Procházet zdrojové kódy

2.2.5 活动下架 弹框判断兼容null和空数组

Rorschach před 5 roky
rodič
revize
0a9b7ba788

+ 2 - 1
README.md

@@ -39,4 +39,5 @@ https://mp.weixin.qq.com/
 - 2.2.1: 文字超出更改
 - 2.2.2: 添加新用户来源渠道
 - 2.2.3: 更换price页面,增加滚动名单
-- 2.2.4   日期计算bug修改
+- 2.2.4   日期计算bug修改 
+- 2.2.5   活动下架,弹框判断兼容null和空数组

+ 26 - 26
pages/index/index.js

@@ -68,7 +68,7 @@ Page({
     indexMissionDialog: false,
     unfinishedCount: 0
   },
-  jurisdiction: function () {
+  jurisdiction: function() {
     //隐藏弹框
     this.setData({
       hide: !this.data.hide
@@ -77,14 +77,14 @@ Page({
     this.onShow();
   },
   //tab点击
-  switcher: function ({
+  switcher: function({
     currentTarget
   }) {
     if (currentTarget.dataset.index === this.data.myIndex) return;
     this.updateData(currentTarget.dataset.index);
   },
   // 根据index 更新template
-  updateData: function (index) {
+  updateData: function(index) {
     let myIndex = index;
     let templates = this.data.tab[myIndex].templates;
     this.setData({
@@ -108,7 +108,7 @@ Page({
       groupInit(this);
     }
   },
-  onLoad: function (options) {
+  onLoad: function(options) {
     this.uid = wx.getStorageSync('uid');
     wx.getSystemInfo({
       success: (res) => {
@@ -123,8 +123,8 @@ Page({
     setTimeout(() => {
       if (wx.getStorageSync('uid')) {
         httpRequestApi.userLoginRecord().success(res => {
-          if (res.data.data.length !== 0) {
-            // 有数据弹任务窗口
+          if (res.data.data && res.data.data.length !== 0) {
+            // 有数据弹签到
             if (this.data.unfinishedCount > 0) {
               this.setData({
                 indexSignDialog: true
@@ -132,11 +132,11 @@ Page({
             }
 
           } else {
-            // 没数据弹签到
+            // 没数据弹任务
             let oldDay = wx.getStorageSync('oldDay');
             let newDate = new Date();
             let day = newDate.getDate() < 10 ? '0' + newDate.getDate() : newDate.getDate()
-            let timeStep =(newDate.getMonth() + 1).toString() + day
+            let timeStep = (newDate.getMonth() + 1).toString() + day
             if (oldDay) {
               let temp = parseInt(timeStep) - parseInt(oldDay)
               if (temp > 0) {
@@ -159,7 +159,7 @@ Page({
     // this.init();
 
   },
-  onShow: function () {
+  onShow: function() {
     wx.setNavigationBarTitle({
       title: '小学课文朗读配音'
     })
@@ -169,7 +169,7 @@ Page({
     }, (error) => {
       // console.log(error)
 
-      wx.setStorageSync('userSourseType','normal')
+      wx.setStorageSync('userSourseType', 'normal')
       this.setData({
         hide: !this.data.hide
       })
@@ -180,11 +180,11 @@ Page({
       this.getUserWorksInfo(true);
     }
   },
-  onHide: function(){
+  onHide: function() {
     const str = 'hotData.inputFocus'
-      this.setData({
-        [str]: false
-      });
+    this.setData({
+      [str]: false
+    });
   },
   //初始化数据
   // init: function () {
@@ -200,7 +200,7 @@ Page({
   //   });
   // },
   // 获取用户信息
-  getUserWorksInfo: function (flag) {
+  getUserWorksInfo: function(flag) {
     console.log(flag)
     if (flag) {
       httpRequestApi.getUserWorksInfo().success(res => {
@@ -231,8 +231,8 @@ Page({
     })
   },
   // 触底加载
-  onReachBottom: function () {
-    console.log(this.data.myIndex )
+  onReachBottom: function() {
+    console.log(this.data.myIndex)
     if (this.data.myIndex === 0) {
       this.setData({
         followPageNo: this.data.followPageNo + 1
@@ -246,7 +246,7 @@ Page({
           ifHaveMore: false
         })
       }
-    } 
+    }
     // 当前在推荐页面 加载推荐
     if (this.data.myIndex === 1) {
       console.log(this.data.recommendPageNo)
@@ -263,7 +263,7 @@ Page({
     }
 
   },
-  onPullDownRefresh: function () {
+  onPullDownRefresh: function() {
     //当前在团购页下拉加载
     if (this.data.myIndex === 0) {
       // groupInit(this);
@@ -271,7 +271,7 @@ Page({
 
     wx.showNavigationBarLoading() //在标题栏中显示加载
     //模拟加载
-    setTimeout(function () {
+    setTimeout(function() {
       wx.hideNavigationBarLoading() //完成停止加载
       wx.stopPullDownRefresh() //停止下拉刷新
     }, 1500);
@@ -290,7 +290,7 @@ Page({
   //     console.log('错误', error)
   //   })
   // },
-  goToMessage: function () {
+  goToMessage: function() {
     wx.navigateTo({
       url: `../../pages/social/insideMessage/insideMessage`
     });
@@ -299,7 +299,7 @@ Page({
       [str]: 0
     })
   },
-  toMyCollage: function (e) {
+  toMyCollage: function(e) {
     if (app.globalData.isIOS) {
       wx.navigateTo({
         url: `../../pages/groupPage/my-group/my-group?title=我的助力`
@@ -311,17 +311,17 @@ Page({
     }
 
   },
-  toMyCourse: function () {
+  toMyCourse: function() {
     wx.navigateTo({
       url: `../../pages/user/mycourse/mycourse?title=我的课程`
     });
   },
-  goToFlower: function () {
+  goToFlower: function() {
     wx.navigateTo({
       url: `../../pages/social/littleFlower/littleFlower`
     });
   },
-  signInBtn: function (e) {
+  signInBtn: function(e) {
     this.setData({
       indexSignDialog: false
     })
@@ -331,7 +331,7 @@ Page({
     })
     this.goToFlower();
   },
-  missionBtn: function () {
+  missionBtn: function() {
     this.setData({
       indexMissionDialog: false
     })

+ 2 - 2
pages/main/searchResult/searchResult.js

@@ -3,7 +3,7 @@ Page({
   data: {
     wareCards: []
   },
-  onLoad: function (option) {
+  onLoad: function(option) {
     console.log(option);
     wx.setNavigationBarTitle({
       title: '搜索' //页面标题为路由参数
@@ -18,7 +18,7 @@ Page({
     //     })
     // })
   },
-  search: function (key) {
+  search: function(key) {
     httpRequestApi.getSearchResult(1, key, 1, 10).success(res => {
       console.log(res);
       const result = res.data.data.list;

+ 4 - 4
pages/social/littleFlower/littleFlower.wxml

@@ -39,13 +39,13 @@
             <view class="mission-status mission-complete" wx:if="{{item.finished}}">已完成</view>
         </view>
     </scroll-view>
-    <view class="lego-section" bindtap="goToPrize">
+    <!-- <view class="lego-section" bindtap="goToPrize">
         <image class="lego" src="../../../static/image/lego_icon.png" />
-    </view>
-    <!-- <view class="explain">
+    </view> -->
+    <view class="explain">
         <view class="explain-gut">小红花有什么用?</view>
         <view class="explain-gut">我们会启动很多好玩的活动,</view>
         <view class="explain-gut">到时候你将会有大大的惊喜哦!</view>
         <view class="explain-gut">请继续积攒小红花吧!</view>
-    </view> -->
+    </view>
 </view>

+ 82 - 83
project.config.json

@@ -1,85 +1,84 @@
 {
-	"description": "项目配置文件",
-	"packOptions": {
-		"ignore": []
-	},
-	"setting": {
-		"urlCheck": true,
-		"es6": true,
-		"postcss": true,
-		"minified": true,
-		"newFeature": true
-	},
-	"compileType": "miniprogram",
-	"libVersion": "2.3.2",
-	"appid": "wxdfa8a4f1623d28db",
-	"projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%BE%E6%96%87%E6%9C%97%E8%AF%BB%E9%85%8D%E9%9F%B3",
-	"debugOptions": {
-		"hidedInDevtools": []
-	},
-	"isGameTourist": false,
-	"condition": {
-		"search": {
-			"current": -1,
-			"list": []
-		},
-		"conversation": {
-			"current": -1,
-			"list": []
-		},
-		"plugin": {
-			"current": -1,
-			"list": []
-		},
-		"game": {
-			"currentL": -1,
-			"list": []
-		},
-		"miniprogram": {
-			"current": 5,
-			"list": [
-				{
-					"id": -1,
-					"name": "小红花",
-					"pathName": "pages/social/littleFlower/littleFlower",
-					"query": ""
-				},
-				{
-					"id": 1,
-					"name": "作品",
-					"pathName": "pages/social/works/works",
-					"query": "id=1548160250807513&title=【识字1】春夏秋冬",
-					"scene": "1012"
-				},
-				{
-					"id": 2,
-					"name": "分享团",
-					"pathName": "pages/groupPage/group-details/group-details",
-					"query": "productId=1550459447432909",
-					"scene": 1012
-				},
-				{
-					"id": -1,
-					"name": "公众号进入",
-					"pathName": "pages/index/index",
-					"query": "",
-					"scene": 1020,
-					"referrerInfo": {}
-				},
-				{
-					"id": -1,
-					"name": "公众号文章进入",
-					"pathName": "pages/index/index",
-					"query": "",
-					"scene": 1058
-				},
-				{
-					"id": -1,
-					"name": "小红花兑换页面",
-					"pathName": "pages/social/prize/prize",
-					"scene": null
-				}
-			]
-		}
-	}
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "postcss": true,
+    "minified": true,
+    "newFeature": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.3.2",
+  "appid": "wxdfa8a4f1623d28db",
+  "projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%BE%E6%96%87%E6%9C%97%E8%AF%BB%E9%85%8D%E9%9F%B3",
+  "debugOptions": {
+    "hidedInDevtools": []
+  },
+  "isGameTourist": false,
+  "condition": {
+    "search": {
+      "current": -1,
+      "list": []
+    },
+    "conversation": {
+      "current": -1,
+      "list": []
+    },
+    "plugin": {
+      "current": -1,
+      "list": []
+    },
+    "game": {
+      "currentL": -1,
+      "list": []
+    },
+    "miniprogram": {
+      "current": 5,
+      "list": [{
+          "id": -1,
+          "name": "小红花",
+          "pathName": "pages/social/littleFlower/littleFlower",
+          "query": ""
+        },
+        {
+          "id": 1,
+          "name": "作品",
+          "pathName": "pages/social/works/works",
+          "query": "id=1548160250807513&title=【识字1】春夏秋冬",
+          "scene": "1012"
+        },
+        {
+          "id": 2,
+          "name": "分享团",
+          "pathName": "pages/groupPage/group-details/group-details",
+          "query": "productId=1550459447432909",
+          "scene": 1012
+        },
+        {
+          "id": -1,
+          "name": "公众号进入",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": 1020,
+          "referrerInfo": {}
+        },
+        {
+          "id": -1,
+          "name": "公众号文章进入",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": 1058
+        },
+        {
+          "id": -1,
+          "name": "小红花兑换页面",
+          "pathName": "pages/social/prize/prize",
+          "scene": null
+        }
+      ]
+    }
+  }
 }