chore(电子名片): 支持控制显示视频号

This commit is contained in:
2026-01-10 10:29:45 +08:00
parent 4caaf0b9f7
commit c68903223b
6 changed files with 84 additions and 42 deletions

View File

@@ -18,16 +18,20 @@ class Personnel extends BaseModel
*/ */
public function getPersonnelSet($site_id, $app_module) public function getPersonnelSet($site_id, $app_module)
{ {
$DEFAULT_CONFIG_VALUE = '{"is_kefu":1,"is_mp":1,"is_file":1,"is_channel":1,"is_video":1,"is_map":1}';
$config = new ConfigModel(); $config = new ConfigModel();
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_PERSONNEL']]); $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_PERSONNEL']]);
if (empty($res['data']['value'])) { if (empty($res['data']['value'])) {
$res['data']['value'] = [ $res['data']['value'] = [
'personnel_bg' => '', 'personnel_bg' => '',
'value'=>'{"is_kefu":1,"is_mp":1,"is_file":1,"is_video":1,"is_map":1}' 'value' => $DEFAULT_CONFIG_VALUE
]; ];
} else { } else {
if(!isset($res['data']['value']['value'])) $res['data']['value']['value'] = '{"is_kefu":1,"is_mp":1,"is_file":1,"is_video":1,"is_map":1}'; if (!isset($res['data']['value']['value']))
$res['data']['value']['value'] = $DEFAULT_CONFIG_VALUE;
} }
//public/static/img/diy_view/member_info_bg.png //public/static/img/diy_view/member_info_bg.png
return $res; return $res;
} }
@@ -101,7 +105,8 @@ class Personnel extends BaseModel
public function deletePersonnel($id, $site_id) public function deletePersonnel($id, $site_id)
{ {
$info = model('personnel')->getInfo([['site_id', '=', $site_id], ['id', '=', $id]], 'id'); $info = model('personnel')->getInfo([['site_id', '=', $site_id], ['id', '=', $id]], 'id');
if (empty($info)) return $this->error('', '未获取到人员信息'); if (empty($info))
return $this->error('', '未获取到人员信息');
$res = model('personnel')->delete([['site_id', '=', $site_id], ['id', '=', $id]]); $res = model('personnel')->delete([['site_id', '=', $site_id], ['id', '=', $id]]);
return $this->success($res); return $this->success($res);
} }
@@ -131,7 +136,8 @@ class Personnel extends BaseModel
public function deleteMessage($id, $site_id) public function deleteMessage($id, $site_id)
{ {
$info = model('personnel_message')->getInfo([['site_id', '=', $site_id], ['id', '=', $id]], 'id'); $info = model('personnel_message')->getInfo([['site_id', '=', $site_id], ['id', '=', $id]], 'id');
if (empty($info)) return $this->error('', '未获取到留言信息'); if (empty($info))
return $this->error('', '未获取到留言信息');
$res = model('personnel_message')->delete([['site_id', '=', $site_id], ['id', '=', $id]]); $res = model('personnel_message')->delete([['site_id', '=', $site_id], ['id', '=', $id]]);
return $this->success($res); return $this->success($res);
} }

View File

