From 5989263b6d8c9e341a1a590ee525bdb9a9070886 Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Mon, 20 Feb 2017 15:17:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E7=9A=84=E5=BC=B9=E7=AA=97=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/show_product/show_product.js | 27 ++++++++++++++++++++- pages/show_product/show_product.wxml | 35 +++++++++++++++++++++++++++- pages/show_product/show_product.wxss | 5 ++++ 3 files changed, 65 insertions(+), 2 deletions(-) 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