jufubao-mall 2.0.65 → 2.0.66

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-mall",
3
- "version": "2.0.65",
3
+ "version": "2.0.66",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -70,7 +70,7 @@
70
70
  style="margin-right: 8rpx;"
71
71
  icon="iconkaquan"
72
72
  color="#ffc65d"
73
- size="32"
73
+ size="32"
74
74
  ></xd-font-icon>
75
75
  {{ticket.card_type_name}}
76
76
  </view>
@@ -198,12 +198,6 @@
198
198
  if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
199
199
  if (this.$configProject['isPreview']) this.init(value)
200
200
  },
201
- showCardDialog(val){
202
- if(!val){
203
- this.checkedCards=[];
204
- this.chooseData=[];
205
- }
206
- }
207
201
  },
208
202
  data(){
209
203
  return {
@@ -243,7 +237,7 @@
243
237
  },
244
238
  created() {
245
239
  if(!this.$configProject.isPreview){
246
- this.getCardList('');
240
+ this.getCardList('card',true);
247
241
  }
248
242
  },
249
243
  mounted(){
@@ -271,15 +265,24 @@
271
265
  show_type:type
272
266
  }
273
267
  }).then(res => {
274
- console.log(res,'res')
275
268
  this.showCardList = res.list;
276
- console.log(this.showCardList,'showCardList')
269
+
270
+ //自动选择逻辑
271
+ let useCard = this.showCardList.filter(item => item.is_auto_use === 'Y');
272
+ if(useCard.length>0 && this.chooseData.length ===0) {
273
+ let ticket = useCard[0];
274
+ this.handlerTicketSelect(!this.checkedCards.includes(ticket.card_number), ticket);
275
+ setTimeout(() => {
276
+ this.handleChooseConfirm()
277
+ }, 500);
278
+ }
279
+
277
280
  this.renderChecked = Date.now();
278
281
  if(!res.list.length){
279
282
  this.card_name = '无可用票券'
280
283
  return;
281
284
  }
282
-
285
+
283
286
  }).catch(err => {});
284
287
  },
285
288
  handleRefresh(){
@@ -293,24 +296,13 @@
293
296
  this.getCardList(type);
294
297
  },
295
298
  handlerTicketSelect(flat, ticket){
296
- console.log(flat, ticket,this.chooseData,this.checkedCards)
297
299
  if(flat){
298
- if(this.chooseData.length){
299
- this.$xdAlert({
300
- content: '只能选择一张票券!',
301
- isClose: false,
302
- iconShow: false
303
- });
304
- // this.renderChecked = Date.now();
305
- return
306
- }
307
- this.chooseData.push(ticket);
308
- }else{
300
+ this.chooseData = [ticket];
301
+ }
302
+ else{
309
303
  this.chooseData = [];
310
- this.renderChecked = Date.now();
311
304
  }
312
305
  this.checkedCards = this.chooseData.map(item => item.card_number);
313
- console.log(this.chooseData, this.checkedCards,'1231231')
314
306
  },
315
307
  handleChangeType(index){
316
308
  this.activeIndex = index;
@@ -329,96 +321,97 @@
329
321
  }
330
322
  this.detail();
331
323
  this.refrush();
324
+ this.showCardDialog = false;
332
325
  },
