From b33eea975fa8a42ea74e168fa1fa8618509575c8 Mon Sep 17 00:00:00 2001 From: xindan <2499232802@qq.com> Date: Fri, 22 Oct 2021 00:56:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E5=8F=91=E6=8F=92=E4=BB=B6=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 3 +- pages/cart/cart.vue | 7 +- pages/goods-detail/goods-detail.css | 114 ++++++++++++++++++---------- pages/goods-detail/goods-detail.vue | 68 +++++++++++++++-- 4 files changed, 144 insertions(+), 48 deletions(-) diff --git a/App.vue b/App.vue index c52973bc..31247aa6 100644 --- a/App.vue +++ b/App.vue @@ -34,7 +34,7 @@ "/pages/user/user" ], // 请求地址 - request_url: 'https://d1.shopxo.vip/', + request_url: 'https://dev.shopxo.vip/', //request_url: 'http://shopxo.com/', // 静态资源地址 static_url: 'https://dev.shopxo.vip/', @@ -310,7 +310,6 @@ dataType: 'json', success: res => { uni.hideLoading(); - if (res.data.code == 0) { uni.setStorage({ key: self.data.cache_user_info_key, diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index 545cc1f5..19589c14 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -331,8 +331,11 @@ dataType: "json", success: res => { uni.hideLoading(); - if (res.data.code == 0) { - temp_data_list[index]['stock'] = buy_number; + if (res.data.code == 0) { + var data = res.data.data; + temp_data_list[index]['stock'] = data.stock; + temp_data_list[index]['original_price'] = data.original_price; + temp_data_list[index]['price'] = data.price; this.setData({ data_list: temp_data_list }); diff --git a/pages/goods-detail/goods-detail.css b/pages/goods-detail/goods-detail.css index b5de4b56..b5ade28d 100644 --- a/pages/goods-detail/goods-detail.css +++ b/pages/goods-detail/goods-detail.css @@ -405,44 +405,6 @@ padding-right: 30rpx; } -/* -* 优惠劵 - 插件 -*/ -.coupon-container-view { - position: relative; -} -.coupon-container-view .item-title { - position: absolute; - top: calc(50% - 20rpx); -} -.coupon-container-view .item { - margin-bottom: 10rpx; - padding: 3rpx 15rpx; -} -.coupon-container-view .item:not(:last-child) { - margin-right: 10rpx; -} -.coupon-container { - max-height: 50vh; - overflow-y: scroll; - overflow-x: hidden; - margin-top: 20rpx; -} -.coupon-container .v-left { - padding: 20rpx 10rpx 20rpx 20rpx; -} -.coupon-container .item:not(:last-child) { - margin-bottom: 20rpx; -} -.coupon-container .item, -.coupon-container .v-right, -.coupon-container .v-right .circle { - height: 175rpx; -} -.coupon-container .v-left .base .price { - font-size: 46rpx; -} - /* * 商品参数 */ @@ -580,4 +542,80 @@ font-size: 24rpx; min-height: 72rpx; line-height: 36rpx; +} + +/* +* 优惠劵 - 插件 +*/ +.plugins-coupon-container-view .item-title { + position: absolute; + top: calc(50% - 20rpx); +} +.plugins-coupon-container-view .item { + margin-bottom: 10rpx; + padding: 3rpx 15rpx; +} +.plugins-coupon-container-view .item:not(:last-child) { + margin-right: 10rpx; +} +.plugins-coupon-container { + max-height: 50vh; + overflow-y: scroll; + overflow-x: hidden; + margin-top: 20rpx; +} +.plugins-coupon-container .v-left { + padding: 20rpx 10rpx 20rpx 20rpx; +} +.plugins-coupon-container .item:not(:last-child) { + margin-bottom: 20rpx; +} +.plugins-coupon-container .item, +.plugins-coupon-container .v-right, +.plugins-coupon-container .v-right .circle { + height: 175rpx; +} +.plugins-coupon-container .v-left .base .price { + font-size: 46rpx; +} + +/** + * 批发 - 插件 + */ +.plugins-wholesale-container-view .item-title { + position: absolute; + top: calc(50% - 20rpx); +} +.plugins-wholesale-container-view .item { + margin-bottom: 10rpx; + padding: 3rpx 15rpx; + color: #ff6633; + border: 1px dashed #ff9e7e; +} +.plugins-wholesale-container-view .item:not(:last-child) { + margin-right: 10rpx; +} +.plugins-wholesale-container { + max-height: 50vh; + overflow-y: scroll; + overflow-x: hidden; + margin-top: 20rpx; +} +.plugins-wholesale-container .item { + width: calc(50% - 50rpx); + margin-bottom: 20rpx; +} +.plugins-wholesale-container .item:nth-child(2n) { + margin-left: 10rpx; +} +.plugins-wholesale-container .item:nth-child(2n+1) { + margin-right: 10rpx; +} +.plugins-wholesale-container .spec-tips { + color: #ffbf00; + border: 1px solid #333; + background: #333; + padding: 2rpx 10rpx; + top: 22rpx; + left: 20rpx; } \ No newline at end of file diff --git a/pages/goods-detail/goods-detail.vue b/pages/goods-detail/goods-detail.vue index c43821ae..8e930efe 100644 --- a/pages/goods-detail/goods-detail.vue +++ b/pages/goods-detail/goods-detail.vue @@ -106,9 +106,19 @@ + + + + {{plugins_wholesale_data.title}} + + + {{item.msg}} + + + - + 优惠券 @@ -380,6 +390,34 @@ + + + + + + + + + + + {{plugins_wholesale_data.spec_tips}} + + + + {{item.arr.msg}} + {{item.arr.val}} + {{item.arr.unit}} + + + + + + 无批发信息 + + + + + @@ -388,7 +426,7 @@ - + @@ -551,6 +589,9 @@ plugins_salerecords_tips_ent: '', // 多商户 plugins_shop_data: null, + // 批发 + plugins_wholesale_data: null, + popup_wholesale_status: false, }; }, @@ -718,8 +759,7 @@ indicator_dots: data.goods.photo.length > 1, autoplay: data.goods.photo.length > 1, goods_photo: data.goods.photo, - goods_specifications_choose: data.goods.specifications.choose || - [], + goods_specifications_choose: data.goods.specifications.choose || [], goods_content_app: data.goods.content_app || [], buy_number: data.goods.buy_min_number || 1, nav_favor_button_info: { @@ -738,7 +778,8 @@ plugins_coupon_data: data.plugins_coupon_data || null, quick_nav_cart_count: data.common_cart_total || 0, plugins_salerecords_data: (data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0 ? null : data.plugins_salerecords_data, - plugins_shop_data: (data.plugins_shop_data || null) == null || data.plugins_shop_data.length <= 0 ? null : data.plugins_shop_data + plugins_shop_data: (data.plugins_shop_data || null) == null || data.plugins_shop_data.length <= 0 ? null : data.plugins_shop_data, + plugins_wholesale_data: ((data.plugins_wholesale_data || null) == null) ? null : data.plugins_wholesale_data, }); // 标题 @@ -1236,6 +1277,7 @@ goods_spec_base_price: spec_base.price, goods_spec_base_original_price: spec_base.original_price, goods_spec_base_inventory: spec_base.inventory, + plugins_wholesale_data: data.plugins_wholesale_data || null, }; // 已选数量是否超过规格库存 @@ -1609,7 +1651,21 @@ nav_more_event(e) { app.globalData.operation_event(e); this.setData({nav_more_status: false}); - } + }, + + // 批发开启弹层 + popup_wholesale_event(e) { + this.setData({ + popup_wholesale_status: true + }); + }, + + // 批发弹层关闭 + popup_wholesale_close_event(e) { + this.setData({ + popup_wholesale_status: false + }); + }, } };