Commit 29309f7d by 前端

Merge branch 'SAAS+V4.46' into 'master'

上线合并

See merge request !17
2 parents 198fed9f 190dece2
...@@ -4,20 +4,24 @@ ...@@ -4,20 +4,24 @@
"version" : "0.0", "version" : "0.0",
"configurations" : [ "configurations" : [
{ {
"app-plus" : { "app-plus" :
"launchtype" : "remote" {
}, "launchtype" : "local"
"default" : { },
"launchtype" : "local" "default" :
}, {
"h5" : { "launchtype" : "local"
"launchtype" : "local" },
}, "h5" :
"mp-weixin" : { {
"launchtype" : "local" "launchtype" : "local"
}, },
"provider" : "aliyun", "mp-weixin" :
"type" : "uniCloud" {
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud"
}, },
{ {
"playground" : "standard", "playground" : "standard",
......
...@@ -34,6 +34,14 @@ module.exports = { ...@@ -34,6 +34,14 @@ module.exports = {
...data ...data
}) })
}, },
searchRecordingEndTime(data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.customer.searchRecordingEndTime',
projectName: 'boutique',
...data
})
},
getToken(data) { getToken(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.recepiton.customer.oss.getToken', method: 'dj.api.smartcarlife.recepiton.customer.oss.getToken',
......
...@@ -970,7 +970,7 @@ export default { ...@@ -970,7 +970,7 @@ export default {
position: absolute; position: absolute;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
pointer-events: none; pointer-events: none;
z-index: 9; z-index: 99;
} }
.draw-canvas { .draw-canvas {
pointer-events: auto; pointer-events: auto;
......
...@@ -47,6 +47,21 @@ ...@@ -47,6 +47,21 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: 'CarBrands', name: 'CarBrands',
props: {
carBrandKey: {//品牌key
type: String,
default: 'carBrand'
},
carModelKey: {//车型key
type: String,
default: 'carModel'
},
echoData: {
type: Object,
default: () => ({})
},
customBoolean: Boolean
},
data () { data () {
return { return {
carlist: [], carlist: [],
...@@ -68,13 +83,13 @@ export default { ...@@ -68,13 +83,13 @@ export default {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
carModel () { carModel () {
return this.$store.state.user.customerInfo.carModel return this.customBoolean ? this.echoData[this.carModelKey] : this.$store.state.user.customerInfo.carModel
}, },
carBrandList () { carBrandList () {
return this.$store.state.user.carBrands || [] return this.$store.state.user.carBrands || []
}, },
carBrand () { carBrand () {
return this.$store.state.user.customerInfo.carBrand return this.customBoolean ? this.echoData[this.carBrandKey] : this.$store.state.user.customerInfo.carBrand
}, },
boutiqueDefaultCarBrandId () { boutiqueDefaultCarBrandId () {
return this.$store.state.user.boutiqueDefaultCarBrandId return this.$store.state.user.boutiqueDefaultCarBrandId
...@@ -127,7 +142,7 @@ export default { ...@@ -127,7 +142,7 @@ export default {
}, },
selectCar (e, auto = false, index, autoHideLoading = true) { selectCar (e, auto = false, index, autoHideLoading = true) {
let { clickFlga } = this let { clickFlga } = this
if (clickFlga) return if (clickFlga) return
this.clickFlga = true this.clickFlga = true
this.selectItem = { this.selectItem = {
carBrand: e.brandName, carBrand: e.brandName,
...@@ -192,19 +207,19 @@ export default { ...@@ -192,19 +207,19 @@ export default {
.select-box { .select-box {
margin: 40rpx 0; margin: 40rpx 0;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 20rpx; gap: 32rpx;
overflow-y: scroll; overflow-y: scroll;
max-height: 50vh; max-height: 50vh;
padding-bottom: 60rpx; padding-bottom: 60rpx;
.select-item { .select-item {
text-align: center; text-align: center;
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 44rpx;
opacity: 1; opacity: 1;
border: 2rpx solid #dce0e6; border: 2rpx solid #dce0e6;
color: #292d33; color: #333;
font-size: 28rpx; font-size: 32rpx;
border-radius: 8rpx; border-radius: 8rpx;
&.checked { &.checked {
border: 2rpx solid #292d33; border: 2rpx solid #292d33;
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
ref="customerTagstVisible" ref="customerTagstVisible"
position="bottom" position="bottom"
:isFooter="false" :isFooter="false"
title="请选择客户标签" :title="title"
:maxHeight="1000" :maxHeight="1040"
@close="$emit('close')" @close="$emit('close')"
> >
<view class="select-views"> <view class="select-views">
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<view class="select-title">{{ i.labelName }}</view> <view class="select-title">{{ i.labelName }}</view>
<view class="select-box"> <view class="select-box">
<view <view
class="select-item" class="select-item flex"
:class="{ checked: checkedItem(item) }" :class="{ checked: checkedItem(item) }"
@click="handleSelect(item)" @click="handleSelect(item)"
v-for="(item, ind) in i.nextList" v-for="(item, ind) in i.nextList"
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
<view class="footer-btns"> <view class="footer-btns">
<view <view
class="btn cancel" class="btn cancel"
@click="close" @click="clearSwitch ? clear() : close()"
>取消</view> >{{cancelText}}</view>
<view <view
:class="['btn',{disabled:component_chooseList.length == 0}]" :class="['btn',{disabled: disabled}]"
@click="choose" @click="choose"
>确定</view> >确定</view>
</view> </view>
...@@ -47,7 +47,27 @@ ...@@ -47,7 +47,27 @@
export default { export default {
name: 'CustomerTags', name: 'CustomerTags',
props: { props: {
chooseList: Array chooseList: Array,
title: {
type: String,
default: '请选择客户标签'
},
disabledSwitch: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: '取消'
},
clearSwitch: {
type: Boolean,
default: false
},
sceneNumber: {
type: [Number, String],
default: -1
}
}, },
data () { data () {
return { return {
...@@ -73,6 +93,9 @@ export default { ...@@ -73,6 +93,9 @@ export default {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
disabled () {
return this.disabledSwitch && this.component_chooseList.length == 0
}
}, },
mounted () { mounted () {
}, },
...@@ -80,10 +103,11 @@ export default { ...@@ -80,10 +103,11 @@ export default {
open () { open () {
this.$refs.customerTagstVisible.open() this.$refs.customerTagstVisible.open()
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ sceneType } = userInfo; { sceneType } = userInfo,
{ sceneNumber } = this
uni.$api.customerApi uni.$api.customerApi
.findCustomerTags({ .findCustomerTags({
scene: sceneType, scene: sceneNumber > -1 ? sceneNumber : sceneType,
}) })
.then((res) => { .then((res) => {
this.list = res || [] this.list = res || []
...@@ -105,9 +129,13 @@ export default { ...@@ -105,9 +129,13 @@ export default {
return component_chooseList.findIndex(e => e.labelId == item.labelId) != -1 return component_chooseList.findIndex(e => e.labelId == item.labelId) != -1
}, },
choose () { choose () {
if (this.component_chooseList.length == 0) return if (this.disabled) return
this.$emit('select', this.component_chooseList) this.$emit('select', this.component_chooseList)
this.close(); this.close();
},
clear () {
this.component_chooseList = []
this.$forceUpdate()
} }
} }
} }
...@@ -116,7 +144,7 @@ export default { ...@@ -116,7 +144,7 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.select-views { .select-views {
overflow-y: scroll; overflow-y: scroll;
max-height: 50vh; max-height: 60vh;
position: relative; position: relative;
padding-bottom: 128rpx; padding-bottom: 128rpx;
.select-group { .select-group {
...@@ -129,18 +157,21 @@ export default { ...@@ -129,18 +157,21 @@ export default {
.select-box { .select-box {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 20rpx; gap: 32rpx;
.select-item { .select-item {
text-align: center; text-align: center;
height: 68rpx; justify-content: center;
line-height: 68rpx;
opacity: 1; opacity: 1;
border: 2rpx solid #dce0e6; border: 2rpx solid #dce0e6;
color: #292d33; color: #333;
font-size: 28rpx; font-size: 32rpx;
border-radius: 8rpx; border-radius: 8rpx;
position: relative; position: relative;
box-sizing: border-box;
padding: 13rpx 40rpx;
word-break: break-all;
line-height: 44rpx;
.sprite-icon { .sprite-icon {
display: none; display: none;
position: absolute; position: absolute;
......
<template> <template>
<MessageBox <MessageBox ref="employeeBoxVisible" position="bottom" :isFooter="false" :title="`请选择${title}`" :maxHeight="1000" @close="$emit('close')">
ref="employeeBoxVisible"
position="bottom"
:isFooter="false"
:title="`请选择${title}`"
:maxHeight="1000"
@close="$emit('close')"
>
<view class="select-box"> <view class="select-box">
<view <view class="select-item" :class="{ checked: salesUuid == item.uuid }" @click="handleSelect(item)" v-for="(item, index) in employeeList" :key="index">
class="select-item"
:class="{ checked: salesUuid == item.uuid }"
@click="handleSelect(item)"
v-for="(item, index) in employeeList"
:key="index"
>
{{ item.staffName }} {{ item.staffName }}
</view> </view>
</view> </view>
</MessageBox> </MessageBox>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
export default { export default {
name: 'Employee', name: 'Employee',
props: { props: {
title: { title: {
type: String, type: String,
default: '销售' default: '销售'
},
salesPropsUuid: {
type: String,
default: ''
} }
}, },
data () { data () {
...@@ -47,7 +38,7 @@ export default { ...@@ -47,7 +38,7 @@ export default {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
salesUuid () { salesUuid () {
return this.$store.state.user.customerInfo.salesUuid return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid
}, },
employeeList () { employeeList () {
return this.$store.state.user.employeeList return this.$store.state.user.employeeList
...@@ -81,27 +72,27 @@ export default { ...@@ -81,27 +72,27 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.select-box { .select-box {
margin: 40rpx 0; margin: 40rpx 0;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 20rpx; gap: 32rpx;
overflow-y: scroll; overflow-y: scroll;
max-height: 50vh; max-height: 50vh;
padding-bottom: 60rpx; padding-bottom: 60rpx;
.select-item { .select-item {
text-align: center; text-align: center;
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 44rpx;
opacity: 1; opacity: 1;
border: 2rpx solid #dce0e6; border: 2rpx solid #dce0e6;
color: #292d33; color: #333;
font-size: 28rpx; font-size: 32rpx;
border-radius: 8rpx; border-radius: 8rpx;
&.checked { &.checked {
border: 2rpx solid #292d33; border: 2rpx solid #292d33;
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<view class="step"> <view class="step">
<MessageBox <MessageBox ref="formRef" @cancel="cancel" @confirm="submit" :cancelBtnText="`${step == 1 ? '取消' : '上一步'}`" :confirmBtnText="`${sceneType == 0 ? (step == 1 ? '下一步' : '完成接待') : '完成接待'}`" :title="`${step == 1 ? '客户信息完善' : '结果反馈'}`" :popupW="820" :maxHeight="820" :isAutoClose="false">
ref="formRef"
@cancel="cancel"
@confirm="submit"
:cancelBtnText="`${step == 1? '取消' : '上一步'}`"
:confirmBtnText="`${sceneType == 0 ?step == 1? '下一步' : '完成接待': '完成接待'}`"
:title="`${step == 1? '客户信息完善' : '结果反馈'}`"
:popupW="820"
:maxHeight="820"
:isAutoClose="false"
>
<view name="content"> <view name="content">
<template v-if="step == 1"> <template v-if="step == 1">
<template v-if="!check(true)"> <template v-if="!check(true)">
<view <view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view>
class="error-tip" <view class="pop-tips" v-else>{{ tips }}</view>
v-if="errorTip"
>以下信息不能为空,请完善信息后保存</view>
<view
class="pop-tips"
v-else
>{{tips}}</view>
</template> </template>
<view class="form"> <view class="form">
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
<view <view class="form-item" :key="index">
class="form-item" <view :class="['label', { required: i.required }]">{{ i.label }}</view>
:key="index" <view :class="['value', { error: showError(i.key) && i.required }, { disabled: customerType == 0 || i.disabled }]">
>
<view :class="['label',{required:i.required}]">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) && i.required },{disabled:customerType == 0 || i.disabled}]">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<input <input :type="i.inputType" :maxlength="i.maxlength" v-model="formData[i.key]" class="input" :placeholder="i.placeholder" :disabled="customerType == 0" @input="inputCustomer" placeholder-style="color:#c9c9c9;" />
:type="i.inputType"
:maxlength="i.maxlength"
v-model="formData[i.key]"
class="input"
:placeholder="i.placeholder"
:disabled="customerType == 0"
@input="inputCustomer"
placeholder-style="color:#c9c9c9;"
/>
</template> </template>
<template v-else> <template v-else>
<view <view :class="['select', `${formData[i.key] ? '' : 'placeholder'}`]" @click="showPopup(i)">
:class="['select', `${formData[i.key]? '' : 'placeholder'}`]"
@click="showPopup(i)"
>
{{ formData[i.key] || i.placeholder }} {{ formData[i.key] || i.placeholder }}
<uni-icons <uni-icons class="arrow" type="down" :size="16"></uni-icons>
class="arrow"
type="down"
:size="16"
></uni-icons>
</view> </view>
</template> </template>
</view> </view>
...@@ -64,42 +29,25 @@ ...@@ -64,42 +29,25 @@
<template v-else> <template v-else>
<view class="pop-tips">请完善本次接待结果</view> <view class="pop-tips">请完善本次接待结果</view>
<view class="choose-box"> <view class="choose-box">
<template v-for="(i,index) in resultList"> <template v-for="(i, index) in resultList">
<view <view :class="['choose-item', `${i.status == receptionStatus ? (i.status == 1 ? 'success' : 'error') : ''}`]" :key="index" @click="chooseResult(i.status)">
:class="['choose-item', `${i.status == receptionStatus ? i.status == 1 ? 'success' : 'error' : ''}`]" <view :class="['sprite-icon', `icon-face-${i.status == receptionStatus ? `${i.icon}-active` : i.icon}`]"></view>
:key="index" {{ i.text }}
@click="chooseResult(i.status)"
>
<view :class="['sprite-icon' , `icon-face-${i.status == receptionStatus ? `${i.icon}-active` : i.icon }`]"></view>
{{ i.text}}
</view> </view>
</template> </template>
</view> </view>
</template> </template>
</view> </view>
</MessageBox> </MessageBox>
<car-brands <car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" />
ref="carBrandListVisible" <employee ref="employeeBoxVisible" @select="handleSelect($event, 'employeeBoxVisible')" />
@select="handleSelect($event,'carBrandListVisible')" <uni-popup ref="successRef" type="message">
/> <uni-popup-message type="success" message="数据保存成功" :duration="1500"></uni-popup-message>
<employee
ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')"
/>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="数据保存成功"
:duration="1500"
></uni-popup-message>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
...@@ -305,7 +253,6 @@ export default { ...@@ -305,7 +253,6 @@ export default {
}, },
success (receptionStatus) { success (receptionStatus) {
this.$refs.successRef.open(); this.$refs.successRef.open();
this.setReceptionStatus(receptionStatus);
this.$emit('submit', receptionStatus) this.$emit('submit', receptionStatus)
}, },
inputCustomer () { inputCustomer () {
...@@ -346,12 +293,13 @@ export default { ...@@ -346,12 +293,13 @@ export default {
}, },
chooseResult (val) { chooseResult (val) {
this.receptionStatus = val this.receptionStatus = val
this.setReceptionStatus(val);
} }
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.pop-tips { .pop-tips {
background: rgba(44, 102, 247, 0.1); background: rgba(44, 102, 247, 0.1);
color: #2c66f7; color: #2c66f7;
...@@ -470,4 +418,4 @@ export default { ...@@ -470,4 +418,4 @@ export default {
border-color: #f247241a; border-color: #f247241a;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template>
<view
class="case-item"
@click="jumpDetail(item)"
>
<image
class="img"
:src="item.cover || 'https://img02.glsx.com.cn/weapp/resource/app-tape/common/default-cover.webp'"
:style="imgStyle"
mode="aspectFill"
></image>
<view class="case-info">
<view class="case-name text-hide">{{ item.title }}</view>
<template v-for="(j, ind) in caseInfo">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{ j.label }}:</view>
<view :class="['case-value', j.class]">
<template v-if="j.format">
{{ j.format(item) }}
</template>
<template v-else>
{{ item[j.key] || '--' }}
</template>
</view>
</view>
</template>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'CaseItem',
props: {
item: Object,
source: {
type: Number,
default: 1
},
visitsId: [Number, String],
imgStyle: String
},
data () {
return {
caseInfo: [
{
label: '业务场景',
class: 'text-hide',
format: (val) => {
// 业务场景:0-会员权益/升级;1-精品升级;2-次新车转化;3-售后众筹;4-积分商城
return val ? {
0: '会员权益/升级',
1: '精品升级',
2: '次新车转化',
3: '售后众筹',
4: '积分商城'
}[val.scene] : '--'
}
},
{
label: '客户标签',
key: 'tags',
class: 'text-hide'
},
{
label: '适用套餐',
key: 'goods',
class: 'text-two-line'
},
],
}
},
mounted () {
},
methods: {
jumpDetail (item) {
const { source, visitsId } = this
let params = `id=${item.id}&source=${source}`
if (visitsId) params += `&visitsId=${visitsId}`
// 类型:0-图片;1-视频;2-pdf;3-富文本
let url = `/pages/common/caseDetail?${params}`
if (item.type != 3) {
let fileUrl = item?.detailInfos[0]?.image
if (item.type == 2) url = `/pages/common/webview?fileUrl=${fileUrl}&title=${item.title}&${params}`
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&${params}`
}
uni.navigateTo({
url: `${url}`
})
},
}
}
</script>
<style scoped lang='scss'>
.case-item {
width: 100%;
height: 100%;
background: #ffffff;
box-shadow: 0 8rpx 24rpx 0 #2c66f71a;
border-radius: 16rpx;
display: flex;
flex-direction: column;
overflow: hidden;
.img {
width: 100%;
height: 324rpx;
}
.case-name {
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 48rpx;
padding: 16rpx 32rpx 8rpx;
}
.case-text {
align-items: flex-start;
font-size: 24rpx;
color: #666666;
line-height: 40rpx;
padding: 0 32rpx;
margin-bottom: 4rpx;
}
.case-label {
width: 120rpx;
flex-shrink: 0;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -89,6 +89,10 @@ ...@@ -89,6 +89,10 @@
<car-brands <car-brands
ref="carBrandVisible" ref="carBrandVisible"
@select="handleSelect($event,'carBrandVisible')" @select="handleSelect($event,'carBrandVisible')"
:echoData="customerInfo"
carBrandKey="carBrand"
carModelKey="brandModel"
customBoolean
/> />
<customer-tags <customer-tags
ref="customerTagstVisible" ref="customerTagstVisible"
...@@ -268,6 +272,7 @@ export default { ...@@ -268,6 +272,7 @@ export default {
if (popkey == 'carBrandVisible') { if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close() this.$refs.carBrandVisible.close()
this.customerInfo.brandModel = item.name this.customerInfo.brandModel = item.name
this.customerInfo.carBrand = item.carChildsBrandName
} else if (popkey == 'customerTagstVisible') { } else if (popkey == 'customerTagstVisible') {
let names = [], let names = [],
ids = [] ids = []
...@@ -305,6 +310,9 @@ export default { ...@@ -305,6 +310,9 @@ export default {
}) })
if (customerInfo.id) params.id = customerInfo.id if (customerInfo.id) params.id = customerInfo.id
params.customerTagName = params.customerTagName.replace(/|/g, ',') params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi[targetApi](params), const res = await uni.$api.customerApi[targetApi](params),
_this = this _this = this
if (res) { if (res) {
...@@ -312,26 +320,34 @@ export default { ...@@ -312,26 +320,34 @@ export default {
if (res == '1') { if (res == '1') {
this.$refs.successRef.open() this.$refs.successRef.open()
setTimeout(() => { setTimeout(() => {
uni.hideLoading()
this.back() this.back()
this.$emit('refresh') this.$emit('refresh')
}, 1e3) }, 1e3)
} else uni.showModal({ } else {
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待', uni.showModal({
showCancel: false, content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
confirmText: '确认', showCancel: false,
confirmColor: '#347BFF', confirmText: '确认',
success (res) { confirmColor: '#347BFF',
if (res.confirm) { success (res) {
_this.back() if (res.confirm) {
_this.$emit('refresh') _this.back()
_this.$emit('refresh')
}
} }
} })
}) uni.hideLoading()
}
} else {
uni.hideLoading()
} }
} catch (error) { } catch (error) {
let index = this.customerForm.findIndex(e => e.key == error) let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true this.customerForm[index].error = true
this.clickFlag = false
uni.hideLoading()
} }
} }
} }
......
...@@ -4,50 +4,36 @@ ...@@ -4,50 +4,36 @@
<view class="user-avatar sprite-icon icon-avatar"></view> <view class="user-avatar sprite-icon icon-avatar"></view>
<view class="user-name">{{ userInfo.name }}</view> <view class="user-name">{{ userInfo.name }}</view>
</view> </view>
<view :class="['left-tabs', {'three':tabs.length == 3}]"> <view :class="['left-tabs', { three: tabs.length == 3 }]">
<template v-for="(i, index) in tabs"> <template v-for="(i, index) in tabs">
<view <view :class="['tab-item', { tabActive: tabIndex == index }]" :key="index" @click="changeIndex(index)">
:class="['tab-item', { tabActive: tabIndex == index }]"
:key="index"
@click="changeIndex(index)"
>
<view class="icon-box"> <view class="icon-box">
<view :class="[ <view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view>
'sprite-icon',
`icon-${i.icon}${tabIndex == index ? '-active' : ''}`,
]"></view>
</view> </view>
{{ i.label }} {{ i.label }}
<view class="dot" v-if="i.icon == 'record' && perRecordNumber"></view>
</view> </view>
</template> </template>
</view> </view>
<view class="left-footer"> <view class="left-footer">
<view <view class="btn" @click="$refs.kfRef.open()">
class="btn"
@click="$refs.kfRef.open()"
>
<view class="sprite-icon icon-feedback"></view> <view class="sprite-icon icon-feedback"></view>
</view> </view>
<view <view class="btn" @click="$refs.settingRef.open()">
class="btn"
@click="$refs.settingRef.open()"
>
<view class="sprite-icon icon-setting"></view> <view class="sprite-icon icon-setting"></view>
</view> </view>
</view> </view>
<!-- 客服弹框 --> <!-- 客服弹框 -->
<kf-box ref="kfRef" /> <kf-box ref="kfRef" />
<!-- 设置弹框 --> <!-- 设置弹框 -->
<setting-box <setting-box ref="settingRef" @stopAudio="$emit('stopAudio')" />
ref="settingRef"
@stopAudio="$emit('stopAudio')"
/>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
import KfBox from "./KfBox"; import KfBox from "./KfBox";
import SettingBox from "./SettingBox"; import SettingBox from "./SettingBox";
import { STORAGE_OBJECTkEY } from '@/utils/cache/constantData'
export default { export default {
components: { KfBox, SettingBox }, components: { KfBox, SettingBox },
props:{ props:{
...@@ -74,6 +60,11 @@ export default { ...@@ -74,6 +60,11 @@ export default {
if(n.shopMerchantId) this.haveCustomerAccess(n.shopMerchantId) if(n.shopMerchantId) this.haveCustomerAccess(n.shopMerchantId)
} }
}, },
computed: {
perRecordNumber() {
return this.$store.state.audio.perRecordNumber
}
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -96,7 +87,7 @@ export default { ...@@ -96,7 +87,7 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.left-side { .left-side {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -134,6 +125,16 @@ export default { ...@@ -134,6 +125,16 @@ export default {
color: #8a98b5; color: #8a98b5;
text-align: center; text-align: center;
padding-bottom: 96rpx; padding-bottom: 96rpx;
position: relative;
.dot {
width: 16rpx;
height: 16rpx;
background: #f24724;
border-radius: 50%;
position: absolute;
right: 20rpx;
top: 20rpx;
}
.icon-box { .icon-box {
width: 112rpx; width: 112rpx;
height: 112rpx; height: 112rpx;
...@@ -213,5 +214,4 @@ export default { ...@@ -213,5 +214,4 @@ export default {
padding-left: 60rpx; padding-left: 60rpx;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template>
<view class="data-container">
<view class="nav-bar" @click="$emit('cancel')">
<view class="back" @click="$emit('update:showPayPage', false)">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">接待记录</view>
</view>
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view>
<view class="form">
<template v-for="(i, index) in formObject">
<view :class="['form-item', { active: focusIndex == index }]" :key="index">
<view class="label required">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) }]">
<template v-if="i.type == 'input'">
<input :type="i.inputType" :maxlength="i.maxlength" v-model="customerInfo[i.key]" class="input" :placeholder="i.placeholder" @focus="focusIndex = index" @blur="resetFocusIndex" />
</template>
<template v-else>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.key] }]" @click="showPopup(i.popKey, index)">
<view class="text-hide">{{ customerInfo[i.key] || i.placeholder }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
</view>
</view>
</template>
</view>
<view class="footer-box">
<view class="cancel-btn" @click="$emit('cancel')">取消</view>
<view class="submit-btn" @click="handleSave">提交</view>
</view>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" />
<employee ref="employeeBoxVisible" :salesPropsUuid="customerInfo.salesUuid" @select="handleSelect($event, 'employeeBoxVisible')" />
<MessageBox ref="receptionStatusVisible" position="bottom" :isFooter="false" title="请选择接待结果" :maxHeight="1000">
<view class="select-box">
<view class="select-item" :class="{ checked: customerInfo.receptionStatus == item.label }" @click="selectReception(item.label)" v-for="(item, index) in receptionList" :key="index">
{{ item.label }}
</view>
</view>
</MessageBox>
</view>
</template>
<script type="text/ecmascript-6">
import CarBrands from '@/components/CarBrands.vue'
import Employee from '@/components/Employee.vue'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
import utils from "@/utils/utils";
export default {
components: {
CarBrands,
Employee,
CustomerAutocomplete
},
props: {
customerInfoVal: {
type: Object,
default: () => ({})
}
},
data() {
return {
errorTip:false,
receptionList: [{
label: '成交',
value: 1
},
{
label: '战败',
value: 0
}
],
formObject: [{
label: "车主姓名",
placeholder: '车主姓名',
key: 'customerName',
type: 'input',
inputType: 'text',
maxlength: 50
},
{
label: "车主电话",
placeholder: '车主电话',
key: 'phoneNumber',
type: 'input',
inputType: 'tel',
maxlength: 11
},
{
label: "品牌车型",
placeholder: '品牌车型',
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible'
},
{
label: "接待结果",
key: "receptionStatus",
type: "select",
popKey: "receptionStatusVisible",
placeholder: '请选择',
},
{
label: "销售姓名",
key: "salesName",
type: "select",
popKey: "employeeBoxVisible",
placeholder: '请选择',
},
],
focusIndex: -1,
customerInfo:{}
}
},
mounted() {
this.customerInfo = utils.deepClone(this.customerInfoVal)
console.log(this.customerInfo)
const i = this.receptionList.findIndex(e => e.value === this.customerInfo.receptionStatus)
this.$set(this.customerInfo, 'receptionStatus', i == -1?'':this.receptionList[i].label)
},
methods: {
selectReception(value) {
this.customerInfo.receptionStatus = value
this.$refs.receptionStatusVisible.close()
},
showError(key) {
let flag = !this.customerInfo[key]
if (key == 'phoneNumber' && this.customerInfo[key]) flag = !phoneRex.test(this.customerInfo[key])
return flag
},
handleSave() {
const result = this.check(true)
if (!result) return this.errorTip = true
const i = this.receptionList.findIndex(e => e.label == this.customerInfo.receptionStatus)
this.customerInfo.receptionStatus = this.receptionList[i].value
this.$emit('submit',this.customerInfo)
},
check(all = false) {
let flag = true
try {
this.formObject.map(e => {
if (!this.customerInfo[e.key]) throw false
if (!all && e.key == 'phoneNumber' && !phoneRex.test(this.customerInfo[e.key])) {
uni.showToast({
title: "请输入正确的车主电话",
icon: "none",
});
throw false
}
})
} catch (error) {
flag = error
}
return flag
},
handleSelect(item, popkey) {
this.$refs[popkey].close()
console.log(item, popkey)
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.salesName = item.staffName
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
}
this.resetFocusIndex()
this.errorTip = false
},
showPopup(e, index) {
this.focusIndex = index
this.$refs[e].open()
},
resetFocusIndex() {
this.focusIndex = -1
this.errorTip = false
}
}
}
</script>
<style scoped lang="scss">
.error-tip {
font-size: 28rpx;
padding: 32rpx 60rpx 24rpx;
margin-top: 100rpx;
margin-bottom: -80rpx;
text-align: center;
background-color: rgb(254, 237, 234);
color: #f45c3d;
}
.data-container {
background: #ffffff59;
border-radius: 48rpx;
margin: 80rpx 66rpx 80rpx 0;
height: calc(100% - 160rpx);
box-shadow: inset 0 0 16rpx 0 #ffffff;
border: 2rpx solid #fff;
box-sizing: border-box;
position: relative;
.nav-bar {
position: absolute;
width: 100%;
height: 96rpx;
left: 0;
top: 28rpx;
z-index: 9;
text-align: center;
font-weight: 700;
font-size: 32rpx;
color: #1a1a1a;
line-height: 96rpx;
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.form {
display: flex;
flex-wrap: wrap;
gap: 80rpx 160rpx;
padding: 80rpx;
margin-top: 60rpx;
&-item {
width: calc(50% - 80rpx);
display: flex;
align-items: center;
color: #6c6c70;
font-size: 30rpx;
height: 80rpx;
box-sizing: border-box;
.label {
position: relative;
margin-left: auto;
flex-shrink: 0;
width: 124rpx;
margin-right: 30rpx;
}
.required {
&::before {
content: '*';
color: #ff0000;
position: absolute;
left: -20rpx;
top: 50%;
transform: translate(0, -50%);
}
}
.value {
height: 80rpx;
flex: 1;
border: 2rpx solid #e8e8ea;
background: #ffffff;
margin-left: 32rpx;
box-sizing: border-box;
padding: 0 40rpx;
border-radius: 8rpx;
&.error {
border: 2rpx solid #f24724;
border-radius: 8rpx;
}
.input,
.select {
width: 100%;
height: 100%;
border: none !important;
outline: none;
padding: 0 !important;
font-size: 30rpx;
color: #333;
&::placeholder {
color: #c9c9c9;
}
}
.placeholderStyle {
color: #999999;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
}
}
// .active {
// &::after {
// position: absolute;
// left: -2rpx;
// top: -2rpx;
// width: calc(100% + 4rpx);
// height: calc(100% + 4rpx);
// content: '';
// background-image: linear-gradient(#2f6af7, #75bcff);
// box-shadow: 0 0 0 8rpx #2c66f71a;
// border-radius: 16rpx;
// }
// }
}
.footer-box {
display: flex;
align-items: center;
justify-content: center;
gap: 34rpx;
padding: 0 280rpx;
.cancel-btn {
height: 80rpx;
background: #dae9ff;
border-radius: 48rpx;
line-height: 80rpx;
text-align: center;
color: #2c66f7;
flex: 1;
}
.submit-btn {
height: 80rpx;
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: 48rpx;
line-height: 80rpx;
text-align: center;
flex: 1;
color: #ffffff;
}
}
}
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
<template> <template>
<view <view class="container" @click="handleTouchStart">
class="container"
@click="handleTouchStart"
>
<view :class="['home', { show: !id }]"> <view :class="['home', { show: !id }]">
<left-side <left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" @changeTab="$emit('changeTab', $event)" @stopAudio="stopAudio" />
:userInfo="userInfo"
:tabIndex.sync="tabIndex"
@changeTab="$emit('changeTab', $event)"
@stopAudio="stopAudio"
/>
<view class="right-side"> <view class="right-side">
<template v-if="tabIndex == 0"> <template v-if="tabIndex == 0">
<view class="right-content"> <view class="right-content">
<view <view class="start" @click="$emit('start')">
class="start" <image class="start-btn" src="../../assets/images/home/start.gif" alt="开始接待" />
@click="$emit('start')" <image class="start-border" src="../../assets/images/home/start-border.png" />
>
<image
class="start-btn"
src="../../assets/images/home/start.gif"
alt="开始接待"
/>
<image
class="start-border"
src="../../assets/images/home/start-border.png"
/>
</view> </view>
<view class="module-list"> <view class="module-list">
<slot name="module" /> <slot name="module" />
...@@ -33,10 +15,7 @@ ...@@ -33,10 +15,7 @@
</view> </view>
</template> </template>
<template v-else> <template v-else>
<component <component :is="componentName" :userInfo="userInfo" />
:is="componentName"
:userInfo="userInfo"
/>
</template> </template>
<view class="store-addr"> <view class="store-addr">
<view class="icon-addr sprite-icon icon-addr"></view> <view class="icon-addr sprite-icon icon-addr"></view>
...@@ -48,67 +27,39 @@ ...@@ -48,67 +27,39 @@
<slot name="detail" /> <slot name="detail" />
</view> </view>
<!-- 未点击开始接待,弹窗 --> <!-- 未点击开始接待,弹窗 -->
<MessageBox <MessageBox ref="previewRef" @confirm="$emit('preview')" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="$emit('previewCancel')" @close="$emit('previewClose')"></MessageBox>
ref="previewRef"
@confirm="$emit('preview')"
:popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」"
confirmBtnText="预览素材"
@cancel="$emit('previewCancel')"
@close="$emit('previewClose')"
></MessageBox>
<!-- 停留弹框 --> <!-- 停留弹框 -->
<MessageBox <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox>
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
<!-- 退出弹框 --> <!-- 退出弹框 -->
<MessageBox <MessageBox :popupW="704" ref="finish" :content="finishContene" :isFooter="false">
:popupW="704"
ref="finish"
:content="finishContene"
:isFooter="false"
>
<view class="footer"> <view class="footer">
<view <view class="footer-btn confirm flex" @click="$emit('openStep')">
class="footer-btn confirm flex"
@click="$emit('openStep')"
>
<template v-if="finishDoneText"> <template v-if="finishDoneText">
{{ finishDoneText }} {{ finishDoneText }}
</template> </template>
<template v-else> 完成接待<text>(推荐)</text> </template> <template v-else>
完成接待
<text>(推荐)</text>
</template>
</view> </view>
<view <view class="footer-btn cancel flex" @click="$emit('backHome')">
class="footer-btn cancel flex" 仍要退出
@click="$emit('backHome')" <text>(不推荐)</text>
>
仍要退出<text>(不推荐)</text>
</view> </view>
</view> </view>
</MessageBox> </MessageBox>
<!-- 升级弹框 --> <!-- 升级弹框 -->
<update-box /> <update-box />
<slot name="content" /> <slot name="content" />
<web-view <web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view>
@message="handlerMessage"
ref="webview"
src="/hybrid/html/index.html"
></web-view>
</view> </view>
</template> </template>
<script> <script>
import RecordList from './components/RecordList.vue'
import RecordList from "./components/RecordList.vue"; import myClick from '@/mixin/click'
import myClick from "@/mixin/click"; import uploader from '@/mixin/uploader.js'
import uploader from "@/mixin/uploader.js"; import CustomerFile from './components/CustomerFile.vue'
import CustomerFile from './components/CustomerFile.vue'; import LeftSide from './components/LeftSide.vue'
import LeftSide from './components/LeftSide.vue';
export default { export default {
mixins: [myClick, uploader], mixins: [myClick, uploader],
components: { RecordList, CustomerFile, LeftSide }, components: { RecordList, CustomerFile, LeftSide },
...@@ -117,35 +68,34 @@ export default { ...@@ -117,35 +68,34 @@ export default {
finishDoneText: String, finishDoneText: String,
finishContene: { finishContene: {
type: String, type: String,
default: "当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」", default: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}, }
}, },
data () { data() {
return { return {
userInfo: {}, userInfo: {},
tabIndex: 0 tabIndex: 0
}; }
}, },
mounted () { mounted() {
const userInfo = uni.$storage.get("userInfo") || {}; const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo; this.userInfo = userInfo
}, },
computed: { computed: {
previewRef () { previewRef() {
return this.$refs.previewRef; return this.$refs.previewRef
}, },
finishRef () { finishRef() {
return this.$refs.finish; return this.$refs.finish
}, },
componentName () { componentName() {
if (this.tabIndex == 0) return 'HomeSlot' if (this.tabIndex == 0) return 'HomeSlot'
else if (this.tabIndex == 1) return 'RecordList' else if (this.tabIndex == 1) return 'RecordList'
else return 'CustomerFile' else return 'CustomerFile'
}, }
},
methods: {
}, },
}; methods: {}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
......
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
handler (newval) { handler (newval) {
this.$refs.popupRef?.close() this.$refs.popupRef?.close()
this.flag = false this.flag = false
this.scrollTop = 1000 this.scrollTop = -1
setTimeout(() => { setTimeout(() => {
this.scrollTop = 0 this.scrollTop = 0
}, 100); }, 100);
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
export default { export default {
name: 'ReceptionSence', name: 'ReceptionSence',
props: { props: {
customerInfo:Object customerInfo: Object
}, },
data () { data () {
return { return {
list:[], list: [],
id:'' id: ''
} }
}, },
watch: { watch: {
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
watchCustomerInfo() { watchCustomerInfo () {
return this.customerInfo return this.customerInfo
}, },
}, },
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.list = res || [] this.list = res || []
}).catch(err =>{ }).catch(err => {
this.list = [] this.list = []
}) })
}, },
...@@ -90,15 +90,15 @@ export default { ...@@ -90,15 +90,15 @@ export default {
.select-box { .select-box {
margin: 40rpx 0; margin: 40rpx 0;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 20rpx; gap: 32rpx;
overflow-y: scroll; overflow-y: scroll;
max-height: 50vh; max-height: 50vh;
padding-bottom: 60rpx; padding-bottom: 60rpx;
.select-item { .select-item {
text-align: center; text-align: center;
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 44rpx;
opacity: 1; opacity: 1;
border: 2rpx solid #dce0e6; border: 2rpx solid #dce0e6;
color: #292d33; color: #292d33;
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
right: 40rpx; right: 40rpx;
top: calc(5% + 140rpx); top: calc(5% + 140rpx);
z-index: 998; z-index: 998;
width: 128rpx; width: 120rpx;
.btn { .btn {
width: 100%; width: 100%;
height: 120rpx; height: 120rpx;
......
const target = ["ip", "dev", "uat", "prod", "beta"]; const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2; const index = 2
/** /**
* *
0本地 0本地
...@@ -12,110 +12,110 @@ const secretKey = { ...@@ -12,110 +12,110 @@ const secretKey = {
ip: {}, ip: {},
dev: { dev: {
sso: { sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89", appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b", secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}, }
}, },
uat: { uat: {
sso: { sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89", appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b", secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}, }
}, },
prod: { prod: {
sso: { sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89", appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b", secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}, }
}, },
beta: { beta: {
sso: { sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89", appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b", secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}, }
}, }
}[target[index]]; }[target[index]]
const domain = { const domain = {
// ip: 'http://192.168.2.94:8558', // ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315', // ip: 'http://192.168.2.3:8315',
ip: "http://192.168.1.170:8315", ip: 'http://192.168.1.170:8315',
/**登录: 192.168.2.3:8315 /**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */ 商城: 192.168.2.3:8558 */
dev: "https://scrm.dev.glsx.com.cn", dev: 'https://scrm.dev.glsx.com.cn',
uat: "https://scrm.test.glsx.com.cn", uat: 'https://scrm.test.glsx.com.cn',
beta: "https://scrm.beta.glsx.com.cn", beta: 'https://scrm.beta.glsx.com.cn',
prod: "https://scrm.glsx.com.cn", prod: 'https://scrm.glsx.com.cn'
}[target[index]]; }[target[index]]
const djDomain = { const djDomain = {
ip: "http://192.168.2.59:8292", ip: 'http://192.168.2.59:8292',
// ip: 'http://192.168.2.80:8558', // ip: 'http://192.168.2.80:8558',
dev: "http://dj.dev.glsx.com.cn", dev: 'http://dj.dev.glsx.com.cn',
beta: "https://dj.beta.glsx.com.cn", //预发布 appid: wx9f91c1ec493eb425 beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: "https://dj.test.glsx.com.cn", //测试 appid: wxe10067a63c1856ac uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
prod: "https://dj.glsx.com.cn", prod: 'https://dj.glsx.com.cn',
pet: "https://cdptest.glsx.com.cn", //压测 appid: wx7ce755e425603084 pet: 'https://cdptest.glsx.com.cn' //压测 appid: wx7ce755e425603084
}[target[index]]; }[target[index]]
const merchantDomain = { const merchantDomain = {
ip: "http://rop-merchant.dev.glsx.com.cn", ip: 'http://rop-merchant.dev.glsx.com.cn',
dev: "http://rop-merchant.dev.glsx.com.cn", dev: 'http://rop-merchant.dev.glsx.com.cn',
beta: "https://rop-merchant.beta.glsx.com.cn", beta: 'https://rop-merchant.beta.glsx.com.cn',
uat: "https://rop-merchant.test.glsx.com.cn", uat: 'https://rop-merchant.test.glsx.com.cn',
prod: "https://commodity.glsx.com.cn", prod: 'https://commodity.glsx.com.cn',
pet: "", pet: ''
}[target[index]]; }[target[index]]
const djSecretKey = { const djSecretKey = {
ip: {}, ip: {},
dev: { dev: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637", appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b", secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}, },
uat: { uat: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637", appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b", secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}, },
beta: { beta: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637", appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b", secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}, },
prod: { prod: {
appKey: "d7ffc3346fc9a45bccaaa35300d59022", appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353", secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}, },
pet: { pet: {
appKey: "d7ffc3346fc9a45bccaaa35300d59022", appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353", secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}, }
}[target[index]]; }[target[index]]
const pathEnum = { const pathEnum = {
sso: "/rop-scrm-sso/", sso: '/rop-scrm-sso/',
shopmall: "/rop-scrm-shopmall/", shopmall: '/rop-scrm-shopmall/',
coupon: "/rop-scrm-coupon/", coupon: '/rop-scrm-coupon/',
carlife: "/rop-scrm-carlife/", carlife: '/rop-scrm-carlife/',
live: "/rop-scrm-live/", live: '/rop-scrm-live/',
equity: "/rop-scrm-equity/", equity: '/rop-scrm-equity/',
entmicro: "/rop-scrm-entmicro/", entmicro: '/rop-scrm-entmicro/',
wechat: "/rop-scrm-wechat/", wechat: '/rop-scrm-wechat/',
boutiquecoupon: "/rop-scrm-boutiquecoupon/", boutiquecoupon: '/rop-scrm-boutiquecoupon/',
material: "/rop-scrm-marketing/", //素材 material: '/rop-scrm-marketing/', //素材
sop: "/rop-scrm-sop/", sop: '/rop-scrm-sop/',
customercollect: "/rop-scrm-bigdatautil/", customercollect: '/rop-scrm-bigdatautil/',
mindworkplate: "/rop-dj-smartcarlife/", mindworkplate: '/rop-dj-smartcarlife/',
drac: "/rop-scrm-entmicro/", drac: '/rop-scrm-entmicro/',
busassistant: "/rop-scrm-busassistant/", busassistant: '/rop-scrm-busassistant/',
boutique: "/rop-dj-car-boutique/", boutique: '/rop-dj-car-boutique/',
merchants: "/rop-merchants/", merchants: '/rop-merchants/'
}; }
const CONFIG_ENV_MAP = { const CONFIG_ENV_MAP = {
1: "develop", 1: 'develop',
2: "test", 2: 'test',
3: "production", 3: 'production',
4: "beta", 4: 'beta'
}; }
module.exports = { module.exports = {
index, index,
domain, domain,
...@@ -124,5 +124,5 @@ module.exports = { ...@@ -124,5 +124,5 @@ module.exports = {
env: CONFIG_ENV_MAP[index], env: CONFIG_ENV_MAP[index],
djDomain, djDomain,
merchantDomain, merchantDomain,
djSecretKey, djSecretKey
}; }
...@@ -49,7 +49,7 @@ import { index } from './env' ...@@ -49,7 +49,7 @@ import { index } from './env'
// } // }
Vue.prototype.$permision = permision Vue.prototype.$permision = permision
import sentryInit from '@/utils/sentryConfig/sentryInit' import sentryInit from '@/utils/sentryConfig/sentryInit'
if (index == 3) { if (index == 3 || index == 2) {
const sentry = sentryInit() const sentry = sentryInit()
Vue.prototype.$sendSentry = function (e) { Vue.prototype.$sendSentry = function (e) {
sentry.captureException(e) sentry.captureException(e)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "1.9.0", "versionName" : "1.9.1",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
...@@ -91,7 +91,8 @@ ...@@ -91,7 +91,8 @@
"vueVersion" : "2", "vueVersion" : "2",
"h5" : { "h5" : {
"devServer" : { "devServer" : {
"port" : "" "port" : 8080,
"https" : false
} }
} }
} }
export default { export default {
data() { data () {
return { return {
goodsId: '', goodsId: '',
visitsId: '' visitsId: '',
source: 1
} }
}, },
onLoad(options) { onLoad (options) {
this.visitsId = options.visitsId this.visitsId = options.visitsId || ''
this.goodsId = options.id this.goodsId = options.id
if (options.source) this.source = options.source
this.addRecord() this.addRecord()
}, },
methods: { methods: {
addRecord() { addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo') const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
const params = { const params = {
goodsId: this.goodsId, goodsId: this.goodsId,
goodsType: 0, goodsType: 0,
merchantId, merchantId,
merchantName, merchantName,
visitsId: this.visitsId searchSource: this.source
} }
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.addRecord(params).then(res => { uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res this.addId = res
}) })
} }
}, },
onUnload() { onUnload () {
const params = { const params = {
id: this.addId, id: this.addId
visitsId: this.visitsId
} }
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.leaveRecord(params).then(res => { uni.$api.commonApi.leaveRecord(params).then(res => {
console.log(res, 888) console.log(res, 888)
}) })
......
...@@ -126,9 +126,13 @@ export default { ...@@ -126,9 +126,13 @@ export default {
* @throws {Error} - 如果获取 OSS 令牌的过程中出现错误,将抛出错误 * @throws {Error} - 如果获取 OSS 令牌的过程中出现错误,将抛出错误
*/ */
async uploadRecord(record) { async uploadRecord(record) {
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = await getOssToken() if (record.filePath) {
console.log('获取Token成功!!', `lsaccessKeySecret: ${lsaccessKeySecret}, lsaccessKeyId: ${lsaccessKeyId}`) const { lsaccessKeySecret, securityToken, lsaccessKeyId } = await getOssToken()
this.wv.evalJS(`msgFromUniapp('${lsaccessKeyId}','${lsaccessKeySecret}','${securityToken}','${record.fileName}','${record.filePath}','${record.recordId}')`) console.log('获取Token成功!!', `lsaccessKeySecret: ${lsaccessKeySecret}, lsaccessKeyId: ${lsaccessKeyId}`)
this.wv.evalJS(`msgFromUniapp('${lsaccessKeyId}','${lsaccessKeySecret}','${securityToken}','${record.fileName}','${record.filePath}','${record.recordId}')`)
} else {
this._saveOrUpdateFail(record.recordId)
}
}, },
/** /**
* 文件上传成功后的处理逻辑 * 文件上传成功后的处理逻辑
...@@ -209,6 +213,11 @@ export default { ...@@ -209,6 +213,11 @@ export default {
if (record.recordUrlList?.every(i => i.status == undefined)) { if (record.recordUrlList?.every(i => i.status == undefined)) {
const pathArr = record.recordUrlList.map(i => i.file) const pathArr = record.recordUrlList.map(i => i.file)
const params = { ...record, recordUrlList: pathArr } const params = { ...record, recordUrlList: pathArr }
if (!params.receptionEndTime) {
const endTime = await uni.$api.commonApi.searchRecordingEndTime({ recordUrlList: pathArr, receptionStartTime: params.receptionStartTime.replace(/\//g, '-') })
params.receptionEndTime = endTime.replace(/\-/g, '/')
}
console.log(params, 'params')
const res = await uni.$api.commonApi.saveRecCustomer(params) const res = await uni.$api.commonApi.saveRecCustomer(params)
if (res) { if (res) {
uni.$recordManager.removeRecord(record.id) uni.$recordManager.removeRecord(record.id)
...@@ -219,7 +228,25 @@ export default { ...@@ -219,7 +228,25 @@ export default {
this._removeFileOnClient(filePathOnClient) this._removeFileOnClient(filePathOnClient)
} }
}, },
async _saveOrUpdateFail(recordId) {
const unlock = await uni.$recordManager.lock()
try {
const record = uni.$recordManager.getRecordById(recordId)
const params = { ...record, recordUrlList: [] }
if (!params.receptionEndTime) {
params.receptionEndTime = params.receptionStartTime
}
const res = await uni.$api.commonApi.saveRecCustomer(params)
if (res) {
uni.$recordManager.removeRecord(record.id)
}
} catch (e) {
this.reportError(recordId, '无文件', e)
} finally {
unlock()
this.polling()
}
},
/** /**
* 获取记录快照的异步函数 * 获取记录快照的异步函数
* 此函数获取当前记录列表的快照,并返回这些记录 * 此函数获取当前记录列表的快照,并返回这些记录
...@@ -242,7 +269,8 @@ export default { ...@@ -242,7 +269,8 @@ export default {
*/ */
flattenData(records) { flattenData(records) {
const result = records.reduce((acc, cur) => { const result = records.reduce((acc, cur) => {
const recordUrlList = cur.recordUrlList.map(file => { cur.recordUrlList = cur.recordUrlList || []
let recordUrlList = cur.recordUrlList.map(file => {
if (!file.status) { if (!file.status) {
return [] return []
} }
...@@ -251,6 +279,9 @@ export default { ...@@ -251,6 +279,9 @@ export default {
const filePath = aFullPath.join('/') + '/' const filePath = aFullPath.join('/') + '/'
return { ...file, recordId: cur.id, fileName, filePath } return { ...file, recordId: cur.id, fileName, filePath }
}) })
if (cur.recordUrlList.length == 0) {
recordUrlList = [{ recordId: cur.id }]
}
acc = acc.concat(...recordUrlList) acc = acc.concat(...recordUrlList)
return acc return acc
}, []) }, [])
......
...@@ -66,20 +66,6 @@ ...@@ -66,20 +66,6 @@
} }
}, },
{ {
"path": "pages/boutique/membranes",
"style": {
"navigationStyle": "custom",
"disableSwipeBack": true
}
},
{
"path": "pages/boutique/productDetail",
"style": {
"navigationStyle": "custom",
"disableSwipeBack": true
}
},
{
"path": "pages/boutique/history", "path": "pages/boutique/history",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
......
<template> <template>
<view class="container" @click="hideSelect"> <view
<view class="bg"></view> class="container"
<view class="box"> @click="hideSelect"
<view class="select-box"> >
<view class="select" @click.stop="selectType"> <wnCanvas
{{selectIndex}} :canvasId="`c-${madiaId}`"
<view class="sprite-icon icon-arrow-bottom"></view> :drawStatus="penSwitch"
</view> custom
<view class="pop-box" v-show="isSelect"> :scaleSwitch="false"
<view v-for="i in selectList" :key="i.label" class="type-item" :class="i.value == selectIndex ? 'active' : ''" @click="chooseType(i)">{{i.label}}</view> ref="caseCanvas"
<!-- <view class="type-item active">全部</view> >
<template slot="customContent">
<view class="bg"></view>
<view class="box">
<view class="select-box">
<view
class="select"
@click.stop="selectType"
>
{{selectIndex}}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<view
class="pop-box"
v-show="isSelect"
>
<view
v-for="i in selectList"
:key="i.label"
class="type-item"
:class="i.value == selectIndex ? 'active' : ''"
@click="chooseType(i)"
>{{i.label}}</view>
<!-- <view class="type-item active">全部</view>
<view class="type-item">视频</view> <view class="type-item">视频</view>
<view class="type-item">图片</view> <view class="type-item">图片</view>
<view class="type-item">PDF</view> --> <view class="type-item">PDF</view> -->
</view> </view>
</view> </view>
<view class="input-box"> <view class="input-box">
<input <input
type="text" type="text"
class="input" class="input"
v-model="name" v-model="name"
maxlength="50" maxlength="50"
@blur="input($event)" @blur="input($event)"
@focus="focus" @focus="focus"
/> />
<view <view
class="input-tips" class="input-tips"
v-if="!isSearch" v-if="!isSearch"
>搜索图片/视频名称<uni-icons >搜索图片/视频名称<uni-icons
type="search" type="search"
class="icon" class="icon"
color="#999" color="#999"
size="20" size="20"
></uni-icons></view> ></uni-icons></view>
<uni-icons <uni-icons
v-if="isSearch" v-if="isSearch"
type="closeempty" type="closeempty"
class="close" class="close"
color="#999" color="#999"
@click="handleClear" @click="handleClear"
size="20" size="20"
></uni-icons> ></uni-icons>
</view> </view>
<scroll-view <scroll-view
class="record-box" class="record-box"
scroll-y scroll-y
:scroll-top="scrollTop" :scroll-top="scrollTop"
> >
<view class="list"> <view class="list">
<template v-if="list.length"> <template v-if="list.length">
<template v-for="item in list"> <template v-for="item in list">
<view <view
class="item" class="item"
:key="item.id" :key="item.id"
> >
<view <view
class="item-autio" class="item-autio"
@click="playVideo(item)" @click="playVideo(item)"
> >
<image
:src="item.thumbnailUrl"
class="cover-box"
></image>
<image
v-if="item.materialFormat == 1"
src="../../assets/images/boutique/play.png"
class="play-box"
></image>
</view>
<view class="item-desc">{{ item.name }}</view>
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image <image
:src="item.thumbnailUrl" class="icon"
class="cover-box" src="../../assets/images/home/nothing.webp"
></image> />
<image 暂无数据
v-if="item.materialFormat == 1"
src="../../assets/images/boutique/play.png"
class="play-box"
></image>
</view> </view>
<view class="item-desc">{{ item.name }}</view> </template>
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view> </view>
</template> </scroll-view>
</view> </view>
</scroll-view> </template>
</view> </wnCanvas>
<view <view
class="popup-box" class="popup-box"
v-if="popupShow" v-if="popupShow"
...@@ -110,7 +135,7 @@ ...@@ -110,7 +135,7 @@
></video> ></video>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -137,11 +162,9 @@ export default { ...@@ -137,11 +162,9 @@ export default {
} }
}, },
props: { props: {
views: { show: Boolean,
type: Array, madiaId: Number,
default: () => [] penSwitch: Boolean,
},
show: Boolean
}, },
computed: { computed: {
watchStatus () { watchStatus () {
...@@ -150,7 +173,7 @@ export default { ...@@ -150,7 +173,7 @@ export default {
}, },
watch: { watch: {
watchStatus: { watchStatus: {
handler(val) { handler (val) {
this.selectIndex = '全部' this.selectIndex = '全部'
// console.log(val) // console.log(val)
// this.name = ''; // this.name = '';
...@@ -161,19 +184,19 @@ export default { ...@@ -161,19 +184,19 @@ export default {
immediate: true immediate: true
}, },
show: { show: {
handler(newValue) { handler (newValue) {
if(newValue) this.init() if (newValue) this.init()
}, },
immediate:true immediate: true
} }
}, },
mounted() { mounted () {
this.init() this.init()
this.getCategory() this.getCategory()
}, },
methods: { methods: {
playVideo (item) { playVideo (item) {
this.$emit('preview',item) this.$emit('preview', item)
}, },
focus () { focus () {
this.isSearch = true this.isSearch = true
...@@ -192,27 +215,30 @@ export default { ...@@ -192,27 +215,30 @@ export default {
this.name = '' this.name = ''
this.isSearch = false this.isSearch = false
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex) this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex)
this.clearCanvas()
}, },
input(e) { input (e) {
this.name = e.detail.value this.name = e.detail.value
if (this.name == '') if (this.name == '')
this.isSearch = false this.isSearch = false
// this.list = this.searchList.filter(i => i.name.includes(this.name)) // this.list = this.searchList.filter(i => i.name.includes(this.name))
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex, this.name) this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex, this.name)
this.clearCanvas()
}, },
selectType() { selectType () {
this.isSelect = !this.isSelect this.isSelect = !this.isSelect
}, },
hideSelect() { hideSelect () {
this.isSelect = false this.isSelect = false
}, },
chooseType(val) { chooseType (val) {
console.log(val) console.log(val)
this.selectIndex = val.value this.selectIndex = val.value
this.isSelect = false this.isSelect = false
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex, this.name) this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex, this.name)
this.clearCanvas()
}, },
async getCaseList(category = '', name = '') { async getCaseList (category = '', name = '') {
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo; // 44217687 { shopMerchantId } = userInfo; // 44217687
const params = { merchantId: shopMerchantId, category } const params = { merchantId: shopMerchantId, category }
...@@ -226,7 +252,7 @@ export default { ...@@ -226,7 +252,7 @@ export default {
this.scrollTop = 0 this.scrollTop = 0
}, 100); }, 100);
}, },
async getCategory() { async getCategory () {
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo; { shopMerchantId } = userInfo;
const res = await uni.$api.boutiqueApi.getCategory({ merchantId: shopMerchantId }) const res = await uni.$api.boutiqueApi.getCategory({ merchantId: shopMerchantId })
...@@ -238,7 +264,10 @@ export default { ...@@ -238,7 +264,10 @@ export default {
} }
}) })
this.selectList = [...this.selectList, ..._list] this.selectList = [...this.selectList, ..._list]
} },
clearCanvas () {
this.$refs.caseCanvas.clearBoard()
},
}, },
} }
</script> </script>
...@@ -282,7 +311,7 @@ export default { ...@@ -282,7 +311,7 @@ export default {
.pop-box { .pop-box {
width: 368rpx; width: 368rpx;
// height: 248rpx; // height: 248rpx;
background: #FFFFFF; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
padding: 16rpx 0; padding: 16rpx 0;
.type-item { .type-item {
...@@ -294,7 +323,7 @@ export default { ...@@ -294,7 +323,7 @@ export default {
margin-bottom: 0; margin-bottom: 0;
} }
&.active { &.active {
background-color: #ECF1FF; background-color: #ecf1ff;
} }
} }
} }
...@@ -380,7 +409,7 @@ export default { ...@@ -380,7 +409,7 @@ export default {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; // 控制多行的行数 -webkit-line-clamp: 2; // 控制多行的行数
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
padding-bottom: 0; padding-bottom: 0;
} }
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<template v-if="customerType == 1"> <template v-if="customerType == 1">
<template v-if="pageParams.received"> <template v-if="pageParams.received">
<view class="ok"> <view class="ok">
<view class="ok-status"></view> <view class="ok-status"></view>
<!-- <image <!-- <image
class="ok-status" class="ok-status"
src="@/assets/images/boutique/ok-status.webp" src="@/assets/images/boutique/ok-status.webp"
...@@ -94,11 +94,15 @@ ...@@ -94,11 +94,15 @@
</view> </view>
</template> </template>
<template v-else> <template v-else>
<image v-if="pageParams.QRURL" <image
v-if="pageParams.QRURL"
class="qr-code-img" class="qr-code-img"
:src="pageParams.QRURL" :src="pageParams.QRURL"
/> />
<view v-else class="no-data"> <view
v-else
class="no-data"
>
<view class="no-data-img"></view> <view class="no-data-img"></view>
<!-- <image <!-- <image
src="@/assets/images/boutique/no-data.webp" src="@/assets/images/boutique/no-data.webp"
...@@ -231,7 +235,7 @@ export default { ...@@ -231,7 +235,7 @@ export default {
watch: { watch: {
watchCustomerInfo: { watchCustomerInfo: {
immediate: true, immediate: true,
handler(newval) { handler (newval) {
this.customerInfo = Object.assign(this.customerInfo, newval) this.customerInfo = Object.assign(this.customerInfo, newval)
try { try {
// 监听完成接待修改数据,同步修改生成优惠券按钮状态 // 监听完成接待修改数据,同步修改生成优惠券按钮状态
...@@ -246,7 +250,7 @@ export default { ...@@ -246,7 +250,7 @@ export default {
}, },
watchStatus: { watchStatus: {
immediate: true, immediate: true,
handler(newval) { handler (newval) {
this.close() this.close()
this.closeAllPopup() this.closeAllPopup()
this.pageParams.QRURL = '' this.pageParams.QRURL = ''
...@@ -260,7 +264,7 @@ export default { ...@@ -260,7 +264,7 @@ export default {
} }
} }
}, },
show() { show () {
this.closeAllPopup() this.closeAllPopup()
} }
}, },
...@@ -293,7 +297,7 @@ export default { ...@@ -293,7 +297,7 @@ export default {
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
init () { init () {
...@@ -332,7 +336,7 @@ export default { ...@@ -332,7 +336,7 @@ export default {
const { customerName, phoneNumber, staffName } = this.customerInfo const { customerName, phoneNumber, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName this.isCheck = customerName && phoneNumber && staffName
}, },
chooseCoupon(item) { chooseCoupon (item) {
this.pageParams.couponId = item.id this.pageParams.couponId = item.id
this.customerInfo.couponTypeName = item.couponTypeName this.customerInfo.couponTypeName = item.couponTypeName
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
...@@ -349,12 +353,12 @@ export default { ...@@ -349,12 +353,12 @@ export default {
this.$refs[e].open(); this.$refs[e].open();
this.$emit('hideTool') this.$emit('hideTool')
}, },
open(customerType, customerCouponId) { open (customerType, customerCouponId) {
this.$refs.couponPopup.open() this.$refs.couponPopup.open()
this.customerType = customerType this.customerType = customerType
if (customerCouponId) { if (customerCouponId) {
this.pageParams.customerCouponId = customerCouponId this.pageParams.customerCouponId = customerCouponId
this.pageParams.customerQr = qrcode.createQrCodeImg(`couponId=${customerCouponId}`, {size: 200}) this.pageParams.customerQr = qrcode.createQrCodeImg(`couponId=${customerCouponId}`, { size: 200 })
} }
this.init() this.init()
try { try {
...@@ -367,7 +371,7 @@ export default { ...@@ -367,7 +371,7 @@ export default {
close () { close () {
this.$refs.couponPopup?.close() this.$refs.couponPopup?.close()
}, },
handleSelect(item, popkey) { handleSelect (item, popkey) {
console.log(item, popkey) console.log(item, popkey)
this.$refs[popkey].close(); this.$refs[popkey].close();
if (popkey == "employeeBoxVisible") { if (popkey == "employeeBoxVisible") {
...@@ -404,7 +408,7 @@ export default { ...@@ -404,7 +408,7 @@ export default {
} }
return flag return flag
}, },
async createCoupon() { async createCoupon () {
if (this.pageParams.received) return if (this.pageParams.received) return
if (!this.isCheck) return // 按钮置灰的情况 if (!this.isCheck) return // 按钮置灰的情况
try { try {
...@@ -620,8 +624,8 @@ export default { ...@@ -620,8 +624,8 @@ export default {
.select-box { .select-box {
margin: 40rpx 0; margin: 40rpx 0;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 20rpx; gap: 32rpx;
overflow-y: scroll; overflow-y: scroll;
max-height: 50vh; max-height: 50vh;
padding-bottom: 60rpx; padding-bottom: 60rpx;
......
<template>
<view class="views-box">
<view class="views-title-box flex">
<template v-for="(i,index) in viewsTitle">
<view
:class="['title-item flex row',`row-${index + 1}`]"
:key="index"
>
<template v-if="!i">
<view
:class="['check-box flex',{'checked':allChecked}]"
@click="chooseAll"
>
<uni-icons
type="checkmarkempty"
:size="10"
:color="`${allChecked?'#fff':'transparent'}`"
></uni-icons>
</view>
</template>
<template v-else>
{{i}}
</template>
</view>
</template>
</view>
<view class="views-content">
<scroll-view
class="table"
scroll-y
:scroll-top="scrollTop"
>
<!-- <template v-if="optionals[this.currentCar].length"> -->
<template v-for="(i,index) in optionalsList">
<view
class="optional-item"
:key="index"
>
<view
class="row-1 flex"
@click="choose(i,index)"
>
<view :class="['check-box flex',{'checked':i.checked}]">
<uni-icons
type="checkmarkempty"
:size="10"
:color="`${i.checked?'#fff':'transparent'}`"
></uni-icons>
</view>
</view>
<view class="row row-2">
{{i.name}}
</view>
<view class="row row-3">
<rich-text :nodes="i.warranty"></rich-text>
</view>
<view class="row row-4">
{{i.price}}
</view>
</view>
</template>
<!-- </template>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-no-insurance-data"></view>
暂无数据
</view>
</template> -->
</scroll-view>
</view>
<view class="views-footer">
<view class="price flex">
总价:¥
<view class="total">{{total}}</view>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import NP from 'number-precision'
export default {
props: {
currentCar: String,
show: Boolean
},
data () {
return {
viewsTitle: ['', '产品名称', '质保', '售价'],
scrollTop: 0,
optionalsList: []
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.optionalsList = []
}
},
currentCar: {
immediate: true,
handler (newval) {
console.log(newval)
this.optionalsList = []
this.init()
}
},
show: {
immediate: true,
handler (newval) {
if (newval) {
if (this.optionalsList.length) return
this.init()
} else this.optionalsList = []
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
allChecked () {
let flag = false
if (this.show) flag = this.optionalsList.filter(item => item.checked).length == this.optionalsList.length
return flag
},
total () {
let total = 0
if (this.show) total = Number(this.optionalsList.reduce((pre, cur) => {
return NP.plus(pre, NP.times(cur.price, cur.checked ? 1 : 0))
}, 0))
return total ? total.toFixed(2) : '0.00'
},
boutiqueMediaConfig () {
return this.$store.state.user.boutiqueMediaConfig
},
},
mounted () {
},
methods: {
init () {
if (!this.show) return
let { optionals } = this.boutiqueMediaConfig[this.currentCar]
optionals.map(e => e.checked = false)
this.optionalsList = optionals
console.log(this.optionalsList)
this.scrollTop = -1
setTimeout(() => {
this.scrollTop = 0
}, 100);
this.$forceUpdate()
},
chooseAll () {
let { allChecked } = this
this.optionalsList.map(e => {
e.checked = allChecked ? false : true
})
},
choose (item, index) {
this.optionalsList[index].checked = !item.checked
},
}
}
</script>
<style scoped lang='scss'>
.views-box {
width: 2186rpx;
height: calc(100vh - 236rpx);
box-sizing: border-box;
margin: 236rpx auto 0;
animation: show-view-opacity 0.15s forwards;
.views-title-box {
height: 96rpx;
background: #edf2ff;
border-radius: 16rpx;
margin-bottom: 16rpx;
.title-item {
height: 96rpx;
box-sizing: border-box;
flex-shrink: 0;
font-size: 26rpx;
color: #666666;
}
}
.check-box {
width: 32rpx;
height: 32rpx;
background: transparent;
border: 1.5px solid #999;
border-radius: 6rpx;
box-sizing: border-box;
justify-content: center;
overflow: hidden;
transition: all 0.25s;
flex-shrink: 0;
}
.checked {
background: #2c66f7;
border-color: #2c66f7;
}
.row {
padding: 26rpx 32rpx;
display: flex;
align-items: center;
}
.row-1 {
width: 96rpx;
justify-content: center;
padding: 26rpx 0;
}
.row-2 {
width: 1380rpx;
border-right: 2rpx solid #fff;
border-left: 2rpx solid #fff;
}
.row-3 {
width: 400rpx;
}
.row-4 {
border-left: 2rpx solid #fff;
width: 304rpx;
}
.views-content {
height: calc(100% - 292rpx);
display: flex;
box-sizing: border-box;
position: relative;
background: #f7f7f7;
border-radius: 16rpx;
.table {
height: 100%;
.optional-item {
border-bottom: 2rpx solid #ffffff;
position: relative;
display: flex;
font-size: 28rpx;
color: #333333;
// &:last-child {
// border: none;
// }
}
.disabled {
.name,
.range {
color: #999999;
}
.cost {
&-input {
border-color: #d8dce6;
.input,
.unit {
color: #cccccc;
}
}
}
}
.disabled-input {
.cost {
&-input {
border-color: #d8dce6;
.input,
.unit {
color: #cccccc;
}
}
}
}
}
.nothing {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
justify-content: center;
flex-direction: column;
font-size: 26rpx;
color: #808291;
.sprite-icon {
margin-bottom: 24rpx;
}
}
}
.views-footer {
height: 180rpx;
background: #ffffff;
box-sizing: border-box;
font-weight: 500;
font-size: 32rpx;
color: #333333;
line-height: 44rpx;
display: flex;
align-items: flex-start;
.price {
margin-top: 44rpx;
align-items: baseline;
}
.total {
font-weight: 700;
font-size: 48rpx;
line-height: 64rpx;
margin-left: 8rpx;
}
.total-btn {
margin: 16rpx 0 0 auto;
width: 480rpx;
height: 96rpx;
background-image: linear-gradient(180deg, #61c0ff 0%, #2c66f7 100%);
box-shadow: inset 0 0 32rpx 0 #ffffff;
border-radius: 16rpx;
font-weight: 500;
font-size: 36rpx;
color: #ffffff;
line-height: 44rpx;
justify-content: center;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<view class="layout"> <view class="layout">
<view class="tab-box flex"> <wnCanvas
<template v-for="(item, index) in carList"> :canvasId="`c-${madiaId}`"
:drawStatus="penSwitch"
custom
:scaleSwitch="false"
ref="receptionCanvas"
>
<template slot="customContent">
<view class="tab-box flex">
<template v-for="(item, index) in carList">
<view
:key="index"
:class="['tab',`${currentIndex == index ? 'active' : ''}`]"
@click="changeCar(item)"
>
{{item}}
</view>
</template>
</view>
<view <view
:key="index" class="risk-informed flex"
:class="['tab',`${currentIndex == index ? 'active' : ''}`]" @click="$refs.riskInformedPop.open()"
@click="changeCar(item)"
> >
{{item}} 风险告知
<view class="sprite-icon icon-info_shield"></view>
</view> </view>
</template>
</view>
<view
class="risk-informed flex"
@click="$refs.riskInformedPop.open()"
>
风险告知
<view class="sprite-icon icon-info_shield"></view>
</view>
<view class="content-box flex">
<template v-if="currentItem && currentItem.modelDisplayPicurl">
<view <view
class="left-content" class="content-box flex"
:key="updateViewKey" v-show="tabIndex == 0"
@click="showPicture(currentItem)"
> >
<image <template v-if="currentItem && currentItem.modelDisplayPicurl">
:src="currentItem.modelDisplayPicurl" <view
class="poster" class="left-content"
/> :key="updateViewKey"
<view @click="showPicture(currentItem)"
class="tips" >
v-if="currentItem.detailPicurl" <image
>* 点击图片查看详情 &gt;</view> :src="currentItem.modelDisplayPicurl"
class="poster"
/>
<view
class="tips"
v-if="currentItem.detailPicurl"
>* 点击图片查看详情 &gt;</view>
</view>
</template>
<template v-else>
<view class="left-content">
<image
class="default"
:src="defaultImg"
/>
</view>
</template>
<view class="right-content">
<view :class="['sku-box',isPreview ? 'preview' : '']">
<sku-box
:currentCar="currentCarString"
:defaultTabId="tabId"
:show="show && tabIndex == 0"
@changePreView="changePreView"
ref="sku"
/>
</view>
<view
class="coupon-btn flex"
v-if="!isPreview"
@click="couponPopupRef.open(customerType, customerInfo.customerCouponId)"
>{{couponText}}</view>
</view>
</view> </view>
<optional-table
v-show="tabIndex == 1"
:currentCar="currentCarString"
:show="show && tabIndex == 1"
></optional-table>
<template v-if="hasOptionals">
<view class="tabs-box flex">
<template v-for="(i,index) in tabs">
<view
:class="['tab flex',{active:index==tabIndex}]"
:key="index"
@click="changeTab(index)"
>{{i}}</view>
</template>
<view :class="['block',{'block-right':tabIndex == 1}]"></view>
</view>
</template>
</template> </template>
<template v-else> </wnCanvas>
<view class="left-content">
<image
class="default"
:src="defaultImg"
/>
</view>
</template>
<view class="right-content">
<view :class="['sku-box',isPreview ? 'preview' : '']">
<sku-box
:currentCar="currentCarString"
:defaultTabId="tabId"
:show="show"
@changePreView="changePreView"
ref="sku"
/>
</view>
<view
class="coupon-btn flex"
v-if="!isPreview"
@click="couponPopupRef.open(customerType, customerInfo.customerCouponId)"
>{{couponText}}</view>
</view>
</view>
<car-brands <car-brands
ref="carBrandRef" ref="carBrandRef"
@select="handleSelect" @select="handleSelect"
...@@ -83,12 +113,13 @@ import SkuBox from './SkuBox.vue' ...@@ -83,12 +113,13 @@ 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 RiskInformedBox from './RiskInformedBox.vue' import RiskInformedBox from './RiskInformedBox.vue'
import OptionalTable from './OptionalTable.vue'
const m5 = require("@/assets/images/boutique/index/m5.png") const m5 = require("@/assets/images/boutique/index/m5.png")
const m7 = require("@/assets/images/boutique/index/m7.png") const m7 = require("@/assets/images/boutique/index/m7.png")
const m9 = require("@/assets/images/boutique/index/m9.png") const m9 = require("@/assets/images/boutique/index/m9.png")
export default { export default {
name: 'Reception', name: 'Reception',
components: { SkuBox, CarBrands, CouponPop, RiskInformedBox }, components: { SkuBox, CarBrands, CouponPop, RiskInformedBox, OptionalTable },
props: { props: {
customerType: Number, customerType: Number,
show: Boolean, show: Boolean,
...@@ -96,6 +127,8 @@ export default { ...@@ -96,6 +127,8 @@ export default {
currentCar: String, currentCar: String,
type: String, type: String,
popupImg: String, popupImg: String,
madiaId: Number,
penSwitch: Boolean,
}, },
data () { data () {
return { return {
...@@ -105,7 +138,9 @@ export default { ...@@ -105,7 +138,9 @@ export default {
updateViewKey: Date.now(), updateViewKey: Date.now(),
carInfo: {}, carInfo: {},
currentImgUrl: '', currentImgUrl: '',
currentItem: null currentItem: null,
tabs: ['加装', '选装'],
tabIndex: 0
} }
}, },
watch: { watch: {
...@@ -124,6 +159,7 @@ export default { ...@@ -124,6 +159,7 @@ export default {
currentCarString: { currentCarString: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (!this.hasOptionals && this.tabIndex == 1) this.tabIndex = 0
this.defaultImg = { this.defaultImg = {
'M5': m5, 'M5': m5,
'M7': m7, 'M7': m7,
...@@ -140,6 +176,7 @@ export default { ...@@ -140,6 +176,7 @@ export default {
watchStatus: { watchStatus: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.tabIndex = 0
this.currentItem = null this.currentItem = null
this.closeAllPopup() this.closeAllPopup()
} }
...@@ -148,7 +185,7 @@ export default { ...@@ -148,7 +185,7 @@ export default {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (newval) { if (newval) {
if (newval && this.currentItem) this.changePreView(this.currentItem, false) if (newval && this.currentItem && this.tabIndex == 0) this.changePreView(this.currentItem, false, false)
} }
} }
} }
...@@ -178,6 +215,14 @@ export default { ...@@ -178,6 +215,14 @@ export default {
}, },
receptionTrack () { receptionTrack () {
return this.$store.state.user.receptionTrack return this.$store.state.user.receptionTrack
},
boutiqueMediaConfig () {
return this.$store.state.user.boutiqueMediaConfig
},
hasOptionals () {
let flag = false
if (this.show) flag = this.boutiqueMediaConfig[this.currentCarString].optionals && this.boutiqueMediaConfig[this.currentCarString].optionals.length
return flag
} }
}, },
...@@ -187,9 +232,9 @@ export default { ...@@ -187,9 +232,9 @@ export default {
if (this.change_disabled || this.currentCarString == item) return uni.hideLoading() if (this.change_disabled || this.currentCarString == item) return uni.hideLoading()
this.currentCarString = item this.currentCarString = item
this.updateViewKey = Date.now() this.updateViewKey = Date.now()
this.clearCanvas()
}, },
changePreView (e, leave = true) { changePreView (e, leave = true, clearBoard = true) {
let { currentItem } = this, let { currentItem } = this,
{ id, carModelName, name, materialType } = e, { id, carModelName, name, materialType } = e,
key = `${carModelName}_${id}`, key = `${carModelName}_${id}`,
...@@ -198,6 +243,7 @@ export default { ...@@ -198,6 +243,7 @@ export default {
this.currentItem = e this.currentItem = e
this.updateViewKey = Date.now() this.updateViewKey = Date.now()
if (this.isPreview) return if (this.isPreview) return
if (clearBoard) this.clearCanvas()
if (value) { if (value) {
value.openCount += 1 value.openCount += 1
value.entryTime = Date.now() value.entryTime = Date.now()
...@@ -246,6 +292,16 @@ export default { ...@@ -246,6 +292,16 @@ export default {
}, },
clearSkuState () { clearSkuState () {
this.$refs.sku.requested = false this.$refs.sku.requested = false
},
clearCanvas () {
this.$refs.receptionCanvas.clearBoard()
},
changeTab (index) {
if (this.tabIndex == index) return
this.tabIndex = index
if (index == 1) this.previewLeave(this.currentItem)
else this.$refs.sku.changeCar(this.currentCarString)
this.clearCanvas()
} }
} }
} }
...@@ -317,6 +373,7 @@ export default { ...@@ -317,6 +373,7 @@ export default {
height: calc(100vh - 144rpx); height: calc(100vh - 144rpx);
margin-top: 144rpx; margin-top: 144rpx;
padding: 0 0 64rpx 64rpx; padding: 0 0 64rpx 64rpx;
animation: show-view-opacity 0.15s forwards;
.left-content { .left-content {
width: 1328rpx; width: 1328rpx;
height: 100%; height: 100%;
...@@ -377,5 +434,45 @@ export default { ...@@ -377,5 +434,45 @@ export default {
} }
} }
} }
.tabs-box {
position: fixed;
top: 156rpx;
left: 80rpx;
width: 212rpx;
height: 64rpx;
background: #f2f2f2;
border-radius: 40rpx;
box-sizing: border-box;
border: 2rpx solid #f2f2f2;
.tab {
width: 50%;
height: 100%;
justify-content: center;
font-size: 28rpx;
color: #666666;
line-height: 44rpx;
position: relative;
z-index: 2;
transition: all 0.15s;
}
.active {
font-weight: 500;
color: #ffffff;
}
.block {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
width: 50%;
height: 100%;
background: #333333;
border-radius: 40rpx;
transition: all 0.15s;
}
.block-right {
left: 50%;
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<view class="sku-content"> <view class="sku-content">
<view :class="['first-type-box flex',firstClass(boutiqueMediaConfig[currentCar])]"> <view :class="['first-type-box flex',firstClass(list)]">
<view :class="['block',blockClass]"></view> <view :class="['block',blockClass]"></view>
<template v-for="(i,index) in boutiqueMediaConfig[currentCar]"> <template v-for="(i,index) in list">
<view <view
:class="['first-type-item flex',{active:i.tabId == tabId}]" :class="['first-type-item flex',{active:i.tabId == tabId}]"
:key="index" :key="index"
...@@ -121,10 +121,7 @@ export default { ...@@ -121,10 +121,7 @@ export default {
currentCar: { currentCar: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (this.show && this.requested) { if (this.show && this.requested) this.changeCar(newval)
let [item] = this.boutiqueMediaConfig[newval]
this.changeTabId(item.tabId, 0, false)
}
} }
}, },
show: { show: {
...@@ -152,13 +149,21 @@ export default { ...@@ -152,13 +149,21 @@ export default {
}, },
boutiqueMediaConfig () { boutiqueMediaConfig () {
return this.$store.state.user.boutiqueMediaConfig return this.$store.state.user.boutiqueMediaConfig
},
list(){
let item = this.boutiqueMediaConfig[this.currentCar]
return item?.retrofitting || []
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
changeCar (newval) {
let [item] = this.boutiqueMediaConfig[newval].retrofitting
this.changeTabId(item.tabId, 0, false)
},
init (tabId) { init (tabId) {
let index = this.boutiqueMediaConfig[this.currentCar].findIndex(e => e.tabId == tabId) let index = this.boutiqueMediaConfig[this.currentCar].retrofitting.findIndex(e => e.tabId == tabId)
this.changeTabId(tabId, index, false) this.changeTabId(tabId, index, false)
}, },
changeTabId (tabId, index, filter = true) { changeTabId (tabId, index, filter = true) {
...@@ -168,7 +173,7 @@ export default { ...@@ -168,7 +173,7 @@ export default {
this.setSecondList() this.setSecondList()
}, },
async setSecondList () { async setSecondList () {
let secondList = this.boutiqueMediaConfig[this.currentCar], let secondList = this.boutiqueMediaConfig[this.currentCar].retrofitting,
index = secondList.findIndex(e => e.tabId == this.tabId) index = secondList.findIndex(e => e.tabId == this.tabId)
if (index == -1) index = 0 if (index == -1) index = 0
let { list } = secondList[index] let { list } = secondList[index]
...@@ -428,13 +433,5 @@ export default { ...@@ -428,13 +433,5 @@ export default {
} }
} }
} }
@keyframes show-view-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
* @LastEditTime: 2024-05-31 16:07:23 * @LastEditTime: 2024-05-31 16:07:23
--> -->
<template> <template>
<view class="detail-box"> <view
class="detail-box"
@dblclick="dbClick"
>
<view class="nav-bar"> <view class="nav-bar">
<view <view
class="back" class="back"
...@@ -43,6 +46,7 @@ ...@@ -43,6 +46,7 @@
:type="type" :type="type"
:popupImg="item.popupImg" :popupImg="item.popupImg"
@preview="onPreview" @preview="onPreview"
:penSwitch="penSwitch"
/> />
</view> </view>
</template> </template>
...@@ -54,9 +58,17 @@ ...@@ -54,9 +58,17 @@
@choose="choose" @choose="choose"
@finish="open" @finish="open"
:id="id" :id="id"
toolStyle="top:calc(50% - 160rpx);" toolStyle="top:calc(50% - 24rpx);"
/> />
</template> </template>
<template v-if="!isPreview">
<view
class="pen-box"
@click="drawStatus = !drawStatus"
>
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view>
</template>
<finish-step <finish-step
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
...@@ -77,7 +89,6 @@ ...@@ -77,7 +89,6 @@
<script> <script>
import ToolBox from "@/components/ToolBox.vue"; import ToolBox from "@/components/ToolBox.vue";
import FinishStep from "@/components/FinishStep.vue"; import FinishStep from "@/components/FinishStep.vue";
import Membranes from "./membranes.vue";
import Reception from "./components/Reception.vue"; import Reception from "./components/Reception.vue";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import invitation from "./invitation.vue"; import invitation from "./invitation.vue";
...@@ -90,7 +101,6 @@ export default { ...@@ -90,7 +101,6 @@ export default {
components: { components: {
ToolBox, ToolBox,
FinishStep, FinishStep,
Membranes,
Reception, Reception,
invitation, invitation,
Case, Case,
...@@ -114,10 +124,17 @@ export default { ...@@ -114,10 +124,17 @@ export default {
data () { data () {
return { return {
showPreview: false, showPreview: false,
mediaObject: null mediaObject: null,
drawStatus: false,
}; };
}, },
watch: { watch: {
watchStatus: {
immediate: true,
handler (newval) {
if (newval) this.drawStatus = false
}
},
}, },
computed: { computed: {
title () { title () {
...@@ -134,6 +151,12 @@ export default { ...@@ -134,6 +151,12 @@ export default {
watchCustomerInfo () { watchCustomerInfo () {
return this.$store.state.user.customerInfo return this.$store.state.user.customerInfo
}, },
penSwitch () {
return !this.isPreview && this.drawStatus
},
isPreview () {
return this.type == 'preview'
}
}, },
mounted () { mounted () {
}, },
...@@ -219,7 +242,7 @@ export default { ...@@ -219,7 +242,7 @@ export default {
detailUrl: materialUrl detailUrl: materialUrl
} }
this.showPreview = true this.showPreview = true
if (this.type == 'preview') return if (this.isPreview) return
let key = `case-${materialFormat}-${id}`, let key = `case-${materialFormat}-${id}`,
value = this.receptionTrack[key] value = this.receptionTrack[key]
if (value) { if (value) {
...@@ -239,7 +262,7 @@ export default { ...@@ -239,7 +262,7 @@ export default {
}, },
onPreviewBack () { onPreviewBack () {
this.showPreview = false this.showPreview = false
if (this.type == 'preview') return this.mediaObject = null if (this.isPreview) return this.mediaObject = null
const { materialFormat, id } = this.mediaObject, const { materialFormat, id } = this.mediaObject,
key = `case-${materialFormat}-${id}`, key = `case-${materialFormat}-${id}`,
value = this.receptionTrack[key] value = this.receptionTrack[key]
...@@ -268,7 +291,10 @@ export default { ...@@ -268,7 +291,10 @@ export default {
if (customerType == 0 && !watchCustomerInfo.phoneNumber) flag = false if (customerType == 0 && !watchCustomerInfo.phoneNumber) flag = false
} }
return flag return flag
} },
dbClick () {
if (!this.isPreview) this.drawStatus = !this.drawStatus
},
}, },
}; };
</script> </script>
...@@ -327,7 +353,19 @@ export default { ...@@ -327,7 +353,19 @@ export default {
left: 0; left: 0;
} }
} }
.tool-box { .pen-box {
top: 284rpx; position: fixed;
right: 40rpx;
top: calc(50% - 160rpx);
width: 120rpx;
height: 120rpx;
z-index: 10;
box-shadow: 0 4px 12px 0 #00000033;
border-radius: 16rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
} }
</style> </style>
<template> <template>
<view class="container"> <view class="container">
<view class="bg"></view> <wnCanvas
<view class="box"> :canvasId="`c-${madiaId}`"
<view class="data-tabs-box"> :drawStatus="penSwitch"
<view class="data-tabs"> custom
<template v-for="(item, index) in dateList"> :scaleSwitch="false"
<view ref="historyCanvas"
:class="['tab flex', { active: groupIndex == item.id }]" >
:key="index" <template slot="customContent">
@click="changeIndex(item.id)" <view class="bg"></view>
>{{ item.text }}</view> <view class="box">
</template> <view class="data-tabs-box">
<view :class="['active-btn', `active-btn-${groupIndex - 1}`]"></view> <view class="data-tabs">
</view> <template v-for="(item, index) in dateList">
</view>
<scroll-view
class="record-box"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view class="list">
<template v-if="flag">
<template v-if="list.length">
<template v-for="item in list">
<view <view
class="item" :class="['tab flex', { active: groupIndex == item.id }]"
:key="item.id" :key="index"
@click="handleLook(item.goodsList)" @click="changeIndex(item.id)"
> >{{ item.text }}</view>
<image </template>
class="image-box" <view :class="['active-btn', `active-btn-${groupIndex - 1}`]"></view>
v-if="item.payVouchers.length" </view>
:src="item.payVouchers[0].payVoucher" </view>
/> <scroll-view
<image class="record-box"
v-else scroll-y
class="image-box photo" @scrolltolower="pageonReachBottom"
src="../../assets/images/boutique/photos.png" >
/> <view class="list">
<view class="gradient-overlay"></view> <template v-if="flag">
<view class="box-desc"> <template v-if="list.length">
<view class="name"> <template v-for="item in list">
{{ item.customerName.substring(0, 1) + "*" || "-" }} <view
</view> class="item"
<view class="goods-name flex"> :key="item.id"
<view class="goods-label">{{ @click="handleLook(item.goodsList)"
>
<image
class="image-box"
v-if="item.payVouchers.length"
:src="item.payVouchers[0].payVoucher"
/>
<image
v-else
class="image-box photo"
src="../../assets/images/boutique/photos.png"
/>
<view class="gradient-overlay"></view>
<view class="box-desc">
<view class="name">
{{ item.customerName.substring(0, 1) + "*" || "-" }}
</view>
<view class="goods-name flex">
<view class="goods-label">{{
item.goodsList.length item.goodsList.length
? item.goodsList[0].goodsName ? item.goodsList[0].goodsName
: "-" : "-"
}}</view> }}</view>
X{{ item.goodsList.length }}件 X{{ item.goodsList.length }}件
<image <image
class="image-look" class="image-look"
src="../../assets/images/boutique/look.png" src="../../assets/images/boutique/look.png"
/> />
</view> </view>
<template v-for="(k, ind) in itemObject"> <template v-for="(k, ind) in itemObject">
<view <view
class="info flex" class="info flex"
:key="ind" :key="ind"
> >
<view class="label">{{ k.label }}</view> <view class="label">{{ k.label }}</view>
<view :class="{ value: true, bold: k.isBold }">{{ <view :class="{ value: true, bold: k.isBold }">{{
k.format k.format
? formatTime(item[k.key]) ? formatTime(item[k.key])
: item[k.key] || "-" : item[k.key] || "-"
}}</view> }}</view>
</view> </view>
</template> </template>
<view class="info flex"> <view class="info flex">
<view class="label">支付方式</view> <view class="label">支付方式</view>
<view class="value"> <view class="value">
<image <image
class="image-pay" class="image-pay"
:src=" :src="
require(`@/assets/images/boutique/pay_${item.payType}.png`) require(`@/assets/images/boutique/pay_${item.payType}.png`)
" "
/> />
</view>
</view>
<view class="info flex">
<view class="label">实收金额</view>
<view class="value bold">¥ <text>{{ item.totalPrice.toFixed(2) }}</text></view>
</view>
</view> </view>
</view> </view>
<view class="info flex"> </template>
<view class="label">实收金额</view> </template>
<view class="value bold">¥ <text>{{ item.totalPrice.toFixed(2) }}</text></view> <template v-else>
</view> <view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view> </view>
</view> </template>
</template> </template>
</view>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template> </template>
<template v-else> </scroll-view>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</template>
</template>
</view> </view>
<template v-if="nothing"> </template>
<view class="end-text">到底了!</view> </wnCanvas>
</template>
</scroll-view>
</view>
<MessageBox <MessageBox
ref="historyRef" ref="historyRef"
title="订单商品" title="订单商品"
...@@ -145,7 +155,9 @@ export default { ...@@ -145,7 +155,9 @@ export default {
name: '', name: '',
mixins: [Record], mixins: [Record],
props: { props: {
show: Boolean show: Boolean,
madiaId: Number,
penSwitch: Boolean,
}, },
data () { data () {
return { return {
...@@ -214,6 +226,7 @@ export default { ...@@ -214,6 +226,7 @@ export default {
this.pageNum = 1 this.pageNum = 1
this.groupIndex = index this.groupIndex = index
this.getRecordList() this.getRecordList()
if (!isStart) this.$refs.historyCanvas.clearBoard()
}, },
getRecordList () { getRecordList () {
const { pageNum, pageSize, groupIndex } = this, const { pageNum, pageSize, groupIndex } = this,
......
...@@ -243,9 +243,15 @@ export default { ...@@ -243,9 +243,15 @@ export default {
}).then(({ materials, hidePackage }) => { }).then(({ materials, hidePackage }) => {
uni.hideLoading() uni.hideLoading()
let boutiqueMediaConfig = { let boutiqueMediaConfig = {
M5: [], M5: {
M7: [], retrofitting: []
M9: [], },
M7: {
retrofitting: []
},
M9: {
retrofitting: []
}
} }
materials.map(e => { materials.map(e => {
const configItems = [ const configItems = [
...@@ -254,14 +260,19 @@ export default { ...@@ -254,14 +260,19 @@ export default {
] ]
if (!hidePackage) configItems.unshift({ key: 'packages', configIndex: 0 }) if (!hidePackage) configItems.unshift({ key: 'packages', configIndex: 0 })
configItems.map(item => { configItems.map(item => {
boutiqueMediaConfig[e.carModelName].push({ boutiqueMediaConfig[e.carModelName].retrofitting.push({
...defaultConfig[item.configIndex], ...defaultConfig[item.configIndex],
list: e[item.key] list: e[item.key],
}) })
}) })
e.optionals?.map(item => {
item.checked = false
item.warranty = item.warranty?.replace(/<\/?br\s*\/?>|\n/g, '<br>')
})
boutiqueMediaConfig[e.carModelName].optionals = e.optionals
}) })
this.carBannerList.map(e => { this.carBannerList.map(e => {
e.configList = boutiqueMediaConfig[e.title] e.configList = boutiqueMediaConfig[e.title].retrofitting
}) })
this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig
}).catch(error => { }).catch(error => {
......
<template> <template>
<view class="container"> <view class="container">
<view class="bg"></view> <wnCanvas
<view class="box"> :canvasId="`c-${madiaId}`"
<view class="input-box"> :drawStatus="penSwitch"
<input custom
type="text" :scaleSwitch="false"
class="input" ref="invitationCanvas"
v-model="customerNameOrPhone" >
maxlength="11" <template slot="customContent">
@blur="input($event)" <view class="bg"></view>
@focus="focus" <view class="box">
/> <view class="input-box">
<view class="input-tips" v-if="!isSearch" <input
>搜索客户姓名/电话<uni-icons type="text"
type="search" class="input"
class="icon" v-model="customerNameOrPhone"
color="#999" maxlength="11"
size="20" @blur="input($event)"
></uni-icons @focus="focus"
></view> />
<uni-icons <view
v-if="isSearch" class="input-tips"
type="closeempty" v-if="!isSearch"
class="close" >搜索客户姓名/电话<uni-icons
color="#999" type="search"
@click="handleClear" class="icon"
size="20" color="#999"
></uni-icons> size="20"
</view> ></uni-icons></view>
<scroll-view <uni-icons
class="record-box" v-if="isSearch"
scroll-y type="closeempty"
@scrolltolower="pageonReachBottom" class="close"
> color="#999"
<view class="list"> @click="handleClear"
<template v-if="flag"> size="20"
<template v-if="list.length"> ></uni-icons>
<template v-for="item in list"> </view>
<view class="item" :key="item.id" @click="reception(item)"> <scroll-view
<view class="record-box"
:class="['status flex', 'status_' + formatInvite(item)]" scroll-y
>{{ inviteStatus[formatInvite(item)] }}</view @scrolltolower="pageonReachBottom"
> >
<view class="name"> <view class="list">
{{ item.customerName }} <template v-if="flag">
</view> <template v-if="list.length">
<template v-for="(k, ind) in itemObject"> <template v-for="item in list">
<view class="info flex" :key="ind"> <view
<view class="label">{{ k.label }}</view> class="item"
<view class="value">{{ :key="item.id"
@click="reception(item)"
>
<view :class="['status flex', 'status_' + formatInvite(item)]">{{ inviteStatus[formatInvite(item)] }}</view>
<view class="name">
{{ item.customerName }}
</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="ind"
>
<view class="label">{{ k.label }}</view>
<view class="value">{{
k.format k.format
? formatTime(item[k.key], k.key) ? formatTime(item[k.key], k.key)
: item[k.key] || "-" : item[k.key] || "-"
}}</view> }}</view>
</view>
</template>
</view> </view>
</template> </template>
</view> </template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</template>
</template> </template>
</view>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template> </template>
<template v-else> </scroll-view>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</template>
</template>
</view> </view>
<template v-if="nothing"> </template>
<view class="end-text">到底了!</view> </wnCanvas>
</template>
</scroll-view>
</view>
<MessageBox <MessageBox
ref="receptionTips" ref="receptionTips"
content="是否接待当前客户,确定接待直接进入\n「车型加装选购页」" content="是否接待当前客户,确定接待直接进入\n「车型加装选购页」"
...@@ -89,7 +104,9 @@ import Record from "@/mixin/record"; ...@@ -89,7 +104,9 @@ import Record from "@/mixin/record";
export default { export default {
mixins: [Record], mixins: [Record],
props: { props: {
show: Boolean show: Boolean,
madiaId: Number,
penSwitch: Boolean,
}, },
data () { data () {
return { return {
...@@ -107,26 +124,26 @@ export default { ...@@ -107,26 +124,26 @@ export default {
chooseItem: {} chooseItem: {}
} }
}, },
watch:{ watch: {
show:{ show: {
handler(val) { handler (val) {
if(val) this.init() if (val) this.init()
this.$refs.receptionTips?.close() this.$refs.receptionTips?.close()
}, },
immediate:true immediate: true
} }
}, },
methods: { methods: {
init () { init () {
this.customerNameOrPhone = ''; this.customerNameOrPhone = '';
console.log('init') console.log('init')
setTimeout(()=>{ setTimeout(() => {
this.isSearch = false this.isSearch = false
this.pageNum = 1 this.pageNum = 1
this.flag = false this.flag = false
this.getRecordList() this.getRecordList()
},300) }, 300)
}, },
//已预约的并且预约时间小于当前时间的,显示超时未到店,否则显示已预约 //已预约的并且预约时间小于当前时间的,显示超时未到店,否则显示已预约
...@@ -158,12 +175,14 @@ export default { ...@@ -158,12 +175,14 @@ export default {
this.pageNum = 1 this.pageNum = 1
this.flag = false this.flag = false
this.getRecordList() this.getRecordList()
this.clearCanvas()
}, },
focus () { focus () {
this.isSearch = true this.isSearch = true
}, },
handleClear () { handleClear () {
this.init() this.init()
this.clearCanvas()
}, },
getRecordList () { getRecordList () {
const { pageNum, pageSize, customerNameOrPhone } = this, const { pageNum, pageSize, customerNameOrPhone } = this,
...@@ -184,7 +203,11 @@ export default { ...@@ -184,7 +203,11 @@ export default {
this.$emit('reception', { this.$emit('reception', {
item: this.chooseItem item: this.chooseItem
}) })
}, 200) }, 200),
clearCanvas () {
this.$refs.invitationCanvas.clearBoard()
},
}, },
} }
</script> </script>
...@@ -203,7 +226,7 @@ export default { ...@@ -203,7 +226,7 @@ export default {
height: 800rpx; height: 800rpx;
position: absolute; position: absolute;
left: 0; left: 0;
background-image: url("../../assets/images/boutique/record-bg.png"); background-image: url('../../assets/images/boutique/record-bg.png');
background-size: 100% 100%; background-size: 100% 100%;
top: 0; top: 0;
} }
......
<template>
<view style="font-size: 0;">
<!-- :src="require('@/assets/images/boutique/detail.webp')" -->
<image
class="detail-img"
:src="detailUrl"
mode="widthFix"
/>
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="32"
></uni-icons>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: '',
data () {
return {
detailUrl: ''
}
},
onLoad (options) {
console.log(options, ' =')
this.detailUrl = options.detailUrl
},
methods: {
back () {
uni.navigateBack({
delta: 1
})
}
},
}
</script>
<style scoped lang="scss">
.nav-bar {
position: fixed;
width: 100%;
height: 96rpx;
left: 0;
top: 48rpx;
z-index: 9;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
}
.title {
width: 100%;
text-align: center;
font-weight: 700;
}
}
.detail-img {
width: 100%;
height: auto;
object-fit: cover;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -94,11 +94,11 @@ export default { ...@@ -94,11 +94,11 @@ export default {
mounted () { mounted () {
}, },
methods: { methods: {
search () { search () {
this.edit = false this.edit = false
console.log(this.searchValue) console.log(this.searchValue)
}, },
openInput () { openInput () {
this.edit = true this.edit = true
this.inputFocus = true this.inputFocus = true
}, },
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
background: #ffffff; background: #ffffff;
border: 3rpx solid #A8C1FF;; border: 3rpx solid #a8c1ff;
border-radius: 16rpx; border-radius: 16rpx;
box-sizing: border-box; box-sizing: border-box;
color: #333; color: #333;
...@@ -179,8 +179,8 @@ export default { ...@@ -179,8 +179,8 @@ export default {
.select-box { .select-box {
margin: 32rpx 0; margin: 32rpx 0;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 20rpx; gap: 32rpx;
overflow-y: scroll; overflow-y: scroll;
max-height: 50vh; max-height: 50vh;
padding-bottom: 60rpx; padding-bottom: 60rpx;
......
...@@ -98,13 +98,14 @@ export default { ...@@ -98,13 +98,14 @@ export default {
} }
} }
} catch (error) { } catch (error) {
this.$sendSentry(`选择场景异常:merchantId:${userInfo.shopMerchantId},merchantName:${userInfo.shopMerchantName},sceneType:${sceneType},失败原因:${JSON.stringify(error)}`)
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: error, title: typeof error == "string" ? error : error.toString(),
icon: 'none' icon: 'none'
}) })
console.log(error) console.log(error)
this.$sendSentry(`选择场景异常:merchantId:${userInfo?.shopMerchantId},merchantName:${userInfo?.shopMerchantName},sceneType:${sceneType},失败原因:${typeof error == "string" ? error : error.toString()}`)
} }
}, },
async jump (userInfo, data) { async jump (userInfo, data) {
......
...@@ -61,31 +61,11 @@ ...@@ -61,31 +61,11 @@
<view <view
class="case-item" class="case-item"
:key="item.id" :key="item.id"
@click="jumpDetail(item)"
> >
<image <case-item
class="img" :item="item"
:src="item.cover" :visitsId="visitsId"
></image> />
<view class="case-info">
<view class="case-name text-hide">{{ item.title }}</view>
<template v-for="(j, ind) in caseInfo">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{ j.label }}:</view>
<view :class="['case-value', j.class]">
<template v-if="j.format">
{{ j.format(item) }}
</template>
<template v-else>
{{ item[j.key] || '--' }}
</template>
</view>
</view>
</template>
</view>
</view> </view>
</template> </template>
</template> </template>
...@@ -115,9 +95,11 @@ ...@@ -115,9 +95,11 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import dayjs from 'dayjs' import dayjs from 'dayjs'
import PackagePopup from './components/PackagePopup.vue' import PackagePopup from './components/PackagePopup.vue'
import CaseItem from '@/components/HomeFrame/components/CaseItem.vue'
export default { export default {
components: { components: {
PackagePopup PackagePopup,
CaseItem
}, },
data () { data () {
return { return {
...@@ -259,7 +241,6 @@ export default { ...@@ -259,7 +241,6 @@ export default {
}) })
e.tags = tags.join('、') e.tags = tags.join('、')
e.goods = goods.join('、') e.goods = goods.join('、')
if (!e.cover) e.cover = 'https://img02.glsx.com.cn/weapp/resource/app-tape/common/default-cover.webp'
}) })
this.list[currentPage - 1] = list this.list[currentPage - 1] = list
this.flag = true this.flag = true
...@@ -277,28 +258,6 @@ export default { ...@@ -277,28 +258,6 @@ export default {
animationDuration: 100 animationDuration: 100
}) })
}, },
jumpDetail (item) {
// 类型:0-图片;1-视频;2-pdf;3-富文本
let url = `/pages/common/caseDetail?id=${item.id}&visitsId=${this.visitsId}`
if (item.type != 3) {
let fileUrl = item?.detailInfos[0]?.image
if (item.type == 2) {
// uni.downloadFile({
// url: fileUrl,
// success (res) {
// var filePath = res.tempFilePath;
// }
// })
// return
url = `/pages/common/webview?fileUrl=${fileUrl}&title=${item.title}&id=${item.id}&visitsId=${this.visitsId}`
}
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}`
})
},
pageonReachBottom () { pageonReachBottom () {
let { currentPage, total, nothing, pageSize } = this let { currentPage, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing' if (!nothing) nothing = 'nothing'
...@@ -338,7 +297,7 @@ export default { ...@@ -338,7 +297,7 @@ export default {
background-image: url('@/assets/images/common/page-bg.webp'); background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%; background-size: 100%;
box-sizing: border-box; box-sizing: border-box;
padding-top: 176rpx; padding-top: 160rpx;
.nav-bar { .nav-bar {
position: fixed; position: fixed;
width: 100%; width: 100%;
...@@ -442,12 +401,15 @@ export default { ...@@ -442,12 +401,15 @@ export default {
font-size: 28rpx; font-size: 28rpx;
color: #292d33; color: #292d33;
line-height: 44rpx; line-height: 44rpx;
max-height: 50vh;
overflow-y: scroll;
word-break: break-all;
} }
} }
} }
} }
.case-box { .case-box {
height: 1004rpx; height: 1020rpx;
padding: 0 !important; padding: 0 !important;
.case-scroll-box { .case-scroll-box {
height: calc(100% - 104rpx); height: calc(100% - 104rpx);
...@@ -460,35 +422,6 @@ export default { ...@@ -460,35 +422,6 @@ export default {
.case-item { .case-item {
width: 496rpx; width: 496rpx;
height: 588rpx; height: 588rpx;
background: #ffffff;
box-shadow: 0 8rpx 24rpx 0 #2c66f71a;
border-radius: 16rpx;
display: flex;
flex-direction: column;
overflow: hidden;
.img {
width: 100%;
height: 324rpx;
}
.case-name {
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 48rpx;
padding: 16rpx 32rpx 8rpx;
}
.case-text {
align-items: flex-start;
font-size: 24rpx;
color: #666666;
line-height: 40rpx;
padding: 0 32rpx;
margin-bottom: 2rpx;
}
.case-label {
width: 120rpx;
flex-shrink: 0;
}
} }
} }
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
:ulList="item.ulList" :ulList="item.ulList"
:screenList="item.screenList" :screenList="item.screenList"
@onProductModel="productModelStatus = $event" @onProductModel="productModelStatus = $event"
:isPreview="type == 'preview'" :isPreview="isPreview"
:isByd="isByd" :isByd="isByd"
/> />
</view> </view>
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
penSwitch () { penSwitch () {
return this.type != 'preview' && this.drawStatus return !this.isPreview && this.drawStatus
}, },
watchPayInfo () { watchPayInfo () {
return this.$store.state.user.paymentType.length ? true : false return this.$store.state.user.paymentType.length ? true : false
...@@ -152,6 +152,9 @@ export default { ...@@ -152,6 +152,9 @@ export default {
const { channelType } = uni.$storage.get("userInfo") const { channelType } = uni.$storage.get("userInfo")
return channelType == 2 return channelType == 2
}, },
isPreview(){
return this.type == 'preview'
}
}, },
watch: { watch: {
...@@ -198,7 +201,7 @@ export default { ...@@ -198,7 +201,7 @@ export default {
this.$refs.pay.show() this.$refs.pay.show()
}, },
dbClick () { dbClick () {
if (this.type != 'preview') this.drawStatus = !this.drawStatus if (!this.isPreview) this.drawStatus = !this.drawStatus
}, },
touchStart (e) { touchStart (e) {
if (!this.drawStatus && e.changedTouches?.length) { if (!this.drawStatus && e.changedTouches?.length) {
......
...@@ -229,7 +229,13 @@ export default { ...@@ -229,7 +229,13 @@ export default {
errorImg (index) { errorImg (index) {
this.moduleList[index].showAlt = true; this.moduleList[index].showAlt = true;
}, },
async start () { async start () {
if (this.recording) return
uni.showLoading({
mask: true
})
const result = await this.$permision.requestAndroidPermission( const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO" "android.permission.RECORD_AUDIO"
); );
...@@ -246,8 +252,10 @@ export default { ...@@ -246,8 +252,10 @@ export default {
this.id = this.moduleList[0].id; this.id = this.moduleList[0].id;
this.type = "edit"; this.type = "edit";
this.recording = true; this.recording = true;
setTimeout(() => {
uni.hideLoading();
}, 1e3)
}, },
toDetail (item) { toDetail (item) {
this.chooseItem = item; this.chooseItem = item;
this.$refs.home.previewRef.open(); this.$refs.home.previewRef.open();
......
...@@ -3,50 +3,59 @@ ...@@ -3,50 +3,59 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-04-07 18:15:11 * @Date: 2024-04-07 18:15:11
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-11 21:22:55 * @LastEditTime: 2024-10-21 11:49:44
*/ */
// import { setToken, getToken, removeToken } from '@/utils/token';; // import { setToken, getToken, removeToken } from '@/utils/token';;
import utils from "@/utils/utils"; import utils from '@/utils/utils'
// const recorderManager = uni.getRecorderManager(); // const recorderManager = uni.getRecorderManager();
import upload from "@/utils/ossUploadFile/uploadFile.js"; import upload from '@/utils/ossUploadFile/uploadFile.js'
import store from "../index"; import store from '../index'
export default { export default {
namespaced: true, namespaced: true,
state() { state() {
return { return {
booksList: [], booksList: [],
audioList: [], audioList: [],
receptionStatus: 1, receptionStatus: '',
endReasonType: 0, endReasonType: 0,
perRecordNumber: 0,
audioInfo: { audioInfo: {
audioStatus: "", audioStatus: '',
endReasonType: 0, endReasonType: 0,
receptionStartTime: "", receptionStartTime: '',
receptionEndTime: "", receptionEndTime: ''
}, }
}; }
}, },
mutations: { mutations: {
setAudioInfo(state, data) { setAudioInfo(state, data) {
if (data.audioStatus == "start") { if (data.audioStatus == 'start') {
data.receptionStartTime = utils.convertDateTimeFormat(new Date(), "/"); data.receptionStartTime = utils.convertDateTimeFormat(new Date(), '/')
data.receptionEndTime = ''
} }
if (data.audioStatus == "end") { if (data.audioStatus == 'end') {
data.receptionEndTime = utils.convertDateTimeFormat(new Date(), "/"); data.receptionEndTime = utils.convertDateTimeFormat(new Date(), '/')
} }
state.audioInfo = Object.assign(state.audioInfo, data); state.audioInfo = Object.assign(state.audioInfo, data)
}, },
setReceptionStatus(state, data) { setReceptionStatus(state, data) {
state.receptionStatus = data; state.receptionStatus = data
}, },
setAudioList(state, data) { setAudioList(state, data) {
state.audioList = data; state.audioList = data
}, },
setBooks(state, data) { setBooks(state, data) {
state.booksList = data; state.booksList = data
}, },
setPerRecordNumber(state, data) {
state.perRecordNumber = data
}
}, },
actions: { actions: {
setPerRecordNumber({ commit }, value) {
console.log(value)
commit('setPerRecordNumber', value)
}
// startAudio({ commit, state, dispatch }) { // startAudio({ commit, state, dispatch }) {
// if (state.isStart) return; // if (state.isStart) return;
// commit("setAudioStart", true); // commit("setAudioStart", true);
...@@ -115,5 +124,5 @@ export default { ...@@ -115,5 +124,5 @@ export default {
// commit("setReceptionStatus", 0); // commit("setReceptionStatus", 0);
// uni.$storage.set("storageFile", ""); // uni.$storage.set("storageFile", "");
// }, // },
}, }
}; }
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
}, },
setReceptionTrack ({ state }, { key, value }) { setReceptionTrack ({ state }, { key, value }) {
state.receptionTrack[key] = value state.receptionTrack[key] = value
// console.log(JSON.parse(JSON.stringify(state.receptionTrack))) console.log(JSON.parse(JSON.stringify(state.receptionTrack)))
}, },
clearReceptionTrack ({ state }) { clearReceptionTrack ({ state }) {
state.receptionTrack = {} state.receptionTrack = {}
......
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
font-family: 'number-700'; font-family: 'number-700';
src: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf'); src: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf');
} }
@font-face { @font-face {
font-family: 'number-400'; font-family: 'number-400';
src: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-400-Regular.ttf'); src: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-400-Regular.ttf');
} }
@keyframes show-view { @keyframes show-view {
0% { 0% {
opacity: 0; opacity: 0;
...@@ -73,10 +75,29 @@ ...@@ -73,10 +75,29 @@
} }
@media screen and (min-width: 500px){ @media screen and (min-width: 500px) {
.fixforpc-width{ .fixforpc-width {
min-width: auto !important; min-width: auto !important;
width: fit-content !important; width: fit-content !important;
padding: 20rpx 46rpx !important; padding: 20rpx 46rpx !important;
} }
}
.select-box {
.select-item {
display: flex;
justify-content: center;
align-items: center;
}
}
@keyframes show-view-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
} }
\ No newline at end of file \ No newline at end of file
// export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/' // export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/'
// import util from '~/utils/util' // import util from '~/utils/util'
export const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/app-tape/"; export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/app-tape/'
// 缓存get方法为空的默认指定值 // 缓存get方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ["sessionId", "merchantId", "userInfo"]; export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
// 缓存get方法key的对应才映射值 // 缓存get方法key的对应才映射值
export const STORAGE_OBJECTkEY = { export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY, DEFAULT_GET_STORAGEKEY,
mock_data: "mock_data", mock_data: 'mock_data',
storageFile: "storageFile", storageFile: 'storageFile',
userInfo: "userInfo", userInfo: 'userInfo',
customerInfo: "customerInfo", customerInfo: 'customerInfo',
noSignInUuid: "noSignInUuid", noSignInUuid: 'noSignInUuid',
noviceGuideStatus: "noviceGuideStatus", noviceGuideStatus: 'noviceGuideStatus',
carBrandList: "carBrandList", carBrandList: 'carBrandList',
employeeList: "employeeList", employeeList: 'employeeList',
recordList: "recordList", recordList: 'recordList',
recordSuccessList: "recordSuccessList", preRecordList: 'preRecordList',
historyList: "historyList", preRecordId: 'preRecordId',
storageVersion: "storageVersion", recordSuccessList: 'recordSuccessList',
byd_mock_data:'byd_mock_data', historyList: 'historyList',
boutique_mock_data:'boutique_mock_data' storageVersion: 'storageVersion',
}; byd_mock_data: 'byd_mock_data',
boutique_mock_data: 'boutique_mock_data'
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-16 09:55:40
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-10-16 13:51:15
* @FilePath: \gl-tape\utils\cache\storageApi.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { STORAGE_OBJECTkEY } from './constantData' import { STORAGE_OBJECTkEY } from './constantData'
// console.log(storage) // console.log(storage)
/** */ /** */
...@@ -59,16 +67,16 @@ export function setSystem_info(that) { ...@@ -59,16 +67,16 @@ export function setSystem_info(that) {
}) })
} }
export function getRecords() { export function getRecords(record = 'recordList') {
return storage.get(STORAGE_OBJECTkEY.recordList) return storage.get(STORAGE_OBJECTkEY[record])
} }
export function setRecords(data) { export function setRecords(data, record = 'recordList') {
storage.set(STORAGE_OBJECTkEY.recordList, data) storage.set(STORAGE_OBJECTkEY[record], data)
} }
export function removeRecords() { export function removeRecords(record = 'recordList') {
storage.rm(STORAGE_OBJECTkEY.recordList) storage.rm(STORAGE_OBJECTkEY[record])
} }
export default{ export default {
getSessionId, getSessionId,
setSessionId, setSessionId,
getUserInfo, getUserInfo,
......
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-10-14 17:38:35
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-10-18 18:09:15
* @FilePath: \gl-tape\utils\recordManager\interruptRecord.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import RecordManager from '../RecordManager.js'
import utils from '@/utils/utils.js'
import { storageApi } from '../cache'
import store from '@/store'
class InterruptRecord extends RecordManager {
constructor() {
super()
const records = this.getRecords()
store.dispatch('audio/setPerRecordNumber', records.length)
// console.log(store)
// storageApi.removeRecords('preRecordList')
// storageApi.removeRecords('preRecordId')
// storageApi.removeRecords('recordList')
}
records = {}
pathName = null
/**
* 获取记录列表
*
* @returns {Array} - 从 storageApi 获取的记录列表
*/
getRecords() {
console.log(storageApi.getRecords('preRecordList'), 'ddd')
return storageApi.getRecords('preRecordList') || []
}
/**
* 获取待提交的记录id
*
*/
getPreRecord() {
const id = storageApi.getRecords('preRecordId')
if (!id) {
return
}
return this.getRecordById(id)
}
/**
* 删除待提交的记录
*
*/
removePreRecord(id) {
this.removeRecord(id)
storageApi.setRecords('', 'preRecordId')
}
/**
* 初始化保存记录
*
* @param {string} name - 录音文件目录名
* @returns {void} - 此函数不返回任何值
*/
async addPreRecords(params) {
console.log(storageApi.getRecords('preRecordId'), 6666)
if (storageApi.getRecords('preRecordId')) {
this.addPreAudio()
return
}
console.log('pathName')
const pathName = await this.getAudioPathName()
const audioPath = await this.getAudioPath(pathName)
const id = utils.uuid()
storageApi.setRecords(id, 'preRecordId')
const ids = storageApi.getRecords('preRecordId')
console.log(ids, 'id')
this.records = {
id,
...params,
audioPath: [audioPath]
}
const records = this.getRecords() || []
records.push(this.records)
this.setRecords(records)
}
/**
* 添加录音文件
*
* @returns {void} - 此函数不返回任何值
*/
async addPreAudio() {
const pathName = await this.getAudioPathName()
const audioPath = await this.getAudioPath(pathName)
this.records.audioPath.push(audioPath)
const records = this.getPreRecord()
const params = { ...records, ...this.records }
this.updateRecord(params)
}
/**
* 更新参数
*
* @returns {void} - 此函数不返回任何值
*/
updatePreRecords(params, isRemoveId) {
if (isRemoveId) {
storageApi.setRecords('', 'preRecordId')
}
const updateParams = { ...this.records, ...params }
console.log(updateParams, 'updateParams')
this.updateRecord(updateParams)
}
/**
* 获取录音文件全路径
*
* @param {string} name - 录音文件目录名
* @returns {void} - 此函数不返回任何值
*/
async getAudioPath(name) {
console.log(name, 'name')
return new Promise(async (resolve, reject) => {
const path = await utils.getAudioFilePath(name + '/recorder')
console.log(path, 'path')
plus.io.resolveLocalFileSystemURL(
path,
e => {
var dirR = e.createReader()
dirR.readEntries(
function (er) {
Promise.all(
er.map((item, index) => {
return new Promise(resolve => {
item.getMetadata(metadata => {
resolve({
index: index,
name: item.name,
modificationTime: new Date(metadata.modificationTime).getTime()
})
})
})
})
).then(results => {
console.log(results, 'results')
// 找到修改时间最晚的文件
const latest = results.reduce(
(acc, current) => {
if (current.modificationTime > acc.modificationTime) {
return current
}
return acc
},
{ modificationTime: 0 }
)
// 修改时间最晚的文件名
resolve(path + '/' + latest.name)
})
},
err => {
reject(err)
}
)
},
err => {}
)
})
}
/**
* 获取录音文件名
*
* @returns {void} - 此函数不返回任何值
*/
async getAudioPathName() {
return new Promise(async (resolve, reject) => {
const path = await utils.getAudioFilePath()
plus.io.resolveLocalFileSystemURL(
path,
e => {
var dirR = e.createReader()
dirR.readEntries(
function (er) {
for (var i = 0; i < er.length; i++) {
if (er[i].name.startsWith('uniapp_temp')) {
resolve(er[i].name)
}
// er[i].getMetadata(function (metadata) {
// console.log(metadata.modificationTime, '修改时间')
// })
}
},
err => {
console.log(err)
}
)
},
err => {}
)
})
}
/**
* 设置记录列表
*
* @param {Array} records - 要设置的记录列表
* @returns {void} - 此函数不返回任何值
*/
setRecords(records) {
storageApi.setRecords(records, 'preRecordList')
console.log(records, 'records')
store.dispatch('audio/setPerRecordNumber', records.length)
}
}
export default new InterruptRecord()
...@@ -170,6 +170,10 @@ async function getFileSaveFolderOnClient() { ...@@ -170,6 +170,10 @@ async function getFileSaveFolderOnClient() {
const rootPath = await getFilePath() const rootPath = await getFilePath()
return `file://${rootPath}uniapp_save/` return `file://${rootPath}uniapp_save/`
} }
async function getAudioFilePath(path = '') {
const rootPath = await getFilePath()
return `file://${rootPath}${path}`
}
export default { export default {
compareVersions, compareVersions,
convertDateTimeFormat, convertDateTimeFormat,
...@@ -180,5 +184,6 @@ export default { ...@@ -180,5 +184,6 @@ export default {
isNetWork, isNetWork,
uuid, uuid,
getFilePath, getFilePath,
getFileSaveFolderOnClient getFileSaveFolderOnClient,
getAudioFilePath
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!