333
326
  /**
334
- * @description 获取卡详情
335
- */
336
- detail() {
337
- jfbRootExec("getBaseByIdCardDetail", {
338
- vm: this,
339
- data: {card_number: this.card_number,},
340
- })
341
- .then((res) => {
342
- if (res && res.card_point) {
343
- res["card_point"] = this.$xdUniHelper.divisionFloatNumber(res.card_point, 100);
344
- }
345
- if (res && res.card_point) {
346
- res["other_card_point"] = this.$xdUniHelper.divisionFloatNumber(res.other_card_point, 100);
347
- }
348
- //显示按钮
349
- if (res["is_show_qrcode_logo"] === "Y") {
350
- this.isBrandLogo = true;
351
- }
352
- this.info = res;
353
- this.card_name = '已选卡号'+res.card_number;
354
- this.showCardDialog = false;
355
- if(!this.$configProject.isPreview) {
356
- this.setInval(this.info.card_qrcode_expire);
357
- }
358
- })
359
- .catch((err) => {
360
- // this.$refs["pwPay"].clearPwd();
361
- });
362
- },
363
- setInval(time) {
364
- console.log("pppppp", time);
365
- this.timeer = setInterval(() => {
366
- if (time === 0) {
367
- this.timeStr = "00分00秒";
368
- clearInterval(this.timeer);
369
- this.detail();
370
- } else {
371
- time--;
372
- let f = Math.floor(time / 60);
373
- f = f < 10 ? "0" + f : f;
374
- let m = time % 60;
375
- m = m < 10 ? "0" + m : m;
376
- this.timeStr = `${f}分${m}秒`;
377
- }
378
- }, 1000);
379
- },
380
- refrush() {
381
- // if (this.stopTimer) return;
382
- if (this.time >= this.maxTime) {
383
- clearTimeout(this.refrushTimeer);
384
- console.log("refrushTimeer.end");
385
- return;
386
- }
387
- this.time++;
388
- let time =
389
- this.time >= 5 ? 32 * 1000 : Math.pow(this.date, this.time) * 1000;
390
- this.refrushTimeer = setTimeout(() => {
391
- jfbRootExec("getCardYue", {
327
+ * @description 获取卡详情
328
+ */
329
+ detail() {
330
+ jfbRootExec("getBaseByIdCardDetail", {
392
331
  vm: this,
393
- data: {
394
- card_number: this.card_number,
395
- },
332
+ data: {card_number: this.card_number,},
396
333
  })
397
334
  .then((res) => {
398
- //res[4]['value'] = this.$xdUniHelper.random(20,30);
399
- let refrushInfo = this.$xdUniHelper.cloneDeep(this.info);
400
- if (res && res !== null && Object.keys(res).length > 0) {
401
- if (res.card_point) {
402
- refrushInfo.card_point = this.$xdUniHelper.divisionFloatNumber(
403
- res.card_point,
404
- 100
405
- );
406
- }
407
- if (res.other_card_point) {
408
- refrushInfo.other_card_point =
409
- this.$xdUniHelper.divisionFloatNumber(
410
- res.other_card_point,
335
+ if (res && res.card_point) {
336
+ res["card_point"] = this.$xdUniHelper.divisionFloatNumber(res.card_point, 100);
337
+ }
338
+ if (res && res.card_point) {
339
+ res["other_card_point"] = this.$xdUniHelper.divisionFloatNumber(res.other_card_point, 100);
340
+ }
341
+ //显示按钮
342
+ if (res["is_show_qrcode_logo"] === "Y") {
343
+ this.isBrandLogo = true;
344
+ }
345
+ this.info = res;
346
+ this.card_name = '已选卡号'+res.card_number;
347
+ this.showCardDialog = false;
348
+ if(!this.$configProject.isPreview) {
349
+ this.setInval(this.info.card_qrcode_expire);
350
+ }
351
+ })
352
+ .catch((err) => {
353
+ // this.$refs["pwPay"].clearPwd();
354
+ });
355
+ },
356
+ setInval(time) {
357
+ console.log("pppppp", time);
358
+ this.timeer = setInterval(() => {
359
+ if (time === 0) {
360
+ this.timeStr = "00分00秒";
361
+ clearInterval(this.timeer);
362
+ this.detail();
363
+ } else {
364
+ time--;
365
+ let f = Math.floor(time / 60);
366
+ f = f < 10 ? "0" + f : f;
367
+ let m = time % 60;
368
+ m = m < 10 ? "0" + m : m;
369
+ this.timeStr = `${f}分${m}秒`;
370
+ }
371
+ }, 1000);
372
+ },
373
+ refrush() {
374
+ // if (this.stopTimer) return;
375
+ if (this.time >= this.maxTime) {
376
+ clearTimeout(this.refrushTimeer);
377
+ console.log("refrushTimeer.end");
378
+ return;
379
+ }
380
+ this.time++;
381
+ let time =
382
+ this.time >= 5 ? 32 * 1000 : Math.pow(this.date, this.time) * 1000;
383
+ this.refrushTimeer = setTimeout(() => {
384
+ jfbRootExec("getCardYue", {
385
+ vm: this,
386
+ data: {
387
+ card_number: this.card_number,
388
+ },
389
+ })
390
+ .then((res) => {
391
+ //res[4]['value'] = this.$xdUniHelper.random(20,30);
392
+ let refrushInfo = this.$xdUniHelper.cloneDeep(this.info);
393
+ if (res && res !== null && Object.keys(res).length > 0) {
394
+ if (res.card_point) {
395
+ refrushInfo.card_point = this.$xdUniHelper.divisionFloatNumber(
396
+ res.card_point,
411
397
  100
412
398
  );
399
+ }
400
+ if (res.other_card_point) {
401
+ refrushInfo.other_card_point =
402
+ this.$xdUniHelper.divisionFloatNumber(
403
+ res.other_card_point,
404
+ 100
405
+ );
406
+ }
413
407
  }
414
- }
415
408
 
416
- this.info = refrushInfo;
417
- this.refrush();
418
- })
419
- .catch();
420
- }, time);
421
- },
409
+ this.info = refrushInfo;
410
+ this.refrush();
411
+ })
412
+ .catch();
413
+ }, time);
414
+ },
422
415
  }
423
416
  }
424
417
  </script>