第一次上传
This commit is contained in:
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<view style="padding: 20rpx;">
|
||||
|
||||
|
||||
<!-- 当前积分区域 -->
|
||||
<view class="current-points-section">
|
||||
<text class="points-label">当前积分</text>
|
||||
<text class="points-value">2,758</text>
|
||||
</view>
|
||||
|
||||
<!-- 积分获取规则 -->
|
||||
<view class="rules-section">
|
||||
<text class="section-title">积分获取规则</text>
|
||||
<view class="rule-item">
|
||||
<view class="flex-center" style=" border-radius: 50%; padding: 20rpx; background-color: #F9FAFB; ">
|
||||
<image :src="Service.GetIconImg('/static/userFunc/intergration/shop.png')" class="service-icon"></image>
|
||||
</view>
|
||||
<view class="" style="margin-left: 20rpx;" >
|
||||
<view class="rule-title">消费获得积分</view>
|
||||
<view class="rule-desc">每消费1元得1分</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rule-item">
|
||||
<view class="flex-center" style=" border-radius: 50%; padding: 20rpx; background-color: #F9FAFB; ">
|
||||
<image :src="Service.GetIconImg('/static/userFunc/intergration/share.png')" class="service-icon"></image>
|
||||
</view>
|
||||
<view class="" style="margin-left: 20rpx;" >
|
||||
<view class="rule-title">分享商品</view>
|
||||
<view class="rule-desc">每次分享得5分</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分明细 -->
|
||||
<view class="points-detail-section">
|
||||
<text class="section-title">积分明细</text>
|
||||
<view class="points-list">
|
||||
<view class="points-item" v-for="(item, index) in pointsList" :key="index">
|
||||
<text :class="['points-number', item.isPositive ? 'positive' : 'negative']">
|
||||
{{ item.isPositive ? '+' : '-' }}{{ item.points }}
|
||||
</text>
|
||||
<view class="" style="margin-left: 20rpx;" >
|
||||
<view class="points-type">{{ item.type }}</view>
|
||||
<view class="points-date">{{ item.date }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import {Service} from "@/Service/Service"
|
||||
// 积分明细数据类型
|
||||
interface PointsItem {
|
||||
id : number;
|
||||
type : string;
|
||||
points : number;
|
||||
isPositive : boolean;
|
||||
date : string;
|
||||
}
|
||||
|
||||
// 积分明细数据
|
||||
const pointsList = ref<PointsItem[]>([
|
||||
{
|
||||
id: 1,
|
||||
type: '购买商品获得积分',
|
||||
points: 100,
|
||||
isPositive: true,
|
||||
date: '2025-09-12 14:30'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: '购买商品获得积分',
|
||||
points: 5,
|
||||
isPositive: true,
|
||||
date: '2025-09-12 11:45'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
type: '积分抵消费金额',
|
||||
points: 20,
|
||||
isPositive: false,
|
||||
date: '2025-09-11 09:15'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
type: '购买商品获得积分',
|
||||
points: 200,
|
||||
isPositive: true,
|
||||
date: '2025-09-10 18:00'
|
||||
}
|
||||
]);
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
.service-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
/* 当前积分区域 */
|
||||
.current-points-section {
|
||||
background-color: #ffffff;
|
||||
padding: 60rpx 0;
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.points-label {
|
||||
font-size: 32rpx;
|
||||
color: #666666;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.points-value {
|
||||
font-size: 64rpx;
|
||||
color: #FF6600;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 积分获取规则 */
|
||||
.rules-section {
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.rule-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
|
||||
.rule-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.rule-icon {
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.rule-title {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.rule-desc {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/* 积分明细 */
|
||||
.points-detail-section {
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.points-list {
|
||||
gap: 36rpx;
|
||||
}
|
||||
|
||||
.points-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.points-item:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.points-type {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.points-number {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 24rpx;
|
||||
min-width: 80rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.points-number.positive {
|
||||
color: #4CD964;
|
||||
}
|
||||
|
||||
.points-number.negative {
|
||||
color: #FF4D4F;
|
||||
}
|
||||
|
||||
.points-date {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<!-- Tab 切换栏 -->
|
||||
<view class="tab-bar">
|
||||
<view v-for="(tab, index) in tabs" :key="index" class="tab-item" :class="{ active: currentTab === index }"
|
||||
@click="switchTab(index)">
|
||||
<text class="tab-text">{{ tab.label }}</text>
|
||||
<view v-if="currentTab === index" class="tab-indicator"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 统计卡片 -->
|
||||
<view class="stats-section">
|
||||
<view class="stats-card">
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{allAmount}}</text>
|
||||
<text class="stat-label">营销额</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{ orderTotal }}</text>
|
||||
<text class="stat-label">订单数</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{ average }}</text>
|
||||
<text class="stat-label">人均消费</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="" style=" margin:20rpx; ">
|
||||
<view class="" style="font-weight: bold; font-size: 26rpx; ">
|
||||
订单记录
|
||||
</view>
|
||||
<view class="" v-for="(item,index) in orderList" :key="index"
|
||||
style="display: flex; align-items: center; padding: 40rpx 30rpx; margin-top: 20rpx; justify-content: space-between; border-radius: 20rpx; background-color: #fff; ">
|
||||
<view class="">
|
||||
<view class="" style="display: flex; align-items: center;gap: 15rpx; ">
|
||||
<img :src="Service.GetMateUrlByImg(item.headImg)"
|
||||
style=" border-radius: 10rpx; width: 100rpx; height: 100rpx;" alt="" />
|
||||
<view class="">
|
||||
<view >{{ item.nick }}</view>
|
||||
<view class="" style="margin-top: 15rpx; font-size: 24rpx; color: #999999; ">
|
||||
{{ Service.formatDate(item.payTime,2) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="" style="font-weight: 600; color: #666666;">
|
||||
¥+{{ item.payAmount }}
|
||||
</view>
|
||||
</view>
|
||||
<up-loadmore :status="status" />
|
||||
<view class="" style="width: 100%; height: 20rpx;" >
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<up-calendar :show="showDate" closeOnClickOverlay='true' :mode="mode" monthNum='5' minDate='2025-12-01'
|
||||
maxDate='2999-12-31' @close="showDate=false" @confirm="confirmDate"></up-calendar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import { Service } from '@/Service/Service'
|
||||
import { vpMerchService } from '@/Service/vp/vpMerchService'
|
||||
|
||||
// 当前Tab
|
||||
const currentTab = ref(0)
|
||||
|
||||
|
||||
// Tab 配置
|
||||
const tabs = [{
|
||||
label: '全部',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '今日',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '本月',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '自定义',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
|
||||
// 日历管理
|
||||
const showDate = ref(false);
|
||||
const mode = ref('range');
|
||||
let time = ref('')
|
||||
let page = ref(1)
|
||||
let status = ref('nomore')
|
||||
|
||||
let allAmount=ref('')
|
||||
let average=ref('')
|
||||
let orderTotal=ref('')
|
||||
let orderList=ref<Array<any>>([])
|
||||
let type = ref(null)
|
||||
onLoad(() => {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '订单列表'
|
||||
})
|
||||
getData()
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
|
||||
onReachBottom(()=>{
|
||||
getList()
|
||||
|
||||
})
|
||||
|
||||
const getData = () => {
|
||||
status.value = 'Loadmore'
|
||||
page.value = 1
|
||||
orderList.value = []
|
||||
getList()
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
|
||||
if (status.value == 'loading' || status.value == 'nomore') {
|
||||
return
|
||||
}
|
||||
status.value = 'loading'
|
||||
vpMerchService.GetMerchOrderList(String(currentTab.value) === '3' ? time.value : ( String(currentTab.value)==='0'?'':String(currentTab.value) ), page.value).then(res => {
|
||||
if (res.code == 0) {
|
||||
allAmount.value=res.data.allAmount
|
||||
average.value=res.data.average
|
||||
orderTotal.value=res.data.orderTotal.value
|
||||
orderList.value = [...orderList.value, ...res.data.orderList]
|
||||
status.value = res.data.orderList.length == 10 ? 'loadmore' : 'nomore'
|
||||
page.value++
|
||||
} else {
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 切换Tab
|
||||
const switchTab = (index : any) => {
|
||||
if (index == 3) {
|
||||
showDate.value = true
|
||||
return
|
||||
}
|
||||
currentTab.value = index
|
||||
getData()
|
||||
}
|
||||
|
||||
const changetab = (e : number) => {
|
||||
if (e == 3) {
|
||||
showDate.value = true
|
||||
return
|
||||
}
|
||||
currentTab.value = e
|
||||
getData()
|
||||
}
|
||||
|
||||
const confirmDate = (e:any) => {
|
||||
currentTab.value = 3
|
||||
time.value = e[0] + '_' + e[e.length - 1]
|
||||
getData()
|
||||
showDate.value = false
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
// .active{
|
||||
// background-color: #F3F4F6;
|
||||
// color: #4B5563;
|
||||
// }
|
||||
// .actived{
|
||||
// background-color: #FF6B35;
|
||||
// color: #fff;
|
||||
// }
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* Tab 切换栏 */
|
||||
.tab-bar {
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24rpx 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-text {
|
||||
color: #FF6B00;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab-indicator {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 40rpx;
|
||||
height: 4rpx;
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
/* 统计卡片 */
|
||||
.stats-section {
|
||||
padding: 20rpx 20rpx 10rpx;
|
||||
}
|
||||
|
||||
.stats-card {
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
box-shadow: 0 4rpx 16rpx rgba(255, 107, 0, 0.3);
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
color: #FFFFFF;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.stat-divider {
|
||||
width: 1rpx;
|
||||
height: 60rpx;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user