master
wangxinglong 2021-12-08 11:48:22 +08:00
parent bf262e41cf
commit c10d9576f5
26 changed files with 36 additions and 4 deletions

View File

@ -9,6 +9,7 @@ use app\repository\CommentRepository;
use app\validate\Comment as VComment;
use think\Exception;
use think\exception\ValidateException;
use think\facade\Config;
/**
* 评论相关
@ -28,8 +29,10 @@ class Comment extends Base
public function myCommentZone()
{
$page = $this->request->param('page/d', 1);
$size = $this->request->param('size/d', 30);
$data = CommentRepository::getInstance()->myCommentZone( $page, $size);
//$size = $this->request->param('size/d', 30);
Config::load("extra/wechat","wechat");
$systemSize = config("wechat.commentNum") ?? 30;
$data = CommentRepository::getInstance()->myCommentZone( $page, $systemSize);
return $this->json(0, "success", $data);
}
@ -63,6 +66,7 @@ class Comment extends Base
"lat" => input("lat/s"),//纬度
"location" => input("location/s"),
];
//如果是图片或者语音 加上域名信息
if(in_array($param['type'],[CommentModel::type_img,CommentModel::type_voice])){
$comment = $param['comment'];

View File

@ -192,7 +192,25 @@ class Comment extends Base
return $q->withJoin("account");
}, $orders);
$list["list"]->each(function ($item){
if($item->type == CommentModel::type_text){
$data = json_decode($item->comment,true);
if(!empty($data)){
$dataStr = '';
foreach ($data as $ditem){
if($ditem["msgType"] == CommentModel::msg_type_emoji){
$dataStr .= "<img class='emoji' src='/static/" . $ditem['msgImage']."'/>";
}else{
$dataStr.=$ditem['msgCont'];
}
}
$item->comment = $dataStr;
}
}
});
return $this->json(0, 'success', $list);
}

View File

@ -12,6 +12,11 @@ class Comment extends Base
public const type_img = 1;// 图片
public const type_voice = 2;// 语音
public const msg_type_text = "text";// 普通文字
public const msg_type_emoji = "emoji";// emoji标签
public static function allState(){
return [

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -15,6 +15,11 @@
vertical-align: middle;
border: 0;
}
.emoji{
display: inline-block!important;
width: 20px;
height: 20px;
}
</style>
<div class="layui-row layui-col-space12">

View File

@ -117,7 +117,7 @@
<div class="layui-form-mid layui-word-aux">商家余额不足以支付相应数量优惠券时,进行充值提醒</div>
</div>
<div class="layui-form-item layui-form-item-lg">
<div class="layui-form-item layui-form-item-lg layui-hide">
<label class="layui-form-label">商家发布优惠券</label>
<div class="layui-input-block">
<input type="checkbox" {if isset($item.directory) && $item.directory == 1} checked="" {/if} lay-skin="switch" lay-filter="switchDirectory" lay-text="开启|关闭">
@ -139,7 +139,7 @@
<input class="layui-input" type="text" name="commentNum" value="{$item.commentNum ?? 10}"/>
</div>
</div>
<div class="layui-form-item layui-form-item-lg">
<div class="layui-form-item layui-form-item-lg layui-hide">
<label class="layui-form-label">评论人工审核可见</label>
<div class="layui-input-block">
<input type="checkbox" {if isset($item.commentState) && $item.commentState == 1} checked="" {/if} lay-skin="switch" lay-filter="switchCommentState" lay-text="开启|关闭">