第一次上传

This commit is contained in:
Ls
2026-03-09 16:39:03 +08:00
commit 3d9efaf15c
924 changed files with 326227 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { Service } from '@/Service/Service';
/*****用户*****/
class vpUserService {
private static GetUserInfoPath : string = '/User/GetUserInfo';
/*****获取用户信息*****/
static GetUserInfo() {
var result = Service.Request(this.GetUserInfoPath, 'GET', {});
return result;
}
private static GetUserAccInfoPath : string = '/User/GetUserAccInfo';
/*****获取用户账户信息*****/
static GetUserAccInfo(page : number) {
var result = Service.Request(this.GetUserAccInfoPath, 'GET', { page });
return result;
}
private static UpdateUserPath : string = '/User/UpdateUser';
/*****修改用户信息*****/
static UpdateUser(headImg:string,nick:string,sex:string,phone:string) {
var result = Service.Request(this.UpdateUserPath, 'POST', { headImg,nick,sex,phone });
return result;
}
}
export { Service, vpUserService };

View File

@@ -0,0 +1,176 @@
<template>
<view style="padding: 20rpx;">
<!-- 当前积分区域 -->
<view class="points-detail-section" style="margin-bottom: 20rpx;" >
<view class="" style="display: flex; align-items: center; justify-content: space-between;" >
<view class="" style="font-size: 30rpx; color: #999;" >
积分余额
</view>
<view class="" style="color: red; font-weight: bold; font-size: 34rpx; " >
200
</view>
</view>
<view class="" style="margin-top: 20rpx;" >
<u-button type="primary" @click="Service.GoPage('/pages/userFunc/withdrow')" :custom-style="contactButtonStyle">立即提现</u-button>
</view>
<view class="" style="font-size: 26rpx; color: #999; text-align: center; margin-top: 20rpx; " >
提现到账时间:T+1工作日
</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.code=='收入' ? 'positive' : 'negative']">
{{ item.code=='收入' ? '+' : '-' }}{{ item.amount }}
</text>
<view class="" style="margin-left: 20rpx;">
<view class="points-type">{{ item.name }}</view>
<view class="points-date">{{ Service.formatDate(item.addTime,1) }}</view>
</view>
</view>
</view>
<view v-if="pointsList.length==0" class="" style=" font-size: 28rpx; text-align: center;padding: 10rpx 0;" >
暂无记录
</view>
</view>
<up-loadmore v-if="pointsList.length!==0" :status="status" />
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { Service } from "@/Service/Service"
import { vpUserService } from '@/Service/vp/vpUserService'
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
// 积分明细数据类型
interface PointsItem {
amount:number
code:string
name:string
addTime:string
}
interface accInfo{
account:number
integral:number
userId:string
}
// 按钮样式
const contactButtonStyle = ref({
backgroundColor: '#FF6600',
borderColor: '#FF6600',
color: '#FFFFFF',
fontSize: '28rpx',
height: '75rpx',
borderRadius: '45rpx',
marginRight: '20rpx'
});
let accInfo=ref<accInfo>()
let status=ref('loadmore')
let page=ref(1)
// 积分明细数据
const pointsList = ref<PointsItem[]>([
]);
onLoad(() => {
getUseraccInfo()
})
onReachBottom(()=>{
getList()
})
const getUseraccInfo = () => {
status.value = 'loadmore'
page.value = 1
pointsList.value=[]
getList()
}
const getList=()=>{
if (status.value !== 'loadmore') {
return
}
status.value = 'loading'
vpUserService.GetUserAccInfo(page.value).then(res => {
accInfo.value = res.data.accInfo
pointsList.value=[...pointsList.value,...res.data.logList]
status.value = res.data.logList.length == 10 ? 'loadmore' : 'nomore'
page.value++
})
}
</script>
<style lang="scss">
page {
background-color: #f6f6f6;
}
/* 积分明细 */
.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>

View File

