fixbug: 修改页面改造bug
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- <view class="tags_row" v-if="Array.isArray(item.tags)"> -->
|
<!-- <view class="tags_row" v-if="Array.isArray(item.tags)"> -->
|
||||||
<view class="tags_row">
|
<view class="tags_row">
|
||||||
<image v-for="i in item.goodsTagList" :key="i.mchId" :src="i.icon"
|
<image v-for="i in item.goodsTagList" :key="i.mchId" :src="i.icon" class="tag_image"
|
||||||
class="tag_image" mode="heightFix"></image>
|
mode="heightFix"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 商品名称 -->
|
<!-- 商品名称 -->
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
<view class="coupon_row" v-if="hasCoupon">
|
<view class="coupon_row" v-if="hasCoupon">
|
||||||
<view class="coupon_badge" v-if="activedType === 'seckill'">
|
<view class="coupon_badge" v-if="activedType === 'seckill'">
|
||||||
<text class="flash_icon">⚡</text>
|
<text class="flash_icon">⚡</text>
|
||||||
<text class="coupon_text" v-if="item.secDiscount || item.subsidy">加倍补{{ item.secDiscount || item.subsidy }}元</text>
|
<text class="coupon_text" v-if="item.secDiscount || item.subsidy">加倍补{{ item.secDiscount ||
|
||||||
|
item.subsidy }}元</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="coupon_badge" v-if="activedType === 'super'">
|
<view class="coupon_badge" v-if="activedType === 'super'">
|
||||||
<text class="flash_icon">⚡</text>
|
<text class="flash_icon">⚡</text>
|
||||||
@@ -39,15 +40,16 @@
|
|||||||
<view class="price_section">
|
<view class="price_section">
|
||||||
<text class="price_symbol">¥</text>
|
<text class="price_symbol">¥</text>
|
||||||
<text class="price_integer">{{ item.price }}</text>
|
<text class="price_integer">{{ item.price }}</text>
|
||||||
<text class="original_price seckill" >{{ `${attributes.leftTime ?
|
<text class="original_price seckill">{{ `${attributes.leftTime ?
|
||||||
`只剩${attributes.leftTime}` : ''}` }}</text>
|
`只剩${attributes.leftTime}` : ''}` }}</text>
|
||||||
<!-- <text class="original_price" v-else>¥{{ formatOriginalPrice }}</text> -->
|
<!-- <text class="original_price" v-else>¥{{ formatOriginalPrice }}</text> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- Alarm clock button -->
|
<!-- Alarm clock button -->
|
||||||
<view class="alarm_btn_wrapper" @click.stop="$emit('action', item)">
|
<view class="alarm_btn_wrapper">
|
||||||
<image class="uni-image" v-if="activedType === 'seckill'" src="https://static.tbmall.xin/static/new-home/home_3.png"></image>
|
<image class="uni-image" v-if="activedType === 'seckill'"
|
||||||
<image class="uni-image seckill-icon" v-else
|
src="https://static.tbmall.xin/static/new-home/home_3.png"></image>
|
||||||
src="https://static.tbmall.xin/static/home/qiang.png"></image>
|
<image class="uni-image seckill-icon" v-else src="https://static.tbmall.xin/static/home/qiang.png">
|
||||||
|
</image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -108,8 +110,8 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 商品
|
// 商品
|
||||||
onSelectProct(item) {
|
onSelectProct(item) {
|
||||||
let url = "/pages/other_package/productInfo/productInfo?id=" + item.id ;
|
let url = "/pages/other_package/productInfo/productInfo?id=" + item.id;
|
||||||
if(this.activedType === 'seckill'){
|
if (this.activedType === 'seckill') {
|
||||||
url = "/pages/other_package/productInfo/productInfo?id=" + item.id + "&activedType=" + this.activedType + "&activityId=" + item.activityId;
|
url = "/pages/other_package/productInfo/productInfo?id=" + item.id + "&activedType=" + this.activedType + "&activityId=" + item.activityId;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -20,26 +20,21 @@
|
|||||||
|
|
||||||
<view class="tab-view">
|
<view class="tab-view">
|
||||||
<!-- 限时秒杀卡片 -->
|
<!-- 限时秒杀卡片 -->
|
||||||
<view class="tab-card">
|
<view class="tab-card">
|
||||||
<view
|
<view class="tab-item" :class="{ active: activeTab === index }" @click="onActiveTabChange(index)"
|
||||||
class="tab-item"
|
v-for="(item, index) in activeTabList" :key="index">
|
||||||
:class="{ active: activeTab === index }"
|
|
||||||
@click="onActiveTabChange(index)"
|
|
||||||
v-for="(item, index) in activeTabList"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<text class="tab-text">{{ item.name }}</text>
|
<text class="tab-text">{{ item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 限时秒杀标签 -->
|
<!-- 限时秒杀标签 -->
|
||||||
<view class="tab-list-container">
|
<view class="tab-list-container">
|
||||||
<view class="tab-list" @click="onTab(index)" v-for="(item, index) in tabList" :key="index">
|
<view class="tab-list" @click="onTab(index)" v-for="(item, index) in tabList" :key="index">
|
||||||
<text class="text-28 text-space" :style="{
|
<text class="text-28 text-space" :style="{
|
||||||
color: curTab == index ? '#7A35F6' : '#666',
|
color: curTab == index ? '#7A35F6' : '#666',
|
||||||
}">{{ item.name }}</text>
|
}">{{ item.name }}</text>
|
||||||
<!-- <view class="line" v-if="curTab == index"></view> -->
|
<!-- <view class="line" v-if="curTab == index"></view> -->
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="setting-view">
|
<view class="setting-view">
|
||||||
@@ -135,10 +130,10 @@ export default {
|
|||||||
url().then((res) => {
|
url().then((res) => {
|
||||||
if (res.bizcode === 100) {
|
if (res.bizcode === 100) {
|
||||||
this.activityId = res.data.activityId;
|
this.activityId = res.data.activityId;
|
||||||
console.log('获取秒杀当前时间',res.data);
|
console.log('获取秒杀当前时间', res.data);
|
||||||
|
|
||||||
this.attributes ={
|
this.attributes = {
|
||||||
leftTime: res.data.leftTime || null,
|
leftTime: res.data.leftTime || null,
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.mescroll && this.mescroll.resetUpScroll();
|
this.mescroll && this.mescroll.resetUpScroll();
|
||||||
@@ -210,7 +205,7 @@ export default {
|
|||||||
this.activeTab = index;
|
this.activeTab = index;
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
const item = this.activeTabList[index];
|
const item = this.activeTabList[index];
|
||||||
this.onGetSeckillCurrent(item.type);
|
this.onGetSeckillCurrent(item.type);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -223,7 +218,7 @@ export default {
|
|||||||
delta: 1, // 返回的页面数,默认为1,返回到上一级
|
delta: 1, // 返回的页面数,默认为1,返回到上一级
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onSwiper(index) {
|
onSwiper(index) {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
current: index,
|
current: index,
|
||||||
loop: true,
|
loop: true,
|
||||||
@@ -257,7 +252,7 @@ export default {
|
|||||||
|
|
||||||
.u-swiper__wrapper__item__wrapper__image {
|
.u-swiper__wrapper__item__wrapper__image {
|
||||||
height: 600rpx !important;
|
height: 600rpx !important;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -330,13 +325,14 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tab-card {
|
.tab-card {
|
||||||
width: 100%;
|
width: calc(100% - 64rpx);
|
||||||
height: 74rpx;
|
height: 74rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
padding: 0 4rpx;
|
padding: 0 4rpx;
|
||||||
|
margin: 0 32rpx;
|
||||||
margin-bottom: 16rpx;
|
margin-bottom: 16rpx;
|
||||||
|
|
||||||
.tab-item {
|
.tab-item {
|
||||||
@@ -372,20 +368,24 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 24rpx 32rpx 0;
|
padding: 24rpx 0 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;;
|
background-color: #fff;
|
||||||
|
;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 520rpx;
|
top: 520rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
.tab-list-container{
|
|
||||||
width: 100%;
|
.tab-list-container {
|
||||||
height: 60rpx;
|
width: 100%;
|
||||||
display: flex;
|
height: 60rpx;
|
||||||
flex-direction: row;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: row;
|
||||||
}
|
align-items: center;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-list {
|
.tab-list {
|
||||||
margin-right: 24rpx;
|
margin-right: 24rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
+21
-8
@@ -52,7 +52,7 @@
|
|||||||
<view class="yp_item" v-for="item in faddishProduct" :key="item.id"
|
<view class="yp_item" v-for="item in faddishProduct" :key="item.id"
|
||||||
@click.stop="jumpInfo(item)">
|
@click.stop="jumpInfo(item)">
|
||||||
<view class="yp_item_image_wrapper">
|
<view class="yp_item_image_wrapper">
|
||||||
<up-image :src="item.url" width="100%" height="80" bgColor="#f1f6ff00"
|
<up-image :src="item.url" width="100%" height="88" bgColor="#f1f6ff00"
|
||||||
shape="square" radius="15"></up-image>
|
shape="square" radius="15"></up-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="yp_item_info">
|
<view class="yp_item_info">
|
||||||
@@ -102,8 +102,8 @@
|
|||||||
<view class="product_comm_tip" @click="jumpPage(item.path)">
|
<view class="product_comm_tip" @click="jumpPage(item.path)">
|
||||||
<view class="product_comm_tip_left">
|
<view class="product_comm_tip_left">
|
||||||
<image class="uni-image" :src="item.title_icon"></image>
|
<image class="uni-image" :src="item.title_icon"></image>
|
||||||
<view class="tip_title" v-if="item.title_text">{{ item.title_text }}</view>
|
<view :class="[activedTabId === 'actived' ? 'tip_title_lable' : 'tip_title']" style="margin-right: 10rpx;" v-if="item.title_text" @click.stop="jumpTab(item, 'actived')">{{ item.title_text }}</view>
|
||||||
<view class="tip_title_lable">{{ item.title }}</view>
|
<view :class="[activedTabId === 'seckill' ? 'tip_title_lable' : 'tip_title']" @click.stop="jumpTab(item, 'seckill')">{{ item.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="product_comm_tip_right">{{ item.rightText }}
|
<view class="product_comm_tip_right">{{ item.rightText }}
|
||||||
@@ -125,6 +125,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 为您精选 -->
|
||||||
|
<choiceness />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -197,6 +201,7 @@ import {
|
|||||||
getGoodsDetail,
|
getGoodsDetail,
|
||||||
searchList,
|
searchList,
|
||||||
getSeckillCurrent,
|
getSeckillCurrent,
|
||||||
|
getSeckillPreview,
|
||||||
getSeckillGoodsList,
|
getSeckillGoodsList,
|
||||||
getGoodsTags,
|
getGoodsTags,
|
||||||
} from "@/api/product.js";
|
} from "@/api/product.js";
|
||||||
@@ -266,8 +271,8 @@ export default {
|
|||||||
rightText: '专属补贴 . 低价秒杀',
|
rightText: '专属补贴 . 低价秒杀',
|
||||||
activedType: 'seckill'
|
activedType: 'seckill'
|
||||||
},
|
},
|
||||||
|
|
||||||
], // 首页活动列表
|
], // 首页活动列表
|
||||||
|
activedTabId: 'seckill', // 当前选中的活动类型
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -311,9 +316,15 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() { },
|
mounted() { },
|
||||||
methods: {
|
methods: {
|
||||||
|
// 切换活动类型
|
||||||
|
jumpTab(item, type) {
|
||||||
|
this.activedTabId = type;
|
||||||
|
this.onGetSeckillCurrent();
|
||||||
|
},
|
||||||
// 获取秒杀
|
// 获取秒杀
|
||||||
onGetSeckillCurrent() {
|
onGetSeckillCurrent() {
|
||||||
getSeckillCurrent().then((res) => {
|
const url = this.activedTabId === 'seckill' ? getSeckillCurrent : getSeckillPreview;
|
||||||
|
url().then((res) => {
|
||||||
console.log("获取秒杀", res);
|
console.log("获取秒杀", res);
|
||||||
if (res.bizcode === 100) {
|
if (res.bizcode === 100) {
|
||||||
res.data.activityId && this.onGetSeckillGoodsList(res.data.activityId, 'seckillGoodsList');
|
res.data.activityId && this.onGetSeckillGoodsList(res.data.activityId, 'seckillGoodsList');
|
||||||
@@ -812,7 +823,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.yp_item {
|
.yp_item {
|
||||||
flex: 0 0 32%;
|
// flex: 0 0 32%;
|
||||||
|
flex:1;
|
||||||
|
// height: 268rpx;
|
||||||
|
max-width: 33.3%;
|
||||||
|
gap: 10rpx;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-radius: 24rpx;
|
border-radius: 24rpx;
|
||||||
@@ -828,7 +843,6 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.yp_item_info {
|
.yp_item_info {
|
||||||
@@ -1065,7 +1079,6 @@ export default {
|
|||||||
|
|
||||||
.tip_title {
|
.tip_title {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
margin-right: 12rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tip_title_lable {
|
.tip_title_lable {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-for="(addItem, addIndex) in item.addrTimes" :key="addIndex">
|
<view v-for="(addItem, addIndex) in item.addrTimes" :key="addIndex">
|
||||||
<!-- 单个地址 -->
|
<!-- 单个地址 -->
|
||||||
<view v-if="addItem.address" class="shops_address_warp"
|
<!-- <view v-if="addItem.address" class="shops_address_warp"
|
||||||
@click="checkAddressShow(true, 'addrTimes', addIndex, index)">
|
@click="checkAddressShow(true, 'addrTimes', addIndex, index)">
|
||||||
<view class="shops_address_warp_title">
|
<view class="shops_address_warp_title">
|
||||||
<text style="margin-right: 20rpx">{{ addItem.address.name }}</text>
|
<text style="margin-right: 20rpx">{{ addItem.address.name }}</text>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<up-image src="/static/common/right.png" width="16" height="16" bgColor="#f1f6ff00"></up-image>
|
<up-image src="/static/common/right.png" width="16" height="16" bgColor="#f1f6ff00"></up-image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 产品详情 -->
|
<!-- 产品详情 -->
|
||||||
<view v-if="ids" class="order_item_content" v-for="(pItem, pIndex) in addItem.goods" :key="pItem.id">
|
<view v-if="ids" class="order_item_content" v-for="(pItem, pIndex) in addItem.goods" :key="pItem.id">
|
||||||
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"
|
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
<view class="content_right_total">
|
<view class="content_right_total">
|
||||||
<view>¥<text style="font-size: 36rpx">{{
|
<view>¥<text style="font-size: 36rpx">{{
|
||||||
pItem.totalPrice
|
pItem.totalPrice
|
||||||
}}</text></view>
|
}}</text></view>
|
||||||
<view>每件到手价¥{{ pItem.unitPrice }}</view>
|
<view>每件到手价¥{{ pItem.unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="shopping_info_quantity">
|
<view class="shopping_info_quantity">
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
<view class="content_right_total">
|
<view class="content_right_total">
|
||||||
<view>¥<text style="font-size: 36rpx">{{
|
<view>¥<text style="font-size: 36rpx">{{
|
||||||
pItem.totalPrice
|
pItem.totalPrice
|
||||||
}}</text></view>
|
}}</text></view>
|
||||||
<view>每件到手价¥{{ pItem.unitPrice }}</view>
|
<view>每件到手价¥{{ pItem.unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="shopping_info_quantity">
|
<view class="shopping_info_quantity">
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
<view class="order_freight_item">
|
<view class="order_freight_item">
|
||||||
<view>运费<text style="color: #c0c3c6; margin-left: 20rpx">{{
|
<view>运费<text style="color: #c0c3c6; margin-left: 20rpx">{{
|
||||||
getValue(PRODUCT_DELIVERY_TIME, addItem.deliveryTime)
|
getValue(PRODUCT_DELIVERY_TIME, addItem.deliveryTime)
|
||||||
}}</text></view>
|
}}</text></view>
|
||||||
<view class="value_">
|
<view class="value_">
|
||||||
{{ orderInfo.postage ? "¥" + orderInfo.postage : "包邮" }}
|
{{ orderInfo.postage ? "¥" + orderInfo.postage : "包邮" }}
|
||||||
</view>
|
</view>
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
<view style="display: flex; align-items: center;">
|
<view style="display: flex; align-items: center;">
|
||||||
<view class="seckill-tag">限时秒杀</view>
|
<view class="seckill-tag">限时秒杀</view>
|
||||||
<view class="text-24 " style="margin-right:8rpx;color:#7934F6;font-size: 32rpx;font-weight: bold;">¥{{
|
<view class="text-24 " style="margin-right:8rpx;color:#7934F6;font-size: 32rpx;font-weight: bold;">¥{{
|
||||||
allOrderInfo.activity?.activityPrice}}</view>
|
allOrderInfo.activity?.activityPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="price-view" v-if="isCoupon">
|
<view class="price-view" v-if="isCoupon">
|
||||||
@@ -256,7 +256,7 @@
|
|||||||
</up-popup>
|
</up-popup>
|
||||||
|
|
||||||
<!-- 选择地址 -->
|
<!-- 选择地址 -->
|
||||||
<up-popup v-model:show="addressShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
|
<up-popup v-model:show="addressShow" v-if="addressShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
|
||||||
:safeAreaInsetBottom="false" @close="checkAddressShow(false, null, 0, 0)">
|
:safeAreaInsetBottom="false" @close="checkAddressShow(false, null, 0, 0)">
|
||||||
<view class="address_popup_warp">
|
<view class="address_popup_warp">
|
||||||
<view class="address_popup_title">收件地址</view>
|
<view class="address_popup_title">收件地址</view>
|
||||||
@@ -294,7 +294,8 @@
|
|||||||
<up-toast ref="uToastRef"></up-toast>
|
<up-toast ref="uToastRef"></up-toast>
|
||||||
|
|
||||||
<!-- 优惠券选择弹框 -->
|
<!-- 优惠券选择弹框 -->
|
||||||
<CouponDialog :show="couponShow" v-if="couponShow" @close="couponShow = false" @select="handleCouponSelect"></CouponDialog>
|
<CouponDialog :show="couponShow" v-if="couponShow" @close="couponShow = false" @select="handleCouponSelect">
|
||||||
|
</CouponDialog>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -541,8 +542,8 @@ export default {
|
|||||||
parmas.isDeduction = true;
|
parmas.isDeduction = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.sed.activedType == "seckill"){
|
if (this.sed?.activedType == "seckill") {
|
||||||
parmas["types"] = "1,2,3";
|
parmas["types"] = "1,2,3";
|
||||||
}
|
}
|
||||||
const result = await getSupportPay(parmas);
|
const result = await getSupportPay(parmas);
|
||||||
if (result && result.bizcode === 100) {
|
if (result && result.bizcode === 100) {
|
||||||
@@ -630,9 +631,10 @@ export default {
|
|||||||
if (resp && resp.bizcode === 100) {
|
if (resp && resp.bizcode === 100) {
|
||||||
const data = resp.data;
|
const data = resp.data;
|
||||||
this.isPoints = data.type == 3 ? 1 : 0;
|
this.isPoints = data.type == 3 ? 1 : 0;
|
||||||
|
console.log("秦星星data", data);
|
||||||
this.orderInfo = {
|
this.orderInfo = {
|
||||||
address: null,
|
address: null,
|
||||||
amount:this.sed?.activedType == "seckill" ? data.activity?.activityPrice :this.sed.goodsNum * this.sed.specsId.price || 0,
|
amount: this.sed?.activedType == "seckill" ? data.activity?.activityPrice : this.sed.goodsNum * this.sed.specsId.price || 0,
|
||||||
postage: 0,
|
postage: 0,
|
||||||
shops: [
|
shops: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="content_data_series">
|
<view class="content_data_series">
|
||||||
<!-- 暂时隐藏 -->
|
<!-- 暂时隐藏 -->
|
||||||
<view></view>
|
<view class="content_data_series_tag" v-if="orderInfo.contribution">
|
||||||
|
<image class="uni-image" src="https://static.tbmall.xin/static/new-home/home_3.png"></image>
|
||||||
|
下单送{{ orderInfo.contribution }}贡献值
|
||||||
|
</view>
|
||||||
<!-- 销量还需要改 -->
|
<!-- 销量还需要改 -->
|
||||||
<view>销量{{ limit999(orderInfo.sales) }}件</view>
|
<view>销量{{ limit999(orderInfo.sales) }}件</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -846,7 +849,7 @@ export default {
|
|||||||
if (this.isCoupon) {
|
if (this.isCoupon) {
|
||||||
params.type = -1;
|
params.type = -1;
|
||||||
}
|
}
|
||||||
if(this.activedType === 'seckill'){
|
if (this.activedType === 'seckill') {
|
||||||
params.activityId = this.activityId;
|
params.activityId = this.activityId;
|
||||||
params.activityType = 'seckill';
|
params.activityType = 'seckill';
|
||||||
}
|
}
|
||||||
@@ -863,7 +866,7 @@ export default {
|
|||||||
data.addressObj = {}; // 收件人地址
|
data.addressObj = {}; // 收件人地址
|
||||||
data.quantity = 1; // 数量
|
data.quantity = 1; // 数量
|
||||||
data.inventory = 0; // 库存
|
data.inventory = 0; // 库存
|
||||||
if(this.activedType === 'seckill'){
|
if (this.activedType === 'seckill') {
|
||||||
data.minPrice = data.activity?.activityPrice;
|
data.minPrice = data.activity?.activityPrice;
|
||||||
}
|
}
|
||||||
this.orderInfo = data;
|
this.orderInfo = data;
|
||||||
@@ -1084,22 +1087,22 @@ export default {
|
|||||||
|
|
||||||
console.log("selectTempl", selectTempl);
|
console.log("selectTempl", selectTempl);
|
||||||
if (this.isShowCart == 1 || this.isCoupon) {
|
if (this.isShowCart == 1 || this.isCoupon) {
|
||||||
console.log("活动类型params---秦星星", params,this.isCoupon);
|
console.log("活动类型params---秦星星", params, this.isCoupon);
|
||||||
params["specsId"] = selectTempl;
|
params["specsId"] = selectTempl;
|
||||||
let url = "";
|
let url = "";
|
||||||
if(this.activedType == "seckill"){
|
if (this.activedType == "seckill") {
|
||||||
params["activedType"] = this.activedType; // 活动类型
|
params["activedType"] = this.activedType; // 活动类型
|
||||||
params["activityId"] = this.activityId;// 秒杀活动ID
|
params["activityId"] = this.activityId;// 秒杀活动ID
|
||||||
url = `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
|
url = `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
|
||||||
params
|
params
|
||||||
)}`;
|
)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.isCoupon){
|
if (this.isCoupon) {
|
||||||
url =`/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
|
url = `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
|
||||||
params
|
params
|
||||||
)}&address=${this.selectAddress?.id}&isCoupon=${this.isCoupon}`
|
)}&address=${this.selectAddress?.id}&isCoupon=${this.isCoupon}`
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url
|
url: url
|
||||||
@@ -1236,6 +1239,24 @@ export default {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
|
|
||||||
|
.content_data_series_tag {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
color: #7934F6;
|
||||||
|
padding: 0 12rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgba(121, 52, 246, 0.1);
|
||||||
|
|
||||||
|
.uni-image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tui-view {
|
.tui-view {
|
||||||
|
|||||||
@@ -1,102 +1,46 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view
|
<view :calss="[
|
||||||
:calss="[
|
isDataNull ? 'isDataNull-calss' : 'isDataNull-active',
|
||||||
isDataNull ? 'isDataNull-calss' : 'isDataNull-active',
|
platformType ? '' : 'iosplatformType',
|
||||||
platformType ? '' : 'iosplatformType',
|
]" class="shopping_cart_warp">
|
||||||
]"
|
|
||||||
class="shopping_cart_warp"
|
|
||||||
>
|
|
||||||
<view class="shopping_cart_header">
|
<view class="shopping_cart_header">
|
||||||
<view class="cart">购物车({{ shoppingTotal }})</view>
|
<view class="cart">购物车({{ shoppingTotal }})</view>
|
||||||
<view
|
<view class="enit_but" @click="isEdit = true" v-if="!isEdit" v-show="!isDataNull">编辑</view>
|
||||||
class="enit_but"
|
<view class="enit_but" @click="isEdit = false" v-else>取消</view>
|
||||||
@click="isEdit = true"
|
|
||||||
v-if="!isEdit"
|
|
||||||
v-show="!isDataNull"
|
|
||||||
>编辑</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="enit_but"
|
|
||||||
@click="isEdit = false"
|
|
||||||
v-else
|
|
||||||
v-show="isDataNull"
|
|
||||||
>取消</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 购物车列表 -->
|
<!-- 购物车列表 -->
|
||||||
<up-loading-page :loading="listLoading"></up-loading-page>
|
<up-loading-page :loading="listLoading"></up-loading-page>
|
||||||
<view class="shopping_cart_content">
|
<view class="shopping_cart_content">
|
||||||
<view
|
<view v-if="!isDataNull" class="shopping_cart_content_item" v-for="(item, index) in shoppingList"
|
||||||
v-if="!isDataNull"
|
:key="item.id">
|
||||||
class="shopping_cart_content_item"
|
|
||||||
v-for="(item, index) in shoppingList"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<!-- 店铺头部 -->
|
<!-- 店铺头部 -->
|
||||||
<up-checkbox
|
<up-checkbox :customStyle="{ marginBottom: '8px' }" name="isCheck" usedAlone v-model:checked="item.isCheck"
|
||||||
:customStyle="{ marginBottom: '8px' }"
|
shape="circle" activeColor="#7934F6" size="19" iconSize="18"
|
||||||
name="isCheck"
|
@change="(event) => shoppingChange(event, index)">
|
||||||
usedAlone
|
|
||||||
v-model:checked="item.isCheck"
|
|
||||||
shape="circle"
|
|
||||||
activeColor="#7934F6"
|
|
||||||
size="19"
|
|
||||||
iconSize="18"
|
|
||||||
@change="(event) => shoppingChange(event, index)"
|
|
||||||
>
|
|
||||||
<template #label>
|
<template #label>
|
||||||
<view class="content_item_header">
|
<view class="content_item_header">
|
||||||
<up-image
|
<up-image :src="item.shopLogo ? item.shopLogo : '/static/shopping/store.png'
|
||||||
:src="
|
" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
|
||||||
item.shopLogo ? item.shopLogo : '/static/shopping/store.png'
|
<view class="order_product_title">{{ item.shopName }}{{ item.id }}</view>
|
||||||
"
|
|
||||||
width="22"
|
|
||||||
height="22"
|
|
||||||
bgColor="#f1f6ff00"
|
|
||||||
shape="circle"
|
|
||||||
></up-image>
|
|
||||||
<view class="order_product_title"
|
|
||||||
>{{ item.shopName }}{{ item.id }}</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</up-checkbox>
|
</up-checkbox>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<view
|
<view class="content_item_info" v-for="(pItem, pIndex) in item.product" :key="pItem.id">
|
||||||
class="content_item_info"
|
|
||||||
v-for="(pItem, pIndex) in item.product"
|
|
||||||
:key="pItem.id"
|
|
||||||
>
|
|
||||||
<!-- 单个商品 -->
|
<!-- 单个商品 -->
|
||||||
<up-checkbox
|
<up-checkbox :customStyle="{ marginBottom: '8px' }" name="isCheck" usedAlone
|
||||||
:customStyle="{ marginBottom: '8px' }"
|
v-model:checked="pItem.isCheck" shape="circle" activeColor="#7934F6" size="19" iconSize="18"
|
||||||
name="isCheck"
|
|
||||||
usedAlone
|
|
||||||
v-model:checked="pItem.isCheck"
|
|
||||||
shape="circle"
|
|
||||||
activeColor="#7934F6"
|
|
||||||
size="19"
|
|
||||||
iconSize="18"
|
|
||||||
:disabled="!isEdit && [1, 2].includes(pItem.goodsStatus)"
|
:disabled="!isEdit && [1, 2].includes(pItem.goodsStatus)"
|
||||||
@change="(event) => productChange(event, index, pIndex)"
|
@change="(event) => productChange(event, index, pIndex)">
|
||||||
>
|
|
||||||
</up-checkbox>
|
</up-checkbox>
|
||||||
<view class="info_item">
|
<view class="info_item">
|
||||||
<up-image
|
<up-image :src="pItem.mainGraph" width="100" height="100" bgColor="#f1f6ff00"
|
||||||
:src="pItem.mainGraph"
|
@click="jumpInfo(pItem)"></up-image>
|
||||||
width="100"
|
|
||||||
height="100"
|
|
||||||
bgColor="#f1f6ff00"
|
|
||||||
@click="jumpInfo(pItem)"
|
|
||||||
></up-image>
|
|
||||||
<view class="content_info">
|
<view class="content_info">
|
||||||
<view
|
<view class="shopping_content_info_title" @click="jumpInfo(pItem)">{{ pItem.name }}</view>
|
||||||
class="shopping_content_info_title"
|
|
||||||
@click="jumpInfo(pItem)"
|
|
||||||
>{{ pItem.name }}</view
|
|
||||||
>
|
|
||||||
<view class="content_info_description">
|
<view class="content_info_description">
|
||||||
{{ pItem.goodsSpece }}
|
{{ pItem.goodsSpece }}
|
||||||
</view>
|
</view>
|
||||||
@@ -108,34 +52,16 @@
|
|||||||
pItem.unitPrice
|
pItem.unitPrice
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="shopping_info_amount_original"
|
<view class="shopping_info_amount_original">¥{{ pItem.unitPrice }}</view>
|
||||||
>¥{{ pItem.unitPrice }}</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="shopping_info_quantity">
|
<view class="shopping_info_quantity">
|
||||||
<view
|
<view class="quantity_but" @click="quantityFun('minus', index, pIndex, pItem.id)">-</view>
|
||||||
class="quantity_but"
|
|
||||||
@click="quantityFun('minus', index, pIndex, pItem.id)"
|
|
||||||
>-</view
|
|
||||||
>
|
|
||||||
<view class="quantity_value">{{ pItem.buyNum }}</view>
|
<view class="quantity_value">{{ pItem.buyNum }}</view>
|
||||||
<view
|
<view class="quantity_but" @click="quantityFun('add', index, pIndex, pItem.id)">+</view>
|
||||||
class="quantity_but"
|
|
||||||
@click="quantityFun('add', index, pIndex, pItem.id)"
|
|
||||||
>+</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view v-if="[1].includes(pItem.goodsStatus)" class="insufficient_stock">库存不足</view>
|
||||||
v-if="[1].includes(pItem.goodsStatus)"
|
<view v-if="[2].includes(pItem.goodsStatus)" class="insufficient_stock">商品已下架</view>
|
||||||
class="insufficient_stock"
|
|
||||||
>库存不足</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
v-if="[2].includes(pItem.goodsStatus)"
|
|
||||||
class="insufficient_stock"
|
|
||||||
>商品已下架</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -144,12 +70,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="not_order_warp">
|
<view v-else class="not_order_warp">
|
||||||
<up-image
|
<up-image src="https://static.tbmall.xin/static/not_shopping.png" width="80" height="80"
|
||||||
src="https://static.tbmall.xin/static/not_shopping.png"
|
bgColor="#f1f6ff00"></up-image>
|
||||||
width="80"
|
|
||||||
height="80"
|
|
||||||
bgColor="#f1f6ff00"
|
|
||||||
></up-image>
|
|
||||||
<view class="not_order_msg_warp">购物车是空的</view>
|
<view class="not_order_msg_warp">购物车是空的</view>
|
||||||
</view>
|
</view>
|
||||||
<choiceness />
|
<choiceness />
|
||||||
@@ -159,25 +81,13 @@
|
|||||||
<view class="shopping_cart_but">
|
<view class="shopping_cart_but">
|
||||||
<!-- 全选 -->
|
<!-- 全选 -->
|
||||||
<view class="shopping_cart_but_total">
|
<view class="shopping_cart_but_total">
|
||||||
<up-checkbox
|
<up-checkbox name="isAll" usedAlone v-model:checked="isAll" shape="circle" activeColor="#7934F6" size="19"
|
||||||
name="isAll"
|
iconSize="18" @change="isAllChange">
|
||||||
usedAlone
|
|
||||||
v-model:checked="isAll"
|
|
||||||
shape="circle"
|
|
||||||
activeColor="#7934F6"
|
|
||||||
size="19"
|
|
||||||
iconSize="18"
|
|
||||||
@change="isAllChange"
|
|
||||||
>
|
|
||||||
<template #label>
|
<template #label>
|
||||||
<text style="font-size: 26rpx; color: #444444">全选</text>
|
<text style="font-size: 26rpx; color: #444444">全选</text>
|
||||||
</template>
|
</template>
|
||||||
</up-checkbox>
|
</up-checkbox>
|
||||||
<text
|
<text style="margin-left: 20rpx; font-size: 24rpx; color: #444444" v-if="!isEdit">合计:</text>
|
||||||
style="margin-left: 20rpx; font-size: 24rpx; color: #444444"
|
|
||||||
v-if="!isEdit"
|
|
||||||
>合计:</text
|
|
||||||
>
|
|
||||||
<text style="font-size: 24rpx" v-if="!isEdit">¥</text>
|
<text style="font-size: 24rpx" v-if="!isEdit">¥</text>
|
||||||
<text style="font-size: 32rpx" v-if="!isEdit">{{ total }}</text>
|
<text style="font-size: 32rpx" v-if="!isEdit">{{ total }}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -231,7 +141,7 @@ export default {
|
|||||||
/*#endif*/
|
/*#endif*/
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onLoad() { },
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 查询购物车列表
|
* 查询购物车列表
|
||||||
@@ -532,12 +442,15 @@ export default {
|
|||||||
background-color: $app-bj;
|
background-color: $app-bj;
|
||||||
padding: 104rpx 30rpx 30rpx;
|
padding: 104rpx 30rpx 30rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&.isDataNull-calss {
|
&.isDataNull-calss {
|
||||||
height: calc(100vh - 100rpx - env(safe-area-inset-bottom));
|
height: calc(100vh - 100rpx - env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
&.isDataNull-active {
|
&.isDataNull-active {
|
||||||
height: calc(100vh - 100rpx - env(safe-area-inset-bottom) - 100rpx);
|
height: calc(100vh - 100rpx - env(safe-area-inset-bottom) - 100rpx);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.iosplatformType {
|
&.iosplatformType {
|
||||||
height: calc(100vh - 100rpx - 50rpx) !important;
|
height: calc(100vh - 100rpx - 50rpx) !important;
|
||||||
|
|
||||||
@@ -545,9 +458,9 @@ export default {
|
|||||||
height: calc(100vh - 104rpx - 30rpx - 30rpx - 100rpx - 10rpx) !important;
|
height: calc(100vh - 104rpx - 30rpx - 30rpx - 100rpx - 10rpx) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shopping_cart_but{
|
.shopping_cart_but {
|
||||||
bottom: 90rpx !important;
|
bottom: 90rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,10 +482,7 @@ export default {
|
|||||||
|
|
||||||
.shopping_cart_content {
|
.shopping_cart_content {
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
height: calc(
|
height: calc(100vh - 104rpx - 30rpx - 30rpx - 100rpx - env(safe-area-inset-bottom) - 10rpx);
|
||||||
100vh - 104rpx - 30rpx - 30rpx - 100rpx - env(safe-area-inset-bottom) -
|
|
||||||
10rpx
|
|
||||||
);
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
.shopping_cart_content_item {
|
.shopping_cart_content_item {
|
||||||
|
|||||||
@@ -8,56 +8,28 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tab-box">
|
<view class="tab-box">
|
||||||
<view
|
<view class="tab-item" v-for="(item, index) in tabArr" :key="item.id" @click="onTab(item.id)">
|
||||||
class="tab-item"
|
|
||||||
v-for="(item, index) in tabArr"
|
<image :src="curTab == item.id ? item.iconActive : item.icon" mode="aspectFill" class="tab-img">
|
||||||
:key="index"
|
</image>
|
||||||
@click="onTab(index)"
|
<view class="tab-name" :style="{
|
||||||
>
|
color: curTab == item.id ? '#7A35F6' : '#666',
|
||||||
<image
|
}">{{ item.name }}</view>
|
||||||
:src="curTab == index ? item.icon : item.icon"
|
|
||||||
mode="aspectFill"
|
|
||||||
class="tab-img"
|
|
||||||
></image>
|
|
||||||
<view
|
|
||||||
class="tab-name"
|
|
||||||
:style="{
|
|
||||||
color: curTab == index ? '#7A35F6' : '#666',
|
|
||||||
}"
|
|
||||||
>{{ item.name }}</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="setting-view">
|
<view class="setting-view">
|
||||||
<view class="name-box">
|
<view class="name-box">
|
||||||
<mescroll-uni
|
<mescroll-uni ref="mescrollRef" @down="downCallback" @up="upCallback" :up="upOption" :down="downOption"
|
||||||
ref="mescrollRef"
|
@init="mescrollInit" :fixed="false">
|
||||||
@down="downCallback"
|
|
||||||
@up="upCallback"
|
|
||||||
:up="upOption"
|
|
||||||
:down="downOption"
|
|
||||||
@init="mescrollInit"
|
|
||||||
:fixed="false"
|
|
||||||
>
|
|
||||||
<!-- 原来单个 v-for 替换成两列 -->
|
<!-- 原来单个 v-for 替换成两列 -->
|
||||||
<view class="mescrollUniView">
|
<view class="mescrollUniView">
|
||||||
<view class="fall-col">
|
<view class="fall-col">
|
||||||
<PingItem
|
<PingItem v-for="(item, i) in leftList" :key="item.id" :obj="item" @ok="onJumpShop"
|
||||||
v-for="(item, i) in leftList"
|
style="margin-top: 24rpx" />
|
||||||
:key="item.id"
|
|
||||||
:obj="item"
|
|
||||||
@ok="onJumpShop"
|
|
||||||
style="margin-top: 24rpx"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="fall-col">
|
<view class="fall-col">
|
||||||
<PingItem
|
<PingItem v-for="(item, i) in rightList" :key="item.id" :obj="item" @ok="onJumpShop"
|
||||||
v-for="(item, i) in rightList"
|
style="margin-top: 24rpx" />
|
||||||
:key="item.id"
|
|
||||||
:obj="item"
|
|
||||||
@ok="onJumpShop"
|
|
||||||
style="margin-top: 24rpx"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</mescroll-uni>
|
</mescroll-uni>
|
||||||
@@ -75,19 +47,41 @@ import Header from "@/components/common/header.vue";
|
|||||||
import TopSafe from "@/components/common/top-safe.nvue";
|
import TopSafe from "@/components/common/top-safe.nvue";
|
||||||
import MyBtn from "@/components/common/my-btn.vue";
|
import MyBtn from "@/components/common/my-btn.vue";
|
||||||
import PingItem from "@/components/shop/ping-item.vue";
|
import PingItem from "@/components/shop/ping-item.vue";
|
||||||
import { searchList,getGoodsTags } from "@/api/product.js";
|
import { searchList, getGoodsTags } from "@/api/product.js";
|
||||||
import CustomTabBar from "@/components/custom-tab-bar.vue";
|
import CustomTabBar from "@/components/custom-tab-bar.vue";
|
||||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||||
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue";
|
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [MescrollMixin],
|
mixins: [MescrollMixin],
|
||||||
components: { Header, TopSafe, MyBtn,PingItem, CustomTabBar, MescrollUni },
|
components: { Header, TopSafe, MyBtn, PingItem, CustomTabBar, MescrollUni },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataList: [],
|
dataList: [],
|
||||||
tabArr: [ ],
|
tabArr: [
|
||||||
curTab: 0,
|
{
|
||||||
|
id: 7,
|
||||||
|
name: '信任专享',
|
||||||
|
icon: 'https://static.tbmall.xin/static/new-home/xinren.png',
|
||||||
|
iconActive: 'https://static.tbmall.xin/static/new-home/xinren_active.png',
|
||||||
|
}, {
|
||||||
|
id: 15,
|
||||||
|
name: '全网爆款',
|
||||||
|
icon: 'https://static.tbmall.xin/static/new-home/baokuan.png',
|
||||||
|
iconActive: 'https://static.tbmall.xin/static/new-home/baokuan_active.png',
|
||||||
|
}, {
|
||||||
|
id: 16,
|
||||||
|
name: '低价好物',
|
||||||
|
icon: 'https://static.tbmall.xin/static/new-home/cart.png',
|
||||||
|
iconActive: 'https://static.tbmall.xin/static/new-home/cart_active.png',
|
||||||
|
}, {
|
||||||
|
id: 6,
|
||||||
|
name: '品牌特卖',
|
||||||
|
icon: 'https://static.tbmall.xin/static/new-home/huiyuan.png',
|
||||||
|
iconActive: 'https://static.tbmall.xin/static/new-home/huiyuan_active.png',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
curTab: 7,
|
||||||
upOption: {
|
upOption: {
|
||||||
auto: false,
|
auto: false,
|
||||||
page: {
|
page: {
|
||||||
@@ -111,18 +105,20 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init();
|
console.log("+++++", options)
|
||||||
if(options.index){
|
if (options.index) {
|
||||||
this.curTab = options.index;
|
this.curTab = options.index;
|
||||||
}
|
}
|
||||||
|
this.getSearchList()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.tabArr.length > 0) {
|
if (this.tabArr.length > 0) {
|
||||||
const sortParams = uni.getStorageSync('sortParams');
|
const sortParams = uni.getStorageSync('sortParams');
|
||||||
if (sortParams) {
|
if (sortParams) {
|
||||||
|
|
||||||
|
const targetIndex = this.tabArr.find(item => item.name === sortParams.value)?.id;
|
||||||
uni.removeStorageSync('sortParams');
|
uni.removeStorageSync('sortParams');
|
||||||
const targetIndex = this.tabArr.findIndex(item => item.name === sortParams.value);
|
if (targetIndex) {
|
||||||
if (targetIndex !== -1 && targetIndex !== this.curTab) {
|
|
||||||
this.curTab = targetIndex;
|
this.curTab = targetIndex;
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
this.downCallback();
|
this.downCallback();
|
||||||
@@ -132,29 +128,29 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 查询分类列表
|
* 查询分类列表
|
||||||
*/
|
*/
|
||||||
async getSortList() {
|
async getSortList() {
|
||||||
const resp = await getGoodsTags({ type: 5 });
|
const resp = await getGoodsTags({ type: 5 });
|
||||||
if (resp && resp.bizcode === 100) {
|
if (resp && resp.bizcode === 100) {
|
||||||
this.tabArr = resp.data.sort((a, b) => a.sort - b.sort);
|
this.tabArr = resp.data.sort((a, b) => a.sort - b.sort);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.applySortParams();
|
this.applySortParams();
|
||||||
this.downCallback();
|
this.downCallback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
applySortParams() {
|
applySortParams() {
|
||||||
const sortParams = uni.getStorageSync('sortParams');
|
const sortParams = uni.getStorageSync('sortParams');
|
||||||
if (sortParams && this.tabArr.length > 0) {
|
if (sortParams && this.tabArr.length > 0) {
|
||||||
uni.removeStorageSync('sortParams');
|
uni.removeStorageSync('sortParams');
|
||||||
const targetIndex = this.tabArr.findIndex(item => item.name === sortParams.value);
|
const targetIndex = this.tabArr.findIndex(item => item.name === sortParams.value);
|
||||||
if (targetIndex !== -1 && targetIndex !== this.curTab) {
|
if (targetIndex !== -1 && targetIndex !== this.curTab) {
|
||||||
this.curTab = targetIndex;
|
this.curTab = targetIndex;
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mescrollInit(mescroll) {
|
mescrollInit(mescroll) {
|
||||||
this.mescroll = mescroll;
|
this.mescroll = mescroll;
|
||||||
},
|
},
|
||||||
@@ -166,11 +162,10 @@ export default {
|
|||||||
type: 2,
|
type: 2,
|
||||||
page: page.num,
|
page: page.num,
|
||||||
pageSize: page.size,
|
pageSize: page.size,
|
||||||
isPar: true
|
isPar: true,
|
||||||
|
tag: this.curTab
|
||||||
};
|
};
|
||||||
if (this.tabArr.length > 0 && this.tabArr[this.curTab]) {
|
|
||||||
params["tag"] = this.tabArr[this.curTab].id;
|
|
||||||
}
|
|
||||||
searchList(params).then((res) => {
|
searchList(params).then((res) => {
|
||||||
let curPageLen = res.data.length;
|
let curPageLen = res.data.length;
|
||||||
this.dataList = this.dataList.concat(res.data);
|
this.dataList = this.dataList.concat(res.data);
|
||||||
@@ -187,22 +182,19 @@ export default {
|
|||||||
onTab(index) {
|
onTab(index) {
|
||||||
if (index != this.curTab) {
|
if (index != this.curTab) {
|
||||||
this.curTab = index;
|
this.curTab = index;
|
||||||
|
console.log("----", this.curTab)
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
this.downCallback();
|
this.downCallback();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {;
|
|
||||||
this.getSortList();
|
|
||||||
},
|
|
||||||
async getSearchList() {
|
async getSearchList() {
|
||||||
const params = {
|
const params = {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
isPar: true,
|
isPar: true,
|
||||||
|
tag: this.curTab
|
||||||
};
|
};
|
||||||
if (this.tabArr.length > 0 && this.tabArr[this.curTab]) {
|
|
||||||
params["type"] = this.tabArr[this.curTab].id;
|
|
||||||
}
|
|
||||||
const resp = await searchList(params);
|
const resp = await searchList(params);
|
||||||
if (resp && resp.bizcode === 100) {
|
if (resp && resp.bizcode === 100) {
|
||||||
this.dataList = resp.data || [];
|
this.dataList = resp.data || [];
|
||||||
@@ -249,6 +241,7 @@ export default {
|
|||||||
height: calc(100vh);
|
height: calc(100vh);
|
||||||
background-color: $app-bj;
|
background-color: $app-bj;
|
||||||
}
|
}
|
||||||
|
|
||||||
.head-view {
|
.head-view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 88rpx;
|
min-height: 88rpx;
|
||||||
@@ -258,6 +251,7 @@ export default {
|
|||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
.head-search {
|
.head-search {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 76rpx;
|
height: 76rpx;
|
||||||
@@ -269,6 +263,7 @@ export default {
|
|||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-box {
|
.tab-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
@@ -280,21 +275,25 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|
||||||
.tab-item {
|
.tab-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.tab-img {
|
.tab-img {
|
||||||
width: 56rpx;
|
width: 56rpx;
|
||||||
height: 56rpx;
|
height: 56rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-name {
|
.tab-name {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-view {
|
.tab-view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
@@ -305,6 +304,7 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|
||||||
.tab-list {
|
.tab-list {
|
||||||
margin-right: 24rpx;
|
margin-right: 24rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -315,12 +315,14 @@ export default {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 22rpx;
|
margin-top: 22rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.line {
|
.line {
|
||||||
width: 48rpx;
|
width: 48rpx;
|
||||||
height: 6rpx;
|
height: 6rpx;
|
||||||
background-color: #7a35f6;
|
background-color: #7a35f6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-view {
|
.setting-view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 88rpx - 80rpx - 100rpx - var(--status-bar-height));
|
height: calc(100vh - 88rpx - 80rpx - 100rpx - var(--status-bar-height));
|
||||||
@@ -332,6 +334,7 @@ export default {
|
|||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.name-box {
|
.name-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 88rpx - 80rpx - 100rpx - var(--status-bar-height));
|
height: calc(100vh - 88rpx - 80rpx - 100rpx - var(--status-bar-height));
|
||||||
@@ -346,7 +349,8 @@ export default {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.fall-col {
|
.fall-col {
|
||||||
width: 332rpx; /* 与 PingItem 宽度一致 */
|
width: 332rpx;
|
||||||
|
/* 与 PingItem 宽度一致 */
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user