第一次提交

This commit is contained in:
dt_2916866708
2024-02-28 17:26:46 +08:00
commit f756390529
991 changed files with 126914 additions and 0 deletions

70
pages/personal/index.scss Normal file
View File

@@ -0,0 +1,70 @@
.personal {
width: 100vw;
height: 100vh;
overflow: hidden;
box-sizing: border-box;
padding: 0 30rpx;
display: flex;
flex-direction: column;
.personal_footer {
width: 100%;
background: #ffffff;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 21rpx 0;
padding: 30rpx ;
box-sizing: border-box;
.personal_footer_row{
margin-bottom: 70rpx;
image{
width: 56rpx;
height: 56rpx;
}
}
}
.personal_center {
width: 100%;
background: #ffffff;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin-top: 50rpx;
box-sizing: border-box;
padding: 25rpx;
.menuList {
margin: 50rpx 0 20rpx 0;
justify-content: space-around;
.menuItem {
text-align: center;
.title {
font-size: 28rpx;
color: #333333;
}
image {
width: 56rpx;
height: 56rpx;
}
}
}
.personal_center_header {
}
}
.personal_header {
.userDetails {
color: #ffffff;
margin-left: 30rpx;
.account {
font-size: 28rpx;
}
.name {
font-size: 36rpx;
}
}
.headSculpture {
width: 108rpx;
height: 108rpx;
overflow: hidden;
background: linear-gradient(180deg, #ffffff 20%, #00ffff 100%);
border-radius: 100rpx;
}
}
}

204
pages/personal/index.vue Normal file
View File

@@ -0,0 +1,204 @@
<template>
<view :style="{paddingTop:`${titleStyle.top+titleStyle.height}px`}"
style="background: linear-gradient(180deg, #FF4A2B 0%, #F2F2F2 25%);" class="personal">
<view class="personal_header flex ac">
<view class="personal_header_left flex ac oneflex">
<view class="headSculpture">
<image v-if="user.headPhoto" style="width: 100%;height: 100%;" mode="aspectFit" :src="user.headPhoto"></image>
</view>
<view class="userDetails">
<view class="name">{{user.name}}</view>
<view class="account">当前积分{{accountBalance}}</view>
</view>
</view>
<view @click="goSeting" class="personal_header_right">
<uni-icons type="gear" color="#ffffff" size="30"></uni-icons>
</view>
</view>
<view class="personal_center">
<view @click="goOrder" class="personal_center_header flex ac jw">
<text style="font-size: 28rpx;"> 我的订单</text>
<uni-icons color="#999999" type="right" size="20"></uni-icons>
</view>
<view class="menuList flex ">
<view @click="goList(item)" v-for="item in options" class="menuItem">
<image :src="item.logo"></image>
<view class="title">{{item.title}}</view>
</view>
</view>
</view>
<view class="personal_footer oneflex">
<view @click="othersClick(item)" v-for="item in others" class="personal_footer_row flex jw ac">
<view class="flex ac oneflex">
<image :src="item.logo"></image>
<view style="margin-left: 20rpx;">{{item.title}}</view>
</view>
<uni-icons type="right" color="#999999" size="20"></uni-icons>
</view>
</view>
</view>
</template>
<script>
import homeApi from "@/api/home.js"
import tool from '../../utils/tool.js'
export default {
data() {
return {
integral:null,
imgUrl: this.baseImgURL,
cards: uni.getStorageSync('cards'),
user: uni.getStorageSync('user'),
others: [{
title: '积分记录',
logo: require('../../static/jfjl@2x.png'),
url: "/pages/personal/points"
}, {
title: '联系客服',
logo: require('../../static/lxkf@2x.png'),
}, {
title: '意见反馈',
logo: require('../../static/yjfk@2x.png'),
}],
options: [{
logo: require('../../static/dth@2x.png'),
title: '待提货',
functionName: 'KillTheRecord',
value:1
},
{
logo: require('../../static/ywc@2x.png'),
title: '已完成',
functionName: 'ultramanVehicle',
value:2
},
{
logo: require('../../static/tk@2x.png'),
title: '退款/售后',
functionName: 'goCollect',
value:99
}
],
titleStyle: {}
}
},
created() {
this.init()
},
onShow() {
this.myInfo()
},
//下拉刷新
onPullDownRefresh() {
this.myInfo()
},
filters: {
filterPhone(str) {
if (!str) return ' '
let enStr = str.slice(0, 3) + '****' + str.slice(str.length - 4);
return enStr
}
},
computed:{
accountBalance(){
return this.integral.accountBalance?Number(this.integral.accountBalance).toFixed(0):0
}
},
methods: {
goList(item){
uni.navigateTo({
url:`/Order/pages/index/index?orderStatus=${item.value}`
})
},
myInfo() {
homeApi.myInfo().then(res => {
if(res.code==20000){
this.integral = res.data;
uni.setStorageSync('user',Object.assign(this.user,{integral:this.integral}));
this.user = uni.getStorageSync('user');
}
}).finally(res=>{
uni.stopPullDownRefresh();
})
},
othersClick({
url
}) {
if (url) {
uni.navigateTo({
url
})
}
},
goSeting() {
uni.navigateTo({
url: "/Seting/pages/index/index"
})
},
goOrder() {
uni.navigateTo({
url: "/Order/pages/index/index"
})
},
ultramanVehicle() {
uni.navigateTo({
url: '/ChargingStation/pages/vehicle/index'
})
},
goCollect() {
uni.navigateTo({
url: '/ChargingStation/pages/collect/index'
})
},
KillTheRecord() {
this.$emit('switchTabBar', 3)
},
login() {
if (!this.user) {
uni.clearStorageSync();
uni.reLaunch({
url: '/pages/login/index'
})
}
},
isEyeFn(e) {
e.isEye = !e.isEye;
console.log(e, 'isEyeFnisEyeFnisEyeFn')
},
// othersClick(e) {
// if (e.functionName) {
// this[e.functionName]()
// } else {
// uni.showToast({
// title: '功能暂未开放',
// icon: 'none'
// })
// }
// },
init() {
this.titleStyle = wx.getMenuButtonBoundingClientRect(); //获取高度
if (!this.user) {
this.others.pop();
}else{
}
},
async goM78() {
let res = await tool.loginOut();
if (res) {
uni.clearStorageSync();
uni.reLaunch({
url: '/pages/login/index'
})
}
}
}
}
</script>
<style lang="scss" scoped>
@import 'index.scss';
@import '../index/index.scss';
</style>

138
pages/personal/points.vue Normal file
View File

@@ -0,0 +1,138 @@
<template>
<view class="points-body">
<view class="card flex ac jc">
<view class="balance">{{Number(user.integral.accountBalance).toFixed(0)}}</view>
<view class="label"> 当前积分 </view>
</view>
<view v-for="(item,index) in list" :key="index" class="points-item flex ac">
<view class="points-item-left oneflex">
<view class="label">{{item.type|type}}</view>
<view class="time">{{item.createTime}}</view>
</view>
<view class="points-item-right">
{{item.type==3||item.type==2?'-':'+'}}{{Number(item.occurAmount).toFixed(2)}}
</view>
</view>
<uni-load-more :status="loadingType"></uni-load-more>
</view>
</template>
<script>
import pointsApi from "@/api/product.js"
export default {
data() {
return {
user: uni.getStorageSync('user'),
list: [],
page: {
"currentPage": 1,
"pageSize": 10,
"params": {
"orderStatus": ""
}
},
loadingType: 'more', //加载更多状态
pageData: null
}
},
filters: {
type(e) {
switch (Number(e)) {
case 1:
return "加油收入";
case 2:
return "加油退款";
case 3:
return "商品兑换";
case 4:
return "商品兑换退款";
default:
break;
}
}
},
onLoad() {
this.getList()
},
methods: {
onPullDownRefresh() {
this.page.currentPage = 1;
this.loadingType = 'more';
this.getList();
},
//加载更多
onReachBottom() {
this.page.currentPage += 1
this.getList();
},
async getList() {
if (this.loadingType === 'nomore') {
return;
};
await pointsApi.accountRecordByPage(this.page).then(res => {
if (res.code == 20000) {
this.list = this.page.currentPage != 1 ? this.list.concat(res.data.list) : res.data
.list;
this.loadingType = res.data.list.length < this.page.pageSize ? 'nomore' : 'more';
}
});
uni.stopPullDownRefresh()
},
}
}
</script>
<style lang="scss">
.points-body {
width: 100vw;
min-height: 100vh;
overflow: hidden;
padding-top: 357rpx;
background-color: #F2F2F2;
position: relative;
box-sizing: border-box;
.points-item {
background-color: #FFFFFF;
padding: 30rpx;
box-sizing: border-box;
border-bottom: solid 1rpx #F6F6F6;
.points-item-right {
color: #666666;
font-size: 28rpx;
}
.points-item-left {
.time {
font-size: 22rpx;
color: #999999;
}
.label {
color: #333333;
font-size: 28rpx;
margin-bottom: 15rpx;
}
}
}
.card {
width: 684rpx;
height: 337rpx;
background-color: #FE5439;
border-radius: 10rpx;
position: fixed;
top: 0;
left: 0;
right: 0;
margin: 10rpx auto;
color: #FFFFFF;
flex-direction: column;
.balance {
font-size: 64rpx;
font-weight: 600;
}
}
}
</style>