liuxiaolong
2019-05-06 3e0536f508aad49f743e7bfabca34e3980a1b6e2
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import {
  getBigPic,
  getVideoByCServer
} from '../../../server/searchList/commomList.js'
export function LayerModel(json) {
  this.BigPicParam = json.BigPicParam ? json.BigPicParam : {}
  this.$layer = json.layer
  this.videoUrl = null
  /** 数据准备 */
  this.init = async function () {
    const _this = this
    let res = await getBigPic(_this.BigPicParam)
    if (res && res.success) {
      _this.BigPicUrl = res.data.img_url
      console.log(_this.BigPicUrl, '大图路径')
    }
    let res2 = await getVideoByCServer(_this.BigPicParam)
    if (res2 && res.success) {
      _this.videoUrl = res2.data.filepath
    }
  }
 
  /** 打开弹框 */
  this.openModel = function () {
    console.log(this.$layer, 'layer js')
    const _this = this
    let htmlString = `
      <div class="d-flex">
        <div
          variant="link"
          :class="['table-type-btns',tableType === 'catch'?'active':'']"
          click="tableType='catch'"
        >大图</div>
        <div class="flex-vertical-center px-3">
          <span class="text-light">|</span>
        </div>
        <div
          variant="link"
          :class="['table-type-btns',tableType === 'alarm'?'active':'']"
          click="tableType='alarm'"
        >视频</div>
      </div>
    `
    _this.$layer.open({
      title: '调试',
      type: 0,
      area: '600px',
      shade: false,
      zIndex: _this.$layer.zIndex,
      content: htmlString,
      success: function (layero) {
        _this.$layer.setTop(layero)
      }
    })
  }
}