客户信息及授权

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

View File

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

View File

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

View File

@ -36,6 +36,9 @@
<view class="cardLabel">余额</view> <view class="cardLabel">余额</view>
</view> </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="cardItemBottom">-->
<!-- <view class="useSm">使用说明</view>--> <!-- <view class="useSm">使用说明</view>-->
<!-- <view class="useBtn">去使用</view>--> <!-- <view class="useBtn">去使用</view>-->
@ -239,5 +242,8 @@
bottom: 2rpx; bottom: 2rpx;
transform: translate(-50%, 0); transform: translate(-50%, 0);
} }
.no-data{
text-align: center;
}
} }
</style> </style>

View File

@ -67,8 +67,7 @@
import tabBarVue from '@/components/tabBar/tabBar.vue' import tabBarVue from '@/components/tabBar/tabBar.vue'
import request from "@/utils/request"; import request from "@/utils/request";
import config from '@/config' import config from '@/config'
import {getUserInfoRequest} from "@/utils/common.js"; import {getToken,getUserInfo} from '@/utils/auth'
import {getToken,setUserInfo,getUserInfo} from '@/utils/auth'
export default { export default {
components: { components: {
tabBarVue, tabBarVue,
@ -113,23 +112,6 @@
url: '/pages/my/myEquity' 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> </script>

View File

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

View File

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