HuaJingwen 7 years ago
parent
commit
71a05e1817

+ 27 - 0
app.js

@@ -54,5 +54,32 @@ App({
54 54
         }
55 55
       }
56 56
     });
57
+  },
58
+  confirmModal (content, func) {
59
+    wx.showModal({
60
+      title: '小提示',
61
+      content: content,
62
+      success: function(res) {
63
+        if (res.confirm) {
64
+          console.log('用户点击确定')
65
+          func();
66
+        } else if (res.cancel) {
67
+          console.log('用户点击取消')
68
+        }
69
+      }
70
+    })
71
+  },
72
+  noticeModal (content) {
73
+    wx.showModal({
74
+      title: '小提示',
75
+      content: content,
76
+      showCancel: false,
77
+      confirmText: '我知道了',
78
+      success: function(res) {
79
+        if (res.confirm) {
80
+          console.log('用户点击确定')
81
+        }
82
+      }
83
+    })
57 84
   }
58 85
 })

+ 3 - 3
pages/application/application.js

@@ -26,9 +26,9 @@ Page({
26 26
             })*/
27 27
           }else if(data.errno == '90001'){
28 28
             console.log('go');
29
-            wx.navigateTo({
30
-              // url: '/pages/'
31
-            })
29
+            // wx.navigateTo({
30
+            //   url: '/pages/getPhone/getPhone'
31
+            // })
32 32
           }
33 33
         },