@@ -54,8 +54,7 @@
<p>点击上传</p> <p>点击上传</p>
</div> </div>
</div> </div>
<input type="hidden" name="avatar_url_upload" value="{$info.avatar_url}" /> <input type="hidden" name="avatar_url_upload" value="" />
<input type="hidden" name="avatar_url" value="{$info.avatar_url}" />
<i class="del">x</i> <i class="del">x</i>
</div> </div>
</div> </div>
@@ -70,14 +69,14 @@
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">内容ID</label> <label class="layui-form-label"><span class="required">*</span>内容ID</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="feed_id" value="{$info.feed_id}" lay-verify="required" maxlength="50" autocomplete="off" placeholder="请输入视频号内容ID" class="layui-input len-long"> <input type="text" name="feed_id" value="{$info.feed_id}" lay-verify="required" maxlength="50" autocomplete="off" placeholder="请输入视频号内容ID" class="layui-input len-long">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">封面类型:</label> <label class="layui-form-label"><span class="required">*</span>封面类型:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="radio" name="cover_image_type" lay-filter="coverImageType" value="url" title="URL链接" {:$info['cover_image_type'] ? ($info['cover_image_type'] == 'url' ? 'checked' : '') : 'checked'}> <input type="radio" name="cover_image_type" lay-filter="coverImageType" value="url" title="URL链接" {:$info['cover_image_type'] ? ($info['cover_image_type'] == 'url' ? 'checked' : '') : 'checked'}>
<input type="radio" name="cover_image_type" lay-filter="coverImageType" value="upload" title="上传图片" {:$info['cover_image_type'] ? ($info['cover_image_type'] == 'upload' ? 'checked' : '') : ''}> <input type="radio" name="cover_image_type" lay-filter="coverImageType" value="upload" title="上传图片" {:$info['cover_image_type'] ? ($info['cover_image_type'] == 'upload' ? 'checked' : '') : ''}>
@@ -85,14 +84,14 @@
</div> </div>
<div class="layui-form-item" id="coverTypeUrl"> <div class="layui-form-item" id="coverTypeUrl">
<label class="layui-form-label">封面URL</label> <label class="layui-form-label"><span class="required">*</span>封面URL</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="cover_url" value="{$info.cover_url}" maxlength="255" autocomplete="off" placeholder="请输入封面URL" class="layui-input len-long"> <input type="text" name="cover_url" value="{$info.cover_url}" maxlength="255" autocomplete="off" placeholder="请输入封面URL" class="layui-input len-long">
</div> </div>
</div> </div>
<div class="layui-form-item" id="coverTypeUpload"> <div class="layui-form-item" id="coverTypeUpload">
<label class="layui-form-label">封面图:</label> <label class="layui-form-label"><span class="required">*</span>封面图:</label>
<div class="layui-input-block img-upload"> <div class="layui-input-block img-upload">
<div class="upload-img-block simple-uploading"> <div class="upload-img-block simple-uploading">
<div class="upload-img-box" id="coverImg"> <div class="upload-img-box" id="coverImg">
@@ -101,8 +100,7 @@
<p>点击上传</p> <p>点击上传</p>
</div> </div>
</div> </div>
<input type="hidden" name="cover_url_upload" value="{$info.cover_url}" /> <input type="hidden" name="cover_url_upload" value="" />
<input type="hidden" name="cover_url" value="{$info.cover_url}" />
<i class="del">x</i> <i class="del">x</i>
</div> </div>
</div> </div>
@@ -152,6 +150,7 @@
if(avatarImg){ if(avatarImg){
if(avatarImageType == 'upload'){ if(avatarImageType == 'upload'){
$("#avatarImg").html("<img src='" + ns.img(avatarImg) + "' alt='头像'>"); $("#avatarImg").html("<img src='" + ns.img(avatarImg) + "' alt='头像'>");
$("input[name='avatar_url_upload']").val(avatarImg);
imageCollection.push(avatarImg); imageCollection.push(avatarImg);
}else{ }else{
$("#avatarImg").html("<img src='" + avatarImg + "' alt='头像' style='width:100%;height:100%;object-fit:contain;'>"); $("#avatarImg").html("<img src='" + avatarImg + "' alt='头像' style='width:100%;height:100%;object-fit:contain;'>");
@@ -162,6 +161,7 @@
if(coverImg){ if(coverImg){
if(coverImageType == 'upload'){ if(coverImageType == 'upload'){
$("#coverImg").html("<img src='" + ns.img(coverImg) + "' alt='封面'>"); $("#coverImg").html("<img src='" + ns.img(coverImg) + "' alt='封面'>");
$("input[name='cover_url_upload']").val(coverImg);
}else{ }else{
$("#coverImg").html("<img src='" + coverImg + "' alt='封面' style='width:100%;height:100%;object-fit:contain;'>"); $("#coverImg").html("<img src='" + coverImg + "' alt='封面' style='width:100%;height:100%;object-fit:contain;'>");
} }
@@ -315,6 +315,8 @@
delete field.avatar_url_upload; delete field.avatar_url_upload;
delete field.cover_url_upload; delete field.cover_url_upload;
field.status = 1; field.status = 1;
console.log('添加:提交的数据', field)
formSubmit(field) formSubmit(field)
}); });
}); });

View File

