|
@@ -68,12 +68,11 @@ export default {
|
|
let hostUrl
|
|
let hostUrl
|
|
if (options.url.indexOf('www.4dkankan.com') != -1) {
|
|
if (options.url.indexOf('www.4dkankan.com') != -1) {
|
|
hostUrl = 'https://www.4dkankan.com/shop-container-zfb/'
|
|
hostUrl = 'https://www.4dkankan.com/shop-container-zfb/'
|
|
- } else if(options.url.indexOf('test.4dkankan.com') != -1){
|
|
|
|
|
|
+ } else if (options.url.indexOf('test.4dkankan.com') != -1) {
|
|
hostUrl = 'https://test.4dkankan.com/shop-container-zfb/'
|
|
hostUrl = 'https://test.4dkankan.com/shop-container-zfb/'
|
|
- }else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
// hostUrl = 'https://zfb.4dkankan.com/shop-container/'
|
|
// hostUrl = 'https://zfb.4dkankan.com/shop-container/'
|
|
- hostUrl = remote.viewHost+'/shop-container/'
|
|
|
|
|
|
+ hostUrl = remote.viewHost + '/shop-container/'
|
|
}
|
|
}
|
|
// 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 = hostUrl + 'fashilong.html?time=' + Date.now() + '&env=' + remote.env + '&sponsor=' + sponsor + '&many=' + this.data.many
|
|
let base = hostUrl + 'fashilong.html?time=' + Date.now() + '&env=' + remote.env + '&sponsor=' + sponsor + '&many=' + this.data.many
|
|
@@ -249,7 +248,7 @@ export default {
|
|
// userInfoa: userInfo.nickname.split('').join(' ')
|
|
// userInfoa: userInfo.nickname.split('').join(' ')
|
|
// })
|
|
// })
|
|
|
|
|
|
-
|
|
|
|
|
|
+ userInfo.nickname = userInfo.nickname.replace(/[^\u4E00-\u9FA5A-Za-z0-9]/g, '')
|
|
|
|
|
|
// this.role !== 'leader'
|
|
// this.role !== 'leader'
|
|
let roomType
|
|
let roomType
|
|
@@ -264,7 +263,7 @@ export default {
|
|
// wx.showToast({
|
|
// wx.showToast({
|
|
// title: this.data.peopleCount.toString(),
|
|
// title: this.data.peopleCount.toString(),
|
|
// })
|
|
// })
|
|
-
|
|
|
|
|
|
+
|
|
return {
|
|
return {
|
|
role: this.role || 'leader',
|
|
role: this.role || 'leader',
|
|
userId: userInfo.userId,
|
|
userId: userInfo.userId,
|
|
@@ -341,12 +340,12 @@ export default {
|
|
let enableTalk = config.roomsConfig.enableTalk !== false
|
|
let enableTalk = config.roomsConfig.enableTalk !== false
|
|
let noMute = getApp().globalData.voiceProps.noMute
|
|
let noMute = getApp().globalData.voiceProps.noMute
|
|
getApp().globalData.voiceProps.force = enableTalk
|
|
getApp().globalData.voiceProps.force = enableTalk
|
|
-
|
|
|
|
|
|
+
|
|
if (!enableTalk && !noMute) {
|
|
if (!enableTalk && !noMute) {
|
|
if (this.role !== 'leader') {
|
|
if (this.role !== 'leader') {
|
|
// this.mic()
|
|
// this.mic()
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -500,50 +499,50 @@ export default {
|
|
|
|
|
|
async startCall(data) {
|
|
async startCall(data) {
|
|
// if( this.role =='leader'){
|
|
// if( this.role =='leader'){
|
|
- this.setData({
|
|
|
|
- shareStatus: 1
|
|
|
|
- })
|
|
|
|
- if (!data) return;
|
|
|
|
-
|
|
|
|
- this.setData({
|
|
|
|
- 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})
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- const socketOptions = this.data.socketOptions
|
|
|
|
- getApp().globalData.roomId = socketOptions.roomId
|
|
|
|
- const user = data.roomsPerson.find(user => user.userId == socketOptions.userId)
|
|
|
|
- if (!user) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- //屏蔽有人进来才开麦克风
|
|
|
|
- // if (data.roomsPerson.length <= 1) {
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- user.noMute = getApp().globalData.voiceProps.noMute
|
|
|
|
- getApp().setVoiceProps({
|
|
|
|
- ...user,
|
|
|
|
- action: 'startCall'
|
|
|
|
- })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ shareStatus: 1
|
|
|
|
+ })
|
|
|
|
+ if (!data) return;
|
|
|
|
+
|
|
|
|
+ this.setData({
|
|
|
|
+ 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', {
|
|
// this.socketSendMessage('changeVoiceStatus', {
|
|
// status: getApp().globalData.voiceProps.noMute ? 0 : 2
|
|
// status: getApp().globalData.voiceProps.noMute ? 0 : 2
|
|
// })
|
|
// })
|
|
|
|
+ // this.data.socketOptions.voiceStatus = 1
|
|
|
|
+ // this.socketSendMessage('changeVoiceStatus', {status: noMute ? 0 : 2})
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const socketOptions = this.data.socketOptions
|
|
|
|
+ getApp().globalData.roomId = socketOptions.roomId
|
|
|
|
+ const user = data.roomsPerson.find(user => user.userId == socketOptions.userId)
|
|
|
|
+ if (!user) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ //屏蔽有人进来才开麦克风
|
|
|
|
+ // if (data.roomsPerson.length <= 1) {
|
|
|
|
+ // return
|
|
// }
|
|
// }
|
|
-
|
|
|
|
|
|
+ user.noMute = getApp().globalData.voiceProps.noMute
|
|
|
|
+ getApp().setVoiceProps({
|
|
|
|
+ ...user,
|
|
|
|
+ action: 'startCall'
|
|
|
|
+ })
|
|
|
|
+ // this.socketSendMessage('changeVoiceStatus', {
|
|
|
|
+ // status: getApp().globalData.voiceProps.noMute ? 0 : 2
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
stopCall() {
|
|
stopCall() {
|
|
@@ -594,7 +593,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
|
|
peopleCount: this.data.many ? manyCount : 2
|
|
peopleCount: this.data.many ? manyCount : 2
|
|
@@ -658,7 +657,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
async mic() {
|
|
async mic() {
|
|
-
|
|
|
|
|
|
+
|
|
let noMute = getApp().globalData.voiceProps.noMute
|
|
let noMute = getApp().globalData.voiceProps.noMute
|
|
|
|
|
|
|
|
|
|
@@ -712,7 +711,7 @@ export default {
|
|
newPicUrl
|
|
newPicUrl
|
|
} = this.data
|
|
} = this.data
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
if (res.from === 'button') {
|
|
if (res.from === 'button') {
|
|
this.setData({
|
|
this.setData({
|
|
sendShare: false
|
|
sendShare: false
|
|
@@ -1108,11 +1107,11 @@ export default {
|
|
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
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
this.setData({
|
|
this.setData({
|
|
// peopleCount: this.data.many ? manyCount : 5,
|
|
// peopleCount: this.data.many ? manyCount : 5,
|
|
peopleCount: this.data.many ? manyCount : 2,
|
|
peopleCount: this.data.many ? manyCount : 2,
|