jufubao-forms 1.0.0-beta7 → 1.0.0-beta9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-forms",
3
- "version": "1.0.0-beta7",
3
+ "version": "1.0.0-beta9",
4
4
  "private": false,
5
5
  "description": "聚福宝表单业务插件库",
6
6
  "main": "index.js",
@@ -78,7 +78,7 @@
78
78
  :end="item.end_time"
79
79
  :border="false"
80
80
  placeholder="请选择日期"
81
- @change="handleClearError(item)">
81
+ @change="e => handleDateTimePicker(e, item)">
82
82
  </uni-datetime-picker>
83
83
  </template>
84
84
  <!-- <xd-form-date v-if="item.field_type === 'calendar'"
@@ -600,6 +600,10 @@
600
600
  this.$set(this.form, item.field_value, value);
601
601
  this.$set(item, "error", "")
602
602
  },
603
+ handleDateTimePicker(time, item){
604
+ this.$set(this.form, item.field_value, time);
605
+ this.$set(item, "error", "")
606
+ },
603
607
  doClose(){
604
608
  this.$xdUniHelper.navigateTo({
605
609
  url: this.submitPagePath
@@ -595,6 +595,9 @@
595
595
  this.tempRange.before = this.cale.multipleStatus.before
596
596
  this.tempRange.after = this.cale.multipleStatus.after
597
597
  }
598
+ if(this.hasTime && !this.time) {
599
+ this.time = getTime(new Date(), this.hideSecond)
600
+ }
598
601
  this.change()
599
602
  },
600
603
  changeMonth(type) {
@@ -75,6 +75,18 @@ export default {
75
75
  },
76
76
  inline: false,
77
77
  },
78
+ {
79
+ label: "问答详情跳转路径",
80
+ ele: 'xd-select-pages-path',
81
+ valueKey: 'qaDetailPath',
82
+ groupKey:'advanced',
83
+ placeholder: '请选择问卷详情跳转路径',
84
+ value: data['qaDetailPath'] || null,
85
+ setting: {
86
+ router: XdBus.getParentApi('getPagesTree'),
87
+ },
88
+ inline: false,
89
+ },
78
90
  ].filter(i=>i)
79
91
  },
80
92
  advanced: [],
@@ -21,7 +21,7 @@
21
21
  <view class="activity_item"
22
22
  v-for="(item,i) in list" :key="item.id"
23
23
  :style="listItemBoxStyle"
24
- @click="toDetail(item.form_id)"
24
+ @click="toDetail(item)"
25
25
  >
26
26
  <view class="item_img">
27
27
  <image :src="item.cover" mode="aspectFill"></image>
@@ -68,6 +68,7 @@
68
68
  itemRadius: 0,
69
69
  detailPath: "",
70
70
  bucket: "default",
71
+ qaDetailPath: "",
71
72
  }
72
73
  },
73
74
  computed: {
@@ -118,6 +119,7 @@
118
119
  this.itemRadius = getContainerPropsValue(container, 'content.itemRadius', 0);
119
120
  this.bucket = getContainerPropsValue(container, 'content.bucket', 'default');
120
121
  this.detailPath = getContainerPropsValue(container, 'content.detailPath', {value: ""}).value;
122
+ this.qaDetailPath = getContainerPropsValue(container, 'content.qaDetailPath', {value: ""}).value;
121
123
  },
122
124
  getList(){
123
125
  let data = {
@@ -144,10 +146,17 @@
144
146
  this.hasNext = !!res.next_page_token;
145
147
  })
146
148
  },
147
- toDetail(form_id){
148
- this.$xdUniHelper.navigateTo({
149
+ toDetail(item){
150
+ let form_id = item.form_id;
151
+ if(item.base_type=='form'){
152
+ this.$xdUniHelper.navigateTo({
149
153
  url: this.detailPath + `?form_id=${form_id}`
150
154
  })
155
+ }else{
156
+ this.$xdUniHelper.navigateTo({
157
+ url: this.qaDetailPath + `?form_id=${form_id}`
158
+ })
159
+ }
151
160
  },
152
161
  onJfbScroll(options) {
153
162
  console.log('event.onJfbScroll', options)
@@ -19,6 +19,18 @@ export default {
19
19
  },
20
20
  inline: false,
21
21
  },
22
+ {
23
+ label: "问卷列表跳转路径",
24
+ ele: 'xd-select-pages-path',
25
+ valueKey: 'qaListPath',
26
+ groupKey:'advanced',
27
+ placeholder: '请选择问卷详情跳转路径',
28
+ value: data['qaListPath'] || null,
29
+ setting: {
30
+ router: XdBus.getParentApi('getPagesTree'),
31
+ },
32
+ inline: false,
33
+ },
22
34
  ].filter(i=>i)
23
35
  },
24
36
  advanced: [],
@@ -18,6 +18,7 @@
18
18
  <view class="jfb-forms-question-and-answer__body" :style="{
19
19
  '--main-color': mainColor,
20
20
  '--main-color-alpha': mainColorAlpha,
21
+ 'min-height': layoutInfo.bodyMinHeight
21
22
  }">
