feat: 更新项目配置与组件使用

- 在入口文件中引入uview-plus的配置,优化字体加载逻辑
- 移除manifest.json中不必要的权限描述
- 更新package.json和package-lock.json,添加开发依赖
- 调整多个组件的样式和结构,提升用户体验
- 修复部分组件的逻辑和样式问题,确保兼容性
This commit is contained in:
pikachu1995@126.com
2026-06-30 16:02:40 +08:00
parent f4337fd030
commit e871509bf5
87 changed files with 3546 additions and 1506 deletions

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<u-popup class="popup" v-model:show="buyMask" :height="setup.height" closeable :mode="setup.mode" :border-radius="setup.radius" @close="closeMask()"> <u-popup class="popup" :show="buyMask" :height="setup.height" closeable :mode="setup.mode" :border-radius="setup.radius" @close="closeMask()">
<!-- 商品 --> <!-- 商品 -->
<view class="goods-box bottom"> <view class="goods-box bottom">
<view class="goods-header"> <view class="goods-header">
@@ -81,16 +81,16 @@
</view> </view>
<!-- 拼团购买仅筛选出当前拼团类型商品 --> <!-- 拼团购买仅筛选出当前拼团类型商品 -->
<template v-for="(spec_val, spec_index) in spec.values" :key="spec_index">
<view <view
v-if="parentOrder && spec_val.skuId == goodsDetail.id" v-if="parentOrder && spec_val.skuId == goodsDetail.id"
:class="{ active: spec_val.value == currentSelected[specIndex] }" :class="{ active: spec_val.value == currentSelected[specIndex] }"
class="skus-view-item" class="skus-view-item"
v-for="(spec_val, spec_index) in spec.values"
:key="spec_index"
@click="handleClickSpec(spec, specIndex, spec_val)" @click="handleClickSpec(spec, specIndex, spec_val)"
> >
{{ spec_val.value }} {{ spec_val.value }}
</view> </view>
</template>
</view> </view>
</view> </view>
<div class="soldout" v-if="goodsDetail.quantity === 0"> <div class="soldout" v-if="goodsDetail.quantity === 0">
@@ -531,11 +531,6 @@ export default {
color: $price-color; color: $price-color;
line-height: 80rpx; line-height: 80rpx;
margin-right: 20rpx; margin-right: 20rpx;
> * {
color: $price-color;
line-height: 80rpx;
}
} }
.promotion-box { .promotion-box {
@@ -565,9 +560,6 @@ export default {
> .goods-check-skus-name { > .goods-check-skus-name {
margin-left: 4rpx; margin-left: 4rpx;
}
> span {
color: #333; color: #333;
} }
} }

View File

@@ -391,12 +391,10 @@ export default {
flex-direction: column; flex-direction: column;
/* #endif */ /* #endif */
margin-right: 5px; margin-right: 5px;
margin-left: 40rpx;
vertical-align: middle; vertical-align: middle;
} }
.color { .color {
color: $light-color; color: $light-color;
} }
icon {
margin-left: 40rpx;
}
</style> </style>

View File

@@ -15,19 +15,19 @@
</div> </div>
<view class="price-box" @click="navigateToDetailPage(item)"> <view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price!=undefined"> <div class="price" v-if="item.price!=undefined">
¥<span>{{ goodsFormatPrice(item.price )[0] }} </span>.{{ ¥<span class="price-int">{{ goodsFormatPrice(item.price )[0] }} </span>.{{
goodsFormatPrice(item.price )[1] goodsFormatPrice(item.price )[1]
}} }}
</div> </div>
</view> </view>
<div class="promotion" @click="navigateToDetailPage(item)"> <div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.salesModel == 'WHOLESALE'"> <div v-if="item.salesModel == 'WHOLESALE'">
<span></span> <span class="promotion-tag"></span>
</div> </div>
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex"> <div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span> <span class="promotion-tag" v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span> <span class="promotion-tag" v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span> <span class="promotion-tag" v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
</div> </div>
</div> </div>
<div class="count-config" @click="navigateToDetailPage(item)"> <div class="count-config" @click="navigateToDetailPage(item)">
@@ -35,14 +35,12 @@
<span>{{ item.commentNum || "0" }}条评论</span> <span>{{ item.commentNum || "0" }}条评论</span>
</div> </div>
<div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)"> <div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)">
<div class="text-hidden"> <view class="store-name-row">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" <text class="self-tag" v-if="item.selfOperated">自营</text>
text="自营" type="error" /> <text class="store-name-text">{{ item.storeName || "暂无" }}</text>
<span>{{ item.storeName || "暂无" }}</span> <text class="to-store">进店</text>
</div> </view>
<span> <u-icon name="arrow-right" size="12" color="#c5c5c5"></u-icon>
<u-icon name="arrow-right"></u-icon>
</span>
</div> </div>
</view> </view>
</view> </view>
@@ -60,36 +58,32 @@
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.goodsName }}</div> <div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)"> <view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price!=undefined"> <div class="price" v-if="item.price!=undefined">
¥<span>{{ goodsFormatPrice(item.price )[0] }} </span>.{{ ¥<span class="price-int">{{ goodsFormatPrice(item.price )[0] }} </span>.{{
goodsFormatPrice(item.price )[1] goodsFormatPrice(item.price )[1]
}} }}
</div> </div>
</view> </view>
<div class="promotion" @click="navigateToDetailPage(item)"> <div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.salesModel == 'WHOLESALE'"> <div v-if="item.salesModel == 'WHOLESALE'">
<span></span> <span class="promotion-tag"></span>
</div> </div>
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex"> <div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span> <span class="promotion-tag" v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span> <span class="promotion-tag" v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span> <span class="promotion-tag" v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
</div> </div>
</div> </div>
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config"> <div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
<span style="float: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span> <span style="float: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span>
<span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span> <span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span>
</div> </div>
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config"> <div class="store-seller-name" @click="navigateToStoreDetailPage(item)">
<div class="text-hidden" v-if="storeName"> <view class="store-name-row" v-if="storeName">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" <text class="self-tag" v-if="item.selfOperated">自营</text>
text="自营" type="error" /> <text class="store-name-text">{{ item.storeName }}</text>
<span class="line1-store-name">{{ item.storeName }}</span> <text class="to-store">进店</text>
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon> </view>
</span> <u-icon name="arrow-right" size="12" color="#c5c5c5"></u-icon>
</div>
<span>
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
</span>
</div> </div>
</div> </div>
</div> </div>
@@ -245,13 +239,59 @@
font-size: $font-sm; font-size: $font-sm;
} }
.text-hidden { .store-seller-name {
color: #666;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 4rpx;
font-size: 24rpx;
}
.store-name-row {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
overflow: hidden;
}
.store-name-text {
flex: 1;
min-width: 0;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} font-size: 24rpx;
color: #999;
} }
.to-store {
flex-shrink: 0;
font-size: 24rpx;
color: #333;
margin-left: 8rpx;
}
.self-tag {
flex-shrink: 0;
margin-right: 8rpx;
padding: 2rpx 10rpx;
border-radius: 8rpx;
background: $main-color;
color: #fff;
font-size: 20rpx;
line-height: 1.4;
}
.count-config {
padding: 5rpx 0;
color: #666;
display: flex;
font-size: 24rpx;
justify-content: space-between;
}
}
.goods-row { .goods-row {
background: #fff; background: #fff;
@@ -290,8 +330,7 @@
margin-top: 4rpx; margin-top: 4rpx;
display: flex; display: flex;
div { .promotion-tag {
span {
font-size: 24rpx; font-size: 24rpx;
color: $light-color; color: $light-color;
margin-right: 10rpx; margin-right: 10rpx;
@@ -299,13 +338,50 @@
border-radius: 2rpx; border-radius: 2rpx;
} }
} }
}
.store-seller-name { .store-seller-name {
color: #666; color: #666;
overflow: hidden;
display: flex; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 4rpx;
font-size: 24rpx;
}
.store-name-row {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
overflow: hidden;
}
.store-name-text {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 24rpx;
color: #999;
}
.to-store {
flex-shrink: 0;
font-size: 24rpx;
color: #333;
margin-left: 8rpx;
}
.self-tag {
flex-shrink: 0;
margin-right: 8rpx;
padding: 2rpx 10rpx;
border-radius: 8rpx;
background: $main-color;
color: #fff;
font-size: 20rpx;
line-height: 1.4;
} }
.count-config { .count-config {
@@ -331,7 +407,7 @@
color: $main-color; color: $main-color;
font-weight: bold; font-weight: bold;
::v-deep span:nth-of-type(1) { .price-int {
font-size: 38rpx; font-size: 38rpx;
} }
} }

View File

@@ -13,28 +13,28 @@
<view class="price-box"> <view class="price-box">
<!-- 秒杀 / 拼团 --> <!-- 秒杀 / 拼团 -->
<div class="price" v-if="!type && item.price!=undefined"> <div class="price" v-if="!type && item.price!=undefined">
¥<span>{{ goodsFormatPrice(item.price )[0] }} </span>.{{ ¥<span class="price-int">{{ goodsFormatPrice(item.price )[0] }} </span>.{{
goodsFormatPrice(item.price )[1] goodsFormatPrice(item.price )[1]
}} }}
</div> </div>
<!-- 砍价 --> <!-- 砍价 -->
<div class="price" v-if="type && item.purchasePrice!=undefined"> <div class="price" v-if="type && item.purchasePrice!=undefined">
最低 最低
¥<span>{{ goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{ ¥<span class="price-int">{{ goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{
goodsFormatPrice(item.purchasePrice )[1] goodsFormatPrice(item.purchasePrice )[1]
}} }}
</div> </div>
<!-- 兜底策略如果金额是0 --> <!-- 兜底策略如果金额是0 -->
<div class="price" v-if="!item.price && !type"> <div class="price" v-if="!item.price && !type">
¥<span>0 </span>.00 ¥<span class="price-int">0 </span>.00
</div> </div>
</view> </view>
<div> <div>
<image class='buy' :src="buy"></image> <image class="buy" src="/static/buy.png"></image>
</div> </div>
</div> </div>
<div class='count-config' v-if="!type"> <div class='count-config' v-if="!type">
<span>即将恢复{{ item.originalPrice}}</span> <text class="count-config-text">即将恢复{{ item.originalPrice}}</text>
</div> </div>
</div> </div>
</div> </div>
@@ -49,7 +49,6 @@
data() { data() {
return { return {
lightColor: this.$mainColor, lightColor: this.$mainColor,
buy: require('@/static/buy.png')
} }
}, },
mixins: [commonTpl], mixins: [commonTpl],
@@ -119,21 +118,6 @@
overflow: hidden; overflow: hidden;
} }
.promotion {
margin-top: 4rpx;
display: flex;
div {
span {
font-size: 24rpx;
color: $light-color;
margin-right: 10rpx;
padding: 0 4rpx;
border-radius: 2rpx;
}
}
}
.count-config { .count-config {
padding: 5rpx 0; padding: 5rpx 0;
color: #666; color: #666;
@@ -141,6 +125,10 @@
font-size: 24rpx; font-size: 24rpx;
letter-spacing:2rpx; letter-spacing:2rpx;
padding-left: 10rpx; padding-left: 10rpx;
.count-config-text {
font-size: 24rpx;
}
} }
@@ -162,7 +150,7 @@
color: $main-color; color: $main-color;
font-weight: bold; font-weight: bold;
::v-deep span:nth-of-type(1) { .price-int {
font-size: 48rpx; font-size: 48rpx;
} }
} }

View File

@@ -100,10 +100,6 @@ $w_94: 94%;
border-top-left-radius: 20rpx; border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx; border-top-right-radius: 20rpx;
overflow: hidden; overflow: hidden;
> img {
width: 100%;
height: 100%;
}
} }
.goods-desc { .goods-desc {
border-bottom-left-radius: 20rpx; border-bottom-left-radius: 20rpx;

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="serach"> <view class="serach">
<view class="left-box" @tap="onClickLeft"> <view class="left-box" @tap="onClickLeft">
<u-icon name="arrow-left" size="40" color="#666"></u-icon> <u-icon name="arrow-left" size="28" color="#666"></u-icon>
</view> </view>
<view class="content" :style="{ 'border-radius': radius + 'px' }"> <view class="content" :style="{ 'border-radius': radius + 'px' }">
<!-- HM修改 增加进入输入状态的点击范围 --> <!-- HM修改 增加进入输入状态的点击范围 -->
@@ -21,8 +21,8 @@
</view> </view>
<view v-else class="button-item"> <view v-else class="button-item">
<u-icon name="grid-fill" size="50" @click="handelListClass()" v-if="!switchLayout"></u-icon> <u-icon name="grid-fill" size="32" @click="handelListClass()" v-if="!switchLayout"></u-icon>
<u-icon v-else @click="handelListClass()" name="list-dot" size="50"></u-icon> <u-icon v-else @click="handelListClass()" name="list-dot" size="32"></u-icon>
</view> </view>
</view> </view>
</view> </view>
@@ -162,7 +162,7 @@ export default {
.serach { .serach {
display: flex; display: flex;
width: 100%; width: 100%;
//border-bottom: 1px #f5f5f5 solid; //HM修改 去掉边框 align-items: center;
box-sizing: border-box; box-sizing: border-box;
font-size: 24rpx; font-size: 24rpx;
@@ -170,53 +170,41 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 15%; flex-shrink: 0;
/* #ifndef APP-NVUE */ width: auto;
text-align: center; padding: 0 8rpx;
// display: flex;
// /* #endif */
} }
.content { .content {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; flex: 1;
min-width: 0;
height: 70rpx; height: 70rpx;
color: #999; color: #999;
background: #eee; background: #eee;
overflow: hidden; overflow: hidden;
transition: all 0.2s linear; transition: all 0.2s linear;
border-radius: 1000rpx;
.content-box { .content-box {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
&.center { &.center {
justify-content: center; justify-content: flex-start;
}
.icon {
padding: 0 15rpx;
&.icon-serach:before {
content: "\e61c";
}
} }
.input { .input {
width: 100%; flex: 1;
max-width: 100%; min-width: 0;
width: auto;
line-height: 60rpx; line-height: 60rpx;
height: 60rpx; height: 60rpx;
transition: all 0.2s linear; transition: all 0.2s linear;
&.center { &.center {
width: 200rpx;
}
&.sub {
// position: absolute;
width: auto; width: auto;
color: grey;
} }
} }
} }
@@ -226,16 +214,16 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative;
flex-shrink: 0; flex-shrink: 0;
width: 0; width: 0;
overflow: hidden;
transition: all 0.2s linear; transition: all 0.2s linear;
white-space: nowrap; white-space: nowrap;
overflow: hidden;
&.active { &.active {
padding-left: 15rpx; padding-left: 12rpx;
width: 100rpx; width: auto;
min-width: 80rpx;
} }
} }
} }

View File

@@ -15,14 +15,14 @@
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view class="share-item" @click="handleShare(item)" v-for="(item, index) in list" :key="index"> <view class="share-item" @click="handleShare(item)" v-for="(item, index) in list" :key="index">
<u-icon :color="item.color" size="80" :name="item.icon"></u-icon> <u-icon class="share-icon" :color="item.color" size="80" :name="item.icon"></u-icon>
<view>{{ item.title }}</view> <view class="share-label">{{ item.title }}</view>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<view class="share-item" @click="copyLink()"> <view class="share-item" @click="copyLink()">
<u-icon color="#b4aee8" size="80" name="share-fill"></u-icon> <u-icon class="share-icon" color="#b4aee8" size="80" name="share-fill"></u-icon>
<view>{{ '复制链接' }}</view> <view class="share-label">{{ '复制链接' }}</view>
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
@@ -156,7 +156,7 @@ export default {
top: 30rpx; top: 30rpx;
} }
} }
button:after { .share-btn:after {
border: none; border: none;
} }
@@ -169,7 +169,8 @@ button:after {
width: 25%; width: 25%;
font-size: 24rpx; font-size: 24rpx;
color: #666; color: #666;
> * { > .share-icon,
> .share-label {
margin: 8rpx 0; margin: 8rpx 0;
} }
} }

View File

@@ -0,0 +1,86 @@
<template>
<view class="u-time-line-item">
<view class="u-time-line-item__node" :style="nodeStyle">
<slot name="node">
<view class="u-time-line-item__dot" :style="{ backgroundColor: bgColor }"></view>
</slot>
</view>
<view class="u-time-line-item__content">
<slot name="content" />
</view>
</view>
</template>
<script>
export default {
name: 'UTimeLineItem',
props: {
nodeTop: {
type: [String, Number],
default: ''
},
bgColor: {
type: String,
default: '#ffffff'
}
},
computed: {
nodeStyle() {
if (this.nodeTop === '' || this.nodeTop === null || this.nodeTop === undefined) {
return {}
}
const top = typeof this.nodeTop === 'number' ? `${this.nodeTop}rpx` : this.nodeTop
return { top }
}
}
}
</script>
<style lang="scss" scoped>
.u-time-line-item {
display: flex;
flex-direction: row;
position: relative;
padding-bottom: 32rpx;
&:last-child {
padding-bottom: 0;
}
&__node {
position: relative;
width: 32rpx;
display: flex;
justify-content: center;
flex-shrink: 0;
z-index: 1;
}
&__dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: #ddd;
}
&__content {
flex: 1;
padding-left: 12rpx;
}
&::before {
content: '';
position: absolute;
left: 15rpx;
top: 0;
bottom: 0;
width: 1px;
background-color: #ddd;
}
&:last-child::before {
bottom: auto;
height: 16rpx;
}
}
</style>

View File

@@ -0,0 +1,18 @@
<template>
<view class="u-time-line">
<slot />
</view>
</template>
<script>
export default {
name: 'UTimeLine'
}
</script>
<style lang="scss" scoped>
.u-time-line {
display: flex;
flex-direction: column;
}
</style>

View File

@@ -2,22 +2,22 @@
<view class="uni-load-more"> <view class="uni-load-more">
<view class="uni-load-more__img" v-show="status === 'loading' && showIcon"> <view class="uni-load-more__img" v-show="status === 'loading' && showIcon">
<view class="load1"> <view class="load1">
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
</view> </view>
<view class="load2"> <view class="load2">
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
</view> </view>
<view class="load3"> <view class="load3">
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
<view :style="{ background: color }"></view> <view class="load-item" :style="{ background: color }"></view>
</view> </view>
</view> </view>
<text class="uni-load-more__text" :style="{ color: color }" v-if="showText"> <text class="uni-load-more__text" :style="{ color: color }" v-if="showText">
@@ -86,11 +86,13 @@ export default {
margin-right: 10px; margin-right: 10px;
} }
.uni-load-more__img > view { .load1,
.load2,
.load3 {
position: absolute; position: absolute;
} }
.uni-load-more__img > view view { .load-item {
width: 6px; width: 6px;
height: 2px; height: 2px;
border-top-left-radius: 1px; border-top-left-radius: 1px;
@@ -102,25 +104,25 @@ export default {
animation: load 1.56s ease infinite; animation: load 1.56s ease infinite;
} }
.uni-load-more__img > view view:nth-child(1) { .load-item:nth-child(1) {
transform: rotate(90deg); transform: rotate(90deg);
top: 2px; top: 2px;
left: 9px; left: 9px;
} }
.uni-load-more__img > view view:nth-child(2) { .load-item:nth-child(2) {
transform: rotate(180deg); transform: rotate(180deg);
top: 11px; top: 11px;
right: 0; right: 0;
} }
.uni-load-more__img > view view:nth-child(3) { .load-item:nth-child(3) {
transform: rotate(270deg); transform: rotate(270deg);
bottom: 2px; bottom: 2px;
left: 9px; left: 9px;
} }
.uni-load-more__img > view view:nth-child(4) { .load-item:nth-child(4) {
top: 11px; top: 11px;
left: 0; left: 0;
} }
@@ -140,51 +142,51 @@ export default {
transform: rotate(60deg); transform: rotate(60deg);
} }
.load1 view:nth-child(1) { .load1 .load-item:nth-child(1) {
animation-delay: 0s; animation-delay: 0s;
} }
.load2 view:nth-child(1) { .load2 .load-item:nth-child(1) {
animation-delay: 0.13s; animation-delay: 0.13s;
} }
.load3 view:nth-child(1) { .load3 .load-item:nth-child(1) {
animation-delay: 0.26s; animation-delay: 0.26s;
} }
.load1 view:nth-child(2) { .load1 .load-item:nth-child(2) {
animation-delay: 0.39s; animation-delay: 0.39s;
} }
.load2 view:nth-child(2) { .load2 .load-item:nth-child(2) {
animation-delay: 0.52s; animation-delay: 0.52s;
} }
.load3 view:nth-child(2) { .load3 .load-item:nth-child(2) {
animation-delay: 0.65s; animation-delay: 0.65s;
} }
.load1 view:nth-child(3) { .load1 .load-item:nth-child(3) {
animation-delay: 0.78s; animation-delay: 0.78s;
} }
.load2 view:nth-child(3) { .load2 .load-item:nth-child(3) {
animation-delay: 0.91s; animation-delay: 0.91s;
} }
.load3 view:nth-child(3) { .load3 .load-item:nth-child(3) {
animation-delay: 1.04s; animation-delay: 1.04s;
} }
.load1 view:nth-child(4) { .load1 .load-item:nth-child(4) {
animation-delay: 1.17s; animation-delay: 1.17s;
} }
.load2 view:nth-child(4) { .load2 .load-item:nth-child(4) {
animation-delay: 1.3s; animation-delay: 1.3s;
} }
.load3 view:nth-child(4) { .load3 .load-item:nth-child(4) {
animation-delay: 1.43s; animation-delay: 1.43s;
} }

