refactor: 优化购物车与订单页面逻辑

- 更新购物车页面,增强商品展示与交互体验。
- 调整订单页面的状态反馈与用户操作逻辑,确保信息清晰。
- 改进组件样式与布局,提升整体用户体验。
- 修复多个页面中的样式与功能问题,确保一致性与流畅性。
This commit is contained in:
pikachu1995@126.com
2026-09-29 10:22:57 +08:00
parent 0bffe81c6b
commit a3193c3b68
19 changed files with 1631 additions and 1480 deletions

View File

@@ -17,7 +17,9 @@ import { handleAppLaunchScene } from '@/utils/distributionBind.js'
const store = useStore() const store = useStore()
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
wx.onAppRoute(() => {}) wx.onAppRoute((res) => {
applyTabBarStyle(store.state.theme && store.state.theme.mainColor, res && res.path)
})
// #endif // #endif
onLaunch((val) => { onLaunch((val) => {
@@ -39,6 +41,8 @@ onLaunch((val) => {
}) })
onShow(() => { onShow(() => {
applyTabBarStyle(store.state.theme && store.state.theme.mainColor)
// #ifndef H5 // #ifndef H5
if (config.enableGetClipboard) { if (config.enableGetClipboard) {
getClipboard() getClipboard()

View File

@@ -226,8 +226,10 @@ async function generatePosters() {
} }
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN
loadError.value = '请在微信小程序中生成海报' {
return loadError.value = '请在微信小程序中生成海报'
return
}
// #endif // #endif
loading.value = true loading.value = true

View File

@@ -7,6 +7,12 @@
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/> />
<title></title> <title></title>
<!-- H5 构建会把 process.env 替换成空对象,但运行时仍会读取 process,浏览器中不存在该变量 -->
<script>
if (typeof process === "undefined") {
window.process = { env: {} };
}
</script>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
</head> </head>

View File

@@ -18,7 +18,6 @@
v-model="bindForm.cardSecret" v-model="bindForm.cardSecret"
border="none" border="none"
maxlength="128" maxlength="128"
password
placeholder="请输入兑换码(卡密)" placeholder="请输入兑换码(卡密)"
clearable clearable
/> />

View File

@@ -20,6 +20,9 @@
padding: 2rpx 20rpx; padding: 2rpx 20rpx;
} }
.list { .list {
padding-bottom: calc(140rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
.item:hover { .item:hover {
background: #ededed; background: #ededed;
} }
@@ -115,21 +118,28 @@
} }
} }
.btn-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 99;
padding: 20rpx 30rpx calc(20rpx + constant(safe-area-inset-bottom));
padding: 20rpx 30rpx calc(20rpx + env(safe-area-inset-bottom));
background: $page-color-base;
box-sizing: border-box;
}
.btn { .btn {
background: $light-color; background: $light-color;
position: fixed; width: 100%;
width: 690rpx;
bottom: calc(60rpx + constant(safe-area-inset-bottom));
bottom: calc(60rpx + env(safe-area-inset-bottom));
height: 80rpx; height: 80rpx;
left: 30rpx;
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
border-radius: 40rpx; border-radius: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 99;
overflow: hidden; overflow: hidden;
.btn-text { .btn-text {

View File

@@ -27,8 +27,8 @@
<view class="relative"> <view class="relative">
<view class="alifont icon-bianji-copy"></view> <view class="alifont icon-bianji-copy"></view>
<text class="mr-40" @click="addAddress(item.id)">编辑</text> <text class="mr-40" @click="addAddress(item.id)">编辑</text>
<view class="alifont icon-lajitong"></view> <view class="alifont icon-lajitong" @click.stop="removeAddress(item.id)"></view>
<text @click="removeAddress(item.id)">删除</text> <text @click.stop="removeAddress(item.id)">删除</text>
</view> </view>
</view> </view>
</view> </view>
@@ -38,7 +38,6 @@
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon> <u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
<text class="btn-text">添加新收货人</text> <text class="btn-text">添加新收货人</text>
</view> </view>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view> </view>
</template> </template>
@@ -52,10 +51,6 @@ import * as API_Address from '@/api/address.js'
const store = useStore() const store = useStore()
const addressList = ref<any[]>([]) const addressList = ref<any[]>([])
const showAction = ref(false)
const removeList = [{ text: '确定' }]
const tips = { text: '确定要删除该收货人信息吗?' }
const removeId = ref('')
const routerVal = ref<Record<string, string>>({}) const routerVal = ref<Record<string, string>>({})
const params = { pageNumber: 1, pageSize: 1000 } const params = { pageNumber: 1, pageSize: 1000 }
@@ -94,18 +89,20 @@ function getAddressList() {
} }
function removeAddress(id: string) { function removeAddress(id: string) {
removeId.value = id uni.showModal({
showAction.value = true title: '提示',
} content: '确定要删除该收货人信息吗?',
success: (res) => {
function deleteAddressMessage() { if (!res.confirm) return
API_Address.deleteAddress(removeId.value).then((res) => { API_Address.deleteAddress(id).then((result) => {
if (res.statusCode == 200) { if (result.statusCode == 200) {
uni.showToast({ icon: 'none', title: '删除成功' }) uni.showToast({ icon: 'none', title: '删除成功' })
getAddressList() getAddressList()
} else { } else {
uni.showToast({ icon: 'none', title: res.data.message, duration: 2000 }) uni.showToast({ icon: 'none', title: result.data.message, duration: 2000 })
} }
})
},
}) })
} }

View File

@@ -26,20 +26,19 @@
<view class="relative"> <view class="relative">
<view class="alifont icon-bianji-copy"></view> <view class="alifont icon-bianji-copy"></view>
<text class="mr-40" @click="addAddress(item.id)">编辑</text> <text class="mr-40" @click="addAddress(item.id)">编辑</text>
<view class="alifont icon-lajitong"></view> <view class="alifont icon-lajitong" @click.stop="removeAddress(item.id)"></view>
<text @click="removeAddress(item.id)">删除</text> <text @click.stop="removeAddress(item.id)">删除</text>
</view> </view>
</view> </view>
</view> </view>
<view style="height: 100px"></view>
</view> </view>
<view class="btn" @click="addAddress('')"> <view class="btn-bar">
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon> <view class="btn" @click="addAddress('')">
<text class="btn-text">添加新收货人</text> <u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
<text class="btn-text">添加新收货人</text>
</view>
</view> </view>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view> </view>
</template> </template>
@@ -53,10 +52,6 @@ import * as API_Address from '@/api/address.js'
const store = useStore() const store = useStore()
const addressList = ref<any[]>([]) const addressList = ref<any[]>([])
const showAction = ref(false)
const removeList = [{ text: '确定' }]
const tips = { text: '确定要删除该收货人信息吗?' }
const removeId = ref('')
const routerVal = ref<Record<string, string>>({}) const routerVal = ref<Record<string, string>>({})
const params = { pageNumber: 1, pageSize: 1000 } const params = { pageNumber: 1, pageSize: 1000 }
@@ -96,18 +91,20 @@ function getAddressList() {
} }
function removeAddress(id: string) { function removeAddress(id: string) {
removeId.value = id uni.showModal({
showAction.value = true title: '提示',
} content: '确定要删除该收货人信息吗?',
success: (res) => {
function deleteAddressMessage() { if (!res.confirm) return
API_Address.deleteAddress(removeId.value).then((res) => { API_Address.deleteAddress(id).then((result) => {
if (res.statusCode == 200) { if (result.statusCode == 200) {
uni.showToast({ icon: 'none', title: '删除成功' }) uni.showToast({ icon: 'none', title: '删除成功' })
getAddressList() getAddressList()
} else { } else {
uni.showToast({ icon: 'none', title: res.data.message, duration: 2000 }) uni.showToast({ icon: 'none', title: result.data.message, duration: 2000 })
} }
})
},
}) })
} }

View File

@@ -16,7 +16,13 @@
</view> </view>
<view style="height: 100px"></view> <view style="height: 100px"></view>
</view> </view>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet> <u-action-sheet
:actions="removeList"
:description="tips.text"
cancel-text="取消"
v-model:show="showAction"
@select="deleteAddressMessage"
></u-action-sheet>
</view> </view>
</template> </template>
@@ -31,7 +37,7 @@ const store = useStore()
const storeAddressList = ref<any[]>([]) const storeAddressList = ref<any[]>([])
const showAction = ref(false) const showAction = ref(false)
const removeList = [{ text: '确定' }] const removeList = [{ name: '确定' }]
const tips = { text: '确定要删除该收货人信息吗?' } const tips = { text: '确定要删除该收货人信息吗?' }
const removeId = ref('') const removeId = ref('')
const routerVal = ref<Record<string, string>>({}) const routerVal = ref<Record<string, string>>({})

View File

@@ -10,55 +10,46 @@
<view class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</view> <view class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</view>
</template> </template>
</u-navbar> </u-navbar>
<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="isEmpty"></u-empty> <u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="isEmpty"></u-empty>
<view v-else class="tracks-list"> <view v-else class="tracks-list" :class="{ 'is-editing': isEdit }">
<block v-for="(item, index) in trackList" :key="index"> <u-swipe-action
<view v-for="(item, index) in trackList"
class="myTracks-title" :key="item.id || index"
v-if="getStoreName(item)" class="myTracks-swipe"
@click="navigateToStore(item)" >
>{{ getStoreName(item) }}</view> <u-swipe-action-item
<u-swipe-action class="myTracks-swipe"> :show="item.show"
<u-swipe-action-item :name="index"
:show="item.show" @click="deleteTracks"
:name="index" @open="openSwipe"
@click="deleteTracks" :options="swipeOptions"
@open="openSwipe" >
:options="swipeOptions" <view class="myTracks-item">
> <u-checkbox-group v-if="isEdit" class="store-line-check">
<view class="myTracks-item"> <u-checkbox
<u-checkbox-group v-if="isEdit" class="store-line-check"> usedAlone
<u-checkbox shape="circle"
usedAlone :active-color="lightColor"
shape="circle" v-model:checked="item.checked"
:active-color="lightColor" @change="onTrackCheckChange(item)"
v-model:checked="item.checked" ></u-checkbox>
@change="onTrackCheckChange(item)" </u-checkbox-group>
></u-checkbox> <view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
</u-checkbox-group> <image v-if="item.thumbnail" class="track-thumb-img" mode="aspectFill" :src="item.thumbnail"></image>
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
<image class="track-thumb" :src="item.thumbnail"></image>
</view>
<view class="myTracks-item-content" @click.stop="navigateToDetail(item)">
<view class="myTracks-item-title">
{{ item.goodsName }}
</view>
<view class="myTracks-item-price">
¥{{ unitPrice(item.price) }}
</view>
</view>
</view> </view>
</u-swipe-action-item> <view class="myTracks-item-content" @click.stop="navigateToDetail(item)">
</u-swipe-action> <view class="myTracks-item-title">{{ item.goodsName }}</view>
<view class="myTracks-divider"></view> <view
</block> v-if="getStoreName(item)"
<view v-if="isEdit" class="submit" @click="deleteSelectedTracks"> class="myTracks-item-store"
删除所选 @click.stop="navigateToStore(item)"
</view> >{{ getStoreName(item) }}</view>
<view class="myTracks-item-price">¥{{ unitPrice(item.price) }}</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
<view v-if="isEdit" class="submit" @click="deleteSelectedTracks">删除所选</view>
</view> </view>
</view> </view>
@@ -226,28 +217,30 @@ function deleteTracks(e: any, ids?: any) {
.myTracks { .myTracks {
width: 100%; width: 100%;
min-height: 100vh;
background: #f5f5f5;
padding-top: 2rpx; padding-top: 2rpx;
} box-sizing: border-box;
.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 { .tracks-list {
width: 100%; padding: 20rpx 24rpx 40rpx;
box-sizing: border-box;
&.is-editing {
padding-bottom: calc(140rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
}
}
.myTracks-swipe {
display: block;
margin-bottom: 20rpx;
border-radius: 16rpx;
overflow: hidden;
background: #fff;
} }
.myTracks-swipe,
:deep(.u-swipe-action), :deep(.u-swipe-action),
:deep(.u-swipe-action-item), :deep(.u-swipe-action-item),
:deep(.u-swipe-action-item__content) { :deep(.u-swipe-action-item__content) {
@@ -256,25 +249,12 @@ function deleteTracks(e: any, ids?: any) {
:deep(.u-swipe-action-item__content) { :deep(.u-swipe-action-item__content) {
overflow: hidden; overflow: hidden;
} background: #fff;
.myTracks-title {
width: 100%;
height: 110rpx;
padding: 0 20rpx;
font-size: 28rpx;
color: #666;
font-weight: bold;
background-color: #fff;
display: flex;
align-items: center;
box-sizing: border-box;
} }
.myTracks-item { .myTracks-item {
width: 100%; width: 100%;
min-height: 226rpx; padding: 24rpx;
padding: 30rpx 20rpx;
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
@@ -287,13 +267,17 @@ function deleteTracks(e: any, ids?: any) {
} }
.myTracks-item-img { .myTracks-item-img {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx; margin-right: 20rpx;
flex-shrink: 0; flex-shrink: 0;
border-radius: 12rpx;
background: #f3f4f6;
overflow: hidden;
.track-thumb { .track-thumb-img {
width: 130rpx; width: 100%;
height: 130rpx; height: 100%;
border-radius: 8rpx;
display: block; display: block;
} }
} }
@@ -301,27 +285,38 @@ function deleteTracks(e: any, ids?: any) {
.myTracks-item-content { .myTracks-item-content {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
min-height: 160rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: space-between;
} }
.myTracks-item-title { .myTracks-item-title {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
line-height: 1.4; line-height: 1.4;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.myTracks-item-store {
margin-top: 8rpx;
font-size: 24rpx;
color: #999;
line-height: 1.4;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.myTracks-item-price { .myTracks-item-price {
font-size: 28rpx; margin-top: 12rpx;
font-size: 32rpx;
font-weight: 600;
color: $light-color; color: $light-color;
padding-top: 10rpx; line-height: 1.2;
}
.myTracks-divider {
width: 100%;
height: 20rpx;
background: #f5f5f5;
} }
.edit { .edit {

View File

@@ -56,7 +56,6 @@
<view class="bottom"> <view class="bottom">
<view class="submit" @click="submit">保存</view> <view class="submit" @click="submit">保存</view>
<view class="submit light" @click="quiteLoginOut">退出登录</view>
</view> </view>
<u-datetime-picker <u-datetime-picker
@@ -84,7 +83,6 @@
import { ref, reactive, computed } from 'vue' import { ref, reactive, computed } from 'vue'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { useStore } from '@/store' import { useStore } from '@/store'
import { quiteLoginOut } from '@/utils/filters.js'
import { saveUserInfo } from '@/api/members.js' import { saveUserInfo } from '@/api/members.js'
import { upload } from '@/api/common.js' import { upload } from '@/api/common.js'
import storage from '@/utils/storage.js' import storage from '@/utils/storage.js'
@@ -211,31 +209,40 @@ onShow(() => {
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss">
page { page {
background: #fff; background: #f5f5f5;
} }
</style>
<style lang="scss" scoped>
.person-msg { .person-msg {
min-height: 100vh; min-height: 100vh;
background: #fff; background: #f5f5f5;
padding-bottom: 180rpx; padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
} }
.head { .head {
padding: 40rpx 0 20rpx; margin-bottom: 20rpx;
color: $font-color-light; padding: 48rpx 0 32rpx;
font-size: $font-sm; background: #fff;
color: #999;
font-size: 24rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
line-height: 2em;
image { image {
width: 144rpx; width: 144rpx;
height: 144rpx; height: 144rpx;
border-radius: 50%; border-radius: 50%;
background: #f3f4f6;
}
view {
margin-top: 16rpx;
line-height: 1.4;
} }
} }
@@ -244,13 +251,13 @@ page {
} }
:deep(.u-form-item) { :deep(.u-form-item) {
padding: 0 30rpx; padding: 0 32rpx;
min-height: 100rpx;
} }
:deep(.u-form-item__body) { :deep(.u-form-item__body) {
min-height: 100rpx; min-height: 108rpx;
align-items: center; align-items: center;
padding: 16rpx 0 !important;
} }
:deep(.u-form-item__body__left__content__label) { :deep(.u-form-item__body__left__content__label) {
@@ -258,8 +265,13 @@ page {
color: #333; color: #333;
} }
:deep(.u-form-item__body__right) {
min-width: 0;
}
:deep(.u-form-item__body__right__content__slot) { :deep(.u-form-item__body__right__content__slot) {
flex: 1; flex: 1;
min-width: 0;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
@@ -271,7 +283,8 @@ page {
:deep(.u-input__content__field-wrapper__field) { :deep(.u-input__content__field-wrapper__field) {
font-size: 28rpx !important; font-size: 28rpx !important;
color: #666 !important; color: #333 !important;
text-align: right;
} }
.sex-row { .sex-row {
@@ -288,16 +301,20 @@ page {
.form-value { .form-value {
width: 100%; width: 100%;
min-width: 0;
text-align: right; text-align: right;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.bind-mobile { .bind-mobile {
width: 100%; width: 100%;
text-align: right; text-align: right;
font-size: 28rpx; font-size: 28rpx;
color: $main-color; color: $light-color;
} }
.bottom { .bottom {
@@ -307,10 +324,10 @@ page {
bottom: 0; bottom: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; padding: 16rpx 32rpx calc(16rpx + env(safe-area-inset-bottom));
padding: 24rpx 30rpx calc(24rpx + env(safe-area-inset-bottom));
background: #fff; background: #fff;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
} }
.submit { .submit {
@@ -318,18 +335,9 @@ page {
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
border-radius: 100px; border-radius: 40rpx;
font-size: 30rpx; font-size: 30rpx;
background: $light-color; background: $light-color;
color: #fff; color: #fff;
} }
.submit + .submit {
margin-left: 24rpx;
}
.light {
background: rgba($color: $light-color, $alpha: 0.2) !important;
color: $light-color !important;
}
</style> </style>

View File

@@ -159,7 +159,7 @@
title="申请原因" title="申请原因"
@confirm="reasonSelectConfirm" @confirm="reasonSelectConfirm"
></u-picker> ></u-picker>
<u-toast ref="uToast" /> <u-toast ref="toastRef" />
</view> </view>
</template> </template>
@@ -186,7 +186,7 @@ const sku = ref<any>({})
const reasonSelectShow = ref(false) const reasonSelectShow = ref(false)
const reasonList = ref<any[]>([]) const reasonList = ref<any[]>([])
const applyInfo = ref<any>({}) const applyInfo = ref<any>({})
const uToast = ref<any>(null) const toastRef = ref<any>(null)
const isAppointmentAfterSale = ref(false) const isAppointmentAfterSale = ref(false)
const form = reactive({ const form = reactive({
@@ -335,8 +335,8 @@ function onUploadAfterRead(event: any) {
function showToast(message: string, type = 'error') { function showToast(message: string, type = 'error') {
const text = message || (type === 'success' ? '操作成功' : '操作失败') const text = message || (type === 'success' ? '操作成功' : '操作失败')
if (uToast.value) { if (toastRef.value) {
uToast.value.show({ message: text, type }) toastRef.value.show({ message: text, type })
return return
} }
uni.showToast({ uni.showToast({

View File

@@ -69,7 +69,7 @@
@confirm="onTimeConfirm" @confirm="onTimeConfirm"
@close="timeshow = false" @close="timeshow = false"
/> />
<u-toast ref="uToast"/> <u-toast ref="toastRef"/>
</view> </view>
</template> </template>
@@ -96,7 +96,7 @@ const form = reactive({
}) })
const serviceDetail = reactive<{ sn: string }>({ sn: '' }) const serviceDetail = reactive<{ sn: string }>({ sn: '' })
const sku = ref<any>({}) const sku = ref<any>({})
const uToast = ref<any>(null) const toastRef = ref<any>(null)
onLoad((options) => { onLoad((options) => {
sku.value = storage.getAfterSaleData() sku.value = storage.getAfterSaleData()
@@ -136,15 +136,15 @@ function onSubmit() {
delete submitForm.courierCompany delete submitForm.courierCompany
if (form.logisticsId == '') { if (form.logisticsId == '') {
uToast.value?.show({ title: '请选择快递公司', type: 'error' }) toastRef.value?.show({ title: '请选择快递公司', type: 'error' })
return return
} }
if (form.logisticsNo == '') { if (form.logisticsNo == '') {
uToast.value?.show({ title: '请填写快递单号', type: 'error' }) toastRef.value?.show({ title: '请填写快递单号', type: 'error' })
return return
} }
if (form.mDeliverTime == '') { if (form.mDeliverTime == '') {
uToast.value?.show({ title: '请选择发货时间', type: 'error' }) toastRef.value?.show({ title: '请选择发货时间', type: 'error' })
return return
} }
@@ -152,7 +152,7 @@ function onSubmit() {
fillShipInfo(serviceDetail.sn, submitForm).then((res) => { fillShipInfo(serviceDetail.sn, submitForm).then((res) => {
hideLoadingIfNeeded() hideLoadingIfNeeded()
if (res.statusCode === 200) { if (res.statusCode === 200) {
uToast.value?.show({ toastRef.value?.show({
title: '提交成功', title: '提交成功',
type: 'success', type: 'success',
back: true, back: true,

View File

@@ -417,7 +417,11 @@ function openOrder(order: any) {
} }
function changeTab(e: any) { function changeTab(e: any) {
tabCurrentIndex.value = e.target.current // H5 的 swiper change 把下标放在 detail.current。
// 读 target.current 会得到 undefined,选中态被清掉,列表就停在「全部」。
const current = Number(e?.detail?.current ?? e?.target?.current)
if (!Number.isInteger(current) || current < 0 || current >= navList.length) return
tabCurrentIndex.value = current
} }
function tabClick(index: number) { function tabClick(index: number) {

View File

@@ -34,7 +34,7 @@
<verification-codes :items="verificationCodeItems" /> <verification-codes :items="verificationCodeItems" />
</view> </view>
<view v-else-if="isECouponOrder" class="card-key-entry"> <view v-else-if="isECouponOrder" class="card-key-entry">
<view v-if="ecouponCardKeyDelivered" class="card-key-entry__btn" @click="goCardKeyDetail"> <view v-if="ecouponCardKeyDelivered" class="btn" @click="goCardKeyDetail">
查看卡密 查看卡密
</view> </view>
<view v-else-if="order.orderStatus === 'CANCELLED'" class="card-key-entry__tip"> <view v-else-if="order.orderStatus === 'CANCELLED'" class="card-key-entry__tip">
@@ -1055,17 +1055,14 @@ page,
.card-key-entry { .card-key-entry {
width: 100%; width: 100%;
text-align: center;
}
.card-key-entry__btn { .btn {
display: inline-block; width: 100%;
padding: 20rpx 80rpx; height: 80rpx;
border: 2rpx solid $main-color; line-height: 80rpx;
border-radius: 12rpx; border-radius: 40rpx;
color: $main-color; font-size: 30rpx;
font-size: 28rpx; }
font-weight: 600;
} }
.card-key-entry__tip { .card-key-entry__tip {

View File

@@ -11,15 +11,21 @@
<div class="step-list"> <div class="step-list">
<div <div
class="step-item" class="step-item"
:class="{ active: current == index }" :class="{ active: current == index, done: current > index }"
v-for="(item, index) in entrySteps" v-for="(item, index) in flowSteps"
:key="index" :key="item.value"
> >
{{ item.title }} <div class="step-mark">{{ index + 1 }}</div>
<div class="step-title">{{ item.title }}</div>
</div> </div>
</div> </div>
<div class="submit" @click="keepOn()">开始填写</div> <div v-if="statusTip" class="status-tip" :class="statusTip.value">
<div class="notice" @click="getEntryNotice">查看店铺入驻协议</div> {{ statusTip.title }}
</div>
<div class="actions">
<div v-if="showFillButton" class="submit" @click="keepOn()">开始填写</div>
<div class="notice" @click="getEntryNotice">查看店铺入驻协议</div>
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -36,8 +42,15 @@ const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme)) const themeStyle = computed(() => getThemeStyle(store.state.theme))
const current = ref(999) const current = ref(-1)
const companyData = ref<any>('') const companyData = ref<any>('')
const showFillButton = computed(() => companyData.value?.storeDisable !== 'OPEN')
const flowSteps = computed(() =>
entrySteps.value.filter((item) => item.value === 'APPLY' || item.value === 'APPLYING')
)
const statusTip = computed(() =>
entrySteps.value.find((item) => item.value !== 'APPLY' && item.value !== 'APPLYING')
)
const entrySteps = ref([ const entrySteps = ref([
{ {
@@ -137,54 +150,103 @@ page {
} }
.entry-content { .entry-content {
padding: 32rpx 80rpx calc(40rpx + env(safe-area-inset-bottom)); padding: 48rpx 48rpx calc(40rpx + env(safe-area-inset-bottom));
box-sizing: border-box; box-sizing: border-box;
} }
.title { .title {
line-height: 1.2; line-height: 1.2;
font-weight: 500; font-weight: 600;
font-size: 56rpx; font-size: 48rpx;
color: #333; color: #222;
} }
.step-list { .step-list {
margin: 80rpx 0; margin-top: 64rpx;
} }
.step-item { .step-item {
padding: 30rpx 20rpx; display: flex;
font-size: 40rpx; align-items: center;
font-weight: bold; padding: 18rpx 0;
color: #666; color: #999;
} }
.step-item.active { .step-mark {
width: 48rpx;
height: 48rpx;
margin-right: 20rpx;
border-radius: 50%;
background: #f2f2f2;
color: #999;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.step-title {
font-size: 32rpx;
font-weight: 500;
line-height: 1.4;
}
.step-item.done .step-mark,
.step-item.active .step-mark {
background: var(--theme-light, #ff6b35);
color: #fff;
}
.step-item.done .step-title {
color: #333;
}
.step-item.active .step-title {
color: var(--theme-light, #ff6b35);
}
.status-tip {
margin-top: 24rpx;
padding: 24rpx 28rpx;
border-radius: 16rpx;
font-size: 28rpx;
line-height: 1.5;
color: var(--theme-light, #ff6b35); color: var(--theme-light, #ff6b35);
background: var(--theme-light-10, rgba(255, 107, 53, 0.1)); background: var(--theme-light-10, rgba(255, 107, 53, 0.1));
border-radius: 20rpx; }
.status-tip.REFUSED {
color: var(--theme-primary, #ff3c2a);
background: #fff1f0;
}
.status-tip.CLOSED {
color: #666;
background: #f5f5f5;
}
.actions {
margin-top: 72rpx;
} }
.submit, .submit,
.notice { .notice {
font-weight: bold; height: 88rpx;
font-size: 28rpx; line-height: 88rpx;
height: 92rpx;
text-align: center; text-align: center;
letter-spacing: 4rpx; font-size: 30rpx;
line-height: 92rpx; border-radius: 44rpx;
border-radius: 20rpx;
} }
.submit { .submit {
color: #fff; color: #fff;
margin-top: 120rpx;
background: var(--theme-light, #ff6b35); background: var(--theme-light, #ff6b35);
margin-bottom: 24rpx;
} }
.notice { .notice {
margin-top: 40rpx;
color: #333; color: #333;
background: $bg-color; background: #f5f5f5;
} }
</style> </style>

View File

@@ -1,25 +1,22 @@
<template> <template>
<view class="box"> <view class="box">
<view v-if="bargainLog.length != 0"> <view v-if="bargainLog.length != 0" class="list">
<view v-for="(item,index) in bargainLog" class="flex" :key="index"> <view v-for="(item,index) in bargainLog" class="card" :key="index">
<view class="goods-img"> <view class="goods-img">
<u-image radius="20rpx" width="230rpx" height="230rpx" :src="item.thumbnail"></u-image> <u-image radius="12rpx" width="160rpx" height="160rpx" :src="item.thumbnail"></u-image>
</view> </view>
<view class="goods"> <view class="goods">
<view class="wes-2"> <view class="head">
{{item.goodsName}} <view class="goods-name wes-2">{{ item.goodsName }}</view>
<text class="tips" :class="item.status">{{ statusWay[item.status] }}</text>
</view> </view>
<view class="surplus"> <view class="foot">
还剩<text class="surplusPrice">{{unitPrice(item.surplusPrice)}}元</text> <view class="surplus">
</view> 还剩<text class="surplusPrice">{{ unitPrice(item.surplusPrice) }}</text>元
</view>
<view @click="navigateToBargainDetail(item)" v-if="item.status == 'START'" class="buy"> <view v-if="item.status == 'START'" class="buy" @click="navigateToBargainDetail(item)">
继续免费领 继续免费领
</view> </view>
</view>
<view class="tips-box">
<view class="tips" :class="[item.status]">
{{statusWay[item.status]}}
</view> </view>
</view> </view>
</view> </view>
@@ -76,67 +73,90 @@ function navigateToBargainDetail(val: any) {
</script> </script>
<style> <style>
page { page {
background: #fff; background: #f5f5f5;
} }
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">
.box { .box {
padding: 0 32rpx; min-height: 100vh;
padding: 20rpx 24rpx 40rpx;
background: #f5f5f5;
box-sizing: border-box;
}
.card {
display: flex;
align-items: center;
margin-bottom: 20rpx;
padding: 24rpx;
background: #fff; background: #fff;
border-radius: 16rpx;
} }
.goods-img { .goods-img {
width: 230rpx; width: 160rpx;
height: 230rpx; height: 160rpx;
flex: 0 0 230rpx; flex: 0 0 160rpx;
} border-radius: 12rpx;
.buy { overflow: hidden;
background: $light-color; background: #f5f5f5;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
padding: 10rpx 0;
border-radius: 100rpx;
width: 200rpx;
font-size: 24rpx;
margin-top: 20rpx;
}
.tips-box {
flex: 1;
justify-content: center;
display: flex;
align-items: center;
}
.tips {
color: #999;
margin-top: 20rpx;
}
.surplusPrice {
font-size: 40rpx;
margin-left: 10rpx;
font-weight: bold;
color: $light-color;
}
.surplus {
color: #333;
font-size: 26rpx;
margin-top: 12rpx;
} }
.goods { .goods {
margin: 0 20rpx; flex: 1;
min-width: 0;
margin-left: 20rpx;
display: flex; display: flex;
flex: 2;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: space-between;
min-height: 160rpx;
} }
.flex { .head {
border-bottom: 1rpx solid #f7f7f7; display: flex;
align-items: flex-start;
}
.goods-name {
flex: 1;
min-width: 0;
font-size: 28rpx;
color: #333;
line-height: 1.4;
}
.tips {
flex-shrink: 0;
margin-left: 16rpx;
font-size: 24rpx;
line-height: 1.4;
color: #999;
}
.foot {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 20rpx 0; justify-content: space-between;
margin: 10rpx 0; margin-top: 16rpx;
}
.surplus {
flex: 1;
min-width: 0;
color: #666;
font-size: 24rpx;
white-space: nowrap;
}
.surplusPrice {
margin: 0 6rpx;
font-size: 36rpx;
font-weight: 600;
color: $light-color;
}
.buy {
flex-shrink: 0;
margin-left: 16rpx;
height: 56rpx;
padding: 0 28rpx;
border-radius: 100rpx;
background: $light-color;
color: #fff;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
} }
.SUCCESS { .SUCCESS {
color: $light-color; color: $light-color;

View File

@@ -98,7 +98,7 @@
</u-swipe-action> </u-swipe-action>
</div> </div>
</div> </div>
<u-modal v-model:show="deleteShow" :confirm-style="{'color':lightColor}" @confirm="deleteConfirm" show-cancel-button <u-modal v-if="deleteShow" v-model:show="deleteShow" :confirm-style="modalConfirmStyle" @confirm="deleteConfirm" show-cancel-button
:content="deleteContent" :async-close="true"></u-modal> :content="deleteContent" :async-close="true"></u-modal>
<!-- 结账 --> <!-- 结账 -->
<div class="box box6"> <div class="box box6">
@@ -155,7 +155,7 @@
<div class="settlement">去结算</div> <div class="settlement">去结算</div>
</view> </view>
</div> </div>
<u-toast ref="uToast" /> <u-toast />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -169,7 +169,6 @@ import { useStore } from '@/store'
import { unitPrice, goodsFormatPrice, isLogin, forceLogin } from '@/utils/filters.js' import { unitPrice, goodsFormatPrice, isLogin, forceLogin } from '@/utils/filters.js'
const store = useStore() const store = useStore()
const uToast = ref()
const swiperAction = ref() const swiperAction = ref()
const lightColor = computed(() => store.getters.lightColor) const lightColor = computed(() => store.getters.lightColor)
@@ -211,6 +210,10 @@ const cartNavbarStyle = computed(() => {
} }
}) })
const modalConfirmStyle = computed(() => ({
color: lightColor.value,
}))
onMounted(() => { onMounted(() => {
setCapsuleInset() setCapsuleInset()
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN

View File

@@ -1,5 +1,5 @@
diff --git a/node_modules/uview-plus/components/u-image/u-image.vue b/node_modules/uview-plus/components/u-image/u-image.vue 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..b59b657 100644 index 24e3b10..1360704 100644
--- a/node_modules/uview-plus/components/u-image/u-image.vue --- a/node_modules/uview-plus/components/u-image/u-image.vue
+++ b/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 @@ @@ -26,7 +26,7 @@
@@ -20,20 +20,7 @@ index 24e3b10..b59b657 100644
class="u-image__error" class="u-image__error"
:style="{ :style="{
borderRadius: shape == 'circle' ? '50%' : addUnit(radius), borderRadius: shape == 'circle' ? '50%' : addUnit(radius),
@@ -108,7 +108,12 @@ @@ -126,6 +126,12 @@
// 图片加载完成时,去掉背景颜色,因为如果是png图片,就会显示灰色的背景
backgroundStyle: {},
// 用于fade模式的控制组件显示与否
+ // #ifdef MP-WEIXIN
+ show: true
+ // #endif
+ // #ifndef MP-WEIXIN
show: false
+ // #endif
};
},
watch: {
@@ -126,6 +131,12 @@
} }
}, },
computed: { computed: {
@@ -46,6 +33,39 @@ index 24e3b10..b59b657 100644
transStyle() { transStyle() {
let style = {}; let style = {};
// 通过调用addUnit()方法,如果有单位,如百分比,px单位等,直接返回,如果是纯粹的数值,则加上rpx单位 // 通过调用addUnit()方法,如果有单位,如百分比,px单位等,直接返回,如果是纯粹的数值,则加上rpx单位
diff --git a/node_modules/uview-plus/components/u-modal/props.js b/node_modules/uview-plus/components/u-modal/props.js
index 0f0177b..1aacecf 100644
--- a/node_modules/uview-plus/components/u-modal/props.js
+++ b/node_modules/uview-plus/components/u-modal/props.js
@@ -105,7 +105,7 @@ export const props = defineMixin({
// 内容样式
contentStyle: {
type: Object,
- default: () => defProps.modal.contentStyle
+ default: () => ({ ...(defProps.modal.contentStyle || {}) })
}
}
})
diff --git a/node_modules/uview-plus/components/u-modal/u-modal.vue b/node_modules/uview-plus/components/u-modal/u-modal.vue
index eab8f72..bfd3da0 100644
--- a/node_modules/uview-plus/components/u-modal/u-modal.vue
+++ b/node_modules/uview-plus/components/u-modal/u-modal.vue
@@ -142,9 +142,12 @@
emits: ["confirm", "cancel", "close", "update:show", 'cancelOnAsync'],
computed: {
contentStyleCpu() {
- let style = this.contentStyle;
- style.paddingTop = `${this.title ? 12 : 25}px`
- return style;
+ // 不要改 props 上的 contentStyle。那个对象是默认配置里的共享引用,
+ // 渲染时写入会反向触发父组件更新,购物车页会因此无限循环。
+ return {
+ ...(this.contentStyle || {}),
+ paddingTop: `${this.title ? 12 : 25}px`
+ }
}
},
methods: {
diff --git a/node_modules/uview-plus/components/u-navbar/theme-vars.scss b/node_modules/uview-plus/components/u-navbar/theme-vars.scss 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 index d057ee6..791a092 100644
--- a/node_modules/uview-plus/components/u-navbar/theme-vars.scss --- a/node_modules/uview-plus/components/u-navbar/theme-vars.scss

View File

@@ -35,14 +35,35 @@ export function loadCachedTheme() {
} }
} }
export function applyTabBarStyle(mainColor) { const TAB_BAR_ROUTES = [
if (!mainColor) return; "pages/tabbar/home/index",
try { "pages/tabbar/category/category",
uni.setTabBarStyle({ "pages/tabbar/cart/cartList",
selectedColor: mainColor, "pages/tabbar/user/my",
}); ];
} catch (e) {
// 非 tabBar 页面可能报错,忽略 function normalizeRoute(route = "") {
return String(route).replace(/^\//, "").split("?")[0];
}
function currentRoute() {
const pages = typeof getCurrentPages === "function" ? getCurrentPages() : [];
const page = pages[pages.length - 1];
return (page && page.route) || "";
}
export function isTabBarRoute(route) {
return TAB_BAR_ROUTES.includes(normalizeRoute(route || currentRoute()));
}
export function applyTabBarStyle(mainColor, route) {
if (!mainColor || !isTabBarRoute(route)) return;
const task = uni.setTabBarStyle({
selectedColor: mainColor,
fail() {},
});
if (task && typeof task.catch === "function") {
task.catch(() => {});
} }
} }