@@ -0,0 +1,309 @@
<template>
<view class="points-mall-page">
<view class="page-content">
<!-- 1. 顶部轮播图 (原生 <swiper> 实现) -->
<view class="swiper-section">
<swiper class="swiper-container" circular autoplay :interval="3000" :duration="500"
@change="e => swiperCurrent = e.detail.current">
<swiper-item v-for="(item, index) in swiperList" :key="index">
<view class="swiper-item">
<view class="image-placeholder swiper-image">
<image :src="item" style="width: 100%; height: 100%;" mode=""></image>
</view>
</view>
</swiper-item>
</swiper>
<!-- 自定义指示点 -->
<view class="swiper-dots">
<view class="dot" :class="{ active: index === swiperCurrent }" v-for="(item, index) in swiperList"
:key="index"></view>
</view>
</view>
<!-- 2. 主体内容:左右联动 -->
<view class="main-content">
<!-- 左侧分类栏 -->
<scroll-view class="left-panel" scroll-y>
<view class="category-item" :class="{ active: currentCategory === cat.typeId }"
v-for="(cat, index) in categories" :key="index" @click="selectCategory(cat)">
<text class="name">{{ cat.name }}</text>
</view>
</scroll-view>
<!-- 右侧商品列表 -->
<scroll-view class="right-panel" @scrolltolower="getList()" scroll-y>
<view class="product-list">
<view class="product-card" v-for="(product,index) in products" :key="index"
@click="Service.GoPage('/pages/goods/integralGoods?id='+product.goodsId)">
<view class="image-placeholder product-image">
<image :src="Service.GetMateUrlByImg(product.img)" style="width: 100%; height: 100%; border-radius: 20rpx;"
mode=""></image>
</view>
<view class="product-info" style="flex: 1;">
<text class="name">{{ product.goodsName }}</text>
<view style=" margin: 10rpx 0; display: flex; align-items: center; color: #999; font-size: 26rpx; " >
<view class="">
销量 {{ product.sale}}
</view>
<view class="">
库存 {{ product.stock}}
</view>
</view>
<view class="price-line" style="display: flex; align-items: center; justify-content: space-between;" >
<text class="points">{{ product.price }} 积分</text>
<view class="">
<u-button type="primary" :custom-style="ButtonStyle">立即兑换</u-button>
</view>
</view>
</view>
</view>
</view>
<up-loadmore status="nomore" nomoreText="没有更多商品了"></up-loadmore>
</scroll-view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { Service } from "@/Service/Service";
import { vpGoodsService } from '@/Service/vp/vpGoodsService'
const ButtonStyle = ref({
backgroundColor: '#FF6600',
borderColor: '#FF6600',
color: '#FFFFFF',
fontSize: '24rpx',
height: '40rpx',
padding:'24rpx 8rpx',
borderRadius: '45rpx',
});
let keyword=ref('')
const currentCategory = ref('1001');
const swiperCurrent = ref(0);
// 轮播图数据
let swiperList = reactive([
'/static/dele/dele1.jpg',
'/static/dele/dele2.jpg',
'/static/dele/dele3.png',
]);
// 分类数据
const categories = ref<Array<any>>([]);
// 商品数据
const products = ref<Array<any>>([]);
let page=ref(1)
let status=ref('nomore')
onLoad(() => {
getData()
});
onShow(() => { });
const getData=()=>{
page.value=1
status.value='loadmore'
products.value=[]
getList()
}
const getList=()=>{
if(status.value=='nomore'|| status.value=='loading' ){
return
}
status.value='loading'
swiperList=[]
vpGoodsService.GetGoodsList(currentCategory.value,page.value).then(res=>{
if(res.code==0){
categories.value=res.data.goodsType
products.value=[...products.value,...res.data.goodsList]
res.data.bannerList.map(item=>{
swiperList.push(Service.GetMateUrlByImg(item.img))
})
}
})
}
const selectCategory = (cat : any) => {
currentCategory.value = cat.typeId;
getData()
};
</script>
<style lang="scss" scoped>
.points-mall-page {
background-color: #f6f6f6;
height: 100vh;
display: flex;
flex-direction: column;
}
.swiper-section {
padding: 24rpx;
position: relative;
.swiper-container {
height: 300rpx;
border-radius: 16rpx;
overflow: hidden;
}
.swiper-item {
width: 100%;
height: 100%;
.swiper-image {
width: 100%;
height: 100%;
}
}
.swiper-dots {
position: absolute;
bottom: 40rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 12rpx;
.dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.5);
transition: all 0.3s;
&.active {
width: 30rpx;
background-color: #fff;
}
}
}
}
.main-content {
flex: 1;
display: flex;
overflow: hidden;
}
.left-panel {
width: 180rpx;
background-color: #f7f7f7;
height: 100%;
.category-item {
padding: 30rpx 20rpx;
font-size: 28rpx;
color: #666;
text-align: center;
position: relative;
&.active {
background-color: #fff;
color: #333;
font-weight: bold;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx;
height: 40rpx;
background-color: #fa6400;
}
}
}
}
.right-panel {
flex: 1;
background-color: #fff;
height: 920rpx;
padding: 30rpx;
.product-list {
display: flex;
flex-direction: column;
gap: 30rpx;
}
.product-card {
display: flex;
gap: 24rpx;
align-items: center;
border-bottom: 1rpx solid #e2e2e2;
padding-bottom: 10rpx;
.product-image {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
flex-shrink: 0;
}
.product-info {
flex: 1;
min-width: 0;
.name {
font-size: 34rpx;
color: #333;
font-weight: bold;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.price-line {
display: flex;
align-items: baseline;
.points {
font-size: 32rpx;
font-weight: bold;
color: #fa6400;
}
.original-price {
font-size: 22rpx;
color: #999;
margin-left: 8rpx;
}
}
}
.exchange-btn {
background-color: #fa6400;
color: #fff;
border-radius: 30rpx;
font-size: 24rpx;
padding: 10rpx 24rpx;
margin: 0;
height: fit-content;
line-height: 1.5;
&::after {
border: none;
}
}
}
}
</style>