Commit 59a1608b by zhangzhen

细节优化

parent 5650f3cc
...@@ -73,3 +73,4 @@ export const getProtocol=(key)=>{ ...@@ -73,3 +73,4 @@ export const getProtocol=(key)=>{
let url=`/protocol/${key}` let url=`/protocol/${key}`
return http.get(url) return http.get(url)
} }
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
<script> <script>
import { import {
login, login,
register register,
getUserInfo
} from "@/api/index.js"; } from "@/api/index.js";
export default { export default {
...@@ -32,6 +33,13 @@ ...@@ -32,6 +33,13 @@
}; };
}, },
methods:{ methods:{
onGetUserInfoToSave(){
getUserInfo().then(res => {
if(res.data.code == 200){
uni.setStorageSync('userInfo',res.data.data)
}
})
},
open(){ open(){
let that = this; let that = this;
wx.login({ wx.login({
...@@ -45,6 +53,7 @@ ...@@ -45,6 +53,7 @@
data: res.data.data.token data: res.data.data.token
}) })
that.$emit('success') that.$emit('success')
that.onGetUserInfoToSave()
} else { } else {
uni.removeStorageSync('tokenHeaders') uni.removeStorageSync('tokenHeaders')
this.$refs.popupPhone.open(); this.$refs.popupPhone.open();
...@@ -84,6 +93,7 @@ ...@@ -84,6 +93,7 @@
success: (res) => { success: (res) => {
that.$emit('success') that.$emit('success')
this.$refs.popupPhone.close() this.$refs.popupPhone.close()
that.onGetUserInfoToSave()
} }
}) })
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<script> <script>
import { import {
register, register,
getUserInfo
} from "@/api/index.js"; } from "@/api/index.js";
export default { export default {
...@@ -34,6 +35,13 @@ ...@@ -34,6 +35,13 @@
} }
}, },
methods:{ methods:{
onGetUserInfoToSave(){
getUserInfo().then(res => {
if(res.data.code == 200){
uni.setStorageSync('userInfo',res.data.data)
}
})
},
onGetPhoneNumber(e){ onGetPhoneNumber(e){
let that = this; let that = this;
this.phoneCode = e.detail.code; this.phoneCode = e.detail.code;
...@@ -54,6 +62,7 @@ ...@@ -54,6 +62,7 @@
data: res.data.data.token, data: res.data.data.token,
success: (res) => { success: (res) => {
that.$emit('success') that.$emit('success')
that.onGetUserInfoToSave();
} }
}) })
} }
......
...@@ -366,13 +366,13 @@ ...@@ -366,13 +366,13 @@
}) })
}, },
onNavToOrder(item) { onNavToOrder(item) {
// if(item.isDirtyRoom >=1){ if(item.isDirtyRoom >=1){
// uni.showToast({ uni.showToast({
// icon:"none", icon:"none",
// title:'当前房间未保洁,无法预定,请选择其他房间' title:'当前房间未保洁,无法预定,请选择其他房间'
// }) })
// return return
// } }
uni.navigateTo({ uni.navigateTo({
url: `/pages/order/order?roomId=${item.id}` url: `/pages/order/order?roomId=${item.id}`
}) })
......
...@@ -237,7 +237,6 @@ ...@@ -237,7 +237,6 @@
}, },
onGetUserInfo() { onGetUserInfo() {
getUserInfo().then(res => { getUserInfo().then(res => {
console.log(res)
if(res.data.code == 200){ if(res.data.code == 200){
this.userInfo = res.data.data; this.userInfo = res.data.data;
this.userName = this.userInfo.phone.slice(-4); this.userName = this.userInfo.phone.slice(-4);
......
...@@ -7,12 +7,21 @@ ...@@ -7,12 +7,21 @@
<view class="part-right"> <view class="part-right">
<text <text
class="text-title text-xl text-bold">{{roomInfo.name||'凑角'}}{{roomInfo.roomType?'【'+roomTypeEnum[roomInfo.roomType]+'】':''}}</text> class="text-title text-xl text-bold">{{roomInfo.name||'凑角'}}{{roomInfo.roomType?'【'+roomTypeEnum[roomInfo.roomType]+'】':''}}</text>
<view class="status-icon-box">
<view v-if="roomInfo.isDirtyRoom >=1" class="status-icon-box">
<view class="status-box" :class="'status-box-1'">
<text>未保洁</text>
</view>
<image class="img" :src="assetsPath+'/fa_icon_1.png'" mode="widthFix"></image>
</view>
<view v-else class="status-icon-box">
<view class="status-box" :class="'status-box-'+roomInfo.status"> <view class="status-box" :class="'status-box-'+roomInfo.status">
<text>{{roomStatusEnum[roomInfo.status]}}</text> <text>{{roomStatusEnum[roomInfo.status]}}</text>
</view> </view>
<image class="img" :src="assetsPath+'/fa_icon_'+roomInfo.status+'.png'" mode="widthFix"></image> <image class="img" :src="assetsPath+'/fa_icon_'+roomInfo.status+'.png'" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="part-left"> <view class="part-left">
<image :src="roomInfo.images.length?roomInfo.images[0]: assetsPath+'/banner.jpg'" mode="widthFix"> <image :src="roomInfo.images.length?roomInfo.images[0]: assetsPath+'/banner.jpg'" mode="widthFix">
...@@ -921,6 +930,11 @@ ...@@ -921,6 +930,11 @@
// uni.hideLoading() // uni.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
this.computePriceInfo = res.data.data; this.computePriceInfo = res.data.data;
}else {
uni.showToast({
icon:"none",
title:res.data.msg
})
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment