diff --git a/.eslintrc.js b/.eslintrc.js
index f962912..e0b044f 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -26,6 +26,14 @@ module.exports = {
],
"rules": {
quotes: ['error', 'single'],
- 'space-before-function-paren': 0
+ 'space-before-function-paren': 0,
+ // 数组和对象键值对最后一个逗号, never参数:不能带末尾的逗号, always参数:必须带末尾的逗号,
+ // always-multiline:多行模式必须带逗号,单行模式不能带逗号
+ "comma-dangle": [2, "always-multiline"],
+ // 控制逗号前后的空格
+ "comma-spacing": [2, { "before": false, "after": true }],
+ // 控制逗号在行尾出现还是在行首出现
+ // http://eslint.org/docs/rules/comma-style
+ "comma-style": [2, "last"],
}
};
diff --git a/src/components/CommodityCard/CommodityCard.vue b/src/components/CommodityCard/CommodityCard.vue
index 38494b9..f98ab9b 100644
--- a/src/components/CommodityCard/CommodityCard.vue
+++ b/src/components/CommodityCard/CommodityCard.vue
@@ -10,9 +10,10 @@
{{goods.name?goods.name:goods.p_name}}
- {{goods.oldPrice !== undefined?goods.oldPrice:goods.old_price}}
+ {{goods.old_price ? goods.old_price : (goods.rsSon && goods.rsSon.Min_Price)}}
- {{goods.price !== undefined?goods.price:goods.real_price}}
+
+ {{goods.real_price ? goods.real_price : parseInt(goods.rsSon && goods.rsSon.Min_Price*(1 + Number(goods.rsSon.discount)/100))}}
{{goods.trade_num}}人购买
@@ -34,8 +35,8 @@ export default {
originCost: String,
price: String,
trade_num: String,
- goodType: String
- }
+ goodType: String,
+ },
},
created () {
@@ -52,10 +53,10 @@ export default {
url: '../frameDetail/frameDetail?pid=' + id,
success: res => {},
fail: () => {},
- complete: () => {}
+ complete: () => {},
})
- }
- }
+ },
+ },
}
diff --git a/src/pages/confirmOrder/confirmOrder.vue b/src/pages/confirmOrder/confirmOrder.vue
index 0a630b1..876940c 100644
--- a/src/pages/confirmOrder/confirmOrder.vue
+++ b/src/pages/confirmOrder/confirmOrder.vue
@@ -61,7 +61,9 @@
商品名称商品名称商品名称名称名称
- ¥198
+ ¥{{Number(skuInfo.real_price) * count}}
+ ¥{{parseInt(skuInfo.real_price * (1 + Number(skuInfo.discount) / 100))}}
+
- 规格 玫瑰金/钛合金
+ 规格
+
+ {{attrList[index].attr[item].name}}/
+
配送方式 快递
买家留言
合计
- ¥{{total}}
+ ¥{{Number(skuInfo.real_price) * count}}
@@ -150,7 +158,7 @@
-->
-->
{
this.parameter[0].slength = `${this.goodInfo.frame_width}mm`
this.parameter[1].slength = `${this.goodInfo.glass_width}mm`
@@ -406,7 +406,7 @@ export default {
goodInfo () {
console.log(this.$store.state.read.goodInfo)
return this.$store.state.read.goodInfo
- }
+ },
},
methods: {
// 前往购物车
@@ -415,7 +415,7 @@ export default {
url: '/pages/cart/cart',
success: res => {},
fail: (error) => { console.log('跳转购物车失败======>', error) },
- complete: () => { console.log('toCart') }
+ complete: () => { console.log('toCart') },
})
},
// 加入购物车
@@ -428,10 +428,10 @@ export default {
num: this.addCartList.num,
pid: this.pid,
price: this.addCartList.price,
- checkedSKU: {}
+ checkedSKU: {},
})
store.dispatch('cart/getCartList', {
- uid: this.$store.state.user.userInfo.uid // 用户id
+ uid: this.$store.state.user.userInfo.uid, // 用户id
})
},
goPerchase () {
@@ -442,7 +442,7 @@ export default {
url: `../purchaseLenses/purchaseLenses?pid=${this.pid}`,
success: res => {},
fail: (error) => { console.log('跳转参数选择失败======>', error) },
- complete: () => { console.log('goPerchase') }
+ complete: () => { console.log('goPerchase') },
})
// break
// case '2':
@@ -479,18 +479,18 @@ export default {
uid: this.$store.state.user.userInfo.uid,
openid: this.$store.state.user.userInfo.openid,
pid: this.pid,
- checkedSKU: {}
+ checkedSKU: {},
})
store.dispatch('cart/getCartList', {
- uid: this.$store.state.user.userInfo.uid // 用户id
+ uid: this.$store.state.user.userInfo.uid, // 用户id
})
},
tabChange (e) {
if (this.current !== e) {
this.current = e
}
- }
- }
+ },
+ },
}