购买数量样式

wechat_user_type
Ge Hao 7 years ago
parent f998471164
commit dbf7b1d1b7
  1. 5
      app.wxss
  2. 2
      pages/cart/cart.js
  3. 6
      pages/cart/cart.wxml
  4. 14
      pages/cart/cart.wxss
  5. 8
      pages/show_product/show_product.js
  6. 8
      pages/show_product/show_product.wxml
  7. 27
      pages/show_product/show_product.wxss

@ -1,3 +1,8 @@
page {
background-color: white;
}
.separate {
height: 18rpx;
background-color: #f2f2f2;
}

@ -89,7 +89,7 @@ Page({
wx.showModal({
title: '删除商品',
content: '是否要删除购物车中的这件商品?',
content: '是否要删除购这件商品?',
confirmText: '删除',
cancelText: '别删',
success: function(res) {

@ -14,6 +14,7 @@
<view wx:else bindtap="bindTapAddress">
<button class="button" type='primary'>填写收货地址</button>
</view>
<view class="separate"></view>
<view wx:if="{{ coupon }}">
@ -30,6 +31,7 @@
</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}}">
@ -65,9 +67,9 @@
<view class="billing-btn">
<view wx:if="{{coupon}}">
<view>总计:¥{{amount}}元 {{'-' + coupon['coupon-value'] + '元优惠券' }}</view>
<view class="total">总计:¥{{amount}}元 {{'-' + coupon['coupon-value'] + '元优惠券' }}</view>
</view>
<view wx:else>
<view wx:else class="total">
<view>总计:¥{{amount}}元</view>
</view>
<button class="button" type='warn' bindtap="bindBilling"> 去支付 </button>

@ -114,23 +114,21 @@
width: 100%;
}
.billing-btn .total {
background-color: #eee;
}
.billing-btn .button {
border-radius: 0;
}
.billing-btn view {
padding-top: 15rpx;
padding-bottom: 15rpx;
padding-top: 10rpx;
padding-bottom: 10rpx;
padding-left: 15rpx;
background-color: white;
font-size: 30rpx;
}
.separate {
height: 18rpx;
background-color: #f2f2f2;
}
.use-coupon {
font-size: 33rpx;
line-height: 70rpx;

@ -81,7 +81,7 @@ Page({
} else {
cartItems.push({
id: this.data.id,
quantity: this.data.quantity,
quantity: 1,
product: this.data.product
})
}
@ -94,9 +94,5 @@ Page({
key: 'cartItems',
data: cartItems
})
},
bindQuantityInput (e) {
this.setData({'quantity': e.detail.value})
},
}
})

@ -10,16 +10,12 @@
<view class="line">
<view class="section price">
<view wx:if="{{ accountType === '巴爷' }}">
<text id="price">¥{{product['baye-price']}}</text>
<text id="price">巴爷价:¥{{product['baye-price']}}</text>
</view>
<view wx:else>
<text id="price">¥{{product['member-price']}}</text>
</view>
</view>
<view class="section quantity">
<view>购买数量:</view>
<input id="quantity" name="quantity" bindinput="bindQuantityInput" value="1" />
</view>
</view>
<view class="btn-area">
<button bindtap="bindAddToCart" type="primary">加入购物车</button>
@ -27,6 +23,8 @@
</form>
</view>
<view class="separate"></view>
<view class="desc-container">
<block wx:for="{{product.desc}}" wx:for-item="desc" wx:key="id">
<image class="desc-image" src="{{desc[0]}}" style="height: {{desc[2] / desc[1] * windowWidth}}px;" mode="aspectFit"/>

@ -1,5 +1,6 @@
.head-img {
width: 100%;
width: 750rpx;
height: 750rpx;
}
.line {
@ -9,25 +10,10 @@
padding: 10rpx 20rpx 0 20rpx;
}
.quantity {
width: 50%;
display: flex;
align-items: center;
justify-content: flex-end;
margin-left: auto;
margin: 20rpx;
font-size: 30rpx;
}
#quantity {
width: 80rpx;
border: 1rpx solid lightgrey;
}
.price {
margin-left: 20rpx;
width: 50%;
margin-right: auto;
margin-top: 40rpx;
margin-bottom: 50rpx;
text-align: center;
}
#price {
@ -44,7 +30,7 @@
text-align: center;
font-size: 32rpx;
line-height: 48rpx;
padding: 5rpx 20rpx 0 20rpx;
padding: 0 75rpx 0 75rpx;
}
.btn-area {
@ -55,7 +41,6 @@
.desc-container {
border-top: 1rpx solid lightgrey;
margin-top: 40rpx;
margin-bottom: 90rpx;
}

Loading…
Cancel
Save