jufubao-forms 1.0.0-beta13 → 1.0.0-beta14

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-beta13",
3
+ "version": "1.0.0-beta14",
4
4
  "private": false,
5
5
  "description": "聚福宝表单业务插件库",
6
6
  "main": "index.js",
@@ -102,7 +102,14 @@
102
102
  <xd-font-icon icon="iconchenggong" color="#06bc85" :size="64"></xd-font-icon>
103
103
  <view class="status_tip">您已成功提交</view>
104
104
  <view class="status_name">{{ formName }}</view>
105
- <view class="status_btn" @click="doClose">关闭</view>
105
+ <!-- <view class="status_btn" @click="doClose">关闭</view> -->
106
+ <view class="status_btn_wrap">
107
+ <view class="status_btn" @click="doClose">关闭</view>
108
+ <view class="status_btn" v-if="marketToolText"
109
+ style="background:#FE7A63;"
110
+ @click="handleMarketToolBtn"
111
+ >{{ marketToolText }}</view>
112
+ </view>
106
113
  </view>
107
114
  <view v-if="form_status === 'error'" class="form_status form_error">
108
115
  <!-- <xd-font-icon icon="iconshibai" color="#ff5235" :size="64"></xd-font-icon> -->
@@ -185,6 +192,10 @@
185
192
  return {
186
193
  formName: "",
187
194
  form: {},
195
+ marketing_tool: "",
196
+ activity_page_url: "",
197
+ activity_id: "",
198
+ foreign_id: "",
188
199
  dynamicFormList: [],
189
200
  renderForm: "renderForm",
190
201
  form_id: "",
@@ -210,6 +221,15 @@
210
221
  ...mapState({
211
222
  brandInfo: state => state.brandInfo
212
223
  }),
224
+ marketToolText(){
225
+ let toolText = {
226
+ prize: '去抽奖',
227
+ coupon: '去领券',
228
+ walking: '健步走',
229
+ };
230
+ let btnText = toolText[this.marketing_tool];
231
+ return btnText ? btnText : '';
232
+ },
213
233
  bucket(){
214
234
  return this.formBe == 1 ? 'default' : 'saas';
215
235
  }
@@ -351,6 +371,17 @@
351
371
  getTimeFormat2(num) {
352
372
  return Number(num) < 10 ? "0" + num : num;
353
373
  },
374
+ handleMarketToolBtn(){
375
+ let url = this.checkUrlIsValid(this.activity_page_url);
376
+ if(url){
377
+ if(this.marketing_tool === 'prize') url = url + '?id=' + this.activity_id;
378
+ else if(this.marketing_tool === 'coupon') url = url + '?activity_id=' + this.activity_id;
379
+ else url = url + `?id=${this.activity_id}&activity_id=${this.activity_id}&foreign_id=${this.foreign_id}`;
380
+ this.$xdUniHelper.navigateTo({
381
+ url: url
382
+ })
383
+ }
384
+ },
354
385
  doCheckValidCode(){
355
386
  let token = this.valid_token;
356
387
  let valid_code = this.valid_code;
@@ -442,6 +473,10 @@
442
473
  }
443
474
  }).then(res => {
444
475
  this.$xdHideLoading();
476
+ this.marketing_tool = res.marketing_tool;
477
+ this.activity_page_url = res.activity_page_url;
478
+ this.activity_id = res.activity_id;
479
+ this.foreign_id = res.foreign_id;
445
480
  this.form_status = 'success';
446
481
  })
447
482
  },
@@ -688,6 +723,11 @@
688
723
  font-size: 32rpx;
689
724
  margin: 78rpx 0;
690
725
  }
726
+ .status_btn_wrap{
727
+ display: flex;
728
+ justify-content: center;
729
+ width: 80%;
730
+ }
691
731
  .status_btn{
692
732
  width: 80%;
693
733
  border-radius: 4px;
@@ -697,6 +737,9 @@
697
737
  height: 80rpx;
698
738
  line-height: 80rpx;
699
739
  text-align: center;
740
+ & + .status_btn{
741
+ margin-left: 32rpx;
742
+ }
700
743
  }
701
744
  }
702
745
 
@@ -338,7 +338,7 @@
338
338
  let url = this.checkUrlIsValid(this.activity_page_url);
339
339
  if(url){
340
340
  if(this.marketing_tool === 'prize') url = url + '?id=' + this.activity_id;
341
- if(this.marketing_tool === 'coupon') url = url + '?activity_id=' + this.activity_id;
341
+ else if(this.marketing_tool === 'coupon') url = url + '?activity_id=' + this.activity_id;
342
342
  else url = url + `?id=${this.activity_id}&activity_id=${this.activity_id}&foreign_id=${this.foreign_id}`;
343
343
  this.$xdUniHelper.navigateTo({
344
344
  url: url