评论新增支持图片
parent
a1fd5d1760
commit
5d33d37d60
|
|
@ -98,6 +98,7 @@
|
|||
<th class="am-hide-md-down">用户信息</th>
|
||||
<th class="am-hide-sm-only">业务类型</th>
|
||||
<th>评论内容</th>
|
||||
<th class="am-hide-sm-only">评论图片</th>
|
||||
<th class="am-hide-sm-only">评分</th>
|
||||
<th class="am-hide-sm-only">回复</th>
|
||||
<th class="am-hide-sm-only">匿名</th>
|
||||
|
|
@ -142,6 +143,21 @@
|
|||
{{$v.content}}
|
||||
</div>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
{{if !empty($v['images'])}}
|
||||
<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{"directionNav":false, slideshow:false}' >
|
||||
<ul class="am-slides">
|
||||
{{foreach $v.images as $img}}
|
||||
<li>
|
||||
<a href="{{$img}}" target="_blank">
|
||||
<img src="{{$img}}" />
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<span class="am-badge am-radius {{$common_goods_comments_rating_list[$v['rating']]['badge']}}">{{$v.rating_text}}</span>
|
||||
</td>
|
||||
|
|
@ -201,6 +217,17 @@
|
|||
<dt>评论内容</dt>
|
||||
<dd>{{$v.content}}</dd>
|
||||
|
||||
<dt>评论图片</dt>
|
||||
<dd>
|
||||
{{if !empty($v['images'])}}
|
||||
{{foreach $v.images as $img}}
|
||||
<a href="{{$img}}" target="_blank">
|
||||
<img src="{{$img}}" class="am-img-thumbnail" width="80" height="80" />
|
||||
</a>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</dd>
|
||||
|
||||
<dt>评分</dt>
|
||||
<dd>
|
||||
<span class="am-badge am-radius {{$common_goods_comments_rating_list[$v['rating']]['badge']}}">{{$v.rating_text}}</span>
|
||||
|
|
|
|||
|
|
@ -137,7 +137,9 @@
|
|||
<ul class="am-slides">
|
||||
{{foreach $v.images as $img}}
|
||||
<li>
|
||||
<img src="{{$img}}" />
|
||||
<a href="{{$img}}" target="_blank">
|
||||
<img src="{{$img}}" />
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ class Common extends Controller
|
|||
$this->assign('common_bottom_nav_list', NavigationService::BottomNavigation(['user'=>$this->user]));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', empty($this->user['id']) ? 'public' : 'user_'.$this->user['id']);
|
||||
$this->assign('editor_path_type', empty($this->user['id']) ? 'public' : 'user-'.$this->user['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -171,6 +171,9 @@ class Order extends Common
|
|||
{
|
||||
$this->assign('referer_url', empty($_SERVER['HTTP_REFERER']) ? MyUrl('index/order/index') : $_SERVER['HTTP_REFERER']);
|
||||
$this->assign('data', $data['data'][0]);
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', 'order_comments-'.$this->user['id'].'-'.$data['data'][0]['id']);
|
||||
return $this->fetch();
|
||||
} else {
|
||||
$this->assign('msg', '没有相关数据');
|
||||
|
|
|
|||
|
|
@ -490,22 +490,24 @@
|
|||
<div class="am-progress am-fr">
|
||||
{{if isset($goods_score['avg']) and $goods_score['avg'] gt 0 and !empty($goods_score['rating'])}}
|
||||
{{foreach $goods_score.rating as $score}}
|
||||
<div class="am-progress-bar
|
||||
{{switch score.rating}}
|
||||
{{case 1}}
|
||||
am-progress-bar-danger
|
||||
{{/case}}
|
||||
{{case 2}}
|
||||
am-progress-bar-warning
|
||||
{{/case}}
|
||||
{{case 3}}
|
||||
am-progress-bar-secondary
|
||||
{{/case}}
|
||||
{{case 5}}
|
||||
am-progress-bar-success
|
||||
{{/case}}
|
||||
{{/switch}}"
|
||||
style="width: {{$score.portion}}%">{{$score.name}}({{$score.portion}}%)</div>
|
||||
{{if $score.portion gt 0}}
|
||||
<div class="am-progress-bar
|
||||
{{switch score.rating}}
|
||||
{{case 1}}
|
||||
am-progress-bar-danger
|
||||
{{/case}}
|
||||
{{case 2}}
|
||||
am-progress-bar-warning
|
||||
{{/case}}
|
||||
{{case 3}}
|
||||
am-progress-bar-secondary
|
||||
{{/case}}
|
||||
{{case 5}}
|
||||
am-progress-bar-success
|
||||
{{/case}}
|
||||
{{/switch}}"
|
||||
style="width: {{$score.portion}}%">{{$score.name}}({{$score.portion}}%)</div>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{else /}}
|
||||
没有评分数据
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{foreach $data.items as $goods}}
|
||||
{{foreach $data.items as $key=>$goods}}
|
||||
<tr id="data-list-{{$goods.id}}" data-id="{{$goods.id}}" data-goods-id="{{$goods.goods_id}}" class="am-form-group business-form-block">
|
||||
<td class="base">
|
||||
<div class="goods-detail">
|
||||
|
|
@ -76,11 +76,17 @@
|
|||
<li><i class="am-icon-star-o am-icon-md"></i></li>
|
||||
<li><i class="am-icon-star-o am-icon-md"></i></li>
|
||||
<li><i class="am-icon-star-o am-icon-md"></i></li>
|
||||
<li class="tips-text"></li>
|
||||
</ul>
|
||||
<input type="text" name="rating[]" value="" class="input-rating" data-validation-message="请选择评分" required />
|
||||
</div>
|
||||
<textarea name="content[]" class="am-radius" rows="4" minlength="6" maxlength="230" data-validation-message="评论内容 6~230 个字符之间" required></textarea>
|
||||
<textarea name="content[]" class="am-radius" placeholder="宝贝满足你的期待吗?说说它的优点和美中不足的地方吧" rows="4" minlength="6" maxlength="230" data-validation-message="评论内容 6~230 个字符之间" required></textarea>
|
||||
<input type="hidden" name="goods_id[]" value="{{$goods.goods_id}}" />
|
||||
|
||||
<ul class="plug-file-upload-view goods-images-view-{{$key}}" data-form-name="images[{{$key}}][]" data-max-number="3" data-dialog-type="images">
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.goods-images-view-{{$key}}">+上传图片</div>
|
||||
<span class="am-form-group-label-tips">最多上传3张图片</span>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
|
|
@ -90,7 +96,7 @@
|
|||
{{/if}}
|
||||
|
||||
<div class="am-form-group business-form-block">
|
||||
<label class="block">是否匿名</label>
|
||||
<label class="block">是否匿名<span class="am-form-group-label-tips">开启后你写的评论会以匿名的形式展现</span></label>
|
||||
<input name="is_anonymous" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch />
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -830,14 +830,10 @@ class BuyService
|
|||
$address = $buy['data']['base']['address'];
|
||||
}
|
||||
|
||||
// 店铺
|
||||
$shop_id = 0;
|
||||
|
||||
// 订单写入
|
||||
$order = [
|
||||
'order_no' => date('YmdHis').GetNumberCode(6),
|
||||
'user_id' => $params['user']['id'],
|
||||
'shop_id' => $shop_id,
|
||||
'receive_address_id' => $address['id'],
|
||||
'receive_name' => $address['name'],
|
||||
'receive_tel' => $address['tel'],
|
||||
|
|
@ -888,7 +884,6 @@ class BuyService
|
|||
$detail = [
|
||||
'order_id' => $order_id,
|
||||
'user_id' => $params['user']['id'],
|
||||
'shop_id' => $shop_id,
|
||||
'goods_id' => $v['goods_id'],
|
||||
'title' => $v['title'],
|
||||
'images' => $v['images_old'],
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class GoodsCommentsService
|
|||
// 获取订单信息
|
||||
$order_id = intval($params['id']);
|
||||
$where = ['id'=>$order_id, 'user_id'=>$params['user']['id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0];
|
||||
$order = Db::name('Order')->where($where)->field('id,status,shop_id,user_is_comments')->find();
|
||||
$order = Db::name('Order')->where($where)->field('id,status,user_is_comments')->find();
|
||||
if(empty($order))
|
||||
{
|
||||
return DataReturn('资源不存在或已被删除', -1);
|
||||
|
|
@ -155,7 +155,6 @@ class GoodsCommentsService
|
|||
{
|
||||
$data = [
|
||||
'user_id' => $params['user']['id'],
|
||||
'shop_id' => $order['shop_id'],
|
||||
'order_id' => $order_id,
|
||||
'goods_id' => $goods_id,
|
||||
'business_type' => $params['business_type'],
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -7,7 +7,7 @@
|
|||
<view class="progress fr tc">
|
||||
<block a:if="{{goods_score.avg > 0}}">
|
||||
<block a:for="{{goods_score.rating}}">
|
||||
<view class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
|
||||
<view a:if="{{item.portion > 0}}" class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
|
||||
</block>
|
||||
</block>
|
||||
<text a:else class="cr-888">暂无评分</text>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<view class="progress fr tc">
|
||||
<block s-if="goods_score.avg > 0">
|
||||
<block s-for="item, index in goods_score.rating" s-key="key">
|
||||
<view class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
|
||||
<view s-if="item.portion > 0" class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
|
||||
</block>
|
||||
</block>
|
||||
<text s-else class="cr-888">暂无评分</text>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<view class="progress fr tc">
|
||||
<block wx:if="{{goods_score.avg > 0}}">
|
||||
<block wx:for="{{goods_score.rating}}" wx:key="key">
|
||||
<view class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
|
||||
<view wx:if="{{item.portion > 0}}" class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
|
||||
</block>
|
||||
</block>
|
||||
<text wx:else class="cr-888">暂无评分</text>
|
||||
|
|
|
|||
|
|
@ -56,6 +56,13 @@
|
|||
.content-right table.am-table .view-operation {
|
||||
width: 85px;
|
||||
}
|
||||
.content-right table.am-table .am-slider {
|
||||
width: 100px;
|
||||
max-height: 108px;
|
||||
overflow: hidden;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
overflow: hidden;
|
||||
margin-bottom: 2px;
|
||||
padding: 3px 5px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.user-content-body ul.rating li {
|
||||
float: left;
|
||||
|
|
@ -19,6 +20,9 @@
|
|||
.user-content-body ul.rating li i.am-icon-star {
|
||||
color: #d13b49;
|
||||
}
|
||||
.user-content-body ul.rating li.tips-text {
|
||||
width: 38px;
|
||||
}
|
||||
.user-content-body .rating-items {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,10 +57,12 @@ $(function()
|
|||
{
|
||||
$(this).parent().find('li i').removeClass('am-icon-star').addClass('am-icon-star-o');
|
||||
var index = $(this).index();
|
||||
var rating_msg = ['非常差', '差', '一般', '好', '非常好'];
|
||||
for(var i=0; i<=index; i++)
|
||||
{
|
||||
$(this).parent().find('li').eq(i).find('i').removeClass('am-icon-star-o').addClass('am-icon-star');
|
||||
}
|
||||
$(this).parent().find('li.tips-text').text(rating_msg[index]);
|
||||
$(this).parents('td').find('input.input-rating').val(index+1).trigger('blur');
|
||||
$(this).parent().removeClass('not-selected');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue