调用接口6.18
This commit is contained in:
parent
44fbd1d668
commit
e4912a82a8
@ -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",//发送评论
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -3,28 +3,35 @@
|
||||
<div class="Msg">
|
||||
<div class="Msg_Tit">
|
||||
<div class="Msg_Tit_left">
|
||||
<image src="http://192.168.0.172:5500/test.png" mode="aspectFill"></image>
|
||||
TP
|
||||
<image src="http://192.168.0.172:5500/user_ava.png" v-if="!info.user.avatar" mode="aspectFill">
|
||||
</image>
|
||||
<image :src="picUrl + info.user.avatar" v-if="info.user.avatar" mode="aspectFill"></image>
|
||||
{{ info.user.nick_name }}
|
||||
</div>
|
||||
<div class="Msg_Tit_right">
|
||||
<image v-for="item in 5" src="http://192.168.0.172:5500/local_start1.png" mode="aspectFill"></image>
|
||||
<image v-for="indez in 5"
|
||||
:src="indez < info.satisfaction ? 'http://192.168.0.172:5500/local_start1.png' : 'http://192.168.0.172:5500/local_start2.png'"
|
||||
mode="aspectFill"></image>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Msg_con">
|
||||
踏入这家位于街角的餐厅,木质门框与暖黄灯光交织出温馨氛围,墙面上手绘的食材插画透着文艺气息,开放式厨房的设计让食客能看见厨师处理食材的全过程,第一印象便给人以干净与安心。
|
||||
{{ info.comment }}
|
||||
</div>
|
||||
|
||||
<div class="Msg_iconList">
|
||||
<div class="Msg_iconList_left">
|
||||
<div class="Msg_iconList_leftIcon">
|
||||
<image src="http://192.168.0.172:5500/local_review.png" mode="widthFix"></image>
|
||||
300
|
||||
{{ info.merchant_evaluation_reply_list ? info.merchant_evaluation_reply_list.length : 0 }}
|
||||
</div>
|
||||
|
||||
<div class="Msg_iconList_leftIcon">
|
||||
<image src="http://192.168.0.172:5500/com_likeIcon.png" mode="widthFix"></image>
|
||||
300
|
||||
<image v-if="info.is_like == 2" src="http://192.168.0.172:5500/com_likeIcon.png" mode="widthFix"
|
||||
@click="like(info)"></image>
|
||||
<image v-if="info.is_like == 1" src="http://192.168.0.172:5500/com_likeIcon2.png"
|
||||
mode="widthFix" @click="unlike(info)"></image>
|
||||
{{ info.merchant_evaluation_like_list ? info.merchant_evaluation_like_list.length : 0 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="Msg_iconList_right">
|
||||
@ -39,7 +46,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 回复列表 -->
|
||||
<div class="reply" v-for="item in 3">
|
||||
<div class="reply" v-for="item in info.merchant_evaluation_reply_list">
|
||||
<div class="reply_tit">
|
||||
<div class="reply_tit_left">
|
||||
<image src="http://192.168.0.172:5500/test.png" mode="aspectFill"></image>
|
||||
@ -54,7 +61,8 @@
|
||||
<div class="comment">
|
||||
<div class="comment_con">
|
||||
<image src="http://192.168.0.172:5500/local_send.png" mode="aspectFill"></image>
|
||||
<input type="text" placeholder="说点什么">
|
||||
<input type="text" v-model="reply_content" placeholder="说点什么">
|
||||
|
||||
<button id="send" @click="sendComment">发送</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -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,6 +108,22 @@ 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() {
|
||||
@ -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
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
@ -236,3 +236,18 @@ image {
|
||||
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;
|
||||
}
|
||||
@ -3,10 +3,10 @@
|
||||
<div class="Msg">
|
||||
<div class="Msg_Tit">
|
||||
<div class="Msg_Tit_left">
|
||||
<image src="http://192.168.0.172:5500/test.png" mode="aspectFill"></image>
|
||||
<image :src="picUrl + info.bigImg[0]" mode="aspectFill"></image>
|
||||
</div>
|
||||
<div class="Msg_Tit_right">
|
||||
七个2锁城
|
||||
{{info.merchant_name}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -14,7 +14,9 @@
|
||||
<div class="row">满意度</div>
|
||||
<div class="startList">
|
||||
<div class="start" v-for="(item, index) in 5" :key="index" @click="setRating(index + 1)">
|
||||
<image :src="index < rating ? 'http://192.168.0.172:5500/local_start1.png' : 'http://192.168.0.172:5500/local_start2.png'" mode="aspectFill"></image>
|
||||
<image
|
||||
:src="index < rating ? 'http://192.168.0.172:5500/local_start1.png' : 'http://192.168.0.172:5500/local_start2.png'"
|
||||
mode="aspectFill"></image>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -23,7 +25,7 @@
|
||||
<div class="Msg_ipt noneBor">
|
||||
<div class="row">点评</div>
|
||||
<div class="startList">
|
||||
<textarea name="" auto-height placeholder="您对服务满意吗" id="textareas"></textarea>
|
||||
<textarea name="" v-model="comment" auto-height placeholder="您对服务满意吗" id="textareas"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -36,8 +38,6 @@
|
||||
</div>
|
||||
|
||||
<div class="Msg2_Con">
|
||||
|
||||
|
||||
<u-upload v-if="active === 0" :maxCount="8" :fileList="imgList" @afterRead="afterReadVideo"
|
||||
@delete="deletePic" name="1" multiple
|
||||
:custom-style="imgList.length > 0 ? uploadStyle.small : uploadStyle.full" :previewFullImage="true">
|
||||
@ -72,6 +72,8 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn1" @click="handleSubmit">确认评价</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -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")
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
|
||||
@ -1,36 +1,56 @@
|
||||
page {
|
||||
background-color: #f6f7fb;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin-top: 7rpx;
|
||||
}
|
||||
|
||||
.white_container {
|
||||
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;
|
||||
}
|
||||
|
||||
.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;
|
||||
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 {
|
||||
width: 32rpx;
|
||||
height: 30rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 230rpx;
|
||||
height: 70rpx;
|
||||
@ -87,3 +116,103 @@ color: #FF370B;
|
||||
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;
|
||||
}
|
||||
@ -1,36 +1,87 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="white_container">
|
||||
<image class="pic" src="http://127.0.0.1:5500/assets/index_Mask_group.png" />
|
||||
<swiper class="swiper" autoplay>
|
||||
<swiper-item v-for="(item, pageIndex) in info.bigImg" :key="pageIndex">
|
||||
<image class="pic" :src="picUrl + item" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<view class="main">
|
||||
<view class="title">七个2锁城</view>
|
||||
<u-icon name="star-fill" color="#FFB84D" />
|
||||
<view class="title">{{ info.merchant_name }}</view>
|
||||
|
||||
<!-- <u-icon name="star-fill" color="#FFB84D" /> -->
|
||||
<div class="startList">
|
||||
<image v-for="index in 5"
|
||||
:src="index < item.rating ? 'http://192.168.0.172:5500/local_start1.png' : 'http://192.168.0.172:5500/local_start2.png'"
|
||||
mode="aspectFill"></image>
|
||||
</div>
|
||||
|
||||
<u-line margin="46rpx 0 30rpx 0" />
|
||||
<view class="table">
|
||||
<view class="label">联系电话</view>
|
||||
<view class="desc">15901518415</view>
|
||||
<view class="desc">{{ info.phone }}</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="label">营业时间</view>
|
||||
<view class="desc">05:00至24:00</view>
|
||||
<view class="desc">{{ info.business_hours }}</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="label">营业地址</view>
|
||||
<view class="desc">河北省衡水市桃城区自强街路东综合楼1栋8号门店</view>
|
||||
<view class="desc">{{ info.comAddress }}</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="table mb32">
|
||||
<view class="label">特色服务</view>
|
||||
<view class="desc">开锁、换锁、修锁、指纹锁、配汽车钥匙</view>
|
||||
<view class="desc">{{ info.features }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="white_container detail">
|
||||
<view class="particulars">
|
||||
|
||||
<view class="particulars" @click="detail_msg">
|
||||
<view>查看详情</view>
|
||||
<u-icon name="arrow-right" size="30" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="white_container detail" v-for="item in commentList">
|
||||
<div class="Msg">
|
||||
<div class="Msg_Tit">
|
||||
<div class="Msg_Tit_left">
|
||||
<image src="http://192.168.0.172:5500/user_ava.png" v-if="!item.user.avatar" mode="aspectFill"></image>
|
||||
<image :src="picUrl + item.user.avatar" v-if="item.user.avatar" mode="aspectFill"></image>
|
||||
{{ item.user.nick_name }}
|
||||
</div>
|
||||
<div class="Msg_Tit_right">
|
||||
<image v-for="indez in 5"
|
||||
:src="indez < item.satisfaction ? 'http://192.168.0.172:5500/local_start1.png' : 'http://192.168.0.172:5500/local_start2.png'"
|
||||
mode="aspectFill"></image>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Msg_con">
|
||||
{{ item.comment }}
|
||||
</div>
|
||||
|
||||
<div class="Msg_iconList">
|
||||
<div class="Msg_iconList_left">
|
||||
<div class="Msg_iconList_leftIcon">
|
||||
<image src="http://192.168.0.172:5500/local_review.png" mode="widthFix"></image>
|
||||
{{ item.merchant_evaluation_reply_list ? item.merchant_evaluation_reply_list.length : 0 }}
|
||||
</div>
|
||||
|
||||
<div class="Msg_iconList_leftIcon">
|
||||
<image v-if="item.is_like == 2" src="http://192.168.0.172:5500/com_likeIcon.png" mode="widthFix"
|
||||
@click="like(item)"></image>
|
||||
<image v-if="item.is_like == 1" src="http://192.168.0.172:5500/com_likeIcon2.png" mode="widthFix"
|
||||
@click="unlike(item)"></image>
|
||||
{{ item.merchant_evaluation_like_list ? item.merchant_evaluation_like_list.length : 0 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="Msg_iconList_right" @click="commentDesc(item)">
|
||||
详情 <div><u-icon name="arrow-right" colof="#999999"></u-icon></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="left">
|
||||
<view class="left_label" @click="handleOptionClick">
|
||||
@ -58,30 +109,67 @@ import {
|
||||
NavgateTo,
|
||||
} from "../../../utils";
|
||||
|
||||
import { apiArr } from "../../../api/v2Community";
|
||||
import { apiArr } from "../../../api/v2local";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
picUrl,
|
||||
info: {},
|
||||
page_num: 1,
|
||||
page_size: 10,
|
||||
commentList: [],
|
||||
flag: false,
|
||||
};
|
||||
},
|
||||
onLoad(options) {},
|
||||
onLoad(options) {
|
||||
this.info = uni.getStorageSync("merchantInfo")
|
||||
},
|
||||
onShow(){
|
||||
this.page_num = 1
|
||||
this.flag = false
|
||||
this.commentList = []
|
||||
this.getCommentList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.flag) {
|
||||
this.getMechantList();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleQuickPayClick() {
|
||||
console.log('快捷支付');
|
||||
// NavgateTo('');
|
||||
NavgateTo('../pay/index');
|
||||
},
|
||||
//获取评论列表
|
||||
getCommentList() {
|
||||
request(apiArr.getMerchantComment, "POST", {
|
||||
page_num: this.page_num,
|
||||
page_size: this.page_size,
|
||||
merchant_id: this.info.id,
|
||||
}).then(res => {
|
||||
this.page_num++
|
||||
if (res.rows.length == this.page_size) {
|
||||
this.flag = true;
|
||||
} else {
|
||||
this.flag = false;
|
||||
}
|
||||
this.commentList = this.commentList.concat(res.rows);
|
||||
})
|
||||
},
|
||||
|
||||
//店铺详情
|
||||
detail_msg() {
|
||||
NavgateTo('../detail_msg/index')
|
||||
},
|
||||
// 导航
|
||||
handleOptionClick() {
|
||||
const { info } = this;
|
||||
let openParmas = {
|
||||
latitude: Number(info.lat),
|
||||
longitude: Number(info.lng),
|
||||
name: info.name,
|
||||
address: info.addr,
|
||||
latitude: Number(info.latitude),
|
||||
longitude: Number(info.longitude),
|
||||
name: info.comAddress,
|
||||
address: info.comAddress,
|
||||
};
|
||||
uni.openLocation(openParmas);
|
||||
},
|
||||
@ -89,7 +177,7 @@ export default {
|
||||
//拨打电话触发事件
|
||||
handlePhoneClick() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.info.tel || '',
|
||||
phoneNumber: this.info.phone || '',
|
||||
fail(err) {
|
||||
console.log('拨打电话失败', err)
|
||||
}
|
||||
@ -98,8 +186,44 @@ export default {
|
||||
|
||||
// 点评
|
||||
handleDiscussClick() {
|
||||
console.log('111');
|
||||
// NavgateTo('');
|
||||
NavgateTo('../comment/index');
|
||||
},
|
||||
|
||||
like(e) {
|
||||
request(apiArr.merChantCommentLike, "POST", {
|
||||
evaluation_id: e.id,
|
||||
}).then(res => {
|
||||
console.log(e);
|
||||
if(e.merchant_evaluation_like_list){
|
||||
e.merchant_evaluation_like_list.push({})
|
||||
}else{
|
||||
e.merchant_evaluation_like_list = []
|
||||
e.merchant_evaluation_like_list.push({})
|
||||
}
|
||||
e.is_like = 1
|
||||
uni.showToast({
|
||||
icon:"none",
|
||||
title: '点赞成功',
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
},
|
||||
unlike(e) {
|
||||
request(apiArr.merChantCommentUnlike, "POST", {
|
||||
evaluation_id: e.id,
|
||||
}).then(res => {
|
||||
e.is_like = 2
|
||||
e.merchant_evaluation_like_list.pop()
|
||||
uni.showToast({
|
||||
title: '取消成功',
|
||||
icon:"none",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
commentDesc(e){
|
||||
NavgateTo(`../UserComment/index?id=${e.id}`)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
9
packages/localLife/detail_msg/index.css
Normal file
9
packages/localLife/detail_msg/index.css
Normal file
@ -0,0 +1,9 @@
|
||||
page {
|
||||
background-color: #f6f7fb;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin-top: 7rpx;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
35
packages/localLife/detail_msg/index.vue
Normal file
35
packages/localLife/detail_msg/index.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<rich-text :nodes="info.description"></rich-text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
request,
|
||||
picUrl,
|
||||
NavgateTo,
|
||||
} from "../../../utils";
|
||||
|
||||
import { apiArr } from "../../../api/v2Community";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
picUrl,
|
||||
info: {},
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.info = uni.getStorageSync("merchantInfo")
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("./index.css");
|
||||
</style>
|
||||
@ -219,7 +219,11 @@ page {
|
||||
height: 82rpx;
|
||||
border-image: linear-gradient(90deg, rgba(255, 255, 255, 1), rgba(215, 215, 215, 1), rgba(255, 255, 255, 1)) 1 1;
|
||||
}
|
||||
|
||||
.lines{
|
||||
background-color: #f5f7f9;
|
||||
height: 40rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.merchantList {
|
||||
padding: 0 20rpx;
|
||||
width: 100%;
|
||||
@ -282,6 +286,7 @@ page {
|
||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||
display: inline-block;
|
||||
margin-top: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.startList {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="container">
|
||||
<div class="local">
|
||||
<image id="local" src="http://192.168.0.172:5500/local_localIcon.png" mode="aspectFill"></image>
|
||||
桃城苑小区西北50米(育才南大街)
|
||||
{{address}}
|
||||
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
||||
</div>
|
||||
|
||||
@ -32,7 +32,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<scroll-view scroll-x="true" enhanced enable-flex class="scrollBox">
|
||||
<div class="lines"></div>
|
||||
<!-- <scroll-view scroll-x="true" enhanced enable-flex class="scrollBox">
|
||||
<div class="scrollView">
|
||||
<div class="scroll-viewItem" v-for="(item, index) in 4" @click="checkItem(index)">
|
||||
<image v-show="!checkedItems[index]" src="http://192.168.0.172:5500/local_uncheck.png"
|
||||
@ -42,29 +43,29 @@
|
||||
买单返物业费
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</scroll-view> -->
|
||||
|
||||
<div class="merchantList">
|
||||
<div class="merchantItem" v-for="itme in 3">
|
||||
<div class="merchantItem" v-for="item in merchatList" :key="item.id" @click="Info(item)">
|
||||
<div class="merchantItem_left">
|
||||
<image src="http://192.168.0.172:5500/test.png" mode="aspectFill"></image>
|
||||
<image :src="picUrl + item.bigImg[0]" mode="aspectFill"></image>
|
||||
</div>
|
||||
<div class="merchantItem_right">
|
||||
<div class="merchantItem_right_tit">
|
||||
<div class="merchantItem_right_tit_left">
|
||||
大发师美容美发店
|
||||
{{item.merchant_name}}
|
||||
</div>
|
||||
<div class="merchantItem_right_tit_right">
|
||||
898km
|
||||
{{item.distances}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="merchantItem_right_con">
|
||||
<div class="merchantItem_right_con_left">
|
||||
<div class="startList">
|
||||
<image v-for="iten in 5" src="http://192.168.0.172:5500/local_start1.png"
|
||||
mode="aspectFill"></image>
|
||||
<image v-for="index in 5" :src="index < item.rating ? 'http://192.168.0.172:5500/local_start1.png' : 'http://192.168.0.172:5500/local_start2.png'" mode="aspectFill"></image>
|
||||
</div>
|
||||
<div class="merchangtItem_tag">买单返物业费</div>
|
||||
<div class="merchangtItem_tag" v-if="item.refund_property_fee_ratio">买单反物业费</div>
|
||||
<div class="merchangtItem_tag" v-if="item.refund_user_points_ratio">买单反积分</div>
|
||||
</div>
|
||||
<div class="merchantItem_right_con_right">
|
||||
<image src="http://192.168.0.172:5500/local_review.png" mode="aspectFill"></image>
|
||||
@ -72,7 +73,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="merchantItem_right_add">
|
||||
苏州市太仓市城厢镇桃园三村11幢105市
|
||||
{{item.comAddress}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -103,6 +104,7 @@ import {
|
||||
picUrl,
|
||||
uniqueByField,
|
||||
menuButtonInfo,
|
||||
calculateDistance,
|
||||
NavgateTo
|
||||
} from '../../../utils';
|
||||
|
||||
@ -118,8 +120,12 @@ export default {
|
||||
swiperList: [
|
||||
],
|
||||
currentIndex: 0,
|
||||
checkedItems: [false, false, false, false]
|
||||
|
||||
checkedItems: [false, false, false, false],
|
||||
address:"",
|
||||
page_size:"10",
|
||||
page_num:"1",
|
||||
flag:false,
|
||||
merchatList:[]
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -128,8 +134,16 @@ export default {
|
||||
// this.top = meun.height + meun.top;
|
||||
this.localHeight = meun.height;
|
||||
this.getCateList();
|
||||
this.getMechantList();
|
||||
this.address = uni.getStorageSync("location").address
|
||||
console.log(this.address)
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
if(this.flag){
|
||||
this.getMechantList();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
@ -139,10 +153,10 @@ export default {
|
||||
checkItem(index) {
|
||||
this.$set(this.checkedItems, index, !this.checkedItems[index]);
|
||||
},
|
||||
|
||||
getCateList() {
|
||||
//查询商家分类
|
||||
async getCateList() {
|
||||
let that = this
|
||||
request(apiArr.getMerChantList, "POST").then(res => {
|
||||
await request(apiArr.getMerChantCateList, "POST").then(res => {
|
||||
console.log(res);
|
||||
// 将数据分成每10个一组
|
||||
const chunkSize = 10;
|
||||
@ -152,6 +166,48 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
//查询商家列表
|
||||
async getMechantList(){
|
||||
let that = this
|
||||
await request(apiArr.getMerchantList, "POST",{
|
||||
page_num:that.page_num,
|
||||
page_size:that.page_size,
|
||||
}).then(res => {
|
||||
let latitude = uni.getStorageSync("location").lat
|
||||
let longitude = uni.getStorageSync("location").lng
|
||||
res.rows.forEach(item => {
|
||||
item.bigImg = item.album_images.split(',')
|
||||
const distanceInKm = calculateDistance(latitude,longitude,item.latitude,item.longitude);
|
||||
item.distances = distanceInKm >= 1 ? `${distanceInKm.toFixed(1)}km` : `${(distanceInKm * 1000).toFixed(1)}m`;
|
||||
|
||||
if(item.ad){
|
||||
item.comAddress = item.ad.ad_name.replace(/,/g, '') + item.address
|
||||
}else{
|
||||
item.comAddress = item.address
|
||||
}
|
||||
});
|
||||
res.rows.sort((a, b) => {
|
||||
const valueA = parseFloat(a.distances.replace('km', '').replace('m', '')) * (a.distances.includes('km') ? 1000 : 1);
|
||||
const valueB = parseFloat(b.distances.replace('km', '').replace('m', '')) * (b.distances.includes('km') ? 1000 : 1);
|
||||
return valueA - valueB;
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(res.rows.length == this.page_size){
|
||||
this.page_num = this.page_num + 1;
|
||||
this.flag = true
|
||||
}else{
|
||||
this.flag = false
|
||||
}
|
||||
this.merchatList = this.merchatList.concat(res.rows)
|
||||
})
|
||||
},
|
||||
//跳转商家详情
|
||||
Info(e){
|
||||
uni.setStorageSync("merchantInfo",e)
|
||||
NavgateTo("../detail/index")
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
|
||||
@ -450,6 +450,13 @@
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail_msg/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商家详情",
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "UserComment/index",
|
||||
"style": {
|
||||
|
||||
@ -190,6 +190,7 @@
|
||||
let preciseLocation = {
|
||||
cityName: address_component.city, // 市区
|
||||
district: address_component.district + address_component.street_number, // 详细地址
|
||||
address: address_component.city + address_component.district + address_component.street_number, // 详细地址
|
||||
lat: latitude,
|
||||
lng: longitude,
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/mp-weixin/app.json
vendored
1
unpackage/dist/dev/mp-weixin/app.json
vendored
@ -117,6 +117,7 @@
|
||||
"shopList/index",
|
||||
"comment/index",
|
||||
"detail/index",
|
||||
"detail_msg/index",
|
||||
"UserComment/index",
|
||||
"pay/index",
|
||||
"payInfo/index",
|
||||
|
||||
43
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
43
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
@ -19342,7 +19342,7 @@ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/inte
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.uploadVideo = exports.upload = exports.uniqueByField = exports.request = exports.picUrl = exports.menuButtonInfo = exports.isPhone = exports.getProviderPromise = exports.floatCalculate = exports.NavgateTo = void 0;
|
||||
exports.uploadVideo = exports.upload = exports.uniqueByField = exports.request = exports.picUrl = exports.menuButtonInfo = exports.isPhone = exports.getProviderPromise = exports.floatCalculate = exports.calculateDistance = exports.NavgateTo = void 0;
|
||||
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
@ -19632,8 +19632,31 @@ var uploadVideo = function uploadVideo(filename, fn) {
|
||||
complete: function complete() {}
|
||||
});
|
||||
};
|
||||
//
|
||||
|
||||
/**
|
||||
* 计算两地之间的距离
|
||||
* @param {string} lat1 第一个点的纬度
|
||||
* @param {string} lon1 第一个点的经度
|
||||
* @param {string} lat2 第二个点的纬度
|
||||
* @param {string} lon2 第二个点的经度
|
||||
* @returns {number} 距离
|
||||
*/
|
||||
exports.uploadVideo = uploadVideo;
|
||||
var calculateDistance = function calculateDistance(lat1, lon1, lat2, lon2) {
|
||||
// 将经纬度转换为弧度
|
||||
var toRad = function toRad(value) {
|
||||
return value * Math.PI / 180;
|
||||
};
|
||||
var R = 6371; // 地球半径(单位:千米)
|
||||
var dLat = toRad(lat2 - lat1);
|
||||
var dLon = toRad(lon2 - lon1);
|
||||
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
|
||||
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
var distance = R * c; // 最终距离(单位:千米)
|
||||
return distance;
|
||||
};
|
||||
//
|
||||
exports.calculateDistance = calculateDistance;
|
||||
var menuButtonInfo = function menuButtonInfo() {
|
||||
var systemInfo = uni.getSystemInfoSync();
|
||||
var platform = systemInfo.platform;
|
||||
@ -20865,7 +20888,21 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.apiArr = void 0;
|
||||
var 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" //发送评论
|
||||
};
|
||||
exports.apiArr = apiArr;
|
||||
|
||||
|
||||
@ -258,6 +258,8 @@ var _default = {
|
||||
// 市区
|
||||
district: address_component.district + address_component.street_number,
|
||||
// 详细地址
|
||||
address: address_component.city + address_component.district + address_component.street_number,
|
||||
// 详细地址
|
||||
lat: latitude,
|
||||
lng: longitude
|
||||
};
|
||||
|
||||
@ -8,8 +8,22 @@
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"name": "packages/shopEnter/apply/index",
|
||||
"pathName": "packages/shopEnter/apply/index",
|
||||
"name": "packages/localLife/comment/index",
|
||||
"pathName": "packages/localLife/comment/index",
|
||||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "packages/localLife/detail/index",
|
||||
"pathName": "packages/localLife/detail/index",
|
||||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "packages/localLife/index/index",
|
||||
"pathName": "packages/localLife/index/index",
|
||||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@ -276,6 +276,30 @@ export const uploadVideo = (filename, fn) => {
|
||||
complete: () => {}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两地之间的距离
|
||||
* @param {string} lat1 第一个点的纬度
|
||||
* @param {string} lon1 第一个点的经度
|
||||
* @param {string} lat2 第二个点的纬度
|
||||
* @param {string} lon2 第二个点的经度
|
||||
* @returns {number} 距离
|
||||
*/
|
||||
export const calculateDistance = (lat1, lon1, lat2, lon2)=>{
|
||||
// 将经纬度转换为弧度
|
||||
const toRad = (value) => (value * Math.PI) / 180;
|
||||
|
||||
const R = 6371; // 地球半径(单位:千米)
|
||||
const dLat = toRad(lat2 - lat1);
|
||||
const dLon = toRad(lon2 - lon1);
|
||||
const a =
|
||||
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
||||
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
|
||||
Math.sin(dLon / 2) * Math.sin(dLon / 2);
|
||||
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
const distance = R * c; // 最终距离(单位:千米)
|
||||
return distance;
|
||||
}
|
||||
//
|
||||
export const menuButtonInfo = () => {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user