zhaoxiaohai 3 years ago
parent
commit
cdb77c203f

+ 1 - 1
components/My_navBar/index.js

@@ -17,7 +17,7 @@ Component({
             setTimeout(() => {
                 let data = getApp().globalData.account_list[wx.getStorageSync('userData').index];
                 let userName = '';
-                (data.fagentname != null && data.fagentname != undefined) ? userName = data.fagentname + '-': userName = data.fname + '-'
+                (data.fbrand != null && data.fbrand != undefined) ? userName = data.fbrand + '-': userName = data.fname + '-'
                 userName += data.frole;
                 console.log(userName)
                 that.setData({

+ 4 - 3
pages/storeMessage/index.wxml

@@ -14,7 +14,7 @@
         </My_GreyRectangleForm>
 
         <My_GreyRectangleForm title="经营类目" required>
-            <view class="manage u-line-1 {{showSaleprodclass==''?'ismanage':''}}" bindtap="showPop">{{showSaleprodclass==''?'点击选择':showSaleprodclass}}</view>
+            <view class="manage u-line-1 {{showSaleprodclass==''?'ismanage':''}}" style="opacity: {{isDisabled?'0.3':'1'}};" bindtap="showPop">{{showSaleprodclass==''?'点击选择':showSaleprodclass}}</view>
         </My_GreyRectangleForm>
 
         <My_GreyRectangleForm title="联系人" required>
@@ -30,8 +30,9 @@
         </My_GreyRectangleForm>
         <import src="/wxParse/wxParse" />
         <My_GreyRectangleForm title="公司介绍" required>
-            <view style="width: 400rpx;">
-                <template is="wxParse" data="{{wxParseData:article.nodes}}" />
+            <view style="width: 400rpx; text-align: right;">
+                编辑/预览
+                <!-- <template is="wxParse" data="{{wxParseData:article.nodes}}" /> -->
             </view>
             <!-- <van-field autosize type="textarea" disabled="{{isDisabled}}" model:value="{{ fintroduction }}" data-name="fintroduction" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fintroduction}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" /> -->
         </My_GreyRectangleForm>

+ 52 - 2
pages/tabbar-pages/message/index.js

@@ -93,13 +93,63 @@ Page({
                 "ftype": type
             }
         }).then(res => {
-            console.log(res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: 'none'
             });
+            let data = res.data,
+                date = new Date(),
+                opt = {
+                    "Y": date.getFullYear().toString(), // 年
+                    "m": (date.getMonth() + 1).toString(), // 月
+                    "d": date.getDate().toString(), // 日
+                    "H": date.getHours().toString(), // 时
+                    "M": date.getMinutes().toString(), // 分
+                    "S": date.getSeconds().toString() // 秒
+                };
+            for (let i = 0; i < data.length; i++) {
+                let arr = data[i].createdate.split(' '),
+                    YmD = arr[0].split('-'), //年月日
+                    HM = arr[1].slice(0, arr[1].lastIndexOf(':')), //小时,分钟
+                    optm = parseInt(opt.m),
+                    m = parseInt(YmD[1]),
+                    optd = parseInt(opt.d),
+                    d = parseInt(YmD[2])
+
+                //同年
+                if (parseInt(opt.Y) == parseInt(YmD[0])) {
+                    if (opt.m > 10) opt.m = "0" + opt.m;
+                    //同月
+                    if (optm == m) {
+                        if (optd == d) {
+                            data[i].time = '今天 ' + HM;
+                        } else if (optd - d == 1) {
+                            data[i].time = '昨天 ' + HM;
+                        } else if (optd - d == 2) {
+                            data[i].time = '前天 ' + HM;
+                        } else if (optd - d >= 3) {
+                            data[i].time = '三天前'
+                        } else if (optd - d >= 7) {
+                            data[i].time = '七天前'
+                        }
+                    } else {
+                        //不同月
+                        if (optm - m == 1) {
+                            data[i].time = '1月前'
+                        } else if (optm - m == 2) {
+                            data[i].time = '2月前'
+                        } else if (optm - m >= 3 && opt.m - YmD[1] < 6) {
+                            data[i].time = '3月前'
+                        } else if (optm - m >= 6) {
+                            data[i].time = '半年前'
+                        }
+                    }
+                } else {
+                    data[i].time = YmD[0] + '年'
+                }
+            };
             this.setData({
-                msgList: res.data,
+                msgList: data,
                 pageTotal: res.pageTotal
             })
         })

+ 1 - 1
pages/tabbar-pages/message/index.wxml

@@ -23,7 +23,7 @@
                     <view class="msg u-line-1">{{item.fmessage}}</view>
                 </view>
                 <view class="msgTime">
-                    上午9:34
+                    {{item.time}}
                 </view>
             </view>
         </navigator>

+ 1 - 1
pages/userCenter/index.wxml

@@ -42,7 +42,7 @@
         <My_GreyRectangleForm title="生日">
             <!-- 时间选择 -->
             <picker value="{{fbirthdate}}" mode="date" start="1921-01-01" end="{{YMD}}" bindchange="timeChange">
-                <view class="picker">
+                <view class="picker" style="opacity: {{fbirthdate!=null?'1':'0.3'}};">
                     {{fbirthdate!=null?fbirthdate:'选择日期'}}
                     <van-icon name="arrow" />
                 </view>

+ 4 - 0
pages/userCenter/index.wxss

@@ -52,4 +52,8 @@
 .changeImage {
     font-size: 32rpx;
     color: #333333;
+}
+
+.fbirthdate {
+    color: #323233 !important;
 }