From 95d12a01bbc74fa5ac4a4c0510232497b5cac255 Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Wed, 23 Nov 2016 17:26:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=86=E5=A4=87=E6=B7=BB=E5=8A=A0coupon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 1 + pages/cart/cart.js | 6 ++++++ pages/cart/cart.wxml | 6 ++++++ pages/cart/cart.wxss | 6 +++++- pages/cart/coupon.js | 26 ++++++++++++++++++++++++++ pages/cart/coupon.json | 3 +++ pages/cart/coupon.wxml | 0 pages/cart/coupon.wxss | 0 8 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 pages/cart/coupon.js create mode 100644 pages/cart/coupon.json create mode 100644 pages/cart/coupon.wxml create mode 100644 pages/cart/coupon.wxss diff --git a/app.json b/app.json index d3bfb6a..3b04385 100644 --- a/app.json +++ b/app.json @@ -4,6 +4,7 @@ "pages/show_product/show_product", "pages/address/address", "pages/cart/cart", + "pages/cart/coupon", "pages/mine/mine", "pages/category/category", "pages/my_assets/show" diff --git a/pages/cart/cart.js b/pages/cart/cart.js index 22cf9f0..5115efe 100644 --- a/pages/cart/cart.js +++ b/pages/cart/cart.js @@ -33,6 +33,12 @@ Page({ this.setData({address: address}) }, + bindSelectCoupon: function() { + wx.navigateTo({ + url: `coupon` + }) + }, + bindChangeQuantity: function (e) { var cartItems = this.data.cartItems var item = cartItems.filter(function(ele){ diff --git a/pages/cart/cart.wxml b/pages/cart/cart.wxml index 67e7629..c954eca 100644 --- a/pages/cart/cart.wxml +++ b/pages/cart/cart.wxml @@ -14,7 +14,13 @@ + + + 使用优惠券 + + + diff --git a/pages/cart/cart.wxss b/pages/cart/cart.wxss index 8658d4f..cd431ed 100644 --- a/pages/cart/cart.wxss +++ b/pages/cart/cart.wxss @@ -5,7 +5,6 @@ .address-container { margin: 15rpx; padding-bottom: 10rpx; - border-bottom: 1px solid #e4e4e4; } .receiver { @@ -111,4 +110,9 @@ .quantity input { min-height: 10rpx; height: 50rpx; +} + +.separate { + height: 18rpx; + background-color: #f2f2f2; } \ No newline at end of file diff --git a/pages/cart/coupon.js b/pages/cart/coupon.js new file mode 100644 index 0000000..0e8c5a2 --- /dev/null +++ b/pages/cart/coupon.js @@ -0,0 +1,26 @@ +Page({ + data: { + + }, + + onShow: function() { + }, + + onLoad: function() { + this.getCoupon() + }, + + getCoupon: function() { + wx.request({ + url: `${getApp().globalData.API_URL}/coupons`, + data: {}, + method: 'GET', + success: function(res){ + }, + fail: function() { + }, + complete: function() { + } + }) + } +}) \ No newline at end of file diff --git a/pages/cart/coupon.json b/pages/cart/coupon.json new file mode 100644 index 0000000..08f4c91 --- /dev/null +++ b/pages/cart/coupon.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "我的优惠券" +} \ No newline at end of file diff --git a/pages/cart/coupon.wxml b/pages/cart/coupon.wxml new file mode 100644 index 0000000..e69de29 diff --git a/pages/cart/coupon.wxss b/pages/cart/coupon.wxss new file mode 100644 index 0000000..e69de29