feat: 添加我的店铺api

This commit is contained in:
2026-06-03 15:18:09 +08:00
parent 5c7f7a9c4e
commit fd851bab83
14 changed files with 181 additions and 87 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ SHOPRO_VERSION=v2.4.1
#SHOPRO_DEV_BASE_URL=https://www.qflyqzy.net/yg-api #SHOPRO_DEV_BASE_URL=https://www.qflyqzy.net/yg-api
# 伟伟 # 伟伟
# SHOPRO_DEV_BASE_URL=http://192.168.1.4:48080 # SHOPRO_DEV_BASE_URL=http://192.168.1.7:48080
# 测试环境 # 测试环境
SHOPRO_DEV_BASE_URL=https://yougoutest.api.riananyoumu.com SHOPRO_DEV_BASE_URL=https://yougoutest.api.riananyoumu.com
+63 -3
View File
@@ -1,9 +1,12 @@
<template> <template>
<s-layout :navbar="navBar" title="金种子" navPreset="float"> <s-layout :navbar="navBar" title="金种子" navPreset="float">
<view class="pages w100" :style="{ marginTop: -height + 'px' }"> <view class="pages w100" :style="{ marginTop: -height + 'px' }">
<view class="w100"> <view class="seed-hero w100">
<!-- <image class="w100" :src="$url + 'home/seed_1.png'" mode="widthFix" /> --> <image class="seed-hero__bg" src="/static/jinzhongzi_bg.png" mode="widthFix" />
<image class="w100" src="/static/jinzhongzi_bg.png" mode="widthFix" /> <view class="seed-hero__text">
<view class="seed-hero__title">资产概览</view>
<view class="seed-hero__sub">更新于 {{ getUpdateDateText() }}</view>
</view>
</view> </view>
<view class="content" :style="{ marginTop: -top + 'px' }"> <view class="content" :style="{ marginTop: -top + 'px' }">
<view class="con"> <view class="con">
@@ -283,6 +286,33 @@
const n = Number(val); const n = Number(val);
return Number.isFinite(n) ? n.toFixed(4) : '0.0000'; return Number.isFinite(n) ? n.toFixed(4) : '0.0000';
}; };
const formatYmd = (val: any) => {
const formatDate = (d: Date) => {
const y = d.getFullYear();
const m = pad2(d.getMonth() + 1);
const day = pad2(d.getDate());
return `${y}年${m}月${day}日`;
};
if (val instanceof Date) return formatDate(val);
if (typeof val === 'number') {
const d = new Date(val);
return Number.isFinite(d.getTime()) ? formatDate(d) : '';
}
const s = String(val ?? '').trim();
if (!s) return '';
const m = s.match(/^(\d{4})-(\d{2})-(\d{2})/);
if (m) return `${m[1]}年${m[2]}月${m[3]}日`;
const d = new Date(s);
return Number.isFinite(d.getTime()) ? formatDate(d) : '';
};
const getUpdateDateText = () => {
return (
formatYmd(dataObj?.updateTime || dataObj?.updateDate || dataObj?.updateAt) ||
formatYmd(new Date())
);
};
const toLocalDateTime = (d) => { const toLocalDateTime = (d) => {
const y = d.getFullYear(); const y = d.getFullYear();
const m = pad2(d.getMonth() + 1); const m = pad2(d.getMonth() + 1);
@@ -633,7 +663,37 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.pages { .pages {
// position: relative; // position: relative;
box-sizing: border-box;
.seed-hero {
position: relative;
width: 100%;
}
.seed-hero__bg {
width: 100%;
display: block;
}
.seed-hero__text {
position: absolute;
left: 60rpx;
top: calc(env(safe-area-inset-top) + 120rpx);
z-index: 2;
}
.seed-hero__title {
font-size: 44rpx;
line-height: 52rpx;
font-weight: 700;
color: #fff;
}
.seed-hero__sub {
margin-top: 10rpx;
font-size: 26rpx;
line-height: 34rpx;
color: rgba(255, 255, 255, 0.88);
}
.content { .content {
// position: absolute; // position: absolute;
width: 100%; width: 100%;
+26
View File
@@ -3,6 +3,11 @@
<view class="share_page_bg" id="captureBox" :style="{ marginTop: `-${navHeight}px` }"> <view class="share_page_bg" id="captureBox" :style="{ marginTop: `-${navHeight}px` }">
<view class="slogan"> <view class="slogan">
<image class="slogan_img" src="/static/share_bg.png" mode="widthFix" /> <image class="slogan_img" src="/static/share_bg.png" mode="widthFix" />
<view class="slogan__text">
<view class="slogan__title">邀请好友</view>
<view class="slogan__title">一起瓜分金种子</view>
<view class="slogan__sub">好友注册你得奖励</view>
</view>
</view> </view>
<view class="share_card"> <view class="share_card">
@@ -385,6 +390,27 @@
display: block; display: block;
} }
.slogan__text {
position: absolute;
left: 60rpx;
top: calc(env(safe-area-inset-top) + 100rpx);
z-index: 1;
}
.slogan__title {
font-size: 45rpx;
line-height: 60rpx;
font-weight: 800;
color: #ffffff;
}
.slogan__sub {
margin-top: 18rpx;
font-size: 28rpx;
line-height: 35rpx;
color: rgba(255, 255, 255, 0.88);
}
.share_card { .share_card {
position: relative; position: relative;
z-index: 0; z-index: 0;
+34 -38
View File
@@ -95,7 +95,8 @@
</view> </view>
<view class="shop-summary-info flex1"> <view class="shop-summary-info flex1">
<view class="shop-summary-title">{{ shopSummary.title }}</view> <view class="shop-summary-title">{{ shopSummary.title }}</view>
<view class="shop-summary-id">ID:{{ shopSummary.id }}</view> <view class="shop-summary-id">ID:{{ shopSummary.shopId }}</view>
<!-- <view class="shop-summary-id">商品总数:{{ shopSummary.total }}</view> -->
</view> </view>
</view> </view>
<view class="shop-summary-bottom" v-if="index === 1"> <view class="shop-summary-bottom" v-if="index === 1">
@@ -112,7 +113,7 @@
<view class="metric-divider"></view> <view class="metric-divider"></view>
<view class="metric flex1"> <view class="metric flex1">
<view class="metric-label">店铺等级</view> <view class="metric-label">店铺等级</view>
<view class="metric-value">{{ shopSummary.level }}</view> <view class="metric-value">LV.{{ shopSummary.level || 0 }}</view>
</view> </view>
</view> </view>
</view> </view>
@@ -264,10 +265,11 @@
let res = null; let res = null;
if (index.value) { if (index.value) {
res = await api.getOrderPage({ res = await api.getMyShop({
pageNo: mescroll?.num || 1, pageNo: mescroll?.num || 1,
pageSize: mescroll?.size || 10, pageSize: mescroll?.size || 10,
keyWord: searchText.value, keyWord: searchText.value || undefined,
status: mescroll?.params?.status,
}); });
} else { } else {
res = await api.getSpuPage({ res = await api.getSpuPage({
@@ -286,37 +288,31 @@
let curPageData = []; let curPageData = [];
if (index.value) { if (index.value) {
const list = res.data.list || []; const root = res?.data || {};
const arr = []; if ((mescroll?.num || 1) === 1) {
list.forEach((e) => { shopSummary.value = {
e.items1 = JSON.parse(JSON.stringify(e.items)); title: '我的店铺',
if (e?.items?.length) { totalEarnings: root?.totalRevenue ?? 0,
e.items.forEach((item) => { shopCount: root?.numberOfStores ?? 0,
item.skuArr = item.items; level: root?.shopRating ?? 0,
item.status = e.status; total: root?.total ?? 0,
item.id = item.spuId; shopId: root?.shopId ?? '',
item.spuId = e.payOrderId; };
item.shoppingPlazaId = e.roundTimeId;
item.items1 = e.items1;
arr.push(item);
});
}
});
if (arr.length) {
arr.forEach((e) => {
if (e.skuArr && e.skuArr.length) {
e.skuArr.forEach((item) => {
item.propertyText = '';
if (item?.properties) {
item.properties.forEach((e1) => {
item.propertyText += e1.valueName + ' ';
});
}
});
}
});
} }
curPageData = arr; const list = Array.isArray(root?.storeList) ? root.storeList : [];
curPageData = list.map((it) => {
const agencyTime = String(it?.agencyTime || '').trim();
const dateOnly = agencyTime ? agencyTime.split('T')[0].split(' ')[0] : '';
return {
id: it?.skuId ?? '',
name: it?.aiShopCommodityName ?? '',
createTime: dateOnly,
progress: 0,
earnings: it?.totalRevenue ?? 0,
leaf: it?.greenCredits ?? 0,
cover: it?.picUrl ?? '',
};
});
} else { } else {
curPageData = res.data?.list || []; curPageData = res.data?.list || [];
} }
@@ -357,10 +353,10 @@
const shopSummary = ref({ const shopSummary = ref({
title: '我的店铺', title: '我的店铺',
id: '123726492', totalEarnings: 0,
totalEarnings: 26873.8, shopCount: 0,
shopCount: 12, level: 0,
level: 'LV.3', total: 0,
}); });
const formatAmount = (value) => { const formatAmount = (value) => {
+4 -35
View File
@@ -2,7 +2,7 @@
<view class="tab2-wrap p-x-32 p-b-24"> <view class="tab2-wrap p-x-32 p-b-24">
<view <view
class="shop-card m-b-24" class="shop-card m-b-24"
v-for="(v, i) in mockList" v-for="(v, i) in renderList"
:key="v.id || i" :key="v.id || i"
@tap="toListRecord(v)" @tap="toListRecord(v)"
> >
@@ -45,9 +45,9 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'; import { computed } from 'vue';
defineProps({ const props = defineProps({
list: { list: {
type: Array, type: Array,
default: () => [], default: () => [],
@@ -60,38 +60,7 @@
const emit = defineEmits(['addCar', 'update', 'shipment']); const emit = defineEmits(['addCar', 'update', 'shipment']);
const mockList = ref([ const renderList = computed(() => (Array.isArray(props.list) ? props.list : []));
{
id: 1,
name: '卓玛阳光防断洗发水',
// level: 'LV.3 超级店长',
createTime: '2026-03-09',
progress: 75,
earnings: 200,
leaf: 3200,
cover: '/static/home/img1.png',
},
{
id: 2,
name: '治山贡鸡源头旗舰店',
// level: 'LV.2 高级店长',
createTime: '2026-02-18',
progress: 62,
earnings: 870,
leaf: 5600,
cover: '/static/home/5.png',
},
{
id: 3,
name: '有购精选生活馆',
// level: 'LV.1 初级店长',
createTime: '2026-01-25',
progress: 48,
earnings: 126.5,
leaf: 2100,
cover: '/static/home/6.png',
},
]);
const formatMoney = (value) => { const formatMoney = (value) => {
const num = Number(value); const num = Number(value);
+44 -8
View File
@@ -2,7 +2,13 @@
<template> <template>
<s-layout title="首页" :showLeftButton="false" tabbar="/pages/index/index" navPreset="light"> <s-layout title="首页" :showLeftButton="false" tabbar="/pages/index/index" navPreset="light">
<view class="pagesIndex"> <view class="pagesIndex">
<view class="index-notice-btn" @click="goNotice"></view> <view class="index-header">
<view class="index-header__left">
<view class="index-header__title">优购商城</view>
<view class="index-header__subtitle">AI店铺 · 一人店铺 · 共建共享</view>
</view>
<view class="index-notice-btn" @click="goNotice"></view>
</view>
<view class="pageContent"> <view class="pageContent">
<view class="floating-search-wrap"> <view class="floating-search-wrap">
<view class="floating-search" @click="goSearch"> <view class="floating-search" @click="goSearch">
@@ -343,12 +349,12 @@
} }
.pagesIndex { .pagesIndex {
position: relative; position: relative;
padding-top: 470rpx; padding-top: 480rpx;
// background: linear-gradient(135deg, #2c8cfa 0%, #3d5efb 100%); // background: linear-gradient(135deg, #2c8cfa 0%, #3d5efb 100%);
background-image: url("../../static/index/index_bg.png"); background-image: url("../../static/index/index_bg.jpeg");
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top center; background-position: center -20rpx;
.pageContent{ .pageContent{
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
position: relative; position: relative;
@@ -356,18 +362,48 @@
background: #fff; background: #fff;
} }
} }
.index-notice-btn {
.index-header {
position: absolute; position: absolute;
top: 60rpx; top: 0;
right: 52rpx; left: 0;
right: 0;
z-index: 20;
padding: calc(env(safe-area-inset-top) + 60rpx) 52rpx 0 52rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.index-header__left {
min-width: 0;
}
.index-header__title {
font-size: 44rpx;
line-height: 52rpx;
font-weight: 700;
color: #fff;
}
.index-header__subtitle {
margin-top: 10rpx;
font-size: 26rpx;
line-height: 34rpx;
color: rgba(255, 255, 255, 0.88);
}
.index-notice-btn {
position: relative;
width: 44rpx; width: 44rpx;
height: 44rpx; height: 44rpx;
background-image: url('/static/icon/ notice.png'); background-image: url('/static/icon/ notice.png');
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
z-index: 20; flex: 0 0 auto;
} }
.floating-search-wrap { .floating-search-wrap {
position: absolute; position: absolute;
top: -50rpx; top: -50rpx;
+8 -1
View File
@@ -258,6 +258,14 @@ export function aiDelayedShipment(params : any) {
}) })
} }
export function getMyShop(params: any) {
return request({
url: '/aishop/app/myshop/get',
method: 'get',
params,
})
}
// 立即发货 // 立即发货
export function aiPendingShipment(params : any) { export function aiPendingShipment(params : any) {
return request({ return request({
@@ -274,4 +282,3 @@ export function aiPendingShipment(params : any) {
@@ -625,7 +625,7 @@
} }
.modal-footer { .modal-footer {
padding-bottom: 40rpx; padding-bottom: calc(env(safe-area-inset-bottom) + 140rpx);
box-sizing: border-box; box-sizing: border-box;
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 KiB

After

Width:  |  Height:  |  Size: 542 KiB