Parcourir la Source

短视频页面隐藏标签,新设计稿页面提交

guohh 4 ans auparavant
Parent
commit
7b83587720

+ 196 - 1
2020/short-video-ui/biz/css/base.css

@ -2,6 +2,74 @@
2 2
  padding-bottom: .1rem;
3 3
}
4 4
5
.common-search {
6
  padding: .15rem;
7
  background-color: #fff;
8
}
9
10
.common-search-content {
11
  position: relative;
12
  background: #f7f7f7;
13
  border-radius: 0.18rem;
14
  overflow: hidden;
15
}
16
17
.common-search-input {
18
  display: block;
19
  width: 100%;
20
  -webkit-appearance: none;
21
  border: none;
22
  font-size: 0.12rem;
23
  line-height: 0.16rem;
24
  padding: .11rem .4rem .09rem .35rem;
25
  color: #666;
26
  background-color: transparent;
27
}
28
29
.common-search-tip {
30
  position: absolute;
31
  top: .08rem;
32
  left: .1rem;
33
  width: auto;
34
  font-size: 0.14rem;
35
  font-weight: 400;
36
  color: #B9BFC6;
37
  line-height: 0.24rem;
38
  text-align: center;
39
}
40
41
.common-search-input-clear {
42
  display: none;
43
  right: 0;
44
  top: 0;
45
  position: absolute;
46
  font-size: .15rem;
47
  width: .4rem;
48
  height: .4rem;
49
  text-align: center;
50
  color: rgba(0, 0, 0, .4);
51
  line-height: .4rem;
52
}
53
54
.common-search-icon {
55
  margin-right: .05rem;
56
  font-size: .2rem;
57
}
58
59
.common-search-value .common-search-tip-msg {
60
  display: none;
61
}
62
63
.common-search-value .common-search-tip,
64
.common-search-active .common-search-tip {
65
  left: .1rem;
66
  width: auto;
67
}
68
69
.common-search-value .common-search-input-clear {
70
  display: block;
71
}
72
5 73
.pages-video {
6 74
  font-family: PingFangSC;
7 75
  background-color: #fff;
@ -255,7 +323,7 @@
255 323
}
256 324
257 325
.video-common-list .ipu-switch input {
258
  width: .32rem;
326
  width: .3rem;
259 327
  height: .15rem;
260 328
}
261 329
@ -278,4 +346,131 @@
278 346
  font-size: .12rem;
279 347
  color: rgba(0, 0, 0, .25);
280 348
  line-height: 1;
