|
@@ -135,8 +135,11 @@ export default {
|
|
showComtypesAllTab: false
|
|
showComtypesAllTab: false
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ // wx.showToast({
|
|
|
|
+ // title: '测试--socket.connected' + this.socket.connected,
|
|
|
|
+ // })
|
|
|
|
|
|
- if (this.socketSendMessage) {
|
|
|
|
|
|
+ const onlineAction = () => {
|
|
this.pauseVideo = false
|
|
this.pauseVideo = false
|
|
this.joinUrl()
|
|
this.joinUrl()
|
|
// debugger
|
|
// debugger
|
|
@@ -144,6 +147,44 @@ export default {
|
|
status: 1
|
|
status: 1
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ console.warn("socketInstance-1", this.socketInstance);
|
|
|
|
+
|
|
|
|
+ if (this.socketInstance) {
|
|
|
|
+ if (!this.socketInstance.connected) {
|
|
|
|
+
|
|
|
|
+ // wx.showToast({
|
|
|
|
+ // title: 'socketInstance-2',
|
|
|
|
+ // icon: 'none',
|
|
|
|
+ // duration: 5000
|
|
|
|
+ // })
|
|
|
|
+ // this.socketInstance.connect();
|
|
|
|
+ // wx.showModal({
|
|
|
|
+ // title: '提示',
|
|
|
|
+ // content: '欧克',
|
|
|
|
+ // showCancel: false,
|
|
|
|
+ // confirmColor: '#0075DC',
|
|
|
|
+ // success: function (res) {}
|
|
|
|
+ // })
|
|
|
|
+ setTimeout(onlineAction, 300)
|
|
|
|
+ } else {
|
|
|
|
+ // wx.showToast({
|
|
|
|
+ // title: 'socketInstance-3',
|
|
|
|
+ // icon: 'none',
|
|
|
|
+ // duration: 5000
|
|
|
|
+ // })
|
|
|
|
+ onlineAction();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // if (this.socketSendMessage) {
|
|
|
|
+ // this.pauseVideo = false
|
|
|
|
+ // this.joinUrl()
|
|
|
|
+ // // debugger
|
|
|
|
+ // this.socketSendMessage('changeOnlineStatus', {
|
|
|
|
+ // status: 1
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
|
|
|
|
changeShowComtypesAllTab(ev) {
|
|
changeShowComtypesAllTab(ev) {
|
|
@@ -413,8 +454,14 @@ export default {
|
|
|
|
|
|
console.log('小程序参数', options)
|
|
console.log('小程序参数', options)
|
|
if (!options.roomId) {
|
|
if (!options.roomId) {
|
|
- return
|
|
|
|
|
|
+ return Promise.resolve(false)
|
|
}
|
|
}
|
|
|
|
+ // 真正进入统计
|
|
|
|
+ util.request(api.trackRoom, {
|
|
|
|
+ roomId: options.roomId,
|
|
|
|
+ type: 0
|
|
|
|
+ }, 'POST', 'application/json')
|
|
|
|
+
|
|
let userInfo = await this.getUserInfo()
|
|
let userInfo = await this.getUserInfo()
|
|
|
|
|
|
let socket = io(remote.socketHost, {
|
|
let socket = io(remote.socketHost, {
|
|
@@ -428,11 +475,12 @@ export default {
|
|
isClient: true,
|
|
isClient: true,
|
|
from: 2
|
|
from: 2
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ this.socketInstance = socket
|
|
|
|
|
|
console.error('新建socket Room', options.roomId)
|
|
console.error('新建socket Room', options.roomId)
|
|
this.setData({
|
|
this.setData({
|
|
- socketStatus: 0
|
|
|
|
|
|
+ socketStatus: 0,
|
|
})
|
|
})
|
|
|
|
|
|
socket.on('connect', () => this.setData({
|
|
socket.on('connect', () => this.setData({
|
|
@@ -1102,6 +1150,16 @@ export default {
|
|
invite(data) {
|
|
invite(data) {
|
|
if (data.sender !== 'h5') return;
|
|
if (data.sender !== 'h5') return;
|
|
|
|
|
|
|
|
+ // 分享房间进入统计
|
|
|
|
+ if (this.data.socketOptions.roomId !== '888888') {
|
|
|
|
+ util.request(api.trackRoom, {
|
|
|
|
+ roomId: this.data.socketOptions.roomId,
|
|
|
|
+ type: 1,
|
|
|
|
+ }, 'POST', 'application/json')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
this.setData({
|
|
this.setData({
|
|
sendShare: true,
|
|
sendShare: true,
|
|
count: ++this.data.count
|
|
count: ++this.data.count
|
|
@@ -1384,15 +1442,24 @@ export default {
|
|
// let base = 'http://192.168.0.112:8080/shop.html?m=t-7Uqj9Fq&origin=fashilong'
|
|
// let base = 'http://192.168.0.112:8080/shop.html?m=t-7Uqj9Fq&origin=fashilong'
|
|
if (res.errno === 0) {
|
|
if (res.errno === 0) {
|
|
let url = base + "&sid=" + id
|
|
let url = base + "&sid=" + id
|
|
|
|
+ // debugger
|
|
this.setData({
|
|
this.setData({
|
|
id: id,
|
|
id: id,
|
|
newPicUrl: res.data.brand.appListPicUrl,
|
|
newPicUrl: res.data.brand.appListPicUrl,
|
|
sceneNum: res.data.brand.sceneNum,
|
|
sceneNum: res.data.brand.sceneNum,
|
|
canShow: res.data.brand.canShow,
|
|
canShow: res.data.brand.canShow,
|
|
- contractPhone: res.data.brand.contractPhone
|
|
|
|
|
|
+ contractPhone: res.data.brand.contractPhone,
|
|
|
|
+
|
|
|
|
+ contactInfo: {
|
|
|
|
+ contactPhone: res.data.brand.contactPhone || '',
|
|
|
|
+ contactHead: res.data.brand.contactHead || '',
|
|
|
|
+ contactCompanyName: res.data.brand.contactCompanyName || '',
|
|
|
|
+ contactNickName: res.data.brand.contactNickName || '',
|
|
|
|
+ brands: res.data.brand.brands || []
|
|
|
|
+ }
|
|
|
|
|
|
})
|
|
})
|
|
- // debugger
|
|
|
|
|
|
+
|
|
if (this.data.many === void 0) {
|
|
if (this.data.many === void 0) {
|
|
this.data.many = !!res.data.brand.canShow
|
|
this.data.many = !!res.data.brand.canShow
|
|
}
|
|
}
|
|
@@ -1412,6 +1479,13 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+
|
|
|
|
+ sendContactInfo() {
|
|
|
|
+ this.socketSendMessage('getContactInfo', {
|
|
|
|
+ contactInfo: this.data.contactInfo,
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
selectType(ev) {
|
|
selectType(ev) {
|
|
this.getGoodsList(this.options.id, ev.target.dataset.item.category_id)
|
|
this.getGoodsList(this.options.id, ev.target.dataset.item.category_id)
|
|
},
|
|
},
|