# 系统弹窗

系统模态弹窗,在浮层中间显示,引导用户进行相关操作。

使用规则

居中弹窗默认基于iOS系统弹窗规范设计执行,宽度原则上按规范保持270pt,高度可自适应。

# 示例:

<template>
  <scroller class="wrapper">
    <dof-minibar title="拖拽组件" @dofMinibarLeftButtonClicked="back"></dof-minibar>
    <midea-drag-list-view ref="dragListView" class="drag" :data="data"> </midea-drag-list-view>
    <text class="btn" @click="getDataList">获取数据</text>
  </scroller>
</template>

<script>
var modal = weex.requireModule('modal')
export default {
  data() {
    return {
      data: {
        itemViewHeight: 100, // 行高
        itemViewMarginTop: 10, //行间距
        imageMarginTop: 10, //图片距离顶部的的距离
        textMarginTop: 10, // 文字与图片的距离
        textColor: 'blue', //文字颜色
        textSize: 16, //文字大小
        imageSize: 60, //图片大小
        spanCount: 4, //列数
        isEditable: false, //控制整个列表是否可编辑,默认是false, 为true时才显示编辑按钮
        editIcon: 'https://alifei02.cfp.cn/creative/icon/512/VCG25i3639131.jpg', //编辑按钮图标地址
        listData: [
          {
            id: '1', //item的标识
            imageSrc: 'https://alifei02.cfp.cn/creative/icon/512/VCG25i3639131.jpg', //图标url
            label: 'test1', //文本描述
            isEditable: true //控制是否显示该编辑按钮,默认为false, 为true则显示
          },
          {
            id: '2',
            imageSrc: 'https://alifei03.cfp.cn/creative/icon/512/VCG25i3639132.jpg',
            label: 'test2'
          },
          {
            id: '3',
            imageSrc: 'https://alifei04.cfp.cn/creative/icon/512/VCG25i3639133.jpg',
            label: 'test3',
            isEditable: true //控制是否显示该编辑按钮,默认为false, 为true则显示
          },
          {
            id: '4',
            imageSrc: 'https://alifei05.cfp.cn/creative/icon/512/VCG25i3639134.jpg',
            label: 'test4',
            isEditable: true //
          },
          {
            id: '5',
            imageSrc: 'https://tenfei01.cfp.cn/creative/icon/512/VCG25i3639135.jpg',
            label: 'test5',
            isEditable: true
          }
        ]
      }
    }
  },

  methods: {
    getDataList(event) {
      let that = this
      this.$refs.dragListView.getListData(function(data) {
        that.data = {
          listData: [
            {
              id: '1',
              imageSrc: 'https://alifei02.cfp.cn/creative/icon/512/VCG25i3639131.jpg',
              label: 'test1qerqerqwerqwrwerqwerqwrwrqwrwrqwerwr'
            },
            {
              id: '2',
              imageSrc: 'https://alifei03.cfp.cn/creative/icon/512/VCG25i3639132.jpg',
              label: 'test2'
            },
            {
              id: '3',
              imageSrc: 'https://alifei04.cfp.cn/creative/icon/512/VCG25i3639133.jpg',
              label: 'test3'
            },
            {
              id: '4',
              imageSrc: 'https://alifei05.cfp.cn/creative/icon/512/VCG25i3639134.jpg',
              label: 'test4'
            },
            {
              id: '5',
              imageSrc: 'https://tenfei01.cfp.cn/creative/icon/512/VCG25i3639135.jpg',
              label: 'test5'
            },
            {
              id: '6',
              isEditable: true,
              imageSrc: 'https://tenfei02.cfp.cn/creative/icon/512/VCG25i3639136.jpg',
              label: 'test6'
            },
            {
              id: '7',
              isEditable: true,
              imageSrc: 'https://tenfei03.cfp.cn/creative/icon/512/VCG25i3639137.jpg',
              label: 'test7'
            },
            {
              id: '8',
              imageSrc: 'https://tenfei04.cfp.cn/creative/icon/512/VCG25i3639138.jpg',
              label: 'test8'
            },
            {
              id: '9',
              isEditable: true,
              imageSrc: 'https://tenfei05.cfp.cn/creative/icon/512/VCG25i3639139.jpg',
              label: 'test9'
            },
            {
              id: '10',
              imageSrc: 'https://alifei01.cfp.cn/creative/icon/512/VCG25i3639140.jpg',
              label: 'test10'
            },
            {
              id: '11',
              isEditable: true,
              imageSrc: 'https://alifei02.cfp.cn/creative/icon/512/VCG25i3639141.jpg',
              label: 'test11'
            },
            {
              id: '1',
              imageSrc: 'https://alifei02.cfp.cn/creative/icon/512/VCG25i3639131.jpg',
              label: 'test1qerqerqwerqwrwerqwerqwrwrqwrwrqwerwr'
            },
            {
              id: '2',
              imageSrc: 'https://alifei03.cfp.cn/creative/icon/512/VCG25i3639132.jpg',
              label: 'test2'
            },
            {
              id: '3',
              imageSrc: 'https://alifei04.cfp.cn/creative/icon/512/VCG25i3639133.jpg',
              label: 'test3'
            },
            {
              id: '4',
              imageSrc: 'https://alifei05.cfp.cn/creative/icon/512/VCG25i3639134.jpg',
              label: 'test4'
            },
            {
              id: '5',
              imageSrc: 'https://tenfei01.cfp.cn/creative/icon/512/VCG25i3639135.jpg',
              label: 'test5'
            },
            {
              id: '6',
              isEditable: true,
              imageSrc: 'https://tenfei02.cfp.cn/creative/icon/512/VCG25i3639136.jpg',
              label: 'test6'
            },
            {
              id: '7',
              isEditable: true,
              imageSrc: 'https://tenfei03.cfp.cn/creative/icon/512/VCG25i3639137.jpg',
              label: 'test7'
            },
            {
              id: '8',
              imageSrc: 'https://tenfei04.cfp.cn/creative/icon/512/VCG25i3639138.jpg',
              label: 'test8'
            },
            {
              id: '9',
              isEditable: true,
              imageSrc: 'https://tenfei05.cfp.cn/creative/icon/512/VCG25i3639139.jpg',
              label: 'test9'
            },
            {
              id: '10',
              imageSrc: 'https://alifei01.cfp.cn/creative/icon/512/VCG25i3639140.jpg',
              label: 'test10'
            },
            {
              id: '11',
              isEditable: true,
              imageSrc: 'https://alifei02.cfp.cn/creative/icon/512/VCG25i3639141.jpg',
              label: 'test11'
            }
          ],
          itemViewHeight: 100, // 行高
          itemViewMarginTop: 10, //行间距
          imageMarginTop: 10, //图片距离顶部的的距离
          textMarginTop: 10, // 文字与图片的距离
          textColor: 'blue', //文字颜色
          textSize: 16, //文字大小
          imageSize: 40, //图片大小
          spanCount: 4, //列数
          isEditable: true, //控制整个列表是否可编辑,默认是false, 为true时才显示编辑按钮
          editIcon: 'https://alifei02.cfp.cn/creative/icon/512/VCG25i3639131.jpg'
        }

        modal.alert({
          message: data,
          okTitle: '确认'
        })
      })
    },
    slideChange(event) {}
  }
}
</script>

