添加购物车
This commit is contained in:
@@ -3,13 +3,15 @@ Component({
|
||||
img:String,
|
||||
title:String,
|
||||
id:String,
|
||||
price:String
|
||||
price:String,
|
||||
shopid:String
|
||||
},
|
||||
data: {},
|
||||
methods: {
|
||||
gotodetail() {
|
||||
gotodetail(e) {
|
||||
console.log(e.currentTarget.dataset.id)
|
||||
wx.navigateTo({
|
||||
url: "/pages/product/product"
|
||||
url: "/pages/product/product?shopid="+e.currentTarget.dataset.id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<view class="commodity" bindtap="gotodetail">
|
||||
<view class="commodity" bindtap="gotodetail" data-id="{{shopid}}">
|
||||
<view class="content">
|
||||
<image class="imgthumb " src="{{img}}"></image>
|
||||
<view class="introduce">
|
||||
<text class="towline">{{title}}</text>
|
||||
|
||||
<view>
|
||||
<text>¥{{price}}</text>
|
||||
<text>加入购物车</text>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<view class="list">
|
||||
<text class="title">热门商品</text>
|
||||
<commodity wx:for="{{list}}" title="{{item.goods_name}}" price="{{item.shop_price}}" img="{{item.image}}"></commodity>
|
||||
<commodity wx:for="{{list}}" title="{{item.goods_name}}" price="{{item.shop_price}}" img="{{item.image}}" shopid="{{item.goods_id}}"></commodity>
|
||||
</view>
|
||||
Reference in New Issue
Block a user