瀏覽代碼

showList,playShpw

yukangzhe 3 年之前
父節點
當前提交
c95402f122

+ 1 - 0
app.json

@@ -2,6 +2,7 @@
   "plugins": {},
   "pages": [
     "pages/login/login",
+    "pages/playShow/playShow",
     "pages/demo/demo",
     "pages/taskDetail/taskDetail",
     "pages/index/index",

二進制
images/share.png


+ 5 - 0
pages/Components/showList/showList.js

@@ -2,6 +2,11 @@
 const util = require("../../../utils/util")
 const urlDef = require("../../../utils/urls")
 Component({
+  lifetimes:{
+    attached:function(){
+      
+    }
+  },
   /**
    * 组件的属性列表
    */

+ 3 - 2
pages/Components/showList/showList.wxml

@@ -2,13 +2,14 @@
   <view class="show-list">
     <view class="show-box" wx:for="{{list}}" wx:key="index">
       <view class="show-img"  bindtap="doPlay" data-url="{{item.playUrl}}">
-        <image mode="aspectFill" src="{{item.imgUrl}}"></image>
+        <video poster="{{item.imgUrl}}" src="{{item.src}}" controls="true"></video>
       </view>
       <view class="show-title-view">
         <view class="show-title">{{item.title}}</view>
         <view class="zan-view"  bindtap="doThumbsUp" data-id="{{item.videoId}}">
           <view class="zan-img">
-            <image src="/images/zan.png" ></image>
+            <image src="/images/zan.png" wx:if="{{item.goodCount <= 0}}" ></image>
+            <image src="/images/cur-zan.png" ex:else></image>
           </view>
           <view class="zan-num">{{item.goodCount}}</view>
         </view>

+ 1 - 1
pages/Components/showList/showList.wxss

@@ -17,7 +17,7 @@
   height: 255rpx;
 }
 
-.show-img image {
+.show-img video {
   width: 100%;
   height: 100%;
   border-radius: 10rpx;

+ 66 - 0
pages/playShow/playShow.js

@@ -0,0 +1,66 @@
+// pages/playShow/playShow.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/playShow/playShow.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 20 - 0
pages/playShow/playShow.wxml

@@ -0,0 +1,20 @@
+<view class="container">
+  <view class="video-view">
+    <video id="playShow" controls="true"></video>
+  </view>
+
+  <view class="title">测试视视频</view>
+  <view class="desc">测试视频简介测试视频简介测试视频简介测试视频简介测试视频简介测试视频简介</view>
+
+  <view class="edit-view">
+    <view class="zan-view" bindtap="zanBtn">
+      <image src="/images/zan.png"></image>
+      <view>点赞</view>
+      <text>(1000000)</text>
+    </view>
+    <button open-type='share' class="share-view">
+      <image src="/images/share.png"></image>
+      <view>分享</view>
+    </button>
+  </view>
+</view>

+ 48 - 0
pages/playShow/playShow.wxss

@@ -0,0 +1,48 @@
+.container{
+  padding: 0;
+  margin: 0;
+}
+#playShow{
+  width: 750rpx;
+  height: 563rpx;
+}
+.title,.desc{
+  width: 700rpx;
+  padding: 10rpx 25rpx;
+}
+.title{
+  font-size: 36rpx;
+}
+.desc{
+  color: #999;
+}
+
+.zan-view image,.share-view image{
+  width: 100rpx ;
+  height: 100rpx;
+}
+.edit-view{
+  width: 600rpx;
+  display: flex;
+  position: absolute;
+  bottom: 200rpx;
+  left: 50%;
+  margin-left: -300rpx;
+}
+.edit-view>view{
+  margin: 0 auto;
+  text-align: center;
+  width: 200rpx;
+}
+.edit-view text{
+  font-size: 24rpx;
+}
+.share-view{
+  padding: 0;
+  margin: 0;
+  background: #FFF;
+  width: 200rpx !important;
+}
+.share-view view{
+  font-weight: 400 !important;
+}