diff --git a/src/addon/personnel/config/menu_shop.php b/src/addon/personnel/config/menu_shop.php index 1decf3c0e..5159956b0 100644 --- a/src/addon/personnel/config/menu_shop.php +++ b/src/addon/personnel/config/menu_shop.php @@ -112,13 +112,46 @@ return [ ], ] ], + [ + 'name' => 'PERSONNEL_CHANNEL_LIST', + 'title' => '视频号', + 'url' => 'personnel://shop/enterprise/channellists', + 'is_show' => 1, + 'sort' => 4, + 'child_list' => [ + [ + 'name' => 'PERSONNEL_CHANNEL_ADD', + 'title' => '添加视频号', + 'url' => 'personnel://shop/enterprise/channeladd', + 'sort' => 1, + 'is_show' => 0, + 'is_control' => 1, + ], + [ + 'name' => 'PERSONNEL_CHANNEL_EDIT', + 'title' => '编辑视频号', + 'url' => 'personnel://shop/enterprise/channeledit', + 'sort' => 1, + 'is_show' => 0, + 'is_control' => 1, + ], + [ + 'name' => 'PERSONNEL_CHANNEL_DELETE', + 'title' => '删除视频号', + 'url' => 'personnel://shop/enterprise/channeldelete', + 'sort' => 2, + 'is_show' => 0, + 'is_control' => 1, + ], + ] + ], [ 'name' => 'MESSAGE_ROOT', 'title' => '留言列表', 'url' => 'personnel://shop/personnel/message', 'is_show' => 1, - 'sort' => 4, + 'sort' => 5, 'child_list' => [ ], @@ -128,7 +161,7 @@ return [ 'title' => '电子名片', 'url' => 'personnel://shop/personnel/diy', 'is_show' => 1, - 'sort' => 5, + 'sort' => 6, 'child_list' => [ ], @@ -138,7 +171,7 @@ return [ 'title' => '设置', 'url' => 'personnel://shop/personnel/set', 'is_show' => 1, - 'sort' => 6, + 'sort' => 7, 'child_list' => [ ], diff --git a/src/addon/personnel/data/install.sql b/src/addon/personnel/data/install.sql index 22c382dd4..7a996ca29 100644 --- a/src/addon/personnel/data/install.sql +++ b/src/addon/personnel/data/install.sql @@ -1 +1,36 @@ -SET NAMES 'utf8'; \ No newline at end of file +SET NAMES 'utf8'; + +-- 创建视频号表 +CREATE TABLE IF NOT EXISTS `lucky_personnel_channel` +( + `channel_id` int unsigned NOT NULL AUTO_INCREMENT, + `site_id` int unsigned NOT NULL DEFAULT 0 COMMENT '站点ID', + `create_time` int unsigned NOT NULL DEFAULT 0 COMMENT '创建时间', + `channel_type` varchar(20) NOT NULL DEFAULT 'wechat' COMMENT '视频号类型:wechat-微信视频号,douyin-抖音,kuaishou-快手,redbook-小红书,bilibili-B站', + `channel_name` varchar(100) NOT NULL DEFAULT '' COMMENT '视频号ID', + `feed_id` varchar(100) NOT NULL DEFAULT '' COMMENT '视频号内容ID', + `feed_token` varchar(255) NOT NULL DEFAULT '' COMMENT '视频号视频的标识', + `avatar_image_type` varchar(10) NOT NULL DEFAULT 'upload' COMMENT '头像类型:upload-上传图片,url-URL', + `avatar_url` varchar(500) NOT NULL DEFAULT '' COMMENT '头像URL', + `video_title` varchar(200) NOT NULL DEFAULT '' COMMENT '视频标题', + `cover_image_type` varchar(10) NOT NULL DEFAULT 'upload' COMMENT '封面类型:upload-上传图片,url-URL', + `cover_url` varchar(500) NOT NULL DEFAULT '' COMMENT '封面URL', + `view_count` int unsigned NOT NULL DEFAULT 0 COMMENT '视频观看次数', + `show_view_count` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示视频观看次数:0-不显示,1-显示', + `show_follow` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示关注按钮:0-不显示,1-显示', + `is_show` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否显示:0-隐藏,1-显示', + `sort` int NOT NULL DEFAULT 0 COMMENT '排序,数值越小越靠前', + PRIMARY KEY (`channel_id`), + KEY `idx_site_id` (`site_id`), + KEY `idx_channel_type` (`channel_type`), + KEY `idx_is_show` (`is_show`), + KEY `idx_sort` (`sort`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='电子名片视频号资源表'; + +-- 插入视频号菜单权限(使用 IGNORE 避免重复插入报错) +INSERT IGNORE INTO `lucky_menu` (`app_module`, `addon`, `title`, `name`, `parent`, `level`, `url`, `is_show`, `sort`, `desc`, `is_icon`, `picture`, `picture_select`, `is_control`) +VALUES +('shop', 'personnel', '视频号', 'PERSONNEL_CHANNEL_LIST', 'PERSONNEL_ROOT', 4, 'personnel://shop/enterprise/channellists', 1, 4, '', 0, '', '', 1), +('shop', 'personnel', '添加视频号', 'PERSONNEL_CHANNEL_ADD', 'PERSONNEL_CHANNEL_LIST', 5, 'personnel://shop/enterprise/channeladd', 0, 1, '', 0, '', '', 1), +('shop', 'personnel', '编辑视频号', 'PERSONNEL_CHANNEL_EDIT', 'PERSONNEL_CHANNEL_LIST', 5, 'personnel://shop/enterprise/channeledit', 0, 1, '', 0, '', '', 1), +('shop', 'personnel', '删除视频号', 'PERSONNEL_CHANNEL_DELETE', 'PERSONNEL_CHANNEL_LIST', 5, 'personnel://shop/enterprise/channeldelete', 0, 2, '', 0, '', '', 1); \ No newline at end of file diff --git a/src/addon/personnel/data/uninstall.sql b/src/addon/personnel/data/uninstall.sql index 0b4cf1b2f..c14f8bb57 100644 --- a/src/addon/personnel/data/uninstall.sql +++ b/src/addon/personnel/data/uninstall.sql @@ -1 +1,7 @@ SET NAMES 'utf8'; + +-- 删除视频号菜单权限 +DELETE FROM `lucky_menu` WHERE `name` IN ('PERSONNEL_CHANNEL_LIST', 'PERSONNEL_CHANNEL_ADD', 'PERSONNEL_CHANNEL_EDIT', 'PERSONNEL_CHANNEL_DELETE'); + +-- 删除视频号表 +DROP TABLE IF EXISTS `lucky_personnel_channel`; \ No newline at end of file diff --git a/src/addon/personnel/data/upgrade_add_channel_fields.sql b/src/addon/personnel/data/upgrade_add_channel_fields.sql new file mode 100644 index 000000000..f58e16a0a --- /dev/null +++ b/src/addon/personnel/data/upgrade_add_channel_fields.sql @@ -0,0 +1,35 @@ +-- 升级脚本:为 personnel_channel 表添加新字段并优化表结构 +-- 执行时间: 2026-01-10 + +-- 1. 为 lucky_personnel_channel 表添加新字段 +ALTER TABLE `lucky_personnel_channel` +ADD COLUMN `feed_token` varchar(255) NOT NULL DEFAULT '' COMMENT '视频号视频的标识' AFTER `feed_id`, +ADD COLUMN `view_count` int unsigned NOT NULL DEFAULT 0 COMMENT '视频观看次数' AFTER `cover_url`, +ADD COLUMN `show_view_count` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示视频观看次数:0-不显示,1-显示' AFTER `view_count`, +ADD COLUMN `show_follow` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示关注按钮:0-不显示,1-显示' AFTER `show_view_count`; + +-- 2. 优化现有字段长度和类型 +ALTER TABLE `lucky_personnel_channel` +MODIFY COLUMN `channel_type` varchar(20) NOT NULL DEFAULT 'wechat' COMMENT '视频号类型:wechat-微信视频号,douyin-抖音,kuaishou-快手,redbook-小红书,bilibili-B站', +MODIFY COLUMN `channel_name` varchar(100) NOT NULL DEFAULT '' COMMENT '视频号名称', +MODIFY COLUMN `avatar_image_type` varchar(10) NOT NULL DEFAULT 'upload' COMMENT '头像类型:upload-上传图片,url-URL', +MODIFY COLUMN `avatar_url` varchar(500) NOT NULL DEFAULT '' COMMENT '头像URL', +MODIFY COLUMN `video_title` varchar(200) NOT NULL DEFAULT '' COMMENT '视频标题', +MODIFY COLUMN `feed_id` varchar(100) NOT NULL DEFAULT '' COMMENT '视频号内容ID', +MODIFY COLUMN `cover_image_type` varchar(10) NOT NULL DEFAULT 'upload' COMMENT '封面类型:upload-上传图片,url-URL', +MODIFY COLUMN `cover_url` varchar(500) NOT NULL DEFAULT '' COMMENT '封面URL', +MODIFY COLUMN `sort` int NOT NULL DEFAULT 0 COMMENT '排序,数值越小越靠前', +MODIFY COLUMN `is_show` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否显示:0-隐藏,1-显示', +MODIFY COLUMN `channel_id` int unsigned NOT NULL AUTO_INCREMENT, +MODIFY COLUMN `site_id` int unsigned NOT NULL DEFAULT 0 COMMENT '站点ID', +MODIFY COLUMN `create_time` int unsigned NOT NULL DEFAULT 0 COMMENT '创建时间'; + +-- 3. 添加索引优化查询性能 +ALTER TABLE `lucky_personnel_channel` +ADD INDEX `idx_site_id` (`site_id`), +ADD INDEX `idx_channel_type` (`channel_type`), +ADD INDEX `idx_is_show` (`is_show`), +ADD INDEX `idx_sort` (`sort`); + +-- 4. 修改表引擎为 InnoDB 和字符集为 utf8mb4 +ALTER TABLE `lucky_personnel_channel` ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/src/addon/personnel/model/Enterprise.php b/src/addon/personnel/model/Enterprise.php index 3c877a5d5..70fd166c7 100644 --- a/src/addon/personnel/model/Enterprise.php +++ b/src/addon/personnel/model/Enterprise.php @@ -264,4 +264,107 @@ class Enterprise extends BaseModel return $this->success($res); } + //视频号 + /** + * 获取视频号分页列表 + * @param array $condition + * @param number $page + * @param string $page_size + * @param string $order + * @param string $field + */ + public function getChannelPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'create_time desc', $field = '*') + { + $check_condition = array_column($condition, 2, 0); + $site_id = $check_condition['site_id'] ?? ''; + if ($site_id === '') { + return $this->error('', 'REQUEST_SITE_ID'); + } + + $list = model('personnel_channel')->pageList($condition, $field, $order, $page, $page_size); + return $this->success($list); + } + + /** + * 获取视频号列表 + * @param array $condition + * @param string $field + * @param string $order + * @param string $limit + */ + public function getChannelList($condition = [], $field = '*', $order = '', $limit = null) + { + $list = model('personnel_channel')->getList($condition, $field, $order, '', '', '', $limit); + return $this->success($list); + } + + /** + * 添加视频号 + * @param array $data + */ + public function addChannel($data) + { + $site_id = $data['site_id'] ?? ''; + if ($site_id === '') { + return $this->error('', 'REQUEST_SITE_ID'); + } + + $data['create_time'] = time(); + // 默认视频号类型为微信 + if (!isset($data['channel_type']) || empty($data['channel_type'])) { + $data['channel_type'] = 'wechat'; + } + $channel_id = model('personnel_channel')->add($data); + return $this->success($channel_id); + } + + /** + * 获取视频号信息 + * @param array $condition + * @param string $field + */ + public function getChannelInfo($condition = [], $field = '*') + { + $list = model('personnel_channel')->getInfo($condition, $field); + return $this->success($list); + } + + /** + * 修改视频号 + * @param array $data + */ + public function editChannel($data) + { + $site_id = $data['site_id'] ?? ''; + if ($site_id === '') { + return $this->error('', 'REQUEST_SITE_ID'); + } + + model('personnel_channel')->startTrans(); + try { + model('personnel_channel')->update($data, [ [ 'site_id', '=', $data[ 'site_id' ] ], [ 'channel_id', '=', $data[ 'channel_id' ] ] ]); + model('personnel_channel')->commit(); + return $this->success(); + } catch (\Exception $e) { + model('personnel_channel')->rollback(); + return $this->error('', $e->getMessage()); + } + } + + /** + * 删除视频号 + * @param array $condition + */ + public function deleteChannel($condition) + { + $check_condition = array_column($condition, 2, 0); + $site_id = $check_condition['site_id'] ?? ''; + if ($site_id === '') { + return $this->error('', 'REQUEST_SITE_ID'); + } + + $res = model('personnel_channel')->delete($condition); + return $this->success($res); + } + } \ No newline at end of file diff --git a/src/addon/personnel/model/Personnel.php b/src/addon/personnel/model/Personnel.php index bb353680c..41cb97840 100644 --- a/src/addon/personnel/model/Personnel.php +++ b/src/addon/personnel/model/Personnel.php @@ -9,8 +9,8 @@ class Personnel extends BaseModel { - - /** + + /** * 获取名片设置 * @param $site_id * @param $app_module @@ -18,16 +18,20 @@ class Personnel extends BaseModel */ 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(); - $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_PERSONNEL' ] ]); - if (empty($res[ 'data' ][ 'value' ])){ - $res[ 'data' ][ 'value' ] = [ + $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_PERSONNEL']]); + if (empty($res['data']['value'])) { + $res['data']['value'] = [ 'personnel_bg' => '', - 'value'=>'{"is_kefu":1,"is_mp":1,"is_file":1,"is_video":1,"is_map":1}' + 'value' => $DEFAULT_CONFIG_VALUE ]; - }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}'; + } else { + if (!isset($res['data']['value']['value'])) + $res['data']['value']['value'] = $DEFAULT_CONFIG_VALUE; } + + //public/static/img/diy_view/member_info_bg.png return $res; } @@ -42,7 +46,7 @@ class Personnel extends BaseModel public function setPersonnelSet($data, $site_id, $app_module) { $config = new ConfigModel(); - $res = $config->setConfig($data, '名片设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_PERSONNEL' ] ]); + $res = $config->setConfig($data, '名片设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_PERSONNEL']]); return $res; } @@ -63,9 +67,9 @@ class Personnel extends BaseModel public function getMessagePageList($condition = [], $field = true, $order = '', $page = 1, $list_rows = PAGE_LIST_ROWS, $alias = 'a', $join = []) { $data = model('personnel_message')->pageList($condition, $field, $order, $page, $list_rows, $alias, $join); - if (!empty($data[ 'list' ])) { - foreach ($data[ 'list' ] as $k => $item) { - $data[ 'list' ][ $k ][ 'createtime' ] = date('Y-m-d H:i:s',$item['createtime']); + if (!empty($data['list'])) { + foreach ($data['list'] as $k => $item) { + $data['list'][$k]['createtime'] = date('Y-m-d H:i:s', $item['createtime']); } } return $this->success($data); @@ -87,9 +91,9 @@ class Personnel extends BaseModel * 编辑人员 * @param $param */ - public function editPersonnel($condition,$data) + public function editPersonnel($condition, $data) { - $result = model('personnel')->update($condition,$data); + $result = model('personnel')->update($condition, $data); return $this->success($result); } @@ -100,13 +104,14 @@ class Personnel extends BaseModel */ public function deletePersonnel($id, $site_id) { - $info = model('personnel')->getInfo([ [ 'site_id', '=', $site_id ], [ 'id', '=', $id ] ], 'id'); - if (empty($info)) return $this->error('', '未获取到人员信息'); - $res = model('personnel')->delete([ [ 'site_id', '=', $site_id ], [ 'id', '=', $id ] ]); + $info = model('personnel')->getInfo([['site_id', '=', $site_id], ['id', '=', $id]], 'id'); + if (empty($info)) + return $this->error('', '未获取到人员信息'); + $res = model('personnel')->delete([['site_id', '=', $site_id], ['id', '=', $id]]); return $this->success($res); } - /** + /** * 获取电子名片人员列表 * @param array $condition * @param bool $field @@ -123,16 +128,17 @@ class Personnel extends BaseModel return $this->success($data); } - /** + /** * 删除留言 * @param $id * @param $site_id */ public function deleteMessage($id, $site_id) { - $info = model('personnel_message')->getInfo([ [ 'site_id', '=', $site_id ], [ 'id', '=', $id ] ], 'id'); - if (empty($info)) return $this->error('', '未获取到留言信息'); - $res = model('personnel_message')->delete([ [ 'site_id', '=', $site_id ], [ 'id', '=', $id ] ]); + $info = model('personnel_message')->getInfo([['site_id', '=', $site_id], ['id', '=', $id]], 'id'); + if (empty($info)) + return $this->error('', '未获取到留言信息'); + $res = model('personnel_message')->delete([['site_id', '=', $site_id], ['id', '=', $id]]); return $this->success($res); } } \ No newline at end of file diff --git a/src/addon/personnel/shop/controller/Enterprise.php b/src/addon/personnel/shop/controller/Enterprise.php index fb0a35253..05892feec 100644 --- a/src/addon/personnel/shop/controller/Enterprise.php +++ b/src/addon/personnel/shop/controller/Enterprise.php @@ -168,7 +168,117 @@ class Enterprise extends BaseShop if (request()->isJson()) { $video_id = input('video_id', 0); $model = new EnterpriseModel(); - return $model->deleteVideo([ [ 'video_id', '=', $video_id],['site_id','=',$this->site_id] ]); + return $model->deleteVideo([ [ 'video_id', '=', $video_id ], [ 'site_id', '=', $this->site_id ] ]); + } + } + + /***************************************视频号部分****************************************/ + /** + * 视频号列表 + */ + public function channellists(){ + if (request()->isJson()) { + $page = input('page', 1); + $page_size = input('page_size', PAGE_LIST_ROWS); + $search_text = input('search_text', ''); + $channel_type = input('channel_type', ''); + $is_show = input('is_show', ''); + $order = input('order', ''); + $condition = [ [ 'site_id', '=', $this->site_id ] ]; + if ($search_text) { + $condition[] = [ 'channel_name', 'like', '%' . $search_text . '%' ]; + } + if ($channel_type) { + $condition[] = [ 'channel_type', '=', $channel_type ]; + } + if ($is_show !== '') { + $condition[] = [ 'is_show', '=', $is_show ]; + } + $order_by = $order ? $order : 'create_time desc'; + $model = new EnterpriseModel(); + $list = $model->getChannelPageList($condition, $page, $page_size, $order_by); + return $list; + } else { + return $this->fetch('enterprise/channel/lists'); + } + } + + /** + * 添加视频号 + */ + public function channeladd() + { + $model = new EnterpriseModel(); + if (request()->isJson()) { + $data = [ + 'site_id' => $this->site_id, + 'channel_type' => input('channel_type', 'wechat'), + 'channel_name' => input('channel_name', ''), + 'avatar_image_type' => input('avatar_image_type', 'upload'), + 'avatar_url' => input('avatar_url', ''), + 'video_title' => input('video_title', ''), + 'feed_id' => input('feed_id', ''), + 'cover_image_type' => input('cover_image_type', 'upload'), + 'cover_url' => input('cover_url', ''), + 'sort' => input('sort', 0), + 'is_show' => input('is_show', 1), + 'feed_token' => input('feed_token', ''), + 'view_count' => input('view_count', 0), + 'show_view_count' => input('show_view_count', 0), + 'show_follow' => input('show_follow', 0), + 'create_time' => time() + ]; + return $model->addChannel($data); + } else { + return $this->fetch('enterprise/channel/edit'); + } + } + + /** + * 编辑视频号 + */ + public function channeledit() + { + $channel_id = input('channel_id', 0); + $model = new EnterpriseModel(); + if (request()->isJson()) { + $data = [ + 'channel_id' => $channel_id, + 'site_id' => $this->site_id, + 'channel_type' => input('channel_type', 'wechat'), + 'channel_name' => input('channel_name', ''), + 'avatar_image_type' => input('avatar_image_type', 'upload'), + 'avatar_url' => input('avatar_url', ''), + 'video_title' => input('video_title', ''), + 'feed_id' => input('feed_id', ''), + 'cover_image_type' => input('cover_image_type', 'upload'), + 'cover_url' => input('cover_url', ''), + 'sort' => input('sort', 0), + 'is_show' => input('is_show', 1), + 'feed_token' => input('feed_token', ''), + 'view_count' => input('view_count', 0), + 'show_view_count' => input('show_view_count', 0), + 'show_follow' => input('show_follow', 0), + ]; + return $model->editChannel($data); + } else { + $this->assign('channel_id', $channel_id); + $article_info = $model->getChannelInfo([ [ 'channel_id', '=', $channel_id ] ]); + $this->assign('info', $article_info[ 'data' ]); + // 返回统一的 add.html 模板,前端会根据 channel_id 判断是否为编辑模式 + return $this->fetch('enterprise/channel/edit'); + } + } + + /** + * 删除视频号 + */ + public function channeldelete() + { + if (request()->isJson()) { + $channel_id = input('channel_id', 0); + $model = new EnterpriseModel(); + return $model->deleteChannel([ [ 'channel_id', '=', $channel_id ], [ 'site_id', '=', $this->site_id ] ]); } } } \ No newline at end of file diff --git a/src/addon/personnel/shop/view/enterprise/channel/edit.html b/src/addon/personnel/shop/view/enterprise/channel/edit.html new file mode 100644 index 000000000..ac9b63027 --- /dev/null +++ b/src/addon/personnel/shop/view/enterprise/channel/edit.html @@ -0,0 +1,452 @@ + + + + + + +
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+ +

点击上传

+
+
+ + x +
+
+
推荐使用 750x420 像素的图片
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+ +

点击上传

+
+
+ + x +
+
+
推荐使用 200x200 像素的图片
+
+ + + + +
+ +
+ +
+
数值越小排序越靠前
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ + +
+ + + +
+ + diff --git a/src/addon/personnel/shop/view/enterprise/channel/lists.html b/src/addon/personnel/shop/view/enterprise/channel/lists.html new file mode 100644 index 000000000..f4c09f2ec --- /dev/null +++ b/src/addon/personnel/shop/view/enterprise/channel/lists.html @@ -0,0 +1,228 @@ + +
+ + +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + diff --git a/src/addon/personnel/shop/view/personnel/diy.html b/src/addon/personnel/shop/view/personnel/diy.html index 463feeb7c..71fcaefb3 100644 --- a/src/addon/personnel/shop/view/personnel/diy.html +++ b/src/addon/personnel/shop/view/personnel/diy.html @@ -41,6 +41,10 @@ +
+ 视频号 +
+
@@ -99,6 +103,16 @@
+
+ +
+ 隐藏显示 +
+ +
+
+
+
diff --git a/src/addon/personnel/shop/view/public/diy.js b/src/addon/personnel/shop/view/public/diy.js index 645b1b94a..c03031e20 100644 --- a/src/addon/personnel/shop/view/public/diy.js +++ b/src/addon/personnel/shop/view/public/diy.js @@ -17,6 +17,7 @@ var vue = new Vue({ is_mp: 1, is_file: 1, is_video: 1, + is_channel: 1, is_map: 1, }, created: function () { @@ -32,6 +33,7 @@ var vue = new Vue({ this.is_file = data.is_file this.is_video = data.is_video this.is_map = data.is_map + this.is_channel = data.is_channel fullScreenSize(function () { self.lazyLoad = true; }); @@ -90,8 +92,9 @@ layui.use(['form'], function () { is_mp:vue.is_mp, is_file:vue.is_file, is_video:vue.is_video, + is_channel:vue.is_channel, is_map:vue.is_map - } + }; $.ajax({ type: "post", url: ns.url('personnel://shop/personnel/diy'), diff --git a/src/addon/personnel/shop/view/public/img/channel.png b/src/addon/personnel/shop/view/public/img/channel.png new file mode 100644 index 000000000..23082294a Binary files /dev/null and b/src/addon/personnel/shop/view/public/img/channel.png differ diff --git a/src/addon/personnel/shop/view/public/img/mingpian.png b/src/addon/personnel/shop/view/public/img/mingpian.png index a54526127..71b4634d7 100644 Binary files a/src/addon/personnel/shop/view/public/img/mingpian.png and b/src/addon/personnel/shop/view/public/img/mingpian.png differ diff --git a/src/app/api/controller/Member.php b/src/app/api/controller/Member.php index e1fa312c1..a427047fa 100644 --- a/src/app/api/controller/Member.php +++ b/src/app/api/controller/Member.php @@ -576,6 +576,8 @@ class Member extends BaseApi $Personnelmodel = new PersonnelModel(); $set = $Personnelmodel->getPersonnelSet($this->site_id, $this->app_module)[ 'data' ][ 'value' ]; + //视频号数据 + $channel_list = model('personnel_channel')->getList(['site_id'=>$this->site_id, 'is_show'=>1],'*','sort asc createtime desc'); //视频文件 $video_list = model('personnel_video')->getList(['site_id'=>$this->site_id],'*','createtime desc'); //企业文件 @@ -583,7 +585,7 @@ class Member extends BaseApi //电子名片diy $config = $Personnelmodel->getPersonnelSet($this->site_id, $this->app_module)[ 'data' ][ 'value' ]; $config['value'] = json_decode($config['value'],true); - return $this->response(['code'=>'0','data'=>$list,'message'=>'操作成功','shop'=>$shop_info_result,'set'=>$set,'video_list'=>$video_list,'file_list'=>$file_list,'diy'=>$config['value']]); + return $this->response(['code'=>'0','data'=>$list,'message'=>'操作成功','shop'=>$shop_info_result,'set'=>$set,'channel_list'=>$channel_list, 'video_list'=>$video_list,'file_list'=>$file_list,'diy'=>$config['value']]); } //留言 public function message()