Commit a6aae4b1 by 李伟康

commit 提交

1 parent b23bfd53
...@@ -91,6 +91,7 @@ export default { ...@@ -91,6 +91,7 @@ export default {
}), }),
{ receptionStartTime, receptionEndTime, endReasonType } = this.audioInfo, { receptionStartTime, receptionEndTime, endReasonType } = this.audioInfo,
{ deviceId: appCode } = uni.getDeviceInfo(), { deviceId: appCode } = uni.getDeviceInfo(),
receptionTrack = this.$store.state.user.receptionTrack,
params = { params = {
staffUuid: uuid, staffUuid: uuid,
staffName: name, staffName: name,
...@@ -112,6 +113,7 @@ export default { ...@@ -112,6 +113,7 @@ export default {
bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改 bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
channelType: channelType || 1 //1问界 2 比亚迪 3 其他 channelType: channelType || 1 //1问界 2 比亚迪 3 其他
} }
console.log(receptionTrack)
return params return params
}, },
/** /**
......
import loginMixin from './loginMixin' import loginMixin from './loginMixin'
import receptionTrackMixin from './receptionTrackMixin'
module.exports = { module.exports = {
loginMixin loginMixin,
receptionTrackMixin
} }
export default {
watch: {
id: {
immediate: true,
handler (key) {
if (!key) return
let item = this.media.find(e => e.id == key),
value = this.receptionTrack[key]
if (value) {
value.openCount += 1
value.entryTime = Date.now()
} else {
value = {
openCount: 1,
name: item.title,
id: item.id,
stayTime: 0,
entryTime: Date.now()
}
}
this.$store.dispatch("setReceptionTrack", { key, value })
}
}
},
computed:{
receptionTrack () {
return this.$store.state.user.receptionTrack
}
},
methods: {
receptionTrackLeave () {
let key = this.id,
value = this.receptionTrack[key]
value.stayTime += Number(((Date.now() - value.entryTime) / 1000).toFixed(2))
this.$store.dispatch("setReceptionTrack", { key, value })
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
<coupon-pop <coupon-pop
:carInfo="carInfo" :carInfo="carInfo"
ref="couponPopup" ref="couponPopup"
@reception="reception"
:customerType="customerType"
/> />
<picture-box :imgUrl="currentImgUrl" /> <picture-box :imgUrl="currentImgUrl" />
<risk-informed-box <risk-informed-box
...@@ -135,7 +137,7 @@ export default { ...@@ -135,7 +137,7 @@ export default {
}[newval] }[newval]
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))
} }
} },
}, },
computed: { computed: {
...@@ -153,7 +155,8 @@ export default { ...@@ -153,7 +155,8 @@ export default {
}, },
couponText () { couponText () {
return this.customerType == 0 ? '查看客户券码' : '为客户发券' return this.customerType == 0 ? '查看客户券码' : '为客户发券'
} },
}, },
methods: { methods: {
...@@ -171,8 +174,10 @@ export default { ...@@ -171,8 +174,10 @@ export default {
this.carInfo = item this.carInfo = item
}, },
showPicture (e) { showPicture (e) {
this.currentImgUrl = e this.currentImgUrl = e
},
reception (e) {
this.$emit('reception', e)
} }
} }
} }
......
...@@ -71,6 +71,7 @@ import { mapMutations } from "vuex"; ...@@ -71,6 +71,7 @@ import { mapMutations } from "vuex";
import invitation from "./invitation.vue"; 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'
export default { export default {
components: { components: {
ToolBox, ToolBox,
...@@ -93,10 +94,13 @@ export default { ...@@ -93,10 +94,13 @@ export default {
tabId: Number, tabId: Number,
currentCar: String currentCar: String
}, },
mixins: [receptionTrackMixin],
data () { data () {
return { return {
}; };
}, },
watch: {
},
computed: { computed: {
title () { title () {
let { id } = this, let { id } = this,
...@@ -122,20 +126,22 @@ export default { ...@@ -122,20 +126,22 @@ export default {
ref.closeAllPopup && ref.closeAllPopup() ref.closeAllPopup && ref.closeAllPopup()
} }
}) })
this.receptionTrackLeave()
this.jumpPage({ id: e.id }) this.jumpPage({ id: e.id })
}, },
back () { back () {
this.$refs?.toolRef?.hide(); this.$refs?.toolRef?.hide();
// this.$emit("back"); // this.$emit("back");
if(this.id == 1) { if (this.id == 1) {
let [reception] = this.$refs.media1 let [reception] = this.$refs.media1
if(reception.currentImgUrl) reception.showPicture('') if (reception.currentImgUrl) reception.showPicture('')
else this.$emit("back"); 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.$emit("done", e); this.$emit("done", e);
}, },
jumpPage ({ id }) { jumpPage ({ id }) {
...@@ -171,7 +177,7 @@ export default { ...@@ -171,7 +177,7 @@ export default {
icon: 'none' icon: 'none'
}) })
}, 1e3) }, 1e3)
} },
}, },
}; };
</script> </script>
......
...@@ -309,6 +309,7 @@ export default { ...@@ -309,6 +309,7 @@ export default {
clearHistory () { clearHistory () {
this.$store.dispatch("clearCustomerInfo"); this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory"); this.$store.dispatch("clearHistory");
this.$store.dispatch('clearReceptionTrack')
}, },
openStep () { openStep () {
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
...@@ -332,8 +333,12 @@ export default { ...@@ -332,8 +333,12 @@ export default {
setTimeout(() => { setTimeout(() => {
this.id = ""; this.id = "";
this.type = ""; this.type = "";
this.currentCar = ''
this.bannerAutoplay = true
this.customerType = -1
this.setReceptionStatus(e); this.setReceptionStatus(e);
this.$store.dispatch("clearHistory") this.$store.dispatch("clearHistory")
this.$store.dispatch('clearReceptionTrack')
}, 1500); }, 1500);
}, },
changeTab (index) { changeTab (index) {
......
...@@ -91,7 +91,7 @@ import FinishStep from '@/components/FinishStep.vue'; ...@@ -91,7 +91,7 @@ import FinishStep from '@/components/FinishStep.vue';
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import informationEntry from './components/informationEntry.vue' import informationEntry from './components/informationEntry.vue'
import insurance from '@/components/Insurance/Insurance.vue' import insurance from '@/components/Insurance/Insurance.vue'
import {receptionTrackMixin} from '@/mixin/index.js'
export default { export default {
components: { components: {
ToolBox, ToolBox,
...@@ -114,6 +114,7 @@ export default { ...@@ -114,6 +114,7 @@ export default {
}, },
toolList: Array toolList: Array
}, },
mixins: [receptionTrackMixin],
data () { data () {
return { return {
drawStatus: false, drawStatus: false,
...@@ -150,7 +151,8 @@ export default { ...@@ -150,7 +151,8 @@ export default {
isByd () { isByd () {
const { channelType } = uni.$storage.get("userInfo") const { channelType } = uni.$storage.get("userInfo")
return channelType == 2 return channelType == 2
} },
}, },
watch: { watch: {
watchStatus: { watchStatus: {
...@@ -178,6 +180,7 @@ export default { ...@@ -178,6 +180,7 @@ export default {
ref.closeAllPopup && ref.closeAllPopup() ref.closeAllPopup && ref.closeAllPopup()
} }
}) })
this.receptionTrackLeave()
this.$emit('update:id', e.id) this.$emit('update:id', e.id)
}, },
back () { back () {
...@@ -203,7 +206,7 @@ export default { ...@@ -203,7 +206,7 @@ export default {
} }
}, },
touchEnd (e) { touchEnd (e) {
if(this.modeName) return if (this.modeName) return
try { try {
let { toolList, drawStatus, startX, screenWidth, id, scaleValueObject, productModelStatus } = this let { toolList, drawStatus, startX, screenWidth, id, scaleValueObject, productModelStatus } = this
if (!e || !e.changedTouches || drawStatus || toolList.length == 0 || e.changedTouches.length === 0) return if (!e || !e.changedTouches || drawStatus || toolList.length == 0 || e.changedTouches.length === 0) return
...@@ -216,6 +219,7 @@ export default { ...@@ -216,6 +219,7 @@ export default {
if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1 && !productModelStatus) { if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1 && !productModelStatus) {
const { nextId, modeName } = this.getNextId(index, toolList, startX, halfScreenWidth) const { nextId, modeName } = this.getNextId(index, toolList, startX, halfScreenWidth)
this.modeName = modeName this.modeName = modeName
this.receptionTrackLeave()
this.$emit('update:id', nextId) this.$emit('update:id', nextId)
setTimeout(() => { setTimeout(() => {
this.modeName = '' this.modeName = ''
...@@ -243,7 +247,8 @@ export default { ...@@ -243,7 +247,8 @@ export default {
scale (e) { scale (e) {
let { id } = this let { id } = this
this.scaleValueObject[id] = e this.scaleValueObject[id] = e
} },
}, },
}; };
......
...@@ -269,6 +269,7 @@ export default { ...@@ -269,6 +269,7 @@ export default {
this.type = ""; this.type = "";
this.setReceptionStatus(e); this.setReceptionStatus(e);
this.$store.dispatch("clearHistory") this.$store.dispatch("clearHistory")
this.$store.dispatch('clearReceptionTrack')
}, 1500); }, 1500);
}, },
back () { back () {
...@@ -296,6 +297,7 @@ export default { ...@@ -296,6 +297,7 @@ export default {
this.$store.dispatch("clearCustomerInfo"); this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory"); this.$store.dispatch("clearHistory");
this.$refs.home.setBooks([]); this.$refs.home.setBooks([]);
this.$store.dispatch('clearReceptionTrack')
}, },
openStep () { openStep () {
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
......
...@@ -28,7 +28,8 @@ export default { ...@@ -28,7 +28,8 @@ export default {
M5: [], M5: [],
M7: [], M7: [],
M9: [] M9: []
} },
receptionTrack: {} //接待记录埋点
}; };
}, },
mutations: { mutations: {
...@@ -77,5 +78,12 @@ export default { ...@@ -77,5 +78,12 @@ export default {
setEmployeeList ({ state }, value) { setEmployeeList ({ state }, value) {
state.employeeList = value; state.employeeList = value;
}, },
setReceptionTrack ({ state }, { key, value }) {
console.log(value)
state.receptionTrack[key] = value
},
clearReceptionTrack ({ state }) {
state.receptionTrack = {}
},
}, },
}; };
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!