Commit a7b6720d by 前端

埋点

1 parent 13ceb338
export default {
data() {
return {
goodsId: '',
visitsId: ''
}
},
onLoad(options) {
this.visitsId = options.visitsId
this.goodsId = options.id
this.addRecord()
},
methods: {
addRecord() {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
visitsId: this.visitsId
}
uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res
})
}
},
onUnload() {
const params = {
id: this.addId,
visitsId: this.visitsId
}
uni.$api.commonApi.leaveRecord(params).then(res => {
console.log(res, 888)
})
}
}
......@@ -7,19 +7,13 @@
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video
ref="videoPlayer"
:src="detailUrl"
controls
v-if="sourceType == 2"
></video>
<view class="img-detail" v-else
><image @click="back" :src="detailUrl" :style="{ width: width + 'px' }"
/></view>
<video ref="videoPlayer" :src="detailUrl" controls v-if="sourceType == 2"></video>
<view class="img-detail" v-else><image @click="back" :src="detailUrl" :style="{ width: width + 'px' }" /></view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import report from "@/mixin/report.js";
export default {
data () {
return {
......@@ -29,6 +23,7 @@ export default {
detailUrl: ''
}
},
mixins:[report],
onLoad (options) {
const {tabName,sourceType,detailUrl} = options
this.title = tabName
......
<template>
<view class="case-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
{{ caseObject.title }}
</view>
<view class="case-content">
<view class="left-menu">
<view class="title">方案目录</view>
<scroll-view
scroll-y
class="scroll"
:scroll-into-view="`menu-${currentId}`"
@scroll="menuScroll"
>
<view
class="scroll-content"
id="scroll-content"
>
<scroll-view scroll-y class="scroll" :scroll-into-view="`menu-${currentId}`" @scroll="menuScroll">
<view class="scroll-content" id="scroll-content">
<template v-for="(item, index) in detailInfo">
<view
class="item"
:key="index"
>
<view
:class="['name', isLast(index), isActive(item)]"
@click="menuClick(item)"
>
<view
class="text"
:id="`menu-${item.id}`"
>{{ item.headings }}</view>
<view class="item" :key="index">
<view :class="['name', isLast(index), isActive(item)]" @click="menuClick(item)">
<view class="text" :id="`menu-${item.id}`">{{ item.headings }}</view>
</view>
<template v-if="item.children && item.children.length">
<template v-for="(i, j) in item.children">
<view
:class="['name', isLast(index, j, item.children), isActive(i)]"
:key="j"
@click="menuClick(i)"
>
<view
class="text"
:id="`menu-${i.id}`"
>
<view :class="['name', isLast(index, j, item.children), isActive(i)]" :key="j" @click="menuClick(i)">
<view class="text" :id="`menu-${i.id}`">
<view class="icon"></view>
{{ i.headings }}
</view>
......@@ -60,78 +29,36 @@
</view>
</template>
<template v-if="currentId">
<view
class="block"
:style="blockTop"
></view>
<view class="block" :style="blockTop"></view>
</template>
</view>
</scroll-view>
</view>
<scroll-view
class="right-content"
scroll-y
:scroll-into-view="`case-${contentId}`"
@scroll="contentScroll"
scroll-with-animation
enable-flex
>
<scroll-view class="right-content" scroll-y :scroll-into-view="`case-${contentId}`" @scroll="contentScroll" scroll-with-animation enable-flex>
<template v-for="(item, index) in detailInfo">
<view
class="detail-item"
:key="item.id"
>
<view
class="item-title"
:id="`case-${item.id}`"
>{{ item.headings }}</view>
<view class="detail-item" :key="item.id">
<view class="item-title" :id="`case-${item.id}`">{{ item.headings }}</view>
<template v-if="item.audio">
<audio-component
:src="item.audio"
@onPlay="onPlay(item.id)"
:ref="`audio-${item.id}`"
/>
<audio-component :src="item.audio" @onPlay="onPlay(item.id)" :ref="`audio-${item.id}`" />
</template>
<view class="item-content">
<rich-text :nodes="item.content"></rich-text>
</view>
<template v-for="(i, ind) in item.pictureList">
<image
:key="`img-${index}-${ind}`"
:src="i"
class="item-img"
mode="widthFix"
@load="imgLoad"
></image>
<image :key="`img-${index}-${ind}`" :src="i" class="item-img" mode="widthFix" @load="imgLoad"></image>
</template>
<template v-if="item.children && item.children.length">
<template v-for="(i, s) in item.children">
<view
class="sub-item-content"
:key="s"
>
<view
class="item-title sub-item-title flex"
:id="`case-${i.id}`"
>{{ i.headings }}</view>
<view class="sub-item-content" :key="s">
<view class="item-title sub-item-title flex" :id="`case-${i.id}`">{{ i.headings }}</view>
<template v-if="i.audio">
<audio-component
:src="i.audio"
@onPlay="onPlay(i.id)"
:ref="`audio-${i.id}`"
/>
<audio-component :src="i.audio" @onPlay="onPlay(i.id)" :ref="`audio-${i.id}`" />
</template>
<view class="item-content">
<rich-text :nodes="i.content"></rich-text>
</view>
<template v-for="(c, k) in i.pictureList">
<image
:key="k"
:src="c"
class="item-img"
mode="widthFix"
@load="imgLoad"
></image>
<image :key="k" :src="c" class="item-img" mode="widthFix" @load="imgLoad"></image>
</template>
</view>
</template>
......@@ -147,12 +74,14 @@
<script type="text/ecmascript-6">
import AudioComponent from './components/AudioComponent.vue'
import report from "@/mixin/report.js";
const view_padding_top = 88,
menuHeight = 68
export default {
components: {
AudioComponent
},
mixins: [report],
data () {
return {
detailInfo: [],
......@@ -167,10 +96,7 @@ export default {
}
},
onLoad (options) {
this.visitsId = options.visitsId
this.goodsId = options.id
this.getMaterialDetail(options.id)
this.addRecord()
},
watch: {
currentId (n) {
......@@ -184,30 +110,7 @@ export default {
},
computed: {
},
onUnload () {
const params = {
id: this.addId,
visitsId: this.visitsId
}
uni.$api.commonApi.leaveRecord(params).then(res => {
console.log(res, 888)
})
},
methods: {
addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
visitsId: this.visitsId
}
uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res
console.log(this.addId, 'this.addId')
})
},
async getMaterialDetail (id) {
try {
......
......@@ -237,7 +237,7 @@ export default {
if (item.type != 3) {
let fileUrl = item?.detailInfos[0]?.image
if (item.type == 2) url = `/pages/common/webview?url=${fileUrl}&title=${item.title}`
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}`
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&id=${item.id}&visitsId=${this.visitsId}`
}
uni.navigateTo({
url: `${url}`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!