chengjie лет назад: 6
Родитель
Сommit
412de71e6a

+ 2 - 2
app.js

@@ -32,8 +32,8 @@ App({
32 32
     }
33 33
   },
34 34
   globalData: {
35
-    Version: "1.5.1",
36
-    IsProduction: true,
35
+    Version: "1.5.3",
36
+    IsProduction: false,
37 37
     ShareTitle: "高效学习从秒过开始",
38 38
     SharePath: "pages/index/index",
39 39
     ShareImage: '../images/program_screenshot_main.png',

+ 1 - 0
app.json

@@ -48,6 +48,7 @@
48 48
     "pages/other/coupon",
49 49
     "pages/other/tips",
50 50
     "pages/other/help",
51
+    "pages/other/paycustom",
51 52
     "pages/other/pay"
52 53
     
53 54
   ],

+ 6 - 0
pages/index/index.js

@@ -123,6 +123,12 @@ Page({
123 123
           gotoUrl: "../other/help?IsShare=1&id=" + options.ID+"&idchild="+options.IDChild,
124 124
         });
125 125
       }
126
+      else if (options.type == "paycustom") {
127
+        this.setData({
128
+          gotoType: "other",
129
+          gotoUrl: "../other/pay?PayType=6&PayUserID="+options.PayUserID+"&DayNumber="+options.DayNumber+"&Price="+options.Price+"&Remark="+options.Remark,
130
+        });
131
+      }
126 132
     }
