批发,批量下单优化
parent
8612cffa90
commit
1cc83bc4d5
6
App.vue
6
App.vue
|
|
@ -7,12 +7,10 @@
|
|||
data: {
|
||||
// 基础配置
|
||||
// 数据接口请求地址
|
||||
request_url: 'https://new.shopxo.vip/',
|
||||
// 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: 'https://new.shopxo.vip/',
|
||||
static_url: 'http://shopxo.com/',
|
||||
|
||||
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
|
||||
system_type: 'default',
|
||||
|
|
|
|||
|
|
@ -7,15 +7,20 @@
|
|||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="plugins-batchbuy-container oh">
|
||||
<block v-if="(goods || null) != null && (batchbuy_data || null) != null && (batchbuy_data.goods_spec_data || null) != null && batchbuy_data.goods_spec_data.length > 0">
|
||||
<view class="plugins-batchbuy-container">
|
||||
<!-- 批发规则 -->
|
||||
<view v-if="(plugins_wholesale_data || null) != null" class="padding-main br-b-f5">
|
||||
<component-wholesale-rules :propCurrencySymbol="propCurrencySymbol" :propData="plugins_wholesale_data"></component-wholesale-rules>
|
||||
</view>
|
||||
<!-- 下单规格选择 -->
|
||||
<view v-if="(goods || null) != null && (batchbuy_data || null) != null && (batchbuy_data.goods_spec_data || null) != null && batchbuy_data.goods_spec_data.length > 0" :class="'spec-data-content oh '+((plugins_wholesale_data || null) != null ? 'wholesale' : '')">
|
||||
<block v-if="batchbuy_data.is_only_level_one == 0">
|
||||
<view class="left-nav pa bg-base">
|
||||
<view class="left-nav ht-auto bg-base fl">
|
||||
<scroll-view :scroll-y="true" class="ht-auto">
|
||||
<block v-for="(item, index) in batchbuy_data.goods_spec_data" :key="index">
|
||||
<view :class="'padding-top-xxl padding-bottom-xxl tc cp oh pr ' + (nav_active_index == index ? 'bg-white cr-main' : '')" :data-index="index" @tap="nav_event">
|
||||
<image v-if="(item.images || null) != null" class="dis-inline-block va-m radius margin-right spec-images" :src="item.images" mode="widthFix"></image>
|
||||
<text class="text-size-xs cr-base va-m">{{ item.name }}</text>
|
||||
<view :class="'padding-vertical-main tc cp oh pr ' + (nav_active_index == index ? 'bg-white cr-main' : '')" :data-index="index" @tap="nav_event">
|
||||
<image v-if="(item.images || null) != null" class="dis-inline-block br-f5 radius dis-block spec-images" :src="item.images" mode="widthFix"></image>
|
||||
<view class="cr-base">{{ item.name }}</view>
|
||||
<view v-if="(item.badge_total || 0) > 0" class="badge-icon pa">
|
||||
<component-badge :propNumber="item.badge_total"></component-badge>
|
||||
</view>
|
||||
|
|
@ -23,15 +28,16 @@
|
|||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="right-conent ht-auto fr padding-main bs-bb">
|
||||
<view class="right-conent ht-auto bs-bb fr">
|
||||
<scroll-view :scroll-y="true" class="ht-auto">
|
||||
<block v-for="(item, index) in batchbuy_data.goods_spec_data[nav_active_index]['data']" :key="index">
|
||||
<view :class="'oh padding-vertical-main ' + (index > 0 ? 'br-t' : '')">
|
||||
<view class="padding-main oh">
|
||||
<view class="fl item-left">
|
||||
<view class="text-size-xs">{{ item.name }}</view>
|
||||
<view class="sales-price text-size-xs">{{ currency_symbol }}{{ item.base.price }}</view>
|
||||
<view class="sales-price text-size-xs">{{ propCurrencySymbol }}{{ item.base.price }}</view>
|
||||
</view>
|
||||
<view class="tc oh round fr item-right text-size-xs">
|
||||
<text v-if="(item.base.inventory || 0) == 0" class="fr text-size-xs cr-grey">{{$t('goods-batch-buy.goods-batch-buy.dsfd98')}}</text>
|
||||
<view v-else class="tc oh round fr item-right text-size-xs">
|
||||
<view @tap="batchbuy_goods_buy_number_event" class="number-submit tc cr-grey fl va-m" data-type="0" :data-index="index">-</view>
|
||||
<input @blur="batchbuy_goods_buy_number_blur" class="tc cr-grey bg-white fl va-m radius-0" type="number" :value="item.buy_number || 0" :data-index="index" />
|
||||
<view @tap="batchbuy_goods_buy_number_event" class="number-submit tc cr-grey fl va-m" data-type="1" :data-index="index">+</view>
|
||||
|
|
@ -45,15 +51,16 @@
|
|||
<view class="right-conent ht-auto padding-main bs-bb right-conent-only-level-one">
|
||||
<scroll-view :scroll-y="true" class="ht-auto">
|
||||
<block v-for="(item, index) in batchbuy_data.goods_spec_data" :key="index">
|
||||
<view :class="'oh padding-vertical-main ' + (index > 0 ? 'br-t' : '')">
|
||||
<view class="oh padding-vertical-main">
|
||||
<view class="fl item-left">
|
||||
<view>
|
||||
<image v-if="(item.images || null) != null" class="dis-inline-block va-m radius margin-right spec-images" :src="item.images" mode="widthFix"></image>
|
||||
<image v-if="(item.images || null) != null" class="dis-inline-block va-m br-f5 radius margin-right-sm spec-images" :src="item.images" mode="widthFix"></image>
|
||||
<text class="text-size-xs va-m">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="sales-price text-size-xs">{{ currency_symbol }}{{ item.base.price }}</view>
|
||||
<view class="sales-price text-size-xs margin-top-xs">{{ propCurrencySymbol }}{{ item.base.price }}</view>
|
||||
</view>
|
||||
<view class="tc oh round fr item-right text-size-xs margin-top-xs">
|
||||
<text v-if="(item.base.inventory || 0) == 0" class="fr text-size-xs cr-grey">{{$t('goods-batch-buy.goods-batch-buy.dsfd98')}}</text>
|
||||
<view v-else :class="'tc oh round fr item-right text-size-xs margin-top'+((item.images || null) == null ? 'xs' : '')">
|
||||
<view @tap="batchbuy_goods_buy_number_event" class="number-submit tc cr-grey fl va-m" data-type="0" :data-index="index">-</view>
|
||||
<input @blur="batchbuy_goods_buy_number_blur" class="tc cr-grey bg-white fl va-m radius-0" type="number" :value="item.buy_number || 0" :data-index="index" />
|
||||
<view @tap="batchbuy_goods_buy_number_event" class="number-submit tc cr-grey fl va-m" data-type="1" :data-index="index">+</view>
|
||||
|
|
@ -63,7 +70,7 @@
|
|||
</scroll-view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="confirm-submit pa wh-auto bottom-line-exclude bg-white padding-top-main">
|
||||
<view class="confirm-submit pa wh-auto bottom-line-exclude bg-white padding-top-main br-t-f5">
|
||||
<view class="oh padding-horizontal-main padding-bottom-main cr-grey">
|
||||
<text class="text-size-xs">
|
||||
<text>{{$t('buy.buy.g2vt78')}}</text>
|
||||
|
|
@ -72,7 +79,7 @@
|
|||
<text class="cr-red padding-left-xs padding-right-xs">{{ base_data.quantity }}</text>
|
||||
<text>{{ goods.inventory_unit }}</text>
|
||||
</text>
|
||||
<text class="text-size-xs fr">{{$t('goods-batch-buy.goods-batch-buy.geq82x')}}<text class="fw-b sales-price">{{ currency_symbol }}{{ base_data.amount_money }}</text></text>
|
||||
<text class="text-size-xs fr">{{$t('goods-batch-buy.goods-batch-buy.geq82x')}}<text class="fw-b sales-price">{{ propCurrencySymbol }}{{ base_data.amount_money }}</text></text>
|
||||
</view>
|
||||
<view v-if="(opt_button || null) != null && opt_button.length > 0" class="padding-bottom-main">
|
||||
<view :class="'oh buy-nav-btn-number-' + (opt_button.length || 0)">
|
||||
|
|
@ -84,7 +91,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="cr-grey tc padding-top-xl padding-bottom-xxxl">{{$t('goods-batch-buy.goods-batch-buy.ypby1k')}}</view>
|
||||
</block>
|
||||
|
|
@ -95,14 +102,14 @@
|
|||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import base64 from "../../common/js/lib/base64.js";
|
||||
import base64 from "@/common/js/lib/base64.js";
|
||||
import componentPopup from "@/components/popup/popup";
|
||||
import componentBadge from "../../components/badge/badge";
|
||||
import componentBadge from "@/components/badge/badge";
|
||||
import componentWholesaleRules from '@/components/wholesale-rules/wholesale-rules';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
popup_status: false,
|
||||
nav_active_index: 0,
|
||||
goods: null,
|
||||
|
|
@ -114,25 +121,48 @@ export default {
|
|||
quantity: 0,
|
||||
amount_money: "0.00",
|
||||
},
|
||||
// 批发数据
|
||||
plugins_wholesale_data: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentPopup,
|
||||
componentBadge,
|
||||
componentWholesaleRules
|
||||
},
|
||||
|
||||
props: {
|
||||
// 价格符号
|
||||
propCurrencySymbol: {
|
||||
type: String,
|
||||
default: app.globalData.currency_symbol(),
|
||||
},
|
||||
// 批发数据
|
||||
propPluginsWholesaleData: {
|
||||
type: [Array, Object],
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
|
||||
created: function () {},
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
this.setData({
|
||||
plugins_wholesale_data: this.propPluginsWholesaleData,
|
||||
});
|
||||
console.log(this.plugins_wholesale_data)
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init(goods = null, batchbuy_data = null, buy_button = null, back_data = null) {
|
||||
init(params = {}) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 购买按钮处理,仅展示购买和购物车
|
||||
var opt_button = [];
|
||||
var buy_button = params.buy_button || null;
|
||||
if(buy_button != null && (buy_button.data || null) != null && buy_button.data.length > 0) {
|
||||
var arr = ['plugins-batchbuy-button-cart', 'plugins-batchbuy-button-buy'];
|
||||
for(var i in buy_button.data) {
|
||||
|
|
@ -145,10 +175,11 @@ export default {
|
|||
// 设置数据
|
||||
this.setData({
|
||||
popup_status: true,
|
||||
goods: goods || null,
|
||||
batchbuy_data: batchbuy_data || null,
|
||||
opt_button: opt_button,
|
||||
back_data: back_data,
|
||||
goods: params.goods || null,
|
||||
batchbuy_data: params.batchbuy_data || null,
|
||||
back_data: params.back_data || null,
|
||||
plugins_wholesale_data: params.plugins_wholesale_data || null
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -299,8 +330,14 @@ export default {
|
|||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var plugins_wholesale_data = null;
|
||||
res.data.data.forEach((item) => {
|
||||
if (item.code == 0) {
|
||||
// 批发数据
|
||||
if((item.data.plugins_wholesale_data || null) != null && temp_spec_data.base_id == item.data.spec_base.id) {
|
||||
plugins_wholesale_data = item.data.plugins_wholesale_data;
|
||||
}
|
||||
// 规格数据处理
|
||||
for (var i1 in temp_data.goods_spec_data) {
|
||||
if (parseInt(temp_data.is_only_level_one || 0) == 1) {
|
||||
if (temp_data.goods_spec_data[i1].base.id == item.data.spec_base.id) {
|
||||
|
|
@ -322,6 +359,15 @@ export default {
|
|||
});
|
||||
this.setData({
|
||||
batchbuy_data: temp_data,
|
||||
plugins_wholesale_data: plugins_wholesale_data,
|
||||
});
|
||||
|
||||
// 调用父级
|
||||
this.$emit("BatchStockSuccessEvent", {
|
||||
current_spec: temp_spec_data,
|
||||
goods_data: goods_data,
|
||||
back_data: res.data.data,
|
||||
plugins_wholesale_data: plugins_wholesale_data,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
|
|
@ -431,25 +477,28 @@ export default {
|
|||
</script>
|
||||
<style>
|
||||
.plugins-batchbuy-container {
|
||||
height: 60vh;
|
||||
height: 70vh;
|
||||
padding-bottom: 160rpx;
|
||||
}
|
||||
.plugins-batchbuy-container .spec-data-content {
|
||||
height: calc(100% - 15rpx);
|
||||
}
|
||||
.plugins-batchbuy-container .spec-data-content.wholesale {
|
||||
height: calc(100% - 160rpx);
|
||||
}
|
||||
.plugins-batchbuy-container .left-nav {
|
||||
width: 200rpx;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: calc(100% - 160rpx);
|
||||
}
|
||||
.plugins-batchbuy-container .left-nav .badge-icon {
|
||||
top: 8rpx;
|
||||
right: 36rpx;
|
||||
}
|
||||
.plugins-batchbuy-container .left-nav .spec-images {
|
||||
width: 50rpx;
|
||||
height: 50rpx !important;
|
||||
width: 100rpx;
|
||||
height: 100rpx !important;
|
||||
}
|
||||
.plugins-batchbuy-container .right-conent {
|
||||
width: calc(100% - 200rpx);
|
||||
width: calc(100% - 210rpx);
|
||||
}
|
||||
.plugins-batchbuy-container .right-conent .item-left {
|
||||
width: calc(100% - 290rpx);
|
||||
|
|
@ -475,8 +524,8 @@ export default {
|
|||
width: 100%;
|
||||
}
|
||||
.plugins-batchbuy-container .right-conent-only-level-one .spec-images {
|
||||
width: 34rpx;
|
||||
height: 34rpx !important;
|
||||
width: 100rpx;
|
||||
height: 100rpx !important;
|
||||
}
|
||||
.plugins-batchbuy-container .confirm-submit {
|
||||
left: 0;
|
||||
|
|
|
|||
|
|
@ -567,6 +567,17 @@
|
|||
goods_spec_base_buy_max_number: spec_buy_max_number,
|
||||
buy_number: buy_number,
|
||||
});
|
||||
|
||||
// 调用父级
|
||||
this.$emit("BackSuccessEvent", {
|
||||
buy_number: this.buy_number,
|
||||
base_price: this.goods_spec_base_price,
|
||||
base_original_price: this.goods_spec_base_original_price,
|
||||
base_inventory: this.goods_spec_base_inventory,
|
||||
base_buy_min_number: this.goods_spec_base_buy_min_number,
|
||||
base_buy_max_number: this.goods_spec_base_buy_max_number,
|
||||
back_data: data
|
||||
});
|
||||
},
|
||||
|
||||
// 已选的商品规格
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 批发规则展示 -->
|
||||
<view v-if="(data || null) != null" class="scroll-view-horizontal">
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="plugins-wholesale-container-rules-view wh-auto" @tap="popup_wholesale_event">
|
||||
<view v-for="(item, index) in data.rules" :key="index" class="item">
|
||||
<view class="price">
|
||||
<text v-if="item.arr.type == 1" class="cr-red text-size-xs">{{propCurrencySymbol}}</text>
|
||||
<text class="sales-price text-size-lg">{{item.range_val}}</text>
|
||||
<text v-if="item.arr.type == 0" class="unit text-size-xsss">{{item.arr.unit}}</text>
|
||||
</view>
|
||||
<view class="msg cr-black text-size-sm cr-base margin-top-xs">{{item.range_msg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 批发规则弹层 -->
|
||||
<block v-if="propIsPopup">
|
||||
<component-popup :propShow="popup_status" propPosition="bottom" @onclose="popup_wholesale_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="close oh">
|
||||
<view class="fr" @tap.stop="popup_wholesale_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="plugins-wholesale-container-rules">
|
||||
<block v-if="(data || null) != null">
|
||||
<view class="oh flex-row flex-warp">
|
||||
<block v-for="(item, index) in data.rules" :key="index">
|
||||
<view class="item flex-width-half margin-bottom">
|
||||
<view class="item-content padding-main bg-base border-radius-main oh tc">
|
||||
<text class="cr-base">{{ item.range_msg }}</text>
|
||||
<text v-if="item.arr.type == 1" class="cr-main text-size-xs">{{propCurrencySymbol}}</text>
|
||||
<text class="cr-main fw-b text-size-lg">{{ item.range_val }}</text>
|
||||
<text v-if="item.arr.type == 0" class="cr-grey text-size-xsss">{{ item.arr.unit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cr-grey tc padding-top-xl padding-bottom-xxxl">{{$t('goods-detail.goods-detail.m3op38')}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentPopup from "@/components/popup/popup";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data: null,
|
||||
popup_status: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentPopup
|
||||
},
|
||||
props: {
|
||||
// 是否展示弹窗
|
||||
propIsPopup: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 价格符号
|
||||
propCurrencySymbol: {
|
||||
type: String,
|
||||
default: app.globalData.currency_symbol(),
|
||||
},
|
||||
// 列表数据
|
||||
propData: {
|
||||
type: [Array, Object, String],
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
// 属性值改变监听
|
||||
watch: {
|
||||
// 数据
|
||||
propData(value, old_value) {
|
||||
this.setData({
|
||||
data: value,
|
||||
});
|
||||
console.log(value)
|
||||
}
|
||||
},
|
||||
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
this.setData({
|
||||
data: this.propData,
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 批发开启弹层
|
||||
popup_wholesale_event(e) {
|
||||
if(this.propIsPopup) {
|
||||
this.setData({
|
||||
popup_status: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 批发弹层关闭
|
||||
popup_wholesale_close_event(e) {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
/**
|
||||
* 批发 - 插件
|
||||
*/
|
||||
.plugins-wholesale-container-rules-view {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
gap: 60rpx;
|
||||
}
|
||||
.plugins-wholesale-container-rules-view .item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.plugins-wholesale-container-rules-view .item .price > .unit {
|
||||
border: 0.05rem solid #cdcdcd;
|
||||
color: #969696;
|
||||
border-radius: 50%;
|
||||
padding: 1rpx 6rpx;
|
||||
vertical-align: middle;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
.plugins-wholesale-container-rules {
|
||||
max-height: 50vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.plugins-wholesale-container-rules .item:nth-child(2n)>.item-content {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.plugins-wholesale-container-rules .item:nth-child(2n+1)>.item-content {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.plugins-wholesale-container-rules .spec-tips {
|
||||
color: #ffbf00;
|
||||
border: 1px solid #333;
|
||||
background: #333;
|
||||
padding: 2rpx 10rpx;
|
||||
top: 22rpx;
|
||||
left: 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1547,7 +1547,8 @@
|
|||
"9ectyf": "species",
|
||||
"geq82x": "Amount:",
|
||||
"ypby1k": "No relevant information available",
|
||||
"7tp1tc": "Incorrect operation event type"
|
||||
"7tp1tc": "Incorrect operation event type",
|
||||
"dsfd98": "Out of stock"
|
||||
}
|
||||
},
|
||||
"goods-buy": {
|
||||
|
|
|
|||
|
|
@ -1539,7 +1539,8 @@
|
|||
"9ectyf": "种",
|
||||
"geq82x": "金额:",
|
||||
"ypby1k": "无相关信息",
|
||||
"7tp1tc": "操作事件类型有误"
|
||||
"7tp1tc": "操作事件类型有误",
|
||||
"dsfd98": "无库存"
|
||||
}
|
||||
},
|
||||
"goods-buy": {
|
||||
|
|
|
|||
|
|
@ -522,54 +522,6 @@
|
|||
font-size: 46rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批发 - 插件
|
||||
*/
|
||||
.plugins-wholesale-container-view {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.plugins-wholesale-container-view .item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.plugins-wholesale-container-view .item .price > .unit {
|
||||
border: 0.05rem solid #cdcdcd;
|
||||
color: #969696;
|
||||
border-radius: 50%;
|
||||
padding: 1rpx 6rpx;
|
||||
vertical-align: top;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
.plugins-wholesale-container-view .spec-tips {
|
||||
color: #ffefc0;
|
||||
border: 1rpx solid #ff9800;
|
||||
background: #FF9800;
|
||||
padding: 0 16rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.plugins-wholesale-container {
|
||||
max-height: 50vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.plugins-wholesale-container .item:nth-child(2n)>view {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.plugins-wholesale-container .item:nth-child(2n+1)>view {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.plugins-wholesale-container .spec-tips {
|
||||
color: #ffbf00;
|
||||
border: 1px solid #333;
|
||||
background: #333;
|
||||
padding: 2rpx 10rpx;
|
||||
top: 22rpx;
|
||||
left: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签 - 插件
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -80,36 +80,34 @@
|
|||
|
||||
<!-- 价格信息 -->
|
||||
<view class="goods-base-price bg-white oh spacing-mb" :class="(plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1 ? 'goods-base-price-countdown' : ''">
|
||||
<!-- 批发规则、未隐藏商品售价的时候独立行展示 -->
|
||||
<view v-if="(plugins_wholesale_data || null) != null && (plugins_wholesale_data.is_hide_goods_price || 0) != 1" class="padding-horizontal-main padding-top-main">
|
||||
<component-wholesale-rules :propIsPopup="true" :propCurrencySymbol="currency_symbol" :propData="plugins_wholesale_data"></component-wholesale-rules>
|
||||
</view>
|
||||
<!-- 价格 -->
|
||||
<view class="price-content padding-vertical-main padding-left-main bs-bb fl" :style="(plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1 ? 'background-image: url(' + plugins_seckill_data.goods_detail_header + ')' : ''">
|
||||
<!-- 批发 -->
|
||||
<block v-if="(plugins_wholesale_data || null) != null">
|
||||
<view class="plugins-wholesale-container-view wh-auto item" @tap="popup_wholesale_event">
|
||||
<view v-for="(item, index) in plugins_wholesale_data.rules" :key="index" class="item">
|
||||
<view class="price">
|
||||
<text v-if="item.arr.type == 1" class="cr-red text-size-xs">{{currency_symbol}}</text>
|
||||
<text class="sales-price">{{item.range_val}}</text>
|
||||
<text v-if="item.arr.type == 0" class="unit text-size-xsss">{{item.arr.unit}}</text>
|
||||
</view>
|
||||
<view class="msg cr-black text-size-sm cr-grey">{{item.range_msg}}</view>
|
||||
</view>
|
||||
<!-- 批发规则、隐藏商品售价的时候在这里展示 -->
|
||||
<view v-if="(plugins_wholesale_data || null) != null && (plugins_wholesale_data.is_hide_goods_price || 0) == 1" class="item">
|
||||
<component-wholesale-rules :propIsPopup="true" :propCurrencySymbol="currency_symbol" :propData="plugins_wholesale_data"></component-wholesale-rules>
|
||||
</view>
|
||||
<!-- 批发插件是否开启隐藏价格信息 -->
|
||||
<block v-if="(plugins_wholesale_data || null) == null || (plugins_wholesale_data.is_hide_goods_price || 0) != 1">
|
||||
<!-- 售价 -->
|
||||
<view v-if="(goods.show_field_price_status || 0) == 1" class="item single-text">
|
||||
<!-- 图标 -->
|
||||
<text v-if="(show_field_price_text || null) != null" :class="'price-icon round va-m margin-right-xs '+(((plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1) ? 'seckill' : '')">{{ show_field_price_text }}</text>
|
||||
<!-- 售价 -->
|
||||
<text class="sales-price va-m">{{ goods.show_price_symbol }}{{ goods_spec_base_price }}</text>
|
||||
<text class="text-size-xs cr-grey va-m">{{ goods.show_price_unit }}</text>
|
||||
</view>
|
||||
<!-- 原价 -->
|
||||
<view v-if="(goods.show_field_original_price_status || 0) == 1 && (goods_spec_base_original_price || null) != null && goods_spec_base_original_price != 0" class="item original-price single-text">{{ goods.show_original_price_symbol }}{{ goods_spec_base_original_price }}{{ goods.show_original_price_unit }}</view>
|
||||
<!-- 积分兑换 -->
|
||||
<view v-if="(goods.plugins_points_data || null) != null && (goods.plugins_points_data.is_goods_detail_show || 0) == 1" class="item">
|
||||
<text class="text-size-lg cr-base va-m">{{ goods.plugins_points_data.points_value }}</text>
|
||||
<text class="text-size-xs cr-grey va-m margin-left-xs">{{goods.plugins_points_data.points_unit}}</text>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 售价 -->
|
||||
<view v-if="(goods.show_field_price_status || 0) == 1" class="item single-text">
|
||||
<!-- 图标 -->
|
||||
<text v-if="(show_field_price_text || null) != null" :class="'price-icon round va-m margin-right-xs '+(((plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1) ? 'seckill' : '')">{{ show_field_price_text }}</text>
|
||||
<!-- 售价 -->
|
||||
<text class="sales-price va-m">{{ goods.show_price_symbol }}{{ goods_spec_base_price }}</text>
|
||||
<text class="text-size-xs cr-grey va-m">{{ goods.show_price_unit }}</text>
|
||||
</view>
|
||||
<!-- 原价 -->
|
||||
<view v-if="(goods.show_field_original_price_status || 0) == 1 && (goods_spec_base_original_price || null) != null && goods_spec_base_original_price != 0" class="item original-price single-text">{{ goods.show_original_price_symbol }}{{ goods_spec_base_original_price }}{{ goods.show_original_price_unit }}</view>
|
||||
<!-- 积分兑换 -->
|
||||
<view v-if="(goods.plugins_points_data || null) != null && (goods.plugins_points_data.is_goods_detail_show || 0) == 1" class="item">
|
||||
<text class="text-size-lg cr-base va-m">{{ goods.plugins_points_data.points_value }}</text>
|
||||
<text class="text-size-xs cr-grey va-m margin-left-xs">{{goods.plugins_points_data.points_unit}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="(plugins_seckill_data || null) != null && plugins_seckill_data.time.status == 1">
|
||||
<view class="countdown-content padding-top-lg padding-bottom-lg padding-left-xs padding-right-xs fr tc">
|
||||
|
|
@ -499,36 +497,6 @@
|
|||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 批发弹层 -->
|
||||
<component-popup :propShow="popup_wholesale_status" propPosition="bottom" @onclose="popup_wholesale_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="close oh">
|
||||
<view class="fr" @tap.stop="popup_wholesale_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</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 flex-row flex-warp">
|
||||
<block v-for="(item, index) in plugins_wholesale_data.rules" :key="index">
|
||||
<view class="item flex-width-half margin-bottom">
|
||||
<view class="padding-main bg-base border-radius-main oh tc">
|
||||
<text class="cr-base">{{ item.range_msg }}</text>
|
||||
<text class="margin-left-sm cr-main fw-b text-size-lg">{{ item.range_val }}</text>
|
||||
<text class="cr-grey margin-left-xs">{{ item.arr.unit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cr-grey tc padding-top-xl padding-bottom-xxxl">{{$t('goods-detail.goods-detail.m3op38')}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 优惠券弹层 -->
|
||||
<component-popup :propShow="popup_coupon_status" propPosition="bottom" @onclose="popup_coupon_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
|
|
@ -612,7 +580,7 @@
|
|||
<component-share-popup ref="share"></component-share-popup>
|
||||
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy ref="goods_buy" :propParams="params" :propCurrencySymbol="currency_symbol" v-on:CartSuccessEvent="goods_cart_back_event" v-on:SpecChoiceEvent="goods_spec_back_event"></component-goods-buy>
|
||||
<component-goods-buy ref="goods_buy" :propParams="params" :propCurrencySymbol="currency_symbol" v-on:BackSuccessEvent="goods_buy_back_success_event" v-on:CartSuccessEvent="goods_cart_back_event" v-on:SpecChoiceEvent="goods_spec_back_event"></component-goods-buy>
|
||||
|
||||
<!-- 商品批量下单 -->
|
||||
<component-goods-batch-buy ref="goods_batch_buy" v-on:BatchCartSuccessEvent="batch_goods_cart_back_event"></component-goods-batch-buy>
|
||||
|
|
@ -641,6 +609,7 @@
|
|||
import componentCouponCard from '@/components/coupon-card/coupon-card';
|
||||
import componentRealstoreCart from '@/components/realstore-cart/realstore-cart';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
import componentWholesaleRules from '@/components/wholesale-rules/wholesale-rules';
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
var ask_static_url = app.globalData.get_static_url('ask', true) + 'app/';
|
||||
|
|
@ -751,9 +720,6 @@
|
|||
plugins_salerecords_tips_ent: '',
|
||||
// 多商户插件
|
||||
plugins_shop_data: null,
|
||||
// 批发插件
|
||||
plugins_wholesale_data: null,
|
||||
popup_wholesale_status: false,
|
||||
// 标签插件
|
||||
plugins_label_data: null,
|
||||
// 智能工具插件
|
||||
|
|
@ -794,7 +760,8 @@
|
|||
componentAskCommentsGoods,
|
||||
componentCouponCard,
|
||||
componentRealstoreCart,
|
||||
componentGoodsList
|
||||
componentGoodsList,
|
||||
componentWholesaleRules
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
|
|
@ -1179,7 +1146,7 @@
|
|||
// 商品批量下单-加入购物车
|
||||
case 'plugins-batchbuy-button-cart':
|
||||
if ((this.$refs.goods_batch_buy || null) != null) {
|
||||
this.$refs.goods_batch_buy.init(this.goods, this.plugins_batchbuy_data, this.buy_button);
|
||||
this.$refs.goods_batch_buy.init({goods: this.goods, batchbuy_data: this.plugins_batchbuy_data, buy_button: this.buy_button, plugins_wholesale_data: this.plugins_wholesale_data});
|
||||
}
|
||||
break;
|
||||
// 默认
|
||||
|
|
@ -1188,6 +1155,15 @@
|
|||
}
|
||||
},
|
||||
|
||||
// 数量和规格详情回调成功
|
||||
goods_buy_back_success_event(e) {
|
||||
if((e.back_data.plugins_wholesale_data || null) != null) {
|
||||
this.setData({
|
||||
plugins_wholesale_data: e.back_data.plugins_wholesale_data
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 加入购物车成功回调
|
||||
goods_cart_back_event(e) {
|
||||
this.goods_spec_back_event(e);
|
||||
|
|
@ -1449,20 +1425,6 @@
|
|||
});
|
||||
},
|
||||
|
||||
// 批发开启弹层
|
||||
popup_wholesale_event(e) {
|
||||
this.setData({
|
||||
popup_wholesale_status: true,
|
||||
});
|
||||
},
|
||||
|
||||
// 批发弹层关闭
|
||||
popup_wholesale_close_event(e) {
|
||||
this.setData({
|
||||
popup_wholesale_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 商品服务开启弹层
|
||||
popup_goodsservice_event(e) {
|
||||
this.setData({
|
||||
|
|
|
|||
|
|
@ -488,11 +488,11 @@
|
|||
// 获取数据
|
||||
init(params = {}) {
|
||||
// 还没有数据则读取缓存
|
||||
var cache_key = app.globalData.data.cache_index_data_key;
|
||||
if(this.load_status == 0)
|
||||
{
|
||||
// 本地缓存数据
|
||||
var key = app.globalData.data.cache_index_data_key;
|
||||
var upd_data = uni.getStorageSync(key) || null;
|
||||
var upd_data = uni.getStorageSync(cache_key) || null;
|
||||
if(upd_data != null) {
|
||||
// 先使用缓存数据展示
|
||||
this.setData(upd_data);
|
||||
|
|
@ -556,7 +556,7 @@
|
|||
this.setData(upd_data);
|
||||
|
||||
// 存储缓存
|
||||
uni.setStorageSync(key, upd_data);
|
||||
uni.setStorageSync(cache_key, upd_data);
|
||||
|
||||
// 弹屏广告插件处理
|
||||
this.plugins_popupscreen_handle();
|
||||
|
|
|
|||
Loading…
Reference in New Issue