|
|
@@ -12,6 +12,7 @@ Page({
|
|
|
backParams: null as any,
|
|
|
instrumentList: [] as any,
|
|
|
list: [] as any,
|
|
|
+ submitDisabled: false, // 提交
|
|
|
isOverSaled: false, // 是否所有商品都没有库存
|
|
|
smallGoods: {}, // 最小金额商品
|
|
|
selected: {} as any,
|
|
|
@@ -232,56 +233,59 @@ Page({
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- debounce(function () {
|
|
|
- if (!that.isLogin()) {
|
|
|
- return
|
|
|
- }
|
|
|
- const params = [] as any
|
|
|
- const selected = that.data.selected
|
|
|
- if (selected.id) {
|
|
|
- params.push({
|
|
|
- pic: selected.pic,
|
|
|
- name: selected.name,
|
|
|
- period: selected.period,
|
|
|
- num: selected.num,
|
|
|
- originalPrice: selected.originalPrice,
|
|
|
- salePrice: selected.salePrice,
|
|
|
- shopId: selected.shopId,
|
|
|
- id: selected.id,
|
|
|
- goodsType: 'ACTIVATION_CODE', // INSTRUMENTS
|
|
|
- })
|
|
|
- }
|
|
|
- const selectedInstrument = that.data.selectedInstrument
|
|
|
- if (selectedInstrument.id) {
|
|
|
- params.push({
|
|
|
- pic: selectedInstrument.pic,
|
|
|
- name: selectedInstrument.name,
|
|
|
- period: selectedInstrument?.period,
|
|
|
- num: selectedInstrument?.num || 0,
|
|
|
- originalPrice: selectedInstrument.originalPrice,
|
|
|
- salePrice: selectedInstrument.salePrice,
|
|
|
- shopId: selectedInstrument.shopId,
|
|
|
- id: selectedInstrument.id,
|
|
|
- goodsType: 'INSTRUMENTS', // INSTRUMENTS
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- let info = JSON.stringify({
|
|
|
- ...params
|
|
|
- });
|
|
|
- info = encodeURIComponent(info);
|
|
|
|
|
|
- console.log(params, "params")
|
|
|
- wx.navigateTo({
|
|
|
- url: `../orders/order-detail?orderInfo=${info}&userBeneficiaryId=${that.data.userBeneficiaryId}`,
|
|
|
- success: () => {
|
|
|
- that.setData({
|
|
|
- popupShow: false,
|
|
|
- currentIndex: 1,
|
|
|
- })
|
|
|
- }
|
|
|
+ if (!that.isLogin() || that.data.submitDisabled) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ that.setData({
|
|
|
+ submitDisabled: true
|
|
|
+ })
|
|
|
+ const params = [] as any
|
|
|
+ const selected = that.data.selected
|
|
|
+ if (selected.id) {
|
|
|
+ params.push({
|
|
|
+ pic: selected.pic,
|
|
|
+ name: selected.name,
|
|
|
+ period: selected.period,
|
|
|
+ num: selected.num,
|
|
|
+ originalPrice: selected.originalPrice,
|
|
|
+ salePrice: selected.salePrice,
|
|
|
+ shopId: selected.shopId,
|
|
|
+ id: selected.id,
|
|
|
+ goodsType: 'ACTIVATION_CODE', // INSTRUMENTS
|
|
|
+ })
|
|
|
+ }
|
|
|
+ const selectedInstrument = that.data.selectedInstrument
|
|
|
+ if (selectedInstrument.id) {
|
|
|
+ params.push({
|
|
|
+ pic: selectedInstrument.pic,
|
|
|
+ name: selectedInstrument.name,
|
|
|
+ period: selectedInstrument?.period,
|
|
|
+ num: selectedInstrument?.num || 0,
|
|
|
+ originalPrice: selectedInstrument.originalPrice,
|
|
|
+ salePrice: selectedInstrument.salePrice,
|
|
|
+ shopId: selectedInstrument.shopId,
|
|
|
+ id: selectedInstrument.id,
|
|
|
+ goodsType: 'INSTRUMENTS', // INSTRUMENTS
|
|
|
})
|
|
|
- }, 500)()
|
|
|
+ }
|
|
|
+
|
|
|
+ let info = JSON.stringify({
|
|
|
+ ...params
|
|
|
+ });
|
|
|
+ info = encodeURIComponent(info);
|
|
|
+
|
|
|
+ console.log(params, "params")
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `../orders/order-detail?orderInfo=${info}&userBeneficiaryId=${that.data.userBeneficiaryId}`,
|
|
|
+ success: () => {
|
|
|
+ that.setData({
|
|
|
+ popupShow: false,
|
|
|
+ currentIndex: 1,
|
|
|
+ submitDisabled: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
/** 添加购买人 */
|
|
|
onAddBuyer() {
|