349
}
350
351
.list-item-sy .ipu-list-item-inner {
352
  overflow: visible;
353
}
354
355
.video-sy-block {
356
  margin: .12rem -.12rem -.12rem;
357
  padding: .12rem;
358
  background-color: rgba(0, 0, 0, .04);
359
}
360
361
.video-sy-block .sy-img-title {
362
  font-size: .12rem;
363
  color: rgba(0, 0, 0, .85);
364
  line-height: 1;
365
}
366
367
.video-sy-block .sy-slt-icon {
368
  margin-top: .12rem;
369
  line-height: 1;
370
  font-size: .4rem;
371
  color: rgba(0, 0, 0, .65);
372
}
373
374
.list-nowrap-border.ipu-list > ul:before,
375
.list-nowrap-border.ipu-list > ul:after {
376
  content: none;
377
}
378
379
.video-upload-play {
380
  height: 2.13rem;
381
  background-color: #eee;
382
  margin-bottom: .08rem;
383
}
384
385
.sy-img-display .sy-img-result {
386
  display: block;
387
  width: .4rem;
388
  height: .4rem;
389
}
390
391
.video-desc-limit-num {
392
  text-align: right;
393
  font-size: .08rem;
394
  color: rgba(0, 0, 0, 0.25);
395
  line-height: 1;
396
}
397
398
.list-item-vido-desc .ipu-list-item-textarea {
399
  height: 1.12rem;
400
}
401
402
.upload-video-add-labels {
403
  overflow: auto;
404
  margin: 0.05rem -0.05rem;
405
}
406
407
.upload-video-add-labels .label-item {
408
  background: #0083D3;
409
  border-radius: .04rem;
410
  color: #fff;
411
  font-size: .12rem;
412
  line-height: .2rem;
413
  padding: 0 0 0 .08rem;
414
  float: left;
415
  margin: .05rem;
416
}
417
418
.pages-video-add-label .common-page-content {
419
  margin: 0 .12rem;
420
}
421
422
.upload-video-add-labels .label-item .close-icon {
423
  padding-left: .07rem;
424
  padding-right: .08rem;
425
}
426
427
.video-label-input {
428
  -webkit-appearance: none;
429
  display: block;
430
  width: 100%;
431
  border-radius: .09rem;
432
  background-color: #f7f7f7;
433
  color: rgba(0, 0, 0, .85);
434
  font-size: .12rem;
435
  line-height: .18rem;
436
  padding: .09rem .18rem;
437
  border: none;
438
}
439
440
.video-label-limit {
441
  margin-left: .12rem;
442
  font-size: .12rem;
443
  color: rgba(0, 0, 0, .25);
444
  line-height: .36rem;
445
}
446
447
.video-label-recomm-title {
448
  font-size: .14rem;
449
  color: rgba(0, 0, 0, .85);
450
  line-height: 1;
451
}
452
453
.video-label-recomm-labels {
454
  margin: 0 -.05rem;
455
  overflow: auto;
456
  margin-top: .13rem;
457
}
458
459
.video-label-recomm-labels .label {
460
  background: #F7F7F7;
461
  border-radius: .04rem;
462
  font-size: .12rem;
463
  color: rgba(0, 0, 0, .65);
464
  line-height: .2rem;
465
  padding: 0 .08rem;
466
  margin: .05rem;
467
  float: left;
468
}
469
470
.video-label-recomm {
471
  margin-top: .2rem;
472
}
473
474
.label-input-block {
475
  margin-top: .1rem;
281 476
}

+ 70 - 0
2020/short-video-ui/biz/js/page/video-add-label.js

@ -0,0 +1,70 @@
1
require(["ipuUI", "jquery"], function (ipuUI, $) {
2
  $.sizeReady(function () {
3
    // 扩展jquery增加一个回车的回调,不好的方便,不能取消绑定事件
4
    $.fn.enter = function (back) {
5
      $(this).on("keydown", function (e) { // 输入框是否有值
6
        if (e.which == '13') {  // 回车事件
7
          back.call(this);
8
        }
9
      });
10
      return this;
11
    };
12
13
    var labels = [];  // 已添加的标签数组
14
15
    // 输入框回车添加标签
16
    $(".video-label-input").enter(function () {
17
      var inputLabel = $.trim($(this).val());
18
      if (checkLabelSize() && inputLabel != "") {
19
        addLabel(inputLabel);
20
        $(this).val("");   // 清空输入
21
      }
22
    });
23
24
    // 删除已添加标签
25
    $(".upload-video-add-labels").on("click", ".label-item", function () {
26
      $(this).remove();
27
      labels.splice( $(this).index(), 1);   // 更新数组
28
      updateLabelSize();
29
    });
30
31
    // 添加标签
32
    function addLabel(labelStr) {
33
      if (labels.indexOf(labelStr) == -1) {
34
        labels.push(labelStr);
35
36
        // templates:es6特性, 兼容性:ios9+与android4.4+
37
        var labelHtml = `<label class="ipu-flex ipu-flex-align-center label-item">
38
                          ${labelStr} <i class="close-icon mdi mdi-close"></i>
39
                        </label>`;
40
        $(labelHtml).appendTo(".upload-video-add-labels");
41
        updateLabelSize();
42
      } else {
43
        ipuUI.toast('该标签已添加');
44
      }
45
    }
46
47
    // 更新标签数量
48
    function updateLabelSize() {
49
      $(".video-label-num").text(labels.length);
50
    }
51
52
    // 检验标签数量
53
    function checkLabelSize() {
54
      if (labels.length >= 5) {
55
        ipuUI.toast("最多只能添加5个标签");
56
        return false;
57
      } else {
58
        return true;
59
      }
60
    }
61
62
    // 点击推荐标签
63
    $(".video-label-recomm-labels").on("click", ".label", function () {
64
      if (checkLabelSize()) {
65
        addLabel($.trim($(this).text()));
66
      }
67
    });
68
69
  });
70
});

