|
@@ -21,7 +21,8 @@ App({
|
|
initSocket() {
|
|
initSocket() {
|
|
let that = this;
|
|
let that = this;
|
|
this.globalData.SocketTask = wx.connectSocket({
|
|
this.globalData.SocketTask = wx.connectSocket({
|
|
- url: 'wss://meida.cnyunl.com/yos/webSocket/' + wx.getStorageSync('userMsg').token,
|
|
+
|
|
|
|
+ url: 'ws://192.168.3.111:8100/yos/webSocket/' + wx.getStorageSync('userMsg').token,
|
|
complete: (res) => {
|
|
complete: (res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
}
|
|
}
|
|
@@ -31,6 +32,24 @@ App({
|
|
})
|
|
})
|
|
this.globalData.SocketTask.onMessage(function (res) {
|
|
this.globalData.SocketTask.onMessage(function (res) {
|
|
that.globalData.socket.callback(res)
|
|
that.globalData.socket.callback(res)
|
|
|
|
+ let data = JSON.parse(res.data);
|
|
|
|
+ if (data.message.type == 'pay') {
|
|
|
|
+ that.globalData.http.basic({
|
|
|
|
+ "classname": "system.payorder.payorder",
|
|
|
|
+ "method": "query_userauth",
|
|
|
|
+ content: {
|
|
|
|
+ nocache: true
|
|
|
|
+ }
|
|
|
|
+ }).then(res => {
|
|
|
|
+ console.log('更新付费信息', res)
|
|
|
|
+ wx.setStorageSync('userauth', res.data);
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '应用付费信息已更新',
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ getCurrentPages().find(v => v.__route__ == 'pages/tabbar/home/index').refreshData();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
})
|
|
})
|
|
this.globalData.SocketTask.onError(function (res) {
|
|
this.globalData.SocketTask.onError(function (res) {
|
|
that.globalData.socketEstablish = false;
|
|
that.globalData.socketEstablish = false;
|