Commit 63d0b6d4 by 李伟康

commit 素材日志

1 parent 7cd7af21
...@@ -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' import { receptionTrackMixin } from '@/mixin/index.js'
export default { export default {
components: { components: {
ToolBox, ToolBox,
...@@ -152,10 +152,10 @@ export default { ...@@ -152,10 +152,10 @@ export default {
const { channelType } = uni.$storage.get("userInfo") const { channelType } = uni.$storage.get("userInfo")
return channelType == 2 return channelType == 2
}, },
isPreview(){ isPreview () {
return this.type == 'preview' return this.type == 'preview'
} }
}, },
watch: { watch: {
watchStatus: { watchStatus: {
...@@ -185,6 +185,7 @@ export default { ...@@ -185,6 +185,7 @@ export default {
}) })
this.receptionTrackLeave() this.receptionTrackLeave()
this.$emit('update:id', e.id) this.$emit('update:id', e.id)
uni.$logger.local.info(`预览${e.title}`)
}, },
back () { back () {
this.$refs?.toolRef?.hide() this.$refs?.toolRef?.hide()
...@@ -221,10 +222,11 @@ export default { ...@@ -221,10 +222,11 @@ export default {
if (Math.abs(this.startY - touch.pageY) > 100) return if (Math.abs(this.startY - touch.pageY) > 100) return
if (!scaleValueObject[id]) scaleValueObject[id] = 1 if (!scaleValueObject[id]) scaleValueObject[id] = 1
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, title } = this.getNextId(index, toolList, startX, halfScreenWidth)
this.modeName = modeName this.modeName = modeName
this.receptionTrackLeave() this.receptionTrackLeave()
this.$emit('update:id', nextId) this.$emit('update:id', nextId)
uni.$logger.local.info(`预览${title}`)
setTimeout(() => { setTimeout(() => {
this.modeName = '' this.modeName = ''
}, 500) }, 500)
...@@ -234,25 +236,26 @@ export default { ...@@ -234,25 +236,26 @@ export default {
} }
}, },
getNextId (index, toolList, startX, halfScreenWidth) { getNextId (index, toolList, startX, halfScreenWidth) {
let nextId = '', let nextItem = {},
modeName = '' modeName = ''
if (startX > halfScreenWidth) { if (startX > halfScreenWidth) {
nextId = index === toolList.length - 1 ? toolList[0].id : toolList[index + 1].id; nextItem = index === toolList.length - 1 ? toolList[0] : toolList[index + 1];
modeName = 'to-right' modeName = 'to-right'
} else { } else {
nextId = index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id; nextItem = index === 0 ? toolList[toolList.length - 1] : toolList[index - 1];
modeName = 'to-left' modeName = 'to-left'
} }
return { return {
nextId, nextId: nextItem.id,
modeName modeName,
title: nextItem.title
} }
}, },
scale (e) { scale (e) {
let { id } = this let { id } = this
this.scaleValueObject[id] = e this.scaleValueObject[id] = e
}, },
}, },
}; };
......
<template> <template>
<view> <view>
<home-frame @preview="preview" @start="start" ref="home" :id="id" @openStep="openStep" @backHome="backHome" @changeTab="changeTab"> <home-frame
<view class="module-box" slot="module"> @preview="preview"
@start="start"
ref="home"
:id="id"
@openStep="openStep"
@backHome="backHome"
@changeTab="changeTab"
>
<view
class="module-box"
slot="module"
>
<template v-for="(i, index) in moduleList"> <template v-for="(i, index) in moduleList">
<view :key="index" :class="['item', i.class]" :style="i.style" @click="toDetail(i)" v-if="!i.hide"> <view
:key="index"
:class="['item', i.class]"
:style="i.style"
@click="toDetail(i)"
v-if="!i.hide"
>
<template v-if="i.showAlt"> <template v-if="i.showAlt">
<view class="item-text flex">{{ i.title }}</view> <view class="item-text flex">{{ i.title }}</view>
</template> </template>
<template v-else> <template v-else>
<image class="item-img" :src="i.thumbnail" mode="scaleToFill" @error="errorImg(index)" /> <image
class="item-img"
:src="i.thumbnail"
mode="scaleToFill"
@error="errorImg(index)"
/>
</template> </template>
</view> </view>
</template> </template>
</view> </view>
<template slot="detail"> <template slot="detail">
<detail :id.sync="id" :media="moduleList" :type.sync="type" :toolList="toolList" @back="back" @done="done" ref="detail" /> <detail
:id.sync="id"
:media="moduleList"
:type.sync="type"
:toolList="toolList"
@back="back"
@done="done"
ref="detail"
/>
</template> </template>
<template slot="content"> <template slot="content">
<!-- <novice-guide <!-- <novice-guide
...@@ -42,7 +72,7 @@ import HomeFrame from '@/components/HomeFrame/index.vue' ...@@ -42,7 +72,7 @@ import HomeFrame from '@/components/HomeFrame/index.vue'
export default { export default {
// mixins: [storge], // mixins: [storge],
components: { HomeFrame, detail, NoviceGuide }, components: { HomeFrame, detail, NoviceGuide },
data() { data () {
return { return {
moduleList: [], moduleList: [],
toolList: [], toolList: [],
...@@ -54,12 +84,12 @@ export default { ...@@ -54,12 +84,12 @@ export default {
} }
}, },
computed: { computed: {
channelType() { channelType () {
const { channelType } = uni.$storage.get('userInfo') const { channelType } = uni.$storage.get('userInfo')
return channelType || 1 //默认问界 return channelType || 1 //默认问界
} }
}, },
onBackPress(options) { onBackPress (options) {
if (options.from === 'backbutton') { if (options.from === 'backbutton') {
// 物理返回按钮触发 // 物理返回按钮触发
// 阻止默认行为,即不执行页面返回 // 阻止默认行为,即不执行页面返回
...@@ -69,12 +99,12 @@ export default { ...@@ -69,12 +99,12 @@ export default {
// 其他情况允许正常返回 // 其他情况允许正常返回
return false return false
}, },
onLoad() { onLoad () {
this.setViewInfo() this.setViewInfo()
this.getSoure() this.getSoure()
this.get_Vehicle_Sales_Data() this.get_Vehicle_Sales_Data()
}, },
onShow() { onShow () {
const userInfo = uni.$storage.get('userInfo') const userInfo = uni.$storage.get('userInfo')
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) { if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm('userInfo') uni.$storage.rm('userInfo')
...@@ -88,11 +118,11 @@ export default { ...@@ -88,11 +118,11 @@ export default {
}, },
methods: { methods: {
...mapMutations('audio', ['setReceptionStatus']), ...mapMutations('audio', ['setReceptionStatus']),
init() { init () {
this.findPayInfo() this.findPayInfo()
}, },
/**获取车型&销售数据 */ /**获取车型&销售数据 */
get_Vehicle_Sales_Data() { get_Vehicle_Sales_Data () {
const userInfo = uni.$storage.get('userInfo'), const userInfo = uni.$storage.get('userInfo'),
storageCarBrandList = uni.$storage.get('carBrandList'), storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'), storageEmployeeList = uni.$storage.get('employeeList'),
...@@ -127,7 +157,7 @@ export default { ...@@ -127,7 +157,7 @@ export default {
}) })
}, },
// 查询素材 // 查询素材
async getSoure() { async getSoure () {
/**比亚迪 */ /**比亚迪 */
if (this.channelType == 2) { if (this.channelType == 2) {
let { moduleList, toolList } = await uni.$api.systemApi.getBydMockData(true) let { moduleList, toolList } = await uni.$api.systemApi.getBydMockData(true)
...@@ -184,11 +214,11 @@ export default { ...@@ -184,11 +214,11 @@ export default {
} }
} }
}, },
errorImg(index) { errorImg (index) {
this.moduleList[index].showAlt = true this.moduleList[index].showAlt = true
}, },
async start() { async start () {
if (this.recording) return if (this.recording) return
uni.showLoading({ uni.showLoading({
mask: true mask: true
...@@ -211,22 +241,22 @@ export default { ...@@ -211,22 +241,22 @@ export default {
uni.hideLoading() uni.hideLoading()
}, 1e3) }, 1e3)
}, },
toDetail(item) { toDetail (item) {
uni.$logger.local.info(`预览${item.title}`)
this.chooseItem = item this.chooseItem = item
this.$refs.home.previewRef.open() this.$refs.home.previewRef.open()
}, },
cancel() { cancel () {
this.$refs.home.previewRef.close() this.$refs.home.previewRef.close()
}, },
preview() { preview () {
let { id } = this.chooseItem let { id, title } = this.chooseItem
this.type = 'preview' this.type = 'preview'
this.id = id this.id = id
uni.$logger.local.info(`预览${title}`)
this.cancel() this.cancel()
}, },
// 完成接待 // 完成接待
done(e) { done (e) {
this.$refs.home.finishRef.close() this.$refs.home.finishRef.close()
if (this.recording) this.$refs.home.stopAudio() if (this.recording) this.$refs.home.stopAudio()
this.recording = false this.recording = false
...@@ -238,14 +268,14 @@ export default { ...@@ -238,14 +268,14 @@ export default {
this.$store.dispatch('clearReceptionTrack') this.$store.dispatch('clearReceptionTrack')
}, 1500) }, 1500)
}, },
back() { back () {
const detailRef = this.$refs.detail const detailRef = this.$refs.detail
if (detailRef.showPayPage) return (detailRef.showPayPage = false) if (detailRef.showPayPage) return (detailRef.showPayPage = false)
if (!this.id) return uni.navigateBack() if (!this.id) return uni.navigateBack()
if (this.type != 'preview') return this.$refs.home.finishRef.open() if (this.type != 'preview') return this.$refs.home.finishRef.open()
this.backHome() this.backHome()
}, },
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.id = '' this.id = ''
...@@ -254,23 +284,23 @@ export default { ...@@ -254,23 +284,23 @@ export default {
this.init() this.init()
this.recording = false this.recording = false
}, },
nextStep() { nextStep () {
let { id } = this.moduleList[0] let { id } = this.moduleList[0]
this.type = 'preview' this.type = 'preview'
this.id = id this.id = id
}, },
clearHistory() { clearHistory () {
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') this.$store.dispatch('clearReceptionTrack')
}, },
openStep() { openStep () {
this.$refs.home.finishRef.close() this.$refs.home.finishRef.close()
this.$refs.detail.open() this.$refs.detail.open()
}, },
// 查询门店支付配置 // 查询门店支付配置
async findPayInfo() { async findPayInfo () {
const { shopMerchantId } = uni.$storage.get('userInfo') const { shopMerchantId } = uni.$storage.get('userInfo')
const data = await uni.$api.commonApi.findPayInfo({ const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId merchantId: shopMerchantId
...@@ -294,13 +324,13 @@ export default { ...@@ -294,13 +324,13 @@ export default {
}) })
this.$store.dispatch('setPaymentType', paymentType) this.$store.dispatch('setPaymentType', paymentType)
}, },
changeTab(index) { changeTab (index) {
this.tabIndex = index this.tabIndex = index
if (index == 0) this.init() if (index == 0) this.init()
}, },
/**按序加载车型 */ /**按序加载车型 */
async getCarBrandsList(carBrandList, index) { async getCarBrandsList (carBrandList, index) {
const item = carBrandList[index] const item = carBrandList[index]
if (!item) return if (!item) return
const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`) const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
...@@ -317,7 +347,7 @@ export default { ...@@ -317,7 +347,7 @@ export default {
} }
}, },
/**素材内容 */ /**素材内容 */
setViewInfo(_moduleList, _toolList) { setViewInfo (_moduleList, _toolList) {
if (_moduleList && _toolList) { if (_moduleList && _toolList) {
this.moduleList = _moduleList this.moduleList = _moduleList
this.toolList = _toolList this.toolList = _toolList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!