diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 1cd41b438916e66c0ca5e998391e3ca45bb7ce40..ce5e97242eb491fd239d37b917dadbce0272dd84 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -306,6 +306,8 @@ class User extends Common $result['openid'] = $result['data']['openid']; $result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0; return UserService::AuthUserProgram($result, 'baidu_openid'); + } else { + return DataReturn($result['msg'], -1); } } else { return DataReturn('授权成功', 0, $user); diff --git a/application/service/BuyService.php b/application/service/BuyService.php index 6607a5ba1c1617fae9849b5e7e7ddb48ed677b19..074ed557cbdfdb7ed879674a44ae66d806307d9b 100755 --- a/application/service/BuyService.php +++ b/application/service/BuyService.php @@ -1305,7 +1305,7 @@ class BuyService } /** - * 库存校验 + * 订单支付前校验 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 @@ -1313,7 +1313,7 @@ class BuyService * @desc description * @param [array] $params [输入参数] */ - public static function OrderInventoryCheck($params = []) + public static function OrderPayBeginCheck($params = []) { // 请求参数 $p = [ @@ -1352,7 +1352,20 @@ class BuyService { foreach($order_detail as $v) { - $goods = Db::name('Goods')->field('is_deduction_inventory,inventory,title')->find($v['goods_id']); + // 获取商品 + $goods = Db::name('Goods')->field('is_shelves,is_deduction_inventory,inventory,title')->find($v['goods_id']); + if(empty($goods)) + { + return DataReturn('商品不存在', -10); + } + + // 商品状态 + if($goods['is_shelves'] != 1) + { + return DataReturn('商品已下架['.$goods['title'].']', -10); + } + + // 库存 if(isset($goods['is_deduction_inventory']) && $goods['is_deduction_inventory'] == 1) { // 先判断商品库存是否不足 diff --git a/application/service/OrderService.php b/application/service/OrderService.php index 9b665c5217f15a4cfcb54392801a28537279a337..198091bd721344ef8f4913ebe569ab8bdcb0d672 100755 --- a/application/service/OrderService.php +++ b/application/service/OrderService.php @@ -72,8 +72,8 @@ class OrderService return DataReturn('状态不可操作['.$status_text.']', -1); } - // 库存校验 - $ret = BuyService::OrderInventoryCheck(['order_id'=>$order['id'], 'order_data'=>$order]); + // 订单支付前校验 + $ret = BuyService::OrderPayBeginCheck(['order_id'=>$order['id'], 'order_data'=>$order]); if($ret['code'] != 0) { return $ret; @@ -263,8 +263,8 @@ class OrderService return DataReturn('状态不可操作['.$status_text.']', -1); } - // 库存校验 - $ret = BuyService::OrderInventoryCheck(['order_id'=>$order['id'], 'order_data'=>$order]); + // 订单支付前校验 + $ret = BuyService::OrderPayBeginCheck(['order_id'=>$order['id'], 'order_data'=>$order]); if($ret['code'] != 0) { return $ret; diff --git a/extend/base/BaiduAuth.php b/extend/base/BaiduAuth.php index 93347db79aaa74b5f62cfcf5b397e4ce6dcdc134..28e1019143552e4ee8dfea4da6ebbc3064fc6ffc 100755 --- a/extend/base/BaiduAuth.php +++ b/extend/base/BaiduAuth.php @@ -79,6 +79,10 @@ class BaiduAuth if (function_exists("openssl_decrypt")) { $plaintext = openssl_decrypt($encrypted_data, "AES-192-CBC", $session_key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv); } else { + if(!function_exists('mcrypt_module_open')) + { + return ['status'=>-1, 'msg'=>'mcrypt_module_open方法不支持']; + } $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, null, MCRYPT_MODE_CBC, null); mcrypt_generic_init($td, $session_key, $iv); $plaintext = mdecrypt_generic($td, $encrypted_data); diff --git a/public/appmini/old/alipay/app.js b/public/appmini/old/alipay/app.js index 92b5b6f8d7d0f501d09891bcba0c9c9e7fa8fe04..1985c5fe8df36e3e0d53c458e790db991b71d8fa 100644 --- a/public/appmini/old/alipay/app.js +++ b/public/appmini/old/alipay/app.js @@ -721,8 +721,8 @@ App({ set_nav_bg_color_main() { // 窗口和下拉顶部背景色 my.setBackgroundColor({ - backgroundColor: '#d2364c', backgroundColorTop: '#d2364c', + backgroundColorBottom: '#f5f5f5', }); // 下拉文字颜色 diff --git a/public/appmini/old/alipay/app.json b/public/appmini/old/alipay/app.json index 6ae2b52fe03f351b7e15e65e02d3c245595ec6a5..1650530e848f90e471d8353b3dc8cfb53beea1ae 100644 --- a/public/appmini/old/alipay/app.json +++ b/public/appmini/old/alipay/app.json @@ -32,7 +32,8 @@ ], "window": { "defaultTitle": "shopxo", - "titleBarColor": "#d2364c" + "titleBarColor": "#d2364c", + "backgroundColor": "#f5f5f5" }, "tabBar": { "textColor": "#8a8a8a", diff --git a/public/appmini/old/baidu/app.js b/public/appmini/old/baidu/app.js index b9fe4369f985dbf70d073bf66d05ac021d529b72..60fdef700b8828ff4ce52aef22e7d7982e0bb2dd 100755 --- a/public/appmini/old/baidu/app.js +++ b/public/appmini/old/baidu/app.js @@ -62,8 +62,8 @@ App({ // 请求地址 request_url: "{{request_url}}", - // request_url: 'http://tp5-dev.com/', - // request_url: 'https://dev.shopxo.net/', + request_url: 'http://shopxo.com/', + request_url: 'https://dev.shopxo.net/', // 基础信息 application_title: "{{application_title}}", @@ -623,4 +623,38 @@ App({ return true; }, + /** + * 设置导航reddot + * index tabBar 的哪一项,从左边算起(0开始) + * type 0 移出, 1 添加 (默认 0 移出) + */ + set_tab_bar_reddot(index, type) { + if (index !== undefined && index !== null) + { + if ((type || 0) == 0) + { + swan.hideTabBarRedDot({ index: Number(index) }); + } else { + swan.showTabBarRedDot({ index: Number(index) }); + } + } + }, + + /** + * 设置导航车badge + * index tabBar 的哪一项,从左边算起(0开始) + * type 0 移出, 1 添加 (默认 0 移出) + * value 显示的文本,超过 4 个字符则显示成 ...(type参数为1的情况下有效) + */ + set_tab_bar_badge(index, type, value) { + if (index !== undefined && index !== null) + { + if ((type || 0) == 0) { + swan.removeTabBarBadge({ index: Number(index) }); + } else { + swan.setTabBarBadge({ index: Number(index), "text": value.toString() }); + } + } + }, + }); \ No newline at end of file diff --git a/public/appmini/old/baidu/app.json b/public/appmini/old/baidu/app.json index 27be7a63bb428d4c7704547f010bf410f6a59673..9270d59fc3a9a645bcbc45d73d42ea9a2311c49d 100755 --- a/public/appmini/old/baidu/app.json +++ b/public/appmini/old/baidu/app.json @@ -32,7 +32,9 @@ ], "window": { "navigationBarTitleText": "{{application_title}}", - "navigationBarBackgroundColor": "#d2364c" + "navigationBarBackgroundColor": "#d2364c", + "backgroundColor": "#f5f5f5", + "backgroundColorBottom": "#f5f5f5" }, "tabBar": { "color": "#8a8a8a", diff --git a/public/appmini/old/baidu/pages/cart/cart.js b/public/appmini/old/baidu/pages/cart/cart.js index 4f27d9095b9b75e95f6060ac73962edcd016757e..14f9f79b42e45b317b797d4f2405549a66f0781a 100755 --- a/public/appmini/old/baidu/pages/cart/cart.js +++ b/public/appmini/old/baidu/pages/cart/cart.js @@ -89,6 +89,14 @@ Page({ common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询', customer_service_tel: data.customer_service_tel || null, }); + + // 导航购物车处理 + var cart_total = data.common_cart_total || 0; + if (cart_total <= 0) { + app.set_tab_bar_badge(2, 0); + } else { + app.set_tab_bar_badge(2, 1, cart_total); + } } else { this.setData({ data_list_loding_status: 2, @@ -260,6 +268,14 @@ Page({ data_list_loding_status: temp_data_list.length == 0 ? 0 : this.data.data_list_loding_status }); + // 导航购物车处理 + var cart_total = res.data.data || 0; + if (cart_total <= 0) { + app.set_tab_bar_badge(2, 0); + } else { + app.set_tab_bar_badge(2, 1, cart_total); + } + app.showToast(type == 'delete' ? '删除成功' : '收藏成功', 'success'); } else { if (app.is_login_check(res.data)) { diff --git a/public/appmini/old/baidu/pages/index/index.js b/public/appmini/old/baidu/pages/index/index.js index ba1a564d81d523263ba6980c45c32b09cf620da6..9f43758ff5e5ab539e20af221aeec304e6143ab9 100755 --- a/public/appmini/old/baidu/pages/index/index.js +++ b/public/appmini/old/baidu/pages/index/index.js @@ -61,6 +61,15 @@ Page({ plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null }); + // 导航购物车处理 + var cart_total = data.common_cart_total || 0; + if (cart_total <= 0) + { + app.set_tab_bar_badge(2, 0); + } else { + app.set_tab_bar_badge(2, 1, cart_total); + } + // 限时秒杀倒计时 if (this.data.common_app_is_limitedtimediscount == 1 && this.data.plugins_limitedtimediscount_data != null) { this.plugins_limitedtimediscount_countdown(); diff --git a/public/appmini/old/baidu/pages/index/index.json b/public/appmini/old/baidu/pages/index/index.json index b3298e1be52467e9f0c4653c7512cbaa836e2660..facc6d737b32c9439c56f9fc67546cc697d777db 100755 --- a/public/appmini/old/baidu/pages/index/index.json +++ b/public/appmini/old/baidu/pages/index/index.json @@ -1,5 +1,7 @@ { "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#d2364c", + "backgroundColorTop": "#d2364c", "usingComponents": { "component-icon-nav": "/components/icon-nav/icon-nav", "component-banner": "/components/slider/slider" diff --git a/public/appmini/old/baidu/pages/user/user.js b/public/appmini/old/baidu/pages/user/user.js index d0b4e2298d9214b830e59cfab5b2661026468079..538fdf7ea59b60e4c9e87572e3d0c9688b638be3 100755 --- a/public/appmini/old/baidu/pages/user/user.js +++ b/public/appmini/old/baidu/pages/user/user.js @@ -112,6 +112,14 @@ Page({ common_app_is_online_service: data.common_app_is_online_service || 0, common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0, }); + + // 导航购物车处理 + var cart_total = data.common_cart_total || 0; + if (cart_total <= 0) { + app.set_tab_bar_badge(2, 0); + } else { + app.set_tab_bar_badge(2, 1, cart_total); + } } else { if(app.is_login_check(res.data, this, 'get_data')) { diff --git a/public/appmini/old/baidu/pages/user/user.json b/public/appmini/old/baidu/pages/user/user.json index 1e8b450ba5f16abdec108440b5bbd7493fdb3218..daa19778df6158872be9c88864a7eab4c315d028 100755 --- a/public/appmini/old/baidu/pages/user/user.json +++ b/public/appmini/old/baidu/pages/user/user.json @@ -1,6 +1,8 @@ { - "enablePullDownRefresh": true, - "usingComponents": { - "component-badge": "/components/badge/badge" - } + "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#d2364c", + "backgroundColorTop": "#d2364c", + "usingComponents": { + "component-badge": "/components/badge/badge" + } } \ No newline at end of file diff --git a/public/appmini/old/weixin/app.js b/public/appmini/old/weixin/app.js index 77ee670da4ce830a7025857bc07eb30ef918027a..01ef8f136b3619a4e1b13e8871bd9a059029689a 100755 --- a/public/appmini/old/weixin/app.js +++ b/public/appmini/old/weixin/app.js @@ -71,7 +71,7 @@ App({ // 请求地址 request_url: "{{request_url}}", request_url: 'http://shopxo.com/', - // request_url: 'https://dev.shopxo.net/', + request_url: 'https://dev.shopxo.net/', // 基础信息 application_title: "{{application_title}}", diff --git a/public/appmini/old/weixin/app.json b/public/appmini/old/weixin/app.json index 9cf18dae1cef2e339bc32566a777a9798fcba861..01dcc5b145b3988a7c9b7470c314232d03821f53 100755 --- a/public/appmini/old/weixin/app.json +++ b/public/appmini/old/weixin/app.json @@ -1,6 +1,6 @@ { "pages": [ - "pages/plugins/membershiplevelvip/order/order", + "pages/index/index", "pages/goods-category/goods-category", "pages/cart/cart", @@ -36,7 +36,9 @@ ], "window": { "navigationBarTitleText": "{{application_title}}", - "navigationBarBackgroundColor": "#d2364c" + "navigationBarBackgroundColor": "#d2364c", + "backgroundColor": "#f5f5f5", + "backgroundColorBottom": "#f5f5f5" }, "tabBar": { "color": "#8a8a8a", diff --git a/public/appmini/old/weixin/pages/index/index.json b/public/appmini/old/weixin/pages/index/index.json index d98684c7d1855bac6b220aff712466e4c35225a0..facc6d737b32c9439c56f9fc67546cc697d777db 100755 --- a/public/appmini/old/weixin/pages/index/index.json +++ b/public/appmini/old/weixin/pages/index/index.json @@ -1,7 +1,7 @@ { "enablePullDownRefresh": true, "navigationBarBackgroundColor": "#d2364c", - "backgroundColor": "#d2364c", + "backgroundColorTop": "#d2364c", "usingComponents": { "component-icon-nav": "/components/icon-nav/icon-nav", "component-banner": "/components/slider/slider" diff --git a/public/appmini/old/weixin/pages/plugins/membershiplevelvip/user/user.json b/public/appmini/old/weixin/pages/plugins/membershiplevelvip/user/user.json index d7bf94c8dc69911ea61675b46c11c24b6e6ffad6..13fbbe2524f7df6dfb8051e8380db322bf51b86e 100644 --- a/public/appmini/old/weixin/pages/plugins/membershiplevelvip/user/user.json +++ b/public/appmini/old/weixin/pages/plugins/membershiplevelvip/user/user.json @@ -1,5 +1,5 @@ { "enablePullDownRefresh": true, "navigationBarBackgroundColor": "#1d1611", - "backgroundColor": "#1d1611" + "backgroundColorTop": "#1d1611" } \ No newline at end of file