@@ -54,8 +54,7 @@
<p>点击上传</p> <p>点击上传</p>
</div> </div>
</div> </div>
<input type="hidden" name="avatar_url_upload" value="{$info.avatar_url}" /> <input type="hidden" name="avatar_url_upload" value="" />
<input type="hidden" name="avatar_url" value="{$info.avatar_url}" />
<i class="del">x</i> <i class="del">x</i>
</div> </div>
</div> </div>
@@ -101,8 +100,7 @@
<p>点击上传</p> <p>点击上传</p>
</div> </div>
</div> </div>
<input type="hidden" name="cover_url_upload" value="{$info.cover_url}" /> <input type="hidden" name="cover_url_upload" value="" />
<input type="hidden" name="cover_url" value="{$info.cover_url}" />
<i class="del">x</i> <i class="del">x</i>
</div> </div>
</div> </div>
@@ -152,6 +150,7 @@
if(avatarImg){ if(avatarImg){
if(avatarImageType == 'upload'){ if(avatarImageType == 'upload'){
$("#avatarImg").html("<img src='" + ns.img(avatarImg) + "' alt='头像'>"); $("#avatarImg").html("<img src='" + ns.img(avatarImg) + "' alt='头像'>");
$("input[name='avatar_url_upload']").val(avatarImg);
imageCollection.push(avatarImg); imageCollection.push(avatarImg);
}else{ }else{
$("#avatarImg").html("<img src='" + avatarImg + "' alt='头像' style='width:100%;height:100%;object-fit:contain;'>"); $("#avatarImg").html("<img src='" + avatarImg + "' alt='头像' style='width:100%;height:100%;object-fit:contain;'>");
@@ -162,6 +161,7 @@
if(coverImg){ if(coverImg){
if(coverImageType == 'upload'){ if(coverImageType == 'upload'){
$("#coverImg").html("<img src='" + ns.img(coverImg) + "' alt='封面'>"); $("#coverImg").html("<img src='" + ns.img(coverImg) + "' alt='封面'>");
$("input[name='cover_url_upload']").val(coverImg);
}else{ }else{
$("#coverImg").html("<img src='" + coverImg + "' alt='封面' style='width:100%;height:100%;object-fit:contain;'>"); $("#coverImg").html("<img src='" + coverImg + "' alt='封面' style='width:100%;height:100%;object-fit:contain;'>");
} }
@@ -315,6 +315,8 @@
delete field.avatar_url_upload; delete field.avatar_url_upload;
delete field.cover_url_upload; delete field.cover_url_upload;
field.status = 1; field.status = 1;
console.log('编辑:提交的数据', field)
formSubmit(field) formSubmit(field)
}); });
}); });

View File

