Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
13272519
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
13272519
编写于
7月 12, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品评论
上级
3b6ffca2
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
366 addition
and
31 deletion
+366
-31
public/appmini/old/alipay/app.js
public/appmini/old/alipay/app.js
+22
-0
public/appmini/old/alipay/app.json
public/appmini/old/alipay/app.json
+1
-0
public/appmini/old/alipay/pages/common/nodata.axml
public/appmini/old/alipay/pages/common/nodata.axml
+1
-1
public/appmini/old/alipay/pages/goods-comment/goods-comment.acss
...appmini/old/alipay/pages/goods-comment/goods-comment.acss
+98
-0
public/appmini/old/alipay/pages/goods-comment/goods-comment.axml
...appmini/old/alipay/pages/goods-comment/goods-comment.axml
+45
-0
public/appmini/old/alipay/pages/goods-comment/goods-comment.js
...c/appmini/old/alipay/pages/goods-comment/goods-comment.js
+157
-0
public/appmini/old/alipay/pages/goods-comment/goods-comment.json
...appmini/old/alipay/pages/goods-comment/goods-comment.json
+3
-0
public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
...c/appmini/old/alipay/pages/goods-detail/goods-detail.axml
+4
-2
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
+1
-1
public/appmini/old/weixin/app.js
public/appmini/old/weixin/app.js
+1
-1
public/appmini/old/weixin/app.json
public/appmini/old/weixin/app.json
+2
-1
public/appmini/old/weixin/pages/common/nodata.wxml
public/appmini/old/weixin/pages/common/nodata.wxml
+1
-1
public/appmini/old/weixin/pages/goods-comment/goods-comment.js
...c/appmini/old/weixin/pages/goods-comment/goods-comment.js
+1
-12
public/appmini/old/weixin/pages/goods-comment/goods-comment.json
...appmini/old/weixin/pages/goods-comment/goods-comment.json
+1
-1
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml
...appmini/old/weixin/pages/goods-comment/goods-comment.wxml
+6
-3
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxss
...appmini/old/weixin/pages/goods-comment/goods-comment.wxss
+17
-5
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+1
-1
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
...c/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
+4
-2
未找到文件。
public/appmini/old/alipay/app.js
浏览文件 @
13272519
...
...
@@ -56,6 +56,7 @@ App({
"
message
"
:
"
消息
"
,
"
user_integral
"
:
"
我的积分
"
,
"
user_goods_browse
"
:
"
我的足迹
"
,
"
goods_comment
"
:
"
商品评论
"
,
},
// 请求地址
...
...
@@ -610,4 +611,25 @@ App({
return
false
;
},
/**
* 默认弱提示方法
* msg [string] 提示信息
* status [string] 状态 默认error [正确success, 错误error]
*/
showToast
(
msg
,
status
)
{
if
((
status
||
'
error
'
)
==
'
success
'
)
{
my
.
showToast
({
type
:
"
success
"
,
content
:
msg
});
}
else
{
my
.
showToast
({
type
:
"
fail
"
,
content
:
msg
});
}
},
});
public/appmini/old/alipay/app.json
浏览文件 @
13272519
...
...
@@ -9,6 +9,7 @@
"pages/paytips/paytips"
,
"pages/goods-search/goods-search"
,
"pages/goods-detail/goods-detail"
,
"pages/goods-comment/goods-comment"
,
"pages/goods-attribute/goods-attribute"
,
"pages/buy/buy"
,
"pages/user-address/user-address"
,
...
...
public/appmini/old/alipay/pages/common/nodata.axml
浏览文件 @
13272519
...
...
@@ -13,6 +13,6 @@
<!-- 0 默认没有数据 -->
<view a:elif="{{status == 0}}" class="no-data-box tc">
<image src="/images/empty.png" mode="widthFix" />
<view class="no-data-tips">{{msg || '
这里人迹罕至,什么都没有
'}}</view>
<view class="no-data-tips">{{msg || '
没有相关数据
'}}</view>
</view>
</template>
\ No newline at end of file
public/appmini/old/alipay/pages/goods-comment/goods-comment.acss
0 → 100644
浏览文件 @
13272519
/*
* 评分
*/
.score-container {
padding: 10rpx;
}
.score-container .score {
width: 180rpx;
border-right: 1px solid #eee;
}
.score-container .score .value {
color: #f03726;
font-weight: bold;
font-size: 60rpx;
line-height: 60rpx;
margin-top: 10rpx;
}
.progress {
overflow: hidden;
height: 40rpx;
margin-top: 35rpx;
background-color: #eee;
border-radius: 0;
width: calc(100% - 200rpx);
}
.progress .cr-888 {
font-size: 24rpx;
line-height: 40rpx;
}
.progress-bar {
float: left;
width: 0;
height: 100%;
font-size: 24rpx;
line-height: 40rpx;
color: #fff;
text-align: center;
background-color: #0e90d2;
}
.progress-bar-danger {
background-color: #dd514c;
}
.progress-bar-warning {
background-color: #F37B1D;
}
.progress-bar-secondary {
background-color: #3bb4f2;
}
.progress-bar-success {
background-color: #5eb95e;
}
/*
* 列表
*/
.scroll-box {
height: calc(100vh - 125rpx);
}
.comment-item {
padding: 0 10rpx 10rpx 10rpx;
border-bottom:solid 1px #eee;
}
.comment-item .nav {
background: #ebebeb;
padding: 10rpx 0;
}
.comment-item .avatar {
width: 70rpx;
height: 70rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
}
.comment-item .base-nav {
width: calc(100% - 90rpx);
line-height: 70rpx;
}
.comment-item .base-nav text:not(:last-child) {
margin-right: 5rpx;
}
.base-content {
padding: 10rpx;
}
.base-content .content, .base-content .reply {
line-height: 46rpx;
font-size: 30rpx;
}
.base-content .spec {
margin-top: 20rpx;
color: #B0B0B0;
}
.base-content .reply {
margin-top: 20rpx;
padding-top: 20rpx;
}
.base-content .reply-desc {
color: #905602;
}
\ No newline at end of file
public/appmini/old/alipay/pages/goods-comment/goods-comment.axml
0 → 100644
浏览文件 @
13272519
<!-- 评分 -->
<view a:if="{{goods_score != null}}" class="score-container oh br-b">
<view class="score fl tc">
<view class="cr-666">动态评分</view>
<view class="value">{{goods_score.avg || '0.0'}}</view>
</view>
<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>
</block>
</block>
<text a:else class="cr-888">暂无评分</text>
</view>
</view>
<!-- 列表 -->
<scroll-view scroll-y="{{true}}" class="scroll-box" bindscrolltolower="scroll_lower" lower-threshold="30">
<view a:for="{{data_list}}" class="comment-item spacing-mt">
<view class="oh nav">
<image class="avatar dis-block fl" src="{{item.user.avatar || '/images/default-user.png'}}" mode="aspectFit"></image>
<view class="base-nav fr">
<text>{{item.user.user_name_view}}</text>
<text class="cr-ccc">评论于</text>
<text class="cr-666">{{item.add_time_time}}</text>
</view>
</view>
<view class="base-content oh">
<view class="content cr-666">{{item.content}}</view>
<view a:if="{{(item.msg || null) != null}}" class="spec">{{item.msg}}</view>
<view a:if="{{item.is_reply == 1 && (item.reply || null) != null}}" class="reply br-t-dashed">
<text class="cr-888">管理员回复:</text>
<text class="reply-desc">{{item.reply}}</text>
</view>
</view>
</view>
<view a:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.axml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.axml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>
\ No newline at end of file
public/appmini/old/alipay/pages/goods-comment/goods-comment.js
0 → 100644
浏览文件 @
13272519
const
app
=
getApp
();
Page
({
data
:
{
data_list_loding_status
:
1
,
data_bottom_line_status
:
false
,
data_list
:
[],
data_page_total
:
0
,
data_page
:
1
,
goods_score
:
null
,
params
:
null
,
progress_class
:
[
'
progress-bar-danger
'
,
'
progress-bar-warning
'
,
'
progress-bar-secondary
'
,
''
,
'
progress-bar-success
'
],
},
onLoad
(
params
)
{
//params['goods_id']=2;
this
.
setData
({
params
:
params
});
this
.
init
();
},
onShow
()
{
my
.
setNavigationBar
({
title
:
app
.
data
.
common_pages_title
.
goods_comment
});
},
// 初始化
init
()
{
// 获取数据
this
.
goods_score
();
this
.
get_data_list
();
},
// 获取商品评分
goods_score
()
{
my
.
request
({
url
:
app
.
get_request_url
(
"
goodsscore
"
,
"
goods
"
),
method
:
"
POST
"
,
data
:
{
goods_id
:
this
.
data
.
params
.
goods_id
},
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
if
(
res
.
data
.
code
==
0
)
{
this
.
setData
({
goods_score
:
res
.
data
.
data
||
null
,
});
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 获取数据列表
get_data_list
(
is_mandatory
)
{
// 参数校验
if
((
this
.
data
.
params
.
goods_id
||
null
)
==
null
)
{
my
.
stopPullDownRefresh
();
this
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
});
}
else
{
var
self
=
this
;
// 分页是否还有数据
if
((
is_mandatory
||
0
)
==
0
)
{
if
(
this
.
data
.
data_bottom_line_status
==
true
)
{
return
false
;
}
}
// 加载loding
my
.
showLoading
({
title
:
"
加载中...
"
});
this
.
setData
({
data_list_loding_status
:
1
});
my
.
request
({
url
:
app
.
get_request_url
(
"
comment
"
,
"
goods
"
),
method
:
"
POST
"
,
data
:
{
goods_id
:
this
.
data
.
params
.
goods_id
,
page
:
this
.
data
.
data_page
},
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
my
.
hideLoading
();
my
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
data
.
data
.
length
>
0
)
{
if
(
this
.
data
.
data_page
<=
1
)
{
var
temp_data_list
=
res
.
data
.
data
.
data
;
}
else
{
var
temp_data_list
=
this
.
data
.
data_list
;
var
temp_data
=
res
.
data
.
data
.
data
;
for
(
var
i
in
temp_data
)
{
temp_data_list
.
push
(
temp_data
[
i
]);
}
}
this
.
setData
({
data_list
:
temp_data_list
,
data_total
:
res
.
data
.
data
.
total
,
data_page_total
:
res
.
data
.
data
.
page_total
,
data_list_loding_status
:
3
,
data_page
:
this
.
data
.
data_page
+
1
});
// 是否还有数据
if
(
this
.
data
.
data_page
>
1
&&
this
.
data
.
data_page
>
this
.
data
.
data_page_total
)
{
this
.
setData
({
data_bottom_line_status
:
true
});
}
else
{
this
.
setData
({
data_bottom_line_status
:
false
});
}
}
else
{
this
.
setData
({
data_list_loding_status
:
0
,
});
if
(
this
.
data
.
data_page
<=
1
)
{
this
.
setData
({
data_list
:
[],
data_bottom_line_status
:
false
,
});
}
}
}
else
{
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
my
.
hideLoading
();
my
.
stopPullDownRefresh
();
this
.
setData
({
data_list_loding_status
:
2
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
setData
({
data_page
:
1
});
this
.
get_data_list
(
1
);
},
// 滚动加载
scroll_lower
(
e
)
{
this
.
get_data_list
();
},
});
public/appmini/old/alipay/pages/goods-comment/goods-comment.json
0 → 100644
浏览文件 @
13272519
{
"pullRefresh"
:
true
}
\ No newline at end of file
public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
浏览文件 @
13272519
...
...
@@ -39,8 +39,10 @@
<text class="cr-main">{{goods.access_count}}</text>
</view>
<view class="fl tr">
<text class="cr-888">累计评论</text>
<text class="cr-main">{{goods.comments_count}}</text>
<navigator url="/pages/goods-comment/goods-comment?goods_id={{goods.id}}" hover-class="none">
<text class="cr-888">累计评论</text>
<text class="cr-main">{{goods.comments_count}}</text>
</navigator>
</view>
</view>
</view>
...
...
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
浏览文件 @
13272519
...
...
@@ -41,7 +41,7 @@ Page({
},
onShow
()
{
my
.
setNavigationBar
({
title
:
app
.
data
.
common_pages_title
.
goods_detail
});
my
.
setNavigationBar
({
title
:
(
this
.
data
.
goods
==
null
)
?
app
.
data
.
common_pages_title
.
goods_detail
:
this
.
data
.
goods
.
title
});
},
// 获取数据列表
...
...
public/appmini/old/weixin/app.js
浏览文件 @
13272519
...
...
@@ -62,7 +62,7 @@ App({
// 请求地址
// request_url: "{{request_url}}",
request_url
:
'
http://tp5-dev.com/
'
,
//
request_url: 'https://test.shopxo.net/',
request_url
:
'
https://test.shopxo.net/
'
,
// 基础信息
application_title
:
"
{{application_title}}
"
,
...
...
public/appmini/old/weixin/app.json
浏览文件 @
13272519
{
"pages"
:
[
"pages/goods-comment/goods-comment"
,
"pages"
:
[
"pages/index/index"
,
"pages/goods-category/goods-category"
,
"pages/cart/cart"
,
...
...
@@ -9,6 +9,7 @@
"pages/paytips/paytips"
,
"pages/goods-search/goods-search"
,
"pages/goods-detail/goods-detail"
,
"pages/goods-comment/goods-comment"
,
"pages/goods-attribute/goods-attribute"
,
"pages/buy/buy"
,
"pages/user-address/user-address"
,
...
...
public/appmini/old/weixin/pages/common/nodata.wxml
浏览文件 @
13272519
...
...
@@ -13,6 +13,6 @@
<!-- 0 默认没有数据 -->
<view wx:elif="{{status == 0}}" class="no-data-box tc">
<image src="/images/empty.png" mode="widthFix" />
<view class="no-data-tips">{{msg || '
这里人迹罕至,什么都没有
'}}</view>
<view class="no-data-tips">{{msg || '
没有相关数据
'}}</view>
</view>
</template>
\ No newline at end of file
public/appmini/old/weixin/pages/goods-comment/goods-comment.js
浏览文件 @
13272519
...
...
@@ -12,7 +12,7 @@ Page({
},
onLoad
(
params
)
{
params
[
'
goods_id
'
]
=
2
;
//
params['goods_id']=2;
this
.
setData
({
params
:
params
});
this
.
init
();
},
...
...
@@ -154,15 +154,4 @@ Page({
scroll_lower
(
e
)
{
this
.
get_data_list
();
},
// 详情图片查看
goods_detail_images_view_event
(
e
)
{
var
value
=
e
.
currentTarget
.
dataset
.
value
||
null
;
if
(
value
!=
null
)
{
wx
.
previewImage
({
current
:
0
,
urls
:
[
value
]
});
}
},
});
public/appmini/old/weixin/pages/goods-comment/goods-comment.json
浏览文件 @
13272519
{
"
usingComponents"
:
{}
"
enablePullDownRefresh"
:
true
}
\ No newline at end of file
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml
浏览文件 @
13272519
...
...
@@ -5,15 +5,18 @@
<view class="value">{{goods_score.avg || '0.0'}}</view>
</view>
<view class="progress fr tc">
<block wx:for="{{goods_score.rating}}" wx:key="key">
<view class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
<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>
</block>
</block>
<text wx:else class="cr-888">暂无评分</text>
</view>
</view>
<!-- 列表 -->
<scroll-view scroll-y="{{true}}" class="scroll-box" bindscrolltolower="scroll_lower" lower-threshold="30">
<view wx:for="{{data_list}}" wx:key="key" class="comment-item
br-b
spacing-mt">
<view wx:for="{{data_list}}" wx:key="key" class="comment-item spacing-mt">
<view class="oh nav">
<image class="avatar dis-block fl" src="{{item.user.avatar || '/images/default-user.png'}}" mode="aspectFit"></image>
<view class="base-nav fr">
...
...
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxss
浏览文件 @
13272519
/*
* 评分
*/
.score-container {
padding: 10rpx;
}
...
...
@@ -12,15 +15,18 @@
line-height: 60rpx;
margin-top: 10rpx;
}
.progress {
overflow: hidden;
height: 40rpx;
margin-top:
40
rpx;
background-color: #
f5f5f5
;
margin-top:
35
rpx;
background-color: #
eee
;
border-radius: 0;
width: calc(100% - 200rpx);
}
.progress .cr-888 {
font-size: 24rpx;
line-height: 40rpx;
}
.progress-bar {
float: left;
width: 0;
...
...
@@ -44,12 +50,18 @@
background-color: #5eb95e;
}
/*
* 列表
*/
.scroll-box {
height: calc(100vh - 125rpx);
}
.comment-item {
padding: 0 10rpx 10rpx 10rpx;
border-bottom:solid 1px #eee;
}
.comment-item .nav {
background: #e
ee
;
background: #e
bebeb
;
padding: 10rpx 0;
}
.comment-item .avatar {
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
13272519
...
...
@@ -46,7 +46,7 @@ Page({
},
onShow
()
{
wx
.
setNavigationBarTitle
({
title
:
app
.
data
.
common_pages_title
.
goods_detail
});
wx
.
setNavigationBarTitle
({
title
:
(
this
.
data
.
goods
==
null
)
?
app
.
data
.
common_pages_title
.
goods_detail
:
this
.
data
.
goods
.
title
});
},
// 获取数据列表
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
浏览文件 @
13272519
...
...
@@ -48,8 +48,10 @@
<text class="cr-main">{{goods.access_count}}</text>
</view>
<view class="fl tr">
<text class="cr-888">累计评论</text>
<text class="cr-main">{{goods.comments_count}}</text>
<navigator url="/pages/goods-comment/goods-comment?goods_id={{goods.id}}" hover-class="none">
<text class="cr-888">累计评论</text>
<text class="cr-main">{{goods.comments_count}}</text>
</navigator>
</view>
</view>
</view>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录