feat: 新增多语言国际化页面配置,修复部分页面硬编码文案
1. 新增了zh-cn和en-us两套语言下的大量页面国际化配置文件,覆盖商品、订单、会员、营销活动等多个业务模块 2. 修复了分销页面、VR页面、支付页面、商品不存在页面的硬编码提示文案,替换为国际化调用 3. 删除了原有的i18n检查脚本文件
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,125 +1,125 @@
|
||||
<template>
|
||||
<!-- 当前商品参与的营销活动入口 -->
|
||||
<view class="ns-goods-promotion" v-if="goodsPromotion.length">
|
||||
<view v-for="(item, index) in goodsPromotion" v-if="promotion != item.promotion_type" :key="index">
|
||||
<view v-if="item.promotion_type == 'discount'" class="item" @click="redirectTo('/pages_goods/detail', { goods_id: item.goods_id })">
|
||||
<text class="promotion-mark ">{{ $lang("goods._components.ns-goods-promotion.l6.t0") }}</text>
|
||||
<text class="title">{ $lang("goods._components.ns-goods-promotion.l7.t0") } item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { groupbuy_id: item.groupbuy_id })">
|
||||
<!-- <view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { id: item.groupbuy_id })"> -->
|
||||
<text class="promotion-mark ">{{ $lang("goods._components.ns-goods-promotion.l13.t0") }}</text>
|
||||
<text class="title">{ $lang("goods._components.ns-goods-promotion.l7.t0") } item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'pintuan'" class="item" @click="redirectTo('/pages_promotion/pintuan/detail', { pintuan_id: item.pintuan_id })">
|
||||
<text class="promotion-mark ">{{ $lang("goods._components.ns-goods-promotion.l19.t0") }}</text>
|
||||
<text class="title">{ $lang("goods._components.ns-goods-promotion.l7.t0") } item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'seckill'" class="item" @click="redirectTo('/pages_promotion/seckill/detail', { seckill_id: item.id })">
|
||||
<text class="promotion-mark ">{{ $lang("goods._components.ns-goods-promotion.l25.t0") }}</text>
|
||||
<text class="title">{ $lang("goods._components.ns-goods-promotion.l7.t0") } item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'topic'" class="item" @click="redirectTo('/pages_promotion/topics/goods_detail', { id: item.id })">
|
||||
<text class="promotion-mark ">{{ $lang("goods._components.ns-goods-promotion.l31.t0") }}</text>
|
||||
<text class="title">{ $lang("goods._components.ns-goods-promotion.l7.t0") } item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'bargain'" class="item" @click="redirectTo('/pages_promotion/bargain/detail', { b_id: item.bargain_id })">
|
||||
<text class="promotion-mark ">{{ $lang("goods._components.ns-goods-promotion.l37.t0") }}</text>
|
||||
<text class="title">{ $lang("goods._components.ns-goods-promotion.l7.t0") } item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'pinfan'" class="item" @click="redirectTo('/pages_promotion/pinfan/detail', { pinfan_id: item.pintuan_id })">
|
||||
<text class="promotion-mark ">{{ $lang("goods._components.ns-goods-promotion.l43.t0") }}</text>
|
||||
<text class="title">{ $lang("goods._components.ns-goods-promotion.l7.t0") } item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ns-goods-promotion',
|
||||
props: {
|
||||
promotion: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
goodsPromotion: {
|
||||
type: Array
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
refresh(goodsPromotion) {
|
||||
this.goodsPromotion = goodsPromotion;
|
||||
},
|
||||
redirectTo(path, param) {
|
||||
this.$util.redirectTo(path, param);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.ns-goods-promotion {
|
||||
background-color: #fff;
|
||||
& > view {
|
||||
}
|
||||
.item {
|
||||
display: flex;
|
||||
font-size: $font-size-base;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.promotion-mark {
|
||||
padding: 12rpx 14rpx;
|
||||
margin-right: 16rpx;
|
||||
line-height: 1;
|
||||
color: var(--main-color);
|
||||
border-radius: 6rpx;
|
||||
font-size: $font-size-tag;
|
||||
font-weight: bold;
|
||||
background-color: var(--main-color-shallow);
|
||||
}
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.img-wrap {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<!-- 当前商品参与的营销活动入口 -->
|
||||
<view class="ns-goods-promotion" v-if="goodsPromotion.length">
|
||||
<view v-for="(item, index) in goodsPromotion" v-if="promotion != item.promotion_type" :key="index">
|
||||
<view v-if="item.promotion_type == 'discount'" class="item" @click="redirectTo('/pages_goods/detail', { goods_id: item.goods_id })">
|
||||
<text class="promotion-mark ">限时折扣</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { groupbuy_id: item.groupbuy_id })">
|
||||
<!-- <view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { id: item.groupbuy_id })"> -->
|
||||
<text class="promotion-mark ">团购</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'pintuan'" class="item" @click="redirectTo('/pages_promotion/pintuan/detail', { pintuan_id: item.pintuan_id })">
|
||||
<text class="promotion-mark ">拼团</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'seckill'" class="item" @click="redirectTo('/pages_promotion/seckill/detail', { seckill_id: item.id })">
|
||||
<text class="promotion-mark ">秒杀</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'topic'" class="item" @click="redirectTo('/pages_promotion/topics/goods_detail', { id: item.id })">
|
||||
<text class="promotion-mark ">专题活动</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'bargain'" class="item" @click="redirectTo('/pages_promotion/bargain/detail', { b_id: item.bargain_id })">
|
||||
<text class="promotion-mark ">砍价</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
|
||||
</view>
|
||||
<view v-else-if="item.promotion_type == 'pinfan'" class="item" @click="redirectTo('/pages_promotion/pinfan/detail', { pinfan_id: item.pintuan_id })">
|
||||
<text class="promotion-mark ">拼团返利</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ns-goods-promotion',
|
||||
props: {
|
||||
promotion: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
goodsPromotion: {
|
||||
type: Array
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
refresh(goodsPromotion) {
|
||||
this.goodsPromotion = goodsPromotion;
|
||||
},
|
||||
redirectTo(path, param) {
|
||||
this.$util.redirectTo(path, param);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.ns-goods-promotion {
|
||||
background-color: #fff;
|
||||
& > view {
|
||||
}
|
||||
.item {
|
||||
display: flex;
|
||||
font-size: $font-size-base;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.promotion-mark {
|
||||
padding: 12rpx 14rpx;
|
||||
margin-right: 16rpx;
|
||||
line-height: 1;
|
||||
color: var(--main-color);
|
||||
border-radius: 6rpx;
|
||||
font-size: $font-size-tag;
|
||||
font-weight: bold;
|
||||
background-color: var(--main-color-shallow);
|
||||
}
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.img-wrap {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,390 +1,390 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="container">
|
||||
<scroll-view class="scroll-view" :scroll-y="true" :show-scrollbar="false" :refresher-enabled="true"
|
||||
:refresher-triggered="refresherTriggered" @refresherrefresh="onRefresh">
|
||||
<block v-if="hasData">
|
||||
<view class="cart-header" v-if="cartData.length">
|
||||
<view class="num-wrap">{ $lang("goods.cart.l8") } cartData[0].cartList.length }}种商品</view>
|
||||
<view class="cart-action" @click="changeAction">
|
||||
{{ isAction ? $lang('common.button.confirm') : $lang('common.button.edit') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-wrap" v-for="(siteItem, siteIndex) in cartData" :key="siteIndex">
|
||||
<view class="coupon-use-tips" v-if="discount.coupon_info">
|
||||
<view>
|
||||
<text class="title color-base-text">{{ $lang("diy.diy-coupon.l209.t0") }}</text>
|
||||
<text class="desc">{ $lang("goods.cart.l17") } discount.coupon_info.coupon_money | moneyFormat }}元</text>
|
||||
</view>
|
||||
<view class="color-base-text" @click="$refs.couponPopup.open()">
|
||||
点击{{ discount.coupon_info.receive_type == 'wait' ? '领取' : $lang('diy.diy-listmenu.l15.t0') }}
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="store-wrap"
|
||||
v-if="globalStoreConfig && globalStoreConfig.store_business == 'store' && globalStoreInfo">
|
||||
<text class="iconfont icon-dianpu"></text>
|
||||
<text class="name">{{ globalStoreInfo.store_name }}</text>
|
||||
</view>
|
||||
<block v-for="(item, cartIndex) in siteItem.cartList" :key="cartIndex">
|
||||
<view class="cart-goods" @touchstart="touchS($event)" @touchend="touchE($event, item)">
|
||||
<view class="goods-wrap" :class="{ edit: item.edit }">
|
||||
<view class="iconfont"
|
||||
:class="item.checked ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"
|
||||
@click="singleElection(siteIndex, cartIndex)"></view>
|
||||
<view @click="toGoodsDetail(item)" class="goods-img">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })"
|
||||
@error="imageError(siteIndex, cartIndex)" mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view>
|
||||
<view @click="toGoodsDetail(item)" class="goods-name">{{ isEnEnv ?
|
||||
item.en_goods_name : item.goods_name }}</view>
|
||||
<view class="sku-wrap">
|
||||
<view class="sku">
|
||||
<view class="goods-spec" v-if="item.sku_spec_format.length"
|
||||
@click="selectSku(item)">
|
||||
<block v-for="(x, i) in item.sku_spec_format" :key="i">
|
||||
{{ x.spec_name }}:{{ x.spec_value_name }}
|
||||
{{ i < item.sku_spec_format.length - 1 ? ';' : '' }}
|
||||
</block>
|
||||
</view>
|
||||
<text class="iconfont icon-unfold"
|
||||
v-if="item.sku_spec_format.length"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-sub-section">
|
||||
<block v-if="item.promotion_type == 1">
|
||||
<block
|
||||
v-if="Number(item.member_price) > 0 && Number(item.member_price) < Number(item.discount_price)">
|
||||
<view class="goods-price ">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currency_symbol') }}</text>
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="goods-price ">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currency_symbol') }}</text>
|
||||
{{ parseFloat(item.discount_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image
|
||||
:src="$util.img('public/uniapp/index/discount.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="Number(item.member_price) > 0">
|
||||
<view class="goods-price">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currency_symbol') }}</text>
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="goods-price">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currency_symbol') }}</text>
|
||||
{{ parseFloat(item.price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<uni-number-box :min="item.min_buy > 1 ? item.min_buy : 1"
|
||||
:max="item.max_buy > 0 && item.max_buy < item.stock ? item.max_buy : item.stock"
|
||||
size="small" :value="initNum(item)" :index="item.cart_id"
|
||||
@change="cartNumChange($event, { siteIndex, cartIndex })"
|
||||
@limit="goodsLimit($event, { siteIndex, cartIndex })" />
|
||||
</view>
|
||||
<view class="discount-wrap" v-if="manjian && manjian['sku_' + item.sku_id]">
|
||||
<text class="discount-tag">{{ $lang("goods.cart.l123") }}</text>
|
||||
<scroll-view scroll-x="true" class="scroll-view">
|
||||
<block v-for="(mitem, key) in manjian['sku_' + item.sku_id]" :key="key">
|
||||
<text v-if="mitem.discount_money">{{ Number(mitem.limit) }}减{{
|
||||
mitem.discount_money }}</text>
|
||||
<text class="interval" v-if="mitem.discount_money"></text>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-del color-base-bg" :class="{ show: item.edit }"
|
||||
@click="deleteCart('single', siteIndex, cartIndex)">{{ $lang('common.list.del') }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="cart-wrap invalid" v-if="invalidGoods.length">
|
||||
<view class="cart-header">
|
||||
<view class="num-wrap">
|
||||
<text class="font-size-base">{ $lang("goods.cart.l143") } invalidGoods.length }}件</text>
|
||||
</view>
|
||||
<view class="cart-action color-base-text" @click="clearInvalidGoods">{{ $lang("goods.cart.l145") }}</view>
|
||||
</view>
|
||||
<block v-for="(goodsItem, goodsIndex) in invalidGoods" :key="goodsIndex">
|
||||
<view class="cart-goods invalid-goods">
|
||||
<view class="goods-wrap">
|
||||
<view class="iconfont icon-yuan_checked color-tip"></view>
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ goodsItem.sku_name }}</view>
|
||||
<view>
|
||||
<view class="sku">
|
||||
<view class="goods-spec" v-if="goodsItem.sku_spec_format.length">
|
||||
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
|
||||
{{ x.spec_name }}:{{ x.spec_value_name }}
|
||||
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-sub-section">
|
||||
<view class="goods-price">
|
||||
<text class="bottom-price price-style large">
|
||||
<template
|
||||
v-if="goodsItem.member_price > 0 && goodsItem.member_price < goodsItem.discount_price">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currency_symbol') }}</text>
|
||||
{{ parseFloat(goodsItem.member_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currency_symbol') }}</text>
|
||||
{{ parseFloat(goodsItem.discount_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</template>
|
||||
</text>
|
||||
</view>
|
||||
<text class="invalid-mark">{{ $lang("goods.cart.l192") }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty">
|
||||
<ns-empty text=$lang("goods.cart.l202") subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"
|
||||
:emptyBtn="{ text: $lang('common.empty.goShopping'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken" @click="toLogin">{{
|
||||
$lang('login.list.to_login')
|
||||
}}</button>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
<ns-goods-recommend ref="goodrecommend" route="cart"></ns-goods-recommend>
|
||||
|
||||
<view class="cart-bottom-block"></view>
|
||||
|
||||
<!-- 底部tabBar占位 -->
|
||||
<view class="page-bottom" :style="{ height: tabBarHeight }"></view>
|
||||
</scroll-view>
|
||||
|
||||
<uni-popup ref="discountPopup" custom-class="uni-popup-discount" type="bottom">
|
||||
<view class="discount-popup popup" v-if="Object.keys(discount).length">
|
||||
<view class="popup-header">
|
||||
<text class="tit">{{ $lang("goods.cart.l221") }}</text>
|
||||
<text class="iconfont icon-close" @click="toggleDiscountPopup"></text>
|
||||
</view>
|
||||
<view class="popup-body" :class="{ 'safe-area': isIphoneX }" @click="toggleDiscountPopup">
|
||||
<view class="detail-item">
|
||||
<view class="title">{{ $lang("goods.cart.l226") }}</view>
|
||||
<view class="money price-font">¥{{ discount.goods_money | moneyFormat }}</view>
|
||||
</view>
|
||||
<view class="detail-item" v-if="discount.coupon_money > 0">
|
||||
<view class="title">{{ $lang("diy.diy-coupon.l209.t0") }}</view>
|
||||
<view class="money price-font reduce">-¥{{ discount.coupon_money | moneyFormat }}</view>
|
||||
</view>
|
||||
<view class="detail-item" v-if="discount.promotion_money > 0">
|
||||
<view class="title">{{ $lang("goods.cart.l123") }}</view>
|
||||
<view class="money reduce price-font">-¥{{ discount.promotion_money | moneyFormat }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-item total">
|
||||
<view class="title">{{ $lang("goods.cart.l239") }}</view>
|
||||
<view class="money price-font ">¥{{ discount.order_money | moneyFormat }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ height: tabBarHeight }"></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup ref="couponPopup" custom-class="uni-popup-discount" type="bottom" v-if="discount.coupon_info">
|
||||
<view class="coupon-popup popup">
|
||||
<view class="popup-header">
|
||||
<text class="tit">{{ $lang("diy.diy-coupon.l209.t0") }}</text>
|
||||
<text class="iconfont icon-close" @click="$refs.couponPopup.close()"></text>
|
||||
</view>
|
||||
<view class="popup-body" :class="{ 'safe-area': isIphoneX }" @click="$refs.couponPopup.close()">
|
||||
<view class="coupon-item">
|
||||
<view class="coupon-info"
|
||||
:style="{ backgroundColor: discount.coupon_info.receive_type != 'wait' ? '#F2F2F2' : 'var(--main-color-shallow)' }">
|
||||
<view class="info-wrap">
|
||||
<image class="coupon-line" mode="heightFix"
|
||||
:src="$util.img('public/uniapp/coupon/coupon_line.png')" show-menu-by-longpress/>
|
||||
<view class="coupon-money">
|
||||
<template v-if="discount.coupon_info.type == 'reward'">
|
||||
<text class="unit">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text class="money">{{ parseFloat(discount.coupon_info.money) }}</text>
|
||||
</template>
|
||||
<template v-else-if="discount.coupon_info.type == 'discount'">
|
||||
<text class="money">{{ parseFloat(discount.coupon_info.discount) }}</text>
|
||||
<text class="unit">{{ $lang("common.register-reward.l60.t1") }}</text>
|
||||
</template>
|
||||
<view class="at-least">
|
||||
<template v-if="discount.coupon_info.at_least > 0">
|
||||
满{{ discount.coupon_info.at_least }}可用
|
||||
</template>
|
||||
<template v-else>
|
||||
无门槛
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc-wrap">
|
||||
<view class="coupon-name">{{ discount.coupon_info.coupon_name }}</view>
|
||||
<view
|
||||
v-if="discount.coupon_info.type == 'discount' && discount.coupon_info.discount_limit > 0"
|
||||
class="limit">
|
||||
最多可抵¥{{ discount.coupon_info.discount_limit }}
|
||||
</view>
|
||||
<view class="time font-size-goods-tag"
|
||||
v-if="discount.coupon_info.validity_type == 0">
|
||||
有效期:{{ $util.timeStampTurnTime(discount.coupon_info.end_time) }}
|
||||
</view>
|
||||
<view class="time font-size-goods-tag"
|
||||
v-else-if="discount.coupon_info.validity_type == 1">
|
||||
有效期:领取之日起{{ discount.coupon_info.fixed_term }}天内有效
|
||||
</view>
|
||||
<view class="time font-size-goods-tag" v-else>{{ $lang("goods.cart.l294") }}</view>
|
||||
</view>
|
||||
|
||||
<button type="primary" v-if="discount.coupon_info.receive_type != 'wait'"
|
||||
disabled>{{ $lang("goods.cart.l298") }}</button>
|
||||
<button type="primary" v-else
|
||||
@click.stop="receiveCoupon(discount.coupon_info.coupon_type_id)">{{ $lang("diy.diy-coupon.l71.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ height: tabBarHeight }"></view>
|
||||
<view class="cart-bottom-block"></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<view class="cart-bottom" :style="{ bottom: tabBarHeight }" :class="{ active: isIphoneX }" v-if="hasData">
|
||||
<view class="all-election" @click="allElection">
|
||||
<view class="iconfont" :class="checkAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'">
|
||||
</view>
|
||||
<text>{{ $lang('common.button.select_all') }}</text>
|
||||
</view>
|
||||
<view class="settlement-info" :style="{ visibility: isAction ? 'hidden' : 'visible' }">
|
||||
<view class="money">
|
||||
{{ $lang('cart.list.total') }}:
|
||||
<text class="unit price-font">{{ $lang('common.currency_symbol') }}</text>
|
||||
<block v-if="Object.keys(discount).length">
|
||||
<text class="value price-font">{{ parseFloat(discount.order_money).toFixed(2).split('.')[0]
|
||||
}}</text>
|
||||
<text class="unit price-font">.{{ parseFloat(discount.order_money).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text class="value price-font">{{ parseFloat(totalPrice).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-font">.{{ parseFloat(totalPrice).toFixed(2).split('.')[1] }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="detail" @click="toggleDiscountPopup" v-if="Object.keys(discount).length">
|
||||
优惠明细
|
||||
<text class="iconfont icon-unfold" :class="{ open: !discountPopupShow }"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-btn" v-if="isAction">
|
||||
<button type="primary" size="mini" class="mini" @click="deleteCart('all')">{{ $lang('common.list.del') }}</button>
|
||||
</view>
|
||||
<view class="action-btn" v-else>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" v-if="totalCount != 0">
|
||||
{{ discount.coupon_info && discount.coupon_info.receive_type == 'wait' ? '领券' : $lang('goods.cart.l341') }}结算({{
|
||||
totalCount }})
|
||||
</button>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" disabled v-else>{{
|
||||
$lang('cart.button.checkout') }}({{
|
||||
totalCount }})</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
|
||||
<ns-goods-sku ref="selectSku" v-if="goodsSkuDetail" :goods-detail="goodsSkuDetail"
|
||||
:goods-id="goodsSkuDetail.goods_id" :max-buy="goodsSkuDetail.max_buy" :min-buy="goodsSkuDetail.min_buy"
|
||||
@refresh="refreshSkuDetail"></ns-goods-sku>
|
||||
|
||||
<!-- 加载动画 -->
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
import cart from './public/js/cart.js';
|
||||
|
||||
export default {
|
||||
mixins: [scroll, cart]
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
@import './public/css/cart.scss';
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="container">
|
||||
<scroll-view class="scroll-view" :scroll-y="true" :show-scrollbar="false" :refresher-enabled="true"
|
||||
:refresher-triggered="refresherTriggered" @refresherrefresh="onRefresh">
|
||||
<block v-if="hasData">
|
||||
<view class="cart-header" v-if="cartData.length">
|
||||
<view class="num-wrap">共{{ cartData[0].cartList.length }}种商品</view>
|
||||
<view class="cart-action" @click="changeAction">
|
||||
{{ isAction ? $lang('complete') : $lang('edit') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-wrap" v-for="(siteItem, siteIndex) in cartData" :key="siteIndex">
|
||||
<view class="coupon-use-tips" v-if="discount.coupon_info">
|
||||
<view>
|
||||
<text class="title color-base-text">优惠券</text>
|
||||
<text class="desc">领券结算最高可减{{ discount.coupon_info.coupon_money | moneyFormat }}元</text>
|
||||
</view>
|
||||
<view class="color-base-text" @click="$refs.couponPopup.open()">
|
||||
点击{{ discount.coupon_info.receive_type == 'wait' ? '领取' : '查看' }}
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="store-wrap"
|
||||
v-if="globalStoreConfig && globalStoreConfig.store_business == 'store' && globalStoreInfo">
|
||||
<text class="iconfont icon-dianpu"></text>
|
||||
<text class="name">{{ globalStoreInfo.store_name }}</text>
|
||||
</view>
|
||||
<block v-for="(item, cartIndex) in siteItem.cartList" :key="cartIndex">
|
||||
<view class="cart-goods" @touchstart="touchS($event)" @touchend="touchE($event, item)">
|
||||
<view class="goods-wrap" :class="{ edit: item.edit }">
|
||||
<view class="iconfont"
|
||||
:class="item.checked ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"
|
||||
@click="singleElection(siteIndex, cartIndex)"></view>
|
||||
<view @click="toGoodsDetail(item)" class="goods-img">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })"
|
||||
@error="imageError(siteIndex, cartIndex)" mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view>
|
||||
<view @click="toGoodsDetail(item)" class="goods-name">{{ isEnEnv ?
|
||||
item.en_goods_name : item.goods_name }}</view>
|
||||
<view class="sku-wrap">
|
||||
<view class="sku">
|
||||
<view class="goods-spec" v-if="item.sku_spec_format.length"
|
||||
@click="selectSku(item)">
|
||||
<block v-for="(x, i) in item.sku_spec_format" :key="i">
|
||||
{{ x.spec_name }}:{{ x.spec_value_name }}
|
||||
{{ i < item.sku_spec_format.length - 1 ? ';' : '' }}
|
||||
</block>
|
||||
</view>
|
||||
<text class="iconfont icon-unfold"
|
||||
v-if="item.sku_spec_format.length"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-sub-section">
|
||||
<block v-if="item.promotion_type == 1">
|
||||
<block
|
||||
v-if="Number(item.member_price) > 0 && Number(item.member_price) < Number(item.discount_price)">
|
||||
<view class="goods-price ">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="goods-price ">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.discount_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image
|
||||
:src="$util.img('public/uniapp/index/discount.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="Number(item.member_price) > 0">
|
||||
<view class="goods-price">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="goods-price">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<uni-number-box :min="item.min_buy > 1 ? item.min_buy : 1"
|
||||
:max="item.max_buy > 0 && item.max_buy < item.stock ? item.max_buy : item.stock"
|
||||
size="small" :value="initNum(item)" :index="item.cart_id"
|
||||
@change="cartNumChange($event, { siteIndex, cartIndex })"
|
||||
@limit="goodsLimit($event, { siteIndex, cartIndex })" />
|
||||
</view>
|
||||
<view class="discount-wrap" v-if="manjian && manjian['sku_' + item.sku_id]">
|
||||
<text class="discount-tag">满减</text>
|
||||
<scroll-view scroll-x="true" class="scroll-view">
|
||||
<block v-for="(mitem, key) in manjian['sku_' + item.sku_id]" :key="key">
|
||||
<text v-if="mitem.discount_money">{{ Number(mitem.limit) }}减{{
|
||||
mitem.discount_money }}</text>
|
||||
<text class="interval" v-if="mitem.discount_money"></text>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-del color-base-bg" :class="{ show: item.edit }"
|
||||
@click="deleteCart('single', siteIndex, cartIndex)">{{ $lang('del') }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="cart-wrap invalid" v-if="invalidGoods.length">
|
||||
<view class="cart-header">
|
||||
<view class="num-wrap">
|
||||
<text class="font-size-base">失效商品{{ invalidGoods.length }}件</text>
|
||||
</view>
|
||||
<view class="cart-action color-base-text" @click="clearInvalidGoods">清空</view>
|
||||
</view>
|
||||
<block v-for="(goodsItem, goodsIndex) in invalidGoods" :key="goodsIndex">
|
||||
<view class="cart-goods invalid-goods">
|
||||
<view class="goods-wrap">
|
||||
<view class="iconfont icon-yuan_checked color-tip"></view>
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ goodsItem.sku_name }}</view>
|
||||
<view>
|
||||
<view class="sku">
|
||||
<view class="goods-spec" v-if="goodsItem.sku_spec_format.length">
|
||||
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
|
||||
{{ x.spec_name }}:{{ x.spec_value_name }}
|
||||
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-sub-section">
|
||||
<view class="goods-price">
|
||||
<text class="bottom-price price-style large">
|
||||
<template
|
||||
v-if="goodsItem.member_price > 0 && goodsItem.member_price < goodsItem.discount_price">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(goodsItem.member_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(goodsItem.discount_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</template>
|
||||
</text>
|
||||
</view>
|
||||
<text class="invalid-mark">已失效</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty">
|
||||
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"
|
||||
:emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken" @click="toLogin">{{
|
||||
$lang('toLogin')
|
||||
}}</button>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
<ns-goods-recommend ref="goodrecommend" route="cart"></ns-goods-recommend>
|
||||
|
||||
<view class="cart-bottom-block"></view>
|
||||
|
||||
<!-- 底部tabBar占位 -->
|
||||
<view class="page-bottom" :style="{ height: tabBarHeight }"></view>
|
||||
</scroll-view>
|
||||
|
||||
<uni-popup ref="discountPopup" custom-class="uni-popup-discount" type="bottom">
|
||||
<view class="discount-popup popup" v-if="Object.keys(discount).length">
|
||||
<view class="popup-header">
|
||||
<text class="tit">优惠明细</text>
|
||||
<text class="iconfont icon-close" @click="toggleDiscountPopup"></text>
|
||||
</view>
|
||||
<view class="popup-body" :class="{ 'safe-area': isIphoneX }" @click="toggleDiscountPopup">
|
||||
<view class="detail-item">
|
||||
<view class="title">商品总额</view>
|
||||
<view class="money price-font">¥{{ discount.goods_money | moneyFormat }}</view>
|
||||
</view>
|
||||
<view class="detail-item" v-if="discount.coupon_money > 0">
|
||||
<view class="title">优惠券</view>
|
||||
<view class="money price-font reduce">-¥{{ discount.coupon_money | moneyFormat }}</view>
|
||||
</view>
|
||||
<view class="detail-item" v-if="discount.promotion_money > 0">
|
||||
<view class="title">满减</view>
|
||||
<view class="money reduce price-font">-¥{{ discount.promotion_money | moneyFormat }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-item total">
|
||||
<view class="title">合计</view>
|
||||
<view class="money price-font ">¥{{ discount.order_money | moneyFormat }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ height: tabBarHeight }"></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup ref="couponPopup" custom-class="uni-popup-discount" type="bottom" v-if="discount.coupon_info">
|
||||
<view class="coupon-popup popup">
|
||||
<view class="popup-header">
|
||||
<text class="tit">优惠券</text>
|
||||
<text class="iconfont icon-close" @click="$refs.couponPopup.close()"></text>
|
||||
</view>
|
||||
<view class="popup-body" :class="{ 'safe-area': isIphoneX }" @click="$refs.couponPopup.close()">
|
||||
<view class="coupon-item">
|
||||
<view class="coupon-info"
|
||||
:style="{ backgroundColor: discount.coupon_info.receive_type != 'wait' ? '#F2F2F2' : 'var(--main-color-shallow)' }">
|
||||
<view class="info-wrap">
|
||||
<image class="coupon-line" mode="heightFix"
|
||||
:src="$util.img('public/uniapp/coupon/coupon_line.png')" show-menu-by-longpress/>
|
||||
<view class="coupon-money">
|
||||
<template v-if="discount.coupon_info.type == 'reward'">
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="money">{{ parseFloat(discount.coupon_info.money) }}</text>
|
||||
</template>
|
||||
<template v-else-if="discount.coupon_info.type == 'discount'">
|
||||
<text class="money">{{ parseFloat(discount.coupon_info.discount) }}</text>
|
||||
<text class="unit">折</text>
|
||||
</template>
|
||||
<view class="at-least">
|
||||
<template v-if="discount.coupon_info.at_least > 0">
|
||||
满{{ discount.coupon_info.at_least }}可用
|
||||
</template>
|
||||
<template v-else>
|
||||
无门槛
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc-wrap">
|
||||
<view class="coupon-name">{{ discount.coupon_info.coupon_name }}</view>
|
||||
<view
|
||||
v-if="discount.coupon_info.type == 'discount' && discount.coupon_info.discount_limit > 0"
|
||||
class="limit">
|
||||
最多可抵¥{{ discount.coupon_info.discount_limit }}
|
||||
</view>
|
||||
<view class="time font-size-goods-tag"
|
||||
v-if="discount.coupon_info.validity_type == 0">
|
||||
有效期:{{ $util.timeStampTurnTime(discount.coupon_info.end_time) }}
|
||||
</view>
|
||||
<view class="time font-size-goods-tag"
|
||||
v-else-if="discount.coupon_info.validity_type == 1">
|
||||
有效期:领取之日起{{ discount.coupon_info.fixed_term }}天内有效
|
||||
</view>
|
||||
<view class="time font-size-goods-tag" v-else>有效期:长期有效</view>
|
||||
</view>
|
||||
|
||||
<button type="primary" v-if="discount.coupon_info.receive_type != 'wait'"
|
||||
disabled>已领取</button>
|
||||
<button type="primary" v-else
|
||||
@click.stop="receiveCoupon(discount.coupon_info.coupon_type_id)">领取</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ height: tabBarHeight }"></view>
|
||||
<view class="cart-bottom-block"></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<view class="cart-bottom" :style="{ bottom: tabBarHeight }" :class="{ active: isIphoneX }" v-if="hasData">
|
||||
<view class="all-election" @click="allElection">
|
||||
<view class="iconfont" :class="checkAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'">
|
||||
</view>
|
||||
<text>{{ $lang('allElection') }}</text>
|
||||
</view>
|
||||
<view class="settlement-info" :style="{ visibility: isAction ? 'hidden' : 'visible' }">
|
||||
<view class="money">
|
||||
{{ $lang('total') }}:
|
||||
<text class="unit price-font">{{ $lang('common.currencySymbol') }}</text>
|
||||
<block v-if="Object.keys(discount).length">
|
||||
<text class="value price-font">{{ parseFloat(discount.order_money).toFixed(2).split('.')[0]
|
||||
}}</text>
|
||||
<text class="unit price-font">.{{ parseFloat(discount.order_money).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text class="value price-font">{{ parseFloat(totalPrice).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-font">.{{ parseFloat(totalPrice).toFixed(2).split('.')[1] }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="detail" @click="toggleDiscountPopup" v-if="Object.keys(discount).length">
|
||||
优惠明细
|
||||
<text class="iconfont icon-unfold" :class="{ open: !discountPopupShow }"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-btn" v-if="isAction">
|
||||
<button type="primary" size="mini" class="mini" @click="deleteCart('all')">{{ $lang('del') }}</button>
|
||||
</view>
|
||||
<view class="action-btn" v-else>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" v-if="totalCount != 0">
|
||||
{{ discount.coupon_info && discount.coupon_info.receive_type == 'wait' ? '领券' : '立即' }}结算({{
|
||||
totalCount }})
|
||||
</button>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" disabled v-else>{{
|
||||
$lang('settlement') }}({{
|
||||
totalCount }})</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
|
||||
<ns-goods-sku ref="selectSku" v-if="goodsSkuDetail" :goods-detail="goodsSkuDetail"
|
||||
:goods-id="goodsSkuDetail.goods_id" :max-buy="goodsSkuDetail.max_buy" :min-buy="goodsSkuDetail.min_buy"
|
||||
@refresh="refreshSkuDetail"></ns-goods-sku>
|
||||
|
||||
<!-- 加载动画 -->
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
import cart from './public/js/cart.js';
|
||||
|
||||
export default {
|
||||
mixins: [scroll, cart]
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
@import './public/css/cart.scss';
|
||||
</style>
|
||||
@@ -1,390 +0,0 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="container">
|
||||
<scroll-view class="scroll-view" :scroll-y="true" :show-scrollbar="false" :refresher-enabled="true"
|
||||
:refresher-triggered="refresherTriggered" @refresherrefresh="onRefresh">
|
||||
<block v-if="hasData">
|
||||
<view class="cart-header" v-if="cartData.length">
|
||||
<view class="num-wrap">共{{ cartData[0].cartList.length }}种商品</view>
|
||||
<view class="cart-action" @click="changeAction">
|
||||
{{ isAction ? $lang('complete') : $lang('edit') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-wrap" v-for="(siteItem, siteIndex) in cartData" :key="siteIndex">
|
||||
<view class="coupon-use-tips" v-if="discount.coupon_info">
|
||||
<view>
|
||||
<text class="title color-base-text">优惠券</text>
|
||||
<text class="desc">领券结算最高可减{{ discount.coupon_info.coupon_money | moneyFormat }}元</text>
|
||||
</view>
|
||||
<view class="color-base-text" @click="$refs.couponPopup.open()">
|
||||
点击{{ discount.coupon_info.receive_type == 'wait' ? '领取' : '查看' }}
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="store-wrap"
|
||||
v-if="globalStoreConfig && globalStoreConfig.store_business == 'store' && globalStoreInfo">
|
||||
<text class="iconfont icon-dianpu"></text>
|
||||
<text class="name">{{ globalStoreInfo.store_name }}</text>
|
||||
</view>
|
||||
<block v-for="(item, cartIndex) in siteItem.cartList" :key="cartIndex">
|
||||
<view class="cart-goods" @touchstart="touchS($event)" @touchend="touchE($event, item)">
|
||||
<view class="goods-wrap" :class="{ edit: item.edit }">
|
||||
<view class="iconfont"
|
||||
:class="item.checked ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"
|
||||
@click="singleElection(siteIndex, cartIndex)"></view>
|
||||
<view @click="toGoodsDetail(item)" class="goods-img">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })"
|
||||
@error="imageError(siteIndex, cartIndex)" mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view>
|
||||
<view @click="toGoodsDetail(item)" class="goods-name">{{ isEnEnv ?
|
||||
item.en_goods_name : item.goods_name }}</view>
|
||||
<view class="sku-wrap">
|
||||
<view class="sku">
|
||||
<view class="goods-spec" v-if="item.sku_spec_format.length"
|
||||
@click="selectSku(item)">
|
||||
<block v-for="(x, i) in item.sku_spec_format" :key="i">
|
||||
{{ x.spec_name }}:{{ x.spec_value_name }}
|
||||
{{ i < item.sku_spec_format.length - 1 ? ';' : '' }}
|
||||
</block>
|
||||
</view>
|
||||
<text class="iconfont icon-unfold"
|
||||
v-if="item.sku_spec_format.length"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-sub-section">
|
||||
<block v-if="item.promotion_type == 1">
|
||||
<block
|
||||
v-if="Number(item.member_price) > 0 && Number(item.member_price) < Number(item.discount_price)">
|
||||
<view class="goods-price ">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="goods-price ">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.discount_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image
|
||||
:src="$util.img('public/uniapp/index/discount.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="Number(item.member_price) > 0">
|
||||
<view class="goods-price">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="goods-price">
|
||||
<view class="bottom-price price-style large">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(item.price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<uni-number-box :min="item.min_buy > 1 ? item.min_buy : 1"
|
||||
:max="item.max_buy > 0 && item.max_buy < item.stock ? item.max_buy : item.stock"
|
||||
size="small" :value="initNum(item)" :index="item.cart_id"
|
||||
@change="cartNumChange($event, { siteIndex, cartIndex })"
|
||||
@limit="goodsLimit($event, { siteIndex, cartIndex })" />
|
||||
</view>
|
||||
<view class="discount-wrap" v-if="manjian && manjian['sku_' + item.sku_id]">
|
||||
<text class="discount-tag">满减</text>
|
||||
<scroll-view scroll-x="true" class="scroll-view">
|
||||
<block v-for="(mitem, key) in manjian['sku_' + item.sku_id]" :key="key">
|
||||
<text v-if="mitem.discount_money">{{ Number(mitem.limit) }}减{{
|
||||
mitem.discount_money }}</text>
|
||||
<text class="interval" v-if="mitem.discount_money"></text>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-del color-base-bg" :class="{ show: item.edit }"
|
||||
@click="deleteCart('single', siteIndex, cartIndex)">{{ $lang('del') }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="cart-wrap invalid" v-if="invalidGoods.length">
|
||||
<view class="cart-header">
|
||||
<view class="num-wrap">
|
||||
<text class="font-size-base">失效商品{{ invalidGoods.length }}件</text>
|
||||
</view>
|
||||
<view class="cart-action color-base-text" @click="clearInvalidGoods">清空</view>
|
||||
</view>
|
||||
<block v-for="(goodsItem, goodsIndex) in invalidGoods" :key="goodsIndex">
|
||||
<view class="cart-goods invalid-goods">
|
||||
<view class="goods-wrap">
|
||||
<view class="iconfont icon-yuan_checked color-tip"></view>
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ goodsItem.sku_name }}</view>
|
||||
<view>
|
||||
<view class="sku">
|
||||
<view class="goods-spec" v-if="goodsItem.sku_spec_format.length">
|
||||
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
|
||||
{{ x.spec_name }}:{{ x.spec_value_name }}
|
||||
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-sub-section">
|
||||
<view class="goods-price">
|
||||
<text class="bottom-price price-style large">
|
||||
<template
|
||||
v-if="goodsItem.member_price > 0 && goodsItem.member_price < goodsItem.discount_price">
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(goodsItem.member_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" show-menu-by-longpress/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="unit price-style small">{{
|
||||
$lang('common.currencySymbol') }}</text>
|
||||
{{ parseFloat(goodsItem.discount_price).toFixed(2).split('.')[0]
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</template>
|
||||
</text>
|
||||
</view>
|
||||
<text class="invalid-mark">已失效</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty">
|
||||
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"
|
||||
:emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken" @click="toLogin">{{
|
||||
$lang('toLogin')
|
||||
}}</button>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
<ns-goods-recommend ref="goodrecommend" route="cart"></ns-goods-recommend>
|
||||
|
||||
<view class="cart-bottom-block"></view>
|
||||
|
||||
<!-- 底部tabBar占位 -->
|
||||
<view class="page-bottom" :style="{ height: tabBarHeight }"></view>
|
||||
</scroll-view>
|
||||
|
||||
<uni-popup ref="discountPopup" custom-class="uni-popup-discount" type="bottom">
|
||||
<view class="discount-popup popup" v-if="Object.keys(discount).length">
|
||||
<view class="popup-header">
|
||||
<text class="tit">优惠明细</text>
|
||||
<text class="iconfont icon-close" @click="toggleDiscountPopup"></text>
|
||||
</view>
|
||||
<view class="popup-body" :class="{ 'safe-area': isIphoneX }" @click="toggleDiscountPopup">
|
||||
<view class="detail-item">
|
||||
<view class="title">商品总额</view>
|
||||
<view class="money price-font">¥{{ discount.goods_money | moneyFormat }}</view>
|
||||
</view>
|
||||
<view class="detail-item" v-if="discount.coupon_money > 0">
|
||||
<view class="title">优惠券</view>
|
||||
<view class="money price-font reduce">-¥{{ discount.coupon_money | moneyFormat }}</view>
|
||||
</view>
|
||||
<view class="detail-item" v-if="discount.promotion_money > 0">
|
||||
<view class="title">满减</view>
|
||||
<view class="money reduce price-font">-¥{{ discount.promotion_money | moneyFormat }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-item total">
|
||||
<view class="title">合计</view>
|
||||
<view class="money price-font ">¥{{ discount.order_money | moneyFormat }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ height: tabBarHeight }"></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup ref="couponPopup" custom-class="uni-popup-discount" type="bottom" v-if="discount.coupon_info">
|
||||
<view class="coupon-popup popup">
|
||||
<view class="popup-header">
|
||||
<text class="tit">优惠券</text>
|
||||
<text class="iconfont icon-close" @click="$refs.couponPopup.close()"></text>
|
||||
</view>
|
||||
<view class="popup-body" :class="{ 'safe-area': isIphoneX }" @click="$refs.couponPopup.close()">
|
||||
<view class="coupon-item">
|
||||
<view class="coupon-info"
|
||||
:style="{ backgroundColor: discount.coupon_info.receive_type != 'wait' ? '#F2F2F2' : 'var(--main-color-shallow)' }">
|
||||
<view class="info-wrap">
|
||||
<image class="coupon-line" mode="heightFix"
|
||||
:src="$util.img('public/uniapp/coupon/coupon_line.png')" show-menu-by-longpress/>
|
||||
<view class="coupon-money">
|
||||
<template v-if="discount.coupon_info.type == 'reward'">
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="money">{{ parseFloat(discount.coupon_info.money) }}</text>
|
||||
</template>
|
||||
<template v-else-if="discount.coupon_info.type == 'discount'">
|
||||
<text class="money">{{ parseFloat(discount.coupon_info.discount) }}</text>
|
||||
<text class="unit">折</text>
|
||||
</template>
|
||||
<view class="at-least">
|
||||
<template v-if="discount.coupon_info.at_least > 0">
|
||||
满{{ discount.coupon_info.at_least }}可用
|
||||
</template>
|
||||
<template v-else>
|
||||
无门槛
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc-wrap">
|
||||
<view class="coupon-name">{{ discount.coupon_info.coupon_name }}</view>
|
||||
<view
|
||||
v-if="discount.coupon_info.type == 'discount' && discount.coupon_info.discount_limit > 0"
|
||||
class="limit">
|
||||
最多可抵¥{{ discount.coupon_info.discount_limit }}
|
||||
</view>
|
||||
<view class="time font-size-goods-tag"
|
||||
v-if="discount.coupon_info.validity_type == 0">
|
||||
有效期:{{ $util.timeStampTurnTime(discount.coupon_info.end_time) }}
|
||||
</view>
|
||||
<view class="time font-size-goods-tag"
|
||||
v-else-if="discount.coupon_info.validity_type == 1">
|
||||
有效期:领取之日起{{ discount.coupon_info.fixed_term }}天内有效
|
||||
</view>
|
||||
<view class="time font-size-goods-tag" v-else>有效期:长期有效</view>
|
||||
</view>
|
||||
|
||||
<button type="primary" v-if="discount.coupon_info.receive_type != 'wait'"
|
||||
disabled>已领取</button>
|
||||
<button type="primary" v-else
|
||||
@click.stop="receiveCoupon(discount.coupon_info.coupon_type_id)">领取</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ height: tabBarHeight }"></view>
|
||||
<view class="cart-bottom-block"></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<view class="cart-bottom" :style="{ bottom: tabBarHeight }" :class="{ active: isIphoneX }" v-if="hasData">
|
||||
<view class="all-election" @click="allElection">
|
||||
<view class="iconfont" :class="checkAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'">
|
||||
</view>
|
||||
<text>{{ $lang('allElection') }}</text>
|
||||
</view>
|
||||
<view class="settlement-info" :style="{ visibility: isAction ? 'hidden' : 'visible' }">
|
||||
<view class="money">
|
||||
{{ $lang('total') }}:
|
||||
<text class="unit price-font">{{ $lang('common.currencySymbol') }}</text>
|
||||
<block v-if="Object.keys(discount).length">
|
||||
<text class="value price-font">{{ parseFloat(discount.order_money).toFixed(2).split('.')[0]
|
||||
}}</text>
|
||||
<text class="unit price-font">.{{ parseFloat(discount.order_money).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text class="value price-font">{{ parseFloat(totalPrice).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-font">.{{ parseFloat(totalPrice).toFixed(2).split('.')[1] }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="detail" @click="toggleDiscountPopup" v-if="Object.keys(discount).length">
|
||||
优惠明细
|
||||
<text class="iconfont icon-unfold" :class="{ open: !discountPopupShow }"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-btn" v-if="isAction">
|
||||
<button type="primary" size="mini" class="mini" @click="deleteCart('all')">{{ $lang('del') }}</button>
|
||||
</view>
|
||||
<view class="action-btn" v-else>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" v-if="totalCount != 0">
|
||||
{{ discount.coupon_info && discount.coupon_info.receive_type == 'wait' ? '领券' : '立即' }}结算({{
|
||||
totalCount }})
|
||||
</button>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" disabled v-else>{{
|
||||
$lang('settlement') }}({{
|
||||
totalCount }})</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
|
||||
<ns-goods-sku ref="selectSku" v-if="goodsSkuDetail" :goods-detail="goodsSkuDetail"
|
||||
:goods-id="goodsSkuDetail.goods_id" :max-buy="goodsSkuDetail.max_buy" :min-buy="goodsSkuDetail.min_buy"
|
||||
@refresh="refreshSkuDetail"></ns-goods-sku>
|
||||
|
||||
<!-- 加载动画 -->
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
import cart from './public/js/cart.js';
|
||||
|
||||
export default {
|
||||
mixins: [scroll, cart]
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
@import './public/css/cart.scss';
|
||||
</style>
|
||||
@@ -1,149 +1,149 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<block v-if="diyData">
|
||||
<block v-for="(item, index) in diyData.value" :key="index">
|
||||
<view v-if="item.componentName == 'GoodsCategory'">
|
||||
<diy-category @tologin="toLogin" ref="category" :value="item"></diy-category>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
diyData: null,
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.$util.hideHomeButton();
|
||||
//刷新多语言
|
||||
this.$langConfig.refresh();
|
||||
this.getDiyInfo();
|
||||
},
|
||||
onShow() {
|
||||
this.$util.hideHomeButton();
|
||||
if (this.$refs.category) this.$refs.category[0].pageShow();
|
||||
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare('/pages_goods/category').then(res => {
|
||||
this.mpShareData = res;
|
||||
}).catch(err => {
|
||||
// 如果后台没配置,用默认值
|
||||
this.mpShareData = {
|
||||
appMessage: {
|
||||
title: $lang('goods.category.l51'),
|
||||
path: '/pages_goods/category'
|
||||
},
|
||||
timeLine: {
|
||||
title: $lang('goods.category.l51'),
|
||||
query: '/pages_goods/category'
|
||||
}
|
||||
};
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
onUnload() {
|
||||
if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();
|
||||
},
|
||||
methods: {
|
||||
getDiyInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/diyview/info',
|
||||
data: {
|
||||
name: 'DIY_VIEW_GOODS_CATEGORY'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.diyData = res.data;
|
||||
if (this.diyData.value) {
|
||||
this.diyData = JSON.parse(this.diyData.value);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
toLogin() {
|
||||
this.$refs.login.open('/pages_goods/category')
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.hideTabBar();
|
||||
this.getDiyInfo();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData?.appMessage || {
|
||||
title: $lang('goods.category.l51'),
|
||||
path: '/pages_goods/category'
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
return this.mpShareData?.timeLine || {
|
||||
title: $lang('goods.category.l51'),
|
||||
query: '/pages_goods/category'
|
||||
};
|
||||
},
|
||||
onAddToFavorites() {
|
||||
return {
|
||||
title: $lang('goods.category.l51'),
|
||||
path: '/pages_goods/category'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .uni-popup__wrapper.uni-center {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper-box {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper.uni-custom.center .uni-popup__wrapper-box {
|
||||
overflow-y: visible;
|
||||
}
|
||||
|
||||
::v-deep .loading-layer {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
// 分类四一级展开
|
||||
::v-deep .category-template-4 .template-four .uni-popup__wrapper-box {
|
||||
border-radius: 0px 0px 14px 14px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
::v-deep .category-template-4 .content-wrap .categoty-goods-wrap .goods-list {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
::v-deep .category-template-4 .content-wrap .goods-list .goods-item .footer-wrap .right-wrap .num-action {
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
}
|
||||
|
||||
::v-deep .uni-page-refresh-inner .uni-page-refresh__path {
|
||||
stroke: rgb(1, 1, 1) !important;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<block v-if="diyData">
|
||||
<block v-for="(item, index) in diyData.value" :key="index">
|
||||
<view v-if="item.componentName == 'GoodsCategory'">
|
||||
<diy-category @tologin="toLogin" ref="category" :value="item"></diy-category>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
diyData: null,
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.$util.hideHomeButton();
|
||||
//刷新多语言
|
||||
this.$langConfig.refresh();
|
||||
this.getDiyInfo();
|
||||
},
|
||||
onShow() {
|
||||
this.$util.hideHomeButton();
|
||||
if (this.$refs.category) this.$refs.category[0].pageShow();
|
||||
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare('/pages_goods/category').then(res => {
|
||||
this.mpShareData = res;
|
||||
}).catch(err => {
|
||||
// 如果后台没配置,用默认值
|
||||
this.mpShareData = {
|
||||
appMessage: {
|
||||
title: '发现超多好物,快来看看',
|
||||
path: '/pages_goods/category'
|
||||
},
|
||||
timeLine: {
|
||||
title: '发现超多好物,快来看看',
|
||||
query: '/pages_goods/category'
|
||||
}
|
||||
};
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
onUnload() {
|
||||
if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();
|
||||
},
|
||||
methods: {
|
||||
getDiyInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/diyview/info',
|
||||
data: {
|
||||
name: 'DIY_VIEW_GOODS_CATEGORY'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.diyData = res.data;
|
||||
if (this.diyData.value) {
|
||||
this.diyData = JSON.parse(this.diyData.value);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
toLogin() {
|
||||
this.$refs.login.open('/pages_goods/category')
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.hideTabBar();
|
||||
this.getDiyInfo();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData?.appMessage || {
|
||||
title: '发现超多好物,快来看看',
|
||||
path: '/pages_goods/category'
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
return this.mpShareData?.timeLine || {
|
||||
title: '发现超多好物,快来看看',
|
||||
query: '/pages_goods/category'
|
||||
};
|
||||
},
|
||||
onAddToFavorites() {
|
||||
return {
|
||||
title: '发现超多好物,快来看看',
|
||||
path: '/pages_goods/category'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .uni-popup__wrapper.uni-center {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper-box {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper.uni-custom.center .uni-popup__wrapper-box {
|
||||
overflow-y: visible;
|
||||
}
|
||||
|
||||
::v-deep .loading-layer {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
// 分类四一级展开
|
||||
::v-deep .category-template-4 .template-four .uni-popup__wrapper-box {
|
||||
border-radius: 0px 0px 14px 14px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
::v-deep .category-template-4 .content-wrap .categoty-goods-wrap .goods-list {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
::v-deep .category-template-4 .content-wrap .goods-list .goods-item .footer-wrap .right-wrap .num-action {
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
}
|
||||
|
||||
::v-deep .uni-page-refresh-inner .uni-page-refresh__path {
|
||||
stroke: rgb(1, 1, 1) !important;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,269 +1,269 @@
|
||||
<template>
|
||||
<view class="content" :style="themeColor">
|
||||
<view class="head-wrap">
|
||||
<!-- 搜索区域 -->
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
<view class="flex-item input-wrap">
|
||||
<input class="uni-input" maxlength="50" v-model="keyword" @confirm="search()"
|
||||
:placeholder="langstatus ? $lang('goods.button.search') : '请输入您要搜索的商品'" />
|
||||
<text class="iconfont icon-sousuo3" @click.stop="search()"></text>
|
||||
</view>
|
||||
<view class="iconfont" :class="{ 'icon-apps': isList, 'icon-list': !isList }"
|
||||
@click="changeListStyle()"></view>
|
||||
</view>
|
||||
|
||||
<!-- 排序 -->
|
||||
<view class="sort-wrap">
|
||||
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }"
|
||||
@click="sortTabClick('')">
|
||||
<text :class="{ 'color-base-text': orderType === '' }">{{ langstatus ? $lang('goods.list.random') : $lang('goods.list.l19') }}</text>
|
||||
</view>
|
||||
|
||||
<view :class="{ 'color-base-text': orderType === 'sale_num' }" @click="sortTabClick('sale_num')">
|
||||
{{ langstatus ? $lang('goods.list.sales') : $lang('goods.list.l23') }}
|
||||
</view>
|
||||
|
||||
<view class="price-wrap" @click="sortTabClick('discount_price')">
|
||||
<text
|
||||
:class="{ 'color-base-text': orderType === 'discount_price' }">{{ langstatus ? $lang('goods.list.price') : $lang('goods.list.l28') }}</text>
|
||||
<view class="iconfont-wrap">
|
||||
<view class="iconfont icon-iconangledown-copy asc"
|
||||
:class="{ 'color-base-text': priceOrder === 'asc' && orderType === 'discount_price' }">
|
||||
</view>
|
||||
<view class="iconfont icon-iconangledown desc"
|
||||
:class="{ 'color-base-text': priceOrder === 'desc' && orderType === 'discount_price' }">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view :class="{ 'color-base-text': orderType === 'screen' }" class="screen-wrap">
|
||||
<text @click="sortTabClick('screen')">{{ langstatus ? $lang('goods.list.filter') : $lang('goods.list.l40') }}</text>
|
||||
<view @click="sortTabClick('screen')" class="iconfont-wrap">
|
||||
<view class="iconfont icon-shaixuan color-tip"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<mescroll-uni top="180" ref="mescroll" @getData="getGoodsList">
|
||||
<block slot="list">
|
||||
<view v-if="isList" class="goods-list single-column" :class="{ show: isList }">
|
||||
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="item.id"
|
||||
@click="toDetail(item)">
|
||||
<view class="goods-img">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)" show-menu-by-longpress ></image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}
|
||||
</view>
|
||||
<view class="sell-out" v-if="item.goods_stock <= 0">
|
||||
<text class="iconfont icon-shuqing"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="name-wrap">
|
||||
<view class="goods-name"
|
||||
:class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
|
||||
|
||||
{{ isEnEnv ? item.en_goods_name : item.goods_name }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price" v-if="item.isinformation == 0">
|
||||
<text class="unit price-style small">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text class="price price-style large">{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.isinformation == 0">
|
||||
<view class="block-wrap">
|
||||
<view class="sale" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
|
||||
? item.unit : $lang('common.ns-goods-sku.ns-goods-sku-index.l150.t0') }}</view>
|
||||
</view>
|
||||
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
|
||||
<view class="cart buy-btn click-wrap" :id="'goods-' + item.id"
|
||||
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
|
||||
{{ $lang('common.action.buy') }}
|
||||
<view class="click-event"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ai-chat-btn-wrap" v-if="item.isinformation == 1">
|
||||
<view class="ai-chat-btn" @click.stop="sendToAIChat(item)">
|
||||
{{ $lang('common.action.consult') }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!isList" class="goods-list double-column" :class="{ show: !isList }">
|
||||
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="item.id"
|
||||
@click="toDetail(item)"
|
||||
:style="{ left: listPosition[index] ? listPosition[index].left : '', top: listPosition[index] ? listPosition[index].top : '' }">
|
||||
<view class="goods-img">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)" show-menu-by-longpress ></image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}
|
||||
</view>
|
||||
<view class="sell-out" v-if="item.stock <= 0">
|
||||
<text class="iconfont icon-shuqing"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="goods-name"
|
||||
:class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
|
||||
{{ isEnEnv ? item.en_goods_name : item.goods_name }}
|
||||
</view>
|
||||
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price" v-if="item.isinformation == 0">
|
||||
<text class="unit price-style small">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text class="price price-style large">{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.isinformation == 0">
|
||||
<view class="block-wrap">
|
||||
<view class="sale" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
|
||||
? item.unit : $lang('common.ns-goods-sku.ns-goods-sku-index.l150.t0') }}</view>
|
||||
</view>
|
||||
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
|
||||
<view class="cart buy-btn click-wrap" :id="'goods-' + item.id"
|
||||
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
|
||||
{{ $lang('common.action.buy') }}
|
||||
<view class="click-event"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ai-chat-btn-wrap" v-if="item.isinformation == 1">
|
||||
<view class="ai-chat-btn" @click.stop="sendToAIChat(item)">
|
||||
{{ $lang('common.action.consult') }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty text=$lang("goods.list.l148")></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<ns-goods-sku-index ref="goodsSkuIndex" @addCart="addCart"></ns-goods-sku-index>
|
||||
|
||||
<!-- 筛选弹出框 -->
|
||||
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
|
||||
<view class="title color-tip">{{ $lang("goods.list.l40") }}</view>
|
||||
<scroll-view scroll-y>
|
||||
<!-- 包邮 -->
|
||||
<!-- <view class="item-wrap">
|
||||
<view class="label"><text>{{ $lang("goods.list.l160") }}</text></view>
|
||||
<view class="list">
|
||||
<uni-tag :inverted="true" text="包邮" :type="isFreeShipping ? 'primary' : 'default'" @click="isFreeShipping = !isFreeShipping" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 价格筛选项 -->
|
||||
<!-- <view class="item-wrap">
|
||||
<view class="label"><text>{{ $lang("goods.list.l168") }}</text></view>
|
||||
<view class="price-wrap">
|
||||
<input class="uni-input" type="digit" v-model="minPrice" placeholder=$lang("goods.list.l170") />
|
||||
<view class="h-line"></view>
|
||||
<input class="uni-input" type="digit" v-model="maxPrice" placeholder=$lang("goods.list.l172") />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 品牌筛选项 -->
|
||||
<!-- <view class="item-wrap" v-if="brandList.length > 0">
|
||||
<view class="label"><text>{{ $lang("diy.diy-merch-list.l66.t0") }}</text></view>
|
||||
<view class="list">
|
||||
<view v-for="(item, index) in brandList" :key="index">
|
||||
<uni-tag :inverted="true" :text="item.brand_name" :type="item.brand_id == brandId ? 'primary' : 'default'" @click="brandId == item.brand_id ? (brandId = 0) : (brandId = item.brand_id)" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 分类筛选项 -->
|
||||
<view class="category-list-wrap">
|
||||
<text class="first">{{ $lang("goods.list.l188") }}</text>
|
||||
<view class="class-box">
|
||||
<view @click="selectedCategory('')" class="list-wrap">
|
||||
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ $lang("diy.diy-category-item.l47.t0") }}</text>
|
||||
</view>
|
||||
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
|
||||
:key="index" class="list-wrap">
|
||||
<text
|
||||
:class="{ selected: item.category_id == categoryId, 'color-base-text': item.category_id == categoryId }">{{
|
||||
item.category_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="footer" :class="{ 'safe-area': isIphoneX }">
|
||||
<button type="default" class="footer-box" @click="resetData">{{ $lang("goods.list.l203") }}</button>
|
||||
<button type="primary" class="footer-box1" @click="screenData">{{ $lang("common.ns-goods-sku.ns-goods-sku-category.l76.t0") }}</button>
|
||||
</view>
|
||||
</uni-drawer>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import list from './public/js/list.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mixins: [list],
|
||||
methods: {
|
||||
sendToAIChat(item) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/list.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
>>>.uni-tag--primary.uni-tag--inverted {
|
||||
background-color: #f5f5f5 !important;
|
||||
|
||||
}
|
||||
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
|
||||
.ai-chat-btn-wrap {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: auto;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.ai-chat-btn {
|
||||
background-color: #ff0000;
|
||||
color: #fff;
|
||||
padding: 12rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
<template>
|
||||
<view class="content" :style="themeColor">
|
||||
<view class="head-wrap">
|
||||
<!-- 搜索区域 -->
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
<view class="flex-item input-wrap">
|
||||
<input class="uni-input" maxlength="50" v-model="keyword" @confirm="search()"
|
||||
:placeholder="langstatus ? $lang('Search') : '请输入您要搜索的商品'" />
|
||||
<text class="iconfont icon-sousuo3" @click.stop="search()"></text>
|
||||
</view>
|
||||
<view class="iconfont" :class="{ 'icon-apps': isList, 'icon-list': !isList }"
|
||||
@click="changeListStyle()"></view>
|
||||
</view>
|
||||
|
||||
<!-- 排序 -->
|
||||
<view class="sort-wrap">
|
||||
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }"
|
||||
@click="sortTabClick('')">
|
||||
<text :class="{ 'color-base-text': orderType === '' }">{{ langstatus ? $lang('Random') : '综合' }}</text>
|
||||
</view>
|
||||
|
||||
<view :class="{ 'color-base-text': orderType === 'sale_num' }" @click="sortTabClick('sale_num')">
|
||||
{{ langstatus ? $lang('Sales') : '销量' }}
|
||||
</view>
|
||||
|
||||
<view class="price-wrap" @click="sortTabClick('discount_price')">
|
||||
<text
|
||||
:class="{ 'color-base-text': orderType === 'discount_price' }">{{ langstatus ? $lang('Price') : '价格' }}</text>
|
||||
<view class="iconfont-wrap">
|
||||
<view class="iconfont icon-iconangledown-copy asc"
|
||||
:class="{ 'color-base-text': priceOrder === 'asc' && orderType === 'discount_price' }">
|
||||
</view>
|
||||
<view class="iconfont icon-iconangledown desc"
|
||||
:class="{ 'color-base-text': priceOrder === 'desc' && orderType === 'discount_price' }">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view :class="{ 'color-base-text': orderType === 'screen' }" class="screen-wrap">
|
||||
<text @click="sortTabClick('screen')">{{ langstatus ? $lang('Filter') : '筛选' }}</text>
|
||||
<view @click="sortTabClick('screen')" class="iconfont-wrap">
|
||||
<view class="iconfont icon-shaixuan color-tip"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<mescroll-uni top="180" ref="mescroll" @getData="getGoodsList">
|
||||
<block slot="list">
|
||||
<view v-if="isList" class="goods-list single-column" :class="{ show: isList }">
|
||||
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="item.id"
|
||||
@click="toDetail(item)">
|
||||
<view class="goods-img">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)" show-menu-by-longpress ></image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}
|
||||
</view>
|
||||
<view class="sell-out" v-if="item.goods_stock <= 0">
|
||||
<text class="iconfont icon-shuqing"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="name-wrap">
|
||||
<view class="goods-name"
|
||||
:class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
|
||||
|
||||
{{ isEnEnv ? item.en_goods_name : item.goods_name }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price" v-if="item.isinformation == 0">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price price-style large">{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.isinformation == 0">
|
||||
<view class="block-wrap">
|
||||
<view class="sale" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
|
||||
? item.unit : '件' }}</view>
|
||||
</view>
|
||||
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
|
||||
<view class="cart buy-btn click-wrap" :id="'goods-' + item.id"
|
||||
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
|
||||
{{ $lang('buy') }}
|
||||
<view class="click-event"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ai-chat-btn-wrap" v-if="item.isinformation == 1">
|
||||
<view class="ai-chat-btn" @click.stop="sendToAIChat(item)">
|
||||
{{ $lang('consult') }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!isList" class="goods-list double-column" :class="{ show: !isList }">
|
||||
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="item.id"
|
||||
@click="toDetail(item)"
|
||||
:style="{ left: listPosition[index] ? listPosition[index].left : '', top: listPosition[index] ? listPosition[index].top : '' }">
|
||||
<view class="goods-img">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)" show-menu-by-longpress ></image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}
|
||||
</view>
|
||||
<view class="sell-out" v-if="item.stock <= 0">
|
||||
<text class="iconfont icon-shuqing"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="goods-name"
|
||||
:class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
|
||||
{{ isEnEnv ? item.en_goods_name : item.goods_name }}
|
||||
</view>
|
||||
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price" v-if="item.isinformation == 0">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price price-style large">{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.isinformation == 0">
|
||||
<view class="block-wrap">
|
||||
<view class="sale" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
|
||||
? item.unit : '件' }}</view>
|
||||
</view>
|
||||
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
|
||||
<view class="cart buy-btn click-wrap" :id="'goods-' + item.id"
|
||||
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
|
||||
{{ $lang('buy') }}
|
||||
<view class="click-event"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ai-chat-btn-wrap" v-if="item.isinformation == 1">
|
||||
<view class="ai-chat-btn" @click.stop="sendToAIChat(item)">
|
||||
{{ $lang('consult') }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty text="暂无商品"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<ns-goods-sku-index ref="goodsSkuIndex" @addCart="addCart"></ns-goods-sku-index>
|
||||
|
||||
<!-- 筛选弹出框 -->
|
||||
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
|
||||
<view class="title color-tip">筛选</view>
|
||||
<scroll-view scroll-y>
|
||||
<!-- 包邮 -->
|
||||
<!-- <view class="item-wrap">
|
||||
<view class="label"><text>是否包邮</text></view>
|
||||
<view class="list">
|
||||
<uni-tag :inverted="true" text="包邮" :type="isFreeShipping ? 'primary' : 'default'" @click="isFreeShipping = !isFreeShipping" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 价格筛选项 -->
|
||||
<!-- <view class="item-wrap">
|
||||
<view class="label"><text>价格区间(元)</text></view>
|
||||
<view class="price-wrap">
|
||||
<input class="uni-input" type="digit" v-model="minPrice" placeholder="最低价" />
|
||||
<view class="h-line"></view>
|
||||
<input class="uni-input" type="digit" v-model="maxPrice" placeholder="最高价" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 品牌筛选项 -->
|
||||
<!-- <view class="item-wrap" v-if="brandList.length > 0">
|
||||
<view class="label"><text>品牌</text></view>
|
||||
<view class="list">
|
||||
<view v-for="(item, index) in brandList" :key="index">
|
||||
<uni-tag :inverted="true" :text="item.brand_name" :type="item.brand_id == brandId ? 'primary' : 'default'" @click="brandId == item.brand_id ? (brandId = 0) : (brandId = item.brand_id)" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 分类筛选项 -->
|
||||
<view class="category-list-wrap">
|
||||
<text class="first">全部分类</text>
|
||||
<view class="class-box">
|
||||
<view @click="selectedCategory('')" class="list-wrap">
|
||||
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">全部</text>
|
||||
</view>
|
||||
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
|
||||
:key="index" class="list-wrap">
|
||||
<text
|
||||
:class="{ selected: item.category_id == categoryId, 'color-base-text': item.category_id == categoryId }">{{
|
||||
item.category_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="footer" :class="{ 'safe-area': isIphoneX }">
|
||||
<button type="default" class="footer-box" @click="resetData">重置</button>
|
||||
<button type="primary" class="footer-box1" @click="screenData">确定</button>
|
||||
</view>
|
||||
</uni-drawer>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import list from './public/js/list.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mixins: [list],
|
||||
methods: {
|
||||
sendToAIChat(item) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/list.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
>>>.uni-tag--primary.uni-tag--inverted {
|
||||
background-color: #f5f5f5 !important;
|
||||
|
||||
}
|
||||
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
|
||||
.ai-chat-btn-wrap {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: auto;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.ai-chat-btn {
|
||||
background-color: #ff0000;
|
||||
color: #fff;
|
||||
padding: 12rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user