liyongli 1 gadu atpakaļ
vecāks
revīzija
b5b96a7d33

+ 22 - 1
api/guests.js

@@ -24,7 +24,28 @@ function getGuests({type = 1, success}) {
     });
   })
 }
+// 获取嘉宾详情
+function getGuestsDetail({id, success}) {
+  return new Promise((resolve, reject) => {
+    req({
+      url: `/conference/guest/info/${id}`,
+      success(res) {
+        if (res.code !== 0) {
+          wx.showToast({
+            title: res.message || "请稍后再试",
+            icon: "none"
+          })
+          reject(res)
+          return
+        }
+        success && success(res.data)
+        resolve(res.data);
+      }
+    });
+  })
+}
 
 export default {
-  getGuests
+  getGuests,
+  getGuestsDetail
 }

+ 2 - 1
app.json

@@ -11,7 +11,8 @@
     "pages/partners/index",
     "pages/service/index",
     "pages/news/index",
-    "pages/signUp/index"
+    "pages/signUp/index",
+    "pages/detail/guests"
   ],
   "window": {
     "navigationBarTextStyle": "black",

+ 94 - 0
pages/detail/guests.js

@@ -0,0 +1,94 @@
+// pages/detail/guests.js
+import api from "../../api/index"
+const {
+  globalData: {
+    systemInfo: {
+      windowWidth
+    }
+  }
+} = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    detail : {}
+  },
+  imageload(e){
+    const {
+      detail: {
+        width,
+        height
+      }
+    } = e;
+    const rWidth = windowWidth * 0.3
+    const rheight = height / width * rWidth;
+    const item = JSON.parse(JSON.stringify(this.data.detail));
+    item.width = rWidth;
+    item.height = rheight;
+    this.setData({
+      detail: item
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    api.getGuestsDetail({id: options.id}).then(r=>{
+      console.log(r)
+      this.setData({
+        detail: r || {}
+      })
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 7 - 0
pages/detail/guests.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "van-row": "@vant/weapp/row/index",
+    "van-col": "@vant/weapp/col/index",
+    "van-cell-group": "@vant/weapp/cell-group/index"
+  }
+}

+ 24 - 0
pages/detail/guests.wxml

@@ -0,0 +1,24 @@
+<!--pages/detail/guests.wxml-->
+<view class="guests">
+  <van-cell-group inset>
+    <view style="background-color: #fff;padding: 1em;">
+      <van-row>
+        <van-col span="8">
+          <image class="m_phone" style="{{'width: ' + (detail.width || 0) + 'px;height: ' + (detail.height || 0) + 'px'}}" src="{{detail.photo}}" bindload="imageload" />
+        </van-col>
+        <van-col span="16">
+          <view style="padding: 0 0 0 1em;">
+            <view class="title" style="margin-bottom: 1em;">{{detail.userName}}</view>
+            <view class="van-multi-ellipsis--l2">{{detail.tags}}</view>
+          </view>
+        </van-col>
+      </van-row>
+    </view>
+  </van-cell-group>
+  <view style="height: 2em;"></view>
+  <van-cell-group inset>
+    <view style="background-color: #fff;padding: 1em;text-indent: 2em;">
+      {{detail.userDesc}}
+    </view>
+  </van-cell-group>
+</view>

+ 4 - 0
pages/detail/guests.wxss

@@ -0,0 +1,4 @@
+/* pages/detail/guests.wxss */
+.guests{
+  padding-top: 100rpx;
+}

+ 7 - 1
pages/guests/index.js

@@ -1,5 +1,8 @@
 // pages/guests/index.js
 import api from "../../api/index"
+import {
+  toNavigatePage
+} from "../../utils/util"
 const {
   globalData: {
     systemInfo: {
@@ -18,6 +21,9 @@ Page({
     guests_ordinary: []
   },
 
+  toPage(e) {
+    toNavigatePage(e.currentTarget.dataset.url + '?id=' + e.currentTarget.dataset.id)
+  },
   imageload(e) {
     const {
       detail: {
@@ -30,7 +36,7 @@ Page({
         }
       }
     } = e;
-    const rwidth = windowWidth * 0.6;
+    const rwidth = windowWidth * 0.5;
     const rheight = height / width * rwidth;
     const item = JSON.parse(JSON.stringify(this.data.guests_marster));
     item[index].width = rwidth;

+ 12 - 16
pages/guests/index.wxml

@@ -4,28 +4,24 @@
     <view class="guests_title">
       主讲嘉宾
     </view>
-    <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 style="height: 300px;">
-          <view class="m_phone_bg">
-            <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: 10rpx 15rpx;" class="van-ellipsis">
-              {{item.tags}}
-            </view>
-          </view>
-        </swiper-item>
-      </block>
-    </swiper>
+    <view style="padding-left: 10rpx;">
+      <view bindtap="toPage" data-url="/pages/detail/guests" data-id="{{item.id}}" wx:for="{{guests_marster}}" wx:key="index" class="m_phone_bg">
+        <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: 10rpx 15rpx;" class="van-ellipsis">
+          {{item.tags}}
+        </view>
+      </view>
+    </view>
   </block>
   <block wx:if="{{guests_participate_in.length}}">
     <view class="guests_title">
       参会嘉宾
     </view>
     <van-cell-group inset>
-      <van-cell wx:for="{{guests_marster}}" wx:key="index" title="{{item.userName}}" label="{{item.tags}}" />
+      <van-cell wx:for="{{guests_participate_in}}" wx:key="index" title="{{item.userName}}" label="{{item.tags}}" />
     </van-cell-group>
   </block>
   <block wx:if="{{guests_ordinary.length}}">

+ 3 - 3
pages/guests/index.wxss

@@ -28,11 +28,11 @@
 }
 
 .m_phone_bg {
-  display: block;
-  margin: 0 auto;
+  display: inline-block;
+  margin: 10rpx 0 0 10rpx;
   border-radius: 35rpx;
   line-height: 1.5em;
-  width: 450rpx;
+  width: 350rpx;
   overflow: hidden;
   background-color: var(--base-color);
   position: relative;