Commit 63d0b6d4 by 李伟康

commit 素材日志

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