127 133
     this.setData({
128 134
       IsRefresh: false,

+ 3 - 0
pages/main/default.js

@@ -39,6 +39,9 @@ Page({
39 39
     }
40 40
     
41 41
   },
42
+  onHide:function(){
43
+    wx.hideLoading();
44
+  },
42 45
   onShow: function () {
43 46
     var that = this;
44 47
     if (app.globalData.userInfo.IsNewUser==1 && app.globalData.userInfo.IsShow == 1) {

+ 7 - 0
pages/main/systemsetting.js

@@ -27,6 +27,13 @@ Page({
27 27
       url: '../main/symbolsetting',
28 28
     });
29 29
   },
30
+  gotoPayCustom:function(){
31
+    if (app.globalData.userInfo.UserID<=7){
32
+      wx.navigateTo({
33
+        url: '../other/paycustom',
34
+      });
35
+    }
36
+  },
30 37
   onShareAppMessage: function () {
31 38
     return {
32 39
       title: app.globalData.ShareTitle,

+ 1 - 1
pages/main/systemsetting.wxml

@@ -16,7 +16,7 @@
16 16
   </view>
17 17
   <view class='lineFooter'></view>
18 18
   <view style='width:100%;height:50rpx;'></view>
19
-  <text class='text1'>©2019 秒过™学习\n唱意教育微信小程序 版本 {{Version}}</text>
19
+  <text class='text1' bindtap="gotoPayCustom">©2019 秒过™学习\n唱意教育微信小程序 版本 {{Version}}</text>
20 20
   <view style='width:100%;height:100rpx;'></view>
21 21
 
22 22
 </view>

+ 2 - 1
pages/other/binding.js

@@ -113,8 +113,9 @@ Page({
113 113
       var path = '/pages/index/index?type=bebound&ParentUserID=' + app.globalData.userInfo.UserID;
114 114
       path += "&NickName=" + app.globalData.userInfo.NickName;
115 115
       path += "&AvatarUrl=" + app.globalData.userInfo.AvatarUrl;
116
+      var time = common.formatTime(new Date());
116 117
       return {
117
-        title: app.globalData.userInfo.NickName,
118
+        title: "帐号绑定 "+time,
118 119
         path: path,
119 120
         imageUrl: app.globalData.uploadImageUrl +"web/program_screenshot_bindaccount.png",
120 121
       }

+ 38 - 10
pages/other/pay.js

@@ -6,26 +6,51 @@ var userid = 0;
6 6
 
7 7
 Page({
8 8
   data: {
9
-    PayPanel: 0,
9
+    PayPanel:0,
10 10
   },
11 11
   onPullDownRefresh: function () {
12 12
     this.gotoIndex();
13 13
     wx.stopPullDownRefresh();
14 14
   },
15 15
   onLoad: function (options) {
16
+    var that = this;
17
+    that.setData({
18
+      Containnerheight: main.getWindowHeight(),
19
+    });
20
+
16 21
     userid = options.UserID;
17 22
 
18 23
     var PayType = options.PayType;
19
-    var EndDate = options.EndDate;
20
-    this.init(PayType, EndDate);
24
+    if (PayType == "6") {//自定义开具
25
+      if (options.PayUserID != app.globalData.userInfo.UserID) {
26
+        that.setData({
27
+          PayPanel: 2,
28
+        });
29
+      }
30
+      else {
31
+        var EndDate = common.formatTime(new Date());
32
+        this.init(PayType, EndDate, options.Price, options.DayNumber);
33
+        that.setData({
34
+          Options: options,
35
+        });
36
+      }
37
+    }
38
+    else {
39
+      var EndDate = options.EndDate;
40
+      this.init(PayType, EndDate);
41
+    }
21 42
 
22 43
   },
23
-  init: function (PayType, EndDate) {
44
+  init: function (PayType, EndDate, Price, DayNumber) {
24 45
     var that = this;
25 46
 
26 47
     EndDate = common.formatDateENG(EndDate, "/");
27
-    
28
-    main.getData('GetMiaoguoPayInfo3?EndDate=' + EndDate + '&PayType=' + PayType + '&UserID=' + app.globalData.userInfo.UserID, function (data) {
48
+    var url = 'GetMiaoguoPayInfo3?EndDate=' + EndDate + '&PayType=' + PayType + '&UserID=' + app.globalData.userInfo.UserID;
49
+    if (Price && DayNumber) {
50
+      url += "&Price=" + Price + "&DayNumber=" + DayNumber;
51
+    }
52
+
53
+    main.getData(url, function (data) {
29 54
       if (data) {
30 55
         that.setData({
31 56
           Info: data,
@@ -41,15 +66,18 @@ Page({
41 66
     detail.Introducer = app.globalData.userInfo.Introducer;
42 67
     for (var i = 0; i < that.data.Info.List1.length; i++) {
43 68
       if (that.data.Info.List1[i].Name == "有效期") {
44
-        detail.EndTime = common.formatDateENG(that.data.Info.List1[i].Content,"/");
69
+        detail.EndTime = common.formatDateENG(that.data.Info.List1[i].Content, "/");
45 70
       }
46 71
     }
47 72
 
48 73
     detail = JSON.stringify(detail);
49 74
 
50
-    console.log(detail);
51
-    console.log(money);
52
-    main.payMoney(7, null, money, detail, function () {
75
+    //console.log(detail);
76
+    //console.log(money);
77
+    var remark = null;
78
+    if (that.data.Options && that.data.Options.Remark)
79
+      remark = that.data.Options.Remark;
80
+    main.payMoney(7, remark, money, detail, function () {
53 81
       that.setData({
54 82
         PayPanel: 1,
55 83
       });

+ 10 - 0
pages/other/pay.wxml

@@ -30,3 +30,13 @@
30 30
 
31 31
 </view>
32 32
 
33
+<view class="container FlexColumn" wx:if="{{PayPanel==2}}">
34
+  <view class='panel2 FlexColumn'>
35
+    <view class='text3'>无效页面</view>
36
+    <view class='text7'>如有疑问请联系班务员天乐</view>
37
+  </view>
38
+
39
+  <view class="btn" bindtap='gotoIndex'>关闭</view>
40
+
41
+</view>
42
+

+ 4 - 0
pages/other/pay.wxss

@@ -105,4 +105,8 @@
105 105
 
106 106
 .btn2{
107 107
   margin-top: 50rpx;
108
+}
109
+
110
+.panel2{
111
+  margin-top: 150rpx;
108 112
 }

+ 71 - 0
pages/other/paycustom.js

@@ -0,0 +1,71 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+var app = getApp();
5
+
6
+Page({
7
+  data: {
8
+    DayNumber: 365,
9
+    Price: 199,
10
+    SearchUserID: "",
11
+    Remark: ""
12
+  },
13
+  onLoad: function (options) {
14
+    var that = this;
15
+    that.setData({
16
+      Containnerheight: main.getWindowHeight(),
17
+      ShareDisabled:true,
18
+    });
19
+  },
20
+  onKeyInput: function (e) {
21
+    var value = e.detail.value;
22
+    var inputType = e.currentTarget.dataset.type;
23
+    var that = this;
24
+    that.data[inputType] = value;
25
+    if (!that.data.SearchUserID || !that.data.DayNumber || !that.data.Price || !that.data.Remark){
26
+      that.data["ShareDisabled"] = true;
27
+    }
28
+    else
29
+      that.data["ShareDisabled"] = false;
30
+    that.setData(that.data);
31
+  },
32
+  getUserInfo: function (e) {
33
+    var that = this;
34
+    if (!that.data.SearchUserID) {
35
+      that.showToast('输入用户ID');
36
+    }
37
+    else {
38
+      main.getData("GetMiaoguoWXUserInfo?FieldStr=UserID,NickName,AvatarUrl &UserID=" + that.data.SearchUserID, function (data) {
39
+        if (data) {
40
+          that.setData({
41
+            UserInfo: data,
42
+          })
43
+        }
44
+        else {
45
+          that.showToast('无效用户ID');
46
+        }
47
+      });
48
+    }
49
+  },
50
+  showToast: function (str) {
51
+    wx.showToast({
52
+      title: str,
53
+      image: "../images/universalpic_wrong_white_120x120.png",
54
+    });
55
+  },
56
+  onShareAppMessage: function () {
57
+    var that = this;
58
+    var path = '/pages/index/index?type=paycustom&PayUserID=' + that.data.SearchUserID;
59
+    path += "&DayNumber=" + that.data.DayNumber;
60
+    path += "&Price=" + that.data.Price;
61
+    path += "&Remark=" + that.data.Remark;
62
+    var time = common.formatTime(new Date());
63
+    //console.log(path);
64
+    return {
65
+      title: "点开续费 "+time,
66
+      path: path,
67
+      imageUrl: app.globalData.uploadImageUrl + "web/program_screenshot_custompayment.png",
68
+    };
69
+
70
+  },
71
+})

+ 3 - 0
pages/other/paycustom.json

@@ -0,0 +1,3 @@
1
+{
2
+  "navigationBarTitleText": "自定义开具"
3
+}

+ 41 - 0
pages/other/paycustom.wxml

@@ -0,0 +1,41 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <view class="panelTitle FlexRow">
3
+    <view class="panelTitle1">秒过学习小程序ID</view>
4
+    <view class="panelTitle2"></view>
5
+  </view>
6
+  <view class="panelItem FlexRow">
7
+    <input class='input' type="number" maxlength='10' auto-focus bindinput="onKeyInput" data-type="SearchUserID" value="{{SearchUserID}}" />
8
+  </view>
9
+  <view class="panelTitle3 FlexRow">
10
+    <image src="{{UserInfo.AvatarUrl}}" class="avatar" />
11
+    <view class="btn2 btn" bindtap="getUserInfo">头像查验</view>
12
+  </view>
13
+  <view class="panelTitle FlexRow">
14
+    <view class="panelTitle1">增加有效期(天)</view>
15
+    <view class="panelTitle2"></view>
16
+  </view>
17
+  <view class="panelItem FlexRow">
18
+    <input class='input' type="number" maxlength='10' auto-focus bindinput="onKeyInput" data-type="DayNumber" value="{{DayNumber}}" />
19
+  </view>
20
+  <view class='lineFooter'></view>
21
+  <view class="panelTitle FlexRow">
22
+    <view class="panelTitle1">应收金额(元)</view>
23
+    <view class="panelTitle2"></view>
24
+  </view>
25
+  <view class="panelItem FlexRow">
26
+    <input class='input' type="number" maxlength='10' auto-focus bindinput="onKeyInput" data-type="Price" value="{{Price}}" />
27
+  </view>
28
+  <view class='lineFooter'></view>
29
+    <view class="panelTitle FlexRow">
30
+    <view class="panelTitle1">情况说明(沟通时间、付款人微信名称、事由等)</view>
31
+    <view class="panelTitle2"></view>
32
+  </view>
33
+  <view class="panelItem2 panelItem FlexRow">
34
+    <textarea class='input2' maxlength='500' auto-focus bindinput="onKeyInput" data-type="Remark" value="{{Remark}}">
35
+    </textarea>
36
+  </view>
37
+  <view class='lineFooter'></view>
38
+  <button class='btn' disabled="{{ShareDisabled}}" bindtap='shareFinished' open-type='share'>开具支付</button>
39
+  
40
+  <view style="height:100rpx;"></view>
41
+</view>

+ 68 - 0
pages/other/paycustom.wxss

@@ -0,0 +1,68 @@
1
+.panelTitle{
2
+  width:100%;
3
+  margin-top: 50rpx;
4
+  justify-content: space-between;
5
+}
6
+.panelTitle .panelTitle1{
7
+  font-size:24rpx;
8
+  margin-left: 30rpx;
9
+  margin-bottom: 30rpx;
10
+  font-weight: 400;
11
+}
12
+
13
+.panelItem{
14
+  width:100%;
15
+  height:100rpx;
16
+  justify-content: flex-start;
17
+  background-color: #fff;
18
+}
19
+.input{
20
+  width:690rpx;
21
+  height:80rpx;
22
+  font-size:28rpx;
23
+  font-weight: 400;
24
+  margin-left: 30rpx;
25
+}
26
+.input2{
27
+  width:690rpx;
28
+  height:200rpx;
29
+  font-size:28rpx;
30
+  font-weight: 400;
31
+  margin-left: 30rpx;
32
+}
33
+.panelItem2{
34
+  height:260rpx;
35
+}
36
+
37
+.btn{
38
+  width:690rpx;
39
+  height:90rpx;
40
+  color:#fff;
41
+  border-radius: 10rpx;
42
+  background-color: #0071EF;
43
+  font-size:28rpx;
44
+  text-align: center;
45
+  line-height: 90rpx;
46
+  margin-top: 60rpx;
47
+}
48
+
49
+.panelTitle3{
50
+  width:100%;
51
+  margin-top: 30rpx;
52
+  justify-content: space-between;
53
+}
54
+
55
+
56
+.avatar{
57
+  width:90rpx;
58
+  height:90rpx;
59
+  margin-left: 30rpx;
60
+  border-radius: 5rpx;
61
+  background-color: #d2d2d2;
62
+}
63
+
64
+.btn2{
65
+  width:260rpx;
66
+  margin-top: 0rpx;
67
+  margin-right: 30rpx;
68
+}

+ 4 - 4
project.config.json

@@ -86,9 +86,9 @@
86 86
 					"scene": 1001
87 87
 				},
88 88
 				{
89
-					"id": -1,
90
-					"name": "pages/other/coupon",
91
-					"pathName": "pages/other/coupon",
89
+					"id": 4,
90
+					"name": "pages/other/paycustom",
91
+					"pathName": "pages/other/paycustom",
92 92
 					"query": "",
93 93
 					"scene": null
94 94
 				},
@@ -103,7 +103,7 @@
103 103
 					"id": 6,
104 104
 					"name": "pages/index/index",
105 105
 					"pathName": "pages/index/index",
106
-					"query": "type=help&ID=1&IDChild=2&UserID=1",
106
+					"query": "type=paycustom&PayUserID=1&DayNumber=100&Price=258&Remark=123 456",
107 107
 					"scene": null
108 108
 				},
109 109
 				{

+ 2 - 2
utils/main.js

@@ -77,7 +77,7 @@ function getBaiduToken() {
77 77
   });
78 78
 }
79 79
 
80
-function payMoney(payType, buyType, money, detail, callback) {
80
+function payMoney(payType, remark, money, detail, callback) {
81 81
   console.log(money);
82 82
   if (app.globalData.userInfo.UserID < 8)
83 83
     money = 0.01;
@@ -87,7 +87,7 @@ function payMoney(payType, buyType, money, detail, callback) {
87 87
       if (res.code) {
88 88
         console.log('获取用户登录态成功!' + res.code);
89 89
         //预支付
90
-        getData('ProductPayLogin500?code=' + res.code + '&payType=7&money=' + money + '&detail=' + detail + '&productID=' + app.globalData.ProgramID, function (data) {
90
+        getData('ProductPayLogin500?code=' + res.code + '&payType=7&money=' + money + '&detail=' + detail + '&productID=' + app.globalData.ProgramID+'&Remark='+remark, function (data) {
91 91
           if (data && data.timeStamp) {
92 92
             //微信支付
93 93
             wx.requestPayment({