This commit is contained in:
devil_gong 2018-11-27 10:47:20 +08:00
parent d8eeac2c12
commit dcc9cf30ae
7 changed files with 67 additions and 55 deletions

View File

@ -87,11 +87,12 @@ Page({
this.setData({ this.setData({
goods_list: data.goods_list, goods_list: data.goods_list,
total_price: data.base.total_price, total_price: data.base.total_price,
payment_list: data.payment_list || [],
extension_list: data.extension_list || [], extension_list: data.extension_list || [],
data_list_loding_status: 3, data_list_loding_status: 3,
common_order_is_booking: data.common_order_is_booking || 0, common_order_is_booking: data.common_order_is_booking || 0,
}); });
// 地址
if (this.data.address == null || this.data.address_id == 0) { if (this.data.address == null || this.data.address_id == 0) {
if((data.base.address || null) != null) { if((data.base.address || null) != null) {
this.setData({ this.setData({
@ -100,6 +101,9 @@ Page({
}); });
} }
} }
// 支付方式
this.payment_list_data(data.payment_list);
} }
} else { } else {
this.setData({ this.setData({
@ -190,19 +194,22 @@ Page({
// 支付方式选择 // 支付方式选择
payment_event(e) { payment_event(e) {
var payment_id = e.currentTarget.dataset.value || 0; this.setData({ payment_id: e.target.dataset.value});
var temp_payment_list = this.data.payment_list; this.payment_list_data(this.data.payment_list);
for(var i in temp_payment_list) { },
if(temp_payment_list[i]['id'] == payment_id) {
temp_payment_list[i]['selected'] = 'selected'; // 支付方式数据处理
} else { payment_list_data(data) {
temp_payment_list[i]['selected'] = ''; if (this.data.payment_id != 0) {
for (var i in data) {
if (data[i]['id'] == this.data.payment_id) {
data[i]['selected'] = 'selected';
} else {
data[i]['selected'] = '';
}
} }
} }
this.setData({ this.setData({payment_list: data || []});
payment_id: payment_id,
payment_list: temp_payment_list
});
} }
}); });

View File

@ -45,27 +45,25 @@
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
top: 100rpx; top: 100rpx;
}
.number-content button
{
background: #eee; background: #eee;
height: 64rpx; border-radius: 2px;
line-height: 64rpx; border: 1px solid #eee;
}
.number-content .number-submit
{
width: 80rpx;
font-weight: bold; font-weight: bold;
color: #666;
} }
.number-content input { .number-content input {
width: 50px; width: 50px;
margin: 2rpx 10rpx 0 10rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 2px;
} }
.number-content button, .number-content .number-submit,
.number-content input .number-content input
{ {
border: 1px solid #ddd;
padding: 0; padding: 0;
vertical-align: middle;
height: 60rpx;
line-height: 60rpx;
} }
/** /**

View File

@ -22,10 +22,10 @@
</block> </block>
</view> </view>
<!-- 数量 --> <!-- 数量 -->
<view class="number-content fr tr"> <view class="number-content tc oh">
<button type="default" size="mini" catchTap="goods_buy_number_event" data-index="{{index}}" data-type="0" hover-class="none">﹣</button> <view onTap="goods_buy_number_event" class="number-submit tc cr-888 fl" data-index="{{index}}" data-type="0">-</view>
<input onBlur="goods_buy_number_blur" class="tc cr-888" type="number" value="{{item.stock}}" data-index="{{index}}" /> <input onBlur="goods_buy_number_blur" class="tc cr-888 fl" type="number" value="{{item.stock}}" data-index="{{index}}" />
<button type="default" size="mini" catchTap="goods_buy_number_event" data-index="{{index}}" data-type="1" hover-class="none"></button> <view onTap="goods_buy_number_event" class="number-submit tc cr-888 fl" data-index="{{index}}" data-type="1">+</view>
</view> </view>
<!-- 价格 --> <!-- 价格 -->

View File

@ -52,33 +52,35 @@
} }
.goods-popup .goods-buy-number { .goods-popup .goods-buy-number {
margin-bottom: 20rpx; margin-bottom: 20rpx;
position: relative;
height: 70rpx;
} }
.goods-popup .goods-buy-number .title { .goods-popup .goods-buy-number .title {
line-height: 60rpx; line-height: 60rpx;
} }
.goods-popup .number-content button
{
background: #eee;
height: 64rpx;
line-height: 64rpx;
font-weight: bold;
color: #666;
}
.goods-popup .number-content { .goods-popup .number-content {
width: calc(100% - 200rpx); position: absolute;
right: 20rpx;
top: 0;
background: #eee;
border-radius: 2px;
border: 1px solid #eee;
}
.goods-popup .number-content .number-submit
{
width: 80rpx;
font-weight: bold;
} }
.goods-popup .number-content input { .goods-popup .number-content input {
width: 50px; width: 50px;
margin: 2rpx 10rpx 0 10rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 2px;
} }
.goods-popup .number-content button, .goods-popup .number-content .number-submit,
.goods-popup .number-content input .goods-popup .number-content input
{ {
border: 1px solid #ddd;
padding: 0; padding: 0;
vertical-align: middle;
height: 60rpx;
line-height: 60rpx;
} }
.goods-detail-app .content-items view { .goods-detail-app .content-items view {

View File

@ -101,10 +101,10 @@
<!-- 购买数量 --> <!-- 购买数量 -->
<view class="goods-buy-number oh"> <view class="goods-buy-number oh">
<view class="title fl">购买数量</view> <view class="title fl">购买数量</view>
<view class="number-content fr tr"> <view class="number-content tc oh">
<button type="default" size="mini" catchTap="goods_buy_number_event" data-type="0" hover-class="none">﹣</button> <view onTap="goods_buy_number_event" class="number-submit tc cr-888 fl" data-type="0">-</view>
<input onBlur="goods_buy_number_blur" class="tc cr-888" type="number" value="{{temp_buy_number}}" /> <input onBlur="goods_buy_number_blur" class="tc cr-888 fl" type="number" value="{{temp_buy_number}}" />
<button type="default" size="mini" catchTap="goods_buy_number_event" data-type="1" hover-class="none"></button> <view onTap="goods_buy_number_event" class="number-submit tc cr-888 fl" data-type="1">+</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -11,11 +11,15 @@
<view class="tips">{{common_shop_notice}}</view> <view class="tips">{{common_shop_notice}}</view>
</view> </view>
<!-- 轮播 --> <!-- 组件 -->
<component-home-banner /> <view a:if="{{load_status == 1}}">
<!-- 轮播 -->
<component-home-banner />
<!-- 导航 -->
<component-home-nav />
</view>
<!-- 导航 -->
<component-home-nav />
<!-- 楼层数据 --> <!-- 楼层数据 -->
<block a:if="{{data_list.length > 0}}"> <block a:if="{{data_list.length > 0}}">
@ -62,5 +66,7 @@
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template> <template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
<!-- 版权 --> <!-- 版权 -->
<import src="/pages/common/copyright.axml" /> <view a:if="{{load_status == 1}}">
<template is="copyright"></template> <import src="/pages/common/copyright.axml" />
<template is="copyright"></template>
</view>

View File

@ -68,5 +68,4 @@
<!-- 版权 --> <!-- 版权 -->
<import src="/pages/common/copyright.axml" /> <import src="/pages/common/copyright.axml" />
<template is="copyright"> <template is="copyright"></template>
</template>