时间判断
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const env = "d";
|
||||
const env = "p";
|
||||
|
||||
const version = 1,
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Page({
|
||||
imgUrl:_.config.imgUrl,
|
||||
userCal:'',
|
||||
deallist:'',
|
||||
hoursTip:'',
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -20,8 +21,27 @@ Page({
|
||||
|
||||
onShow: function () {
|
||||
this.getAppUserCal()
|
||||
this.getHoursTip()
|
||||
},
|
||||
|
||||
|
||||
//候取时间
|
||||
getHoursTip(){
|
||||
let hoursTip = '';
|
||||
let date=new Date();
|
||||
if(date.getHours()>=0&&date.getHours()<12){
|
||||
hoursTip="上午好!"
|
||||
}else if(date.getHours()>=12&&date.getHours()<18){
|
||||
hoursTip="下午好!"
|
||||
}else{
|
||||
hoursTip="晚上好!"
|
||||
}
|
||||
this.setData({
|
||||
hoursTip:hoursTip
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//获取用户信息
|
||||
getUserInfo(){
|
||||
_.apiQuery.getUserInfo().then(res => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<open-data type="userAvatarUrl"></open-data>
|
||||
</view>
|
||||
<view>
|
||||
<view class="font-22 color-fff">Hi~ 店长好!欢迎回到狸车宝!</view>
|
||||
<view class="font-22 color-fff">Hi~ {{hoursTip}}欢迎回到狸车宝!</view>
|
||||
<view>
|
||||
<text class="text-middle text-bold font-48 color-fff">{{userInfo.uname}}</text>
|
||||
<text class="inline-block ml10 pl10 pr10 bg-fff text-middle font-18 ulib-r750">{{userInfo.biz_name}}</text>
|
||||
|
||||
Reference in New Issue
Block a user