1、新增签约宝
2、调整自营 3、新增购物车(未完善)
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
<view class="w-1200 m-a">
|
||||
<view class="mt-20 bg-white rounded p-20">
|
||||
<view class="flex justify-between">
|
||||
<text class="font-bold text-40">
|
||||
购物车(全部{{ list.length }})
|
||||
</text>
|
||||
<view class="flex justify-end items-center">
|
||||
<text>已选商品(不含运费)</text>
|
||||
<text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text>
|
||||
<el-button type="primary" round>结算</el-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<gap height="50"/>
|
||||
<common-footer></common-footer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "cart",
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
selectedList: [],
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: "client/cart/kh/getList"
|
||||
})
|
||||
this.list = rows
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getList()
|
||||
},
|
||||
computed: {
|
||||
amount() {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -31,7 +31,7 @@
|
||||
<text class="font-bold text-main">¥{{ info.amount }}</text>
|
||||
</view>
|
||||
<view class="flex justify-end is-center">
|
||||
<el-button type="danger" round class="add-to-cart-btn">加入购物车</el-button>
|
||||
<el-button type="danger" round class="add-to-cart-btn" @click.native="addToCart">加入购物车</el-button>
|
||||
<el-button type="primary" round class="ml-35">立即购买</el-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -55,6 +55,7 @@ export default {
|
||||
components: {UGap},
|
||||
data() {
|
||||
return {
|
||||
id: null,
|
||||
info: {
|
||||
name: ''
|
||||
}
|
||||
@@ -62,6 +63,7 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options && options.id) {
|
||||
this.id = options.id;
|
||||
this.getInfo(options.id)
|
||||
}
|
||||
},
|
||||
@@ -74,6 +76,20 @@ export default {
|
||||
url: 'client/goods/list/pub/getDetail',
|
||||
data: {id}
|
||||
})
|
||||
},
|
||||
addToCart(){
|
||||
vk.callFunction({
|
||||
url: 'client/cart/kh/add',
|
||||
data: {
|
||||
goodsId: this.id,
|
||||
},
|
||||
success: (res) => {
|
||||
this.$message({
|
||||
type:'success',
|
||||
message: '添加成功'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
</view>
|
||||
<!-- 现货市场 end -->
|
||||
<gap height="50"/>
|
||||
<right-bar></right-bar>
|
||||
<common-footer></common-footer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user