+ 57 - 0
2020/short-video-ui/video-add-label.html

@ -0,0 +1,57 @@
1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <title>视频-添加标签</title>
5
  <meta charset="utf-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
7
8
  <link rel="stylesheet" type="text/css" href="ipu/ui/css/ipuUI.css">
9
  <link rel="stylesheet" type="text/css" href="ipu/lib/mdi/css/mdi.css">
10
  <link rel="stylesheet" type="text/css" href="biz/css/base.css">
11
12
  <script src="ipu/lib/requirejs/require.js"></script>
13
  <script src="biz/js/require-config.js"></script>
14
  <script src="biz/js/page/video-add-label.js"></script>
15
</head>
16
<body class="pages-video pages-video-add-label">
17
<div class="ipu-flex-row ipu-flex-vertical">
18
19
  <div class="ipu-flex-col">
20
    <header class="ipu-toolbar">
21
      <a class="ipu-fn-left page-back" href="javascript:history.back();">
22
        <i class="ipu-icon mdi mdi-chevron-left"></i>
23
      </a>
24
      <div class="ipu-fn-right">
25
        完成
26
      </div>
27
      <h1 class="ipu-toolbar-title">添加标签</h1>
28
    </header>
29
  </div>
30
  <div class="ipu-flex-col ipu-flex-col-auto">
31
    <div class="common-page-content">
32
      <div class="upload-video-add-labels">
33
      </div>
34
      <div class="ipu-flex label-input-block">
35
        <div class="ipu-flex-grow-1 video-label-input-wrap">
36
          <input type="text" class="video-label-input" placeholder="请输入标签名称">
37
        </div>
38
        <div class="ipu-flex-grow-0 video-label-limit">
39
          <span class="video-label-num">0</span>/5
40
        </div>
41
      </div>
42
      <div class="video-label-recomm">
43
        <div class="video-label-recomm-title">推荐标签</div>
44
        <div class="video-label-recomm-labels ">
45
          <label  class="label">标签内容</label>
46
          <label class="label">标签内容</label>
47
          <label class="label">标签内容</label>
48
          <label class="label">标签内容</label>
49
          <label class="label">标签内容</label>
50
        </div>
51
      </div>
52
    </div>
53
  </div>
54
55
</div>
56
</body>
57
</html>

+ 64 - 110
2020/short-video-ui/video-add.html

@ -30,127 +30,81 @@
30 30
    </header>
31 31
  </div>
32 32
  <div class="ipu-flex-col ipu-flex-col-auto">
33
    <div class="ipu-list ipu-list-form video-common-list">
34
      <ul>
35
        <li class="ipu-list-item">
36
          <div class="ipu-list-item-inner">
37
            <div class="ipu-list-item-label">
38
              视频名称
39
            </div>
40
            <div class="ipu-list-item-input-wrap">
41
              <input class="ipu-list-item-input" type="text" placeholder="请填写名称">
42
            </div>
43
          </div>
44
        </li>
45
        <li class="ipu-list-item">
46
          <div class="ipu-list-item-inner">
47
            <div class="ipu-list-item-label">
48
              视频简介
49
            </div>
50
            <div class="ipu-list-item-input-wrap">
51
              <textarea class="ipu-list-item-textarea" rows="6" placeholder="请填写简介"></textarea>
52
            </div>
53
          </div>
54
        </li>
55
        <li class="ipu-list-item">
56
          <div class="ipu-list-item-inner">
57
            <div class="ipu-list-item-label">
58
              是否公开
33
    <div class="common-page-content">
34
      <div class="video-upload-play">
35
        视频区域
36
      </div>
37
      <div class="ipu-list ipu-list-form video-common-list list-nowrap-border">
38
        <ul>
39
          <li class="ipu-list-item">
40
            <div class="ipu-list-item-inner">
41
              <div class="ipu-list-item-label">
42
                视频名称
43
              </div>
44
              <div class="ipu-list-item-input-wrap">
45
                <input class="ipu-list-item-input" type="text" placeholder="请填写名称">
46
              </div>
59 47
            </div>
