feat: 选品广场购买结算返回原位
This commit is contained in:
+29
-9
@@ -6,6 +6,7 @@
|
||||
:showLeftButton="false"
|
||||
>
|
||||
<view class="ai-store-page h100 flex-column">
|
||||
<view v-if="index === 0" class="page-bg page-bg--ai"></view>
|
||||
<view class="top-area" :class="{'top-area1': index === 1}">
|
||||
<view class="tab-header">
|
||||
<view
|
||||
@@ -40,7 +41,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<aistore_earnings_carousel v-if="index === 0" :pageSize="30" />
|
||||
<!-- <view class="m-t-16 m-b-8" v-if="timeRound.length && index === 0">
|
||||
<view class="m-t-16 m-b-8" v-if="timeRound.length && index === 0">
|
||||
<scroll-view scroll-x class="time-scroll">
|
||||
<view class="flex">
|
||||
<view
|
||||
@@ -54,7 +55,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view style="padding: 80rpx 0 120rpx" v-if="index === 1">
|
||||
<view style="position: relative">
|
||||
<view class="shop-summary-card">
|
||||
@@ -353,11 +354,12 @@
|
||||
status: mescroll?.params?.status,
|
||||
});
|
||||
} else {
|
||||
const id = selectedTimeId.value;
|
||||
res = await api.getSpuPage({
|
||||
pageNo: mescroll?.num || 1,
|
||||
pageSize: mescroll?.size || 10,
|
||||
keyWord: searchText.value,
|
||||
// timeId: selectedTimeId.value,
|
||||
...(id !== null && id !== undefined && id !== '' ? { timeId: id } : {}),
|
||||
...mescroll.params,
|
||||
});
|
||||
}
|
||||
@@ -472,16 +474,32 @@
|
||||
|
||||
.ai-store-page {
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.page-bg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.page-bg--ai {
|
||||
background: url('/static/ai_bg.png') no-repeat center top;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
|
||||
.top-area {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 0 24rpx 24rpx;
|
||||
background: url('/static/ai_bg.png') no-repeat center top;
|
||||
background-size: cover;
|
||||
// border-radius: 0 0 30rpx 30rpx;
|
||||
}
|
||||
.top-area1{
|
||||
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: #2556ec;
|
||||
}
|
||||
|
||||
@@ -560,8 +578,10 @@
|
||||
padding: 0 22rpx;
|
||||
border-radius: 28rpx;
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
// color: rgba(255, 255, 255, 0.85);
|
||||
color: #2556ec;
|
||||
background: rgba(255, 255, 255, 0.55);
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.01);
|
||||
}
|
||||
|
||||
.activeTime {
|
||||
|
||||
@@ -1,48 +1,53 @@
|
||||
<template>
|
||||
<view class="earnings-carousel">
|
||||
<view class="earnings-header">
|
||||
<view class="earnings-header" @click="toggleCollapsed">
|
||||
<view class="earnings-title">
|
||||
<view class="earnings-title__icon">
|
||||
<image class="earnings-title__icon-img" src="/static/icon/medal.png" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="earnings-title__text">销量风云榜</view>
|
||||
</view>
|
||||
<view class="earnings-collapse-icon" :class="{ collapsed: isCollapsed }">
|
||||
<text class="earnings-collapse-arrow">▾</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<swiper
|
||||
class="earnings-swiper"
|
||||
:current="currentPageIndex"
|
||||
:autoplay="autoplay"
|
||||
:interval="interval"
|
||||
:duration="duration"
|
||||
:circular="swiperPages.length > 1"
|
||||
:disable-touch="true"
|
||||
:indicator-dots="false"
|
||||
@change="onSwiperChange"
|
||||
>
|
||||
<swiper-item v-for="(page, pageIndex) in swiperPages" :key="pageIndex">
|
||||
<view class="earnings-page">
|
||||
<view class="earnings-row">
|
||||
<view class="rank-card" v-for="(item, i) in page" :key="item.orderItemId || i">
|
||||
<view class="rank-top">
|
||||
<image class="rank-avatar" :src="getAvatar(item)" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="rank-name lineOne">{{ item.nickname || maskMobile(item.mobile) || '-' }}</view>
|
||||
<view class="rank-goods">
|
||||
<image class="rank-goods__img" :src="getGoodsPic(item)" mode="aspectFill" />
|
||||
<view class="rank-goods__mask">
|
||||
<view class="rank-rate">{{ formatPercent(item.progress) }}</view>
|
||||
<view class="rank-progress">
|
||||
<view class="rank-progress__bar" :style="{ width: `${clampProgress(item.progress)}%` }" />
|
||||
<view v-show="!isCollapsed" class="earnings-content">
|
||||
<swiper
|
||||
class="earnings-swiper"
|
||||
:current="currentPageIndex"
|
||||
:autoplay="autoplay && !isCollapsed"
|
||||
:interval="interval"
|
||||
:duration="duration"
|
||||
:circular="swiperPages.length > 1"
|
||||
:disable-touch="true"
|
||||
:indicator-dots="false"
|
||||
@change="onSwiperChange"
|
||||
>
|
||||
<swiper-item v-for="(page, pageIndex) in swiperPages" :key="pageIndex">
|
||||
<view class="earnings-page">
|
||||
<view class="earnings-row">
|
||||
<view class="rank-card" v-for="(item, i) in page" :key="item.orderItemId || i">
|
||||
<view class="rank-top">
|
||||
<image class="rank-avatar" :src="getAvatar(item)" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="rank-name lineOne">{{ item.nickname || maskMobile(item.mobile) || '-' }}</view>
|
||||
<view class="rank-goods">
|
||||
<image class="rank-goods__img" :src="getGoodsPic(item)" mode="aspectFill" />
|
||||
<view class="rank-goods__mask">
|
||||
<view class="rank-rate">{{ formatPercent(item.progress) }}</view>
|
||||
<view class="rank-progress">
|
||||
<view class="rank-progress__bar" :style="{ width: `${clampProgress(item.progress)}%` }" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rank-goods__name lineOne">{{ item.spuName || '-' }}</view>
|
||||
</view>
|
||||
<view class="rank-goods__name lineOne">{{ item.spuName || '-' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -72,11 +77,25 @@
|
||||
type: Number,
|
||||
default: 450,
|
||||
},
|
||||
defaultCollapsed: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const MAX_PAGES = 30;
|
||||
const DISPLAY_SIZE = 5;
|
||||
|
||||
const isCollapsed = ref(Boolean(props.defaultCollapsed));
|
||||
const toggleCollapsed = () => {
|
||||
isCollapsed.value = !isCollapsed.value;
|
||||
if (!isCollapsed.value) {
|
||||
schedulePrefetchNext(true);
|
||||
} else {
|
||||
clearPrefetch();
|
||||
}
|
||||
};
|
||||
|
||||
const currentPageIndex = ref(0);
|
||||
const total = ref(0);
|
||||
const pagesMap = ref({});
|
||||
@@ -263,7 +282,8 @@
|
||||
.earnings-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 6rpx 0;
|
||||
justify-content: space-between;
|
||||
padding: 0 6rpx 12rpx;
|
||||
}
|
||||
|
||||
.earnings-title {
|
||||
@@ -294,6 +314,28 @@
|
||||
color: #1d4ed8;
|
||||
}
|
||||
|
||||
.earnings-collapse-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: transform 0.25s ease;
|
||||
&.collapsed {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
.earnings-collapse-arrow {
|
||||
font-size: 36rpx;
|
||||
color: #1d4ed8;
|
||||
line-height: 1;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.earnings-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.earnings-swiper {
|
||||
height: 280rpx;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
>{{ state.pickUpInfo.name }}
|
||||
<text class="phone">{{ state.pickUpInfo.phone }}</text>
|
||||
</view>
|
||||
<view class="line1">
|
||||
{{ state.pickUpInfo.district }}{{ ', ' + state.pickUpInfo.description }}
|
||||
<view class="line1 line2">
|
||||
{{ formatPickUpAddress(state.pickUpInfo) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="addressCon" v-else>
|
||||
@@ -145,6 +145,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 格式化自提门店地址,优先使用 address 字段
|
||||
function formatPickUpAddress(info = {}) {
|
||||
const address = info?.address || '';
|
||||
if (address) return address;
|
||||
const district = info?.district || '';
|
||||
const description = info?.description || '';
|
||||
return `${district}${description ? `, ${description}` : ''}`.trim();
|
||||
}
|
||||
|
||||
// 收货方式切换
|
||||
const switchDeliveryType = (type) => {
|
||||
state.value.deliveryType = type;
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
});
|
||||
|
||||
const goAiStoreMyShopTab = () => {
|
||||
const url = '/pages/index/aiStore?tab=1';
|
||||
const url = '/pages/index/aiStore?tab=0';
|
||||
uni.redirectTo({
|
||||
url,
|
||||
fail: () => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user