Commit e9054968 by 李伟康

commit 提交

1 parent 596529b8
...@@ -109,17 +109,12 @@ ...@@ -109,17 +109,12 @@
></video> ></video>
</view> </view>
</view> </view>
<preview
ref="preview"
isComponents
:show="showPreview"
/>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import preview from './preview.vue'
export default { export default {
components: { preview },
name: 'case', name: 'case',
data () { data () {
return { return {
...@@ -129,7 +124,6 @@ export default { ...@@ -129,7 +124,6 @@ export default {
popupShow: false, popupShow: false,
isSearch: false, isSearch: false,
videoSrc: '', videoSrc: '',
showPreview: false,
isSelect: false, isSelect: false,
selectIndex: '全部', selectIndex: '全部',
selectList: [ selectList: [
...@@ -168,12 +162,7 @@ export default { ...@@ -168,12 +162,7 @@ export default {
}, },
methods: { methods: {
playVideo (item) { playVideo (item) {
const { tabName, sourceType, detailUrl } = item this.$emit('preview',item)
console.log(this.$refs.preview)
// this.showPreview = true
// uni.navigateTo({
// url: `/pages/boutique/preview?tabName=${tabName}&sourceType=${sourceType}&detailUrl=${detailUrl}`
// })
}, },
focus () { focus () {
this.isSearch = true this.isSearch = true
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
position: absolute; position: absolute;
top: 0; top: 0;
width: 100%; width: 100%;
z-index: 99; z-index: 998;
min-height: 100vh; min-height: 100vh;
background-color: #fff; background-color: #fff;
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<view class="sprite-icon icon-info_shield"></view> <view class="sprite-icon icon-info_shield"></view>
</view> </view>
<view class="content-box flex"> <view class="content-box flex">
<template v-if="currentItem.modelDisplayPicurl"> <template v-if="currentItem && currentItem.modelDisplayPicurl">
<view <view
class="left-content" class="left-content"
:key="updateViewKey" :key="updateViewKey"
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
@reception="reception" @reception="reception"
:show="show" :show="show"
/> />
<picture-box :imgUrl="currentImgUrl" />
<risk-informed-box <risk-informed-box
ref="riskInformedPop" ref="riskInformedPop"
:popupImg="popupImg" :popupImg="popupImg"
...@@ -81,14 +80,13 @@ ...@@ -81,14 +80,13 @@
import SkuBox from './SkuBox.vue' import SkuBox from './SkuBox.vue'
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import CouponPop from './CouponPop.vue' import CouponPop from './CouponPop.vue'
import PictureBox from './Picture.vue'
import RiskInformedBox from './RiskInformedBox.vue' import RiskInformedBox from './RiskInformedBox.vue'
const m5 = require("@/assets/images/boutique/index/m5.webp") const m5 = require("@/assets/images/boutique/index/m5.webp")
const m7 = require("@/assets/images/boutique/index/m7.webp") const m7 = require("@/assets/images/boutique/index/m7.webp")
const m9 = require("@/assets/images/boutique/index/m9.webp") const m9 = require("@/assets/images/boutique/index/m9.webp")
export default { export default {
name: 'Reception', name: 'Reception',
components: { SkuBox, CarBrands, CouponPop, PictureBox, RiskInformedBox }, components: { SkuBox, CarBrands, CouponPop, RiskInformedBox },
props: { props: {
customerType: Number, customerType: Number,
show: Boolean, show: Boolean,
...@@ -105,7 +103,7 @@ export default { ...@@ -105,7 +103,7 @@ export default {
updateViewKey: Date.now(), updateViewKey: Date.now(),
carInfo: {}, carInfo: {},
currentImgUrl: '', currentImgUrl: '',
currentItem: {} currentItem: null
} }
}, },
watch: { watch: {
...@@ -132,9 +130,18 @@ export default { ...@@ -132,9 +130,18 @@ export default {
if (this.show && newval && !this.isPreview && this.customerType == 1) this.$refs.carBrandRef.autoSelect(this.carList.findIndex(e => e == newval)) if (this.show && newval && !this.isPreview && this.customerType == 1) this.$refs.carBrandRef.autoSelect(this.carList.findIndex(e => e == newval))
} }
}, },
watchStatus: {
immediate: true,
handler (newval) {
this.currentItem = null
}
}
}, },
computed: { computed: {
watchStatus () {
return this.$store.state.user.historyStatus;
},
watchCustomerInfo () { watchCustomerInfo () {
return this.$store.state.user.customerInfo return this.$store.state.user.customerInfo
}, },
...@@ -166,21 +173,15 @@ export default { ...@@ -166,21 +173,15 @@ export default {
this.updateViewKey = Date.now() this.updateViewKey = Date.now()
}, },
changePreView (e) { changePreView (e) {
this.currentItem = e let { currentItem } = this,
this.updateViewKey = Date.now() { id, carModelName, name } = e,
},
handleSelect (item) {
this.customerInfo.carModel = item.name
this.$store.dispatch('setCustomerInfo', this.customerInfo)
this.carInfo = item
},
showPicture (off = true) {
let { detailPicurl, id, carModelName, name } = this.currentItem,
key = `${carModelName}_${id}`, key = `${carModelName}_${id}`,
value = this.receptionTrack[key] value = this.receptionTrack[key]
this.currentImgUrl = off ? detailPicurl : '' if (currentItem) this.previewLeave(currentItem)
if (!detailPicurl || this.isPreview) return
if (off) { this.currentItem = e
this.updateViewKey = Date.now()
if (this.isPreview) return
if (value) { if (value) {
value.openCount += 1 value.openCount += 1
value.entryTime = Date.now() value.entryTime = Date.now()
...@@ -193,9 +194,17 @@ export default { ...@@ -193,9 +194,17 @@ export default {
entryTime: Date.now() entryTime: Date.now()
} }
} }
} else value.stayDuration += Number(Date.now() - value.entryTime)
this.$store.dispatch("setReceptionTrack", { key, value }) this.$store.dispatch("setReceptionTrack", { key, value })
}, },
handleSelect (item) {
this.customerInfo.carModel = item.name
this.$store.dispatch('setCustomerInfo', this.customerInfo)
this.carInfo = item
},
showPicture (off = true) {
let { detailPicurl } = this.currentItem
this.currentImgUrl = off ? detailPicurl : ''
},
reception (e) { reception (e) {
this.clearCustomerReceivedTimer() this.clearCustomerReceivedTimer()
this.$emit('reception', e) this.$emit('reception', e)
...@@ -205,6 +214,17 @@ export default { ...@@ -205,6 +214,17 @@ export default {
clearInterval(this.couponPopupRef.pageParams.qrTimer) clearInterval(this.couponPopupRef.pageParams.qrTimer)
this.couponPopupRef.pageParams.qrTimer = null this.couponPopupRef.pageParams.qrTimer = null
} }
},
closeAllPopup () {
this.$refs.riskInformedPop.close()
this.$refs.couponPopup.close()
},
previewLeave (currentItem) {
if (this.isPreview) return
let key = `${currentItem.carModelName}_${currentItem.id}`,
value = this.receptionTrack[key]
value.stayDuration += Number(Date.now() - value.entryTime)
this.$store.dispatch("setReceptionTrack", { key, value })
} }
} }
} }
......
...@@ -116,7 +116,6 @@ export default { ...@@ -116,7 +116,6 @@ export default {
defaultTabId: { defaultTabId: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
console.log(newval)
if (this.show) this.tabId = newval if (this.show) this.tabId = newval
} }
}, },
...@@ -208,7 +207,8 @@ export default { ...@@ -208,7 +207,8 @@ export default {
this.thirdlyIndex = index this.thirdlyIndex = index
this.getGoodsList() this.getGoodsList()
}, },
changeGoods (item, index) { changeGoods (item, index, filter = true) {
if(filter && this.goodsIndex == index) return
this.goodsIndex = index this.goodsIndex = index
this.currentItem = item this.currentItem = item
this.changePreView() this.changePreView()
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
this.flagObject.goodsFlag = true this.flagObject.goodsFlag = true
this.flagObject.scrollTop = 1 this.flagObject.scrollTop = 1
this.setScrollHeight() this.setScrollHeight()
this.changeGoods(goodsList[0], 0) this.changeGoods(goodsList[0], 0, false)
}) })
}, },
changePreView () { changePreView () {
...@@ -376,9 +376,10 @@ export default { ...@@ -376,9 +376,10 @@ export default {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
line-height: 44rpx; line-height: 44rpx;
margin-bottom: 8rpx;
} }
.goods-description { .goods-description {
margin-top: 8rpx;
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
line-height: 36rpx; line-height: 36rpx;
......
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
color="#000" color="#000"
></uni-icons> ></uni-icons>
</view> </view>
<view class="title" v-if="id != 1">{{ title }}</view> <view
class="title"
v-if="id != 1"
>{{ title }}</view>
</view> </view>
<template v-for="(item, index) in media"> <template v-for="(item, index) in media">
<view <view
...@@ -39,6 +42,7 @@ ...@@ -39,6 +42,7 @@
:currentCar="currentCar" :currentCar="currentCar"
:type="type" :type="type"
:popupImg="item.popupImg" :popupImg="item.popupImg"
@preview="onPreview"
/> />
</view> </view>
</template> </template>
...@@ -60,6 +64,14 @@ ...@@ -60,6 +64,14 @@
:customerType="customerType" :customerType="customerType"
@back="backInvitation" @back="backInvitation"
/> />
<picture-box :imgUrl="currentImgUrl($refs.media1)" />
<preview
ref="preview"
isComponents
:show.sync="showPreview"
:mediaObject="mediaObject"
@previewBack="onPreviewBack"
/>
</view> </view>
</template> </template>
<script> <script>
...@@ -72,6 +84,8 @@ import invitation from "./invitation.vue"; ...@@ -72,6 +84,8 @@ import invitation from "./invitation.vue";
import Case from "./case.vue"; import Case from "./case.vue";
import history from "./history.vue"; import history from "./history.vue";
import { receptionTrackMixin } from '@/mixin/index.js' import { receptionTrackMixin } from '@/mixin/index.js'
import PictureBox from './components/Picture.vue'
import preview from './preview.vue'
export default { export default {
components: { components: {
ToolBox, ToolBox,
...@@ -80,7 +94,9 @@ export default { ...@@ -80,7 +94,9 @@ export default {
Reception, Reception,
invitation, invitation,
Case, Case,
history history,
PictureBox,
preview
}, },
props: { props: {
id: [String, Number], id: [String, Number],
...@@ -97,6 +113,8 @@ export default { ...@@ -97,6 +113,8 @@ export default {
mixins: [receptionTrackMixin], mixins: [receptionTrackMixin],
data () { data () {
return { return {
showPreview: false,
mediaObject: null
}; };
}, },
watch: { watch: {
...@@ -110,8 +128,12 @@ export default { ...@@ -110,8 +128,12 @@ export default {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus; return this.$store.state.user.historyStatus;
}, },
receptionTrack () {
return this.$store.state.user.receptionTrack
}
},
mounted () {
}, },
mounted () { },
methods: { methods: {
...mapMutations("audio", ["setReceptionStatus"]), ...mapMutations("audio", ["setReceptionStatus"]),
open () { open () {
...@@ -131,18 +153,16 @@ export default { ...@@ -131,18 +153,16 @@ export default {
}, },
back () { back () {
this.$refs?.toolRef?.hide(); this.$refs?.toolRef?.hide();
// this.$emit("back"); let [receptionRef] = this.$refs.media1
if (this.id == 1) { if (this.id == 1 && receptionRef.currentImgUrl) receptionRef.showPicture(false)
let [reception] = this.$refs.media1
if (reception.currentImgUrl) reception.showPicture(false)
else this.$emit("back"); else this.$emit("back");
} else this.$emit("back");
}, },
done (e) { done (e) {
this.$refs.toolRef.hide(); this.$refs.toolRef.hide();
this.$refs.stepRef.close(); this.$refs.stepRef.close();
this.receptionTrackLeave() this.receptionTrackLeave()
this.$emit("done", e); this.$emit("done", e);
this.clearCustomerReceivedTimer()
}, },
jumpPage ({ id }) { jumpPage ({ id }) {
this.$emit("update:id", Number(id)); this.$emit("update:id", Number(id));
...@@ -179,6 +199,47 @@ export default { ...@@ -179,6 +199,47 @@ export default {
}) })
}, 1e3) }, 1e3)
}, },
clearCustomerReceivedTimer () {
this.$refs.media1[0].clearCustomerReceivedTimer()
},
currentImgUrl (receptionRef) {
return receptionRef ? receptionRef[0].currentImgUrl : ''
},
onPreview (item) {
const { materialUrl, materialFormat, name, id } = item
this.mediaObject = {
...item,
tabName: name,
sourceType: materialFormat == 1 ? 2 : 1,
detailUrl: materialUrl
}
this.showPreview = true
if (this.type == 'preview') return
let key = `case-${materialFormat}-${id}`,
value = this.receptionTrack[key]
if (value) {
value.openCount += 1
value.entryTime = Date.now()
} else {
value = {
openCount: 1,
materialName: name,
materialId: `case-${id}`,
stayDuration: 0,
entryTime: Date.now()
}
}
this.$store.dispatch("setReceptionTrack", { key, value })
},
onPreviewBack () {
this.showPreview = false
if (this.type == 'preview') return
const { materialFormat, id } = this.mediaObject,
key = `case-${materialFormat}-${id}`,
value = this.receptionTrack[key]
value.stayDuration += Number(Date.now() - value.entryTime)
this.$store.dispatch("setReceptionTrack", { key, value })
}
}, },
}; };
</script> </script>
...@@ -192,7 +253,7 @@ export default { ...@@ -192,7 +253,7 @@ export default {
height: 96rpx; height: 96rpx;
left: 0; left: 0;
top: 48rpx; top: 48rpx;
z-index: 9; z-index: 999;
pointer-events: none; pointer-events: none;
.back { .back {
height: 100%; height: 100%;
......
...@@ -295,6 +295,7 @@ export default { ...@@ -295,6 +295,7 @@ export default {
backHome () { backHome () {
if (this.recording) this.$refs.home.stopAudio(true); if (this.recording) this.$refs.home.stopAudio(true);
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
this.$refs.detail.clearCustomerReceivedTimer()
this.id = ""; this.id = "";
this.type = ""; this.type = "";
this.currentCar = '' this.currentCar = ''
......
...@@ -41,7 +41,8 @@ import report from "@/mixin/report.js"; ...@@ -41,7 +41,8 @@ import report from "@/mixin/report.js";
export default { export default {
props: { props: {
isComponents: Boolean, isComponents: Boolean,
show: Boolean show: Boolean,
mediaObject: Object
}, },
data () { data () {
return { return {
...@@ -51,12 +52,23 @@ export default { ...@@ -51,12 +52,23 @@ export default {
detailUrl: '' detailUrl: ''
} }
}, },
watch:{
show:{
immediate: true,
handler (n) {
if (n) {
console.log(this.mediaObject)
this.init(this.mediaObject)
}
}
}
},
computed: { computed: {
popupShow () { popupShow () {
let status = true let status = true
if (this.isComponents) status = this.show if (this.isComponents) status = this.show
return status return status
} },
}, },
mixins: [report], mixins: [report],
onLoad (options) { onLoad (options) {
...@@ -83,9 +95,9 @@ export default { ...@@ -83,9 +95,9 @@ export default {
}); });
}, },
back () { back () {
if (this.isComponents) this.$emit('update:show', false) if (this.isComponents) this.$emit('previewBack')
else uni.navigateBack() else uni.navigateBack()
} },
} }
} }
</script> </script>
...@@ -98,7 +110,7 @@ export default { ...@@ -98,7 +110,7 @@ export default {
height: 100vh; height: 100vh;
background: #000; background: #000;
padding: 60rpx 0rpx; padding: 60rpx 0rpx;
z-index: 100; z-index: 999;
.nav-bar { .nav-bar {
width: 100%; width: 100%;
height: 96rpx; height: 96rpx;
......
...@@ -79,8 +79,8 @@ export default { ...@@ -79,8 +79,8 @@ export default {
state.employeeList = value; state.employeeList = value;
}, },
setReceptionTrack ({ state }, { key, value }) { setReceptionTrack ({ state }, { key, value }) {
console.log(value,'触发埋点')
state.receptionTrack[key] = value state.receptionTrack[key] = value
console.log(state.receptionTrack,'触发埋点')
}, },
clearReceptionTrack ({ state }) { clearReceptionTrack ({ state }) {
state.receptionTrack = {} state.receptionTrack = {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!