消息发送,支持多选
parent
235c8435bb
commit
cfdc9d26cc
|
|
@ -42,7 +42,7 @@ class AlipayLifeMessageController extends CommonController
|
|||
public function Index()
|
||||
{
|
||||
// 参数
|
||||
$param = array_merge($_POST, $_GET);
|
||||
$params = array_merge($_POST, $_GET);
|
||||
|
||||
// 模型对象
|
||||
$m = M('AlipayLifeMessage');
|
||||
|
|
@ -55,7 +55,7 @@ class AlipayLifeMessageController extends CommonController
|
|||
$page_param = array(
|
||||
'number' => $number,
|
||||
'total' => $m->where($where)->count(),
|
||||
'where' => $param,
|
||||
'where' => $params,
|
||||
'url' => U('Admin/AlipayLifeMessage/Index'),
|
||||
);
|
||||
$page = new \Library\Page($page_param);
|
||||
|
|
@ -65,7 +65,7 @@ class AlipayLifeMessageController extends CommonController
|
|||
$list = $this->SetDataHandle($list);
|
||||
|
||||
// 参数
|
||||
$this->assign('param', $param);
|
||||
$this->assign('params', $params);
|
||||
|
||||
// 分页
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
|
|
@ -74,7 +74,7 @@ class AlipayLifeMessageController extends CommonController
|
|||
$this->assign('common_send_status_list', L('common_send_status_list'));
|
||||
|
||||
// 消息类型
|
||||
$this->assign('alipay_life_message_type_list', L('alipay_life_message_type_list'));
|
||||
$this->assign('alipay_life_message_msg_type_list', L('alipay_life_message_msg_type_list'));
|
||||
|
||||
// 发送类型
|
||||
$this->assign('alipay_life_message_send_type_list', L('alipay_life_message_send_type_list'));
|
||||
|
|
@ -98,7 +98,7 @@ class AlipayLifeMessageController extends CommonController
|
|||
if(!empty($data))
|
||||
{
|
||||
$common_send_status_list = L('common_send_status_list');
|
||||
$alipay_life_message_type_list = L('alipay_life_message_type_list');
|
||||
$alipay_life_message_msg_type_list = L('alipay_life_message_msg_type_list');
|
||||
$alipay_life_message_send_type_list = L('alipay_life_message_send_type_list');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
|
|
@ -106,23 +106,16 @@ class AlipayLifeMessageController extends CommonController
|
|||
$v['status_name'] = $common_send_status_list[$v['status']]['name'];
|
||||
|
||||
// 消息类型
|
||||
$v['type_name'] = $alipay_life_message_type_list[$v['type']]['name'];
|
||||
$v['type_name'] = $alipay_life_message_msg_type_list[$v['msg_type']]['name'];
|
||||
|
||||
// 发送状态
|
||||
$v['send_type_name'] = $alipay_life_message_send_type_list[$v['send_type']]['name'];
|
||||
|
||||
// 分类名称
|
||||
$category_all = M('AlipayLifeMessageCategoryJoin')->where(['alipay_life_id'=>$v['id']])->getField('alipay_life_category_id', true);
|
||||
$v['alipay_life_category_text'] = M('AlipayLifeMessageCategory')->where(['id'=>['in', $category_all]])->getField('name', true);
|
||||
|
||||
// image_url
|
||||
$v['image_url'] = empty($v['image_url']) ? '' : C('IMAGE_HOST').$v['image_url'];
|
||||
|
||||
// 生活号分类
|
||||
$v['category_all'] = empty($v['alipay_life_category_id']) ? '' : M('AlipayLifeCategory')->where(['id'=>['in', json_decode($v['alipay_life_category_id'], true)]])->getField('name', true);
|
||||
|
||||
// 生活号
|
||||
$v['alipay_life_name'] = empty($v['alipay_life_id']) ? '' : M('AlipayLife')->where(['id'=>$v['alipay_life_id']])->getField('name');
|
||||
$v['alipay_life_all'] = empty($v['alipay_life_ids']) ? '' : M('AlipayLife')->where(['id'=>['in', json_decode($v['alipay_life_ids'], true)]])->getField('name', true);
|
||||
|
||||
// 用户
|
||||
$v['alipay_openid'] = empty($v['user_id']) ? '' : M('User')->where(['id'=>$v['user_id']])->getField('alipay_openid');
|
||||
|
||||
// 时间
|
||||
$v['send_startup_time'] = empty($v['send_startup_time']) ? '' : date('Y-m-d H:i:s', $v['send_startup_time']);
|
||||
|
|
@ -160,7 +153,7 @@ class AlipayLifeMessageController extends CommonController
|
|||
}
|
||||
if(I('type', -1) > -1)
|
||||
{
|
||||
$where['type'] = intval(I('type', 0));
|
||||
$where['msg_type'] = intval(I('type', 0));
|
||||
}
|
||||
if(I('send_type', -1) > -1)
|
||||
{
|
||||
|
|
@ -189,31 +182,56 @@ class AlipayLifeMessageController extends CommonController
|
|||
*/
|
||||
public function SaveInfo()
|
||||
{
|
||||
// 轮播图片信息
|
||||
// 数据
|
||||
$data = empty($_REQUEST['id']) ? array() : M('AlipayLifeMessage')->find(I('id'));
|
||||
$this->assign('data', $data);
|
||||
|
||||
// 发送状态
|
||||
$this->assign('common_send_status_list', L('common_send_status_list'));
|
||||
|
||||
// 消息类型
|
||||
$this->assign('alipay_life_message_type_list', L('alipay_life_message_type_list'));
|
||||
$this->assign('alipay_life_message_msg_type_list', L('alipay_life_message_msg_type_list'));
|
||||
|
||||
// 单用户发消息用户信息
|
||||
$alipay_openid = empty($_GET['user_id']) ? '' : M('User')->where(['id'=>intval(I('user_id'))])->getField('alipay_openid');
|
||||
$alipay_openid = '';
|
||||
$user_id = 0;
|
||||
$alipay_life_user_id = 0;
|
||||
if(!empty($_GET['user_id']))
|
||||
{
|
||||
$user_id = intval(I('user_id'));
|
||||
$alipay_life_user_id = intval(I('alipay_life_user_id'));
|
||||
}
|
||||
if(!empty($data))
|
||||
{
|
||||
$user_id = $data['user_id'];
|
||||
$alipay_life_user_id = $data['alipay_life_user_id'];
|
||||
}
|
||||
if(!empty($user_id))
|
||||
{
|
||||
$alipay_openid = M('User')->where(['id'=>$user_id])->getField('alipay_openid');
|
||||
}
|
||||
$this->assign('user_id', $user_id);
|
||||
$this->assign('alipay_life_user_id', $alipay_life_user_id);
|
||||
$this->assign('alipay_openid', $alipay_openid);
|
||||
|
||||
// 消息发送类型
|
||||
$this->assign('alipay_life_message_send_type_list', L('alipay_life_message_send_type_list'));
|
||||
$this->assign('send_type', empty($alipay_openid) ? 1 : 0);
|
||||
$send_type = (isset($data['send_type']) && $data['send_type'] == 0) ? $data['send_type'] : (empty($alipay_openid) ? 1 : 0);
|
||||
$this->assign('send_type', $send_type);
|
||||
|
||||
// 生活号
|
||||
$alipay_life_list = [];
|
||||
$alipay_life_ids_all = [];
|
||||
if(!empty($_GET['alipay_life_id']))
|
||||
{
|
||||
$alipay_life_list = M('AlipayLife')->field('id,name')->where(['id'=>intval(I('alipay_life_id'))])->select();
|
||||
} else {
|
||||
$alipay_life_list = [];
|
||||
$alipay_life_ids_all = [intval(I('alipay_life_id'))];
|
||||
}
|
||||
if(!empty($data['alipay_life_ids']))
|
||||
{
|
||||
$alipay_life_ids_all = json_decode($data['alipay_life_ids'], true);
|
||||
}
|
||||
if(!empty($alipay_life_ids_all))
|
||||
{
|
||||
$alipay_life_list = M('AlipayLife')->field('id,name')->where(['id'=>['in', $alipay_life_ids_all]])->select();
|
||||
}
|
||||
$this->assign('alipay_life_ids_all', $alipay_life_ids_all);
|
||||
$this->assign('alipay_life_list', $alipay_life_list);
|
||||
|
||||
// 生活号分类
|
||||
|
|
@ -227,10 +245,100 @@ class AlipayLifeMessageController extends CommonController
|
|||
|
||||
// 参数
|
||||
$this->assign('params', array_merge($_POST, $_GET));
|
||||
$this->assign('nav_type', I('nav_type', 0));
|
||||
$this->assign('msg_type', I('msg_type', 0));
|
||||
$this->display('SaveInfo');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [Index 消息内容列表]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
*/
|
||||
public function ContentIndex()
|
||||
{
|
||||
// 参数
|
||||
$params = array_merge($_POST, $_GET);
|
||||
|
||||
// 条件
|
||||
$where = ['alipay_life_message_id' => intval($params['message_id'])];
|
||||
|
||||
// 获取列表
|
||||
$list = M('AlipayLifeMessageContent')->where($where)->order('id desc')->select();
|
||||
$list = $this->SetDataHandleContent($list);
|
||||
|
||||
// 消息主数据
|
||||
$data = empty($_REQUEST['message_id']) ? array() : M('AlipayLifeMessage')->find(I('message_id'));
|
||||
$this->assign('data', $data);
|
||||
$this->assign('msg_type', $data['msg_type']);
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
|
||||
// 数据列表
|
||||
$this->assign('list', $list);
|
||||
$this->assign('list_count', count($list));
|
||||
$this->display('ContentIndex');
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息内容处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-29
|
||||
* @desc description
|
||||
* @param [array] $data [轮播图片数据]
|
||||
* @return [array] [处理好的数据]
|
||||
*/
|
||||
private function SetDataHandleContent($data)
|
||||
{
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_send_status_list = L('common_send_status_list');
|
||||
$alipay_life_message_msg_type_list = L('alipay_life_message_msg_type_list');
|
||||
$alipay_life_message_send_type_list = L('alipay_life_message_send_type_list');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// image_url
|
||||
$v['image_url'] = empty($v['image_url']) ? '' : C('IMAGE_HOST').$v['image_url'];
|
||||
|
||||
// 时间
|
||||
$v['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
|
||||
$v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容添加/编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-29
|
||||
* @desc description
|
||||
*/
|
||||
public function ContentSaveInfo()
|
||||
{
|
||||
// 主数据
|
||||
$message = empty($_REQUEST['message_id']) ? array() : M('AlipayLifeMessage')->find(I('message_id'));
|
||||
|
||||
// 数据
|
||||
$data = empty($_REQUEST['id']) ? array() : M('AlipayLifeMessageContent')->find(I('id'));
|
||||
$this->assign('data', $data);
|
||||
|
||||
// 消息类型
|
||||
$this->assign('alipay_life_message_msg_type_list', L('alipay_life_message_msg_type_list'));
|
||||
$this->assign('msg_type', $message['msg_type']);
|
||||
|
||||
// 参数
|
||||
$this->assign('params', array_merge($_POST, $_GET));
|
||||
$this->display('ContentSaveInfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* [Save 生活号消息保存]
|
||||
* @author Devil
|
||||
|
|
@ -250,6 +358,25 @@ class AlipayLifeMessageController extends CommonController
|
|||
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* [ContentSave 生活号消息内容保存]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-25T22:36:12+0800
|
||||
*/
|
||||
public function ContentSave()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
$ret = AlipayLifeService::MessageContentAdd($_POST);
|
||||
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* [Delete 生活号消息删除]
|
||||
* @author Devil
|
||||
|
|
@ -293,5 +420,25 @@ class AlipayLifeMessageController extends CommonController
|
|||
$ret = AlipayLifeService::MessageSubmit($_POST);
|
||||
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生活号搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-29
|
||||
* @desc description
|
||||
*/
|
||||
public function Search()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
$ret = AlipayLifeService::AlipayLifeSearch($_POST);
|
||||
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
return array(
|
||||
// 添加/编辑
|
||||
'alipay_life_message_add_name' => '生活号消息创建',
|
||||
'alipay_life_message_content_title' => '生活号消息内容',
|
||||
|
||||
'alipay_life_message_life_text' => '生活号',
|
||||
'alipay_life_message_life_format' => '请选择生活号',
|
||||
|
|
@ -34,8 +35,9 @@ return array(
|
|||
|
||||
'alipay_life_message_keywords_text' => '标题',
|
||||
|
||||
'alipay_life_message_type_text' => '消息类型',
|
||||
'alipay_life_message_type_list' => array(
|
||||
'alipay_life_message_msg_type_text' => '消息类型',
|
||||
'alipay_life_message_msg_type_format' => '请选择消息类型',
|
||||
'alipay_life_message_msg_type_list' => array(
|
||||
0 => array('value' => 0, 'name' => '文本'),
|
||||
1 => array('value' => 1, 'name' => '图文'),
|
||||
),
|
||||
|
|
@ -50,5 +52,10 @@ return array(
|
|||
'alipay_life_message_user_text' => '给用户发送消息',
|
||||
'alipay_life_message_startup_time_text' => '发送启动时间',
|
||||
'alipay_life_message_success_time_text' => '发送完成时间',
|
||||
|
||||
'alipay_life_message_optional_text' => '可选',
|
||||
'alipay_life_message_selected_text' => '已选',
|
||||
'alipay_life_message_selected_all_text' => '全选',
|
||||
'alipay_life_message_content_text' => '内容',
|
||||
);
|
||||
?>
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<include file="Public/Header" />
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">{{:L('alipay_life_message_content_title')}}</span>
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
|
||||
</legend>
|
||||
|
||||
<!-- operation start -->
|
||||
<if condition="($msg_type eq 0 and $list_count eq 0) or ($msg_type eq 1 and $list_count lt 10)">
|
||||
<div class="am-g">
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/ContentSaveInfo', ['message_id'=>$params['message_id']])}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> {{:L('common_operation_add')}}</a>
|
||||
</div>
|
||||
</if>
|
||||
<!-- operation end -->
|
||||
|
||||
<!-- list start -->
|
||||
<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{:L('alipay_life_message_title_text')}}</th>
|
||||
<th>{{:L('alipay_life_message_content_text')}}</th>
|
||||
<th>{{:L('alipay_life_message_image_url_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('alipay_life_message_url_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('alipay_life_message_action_name_text')}}</th>
|
||||
<th>{{:L('common_more_name')}}</th>
|
||||
<th>{{:L('common_operation_name')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<if condition="!empty($list)">
|
||||
<foreach name="list" item="v">
|
||||
<tr id="data-list-{{$v.id}}">
|
||||
<td>
|
||||
<if condition="empty($v['title'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.title}}</if>
|
||||
</td>
|
||||
<td>
|
||||
<if condition="empty($v['content'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.content}}</if>
|
||||
</td>
|
||||
<td>
|
||||
<if condition="!empty($v['image_url'])">
|
||||
<a href="{{$v['image_url']}}" target="_blank">
|
||||
<img src="{{$v['image_url']}}" class="am-radius" width="100" />
|
||||
</a>
|
||||
<else />
|
||||
<span class="cr-ddd">{{:L('common_on_fill_in_images')}}</span>
|
||||
</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['url'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.url}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['action_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.action_name}}</if>
|
||||
</td>
|
||||
<td>
|
||||
<span class="am-icon-caret-down c-p" data-am-modal="{target: '#my-popup{{$v.id}}'}"> {{:L('common_see_more_name')}}</span>
|
||||
<div class="am-popup am-radius" id="my-popup{{$v.id}}">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">{{:L('common_detail_content')}}</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<dl class="dl-content">
|
||||
<dt>{{:L('alipay_life_message_title_text')}}</dt>
|
||||
<dd><if condition="empty($v['title'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.title}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_content_text')}}</dt>
|
||||
<dd><if condition="empty($v['content'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.content}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_image_url_text')}}</dt>
|
||||
<dd>
|
||||
<if condition="!empty($v['image_url'])">
|
||||
<img src="{{$v['image_url']}}" class="am-img-thumbnail am-radius" width="100" height="100" />
|
||||
<else />
|
||||
<span class="cr-ddd">{{:L('common_on_fill_in_images')}}</span>
|
||||
</if>
|
||||
</dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_url_text')}}</dt>
|
||||
<dd><if condition="empty($v['url'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.url}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_action_name_text')}}</dt>
|
||||
<dd><if condition="empty($v['action_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.action_name}}</if></dd>
|
||||
|
||||
<dt>{{:L('common_create_time_name')}}</dt>
|
||||
<dd>{{$v.add_time}}</dd>
|
||||
|
||||
<dt>{{:L('common_upd_time_name')}}</dt>
|
||||
<dd>{{$v.upd_time}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="view-operation">
|
||||
<if condition="$v['status'] eq 0">
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/ContentSaveInfo', array('id'=>$v['id'], 'message_id'=>$params['message_id']))}}">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit"> {{:L('common_operation_edit')}}</button>
|
||||
</a>
|
||||
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/AlipayLifeMessage/ContentDelete')}}" data-id="{{$v.id}}"> {{:L('common_operation_delete')}}</button>
|
||||
</if>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
<else />
|
||||
<tr><td colspan="20" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
|
||||
</if>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- list end -->
|
||||
|
||||
<!-- page start -->
|
||||
<if condition="!empty($list)">
|
||||
{{$page_html}}
|
||||
</if>
|
||||
<!-- page end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<include file="Public/Header" />
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:U('Admin/AlipayLifeMessage/ContentSave')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/AlipayLifeMessage/ContentIndex', ['message_id'=>$params['message_id']])}}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_image', 2048000)}}" />
|
||||
<legend>
|
||||
<span class="fs-16">{{:L('alipay_life_message_add_name')}}</span>
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/ContentIndex', ['message_id'=>$params['message_id']])}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_title_text')}}</label>
|
||||
<input type="text" name="title" placeholder="{{:L('alipay_life_message_title_text')}}" maxlength="80" data-validation-message="{{:L('alipay_life_message_title_format')}}" class="am-radius" value="<notempty name="data.title">{{$data.title}}</notempty>" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_content_text')}}</label>
|
||||
<textarea rows="5" name="content" class="am-radius" placeholder="{{:L('alipay_life_message_content_text')}}" data-validation-message="{{:L('alipay_life_message_content_format')}}" maxlength="250" required><notempty name="data.content">{{$data.content}}</notempty></textarea>
|
||||
</div>
|
||||
|
||||
<if condition="$msg_type eq 1">
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">{{:L('alipay_life_message_image_url_text')}}</label>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius">
|
||||
<i class="am-icon-cloud-upload"></i> {{:L('common_select_images_text')}}</button>
|
||||
<input type="text" name="image_url" class="am-radius js-choice-one original-images-url original-icon-images-url" data-choice-one-to='input[name="file_image_url"]' data-validation-message="{{:L('alipay_life_message_image_url_format')}}" readonly="readonly" value="<notempty name="data.image_url">{{$data.image_url}}</notempty>" required />
|
||||
<input type="file" name="file_image_url" multiple data-validation-message="{{:L('alipay_life_message_image_url_format')}}" accept="image/gif,image/jpeg,image/jpg,image/png" class="js-choice-one images-file-event file_image_url-tag" data-choice-one-to=".original-icon-images-url" data-tips-tag="#form-icon-tips" data-image-tag="#form-img-icon" required />
|
||||
<div id="form-icon-tips" class="m-t-5"></div>
|
||||
<notempty name="data.image_url">
|
||||
<img src="{{$image_host}}{{$data.image_url}}" id="form-img-icon" class="block m-t-5 am-img-thumbnail am-radius" width="100" height="100" data-default="{{$image_host}}/Public/Admin/Default/Images/default-images.png" />
|
||||
</notempty>
|
||||
<empty name="data.image_url">
|
||||
<img src="{{$image_host}}/Public/Admin/Default/Images/default-images.png" id="form-img-icon" class="block m-t-5 am-img-thumbnail am-radius" width="100" height="100" data-default="{{$image_host}}/Public/Admin/Default/Images/default-images.png" />
|
||||
</empty>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_url_text')}}</label>
|
||||
<input type="text" name="url" placeholder="{{:L('alipay_life_message_url_text')}}" data-validation-message="{{:L('alipay_life_message_url_format')}}" class="am-radius" maxlength="255" value="<notempty name="data.url">{{$data.url}}</notempty>" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_action_name_text')}}</label>
|
||||
<input type="text" name="action_name" placeholder="{{:L('alipay_life_message_action_name_text')}}" data-validation-message="{{:L('alipay_life_message_action_name_format')}}" class="am-radius" maxlength="60" value="<notempty name="data.action_name">{{$data.action_name}}</notempty>" />
|
||||
</div>
|
||||
</if>
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" name="id" value="{{$data.id}}" />
|
||||
<input type="hidden" name="message_id" value="{{$params.message_id}}" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
||||
|
|
@ -6,37 +6,37 @@
|
|||
<!-- form start -->
|
||||
<form class="am-form view-list" action="{{:U('Admin/AlipayLifeMessage/Index')}}" method="POST">
|
||||
<div class="am-g">
|
||||
<input type="text" class="am-radius form-keyword" placeholder="{{:L('alipay_life_message_keywords_text')}}" name="keyword" <present name="param['keyword']"> value="{{$param.keyword}}"</present> />
|
||||
<input type="text" class="am-radius form-keyword" placeholder="{{:L('alipay_life_message_keywords_text')}}" name="keyword" <present name="param['keyword']"> value="{{$params.keyword}}"</present> />
|
||||
<button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">{{:L('common_operation_query')}}</button>
|
||||
<label class="fs-12 m-l-5 c-p fw-100 more-submit">
|
||||
{{:L('common_more_screening')}}
|
||||
<input type="checkbox" name="is_more" value="1" id="is_more" <if condition="isset($param['is_more']) and $param['is_more'] eq 1">checked</if> />
|
||||
<input type="checkbox" name="is_more" value="1" id="is_more" <if condition="isset($params['is_more']) and $params['is_more'] eq 1">checked</if> />
|
||||
<i class="am-icon-angle-down"></i>
|
||||
</label>
|
||||
|
||||
<div class="more-where <if condition="!isset($param['is_more']) or $param['is_more'] neq 1">none</if>">
|
||||
<div class="more-where <if condition="!isset($params['is_more']) or $params['is_more'] neq 1">none</if>">
|
||||
<select name="status" class="am-radius c-p m-t-10 m-l-5 param-where">
|
||||
<option value="-1">{{:L('common_view_status_title')}}</option>
|
||||
<foreach name="common_send_status_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($param['status']) and $param['status'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
<option value="{{$v.value}}" <if condition="isset($params['status']) and $params['status'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
<select name="type" class="am-radius c-p m-t-10 m-l-5 param-where">
|
||||
<option value="-1">{{:L('alipay_life_message_type_text')}}</option>
|
||||
<foreach name="alipay_life_message_type_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($param['type']) and $param['type'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
<option value="-1">{{:L('alipay_life_message_msg_type_text')}}</option>
|
||||
<foreach name="alipay_life_message_msg_type_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($params['type']) and $params['type'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
<select name="send_type" class="am-radius c-p m-t-10 m-l-5 param-where">
|
||||
<option value="-1">{{:L('alipay_life_message_send_type_text')}}</option>
|
||||
<foreach name="alipay_life_message_send_type_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($param['send_type']) and $param['send_type'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
<option value="{{$v.value}}" <if condition="isset($params['send_type']) and $params['send_type'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
<div class="param-date param-where m-l-5">
|
||||
<input type="text" name="time_start" class="Wdate am-radius m-t-10" placeholder="{{:L('common_time_start_name')}}" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <if condition="isset($param['time_start'])">value="{{$param.time_start}}"</if>/>
|
||||
<input type="text" name="time_start" class="Wdate am-radius m-t-10" placeholder="{{:L('common_time_start_name')}}" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <if condition="isset($params['time_start'])">value="{{$params.time_start}}"</if>/>
|
||||
<span>~</span>
|
||||
<input type="text" class="Wdate am-radius m-t-10" placeholder="{{:L('common_time_end_name')}}" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <if condition="isset($param['time_end'])">value="{{$param.time_end}}"</if>/>
|
||||
<input type="text" class="Wdate am-radius m-t-10" placeholder="{{:L('common_time_end_name')}}" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <if condition="isset($params['time_end'])">value="{{$params.time_end}}"</if>/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -53,13 +53,8 @@
|
|||
<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{:L('alipay_life_message_type_text')}}</th>
|
||||
<th>{{:L('alipay_life_message_msg_type_text')}}</th>
|
||||
<th>{{:L('alipay_life_message_send_type_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('alipay_life_message_title_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('alipay_life_message_content_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('alipay_life_message_image_url_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('alipay_life_message_url_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('alipay_life_message_action_name_text')}}</th>
|
||||
<th>{{:L('common_view_status_title')}}</th>
|
||||
<th>{{:L('common_more_name')}}</th>
|
||||
<th>{{:L('common_operation_name')}}</th>
|
||||
|
|
@ -71,27 +66,6 @@
|
|||
<tr id="data-list-{{$v.id}}">
|
||||
<td>{{$v.type_name}}</td>
|
||||
<td>{{$v.send_type_name}}</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['title'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.title}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['content'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.content}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="!empty($v['image_url'])">
|
||||
<a href="{{$v['image_url']}}" target="_blank">
|
||||
<img src="{{$v['image_url']}}" class="am-radius" width="100" />
|
||||
</a>
|
||||
<else />
|
||||
<span class="cr-ddd">{{:L('common_on_fill_in_images')}}</span>
|
||||
</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['url'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.url}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['action_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.action_name}}</if>
|
||||
</td>
|
||||
<td>{{$v.status_name}}</td>
|
||||
<td>
|
||||
<span class="am-icon-caret-down c-p" data-am-modal="{target: '#my-popup{{$v.id}}'}"> {{:L('common_see_more_name')}}</span>
|
||||
|
|
@ -103,38 +77,17 @@
|
|||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<dl class="dl-content">
|
||||
<dt>{{:L('alipay_life_message_type_text')}}</dt>
|
||||
<dt>{{:L('alipay_life_message_msg_type_text')}}</dt>
|
||||
<dd><if condition="empty($v['type_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.type_name}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_send_type_text')}}</dt>
|
||||
<dd><if condition="empty($v['send_type_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.send_type_name}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_title_text')}}</dt>
|
||||
<dd><if condition="empty($v['title'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.title}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_content_text')}}</dt>
|
||||
<dd><if condition="empty($v['content'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.content}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_category_text')}}</dt>
|
||||
<dd><if condition="empty($v['category_all'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{:implode(',', $v['category_all'])}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_life_text')}}</dt>
|
||||
<dd><if condition="empty($v['alipay_life_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.alipay_life_name}}</if></dd>
|
||||
<dd><if condition="empty($v['alipay_life_all'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{:implode(',', $v['alipay_life_all'])}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_image_url_text')}}</dt>
|
||||
<dd>
|
||||
<if condition="!empty($v['image_url'])">
|
||||
<img src="{{$v['image_url']}}" class="am-img-thumbnail am-radius" width="100" height="100" />
|
||||
<else />
|
||||
<span class="cr-ddd">{{:L('common_on_fill_in_images')}}</span>
|
||||
</if>
|
||||
</dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_url_text')}}</dt>
|
||||
<dd><if condition="empty($v['url'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.url}}</if></dd>
|
||||
|
||||
<dt>{{:L('alipay_life_message_action_name_text')}}</dt>
|
||||
<dd><if condition="empty($v['action_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.action_name}}</if></dd>
|
||||
<dt>{{:L('alipay_life_message_user_text')}}</dt>
|
||||
<dd><if condition="empty($v['alipay_openid'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.alipay_openid}}</if></dd>
|
||||
|
||||
<dt>{{:L('common_view_status_title')}}</dt>
|
||||
<dd><if condition="empty($v['status_name'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.status_name}}</if></dd>
|
||||
|
|
@ -158,6 +111,15 @@
|
|||
<td class="view-operation">
|
||||
<if condition="$v['status'] eq 0">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-send-o submit-ajax" data-url="{{:U('Admin/AlipayLifeMessage/Send')}}" data-id="{{$v.id}}" data-view="reload"> {{:L('common_send_text')}}</button>
|
||||
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/ContentIndex', array('message_id'=>$v['id']))}}">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-cubes"> {{:L('alipay_life_message_content_text')}}</button>
|
||||
</a>
|
||||
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/SaveInfo', array('id'=>$v['id']))}}">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit"> {{:L('common_operation_edit')}}</button>
|
||||
</a>
|
||||
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/AlipayLifeMessage/Delete')}}" data-id="{{$v.id}}"> {{:L('common_operation_delete')}}</button>
|
||||
</if>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<ul class="am-nav am-nav-pills table-nav m-b-10">
|
||||
<foreach name="alipay_life_message_type_list" item="v">
|
||||
<li <if condition="$nav_type eq $v['value']">class="am-active"</if> data-type="{{$v.value}}">
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/SaveInfo', array_merge($params, ['nav_type'=>$v['value']]))}}">{{$v.name}}</a>
|
||||
<foreach name="alipay_life_message_msg_type_list" item="v">
|
||||
<li <if condition="$msg_type eq $v['value']">class="am-active"</if> data-type="{{$v.value}}">
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/ContentSaveInfo', array_merge($params, ['msg_type'=>$v['value']]))}}">{{$v.name}}</a>
|
||||
</li>
|
||||
</foreach>
|
||||
</ul>
|
||||
|
|
@ -11,83 +11,86 @@
|
|||
<a href="{{:U('Admin/AlipayLifeMessage/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
|
||||
</legend>
|
||||
|
||||
<!-- table nav start -->
|
||||
<include file="Nav" />
|
||||
<!-- table nav end -->
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_msg_type_text')}}</label>
|
||||
<select name="msg_type" class="am-radius c-p chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_msg_type_format')}}" required>
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="alipay_life_message_msg_type_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($data['msg_type']) and $v['value'] eq $data['msg_type']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_send_type_text')}}</label>
|
||||
<select name="send_type" class="am-radius c-p chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_send_type_format')}}" disabled required>
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="alipay_life_message_send_type_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($send_type) and $v['value'] eq $send_type">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
<if condition="$send_type eq 1">
|
||||
<empty name="params.alipay_life_id">
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_category_text')}}</label>
|
||||
<select name="alipay_life_category_id" class="am-radius c-p chosen-select" multiple="multiple" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_category_format')}}" required>
|
||||
<foreach name="alipay_life_category" item="v">
|
||||
<option value="{{$v.id}}">{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</empty>
|
||||
<label>{{:L('alipay_life_message_send_type_text')}}</label>
|
||||
<select name="send_type" class="am-radius c-p chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_send_type_format')}}" disabled required>
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="alipay_life_message_send_type_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($send_type) and $v['value'] eq $send_type">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 单条 -->
|
||||
<if condition="$send_type eq 0">
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_life_text')}}</label>
|
||||
<select name="alipay_life_ids" class="am-radius c-p chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_life_format')}}" <empty name="send_type">disabled</empty> required>
|
||||
<foreach name="alipay_life_list" item="v">
|
||||
<option value="{{$v.id}}" <if condition="in_array($v['id'], $alipay_life_ids_all)">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<notempty name="params.alipay_life_id">
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_life_text')}}</label>
|
||||
<select name="alipay_life_id" class="am-radius c-p chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_life_format')}}" <notempty name="params.alipay_life_id">disabled</notempty> required>
|
||||
<foreach name="alipay_life_list" item="v">
|
||||
<option value="{{$v.id}}" <if condition="$params['alipay_life_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</notempty>
|
||||
<else />
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_user_text')}}</label>
|
||||
<input type="hidden" name="user_id" value="{{$params.user_id}}" />
|
||||
<input type="hidden" name="alipay_life_user_id" value="{{$params.alipay_life_user_id}}" />
|
||||
<input type="hidden" name="user_id" value="{{$user_id}}" />
|
||||
<input type="hidden" name="alipay_life_user_id" value="{{$alipay_life_user_id}}" />
|
||||
<input type="text" class="am-radius" value="{{$alipay_openid}}" disabled />
|
||||
</div>
|
||||
</if>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_title_text')}}</label>
|
||||
<input type="text" name="title" placeholder="{{:L('alipay_life_message_title_text')}}" maxlength="80" data-validation-message="{{:L('alipay_life_message_title_format')}}" class="am-radius" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_content_text')}}</label>
|
||||
<textarea rows="5" name="content" class="am-radius" placeholder="{{:L('alipay_life_message_content_text')}}" data-validation-message="{{:L('alipay_life_message_content_format')}}" maxlength="250" required></textarea>
|
||||
</div>
|
||||
|
||||
<if condition="$nav_type eq 1">
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">{{:L('alipay_life_message_image_url_text')}}</label>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius">
|
||||
<i class="am-icon-cloud-upload"></i> {{:L('common_select_images_text')}}</button>
|
||||
<input type="text" name="image_url" class="am-radius js-choice-one original-images-url original-icon-images-url" data-choice-one-to='input[name="file_image_url"]' data-validation-message="{{:L('alipay_life_message_image_url_format')}}" readonly="readonly" required />
|
||||
<input type="file" name="file_image_url" multiple data-validation-message="{{:L('alipay_life_message_image_url_format')}}" accept="image/gif,image/jpeg,image/jpg,image/png" class="js-choice-one images-file-event file_image_url-tag" data-choice-one-to=".original-icon-images-url" data-tips-tag="#form-icon-tips" data-image-tag="#form-img-icon" required />
|
||||
<div id="form-icon-tips" class="m-t-5"></div>
|
||||
<img src="{{$image_host}}/Public/Admin/Default/Images/default-images.png" id="form-img-icon" class="block m-t-5 am-img-thumbnail am-radius" width="100" height="100" data-default="{{$image_host}}/Public/Admin/Default/Images/default-images.png" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_url_text')}}</label>
|
||||
<input type="text" name="url" placeholder="{{:L('alipay_life_message_url_text')}}" data-validation-message="{{:L('alipay_life_message_url_format')}}" class="am-radius" maxlength="255" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_action_name_text')}}</label>
|
||||
<input type="text" name="action_name" placeholder="{{:L('alipay_life_message_action_name_text')}}" data-validation-message="{{:L('alipay_life_message_action_name_format')}}" class="am-radius" maxlength="60" />
|
||||
<!-- 群发 -->
|
||||
<if condition="$send_type eq 1">
|
||||
<div class="life-container">
|
||||
<label class="block">{{:L('alipay_life_message_life_text')}}</label>
|
||||
<div class="life-form" data-search-url="{{:U('Admin/AlipayLifeMessage/Search')}}">
|
||||
<select class="am-radius c-p chosen-select life-form-category" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_category_format')}}">
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="alipay_life_category" item="v">
|
||||
<option value="{{$v.id}}">{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
<input type="text" placeholder="{{:L('alipay_life_message_title_text')}}" class="am-radius life-form-keywords" />
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm search-submit">{{:L('common_so_text')}}</button>
|
||||
</div>
|
||||
<div class="am-form-group life-list">
|
||||
<input type="text" name="alipay_life_ids" value="<notempty name="data.alipay_life_ids">{{:implode(',', json_decode($data['alipay_life_ids'], true))}}</notempty>" data-validation-message="{{:L('alipay_life_message_life_format')}}" required />
|
||||
<div class="life-items am-fl">
|
||||
<div class="title">{{:L('alipay_life_message_optional_text')}}</div>
|
||||
<ul class="life-content am-list ul-left">
|
||||
<div class="table-no">{{:L('common_not_data_tips')}}</div>
|
||||
</ul>
|
||||
</div>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-xs selected-all">{{:L('alipay_life_message_selected_all_text')}} <i class="am-icon-angle-double-right"></i></button>
|
||||
<div class="life-items am-fr">
|
||||
<div class="title">{{:L('alipay_life_message_selected_text')}}</div>
|
||||
<ul class="life-content am-list ul-right">
|
||||
<div class="table-no <notempty name="data">none</notempty>">{{:L('common_not_data_tips')}}</div>
|
||||
<foreach name="alipay_life_list" item="v">
|
||||
<li class="am-animation-slide-bottom items-li-{{$v.id}}">
|
||||
<span class="name" data-value="{{$v.id}}">{{$v.name}}</span>
|
||||
<i class="am-icon-trash-o am-fr"></i>
|
||||
</li>
|
||||
</foreach>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</if>
|
||||
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" name="type" value="{{$nav_type}}" />
|
||||
<input type="hidden" name="id" value="<notempty name="params.id">{{$params.id}}</notempty>" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,101 +0,0 @@
|
|||
<include file="Public/Header" />
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:U('Admin/AlipayLifeMessage/Save')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/AlipayLifeMessage/Index')}}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_image', 2048000)}}" />
|
||||
<legend>
|
||||
<span class="fs-16">{{:L('alipay_life_message_add_name')}}</span>
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
|
||||
</legend>
|
||||
|
||||
<!-- table nav start -->
|
||||
<include file="Nav" />
|
||||
<!-- table nav end -->
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_send_type_text')}}</label>
|
||||
<select name="send_type" class="am-radius c-p chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_send_type_format')}}" disabled required>
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="alipay_life_message_send_type_list" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($send_type) and $v['value'] eq $send_type">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
<if condition="$send_type eq 1">
|
||||
<empty name="params.alipay_life_id">
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_category_text')}}</label>
|
||||
<select name="alipay_life_category_id" class="am-radius c-p chosen-select" multiple="multiple" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_category_format')}}" required>
|
||||
<foreach name="alipay_life_category" item="v">
|
||||
<option value="{{$v.id}}">{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</empty>
|
||||
|
||||
<notempty name="params.alipay_life_id">
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_life_text')}}</label>
|
||||
<select name="alipay_life_id" class="am-radius c-p chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" data-validation-message="{{:L('alipay_life_message_life_format')}}" <notempty name="params.alipay_life_id">disabled</notempty> required>
|
||||
<foreach name="alipay_life_list" item="v">
|
||||
<option value="{{$v.id}}" <if condition="$params['alipay_life_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</notempty>
|
||||
<else />
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_user_text')}}</label>
|
||||
<input type="hidden" name="user_id" value="{{$params.user_id}}" />
|
||||
<input type="hidden" name="alipay_life_user_id" value="{{$params.alipay_life_user_id}}" />
|
||||
<input type="text" class="am-radius" value="{{$alipay_openid}}" disabled />
|
||||
</div>
|
||||
</if>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_title_text')}}</label>
|
||||
<input type="text" name="title" placeholder="{{:L('alipay_life_message_title_text')}}" maxlength="80" data-validation-message="{{:L('alipay_life_message_title_format')}}" class="am-radius" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_content_text')}}</label>
|
||||
<textarea rows="5" name="content" class="am-radius" placeholder="{{:L('alipay_life_message_content_text')}}" data-validation-message="{{:L('alipay_life_message_content_format')}}" maxlength="250" required></textarea>
|
||||
</div>
|
||||
|
||||
<if condition="$nav_type eq 1">
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">{{:L('alipay_life_message_image_url_text')}}</label>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius">
|
||||
<i class="am-icon-cloud-upload"></i> {{:L('common_select_images_text')}}</button>
|
||||
<input type="text" name="image_url" class="am-radius js-choice-one original-images-url original-icon-images-url" data-choice-one-to='input[name="file_image_url"]' data-validation-message="{{:L('alipay_life_message_image_url_format')}}" readonly="readonly" required />
|
||||
<input type="file" name="file_image_url" multiple data-validation-message="{{:L('alipay_life_message_image_url_format')}}" accept="image/gif,image/jpeg,image/jpg,image/png" class="js-choice-one images-file-event file_image_url-tag" data-choice-one-to=".original-icon-images-url" data-tips-tag="#form-icon-tips" data-image-tag="#form-img-icon" required />
|
||||
<div id="form-icon-tips" class="m-t-5"></div>
|
||||
<img src="{{$image_host}}/Public/Admin/Default/Images/default-images.png" id="form-img-icon" class="block m-t-5 am-img-thumbnail am-radius" width="100" height="100" data-default="{{$image_host}}/Public/Admin/Default/Images/default-images.png" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_url_text')}}</label>
|
||||
<input type="text" name="url" placeholder="{{:L('alipay_life_message_url_text')}}" data-validation-message="{{:L('alipay_life_message_url_format')}}" class="am-radius" maxlength="255" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('alipay_life_message_action_name_text')}}</label>
|
||||
<input type="text" name="action_name" placeholder="{{:L('alipay_life_message_action_name_text')}}" data-validation-message="{{:L('alipay_life_message_action_name_format')}}" class="am-radius" maxlength="60" />
|
||||
</div>
|
||||
</if>
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" name="type" value="{{$nav_type}}" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
||||
|
|
@ -142,7 +142,7 @@
|
|||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/SaveInfo', ['user_id'=>$v['user_id'], 'alipay_life_user_id'=>$v['alipay_life_user_id']])}}">
|
||||
<a href="{{:U('Admin/AlipayLifeMessage/SaveInfo', ['user_id'=>$v['user_id'], 'alipay_life_user_id'=>$v['alipay_life_user_id'], 'alipay_life_id'=>$v['alipay_life_id']])}}">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-send-o"> {{:L('alipay_life_user_send_text')}}</button>
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -17,17 +17,17 @@
|
|||
* @desc 异步运行url地址方法
|
||||
* @param [string] $url [url地址 支持get参数]
|
||||
*/
|
||||
function SyncJob($url)
|
||||
function SyncJob($url, $port = 80, $time = 30)
|
||||
{
|
||||
$url_str = str_replace(array('http://', 'https://'), '', $url);
|
||||
$location = strpos($url_str, '/');
|
||||
$host = substr($url_str, 0, $location);
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
$fp = fsockopen($host, 80, $errno, $errstr, 3);
|
||||
$fp = fsockopen($host, $port, $errno, $errstr, $time);
|
||||
if($fp)
|
||||
{
|
||||
$out = "GET $url HTTP/1.1\r\n";
|
||||
$out .= "Host: $host\r\n";
|
||||
$out = "GET ".str_replace($host, '', $url_str)." HTTP/1.1\r\n";
|
||||
$out .= "Host: ".$host."\r\n";
|
||||
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
|
||||
$out .= "Connection: Close\r\n\r\n";
|
||||
fputs($fp, $out);
|
||||
fclose($fp);
|
||||
|
|
|
|||
|
|
@ -349,6 +349,84 @@ class AlipayLife
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息发送
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-24
|
||||
* @desc description
|
||||
* @param [array] $data [输入参数]
|
||||
*/
|
||||
public function MessageSend($params = [])
|
||||
{
|
||||
// 参数处理
|
||||
$p = $this->RequestCommonParams();
|
||||
$p['method'] = $params['method'];
|
||||
$biz_content = [
|
||||
'msg_type' => ($params['msg_type'] == 0) ? 'text' : 'image-text',
|
||||
'chat' => isset($params['chat']) ? intval($params['chat']) : 0,
|
||||
];
|
||||
|
||||
// 消息内容
|
||||
if(empty($params['content']) || !is_array($params['content']))
|
||||
{
|
||||
return ['status'=>-1, 'msg'=>'消息内容有误'];
|
||||
}
|
||||
|
||||
// 发送类型 单条
|
||||
if($params['send_type'] == 0)
|
||||
{
|
||||
if(empty($params['alipay_openid']))
|
||||
{
|
||||
return ['status'=>-1, 'msg'=>'指定用户openid不能为空'];
|
||||
}
|
||||
$biz_content['to_user_id'] = $params['alipay_openid'];
|
||||
}
|
||||
|
||||
// 消息类型
|
||||
if($params['msg_type'] == 1)
|
||||
{
|
||||
$biz_content['articles'] = [];
|
||||
foreach($params['content'] as $k=>$v)
|
||||
{
|
||||
if($k < 10)
|
||||
{
|
||||
$biz_content['articles'][] = [
|
||||
'title' => $v['title'],
|
||||
'desc' => $v['content'],
|
||||
'image_url' => $v['out_image_url'],
|
||||
'url' => $v['url'],
|
||||
'action_name' => $v['action_name'],
|
||||
];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$biz_content['text'] = ['content'=>$params['content'][0]['content']];
|
||||
}
|
||||
$p['biz_content'] = json_encode($biz_content, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
// 生成签名
|
||||
$p['sign'] = $this->MyRsaSign($this->ArrayToUrlString($p));
|
||||
|
||||
// 请求接口
|
||||
$result = $this->HttpRequest('https://openapi.alipay.com/gateway.do', $p);
|
||||
$key = str_replace('.', '_', $p['method']).'_response';
|
||||
|
||||
// 验证签名
|
||||
if(!$this->SyncRsaVerify($result, $key))
|
||||
{
|
||||
return ['status'=>-1, 'msg'=>'签名验证错误'];
|
||||
}
|
||||
|
||||
// 状态
|
||||
if(isset($result[$key]['code']) && $result[$key]['code'] == 10000)
|
||||
{
|
||||
return ['status'=>0, 'msg'=>'发送成功'];
|
||||
}
|
||||
return ['status'=>-100, 'msg'=>$result[$key]['sub_msg'].'['.$result[$key]['code'].']'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 单条消息发送
|
||||
* @author Devil
|
||||
|
|
@ -360,46 +438,8 @@ class AlipayLife
|
|||
*/
|
||||
public function CustomSend($params = [])
|
||||
{
|
||||
// 参数处理
|
||||
$p = $this->RequestCommonParams();
|
||||
$p['method'] = 'alipay.open.public.message.custom.send';
|
||||
$biz_content = [
|
||||
'to_user_id' => $params['alipay_openid'],
|
||||
'msg_type' => ($params['msg_type'] == 0) ? 'text' : 'image-text',
|
||||
'chat' => 0,
|
||||
];
|
||||
if($params['msg_type'] == 1)
|
||||
{
|
||||
$biz_content['articles'][] = [
|
||||
'title' => isset($params['title']) ? $params['title'] : '',
|
||||
'desc' => $params['content'],
|
||||
'image_url' => $params['out_image_url'],
|
||||
'url' => $params['url'],
|
||||
'action_name' => isset($params['action_name']) ? $params['action_name'] : '',
|
||||
];
|
||||
} else {
|
||||
$biz_content['text'] = ['content'=>$params['content']];
|
||||
}
|
||||
$p['biz_content'] = json_encode($biz_content, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
// 生成签名
|
||||
$p['sign'] = $this->MyRsaSign($this->ArrayToUrlString($p));
|
||||
|
||||
// 请求接口
|
||||
$result = $this->HttpRequest('https://openapi.alipay.com/gateway.do', $p);
|
||||
|
||||
// 验证签名
|
||||
if(!$this->SyncRsaVerify($result, 'alipay_open_public_message_custom_send_response'))
|
||||
{
|
||||
return ['status'=>-1, 'msg'=>'签名验证错误'];
|
||||
}
|
||||
|
||||
// 状态
|
||||
if(isset($result['alipay_open_public_message_custom_send_response']['code']) && $result['alipay_open_public_message_custom_send_response']['code'] == 10000)
|
||||
{
|
||||
return ['status'=>0, 'msg'=>'发送成功'];
|
||||
}
|
||||
return ['status'=>-100, 'msg'=>$result['alipay_open_public_message_custom_send_response']['sub_msg'].'['.$result['alipay_open_public_message_custom_send_response']['code'].']'];
|
||||
$params['method'] = 'alipay.open.public.message.custom.send';
|
||||
return $this->MessageSend($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -413,48 +453,8 @@ class AlipayLife
|
|||
*/
|
||||
public function GroupSend($params = [])
|
||||
{
|
||||
// 参数处理
|
||||
$p = $this->RequestCommonParams();
|
||||
$p['method'] = 'alipay.open.public.message.total.send';
|
||||
$biz_content = [
|
||||
'msg_type' => ($params['msg_type'] == 0) ? 'text' : 'image-text',
|
||||
'chat' => 0,
|
||||
];
|
||||
if($params['msg_type'] == 1)
|
||||
{
|
||||
$biz_content['articles'][] = [
|
||||
'title' => $params['title'],
|
||||
'desc' => $params['content'],
|
||||
'image_url' => $params['out_image_url'],
|
||||
'url' => $params['url'],
|
||||
'action_name' => isset($params['action_name']) ? $params['action_name'] : '',
|
||||
];
|
||||
} else {
|
||||
$biz_content['text'] = [
|
||||
'content' => $params['content'],
|
||||
'title' => $params['title'],
|
||||
];
|
||||
}
|
||||
$p['biz_content'] = json_encode($biz_content, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
// 生成签名
|
||||
$p['sign'] = $this->MyRsaSign($this->ArrayToUrlString($p));
|
||||
|
||||
// 请求接口
|
||||
$result = $this->HttpRequest('https://openapi.alipay.com/gateway.do', $p);
|
||||
|
||||
// 验证签名
|
||||
if(!$this->SyncRsaVerify($result, 'alipay_open_public_message_total_send_response'))
|
||||
{
|
||||
return ['status'=>-1, 'msg'=>'签名验证错误'];
|
||||
}
|
||||
|
||||
// 状态
|
||||
if(isset($result['alipay_open_public_message_total_send_response']['code']) && $result['alipay_open_public_message_total_send_response']['code'] == 10000)
|
||||
{
|
||||
return ['status'=>0, 'msg'=>'发送成功'];
|
||||
}
|
||||
return ['status'=>-100, 'msg'=>$result['alipay_open_public_message_total_send_response']['sub_msg'].'['.$result['alipay_open_public_message_total_send_response']['code'].']'];
|
||||
$params['method'] = 'alipay.open.public.message.total.send';
|
||||
return $this->MessageSend($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
//000000000000a:152:{i:41;s:12:"config_index";i:42;s:11:"config_save";i:81;s:10:"site_index";i:103;s:10:"site_index";i:105;s:9:"site_save";i:104;s:9:"sms_index";i:107;s:8:"sms_save";i:219;s:11:"email_index";i:220;s:10:"email_save";i:221;s:15:"email_emailtest";i:199;s:9:"seo_index";i:200;s:8:"seo_save";i:1;s:11:"power_index";i:22;s:11:"admin_index";i:19;s:14:"admin_saveinfo";i:20;s:10:"admin_save";i:21;s:12:"admin_delete";i:4;s:10:"power_role";i:17;s:18:"power_rolesaveinfo";i:18;s:14:"power_rolesave";i:23;s:16:"power_roledelete";i:13;s:11:"power_index";i:15;s:15:"power_powersave";i:16;s:17:"power_powerdelete";i:126;s:10:"user_index";i:127;s:10:"user_index";i:128;s:13:"user_saveinfo";i:129;s:9:"user_save";i:130;s:11:"user_delete";i:146;s:16:"user_excelexport";i:38;s:11:"goods_index";i:39;s:11:"goods_index";i:57;s:14:"goods_saveinfo";i:58;s:10:"goods_save";i:59;s:12:"goods_delete";i:181;s:19:"goods_statusshelves";i:218;s:27:"goods_statushomerecommended";i:201;s:19:"goodscategory_index";i:202;s:18:"goodscategory_save";i:203;s:20:"goodscategory_delete";i:177;s:11:"order_index";i:178;s:11:"order_index";i:179;s:12:"order_delete";i:180;s:12:"order_cancel";i:267;s:14:"order_delivery";i:268;s:13:"order_collect";i:269;s:9:"order_pay";i:213;s:12:"answer_index";i:214;s:12:"answer_index";i:215;s:11:"answer_save";i:216;s:13:"answer_delete";i:217;s:19:"answer_statusupdate";i:222;s:16:"navigation_index";i:223;s:16:"navigation_index";i:226;s:15:"navigation_save";i:227;s:17:"navigation_delete";i:228;s:23:"navigation_statusupdate";i:234;s:16:"customview_index";i:235;s:19:"customview_saveinfo";i:236;s:15:"customview_save";i:237;s:17:"customview_delete";i:238;s:23:"customview_statusupdate";i:239;s:10:"link_index";i:240;s:13:"link_saveinfo";i:241;s:9:"link_save";i:242;s:11:"link_delete";i:243;s:17:"link_statusupdate";i:244;s:11:"theme_index";i:245;s:10:"theme_save";i:246;s:12:"theme_upload";i:247;s:12:"theme_delete";i:252;s:11:"brand_index";i:249;s:11:"brand_index";i:256;s:14:"brand_saveinfo";i:250;s:10:"brand_save";i:257;s:17:"brand_stateupdate";i:251;s:12:"brand_delete";i:253;s:19:"brandcategory_index";i:254;s:18:"brandcategory_save";i:255;s:20:"brandcategory_delete";i:270;s:16:"alipaylife_index";i:271;s:16:"alipaylife_index";i:272;s:19:"alipaylife_saveinfo";i:273;s:15:"alipaylife_save";i:284;s:23:"alipaylife_statusupdate";i:274;s:17:"alipaylife_delete";i:281;s:24:"alipaylifecategory_index";i:282;s:23:"alipaylifecategory_save";i:283;s:25:"alipaylifecategory_delete";i:275;s:23:"alipaylifemessage_index";i:276;s:26:"alipaylifemessage_saveinfo";i:277;s:22:"alipaylifemessage_save";i:278;s:24:"alipaylifemessage_delete";i:285;s:22:"alipaylifemessage_send";i:279;s:20:"alipaylifeuser_index";i:280;s:21:"alipaylifeuser_delete";i:204;s:13:"article_index";i:205;s:13:"article_index";i:206;s:16:"article_saveinfo";i:207;s:12:"article_save";i:208;s:14:"article_delete";i:209;s:20:"article_statusupdate";i:248;s:29:"article_statushomerecommended";i:210;s:21:"articlecategory_index";i:211;s:20:"articlecategory_save";i:212;s:22:"articlecategory_delete";i:162;s:15:"marketing_index";i:163;s:12:"coupon_index";i:164;s:18:"coupon_stateupdate";i:165;s:15:"coupon_saveinfo";i:166;s:11:"coupon_save";i:167;s:11:"coupon_user";i:168;s:13:"coupon_delete";i:169;s:15:"coupon_sendinfo";i:170;s:11:"coupon_send";i:171;s:16:"coupon_userquery";i:182;s:10:"data_index";i:183;s:13:"message_index";i:184;s:14:"message_delete";i:185;s:12:"paylog_index";i:186;s:21:"userintegrallog_index";i:187;s:15:"complaint_index";i:188;s:14:"complaint_save";i:189;s:16:"complaint_delete";i:152;s:15:"resources_index";i:153;s:12:"region_index";i:154;s:11:"region_save";i:155;s:13:"region_delete";i:156;s:13:"express_index";i:157;s:12:"express_save";i:158;s:14:"express_delete";i:172;s:11:"slide_index";i:173;s:14:"slide_saveinfo";i:174;s:10:"slide_save";i:175;s:17:"slide_stateupdate";i:176;s:12:"slide_delete";i:193;s:20:"screeningprice_index";i:194;s:19:"screeningprice_save";i:258;s:21:"screeningprice_delete";i:259;s:13:"payment_index";i:260;s:16:"payment_saveinfo";i:261;s:12:"payment_save";i:262;s:14:"payment_delete";i:263;s:15:"payment_install";i:264;s:20:"payment_statusupdate";i:265;s:17:"payment_uninstall";i:266;s:14:"payment_upload";i:118;s:10:"tool_index";i:119;s:11:"cache_index";i:120;s:16:"cache_siteupdate";i:121;s:20:"cache_templateupdate";i:122;s:18:"cache_moduleupdate";}
|
||||
//000000000000a:156:{i:41;s:12:"config_index";i:42;s:11:"config_save";i:81;s:10:"site_index";i:103;s:10:"site_index";i:105;s:9:"site_save";i:104;s:9:"sms_index";i:107;s:8:"sms_save";i:219;s:11:"email_index";i:220;s:10:"email_save";i:221;s:15:"email_emailtest";i:199;s:9:"seo_index";i:200;s:8:"seo_save";i:1;s:11:"power_index";i:22;s:11:"admin_index";i:19;s:14:"admin_saveinfo";i:20;s:10:"admin_save";i:21;s:12:"admin_delete";i:4;s:10:"power_role";i:17;s:18:"power_rolesaveinfo";i:18;s:14:"power_rolesave";i:23;s:16:"power_roledelete";i:13;s:11:"power_index";i:15;s:15:"power_powersave";i:16;s:17:"power_powerdelete";i:126;s:10:"user_index";i:127;s:10:"user_index";i:128;s:13:"user_saveinfo";i:129;s:9:"user_save";i:130;s:11:"user_delete";i:146;s:16:"user_excelexport";i:38;s:11:"goods_index";i:39;s:11:"goods_index";i:57;s:14:"goods_saveinfo";i:58;s:10:"goods_save";i:59;s:12:"goods_delete";i:181;s:19:"goods_statusshelves";i:218;s:27:"goods_statushomerecommended";i:201;s:19:"goodscategory_index";i:202;s:18:"goodscategory_save";i:203;s:20:"goodscategory_delete";i:177;s:11:"order_index";i:178;s:11:"order_index";i:179;s:12:"order_delete";i:180;s:12:"order_cancel";i:267;s:14:"order_delivery";i:268;s:13:"order_collect";i:269;s:9:"order_pay";i:213;s:12:"answer_index";i:214;s:12:"answer_index";i:215;s:11:"answer_save";i:216;s:13:"answer_delete";i:217;s:19:"answer_statusupdate";i:222;s:16:"navigation_index";i:223;s:16:"navigation_index";i:226;s:15:"navigation_save";i:227;s:17:"navigation_delete";i:228;s:23:"navigation_statusupdate";i:234;s:16:"customview_index";i:235;s:19:"customview_saveinfo";i:236;s:15:"customview_save";i:237;s:17:"customview_delete";i:238;s:23:"customview_statusupdate";i:239;s:10:"link_index";i:240;s:13:"link_saveinfo";i:241;s:9:"link_save";i:242;s:11:"link_delete";i:243;s:17:"link_statusupdate";i:244;s:11:"theme_index";i:245;s:10:"theme_save";i:246;s:12:"theme_upload";i:247;s:12:"theme_delete";i:252;s:11:"brand_index";i:249;s:11:"brand_index";i:256;s:14:"brand_saveinfo";i:250;s:10:"brand_save";i:257;s:17:"brand_stateupdate";i:251;s:12:"brand_delete";i:253;s:19:"brandcategory_index";i:254;s:18:"brandcategory_save";i:255;s:20:"brandcategory_delete";i:270;s:16:"alipaylife_index";i:271;s:16:"alipaylife_index";i:272;s:19:"alipaylife_saveinfo";i:273;s:15:"alipaylife_save";i:284;s:23:"alipaylife_statusupdate";i:274;s:17:"alipaylife_delete";i:281;s:24:"alipaylifecategory_index";i:282;s:23:"alipaylifecategory_save";i:283;s:25:"alipaylifecategory_delete";i:275;s:23:"alipaylifemessage_index";i:276;s:26:"alipaylifemessage_saveinfo";i:277;s:22:"alipaylifemessage_save";i:278;s:24:"alipaylifemessage_delete";i:285;s:22:"alipaylifemessage_send";i:286;s:24:"alipaylifemessage_search";i:287;s:30:"alipaylifemessage_contentindex";i:288;s:33:"alipaylifemessage_contentsaveinfo";i:289;s:29:"alipaylifemessage_contentsave";i:279;s:20:"alipaylifeuser_index";i:280;s:21:"alipaylifeuser_delete";i:204;s:13:"article_index";i:205;s:13:"article_index";i:206;s:16:"article_saveinfo";i:207;s:12:"article_save";i:208;s:14:"article_delete";i:209;s:20:"article_statusupdate";i:248;s:29:"article_statushomerecommended";i:210;s:21:"articlecategory_index";i:211;s:20:"articlecategory_save";i:212;s:22:"articlecategory_delete";i:162;s:15:"marketing_index";i:163;s:12:"coupon_index";i:164;s:18:"coupon_stateupdate";i:165;s:15:"coupon_saveinfo";i:166;s:11:"coupon_save";i:167;s:11:"coupon_user";i:168;s:13:"coupon_delete";i:169;s:15:"coupon_sendinfo";i:170;s:11:"coupon_send";i:171;s:16:"coupon_userquery";i:182;s:10:"data_index";i:183;s:13:"message_index";i:184;s:14:"message_delete";i:185;s:12:"paylog_index";i:186;s:21:"userintegrallog_index";i:187;s:15:"complaint_index";i:188;s:14:"complaint_save";i:189;s:16:"complaint_delete";i:152;s:15:"resources_index";i:153;s:12:"region_index";i:154;s:11:"region_save";i:155;s:13:"region_delete";i:156;s:13:"express_index";i:157;s:12:"express_save";i:158;s:14:"express_delete";i:172;s:11:"slide_index";i:173;s:14:"slide_saveinfo";i:174;s:10:"slide_save";i:175;s:17:"slide_stateupdate";i:176;s:12:"slide_delete";i:193;s:20:"screeningprice_index";i:194;s:19:"screeningprice_save";i:258;s:21:"screeningprice_delete";i:259;s:13:"payment_index";i:260;s:16:"payment_saveinfo";i:261;s:12:"payment_save";i:262;s:14:"payment_delete";i:263;s:15:"payment_install";i:264;s:20:"payment_statusupdate";i:265;s:17:"payment_uninstall";i:266;s:14:"payment_upload";i:118;s:10:"tool_index";i:119;s:11:"cache_index";i:120;s:16:"cache_siteupdate";i:121;s:20:"cache_templateupdate";i:122;s:18:"cache_moduleupdate";}
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -29,15 +29,64 @@ class AlipayLifeService
|
|||
return $ret;
|
||||
}
|
||||
|
||||
// 开始处理业务
|
||||
// 数据项
|
||||
$data = [
|
||||
'user_id' => isset($params['user_id']) ? intval($params['user_id']) : 0,
|
||||
'alipay_life_user_id' => isset($params['alipay_life_user_id']) ? intval($params['alipay_life_user_id']) : 0,
|
||||
'alipay_life_id' => empty($params['alipay_life_id']) ? 0 : intval($params['alipay_life_id']),
|
||||
'alipay_life_category_id' => empty($params['alipay_life_category_id']) ? '' : json_encode(explode(',', $params['alipay_life_category_id'])),
|
||||
'type' => intval($params['type']),
|
||||
'alipay_life_ids' => empty($params['alipay_life_ids']) ? 0 : json_encode(explode(',', $params['alipay_life_ids'])),
|
||||
'msg_type' => intval($params['msg_type']),
|
||||
'send_type' => intval($params['send_type']),
|
||||
'status' => 0,
|
||||
];
|
||||
|
||||
// 开始处理业务
|
||||
$status = false;
|
||||
$m = M('AlipayLifeMessage');
|
||||
if(empty($params['id']))
|
||||
{
|
||||
$data['add_time'] = time();
|
||||
if($m->add($data))
|
||||
{
|
||||
$status = true;
|
||||
$msg = L('common_operation_add_success');
|
||||
} else {
|
||||
$msg = L('common_operation_add_error');
|
||||
}
|
||||
} else {
|
||||
$data['upd_time'] = time();
|
||||
if($m->where(array('id'=>intval(I('id'))))->save($data))
|
||||
{
|
||||
$status = true;
|
||||
$msg = L('common_operation_edit_success');
|
||||
} else {
|
||||
$msg = L('common_operation_edit_error');
|
||||
}
|
||||
}
|
||||
|
||||
return DataReturn($msg, $status ? 0 : -100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息添加
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-24
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function MessageContentAdd($params = [])
|
||||
{
|
||||
// 参数校验
|
||||
$ret = self::MessageContentAddCheck($params);
|
||||
if($ret['code'] != 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// 开始处理业务
|
||||
$data = [
|
||||
'alipay_life_message_id' => intval($params['message_id']),
|
||||
'title' => I('title', '', null, $params),
|
||||
'content' => I('content', '', null, $params),
|
||||
'url' => I('url', '', null, $params),
|
||||
|
|
@ -57,14 +106,15 @@ class AlipayLifeService
|
|||
$data['image_url'] = $ret['data']['url'];
|
||||
|
||||
// 图片上传至支付宝
|
||||
$alipay_life_id = $data['alipay_life_id'];
|
||||
if(empty($alipay_life_id))
|
||||
$alipay_life_message = M('AlipayLifeMessage')->find($data['alipay_life_message_id']);
|
||||
if(!empty($alipay_life_message))
|
||||
{
|
||||
if($data['send_type'] == 1 && !empty($data['alipay_life_category_id']))
|
||||
if($alipay_life_message['send_type'] == 1 && !empty($alipay_life_message['alipay_life_ids']))
|
||||
{
|
||||
$alipay_life_id = M('AlipayLifeCategoryJoin')->where(['alipay_life_category_id'=>json_decode($data['alipay_life_category_id'], true)[0]])->getField('alipay_life_id');
|
||||
$alipay_life_ids = json_decode($alipay_life_message['alipay_life_ids'], true);
|
||||
$$alipay_life_id = isset($alipay_life_ids[0]) ? $alipay_life_ids[0] : '';
|
||||
} else {
|
||||
$alipay_life_id = M('AlipayLifeUser')->where(['id'=>$data['alipay_life_user_id']])->getField('alipay_life_id');
|
||||
$alipay_life_id = M('AlipayLifeUser')->where(['id'=>$alipay_life_message['alipay_life_user_id']])->getField('alipay_life_id');
|
||||
}
|
||||
}
|
||||
if(!empty($alipay_life_id))
|
||||
|
|
@ -76,11 +126,31 @@ class AlipayLifeService
|
|||
}
|
||||
}
|
||||
|
||||
if(M('AlipayLifeMessage')->add($data))
|
||||
// 开始处理业务
|
||||
$status = false;
|
||||
$m = M('AlipayLifeMessageContent');
|
||||
if(empty($params['id']))
|
||||
{
|
||||
return DataReturn(L('common_operation_add_success'), 0);
|
||||
$data['add_time'] = time();
|
||||
if($m->add($data))
|
||||
{
|
||||
$status = true;
|
||||
$msg = L('common_operation_add_success');
|
||||
} else {
|
||||
$msg = L('common_operation_add_error');
|
||||
}
|
||||
} else {
|
||||
$data['upd_time'] = time();
|
||||
if($m->where(array('id'=>intval(I('id'))))->save($data))
|
||||
{
|
||||
$status = true;
|
||||
$msg = L('common_operation_edit_success');
|
||||
} else {
|
||||
$msg = L('common_operation_edit_error');
|
||||
}
|
||||
}
|
||||
return DataReturn(L('common_operation_add_error'), -100);
|
||||
|
||||
return DataReturn($msg, $status ? 0 : -100);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +168,7 @@ class AlipayLifeService
|
|||
$p = [
|
||||
[
|
||||
'checked_type' => 'in',
|
||||
'key_name' => 'type',
|
||||
'key_name' => 'msg_type',
|
||||
'checked_data' => [0,1],
|
||||
'error_msg' => '消息类型有误',
|
||||
],
|
||||
|
|
@ -108,6 +178,65 @@ class AlipayLifeService
|
|||
'checked_data' => [0,1],
|
||||
'error_msg' => '发送类型有误',
|
||||
],
|
||||
];
|
||||
$ret = params_checked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 发送类型
|
||||
$p = [];
|
||||
if($params['send_type'] == 0)
|
||||
{
|
||||
$p[] = [
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'user_id',
|
||||
'error_msg' => '指定用户id有误',
|
||||
];
|
||||
$p[] = [
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'alipay_life_user_id',
|
||||
'error_msg' => '指定用户生活号关联id有误',
|
||||
];
|
||||
$p[] = [
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'alipay_life_ids',
|
||||
'error_msg' => '指定用户生活号id有误',
|
||||
];
|
||||
}
|
||||
|
||||
// 验证
|
||||
if(!empty($p))
|
||||
{
|
||||
$ret = params_checked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
}
|
||||
|
||||
return DataReturn('验证成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息内容添加参数校验
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-24
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function MessageContentAddCheck($params = [])
|
||||
{
|
||||
// 基础参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'message_id',
|
||||
'error_msg' => '消息id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'title',
|
||||
|
|
@ -125,35 +254,8 @@ class AlipayLifeService
|
|||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 发送类型
|
||||
$p = [];
|
||||
switch($params['send_type'])
|
||||
{
|
||||
// 单条
|
||||
case 0 :
|
||||
$p[] = [
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'user_id',
|
||||
'error_msg' => '指定用户id有误',
|
||||
];
|
||||
$p[] = [
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'alipay_life_user_id',
|
||||
'error_msg' => '指定生活号用户id有误',
|
||||
];
|
||||
break;
|
||||
|
||||
// 批量
|
||||
case 1 :
|
||||
if(empty($params['alipay_life_category_id']) && empty($params['alipay_life_id']))
|
||||
{
|
||||
return DataReturn('批量id有误', -1);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// 图文
|
||||
$p = [];
|
||||
if($params['type'] == 1)
|
||||
{
|
||||
// 图片
|
||||
|
|
@ -317,13 +419,7 @@ class AlipayLifeService
|
|||
$data = [];
|
||||
if($message['send_type'] == 1)
|
||||
{
|
||||
if(!empty($message['alipay_life_category_id']))
|
||||
{
|
||||
$category_all = json_decode($message['alipay_life_category_id'], true);
|
||||
$alipay_life_all = M('AlipayLifeCategoryJoin')->where(['alipay_life_category_id'=>['in', $category_all]])->group('alipay_life_id')->getField('alipay_life_id', true);
|
||||
} else {
|
||||
$alipay_life_all = [$message['alipay_life_id']];
|
||||
}
|
||||
$alipay_life_all = json_decode($message['alipay_life_ids'], true);
|
||||
foreach($alipay_life_all as $alipay_life_id)
|
||||
{
|
||||
$data[] = [
|
||||
|
|
@ -352,8 +448,8 @@ class AlipayLifeService
|
|||
{
|
||||
if($m->where(['id'=>$message['id']])->save(['status'=>1, 'send_startup_time'=>time(), 'upd_time'=>time()]) !== false)
|
||||
{
|
||||
self::SyncJobSend($message['id']);
|
||||
$m->commit();
|
||||
self::SyncJobSend($message['id']);
|
||||
return DataReturn(L('common_submit_success'), 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -410,19 +506,17 @@ class AlipayLifeService
|
|||
// 发送消息类型
|
||||
if($message['send_type'] == 1)
|
||||
{
|
||||
if(!empty($message['alipay_life_category_id']))
|
||||
{
|
||||
$category_all = json_decode($message['alipay_life_category_id'], true);
|
||||
$alipay_life_all = M('AlipayLifeCategoryJoin')->where(['alipay_life_category_id'=>['in', $category_all]])->group('alipay_life_id')->getField('alipay_life_id', true);
|
||||
} else {
|
||||
$alipay_life_all = [$message['alipay_life_id']];
|
||||
}
|
||||
$alipay_life_all = json_decode($message['alipay_life_ids'], true);
|
||||
} else {
|
||||
$alipay_life_all = [M('AlipayLifeUser')->where(['id'=>$message['alipay_life_user_id']])->getField('alipay_life_id')];
|
||||
}
|
||||
|
||||
// 消息类型
|
||||
$message['msg_type'] = $message['type'];
|
||||
// 消息内容
|
||||
$message['content'] = M('AlipayLifeMessageContent')->field('id,title,content,out_image_url,url,action_name')->where(['alipay_life_message_id'=>$message['id']])->select();
|
||||
if(empty($message['content']))
|
||||
{
|
||||
die('[time:'.date('Y-m-d H:i:s')."][msg:{$message['id']}消息内容为空]\n\n");
|
||||
}
|
||||
|
||||
// 生活号循环处理
|
||||
$detail_m = M('AlipayLifeMessageDetail');
|
||||
|
|
@ -475,5 +569,41 @@ class AlipayLifeService
|
|||
// end
|
||||
die('[end_time:'.date('Y-m-d H:i:s')."][msg:处理结束]\n\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* 生活号搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-29
|
||||
* @desc description
|
||||
* @param array $params [description]
|
||||
*/
|
||||
public static function AlipayLifeSearch($params = [])
|
||||
{
|
||||
$where = ['l.is_shelves'=>1];
|
||||
|
||||
// 分类
|
||||
if(!empty($params['category_id']))
|
||||
{
|
||||
$where['lc.alipay_life_category_id'] = intval($params['category_id']);
|
||||
}
|
||||
|
||||
// 关键字
|
||||
if(!empty($params['keywords']))
|
||||
{
|
||||
$where['l.name'] = ['like', '%'.I('keywords', '', '', $params).'%'];
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
$data = M('AlipayLife')->alias('l')->join(' INNER JOIN __ALIPAY_LIFE_CATEGORY_JOIN__ AS lc ON l.id=lc.alipay_life_id')->field('l.id,l.name')->group('l.id')->where($where)->select();
|
||||
|
||||
if(empty($data))
|
||||
{
|
||||
return DataReturn(L('common_not_data_tips'), -100);
|
||||
} else {
|
||||
return DataReturn(L('common_operation_success'), 0, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -15,4 +15,78 @@
|
|||
}
|
||||
@media only screen and (max-width: 321px) {
|
||||
.view-operation button { margin: 2px 0px; }
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
.life-container .life-form-category, .life-container .chosen-container, .life-container .life-form-keywords {
|
||||
width: 30% !important;
|
||||
}
|
||||
.life-container .chosen-container, .life-container .life-form-keywords {
|
||||
display: -webkit-inline-box !important;
|
||||
}
|
||||
.life-container .chosen-single {
|
||||
width: 100%;
|
||||
}
|
||||
.life-container .life-form {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.life-list {
|
||||
overflow: hidden;
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
}
|
||||
.life-list .life-items {
|
||||
width: calc(50% - 50px);
|
||||
height: 300px;
|
||||
}
|
||||
.life-list .life-items .title {
|
||||
text-align: center;
|
||||
}
|
||||
.life-list .life-items .life-content {
|
||||
border: 1px solid #eee;
|
||||
height: calc(100% - 25px);
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.life-list .life-items .life-content li {
|
||||
padding: 5px;
|
||||
border-style: dotted;
|
||||
border-color: #eaeaea;
|
||||
border-width: 1px 0;
|
||||
}
|
||||
.life-list .life-items .life-content li:nth-child(2) {
|
||||
border-top: 0;
|
||||
}
|
||||
.life-list .life-items .life-content li i {
|
||||
cursor: pointer;
|
||||
padding: 0 10px 0 5px;
|
||||
}
|
||||
.life-list .selected-all {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: calc(50% - 30px);
|
||||
}
|
||||
.life-container input[name="alipay_life_ids"] {
|
||||
position: absolute;
|
||||
left: -1000000px;
|
||||
top: -1000000px;
|
||||
}
|
||||
.life-list i {
|
||||
color: #888 !important;
|
||||
}
|
||||
.am-form-error .life-items .life-content {
|
||||
border-color: #dd514c;
|
||||
}
|
||||
@media only screen and (max-width: 641px) {
|
||||
.life-container .life-form-category, .life-container .life-form-keywords
|
||||
{
|
||||
width: calc(55% - 60px) !important;
|
||||
display: -webkit-inline-box !important;
|
||||
}
|
||||
.life-container .chosen-container {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,18 +5,47 @@ $(function()
|
|||
{
|
||||
if($('ul.ul-right').find('.items-li-'+value).length == 0)
|
||||
{
|
||||
var html = '<li class="items-li-'+value+'"><span class="name" data-value="'+value+'">'+name+'</span><i class="am-icon-trash-o am-fr"></i></li>';
|
||||
var html = '<li class="am-animation-slide-bottom items-li-'+value+'"><span class="name" data-value="'+value+'">'+name+'</span><i class="am-icon-trash-o am-fr"></i></li>';
|
||||
$('ul.ul-right').append(html);
|
||||
}
|
||||
|
||||
// 右侧数据同步
|
||||
RightElementAlipayLife();
|
||||
|
||||
// 左侧是否还有内容
|
||||
if($('ul.ul-left li').length == 0)
|
||||
{
|
||||
$('ul.ul-left .table-no').removeClass('none');
|
||||
} else {
|
||||
$('ul.ul-left .table-no').addClass('none');
|
||||
}
|
||||
}
|
||||
|
||||
// 批量-生活号id同步
|
||||
function RightElementAlipayLife()
|
||||
{
|
||||
var value_all = [];
|
||||
$('ul.ul-right li').each(function(k, v)
|
||||
{
|
||||
value_all[k] = $(this).find('span.name').data('value');
|
||||
});
|
||||
$('.life-container input[name="alipay_life_ids"]').val(value_all.join(',')).blur();
|
||||
|
||||
// 右侧是否还有数据
|
||||
if($('ul.ul-right li').length == 0)
|
||||
{
|
||||
$('ul.ul-right .table-no').removeClass('none');
|
||||
} else {
|
||||
$('ul.ul-right .table-no').addClass('none');
|
||||
}
|
||||
}
|
||||
// 左侧点击到右侧
|
||||
$('ul.ul-left i.am-icon-angle-right').on('click', function()
|
||||
$('ul.ul-left').on('click', 'i.am-icon-angle-right', function()
|
||||
{
|
||||
var value = $(this).prev().data('value');
|
||||
var name = $(this).prev().text();
|
||||
RightElementAdd(value, name);
|
||||
$(this).parent().remove();
|
||||
return false;
|
||||
RightElementAdd(value, name);
|
||||
});
|
||||
|
||||
// 左侧全部移动到右侧
|
||||
|
|
@ -26,16 +55,53 @@ $(function()
|
|||
{
|
||||
var value = $(this).find('span.name').data('value');
|
||||
var name = $(this).find('span.name').text();
|
||||
RightElementAdd(value, name);
|
||||
$(this).remove();
|
||||
RightElementAdd(value, name);
|
||||
});
|
||||
});
|
||||
|
||||
// 右侧删除
|
||||
$('ul.ul-right i.am-icon-trash-o').on('click', function()
|
||||
$('ul.ul-right').on('click', 'i.am-icon-trash-o', function()
|
||||
{
|
||||
$(this).parent().remove();
|
||||
return false;
|
||||
RightElementAlipayLife();
|
||||
});
|
||||
|
||||
// 生活号搜索
|
||||
$('.life-form .search-submit').on('click', function()
|
||||
{
|
||||
var category_id = $('.life-form .life-form-category').val();
|
||||
var keywords = $('.life-form .life-form-keywords').val();
|
||||
console.log(category_id, keywords)
|
||||
|
||||
// ajax请求
|
||||
$.ajax({
|
||||
url:$('.life-form').data('search-url'),
|
||||
type:'POST',
|
||||
dataType:"json",
|
||||
timeout:10000,
|
||||
data:{"category_id": category_id, "keywords": keywords},
|
||||
success:function(result)
|
||||
{
|
||||
if(result.code == 0)
|
||||
{
|
||||
var html = '';
|
||||
for(var i in result.data)
|
||||
{
|
||||
html += '<li class="am-animation-slide-bottom"><span class="name" data-value="'+result['data'][i]['id']+'">'+result['data'][i]['name']+'</span><i class="am-icon-angle-right am-fr"></i></li>';
|
||||
}
|
||||
$('ul.ul-left .table-no').addClass('none');
|
||||
$('ul.ul-left li').remove();
|
||||
$('ul.ul-left').append(html);
|
||||
} else {
|
||||
Prompt(result.msg);
|
||||
}
|
||||
},
|
||||
error:function()
|
||||
{
|
||||
Prompt('网络异常错误');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Loading…
Reference in New Issue