Commit 5bc1b82c by 张立顺

fix 弹框滚动问题

1 parent e830f140
Showing 28 changed files with 124 additions and 39 deletions
...@@ -360,6 +360,10 @@ Component({ ...@@ -360,6 +360,10 @@ Component({
chooseItem, chooseItem,
}); });
}, },
/** 取消时通知父页面关闭弹框 */
onPopupCancel() {
this.triggerEvent('cancel')
},
confirm() { confirm() {
let { chooseItem, equityFlag } = this.data; let { chooseItem, equityFlag } = this.data;
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
title="选择车型" title="选择车型"
show="{{show}}" show="{{show}}"
bindconfirm="confirm" bindconfirm="confirm"
bindcancel="onPopupCancel"
height="{{ equityFlag ? '85%' : '90%' }}"> height="{{ equityFlag ? '85%' : '90%' }}">
<view class="car-brands-box"> <view class="car-brands-box">
<search-input bindsearch="searchCar" /> <search-input bindsearch="searchCar" />
......
...@@ -193,6 +193,11 @@ Component({ ...@@ -193,6 +193,11 @@ Component({
}) })
}, },
/** 取消时通知父页面关闭,便于 page-meta 解锁 */
onPopupCancel() {
this.triggerEvent('cancel')
},
confirm() { confirm() {
const { orderInfo, customerList } = this.data const { orderInfo, customerList } = this.data
const flag = customerList.some((item) => item.active) const flag = customerList.some((item) => item.active)
...@@ -201,7 +206,6 @@ Component({ ...@@ -201,7 +206,6 @@ Component({
} }
this.triggerEvent('confirm', orderInfo) this.triggerEvent('confirm', orderInfo)
this.setData({ show: false })
} }
} }
}) })
<popup title="选择客户" show="{{show}}" bindconfirm="confirm" height="90%"> <popup title="选择客户" show="{{show}}" bindconfirm="confirm" bindcancel="onPopupCancel" height="90%">
<view class="car-brands-box"> <view class="car-brands-box">
<search-input bindsearch="searchCar" /> <search-input bindsearch="searchCar" />
<view class="car-brands" catchtouchmove="noScroll"> <view class="car-brands" catchtouchmove="noScroll">
......
...@@ -606,10 +606,10 @@ Component({ ...@@ -606,10 +606,10 @@ Component({
goodsList: arr goodsList: arr
}) })
}, },
/** 取消时通知父页面关闭弹框;内部 show 兼容未绑 cancel 的引用页 */
cancel() { cancel() {
this.setData({ this.setData({ show: false })
show: false this.triggerEvent('cancel')
})
}, },
async confirm() { async confirm() {
let chooseList = await this.getChooseList(true) let chooseList = await this.getChooseList(true)
...@@ -628,9 +628,7 @@ Component({ ...@@ -628,9 +628,7 @@ Component({
goodsList: chooseList goodsList: chooseList
}) })
this.triggerEvent('confirm', chooseList) this.triggerEvent('confirm', chooseList)
this.setData({ this.setData({ show: false })
show: false
})
} }
} }
}) })
...@@ -460,6 +460,10 @@ Component({ ...@@ -460,6 +460,10 @@ Component({
} = e.detail } = e.detail
const thisPage = wx.$router.getPageInstance() const thisPage = wx.$router.getPageInstance()
thisPage.setCustomerInfo(customer) thisPage.setCustomerInfo(customer)
this.setData({ customerInfoBox: false })
},
onCustomerInfoCancel() {
this.setData({ customerInfoBox: false })
}, },
changeGender(e) { changeGender(e) {
let { let {
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</view> </view>
<store-referrer-picker bindconfirm="handleSalesChange" show="{{referrerPicker}}" title="{{pointsMultiRole=='N'?'推荐人':'销售顾问/录单员'}}" type="1" orderObj="{{ orderObj }}" pickerListAll="{{employeeList}}" /> <store-referrer-picker bindconfirm="handleSalesChange" show="{{referrerPicker}}" title="{{pointsMultiRole=='N'?'推荐人':'销售顾问/录单员'}}" type="1" orderObj="{{ orderObj }}" pickerListAll="{{employeeList}}" />
<store-referrer-picker bindconfirm="handleDeliveryChange" show="{{deliveryPicker}}" title="交付专员" type="2" orderObj="{{ orderObj }}" pickerListAll="{{employeeList}}" /> <store-referrer-picker bindconfirm="handleDeliveryChange" show="{{deliveryPicker}}" title="交付专员" type="2" orderObj="{{ orderObj }}" pickerListAll="{{employeeList}}" />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" apiType="2" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" apiType="2" />
<car-brands show="{{ carBrandBox }}" bindconfirm="chooseCar" carSeriesId="{{ serviceInfo.carSeriesId || '' }}" equityFlag="true" merchantId="{{ userInfo.default4SStoreInfo.merchantId || undefined }}" /> <car-brands show="{{ carBrandBox }}" bindconfirm="chooseCar" carSeriesId="{{ serviceInfo.carSeriesId || '' }}" equityFlag="true" merchantId="{{ userInfo.default4SStoreInfo.merchantId || undefined }}" />
<van-popup show="{{ showSceneSelect }}" position="bottom" bind:close="onCloseSceneSelect"> <van-popup show="{{ showSceneSelect }}" position="bottom" bind:close="onCloseSceneSelect">
......
...@@ -270,6 +270,10 @@ Page({ ...@@ -270,6 +270,10 @@ Page({
this.setData({ this.setData({
customer customer
}) })
this.setData({ customerInfoBox: false })
},
onCustomerInfoCancel() {
this.setData({ customerInfoBox: false })
}, },
input(e) { input(e) {
let { value } = e.detail let { value } = e.detail
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</view> </view>
</view> </view>
<merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" scene="0" type="1" /> <merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" scene="0" type="1" />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
<van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType"> <van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType">
<van-picker show-toolbar columns="{{ saleTypesList }}" value-key="name" bind:cancel="onCloseSaleType" bind:confirm="onChangeSaleType" /> <van-picker show-toolbar columns="{{ saleTypesList }}" value-key="name" bind:cancel="onCloseSaleType" bind:confirm="onChangeSaleType" />
</van-popup> </van-popup>
......
...@@ -241,6 +241,10 @@ Page({ ...@@ -241,6 +241,10 @@ Page({
this.setData({ this.setData({
customer, customer,
}); });
this.setData({ customerInfoBox: false });
},
onCustomerInfoCancel() {
this.setData({ customerInfoBox: false });
}, },
input(e) { input(e) {
let { value } = e.detail; let { value } = e.detail;
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</view> </view>
</block> </block>
<merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" type="1" scene="0"/> <merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" type="1" scene="0"/>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
<van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType"> <van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType">
<van-picker show-toolbar columns="{{ saleTypesList }}" value-key="name" bind:cancel="onCloseSaleType" bind:confirm="onChangeSaleType" /> <van-picker show-toolbar columns="{{ saleTypesList }}" value-key="name" bind:cancel="onCloseSaleType" bind:confirm="onChangeSaleType" />
</van-popup> </van-popup>
\ No newline at end of file \ No newline at end of file
...@@ -1476,6 +1476,9 @@ Page({ ...@@ -1476,6 +1476,9 @@ Page({
firstStepCustomerInfoBox: false, firstStepCustomerInfoBox: false,
}); });
}, },
handleFirstStepCustomerInfoCancel() {
this.setData({ firstStepCustomerInfoBox: false });
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
......
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
wx:if="{{step === 'first'}}" wx:if="{{step === 'first'}}"
show="{{firstStepCustomerInfoBox}}" show="{{firstStepCustomerInfoBox}}"
bindconfirm="handleFirstStepCustomerInfo" bindconfirm="handleFirstStepCustomerInfo"
bindcancel="handleFirstStepCustomerInfoCancel"
apiType="2" apiType="2"
/> />
......
...@@ -70,6 +70,7 @@ Page({ ...@@ -70,6 +70,7 @@ Page({
// 预约提交 // 预约提交
chooseCustomerInfo(e) { chooseCustomerInfo(e) {
let { detail } = e let { detail } = e
this.setData({ customerInfoBox: false })
let { inviteObj } = this.data let { inviteObj } = this.data
let params = { let params = {
id: detail.id, id: detail.id,
...@@ -90,6 +91,9 @@ Page({ ...@@ -90,6 +91,9 @@ Page({
} }
}) })
}, },
onCustomerInfoCancel() {
this.setData({ customerInfoBox: false })
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
......
...@@ -47,4 +47,4 @@ ...@@ -47,4 +47,4 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<customerInfo wx:if="{{customerInfoBox}}" show="{{customerInfoBox}}" bindconfirm="chooseCustomerInfo" />
\ No newline at end of file \ No newline at end of file
<customerInfo wx:if="{{customerInfoBox}}" show="{{customerInfoBox}}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
\ No newline at end of file \ No newline at end of file
...@@ -515,6 +515,11 @@ Component({ ...@@ -515,6 +515,11 @@ Component({
couponList: arr, couponList: arr,
}); });
}, },
/** 取消时通知父页面关闭弹框;内部 show 兼容未绑 cancel 的引用页 */
onPopupCancel() {
this.setData({ show: false })
this.triggerEvent('cancel')
},
confirm() { confirm() {
let { chooseItem } = this.data; let { chooseItem } = this.data;
// customerCouponList // customerCouponList
...@@ -525,9 +530,9 @@ Component({ ...@@ -525,9 +530,9 @@ Component({
}); });
} }
// console.log(chooseItem) // console.log(chooseItem)
this.setData({ const name =
show: false, (chooseItem.couponName || '') +
}); (chooseItem.customerCouponCode || chooseItem.merchantCouponCode || '')
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let { orderObj } = thisPage.data; let { orderObj } = thisPage.data;
...@@ -542,6 +547,8 @@ Component({ ...@@ -542,6 +547,8 @@ Component({
thisPage.setData({ thisPage.setData({
orderObj, orderObj,
}); });
this.setData({ show: false });
this.triggerEvent('confirm', { name });
}, },
}, },
}); });
<popup show="{{show}}" title="选择礼券" bindconfirm="confirm"> <popup show="{{show}}" title="选择礼券" bindconfirm="confirm" bindcancel="onPopupCancel">
<view class="coupon-box"> <view class="coupon-box">
<search-input bindsearch="searchCoupon"></search-input> <search-input bindsearch="searchCoupon"></search-input>
<scroll-view class="coupon" scroll-y> <scroll-view class="coupon" scroll-y>
......
...@@ -318,12 +318,6 @@ Component({ ...@@ -318,12 +318,6 @@ Component({
console.log(chooseList,'chooseList') console.log(chooseList,'chooseList')
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
if (!selectData.length) return wx.$util.showToast("请勾选套餐"); if (!selectData.length) return wx.$util.showToast("请勾选套餐");
this.setData({
show: false,
});
thisPage.setData({
packageBox: false,
});
thisPage?.setGoodsTotal && thisPage.setGoodsTotal(chooseList); thisPage?.setGoodsTotal && thisPage.setGoodsTotal(chooseList);
thisPage.setData({ thisPage.setData({
goodsList: chooseList, goodsList: chooseList,
...@@ -331,13 +325,8 @@ Component({ ...@@ -331,13 +325,8 @@ Component({
this.triggerEvent("confirm", chooseList); this.triggerEvent("confirm", chooseList);
}, },
cancel() { cancel() {
let thisPage = wx.$router.getPageInstance(); this.setData({ show: false })
this.setData({ this.triggerEvent('cancel')
show: false,
});
thisPage.setData({
packageBox: false,
});
}, },
}, },
}); });
\ No newline at end of file \ No newline at end of file
...@@ -117,6 +117,10 @@ Page({ ...@@ -117,6 +117,10 @@ Page({
let { detail } = e let { detail } = e
// this.onRoute(detail) // this.onRoute(detail)
this.setOrderObj(detail) this.setOrderObj(detail)
this.setData({ customerInfoBox: false })
},
onCustomerInfoCancel() {
this.setData({ customerInfoBox: false })
}, },
closeTips() { closeTips() {
this.setData({ this.setData({
......
...@@ -655,7 +655,7 @@ ...@@ -655,7 +655,7 @@
<view class="modalTips">请修改商品价格,商品总额需等于总价。</view> <view class="modalTips">请修改商品价格,商品总额需等于总价。</view>
</view> </view>
</modal> </modal>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" merchantId="{{ orderObj.merchantId }}" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" merchantId="{{ orderObj.merchantId }}" />
<!-- <order-popup <!-- <order-popup
orderType="{{remarkBox}}" orderType="{{remarkBox}}"
show="{{remarkBox}}" show="{{remarkBox}}"
......
...@@ -18,6 +18,7 @@ import { ...@@ -18,6 +18,7 @@ import {
buildOrderPatch, buildOrderPatch,
resolveDefaultSelection resolveDefaultSelection
} from './services/merchantStaffSelection' } from './services/merchantStaffSelection'
import { closePagePopupPatch } from './services/pagePopupLock'
import { import {
PAY_TYPE, PAY_TYPE,
PAY_TYPE_MAP, PAY_TYPE_MAP,
...@@ -546,6 +547,16 @@ Page({ ...@@ -546,6 +547,16 @@ Page({
this.onRoute(detail) this.onRoute(detail)
// 判断一下档案支付方式现在是否还在,在就替换,没有就去掉这个参数 // 判断一下档案支付方式现在是否还在,在就替换,没有就去掉这个参数
this.settingPayType(detail) this.settingPayType(detail)
this.setData(closePagePopupPatch('customerInfoBox'))
},
/** 客户档案弹框取消:重置 flag,解除 page-meta 锁页 */
onCustomerInfoCancel() {
this.setData(closePagePopupPatch('customerInfoBox'))
},
/** 通用弹框取消:由 wxml data-popup-key 指定要关闭的字段 */
onPagePopupCancel(e) {
const popupKey = e.currentTarget.dataset.popupKey
this.setData(closePagePopupPatch(popupKey))
}, },
closeTips() { closeTips() {
this.setData({ this.setData({
...@@ -956,7 +967,8 @@ Page({ ...@@ -956,7 +967,8 @@ Page({
console.log(e) console.log(e)
let { carBrand, carType } = e.detail let { carBrand, carType } = e.detail
this.setData({ this.setData({
car: `${carBrand}|${carType}` car: `${carBrand}|${carType}`,
...closePagePopupPatch('carBrandBox')
}) })
}, },
/** /**
...@@ -967,9 +979,17 @@ Page({ ...@@ -967,9 +979,17 @@ Page({
console.log(e) console.log(e)
let { name } = e.detail let { name } = e.detail
this.setData({ this.setData({
couponName: name couponName: name,
...closePagePopupPatch('couponBox')
}) })
}, },
/** 商品/套餐弹框确认后关闭,Goods/SetMeal 已通过 getPageInstance 写入 goodsList */
chooseGoods() {
const patch = {}
if (this.data.goodsBox) Object.assign(patch, closePagePopupPatch('goodsBox'))
if (this.data.packageBox) Object.assign(patch, closePagePopupPatch('packageBox'))
if (Object.keys(patch).length) this.setData(patch)
},
//修改套餐价格 //修改套餐价格
changeMealPrice(e) { changeMealPrice(e) {
console.log(e) console.log(e)
...@@ -2180,7 +2200,8 @@ Page({ ...@@ -2180,7 +2200,8 @@ Page({
remarkConfirm(e) { remarkConfirm(e) {
let value = e.detail let value = e.detail
this.setData({ this.setData({
['orderObj.remark']: value ['orderObj.remark']: value,
...closePagePopupPatch('showRemark')
}) })
}, },
......
...@@ -833,6 +833,8 @@ value="{{ orderObj.remark }}" ...@@ -833,6 +833,8 @@ value="{{ orderObj.remark }}"
<car-brands <car-brands
show="{{ carBrandBox }}" show="{{ carBrandBox }}"
bindconfirm="chooseCar" bindconfirm="chooseCar"
bindcancel="onPagePopupCancel"
data-popup-key="carBrandBox"
carSeriesId="{{ orderObj.customer.carSeriesId || '' }}" carSeriesId="{{ orderObj.customer.carSeriesId || '' }}"
merchantId="{{ orderObj.merchantId || 0 }}" merchantId="{{ orderObj.merchantId || 0 }}"
/> />
...@@ -840,6 +842,8 @@ value="{{ orderObj.remark }}" ...@@ -840,6 +842,8 @@ value="{{ orderObj.remark }}"
wx:if="{{ showRemark }}" wx:if="{{ showRemark }}"
show="{{ showRemark }}" show="{{ showRemark }}"
bindconfirm="remarkConfirm" bindconfirm="remarkConfirm"
bindcancel="onPagePopupCancel"
data-popup-key="showRemark"
placeholder="请填写内容,最多30个字" placeholder="请填写内容,最多30个字"
maxlength="30" maxlength="30"
value="{{ orderObj.remark }}" value="{{ orderObj.remark }}"
...@@ -850,6 +854,8 @@ value="{{ orderObj.remark }}" ...@@ -850,6 +854,8 @@ value="{{ orderObj.remark }}"
class="coupon" class="coupon"
orderCreateType="{{ orderCreateType }}" orderCreateType="{{ orderCreateType }}"
bindconfirm="chooseCoupon" bindconfirm="chooseCoupon"
bindcancel="onPagePopupCancel"
data-popup-key="couponBox"
merchantId="{{ orderObj.merchantId || 0 }}" merchantId="{{ orderObj.merchantId || 0 }}"
customerPhone="{{ orderObj.customer.customerPhone }}" customerPhone="{{ orderObj.customer.customerPhone }}"
yqMerchantId="{{ orderObj.sellerMerchantId || 0 }}" yqMerchantId="{{ orderObj.sellerMerchantId || 0 }}"
...@@ -860,13 +866,15 @@ value="{{ orderObj.remark }}" ...@@ -860,13 +866,15 @@ value="{{ orderObj.remark }}"
show="{{ goodsBox }}" show="{{ goodsBox }}"
wx:if="{{ goodsBox }}" wx:if="{{ goodsBox }}"
bindconfirm="chooseGoods" bindconfirm="chooseGoods"
bindcancel="onPagePopupCancel"
data-popup-key="goodsBox"
goodsData="{{ goodsData }}" goodsData="{{ goodsData }}"
chooseGoodsList="{{ goodsList }}" chooseGoodsList="{{ goodsList }}"
isSolarFilm="{{ true }}" isSolarFilm="{{ true }}"
baseConfigData="{{ baseConfigData }}" baseConfigData="{{ baseConfigData }}"
/> />
<sku-goods show="{{ skuGoodsBox }}" sceneType="1" goodsData="{{ skuGoodsData }}" chooseGoodsList="{{ goodsList }}"></sku-goods> <sku-goods show="{{ skuGoodsBox }}" sceneType="1" goodsData="{{ skuGoodsData }}" chooseGoodsList="{{ goodsList }}"></sku-goods>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
<van-popup show="{{ showSource }}" position="bottom" bind:close="onCloseSource"> <van-popup show="{{ showSource }}" position="bottom" bind:close="onCloseSource">
<van-picker <van-picker
show-toolbar show-toolbar
...@@ -902,6 +910,8 @@ value="{{ orderObj.remark }}" ...@@ -902,6 +910,8 @@ value="{{ orderObj.remark }}"
wx:if="{{ packageBox }}" wx:if="{{ packageBox }}"
show="{{ packageBox }}" show="{{ packageBox }}"
bindconfirm="chooseGoods" bindconfirm="chooseGoods"
bindcancel="onPagePopupCancel"
data-popup-key="packageBox"
goodsData="{{ goodsData }}" goodsData="{{ goodsData }}"
chooseGoodsList="{{ goodsList }}" chooseGoodsList="{{ goodsList }}"
isSolarFilm="{{ true }}" isSolarFilm="{{ true }}"
......
...@@ -62,8 +62,18 @@ function shouldSyncPagePopup(updates) { ...@@ -62,8 +62,18 @@ function shouldSyncPagePopup(updates) {
}) })
} }
/**
* 返回用于 setData 的关弹框 patch,便于 page-meta 解锁底层滚动
* @param {string} popupKey data 中的弹框字段名
* @returns {object}
*/
function closePagePopupPatch(popupKey) {
return popupKey ? { [popupKey]: false } : {}
}
module.exports = { module.exports = {
PAGE_POPUP_KEYS, PAGE_POPUP_KEYS,
computePagePopupVisible, computePagePopupVisible,
shouldSyncPagePopup shouldSyncPagePopup,
closePagePopupPatch
} }
...@@ -5,7 +5,8 @@ import { createRequire } from 'node:module' ...@@ -5,7 +5,8 @@ import { createRequire } from 'node:module'
const require = createRequire(import.meta.url) const require = createRequire(import.meta.url)
const { const {
computePagePopupVisible, computePagePopupVisible,
shouldSyncPagePopup shouldSyncPagePopup,
closePagePopupPatch
} = require('../services/pagePopupLock.js') } = require('../services/pagePopupLock.js')
describe('pagePopupLock', () => { describe('pagePopupLock', () => {
...@@ -27,4 +28,12 @@ describe('pagePopupLock', () => { ...@@ -27,4 +28,12 @@ describe('pagePopupLock', () => {
assert.equal(shouldSyncPagePopup({ orderObj: {} }), false) assert.equal(shouldSyncPagePopup({ orderObj: {} }), false)
assert.equal(shouldSyncPagePopup({ pagePopupVisible: true }), false) assert.equal(shouldSyncPagePopup({ pagePopupVisible: true }), false)
}) })
it('closePagePopupPatch returns false patch for popup key', () => {
assert.deepEqual(closePagePopupPatch('customerInfoBox'), {
customerInfoBox: false
})
assert.deepEqual(closePagePopupPatch(''), {})
assert.deepEqual(closePagePopupPatch(null), {})
})
}) })
...@@ -238,9 +238,13 @@ Page({ ...@@ -238,9 +238,13 @@ Page({
experienceFlag: detail.customer.experienceFlag || 'Y' experienceFlag: detail.customer.experienceFlag || 'Y'
}, },
[prop + '.customerCouponCode']: detail.customerCoupon?.customerCouponCode, [prop + '.customerCouponCode']: detail.customerCoupon?.customerCouponCode,
[prop + '.customerCouponId']: detail?.customerCouponId // 客户券id [prop + '.customerCouponId']: detail?.customerCouponId, // 客户券id
customerInfoBox: false
}) })
}, },
onCustomerInfoCancel() {
this.setData({ customerInfoBox: false })
},
showCustomPop(e) { showCustomPop(e) {
let { index } = e.currentTarget.dataset let { index } = e.currentTarget.dataset
this.setData({ this.setData({
......
...@@ -737,7 +737,7 @@ ...@@ -737,7 +737,7 @@
isSolarFilm="{{ true }}" isSolarFilm="{{ true }}"
baseConfigData="{{ baseConfigData }}" baseConfigData="{{ baseConfigData }}"
/> />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
<sub-shop-merchant <sub-shop-merchant
show="{{ subShopMerchantBox }}" show="{{ subShopMerchantBox }}"
title="选择二级流量方" title="选择二级流量方"
......
...@@ -99,6 +99,10 @@ Page({ ...@@ -99,6 +99,10 @@ Page({
chooseCustomerInfo(e) { chooseCustomerInfo(e) {
let { detail } = e; let { detail } = e;
this.onRoute(detail); this.onRoute(detail);
this.setData({ customerInfoBox: false });
},
onCustomerInfoCancel() {
this.setData({ customerInfoBox: false });
}, },
closeTips() { closeTips() {
this.setData({ this.setData({
......
...@@ -435,7 +435,7 @@ ...@@ -435,7 +435,7 @@
filmOrder="1" filmOrder="1"
/> />
<goods show="{{ goodsBox }}" bindconfirm="chooseGoods" goodsData="{{ goodsData }}" chooseGoodsList="{{ goodsList }}" /> <goods show="{{ goodsBox }}" bindconfirm="chooseGoods" goodsData="{{ goodsData }}" chooseGoodsList="{{ goodsList }}" />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
<sub-shop-merchant <sub-shop-merchant
show="{{ subShopMerchantBox }}" show="{{ subShopMerchantBox }}"
title="选择二级流量方" title="选择二级流量方"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!