Commit 61c5fae3 by 前端

Merge branch 'v1.0.5' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.5

2 parents 5eab77b3 0cb2063a
...@@ -9,13 +9,18 @@ module.exports = { ...@@ -9,13 +9,18 @@ module.exports = {
...data, ...data,
}); });
}, },
/** 查当前4s商户下商户券 */ /** 查询可发放礼券-分页查询商户券列表 */
findCouponList(data) { findCouponList(data) {
return http.post({ return http.post(
method: "dj.api.smartCarLife.merchant.coupon.list", {
method: "dj.api.smartcarlife.merchantCoupon.pageForZYApp",
projectName: "boutique", projectName: "boutique",
onlyUsable: true,
...data, ...data,
}); },
false,
"ip"
);
}, },
/**查询用户是否领券 */ /**查询用户是否领券 */
findCustomerReceivedStatus(data) { findCustomerReceivedStatus(data) {
...@@ -23,6 +28,8 @@ module.exports = { ...@@ -23,6 +28,8 @@ module.exports = {
method: "dj.api.smartcarlife.customerCoupon.page", method: "dj.api.smartcarlife.customerCoupon.page",
projectName: "boutique", projectName: "boutique",
...data, ...data,
currentPage: 1,
pageSize: 99999,
}); });
}, },
/**历史成交客户 */ /**历史成交客户 */
......
...@@ -11,7 +11,7 @@ const HOST = { ...@@ -11,7 +11,7 @@ const HOST = {
scrm: domain, scrm: domain,
dj: djDomain, dj: djDomain,
merchant: merchantDomain, merchant: merchantDomain,
ip: 'http://192.168.3.226:9711' ip: 'http://192.168.1.169:8292'
}; };
class Request { class Request {
get (params, returnAll = false, hostType) { get (params, returnAll = false, hostType) {
...@@ -36,10 +36,10 @@ class Request { ...@@ -36,10 +36,10 @@ class Request {
let _this = this let _this = this
uni.getNetworkType({ uni.getNetworkType({
success (res) { success (res) {
if(res.networkType == 'none'){ if (res.networkType == 'none') {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title:'网络异常', title: '网络异常',
icon: "error", icon: "error",
}); });
reject('网络异常'); reject('网络异常');
...@@ -66,9 +66,13 @@ class Request { ...@@ -66,9 +66,13 @@ class Request {
success (response) { success (response) {
/**业务代码 */ /**业务代码 */
let { let {
data: { code, message },
data, data,
} = response; } = response
if (!data) return uni.showToast({
title: "接口异常",
icon: "none",
});
let { code, message } = data
if (returnAll) { if (returnAll) {
resolve(data); resolve(data);
return; return;
......
.sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 1070rpx 876rpx;}
.icon-arrow-right { width: 32rpx; height: 32rpx; background-position: -1032rpx -60rpx;}
.icon-back { width: 128rpx; height: 50rpx; background-position: -942rpx 0rpx;}
.icon-change-account { width: 32rpx; height: 32rpx; background-position: -1032rpx -102rpx;}
.icon-customer-1 { width: 400rpx; height: 400rpx; background-position: 0rpx 0rpx;}
.icon-customer-2 { width: 400rpx; height: 400rpx; background-position: -410rpx 0rpx;}
.icon-face-error-active { width: 96rpx; height: 96rpx; background-position: -820rpx -610rpx;}
.icon-face-error { width: 96rpx; height: 96rpx; background-position: 0rpx -780rpx;}
.icon-face-success-active { width: 96rpx; height: 96rpx; background-position: -106rpx -780rpx;}
.icon-face-success { width: 96rpx; height: 96rpx; background-position: -212rpx -780rpx;}
.icon-feedback { width: 32rpx; height: 32rpx; background-position: -1032rpx -150rpx;}
.icon-first-nav { width: 464rpx; height: 176rpx; background-position: 0rpx -410rpx;}
.icon-home-active { width: 80rpx; height: 80rpx; background-position: -942rpx -60rpx;}
.icon-home { width: 80rpx; height: 80rpx; background-position: -942rpx -150rpx;}
.icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -1032rpx -192rpx;}
.icon-icon-avatar { width: 112rpx; height: 112rpx; background-position: -820rpx 0rpx;}
.icon-icon-female { width: 32rpx; height: 32rpx; background-position: -1032rpx -240rpx;}
.icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -942rpx -420rpx;}
.icon-icon-male { width: 32rpx; height: 32rpx; background-position: -1032rpx -282rpx;}
.icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -1032rpx -330rpx;}
.icon-icon-upload { width: 128rpx; height: 128rpx; background-position: -644rpx -410rpx;}
.icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -1032rpx -372rpx;}
.icon-kf-0 { width: 32rpx; height: 32rpx; background-position: -1016rpx -576rpx;}
.icon-kf-1 { width: 32rpx; height: 32rpx; background-position: -1012rpx -650rpx;}
.icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -1012rpx -720rpx;}
.icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -1012rpx -790rpx;}
.icon-logo { width: 160rpx; height: 160rpx; background-position: -474rpx -410rpx;}
.icon-new-addr { width: 32rpx; height: 32rpx; background-position: -820rpx -716rpx;}
.icon-new-avatar { width: 96rpx; height: 96rpx; background-position: -318rpx -780rpx;}
.icon-new-feedback { width: 64rpx; height: 64rpx; background-position: -942rpx -502rpx;}
.icon-new-home-active { width: 112rpx; height: 112rpx; background-position: -820rpx -122rpx;}
.icon-new-home { width: 112rpx; height: 112rpx; background-position: -820rpx -244rpx;}
.icon-new-record-active { width: 112rpx; height: 112rpx; background-position: -820rpx -366rpx;}
.icon-new-record { width: 112rpx; height: 112rpx; background-position: -820rpx -488rpx;}
.icon-new-setting { width: 64rpx; height: 64rpx; background-position: -942rpx -576rpx;}
.icon-pen-active { width: 120rpx; height: 120rpx; background-position: -490rpx -596rpx;}
.icon-pen { width: 120rpx; height: 120rpx; background-position: -620rpx -596rpx;}
.icon-qw { width: 48rpx; height: 48rpx; background-position: -1016rpx -502rpx;}
.icon-record-active { width: 80rpx; height: 80rpx; background-position: -942rpx -240rpx;}
.icon-record { width: 80rpx; height: 80rpx; background-position: -942rpx -330rpx;}
.icon-scene-0 { width: 96rpx; height: 96rpx; background-position: -424rpx -780rpx;}
.icon-scene-1 { width: 96rpx; height: 96rpx; background-position: -530rpx -780rpx;}
.icon-search { width: 40rpx; height: 40rpx; background-position: -1024rpx -420rpx;}
.icon-second-nav { width: 480rpx; height: 128rpx; background-position: 0rpx -596rpx;}
.icon-setting { width: 32rpx; height: 32rpx; background-position: -862rpx -716rpx;}
.icon-store { width: 96rpx; height: 96rpx; background-position: -636rpx -780rpx;}
.icon-tool-file { width: 60rpx; height: 60rpx; background-position: -942rpx -650rpx;}
.icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -942rpx -720rpx;}
.icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -942rpx -790rpx;}
.icon-aito { width: 320rpx; height: 36rpx; background-position: 0rpx -734rpx;}
.icon-qr-success { width: 96rpx; height: 96rpx; background-position: -742rpx -780rpx;}
\ No newline at end of file \ No newline at end of file
.sprite-icon {
background-image: url(@/assets/images/sprite.png);
background-size: 1070rpx 876rpx;
}
.icon-arrow-right {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -60rpx;
}
.icon-back {
width: 128rpx;
height: 50rpx;
background-position: -942rpx 0rpx;
}
.icon-change-account {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -102rpx;
}
.icon-customer-1 {
width: 400rpx;
height: 400rpx;
background-position: 0rpx 0rpx;
}
.icon-customer-2 {
width: 400rpx;
height: 400rpx;
background-position: -410rpx 0rpx;
}
.icon-face-error-active {
width: 96rpx;
height: 96rpx;
background-position: -820rpx -610rpx;
}
.icon-face-error {
width: 96rpx;
height: 96rpx;
background-position: 0rpx -780rpx;
}
.icon-face-success-active {
width: 96rpx;
height: 96rpx;
background-position: -106rpx -780rpx;
}
.icon-face-success {
width: 96rpx;
height: 96rpx;
background-position: -212rpx -780rpx;
}
.icon-feedback {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -150rpx;
}
.icon-first-nav {
width: 464rpx;
height: 176rpx;
background-position: 0rpx -410rpx;
}
.icon-home-active {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -60rpx;
}
.icon-home {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -150rpx;
}
.icon-icon-addr {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -192rpx;
}
.icon-icon-avatar {
width: 112rpx;
height: 112rpx;
background-position: -820rpx 0rpx;
}
.icon-icon-female {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -240rpx;
}
.icon-icon-handshake {
width: 72rpx;
height: 72rpx;
background-position: -942rpx -420rpx;
}
.icon-icon-male {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -282rpx;
}
.icon-icon-shop {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -330rpx;
}
.icon-icon-upload {
width: 128rpx;
height: 128rpx;
background-position: -644rpx -410rpx;
}
.icon-icon-weixin {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -372rpx;
}
.icon-kf-0 {
width: 32rpx;
height: 32rpx;
background-position: -1016rpx -576rpx;
}
.icon-kf-1 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -650rpx;
}
.icon-kf-2 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -720rpx;
}
.icon-kf-3 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -790rpx;
}
.icon-logo {
width: 160rpx;
height: 160rpx;
background-position: -474rpx -410rpx;
}
.icon-new-addr {
width: 32rpx;
height: 32rpx;
background-position: -820rpx -716rpx;
}
.icon-new-avatar {
width: 96rpx;
height: 96rpx;
background-position: -318rpx -780rpx;
}
.icon-new-feedback {
width: 64rpx;
height: 64rpx;
background-position: -942rpx -502rpx;
}
.icon-new-home-active {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -122rpx;
}
.icon-new-home {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -244rpx;
}
.icon-new-record-active {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -366rpx;
}
.icon-new-record {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -488rpx;
}
.icon-new-setting {
width: 64rpx;
height: 64rpx;
background-position: -942rpx -576rpx;
}
.icon-pen-active {
width: 120rpx;
height: 120rpx;
background-position: -490rpx -596rpx;
}
.icon-pen {
width: 120rpx;
height: 120rpx;
background-position: -620rpx -596rpx;
}
.icon-qw {
width: 48rpx;
height: 48rpx;
background-position: -1016rpx -502rpx;
}
.icon-record-active {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -240rpx;
}
.icon-record {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -330rpx;
}
.icon-scene-0 {
width: 96rpx;
height: 96rpx;
background-position: -424rpx -780rpx;
}
.icon-scene-1 {
width: 96rpx;
height: 96rpx;
background-position: -530rpx -780rpx;
}
.icon-search {
width: 40rpx;
height: 40rpx;
background-position: -1024rpx -420rpx;
}
.icon-second-nav {
width: 480rpx;
height: 128rpx;
background-position: 0rpx -596rpx;
}
.icon-setting {
width: 32rpx;
height: 32rpx;
background-position: -862rpx -716rpx;
}
.icon-store {
width: 96rpx;
height: 96rpx;
background-position: -636rpx -780rpx;
}
.icon-tool-file {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -650rpx;
}
.icon-tool-finish {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -720rpx;
}
.icon-tool-pay {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -790rpx;
}
.icon-customer-1 {
width: 400rpx;
height: 400rpx;
background-position: 0rpx 0rpx;
}
.icon-customer-2 {
width: 400rpx;
height: 400rpx;
background-position: -410rpx 0rpx;
}
.icon-aito {
width: 320rpx;
height: 36rpx;
background-position: 0rpx -734rpx;
}
.icon-qr-success {
width: 96rpx;
height: 96rpx;
background-position: -742rpx -780rpx;
}
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view <view
class="pop-tips" class="pop-tips"
v-else v-else
>检测到“{{sceneType == 0 ? '交车通知书':'精品加装服务说明页'}}”中未填写客户档案,请填写后再完成接待。</view> >{{tips}}</view>
</template> </template>
<view class="form"> <view class="form">
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
:key="index" :key="index"
> >
<view class="label">{{ i.label }}</view> <view class="label">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) }]"> <view :class="['value', { error: showError(i.key) },{disabled:customerType == 0}]">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<input <input
:type="i.inputType" :type="i.inputType"
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
v-model="formData[i.key]" v-model="formData[i.key]"
class="input" class="input"
:placeholder="i.placeholder" :placeholder="i.placeholder"
placeholder-class="placeholder" :disabled="customerType == 0"
/> />
</template> </template>
<template v-else> <template v-else>
...@@ -102,6 +102,36 @@ import Employee from '@/components/Employee.vue' ...@@ -102,6 +102,36 @@ import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
const phoneRex = /^[1]([3-9])[0-9]{9}$/; const phoneRex = /^[1]([3-9])[0-9]{9}$/;
const formObject_boutique = [{
label: "车主姓名",
key: "customerName",
type: "input",
inputType: "text",
maxlength: 50,
placeholder: '请输入姓名'
},
{
label: "车型",
key: "carModel",
type: "select",
popKey: "carBrandListVisible",
placeholder: '请选择车型'
},
{
label: "车主电话",
key: "phoneNumber",
type: "input",
inputType: "tel",
maxlength: 11,
placeholder: '请输入电话'
},
{
label: "交付专员",
key: "staffName",
type: "select",
popKey: "employeeBoxVisible",
placeholder: '请选择交付专员'
},]
export default { export default {
components: { Employee, CarBrands }, components: { Employee, CarBrands },
name: 'FinishStep', name: 'FinishStep',
...@@ -109,6 +139,10 @@ export default { ...@@ -109,6 +139,10 @@ export default {
sceneType: { sceneType: {
type: Number, type: Number,
default: 0 default: 0
},
customerType: {
type: Number,
default: 1
} }
}, },
data () { data () {
...@@ -174,6 +208,12 @@ export default { ...@@ -174,6 +208,12 @@ export default {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
tips () {
let { sceneType } = this,
text = '检测到“交车通知书”中未填写客户档案,请填写后再完成接待。'
if (sceneType == 1) text = '请确认“精品加装服务说明页”中的客户信息,并点击完成接待结束客户接待。'
return text
}
}, },
watch: { watch: {
watchStatus: { watchStatus: {
...@@ -196,6 +236,8 @@ export default { ...@@ -196,6 +236,8 @@ export default {
return this.errorTip && flag return this.errorTip && flag
}, },
showPopup (e) { showPopup (e) {
let {customerType} = this
if(customerType == 0) return
this.$refs[e].open(); this.$refs[e].open();
}, },
// 取消 // 取消
...@@ -257,16 +299,26 @@ export default { ...@@ -257,16 +299,26 @@ export default {
}, },
open () { open () {
this.$store.dispatch('getCustomerInfo').then((customerInfo) => { this.$store.dispatch('getCustomerInfo').then((customerInfo) => {
let { sceneType } = this
this.errorTip = false
this.receptionStatus = sceneType == 0 ? -1 : 1 //精品默认1
this.formData = customerInfo this.formData = customerInfo
let step = sceneType == 0 ? Object.values(customerInfo).every((value) => !!value) ? 2 : 1 : 1 let { sceneType, customerType } = this,
receptionStatus = -1,
step = Object.values(customerInfo).every((value) => !!value) ? 2 : 1
this.errorTip = false
if (sceneType == 1) {
if (customerType == 0 && !this.check()) return uni.showToast({
title: '请选择回店客户',
icon: 'none'
})
receptionStatus = 1 //精品默认1
step = 1
this.formObject = formObject_boutique
}
if (step == 2 && !this.check()) { if (step == 2 && !this.check()) {
this.errorTip = true this.errorTip = true
step = 1 step = 1
} }
this.step = step this.step = step
this.receptionStatus = receptionStatus
this.$refs.formRef.open() this.$refs.formRef.open()
}) })
}, },
...@@ -341,6 +393,10 @@ export default { ...@@ -341,6 +393,10 @@ export default {
border: none !important; border: none !important;
outline: none; outline: none;
padding: 0 !important; padding: 0 !important;
font-size: 30rpx;
&::placeholder {
color: #c9c9c9;
}
} }
.select { .select {
display: flex; display: flex;
...@@ -354,6 +410,9 @@ export default { ...@@ -354,6 +410,9 @@ export default {
color: #c9c9c9; color: #c9c9c9;
} }
} }
.disabled{
background: #f4f4f4;
}
} }
} }
.choose-box { .choose-box {
......
...@@ -225,15 +225,6 @@ export default { ...@@ -225,15 +225,6 @@ export default {
return this.$refs.finish return this.$refs.finish
} }
}, },
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
return true;
}
// 其他情况允许正常返回
return false;
},
methods: { methods: {
changeIndex (index) { changeIndex (index) {
this.tabIndex = index; this.tabIndex = index;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
@input="inputCustomer" @input="inputCustomer"
:placeholder="i.placeholder" :placeholder="i.placeholder"
@focus="focusIndex = index" @focus="focusIndex = index"
@blur="focusIndex = -1" @blur="resetFocusIndex"
/> />
</template> </template>
<template v-else> <template v-else>
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
<view :class="['form-item' ,{active:focusIndex == 4}]"> <view :class="['form-item' ,{active:focusIndex == 4}]">
<view class="form-item-box"> <view class="form-item-box">
<view <view
:class="['select flex',{placeholderStyle:!couponName}]" :class="['select flex',{placeholderStyle:!couponTypeName}]"
@click="showPopup('couponBoxVisible', 4)" @click="showPopup('couponBoxVisible', 4)"
> >
<view class="value text-hide">{{couponName|| '请选择礼券类型'}}</view> <view class="value text-hide">{{couponTypeName|| '请选择礼券类型'}}</view>
<uni-icons <uni-icons
class="arrow" class="arrow"
type="right" type="right"
...@@ -88,13 +88,13 @@ ...@@ -88,13 +88,13 @@
<car-brands <car-brands
ref="carBrandListVisible" ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')" @select="handleSelect($event,'carBrandListVisible')"
@close="focusIndex = -1" @close="resetFocusIndex"
/> />
<employee <employee
ref="employeeBoxVisible" ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')" @select="handleSelect($event,'employeeBoxVisible')"
title="交付人员" title="交付人员"
@close="focusIndex = -1" @close="resetFocusIndex"
/> />
<MessageBox <MessageBox
ref="couponBoxVisible" ref="couponBoxVisible"
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
:isFooter="false" :isFooter="false"
title="请选择礼券类型" title="请选择礼券类型"
:maxHeight="1000" :maxHeight="1000"
@close="focusIndex = -1" @close="resetFocusIndex"
> >
<view class="select-box"> <view class="select-box">
<view <view
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
v-for="(item, index) in couponList" v-for="(item, index) in couponList"
:key="index" :key="index"
> >
{{ item.couponName }} {{ item.couponTypeName }}
</view> </view>
</view> </view>
</MessageBox> </MessageBox>
...@@ -129,6 +129,8 @@ ...@@ -129,6 +129,8 @@
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import QrBox from './QrBox.vue' import QrBox from './QrBox.vue'
import dayjs from 'dayjs'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
export default { export default {
name: 'Reception', name: 'Reception',
components: { Employee, CarBrands, QrBox }, components: { Employee, CarBrands, QrBox },
...@@ -170,25 +172,25 @@ export default { ...@@ -170,25 +172,25 @@ export default {
], ],
customerInfo: {}, customerInfo: {},
couponList: [], couponList: [],
couponName: '', couponTypeName: '',
focusIndex: -1, focusIndex: -1,
couponId: '', couponId: '',
carInfo: {}, carInfo: {},
QRURL: 'https://qcimg01.glsx.com.cn/group1/M00/06/B9/wKgD3mZcKDeAXECgAADCGbjApJQ653.png', QRURL: '',
received: false, received: false,
qrTimer: null qrTimer: null
} }
}, },
mounted () {
if (this.show) this.init()
},
watch: { watch: {
watchCustomerInfo: { watchCustomerInfo: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (newval) this.customerInfo = newval if (newval && this.show) this.customerInfo = newval
} }
}, },
show (n) {
if (n && this.customerType == 1) this.init()
}
}, },
computed: { computed: {
watchCustomerInfo () { watchCustomerInfo () {
...@@ -202,16 +204,20 @@ export default { ...@@ -202,16 +204,20 @@ export default {
methods: { methods: {
init () { init () {
this.qrTimer = null this.qrTimer = null
this.focusIndex = -1 this.resetFocusIndex()
this.findCouponList() this.findCouponList()
}, },
async findCouponList () { async findCouponList () {
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo, { shopMerchantId } = userInfo,
couponList = await uni.$api.boutiqueApi.findCouponList({ { list } = await uni.$api.boutiqueApi.findCouponList({
merchantId: shopMerchantId merchantIdList: [shopMerchantId]
}) })
this.couponList = couponList || [] if (list && list.length) {
let item = list.find(e => e.couponType == 1)
if (item && !this.couponId) this.chooseCoupon(item)
}
this.couponList = list || []
}, },
inputCustomer () { inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
...@@ -226,7 +232,7 @@ export default { ...@@ -226,7 +232,7 @@ export default {
this.customerInfo.carModel = item.name this.customerInfo.carModel = item.name
this.carInfo = item this.carInfo = item
} }
this.focusIndex = -1 this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
}, },
showPopup (e, index) { showPopup (e, index) {
...@@ -237,10 +243,12 @@ export default { ...@@ -237,10 +243,12 @@ export default {
this.$refs.carBrandListVisible.close() this.$refs.carBrandListVisible.close()
this.$refs.employeeBoxVisible.close() this.$refs.employeeBoxVisible.close()
this.$refs.couponBoxVisible.close() this.$refs.couponBoxVisible.close()
this.resetFocusIndex()
this.closeQr()
}, },
chooseCoupon (item) { chooseCoupon (item) {
this.couponId = item.id this.couponId = item.id
this.couponName = item.couponName this.couponTypeName = item.couponTypeName
this.$refs.couponBoxVisible.close() this.$refs.couponBoxVisible.close()
}, },
jumpPage (e) { jumpPage (e) {
...@@ -249,27 +257,20 @@ export default { ...@@ -249,27 +257,20 @@ export default {
async createCoupon () { async createCoupon () {
try { try {
const { couponId, customerInfo, carInfo } = this const { couponId, customerInfo, carInfo } = this
if (!customerInfo.customerName) throw '请输入车主姓名' await this.validate()
if (!customerInfo.phoneNumber) throw '请输入车主手机'
if (!customerInfo.carModel) throw '请选择车型'
if (!customerInfo.staffName) throw '请选择交付专员'
if (!couponId) throw '请选择礼券类型'
uni.showLoading() uni.showLoading()
const { const {
uuid, uuid,
name, name,
shopMerchantId shopMerchantId
} = uni.$storage.get("userInfo") } = uni.$storage.get("userInfo")
let scene = `id=${couponId}&userId=${uuid}&employName=${name}&merchantId=${shopMerchantId} let scene = `id=${couponId}&userId=${uuid}&employName=${name}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
params = { params = {
path: '/packageShopmall/packageMine/pages/boutique/gift/gift', path: '/packageShopmall/packageMine/pages/boutique/gift/gift',
appId: 'wxe10067a63c1856ac', appId: 'wxe10067a63c1856ac',
} }
if (carInfo.name) { if (carInfo.name) {
scene += `&carChildsBrandId=${carInfo.carChildsBrandId}&carChildsBrandName=${carInfo.carChildsBrandName} scene += `&carChildsBrandId=${carInfo.carChildsBrandId}&carChildsBrandName=${carInfo.carChildsBrandName}&carBrandId=${carInfo.carBrandId}&carBrand=${carInfo.carBrand}&carSeriesId=${carInfo.id}&carSeriesName=${carInfo.name}`
&carBrandId=${carInfo.carBrandId}&carBrand=${carInfo.carBrand}
&carSeriesId=${carInfo.id}&carSeriesName=${carInfo.name}`
} }
params.scene = scene params.scene = scene
let { let {
...@@ -281,7 +282,8 @@ export default { ...@@ -281,7 +282,8 @@ export default {
if (code == 0) { if (code == 0) {
if (data) { if (data) {
this.QRURL = data this.QRURL = data
this.checkCustomerReceivedStatus() this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
} }
else throw '生成小程序码失败,请重试!' else throw '生成小程序码失败,请重试!'
} else throw message } else throw message
...@@ -294,10 +296,30 @@ export default { ...@@ -294,10 +296,30 @@ export default {
}) })
} }
}, },
checkCustomerReceivedStatus () { async validate () {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this
// 检查车主姓名
if (!customerName) throw '请输入车主姓名'
// 检查车主手机
if (!phoneNumber) throw '请输入车主手机'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
// 检查车型
if (!carModel) throw '请选择车型'
// 检查交付专员
if (!staffName) throw '请选择交付专员'
// 检查礼券类型
if (!couponId) throw '请选择礼券类型'
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
this.qrTimer = setInterval(async () => { this.qrTimer = setInterval(async () => {
// const res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({}) const { couponId, customerInfo } = this,
if (true) { res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res.total) {
this.received = true this.received = true
this.closeQr() this.closeQr()
setTimeout(() => { setTimeout(() => {
...@@ -307,8 +329,13 @@ export default { ...@@ -307,8 +329,13 @@ export default {
}, 1e3) }, 1e3)
}, },
closeQr () { closeQr () {
console.log(this.qrTimer)
clearInterval(this.qrTimer) clearInterval(this.qrTimer)
this.qrTimer = null this.qrTimer = null
},
resetFocusIndex () {
this.focusIndex = -1
} }
} }
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
:key="index" :key="index"
> >
<component <component
:is="componentName" :is="componentName(item.id)"
:views="item.receptionSourceDetailList || []" :views="item.receptionSourceDetailList || []"
:ref="'media'+item.id" :ref="'media'+item.id"
:title="item.detailTitle || ''" :title="item.detailTitle || ''"
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
@jumpPage="jumpPage" @jumpPage="jumpPage"
:show="id == item.id" :show="id == item.id"
/> />
<!-- <membranes :id="id"></membranes> -->
</view> </view>
</template> </template>
<template v-if="type != 'preview'"> <template v-if="type != 'preview'">
...@@ -51,6 +50,7 @@ ...@@ -51,6 +50,7 @@
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
:sceneType="1" :sceneType="1"
:customerType="customerType"
/> />
</view> </view>
</template> </template>
...@@ -82,7 +82,6 @@ export default { ...@@ -82,7 +82,6 @@ export default {
}, },
data () { data () {
return { return {
finishVisible: false,
}; };
}, },
computed: { computed: {
...@@ -94,22 +93,21 @@ export default { ...@@ -94,22 +93,21 @@ export default {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
componentName () { },
let { id } = this, mounted () {
name = ''
},
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
componentName (id) {
let name = ''
if ([8, 10, 11].includes(id)) name = 'membranes' if ([8, 10, 11].includes(id)) name = 'membranes'
else name = { else name = {
7: 'reception', 7: 'reception',
13: 'invitation' 13: 'invitation'
}[id] }[id]
return name return name
}
},
mounted () {
}, },
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
open () { open () {
this.$refs.stepRef.open() this.$refs.stepRef.open()
}, },
...@@ -184,21 +182,6 @@ export default { ...@@ -184,21 +182,6 @@ export default {
// display: block; // display: block;
animation: show-content-left 0.15s forwards; animation: show-content-left 0.15s forwards;
} }
.pen-box {
position: fixed;
right: 40rpx;
top: 5%;
width: 120rpx;
height: 120rpx;
z-index: 10;
box-shadow: 0 4px 12px 0 #00000033;
border-radius: 16rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
@keyframes show-content-left { @keyframes show-content-left {
0% { 0% {
left: 100%; left: 100%;
...@@ -207,7 +190,7 @@ export default { ...@@ -207,7 +190,7 @@ export default {
left: 0; left: 0;
} }
} }
.tool-box{ .tool-box {
top: 5%; top: 5%;
} }
</style> </style>
...@@ -65,8 +65,7 @@ export default { ...@@ -65,8 +65,7 @@ export default {
name: 'boutique', name: 'boutique',
data () { data () {
return { return {
moduleList: [ moduleList: [],
],
moduleKey: Date.now(), moduleKey: Date.now(),
chooseItem: {}, chooseItem: {},
id: '', id: '',
...@@ -74,6 +73,16 @@ export default { ...@@ -74,6 +73,16 @@ export default {
customerType: 1 customerType: 1
} }
}, },
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back();
return true;
}
// 其他情况允许正常返回
return false;
},
mounted () { mounted () {
this.init() this.init()
this.moduleList.map((e, index) => { this.moduleList.map((e, index) => {
...@@ -189,7 +198,7 @@ export default { ...@@ -189,7 +198,7 @@ export default {
chooseCustomerType (index) { chooseCustomerType (index) {
const { moduleList } = this const { moduleList } = this
this.customerType = index this.customerType = index
if (index == 0) this.jumpPage(moduleList.at(-1).id) if (index == 0) this.jumpPage(moduleList.at(-1).id) //跳转处理
else this.jumpPage() else this.jumpPage()
}, },
done (e) { done (e) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-05-30 14:40:39 * @Date: 2024-05-30 14:40:39
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-05-31 18:06:10 * @LastEditTime: 2024-06-03 14:49:06
--> -->
<template> <template>
<view style="position: relative;"> <view style="position: relative;">
...@@ -19,22 +19,22 @@ ...@@ -19,22 +19,22 @@
<view class="first-tab"> <view class="first-tab">
<view <view
class="tab-item" class="tab-item"
v-for="(i, index) in firstNav" v-for="(i, index) in views"
:key="index" :key="index"
@click="changeIndex(index, 'firstIndex')" @click="changeIndex(index, 'firstIndex')"
> >
<view <view
class="sprite-icon" class="sprite-icon"
:class="[firstIndex == index ? `icon-${i.class} active` : '']" :class="[firstIndex == index ? `icon-${firstClass[index]} active` : '']"
:style="{ left: i.left }" :style="{ left: firstLeft[index] }"
></view> ></view>
{{ i.name }} <view class="text" :class="[firstIndex == index ? `active` : '']">{{ i.tabName }}</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content" id="content">
<view class="second-tab"> <view class="second-tab" ref="secondTab" v-if="views[firstIndex].receptionSourceDetailInfoList">
<view <view
v-for="(item, ind) in secondNav" v-for="(item, ind) in views[firstIndex].receptionSourceDetailInfoList"
:key="ind" :key="ind"
class="tab-item" class="tab-item"
@click="changeIndex(ind, 'secondIndex')" @click="changeIndex(ind, 'secondIndex')"
...@@ -42,11 +42,12 @@ ...@@ -42,11 +42,12 @@
<view <view
class="text" class="text"
:class="[secondIndex == ind ? 'active' : '']" :class="[secondIndex == ind ? 'active' : '']"
>{{ item }}</view >{{ item.tabName }}</view
> >
</view> </view>
</view> </view>
<view class="product-list"> <template v-if="views[firstIndex].receptionSourceDetailInfoList && views[firstIndex].receptionSourceDetailInfoList[secondIndex].receptionSourceDetailInfoList">
<view class="product-list" :style="{height: views[firstIndex].receptionSourceDetailInfoList ? '908rpx' : '1040rpx'}">
<view class="product-item"> <view class="product-item">
<image <image
:src="require('@/assets/images/boutique/product.png')" :src="require('@/assets/images/boutique/product.png')"
...@@ -88,6 +89,16 @@ ...@@ -88,6 +89,16 @@
<view class="product-name">AITO问界 3M车窗膜(M5)</view> <view class="product-name">AITO问界 3M车窗膜(M5)</view>
</view> </view>
</view> </view>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/boutique/nothing.png"
/>
<view>暂无产品内容</view>
</view>
</template>
</view> </view>
</view> </view>
</view> </view>
...@@ -103,29 +114,22 @@ ...@@ -103,29 +114,22 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
export default { export default {
name: 'Membranes', name: 'Membranes',
props: {
views: {
type: Array,
default: () => []
},
madiaId: {
type: Number,
default: 0
}
},
data () { data () {
return { return {
firstIndex: 0, firstIndex: 0,
firstNav: [ firstLeft: ['0rpx', '352rpx', '756rpx'],
{ firstClass: ['first-nav', 'second-nav', 'second-nav'],
name: '问界M5',
left: '0rpx',
class: 'first-nav'
},
{
name: '问界M7',
left: '352rpx',
class: 'second-nav'
},
{
name: '问界M9',
left: '756rpx',
class: 'second-nav'
}
],
secondIndex: 0, secondIndex: 0,
secondNav: ['车窗膜', '改色膜', '车衣', '天窗冰甲'],
// animationList: ['m5', 'm7', 'm9']
animationList: [require('@/assets/images/boutique/animation-m5.png'), require('@/assets/images/boutique/animation-m7.png'), require('@/assets/images/boutique/animation-m9.png')] animationList: [require('@/assets/images/boutique/animation-m5.png'), require('@/assets/images/boutique/animation-m7.png'), require('@/assets/images/boutique/animation-m9.png')]
} }
}, },
...@@ -139,21 +143,19 @@ export default { ...@@ -139,21 +143,19 @@ export default {
this.firstIndex = 0 this.firstIndex = 0
} }
}, },
mounted () {
},
methods: { methods: {
changeIndex (index, name) { changeIndex(index, name) {
console.log(index, name)
this[name] = index this[name] = index
if (name === 'fristIndex') {
this.secondIndex = 0
}
}, },
async findSoureList () { async findSoureList () {
console.log(1111) console.log(1111)
const data = await uni.$api.boutiqueApi.findSoureList({}) const data = await uni.$api.boutiqueApi.findSoureList({})
console.log(data) console.log(data)
}, },
back () {
console.log('back')
}
} }
} }
</script> </script>
...@@ -219,10 +221,29 @@ export default { ...@@ -219,10 +221,29 @@ export default {
font-weight: 500; font-weight: 500;
font-size: 40rpx; font-size: 40rpx;
color: #1f2133; color: #1f2133;
.text {
position: relative;
text-align: center;
width: 400rpx;
}
.active { .active {
position: absolute; position: absolute;
top: 0; top: 0;
z-index: -1; 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;
}
} }
} }
} }
...@@ -233,6 +254,7 @@ export default { ...@@ -233,6 +254,7 @@ export default {
padding: 64rpx 0; padding: 64rpx 0;
margin-top: -48rpx; margin-top: -48rpx;
border-radius: 48rpx; border-radius: 48rpx;
height: calc(100% - 128rpx);
.second-tab { .second-tab {
display: inline-flex; display: inline-flex;
background: #f2f2f2; background: #f2f2f2;
...@@ -240,6 +262,7 @@ export default { ...@@ -240,6 +262,7 @@ export default {
height: 84rpx; height: 84rpx;
align-items: center; align-items: center;
margin-left: 64rpx; margin-left: 64rpx;
margin-bottom: 48rpx;
.tab-item { .tab-item {
display: inline-block; display: inline-block;
height: 100%; height: 100%;
...@@ -263,10 +286,8 @@ export default { ...@@ -263,10 +286,8 @@ export default {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 48rpx; gap: 48rpx;
margin-top: 48rpx; // height: 908rpx;
height: 908rpx;
padding: 0 64rpx; padding: 0 64rpx;
// height: 998rpx;
overflow-y: auto; overflow-y: auto;
.product-item { .product-item {
text-align: center; text-align: center;
...@@ -284,6 +305,19 @@ export default { ...@@ -284,6 +305,19 @@ export default {
} }
} }
} }
.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 { @keyframes moveAndFade {
0% { 0% {
transform: translate(100%, -100%) scale(0.2); /* 移动到右上角并缩小 */ transform: translate(100%, -100%) scale(0.2); /* 移动到右上角并缩小 */
...@@ -302,5 +336,7 @@ export default { ...@@ -302,5 +336,7 @@ export default {
position: absolute; /* 确保图片可以移动 */ position: absolute; /* 确保图片可以移动 */
top: 0; top: 0;
right: 0; right: 0;
width: 600rpx;
height: 400rpx;
} }
</style> </style>
...@@ -99,7 +99,6 @@ export default { ...@@ -99,7 +99,6 @@ export default {
data () { data () {
return { return {
drawStatus: false, drawStatus: false,
finishVisible: false,
showPayBtn: false showPayBtn: false
}; };
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!