Files
kangyuan-mobile/pages/index/components/aistore_tab2 copy.vue
T
2026-06-01 18:47:47 +08:00

217 lines
4.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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>