View File

@@ -24,9 +24,8 @@
<!-- 输入框 - --> <!-- 输入框 - -->
<view id="xt__input-ground" class="xt__input-ground"> <view id="xt__input-ground" class="xt__input-ground">
<template v-for="(item, index) in size"> <template v-for="(item, index) in size" :key="index">
<view <view
:key="index"
:style="{ borderColor: code.length === index && cursorVisible ? boxActiveColor : boxNormalColor }" :style="{ borderColor: code.length === index && cursorVisible ? boxActiveColor : boxNormalColor }"
:class="['xt__box', `xt__box-${type + ''}`, `xt__box::after`]" :class="['xt__box', `xt__box-${type + ''}`, `xt__box::after`]"
> >

View File

@@ -1,8 +1,7 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/; var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
exports.weBtoa = function (string) { export function weBtoa(string) {
string = String(string); string = String(string);
var bitmap, a, b, c, result = "", i = 0, rest = string.length % 3; var bitmap, a, b, c, result = "", i = 0, rest = string.length % 3;
for (; i < string.length;) { for (; i < string.length;) {
@@ -15,8 +14,8 @@ exports.weBtoa = function (string) {
b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63); b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
} }
return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result; return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;
}; }
exports.weAtob = function (string) { export function weAtob(string) {
string = String(string).replace(/[\t\n\f\r ]+/g, ""); string = String(string).replace(/[\t\n\f\r ]+/g, "");
if (!b64re.test(string)) if (!b64re.test(string))
throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded."); throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
@@ -30,9 +29,9 @@ exports.weAtob = function (string) {
String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255); String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
} }
return result; return result;
}; }
function b64DecodeUnicode(str) { function b64DecodeUnicode(str) {
return decodeURIComponent(exports.weAtob(str).replace(/(.)/g, function (p) { return decodeURIComponent(weAtob(str).replace(/(.)/g, function (p) {
var code = p.charCodeAt(0).toString(16).toUpperCase(); var code = p.charCodeAt(0).toString(16).toUpperCase();
if (code.length < 2) { if (code.length < 2) {
code = "0" + code; code = "0" + code;
@@ -58,7 +57,7 @@ function base64_url_decode(str) {
return b64DecodeUnicode(output); return b64DecodeUnicode(output);
} }
catch (err) { catch (err) {
return exports.weAtob(output); return weAtob(output);
} }
} }
function weappJwtDecode(token, options) { function weappJwtDecode(token, options) {
@@ -74,4 +73,4 @@ function weappJwtDecode(token, options) {
throw ("Invalid token specified: " + e.message); throw ("Invalid token specified: " + e.message);
} }
} }
exports.default = weappJwtDecode; export default weappJwtDecode;

View File

@@ -265,7 +265,7 @@ function checkSystemEnableLocation() {
} }
} }
module.exports = { export default {
judgeIosPermission: judgeIosPermission, judgeIosPermission: judgeIosPermission,
requestAndroidPermission: requestAndroidPermission, requestAndroidPermission: requestAndroidPermission,
checkSystemEnableLocation: checkSystemEnableLocation, checkSystemEnableLocation: checkSystemEnableLocation,

28
main.js
View File

@@ -1,6 +1,6 @@
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
import App from './App' import App from './App'
import uviewPlus from 'uview-plus' import uviewPlus, { setConfig } from 'uview-plus'
import store from './store' import store from './store'
import config from '@/config/config' import config from '@/config/config'
import airBtn from '@/components/m-airbtn/index.vue' import airBtn from '@/components/m-airbtn/index.vue'
@@ -10,9 +10,35 @@ import * as filterUtils from './utils/filters.js'
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
// #ifdef MP-WEIXIN
// 微信开发者工具部分版本在输出 Vue warn 时会触发
// TypeError: Cannot read property '__global' of null自定义 handler 绕过默认路径
app.config.warnHandler = (msg, _instance, trace) => {
if (
typeof msg === 'string' &&
msg.includes('enumerating keys on a component instance')
) {
return
}
try {
console.warn(`[Vue warn]: ${msg}${trace || ''}`)
} catch (e) {
// 忽略开发者工具 console 代理异常
}
}
// #endif
app.use(store) app.use(store)
app.use(uviewPlus) app.use(uviewPlus)
// uview-plus 的图标字体默认每个 u-icon 实例都会触发 uni.loadFontFace
// 导致进入页面时同一字体被反复请求。开启 loadFontOnce 后全局只加载一次。
setConfig({
config: {
loadFontOnce: true,
},
})
app.config.globalProperties.$store = store app.config.globalProperties.$store = store
app.config.globalProperties.$mainColor = config.mainColor app.config.globalProperties.$mainColor = config.mainColor
app.config.globalProperties.$lightColor = config.lightColor app.config.globalProperties.$lightColor = config.lightColor

View File

@@ -205,9 +205,6 @@
"permission" : { "permission" : {
"scope.userLocation" : { "scope.userLocation" : {
"desc" : "位置信息将用于高德地图的效果展示" "desc" : "位置信息将用于高德地图的效果展示"
},
"scope.writePhotosAlbum" : {
"desc" : "将用于保存图片"
} }
}, },
"plugins" : {}, "plugins" : {},

1176
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,8 @@
"description": "Lilishop uni-app mobile client (Vue 3)", "description": "Lilishop uni-app mobile client (Vue 3)",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"migrate:vue3": "node scripts/migrate-vue3.js && node scripts/migrate-filters-usage.js" "migrate:vue3": "node scripts/migrate-vue3.js && node scripts/migrate-filters-usage.js",
"postinstall": "patch-package"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -15,5 +16,9 @@
"sass": "^1.89.2", "sass": "^1.89.2",
"uview-plus": "^3.4.72", "uview-plus": "^3.4.72",
"vuex": "^4.1.0" "vuex": "^4.1.0"
},
"devDependencies": {
"patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0"
} }
} }

View File

@@ -5,6 +5,10 @@
"custom": { "custom": {
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^u-loading$": "uview-plus/components/u-loading-icon/u-loading-icon.vue",
"^u-alert-tips$": "uview-plus/components/u-alert/u-alert.vue",
"^u-time-line-item$": "@/components/u-time-line/u-time-line-item.vue",
"^u-time-line$": "@/components/u-time-line/u-time-line.vue",
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
} }
}, },
@@ -53,10 +57,10 @@
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"disableScroll": true, "disableScroll": true,
"app-plus": {
"bounce": "none", "bounce": "none",
"scrollIndicator": "none" "scrollIndicator": "none"
}
} }
}, },
@@ -472,9 +476,11 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"style": { "style": {
"navigationBarTitleText": "商品评价", "navigationBarTitleText": "商品评价",
"app-plus": {
//app页面不显示滚动条 //app页面不显示滚动条
"scrollIndicator": "none" "scrollIndicator": "none"
} }
}
}, },
{ // 客服 { // 客服
"path": "customerservice/index", "path": "customerservice/index",
@@ -832,10 +838,8 @@
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "Lili商城", "navigationBarTitleText": "Lili商城",
"titleColor": "#303133",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"backgroundColor": "#fff", "backgroundColor": "#fff",
"color": "#FFFFFF",
"app-plus": { "app-plus": {
// 全局关闭回弹功能 // 全局关闭回弹功能
"bounce": "none" "bounce": "none"

View File

@@ -37,7 +37,6 @@
<!-- 数据 --> <!-- 数据 -->
<view <view
v-if="navItem.dataList && coupon"
class="coupon-item" class="coupon-item"
:class="{ 'coupon-used': navIndex != 0 }" :class="{ 'coupon-used': navIndex != 0 }"
v-for="(coupon, index) in navItem.dataList" v-for="(coupon, index) in navItem.dataList"

View File

@@ -1,9 +1,9 @@
<template> <template>
<view class="wrapper" v-if="flag"> <view class="wrapper" v-if="flag">
<div class='goods' v-if="selectedGoods"> <div class='goods' v-if="selectedGoods">
<image class="goods-image" :src="selectedGoods.thumbnail" alt=""> <image class="goods-image" :src="selectedGoods.thumbnail" alt="" />
<p class="goodsName">{{selectedGoods.goodsName}}</p> <p class="goodsName">{{selectedGoods.goodsName}}</p>
<div class="goodsPrice">{{(selectedGoods.promotionPrice ||unitPrice(selectedGoods.price ), '¥')}}</div> <div class="goodsPrice">{{ unitPrice(selectedGoods.promotionPrice || selectedGoods.price, '¥') }}</div>
</div> </div>
<div> <div>
<div class="tips"> <div class="tips">
@@ -55,7 +55,7 @@
<div class="user-list" v-if="data.pintuanMemberVOS"> <div class="user-list" v-if="data.pintuanMemberVOS">
<div class="user-item" v-for="(item,index) in data.pintuanMemberVOS" :key="index"> <div class="user-item" v-for="(item,index) in data.pintuanMemberVOS" :key="index">
<span class="master" v-if="item.orderSn == ''">团长</span> <span class="master" v-if="item.orderSn == ''">团长</span>
<image class="img" :src="item.face" alt=""> <image class="img" :src="item.face" alt="" />
</div> </div>
</div> </div>

View File

@@ -25,9 +25,7 @@
<u-form-item label="地址别名" label-width="130"> <u-form-item label="地址别名" label-width="130">
<u-input v-model="form.alias" placeholder="请输入地址别名" /> <u-input v-model="form.alias" placeholder="请输入地址别名" />
</u-form-item> </u-form-item>
<u-checkbox-group shape="circle" size="30"> <u-checkbox usedAlone shape="circle" size="30" :active-color="lightColor" v-model:checked="form.isDefault" label="设为默认地址"></u-checkbox>
<u-checkbox :active-color="lightColor" v-model="form.isDefault">设为默认地址</u-checkbox>
</u-checkbox-group>
<div class="saveBtn" @click="save">保存</div> <div class="saveBtn" @click="save">保存</div>
</u-form> </u-form>
@@ -144,33 +142,43 @@ export default {
// 保存当前 地址 // 保存当前 地址
save() { save() {
this.$refs.uForm.validate((valid) => { this.$refs.uForm.validate().then(() => {
if (valid) { const params = { ...this.form };
let pages = getCurrentPages(); //获取页面栈 delete params.___path;
let beforePage = pages[pages.length - 2]; //上个页面
// 如果没有id则为新增地址 if (Array.isArray(params.consigneeAddressIdPath)) {
if (!this.form.id) { params.consigneeAddressIdPath = params.consigneeAddressIdPath.join(",");
// 删除没有的数据 }
delete this.form.___path; if (Array.isArray(params.consigneeAddressPath)) {
addAddress(this.form).then((res) => { params.consigneeAddressPath = params.consigneeAddressPath.join(",");
}
if (!params.id) {
addAddress(params).then((res) => {
if (res.data.success) { if (res.data.success) {
uni.navigateBack(); uni.navigateBack();
} else {
uni.showToast({
title: res.data.message || "保存失败",
icon: "none",
});
} }
}); });
} else { } else {
// 修改地址 delete params.updateBy;
delete this.form.___path; delete params.updateTime;
delete this.form.updateBy; editAddress(params).then((res) => {
delete this.form.updateTime;
editAddress(this.form).then((res) => {
if (res.data.success) { if (res.data.success) {
uni.navigateBack(); uni.navigateBack();
} else {
uni.showToast({
title: res.data.message || "保存失败",
icon: "none",
});
} }
}); });
} }
} }).catch(() => {});
});
}, },
// 三级地址联动回调 // 三级地址联动回调

View File

@@ -119,14 +119,22 @@
background: $light-color; background: $light-color;
position: fixed; position: fixed;
width: 690rpx; width: 690rpx;
bottom: 60rpx; bottom: calc(60rpx + constant(safe-area-inset-bottom));
bottom: calc(60rpx + env(safe-area-inset-bottom));
height: 80rpx; height: 80rpx;
left: 30rpx; left: 30rpx;
font-size: 30rpx; font-size: 30rpx;
line-height: 80rpx; color: #fff;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
z-index: 99;
overflow: hidden;
.u-icon { .btn-text {
margin-right: 10rpx; margin-left: 12rpx;
line-height: 1;
} }
} }
} }

View File

@@ -34,10 +34,10 @@
</view> </view>
<view style="height: 100px"></view> <view style="height: 100px"></view>
</view> </view>
<button type="default" class="btn" @click="addAddress('')"> <view class="btn" @click="addAddress('')">
<u-icon name="plus-circle"></u-icon> <u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
添加新收货人 <text class="btn-text">添加新收货人</text>
</button> </view>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet> <u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view> </view>
</template> </template>

View File

@@ -34,10 +34,10 @@
<view style="height: 100px"></view> <view style="height: 100px"></view>
</view> </view>
<button type="default" class="btn" @click="addAddress('')"> <view class="btn" @click="addAddress('')">
<u-icon name="plus-circle"></u-icon> <u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
添加新收货人 <text class="btn-text">添加新收货人</text>
</button> </view>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet> <u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view> </view>

View File

@@ -122,9 +122,7 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
> * { gap: 20rpx;
margin: 10rpx 0;
}
width: 33%; width: 33%;
// color: #fff; // color: #fff;
} }

View File

@@ -6,13 +6,15 @@
<div class="bagbar">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div> <div class="bagbar">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div>
</div> </div>
<u-card @click="goDetail(row.sn,row.logi_id,row.ship_no)" :title="title" title-color="#666666" title-size="24" sub-title-color="#666666" sub-title-size="24" :border="false" :sub-title=row.status> <u-card @click="goDetail(row.sn,row.logi_id,row.ship_no)" :title="title" title-color="#666666" title-size="24" sub-title-color="#666666" sub-title-size="24" :border="false" :sub-title=row.status>
<view class="msg-body" #body> <template #body>
<view class="msg-body">
<image class="msgImg" :src="row.goods_img" mode=""></image> <image class="msgImg" :src="row.goods_img" mode=""></image>
<view class="msgView"> <view class="msgView">
<view>{{row.goodsName}}</view> <view>{{row.goodsName}}</view>
<view class="msgNum">订单号:{{row.sn}}</view> <view class="msgNum">订单号:{{row.sn}}</view>
</view> </view>
</view> </view>
</template>
</u-card> </u-card>
</view> </view>
</block> </block>
@@ -99,7 +101,7 @@ export default {
color: #fff; color: #fff;
font-size: 24rpx; font-size: 24rpx;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
background: $u-type-info-disabled; background: $u-info-disabled;
} }
.storeImg { .storeImg {
width: 100%; width: 100%;

View File

@@ -10,11 +10,11 @@
</div> </div>
<div class="msgMsg">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div> <div class="msgMsg">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div>
<u-card :title="title" :title-size="35" :border="false"> <u-card :title="title" :title-size="35" :border="false">
<view class #body> <template #body>
<view class="u-body-item u-flex u-row-between u-p-b-0"> <view class="u-body-item u-flex u-row-between u-p-b-0">
<view class="u-body-item-title u-line-2">{{row.content}}</view> <view class="u-body-item-title u-line-2">{{row.content}}</view>
</view> </view>
</view> </template>
</u-card> </u-card>
</view> </view>
</block> </block>

View File

@@ -1,44 +1,75 @@
<template> <template>
<view class="content"> <view class="content">
<u-navbar> <u-navbar
<u-tabs :active-color="lightColor" class="slot-wrap" :list="navList" :is-scroll="true" :current="tabCurrentIndex" @change="tabClick"></u-tabs> :fixed="true"
:placeholder="true"
:border="false"
left-icon=""
title=""
>
<template #center>
<view class="slot-wrap">
<u-tabs
:active-color="lightColor"
class="collect-tabs"
:list="navList"
:is-scroll="true"
:current="tabCurrentIndex"
@change="tabClick"
></u-tabs>
</view>
</template>
</u-navbar> </u-navbar>
<view class="swiper-box"> <view class="collect-body">
<!-- 显示商品栏 --> <!-- 显示商品栏 -->
<view v-if="tabCurrentIndex == 0" class="tab-content"> <view v-if="tabCurrentIndex == 0" class="tab-content">
<scroll-view class="list-scroll-content" scroll-y> <scroll-view class="list-scroll-content" scroll-y>
<!-- 空白页 -->
<u-empty style="margin-top: 40rpx" text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty> <u-empty style="margin-top: 40rpx" text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
<!-- 商品展示数据 --> <template v-else>
<u-swipe-action v-else v-for="(item, index) in goodList" :key="index"> <u-swipe-action
<u-swipe-action-item @open="openLeftChange(item, index, 'goods')" :show="item.selected" v-for="(item, index) in goodList"
:key="index"
class="collect-swipe"
>
<u-swipe-action-item
@open="openLeftChange(item, 'goods')"
:show="item.selected"
:options="LeftOptions" :options="LeftOptions"
@click="clickGoodsSwiperAction(item, index)" :name="index"> @click="clickGoodsSwiperAction(item, index)"
:name="index"
>
<view class="goods" @click="goGoodsDetail(item)"> <view class="goods" @click="goGoodsDetail(item)">
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit"> <u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
<template #loading><u-loading></u-loading></template> <template #loading><u-loading></u-loading></template>
</u-image> </u-image>
<view class="goods-intro"> <view class="goods-intro">
<view>{{ item.goodsName }}</view> <view class="goods-name">{{ item.goodsName }}</view>
<view class="goods-sn">{{ item.goods_sn }}</view> <view class="goods-sn">{{ item.goods_sn }}</view>
<view>{{unitPrice(item.price) }}</view> <view class="goods-price">{{ unitPrice(item.price) }}</view>
</view> </view>
</view> </view>
</u-swipe-action-item> </u-swipe-action-item>
</u-swipe-action> </u-swipe-action>
</template>
</scroll-view> </scroll-view>
</view> </view>
<!-- 显示收藏的店铺栏 --> <!-- 显示收藏的店铺栏 -->
<view v-else class="tab-content"> <view v-else class="tab-content">
<scroll-view class="list-scroll-content" scroll-y> <scroll-view class="list-scroll-content" scroll-y>
<!-- 空白页 -->
<u-empty style="margin-top: 40rpx" text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty> <u-empty style="margin-top: 40rpx" text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
<!-- 店铺展示数据 --> <template v-else>
<u-swipe-action v-else v-for="(item, index) in storeList" :key="index"> <u-swipe-action
<u-swipe-action-item @open="openLeftChange(item, 'store')" :show="item.selected" v-for="(item, index) in storeList"
:key="index"
class="collect-swipe"
>
<u-swipe-action-item
@open="openLeftChange(item, 'store')"
:show="item.selected"
:options="LeftOptions" :options="LeftOptions"
@click="clickStoreSwiperAction(item)"> @click="clickStoreSwiperAction(item)"
:name="index"
>
<view class="store" @click="goStoreMainPage(item.id)"> <view class="store" @click="goStoreMainPage(item.id)">
<view class="intro"> <view class="intro">
<view class="store-logo"> <view class="store-logo">
@@ -59,6 +90,7 @@
</view> </view>
</u-swipe-action-item> </u-swipe-action-item>
</u-swipe-action> </u-swipe-action>
</template>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
@@ -142,16 +174,10 @@
* 打开商品左侧取消收藏 * 打开商品左侧取消收藏
*/ */
openLeftChange(val, type) { openLeftChange(val, type) {
const { const way = type === "goods" ? this.goodList : this.storeList;
goodList,
storeList
} = this;
let way;
type == "goods" ? (way = goodList) : (way = storeList);
way.forEach((item) => { way.forEach((item) => {
item["selected"] = false; item.selected = false;
}); });
val["selected"] = false;
val.selected = true; val.selected = true;
}, },
@@ -284,19 +310,30 @@
height: 100%; height: 100%;
} }
.slot-wrap{ .content {
flex: 1; width: 100%;
display: flex; display: flex;
justify-content: center; flex-direction: column;
padding-right: 72rpx; min-height: 100vh;
} }
.content { .slot-wrap {
width: 100%;
display: flex;
justify-content: center;
}
.collect-tabs {
width: 100%; width: 100%;
} }
.swiper-box { .collect-body {
overflow-y: auto; flex: 1;
min-height: 0;
}
.tab-content {
height: 100%;
} }
.list-scroll-content { .list-scroll-content {
@@ -304,63 +341,52 @@
width: 100%; width: 100%;
} }
::v-deep .u-swipe-content { .collect-swipe,
:deep(.u-swipe-action),
:deep(.u-swipe-action-item),
:deep(.u-swipe-action-item__content) {
width: 100%;
}
:deep(.u-swipe-action-item__content) {
overflow: hidden; overflow: hidden;
} }
.goods { .goods {
background-color: #fff; background-color: #fff;
border-bottom: 1px solid $border-color-light; border-bottom: 1px solid $border-color-light;
height: 190rpx; min-height: 190rpx;
box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 30rpx 20rpx; padding: 30rpx 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
width: 100%;
image {
width: 131rpx;
height: 131rpx;
border-radius: 10rpx;
}
.goods-intro { .goods-intro {
flex: 1; flex: 1;
min-width: 0;
font-size: $font-base; font-size: $font-base;
line-height: 48rpx; line-height: 48rpx;
margin-left: 30rpx; margin-left: 30rpx;
view:nth-child(1) { .goods-name {
line-height: 1.4em; line-height: 1.4em;
font-size: 24rpx; font-size: 24rpx;
max-height: 2.8em; //height是line-height的整数倍防止文字显示不全 max-height: 2.8em;
overflow: hidden; overflow: hidden;
color: #666; color: #666;
} }
view:nth-child(2) { .goods-sn {
color: #cccccc; color: #cccccc;
font-size: 24rpx; font-size: 24rpx;
} }
view:nth-child(3) { .goods-price {
color: $light-color; color: $light-color;
} }
} }
button {
color: $main-color;
height: 50rpx;
width: 120rpx;
font-size: $font-sm;
padding: 0;
line-height: 50rpx;
background-color: #ffffff;
margin-top: 80rpx;
&::after {
border-color: $main-color;
}
}
} }
.store { .store {
@@ -368,91 +394,43 @@
border: 1px solid $border-color-light; border: 1px solid $border-color-light;
border-radius: 16rpx; border-radius: 16rpx;
margin: 20rpx 10rpx; margin: 20rpx 10rpx;
width: calc(100% - 20rpx);
box-sizing: border-box;
.intro { .intro {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0 30rpx 0 40rpx; padding: 0 30rpx 0 40rpx;
height: 170rpx; min-height: 170rpx;
.store-logo { .store-logo {
width: 102rpx; width: 102rpx;
height: 102rpx; height: 102rpx;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
flex-shrink: 0;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
} }
.store-name { .store-name {
flex: 1; flex: 1;
min-width: 0;
margin-left: 30rpx; margin-left: 30rpx;
line-height: 2em; line-height: 2em;
:first-child { :first-child {
font-size: $font-base; font-size: $font-base;
} }
:last-child {
font-size: $font-sm;
color: #999;
}
} }
.store-collect { .store-collect {
flex-shrink: 0;
border-left: 1px solid $border-color-light; border-left: 1px solid $border-color-light;
padding-left: 20rpx; padding-left: 20rpx;
text-align: center; text-align: center;
:last-child {
color: #999; color: #999;
font-size: $font-sm; font-size: $font-sm;
} }
} }
} }
}
.navbar {
display: flex;
height: 40px;
padding: 0 5px;
background: #fff;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
position: relative;
z-index: 10;
.nav-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 26rpx;
text {
position: relative;
}
text.current {
color: $light-color;
font-weight: bold;
font-size: 28rpx;
&::after {
content: "";
position: absolute;
left: 20rpx;
bottom: -10rpx;
width: 30rpx;
height: 0;
border-bottom: 2px solid $light-color;
}
}
}
}
</style> </style>

