diff --git a/alipay/app.js b/alipay/app.js
index 38dbf6a1d..7b2fe07d3 100755
--- a/alipay/app.js
+++ b/alipay/app.js
@@ -44,8 +44,8 @@ App({
},
// 请求地址
- request_url: "http://demo.shopxo.net/",
- request_url: 'http://default.com/project/shopxo/service/',
+ //request_url: "http://demo.shopxo.net/",
+ request_url: 'http://localhost/project/shopxo/service/',
// 基础信息
application_title: "ShopXO电商系统",
@@ -427,5 +427,49 @@ App({
s_x += "0";
}
return s_x;
- }
+ },
+
+ /**
+ * 价格保留两位小数
+ * price 价格保留两位小数
+ */
+ operation_event(e) {
+ var value = e.target.dataset.value || null;
+ var type = parseInt(e.target.dataset.type);
+
+ console.log(value, type)
+ if (value != null) {
+ switch(type) {
+ // web
+ case 0 :
+ my.navigateTo({url: '/pages/web-view/web-view?url='+value});
+ break;
+
+ // 内部页面
+ case 1 :
+ my.navigateTo({url: value});
+ break;
+
+ // 跳转到外部小程序
+ case 2 :
+ my.navigateToMiniProgram({appId: value});
+ break;
+
+ // 跳转到地图查看位置
+ case 3 :
+ my.openLocation({
+ longitude: '121.549697',
+ latitude: '31.227250',
+ name: '支付宝',
+ address: '杨高路地铁站',
+ });
+ break;
+
+ // 拨打电话
+ case 4 :
+ my.makePhoneCall({ number: value });
+ break;
+ }
+ }
+ },
});
diff --git a/alipay/app.json b/alipay/app.json
index 70532ab70..1690b3981 100755
--- a/alipay/app.json
+++ b/alipay/app.json
@@ -39,7 +39,7 @@
"pagePath": "pages/answer-list/answer-list",
"icon": "/images/nav-icon-answer.png",
"activeIcon": "/images/nav-icon-answer-active.png",
- "name": "问答"
+ "name": "分类"
},
{
"pagePath": "pages/user/user",
diff --git a/alipay/components/goods-category-nav/goods-category-nav.acss b/alipay/components/goods-category-nav/goods-category-nav.acss
deleted file mode 100755
index af09be533..000000000
--- a/alipay/components/goods-category-nav/goods-category-nav.acss
+++ /dev/null
@@ -1,22 +0,0 @@
-.category-list {
- overflow: hidden;
-}
-.category-list .items {
- width: 25%;
- padding-bottom: 20rpx;
- float: left;
-}
-.items-content {
- margin: 20rpx;
-}
-.category-list .items:nth-child(4n+1) {
-
-}
-.category-list .items image {
- width: 50px !important;
- height: 50px !important;
-}
-.category-list .items .title {
- margin-top: 10rpx;
- font-size: 32rpx;
-}
\ No newline at end of file
diff --git a/alipay/components/goods-category-nav/goods-category-nav.axml b/alipay/components/goods-category-nav/goods-category-nav.axml
deleted file mode 100644
index bd5d58153..000000000
--- a/alipay/components/goods-category-nav/goods-category-nav.axml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
-
diff --git a/alipay/components/home-banner/home-banner.axml b/alipay/components/home-banner/home-banner.axml
index 114ef3804..0af0bdda6 100644
--- a/alipay/components/home-banner/home-banner.axml
+++ b/alipay/components/home-banner/home-banner.axml
@@ -5,15 +5,15 @@
autoplay="{{autoplay}}"
circular="{{circular}}"
class="banner bg-white spacing-mb"
- a:if="{{banner_list.length > 0}}">
-
+ a:if="{{data_list.length > 0}}">
+
-
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/alipay/components/home-banner/home-banner.js b/alipay/components/home-banner/home-banner.js
index ab98f5c1e..ae7707d40 100644
--- a/alipay/components/home-banner/home-banner.js
+++ b/alipay/components/home-banner/home-banner.js
@@ -9,7 +9,7 @@ Component({
circular: true,
data_list_loding_status: 1,
data_bottom_line_status: false,
- banner_list: [],
+ data_list: [],
},
props: {},
didMount() {
@@ -27,7 +27,7 @@ Component({
// 加载loding
my.httpRequest({
- url: app.get_request_url("Banner", "Index"),
+ url: app.get_request_url("HomeBanner", "Resources"),
method: "POST",
data: {},
dataType: "json",
@@ -35,7 +35,7 @@ Component({
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
- banner_list: data,
+ data_list: data,
indicator_dots: (data.length > 1),
autoplay: (data.length > 1),
data_list_loding_status: data.length == 0 ? 0 : 3,
@@ -67,28 +67,9 @@ Component({
});
},
- // 轮播图事件
+ // 操作事件
banner_event(e) {
- var value = e.target.dataset.value || null;
- var type = parseInt(e.target.dataset.type);
- if (value != null) {
- switch(type) {
- // web
- case 0 :
- my.navigateTo({url: '/pages/web-view/web-view?url='+value});
- break;
-
- // 内部页面
- case 1 :
- my.navigateTo({url: value});
- break;
-
- // 跳转到外部小程序
- case 2 :
- my.navigateToMiniProgram({appId: value});
- break;
- }
- }
+ app.operation_event(e);
},
},
});
diff --git a/alipay/components/home-nav/home-nav.acss b/alipay/components/home-nav/home-nav.acss
new file mode 100755
index 000000000..c9cb0d7e6
--- /dev/null
+++ b/alipay/components/home-nav/home-nav.acss
@@ -0,0 +1,21 @@
+.data-list {
+ overflow: hidden;
+}
+.data-list .items {
+ width: calc(25% - 40rpx);
+ float: left;
+ padding: 20rpx;
+}
+.items-content {
+ border-radius: 50%;
+ padding: 30rpx;
+ text-align: center;
+}
+.data-list .items image {
+ width: 80rpx !important;
+ height: 80rpx !important;
+}
+.data-list .items .title {
+ margin-top: 10rpx;
+ font-size: 32rpx;
+}
\ No newline at end of file
diff --git a/alipay/components/home-nav/home-nav.axml b/alipay/components/home-nav/home-nav.axml
new file mode 100644
index 000000000..f87f89625
--- /dev/null
+++ b/alipay/components/home-nav/home-nav.axml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
diff --git a/alipay/components/goods-category-nav/goods-category-nav.js b/alipay/components/home-nav/home-nav.js
similarity index 87%
rename from alipay/components/goods-category-nav/goods-category-nav.js
rename to alipay/components/home-nav/home-nav.js
index e0cb56c05..f28f2ca8a 100644
--- a/alipay/components/goods-category-nav/goods-category-nav.js
+++ b/alipay/components/home-nav/home-nav.js
@@ -5,7 +5,7 @@ Component({
data: {
data_list_loding_status: 1,
data_bottom_line_status: false,
- category_list: [],
+ data_list: [],
},
didMount() {
this.init();
@@ -21,7 +21,7 @@ Component({
// 加载loding
my.httpRequest({
- url: app.get_request_url("GoodsCategoryNav", "Index"),
+ url: app.get_request_url("HomeNav", "Resources"),
method: "POST",
data: {},
dataType: "json",
@@ -29,7 +29,7 @@ Component({
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
- category_list: data,
+ data_list: data,
data_list_loding_status: data.length == 0 ? 0 : 3,
data_bottom_line_status: true,
});
@@ -58,5 +58,10 @@ Component({
}
});
},
+
+ // 操作事件
+ nav_event(e) {
+ app.operation_event(e);
+ },
}
});
diff --git a/alipay/components/goods-category-nav/goods-category-nav.json b/alipay/components/home-nav/home-nav.json
similarity index 100%
rename from alipay/components/goods-category-nav/goods-category-nav.json
rename to alipay/components/home-nav/home-nav.json
diff --git a/alipay/pages/index/index.acss b/alipay/pages/index/index.acss
index e69de29bb..1b7ad2acd 100755
--- a/alipay/pages/index/index.acss
+++ b/alipay/pages/index/index.acss
@@ -0,0 +1,72 @@
+.floor {
+
+}
+.floor, .floor-list, .floor-left {
+ overflow: hidden;
+ position: relative;
+}
+.floor .nav-name {
+ font-size: 34rpx;
+ font-weight: 500;
+ text-align: center;
+ padding: 10rpx 0;
+}
+.floor .vice-name {
+ top: 20rpx;
+ left: 20rpx;
+}
+.floor-left {
+ width: 40%;
+ float: left;
+ height: 660rpx;
+}
+.floor-left image {
+ left: 0;
+ bottom: 0;
+ width: 100%;
+}
+
+
+.floor .vice-name,
+.floor-left image,
+.goods-list .goods:nth-child(1),
+.goods-list .goods:nth-child(2) {
+ position: absolute;
+}
+
+.goods-list .goods {
+ height: 330rpx;
+ background-color: #fff;
+ overflow: hidden;
+}
+.goods-list .goods image {
+ width: 100%;
+}
+.goods-list .goods:nth-child(1),
+.goods-list .goods:nth-child(2) {
+ width: 60%;
+}
+.goods-list .goods:nth-child(1) .goods-base,
+.goods-list .goods:nth-child(2) .goods-base {
+ float: left;
+}
+.goods-list .goods:nth-child(1) image,
+.goods-list .goods:nth-child(2) image {
+ width: 60%;
+ float: right;
+}
+.goods-list .goods:nth-child(1) {
+ top: 0;
+ right: 0;
+}
+.goods-list .goods:nth-child(2) {
+ top: 330rpx;
+ right: 0;
+}
+.goods-list .goods:nth-child(3),
+.goods-list .goods:nth-child(4),
+.goods-list .goods:nth-child(5),
+.goods-list .goods:nth-child(6) {
+ margin-top: 330rpx;
+ width: 50%;
+}
\ No newline at end of file
diff --git a/alipay/pages/index/index.axml b/alipay/pages/index/index.axml
index f6002432e..e7fb9f618 100755
--- a/alipay/pages/index/index.axml
+++ b/alipay/pages/index/index.axml
@@ -1,25 +1,34 @@
+
-
+
+
-
+
+
+
+
+ {{floor.name}}
- -->
+
+
+ {{floor.vice_name}}
+
+
+
+
+
+
+ {{goods.title}}
+
+
+
+
+
+
+
-
-
-
-
-
@@ -27,9 +36,5 @@
-
-
-
-
diff --git a/alipay/pages/index/index.js b/alipay/pages/index/index.js
index 50a43d7c1..d9fccb386 100755
--- a/alipay/pages/index/index.js
+++ b/alipay/pages/index/index.js
@@ -8,14 +8,7 @@ Page({
circular: true,
data_list_loding_status: 1,
data_bottom_line_status: false,
-
- banner_list: [],
- category_list: [],
- cart_count: 0,
- username: null,
- nickname: null,
- customer_service_tel: null,
-
+ data_list: [],
load_status: 0,
},
@@ -45,15 +38,10 @@ Page({
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
- banner_list: data.banner,
- indicator_dots: (data.banner.length > 1),
- autoplay: (data.banner.length > 1),
- category_list: data.category,
- cart_count: data.cart_count,
- username: data.username,
- nickname: data.nickname,
- customer_service_tel: data.customer_service_tel,
- data_list_loding_status: data.category.length == 0 ? 0 : 3,
+ data_list: data,
+ indicator_dots: (data.length > 1),
+ autoplay: (data.length > 1),
+ data_list_loding_status: data.length == 0 ? 0 : 3,
data_bottom_line_status: true,
});
} else {
@@ -84,48 +72,11 @@ Page({
});
},
- // 轮播图事件
- banner_event(e) {
- var value = e.target.dataset.value || null;
- var type = parseInt(e.target.dataset.type);
- if (value != null) {
- switch(type) {
- // web
- case 0 :
- my.navigateTo({url: '/pages/web-view/web-view?url='+value});
- break;
-
- // 内部页面
- case 1 :
- my.navigateTo({url: value});
- break;
-
- // 跳转到外部小程序
- case 2 :
- my.navigateToMiniProgram({appId: value});
- break;
- }
- }
- },
-
// 下拉刷新
onPullDownRefresh() {
this.init();
},
- // 客服电话
- call_event() {
- if(this.data.customer_service_tel == null)
- {
- my.showToast({
- type: "fail",
- content: "客服电话有误"
- });
- } else {
- my.makePhoneCall({ number: this.data.customer_service_tel });
- }
- },
-
// 自定义分享
onShareAppMessage() {
return {
diff --git a/alipay/pages/index/index.json b/alipay/pages/index/index.json
index b910a1e4f..87b931570 100755
--- a/alipay/pages/index/index.json
+++ b/alipay/pages/index/index.json
@@ -1,7 +1,7 @@
{
"pullRefresh": true,
"usingComponents": {
- "component-goods-category-nav": "/components/goods-category-nav/goods-category-nav",
+ "component-home-nav": "/components/home-nav/home-nav",
"component-home-banner": "/components/home-banner/home-banner"
}
}
\ No newline at end of file
diff --git a/service/Application/Admin/Controller/AppHomeNavController.class.php b/service/Application/Admin/Controller/AppHomeNavController.class.php
index 07acbe07e..cd2c52ed9 100755
--- a/service/Application/Admin/Controller/AppHomeNavController.class.php
+++ b/service/Application/Admin/Controller/AppHomeNavController.class.php
@@ -59,7 +59,7 @@ class AppHomeNavController extends CommonController
$page = new \Library\Page($page_param);
// 获取列表
- $list = $this->SetDataHandle($m->where($where)->limit($page->GetPageStarNumber(), $number)->order('is_enable desc, id desc')->select());
+ $list = $this->SetDataHandle($m->where($where)->limit($page->GetPageStarNumber(), $number)->order('is_enable desc, sort asc')->select());
// 参数
$this->assign('param', $param);
@@ -209,30 +209,7 @@ class AppHomeNavController extends CommonController
}
// 图片
- if(!empty($_FILES['file_images_url']))
- {
- // 文件上传校验
- $error = FileUploadError('file_images_url');
- if($error !== true)
- {
- $this->ajaxReturn($error, -1);
- }
-
- // 文件类型
- list($type, $suffix) = explode('/', $_FILES['file_images_url']['type']);
- $path = 'Public'.DS.'Upload'.DS.'app_home_nav'.DS.date('Y').DS.date('m').DS;
- if(!is_dir($path))
- {
- mkdir(ROOT_PATH.$path, 0777, true);
- }
- $filename = date('YmdHis').GetNumberCode(6).'.'.$suffix;
- $file_images_url = $path.$filename;
-
- if(move_uploaded_file($_FILES['file_images_url']['tmp_name'], ROOT_PATH.$file_images_url))
- {
- $_POST['images_url'] = DS.$file_images_url;
- }
- }
+ $this->FileSave('images_url', 'file_images_url', 'app_home_nav');
// 添加
if(empty($_POST['id']))
@@ -263,11 +240,12 @@ class AppHomeNavController extends CommonController
// 额外数据处理
$m->name = I('name');
$m->jump_url = I('jump_url');
- $m->event_type = intval(I('event_type'));
+ $m->event_type = intval(I('event_type', -1));
$m->images_url = I('images_url');
$m->platform = I('platform');
$m->is_enable = intval(I('is_enable', 0));
$m->bg_color = I('bg_color');
+ $m->sort = intval(I('sort'));
$m->add_time = time();
// 数据添加
@@ -300,11 +278,12 @@ class AppHomeNavController extends CommonController
// 额外数据处理
$m->name = I('name');
$m->jump_url = I('jump_url');
- $m->event_type = intval(I('event_type'));
+ $m->event_type = intval(I('event_type', -1));
$m->images_url = I('images_url');
$m->platform = I('platform');
$m->is_enable = intval(I('is_enable', 0));
$m->bg_color = I('bg_color');
+ $m->sort = intval(I('sort'));
$m->upd_time = time();
// 更新数据库
diff --git a/service/Application/Admin/Controller/AppMiniAlipayConfigController.class.php b/service/Application/Admin/Controller/AppMiniAlipayConfigController.class.php
new file mode 100755
index 000000000..6ab3780cc
--- /dev/null
+++ b/service/Application/Admin/Controller/AppMiniAlipayConfigController.class.php
@@ -0,0 +1,61 @@
+Is_Login();
+
+ // 权限校验
+ $this->Is_Power();
+ }
+
+ /**
+ * [Index 配置列表]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-06T21:31:53+0800
+ */
+ public function Index()
+ {
+ // 配置信息
+ $data = M('Config')->getField('only_tag,name,describe,value,error_tips');
+ $this->assign('data', $data);
+
+ $this->display('Index');
+ }
+
+ /**
+ * [Save 配置数据保存]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2017-01-02T23:08:19+0800
+ */
+ public function Save()
+ {
+ $this->MyConfigSave();
+ }
+}
+?>
\ No newline at end of file
diff --git a/service/Application/Admin/Controller/AppSlideController.class.php b/service/Application/Admin/Controller/AppSlideController.class.php
new file mode 100755
index 000000000..f3368a434
--- /dev/null
+++ b/service/Application/Admin/Controller/AppSlideController.class.php
@@ -0,0 +1,369 @@
+Is_Login();
+
+ // 权限校验
+ $this->Is_Power();
+ }
+
+ /**
+ * [Index 手机管理-轮播图片列表]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-06T21:31:53+0800
+ */
+ public function Index()
+ {
+ // 参数
+ $param = array_merge($_POST, $_GET);
+
+ // 模型对象
+ $m = M('AppSlide');
+
+ // 条件
+ $where = $this->GetIndexWhere();
+
+ // 分页
+ $number = MyC('admin_page_number');
+ $page_param = array(
+ 'number' => $number,
+ 'total' => $m->where($where)->count(),
+ 'where' => $param,
+ 'url' => U('Admin/AppSlide/Index'),
+ );
+ $page = new \Library\Page($page_param);
+
+ // 获取列表
+ $list = $this->SetDataHandle($m->where($where)->limit($page->GetPageStarNumber(), $number)->order('is_enable desc, sort asc')->select());
+
+ // 参数
+ $this->assign('param', $param);
+
+ // 分页
+ $this->assign('page_html', $page->GetPageHtml());
+
+ // 是否启用
+ $this->assign('common_is_enable_list', L('common_is_enable_list'));
+
+ // 所属平台
+ $this->assign('common_platform_type', L('common_platform_type'));
+
+ // 事件类型
+ $this->assign('common_app_event_type', L('common_app_event_type'));
+
+ // 数据列表
+ $this->assign('list', $list);
+ $this->display('Index');
+ }
+
+ /**
+ * [SetDataHandle 数据处理]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-29T21:27:15+0800
+ * @param [array] $data [手机管理-轮播图片数据]
+ * @return [array] [处理好的数据]
+ */
+ private function SetDataHandle($data)
+ {
+ if(!empty($data))
+ {
+ $common_platform_type = L('common_platform_type');
+ $common_is_enable_tips = L('common_is_enable_tips');
+ $common_app_event_type = L('common_app_event_type');
+ foreach($data as &$v)
+ {
+ // 是否启用
+ $v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
+
+ // 平台类型
+ $v['platform_text'] = $common_platform_type[$v['platform']]['name'];
+
+ // 事件类型
+ $v['event_type_text'] = $common_app_event_type[$v['event_type']]['name'];
+
+ // 图片地址
+ $v['images_url'] = empty($v['images_url']) ? '' : C('IMAGE_HOST').$v['images_url'];
+
+ // 添加时间
+ $v['add_time_text'] = date('Y-m-d H:i:s', $v['add_time']);
+
+ // 更新时间
+ $v['upd_time_text'] = date('Y-m-d H:i:s', $v['upd_time']);
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * [GetIndexWhere 列表条件]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-10T22:16:29+0800
+ */
+ private function GetIndexWhere()
+ {
+ $where = array();
+
+ // 模糊
+ if(!empty($_REQUEST['keyword']))
+ {
+ $where['name'] = array('like', '%'.I('keyword').'%');
+ }
+
+ // 是否更多条件
+ if(I('is_more', 0) == 1)
+ {
+ if(I('is_enable', -1) > -1)
+ {
+ $where['is_enable'] = intval(I('is_enable', 0));
+ }
+ if(I('event_type', -1) > -1)
+ {
+ $where['event_type'] = intval(I('event_type', 0));
+ }
+ if(!empty($_REQUEST['platform']))
+ {
+ $where['platform'] = I('platform');
+ }
+
+ // 表达式
+ if(!empty($_REQUEST['time_start']))
+ {
+ $where['add_time'][] = array('gt', strtotime(I('time_start')));
+ }
+ if(!empty($_REQUEST['time_end']))
+ {
+ $where['add_time'][] = array('lt', strtotime(I('time_end')));
+ }
+ }
+ return $where;
+ }
+
+ /**
+ * [SaveInfo 添加/编辑页面]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-14T21:37:02+0800
+ */
+ public function SaveInfo()
+ {
+ // 手机管理-轮播图片信息
+ $data = empty($_REQUEST['id']) ? array() : M('AppSlide')->find(I('id'));
+ $this->assign('data', $data);
+
+ // 所属平台
+ $this->assign('common_platform_type', L('common_platform_type'));
+
+ // 事件类型
+ $this->assign('common_app_event_type', L('common_app_event_type'));
+
+ // 参数
+ $this->assign('param', array_merge($_POST, $_GET));
+
+ $this->display('SaveInfo');
+ }
+
+ /**
+ * [Save 手机管理-轮播图片添加/编辑]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-14T21:37:02+0800
+ */
+ public function Save()
+ {
+ // 是否ajax请求
+ if(!IS_AJAX)
+ {
+ $this->error(L('common_unauthorized_access'));
+ }
+
+ // 图片
+ $this->FileSave('images_url', 'file_images_url', 'app_slide');
+
+ // 添加
+ if(empty($_POST['id']))
+ {
+ $this->Add();
+
+ // 编辑
+ } else {
+ $this->Edit();
+ }
+ }
+
+ /**
+ * [Add 手机管理-轮播图片添加]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-18T16:20:59+0800
+ */
+ private function Add()
+ {
+ // 手机管理-轮播图片模型
+ $m = D('AppSlide');
+
+ // 数据自动校验
+ if($m->create($_POST, 1))
+ {
+ // 额外数据处理
+ $m->name = I('name');
+ $m->jump_url = I('jump_url');
+ $m->event_type = intval(I('event_type', -1));
+ $m->images_url = I('images_url');
+ $m->platform = I('platform');
+ $m->is_enable = intval(I('is_enable', 0));
+ $m->sort = intval(I('sort'));
+ $m->add_time = time();
+
+ // 数据添加
+ if($m->add())
+ {
+ $this->ajaxReturn(L('common_operation_add_success'));
+ } else {
+ $this->ajaxReturn(L('common_operation_add_error'), -100);
+ }
+ } else {
+ $this->ajaxReturn($m->getError(), -1);
+ }
+ }
+
+ /**
+ * [Edit 手机管理-轮播图片编辑]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-17T22:13:40+0800
+ */
+ private function Edit()
+ {
+ // 手机管理-轮播图片模型
+ $m = D('AppSlide');
+
+ // 数据自动校验
+ if($m->create($_POST, 2))
+ {
+ // 额外数据处理
+ $m->name = I('name');
+ $m->jump_url = I('jump_url');
+ $m->event_type = intval(I('event_type', -1));
+ $m->images_url = I('images_url');
+ $m->platform = I('platform');
+ $m->is_enable = intval(I('is_enable', 0));
+ $m->sort = intval(I('sort'));
+ $m->upd_time = time();
+
+ // 更新数据库
+ if($m->where(array('id'=>I('id')))->save())
+ {
+ $this->ajaxReturn(L('common_operation_edit_success'));
+ } else {
+ $this->ajaxReturn(L('common_operation_edit_error'), -100);
+ }
+ } else {
+ $this->ajaxReturn($m->getError(), -1);
+ }
+ }
+
+ /**
+ * [Delete 手机管理-轮播图片删除]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-15T11:03:30+0800
+ */
+ public function Delete()
+ {
+ // 是否ajax请求
+ if(!IS_AJAX)
+ {
+ $this->error(L('common_unauthorized_access'));
+ }
+
+ // 参数处理
+ $id = I('id');
+
+ // 删除数据
+ if(!empty($id))
+ {
+ // 模型
+ $m = M('AppSlide');
+
+ // 是否存在
+ $data = $m->find($id);
+ if(empty($data))
+ {
+ $this->ajaxReturn(L('common_data_no_exist_error'), -2);
+ }
+ if($data['is_enable'] == 1)
+ {
+ $this->ajaxReturn(L('common_already_is_enable_error'), -3);
+ }
+
+ // 删除
+ if($m->where(array('id'=>$id))->delete() !== false)
+ {
+ $this->ajaxReturn(L('common_operation_delete_success'));
+ } else {
+ $this->ajaxReturn(L('common_operation_delete_error'), -100);
+ }
+ } else {
+ $this->ajaxReturn(L('common_param_error'), -1);
+ }
+ }
+
+ /**
+ * [StatusUpdate 状态更新]
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2017-01-12T22:23:06+0800
+ */
+ public function StatusUpdate()
+ {
+ // 参数
+ if(empty($_POST['id']) || !isset($_POST['state']))
+ {
+ $this->ajaxReturn(L('common_param_error'), -1);
+ }
+
+ // 数据更新
+ if(M('AppSlide')->where(array('id'=>I('id')))->save(array('is_enable'=>I('state'))))
+ {
+ $this->ajaxReturn(L('common_operation_edit_success'));
+ } else {
+ $this->ajaxReturn(L('common_operation_edit_error'), -100);
+ }
+ }
+}
+?>
\ No newline at end of file
diff --git a/service/Application/Admin/Controller/ConfigController.class.php b/service/Application/Admin/Controller/ConfigController.class.php
index e3d7f4502..2d0ac956e 100755
--- a/service/Application/Admin/Controller/ConfigController.class.php
+++ b/service/Application/Admin/Controller/ConfigController.class.php
@@ -39,10 +39,6 @@ class ConfigController extends CommonController
*/
public function Index()
{
- // 学期
- $semester_list = M('Semester')->field(array('id', 'name'))->where(array('is_enable'=>1))->order('id desc')->select();
- $this->assign('semester_list', $semester_list);
-
// csv
$this->assign('common_excel_charset_list', L('common_excel_charset_list'));
diff --git a/service/Application/Admin/Controller/SlideController.class.php b/service/Application/Admin/Controller/SlideController.class.php
index 3529da56b..9f7ae92c3 100755
--- a/service/Application/Admin/Controller/SlideController.class.php
+++ b/service/Application/Admin/Controller/SlideController.class.php
@@ -59,7 +59,7 @@ class SlideController extends CommonController
$page = new \Library\Page($page_param);
// 获取列表
- $list = $this->SetDataHandle($m->where($where)->limit($page->GetPageStarNumber(), $number)->order('is_enable desc, id desc')->select());
+ $list = $this->SetDataHandle($m->where($where)->limit($page->GetPageStarNumber(), $number)->order('is_enable desc, sort asc')->select());
// 参数
$this->assign('param', $param);
@@ -70,12 +70,6 @@ class SlideController extends CommonController
// 是否启用
$this->assign('common_is_enable_list', L('common_is_enable_list'));
- // 所属平台
- $this->assign('common_platform_type', L('common_platform_type'));
-
- // 跳转类型
- $this->assign('common_jump_url_type', L('common_jump_url_type'));
-
// 数据列表
$this->assign('list', $list);
$this->display('Index');
@@ -94,20 +88,12 @@ class SlideController extends CommonController
{
if(!empty($data))
{
- $common_platform_type = L('common_platform_type');
$common_is_enable_tips = L('common_is_enable_tips');
- $common_jump_url_type = L('common_jump_url_type');
foreach($data as &$v)
{
// 是否启用
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
- // 平台类型
- $v['platform_text'] = $common_platform_type[$v['platform']]['name'];
-
- // 跳转类型
- $v['jump_url_type_text'] = $common_jump_url_type[$v['jump_url_type']]['name'];
-
// 图片地址
$v['images_url'] = empty($v['images_url']) ? '' : C('IMAGE_HOST').$v['images_url'];
@@ -145,14 +131,6 @@ class SlideController extends CommonController
{
$where['is_enable'] = intval(I('is_enable', 0));
}
- if(I('jump_url_type', -1) > -1)
- {
- $where['jump_url_type'] = intval(I('jump_url_type', 0));
- }
- if(!empty($_REQUEST['platform']))
- {
- $where['platform'] = I('platform');
- }
// 表达式
if(!empty($_REQUEST['time_start']))
@@ -180,12 +158,6 @@ class SlideController extends CommonController
$data = empty($_REQUEST['id']) ? array() : M('Slide')->find(I('id'));
$this->assign('data', $data);
- // 所属平台
- $this->assign('common_platform_type', L('common_platform_type'));
-
- // 跳转类型
- $this->assign('common_jump_url_type', L('common_jump_url_type'));
-
// 参数
$this->assign('param', array_merge($_POST, $_GET));
@@ -208,30 +180,7 @@ class SlideController extends CommonController
}
// 图片
- if(!empty($_FILES['file_images_url']))
- {
- // 文件上传校验
- $error = FileUploadError('file_images_url');
- if($error !== true)
- {
- $this->ajaxReturn($error, -1);
- }
-
- // 文件类型
- list($type, $suffix) = explode('/', $_FILES['file_images_url']['type']);
- $path = 'Public'.DS.'Upload'.DS.'slide'.DS.date('Y').DS.date('m').DS;
- if(!is_dir($path))
- {
- mkdir(ROOT_PATH.$path, 0777, true);
- }
- $filename = date('YmdHis').GetNumberCode(6).'.'.$suffix;
- $file_images_url = $path.$filename;
-
- if(move_uploaded_file($_FILES['file_images_url']['tmp_name'], ROOT_PATH.$file_images_url))
- {
- $_POST['images_url'] = DS.$file_images_url;
- }
- }
+ $this->FileSave('images_url', 'file_images_url', 'slide');
// 添加
if(empty($_POST['id']))
@@ -262,11 +211,10 @@ class SlideController extends CommonController
// 额外数据处理
$m->name = I('name');
$m->jump_url = I('jump_url');
- $m->jump_url_type = intval(I('jump_url_type'));
$m->images_url = I('images_url');
- $m->platform = I('platform');
$m->is_enable = intval(I('is_enable', 0));
$m->bg_color = I('bg_color');
+ $m->sort = intval(I('sort'));
$m->add_time = time();
// 数据添加
@@ -299,11 +247,10 @@ class SlideController extends CommonController
// 额外数据处理
$m->name = I('name');
$m->jump_url = I('jump_url');
- $m->jump_url_type = intval(I('jump_url_type'));
$m->images_url = I('images_url');
- $m->platform = I('platform');
$m->is_enable = intval(I('is_enable', 0));
$m->bg_color = I('bg_color');
+ $m->sort = intval(I('sort'));
$m->upd_time = time();
// 更新数据库
@@ -366,13 +313,13 @@ class SlideController extends CommonController
}
/**
- * [StateUpdate 状态更新]
+ * [StatusUpdate 状态更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
*/
- public function StateUpdate()
+ public function StatusUpdate()
{
// 参数
if(empty($_POST['id']) || !isset($_POST['state']))
diff --git a/service/Application/Admin/Lang/zh-cn/appslide.php b/service/Application/Admin/Lang/zh-cn/appslide.php
new file mode 100755
index 000000000..e2cef4969
--- /dev/null
+++ b/service/Application/Admin/Lang/zh-cn/appslide.php
@@ -0,0 +1,21 @@
+ '轮播添加',
+ 'app_slide_edit_name' => '轮播编辑',
+
+ 'app_slide_name_text' => '名称',
+ 'app_slide_name_format' => '名称格式 2~60 个字符',
+
+ 'app_slide_images_url_text' => '轮播图片',
+ 'app_slide_images_url_format' => '请上传轮播图片',
+);
+?>
\ No newline at end of file
diff --git a/service/Application/Admin/Model/AppHomeNavModel.class.php b/service/Application/Admin/Model/AppHomeNavModel.class.php
index b3bf1bd2b..e43ebb2b0 100755
--- a/service/Application/Admin/Model/AppHomeNavModel.class.php
+++ b/service/Application/Admin/Model/AppHomeNavModel.class.php
@@ -4,7 +4,7 @@ namespace Admin\Model;
use Think\Model;
/**
- * 支付宝小程序-首页导航模型
+ * 手机管理-首页导航模型
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
diff --git a/service/Application/Admin/Model/AppSlideModel.class.php b/service/Application/Admin/Model/AppSlideModel.class.php
new file mode 100755
index 000000000..cae610074
--- /dev/null
+++ b/service/Application/Admin/Model/AppSlideModel.class.php
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/service/Application/Admin/Model/SlideModel.class.php b/service/Application/Admin/Model/SlideModel.class.php
index 20f753ed0..af426ef8b 100755
--- a/service/Application/Admin/Model/SlideModel.class.php
+++ b/service/Application/Admin/Model/SlideModel.class.php
@@ -15,10 +15,8 @@ class SlideModel extends CommonModel
// 数据自动校验
protected $_validate = array(
// 添加,编辑
- array('name', '0,60', '{%slide_name_format}', 1, 'length', 3),
- array('platform', array('pc','h5','app','alipay','wechat','baidu'), '{%common_platform_format}', 1, 'in', 3),
+ array('name', '2,60', '{%slide_name_format}', 1, 'length', 3),
array('jump_url', '0,255', '{%common_jump_url_format}', 2, 'length', 3),
- array('jump_url_type', array(0,1,2), '{%common_jump_url_type_format}', 1, 'in', 3),
array('images_url', 'require', '{%slide_images_url_format}', 1, '', 3),
array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
);
diff --git a/service/Application/Admin/View/Default/AppHomeNav/SaveInfo.html b/service/Application/Admin/View/Default/AppHomeNav/SaveInfo.html
index 2b46306e0..a55dbd9b6 100755
--- a/service/Application/Admin/View/Default/AppHomeNav/SaveInfo.html
+++ b/service/Application/Admin/View/Default/AppHomeNav/SaveInfo.html
@@ -70,6 +70,10 @@
+
+
+ {{$data.sort}}0" required />
+