liyongli 1 year ago
parent
commit
278f84765e

+ 1 - 3
miniprogram/app.js

@@ -15,9 +15,7 @@ App({
       })
     }
 
-    this.globalData = {
-      ...config
-    }
+    this.globalData = config;
   }
 })
 

+ 1 - 0
miniprogram/config/idnex.js

@@ -1,4 +1,5 @@
 module.exports = {
   client: wx.getSystemInfoSync(),
+  ...wx.getAccountInfoSync(),
   baseurl: "https://cxzx.smcic.net/topic"
 }

+ 12 - 2
miniprogram/pages/activityDetail/index.js

@@ -1,7 +1,10 @@
+// miniprogram/pages/home/index.js
 import {
   httpOrther
 } from "../../utils/httpFunc";
-// miniprogram/pages/home/index.js
+const {
+  globalData
+} = getApp();
 Page({
 
   /**
@@ -50,8 +53,15 @@ Page({
     }
 
     const _this = this;
+    let url = `/Applets/shengshizhongguo/json/${options.url || 'shengshi'}`;
+    if (globalData.miniProgram.envVersion === 'develop') {
+      url += '-dev'
+    } else if (globalData.miniProgram.envVersion === 'trial') {
+      url += '-tri'
+    }
+    url += `.json?${Date.now()}`
     httpOrther({
-      url: `/Applets/shengshizhongguo/json/${options.url || 'shengshi'}.json?${Date.now()}`,
+      url,
       call(res) {
         _this.setData({
           iconList: res.list || [],

+ 22 - 9
miniprogram/pages/home/index.js

@@ -12,13 +12,20 @@ Page({
    */
   data: {
     list: [],
-    heights: []
+    // heights: []
   },
   title: '',
   showBack() {
     const _this = this;
+    let url = '/Applets/shengshizhongguo/json/list';
+    if (globalData.miniProgram.envVersion === 'develop') {
+      url += '-dev'
+    } else if (globalData.miniProgram.envVersion === 'trial') {
+      url += '-tri'
+    }
+    url += `.json?${Date.now()}`
     httpOrther({
-      url: `/Applets/shengshizhongguo/json/list.json?${Date.now()}`,
+      url,
       call(res) {
         const defaultItem = (res.list || [])[0]
         if (!res.showList) {
@@ -28,7 +35,13 @@ Page({
           return
         }
         _this.setData({
-          list: res.list || []
+          // list: res.list || []
+          list: [
+            ...res.list,
+            ...res.list,
+            ...res.list,
+            ...res.list,
+          ]
         })
       }
     })
@@ -41,12 +54,12 @@ Page({
   },
 
   imageload(e) {
-    let width = globalData.client.screenWidth * 73 / 75;
-    const ori = JSON.parse(JSON.stringify(this.data.heights));
-    ori[e.currentTarget.dataset.index || 0] = width * e.detail.height / globalData.client.screenWidth;
-    this.setData({
-      heights: ori
-    })
+    // let width = globalData.client.screenWidth * 73 / 75;
+    // const ori = JSON.parse(JSON.stringify(this.data.heights));
+    // ori[e.currentTarget.dataset.index || 0] = width * e.detail.height / globalData.client.screenWidth;
+    // this.setData({
+    //   heights: ori
+    // })
   },
 
   /**

+ 6 - 4
miniprogram/pages/home/index.wxml

@@ -1,5 +1,7 @@
 <!--pages/home/index.wxml-->
-<view class="homelist" wx:for="{{list}}" wx:key="title" data-file="{{item.fileName}}" data-title="{{item.title}}" bind:tap="toDetail">
-  <image bindload="imageload" style="{{heights[index] + 'px'}}" data-index="{{index}}" class="image" wx:if="{{item.cover}}" src="{{item.cover}}" />
-  <view class="title">{{item.title}}</view>
-</view>
+<view style="padding-top: 10rpx;font-size: 0;">
+  <view class="homelist" wx:for="{{list}}" wx:key="title" data-file="{{item.fileName}}" data-title="{{item.title}}" bind:tap="toDetail">
+    <image bindload="imageload" data-index="{{index}}" class="image" wx:if="{{item.cover}}" src="{{item.cover}}" />
+    <view class="title">{{item.title}}</view>
+  </view>
+</view>

+ 12 - 7
miniprogram/pages/home/index.wxss

@@ -1,16 +1,20 @@
 /* pages/home/index.wxss */
 .homelist{
-  position: relative;
-  width: 730rpx;
-  overflow: hidden;
-  margin: 0 auto;
+  display: inline-block;
+  width: 345rpx;
+  margin: 10rpx 10rpx 10rpx 20rpx;
   border-radius: 15rpx;
-  box-shadow: #ccc 0  0  10rpx;
+  box-shadow: #ccc 0  0  20rpx;
+  overflow: hidden;
+}
+.homelist:nth-child(even){
+  margin: 10rpx 20rpx 10rpx 10rpx;
 }
 
 .image{
-  min-height: 400rpx;
-  width: 730rpx;
+  height: 270rpx;
+  width: 345rpx;
+  display: block;
 }
 
 .title{
@@ -18,6 +22,7 @@
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
+  font-size: 16px;
 }
 
 .tag{

+ 11 - 3
miniprogram/pages/live/live.js

@@ -10,7 +10,8 @@ Page({
   data: {
     isLive: false,
     liveData: {},
-    list: []
+    list: [],
+    type: '简介'
   },
   activity: "",
   id: "",
@@ -35,7 +36,14 @@ Page({
     })
   },
 
-  liveing() {
+  select(e){
+    console.log(e.currentTarget.dataset.type);
+    this.setData({
+      type: e.currentTarget.dataset.type
+    })
+  },
+
+  liveing(e) {
     this.setData({
       isLive: true
     })
@@ -49,7 +57,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.activity = options.activityName;
+    this.activity = decodeURIComponent(options.activityName);
     this.id = options.id;
     this.getDate();
   },

+ 16 - 2
miniprogram/pages/live/live.wxml

@@ -3,5 +3,19 @@
   <image wx:if="{{!isLive}}" class="image" src="../../assets/image/nolive.jpg" mode="aspectFill" />
   <video class="video" enable-play-gesture="{{true}}" enable-progress-gesture="{{false}}" play-btn-position="center" show-progress="{{false}}" src="{{liveData.liveUrl || liveData.backUrl}}" binderror="liveerr" bindplay="liveing" autoplay />
 </view>
-<mp-cell title="{{liveData.title}}"></mp-cell>
-<rich-text wx:if="{{liveData.introduce}}" style="width:730rpx;margin: 10rpx auto;display:block" nodes="{{liveData.introduce}}"></rich-text>
+<view wx:if="{{!liveData.is_activityName}}">
+  <mp-cell title="{{liveData.title}}"></mp-cell>
+  <!-- <view class="tabs">
+    <view wx:if="{{liveData.introduce}}" class="tab-item" data-type="简介" bind:tap="select">
+      <view class="tab-item-text">简介
+        <view class="{{'tab-item-line ' + (type === '简介' ? 'tab-item-act' : '')}}"></view>
+      </view>
+    </view>
+    <view class="tab-item" data-type="评论" bind:tap="select">
+      <view class="tab-item-text">评论
+        <view class="{{'tab-item-line ' + (type === '评论' ? 'tab-item-act' : '')}}"></view>
+      </view>
+    </view>
+  </view> -->
+  <rich-text wx:if="{{type === '简介' && liveData.introduce}}" style="width:730rpx;margin: 10rpx auto;display:block" nodes="{{liveData.introduce}}" />
+</view>

+ 27 - 1
miniprogram/pages/live/live.wxss

@@ -6,7 +6,33 @@
   height: 422rpx;
 }
 
-.liveBg{
+.liveBg {
   overflow: hidden;
   font-size: 0;
 }
+
+.tabs {
+  display: flex;
+}
+
+.tab-item {
+  flex: 1;
+  margin-bottom: 10rpx;
+  text-align: center;
+}
+
+.tab-item-text{
+  display: inline-block;
+  height: 2em;
+}
+
+.tab-item-line{
+  width: 2.5em;
+  height: 10rpx;
+  background-color: #f6f6f6;
+  border-radius: 2em;
+}
+
+.tab-item-act {
+  background-color: #8bbdee;
+}

+ 2 - 2
miniprogram/pages/videoDetail/index.js

@@ -39,7 +39,7 @@ Page({
    */
   onLoad(options) {
     const _this = this;
-    this.activityName = options.activityName;
+    this.activityName = decodeURIComponent(options.activityName);
     httpCloud({
       name: "server",
       type: "getMediaOnceController",
@@ -47,7 +47,7 @@ Page({
         typeMedia: options.type,
         id: options.id,
         group: options.group,
-        activityName: options.activityName
+        activityName: this.activityName
       },
       call(res) {
         const ori = res[0] || {

+ 1 - 8
project.private.config.json

@@ -9,14 +9,7 @@
         {
           "name": "",
           "pathName": "pages/live/live",
-          "query": "title=%E8%93%9D%E7%9B%B4%E6%92%AD&mediaType=live",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/livelist/index",
-          "query": "title=%E8%93%9D%E7%9B%B4%E6%92%AD&mediaType=live",
+          "query": "id=AvrSA4TAEG1fz1sK&activityName=%E7%9B%9B%E4%B8%96%E4%B8%AD%E5%8D%8E%20%E4%BD%95%E4%BB%A5%E4%B8%AD%E5%9B%BD",
           "launchMode": "default",
           "scene": null
         }