diff --git a/App.vue b/App.vue index 97ad88c9..b422bf96 100644 --- a/App.vue +++ b/App.vue @@ -7,10 +7,10 @@ data: { // 基础配置 // 数据接口请求地址 - request_url:'https://new.shopxo.vip/', + request_url:'http://shopxo.com/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/) - static_url:'https://new.shopxo.vip/', + static_url:'http://shopxo.com/', // 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立) system_type: 'default', diff --git a/pages/plugins/binding/detail/detail.vue b/pages/plugins/binding/detail/detail.vue index 5cc9a362..25db8a76 100644 --- a/pages/plugins/binding/detail/detail.vue +++ b/pages/plugins/binding/detail/detail.vue @@ -15,7 +15,8 @@ {{ item.title }} @@ -33,12 +34,6 @@ - - - - - - {{ item.inventory }}{{ item.inventory_unit }} @@ -103,9 +98,6 @@ - - - @@ -117,8 +109,6 @@ import componentNoData from '@/components/no-data/no-data'; import componentBottomLine from '@/components/bottom-line/bottom-line'; import componentGoodsSpecChoice from '@/components/goods-spec-choice/goods-spec-choice'; - import componentGoodsBuy from '@/components/goods-buy/goods-buy'; - import componentBadge from '@/components/badge/badge'; let binding_static_url = app.globalData.get_static_url('binding', true); export default { @@ -145,9 +135,7 @@ componentCommon, componentNoData, componentBottomLine, - componentGoodsSpecChoice, - componentGoodsBuy, - componentBadge + componentGoodsSpecChoice }, onLoad(params) { @@ -269,51 +257,53 @@ var index = e.currentTarget.dataset.index || 0; var temp_data = this.data; var goods = temp_data.goods; - goods[index]['checked'] = goods[index]['checked'] == undefined || goods[index]['checked'] == true ? false : true; - temp_data['goods'] = goods; + if(parseInt(goods[index]['is_required'] || 0) == 0) { + goods[index]['checked'] = goods[index]['checked'] == undefined || goods[index]['checked'] == true ? false : true; + temp_data['goods'] = goods; - // 已选商品 - var min_price = 0; - var max_price = 0; - var min_discount_price = 0; - var max_discount_price = 0; - for (var i in goods) { - if ((goods[i]['checked'] == undefined || goods[i]['checked'] == true) && goods[i]['is_error'] == 0) { - min_price += parseFloat(goods[i]['min_price'] || 0); - max_price += parseFloat(goods[i]['max_price'] || 0); - var discount_price = goods[i]['discount_price'] || null; - if (discount_price != null) { - if (discount_price.indexOf('-') == -1) { - min_discount_price += parseFloat(discount_price); - max_discount_price += parseFloat(discount_price); - } else { - var temp = discount_price.split('-'); - min_discount_price += parseFloat(temp[0]); - max_discount_price += parseFloat(temp[1]); + // 已选商品 + var min_price = 0; + var max_price = 0; + var min_discount_price = 0; + var max_discount_price = 0; + for (var i in goods) { + if ((goods[i]['checked'] == undefined || goods[i]['checked'] == true) && goods[i]['is_error'] == 0) { + min_price += parseFloat(goods[i]['min_price'] || 0); + max_price += parseFloat(goods[i]['max_price'] || 0); + var discount_price = goods[i]['discount_price'] || null; + if (discount_price != null) { + if (discount_price.indexOf('-') == -1) { + min_discount_price += parseFloat(discount_price); + max_discount_price += parseFloat(discount_price); + } else { + var temp = discount_price.split('-'); + min_discount_price += parseFloat(temp[0]); + max_discount_price += parseFloat(temp[1]); + } } } } - } - // 价格 - if (min_price == max_price) { - var price = app.globalData.price_two_decimal(min_price); - } else { - var price = app.globalData.price_two_decimal(min_price) + '-' + app.globalData.price_two_decimal(max_price); - } + // 价格 + if (min_price == max_price) { + var price = app.globalData.price_two_decimal(min_price); + } else { + var price = app.globalData.price_two_decimal(min_price) + '-' + app.globalData.price_two_decimal(max_price); + } - // 节省 - if (min_discount_price == max_discount_price) { - var discount_price = app.globalData.price_two_decimal(min_discount_price); - } else { - var discount_price = app.globalData.price_two_decimal(min_discount_price) + '-' + app.globalData.price_two_decimal(max_discount_price); - } + // 节省 + if (min_discount_price == max_discount_price) { + var discount_price = app.globalData.price_two_decimal(min_discount_price); + } else { + var discount_price = app.globalData.price_two_decimal(min_discount_price) + '-' + app.globalData.price_two_decimal(max_discount_price); + } - // 购买价格 - temp_data['estimate_price'] = price; - // 节省价格 - temp_data['estimate_discount_price'] = discount_price; - this.setData({ data: temp_data }); + // 购买价格 + temp_data['estimate_price'] = price; + // 节省价格 + temp_data['estimate_discount_price'] = discount_price; + this.setData({ data: temp_data }); + } }, // 规格选择 @@ -386,31 +376,8 @@ goods_data: encodeURIComponent(base64.encode(JSON.stringify(goods_data))), }; app.globalData.url_open('/pages/buy/buy?data=' + encodeURIComponent(base64.encode(JSON.stringify(data)))); - }, - - // 加入购物车 - goods_cart_event(e) { - if ((this.$refs.goods_buy || null) != null) { - var index = e.currentTarget.dataset.index || 0; - var goods = this.data['goods'][index]; - this.$refs.goods_buy.init(goods, { buy_event_type: 'cart', is_direct_cart: 1 }, { index: index }); - } - }, - - // 加入购物车成功回调 - goods_cart_back_event(e) { - // 增加数量 - var back = e.back_data; - var temp = this.data; - var goods = temp['goods'][back.index]; - goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock); - if (goods['user_cart_count'] > 99) { - goods['user_cart_count'] = '99+'; - } - temp['goods'][back.index] = goods; - this.setData({ data: temp }); - }, - }, + } + } };