Commit 4d9bdbad authored by Mac's avatar Mac

1

parent dc502166
...@@ -401,6 +401,10 @@ ...@@ -401,6 +401,10 @@
"path":"personal/orderList" "path":"personal/orderList"
},{ },{
"path":"personal/orderDetail" "path":"personal/orderDetail"
},{
"path":"personal/order-commit"//课程待评价
},{
"path":"personal/order-commit-details"//发表评论
}] }]
}, },
......
...@@ -59,6 +59,11 @@ ...@@ -59,6 +59,11 @@
</view> </view>
</view> </view>
</view> </view>
<view class="reply" v-if="x.Reply!=''">
<view style="font-size: 12px;color: #121212;">回复:</view>
<view style="font-size: 12px;color: #9A9A9A;margin-top: 3px;">{{x.Reply}}</view>
</view>
</view> </view>
</view> </view>
<u-loadmore <u-loadmore
...@@ -257,6 +262,7 @@ export default { ...@@ -257,6 +262,7 @@ export default {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
font-family: aa;
} }
.comment-list .comment-details { .comment-list .comment-details {
height: calc(100% - 40px); height: calc(100% - 40px);
...@@ -393,4 +399,12 @@ export default { ...@@ -393,4 +399,12 @@ export default {
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
} }
.comment-list .reply{
width: 100%;
padding: 10px;
background: #F5F6F7;
border-radius: 3px;
margin-top: 10px;
}
</style> </style>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
active-color="#FEC471" inactive-color="#DDDDDD" active-color="#FEC471" inactive-color="#DDDDDD"
active-icon="star" active-icon="star"
inactive-icon="star-o" inactive-icon="star-o"
size="24" size="26"
:disabled="true" :disabled="true"
></u-rate> ></u-rate>
...@@ -126,41 +126,8 @@ ...@@ -126,41 +126,8 @@
</view> </view>
</view> </view>
<view class="sku-box u-skeleton-rect" v-if="comments.length == 0 && setting.is_comment == 1">
<view class="label">暂无评论信息</view>
</view>
<view class="comment" v-if="comments.length > 0">
<view class="chead">
<u-section
:bold="false"
:sub-color="secondary"
:show-split="false"
:title="`商品评价(${comments.length})`"
sub-title="查看更多"
@click="clickCommentHandler"
font-size="24"
></u-section>
</view>
<view class="content">
<view class="u-box">
<view class="user">
<u-avatar :src="comments[0].UserPhotoPath" :size="50"></u-avatar>
<text style="margin-left: 10px;">{{ comments[0].UserName }}</text>
<u-rate
:current="comments[0].CommentScore"
active-color="#FA3534"
inactive-color="#b2b2b2"
active-icon="star"
inactive-icon="star-o"
size="20"
:disabled="true"
></u-rate>
</view>
<view class="timer">{{ comments[0].CreateDate }}</view>
</view>
<view class="ucontent">{{ comments[0].Content }}</view>
</view>
</view>
<view class="tiaoti"> <view class="tiaoti">
<view class="tiaoti-l"></view> <view class="tiaoti-l"></view>
<text style="font-size: 16px;color: #1B1D1E;margin-left: 5px;">课程简介</text> <text style="font-size: 16px;color: #1B1D1E;margin-left: 5px;">课程简介</text>
...@@ -192,6 +159,42 @@ ...@@ -192,6 +159,42 @@
查看更多目录 查看更多目录
</view> </view>
</view> </view>
<view class="tiaoti">
<view class="tiaoti-l"></view>
<text style="font-size: 16px;color: #1B1D1E;margin-left: 5px;">评价 <text style="font-size: 11px;color: #1C1E1F;margin-left: 5px;">{{commentcount}}</text> </text>
</view>
<view class="sku-box u-skeleton-rect" style="justify-content: center;" v-if="comments.length == 0 && setting.is_comment == 1">
<view class="label">暂无评价信息</view>
</view>
<view class="comment" v-if="comments.length > 0">
<view class="content">
<view class="u-box">
<view class="user">
<u-avatar :src="comments[0].UserPhotoPath" :size="50"></u-avatar>
<text style="margin-left: 10px;">{{ comments[0].UserName }}</text>
<u-rate
:current="comments[0].CommentScore"
active-color="#FA3534"
inactive-color="#b2b2b2"
active-icon="star"
inactive-icon="star-o"
size="20"
:disabled="true"
></u-rate>
</view>
<view class="timer">{{ comments[0].CreateDate }}</view>
</view>
<view class="ucontent" style="line-height: 24px;">{{ comments[0].Content }}</view>
<view class="reply" v-if="comments[0].Reply!=''">
<view style="font-size: 12px;color: #121212;">回复:</view>
<view style="font-size: 12px;color: #9A9A9A;margin-top: 3px;">{{comments[0].Reply}}</view>
</view>
</view>
<view class="ckcatalog" v-if="comments.length>1" @click="gocomments" >
查看更多评价
</view>
</view>
</view> </view>
<view class="actionsheet" > <view class="actionsheet" >
<view style="display: flex;flex-direction: row;align-items: center;"> <view style="display: flex;flex-direction: row;align-items: center;">
...@@ -257,6 +260,7 @@ export default { ...@@ -257,6 +260,7 @@ export default {
pricecolor:'', pricecolor:'',
skuimage: [], skuimage: [],
comments: [], comments: [],
commentcount:0,
secondary: "", secondary: "",
detailContent: "", detailContent: "",
showSku: false, showSku: false,
...@@ -348,6 +352,9 @@ export default { ...@@ -348,6 +352,9 @@ export default {
menus: ["shareAppMessage", "shareTimeline"], menus: ["shareAppMessage", "shareTimeline"],
}); });
}, },
onShow(){
this.init();
},
onShareTimeline() { onShareTimeline() {
setTimeout(() => { setTimeout(() => {
console.log("分享调用"); console.log("分享调用");
...@@ -537,7 +544,7 @@ export default { ...@@ -537,7 +544,7 @@ export default {
}, },
(res) => { (res) => {
this.comments = res.data.pageData; this.comments = res.data.pageData;
this.commentcount = res.data.count
// this.initRecommend(); // this.initRecommend();
}, },
(err) => { (err) => {
...@@ -601,6 +608,11 @@ export default { ...@@ -601,6 +608,11 @@ export default {
} }
},
gocomments(){
uni.navigateTo({
url: "/pages/goods/comment-list?id=" + this.id,
});
}, },
goMystudy(){//学习中心 goMystudy(){//学习中心
uni.navigateTo({ uni.navigateTo({
...@@ -761,7 +773,7 @@ export default { ...@@ -761,7 +773,7 @@ export default {
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.goods .sku-box { .goods .sku-box {
margin: 10px 0;
background: #fff; background: #fff;
display: flex; display: flex;
padding: 15px 10px; padding: 15px 10px;
...@@ -809,9 +821,9 @@ export default { ...@@ -809,9 +821,9 @@ export default {
width: 24px; width: 24px;
} }
.goods .comment { .goods .comment {
margin: 10px 0; /* margin: 10px 0; */
background: #fff; background: #fff;
font-family: aa;
padding: 10px; padding: 10px;
} }
.goods .comment .chead { .goods .comment .chead {
...@@ -821,7 +833,8 @@ export default { ...@@ -821,7 +833,8 @@ export default {
.goods .comment .content { .goods .comment .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 15px;
margin-bottom: 15px;
} }
.goods .comment .content .u-box { .goods .comment .content .u-box {
display: flex; display: flex;
...@@ -1019,7 +1032,15 @@ export default { ...@@ -1019,7 +1032,15 @@ export default {
} }
.goods .good-rb-text{ .goods .good-rb-text{
font-size: 11px; font-size: 11px;
color: #999999; color: #121212;
margin-left: 2px; margin-right: 2px;
}
.goods .reply{
width: 100%;
padding: 10px;
background: #F5F6F7;
border-radius: 3px;
margin-top: 10px;
} }
</style> </style>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
Name: '', Name: '',
GoodsType: 0, GoodsType: 0,
CategoryIds: '', CategoryIds: '',
OrderBy: 0, OrderBy: 1,
GoodsPageType:0 GoodsPageType:0
}, },
newsortType: 1, newsortType: 1,
......
<template>
<view class="commit-detail">
<u-top-tips ref="uTips"></u-top-tips>
<view class="good-item">
<image class="good-pic" :src="goodsPic" mode="aspectFit" />
<view class="right-box">
<view class="good-info">{{goodsName}}</view>
<view class="op-box">
<u-rate
:current="msg.CommentScore"
active-color="#FA3534"
inactive-color="#b2b2b2"
active-icon="star"
inactive-icon="star-o"
size="40"
@change='change'
></u-rate>
</view>
</view>
</view>
<view class="content-box">
<view class="title-box">输入评价内容</view>
<view class="editor-box">
<view class="editor-icon">
<u-icon name="edit" size="36"></u-icon>
</view>
<view class="editor">
<textarea placeholder="评价内容" v-model="msg.Content" maxlength="200"></textarea>
</view>
</view>
</view>
<view style="padding:10px 40px;background:#FFF">
<u-button
size="80"
:ripple="true"
@click="submitForm"
shape="circle"
:custom-style="{
backgroundColor: mc,
height: '80rpx',
color: '#FFF',
fontSize: '14px'
}"
>
<u-loading mode="circle" style="margin-right: 5px;" v-if="submitStatus"></u-loading>提交评价
</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "发表评价",
mc: "",
secondary: "",
msg: {
CommentGrade: 1,
GoodsId: 0,
Content: "",
OrderDetailId: 0,
CommentImgList: [],
CommentScore:5
},
submitStatus: false,
goodsName: "",
goodsPic: "",
fileList: [],
};
},
onLoad(option) {
if (option.param) {
let param = JSON.parse(decodeURIComponent(option.param));
this.msg.GoodsId = param.GoodsId;
this.msg.OrderDetailId = param.OrderDetailId;
this.goodsName = param.GoodsName;
this.goodsPic = param.CoverImage;
}
},
mounted() {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
},
methods: {
change(val){
this.msg.CommentScore = val
},
submitForm() {
this.submitStatus = true;
if (this.msg.CommentScore > 0) {
this.request2(
{
url: "/api/AppletOrder/SetGoodsCommentInfo",
data: this.msg,
},
(res) => {
if (res.resultCode == 1) {
uni.showModal({
content: "评价成功,感谢您的反馈",
showCancel: false,
confirmText: "确认",
success: function (res) {
if (res.confirm) {
uni.navigateBack({
delta: 1,
});
}
this.submitStatus = false;
},
});
} else {
this.submitStatus = false;
this.$refs.uTips.show({
title: res.msg,
type: "error",
duration: "2300",
});
}
}
);
} else {
this.$refs.uTips.show({
title: "请您为商品打打分吧",
type: "error",
duration: "2300",
});
}
},
},
};
</script>
<style>
.commit-detail {
background: #faf8f9;
height: 100vh;
position: relative;
}
.commit-detail .good-item {
margin: 10px 0;
background: #fff;
padding: 10px;
border-radius: 10px;
display: flex;
}
.commit-detail .good-item .good-pic {
width: 232rpx;
height: 120rpx;
margin-right: 15px;
border-radius: 5px;
}
.commit-detail .good-item .right-box {
width: 1px;
flex: 1;
display: flex;
flex-direction: column;
height: 120rpx;
}
.commit-detail .good-item .right-box .good-info {
flex: 1;
width: 100%;
height: 1px;
font-size: 28rpx;
color: #333;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
margin-bottom: 5px;
}
.commit-detail .good-item .right-box .op-box {
height: 25px;
}
.commit-detail .content-box {
background: #fff;
padding: 15px;
border-radius: 5px;
}
.commit-detail .content-box .title-box {
padding-bottom: 15px;
border-bottom: 1px solid #e3e3e3;
font-size: 15px;
font-weight: 500;
margin-bottom: 15px;
color: #000;
}
.commit-detail .content-box .editor-box {
display: flex;
}
.commit-detail .content-box .editor-box .editor-icon {
width: 18px;
margin-right: 5px;
}
.commit-detail .content-box .editor-box .editor {
width: 1px;
flex: 1;
}
.commit-detail .content-box .editor-box .editor textarea {
width: 100%;
height: 150px;
font-size: 14px;
color: #000;
border: none;
outline: none;
margin-bottom: 10px;
}
.commit-detail .content-box .editor-box .editor .slot-btn {
width: 140rpx;
height: 140rpx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: rgb(244, 245, 246);
border-radius: 10rpx;
}
.commit-detail .content-box .editor-box .editor .slot-btn .mian-title {
font-size: 28rpx;
color: #888;
font-weight: 600;
margin: 10rpx 0;
}
.commit-detail .content-box .editor-box .editor .slot-btn .sub-title {
color: #999;
font-size: 26rpx;
font-family: "microsoft yahei" !important;
}
.commit-detail .u-list-item {
width: 90px !important;
height: 90px !important;
}
</style>
\ No newline at end of file
<template>
<view class="commit-box">
<u-empty text="没有找到未评价的商品信息" font-size="36" mode="list" v-if="g.length == 0 && !loading"></u-empty>
<view
v-if="g.length > 0"
style="height: 100vh;width: 100vw;overflow: hidden;padding:0 0 10px 0;"
>
<scroll-view
:scroll-y="true"
@scrolltolower="lower"
:enable-back-to-top="true"
:enable-flex="true"
:scroll-top="scrollTop"
@scroll="scroll"
style="height: 100%; padding-bottom: 0px;"
>
<view class="good-list">
<view class="good-item" v-for="(x, i) in g" :key="i">
<image class="good-pic" :src="x.CoverImage" mode="aspectFit" />
<view class="right-box">
<view class="good-info">
<view class="good-name">{{x.GoodsName}}</view>
</view>
<view class="op-box">
<u-button
size="mini"
ripple
plain
shape="circle"
:custom-style="{color:mc,borderColor:mc}"
@click="goCommit(x)"
>评价</u-button>
</view>
</view>
</view>
</view>
<u-loadmore
v-if="showLoading"
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#F5F5F5"
/>
</scroll-view>
</view>
<!-- <view class="quick" v-if="!loading">
<view class="item">
<u-icon name="cart-o" size="48" color="#333" />
</view>
<view class="item" @click="goTop">
<u-icon name="arrow-up" size="48" color="#333" />
</view>
</view>-->
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "课程评论",
loading: false,
g: [],
showLoading: false,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多评价课程了",
},
status: "loadmore",
scrollTop: 0,
old: {
scrollTop: 0,
},
mc: "",
secondary: "",
msg: {
pageIndex: 1,
pageSize: 10,
IsComment: 2,
GoodsName: "",
OrderNo: "",
OrderClassify:2,
},
page_count: 0,
isover: false,
};
},
onShow() {
this.msg.pageIndex = 1;
this.g = [];
console.log(this.g)
this.init();
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
},
methods: {
scroll(e) {
this.old.scrollTop = e.detail.scrollTop;
},
goCommit(x) {
let msg = {
GoodsId: x.GoodsId,
OrderDetailId: x.OrderDetailId,
GoodsName: x.GoodsName,
CoverImage: x.CoverImage,
};
uni.navigateTo({
url:
"/pages/school/personal/order-commit-details?param=" +
encodeURIComponent(JSON.stringify(msg)),
fail: function (e) {
console.log(e);
},
});
},
goTop(e) {
this.scrollTop = this.old.scrollTop;
this.$nextTick(function () {
this.scrollTop = 0;
});
},
init() {
this.isover = false;
this.loading = true;
this.showLoading = this.msg.pageIndex != 1;
this.request2(
{
url: "/api/AppletOrder/GetAppletGoodsWaitCommentPageList",
data: this.msg,
},
(res) => {
this.isloading = false;
if (res.resultCode == 1) {
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.isover = true;
this.status = "nomore";
} else {
this.status = "loadmore";
}
}
uni.hideNavigationBarLoading();
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.status = "loading";
this.msg.pageIndex++;
this.init();
} else {
this.isover = true;
this.status = "nomore";
}
},
},
};
</script>
<style>
.commit-box {
background: #faf8f9;
height: 100vh;
position: relative;
}
.commit-box .quick {
right: 50rpx;
bottom: 50rpx;
position: absolute;
}
.commit-box .quick .item {
background: #fff;
border: 1px solid #aaa;
height: 90rpx;
width: 90rpx;
color: #333;
border-radius: 90rpx;
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.commit-box .good-list {
}
.commit-box .good-list .good-item {
margin-top: 10px;
background: #fff;
padding: 10px;
border-radius: 10px;
display: flex;
}
.commit-box .good-list .good-item .good-pic {
width: 232rpx;
height: 128rpx;
margin-right: 15px;
border-radius: 5px;
}
.commit-box .good-list .good-item .right-box {
width: 1px;
flex: 1;
display: flex;
flex-direction: column;
height: 128rpx;
}
.commit-box .good-list .good-item .right-box .good-info {
flex: 1;
width: 100%;
height: 1px;
}
.commit-box .good-list .good-item .right-box .op-box {
text-align: right;
height: 25px;
}
.commit-box .good-list .good-item .right-box .good-info .good-name {
font-size: 27rpx;
color: #333;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 5px;
}
.commit-box .good-list .good-item .right-box .good-info .good-attr {
text-align: left;
}
</style>
\ No newline at end of file
...@@ -319,6 +319,7 @@ ...@@ -319,6 +319,7 @@
border-top-right-radius: 20px; border-top-right-radius: 20px;
border-top-left-radius: 20px; border-top-left-radius: 20px;
padding-top: 10px; padding-top: 10px;
margin-bottom: 20px;
} }
.teacherDetails .tiaoti{ .teacherDetails .tiaoti{
width: 100%; width: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment