Commit 0cb2063a by 李伟康

commit 提交

1 parent f5d58b18
......@@ -16,7 +16,7 @@ module.exports = {
projectName: "boutique",
onlyUsable: true,
...data,
});
},false,'ip');
},
/**查询用户是否领券 */
findCustomerReceivedStatus (data) {
......@@ -24,6 +24,8 @@ module.exports = {
method: 'dj.api.smartcarlife.customerCoupon.page',
projectName: "boutique",
...data,
currentPage: 1,
pageSize: 99999
});
},
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ const HOST = {
scrm: domain,
dj: djDomain,
merchant: merchantDomain,
ip: 'http://192.168.3.226:9711'
ip: 'http://192.168.1.169:8292'
};
class Request {
get (params, returnAll = false, hostType) {
......@@ -36,13 +36,13 @@ class Request {
let _this = this
uni.getNetworkType({
success (res) {
if(res.networkType == 'none'){
if (res.networkType == 'none') {
uni.hideLoading();
uni.showToast({
title:'网络异常',
icon: "error",
});
reject('网络异常');
uni.showToast({
title: '网络异常',
icon: "error",
});
reject('网络异常');
return
}
let header = RequestMethods === "POST"
......@@ -66,9 +66,13 @@ class Request {
success (response) {
/**业务代码 */
let {
data: { code, message },
data,
} = response;
} = response
if (!data) return uni.showToast({
title: "接口异常",
icon: "none",
});
let { code, message } = data
if (returnAll) {
resolve(data);
return;
......
......@@ -225,15 +225,6 @@ export default {
return this.$refs.finish
}
},
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
return true;
}
// 其他情况允许正常返回
return false;
},
methods: {
changeIndex (index) {
this.tabIndex = index;
......
......@@ -47,10 +47,10 @@
<view :class="['form-item' ,{active:focusIndex == 4}]">
<view class="form-item-box">
<view
:class="['select flex',{placeholderStyle:!couponName}]"
:class="['select flex',{placeholderStyle:!couponTypeName}]"
@click="showPopup('couponBoxVisible', 4)"
>
<view class="value text-hide">{{couponName|| '请选择礼券类型'}}</view>
<view class="value text-hide">{{couponTypeName|| '请选择礼券类型'}}</view>
<uni-icons
class="arrow"
type="right"
......@@ -112,7 +112,7 @@
v-for="(item, index) in couponList"
:key="index"
>
{{ item.couponName }}
{{ item.couponTypeName }}
</view>
</view>
</MessageBox>
......@@ -172,25 +172,25 @@ export default {
],
customerInfo: {},
couponList: [],
couponName: '',
couponTypeName: '',
focusIndex: -1,
couponId: '',
carInfo: {},
QRURL: 'https://qcimg01.glsx.com.cn/group1/M00/06/B9/wKgD3mZcKDeAXECgAADCGbjApJQ653.png',
QRURL: '',
received: false,
qrTimer: null
}
},
mounted () {
if (this.show) this.init()
},
watch: {
watchCustomerInfo: {
immediate: true,
handler (newval) {
if (newval) this.customerInfo = newval
if (newval && this.show) this.customerInfo = newval
}
},
show (n) {
if (n && this.customerType == 1) this.init()
}
},
computed: {
watchCustomerInfo () {
......@@ -210,10 +210,14 @@ export default {
async findCouponList () {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo,
couponList = await uni.$api.boutiqueApi.findCouponList({
{ list } = await uni.$api.boutiqueApi.findCouponList({
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 () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
......@@ -244,7 +248,7 @@ export default {
},
chooseCoupon (item) {
this.couponId = item.id
this.couponName = item.couponName
this.couponTypeName = item.couponTypeName
this.$refs.couponBoxVisible.close()
},
jumpPage (e) {
......@@ -260,16 +264,13 @@ export default {
name,
shopMerchantId
} = uni.$storage.get("userInfo")
let scene = `id=${couponId}&userId=${uuid}&employName=${name}&merchantId=${shopMerchantId}
&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
let scene = `id=${couponId}&userId=${uuid}&employName=${name}&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}`
scene += `&carChildsBrandId=${carInfo.carChildsBrandId}&carChildsBrandName=${carInfo.carChildsBrandName}&carBrandId=${carInfo.carBrandId}&carBrand=${carInfo.carBrand}&carSeriesId=${carInfo.id}&carSeriesName=${carInfo.name}`
}
params.scene = scene
let {
......@@ -282,6 +283,7 @@ export default {
if (data) {
this.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
}
else throw '生成小程序码失败,请重试!'
} else throw message
......@@ -327,8 +329,10 @@ export default {
}, 1e3)
},
closeQr () {
console.log(this.qrTimer)
clearInterval(this.qrTimer)
this.qrTimer = null
},
resetFocusIndex () {
this.focusIndex = -1
......
......@@ -25,7 +25,7 @@
:key="index"
>
<component
:is="componentName"
:is="componentName(item.id)"
:views="item.receptionSourceDetailList || []"
:ref="'media'+item.id"
:title="item.detailTitle || ''"
......@@ -34,7 +34,6 @@
@jumpPage="jumpPage"
:show="id == item.id"
/>
<!-- <membranes :id="id"></membranes> -->
</view>
</template>
<template v-if="type != 'preview'">
......@@ -83,7 +82,6 @@ export default {
},
data () {
return {
finishVisible: false,
};
},
computed: {
......@@ -95,22 +93,21 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
componentName () {
let { id } = this,
name = ''
if ([8, 10, 11].includes(id)) name = 'membranes'
else name = {
7: 'reception',
13: 'invitation'
}[id]
return name
}
},
mounted () {
},
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
componentName (id) {
let name = ''
if ([8, 10, 11].includes(id)) name = 'membranes'
else name = {
7: 'reception',
13: 'invitation'
}[id]
return name
},
open () {
this.$refs.stepRef.open()
},
......@@ -185,21 +182,6 @@ export default {
// display: block;
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 {
0% {
left: 100%;
......@@ -208,7 +190,7 @@ export default {
left: 0;
}
}
.tool-box{
.tool-box {
top: 5%;
}
</style>
......@@ -65,8 +65,7 @@ export default {
name: 'boutique',
data () {
return {
moduleList: [
],
moduleList: [],
moduleKey: Date.now(),
chooseItem: {},
id: '',
......@@ -74,6 +73,16 @@ export default {
customerType: 1
}
},
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back();
return true;
}
// 其他情况允许正常返回
return false;
},
mounted () {
this.init()
this.moduleList.map((e, index) => {
......
......@@ -99,7 +99,6 @@ export default {
data () {
return {
drawStatus: false,
finishVisible: false,
showPayBtn: false
};
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!