60
            <div class="ipu-list-item-input-wrap ipu-flex ipu-flex-justify-end">
61
              <label class="ipu-switch">
62
                <input class="ipu-switch-input" type="checkbox">
63
              </label>
48
          </li>
49
          <li class="ipu-list-item list-item-vido-desc">
50
            <div class="ipu-list-item-inner">
51
              <div class="ipu-list-item-label">
52
                视频简介
53
              </div>
54
              <div class="ipu-list-item-input-wrap">
55
                <textarea class="ipu-list-item-textarea" rows="6" placeholder="请填写简介"></textarea>
56
                <div class="video-desc-limit-num">
57
                  <sapn class="video-desc-num">0</sapn>
58
                  /250
59
                </div>
60
              </div>
64 61
            </div>
65
          </div>
66
        </li>
67
        <li class="ipu-list-item">
68
          <div class="">
62
          </li>
63
          <li class="ipu-list-item">
69 64
            <div class="ipu-list-item-inner">
70 65
              <div class="ipu-list-item-label">
71
                添加水印
66
                是否公开
72 67
              </div>
73
              <div class="ipu-list-item-input-wrap ipu-flex ipu-flex-justify-space">
74
                <div class="sy-switch-note">水印将展示在视频右上角</div>
68
              <div class="ipu-list-item-input-wrap ipu-flex ipu-flex-justify-end">
75 69
                <label class="ipu-switch">
76 70
                  <input class="ipu-switch-input" type="checkbox">
77 71
                </label>
78 72
              </div>
79 73
            </div>
80
            <div class="">
81
              新的内容
82
            </div>
83
          </div>
84
        </li>
85
        <li class="ipu-list-item">
86
          <div class="ipu-list-item-inner">
87
            <div class="ipu-list-item-label">
88
              水印图片:
89
            </div>
90
            <div class="ipu-list-item-input-wrap">
91
              <input class="ipu-list-item-input" type="text" placeholder="请选择" readonly>
92
            </div>
93
          </div>
94
        </li>
95
        <li class="ipu-list-item">
96
          <div class="ipu-list-item-inner">
97
            <div class="ipu-list-item-label">
98
            </div>
99
            <div class="ipu-list-item-input-wrap">
100
              <img class="form-input-img" src="temp/01.jpg" alt=""/>
101
            </div>
102
          </div>
103
        </li>
104
        <li class="ipu-list-item">
105
          <div class="ipu-list-item-inner">
106
            <div class="ipu-list-item-label">
107
              水印位置:
108
            </div>
109
            <div class="ipu-list-item-input-wrap">
110
              <input class="ipu-list-item-input" type="text" placeholder="请选择" readonly>
111
            </div>
112
          </div>
113
        </li>
114
        <li class="ipu-list-item">
115
          <div class="ipu-list-item-inner">
116
            <div class="ipu-list-item-label">
117
              <span class="form-label-required">*</span>
118
              视频名称:
119
            </div>
120
            <div class="ipu-list-item-input-wrap">
121
              <input class="ipu-list-item-input" type="text" placeholder="请输入">
122
            </div>
123
          </div>
124
        </li>
125
        <li class="ipu-list-item">
126
          <div class="ipu-list-item-inner">
127
            <div class="ipu-list-item-label">
128
              <span class="form-label-required">*</span>
129
              是否公开:
130
            </div>
131
            <div class="ipu-list-item-input-wrap">
132
              <label class="ipu-switch">
133
                <input class="ipu-switch-input" type="checkbox">
134
              </label>
135
            </div>
136
          </div>
137
        </li>
138
        <li class="ipu-list-item">
139
          <div class="ipu-list-item-inner">
140
            <div class="ipu-list-item-label">
141
              标签(空格分隔):
142
            </div>
143
            <div class="ipu-list-item-input-wrap">
144
              <textarea class="ipu-list-item-textarea" placeholder="请输入">游戏 魔兽世界 ICC 魔兽 剑圣</textarea>
74
          </li>
75
          <li class="ipu-list-item list-item-sy">
76
            <div class="ipu-list-item-inner ipu-flex-vertical">
77
              <div class="ipu-flex">
78
                <div class="ipu-list-item-label">
