批发插件开发
parent
7956a1a603
commit
b33eea975f
3
App.vue
3
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,
|
||||
|
|
|
|||
|
|
@ -332,7 +332,10 @@
|
|||
success: res => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
temp_data_list[index]['stock'] = buy_number;
|
||||
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
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品参数
|
||||
*/
|
||||
|
|
@ -581,3 +543,79 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -107,8 +107,18 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 批发 -->
|
||||
<view v-if="((plugins_wholesale_data || null) != null)" class="plugins-wholesale-container-view pr oh padding-horizontal-main padding-top-main padding-bottom-sm border-radius-main bg-white arrow-right spacing-mb">
|
||||
<view class="fl item-title">{{plugins_wholesale_data.title}}</view>
|
||||
<view class="fr column-right-view single-text" @tap="popup_wholesale_event">
|
||||
<block v-for="(item, index) in plugins_wholesale_data.rules" :key="index">
|
||||
<view class="item round dis-inline-block">{{item.msg}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券 -->
|
||||
<view v-if="(plugins_coupon_data || null) != null && plugins_coupon_data.data.length > 0" class="coupon-container-view oh padding-horizontal-main padding-top-main padding-bottom-sm border-radius-main bg-white arrow-right spacing-mb">
|
||||
<view v-if="(plugins_coupon_data || null) != null && plugins_coupon_data.data.length > 0" class="plugins-coupon-container-view pr oh padding-horizontal-main padding-top-main padding-bottom-sm border-radius-main bg-white arrow-right spacing-mb">
|
||||
<view class="fl item-title">优惠券</view>
|
||||
<view class="fr column-right-view single-text" @tap="popup_coupon_event">
|
||||
<block v-for="(item, index) in plugins_coupon_data.data" :key="index">
|
||||
|
|
@ -380,6 +390,34 @@
|
|||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 批发弹层 -->
|
||||
<component-popup :prop-show="popup_wholesale_status" prop-position="bottom" @onclose="popup_wholesale_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-base">
|
||||
<view class="close oh">
|
||||
<view class="fr" @tap.stop="popup_wholesale_close_event">
|
||||
<icon type="clear" size="20"></icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="plugins-wholesale-container">
|
||||
<block v-if="(plugins_wholesale_data || null) != null">
|
||||
<text v-if="(plugins_wholesale_data.spec_tips || null) != null" class="spec-tips pa round">{{plugins_wholesale_data.spec_tips}}</text>
|
||||
<view class="oh">
|
||||
<block v-for="(item, index) in plugins_wholesale_data.rules" :key="index">
|
||||
<view class="item padding-main bg-white border-radius-main oh dis-inline-block tc">
|
||||
<text class="cr-base">{{item.arr.msg}}</text>
|
||||
<text class="margin-left-sm cr-main fw-b text-size-lg">{{item.arr.val}}</text>
|
||||
<text class="cr-grey margin-left-xs">{{item.arr.unit}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cr-grey tc padding-top-xl padding-bottom-xxxl">无批发信息</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 优惠券弹层 -->
|
||||
<component-popup :prop-show="popup_coupon_status" prop-position="bottom" @onclose="popup_coupon_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-base">
|
||||
|
|
@ -388,7 +426,7 @@
|
|||
<icon type="clear" size="20"></icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coupon-container padding-bottom-main">
|
||||
<view class="plugins-coupon-container padding-bottom-main">
|
||||
<block v-if="(plugins_coupon_data || null) != null && plugins_coupon_data.data.length > 0">
|
||||
<block v-for="(item, index) in plugins_coupon_data.data" :key="index">
|
||||
<view :class="'item bg-white border-radius-main ' + (item.is_operable == 0 ? 'item-disabled' : '')">
|
||||
|
|
@ -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
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue