HuaJingwen 6 gadi atpakaļ
vecāks
revīzija
400dd7ed64

+ 46 - 0
app.wxss

@@ -205,6 +205,52 @@ page{
205 205
   padding: 2px 4px;
206 206
 }
207 207
 
208
+.mask{
209
+  position: fixed;
210
+  top: 0;
211
+  left: 0;
212
+  width: 100%;
213
+  height: 100%;
214
+  background: rgba(0, 0, 0, .5);
215
+}
216
+.mask .content{
217
+  width: 83.2%;
218
+  padding: 10px 0px 0;
219
+  background: #fff;
220
+  position: absolute;
221
+  top: 50%;
222
+  left: 50%;
223
+  transform: translate(-50%, -50%);
224
+  border-radius: 10px;
225
+  text-align: center;
226
+}
227
+.mask .content .title{
228
+  font-size: 32rpx;
229
+  color: #000;
230
+  font-weight: 600;
231
+  margin: 12px auto 20px;
232
+}
233
+.mask .content .text{
234
+  margin-bottom: 20px;
235
+  font-size: 30rpx;
236
+  color: #999;
237
+}
238
+.mask .content .text>text{
239
+  color: #E94D4D;
240
+  font-weight: 600;
241
+}
242
+.mask .content .contact-btn{
243
+  width: 100%;
244
+  height: 50px;
245
+  line-height: 50px;
246
+  margin-top: 10px;
247
+  font-size: 32rpx;
248
+  color: #3cc51f;
249
+  background: #fff;
250
+  border-top: 1rpx solid #d2d3d5;
251
+  border-radius: 0px 0px 10px 10px;
252
+}
253
+
208 254
 /*@media (-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5){
209 255
 
210 256
 }

+ 13 - 3
pages/application/application.js

@@ -8,7 +8,9 @@ Page({
8 8
     cardList: [],
9 9
     tabs: ["借款申请", "信用卡申请"],
10 10
     activeIndex: 0,
11
-    hidden: false
11
+    hidden: false,
12
+    hiddenThis: true,
13
+    appid: 0
12 14
   },
13 15
   onLoad: function () {
14 16
     this.initApplication();
@@ -51,6 +53,10 @@ Page({
51 53
         }
52 54
       });
53 55
   },
56
+  showPanel (e) {
57
+    var appid = e.currentTarget.dataset.id
58
+    this.setData({hiddenThis: false, appid: appid})
59
+  },
54 60
   initCardList() {
55 61
     var that = this, token = wx.getStorageSync('user').token, list = [];
56 62
     that.setData({hidden: false});
@@ -89,7 +95,8 @@ Page({
89 95
       var id = e.currentTarget.id;
90 96
       this.setData({
91 97
           activeIndex: id,
92
-          page: 0
98
+          page: 0,
99
+          hiddenThis: true
93 100
       });
94 101
       // console.log(this.data.activeIndex);
95 102
       if (id == 0) {
@@ -114,5 +121,8 @@ Page({
114 121
     }else{
115 122
       this.initCardList();
116 123
     }
117
-  }
124
+  },
125
+  onHide () {
126
+    this.setData({hiddenThis: true})
127
+  },
118 128
 })

+ 7 - 0
pages/application/application.wxml

@@ -18,6 +18,13 @@
18 18
             <template is="jiefItem4" data="{{cardList}}"/>
19 19
         </view>
20 20
     </view>
21
+    <view class="mask" hidden="{{hiddenThis}}">
22
+      <view class="content">
23
+        <view class="title">小提示</view>
24
+        <view class="text">回复"<text>2</text>",去还款</view>
25
+        <button class="contact-btn" open-type="contact"  session-from="id={{appid}}">我知道了</button>
26
+      </view>
27
+    </view>
21 28
 </view>
22 29
 <!-- <view class="content-wrapper">
23 30
      使用热门推荐模板,传入当前循环对象item

+ 12 - 15
pages/card/card.js

@@ -12,35 +12,32 @@ Page({
12 12
     cardList: [],
13 13
     hasNext: true,
14 14
     page: 0,
15
-    hasPhone: false
15
+    hiddenThis: true,
16
+    appid: 0
16 17
   },
17 18
   onLoad: function () {
18 19
     this.initBanner();
19 20
     this.initCardList();
20 21
     app.login(this);
21
-    this.initConcact(null, true);
22 22
   },
23 23
   onShow () {
24 24
     wx.stopPullDownRefresh()
25 25
   },
26 26
   onHide () {
27 27
     wx.stopPullDownRefresh()
28
+    this.setData({hiddenThis: true})
28 29
   },
29
-  initConcact (event, flag) {
30
-    var that = this, event = event || null, flag = flag || false;
31
-    var tel = wx.getStorageSync('tel') || '0', user_id = wx.getStorageSync('user').user_id || '0', id = 0;
30
+  initConcact (event) {
31
+    var that = this;
32
+    var tel = wx.getStorageSync('tel') || '0', user_id = wx.getStorageSync('user').user_id || '0', id = event.currentTarget.dataset.id;
32 33
     if (user_id != '0' || tel != '0') {
33
-      that.setData({hasPhone: true})
34
+      // 绑定了手机号
35
+      this.setData({hiddenThis: false, appid: id})
34 36
     }else{
35
-      that.setData({hasPhone: false});
36
-      console.log(flag);
37
-      if (!flag) {
38
-        console.log('test');
39
-        id = event.currentTarget.dataset.id
40
-        wx.navigateTo({
41
-          url: "/pages/getPhone/getPhone?from=card&preid=" + id
42
-        })
43
-      }
37
+      // 未绑定手机号
38
+      wx.navigateTo({
39
+        url: "/pages/getPhone/getPhone?from=card&preid=" + id
40
+      })
44 41
     }
45 42
   },
46 43
   initCardList: function () {

+ 7 - 0
pages/card/card.wxml

@@ -27,4 +27,11 @@
27 27
         加载中...
28 28
       </loading>
29 29
     </view>
30
+    <view class="mask" hidden="{{hiddenThis}}">
31
+      <view class="content">
32
+        <view class="title">小提示</view>
33
+        <view class="text">回复"<text>1</text>",获取贷款资格</view>
34
+        <button class="contact-btn" open-type="contact"  session-from="id=X_{{appid}}">我知道了</button>
35
+      </view>
36
+    </view>
30 37
 </view>

+ 22 - 16
pages/details/details.js

@@ -12,7 +12,8 @@ Page({
12 12
      time: 0,
13 13
      valLoan: 0,
14 14
      index: 0,
15
-     hasPhone: false
15
+     hiddenThis: true,
16
+     appid: 0
16 17
   },
17 18
   onLoad: function (options) {
18 19
     var id = options.id
@@ -21,7 +22,7 @@ Page({
21 22
     }
22 23
     this.initDetails();
23 24
     this.getRemmondList();
24
-    this.showConcact(null, true);
25
+    // this.showConcact(null, true);
25 26
     // console.log(this.data.remmondList);
26 27
   },
27 28
   bindPickerChange: function(e) {
@@ -105,22 +106,26 @@ Page({
105 106
     that.setData({money: money})
106 107
     that.caculateMoney();
107 108
   },
108
-  showConcact (event, flag) {
109
-    var that = this, event = event || null, flag = flag || false;
110
-    var tel = wx.getStorageSync('tel') || '0', user_id = wx.getStorageSync('user').user_id || '0', id = 0;
109
+  showConcact (event) {
110
+    var that = this;
111
+    var tel = wx.getStorageSync('tel') || '0', user_id = wx.getStorageSync('user').user_id || '0', id = event.currentTarget.dataset.id;
111 112
     if (user_id != '0' || tel != '0') {
112
-      console.log('test');
113
-      that.setData({hasPhone: true})
113
+      // 绑定了手机号
114
+      this.setData({hiddenThis: false, appid: id});
115
+      wx.request({
116
+        url: app.globalData.HOST + '/user/wx/known',
117
+        method: "POST",
118
+        data: {id: id, },
119
+        success: function (res) {
120
+        },
121
+        complete: function () {
122
+        }
123
+      });
114 124
     }else{
115
-      console.log(flag);
116
-      that.setData({hasPhone: false});
117
-      if (!flag) {
118
-        id = event.currentTarget.dataset.id
119
-        console.log(id);
120
-        wx.navigateTo({
121
-          url: "/pages/getPhone/getPhone?from=details&preid=" + id
122
-        })
123
-      }
125
+      // 未绑定手机号
126
+      wx.navigateTo({
127
+        url: "/pages/getPhone/getPhone?from=details&preid=" + id
128
+      })
124 129
     }
125 130
   },
126 131
   onReady: function () {
@@ -128,6 +133,7 @@ Page({
128 133
   onShow: function () {
129 134
   },
130 135
   onHide: function () {
136
+    this.setData({hiddenThis: true})
131 137
   },
132 138
   onUnload: function () {
133 139
   }

+ 8 - 2
pages/details/details.wxml

@@ -62,7 +62,13 @@
62 62
       </view>
63 63
     </view>
64 64
     <view class="button-wrapper" data-id="{{info.id}}" bindtap="showConcact">
65
-      <button class="contact-btn" open-type="contact"  session-from="id=Y_{{info.id}}&period={{time}}&money={{money}}" wx-if="{{hasPhone}}">我要申请</button>
66
-      <button class="contact-btn" wx-if="{{!hasPhone}}">我要申请</button>
65
+      <button class="contact-btn" wx-if="{{!hasPhone}}" >我要申请</button>
66
+    </view>
67
+    <view class="mask" hidden="{{hiddenThis}}">
68
+      <view class="content">
69
+        <view class="title">小提示</view>
70
+        <view class="text">回复"<text>1</text>",获取贷款资格</view>
71
+        <button class="contact-btn" open-type="contact"  session-from="id=Y_{{appid}}">我知道了</button>
72
+      </view>
67 73
     </view>
68 74
 </view>

+ 25 - 3
pages/getIt/getIt.js

@@ -1,20 +1,42 @@
1
+const app = getApp();
1 2
 Page({
2 3
   data: {
3 4
     phone_number:'18888888888',
4 5
     from: '',
5
-    preid: ''
6
+    preid: '',
7
+    hiddenThis: true,
8
+    appid: 0
6 9
   },
7 10
   onLoad: function (options) {
8 11
     var that = this, tel = options.tel, preid = options.preid || 0, from = options.from;
9
-    console.log(tel);
10
-    console.log(preid);
12
+    // console.log(tel);
11 13
     that.setData({phone_number: tel, preid: preid, from: from})
12 14
   },
15
+  goApply () {
16
+    var id = this.data.id, from = this.data.from, appid = '';
17
+    if (from == 'card') {
18
+      appid = 'X_' + id
19
+    }else{
20
+      console.log(from);
21
+      appid = 'Y_' + id;
22
+      wx.request({
23
+        url: app.globalData.HOST + '/user/wx/known',
24
+        method: "POST",
25
+        data: {id: id, },
26
+        success: function (res) {
27
+        },
28
+        complete: function () {
29
+        }
30
+      });
31
+    }
32
+    this.setData({hiddenThis: false, appid: appid})
33
+  },
13 34
   onReady: function () {
14 35
   },
15 36
   onShow: function () {
16 37
   },
17 38
   onHide: function () {
39
+    this.setData({hiddenThis: true})
18 40
   },
19 41
   onUnload: function () {
20 42
   }

+ 8 - 2
pages/getIt/getIt.wxml

@@ -5,6 +5,12 @@
5 5
         <view class='phone_number'>手机:<text>{{phone_number}}</text></view>
6 6
     </view>
7 7
     <view class='details'>同时申请<text>3</text>款以上产品,成功率提升<text>90%</text></view>
8
-    <button class="contact-btn" open-type="contact"  session-from="id=X_{{preid}}" wx-if="{{from == 'card' && preid != 0}}">立即申请</button>
9
-    <button class="contact-btn" open-type="contact"  session-from="id=Y_{{preid}}" wx-if="{{from != 'card' && preid != 0}}">立即申请</button>
8
+    <button class="contact-btn" bindtap="goApply">立即申请</button>
9
+    <view class="mask" hidden="{{hiddenThis}}">
10
+      <view class="content">
11
+        <view class="title">小提示</view>
12
+        <view class="text">回复"<text>1</text>",获取贷款资格</view>
13
+        <button class="contact-btn" open-type="contact"  session-from="id={{appid}}">我知道了</button>
14
+      </view>
15
+    </view>
10 16
 </view>

+ 1 - 0
pages/index/index.wxml

@@ -27,3 +27,4 @@
27 27
 
28 28
 
29 29
 
30
+

+ 3 - 5
pages/template/template.wxml

@@ -24,7 +24,7 @@
24 24
           <image class="icon" src="{{item.card_icon}}"/>
25 25
       </view>
26 26
       <view class="weui-cell__bd">
27
-          <button class="contact-btn" open-type="contact"  session-from="id=X_{{item.id}}" wx-if="{{hasPhone}}"/>
27
+          <!--bindtap="initConcact" <button class="contact-btn" open-type="contact"  session-from="id=X_{{item.id}}" wx-if="{{hasPhone}}"/> -->
28 28
           <view class="title">{{item.name}}<view wx:for="{{item.keywords}}" wx:for-item="word" wx:key="void" wx-if="{{word == '礼' && item.keywords.length > 0}}" class="weui-badge">{{word}}</view><view wx:for="{{item.keywords}}" wx:for-item="word" wx:key="void" wx-if="{{word !== '礼' && item.keywords.length > 0}}" class="weui-badge other">{{word}}</view></view>
29 29
           <view class="desc elli">{{item.desc}}</view>
30 30
           <view class="desc elli" >申请人数<text class="emphasize">{{item.apply_num}}</text></view>
@@ -37,14 +37,13 @@
37 37
 
38 38
 <template name="jiefItem3">
39 39
   <block wx:for="{{dataList}}" wx:key="void">
40
-  <view class="weui-cells weui-cells_after-title template">
40
+  <view class="weui-cells weui-cells_after-title template" data-id="Y_{{item.product_id}}" bindtap="showPanel">
41 41
     <view class="weui-cell borrow-list-temp">
42 42
       <button class="notice-btn">我要还款</button>
43 43
       <view class="weui-cell__hd">
44 44
           <image class="icon" src="{{item.product_icon}}"/>
45 45
       </view>
46 46
       <view class="weui-cell__bd">
47
-          <button class="contact-btn" open-type="contact"  session-from="id=Y_{{item.product_id}}"/>
48 47
           <view class="title">{{item.product_name}}<view class="weui-badge" wx-if="{{item.prod_title != null}}">{{item.prod_title}}</view></view>
49 48
           <view class="desc elli">{{item.create_time}}</view>
50 49
           <view class="desc elli" >贷款金额<text class="emphasize">{{item.money}}</text>贷款期数<text class="emphasize">{{item.periods}}</text></view>
@@ -57,13 +56,12 @@
57 56
 
58 57
 <template name="jiefItem4">
59 58
 <block wx:for="{{cardList}}" wx:key="void">
60
-  <view class="weui-cells weui-cells_after-title template" data-id="{{item.product_id}}">
59
+  <view class="weui-cells weui-cells_after-title template" data-id="X_{{item.product_id}}" bindtap="showPanel">
61 60
     <view class="weui-cell card-list-temp">
62 61
       <view class="weui-cell__hd">
63 62
           <image class="icon" src="{{item.icon}}"/>
64 63
       </view>
65 64
       <view class="weui-cell__bd">
66
-          <button class="contact-btn" open-type="contact"  session-from="id=X_{{item.product_id}}"/>
67 65
           <view class="title">{{item.product_name}}</view>
68 66
           <view class="desc elli">{{item.desc}}</view>
69 67
           <view class="desc elli" >申请时间: {{item.create_time}}</view>

+ 18 - 2
project.config.json

@@ -20,6 +20,10 @@
20 20
 			"current": -1,
21 21
 			"list": []
22 22
 		},
23
+		"plugin": {
24
+			"current": -1,
25
+			"list": []
26
+		},
23 27
 		"game": {
24 28
 			"list": []
25 29
 		},
@@ -58,8 +62,8 @@
58 62
 				},
59 63
 				{
60 64
 					"id": 5,
61
-					"name": "eg",
62
-					"pathName": "pages/eg/eg",
65
+					"name": "card",
66
+					"pathName": "pages/card/card",
63 67
 					"query": ""
64 68
 				},
65 69
 				{
@@ -127,6 +131,18 @@
127 131
 					"name": "signup",
128 132
 					"pathName": "pages/signup/signup",
129 133
 					"query": ""
134
+				},
135
+				{
136
+					"id": -1,
137
+					"name": "application",
138
+					"pathName": "pages/application/application",
139
+					"query": ""
140
+				},
141
+				{
142
+					"id": -1,
143
+					"name": "getIt",
144
+					"pathName": "pages/getIt/getIt",
145
+					"query": ""
130 146
 				}
131 147
 			]
132 148
 		}