小程序自提地址选择 bug 修复

feat/task1-c-wallet
devil 2020-02-21 13:02:31 +08:00
parent 90b78135dd
commit 389aa7dd4c
7 changed files with 47 additions and 8 deletions

View File

@ -117,6 +117,9 @@ class Site extends Common
*/
public function Save()
{
// 参数
$params = $_POST;
// 导航
$nav_type = input('nav_type', 'base');
@ -150,6 +153,25 @@ class Site extends Common
case 'imagesverify' :
$field_list[] = 'common_images_verify_rules';
break;
// 站点类型
case 'sitetype' :
// 自提地址处理
if(!empty($params['common_self_extraction_address']))
{
if(!is_array($params['common_self_extraction_address']))
{
$address = json_decode($params['common_self_extraction_address'], true);
} else {
$address = $params['common_self_extraction_address'];
}
foreach($address as $k=>$v)
{
$address[$k]['id'] = $k;
}
$params['common_self_extraction_address'] = json_encode($address, JSON_UNESCAPED_UNICODE);
}
break;
}
// 开始处理空值
@ -157,15 +179,15 @@ class Site extends Common
{
foreach($field_list as $field)
{
if(!isset($_POST[$field]))
if(!isset($params[$field]))
{
$_POST[$field] = '';
$params[$field] = '';
}
}
}
// 基础配置
$ret = ConfigService::ConfigSave($_POST);
$ret = ConfigService::ConfigSave($params);
// 清除缓存
if($ret['code'] == 0)

View File

@ -32,5 +32,21 @@ return array (
'log_write' =>
array (
),
'plugins_service_users_center_left_menu_handle' =>
array (
0 => 'app\\plugins\\excellentbuyreturntocash\\Hook',
),
'plugins_service_header_navigation_top_right_handle' =>
array (
0 => 'app\\plugins\\excellentbuyreturntocash\\Hook',
),
'plugins_service_buy_order_insert_end' =>
array (
0 => 'app\\plugins\\excellentbuyreturntocash\\Hook',
),
'plugins_service_order_status_change_history_success_handle' =>
array (
0 => 'app\\plugins\\excellentbuyreturntocash\\Hook',
),
);
?>

View File

@ -135,7 +135,7 @@ Page({
// 地址
this.setData({
address: data.base.address || null,
address_id: ((data.base.address || null) != null && (data.base.address.id || null) != null) ? data.base.address.id : null,
address_id: ((data.base.address || null) != null) ? data.base.address.id : null,
});
my.setStorage({
key: app.data.cache_buy_user_address_select_key,

View File

@ -116,7 +116,7 @@ Page({
// 地址
this.setData({
address: data.base.address || null,
address_id: (data.base.address || null) != null && (data.base.address.id || null) != null ? data.base.address.id : null
address_id: ((data.base.address || null) != null) ? data.base.address.id : null
});
swan.setStorage({
key: app.data.cache_buy_user_address_select_key,

View File

@ -122,7 +122,7 @@ Page({
// 地址
this.setData({
address: data.base.address || null,
address_id: ((data.base.address || null) != null && (data.base.address.id || null) != null) ? data.base.address.id : null,
address_id: ((data.base.address || null) != null) ? data.base.address.id : null,
});
qq.setStorage({
key: app.data.cache_buy_user_address_select_key,

View File

@ -122,7 +122,7 @@ Page({
// 地址
this.setData({
address: data.base.address || null,
address_id: ((data.base.address || null) != null && (data.base.address.id || null) != null) ? data.base.address.id : null,
address_id: ((data.base.address || null) != null) ? data.base.address.id : null,
});
tt.setStorage({
key: app.data.cache_buy_user_address_select_key,

View File

@ -122,7 +122,7 @@ Page({
// 地址
this.setData({
address: data.base.address || null,
address_id: ((data.base.address || null) != null && (data.base.address.id || null) != null) ? data.base.address.id : null,
address_id: ((data.base.address || null) != null) ? data.base.address.id : null,
});
wx.setStorage({
key: app.data.cache_buy_user_address_select_key,
@ -184,6 +184,7 @@ Page({
if (this.data.common_order_is_booking != 1) {
validation.push({ fields: 'payment_id', msg: '请选择支付方式' });
}
if (app.fields_check(data, validation)) {
// 加载loding
wx.showLoading({title: '提交中...'});