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

View File

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

View File

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

View File

@ -52,33 +52,35 @@
}
.goods-popup .goods-buy-number {
margin-bottom: 20rpx;
position: relative;
height: 70rpx;
}
.goods-popup .goods-buy-number .title {
line-height: 60rpx;
}
.goods-popup .number-content button
{
background: #eee;
height: 64rpx;
line-height: 64rpx;
font-weight: bold;
color: #666;
}
.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 {
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
{
border: 1px solid #ddd;
padding: 0;
vertical-align: middle;
height: 60rpx;
line-height: 60rpx;
}
.goods-detail-app .content-items view {

View File

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

View File

@ -11,11 +11,15 @@
<view class="tips">{{common_shop_notice}}</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}}">
@ -62,5 +66,7 @@
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
<!-- 版权 -->
<import src="/pages/common/copyright.axml" />
<template is="copyright"></template>
<view a:if="{{load_status == 1}}">
<import src="/pages/common/copyright.axml" />
<template is="copyright"></template>
</view>

View File

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