<style scoped>
.wrapper {
  width: 750px;
}
.drag {
  background-color: lightblue;
  width: 730px;
  height: 480px;
  margin-left: 10px;
  margin-right: 10px;
  margin-top: 200px;
}
.btn {
  width: 200px;
  height: 80px;
  top: 100px;
  margin-left: 100px;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-top: 30px;
  margin-left: 150px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-width: 2px;
  border-style: solid;
  color: #666666;
  border-color: #dddddd;
  background-color: #f5f5f5;
}

.btn2 {
  width: 200px;
  height: 80px;
  top: 400px;
  margin-left: 100px;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-top: 30px;
  margin-left: 150px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-width: 2px;
  border-style: solid;
  color: #666666;
  border-color: #dddddd;
  background-color: #f5f5f5;
}
</style>

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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258

# 属性(data)

Prop Type Required Default Description
itemViewHeight Number N -1 行高
itemViewMarginTop Number N 10 行间距
imageMarginTop Number N 10 图片距离顶部的的距离
textMarginTop Number N 12 文字与图片的距离
textColor String N #000000 文字颜色
textSize Number N 12 文字大小
imageSize Number N 60 图片大小
spanCount Number N 4 列数
isEditAble Boolean N false 控制整个列表是否可编辑,为true时才显示编辑按钮
editIcon String N '' 编辑按钮图标地址
listData Array N [] 列表项(见注1)
系统弹窗
扫码预览
Last Updated: 1/26/2024, 6:36:02 PM