客户信息及授权
This commit is contained in:
parent
6ad7a2ea20
commit
dccf1d0bde
@ -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'
|
||||
},
|
||||
|
@ -6,7 +6,7 @@
|
||||
<view class="date">{{ item.commentTime }}</view>
|
||||
<view class="message">
|
||||
<!-- 这家修理厂的喷漆工艺非常不错,特别均匀,师傅也很细心。如果您需要做喷漆或者维修服务,不要错过这里!-->
|
||||
{{item.commentDesc}}
|
||||
{{item.commentDesc || "未输入评价内容"}}
|
||||
</view>
|
||||
<view class="rate">
|
||||
<!-- 设置尺寸大小 -->
|
||||
|
@ -124,6 +124,7 @@
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.cancelReservation()
|
||||
this.getServer()
|
||||
},
|
||||
methods: {
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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 {
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user