View File

@@ -5,29 +5,38 @@
<div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div> <div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div>
</template> </template>
</u-navbar> </u-navbar>
<u-notice-bar mode="vertical" :list="['右划删除浏览记录']"></u-notice-bar> <view class="tracks-tip">
<u-icon name="volume" color="#f9ae3d" size="19"></u-icon>
<text class="tracks-tip-text">右划删除浏览记录</text>
</view>
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty> <u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
<div v-else> <view v-else class="tracks-list">
<view v-for="(item, index) in trackList" :key="index"> <block v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navigateToStore(item)">{{ item.storeName }}</view> <view class="myTracks-title" @click="navigateToStore(item)">{{ item.storeName }}</view>
<view class="myTracks-items"> <u-swipe-action class="myTracks-swipe">
<u-swipe-action-item
<u-swipe-action style="width: 100%;"> :show="item.show"
<u-swipe-action-item :show="item.show" :name="index" :name="index"
@click="delTracks" @open="open" :options="options"> @click="delTracks"
@open="open"
:options="options"
>
<view class="myTracks-item"> <view class="myTracks-item">
<u-checkbox-group v-if="isEdit" class="store-line-check"> <u-checkbox-group v-if="isEdit" class="store-line-check">
<u-checkbox shape="circle" :active-color="lightColor" v-model="item.checked" <u-checkbox
@change="checkboxChangeDP(item)"></u-checkbox> usedAlone
shape="circle"
:active-color="lightColor"
v-model:checked="item.checked"
@change="checkboxChangeDP(item)"
></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)"> <view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
<image :src="item.thumbnail"></image> <image class="track-thumb" :src="item.thumbnail"></image>
</view> </view>
<view class="myTracks-item-content" @click.stop="navigateToDetail(item)"> <view class="myTracks-item-content" @click.stop="navigateToDetail(item)">
<view class="myTracks-item-title"> <view class="myTracks-item-title">
{{ item.goodsName }} {{ item.goodsName }}
<view class="myTracks-item-title-desc"> </view>
</view> </view>
<view class="myTracks-item-price"> <view class="myTracks-item-price">
{{ unitPrice(item.price) }} {{ unitPrice(item.price) }}
@@ -36,15 +45,12 @@
</view> </view>
</u-swipe-action-item> </u-swipe-action-item>
</u-swipe-action> </u-swipe-action>
</view>
<view class="myTracks-divider"></view> <view class="myTracks-divider"></view>
</block>
</view> <view v-if="isEdit" class="submit" @click="handleClickDeleteSelected">
<div @click="handleClickDeleteSelected" v-if="isEdit" class="submit">
删除所选 删除所选
</div> </view>
</div> </view>
</view> </view>
</template> </template>
@@ -165,8 +171,11 @@
/** /**
* 删除足迹 * 删除足迹
*/ */
delTracks(index,ids) { delTracks(e, ids) {
deleteHistoryListId(ids || this.trackList[index].goodsId).then((res) => { const index = typeof e === 'object' ? (e.name ?? e.index) : e;
const goodsId = ids || this.trackList[index]?.goodsId;
if (!goodsId) return;
deleteHistoryListId(goodsId).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.trackList = []; this.trackList = [];
this.params.pageNumber = 1 this.params.pageNumber = 1
@@ -187,7 +196,8 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.submit { .submit {
position: fixed; position: fixed;
bottom: 20rpx; bottom: calc(20rpx + constant(safe-area-inset-bottom));
bottom: calc(20rpx + env(safe-area-inset-bottom));
left: 10%; left: 10%;
width: 80%; width: 80%;
height: 80rpx; height: 80rpx;
@@ -197,109 +207,109 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: $light-color; background: $light-color;
z-index: 99;
} }
.myTracks { .myTracks {
width: 100%; width: 100%;
padding-top: 2rpx; padding-top: 2rpx;
} }
.tracks-tip {
display: flex;
align-items: center;
padding: 18rpx 24rpx;
background: #fdf6ec;
}
.tracks-tip-text {
margin-left: 10rpx;
font-size: 28rpx;
color: #f9ae3d;
line-height: 1.4;
}
.tracks-list {
width: 100%;
}
.myTracks-swipe,
:deep(.u-swipe-action),
:deep(.u-swipe-action-item),
:deep(.u-swipe-action-item__content) {
width: 100%;
}
:deep(.u-swipe-action-item__content) {
overflow: hidden;
}
.myTracks-title { .myTracks-title {
width: 100%; width: 100%;
height: 110rpx; height: 110rpx;
padding-left: 20rpx; padding: 0 20rpx;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
font-weight: bold; font-weight: bold;
background-color: #fff; background-color: #fff;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
}
.myTracks-items {
padding-top: 2rpx;
align-items: center; align-items: center;
display: -webkit-box; box-sizing: border-box;
display: -webkit-flex;
display: flex;
flex-direction: column;
} }
.myTracks-item { .myTracks-item {
width: 100%; width: 100%;
height: 226rpx; min-height: 226rpx;
padding-left: 20rpx; padding: 30rpx 20rpx;
padding-right: 20rpx;
margin-bottom: 2rpx;
// border-radius: 6/@px;
background-color: #fff; background-color: #fff;
position: relative; box-sizing: border-box;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
align-items: center;
}
.store-line-check {
margin-right: 16rpx;
flex-shrink: 0;
} }
.myTracks-item-img { .myTracks-item-img {
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 8rpx; flex-shrink: 0;
image { .track-thumb {
width: 130rpx; width: 130rpx;
height: 130rpx; height: 130rpx;
border-radius: 8rpx; border-radius: 8rpx;
display: block;
} }
} }
.myTracks-item-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: center;
}
.myTracks-item-title { .myTracks-item-title {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
} line-height: 1.4;
.myTracks-item-title-desc {
font-size: 28rpx;
color: #999;
} }
.myTracks-item-price { .myTracks-item-price {
font-size: 28rpx; font-size: 28rpx;
color: $light-color; color: $light-color;
padding: 10rpx 0 0 0; padding-top: 10rpx;
}
.myTracks-action {
display: flex;
justify-content: space-between;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: #fff;
height: 75rpx;
align-items: center;
padding: 0 32rpx;
}
.myTracks-action-btn {
width: 130rpx;
height: 60rpx;
line-height: 60rpx;
} }
.myTracks-divider { .myTracks-divider {
width: 100%; width: 100%;
height: 20rpx; height: 20rpx;
background: #f5f5f5;
} }
.myTracks-action-check {
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.edit { .edit {
padding-right: 32rpx; padding-right: 32rpx;
} }

View File

@@ -8,24 +8,27 @@
</view> </view>
</view> </view>
<u-row class="portrait-box2"> <view class="point-summary">
<u-col span="6" class="portrait-box2-col" :gutter="16"> <view class="point-summary-item">
<text>累计获得</text> <text>累计获得</text>
<text class="pcolor">{{ pointData.totalPoint || 0 }}</text> <text class="pcolor">{{ pointData.totalPoint || 0 }}</text>
</u-col> </view>
<u-col span="6" class="portrait-box2-col"> <view class="point-summary-divider"></view>
<view class="point-summary-item">
<text>剩余积分</text> <text>剩余积分</text>
<text class="pcolor">{{ pointData.point || 0 }}</text> <text class="pcolor">{{ pointData.point || 0 }}</text>
</u-col> </view>
</u-row> </view>
<div class="point-list"> <div class="point-list">
<view class="point-item" v-for="(item, index) in pointList" :key="index"> <view class="point-item" v-for="(item, index) in pointList" :key="index">
<view> <view class="point-item-left">
<view class="point-label">{{ item.content }}</view> <view class="point-label">{{ item.content }}</view>
<view>{{ item.createTime}}</view> <view class="point-item-time">{{ item.createTime }}</view>
</view>
<view class="point-item-value" :class="[item.pointType == 'INCREASE' ? 'plus' : 'reduce']">
<text>{{ item.pointType == "INCREASE" ? "+" : "-" }}</text>{{ item.variablePoint }}
</view> </view>
<view :class="[item.pointType == 'INCREASE' ? 'plus' : 'reduce']"><span>{{item.pointType == "INCREASE" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
</view> </view>
<uni-load-more :status="count.loadStatus"></uni-load-more> <uni-load-more :status="count.loadStatus"></uni-load-more>
</div> </div>
@@ -100,7 +103,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.point-list { .point-list {
margin-top: 50rpx; margin-top: 20rpx;
} }
.title { .title {
height: 80rpx; height: 80rpx;
@@ -120,45 +123,61 @@ export default {
.point-item { .point-item {
width: 100%; width: 100%;
height: 130rpx; min-height: 130rpx;
padding: 0 20rpx; padding: 24rpx 20rpx;
background: #ffffff; background: #ffffff;
font-size: $font-sm; font-size: $font-sm;
border-bottom: 1px solid $border-color-light; border-bottom: 1px solid $border-color-light;
display: flex; display: flex;
justify-content: end; justify-content: space-between;
align-items: center; align-items: center;
> view:nth-child(1) { box-sizing: border-box;
.point-item-left {
flex: 1; flex: 1;
min-width: 0;
line-height: 40rpx; line-height: 40rpx;
view {
color: #666666;
}
:last-child {
color: #999;
}
} }
> view:nth-child(2) { .point-item-time {
color: #999;
}
.point-item-value {
flex-shrink: 0;
width: 100rpx; width: 100rpx;
text-align: center; text-align: center;
} }
} }
.portrait-box2 { .point-summary {
height: 100rpx; display: flex;
align-items: center;
min-height: 100rpx;
padding: 28rpx 0;
background: #ffffff; background: #ffffff;
border-radius: 0 0 20rpx 20rpx; border-radius: 0 0 20rpx 20rpx;
margin: 0 20rpx; margin: 0 20rpx;
font-size: 26rpx; font-size: 26rpx;
::v-deep .u-col { box-sizing: border-box;
text-align: center !important;
.point-summary-item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
} }
::v-deep .u-col:first-child {
border-right: 1px solid $border-color-light; .point-summary-divider {
width: 1px;
height: 48rpx;
background: $border-color-light;
flex-shrink: 0;
} }
.pcolor { .pcolor {
color: $light-color; color: $light-color;
margin-left: 8rpx;
} }
} }
@@ -225,5 +244,6 @@ export default {
.point-label { .point-label {
font-weight: bold; font-weight: bold;
margin-bottom: 10rpx; margin-bottom: 10rpx;
color: #666666;
} }
</style> </style>

View File

@@ -111,13 +111,41 @@ page {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
} }
.scoll-page { .scoll-page,
.goods-scroll {
flex: 1;
height: 0;
overflow: auto; overflow: auto;
} }
.search-navbar-wrap {
box-sizing: border-box;
flex-shrink: 0;
}
.search-navbar {
width: 100%;
:deep(.u-navbar__content__left) {
width: auto !important;
padding: 0 0 0 16rpx !important;
}
}
.goods-content {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
background: $bg-color;
}
.content { .content {
background-color: $bg-color; background-color: $bg-color;
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
display: flex;
flex-direction: column;
} }
.index-nav-arrow:last-child { .index-nav-arrow:last-child {
@@ -266,6 +294,8 @@ view {
.search-keyword { .search-keyword {
width: 100%; width: 100%;
flex: 1;
min-height: 0;
background-color: #ededed; background-color: #ededed;
} }

View File

@@ -1,6 +1,17 @@
<template> <template>
<view class="content"> <view class="content">
<u-navbar :bg-color="navObj.background" :auto-back="false"> <u-navbar
:bg-color="navObj.background"
:auto-back="false"
:fixed="true"
:placeholder="true"
:border="false"
left-icon=""
title=""
class="search-navbar"
>
<template #left>
<view class="search-navbar-wrap" :style="searchNavbarStyle">
<mSearch <mSearch
ref="mSearch" ref="mSearch"
class="mSearch-input-box" class="mSearch-input-box"
@@ -13,6 +24,8 @@
v-model="keyword" v-model="keyword"
:isFocusVal="!isShowSeachGoods" :isFocusVal="!isShowSeachGoods"
></mSearch> ></mSearch>
</view>
</template>
</u-navbar> </u-navbar>
<view class="search-keyword" v-if="!isShowSeachGoods"> <view class="search-keyword" v-if="!isShowSeachGoods">
@@ -33,9 +46,11 @@
<view class="keyword-block" v-if="oldKeywordList.length > 0"> <view class="keyword-block" v-if="oldKeywordList.length > 0">
<view class="keyword-list-header"><view class="u-tips">搜索历史</view></view> <view class="keyword-list-header"><view class="u-tips">搜索历史</view></view>
<div class="oldKeyList"> <div class="oldKeyList">
<div class="oldKeyItem" v-if="keyword" v-for="(keyword, index) in oldKeywordList" :key="index" @click="doSearch(keyword)"> <template v-for="(keyword, index) in oldKeywordList" :key="index">
<div class="oldKeyItem" v-if="keyword" @click="doSearch(keyword)">
<span>{{ keyword }}</span> <span>{{ keyword }}</span>
</div> </div>
</template>
<div @click="showMore" v-if="oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div> <div @click="showMore" v-if="oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
</div> </div>
@@ -77,36 +92,32 @@
<view class="nav-item" @click="sortGoods">筛选</view> <view class="nav-item" @click="sortGoods">筛选</view>
</view> </view>
<!-- 一行一个商品展示 --> <!-- 一行一个商品展示 -->
<div v-if="isSWitch">
<scroll-view <scroll-view
:style="{ height: goodsHeight }" v-if="isSWitch"
class="goods-scroll"
enableBackToTop="true" enableBackToTop="true"
lower-threshold="250" lower-threshold="250"
@scrolltolower="loadmore()" @scrolltolower="loadmore()"
scroll-with-animation scroll-with-animation
scroll-y scroll-y
class="scoll-page"
> >
<goodsList :res="goodsList" type="oneColumns" :keyword="keyword" /> <goodsList :res="goodsList" type="oneColumns" :keyword="keyword" />
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more> <uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
</scroll-view> </scroll-view>
</div>
<!-- 一行两个商品展示 --> <!-- 一行两个商品展示 -->
<div v-if="!isSWitch && !(goodsList == [] || goodsList == '' || goodsList == null)">
<scroll-view <scroll-view
:style="{ height: goodsHeight }" v-if="!isSWitch && !(goodsList == [] || goodsList == '' || goodsList == null)"
class="goods-scroll"
scroll-anchoring scroll-anchoring
enableBackToTop="true" enableBackToTop="true"
@scrolltolower="loadmore()" @scrolltolower="loadmore()"
scroll-with-animation scroll-with-animation
scroll-y scroll-y
lower-threshold="250" lower-threshold="250"
class="scoll-page"
> >
<goodsList :res="goodsList" :keyword="keyword" /> <goodsList :res="goodsList" :keyword="keyword" />
<uni-load-more :status="loadingType"></uni-load-more> <uni-load-more :status="loadingType"></uni-load-more>
</scroll-view> </scroll-view>
</div>
</view> </view>
<u-popup border-radius="20" mode="right" width="90%" v-model:show="sortPopup"> <u-popup border-radius="20" mode="right" width="90%" v-model:show="sortPopup">
@@ -229,7 +240,6 @@ export default {
type: '', type: '',
index: '' index: ''
}, },
goodsHeight: '',
defaultKeyword: '', defaultKeyword: '',
keyword: '', keyword: '',
oldKeywordList: [], oldKeywordList: [],
@@ -267,10 +277,25 @@ export default {
categoryId: '' categoryId: ''
}, },
routerVal: '' routerVal: '',
capsuleInsetRight: 0,
searchNavbarWidth: 0,
}; };
}, },
computed: {
searchNavbarStyle() {
if (this.searchNavbarWidth) {
return {
width: `${this.searchNavbarWidth}px`,
};
}
return {
width: '100%',
};
},
},
onPageScroll(e) { onPageScroll(e) {
console.log(e); console.log(e);
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
@@ -309,6 +334,9 @@ export default {
} }
this.loadData(); this.loadData();
}, },
onReady() {
this.setSearchNavbarWidth();
},
components: { components: {
mSearch, mSearch,
goodsList goodsList
@@ -338,40 +366,22 @@ export default {
this.loadData(); this.loadData();
}, },
mounted() {
const { windowWidth, windowHeight } = uni.getSystemInfoSync();
let topHeight = 0;
let navHeight = 0;
uni.getSystemInfo({
success: function(res) {
// res - 各种参数
let top = uni.createSelectorQuery().select('.u-navbar');
top.boundingClientRect(function(data) {
if (data && data.height) {
//data - 各种参数
topHeight = data.height; // 获取元素宽度
}
}).exec();
let nav = uni.createSelectorQuery().select('.navbar');
nav.boundingClientRect(function(data) {
if (data && data.height) {
//data - 各种参数
navHeight = data.height; // 获取元素宽度
}
}).exec();
}
});
this.goodsHeight = windowHeight - navHeight - topHeight;
// #ifdef APP-PLUS
this.goodsHeight = this.goodsHeight - 100;
// #endif
this.goodsHeight += 'px';
},
methods: { methods: {
setSearchNavbarWidth() {
// #ifdef MP-WEIXIN
try {
const menuButton = uni.getMenuButtonBoundingClientRect();
const { windowWidth } = uni.getWindowInfo();
this.capsuleInsetRight = windowWidth - menuButton.left;
const leftPadding = uni.upx2px(16);
const gap = uni.upx2px(8);
this.searchNavbarWidth =
windowWidth - this.capsuleInsetRight - leftPadding - gap;
} catch (e) {
this.searchNavbarWidth = 280;
}
// #endif
},
// 数据去重一下 只显示一次 减免 劵 什么的 // 数据去重一下 只显示一次 减免 劵 什么的
getPromotion(item) { getPromotion(item) {
if (item.promotionMap) { if (item.promotionMap) {

View File

@@ -10,7 +10,8 @@
</view> </view>
</view> </view>
<view> <view>
<view class="goods-item-view" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn" <template v-for="(item,index) in sku.orderItems" :key="index">
<view class="goods-item-view" v-if="item.sn == sn"
@click="gotoGoodsDetail(sku.goods_id)"> @click="gotoGoodsDetail(sku.goods_id)">
<view class="goods-img"> <view class="goods-img">
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image> <u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image>
@@ -24,6 +25,7 @@
</view> </view>
</view> </view>
</view> </view>
</template>
</view> </view>
<view class="after-num"> <view class="after-num">
<view>申请数量</view> <view>申请数量</view>

View File

@@ -9,7 +9,8 @@
</view> </view>
</view> </view>
<view> <view>
<view class="goods-item-view" :key="index" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn" @click="navigateToGoodsDetail(sku.skuId)"> <template v-for="(item,index) in sku.orderItems" :key="index">
<view class="goods-item-view" v-if="item.sn == sn" @click="navigateToGoodsDetail(sku.skuId)">
<view class="goods-img"> <view class="goods-img">
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image> <u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image>
</view> </view>
@@ -22,6 +23,7 @@
</view> </view>
</view> </view>
</view> </view>
</template>
</view> </view>
</view> </view>

View File

@@ -114,7 +114,9 @@
v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'"> v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
<view class="title">联系方式:</view> <view class="title">联系方式:</view>
<view class="value">{{ <view class="value">{{
storeAfterSaleAddress.salesConsigneeMobile ||secrecyMobile("") storeAfterSaleAddress.salesConsigneeMobile
? secrecyMobile(storeAfterSaleAddress.salesConsigneeMobile)
: ''
}}</view> }}</view>
</view> </view>
<view v-if="refundShow"> <view v-if="refundShow">

View File

@@ -18,10 +18,9 @@
<view class="info-view"> <view class="info-view">
<view> <view>
<u-time-line v-if="logList.length != 0"> <u-time-line v-if="logList.length != 0">
<u-time-line-item> <u-time-line-item v-for="(time, index) in logList" :key="index">
<!-- 此处没有自定义左边的内容会默认显示一个点 --> <template #content>
<template v-slot:content> <view>
<view v-for="(time,index) in logList" :key="index">
<view class="u-order-desc">{{ time.message }}</view> <view class="u-order-desc">{{ time.message }}</view>
<view class="u-order-time">{{ time.createTime }}</view> <view class="u-order-time">{{ time.createTime }}</view>
</view> </view>

View File

@@ -5,12 +5,13 @@
<view class="seller-info u-flex u-row-between"> <view class="seller-info u-flex u-row-between">
<view class="seller-name"> <view class="seller-name">
<view class="name">{{ order.storeName || "" }}</view> <view class="name">{{ order.storeName || "" }}</view>
<view class="status">{{ orderStatusList[order.orderStatus] }}</view> <view class="status">{{ orderStatusMap[order.orderStatus] }}</view>
</view> </view>
<view class="order-sn"></view> <view class="order-sn"></view>
</view> </view>
<u-line color="#DCDFE6"></u-line> <u-line color="#DCDFE6"></u-line>
<view class="goods-item-view" v-for="(sku, index) in orderGoodsList" :key="index" v-if="sku.skuId == skuId"> <template v-for="(sku, index) in orderGoodsList" :key="index">
<view class="goods-item-view" v-if="sku.skuId == skuId">
<view class="goods-img"> <view class="goods-img">
<u-image border-radius="6" width="131rpx" height="131rpx" :src="sku.image"></u-image> <u-image border-radius="6" width="131rpx" height="131rpx" :src="sku.image"></u-image>
</view> </view>
@@ -24,6 +25,7 @@
<view>x{{ sku.num }}</view> <view>x{{ sku.num }}</view>
</view> </view>
</view> </view>
</template>
</view> </view>
<!-- 投诉主题 --> <!-- 投诉主题 -->
@@ -65,7 +67,7 @@ export default {
return { return {
storage, storage,
uploadFileList: [], uploadFileList: [],
orderStatusList: { orderStatusMap: {
//订单状态列表 //订单状态列表
UNDELIVERED: "待发货", UNDELIVERED: "待发货",
PARTS_DELIVERED: "部分发货", PARTS_DELIVERED: "部分发货",

View File

@@ -3,7 +3,7 @@
<view class="logistics-detail"> <view class="logistics-detail">
<view class="card"> <view class="card">
<div v-if="logisticsList && logisticsList.length>0"> <div v-if="logisticsList && logisticsList.length>0">
<ul class="express-log" v-for="(packageItem, packageIndex) in logisticsList" :key="packageIndex" v-if="packageItem"> <ul class="express-log" v-for="(packageItem, packageIndex) in logisticsList" :key="packageIndex">
<div class="layui-layer-wrap"> <div class="layui-layer-wrap">
<dl> <dl>
<dt>物流公司</dt> <dt>物流公司</dt>

View File

@@ -7,7 +7,8 @@
</view> </view>
<swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500"> <swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
<swiper-item v-for="(item, listIndex) in list" :key="listIndex"> <swiper-item v-for="(item, listIndex) in list" :key="listIndex">
<scroll-view scroll-y style="height: 100%" @scrolltolower="renderData(listIndex)"> <scroll-view scroll-y :enable-flex="true" class="evaluate-scroll" @scrolltolower="renderData(listIndex)">
<view class="evaluate-scroll-inner">
<u-empty text="尚无需要评价的商品" mode="list" v-if="orderList.length == 0"></u-empty> <u-empty text="尚无需要评价的商品" mode="list" v-if="orderList.length == 0"></u-empty>
<view class="seller-view" v-for="(order, index) in orderList" :key="index"> <view class="seller-view" v-for="(order, index) in orderList" :key="index">
<!-- 店铺名称 --> <!-- 店铺名称 -->
@@ -62,6 +63,7 @@
</view> </view>
<uni-load-more :status="params.loadStatus"></uni-load-more> <uni-load-more :status="params.loadStatus"></uni-load-more>
</view>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@@ -327,6 +329,16 @@ page {
height: calc(100% - 88rpx); height: calc(100% - 88rpx);
} }
.evaluate-scroll {
height: 100%;
display: flex;
flex-direction: column;
}
.evaluate-scroll-inner {
width: 100%;
}
.goods-specs { .goods-specs {
margin-bottom: 10rpx; margin-bottom: 10rpx;
color: #cccccc; color: #cccccc;

View File

@@ -214,9 +214,7 @@
@click="shippingFlag = true" @click="shippingFlag = true"
> >
{{ {{
shippingMethod.find((e) => { getShippingLabel()
return e.value == shippingText;
}).label
}} }}
</u-col> </u-col>
</u-row> </u-row>
@@ -513,6 +511,13 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
getShippingLabel() {
const item =
this.shippingMethod.find((e) => e.value === this.shippingText) ||
this.shippingWay.find((e) => e.value === this.shippingText);
return item ? item.label : "";
},
//发票回调 选择发票之后刷新购物车 //发票回调 选择发票之后刷新购物车
async callbackInvoice(val) { async callbackInvoice(val) {
this.invoiceFlag = false; this.invoiceFlag = false;
@@ -746,6 +751,9 @@ export default {
}); });
}); });
this.shippingMethod = way; this.shippingMethod = way;
if (way.length && !way.some((item) => item.value === this.shippingText)) {
this.shippingText = way[0].value;
}
} }
}, },

View File

@@ -2,9 +2,9 @@
<view> <view>
<!-- 订单状态 --> <!-- 订单状态 -->
<div class="info-view order-view"> <div class="info-view order-view">
<div class="order-status" v-if="orderStatusList[order.orderStatus]"> <div class="order-status" v-if="orderStatusMap[order.orderStatus]">
{{ orderStatusList[order.orderStatus].title }} {{ orderStatusMap[order.orderStatus].title }}
<div>{{ orderStatusList[order.orderStatus].value }}</div> <div>{{ orderStatusMap[order.orderStatus].value }}</div>
</div> </div>
</div> </div>
@@ -35,7 +35,7 @@
<view> <view>
<view class="address-title"> <view class="address-title">
<span>{{ order.consigneeName || "未填写昵称" }}</span> <span>{{ order.consigneeName || "未填写昵称" }}</span>
<span>{{ order.consigneeMobile || "未填写手机号secrecyMobile(") }}</span> <span>{{ order.consigneeMobile ? secrecyMobile(order.consigneeMobile) : '未填写手机号' }}</span>
</view> </view>
<view class="address">地址{{ order.consigneeAddressPath }} <view class="address">地址{{ order.consigneeAddressPath }}
{{ order.consigneeDetail }}</view> {{ order.consigneeDetail }}</view>
@@ -67,7 +67,7 @@
<view class="seller-info u-flex u-row-between"> <view class="seller-info u-flex u-row-between">
<view class="seller-name" @click="goToShopPage(order)"> <view class="seller-name" @click="goToShopPage(order)">
<view class="name">{{ order.storeName }}</view> <view class="name">{{ order.storeName }}</view>
<view class="status" v-if="orderStatusList[order.orderStatus]"> {{ orderStatusList[order.orderStatus].title <view class="status" v-if="orderStatusMap[order.orderStatus]"> {{ orderStatusMap[order.orderStatus].title
}}</view> }}</view>
</view> </view>
<view class="order-sn"></view> <view class="order-sn"></view>
@@ -268,7 +268,7 @@ export default {
lightColor: this.$lightColor, lightColor: this.$lightColor,
logisticsList: "", //物流信息 logisticsList: "", //物流信息
shareFlag: false, //拼团分享开关 shareFlag: false, //拼团分享开关
orderStatusList: { orderStatusMap: {
UNPAID: { UNPAID: {
title: "未付款", title: "未付款",
value: "商品暂未付款", value: "商品暂未付款",

View File

@@ -46,9 +46,7 @@
</div> </div>
<div class="flex" v-show="current != 1"> <div class="flex" v-show="current != 1">
<u-checkbox-group :icon-size="24" width="45rpx"> <u-checkbox usedAlone :icon-size="24" shape="circle" v-model:checked="enablePrivacy" active-color="#FF5E00"></u-checkbox>
<u-checkbox shape="circle" v-model="enablePrivacy" active-color="#FF5E00"></u-checkbox>
</u-checkbox-group>
<div class="tips"> <div class="tips">
未注册的手机号验证后将自动创建用户账号登录即代表您已同意<span @click="navigateToPrivacy('PRIVACY_POLICY')">隐私协议</span> 未注册的手机号验证后将自动创建用户账号登录即代表您已同意<span @click="navigateToPrivacy('PRIVACY_POLICY')">隐私协议</span>
<span @click="navigateToPrivacy('USER_AGREEMENT')"> <span @click="navigateToPrivacy('USER_AGREEMENT')">
@@ -63,14 +61,15 @@
<!-- 循环出当前可使用的第三方登录模式 --> <!-- 循环出当前可使用的第三方登录模式 -->
<div class="flex login-list"> <div class="flex login-list">
<div v-if="item.code" :style="{ background: item.color }" class="login-item" <template v-for="(item, index) in loginList" :key="index">
v-for="(item, index) in loginList" :key="index"> <div v-if="item.code" :style="{ background: item.color }" class="login-item">
<u-icon v-if="item.title != 'APPLE'" color="#fff" size="42" :name="item.icon" <u-icon v-if="item.title != 'APPLE'" color="#fff" size="42" :name="item.icon"
@click="navigateLogin(item)"> @click="navigateLogin(item)">
</u-icon> </u-icon>
<u-image v-else src="/static/appleidButton@2x.png" :lazy-load="false" @click="navigateLogin(item)" <u-image v-else src="/static/appleidButton@2x.png" :lazy-load="false" @click="navigateLogin(item)"
width="80" height="80" /> width="80" height="80" />
</div> </div>
</template>
</div> </div>
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification" <myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification"
business="LOGIN" /> business="LOGIN" />

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="container"> <view class="container">
<u-navbar :auto-back="false" @leftClick="back" title="小程序登录"></u-navbar> <u-navbar :auto-back="false" :fixed="true" :placeholder="true" @leftClick="back" title="小程序登录"></u-navbar>
<u-modal v-model:show="phoneAuthPopup" :mask-close-able="true" :title="projectName+'商城'" <u-modal v-model:show="phoneAuthPopup" :mask-close-able="true" :title="projectName+'商城'"
:show-confirm-button="false"> :show-confirm-button="false">
<div class="tips"> <div class="tips">
@@ -24,14 +24,23 @@
class="btn-auth">登录</button> class="btn-auth">登录</button>
<div @click="backToHome" class="btn-callback">暂不登录</div> <div @click="backToHome" class="btn-callback">暂不登录</div>
</view> </view>
<div class="privacy"> <view class="privacy">
<u-checkbox shape="circle" v-model="checked" :active-color="lightColor"> <view class="privacy-row">
<div class="flex"> <u-checkbox
阅读并同意<navigator class="light-color" url="/pages/mine/help/tips?type=PRIVACY_POLICY">隐私协议</navigator> class="privacy-check"
<navigator class="light-color" url="/pages/mine/help/tips?type=USER_AGREEMENT">用户协议</navigator> usedAlone
</div> shape="circle"
</u-checkbox> v-model:checked="checked"
</div> :active-color="lightColor"
:icon-size="18"
></u-checkbox>
<view class="privacy-text">
阅读并同意
<navigator class="privacy-link" url="/pages/mine/help/tips?type=PRIVACY_POLICY">隐私协议</navigator>
<navigator class="privacy-link" url="/pages/mine/help/tips?type=USER_AGREEMENT">用户协议</navigator>
</view>
</view>
</view>
</div> </div>
</view> </view>
</view> </view>
@@ -237,18 +246,14 @@
.wx-auth-container { .wx-auth-container {
width: 100%; width: 100%;
margin-top: 20%; padding-top: 120rpx;
} }
.logo-info { .logo-info {
display: flex; display: flex;
flex-wrap: nowrap;
justify-content: flex-start;
flex-direction: row;
align-items: flex-start;
padding: 20rpx;
flex-direction: column; flex-direction: column;
align-items: flex-start;
padding: 0 20rpx;
font-weight: bold; font-weight: bold;
} }
@@ -376,8 +381,37 @@
} }
.privacy { .privacy {
text-align: center; margin-top: 32rpx;
margin-top: 20rpx;
width: 100%; width: 100%;
display: flex;
justify-content: center;
}
.privacy-row {
display: flex;
align-items: flex-start;
width: 92%;
}
.privacy-check {
flex-shrink: 0;
margin-top: 4rpx;
::v-deep .u-checkbox {
margin: 0;
}
}
.privacy-text {
flex: 1;
margin-left: 12rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #666;
}
.privacy-link {
display: inline;
color: $light-color;
} }
</style> </style>

View File

@@ -351,9 +351,7 @@ page {
flex-wrap: wrap; flex-wrap: wrap;
/* height: 140rpx; */ /* height: 140rpx; */
overflow: hidden; overflow: hidden;
> * { gap: 16rpx;
margin-right: 16rpx;
}
} }
.bot { .bot {

View File

@@ -4,7 +4,6 @@
</view> </view>
</template> </template>
<script> <script>
var chat = requirePlugin('myPlugin')
export default { export default {
data() { data() {
return { return {
@@ -15,6 +14,19 @@
}, },
onLoad (e) { onLoad (e) {
// 腾讯云智服客服插件需在 manifest.json 的 mp-weixin.plugins 中注册后方可使用,
// 未注册时 requirePlugin 会抛出 "has not registered any plugins",此处做容错处理。
let chat
try {
chat = requirePlugin('myPlugin')
} catch (err) {
uni.showToast({
title: '客服功能暂未配置',
icon: 'none',
duration: 2000
})
return
}
const params = JSON.parse((decodeURIComponent(e.params))) const params = JSON.parse((decodeURIComponent(e.params)))
chat.init({ chat.init({
sign: params.mpSign, //必传,公司渠道唯一标识,腾讯云智服后台系统创建「小程序插件」渠道后,在「渠道管理」获取 sign: params.mpSign, //必传,公司渠道唯一标识,腾讯云智服后台系统创建「小程序插件」渠道后,在「渠道管理」获取

View File

@@ -17,7 +17,7 @@
:y="navbarListY" placement="top-start" /> :y="navbarListY" placement="top-start" />
<view class="index"> <view class="index">
<!-- topBar --> <!-- topBar -->
<u-navbar :bg-color="navbar.background" :auto-back="false" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'"> <u-navbar :bg-color="navbar.background" :auto-back="false" @leftClick="back" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
<div class="headerRow"> <div class="headerRow">
<div class="backs"> <div class="backs">
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon> <u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
@@ -36,7 +36,7 @@
</u-navbar> </u-navbar>
<u-navbar :border="false" v-show="!headerFlag" class="header-only-back" :bg-color="navbarOnlyBack.background" <u-navbar :border="false" v-show="!headerFlag" class="header-only-back" :bg-color="navbarOnlyBack.background"
:auto-back="false"> :auto-back="false" @leftClick="back">
<div> <div>
<div class="bg-back"> <div class="bg-back">
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon> <u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
@@ -198,15 +198,15 @@
<view class="page-bottom mp-iphonex-bottom" id="pageBottom"> <view class="page-bottom mp-iphonex-bottom" id="pageBottom">
<view class="icon-btn"> <view class="icon-btn">
<view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)"> <view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
<u-icon size="34" class="red" name="home-fill"></u-icon> <u-icon size="22" class="red" name="home-fill"></u-icon>
<view class="red icon-btn-name">店铺</view> <view class="red icon-btn-name">店铺</view>
</view> </view>
<view class="icon-btn-item" @click="linkMsgDetail()"> <view class="icon-btn-item" @click="linkMsgDetail()">
<u-icon size="34" name="kefu-ermai"></u-icon> <u-icon size="22" name="kefu-ermai"></u-icon>
<view class="icon-btn-name">客服</view> <view class="icon-btn-name">客服</view>
</view> </view>
<view class="icon-btn-item" @click="reluchToCart()"> <view class="icon-btn-item" @click="reluchToCart()">
<u-icon size="34" name="storeping-cart"></u-icon> <u-icon size="22" name="shopping-cart"></u-icon>
<view class="icon-btn-name">购物车</view> <view class="icon-btn-name">购物车</view>
<view v-if="nums && nums > 0" class="num-icon">{{ nums }}</view> <view v-if="nums && nums > 0" class="num-icon">{{ nums }}</view>
</view> </view>
@@ -574,6 +574,10 @@ export default {
} }
/**商品信息以及规格信息存储 */ /**商品信息以及规格信息存储 */
this.goodsDetail = response.data.result.data; this.goodsDetail = response.data.result.data;
// 清洗缩略图,避免损坏地址(如 1?x-oss-process=style/400X400触发渲染层 500
if (this.goodsDetail) {
this.goodsDetail.thumbnail = this.parseGoodsImageUrl(this.goodsDetail.thumbnail);
}
this.wholesaleList = response.data.result.wholesaleList; this.wholesaleList = response.data.result.wholesaleList;
this.goodsSpec = response.data.result.specs; this.goodsSpec = response.data.result.specs;
this.PromotionList = response.data.result.promotionMap; this.PromotionList = response.data.result.promotionMap;
@@ -592,8 +596,12 @@ export default {
this.isSeckill = true this.isSeckill = true
} }
}); });
// 轮播图 // 轮播图:兼容上传 JSON 与纯 URL解析后去重
this.imgList = this.goodsDetail.goodsGalleryList.filter(i => i.indexOf("\"url\":") === -1 && i.indexOf("\"status\":") === -1); const gallery = (this.goodsDetail.goodsGalleryList || [])
.map((i) => this.parseGoodsImageUrl(i, ""))
.filter(Boolean);
this.imgList = [...new Set(gallery)];
// 获取店铺基本信息 // 获取店铺基本信息
this.getStoreBaseInfoFun(this.goodsDetail.storeId); this.getStoreBaseInfoFun(this.goodsDetail.storeId);
@@ -740,6 +748,9 @@ export default {
API_store.getStoreBaseInfo(id).then((res) => { API_store.getStoreBaseInfo(id).then((res) => {
if (res.data.success) { if (res.data.success) {
this.storeDetail = res.data.result; this.storeDetail = res.data.result;
if (this.storeDetail) {
this.storeDetail.storeLogo = this.parseGoodsImageUrl(this.storeDetail.storeLogo);
}
} }
}); });
}, },
@@ -780,7 +791,10 @@ export default {
storeId: this.goodsDetail.storeId, storeId: this.goodsDetail.storeId,
recommend: true, recommend: true,
}).then((res) => { }).then((res) => {
this.recommendList = res.data.result.records; this.recommendList = (res.data.result.records || []).map((item) => ({
...item,
thumbnail: this.parseGoodsImageUrl(item.thumbnail),
}));
}); });
}, },
@@ -795,7 +809,10 @@ export default {
currentGoodsId: this.goodsDetail.id, currentGoodsId: this.goodsDetail.id,
keyword: this.goodsDetail.name keyword: this.goodsDetail.name
}).then((res) => { }).then((res) => {
this.likeGoodsList = res.data.result.records; this.likeGoodsList = (res.data.result.records || []).map((item) => ({
...item,
thumbnail: this.parseGoodsImageUrl(item.thumbnail),
}));
}); });
}, },

View File

@@ -38,7 +38,7 @@
</view> </view>
<!-- 查看全部评价按钮 --> <!-- 查看全部评价按钮 -->
<view v-if="commDetail && commDetail.records && commDetail.records.length > 0" class="eva-section-btn" @click="toComment(goodsDetail.goodsId, goodsDetail.grade)"> <view v-if="commDetail && commDetail.records && commDetail.records.length > 0" class="eva-section-btn" @click="toComment(goodsDetail.goodsId, goodsDetail.grade)">
<text>查看全部评价</text> <text class="btn-text">查看全部评价</text>
</view> </view>
</view> </view>
</template> </template>
@@ -131,7 +131,7 @@ export default {
margin: 2px 0 20rpx 0; margin: 2px 0 20rpx 0;
background: #fff; background: #fff;
text { .btn-text {
width: 200rpx; width: 200rpx;
height: 50rpx; height: 50rpx;
font-size: 22rpx; font-size: 22rpx;
@@ -207,7 +207,7 @@ export default {
margin-right: 20rpx; margin-right: 20rpx;
} }
> view > text { > .star-con > .name {
margin-left: 6rpx; margin-left: 6rpx;
} }
} }

View File

@@ -55,7 +55,7 @@ export default {
return { return {
goodsDetail: "", goodsDetail: "",
style: { style: {
img:"display:block" img:"display:block;width:100%"
} }
}; };
}, },
@@ -114,15 +114,6 @@ export default {
width: 100%; width: 100%;
} }
.vhtml {
::v-deep img {
display: block !important;
}
}
::v-deep img {
width: 100%;
}
.goods-detail-box { .goods-detail-box {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@@ -2,7 +2,7 @@
<!-- 轮播图 --> <!-- 轮播图 -->
<view class="carousel"> <view class="carousel">
<swiper circular="true" duration="400" @change="swiperChange"> <swiper class="goods-swiper" circular="true" duration="400" @change="swiperChange">
<swiper-item v-if='video'> <swiper-item v-if='video'>
<!-- #ifndef APP-PLUS --> <!-- #ifndef APP-PLUS -->
<video class="video" show-mute-btn style="width:100%; height:100%;" muted autoplay :src='video' loop <video class="video" show-mute-btn style="width:100%; height:100%;" muted autoplay :src='video' loop
@@ -20,9 +20,7 @@
<swiper-item class="swiper-item" v-for="(item, index) in res" :key="index"> <swiper-item class="swiper-item" v-for="(item, index) in res" :key="index">
<view class="image-wrapper"> <view class="image-wrapper">
<u-image :src="item" mode="aspectFit" class="loaded" width="100%" height="100%"> <image class="swiper-img" :src="item" mode="aspectFit"></image>
<template #loading><u-loading></u-loading></template>
</u-image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@@ -63,7 +61,7 @@ export default {
height: 750rpx; height: 750rpx;
position: relative; position: relative;
swiper { .goods-swiper {
height: 100%; height: 100%;
} }
@@ -72,17 +70,17 @@ export default {
height: 100%; height: 100%;
} }
.swiper-img {
width: 100%;
height: 100%;
}
.swiper-item { .swiper-item {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-content: center; align-content: center;
height: 750rpx; height: 750rpx;
overflow: hidden; overflow: hidden;
image {
width: 100%;
height: 100%;
}
} }
position: relative; position: relative;
@@ -104,7 +102,7 @@ export default {
} }
} }
::v-deep .image-wrapper image { ::v-deep .image-wrapper .u-image__image {
opacity: 1 !important; opacity: 1 !important;
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<u-popup class="popup" v-model:show="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" closeable> <u-popup class="popup" :show="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" closeable>
<view class="header-title">选择地址</view> <view class="header-title">选择地址</view>
<view class="view-box" v-if="addressDetail"> <view class="view-box" v-if="addressDetail">
<view class="view-item" v-for="(item, index) in addressDetail" :key="index" @click="clickAddress(item)"> <view class="view-item" v-for="(item, index) in addressDetail" :key="index" @click="clickAddress(item)">
@@ -48,17 +48,17 @@ export default {
}, },
props: ["goodsId", "addressFlag"], props: ["goodsId", "addressFlag"],
methods: {
mounted() { mounted() {
this.addressFlag = false;
if (this.isLogin("auth")) { if (this.isLogin("auth")) {
this.getShippingAddress() this.getShippingAddress();
} } else {
else{
uni.navigateTo({ uni.navigateTo({
url: 'pages/passport/login' url: "/pages/passport/login",
}); });
}
}, },
methods: {
/**关闭地址 */ /**关闭地址 */
closeAddress() { closeAddress() {
this.$emit("closeAddress", false); this.$emit("closeAddress", false);
@@ -66,7 +66,6 @@ export default {
}, },
getpicker() { getpicker() {
// this.$refs.cityPicker.show();
uni.navigateTo({ uni.navigateTo({
url: "/pages/mine/address/add", url: "/pages/mine/address/add",
}); });
@@ -87,10 +86,6 @@ export default {
this.checked = addr[0]; this.checked = addr[0];
this.$emit("deliveryData", this.checked); this.$emit("deliveryData", this.checked);
} }
// addr[0] ? "" : (addr = res.data);
// /**获取默认地址是否有货 */
// this.clickAddress(addr[0]);
} }
}); });
} }

