houwei 4 роки тому
батько
коміт
452e788994

+ 0 - 2
app.json

@@ -2,8 +2,6 @@
   "pages": [
     "pages/index/index",
     "pages/share/share",
-   
-    
     "pages/targetInfo/targetInfo",
     "pages/personInfo/personInfo",
     "pages/onSiteActivity/onSiteActivity",

+ 27 - 14
pages/onSiteActivity/onSiteActivity.js

@@ -18,7 +18,7 @@ Page({
     let status = this.data.member[e.currentTarget.dataset.index].hearted
     let status1 = 'member[' + e.currentTarget.dataset.index + '].hearted'
     console.log(status)
-    if (status == 0) {
+    if (status == 1) {
       wx.request({
         url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/unfollow',
         method: "get",
@@ -29,7 +29,7 @@ Page({
           if (res.data.code == 0) {
             console.log(res, '我取消心动了')
             this.setData({
-              [status1]: 1,
+              [status1]: 0,
               member: this.data.member
             })
             console.log(this.data.member)
@@ -49,7 +49,7 @@ Page({
             if (res.data.code == 0) {
               console.log(res, '我心动了')
               this.setData({
-                [status1]: 0,
+                [status1]: 1,
                 member: this.data.member
               })
               console.log(this.data.member)
@@ -100,23 +100,28 @@ Page({
       success: (res) => {
         if (res.data.code == 0) {
           console.log(res.data.members, '我获取人员名单')
-          for (let i = 0; i < res.data.members.length; i++) {
-            if (res.data.members[i].openId == this.data.openid) {
-              this.setData({
-                myNum: res.data.members[i].activeNumber
-              })
-              // 删除自己
-              res.data.members.splice(i, 1);
-            }
-          }
           this.setData({
             member: res.data.members
           })
         }
       }
     })
+    wx.request({
+      // this.data.activeId
+      url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/sign',
+      method: "get",
+      success: (res) => {
+        console.log(res,'我签到的结果')
+        if (res.data.code == 0) {
+          this.setData({
+            myNum: res.data.activeNumber
+          })
+        }
+      }
+    })
   },
   async onLoad(options) {
+    console.log(options)
     tool.openidStatus().then(result => {
       this.setData({
         openid: result[0],
@@ -138,14 +143,22 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    this.data.realTime = setInterval(()=>
+    {
+      this.getActivies();
+      this.getMyheartNowTimes();
+    }, 10000)//间隔时间
+    // 更新数据
+    this.setData({
+      realTime:this.data.realTime,//实时数据对象(用于关闭实时刷新方法)
+    })
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-
+    clearInterval(this.data.realTime)
   },
 
   /**

+ 4 - 4
pages/onSiteActivity/onSiteActivity.wxml

@@ -1,5 +1,5 @@
 <view class="container">
-	<view class="title">本场编号为{{myNum}}</view>
+	<view class="title">我的本场编号为{{myNum}}</view>
 	<view class="subtitle">请给你喜欢的嘉宾点击心动,心动上限为{{planHeart}}个</view>
 	<scroll-view scroll-x="true" enable-flex="true" style="margin-top:40rpx">
 		<view class="heartbox">
@@ -13,7 +13,7 @@
 		</view>
 	</scroll-view>
 	<view class="num">
-		<view class='allnum'>嘉宾: {{member.length}}名</view>
+		<view class='allnum'>本场嘉宾: {{member.length}}名</view>
 			<button id="tousu" session-from="nickName={{userInfo.nickName}}|avatarUrl={{userInfo.avatarUrl}}" open-type="contact">投诉反馈</button>
 		<!-- <view class="tousu" bindtap="goTousu">投诉反馈</view> -->
 	</view>
@@ -21,9 +21,9 @@
 <view class="photobox">
 	<view wx:for="{{member}}" wx:key="index" data-index="{{index}}" data-openId='{{item.openId}}' bindtap="love" style="text-align:center;width: 140rpx;position:relative">
 		<image src="{{item.memberAvatar}}" style="width:110rpx;height:110rpx;border-radius:50%;margin-top:20rpx" mode="aspectFit"></image>
-		<view style="color:#4d4d4d;font-size:28rpx;margin-top:5rpx">{{item.activeNumber}}</view>
+		<view style="color:#4d4d4d;font-size:28rpx;margin-top:5rpx">{{item.activeNumber}}</view>
 		<view style="color:#4d4d4d;font-size:28rpx;padding-bottom:35rpx">{{item.memberName}}</view>
 		<view class="grayCircle"></view>
-		<image src="../../images/love.png" class="loveCircle" wx:if="{{item.hearted==0}}"></image>
+		<image src="../../images/love.png" class="loveCircle" wx:if="{{item.hearted==1}}"></image>
 	</view>
 </view>

+ 61 - 3
pages/personInfo/personInfo.js

@@ -24,6 +24,7 @@ Page({
       idFront: '',
       idCard: '',
       name: '',
+      tel:'',
       sex: '',
       age: '',
       nativePlace: '',
@@ -97,7 +98,7 @@ Page({
       title: '上传中',
     })
     wx.chooseImage({
-      count: 1,
+      count: 9,
       sizeType: ['compressed'],
       sourceType: ['album', 'camera'],
       success: (res) => {
@@ -330,6 +331,9 @@ Page({
       sex: {
         required: true
       },
+      tel: {
+        required: true
+      },
       age: {
         required: true
       },
@@ -433,6 +437,7 @@ Page({
         let photoUrl = 'form.photoUrl'
         let idCard = 'form.idCard'
         let name = 'form.name'
+        let tel = 'form.tel'
         let sex = 'form.sex'
         let age = 'form.age'
         let nativePlace = 'form.nativePlace'
@@ -467,6 +472,7 @@ Page({
             imgsrc: res.data.info.idFront,
             [idFront]: res.data.info.idFront,
             photo: res.data.info.photoUrl,
+            [tel]:res.data.info.tel,
             [photoUrl]: res.data.info.photoUrl,
             [idCard]: res.data.info.idCard,
             [name]: res.data.info.name,
@@ -485,6 +491,52 @@ Page({
       }
     })
   },
+  getPhoneNumber(e) {
+    tool.isLogin().then(res => {
+      console.log(res)
+      if (e.detail.errMsg == "getPhoneNumber:ok") {
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/user/wxbfa171fdd4000e03/phone',
+          header: {
+            'content-type': 'application/x-www-form-urlencoded',
+          },
+          data: {
+            sessionKey: this.data.sessionkey,
+            signature: res.signature,
+            rawData: res.rawData,
+            encryptedData: e.detail.encryptedData,
+            iv: e.detail.iv
+          },
+          method: "POST",
+          success: (res) => {
+            console.log(res, '我是解析的手号');
+            let tel = 'form.tel'
+            if (res.data.phoneNumber) {
+              this.setData({
+                [tel]: res.data.phoneNumber
+              })
+            } else {
+              this.setData({
+                [tel]: 0
+              })
+            }
+          }
+        })
+      }
+    }).catch(err => {
+      wx.showModal({
+        title: '您还未登录',
+        showCancel: false,
+        success(res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/personal/personal',
+            })
+          }
+        }
+      });
+    })
+  },
   // 表单提交事件
   formSubmit(e) {
     console.log(e.detail.value)
@@ -531,6 +583,12 @@ Page({
               }
             }
           });
+        }else{
+          wx.showModal({
+            title: '不好意思啦',
+            content:'信息提交失败了,请联系客服呦',
+            showCancel: false
+          })
         }
       }
     })
@@ -566,9 +624,9 @@ Page({
       this.setData({
         userInfo: JSON.parse(res.rawData)
       })
-      console.log(this.data.userInfo)
+      console.log(this.data.userInfo,'11111111')
     }).catch(err => {
-      console.log(err)
+      console.log(err,'0000000000')
     })
   }
 })

+ 9 - 2
pages/personInfo/personInfo.wxml

@@ -3,8 +3,6 @@
 		<view class="p1">身份证上传</view>
 		<view class="p2">注:上传横向且清晰的</view>
 		<view class="p3">身份证头像面照片</view>
-		<!-- <view class="p3">注:需要身份证照片清晰</view>
-		<view class="p4">方向为横向</view> -->
 		<image class="cardimg" mode="aspectFit" src="{{imgsrc}}" data-type='card' bindtap="uploadCard"></image>
 	</view>
 	<view class="card_bj">
@@ -28,6 +26,13 @@
 				<input name="name" value="{{form.name}}" placeholder="未填写" placeholder-class="iconfont icon-jianjiaohao1 icon-tubiaozhizuo-1"></input>
 			</view>
 		</view>
+		<view class="block">
+				<view class='left' style="width:40%">联系方式</view>
+				<view class='right' style="width:60%">
+					<input name="tel" wx:if="{{form.tel}}" value="{{form.tel}}" bindblur="phoneChange" placeholder="未填写" placeholder-class="iconfont icon-jianjiaohao1 icon-tubiaozhizuo-1"></input>
+					<button wx:else open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" id="photo_btn">未填写</button>
+				</view>
+			</view>
 		<view class="block">
 			<view class='left'>性别</view>
 			<view class='right'>
@@ -95,6 +100,8 @@
 				</picker>
 			</view>
 		</view>
+
+
 		<view class="btn-area">
 			<button form-type="submit" id="sunbmit">
 				<span wx:if="{{myInfo&&myInfo.height}}">确认</span>

+ 8 - 1
pages/personInfo/personInfo.wxss

@@ -1,4 +1,11 @@
-
+#photo_btn{
+  background: #fff!important;
+  /* border: 1px solid red; */
+  font-weight: normal!important;
+  font-size: 28rpx;
+  text-align: right;
+  color: #4d4d4d;
+}
 .block {
   height: 80rpx;
   line-height: 80rpx;

+ 1 - 1
pages/personInfoDetail/personInfoDetail.js

@@ -938,7 +938,7 @@ Page({
   initValidate() {
     const rules = {
       tel: {
-        required: true
+        required: false
       },
       height: {
         required: true

+ 1 - 1
pages/personInfoDetail/personInfoDetail.wxml

@@ -1,6 +1,6 @@
 	<view class="container">
 		<form bindsubmit='formSubmit'>
-			<view class="block">
+			<view class="block" style="display:none">
 				<view class='left' style="width:40%">咋联系你呢</view>
 				<view class='right' style="width:60%">
 					<input name="tel" wx:if="{{form.tel}}" value="{{form.tel}}" bindblur="phoneChange" placeholder="未填写" placeholder-class="iconfont icon-jianjiaohao1 icon-tubiaozhizuo-1"></input>

+ 27 - 18
pages/personal/personal.js

@@ -121,21 +121,21 @@ Page({
       }
     })
   },
-  getInfos() {
-    tool.isLogin().then(res => {
-      console.log(res)
-      this.setData({
-        userInfo: JSON.parse(res.rawData),
-        avatarUrl: res.userInfo.avatarUrl,
-        nick: res.userInfo.nickName,
-        loginStatus: true
-      })
-    }).catch(err => {
-      this.setData({
-        loginStatus: false
-      })
-    })
-  },
+  // getInfos() {
+  //   tool.isLogin().then(res => {
+  //     console.log(res)
+  //     this.setData({
+  //       userInfo: JSON.parse(res.rawData),
+  //       avatarUrl: res.userInfo.avatarUrl,
+  //       nick: res.userInfo.nickName,
+  //       loginStatus: true
+  //     })
+  //   }).catch(err => {
+  //     this.setData({
+  //       loginStatus: false
+  //     })
+  //   })
+  // },
   getInfos2() {
     wx.request({
       url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
@@ -149,7 +149,6 @@ Page({
           }else{
             sex1='男'
           }
-          console.log(sex1)
           this.setData({
             myInfo: res.data.info,
             [config]:JSON.stringify({
@@ -183,7 +182,17 @@ Page({
             })
           })
           console.log(this.data.ysf.config)
-        }
+          if(res.data.info.avatar&&res.data.info.nickName){
+            this.setData({
+              avatarUrl: res.data.info.avatar,
+              nick: res.data.info.nickName,
+              loginStatus: true,
+          })
+        }else{
+          this.setData({
+            loginStatus: false,
+        })
+        }}
       }
     })
   },
@@ -193,7 +202,7 @@ Page({
         openid: result[0],
         sessionkey: result[1]
       })
-      this.getInfos();
+      // this.getInfos();
       this.getInfos2();
       this.getTimes();
     })

+ 1 - 0
pages/personal/personal.wxml

@@ -2,6 +2,7 @@
 	<image src="../../images/person_bj.jpg" style="width:750rpx;height:350rpx"></image>
 	<view class="top">
 		<image class="img" src="{{avatarUrl}}"></image>
+  <!-- <image class="img avatar" src='{{userInfo.avatarUrl}}'></image> -->
 		<view class="nick">
 			<view wx:if="{{nick}}">{{nick}}</view>
 			<button wx:else open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo" id="login_btn">

+ 4 - 3
pages/share/share.js

@@ -50,7 +50,9 @@ Page({
     })
   },
   getEwm() {
+    console.log('我走啦')
       tool.isFinishInfo().then(result2 => {
+        console.log(result2,'000000000000000')
           wx.request({
             url: app.globalData.publicUrl + '/wx/mpuser/wxeef6678b92b6c856/qrCode',
             method: "get",
@@ -66,12 +68,12 @@ Page({
             }
           })
       }).catch(err => {
-        // wx.showLoading();
+        console.log(err,'333333333333')
         wx.request({
           url: app.globalData.publicUrl + '/wx/mpuser/wxeef6678b92b6c856/qrCode',
           method: "get",
           data: {
-            memberId:0
+            memberId:err.id
           },
           success: (res) => {
             console.log(res)
@@ -82,7 +84,6 @@ Page({
           }
         })
       })
-
   },
   draw(qrcode) {
     wx.downloadFile({

+ 28 - 25
pages/sign/sign.js

@@ -5,53 +5,56 @@ Page({
 
   },
   go() {
+    // + this.data.activeId,
     wx.navigateTo({
-      url: '/pages/onSiteActivity/onSiteActivity',
-    })
-  },
-  getNum() {
-    wx.request({
-      url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/members',
-      method: "get",
-      success: (res) => {
-        if (res.data.code == 0) {
-          console.log(res.data.members, '我获取人员名单')
-          for (let i = 0; i < res.data.members.length; i++) {
-            if (res.data.members[i].openId == this.data.openid) {
-              this.setData({
-                myNum: res.data.members[i].activeNumber
-              })
-            }
-          }
-        }
-      }
+      url: '/pages/onSiteActivity/onSiteActivity?id='+ this.data.activeId
     })
   },
+  // getNum() {
+  //   wx.request({
+  //     url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/members',
+  //     method: "get",
+  //     success: (res) => {
+  //       if (res.data.code == 0) {
+  //         console.log(res.data.members, '我获取人员名单')
+  //         for (let i = 0; i < res.data.members.length; i++) {
+  //           if (res.data.members[i].openId == this.data.openid) {
+  //             this.setData({
+  //               myNum: res.data.members[i].activeNumber
+  //             })
+  //           }
+  //         }
+  //       }
+  //     }
+  //   })
+  // },
   sign(){
-    // /wx/actives/{openId}/{activeId}/sign
     wx.request({
       url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/sign',
       method: "get",
       success: (res) => {
+        console.log(res,'我签到的结果')
         if (res.data.code == 0) {
-          console.log(res.data, '我签到成功了');
-          this.getNum();
+          this.setData({
+            myNum: res.data.activeNumber
+          })
         }
       }
     })
   },
   onLoad: function (options) {
-    console.log(options)
+    console.log(decodeURIComponent(options.q),'我是签到页带过来的参数');
+    let url=decodeURIComponent(options.q);
+    let after = url.split('id=')[1];
     tool.openidStatus().then(result => {
       this.setData({
         openid: result[0],
         sessionkey: result[1],
-        activeId:options.id
+        activeId:after
       })
       this.sign();
     })
   },
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 3 - 3
utils/tool.js

@@ -89,11 +89,11 @@ const isFinishInfo = () => {
       url: util.globalData.publicUrl + '/wx/member/' + wx.getStorageSync('openId') + '/info',
       method: "get",
       success: (res) => {
-        console.log(res)
-        if (res.data.code == 0&&res.data.info.name&&res.data.info.tel) {
+        // console.log(res,'99999999999999999')
+        if (res.data.code == 0&&res.data.info.name&&res.data.info.height) {
           resolve(res.data.info)
         } else {
-          reject(res.data.code)
+          reject(res.data.info)
         }
       }
     })