LXT-NJ\Admin hace 1 año
padre
commit
9dae16ff79
Se han modificado 1 ficheros con 24 adiciones y 0 borrados
  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,