小程序购买数量限制逻辑优化,地址编辑优化
parent
9a43e9234e
commit
dcd975f271
|
|
@ -82,7 +82,7 @@ Page({
|
|||
goods_photo: data.goods.photo,
|
||||
goods_specifications_choose: data.goods.specifications.choose || [],
|
||||
goods_content_app: data.goods.content_app,
|
||||
temp_buy_number: (data.goods.buy_min_number) || 1,
|
||||
temp_buy_number: data.goods.buy_min_number || 1,
|
||||
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
|
||||
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
|
||||
nav_submit_text: ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约',
|
||||
|
|
@ -328,7 +328,7 @@ Page({
|
|||
}
|
||||
}
|
||||
}
|
||||
this.setData({goods_specifications_choose: temp_data, goods_spec_base_images: temp_images});
|
||||
this.setData({goods_specifications_choose: temp_data, goods_spec_base_images: temp_images, temp_buy_number: 1});
|
||||
|
||||
// 不能选择规格处理
|
||||
this.goods_specifications_choose_handle_dont(key);
|
||||
|
|
@ -510,7 +510,7 @@ Page({
|
|||
goods_buy_number_func(buy_number) {
|
||||
var buy_min_number = parseInt(this.data.goods.buy_min_number) || 1;
|
||||
var buy_max_number = parseInt(this.data.goods.buy_max_number) || 0;
|
||||
var inventory = parseInt(this.data.goods.goods_spec_base_inventory);
|
||||
var inventory = parseInt(this.data.goods_spec_base_inventory);
|
||||
var inventory_unit = this.data.goods.inventory_unit;
|
||||
if(buy_number < buy_min_number)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ Page({
|
|||
province_id: null,
|
||||
city_id: null,
|
||||
county_id: null,
|
||||
is_default: 0,
|
||||
|
||||
default_province: "请选择省",
|
||||
default_city: "请选择市",
|
||||
|
|
@ -74,7 +75,8 @@ Page({
|
|||
address: data.address,
|
||||
province_id: data.province,
|
||||
city_id: data.city,
|
||||
county_id: data.county
|
||||
county_id: data.county,
|
||||
is_default: data.is_default || 0,
|
||||
});
|
||||
|
||||
self.get_city_list();
|
||||
|
|
@ -276,6 +278,7 @@ Page({
|
|||
form_data["city"] = data.city_id;
|
||||
form_data["county"] = data.county_id;
|
||||
form_data["id"] = self.data.params.id || 0;
|
||||
form_data["is_default"] = self.data.is_default || 0;
|
||||
|
||||
if (app.fields_check(form_data, validation)) {
|
||||
// 加载loding
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@
|
|||
<text class="cr-666">{{item.add_time}}</text>
|
||||
<text class="fr cr-main">{{item.status_name}}</text>
|
||||
</view>
|
||||
<navigator url="/pages/user-order-detail/user-order-detail?id={{item.id}}" hover-class="none">
|
||||
<view a:for="{{item.items}}" a:for-item="detail" class="goods-item oh">
|
||||
<view a:for="{{item.items}}" a:for-item="detail" class="goods-item oh">
|
||||
<navigator url="/pages/user-order-detail/user-order-detail?id={{item.id}}" hover-class="none">
|
||||
<image class="goods-image fl" src="{{detail.images}}" mode="aspectFill" />
|
||||
<view class="goods-base">
|
||||
<view class="goods-title multi-text" >{{detail.title}}</view>
|
||||
|
|
@ -30,29 +30,30 @@
|
|||
<text a:if="{{detail.original_price > 0}}" class="original-price">¥{{detail.original_price}}</text>
|
||||
<text class="buy-number">x{{detail.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="item-describe tr cr-666">{{item.describe}}
|
||||
</view>
|
||||
<view a:if="{{item.status <= 3}}" class="item-operation tr br-t">
|
||||
<button a:if="{{item.status <= 1}}" class="submit-cancel" type="default" size="mini" onTap="cancel_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">取消
|
||||
</button>
|
||||
<button a:if="{{item.status == 1}}" class="submit-pay cr-666" type="default" size="mini" onTap="pay_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">支付
|
||||
</button>
|
||||
<button a:if="{{item.status == 2}}" class="submit-rush cr-666" type="default" size="mini" onTap="rush_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">催催
|
||||
</button>
|
||||
<button a:if="{{item.status == 3}}" class="submit-success cr-666" type="default" size="mini" onTap="collect_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">收货
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view a:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.axml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}">
|
||||
</template>
|
||||
</navigator>
|
||||
<view class="item-describe tr cr-666">{{item.describe}}</view>
|
||||
<view a:if="{{item.status <= 3}}" class="item-operation tr br-t">
|
||||
<button a:if="{{item.status <= 1}}" class="submit-cancel" type="default" size="mini" onTap="cancel_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">取消
|
||||
</button>
|
||||
<button a:if="{{item.status == 1}}" class="submit-pay cr-666" type="default" size="mini" onTap="pay_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">支付
|
||||
</button>
|
||||
<button a:if="{{item.status == 2}}" class="submit-rush cr-666" type="default" size="mini" onTap="rush_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">催催
|
||||
</button>
|
||||
<button a:if="{{item.status == 3}}" class="submit-success cr-666" type="default" size="mini" onTap="collect_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">收货
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view a:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.axml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}">
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<import src="/pages/common/bottom_line.axml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}">
|
||||
</template>
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 支付方式 popup -->
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ Page({
|
|||
goods_photo: data.goods.photo,
|
||||
goods_specifications_choose: data.goods.specifications.choose || [],
|
||||
goods_content_app: data.goods.content_app,
|
||||
temp_buy_number: (data.goods.buy_min_number) || 1,
|
||||
temp_buy_number: data.goods.buy_min_number || 1,
|
||||
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
|
||||
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
|
||||
nav_submit_text: ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约',
|
||||
|
|
@ -303,7 +303,7 @@ Page({
|
|||
}
|
||||
}
|
||||
}
|
||||
this.setData({goods_specifications_choose: temp_data, goods_spec_base_images: temp_images});
|
||||
this.setData({ goods_specifications_choose: temp_data, goods_spec_base_images: temp_images, temp_buy_number: 1});
|
||||
|
||||
// 不能选择规格处理
|
||||
this.goods_specifications_choose_handle_dont(key);
|
||||
|
|
@ -473,14 +473,14 @@ Page({
|
|||
goods_buy_number_func(buy_number) {
|
||||
var buy_min_number = parseInt(this.data.goods.buy_min_number) || 1;
|
||||
var buy_max_number = parseInt(this.data.goods.buy_max_number) || 0;
|
||||
var inventory = parseInt(this.data.goods.goods_spec_base_inventory);
|
||||
var inventory = parseInt(this.data.goods_spec_base_inventory);
|
||||
var inventory_unit = this.data.goods.inventory_unit;
|
||||
if(buy_number < buy_min_number)
|
||||
{
|
||||
buy_number = buy_min_number;
|
||||
if(buy_min_number > 1)
|
||||
{
|
||||
app.showToast( '起购'+buy_min_number+inventory_unit);
|
||||
app.showToast('起购'+buy_min_number+inventory_unit);
|
||||
}
|
||||
}
|
||||
if(buy_max_number > 0 && buy_number > buy_max_number)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ Page({
|
|||
province_id: null,
|
||||
city_id: null,
|
||||
county_id: null,
|
||||
is_default: 0,
|
||||
|
||||
default_province: "请选择省",
|
||||
default_city: "请选择市",
|
||||
|
|
@ -77,7 +78,8 @@ Page({
|
|||
address: data.address,
|
||||
province_id: data.province,
|
||||
city_id: data.city,
|
||||
county_id: data.county
|
||||
county_id: data.county,
|
||||
is_default: data.is_default || 0,
|
||||
});
|
||||
|
||||
self.get_city_list();
|
||||
|
|
@ -258,6 +260,7 @@ Page({
|
|||
form_data["city"] = data.city_id;
|
||||
form_data["county"] = data.county_id;
|
||||
form_data["id"] = self.data.params.id || 0;
|
||||
form_data["is_default"] = self.data.is_default || 0;
|
||||
|
||||
if (app.fields_check(form_data, validation)) {
|
||||
// 加载loding
|
||||
|
|
|
|||
|
|
@ -43,13 +43,15 @@
|
|||
<button wx:if="{{item.status == 3}}" class="submit-success cr-666 br" type="default" size="mini" bindtap="collect_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">收货
|
||||
</button>
|
||||
</view>
|
||||
<view wx:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}">
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}">
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
|
|
|
|||
Loading…
Reference in New Issue