Commit ee929688ab538b6b80f0e066f554f3a44745fcc6

Authored by 后端研发-倪永富
1 parent 687fce2a

直播列表 和 直播详情页 添加开播时间

packageA/pages/liveStream/liveStream.wxml
... ... @@ -15,7 +15,7 @@
15 15 <view>
16 16 <view class="item-title">{{item.name}}</view>
17 17 <view class="item-time">{{filter.format_time(item.start_time, 2)}} 开始</view>
18   - <view></view>
  18 + <view class="item-anchor">主播:{{item['anchor_name']}}</view>
19 19 </view>
20 20 <subscribe room-id="{{item.roomid}}" stopPropagation="{{true}}"></subscribe>
21 21 </view>
... ... @@ -36,7 +36,11 @@
36 36 <image src="{{item.share_img}}" class="item-pic" mode="aspectFill"></image>
37 37 </view>
38 38 <view class="list-item-right">
39   - <view class="item-title">{{item.name}}</view>
  39 + <view>
  40 + <view class="item-title">{{item.name}}</view>
  41 + <view class="item-time">{{filter.format_time(item.start_time, 2)}} 开始</view>
  42 + <view class="item-anchor">主播:{{item['anchor_name']}}</view>
  43 + </view>
40 44 <view class="item-btn" catchtap="clickLive" data-roomid="{{item.roomid}}">观看直播</view>
41 45 </view>
42 46 </view>
... ... @@ -57,7 +61,7 @@
57 61 <view class="list-item-right">
58 62 <view>
59 63 <view class="item-title">{{item.name}}</view>
60   - <view class="item-time">{{filter.format_time(item.start_time, 2)}} 开始</view>
  64 + <view class="item-time">{{filter.format_time(item.end_time, 2)}} 结束</view>
61 65 <view class="item-anchor">主播:{{item['anchor_name']}}</view>
62 66 </view>
63 67 <view class="item-btn" catchtap="clickLive" data-roomid="{{item.roomid}}">观看回放</view>
... ...
packageA/pages/liveStreamDetails/liveStreamDetails.js
... ... @@ -191,7 +191,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
191 191 // 绘制文字
192 192 ctx.setFontSize(24);
193 193 ctx.setFillStyle('#1E1E1E');
194   - this.drawText(ctx, '发的电视剧覅是覅世界佛教阿松i范吉奥i是房间都是金佛ex哎', 51, 563, 300, 300, 2);
  194 + this.drawText(ctx, title, 51, 563, 300, 300, 2);
195 195  
196 196 // 绘制小程序码
197 197 ctx.drawImage(this.data.ewm, 310, 525, 132, 132);
... ...
packageA/pages/liveStreamDetails/liveStreamDetails.wxml
... ... @@ -5,22 +5,22 @@
5 5 <view class="content">
6 6 <!-- 封面标题 -->
7 7 <view class="cover-container">
8   - <image src="{{details.cover_img}}" class="cover-img" mode="aspectFit"></image>
  8 + <image src="{{details.share_img}}" class="cover-img" mode="aspectFit"></image>
9 9 <!-- <view class="cover-desc">
10 10 <view>{{details.name}}</view>
11   - <view>{{filter.format_time(details.start_time)}}</view>
  11 + <view>{{filter.format_time(details.startshare_time)}}</view>
12 12 </view> -->
13 13 </view>
14 14  
15 15 <!-- 直播详情 -->
16 16 <view class="desc-container">
17 17 <view class="desc-title">{{details.name}}</view>
  18 + <view class="desc-content">
  19 + <view>{{filter.format_time(details.start_time, 2)}} 锁定直播</view>
  20 + <!-- <view>护肤、彩妆、香氛群星汇聚,更有折扣买赠与神秘新品加持~</view>
  21 + <view>多轮抽奖惊喜连连,不容错过!</view> -->
  22 + </view>
18 23 <text class="desc-status">{{myUtils.liveStatus(details.live_status)}}</text>
19   - <!-- <view class="desc-content">
20   - <view>6月24日20:00锁定直播 盘点年中 「上榜」好货!</view>
21   - <view>护肤、彩妆、香氛群星汇聚,更有折扣买赠与神秘新品加持~</view>
22   - <view>多轮抽奖惊喜连连,不容错过!</view>
23   - </view> -->
24 24 </view>
25 25  
26 26 <!-- 列表 -->
... ...
packageA/pages/liveStreamDetails/liveStreamDetails.wxss
... ... @@ -54,11 +54,13 @@
54 54 line-height: 50rpx;
55 55 padding: 0 30rpx;
56 56 background-color: #eee;
57   - margin-top: 22rpx;
58   - margin-bottom: 44rpx;
  57 + /* margin-top: 22rpx;
  58 + margin-bottom: 44rpx; */
