购物车功能,手机号码兼容台湾香港

This commit is contained in:
liuyuan
2025-07-08 14:19:59 +08:00
parent 249b4b93f6
commit 334b857b39
14 changed files with 175 additions and 81 deletions

View File

@@ -170,6 +170,73 @@
</view>
</view>
</view>
<view class="linkPro" v-if="tjProList.length > 0">
<uni-section style="padding: 0 20rpx;" class="mb-10 graybg" title="相关书籍" type="line"></uni-section>
<view class="list supermarketBox">
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="item" v-for="(item, index) in tjProList" :key="index" @click="goToGoodsList(item)">
<view class="imgcontainer" style="position: relative;">
<view v-if="item.isVipPrice==1&&item.vipPrice!=0&&item.vipPrice!=null"
style="z-index:10;position: absolute;top:0;left:0;text-align: center;font-size: 20rpx;background-color: #f94f04;color: #fff;font-weight: bold;border-radius:4px; line-height: 30rpx; padding:10rpx;box-sizing: border-box;">
VIP优惠</view>
<image :src="item.productImages" mode="aspectFit"></image>
</view>
<view class="name">
{{ item.productName }}
</view>
<text
class="price"
v-if="
item.isVipPrice == 1 &&
item.vipPrice != 0 &&
item.vipPrice != null
"
>
<text
style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ item.vipPrice.toFixed(2) }}</text
>
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(item.price) }}</text
>
</text>
<text
v-else-if="item.activityPrice && item.activityPrice > 0"
class="price"
>
<text
style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ item.activityPrice }}</text
>
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(item.price)}}</text
>
</text>
<text v-else class="price" style="color: #e97512 !important;"
>¥{{ Number(item.price) }}</text
>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</view>
@@ -297,6 +364,7 @@
fuduId: null,
showNewPayBtn: [], //复读状态
newPaymentProList: [], //复读列表数据
tjProList: [], //相关书籍
};
},
onLoad(options) {
@@ -677,6 +745,15 @@
};
}
if (
res.data.shopProductList &&
res.data.shopProductList.length > 0
) {
this.tjProList = res.data.shopProductList;
} else {
this.tjProList = [];
}
//获取的数据解析
that.removeImagesFromHTML();
@@ -686,6 +763,16 @@
that.$forceUpdate();
});
},
//相关书籍跳转
goToGoodsList(data) {
if (data.delFlag == -1) {
this.$commonJS.showToast("商品已下架");
} else {
uni.navigateTo({
url: `/pages/goods/index?isMiaosha=1&id=${data.productId}`,
});
}
},
},
onBackPress() {
// #ifdef APP-PLUS
@@ -709,12 +796,6 @@
}
}
.scroll-view_H {
background-color: #fff;
white-space: nowrap;
padding: 10rpx;
}
.contentBox {
height: calc(100% - 50px);
@@ -1492,4 +1573,59 @@
max-height: 48px;
height: auto;
}
.linkPro {
margin-top: 10rpx;
.more {
font-size: 24rpx;
color: #666;
}
.supermarketBox{
background: #fff;
border-radius: 4px;
box-shadow: 0px 0px 10px 0px #a7bbe4;
}
}
.scroll-view_H {
white-space: nowrap;
padding: 20rpx 10rpx;
margin-top: 12rpx;
.item {
padding: 10rpx;
overflow: hidden;
display: inline-block;
padding-bottom: 0;
width: 210rpx !important;
margin-right: 8rpx;
border-radius: 10rpx;
image {
display: block;
width: 100%;
height: 260rpx;
}
.name {
display: block;
margin-top: 2rpx;
color: #666;
font-size: 28rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
/deep/.uni-section-header__decoration{
width: 14px;
height: 34px;
}
/deep/.distraction{
font-size: 32rpx !important;
color: #294a97 !important;
font-weight: bold;
}
</style>