79
                  添加水印
80
                </div>
81
                <div class="ipu-list-item-input-wrap ipu-flex ipu-flex-justify-space">
82
                  <div class="sy-switch-note">水印将展示在视频右上角</div>
83
                  <label class="ipu-switch">
84
                    <input class="ipu-switch-input" type="checkbox">
85
                  </label>
86
                </div>
87
              </div>
88
              <div class="ipu-flex ipu-flex-vertical video-sy-block">
89
                <div class="sy-img-title">水印图片</div>
90
                <div class="sy-img-display">
91
                  <i class="mdi mdi-image-plus sy-slt-icon"></i>
92
                  <img src="temp/01.jpg" alt="" class="sy-img-result">
93
                </div>
94
              </div>
145 95
            </div>
146
          </div>
147
         </li>
148
      </ul>
149
    </div>
150
  </div>
151
  <div class="ipu-flex-col">
152
    <div class="ipu-fn-m">
153
      <button class="ipu-btn ipu-btn-l ipu-btn-block">发布</button>
96
          </li>
97
           <li>
98
            <a href="" class="ipu-list-item ipu-list-item-link list-item-label">
99
              <div class="ipu-list-item-inner">
100
                <div class="ipu-list-item-label">
101
                  标签
102
                </div>
103
              </div>
104
            </a>
105
          </li>
106
        </ul>
107
      </div>
154 108
    </div>
155 109
  </div>
156 110

+ 3 - 3
2020/short-video-ui/video-search.html

@ -13,7 +13,7 @@
13 13
  <script src="biz/js/require-config.js"></script>
14 14
  <script src="biz/js/page/video-search.js"></script>
15 15
</head>
16
<body class="pages-video-search">
16
<body class="pages-video pages-video-search">
17 17
<div class="ipu-flex-row ipu-flex-vertical">
18 18
19 19
  <div class="ipu-flex-col">
@ -30,11 +30,11 @@
30 30
      <div class="ipu-flex common-search-content">
31 31
        <div class="ipu-flex-center-middle  common-search-tip">
32 32
          <i class="common-search-icon mdi mdi-magnify"></i>
33
          <span class="common-search-tip-msg">搜索</span>
33
          <!--<span class="common-search-tip-msg">搜索</span>-->
34 34
        </div>
35 35
36 36
        <div class="ipu-flex-grow-1 common-search-wrap">
37
          <input class="common-search-input" placeholder="">
37
          <input class="common-search-input" placeholder="请输入搜索内容">
38 38
        </div>
39 39
        <i class="ipu-flex-grow-0 common-search-input-clear mdi mdi-close-circle"></i>
40 40
      </div>

+ 8 - 2
2020/short-video/biz/css/base.css

@ -13,6 +13,7 @@
13 13
  width: 50%;
14 14
  float: left;
15 15
}
16
16 17
li.swipe-actions-wrapper {
17 18
  width: auto;
18 19
}
@ -119,7 +120,7 @@ li.swipe-actions-wrapper {
119 120
.video-list .ipu-list-item-media img {
120 121
  position: relative;
121 122
  display: block;
122
  width: 1.2rem;
123
  width: 1.4rem;
123 124
  height: .8rem;
124 125
}
125 126
@ -137,6 +138,7 @@ li.swipe-actions-wrapper {
137 138
.video-list .ipu-list-item-text {
138 139
  font-size: .1rem;
139 140
  color: #999;
141
  margin-top: .03rem;
140 142
}
141 143
142 144
.video-list .ipu-list-item-text .label {
@ -147,7 +149,7 @@ li.swipe-actions-wrapper {
147 149
}
148 150
149 151
.video-list .item-content-inner {
150
  padding: .02rem 0 .03rem;
152
  padding: .05rem 0 .03rem;
151 153
}
152 154
153 155
.video-list .ipu-list-item-text .label + .label {
@ -229,4 +231,8 @@ li.swipe-actions-wrapper {
229 231
  line-height: 1.1;
230 232
  color: #a3a4aa;
231 233
  margin-top: 0.2rem;
234
}
235
236
.video-list .ipu-list-item-inner > .ipu-list-item-text {
237
  display: none;
232 238
}