jufubao-forms 1.0.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +27 -0
  2. package/commands.js +84 -0
  3. package/commands.update.change.js +176 -0
  4. package/file.config.js +16 -0
  5. package/get.package.path.js +22 -0
  6. package/get.package.path.js.tpl +22 -0
  7. package/package.json +119 -0
  8. package/src/CreateClientID.js +16 -0
  9. package/src/ICONS.js +1148 -0
  10. package/src/common/authorize.js +261 -0
  11. package/src/common/getBusinessImageUrl.js +39 -0
  12. package/src/common/getServiceUrl.js +38 -0
  13. package/src/common/paysdk/jweixin.js +98 -0
  14. package/src/components/CusCouponChose/CusCouponChose.vue +1024 -0
  15. package/src/components/CusCouponItem/CusCouponItem.vue +298 -0
  16. package/src/components/CusEnter/CusEnter.vue +333 -0
  17. package/src/components/CusPoster/CusPoster.vue +213 -0
  18. package/src/components/CusPoster/CusSwiperDot.vue +234 -0
  19. package/src/components/CusProduct/CusProduct.vue +362 -0
  20. package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
  21. package/src/components/CusTab/CusTab.vue +411 -0
  22. package/src/components/CusVideo/CusVideo.vue +170 -0
  23. package/src/components/JfbFormsDynamicForm/Api.js +66 -0
  24. package/src/components/JfbFormsDynamicForm/Attr.js +35 -0
  25. package/src/components/JfbFormsDynamicForm/JfbFormsDynamicForm.vue +767 -0
  26. package/src/components/JfbFormsDynamicForm/JfbFormsDynamicFormLess.less +79 -0
  27. package/src/components/JfbFormsDynamicForm/JfbFormsDynamicFormMixin.js +30 -0
  28. package/src/components/JfbFormsDynamicForm/Mock.js +194 -0
  29. package/src/components/JfbFormsDynamicForm/XdFormDate.vue +71 -0
  30. package/src/components/JfbFormsDynamicForm/ld-select/ld-select.vue +329 -0
  31. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/calendar-item.vue +177 -0
  32. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/calendar.vue +930 -0
  33. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/en.json +22 -0
  34. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/index.js +8 -0
  35. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/zh-Hans.json +22 -0
  36. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/zh-Hant.json +22 -0
  37. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/time-picker.vue +934 -0
  38. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/uni-datetime-picker.vue +1042 -0
  39. package/src/components/JfbFormsDynamicForm/uni-datetime-picker/util.js +403 -0
  40. package/src/components/JfbFormsList/Api.js +20 -0
  41. package/src/components/JfbFormsList/Attr.js +70 -0
  42. package/src/components/JfbFormsList/JfbFormsList.vue +228 -0
  43. package/src/components/JfbFormsList/JfbFormsListLess.less +79 -0
  44. package/src/components/JfbFormsList/JfbFormsListMixin.js +30 -0
  45. package/src/components/JfbFormsList/Mock.js +38 -0
  46. package/src/components/JfbFormsQuestionAndAnswer/Api.js +43 -0
  47. package/src/components/JfbFormsQuestionAndAnswer/Attr.js +14 -0
  48. package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswer.vue +506 -0
  49. package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswerLess.less +79 -0
  50. package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswerMixin.js +30 -0
  51. package/src/components/JfbFormsQuestionAndAnswer/Mock.js +144 -0
  52. package/src/components/SkeProduct/SkeProduct.vue +241 -0
  53. package/src/config.app.plus.js +6 -0
  54. package/src/config.h5.js +13 -0
  55. package/src/config.mp.weixin.js +13 -0
  56. package/src/config.project.js +15 -0
  57. package/src/mixins/cardListMixins.js +187 -0
  58. package/src/mixins/colorCardMixins.js +122 -0
  59. package/src/mixins/componentsMixins.js +900 -0
  60. package/src/mixins/extsMixins.js +3 -0
  61. package/src/mixins/locationMixins.js +119 -0
  62. package/src/mixins/newLocaltionMixins.js +754 -0
  63. package/src/mixins/openDebuggerMixins.js +74 -0
  64. package/src/mixins/pageEditx.js +347 -0
  65. package/src/mixins/pageEvent.js +311 -0
  66. package/src/mixins/pageMain.js +120 -0
  67. package/src/mixins/pageUitls.js +738 -0
  68. package/src/mixins/posterMixins.js +122 -0
  69. package/src/mixins/scrollListFixedHeigthMixins.js +174 -0
  70. package/src/mocks.js +4 -0
