feat:完善首页会员优选、我的社员ui重构
This commit is contained in:
@@ -26,7 +26,7 @@ SHOPRO_VERSION=v2.4.1
|
|||||||
SHOPRO_DEV_BASE_URL=https://yougoutest.api.riananyoumu.com
|
SHOPRO_DEV_BASE_URL=https://yougoutest.api.riananyoumu.com
|
||||||
|
|
||||||
# 本地
|
# 本地
|
||||||
#SHOPRO_DEV_BASE_URL=http://8.136.55.200:48090
|
# SHOPRO_DEV_BASE_URL=http://8.136.55.200:48090
|
||||||
|
|
||||||
### SHOPRO_DEV_BASE_URL=http://10.171.1.188:48090
|
### SHOPRO_DEV_BASE_URL=http://10.171.1.188:48090
|
||||||
### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
|
### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
|
||||||
|
|||||||
+3
-3
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
所有版本改动记录在此文件中。
|
所有版本改动记录在此文件中。
|
||||||
|
|
||||||
## [Unreleased]
|
|
||||||
-
|
|
||||||
|
|
||||||
## [1.3.9] - 2026-06-05
|
## [1.3.9] - 2026-06-05
|
||||||
|
### 新增
|
||||||
- 添加“会员优选”标签下列表api
|
- 添加“会员优选”标签下列表api
|
||||||
- 我的订单添加`店铺订单`列
|
- 我的订单添加`店铺订单`列
|
||||||
- 添加商城订单列type为5(开通ai店铺订单)详情接口api
|
- 添加商城订单列type为5(开通ai店铺订单)详情接口api
|
||||||
- 首页`会员优选`分类兜底(已开通ai店铺不展示)
|
- 首页`会员优选`分类兜底(已开通ai店铺不展示)
|
||||||
|
- 首页`会员优选`分类点击购买直接跳转到购买页、支付完成返回首页
|
||||||
|
- 我的社员ui重构
|
||||||
|
|||||||
@@ -61,6 +61,12 @@
|
|||||||
if (mescrollItems.length > n) mescrollItems.splice(n);
|
if (mescrollItems.length > n) mescrollItems.splice(n);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const { tabIndex } = useMescrollMore(
|
||||||
|
mescrollItems,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom,
|
||||||
|
);
|
||||||
|
|
||||||
const refreshDisplay = () => {
|
const refreshDisplay = () => {
|
||||||
const next = computeDisplayList();
|
const next = computeDisplayList();
|
||||||
displayList.value = next;
|
displayList.value = next;
|
||||||
@@ -90,12 +96,6 @@
|
|||||||
},
|
},
|
||||||
{ immediate: true, deep: true },
|
{ immediate: true, deep: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const { tabIndex } = useMescrollMore(
|
|
||||||
mescrollItems,
|
|
||||||
onPageScroll,
|
|
||||||
onReachBottom,
|
|
||||||
);
|
|
||||||
// let tabIndex = ref(0);
|
// let tabIndex = ref(0);
|
||||||
const navChange = (i) => {
|
const navChange = (i) => {
|
||||||
// scrollToLastY()
|
// scrollToLastY()
|
||||||
|
|||||||
@@ -67,11 +67,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<uni-badge :text="props.data.cartCount" v-if="props.type == 2 && props.data.cartCount" absolute="rightTop" :customStyle="{background: '#FF0000'}">
|
<uni-badge :text="props.data.cartCount" v-if="props.type == 2 && props.data.cartCount" absolute="rightTop" :customStyle="{background: '#FF0000'}">
|
||||||
<view class="shopIcon" :class="{ 'shopIcon1': props.type == 2 }" @click.stop="changeSelectSku">
|
<view class="shopIcon" :class="{ 'shopIcon1': props.type == 2 }" @click.stop="onShopIconClick">
|
||||||
<image src="/static/index/shop.png" mode="scaleToFill" />
|
<image src="/static/index/shop.png" mode="scaleToFill" />
|
||||||
</view>
|
</view>
|
||||||
</uni-badge>
|
</uni-badge>
|
||||||
<view class="shopIcon" :class="{ 'shopIcon1': props.type == 2 }" @click.stop="changeSelectSku" v-else>
|
<view class="shopIcon" :class="{ 'shopIcon1': props.type == 2 }" @click.stop="onShopIconClick" v-else>
|
||||||
<image src="/static/index/shop.png" mode="scaleToFill" />
|
<image src="/static/index/shop.png" mode="scaleToFill" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -101,6 +101,10 @@
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
memberPreferred: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
type: {
|
type: {
|
||||||
//1:首页 2:分类 3:搜索
|
//1:首页 2:分类 3:搜索
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -120,6 +124,18 @@
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
let showSelectSku = ref(false);
|
let showSelectSku = ref(false);
|
||||||
|
const buyMemberGoods = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/AI/giftOrder?id=${props.data.id}`,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onShopIconClick = () => {
|
||||||
|
if (props.memberPreferred) {
|
||||||
|
buyMemberGoods();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
changeSelectSku();
|
||||||
|
};
|
||||||
const changeSelectSku = async () => {
|
const changeSelectSku = async () => {
|
||||||
let res = await getData();
|
let res = await getData();
|
||||||
showSelectSku.value = true;
|
showSelectSku.value = true;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
>
|
>
|
||||||
<view class="flex-row wrap w100">
|
<view class="flex-row wrap w100">
|
||||||
<view class="cardItem" v-for="(v, i) in goods" :key="i">
|
<view class="cardItem" v-for="(v, i) in goods" :key="i">
|
||||||
<card_goods :data="v"></card_goods>
|
<card_goods :data="v" :memberPreferred="isMemberPreferred"></card_goods>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</mescroll-body>
|
</mescroll-body>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch, computed } from 'vue';
|
||||||
import useMescroll from '@/uni_modules/mescroll-uni/hooks/useMescroll.js';
|
import useMescroll from '@/uni_modules/mescroll-uni/hooks/useMescroll.js';
|
||||||
import SpuApi from '@/sheep/api/product/spu';
|
import SpuApi from '@/sheep/api/product/spu';
|
||||||
import { getAiProduct } from '@/sheep/api/ai';
|
import { getAiProduct } from '@/sheep/api/ai';
|
||||||
@@ -89,6 +89,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isInit = ref(isAutoInit); // 当前tab是否已初始化
|
const isInit = ref(isAutoInit); // 当前tab是否已初始化
|
||||||
|
const tabName = computed(() => String(props.tabs?.[props.i]?.name || '').trim());
|
||||||
|
const isMemberPreferred = computed(() => tabName.value === '会员优选');
|
||||||
// 监听下标的变化
|
// 监听下标的变化
|
||||||
watch(
|
watch(
|
||||||
() => props.index,
|
() => props.index,
|
||||||
@@ -110,11 +112,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const upCallback = (mescroll) => {
|
const upCallback = (mescroll) => {
|
||||||
const tab = props.tabs?.[props.i] || {};
|
if (isMemberPreferred.value) {
|
||||||
const tabName = String(tab?.name || '').trim();
|
|
||||||
const isMemberPreferred = tabName === '会员优选';
|
|
||||||
|
|
||||||
if (isMemberPreferred) {
|
|
||||||
getAiProduct({
|
getAiProduct({
|
||||||
pageNo: mescroll.num,
|
pageNo: mescroll.num,
|
||||||
pageSize: mescroll.size,
|
pageSize: mescroll.size,
|
||||||
@@ -135,7 +133,7 @@
|
|||||||
SpuApi.getSpuPage({
|
SpuApi.getSpuPage({
|
||||||
pageNo: mescroll.num,
|
pageNo: mescroll.num,
|
||||||
pageSize: mescroll.size,
|
pageSize: mescroll.size,
|
||||||
tagTypeId: tab.id,
|
tagTypeId: props.tabs?.[props.i]?.id,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const list = res.data.list || []; // 当前页数据
|
const list = res.data.list || []; // 当前页数据
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<view class="m-b-12 size24 h_52" v-for="(item, i) in v.items" :key="i">
|
<view class="m-b-12 size24 h_52" v-for="(item, i) in v.items" :key="i">
|
||||||
<view class="flex1 flex-center ju-between h_52 bg18 radius8 p-l-8 p-r-16">
|
<view class="flex1 flex-center ju-between h_52 bg18 radius8 p-l-8 p-r-16">
|
||||||
<view class="lineOne c19">
|
<view class="lineOne c19">
|
||||||
{{item?.properties.length > 1? item?.properties.reduce((items2, items) => items2.valueName + ' ' + items.valueName,): item?.properties[0].valueName}}
|
{{ formatSkuProperties(item?.properties) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-center">
|
<view class="flex-center">
|
||||||
<view class="c19">x{{ item.count }}</view>
|
<view class="c19">x{{ item.count }}</view>
|
||||||
@@ -41,9 +41,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row ju-between" :class="{ 'm-t-8': props.type == 3 }" v-else>
|
<view class="flex-row ju-between" :class="{ 'm-t-8': props.type == 3 }" v-else>
|
||||||
<view class="valueName size28" :class="{ c19: props.theme == 2 }">{{
|
<view class="valueName size28" :class="{ c19: props.theme == 2 }">{{ formatSkuProperties(v.properties) }}</view>
|
||||||
v.properties.map((property) => property.valueName).join(' ')
|
|
||||||
}}</view>
|
|
||||||
<view class="shrink size28 c_333" :class="{ c0: props.theme == 2 }">{{
|
<view class="shrink size28 c_333" :class="{ c0: props.theme == 2 }">{{
|
||||||
`x${v.count}`
|
`x${v.count}`
|
||||||
}}</view>
|
}}</view>
|
||||||
@@ -75,6 +73,13 @@
|
|||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
const { proxy } = getCurrentInstance() as any;
|
const { proxy } = getCurrentInstance() as any;
|
||||||
let emit = defineEmits(['getOrderDetail']);
|
let emit = defineEmits(['getOrderDetail']);
|
||||||
|
const formatSkuProperties = (properties: any) => {
|
||||||
|
const list = Array.isArray(properties) ? properties : [];
|
||||||
|
return list
|
||||||
|
.map((property) => property?.valueName)
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(' ');
|
||||||
|
};
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-pages title="我的社员">
|
<s-pages title="我的社员" :pink_bg="false" navPreset="float" :blue_bg="true">
|
||||||
<!-- 头部 -->
|
<!-- 头部 -->
|
||||||
<view class="header" :style="{ backgroundImage: 'url(' + $url + 'home/staff2.png' + ')' }">
|
<view class="header" :style="{ backgroundImage: 'url(' + $url + 'home/staff2.png' + ')' }">
|
||||||
<view class="header-content">
|
<view class="header-content">
|
||||||
|
|||||||
@@ -35,13 +35,7 @@
|
|||||||
<button
|
<button
|
||||||
class="back-btn ss-reset-button"
|
class="back-btn ss-reset-button"
|
||||||
:class="{ c0: theme == 2 }"
|
:class="{ c0: theme == 2 }"
|
||||||
@tap="
|
@tap="sheep.$router.redirect('/pages/index/index')"
|
||||||
sheep.$router.redirect(
|
|
||||||
state.orderType === 'aiGoods' || state.orderType === 'aiRecharge'
|
|
||||||
? '/pages/AI/index'
|
|
||||||
: '/pages/index/index',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
返回首页
|
返回首页
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
<view class="card1 w100">
|
<view class="card1 w100">
|
||||||
<image v-if="pink_bg" class="w100" :src="$ygUrl + 'transparent_bg.png'" mode="" />
|
<image v-if="pink_bg" class="w100" :src="$ygUrl + 'transparent_bg.png'" mode="" />
|
||||||
</view>
|
</view>
|
||||||
|
<view class="card1 w100">
|
||||||
|
<image v-if="blue_bg" class="w100" src="/static/index/login_bg.png" mode="" />
|
||||||
|
</view>
|
||||||
<view class="scon" :style="{ height: height + 'px' }">
|
<view class="scon" :style="{ height: height + 'px' }">
|
||||||
<slot />
|
<slot />
|
||||||
</view>
|
</view>
|
||||||
@@ -90,6 +93,10 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
blue_bg: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
let height = ref(0);
|
let height = ref(0);
|
||||||
let sysInfo = uni.getSystemInfoSync();
|
let sysInfo = uni.getSystemInfoSync();
|
||||||
@@ -146,6 +153,12 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
height: 300rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scon {
|
.scon {
|
||||||
|
|||||||
Reference in New Issue
Block a user