Feat(页面):页面埋点配置
This commit is contained in:
@@ -57,11 +57,13 @@ import {getAttract, investment, saveAttract} from "@/api/shop.js";
|
||||
// import {
|
||||
// queryByType
|
||||
// } from "@/api/public";
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CitySelect
|
||||
},
|
||||
mixins: [pageListenMixins],
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
@@ -80,7 +82,8 @@ export default {
|
||||
investmentTopImage: null,
|
||||
investmentMainImage: null,
|
||||
investmentBottomImage: null,
|
||||
investmentTitle: ""
|
||||
investmentTitle: "",
|
||||
pageKeyId: Object.freeze('investmentIndex')
|
||||
}
|
||||
},
|
||||
onLoad: function () {
|
||||
|
||||
@@ -22,32 +22,35 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {investmentInfo} from "@/api/shop";
|
||||
|
||||
import {investmentInfo} from '@/api/shop'
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
export default {
|
||||
name: "project",
|
||||
name: 'ProjectDetail',
|
||||
mixins: [pageListenMixins],
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
id: null,
|
||||
info: null
|
||||
info: null,
|
||||
pageKeyId: ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id;
|
||||
this.init();
|
||||
const id = option.id
|
||||
this.id = id
|
||||
this.pageKeyId = `investmentInfo_id_${id}`
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
investmentInfo(this.id).then(({data}) => this.info = data);
|
||||
investmentInfo(this.id).then(({data}) => this.info = data)
|
||||
},
|
||||
|
||||
viewFile(item) {
|
||||
if (item.suffix === "pdf") {
|
||||
if (item.suffix === 'pdf') {
|
||||
uni.downloadFile({
|
||||
url: item.attachment,
|
||||
success: res => {
|
||||
let filePath = res.tempFilePath;
|
||||
const filePath = res.tempFilePath
|
||||
uni.openDocument({
|
||||
filePath
|
||||
})
|
||||
|
||||
@@ -20,26 +20,29 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {investmentInfo, investmentList} from "@/api/shop";
|
||||
import {investmentInfo, investmentList} from '@/api/shop'
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
|
||||
export default {
|
||||
name: "projectList",
|
||||
name: 'ProjectList',
|
||||
mixins: [pageListenMixins],
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
page: 1, // 当前页
|
||||
keyword: "", // 搜索词
|
||||
keyword: '', // 搜索词
|
||||
pages: 0, // 总页数
|
||||
list: [],
|
||||
os: ""
|
||||
os: '',
|
||||
pageKeyId: Object.freeze('investmentList')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getOS();
|
||||
this.getData();
|
||||
this.getOS()
|
||||
this.getData()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.pages >= this.page) this.getData();
|
||||
if (this.pages >= this.page) this.getData()
|
||||
},
|
||||
methods: {
|
||||
getOS() {
|
||||
@@ -47,39 +50,35 @@ export default {
|
||||
success: result => this.os = result.osName
|
||||
})
|
||||
},
|
||||
|
||||
search() {
|
||||
this.list = [];
|
||||
this.page = 1;
|
||||
this.getData();
|
||||
this.list = []
|
||||
this.page = 1
|
||||
this.getData()
|
||||
},
|
||||
|
||||
getData() {
|
||||
investmentList(this.page, this.keyword).then(({data}) => {
|
||||
this.pages = data.pages;
|
||||
this.page++;
|
||||
this.pages = data.pages
|
||||
this.page++
|
||||
if (data.records.length > 0) {
|
||||
data.records.map(item => {
|
||||
this.list.push(item);
|
||||
this.list.push(item)
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
getDetail(id) {
|
||||
investmentInfo(id).then(({data}) => {
|
||||
const file = data.contents[0];
|
||||
if (file.suffix === "pdf" && this.os === "android") {
|
||||
if (file.suffix === 'pdf' && this.os === 'android') {
|
||||
this.viewPdf(file.attachmentFiles[0])
|
||||
} else {
|
||||
let path = file.attachmentFiles[0];
|
||||
uni.navigateTo({
|
||||
url: "/pkg_common/views/pdf?path=" + encodeURI(path)
|
||||
url: '/pkg_common/views/pdf?path=' + encodeURI(path) + '&id=' + id
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
viewPdf(url) {
|
||||
uni.downloadFile({
|
||||
url,//可以是后台传过来的路径
|
||||
@@ -87,13 +86,13 @@ export default {
|
||||
const filePath = res.tempFilePath
|
||||
uni.openDocument({
|
||||
filePath,
|
||||
fileType: "pdf",
|
||||
fileType: 'pdf',
|
||||
success: result => {
|
||||
//成功
|
||||
},
|
||||
fail: err => {
|
||||
uni.showModal({
|
||||
title: "openDocument fail",
|
||||
title: 'openDocument fail',
|
||||
content: JSON.stringify(err)
|
||||
})
|
||||
}
|
||||
@@ -101,7 +100,7 @@ export default {
|
||||
},
|
||||
fail: err => {
|
||||
uni.showModal({
|
||||
title: "downloadFile fail",
|
||||
title: 'downloadFile fail',
|
||||
content: JSON.stringify(err)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user