diff --git a/common/config.js b/common/config.js index 92f77cf..6f3b749 100644 --- a/common/config.js +++ b/common/config.js @@ -96,7 +96,8 @@ class ConfigManager { static getGoodType() { let goodType = this.get('good_type'); if (goodType != null) { - return goodType.map(item => { + // goodType数组过滤,只保留is_show=1的项目 + return goodType.filter(item => item.is_show === 1).map(item => { return { id: item.value, title: item.name @@ -106,6 +107,18 @@ class ConfigManager { return []; } + /** + * 获取指定盒子类型 + * @param {Number} type 盒子类型 + * @returns {Object} 盒子类型对象 + */ + static getGoodTypeFind(type) { + let goodType = this.get('good_type'); + if (goodType != null) { + return goodType.find(item => item.value == type); + } + } + /** * 刷新配置数据 * @returns {Promise} 返回刷新完成的Promise diff --git a/components/order-confirm-popup/order-confirm-popup.vue b/components/order-confirm-popup/order-confirm-popup.vue index f70a5b9..93a83fa 100644 --- a/components/order-confirm-popup/order-confirm-popup.vue +++ b/components/order-confirm-popup/order-confirm-popup.vue @@ -51,7 +51,7 @@ {{ orderData.goods.price }} - + ×{{ orderData.goods.prize_num }} @@ -73,27 +73,13 @@ - - - - 使用积分抵扣 - {{ orderData.use_score }} - (剩余:{{ orderData.score }}) - - - - - - - - - - + - + @@ -142,7 +141,7 @@ 确认支付 {{ - pageData.goods.type == 5 ? ` ${orderData.use_score}积分` : ` ¥${orderData.price}` + pageData.goods.type == 5 ? ` ${(orderData.use_score/100).toFixed(2)}积分` : ` ¥${orderData.price}` }} @@ -168,6 +167,11 @@ export default { type: Boolean, default: true }, + //是否使用余额2 + useMoney2: { + type: Boolean, + default: true + }, // 是否使用积分 useIntegral: { type: Boolean, @@ -195,39 +199,81 @@ export default { } }, data() { + //pageData.goods.type return { currencyName: '', - balanceName: '' + currencyName2:'', + balanceName: '', + pay_balance: 1, + pay_coupon: 1, + pay_currency: 1, + pay_currency2: 1, + pay_wechat: 1, + is_deduction: 1, + deduction_name:'' } }, created() { // 获取货币名称和余额名称 - this.currencyName = this.$config.getAppSetting('currency1_name') || '积分'; + this.currencyName = this.$config.getAppSetting('currency1_name') || '货币'; + this.currencyName2 = this.$config.getAppSetting('currency2_name') || '积分'; this.balanceName = this.$config.getAppSetting('balance_name') || '余额'; + let goodType = this.$config.getGoodTypeFind(this.pageData.goods.type); + //是否显示余额支付 + this.pay_balance = goodType.pay_balance; + //是否显示优惠卷 + this.pay_coupon = goodType.pay_coupon; + //是否显示货币支付 + this.pay_currency = goodType.pay_currency; + //是否显示货币2支付 + this.pay_currency2 = goodType.pay_currency2; + //是否显示微信支付 + this.pay_wechat = goodType.pay_wechat; + //抵扣还是支付 + this.is_deduction=goodType.is_deduction; + if(this.is_deduction==1){ + this.deduction_name='抵扣'; + }else{ + this.deduction_name='支付'; + } + }, methods: { + /** * 打开弹窗 */ open() { this.$refs.popup.open(); }, - + /** * 关闭弹窗 */ close() { this.$refs.popup.close(); }, - + /** * 切换支付方式 * @param {String} method 支付方式 */ changePayMethod(method) { + if(this.is_deduction==0){ + // 如果是支付模式,检查可用的支付方式数量 + let availablePayMethods = 0; + if(this.pay_balance) availablePayMethods++; + if(this.pay_currency) availablePayMethods++; + if(this.pay_currency2) availablePayMethods++; + + // 如果只有一种支付方式可用,则不允许切换 + if(availablePayMethods <= 1) { + return; + } + } this.$emit('change-pay', method); }, - + /** * 检查按钮是否显示 */ @@ -448,4 +494,4 @@ export default { } } } - \ No newline at end of file + \ No newline at end of file diff --git a/components/order-confirm-popup/order-confirm-popup.vue.bak b/components/order-confirm-popup/order-confirm-popup.vue.bak new file mode 100644 index 0000000..1f7e35a Binary files /dev/null and b/components/order-confirm-popup/order-confirm-popup.vue.bak differ diff --git a/pages/mall/index.vue b/pages/mall/index.vue index 3f87ac8..d07963b 100644 --- a/pages/mall/index.vue +++ b/pages/mall/index.vue @@ -108,19 +108,7 @@ - diff --git a/pages/shouye/detail.vue b/pages/shouye/detail.vue index e5a96e4..4f8f8ac 100644 --- a/pages/shouye/detail.vue +++ b/pages/shouye/detail.vue @@ -10,30 +10,30 @@ + background: + 'url(' + pageData.goods.imgurl_detail + ') no-repeat 0 0 / 100% 100%', + }"> {{ pageData.goods.title }} + pageData.goods.lock_is == 1 && + pageData.lock_info.goods_lock_surplus_time > 0 + "> + pageData.lock_info.goods_lock_user_nickname + }} 倒计时:{{ secNum }}S + background: + 'url(' + + $img1('common/chouTitle.png') + + ') no-repeat 0 0 / 100% 100%', + }"> @@ -65,12 +65,13 @@ {{ pageData.goods.num }} /{{ - pageData.goods.stock - }}箱 + pageData.goods.stock + }}箱 赏品余量 - {{ pageData.goods.goodslist_surplus_stock }}/{{ pageData.goods.goodslist_stock }} + {{ pageData.goods.goodslist_surplus_stock }}/{{ pageData.goods.goodslist_stock + }} @@ -86,8 +87,8 @@ + background: item.shang_info ? item.shang_info.color : '#FFFFFF', + }"> {{ item.shang_info ? item.shang_info.title : "" }} {{ item.surplus_stock }}/{{ item.stock }} @@ -130,23 +131,11 @@ - + @@ -172,14 +161,14 @@ + backgroundImage: `url(${$img1('common/quhegui.png')})`, + }" @click="toBag"> 去发货 + backgroundImage: `url(${$img1('common/jixuchou.png')})`, + }" @click="close('resPop')"> 继续抽 @@ -197,987 +186,1099 @@ \ No newline at end of file