Browse Source

优化项目新人折扣

yuhao 2 years ago
parent
commit
4a698d1b28
3 changed files with 9 additions and 1 deletions
  1. 5 0
      package-lock.json
  2. 1 0
      package.json
  3. 3 1
      src/pages/confirmOrder/details/index.vue

+ 5 - 0
package-lock.json

@@ -4583,6 +4583,11 @@
4583 4583
       "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==",
4584 4584
       "dev": true
4585 4585
     },
4586
+    "console": {
4587
+      "version": "0.7.2",
4588
+      "resolved": "https://registry.npmmirror.com/console/-/console-0.7.2.tgz",
4589
+      "integrity": "sha512-+JSDwGunA4MTEgAV/4VBKwUHonP8CzJ/6GIuwPi6acKFqFfHUdSGCm89ZxZ5FfGWdZfkdgAroy5bJ5FSeN/t4g=="
4590
+    },
4586 4591
     "console-browserify": {
4587 4592
       "version": "1.2.0",
4588 4593
       "resolved": "https://registry.npmmirror.com/console-browserify/-/console-browserify-1.2.0.tgz",

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
12 12
   },
13 13
   "dependencies": {
14 14
     "axios": "^0.27.2",
15
+    "console": "^0.7.2",
15 16
     "crypto-js": "^3.1.9-1",
16 17
     "element-ui": "^2.8.2",
17 18
     "js-cookie": "^3.0.1",

+ 3 - 1
src/pages/confirmOrder/details/index.vue

@@ -514,6 +514,7 @@ import minePupop from '../../../components/minePupop/index.vue'
514 514
 import QRCode from 'qrcodejs2'
515 515
 import api from '../../../server/home'
516 516
 import internal from 'assert';
517
+import { log } from 'console';
517 518
 
518 519
 export default {
519 520
   components: { minePupop },
@@ -1172,8 +1173,9 @@ export default {
1172 1173
       let payWayList = this.payList.filter(res => {
1173 1174
         return res.isSelect == true
1174 1175
       })
1176
+      console.log(this.discountList);
1175 1177
       // 卡券,项目券数据包, id:订单项目ID, coupon_id:优惠券ID, 如:[{ "id": 1220, coupon_id: 199 }]isSelectCoup
1176
-      this.discountList = this.card_data.length > 0||this.order_data.discount!=0 ? 0 : this.discountList.sort(this.compare("priceSet"))[0].id
1178
+      this.discountList = this.card_data.length > 0||this.order_data.discount!=0 ? 0 :this.discountList.length!=0?this.discountList.sort(this.compare("priceSet"))[0].id:0
1177 1179
       let params = {
1178 1180
         id: this.id,
1179 1181
         pay_way: payWayList[0].pay_way,