style: ai店铺ui

This commit is contained in:
2026-06-01 18:47:47 +08:00
parent 86e964c363
commit 79fab5929a
7 changed files with 591 additions and 20 deletions
@@ -0,0 +1,216 @@
<template>
<view class="tab2-wrap p-x-32 p-t-16 p-b-24">
<view class="shop-card m-b-24" v-for="(v, i) in mockList" :key="v.id || i">
<view class="cover-wrap">
<image class="cover" :src="v.cover" mode="aspectFill" />
<view class="cover-mask" />
<view class="cover-content">
<view class="title lineOne">{{ v.name }}</view>
<view class="sub flex-center ju-flex-start m-t-10">
<view class="tag shrink">{{ v.level }}</view>
<view class="subText lineOne m-l-16">首次代理时间:{{ v.createTime }}</view>
</view>
</view>
</view>
<view class="body">
<view class="progress-row">
<view class="progress-label">目标达成:{{ v.progress }}%</view>
<view class="progress-bar">
<view class="progress" :style="{ width: `${v.progress}%` }" />
</view>
</view>
<view class="stats flex-between">
<view class="stat">
<view class="stat-title flex-between al-flex-center">
<view>店铺总收益</view>
<image class="stat-icon" src="/static/aiStore/earnings.png" mode="aspectFit" />
</view>
<view class="stat-value">¥{{ formatMoney(v.earnings) }}</view>
</view>
<view class="stat">
<view class="stat-title flex-between al-flex-center">
<view>绿色积分</view>
<image class="stat-icon" src="/static/aiStore/leaf.png" mode="aspectFit" />
</view>
<view class="stat-value leaf">{{ v.leaf }}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
defineProps({
list: {
type: Array,
default: () => [],
},
source: {
type: Number,
default: 1,
},
});
const emit = defineEmits(['addCar', 'update', 'shipment']);
const mockList = ref([
{
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 num = Number(value);
if (!Number.isFinite(num)) return '0.00';
return num.toFixed(2);
};
</script>
<style lang="scss" scoped>
.tab2-wrap {
box-sizing: border-box;
}
.shop-card {
background: #ffffff;
border-radius: 24rpx;
overflow: hidden;
box-shadow: 0 16rpx 40rpx rgba(25, 80, 215, 0.12);
}
.cover-wrap {
position: relative;
height: 220rpx;
}
.cover {
width: 100%;
height: 100%;
}
.cover-mask {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.55) 100%);
}
.cover-content {
position: absolute;
left: 24rpx;
right: 24rpx;
bottom: 20rpx;
color: #ffffff;
}
.title {
font-size: 34rpx;
font-weight: 600;
letter-spacing: 0.5rpx;
}
.subText {
font-size: 22rpx;
opacity: 0.92;
}
.tag {
padding: 6rpx 16rpx;
border-radius: 999rpx;
font-size: 22rpx;
border: 1rpx solid rgba(255, 255, 255, 0.4);
background: rgba(255, 255, 255, 0.22);
box-sizing: border-box;
}
.body {
padding: 24rpx;
}
.progress-label {
font-size: 24rpx;
color: #5b6b8a;
margin-bottom: 12rpx;
}
.progress-bar {
height: 12rpx;
border-radius: 999rpx;
background: #e9eef8;
overflow: hidden;
}
.progress {
height: 100%;
border-radius: 999rpx;
background: linear-gradient(90deg, #2c63ff 0%, #ff8a00 100%);
}
.stats {
margin-top: 20rpx;
}
.stat {
width: 48%;
padding: 20rpx 22rpx 12rpx;
border-radius: 20rpx;
box-sizing: border-box;
background: #f7faff;
border: 1rpx solid #e6ecfb;
}
.stat-title {
font-size: 22rpx;
color: #5b6b8a;
}
.stat-icon {
width: 28rpx;
height: 28rpx;
}
.stat-value {
font-size: 42rpx;
font-weight: 700;
color: #ff4d3f;
margin-top: 10rpx;
}
.stat-value.leaf {
color: #12b76a;
}
</style>
+228 -10
View File
@@ -1,19 +1,46 @@
<template>
<view class="p-t-16 p-b-24">
<view class="m-b-24" v-for="(v, i) in list" :key="i">
<aiOrder
:data="v"
@addCar="emit('addCar', $event)"
:source="source"
@update="emit('update')"
@shipment="emit('shipment')"
/>
<view class="tab2-wrap p-x-32 p-t-16 p-b-24">
<view class="shop-card m-b-24" v-for="(v, i) in list" :key="v.id || i">
<view class="shop-card-inner">
<view class="shop-card-top">
<view class="shop-name lineOne">{{ v.name }}</view>
</view>
<view class="meta-row flex-between">
<view class="progress-row">
<view class="progress-bar">
<view
class="progress"
:style="{ width: `${Math.max(0, Math.min(100, Number(v.progress) || 0))}%` }"
></view>
</view>
</view>
<view class="first-time">首次代理时间:{{ v.createTime }}</view>
</view>
<view class="stats flex-between">
<view class="stat">
<view class="stat-head flex-between">
<view class="stat-title">店铺总收益</view>
<image class="stat-icon" src="/static/aiStore/earnings.png" mode="aspectFit" />
</view>
<view class="stat-value">¥{{ formatMoney(v.earnings) }}</view>
</view>
<view class="stat">
<view class="stat-head flex-between">
<view class="stat-title">绿色积分</view>
<image class="stat-icon" src="/static/aiStore/leaf.png" mode="aspectFit" />
</view>
<view class="stat-value leaf">{{ v.leaf || 0 }}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import aiOrder from '@/components/ai_order/ai_order';
import { ref } from 'vue';
defineProps({
list: {
@@ -27,7 +54,198 @@
});
const emit = defineEmits(['addCar', 'update', 'shipment']);
const mockList = ref([
{
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 num = Number(value);
if (!Number.isFinite(num)) return '0.00';
return num.toFixed(2);
};
</script>
<style lang="scss" scoped>
.tab2-wrap {
box-sizing: border-box;
}
.shop-card {
background: #ffffff;
border-radius: 24rpx;
overflow: hidden;
box-shadow: 0 16rpx 40rpx rgba(25, 80, 215, 0.12);
}
.shop-card-inner {
padding: 24rpx;
}
.shop-card-top {
align-items: flex-end;
}
.shop-name {
flex: 1;
font-size: 34rpx;
font-weight: 600;
color: #1b2b4b;
letter-spacing: 0.5rpx;
}
.meta-row {
margin-top: 16rpx;
align-items: center;
gap: 16rpx;
}
.first-time {
flex-shrink: 0;
font-size: 22rpx;
color: #5b6b8a;
}
.progress-row {
flex: 1;
min-width: 180rpx;
}
.cover-wrap {
position: relative;
height: 220rpx;
}
.cover {
width: 100%;
height: 100%;
}
.cover-mask {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.55) 100%);
}
.cover-content {
position: absolute;
left: 24rpx;
right: 24rpx;
bottom: 20rpx;
color: #ffffff;
}
.title {
font-size: 34rpx;
font-weight: 600;
letter-spacing: 0.5rpx;
}
.subText {
font-size: 22rpx;
opacity: 0.92;
}
.tag {
padding: 6rpx 16rpx;
border-radius: 999rpx;
font-size: 22rpx;
border: 1rpx solid rgba(255, 255, 255, 0.4);
background: rgba(255, 255, 255, 0.22);
box-sizing: border-box;
}
.body {
padding: 24rpx;
}
.progress-label {
font-size: 24rpx;
color: #5b6b8a;
margin-bottom: 12rpx;
}
.progress-bar {
height: 15rpx;
border-radius: 999rpx;
background: linear-gradient(90deg, #2c63ff 0%, #ff3b30 100%);
overflow: hidden;
}
.progress {
height: 13rpx;
margin: 1rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.92);
}
.stats {
margin-top: 20rpx;
}
.stat {
width: 48%;
padding: 20rpx 22rpx 12rpx;
border-radius: 20rpx;
box-sizing: border-box;
background: #f7faff;
border: 1rpx solid #e6ecfb;
}
.stat-head {
gap: 12rpx;
}
.stat-title {
font-size: 22rpx;
color: #5b6b8a;
}
.stat-icon {
width: 28rpx;
height: 28rpx;
}
.stat-value {
font-size: 42rpx;
font-weight: 700;
color: #ff4d3f;
margin-top: 10rpx;
}
.stat-value.leaf {
color: #12b76a;
}
</style>