zlisen пре 3 година
родитељ
комит
44c94fd7a5

+ 2
- 2
config/dev.js Прегледај датотеку

@@ -3,8 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 5
   defineConstants: {
6
-    // HOST: '"https://xlk.njyz.tech"',
7
-    HOST: '"http://127.0.0.1:8088"',
6
+    HOST: '"https://xlk.njyz.tech"',
7
+    // HOST: '"http://127.0.0.1:8088"',
8 8
     WSS_HOST: '"wss://xlk.njyz.tech"',
9 9
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10 10
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',

+ 229
- 54
src/pages/index/activityDetail/index.jsx Прегледај датотеку

@@ -1,101 +1,276 @@
1
-import { useState, useEffect } from 'react'
2
-import withLayout from '@/layout'
3
-import { ScrollView, Image } from '@tarojs/components'
4
-import '@/assets/css/iconfont.css'
5
-import './index.scss'
1
+import { useState, useEffect } from "react";
2
+import Taro, { useDidShow, useReady } from "@tarojs/taro";
3
+import withLayout from "@/layout";
4
+import {
5
+  Text,
6
+  View,
7
+  Picker,
8
+  Input,
9
+  ScrollView,
10
+  Image,
11
+  RichText,
12
+} from "@tarojs/components";
13
+import "@/assets/css/iconfont.css";
14
+import "./index.scss";
15
+import {
16
+  // addActivityShareNum,
17
+  signupActivity,
18
+  favorActivity,
19
+  cancelFavorActivity,
20
+  queryActivityDetail,
21
+} from "@/services/activity";
22
+import { getImgURL } from "@/utils/image";
23
+import getDateFormat from "@/utils/chatDate";
6 24
 
7
-export default withLayout(() => {
25
+const activityStatusDict = {
26
+  0: {
27
+    text: "立即参与",
28
+    className: "yellow",
29
+  },
30
+  1: {
31
+    text: "未开始",
32
+    className: "blue",
33
+  },
34
+  2: {
35
+    text: "已结束",
36
+    className: "grey",
37
+  },
38
+  3: {
39
+    text: "已参与",
40
+    className: "yellow",
41
+  },
42
+};
8 43
 
9
-  const [IsPull, setPull] = useState(false)
10
-  const [PullTimer, setPullTimer] = useState(null)
44
+export default withLayout((props) => {
45
+  console.log(props, "props");
46
+  const { id } = props.router.params;
47
+  const [detail, setDetail] = useState({});
48
+  const [canChoose, setCanChoose] = useState("none");
11 49
 
12
-  const PageRefresh = () => { // 页面下拉刷新回调
13
-    setPull(true)
14
-  }
50
+  const [IsPull, setPull] = useState(false);
51
+  const [PullTimer, setPullTimer] = useState(null);
15 52
 
16
-  useEffect(() => { // 下拉刷新触发
53
+  const PageRefresh = () => {
54
+    // 页面下拉刷新回调
55
+    setPull(true);
56
+  };
57
+
58
+  useEffect(() => {
59
+    // 下拉刷新触发
17 60
     if (IsPull) {
18
-      clearTimeout(PullTimer)
19
-      setPullTimer(setTimeout(() => {
20
-        setPull(false)
21
-      }, 2000))
61
+      clearTimeout(PullTimer);
62
+      setPullTimer(
63
+        setTimeout(() => {
64
+          setPull(false);
65
+        }, 2000)
66
+      );
67
+    }
68
+  }, [IsPull]);
69
+
70
+  const getDetail = (params) => {
71
+    Taro.showLoading();
72
+
73
+    queryActivityDetail(params).then((res) => {
74
+      console.log(res, "queryActivityDetail");
75
+      setDetail(res);
76
+
77
+      Taro.hideLoading();
78
+    });
79
+  };
80
+
81
+  useEffect(() => {
82
+    if (id) {
83
+      getDetail(id);
84
+    }
85
+  }, [id]);
86
+
87
+  useReady(() => {
88
+    console.log("Taro.showLoading()");
89
+  });
90
+
91
+  useDidShow(() => {
92
+    // Taro.getCurrentPages()
93
+    console.log("Taro.showLoading()");
94
+
95
+    // console.log(Taro.getCurrentPages(),'Taro.showLoading()')
96
+    // getDetail()
97
+  });
98
+
99
+  //收藏
100
+  const handleFavo = () => {
101
+    const { dynamicId, isSaved } = detail;
102
+    if (isSaved) {
103
+      cancelFavorActivity(dynamicId).then((res) => {
104
+        Taro.showToast({
105
+          title: "已取消收藏",
106
+        });
107
+        setDetail({
108
+          ...detail,
109
+          isSaved: 0,
110
+        });
111
+      });
112
+    } else {
113
+      favorActivity(dynamicId).then((res) => {
114
+        Taro.showToast({
115
+          title: "收藏成功",
116
+        });
117
+        setDetail({
118
+          ...detail,
119
+          isSaved: 1,
120
+        });
121
+      });
122
+    }
123
+    // savePoint({
124
+    //   event: 'save',
125
+    //   eventType: 'activity',
126
+    //   targetType: 'dynamic',
127
+    //   propertyName: '活动详情收藏',
128
+    //   data: '{}'
129
+    // }).then(res => {
130
+    //   console.log('活动详情收藏')
131
+    // })
132
+  };
133
+
134
+  const handleSignup = () => {
135
+    const {
136
+      detail: { buildingId, dynamicId, isSign },
137
+    } = this.state;
138
+    const {
139
+      userInfo: {
140
+        person: { phone, name, nickname },
141
+      },
142
+    } = this.props;
143
+
144
+    if (isSign) {
145
+      Taro.showToast({
146
+        icon: "none",
147
+        title: "你已报名成功",
148
+      });
149
+      return;
22 150
     }
23
-  }, [IsPull])
151
+
152
+    this.setState({
153
+      canChoose: "block",
154
+    });
155
+  };
24 156
 
25 157
   return (
26
-    <view className='Page activityDetail flex-v'>
27
-      <view className='flex-item'>
158
+    <view className="Page activityDetail flex-v">
159
+      <view className="flex-item">
28 160
         <view>
29
-          <ScrollView scroll-y refresher-enabled refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#fff'>
30
-            <view className='PageContent'>
31
-
32
-              <view className='Top'>
33
-                <Image mode='aspectFill' src={null} className='centerLabel'></Image>
161
+          <ScrollView
162
+            scroll-y
163
+            refresher-enabled
164
+            refresher-triggered={IsPull}
165
+            onrefresherrefresh={PageRefresh}
166
+            refresher-background="#fff"
167
+          >
168
+            <view className="PageContent">
169
+              <view className="Top">
170
+                <Image
171
+                  mode="aspectFill"
172
+                  src={getImgURL(detail.bannerListImg)}
173
+                  className="centerLabel"
174
+                ></Image>
34 175
               </view>
35 176
 
36
-              <view className='Info'>
177
+              <view className="Info">
37 178
                 <view>
38
-                  <view className='Title flex-h'>
39
-                    <view className='flex-item'>
40
-                      <text>换了套圈圈福利 快来参加吧</text>
179
+                  <view className="Title flex-h">
180
+                    <view className="flex-item">
181
+                      <text>{detail.title}</text>
41 182
                     </view>
42
-                    <text className='Tips'>17人已报名</text>
183
+                    <text className="Tips">{detail.enlisted || 0}人已报名</text>
43 184
                   </view>
44
-                  <text className='Time'>报名截止时间:2019-07-19 12:00</text>
45
-                  <text className='Name'>“香颂 · 蔚澜半岛”</text>
46
-                  <view className='flex-h Address'>
185
+                  <text className="Time">
186
+                    报名截止时间:
187
+                    {getDateFormat(
188
+                      new Date(detail.enlistEnd).valueOf(),
189
+                      true,
190
+                      "yyyy/M/d"
191
+                    )}
192
+                  </text>
193
+                  {/* <text className="Name">“香颂 · 蔚澜半岛”</text> */}
194
+                  <view className="flex-h Address">
47 195
                     <text>地址:</text>
48
-                    <view className='flex-item'>
49
-                      <text>江苏省南京市奥体大厦1楼</text>
196
+                    <view className="flex-item">
197
+                      <text>{detail.address}</text>
50 198
                     </view>
51 199
                   </view>
52
-                  <view className='flex-h Date'>
200
+                  <view className="flex-h Date">
53 201
                     <text>时间:</text>
54
-                    <view className='flex-item'>
55
-                      <text>2019/10/20 10:00 - 2019/10/22 10:00</text>
202
+                    <view className="flex-item">
203
+                      <text>
204
+                        {getDateFormat(
205
+                          new Date(detail.startDate).valueOf(),
206
+                          true,
207
+                          "yyyy/M/d"
208
+                        )}{" "}
209
+                        -{" "}
210
+                        {getDateFormat(
211
+                          new Date(detail.endDate).valueOf(),
212
+                          true,
213
+                          "yyyy/M/d"
214
+                        )}
215
+                      </text>
56 216
                     </view>
57 217
                   </view>
58
-                  <view className='Btn'>
218
+                  <view className="Btn">
59 219
                     <text>分享好友</text>
60 220
                   </view>
61 221
                 </view>
62 222
               </view>
63 223
 
64
-              <view className='ActivityIntro'>
65
-                <view className='Title'>
224
+              <view className="ActivityIntro">
225
+                <view className="Title">
66 226
                   <text>活动介绍</text>
67 227
                 </view>
228
+                <Image
229
+                  mode="aspectFill"
230
+                  src={getImgURL(detail.imgUrl)}
231
+                  className="img"
232
+                ></Image>
233
+                <RichText nodes={detail.desc} />
234
+                {/* <richText nodes={detail.desc} ></richText> */}
68 235
               </view>
69 236
 
70
-              <view className='Bottom'>
237
+              <view className="Bottom">
71 238
                 <view>
72 239
                   <view>
73
-                    <text className='iconfont icon-shengming'></text>
240
+                    <text className="iconfont icon-shengming"></text>
74 241
                     <text>免责声明</text>
75 242
                   </view>
76 243
                   <view>
77
-                    <text>&emsp;&emsp;以上价格仅供参考,具体一房一价的信息以售楼处展示为准。房屋位置交通、医疗、教育、商业等配套信息,来源于第三方不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。本平台对项目周边文化教育的介绍旨在提供相关信息1 意味着信息发布方对就学安排作出承诺。相关教育资首页信息存在调整的可能,应以政府教育主管部门门及办学颁布的政策规定为准。详情请仔细阅读</text>
78
-                    <text className='active'>《新联家使用免责条款》</text>
244
+                    <text>
245
+                      &emsp;&emsp;以上价格仅供参考,具体一房一价的信息以售楼处展示为准。房屋位置交通、医疗、教育、商业等配套信息,来源于第三方不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。本平台对项目周边文化教育的介绍旨在提供相关信息1
246
+                      意味着信息发布方对就学安排作出承诺。相关教育资首页信息存在调整的可能,应以政府教育主管部门门及办学颁布的政策规定为准。详情请仔细阅读
247
+                    </text>
248
+                    <text className="active">《新联家使用免责条款》</text>
79 249
                   </view>
80 250
                 </view>
81 251
               </view>
82
-
83 252
             </view>
84 253
           </ScrollView>
85 254
         </view>
86 255
       </view>
87
-      <view className='PageBottom flex-h'>
88
-        <view className='Share'>
89
-          <text className='iconfont icon-fenxiang'></text>
256
+      <view className="PageBottom flex-h">
257
+        <view className="Share">
258
+          <text className="iconfont icon-fenxiang"></text>
90 259
           <text>分享</text>
91 260
         </view>
92
-        <view className='Collect'>
93
-          <text className='iconfont icon-shoucang'></text>
261
+        <view className="Collect" onClick={handleFavo}>
262
+          <text
263
+            className="iconfont icon-shoucang"
264
+            style={detail.isSaved === 1 ? { color: "red" } : undefined}
265
+          ></text>
94 266
           <text>收藏</text>
95 267
         </view>
96
-        <view className='flex-item'></view>
97
-        <text className='Post'>立即报名</text>
268
+        <view className="flex-item"></view>
269
+
270
+        <text className="Post" onClick={handleSignup}>
271
+          {activityStatusDict[detail.activityStatus]?.text}
272
+        </text>
98 273
       </view>
99 274
     </view>
100
-  )
101
-})
275
+  );
276
+});

