初始上传
32
addon/wechat/shop/controller/BaseWechat.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use app\shop\controller\BaseShop;
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* 微信控制器基类
|
||||
*/
|
||||
class BaseWechat extends BaseShop
|
||||
{
|
||||
|
||||
public function __construct(App $app = null)
|
||||
{
|
||||
$this->replace = [
|
||||
'WECHAT_CSS' => __ROOT__ . '/addon/wechat/shop/view/public/css',
|
||||
'WECHAT_JS' => __ROOT__ . '/addon/wechat/shop/view/public/js',
|
||||
'WECHAT_IMG' => __ROOT__ . '/addon/wechat/shop/view/public/img',
|
||||
];
|
||||
parent::__construct($app);
|
||||
}
|
||||
|
||||
}
|
||||
305
addon/wechat/shop/controller/Fans.php
Executable file
@@ -0,0 +1,305 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use addon\wechat\model\Wechat as WechatModel;
|
||||
use addon\wechat\model\Fans as FansModel;
|
||||
|
||||
/**
|
||||
* 微信粉丝控制器
|
||||
*/
|
||||
class Fans extends BaseWechat
|
||||
{
|
||||
|
||||
/**
|
||||
* 粉丝列表
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$fans_model = new FansModel();
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$limit = input('page_size', PAGE_LIST_ROWS);
|
||||
$is_subscribe = input('is_subscribe', '');//关注
|
||||
$nickname = input('nickname', '');//粉丝名称
|
||||
$start_time = input('start_time', '');
|
||||
$end_time = input('end_time', '');
|
||||
$condition[] = [ 'site_id', '=', $this->site_id ];
|
||||
if ($is_subscribe !== '') {
|
||||
$condition[] = [ 'is_subscribe', "=", $is_subscribe ];
|
||||
}
|
||||
if ($nickname != '') {
|
||||
$condition[] = [ 'nickname', 'like', '%' . $nickname . '%' ];
|
||||
}
|
||||
if (!empty($start_time) && empty($end_time)) {
|
||||
$condition[] = [ "subscribe_time", ">=", date_to_time($start_time) ];
|
||||
} elseif (empty($start_time) && !empty($end_time)) {
|
||||
$condition[] = [ "subscribe_time", "<=", date_to_time($end_time) ];
|
||||
} elseif (!empty($start_time) && !empty($end_time)) {
|
||||
$condition[] = [ 'subscribe_time', 'between', [ date_to_time($start_time), date_to_time($end_time) ] ];
|
||||
}
|
||||
$fans_list = $fans_model->getFansPageList($condition, $page, $limit);
|
||||
return $fans_list;
|
||||
}
|
||||
|
||||
$tag_list = $fans_model->getFansTagList();
|
||||
$this->assign('tag_list', $tag_list[ 'data' ]);
|
||||
|
||||
return $this->fetch('fans/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新粉丝信息
|
||||
*/
|
||||
public function syncWechatFans()
|
||||
{
|
||||
$page_index = input('page', 0);
|
||||
$page_size = input('limit', PAGE_LIST_ROWS);
|
||||
$wechat_model = new WechatModel($this->site_id);
|
||||
if ($page_index == 0) {
|
||||
//建立连接,同时获取所有用户openid 拉去粉丝信息列表(一次拉取调用最多拉取10000个关注者的OpenID,可以通过多次拉取的方式来满足需求。)
|
||||
$openid_list = [];
|
||||
$is_continue = true;
|
||||
$next_openid = null;
|
||||
do {
|
||||
$item_result = $wechat_model->user($next_openid);
|
||||
|
||||
if ($item_result[ "code" ] < 0)
|
||||
return $item_result;
|
||||
|
||||
if (empty($item_result[ 'data' ][ 'data' ])) {
|
||||
return success(0, '公众号暂无粉丝');
|
||||
}
|
||||
|
||||
$next_openid = $item_result[ "data" ][ "next_openid" ];
|
||||
$openid_item = $item_result[ "data" ][ 'data' ][ "openid" ];
|
||||
if (empty($openid_item)) {
|
||||
$is_continue = false;
|
||||
} else {
|
||||
$is_continue = false;
|
||||
foreach ($openid_item as $k => $v) {
|
||||
$openid_list[] = $v;
|
||||
}
|
||||
}
|
||||
} while ($is_continue);
|
||||
|
||||
//将粉丝列表存入session
|
||||
session('wechat_openid_list', $openid_list);
|
||||
$total = count($openid_list);
|
||||
if ($openid_list % $page_size == 0) {
|
||||
$page_count = $total / $page_size;
|
||||
} else {
|
||||
$page_count = (int) ( $total / $page_size ) + 1;
|
||||
}
|
||||
$data = array (
|
||||
'total' => $total,
|
||||
'page_count' => $page_count,
|
||||
);
|
||||
return success(0, '', $data);
|
||||
|
||||
} else {
|
||||
//对应页数更新用户粉丝信息
|
||||
$openid_list = session('wechat_openid_list');
|
||||
if (empty($openid_list)) {
|
||||
return error();
|
||||
}
|
||||
|
||||
$start = ( $page_index - 1 ) * $page_size;
|
||||
$page_fans_openid_list = array_slice($openid_list, $start, $page_size);
|
||||
|
||||
if (empty($page_fans_openid_list)) {
|
||||
return error();
|
||||
}
|
||||
|
||||
$fans_model = new FansModel();
|
||||
|
||||
$result = $wechat_model->selectUser($page_fans_openid_list);
|
||||
if ($result[ 'data' ] && $result[ 'data' ][ 'user_info_list' ]) {
|
||||
foreach ($result[ 'data' ][ 'user_info_list' ] as $k => $v) {
|
||||
$nickname_decode = preg_replace('/[\x{10000}-\x{10FFFF}]/u', '', $v[ 'nickname' ]);
|
||||
$nickname = preg_replace_callback('/./u',
|
||||
function(array $match) {
|
||||
return strlen($match[ 0 ]) >= 4 ? '' : $match[ 0 ];
|
||||
},
|
||||
$v[ 'nickname' ]);
|
||||
$add_data = [
|
||||
'site_id' => $this->site_id,
|
||||
'nickname' => $nickname,
|
||||
'nickname_decode' => $nickname_decode,
|
||||
'headimgurl' => $v[ 'headimgurl' ],
|
||||
'sex' => $v[ 'sex' ],
|
||||
'language' => $v[ 'language' ],
|
||||
'country' => $v[ 'country' ],
|
||||
'province' => $v[ 'province' ],
|
||||
'city' => $v[ 'city' ],
|
||||
'openid' => $v[ 'openid' ],
|
||||
'unionid' => $v[ 'unionid' ] ?? '',
|
||||
'groupid' => '',
|
||||
'is_subscribe' => 1,
|
||||
'remark' => $v[ 'remark' ],
|
||||
'subscribe_time' => $v[ 'subscribe_time' ] ?? 0,
|
||||
'subscribe_scene' => $v[ 'subscribe_scene' ] ?? 0,
|
||||
'unsubscribe_time' => $v[ 'unsubscribe_time' ] ?? 0,
|
||||
'update_date' => time()
|
||||
];
|
||||
$info = $fans_model->getFansInfo([ 'openid' => $v[ 'openid' ], 'site_id' => $this->site_id ], 'openid');
|
||||
if (!empty($info[ 'data' ])) {
|
||||
$fans_model->editFans($add_data, [ [ 'openid', '=', $v[ 'openid' ] ], [ 'site_id', '=', $this->site_id ] ]);
|
||||
} else {
|
||||
$fans_model->addFans($add_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信粉丝标签
|
||||
*/
|
||||
public function fansTagList()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$fans_model = new FansModel();
|
||||
$page = input('page', 1);
|
||||
$limit = input('limit', PAGE_LIST_ROWS);
|
||||
$condition = [];
|
||||
$list = $fans_model->getFansTagPageList($condition, $page, $limit);
|
||||
return $list;
|
||||
} else {
|
||||
return $this->fetch('fans/fans_tag_list');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 为微信粉丝批量打标签
|
||||
*/
|
||||
public function fansBatchTagging()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$fans_model = new FansModel();
|
||||
$tagids = input('tag_id', '');
|
||||
$openids = input('openid', '');
|
||||
if (!empty($openids)) {
|
||||
$tag_id_list = explode(',', $tagids);
|
||||
$openid_list = explode(',', $openids);
|
||||
$data = [
|
||||
'tag_id_list' => $tag_id_list,
|
||||
'openid_list' => $openid_list
|
||||
];
|
||||
$res = $fans_model->fansBatchTagging($data);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 为微信粉丝打标签
|
||||
*/
|
||||
public function fansTagging()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$fans_model = new FansModel();
|
||||
$openid = input('openid', '');
|
||||
$tagid_list = input('tagid_list', '');
|
||||
$cancel_tagid_list = input('cancel_tagid_list', '');
|
||||
if (!empty($openid)) {
|
||||
$tagid_list_arr = !empty($tagid_list) ? explode(',', $tagid_list) : [];
|
||||
$cancel_tagid_list_arr = !empty($cancel_tagid_list) ? explode(',', $cancel_tagid_list) : [];
|
||||
$data = [
|
||||
'tag_id_list' => $tagid_list_arr,
|
||||
'openid_list' => [ $openid ]
|
||||
];
|
||||
$res = $fans_model->fansBatchTagging($data);//批量增加标签
|
||||
$data[ 'tag_id_list' ] = $cancel_tagid_list_arr;
|
||||
$fans_model->batchUnTagging($data);//批量减少标签
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加标签
|
||||
* @return array
|
||||
*/
|
||||
public function addFansTag()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$fans_model = new FansModel();
|
||||
$tag_name = input('tag_name', '');
|
||||
if (!empty($tag_name)) {
|
||||
$data = [
|
||||
'tag_name' => $tag_name,
|
||||
];
|
||||
$data[ "tags" ] = time();
|
||||
$data[ "tag_id" ] = time();
|
||||
$res = $fans_model->addFansTag($data);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑标签
|
||||
*/
|
||||
public function editFansTag()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$fans_model = new FansModel();
|
||||
$id = input('id', '');
|
||||
$tag_name = input('tag_name', '');
|
||||
if (!empty($tag_name)) {
|
||||
$data = [
|
||||
'tag_name' => $tag_name,
|
||||
];
|
||||
$condition = array (
|
||||
[ "id", "=", $id ]
|
||||
);
|
||||
$res = $fans_model->editFansTag($data, $condition);
|
||||
return $res;
|
||||
} else {
|
||||
return error("", "标签名称不可为空!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签
|
||||
*/
|
||||
public function deleteFansTag()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$fans_model = new FansModel();
|
||||
$id = input('id', '');
|
||||
$condition = [
|
||||
[ 'id', "=", $id ],
|
||||
];
|
||||
$res = $fans_model->deleteFansTag($condition);
|
||||
return $res;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步粉丝标签
|
||||
*/
|
||||
public function syncFansTag()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$fans_model = new FansModel();
|
||||
$res = $fans_model->syncFansTag();
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
312
addon/wechat/shop/controller/Material.php
Executable file
@@ -0,0 +1,312 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use addon\wechat\model\Material as MaterialModel;
|
||||
use addon\wechat\model\Wechat as WechatModel;
|
||||
|
||||
/**
|
||||
* 微信素材控制器
|
||||
*/
|
||||
class Material extends BaseWechat
|
||||
{
|
||||
|
||||
/**
|
||||
* 素材列表--图文消息
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$type = input('type', '');
|
||||
$name = input('name', '');
|
||||
$page_index = input('page', 1);
|
||||
$page_size = input('limit', 9);
|
||||
if (!empty($type)) {
|
||||
$condition[] = [ 'type', "=", $type ];
|
||||
}
|
||||
if (!empty($name)) {
|
||||
$condition[] = array (
|
||||
'value', 'like', '%"name":"%' . $name . '%","url"%'
|
||||
);
|
||||
}
|
||||
$condition[] = [ 'site_id', '=', $this->site_id ];
|
||||
$material_model = new MaterialModel();
|
||||
$material_list = $material_model->getMaterialPageList($condition, $page_index, $page_size, 'type asc,create_time desc');
|
||||
if (!empty($material_list[ 'data' ][ 'list' ]) && is_array($material_list[ 'data' ][ 'list' ])) {
|
||||
foreach ($material_list[ 'data' ][ 'list' ] as $k => $v) {
|
||||
if (!empty($v[ 'value' ]) && json_decode($v[ 'value' ])) {
|
||||
$material_list[ 'data' ][ 'list' ][ $k ][ 'value' ] = json_decode($v[ 'value' ], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $material_list;
|
||||
} else {
|
||||
return $this->fetch('material/lists');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加图文消息
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$type = input('type', 1);
|
||||
$param[ 'value' ] = input('value', '');
|
||||
|
||||
if ($type != 1) {
|
||||
// 图片、音频、视频、缩略图素材
|
||||
$file_path = input('path', '');
|
||||
|
||||
$res = $this->uploadApi($type, [ 'path' => $file_path ]);
|
||||
if ($res[ 'code' ] != 0) {
|
||||
return $res;
|
||||
}
|
||||
|
||||
$value[ 'file_path' ] = $file_path;
|
||||
$value[ 'url' ] = $res[ 'data' ][ 'url' ];
|
||||
$param[ 'value' ] = json_encode($value);
|
||||
$param[ 'media_id' ] = $res[ 'data' ][ 'media_id' ];
|
||||
|
||||
} else {
|
||||
$param[ 'media_id' ] = time() . 'GRAPHIC' . 'MESSAGE' . rand(1, 1000);
|
||||
}
|
||||
$param[ 'type' ] = $type;
|
||||
|
||||
$param[ 'create_time' ] = time();
|
||||
$param[ 'update_time' ] = time();
|
||||
$param[ 'site_id' ] = $this->site_id;
|
||||
$material_model = new MaterialModel();
|
||||
$res = $material_model->addMaterial($param);
|
||||
|
||||
return $res;
|
||||
} else {
|
||||
$this->assign('material_id', '0');
|
||||
$this->assign('flag', false);
|
||||
return $this->fetch('material/edit');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图文消息
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$condition = [];
|
||||
$condition[ 'id' ] = input('id', '');
|
||||
|
||||
$data[ 'value' ] = input('value', '');
|
||||
$data[ 'update_time' ] = time();
|
||||
|
||||
$material_model = new MaterialModel();
|
||||
$res = $material_model->editMaterial($data, $condition);
|
||||
|
||||
return $res;
|
||||
} else {
|
||||
$material_id = input('id', '');
|
||||
$this->assign('material_id', $material_id);
|
||||
$this->assign('flag', true);
|
||||
return $this->fetch('material/edit');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文本素材
|
||||
*/
|
||||
public function addTextMaterial()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$type = input('type', 1);
|
||||
$param[ 'value' ] = input('value', '');
|
||||
|
||||
$param[ 'type' ] = $type;
|
||||
|
||||
$param[ 'create_time' ] = time();
|
||||
$param[ 'update_time' ] = time();
|
||||
$param[ 'site_id' ] = $this->site_id;
|
||||
$material_model = new MaterialModel();
|
||||
$res = $material_model->addMaterial($param);
|
||||
|
||||
return $res;
|
||||
} else {
|
||||
return $this->fetch('material/add_text');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文本素材
|
||||
*/
|
||||
public function editTextMaterial()
|
||||
{
|
||||
$material_model = new MaterialModel();
|
||||
if (request()->isJson()) {
|
||||
$media_id = input("media_id", "");
|
||||
$media_id = str_replace("MATERIAL_TEXT_MESSAGE_", "", $media_id);
|
||||
|
||||
$content = input("content", "");
|
||||
$content = [ "content" => $content ];
|
||||
$content = json_encode($content, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
$condition[ 'id' ] = $media_id;
|
||||
$data[ 'value' ] = $content;
|
||||
$data[ 'update_time' ] = time();
|
||||
|
||||
$res = $material_model->editMaterial($data, $condition);
|
||||
|
||||
return $res;
|
||||
} else {
|
||||
$material_id = input('id', '');
|
||||
$data = $material_model->getMaterialInfo([ [ 'id', '=', $material_id ], [ 'site_id', '=', $this->site_id ] ]);
|
||||
if (!empty($data[ 'data' ])) {
|
||||
$data[ 'data' ][ 'value' ] = json_decode($data[ 'data' ][ 'value' ], true);
|
||||
}
|
||||
$this->assign('material_data', $data[ 'data' ]);
|
||||
return $this->fetch('material/edit_text');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 预览图文
|
||||
*/
|
||||
public function previewGraphicMessage()
|
||||
{
|
||||
$id = input('id', '');
|
||||
$index = input('i', '');
|
||||
$material_model = new MaterialModel();
|
||||
$info = $material_model->getMaterialInfo([ 'id' => $id ]);
|
||||
if (!empty($info[ 'data' ][ 'value' ]) && json_decode($info[ 'data' ][ 'value' ], true)) {
|
||||
$info[ 'data' ][ 'value' ] = json_decode($info[ 'data' ][ 'value' ], true);
|
||||
}
|
||||
$this->assign('info', $info[ 'data' ]);
|
||||
$this->assign('index', $index);
|
||||
return $this->fetch('material/preview_material');
|
||||
}
|
||||
|
||||
/**
|
||||
* 预览文本
|
||||
*/
|
||||
public function previewTextMessage()
|
||||
{
|
||||
$id = input('id', '');
|
||||
$material_model = new MaterialModel();
|
||||
$info = $material_model->getMaterialInfo([ 'id' => $id ]);
|
||||
if (!empty($info[ 'data' ][ 'value' ]) && json_decode($info[ 'data' ][ 'value' ], true)) {
|
||||
$info[ 'data' ][ 'value' ] = json_decode($info[ 'data' ][ 'value' ], true);
|
||||
}
|
||||
$this->assign('info', $info[ 'data' ]);
|
||||
return $this->fetch('material/preview_text');
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传永久素材
|
||||
* @param $type
|
||||
* @param $data
|
||||
* @return array
|
||||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||
*/
|
||||
public function uploadApi($type, $data)
|
||||
{
|
||||
$wechat_model = new WechatModel();
|
||||
|
||||
if ($type == 1) {
|
||||
$res = $wechat_model->uploadArticle($data);
|
||||
} else {
|
||||
if ($type == 2) {
|
||||
$type = 'image';
|
||||
$res = $wechat_model->uploadImage($data[ 'path' ]);
|
||||
} else if ($type == 3) {
|
||||
$type = 'voice';
|
||||
$res = $wechat_model->uploadVoice($data[ 'path' ]);
|
||||
} else if ($type == 4) {
|
||||
$type = 'video';
|
||||
$res = $wechat_model->uploadVideo($data[ 'path' ]);
|
||||
} else if ($type == 6) {
|
||||
$res = $wechat_model->uploadVideo($data[ 'path' ]);
|
||||
$type = 'thumb';
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信素材
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$id = input('id', 0);
|
||||
$material_model = new MaterialModel();
|
||||
$condition = array (
|
||||
[ "id", "=", $id ]
|
||||
);
|
||||
$res = $material_model->deleteMaterial($condition);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取素材详情
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMaterialInfo()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$material_model = new MaterialModel();
|
||||
$condition = array (
|
||||
[ 'id', '=', input('id', '') ]
|
||||
);
|
||||
$material_info = $material_model->getMaterialInfo($condition);
|
||||
if (json_decode($material_info[ 'data' ][ 'value' ])) {
|
||||
$material_info[ 'data' ][ 'value' ] = json_decode($material_info[ 'data' ][ 'value' ]);
|
||||
}
|
||||
return $material_info;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图文素材
|
||||
*/
|
||||
public function articleList()
|
||||
{
|
||||
$material_model = new MaterialModel();
|
||||
$condition = array (
|
||||
[ 'type', '=', 1 ]
|
||||
);
|
||||
$material_list = $material_model->getMaterialList($condition, '*', 'update_time desc');
|
||||
if (!empty($material_list[ 'data' ]) && is_array($material_list[ 'data' ])) {
|
||||
foreach ($material_list[ 'data' ] as $k => $v) {
|
||||
if (!empty($v[ 'value' ]) && json_decode($v[ 'value' ])) {
|
||||
$material_list[ 'data' ][ $k ][ 'value' ] = json_decode($v[ 'value' ], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->assign('material_list', $material_list);
|
||||
return $this->fetch('material/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 素材管理
|
||||
*/
|
||||
public function material()
|
||||
{
|
||||
//这这里的常量要与base中的区分,如果一致界面将无法渲染
|
||||
$type = input("type", 1);
|
||||
$this->assign("type", $type);
|
||||
// return array( 'shop/material/material' );
|
||||
return $this->fetch('material/material');
|
||||
}
|
||||
}
|
||||
66
addon/wechat/shop/controller/Menu.php
Executable file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use addon\wechat\model\Menu as MenuModel;
|
||||
use addon\wechat\model\Wechat as WechatModel;
|
||||
|
||||
/**
|
||||
* 微信菜单控制器
|
||||
*/
|
||||
class Menu extends BaseWechat
|
||||
{
|
||||
/**
|
||||
* 微信自定义菜单配置
|
||||
*/
|
||||
public function menu()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$menu_model = new MenuModel();
|
||||
$menu_info = $menu_model->getWechatMenuConfig($this->site_id);
|
||||
return $menu_info;
|
||||
} else {
|
||||
return $this->fetch('menu/menu');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改微信自定义菜单
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$menu_value = input('value', '');
|
||||
$menu_json = input('json_data', '');
|
||||
$menu_model = new MenuModel();
|
||||
$data = json_decode($menu_value, true);
|
||||
$res = $menu_model->setWechatMenuConfig($data, $this->site_id);
|
||||
if ($res[ 'code' ] != 0) {
|
||||
return $res;
|
||||
}
|
||||
$res = $this->sendWeixinMenu($menu_json);
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号同步更新微信菜单
|
||||
*/
|
||||
public function sendWeixinMenu($menu_json)
|
||||
{
|
||||
$wechat_model = new WechatModel($this->site_id);
|
||||
$menu_arr = json_decode($menu_json, true);
|
||||
$res = $wechat_model->menu($menu_arr[ 'button' ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
142
addon/wechat/shop/controller/Message.php
Executable file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use addon\wechat\model\Config;
|
||||
use app\model\message\Message as MessageModel;
|
||||
use app\model\message\MessageTemplate as MessageTemplateModel;
|
||||
|
||||
/**
|
||||
* 微信公众号模板消息
|
||||
*/
|
||||
class Message extends BaseWechat
|
||||
{
|
||||
/**
|
||||
* 编辑模板消息
|
||||
* @return array|mixed|string
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$message_model = new MessageModel();
|
||||
$keywords = input("keywords", "");
|
||||
$info = $message_model->getMessageInfo($this->site_id, $keywords)[ 'data' ];
|
||||
|
||||
if (empty($info))
|
||||
$this->error("不存在的模板信息!");
|
||||
|
||||
$wechat_json_array = $info[ "wechat_json_array" ];
|
||||
if (request()->isJson()) {
|
||||
|
||||
$wechat_is_open = input('wechat_is_open', 0);
|
||||
// $bottomtext = input("bottomtext", "");
|
||||
// $headtext = input("headtext", "");
|
||||
// $bottomtextcolor = input("bottomtextcolor", "");
|
||||
// $headtextcolor = input("headtextcolor", "");
|
||||
//// $wechat_json_array[ 'headtext' ] = $headtext;//头部标题
|
||||
// $wechat_json_array[ 'headtextcolor' ] = $headtextcolor;//头部标题颜色
|
||||
// $wechat_json_array[ 'bottomtext' ] = $bottomtext;//尾部描述
|
||||
// $wechat_json_array[ 'bottomtextcolor' ] = $bottomtextcolor;//尾部描述颜色
|
||||
|
||||
$data = array (
|
||||
'wechat_json' => json_encode($wechat_json_array),
|
||||
);
|
||||
$condition = array (
|
||||
[ "keywords", "=", $keywords ]
|
||||
);
|
||||
$template_model = new MessageTemplateModel();
|
||||
$res = $template_model->editMessageTemplate($data, $condition);
|
||||
if ($res[ 'code' ] == 0) {
|
||||
$res = $message_model->editMessage([ 'wechat_is_open' => $wechat_is_open, 'site_id' => $this->site_id, 'keywords' => $keywords ], [
|
||||
[ "keywords", "=", $keywords ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
]);
|
||||
}
|
||||
return $res;
|
||||
} else {
|
||||
$this->assign("keywords", $keywords);
|
||||
if (isset($wechat_json_array[ 'keyword_name_list' ])) {
|
||||
$wechat_json_array[ 'keyword_name_list' ] = implode(',', $wechat_json_array[ 'keyword_name_list' ]);
|
||||
}
|
||||
$this->assign("info", $wechat_json_array);
|
||||
$this->assign('wechat_is_open', $info[ 'wechat_is_open' ]);
|
||||
$this->assign('message_title', $info[ 'title' ]);
|
||||
return $this->fetch('message/edit');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板消息设置
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function config()
|
||||
{
|
||||
$message_model = new MessageModel();
|
||||
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$condition = array (
|
||||
[ "support_type", "like", '%wechat%' ],
|
||||
);
|
||||
$list = $message_model->getMessagePageList($condition, $this->site_id, $page, $page_size);
|
||||
return $list;
|
||||
} else {
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getTemplateMessageConfig($this->site_id)[ 'data' ][ 'value' ];
|
||||
$this->assign('config', $config);
|
||||
return $this->fetch('message/config');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信模板消息状态设置
|
||||
*/
|
||||
public function setWechatStatus()
|
||||
{
|
||||
$message_model = new MessageModel();
|
||||
|
||||
if (request()->isJson()) {
|
||||
$keywords = input("keywords", "");
|
||||
$wechat_is_open = input('wechat_is_open', 0);
|
||||
$res = $message_model->getWechatTemplateNo($keywords, $this->site_id, $wechat_is_open);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板编号
|
||||
*/
|
||||
public function getWechatTemplateNo()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$keywords = input("keywords", "");
|
||||
$message_model = new MessageModel();
|
||||
$res = $message_model->getWechatTemplateNo($keywords, $this->site_id, -1);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模板消息配置
|
||||
* @return array
|
||||
*/
|
||||
public function messageConfig()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$is_jump_weapp = input("is_jump_weapp", 0);
|
||||
$config_model = new Config();
|
||||
$res = $config_model->setTemplateMessageConfig([ 'is_jump_weapp' => $is_jump_weapp ], 1, $this->site_id);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
353
addon/wechat/shop/controller/Replay.php
Executable file
@@ -0,0 +1,353 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use addon\wechat\model\Replay as ReplayModel;
|
||||
|
||||
/**
|
||||
* 微信回复控制器
|
||||
*/
|
||||
class Replay extends BaseWechat
|
||||
{
|
||||
/**
|
||||
* 回复设置--关键字自动回复
|
||||
*/
|
||||
public function replay()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$limit = input('limit', PAGE_LIST_ROWS);
|
||||
$rule_type = input('rule_type', '');
|
||||
$search_text = input('search_text', '');
|
||||
|
||||
$condition = array (
|
||||
[ 'rule_type', "=", $rule_type ],
|
||||
[ 'site_id', '=', $this->site_id ]
|
||||
);
|
||||
|
||||
$condition[] = [
|
||||
'rule_name', 'like', '%' . $search_text . '%'
|
||||
];
|
||||
|
||||
$order = 'create_time desc';
|
||||
$replay_model = new ReplayModel();
|
||||
$list = $replay_model->getReplayPageList($condition, $page, $limit, $order);
|
||||
foreach ($list[ 'data' ][ 'list' ] as $k => $v) {
|
||||
$list[ 'data' ][ 'list' ][ $k ][ 'key_list' ] = $v['keywords_json'] ? json_decode($v[ 'keywords_json' ]) : [];
|
||||
$list[ 'data' ][ 'list' ][ $k ][ 'replay_list' ] = $v['replay_json'] ? json_decode($v[ 'replay_json' ]) : [];
|
||||
}
|
||||
return $list;
|
||||
} else {
|
||||
$this->assign('link_list', []);
|
||||
return $this->fetch('replay/replay');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加关键字回复
|
||||
*/
|
||||
public function addOrEditRule()
|
||||
{
|
||||
$replay_model = new ReplayModel();
|
||||
if (request()->isJson()) {
|
||||
$rule_name = input('rule_name', '');
|
||||
$rule_id = input('rule_id', 0);
|
||||
if ($rule_id > 0) {
|
||||
$data = [
|
||||
'rule_name' => $rule_name,
|
||||
'modify_time' => time()
|
||||
];
|
||||
$res = $replay_model->editRule($data, [ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
return $res;
|
||||
} else {
|
||||
$data = [
|
||||
'rule_name' => $rule_name,
|
||||
'rule_type' => 'KEYWORDS',
|
||||
'keywords_json' => '',
|
||||
'replay_json' => '',
|
||||
'create_time' => time(),
|
||||
'site_id' => $this->site_id
|
||||
];
|
||||
$res = $replay_model->addRule($data);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加关键词回复
|
||||
*/
|
||||
public function editKeywords()
|
||||
{
|
||||
$replay_model = new ReplayModel();
|
||||
if (request()->isJson()) {
|
||||
$rule_id = input('rule_id', '');
|
||||
$keywords_name = input('keywords_name', '');
|
||||
$keywords_type = input('keywords_type', 0);
|
||||
$key_id = input('key_id', -1);
|
||||
$info = $replay_model->getRuleInfo([ [ 'rule_id', "=", $rule_id ] ])[ 'data' ];
|
||||
if ($info[ 'keywords_json' ]) {
|
||||
$data = json_decode($info[ 'keywords_json' ]);
|
||||
if ($key_id > -1) {
|
||||
$data[ $key_id ] = [
|
||||
'keywords_name' => $keywords_name,
|
||||
'keywords_type' => $keywords_type
|
||||
];
|
||||
} else {
|
||||
$data[] = [
|
||||
'keywords_name' => $keywords_name,
|
||||
'keywords_type' => $keywords_type
|
||||
];
|
||||
}
|
||||
$data = json_encode($data);
|
||||
} else {
|
||||
$data = [
|
||||
[
|
||||
'keywords_name' => $keywords_name,
|
||||
'keywords_type' => $keywords_type
|
||||
]
|
||||
];
|
||||
$data = json_encode($data);
|
||||
}
|
||||
$data = [
|
||||
'keywords_json' => $data,
|
||||
'modify_time' => time()
|
||||
];
|
||||
$res = $replay_model->editRule($data, [ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除关键字回复
|
||||
*/
|
||||
public function deleteRule()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$rule_id = input('rule_id', 0);
|
||||
$replay_model = new ReplayModel();
|
||||
$res = $replay_model->deleteRule([ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除关键词数据
|
||||
*/
|
||||
public function deleteKeywords()
|
||||
{
|
||||
$replay_model = new ReplayModel();
|
||||
if (request()->isJson()) {
|
||||
$rule_id = input('rule_id', '');
|
||||
$key_id = input('key_id', '');
|
||||
$info_result = $replay_model->getRuleInfo([ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
$info = $info_result[ "data" ];
|
||||
$keywords_json = '';
|
||||
if ($info[ 'keywords_json' ]) {
|
||||
$keywords_json = json_decode($info[ 'keywords_json' ]);
|
||||
array_splice($keywords_json, $key_id, 1);
|
||||
$keywords_json = json_encode($keywords_json);
|
||||
}
|
||||
$data = [
|
||||
'keywords_json' => $keywords_json,
|
||||
];
|
||||
$res = $replay_model->editRule($data, [ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改回复数据
|
||||
* @return mixed
|
||||
*/
|
||||
public function editReplays()
|
||||
{
|
||||
$replay_model = new ReplayModel();
|
||||
if (request()->isJson()) {
|
||||
$rule_id = input('rule_id', '');
|
||||
$reply_content = input('reply_content', '');
|
||||
$media_id = input('media_id', '');
|
||||
$key_id = input('key_id', -1);
|
||||
$type = input('type', '');
|
||||
$replay_type = input('replay_type', '');
|
||||
$info_result = $replay_model->getRuleInfo([ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
$info = $info_result[ "data" ];
|
||||
if (!empty($rule_id)) {
|
||||
if ($info[ 'replay_json' ]) {
|
||||
$data = json_decode($info[ 'replay_json' ]);
|
||||
|
||||
if ($key_id > -1) {
|
||||
$data[ $key_id ] = [
|
||||
'reply_content' => $reply_content,
|
||||
'type' => $type,
|
||||
];
|
||||
if (!empty($media_id)) {
|
||||
$data[ $key_id ][ 'media_id' ] = $media_id;
|
||||
}
|
||||
} else {
|
||||
if (!empty($media_id)) {
|
||||
$data[] = [
|
||||
'reply_content' => $reply_content,
|
||||
'type' => $type,
|
||||
'media_id' => $media_id
|
||||
];
|
||||
} else {
|
||||
$data[] = [
|
||||
'reply_content' => $reply_content,
|
||||
'type' => $type,
|
||||
];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data = [
|
||||
[
|
||||
'reply_content' => $reply_content,
|
||||
'type' => $type,
|
||||
]
|
||||
];
|
||||
if (!empty($media_id)) {
|
||||
$data[ 0 ][ 'media_id' ] = $media_id;
|
||||
}
|
||||
}
|
||||
$data = json_encode($data);
|
||||
$data = [
|
||||
'replay_json' => $data,
|
||||
'modify_time' => time()
|
||||
];
|
||||
$res = $replay_model->editRule($data, [ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
return $res;
|
||||
} else {
|
||||
$rule_type = '';
|
||||
$rule_name = '';
|
||||
if ($replay_type == "default") {
|
||||
$rule_type = 'DEFAULT';
|
||||
$rule_name = '默认回复';
|
||||
} else if ($replay_type == "follow") {
|
||||
$rule_type = 'AFTER';
|
||||
$rule_name = '关注后回复';
|
||||
}
|
||||
$data = [
|
||||
[
|
||||
'reply_content' => $reply_content,
|
||||
'type' => $type,
|
||||
]
|
||||
];
|
||||
if (!empty($media_id)) {
|
||||
$data[ 0 ][ 'media_id' ] = $media_id;
|
||||
}
|
||||
$data = json_encode($data);
|
||||
$data = [
|
||||
'replay_json' => $data,
|
||||
'modify_time' => time(),
|
||||
'rule_name' => $rule_name,
|
||||
'rule_type' => $rule_type,
|
||||
'site_id' => $this->site_id,
|
||||
];
|
||||
$res = $replay_model->addRule($data);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回复数据
|
||||
*/
|
||||
public function deleteReply()
|
||||
{
|
||||
$replay_model = new ReplayModel();
|
||||
if (request()->isJson()) {
|
||||
$rule_id = input('rule_id', '');
|
||||
$key_id = input('key_id', '');
|
||||
$info = $replay_model->getRuleInfo([ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
$info = $info[ 'data' ];
|
||||
$replay_json = '';
|
||||
if ($info[ 'replay_json' ]) {
|
||||
$replay_json = json_decode($info[ 'replay_json' ]);
|
||||
array_splice($replay_json, $key_id, 1);
|
||||
$replay_json = json_encode($replay_json);
|
||||
}
|
||||
$data = [
|
||||
'replay_json' => $replay_json,
|
||||
];
|
||||
$res = $replay_model->editRule($data, [ [ 'rule_id', "=", $rule_id ], [ 'site_id', "=", $this->site_id ] ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关注后回复设置
|
||||
*/
|
||||
public function afterAttention()
|
||||
{
|
||||
return $this->fetch('replay/aterAttention');
|
||||
}
|
||||
|
||||
/**
|
||||
* 回复设置--关注后自动回复
|
||||
*/
|
||||
public function follow()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$pagesize = input('limit', PAGE_LIST_ROWS);
|
||||
$rule_type = input('rule_type', '');
|
||||
$condition = array (
|
||||
'rule_type' => $rule_type,
|
||||
'site_id' => $this->site_id
|
||||
);
|
||||
$order = 'create_time desc';
|
||||
$replay_model = new ReplayModel();
|
||||
$list = $replay_model->getReplayPageList($condition, $page, $pagesize, $order);
|
||||
foreach ($list[ 'data' ][ 'list' ] as $k => $v) {
|
||||
$list[ 'data' ][ 'list' ][ $k ][ 'key_list' ] = $v['keywords_json'] ? json_decode($v[ 'keywords_json' ]) : [];
|
||||
$list[ 'data' ][ 'list' ][ $k ][ 'replay_list' ] = $v['replay_json'] ? json_decode($v[ 'replay_json' ]) : [];
|
||||
}
|
||||
return $list;
|
||||
} else {
|
||||
$this->assign('link_list', []);//链接
|
||||
return $this->fetch('replay/follow');
|
||||
}
|
||||
}
|
||||
|
||||
public function default()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$limit = input('limit', PAGE_LIST_ROWS);
|
||||
// $rule_type = input('rule_type', '');
|
||||
$search_text = input('search_text', '');
|
||||
|
||||
$condition = array (
|
||||
[ 'rule_type', "=", 'DEFAULT' ], //只获取默认的
|
||||
[ 'site_id', '=', $this->site_id ]
|
||||
);
|
||||
|
||||
$condition[] = [
|
||||
'rule_name', 'like', '%' . $search_text . '%'
|
||||
];
|
||||
|
||||
$order = 'create_time desc';
|
||||
$replay_model = new ReplayModel();
|
||||
$list = $replay_model->getReplayPageList($condition, $page, $limit, $order);
|
||||
foreach ($list[ 'data' ][ 'list' ] as $k => $v) {
|
||||
$list[ 'data' ][ 'list' ][ $k ][ 'key_list' ] = $v['keywords_json'] ? json_decode($v[ 'keywords_json' ]) : [];
|
||||
$list[ 'data' ][ 'list' ][ $k ][ 'replay_list' ] = $v['replay_json'] ? json_decode($v[ 'replay_json' ]) : [];
|
||||
}
|
||||
return $list;
|
||||
} else {
|
||||
$this->assign('link_list', []);//链接
|
||||
return $this->fetch('replay/default');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
60
addon/wechat/shop/controller/Stat.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use addon\wechat\model\Stat as StatModel;
|
||||
|
||||
/**
|
||||
* 微信公众号基础功能
|
||||
*/
|
||||
class Stat extends BaseWechat
|
||||
{
|
||||
/**
|
||||
* 访问统计
|
||||
*/
|
||||
public function stat()
|
||||
{
|
||||
$stat_model = new StatModel();
|
||||
$yesterday = date('Y-m-d', strtotime('-1 day'));
|
||||
//昨天的用户分析数据
|
||||
$wechat_fans_result = $stat_model->fans($yesterday, $yesterday);
|
||||
$this->assign('yesterday_user_data', $wechat_fans_result[ 'data' ][ 0 ] ?? []);
|
||||
//昨天的接口分析数据
|
||||
$wechat_interface_result = $stat_model->interfaceSummary($yesterday, $yesterday);
|
||||
$this->assign('yesterday_interface_data', $wechat_interface_result[ 'data' ][ 0 ] ?? []);
|
||||
return $this->fetch('stat/stat');
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口调用统计
|
||||
* @return array
|
||||
*/
|
||||
public function interfaceSummaryStatistics()
|
||||
{
|
||||
$date_type = input("date_type", "week");
|
||||
$stat_model = new StatModel();
|
||||
$result = $stat_model->interfaceSummaryStatistics($date_type);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户访问统计
|
||||
* @return array
|
||||
*/
|
||||
public function userSummaryStatistics()
|
||||
{
|
||||
$date_type = input("date_type", "week");
|
||||
$stat_model = new StatModel();
|
||||
$result = $stat_model->userSummaryStatistics($date_type);
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
323
addon/wechat/shop/controller/Wechat.php
Executable file
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\wechat\shop\controller;
|
||||
|
||||
use addon\wechat\model\Config as ConfigModel;
|
||||
use addon\wechat\model\Qrcode;
|
||||
use app\model\share\WchatShareBase as ShareModel;
|
||||
use app\model\system\User;
|
||||
|
||||
/**
|
||||
* 微信公众号基础功能
|
||||
*/
|
||||
class Wechat extends BaseWechat
|
||||
{
|
||||
|
||||
/**
|
||||
* 功能设置
|
||||
*/
|
||||
public function setting()
|
||||
{
|
||||
$replay_url = 'wechat://shop/replay/replay';
|
||||
if(!($this->user_info['is_admin'] == 1 || $this->group_info['is_system'] == 1)){
|
||||
$user_model = new User();
|
||||
$check_res = $user_model->checkAndGetRedirectUrl(['url' => $replay_url, 'app_module' => $this->app_module], $this->group_info);
|
||||
if($check_res['redirect_url']){
|
||||
$replay_url = $check_res[ 'redirect_url' ];
|
||||
}
|
||||
}
|
||||
$setting_arr = [
|
||||
[
|
||||
'url' => href_url('wechat://shop/wechat/config'),
|
||||
'img' => 'config_wechat_icon.png',
|
||||
'title' => '公众号管理',
|
||||
'content' => '公众号管理',
|
||||
],
|
||||
[
|
||||
'url' => href_url('wechat://shop/material/lists'),
|
||||
'img' => 'config_material_icon.png',
|
||||
'title' => '消息素材',
|
||||
'content' => '消息素材',
|
||||
],
|
||||
// [
|
||||
// 'url' => href_url('wechat://shop/fans/lists'),
|
||||
// 'img' => 'config_material_icon.png',
|
||||
// 'title' => '粉丝列表',
|
||||
// 'content' => '粉丝列表',
|
||||
// ],
|
||||
[
|
||||
'url' => href_url('wechat://shop/menu/menu'),
|
||||
'img' => 'config_menu_icon.png',
|
||||
'title' => '菜单管理',
|
||||
'content' => '菜单管理',
|
||||
],
|
||||
// [
|
||||
// 'url' => href_url('wechat://shop/wechat/qrcode'),
|
||||
// 'img' => 'config_qrcode_icon.png',
|
||||
// 'title' => '推广二维码',
|
||||
// 'content' => '推广二维码管理',
|
||||
// ],
|
||||
[
|
||||
'url' => href_url('wechat://shop/wechat/share'),
|
||||
'img' => 'config_share_icon.png',
|
||||
'title' => '分享内容设置',
|
||||
'content' => '分享内容设置',
|
||||
],
|
||||
[
|
||||
'url' => href_url($replay_url),
|
||||
'img' => 'config_replay_icon.png',
|
||||
'title' => '回复设置',
|
||||
'content' => '回复设置',
|
||||
],
|
||||
[
|
||||
'url' => href_url('wechat://shop/message/config'),
|
||||
'img' => 'config_message_icon.png',
|
||||
'title' => '模板消息',
|
||||
'content' => '模板消息设置',
|
||||
],
|
||||
];
|
||||
$this->assign('setting_arr', $setting_arr);
|
||||
return $this->fetch('wechat/setting');
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号配置
|
||||
*/
|
||||
public function config()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
if (request()->isJson()) {
|
||||
$wechat_name = input('wechat_name', '');//公众号名称 (备注: 公众号名称,尽量与公众号平台保持一致)
|
||||
$wechat_original = input('wechat_original', '');//公众号原始id (备注: 公众号原始id,如:gh_111111111111)
|
||||
$appid = input('appid', '');//gh_845581623321AppID (备注: AppID 请注意需要与微信公众号平台保持一致,且注意信息安全,不要随意透露给第三方)
|
||||
$appsecret = input('appsecret', '');//AppSecret (备注: AppSecret密钥需要与微信公众号平台保持一致,没有特别原因不要随意修改,也不要随意透露给第三方)
|
||||
$token = input('token', 'TOKEN');//Token (备注: 自定义的Token值、确保后台与公众号平台填写的一致)
|
||||
$encodingaeskey = input('encodingaeskey', '');//EncodingAESKey (备注: 由开发者手动填写或随机生成,将用作消息体加解密密钥)
|
||||
$is_use = input('is_use', 1);//是否启用
|
||||
$qrcode = input('qrcode', '');//二维码
|
||||
$headimg = input('headimg', '');//头像
|
||||
$data = array (
|
||||
"wechat_name" => $wechat_name,
|
||||
"wechat_original" => $wechat_original,
|
||||
"appid" => $appid,
|
||||
"appsecret" => $appsecret,
|
||||
"token" => $token,
|
||||
"encodingaeskey" => $encodingaeskey,
|
||||
'qrcode' => $qrcode,
|
||||
'headimg' => $headimg,
|
||||
);
|
||||
|
||||
$res = $config_model->setWechatConfig($data, $is_use, $this->site_id);
|
||||
return $res;
|
||||
} else {
|
||||
$config_result = $config_model->getWechatConfig($this->site_id);
|
||||
$config = $config_result[ "data" ];
|
||||
$is_authopen = $config_result[ 'data' ][ 'value' ][ 'is_authopen' ] ?? 0;
|
||||
if ($is_authopen == 1) {
|
||||
$config[ 'value' ] = [];
|
||||
}
|
||||
$this->assign("config", $config);
|
||||
// 获取当前域名
|
||||
$url = __ROOT__;
|
||||
// 去除链接的http://头部
|
||||
$url_top = str_replace("https://", "", $url);
|
||||
$url_top = str_replace("http://", "", $url_top);
|
||||
// 去除链接的尾部/?s=
|
||||
$url_top = str_replace('/?s=', '', $url_top);
|
||||
$call_back_url = addon_url("wechat://api/auth/relateweixin");
|
||||
$this->assign("url", $url_top);
|
||||
$this->assign("call_back_url", $call_back_url);
|
||||
|
||||
return $this->fetch('wechat/config');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推广二维码模板
|
||||
*/
|
||||
public function qrcode()
|
||||
{
|
||||
$qrcode_model = new Qrcode();
|
||||
$template_list = $qrcode_model->getQrcodePageList([ 'is_remove' => 0 ]);
|
||||
$this->assign("template_list", $template_list[ 'data' ]);
|
||||
return $this->fetch('wechat/qrcode');
|
||||
}
|
||||
|
||||
/**
|
||||
* 推广二维码
|
||||
*/
|
||||
public function addQrcode()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$data = array (
|
||||
'background' => input("background", ''),
|
||||
'nick_font_color' => input("nick_font_color", '#000'),
|
||||
'nick_font_size' => input("nick_font_size", '12'),
|
||||
'is_logo_show' => input("is_logo_show", '1'),
|
||||
'header_left' => input("header_left", '59') . 'px',
|
||||
'header_top' => input("header_top", '15') . 'px',
|
||||
'name_left' => input("name_left", '128') . 'px',
|
||||
'name_top' => input("name_top", '23') . 'px',
|
||||
'logo_left' => input("logo_left", '60') . 'px',
|
||||
'logo_top' => input("logo_top", '200') . 'px',
|
||||
'code_left' => input("code_left", '70') . 'px',
|
||||
'code_top' => input("code_top", '300') . 'px',
|
||||
);
|
||||
$qrcode_model = new Qrcode();
|
||||
$result = $qrcode_model->addQrcode($data);
|
||||
return $result;
|
||||
} else {
|
||||
return $this->fetch('wechat/add_qrcode');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑二维码模板
|
||||
* @return mixed
|
||||
*/
|
||||
public function editQrcode()
|
||||
{
|
||||
$id = input("id", 0);
|
||||
$qrcode_model = new Qrcode();
|
||||
$condition = array (
|
||||
"id" => $id
|
||||
);
|
||||
if (request()->isJson()) {
|
||||
$data = array (
|
||||
'background' => input("background", ''),
|
||||
'nick_font_color' => input("nick_font_color", '#000'),
|
||||
'nick_font_size' => input("nick_font_size", '12'),
|
||||
'is_logo_show' => input("is_logo_show", '1'),
|
||||
'header_left' => input("header_left", '59') . 'px',
|
||||
'header_top' => input("header_top", '15') . 'px',
|
||||
'name_left' => input("name_left", '128') . 'px',
|
||||
'name_top' => input("name_top", '23') . 'px',
|
||||
'logo_left' => input("logo_left", '60') . 'px',
|
||||
'logo_top' => input("logo_top", '200') . 'px',
|
||||
'code_left' => input("code_left", '70') . 'px',
|
||||
'code_top' => input("code_top", '300') . 'px',
|
||||
);
|
||||
|
||||
$result = $qrcode_model->editQrcode($data, $condition);
|
||||
return $result;
|
||||
} else {
|
||||
$info = $qrcode_model->getQrcodeInfo($condition)[ "data" ];
|
||||
$this->assign("info", $info);
|
||||
return $this->fetch('wechat/edit_qrcode');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认推广二维码
|
||||
*/
|
||||
public function qrcodeDefault()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$id = input('id', 0);
|
||||
$qrcode_model = new Qrcode();
|
||||
$result = $qrcode_model->modifyQrcodeDefault([ 'id' => $id ]);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除默认推广二维码
|
||||
*/
|
||||
public function deleteQrcode()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$id = input('id', 0);
|
||||
$qrcode_model = new Qrcode();
|
||||
$result = $qrcode_model->deleteQrcode([ 'id' => $id ]);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享内容设置
|
||||
*/
|
||||
public function shareBack()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
if (request()->isJson()) {
|
||||
$qrcode_param_1 = input('qrcode_param_1', '');
|
||||
$qrcode_param_2 = input('qrcode_param_2', '');
|
||||
$goods_param_1 = input('goods_param_1', '');
|
||||
$goods_param_2 = input('goods_param_2', '');
|
||||
$shop_param_1 = input('shop_param_1', '');
|
||||
$shop_param_2 = input('shop_param_2', '');
|
||||
$shop_param_3 = input('shop_param_3', '');
|
||||
|
||||
$data = array (
|
||||
'qrcode_param_1' => $qrcode_param_1,
|
||||
'qrcode_param_2' => $qrcode_param_2,
|
||||
'goods_param_1' => $goods_param_1,
|
||||
'goods_param_2' => $goods_param_2,
|
||||
'shop_param_1' => $shop_param_1,
|
||||
'shop_param_2' => $shop_param_2,
|
||||
'shop_param_3' => $shop_param_3,
|
||||
);
|
||||
|
||||
$res = $config_model->setShareConfig($data, 1, $this->site_id);
|
||||
return $res;
|
||||
} else {
|
||||
$config_result = $config_model->getShareConfig($this->site_id);
|
||||
$this->assign("info", $config_result[ "data" ][ 'value' ]);
|
||||
return $this->fetch('wechat/share_back');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享内容设置
|
||||
*/
|
||||
public function share()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$data_json = input('data_json', '');
|
||||
$data = json_decode($data_json, true);
|
||||
$share_model = new ShareModel();
|
||||
return $share_model->setShareConfig($this->site_id, $data);
|
||||
} else {
|
||||
$share_config = event('WchatShareConfig', [ 'site_id' => $this->site_id ]);
|
||||
$config_list = [];
|
||||
foreach ($share_config as $data) {
|
||||
foreach ($data[ 'data' ] as $val) {
|
||||
$config_list[] = $val;
|
||||
}
|
||||
}
|
||||
$this->assign('config_list', $config_list);
|
||||
return $this->fetch('wechat/share');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号设置
|
||||
*/
|
||||
public function configSetting()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
$config_result = $config_model->getWechatConfig($this->site_id);
|
||||
$config = $config_result[ "data" ];
|
||||
if (!empty($config[ "value" ])) {
|
||||
//是否是开放平台授权
|
||||
$is_authopen = $config_result[ 'data' ][ 'value' ][ 'is_authopen' ] ?? 0;
|
||||
if ($is_authopen > 0) {
|
||||
$this->redirect(addon_url("wxoplatform://shop/oplatform/wechat"));
|
||||
} else {
|
||||
$this->redirect(addon_url("wechat://shop/wechat/config"));
|
||||
}
|
||||
} else {
|
||||
$this->redirect(addon_url("wxoplatform://shop/oplatform/wechatsettled"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
158
addon/wechat/shop/view/fans/fans_tag_list.html
Executable file
@@ -0,0 +1,158 @@
|
||||
<style>
|
||||
.layui-table {margin: 0}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<button class="layui-btn" onclick="addOrEditTag('添加标签')">添加标签</button>
|
||||
<button class="layui-btn" onclick="syncTag()">同步标签</button>
|
||||
</div>
|
||||
<div>
|
||||
<table id="tag_list" lay-filter="tag_list" class="layui-table"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default" lay-event="edit">编辑</a> |
|
||||
<a class="default" lay-event="delete">删除</a> <br/>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="addOrEditTag">
|
||||
<div class="layui-form" lay-filter="otherInfo">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">标签名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="tag_name" class="layui-input" value="{{d.tag_name}}" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addOrEditTagSubmit">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="{{d.id}}">
|
||||
<input type="hidden" name="tag_id" value="{{d.tag_id}}">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var form,laytpl,index,layer;
|
||||
var table = new Table({
|
||||
elem : '#tag_list',
|
||||
filter : "tag_list",
|
||||
url : "{:addon_url('wechat://shop/fans/fansTagList')}",
|
||||
cols : [
|
||||
[
|
||||
{
|
||||
type : 'checkbox',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
field: 'tag_name',
|
||||
title: '标签名称',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
title : '操作',
|
||||
toolbar : '#operation',
|
||||
width : '30%',
|
||||
align : 'right',
|
||||
unresize : 'true'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
table.tool(function(obj){
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case 'edit':
|
||||
addOrEditTag('编辑标签', data);
|
||||
break;
|
||||
case 'delete':
|
||||
deleteTag(data);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
layui.use([ 'form', 'laytpl'], function() {
|
||||
laytpl = layui.laytpl;
|
||||
form = layui.form;
|
||||
form.render();
|
||||
|
||||
var repeat_flag = false;//防重复标识
|
||||
form.on('submit(addOrEditTagSubmit)', function (data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
var url = data.field.id > 0 ? '{:addon_url("wechat://shop/fans/editFansTag")}' : '{:addon_url("wechat://shop/fans/addFansTag")}';
|
||||
$.ajax({
|
||||
type: "post",
|
||||
async: false,
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
data: data.field,
|
||||
success: function (res) {
|
||||
back();
|
||||
layer.msg(res.message);
|
||||
if (res.code == 0) {
|
||||
table.reload();
|
||||
}
|
||||
repeat_flag = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
function addOrEditTag(title, data) {
|
||||
var tpl_data = data == undefined ? {tag_name: '', tag_id: 0, id: 0} : data;
|
||||
laytpl($("#addOrEditTag").html()).render(tpl_data, function (html) {
|
||||
index = layer.open({
|
||||
type: 1,
|
||||
title: title,
|
||||
skin: 'layer-tips-class',
|
||||
area: ['450px'],
|
||||
content: html
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
var repeat_flag_delete = false;//防重复标识
|
||||
function deleteTag(data){
|
||||
if (repeat_flag_delete) return;
|
||||
repeat_flag_delete = true;
|
||||
layer.confirm('确定要删除该标签吗?',function (index) {
|
||||
layer.close(index);
|
||||
$.ajax({
|
||||
type : "post",
|
||||
async : false,
|
||||
url : '{:addon_url("wechat://shop/fans/deleteFansTag")}',
|
||||
dataType: 'json',
|
||||
data : data,
|
||||
success:function(res){
|
||||
layer.msg(res.message);
|
||||
if(res.code == 0){
|
||||
table.reload();
|
||||
}
|
||||
repeat_flag_delete = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function syncTag(){
|
||||
$.ajax({
|
||||
url : '{:addon_url("wechat://shop/fans/syncFansTag")}',
|
||||
dataType: 'json',
|
||||
async : false,
|
||||
type : "post",
|
||||
beforeSend : function(){
|
||||
index = layer.load(2);
|
||||
},
|
||||
success:function(res){
|
||||
back();
|
||||
layer.msg(res.message);
|
||||
if(res.code == 0){
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
212
addon/wechat/shop/view/fans/lists.html
Executable file
@@ -0,0 +1,212 @@
|
||||
<link rel="stylesheet" type="text/css" href="SHOP_CSS/member.css" />
|
||||
<link rel="stylesheet" type="text/css" href="WECHAT_CSS/wx_fans.css" />
|
||||
<style>
|
||||
.layui-layout-admin .tips-wrap{margin-bottom: 15px;}
|
||||
</style>
|
||||
|
||||
<div class="single-filter-box">
|
||||
<button class="layui-btn btn-hide" lay-submit="" lay-filter="save" onclick="refresh()">同步粉丝信息</button>
|
||||
<div class="layui-form">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="nickname" placeholder="请输入粉丝名称" autocomplete="off" class="layui-input">
|
||||
<button type="button" class="layui-btn layui-btn-primary" lay-filter="search" lay-submit>
|
||||
<i class="layui-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<div class="layui-colla-content layui-show">说明:把同步公众号上的实际粉丝数量与信息同步到商城中展示</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<table id="Fans_list" lay-filter="Fans_list"></table>
|
||||
|
||||
<!-- 批量操作 -->
|
||||
<script type="text/html" id="batchOperation">
|
||||
</script>
|
||||
|
||||
<!-- 地址 -->
|
||||
<script type="text/html" id="diqu">
|
||||
<p>{{d.country}}{{d.province}}{{d.city}}{{ d.district != '' && d.district != '无' ? d.district : '' }}</p>
|
||||
</script>
|
||||
|
||||
<!-- 操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
<a class="layui-btn" href="" lay-event="">查看消息</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<script type="text/html" id="fansMessage">
|
||||
<div class='table-title'>
|
||||
<div class='title-pic'>
|
||||
{{# if(d.headimgurl){ }}
|
||||
<img layer-src src={{ns.img(d.headimgurl)}} class="head-portrait">
|
||||
{{# } }}
|
||||
</div>
|
||||
<div class='title-content'>
|
||||
<p class="layui-elip">用户名:{{d.nickname}}</p>
|
||||
{{# if(d.sex == 1){ }}
|
||||
<p class="layui-elip">性别:男</p>
|
||||
{{# }else{ }}
|
||||
<p class="layui-elip">性别:女</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 用户来源 -->
|
||||
<script type="text/html" id="subscribe_scene">
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_SEARCH'){ }}
|
||||
<p>公众号搜索</p>
|
||||
{{# } }}
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_ACCOUNT_MIGRATION'){ }}
|
||||
<p>公众号迁移</p>
|
||||
{{# } }}
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PROFILE_CARD'){ }}
|
||||
<p>名片分享</p>
|
||||
{{# } }}
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_QR_CODE'){ }}
|
||||
<p>扫描二维码</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PROFILE_LINK'){ }}
|
||||
<p>图文页内名称点击</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PROFILE_ITEM'){ }}
|
||||
<p>图文页右上角菜单</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PAID'){ }}
|
||||
<p>支付后关注</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_OTHERS '){ }}
|
||||
<p>其他</p>
|
||||
{{# } }}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="progress-layer">
|
||||
<h3>正在同步中,已完成...</h3>
|
||||
<div class="layui-progress layui-progress-big" lay-showPercent="true" lay-filter="progress">
|
||||
<div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'element'], function() {
|
||||
var table,
|
||||
form = layui.form;
|
||||
form.render();
|
||||
|
||||
table = new Table({
|
||||
elem: '#Fans_list',
|
||||
url: ns.url("wechat://shop/fans/lists"),
|
||||
page: true,
|
||||
cols: [
|
||||
[{
|
||||
title: '粉丝信息',
|
||||
width: '30%',
|
||||
unresize: 'false',
|
||||
templet: '#fansMessage'
|
||||
}, {
|
||||
field: 'subscribe_time',
|
||||
title: '关注时间',
|
||||
width: '20%',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.subscribe_time);
|
||||
}
|
||||
}, {
|
||||
field: 'country',
|
||||
title: '详细地址',
|
||||
width: '30%',
|
||||
unresize: 'false',
|
||||
templet:'#diqu'
|
||||
}, {
|
||||
field: 'subscribe_scene',
|
||||
title: '粉丝来源',
|
||||
width: '20%',
|
||||
unresize: 'false',
|
||||
templet:'#subscribe_scene'
|
||||
}]
|
||||
]
|
||||
});
|
||||
/**
|
||||
* 搜索功能
|
||||
*/
|
||||
form.on('submit(search)', function(data) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// 更新粉丝列表
|
||||
var repeat_flag = false;//防重复标识
|
||||
var page_index = 0;
|
||||
var page_count = 0;
|
||||
var progress_element;
|
||||
layui.use('element', function(){
|
||||
progress_element = layui.element;
|
||||
});
|
||||
|
||||
function refresh() {
|
||||
if(repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type : "post",
|
||||
url : "{:addon_url('wechat://shop/fans/syncWechatFans')}",
|
||||
data : {
|
||||
"page" : page_index,
|
||||
},
|
||||
dataType : "JSON",
|
||||
beforeSend : function() {
|
||||
$(".progress-layer").fadeIn();
|
||||
},
|
||||
success : function(data) {
|
||||
repeat_flag = false;
|
||||
if (data.code != 0 && data.message != undefined && data.message != '') {
|
||||
layer.msg(data.message);
|
||||
$(".progress-layer").fadeOut();
|
||||
} else if (data.code == 0) {
|
||||
if (page_index == 0) page_count = data['data']["page_count"];
|
||||
|
||||
page_index += 1;
|
||||
if (data.data == null) {
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
|
||||
if (page_index <= page_count) {
|
||||
var speed_of_progress = (page_index / page_count * 100).toFixed(2);
|
||||
progress_element.progress('progress', speed_of_progress + '%');
|
||||
}
|
||||
if (page_index <= page_count) {
|
||||
repeat_flag = false;
|
||||
refresh();
|
||||
} else {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
} else {
|
||||
layer.msg('更新失败');
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
layer.msg('更新失败');
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
80
addon/wechat/shop/view/material/add_text.html
Executable file
@@ -0,0 +1,80 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style type="text/css">
|
||||
.layui-tab-brief{width: 800px;height: 646px}
|
||||
.input-text-hint{float:right}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'></textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWechatMaterialList()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use('form', function () {
|
||||
var form = layui.form,repeat_flag = false;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
var value = JSON.stringify(data.field);
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/addTextMaterial'),
|
||||
data: {type: 5, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
//_self.material_id = res.data;
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
}
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backWechatMaterialList() {
|
||||
location.hash = ns.hash("wechat://shop/material/lists");
|
||||
}
|
||||
|
||||
</script>
|
||||
163
addon/wechat/shop/view/material/edit.html
Executable file
@@ -0,0 +1,163 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style type="text/css">
|
||||
.img-upload{margin-left: 0}
|
||||
.body-content{padding-top: 15px !important;}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<div class='graphic-message'>
|
||||
<img src='WECHAT_IMG/mobile_head.png'/>
|
||||
<ul class='graphic-message-list'>
|
||||
<template v-for="(value, index) in article_item_list">
|
||||
<li @click.stop="chooseGraphicMessage(index)" @mouseenter="moveThis(index)" @mouseleave="leaveThis(index)">
|
||||
<content>
|
||||
<template v-if="value.cover.path == ''">
|
||||
<div class='empty-img'></div>
|
||||
<span class='empty-hint'>{{index == 0 ? '封面图片' : '缩略图'}}</span>
|
||||
</template>
|
||||
<img v-else :src="value.cover.path"/>
|
||||
<div class='mask-layer'></div>
|
||||
<h4 class='title'><span>{{value.title == '' ? '标题' : value.title}}</span></h4>
|
||||
</content>
|
||||
<div class='action'>
|
||||
<template v-if="(index == 0 && index == current_msg_index) || (move_index == 0 && index == 0)">
|
||||
<span class='edit' @click.stop="chooseGraphicMessage(index)">编辑</span>
|
||||
</template>
|
||||
<template v-else-if="move_index == index || index == current_msg_index">
|
||||
<span class='edit' @click.stop="chooseGraphicMessage(index)">编辑</span>
|
||||
<span class='delete' @click.stop="deleteGraphicMessage(index)">删除</span>
|
||||
</template>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
<div class='add-graphic-message'>
|
||||
<h4>
|
||||
<a @click="addGraphicMessage()">新增</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div class='bottom-botton'>
|
||||
<template v-if="material_id == 0">
|
||||
<button class='layui-btn' @click="saveGraphicMessage()">保存</button>
|
||||
</template>
|
||||
<button class='layui-btn' v-else @click="editGraphicMessage()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='editor-box' :style="'margin-top:' + editBoxTopPosition + 'px'">
|
||||
<div class='arrow'></div>
|
||||
<div class='editor-title'>
|
||||
<label>标题<span class='hint'>(必填)</span></label>
|
||||
<input class="layui-input" id="input_title" placeholder="请在这里输入标题" maxlength="64" v-model="inputTitle" max-length="70"/>
|
||||
</div>
|
||||
<div class='editor-author'>
|
||||
<label>作者<span class='hint'>(选填)</span></label>
|
||||
<input class="layui-input" id="input_autor" placeholder="请输入作者" maxlength="16" v-model="inputAutor" max-length="20"/>
|
||||
</div>
|
||||
<div class='editor-cover'>
|
||||
<label>封面<span class='hint'>(图片建议尺寸:900 x 500像素 必填)</span></label>
|
||||
<!--<div class="choose-cover">-->
|
||||
<!--<div class="choose-cover-pic">-->
|
||||
<!--<img :src="coverImg"/>-->
|
||||
<!--</div>-->
|
||||
<!--<template v-if="coverImg == ''">-->
|
||||
<!--<a class="text-color" id="uploadImg" href="javascript:;">上传图片...</a>-->
|
||||
<!--</template>-->
|
||||
<!--<template v-else>-->
|
||||
<!--<a id="uploadImg" style="margin-top: 15px;" href="javascript:;">更换封面图...</a>-->
|
||||
<!--</template>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="layui-input-block img-upload">
|
||||
<div class="upload-img-block">
|
||||
<div class="upload-img-box hover" v-if="coverImg">
|
||||
<div class="upload-default" id="uploadImg" >
|
||||
<div id="preview_uploadImg" class="preview_img">
|
||||
<img layer-src :src="coverImg" class="img_prev" :data-img="coverImg"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="logo" id="logo" :value="coverImg"/>
|
||||
</div>
|
||||
<div class="upload-img-box" v-else>
|
||||
<div class="upload-default" id="uploadImg" >
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="logo" id="logo" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="editor-msg-label" :class="checkShowCoverPic ? 'selected' : ''" for="check_show_cover_pic">
|
||||
<input type="checkbox" id="check_show_cover_pic" value="1" v-model="checkShowCoverPic"/>
|
||||
封面图片显示在正文中
|
||||
</label>
|
||||
</div>
|
||||
<div class='editor-content'>
|
||||
<label>正文<span class='hint'>(必填)</span></label>
|
||||
<script id="editor" type="text/plain" style="width:380px; height:300px;"></script>
|
||||
</div>
|
||||
<div class='editor-url'>
|
||||
<label>原文链接<span class='hint'>(选填)</span></label>
|
||||
<input class="layui-input" id="original_url" placeholder="例:http://www.example.com" maxlength="100" v-model="inputOriginalUrl"/>
|
||||
</div>
|
||||
</div>
|
||||
<input type='hidden' id='edit_flag' value='{$flag}'/>
|
||||
<input type='hidden' id='material_id' value='{$material_id}'/>
|
||||
<div class="loading" :class="{ show: loading }"><i class=" layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i></div>
|
||||
</div>
|
||||
|
||||
<script src="STATIC_JS/vue.js"></script>
|
||||
<script src='WECHAT_JS/wx_graphic_message.js'></script>
|
||||
<script>
|
||||
var material_id = $("#material_id").val();
|
||||
if(material_id != 0){
|
||||
var timer_new = setInterval(function () {
|
||||
if($(".img_prev").attr('data-img') && $("#material_id").val()){
|
||||
loadImgMagnify();
|
||||
var logo_upload = new Upload({
|
||||
elem: '#uploadImg',
|
||||
callback:function (res) {
|
||||
if (res.code >= 0) {
|
||||
//成功之后将图片的路径存放再隐藏域中,便于提交使用
|
||||
// $("input[name='web_qrcode']").val(res.data.pic_path);
|
||||
vue_obj.coverImg = ns.img(res.data.pic_path);
|
||||
vue_obj.article_item_list[vue_obj.current_msg_index].cover.path = ns.img(res.data.pic_path);
|
||||
//将图片展示在页面上
|
||||
// $("#webQrcodeUpload").html("<img src=" + ns.img(res.data.pic_path) + " >");
|
||||
}
|
||||
}
|
||||
});
|
||||
clearInterval(timer_new);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- 百度编辑器 -->
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.config.js?time=20240614"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.all.js?time=20240614"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/lang/zh-cn/zh-cn.js"></script>
|
||||
82
addon/wechat/shop/view/material/edit_text.html
Executable file
@@ -0,0 +1,82 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style>
|
||||
.layui-tab-brief{width: 800px;height:646px}
|
||||
.input-text-hint{float:right}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'>{$material_data.value.content}</textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
<input type="hidden" name="media_id" id="media_id" value="{$material_data.id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWechatMaterialList()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use('form', function () {
|
||||
var form = layui.form;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/editTextMaterial'),
|
||||
data: {type: 5,content: data.field.content,media_id:data.field.media_id},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
} else {
|
||||
repeat_flag = false;
|
||||
}
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backWechatMaterialList() {
|
||||
location.hash = ns.hash("wechat://shop/material/lists");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
144
addon/wechat/shop/view/material/lists.html
Executable file
@@ -0,0 +1,144 @@
|
||||
<style>
|
||||
.news-material>ul{display: flex;flex-wrap: wrap}
|
||||
.news-material>ul>li{border: 1px solid rgb(233, 233, 233);position: relative;margin:14px 14px 0 0 ;width: calc((100% - 16px*5)/ 5);height: 315px;}
|
||||
.news-material .add-news{text-align: center;display: flex;position: relative;}
|
||||
.news-material .add-news .add-box{margin: auto}
|
||||
.news-material .add-news .iconfont{font-size: 100px; font-weight: 800;color: #606266;}
|
||||
.news-material .add-news:hover .add-li{display: block;}
|
||||
.news-material .add-li{display: none;width: 130px;height: 60px; box-shadow:0px 0px 5px rgb(231, 231, 231) ; background: #fff; position: absolute;left: 50%;top: 85%;transform: translate(-50%,-50%)}
|
||||
.news-material .add-li li{line-height: 30px;}
|
||||
.news-material .add-li li .iconfont{font-size: 16px;}
|
||||
.news-material .add-li li:hover{background: var(--base-color)}
|
||||
.news-material .add-li li:hover span{color: #fff;cursor: pointer;}
|
||||
.news-material .add-li li:hover i{color: #fff;}
|
||||
.material-content{padding: 20px}
|
||||
.news-material .meterail-img{height:200px;text-align: center;line-height: 200px;}
|
||||
.meterail-img img{max-width: 100%; max-height: 100%;}
|
||||
.meterail-title {height: 200px;padding: 20px 40px;box-sizing: border-box;text-align: center;display: flex; overflow: hidden}
|
||||
.meterail-title .title{margin: auto ;}
|
||||
.meterail-title-text{height: 235px !important;}
|
||||
.material-content .meterail-text {overflow: hidden;height: 35px;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2; overflow:hidden; -webkit-box-orient: vertical;}
|
||||
.material-content .meterail-time{margin-top: 20px ;color: #999}
|
||||
.del-edit{position: absolute;right: 10px;top: 10px;display: none;}
|
||||
.del{margin-right: 5px;}
|
||||
.del,.edit{display: inline-block;background: #fff;height: 30px; width: 30px;text-align: center;border-radius: 50%;line-height: 30px;box-shadow:0px 0px 5px rgb(231, 231, 231) ;}
|
||||
.news-material>ul>li:hover .del-edit{display: inline-block}
|
||||
.del:hover,.edit:hover {color: var(--base-color);cursor: pointer;}
|
||||
#MaterailList{display: flex;justify-content: flex-end;margin-right: 14px;}
|
||||
</style>
|
||||
|
||||
<div class="news-material">
|
||||
<ul id="newsMaterialContent"></ul>
|
||||
<div id="MaterailList"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//删除
|
||||
function delMaterial(id){
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/delete'),
|
||||
data: {
|
||||
id,
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
listenerHash(); // 刷新页面
|
||||
}
|
||||
});
|
||||
}
|
||||
function add_tuwen(){
|
||||
window.open(ns.href("wechat://shop/material/add"));
|
||||
}
|
||||
function add_text(){
|
||||
window.open(ns.href("wechat://shop/material/addtextmaterial"));
|
||||
}
|
||||
var data = '';
|
||||
function getMaterailList(page){
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/lists'),
|
||||
data: {
|
||||
page,
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
this.data = res.data.list;
|
||||
//列表渲染
|
||||
var str = ``;
|
||||
if(page == undefined || page == 1 || !page){
|
||||
str += `
|
||||
<li class="add-news">
|
||||
<div class="add-box">
|
||||
<i class="iconfont iconadd_light icon-hover"></i><br>
|
||||
<span>添加素材</span>
|
||||
<div class="add-li">
|
||||
<ul>
|
||||
<li onclick="add_tuwen()">
|
||||
<i class="iconfont icondoc_plaintext"></i> <span>添加图文</span>
|
||||
</li>
|
||||
<li onclick="add_text()">
|
||||
<i class="iconfont icontext"></i> <span>添加文字</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
`;
|
||||
|
||||
}
|
||||
$.each(this.data, function(index, item) {
|
||||
if(item.type == 1){
|
||||
str += `
|
||||
<li>
|
||||
<div class="del-edit">
|
||||
<a class="del" onclick="delMaterial(`+ item.id +`)" ><i class="iconfont iconshanchu"></i></a>
|
||||
<a href="`+ ns.href('wechat://shop/material/edit',{"id": item.id,'media_id':item.media_id,'type':item.type}) +`" target='_blank' class="edit"><i class="iconfont iconbianji-copy"></i></a>
|
||||
</div>
|
||||
<div class="meterail-img">
|
||||
<img src=" `+ item.value[0].cover.path +` " alt="">
|
||||
</div>
|
||||
<div class="material-content">
|
||||
<p class="meterail-text">`+ item.value[0].title +`</p>
|
||||
<p class="meterail-time">更新于<span>`+ ns.time_to_date(item.update_time) +`</span></p>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
}else{
|
||||
str += `
|
||||
<li>
|
||||
<div class="del-edit">
|
||||
<a class="del" onclick="delMaterial(`+ item.id +`)"><i class="iconfont iconshanchu"></i></a>
|
||||
<a href="`+ ns.href('wechat://shop/material/edittextmaterial',{"id": item.id,'media_id':item.media_id,'type':item.type}) +`" target='_blank' class="edit"><i class="iconfont iconbianji-copy"></i></a>
|
||||
</div>
|
||||
<div class="meterail-title meterail-title-text">
|
||||
<p class="title">`+ item.value.content +`</p>
|
||||
</div>
|
||||
<div class="material-content">
|
||||
<p class="meterail-time">更新于<span>`+ ns.time_to_date(item.update_time) +`</span></p>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
}
|
||||
|
||||
});
|
||||
$("#newsMaterialContent").html(str);
|
||||
//分页
|
||||
layui.use('laypage', function(){
|
||||
var laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'MaterailList' ,
|
||||
curr: page, //当前页
|
||||
count: res.data.count,
|
||||
layout: ['count', 'prev', 'page', 'next'],
|
||||
jump: function(obj, first){
|
||||
//首次不执行
|
||||
if(!first){
|
||||
getMaterailList(obj.curr);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
getMaterailList();
|
||||
</script>
|
||||
93
addon/wechat/shop/view/material/material.html
Executable file
@@ -0,0 +1,93 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_menu.css">
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
|
||||
<!-- 内容 -->
|
||||
{if $type == 1}
|
||||
<div class="layui-tab layui-tab-brief" id="marterial_graphic_message">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">图文消息</li>
|
||||
<!-- <li>高级图文</li> -->
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table id="marterial_graphic_message_list" lay-filter="marterial_graphic_message"></table>
|
||||
<!-- 标题 -->
|
||||
<script type="text/html" id="graphic_message_title">
|
||||
<div class="layui-row grid-demo">
|
||||
{{# for (var index in d.value) { }}
|
||||
<div class="layui-col-md12 layui-clear">
|
||||
<div class="layui-col-md3 article-img" style="float:left;">
|
||||
<span style="color: #fff;padding: 2px 4px;background: #1aad19;">图文</span>
|
||||
</div>
|
||||
<div class="layui-col-md3 title" style="float:left;">
|
||||
<a href="javascript:void(0);" onclick="preview({{d.id}}, {{index}})">{{d.value[index].title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# if (d.value.length == 1) { }}
|
||||
<div class='layui-col-md12 read-all layui-clear' onclick="preview({{d.id}})">
|
||||
<div class='layui-col-md4' style="float:left;">阅读全文</div>
|
||||
<div class='layui-col-md4 layui-col-md-offset4'> </div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default layui-btn-sm hover_cursor text-color" style="cursor:pointer;" lay-event="choose">选取</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else/}
|
||||
|
||||
<!-- 文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table id="material_text_list" lay-filter="material_text"></table>
|
||||
<!-- 内容 -->
|
||||
<script type="text/html" id="text_content">
|
||||
<div class="layui-row grid-demo">
|
||||
<div class="layui-col-md12 layui-clear">
|
||||
<div class="layui-col-md12 article-img" style="text-align: left;">
|
||||
<span style="color: #fff;padding: 2px 4px;">文本</span>
|
||||
</div>
|
||||
<div class="layui-col-md12 title line-hiding" style="float:left;">
|
||||
<a href="javascript:void(0);" onclick="previewText('{{d.value.content}}')" title="{{d.value.content}}">{{d.value.content}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default layui-btn-sm hover_cursor text-color" style="cursor:pointer;" lay-event="choose">选取</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript" src="WECHAT_JS/wx_material_mannager.js"></script>
|
||||
<script type="text/javascript">
|
||||
loadMaterialList({$type});
|
||||
</script>
|
||||
91
addon/wechat/shop/view/material/material_list.html
Executable file
@@ -0,0 +1,91 @@
|
||||
<link rel="stylesheet" href="ADDON_WECHAT_CSS/wx_material.css">
|
||||
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class='mg'>
|
||||
<button class="layui-btn" onclick="window.open(ns.href('wechat://shop/material/addgraphicmessage'))">新建图文</button>
|
||||
</div>
|
||||
<div>
|
||||
<table id="graphic_message_list" lay-filter="graphic_message"></table>
|
||||
</div>
|
||||
<!-- 标题 -->
|
||||
<script type="text/html" id="title">
|
||||
<div class="layui-row grid-demo">
|
||||
{{# for (var index in d.value) { }}
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-col-md3 article-img">
|
||||
<span class="bg-color">图文</span>
|
||||
</div>
|
||||
<div class="layui-col-md8 title">
|
||||
<a class="graphic-message-title" href="javascript:void(0);" onclick="preview({{d.id}}, {{index}})">{{d.value[index].title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{# } }}
|
||||
{{# if (d.value.length == 1) { }}
|
||||
<div class='layui-col-md12 read-all' onclick="preview({{d.id}})">
|
||||
<div class='layui-col-md4'>阅读全文</div>
|
||||
<div class='layui-col-md4 layui-col-md-offset4'> > </div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default" lay-event="edit">编辑</a>
|
||||
<a class="default" lay-event="delete">删除</a>
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<script src="ADDON_WECHAT_JS/wx_material.js"></script>
|
||||
<script>
|
||||
loadMaterialList(1);
|
||||
layui.use(['table','form'], function() {
|
||||
var table,
|
||||
form = layui.form;
|
||||
|
||||
table = new Table({
|
||||
elem: '#Fans_list',
|
||||
url: ns.url("wechat://shop/material/lists"),
|
||||
page: false,
|
||||
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
field: 'title',
|
||||
title: '标题',
|
||||
unresize: 'false'
|
||||
}, {
|
||||
field: 'create_time',
|
||||
title: '创建时间',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.create_time);
|
||||
}
|
||||
}, {
|
||||
field: 'update_time',
|
||||
title: '更新时间',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.update_time);
|
||||
}
|
||||
}, {
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
align: 'right',
|
||||
unresize: 'false'
|
||||
}
|
||||
]
|
||||
],
|
||||
bottomToolbar: "#batchOperation"
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
48
addon/wechat/shop/view/material/preview_material.html
Executable file
@@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="referrer" content="never">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"/>
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
|
||||
<title>{$info.value[$index]['title']}</title>
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="SITEHOME_CSS/home.css">
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_preview_graphic_message.css">
|
||||
<script src="__STATIC__/js/jquery-2.2.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class='preview-box'>
|
||||
<img class='head' src='WECHAT_IMG/mobile_head.png'/>
|
||||
<div class='graphic-message'>
|
||||
<h1 class='title'>{$info.value[$index]['title']}</h1>
|
||||
{if condition="$info.update_time eq 0"}
|
||||
<span class='time'>{$info['create_time']|time_to_date='Y-m-d'}</span>
|
||||
{else/}
|
||||
<span class='time'>{$info['update_time']|time_to_date='Y-m-d'}</span>
|
||||
{/if}
|
||||
<span class='author'>{$info.value[$index]['autor']}</span>
|
||||
<content>
|
||||
{if condition="$info.value[$index]['show_cover_pic'] == 1"}
|
||||
<div class="rich-media-thumb" id="media">
|
||||
<img onerror="this.parentNode.removeChild(this)" src="{$info.value[$index]['cover']['path']}">
|
||||
</div>
|
||||
{/if}
|
||||
{:html_entity_decode($info.value[$index]['content'])}
|
||||
</content>
|
||||
{if condition="!empty($info.value[$index]['url'])"}
|
||||
<a class='original-text' href="{$info.value[$index]['url']}">阅读原文</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$(function () {
|
||||
$("img").each(function () {
|
||||
$(this).replaceWith(this);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
32
addon/wechat/shop/view/material/preview_text.html
Executable file
@@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="referrer" content="never">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"/>
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="SITEHOME_CSS/home.css">
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_preview_graphic_message.css">
|
||||
<script src="__STATIC__/js/jquery-2.2.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class='preview-box'>
|
||||
<img class='head' src='WECHAT_IMG/mobile_head.png'/>
|
||||
<div class='graphic-message'>
|
||||
<content>
|
||||
{:html_entity_decode($info.value['content'])}
|
||||
</content>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$(function () {
|
||||
$("img").each(function () {
|
||||
$(this).replaceWith(this);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
266
addon/wechat/shop/view/menu/menu.html
Executable file
@@ -0,0 +1,266 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_menu.css">
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
|
||||
<div class='wx-menu' id='menu'>
|
||||
<div class='wx-menu-preview'>
|
||||
<div class='mobile-preview'>
|
||||
<div class='mobile-hd'>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class='mobile-bd'>
|
||||
<div class='wx-menu-list'>
|
||||
<template v-for="(item, index) in button">
|
||||
<div class="wx-menu-item-box" :class="['wx-menu-item-box-' + index]">
|
||||
<div class='wx-menu-item' :class="[index==menuIndex[0]&&-1==menuIndex[1] ? 'active' : '']" @click.stop='chooseMenu(index, -1)'>
|
||||
<template v-if="item.name == ''">
|
||||
<span>菜单名称</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{item.name}}</span>
|
||||
</template>
|
||||
</div>
|
||||
<template v-if="index==menuIndex[0]">
|
||||
<div class='wx-sub-menu-list' v-if="item" :class="[button.length != undefined && button.length == 2 ? 'two' : '', button.length != undefined && button.length == 3 ? 'three' : '']">
|
||||
<div class='wx-sub-menu-item' :data="[second_index]" :class="[second_index==menuIndex[1] ? 'active' : '', 'wx-sub-menu-item-' + second_index]" v-for="(item2, second_index) in item.sub_button" @click.stop='chooseMenu(index, second_index)'>
|
||||
<template v-if="item2.name == ''">
|
||||
<span>子菜单名称</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{item2.name}}</span>
|
||||
</template>
|
||||
</div>
|
||||
<template v-if="subMenuPlusShow">
|
||||
<div class='wx-sub-menu-item' @click.stop="addSubMenu(index)">+</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="button.length < 3">
|
||||
<div class='wx-menu-item-box add-menu' @click="addMenu()">+</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='wx-menu-form'>
|
||||
<div class='button-list-null' v-if='menuIndex[0] == -1'>点击左侧按钮 + 添加菜单</div>
|
||||
<template v-if="menuIndex[0] != -1">
|
||||
<div class='form-editor'>
|
||||
<div class='form-hd'>
|
||||
<div class='form-hd-name'>{{name}}</div>
|
||||
<div class='form-hd-del'><a href="javascript:void(0);" class='layui-btn layui-btn-primary layui-btn-xs' @click='deleteMenu()'>删除菜单</a></div>
|
||||
</div>
|
||||
<div class='form-bd'>
|
||||
<div class='form-bd-list'>
|
||||
<div class='form-bd-item'>
|
||||
<label class='layui-form-label sm'>菜单名称</label>
|
||||
<div class='item-group'>
|
||||
<template v-if="menuIndex[1] == -1">
|
||||
<input type='text' class='input layui-input' :class="error_hint == 'name' ? 'error' : ''" value='' @keyup="checkName($event)" v-model='name' placeholder="请输入菜单名称">
|
||||
<p class="tip" :class="error_hint == 'name' ? 'error' : ''">字数不超过4个汉字或8个字母</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<input type='text' class='input layui-input' :class="error_hint == 'name' ? 'error' : ''" value='' @keyup="checkName($event, 'sub_button')" v-model='name' placeholder="请输入子菜单名称">
|
||||
<p class='tip' :class="error_hint == 'name' ? 'error' : ''">字数不超过8个汉字或16个字母</p>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-bd-item' v-if="(menuIndex[0] > -1 && (button[menuIndex[0]] == undefined || button[menuIndex[0]].sub_button == undefined || button[menuIndex[0]].sub_button[0] == undefined)) || (menuIndex[1] > -1)">
|
||||
<label class='layui-form-label sm'>菜单内容</label>
|
||||
<div class='item-group menu-type'>
|
||||
<label class='radio-label'>
|
||||
<i class='layui-icon' :class="type == 'media' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type1' value='media' v-model='type'>
|
||||
<span>发送素材内容</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<i class='layui-icon' :class="type == 'view' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type2' value='view' v-model='type'>
|
||||
<span>跳转到网页</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<i class='layui-icon' :class="type == 'miniprogram' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type3' value='miniprogram' v-model='type'>
|
||||
<span>跳转小程序</span>
|
||||
</label>
|
||||
<label class='radio-label hide'>
|
||||
<i class='layui-icon' :class="type == 'custom_event' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type4' value='custom_event' v-model='type'>
|
||||
<span>自定义事件</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-bd-content'>
|
||||
<div class='menu-content' v-if='type == "media"'>
|
||||
<div class="layui-tab layui-tab-brief">
|
||||
<ul class="layui-tab-title wechat-media">
|
||||
<li :class="media_type == 'text' ? 'layui-this' : ''" @click="chooseMediaType(5)"><i class='layui-icon layui-icon-form'></i>文本消息</li>
|
||||
<li :class="media_type == 'graphic_message' ? 'layui-this' : ''" @click="chooseMediaType(1)"><i class='layui-icon layui-icon-tabs'></i>图文消息</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item" :class="media_type == 'text' ? 'layui-show' : ''">
|
||||
<template v-if="text == '' || text == undefined">
|
||||
<div class='material-library' @click="material(5)">
|
||||
<i></i>
|
||||
<span>从素材库选择</span>
|
||||
</div>
|
||||
<div class='add-material' @click="addMaterial(5)">
|
||||
<i></i>
|
||||
<span>添加文本素材</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class='text-message'>
|
||||
<div class='text-message-content'>
|
||||
<div class="material-type">
|
||||
<span>文本</span>
|
||||
</div>
|
||||
<div class="title">
|
||||
<a href="javascript:void(0);" @click="previewTexts(text)">{{text}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class='del' @click="deleteMaterial(5)">删除</span>
|
||||
</template>
|
||||
</div>
|
||||
<div class="layui-tab-item" :class="media_type == 'graphic_message' ? 'layui-show' : ''">
|
||||
<template v-if="graphic_message[0] == undefined">
|
||||
<div class='material-library' @click="material(1)">
|
||||
<i></i>
|
||||
<span>从素材库选择</span>
|
||||
</div>
|
||||
<div class='add-material' @click="addMaterial(1)">
|
||||
<i></i>
|
||||
<span>新建图文素材</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class='graphic-message-list'>
|
||||
<template v-for="(value, index) in graphic_message">
|
||||
<div class='graphic-message-content'>
|
||||
<div class="material-type">
|
||||
<span>图文</span>
|
||||
</div>
|
||||
<div class="title">
|
||||
<a href="javascript:void(0);" @click="preview(value.id, index)">{{value.title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="graphic_message.length == 1">
|
||||
<div class='read-all' @click="preview(value.id)">
|
||||
<div>阅读全文</div>
|
||||
<i> > </i>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
<span class='del' @click="deleteMaterial(1)">删除</span>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='menu-content view' v-if='type == "view"'>
|
||||
<p class='tip' style="margin: 10px 0 20px 0;padding-left: 5px;">订阅者点击该子菜单会跳转到一下链接</p>
|
||||
<div class='form-bd-item'>
|
||||
<label class='layui-form-label sm'>页面地址</label>
|
||||
<div class='layui-input-inline'>
|
||||
<input type='text' class="input layui-input" value='' v-model='url' placeholder='例:http://example.com'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='menu-content menu' v-if='type == "miniprogram"'>
|
||||
<p class='tip' style="margin: 10px 0 20px 0;padding-left: 5px;">订阅者点击该子菜单会跳到以下小程序</p>
|
||||
<div class='layui-form-item'>
|
||||
<label class='layui-form-label'>备用网页</label>
|
||||
<div class='layui-input-block'>
|
||||
<input type='text' id='miniprogram_url' class="layui-input" value='' v-model='url' placeholder='例:http://example.com'>
|
||||
<p class='layui-form-mid layui-word-aux'>旧版微信客户端无法支持小程序,用户点击菜单时将会打开备用网页。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class='layui-form-item'>
|
||||
<label class='layui-form-label'>小程序APPID</label>
|
||||
<div class='layui-input-block'>
|
||||
<input type='text' class="layui-input" value='' v-model='appid'>
|
||||
<p class='layui-form-mid layui-word-aux'>小程序需要绑定当前公众号。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class='layui-form-item'>
|
||||
<label class='layui-form-label'>小程序页面路径</label>
|
||||
<div class='layui-input-inline'>
|
||||
<input type='text' class="layui-input" value='' v-model='pagepath'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='menu-content' v-if='type == "event"'>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='click' v-model='eventType'>
|
||||
<span>点击事件</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='scancode_push' v-model='eventType'>
|
||||
<span>扫码推事件</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='scancode_waitmsg' v-model='eventType'>
|
||||
<span>扫码推事件带提示</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='pic_sysphoto' v-model='eventType'>
|
||||
<span>弹出系统拍照发图</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='pic_photo_or_album' v-model='eventType'>
|
||||
<span>弹出拍照或者相册发图</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='pic_wechat' v-model='eventType'>
|
||||
<span>弹出微信相册发图器</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='location_select' v-model='eventType'>
|
||||
<span>弹出地理位置选择器</span>
|
||||
</label>
|
||||
<div class='form-bd-item'>
|
||||
<label class='item-label'>菜单KEY值</label>
|
||||
<div class='item-group'>
|
||||
<input type='text' class='input' value='' v-model='key'>
|
||||
<p class='tip'>旧版微信客户端无法支持小程序,用户点击菜单时将会打开备用网页。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class='form-ft'>
|
||||
<button class='layui-btn' @click="saveMenu()">保存并发布</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text" style="display:none;">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'></textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="back()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="STATIC_JS/vue.js"></script>
|
||||
<script type="text/javascript" src="WECHAT_JS/wx_menu.js?v=1"></script>
|
||||
<script type="text/javascript" src="WECHAT_JS/wx_material_mannager.js"></script>
|
||||
211
addon/wechat/shop/view/message/config.html
Executable file
@@ -0,0 +1,211 @@
|
||||
<style>
|
||||
.card-common .layui-card-header{ padding-bottom: 10px; }
|
||||
</style>
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>注意:请将微信公众号服务类目选择为:商业服务——>软件/建站/技术开发,生活服务——>百货/超市/便利店,工具—>信息查询,所选行业不一致将会导致模板消息不可用。</li>
|
||||
<li>公众号可设置20个服务类目,每月只能修改5次,请谨慎选择。</li>
|
||||
<li>公众号最多支持25个模板消息,获取时请注意公众号剩余模板数量是否充足</li>
|
||||
<li>所需跳转到的小程序必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form">
|
||||
<div class="layui-card card-common card-brief top">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">是否需跳转到小程序</span>
|
||||
<input type="checkbox" name="" value="1" lay-skin="switch" lay-filter="is_jump_weapp" {if $config.is_jump_weapp == 1} checked {/if} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="template_list" lay-filter="template_list"></table>
|
||||
|
||||
<script type="text/html" id="batchOperation">
|
||||
<button class="layui-btn layui-btn-primary" lay-event="open">批量开启</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-event="close">批量关闭</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-event="getAll">批量获取</button>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
{{# if(d.wechat_is_open == 0){ }}
|
||||
<a class="layui-btn" lay-event="open">开启</a>
|
||||
{{# }else{ }}
|
||||
<a class="layui-btn" lay-event="close">关闭</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.wechat_template_id != undefined && d.wechat_template_id != ''){ }}
|
||||
<a class="layui-btn" lay-event="getTemplateNo">重新获取</a>
|
||||
{{# } }}
|
||||
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="message_type">
|
||||
{{ d.message_type == 1 ? '买家消息' : '卖家消息' }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="template_no">
|
||||
{{ d.wechat_template_id ? d.wechat_template_id : '' }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="wechat_is_open">
|
||||
{{ d.wechat_is_open == 1 ? '已启动' : '已关闭' }}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var form,table;
|
||||
layui.use(['form'], function() {
|
||||
form = layui.form;
|
||||
form.render();
|
||||
var repeat_flag = false;//防重复标识
|
||||
|
||||
form.on('switch(is_jump_weapp)', function (data) {
|
||||
data.value = data.elem.checked ? data.value : 0;
|
||||
|
||||
$.ajax({
|
||||
dataType: "JSON",
|
||||
type: "POST",
|
||||
data: {"is_jump_weapp": data.value},
|
||||
url: ns.url("wechat://shop/message/messageConfig"),
|
||||
success: function (res) {
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
table = new Table({
|
||||
elem: '#template_list',
|
||||
url: ns.url("wechat://shop/message/config"),
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
width: "3%",
|
||||
type: 'checkbox',
|
||||
unresize: 'false'
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
title: '类型',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'message_type',
|
||||
title: '消息类型',
|
||||
templet: '#message_type',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'wechat_is_open',
|
||||
title: '是否启用',
|
||||
templet: '#wechat_is_open',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'wechat_template_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
templet: '#template_no'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
align: 'right'
|
||||
}
|
||||
]
|
||||
],
|
||||
bottomToolbar: "#batchOperation"
|
||||
});
|
||||
|
||||
// 批量操作
|
||||
table.bottomToolbar(function (obj) {
|
||||
|
||||
if (obj.data.length < 1) {
|
||||
layer.msg('请选择要操作的数据');
|
||||
return;
|
||||
}
|
||||
|
||||
var keywords_array = new Array();
|
||||
for (i in obj.data) keywords_array.push(obj.data[i].keywords);
|
||||
switch (obj.event) {
|
||||
case 'open':
|
||||
// 开启
|
||||
setStatus(keywords_array.toString(), 1);
|
||||
break;
|
||||
case 'close':
|
||||
// 关闭
|
||||
setStatus(keywords_array.toString(), 0);
|
||||
break;
|
||||
case 'getAll':
|
||||
// 批量获取
|
||||
getTemplate(keywords_array.toString());
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听工具栏操作
|
||||
*/
|
||||
table.tool(function (obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case 'getTemplateNo': //获取模板id
|
||||
getTemplate(data.keywords);
|
||||
break;
|
||||
case 'open': //开启
|
||||
setStatus(data.keywords, 1);
|
||||
break;
|
||||
case 'close': //关闭
|
||||
setStatus(data.keywords, 0);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
function setStatus(keywords, status) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '{:addon_url("wechat://shop/message/setWechatStatus")}',
|
||||
data: {
|
||||
"wechat_is_open": status,
|
||||
'keywords': keywords
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
table.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getTemplate(keywords) {
|
||||
var loadLayer;
|
||||
layer.confirm('已存在的模板再次获取会导致模板重复存在,是否继续?', function (index) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '{:addon_url("wechat://shop/message/getWechatTemplateNo")}',
|
||||
data: {
|
||||
'keywords': keywords
|
||||
},
|
||||
dataType: "JSON",
|
||||
beforeSend: function () {
|
||||
loadLayer = layer.msg("模板获取中,请耐心等待,请勿进行其他操作!", {time: 1000 * 10000});
|
||||
},
|
||||
complete: function () {
|
||||
layer.close(loadLayer);
|
||||
},
|
||||
success: function (res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
layer.close(index);
|
||||
table.reload();
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
84
addon/wechat/shop/view/message/edit.html
Executable file
@@ -0,0 +1,84 @@
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否开启:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="wechat_is_open" value="1" {if $wechat_is_open == 1}checked{/if} lay-skin="switch">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模板名称:</label>
|
||||
<div class="layui-input-block">
|
||||
{$message_title}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模板消息ID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="template_id" value="{if $info}{$info.template_id_short}{/if}" placeholder="模板消息ID" autocomplete="off" class="layui-input len-long" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">类目模板:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="keyword_name_list" value="{if $info && isset($info.keyword_name_list)}{$info.keyword_name_list}{/if}" placeholder="类目模板,多个逗号隔开" autocomplete="off" class="layui-input len-long" readonly>
|
||||
</div>
|
||||
<div class="word-aux">类目模板的关键词,多个逗号隔开</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label"><span class="required"></span>模板内容:</label>
|
||||
<div class="layui-input-inline">
|
||||
<textarea placeholder="" class="layui-textarea len-long" readonly>{if $info}{$info.content}{/if}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="keywords" value="{$keywords}" />
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backMessageList()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'colorpicker'], function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
$.ajax({
|
||||
url: ns.url("wechat://shop/Message/edit"),
|
||||
data: data.field,
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('编辑成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续操作'],
|
||||
yes: function(index, layero){
|
||||
location.hash = ns.hash("shop/message/lists")
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function(index, layero) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backMessageList() {
|
||||
location.hash = ns.hash("shop/message/lists");
|
||||
}
|
||||
</script>
|
||||
9
addon/wechat/shop/view/public/css/wx_access_statistics.css
Executable file
@@ -0,0 +1,9 @@
|
||||
.access-statistics .access-api-list{display: flex;justify-content: space-between;padding: 0 15px;}
|
||||
.access-statistics .access-api-item{flex-grow: 1;text-align: center;margin-right: 10px;border: 1px solid #e5e5e5;padding-top: 25px;}
|
||||
.access-statistics .access-api-item:last-of-type{margin-right:0;}
|
||||
.access-statistics .access-api-itme-content{height: 80px; line-height: 80px; font-size: 30px;}
|
||||
.access-statistics .access-api-item-title{position: relative;}
|
||||
.access-statistics .access-api-item-title h3{display: inline-block;}
|
||||
.access-statistics .access-api-vice-content{font-size: 25px;}
|
||||
.layui-fluid .layui-tab-title{margin-top: 0;}
|
||||
.layui-tab-content-time{display: inline-block; height: 40px; margin-left: 15px; line-height: 40px;}
|
||||
101
addon/wechat/shop/view/public/css/wx_fans.css
Executable file
@@ -0,0 +1,101 @@
|
||||
.date-picker-btn.selected {
|
||||
background-color: var(--base-color);
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.search_form {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.search_form .reset {
|
||||
background: transparent;
|
||||
border: none;
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search_form .layui-form-mid {
|
||||
display: inline-block;
|
||||
float: unset;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.search_form .layui-btn+.layui-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.layui-table {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.layui-layer-content {
|
||||
padding: 15px;
|
||||
height: auto!important;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.headimg-box {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.headimg-box img{
|
||||
max-width: 50px;
|
||||
max-height: 50px;
|
||||
margin: auto;
|
||||
}
|
||||
.layui-table-cell{
|
||||
text-overflow: ellipsis;
|
||||
overflow: initial !important;
|
||||
white-space: initial;
|
||||
}
|
||||
.tag-list{
|
||||
display: inline-block;
|
||||
line-height: 40px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.tag-list span{
|
||||
margin: 2px;
|
||||
padding: 2px 5px;
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.progress-layer {
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
box-shadow: 1px 1px 50px rgba(0,0,0,.3);
|
||||
padding: 20px 20px;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.progress-layer h3{
|
||||
line-height: 1;
|
||||
margin-bottom: 15px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.progress-layer .layui-progress-big, .progress-layer .layui-progress-big .layui-progress-bar{
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.progress-layer .layui-progress-text{
|
||||
line-height: 14px;
|
||||
}
|
||||
742
addon/wechat/shop/view/public/css/wx_follow.css
Executable file
@@ -0,0 +1,742 @@
|
||||
.layui-layout-admin .layui-body .body-content{
|
||||
background: #f8f8f8;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title {
|
||||
background: #fff;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title li {
|
||||
line-height: 48px;
|
||||
margin: 0 15px;
|
||||
}
|
||||
|
||||
button, input, select, textarea {
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-moz-placeholder, textarea:-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a:-webkit-any-link {
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.reply-opts a:-webkit-any-link{
|
||||
color: var(--base-color);
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.reply-opts .delet-color:-webkit-any-link {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
padding: 0 22px;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.layui-body {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-title h2 {
|
||||
font-size: 26px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.type-menu {
|
||||
text-align: left;
|
||||
height: 50px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #E0E1E2;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.type-menu li {
|
||||
float: left;
|
||||
margin-right: 24px;
|
||||
line-height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.replay-info {
|
||||
padding: 15px 0 0;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.weixin-normal {
|
||||
position: relative;
|
||||
margin-top: 15px
|
||||
}
|
||||
|
||||
.replay-info .info {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-info h3 {
|
||||
display: inline-block;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.replay-info h3:last-child {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.replay-button {
|
||||
float: right;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.replay-button>div {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button:after {
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.replay-button>label {
|
||||
background-color: #1AAD19;
|
||||
border-color: #1AAD19;
|
||||
color: #FFFFFF;
|
||||
display: inline-block;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.replay-button .layui-layer-page {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.replay-button .layui-form>.layui-btn {
|
||||
display: block;
|
||||
margin: auto;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.replay-button label>input {
|
||||
position: absolute;
|
||||
left: -9999em;
|
||||
}
|
||||
|
||||
.replay-button .search {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: .5em;
|
||||
width: 243px;
|
||||
}
|
||||
|
||||
.replay-button .down {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button .down button {
|
||||
padding: 14px 12px 10px 12px;
|
||||
min-width: unset;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
color: #00A717;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.rule-group {
|
||||
position: relative;
|
||||
/* border: 1px solid #ccc; */
|
||||
margin-bottom: 20px;
|
||||
border-radius: 2px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta:hover h3 .rule-opts a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 {
|
||||
width: 300px;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
line-height: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -65px;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts a {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.rule-group .rule-body {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
margin: 0;
|
||||
/*padding-top: 5px;*/
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.rule-group .rule-body:before, .rule-group .rule-body:after {
|
||||
display: table;
|
||||
content: "";
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.rule-group .long-dashed {
|
||||
position: absolute;
|
||||
top: 80px;
|
||||
width: 100%;
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
}
|
||||
|
||||
.weixin-normal .rule-keywords {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
margin: 0 0 5px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .keyword-containe {
|
||||
padding-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.keyword-list .keyword {
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.keyword .close--circle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.keyword-list .keyword:hover .close--circle {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
font-size: 28px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.keyword .value {
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #555555;
|
||||
vertical-align: middle;
|
||||
border-radius: 4px 0 0 4px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.input-append .add-on, .input-prepend .add-on {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
height: 20px;
|
||||
min-width: 16px;
|
||||
padding: 4px 5px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
margin-left: -4px;
|
||||
border-radius: 0 4px 4px 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.rule-group hr.dashed {
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
border-top: none;
|
||||
margin: 0;
|
||||
background-color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.rule-group .opt {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.rule-group .opt a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.weixin-normal .rule-replies {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
margin: 0 0 5px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .reply-container, .keyword-container {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .info {
|
||||
padding: 5px 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol.reply-list {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.reply-list li, .quick-dropmenu li {
|
||||
position: relative;
|
||||
padding: 8px 90px 8px 5px;
|
||||
list-style: unset;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts a:hover {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.reply-cont {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.reply-summary {
|
||||
display: inline-block;
|
||||
max-width: 360px;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts, .quick-dropmenu .reply-opts {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.reply-list li::after, .quick-dropmenu li::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
bottom: 0;
|
||||
left: -20px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.reply-list li:last-child::after, .quick-dropmenu li:last-child::after {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.rule-group .opt .disable-opt {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.badge-success, .label-success {
|
||||
display: inline-block;
|
||||
padding: 2px 4px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
background: #1AAD19;
|
||||
}
|
||||
/***************************************/
|
||||
.misc {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.misc>a {
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
color: var(--base-color) !important
|
||||
}
|
||||
|
||||
.others {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.others>a {
|
||||
padding: 10px;
|
||||
color: var(--base-color) !important
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
color: #ccc;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: 25px;
|
||||
left: 10px;
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
font-size: 12px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.125);
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 10px 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.dropdown-menu li {
|
||||
padding: 0 10px;
|
||||
line-height: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.others:hover .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover {
|
||||
background: var(--base-color);
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.complex-backdrop {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 75px;
|
||||
left: 25px;
|
||||
width: 86%;
|
||||
height: 36.5%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.complex-content {
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.ng.ng-image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ng {
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
width: 250px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #eee;
|
||||
background-color: #fff;
|
||||
margin-bottom: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.picture>img {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.msg-music-thumb {
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.msg-music-thumb a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px dashed #F2F2F2;
|
||||
display: block;
|
||||
line-height: 100px;
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
#music .layui-textarea {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.voice-player {
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
border: 1px solid #85ac4c;
|
||||
display: inline-block;
|
||||
width: 90px;
|
||||
height: 25px;
|
||||
padding: 0 6px 0 7px;
|
||||
font-size: 12px !important;
|
||||
line-height: 25px;
|
||||
cursor: pointer;
|
||||
background: #a0ce3d;
|
||||
vertical-align: middle;
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.voice-player::before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -13px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #85ac4c;
|
||||
}
|
||||
|
||||
.voice-player .stop {
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px 1px #8ab433;
|
||||
}
|
||||
|
||||
.popover .close--circle {
|
||||
z-index: initial;
|
||||
}
|
||||
|
||||
.complex-content .close--circle ,.keyword-list .close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: rgba(153, 153, 153, 0.6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.voice-player .second {
|
||||
display: none;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
color: #476600;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.voice-player .play {
|
||||
display: inline-block;
|
||||
width: 17px;
|
||||
height: 20px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.voice-player::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -12px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #a0ce3d;
|
||||
}
|
||||
/*其他*/
|
||||
.ng .close--circle {
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
}
|
||||
|
||||
.ng .ng-item {
|
||||
border-bottom: 1px solid #eee;
|
||||
overflow: hidden;
|
||||
padding: 5px 9px;
|
||||
}
|
||||
|
||||
.ng .label {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*图文*/
|
||||
.ng .ng-title {
|
||||
display: inline-block !important;
|
||||
overflow: hidden !important;
|
||||
white-space: nowrap !important;
|
||||
text-overflow: ellipsis !important;
|
||||
line-height: 16px;
|
||||
min-height: 16px;
|
||||
vertical-align: middle;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
a.new-window {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more a {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/*************************************/
|
||||
.rule-container {
|
||||
/*position: absolute;*/
|
||||
/*padding: 5px 10px;*/
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
/*box-shadow: 0px 1px 6px 7px rgba(0, 0, 0, 0.1);*/
|
||||
/*border: 1px solid #e5e5e5; */
|
||||
/*height: 230px;*/
|
||||
/*width: 460px;*/
|
||||
}
|
||||
|
||||
.rule-container .add_reply-top{
|
||||
position: absolute;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
line-height: 0px;/*为了防止ie下出现题型*/
|
||||
border-bottom: 10px solid #fff;
|
||||
border-left: 10px solid rgba(0,0,0,0);
|
||||
border-right: 10px solid rgba(0,0,0,0);
|
||||
right: 55px;
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
.popover>.close--circle {
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: 50%;
|
||||
left: -13px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow i {
|
||||
color: #e5e5e5;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.layui-card-body, .layui-card-header, .layui-form-label, .layui-form-mid,
|
||||
.layui-form-select, .layui-input-block, .layui-input-inline,
|
||||
.layui-textarea {
|
||||
position: unset;
|
||||
}
|
||||
|
||||
.rule-group-container {
|
||||
min-height: 165px
|
||||
}
|
||||
|
||||
.layui-layer-btn .layui-layer-btn1:hover{
|
||||
color: #333 !important;
|
||||
}
|
||||
.layui-layer-btn a:hover{
|
||||
color: #fff !important;
|
||||
}
|
||||
338
addon/wechat/shop/view/public/css/wx_graphic_message.css
Executable file
@@ -0,0 +1,338 @@
|
||||
#graphic_message {
|
||||
/*width: 760px;*/
|
||||
margin-bottom: 90px;
|
||||
padding: 20px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.layui-elem-quote{
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message {
|
||||
position: relative;
|
||||
width: 320px;
|
||||
min-height: 310px;
|
||||
float: left;
|
||||
border: 1px solid #C5C5C5;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box {
|
||||
position: relative;
|
||||
margin-top: 80px;
|
||||
width: 380px;
|
||||
min-height: 400px;
|
||||
float: left;
|
||||
padding: 15px;
|
||||
margin-left: 20px;
|
||||
border: 1px solid #d1d1d1;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#graphic_message .arrow, #graphic_message .arrow::after {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 7px 7px 6px 0;
|
||||
border-color: transparent #d1d1d1 transparent transparent;
|
||||
position: absolute;
|
||||
left: -7px;
|
||||
top: 19px;
|
||||
}
|
||||
|
||||
#graphic_message .arrow::after {
|
||||
content: "";
|
||||
border-right-color: #f8f8f8;
|
||||
left: 1px;
|
||||
top: -7px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li {
|
||||
border: 1px solid #AAA;
|
||||
border-top-color: #FFF;
|
||||
border-bottom-color: #DDD;
|
||||
background: #FFF;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child {
|
||||
border-top-color: #AAA;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:last-child {
|
||||
border-bottom-color: #AAA;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content {
|
||||
display: block;
|
||||
margin: 10px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content {
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li .title {
|
||||
padding-right: 70px;
|
||||
max-height: 48px;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child .title {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
color: #FFF;
|
||||
z-index: 2;
|
||||
line-height: 30px;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
max-height: unset;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child .title span {
|
||||
padding: 2px 7px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li .title span {
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li .action {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#graphic_message .action span.edit, #graphic_message .action span.delete {
|
||||
background: rgba(0, 0, 0, .4);
|
||||
color: #FFF;
|
||||
font-size: 14px;
|
||||
padding: 0 5px;
|
||||
display: inline-block;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content img {
|
||||
max-width: 100%;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
float: right;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: #EEE;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content .empty-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
float: right;
|
||||
background: #EEE;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content img {
|
||||
width: 268px;
|
||||
height: auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content .empty-img {
|
||||
width: 268px;
|
||||
height: auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content .empty-hint {
|
||||
height: 20px;
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -5px;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
color: #AAA;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content .empty-hint {
|
||||
height: 20px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 7px;
|
||||
margin: auto;
|
||||
color: #AAA;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#editor {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4::before {
|
||||
top: -19px;
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
border: 8px solid transparent;
|
||||
border-bottom-width: 10px;
|
||||
border-bottom-color: #ddd;
|
||||
left: 148px;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4::after {
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
border: 8px solid transparent;
|
||||
border-bottom-width: 10px;
|
||||
border-bottom-color: #f8f8f8;
|
||||
top: -16px;
|
||||
left: 148px;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4 {
|
||||
position: relative;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-top: 1px solid #ddd;
|
||||
-webkit-box-shadow: 0 0 0 1px #ddd;
|
||||
box-shadow: 0 0 0 1px #ddd;
|
||||
padding: 0 6px 4px 10px;
|
||||
width: 304px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4 a {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#graphic_message .layui-input {
|
||||
width: 270px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box label {
|
||||
display: inline-block;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box label .hint {
|
||||
color: #AAA;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover,
|
||||
#graphic_message .editor-box .editor-author,
|
||||
#graphic_message .editor-box .editor-title,
|
||||
#graphic_message .editor-box .editor-content {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover .editor-msg-label {
|
||||
position: relative;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover #check_show_cover_pic {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 1px;
|
||||
height: 13px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover .choose-cover {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover .choose-cover a {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#edui1_bottombar.edui-editor-bottomContainer.edui-default {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bottom-botton {
|
||||
position: absolute;
|
||||
padding: 20px 0;
|
||||
width: auto;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -80px;
|
||||
text-align: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.loading {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
padding-top: 20%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.loading .layui-icon {
|
||||
font-size: 39px;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block !important;
|
||||
}
|
||||
.choose-cover-pic{
|
||||
margin-bottom: 10px;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
text-align: center;
|
||||
line-height: 160px;
|
||||
}
|
||||
.choose-cover-pic img{
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
106
addon/wechat/shop/view/public/css/wx_leavemsg.css
Executable file
@@ -0,0 +1,106 @@
|
||||
.user_info{
|
||||
position: relative;
|
||||
/* margin-left: 80px;
|
||||
margin-right: 215px; */
|
||||
}
|
||||
.message_info{
|
||||
margin-left:80px;
|
||||
margin-right:80px;
|
||||
width:auto;
|
||||
}
|
||||
.user_info .avatar{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left:16px;
|
||||
}
|
||||
.user_info img{
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
|
||||
}
|
||||
|
||||
.layui-table .layui-table-cell{
|
||||
padding:1px;
|
||||
}
|
||||
.layui-table thead tr{
|
||||
display:none;
|
||||
}
|
||||
.message_content{
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
color: #8d8d8d;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
white-space:normal;
|
||||
}
|
||||
.layui-icon-reply-fill:hover{
|
||||
color:#393D49 !important;
|
||||
}
|
||||
.headimg{
|
||||
width:80px;
|
||||
}
|
||||
.message_list{
|
||||
font-size:14px;
|
||||
min-height: 46px;
|
||||
/* border: 1px solid #e7e7eb;
|
||||
padding: 15px;*/
|
||||
}
|
||||
.message_time{
|
||||
margin-top: 0;
|
||||
color: #8d8d8d;
|
||||
}
|
||||
.layui-table tbody tr:hover,.layui-table-click{
|
||||
background-color:#FFF;
|
||||
}
|
||||
.layui-table tbody tr{
|
||||
border:none;
|
||||
}
|
||||
.reply-box{
|
||||
display:none;
|
||||
border-top:1px solid #e7e7eb;
|
||||
padding-top:15px;
|
||||
padding-left:80px;
|
||||
padding-right:80px;
|
||||
}
|
||||
.layui-table-header{
|
||||
border:none;
|
||||
}
|
||||
.reply-button{
|
||||
padding-top:15px;
|
||||
}
|
||||
.reply-button button{
|
||||
min-width:100px;
|
||||
}
|
||||
.userinfo-box-headimg{
|
||||
float: left;
|
||||
width: 230px;
|
||||
height: 230px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.userinfo-box-user-info{
|
||||
overflow: hidden;
|
||||
height: 230px;
|
||||
position: relative;
|
||||
}
|
||||
.userinfo-box-user-info-title{
|
||||
width:20px;
|
||||
margin-right:10px;
|
||||
color: #8d8d8d;
|
||||
}
|
||||
.userinfo-box-user-info-content{
|
||||
font-weight:normal;
|
||||
}
|
||||
.layui-layer-tips{
|
||||
width:auto !important;
|
||||
}
|
||||
.userinfo-box-user-info .layui-card-body{
|
||||
color: #333;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
.userinfo-box-user-info-header-title{
|
||||
margin-right:200px;
|
||||
}
|
||||
.layui-tab-title{
|
||||
margin-bottom:15px;
|
||||
}
|
||||
280
addon/wechat/shop/view/public/css/wx_material.css
Executable file
@@ -0,0 +1,280 @@
|
||||
.right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.layui-table-page {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
line-height: 28px;
|
||||
min-height: 28px;
|
||||
}
|
||||
|
||||
/* ----------------------------------GRAPHIC_MESSAGE_LIST----------------------------- */
|
||||
#graphic_message_list + div .layui-table-box .layui-table td {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-row.grid-demo {
|
||||
border: 1px solid #DEDEDE;
|
||||
border-radius: 5px;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.article-img span {
|
||||
padding: 2px 4px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12 {
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12.read-all {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:first-child {
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3 {
|
||||
padding-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title {
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title a {
|
||||
color: #0d73f9;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4 {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4.layui-col-md-offset4 {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
a.graphic-message-title {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* ----------------------------------MATERIAL_GRAPHIC_MESSAGE_LIST----------------------------- */
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-row.grid-demo {
|
||||
border: 1px solid #DEDEDE;
|
||||
border-radius: 5px;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.article-img span {
|
||||
background: green;
|
||||
color: #FFF;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12 {
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12.read-all {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:first-child {
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3 {
|
||||
padding-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title {
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title a {
|
||||
color: #0d73f9;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4 {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4.layui-col-md-offset4 {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
/* ----------------------------------material_text----------------------------- */
|
||||
#material_text div .layui-table-box .layui-table td {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-row.grid-demo {
|
||||
border: 1px solid #DEDEDE;
|
||||
border-radius: 5px;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.article-img span {
|
||||
background: green;
|
||||
color: #FFF;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12 {
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12.read-all {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:first-child {
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3 {
|
||||
padding-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title {
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title a {
|
||||
color: #0d73f9;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4 {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4.layui-col-md-offset4 {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
/* --------------------------------ADD_MATERIAL_TEXT -------------------------------------- */
|
||||
#add_material_text form.layui-form {
|
||||
padding: 15px;
|
||||
padding-right: 50px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#add_material_text .input-text-hint {
|
||||
float: right;
|
||||
color: #AAA;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* -------------------------------- MATERIAL_IMAGE -----------------------------------------*/
|
||||
#material_image .img-list {
|
||||
padding-top: 26px;
|
||||
text-align: center;
|
||||
margin-bottom: 80px;
|
||||
}
|
||||
|
||||
#material_image .img-list::after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#material_image .img-list .layui-col-md2 .img {
|
||||
display: inline-block;
|
||||
background: #ccc;
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
text-align: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover !important;
|
||||
background-position: 50% !important;
|
||||
}
|
||||
|
||||
#material_image .buttom-button {
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
left: 50%;
|
||||
margin-left: -66px;
|
||||
}
|
||||
|
||||
#material_image .img-list p.layui-elip {
|
||||
max-width: 110px;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
|
||||
#material_image .img-list .img-check-mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 11px;
|
||||
right: 11px;
|
||||
bottom: 26px;
|
||||
line-height: 120px;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
}
|
||||
|
||||
#material_image .img-list .img-check-mask[data-show='false'] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#material_image .img-list .layui-icon-ok {
|
||||
color: #FFF;
|
||||
font-size: 36px;
|
||||
}
|
||||
.article-img .bg-color {
|
||||
color: #fff;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
442
addon/wechat/shop/view/public/css/wx_menu.css
Executable file
@@ -0,0 +1,442 @@
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.wx-menu {
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.wx-menu-preview {
|
||||
width: 320px;
|
||||
height: 570px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.mobile-preview {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
border: 1px solid #e7e7eb;
|
||||
}
|
||||
|
||||
.mobile-hd {
|
||||
height: 25px;
|
||||
padding-top: 35px;
|
||||
color: #FFF;
|
||||
background: #000;
|
||||
font-size: 16px;
|
||||
background-image: url(../img/mobile_head.png);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mobile-bd {
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-top: 1px solid #e7e7eb;
|
||||
background: transparent url(../img/mobile_foot_default.png) no-repeat 0 0;
|
||||
}
|
||||
|
||||
.wx-menu-list {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
padding-left: 43px;
|
||||
}
|
||||
|
||||
.wx-menu-item-box {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
color: #616161;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wx-menu-item-box.add-menu {
|
||||
border-left: 1px solid #e7e7eb;
|
||||
}
|
||||
|
||||
.wx-menu-item {
|
||||
border-left: 1px solid #e7e7eb;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wx-menu-item.active, .wx-sub-menu-item.active {
|
||||
border: 1px solid;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list {
|
||||
position: absolute;
|
||||
bottom: 62px;
|
||||
width: 136px;
|
||||
border: 1px solid #d0d0d0;
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list.two, .wx-sub-menu-list.three {
|
||||
width: 90.328px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list.active-second {
|
||||
left: 134.328px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list.active-third {
|
||||
left: 226.328px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-item {
|
||||
border-top: 1px solid #d0d0d0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wx-menu-item, .wx-sub-menu-item {
|
||||
line-height: 50px;
|
||||
background-color: #fafafa;
|
||||
text-align: center;
|
||||
color: #616161;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list .wx-sub-menu-item {
|
||||
height: 50px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.wx-menu-form {
|
||||
width: auto;
|
||||
margin-left: 340px;
|
||||
min-height: 570px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form-editor {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
background-color: #f4f5f9;
|
||||
border: 1px solid #e7e7eb;
|
||||
min-width: 560px;
|
||||
}
|
||||
|
||||
.form-editor .form-hd {
|
||||
padding: 10px 20px;
|
||||
border-bottom: 1px solid #e7e7eb;
|
||||
line-height: 31px;
|
||||
}
|
||||
|
||||
.form-hd-name {
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-hd-del {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.form-editor .form-bd {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.item-label {
|
||||
width: 5em;
|
||||
float: left;
|
||||
margin-top: .3em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.item-group {
|
||||
display: table-cell;
|
||||
vertical-align: top;
|
||||
float: none;
|
||||
width: auto;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.button-list-null {
|
||||
position: absolute;
|
||||
top: 37%;
|
||||
left: 30%;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #AAA;
|
||||
padding: 2px 2px 2px 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tip.error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
input.error {
|
||||
border-color: red !important;
|
||||
}
|
||||
|
||||
.form-bd-content {
|
||||
background-color: #fff;
|
||||
padding: 0 15px 15px;
|
||||
min-height: 290px;
|
||||
margin: 15px 0 0;
|
||||
border-radius: 7px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.item-group.menu-type {
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
.form-bd-item:first-child {
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.form-bd-item {
|
||||
min-height: 35px;
|
||||
line-height: 35px;
|
||||
padding-bottom: 15px
|
||||
}
|
||||
|
||||
.input.layui-input {
|
||||
display: inline-block !important;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.wechat-media i.layui-icon {
|
||||
color: #AAA;
|
||||
font-size: 16px;
|
||||
padding: 0 7px;
|
||||
}
|
||||
|
||||
.wechat-media .layui-this i.layui-icon {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.radio-label input {
|
||||
position: absolute;
|
||||
left: -500vw;
|
||||
top: -500vw;
|
||||
}
|
||||
|
||||
.radio-label i.layui-icon {
|
||||
color: #AAA;
|
||||
}
|
||||
|
||||
.radio-label {
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.form-ft {
|
||||
padding-top: 20px;
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.form-bd-list {
|
||||
background: #FFF;
|
||||
border-radius: 7px;
|
||||
padding-left: 22px;
|
||||
padding-top: 7px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
|
||||
.material-library, .add-material {
|
||||
display: inline-block;
|
||||
width: 40%;
|
||||
margin-top: 15px;
|
||||
text-align: center;
|
||||
padding: 50px 0;
|
||||
border: 1px dotted #CCC;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.material-library object, .add-material object {
|
||||
width: 36px;
|
||||
}
|
||||
|
||||
.material-library {
|
||||
float: left;
|
||||
margin-left: 5%;
|
||||
}
|
||||
|
||||
.material-library i, .add-material i {
|
||||
background-size: 100% 100%;
|
||||
background-color: #FFF;
|
||||
display: block;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin: auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.material-library i {
|
||||
background-image: url(../img/folder.png);
|
||||
}
|
||||
|
||||
.add-material i {
|
||||
background-image: url(../img/add.png);
|
||||
}
|
||||
|
||||
.add-material {
|
||||
float: right;
|
||||
margin-right: 5%;
|
||||
}
|
||||
|
||||
.material-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.material-img img {
|
||||
max-width: 70%;
|
||||
max-height: 180px;
|
||||
}
|
||||
|
||||
.del {
|
||||
display: inline-block;
|
||||
vertical-align: bottom;
|
||||
color: var(--base-color);
|
||||
text-decoration: solid;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menu-content .layui-textarea {
|
||||
height: 170px;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.material-type {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.material-type span {
|
||||
background: green;
|
||||
color: #FFF;
|
||||
padding: 2px 4px;
|
||||
display: inline-block;
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.graphic-message-list {
|
||||
width: 400px;
|
||||
border: 1px solid #CCC;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content {
|
||||
border-bottom: 1px solid #DDD;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content .title {
|
||||
display: inline-block;
|
||||
width: 75%;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content .title a {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all {
|
||||
padding: 5px 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all::after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all div {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all i {
|
||||
float: right;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.text-message {
|
||||
width: 400px;
|
||||
border: 1px solid #CCC;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.text-message .text-message-content {
|
||||
border-bottom: 1px solid #DDD;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.text-message .text-message-content .title {
|
||||
width: 380px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
vertical-align: middle;
|
||||
border-top: 1px solid #CCC;
|
||||
margin-top: 10px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.text-message .text-message-content .title a {
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 4;
|
||||
-webkit-box-orient: vertical;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.text-message .text-message-content .material-type {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.wx-menu-item, .wx-menu-item span, .wx-sub-menu-item, .wx-sub-menu-item span {
|
||||
moz-user-select: -moz-none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.article-img .bg-color {
|
||||
color: #fff;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
.text-r{
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
border-color: #ccc;
|
||||
resize:none
|
||||
}
|
||||
77
addon/wechat/shop/view/public/css/wx_preview_graphic_message.css
Executable file
@@ -0,0 +1,77 @@
|
||||
.preview-box {
|
||||
max-width: 600px;
|
||||
height: 779px;
|
||||
background: #FFF;
|
||||
margin: 0 auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.rich-media-thumb img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-track {
|
||||
background-color: #EEE;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-thumb {
|
||||
background-color: #CCC;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #AAA
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-thumb:active {
|
||||
background-color: #AAA
|
||||
}
|
||||
|
||||
.preview-box > img.head {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message {
|
||||
position: relative;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
padding-bottom: 150px;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message > span.time, .preview-box > .graphic-message > span.author {
|
||||
display: inline-block;
|
||||
color: #AAA;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message > content {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message > .graphic-message-content {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message a.original-text {
|
||||
position: absolute;
|
||||
bottom: 50px;
|
||||
left: 0px;
|
||||
color: #607fa6;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
119
addon/wechat/shop/view/public/css/wx_qrcode.css
Executable file
@@ -0,0 +1,119 @@
|
||||
.qrcode-body {
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#albumList {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.input-file {
|
||||
position: absolute;
|
||||
top: -10px !important;
|
||||
right: 9px !important;
|
||||
height: 26px !important;
|
||||
width: 94px !important;
|
||||
filter: alpha(opacity:0) !important;
|
||||
opacity: 0 !important;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.qrcode_button {
|
||||
background-color: #51a351;
|
||||
border: none;
|
||||
margin-top: 15px;
|
||||
width: 100%;
|
||||
color: #FFF;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.check {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
right: -1px;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
display: none;
|
||||
}
|
||||
|
||||
.check div {
|
||||
width: 60%;
|
||||
height: 30px;
|
||||
margin-left: 20%;
|
||||
border: 1px solid #fff;
|
||||
margin-top: 10%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.check div:hover {
|
||||
background: var(--base-color);
|
||||
border: 1px solid var(--base-color);
|
||||
}
|
||||
|
||||
.check div span {
|
||||
font-size: 15px;
|
||||
color: #fff;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.options-btn {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
#albumList li {
|
||||
opacity: 1;
|
||||
height: auto;
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-right: 1%;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
line-height: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.img-block {
|
||||
width: 100%;
|
||||
}
|
||||
.qrcode {
|
||||
width: 320px;
|
||||
height: 569px;
|
||||
background: #f5f5f5;
|
||||
position: relative;
|
||||
}
|
||||
.qrcode #imgLogo {
|
||||
max-width: 320px;
|
||||
max-height: 569px;
|
||||
}
|
||||
.tdrag-header {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
position: absolute;
|
||||
left: 59px; top: 15px;
|
||||
cursor: move;
|
||||
}
|
||||
.tdrag-logo {
|
||||
width: 43px;
|
||||
position: absolute;
|
||||
left: 60px;
|
||||
top: 210px;
|
||||
cursor: move;
|
||||
}
|
||||
.tdrag-code{
|
||||
width: 144px;
|
||||
height: 144px;
|
||||
position: absolute;
|
||||
left: 70px;
|
||||
top: 300px;
|
||||
cursor: move;
|
||||
}
|
||||
.tdrag-name{
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
position: absolute;
|
||||
left: 128px;
|
||||
top: 23px;
|
||||
cursor: move;
|
||||
}
|
||||
811
addon/wechat/shop/view/public/css/wx_replay.css
Executable file
@@ -0,0 +1,811 @@
|
||||
button, input, select, textarea {
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-moz-placeholder, textarea:-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.empty{width: 100%;margin-top: 15px;text-align: center;padding: 75px 0;}
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
a:-webkit-any-link {
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.reply-opts a:-webkit-any-link {
|
||||
color: var(--base-color);
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.reply-opts .delet-color:-webkit-any-link {
|
||||
color: #ff3d3d;
|
||||
}
|
||||
.rule-group .rule-meta h3 .rule-opts .delet-color {
|
||||
color: #ff3d3d;
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
padding: 0 22px;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.layui-body {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-title h2 {
|
||||
font-size: 26px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.type-menu {
|
||||
text-align: left;
|
||||
height: 50px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #E0E1E2;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.type-menu li {
|
||||
float: left;
|
||||
margin-right: 24px;
|
||||
line-height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.replay-info {
|
||||
padding: 15px 0 0;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.weixin-normal {
|
||||
margin-top: 15px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.replay-info .info {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-info h3 {
|
||||
display: inline-block;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.replay-info h3:last-child {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.replay-button {
|
||||
float: right;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.replay-button > div {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button:after {
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.replay-button > label {
|
||||
background-color: #1AAD19;
|
||||
border-color: #1AAD19;
|
||||
color: #FFFFFF;
|
||||
display: inline-block;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.replay-button .layui-layer-page {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.replay-button .layui-form > .layui-btn {
|
||||
display: block;
|
||||
margin: auto;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.replay-button label > input {
|
||||
position: absolute;
|
||||
left: -9999em;
|
||||
}
|
||||
|
||||
.replay-button .search {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: .5em;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.replay-button .down {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button .down button {
|
||||
padding: 14px 12px 10px 12px;
|
||||
min-width: unset;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
color: #00A717;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.rule-group {
|
||||
border: 1px solid #e5e5e5;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 2px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.rule-group:hover {
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts a:hover {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
line-height: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0px;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.rule-group .rule-body {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
/* margin: 0 0 10px;
|
||||
padding-top: 5px; */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.rule-group .rule-body:before, .rule-group .rule-body:after {
|
||||
display: table;
|
||||
content: "";
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
/* .rule-group .long-dashed {
|
||||
position: absolute;
|
||||
top: 80px;
|
||||
width: 100%;
|
||||
border-bottom: 1px dashed #e5e5e5;
|
||||
} */
|
||||
|
||||
.weixin-normal .rule-keywords {
|
||||
float: left;
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.rule-group .keyword-containe {
|
||||
padding-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.rule-group .keyword-list, .reply-list {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.keyword-list .keyword {
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.keyword .close--circle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.keyword-list .keyword:hover .close--circle {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.complex-content .close--circle ,.keyword-list .close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: rgba(153, 153, 153, 0.6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.keyword .value {
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
padding: 2px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #333;
|
||||
vertical-align: middle;
|
||||
border-radius: 2px 0 0 2px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.input-append .add-on, .input-prepend .add-on {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
height: 20px;
|
||||
min-width: 16px;
|
||||
padding: 2px 7px;
|
||||
font-size: 10px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #ccc;
|
||||
margin-left: -4px;
|
||||
border-radius: 0 2px 2px 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* .rule-group hr.dashed {
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
border-top: none;
|
||||
margin: 0;
|
||||
background-color: rgb(255, 255, 255);
|
||||
|
||||
} */
|
||||
.layui-textarea {
|
||||
resize:none
|
||||
}
|
||||
.rule-group .opt {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.rule-group .opt a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
.inner-keywordbox a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.weixin-normal .rule-replies {
|
||||
position: static;
|
||||
float: left;
|
||||
border-left: 1px solid #f7f7f7;
|
||||
padding-top: 10px;
|
||||
min-height: 115px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner .inner-keywordbox {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 15px;
|
||||
background: #f7f7f7;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.rule-group .reply-container, .keyword-container {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .info {
|
||||
padding: 5px 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol.reply-list {
|
||||
list-style-type: decimal !important;
|
||||
}
|
||||
|
||||
.reply-list li, .quick-dropmenu li {
|
||||
position: relative;
|
||||
padding: 8px 90px 8px 5px;
|
||||
margin-left: 20px;
|
||||
list-style: unset;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts a:hover {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.reply-cont {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.reply-summary {
|
||||
display: inline-block;
|
||||
max-width: 360px;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts, .quick-dropmenu .reply-opts {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.reply-list li::after, .quick-dropmenu li::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
bottom: 0;
|
||||
left: -20px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.reply-list li:last-child::after, .quick-dropmenu li:last-child::after {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.rule-group .opt .disable-opt {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.badge-success, .label-success {
|
||||
display: inline-block;
|
||||
padding: 2px 4px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
background-color: #1AAD19;
|
||||
}
|
||||
|
||||
/***************************************/
|
||||
.misc {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.misc > a {
|
||||
display: inline-block;
|
||||
padding: 7px 10px;
|
||||
color: var(--base-color) !important;
|
||||
border-bottom: 2px solid #fff;
|
||||
}
|
||||
|
||||
.misc .active {
|
||||
color: var(--base-color)!important;
|
||||
border-color: var(--base-color);
|
||||
}
|
||||
|
||||
.others {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.others > a {
|
||||
padding: 10px;
|
||||
color: var(--base-color) !important
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
color: #ccc;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: 25px;
|
||||
left: 10px;
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
font-size: 12px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.125);
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 10px 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.dropdown-menu li {
|
||||
padding: 0 10px;
|
||||
line-height: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.others:hover .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover {
|
||||
background: var(--base-color);
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.complex-backdrop {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 75px;
|
||||
left: 25px;
|
||||
width: 86%;
|
||||
height: 36.5%;
|
||||
background-color: #fff;
|
||||
/* -webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.25); */
|
||||
/* border:1px solid #E6E6E6; */
|
||||
/* padding-top: 12px; */
|
||||
}
|
||||
|
||||
.layui-layout-admin .layui-body .body-content {
|
||||
background: #f8f8f8;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title {
|
||||
background: #fff;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title li {
|
||||
line-height: 48px;
|
||||
margin: 0 15px;
|
||||
}
|
||||
|
||||
.keyword-content {
|
||||
background: #fff;
|
||||
padding: 15px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
[lay-id=marterial_graphic_message_list] .article-img .bg-color {
|
||||
background-color: #1aad19 !important;
|
||||
}
|
||||
.layui-table-view{
|
||||
background-color: red!important;
|
||||
}
|
||||
|
||||
.complex-content {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.ng.ng-image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.insert-connect {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 20px;
|
||||
color: var(--base-color) !important;
|
||||
}
|
||||
|
||||
.ng {
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
width: 250px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #eee;
|
||||
background-color: #fff;
|
||||
margin-bottom: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.picture > img {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.msg-music-thumb {
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.msg-music-thumb a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px dashed #F2F2F2;
|
||||
display: block;
|
||||
line-height: 100px;
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
#music .layui-textarea {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.voice-player {
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
border: 1px solid #85ac4c;
|
||||
display: inline-block;
|
||||
width: 90px;
|
||||
height: 25px;
|
||||
padding: 0 6px 0 7px;
|
||||
font-size: 12px !important;
|
||||
line-height: 25px;
|
||||
cursor: pointer;
|
||||
background: #a0ce3d;
|
||||
vertical-align: middle;
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.voice-player::before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -13px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #85ac4c;
|
||||
}
|
||||
|
||||
.voice-player .stop {
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px 1px #8ab433;
|
||||
}
|
||||
|
||||
.popover .close--circle {
|
||||
z-index: initial;
|
||||
}
|
||||
|
||||
.close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
font-size: 28px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.voice-player .second {
|
||||
display: none;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
color: #476600;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.voice-player .play {
|
||||
display: inline-block;
|
||||
width: 17px;
|
||||
height: 20px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.voice-player::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -12px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #a0ce3d;
|
||||
}
|
||||
|
||||
/*其他*/
|
||||
.ng .close--circle {
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
}
|
||||
|
||||
.ng .ng-item {
|
||||
border-bottom: 1px solid #eee;
|
||||
overflow: hidden;
|
||||
padding: 5px 9px;
|
||||
}
|
||||
|
||||
.ng .label {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*图文*/
|
||||
.ng .ng-title {
|
||||
display: inline-block !important;
|
||||
overflow: hidden !important;
|
||||
white-space: nowrap !important;
|
||||
text-overflow: ellipsis !important;
|
||||
line-height: 16px;
|
||||
min-height: 16px;
|
||||
vertical-align: middle;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
a.new-window {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more a {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/*************************************/
|
||||
|
||||
.rule-container .add_reply-top{
|
||||
position: absolute;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
line-height: 0px;/*为了防止ie下出现题型*/
|
||||
border-bottom: 10px solid #fff;
|
||||
border-left: 10px solid rgba(0,0,0,0);
|
||||
border-right: 10px solid rgba(0,0,0,0);
|
||||
right: 55px;
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
.popover > .close--circle {
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: 50%;
|
||||
left: -13px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow i {
|
||||
color: #e5e5e5;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.rule-group-container {
|
||||
position: relative;
|
||||
min-height: 165px
|
||||
}
|
||||
|
||||
.search {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 1px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.layui-form-item .layui-textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.layui-form.hyperlink {
|
||||
padding: 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.layui-form.hyperlink .layui-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.layui-layout-shop .fourstage-nav ul li.layui-this:after {
|
||||
border: none !important;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background-color: var(--base-color);
|
||||
border-radius: 30px !important;
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
}
|
||||
BIN
addon/wechat/shop/view/public/img/add.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
addon/wechat/shop/view/public/img/administration.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
addon/wechat/shop/view/public/img/appmsg.png
Executable file
|
After Width: | Height: | Size: 29 KiB |
BIN
addon/wechat/shop/view/public/img/appmsg1.png
Executable file
|
After Width: | Height: | Size: 16 KiB |
BIN
addon/wechat/shop/view/public/img/appmsg2.png
Executable file
|
After Width: | Height: | Size: 95 KiB |
BIN
addon/wechat/shop/view/public/img/arrow.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/article-msg.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/audio.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/base_icon.png
Executable file
|
After Width: | Height: | Size: 93 KiB |
BIN
addon/wechat/shop/view/public/img/cart.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
addon/wechat/shop/view/public/img/check_qrcode1.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
addon/wechat/shop/view/public/img/complete.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/config_fans_icon.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
addon/wechat/shop/view/public/img/config_info.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/config_leavemsg_icon.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
addon/wechat/shop/view/public/img/config_mass_icon.png
Executable file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
addon/wechat/shop/view/public/img/config_material_icon.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/wechat/shop/view/public/img/config_menu_icon.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
addon/wechat/shop/view/public/img/config_message_icon.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/wechat/shop/view/public/img/config_qrcode_icon.png
Executable file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
addon/wechat/shop/view/public/img/config_replay_icon.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
addon/wechat/shop/view/public/img/config_share_icon.png
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
addon/wechat/shop/view/public/img/config_wechat_icon.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
addon/wechat/shop/view/public/img/edition.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
addon/wechat/shop/view/public/img/flow/arrow.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/flow/complete.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/flow/config_info.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/flow/edition.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
addon/wechat/shop/view/public/img/flow/public_number.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/flow/register.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/folder.png
Executable file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
addon/wechat/shop/view/public/img/icon-header.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
addon/wechat/shop/view/public/img/icon.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
addon/wechat/shop/view/public/img/icon_audio_player.png
Executable file
|
After Width: | Height: | Size: 19 KiB |
BIN
addon/wechat/shop/view/public/img/index_author.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/index_weixin.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/wechat/shop/view/public/img/material_delete.png
Executable file
|
After Width: | Height: | Size: 1003 B |
BIN
addon/wechat/shop/view/public/img/material_download.png
Executable file
|
After Width: | Height: | Size: 15 KiB |
BIN
addon/wechat/shop/view/public/img/material_edit.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/menu_wchat_selected.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/menu_wechat.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/wechat_icon.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/wechat_icon_new.png
Executable file
|
After Width: | Height: | Size: 829 B |
BIN
addon/wechat/shop/view/public/img/menu_icon/wechat_icon_select.png
Executable file
|
After Width: | Height: | Size: 694 B |
BIN
addon/wechat/shop/view/public/img/menu_preview.png
Executable file
|
After Width: | Height: | Size: 21 KiB |
BIN
addon/wechat/shop/view/public/img/mobile_foot_default.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/mobile_head.png
Executable file
|
After Width: | Height: | Size: 12 KiB |
BIN
addon/wechat/shop/view/public/img/picture.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/public_number.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/register.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/set_up.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
addon/wechat/shop/view/public/img/small_procedures.png
Executable file
|
After Width: | Height: | Size: 667 B |
BIN
addon/wechat/shop/view/public/img/template_qrcode.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
addon/wechat/shop/view/public/img/video.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/wechat.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/wx_feature_set.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/wx_menu_icos.png
Executable file
|
After Width: | Height: | Size: 228 B |
16
addon/wechat/shop/view/public/js/common.js
Executable file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 素材库
|
||||
* @param type
|
||||
*/
|
||||
function material(type) {
|
||||
layui.use(['layer'], function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: "素材库",
|
||||
area: ['890px', '700px'],
|
||||
fixed: false, //不固定
|
||||
maxmin: false,
|
||||
content: ns.url("wechat://shop/material/material", {request_mode: 'iframe', type: type}),
|
||||
})
|
||||
})
|
||||
}
|
||||
475
addon/wechat/shop/view/public/js/wx_default.js
Executable file
@@ -0,0 +1,475 @@
|
||||
WxReplay = function (limit = 0, limits = []) {
|
||||
var _this = this;
|
||||
_this._dom = null;
|
||||
_this.eventFlg = true;
|
||||
|
||||
_this.listCount = 0;
|
||||
_this.limit = limit == false ? 15 : limit;
|
||||
_this.limits = limit == false ? [15, 20, 50] : limits;
|
||||
_this.page = 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取关注后回复列表
|
||||
*/
|
||||
WxReplay.prototype.getData = function (d) {
|
||||
var _this = d._this;
|
||||
var page = _this.page;
|
||||
var limit = _this.limit;
|
||||
var rule_type = d.rule_type;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/default'),
|
||||
async: false,
|
||||
data: {"page": page, "limit": limit, "rule_type": rule_type},
|
||||
success: function (data) {
|
||||
_this.listCount = data.data.count;
|
||||
_this.aD.addReolayList(data.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* layui分页
|
||||
*/
|
||||
WxReplay.prototype.pageInit = function (d) {
|
||||
var _this = d._this;
|
||||
layui.use('laypage', function () {
|
||||
var laypage = layui.laypage;
|
||||
var page = 1;
|
||||
var hash_arr = getHashArr();
|
||||
$.each(hash_arr,function(index, itemobj){
|
||||
var item_arr = itemobj.split("=");
|
||||
if(item_arr.length == 2){
|
||||
switch(item_arr[0]){
|
||||
case "page":
|
||||
page = item_arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
laypage.render({
|
||||
elem: 'list_page',
|
||||
count: _this.listCount,
|
||||
limit: _this.limit,
|
||||
limits: _this.limits,
|
||||
layout: ns.get_page_param(),
|
||||
curr: page, //获取起始页
|
||||
jump: function (obj, first) {
|
||||
_this.limit = obj.limit;
|
||||
if (!first) {
|
||||
_this.page = obj.curr;
|
||||
_this.getData({_this: _this, "rule_type": 'KEYWORDS'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 事件操作
|
||||
* @param e 事件对象
|
||||
*/
|
||||
WxReplay.prototype.e = function (e) {
|
||||
try {
|
||||
//_this为replay对象 //_dom 为元素dom
|
||||
var _this = e.data._this;
|
||||
_this._dom = e.target;
|
||||
var eventFlg = _this.eventFlg;
|
||||
if (!eventFlg) return;
|
||||
_this.eventFlg = false;
|
||||
var _dom = e.target;
|
||||
var dataEvent = $(_dom).attr("nc-event");
|
||||
var dataAction = $(_dom).attr("nc-action");
|
||||
var type = e.type;
|
||||
if (dataEvent != type) {
|
||||
if ($(_dom).attr("nc-event2") != type) {
|
||||
_this.eventFlg = true;
|
||||
return;
|
||||
} else {
|
||||
dataEvent = $(_dom).attr("nc-event2");
|
||||
dataAction = $(_dom).attr("nc-action2");
|
||||
}
|
||||
}
|
||||
|
||||
var eventObj = null;
|
||||
switch (dataEvent) {
|
||||
case "click":
|
||||
eventObj = _this.clickEvent;
|
||||
break;
|
||||
case "mouseenter" :
|
||||
eventObj = _this.mouseenterEvent;
|
||||
break;
|
||||
case "mouseleave" :
|
||||
eventObj = _this.mouseleaveEvent;
|
||||
break;
|
||||
}
|
||||
if (eventObj) {
|
||||
|
||||
_this.evalFun(eventObj, dataAction, {"_this": _this});
|
||||
|
||||
_this.eventFlg = true;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
_this.eventFlg = true;
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
WxReplay.prototype.clickEvent = {
|
||||
click: function () {
|
||||
|
||||
},
|
||||
//添加一条回复
|
||||
addReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "设置默认回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("textarea[name='reply_content']").val("");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//编辑回复
|
||||
editReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var request_type = $(_dom).attr('type');
|
||||
$("#hidden_reply_type").val(request_type);
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "修改默认回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("textarea[name='reply_content']").val(reply_content);
|
||||
|
||||
$(".voice").css("display", "none");
|
||||
$(".voice").next("span").css("display", "none");
|
||||
|
||||
if (request_type == 'music') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="' + reply_content + '">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
|
||||
} else if (request_type == 'other') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + reply_content + '"><span class="label label-success">' + reply_content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'articles') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="" target="_blank" class="new-window" title="rgrg">' + reply_content + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else {
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//删除回复
|
||||
delReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "是否删除该条回复",
|
||||
offset: "auto",
|
||||
content: '删除后,关注该公众号的用户将不再接收该回复,确定删除?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteReply'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//音乐
|
||||
music: function (d) {
|
||||
$("#hidden_reply_type").val('music');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '音乐素材',
|
||||
area: ['652px', "380px"],
|
||||
offset: "auto",
|
||||
content: $("#music"),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 移入事件
|
||||
*/
|
||||
|
||||
WxReplay.prototype.mouseenterEvent = {};
|
||||
|
||||
/**
|
||||
* 移出事件
|
||||
*/
|
||||
WxReplay.prototype.mouseleaveEvent = {};
|
||||
|
||||
/**
|
||||
* 执行传过来的方法
|
||||
* @param eventObj
|
||||
* @param funcName
|
||||
* @param d
|
||||
*/
|
||||
WxReplay.prototype.evalFun = function (eventObj, funcName, d = {}) {
|
||||
for (i in eventObj) {
|
||||
if (i == funcName) {
|
||||
eval(eventObj[i](d));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 元素操作 da(documentAction)
|
||||
*/
|
||||
WxReplay.prototype.aD = {
|
||||
|
||||
addReolayList: function (d) {
|
||||
var data = d.list;
|
||||
var html = '';
|
||||
if (data.length) {
|
||||
$.each(data, function (i) {
|
||||
var d = data[i];
|
||||
html += '<div class="rule-group layui-row" data-rule_id="' + d.rule_id + '">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 默认回复</span></h3>';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
|
||||
if (d.replay_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<ol class="reply-list">';
|
||||
|
||||
if (d.replay_list.length > 0) {
|
||||
for (var j in d.replay_list) {
|
||||
|
||||
html += '<li>';//回复列表
|
||||
html += '<div class="reply-cont">';
|
||||
html += '<div class="reply-summary">';
|
||||
if (d.replay_list[j].type == 'text') {
|
||||
html += '<span class="label label-success">文本</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'music') {
|
||||
html += '<div class="voice-wrapper" data-voice-src="' + d.replay_list[j].reply_content + '">';
|
||||
html += '<span class="voice-player">';
|
||||
html += '<span class="stop">点击播放</span>';
|
||||
html += '<span class="second" style="display: block;"></span>';
|
||||
html += '<i class="play" style="display:none;"></i>';
|
||||
html += '</span>';
|
||||
html += '</div>';
|
||||
} else if (d.replay_list[j].type == 'other') {
|
||||
html += '<span class="label label-success">' + d.replay_list[j].reply_content + '</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'articles') {
|
||||
html += '<span class="label label-success">图文</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="reply-opts">';
|
||||
var reply_content_to = d.replay_list[j].reply_content.replace(/"/g, "'");
|
||||
html += '<a class="js-edit-it js-replay" href="javascript:;" reply_content="' + reply_content_to + '" data-key_id="' + j + '" type="' + d.replay_list[j].type + '" nc-event="click" nc-action="editReply">编辑</a> - ';
|
||||
html += '<a class="js-delete-it js-replay delet-color" href="javascript:;" data-key_id="' + j + '" nc-event="click" nc-action="delReply">删除</a>';
|
||||
html += '</div>';
|
||||
html += '</li>';
|
||||
|
||||
}
|
||||
}
|
||||
html += '</ol>';
|
||||
html += '</div>';
|
||||
// html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
if (d.replay_list.length < 1) {
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
} else {
|
||||
html += '<span class="disable-opt hide">最多一条回复</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
});
|
||||
} else {
|
||||
html += '<div class="rule-group layui-row" data-rule_id="">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 默认回复</span></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$("#load_rule_list").html(html);
|
||||
}
|
||||
};
|
||||
|
||||
WxReplay.prototype.sendAjax = function (param = {}) {
|
||||
var d = $.extend({
|
||||
"url": '',
|
||||
"type": "post",
|
||||
"data": {},
|
||||
"async": true,
|
||||
"success": ''
|
||||
}, param);
|
||||
try {
|
||||
$.ajax({
|
||||
url: d.url,
|
||||
type: d.type,
|
||||
data: d.data,
|
||||
async: d.async,
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (typeof (d.success) == "function") {
|
||||
d.success(res);
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
//其他
|
||||
$(".dropdown-menu li").click(function () {
|
||||
$("#hidden_reply_type").val('other');
|
||||
var title = $(this).text();
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + title + '"><span class="label label-success">' + title + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(title);
|
||||
});
|
||||
|
||||
//插入链接
|
||||
function hyperlink(d) {
|
||||
$("#hidden_reply_type").val('text');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
// $("#add_reply").find("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['306px', "auto"],
|
||||
offset: "auto",
|
||||
content: $("#hyperlink").html(),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
476
addon/wechat/shop/view/public/js/wx_follow.js
Executable file
@@ -0,0 +1,476 @@
|
||||
WxReplay = function (limit = 0, limits = []) {
|
||||
var _this = this;
|
||||
_this._dom = null;
|
||||
_this.eventFlg = true;
|
||||
|
||||
_this.listCount = 0;
|
||||
_this.limit = limit == false ? 15 : limit;
|
||||
_this.limits = limit == false ? [15, 20, 50] : limits;
|
||||
_this.page = 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取关注后回复列表
|
||||
*/
|
||||
WxReplay.prototype.getData = function (d) {
|
||||
var _this = d._this;
|
||||
var page = _this.page;
|
||||
var limit = _this.limit;
|
||||
var rule_type = d.rule_type;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/follow'),
|
||||
async: false,
|
||||
data: {"page": page, "limit": limit, "rule_type": rule_type},
|
||||
success: function (data) {
|
||||
_this.listCount = data.data.count;
|
||||
_this.aD.addReplayList(data.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* layui分页
|
||||
*/
|
||||
WxReplay.prototype.pageInit = function (d) {
|
||||
var _this = d._this;
|
||||
layui.use('laypage', function () {
|
||||
var laypage = layui.laypage;
|
||||
var page = 1;
|
||||
var hash_arr = getHashArr();
|
||||
$.each(hash_arr,function(index, itemobj){
|
||||
var item_arr = itemobj.split("=");
|
||||
if(item_arr.length == 2){
|
||||
switch(item_arr[0]){
|
||||
case "page":
|
||||
page = item_arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
laypage.render({
|
||||
elem: 'list_page',
|
||||
count: _this.listCount,
|
||||
limit: _this.limit,
|
||||
limits: _this.limits,
|
||||
layout: ns.get_page_param(),
|
||||
curr: page,
|
||||
jump: function (obj, first) {
|
||||
_this.limit = obj.limit;
|
||||
if (!first) {
|
||||
_this.page = obj.curr;
|
||||
_this.getData({_this: _this, "rule_type": 'KEYWORDS'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 事件操作
|
||||
* @param e 事件对象
|
||||
*/
|
||||
WxReplay.prototype.e = function (e) {
|
||||
try {
|
||||
//_this为replay对象 //_dom 为元素dom
|
||||
var _this = e.data._this;
|
||||
_this._dom = e.target;
|
||||
var eventFlg = _this.eventFlg;
|
||||
if (!eventFlg) return;
|
||||
_this.eventFlg = false;
|
||||
var _dom = e.target;
|
||||
var dataEvent = $(_dom).attr("nc-event");
|
||||
var dataAction = $(_dom).attr("nc-action");
|
||||
var type = e.type;
|
||||
if (dataEvent != type) {
|
||||
if ($(_dom).attr("nc-event2") != type) {
|
||||
_this.eventFlg = true;
|
||||
return;
|
||||
} else {
|
||||
dataEvent = $(_dom).attr("nc-event2");
|
||||
dataAction = $(_dom).attr("nc-action2");
|
||||
}
|
||||
}
|
||||
|
||||
var eventObj = null;
|
||||
switch (dataEvent) {
|
||||
case "click":
|
||||
eventObj = _this.clickEvent;
|
||||
break;
|
||||
case "mouseenter" :
|
||||
eventObj = _this.mouseenterEvent;
|
||||
break;
|
||||
case "mouseleave" :
|
||||
eventObj = _this.mouseleaveEvent;
|
||||
break;
|
||||
}
|
||||
if (eventObj) {
|
||||
|
||||
_this.evalFun(eventObj, dataAction, {"_this": _this});
|
||||
|
||||
_this.eventFlg = true;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
_this.eventFlg = true;
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
WxReplay.prototype.clickEvent = {
|
||||
click: function () {
|
||||
|
||||
},
|
||||
|
||||
//添加一条回复
|
||||
addReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "设置自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("textarea[name='reply_content']").val("");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//编辑回复
|
||||
editReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var request_type = $(_dom).attr('type');
|
||||
$("#hidden_reply_type").val(request_type);
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "修改自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("textarea[name='reply_content']").val(reply_content);
|
||||
|
||||
$(".voice").css("display", "none");
|
||||
$(".voice").next("span").css("display", "none");
|
||||
|
||||
if (request_type == 'music') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="' + reply_content + '">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
|
||||
} else if (request_type == 'other') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + reply_content + '"><span class="label label-success">' + reply_content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'articles') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="" target="_blank" class="new-window" title="rgrg">' + reply_content + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else {
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//删除回复
|
||||
delReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "是否删除该条回复",
|
||||
offset: "auto",
|
||||
content: '删除后,关注该公众号的用户将不再接收该回复,确定删除?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteReply'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//音乐
|
||||
music: function (d) {
|
||||
$("#hidden_reply_type").val('music');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$("#add_reply").find("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '音乐素材',
|
||||
area: ['652px', "380px"],
|
||||
offset: "auto",
|
||||
content: $("#music").html(),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 移入事件
|
||||
*/
|
||||
|
||||
WxReplay.prototype.mouseenterEvent = {};
|
||||
|
||||
/**
|
||||
* 移出事件
|
||||
*/
|
||||
WxReplay.prototype.mouseleaveEvent = {};
|
||||
|
||||
/**
|
||||
* 执行传过来的方法
|
||||
* @param eventObj
|
||||
* @param funcName
|
||||
* @param d
|
||||
*/
|
||||
WxReplay.prototype.evalFun = function (eventObj, funcName, d = {}) {
|
||||
for (i in eventObj) {
|
||||
if (i == funcName) {
|
||||
eval(eventObj[i](d));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 元素操作 da(documentAction)
|
||||
*/
|
||||
WxReplay.prototype.aD = {
|
||||
|
||||
addReplayList: function (d) {
|
||||
var data = d.list;
|
||||
var html = '';
|
||||
if (data.length) {
|
||||
$.each(data, function (i) {
|
||||
var d = data[i];
|
||||
html += '<div class="rule-group layui-row" data-rule_id="' + d.rule_id + '">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 关注后自动回复</span></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
|
||||
if (d.replay_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<ol class="reply-list">';
|
||||
|
||||
if (d.replay_list.length > 0) {
|
||||
for (var j in d.replay_list) {
|
||||
|
||||
html += '<li>';//回复列表
|
||||
html += '<div class="reply-cont">';
|
||||
html += '<div class="reply-summary">';
|
||||
if (d.replay_list[j].type == 'text') {
|
||||
html += '<span class="label label-success">文本</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'music') {
|
||||
html += '<div class="voice-wrapper" data-voice-src="' + d.replay_list[j].reply_content + '">';
|
||||
html += '<span class="voice-player">';
|
||||
html += '<span class="stop">点击播放</span>';
|
||||
html += '<span class="second" style="display: block;"></span>';
|
||||
html += '<i class="play" style="display:none;"></i>';
|
||||
html += '</span>';
|
||||
html += '</div>';
|
||||
} else if (d.replay_list[j].type == 'other') {
|
||||
html += '<span class="label label-success">' + d.replay_list[j].reply_content + '</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'articles') {
|
||||
html += '<span class="label label-success">图文</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="reply-opts">';
|
||||
var reply_content_to = d.replay_list[j].reply_content.replace(/"/g, "'");
|
||||
html += '<a class="js-edit-it js-replay" href="javascript:;" data-key_id="' + j + '" reply_content="' + reply_content_to + '" type="' + d.replay_list[j].type + '" nc-event="click" nc-action="editReply">编辑</a> - ';
|
||||
html += '<a class="js-delete-it js-replay" href="javascript:;" data-key_id="' + j + '" nc-event="click" nc-action="delReply">删除</a>';
|
||||
html += '</div>';
|
||||
html += '</li>';
|
||||
|
||||
}
|
||||
}
|
||||
html += '</ol>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
if (d.replay_list.length < 1) {
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
} else {
|
||||
html += '<span class="disable-opt hide">最多一条回复</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
});
|
||||
} else {
|
||||
html += '<div class="rule-group layui-row" data-rule_id="">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 关注后自动回复</span></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$("#load_rule_list").html(html);
|
||||
}
|
||||
};
|
||||
|
||||
WxReplay.prototype.sendAjax = function (param = {}) {
|
||||
var d = $.extend({
|
||||
"url": '',
|
||||
"type": "post",
|
||||
"data": {},
|
||||
"async": true,
|
||||
"success": ''
|
||||
}, param);
|
||||
try {
|
||||
$.ajax({
|
||||
url: d.url,
|
||||
type: d.type,
|
||||
data: d.data,
|
||||
async: d.async,
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (typeof (d.success) == "function") {
|
||||
d.success(res);
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
//其他
|
||||
$(".dropdown-menu li").click(function () {
|
||||
$("#hidden_reply_type").val('other');
|
||||
var title = $(this).text();
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + title + '"><span class="label label-success">' + title + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(title);
|
||||
|
||||
});
|
||||
|
||||
|
||||
//插入链接
|
||||
function hyperlink(d) {
|
||||
$("#hidden_reply_type").val('text');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['306px', "auto"],
|
||||
offset: "auto",
|
||||
content: $("#hyperlink").html(),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
417
addon/wechat/shop/view/public/js/wx_graphic_message.js
Executable file
@@ -0,0 +1,417 @@
|
||||
var vue_obj;
|
||||
var repeat_flag = false;//防重复标识
|
||||
$(function () {
|
||||
|
||||
initVue();
|
||||
if ($('#edit_flag').val()) {
|
||||
setTimeout(function () {
|
||||
vue_obj.loadGraphicMessageInfo();
|
||||
}, 20);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// 初始化Vue
|
||||
function initVue() {
|
||||
// 挂载父组件
|
||||
vue_obj = new Vue({
|
||||
el: '#graphic_message', // 挂载点标识
|
||||
data: { // 数据
|
||||
article_item_list: [
|
||||
{
|
||||
msg_type: 1, // 消息类型
|
||||
title: '', // 标题
|
||||
autor: '', // 作者
|
||||
content: '', // 内容
|
||||
url: '', // 原文链接
|
||||
show_cover_pic: 0, // 正文是否显示封面图
|
||||
cover: {
|
||||
path: '', // 封面路径
|
||||
media_id: '' // 封面media_id
|
||||
},
|
||||
digest: '', // 摘要
|
||||
},
|
||||
],
|
||||
edit_mask_list: [
|
||||
{
|
||||
is_show: false, // 是否显示列表修改菜单 ---对应图文消息列表
|
||||
}
|
||||
],
|
||||
max_item_list: 8,
|
||||
current_msg_index: 0, // 当前选中消息下标
|
||||
material_id: 0, // 当前图文消息ID
|
||||
inputTitle: '',
|
||||
inputAutor: '',
|
||||
inputOriginalUrl: '',
|
||||
checkShowCoverPic: 0,
|
||||
coverImg: '',
|
||||
editBoxTopPosition: 80,
|
||||
move_index: -1,
|
||||
loading: false,
|
||||
editor: null
|
||||
},
|
||||
watch: {
|
||||
//输入标题
|
||||
inputTitle: function (val) {
|
||||
this.article_item_list[this.current_msg_index].title = val;
|
||||
},
|
||||
//输入作者
|
||||
inputAutor: function (val) {
|
||||
this.article_item_list[this.current_msg_index].autor = val;
|
||||
},
|
||||
// 输入原文链接
|
||||
inputOriginalUrl: function (val) {
|
||||
this.article_item_list[this.current_msg_index].url = val;
|
||||
},
|
||||
// 正文是否显示封面图
|
||||
checkShowCoverPic: function (val) {
|
||||
this.article_item_list[this.current_msg_index].show_cover_pic = val;
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
var _self = this;
|
||||
_self.material_id = $('#material_id').val();
|
||||
_self.editor = UE.getEditor('editor');
|
||||
if(_self.material_id == 0){
|
||||
_self.reloadUpload();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 添加图文消息
|
||||
addGraphicMessage: function (e) {
|
||||
getContent();
|
||||
var article_item_list = this.article_item_list;
|
||||
if (article_item_list.length > 7) {
|
||||
layer.msg('多图文消息内容不可超过8个');
|
||||
return false;
|
||||
}
|
||||
|
||||
var new_item_msg = {
|
||||
msg_type: 1, // 消息类型
|
||||
title: '', // 标题
|
||||
autor: '', // 作者
|
||||
content: '', // 内容
|
||||
url: '', // 原文链接
|
||||
show_cover_pic: 0, // 正文是否显示封面
|
||||
cover: {
|
||||
path: '', // 封面路径
|
||||
media_id: '' // 封面media_id
|
||||
},
|
||||
digest: '', // 摘要
|
||||
};
|
||||
var new_edit_mask = {
|
||||
is_show: false
|
||||
};
|
||||
// 添加新图文消息
|
||||
this.article_item_list.push(new_item_msg);
|
||||
this.edit_mask_list.push(new_edit_mask);
|
||||
// 初始化新图文消息
|
||||
this.editor.setContent('');
|
||||
this.current_msg_index = article_item_list.length - 1;// 更新当前选中消息
|
||||
this.inputTitle = '';// 初始化输入标题
|
||||
this.inputAutor = '';// 初始化输入作者
|
||||
this.checkShowCoverPic = '';
|
||||
this.inputOriginalUrl = '';
|
||||
this.coverImg = '';
|
||||
var _num = article_item_list.length - 1;
|
||||
var _top = 250;
|
||||
_top = _num == 0 ? 80 : _top;
|
||||
_num = _num > 0 ? _num - 1 : _num;
|
||||
this.editBoxTopPosition = 72 * _num + _top;
|
||||
|
||||
setTimeout(()=>{
|
||||
this.reloadUpload();
|
||||
},600)
|
||||
},
|
||||
// 选择编辑中图文消息
|
||||
chooseGraphicMessage: function (index) {
|
||||
getContent();
|
||||
var article = this.article_item_list[index];
|
||||
this.current_msg_index = index;
|
||||
this.inputTitle = article.title; // 初始化输入标题
|
||||
this.inputAutor = article.autor; // 初始化输入作者
|
||||
this.editor.setContent(article.content); // 初始化ueditor输入
|
||||
this.checkShowCoverPic = article.show_cover_pic;
|
||||
this.inputOriginalUrl = article.url;
|
||||
this.coverImg = article.cover.path;
|
||||
var _num = index;
|
||||
var _top = 250;
|
||||
_top = _num == 0 ? 80 : _top;
|
||||
_num = _num > 0 ? _num - 1 : _num;
|
||||
this.editBoxTopPosition = 72 * _num + _top;
|
||||
|
||||
setTimeout(()=>{
|
||||
this.reloadUpload();
|
||||
},600)
|
||||
},
|
||||
//鼠标经过
|
||||
moveThis: function (index) {
|
||||
this.move_index = index;
|
||||
},
|
||||
leaveThis: function (index) {
|
||||
this.move_index = -1;
|
||||
},
|
||||
// 加载当前图文消息
|
||||
loadGraphicMessageInfo: function () {
|
||||
var _self = this;
|
||||
var id = _self.material_id;
|
||||
_self.loading = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url("wechat://shop/material/getMaterialInfo"),
|
||||
data: {id},
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
data = data.data;
|
||||
if (data.value != null && data.id > 0) {
|
||||
//延时渲染
|
||||
var count_timer = 0;
|
||||
var timer = setInterval(function () {
|
||||
try {
|
||||
// 初始化
|
||||
_self.article_item_list = new Array();
|
||||
_self.edit_mask_list = new Array();
|
||||
// 循环赋值
|
||||
count_timer++;
|
||||
if (count_timer > 5) {
|
||||
clearInterval(timer);
|
||||
layer.msg('加载失败');
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var index in data.value) {
|
||||
var msg = data.value[index];
|
||||
|
||||
var new_item_msg = {
|
||||
msg_type: 1, // 消息类型
|
||||
title: msg.title, // 标题
|
||||
autor: msg.autor, // 作者
|
||||
content: msg.content, // 内容
|
||||
url: msg.url,
|
||||
cover: msg.cover, // 封面
|
||||
show_cover_pic: msg.show_cover_pic, // 正文是否显示封面
|
||||
digest: msg.digest, // 摘要
|
||||
};
|
||||
var new_edit_mask = {
|
||||
is_show: false
|
||||
};
|
||||
// 添加新图文消息
|
||||
_self.article_item_list.push(new_item_msg);
|
||||
_self.edit_mask_list.push(new_edit_mask);
|
||||
// 初始化新图文消息
|
||||
_self.current_msg_index = 0; // 更新当前选中消息
|
||||
|
||||
if (index == 0) {
|
||||
_self.inputTitle = msg.title; // 初始化输入标题
|
||||
_self.inputAutor = msg.autor; // 初始化输入作者
|
||||
_self.editor.setContent(msg.content); // 初始化ueditor输入
|
||||
_self.checkShowCoverPic = msg.show_cover_pic;
|
||||
_self.inputOriginalUrl = msg.url;
|
||||
_self.inputDigest = msg.digest;
|
||||
_self.coverImg = msg.cover.path;
|
||||
_self.loading = false;
|
||||
}
|
||||
}
|
||||
clearInterval(timer);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('加载失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 修改当前图文消息
|
||||
editGraphicMessage: function () {
|
||||
getContent();
|
||||
|
||||
var _self = this;
|
||||
if (!_self.verification(_self)) return;
|
||||
|
||||
var id = _self.material_id;
|
||||
var article_item_list = JSON.parse(JSON.stringify(_self.article_item_list));
|
||||
article_item_list[0].cover.path = $("#logo").val();
|
||||
var value = JSON.stringify(article_item_list);
|
||||
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/edit'),
|
||||
data: {id, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code == 0) {
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
} else {
|
||||
repeat_flag = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存图文消息
|
||||
saveGraphicMessage: function (e) {
|
||||
getContent();
|
||||
|
||||
var _self = this;
|
||||
if (!_self.verification(_self)) return;
|
||||
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
var article_item_list = JSON.parse(JSON.stringify(_self.article_item_list));
|
||||
var value = JSON.stringify(article_item_list);
|
||||
|
||||
var type = 1;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ns.url('wechat://shop/material/add'),
|
||||
data: {type, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
//_self.material_id = res.data;
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
} else {
|
||||
repeat_flag = false;
|
||||
}
|
||||
layer.msg(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加封面图
|
||||
addCover: function (e) {
|
||||
// uploadAlbumalbum_contain();
|
||||
},
|
||||
// 删除图文消息
|
||||
deleteGraphicMessage: function (_index) {
|
||||
var _self = this;
|
||||
layer.confirm(
|
||||
'确认删除?',
|
||||
{
|
||||
btn: ['确认', '取消'], //可以无限个按钮
|
||||
},
|
||||
function (index, layero) {
|
||||
if (_index == _self.article_item_list.length - 1) {
|
||||
_self.chooseGraphicMessage(_index - 1);
|
||||
} else {
|
||||
if (_self.current_msg_index != 0) {
|
||||
var _num = _self.current_msg_index - 1;
|
||||
var _top = 250;
|
||||
_top = _num == 0 ? 80 : _top;
|
||||
_num = _num > 0 ? _num - 1 : _num;
|
||||
_self.editBoxTopPosition = 72 * _num + _top;
|
||||
}
|
||||
_self.current_msg_index = _self.current_msg_index - 1;
|
||||
}
|
||||
_self.article_item_list.splice(_index, 1);
|
||||
layer.close(index);
|
||||
},
|
||||
function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
);
|
||||
},
|
||||
//验证
|
||||
verification: function (_self) {
|
||||
var article_item_list = _self.article_item_list;
|
||||
var falg = true;
|
||||
var hint_type = '';
|
||||
|
||||
for (var index in article_item_list) {
|
||||
var article = article_item_list[index];
|
||||
|
||||
if (article.title == '' && falg) {
|
||||
layer.msg('标题不可为空 !');
|
||||
hint_type = 'title';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if (article.cover.path == '' && falg) {
|
||||
layer.msg('封面图片不可为空 !');
|
||||
hint_type = 'cover';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if ((article.content == '' || article.content == '<p><span style="color:#A7A7Ab;">从这里开始输入正文</span></p>') && falg) {
|
||||
layer.msg('正文不可为空 !');
|
||||
hint_type = 'content';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if (article.url != '' && (article.url.indexOf('http://') != 0 && article.url.indexOf('https://') != 0) && falg) {
|
||||
layer.msg('原文链接无效,请输入http:// 或 https://为前缀的有效地址 !');
|
||||
hint_type = 'url';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if (article.digest == '' && falg) {
|
||||
var content = article.content.replace(/<\/?.+?>/g, "");
|
||||
content = content.replace(/ /g, "");
|
||||
content = content.replace(" ", " ");
|
||||
content = content.replace("'", "'");
|
||||
content = content.substr(0, 64);
|
||||
|
||||
_self.article_item_list[index].digest = content;
|
||||
}
|
||||
|
||||
if (!falg) {
|
||||
_self.chooseGraphicMessage(index);
|
||||
|
||||
if (hint_type == 'title') {
|
||||
$('#input_title').focus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
reloadUpload: function () {
|
||||
var upload = new Upload({
|
||||
elem: '#uploadImg',
|
||||
callback:function (res) {
|
||||
if (res.code >= 0) {
|
||||
//成功之后将图片的路径存放再隐藏域中,便于提交使用
|
||||
// $("input[name='web_qrcode']").val(res.data.pic_path);
|
||||
vue_obj.coverImg = ns.img(res.data.pic_path);
|
||||
vue_obj.article_item_list[vue_obj.current_msg_index].cover.path = ns.img(res.data.pic_path);
|
||||
//将图片展示在页面上
|
||||
// $("#webQrcodeUpload").html("<img src=" + ns.img(res.data.pic_path) + " >");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 相册选择图片回调
|
||||
* @param data
|
||||
* @param name
|
||||
*/
|
||||
function albumUploadSuccess(data, name) {
|
||||
if (data.length != undefined && data.length > 0) {
|
||||
if (data.length > 1) {
|
||||
layer.msg('封面图只可选择一张');
|
||||
}
|
||||
path = ns.img(data[0].path);
|
||||
var article_item_list = vue_obj.article_item_list;
|
||||
var index = vue_obj.current_msg_index;
|
||||
article_item_list[index].cover.path = path;
|
||||
vue_obj.article_item_list = article_item_list;
|
||||
vue_obj.coverImg = path;
|
||||
} else {
|
||||
layer.msg('图片添加失败');
|
||||
}
|
||||
}
|
||||
|
||||
//获取富文本内容
|
||||
function getContent(){
|
||||
vue_obj.article_item_list[vue_obj.current_msg_index].content = vue_obj.editor.getContent();
|
||||
}
|
||||
128
addon/wechat/shop/view/public/js/wx_material.js
Executable file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* 素材列表
|
||||
*/
|
||||
layui.use(['form', 'table', 'element'], function() {
|
||||
var form = layui.form,
|
||||
element = layui.element;
|
||||
|
||||
form.render();
|
||||
|
||||
element.on('tab(list_tab)', function() {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: {
|
||||
'type': this.getAttribute('lay-id')
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var table = new Table({
|
||||
elem: '#graphic_message_list',
|
||||
filter: "graphic_message",
|
||||
url: ns.url('wechat://shop/material/lists'),
|
||||
cols: [[
|
||||
{
|
||||
field: 'value',
|
||||
width: '30%',
|
||||
title: '标题',
|
||||
align: 'center',
|
||||
templet: '#title',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
width: '30%',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
templet: '#create_time',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
field: 'update_time',
|
||||
width: '25%',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
templet: '#update_time',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '15%',
|
||||
toolbar: '#operation',
|
||||
unresize : 'true',
|
||||
align:'right'
|
||||
}
|
||||
]]
|
||||
});
|
||||
//监听工具条
|
||||
table.tool(function(obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case "edit":
|
||||
if(data.type == 1){
|
||||
location.hash = ns.hash('wechat://shop/material/edit', {"id": data.id});
|
||||
}else{
|
||||
location.hash = ns.hash('wechat://shop/material/edittextmaterial', {"id": data.id});
|
||||
}
|
||||
break;
|
||||
case "delete":
|
||||
delMaterial(data.id, 1, data.media_id);
|
||||
break;
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 删除素材
|
||||
*/
|
||||
function delMaterial(id, type, media_id) {
|
||||
layer.confirm(
|
||||
'确认删除?', {
|
||||
btn: ['确认', '取消'],
|
||||
},
|
||||
function(index, layero) {
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/delete'),
|
||||
data: {
|
||||
id,
|
||||
media_id
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code == 0) {
|
||||
table.reload()
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
},
|
||||
function(index) {
|
||||
layer.close(index);
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 图文消息预览
|
||||
*/
|
||||
function preview(id, index = 0) {
|
||||
var url = ns.href('wechat://shop/material/previewgraphicmessage', {
|
||||
"id": id,
|
||||
"i": index
|
||||
});
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
function previewtext(id, index = 0) {
|
||||
var url = ns.href('wechat://shop/material/previewtextmessage', {
|
||||
"id": id,
|
||||
"i": index
|
||||
});
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
265
addon/wechat/shop/view/public/js/wx_material_mannager.js
Executable file
@@ -0,0 +1,265 @@
|
||||
var layer_index = '';
|
||||
var add_layer_index = '';
|
||||
var limit = 15;
|
||||
var laytpl;
|
||||
var laypage;
|
||||
var repeat_flag = false;//防重复标识
|
||||
|
||||
function chooseMaterial(type) {
|
||||
loadMaterialList(type);
|
||||
var content_id = $('#marterial_graphic_message');
|
||||
if (type == 1) {
|
||||
content_id = $('#marterial_graphic_message');
|
||||
} else if (type == 2) {
|
||||
content_id = $('#material_image');
|
||||
} else if (type == 5) {
|
||||
content_id = $('#material_text');
|
||||
}
|
||||
layer_index = layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
// shade: [0],
|
||||
area: ['800px', '450px'],
|
||||
content: content_id,
|
||||
success: function (layero, index) {
|
||||
var mask = $(".layui-layer-shade");
|
||||
mask.appendTo(layero.parent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 素材列表
|
||||
*/
|
||||
function loadMaterialList(type) {
|
||||
if (type == 1) {
|
||||
var table = new Table({
|
||||
elem: '#marterial_graphic_message_list',
|
||||
filter: "marterial_graphic_message",
|
||||
// width: '780',
|
||||
url: ns.url("wechat://shop/material/lists"),
|
||||
where: {type: 1, limit},
|
||||
cols: [[
|
||||
{
|
||||
field: 'value',
|
||||
width: '35%',
|
||||
title: '标题',
|
||||
align: 'center',
|
||||
templet: '#graphic_message_title'
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
width: '25%',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
templet: '#create_time'
|
||||
},
|
||||
{
|
||||
field: 'update_time',
|
||||
width: '20%',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
templet: '#update_time'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '20%',
|
||||
toolbar: '#operation',
|
||||
align:'right'
|
||||
}
|
||||
]]
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
table.tool(function (obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case "choose":
|
||||
try{
|
||||
parent.chooseGraphicMessage(data);
|
||||
}catch(e){
|
||||
console.error("chooseGraphicMessage()");
|
||||
}
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
parent.layer.close(index);
|
||||
// chooseGraphicMessage(data);
|
||||
// layer.close(layer_index);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}else if (type == 5) {
|
||||
var table = new Table({
|
||||
elem: '#material_text_list',
|
||||
filter: "material_text",
|
||||
// width: '780',
|
||||
url: ns.url("wechat://shop/material/lists"),
|
||||
where: {type: 5},
|
||||
cols: [[
|
||||
{
|
||||
field: 'value',
|
||||
width: '40%',
|
||||
title: '内容',
|
||||
align: 'center',
|
||||
templet: '#text_content'
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
width: '25%',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
templet: '#create_time'
|
||||
},
|
||||
{
|
||||
field: 'update_time',
|
||||
width: '25%',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
templet: '#update_time'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '10%',
|
||||
toolbar: '#operation',
|
||||
align:'right'
|
||||
}
|
||||
]]
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
table.tool(function (obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case "choose":
|
||||
try{
|
||||
parent.chooseTextMessage(data);
|
||||
|
||||
}catch(e){
|
||||
console.error("chooseTextMessage()");
|
||||
}
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
parent.layer.close(index);
|
||||
//
|
||||
// chooseTextMessage(data);
|
||||
// layer.close(layer_index);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图文消息预览
|
||||
*/
|
||||
function preview(id, index = 0) {
|
||||
var parme = {"id": id, "i": index};
|
||||
var url = ns.url("wechat://shop/material/previewgraphicmessage", {id: id, i: index});
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本消息预览
|
||||
*/
|
||||
function previewTexts(event, media_id, index, subIndex = "") {
|
||||
var content = $(".text-message-content .title>a").html();
|
||||
var html = "";
|
||||
html += "<div><textarea id='text_content' class='text-r'>"+ content +"</textarea></div>";
|
||||
layer_index = layer.open({
|
||||
type: 1,
|
||||
closeBtn: 0, //不显示关闭按钮
|
||||
anim: 2,
|
||||
area: ['380px', '230px'],
|
||||
shadeClose: true, //开启遮罩关闭
|
||||
btn: ['确定', '取消'],
|
||||
title : "文本信息",
|
||||
content: html,
|
||||
yes:function(){
|
||||
var text_r = $(".text-r").val();
|
||||
$(".text-message-content .title>a").html(text_r);
|
||||
if(subIndex >= 0){
|
||||
menu.button[index].sub_button[subIndex]['text'] = text_r;
|
||||
}else{
|
||||
menu.button[index]['text'] = text_r;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/editTextMaterial'),
|
||||
data: {media_id: media_id, content : text_r},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
|
||||
layer.close(layer_index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function previewText(content) {
|
||||
layer.open({
|
||||
title: '文本内容',
|
||||
content: content
|
||||
})
|
||||
}
|
||||
|
||||
function addMaterial(type) {
|
||||
addMaterialForm(type);
|
||||
var content_id = $('#add_material_text');
|
||||
|
||||
add_layer_index = layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
// shade: [0],
|
||||
area: ['800px', '646px'],
|
||||
content: content_id,
|
||||
success: function (layero, index) {
|
||||
var mask = $(".layui-layer-shade");
|
||||
mask.appendTo(layero.parent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addMaterialForm(type) {
|
||||
if (type == 5) {
|
||||
layui.use('form', function () {
|
||||
var form = layui.form;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
var value = JSON.stringify(data.field);
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/addTextMaterial'),
|
||||
data: {type: 5, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
layer.close(add_layer_index);
|
||||
var _data = {
|
||||
id: res.data,
|
||||
value: data.field
|
||||
};
|
||||
typeof chooseTextMessage == 'function' && chooseTextMessage(_data)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
752
addon/wechat/shop/view/public/js/wx_menu.js
Executable file
@@ -0,0 +1,752 @@
|
||||
var loading_index;
|
||||
var menu = new Vue({
|
||||
el: '#menu',
|
||||
data: {
|
||||
button: [],
|
||||
menuIndex: [-1, -1],// 分别是一二级菜单的index
|
||||
menuObj: {}, // 当前选择的菜单 对应的值
|
||||
subMenuPlusShow: true,// 二级菜单 添加按钮显示
|
||||
name: '',
|
||||
type: 'media',
|
||||
key: '',
|
||||
url: '',
|
||||
media_type: '',
|
||||
media_id: '',
|
||||
appid: '',
|
||||
pagepath: '',
|
||||
error_hint: '',
|
||||
picurl: '',
|
||||
text: '',
|
||||
graphic_message: [],
|
||||
position_x: '',
|
||||
position_y: '',
|
||||
change_active: true,
|
||||
},
|
||||
watch: {
|
||||
name: function (v, ov) {
|
||||
this.setValue('name', v);
|
||||
},
|
||||
type: function (v, ov) {
|
||||
if (ov == 'media') {
|
||||
this.setValue('media_type', 'text');
|
||||
this.media_type = 'text';
|
||||
}
|
||||
this.setValue('type', v);
|
||||
},
|
||||
key: function (v, ov) {
|
||||
this.setValue('key', v);
|
||||
},
|
||||
url: function (v, ov) {
|
||||
this.setValue('url', v);
|
||||
},
|
||||
media_id: function (v, ov) {
|
||||
this.setValue('media_id', v);
|
||||
},
|
||||
appid: function (v, ov) {
|
||||
this.setValue('appid', v);
|
||||
},
|
||||
pagepath: function (v, ov) {
|
||||
this.setValue('pagepath', v);
|
||||
},
|
||||
text: function (v, ov) {
|
||||
this.setValue('text', v);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addMenu: function () {
|
||||
var _self = this;
|
||||
var menuItem = {
|
||||
'name': '菜单名称',
|
||||
};
|
||||
var length = _self.button.length;
|
||||
_self.name = '菜单名称';
|
||||
_self.button.push(menuItem);
|
||||
_self.chooseMenu(length, -1);
|
||||
_self.setValue('type', 'media');
|
||||
_self.setValue('media_type', 'text');
|
||||
_self.media_type = 'text';
|
||||
_self.type = 'media';
|
||||
|
||||
},
|
||||
addSubMenu: function (index) {
|
||||
var menuItem, subMenuItem;
|
||||
var _self = this;
|
||||
if (_self.button[index].sub_button != undefined && _self.button[index].sub_button.length >= 5) {
|
||||
layer.msg('每个一级菜单最多包含5个子菜单');
|
||||
return false;
|
||||
}
|
||||
if (_self.button[index].sub_button == undefined || _self.button[index].sub_button.length == 0) {
|
||||
menuItem = {
|
||||
'name': _self.button[index].name,
|
||||
'sub_button': []
|
||||
};
|
||||
_self.button[index] = menuItem;
|
||||
}
|
||||
subMenuItem = {
|
||||
'name': '子菜单名称'
|
||||
};
|
||||
this.name = '子菜单名称';
|
||||
var second_index = this.button[index].sub_button.length;
|
||||
var subMenuLength = second_index + 1;
|
||||
_self.button[index].sub_button.push(subMenuItem);
|
||||
_self.subMenuPlusShow = subMenuLength >= 5 ? false : true;
|
||||
_self.chooseMenu(index, second_index);
|
||||
_self.setValue('type', 'media');
|
||||
_self.setValue('media_type', 'text');
|
||||
_self.type = 'media';
|
||||
_self.media_type = 'text';
|
||||
delete _self.button[index].type;
|
||||
delete _self.button[index].url;
|
||||
delete _self.button[index].key;
|
||||
delete _self.button[index].media_id;
|
||||
delete _self.button[index].appid;
|
||||
delete _self.button[index].pagepath;
|
||||
delete _self.button[index].media_type;
|
||||
delete _self.button[index].picurl;
|
||||
delete _self.button[index].text;
|
||||
delete _self.button[index].graphic_message;
|
||||
},
|
||||
// 选择 菜单,first_index = 一级菜单 0-2; second_index = 二级菜单下标 0-4
|
||||
chooseMenu: function (first_index, second_index) {
|
||||
var _self = this;
|
||||
var change_active = _self.change_active;
|
||||
if (change_active === false) {
|
||||
_self.change_active = true;
|
||||
return false;
|
||||
}
|
||||
_self.menuIndex = [first_index, second_index];
|
||||
if (_self.button[first_index].sub_button != undefined) {
|
||||
_self.subMenuPlusShow = _self.button[first_index].sub_button.length >= 5 ? false : true;
|
||||
} else {
|
||||
_self.subMenuPlusShow = true;
|
||||
}
|
||||
_self.initMenuInfo();
|
||||
},
|
||||
// 删除菜单
|
||||
deleteMenu: function () {
|
||||
var _self = this;
|
||||
var first_index = _self.menuIndex[0];
|
||||
var second_index = _self.menuIndex[1];
|
||||
|
||||
layer.open({
|
||||
title: '删除确认',
|
||||
content: '确定删除菜单 "' + _self.name + '"?',
|
||||
btn: ['确认', '关闭'],
|
||||
btn1: function () {
|
||||
_self.delMenu(first_index, second_index);
|
||||
},
|
||||
success: function (layero, index) {
|
||||
this.enterEsc = function (event) {
|
||||
if (event.keyCode === 13) {
|
||||
_self.delMenu(first_index, second_index);
|
||||
layer.close(index);
|
||||
return false; // 阻止系统默认事件
|
||||
} else if (event.keyCode === 27) {
|
||||
layer.close(index);
|
||||
return false; // 阻止系统默认事件
|
||||
}
|
||||
};
|
||||
$(document).on('keydown', this.enterEsc); // 监听键盘事件,关闭层
|
||||
},
|
||||
end: function () {
|
||||
$(document).off('keydown', this.enterEsc); // 解除键盘关闭事件
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseMediaType: function (type) {
|
||||
var _self = this;
|
||||
var first_index = _self.menuIndex[0];
|
||||
var second_index = _self.menuIndex[1];
|
||||
switch (type) {
|
||||
case 1 :
|
||||
_self.setValue('media_type', 'graphic_message');
|
||||
_self.media_type = 'graphic_message';
|
||||
break;
|
||||
case 2 :
|
||||
_self.setValue('media_type', 'picture');
|
||||
_self.media_type = 'picture';
|
||||
break;
|
||||
case 3 :
|
||||
_self.setValue('media_type', 'audio');
|
||||
_self.media_type = 'audio';
|
||||
break;
|
||||
case 4 :
|
||||
_self.setValue('media_type', 'video');
|
||||
_self.media_type = 'video';
|
||||
break;
|
||||
case 5 :
|
||||
_self.setValue('media_type', 'text');
|
||||
_self.media_type = 'text';
|
||||
break;
|
||||
}
|
||||
},
|
||||
material: function (type) {
|
||||
switch (type) {
|
||||
case 1 :
|
||||
material(1);
|
||||
break;
|
||||
case 2 :
|
||||
material(2);
|
||||
break;
|
||||
case 3 :
|
||||
break;
|
||||
case 4 :
|
||||
break;
|
||||
case 5 :
|
||||
material(5);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 添加素材
|
||||
addMaterial: function (type) {
|
||||
switch (type) {
|
||||
case 1 :
|
||||
window.open(ns.href("wechat://shop/material/add"));
|
||||
break;
|
||||
case 2 :
|
||||
uploadSingle();
|
||||
break;
|
||||
case 3 :
|
||||
break;
|
||||
case 4 :
|
||||
break;
|
||||
case 5 :
|
||||
addMaterial(5);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 删除素材
|
||||
deleteMaterial: function (type) {
|
||||
var _self = this;
|
||||
switch (type) {
|
||||
case 1 :
|
||||
_self.setValue('media_id', '');
|
||||
_self.setValue('graphic_message', []);
|
||||
_self.graphic_message = [];
|
||||
break;
|
||||
case 2 :
|
||||
_self.setValue('media_id', '');
|
||||
_self.setValue('picurl', '');
|
||||
_self.picurl = '';
|
||||
break;
|
||||
case 3 :
|
||||
break;
|
||||
case 4 :
|
||||
break;
|
||||
case 5 :
|
||||
_self.setValue('media_id', '');
|
||||
_self.setValue('text', '');
|
||||
_self.text = '';
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 预览图文
|
||||
preview: function (id, index = 0) {
|
||||
preview(id, index);
|
||||
},
|
||||
// 预览文本
|
||||
previewText: function (text) {
|
||||
previewText(text);
|
||||
},
|
||||
// 预览文本
|
||||
previewTexts: function (text) {
|
||||
var index = this.menuIndex[0];
|
||||
var subIndex = this.menuIndex[1];
|
||||
if(subIndex >= 0){
|
||||
previewTexts(text, this.button[index].sub_button[subIndex]['media_id'], index, subIndex, 2);
|
||||
}else{
|
||||
previewTexts(text, this.button[index]['media_id'], index, subIndex, 1);
|
||||
}
|
||||
},
|
||||
setValue: function (menu_key, menu_value) {
|
||||
var index = this.menuIndex[0];
|
||||
var subIndex = this.menuIndex[1];
|
||||
if (subIndex >= 0) {
|
||||
this.button[index].sub_button[subIndex][menu_key] = menu_value;
|
||||
} else {
|
||||
this.button[index][menu_key] = menu_value;
|
||||
}
|
||||
},
|
||||
initMenuInfo: function () {
|
||||
var _self = this;
|
||||
var index = _self.menuIndex[0];
|
||||
var subIndex = _self.menuIndex[1];
|
||||
var info;
|
||||
if (subIndex >= 0) {
|
||||
info = _self.button[index].sub_button[subIndex];
|
||||
} else {
|
||||
info = _self.button[index];
|
||||
}
|
||||
|
||||
_self.name = info.name ? info.name : '';
|
||||
_self.type = info.type ? info.type : '';
|
||||
_self.key = info.key ? info.key : '';
|
||||
_self.url = info.url ? info.url : '';
|
||||
_self.media_type = info.media_type ? info.media_type : '';
|
||||
_self.media_id = info.media_id ? info.media_id : '';
|
||||
_self.appid = info.appid ? info.appid : '';
|
||||
_self.pagepath = info.pagepath ? info.pagepath : '';
|
||||
_self.picurl = info.picurl ? info.picurl : '';
|
||||
_self.text = info.text ? info.text : '';
|
||||
_self.graphic_message = info.graphic_message ? info.graphic_message : [];
|
||||
|
||||
},
|
||||
// 执行删除
|
||||
delMenu: function (first_index, second_index) {
|
||||
var _self = this;
|
||||
if (second_index == -1) {
|
||||
var length = _self.button.length;
|
||||
_self.button.splice(first_index, 1);
|
||||
if (length == 1) {
|
||||
this.menuIndex[0] = -1;
|
||||
}
|
||||
first_index = first_index == length - 1 ? first_index - 1 : first_index;
|
||||
length = length - 1 <= 0 ? -1 : length;
|
||||
} else {
|
||||
var length = _self.button[first_index].sub_button.length;
|
||||
_self.button[first_index].sub_button.splice(second_index, 1);
|
||||
second_index = second_index == length - 1 ? second_index - 1 : second_index;
|
||||
if (length == 1) {
|
||||
_self.button[first_index].media_type = 'text';
|
||||
_self.button[first_index].type = 'media';
|
||||
}
|
||||
}
|
||||
layer.msg('成功删除菜单 "' + _self.name + '"', {icon: 1});
|
||||
if (length != -1) _self.chooseMenu(first_index, second_index);
|
||||
},
|
||||
// 加载自定义菜单
|
||||
loadMenu: function () {
|
||||
var _self = this;
|
||||
$.ajax({
|
||||
//TODO 有的客户服务器在加载了html页面后再相同地址请求数据会无法识别为json请求,所以加个数据做区分就不会有问题
|
||||
url: ns.url('wechat://shop/menu/menu', {type:'json'}),
|
||||
data: {},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code != 0) {
|
||||
layer.msg(res.message);
|
||||
}
|
||||
res = res.data;
|
||||
try {
|
||||
var data = {};
|
||||
if (res.value == '') return false;
|
||||
if (res.value.button == undefined || res.value.button == '' || res.value.button == null) {
|
||||
return false;
|
||||
}
|
||||
_self.button = res.value.button;
|
||||
_self.menuIndex[-1, -1];
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
layer.msg('加载失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存自定义菜单
|
||||
saveMenu: function () {
|
||||
var _self = this;
|
||||
var value = {};
|
||||
var json_data = {};
|
||||
var button = JSON.parse(JSON.stringify(_self.button));
|
||||
|
||||
if (!_self.verification(button)[0]) {
|
||||
return;
|
||||
}
|
||||
var button_backup = JSON.parse(JSON.stringify(button));
|
||||
value.button = button;
|
||||
value = JSON.stringify(value);
|
||||
|
||||
json_data.button = _self.dataProcessing(button_backup);
|
||||
json_data = JSON.stringify(json_data);
|
||||
$.ajax({
|
||||
url: ns.url("wechat://shop/menu/edit"),
|
||||
data: {value, json_data},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
},
|
||||
error: function (e) {
|
||||
layer.msg('保存失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
// 输入名称验证
|
||||
checkName: function (e, type = '') {
|
||||
var _self = this;
|
||||
var str = e.target.value;
|
||||
_self.error_hint = '';
|
||||
|
||||
if (str == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == 'sub_button') {
|
||||
var res = /^[a-zA-Z-0-9]{1,16}$/.test((str + '').replace(/[\u4e00-\u9fa5]/g, 'aa'));
|
||||
if (!res) {
|
||||
layer.msg('菜单名称不可超过8个汉字或16个字母');
|
||||
_self.error_hint = 'name';
|
||||
_self.name = subStringLen(_self.name, 16);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
var res = /^[a-zA-Z-0-9]{1,8}$/.test((str + '').replace(/[\u4e00-\u9fa5]/g, 'aa'));
|
||||
if (!res) {
|
||||
layer.msg('菜单名称不可超过4个汉字或8个字母');
|
||||
_self.error_hint = 'name';
|
||||
_self.name = subStringLen(_self.name, 8);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
verification: function (button, _times = 0) {
|
||||
var _self = this;
|
||||
var _flag = true;
|
||||
var _index = -1;
|
||||
var _arr = [];
|
||||
for (var index in button) {
|
||||
var value = button[index];
|
||||
if (value.sub_button == undefined || value.sub_button == null || value.sub_button.length == 0) {
|
||||
|
||||
if (value.name == '' || value.name == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请输入菜单名称');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.type == '' || value.type == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请选择菜单内容');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.type == 'view') {
|
||||
delete value.key;
|
||||
delete value.appid;
|
||||
delete value.pagepath;
|
||||
delete value.media_type;
|
||||
delete value.media_id;
|
||||
delete value.picurl;
|
||||
delete value.graphic_message;
|
||||
delete value.text;
|
||||
if (value.url == '' || value.url == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('页面地址不可为空');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.url.indexOf('https://') != 0 && value.url.indexOf('http://') != 0) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请输入 http:// 或 https:// 为前缀的有效地址');
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (value.type == 'miniprogram') {
|
||||
delete value.key;
|
||||
delete value.media_type;
|
||||
delete value.media_id;
|
||||
delete value.picurl;
|
||||
delete value.graphic_message;
|
||||
delete value.text;
|
||||
if (value.url == '' || value.url == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('备用网页不可为空');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.url.indexOf('https://') != 0 && value.url.indexOf('http://') != 0) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请输入 http:// 或 https:// 为前缀的有效地址');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.appid == '' || value.appid == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('小程序appid不可为空');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.pagepath == '' || value.pagepath == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('小程序页面路径不可为空');
|
||||
break;
|
||||
}
|
||||
} else if (value.type == 'media') {
|
||||
delete value.key;
|
||||
delete value.appid;
|
||||
delete value.pagepath;
|
||||
delete value.url;
|
||||
if (value.media_type == 'graphic_message') {
|
||||
delete value.picurl;
|
||||
delete value.text;
|
||||
if (value.graphic_message == undefined || value.graphic_message[0] == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('图文消息不可为空');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (value.media_type == 'picture') {
|
||||
delete value.graphic_message;
|
||||
delete value.text;
|
||||
if (value.picurl == undefined || value.picurl == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('图片素材不可为空');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (value.media_type == 'text') {
|
||||
delete value.picurl;
|
||||
delete value.graphic_message;
|
||||
if (value.text == '' || value.text == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('文本素材不可为空');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_index = index;
|
||||
_arr = _self.verification(value.sub_button, 1);
|
||||
if (!_arr[0]) {
|
||||
_flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_flag) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_times == 0 && !_flag) {
|
||||
if (_arr[0] != undefined && !_arr[0]) {
|
||||
_flag = false;
|
||||
_self.chooseMenu(_index, _arr[1]);
|
||||
} else {
|
||||
_self.chooseMenu(_index, -1);
|
||||
}
|
||||
}
|
||||
|
||||
return [_flag, _index, button];
|
||||
},
|
||||
//media 事件 转换为 click 事件
|
||||
dataProcessing: function (buttons) {
|
||||
var _self = this;
|
||||
for (var first_index in buttons) {
|
||||
if (first_index == 'indexOfElem' || first_index == 'removeElem') {
|
||||
delete buttons[first_index];
|
||||
continue;
|
||||
}
|
||||
if (buttons[first_index].sub_button == undefined || buttons[first_index].sub_button == null || buttons[first_index].sub_button.length == 0) {
|
||||
delete buttons[first_index].sub_button;
|
||||
if (buttons[first_index].type == 'media') {
|
||||
delete buttons[first_index].media_type;
|
||||
delete buttons[first_index].picurl;
|
||||
delete buttons[first_index].text;
|
||||
delete buttons[first_index].graphic_message;
|
||||
buttons[first_index].type = 'click';
|
||||
buttons[first_index].key = buttons[first_index].media_id;
|
||||
delete buttons[first_index].media_id;
|
||||
}
|
||||
} else {
|
||||
for (var second_index in buttons[first_index].sub_button) {
|
||||
if (buttons[first_index].sub_button[second_index].type == 'media') {
|
||||
delete buttons[first_index].sub_button[second_index].media_type;
|
||||
delete buttons[first_index].sub_button[second_index].picurl;
|
||||
delete buttons[first_index].sub_button[second_index].text;
|
||||
delete buttons[first_index].sub_button[second_index].graphic_message;
|
||||
buttons[first_index].sub_button[second_index].type = 'click';
|
||||
buttons[first_index].sub_button[second_index].key = buttons[first_index].sub_button[second_index].media_id;
|
||||
delete buttons[first_index].sub_button[second_index].media_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return buttons;
|
||||
},
|
||||
// 菜单拖拽移动
|
||||
// dragMove(e, index){
|
||||
// var _self = this;
|
||||
// var button = _self.button;
|
||||
// var menuIndex = _self.menuIndex;
|
||||
//
|
||||
// var length = button.length;
|
||||
//
|
||||
// if (length != undefined && length > 1) {
|
||||
// var odiv = e.target;
|
||||
// var disX = e.clientX;
|
||||
// var ele = $('.wx-menu-item-box-' + index);
|
||||
// // var min = 0 - index * 93.67;
|
||||
// // var max = 0 + (length - index - 1) * 93.67;
|
||||
// ele.css({'left': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = (e)=>{
|
||||
// var left = e.clientX - disX;
|
||||
// if (index == 0) {
|
||||
// if (left > 47 && left < 94) {
|
||||
// var new_item = button[index];
|
||||
// button[index] = button[index + 1];
|
||||
// button[index + 1] = new_item;
|
||||
// console.log(button);
|
||||
// console.log();
|
||||
// _self.button = button;
|
||||
// _self.menuIndex[0] = index + 1;
|
||||
// _self.initMenuInfo();
|
||||
// console.log(_self.button);
|
||||
// }
|
||||
// } else if (index == 1) {
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// ele.css({'left': left + 'px', 'z-index': 10});
|
||||
// if ((left > 5 || left < -5) && _self.change_active !== false) {
|
||||
// _self.change_active = false;
|
||||
// }
|
||||
// };
|
||||
// document.onmouseup = (e) => {
|
||||
// ele.css({'left': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = null;
|
||||
// document.onmouseup = null;
|
||||
// };
|
||||
// }
|
||||
// },
|
||||
// // 子菜单拖拽移动
|
||||
// dragMoveItem(e, second_index){
|
||||
// var _self = this;
|
||||
// var button = _self.button;
|
||||
// var menuIndex = _self.menuIndex;
|
||||
// var index = menuIndex[0];
|
||||
// var length = button[index].sub_button.length;
|
||||
// // var min = 0 - second_index * 50;
|
||||
// // var max = 0 + (length - second_index - 1) * 50;
|
||||
// if (length != undefined && length > 1) {
|
||||
// var odiv = e.target;
|
||||
// var disY = e.clientY;
|
||||
// var ele = $('.wx-sub-menu-item-' + second_index);
|
||||
// ele.css({'top': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = (e)=>{
|
||||
// var top = e.clientY - disY;
|
||||
// ele.css({'top': top, 'z-index': 10});
|
||||
// if ((top > 5 || top < -5) && _self.change_active !== false) {
|
||||
// _self.change_active = false;
|
||||
// }
|
||||
// };
|
||||
// document.onmouseup = (e) => {
|
||||
// ele.css({'top': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = null;
|
||||
// document.onmouseup = null;
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
},
|
||||
});
|
||||
|
||||
$(function () {
|
||||
setTimeout(function () {
|
||||
menu.loadMenu();
|
||||
}, 50)
|
||||
});
|
||||
|
||||
/**
|
||||
* 单图上传回调
|
||||
*
|
||||
* @param _data
|
||||
* @param _name
|
||||
*/
|
||||
function singleImageUploadSuccess(_data, _name) {
|
||||
if (_data.path != undefined) {
|
||||
layer.closeAll('page');
|
||||
loading_index = layer.load(2, {time: 10 * 1000});
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/add'),
|
||||
dataType: "JSON",
|
||||
data: {
|
||||
'type': 2,
|
||||
'path': _data.path,
|
||||
'title': _data.file_name
|
||||
},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
layer.close(loading_index);
|
||||
if (res.code == 0) {
|
||||
menu.setValue('media_id', 'MATERIAL_PICTURE_' + res.data);
|
||||
menu.setValue('picurl', ns.img(_data.path));
|
||||
menu.picurl = ns.img(_data.path);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片素材选择回调
|
||||
*/
|
||||
function materialPicCallBack(_data) {
|
||||
menu.setValue('media_id', 'MATERIAL_PICTURE_' + _data.file_id);
|
||||
menu.setValue('picurl', _data.path);
|
||||
menu.picurl = _data.path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图文选择回调
|
||||
* @param _data
|
||||
*/
|
||||
function chooseGraphicMessage(_data) {
|
||||
var graphic_message = new Array();
|
||||
for (var index in _data.value) {
|
||||
graphic_message[index] = {};
|
||||
graphic_message[index].title = _data.value[index].title;
|
||||
graphic_message[index].id = _data.id;
|
||||
}
|
||||
menu.setValue('media_id', 'MATERIAL_GRAPHIC_MESSAGE_' + _data.id);
|
||||
menu.setValue('graphic_message', graphic_message);
|
||||
menu.graphic_message = graphic_message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本选择回调
|
||||
*/
|
||||
function chooseTextMessage(_data) {
|
||||
menu.setValue('media_id', 'MATERIAL_TEXT_MESSAGE_' + _data.id);
|
||||
menu.setValue('text', _data.value.content);
|
||||
menu.text = _data.value.content;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文本回调
|
||||
*/
|
||||
function textMessageAddSuccess(_data) {
|
||||
menu.setValue('media_id', 'MATERIAL_TEXT_MESSAGE_' + _data.id);
|
||||
menu.setValue('text', _data.value.content);
|
||||
menu.text = _data.value.content;
|
||||
}
|
||||
|
||||
function subStringLen(str, len) {
|
||||
var regexp = /[^\x00-\xff]/g;
|
||||
if (str.replace(regexp, "aa").length <= len) {
|
||||
return str;
|
||||
}
|
||||
var m = Math.floor(len / 2);
|
||||
for (var i = m, j = str.length; i < j; i++) {
|
||||
if (str.substring(0, i).replace(regexp, "aa").length >= len) {
|
||||
return str.substring(0, i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
139
addon/wechat/shop/view/public/js/wx_qrcode.js
Executable file
@@ -0,0 +1,139 @@
|
||||
$(document).ready(function() {
|
||||
var fontSize = $("#font_size").val();
|
||||
$(".tdrag-name").css("fontSize", fontSize + 'px');
|
||||
|
||||
$(".tdrag-header").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
|
||||
$(".tdrag-logo").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
|
||||
$(".tdrag-code").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
|
||||
$(".tdrag-name").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
});
|
||||
|
||||
layui.use(['form', 'colorpicker'], function() {
|
||||
var form = layui.form,
|
||||
colorpicker = layui.colorpicker,
|
||||
repeat_flag = false; //防重复标识
|
||||
|
||||
/**
|
||||
* 监听保存
|
||||
*/
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
var field = data.field;
|
||||
if(field.is_logo_show == 'on'){
|
||||
field.is_logo_show = 1;
|
||||
}else{
|
||||
field.is_logo_show = 0;
|
||||
}
|
||||
field.header_left = $("#header").position().left;
|
||||
field.header_top = $("#header").position().top;
|
||||
field.name_left = $("#name").position().left;
|
||||
field.name_top = $("#name").position().top;
|
||||
field.logo_left = $("#logo").position().left;
|
||||
field.logo_top = $("#logo").position().top;
|
||||
field.code_left = $("#code").position().left;
|
||||
field.code_top = $("#code").position().top;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: field,
|
||||
dataType: 'JSON',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
location.hash = ns.hash("wechat://shop/wechat/qrcode");
|
||||
repeat_flag = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*/
|
||||
var posterWidth = 640, posterHeight = 1134;
|
||||
|
||||
var upload = new Upload({
|
||||
elem: '#background',
|
||||
auto: false,
|
||||
choose: function(obj) {
|
||||
obj.preview(function(index, file, result) {
|
||||
var img = new Image();
|
||||
img.onload = function() {
|
||||
if (posterWidth == img.width && posterHeight == img.height) {
|
||||
obj.upload(index, file);
|
||||
} else {
|
||||
layer.msg('海报尺寸必须为:' + posterWidth + 'px * ' + posterHeight + 'px');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
img.src = result;
|
||||
});
|
||||
},
|
||||
callback: function(res) {
|
||||
if (res.code >= 0) {
|
||||
$("#imgLogo").attr("src", ns.img(res.data.pic_path));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 文字颜色
|
||||
*/
|
||||
colorpicker.render({
|
||||
elem: '#font_color', //绑定元素
|
||||
color: default_color,
|
||||
done: function(color) {
|
||||
$(".tdrag-name").css("color", color);
|
||||
$("input[name='nick_font_color']").val(color);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听字体变化
|
||||
*/
|
||||
$("input[name=nick_font_size]").blur(function() {
|
||||
$("#name").css("fontSize", $(this).val() + "px");
|
||||
});
|
||||
|
||||
/**
|
||||
* 表单验证
|
||||
*/
|
||||
form.verify({
|
||||
int: function(value) {
|
||||
if (value == "") {
|
||||
return false;
|
||||
}
|
||||
if (value < 0 || !(value % 1 === 0)) {
|
||||
return '请输入大于0的整数'
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* 是否显示logo
|
||||
*/
|
||||
form.on('switch(logo)', function(data){
|
||||
if(data.elem.checked) {
|
||||
//开
|
||||
$('#logo').show();
|
||||
}else {
|
||||
//关
|
||||
$('#logo').hide();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function backWechatQrcode() {
|
||||
location.hash = ns.hash("wechat://shop/wechat/qrcode");
|
||||
}
|
||||
676
addon/wechat/shop/view/public/js/wx_replay.js
Executable file
@@ -0,0 +1,676 @@
|
||||
var form;
|
||||
layui.use('form', function() {
|
||||
form = layui.form;
|
||||
form.render();
|
||||
});
|
||||
|
||||
/**
|
||||
* 微信回复
|
||||
*/
|
||||
WxReplay = function (limit = 0, limits = []) {
|
||||
var _this = this;
|
||||
_this._dom = null;
|
||||
_this.eventFlg = true;
|
||||
_this.listCount = 0;
|
||||
_this.limit = limit == false ? 15 : limit;
|
||||
_this.limits = limit == false ? [15, 20, 50] : limits;
|
||||
|
||||
var page = 1;
|
||||
var hash_arr = getHashArr();
|
||||
$.each(hash_arr,function(index, itemobj){
|
||||
var item_arr = itemobj.split("=");
|
||||
if(item_arr.length == 2){
|
||||
switch(item_arr[0]){
|
||||
case "page":
|
||||
page = item_arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
_this.page = page;
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取关键词回复列表
|
||||
*/
|
||||
WxReplay.prototype.getData = function (d) {
|
||||
var _this = d._this;
|
||||
var page = _this.page;
|
||||
var limit = _this.limit;
|
||||
var rule_type = d.rule_type;
|
||||
var search_text = d.search_text == null ? {} : d.search_text;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/replay'),
|
||||
async: false,
|
||||
data: {"page": page, "limit": limit, "rule_type": rule_type, "search_text": search_text},
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
_this.listCount = data.data.count;
|
||||
_this.aD.addReplayList(data.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* layui分页
|
||||
*/
|
||||
WxReplay.prototype.pageInit = function (d) {
|
||||
var _this = d._this;
|
||||
|
||||
layui.use('laypage', function () {
|
||||
var laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'list_page',
|
||||
count: _this.listCount,
|
||||
limit: _this.limit,
|
||||
limits: _this.limits,
|
||||
layout: ns.get_page_param().layout,
|
||||
prev: '<i class="layui-icon layui-icon-left"></i>',
|
||||
next: '<i class="layui-icon layui-icon-right"></i>',
|
||||
curr: _this.page,
|
||||
jump: function (obj, first) {
|
||||
_this.limit = obj.limit;
|
||||
if (!first) {
|
||||
_this.page = obj.curr;
|
||||
_this.getData({_this: _this, "rule_type": 'KEYWORDS'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 事件操作
|
||||
* @param e 事件对象
|
||||
*/
|
||||
WxReplay.prototype.e = function (e) {
|
||||
try {
|
||||
//_this为replay对象 //_dom 为元素dom
|
||||
var _this = e.data._this;
|
||||
_this._dom = e.target;
|
||||
var eventFlg = _this.eventFlg;
|
||||
if (!eventFlg) return;
|
||||
_this.eventFlg = false;
|
||||
var _dom = e.target;
|
||||
var dataEvent = $(_dom).attr("nc-event");
|
||||
var dataAction = $(_dom).attr("nc-action");
|
||||
var type = e.type;
|
||||
if (dataEvent != type) {
|
||||
if ($(_dom).attr("nc-event2") != type) {
|
||||
_this.eventFlg = true;
|
||||
return;
|
||||
} else {
|
||||
dataEvent = $(_dom).attr("nc-event2");
|
||||
dataAction = $(_dom).attr("nc-action2");
|
||||
}
|
||||
}
|
||||
|
||||
var eventObj = null;
|
||||
switch (dataEvent) {
|
||||
case "click":
|
||||
eventObj = _this.clickEvent;
|
||||
break;
|
||||
case "mouseenter" :
|
||||
eventObj = _this.mouseenterEvent;
|
||||
break;
|
||||
case "mouseleave" :
|
||||
eventObj = _this.mouseleaveEvent;
|
||||
break;
|
||||
}
|
||||
if (eventObj) {
|
||||
|
||||
_this.evalFun(eventObj, dataAction, {"_this": _this});
|
||||
|
||||
_this.eventFlg = true;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
_this.eventFlg = true;
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
WxReplay.prototype.clickEvent = {
|
||||
click: function () {},
|
||||
|
||||
//添加回复
|
||||
addRule: function (d) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "新建自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_auto_replay").html(),
|
||||
success: function(layero, index) {
|
||||
$(layero).find("input[name='rule_id']").val(0);
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
editRule: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var ruke_name = $(_dom).attr('data-ruke_name');
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "修改自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_auto_replay").html(),
|
||||
success: function (layero, index) {
|
||||
$(layero).find("button[type='reset']").hide();
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='key_rule_name']").val(ruke_name);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
delRule: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "删除",
|
||||
offset: "auto",
|
||||
content: ' 确定要删除规则吗?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteRule'),
|
||||
data: {"rule_id": rule_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//添加关键词
|
||||
addKeywords: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "添加关键词",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_keywords").html(),
|
||||
success: function (layero, index) {
|
||||
form.render();
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//编辑关键词
|
||||
editKeywords: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var keyword_name = $(_dom).attr('keyword_name');
|
||||
var keywords_type = $(_dom).parent().find('.add-on').attr("keyword_type");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "添加关键词",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_keywords").html(),
|
||||
success: function (layero, index) {
|
||||
form.render();
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("input[name='keywords_name']").val(keyword_name);
|
||||
$(layero).find("input[name='keywords_type']").each(function (i, item) {
|
||||
if ($(item).val() == keywords_type) {
|
||||
$(item).prop('checked', true);
|
||||
form.render();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//删除关键词
|
||||
delKeywords: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "是否删除关键词",
|
||||
offset: "auto",
|
||||
content: ''
|
||||
, btn: ['保存', '返回']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteKeywords'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//添加一条回复
|
||||
addReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "添加自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero, index) {
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(".image,.voice").css("display", "inline-block");
|
||||
$(".image,.voice").next("span").css("display", "inline-block");
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$(layero).find("textarea[name='reply_content']").val("");
|
||||
},
|
||||
cancel: function(){
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
//编辑回复
|
||||
editReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var request_type = $(_dom).attr('type');
|
||||
$("#hidden_reply_type").val(request_type);
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "修改自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero, index) {
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("textarea[name='reply_content']").val(reply_content);
|
||||
|
||||
$(".voice").css("display", "none");
|
||||
$(".voice").next("span").css("display", "none");
|
||||
|
||||
if (request_type == 'image') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href=""><img src="' + ns.img(reply_content) + '" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'music') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="' + reply_content + '">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
|
||||
} else if (request_type == 'other') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + reply_content + '"><span class="label label-success">' + reply_content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'articles') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="" target="_blank" class="new-window" title="' + reply_content + '">' + reply_content + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else {
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
},
|
||||
cancel: function(){
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
//删除回复
|
||||
delReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "删除",
|
||||
offset: "auto",
|
||||
content: '确定删除该条回复吗?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteReply'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//音乐
|
||||
music: function (d) {
|
||||
$("#hidden_reply_type").val('music');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '音乐素材',
|
||||
area: ['850px'],
|
||||
offset: "auto",
|
||||
content: $("#music").html()
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 移入事件
|
||||
*/
|
||||
WxReplay.prototype.mouseenterEvent = {
|
||||
groupEnter: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
$(_dom).css({"border": "2px solid #333"});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 移出事件
|
||||
*/
|
||||
WxReplay.prototype.mouseleaveEvent = {};
|
||||
|
||||
/**
|
||||
* 执行传过来的方法
|
||||
* @param eventObj
|
||||
* @param funcName
|
||||
* @param d
|
||||
*/
|
||||
WxReplay.prototype.evalFun = function (eventObj, funcName, d = {}) {
|
||||
for (i in eventObj) {
|
||||
if (i == funcName) {
|
||||
eval(eventObj[i](d));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 元素操作 da(documentAction)
|
||||
*/
|
||||
WxReplay.prototype.aD = {
|
||||
|
||||
addReplayList: function (d) {
|
||||
var data = d.list;
|
||||
var html = '';
|
||||
$.each(data, function (i) {
|
||||
var d = data[i];
|
||||
html += '<div class="rule-group layui-row" data-rule_id="' + d.rule_id + '">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">' + d.rule_name + '</span><div class="rule-opts"><a href="javascript:;" class="js-edit-rule js-replay" nc-event="click" nc-action="editRule" data- data-id="' + d.rule_id + '" data-ruke_name="' + d.rule_name + '">编辑</a><span> - </span><a href="javascript:;" class="js-del-rule js-replay" data-id="' + d.rule_id + '" nc-event="click" nc-action="delRule">删除</a></div></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '<div class="long-dashed"></div>';
|
||||
html += '<div class="rule-keywords layui-col-md5">';
|
||||
html += '<div class="rule-inner"><h4>关键词:</h4>';
|
||||
html += '<div class="keyword-container">';
|
||||
if (d.key_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何关键字!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<div class="keyword-list">';//关键词列表
|
||||
if (d.key_list.length > 0) {
|
||||
for (i in d.key_list) {
|
||||
html += '<div class="keyword input-append" >';
|
||||
html += '<a href="javascript:;" class="close--circle js-replay" data-key_id="' + i + '" nc-event="click" nc-action="delKeywords">×</a>';//删除关键词
|
||||
html += '<span class="value js-replay" keyword_name="' + d.key_list[i].keywords_name + '" data-key_id="' + i + '" nc-event="click" nc-action="editKeywords">' + d.key_list[i].keywords_name + '</span>';
|
||||
if (d.key_list[i].keywords_type == 0) {
|
||||
html += '<span class="add-on" keyword_type="' + d.key_list[i].keywords_type + '"> 全匹配</span>';
|
||||
} else {
|
||||
html += '<span class="add-on" keyword_type="' + d.key_list[i].keywords_type + '"> 模糊</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed"/>';
|
||||
html += '<div class="opt">';
|
||||
html += '<a href="javascript:;" class="js-add-keyword js-replay" nc-event="click" nc-action="addKeywords">+ 添加关键词</a>'; //添加关键词
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md7">';
|
||||
html += '<div class="rule-inner">';
|
||||
html += '<h4>自动回复: <span class="send-method">随机发送</span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
if (d.replay_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<ol class="reply-list">';
|
||||
|
||||
if (d.replay_list.length > 0) {
|
||||
for (j in d.replay_list) {
|
||||
|
||||
html += '<li>';//回复列表
|
||||
html += '<div class="reply-cont">';
|
||||
html += '<div class="reply-summary">';
|
||||
if (d.replay_list[j].type == 'text') {
|
||||
html += '<span class="label label-success">文本</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'image') {
|
||||
html += '<span class="label"><img src="' + ns.img(d.replay_list[j].reply_content) + '" alt=""/></span>';
|
||||
} else if (d.replay_list[j].type == 'music') {
|
||||
html += '<div class="voice-wrapper" data-voice-src="' + d.replay_list[j].reply_content + '">';
|
||||
html += '<span class="voice-player">';
|
||||
html += '<span class="stop">点击播放</span>';
|
||||
html += '<span class="second" style="display: block;"></span>';
|
||||
html += '<i class="play" style="display:none;"></i>';
|
||||
html += '</span>';
|
||||
html += '</div>';
|
||||
} else if (d.replay_list[j].type == 'other') {
|
||||
html += '<span class="label label-success">' + d.replay_list[j].reply_content + '</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'articles') {
|
||||
html += '<span class="label label-success">图文</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="reply-opts">';
|
||||
var reply_content_to = d.replay_list[j].reply_content.replace(/"/g, "'");
|
||||
html += '<a class="js-edit-it js-replay" href="javascript:;" reply_content="' + reply_content_to + '" data-key_id="' + j + '" type="' + d.replay_list[j].type + '" nc-event="click" nc-action="editReply">编辑</a> - ';
|
||||
html += '<a class="js-delete-it js-replay" href="javascript:;" data-key_id="' + j + '" nc-event="click" nc-action="delReply">删除</a>';
|
||||
html += '</div>';
|
||||
html += '</li>';
|
||||
|
||||
}
|
||||
}
|
||||
html += '</ol>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed"/>';
|
||||
html += '<div class="opt">';
|
||||
if (d.replay_list.length < 10) {
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">+ 添加一条回复</a>';
|
||||
} else {
|
||||
html += '<span class="disable-opt hide">最多十条回复</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
});
|
||||
|
||||
if (d.count > 0) {
|
||||
$("#load_rule_list").html(html);
|
||||
} else {
|
||||
html = '<div class="empty">暂无数据!</div>';
|
||||
$("#load_rule_list").html(html);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
WxReplay.prototype.sendAjax = function (param = {}) {
|
||||
var d = $.extend({
|
||||
"url": '',
|
||||
"type": "post",
|
||||
"data": {},
|
||||
"async": true,
|
||||
"success": ''
|
||||
}, param);
|
||||
try {
|
||||
$.ajax({
|
||||
url: d.url,
|
||||
type: d.type,
|
||||
data: d.data,
|
||||
async: d.async,
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (typeof (d.success) == "function") {
|
||||
d.success(res);
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
//其他
|
||||
$(".dropdown-menu li").click(function () {
|
||||
$("#hidden_reply_type").val('other');
|
||||
var title = $(this).text();
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="javascript:;" class="new-window" title="' + title + '"><span class="label label-success">' + title + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="javascript:;" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(title);
|
||||
$("span.pull-right").hide();
|
||||
|
||||
});
|
||||
|
||||
//插入链接
|
||||
function hyperlink (d) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#hyperlink").html(),
|
||||
success: function(layero) {
|
||||
}
|
||||
});
|
||||
}
|
||||
292
addon/wechat/shop/view/replay/default.html
Executable file
@@ -0,0 +1,292 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_follow.css">
|
||||
|
||||
<div class="weixin-normal rule-autoreplay-page">
|
||||
<div id="load_rule_list"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="add_reply">
|
||||
<!--添加回复-->
|
||||
<div class="layui-form rule-container">
|
||||
<input type="hidden" name="layer_index" value="">
|
||||
<input type="hidden" name="rule_id" value="">
|
||||
<input type="hidden" name="key_id" value="-1">
|
||||
<!-- <div class="arrow"><i class="layui-icon"></i></div> -->
|
||||
<span class="add_reply-top"></span>
|
||||
<!--<a href="javascript:;" class="close--circle js-close">×</a>-->
|
||||
<div>
|
||||
<div class="misc">
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="emotion">表情</a> -->
|
||||
<a href="javascript:hyperlink();" class="js-replay">插入链接</a>
|
||||
<a href="javascript:;" class="image" onclick="material(5);">文本消息</a>
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="music">音乐</a> -->
|
||||
<a href="javascript:;" class="js-replay" onclick="material(1);">选择图文</a>
|
||||
<!--<div class="others">-->
|
||||
<!--<a href="javascript:;">其他<i class="caret"></i></a>-->
|
||||
<!--<ul class="dropdown-menu">-->
|
||||
<!--{volist name="link_list" id="vo"}-->
|
||||
<!--<li><a class="js-open-goods" data-action-type="{$vo.name}" data-complex-mode="true" href="javascript:;">{$vo.title}</a></li>-->
|
||||
<!--{/volist}-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea reply-content" name="reply_content" maxlength="300" lay-verify="required|content" ></textarea>
|
||||
<div class="complex-backdrop">
|
||||
<div class="complex-content"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-block" style="margin-top:10px;margin-left: 0;">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_reply">确定</button>
|
||||
<span class="pull-right">还能输入 <i>300</i> 个字</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="" id="hidden_reply_type"/>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="hyperlink">
|
||||
<!-- 插入链接 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" lay-verify="required|title" autocomplete="off" placeholder="http://" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit lay-filter="hyperlink">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="music">
|
||||
<!-- 音乐素材 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label msg-music-thumb"><a href="javascript:;" class="js-replay" nc-event="click" nc-action="thumbnail"><i class="layui-icon"></i></a></label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="title" placeholder="音乐标题" autocomplete="off" class="layui-input" lay-verify="required|title" style="margin-bottom: 10px;">
|
||||
<textarea placeholder="音乐描述" class="layui-textarea" name="description" maxlength="300" lay-verify="required|description" ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">普通音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">高清音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="hq_music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit lay-filter="music" style="float: right; margin-right: 10px;">确定</button>
|
||||
</div>
|
||||
<input type="hidden" name="thumb_attachment_id" value="">
|
||||
</div>
|
||||
</script>
|
||||
<script type='text/javascript' src='WECHAT_JS/wx_default.js'></script>
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var replay = new WxReplay(3,[3,6,9]);
|
||||
replay.getData({"_this": replay, "rule_type": 'AFTER'});//数据初始化
|
||||
replay.pageInit({"_this": replay});//分页初始化
|
||||
// $(".js-replay").bind("click", {"_this": replay}, replay.e); //元素事件
|
||||
$(".rule-autoreplay-page,.replay-button").delegate(".js-replay","click",{"_this": replay},replay.e);
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form;
|
||||
|
||||
//添加和修改回复
|
||||
form.on('submit(add_reply)', function (data) {
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var reply_content = $.trim(d.reply_content);
|
||||
var layer_index = d.layer_index;
|
||||
var type = $("#hidden_reply_type").val() ? $("#hidden_reply_type").val() : "text";
|
||||
|
||||
var param = {
|
||||
url: ns.url('wechat://shop/replay/editReplays'),
|
||||
data: {"rule_id": rule_id,"reply_content":reply_content, "key_id":key_id, "type" : type,"replay_type":"default"},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//插入链接 确定
|
||||
form.on('submit(hyperlink)', function (data, index) {
|
||||
var d = data.field;
|
||||
var url = d.title;
|
||||
if (url.indexOf('http://') == -1 && url.indexOf('https://') == -1) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
|
||||
var textarea = $(".reply-content").val();
|
||||
if(textarea.indexOf("href") != -1){
|
||||
|
||||
var num_1 = textarea.indexOf("'");
|
||||
var num_2 = textarea.indexOf("'", num_1 + 1);
|
||||
var text = textarea.slice(num_1 + 1 ,num_2);
|
||||
var value = textarea.replace(text, url);
|
||||
|
||||
}else{
|
||||
var value = "<a href='"+ url +"'>"+ textarea +"</a>";
|
||||
}
|
||||
|
||||
$("textarea[name='reply_content']").val(value);
|
||||
layer.close(layer.index);
|
||||
});
|
||||
|
||||
//音乐 确定
|
||||
form.on('submit(music)', function (data, index) {
|
||||
var d = data.field;
|
||||
var thumb_attachment_id = d.thumb_attachment_id;
|
||||
var title = d.title;
|
||||
var description = d.description;
|
||||
var music_url = d.music_url;
|
||||
var hq_music_url = d.hq_music_url;
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="'+music_url+'">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(music_url);
|
||||
|
||||
layer.close(layer.index);
|
||||
});
|
||||
});
|
||||
|
||||
//关闭 清除
|
||||
$(".js-close").click(function(){
|
||||
$("textarea[name='reply_content']").val();
|
||||
$('.complex-backdrop').css("display","none");
|
||||
$(".layui-layer-shade").remove();
|
||||
});
|
||||
|
||||
//清除
|
||||
$("body").off('click',".js-delete-complex").on('click',".js-delete-complex",function(){
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$('.complex-backdrop').css("display","none");
|
||||
});
|
||||
});
|
||||
|
||||
//音乐回调
|
||||
function albumUploadSuccess(o,name){
|
||||
$("#hidden_reply_type").val('image');
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href=""><img src="'+nc.img(o[0]['small_pic_path'])+'" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(o[0]['small_pic_path']);
|
||||
}
|
||||
|
||||
//图文回调
|
||||
function chooseGraphicMessage(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="new-window" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value[0].title);
|
||||
$("#hidden_reply_type").val('articles');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
function chooseTextMessage(data){
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">文 本</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value.content+'">' + data.value.content + '</a>';
|
||||
active_pic += '</div>';
|
||||
// active_pic += '<a href="h" target="_blank" class="new-window" title="' + data.value.content + '"><span class="label label-success">' + data.value.content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value.content);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('text');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//弹出框的位置
|
||||
$("body").off('click',".add-reply-menu").on('click',".add-reply-menu",function(){
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = 16;
|
||||
var real_y = 72;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var m = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(m);
|
||||
$('.rule-container .arrow').css('right', 'auto');
|
||||
$('.rule-container .arrow').css('left', '-13px');
|
||||
|
||||
$('.pull-right').find('i').text(300);
|
||||
});
|
||||
|
||||
//编辑弹出框的位置
|
||||
$("body").off('click',".js-edit-it").on('click',".js-edit-it",function(){
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = x + 78;
|
||||
var real_y = y;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('right', real_y);
|
||||
|
||||
var s = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(s);
|
||||
$('.rule-container .arrow').css('left', 'auto');
|
||||
$('.rule-container .arrow').css('right', 3);
|
||||
|
||||
var text_leng = $('.rule-container').find(".layui-textarea").val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
$("body").off('keydown',".layui-textarea").on('keydown',".layui-textarea",function(){
|
||||
var text_leng = $(this).val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
})
|
||||
</script>
|
||||
332
addon/wechat/shop/view/replay/follow.html
Executable file
@@ -0,0 +1,332 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_follow.css">
|
||||
|
||||
<div class="weixin-normal rule-autoreplay-page">
|
||||
<div id="load_rule_list"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="add_reply">
|
||||
<!--添加回复-->
|
||||
<div class="layui-form rule-container">
|
||||
<input type="hidden" name="layer_index" value="">
|
||||
<input type="hidden" name="rule_id" value="">
|
||||
<input type="hidden" name="key_id" value="-1">
|
||||
<!--<div class="arrow"><i class="layui-icon"></i></div>-->
|
||||
<!--<a href="javascript:;" class="close--circle js-close">×</a>-->
|
||||
<div>
|
||||
<div class="misc">
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="emotion">表情</a> -->
|
||||
<a href="javascript:hyperlink();" class="js-replay">插入链接</a>
|
||||
<a href="javascript:;" class="image" onclick="material(5);">文本消息</a>
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="music">音乐</a> -->
|
||||
<a href="javascript:;" class="js-replay" onclick="material(1);">选择图文</a>
|
||||
<!--<div class="others">-->
|
||||
<!--<a href="javascript:;">其他<i class="caret"></i></a>-->
|
||||
<!--<ul class="dropdown-menu">-->
|
||||
<!--{volist name="link_list" id="vo"}-->
|
||||
<!--<li><a class="js-open-goods" data-action-type="{$vo.name}" data-complex-mode="true" href="javascript:;">{$vo.title}</a></li>-->
|
||||
<!--{/volist}-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea" name="reply_content" maxlength="300" lay-verify="required|content" ></textarea>
|
||||
<div class="complex-backdrop">
|
||||
<div class="complex-content"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-block" style="margin-top:10px;margin-left: 0;">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_reply">确定</button>
|
||||
<span class="pull-right">还能输入 <i>300</i> 个字</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="" id="hidden_reply_type"/>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="hyperlink">
|
||||
<!-- 插入链接 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item" style="margin-bottom:0;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" lay-verify="required|title" autocomplete="off" placeholder="http://" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit lay-filter="hyperlink">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="music">
|
||||
<!-- 音乐素材 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label msg-music-thumb"><a href="javascript:;" class="js-replay" nc-event="click" nc-action="thumbnail"><i class="layui-icon"></i></a></label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="title" placeholder="音乐标题" autocomplete="off" class="layui-input" lay-verify="required|title" style="margin-bottom: 10px;">
|
||||
<textarea placeholder="音乐描述" class="layui-textarea" name="description" maxlength="300" lay-verify="required|description" ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">普通音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">高清音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="hq_music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit lay-filter="music" style="float: right; margin-right: 10px;">确定</button>
|
||||
</div>
|
||||
<input type="hidden" name="thumb_attachment_id" value="">
|
||||
</div>
|
||||
</script>
|
||||
<script type='text/javascript' src='WECHAT_JS/wx_follow.js'></script>
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$.fn.extend({
|
||||
insertAtCaret: function(myValue, type){
|
||||
var $t=$(this)[0];
|
||||
if (document.selection) {
|
||||
this.focus();
|
||||
sel = document.selection.createRange();
|
||||
sel.text = myValue;
|
||||
this.focus();
|
||||
}
|
||||
else
|
||||
if ($t.selectionStart || $t.selectionStart == '0') {
|
||||
|
||||
var startPos = $t.selectionStart;
|
||||
var endPos = $t.selectionEnd;
|
||||
var scrollTop = $t.scrollTop;
|
||||
if(type == 'url'){
|
||||
if($t.value.substring(0, startPos).indexOf("href") != -1){
|
||||
|
||||
var num_1 = $t.value.substring(0, startPos).indexOf("'");
|
||||
var num_2 = $t.value.substring(0, startPos).indexOf("'", num_1 + 1);
|
||||
var text = $t.value.substring(0, startPos).slice(num_1 + 1 ,num_2);
|
||||
$t.value = $t.value.substring(0, startPos).replace(text, myValue);
|
||||
|
||||
}else{
|
||||
$t.value = "<a href='"+ myValue +"'>"+ $t.value.substring(0, startPos) +"</a>";
|
||||
}
|
||||
}
|
||||
// $t.value = $t.value.substring(0, startPos) + myValue + $t.value.substring(endPos, $t.value.length);
|
||||
|
||||
this.focus();
|
||||
$t.selectionStart = startPos + myValue.length;
|
||||
$t.selectionEnd = startPos + myValue.length;
|
||||
$t.scrollTop = scrollTop;
|
||||
}
|
||||
else {
|
||||
this.value += myValue;
|
||||
this.focus();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
var replay = new WxReplay(3,[3,6,9]);
|
||||
replay.getData({"_this": replay, "rule_type": 'AFTER'});//数据初始化
|
||||
replay.pageInit({"_this": replay});//分页初始化
|
||||
// $(".js-replay").bind("click", {"_this": replay}, replay.e); //元素事件
|
||||
$(".rule-autoreplay-page,.replay-button").delegate(".js-replay","click",{"_this": replay},replay.e);
|
||||
//form 操作模块
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form;
|
||||
|
||||
//添加和修改回复
|
||||
form.on('submit(add_reply)', function (data) {
|
||||
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var reply_content = $.trim(d.reply_content);
|
||||
var layer_index = d.layer_index;
|
||||
var type = $("#hidden_reply_type").val() ? $("#hidden_reply_type").val() : "text";
|
||||
|
||||
var param = {
|
||||
url: ns.url('wechat://shop/replay/editReplays'),
|
||||
data: {"rule_id": rule_id,"reply_content":reply_content, "key_id":key_id, "type" : type,"replay_type":"follow"},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//插入链接 确定
|
||||
form.on('submit(hyperlink)', function (data, index) {
|
||||
var d = data.field;
|
||||
var url = d.title;
|
||||
if (url.indexOf('http://') == -1 && url.indexOf('https://') == -1) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
var textarea = $("textarea[name='reply_content']").val();
|
||||
if(textarea.indexOf("href") != -1){
|
||||
|
||||
var num_1 = textarea.indexOf("'");
|
||||
var num_2 = textarea.indexOf("'", num_1 + 1);
|
||||
var text = textarea.slice(num_1 + 1 ,num_2);
|
||||
var value = textarea.replace(text, url);
|
||||
|
||||
}else{
|
||||
var value = "<a href='"+ url +"'>"+ textarea +"</a>";
|
||||
}
|
||||
|
||||
$("textarea[name='reply_content']").val(value);
|
||||
layer.close(layer.index);
|
||||
});
|
||||
|
||||
//音乐 确定
|
||||
form.on('submit(music)', function (data, index) {
|
||||
var d = data.field;
|
||||
var thumb_attachment_id = d.thumb_attachment_id;
|
||||
var title = d.title;
|
||||
var description = d.description;
|
||||
var music_url = d.music_url;
|
||||
var hq_music_url = d.hq_music_url;
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="'+music_url+'">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(music_url);
|
||||
|
||||
layer.close(layer.index);
|
||||
});
|
||||
});
|
||||
|
||||
//关闭 清除
|
||||
$(".js-close").click(function(){
|
||||
$("textarea[name='reply_content']").val();
|
||||
$('.complex-backdrop').css("display","none");
|
||||
$(".layui-layer-shade").remove();
|
||||
});
|
||||
|
||||
//清除
|
||||
$("body").off('click',".js-delete-complex").on('click',".js-delete-complex",function(){
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$('.complex-backdrop').css("display","none");
|
||||
});
|
||||
});
|
||||
|
||||
//音乐回调
|
||||
function albumUploadSuccess(o,name){
|
||||
$("#hidden_reply_type").val('image');
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href=""><img src="'+nc.img(o[0]['small_pic_path'])+'" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(o[0]['small_pic_path']);
|
||||
}
|
||||
|
||||
//图文回调
|
||||
function chooseGraphicMessage(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="new-window" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value[0].title);
|
||||
$("#hidden_reply_type").val('articles');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
function chooseTextMessage(data){
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">文 本</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value.content+'">' + data.value.content + '</a>';
|
||||
active_pic += '</div>';
|
||||
// active_pic += '<a href="h" target="_blank" class="new-window" title="' + data.value.content + '"><span class="label label-success">' + data.value.content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value.content);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('text');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//弹出框的位置
|
||||
$("body").off('click',".add-reply-menu").on('click',".add-reply-menu",function(){
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = 16;
|
||||
var real_y = 72;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var m = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(m);
|
||||
$('.rule-container .arrow').css('right', 'auto');
|
||||
$('.rule-container .arrow').css('left', '-13px');
|
||||
|
||||
$('.pull-right').find('i').text(300);
|
||||
});
|
||||
|
||||
//编辑弹出框的位置
|
||||
$("body").off('click',".js-edit-it").on('click',".js-edit-it",function(){
|
||||
var x = $(this).position().top;
|
||||
var real_x = x;
|
||||
var real_y = 85;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('right', real_y);
|
||||
|
||||
var s = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(s);
|
||||
$('.rule-container .arrow').css('left', 'auto');
|
||||
$('.rule-container .arrow').css('right', 3);
|
||||
|
||||
var text_leng = $('.rule-container').find(".layui-textarea").val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
$("body").off('keydown',".layui-textarea").on('keydown',".layui-textarea",function(){
|
||||
var text_leng = $(this).val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
})
|
||||
</script>
|
||||
461
addon/wechat/shop/view/replay/replay.html
Executable file
@@ -0,0 +1,461 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_replay.css">
|
||||
<style>
|
||||
.layui-layout-admin .single-filter-box{padding-bottom: 0;}
|
||||
</style>
|
||||
|
||||
<div class="keyword-content">
|
||||
<div class="single-filter-box">
|
||||
<div class='info'>
|
||||
<button class='add-replay js-replay layui-btn' type="button" nc-event="click" nc-action="addRule">新建自动回复</button>
|
||||
</div>
|
||||
<div class="layui-form">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="rule_name" id="search_text" placeholder="请输入规则" class="layui-input">
|
||||
<button type="button" class="layui-btn layui-btn-primary" onclick="search()">
|
||||
<i class="layui-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="weixin-normal rule-autoreplay-page">
|
||||
<div id="load_rule_list" class="rule-group-container"></div>
|
||||
<div id="list_page" style="text-align: right;"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="add_auto_replay">
|
||||
<!--添加一条规则-->
|
||||
<div class="layui-form">
|
||||
<input type="hidden" name="layer_index" value="">
|
||||
<input type="hidden" name="rule_id" value="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm"><span class="required">*</span>规则名称</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="key_rule_name" placeholder="关键字回复规格名称" autocomplete="off" class="layui-input" required lay-verify="required"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_rule_replay">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="add_keywords">
|
||||
<!--添加关键字-->
|
||||
<div class="layui-form">
|
||||
<input type="hidden" name="layer_index" value=""/>
|
||||
<input type="hidden" name="rule_id" value=""/>
|
||||
<input type="hidden" name="key_id" value="-1"/>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label sm">关键字</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="keywords_name" placeholder="关键词最多支持15个字" autocomplete="off" class="layui-input" required lay-verify="required|length"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">规则</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="keywords_type" value="0" title="全匹配" checked/>
|
||||
<input type="radio" name="keywords_type" value="1" title="模糊"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_keywords">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="add_reply">
|
||||
<!--添加回复-->
|
||||
<div class="layui-form rule-container">
|
||||
<input type="hidden" name="layer_index" value=""/>
|
||||
<input type="hidden" name="rule_id" value=""/>
|
||||
<input type="hidden" name="key_id" value="-1"/>
|
||||
<input type="hidden" value="" id="hidden_reply_type" />
|
||||
<input type="hidden" value="" id="hidden_media_id" />
|
||||
<!--<div class="arrow">-->
|
||||
<!--<i class="layui-icon"></i>-->
|
||||
<!--</div>-->
|
||||
<!--<a href="javascript:;" class="close--circle js-close">×</a>-->
|
||||
<div>
|
||||
<div class="misc">
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="emotion">表情</a> -->
|
||||
<a href="javascript:hyperlink();" class="js-replay">插入链接</a>
|
||||
<a href="javascript:;" class="image" onclick="material(5);">文本消息</a>
|
||||
<!-- <a href="javascript:;" class="voice" onclick="chooseMaterial(3);">音频</a> -->
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="music">音乐</a> -->
|
||||
<a href="javascript:;" class="js-replay" onclick="material(1);">选择图文</a>
|
||||
<!--<div class="others">-->
|
||||
<!--<a href="javascript:;">其他<i class="caret"></i></a>-->
|
||||
<!--<ul class="dropdown-menu">-->
|
||||
<!--{volist name="link_list" id="vo"}-->
|
||||
<!--<li>-->
|
||||
<!--<a class="js-open-goods" data-action-type="{$vo.name}" data-complex-mode="true" href="javascript:;">{$vo.title}</a>-->
|
||||
<!--</li>-->
|
||||
<!--{/volist}-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea" name="reply_content" maxlength="300" lay-verify="required|content"></textarea>
|
||||
<div class="complex-backdrop">
|
||||
<div class="complex-content"></div>
|
||||
</div>
|
||||
<div class="layui-input-block" style="margin-top: 10px; margin-left: 0;">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_reply">确定</button>
|
||||
<span class="pull-right">还能输入 <i>300</i> 个字 </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="hyperlink">
|
||||
<!-- 插入链接 -->
|
||||
<div class="layui-form hyperlink">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" onkeyup="value=value.replace(/[\u4e00-\u9fa5]/ig,'')" lay-verify="required|title" autocomplete="off" placeholder="http://" class="layui-input"/>
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" lay-submit lay-filter="hyperlink">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="music">
|
||||
<!-- 音乐素材 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label msg-music-thumb">
|
||||
<a href="javascript:chooseMaterial(2);" class="js-replay" nc-event="click" nc-action="thumbnail">
|
||||
<i class="layui-icon"></i>
|
||||
</a>
|
||||
</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="title" placeholder="音乐标题" autocomplete="off" class="layui-input" lay-verify="required|title" style="margin-bottom: 10px;"/>
|
||||
<textarea placeholder="音乐描述" class="layui-textarea" name="description" maxlength="300" lay-verify="required|description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">普通音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">高清音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="hq_music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit lay-filter="music" style="float: right; margin-right: 10px;">确定</button>
|
||||
</div>
|
||||
<input type="hidden" name="thumb_attachment_id" value=""/>
|
||||
</div>
|
||||
</script>
|
||||
<script type='text/javascript' src='WECHAT_JS/wx_replay.js'></script>
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var replay = new WxReplay(3, [ 3, 6, 9 ]);
|
||||
replay.getData({
|
||||
"_this" : replay,
|
||||
"rule_type" : 'KEYWORDS'
|
||||
});//数据初始化
|
||||
replay.pageInit({
|
||||
"_this" : replay
|
||||
});//分页初始化
|
||||
// $(".js-replay").bind("click", {"_this": replay}, replay.e); //元素事件
|
||||
$(".rule-autoreplay-page,.info").delegate(".js-replay", "click", {
|
||||
"_this" : replay
|
||||
}, replay.e);
|
||||
|
||||
layui .use([ 'form' ], function() {
|
||||
var form = layui.form;
|
||||
|
||||
//添加关键字回复
|
||||
form.on('submit(add_rule_replay)', function(data) {
|
||||
var d = data.field;
|
||||
var dom = data.form;
|
||||
var rule_id = d.rule_id;
|
||||
var rule_name = $.trim(d.key_rule_name); //关键词名称
|
||||
var layer_index = d.layer_index;
|
||||
var param = {
|
||||
url : ns.url('wechat://shop/replay/addOrEditRule'),
|
||||
data : {
|
||||
"rule_name" : rule_name,
|
||||
"rule_id" : rule_id
|
||||
},
|
||||
success : function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
$(dom).find('button[type="reset"]').click();
|
||||
|
||||
replay.getData({
|
||||
"_this" : replay,
|
||||
"rule_type" : 'KEYWORDS'
|
||||
});//数据初始化
|
||||
replay.pageInit({
|
||||
"_this" : replay
|
||||
});//分页初始化
|
||||
|
||||
layer.close(layer_index);
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//添加关键字
|
||||
form.on('submit(add_keywords)', function(data) {
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var keywords_name = $.trim(d.keywords_name);
|
||||
var keywords_type = d.keywords_type;
|
||||
var layer_index = d.layer_index;
|
||||
form.verify({
|
||||
length : function(val, dom) {
|
||||
if (val.length > 15) {
|
||||
layer.msg("关键词最多支持15个字");
|
||||
}
|
||||
}
|
||||
});
|
||||
var param = {
|
||||
url : ns.url('wechat://shop/replay/editKeywords'),
|
||||
data : {
|
||||
"rule_id" : rule_id,
|
||||
"keywords_name" : keywords_name,
|
||||
"keywords_type" : keywords_type,
|
||||
"key_id" : key_id
|
||||
},
|
||||
success : function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//添加和修改回复
|
||||
form.on('submit(add_reply)', function(data) {
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var reply_content = $.trim(d.reply_content);
|
||||
var layer_index = d.layer_index;
|
||||
var type = $("#hidden_reply_type").val() ? $("#hidden_reply_type").val() : "text";
|
||||
var media_id = $('#hidden_media_id').val();
|
||||
|
||||
var param = {
|
||||
url : ns.url('wechat://shop/replay/editReplays'),
|
||||
data : {
|
||||
"rule_id" : rule_id,
|
||||
"reply_content" : reply_content,
|
||||
"key_id" : key_id,
|
||||
"type" : type,
|
||||
'media_id' : media_id
|
||||
},
|
||||
success : function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
$('#hidden_media_id').val('');
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//插入链接 确定
|
||||
form.on('submit(hyperlink)', function(data, index) {
|
||||
var d = data.field;
|
||||
var url = d.title;
|
||||
if (url.indexOf('http://') == -1 & url.indexOf('https://') == -1) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
var content = $("textarea[name='reply_content']").val();
|
||||
$("textarea[name='reply_content']").val(content + url);
|
||||
var text_leng = (content + url).length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
layer.close(layer.index);
|
||||
});
|
||||
|
||||
//音乐 确定
|
||||
form.on('submit(music)', function(data, index) {
|
||||
var d = data.field;
|
||||
var thumb_attachment_id = d.thumb_attachment_id;
|
||||
var title = d.title;
|
||||
var description = d.description;
|
||||
var music_url = d.music_url;
|
||||
var hq_music_url = d.hq_music_url;
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="'+music_url+'">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(music_url);
|
||||
$("#hidden_reply_type").val('music');
|
||||
layer.close(layer.index);
|
||||
});
|
||||
});
|
||||
|
||||
//关闭 清除
|
||||
$(".js-close").click(function() {
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
});
|
||||
|
||||
//清除
|
||||
$("body").off('click', ".js-delete-complex").on('click', ".js-delete-complex", function() {
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$("span.pull-right").show();
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//图片回调
|
||||
function materialPicCallBack(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href="'+data['url']+'"><img src="' + ns.img(data['path']) + '" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("span.pull-right").hide();
|
||||
$("textarea[name='reply_content']").val(data['path']);
|
||||
$("#hidden_reply_type").val('image');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//图文回调
|
||||
function chooseGraphicMessage(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
//active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="new-window" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
// active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<a href="javascript:;" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value[0].title);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('articles');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
function chooseTextMessage(data){
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">文 本</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value.content+'">' + data.value.content + '</a>';
|
||||
active_pic += '</div>';
|
||||
// active_pic += '<a href="h" target="_blank" class="new-window" title="' + data.value.content + '"><span class="label label-success">' + data.value.content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value.content);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('text');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//弹出框的位置
|
||||
$("body").off('click', ".add-reply-menu").on('click', ".add-reply-menu", function() {
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = x - 180;
|
||||
var real_y = y + 120;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var m = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(m);
|
||||
$('.rule-container .arrow').css('right', 'auto');
|
||||
$('.rule-container .arrow').css('left', '-13px');
|
||||
|
||||
$('.pull-right').find('i').text(300);
|
||||
});
|
||||
|
||||
//编辑弹出框的位置
|
||||
$("body").off('click',".js-edit-it").on('click',".js-edit-it", function() {
|
||||
var x = $(this).offset().top;
|
||||
var y = $(this).offset().left;
|
||||
var real_x = x - 220;
|
||||
var real_y = y - 730;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var s = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(s);
|
||||
$('.rule-container .arrow').css('left', 'auto');
|
||||
$('.rule-container .arrow').css('right', 3);
|
||||
|
||||
var text_leng = $('.rule-container').find(".layui-textarea").val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
$("body").off('keydown', ".layui-textarea").on('keydown', ".layui-textarea", function() {
|
||||
var text_leng = $(this).val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
function search(){
|
||||
var replay = new WxReplay(3, [ 3, 6, 9 ]);
|
||||
var search_text = $("#search_text").val();
|
||||
replay.getData({
|
||||
"_this" : replay,
|
||||
"rule_type" : 'KEYWORDS',
|
||||
"search_text" : search_text
|
||||
});//数据初始化
|
||||
replay.pageInit({
|
||||
"_this" : replay
|
||||
});
|
||||
}
|
||||
</script>
|
||||