liyongli il y a 1 an
Parent
commit
a22487d9a3

+ 36 - 1
pages/guests/index.js

@@ -1,5 +1,12 @@
 // pages/guests/index.js
 import api from "../../api/index"
+const {
+  globalData: {
+    systemInfo: {
+      windowWidth
+    }
+  }
+} = getApp()
 Page({
 
   /**
@@ -11,11 +18,39 @@ Page({
     guests_ordinary: []
   },
 
+  imageload(e) {
+    const {
+      detail: {
+        width,
+        height
+      },
+      currentTarget: {
+        dataset: {
+          index
+        }
+      }
+    } = e;
+    const rwidth = windowWidth * 0.6;
+    const rheight = height / width * rwidth;
+    const item = JSON.parse(JSON.stringify(this.data.guests_marster));
+    item[index].width = rwidth;
+    item[index].height = rheight;
+    this.setData({
+      guests_marster: item
+    })
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    Promise.all([api.getGuests({type: 1}),api.getGuests({type: 2}),api.getGuests({type: 3})]).then(list=>{
+    Promise.all([api.getGuests({
+      type: 1
+    }), api.getGuests({
+      type: 2
+    }), api.getGuests({
+      type: 3
+    })]).then(list => {
       const [guests_marster, guests_participate_in, guests_ordinary] = list;
       this.setData({
         guests_marster: guests_marster || [],

+ 5 - 5
pages/guests/index.wxml

@@ -4,15 +4,15 @@
     <view class="guests_title">
       主讲嘉宾
     </view>
-    <swiper autoplay="{{true}}" circular="{{true}}" display-multiple-items="{{1.5}}" class="marster_phone" cache-extent="{{1}}" layout-type="stackLeft">
+    <swiper autoplay="{{true}}" circular="{{true}}" display-multiple-items="{{1.5}}" class="marster_phone" cache-extent="{{1}}" layout-type="stackLeft" style="height: 300px;">
       <block wx:for="{{guests_marster}}" wx:key="index">
-        <swiper-item>
+        <swiper-item style="height: 300px;">
           <view class="m_phone_bg">
-            <image class="m_phone" src="{{item.photo}}" />
-            <view style="padding: 0 15rpx;" class="van-ellipsis">
+            <image class="m_phone" style="{{'width: ' + (item.width || 0) + 'px;height: ' + (item.height || 0) + 'px'}}" src="{{item.photo}}" bindload="imageload" data-index="{{index}}" />
+            <view style="padding: 10rpx 15rpx;" class="van-ellipsis">
               {{item.userName}}
             </view>
-            <view style="padding: 0 15rpx;" class="van-ellipsis">
+            <view style="padding: 10rpx 15rpx;" class="van-ellipsis">
               {{item.tags}}
             </view>
           </view>

+ 1 - 7
pages/guests/index.wxss

@@ -25,20 +25,14 @@
 .marster_phone {
   display: block;
   width: 750rpx;
-  height: 350rpx;
-}
-
-.m_phone{
-  width: 450rpx;
-  height: 253rpx;
 }
 
 .m_phone_bg {
   display: block;
   margin: 0 auto;
   border-radius: 35rpx;
+  line-height: 1.5em;
   width: 450rpx;
-  height: 350rpx;
   overflow: hidden;
   background-color: var(--base-color);
   position: relative;

+ 9 - 2
pages/livePhone/index.js

@@ -24,10 +24,13 @@ Page({
     cover: ""
   },
   page: 1,
-  size: 10,
+  size: 12,
   total: 0,
   changeMeet(e) {
     this.page = 1;
+    this.setData({
+      images: []
+    })
     this.getPhone(e.detail.name);
   },
   imageLoad(e) {
@@ -67,8 +70,12 @@ Page({
     }).then(res => {
       this.page += 1;
       this.total = res.total;
+      const list = [
+        ...this.data.images,
+        ...(res.records || [])
+      ]
       this.setData({
-        images: res.records || []
+        images: list
       })
     })
   },

+ 1 - 1
pages/livePhone/index.wxml

@@ -5,7 +5,7 @@
   <van-tabs sticky="{{true}}" color="#ffffff" title-inactive-color="#cccccc" title-active-color="#ffffff" active="{{ actMeet }}" bind:change="changeMeet">
     <van-tab wx:for="{{tabs}}" wx:key="index" title="{{item.agendaName}}" name="{{item.id + ''}}"></van-tab>
   </van-tabs>
-  <view style="margin-top: 1em;text-align: center;padding-right: 5px;">
+  <view style="margin-top: 1em;padding-right: 5px;">
     <image wx:for="{{images}}" wx:key="index" bindtap="showImage" data-index="{{index}}" src="{{item.photo}}" style="{{'width:' + phone.width + 'px;height:160rpx;margin-left:5px'}}" mode="aspectFit" />  
   </view>
   <van-empty wx:if="{{!images || !images.length}}" description="" />

+ 5 - 1
pages/liveVideo/index.js

@@ -55,8 +55,12 @@ Page({
     }).then(r => {
       this.page += 1;
       this.total = r.total;
+      const list = [
+        ...this.data.videos,
+        ...(r.records || [])
+      ]
       this.setData({
-        videos: r.records || []
+        videos: list
       })
     })
   },