|
@@ -37,6 +37,8 @@ let urlToJson = (url = window.location.href) => { // 箭头函数默认传值为
|
|
|
|
|
|
export default {
|
|
export default {
|
|
joinUrl() {
|
|
joinUrl() {
|
|
|
|
+ console.log('***************************')
|
|
|
|
+ console.log(this.data.url)
|
|
let options = {
|
|
let options = {
|
|
API_BASE_URL: api.API_BASE_URL,
|
|
API_BASE_URL: api.API_BASE_URL,
|
|
"url": this.data.url,
|
|
"url": this.data.url,
|
|
@@ -64,7 +66,7 @@ export default {
|
|
sponsor = false
|
|
sponsor = false
|
|
}
|
|
}
|
|
|
|
|
|
- let base = remote.viewHost + '/shop-container/fashilong.html?env='+remote.env+'&sponsor=' + sponsor + '&many=' + this.data.many
|
|
|
|
|
|
+ let base = remote.viewHost + '/shop-container/fashilong.html?env=' + remote.env + '&sponsor=' + sponsor + '&many=' + this.data.many
|
|
// let base = remote.viewHost + '/shop.html'
|
|
// let base = remote.viewHost + '/shop.html'
|
|
|
|
|
|
this.data.reload = false
|
|
this.data.reload = false
|
|
@@ -89,12 +91,14 @@ export default {
|
|
isIos,
|
|
isIos,
|
|
showComtypesAllTab: false
|
|
showComtypesAllTab: false
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
if (this.socketSendMessage) {
|
|
if (this.socketSendMessage) {
|
|
this.pauseVideo = false
|
|
this.pauseVideo = false
|
|
this.joinUrl()
|
|
this.joinUrl()
|
|
- this.socketSendMessage('changeOnlineStatus', { status: true })
|
|
|
|
|
|
+ this.socketSendMessage('changeOnlineStatus', {
|
|
|
|
+ status: true
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -234,18 +238,18 @@ export default {
|
|
// })
|
|
// })
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
this.role !== 'leader'
|
|
this.role !== 'leader'
|
|
let roomType
|
|
let roomType
|
|
if ((!this.data.canShow && !this.data.join) || (this.data.join && !this.options.join)) {
|
|
if ((!this.data.canShow && !this.data.join) || (this.data.join && !this.options.join)) {
|
|
- roomType = '1v1'
|
|
|
|
|
|
+ roomType = '1v1'
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
role: this.role || 'leader',
|
|
role: this.role || 'leader',
|
|
userId: userInfo.userId,
|
|
userId: userInfo.userId,
|
|
roomType,
|
|
roomType,
|
|
avatar: userInfo.avatarUrl,
|
|
avatar: userInfo.avatarUrl,
|
|
- nickname: userInfo.nickname,
|
|
|
|
|
|
+ nickname: userInfo.nickname,
|
|
voiceStatus: getApp().globalData.voiceProps.noMute ? 0 : 2,
|
|
voiceStatus: getApp().globalData.voiceProps.noMute ? 0 : 2,
|
|
enableTalk: this.role === 'leader' ? true : undefined,
|
|
enableTalk: this.role === 'leader' ? true : undefined,
|
|
roomId: room,
|
|
roomId: room,
|
|
@@ -299,7 +303,9 @@ export default {
|
|
this.socketSendMessage('changeVoiceStatus', {
|
|
this.socketSendMessage('changeVoiceStatus', {
|
|
status: noMute ? 0 : 2
|
|
status: noMute ? 0 : 2
|
|
})
|
|
})
|
|
- this.socketSendMessage('changeOnlineStatus', { status: true })
|
|
|
|
|
|
+ this.socketSendMessage('changeOnlineStatus', {
|
|
|
|
+ status: true
|
|
|
|
+ })
|
|
})
|
|
})
|
|
socket.on('reconnect_failed', () => this.setData({
|
|
socket.on('reconnect_failed', () => this.setData({
|
|
socketStatus: -1
|
|
socketStatus: -1
|
|
@@ -397,8 +403,8 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
getUrl(url, socketOptions, isJoin) {
|
|
getUrl(url, socketOptions, isJoin) {
|
|
- url += '&room_id=' + socketOptions.roomId + '&user_id=' + socketOptions.userId +'origin=fashilong'
|
|
|
|
-
|
|
|
|
|
|
+ url += '&room_id=' + socketOptions.roomId + '&user_id=' + socketOptions.userId + '&origin=fashilong'
|
|
|
|
+
|
|
|
|
|
|
if (isJoin) {
|
|
if (isJoin) {
|
|
url += '&role=' + this.role + '&shopping'
|
|
url += '&role=' + this.role + '&shopping'
|
|
@@ -407,7 +413,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
console.error(url)
|
|
console.error(url)
|
|
- console.log(isJoin)
|
|
|
|
|
|
+ console.log(isJoin)
|
|
return url
|
|
return url
|
|
},
|
|
},
|
|
|
|
|
|
@@ -438,7 +444,7 @@ export default {
|
|
if (!data) return;
|
|
if (!data) return;
|
|
|
|
|
|
this.setData({
|
|
this.setData({
|
|
- surplus: this.data.peopleCount - data.roomsPerson.length
|
|
|
|
|
|
+ surplus: this.data.peopleCount - data.roomsPerson.length
|
|
})
|
|
})
|
|
if (!this.isAuthorizeRecord) {
|
|
if (!this.isAuthorizeRecord) {
|
|
const voiceStatus = Number(await this.authorizeRecord())
|
|
const voiceStatus = Number(await this.authorizeRecord())
|
|
@@ -504,7 +510,7 @@ export default {
|
|
})
|
|
})
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
this.role = this.data.canShow ? 'leader' : 'customer'
|
|
this.role = this.data.canShow ? 'leader' : 'customer'
|
|
let options = await this.getSocketOptions(this.mcode)
|
|
let options = await this.getSocketOptions(this.mcode)
|
|
|
|
|
|
@@ -517,7 +523,7 @@ export default {
|
|
this.wssSuccess = false
|
|
this.wssSuccess = false
|
|
this.socketStop && this.socketStop()
|
|
this.socketStop && this.socketStop()
|
|
this.data.many = !!this.data.canShow
|
|
this.data.many = !!this.data.canShow
|
|
-
|
|
|
|
|
|
+
|
|
this.setData({
|
|
this.setData({
|
|
peopleCount: this.data.many ? manyCount : 5
|
|
peopleCount: this.data.many ? manyCount : 5
|
|
})
|
|
})
|
|
@@ -534,9 +540,11 @@ export default {
|
|
socketOptions,
|
|
socketOptions,
|
|
})
|
|
})
|
|
this.joinUrl()
|
|
this.joinUrl()
|
|
-
|
|
|
|
|
|
|
|
- this.setData({ socketOptions })
|
|
|
|
|
|
+
|
|
|
|
+ this.setData({
|
|
|
|
+ socketOptions
|
|
|
|
+ })
|
|
this.loadConponSuccess = true
|
|
this.loadConponSuccess = true
|
|
this.readySendCouponCtrl()
|
|
this.readySendCouponCtrl()
|
|
}, 300)
|
|
}, 300)
|
|
@@ -579,8 +587,8 @@ export default {
|
|
|
|
|
|
async mic() {
|
|
async mic() {
|
|
let noMute = getApp().globalData.voiceProps.noMute
|
|
let noMute = getApp().globalData.voiceProps.noMute
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// noMute true 静音
|
|
// noMute true 静音
|
|
// enableTalk false 静音
|
|
// enableTalk false 静音
|
|
// if (!!getApp().globalData.voiceProps.force === !!noMute)
|
|
// if (!!getApp().globalData.voiceProps.force === !!noMute)
|
|
@@ -636,7 +644,7 @@ export default {
|
|
this.setData({
|
|
this.setData({
|
|
sendShare: false
|
|
sendShare: false
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
return {
|
|
return {
|
|
title: '【好友推荐】一起来云逛吧',
|
|
title: '【好友推荐】一起来云逛吧',
|
|
imageUrl: newPicUrl,
|
|
imageUrl: newPicUrl,
|
|
@@ -678,9 +686,9 @@ export default {
|
|
|
|
|
|
console.log(`/pages/shared/shared?img_url=${btoa(img_url)}&shareImg=${btoa(shareImg)}&companyName=${companyName}&vrLink=${btoa(vrLink)}&id=${this.data.id}`);
|
|
console.log(`/pages/shared/shared?img_url=${btoa(img_url)}&shareImg=${btoa(shareImg)}&companyName=${companyName}&vrLink=${btoa(vrLink)}&id=${this.data.id}`);
|
|
|
|
|
|
- wx.navigateTo({
|
|
|
|
- url: `/pages/shared/shared?img_url=${btoa(img_url)}&shareImg=${btoa(shareImg)}&companyName=${companyName}&vrLink=${btoa(vrLink)}&id=${this.data.id}`,
|
|
|
|
- })
|
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/shared/shared?img_url=${btoa(img_url)}&shareImg=${btoa(shareImg)}&companyName=${companyName}&vrLink=${btoa(vrLink)}&id=${this.data.id}`,
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -869,11 +877,11 @@ export default {
|
|
this.readySendCouponCtrl()
|
|
this.readySendCouponCtrl()
|
|
},
|
|
},
|
|
readySendCouponCtrl() {
|
|
readySendCouponCtrl() {
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
if (this.wssSuccess && this.loadConponSuccess) {
|
|
if (this.wssSuccess && this.loadConponSuccess) {
|
|
this.loadConponSuccess = false
|
|
this.loadConponSuccess = false
|
|
-
|
|
|
|
|
|
+
|
|
this.socketSendMessage('clientSyncAction', {
|
|
this.socketSendMessage('clientSyncAction', {
|
|
type: 'showCoupon',
|
|
type: 'showCoupon',
|
|
data: this.data.coupons.length > 0
|
|
data: this.data.coupons.length > 0
|
|
@@ -1016,7 +1024,7 @@ export default {
|
|
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
|
|
-
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
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
|
|
@@ -1024,10 +1032,10 @@ export default {
|
|
this.setData({
|
|
this.setData({
|
|
peopleCount: this.data.many ? manyCount : 5,
|
|
peopleCount: this.data.many ? manyCount : 5,
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
if (!res.data.brand.canShow) {
|
|
if (!res.data.brand.canShow) {
|
|
this.role = 'customer'
|
|
this.role = 'customer'
|
|
- } else if (!this.options.join){
|
|
|
|
|
|
+ } else if (!this.options.join) {
|
|
this.role = 'leader'
|
|
this.role = 'leader'
|
|
}
|
|
}
|
|
cb(url, urlToJson(url).m, )
|
|
cb(url, urlToJson(url).m, )
|
|
@@ -1073,8 +1081,10 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
onHide() {
|
|
onHide() {
|
|
- this.socketSendMessage('changeOnlineStatus', { status: false })
|
|
|
|
-
|
|
|
|
|
|
+ this.socketSendMessage('changeOnlineStatus', {
|
|
|
|
+ status: false
|
|
|
|
+ })
|
|
|
|
+
|
|
this.pauseVideo = true
|
|
this.pauseVideo = true
|
|
this.joinUrl()
|
|
this.joinUrl()
|
|
}
|
|
}
|