Skip to content

Commit

Permalink
添加充值按钮,修复添加至购物车功能
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoKong committed Dec 21, 2021
1 parent 0949780 commit b1f33d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@


#### 安装教程

1. 安装node.js,npm, cnpm
2. cd至项目根目录
1. cnpm install


Expand Down
2 changes: 1 addition & 1 deletion src/components/profile_person.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</tr>
<tr>
<td>余额:</td>
<td>{{this.$store.state.userInfo.balance}}</td>
<td>{{this.$store.state.userInfo.balance}} <button>充值</button></td>
</tr>
</table>
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/views/GoodsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@
}});
}
else{
this.goodsForm.payment = this.goodsForm.amount * this.goodsForm.price;
this.$store.dispatch("addCart", this.goodsForm);
ElMessage({
message: '请先选择型号!',
type: 'error',
Expand All @@ -89,14 +87,14 @@
},
addCart() {
if(this.radio != null){
this.goodsForm.payment = this.goodsForm.amount * this.goodsForm.price;
this.$store.dispatch("addCart", this.goodsForm);
ElMessage({
message: '成功加入购物车!',
type: 'success',
});
}
else{
this.goodsForm.payment = this.goodsForm.amount * this.goodsForm.price;
this.$store.dispatch("addCart", this.goodsForm);
ElMessage({
message: '请先选择型号!',
type: 'error',
Expand Down

0 comments on commit b1f33d7

Please sign in to comment.