@@ -48,11 +48,11 @@
</div> </div>
</script> </script>
<!-- 视频内容信息 --> <!-- 视频内容信息 -->
<script type="text/html" id="info"> <script type="text/html" id="info">
<div class='table-title'> <div class='table-title'>
<div class='title-pic headimg'> <div class='title-pic'>
<img layer-src src="{{ns.img(d.cover_url)}}" onerror="this.src = ns.url('public/static/img/default_img/square.png')" alt="头像"> <img layer-src src="{{ns.img(d.cover_url)}}" onerror="this.src = ns.url('public/static/img/default_img/square.png')" alt="{{d.video_title}}">
</div> </div>
<div class='title-content'> <div class='title-content'>
<p class="layui-elip" style="font-size: 12px;color: #999;margin-top: 5px;">{{d.feed_id}}</p> <p class="layui-elip" style="font-size: 12px;color: #999;margin-top: 5px;">{{d.feed_id}}</p>
@@ -61,6 +61,20 @@
</div> </div>
</script> </script>
<!-- 视频号内容信息 -->
<script type="text/html" id="channelinfo">
<div class='table-title'>
<div class='title-pic headimg'>
<img layer-src src="{{ns.img(d.avatar_url)}}" onerror="this.src = ns.url('public/static/img/default_img/square.png')" alt="{{d.channel_name || '头像'}}">
</div>
<div class='title-content'>
<p class="layui-elip" style="font-size: 12px;color: #999;margin-top: 5px;">{{d.channel_id}}</p>
<p class="layui-elip" style="font-weight: 500; font-size: 13px; color:#000">{{d.channel_name}}</p>
</div>
</div>
</script>
<!-- 是否显示状态 --> <!-- 是否显示状态 -->
<script type="text/html" id="isShow"> <script type="text/html" id="isShow">
{{# if(d.is_show == 1){ }} {{# if(d.is_show == 1){ }}
@@ -101,7 +115,7 @@
{ {
field: 'video_title', field: 'video_title',
title: '视频标题', title: '视频标题',
width: '35%', width: '40%',
unresize: 'false', unresize: 'false',
templet: '#info' templet: '#info'
}, },
@@ -110,6 +124,7 @@
title: '视频号名称', title: '视频号名称',
width: '15%', width: '15%',
unresize: 'false', unresize: 'false',
templet: '#channelinfo'
}, },
{ {
field: 'channel_type', field: 'channel_type',
@@ -120,15 +135,15 @@
}, },
{ {
field: 'is_show', field: 'is_show',
title: '是否显示', title: '显示',
width: '10%', width: '5%',
unresize: 'false', unresize: 'false',
templet: '#isShow' templet: '#isShow'
}, },
{ {
field: 'sort', field: 'sort',
title: '排序', title: '排序',
width: '8%', width: '5%',
unresize: 'false' unresize: 'false'
}, },
{ {

View File

@@ -41,6 +41,10 @@
<img src="{:img('/addon/personnel/shop/view/public/img/video.png')}" style="width: 100%;"></img> <img src="{:img('/addon/personnel/shop/view/public/img/video.png')}" style="width: 100%;"></img>
</div> </div>
<div style="width: 100%;" v-if="is_channel">
<img src="{:img('/addon/personnel/shop/view/public/img/channel.png')}" style="width: 100%;" alt="视频号"></img>
</div>
<div style="width: 100%;" v-if="is_map"> <div style="width: 100%;" v-if="is_map">
<img src="{:img('/addon/personnel/shop/view/public/img/map.png')}" style="width: 100%;"></img> <img src="{:img('/addon/personnel/shop/view/public/img/map.png')}" style="width: 100%;"></img>
</div> </div>
@@ -99,6 +103,16 @@
<div v-else @click="is_video= 1" class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div> <div v-else @click="is_video= 1" class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
</div> </div>
</div> </div>
<div class="layui-form-item checkbox-wrap custom-popup">
<label class="layui-form-label sm">视频号</label>
<div class="layui-input-block">
<span v-if="is_channel== 0">隐藏</span><span v-else>显示</span>
<div v-if="is_channel!= 0" @click="is_channel= 0" class="layui-unselect layui-form-checkbox layui-form-checked" lay-skin="primary">
<i class="layui-icon layui-icon-ok"></i>
</div>
<div v-else @click="is_channel= 1" class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
</div>
</div>
<div class="layui-form-item checkbox-wrap custom-popup"> <div class="layui-form-item checkbox-wrap custom-popup">
<label class="layui-form-label sm">地图导航</label> <label class="layui-form-label sm">地图导航</label>
<div class="layui-input-block"> <div class="layui-input-block">

View File

@@ -17,6 +17,7 @@ var vue = new Vue({
is_mp: 1, is_mp: 1,
is_file: 1, is_file: 1,
is_video: 1, is_video: 1,
is_channel: 1,
is_map: 1, is_map: 1,
}, },
created: function () { created: function () {
@@ -32,6 +33,7 @@ var vue = new Vue({
this.is_file = data.is_file this.is_file = data.is_file
this.is_video = data.is_video this.is_video = data.is_video
this.is_map = data.is_map this.is_map = data.is_map
this.is_channel = data.is_channel
fullScreenSize(function () { fullScreenSize(function () {
self.lazyLoad = true; self.lazyLoad = true;
}); });
@@ -90,6 +92,7 @@ layui.use(['form'], function () {
is_mp:vue.is_mp, is_mp:vue.is_mp,
is_file:vue.is_file, is_file:vue.is_file,
is_video:vue.is_video, is_video:vue.is_video,
is_channel:vue.is_channel,
is_map:vue.is_map is_map:vue.is_map
} }
$.ajax({ $.ajax({