Commit 0cb2063a by 李伟康

commit 提交

1 parent f5d58b18
...@@ -16,7 +16,7 @@ module.exports = { ...@@ -16,7 +16,7 @@ module.exports = {
projectName: "boutique", projectName: "boutique",
onlyUsable: true, onlyUsable: true,
...data, ...data,
}); },false,'ip');
}, },
/**查询用户是否领券 */ /**查询用户是否领券 */
findCustomerReceivedStatus (data) { findCustomerReceivedStatus (data) {
...@@ -24,6 +24,8 @@ module.exports = { ...@@ -24,6 +24,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
}); });
}, },
} }
\ No newline at end of file \ No newline at end of file
...@@ -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;
......
...@@ -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;
......
...@@ -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"
...@@ -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>
...@@ -172,25 +172,25 @@ export default { ...@@ -172,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 () {
...@@ -210,10 +210,14 @@ export default { ...@@ -210,10 +210,14 @@ export default {
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({
merchantIdList: [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)
...@@ -244,7 +248,7 @@ export default { ...@@ -244,7 +248,7 @@ export default {
}, },
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) {
...@@ -260,16 +264,13 @@ export default { ...@@ -260,16 +264,13 @@ export default {
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 {
...@@ -282,6 +283,7 @@ export default { ...@@ -282,6 +283,7 @@ export default {
if (data) { if (data) {
this.QRURL = data this.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss")) this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
} }
else throw '生成小程序码失败,请重试!' else throw '生成小程序码失败,请重试!'
} else throw message } else throw message
...@@ -327,8 +329,10 @@ export default { ...@@ -327,8 +329,10 @@ export default {
}, 1e3) }, 1e3)
}, },
closeQr () { closeQr () {
console.log(this.qrTimer)
clearInterval(this.qrTimer) clearInterval(this.qrTimer)
this.qrTimer = null this.qrTimer = null
}, },
resetFocusIndex () { resetFocusIndex () {
this.focusIndex = -1 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'">
...@@ -83,7 +82,6 @@ export default { ...@@ -83,7 +82,6 @@ export default {
}, },
data () { data () {
return { return {
finishVisible: false,
}; };
}, },
computed: { computed: {
...@@ -95,22 +93,21 @@ export default { ...@@ -95,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()
}, },
...@@ -185,21 +182,6 @@ export default { ...@@ -185,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%;
...@@ -208,7 +190,7 @@ export default { ...@@ -208,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) => {
......
...@@ -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!