Преглед на файлове

微信授权接口调整

junyuanz преди 4 години
родител
ревизия
95f6ea402c

+ 17 - 7
packageUser/pages/user/invite/invite.js

@@ -41,13 +41,23 @@ Page({
 //  this.getCount()
     this.getmonthlist()
     //this.getContributionTotal()
-    wx.getUserInfo({
-      success: res => {
-        this.setData({
-          info: res.userInfo
-        })
-      }
-    })
+    // wx.getUserInfo({
+    //   success: res => {
+    //     this.setData({
+    //       info: res.userInfo
+    //     })
+    //   }
+    // })
+	//新授权
+	wx.getUserProfile({
+	  desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+	  success: (res) => {
+		this.setData({
+		  info: res.userInfo,
+		  hasUserInfo: true
+		})
+	  }
+	})
   },
   getCount: function () {
     var that = this

+ 6 - 6
packageUser/pages/user/invite/invite.wxml

@@ -68,8 +68,8 @@
       </view>
       <view class="list-part2" wx:if="{{wx_user.rank>=1}}">
         <view class="list-nameText">昵称</view>
-        <view class="list-priceText" style="right: 300rpx;">上月业绩</view>
-        <view class="list-priceText" style="right: 150rpx;">本月业绩</view>
+        <view class="list-priceText" style="right: 260rpx;">上月业绩</view>
+        <view class="list-priceText" style="right: 100rpx;">本月业绩</view>
         <view class="list-priceText">代理</view>
       </view>
 	  <view class="list-part2" wx:else>
@@ -91,9 +91,9 @@
         <image class="list-head" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/icon/wx.png" wx:if="{{!item.head}}"></image>
         <view class="list-name ellipsis" wx:if="{{item.nickname}}">{{item.nickname}}</view>
         <view class="list-name ellipsis" wx:if="{{!item.nickname}}">---</view>
-        <view class="list-price" style="right: 300rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group_sum}}" ></currency></view>
+        <view class="list-price" style="right: 260rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group_sum}}" ></currency></view>
         <view class="list-price" style="right: 200rpx;" wx:else><currency symbol="" value="{{item.sale_group_sum}}" ></currency></view>
-        <view class="list-price" style="right: 150rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group}}" ></currency></view>
+        <view class="list-price" style="right: 110rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group}}" ></currency></view>
         <view class="list-price" wx:else><currency symbol="" value="{{item.sale_group}}" ></currency></view>
         <view wx:if="{{item.ne_invitee.length}}">
           <view class="list-oheadlist">
@@ -120,9 +120,9 @@
         <image class="list-head" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/icon/wx.png" wx:if="{{!item.head}}"></image>
         <view class="list-name ellipsis" wx:if="{{item.nickname}}">{{item.nickname}}</view>
         <view class="list-name ellipsis" wx:if="{{!item.nickname}}">---</view>
-        <view class="list-price" style="right: 300rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group_sum}}" ></currency></view>
+        <view class="list-price" style="right: 260rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group_sum}}" ></currency></view>
         <view class="list-price" style="right: 200rpx;" wx:else><currency symbol="" value="{{item.sale_group_sum}}" ></currency></view>
-        <view class="list-price" style="right: 150rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group}}" ></currency></view>
+        <view class="list-price" style="right: 110rpx;"  wx:if="{{wx_user.rank>=1}}"><currency symbol="" value="{{item.sale_group}}" ></currency></view>
         <view class="list-price" wx:else><currency symbol="" value="{{item.sale_group}}" ></currency></view>
         <view wx:if="{{item.ne_invitee.length}}">
           <view class="list-oheadlist">

+ 1 - 1
packageUser/pages/user/invite/invite.wxss

@@ -230,7 +230,7 @@
 }
 .list-price {
   line-height: 88rpx;
-  font-size: 36rpx;
+  font-size: 28rpx;
   color: #eab86a;
   float: right;
 }

+ 18 - 8
packageUser/pages/user/invite/material/material.js

@@ -53,14 +53,24 @@ Page({
   },
   getInfo: function () {
     var that = this
-    wx.getUserInfo({
-      success: function (res) {
-        var userInfo = res.userInfo
-        that.setData({
-          userInfo: userInfo
-        })
-      }
-    })
+    // wx.getUserInfo({
+    //   success: function (res) {
+    //     var userInfo = res.userInfo
+    //     that.setData({
+    //       userInfo: userInfo
+    //     })
+    //   }
+    // })
+	//新授权
+	wx.getUserProfile({
+	  desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+	  success: (res) => {
+		this.setData({
+		  userInfo: res.userInfo,
+		  hasUserInfo: true
+		})
+	  }
+	})
   },
   changeText: function (val) {
     let num = val.currentTarget.dataset.val

+ 2 - 2
packageUser/pages/user/proxyApply/proxyApply.wxml

@@ -5,11 +5,11 @@
 		<h4 class="topname">{{userinfo.nickname}}</h4>
 		<view class="proxyapply-yeji">
 			<small>上月业绩</small>
-			{{userinfo.sale_group_sum}}
+			<currency symbol="" value="{{userinfo.sale_group_sum}}" ></currency>
 		</view>
 		<view class="proxyapply-yeji">
 			<small>本月业绩</small>
-			{{userinfo.sale_group}}
+			<currency symbol="" value="{{userinfo.sale_group}}" ></currency>
 		</view>
 	</view>
   </view>

+ 2 - 2
packageUser/pages/user/proxyReview/proxyReview.wxml

@@ -18,11 +18,11 @@
 	</view>
 	<view class="review-txt">
 		<text>上业绩</text>
-		{{agentinfo.sale_group_sum}}
+		<currency symbol="" value="{{agentinfo.sale_group_sum}}" ></currency>
 	</view>
 	<view class="review-txt">
 		<text>本月业绩</text>
-		{{agentinfo.sale_group}}
+		<currency symbol="" value="{{agentinfo.sale_group}}" ></currency>
 	</view>
   </view>
   <view wx:if="{{agentinfo.status}}" class="review-button" style="background: #eee;color:#666">

+ 1 - 1
pages/home/home.js

@@ -214,7 +214,7 @@ Page ({
   },
   onShareAppMessage: function (val) {
     return _request.share({
-      title: '欢迎来到FOHOW玖玖',
+      title: '欢迎来到凤凰菁选商城',
       path: '/pages/start/start',
       imageUrl: 'http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/share/sharemain.jpg',
       sc: 'xcx_home',

+ 43 - 0
pages/user/all/all.js

@@ -107,6 +107,22 @@ Page({
 	  													  _request.$post(url, params, success)
 	  												  }
 	  												})
+													//新授权
+													wx.getUserProfile({
+													  desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+													  success: function(res3) {
+													    console.log('userinfo',res3)
+													    var url = 'xcx/save_wx_user/info'
+														  var params = {
+															userinfo: JSON.stringify(res3.userInfo)
+														  }
+														  var success = function (res4) {
+																console.log('authorize',res4)
+																that.onShow()
+														  }
+														  _request.$post(url, params, success)
+														}
+													})
 	  											}else{
 	  								      	that.setData({
 	  											    userInfo: 'nologin'
@@ -184,6 +200,33 @@ Page({
 //    })
     }
   },
+  getUserProfile:function(){
+	  var that = this
+	wx.getUserProfile({
+	  desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+	  success: (res) => {
+		this.setData({
+		  userInfo: res.userInfo,
+		  hasUserInfo: true
+		})
+		
+		var channel_id = 0;
+		invite = wx.getStorageSync('invite');
+		if (channel && Number(channel.parent_id) > 0) {
+		  channel_id = Number(channel.parent_id)
+		}
+		var that = this
+		if (res.userInfo.detail.errMsg === 'getUserInfo:ok') {
+		  wx.showLoading({
+		    title: '加载中'
+		  })
+		  _request.sendInfo(val, channel_id, invite, that)
+		  
+		  that.onShow();
+		}
+		}
+	})
+  },
   getVersion: function (val) {
     this.check()
   },

+ 4 - 2
pages/user/all/all.wxml

@@ -1,7 +1,8 @@
 <!--登陆界面-->
 <view class="logindiv" wx:if="{{userInfo == 'nologin'}}">
 	<image class="logindiv_image" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/xcx/start.png"></image>
-    <button class="loginbtn" open-type="getUserInfo" bindgetuserinfo="getUserInfo">微信授权登陆</button>
+    <button class="loginbtn" bindtap="getUserProfile">微信授权登陆</button>
+    <!-- <button class="loginbtn" open-type="getUserInfo" bindgetuserinfo="getUserInfo">微信授权登陆</button> -->
 </view>
     
 
@@ -10,7 +11,8 @@
     <image src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/icon/parner.png" class="user-par" wx:if="{{checkData.copartner_state == 1}}" />
     <view class="user-name ellipsis">{{userInfo.nickname}}</view>
     
-    <button class="user-title" wx:if="{{userInfo == 'nologin'}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo" style="font-size: 18px;margin-top: -20px;">立即登陆</button>
+    <button class="user-title" wx:if="{{userInfo == 'nologin'}}" bindtap="getUserProfile" style="font-size: 18px;margin-top: -20px;">立即登陆</button>
+    <!-- <button class="user-title" wx:if="{{userInfo == 'nologin'}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo" style="font-size: 18px;margin-top: -20px;">立即登陆</button> -->
     
     <view class="user-title" wx:if="{{userInfo != 'nologin'}}"><text>NO.{{info.wx_user.id}}</text><text wx:if="{{info.user.tel}}"> | TEL : {{info.user.tel}}</text></view>
     <span class="user-title" style="top: 165rpx;" wx:if="{{userInfo.rank == 1}}">(身份:代理)</span>

+ 1 - 1
utils/request.js

@@ -282,7 +282,7 @@ function pageLogin (res, str) {
 function share (val) {
   var url = ''
   var image = ''
-  var title = val.title || '欢迎来到FOHOW玖玖'
+  var title = val.title || '欢迎来到凤凰菁选商城'
   if (val.path) {
     if (val.path.indexOf('?') > -1) {
       url = val.path + '&invite=' + getApp().globalData.wx_id