34 34
         complete: function () {

+ 36 - 45
pages/getPhone/getPhone.js

@@ -1,66 +1,57 @@
1 1
 // pages/logs_to/logs_to.js
2
+var app = getApp();
2 3
 Page({
3
-
4
-  /**
5
-   * 页面的初始数据
6
-   */
7 4
   data: {
8
-  
9
-  },
10 5
 
11
-  /**
12
-   * 生命周期函数--监听页面加载
13
-   */
14
-  onLoad: function (options) {
15
-  
16 6
   },
7
+  onLoad: function (options) {
17 8
 
18
-  /**
19
-   * 生命周期函数--监听页面初次渲染完成
20
-   */
21
-  onReady: function () {
22
-  
23 9
   },
10
+  getPhoneNumber: function(e) {
11
+    var that = this;
12
+    if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
13
+      console.log(e.detail.errMsg === 'getPhoneNumber:fail user deny');
14
+      app.noticeModal('不绑定手机号的话就不能申请了哦');
15
+    }else{
16
+      let token = wx.getStorageSync('token');
17
+      // console.log(e.detail.iv)
18
+      // console.log(e.detail.encryptedData)
19
+      that.telHost(token, e.detail.iv, e.detail.encryptedData)
20
+    }
21
+  },
22
+  telHost (token, iv, encryptedData) {
23
+    wx.request({
24
+      url: app.globalData.HOST + '/user/wx/getUserPhone',
25
+      method: 'POST',
26
+      data: {token: token, iv: iv, encryptedData: encryptedData},
27
+      success: function (res) {
28
+        var data = res.data
29
+        console.log(data);
30
+        if (res.data.errno == '0'){
31
+        }else{
32
+        }
33
+      }
34
+    });
35
+  },
36
+  onReady: function () {
24 37
 
25
-  /**
26
-   * 生命周期函数--监听页面显示
27
-   */
28
-  onShow: function () {
29
-  
30 38
   },
39
+  onShow: function () {
31 40
 
32
-  /**
33
-   * 生命周期函数--监听页面隐藏
34
-   */
35
-  onHide: function () {
36
-  
37 41
   },
42
+  onHide: function () {
38 43
 
39
-  /**
40
-   * 生命周期函数--监听页面卸载
41
-   */
42
-  onUnload: function () {
43
-  
44 44
   },
45
+  onUnload: function () {
45 46
 
46
-  /**
47
-   * 页面相关事件处理函数--监听用户下拉动作
48
-   */
49
-  onPullDownRefresh: function () {
50
-  
51 47
   },
48
+  onPullDownRefresh: function () {
52 49
 
53
-  /**
54
-   * 页面上拉触底事件的处理函数
55
-   */
56
-  onReachBottom: function () {
57
-  
58 50
   },
51
+  onReachBottom: function () {
59 52
 
60
-  /**
61
-   * 用户点击右上角分享
62
-   */
53
+  },
63 54
   onShareAppMessage: function () {
64
-  
55
+
65 56
   }
66 57
 })

+ 1 - 1
pages/getPhone/getPhone.wxml

@@ -1,5 +1,5 @@
1 1
 <view class='pd64'>
2
-  <button type="btn" class='wx_login_btn'> <image src='../resource/image/wx_login.png'></image>微信快速登录</button>
2
+  <button type="btn" class='wx_login_btn' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> <image src='../resource/image/wx_login.png'></image>微信快速登录</button>
3 3
   <button type="btn" class='zfb_login_btn'> <image src='../resource/image/zfb_login.png'></image>手机验证码注册 </button>
4 4
 </view>
5 5
 <view class='details'>同时申请<text>3</text>款以上产品,成功率提升<text>90%</text></view>

+ 1 - 1
pages/index/index.js

@@ -19,7 +19,7 @@ Page({
19 19
     var that = this;
20 20
     app.login();
21 21
     wx.request({
22
-      url: 'http://m.henhaojie.com/user/product/homeact',
22
+      url: app.globalData.HOST + '/user/product/homeact',
23 23
       success: function (res) {
24 24
         if (res.data.errno == '0'){
25 25
           that.setData({ imgUrls: res.data.rst.homeact});

+ 12 - 1
pages/mine/mine.js

@@ -18,11 +18,22 @@ Page({
18 18
       success: function (res) {
19 19
         if (res.data.errno == '0'){
20 20
           data = res.data.rst
21
-          console.log(data);
22 21
           that.setData({userInfo: data})
23 22
         }else if(res.data.errno == '90001'){
24 23
         }
25 24
       }
26 25
     });
26
+  },
27
+  goApplication () {
28
+    var tel = wx.getStorageSync('tel');
29
+    if (tel) {
30
+      wx.navigateTo({
31
+        url: '/pages/application/application'
32
+      })
33
+    }else{
34
+      wx.navigateTo({
35
+        url: '/pages/getPhone/getPhone'
36
+      })
37
+    }
27 38
   }
28 39
 })

+ 3 - 3
pages/mine/mine.wxml

@@ -11,13 +11,13 @@
11 11
     <!--内容列表部分-->
12 12
     <view class="content_list top_hr">
13 13
       <!--我的申请-->
14
-      <view class='my_applisation'>
15
-        <navigator url="/pages/application/application" hover-class="navigator-hover">
14
+      <view class='my_applisation' bindtap="goApplication">
15
+        <!-- <navigator url="/pages/application/application" hover-class="navigator-hover"> -->
16 16
           <view class='my_list_01'>
17 17
             <image src="/pages/resource/image/my_Application.png" />
18 18
           </view>
19 19
           <view class='my_list_02'>我的申请</view>
20
-        </navigator>
20
+        <!-- </navigator> -->
21 21
       </view>
22 22
     </view>
23 23
   </view>

+ 1 - 1
pages/questions/questions.json

@@ -1,3 +1,3 @@
1 1
 {
2
-  "navigationBarTitleText": "查看启动日志"
2
+  "navigationBarTitleText": "常见问题"
3 3
 }

BIN
pages/resource/image/image/Feedback.png


BIN
pages/resource/image/image/job.png


BIN
pages/resource/image/image/money.png


BIN
pages/resource/image/image/my_Application.png


BIN
pages/resource/image/image/my_set.png


BIN
pages/resource/image/image/wx_login.png


BIN
pages/resource/image/image/zfb_login.png