diff --git a/alipay/app.json b/alipay/app.json
index c851a018e..dd26eea6a 100755
--- a/alipay/app.json
+++ b/alipay/app.json
@@ -1,5 +1,5 @@
{
- "pages": [
+ "pages": ["pages/goods-search/goods-search",
"pages/index/index",
"pages/goods-category/goods-category",
"pages/cart/cart",
@@ -8,7 +8,7 @@
"pages/login/login",
"pages/paytips/paytips",
- "pages/goods-search/goods-search",
+
"pages/goods-detail/goods-detail",
"pages/goods-attribute/goods-attribute",
"pages/buy/buy",
diff --git a/alipay/images/search-asc-icon.png b/alipay/images/search-asc-icon.png
new file mode 100644
index 000000000..0b16b29ca
Binary files /dev/null and b/alipay/images/search-asc-icon.png differ
diff --git a/alipay/images/search-default-icon.png b/alipay/images/search-default-icon.png
new file mode 100644
index 000000000..d91a76411
Binary files /dev/null and b/alipay/images/search-default-icon.png differ
diff --git a/alipay/images/search-desc-icon.png b/alipay/images/search-desc-icon.png
new file mode 100644
index 000000000..9e79244e9
Binary files /dev/null and b/alipay/images/search-desc-icon.png differ
diff --git a/alipay/images/search-submit-icon.png b/alipay/images/search-submit-icon.png
new file mode 100644
index 000000000..af5205981
Binary files /dev/null and b/alipay/images/search-submit-icon.png differ
diff --git a/alipay/pages/cart/cart.js b/alipay/pages/cart/cart.js
index 7703c7258..99a3bcbba 100644
--- a/alipay/pages/cart/cart.js
+++ b/alipay/pages/cart/cart.js
@@ -105,15 +105,15 @@ Page({
// 数量输入事件
goods_buy_number_blur(e) {
- var index = e.currentTarget.dataset.index || 0;
+ var index = e.target.dataset.index || 0;
var buy_number = parseInt(e.detail.value) || 1;
this.goods_buy_number_func(index, buy_number);
},
// 数量操作事件
goods_buy_number_event(e) {
- var index = e.currentTarget.dataset.index || 0;
- var type = parseInt(e.currentTarget.dataset.type) || 0;
+ var index = e.target.dataset.index || 0;
+ var type = parseInt(e.target.dataset.type) || 0;
var temp_buy_number = parseInt(this.data.data_list[index]['stock']);
if (type == 0) {
var buy_number = temp_buy_number - 1;
@@ -280,7 +280,7 @@ Page({
// 选中处理
selectedt_event(e) {
- var type = e.currentTarget.dataset.type || null;
+ var type = e.target.dataset.type || null;
if (type != null)
{
var temp_data_list = this.data.data_list;
@@ -296,7 +296,7 @@ Page({
// 节点操作
case 'node' :
- var index = e.currentTarget.dataset.index || 0;
+ var index = e.target.dataset.index || 0;
temp_data_list[index]['selected'] = (temp_data_list[index]['selected'] == true) ? false : true;
break;
}
diff --git a/alipay/pages/goods-search/goods-search.acss b/alipay/pages/goods-search/goods-search.acss
index 840f46a66..789f4205c 100755
--- a/alipay/pages/goods-search/goods-search.acss
+++ b/alipay/pages/goods-search/goods-search.acss
@@ -1,4 +1,6 @@
-/* 商品列表 */
+/**
+ * 商品列表
+ */
.data-list {
overflow: hidden;
}
@@ -25,4 +27,64 @@
.data-list .items .base,
.data-list .items .base .price {
margin-top: 15rpx;
+}
+
+/**
+ * 条件
+ */
+.popup-form {
+ height: calc(100vh - 20rpx);
+ padding: 20rpx 20rpx 0 20rpx;
+}
+.popup-form input {
+ font-size: 24rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ background: #efefef;
+}
+.screening-price input {
+ width: 220rpx;
+}
+.screening-price .separator {
+ margin-top: 20rpx;
+ width: 30rpx;
+}
+.popup-form .keywords input {
+ width: 490rpx;
+}
+.popup-form .item:not(:last-child) {
+ margin-bottom: 50rpx;
+}
+.popup-form .item .title {
+ margin-bottom: 10rpx;
+ font-size: 28rpx;
+}
+.popup-form .form-submit {
+ height: 80rpx;
+ line-height: 80rpx;
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ border-radius: 0;
+}
+
+/**
+ * 排序导航
+ */
+.nav-sort-content .item {
+ height: 60rpx;
+ line-height: 60rpx;
+ width: 160rpx;
+}
+.nav-sort-content .item .icon {
+ width: 30rpx;
+ height: 30rpx;
+ vertical-align: middle;
+}
+.screening-submit {
+ width: 45rpx;
+ height: 45rpx;
+ position: absolute;
+ top: 10rpx;
+ right: 20rpx;
}
\ No newline at end of file
diff --git a/alipay/pages/goods-search/goods-search.axml b/alipay/pages/goods-search/goods-search.axml
index 78b1a04b2..3bae675f3 100755
--- a/alipay/pages/goods-search/goods-search.axml
+++ b/alipay/pages/goods-search/goods-search.axml
@@ -1,3 +1,34 @@
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/alipay/pages/goods-search/goods-search.js b/alipay/pages/goods-search/goods-search.js
index a66800867..9f5dbaaf6 100755
--- a/alipay/pages/goods-search/goods-search.js
+++ b/alipay/pages/goods-search/goods-search.js
@@ -7,10 +7,18 @@ Page({
data_page_total: 0,
data_page: 1,
params: null,
+ post_data: {},
+ is_show_popup_form: false,
+ popup_form_loading_status: false,
+ search_nav_sort_list: [
+ { name: "综合", field: "default", sort: "asc", "icon": null },
+ { name: "销量", field: "sales_count", sort: "asc", "icon": "default" },
+ { name: "价格", field: "price", sort: "asc", "icon": "default" },
+ ],
},
onLoad(params) {
- this.setData({params: params});
+ this.setData({params: params, post_data: params});
this.init();
},
@@ -128,4 +136,52 @@ Page({
scroll_lower(e) {
this.get_data_list();
},
+
+ // 搜索条件
+ form_submit_event(e) {
+ this.setData({ post_data: e.detail.value, data_page: 1});
+ this.popup_form_event_close();
+ this.get_data_list(1);
+ },
+
+ // 筛选条件关闭
+ popup_form_event_close(e) {
+ this.setData({ is_show_popup_form: false});
+ },
+
+ // 筛选条件开启
+ popup_form_event_show(e) {
+ this.setData({ is_show_popup_form: true });
+ },
+
+ // 筛选
+ nav_sort_event(e) {
+ var index = e.target.dataset.index || 0;
+ var temp_post_data = this.data.post_data;
+ var temp_search_nav_sort = this.data.search_nav_sort_list;
+ var temp_sort = (temp_search_nav_sort[index]['sort'] == 'desc') ? 'asc' : 'desc';
+ for (var i in temp_search_nav_sort) {
+ if(i != index) {
+ if (temp_search_nav_sort[i]['icon'] != null) {
+ temp_search_nav_sort[i]['icon'] = 'default';
+ }
+ temp_search_nav_sort[i]['sort'] = 'desc';
+ }
+ }
+
+ temp_search_nav_sort[index]['sort'] = temp_sort;
+ if (temp_search_nav_sort[index]['icon'] != null) {
+ temp_search_nav_sort[index]['icon'] = temp_sort;
+ }
+
+ temp_post_data['order_by_field'] = temp_search_nav_sort[index]['field'];
+ temp_post_data['order_by_type'] = temp_sort;
+
+ this.setData({
+ post_data: temp_post_data,
+ search_nav_sort_list: temp_search_nav_sort,
+ data_page: 1,
+ });
+ this.get_data_list(1);
+ },
});
diff --git a/alipay/pages/goods-search/goods-search.json b/alipay/pages/goods-search/goods-search.json
index c96031fd7..55e2d05af 100755
--- a/alipay/pages/goods-search/goods-search.json
+++ b/alipay/pages/goods-search/goods-search.json
@@ -1,3 +1,6 @@
{
- "pullRefresh": true
+ "pullRefresh": true,
+ "usingComponents": {
+ "popup": "mini-antui/es/popup/index"
+ }
}
\ No newline at end of file
diff --git a/alipay/pages/index/index.acss b/alipay/pages/index/index.acss
index e6e3cf036..79c208f5d 100755
--- a/alipay/pages/index/index.acss
+++ b/alipay/pages/index/index.acss
@@ -1,3 +1,33 @@
+/**
+ * 搜索
+ */
+.search {
+ left: 0;
+ top: 20rpx;
+ box-sizing: border-box;
+ padding: 15rpx 20rpx;
+ background: #d2364c;
+}
+.search-content {
+ border-radius: 6rpx;
+ position: relative;
+}
+.search icon {
+ position: absolute;
+ left: 10rpx;
+ top: 10rpx;
+}
+.search input {
+ font-size: 28rpx;
+ padding-left: 50rpx;
+ box-sizing: border-box;
+ height: 60rpx;
+ line-height: 60rpx;
+}
+
+ /**
+ * 楼层数据
+ */
.floor-list, .floor-left {
overflow: hidden;
position: relative;
diff --git a/alipay/pages/index/index.axml b/alipay/pages/index/index.axml
index a7ae13848..fa56d0336 100755
--- a/alipay/pages/index/index.axml
+++ b/alipay/pages/index/index.axml
@@ -1,3 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/alipay/pages/index/index.js b/alipay/pages/index/index.js
index d9fccb386..c2d9b60a6 100755
--- a/alipay/pages/index/index.js
+++ b/alipay/pages/index/index.js
@@ -72,6 +72,20 @@ Page({
});
},
+ // 搜索事件
+ search_input_event(e) {
+ var keywords = e.detail.value || null;
+ if (keywords == null) {
+ my.showToast({content: '请输入搜索关键字'});
+ return false;
+ }
+
+ // 进入搜索页面
+ my.navigateTo({
+ url: '/pages/goods-search/goods-search?keywords='+keywords
+ });
+ },
+
// 下拉刷新
onPullDownRefresh() {
this.init();
diff --git a/alipay/pages/user-order/user-order.js b/alipay/pages/user-order/user-order.js
index 1bff97e2b..1b05d5826 100755
--- a/alipay/pages/user-order/user-order.js
+++ b/alipay/pages/user-order/user-order.js
@@ -293,7 +293,7 @@ Page({
if (res.data.code == 0) {
var temp_data_list = this.data.data_list;
temp_data_list[index]['status'] = 5;
- temp_data_list[index]['status_text'] = '已取消';
+ temp_data_list[index]['status_name'] = '已取消';
this.setData({data_list: temp_data_list});
my.showToast({
@@ -346,7 +346,7 @@ Page({
if (res.data.code == 0) {
var temp_data_list = this.data.data_list;
temp_data_list[index]['status'] = 4;
- temp_data_list[index]['status_text'] = '已完成';
+ temp_data_list[index]['status_name'] = '已完成';
this.setData({data_list: temp_data_list});
my.showToast({
diff --git a/service/Application/Api/Controller/BuyController.class.php b/service/Application/Api/Controller/BuyController.class.php
index ec6f2121e..2b9eea2fe 100755
--- a/service/Application/Api/Controller/BuyController.class.php
+++ b/service/Application/Api/Controller/BuyController.class.php
@@ -48,7 +48,7 @@ class BuyController extends CommonController
public function Index()
{
// 获取商品列表
- $params = $_POST;
+ $params = $this->data_post;
$params['user'] = $this->user;
$ret = BuyService::BuyTypeGoodsList($params);
@@ -94,7 +94,7 @@ class BuyController extends CommonController
*/
public function Add()
{
- $params = $_POST;
+ $params = $this->data_post;
$params['user'] = $this->user;
$ret = BuyService::OrderAdd($params);
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
diff --git a/service/Application/Api/Controller/CommonController.class.php b/service/Application/Api/Controller/CommonController.class.php
index 1aec036a0..1ba5451fa 100755
--- a/service/Application/Api/Controller/CommonController.class.php
+++ b/service/Application/Api/Controller/CommonController.class.php
@@ -46,9 +46,9 @@ class CommonController extends Controller
$this->CommonInit();
// 输入参数
- $this->data_post = I('post.');
- $this->data_get = I('get.');
- $this->data_request = I('request.');
+ $this->data_post = $_POST;
+ $this->data_get = $_GET;
+ $this->data_request = $_REQUEST;
}
/**
diff --git a/service/Application/Api/Controller/OrderController.class.php b/service/Application/Api/Controller/OrderController.class.php
index 27749582d..7d092454e 100755
--- a/service/Application/Api/Controller/OrderController.class.php
+++ b/service/Application/Api/Controller/OrderController.class.php
@@ -130,34 +130,16 @@ class OrderController extends CommonController
*/
public function Cancel()
{
- if(empty($this->data_post['id']))
- {
- $this->ajaxReturn('请选择订单');
- }
-
- $m = M('Order');
- $where = ['id'=>intval($this->data_post['id']), 'user_id' => $this->user['id']];
- $data = $m->where($where)->field('id,status')->find();
- if(empty($data))
- {
- $this->ajaxReturn(L('common_data_no_exist_error'));
- }
- if(!in_array($data['status'], [0,1]))
- {
- $status_text = L('common_order_user_status')[$data['status']]['name'];
- $this->ajaxReturn('状态不可操作['.$status_text.']');
- }
-
- $save_data = ['status' => 5, 'cancel_time' => time(), 'upd_time' => time()];
- if($m->where($where)->save($save_data))
- {
- $this->ajaxReturn(L('common_cancel_success'), 0);
- }
- $this->ajaxReturn(L('common_cancel_error'));
+ $params = $this->data_post;
+ $params['user_id'] = $this->user['id'];
+ $params['creator'] = $this->user['id'];
+ $params['creator_name'] = $this->user['user_name_view'];
+ $ret = OrderService::OrderCancel($params);
+ $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
}
/**
- * [Collect 订单完成]
+ * [Collect 订单收货]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
@@ -165,127 +147,31 @@ class OrderController extends CommonController
*/
public function Collect()
{
- if(empty($this->data_post['id']))
- {
- $this->ajaxReturn('请选择订单');
- }
-
- $m = M('Order');
- $where = ['id'=>intval($this->data_post['id']), 'user_id' => $this->user['id']];
- $data = $m->where($where)->field('id,status')->find();
- if(empty($data))
- {
- $this->ajaxReturn(L('common_data_no_exist_error'));
- }
- if(!in_array($data['status'], [3]))
- {
- $status_text = L('common_order_user_status')[$data['status']]['name'];
- $this->ajaxReturn('状态不可操作['.$status_text.']');
- }
-
- $save_data = ['status' => 4, 'success_time' => time(), 'upd_time' => time()];
- if($m->where($where)->save($save_data))
- {
- $this->ajaxReturn(L('common_confirm_success'), 0);
- }
- $this->ajaxReturn(L('common_confirm_error'));
+ $params = $this->data_post;
+ $params['user_id'] = $this->user['id'];
+ $params['creator'] = $this->user['id'];
+ $params['creator_name'] = $this->user['user_name_view'];
+ $ret = OrderService::OrderCollect($params);
+ $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
}
- // /**
- // * [Pay 订单支付]
- // * @author Devil
- // * @blog http://gong.gg/
- // * @version 1.0.0
- // * @datetime 2018-07-22T22:10:46+0800
- // */
- // public function Pay()
- // {
- // if(empty($this->data_post['id']))
- // {
- // $this->ajaxReturn('请选择订单');
- // }
-
- // $m = M('Order');
- // $where = ['id'=>intval($this->data_post['id']), 'user_id' => $this->user['id']];
- // $data = $m->where($where)->field('id,status,total_price')->find();
- // if(empty($data))
- // {
- // $this->ajaxReturn(L('common_data_no_exist_error'));
- // }
- // if($data['total_price'] <= 0.00)
- // {
- // $this->ajaxReturn('金额不能为0');
- // }
- // if($data['status'] != 1)
- // {
- // $status_text = L('common_order_user_status')[$data['status']]['name'];
- // $this->ajaxReturn('状态不可操作['.$status_text.']');
- // }
-
- // // 发起支付
- // $notify_url = __MY_URL__.'Notify/order.php';
- // $pay_data = array(
- // 'out_user' => md5($this->user['id']),
- // 'order_sn' => $data['id'].GetNumberCode(6),
- // 'name' => '订单支付',
- // 'total_price' => $data['total_price'],
- // 'notify_url' => $notify_url,
- // );
- // $pay = (new \Library\Alipay())->SoonPay($pay_data, C("alipay_key_secret"));
- // if(empty($pay))
- // {
- // $this->ajaxReturn('支付接口异常');
- // }
- // $this->ajaxReturn(L('common_operation_success'), 0, $pay);
- // }
-
/**
- * 确认
+ * 订单删除
* @author Devil
- * @blog http://gong.gg/
- * @version 1.0.0
- * @datetime 2018-06-18T00:10:32+0800
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-30
+ * @desc description
*/
- public function Confirm()
+ public function Delete()
{
- die('error');
- // 参数
- $params = [
- [
- 'checked_type' => 'empty',
- 'key_name' => 'id',
- 'error_msg' => '请选择订单',
- ]
- ];
- $ret = params_checked($this->data_post, $params);
- if($ret !== true)
- {
- $this->ajaxReturn($ret);
- }
-
- // 订单处理
- $m = M('Order');
- $where = ['id'=>intval($this->data_post['id']), 'user_id' => $this->user['id']];
- $data = $m->where($where)->field('id,status')->find();
- if(empty($data))
- {
- $this->ajaxReturn(L('common_data_no_exist_error'));
- }
-
- // 状态
- if($temp['status'] != 0)
- {
- $status_text = L('common_order_user_status')[$data['status']]['name'];
- $this->ajaxReturn('状态不可操作['.$status_text.']');
- }
-
- // 开始处理
- $save_data = ['status' => 1, 'confirm_time' => time(), 'upd_time' => time()];
- if($m->where($where)->save($data))
- {
- $this->ajaxReturn(L('common_confirm_success'), 0);
- }
- $this->ajaxReturn(L('common_confirm_error'));
+ $params = $this->data_post;
+ $params['user_id'] = $this->user['id'];
+ $params['creator'] = $this->user['id'];
+ $params['creator_name'] = $this->user['user_name_view'];
+ $params['user_type'] = 'user';
+ $ret = OrderService::OrderDelete($params);
+ $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
}
}
diff --git a/service/Application/Service/SearchService.class.php b/service/Application/Service/SearchService.class.php
index 067ecbe6a..ac4851eb5 100755
--- a/service/Application/Service/SearchService.class.php
+++ b/service/Application/Service/SearchService.class.php
@@ -87,18 +87,20 @@ class SearchService
if(!empty($params['screening_price_id']))
{
$price = M('ScreeningPrice')->field('min_price,max_price')->where(['is_enable'=>1, 'id'=>intval($params['screening_price_id'])])->find();
- if(!empty($price['min_price']) && !empty($price['max_price']))
+ $params['min_price'] = $price['min_price'];
+ $params['max_price'] = $price['max_price'];
+ if(!empty($params['min_price']) && !empty($params['max_price']))
{
$where['g.price'] = [
- ['EGT', $price['min_price']],
- ['LT', $price['max_price']],
+ ['EGT', $params['min_price']],
+ ['LT', $params['max_price']],
];
- } else if(!empty($price['min_price']))
+ } else if(!empty($params['min_price']))
{
- $where['g.price'] = ['EGT', $price['min_price']];
- } else if(!empty($price['max_price']))
+ $where['g.price'] = ['EGT', $params['min_price']];
+ } else if(!empty($params['max_price']))
{
- $where['g.price'] = ['LT', $price['max_price']];
+ $where['g.price'] = ['LT', $params['max_price']];
}
}