|
|
@@ -57,6 +57,7 @@
|
|
|
<script>
|
|
|
import vueQrcode from '@chenfengyuan/vue-qrcode';
|
|
|
import resolveUrl from 'resolve-url';
|
|
|
+import { mapState } from 'vuex';
|
|
|
import { add } from 'mathjs';
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -102,32 +103,17 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
money() {
|
|
|
- if (this.info.price) {
|
|
|
- return add(this.info.price, this.gas);
|
|
|
- } else {
|
|
|
- return 0;
|
|
|
+ let money = 0;
|
|
|
+ if (this.info.price && !this.couponInfo) {
|
|
|
+ money = this.accAdd(this.info.price, money);
|
|
|
}
|
|
|
- // add(this.info.price, this.gas)
|
|
|
- // if (this.info.price) {
|
|
|
- // return this.info.price.reduce((prev, cur) => {
|
|
|
- // var r1, r2, m;
|
|
|
- // try {
|
|
|
- // r1 = prev.toString().split('.')[1].length;
|
|
|
- // } catch (e) {
|
|
|
- // r1 = 0;
|
|
|
- // }
|
|
|
- // try {
|
|
|
- // r2 = cur.money.toString().split('.')[1].length;
|
|
|
- // } catch (e) {
|
|
|
- // r2 = 0;
|
|
|
- // }
|
|
|
- // m = Math.pow(10, Math.max(r1, r2));
|
|
|
- // return (prev * m + cur.money * m) / m;
|
|
|
- // }, 0);
|
|
|
- // } else {
|
|
|
- // return 0;
|
|
|
- // }
|
|
|
- }
|
|
|
+ if (this.gas && (!this.couponInfo || this.couponInfo.needGas)) {
|
|
|
+ money = this.accAdd(money, this.gas);
|
|
|
+ }
|
|
|
+
|
|
|
+ return money;
|
|
|
+ },
|
|
|
+ ...mapState(['couponInfo'])
|
|
|
},
|
|
|
methods: {
|
|
|
submit() {
|