添加:消息插件

This commit is contained in:
wuhui_zzw 2023-03-04 09:18:42 +08:00
parent be11c30a78
commit 212fe1afb4
14 changed files with 499 additions and 22 deletions

View File

@ -0,0 +1,38 @@
<?php
/**
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.cdcloudshop.com
* =========================================================
*/
return [
// 自定义模板页面类型,格式:[ 'title' => '页面类型名称', 'name' => '页面标识', 'path' => '页面路径', 'value' => '页面数据json格式' ]
'template' => [],
// 后台自定义组件——装修
'util' => [],
// 自定义页面路径
'link' => [],
// 自定义图标库
'icon_library' => [],
// uni-app 组件,格式:[ 'name' => '组件名称/文件夹名称', 'path' => '文件路径/目录路径' ]多个逗号隔开自定义组件名称前缀必须是diy-,也可以引用第三方组件
'component' => [],
// uni-app 页面,多个逗号隔开
'pages' => [],
// 模板信息,格式:'title' => '模板名称', 'name' => '模板标识', 'cover' => '模板封面图', 'preview' => '模板预览图', 'desc' => '模板描述'
'info' => [],
// 主题风格配色格式可以自由定义扩展【在uni-app中通过this.themeStyle... 获取定义的颜色字段例如this.themeStyle.main_color】
'theme' => [],
// 自定义页面数据,格式:[ 'title' => '页面名称', 'name' => "页面标识", 'value' => [页面数据json格式] ]
'data' => []
];

View File

@ -0,0 +1,19 @@
<?php
// 事件定义文件
return [
'bind' => [
],
'listen' => [
//展示活动
'ShowPromotion' => [
'addon\futures\event\ShowPromotion',
],
],
'subscribe' => [
],
];

View File

@ -0,0 +1,21 @@
<?php
/**
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.cdcloudshop.com
* =========================================================
*/
return [
'name' => 'message',
'title' => '消息中心',
'description' => '消息中心',
'type' => 'tool', //插件类型 system :系统插件(自动安装), business:业务插件 promotion:营销插件 tool:工具插件
'status' => 1,
'author' => '',
'version' => '0.0.1',
'version_no' => '520221115001',
'content' => '',
];

View File

@ -0,0 +1,32 @@
<?php
// +----------------------------------------------------------------------
// | 平台端菜单设置
// +----------------------------------------------------------------------
return [
[
'name' => 'MESSAGE_CENTER',
'title' => '消息中心',
'url' => 'message://shop/message/index',
'parent' => 'CHANNEL_ROOT',
'is_show' => 1,
'sort' => 1,
'picture' => 'addon/message/shop/view/public/img/message_new.png', // 图标
'picture_selected' => 'addon/message/shop/view/public/img/message_select.png', // 选中图标
'child_list' => [
[
'name' => 'MESSAGE_HOME',
'title' => '消息中心',
'url' => 'message://shop/message/index',
'is_show' => 1,
'sort' => 1,
],
[
'name' => 'MESSAGE_REMARKS',
'title' => '留言管理',
'url' => 'message://shop/remark/index',
'is_show' => 1,
'sort' => 2,
]
]
],
];

View File

@ -0,0 +1,27 @@
<?php
/**
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.cdcloudshop.com
* =========================================================
*/
namespace addon\message\event;
/**
* 应用安装
*/
class Install
{
/**
* 执行安装
*/
public function handle()
{
return success();
}
}

View File

@ -0,0 +1,47 @@
<?php
/**
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.cdcloudshop.com
* =========================================================
*/
namespace addon\message\event;
/**
* 活动展示
*/
class ShowPromotion
{
/**
* 活动展示
* @return array
*/
public function handle()
{
$data = [
'shop' => [
[
//插件名称
'name' => 'message',
//店铺端展示分类 shop:营销活动 member:互动营销
'show_type' => 'shop',
//展示主题
'title' => '消息中心',
//展示介绍
'description' => '消息中心',
//展示图标
'icon' => 'addon/message/icon.png',
//跳转链接
'url' => 'message://shop/message/index',
]
]
];
return $data;
}
}

View File

@ -0,0 +1,27 @@
<?php
/**
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.cdcloudshop.com
* =========================================================
*/
namespace addon\message\event;
/**
* 应用卸载
*/
class UnInstall
{
/**
* 执行卸载
*/
public function handle()
{
return success();
}
}

