Browse Source

feat:更新代码

jinx 4 years ago
parent
commit
f30a8bed5d

+ 4 - 3
component/auth/api.js

@@ -5,12 +5,13 @@ export const getSubOpen = () => {
   if (!userInfo.isAdmin) {
     return;
   }
-  
+
+
   wx.getSetting({
     withSubscriptions: true,
     success: res => {
       let itemSettings = res.subscriptionsSetting
-    
+      console.log('itemSettings', itemSettings)
       if (!itemSettings || !itemSettings[tempId] || itemSettings[tempId] === 'reject') {
         wx.showModal({
           title: '温馨提示',
@@ -19,7 +20,7 @@ export const getSubOpen = () => {
           cancelText: "取消", //默认是“取消”
           confirmText: "确定", //默认是“确定”
           success: (res) => {
-            authMsg() 
+            authMsg()
           }
         })
       }

+ 12 - 5
component/roomItem/roomItem.wxss

@@ -10,20 +10,26 @@
 
 
 .tj_listItem .tj_listItemCover {
-  width: 210rpx;
-  height: 210rpx;
+  /* width: 210rpx;
+  height: 210rpx; */
+  width:  160rpx;
+  height:  160rpx;
   border-radius: 8px;
   overflow: hidden;
 }
 
 .tj_listItem .tj_listItemCover .coverImage {
-  width: 210rpx;
-  height: 210rpx;
+  /* width: 210rpx;
+  height: 210rpx; */
+  width: 160rpx;
+  height:  160rpx;
 }
 
 .tj_listItemMsg {
   width: 456rpx;
   margin-left: 20rpx;
+  /* padding-top: 10rpx;
+  box-sizing: border-box; */
 }
 
 .tj_listItemMsg .tj_listItemTitle {
@@ -42,7 +48,8 @@
   display: flex;
   align-items: center;
   height: 28rpx;
-  margin: 15rpx 0 10rpx ;
+  margin: 10rpx 0 10rpx ;
+ 
 }
 
 .tj_listItemMsg .tj_listItemTip .tj_listItemTipText {

+ 2 - 2
component/storeItem/storeItem.wxml

@@ -1,8 +1,8 @@
 <!--component/storeItem/storeItem.wxml-->
 <view class="storeBox" data-id="{{storeItem.id}}" data-index="{{index}}" bindtap="gotoWV">
   <view class="storeCover">
-    <image wx:if="{{room.appListPicUrl!=''}}" mode="aspectFill" src="{{storeItem.appListPicUrl}}"></image>
-    <image wx:else mode="aspectFill" class="coverImage" src="../../static/images/icon/pic_bg@2x.png"></image>
+    <image wx:if="{{storeItem.appListPicUrl!=''}}" mode="aspectFill" src="{{storeItem.appListPicUrl}}"></image>
+    <image wx:else mode="widthFix" class="coverImage" src="../../static/images/icon/pic_bg@2x.png"></image>
 
   </view>
   <view class="storeTitle">

+ 1 - 1
component/storeItem/storeItem.wxss

@@ -14,7 +14,7 @@
 
 .storeBox .storeCover image {
   width: 334rpx;
-  /* height: 334rpx; */
+  height: 334rpx;
 }
 
 .storeTitle {

+ 38 - 19
pages/searchRoom/searchRoom.js

@@ -18,7 +18,7 @@ Page({
       type: null,
       address: app.globalData.city,
       page: 1,
-      size: 100,
+      size: 20,
       name: ''
     },
     typeName: {
@@ -31,7 +31,9 @@ Page({
 
   },
   gotoWV: function (event) {
-    let {id} = event.detail
+    let {
+      id
+    } = event.detail
     wx.navigateTo({
       url: `/pages/webview/index?id=${id}`,
     })
@@ -42,20 +44,31 @@ Page({
     });
   },
   search() {
-    if (this.data.fetcherData.name != '') {
-      wx.showLoading({
-        title: '加载中...',
-      });
-      // console.log(this.data.searchKey)
-     
-      this.getRoomList()
+    // if (this.data.fetcherData.name != '') {
+    wx.showLoading({
+      title: '加载中...',
+    });
+    // console.log(this.data.searchKey)
+    if (this.data.fetcherData.type == '21') { //商家
+      this.setData({
+        storeList: []
+      })
     } else {
-      wx.showToast({
-        title: '请输入VR场景名称',
-        icon: 'none'
+      this.setData({
+        roomList: []
       })
-
     }
+    this.setData({
+      'fetcherData.page': 1,
+    })
+    this.getRoomList()
+    // } else {
+    //   wx.showToast({
+    //     title: '请输入VR场景名称',
+    //     icon: 'none'
+    //   })
+
+    // }
 
   },
 
@@ -76,7 +89,7 @@ Page({
       }
     }
     if (!this.data.loading) {
-     
+
       this.setData({
         loading: true
       })
@@ -90,16 +103,20 @@ Page({
           if (this.data.fetcherData.type == '21') {
 
             this.setData({
-              storeList: res.data.data,
+              storeList: this.data.storeList.concat(res.data.data),
+              // storeList: res.data.data,
+              'fetcherData.page': this.data.fetcherData.page + 1,
               isSearch: true
             })
           } else {
 
             this.setData({
-              roomList: res.data.data,
+              roomList: this.data.roomList.concat(res.data.data),
+              // roomList: res.data.data,
+              'fetcherData.page': this.data.fetcherData.page + 1,
               isSearch: true
             })
-           
+
           }
 
 
@@ -126,7 +143,7 @@ Page({
       })
       this.getRoomList()
       wx.setNavigationBarTitle({
-        title: this.data.typeName[options.type] 
+        title: this.data.typeName[options.type]
       })
     }
 
@@ -171,7 +188,9 @@ Page({
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function () {},
+  onReachBottom: function () {
+    this.getRoomList()
+  },
 
   /**
    * 用户点击右上角分享

+ 1 - 1
pages/searchRoom/searchRoom.wxml

@@ -2,7 +2,7 @@
   <view class="storeContent">
     <view class="storeSearch">
       <image src="../../static/images/icon/search@2x.png"></image>
-      <input focus="true" bindinput="inputChange" value="{{fetcherData.name}}" type="text" placeholder="请输入直播间名称"
+      <input focus="true" bindconfirm="search" bindinput="inputChange" value="{{fetcherData.name}}" type="text" placeholder="请输入直播间名称"
         placeholder-class="placeholderStyle" />
     </view>
     <view class="searchBtn" bindtap="search">搜索</view>

+ 29 - 17
pages/sence/sence.js

@@ -35,18 +35,25 @@ Page({
       })
       this.searchRoomList()
     } else {
-      if(this.data.isSearch){
+      if (this.data.isSearch) {
         this.setData({
           isSearch: false
         })
         this.searchRoomList()
-      }else{
-        wx.showToast({
-          title: '请输入VR场景名称',
-          icon: 'none'
+      } else {
+        // wx.showToast({
+        //   title: '请输入VR场景名称',
+        //   icon: 'none'
+        // })
+        wx.showLoading({
+          title: '加载中...',
+        });
+        this.setData({
+          isSearch: true
         })
+        this.searchRoomList()
       }
-     
+
 
     }
 
@@ -128,30 +135,35 @@ Page({
 
   },
   gotoWV: function (event) {
-    let {id} = event.detail
+    let {
+      id
+    } = event.detail
     wx.navigateTo({
       url: `/pages/webview/index?id=${id}`,
     })
     util.request(api.increaseViewCount, {
       brandId: id
     }, 'GET').then((res) => {
-      
+
     });
-     
-  
+
+
   },
-  storeGotoWv(event){
-    let {id,index} = event.detail
+  storeGotoWv(event) {
+    let {
+      id,
+      index
+    } = event.detail
     wx.navigateTo({
       url: `/pages/webview/index?id=${id}`,
     })
     util.request(api.increaseViewCount, {
       brandId: id
     }, 'GET').then((res) => {
-        var num =  'roomList['+index+'].pvTotalNum'
-        this.setData({
-          [num]:res.data
-        })
+      var num = 'roomList[' + index + '].pvTotalNum'
+      this.setData({
+        [num]: res.data
+      })
     });
   },
   /**
@@ -165,7 +177,7 @@ Page({
     })
     if (options.type == 31) {
       wx.setNavigationBarTitle({
-        title: 'VR场景'
+        title: '场景列表'
       })
 
     } else {

+ 1 - 1
pages/sence/sence.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "VR场景",
+  "navigationBarTitleText": "场景列表",
   "enablePullDownRefresh": false,
   "usingComponents": {
     "roomItem": "../../component/roomItem/roomItem",

+ 2 - 2
pages/sence/sence.wxml

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

+ 2 - 3
pages/ucenter/index/index.js

@@ -73,7 +73,7 @@ Page({
           {
             icon: 'vr@2x',
             url: '/pages/sence/sence',
-            name: 'VR场景',
+            name: '场景列表',
             type: 31
           },
           {
@@ -166,8 +166,7 @@ Page({
     },
     async getUserInfo() {
       const {data} = await util.request(api.UserInfo)
-      console.log('!!!!!!!!!')
-      console.log(data)
+      console.log('UserInfo',data)
       wx.setStorageSync('userinfoDetail', data)
       this.setData({
         userInfo: {

+ 6 - 1
pages/user/user.wxml

@@ -17,7 +17,12 @@
     <view class="item">
       <text>手机号</text>
       <view class="ir">
-        <input bindblur="save" data-type="2" bindinput="changPhone" value="{{mobile}}" class="ipname"  wx:if="{{mobile}}"></input>
+        <!-- <input bindblur="save" data-type="2" bindinput="changPhone" value="{{mobile}}" class="ipname"  wx:if="{{mobile}}"></input> -->
+        <button style="background:transparent;padding:0;" wx:if="{{mobile}}"  open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >  
+          <input disabled="{{true}}" data-type="2" bindinput="changPhone" value="{{mobile}}" class="ipname"  ></input>
+        </button>
+    
+
         <button wx:if="{{!mobile}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="getPhone">点击获取手机号</button>
       </view>
     </view>

+ 4 - 6
project.config.json

@@ -18,23 +18,21 @@
     "checkSiteMap": true,
     "uploadWithSourceMap": true,
     "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
     "useMultiFrameRuntime": true,
     "useApiHook": true,
+    "useApiHostProcess": false,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
       "outputPath": ""
     },
-    "enableEngineNative": false,
-    "bundle": false,
-    "useIsolateContext": true,
-    "useCompilerModule": false,
-    "userConfirmedUseCompilerModuleSwitch": false,
+    "useIsolateContext": false,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": true,
-    "useApiHostProcess": false
+    "showES6CompileOption": false
   },
   "compileType": "miniprogram",
   "libVersion": "2.6.6",

+ 51 - 6
socket.js

@@ -37,8 +37,6 @@ let urlToJson = (url = window.location.href) => { // 箭头函数默认传值为
 
 export default {
   joinUrl() {
-    console.log('***************************')
-    console.log(this.data.url)
     let options = {
       API_BASE_URL: api.API_BASE_URL,
       "url": this.data.url,
@@ -65,12 +63,20 @@ export default {
     if (this.data.join && !this.options.join) {
       sponsor = false
     }
-
+    // remote.viewHost
+    // let hostUrl
+    // if(options.url.indexOf('www.4dkankan.com')!=-1){
+    //   hostUrl ='https://www.4dkankan.com'
+    // }else{
+    //   hostUrl ='https://zfb.4dkankan.com'
+    // }
     let base = remote.viewHost + '/shop-container/fashilong.html?env=' + remote.env + '&sponsor=' + sponsor + '&many=' + this.data.many
+    // let base = hostUrl + '/shop-container/fashilong.html?env=' + remote.env + '&sponsor=' + sponsor + '&many=' + this.data.many
     // let base = remote.viewHost + '/shop.html'
 
     this.data.reload = false
     this.data.showCommodity = false
+    // options.url = options.url+'&vlog';
     if (!this.data.webviewUrl) {
       this.setData({
         'webviewUrl': base + '#' + JSON.stringify(options)
@@ -239,11 +245,19 @@ export default {
 
 
 
-    this.role !== 'leader'
+    // this.role !== 'leader'
     let roomType
     if ((!this.data.canShow && !this.data.join) || (this.data.join && !this.options.join)) {
       roomType = '1v1'
+      if (this.options.roomId) {
+        this.role = 'leader'
+      }
+      console.log('**************')
+      console.log(this.options)
     }
+    // wx.showToast({
+    //   title: this.data.peopleCount.toString(),
+    // })
     return {
       role: this.role || 'leader',
       userId: userInfo.userId,
@@ -331,11 +345,14 @@ export default {
       console.log('调用', data.type, '方法', data)
       if (this[data.type]) {
         this[data.type](data)
+      } else if (data.type == 'wx-subscribe') {
+        this.getUrlCode(data.data)
       } else {
         console.error('没有', data.type, '方法')
       }
     })
 
+
     socket.on('action', (data) => {
       if (data.type === 'navigateToGoods') {
         this.navigateToGoodsAction(data.data)
@@ -375,7 +392,33 @@ export default {
 
     return options
   },
+  getUrlCode(url) {
+    this.socketSendMessage('clientSyncAction', {
+      sender: 'wx',
+      type: 'wx-subscribe-result',
+      data: 3020
+    })
+    // wx.request({
+    //   url: url, //仅为示例,并非真实的接口地址
+    //   method: 'get',
+    //   success: (res) => {
+    //     let code = -1
+    //     if (typeof res.data.code != 'undefined') {
+    //       code = res.data.code
+    //     }
+
+    //     this.socketSendMessage('clientSyncAction', {
+    //       sender: 'wx',
+    //       type: 'wx-subscribe-result',
+    //       data: code
+    //     })
 
+    //   },
+    //   fail: (err) => {
+    //     console.log(err)
+    //   }
+    // })
+  },
   changeRoomEnableTalk(data) {
     console.log(data)
     let noMute = getApp().globalData.voiceProps.noMute
@@ -525,7 +568,8 @@ export default {
       this.data.many = !!this.data.canShow
 
       this.setData({
-        peopleCount: this.data.many ? manyCount : 5
+        // peopleCount: this.data.many ? manyCount : 5
+        peopleCount: this.data.many ? manyCount : 2
       })
 
       let base = this.base
@@ -1030,7 +1074,8 @@ export default {
           this.data.many = !!res.data.brand.canShow
         }
         this.setData({
-          peopleCount: this.data.many ? manyCount : 5,
+          // peopleCount: this.data.many ? manyCount : 5,
+          peopleCount: this.data.many ? manyCount : 2,
         })
 
         if (!res.data.brand.canShow) {

BIN
static/images/icon/pic_bg@2x.png