|
@@ -5,7 +5,8 @@ const util = require('/utils/util.js');
|
|
const UNLOGIN = 'NO_LOGIN'
|
|
const UNLOGIN = 'NO_LOGIN'
|
|
const btoa = require('./utils/btoa')
|
|
const btoa = require('./utils/btoa')
|
|
|
|
|
|
-const manyCount = 30
|
|
|
|
|
|
+// const manyCount = 30
|
|
|
|
+const manyCount = 50
|
|
|
|
|
|
import remote from './config.js'
|
|
import remote from './config.js'
|
|
var app = getApp();
|
|
var app = getApp();
|
|
@@ -65,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
|
|
@@ -90,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
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -235,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,
|
|
@@ -301,7 +304,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
|
|
@@ -401,8 +406,8 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
getUrl(url, socketOptions, isJoin) {
|
|
getUrl(url, socketOptions, isJoin) {
|
|
- url += '&room_id=' + socketOptions.roomId + '&user_id=' + socketOptions.userId
|
|
|
|
-
|
|
|
|
|
|
+ url += '&room_id=' + socketOptions.roomId + '&user_id=' + socketOptions.userId
|
|
|
|
+
|
|
|
|
|
|
if (isJoin) {
|
|
if (isJoin) {
|
|
url += '&role=' + this.role + '&shopping'
|
|
url += '&role=' + this.role + '&shopping'
|
|
@@ -411,7 +416,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
console.error(url)
|
|
console.error(url)
|
|
- console.log(isJoin)
|
|
|
|
|
|
+ console.log(isJoin)
|
|
return url
|
|
return url
|
|
},
|
|
},
|
|
|
|
|
|
@@ -442,24 +447,28 @@ 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) {
|
|
|
|
- const voiceStatus = Number(await this.authorizeRecord())
|
|
|
|
- this.isAuthorizeRecord = true
|
|
|
|
-
|
|
|
|
- // getApp().setVoiceProps({
|
|
|
|
- // noMute: !voiceStatus
|
|
|
|
- // })
|
|
|
|
-
|
|
|
|
- // console.log(getApp().globalData.voiceProps.noMute)
|
|
|
|
- // this.socketSendMessage('changeVoiceStatus', {
|
|
|
|
- // status: getApp().globalData.voiceProps.noMute ? 0 : 2
|
|
|
|
- // })
|
|
|
|
- // this.data.socketOptions.voiceStatus = 1
|
|
|
|
- // this.socketSendMessage('changeVoiceStatus', {status: noMute ? 0 : 2})
|
|
|
|
|
|
+ //限制只有主持人才可以开麦
|
|
|
|
+ if (this.role == 'leader') {
|
|
|
|
+ if (!this.isAuthorizeRecord) {
|
|
|
|
+ const voiceStatus = Number(await this.authorizeRecord())
|
|
|
|
+ this.isAuthorizeRecord = true
|
|
|
|
+
|
|
|
|
+ // getApp().setVoiceProps({
|
|
|
|
+ // noMute: !voiceStatus
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // console.log(getApp().globalData.voiceProps.noMute)
|
|
|
|
+ // this.socketSendMessage('changeVoiceStatus', {
|
|
|
|
+ // status: getApp().globalData.voiceProps.noMute ? 0 : 2
|
|
|
|
+ // })
|
|
|
|
+ // this.data.socketOptions.voiceStatus = 1
|
|
|
|
+ // this.socketSendMessage('changeVoiceStatus', {status: noMute ? 0 : 2})
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
const socketOptions = this.data.socketOptions
|
|
const socketOptions = this.data.socketOptions
|
|
getApp().globalData.roomId = socketOptions.roomId
|
|
getApp().globalData.roomId = socketOptions.roomId
|
|
const user = data.roomsPerson.find(user => user.userId == socketOptions.userId)
|
|
const user = data.roomsPerson.find(user => user.userId == socketOptions.userId)
|
|
@@ -470,10 +479,14 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
user.noMute = getApp().globalData.voiceProps.noMute
|
|
user.noMute = getApp().globalData.voiceProps.noMute
|
|
|
|
+ //限制只有主持人才可以开麦
|
|
|
|
+ // if (this.role == 'leader') {
|
|
getApp().setVoiceProps({
|
|
getApp().setVoiceProps({
|
|
...user,
|
|
...user,
|
|
action: 'startCall'
|
|
action: 'startCall'
|
|
})
|
|
})
|
|
|
|
+ // }
|
|
|
|
+
|
|
// this.socketSendMessage('changeVoiceStatus', {
|
|
// this.socketSendMessage('changeVoiceStatus', {
|
|
// status: getApp().globalData.voiceProps.noMute ? 0 : 2
|
|
// status: getApp().globalData.voiceProps.noMute ? 0 : 2
|
|
// })
|
|
// })
|
|
@@ -508,7 +521,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)
|
|
|
|
|
|
@@ -521,7 +534,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
|
|
})
|
|
})
|
|
@@ -538,9 +551,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)
|
|
@@ -583,8 +598,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)
|
|
@@ -640,7 +655,7 @@ export default {
|
|
this.setData({
|
|
this.setData({
|
|
sendShare: false
|
|
sendShare: false
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
return {
|
|
return {
|
|
title: '【好友推荐】一起来云逛吧',
|
|
title: '【好友推荐】一起来云逛吧',
|
|
imageUrl: newPicUrl,
|
|
imageUrl: newPicUrl,
|
|
@@ -682,9 +697,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}`,
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -873,11 +888,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
|
|
@@ -1020,7 +1035,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
|
|
@@ -1028,10 +1043,12 @@ export default {
|
|
this.setData({
|
|
this.setData({
|
|
peopleCount: this.data.many ? manyCount : 5,
|
|
peopleCount: this.data.many ? manyCount : 5,
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ console.error(this.data.peopleCount)
|
|
|
|
+
|
|
|
|
+
|
|
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, )
|
|
@@ -1077,8 +1094,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()
|
|
}
|
|
}
|