Compare commits

...

2 Commits

Author SHA1 Message Date
d13cb45f6a feat: 合并master 2025-06-19 08:54:58 +08:00
e4912a82a8 调用接口6.18 2025-06-19 08:51:19 +08:00
30 changed files with 693 additions and 93 deletions

View File

@ -1,3 +1,10 @@
export const apiArr = { 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",//发送评论
}; };

View File

@ -118,7 +118,6 @@ image {
background-color: #fff; background-color: #fff;
padding-top: 20rpx; padding-top: 20rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
border-bottom: 1rpx solid #EBEBEB;
} }
.HisItem:last-child { .HisItem:last-child {
@ -126,6 +125,7 @@ image {
} }
.His_tit { .His_tit {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -3,28 +3,35 @@
<div class="Msg"> <div class="Msg">
<div class="Msg_Tit"> <div class="Msg_Tit">
<div class="Msg_Tit_left"> <div class="Msg_Tit_left">
<image src="http://192.168.0.172:5500/test.png" mode="aspectFill"></image> <image src="http://192.168.0.172:5500/user_ava.png" v-if="!info.user.avatar" mode="aspectFill">
TP </image>
<image :src="picUrl + info.user.avatar" v-if="info.user.avatar" mode="aspectFill"></image>
{{ info.user.nick_name }}
</div> </div>
<div class="Msg_Tit_right"> <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> </div>
<div class="Msg_con"> <div class="Msg_con">
踏入这家位于街角的餐厅木质门框与暖黄灯光交织出温馨氛围墙面上手绘的食材插画透着文艺气息开放式厨房的设计让食客能看见厨师处理食材的全过程第一印象便给人以干净与安心 {{ info.comment }}
</div> </div>
<div class="Msg_iconList"> <div class="Msg_iconList">
<div class="Msg_iconList_left"> <div class="Msg_iconList_left">
<div class="Msg_iconList_leftIcon"> <div class="Msg_iconList_leftIcon">
<image src="http://192.168.0.172:5500/local_review.png" mode="widthFix"></image> <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>
<div class="Msg_iconList_leftIcon"> <div class="Msg_iconList_leftIcon">
<image src="http://192.168.0.172:5500/com_likeIcon.png" mode="widthFix"></image> <image v-if="info.is_like == 2" src="http://192.168.0.172:5500/com_likeIcon.png" mode="widthFix"
300 @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> </div>
<div class="Msg_iconList_right"> <div class="Msg_iconList_right">
@ -39,7 +46,7 @@
</div> </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">
<div class="reply_tit_left"> <div class="reply_tit_left">
<image src="http://192.168.0.172:5500/test.png" mode="aspectFill"></image> <image src="http://192.168.0.172:5500/test.png" mode="aspectFill"></image>
@ -54,7 +61,8 @@
<div class="comment"> <div class="comment">
<div class="comment_con"> <div class="comment_con">
<image src="http://192.168.0.172:5500/local_send.png" mode="aspectFill"></image> <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> <button id="send" @click="sendComment">发送</button>
</div> </div>
</div> </div>
@ -81,7 +89,9 @@ export default {
picUrl, picUrl,
top: "", top: "",
localHeight: "", localHeight: "",
info: "",
id:"",
reply_content:""
} }
}, },
onLoad(options) { onLoad(options) {
@ -89,6 +99,8 @@ export default {
this.top = meun.top; this.top = meun.top;
// this.top = meun.height + meun.top; // this.top = meun.height + meun.top;
this.localHeight = meun.height; this.localHeight = meun.height;
this.id = options.id
this.getCommentInfo()
}, },
@ -96,9 +108,25 @@ export default {
sendComment() { sendComment() {
// //
console.log('发送评论'); 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({ uni.showModal({
title: '提示', title: '提示',
content: '确定删除?', 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
});
})
},
}, },

View File

@ -236,3 +236,18 @@ image {
top: 24rpx; top: 24rpx;
z-index: 2; 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;
}

View File

@ -3,10 +3,10 @@
<div class="Msg"> <div class="Msg">
<div class="Msg_Tit"> <div class="Msg_Tit">
<div class="Msg_Tit_left"> <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>
<div class="Msg_Tit_right"> <div class="Msg_Tit_right">
七个2锁城 {{info.merchant_name}}
</div> </div>
</div> </div>
@ -14,7 +14,9 @@
<div class="row">满意度</div> <div class="row">满意度</div>
<div class="startList"> <div class="startList">
<div class="start" v-for="(item, index) in 5" :key="index" @click="setRating(index + 1)"> <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> </div>
</div> </div>
@ -23,7 +25,7 @@
<div class="Msg_ipt noneBor"> <div class="Msg_ipt noneBor">
<div class="row">点评</div> <div class="row">点评</div>
<div class="startList"> <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> </div>
</div> </div>
@ -36,8 +38,6 @@
</div> </div>
<div class="Msg2_Con"> <div class="Msg2_Con">
<u-upload v-if="active === 0" :maxCount="8" :fileList="imgList" @afterRead="afterReadVideo" <u-upload v-if="active === 0" :maxCount="8" :fileList="imgList" @afterRead="afterReadVideo"
@delete="deletePic" name="1" multiple @delete="deletePic" name="1" multiple
:custom-style="imgList.length > 0 ? uploadStyle.small : uploadStyle.full" :previewFullImage="true"> :custom-style="imgList.length > 0 ? uploadStyle.small : uploadStyle.full" :previewFullImage="true">
@ -72,6 +72,8 @@
</div> </div>
</div> </div>
<div class="btn1" @click="handleSubmit">确认评价</div>
</div> </div>
</template> </template>
@ -97,7 +99,7 @@ export default {
picUrl, picUrl,
top: "", top: "",
localHeight: "", localHeight: "",
active: 1, active: 0,
videoList: [], videoList: [],
videoList2: [], videoList2: [],
imgList: [], imgList: [],
@ -112,7 +114,9 @@ export default {
height: '120rpx' height: '120rpx'
} }
}, },
rating: 0 rating: 0,
info:'',
comment:""
} }
}, },
onLoad(options) { onLoad(options) {
@ -120,6 +124,8 @@ export default {
this.top = meun.top; this.top = meun.top;
// this.top = meun.height + meun.top; // this.top = meun.height + meun.top;
this.localHeight = meun.height; this.localHeight = meun.height;
this.info = uni.getStorageSync("merchantInfo")
}, },
@ -139,7 +145,7 @@ export default {
upload(item.url, res => { upload(item.url, res => {
console.log(res.data.path); console.log(res.data.path);
this.imgList.push({ url: this.picUrl + 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 => { uploadVideo(e.file.url, res => {
console.log(res.data.url); console.log(res.data.url);
this.videoList.push({ url: this.picUrl + 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) { cancels(e) {
@ -162,7 +168,26 @@ export default {
}, },
setRating(rating) { setRating(rating) {
this.rating = 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")
})
},
}, },

View File

@ -1,36 +1,56 @@
page { page {
background-color: #f6f7fb; background-color: #f6f7fb;
} }
.container { .container {
margin-top: 7rpx; margin-top: 7rpx;
} }
.white_container { .white_container {
background: #FFFFFF; background: #FFFFFF;
padding: 20rpx; padding: 20rpx;
padding-bottom: 28rpx;
} }
.swiper {
width: 710rpx;
height: 400rpx;
}
.pic { .pic {
width: 710rpx; width: 710rpx;
height: 400rpx; height: 400rpx;
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
} }
.main { .main {
margin: 37rpx 10rpx 0; margin: 37rpx 10rpx 0;
} }
.title { .title {
font-weight: 600; font-weight: 600;
font-size: 40rpx; font-size: 40rpx;
color: #000000; color: #000000;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.table { .table {
display: flex; display: flex;
font-size: 26rpx; font-size: 26rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.table {
display: flex;
align-items: center;
justify-content: space-between;
}
.label { .label {
color: #999999; color: #999999;
margin-right: 36rpx; margin-right: 36rpx;
} }
.desc { .desc {
color: #000000; color: #000000;
white-space: nowrap; white-space: nowrap;
@ -39,15 +59,20 @@ margin-bottom: 20rpx;
flex: 1; flex: 1;
display: block; display: block;
} }
.detail { .detail {
margin-top: 20rpx; margin-top: 20rpx;
} }
.particulars { .particulars {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 30rpx; font-size: 30rpx;
color: #FF370B; color: #FF370B;
padding-top: 28rpx;
border-top: 1rpx solid #E6E6E6;
} }
.bottom { .bottom {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@ -58,22 +83,26 @@ color: #FF370B;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.left { .left {
display: flex; display: flex;
margin-top: 22rpx; margin-top: 22rpx;
margin-left: 48rpx; margin-left: 48rpx;
} }
.left_label { .left_label {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin-right: 30rpx; margin-right: 30rpx;
} }
.left_label > image {
.left_label>image {
width: 32rpx; width: 32rpx;
height: 30rpx; height: 30rpx;
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.btn { .btn {
width: 230rpx; width: 230rpx;
height: 70rpx; height: 70rpx;
@ -84,6 +113,106 @@ color: #FF370B;
color: #FFFFFF; color: #FFFFFF;
/* display: inline-block; */ /* display: inline-block; */
/* padding: 10rpx 44rpx; */ /* padding: 10rpx 44rpx; */
background: linear-gradient( 91deg, #FF7658 0%, #FF370B 100%); background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
border-radius: 100rpx 100rpx 100rpx 100rpx; 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;
} }

View File

@ -1,48 +1,99 @@
<template> <template>
<view class="container"> <view class="container">
<view class="white_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="main">
<view class="title">七个2锁城</view> <view class="title">{{ info.merchant_name }}</view>
<u-icon name="star-fill" color="#FFB84D" />
<u-line margin="46rpx 0 30rpx 0"/> <!-- <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="table">
<view class="label">联系电话</view> <view class="label">联系电话</view>
<view class="desc">15901518415</view> <view class="desc">{{ info.phone }}</view>
</view> </view>
<view class="table"> <view class="table">
<view class="label">营业时间</view> <view class="label">营业时间</view>
<view class="desc">05:00至24:00</view> <view class="desc">{{ info.business_hours }}</view>
</view> </view>
<view class="table"> <view class="table">
<view class="label">营业地址</view> <view class="label">营业地址</view>
<view class="desc">河北省衡水市桃城区自强街路东综合楼1栋8号门店</view> <view class="desc">{{ info.comAddress }}</view>
</view> </view>
<view class="table"> <view class="table mb32">
<view class="label">特色服务</view> <view class="label">特色服务</view>
<view class="desc">开锁换锁修锁指纹锁配汽车钥匙</view> <view class="desc">{{ info.features }}</view>
</view>
<view class="particulars" @click="detail_msg">
<view>查看详情</view>
<u-icon name="arrow-right" size="30" />
</view> </view>
</view>
</view>
<view class="white_container detail">
<view class="particulars">
<view>查看详情</view>
<u-icon name="arrow-right" size="30" />
</view> </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="bottom">
<view class="left"> <view class="left">
<view class="left_label" @click="handleOptionClick"> <view class="left_label" @click="handleOptionClick">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Index_add.png" mode="" /> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Index_add.png" mode="" />
<view>导航</view> <view>导航</view>
</view> </view>
<view class="left_label" @click="handlePhoneClick"> <view class="left_label" @click="handlePhoneClick">
<image src="http://127.0.0.1:5500/assets/localLife_detail_Frame.png" mode="" /> <image src="http://127.0.0.1:5500/assets/localLife_detail_Frame.png" mode="" />
<view>电话</view> <view>电话</view>
</view> </view>
<view class="left_label" @click="handleDiscussClick"> <view class="left_label" @click="handleDiscussClick">
<image src="http://127.0.0.1:5500/assets/localLife_shopList_Group_1334.png" mode="" /> <image src="http://127.0.0.1:5500/assets/localLife_shopList_Group_1334.png" mode="" />
<view>点评</view> <view>点评</view>
</view> </view>
</view> </view>
@ -58,30 +109,67 @@ import {
NavgateTo, NavgateTo,
} from "../../../utils"; } from "../../../utils";
import { apiArr } from "../../../api/v2Community"; import { apiArr } from "../../../api/v2local";
export default { export default {
data() { data() {
return { return {
picUrl,
info: {}, 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: { methods: {
handleQuickPayClick() { handleQuickPayClick() {
console.log('快捷支付'); NavgateTo('../pay/index');
// NavgateTo(''); },
//
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() { handleOptionClick() {
const { info } = this; const { info } = this;
let openParmas = { let openParmas = {
latitude: Number(info.lat), latitude: Number(info.latitude),
longitude: Number(info.lng), longitude: Number(info.longitude),
name: info.name, name: info.comAddress,
address: info.addr, address: info.comAddress,
}; };
uni.openLocation(openParmas); uni.openLocation(openParmas);
}, },
@ -89,7 +177,7 @@ export default {
// //
handlePhoneClick() { handlePhoneClick() {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.info.tel || '', phoneNumber: this.info.phone || '',
fail(err) { fail(err) {
console.log('拨打电话失败', err) console.log('拨打电话失败', err)
} }
@ -98,8 +186,44 @@ export default {
// //
handleDiscussClick() { handleDiscussClick() {
console.log('111'); NavgateTo('../comment/index');
// NavgateTo(''); },
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}`)
}, },
}, },
}; };

View File

@ -0,0 +1,9 @@
page {
background-color: #f6f7fb;
}
.container {
margin-top: 7rpx;
padding: 20rpx;
background-color: #fff;
}

View 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>

View File

@ -219,7 +219,11 @@ page {
height: 82rpx; height: 82rpx;
border-image: linear-gradient(90deg, rgba(255, 255, 255, 1), rgba(215, 215, 215, 1), rgba(255, 255, 255, 1)) 1 1; 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 { .merchantList {
padding: 0 20rpx; padding: 0 20rpx;
width: 100%; width: 100%;
@ -282,6 +286,7 @@ page {
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: inline-block; display: inline-block;
margin-top: 20rpx; margin-top: 20rpx;
margin-right: 10rpx;
} }
.startList { .startList {

View File

@ -2,7 +2,7 @@
<div class="container"> <div class="container">
<div class="local"> <div class="local">
<image id="local" src="http://192.168.0.172:5500/local_localIcon.png" mode="aspectFill"></image> <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> <u-icon name="arrow-down" color="#999999" size="28"></u-icon>
</div> </div>
@ -32,7 +32,8 @@
</div> </div>
</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="scrollView">
<div class="scroll-viewItem" v-for="(item, index) in 4" @click="checkItem(index)"> <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" <image v-show="!checkedItems[index]" src="http://192.168.0.172:5500/local_uncheck.png"
@ -42,29 +43,29 @@
买单返物业费 买单返物业费
</div> </div>
</div> </div>
</scroll-view> </scroll-view> -->
<div class="merchantList"> <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"> <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>
<div class="merchantItem_right"> <div class="merchantItem_right">
<div class="merchantItem_right_tit"> <div class="merchantItem_right_tit">
<div class="merchantItem_right_tit_left"> <div class="merchantItem_right_tit_left">
大发师美容美发店 {{item.merchant_name}}
</div> </div>
<div class="merchantItem_right_tit_right"> <div class="merchantItem_right_tit_right">
898km {{item.distances}}
</div> </div>
</div> </div>
<div class="merchantItem_right_con"> <div class="merchantItem_right_con">
<div class="merchantItem_right_con_left"> <div class="merchantItem_right_con_left">
<div class="startList"> <div class="startList">
<image v-for="iten in 5" src="http://192.168.0.172:5500/local_start1.png" <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>
mode="aspectFill"></image>
</div> </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>
<div class="merchantItem_right_con_right"> <div class="merchantItem_right_con_right">
<image src="http://192.168.0.172:5500/local_review.png" mode="aspectFill"></image> <image src="http://192.168.0.172:5500/local_review.png" mode="aspectFill"></image>
@ -72,7 +73,7 @@
</div> </div>
</div> </div>
<div class="merchantItem_right_add"> <div class="merchantItem_right_add">
苏州市太仓市城厢镇桃园三村11幢105市 {{item.comAddress}}
</div> </div>
</div> </div>
</div> </div>
@ -103,6 +104,7 @@ import {
picUrl, picUrl,
uniqueByField, uniqueByField,
menuButtonInfo, menuButtonInfo,
calculateDistance,
NavgateTo NavgateTo
} from '../../../utils'; } from '../../../utils';
@ -118,8 +120,12 @@ export default {
swiperList: [ swiperList: [
], ],
currentIndex: 0, currentIndex: 0,
checkedItems: [false, false, false, false] checkedItems: [false, false, false, false],
address:"",
page_size:"10",
page_num:"1",
flag:false,
merchatList:[]
} }
}, },
onLoad(options) { onLoad(options) {
@ -128,8 +134,16 @@ export default {
// this.top = meun.height + meun.top; // this.top = meun.height + meun.top;
this.localHeight = meun.height; this.localHeight = meun.height;
this.getCateList(); this.getCateList();
this.getMechantList();
this.address = uni.getStorageSync("location").address
console.log(this.address)
}, },
onReachBottom() {
if(this.flag){
this.getMechantList();
}
},
methods: { methods: {
swiperChange(e) { swiperChange(e) {
@ -139,10 +153,10 @@ export default {
checkItem(index) { checkItem(index) {
this.$set(this.checkedItems, index, !this.checkedItems[index]); this.$set(this.checkedItems, index, !this.checkedItems[index]);
}, },
//
getCateList() { async getCateList() {
let that = this let that = this
request(apiArr.getMerChantList, "POST").then(res => { await request(apiArr.getMerChantCateList, "POST").then(res => {
console.log(res); console.log(res);
// 10 // 10
const chunkSize = 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")
},
}, },

View File

@ -450,6 +450,13 @@
"navigationBarBackgroundColor": "#fff" "navigationBarBackgroundColor": "#fff"
} }
}, },
{
"path": "detail_msg/index",
"style": {
"navigationBarTitleText": "商家详情",
"navigationBarBackgroundColor": "#fff"
}
},
{ {
"path": "UserComment/index", "path": "UserComment/index",
"style": { "style": {

View File

@ -190,6 +190,7 @@
let preciseLocation = { let preciseLocation = {
cityName: address_component.city, // cityName: address_component.city, //
district: address_component.district + address_component.street_number, // district: address_component.district + address_component.street_number, //
address: address_component.city + address_component.district + address_component.street_number, //
lat: latitude, lat: latitude,
lng: longitude, 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

View File

@ -117,6 +117,7 @@
"shopList/index", "shopList/index",
"comment/index", "comment/index",
"detail/index", "detail/index",
"detail_msg/index",
"UserComment/index", "UserComment/index",
"pay/index", "pay/index",
"payInfo/index", "payInfo/index",

View File

@ -19342,7 +19342,7 @@ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/inte
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true 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)); 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 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; } 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() {} complete: function complete() {}
}); });
}; };
//
/**
* 计算两地之间的距离
* @param {string} lat1 第一个点的纬度
* @param {string} lon1 第一个点的经度
* @param {string} lat2 第二个点的纬度
* @param {string} lon2 第二个点的经度
* @returns {number} 距离
*/
exports.uploadVideo = uploadVideo; 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 menuButtonInfo = function menuButtonInfo() {
var systemInfo = uni.getSystemInfoSync(); var systemInfo = uni.getSystemInfoSync();
var platform = systemInfo.platform; var platform = systemInfo.platform;
@ -20873,7 +20896,21 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.apiArr = void 0; exports.apiArr = void 0;
var apiArr = { 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; exports.apiArr = apiArr;

View File

@ -258,6 +258,8 @@ var _default = {
// 市区 // 市区
district: address_component.district + address_component.street_number, district: address_component.district + address_component.street_number,
// 详细地址 // 详细地址
address: address_component.city + address_component.district + address_component.street_number,
// 详细地址
lat: latitude, lat: latitude,
lng: longitude lng: longitude
}; };

View File

@ -8,6 +8,7 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
<<<<<<< HEAD
"name": "师傅端详情页", "name": "师傅端详情页",
"pathName": "packages/workOrderDashboard/detail/index", "pathName": "packages/workOrderDashboard/detail/index",
"query": "id=12", "query": "id=12",
@ -22,6 +23,8 @@
"scene": null "scene": null
}, },
{ {
=======
>>>>>>> e4912a82a85c39559af5bbf9f538f54bfe7ecde7
"name": "packages/localLife/comment/index", "name": "packages/localLife/comment/index",
"pathName": "packages/localLife/comment/index", "pathName": "packages/localLife/comment/index",
"query": "", "query": "",
@ -29,15 +32,25 @@
"scene": null "scene": null
}, },
{ {
<<<<<<< HEAD
"name": "师傅端列表", "name": "师傅端列表",
"pathName": "packages/workOrderDashboard/index/index", "pathName": "packages/workOrderDashboard/index/index",
=======
"name": "packages/localLife/detail/index",
"pathName": "packages/localLife/detail/index",
>>>>>>> e4912a82a85c39559af5bbf9f538f54bfe7ecde7
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
<<<<<<< HEAD
"name": "商家入驻", "name": "商家入驻",
"pathName": "packages/shopEnter/apply/index", "pathName": "packages/shopEnter/apply/index",
=======
"name": "packages/localLife/index/index",
"pathName": "packages/localLife/index/index",
>>>>>>> e4912a82a85c39559af5bbf9f538f54bfe7ecde7
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null

View File

@ -276,6 +276,30 @@ export const uploadVideo = (filename, fn) => {
complete: () => {} 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 = () => { export const menuButtonInfo = () => {
const systemInfo = uni.getSystemInfoSync(); const systemInfo = uni.getSystemInfoSync();