初始化代码
This commit is contained in:
163
app/card/info/AdminMenu.php
Normal file
163
app/card/info/AdminMenu.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: shuixian
|
||||
* Date: 2019/11/20
|
||||
* Time: 18:29
|
||||
*/
|
||||
|
||||
$menu = <<<BUSINESSCARD
|
||||
|
||||
{
|
||||
"path": "/businessCard",
|
||||
"component": "Layout",
|
||||
"redirect": "/businessCard/staffCard",
|
||||
"meta": {
|
||||
"menuName": "BusinessCard",
|
||||
"icon": "icon-mingpian",
|
||||
"subNavName": [{
|
||||
"name": "CardInfo",
|
||||
"url": [{
|
||||
"name": "StaffCard",
|
||||
"url": "/businessCard/staffCard"
|
||||
}, {
|
||||
"name": "ImpressionLabel",
|
||||
"url": "/businessCard/tag"
|
||||
}]
|
||||
}, {
|
||||
"name": "CardSetting",
|
||||
"url": [{
|
||||
"name": "ExemptionPassword",
|
||||
"url": "/businessCard/exemptionPwd"
|
||||
}, {
|
||||
"name": "MobileSetting",
|
||||
"url": "/businessCard/mobileSetting"
|
||||
}, {
|
||||
"name": "MediaSetting",
|
||||
"url": "/businessCard/mediaSetting"
|
||||
}, {
|
||||
"name": "CardSetting",
|
||||
"url": "/businessCard/cardSetting"
|
||||
}]
|
||||
}]
|
||||
},
|
||||
"children": [{
|
||||
"path": "staffCard",
|
||||
"name": "StaffCard",
|
||||
"component": "/businessCard/manage/staffCard",
|
||||
"meta": {
|
||||
"keepAlive": true,
|
||||
"title": "CardManage",
|
||||
"isOnly": false,
|
||||
"auth": [],
|
||||
"pagePermission": [{
|
||||
"title": "StaffCard",
|
||||
"index": 0,
|
||||
"auth": ["view", "add", "edit", "del", "outport"]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"path": "editCard",
|
||||
"name": "EditCard",
|
||||
"component": "/businessCard/manage/editCard",
|
||||
"meta": {
|
||||
"refresh": false,
|
||||
"title": "CardManage",
|
||||
"isOnly": false,
|
||||
"auth": [],
|
||||
"pagePermission": [{
|
||||
"title": "EditCard",
|
||||
"index": 0,
|
||||
"auth": ["view", "add", "edit", "del", "outport"]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"path": "tag",
|
||||
"name": "ImpressionLabel",
|
||||
"component": "/businessCard/manage/tag",
|
||||
"meta": {
|
||||
"keepAlive": true,
|
||||
"title": "CardManage",
|
||||
"isOnly": false,
|
||||
"auth": [],
|
||||
"pagePermission": [{
|
||||
"title": "ImpressionLabel",
|
||||
"index": 0,
|
||||
"auth": ["view", "add", "edit", "del", "outport"]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"path": "exemptionPwd",
|
||||
"name": "ExemptionPassword",
|
||||
"component": "/businessCard/set/exemptionPwd",
|
||||
"meta": {
|
||||
"keepAlive": true,
|
||||
"refresh": false,
|
||||
"title": "CardManage",
|
||||
"isOnly": false,
|
||||
"auth": [],
|
||||
"pagePermission": [{
|
||||
"title": "ExemptionPassword",
|
||||
"index": 0,
|
||||
"auth": ["view", "add", "edit", "del", "outport"]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"path": "mobileSetting",
|
||||
"name": "MobileSetting",
|
||||
"component": "/businessCard/set/mobileSetting",
|
||||
"meta": {
|
||||
"keepAlive": true,
|
||||
"refresh": false,
|
||||
"title": "CardManage",
|
||||
"isOnly": false,
|
||||
"auth": [],
|
||||
"pagePermission": [{
|
||||
"title": "MobileSetting",
|
||||
"index": 0,
|
||||
"auth": ["view", "add", "edit", "del", "outport"]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"path": "mediaSetting",
|
||||
"name": "MediaSetting",
|
||||
"component": "/businessCard/set/mediaSetting",
|
||||
"meta": {
|
||||
"keepAlive": true,
|
||||
"refresh": false,
|
||||
"title": "CardManage",
|
||||
"isOnly": false,
|
||||
"auth": [],
|
||||
"pagePermission": [{
|
||||
"title": "MediaSetting",
|
||||
"index": 0,
|
||||
"auth": ["view", "add", "edit", "del", "outport"]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"path": "cardSetting",
|
||||
"name": "CardSetting",
|
||||
"component": "/businessCard/set/cardSetting",
|
||||
"meta": {
|
||||
"keepAlive": true,
|
||||
"refresh": false,
|
||||
"title": "CardManage",
|
||||
"isOnly": false,
|
||||
"auth": [],
|
||||
"pagePermission": [{
|
||||
"title": "CardSetting",
|
||||
"index": 0,
|
||||
"auth": ["view", "add", "edit", "del", "outport"]
|
||||
}]
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
BUSINESSCARD;
|
||||
|
||||
//return json_decode($menu, true) ;
|
||||
|
||||
return ['card' => $menu];
|
||||
|
||||
|
||||
87
app/card/info/DiyCompoents.php
Normal file
87
app/card/info/DiyCompoents.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: shuixian
|
||||
* Date: 2019/11/20
|
||||
* Time: 18:29
|
||||
*/
|
||||
|
||||
|
||||
$gzh = <<<GZH
|
||||
|
||||
{"title":"公众号组件","type":"official","icon":"iconOfficial","isDelete":true,"addNumber":1,"data":{"title":"公众号组件"}}
|
||||
|
||||
GZH;
|
||||
|
||||
|
||||
$acrd = <<<CARD
|
||||
|
||||
{"title":"名片模块","type":"cardModule","icon":"iconCardModule","isDelete":true,"addNumber":1,"attr":[{"title":"显示发名片按钮","type":"Switch","name":"isShowSendBtn"},{"title":"显示保存到通讯录","type":"Switch","name":"isShowSaveBtn"},{"title":"显示电话","type":"Switch","name":"isShowPhone"},{"title":"显示座机","type":"Switch","name":"isShowZuoji"},{"title":"显示400热线","type":"Switch","name":"isShowHotPhone"},{"title":"显示微信","type":"Switch","name":"isShowWechat"},{"title":"显示邮箱","type":"Switch","name":"isShowEmail"},{"title":"显示公司名称","type":"Switch","name":"isShowCompanyName"},{"title":"显示公司地址","type":"Switch","name":"isShowCompanyAddr"}],"data":{"title":"名片模块","isShowSendBtn":true,"isShowSaveBtn":true,"isShowPhone":true,"isShowZuoji":true,"isShowHotPhone":true,"isShowWechat":true,"isShowEmail":true,"isShowCompanyName":true,"isShowCompanyAddr":true},"dataList":[]}
|
||||
CARD;
|
||||
|
||||
$userinfo = <<<USERINFO
|
||||
|
||||
{"title":"个人简介","type":"staffIntroduce","icon":"iconStaffIntroduce","isDelete":true,"addNumber":1,"data":{"title":"个人简介"},"dataList":[]}
|
||||
USERINFO;
|
||||
|
||||
$vr = <<<VR
|
||||
|
||||
{"title":"VR全景","type":"myVR","icon":"iconMyVR","isDelete":true,"addNumber":1,"data":{"title":"VR全景"},"dataList":[]}
|
||||
VR;
|
||||
|
||||
|
||||
$video = <<<VIDEO
|
||||
|
||||
{"title":"我的视频","type":"myVideo","icon":"iconMyVideo","isDelete":true,"addNumber":1,"data":{"title":"我的视频"},"dataList":[]}
|
||||
VIDEO;
|
||||
|
||||
|
||||
$photo = <<<PHOTO
|
||||
{"title":"我的照片","type":"myPhoto","icon":"iconMyPhoto","isDelete":true,"addNumber":1,"data":{"title":"我的照片"},"dataList":[]}
|
||||
PHOTO;
|
||||
|
||||
|
||||
$goods = <<<GOODS
|
||||
|
||||
{"model_name_key":"shop","title":"主推商品","type":"myGoods","icon":"iconMyGoods","isDelete":true,"addNumber":1,"data":{"title":"主推商品"},"dataList":[]}
|
||||
GOODS;
|
||||
|
||||
|
||||
$dynamic = <<<DYNAMIC
|
||||
|
||||
{"model_name_key":"dynamic","title":"我的动态","type":"myDynamic","icon":"iconDynamicList","isDelete":true,"addNumber":1,"attr":[{"title":"点击图片/视频","type":"Radio","name":"clickType","data":[{"label":1,"title":"查看图片/视频"},{"label":2,"title":"进入详情"}]},{"title":"显示数量","type":"InputNumber","name":"row"}],"data":{"title":"我的动态","clickType":1,"row":{"number":3,"min":1,"max":3,"label":"请输入"},"dataList":[]}}
|
||||
DYNAMIC;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//模块组件 后台DIY页面的左侧
|
||||
|
||||
return [
|
||||
|
||||
[
|
||||
"title" => "业务组件",
|
||||
'type' => 'cardCompoent',
|
||||
"data" => [
|
||||
json_decode($gzh, true),
|
||||
|
||||
json_decode($acrd, true),
|
||||
|
||||
json_decode($userinfo, true),
|
||||
|
||||
json_decode($vr, true),
|
||||
|
||||
json_decode($video, true),
|
||||
|
||||
json_decode($photo, true),
|
||||
|
||||
json_decode($goods, true),
|
||||
|
||||
json_decode($dynamic, true),
|
||||
]
|
||||
]
|
||||
|
||||
];
|
||||
19
app/card/info/DiyDefaultCompoents.php
Normal file
19
app/card/info/DiyDefaultCompoents.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: shuixian
|
||||
* Date: 2019/11/20
|
||||
* Time: 18:29
|
||||
*/
|
||||
|
||||
|
||||
$defaultPage=<<<DEFAULT
|
||||
|
||||
{"key":1,"list":[{"title":"名片模块","type":"cardModule","icon":"iconCardModule","isDelete":true,"addNumber":1,"attr":[{"title":"显示发名片按钮","type":"Switch","name":"isShowSendBtn"},{"title":"显示保存到通讯录","type":"Switch","name":"isShowSaveBtn"},{"title":"显示电话","type":"Switch","name":"isShowPhone"},{"title":"显示座机","type":"Switch","name":"isShowZuoji"},{"title":"显示400热线","type":"Switch","name":"isShowHotPhone"},{"title":"显示微信","type":"Switch","name":"isShowWechat"},{"title":"显示邮箱","type":"Switch","name":"isShowEmail"},{"title":"显示公司名称","type":"Switch","name":"isShowCompanyName"},{"title":"显示公司地址","type":"Switch","name":"isShowCompanyAddr"}],"data":{"title":"名片模块","isShowSendBtn":true,"isShowSaveBtn":true,"isShowPhone":true,"isShowZuoji":true,"isShowHotPhone":true,"isShowWechat":true,"isShowEmail":true,"isShowCompanyName":true,"isShowCompanyAddr":true,"dataList":[]},"id":1591842905840,"compontents":"cardCompoent"},{"title":"优惠券","type":"couponList","icon":"iconCouponList","isDelete":true,"addNumber":1,"attr":[{"title":"模板名称","type":"Input","name":"title","maxLength":10},{"title":"卡券样式","type":"Radio","name":"type","data":[{"label":1,"title":"弹窗样式"},{"label":2,"title":"列表样式"}]}],"data":{"title":"领取优惠券","type":1,"dataList":[]},"id":1591842929534,"compontents":"operate"},{"title":"公众号组件","type":"official","icon":"iconOfficial","isDelete":true,"addNumber":1,"data":{"title":"公众号组件"},"id":1591842933706,"compontents":"cardCompoent"},{"title":"个人简介","type":"staffIntroduce","icon":"iconStaffIntroduce","isDelete":true,"addNumber":1,"data":{"title":"个人简介","dataList":[]},"id":1591842938310,"compontents":"cardCompoent"},{"title":"主推商品","type":"myGoods","icon":"iconMyGoods","isDelete":true,"addNumber":1,"data":{"title":"主推商品","dataList":[]},"id":1591842976731,"compontents":"cardCompoent"},{"title":"VR全景","type":"myVR","icon":"iconMyVR","isDelete":true,"addNumber":1,"data":{"title":"VR全景","dataList":[]},"id":1591842986079,"compontents":"cardCompoent"},{"title":"我的视频","type":"myVideo","icon":"iconMyVideo","isDelete":true,"addNumber":1,"data":{"title":"我的视频","dataList":[]},"id":1591842987329,"compontents":"cardCompoent"},{"title":"我的动态","type":"myDynamic","icon":"iconMyDynamic","isDelete":true,"addNumber":1,"attr":[{"title":"点击图片\/视频","type":"Radio","name":"clickType","data":[{"label":1,"title":"查看图片\/视频"},{"label":2,"title":"进入详情"}]},{"title":"显示数量","type":"InputNumber","name":"row"}],"data":{"title":"我的动态","clickType":1,"row":{"number":3,"min":1,"max":3,"label":"请输入"},"dataList":[]},"id":1591843000578,"compontents":"cardCompoent"},{"title":"我的照片","type":"myPhoto","icon":"iconMyPhoto","isDelete":true,"addNumber":1,"data":{"title":"我的照片","dataList":[]},"id":1591843001799,"compontents":"cardCompoent"}]}
|
||||
DEFAULT;
|
||||
|
||||
|
||||
$page = json_decode( $defaultPage , true);
|
||||
|
||||
|
||||
return $page;
|
||||
12
app/card/info/DiyLink.php
Normal file
12
app/card/info/DiyLink.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: shuixian
|
||||
* Date: 2019/11/20
|
||||
* Time: 18:29
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//模块组件 后台DIY页面的左侧
|
||||
return [];
|
||||
39
app/card/info/DiyTabbar.php
Normal file
39
app/card/info/DiyTabbar.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: shuixian
|
||||
* Date: 2019/11/20
|
||||
* Time: 18:29
|
||||
*/
|
||||
|
||||
//底部菜单自定义
|
||||
return [
|
||||
|
||||
[
|
||||
//底部菜单编号
|
||||
'key' => 1 ,
|
||||
//是否显示
|
||||
'is_show' => 1 ,
|
||||
//图标
|
||||
'iconPath' => 'icon-mingpian',
|
||||
//选中图标样式
|
||||
'selectedIconPath' => 'icon-mingpian1',
|
||||
//那个页面 英文名称
|
||||
'pageComponents' => 'cardHome',
|
||||
//名称
|
||||
'name' => '名片',
|
||||
'url' => '',
|
||||
'url_jump_way' => '0',
|
||||
'url_out' => '',
|
||||
'is_delete' => false ,
|
||||
'bind_compoents'=>[
|
||||
|
||||
'cardCompoent',
|
||||
|
||||
'operate'
|
||||
],
|
||||
'bind_links' => [],
|
||||
'page'=> []
|
||||
],
|
||||
|
||||
];
|
||||
28
app/card/info/FunctionPage.php
Normal file
28
app/card/info/FunctionPage.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: shuixian
|
||||
* Date: 2019/11/20
|
||||
* Time: 18:29
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//模块组件 后台DIY页面的左侧
|
||||
return [
|
||||
//链接类型
|
||||
|
||||
[
|
||||
'id'=>'',
|
||||
|
||||
'key'=> 1,
|
||||
//"params"=>"{"page" : "PAGE", "page_count" : "PAGE_COUNT"}",
|
||||
"title" => "名片页面",
|
||||
//小程序路径
|
||||
"path" => "/pages/user/home?key=1&staff_id="
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
34
app/card/info/Info.php
Normal file
34
app/card/info/Info.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: shuixian
|
||||
* Date: 2019/11/20
|
||||
* Time: 18:30
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
//模块名称[必填]
|
||||
'name' => 'card',
|
||||
//模块标题[必填]
|
||||
'title' =>'名片',
|
||||
//内容简介
|
||||
'desc' =>'',
|
||||
//封面图标
|
||||
'icon' =>'',
|
||||
//模块类型[必填] model:模块 可以出现在左侧一级 app:应用中心 , 是一个应用中心的应用
|
||||
'type' => 'model',
|
||||
// 模块唯一标识[必填],格式:模块名.开发者标识.module
|
||||
'identifier' => 'card.longbing.module',
|
||||
// 版本[必填],格式采用三段式:主版本号.次版本号.修订版本号
|
||||
'version' => '1.0.8',
|
||||
// 模块依赖[可选],格式[[模块名, 模块唯一标识, 依赖版本, 对比方式]]
|
||||
'need_module' => [
|
||||
['admin', 'admin.longbing.module', '1.0.0']
|
||||
],
|
||||
// 应用依赖[可选],格式[[插件名, 应用唯一标识, 依赖版本, 对比方式]]
|
||||
'need_app' => [],
|
||||
|
||||
|
||||
|
||||
];
|
||||
131
app/card/info/PermissionCard.php
Normal file
131
app/card/info/PermissionCard.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Longbing [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright Chengdu longbing Technology Co., Ltd.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Website http://longbing.org/
|
||||
// +----------------------------------------------------------------------
|
||||
// | Sales manager: +86-13558882532 / +86-13330887474
|
||||
// | Technical support: +86-15680635005
|
||||
// | After-sale service: +86-17361005938
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace app\card\info;
|
||||
|
||||
use app\agent\model\Cardauth2DefaultModel;
|
||||
use longbingcore\permissions\PermissionAbstract;
|
||||
|
||||
/**
|
||||
* 模块功能权限
|
||||
* Class PermissionAppstore
|
||||
*/
|
||||
class PermissionCard extends PermissionAbstract {
|
||||
|
||||
const tabbarKey = null;
|
||||
//后台管理菜单对应key[必填] , 当前模块文件夹名称
|
||||
const adminMenuKey = 'card';
|
||||
public $saasKey ;
|
||||
const apiPaths = [];
|
||||
|
||||
|
||||
public function __construct(int $uniacid,$infoConfigOptions = [])
|
||||
{
|
||||
$this->saasKey = longbing_get_auth_prefix('AUTH_CARD') ;
|
||||
parent::__construct($uniacid, self::tabbarKey, self::adminMenuKey, $this->saasKey, self::apiPaths , $infoConfigOptions);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回saas端授权结果
|
||||
* @return bool
|
||||
*/
|
||||
public function sAuth(): bool
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回p端授权结果
|
||||
* @return bool
|
||||
*/
|
||||
public function pAuth(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回c端授权结果
|
||||
*
|
||||
* @param int $user_id
|
||||
* @return bool
|
||||
* @author ArtizanZhang
|
||||
* @DataTime: 2019/12/9 17:13
|
||||
*/
|
||||
public function cAuth(int $user_id): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加名片数量
|
||||
*
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/19 19:02
|
||||
*/
|
||||
public function getAuthNumber()
|
||||
{
|
||||
$returnAuthNumber = -1;
|
||||
//代理管理端控制的数量
|
||||
$pAuthConfig = $this->getPAuthConfig();
|
||||
|
||||
$authCardNumber = $this->getAuthVaule($this->saasKey, 5);
|
||||
|
||||
$pAuthNumber = isset($pAuthConfig['number']) ? $pAuthConfig['number'] : -1;
|
||||
//全局设置配置
|
||||
$cardauth2DefaultModel = new Cardauth2DefaultModel();
|
||||
|
||||
$defaultAuthNumber = $cardauth2DefaultModel->getCardNumber() ;
|
||||
|
||||
if ($authCardNumber > 0) {
|
||||
|
||||
if ($pAuthNumber > 0){
|
||||
|
||||
$returnAuthNumber = $pAuthNumber >= $authCardNumber ? $authCardNumber : $pAuthNumber;
|
||||
|
||||
} else {
|
||||
|
||||
$returnAuthNumber = $authCardNumber;
|
||||
|
||||
}
|
||||
|
||||
}else if( $authCardNumber == 0 ){
|
||||
//无限开模式
|
||||
if ($pAuthNumber >=0) {
|
||||
|
||||
$returnAuthNumber = $pAuthNumber;
|
||||
|
||||
}else if($defaultAuthNumber >= 0 ){
|
||||
|
||||
$returnAuthNumber = $defaultAuthNumber;
|
||||
|
||||
}else{
|
||||
|
||||
$returnAuthNumber = $pAuthNumber;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$returnAuthNumber = $pAuthNumber;
|
||||
}
|
||||
|
||||
return $returnAuthNumber;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
216
app/card/info/RadarMessage.php
Normal file
216
app/card/info/RadarMessage.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?php
|
||||
$radar_msg = [
|
||||
[
|
||||
"sign"=> "praise",
|
||||
"type"=> 2,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "请尽快把握商机",
|
||||
"operation"=> "查看",
|
||||
"item"=> "名片",
|
||||
"show_count"=> 1,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 1,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "对你已建立信任,保持联系持续跟进",
|
||||
"operation"=> "将",
|
||||
"item"=> "手机号码存入了手机通讯录",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 2,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "咨询意向强烈,及时联系确保沟通顺畅",
|
||||
"operation"=> "拨打",
|
||||
"item"=> "手机号",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "longbing_card_user_info",
|
||||
"field"=> "phone",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 3,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "请随时保持电话畅通",
|
||||
"operation"=> "拨打",
|
||||
"item"=> "公司电话",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 4,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "客户请随时可能加你微信",
|
||||
"operation"=> "复制了",
|
||||
"item"=> "微信",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 5,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "可能随时邮寄文件给你,请注意查收",
|
||||
"operation"=> "复制了",
|
||||
"item"=> "邮箱",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 6,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "请及时留意雷达动态",
|
||||
"operation"=> "复制",
|
||||
"item"=> "公司名称",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 7,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "对你的公司非常感兴趣",
|
||||
"operation"=> "查看了",
|
||||
"item"=> "公司地址",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 9,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "请及时留意雷达动态",
|
||||
"operation"=> "播放",
|
||||
"item"=> "语音",
|
||||
"show_count"=> 1,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 10,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "正在帮你裂变人脉,请及时留意雷达动态(快去表达一下你的感谢)",
|
||||
"operation"=> "保存了",
|
||||
"item"=> "名片海报",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "copy",
|
||||
"type"=> 11,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "请随时保持电话畅通",
|
||||
"operation"=> "拨打",
|
||||
"item"=> "400热线",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "praise",
|
||||
"type"=> 1,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "请尽快把握商机",
|
||||
"operation"=> "语音点赞",
|
||||
"item"=> "",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "praise",
|
||||
"type"=> 3,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "",
|
||||
"operation"=> "Ta给你点赞了",
|
||||
"item"=> "",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
[
|
||||
"sign"=> "praise",
|
||||
"type"=> 4,
|
||||
"max"=> 0,
|
||||
"pid"=> 0,
|
||||
"msg"=> "正在帮你裂变人脉,请及时留意雷达动态(快去表达一下你的感谢)",
|
||||
"operation"=> "分享了",
|
||||
"item"=> "名片",
|
||||
"show_count"=> 0,
|
||||
"table_name"=> "",
|
||||
"field"=> "",
|
||||
"send"=> 1,
|
||||
"uniacid"=> 2,
|
||||
"status"=> 1
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
return $radar_msg;
|
||||
163
app/card/info/Subscribe.php
Normal file
163
app/card/info/Subscribe.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Longbing [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright Chengdu longbing Technology Co., Ltd.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Website http://longbing.org/
|
||||
// +----------------------------------------------------------------------
|
||||
// | Sales manager: +86-13558882532 / +86-13330887474
|
||||
// | Technical support: +86-15680635005
|
||||
// | After-sale service: +86-17361005938
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\card\info;
|
||||
|
||||
use app\card\model\Job;
|
||||
use app\card\model\User;
|
||||
use app\card\service\UserService;
|
||||
use app\Common\model\LongbingUserInfo;
|
||||
use longbingcore\diy\BaseSubscribe;
|
||||
|
||||
/**
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/11 16:23
|
||||
* Class Subscribe
|
||||
* @package app\ucenter\info
|
||||
*/
|
||||
class Subscribe extends BaseSubscribe
|
||||
{
|
||||
|
||||
/**
|
||||
* 监听个人中心用户监听事件
|
||||
*
|
||||
* @param $data
|
||||
* @return mixed
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/12 9:36
|
||||
*/
|
||||
public function onDiyUserInfo($data)
|
||||
{
|
||||
return $data ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听用户创建模块
|
||||
*
|
||||
* @param $data
|
||||
* @return mixed
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/18 14:05
|
||||
*/
|
||||
public function onDiyCreateCard($data)
|
||||
{
|
||||
|
||||
//这里需要优化
|
||||
/* $data['dataList'] = [
|
||||
"createText" => "",
|
||||
"createBtn" => ""
|
||||
];*/
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听用户中心切换按钮
|
||||
*
|
||||
* @param $data
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/18 14:07
|
||||
*/
|
||||
public function onDiyChangeStaff($data)
|
||||
{
|
||||
|
||||
$userModel = new User();
|
||||
|
||||
$last_staff_id = $userModel->where('id',$this->getUserId())->value('last_staff_id ');
|
||||
|
||||
if ( $last_staff_id) {
|
||||
|
||||
$staff_model = new LongbingUserInfo();
|
||||
|
||||
$staff_info = $staff_model->getStaff($last_staff_id, $this->_uniacid);
|
||||
|
||||
if(!empty($staff_info)){
|
||||
|
||||
$job_model = new Job();
|
||||
$job_name = $job_model->where( 'id' , $staff_info['job_id'])->value('name') ;
|
||||
$staff_info['job_name'] = $job_name;
|
||||
|
||||
$staff_info = longbing_array_columns([$staff_info],['id','fans_id','name','avatar','job_name']) ;
|
||||
$staff_info = $staff_info[0] ;
|
||||
|
||||
//获取职位信息
|
||||
|
||||
}
|
||||
|
||||
$data['dataList'] = $staff_info;
|
||||
}
|
||||
|
||||
return $data ;
|
||||
}
|
||||
/**
|
||||
* 监听用户中心模块
|
||||
*
|
||||
* @return array
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/18 14:04
|
||||
*/
|
||||
public function onAddUcenterCompoent(){
|
||||
|
||||
$userInfo = <<<COMPOENT
|
||||
{"title":"用户信息","type":"userInfo","icon":"iconyonghuxinxi","isDelete":false,"addNumber":1,"attr":[{"title":"字体颜色","type":"ColorPicker","name":"fontColor"},{"title":"背景图片","type":"UploadImage","desc":"750*440","name":"bgImage"}],"data":{"nickName":"用户昵称","avatarUrl":"https://retail.xiaochengxucms.com/defaultAvatar.png","nickText":"更新我的个人资料","fontColor":"#F9DEAF","bgImage":[{"url":"http://longbingcdn.xiaochengxucms.com/admin/diy/user_bg.jpg"}]}}
|
||||
COMPOENT;
|
||||
|
||||
$createCard = <<<COMPOENT
|
||||
{"title":"创建名片","type":"createCard","icon":"iconchuangjianmingpian","isDelete":false,"addNumber":1,"data":{"createText":"创建我的名片","createBtn":"创建名片"}}
|
||||
COMPOENT;
|
||||
|
||||
$changeStaff = <<<COMPOENT
|
||||
{"title":"切换销售","type":"changeStaff","icon":"iconqiehuanmingpian-copy","isDelete":false,"addNumber":1,"attr":[{"title":"模板名称","type":"Input","name":"title"},{"title":"是否显示更多","type":"Switch","name":"isShowMore"}],"data":{"title":"切换销售","isShowMore":true},"dataList":[]}
|
||||
COMPOENT;
|
||||
|
||||
$distribution = <<<DISTRIBUTION
|
||||
|
||||
{"title":"分销申请","type":"distributionApply","icon":"iconDistributionApply","isDelete":true,"addNumber":1,"data":{"title":"分销申请","img":"http://longbingcdn.xiaochengxucms.com/admin/shop/distridution.jpg"}}
|
||||
DISTRIBUTION;
|
||||
|
||||
|
||||
|
||||
$compoentList = [
|
||||
json_decode($userInfo, true),
|
||||
|
||||
json_decode($createCard, true),
|
||||
|
||||
json_decode($changeStaff, true),
|
||||
|
||||
] ;
|
||||
|
||||
$app_name = config('app.AdminModelList')['app_model_name'];
|
||||
|
||||
if(!in_array($app_name,['longbing_web'])){
|
||||
|
||||
$compoentList[] = json_decode($distribution, true);
|
||||
}
|
||||
|
||||
return $compoentList ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听用户登录
|
||||
*
|
||||
* @param $user
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/30 17:28
|
||||
*/
|
||||
public function onUserLoginApp($user){
|
||||
$userService = new UserService();
|
||||
$userService->initFirstUserToStaff($user['id'], $user['uniacid']) ;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user