diff --git a/public/appmini/old/alipay/app.js b/public/appmini/old/alipay/app.js
index 0741d5d79b621b894988c4ea3aac483721cfa4ab..9e065b6f52b7b9a09f558ebb22eb3493a1b61bff 100644
--- a/public/appmini/old/alipay/app.js
+++ b/public/appmini/old/alipay/app.js
@@ -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
+ });
+ }
+ },
+
});
diff --git a/public/appmini/old/alipay/app.json b/public/appmini/old/alipay/app.json
index 418bb49abc0200701dbb8b5880563c1270d8759c..140b2ec2911bdffcc54aa36e1ffd6f9c802dcc1a 100644
--- a/public/appmini/old/alipay/app.json
+++ b/public/appmini/old/alipay/app.json
@@ -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",
diff --git a/public/appmini/old/alipay/pages/common/nodata.axml b/public/appmini/old/alipay/pages/common/nodata.axml
index a4f8a0fce2c37db9a91fc8a39a13883e8d26e30b..82d676bb23ca9315e0000a652495b39565318557 100755
--- a/public/appmini/old/alipay/pages/common/nodata.axml
+++ b/public/appmini/old/alipay/pages/common/nodata.axml
@@ -13,6 +13,6 @@
- {{msg || '这里人迹罕至,什么都没有'}}
+ {{msg || '没有相关数据'}}
\ No newline at end of file
diff --git a/public/appmini/old/alipay/pages/goods-comment/goods-comment.acss b/public/appmini/old/alipay/pages/goods-comment/goods-comment.acss
new file mode 100644
index 0000000000000000000000000000000000000000..912526fbe98e240fd3d08ae507e8b45eccc216ae
--- /dev/null
+++ b/public/appmini/old/alipay/pages/goods-comment/goods-comment.acss
@@ -0,0 +1,98 @@
+/*
+ * 评分
+ */
+.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
diff --git a/public/appmini/old/alipay/pages/goods-comment/goods-comment.axml b/public/appmini/old/alipay/pages/goods-comment/goods-comment.axml
new file mode 100644
index 0000000000000000000000000000000000000000..fadbd77e9628d56c1130b527c572b6c10db47c8e
--- /dev/null
+++ b/public/appmini/old/alipay/pages/goods-comment/goods-comment.axml
@@ -0,0 +1,45 @@
+
+
+
+ 动态评分
+ {{goods_score.avg || '0.0'}}
+
+
+
+
+ {{item.name}}
+
+
+ 暂无评分
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/appmini/old/alipay/pages/goods-comment/goods-comment.js b/public/appmini/old/alipay/pages/goods-comment/goods-comment.js
new file mode 100644
index 0000000000000000000000000000000000000000..5be60751d5048d375c47fb875aef32455b9c5701
--- /dev/null
+++ b/public/appmini/old/alipay/pages/goods-comment/goods-comment.js
@@ -0,0 +1,157 @@
+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();
+ },
+});
diff --git a/public/appmini/old/alipay/pages/goods-comment/goods-comment.json b/public/appmini/old/alipay/pages/goods-comment/goods-comment.json
new file mode 100644
index 0000000000000000000000000000000000000000..ed3a57db1414299558d96397899dde30bc79134f
--- /dev/null
+++ b/public/appmini/old/alipay/pages/goods-comment/goods-comment.json
@@ -0,0 +1,3 @@
+{
+ "pullRefresh": true
+}
\ No newline at end of file
diff --git a/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml b/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
index 0450ab0a4c6adc6f4862fe0df98b74973af14d93..27fd425e0f704beeea4926ac028c8da9ba7f919f 100644
--- a/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
+++ b/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
@@ -39,8 +39,10 @@
{{goods.access_count}}
- 累计评论
- {{goods.comments_count}}
+
+ 累计评论
+ {{goods.comments_count}}
+
diff --git a/public/appmini/old/alipay/pages/goods-detail/goods-detail.js b/public/appmini/old/alipay/pages/goods-detail/goods-detail.js
index febd307a7b0d69f2e8f63134856003176b31fc30..2cf4681a91d291854e8329bb671f24c3fad0db4b 100644
--- a/public/appmini/old/alipay/pages/goods-detail/goods-detail.js
+++ b/public/appmini/old/alipay/pages/goods-detail/goods-detail.js
@@ -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});
},
// 获取数据列表
diff --git a/public/appmini/old/weixin/app.js b/public/appmini/old/weixin/app.js
index d9d1f10868a9508724522db26995a44e9596872c..c7025162aea8d8fd3fae120a31364594d92dd5d3 100755
--- a/public/appmini/old/weixin/app.js
+++ b/public/appmini/old/weixin/app.js
@@ -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}}",
diff --git a/public/appmini/old/weixin/app.json b/public/appmini/old/weixin/app.json
index 71fe18ad834e55cb7f6a4c5a26761e8918619b4d..f325a2101392bd706b28a8c554d1dc21441b5791 100755
--- a/public/appmini/old/weixin/app.json
+++ b/public/appmini/old/weixin/app.json
@@ -1,5 +1,5 @@
{
- "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",
diff --git a/public/appmini/old/weixin/pages/common/nodata.wxml b/public/appmini/old/weixin/pages/common/nodata.wxml
index 6dbc17a21c3bdc488e025a3c6956ed3f4dfcb245..2aa73d38ba861c8df9bddb78ca22e999ec34e13d 100755
--- a/public/appmini/old/weixin/pages/common/nodata.wxml
+++ b/public/appmini/old/weixin/pages/common/nodata.wxml
@@ -13,6 +13,6 @@
- {{msg || '这里人迹罕至,什么都没有'}}
+ {{msg || '没有相关数据'}}
\ No newline at end of file
diff --git a/public/appmini/old/weixin/pages/goods-comment/goods-comment.js b/public/appmini/old/weixin/pages/goods-comment/goods-comment.js
index 5ce3292b6bba2fd39affb367ed65d1eaf0441b6e..cd5221d0cdd96d0342547a97c3d327bab15e504b 100644
--- a/public/appmini/old/weixin/pages/goods-comment/goods-comment.js
+++ b/public/appmini/old/weixin/pages/goods-comment/goods-comment.js
@@ -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]
- });
- }
- },
});
diff --git a/public/appmini/old/weixin/pages/goods-comment/goods-comment.json b/public/appmini/old/weixin/pages/goods-comment/goods-comment.json
index 8835af0699ccec004cbe685ef938cd2d63ea7037..331ad4f3d98660918818a7657404ac8cb0a6f312 100644
--- a/public/appmini/old/weixin/pages/goods-comment/goods-comment.json
+++ b/public/appmini/old/weixin/pages/goods-comment/goods-comment.json
@@ -1,3 +1,3 @@
{
- "usingComponents": {}
+ "enablePullDownRefresh": true
}
\ No newline at end of file
diff --git a/public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml b/public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml
index b5edef4ed6056b4464e24c76efb4850c556bc713..cab4d853a339ad04bcf988eae04e139fbacb7b33 100644
--- a/public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml
+++ b/public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml
@@ -5,15 +5,18 @@
{{goods_score.avg || '0.0'}}
-
- {{item.name}}
+
+
+ {{item.name}}
+
+ 暂无评分
-