客户信息及授权

This commit is contained in:
Vinjor 2024-10-14 18:36:20 +08:00
parent 6ad7a2ea20
commit dccf1d0bde
7 changed files with 13 additions and 57 deletions

View File

@ -34,8 +34,7 @@
<script>
import VNavigationBar from '@/components/VNavigationBar.vue'
import request from "@/utils/request";
import {getUserInfoRequest} from "@/utils/common.js";
import {getToken,setUserInfo,getUserInfo} from '@/utils/auth.js'
import {getToken,getUserInfo} from '@/utils/auth'
export default {
components: {
VNavigationBar,
@ -75,14 +74,8 @@ export default {
url: '/pages/login/login'
})
}else{
console.log("已登录")
if(!getUserInfo()){
console.log("没有用户信息")
this.getUserInfos()
}else{
this.customInfo = JSON.parse(getUserInfo())
this.getActive()
}
//
this.customInfo = JSON.parse(getUserInfo())
}
},
onLoad(data) {
@ -118,24 +111,6 @@ export default {
console.log("index",this.index)
this.joinKkylAct()
},
//
async getUserInfos() {
request({
url: "/userClient/customer/getUserCustomer",
method: 'get',
params:{}
}).then(res=>{
if(!res.data){
uni.reLaunch({
url: '/pages/my/register'
})
}else{
setUserInfo(JSON.stringify(res.data))
this.customInfo = res.data
this.getActive()
}
})
},
//
async getActive() {
this.activeList=[]
@ -239,7 +214,6 @@ export default {
uni.showToast({
title:'支付成功'
})
this.getUserInfos()
}
// res.errMsg = 'requestPayment:ok'
},

View File

@ -6,7 +6,7 @@
<view class="date">{{ item.commentTime }}</view>
<view class="message">
<!-- 这家修理厂的喷漆工艺非常不错特别均匀师傅也很细心如果您需要做喷漆或者维修服务不要错过这里-->
{{item.commentDesc}}
{{item.commentDesc || "未输入评价内容"}}
</view>
<view class="rate">
<!-- 设置尺寸大小 -->

View File

@ -124,6 +124,7 @@
}
},
onShow() {
this.cancelReservation()
this.getServer()
},
methods: {

View File

@ -36,6 +36,9 @@
<view class="cardLabel">余额</view>
</view>
</view>
<view class="no-data" v-if="customInfo.couponList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
<!-- <view class="cardItemBottom">-->
<!-- <view class="useSm">使用说明</view>-->
<!-- <view class="useBtn">去使用</view>-->
@ -239,5 +242,8 @@
bottom: 2rpx;
transform: translate(-50%, 0);
}
.no-data{
text-align: center;
}
}
</style>

View File

@ -67,8 +67,7 @@
import tabBarVue from '@/components/tabBar/tabBar.vue'
import request from "@/utils/request";
import config from '@/config'
import {getUserInfoRequest} from "@/utils/common.js";
import {getToken,setUserInfo,getUserInfo} from '@/utils/auth'
import {getToken,getUserInfo} from '@/utils/auth'
export default {
components: {
tabBarVue,
@ -113,23 +112,6 @@
url: '/pages/my/myEquity'
})
},
//
async getServer() {
request({
url: "/userClient/customer/getUserCustomer",
method: 'get',
params:{}
}).then(res=>{
if(!res.data){
uni.reLaunch({
url: '/pages/my/register'
})
}else{
setUserInfo(JSON.stringify(res.data))
this.customInfo = res.data
}
})
}
}
}
</script>

View File

@ -29,7 +29,6 @@
import VNavigationBar from '@/components/VNavigationBar.vue';
import request from "../../utils/request";
import config from "config";
import {getUserInfoRequest} from "@/utils/common";
import {getToken,setJSONData} from '@/utils/auth'
export default {

View File

@ -21,8 +21,7 @@
import tabBarVue from '@/components/tabBar/tabBar.vue'
import reservationOrderVue from '../../components/reservationOrder/reservationOrder.vue'
import request from "@/utils/request";
import {getUserInfoRequest} from "@/utils/common.js";
import {getToken,setUserInfo} from '@/utils/auth.js'
import {getToken} from '@/utils/auth.js'
export default {
components: {
@ -57,15 +56,10 @@
})
}else{
console.log("已登录")
this.getUserInfos()
}
this.getBookingPage()
},
methods: {
//
async getUserInfos() {
getUserInfoRequest()
},
async getBookingPage(){
const res = await request({
url: "/userClient/repair/booking/page",