From 20e55ed8a2cca680e5d6e96a4559fefd6e913ac6 Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 3 Jan 2020 14:42:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E5=8F=8A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=85=B3=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/user/form.html | 4 ++-- app/admin/view/user/index.html | 22 +++++++-------------- app/wechat/controller/Keys.php | 32 +++++++++++++++---------------- app/wechat/view/keys/form.html | 35 ++++++++++------------------------ 4 files changed, 34 insertions(+), 59 deletions(-) diff --git a/app/admin/view/user/form.html b/app/admin/view/user/form.html index a690f12f5..0f3788a68 100644 --- a/app/admin/view/user/form.html +++ b/app/admin/view/user/form.html @@ -19,8 +19,8 @@ diff --git a/app/admin/view/user/index.html b/app/admin/view/user/index.html index 9ba771a06..99194d6a1 100644 --- a/app/admin/view/user/index.html +++ b/app/admin/view/user/index.html @@ -25,9 +25,7 @@ - 用户信息 - 联系方式 - 最近登录 + 账号信息 账号状态 @@ -45,21 +43,15 @@ img
- 登录账号:{$vo.username|default=''}
- 账号昵称:{$vo.nickname|default='未配置账号昵称'|raw}
+ 登录账号 {$vo.username|default=''},账号昵称 {$vo.nickname|default='未配置账号昵称'|raw}
+ 联系手机 {$vo.contact_phone|default='未配置联系手机'|raw}, + 联系邮箱 {$vo.contact_mail|default='未配置联系邮箱'|raw}
- 联系邮箱:{$vo.contact_mail|default='未配置联系邮箱'|raw}
- 联系手机:{$vo.contact_phone|default='未配置联系手机'|raw}
- - - 登录次数:{$vo.login_num|default=0}
- 登录地址:{$vo.login_ip|default='--'}
- - - 账号状态:{eq name='vo.status' value='0'}已禁用{else}使用中{/eq}
- 创建时间:{$vo.create_at|format_datetime} + 共登录了 {$vo.login_num|default=0} 次, + 最后访问 {$vo.login_ip|default='--'}
+ 账号创建于 {$vo.create_at|format_datetime},当前 {eq name='vo.status' value='0'}已禁用{else}使用中{/eq} diff --git a/app/wechat/controller/Keys.php b/app/wechat/controller/Keys.php index eba271c1f..17f2a7b59 100644 --- a/app/wechat/controller/Keys.php +++ b/app/wechat/controller/Keys.php @@ -109,17 +109,6 @@ class Keys extends Controller $this->_form($this->table, 'form'); } - /** - * 删除回复规则 - * @auth true - * @throws \think\db\exception\DbException - */ - public function remove() - { - $this->_applyFormToken(); - $this->_delete($this->table); - } - /** * 修改回复规则状态 * @auth true @@ -131,6 +120,17 @@ class Keys extends Controller $this->_save($this->table, ['status' => input('status')]); } + /** + * 删除回复规则 + * @auth true + * @throws \think\db\exception\DbException + */ + public function remove() + { + $this->_applyFormToken(); + $this->_delete($this->table); + } + /** * 配置关注回复 * @auth true @@ -188,13 +188,11 @@ class Keys extends Controller protected function _form_result($result) { if ($result !== false) { - list($url, $keys) = ['', $this->request->post('keys')]; - if (!in_array($keys, ['subscribe', 'default'])) { - $url = 'javascript:history.back()'; - } - $this->success('恭喜, 关键字保存成功!', $url); + $iskeys = in_array(input('keys'), ['subscribe', 'default']); + $location = $iskeys ? 'javascript:$.form.reload()' : 'javascript:history.back()'; + $this->success('恭喜, 关键字保存成功!', $location); } else { - $this->error('关键字保存失败, 请稍候再试!'); + $this->error('关键字保存失败, 请稍候再试!'); } } diff --git a/app/wechat/view/keys/form.html b/app/wechat/view/keys/form.html index ffffaf95c..ed0299b63 100644 --- a/app/wechat/view/keys/form.html +++ b/app/wechat/view/keys/form.html @@ -184,7 +184,7 @@
- + {if isset($vo['id'])}{/if} @@ -202,16 +202,8 @@ var $body = $('body'); - // 取消编辑返回 - $('[data-cancel-edit]').on('click', function () { - $.msg.confirm('确定取消编辑吗?', function (index) { - history.back(), $.msg.close(index); - }); - }); - // 刷新预览显示 - function showReview(params) { - var src = ''; + function showReview(params, src) { if (params['type'] === 'news') { src = '{:url("@wechat/api.review/news")}?id=_id_'.replace('_id_', params.content); } else { @@ -220,23 +212,17 @@ $('#phone-preview').attr('src', src); } - // 图文显示预览 $body.off('change', '[name="news_id"]').on('change', '[name="news_id"]', function () { + // 图文显示预览 showReview({type: 'news', content: this.value}); - }); - - // 文字显示预览 - $body.off('change', '[name="content"]').on('change', '[name="content"]', function () { + }).off('change', '[name="content"]').on('change', '[name="content"]', function () { + // 文字显示预览 showReview({type: 'text', content: this.value}); - }); - - // 图片显示预览 - $body.off('change', '[name="image_url"]').on('change', '[name="image_url"]', function () { + }).off('change', '[name="image_url"]').on('change', '[name="image_url"]', function () { + // 图片显示预览 showReview({type: 'image', content: this.value}); - }); - - // 图片显示预览 - $body.off('change', '[name="voice_url"]').on('change', '[name="voice_url"]', function () { + }).off('change', '[name="voice_url"]').on('change', '[name="voice_url"]', function () { + // 语音显示预览 showReview({type: 'voice', content: this.value}); }); @@ -271,6 +257,7 @@ case 'news': return $('[name="news_id"]').trigger('change'); case 'text': + case 'customservice': return $('[name="content"]').trigger('change'); case 'image': return $('[name="image_url"]').trigger('change'); @@ -280,8 +267,6 @@ return $('[name="music_url"]').trigger('change'); case 'voice': return $('[name="voice_url"]').trigger('change'); - case 'customservice': - return $('[name="content"]').trigger('change'); } });