diff --git a/api/v2local.js b/api/v2local.js index b26d8e86..9ea64184 100644 --- a/api/v2local.js +++ b/api/v2local.js @@ -1,3 +1,10 @@ export const apiArr = { - getMerChantList:"/api/v2/wechat/merchant-cate-crud/list", //商家分类 + getMerChantCateList:"/api/v2/wechat/merchant-cate-crud/list", //商家分类 + getMerchantList:"/api/v2/wechat/merchant-info-crud/page",//商家列表 + createComment:"/api/v2/wechat/merchant-evaluation-crud/creat",//创建用户评价 + getMerchantComment:"/api/v2/wechat/merchant-evaluation-crud/page",//获取商家评价 + merChantCommentLike:"/api/v2/wechat/merchant-evaluation-like-crud/creat",//点赞 + merChantCommentUnlike:"/api/v2/wechat/merchant-evaluation-like-crud/del",//取消点赞 + userCommentInfo:"/api/v2/wechat/merchant-evaluation-crud/info",//用户评论详情 + createUserReply:"/api/v2/wechat/merchant-evaluation-reply-crud/creat",//发送评论 }; diff --git a/packages/localLife/Points/index.css b/packages/localLife/Points/index.css index 96abea8c..fe84dc34 100644 --- a/packages/localLife/Points/index.css +++ b/packages/localLife/Points/index.css @@ -118,7 +118,6 @@ image { background-color: #fff; padding-top: 20rpx; padding-bottom: 20rpx; - border-bottom: 1rpx solid #EBEBEB; } .HisItem:last-child { @@ -126,6 +125,7 @@ image { } + .His_tit { display: flex; align-items: center; diff --git a/packages/localLife/UserComment/index.vue b/packages/localLife/UserComment/index.vue index ba305c58..8190aa96 100644 --- a/packages/localLife/UserComment/index.vue +++ b/packages/localLife/UserComment/index.vue @@ -3,28 +3,35 @@
- - TP + + + + {{ info.user.nick_name }}
- +
- 踏入这家位于街角的餐厅,木质门框与暖黄灯光交织出温馨氛围,墙面上手绘的食材插画透着文艺气息,开放式厨房的设计让食客能看见厨师处理食材的全过程,第一印象便给人以干净与安心。 + {{ info.comment }}
- 300 + {{ info.merchant_evaluation_reply_list ? info.merchant_evaluation_reply_list.length : 0 }}
- - 300 + + + {{ info.merchant_evaluation_like_list ? info.merchant_evaluation_like_list.length : 0 }}
@@ -39,7 +46,7 @@
-
+
@@ -54,7 +61,8 @@
- + +
@@ -81,7 +89,9 @@ export default { picUrl, top: "", localHeight: "", - + info: "", + id:"", + reply_content:"" } }, onLoad(options) { @@ -89,6 +99,8 @@ export default { this.top = meun.top; // this.top = meun.height + meun.top; this.localHeight = meun.height; + this.id = options.id + this.getCommentInfo() }, @@ -96,9 +108,25 @@ export default { sendComment() { // 这里添加发送评论的逻辑 console.log('发送评论'); + let that = this + request(apiArr.createUserReply,"POST",{ + evaluation_id:that.info.id, + reply_content:that.reply_content, + reply_user_type:"1" + }).then(res=>{ + uni.showToast({ + title:"发送成功", + icon:"none", + duration: 2000 + }) + this.reply_content = "" + setTimeout(() => { + this.getCommentInfo() + }, 1000); + }) }, - deletes(){ + deletes() { uni.showModal({ title: '提示', content: '确定删除?', @@ -112,6 +140,48 @@ export default { }); }, + getCommentInfo(e) { + let that = this + request(apiArr.userCommentInfo, "POST", { + id: that.id + }).then(res => { + console.log(res); + this.info = res + }) + }, + + like(e) { + request(apiArr.merChantCommentLike, "POST", { + evaluation_id: e.id, + }).then(res => { + if (this.info.merchant_evaluation_like_list) { + this.info.merchant_evaluation_like_list.push({}) + } else { + this.info.merchant_evaluation_like_list = [] + this.info.merchant_evaluation_like_list.push({}) + } + this.info.is_like = 1 + uni.showToast({ + title: '点赞成功', + icon: "none", + duration: 2000 + }); + }) + }, + unlike(e) { + request(apiArr.merChantCommentUnlike, "POST", { + evaluation_id: e.id, + }).then(res => { + this.info.is_like = 2 + this.info.merchant_evaluation_like_list.pop() + uni.showToast({ + icon: "none", + title: '取消成功', + duration: 2000 + }); + }) + }, + }, diff --git a/packages/localLife/comment/index.css b/packages/localLife/comment/index.css index c9246619..eb66c897 100644 --- a/packages/localLife/comment/index.css +++ b/packages/localLife/comment/index.css @@ -235,4 +235,19 @@ image { left: 30rpx; top: 24rpx; z-index: 2; +} + +.btn1 { + font-size: 36rpx; + color: #FFFFFF; + font-weight: 600; + width: 600rpx; + height: 90rpx; + background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%); + border-radius: 100rpx 100rpx 100rpx 100rpx; + margin: 0 auto; + margin-top: 118rpx; + display: flex; + align-items: center; + justify-content: center; } \ No newline at end of file diff --git a/packages/localLife/comment/index.vue b/packages/localLife/comment/index.vue index e8844087..a6b3099a 100644 --- a/packages/localLife/comment/index.vue +++ b/packages/localLife/comment/index.vue @@ -3,10 +3,10 @@
- +
- 七个2锁城 + {{info.merchant_name}}
@@ -14,7 +14,9 @@
满意度
- +
@@ -23,7 +25,7 @@
点评
- +
@@ -36,8 +38,6 @@
- - @@ -72,6 +72,8 @@
+ +
确认评价
@@ -97,7 +99,7 @@ export default { picUrl, top: "", localHeight: "", - active: 1, + active: 0, videoList: [], videoList2: [], imgList: [], @@ -112,7 +114,9 @@ export default { height: '120rpx' } }, - rating: 0 + rating: 0, + info:'', + comment:"" } }, onLoad(options) { @@ -120,6 +124,8 @@ export default { this.top = meun.top; // this.top = meun.height + meun.top; this.localHeight = meun.height; + this.info = uni.getStorageSync("merchantInfo") + }, @@ -139,7 +145,7 @@ export default { upload(item.url, res => { console.log(res.data.path); this.imgList.push({ url: this.picUrl + res.data.path }) - this.imgList2.push({ url: res.data.path }) + this.imgList2.push(res.data.path) }) }) }, @@ -153,7 +159,7 @@ export default { uploadVideo(e.file.url, res => { console.log(res.data.url); this.videoList.push({ url: this.picUrl + res.data.url }) - this.videoList2.push({ url: res.data.url }) + this.videoList2.push( res.data.url) }) }, cancels(e) { @@ -162,7 +168,26 @@ export default { }, setRating(rating) { this.rating = rating; - } + }, + + handleSubmit(){ + let that= this + request(apiArr.createComment,"POST",{ + merchant_id:that.info.id, + satisfaction:that.rating, + comment:that.comment, + image_url:that.imgList2.join(","), + video_url:that.videoList2.join(","), + }).then(res=>{ + that.comment="" + that.rating = 0 + that.imgList=[] + that.imgList2=[] + that.videoList=[] + that.videoList2=[] + NavgateTo("1") + }) + }, }, diff --git a/packages/localLife/detail/index.css b/packages/localLife/detail/index.css index b57ce9cd..1b510dee 100644 --- a/packages/localLife/detail/index.css +++ b/packages/localLife/detail/index.css @@ -1,36 +1,56 @@ page { background-color: #f6f7fb; } + .container { margin-top: 7rpx; } + .white_container { - background: #FFFFFF; + background: #FFFFFF; padding: 20rpx; + padding-bottom: 28rpx; } + +.swiper { + width: 710rpx; + height: 400rpx; +} + .pic { width: 710rpx; height: 400rpx; border-radius: 20rpx 20rpx 20rpx 20rpx; } + .main { margin: 37rpx 10rpx 0; } + .title { font-weight: 600; -font-size: 40rpx; -color: #000000; -margin-bottom: 20rpx; + font-size: 40rpx; + color: #000000; + margin-bottom: 20rpx; } + .table { display: flex; font-size: 26rpx; margin-bottom: 10rpx; } + +.table { + display: flex; + align-items: center; + justify-content: space-between; +} + .label { color: #999999; margin-right: 36rpx; } + .desc { color: #000000; white-space: nowrap; @@ -39,15 +59,20 @@ margin-bottom: 20rpx; flex: 1; display: block; } + .detail { margin-top: 20rpx; } + .particulars { display: flex; justify-content: space-between; font-size: 30rpx; -color: #FF370B; + color: #FF370B; + padding-top: 28rpx; + border-top: 1rpx solid #E6E6E6; } + .bottom { position: fixed; bottom: 0; @@ -58,22 +83,26 @@ color: #FF370B; justify-content: space-between; align-items: center; } + .left { display: flex; margin-top: 22rpx; margin-left: 48rpx; } + .left_label { display: flex; flex-direction: column; align-items: center; margin-right: 30rpx; } -.left_label > image { + +.left_label>image { width: 32rpx; height: 30rpx; margin-bottom: 16rpx; } + .btn { width: 230rpx; height: 70rpx; @@ -84,6 +113,106 @@ color: #FF370B; color: #FFFFFF; /* display: inline-block; */ /* padding: 10rpx 44rpx; */ - background: linear-gradient( 91deg, #FF7658 0%, #FF370B 100%); -border-radius: 100rpx 100rpx 100rpx 100rpx; + background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%); + border-radius: 100rpx 100rpx 100rpx 100rpx; +} + +.startList { + display: flex; + align-items: center; +} + +.startList image { + width: 22rpx; + height: 22rpx; + margin-right: 4rpx; +} + + + +.Msg { + width: 100%; + background: #FFFFFF; + border-radius: 0rpx 0rpx 0rpx 0rpx; + margin: 0 auto; + padding: 26rpx 20rpx; + margin-top: 30rpx; + box-sizing: border-box; +} + +.Msg_Tit { + display: flex; + align-items: center; + justify-content: space-between; +} + +.Msg_Tit_left { + display: flex; + align-items: center; + font-size: 26rpx; + color: #999999; +} + +.Msg_Tit_left image { + height: 60rpx; + width: 60rpx; + border-radius: 50%; + margin-right: 16rpx; +} + +.Msg_Tit_right { + display: flex; + align-items: center; +} + +.Msg_Tit_right image { + width: 22rpx; + height: 22rpx; + margin-right: 4rpx; +} + +.Msg_con { + font-size: 26rpx; + color: #222222; + margin-top: 30rpx; +} + +.Msg_iconList_leftIcon { + display: flex; + align-items: center; + font-size: 22rpx; + color: #999999; + margin-right: 30rpx; +} + +.Msg_iconList_leftIcon image { + width: 30rpx; + /* height: 30rpx; */ + margin-right: 10rpx; +} + +.Msg_iconList { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 30rpx; +} + +.Msg_iconList_left { + display: flex; + align-items: center; +} + +.Msg_iconList_right { + display: flex; + align-items: center; + font-size: 26rpx; + color: #999999; +} +.Msg_iconList_right div{ + margin-left: 10rpx; +} + +.mb32{ + margin-bottom: 32rpx; } \ No newline at end of file diff --git a/packages/localLife/detail/index.vue b/packages/localLife/detail/index.vue index ee91524f..f17966cc 100644 --- a/packages/localLife/detail/index.vue +++ b/packages/localLife/detail/index.vue @@ -1,48 +1,99 @@