22
23
  <view v-if="loaded">
23
24
  <view v-if="form_status === 'content'">
@@ -80,10 +81,11 @@
80
81
  </view>
81
82
  </view>
82
83
  <view v-if="form_status === 'error'" class="form_status form_error">
83
- <xd-font-icon icon="iconshibai" color="#ff5235" :size="64"></xd-font-icon>
84
- <view class="status_tip error_tip">{{ err_msg }}</view>
85
- <view class="status_name">{{ formName }}</view>
86
- <view class="status_btn" @click="doClose" style="border-radius: 8rpx;">关闭</view>
84
+ <!-- <xd-font-icon icon="iconshibai" color="#ff5235" :size="64"></xd-font-icon> -->
85
+ <image class="empty_image" :src="emptyImage" mode="widthFix"></image>
86
+ <view class="status_tip error_tip" style="color: #333333;">{{ err_msg }}</view>
87
+ <!-- <view class="status_name">{{ formName }}</view> -->
88
+ <view class="status_btn" @click="toQaList" style="border-radius: 8rpx;margin-top: 100rpx;">返回列表</view>
87
89
  </view>
88
90
  </view>
89
91
 
@@ -102,6 +104,7 @@
102
104
  import componentsMixins from "@/mixins/componentsMixins";
103
105
  import extsMixins from "@/mixins/extsMixins";
104
106
  import Color from "color"
107
+ import getServiceUrl from '@/common/getServiceUrl'
105
108
  export default {
106
109
  name: "JfbFormsQuestionAndAnswer",
107
110
  components: {
@@ -124,7 +127,8 @@
124
127
  marketing_tool: "",
125
128
  activity_page_url: "",
126
129
  activity_id: "",
127
-
130
+ emptyImage: getServiceUrl('/common/empty/qa.png'),
131
+
128
132
  value: [],
129
133
  qaValue: "",
130
134
 
@@ -135,6 +139,7 @@
135
139
  //todo
136
140
 
137
141
  qaResultPath: "",
142
+ qaListPath: "",
138
143
  }
139
144
  },
140
145
  computed: {
@@ -221,8 +226,6 @@
221
226
  this.init(this.container);
222
227
  this.mainColorAlpha = Color(this.mainColor).alpha(0.15).string();
223
228
  this.isPreview = this.$configProject['isPreview'];
224
-
225
- //todo
226
229
  },
227
230
  methods: {
228
231
  onJfbLoad(options) {
@@ -264,6 +267,7 @@
264
267
  */
265
268
  init(container) {
266
269
  this.qaResultPath = getContainerPropsValue(container, 'content.qaResultPath', {value: ''}).value;
270
+ this.qaListPath = getContainerPropsValue(container, 'content.qaListPath', {value: ""}).value;
267
271
  },
268
272
  handlePrev(){
269
273
  if(this.curIndex > 0){
@@ -283,6 +287,11 @@
283
287
  window.location.href = 'about:blank';
284
288
  window.close();
285
289
  },
290
+ toQaList(){
291
+ this.$xdUniHelper.redirectTo({
292
+ url: this.qaListPath
293
+ })
294
+ },
286
295
  p_submitQaForm(){
287
296
  uni.showModal({
288
297
  title: '提示',
@@ -495,6 +504,13 @@
495
504
  flex-direction: column;
496
505
  align-items: center;
497
506
  padding-top: 100rpx;
507
+ .empty_image{
508
+ width: 500rpx;
509
+
510
+ image{
511
+ width: 100%;
512
+ }
513
+ }
498
514
  .status_tip{
499
515
  color: #06bc85;
500
516
  margin-top: 32rpx;