+ 5
- 0
src/pages/index/activityDetail/index.scss Прегледај датотеку

@@ -151,6 +151,11 @@
151 151
                 line-height: 40px;
152 152
               }
153 153
             }
154
+            >.img {
155
+              margin: auto;
156
+              display: block;
157
+              width: 690px;
158
+            }
154 159
           }
155 160
           >.Bottom {
156 161
             padding: 0 30px 30px;

+ 22
- 3
src/pages/index/activityList/index.jsx Прегледај датотеку

@@ -1,11 +1,16 @@
1 1
 import { useState, useEffect } from 'react'
2
+import { useDidShow,useRouter } from '@tarojs/taro'
2 3
 import { ScrollView } from '@tarojs/components'
4
+import { queryActivityList, getActNewList } from '@/services/activity'
3 5
 import './index.scss'
4 6
 import ActivityListItem from '../components/ActivityListItem/index'
5 7
 
6 8
 export default function MyCollectForActivity (props) {
7
-  const { Data = {} } = props
8
-  const [PageList, setPageList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', ''])
9
+ 
10
+  const router=useRouter()
11
+  console.log(router,'MyCollectForActivity')
12
+   const { type } = router.params;
13
+  const [PageList, setPageList] = useState([])
9 14
   const [IsPull, setPull] = useState(false)
10 15
   const [PullTimer, setPullTimer] = useState(null)
11 16
 
@@ -22,6 +27,20 @@ export default function MyCollectForActivity (props) {
22 27
     }
23 28
   }, [IsPull])
24 29
 
30
+
31
+
32
+ const getList = (params) => {
33
+  queryActivityList({...params,type}).then((res)=>{
34
+    console.log(res,'-----------------')
35
+    setPageList(res.list)
36
+  })
37
+  }
38
+  useDidShow(() => {
39
+    getList({page :0, pageSize : 10})
40
+  })
41
+
42
+ 
43
+
25 44
   return (
26 45
     <view className='components activityList'>
27 46
       <ScrollView scroll-y refresher-enabled refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#f8f8f8'>
@@ -29,7 +48,7 @@ export default function MyCollectForActivity (props) {
29 48
           <view className='List'>
30 49
             {
31 50
               PageList.map((item, index) => (
32
-                <ActivityListItem Data={item} key={`ActivityListItem-${index}`}></ActivityListItem>
51
+                <ActivityListItem data={item} key={`ActivityListItem-${index}`}></ActivityListItem>
33 52
               ))
34 53
             }
35 54
           </view>

+ 28
- 6
src/pages/index/components/ActivityListItem/index.jsx Прегледај датотеку

@@ -2,23 +2,45 @@ import React, { useState, useEffect } from 'react'
2 2
 import './index.scss'
3 3
 import { Image } from '@tarojs/components'
4 4
 import Taro from '@tarojs/taro'
5
+import { getImgURL } from '@/utils/image'
6
+import getDateFormat from '@/utils/chatDate'
5 7
 
8
+const activityStatusDict={
9
+  0:{
10
+    text:'立即参与',
11
+    className:'yellow'
12
+  },
13
+  1:{
14
+    text:'未开始',
15
+    className:'blue'
16
+  },
17
+  2:{
18
+    text:'已结束',
19
+    className:'grey'
20
+  },
21
+  3:{
22
+    text:'已参与',
23
+    className:'yellow'
24
+  }
25
+}
6 26
 export default function ActivityListItem (props) {
7
-  const { Data = {} } = props
27
+  const { data = {} } = props
28
+  console.log(props,'ActivityListItem')
8 29
   return (
9
-    <view className='components ActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.id}` }) }}>
30
+    <view className='components ActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${data.dynamicId}` }) }}>
10 31
       <view className='Img'>
11
-        <Image mode='aspectFill' src={null} className='centerLabel'></Image>
32
+        <Image mode='aspectFill' src={getImgURL(data.listImgUrl)} className='centerLabel'></Image>
12 33
       </view>
13 34
       <view className='Info'>
14 35
         <view className='Name flex-h'>
15 36
           <view className='flex-item'>
16
-            <text>5D沉浸式剧场</text>
37
+            <text>{data.title}</text>
17 38
           </view>
18
-          <text className='yellow'>立即参与</text>
39
+          <text className={activityStatusDict[data.activityStatus]?.className}>{activityStatusDict[data.activityStatus]?.text}</text>
19 40
         </view>
20 41
         <view className='Time'>
21
-          <text>活动时间:2019/10/20 10:00 - 2019/10/22 10:00</text>
42
+          {console.log(new Date(data.startDate).valueOf(),'new Date(data.startDate )')}
43
+          <text>活动时间:{getDateFormat(new Date(data.startDate).valueOf(),true,'yyyy/M/d')} - {getDateFormat(new Date(data.endDate).valueOf(),true,'yyyy/M/d')}</text>
22 44
         </view>
23 45
       </view>
24 46
     </view>

+ 3
- 0
src/pages/index/components/ActivityListItem/index.scss Прегледај датотеку

@@ -48,6 +48,9 @@
48 48
         &.blue {
49 49
           background: #193C83;
50 50
         }
51
+        &.grey {
52
+          background: #B9B2B2;
53
+        }
51 54
       }
52 55
     }
53 56
     >.Time {

+ 2
- 2
src/pages/index/components/Menu/index.jsx Прегледај датотеку

@@ -11,8 +11,8 @@ export default function Menu (props) {
11 11
     { name: '帮我找房', id: 4, icon: require('../../../../assets/index-icon1.png'), router: '/pages/index/helpToFindHouse/index' },
12 12
     { name: '增值服务', id: 5, icon: require('../../../../assets/index-icon16.png'), router: '/pages/index/addedValueService/index' },
13 13
     { name: '地图找房', id: 6, icon: require('../../../../assets/index-icon2.png'), router: '/pages/index/findHouseFromMap/index' },
14
-    { name: '活动信息', id: 7, icon: require('../../../../assets/index-icon5.png'), router: '/pages/index/activityList/index' },
15
-    { name: '团房信息', id: 8, icon: require('../../../../assets/index-icon12.png'), router: `/pages/index/activityList/index?type=2` },
14
+    { name: '活动信息', id: 7, icon: require('../../../../assets/index-icon5.png'), router: '/pages/index/activityList/index?type=dymic' },
15
+    { name: '团房信息', id: 8, icon: require('../../../../assets/index-icon12.png'), router: '/pages/index/activityList/index?type=house' },
16 16
     { name: '特价房', id: 9, icon: require('../../../../assets/index-icon11.png'), router: '/pages/index/specialPriceHouse/index' },
17 17
     { name: '康养', id: 10, icon: require('../../../../assets/index-icon7.png'), router: '/pages/index/recovered/index' },
18 18
     { name: '文旅商办', id: 11, icon: require('../../../../assets/index-icon13.png'), router: '/pages/index/culturalAndBusiness/index' },

+ 129
- 0
src/utils/chatDate.js Прегледај датотеку

@@ -0,0 +1,129 @@
1
+/**
2
+* 对Date的扩展,将 Date 转化为指定格式的String。
3
+*
4
+*  月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
5
+*  年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)。
6
+*
7
+*  【示例】:
8
+*  common.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss.S') ==> 2006-07-02 08:09:04.423
9
+*  common.formatDate(new Date(), 'yyyy-M-d h:m:s.S')      ==> 2006-7-2 8:9:4.18
10
+*  common.formatDate(new Date(), 'hh:mm:ss.S')            ==> 08:09:04.423
11
+*  
12
+*/
13
+
14
+//例子 getDateFormat(new Date().valueOf(),true,'yyyy/M/d')
15
+var _formatDate = function (date, fmt) {
16
+  var o = {
17
+    "M+": date.getMonth() + 1, //月份
18
+    "d+": date.getDate(), //日
19
+    "h+": date.getHours(), //小时
20
+    "m+": date.getMinutes(), //分
21
+    "s+": date.getSeconds(), //秒
22
+    "q+": Math.floor((date.getMonth() + 3) / 3), //季度
23
+    "S": date.getMilliseconds() //毫秒
24
+  };
25
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
26
+  for (var k in o)
27
+    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
+  return fmt;
29
+};
30
+
31
+/**
32
+* 仿照微信中的消息时间显示逻辑,将时间戳(单位:毫秒)转换为友好的显示格式.
33
+*
34
+* 1)7天之内的日期显示逻辑是:今天、昨天(-1d)、前天(-2d)、星期?(只显示总计7天之内的星期数,即<=-4d);
35
+* 2)7天之外(即>7天)的逻辑:直接显示完整日期时间。
36
+*
37
+* @param  {[long]} timestamp 时间戳(单位:毫秒),形如:1550789954260
38
+* @param {boolean} mustIncludeTime true表示输出的格式里一定会包含“时间:分钟”
39
+* ,否则不包含(参考微信,不包含时分的情况,用于首页“消息”中显示时)
40
+*
41
+* @return {string} 输出格式形如:“刚刚”、“10:30”、“昨天 12:04”、“前天 20:51”、“星期二”、“2019/2/21 12:09”等形式
42
+* @since 1.1
43
+*/
44
+export default function getDateFormat(timestamp, mustIncludeTime,format='yyyy-M-d') {
45
+
46
+  // 当前时间
47
+  var currentDate = new Date();
48
+  // 目标判断时间
49
+  var srcDate = new Date(parseInt(timestamp));
50
+
51
+  var currentYear = currentDate.getFullYear();
52
+  var currentMonth = (currentDate.getMonth() + 1);
53
+  var currentDateD = currentDate.getDate();
54
+
55
+  var srcYear = srcDate.getFullYear();
56
+  var srcMonth = (srcDate.getMonth() + 1);
57
+  var srcDateD = srcDate.getDate();
58
+
59
+  var ret = "";
60
+
61
+  // 要额外显示的时间分钟
62
+  var timeExtraStr = (mustIncludeTime ? " " + _formatDate(srcDate, "hh:mm") : "");
63
+
64
+  // // 当年
65
+  // if (currentYear == srcYear) {
66
+  //   var currentTimestamp = currentDate.getTime();
67
+  //   var srcTimestamp = timestamp;
68
+  //   // 相差时间(单位:毫秒)
69
+  //   var deltaTime = (currentTimestamp - srcTimestamp);
70
+
71
+  //   // 当天(月份和日期一致才是)
72
+  //   if (currentMonth == srcMonth && currentDateD == srcDateD) {
73
+  //     // 时间相差60秒以内
74
+  //     if (deltaTime < 60 * 1000)
75
+  //       ret = "刚刚";
76
+  //     // 否则当天其它时间段的,直接显示“时:分”的形式
77
+  //     else
78
+  //       ret = _formatDate(srcDate, "hh:mm");
79
+  //   }
80
+  //   // 当年 && 当天之外的时间(即昨天及以前的时间)
81
+  //   else {
82
+  //     // 昨天(以“现在”的时候为基准-1天)
83
+  //     var yesterdayDate = new Date();
84
+  //     yesterdayDate.setDate(yesterdayDate.getDate() - 1);
85
+
86
+  //     // 前天(以“现在”的时候为基准-2天)
87
+  //     var beforeYesterdayDate = new Date();
88
+  //     beforeYesterdayDate.setDate(beforeYesterdayDate.getDate() - 2);
89
+
90
+  //     // 用目标日期的“月”和“天”跟上方计算出来的“昨天”进行比较,是最为准确的(如果用时间戳差值
91
+  //     // 的形式,是不准确的,比如:现在时刻是2019年02月22日1:00、而srcDate是2019年02月21日23:00,
92
+  //     // 这两者间只相差2小时,直接用“deltaTime/(3600 * 1000)” > 24小时来判断是否昨天,就完全是扯蛋的逻辑了)
93
+  //     if (srcMonth == (yesterdayDate.getMonth() + 1) && srcDateD == yesterdayDate.getDate())
94
+  //       ret = "昨天" + timeExtraStr;// -1d
95
+  //     // “前天”判断逻辑同上
96
+  //     else if (srcMonth == (beforeYesterdayDate.getMonth() + 1) && srcDateD == beforeYesterdayDate.getDate())
97
+  //       ret = "前天" + timeExtraStr;// -2d
98
+  //     else {
99
+  //       // 跟当前时间相差的小时数
100
+  //       var deltaHour = (deltaTime / (3600 * 1000));
101
+
102
+  //       // 如果小于或等 7*24小时就显示星期几
103
+  //       if (deltaHour <= 7 * 24) {
104
+  //         var weekday = new Array(7);
105
+  //         weekday[0] = "星期日";
106
+  //         weekday[1] = "星期一";
107
+  //         weekday[2] = "星期二";
108
+  //         weekday[3] = "星期三";
109
+  //         weekday[4] = "星期四";
110
+  //         weekday[5] = "星期五";
111
+  //         weekday[6] = "星期六";
112
+
113
+  //         // 取出当前是星期几
114
+  //         var weedayDesc = weekday[srcDate.getDay()];
115
+  //         ret = weedayDesc + timeExtraStr;
116
+  //       }
117
+  //       // 否则直接显示完整日期时间
118
+  //       else
119
+  //         ret = _formatDate(srcDate, format) + timeExtraStr;
120
+  //     }
121
+  //   }
122
+  // }
123
+  // // 往年
124
+  // else {
125
+  //   ret = _formatDate(srcDate, format) + timeExtraStr;
126
+  // }
127
+  ret = _formatDate(srcDate, format) + timeExtraStr;
128
+  return ret;
129
+};