Your Name пре 5 година
родитељ
комит
7cd7b823d3

+ 5 - 3
app.js

@@ -53,15 +53,18 @@ App({
53 53
   
54 54
   },
55 55
 
56
+  onLoad: function (options) {
57
+
58
+   
56 59
   
60
+  },
61
+
57 62
   onLaunch: function (options) {
58 63
     wx.showShareMenu();
59 64
 
60 65
     var _this = this;
61 66
     // 查看是否授权
62 67
  
63
-
64
-
65 68
   },
66 69
 
67 70
   // 提示框
@@ -202,7 +205,6 @@ App({
202 205
           // console.log(province);
203 206
 
204 207
         }
205
-
206 208
       }
207 209
     })
208 210
   },


+ 27 - 15
pages/chat-list/chat-list.js

@@ -20,7 +20,18 @@ Page({
20 20
      */
21 21
     onLoad(options) {
22 22
       let that = this;
23
-      // emojiChar: "☺-😋-😌-😍-😏-😜-😝-😞-😔-😪-😭-😁-😂-😃-😅-😆-👿-😒-😓-😔-😏-😖-😘-😚-😒-😡-😢-😣-😤-😢-😨-😳-😵-😷-😸-😻-😼-😽-😾-😿-🙊-🙋-🙏-✈-🚇-🚃-🚌-🍄-🍅-🍆-🍇-🍈-🍉-🍑-🍒-🍓-🐔-🐶-🐷-👦-👧-👱-👩-👰-👨-👲-👳-💃-💄-💅-💆-💇-🌹-💑-💓-💘-🚲",
23
+
24
+      app.postRequest('my/images/headurl', {}, function (res) {
25
+        if (res.code == 201) {
26
+        //  console.log(res);
27
+          that.setData({
28
+            myheadurl: res.data.img,
29
+            // optioninfocode: res,
30
+          })
31
+        }
32
+      })
33
+
34
+    // emojiChar: "☺-😋-😌-😍-😏-😜-😝-😞-😔-😪-😭-😁-😂-😃-😅-😆-👿-😒-😓-😔-😏-😖-😘-😚-😒-😡-😢-😣-😤-😢-😨-😳-😵-😷-😸-😻-😼-😽-😾-😿-🙊-🙋-🙏-✈-🚇-🚃-🚌-🍄-🍅-🍆-🍇-🍈-🍉-🍑-🍒-🍓-🐔-🐶-🐷-👦-👧-👱-👩-👰-👨-👲-👳-💃-💄-💅-💆-💇-🌹-💑-💓-💘-🚲",
24 35
 
25 36
 
26 37
 
@@ -35,6 +46,9 @@ Page({
35 46
         _that.data.conversations[index].count = 0;
36 47
       }
37 48
     }
49
+  
50
+    //唯一用户表示
51
+    wx.setStorageSync('ChatListCount', e.currentTarget.dataset.item.to_str);
38 52
     // wx.setStorageSync('','');
39 53
     wx.setStorageSync('chat_to_id', e.currentTarget.dataset.item.to_id)
40 54
     wx.navigateTo({
@@ -59,20 +73,6 @@ Page({
59 73
 
60 74
     }
61 75
       console.log(e,111111222222);
62
-   
63
-    console.log(11);
64
-
65
-      app.postRequest('my/images/headurl', {}, function (res) {
66
-        if (res.code == 201) {
67
-          console.log(res);
68
-          _this.setData({
69
-            myheadurl: res.data.img,
70
-            // optioninfocode: res,
71
-          })
72
-        }
73
-      })
74
-
75
-      console.log(getApp().UserId());
76 76
       webSocket.sendSocketMessage({
77 77
         msg: JSON.stringify({ form_id: getApp().UserId(), type: 'Chat_list' }),
78 78
         success: function (res) {
@@ -105,12 +105,24 @@ Page({
105 105
   onSocketMessageCallback:function(e){
106 106
      let _this = this; 
107 107
     let data =  JSON.parse(e);
108
+    let chatlistcount = wx.getStorageSync('ChatListCount')
109
+    try {
110
+     
108 111
  
112
+    } catch (e) {
113
+      // Do something when catch error
114
+    }
109 115
     switch(data.type){
110 116
       case 'Chat_list':
111 117
       let dataAtt = data.data
112 118
       console.log(data.data,111111);
113 119
         for (var index in dataAtt) {
120
+          //清除缓存
121
+          if (chatlistcount && dataAtt[index].to_str == chatlistcount) {
122
+            wx.removeStorageSync('ChatListCount');
123
+            console.log(112233);
124
+            dataAtt[index].count = 0;
125
+          }
114 126
           if (dataAtt[index].type == 2) {
115 127
             dataAtt[index].content = '[图片]'
116 128
           }

+ 1 - 1
pages/chat/chat.js

@@ -342,6 +342,6 @@ Page({
342 342
     this.SocketSend({ to_id: _that.data.friendId, form_id: getApp().UserId(), type: 'get_history', page: _that.data.limit_page})
343 343
   },
344 344
   emojis:function(){
345
-      console.log(1111);
345
+    getApp().Tips('该功能正在开发中。');
346 346
   }
347 347
 });

BIN
pages/index/.DS_Store


+ 3 - 0
pages/index/index.js

@@ -1,3 +1,4 @@
1
+
1 2
 const app = getApp();
2 3
 const webSocket = require('../../utils/websocket.js');
3 4
 Page({
@@ -1027,4 +1028,6 @@ var transformation = function (resdata) {
1027 1028
     resdata = _min + '-' + _max
1028 1029
   }
1029 1030
   return resdata;
1031
+
1032
+
1030 1033
 }

+ 14 - 4
pages/index_details/index_details.js

@@ -253,10 +253,20 @@ console.log(that.data.uploadImages)
253 253
   },
254 254
   toChat(e) { //跳转进入聊天页面
255 255
   let that = this;
256
-    wx.navigateTo({
257
-      url: '../chat/chat?to_id=' + that.to_id + '&myheadurl=' + that.myheadurl + '&headUrl=' + that.data.options_img
258
-    });
259
-  },
256
+
257
+    app.postRequest('circle/dialogue/validate', {}, function (res) {
258
+        console.log(res);
259
+      if (res.code == 201) {
260
+        wx.navigateTo({
261
+          url: '../chat/chat?to_id=' + that.to_id + '&myheadurl=' + that.myheadurl + '&headUrl=' + that.data.options_img
262
+        });
263
+        return ;
264
+      } 
265
+      app.Tips(res.msg);
266
+
267
+    })
268
+
269
+  }
260 270
 
261 271
 
262 272
 

+ 55 - 43
pages/payment/Member/Member.js

@@ -68,52 +68,64 @@ Page({
68 68
 
69 69
   sfzfmclick(e) {
70 70
 
71
-    var _Priceid = this.data.Priceid
72
-
73
-
74
-    let payment_url = 'pay/wxpay/index';
75
-    let payment_data = {
76
-      rid: this.data.Priceid,
77
-      total_price: this.data.Price,  //原价
78
-      discount_peice: this.data.Originalprice,  //优惠
79
-      
80
-    };
81
-    app.postRequest(payment_url, payment_data, function (res) {      //  年龄 ajax
82
-
83
-      console.log(res.data)
84
-      if (res.code == 201) {
85
-
86
-        wx.requestPayment({
87
-          timeStamp: res.data.timeStamp,
88
-          nonceStr: res.data.nonceStr,
89
-          package: res.data.package,
90
-          signType: res.data.signType,
91
-          paySign: res.data.paySign,
92
-
93
-          success(res) {
94
-
95
-            wx.showToast({
96
-              title: '支付成功',
97
-              icon: 'success',
98
-              duration: 2000
99
-            })
100
-
101
-           },
102
-          fail(res) {
103
-            var _fail = '支付失败'
104
-            getApp().Tips(_fail);
105
-           }
106
-        })
107
-          
108
-          return 
109 71
 
72
+  },
73
+  pay: function () {
74
+    let _that = this;
75
+    wx.login({
76
+      success: function (res) {
77
+        console.log(res.code)
78
+        if (res.code) {
79
+          // let p_url = 'public/wxlogin';
80
+          // let p_data = {
81
+          //   code: res.code,
82
+          // };
83
+          var _Priceid = _that.data.Priceid
84
+          let payment_url = 'pay/wxpay/index';
85
+          let payment_data = {
86
+            rid: _that.data.Priceid,
87
+            total_price: _that.data.Price,  //原价
88
+            discount_peice: _that.data.Originalprice,  //优惠
89
+            code: res.code
90
+          };
91
+          app.postRequest(payment_url, payment_data, function (res) { 
92
+
93
+            console.log(res.data)
94
+            if (res.code == 201) {
95
+
96
+              wx.requestPayment({
97
+                timeStamp: res.data.timeStamp,
98
+                nonceStr: res.data.nonceStr,
99
+                package: res.data.package,
100
+                signType: res.data.signType,
101
+                paySign: res.data.paySign,
102
+
103
+                success(res) {
104
+                  wx.showToast({
105
+                    title: '支付成功',
106
+                    icon: 'success',
107
+                    duration: 2000
108
+                  })
109
+                },
110
+                fail(res) {
111
+                    getApp().Tips('支付失败');
112
+                }
113
+              })
114
+              return
115
+            }
116
+              getApp().Tips('支付失败');
117
+          })
118
+
119
+          // app.postRequest(p_url, p_data, function (res) {
120
+          //   console.log(res);
121
+          //   if (res.code == 201) {
122
+
123
+
124
+          //   }
125
+          // })
126
+        }
110 127
       }
111
-
112
-      var _fail = '支付失败'
113
-      getApp().Tips(_fail);
114
-
115 128
     })
116
-
117 129
   }
118 130
 
119 131
 

+ 2 - 2
pages/payment/Member/Member.wxml

@@ -31,8 +31,8 @@
31 31
 
32 32
 
33 33
     <!-- <view></view> -->
34
-    
35
-      <view class='NextStep' bindtap='sfzfmclick'>立即开通</view>
34
+    <!-- sfzfmclick -->
35
+      <view class='NextStep' bindtap='pay'>立即开通</view>
36 36
 </view>
37 37
 
38 38
 

+ 3 - 1
project.config.json

@@ -8,7 +8,9 @@
8 8
 		"es6": true,
9 9
 		"postcss": true,
10 10
 		"minified": true,
11
-		"newFeature": true
11
+		"newFeature": true,
12
+		"autoAudits": false,
13
+		"checkInvalidKey": true
12 14
 	},
13 15
 	"compileType": "miniprogram",
14 16
 	"libVersion": "2.4.0",

+ 26 - 0
utils/share.js

@@ -0,0 +1,26 @@
1
+const app = getApp();
2
+const share_title = 'sharetitle';
3
+const share_path = 'sharepath';
4
+const share_imageurl = 'shareimageurl';
5
+function ShareSetInfo(){
6
+  app.postRequest('my/other/share', {}, function (res) {
7
+    if (res.code == 201) {
8
+      wx.setStorageSync(share_title, res.data.title);
9
+      wx.setStorageSync(share_path, res.data.path);
10
+      wx.setStorageSync(share_imageurl, res.data.imageUrl);
11
+    }
12
+  })
13
+}
14
+
15
+function Shareginfo(){
16
+    return{
17
+      title: wx.getStorageSync(share_title),
18
+      path: wx.getStorageSync(share_path),
19
+      imageurl: wx.getStorageSync(share_imageurl),
20
+    };
21
+}
22
+
23
+module.exports = {
24
+  ShareSetInfo,
25
+  Shareginfo
26
+};