LXT-NJ\Admin 1 年間 前
コミット
22ad75316d
2 ファイル変更20 行追加11 行削除
  1. 1 7
      pages/shopsoso/index.vue
  2. 19 4
      pages/sort/index.vue

+ 1 - 7
pages/shopsoso/index.vue

@@ -45,7 +45,7 @@
 							</view>
 							<view class="mt-2 flex-between flex-center">
 								<view class="touxiang mt-30">
-									<text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
+									<text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
 								</view>
 								<view >
 									<image @click.stop="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
@@ -190,16 +190,10 @@ export default {
 				}).then(res => {
 					if (res.data.code == 200) {
 						that.$refs.toast.show({model:'success',label:res.data.msg})
-						// that.getGwc()
 					}else{
 						that.$refs.toast.show({model:'error',label:res.data.msg})
 					}
 				})
-			// }else{
-			// 	uni.navigateTo({
-			// 		url: "/pages/shopdetail/index",
-			// 	})
-			// }
 			// uni.navigateTo({
 			// 	url: "/pages/gouwuche/index",
 			// })

+ 19 - 4
pages/sort/index.vue

@@ -13,10 +13,10 @@
 							</view>
 							<view class="mt-2 flex-between flex-center">
 								<view class="touxiang mt-30">
-									<text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
+									<text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
 								</view>
 								<view >
-									<image @click="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
+									<image @click.stop="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
 								</view>
 							</view>
 						</view>
@@ -87,8 +87,23 @@ export default {
 			})
 		},
 		jiarufuFun(data){
-			uni.navigateTo({
-				url: "/pages/gouwuche/index",
+			let that=this;
+			myRequest({
+				url: "/api/ShopCart/addShopCart",
+				method:'post',
+				data:{
+					goods_id:data.id,
+					goods_name:data.goods_name,
+					goods_image:data.image,
+					goods_price:data.sale_price,
+					goods_num:1
+				}
+			}).then(res => {
+				if (res.data.code == 200) {
+					that.$refs.toast.show({model:'success',label:res.data.msg})
+				}else{
+					that.$refs.toast.show({model:'error',label:res.data.msg})
+				}
 			})
 			// console.log(data)
 			// this.gouwuche.push(data)