myUtils.wxs
771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var myUtils = {
  // 判断直播状态
  liveStatus: function (statusCode) {
    var statusText;
    switch(statusCode) {
      case '101': {
        statusText = '直播中';
        break;
      }
      case '102': {
        statusText = '即将开始';
        break;
      }
      case '103': {
        statusText = '已结束';
        break;
      }
      case '104': {
        statusText = '禁播';
        break;
      }
      case '105': {
        statusText = '暂停中';
        break;
      }
      case '106': {
        statusText = '异常';
        break;
      }
      case '107': {
        statusText = '已过期';
        break;
      }
      default: break;
    }
    return statusText;
  }
};
module.exports = {
  liveStatus: myUtils.liveStatus
}