瀏覽代碼

Merge branch 'master' of https://git.liliju.com/YZM/wardrobe

YZM 1 年之前
父節點
當前提交
ca210f44b2
共有 1 個文件被更改,包括 24 次插入0 次删除
  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,