@@ -0,0 +1,403 @@
1
+ class Calendar {
2
+ constructor({
3
+ selected,
4
+ startDate,
5
+ endDate,
6
+ range,
7
+ } = {}) {
8
+ // 当前日期
9
+ this.date = this.getDateObj(new Date()) // 当前初入日期
10
+ // 打点信息
11
+ this.selected = selected || [];
12
+ // 起始时间
13
+ this.startDate = startDate
14
+ // 终止时间
15
+ this.endDate = endDate
16
+ // 是否范围选择
17
+ this.range = range
18
+ // 多选状态
19
+ this.cleanMultipleStatus()
20
+ // 每周日期
21
+ this.weeks = {}
22
+ this.lastHover = false
23
+ }
24
+ /**
25
+ * 设置日期
26
+ * @param {Object} date
27
+ */
28
+ setDate(date) {
29
+ const selectDate = this.getDateObj(date)
30
+ this.getWeeks(selectDate.fullDate)
31
+ }
32
+
33
+ /**
34
+ * 清理多选状态
35
+ */
36
+ cleanMultipleStatus() {
37
+ this.multipleStatus = {
38
+ before: '',
39
+ after: '',
40
+ data: []
41
+ }
42
+ }
43
+
44
+ setStartDate(startDate) {
45
+ this.startDate = startDate
46
+ }
47
+
48
+ setEndDate(endDate) {
49
+ this.endDate = endDate
50
+ }
51
+
52
+ getPreMonthObj(date){
53
+ date = fixIosDateFormat(date)
54
+ date = new Date(date)
55
+
56
+ const oldMonth = date.getMonth()
57
+ date.setMonth(oldMonth - 1)
58
+ const newMonth = date.getMonth()
59
+ if(oldMonth !== 0 && newMonth - oldMonth === 0){
60
+ date.setMonth(newMonth - 1)
61
+ }
62
+ return this.getDateObj(date)
63
+ }
64
+ getNextMonthObj(date){
65
+ date = fixIosDateFormat(date)
66
+ date = new Date(date)
67
+
68
+ const oldMonth = date.getMonth()
69
+ date.setMonth(oldMonth + 1)
70
+ const newMonth = date.getMonth()
71
+ if(newMonth - oldMonth > 1){
72
+ date.setMonth(newMonth - 1)
73
+ }
74
+ return this.getDateObj(date)
75
+ }
76
+
77
+ /**
78
+ * 获取指定格式Date对象
79
+ */
80
+ getDateObj(date) {
81
+ date = fixIosDateFormat(date)
82
+ date = new Date(date)
83
+
84
+ return {
85
+ fullDate: getDate(date),
86
+ year: date.getFullYear(),
87
+ month: addZero(date.getMonth() + 1),
88
+ date: addZero(date.getDate()),
89
+ day: date.getDay()
90
+ }
91
+ }
92
+
93
+ /**
94
+ * 获取上一个月日期集合
95
+ */
96
+ getPreMonthDays(amount, dateObj) {
97
+ const result = []
98
+ for (let i = amount - 1; i >= 0; i--) {
99
+ const month = dateObj.month - 1
100
+ result.push({
101
+ date: new Date(dateObj.year, month, -i).getDate(),
102
+ month,
103
+ disable: true
104
+ })
105
+ }
106
+ return result
107
+ }
108
+ /**
109
+ * 获取本月日期集合
110
+ */
111
+ getCurrentMonthDays(amount, dateObj) {
112
+ const result = []
113
+ const fullDate = this.date.fullDate
114
+ for (let i = 1; i <= amount; i++) {
115
+ const currentDate = `${dateObj.year}-${dateObj.month}-${addZero(i)}`
116
+ const isToday = fullDate === currentDate
117
+ // 获取打点信息
118
+ const info = this.selected && this.selected.find((item) => {
119
+ if (this.dateEqual(currentDate, item.date)) {
120
+ return item
121
+ }
122
+ })
123
+
124
+ // 日期禁用
125
+ let disableBefore = true
126
+ let disableAfter = true
127
+ if (this.startDate) {
128
+ disableBefore = dateCompare(this.startDate, currentDate)
129
+ }
130
+
131
+ if (this.endDate) {
132
+ disableAfter = dateCompare(currentDate, this.endDate)
133
+ }
134
+
135
+ let multiples = this.multipleStatus.data
136
+ let multiplesStatus = -1
137
+ if (this.range && multiples) {
138
+ multiplesStatus = multiples.findIndex((item) => {
139
+ return this.dateEqual(item, currentDate)
140
+ })
141
+ }
142
+ const checked = multiplesStatus !== -1
143
+
144
+ result.push({
145
+ fullDate: currentDate,
146
+ year: dateObj.year,
147
+ date: i,
148
+ multiple: this.range ? checked : false,
149
+ beforeMultiple: this.isLogicBefore(currentDate, this.multipleStatus.before, this.multipleStatus.after),
150
+ afterMultiple: this.isLogicAfter(currentDate, this.multipleStatus.before, this.multipleStatus.after),
151
+ month: dateObj.month,
152
+ disable: (this.startDate && !dateCompare(this.startDate, currentDate)) || (this.endDate && !dateCompare(currentDate,this.endDate)),
153
+ isToday,
154
+ userChecked: false,
155
+ extraInfo: info
156
+ })
157
+ }
158
+ return result
159
+ }
160
+ /**
161
+ * 获取下一个月日期集合
162
+ */
163
+ _getNextMonthDays(amount, dateObj) {
164
+ const result = []
165
+ const month = dateObj.month + 1
166
+ for (let i = 1; i <= amount; i++) {
167
+ result.push({
168
+ date: i,
169
+ month,
170
+ disable: true
171
+ })
172
+ }
173
+ return result
174
+ }
175
+
176
+ /**
177
+ * 获取当前日期详情
178
+ * @param {Object} date
179
+ */
180
+ getInfo(date) {
181
+ if (!date) {
182
+ date = new Date()
183
+ }
184
+
185
+ return this.calendar.find(item => item.fullDate === this.getDateObj(date).fullDate)
186
+ }
187
+
188
+ /**
189
+ * 比较时间是否相等
190
+ */
191
+ dateEqual(before, after) {
192
+ before = new Date(fixIosDateFormat(before))
193
+ after = new Date(fixIosDateFormat(after))
194
+ return before.valueOf() === after.valueOf()
195
+ }
196
+
197
+ /**
198
+ * 比较真实起始日期
199
+ */
200
+
201
+ isLogicBefore(currentDate, before, after) {
202
+ let logicBefore = before
203
+ if (before && after) {
204
+ logicBefore = dateCompare(before, after) ? before : after
205
+ }
206
+ return this.dateEqual(logicBefore, currentDate)
207
+ }
208
+
209
+ isLogicAfter(currentDate, before, after) {
210
+ let logicAfter = after
211
+ if (before && after) {
212
+ logicAfter = dateCompare(before, after) ? after : before
213
+ }
214
+ return this.dateEqual(logicAfter, currentDate)
215
+ }
216
+
217
+ /**
218
+ * 获取日期范围内所有日期
219
+ * @param {Object} begin
220
+ * @param {Object} end
221
+ */
222
+ geDateAll(begin, end) {
223
+ var arr = []
224
+ var ab = begin.split('-')
225
+ var ae = end.split('-')
226
+ var db = new Date()
227
+ db.setFullYear(ab[0], ab[1] - 1, ab[2])
228
+ var de = new Date()
229
+ de.setFullYear(ae[0], ae[1] - 1, ae[2])
230
+ var unixDb = db.getTime() - 24 * 60 * 60 * 1000
231
+ var unixDe = de.getTime() - 24 * 60 * 60 * 1000
232
+ for (var k = unixDb; k <= unixDe;) {
233
+ k = k + 24 * 60 * 60 * 1000
234
+ arr.push(this.getDateObj(new Date(parseInt(k))).fullDate)
235
+ }
236
+ return arr
237
+ }
238
+
239
+ /**
240
+ * 获取多选状态
241
+ */
242
+ setMultiple(fullDate) {
243
+ if (!this.range) return
244
+
245
+ let {
246
+ before,
247
+ after
248
+ } = this.multipleStatus
249
+ if (before && after) {
250
+ if (!this.lastHover) {
251
+ this.lastHover = true
252
+ return
253
+ }
254
+ this.multipleStatus.before = fullDate
255
+ this.multipleStatus.after = ''
256
+ this.multipleStatus.data = []
257
+ this.multipleStatus.fulldate = ''
258
+ this.lastHover = false
259
+ } else {
260
+ if (!before) {
261
+ this.multipleStatus.before = fullDate
262
+ this.lastHover = false
263
+ } else {
264
+ this.multipleStatus.after = fullDate
265
+ if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
266
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus
267
+ .after);
268
+ } else {
269
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus
270
+ .before);
271
+ }
272
+ this.lastHover = true
273
+ }
274
+ }
275
+ this.getWeeks(fullDate)
276
+ }
277
+
278
+ /**
279
+ * 鼠标 hover 更新多选状态
280
+ */
281
+ setHoverMultiple(fullDate) {
282
+ if (!this.range || this.lastHover) return
283
+
284
+ const { before } = this.multipleStatus
285
+
286
+ if (!before) {
287
+ this.multipleStatus.before = fullDate
288
+ } else {
289
+ this.multipleStatus.after = fullDate
290
+ if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
291
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
292
+ } else {
293
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
294
+ }
295
+ }
296
+ this.getWeeks(fullDate)
297
+ }
298
+
299
+ /**
300
+ * 更新默认值多选状态
301
+ */
302
+ setDefaultMultiple(before, after) {
303
+ this.multipleStatus.before = before
304
+ this.multipleStatus.after = after
305
+ if (before && after) {
306
+ if (dateCompare(before, after)) {
307
+ this.multipleStatus.data = this.geDateAll(before, after);
308
+ this.getWeeks(after)
309
+ } else {
310
+ this.multipleStatus.data = this.geDateAll(after, before);
311
+ this.getWeeks(before)
312
+ }
313
+ }
314
+ }
315
+
316
+ /**
317
+ * 获取每周数据
318
+ * @param {Object} dateData
319
+ */
320
+ getWeeks(dateData) {
321
+ const {
322
+ year,
323
+ month,
324
+ } = this.getDateObj(dateData)
325
+
326
+ const preMonthDayAmount = new Date(year, month - 1, 1).getDay()
327
+ const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData))
328
+
329
+ const currentMonthDayAmount = new Date(year, month, 0).getDate()
330
+ const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData))
331
+
332
+ const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount
333
+ const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData))
334
+
335
+ const calendarDays = [...preMonthDays, ...currentMonthDays, ...nextMonthDays]
336
+
337
+ const weeks = new Array(6)
338
+ for (let i = 0; i < calendarDays.length; i++) {
339
+ const index = Math.floor(i / 7)
340
+ if(!weeks[index]){
341
+ weeks[index] = new Array(7)
342
+ }
343
+ weeks[index][i % 7] = calendarDays[i]
344
+ }
345
+
346
+ this.calendar = calendarDays
347
+ this.weeks = weeks
348
+ }
349
+ }
350
+
351
+ function getDateTime(date, hideSecond){
352
+ return `${getDate(date)} ${getTime(date, hideSecond)}`
353
+ }
354
+
355
+ function getDate(date) {
356
+ date = fixIosDateFormat(date)
357
+ date = new Date(date)
358
+ const year = date.getFullYear()
359
+ const month = date.getMonth()+1
360
+ const day = date.getDate()
361
+ return `${year}-${addZero(month)}-${addZero(day)}`
362
+ }
363
+
364
+ function getTime(date, hideSecond){
365
+ date = fixIosDateFormat(date)
366
+ date = new Date(date)
367
+ const hour = date.getHours()
368
+ const minute = date.getMinutes()
369
+ const second = date.getSeconds()
370
+ return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}`
371
+ }
372
+
373
+ function addZero(num) {
374
+ if(num < 10){
375
+ num = `0${num}`
376
+ }
377
+ return num
378
+ }
379
+
380
+ function getDefaultSecond(hideSecond) {
381
+ return hideSecond ? '00:00' : '00:00:00'
382
+ }
383
+
384
+ function dateCompare(startDate, endDate) {
385
+ startDate = new Date(fixIosDateFormat(startDate))
386
+ endDate = new Date(fixIosDateFormat(endDate))
387
+ return startDate <= endDate
388
+ }
389
+
390
+ function checkDate(date){
391
+ const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g
392
+ return date.match(dateReg)
393
+ }
394
+
395
+ const dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9]:[0-5]?[0-9])?$/
396
+ function fixIosDateFormat(value) {
397
+ if (typeof value === 'string' && dateTimeReg.test(value)) {
398
+ value = value.replace(/-/g, '/')
399
+ }
400
+ return value
401
+ }
402
+
403
+ export {Calendar, getDateTime, getDate, getTime, addZero, getDefaultSecond, dateCompare, checkDate, fixIosDateFormat}
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Form
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ mapFnName: 'getSaasFormList',
10
+ title: '获取问卷列表',
11
+ path: '/saas-app/v1/sms-form',
12
+ isRule: false,
13
+ params: {
14
+ page_token: ['当前页', 'Number', '必选'],
15
+ page_size: ['每页数量', 'Number', '必选'],
16
+ },
17
+ isConsole: true,
18
+ disabled: true,
19
+ },
20
+ ];
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
5
+ */
6
+ export default {
7
+ style: [],
8
+ content: (data) => {
9
+ return [
10
+ {
11
+ label: "列表外边距设置",
12
+ groupKey:'style',
13
+ ele: 'xd-margin-padding',
14
+ valueKey: 'listMargin',
15
+ value: data.listMargin || null,
16
+ setting: {
17
+ type: 'padding',
18
+ },
19
+ placeholder: '请设置边距',
20
+ inline: false,
21
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
22
+ },
23
+ {
24
+ label: "列表内边距设置",
25
+ groupKey:'style',
26
+ ele: 'xd-margin-padding',
27
+ valueKey: 'listPadding',
28
+ value: data.listPadding || null,
29
+ setting: {
30
+ type: 'padding',
31
+ },
32
+ placeholder: '请设置边距',
33
+ inline: false,
34
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
35
+ },
36
+ {
37
+ label: "列表单项圆角设置",
38
+ ele: 'xd-site-select-list',
39
+ valueKey: 'itemRadius',
40
+ value: data['itemRadius'] || '',
41
+ groupKey:'style',
42
+ placeholder: '请选择内容圆角设置',
43
+ multiple: false,
44
+ className: 'input80',
45
+ handleCustom({ action, data }) {
46
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
47
+ .then(res => {
48
+ data.cb(res.list)
49
+ })
50
+ .catch(error => {
51
+ console.error(error);
52
+ });
53
+ },
54
+ },
55
+ {
56
+ label: "问卷详情跳转路径",
57
+ ele: 'xd-select-pages-path',
58
+ valueKey: 'detailPath',
59
+ groupKey:'advanced',
60
+ placeholder: '请选择问卷详情跳转路径',
61
+ value: data['detailPath'] || null,
62
+ setting: {
63
+ router: XdBus.getParentApi('getPagesTree'),
64
+ },
65
+ inline: false,
66
+ },
67
+ ].filter(i=>i)
68
+ },
69
+ advanced: [],
70
+ };
@@ -0,0 +1,228 @@
1
+ <template>
2
+ <view
3
+ class="jfb-forms-list"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-forms-list__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-forms-list__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-forms-list__body">
17
+ <view class="activity_list_wrap" :style="listWrapBoxStyle">
18
+ <view class="activity_list">
19
+ <view class="activity_item"
20
+ v-for="(item,i) in list" :key="item.id"
21
+ :style="listItemBoxStyle"
22
+ @click="toDetail(item.form_id)"
23
+ >
24
+ <view class="item_img">
25
+ <image :src="item.cover" mode="aspectFill"></image>
26
+ <view v-if="item.tip" class="item_status">{{ item.tip }}</view>
27
+ </view>
28
+ <view class="item_cont">
29
+ <view class="item_name">{{item.form_name}}</view>
30
+ <view class="item_time">活动时间:{{item.start_time}}至{{ item.end_time }}</view>
31
+ </view>
32
+ </view>
33
+ </view>
34
+ </view>
35
+ </view>
36
+ </view>
37
+ </template>
38
+
39
+ <script>
40
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
41
+ import { jfbRootExec } from "@/utils/xd.event";
42
+ import JfbFormsListMixin from "./JfbFormsListMixin";
43
+ import { getContainerPropsValue } from "@/utils/xd.base";
44
+ import componentsMixins from "@/mixins/componentsMixins";
45
+ import extsMixins from "@/mixins/extsMixins";
46
+ import getServiceUrl from "@/common/getServiceUrl";
47
+ export default {
48
+ name: "JfbFormsList",
49
+ components: {
50
+ XdFontIcon
51
+ },
52
+ mixins: [
53
+ componentsMixins, extsMixins, JfbFormsListMixin
54
+ ],
55
+ data() {
56
+ return {
57
+ page_token: 1,
58
+ page_size: 10,
59
+ list: [],
60
+ next_page_token: "",
61
+ hasNext: true,
62
+
63
+ //todo
64
+ listMargin: {},
65
+ listPadding: {},
66
+ itemRadius: 0,
67
+ detailPath: "",
68
+ }
69
+ },
70
+ computed: {
71
+ listWrapBoxStyle(){
72
+ let padding = `${this.checkValue(this.listMargin.top, 20)}rpx`;
73
+ padding = `${padding} ${this.checkValue(this.listMargin.right, 20)}rpx`;
74
+ padding = `${padding} ${this.checkValue(this.listMargin.bottom, 20)}rpx`;
75
+ padding = `${padding} ${this.checkValue(this.listMargin.left, 20)}rpx`;
76
+ return this.styleObjectToString({
77
+ padding: padding,
78
+ })
79
+ },
80
+ listItemBoxStyle(){
81
+ let padding = `${this.checkValue(this.listPadding.top, 20)}rpx`;
82
+ padding = `${padding} ${this.checkValue(this.listPadding.right, 20)}rpx`;
83
+ padding = `${padding} ${this.checkValue(this.listPadding.bottom, 20)}rpx`;
84
+ padding = `${padding} ${this.checkValue(this.listPadding.left, 20)}rpx`;
85
+ return this.styleObjectToString({
86
+ padding: padding,
87
+ borderRadius: `${this.itemRadius}rpx`,
88
+ })
89
+ }
90
+
91
+ },
92
+ watch: {
93
+ container(value, oldValue) {
94
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
95
+ if (this.$configProject['isPreview']) this.init(value)
96
+ },
97
+ },
98
+ created() {
99
+ this.init(this.container);
100
+
101
+ //todo
102
+ },
103
+ methods: {
104
+ onJfbLoad(options) {
105
+
106
+ this.getList();
107
+ },
108
+ /**
109
+ * @description 监听事件变化
110
+ * @param container {object} 业务组件对象自己
111
+ */
112
+ init(container) {
113
+ this.listMargin = getContainerPropsValue(container, 'content.listMargin', {});
114
+ this.listPadding = getContainerPropsValue(container, 'content.listPadding', {});
115
+ this.itemRadius = getContainerPropsValue(container, 'content.itemRadius', 0);
116
+ this.detailPath = getContainerPropsValue(container, 'content.detailPath', {value: ""}).value;
117
+ },
118
+ getList(){
119
+ let data = {
120
+ page_token: this.page_token+'',
121
+ page_size: this.page_size
122
+ }
123
+ jfbRootExec("getSaasFormList", {
124
+ vm: this,
125
+ data: data
126
+ }).then(res => {
127
+ let list = res.list.map(item => {
128
+ item['cover'] = getServiceUrl(item.cover);
129
+ item["start_time"] = this.$xdUniHelper.getDate(item["start_time"] * 1000).fullDate;
130
+ item['end_time'] = this.$xdUniHelper.getDate(item["end_time"] * 1000).fullDate;
131
+ return item;
132
+ });
133
+ if(this.page_token == 1){
134
+ this.list = list;
135
+ }else{
136
+ this.list = this.list.concat(list);
137
+ }
138
+ this.next_page_token = res.next_page_token;
139
+ this.hasNext = !!res.next_page_token;
140
+ })
141
+ },
142
+ toDetail(form_id){
143
+ this.$xdUniHelper.navigateTo({
144
+ url: this.detailPath + `?form_id=${form_id}`
145
+ })
146
+ },
147
+ onJfbScroll(options) {
148
+ console.log('event.onJfbScroll', options)
149
+ },
150
+ onJfbReachBottom(options) {
151
+ console.log('event.onJfbReachBottom', options)
152
+ if(this.hasNext){
153
+ this.page_token = this.next_page_token;
154
+ this.getList();
155
+ }
156
+ },
157
+ onJfbShow(options) {
158
+ console.log('event.onJfbShow', options)
159
+ },
160
+ onJfbHide(options) {
161
+ console.log('event.onJfbHide', options)
162
+ },
163
+ onJfbBack(options) {
164
+ console.log('event.onJfbBack', options)
165
+ },
166
+ onJfbUpdate(...data) {
167
+ console.log('event.onJfbUpdate', data)
168
+ },
169
+ onJfbCustomEvent(options) {
170
+ console.log('event.onJfbReachBottom', options)
171
+ },
172
+ }
173
+ }
174
+
175
+ </script>
176
+
177
+ <style scoped lang="less">
178
+ @import "./JfbFormsListLess.less";
179
+
180
+ .jfb-forms-list {
181
+ &__body{
182
+ .activity_item{
183
+ background-color: #FFF;
184
+ padding: 24rpx;
185
+ border-radius: 20rpx;
186
+ margin-bottom: 20rpx;
187
+ .item_img{
188
+ width: 100%;
189
+ height: 260rpx;
190
+ background-color: #EEE;
191
+ border-radius: 20rpx;
192
+ position: relative;
193
+ overflow: hidden;
194
+ image{
195
+ width: 100%;
196
+ height: 100%;
197
+ }
198
+
199
+ .item_status{
200
+ position: absolute;
201
+ top: 20rpx;
202
+ right: 20rpx;
203
+ background-color: rgba(38, 38, 38, 0.5);
204
+ color: #FFFFFF;
205
+ padding: 8rpx 32rpx;
206
+ border-radius: 12rpx;
207
+ font-size: 24rpx;
208
+ }
209
+ }
210
+ .item_cont{
211
+ padding-left: 20rpx;
212
+ }
213
+ .item_name{
214
+ font-size: 32rpx;
215
+ margin-top: 20rpx;
216
+ color: #000;
217
+ font-weight: 500;
218
+ }
219
+ .item_time{
220
+ font-size: 24rpx;
221
+ margin-top: 12rpx;
222
+ color: #999;
223
+ font-weight: 400;
224
+ }
225
+ }
226
+ }
227
+ }
228
+ </style>