Commit 59a1608b by zhangzhen

细节优化

parent 5650f3cc
......@@ -73,3 +73,4 @@ export const getProtocol=(key)=>{
let url=`/protocol/${key}`
return http.get(url)
}
......@@ -21,7 +21,8 @@
<script>
import {
login,
register
register,
getUserInfo
} from "@/api/index.js";
export default {
......@@ -32,6 +33,13 @@
};
},
methods:{
onGetUserInfoToSave(){
getUserInfo().then(res => {
if(res.data.code == 200){
uni.setStorageSync('userInfo',res.data.data)
}
})
},
open(){
let that = this;
wx.login({
......@@ -45,6 +53,7 @@
data: res.data.data.token
})
that.$emit('success')
that.onGetUserInfoToSave()
} else {
uni.removeStorageSync('tokenHeaders')
this.$refs.popupPhone.open();
......@@ -84,6 +93,7 @@
success: (res) => {
that.$emit('success')
this.$refs.popupPhone.close()
that.onGetUserInfoToSave()
}
})
}
......
......@@ -13,6 +13,7 @@
<script>
import {
register,
getUserInfo
} from "@/api/index.js";
export default {
......@@ -34,6 +35,13 @@
}
},
methods:{
onGetUserInfoToSave(){
getUserInfo().then(res => {
if(res.data.code == 200){
uni.setStorageSync('userInfo',res.data.data)
}
})
},
onGetPhoneNumber(e){
let that = this;
this.phoneCode = e.detail.code;
......@@ -54,6 +62,7 @@
data: res.data.data.token,
success: (res) => {
that.$emit('success')
that.onGetUserInfoToSave();
}
})
}
......
......@@ -366,13 +366,13 @@
})
},
onNavToOrder(item) {
// if(item.isDirtyRoom >=1){
// uni.showToast({
// icon:"none",
// title:'当前房间未保洁,无法预定,请选择其他房间'
// })
// return
// }
if(item.isDirtyRoom >=1){
uni.showToast({
icon:"none",
title:'当前房间未保洁,无法预定,请选择其他房间'
})
return
}
uni.navigateTo({
url: `/pages/order/order?roomId=${item.id}`
})
......
......@@ -237,7 +237,6 @@
},
onGetUserInfo() {
getUserInfo().then(res => {
console.log(res)
if(res.data.code == 200){
this.userInfo = res.data.data;
this.userName = this.userInfo.phone.slice(-4);
......
......@@ -7,12 +7,21 @@
<view class="part-right">
<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">
<text>{{roomStatusEnum[roomInfo.status]}}</text>
</view>
<image class="img" :src="assetsPath+'/fa_icon_'+roomInfo.status+'.png'" mode="widthFix"></image>
</view>
</view>
<view class="part-left">
<image :src="roomInfo.images.length?roomInfo.images[0]: assetsPath+'/banner.jpg'" mode="widthFix">
......@@ -921,6 +930,11 @@
// uni.hideLoading()
if (res.data.code == 200) {
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