View File

@@ -5,8 +5,8 @@
<view class="coupon-item"> <view class="coupon-item">
<view class="top"> <view class="top">
<div class="price"> <div class="price">
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span> <span class="price-num" v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span>
<span v-if="item.couponType == 'PRICE'">{{unitPrice(item.price) }}</span> <span class="price-num" v-if="item.couponType == 'PRICE'">{{unitPrice(item.price) }}</span>
</div> </div>
<view class="text"> <view class="text">
<div class="coupon-List-title"> <div class="coupon-List-title">
@@ -21,7 +21,7 @@
<div>{{unitPrice(item.consumeThreshold) }}可用</div> <div>{{unitPrice(item.consumeThreshold) }}可用</div>
</view> </view>
<view class="lingqu-btn" @click="getCoupon(item, index)"> <view class="lingqu-btn" @click="getCoupon(item, index)">
<div :class="yhqFlag[index] ? 'cur' : ''"> <div class="lingqu-text" :class="yhqFlag[index] ? 'cur' : ''">
{{ yhqFlag[index] ? "已领取或领完" : "立即领取" }} {{ yhqFlag[index] ? "已领取或领完" : "立即领取" }}
</div> </div>
</view> </view>
@@ -139,7 +139,7 @@
height: 100%; height: 100%;
align-items: center; align-items: center;
span { .price-num {
font-size: 50rpx; font-size: 50rpx;
} }
} }
@@ -164,7 +164,7 @@
align-items: center; align-items: center;
margin-left: 40rpx; margin-left: 40rpx;
text { .lingqu-text {
width: 140rpx; width: 140rpx;
height: 40rpx; height: 40rpx;
text-align: center; text-align: center;

View File

@@ -116,9 +116,7 @@ export default {
text-align: left; text-align: left;
color: #333333; color: #333333;
margin-left: 20rpx; margin-left: 20rpx;
> span { word-spacing: 15rpx;
margin-right: 15rpx;
}
} }
.wrapper { .wrapper {

View File

@@ -16,7 +16,7 @@
</div> </div>
</view> </view>
<view class="to-store-btn" @click="tostorePage(goodsDetail)"> <view class="to-store-btn" @click="tostorePage(goodsDetail)">
<view>进店逛逛</view> <view class="to-store-text">进店逛逛</view>
</view> </view>
</view> </view>
@@ -122,11 +122,6 @@ export default {
.logo { .logo {
overflow: hidden; overflow: hidden;
border-radius: 6px; border-radius: 6px;
> img {
width: 100%;
height: 100%;
}
} }
.name-star { .name-star {
@@ -144,9 +139,6 @@ export default {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
margin-left: 10px; margin-left: 10px;
text {
margin-right: 10px;
}
} }
} }
@@ -154,7 +146,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
> view { > .to-store-text {
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
width: 160rpx; width: 160rpx;
@@ -171,18 +163,6 @@ export default {
.star-con { .star-con {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
view {
display: flex;
align-items: center;
.star {
width: 30rpx;
height: 30rpx;
background: url(https://image.shutterstock.com/image-vector/star-icon-vector-illustration-260nw-474687040.jpg);
background-size: 100%;
}
}
} }
.recommend-list { .recommend-list {
@@ -230,8 +210,10 @@ export default {
} }
.store-row { .store-row {
display: flex; display: flex;
align-items: center;
margin: 10rpx 0; margin: 10rpx 0;
> div { > .collectionNum,
> .goodsNum {
margin-right: 20rpx; margin-right: 20rpx;
} }
} }

View File

@@ -247,7 +247,7 @@ page {
flex: 1; flex: 1;
position: relative; position: relative;
text-align: center; text-align: center;
font-size: 22rpx; font-size: 20rpx;
color: #262626; color: #262626;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -256,7 +256,8 @@ page {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
> .icon-btn-name { > .icon-btn-name {
margin: 4rpx 0; margin-top: 2rpx;
line-height: 1;
} }
} }
} }

View File

@@ -6,7 +6,7 @@
</view> </view>
</u-navbar> </u-navbar>
<!-- 轮播图 --> <!-- 轮播图 -->
<u-swiper @click="clickSwiper" class="swiper" :effect3d="true" :list="swiperImg"> <u-swiper @click="clickSwiper" class="swiper" keyName="image" :list="swiperImg">
</u-swiper> </u-swiper>
<u-tabs :is-scroll="false" @change="changeTabs" :current="current" :active-color="activeColor" inactive-color="#606266" ref="tabs" :list="tabs"></u-tabs> <u-tabs :is-scroll="false" @change="changeTabs" :current="current" :active-color="activeColor" inactive-color="#606266" ref="tabs" :list="tabs"></u-tabs>

View File

@@ -1,10 +1,17 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<u-navbar :auto-back="false" title="购物车"> <u-navbar
<template #right> class="cart-navbar"
<div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div> :style="cartNavbarStyle"
</template> :auto-back="false"
</u-navbar> :fixed="true"
:placeholder="true"
:border="false"
left-icon=""
title="购物车"
:right-text="isEdit ? '完成' : '编辑'"
@rightClick="toggleEdit"
></u-navbar>
<!-- 空白页--> <!-- 空白页-->
<view v-if="!loading && (cartDetail.cartList == '' || cartDetail.cartList == [] || !cartDetail)" class="empty"> <view v-if="!loading && (cartDetail.cartList == '' || cartDetail.cartList == [] || !cartDetail)" class="empty">
<image src="/static/emptyCart.png" mode="aspectFit"></image> <image src="/static/emptyCart.png" mode="aspectFit"></image>
@@ -19,21 +26,13 @@
:key="index"> :key="index">
<view class="tab"> <view class="tab">
<view class="store-line"> <view class="store-line">
<u-checkbox-group class="store-line-check"> <view class="store-line-check">
<!-- #ifndef MP-WEIXIN --> <u-checkbox usedAlone shape="circle" :active-color="lightColor" v-model:checked="item.checked"
<u-checkbox shape="circle" :active-color="lightColor" v-model="item.checked" :label-size="14" @change="(checked) => onStoreCheckChange(item, checked)"></u-checkbox>
@change="checkboxChangeDP(item)"></u-checkbox> </view>
<!-- #endif --> <text class="store-name wes" @click.stop="navigateToStore(item)">{{
<!-- 微信小程序这里 v-model出现问题改用:value -->
<!-- #ifdef MP-WEIXIN -->
<u-checkbox shape="circle" :active-color="lightColor" :value="item.checked"
@change="checkboxChangeDP(item)"></u-checkbox>
<!-- #endif -->
</u-checkbox-group>
<span class="store-name wes store-line-desc" @click.stop="navigateToStore(item)">{{
item.storeName item.storeName
}}</span> }}</text>
<u-icon @click="navigateToStore(item)" size="24" style="margin-left:10rpx;" name="arrow-right"></u-icon>
</view> </view>
<view class="right-col" v-if="item.canReceiveCoupon" @click="navigateToCoupon(item)"> <view class="right-col" v-if="item.canReceiveCoupon" @click="navigateToCoupon(item)">
<div class="right-line"></div> <div class="right-line"></div>
@@ -56,21 +55,13 @@
<view class="goods-row" :class="{ invalid: isInvalid(skuItem) }"> <view class="goods-row" :class="{ invalid: isInvalid(skuItem) }">
<view class="goods-config"> <view class="goods-config">
<view> <view>
<u-checkbox-group v-if="skuItem.invalid == 0 && !skuItem.errorMessage"> <u-checkbox v-if="skuItem.invalid == 0 && !skuItem.errorMessage" usedAlone shape="circle"
<!-- #ifndef MP-WEIXIN --> :active-color="lightColor" class="c-left" v-model:checked="skuItem.checked"
<u-checkbox shape="circle" :active-color="lightColor" class="c-left" v-model="skuItem.checked" @change="(checked) => onSkuCheckChange(skuItem, checked)"></u-checkbox>
@change="checkboxChange(skuItem)"></u-checkbox>
<!-- #endif -->
<!-- 微信小程序这里 v-model出现问题改用:value -->
<!-- #ifdef MP-WEIXIN -->
<u-checkbox shape="circle" :active-color="lightColor" class="c-left" :value="skuItem.checked"
@change="checkboxChange(skuItem)"></u-checkbox>
<!-- #endif -->
</u-checkbox-group>
<span class="invalid" v-else style="font-size: 24rpx">失效</span> <span class="invalid" v-else style="font-size: 24rpx">失效</span>
</view> </view>
<u-image border-radius="10" :fade="true" @click="navigateToGoods(skuItem)" width="160rpx" height="160rpx" <u-image border-radius="10" :fade="true" @click="navigateToGoods(skuItem)" width="160rpx" height="160rpx"
:src="skuItem.goodsSku.thumbnail" /> mode="aspectFill" :src="getSkuThumbnail(skuItem.goodsSku.thumbnail)" />
</view> </view>
<view class="goods-content"> <view class="goods-content">
<!-- 商品名称 --> <!-- 商品名称 -->
@@ -125,9 +116,10 @@
<!-- 结账 --> <!-- 结账 -->
<div class="box box6"> <div class="box box6">
<view class="navL"> <view class="navL">
<u-checkbox shape="circle" :active-color="lightColor" v-model="checkout" @change="checkOut()" label-size="24">全选 <u-checkbox class="checkout-all" usedAlone shape="circle" :active-color="lightColor" v-model:checked="checkout"
:label-size="12" label="全选" @change="checkOut">
</u-checkbox> </u-checkbox>
<span class="price"> <span class="price checkout-total">
<div class="prices"> <div class="prices">
<div class="fullPrice"> <div class="fullPrice">
<span class="number" v-if="cartDetail && cartDetail.priceDetailDTO"> <span class="number" v-if="cartDetail && cartDetail.priceDetailDTO">
@@ -183,6 +175,7 @@
import * as API_Trade from "@/api/trade"; import * as API_Trade from "@/api/trade";
import { debounce } from "@/utils/tools.js"; import { debounce } from "@/utils/tools.js";
import uniNumberBox from '@/components/uni-number-box' import uniNumberBox from '@/components/uni-number-box'
import config from "@/config/config";
export default { export default {
components:{uniNumberBox}, // 数量加减组件 components:{uniNumberBox}, // 数量加减组件
data() { data() {
@@ -214,10 +207,24 @@ export default {
isEdit: false, // 是否是编辑 isEdit: false, // 是否是编辑
checkout: false, //全选按钮 checkout: false, //全选按钮
WEIXIN_num: "", //购物车兼容微信步进器 WEIXIN_num: "", //购物车兼容微信步进器
defaultGoodsImage: config.logo,
capsuleInsetRight: 0,
}; };
}, },
computed: {
cartNavbarStyle() {
if (!this.capsuleInsetRight) {
return {};
}
return {
"--cart-capsule-inset": `${this.capsuleInsetRight}px`,
};
},
},
mounted() { mounted() {
this.setCapsuleInset();
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// 小程序默认分享 // 小程序默认分享
uni.showShareMenu({ withShareTicket: true }); uni.showShareMenu({ withShareTicket: true });
@@ -242,6 +249,29 @@ export default {
} }
}, },
methods: { methods: {
setCapsuleInset() {
// #ifdef MP-WEIXIN
try {
const menuButton = uni.getMenuButtonBoundingClientRect();
const { windowWidth } = uni.getWindowInfo();
this.capsuleInsetRight = windowWidth - menuButton.left + uni.upx2px(8);
} catch (e) {
this.capsuleInsetRight = 90;
}
// #endif
},
toggleEdit() {
this.isEdit = !this.isEdit;
},
getSkuThumbnail(url) {
if (url && /^(https?:)?\/\//.test(String(url))) {
return url;
}
return this.defaultGoodsImage;
},
/** /**
* 倒数计时 * 倒数计时
*/ */
@@ -420,11 +450,11 @@ export default {
/** /**
* 全选 * 全选
*/ */
checkOut() { checkOut(checked) {
API_Trade.checkAll(this.checkout).then((result) => { const selected = typeof checked === "boolean" ? checked : this.checkout;
API_Trade.checkAll(selected).then((result) => {
if (result.data.success) { if (result.data.success) {
this.getCardData(); this.getCardData();
return true;
} }
}); });
}, },
@@ -440,14 +470,12 @@ export default {
}); });
}, },
/** onStoreCheckChange(storeItem, checked) {
* 店铺点击 this.checkStoreFun(storeItem.storeId, checked);
*/ },
checkboxChangeDP(e) {
// #ifdef MP-WEIXIN onSkuCheckChange(skuItem, checked) {
e.checked = !e.checked; this.updateSkuCheckedFun(skuItem.goodsSku.id, checked);
// #endif
this.checkStoreFun(e.storeId, e.checked);
}, },
/** /**
@@ -501,15 +529,16 @@ export default {
let checkOuted = true; let checkOuted = true;
for (let i = 0; i < this.cartDetail.cartList.length; i++) { for (let i = 0; i < this.cartDetail.cartList.length; i++) {
let item = this.cartDetail.cartList[i]; let item = this.cartDetail.cartList[i];
console.log(item); item.checked = item.checked == 1;
// 循环出当前商品是否全选 // 循环出当前商品是否全选
if (item.checked == 0) { if (!item.checked) {
checkOuted = false; checkOuted = false;
} }
// 如果有拼团活动顺便删除 // 如果有拼团活动顺便删除
item.skuList && item.skuList &&
item.skuList.forEach((sku) => { item.skuList.forEach((sku) => {
if (sku.checked == 0) { sku.checked = sku.checked == 1;
if (!sku.checked) {
checkOuted = false; checkOuted = false;
} }
if(Object.keys(sku.promotionMap).length != 0) if(Object.keys(sku.promotionMap).length != 0)
@@ -535,15 +564,6 @@ export default {
} }
}, },
/**
* 选中某个复选框时由checkbox时触发
*/
checkboxChange(e) {
// #ifdef MP-WEIXIN
e.checked = !e.checked;
// #endif
this.updateSkuCheckedFun(e.goodsSku.id, e.checked);
},
}, },
}; };
</script> </script>
@@ -560,10 +580,17 @@ page {
.u-image { .u-image {
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05); box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
} }
.edit{
padding-right: 32rpx; .cart-navbar {
::v-deep .u-navbar__content__right {
padding-right: var(--cart-capsule-inset, 13px);
}
::v-deep .u-navbar__content__right__text {
color: $light-color;
font-size: 28rpx; font-size: 28rpx;
} }
}
.promotion-notice { .promotion-notice {
margin-top: 10px; margin-top: 10px;
margin-left: 68rpx; margin-left: 68rpx;
@@ -593,16 +620,26 @@ page {
} }
.store-name { .store-name {
flex: 1;
min-width: 0;
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
margin-left: 8rpx;
}
.store-arrow {
flex-shrink: 0;
margin-left: 10rpx;
} }
.invalid { .invalid {
filter: grayscale(1); filter: grayscale(1);
} }
.cart-item { .cart-item {
width: 100%;
border-radius: 0.4em; border-radius: 0.4em;
transition: 0.35s; transition: 0.35s;
overflow: hidden;
} }
/* 空白页 */ /* 空白页 */
@@ -698,11 +735,16 @@ page {
} }
.goods-content { .goods-content {
width: 100%; flex: 1;
height: 100%; min-width: 0;
margin-left: 20rpx;
overflow: hidden; overflow: hidden;
> p {
padding-left: 20rpx; > p,
.sp-name,
.sp-type,
.sp-number {
padding-left: 0;
} }
} }
@@ -718,25 +760,27 @@ page {
border-right: 1px solid $light-color; border-right: 1px solid $light-color;
} }
.store-line-check, .store-line-check {
.store-line-img, flex-shrink: 0;
.store-line-desc {
// #ifdef MP-WEIXIN ::v-deep .u-checkbox {
float: left; margin: 0;
// #endif }
} }
.store-line { .store-line {
// #ifndef MP-WEIXIN
display: flex; display: flex;
// #endif align-items: center;
flex: 1;
min-width: 0;
overflow: hidden; overflow: hidden;
flex:10;
} }
.goods-config { .goods-config {
display: flex; display: flex;
align-items: center; align-items: center;
flex-shrink: 0;
::v-deep .invalid { ::v-deep .invalid {
display: block; display: block;
width: 80rpx !important; width: 80rpx !important;
@@ -746,15 +790,17 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 30rpx 0 0 0; padding: 24rpx 0 8rpx;
} }
.right-col { .right-col {
flex:2; flex-shrink: 0;
display: flex;
align-items: center;
text-align: center; text-align: center;
width: 100rpx;
color: $light-color; color: $light-color;
font-size: 26rpx; font-size: 26rpx;
margin-left: 16rpx;
> span { > span {
margin-left: 20rpx; margin-left: 20rpx;
@@ -762,14 +808,10 @@ page {
} }
.right-line { .right-line {
width: 3px; width: 2rpx;
float: left;
height: 40rpx; height: 40rpx;
border-left: 1px solid #eeeeee; border-left: 1px solid #eeeeee;
margin-right: 20rpx;
::v-deep span {
margin-left: 20rpx;
}
} }
.box6 { .box6 {
@@ -795,6 +837,21 @@ page {
padding: 0 32rpx; padding: 0 32rpx;
display: flex; display: flex;
align-items: center; align-items: center;
flex: 1;
min-width: 0;
gap: 24rpx;
.checkout-all {
flex-shrink: 0;
}
::v-deep .u-checkbox {
margin: 0;
}
}
.checkout-total {
margin-left: 8rpx;
} }
} }

View File

@@ -1,13 +1,28 @@
<template> <template>
<view class="category-wrap"> <view class="category-wrap">
<u-navbar class="navbar" :auto-back="false"> <u-navbar
<div class="title">商品分类</div> class="navbar"
:auto-back="false"
:fixed="true"
:placeholder="true"
:border="false"
left-icon=""
title=""
bg-color="#ffffff"
>
<template #left>
<view class="nav-content">
<text class="title">商品分类</text>
<view class="nav-search-wrap" :style="searchBarStyle">
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<u-search class="nav-search" @click="search" placeholder="搜索商品" :show-action="false"></u-search> <u-search class="nav-search" @click="search" placeholder="搜索商品" :show-action="false"></u-search>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<u-search class="nav-search" disabled @click="search" placeholder="搜索商品" :show-action="false"></u-search> <u-search class="nav-search" disabled @click="search" placeholder="搜索商品" :show-action="false"></u-search>
<!-- #endif --> <!-- #endif -->
</view>
</view>
</template>
</u-navbar> </u-navbar>
<view class="content"> <view class="content">
<scroll-view scroll-y scroll-with-animation class="left-aside"> <scroll-view scroll-y scroll-with-animation class="left-aside">
@@ -26,12 +41,14 @@
<text class="s-item">{{ item.name }}</text> <text class="s-item">{{ item.name }}</text>
<!-- 分类详情 --> <!-- 分类详情 -->
<view class="t-list"> <view class="t-list">
<view @click="navigateToList(item.id, children.id)" v-if="children.parentId === item.id" class="t-item" v-for="(children, cIndex) in item.children" :key="children.id" <template v-for="(children, cIndex) in item.children" :key="children.id">
<view @click="navigateToList(item.id, children.id)" v-if="children.parentId === item.id" class="t-item"
:class="{ 'margin-right': (cIndex + 1) % 3 == 0 }"> :class="{ 'margin-right': (cIndex + 1) % 3 == 0 }">
<u-image width="70px" height="70px" :src="children.image" :lazy-load="true"> <u-image width="70px" height="70px" :src="children.image" :lazy-load="true">
</u-image> </u-image>
<text>{{ children.name }}</text> <text>{{ children.name }}</text>
</view> </view>
</template>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@@ -48,8 +65,17 @@ export default {
tabList: [], //左侧标题列表 tabList: [], //左侧标题列表
categoryList: [], //右侧分类数据列表 categoryList: [], //右侧分类数据列表
topImg: "", //顶部图片 topImg: "", //顶部图片
searchBarWidth: 0, //导航栏搜索框宽度(避让微信胶囊)
}; };
}, },
computed: {
searchBarStyle() {
if (this.searchBarWidth) {
return { width: `${this.searchBarWidth}px` };
}
return { width: "460rpx" };
},
},
onLoad() { onLoad() {
this.loadData(); this.loadData();
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
@@ -57,7 +83,29 @@ export default {
uni.showShareMenu({ withShareTicket: true }); uni.showShareMenu({ withShareTicket: true });
// #endif // #endif
}, },
onReady() {
this.setSearchBarWidth();
},
methods: { methods: {
/**
* 根据微信胶囊位置计算搜索框宽度,避免被胶囊遮挡
*/
setSearchBarWidth() {
// #ifdef MP-WEIXIN
try {
const menuButton = uni.getMenuButtonBoundingClientRect();
const { windowWidth } = uni.getWindowInfo();
const capsuleInsetRight = windowWidth - menuButton.left;
const titleWidth = uni.upx2px(160); // “商品分类” 标题宽度
const leftPadding = uni.upx2px(60); // 左侧内边距
const gap = uni.upx2px(20); // 搜索框与胶囊间距
this.searchBarWidth =
windowWidth - capsuleInsetRight - titleWidth - leftPadding - gap;
} catch (e) {
this.searchBarWidth = 180;
}
// #endif
},
/** /**
* 查询 * 查询
*/ */
@@ -124,22 +172,30 @@ uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
.s-list { .s-list {
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05); box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
} }
.nav-content {
display: flex;
align-items: center;
}
.nav-search-wrap {
flex-shrink: 0;
}
.nav-search { .nav-search {
padding-left: 30rpx !important; width: 100%;
padding-right: 20rpx !important;
} }
.title { .title {
display: block; flex-shrink: 0;
width: 259rpx;
text-align: center; text-align: center;
font-size: 28rpx; font-size: 28rpx;
padding-right: 16rpx;
white-space: nowrap;
} }
.category-wrap { .category-wrap {
height: 100%; height: 100%;
display: flex;
flex-direction: column;
.content { .content {
height: calc(100vh - 94px); flex: 1;
min-height: 0;
display: flex; display: flex;
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;

View File

@@ -7,7 +7,7 @@
display: flex; display: flex;
} }
.item-price { .item-price {
> span { .price-text {
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
color: #e1212b; color: #e1212b;
@@ -26,7 +26,7 @@
position: relative; position: relative;
} }
.item-line-through { .item-line-through {
> span { .price-text {
font-size: 10px; font-size: 10px;
font-weight: 400; font-weight: 400;
text-decoration: line-through; text-decoration: line-through;
@@ -46,11 +46,11 @@
align-items: center; align-items: center;
background: #fff; background: #fff;
height: 50px; height: 50px;
> div:nth-of-type(1) { .join-title-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
> div:nth-of-type(2) { .join-title-more {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }

View File

@@ -4,8 +4,11 @@
display: block; display: block;
padding: 2rpx; padding: 2rpx;
} }
// 首页楼层模块统一左右边距(轮播图、宫格等 .layout 容器)
$home-layout-padding: 16rpx;
.layout { .layout {
padding: 16rpx; padding: $home-layout-padding;
margin: 8rpx 0; margin: 8rpx 0;
background: #fff; background: #fff;
} }

View File

@@ -1,11 +1,23 @@
<template> <template>
<div class="layout"> <view class="layout">
<div class="box"> <view class="banner-box">
<u-swiper @click="clickSwiper" interval="5000" duration="500" height="350" v-if="res" name="img" :list="res.list"> <u-swiper
v-if="res && res.list && res.list.length"
class="home-banner-swiper"
:list="res.list"
keyName="img"
height="350rpx"
imgMode="scaleToFill"
interval="5000"
duration="500"
circular
indicator
@click="clickSwiper"
>
<template #loading><u-loading></u-loading></template> <template #loading><u-loading></u-loading></template>
</u-swiper> </u-swiper>
</div> </view>
</div> </view>
</template> </template>
<script> <script>
@@ -34,4 +46,25 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./tpl.scss"; @import "./tpl.scss";
.banner-box {
width: 100%;
overflow: hidden;
}
:deep(.home-banner-swiper),
:deep(.u-swiper),
:deep(.u-swiper__wrapper) {
width: 100%;
}
:deep(.u-swiper__wrapper__item),
:deep(.u-swiper__wrapper__item__wrapper) {
width: 100%;
}
:deep(.u-swiper__wrapper__item__wrapper__image) {
width: 100% !important;
display: block;
}
</style> </style>

View File

@@ -29,7 +29,4 @@ export default {
justify-content: center; justify-content: center;
background-size: cover; background-size: cover;
} }
img {
width: 84px;
}
</style> </style>

View File

@@ -29,9 +29,5 @@ export default {
width: 100%; width: 100%;
display: block; display: block;
overflow: hidden; overflow: hidden;
> img {
width: 100%;
height: 100%;
}
} }
</style> </style>

View File

@@ -33,7 +33,4 @@ export default {
justify-content: center; justify-content: center;
background-size: cover; background-size: cover;
} }
img {
width: 111px;
}
</style> </style>

View File

@@ -38,10 +38,5 @@ export default {
} }
.flex-item { .flex-item {
width: 50%; width: 50%;
> img {
display: block;
max-width: 100%;
height: 100%;
}
} }
</style> </style>

View File

@@ -10,11 +10,12 @@
:key="index" :key="index"
> >
<h4 class="h4">{{ title.title }}</h4> <h4 class="h4">{{ title.title }}</h4>
<div>{{ title.desc }}</div> <div class="title-desc">{{ title.desc }}</div>
</div> </div>
</div> </div>
</u-sticky> </u-sticky>
<div class="goods-list"> <div class="goods-list">
<template v-for="(item, item_index) in res.list[0].listWay" :key="item_index">
<div <div
v-if=" v-if="
item.___index != undefined item.___index != undefined
@@ -23,8 +24,6 @@
" "
@click="handleClick(item)" @click="handleClick(item)"
class="goods-item" class="goods-item"
v-for="(item, item_index) in res.list[0].listWay"
:key="item_index"
> >
<div class="goods-img"> <div class="goods-img">
<u-image <u-image
@@ -42,16 +41,19 @@
</div> </div>
<div class="goods-bottom"> <div class="goods-bottom">
<div class="goods-price"> <div class="goods-price">
¥<span ¥<span class="price-int"
>{{ goodsFormatPrice(item.price)[0] }} </span >{{ goodsFormatPrice(item.price)[0] }} </span
>.{{ goodsFormatPrice(item.price)[1] }} >.{{ goodsFormatPrice(item.price)[1] }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template>
<div <template
v-if="res.list[0].titleWay[selected.index].bindCategory && goodsData.length" v-if="res.list[0].titleWay[selected.index].bindCategory && goodsData.length"
>
<div
v-for="(item, index) in goodsData" v-for="(item, index) in goodsData"
:key="index" :key="index"
class="goods-item" class="goods-item"
@@ -73,13 +75,14 @@
</div> </div>
<div class="goods-bottom"> <div class="goods-bottom">
<div class="goods-price"> <div class="goods-price">
¥<span ¥<span class="price-int"
>{{ goodsFormatPrice(item.price)[0] }} </span >{{ goodsFormatPrice(item.price)[0] }} </span
>.{{ goodsFormatPrice(item.price)[1] }} >.{{ goodsFormatPrice(item.price)[1] }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template>
</div> </div>
</div> </div>
</template> </template>
@@ -170,12 +173,12 @@ $w_94: 94%;
} }
.selected-title { .selected-title {
> h4 { .h4 {
font-size: 30rpx; font-size: 30rpx;
color: #000 !important; color: #000 !important;
} }
> div { .title-desc {
font-weight: bold; font-weight: bold;
color: $main-color !important; color: $main-color !important;
} }
@@ -191,11 +194,11 @@ $w_94: 94%;
flex: 1; flex: 1;
text-align: center; text-align: center;
> h4 { .h4 {
font-size: 32rpx; font-size: 32rpx;
} }
> div { .title-desc {
color: #999; color: #999;
font-size: 24rpx; font-size: 24rpx;
} }
@@ -223,10 +226,6 @@ $w_94: 94%;
border-top-left-radius: 20rpx; border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx; border-top-right-radius: 20rpx;
overflow: hidden; overflow: hidden;
> img {
width: 100%;
height: 100%;
}
} }
.goods-desc { .goods-desc {
@@ -252,7 +251,7 @@ $w_94: 94%;
> .goods-price { > .goods-price {
line-height: 2; line-height: 2;
color: $main-color; color: $main-color;
> span { .price-int {
font-size: 42rpx; font-size: 42rpx;
} }
} }

View File

@@ -2,8 +2,8 @@
<div class="layout"> <div class="layout">
<div class="join-list"> <div class="join-list">
<div class="join-title"> <div class="join-title">
<div>{{ res.list[0].title }}</div> <div class="join-title-name">{{ res.list[0].title }}</div>
<div>更多</div> <div class="join-title-more">更多</div>
</div> </div>
<div class="join-box"> <div class="join-box">
<div class="join-item" @click="modelNavigateTo(item)" v-for="item in 4" :key="item"> <div class="join-item" @click="modelNavigateTo(item)" v-for="item in 4" :key="item">
@@ -11,10 +11,10 @@
<img class="item-img" src="https://picsum.photos/id/268/200/200" alt /> <img class="item-img" src="https://picsum.photos/id/268/200/200" alt />
</div> </div>
<div class="item-price"> <div class="item-price">
<span>120.00</span> <span class="price-text">120.00</span>
</div> </div>
<div class="item-line-through"> <div class="item-line-through">
<span>190.00</span> <span class="price-text">190.00</span>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="layout"> <div class="layout">
<div class="flex-one hot-image"> <div class="flex-one hot-image">
<image mode="widthFix" :src="res.list[0].img" alt=""></image> <image class="hot-image-main" mode="widthFix" :src="res.list[0].img" alt=""></image>
<image <image
v-for="(area, index) in res.list[0].zoneInfo" v-for="(area, index) in res.list[0].zoneInfo"
@@ -47,11 +47,9 @@ export default {
width: 100%; width: 100%;
display: block; display: block;
overflow: hidden; overflow: hidden;
image {
width: 100%;
min-height: 200rpx;
// height: 100%;
} }
.hot-image-main {
width: 100%;
min-height: 200rpx;
} }
</style> </style>

View File

@@ -2,8 +2,8 @@
<div class="layout"> <div class="layout">
<div class="join-list"> <div class="join-list">
<div class="join-title"> <div class="join-title">
<div>{{ res.list[0].title }}</div> <div class="join-title-name">{{ res.list[0].title }}</div>
<div>更多</div> <div class="join-title-more">更多</div>
</div> </div>
<div class="join-box"> <div class="join-box">
<div class="join-item" v-for="item in 4" :key="item"> <div class="join-item" v-for="item in 4" :key="item">
@@ -11,10 +11,10 @@
<img class="item-img" src="https://picsum.photos/id/268/200/200" alt /> <img class="item-img" src="https://picsum.photos/id/268/200/200" alt />
</div> </div>
<div class="item-price"> <div class="item-price">
<span>20积分</span> <span class="price-text">20积分</span>
</div> </div>
<div class="item-line-through"> <div class="item-line-through">
<span>30积分</span> <span class="price-text">30积分</span>
</div> </div>
</div> </div>
</div> </div>
@@ -34,7 +34,7 @@ export default {
display: flex; display: flex;
} }
.item-price { .item-price {
> span { .price-text {
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
color: #e1212b; color: #e1212b;
@@ -53,7 +53,7 @@ export default {
position: relative; position: relative;
} }
.item-line-through { .item-line-through {
> span { .price-text {
font-size: 10px; font-size: 10px;
font-weight: 400; font-weight: 400;
text-decoration: line-through; text-decoration: line-through;
@@ -73,11 +73,11 @@ export default {
align-items: center; align-items: center;
background: #fff; background: #fff;
height: 50px; height: 50px;
> div:nth-of-type(1) { .join-title-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
> div:nth-of-type(2) { .join-title-more {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }

View File

@@ -2,8 +2,8 @@
<div class="layout"> <div class="layout">
<div class="join-list"> <div class="join-list">
<div class="join-title"> <div class="join-title">
<div>{{ res.list[0].title }}</div> <div class="join-title-name">{{ res.list[0].title }}</div>
<div>更多</div> <div class="join-title-more">更多</div>
</div> </div>
<div class="join-box"> <div class="join-box">
<div class="join-item" v-for="item in 4" :key="item"> <div class="join-item" v-for="item in 4" :key="item">
@@ -16,10 +16,10 @@
<div class="item-position-tips">2人团</div> <div class="item-position-tips">2人团</div>
</div> </div>
<div class="item-price"> <div class="item-price">
<span>120.00</span> <span class="price-text">120.00</span>
</div> </div>
<div class="item-line-through"> <div class="item-line-through">
<span>120.00</span> <span class="price-text">120.00</span>
</div> </div>
</div> </div>
</div> </div>
@@ -39,7 +39,7 @@ export default {
display: flex; display: flex;
} }
.item-price { .item-price {
> span { .price-text {
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
color: #e1212b; color: #e1212b;
@@ -58,7 +58,7 @@ export default {
position: relative; position: relative;
} }
.item-line-through { .item-line-through {
> span { .price-text {
font-size: 10px; font-size: 10px;
font-weight: 400; font-weight: 400;
text-decoration: line-through; text-decoration: line-through;
@@ -78,11 +78,11 @@ export default {
align-items: center; align-items: center;
background: #fff; background: #fff;
height: 50px; height: 50px;
> div:nth-of-type(1) { .join-title-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
> div:nth-of-type(2) { .join-title-more {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }

View File

@@ -1,13 +1,13 @@
<template> <template>
<div class="layout"> <view class="layout">
<div class="menu-list"> <view class="menu-list">
<div <view
class="menu-item" class="menu-item"
@click="modelNavigateTo(item)" @click="modelNavigateTo(item)"
v-for="(item, index) in res.list" v-for="(item, index) in res.list"
:key="index" :key="index"
> >
<div> <view class="menu-img-wrap">
<u-image <u-image
width="88rpx" width="88rpx"
height="88rpx" height="88rpx"
@@ -16,11 +16,11 @@
> >
<template #loading><u-loading></u-loading></template> <template #loading><u-loading></u-loading></template>
</u-image> </u-image>
</div> </view>
<div class="menu-title">{{ item.title }}</div> <view class="menu-title">{{ item.title }}</view>
</div> </view>
</div> </view>
</div> </view>
</template> </template>
<script> <script>
import { modelNavigateTo } from "./tpl"; import { modelNavigateTo } from "./tpl";
@@ -38,24 +38,45 @@ export default {
@import "./tpl.scss"; @import "./tpl.scss";
.menu-list { .menu-list {
display: flex; display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
align-items: flex-start;
> .menu-item { > .menu-item {
text-align: center;
width: 20%;
// flex: 1;
margin: 20rpx 0;
}
}
.menu-img {
display: flex; display: flex;
margin: 0 auto; flex-direction: column;
align-items: center;
justify-content: flex-start;
width: 20%;
flex: 0 0 20%;
box-sizing: border-box;
margin: 20rpx 0;
padding: 0 4rpx;
}
}
.menu-img-wrap {
width: 88rpx; width: 88rpx;
height: 88rpx; height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
} }
.menu-img {
flex-shrink: 0;
}
:deep(.menu-img .u-image) {
display: flex;
align-items: center;
justify-content: center;
}
.menu-title { .menu-title {
margin-top: 8rpx;
font-size: 24rpx; font-size: 24rpx;
line-height: 1.3;
width: 100%;
text-align: center;
} }
</style> </style>

View File

@@ -9,7 +9,7 @@
> >
<div> <div>
<div class="join-title"> <div class="join-title">
<div>{{ item.title }}</div> <div class="join-title-name">{{ item.title }}</div>
<div <div
class="sub" class="sub"
v-if="item.type !== 'SECKILL'" v-if="item.type !== 'SECKILL'"
@@ -54,7 +54,7 @@
{{ i.goodsName ? i.goodsName : i.name }} {{ i.goodsName ? i.goodsName : i.name }}
</div> </div>
<div class="item-price"> <div class="item-price">
<span>{{ i.price ? i.price : i.originalPrice }}</span> <span class="price-text">{{ i.price ? i.price : i.originalPrice }}</span>
</div> </div>
</div> </div>
</div> </div>
@@ -195,7 +195,7 @@ export default {
width: 316rpx !important; width: 316rpx !important;
} }
.item-price { .item-price {
> span { .price-text {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #e1212b; color: #e1212b;
@@ -214,7 +214,7 @@ export default {
position: relative; position: relative;
} }
.item-line-through { .item-line-through {
> span { .price-text {
font-size: 20rpx; font-size: 20rpx;
font-weight: 400; font-weight: 400;
text-decoration: line-through; text-decoration: line-through;
@@ -234,11 +234,12 @@ export default {
align-items: center; align-items: center;
background: #fff; background: #fff;
height: 100rpx; height: 100rpx;
> div:nth-of-type(1) { .join-title-name {
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
} }
> div:nth-of-type(2) { .sub,
.sub-seckill {
font-size: 20rpx; font-size: 20rpx;
line-height: 1.75; line-height: 1.75;
border-radius: 16rpx; border-radius: 16rpx;

View File

@@ -1,25 +1,16 @@
<template> <template>
<div class="layout"> <view class="layout">
<div class="search" @click="handleSearch"> <view class="search" @click="handleSearch">
<u-icon name="search"></u-icon> <u-icon name="search"></u-icon>
{{ res.list[0].title }} <text class="search-text">{{ res.list[0].title }}</text>
</div> </view>
<div class="navbar-right message" @click="linkMsgDetail" style="border-style:none;background:rgb(234,234,234);"> </view>
<image style="width:53rpx;height:53rpx;margin-top:6rpx;" src="@/static/img/title.png"></image>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
title:"搜索栏", title:"搜索栏",
props: ["res","storeId"], props: ["res","storeId"],
methods: { methods: {
linkMsgDetail(){
uni.navigateTo({
url:`/pages/tabbar/home/title`
})
},
handleSearch() { handleSearch() {
if(this.storeId){ if(this.storeId){
uni.navigateTo({ uni.navigateTo({
@@ -39,25 +30,33 @@ export default {
@import "./tpl.scss"; @import "./tpl.scss";
.search { .search {
width: 100%;
height: 64rpx; height: 64rpx;
border-radius: 10rpx; border-radius: 10rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: flex-start;
padding: 0 10rpx;
background: #ededed; background: #ededed;
color: #999;
overflow: hidden;
box-sizing: border-box;
}
.search-text {
margin-left: 12rpx;
font-size: 26rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.layout { .layout {
background: #fff; display: flex;
padding: 0 16rpx; align-items: center;
position: relative; width: 100%;
} background: transparent;
.navbar-right{ padding: 0;
position: absolute; box-sizing: border-box;
top: 0;
// right: 0;
}
.message{
right:40rpx;
} }
</style> </style>

View File

@@ -2,8 +2,8 @@
<div class="layout"> <div class="layout">
<div class="join-list"> <div class="join-list">
<div class="join-title"> <div class="join-title">
<div>{{ res.list[0].title }}</div> <div class="join-title-name">{{ res.list[0].title }}</div>
<div>更多</div> <div class="join-title-more">更多</div>
</div> </div>
<div class="join-box"> <div class="join-box">
<div class="join-item" v-for="item in 4" :key="item"> <div class="join-item" v-for="item in 4" :key="item">
@@ -15,10 +15,10 @@
/> />
</div> </div>
<div class="item-price"> <div class="item-price">
<span>120.00</span> <span class="price-text">120.00</span>
</div> </div>
<div class="item-line-through"> <div class="item-line-through">
<span>190.00</span> <span class="price-text">190.00</span>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -59,12 +59,7 @@ export default {
padding: 0; padding: 0;
} }
.-item-image { .-item-image {
padding: 10px; padding: 10px;
>img{
width: 100%;
}
} }
.-item-tilte { .-item-tilte {
background: $aider-light-color; background: $aider-light-color;

View File

@@ -53,18 +53,10 @@ export default {
display: flex; display: flex;
height: 200rpx; height: 200rpx;
width: 100%; width: 100%;
> img {
width: 100%;
height: 100%;
}
} }
.view-height-85 { .view-height-85 {
padding: 0 1px; padding: 0 1px;
width: 50%; width: 50%;
> img {
width: 100%;
height: 100%;
}
} }
.image-mode{ .image-mode{
width: 100%; width: 100%;

View File

@@ -8,8 +8,9 @@
width="100%" width="100%"
:src="res.list[0].img" :src="res.list[0].img"
alt alt
><u-loading #loading></u-loading >
></u-image> <template #loading><u-loading></u-loading></template>
</u-image>
</div> </div>
<div class="view-height-85" @click="modelNavigateTo(res.list[1])"> <div class="view-height-85" @click="modelNavigateTo(res.list[1])">
<u-image <u-image
@@ -18,8 +19,9 @@
width="100%" width="100%"
:src="res.list[1].img" :src="res.list[1].img"
alt alt
><u-loading #loading></u-loading >
></u-image> <template #loading><u-loading></u-loading></template>
</u-image>
</div> </div>
</div> </div>
<div class="view-width-100" @click="modelNavigateTo(res.list[2])"> <div class="view-width-100" @click="modelNavigateTo(res.list[2])">
@@ -28,8 +30,9 @@
height="200rpx" height="200rpx"
width="100%" width="100%"
:src="res.list[2].img" :src="res.list[2].img"
><u-loading #loading></u-loading >
></u-image> <template #loading><u-loading></u-loading></template>
</u-image>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -3,16 +3,26 @@
<!-- uni 中不能使用 vue component 所以用if判断每个组件 --> <!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
<div v-for="(item, index) in pageData.list" :key="index"> <div v-for="(item, index) in pageData.list" :key="index">
<!-- 搜索栏如果在楼层装修顶部则会自动浮动否则不浮动 --> <!-- 搜索栏如果在楼层装修顶部则会自动浮动否则不浮动 -->
<u-navbar class="navbar" v-if="item.type == 'search'" :auto-back="false" :fixed="index === 1 ? false : true"> <u-navbar
<search style="width: 100%" :res="item.options" /> class="navbar"
<!-- #ifndef H5 --> v-if="item.type == 'search'"
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode --> :auto-back="false"
<template #right> :fixed="index === 1 ? false : true"
<div class="navbar-right"> :placeholder="index === 1 ? false : true"
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon> left-icon=""
</div> title=""
bg-color="#ffffff"
>
<template #left>
<view class="navbar-search-wrap" :style="searchBarStyle" @click.stop>
<search :res="item.options" />
</view>
</template>
<template #right>
<view class="navbar-message" :style="messageIconStyle" @click="linkMsgDetail">
<image class="message-icon" src="/static/img/title.png" mode="aspectFit"></image>
</view>
</template> </template>
<!-- #endif -->
</u-navbar> </u-navbar>
<carousel v-if="item.type == 'carousel'" :res="item.options" /> <carousel v-if="item.type == 'carousel'" :res="item.options" />
<titleLayout v-if="item.type == 'title'" :res="item.options" /> <titleLayout v-if="item.type == 'title'" :res="item.options" />
@@ -68,6 +78,8 @@ import tpl_notice from "@/pages/tabbar/home/template/tpl_notice"; //标题栏模
import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //标题栏模块 import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //标题栏模块
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import fetchCoupon from '@/pages/tabbar/home/template/fetch_coupon' import fetchCoupon from '@/pages/tabbar/home/template/fetch_coupon'
// 与 tpl.scss $home-layout-padding 保持一致
const HOME_LAYOUT_PADDING_RPX = 16;
// import {receiveCoupons} from "@/api/members" // import {receiveCoupons} from "@/api/members"
export default { export default {
@@ -79,8 +91,30 @@ export default {
pageData: "", //楼层页面数据 pageData: "", //楼层页面数据
isIos: "", isIos: "",
enableLoad: false, //触底加载 针对于商品模块 enableLoad: false, //触底加载 针对于商品模块
capsuleInsetRight: 0,
searchBarWidth: 0,
}; };
}, },
computed: {
messageIconStyle() {
if (!this.capsuleInsetRight) {
return {};
}
return {
marginRight: `${this.capsuleInsetRight}px`,
};
},
searchBarStyle() {
if (this.searchBarWidth) {
return {
width: `${this.searchBarWidth}px`,
};
}
return {
width: '560rpx',
};
},
},
components: { components: {
carousel: tpl_banner, carousel: tpl_banner,
titleLayout: tpl_title, titleLayout: tpl_title,
@@ -104,6 +138,7 @@ export default {
}, },
mounted () { mounted () {
this.setCapsuleInset();
this.init(); this.init();
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// 小程序默认分享 // 小程序默认分享
@@ -112,6 +147,28 @@ export default {
}, },
methods: { methods: {
setCapsuleInset() {
// #ifdef MP-WEIXIN
try {
const menuButton = uni.getMenuButtonBoundingClientRect();
const { windowWidth } = uni.getWindowInfo();
this.capsuleInsetRight = windowWidth - menuButton.left;
const messageWidth = uni.upx2px(20);
const leftPadding = uni.upx2px(HOME_LAYOUT_PADDING_RPX);
const gap = uni.upx2px(0);
this.searchBarWidth =
windowWidth - this.capsuleInsetRight - messageWidth - leftPadding - gap;
} catch (e) {
this.capsuleInsetRight = 90;
this.searchBarWidth = 260;
}
// #endif
},
linkMsgDetail() {
uni.navigateTo({
url: "/pages/tabbar/home/title",
});
},
fetchCoupon(){ fetchCoupon(){
this.$refs.coupon.firstGetAuto(); this.$refs.coupon.firstGetAuto();
}, },
@@ -245,7 +302,31 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.navbar-right { @import "@/pages/tabbar/home/template/tpl.scss";
padding: 0 16rpx 0 0;
.navbar {
width: 100%;
:deep(.u-navbar__content__left) {
width: auto !important;
padding: 0 0 0 $home-layout-padding !important;
}
}
.navbar-search-wrap {
box-sizing: border-box;
flex-shrink: 0;
}
.navbar-message {
display: flex;
align-items: center;
justify-content: center;
}
.message-icon {
width: 53rpx;
height: 53rpx;
display: block;
} }
</style> </style>

View File

@@ -6,7 +6,7 @@
</view> </view>
<view class="header" @click="userDetail"> <view class="header" @click="userDetail">
<view class="head-1"> <view class="head-1">
<image :src="userInfo.face || userImage"></image> <image class="head-avatar" :src="userInfo.face || userImage"></image>
</view> </view>
<view class="head-2" v-if="userInfo.id"> <view class="head-2" v-if="userInfo.id">
<view class="user-name">{{ userInfo.nickName }}</view> <view class="user-name">{{ userInfo.nickName }}</view>
@@ -14,57 +14,55 @@
<view class="head-2" v-else> <view class="head-2" v-else>
<view class="user-name">登录/注册</view> <view class="user-name">登录/注册</view>
</view> </view>
<u-icon style="display: flex;align-items: flex-start;" name="arrow-right"></u-icon> <u-icon class="header-arrow" name="arrow-right"></u-icon>
</view> </view>
<!-- 积分优惠券关注 --> <!-- 积分优惠券关注 -->
<div class="pointBox box"> <div class="pointBox box">
<u-row text-align="center" gutter="16" class="point"> <view class="point">
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/operation')"> <view class="point-item" @click="navigateTo('/pages/mine/deposit/operation')">
<view>预存款</view> <view class="point-label">预存款</view>
<view class="money">{{unitPrice(walletNum) }}</view> <view class="point-value money">{{ unitPrice(walletNum) }}</view>
</u-col> </view>
<view class="point-item" @click="navigateTo('/pages/cart/coupon/myCoupon')">
<u-col text-align="center" span="4" @click="navigateTo('/pages/cart/coupon/myCoupon')"> <view class="point-label">优惠券</view>
<view>优惠券</view> <view class="point-value">{{ couponNum || 0 }}</view>
<view>{{ couponNum || 0 }}</view> </view>
</u-col> <view class="point-item" @click="navigateTo('/pages/mine/myTracks')">
<view class="point-label">足迹</view>
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/myTracks')"> <view class="point-value">{{ footNum || 0 }}</view>
<view>足迹</view> </view>
<view>{{ footNum || 0 }}</view> </view>
</u-col>
</u-row>
<!-- 我的订单代付款 --> <!-- 我的订单代付款 -->
<view class="order"> <view class="order">
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=1')"> <view class="order-item" @click="navigateTo('/pages/order/myOrder?status=1')">
<div class="bag bag2"> <view class="bag bag2">
<u-icon name="bag-fill" size="35" color="#fff"></u-icon> <u-icon name="bag-fill" size="22" color="#fff"></u-icon>
</div> </view>
<view>待付款</view> <view class="order-item-label">待付款</view>
</view> </view>
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=3')"> <view class="order-item" @click="navigateTo('/pages/order/myOrder?status=3')">
<div class="bag bag3"> <view class="bag bag3">
<u-icon name="car-fill" size="35" color="#fff"></u-icon> <u-icon name="car-fill" size="22" color="#fff"></u-icon>
</div> </view>
<view>待收货</view> <view class="order-item-label">待收货</view>
</view> </view>
<view class="order-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')"> <view class="order-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
<div class="bag bag4"> <view class="bag bag4">
<u-icon name="star-fill" size="35" color="#fff"></u-icon> <u-icon name="star-fill" size="22" color="#fff"></u-icon>
</div> </view>
<view>待评价</view> <view class="order-item-label">待评价</view>
</view> </view>
<view class="order-item" @click="navigateTo('/pages/order/afterSales/afterSales')"> <view class="order-item" @click="navigateTo('/pages/order/afterSales/afterSales')">
<div class="bag bag5"> <view class="bag bag5">
<u-icon name="server-fill" size="35" color="#fff"></u-icon> <u-icon name="server-fill" size="22" color="#fff"></u-icon>
</div> </view>
<view>售后</view> <view class="order-item-label">售后</view>
</view> </view>
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')"> <view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')">
<div class="bag bag1"> <view class="bag bag1">
<u-icon name="order" size="35" color="#fff"></u-icon> <u-icon name="order" size="22" color="#fff"></u-icon>
</div> </view>
<view>我的订单</view> <view class="order-item-label">我的订单</view>
</view> </view>
</view> </view>
</div> </div>
@@ -179,21 +177,18 @@ body {
background-repeat: no-repeat; background-repeat: no-repeat;
color: #ffffff; color: #ffffff;
display: flex; display: flex;
justify-content: space-between;
.head-1 {
text-align: center;
width: 152rpx;
position: relative;
display: flex;
align-items: center; align-items: center;
image { .head-1 {
flex-shrink: 0;
width: 152rpx;
.head-avatar {
width: 152rpx; width: 152rpx;
height: 144rpx; height: 144rpx;
border-radius: 50%; border-radius: 50%;
margin-bottom: 30rpx;
border: 3px solid #fff; border: 3px solid #fff;
display: block;
} }
.edti-head { .edti-head {
@@ -205,7 +200,7 @@ body {
top: 100rpx; top: 100rpx;
right: 0; right: 0;
image { .head-avatar {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
@@ -215,13 +210,14 @@ body {
.head-2 { .head-2 {
flex: 1; flex: 1;
margin-left: 30rpx; margin-left: 30rpx;
margin-top: 100rpx; min-width: 0;
line-height: 1; display: flex;
align-items: center;
} }
::v-deep .u-icon, .header-arrow {
.u-icon { flex-shrink: 0;
margin-top: 106rpx; margin-left: 20rpx;
} }
} }
@@ -234,47 +230,53 @@ body {
} }
.point { .point {
display: flex;
align-items: center;
text-align: center; text-align: center;
height: 160rpx; height: 160rpx;
font-size: $font-sm; font-size: $font-sm;
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
padding: 24rpx; padding: 24rpx;
// #endif // #endif
.u-col {
view { .point-item {
flex: 1;
text-align: center;
}
.point-label {
color: $u-main-color; color: $u-main-color;
font-size: 28rpx; font-size: 28rpx;
} }
view:last-child { .point-value {
margin-top: 8rpx; margin-top: 8rpx;
color: $main-color; color: $main-color;
font-size: $font-lg; font-size: $font-lg;
} }
} }
}
.order { .order {
height: 140rpx; height: 140rpx;
text-align: center;
font-size: $font-sm; font-size: $font-sm;
display: flex; display: flex;
justify-content: space-around;
align-items: center; align-items: center;
padding: 0 3%; padding: 0 3%;
color: #999; color: #999;
.order-item { .order-item {
position: relative; flex: 1;
line-height: 2em; display: flex;
width: 96rpx; flex-direction: column;
align-items: center;
:first-child { justify-content: center;
font-size: 48rpx; text-align: center;
margin-bottom: 10rpx;
} }
.order-item-label {
margin-top: 10rpx;
line-height: 1.4;
font-size: $font-sm;
} }
} }
} }
@@ -285,13 +287,18 @@ body {
.user-name { .user-name {
font-size: 34rpx; font-size: 34rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.bag { .bag {
width: 56rpx; width: 56rpx;
height: 56rpx; height: 56rpx;
border-radius: 50%; border-radius: 50%;
margin: 0 auto; display: flex;
align-items: center;
justify-content: center;
} }
.bag1 { .bag1 {

View File

@@ -6,51 +6,51 @@
<div class="paddingBox"> <div class="paddingBox">
<view class="interact-container"> <view class="interact-container">
<view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')"> <view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')">
<image src="/static/mine/myaddress.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/myaddress.png" mode=""></image>
<view>地址管理</view> <view>地址管理</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/mine/myTracks')"> <view class="interact-item" @click="navigateTo('/pages/mine/myTracks')">
<image src="/static/mine/logistics.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/logistics.png" mode=""></image>
<view>我的足迹</view> <view>我的足迹</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')"> <view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
<image src="/static/mine/feedback.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/feedback.png" mode=""></image>
<view>我的评价</view> <view>我的评价</view>
</view> </view>
<!-- <view class="interact-item" @click="linkMsgDetail()"> <!-- <view class="interact-item" @click="linkMsgDetail()">
<image src="/static/mine/mycommit.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/mycommit.png" mode=""></image>
<view>我的消息</view> <view>我的消息</view>
</view> --> </view> -->
<view class="interact-item" @click="navigateTo('/pages/mine/myCollect')"> <view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
<image src="/static/mine/myfavorite.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/myfavorite.png" mode=""></image>
<view>我的关注</view> <view>我的关注</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')"> <view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')">
<image src="/static/mine/mypoint.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/mypoint.png" mode=""></image>
<view>我的积分</view> <view>我的积分</view>
</view> </view>
<view class="interact-item" @click="distribution"> <view class="interact-item" @click="distribution">
<image src="/static/mine/distribution.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/distribution.png" mode=""></image>
<view>我的分销</view> <view>我的分销</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')"> <view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')">
<image src="/static/mine/shensu.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/shensu.png" mode=""></image>
<view>我的投诉</view> <view>我的投诉</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')"> <view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')">
<image src="/static/mine/mycoupon.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/mycoupon.png" mode=""></image>
<view>优惠券</view> <view>优惠券</view>
</view> </view>
@@ -58,7 +58,7 @@
<view class="interact-item" @click="navigateTo('/pages/mine/signIn')"> <view class="interact-item" @click="navigateTo('/pages/mine/signIn')">
<image src="/static/mine/sign.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/sign.png" mode=""></image>
<view>每日签到</view> <view>每日签到</view>
</view> </view>
@@ -68,41 +68,41 @@
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')"> <view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')">
<image src="/static/mine/couponcenter.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/couponcenter.png" mode=""></image>
<view>领券中心</view> <view>领券中心</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')"> <view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')">
<image src="/static/mine/kanjia.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/kanjia.png" mode=""></image>
<view>砍价记录</view> <view>砍价记录</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')"> <view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')">
<image src="/static/mine/feedback.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/feedback.png" mode=""></image>
<view>意见反馈</view> <view>意见反馈</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/mine/set/editionIntro')"> <view class="interact-item" @click="navigateTo('/pages/mine/set/editionIntro')">
<image src="/static/mine/pointgift.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/pointgift.png" mode=""></image>
<view>关于</view> <view>关于</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/passport/entry/seller/index')"> <view class="interact-item" @click="navigateTo('/pages/passport/entry/seller/index')">
<image src="/static/mine/feedback.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/feedback.png" mode=""></image>
<view>店铺入驻</view> <view>店铺入驻</view>
</view> </view>
<!-- <view class="interact-item" @click="inviter()">--> <!-- <view class="interact-item" @click="inviter()">-->
<!-- <image src="/static/mine/share.png" mode=""></image>--> <!-- <image class="interact-item-icon" src="/static/mine/share.png" mode=""></image>-->
<!-- <view>邀新</view>--> <!-- <view>邀新</view>-->
<!-- </view>--> <!-- </view>-->
<view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')"> <view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')">
<image src="/static/mine/setting.png" mode=""></image> <image class="interact-item-icon" src="/static/mine/setting.png" mode=""></image>
<view>设置</view> <view>设置</view>
</view> </view>
@@ -114,7 +114,7 @@
<u-popup v-model:show="sharingShow" mode="bottom" border-radius="14"> <u-popup v-model:show="sharingShow" mode="bottom" border-radius="14">
<view style="margin: 10px; text-align: center;"> 请邀请用户扫描二维码或者将地址复制转发给其他用户 </view> <view style="margin: 10px; text-align: center;"> 请邀请用户扫描二维码或者将地址复制转发给其他用户 </view>
<view class='qrcode'> <view class='qrcode'>
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="sharingLink" :options="{ margin: 10 }"> <uqrcode v-if="sharingLink" ref="uqrcode" canvas-id="qrcode" :value="sharingLink" :options="{ margin: 10 }">
</uqrcode> </uqrcode>
</view> </view>
@@ -253,17 +253,10 @@ export default {
border-radius: 20rpx; border-radius: 20rpx;
box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1); box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1);
.interact-item-img { .interact-item-icon {
width: 52rpx !important; width: 56rpx;
height: 52rpx !important; height: 56rpx;
// margin-bottom: !important; margin-bottom: 10rpx;
margin: 0 auto 6rpx auto !important;
}
image {
width: 52rpx;
height: 52rpx;
margin-bottom: 6rpx;
} }
display: flex; display: flex;
@@ -272,10 +265,17 @@ export default {
text-align: center; text-align: center;
.interact-item { .interact-item {
font-size: $font-sm; font-size: 24rpx;
width: 25%; width: 25%;
height: 160rpx; flex: 0 0 25%;
padding: 30rpx; box-sizing: border-box;
height: 150rpx;
padding: 20rpx 8rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #666;
} }
} }
} }

View File

@@ -0,0 +1,306 @@
diff --git a/node_modules/uview-plus/components/u-image/u-image.vue b/node_modules/uview-plus/components/u-image/u-image.vue
index 24e3b10..1360704 100644
--- a/node_modules/uview-plus/components/u-image/u-image.vue
+++ b/node_modules/uview-plus/components/u-image/u-image.vue
@@ -26,7 +26,7 @@
}"
></image>
<view
- v-if="showLoading && loading"
+ v-if="uShowLoading && loading"
class="u-image__loading"
:style="{
borderRadius: shape == 'circle' ? '50%' : addUnit(radius),
@@ -42,7 +42,7 @@
</slot>
</view>
<view
- v-if="showError && isError && !loading"
+ v-if="uShowError && isError && !loading"
class="u-image__error"
:style="{
borderRadius: shape == 'circle' ? '50%' : addUnit(radius),
@@ -126,6 +126,12 @@
}
},
computed: {
+ uShowError() {
+ return this.$props.showError !== false
+ },
+ uShowLoading() {
+ return this.$props.showLoading !== false
+ },
transStyle() {
let style = {};
// 通过调用addUnit()方法如果有单位如百分比px单位等直接返回如果是纯粹的数值则加上rpx单位
diff --git a/node_modules/uview-plus/components/u-navbar/theme-vars.scss b/node_modules/uview-plus/components/u-navbar/theme-vars.scss
index d057ee6..791a092 100644
--- a/node_modules/uview-plus/components/u-navbar/theme-vars.scss
+++ b/node_modules/uview-plus/components/u-navbar/theme-vars.scss
@@ -1,21 +1,3 @@
-:root,
-page,
-body {
- --up-navbar-bg-color: #ffffff;
-}
-
-@media (prefers-color-scheme: dark) {
- :root,
- page,
- body {
- --up-navbar-bg-color: #1c1c1e;
- }
-}
-
-[data-up-theme='light'] {
- --up-navbar-bg-color: #ffffff;
-}
-
-[data-up-theme='dark'] {
- --up-navbar-bg-color: #1c1c1e;
-}
+/* 主题变量已由全局 uview-plus/index.scss(app.wxss) 提供。
+ * 此处原有 page/body 标签选择器与 [data-up-theme] 属性选择器,
+ * 在微信小程序组件级 wxss 中不被允许,会触发编译告警,故移除。 */
diff --git a/node_modules/uview-plus/components/u-notice-bar/theme-vars.scss b/node_modules/uview-plus/components/u-notice-bar/theme-vars.scss
index ed4c8ea..b1e4a3e 100644
--- a/node_modules/uview-plus/components/u-notice-bar/theme-vars.scss
+++ b/node_modules/uview-plus/components/u-notice-bar/theme-vars.scss
@@ -1,25 +1,3 @@
-:root,
-page,
-body {
- --up-notice-bar-color: #f9ae3d;
- --up-notice-bar-bg-color: #fdf6ec;
-}
-
-@media (prefers-color-scheme: dark) {
- :root,
- page,
- body {
- --up-notice-bar-color: #f9ae3d;
- --up-notice-bar-bg-color: #3d2f1b;
- }
-}
-
-[data-up-theme='light'] {
- --up-notice-bar-color: #f9ae3d;
- --up-notice-bar-bg-color: #fdf6ec;
-}
-
-[data-up-theme='dark'] {
- --up-notice-bar-color: #f9ae3d;
- --up-notice-bar-bg-color: #3d2f1b;
-}
+/* 主题变量改由组件 JS 的 upThemeVar 默认值兜底。
+ * 原有 page/body 标签选择器与 [data-up-theme] 属性选择器,
+ * 在微信小程序组件级 wxss 中不被允许,会触发编译告警,故移除。 */
diff --git a/node_modules/uview-plus/components/u-popup/u-popup.vue b/node_modules/uview-plus/components/u-popup/u-popup.vue
index e06f46e..2557244 100644
--- a/node_modules/uview-plus/components/u-popup/u-popup.vue
+++ b/node_modules/uview-plus/components/u-popup/u-popup.vue
@@ -11,11 +11,11 @@
<u-overlay
:show="show && pageInline == false"
@click="overlayClick"
- v-if="overlay"
+ v-if="uOverlay"
:zIndex="zIndex"
:duration="overlayDuration"
- :customStyle="overlayStyle"
- :opacity="overlayOpacity"
+ :customStyle="uOverlayStyle"
+ :opacity="uOverlayOpacity"
></u-overlay>
<u-transition
class="u-popup__content—transition"
@@ -105,7 +105,13 @@
*/
export default {
name: 'u-popup',
+ // 微信小程序不使用 mpMixin避免 virtualHost 导致 props 无法挂到实例
+ // #ifndef MP-WEIXIN
mixins: [mpMixin, mixin, props],
+ // #endif
+ // #ifdef MP-WEIXIN
+ mixins: [mixin, props],
+ // #endif
data() {
return {
overlayDuration: this.duration + 50,
@@ -128,6 +134,15 @@
}
},
computed: {
+ uOverlay() {
+ return this.$props.overlay !== false
+ },
+ uOverlayStyle() {
+ return this.$props.overlayStyle
+ },
+ uOverlayOpacity() {
+ return this.$props.overlayOpacity
+ },
transitionStyle() {
const style = {
display: 'flex',
diff --git a/node_modules/uview-plus/components/u-subsection/theme-vars.scss b/node_modules/uview-plus/components/u-subsection/theme-vars.scss
index eeb867e..b1e4a3e 100644
--- a/node_modules/uview-plus/components/u-subsection/theme-vars.scss
+++ b/node_modules/uview-plus/components/u-subsection/theme-vars.scss
@@ -1,41 +1,3 @@
-:root,
-page,
-body {
- --up-subsection-bg-color: #eeeeef;
- --up-subsection-bar-color: #ffffff;
- --up-subsection-inactive-color: #303133;
- --up-subsection-disabled-text-color: #c8c9cc;
- --up-subsection-disabled-border-color: #d4d4d4;
- --up-subsection-disabled-bar-color: #f5f5f5;
-}
-
-@media (prefers-color-scheme: dark) {
- :root,
- page,
- body {
- --up-subsection-bg-color: #2b2c30;
- --up-subsection-bar-color: #3a3b40;
- --up-subsection-inactive-color: #d1d5db;
- --up-subsection-disabled-text-color: #6b7280;
- --up-subsection-disabled-border-color: #3a3a3c;
- --up-subsection-disabled-bar-color: #3a3a3c;
- }
-}
-
-[data-up-theme='light'] {
- --up-subsection-bg-color: #eeeeef;
- --up-subsection-bar-color: #ffffff;
- --up-subsection-inactive-color: #303133;
- --up-subsection-disabled-text-color: #c8c9cc;
- --up-subsection-disabled-border-color: #d4d4d4;
- --up-subsection-disabled-bar-color: #f5f5f5;
-}
-
-[data-up-theme='dark'] {
- --up-subsection-bg-color: #2b2c30;
- --up-subsection-bar-color: #3a3b40;
- --up-subsection-inactive-color: #d1d5db;
- --up-subsection-disabled-text-color: #6b7280;
- --up-subsection-disabled-border-color: #3a3a3c;
- --up-subsection-disabled-bar-color: #3a3a3c;
-}
+/* 主题变量改由组件 JS 的 upThemeVar 默认值兜底。
+ * 原有 page/body 标签选择器与 [data-up-theme] 属性选择器,
+ * 在微信小程序组件级 wxss 中不被允许,会触发编译告警,故移除。 */
diff --git a/node_modules/uview-plus/components/u-swiper/u-swiper.vue b/node_modules/uview-plus/components/u-swiper/u-swiper.vue
index a872ba7..3b9cde3 100644
--- a/node_modules/uview-plus/components/u-swiper/u-swiper.vue
+++ b/node_modules/uview-plus/components/u-swiper/u-swiper.vue
@@ -51,6 +51,7 @@
:mode="imgMode"
@tap="clickHandler(index)"
:style="{
+ width: '100%',
height: addUnit(height),
borderRadius: addUnit(radius)
}"
@@ -240,6 +241,7 @@
&__image {
flex: 1;
+ width: 100%;
}
&__video {
diff --git a/node_modules/uview-plus/components/u-switch/theme-vars.scss b/node_modules/uview-plus/components/u-switch/theme-vars.scss
index 1ca7595..b1e4a3e 100644
--- a/node_modules/uview-plus/components/u-switch/theme-vars.scss
+++ b/node_modules/uview-plus/components/u-switch/theme-vars.scss
@@ -1,41 +1,3 @@
-:root,
-page,
-body {
- --up-switch-active-color: #3c9cff;
- --up-switch-inactive-color: #ffffff;
- --up-switch-dot-active-color: #ffffff;
- --up-switch-dot-inactive-color: #ffffff;
- --up-switch-loading-inactive-color: #aaabad;
- --up-switch-border-color: rgba(0, 0, 0, 0.12);
-}
-
-@media (prefers-color-scheme: dark) {
- :root,
- page,
- body {
- --up-switch-active-color: #3c9cff;
- --up-switch-inactive-color: #3a3a3c;
- --up-switch-dot-active-color: #ffffff;
- --up-switch-dot-inactive-color: #d1d5db;
- --up-switch-loading-inactive-color: #9ca3af;
- --up-switch-border-color: #4b5563;
- }
-}
-
-[data-up-theme='light'] {
- --up-switch-active-color: #3c9cff;
- --up-switch-inactive-color: #ffffff;
- --up-switch-dot-active-color: #ffffff;
- --up-switch-dot-inactive-color: #ffffff;
- --up-switch-loading-inactive-color: #aaabad;
- --up-switch-border-color: rgba(0, 0, 0, 0.12);
-}
-
-[data-up-theme='dark'] {
- --up-switch-active-color: #3c9cff;
- --up-switch-inactive-color: #3a3a3c;
- --up-switch-dot-active-color: #ffffff;
- --up-switch-dot-inactive-color: #d1d5db;
- --up-switch-loading-inactive-color: #9ca3af;
- --up-switch-border-color: #4b5563;
-}
+/* 主题变量改由组件 JS 的 upThemeVar 默认值兜底。
+ * 原有 page/body 标签选择器与 [data-up-theme] 属性选择器,
+ * 在微信小程序组件级 wxss 中不被允许,会触发编译告警,故移除。 */
diff --git a/node_modules/uview-plus/components/u-tabs/u-tabs.vue b/node_modules/uview-plus/components/u-tabs/u-tabs.vue
index 46caac2..5736483 100644
--- a/node_modules/uview-plus/components/u-tabs/u-tabs.vue
+++ b/node_modules/uview-plus/components/u-tabs/u-tabs.vue
@@ -3,7 +3,7 @@
<view class="u-tabs__wrapper">
<slot name="left" />
<view class="u-tabs__wrapper__scroll-view-wrapper">
- <scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation
+ <scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation :enable-flex="true"
class="u-tabs__wrapper__scroll-view" :show-scrollbar="false" ref="u-tabs__wrapper__scroll-view">
<view class="u-tabs__wrapper__nav" ref="u-tabs__wrapper__nav">
<view class="u-tabs__wrapper__nav__item" v-for="(item, index) in tabList" :key="index"
diff --git a/node_modules/uview-plus/components/u-tag/theme-vars.scss b/node_modules/uview-plus/components/u-tag/theme-vars.scss
index bf38484..b1e4a3e 100644
--- a/node_modules/uview-plus/components/u-tag/theme-vars.scss
+++ b/node_modules/uview-plus/components/u-tag/theme-vars.scss
@@ -1,21 +1,3 @@
-:root,
-page,
-body {
- --up-tag-close-bg-color: #c8c9cc;
-}
-
-@media (prefers-color-scheme: dark) {
- :root,
- page,
- body {
- --up-tag-close-bg-color: #4b5563;
- }
-}
-
-[data-up-theme='light'] {
- --up-tag-close-bg-color: #c8c9cc;
-}
-
-[data-up-theme='dark'] {
- --up-tag-close-bg-color: #4b5563;
-}
+/* 主题变量改由组件 JS 的 upThemeVar 默认值兜底。
+ * 原有 page/body 标签选择器与 [data-up-theme] 属性选择器,
+ * 在微信小程序组件级 wxss 中不被允许,会触发编译告警,故移除。 */

View File

@@ -918,3 +918,12 @@ export default function (isPrompt = false) {
}); });
} }
// #endif // #endif
// #ifndef APP-PLUS
export default function APPUpdate() {}
export const getCurrentNo = function (callback) {
callback && callback({ versionCode: "", version: "" });
};
export const getServerNo = function () {};
export const getDownload = function () {};
// #endif

View File

@@ -19,6 +19,10 @@ function process(content) {
.replace(/<u-cell-item/g, '<u-cell') .replace(/<u-cell-item/g, '<u-cell')
.replace(/<\/u-cell-item>/g, '</u-cell>') .replace(/<\/u-cell-item>/g, '</u-cell>')
.replace(/:arrow="false"/g, ':isLink="false"') .replace(/:arrow="false"/g, ':isLink="false"')
.replace(/<u-loading(\s|>|\/)/g, '<u-loading-icon$1')
.replace(/<\/u-loading>/g, '</u-loading-icon>')
.replace(/<u-alert-tips/g, '<u-alert')
.replace(/<\/u-alert-tips>/g, '</u-alert>')
} }
walk(root).forEach((file) => { walk(root).forEach((file) => {

View File

@@ -65,9 +65,6 @@ $font-weight: 400;
} }
.bg-light-color { .bg-light-color {
background-color: $light-color !important; background-color: $light-color !important;
::v-deep * {
background-color: $light-color !important;
}
} }
.bg-main-color { .bg-main-color {
background-color: $main-color !important; background-color: $main-color !important;

View File

@@ -229,6 +229,38 @@ function navigationToBack(type) {
} }
} }
/**
* 解析商品相册/图片项,兼容上传组件的 JSON 字符串与纯 URL。
* 后端 goodsGalleryList 可能同时存在两种格式:
* - '{"url":"https://...jpg","name":"x.jpg","status":"finished"}'
* - 'https://...jpg'
* @param {String} item 单个相册项
* @returns {String} 解析出的图片地址,无法解析时返回空字符串
*/
export function parseGoodsImageUrl(item) {
if (item === null || item === undefined) return "";
if (typeof item !== "string") return "";
const trimmed = item.trim();
if (!trimmed) return "";
// 纯 URL 直接返回
if (/^https?:\/\//.test(trimmed)) return trimmed;
// JSON 字符串,尝试解析取 url 字段
if (trimmed.charAt(0) === "{") {
try {
const parsed = JSON.parse(trimmed);
const url = parsed && (parsed.url || parsed.path || parsed.link);
if (typeof url === "string" && /^https?:\/\//.test(url.trim())) {
return url.trim();
}
} catch (e) {
// 解析失败时退化为正则提取
}
const match = trimmed.match(/https?:\/\/[^\s"'\\}]+/);
if (match) return match[0];
}
return "";
}
/** /**
* 计算当前时间到第二天0点的倒计时[秒] * 计算当前时间到第二天0点的倒计时[秒]
* @returns {number} * @returns {number}
@@ -246,7 +278,7 @@ export function theNextDayTime() {
).getTime() - nowDate.getTime(); ).getTime() - nowDate.getTime();
return parseInt(time / 1000); return parseInt(time / 1000);
} }
module.exports = { export default {
unixToDate, unixToDate,
dateToUnix, dateToUnix,
formatPrice, formatPrice,
@@ -256,4 +288,5 @@ module.exports = {
theNextDayTime, theNextDayTime,
whetherNavigate, whetherNavigate,
checkBankno, checkBankno,
parseGoodsImageUrl,
}; };

View File

@@ -3,6 +3,15 @@ import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import config from "@/config/config"; import config from "@/config/config";
import Foundation from "./Foundation.js"; import Foundation from "./Foundation.js";
/**
* 解析商品图片地址,兼容上传 JSON 与纯 URL非法时返回占位图
*/
export function parseGoodsImageUrl(item, fallback = config.logo) {
const url = Foundation.parseGoodsImageUrl(item);
return url || fallback || "";
}
/** /**
* 金钱单位置换 2999 --> 2,999.00 * 金钱单位置换 2999 --> 2,999.00
* @param val * @param val
@@ -426,7 +435,7 @@ export function tipsToLogin (type) {
/** /**
* 获取用户信息并重新添加到缓存里面 * 获取用户信息并重新添加到缓存里面
*/ */
export async function userInfo () { export async function refreshUserInfo () {
let res = await getUserInfo(); let res = await getUserInfo();
if (res.data.success) { if (res.data.success) {
storage.setUserInfo(res.data.result); storage.setUserInfo(res.data.result);

View File

@@ -218,6 +218,7 @@ function calcMD5(str) {
return binl2hex(coreMD5(str2binl(str))) return binl2hex(coreMD5(str2binl(str)))
} }
module.exports = { export const md5 = hexMD5
export default {
md5: hexMD5 md5: hexMD5
} }

View File

@@ -4,7 +4,7 @@
// MIT License - http://opensource.org/licenses/mit-license.php // MIT License - http://opensource.org/licenses/mit-license.php
/*global window, require, define */ /*global window, require, define */
(function(_window) { var uuid = (function(_window) {
'use strict'; 'use strict';
@@ -241,22 +241,7 @@
uuid._whatwgRNG = _whatwgRNG; uuid._whatwgRNG = _whatwgRNG;
if (('undefined' !== typeof module) && module.exports) {
// Publish as node.js module
module.exports = uuid;
} else if (typeof define === 'function' && define.amd) {
// Publish as AMD module
define(function() { return uuid; });
} else {
// Publish as global (in browsers)
_previousRoot = _window.uuid;
// **`noConflict()` - (browser only) to reset global 'uuid' var**
uuid.noConflict = function() {
_window.uuid = _previousRoot;
return uuid; return uuid;
}; })('undefined' !== typeof window ? window : (typeof globalThis !== 'undefined' ? globalThis : {}));
_window.uuid = uuid; export default uuid;
}
})('undefined' !== typeof window ? window : null);