Jelajahi Sumber

修改房间问题

tangning 3 tahun lalu
induk
melakukan
7ed15d835d

+ 1 - 1
component/partyItem/partyItem.wxml

@@ -1,7 +1,7 @@
 <wxs module="common" src="./common.wxs"></wxs>
 <view class="tj_listItem" data-id="{{room.brandId}}" data-roomId="{{room.businessId}}" data-index="{{index}}" bindtap="gotoWV">
   <view class="tj_listItemCover">
-    <image wx:if="{{ room.appListPicUrl && room.appListPicUrl!=''}}" mode="aspectFill" class="coverImage" src="{{room.appListPicUrl}}"></image>
+    <image wx:if="{{ room.brandAppListPicUrl && room.brandAppListPicUrl!=''}}" mode="aspectFill" class="coverImage" src="{{room.brandAppListPicUrl}}"></image>
     <image wx:else mode="aspectFill" class="coverImage" src="../../static/images/icon/pic_bg@2x.png"></image>
   </view>
   <view class="tj_listItemMsg">

+ 29 - 5
pages/room/add.js

@@ -169,7 +169,8 @@ Page({
   },
 
   sceneChange: function (e) {
-    const index = e.detail.value
+      console.log('sceneChange', e)
+      const index = e.detail.value
     if (index > -1) {
       const select = this.data.sceneList[index]
       console.log('picker值为', select)
@@ -198,14 +199,14 @@ Page({
     const {
       type
     } = ev.currentTarget.dataset
-    let detail = this.data.detail
+    let detail = JSON.parse(JSON.stringify(this.data.detail))
     detail[type] = ev.detail.value
     //判断大小
-    console.log(detail)
+    console.log(detail,this.data.detail)
     if (detail.effectiveEndTime && detail.effectiveStartTime) {
       let value = new Date(detail.effectiveEndTime.replace(/-/g, "/")) - new Date(detail.effectiveStartTime.replace(/-/g, "/"));
-      console.log(value, detail.effectiveEndTime, detail.effectiveStartTime)
-      if (value < 0) {
+      console.log(value,  new Date(detail.effectiveEndTime.replace(/-/g, "/")).getMinutes(),new Date(detail.effectiveStartTime.replace(/-/g, "/")).getMinutes())
+      if (value <= 0 ) {
         return wx.showToast({
           title: '结束时间大于开始时间',
           icon: 'none',
@@ -230,6 +231,25 @@ Page({
       multiIndex: e.detail.value
     })
   },
+  toReportScene: function(e) {
+    let sceneList = this.data.sceneList
+    if(sceneList && sceneList.length == 0){
+      this.toReport()
+    }
+  },
+  toReportAssistant: function(e) {
+    let assistantList = this.data.assistantList
+    if(assistantList && assistantList.length == 0){
+      this.toReport()
+    }
+  },
+  toReport: function(e) {
+    return wx.showToast({
+      title: '暂无数据',
+      icon: 'none',
+      duration: 1000
+    })
+  },
   sbmit: async function () {
     const {
       name,
@@ -255,6 +275,10 @@ Page({
     } else if (!effectiveEndTime) {
       err = '请选择结束时间'
     }
+    let iconRule2 = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig
+    if(iconRule2.test(name)){
+      err = '房间名称仅支持中英文'
+    }
     if (err) {
       return wx.showToast({
         title: err,

+ 5 - 5
pages/room/add.wxml

@@ -3,13 +3,13 @@
     <view class="navigator a">
         <view class="room-name">
           <text class="require">房间名称</text>
-          <input  bindinput="handleRoomName" class="value input" auto-focus placeholder="请输入房间名称"/>
+          <input  bindinput="handleRoomName" maxlength="15" class="value input" auto-focus placeholder="请输入房间名称"/>
         </view>
       </view>
   </view>
   <view class="order-list-v">
-    <picker bindchange="sceneChange" data-type="brandId" data-name="brandId" value="{{detail.scene}}" range="{{sceneList}}" range-key="name">
-      <view bindtap="toReport" class="navigator a {{ hasBrand ? '' : 'hidden'}}">
+    <picker bindchange="sceneChange" disabled="{{sceneList.length == 0}}" data-type="brandId" data-name="brandId" value="{{detail.scene}}" range="{{sceneList}}" range-key="name">
+      <view bindtap="toReportScene" class="navigator a {{ hasBrand ? '' : 'hidden'}}">
         <view>
           <text class="require">直播场景</text>
           <text class="value {{detail.scene?'':'tipsClass'}}">{{detail.scene || '请选择直播场景'}}</text>
@@ -49,8 +49,8 @@
     </date-time-picker>
   </view>
   <view class="order-list-v">
-    <picker bindchange="assistantChange" data-type="assistantUserId" data-name="assistant" value="{{detail.assistant}}" range="{{assistantList}}" range-key="name">
-      <view bindtap="toReport" class="navigator a {{ hasBrand ? '' : 'hidden'}}">
+    <picker bindchange="assistantChange" disabled="{{assistantList.length == 0}}" data-type="assistantUserId" data-name="assistant" value="{{detail.assistant}}" range="{{assistantList}}" range-key="name">
+      <view bindtap="toReportAssistant" class="navigator a {{ hasBrand ? '' : 'hidden'}}">
         <view>
           <text style="margin-right:30rpx;">选择助理</text>
           <text class="value {{ detail.assistant ? '' : 'tipsClass'}}">{{detail.assistant || '请选择助理'}}</text>

+ 1 - 1
pages/roomManger/roomManger.wxml

@@ -15,7 +15,7 @@
       <view class="storeSearch">
         <image src="../../static/images/icon/search@2x.png"></image>
         <input wx:if="{{fetcherData.type==31}}" maxlength="30" bindconfirm="search" bindinput="inputChange" type="text" placeholder="请输入VR场景名称" placeholder-class="placeholderStyle" />
-        <input wx:else bindconfirm="search"  maxlength="30" bindinput="inputChange" type="text" placeholder="请输入场景名称" placeholder-class="placeholderStyle" />
+        <input wx:else bindconfirm="search"  maxlength="30" bindinput="inputChange" type="text" placeholder="请输入房间名称" placeholder-class="placeholderStyle" />
       </view>
       <view class="searchBtn" bindtap="search">搜索</view>
     </view>

+ 3 - 3
socket.js

@@ -500,6 +500,7 @@ export default {
     })
 
     socket.on("beKicked", data => {
+      const that = this
       if (data.userId && data.roomId) {
         const socketOptions = this.data.socketOptions
         const userId = data.userId
@@ -511,12 +512,11 @@ export default {
             icon: 'none',
             complete: () => {
               setTimeout(() => {
-                this.socketStop();
+                that.socketStop();
                 wx.switchTab({
                   url: '/pages/index/index',
-                });
+                })
               }, 1000)
-
             }
           })
         }