修改用户及微信关键字

This commit is contained in:
Anyon 2020-01-03 14:42:49 +08:00
parent 21b3b903cf
commit 20e55ed8a2
4 changed files with 34 additions and 59 deletions

View File

@ -19,8 +19,8 @@
<label class="layui-col-xs5 relative">
<span class="color-green font-w7">用户昵称</span>
<span class="color-desc margin-left-5">Nickname</span>
<input name="nickname" value='{$vo.nickname|default=""}' placeholder="请输入用户的昵称" class="layui-input">
<span class="help-block">可选,用于显示账号名称,请尽量保持不要重复</span>
<input name="nickname" value='{$vo.nickname|default=""}' required placeholder="请输入用户的昵称" class="layui-input">
<span class="help-block">用户展示的账号名称,请尽量保持不要重复</span>
</label>
</fieldset>

View File

@ -25,9 +25,7 @@
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap'>用户信息</th>
<th class='text-left nowrap layui-hide-xs'>联系方式</th>
<th class='text-left nowrap layui-hide-xs'>最近登录</th>
<th class='text-left nowrap' width="25%">账号信息</th>
<th class='text-left nowrap'>账号状态</th>
<th></th>
</tr>
@ -45,21 +43,15 @@
<td class='text-left nowrap'>
<img alt="img" width="40px" height="40px" class="text-top margin-right-10" data-tips-image src="{$vo.headimg|default=''}">
<div class="inline-block">
登录账号:{$vo.username|default=''}<br>
账号昵称:{$vo.nickname|default='<span class="color-desc">未配置账号昵称</span>'|raw}<br>
登录账号 <b class="color-blue">{$vo.username|default=''}</b>,账号昵称 <b class="color-blue">{$vo.nickname|default='<span class="color-desc">未配置账号昵称</span>'|raw}</b><br>
联系手机 <span class="color-blue">{$vo.contact_phone|default='<i class="color-desc">未配置联系手机</i>'|raw}</span>
联系邮箱 <span class="color-blue">{$vo.contact_mail|default='<i class="color-desc">未配置联系邮箱</i>'|raw}</span>
</div>
</td>
<td class='text-left nowrap layui-hide-xs'>
联系邮箱:{$vo.contact_mail|default='<span class="color-desc">未配置联系邮箱</span>'|raw}<br>
联系手机:{$vo.contact_phone|default='<span class="color-desc">未配置联系手机</span>'|raw}<br>
</td>
<td class='text-left nowrap layui-hide-xs'>
登录次数:{$vo.login_num|default=0}<br>
登录地址:{$vo.login_ip|default='--'}<br>
</td>
<td class='text-left nowrap'>
账号状态:{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}<br>
创建时间:{$vo.create_at|format_datetime}
共登录了 <b class="color-blue">{$vo.login_num|default=0}</b> 次,
最后访问 <b class="color-blue">{$vo.login_ip|default='--'}</b><br>
账号创建于 <i class="color-blue">{$vo.create_at|format_datetime}</i>,当前 {eq name='vo.status' value='0'}<b class="color-red">已禁用</b>{else}<b class="color-green">使用中</b>{/eq}
</td>
<td class='text-left nowrap'>

View File

@ -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('关键字保存失败, 请稍候再试!');
}
}

View File

@ -184,7 +184,7 @@
<div class="hr-line-dashed margin-top-10 margin-bottom-10"></div>
<button class="layui-btn menu-submit">保存数据</button>
<!--{if !isset($vo.keys) || !in_array($vo.keys,['default','subscribe'])}-->
<button data-cancel-edit class="layui-btn layui-btn-danger" type='button'>取消编辑</button>
<button data-history-back class="layui-btn layui-btn-danger" type='button'>取消编辑</button>
<!--{/if}-->
{if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'>{/if}
</div>
@ -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');
}
});