houwei 3 anos atrás
pai
commit
0f1affeb29

+ 0 - 1
app.json

@@ -1,6 +1,5 @@
 {
   "pages": [
-    
     "pages/index/index",
     "pages/share/share",
     "pages/targetInfo/targetInfo",

+ 160 - 86
pages/activeDetail/activeDetail.js

@@ -4,39 +4,97 @@ Page({
   data: {
     isInit: false
   },
-  isOk() {
+  // isOk() {
+    // tool.isLogin().then(result => {
+    //   this.setData({
+    //     loginStatus: true
+    //   })
+    //   tool.isFinishInfo().then(result2 => {
+    //     this.setData({
+    //       infoStatus: true
+    //     })
+    //     tool.isFinishTargetInfo().then(redult3 => {
+    //       this.setData({
+    //         targetInfoStatus: true
+    //       })
+    //     }).catch(err => {
+    //       this.setData({
+    //         targetInfoStatus: false
+    //       })
+    //     })
+    //   }).catch(err => {
+    //     this.setData({
+    //       infoStatus: false
+    //     })
+    //   })
+    // }).catch(err => {
+    //   this.setData({
+    //     loginStatus: false
+    //   })
+    // })
+  // },
+  baoming() {
     tool.isLogin().then(result => {
-      console.log(result,'22222222222')
-      this.setData({
-        loginStatus: true
-      })
       tool.isFinishInfo().then(result2 => {
-        this.setData({
-          infoStatus: true
-        })
         tool.isFinishTargetInfo().then(redult3 => {
-          this.setData({
-            targetInfoStatus: true
+          wx.requestSubscribeMessage({
+            tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
+            success: (res) => {
+              console.log(res,'订阅成功了')
+              wx.request({
+                url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
+                method: "get",
+                success: (res) => {
+                  if (res.data.code == 0) {
+                    wx.redirectTo({
+                      url: '/pages/registrationSuccess/registrationSuccess',
+                    })
+                  }
+                }
+              })
+            },
+            fail: (res1) => {
+              console.log(res1, '订阅失败了')
+              wx.request({
+                url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
+                method: "get",
+                success: (res) => {
+                  if (res.data.code == 0) {
+                    wx.redirectTo({
+                      url: '/pages/registrationSuccess/registrationSuccess',
+                    })
+                  }
+                }
+              })
+            }
           })
         }).catch(err => {
-          this.setData({
-            targetInfoStatus: false
-          })
+          wx.showModal({
+            title: '您还未完善择偶信息',
+            showCancel: false,
+            success(res) {
+              if (res.confirm) {
+                wx.redirectTo({
+                  url: '/pages/targetInfo/targetInfo',
+                })
+              }
+            }
+          });
         })
       }).catch(err => {
-        this.setData({
-          infoStatus: false
-        })
+        wx.showModal({
+          title: '您还未完善个人信息',
+          showCancel: false,
+          success(res) {
+            if (res.confirm) {
+              wx.redirectTo({
+                url: '/pages/personInfo/personInfo',
+              })
+            }
+          }
+        });
       })
     }).catch(err => {
-      console.log(err,'没登录')
-      this.setData({
-        loginStatus: false
-      })
-    })
-  },
-  baoming() {
-    if (!this.data.loginStatus) {
       wx.showModal({
         title: '您还未登录',
         showCancel: false,
@@ -48,70 +106,85 @@ Page({
           }
         }
       });
-      return false;
-    }
-    if (!this.data.infoStatus) {
-      wx.showModal({
-        title: '您还未完善个人信息',
-        showCancel: false,
-        success(res) {
-          if (res.confirm) {
-            wx.redirectTo({
-              url: '/pages/personInfo/personInfo',
-            })
-          }
-        }
-      });
-      return false;
-    }
-    if (!this.data.targetInfoStatus) {
-      wx.showModal({
-        title: '您还未完善择偶信息',
-        showCancel: false,
-        success(res) {
-          if (res.confirm) {
-            wx.redirectTo({
-              url: '/pages/targetInfo/targetInfo',
-            })
-          }
-        }
-      });
-      return false;
-    }
-    wx.requestSubscribeMessage({
-      tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
-      // tmplIds: ['OfeVQOfrOQyOEb-ipTiw6MRJiXs9vlvhv3SVRtrTgKc'],
-      success: (res) => {
-        wx.request({
-          url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
-          method: "get",
-          success: (res) => {
-            if (res.data.code == 0) {
-              wx.redirectTo({
-                url: '/pages/registrationSuccess/registrationSuccess',
-              })
-            }
-          }
-        })
-      },
-      fail: (res1) => {
-        console.log(res1, '失败了')
-        wx.request({
-          url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
-          method: "get",
-          success: (res) => {
-            if (res.data.code == 0) {
-              wx.redirectTo({
-                url: '/pages/registrationSuccess/registrationSuccess',
-              })
-            }
-          }
-        })
-      }
     })
-
+    // if (!this.data.loginStatus) {
+    //   wx.showModal({
+    //     title: '您还未登录',
+    //     showCancel: false,
+    //     success(res) {
+    //       if (res.confirm) {
+    //         wx.redirectTo({
+    //           url: '/pages/personal/personal',
+    //         })
+    //       }
+    //     }
+    //   });
+    //   return false;
+    // }
+    // if (!this.data.infoStatus) {
+    //   wx.showModal({
+    //     title: '您还未完善个人信息',
+    //     showCancel: false,
+    //     success(res) {
+    //       if (res.confirm) {
+    //         wx.redirectTo({
+    //           url: '/pages/personInfo/personInfo',
+    //         })
+    //       }
+    //     }
+    //   });
+    //   return false;
+    // }
+    // if (!this.data.targetInfoStatus) {
+    //   wx.showModal({
+    //     title: '您还未完善择偶信息',
+    //     showCancel: false,
+    //     success(res) {
+    //       if (res.confirm) {
+    //         wx.redirectTo({
+    //           url: '/pages/targetInfo/targetInfo',
+    //         })
+    //       }
+    //     }
+    //   });
+    //   return false;
+    // }
+    // wx.requestSubscribeMessage({
+    //   tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
+    //   success: (res) => {
+    //     wx.request({
+    //       url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
+    //       method: "get",
+    //       success: (res) => {
+    //         if (res.data.code == 0) {
+    //           wx.redirectTo({
+    //             url: '/pages/registrationSuccess/registrationSuccess',
+    //           })
+    //         }
+    //       }
+    //     })
+    //   },
+    //   fail: (res1) => {
+    //     console.log(res1, '失败了')
+    //     wx.request({
+    //       url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
+    //       method: "get",
+    //       success: (res) => {
+    //         if (res.data.code == 0) {
+    //           wx.redirectTo({
+    //             url: '/pages/registrationSuccess/registrationSuccess',
+    //           })
+    //         }
+    //       }
+    //     })
+    //   }
+    // }) 
   },
   async onLoad(options) {
+    wx.showLoading({
+      title:'加载中',
+      mask:true
+    });
     console.log(options)
     tool.openidStatus().then(result => {
       this.setData({
@@ -120,8 +193,9 @@ Page({
         activeOpenid: options.openId,
         isInit: true
       })
-      this.isOk();
+      // this.isOk();
       this.getActivies(options.id);
+      wx.hideLoading();
     })
   },
   getActivies(id2) {

+ 4 - 0
pages/index/index.js

@@ -57,6 +57,7 @@ Page({
   },
   // 获取活动列表
   getActivies() {
+    wx.showLoading();
     wx.request({
       url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/actives',
       method: "get",
@@ -105,6 +106,7 @@ Page({
       })
     }
   },
+  // 获取个人信息用于客服所需参数
   getInfos() {
     wx.request({
       url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
@@ -168,8 +170,10 @@ Page({
     }
   },
   onShow() {
+    // 获取信件
     this.getletterStauts();
     this.getInfos()
+    this.getActivies();
     tool.isLogin().then(res => {
       this.setData({
         userInfo:JSON.parse(res.rawData)

+ 0 - 1
pages/index/index.wxml

@@ -10,7 +10,6 @@
 	<view>{{userInfo}}</view>
 	<view>{{ysf}}</view>
 	</view> -->
-	
 	<image src="../../images/show.jpg" style="width:750rpx;margin-left:0rpx;height:200rpx;margin-top:20rpx" bindtap="goShare"></image>
 	<view style="display:flex;margin-left:30rpx;margin-top:30rpx;margin-bottom:30rpx">
 		<view style='width:10rpx;height:45rpx;background-color:#986aff;margin-right:20rpx;border-radius:10rpx'></view>近期活动

+ 1 - 1
pages/myActive/myActive.wxml

@@ -9,7 +9,7 @@
 		<view wx:if="{{item.activeStatus==1}}" class="btn btn2" data-id='{{item.id}}' data-sign='{{item.isSign}}' bindtap="goActive">进行中</view>
     <view wx:if="{{item.activeStatus==2}}" class="btn btn3">已结束</view>
 	</view>
-	<image src="../../images/activeimg.png" class="img2"></image>
+	<image src="{{item.faceUrl}}" class="img2"></image>
 	<view class="p1">
 	<van-icon name="clock-o" color="#a267ff" size="35rpx"/><view style="margin-left:15rpx">活动时间:{{item.activeTime}}</view>
 	</view>

+ 1 - 1
pages/myActive/myActive.wxss

@@ -1,7 +1,7 @@
 /* pages/myActive/myActive.wxss */
 .box{
   width: 650rpx;
-  height: 530rpx;
+  /* height: 530rpx; */
   margin: 25rpx;
   box-shadow:0 0 10rpx 10rpx #eceafa;
   padding:25rpx

+ 1 - 0
utils/tool.js

@@ -95,6 +95,7 @@ const isFinishInfo = () => {
     })
   })
 };
+// 判断是否完善择偶条件
 const isFinishTargetInfo = () => {
   return new Promise((resolve, reject) => {
     wx.request({