Ver Fonte

购物车

LXT-NJ\Admin há 1 ano atrás
pai
commit
9dae16ff79
1 ficheiros alterados com 24 adições e 0 exclusões
  1. 24 0
      pages/gouwuche/index.vue

+ 24 - 0
pages/gouwuche/index.vue

@@ -17,6 +17,7 @@
 			<tm-listitem class="liebiao jiageList" :value="'¥'+zongjia" :round="24" :shadow="12" title="价格"
 				:show-right-icon="false"></tm-listitem>
 			<view class="text-align-center">
+				<!-- <tm-button theme="red" @click="qingkong()" :round="24" class="mt-50 logincla">清空</tm-button> -->
 				<tm-button theme="red" @click="shanchu" :round="24" class="mt-50 logincla">删除</tm-button>
 				<tm-button theme="primary" :round="24" class="mt-50 logincla" @click="goPay">立即付款</tm-button>
 			</view>
@@ -50,6 +51,29 @@
 			this.getList()
 		},
 		methods: {
+			// 清空
+			qingkong() {
+				let that = this;
+				myRequest({
+					url: '/api/ShopCart/deleteAllGoods',
+					method: 'post',
+					data: {}
+				}).then(res => {
+					if (res.data.code == 200) {
+						console.log(res.data.data,'33');
+						that.$refs.toast.show({
+							model: 'success',
+							label: res.data.msg
+						})
+						// this.getList()
+					} else {
+						that.$refs.toast.show({
+							model: 'error',
+							label: res.data.msg
+						})
+					}
+				})
+			},
 			goPay() {
 				var that = this,
 					data = this.test,