BIN
addon/message/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,33 @@
<?php
/**
* SAAS应用系统 --- 十年开发经验汇集巨献!
* ==========================================================
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
* ----------------------------------------------------------
* 官方网址: https://www.zoomtk.com
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
* ==========================================================
*/
namespace addon\message\shop\controller;
use app\shop\controller\BaseShop;
use addon\futures\model\Futures as futuresModel;
class Message extends BaseShop{
// 进入消息中心
public function index(){
$this->forthMenu();
return $this->fetch('message/index');
}
}

View File

@ -0,0 +1,233 @@
{extend name="app/shop/view/base.html"/}
{block name="resources"}
<style>
.prompt-block .prompt {
display: inline-block;
}
.prompt-block .prompt {
width: 18px;
height: 18px;
line-height: 18px;
position: relative;
}
.user-head-img{
width:40px;
height:40px;
margin-right:20px;
}
.time_p{
height: 20px;
line-height: 20px;
font-size: 13px;
}
</style>
{/block}
{block name="main"}
<!-- 筛选面板 -->
<div class="screen layui-collapse" lay-filter="selection_panel">
<div class="layui-colla-item">
<div class="layui-colla-content layui-form layui-show" lay-filter="search_form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">用户昵称:</label>
<div class="layui-input-inline">
<input type="text" name="nickname" placeholder="用户昵称" autocomplete="off" class="layui-input"/>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">交易状态:</label>
<div class="layui-input-inline">
<select name="status" lay-filter="is_settlement">
<option value="">全部</option>
<option value="1">库存</option>
<option value="2">已上架</option>
<option value="3">已售出</option>
<option value="4">提货中</option>
<option value="5">提货完成</option>
<option value="6">待支付</option>
<option value="7">捡漏</option>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">交易时间:</label>
<!--交易时间类型-->
<div class="layui-input-inline">
<select name="time_type" lay-filter="is_settlement">
<option value="created">购买时间</option>
<option value="release">上架时间</option>
<option value="sell">售卖时间</option>
<option value="take">取货时间</option>
</select>
</div>
<!--时间选择-->
<div class="layui-input-inline">
<input type="text" class="layui-input" name="start_time" placeholder="开始时间" id="start_time" readonly>
<i class=" iconrili iconfont calendar"></i>
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input type="text" class="layui-input" name="end_time" placeholder="结束时间" id="end_time" readonly>
<i class=" iconrili iconfont calendar"></i>
</div>
</div>
</div>
<div class="form-row">
<button class="layui-btn" lay-submit lay-filter="search">筛选</button>
<button type="reset" lay-submit lay-filter="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</div>
</div>
<!-- 列表 -->
<table id="listContent" lay-filter="listContent"></table>
<!-- 操作 -->
<script type="text/html" id="operation">
<div class="table-btn">
<a class="layui-btn" lay-event="seeDetail">查看详情</a>
</div>
</script>
<!--会员信息-->
<script type="text/html" id="memberInfo">
<div class='table-title'>
<div class='title-pic'>
<img layer-src src="{{ns.img(d.seller_headimg)}}" onerror="this.src = '{:img(\'public/static/img/default_img/head.png\')}' ">
</div>
<div class='title-content'>
{{# if(d.seller_username){ }}
<p class="layui-elip">{{d.seller_username}}</p>
{{# } else { }}
<p class="layui-elip">{{d.seller_nickname}}</p>
{{# } }}
</div>
</div>
</script>
<!--商品信息-->
<script type="text/html" id="goodsInfo">
<div class='table-title' title="{{d.goods_name}}">
<div class='title-pic'>
<img layer-src src="{{ns.img(d.goods_image)}}" onerror="this.src = '{:img(\'public/static/img/default_img/head.png\')}' ">
</div>
<div class='title-content'>
<p class="layui-elip">{{d.goods_name}}</p>
</div>
</div>
</script>
{/block}
{block name="script"}
<script>
var table, form, editIframe,laydate, repeat_flag = false;//防重复标识;
layui.use(['form','laydate'], function() {
form = layui.form;
laydate = layui.laydate;
form.render();
//渲染时间
laydate.render({
elem: '#start_time'
,type: 'datetime'
,change: function(value, date, endDate){
$(".date-picker-btn").removeClass("selected");
}
});
laydate.render({
elem: '#end_time'
,type: 'datetime'
,change: function(value, date, endDate){
$(".date-picker-btn").removeClass("selected");
}
});
// 内容获取
table = new Table({
elem: '#listContent',
url: ns.url("futures://shop/futures/index"),
cols: [[
{align: 'center', field: 'id', title: 'ID', width: '5%', unresize: 'false'},
{align: 'left', title: '买家信息', unresize: 'area',width: '15%', templet: '#memberInfo'},
{align: 'left', title: '商品信息', unresize: 'area',width: '15%', templet: '#goodsInfo'},
{align: 'center', title: '商品数量', field: 'total',width: '10%', unresize: 'area'},
{align: 'center', title: '购买价格', field: 'unit_price',width: '10%', unresize: 'area'},
{
align: 'center',width: '10%', templet: function (d) {
// 状态1=库存2=已上架3=已售出4=提货中5=提货完成6=待支付7=捡漏)
let statusText = '';
switch (parseInt(d.status)) {
case 1: statusText = '<p>库存</p>'; break;
case 2: statusText = '<p style="color: #07c160;">已上架</p>'; break;
case 3: statusText = '<p style="color: #1989fa;">已售出</p>'; break;
case 4: statusText = '<p style="color: #7232dd;">提货中</p>'; break;
case 5: statusText = '<p style="color: #ad0000;">提货完成</p>'; break;
case 6: statusText = '<p style="color: #ff976a;">待支付</p>'; break;
case 7: statusText = '<p style="color: #ee0a24;">捡漏</p>'; break;
}
return statusText;
}, title: '交易状态', unresize: 'false'
},
{
align: 'center',width: '15%', templet: function (d) {
let timeText = '';
if(d.release_time > 0) timeText += '<p class="time_p">上架时间:'+ns.time_to_date(d.release_time,'YYYY-MM-DD h:m')+'</p>';
if(d.sell_time > 0) timeText += '<p class="time_p">售卖时间:'+ns.time_to_date(d.sell_time,'YYYY-MM-DD h:m')+'</p>';
if(d.created_time > 0) timeText += '<p class="time_p">购买时间:'+ns.time_to_date(d.created_time,'YYYY-MM-DD h:m')+'</p>';
if(d.take_time > 0) timeText += '<p class="time_p">取货时间:'+ns.time_to_date(d.take_time,'YYYY-MM-DD h:m')+'</p>';
return timeText;
}, title: '交易时间', unresize: 'false'
},
{title: '操作', toolbar: '#operation', unresize: 'false', align: 'right'}
]],
});
// 点击搜索
form.on('submit(search)', function(data) {
table.reload({
page: {
curr: 1
},
where: data.field
});
return false;
});
// 重置表单
form.on('submit(reset)', function(data) {
let field = {
"nickname": "",
"status": "",
"time_type": "created",
"start_time": "",
"end_time": "",
};
form.val("search_form", field);
layui.form.render();
// 刷新表格
table.reload({
page: {
curr: 1
},
where: field
});
});
// 监听工具栏操作
table.tool(function(obj) {
var data = obj.data;
eval(obj.event)(data)
});
});
// 点击查看详情
function seeDetail(data){
layer.open({
type: 2,
title: '交易详情',
skin: 'layer-tips-class',
area: ['80%','90%'],
content: ns.url("futures://shop/futures/seeDetail", { id: data.id }),
end: function(){
//table.reload();
}
});
}
</script>
{/block}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -150,28 +150,28 @@ class Index extends Controller
/**
* 手机端预览
*/
public function h5Preview()
{
$url = input('url', '');
$shop_model = new ShopModel();
$res = $shop_model->qrcode(1);
$h5_data = $res[ 'data' ][ 'path' ][ 'h5' ] ?? [];
if (!empty($url)) {
if (strpos($url, '?') !== false) {
$url .= '&time=' . time();
} else {
$url .= '?time=' . time();
}
$h5_data[ 'url' ] = $url;
} else {
$h5_data[ 'url' ] .= '?time=' . time();
}
$this->assign('h5_data', $h5_data);
$this->assign('is_mobile', isMobile());
return $this->fetch("index/h5_preview");
public function h5Preview(){
return redirect('/h5/');
// $url = input('url', '');
//
// $shop_model = new ShopModel();
// $res = $shop_model->qrcode(1);
// $h5_data = $res[ 'data' ][ 'path' ][ 'h5' ] ?? [];
//
// if (!empty($url)) {
// if (strpos($url, '?') !== false) {
// $url .= '&time=' . time();
// } else {
// $url .= '?time=' . time();
// }
// $h5_data[ 'url' ] = $url;
// } else {
// $h5_data[ 'url' ] .= '?time=' . time();
// }
//
// $this->assign('h5_data', $h5_data);
// $this->assign('is_mobile', isMobile());
// return $this->fetch("index/h5_preview");
}
}