Commit 29309f7d by 前端

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

上线合并

See merge request !17
2 parents 198fed9f 190dece2
......@@ -4,20 +4,24 @@
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "remote"
},
"default" : {
"launchtype" : "local"
},
"h5" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud"
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud"
},
{
"playground" : "standard",
......
......@@ -34,6 +34,14 @@ module.exports = {
...data
})
},
searchRecordingEndTime(data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.customer.searchRecordingEndTime',
projectName: 'boutique',
...data
})
},
getToken(data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.customer.oss.getToken',
......
......@@ -970,7 +970,7 @@ export default {
position: absolute;
background: rgba(0, 0, 0, 0);
pointer-events: none;
z-index: 9;
z-index: 99;
}
.draw-canvas {
pointer-events: auto;
......
......@@ -47,6 +47,21 @@
<script type='text/ecmascript-6'>
export default {
name: 'CarBrands',
props: {
carBrandKey: {//品牌key
type: String,
default: 'carBrand'
},
carModelKey: {//车型key
type: String,
default: 'carModel'
},
echoData: {
type: Object,
default: () => ({})
},
customBoolean: Boolean
},
data () {
return {
carlist: [],
......@@ -68,13 +83,13 @@ export default {
return this.$store.state.user.historyStatus
},
carModel () {
return this.$store.state.user.customerInfo.carModel
return this.customBoolean ? this.echoData[this.carModelKey] : this.$store.state.user.customerInfo.carModel
},
carBrandList () {
return this.$store.state.user.carBrands || []
},
carBrand () {
return this.$store.state.user.customerInfo.carBrand
return this.customBoolean ? this.echoData[this.carBrandKey] : this.$store.state.user.customerInfo.carBrand
},
boutiqueDefaultCarBrandId () {
return this.$store.state.user.boutiqueDefaultCarBrandId
......@@ -127,7 +142,7 @@ export default {
},
selectCar (e, auto = false, index, autoHideLoading = true) {
let { clickFlga } = this
if (clickFlga) return
if (clickFlga) return
this.clickFlga = true
this.selectItem = {
carBrand: e.brandName,
......@@ -192,19 +207,19 @@ export default {
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
......
......@@ -3,8 +3,8 @@
ref="customerTagstVisible"
position="bottom"
:isFooter="false"
title="请选择客户标签"
:maxHeight="1000"
:title="title"
:maxHeight="1040"
@close="$emit('close')"
>
<view class="select-views">
......@@ -16,7 +16,7 @@
<view class="select-title">{{ i.labelName }}</view>
<view class="select-box">
<view
class="select-item"
class="select-item flex"
:class="{ checked: checkedItem(item) }"
@click="handleSelect(item)"
v-for="(item, ind) in i.nextList"
......@@ -33,10 +33,10 @@
<view class="footer-btns">
<view
class="btn cancel"
@click="close"
>取消</view>
@click="clearSwitch ? clear() : close()"
>{{cancelText}}</view>
<view
:class="['btn',{disabled:component_chooseList.length == 0}]"
:class="['btn',{disabled: disabled}]"
@click="choose"
>确定</view>
</view>
......@@ -47,7 +47,27 @@
export default {
name: 'CustomerTags',
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 () {
return {
......@@ -73,6 +93,9 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
disabled () {
return this.disabledSwitch && this.component_chooseList.length == 0
}
},
mounted () {
},
......@@ -80,10 +103,11 @@ export default {
open () {
this.$refs.customerTagstVisible.open()
const userInfo = uni.$storage.get("userInfo"),
{ sceneType } = userInfo;
{ sceneType } = userInfo,
{ sceneNumber } = this
uni.$api.customerApi
.findCustomerTags({
scene: sceneType,
scene: sceneNumber > -1 ? sceneNumber : sceneType,
})
.then((res) => {
this.list = res || []
......@@ -105,9 +129,13 @@ export default {
return component_chooseList.findIndex(e => e.labelId == item.labelId) != -1
},
choose () {
if (this.component_chooseList.length == 0) return
if (this.disabled) return
this.$emit('select', this.component_chooseList)
this.close();
},
clear () {
this.component_chooseList = []
this.$forceUpdate()
}
}
}
......@@ -116,7 +144,7 @@ export default {
<style scoped lang='scss'>
.select-views {
overflow-y: scroll;
max-height: 50vh;
max-height: 60vh;
position: relative;
padding-bottom: 128rpx;
.select-group {
......@@ -129,18 +157,21 @@ export default {
.select-box {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
justify-content: center;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
position: relative;
box-sizing: border-box;
padding: 13rpx 40rpx;
word-break: break-all;
line-height: 44rpx;
.sprite-icon {
display: none;
position: absolute;
......
<template>
<MessageBox
ref="employeeBoxVisible"
position="bottom"
:isFooter="false"
:title="`请选择${title}`"
:maxHeight="1000"
@close="$emit('close')"
>
<MessageBox ref="employeeBoxVisible" position="bottom" :isFooter="false" :title="`请选择${title}`" :maxHeight="1000" @close="$emit('close')">
<view class="select-box">
<view
class="select-item"
:class="{ checked: salesUuid == item.uuid }"
@click="handleSelect(item)"
v-for="(item, index) in employeeList"
:key="index"
>
<view class="select-item" :class="{ checked: salesUuid == item.uuid }" @click="handleSelect(item)" v-for="(item, index) in employeeList" :key="index">
{{ item.staffName }}
</view>
</view>
</MessageBox>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'Employee',
props: {
title: {
type: String,
default: '销售'
},
salesPropsUuid: {
type: String,
default: ''
}
},
data () {
......@@ -47,7 +38,7 @@ export default {
return this.$store.state.user.historyStatus
},
salesUuid () {
return this.$store.state.user.customerInfo.salesUuid
return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid
},
employeeList () {
return this.$store.state.user.employeeList
......@@ -81,27 +72,27 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<view class="step">
<MessageBox
ref="formRef"
@cancel="cancel"
@confirm="submit"
:cancelBtnText="`${step == 1? '取消' : '上一步'}`"
:confirmBtnText="`${sceneType == 0 ?step == 1? '下一步' : '完成接待': '完成接待'}`"
:title="`${step == 1? '客户信息完善' : '结果反馈'}`"
:popupW="820"
:maxHeight="820"
:isAutoClose="false"
>
<MessageBox 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">
<template v-if="step == 1">
<template v-if="!check(true)">
<view
class="error-tip"
v-if="errorTip"
>以下信息不能为空,请完善信息后保存</view>
<view
class="pop-tips"
v-else
>{{tips}}</view>
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view>
<view class="pop-tips" v-else>{{ tips }}</view>
</template>
<view class="form">
<template v-for="(i, index) in formObject">
<view
class="form-item"
:key="index"
>
<view :class="['label',{required:i.required}]">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) && i.required },{disabled:customerType == 0 || i.disabled}]">
<view class="form-item" :key="index">
<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'">
<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;"
/>
<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;" />
</template>
<template v-else>
<view
:class="['select', `${formData[i.key]? '' : 'placeholder'}`]"
@click="showPopup(i)"
>
<view :class="['select', `${formData[i.key] ? '' : 'placeholder'}`]" @click="showPopup(i)">
{{ formData[i.key] || i.placeholder }}
<uni-icons
class="arrow"
type="down"
:size="16"
></uni-icons>
<uni-icons class="arrow" type="down" :size="16"></uni-icons>
</view>
</template>
</view>
......@@ -64,42 +29,25 @@
<template v-else>
<view class="pop-tips">请完善本次接待结果</view>
<view class="choose-box">
<template v-for="(i,index) in resultList">
<view
:class="['choose-item', `${i.status == receptionStatus ? i.status == 1 ? 'success' : 'error' : ''}`]"
:key="index"
@click="chooseResult(i.status)"
>
<view :class="['sprite-icon' , `icon-face-${i.status == receptionStatus ? `${i.icon}-active` : i.icon }`]"></view>
{{ i.text}}
<template v-for="(i, index) in resultList">
<view :class="['choose-item', `${i.status == receptionStatus ? (i.status == 1 ? 'success' : 'error') : ''}`]" :key="index" @click="chooseResult(i.status)">
<view :class="['sprite-icon', `icon-face-${i.status == receptionStatus ? `${i.icon}-active` : i.icon}`]"></view>
{{ i.text }}
</view>
</template>
</view>
</template>
</view>
</MessageBox>
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
/>
<employee
ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')"
/>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="数据保存成功"
:duration="1500"
></uni-popup-message>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" />
<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>
</view>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue'
import { mapMutations } from "vuex";
......@@ -305,7 +253,6 @@ export default {
},
success (receptionStatus) {
this.$refs.successRef.open();
this.setReceptionStatus(receptionStatus);
this.$emit('submit', receptionStatus)
},
inputCustomer () {
......@@ -346,12 +293,13 @@ export default {
},
chooseResult (val) {
this.receptionStatus = val
this.setReceptionStatus(val);
}
}
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.pop-tips {
background: rgba(44, 102, 247, 0.1);
color: #2c66f7;
......@@ -470,4 +418,4 @@ export default {
border-color: #f247241a;
}
}
</style>
\ 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
......@@ -48,8 +48,27 @@
></view>
</view>
</view>
<view
class="scene-box flex"
v-if="firstIndex == 2"
>
<view class="scene-tabs flex">
<template v-for="(i, index) in sceneList">
<view
:class="['tab flex', { active: caseParams.scene == i.id }]"
:key="index"
@click="changeScene(i.id)"
>{{ i.text }}</view>
</template>
</view>
<view
class="search-btn flex"
@click="$refs.customerTagstVisible.open()"
>标签筛选</view>
</view>
<scroll-view
:class="['record-list', {'type-1':firstIndex == 1}]"
:class="['record-list', recordClass]"
scroll-y
@scrolltolower="pageonReachBottom"
>
......@@ -58,87 +77,101 @@
<template v-if="list.length && list[0] && list[0].length">
<template v-for="(i,index) in list">
<template v-for="(item,cindex) in i">
<view
class="item"
:key="item.id"
@longpress="longPress(item,index,cindex)"
@click="jumpDetail(item.id)"
>
<template v-if="firstIndex == 2">
<view
class="case-item"
:key="item.id"
>
<case-item
:item="item"
:source="2"
imgStyle="height:290rpx"
/>
</view>
</template>
<template v-else>
<view
v-if="firstIndex == 1"
:class="[
class="item"
:key="item.id"
@longpress="longPress(item,index,cindex)"
@click="jumpDetail(item.id)"
>
<view
v-if="firstIndex == 1"
:class="[
'status flex',
{ deal: item.receptionResult == 1 },
]"
>{{
>{{
{
1: "成交",
0: "战败",
}[item.receptionResult]
}}</view>
<view class="name">
{{ item.ownerName }}
</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="`${item.id}-${ind}`"
v-if="showItem(k.key)"
>
<view class="label">{{ k.label }}</view>
<view class="value text-hide">{{ item[k.key] || "-" }}</view>
<view class="name">
{{ item.ownerName }}
</view>
</template>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="`${item.id}-${ind}`"
v-if="showItem(k.key)"
>
<view class="label">{{ k.label }}</view>
<view class="value text-hide">{{ item[k.key] || "-" }}</view>
</view>
</template>
<view
:class="['mask',{'show-mask':item.maskStatus}]"
@click.stop
>
<view
class="mask-close"
@click.stop="closeMask(index,cindex)"
:class="['mask',{'show-mask':item.maskStatus}]"
@click.stop
>
<uni-icons
type="closeempty"
:size="16"
color="#fff"
></uni-icons>
</view>
<template v-if="item.showDel">
<view class="mask-del-box flex">
是否删除该客户档案
<view class="btns flex">
<view
class="btn cancel"
@click.stop="switchDel(index,cindex)"
>取消</view>
<view
class="btn"
@click.stop="delItem(item.id,index,cindex)"
>确定</view>
</view>
<view
class="mask-close"
@click.stop="closeMask(index,cindex)"
>
<uni-icons
type="closeempty"
:size="16"
color="#fff"
></uni-icons>
</view>
</template>
<template v-else>
<view class="mask-box flex">
<view
class="mask-item"
@click="editItem(item)"
>
<view class="sprite-icon icon-mask-edit"></view>
编辑
<template v-if="item.showDel">
<view class="mask-del-box flex">
是否删除该客户档案
<view class="btns flex">
<view
class="btn cancel"
@click.stop="switchDel(index,cindex)"
>取消</view>
<view
class="btn"
@click.stop="delItem(item.id,index,cindex)"
>确定</view>
</view>
</view>
<view
class="mask-item"
@click.stop="switchDel(index,cindex, true)"
>
<view class="sprite-icon icon-mask-del"></view>
删除
</template>
<template v-else>
<view class="mask-box flex">
<view
class="mask-item"
@click="editItem(item)"
>
<view class="sprite-icon icon-mask-edit"></view>
编辑
</view>
<view
class="mask-item"
@click.stop="switchDel(index,cindex, true)"
>
<view class="sprite-icon icon-mask-del"></view>
删除
</view>
</view>
</view>
</template>
</template>
</view>
</view>
</view>
</template>
</template>
</template>
</template>
......@@ -148,7 +181,7 @@
class="icon"
src="../../../assets/images/home/nothing.webp"
/>
暂无接待记录
{{firstIndex == 2 ? '暂无推荐话术' : '暂无接待记录'}}
</view>
</template>
</template>
......@@ -175,21 +208,37 @@
:show.sync="showInfo"
@refresh="refresh"
/>
<customer-tags
ref="customerTagstVisible"
@select="handleSelect"
title="筛选"
cancelText="清除筛选"
:chooseList="tagsList"
:disabledSwitch="false"
clearSwitch
:sceneNumber="caseParams.scene"
></customer-tags>
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import CustomerInfo from './CustomerInfo.vue'
import CaseItem from './CaseItem.vue'
import CustomerTags from '../../CustomerTags.vue'
export default {
components: {
CustomerInfo
CustomerInfo,
CaseItem,
CustomerTags
},
name: '',
data () {
return {
tagsList: [],
typeList: [
{ tabName: '未接待' },
{ tabName: '已接待' },
{ tabName: '客户案例广场' },
],
firstIndex: 0,
firstLeft: ['0rpx', '352rpx', '756rpx'],
......@@ -200,6 +249,10 @@ export default {
{ text: '本月' },
{ text: '全部' }
],
sceneList: [
{ text: '会员权益/升级', id: 0 },
{ text: '轻改升级', id: 1 },
],
itemObject: [
{ label: '车主电话', key: 'ownerPhone' },
{ label: '品牌车型', key: 'brandModel' },
......@@ -214,9 +267,15 @@ export default {
list: [],
flag: false,
nothing: false,
pageSize: 18,
pageSize: 12,
customerId: '',
showInfo: false,
caseParams: {
scene: 0,
status: 1,
showChannel: 2,
},
}
},
computed: {
......@@ -225,6 +284,12 @@ export default {
return {
transform: `translate(calc(${dateIndex * 184}rpx), -50%)`
}
},
recordClass () {
return {
1: 'type-1',
2: 'type-2'
}[this.firstIndex]
}
},
mounted () {
......@@ -236,7 +301,8 @@ export default {
this.list = []
this.pageNum = 1;
this.nothing = false
this.getReceptionList()
if (this.firstIndex == 2) this.getMaterialResponsePage()
else this.getReceptionList()
},
changeType (index) {
if (this.firstIndex == index) return // 点击同一个
......@@ -302,17 +368,24 @@ export default {
seconds
}
},
changeIndex (index, isType = false) {
if (this.dateIndex == index && !isType) return
changeIndex (index) {
if (this.dateIndex == index) return
this.dateIndex = index
this.refresh()
},
changeScene (id) {
if (this.caseParams.scene == id) return
this.tagsList = []
this.caseParams.scene = id
this.refresh()
},
pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing'
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getReceptionList()
if (this.firstIndex == 2) this.getMaterialResponsePage()
else this.getReceptionList()
} else this.nothing = true
},
getDateRange (type) {
......@@ -383,6 +456,52 @@ export default {
animationType: 'pop-in',
animationDuration: 100
})
},
async getMaterialResponsePage () {
try {
uni.showLoading({
mask: true
})
let { shopMerchantId } = uni.$storage.get("userInfo"),
{ pageSize, pageNum, caseParams, tagsList } = this,
customerLabelList = []
tagsList.map(e => customerLabelList.push({
labelId: e.labelId
}))
let params = {
currentPage: pageNum,
pageSize,
customerLabelList,
merchantId: shopMerchantId,
...caseParams
}
const { list, total } = await uni.$api.customerApi.getMaterialResponsePage(params)
uni.hideLoading()
list.map(e => {
let tags = [],
goods = []
e.customerLabelInfoList?.map(item => {
tags.push(item.labelName)
})
e.productPackageInfoList?.map(item => {
goods.push(item.upgradeGoodsName)
})
e.tags = tags.join('、')
e.goods = goods.join('、')
})
this.list[pageNum - 1] = list
this.flag = true
this.total = total
this.$forceUpdate()
} catch (error) {
console.log(error)
uni.hideLoading()
this.flag = true
}
},
handleSelect (list) {
this.tagsList = list
this.refresh()
}
}
}
......@@ -481,6 +600,17 @@ export default {
}
}
}
.type-2 {
height: calc(100% - 248rpx);
.list {
padding-top: 48rpx;
.item {
.name {
max-width: 416rpx;
}
}
}
}
.list {
display: flex;
flex-wrap: wrap;
......@@ -599,6 +729,10 @@ export default {
opacity: 1;
}
}
.case-item {
width: 444rpx;
height: 552rpx;
}
}
}
.add-btn {
......@@ -675,6 +809,43 @@ export default {
}
}
}
.scene-box {
position: relative;
top: 0;
z-index: 3;
margin-top: -8rpx;
padding: 0 64rpx;
.scene-tabs {
gap: 0 24rpx;
.tab {
height: 80rpx;
background: #f2f2f2;
border-radius: 16rpx;
padding: 0 32rpx;
justify-content: center;
font-size: 28rpx;
color: #666666;
line-height: 44rpx;
transition: all 0.15s;
}
.active {
font-weight: 500;
color: #2d66f7;
background: #2d66f71a;
}
}
.search-btn {
margin-left: auto;
&::after {
content: '';
border: 12rpx solid transparent;
border-left-color: #000;
margin-left: 12rpx;
transform: translateY(-2rpx);
}
}
}
.nothing {
width: 100%;
flex-direction: column;
......
......@@ -89,6 +89,10 @@
<car-brands
ref="carBrandVisible"
@select="handleSelect($event,'carBrandVisible')"
:echoData="customerInfo"
carBrandKey="carBrand"
carModelKey="brandModel"
customBoolean
/>
<customer-tags
ref="customerTagstVisible"
......@@ -268,6 +272,7 @@ export default {
if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close()
this.customerInfo.brandModel = item.name
this.customerInfo.carBrand = item.carChildsBrandName
} else if (popkey == 'customerTagstVisible') {
let names = [],
ids = []
......@@ -305,6 +310,9 @@ export default {
})
if (customerInfo.id) params.id = customerInfo.id
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi[targetApi](params),
_this = this
if (res) {
......@@ -312,26 +320,34 @@ export default {
if (res == '1') {
this.$refs.successRef.open()
setTimeout(() => {
uni.hideLoading()
this.back()
this.$emit('refresh')
}, 1e3)
} else uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
showCancel: false,
confirmText: '确认',
confirmColor: '#347BFF',
success (res) {
if (res.confirm) {
_this.back()
_this.$emit('refresh')
} else {
uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
showCancel: false,
confirmText: '确认',
confirmColor: '#347BFF',
success (res) {
if (res.confirm) {
_this.back()
_this.$emit('refresh')
}
}
}
})
})
uni.hideLoading()
}
} else {
uni.hideLoading()
}
} catch (error) {
let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true
this.clickFlag = false
uni.hideLoading()
}
}
}
......
......@@ -4,50 +4,36 @@
<view class="user-avatar sprite-icon icon-avatar"></view>
<view class="user-name">{{ userInfo.name }}</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">
<view
:class="['tab-item', { tabActive: tabIndex == index }]"
:key="index"
@click="changeIndex(index)"
>
<view :class="['tab-item', { tabActive: tabIndex == index }]" :key="index" @click="changeIndex(index)">
<view class="icon-box">
<view :class="[
'sprite-icon',
`icon-${i.icon}${tabIndex == index ? '-active' : ''}`,
]"></view>
<view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view>
</view>
{{ i.label }}
<view class="dot" v-if="i.icon == 'record' && perRecordNumber"></view>
</view>
</template>
</view>
<view class="left-footer">
<view
class="btn"
@click="$refs.kfRef.open()"
>
<view class="btn" @click="$refs.kfRef.open()">
<view class="sprite-icon icon-feedback"></view>
</view>
<view
class="btn"
@click="$refs.settingRef.open()"
>
<view class="btn" @click="$refs.settingRef.open()">
<view class="sprite-icon icon-setting"></view>
</view>
</view>
<!-- 客服弹框 -->
<!-- 客服弹框 -->
<kf-box ref="kfRef" />
<!-- 设置弹框 -->
<setting-box
ref="settingRef"
@stopAudio="$emit('stopAudio')"
/>
<setting-box ref="settingRef" @stopAudio="$emit('stopAudio')" />
</view>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import KfBox from "./KfBox";
import SettingBox from "./SettingBox";
import { STORAGE_OBJECTkEY } from '@/utils/cache/constantData'
export default {
components: { KfBox, SettingBox },
props:{
......@@ -74,6 +60,11 @@ export default {
if(n.shopMerchantId) this.haveCustomerAccess(n.shopMerchantId)
}
},
computed: {
perRecordNumber() {
return this.$store.state.audio.perRecordNumber
}
},
mounted () {
},
methods: {
......@@ -96,7 +87,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.left-side {
display: flex;
flex-direction: column;
......@@ -134,6 +125,16 @@ export default {
color: #8a98b5;
text-align: center;
padding-bottom: 96rpx;
position: relative;
.dot {
width: 16rpx;
height: 16rpx;
background: #f24724;
border-radius: 50%;
position: absolute;
right: 20rpx;
top: 20rpx;
}
.icon-box {
width: 112rpx;
height: 112rpx;
......@@ -213,5 +214,4 @@ export default {
padding-left: 60rpx;
}
}
</style>
\ No newline at end of file
</style>
<template>
<view class="record-box">
<view class="record-content">
<view class="record-content" v-if="showRecord">
<view class="data-box">
<template v-for="(i, index) in dataList">
<view
:class="['data-item', i.type]"
:key="index"
>
<image
:src="i.icon"
class="data-item-bg"
/>
<view :class="['data-item', i.type]" :key="index">
<image :src="i.icon" class="data-item-bg" />
<view class="title">{{ dateList[index].text }}</view>
<view class="content">
<view class="total">
<view class="label">{{ i.label }}</view>
<view class="num-box">
<view class="num">{{ i.count == null ? "-" : i.count }}</view>
<view class="num">{{ i.count == null ? '-' : i.count }}</view>
</view>
</view>
<view class="duration">
<view class="label">平均接待时长</view>
<view class="num-box">
<view class="num">{{ i.minutes || "-" }}</view>
<view class="num">{{ i.minutes || '-' }}</view>
<view class="unit">分</view>
<view class="num"> {{ i.seconds || "-" }}</view>
<view class="num">{{ i.seconds || '-' }}</view>
<view class="unit">秒</view>
</view>
</view>
......@@ -34,81 +28,50 @@
</view>
<view class="data-container">
<view :class="['type-box']">
<view
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="changeType(index, 'firstIndex')"
>
<view
class="sprite-icon"
:class="[
firstIndex == index ? `icon-${firstClass[index]} active` : '',
]"
:style="{ left: firstLeft[index] }"
></view>
<view
class="text"
:class="[firstIndex == index ? `active` : '']"
>{{ i.tabName
}}{{
i.num && recordFailList.length > 0
? `(${recordFailList.length})`
: ""
}}</view>
<view class="tab-item" v-for="(i, index) in typeList" :key="index" @click="changeType(index, 'firstIndex')">
<view class="sprite-icon" :class="[firstIndex == index ? `icon-${firstClass[index]} active` : '']" :style="{ left: firstLeft[index] }"></view>
<view class="text" :class="[firstIndex == index ? `active` : '']">
{{ i.tabName }}
<template v-if="index == 1 && i.num && recordFailList.length > 0">({{ recordFailList.length }})</template>
<template v-if="index == 2 && i.num && preRecordFailList.length > 0">({{ preRecordFailList.length }})</template>
<div class="dot" :style="{ right: '86rpx' }" v-if="index == 2 && i.num && preRecordFailList.length > 0"></div>
</view>
</view>
</view>
<view class="tabs-bottom"></view>
<view
v-if="firstIndex == 0"
class="data-tabs-box"
>
<view v-if="firstIndex == 0" class="data-tabs-box">
<view class="data-tabs">
<template v-for="(i, index) in dateList">
<view
:class="['tab flex', { active: dateIndex == index }]"
:key="index"
@click="changeIndex(index)"
>{{ i.text }}</view>
<view :class="['tab flex', { active: dateIndex == index }]" :key="index" @click="changeIndex(index)">{{ i.text }}</view>
</template>
<view :class="['active-btn', `active-btn-${dateIndex}`]"></view>
</view>
</view>
<scroll-view
:class="['record-list', {'type-1':firstIndex == 1}]"
scroll-y
@scrolltolower="pageonReachBottom"
@scroll="scroll"
>
<scroll-view :class="['record-list', { 'type-1': firstIndex == 1 }]" scroll-y @scrolltolower="pageonReachBottom" @scroll="scroll">
<div class="record-tips" v-if="firstIndex == 2 && list.length && list[0] && list[0].length">以下非正常结束的接待记录,需要进行信息确认后才能提交到系统。</div>
<view class="list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="i in list">
<template v-for="item in i">
<view
class="item"
:key="item.id"
>
<view :class="[
'status flex',
{ deal: item.receptionStatus == 1 },
]">{{
<view class="item" :key="item.id" @click="jumpDetail(item)">
<view class="status flex disabled" v-if="item.receptionStatus === '' || item.receptionStatus === undefined">未知</view>
<view :class="['status flex', { deal: item.receptionStatus == 1 }]" v-else>
{{
{
1: "成交",
0: "战败",
1: '成交',
0: '战败'
}[item.receptionStatus]
}}</view>
}}
</view>
<view class="name">
{{ item.customerName }}
{{ item.customerName ? item.customerName : '未填写姓名' }}
</view>
<view class="goods-name">{{ item.carModel }}</view>
<view class="goods-name">{{ item.carModel ? item.carModel : '未选择车型' }}</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="ind"
>
<view class="info flex" :key="ind">
<view class="label">{{ k.label }}</view>
<view class="value">{{ item[k.key] || "-" }}</view>
<view class="value">{{ formatValue(item[k.key], k.key) || '-' }}</view>
</view>
</template>
</view>
......@@ -117,10 +80,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../../assets/images/home/nothing.webp"
/>
<image class="icon" src="../../../assets/images/home/nothing.webp" />
暂无接待记录
</view>
</template>
......@@ -132,6 +92,7 @@
</scroll-view>
</view>
</view>
<save-record v-else @cancel="handleCancel" @submit="handleSubmit" :customerInfoVal="customerInfo"></save-record>
</view>
</template>
<script type="text/ecmascript-6">
......@@ -139,8 +100,12 @@ import dayjs from 'dayjs'
const dayImgUrl = require('@/assets/images/common/day.webp')
const weekImgUrl = require('@/assets/images/common/week.webp')
const monthImgUrl = require('@/assets/images/common/month.webp')
import { STORAGE_OBJECTkEY } from '@/utils/cache/constantData'
import interruptRecord from '@/utils/recordManager/interruptRecord'
import saveRecord from './saveRecord.vue'
export default {
name: '',
components: { saveRecord },
data () {
return {
sexType: {
......@@ -167,6 +132,7 @@ export default {
typeList: [
{ tabName: '已上传' },
{ tabName: '待上传', num: true },
{ tabName: '待提交', num: true },
],
firstIndex: 0,
firstLeft: ['0rpx', '352rpx', '756rpx'],
......@@ -183,7 +149,10 @@ export default {
{ label: '开始接待', key: 'startTime' },
{ label: '结束接待', key: 'endTime' },
],
showRecord:true,
recordFailList: [],
preRecordFailList:[],
customerInfo:{},
dateIndex: 0,
pageNum: 1,
total: 0,
......@@ -197,8 +166,32 @@ export default {
mounted () {
this.init();
this.getRecordNum()
this.getPreRecordNum()
},
methods: {
formatValue(val,k) {
if(!val) return
if(k == 'phoneNumber') {
return val.slice(0, 3) + " " + val.slice(3, 7) + " " + val.slice(7)
}
return val
},
handleCancel() {
this.showRecord = true;
},
async handleSubmit(val ){
this.showRecord = true;
uni.$recordManager.addRecord(val)
interruptRecord.removePreRecord(val.id)
this.getRecordNum()
this.getPreRecordFail()
},
jumpDetail(item) {
console.log(this.firstIndex,'this.firstIndex')
if(this.firstIndex!=2) return
this.showRecord = false;
this.customerInfo = item
},
changeType (index, name) {
if (this[name] == index) return // 点击同一个
this.direction = ''
......@@ -212,11 +205,17 @@ export default {
this.list = []
this.pageNum = 1;
this.nothing = false
if (index == 0) {
switch (index) {
case 0:
this.changeIndex(this.dateIndex, true)
this.getRecordNum()
} else {
break;
case 1:
this.getRecordFail()
break;
default:
this.getPreRecordFail()
break;
}
},
scroll (e) {
......@@ -234,6 +233,22 @@ export default {
console.log(recordFailList);
this.recordFailList = recordFailList.reverse();
},
getPreRecordFail() {
this.getPreRecordNum()
this.list[0] = this.preRecordFailList.map(i => {
return Object.assign(i,{
duration: 0,
startTime:i.receptionStartTime && i.receptionStartTime.replace(/\//g, '.')
})
})
this.nothing = this.preRecordFailList.length ? true : false
},
getPreRecordNum() {
const preRecordList = uni.$storage.get(STORAGE_OBJECTkEY.preRecordList)||[]
console.log(preRecordList)
this.preRecordFailList = preRecordList.reverse()
},
getRecordFail () {
this.getRecordNum()
this.list[0] = this.recordFailList.map(i => {
......@@ -314,11 +329,9 @@ export default {
})
uni.hideLoading()
list?.length && list.map(e => {
let phoneNumber = e.phoneNumber
e.duration = this.formatSeconds(e.receptionEndTime - e.receptionStartTime)
e.startTime = dayjs(e.receptionStartTime).format("YYYY.MM.DD HH:mm:ss")
e.endTime = dayjs(e.receptionEndTime).format("YYYY.MM.DD HH:mm:ss")
e.phoneNumber = phoneNumber.slice(0, 3) + " " + phoneNumber.slice(3, 7) + " " + phoneNumber.slice(7)
})
if (pageNum == 1) {
const record = {
......@@ -412,19 +425,9 @@ export default {
.record-box {
box-sizing: border-box;
height: 100%;
opacity: 1;
position: relative;
animation: show-box 0.15s forwards;
@keyframes show-box {
0% {
left: 100%;
}
100% {
left: 0;
}
}
overflow: hidden;
.record-content {
padding: 96rpx 0 80rpx;
padding: 96rpx 0;
.data-container {
background: #ffffff;
border-radius: 48rpx;
......@@ -454,6 +457,14 @@ export default {
position: relative;
text-align: center;
width: 400rpx;
.dot {
width: 16rpx;
height: 16rpx;
background: #f24724;
position: absolute;
top: 40rpx;
border-radius: 50%;
}
}
.active {
position: absolute;
......@@ -479,22 +490,34 @@ export default {
}
}
.record-list {
height: calc(100% - 242rpx);
height: calc(100% - 248rpx);
position: relative;
z-index: 4;
}
.type-1 {
height: calc(100% - 126rpx);
height: calc(100% - 128rpx);
margin-top: -48rpx;
.list {
padding-top: 48rpx;
}
}
.record-tips {
height: 76rpx;
background: #f58e341a;
border-radius: 16rpx;
text-align: center;
line-height: 76rpx;
font-size: 28rpx;
color: #f58e34;
margin-left: 60rpx;
width: calc(100% - 120rpx);
}
.list {
display: flex;
flex-wrap: wrap;
gap: 40rpx 44rpx;
padding: 40rpx 0 20rpx 64rpx;
.item {
width: 608rpx;
background: #ffffff;
......@@ -515,6 +538,10 @@ export default {
font-weight: 500;
font-size: 24rpx;
justify-content: center;
&.disabled {
background: #f2f2f2;
color: #999999;
}
}
.deal {
background: #eaf9f1;
......@@ -679,13 +706,12 @@ export default {
width: 184rpx;
height: 76rpx;
justify-content: center;
font-size: 28rpx;
color: #1f2133b3;
font-weight: 500;
font-size: 32rpx;
color: #1f2133;
z-index: 10;
}
.active {
color: #1f2133;
font-weight: 500;
}
.active-btn {
position: absolute;
......
<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>
<view
class="container"
@click="handleTouchStart"
>
<view class="container" @click="handleTouchStart">
<view :class="['home', { show: !id }]">
<left-side
:userInfo="userInfo"
:tabIndex.sync="tabIndex"
@changeTab="$emit('changeTab', $event)"
@stopAudio="stopAudio"
/>
<left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" @changeTab="$emit('changeTab', $event)" @stopAudio="stopAudio" />
<view class="right-side">
<template v-if="tabIndex == 0">
<view class="right-content">
<view
class="start"
@click="$emit('start')"
>
<image
class="start-btn"
src="../../assets/images/home/start.gif"
alt="开始接待"
/>
<image
class="start-border"
src="../../assets/images/home/start-border.png"
/>
<view class="start" @click="$emit('start')">
<image class="start-btn" src="../../assets/images/home/start.gif" alt="开始接待" />
<image class="start-border" src="../../assets/images/home/start-border.png" />
</view>
<view class="module-list">
<slot name="module" />
......@@ -33,10 +15,7 @@
</view>
</template>
<template v-else>
<component
:is="componentName"
:userInfo="userInfo"
/>
<component :is="componentName" :userInfo="userInfo" />
</template>
<view class="store-addr">
<view class="icon-addr sprite-icon icon-addr"></view>
......@@ -48,67 +27,39 @@
<slot name="detail" />
</view>
<!-- 未点击开始接待,弹窗 -->
<MessageBox
ref="previewRef"
@confirm="$emit('preview')"
:popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」"
confirmBtnText="预览素材"
@cancel="$emit('previewCancel')"
@close="$emit('previewClose')"
></MessageBox>
<MessageBox ref="previewRef" @confirm="$emit('preview')" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="$emit('previewCancel')" @close="$emit('previewClose')"></MessageBox>
<!-- 停留弹框 -->
<MessageBox
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
<MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox>
<!-- 退出弹框 -->
<MessageBox
:popupW="704"
ref="finish"
:content="finishContene"
:isFooter="false"
>
<MessageBox :popupW="704" ref="finish" :content="finishContene" :isFooter="false">
<view class="footer">
<view
class="footer-btn confirm flex"
@click="$emit('openStep')"
>
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
<template v-else> 完成接待<text>(推荐)</text> </template>
<template v-else>
完成接待
<text>(推荐)</text>
</template>
</view>
<view
class="footer-btn cancel flex"
@click="$emit('backHome')"
>
仍要退出<text>(不推荐)</text>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
仍要退出
<text>(不推荐)</text>
</view>
</view>
</MessageBox>
<!-- 升级弹框 -->
<update-box />
<slot name="content" />
<web-view
@message="handlerMessage"
ref="webview"
src="/hybrid/html/index.html"
></web-view>
<web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view>
</view>
</template>
<script>
import RecordList from "./components/RecordList.vue";
import myClick from "@/mixin/click";
import uploader from "@/mixin/uploader.js";
import CustomerFile from './components/CustomerFile.vue';
import LeftSide from './components/LeftSide.vue';
import RecordList from './components/RecordList.vue'
import myClick from '@/mixin/click'
import uploader from '@/mixin/uploader.js'
import CustomerFile from './components/CustomerFile.vue'
import LeftSide from './components/LeftSide.vue'
export default {
mixins: [myClick, uploader],
components: { RecordList, CustomerFile, LeftSide },
......@@ -117,35 +68,34 @@ export default {
finishDoneText: String,
finishContene: {
type: String,
default: "当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」",
},
default: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}
},
data () {
data() {
return {
userInfo: {},
tabIndex: 0
};
}
},
mounted () {
const userInfo = uni.$storage.get("userInfo") || {};
this.userInfo = userInfo;
mounted() {
const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo
},
computed: {
previewRef () {
return this.$refs.previewRef;
previewRef() {
return this.$refs.previewRef
},
finishRef () {
return this.$refs.finish;
finishRef() {
return this.$refs.finish
},
componentName () {
componentName() {
if (this.tabIndex == 0) return 'HomeSlot'
else if (this.tabIndex == 1) return 'RecordList'
else return 'CustomerFile'
},
},
methods: {
}
},
};
methods: {}
}
</script>
<style scoped lang="scss">
.container {
......
......@@ -126,7 +126,7 @@ export default {
handler (newval) {
this.$refs.popupRef?.close()
this.flag = false
this.scrollTop = 1000
this.scrollTop = -1
setTimeout(() => {
this.scrollTop = 0
}, 100);
......
......@@ -25,12 +25,12 @@
export default {
name: 'ReceptionSence',
props: {
customerInfo:Object
customerInfo: Object
},
data () {
return {
list:[],
id:''
list: [],
id: ''
}
},
watch: {
......@@ -52,7 +52,7 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
watchCustomerInfo() {
watchCustomerInfo () {
return this.customerInfo
},
},
......@@ -70,7 +70,7 @@ export default {
})
.then((res) => {
this.list = res || []
}).catch(err =>{
}).catch(err => {
this.list = []
})
},
......@@ -90,15 +90,15 @@ export default {
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
......
......@@ -111,7 +111,7 @@ export default {
right: 40rpx;
top: calc(5% + 140rpx);
z-index: 998;
width: 128rpx;
width: 120rpx;
.btn {
width: 100%;
height: 120rpx;
......
const target = ["ip", "dev", "uat", "prod", "beta"];
const index = 2;
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2
/**
*
0本地
......@@ -12,110 +12,110 @@ const secretKey = {
ip: {},
dev: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
},
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
uat: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
},
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
prod: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
},
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
beta: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
},
},
}[target[index]];
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
}
}[target[index]]
const domain = {
// ip: 'http://192.168.2.94:8558',
// 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:8558 */
dev: "https://scrm.dev.glsx.com.cn",
uat: "https://scrm.test.glsx.com.cn",
beta: "https://scrm.beta.glsx.com.cn",
prod: "https://scrm.glsx.com.cn",
}[target[index]];
dev: 'https://scrm.dev.glsx.com.cn',
uat: 'https://scrm.test.glsx.com.cn',
beta: 'https://scrm.beta.glsx.com.cn',
prod: 'https://scrm.glsx.com.cn'
}[target[index]]
const djDomain = {
ip: "http://192.168.2.59:8292",
ip: 'http://192.168.2.59:8292',
// ip: 'http://192.168.2.80:8558',
dev: "http://dj.dev.glsx.com.cn",
beta: "https://dj.beta.glsx.com.cn", //预发布 appid: wx9f91c1ec493eb425
uat: "https://dj.test.glsx.com.cn", //测试 appid: wxe10067a63c1856ac
prod: "https://dj.glsx.com.cn",
pet: "https://cdptest.glsx.com.cn", //压测 appid: wx7ce755e425603084
}[target[index]];
dev: 'http://dj.dev.glsx.com.cn',
beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
prod: 'https://dj.glsx.com.cn',
pet: 'https://cdptest.glsx.com.cn' //压测 appid: wx7ce755e425603084
}[target[index]]
const merchantDomain = {
ip: "http://rop-merchant.dev.glsx.com.cn",
dev: "http://rop-merchant.dev.glsx.com.cn",
beta: "https://rop-merchant.beta.glsx.com.cn",
uat: "https://rop-merchant.test.glsx.com.cn",
prod: "https://commodity.glsx.com.cn",
pet: "",
}[target[index]];
ip: 'http://rop-merchant.dev.glsx.com.cn',
dev: 'http://rop-merchant.dev.glsx.com.cn',
beta: 'https://rop-merchant.beta.glsx.com.cn',
uat: 'https://rop-merchant.test.glsx.com.cn',
prod: 'https://commodity.glsx.com.cn',
pet: ''
}[target[index]]
const djSecretKey = {
ip: {},
dev: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637",
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
uat: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637",
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
beta: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637",
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
prod: {
appKey: "d7ffc3346fc9a45bccaaa35300d59022",
secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353",
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
},
pet: {
appKey: "d7ffc3346fc9a45bccaaa35300d59022",
secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353",
},
}[target[index]];
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}[target[index]]
const pathEnum = {
sso: "/rop-scrm-sso/",
shopmall: "/rop-scrm-shopmall/",
coupon: "/rop-scrm-coupon/",
carlife: "/rop-scrm-carlife/",
live: "/rop-scrm-live/",
equity: "/rop-scrm-equity/",
entmicro: "/rop-scrm-entmicro/",
wechat: "/rop-scrm-wechat/",
boutiquecoupon: "/rop-scrm-boutiquecoupon/",
material: "/rop-scrm-marketing/", //素材
sop: "/rop-scrm-sop/",
customercollect: "/rop-scrm-bigdatautil/",
mindworkplate: "/rop-dj-smartcarlife/",
drac: "/rop-scrm-entmicro/",
busassistant: "/rop-scrm-busassistant/",
boutique: "/rop-dj-car-boutique/",
merchants: "/rop-merchants/",
};
sso: '/rop-scrm-sso/',
shopmall: '/rop-scrm-shopmall/',
coupon: '/rop-scrm-coupon/',
carlife: '/rop-scrm-carlife/',
live: '/rop-scrm-live/',
equity: '/rop-scrm-equity/',
entmicro: '/rop-scrm-entmicro/',
wechat: '/rop-scrm-wechat/',
boutiquecoupon: '/rop-scrm-boutiquecoupon/',
material: '/rop-scrm-marketing/', //素材
sop: '/rop-scrm-sop/',
customercollect: '/rop-scrm-bigdatautil/',
mindworkplate: '/rop-dj-smartcarlife/',
drac: '/rop-scrm-entmicro/',
busassistant: '/rop-scrm-busassistant/',
boutique: '/rop-dj-car-boutique/',
merchants: '/rop-merchants/'
}
const CONFIG_ENV_MAP = {
1: "develop",
2: "test",
3: "production",
4: "beta",
};
1: 'develop',
2: 'test',
3: 'production',
4: 'beta'
}
module.exports = {
index,
domain,
......@@ -124,5 +124,5 @@ module.exports = {
env: CONFIG_ENV_MAP[index],
djDomain,
merchantDomain,
djSecretKey,
};
djSecretKey
}
......@@ -49,7 +49,7 @@ import { index } from './env'
// }
Vue.prototype.$permision = permision
import sentryInit from '@/utils/sentryConfig/sentryInit'
if (index == 3) {
if (index == 3 || index == 2) {
const sentry = sentryInit()
Vue.prototype.$sendSentry = function (e) {
sentry.captureException(e)
......
......@@ -2,7 +2,7 @@
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "1.9.0",
"versionName" : "1.9.1",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
......@@ -91,7 +91,8 @@
"vueVersion" : "2",
"h5" : {
"devServer" : {
"port" : ""
"port" : 8080,
"https" : false
}
}
}
......@@ -2,21 +2,28 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-08-30 17:49:04
* @LastEditTime: 2024-10-29 13:33:37
* @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const recorderManager = uni.getRecorderManager()
const plug = uni.requireNativePlugin('html5app-recordaudio')
import interruptRecord from '@/utils/recordManager/interruptRecord'
const UPLOAD_STATUS = {
// 上传状态
success: 1,
fail: 2
}
const AUDIO_STATUS = {
START: 'start', //录音中
END: 'end', //录音结束
ABNORMAL: 'abnormal' //40分钟未触碰平板,断开录音,不提交记录
}
const audioTime = 10 * 60 * 1000
import { mapMutations, mapState } from 'vuex'
import utils from '@/utils/utils.js'
export default {
data () {
data() {
return {
voicePath: '',
timer: null,
......@@ -25,7 +32,8 @@ export default {
reaction: 1
}
},
mounted () {
async mounted() {
this.handleSave(false)
// 获取当前页面栈数组
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
......@@ -34,27 +42,36 @@ export default {
if (url.includes(route)) return
this.initTime()
},
watch: {
/**
* 监听客户信息是否发生变化
* @param {object} val 监听客户信息
*/
changeData: {
handler(val) {
console.log(val, 'val', this.audioInfo.audioStatus)
if (this.audioInfo.audioStatus != AUDIO_STATUS.START) return
const { customerInfo, booksList, receptionStatus } = val
const params = this.getParams(customerInfo, booksList, receptionStatus)
interruptRecord.updatePreRecords(params)
},
deep: true
}
},
computed: {
...mapState('audio', ['receptionStatus', 'booksList', 'audioInfo']),
...mapState(['user.customerInfo'])
},
created () {
console.log('created')
},
onHide () {
console.log('隐藏')
// recorderManager.stop();
// recorderManager.start({
// duration: 10000,
// });
},
onShow () {
// console.log(utils.requestAndroidPermission());
...mapState(['user.customerInfo']),
changeData() {
const customerInfo = this.$store?.state?.user?.customerInfo || {}
const booksList = this.booksList || []
const receptionStatus = this.receptionStatus
return { customerInfo, booksList, receptionStatus }
}
},
methods: {
...mapMutations('audio', ['setReceptionStatus', 'setBooks', 'setAudioInfo']),
// //关闭提示
tipCancel () {
tipCancel() {
this.stopAudio()
this.setReceptionStatus(0)
this.setAudioInfo({ endReasonType: 1 })
......@@ -67,22 +84,22 @@ export default {
}
},
//结束提示
tipConfirm () {
tipConfirm() {
this.times = 0
this.$refs.tipBox?.close()
},
closeAudio () {
closeAudio() {
this.times = 0
clearInterval(this.timer)
this.timer = null
this.stopAudio('abnormal')
this.stopAudio(AUDIO_STATUS.ABNORMAL)
this.setReceptionStatus(0)
this.setAudioInfo({ endReasonType: 1 })
},
getParams () {
getParams(customerInfo, booksList, receptionStatus) {
const { shopMerchantId, phone, sceneType, uuid, name, merchantId, channelType, merchantName } = uni.$storage.get('userInfo'),
{ customerName, phoneNumber, salesUuid, carModel, staffName } = this.$store.state.user.customerInfo,
receptionCustomerPaySourceList = this.booksList.map(item => {
{ customerName, phoneNumber, salesUuid, carModel, staffName } = customerInfo || {},
receptionCustomerPaySourceList = booksList.map(item => {
return {
id: item.id,
sourceType: item.id,
......@@ -99,7 +116,7 @@ export default {
merchantId: shopMerchantId,
businessScene: sceneType,
staffUuid: uuid,
staffName: name,
staffName: name
})
})
let params = {
......@@ -114,7 +131,7 @@ export default {
loginPhone: phone,
salesName: staffName,
salesUuid,
receptionStatus: this.receptionStatus, //接待结果 1.成交 0.战败
receptionStatus, //接待结果 1.成交 0.战败
receptionStartTime,
receptionEndTime,
receptionCustomerPaySourceList, //1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径
......@@ -128,10 +145,10 @@ export default {
},
/**
* 修改文件名。
* @param {旧的文件路径} oldFilePath
* @param {新的文件名} newFileName
* @param {string} oldFilePath 旧的文件路径
* @param {string} newFileName 新的文件名
*/
RenameFile (oldFilePath, newFileName) {
RenameFile(oldFilePath, newFileName) {
plus.io.resolveLocalFileSystemURL(oldFilePath, entry => {
entry.getParent(_oldFile => {
entry.moveTo(_oldFile, '/' + newFileName, newFilePath => {
......@@ -143,86 +160,104 @@ export default {
//开始录音
startAudio: utils.throttle(async function () {
if (this.audioInfo.audioStatus == 'start') return
this.setAudioInfo({ audioList: [], audioStatus: 'start' })
if (this.audioInfo.audioStatus == AUDIO_STATUS.START) return
this.setBooks([])
this.$store.dispatch('clearCustomerInfo')
this.setReceptionStatus(1)
this.setReceptionStatus('')
this.initTime()
this.setAudioInfo({ audioList: [], audioStatus: AUDIO_STATUS.START })
recorderManager.onStart(() => {
//开始录音保持记录,1s延时是因为第一段录音结束时间的文件修改时间等于第二段开始的文件修改时间,加上1s延时,就不会这个问题
setTimeout(() => {
const params = this.getParams(this.$store.state.user.customerInfo, this.booksList, this.receptionStatus)
interruptRecord.addPreRecords(params)
}, 1000)
})
recorderManager.start({
duration: 600000,
duration: audioTime,
sampleRate: 16000,
numberOfChannels: 1
})
recorderManager.onStop(async res => {
console.log('结束录音')
if (this.audioInfo.audioStatus == 'start') {
//第一段录音结束,还在接待中,则开启第二段录音
if (this.audioInfo.audioStatus == AUDIO_STATUS.START) {
uni.getRecorderManager().start({
duration: 600000,
duration: audioTime,
sampleRate: 16000,
numberOfChannels: 1
})
}
if (this.audioInfo.audioStatus == 'no') {
uni.removeSavedFile({
filePath: res.tempFilePath,
complete: function (res) {
console.log(res)
}
})
return
}
const saveResult = await uni.saveFile({
tempFilePath: res.tempFilePath
}) // 保存文件到本地
//删除默认文件
uni.removeSavedFile({
filePath: res.tempFilePath,
complete: function (res) {
console.log(res)
}
})
const oldFilePath = saveResult[1].savedFilePath
const { phone } = uni.$storage.get('userInfo')
const newFileName = String(phone).slice(-4) + '_' + oldFilePath.replace(/.+\/(\d+\.mp3)/, '$1')
const newFilePath = oldFilePath.replace(/(.+\/)(\d+\.mp3)/, '') + newFileName
this.RenameFile(oldFilePath, newFileName)
this.handleSave(newFilePath)
})
}, 300),
handleSave (file) {
const audioList = [...this.audioInfo.audioList, file]
if (file) {
this.setAudioInfo({ audioList })
/**
* 保存记录
* 首先查看有没有没有保存的记录records,没有就直接返回
* 存在没有保存的记录,首先把临时的录音文件,保存永久的录音文件,并重新命名
* @params {boolean} isNormal 是否是正常保存
* @returns {void}
*/
async handleSave(isNormal = true) {
const records = interruptRecord.getPreRecord()
console.log(records, 'records')
if (!records) return
if (isNormal) {
Object.assign(records, this.getParams(this.$store.state.user.customerInfo, this.booksList, this.receptionStatus))
}
if (this.audioInfo.audioStatus != 'end' && this.audioInfo.audioStatus != 'finish') {
return
const audioPath = records.audioPath
const recordUrlList = []
try {
// 把临时文件保存为永久录音文件
for (let i = 0; i < audioPath.length; i++) {
console.log(audioPath[i], 'audioPath[i]')
const saveResult = await uni.saveFile({
tempFilePath: audioPath[i]
})
const oldFilePath = saveResult[1].savedFilePath
console.log(oldFilePath, 'oldFilePath')
const { phone } = uni.$storage.get('userInfo')
const newFileName = String(phone).slice(-4) + '_' + oldFilePath.replace(/.+\/(\d+\.mp3)/, '$1')
const newFilePath = oldFilePath.replace(/(.+\/)(\d+\.mp3)/, '') + newFileName
const path = await utils.getFileSaveFolderOnClient()
recordUrlList.push({ status: UPLOAD_STATUS.fail, file: path + newFilePath })
this.RenameFile(oldFilePath, newFileName)
}
} catch (error) {
this.$sendSentry(`上传保存失败:${JSON.stringify(error)}`)
}
delete records.audioPath
let saveRecords = Object.assign(records, { recordUrlList })
// 如果是正常保存,保存为待上传,并删除待提交记录,如果是异常保存,则更新待提交记录
if (isNormal) {
this.saveRecord(saveRecords)
} else {
interruptRecord.updatePreRecords(saveRecords, true)
}
this.saveRecord()
this.setAudioInfo({ endReasonType: 0, audioStatus: 'finish' })
},
/**保存记录*/
async saveRecord () {
const params = this.getParams()
/**
* 删除待提交记录
* @returns {void}
*/
removeRecords() {
const records = interruptRecord.getPreRecord()
interruptRecord.removePreRecord(records.id)
},
/**
* 保存待上传的记录,并删除待提交的记录
* @param {object} record 记录信息
* @returns {void}
*/
async saveRecord(record) {
const unlock = await uni.$recordManager.lock()
const path = await utils.getFileSaveFolderOnClient()
const recordUrlList = this.audioInfo.audioList.map(i => {
return {
status: UPLOAD_STATUS.fail,
file: path + i.split('/').pop()
}
})
if (recordUrlList.length) {
this.$store.dispatch('clearCustomerInfo')
}
uni.$recordManager.addRecord({
...params,
id: utils.uuid(),
recordUrlList
})
console.log('record', record)
uni.$recordManager.addRecord(record)
interruptRecord.removePreRecord(record.id)
unlock()
},
//结束接待
/**
* 结束接待
* @params {boolean} status true 不保存记录/AUDIO_STATUS.ABNORMAL 只要断开录音
* @returns {void}
*/
stopAudio: utils.throttle(async function (status) {
console.log('结束')
// const result = await this.$permision.requestAndroidPermission(
......@@ -235,27 +270,29 @@ export default {
// });
// return;
// }
if (status == 'abnormal') {
this.setAudioInfo({ audioStatus: 'abnormal' })
//如果是40分钟未触碰平板,只要断开录音即可
if (status == AUDIO_STATUS.ABNORMAL) {
this.setAudioInfo({ audioStatus: AUDIO_STATUS.ABNORMAL })
recorderManager.stop()
return
}
if (this.audioInfo.audioStatus == 'abnormal' && status != true) {
this.setAudioInfo({ audioStatus: 'end' })
//如果是40分钟未触碰平板后完成接待,需要保存记录
if (this.audioInfo.audioStatus == AUDIO_STATUS.ABNORMAL && status != true) {
this.setAudioInfo({ audioStatus: AUDIO_STATUS.END })
this.handleSave()
return
}
if (this.audioInfo.audioStatus != 'start') {
if (this.audioInfo.audioStatus != AUDIO_STATUS.START) {
return
}
this.setAudioInfo({ audioStatus: 'end' })
this.setAudioInfo({ audioStatus: AUDIO_STATUS.END })
//直接退出
uni.showLoading({
mask: true
})
setTimeout(() => {
uni.hideLoading()
if (this.audioInfo.audioStatus == 'end') {
if (this.audioInfo.audioStatus == AUDIO_STATUS.END) {
this.handleSave()
}
}, 3000)
......@@ -263,13 +300,13 @@ export default {
clearInterval(this.timer)
this.timer = null
if (status) {
this.setAudioInfo({ audioStatus: 'no' })
this.removeRecords()
}
recorderManager.stop()
}, 1500),
//监听点击事件
initTime () {
if (this.audioInfo.audioStatus != 'start') return
initTime() {
if (this.audioInfo.audioStatus != AUDIO_STATUS.START) return
this.timer = setInterval(() => {
// console.log(this.times);
this.times++
......@@ -280,11 +317,11 @@ export default {
}
}, 1000 * 10)
},
handleTouchStart () {
handleTouchStart() {
this.times = 0
}
},
beforeCreate () {
beforeCreate() {
clearInterval(this.timer)
this.timer = null
}
......
export default {
data() {
data () {
return {
goodsId: '',
visitsId: ''
visitsId: '',
source: 1
}
},
onLoad(options) {
this.visitsId = options.visitsId
onLoad (options) {
this.visitsId = options.visitsId || ''
this.goodsId = options.id
if (options.source) this.source = options.source
this.addRecord()
},
methods: {
addRecord() {
addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
visitsId: this.visitsId
searchSource: this.source
}
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res
})
}
},
onUnload() {
onUnload () {
const params = {
id: this.addId,
visitsId: this.visitsId
id: this.addId
}
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.leaveRecord(params).then(res => {
console.log(res, 888)
})
......
......@@ -126,9 +126,13 @@ export default {
* @throws {Error} - 如果获取 OSS 令牌的过程中出现错误,将抛出错误
*/
async uploadRecord(record) {
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = await getOssToken()
console.log('获取Token成功!!', `lsaccessKeySecret: ${lsaccessKeySecret}, lsaccessKeyId: ${lsaccessKeyId}`)
this.wv.evalJS(`msgFromUniapp('${lsaccessKeyId}','${lsaccessKeySecret}','${securityToken}','${record.fileName}','${record.filePath}','${record.recordId}')`)
if (record.filePath) {
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = await getOssToken()
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 {
if (record.recordUrlList?.every(i => i.status == undefined)) {
const pathArr = record.recordUrlList.map(i => i.file)
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)
if (res) {
uni.$recordManager.removeRecord(record.id)
......@@ -219,7 +228,25 @@ export default {
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 {
*/
flattenData(records) {
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) {
return []
}
......@@ -251,6 +279,9 @@ export default {
const filePath = aFullPath.join('/') + '/'
return { ...file, recordId: cur.id, fileName, filePath }
})
if (cur.recordUrlList.length == 0) {
recordUrlList = [{ recordId: cur.id }]
}
acc = acc.concat(...recordUrlList)
return acc
}, [])
......
......@@ -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",
"style": {
"navigationStyle": "custom",
......
<template>
<view class="container" @click="hideSelect">
<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="container"
@click="hideSelect"
>
<wnCanvas
:canvasId="`c-${madiaId}`"
:drawStatus="penSwitch"
custom
:scaleSwitch="false"
ref="caseCanvas"
>
<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">PDF</view> -->
</view>
</view>
<view class="input-box">
<input
type="text"
class="input"
v-model="name"
maxlength="50"
@blur="input($event)"
@focus="focus"
/>
<view
class="input-tips"
v-if="!isSearch"
>搜索图片/视频名称<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons></view>
<uni-icons
v-if="isSearch"
type="closeempty"
class="close"
color="#999"
@click="handleClear"
size="20"
></uni-icons>
</view>
</view>
</view>
<view class="input-box">
<input
type="text"
class="input"
v-model="name"
maxlength="50"
@blur="input($event)"
@focus="focus"
/>
<view
class="input-tips"
v-if="!isSearch"
>搜索图片/视频名称<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons></view>
<uni-icons
v-if="isSearch"
type="closeempty"
class="close"
color="#999"
@click="handleClear"
size="20"
></uni-icons>
</view>
<scroll-view
class="record-box"
scroll-y
:scroll-top="scrollTop"
>
<view class="list">
<template v-if="list.length">
<template v-for="item in list">
<view
class="item"
:key="item.id"
>
<view
class="item-autio"
@click="playVideo(item)"
>
<scroll-view
class="record-box"
scroll-y
:scroll-top="scrollTop"
>
<view class="list">
<template v-if="list.length">
<template v-for="item in list">
<view
class="item"
:key="item.id"
>
<view
class="item-autio"
@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
:src="item.thumbnailUrl"
class="cover-box"
></image>
<image
v-if="item.materialFormat == 1"
src="../../assets/images/boutique/play.png"
class="play-box"
></image>
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
<view class="item-desc">{{ item.name }}</view>
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</template>
</view>
</template>
</scroll-view>
</view>
</scroll-view>
</view>
</template>
</wnCanvas>
<view
class="popup-box"
v-if="popupShow"
......@@ -110,7 +135,7 @@
></video>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
......@@ -137,11 +162,9 @@ export default {
}
},
props: {
views: {
type: Array,
default: () => []
},
show: Boolean
show: Boolean,
madiaId: Number,
penSwitch: Boolean,
},
computed: {
watchStatus () {
......@@ -150,7 +173,7 @@ export default {
},
watch: {
watchStatus: {
handler(val) {
handler (val) {
this.selectIndex = '全部'
// console.log(val)
// this.name = '';
......@@ -161,19 +184,19 @@ export default {
immediate: true
},
show: {
handler(newValue) {
if(newValue) this.init()
handler (newValue) {
if (newValue) this.init()
},
immediate:true
immediate: true
}
},
mounted() {
mounted () {
this.init()
this.getCategory()
},
methods: {
playVideo (item) {
this.$emit('preview',item)
this.$emit('preview', item)
},
focus () {
this.isSearch = true
......@@ -192,27 +215,30 @@ export default {
this.name = ''
this.isSearch = false
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex)
this.clearCanvas()
},
input(e) {
input (e) {
this.name = e.detail.value
if (this.name == '')
this.isSearch = false
// this.list = this.searchList.filter(i => i.name.includes(this.name))
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex, this.name)
this.clearCanvas()
},
selectType() {
selectType () {
this.isSelect = !this.isSelect
},
hideSelect() {
hideSelect () {
this.isSelect = false
},
chooseType(val) {
chooseType (val) {
console.log(val)
this.selectIndex = val.value
this.isSelect = false
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex, this.name)
this.clearCanvas()
},
async getCaseList(category = '', name = '') {
async getCaseList (category = '', name = '') {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo; // 44217687
const params = { merchantId: shopMerchantId, category }
......@@ -226,7 +252,7 @@ export default {
this.scrollTop = 0
}, 100);
},
async getCategory() {
async getCategory () {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
const res = await uni.$api.boutiqueApi.getCategory({ merchantId: shopMerchantId })
......@@ -238,7 +264,10 @@ export default {
}
})
this.selectList = [...this.selectList, ..._list]
}
},
clearCanvas () {
this.$refs.caseCanvas.clearBoard()
},
},
}
</script>
......@@ -282,7 +311,7 @@ export default {
.pop-box {
width: 368rpx;
// height: 248rpx;
background: #FFFFFF;
background: #ffffff;
border-radius: 16rpx;
padding: 16rpx 0;
.type-item {
......@@ -294,7 +323,7 @@ export default {
margin-bottom: 0;
}
&.active {
background-color: #ECF1FF;
background-color: #ecf1ff;
}
}
}
......@@ -380,7 +409,7 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; // 控制多行的行数
-webkit-line-clamp: 2; // 控制多行的行数
-webkit-box-orient: vertical;
padding-bottom: 0;
}
......
......@@ -85,7 +85,7 @@
<template v-if="customerType == 1">
<template v-if="pageParams.received">
<view class="ok">
<view class="ok-status"></view>
<view class="ok-status"></view>
<!-- <image
class="ok-status"
src="@/assets/images/boutique/ok-status.webp"
......@@ -94,11 +94,15 @@
</view>
</template>
<template v-else>
<image v-if="pageParams.QRURL"
<image
v-if="pageParams.QRURL"
class="qr-code-img"
:src="pageParams.QRURL"
/>
<view v-else class="no-data">
<view
v-else
class="no-data"
>
<view class="no-data-img"></view>
<!-- <image
src="@/assets/images/boutique/no-data.webp"
......@@ -231,7 +235,7 @@ export default {
watch: {
watchCustomerInfo: {
immediate: true,
handler(newval) {
handler (newval) {
this.customerInfo = Object.assign(this.customerInfo, newval)
try {
// 监听完成接待修改数据,同步修改生成优惠券按钮状态
......@@ -246,7 +250,7 @@ export default {
},
watchStatus: {
immediate: true,
handler(newval) {
handler (newval) {
this.close()
this.closeAllPopup()
this.pageParams.QRURL = ''
......@@ -260,7 +264,7 @@ export default {
}
}
},
show() {
show () {
this.closeAllPopup()
}
},
......@@ -293,7 +297,7 @@ export default {
}
},
mounted () {
},
methods: {
init () {
......@@ -332,7 +336,7 @@ export default {
const { customerName, phoneNumber, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName
},
chooseCoupon(item) {
chooseCoupon (item) {
this.pageParams.couponId = item.id
this.customerInfo.couponTypeName = item.couponTypeName
this.$store.dispatch('setCustomerInfo', this.customerInfo)
......@@ -349,12 +353,12 @@ export default {
this.$refs[e].open();
this.$emit('hideTool')
},
open(customerType, customerCouponId) {
open (customerType, customerCouponId) {
this.$refs.couponPopup.open()
this.customerType = customerType
if (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()
try {
......@@ -367,7 +371,7 @@ export default {
close () {
this.$refs.couponPopup?.close()
},
handleSelect(item, popkey) {
handleSelect (item, popkey) {
console.log(item, popkey)
this.$refs[popkey].close();
if (popkey == "employeeBoxVisible") {
......@@ -404,7 +408,7 @@ export default {
}
return flag
},
async createCoupon() {
async createCoupon () {
if (this.pageParams.received) return
if (!this.isCheck) return // 按钮置灰的情况
try {
......@@ -620,8 +624,8 @@ export default {
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
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
<template>
<view class="layout">
<view class="tab-box flex">
<template v-for="(item, index) in carList">
<wnCanvas
: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
:key="index"
:class="['tab',`${currentIndex == index ? 'active' : ''}`]"
@click="changeCar(item)"
class="risk-informed flex"
@click="$refs.riskInformedPop.open()"
>
{{item}}
风险告知
<view class="sprite-icon icon-info_shield"></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
class="left-content"
:key="updateViewKey"
@click="showPicture(currentItem)"
class="content-box flex"
v-show="tabIndex == 0"
>
<image
:src="currentItem.modelDisplayPicurl"
class="poster"
/>
<view
class="tips"
v-if="currentItem.detailPicurl"
>* 点击图片查看详情 &gt;</view>
<template v-if="currentItem && currentItem.modelDisplayPicurl">
<view
class="left-content"
:key="updateViewKey"
@click="showPicture(currentItem)"
>
<image
: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>
<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 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"
@changePreView="changePreView"
ref="sku"
/>
</view>
<view
class="coupon-btn flex"
v-if="!isPreview"
@click="couponPopupRef.open(customerType, customerInfo.customerCouponId)"
>{{couponText}}</view>
</view>
</view>
</wnCanvas>
<car-brands
ref="carBrandRef"
@select="handleSelect"
......@@ -83,12 +113,13 @@ import SkuBox from './SkuBox.vue'
import CarBrands from '@/components/CarBrands.vue'
import CouponPop from './CouponPop.vue'
import RiskInformedBox from './RiskInformedBox.vue'
import OptionalTable from './OptionalTable.vue'
const m5 = require("@/assets/images/boutique/index/m5.png")
const m7 = require("@/assets/images/boutique/index/m7.png")
const m9 = require("@/assets/images/boutique/index/m9.png")
export default {
name: 'Reception',
components: { SkuBox, CarBrands, CouponPop, RiskInformedBox },
components: { SkuBox, CarBrands, CouponPop, RiskInformedBox, OptionalTable },
props: {
customerType: Number,
show: Boolean,
......@@ -96,6 +127,8 @@ export default {
currentCar: String,
type: String,
popupImg: String,
madiaId: Number,
penSwitch: Boolean,
},
data () {
return {
......@@ -105,7 +138,9 @@ export default {
updateViewKey: Date.now(),
carInfo: {},
currentImgUrl: '',
currentItem: null
currentItem: null,
tabs: ['加装', '选装'],
tabIndex: 0
}
},
watch: {
......@@ -124,6 +159,7 @@ export default {
currentCarString: {
immediate: true,
handler (newval) {
if (!this.hasOptionals && this.tabIndex == 1) this.tabIndex = 0
this.defaultImg = {
'M5': m5,
'M7': m7,
......@@ -140,6 +176,7 @@ export default {
watchStatus: {
immediate: true,
handler (newval) {
this.tabIndex = 0
this.currentItem = null
this.closeAllPopup()
}
......@@ -148,7 +185,7 @@ export default {
immediate: true,
handler (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 {
},
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 {
if (this.change_disabled || this.currentCarString == item) return uni.hideLoading()
this.currentCarString = item
this.updateViewKey = Date.now()
this.clearCanvas()
},
changePreView (e, leave = true) {
changePreView (e, leave = true, clearBoard = true) {
let { currentItem } = this,
{ id, carModelName, name, materialType } = e,
key = `${carModelName}_${id}`,
......@@ -198,6 +243,7 @@ export default {
this.currentItem = e
this.updateViewKey = Date.now()
if (this.isPreview) return
if (clearBoard) this.clearCanvas()
if (value) {
value.openCount += 1
value.entryTime = Date.now()
......@@ -246,6 +292,16 @@ export default {
},
clearSkuState () {
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 {
height: calc(100vh - 144rpx);
margin-top: 144rpx;
padding: 0 0 64rpx 64rpx;
animation: show-view-opacity 0.15s forwards;
.left-content {
width: 1328rpx;
height: 100%;
......@@ -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>
\ No newline at end of file
<template>
<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>
<template v-for="(i,index) in boutiqueMediaConfig[currentCar]">
<template v-for="(i,index) in list">
<view
:class="['first-type-item flex',{active:i.tabId == tabId}]"
:key="index"
......@@ -121,10 +121,7 @@ export default {
currentCar: {
immediate: true,
handler (newval) {
if (this.show && this.requested) {
let [item] = this.boutiqueMediaConfig[newval]
this.changeTabId(item.tabId, 0, false)
}
if (this.show && this.requested) this.changeCar(newval)
}
},
show: {
......@@ -152,13 +149,21 @@ export default {
},
boutiqueMediaConfig () {
return this.$store.state.user.boutiqueMediaConfig
},
list(){
let item = this.boutiqueMediaConfig[this.currentCar]
return item?.retrofitting || []
}
},
mounted () {
},
methods: {
changeCar (newval) {
let [item] = this.boutiqueMediaConfig[newval].retrofitting
this.changeTabId(item.tabId, 0, false)
},
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)
},
changeTabId (tabId, index, filter = true) {
......@@ -168,7 +173,7 @@ export default {
this.setSecondList()
},
async setSecondList () {
let secondList = this.boutiqueMediaConfig[this.currentCar],
let secondList = this.boutiqueMediaConfig[this.currentCar].retrofitting,
index = secondList.findIndex(e => e.tabId == this.tabId)
if (index == -1) index = 0
let { list } = secondList[index]
......@@ -428,13 +433,5 @@ export default {
}
}
}
@keyframes show-view-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="title">
<view class="sprite-icon icon-aito"></view>
<view class="text">{{tabId}}-{{currentCar}}</view>
</view>
<view
class="form-box"
:key="refreshKey"
>
<template v-if="customerType == 1">
<view class="form">
<template v-for="(i, index) in formObject">
<view
:class="['form-item' ,{active:focusIndex == index}]"
:key="index"
>
<view class="form-item-box">
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.key]"
class="input"
@input="inputCustomer"
:placeholder="i.placeholder"
@focus="focusIndex = index"
@blur="resetFocusIndex"
/>
<customer-autocomplete
:showType="i.inputType"
:searchValue="customerInfo[i.key]"
:show="focusIndex == index"
@choose="chooseCustomer"
/>
</template>
<template v-else>
<view
:class="['select flex',{placeholderStyle:!customerInfo[i.key]}]"
@click="showPopup(i.popKey,index)"
>
<view class="value text-hide">{{customerInfo[i.key] ||i.placeholder}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</template>
</view>
</view>
</template>
<view :class="['form-item' ,{active:focusIndex == 4}]">
<view class="form-item-box">
<view
:class="['select flex',{placeholderStyle:!couponTypeName}]"
@click="showPopup('couponBoxVisible', 4)"
>
<view class="value text-hide">{{couponTypeName|| '请选择礼券类型'}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</view>
</view>
<view
class="form-btn flex"
@click="createCoupon"
>为客户发券</view>
</view>
</template>
<template v-if="customerType == 0 && customerInfo.phoneNumber">
<view class="customer-info-box">
<view
class="customer-info flex"
@click="pageParams.showDetail = !pageParams.showDetail"
>
<view class="text text-hide flex">
<view class="text-hide">{{customerInfo.customerName}}</view>
<view class="line">|</view>
<view class="text-hide">{{customerInfo.carModel || '-'}}</view>
</view>
<view class="sprite-icon icon-customer-detail"></view>
</view>
<view
class="customer-detail flex"
v-show="pageParams.showDetail"
>
<template v-for="(i,index) in customerDetailObject">
<view
class="customer-item flex"
:key="index"
>
<view class="label">{{i.label}}</view>
<view class="value text-hide">
<template v-if="i.format">
{{i.format(customerInfo)}}
</template>
<template v-else>
{{customerInfo[i.key] || '-'}}
</template>
</view>
</view>
</template>
</view>
</view>
</template>
</view>
<view class="content">
<template v-for="(i, index) in views">
<image
:key="index"
:src="i.detailUrl"
:class="['item',`item-${index}`]"
@click="jumpPage(i)"
/>
</template>
</view>
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
@close="resetFocusIndex"
/>
<employee
ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')"
title="交付人员"
@close="resetFocusIndex"
/>
<MessageBox
ref="couponBoxVisible"
position="bottom"
:isFooter="false"
title="请选择礼券类型"
:maxHeight="1000"
@close="resetFocusIndex"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: pageParams.couponId == item.id }"
@click="chooseCoupon(item)"
v-for="(item, index) in couponList"
:key="index"
>
{{ item.couponTypeName }}
</view>
</view>
</MessageBox>
<MessageBox
ref="couponTips"
:content="couponErrorTips"
:showCancelBtn="false"
confirmBtnText="知道了"
></MessageBox>
<qr-box
:url="pageParams.QRURL"
ref="qrbox"
:received="pageParams.received"
@close="closeQr"
/>
</view>
</template>
<script type='text/ecmascript-6'>
import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue'
import QrBox from './RiskInformedBox.vue'
import dayjs from 'dayjs'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
export default {
name: 'Reception',
components: { Employee, CarBrands, QrBox, CustomerAutocomplete },
props: {
views: Array,
customerType: Number,
show: Boolean,
madiaId: Number,
tabId: Number,
currentCar: String
},
data () {
return {
formObject: [
{
placeholder: '车主姓名',
key: 'customerName',
type: 'input',
inputType: 'text',
maxlength: 50
},
{
placeholder: '车主电话',
key: 'phoneNumber',
type: 'input',
inputType: 'tel',
maxlength: 11
},
{
placeholder: '车型',
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible'
},
{
placeholder: '交付专员',
key: 'staffName',
type: 'select',
popKey: 'employeeBoxVisible'
}
],
customerDetailObject: [
{
label: '车主姓名',
key: 'customerName',
},
{
label: '交付专员',
key: 'staffName',
},
{
label: '车型',
key: 'carModel',
},
{
label: '领券时间',
format (cell) {
return dayjs(cell.receiveCouponDate).format("YYYY年MM月DD日")
}
},
{
label: '车主电话',
key: 'phoneNumber',
},
{
label: '接待时间',
format () {
return dayjs().format("YYYY年MM月DD日")
}
}
],
customerInfo: {},
couponList: [],
couponTypeName: '',
focusIndex: -1,
pageParams: {
qrTimer: null,
received: false,
couponId: '',
carInfo: {},
QRURL: '',
showDetail: false,
clickFlag: false
},
couponErrorTips: '',
refreshKey: Date.now()
}
},
watch: {
watchCustomerInfo: {
immediate: true,
handler (newval) {
this.customerInfo = newval
this.pageParams.showDetail = false
}
},
show (n) {
if (n && this.customerType == 1) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.pageParams = this.$options.data.call(this).pageParams
this.couponTypeName = ''
this.closeAllPopup()
this.refreshKey = Date.now()
}
}
},
computed: {
watchCustomerInfo () {
return this.$store.state.user.customerInfo
},
watchStatus () {
return this.$store.state.user.historyStatus
},
},
methods: {
init () {
this.findCouponList()
},
async findCouponList () {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo,
{ list } = await uni.$api.boutiqueApi.findCouponList({
merchantIdList: [shopMerchantId]
}),
arr = []
if (list && list.length) {
let couponTypeList = Array.from(new Set([...list.map((e) => e.couponType)]))
couponTypeList.map((i) => {
let item = []
list.map((e) => {
if (i == e.couponType) item.push(e)
})
if (item.length) arr.push(item.sort(function (a, b) {
return b.createdDate - a.createdDate
})[0])
})
console.log(arr)
let item = arr.find(e => e.couponType == 1),
item2 = arr.find(e => e.couponType == 18)
if (!this.pageParams.couponId) {
if (item) this.chooseCoupon(item) //默认填入类型为「太阳膜」类型
else if (item2) this.chooseCoupon(item2) //次选填入「精品」类型
else this.chooseCoupon(arr[0]) // 无此两种类型情况默认带入任意类型礼券
}
}
this.couponList = arr
},
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.staffName = item.staffName
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.pageParams.carInfo = item
}
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
showPopup (e, index) {
this.focusIndex = index
this.$refs[e].open()
},
closeAllPopup () {
this.$refs.carBrandListVisible?.close()
this.$refs.employeeBoxVisible?.close()
this.$refs.couponBoxVisible?.close()
this.$refs.qrbox?.close()
this.resetFocusIndex()
this.closeQr()
},
chooseCoupon (item) {
this.pageParams.couponId = item.id
this.couponTypeName = item.couponTypeName
this.$refs.couponBoxVisible.close()
},
jumpPage (e) {
this.$emit('jumpPage', {
id: e.uniCode,
historyId: this.madiaId
})
},
async createCoupon () {
try {
const { pageParams: { clickFlag, couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo"),
validateStatus = await this.validate(),
checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId])
if (!validateStatus) return
if (clickFlag) return
if (!checkCouponAmount.length) throw '该门店礼券已使用完,请联系管理员配置。'
this.pageParams.clickFlag = true
uni.showLoading({
mask: true
})
let { staffName, salesUuid } = customerInfo,
scene = `id=${couponId}&userId=${salesUuid}&employName=${staffName}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
params = {
path: '/packageShopmall/packageMine/pages/boutique/gift/gift',
appId: 'wxe10067a63c1856ac',
}
if (carInfo.name) {
scene += `&carChildsBrandId=${carInfo.carChildsBrandId}&carChildsBrandName=${carInfo.carChildsBrandName}&carBrandId=${carInfo.carBrandId}&carBrand=${carInfo.carBrand}&carSeriesId=${carInfo.id}&carSeriesName=${carInfo.name}`
}
params.scene = scene
let {
code,
data,
message
} = await uni.$api.commonApi.createQrcode(params)
if (code == 0) {
if (data) {
this.pageParams.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
uni.hideLoading()
this.pageParams.clickFlag = false
}
else throw '生成小程序码失败,请重试!'
} else throw message
} catch (error) {
uni.hideLoading()
if (error) {
this.pageParams.clickFlag = false
this.couponErrorTips = error
this.$refs.couponTips.open()
}
}
},
async validate () {
let flag = true
try {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this.pageParams
// 检查车主姓名
if (!customerName || !phoneNumber || !carModel || !staffName) throw '请输入客户信息'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
if (!couponId) throw '请选择礼券类型'
} catch (error) {
this.pageParams.clickFlag = false
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none',
})
flag = false
}
return flag
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
if (this.pageParams.qrTimer) return
try {
this.pageParams.received = false
this.pageParams.qrTimer = setInterval(async () => {
const { pageParams: { couponId }, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res && res.total) {
this.pageParams.received = true
this.closeQr()
this.$emit('reception', {
item: {
customerName: customerInfo.customerName,
carSeriesName: customerInfo.carModel,
customerPhone: customerInfo.phoneNumber,
userId: customerInfo.salesUuid,
employeeName: customerInfo.staffName,
receiveCouponDate: Date.now()
}
})
setTimeout(() => {
this.$refs.qrbox.close()
}, 3e3)
}
}, 2e3)
} catch (error) {
if (error) uni.showToast({
title: error,
icon: "none",
});
}
},
closeQr () {
if (this.pageParams.qrTimer) clearInterval(this.pageParams.qrTimer)
this.pageParams.qrTimer = null
},
resetFocusIndex () {
this.focusIndex = -1
},
async checkCouponAmount (merchantCouponId, merchantIdList) {
const { list } = await uni.$api.boutiqueApi.findCouponList({
merchantCouponId,
merchantIdList
})
return list || []
},
chooseCustomer (e) {
this.customerInfo = {
...this.customerInfo,
phoneNumber: e.ownerPhone,
customerName: e.ownerName,
carModel: e.brandModel
}
this.inputCustomer()
}
}
}
</script>
<style scoped lang='scss'>
.layout {
position: relative;
&::after {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/boutique/reception-bg.webp');
background-size: 100% 100%;
content: '';
z-index: -1;
}
.title {
padding: 160rpx 0 24rpx 64rpx;
.sprite-icon {
margin-bottom: 24rpx;
}
.text {
line-height: 112rpx;
font-weight: 700;
font-size: 80rpx;
color: #333333;
}
}
.form-box {
height: 80rpx;
margin-bottom: 48rpx;
padding: 0 64rpx;
.form {
display: flex;
gap: 0 28rpx;
height: 100%;
&-item {
width: 336rpx;
height: 100%;
position: relative;
&-box {
position: relative;
width: 100%;
height: 100%;
background: #ffffff;
border: 3rpx solid #a8c1ff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 24rpx;
z-index: 2;
}
.input,
.select {
width: 100%;
height: 100%;
border: none !important;
outline: none;
font-size: 28rpx;
color: #333333;
border-radius: 16rpx;
box-sizing: border-box;
line-height: 80rpx;
padding: 0 !important;
&::placeholder {
color: #999999;
}
}
.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;
}
}
&-btn {
width: 286rpx;
height: 80rpx;
background-image: linear-gradient(180deg, #61c0ff 0%, #2c66f7 100%);
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 16rpx;
font-weight: 500;
font-size: 28rpx;
color: #ffffff;
justify-content: center;
}
}
.customer-info-box {
position: relative;
width: 480rpx;
height: 100%;
.customer-info {
width: 100%;
height: 100%;
background: #ffffff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 24rpx;
.text {
flex: 1;
.text-hide {
max-width: calc(50% - 10rpx);
}
}
.line {
margin: 0 6rpx;
flex-shrink: 0;
}
.sprite-icon {
flex-shrink: 0;
margin-left: auto;
}
}
.customer-detail {
position: absolute;
bottom: 0;
left: 496rpx;
min-width: 860rpx;
height: 204rpx;
z-index: 2;
background: #ffffff;
border-radius: 16rpx;
flex-wrap: wrap;
box-sizing: border-box;
padding: 32rpx 48rpx;
gap: 16rpx 0;
.customer-item {
width: 50%;
color: #333333;
line-height: 36rpx;
font-size: 28rpx;
.label {
width: 120rpx;
color: #666666;
flex-shrink: 0;
margin-right: 24rpx;
text-align: right;
}
}
}
}
}
.content {
width: 100%;
height: calc(100vh - 484rpx);
padding: 0 64rpx;
.item {
float: left;
}
.item-0 {
width: 1084rpx;
height: 992rpx;
margin-right: 50rpx;
}
.item-1 {
margin-bottom: 48rpx;
}
.item-1,
.item-2 {
width: 1084rpx;
height: 472rpx;
}
}
}
.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>
\ No newline at end of file
......@@ -6,7 +6,10 @@
* @LastEditTime: 2024-05-31 16:07:23
-->
<template>
<view class="detail-box">
<view
class="detail-box"
@dblclick="dbClick"
>
<view class="nav-bar">
<view
class="back"
......@@ -43,6 +46,7 @@
:type="type"
:popupImg="item.popupImg"
@preview="onPreview"
:penSwitch="penSwitch"
/>
</view>
</template>
......@@ -54,9 +58,17 @@
@choose="choose"
@finish="open"
:id="id"
toolStyle="top:calc(50% - 160rpx);"
toolStyle="top:calc(50% - 24rpx);"
/>
</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
ref="stepRef"
@submit="done"
......@@ -77,7 +89,6 @@
<script>
import ToolBox from "@/components/ToolBox.vue";
import FinishStep from "@/components/FinishStep.vue";
import Membranes from "./membranes.vue";
import Reception from "./components/Reception.vue";
import { mapMutations } from "vuex";
import invitation from "./invitation.vue";
......@@ -90,7 +101,6 @@ export default {
components: {
ToolBox,
FinishStep,
Membranes,
Reception,
invitation,
Case,
......@@ -114,10 +124,17 @@ export default {
data () {
return {
showPreview: false,
mediaObject: null
mediaObject: null,
drawStatus: false,
};
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
if (newval) this.drawStatus = false
}
},
},
computed: {
title () {
......@@ -134,6 +151,12 @@ export default {
watchCustomerInfo () {
return this.$store.state.user.customerInfo
},
penSwitch () {
return !this.isPreview && this.drawStatus
},
isPreview () {
return this.type == 'preview'
}
},
mounted () {
},
......@@ -219,7 +242,7 @@ export default {
detailUrl: materialUrl
}
this.showPreview = true
if (this.type == 'preview') return
if (this.isPreview) return
let key = `case-${materialFormat}-${id}`,
value = this.receptionTrack[key]
if (value) {
......@@ -239,7 +262,7 @@ export default {
},
onPreviewBack () {
this.showPreview = false
if (this.type == 'preview') return this.mediaObject = null
if (this.isPreview) return this.mediaObject = null
const { materialFormat, id } = this.mediaObject,
key = `case-${materialFormat}-${id}`,
value = this.receptionTrack[key]
......@@ -268,7 +291,10 @@ export default {
if (customerType == 0 && !watchCustomerInfo.phoneNumber) flag = false
}
return flag
}
},
dbClick () {
if (!this.isPreview) this.drawStatus = !this.drawStatus
},
},
};
</script>
......@@ -327,7 +353,19 @@ export default {
left: 0;
}
}
.tool-box {
top: 284rpx;
.pen-box {
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>
<template>
<view class="container">
<view class="bg"></view>
<view class="box">
<view class="data-tabs-box">
<view class="data-tabs">
<template v-for="(item, index) in dateList">
<view
:class="['tab flex', { active: groupIndex == item.id }]"
:key="index"
@click="changeIndex(item.id)"
>{{ item.text }}</view>
</template>
<view :class="['active-btn', `active-btn-${groupIndex - 1}`]"></view>
</view>
</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">
<wnCanvas
:canvasId="`c-${madiaId}`"
:drawStatus="penSwitch"
custom
:scaleSwitch="false"
ref="historyCanvas"
>
<template slot="customContent">
<view class="bg"></view>
<view class="box">
<view class="data-tabs-box">
<view class="data-tabs">
<template v-for="(item, index) in dateList">
<view
class="item"
:key="item.id"
@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">{{
:class="['tab flex', { active: groupIndex == item.id }]"
:key="index"
@click="changeIndex(item.id)"
>{{ item.text }}</view>
</template>
<view :class="['active-btn', `active-btn-${groupIndex - 1}`]"></view>
</view>
</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
class="item"
:key="item.id"
@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[0].goodsName
: "-"
}}</view>
X{{ item.goodsList.length }}件
<image
class="image-look"
src="../../assets/images/boutique/look.png"
/>
</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="ind"
>
<view class="label">{{ k.label }}</view>
<view :class="{ value: true, bold: k.isBold }">{{
X{{ item.goodsList.length }}件
<image
class="image-look"
src="../../assets/images/boutique/look.png"
/>
</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="ind"
>
<view class="label">{{ k.label }}</view>
<view :class="{ value: true, bold: k.isBold }">{{
k.format
? formatTime(item[k.key])
: item[k.key] || "-"
}}</view>
</view>
</template>
<view class="info flex">
<view class="label">支付方式</view>
<view class="value">
<image
class="image-pay"
:src="
</view>
</template>
<view class="info flex">
<view class="label">支付方式</view>
<view class="value">
<image
class="image-pay"
:src="
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 class="info flex">
<view class="label">实收金额</view>
<view class="value bold">¥ <text>{{ item.totalPrice.toFixed(2) }}</text></view>
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</view>
</template>
</template>
</view>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</template>
</template>
</scroll-view>
</view>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
</wnCanvas>
<MessageBox
ref="historyRef"
title="订单商品"
......@@ -145,7 +155,9 @@ export default {
name: '',
mixins: [Record],
props: {
show: Boolean
show: Boolean,
madiaId: Number,
penSwitch: Boolean,
},
data () {
return {
......@@ -214,6 +226,7 @@ export default {
this.pageNum = 1
this.groupIndex = index
this.getRecordList()
if (!isStart) this.$refs.historyCanvas.clearBoard()
},
getRecordList () {
const { pageNum, pageSize, groupIndex } = this,
......
......@@ -243,9 +243,15 @@ export default {
}).then(({ materials, hidePackage }) => {
uni.hideLoading()
let boutiqueMediaConfig = {
M5: [],
M7: [],
M9: [],
M5: {
retrofitting: []
},
M7: {
retrofitting: []
},
M9: {
retrofitting: []
}
}
materials.map(e => {
const configItems = [
......@@ -254,14 +260,19 @@ export default {
]
if (!hidePackage) configItems.unshift({ key: 'packages', configIndex: 0 })
configItems.map(item => {
boutiqueMediaConfig[e.carModelName].push({
boutiqueMediaConfig[e.carModelName].retrofitting.push({
...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 => {
e.configList = boutiqueMediaConfig[e.title]
e.configList = boutiqueMediaConfig[e.title].retrofitting
})
this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig
}).catch(error => {
......
<template>
<view class="container">
<view class="bg"></view>
<view class="box">
<view class="input-box">
<input
type="text"
class="input"
v-model="customerNameOrPhone"
maxlength="11"
@blur="input($event)"
@focus="focus"
/>
<view class="input-tips" v-if="!isSearch"
>搜索客户姓名/电话<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons
></view>
<uni-icons
v-if="isSearch"
type="closeempty"
class="close"
color="#999"
@click="handleClear"
size="20"
></uni-icons>
</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 class="item" :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">{{
<wnCanvas
:canvasId="`c-${madiaId}`"
:drawStatus="penSwitch"
custom
:scaleSwitch="false"
ref="invitationCanvas"
>
<template slot="customContent">
<view class="bg"></view>
<view class="box">
<view class="input-box">
<input
type="text"
class="input"
v-model="customerNameOrPhone"
maxlength="11"
@blur="input($event)"
@focus="focus"
/>
<view
class="input-tips"
v-if="!isSearch"
>搜索客户姓名/电话<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons></view>
<uni-icons
v-if="isSearch"
type="closeempty"
class="close"
color="#999"
@click="handleClear"
size="20"
></uni-icons>
</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
class="item"
: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
? formatTime(item[k.key], k.key)
: item[k.key] || "-"
}}</view>
</view>
</template>
</view>
</template>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</template>
</template>
</view>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</template>
</template>
</scroll-view>
</view>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
</wnCanvas>
<MessageBox
ref="receptionTips"
content="是否接待当前客户,确定接待直接进入\n「车型加装选购页」"
......@@ -89,7 +104,9 @@ import Record from "@/mixin/record";
export default {
mixins: [Record],
props: {
show: Boolean
show: Boolean,
madiaId: Number,
penSwitch: Boolean,
},
data () {
return {
......@@ -107,26 +124,26 @@ export default {
chooseItem: {}
}
},
watch:{
show:{
handler(val) {
if(val) this.init()
this.$refs.receptionTips?.close()
},
immediate:true
}
watch: {
show: {
handler (val) {
if (val) this.init()
this.$refs.receptionTips?.close()
},
immediate: true
}
},
},
methods: {
init () {
this.customerNameOrPhone = '';
console.log('init')
setTimeout(()=>{
setTimeout(() => {
this.isSearch = false
this.pageNum = 1
this.flag = false
this.getRecordList()
},300)
}, 300)
},
//已预约的并且预约时间小于当前时间的,显示超时未到店,否则显示已预约
......@@ -158,12 +175,14 @@ export default {
this.pageNum = 1
this.flag = false
this.getRecordList()
this.clearCanvas()
},
focus () {
this.isSearch = true
},
handleClear () {
this.init()
this.clearCanvas()
},
getRecordList () {
const { pageNum, pageSize, customerNameOrPhone } = this,
......@@ -184,7 +203,11 @@ export default {
this.$emit('reception', {
item: this.chooseItem
})
}, 200)
}, 200),
clearCanvas () {
this.$refs.invitationCanvas.clearBoard()
},
},
}
</script>
......@@ -203,7 +226,7 @@ export default {
height: 800rpx;
position: absolute;
left: 0;
background-image: url("../../assets/images/boutique/record-bg.png");
background-image: url('../../assets/images/boutique/record-bg.png');
background-size: 100% 100%;
top: 0;
}
......
<!--
* @Description: 膜类专区
* @Author: huyue
* @Date: 2024-05-30 14:40:39
* @LastEditors: huyue
* @LastEditTime: 2024-06-05 14:27:27
-->
<template>
<view style="position: relative">
<view class="bg"></view>
<!-- <view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="32"></uni-icons>
</view>
<view class="title">膜类专区</view>
</view> -->
<view class="wrapper">
<view class="wrapper-content">
<template v-if="views && views[firstIndex] && views[firstIndex].receptionSourceDetailInfoList">
<view class="first-tab">
<view
class="tab-item"
v-for="(i, index) in views"
:key="index"
@click="changeIndex(index, 'firstIndex')"
>
<view
class="sprite-icon"
:class="[
firstIndex == index ? `icon-${firstClass[index]} active` : '',
]"
:style="{ left: firstLeft[index] }"
></view>
<view
class="text"
:class="[firstIndex == index ? `active` : '']"
>{{
i.tabName
}}</view>
</view>
</view>
<template v-if="madiaId == 2">
<!-- 套餐 无分组 -->
<view
class="content"
id="content"
>
<template v-if="views && views[firstIndex] && views[firstIndex].noGroupReceptionSourceDetailInfoList &&
views[firstIndex].noGroupReceptionSourceDetailInfoList.length >
0
">
<view
class="product-list"
:key="firstIndex"
:class="direction"
style="height: 1120rpx"
>
<view
class="product-item"
v-for="(it, ids) in views[firstIndex]
.noGroupReceptionSourceDetailInfoList"
:key="ids"
@click="goDetail(it)"
>
<image
:src="it.thumbnail"
mode="scaleToFill"
class="product-img"
/>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/boutique/nothing.png"
/>
<view>暂无产品内容</view>
</view>
</template>
</view>
</template>
<template v-else>
<!-- 其他 有分组 -->
<view
class="content"
id="content"
>
<view
class="second-tab"
ref="secondTab"
v-if="views[firstIndex].receptionSourceDetailInfoList.length > 0"
>
<view
v-for="(item, ind) in views[firstIndex]
.receptionSourceDetailInfoList"
:key="ind"
class="tab-item"
:class="[secondIndex == ind ? 'active' : '']"
@click="changeIndex(ind, 'secondIndex')"
>{{ item.tabName }}
</view>
</view>
<template v-if="
views[firstIndex].receptionSourceDetailInfoList.length > 0 &&
views[firstIndex].receptionSourceDetailInfoList[secondIndex]
.receptionSourceDetailInfoList
">
<view
class="product-list"
:key="firstIndex + secondIndex"
:class="direction"
:style="{
height: views[firstIndex].receptionSourceDetailInfoList
? '962rpx'
: '1032rpx',
}"
>
<view
class="product-item"
v-for="(itm, idx) in views[firstIndex]
.receptionSourceDetailInfoList[secondIndex]
.receptionSourceDetailInfoList"
:key="idx"
@click="goDetail(itm)"
>
<image
:src="itm.thumbnail"
mode="scaleToFill"
class="product-img"
/>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/boutique/nothing.png"
/>
<view>暂无产品内容</view>
</view>
</template>
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/boutique/nothing.png"
/>
<view>暂无产品内容</view>
</view>
</template>
</view>
</view>
<image
v-if="views && views[firstIndex] && views[firstIndex].receptionSourceDetailInfoList"
:src="animationList[firstIndex]"
mode="scaleToFill"
class="img-animate"
:key="imgKey"
/>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: 'Membranes',
props: {
views: {
type: Array,
default: () => []
},
madiaId: Number,
show: Boolean
},
data () {
return {
firstIndex: 0,
firstLeft: ['0rpx', '352rpx', '756rpx'],
firstClass: ['first-nav', 'second-nav', 'second-nav'],
secondIndex: 0,
animationList: [require('@/assets/images/boutique/animation-m5.png'), require('@/assets/images/boutique/animation-m7.png'), require('@/assets/images/boutique/animation-m9.png')],
imgKey: Date.now(),
direction: 'left',
productKey: Date.now()
}
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
},
watch: {
show (val) {
if (val) this.imgKey = Date.now()
},
watchStatus () {
console.log(111)
this.firstIndex = 0
this.secondIndex = 0
this.imgKey = Date.now()
}
},
methods: {
changeIndex (index, name) {
if (this[name] == index) return // 点击同一个
this.direction = ''
console.log(index, name, this[name])
if (this[name] < index) {
this.direction = 'right'
} else {
this.direction = 'left'
}
this[name] = index
console.log(index, name, this[name], '====')
if (name === 'firstIndex') {
this.secondIndex = 0
this.imgKey = Date.now()
}
},
async findSoureList () {
console.log(1111)
const data = await uni.$api.boutiqueApi.findSoureList({})
console.log(data)
},
goDetail (data) {
console.log(data)
uni.navigateTo({
url: `/pages/boutique/productDetail?detailUrl=${data.detailUrl}`
})
}
}
}
</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;
}
}
.bg {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-image: url("../../assets/images/boutique/membranes-bg.webp");
background-size: 100% 100%;
z-index: -1;
}
.wrapper {
box-sizing: border-box;
padding: 168rpx 64rpx 64rpx;
&-content {
background-color: #fff;
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 48rpx;
padding: 4rpx;
height: 1296rpx;
box-sizing: border-box;
}
// filter: blur(8rpx);
.first-tab {
position: relative;
display: flex;
width: 100%;
background-color: #eef4fe;
height: 176rpx;
line-height: 128rpx;
border-radius: 48rpx 48rpx 0 0;
z-index: 0;
.tab-item {
width: 400rpx;
text-align: center;
font-weight: 500;
font-size: 40rpx;
color: #1f2133;
.text {
position: relative;
text-align: center;
width: 400rpx;
}
.active {
position: absolute;
top: 0;
z-index: -1;
font-weight: 700;
font-size: 40rpx;
color: #2c66f7;
&::after {
content: "";
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 8rpx;
background-color: #2c66f7;
border-radius: 16rpx;
}
}
}
}
.content {
position: relative;
background-color: #fff;
width: 100%;
padding-top: 48rpx;
margin-top: -48rpx;
border-radius: 48rpx;
height: calc(100% - 128rpx);
overflow-x: hidden;
.second-tab {
width: fit-content;
display: flex;
background: #f2f2f2;
border-radius: 16rpx;
height: 92rpx;
align-items: center;
margin-left: 64rpx;
margin-bottom: 48rpx;
padding: 4rpx;
box-sizing: border-box;
.tab-item {
height: 100%;
line-height: 88rpx;
padding: 0 48rpx;
box-sizing: border-box;
}
.active {
background-color: #fff;
border-radius: 16rpx;
}
}
.product-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 48rpx;
// height: 908rpx;
padding: 0 64rpx 64rpx;
overflow-y: auto;
.product-item {
text-align: center;
background: #ffffff;
box-shadow: 0 16rpx 24rpx 0 #2c66f71a;
border-radius: 24rpx;
height: 594rpx;
.product-img {
width: 486rpx;
height: 594rpx;
border-radius: 24rpx;
}
.product-name {
padding-bottom: 48rpx;
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
font-size: 14px;
color: #999999;
position: absolute;
top: 50%;
transform: translateY(-50%);
.icon {
width: 676rpx;
height: 284rpx;
margin-bottom: 24rpx;
}
}
@keyframes moveAndFade {
0% {
transform: translate(30%, -30%) scale(0.5); /* 移动到右上角并缩小 */
// transform: translate(100%, -100%) scale(0.2);
filter: blur(0.5px); /* 设置模糊 */
opacity: 0.3;
}
100% {
transform: translate(0, 0) scale(1); /* 移动到正常位置并恢复大小 */
filter: blur(0); /* 清晰 */
opacity: 1;
}
}
.img-animate {
animation: moveAndFade 1.2s ease-in-out forwards; /* 应用动画,持续时间2秒,缓动函数,停留在最后一帧 */
position: absolute; /* 确保图片可以移动 */
top: 0;
right: 0;
width: 480rpx;
height: 320rpx;
}
.left {
animation: show-view-left 0.5s;
}
.right {
animation: show-view-right 0.3s;
}
</style>
<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
......@@ -94,11 +94,11 @@ export default {
mounted () {
},
methods: {
search () {
search () {
this.edit = false
console.log(this.searchValue)
},
openInput () {
openInput () {
this.edit = true
this.inputFocus = true
},
......@@ -141,7 +141,7 @@ export default {
width: 100%;
height: 80rpx;
background: #ffffff;
border: 3rpx solid #A8C1FF;;
border: 3rpx solid #a8c1ff;
border-radius: 16rpx;
box-sizing: border-box;
color: #333;
......@@ -179,8 +179,8 @@ export default {
.select-box {
margin: 32rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
......
......@@ -98,13 +98,14 @@ export default {
}
}
} catch (error) {
this.$sendSentry(`选择场景异常:merchantId:${userInfo.shopMerchantId},merchantName:${userInfo.shopMerchantName},sceneType:${sceneType},失败原因:${JSON.stringify(error)}`)
uni.hideLoading()
uni.showToast({
title: error,
title: typeof error == "string" ? error : error.toString(),
icon: 'none'
})
console.log(error)
this.$sendSentry(`选择场景异常:merchantId:${userInfo?.shopMerchantId},merchantName:${userInfo?.shopMerchantName},sceneType:${sceneType},失败原因:${typeof error == "string" ? error : error.toString()}`)
}
},
async jump (userInfo, data) {
......
......@@ -61,31 +61,11 @@
<view
class="case-item"
:key="item.id"
@click="jumpDetail(item)"
>
<image
class="img"
:src="item.cover"
></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>
<case-item
:item="item"
:visitsId="visitsId"
/>
</view>
</template>
</template>
......@@ -115,9 +95,11 @@
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import PackagePopup from './components/PackagePopup.vue'
import CaseItem from '@/components/HomeFrame/components/CaseItem.vue'
export default {
components: {
PackagePopup
PackagePopup,
CaseItem
},
data () {
return {
......@@ -259,7 +241,6 @@ export default {
})
e.tags = tags.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.flag = true
......@@ -277,28 +258,6 @@ export default {
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 () {
let { currentPage, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing'
......@@ -338,7 +297,7 @@ export default {
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: 176rpx;
padding-top: 160rpx;
.nav-bar {
position: fixed;
width: 100%;
......@@ -442,12 +401,15 @@ export default {
font-size: 28rpx;
color: #292d33;
line-height: 44rpx;
max-height: 50vh;
overflow-y: scroll;
word-break: break-all;
}
}
}
}
.case-box {
height: 1004rpx;
height: 1020rpx;
padding: 0 !important;
.case-scroll-box {
height: calc(100% - 104rpx);
......@@ -460,35 +422,6 @@ export default {
.case-item {
width: 496rpx;
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 @@
:ulList="item.ulList"
:screenList="item.screenList"
@onProductModel="productModelStatus = $event"
:isPreview="type == 'preview'"
:isPreview="isPreview"
:isByd="isByd"
/>
</view>
......@@ -132,7 +132,7 @@ export default {
return this.$store.state.user.historyStatus
},
penSwitch () {
return this.type != 'preview' && this.drawStatus
return !this.isPreview && this.drawStatus
},
watchPayInfo () {
return this.$store.state.user.paymentType.length ? true : false
......@@ -152,6 +152,9 @@ export default {
const { channelType } = uni.$storage.get("userInfo")
return channelType == 2
},
isPreview(){
return this.type == 'preview'
}
},
watch: {
......@@ -198,7 +201,7 @@ export default {
this.$refs.pay.show()
},
dbClick () {
if (this.type != 'preview') this.drawStatus = !this.drawStatus
if (!this.isPreview) this.drawStatus = !this.drawStatus
},
touchStart (e) {
if (!this.drawStatus && e.changedTouches?.length) {
......
......@@ -229,7 +229,13 @@ export default {
errorImg (index) {
this.moduleList[index].showAlt = true;
},
async start () {
if (this.recording) return
uni.showLoading({
mask: true
})
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
......@@ -246,8 +252,10 @@ export default {
this.id = this.moduleList[0].id;
this.type = "edit";
this.recording = true;
setTimeout(() => {
uni.hideLoading();
}, 1e3)
},
toDetail (item) {
this.chooseItem = item;
this.$refs.home.previewRef.open();
......
......@@ -3,50 +3,59 @@
* @Author: huyue
* @Date: 2024-04-07 18:15:11
* @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 utils from "@/utils/utils";
import utils from '@/utils/utils'
// const recorderManager = uni.getRecorderManager();
import upload from "@/utils/ossUploadFile/uploadFile.js";
import store from "../index";
import upload from '@/utils/ossUploadFile/uploadFile.js'
import store from '../index'
export default {
namespaced: true,
state() {
return {
booksList: [],
audioList: [],
receptionStatus: 1,
receptionStatus: '',
endReasonType: 0,
perRecordNumber: 0,
audioInfo: {
audioStatus: "",
audioStatus: '',
endReasonType: 0,
receptionStartTime: "",
receptionEndTime: "",
},
};
receptionStartTime: '',
receptionEndTime: ''
}
}
},
mutations: {
setAudioInfo(state, data) {
if (data.audioStatus == "start") {
data.receptionStartTime = utils.convertDateTimeFormat(new Date(), "/");
if (data.audioStatus == 'start') {
data.receptionStartTime = utils.convertDateTimeFormat(new Date(), '/')
data.receptionEndTime = ''
}
if (data.audioStatus == "end") {
data.receptionEndTime = utils.convertDateTimeFormat(new Date(), "/");
if (data.audioStatus == 'end') {
data.receptionEndTime = utils.convertDateTimeFormat(new Date(), '/')
}
state.audioInfo = Object.assign(state.audioInfo, data);
state.audioInfo = Object.assign(state.audioInfo, data)
},
setReceptionStatus(state, data) {
state.receptionStatus = data;
state.receptionStatus = data
},
setAudioList(state, data) {
state.audioList = data;
state.audioList = data
},
setBooks(state, data) {
state.booksList = data;
state.booksList = data
},
setPerRecordNumber(state, data) {
state.perRecordNumber = data
}
},
actions: {
setPerRecordNumber({ commit }, value) {
console.log(value)
commit('setPerRecordNumber', value)
}
// startAudio({ commit, state, dispatch }) {
// if (state.isStart) return;
// commit("setAudioStart", true);
......@@ -115,5 +124,5 @@ export default {
// commit("setReceptionStatus", 0);
// uni.$storage.set("storageFile", "");
// },
},
};
}
}
......@@ -81,7 +81,7 @@ export default {
},
setReceptionTrack ({ state }, { key, value }) {
state.receptionTrack[key] = value
// console.log(JSON.parse(JSON.stringify(state.receptionTrack)))
console.log(JSON.parse(JSON.stringify(state.receptionTrack)))
},
clearReceptionTrack ({ state }) {
state.receptionTrack = {}
......
......@@ -8,10 +8,12 @@
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');
}
@font-face {
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');
}
@keyframes show-view {
0% {
opacity: 0;
......@@ -73,10 +75,29 @@
}
@media screen and (min-width: 500px){
.fixforpc-width{
@media screen and (min-width: 500px) {
.fixforpc-width {
min-width: auto !important;
width: fit-content !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
// export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/'
// 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方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ["sessionId", "merchantId", "userInfo"];
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
// 缓存get方法key的对应才映射值
export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY,
mock_data: "mock_data",
storageFile: "storageFile",
userInfo: "userInfo",
customerInfo: "customerInfo",
noSignInUuid: "noSignInUuid",
noviceGuideStatus: "noviceGuideStatus",
carBrandList: "carBrandList",
employeeList: "employeeList",
recordList: "recordList",
recordSuccessList: "recordSuccessList",
historyList: "historyList",
storageVersion: "storageVersion",
byd_mock_data:'byd_mock_data',
boutique_mock_data:'boutique_mock_data'
};
mock_data: 'mock_data',
storageFile: 'storageFile',
userInfo: 'userInfo',
customerInfo: 'customerInfo',
noSignInUuid: 'noSignInUuid',
noviceGuideStatus: 'noviceGuideStatus',
carBrandList: 'carBrandList',
employeeList: 'employeeList',
recordList: 'recordList',
preRecordList: 'preRecordList',
preRecordId: 'preRecordId',
recordSuccessList: 'recordSuccessList',
historyList: 'historyList',
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'
// console.log(storage)
/** */
......@@ -59,16 +67,16 @@ export function setSystem_info(that) {
})
}
export function getRecords() {
return storage.get(STORAGE_OBJECTkEY.recordList)
export function getRecords(record = 'recordList') {
return storage.get(STORAGE_OBJECTkEY[record])
}
export function setRecords(data) {
storage.set(STORAGE_OBJECTkEY.recordList, data)
export function setRecords(data, record = 'recordList') {
storage.set(STORAGE_OBJECTkEY[record], data)
}
export function removeRecords() {
storage.rm(STORAGE_OBJECTkEY.recordList)
export function removeRecords(record = 'recordList') {
storage.rm(STORAGE_OBJECTkEY[record])
}
export default{
export default {
getSessionId,
setSessionId,
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() {
const rootPath = await getFilePath()
return `file://${rootPath}uniapp_save/`
}
async function getAudioFilePath(path = '') {
const rootPath = await getFilePath()
return `file://${rootPath}${path}`
}
export default {
compareVersions,
convertDateTimeFormat,
......@@ -180,5 +184,6 @@ export default {
isNetWork,
uuid,
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!