Browse Source

更新购物车商品购买

李书文 1 year ago
parent
commit
4e00ac3a82
1 changed files with 13 additions and 1 deletions
  1. 13 1
      pages/market/one/leader/cart.vue

+ 13 - 1
pages/market/one/leader/cart.vue

@@ -16,7 +16,7 @@
 				<view class="clear"></view>
 				<view class="op">
 					<view class="date">{{ item.createTime }}</view>
-					<view class="an btn" @click.stop="confirm(item.id, 1, '确认接单?')">立即够买</view>
+					<view class="an btn" @click.stop="buy(item)">立即够买</view>
 				</view>
 			</view>
 			<u-empty v-if="list.length == 0"></u-empty>
@@ -47,6 +47,18 @@ export default {
 		detail(item) {
 			uni.navigateTo({ url: '/pages/market/one/detail?id=' + item.publishGoodsId });
 		},
+		// 立即购买
+		buy(item) {
+			this.http.request({
+				url: '/level-one-server/app/TbGoodsTransit/purchaseLevelOntGoodsTransit',
+				data: { goodsTransitId: item.publishGoodsId },
+				method: 'POST',
+				contentType: 'application/json; charset=utf-8',
+				success: res => {
+					uni.redirectTo({ url: '/pages/market/one/leader/success' });
+				}
+			});
+		},
 		del(item) {
 			let ids = item.id || this.list.map(i => i.id);
 			uni.showModal({