diff --git a/pages/show_product/show_product.js b/pages/show_product/show_product.js index 8aae962..f4da819 100644 --- a/pages/show_product/show_product.js +++ b/pages/show_product/show_product.js @@ -10,7 +10,8 @@ Page({ windowHeight: 667, pixelRatio: 2, accountType: '', - from_share: false + from_share: false, + addProductAnimation: {} }, onShareAppMessage: function () { @@ -96,6 +97,12 @@ Page({ } } + + + this.popAddProduct() + + + var cartItems = wx.getStorageSync('cartItems') || [] var exist = cartItems.filter(function(ele){ @@ -126,5 +133,23 @@ Page({ url: '../cart/cart' }) } + }, + + popAddProduct: function () { + if (this.count) { + this.count = this.count + 1 + } else { + this.count = 1 + } + var animation = wx.createAnimation({ + duration: 800, + timingFunction: 'ease', + }) + var y = this.count % 2 === 0 ? 200 : -200 + animation.translateY(y).step() + + this.setData({ + addProductAnimation: animation.export() + }) } }) diff --git a/pages/show_product/show_product.wxml b/pages/show_product/show_product.wxml index 0af0149..9b976be 100644 --- a/pages/show_product/show_product.wxml +++ b/pages/show_product/show_product.wxml @@ -39,4 +39,37 @@ - \ No newline at end of file + + + + + + + + + + {{product.name}} + + 巴爷价:¥{{product['baye-price']}} + + + ¥{{product['member-price']}} + + + + + + + 商品类型 + + + + + + + + + 购买数量: + + + \ No newline at end of file diff --git a/pages/show_product/show_product.wxss b/pages/show_product/show_product.wxss index a0675c1..a5ca443 100644 --- a/pages/show_product/show_product.wxss +++ b/pages/show_product/show_product.wxss @@ -62,4 +62,9 @@ #back-to-home image { width: 100rpx; height: 100rpx; +} + +.mall_tan_content { + position: fixed; + bottom: 0; } \ No newline at end of file