准备添加coupon

wechat_user_type
Ge Hao 8 years ago
parent 6e796a3dc5
commit 95d12a01bb
  1. 1
      app.json
  2. 6
      pages/cart/cart.js
  3. 6
      pages/cart/cart.wxml
  4. 6
      pages/cart/cart.wxss
  5. 26
      pages/cart/coupon.js
  6. 3
      pages/cart/coupon.json
  7. 0
      pages/cart/coupon.wxml
  8. 0
      pages/cart/coupon.wxss

@ -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"

@ -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){

@ -14,7 +14,13 @@
<view wx:else bindtap="bindTapAddress">
<button class="button" type='primary'>填写收货地址</button>
</view>
<view class="separate"></view>
<view bindtap="bindSelectCoupon">
<view><text>使用优惠券</text></view>
</view>
<view class="separate"></view>
<view class="items-container">
<block wx:for="{{cartItems}}" wx:for-item="item" wx:key="id">
<view class="item" data-id="{{item.id}}">

@ -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;
}

@ -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() {
}
})
}
})

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "我的优惠券"
}
Loading…
Cancel
Save