From bae2beec8781b49f9cde941d41dd724b2074fe4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Wed, 28 Jul 2021 14:58:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/js/config.js | 2 +- pages/index/index.js | 20 ++++++++++++++++++++ pages/index/index.wxml | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/commons/js/config.js b/commons/js/config.js index b1f8080..00dd24d 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -1,4 +1,4 @@ -const env = "d"; +const env = "p"; const version = 1, diff --git a/pages/index/index.js b/pages/index/index.js index 71559c3..d879141 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -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 => { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index f521ab9..059afae 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -5,7 +5,7 @@ - Hi~ 店长好!欢迎回到狸车宝! + Hi~ {{hoursTip}}欢迎回到狸车宝! {{userInfo.uname}} {{userInfo.biz_name}}