59 59 }
60 60 .desc-content {
61 61 font-size: 29rpx;
  62 + padding-top: 22rpx;
  63 + padding-bottom: 22rpx;
62 64 }
63 65 .list {
64 66 padding: 0 36rpx;
... ...
utils/filter.wxs
1 1 var filters = {
2   - toFix:function(val,count){
3   - val=parseFloat(val);
4   - return val.toFixed(count)
5   - },
6   - replace_time:function(val){
7   - if(!val) return "不限";
8   - return val.replace("00:00:00","");
9   - },
10   -
11   - replace_time2: function (val) {
12   - if(val==null || val==undefined || val=='') return "";
13   - var a = val.split(" ");
14   - return a[0];
15   - },
  2 + toFix: function (val, count) {
  3 + val = parseFloat(val);
  4 + return val.toFixed(count)
  5 + },
  6 + replace_time: function (val) {
  7 + if (!val) return "不限";
  8 + return val.replace("00:00:00", "");
  9 + },
16 10  
17   - format_time:function(ts,isFull) {
18   - if(ts==null || ts==undefined || ts=='') return "";
19   - var d = getDate(ts*1000)
20   - var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-');
21   - if(isFull==1)
22   - fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':')
23   - return fm;
24   - },
  11 + replace_time2: function (val) {
  12 + if (val == null || val == undefined || val == '') return "";
  13 + var a = val.split(" ");
  14 + return a[0];
  15 + },
25 16  
26   - pInt:function(t) {
27   - var d = parseInt(t); return d;
28   - },
  17 + format_time: function (ts, isFull) {
  18 + // 如果数值位数为1,则补0
  19 + function appendZero(obj) {
  20 + if (obj < 10) {
  21 + return "0" + "" + obj;
  22 + } else {
  23 + return obj;
  24 + }
  25 + };
  26 +
  27 + if (ts == null || ts == undefined || ts == '') return "";
  28 + var d = getDate(ts * 1000)
  29 + var fm = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('-');
  30 + var md = (d.getMonth() + 1) + '月' + d.getDate() + '日';
  31 + if (isFull == 1)
  32 + fm = fm + ' ' + [d.getHours(), d.getMinutes(), d.getSeconds()].join(':');
  33 + if (isFull == 2) {
  34 + fm = md + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes())].join(':');
  35 + }
  36 + return fm;
  37 + },
  38 +
  39 + pInt: function (t) {
  40 + var d = parseInt(t);
  41 + return d;
  42 + },
  43 +
  44 + show_gui_ge: function (spec, color) {
  45 + if ((spec == "" || spec == null || spec == "null")) {
  46 + if ((color == "" || color == null || color == "null")) {
  47 + return "规格1";
  48 + } else {
  49 + return color;
  50 + }
  51 + } else {
  52 + if ((color == "" || color == null || color == "null")) {
  53 + return spec;
  54 + } else {
  55 + return spec + "/" + color;
  56 + }
  57 + }
  58 + }
  59 +};
29 60  
30   - show_gui_ge:function(spec,color){
31   - if((spec=="" || spec==null || spec=="null")){
32   - if((color=="" || color==null || color=="null")){ return "规格1";
33   - }else{return color; }
34   - }else{
35   - if((color=="" || color==null || color=="null")){ return spec;
36   - }else{ return spec+"/"+color; }
37   - }
38   - },
39   -
40   -
41   -}
42 61 module.exports = {
43   - toFix: filters.toFix,
44   - replace_time:filters.replace_time,
45   - replace_time2: filters.replace_time2,
46   - format_time:filters.format_time,
47   - pInt:filters.pInt,
48   - show_gui_ge:filters.show_gui_ge,
  62 + toFix: filters.toFix,
  63 + replace_time: filters.replace_time,
  64 + replace_time2: filters.replace_time2,
  65 + format_time: filters.format_time,
  66 + pInt: filters.pInt,
  67 + show_gui_ge: filters.show_gui_ge,
49 68 }
50 69 \ No newline at end of file
... ...
utils/myUtils.wxs
... ... @@ -8,7 +8,7 @@ var myUtils = {
8 8 break;
9 9 }
10 10 case '102': {
11   - statusText = '开始';
  11 + statusText = '即将开始';
12 12 break;
13 13 }
14 14 case '103': {
... ...