gemercheung 3 роки тому
батько
коміт
f7f8457608
2 змінених файлів з 62 додано та 46 видалено
  1. 19 16
      component/partyItem/partyItem.wxss
  2. 43 30
      socket.js

+ 19 - 16
component/partyItem/partyItem.wxss

@@ -12,8 +12,8 @@
 .tj_listItem .tj_listItemCover {
   /* width: 210rpx;
   height: 210rpx; */
-  width:  160rpx;
-  height:  160rpx;
+  width: 160rpx;
+  height: 160rpx;
   border-radius: 8px;
   overflow: hidden;
 }
@@ -22,11 +22,11 @@
   /* width: 210rpx;
   height: 210rpx; */
   width: 160rpx;
-  height:  160rpx;
+  height: 160rpx;
 }
 
 .tj_listItemMsg {
-  width:calc(100% - 180rpx);
+  width: calc(100% - 180rpx);
   margin-left: 20rpx;
   /* padding-top: 10rpx;
   box-sizing: border-box; */
@@ -37,40 +37,42 @@
   color: #333;
   line-height: 40rpx;
   font-weight: bold;
-  overflow: hidden; 
-  text-overflow: ellipsis; 
+  overflow: hidden;
+  text-overflow: ellipsis;
   display: -webkit-box;
-  -webkit-line-clamp: 2; 
+  -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
-  height:100rpx
+  height: 100rpx
 }
 
 .tj_listItemMsg .tj_listItemTip {
   display: flex;
   align-items: center;
   height: 28rpx;
-  margin: 10rpx 0 10rpx ;
- 
+  margin: 10rpx 0 10rpx;
+
 }
 
 .tj_listItemMsg .tj_listItemTip .tj_listItemTipText {
   font-size: 24rpx;
   color: #666;
-  overflow: hidden; 
-  text-overflow: ellipsis; 
+  overflow: hidden;
+  text-overflow: ellipsis;
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
   line-height: 36rpx;
-  padding-top:10px;
+  padding-top: 10px;
 }
-.tj_listItemTipText .label{
+
+.tj_listItemTipText .label {
   color: #0075DC;
   display: inline-block;
   background-color: rgba(0, 117, 220, 0.2);
-  padding: 10rpx;
+  padding: 5rpx 8rpx;
   border-radius: 2rpx;
 }
+
 .tj_listItemMsg .tj_listItemTag {
   display: flex;
   align-items: center;
@@ -140,7 +142,8 @@
   font-size: 20rpx;
   color: #666;
 }
-.tj_listItemMsg .tj_listItemPrice  .totalPrice{
+
+.tj_listItemMsg .tj_listItemPrice .totalPrice {
   font-size: 28rpx;
   color: #0075DC;
   font-weight: bold;

+ 43 - 30
socket.js

@@ -137,7 +137,7 @@ export default {
       this.pauseVideo = false
       this.joinUrl()
       this.socketSendMessage('changeOnlineStatus', {
-        status: true
+        status: 1
       })
     }
   },
@@ -361,7 +361,7 @@ export default {
       isAllowMic: isAllowMic,
       roomId: roomId,
       sceneNumber: sceneId,
-      onlineStatus: true,
+      onlineStatus: 1,
       userLimitNum: capacities
     }
   },
@@ -420,7 +420,7 @@ export default {
         status: noMute ? 0 : 2
       })
       this.socketSendMessage('changeOnlineStatus', {
-        status: true
+        status: 1
       })
     })
     socket.on('reconnect_failed', () => this.setData({
@@ -721,6 +721,7 @@ export default {
       surplus: this.data.peopleCount - data.roomsPerson.length
     })
   },
+  //deprecated
   async newRoom(data) {
     if (data.roomId) return;
     this.stopCall()
@@ -773,6 +774,22 @@ export default {
       this.readySendCouponCtrl()
     }, 300)
   },
+  // 真正退出房间
+  async exitRoom() {
+    const roomId = this.data.socketOptions.roomId;
+    const result = await util.request(api.exitRoom, {
+      businessId: roomId
+    }, 'POST', 'application/json');
+
+    this.socketSendMessage('stopCall', {
+      from: 2
+    })
+    this.stopCall();
+    this.socketStop();
+    wx.redirectTo({
+      url: '/pages/roomManger/roomManger',
+    });
+  },
   async exit() {
     // this.stopCall()
     getApp().globalData.rtcParams = []
@@ -847,6 +864,28 @@ export default {
     }
   },
 
+  closeMic(data) {
+
+    getApp().globalData.voiceProps.noMute = false
+    this.socketSendMessage('changeVoiceStatus', {
+      status: 0,
+      user: data.user
+    })
+    getApp().setVoiceProps({
+      noMute: false
+    })
+  },
+  
+  openMic() {
+    getApp().globalData.voiceProps.noMute = true
+    this.socketSendMessage('changeVoiceStatus', {
+      status: 2,
+      user: data.user
+    })
+    getApp().setVoiceProps({
+      noMute: true
+    })
+  },
   callPhone() {
     wx.makePhoneCall({
       phoneNumber: this.data.contractPhone,
@@ -1126,32 +1165,6 @@ export default {
   getBrand: function (id, code) {
     this.getGoodsCount(code, id)
     return;
-    let that = this;
-    util.request(api.SueneCategory, {
-      sceneNum: code
-    }, 'GET').then(function (res) {
-      if (res.code === 0) {
-        const comtypes = res.list.map(item => {
-          item.width = (item.name.length + (item.num.toString().length / 2) + 2) * 16
-          return {
-            ...item
-          }
-        })
-
-        that.setData({
-          comWidth: comtypes.reduce((a, b) => a + b.width + 10, 0),
-          comtypes,
-          thumComtypes: (!isIos && comtypes.length > 3) ? comtypes.slice(0, 3) : null,
-          currTypeId: comtypes.length > 0 && comtypes[0].category_id
-        });
-
-        wx.showToast({
-          title: 'currTypeId' + that.data.currTypeId.length,
-        })
-        that.data.currTypeId && that.getGoodsList(id, that.data.currTypeId);
-      }
-    });
-
   },
 
   getGoodsCount(code, id) {
@@ -1321,7 +1334,7 @@ export default {
 
   onHide() {
     this.socketSendMessage('changeOnlineStatus', {
-      status: false
+      status: 0
     })
 
     this.pauseVideo = true