//新办订单-去评价 发行产品,权益产品 | //新办订单-去评价 发行产品,权益产品 | ||||
const gotoEvaluateProduct = (orderInfo: any) => { | const gotoEvaluateProduct = (orderInfo: any) => { | ||||
navTo(`/subpackage/orders/order-evaluate-product?id=${orderInfo.id}`); | |||||
navTo(`/subpackage/orders/order-evaluate-product?id=${orderInfo.id}&orderId=${orderInfo.orderId}`); | |||||
} | } | ||||
//新办订单-去评价 业务办理满意度,业务员满意度 | //新办订单-去评价 业务办理满意度,业务员满意度 | ||||
const gotoEvaluateSalesman = (orderInfo: any) => { | const gotoEvaluateSalesman = (orderInfo: any) => { | ||||
navTo(`/subpackage/orders/order-evaluate-salesman?id=${orderInfo.id}`); | |||||
navTo(`/subpackage/orders/order-evaluate-salesman?id=${orderInfo.id}&orderId=${orderInfo.orderId}`); | |||||
} | } | ||||
//查看物流 | //查看物流 |
"optimization" : { | "optimization" : { | ||||
"subPackages" : true | "subPackages" : true | ||||
}, | }, | ||||
"requiredPrivateInfos" : [ "chooseLocation", "getLocation", "chooseAddress" ] | |||||
"requiredPrivateInfos" : [ "chooseLocation", "getLocation", "chooseAddress" ], | |||||
"permission": { | |||||
"scope.userLocation": { | |||||
"desc": "你的位置信息将用于小程序位置接口的效果展示" // 高速公路行驶持续后台定位 | |||||
} | |||||
} | |||||
}, | }, | ||||
"mp-alipay" : { | "mp-alipay" : { | ||||
"usingComponents" : true | "usingComponents" : true |
}, | }, | ||||
{ | { | ||||
"root": "subpackage/invoice", //发票管理 | "root": "subpackage/invoice", //发票管理 | ||||
"pages": [{ | |||||
"pages": [ | |||||
{ | |||||
"path": "invoiceApply/create-invoice-header-company", | "path": "invoiceApply/create-invoice-header-company", | ||||
"style": { | "style": { | ||||
"navigationBarTitleText": "创建抬头-单位" | "navigationBarTitleText": "创建抬头-单位" | ||||
"navigationBarTitleText": "发票管理" | "navigationBarTitleText": "发票管理" | ||||
} | } | ||||
}, | }, | ||||
{ | |||||
"path": "moreHighMsg/moreHighMsg", | |||||
"style": { | |||||
"navigationBarTitleText": "高速快讯", | |||||
"enablePullDownRefresh":true | |||||
} | |||||
}, | |||||
{ | { | ||||
"path": "invoicing-record", | "path": "invoicing-record", | ||||
"style": { | "style": { | ||||
} | } | ||||
} | } | ||||
] | ] | ||||
}, | |||||
} | |||||
], | ], | ||||
"tabBar": { | "tabBar": { | ||||
"color": "#666666", | "color": "#666666", |
<view class="news"> | <view class="news"> | ||||
<view class="title">高速快讯</view> | <view class="title">高速快讯</view> | ||||
<view class="news-box"> | <view class="news-box"> | ||||
<view class="news-item" @click="$util.msg('该功能正在开发中,敬请期待!')"> | |||||
<view class="news-item" v-for="(item,index) in state.highMsgData" :key='index' @click="link(item)"> | |||||
<view class="left-text"> | <view class="left-text"> | ||||
<view class="tit">贵州高速最新施工通告,请注意贵州高速最新通告,请注意...</view> | |||||
<view class="span">施工通告</view> | |||||
<view class="tit description">{{item.title}}</view> | |||||
<view class="span">{{getCodeName('COPYWRITING',item.copywriting)}}</view> | |||||
</view> | </view> | ||||
<view class="image-box"> | <view class="image-box"> | ||||
<image :src="fileURL + 'image/index/news-1.png'"></image> | |||||
<image :src="fileURL + item.speedUrl"></image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="news-item" @click="$util.msg('该功能正在开发中,敬请期待!')"> | |||||
<!-- <view class="news-item" @click="$util.msg('该功能正在开发中,敬请期待!')"> | |||||
<view class="left-text"> | <view class="left-text"> | ||||
<view class="tit">贵州新建服务区,请注意贵州高速最新通告,请留意...</view> | <view class="tit">贵州新建服务区,请注意贵州高速最新通告,请留意...</view> | ||||
<view class="span">新建</view> | <view class="span">新建</view> | ||||
<view class="image-box"> | <view class="image-box"> | ||||
<image :src="fileURL + 'image/index/news-2.png'"></image> | <image :src="fileURL + 'image/index/news-2.png'"></image> | ||||
</view> | </view> | ||||
</view> | |||||
<view class="more">查看更多</view> | |||||
</view> --> | |||||
<view class="more" @click="$util.navTo('/subpackage/invoice/moreHighMsg/moreHighMsg',true)">查看更多</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
querySwiper, | querySwiper, | ||||
envs, | envs, | ||||
infoQuery, | infoQuery, | ||||
queryHighMsg | |||||
} from "@/utils/network/api.js"; | } from "@/utils/network/api.js"; | ||||
import { | import { | ||||
reactive | reactive | ||||
navTo, | navTo, | ||||
confirm | confirm | ||||
} from "@/utils/utils"; | } from "@/utils/utils"; | ||||
import { | |||||
getCodeName | |||||
} from "@/datas/queryKey.js"; | |||||
const bgOrange = `url(${fileURL}image/index/bg-orange.png) center center no-repeat`; | const bgOrange = `url(${fileURL}image/index/bg-orange.png) center center no-repeat`; | ||||
const bgBlue = `url(${fileURL}image/index/bg-blue.png) center center no-repeat`; | const bgBlue = `url(${fileURL}image/index/bg-blue.png) center center no-repeat`; | ||||
const list = reactive(["您有一条待办事项,还未办理完成"]) | const list = reactive(["您有一条待办事项,还未办理完成"]) | ||||
desc: "支付完成订单", | desc: "支付完成订单", | ||||
}, | }, | ||||
], | ], | ||||
highMsgData:'' //高速快讯内容 | |||||
}); | }); | ||||
const isShowMask = ref(false); | const isShowMask = ref(false); | ||||
const isShowBar = ref(false) | const isShowBar = ref(false) | ||||
quanKeyAction().then((val: any) => { | quanKeyAction().then((val: any) => { | ||||
setItem('key', val.dictTypeAndItem) | setItem('key', val.dictTypeAndItem) | ||||
}) | }) | ||||
highMsg(); //高速快讯 | |||||
}) | }) | ||||
onMounted(() => { | onMounted(() => { | ||||
const strReplace = (str: string) => { | const strReplace = (str: string) => { | ||||
return str.replace('192.168.100.63:8087', envs[process.env.NODE_ENV].baseUrl) | return str.replace('192.168.100.63:8087', envs[process.env.NODE_ENV].baseUrl) | ||||
} | } | ||||
// 高速快讯查询接口 | |||||
const highMsg =()=>{ | |||||
let options = { | |||||
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) | |||||
data: { | |||||
pageNo:1, | |||||
pageSize:2 | |||||
}, //请求参数 | |||||
method: "POST", //提交方式(默认POST) | |||||
showLoading: true, //是否显示加载中(默认显示) | |||||
}; | |||||
//调用方式 | |||||
request(queryHighMsg, options).then((res) => { | |||||
console.log("高速快讯查询接口",stringToJson(res.bizContent)); | |||||
state.highMsgData=stringToJson(res.bizContent).data | |||||
}) | |||||
.catch((err) => { | |||||
}); | |||||
} | |||||
const link=(item)=>{ | |||||
console.log("item",item) | |||||
navTo(`item.hyperLink`) | |||||
} | |||||
</script> | </script> | ||||
<style> | <style> | ||||
.news .image-box image { | .news .image-box image { | ||||
width: 100rpx; | width: 100rpx; | ||||
height: 100rpx; | height: 100rpx; | ||||
border-radius: 10rpx; | |||||
} | } | ||||
.news .span { | .news .span { | ||||
padding: 55rpx 30rpx 30rpx; | padding: 55rpx 30rpx 30rpx; | ||||
} | } | ||||
} | } | ||||
.description{ | |||||
overflow: hidden; | |||||
-webkit-line-clamp: 2; | |||||
text-overflow: ellipsis; | |||||
display: -webkit-box; | |||||
-webkit-box-orient: vertical; | |||||
} | |||||
</style> | </style> |
<!-- 已完成 --> | <!-- 已完成 --> | ||||
<view class="btns" v-else-if="item.orderStep == OrderStatus.已完成"> | <view class="btns" v-else-if="item.orderStep == OrderStatus.已完成"> | ||||
<view v-if="!item.appraise" class='evaluation'> | <view v-if="!item.appraise" class='evaluation'> | ||||
<view class="btn btn-primary" @click.stop="gotoEvaluateOrder(item)" >去评价最初的</view> | |||||
<!-- <view class="btn btn-primary" @click.stop="gotoEvaluateOrder(item)" >去评价最初的</view> --> | |||||
<view class="btn btn-primary" @click.stop="gotoEvaluateProduct(item)" >去评价产品</view> | <view class="btn btn-primary" @click.stop="gotoEvaluateProduct(item)" >去评价产品</view> | ||||
<view class="btn btn-primary" @click.stop="gotoEvaluateSalesman(item)" >去评价业务员</view> | <view class="btn btn-primary" @click.stop="gotoEvaluateSalesman(item)" >去评价业务员</view> | ||||
</view> | </view> |
address: "", | address: "", | ||||
postalCode: "", | postalCode: "", | ||||
promoteId:"", | promoteId:"", | ||||
longitude:"", | |||||
latitude:"" | |||||
}, | }, | ||||
show: false, | show: false, | ||||
addressArray: [], | addressArray: [], | ||||
state.data.promoteId = option.promoteId; | state.data.promoteId = option.promoteId; | ||||
state.isSign=option.isSign | state.isSign=option.isSign | ||||
console.log("订单选择推广发行产品接口",option) | console.log("订单选择推广发行产品接口",option) | ||||
uni.getLocation({ | |||||
type: 'wgs84', | |||||
success: function (res) { | |||||
state.data.longitude=res.longitude; | |||||
state.data.latitude=res.latitude; | |||||
} | |||||
}); | |||||
}); | }); | ||||
//监听页面滚动 | //监听页面滚动 |
<template> | |||||
<div class="content"> | |||||
<div class="item" v-for="(item,index) in state.highMsgData" :key='index' @click="link(item)"> | |||||
<div class="left-content"> | |||||
<div class="description">{{item.title}}</div> | |||||
<div class="mark">{{getCodeName('COPYWRITING',item.copywriting)}}</div> | |||||
</div> | |||||
<image :src="fileURL + item.speedUrl"></image> | |||||
</div> | |||||
<view style="text-align: center;margin: 20rpx;" v-if="state.flags">我是有底线的</view> | |||||
</div> | |||||
</template> | |||||
<script setup lang="ts"> | |||||
import {fileURL} from "@/datas/fileURL.js"; | |||||
import {onPageScroll,onLoad,onPullDownRefresh,onReachBottom} from "@dcloudio/uni-app"; | |||||
import {queryHighMsg} from "@/utils/network/api.js"; | |||||
import {reactive} from "vue"; | |||||
import {stringToJson} from "@/utils/network/encryption.js"; | |||||
import {request} from "@/utils/network/request.js"; | |||||
import {navTo} from "@/utils/utils"; | |||||
import {getCodeName} from "@/datas/queryKey.js"; | |||||
const state = reactive({ | |||||
highMsgData:[], | |||||
flags:false, | |||||
page:1, | |||||
}) | |||||
onLoad(() => { | |||||
highMsg(); //高速快讯 | |||||
}) | |||||
// 下拉刷新 | |||||
onPullDownRefresh(()=>{ | |||||
state.page=1 | |||||
state.highMsgData=[] | |||||
state.flags=false | |||||
console.log('refresh'); | |||||
setTimeout(()=>{ | |||||
highMsg() | |||||
uni.stopPullDownRefresh() | |||||
}, 500); | |||||
}) | |||||
// 触底加载 | |||||
onReachBottom(()=>{ | |||||
if(state.highMsgData.length<state.page*8) return state.flags = true | |||||
console.log("触底了") | |||||
state.page++ | |||||
highMsg() | |||||
}) | |||||
// 高速快讯查询接口 | |||||
const highMsg =()=>{ | |||||
let options = { | |||||
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) | |||||
data: { | |||||
pageNo:state.page, | |||||
pageSize:8 | |||||
}, //请求参数 | |||||
method: "POST", //提交方式(默认POST) | |||||
showLoading: true, //是否显示加载中(默认显示) | |||||
}; | |||||
//调用方式 | |||||
request(queryHighMsg, options).then((res) => { | |||||
console.log("高速快讯查询接口",stringToJson(res.bizContent).data); | |||||
state.highMsgData=[...stringToJson(res.bizContent).data,...state.highMsgData] | |||||
console.log("state.highMsgData",state.highMsgData) | |||||
// state.highMsgData=stringToJson(res.bizContent).data | |||||
}) | |||||
.catch((err) => { | |||||
}); | |||||
} | |||||
const link=(item)=>{ | |||||
console.log("item",item) | |||||
navTo(`item.hyperLink`) | |||||
} | |||||
</script> | |||||
<style scoped> | |||||
.content{ | |||||
background-color: #eef7f7; | |||||
overflow: hidden; | |||||
} | |||||
.item{ | |||||
width: 95%; | |||||
margin:0 auto; | |||||
margin-top: 30rpx; | |||||
background-color: white; | |||||
display: flex; | |||||
padding: 20rpx 30rpx; | |||||
box-sizing: border-box; | |||||
justify-content: space-between; | |||||
border-radius: 14rpx; | |||||
font-size: 30rpx; | |||||
} | |||||
.item>image{ | |||||
width: 100rpx; | |||||
height: 100rpx; | |||||
border-radius: 10rpx; | |||||
} | |||||
.mark{ | |||||
font-size: 22rpx; | |||||
display: inline-block; | |||||
text-align: center; | |||||
background: #bae0f1; | |||||
border-radius: 6rpx; | |||||
color: #0a8f8a; | |||||
padding: 4rpx 8rpx; | |||||
margin-top: 16rpx; | |||||
} | |||||
.left-content{ | |||||
width: 70%; | |||||
} | |||||
.description{ | |||||
overflow: hidden; | |||||
-webkit-line-clamp: 2; | |||||
text-overflow: ellipsis; | |||||
display: -webkit-box; | |||||
-webkit-box-orient: vertical; | |||||
} | |||||
</style> |
<template> | <template> | ||||
<!-- 1,4 --> | <!-- 1,4 --> | ||||
<!-- 产品 --> | <!-- 产品 --> | ||||
<!-- 发行产品评价 --> | |||||
<view class="card" style="padding: 40rpx 30rpx;"> | <view class="card" style="padding: 40rpx 30rpx;"> | ||||
<view class="title">{{state.orderInfo.productName}}</view> | <view class="title">{{state.orderInfo.productName}}</view> | ||||
<evaluate-star v-model="state.product.score" title="评价得分"></evaluate-star> | <evaluate-star v-model="state.product.score" title="评价得分"></evaluate-star> | ||||
<form-image @backImg="backImg($event)" @removeImg="removeImg" :isUrl="false" style="width: 100%;" :retract="-15"></form-image> | <form-image @backImg="backImg($event)" @removeImg="removeImg" :isUrl="false" style="width: 100%;" :retract="-15"></form-image> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- 权益产品评价 --> | |||||
<view class="card" style="padding: 40rpx 30rpx;"> | |||||
<view class="title">{{state.orderInfo.productName}}</view> | |||||
<evaluate-star v-model="state.product.score" title="评价得分"></evaluate-star> | |||||
<textarea class="input-box" v-model="state.product.content" placeholder-class="text-hint" :maxlength="500" | |||||
style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。"> | |||||
</textarea> | |||||
<view class="upload-img"> | |||||
<form-image @backImg="backImg($event)" @removeImg="removeImg" :isUrl="false" style="width: 100%;" :retract="-15"></form-image> | |||||
</view> | |||||
</view> | |||||
<!-- 业务员 --> | |||||
<!-- 业务员满意度评价 --> | |||||
<view class="card" v-if="state.haveUser"> | |||||
<view class="title1">业务员</view> | |||||
<view style="padding: 30rpx 30rpx 45rpx;"> | |||||
<view class="user as-layout-horizontal"> | |||||
<image class="avatar" :src="`${$imgUrl}default_head.png`" mode="aspectFill"></image> | |||||
<view class="user-info"> | |||||
<view class="name">{{state.orderInfo.staffName ?? ''}}</view> | |||||
<view class="name">{{state.orderInfo.staffPhone ?? ''}}</view> | |||||
</view> | |||||
</view> | |||||
<evaluate-star v-model="state.user.score" title="进行评价"></evaluate-star> | |||||
<view class="center as-layout-horizontal"> | |||||
<view class="tags as-layout-horizontal"> | |||||
<view class="tag" v-for="(item,index) in state.user.tagList" :key="item"> | |||||
{{item.label}} | |||||
<image v-if="state.user.tagList.length > 1" class="tag-close" | |||||
:src="`${$imgUrl}common/icon-close.png`" @click="removeTag(item)" /> | |||||
</view> | |||||
</view> | |||||
<image | |||||
:src="`${$imgUrl}common/${state.showTagPop ? 'arror-top.png' : 'arror-down.png'}`" | |||||
style="width: 40rpx;height: 40rpx;" @click="state.showTagPop = !state.showTagPop"></image> | |||||
</view> | |||||
<textarea class="input-box" v-model="state.user.content" placeholder-class="text-hint" | |||||
style="height: 200rpx;" placeholder="请输入评价内容"> | |||||
</textarea> | |||||
<!-- 权益产品评价 --> | |||||
<view class="card" v-if='state.haveInterestsProduct' style="padding: 40rpx 30rpx;"> | |||||
<view class="title">权益产品评价</view> | |||||
<evaluate-star v-model="state.interest.score" title="评价得分"></evaluate-star> | |||||
<textarea class="input-box" v-model="state.interest.content" placeholder-class="text-hint" :maxlength="500" | |||||
style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。"> | |||||
</textarea> | |||||
<view class="upload-img"> | |||||
<form-image @backImg="backImgInterest($event)" @removeImg="removeImgInterest" :isUrl="false" style="width: 100%;" :retract="-15"></form-image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
import {confirm, isBlank, msg} from "@/utils/utils"; | import {confirm, isBlank, msg} from "@/utils/utils"; | ||||
import tagPopup from "./components/popup-order-evaluate-tag"; | import tagPopup from "./components/popup-order-evaluate-tag"; | ||||
import { request } from "@/utils/network/request"; | import { request } from "@/utils/network/request"; | ||||
import { orderDetail, orderEvaluate,orderEvaluateTag,saleMessage } from "@/utils/network/api"; | |||||
import { orderDetail, orderEvaluate,orderEvaluateTag,saleMessage,addEvaluation,judageQuanProduct } from "@/utils/network/api"; | |||||
import {onLoad} from "@dcloudio/uni-app"; | import {onLoad} from "@dcloudio/uni-app"; | ||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; | ||||
import { getItem, StorageKeys } from "@/utils/storage"; | import { getItem, StorageKeys } from "@/utils/storage"; | ||||
const state = reactive({ | const state = reactive({ | ||||
orderInfo:{} as any, //订单信息 | orderInfo:{} as any, //订单信息 | ||||
haveUser: false, //存在有业务员发起的业务展示业务员评价模块 | |||||
showTagPop: false, //显示标签选择弹窗 | showTagPop: false, //显示标签选择弹窗 | ||||
product: { //产品 | product: { //产品 | ||||
score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) | score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) | ||||
content: '', //评价内容 | content: '', //评价内容 | ||||
imageList: [], //支持拍照上传最多上传9张 | imageList: [], //支持拍照上传最多上传9张 | ||||
}, | }, | ||||
interest: { //产品 | |||||
score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) | |||||
content: '', //评价内容 | |||||
imageList: [], //支持拍照上传最多上传9张 | |||||
}, | |||||
user: { //业务员 | user: { //业务员 | ||||
score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) | score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) | ||||
content: '', //评价内容 | content: '', //评价内容 | ||||
tagList: [], //已选择的评价标签列表 | tagList: [], //已选择的评价标签列表 | ||||
}, | }, | ||||
tagAllList:[] | |||||
tagAllList:[], | |||||
orderId:"", | |||||
haveInterestsProduct:false, //是否有权益产品 | |||||
}) | }) | ||||
/* 确认选择tag */ | /* 确认选择tag */ | ||||
const removeImg = (imgList) => { | const removeImg = (imgList) => { | ||||
state.product.imageList = imgList | state.product.imageList = imgList | ||||
} | } | ||||
//选择图片权益产品 | |||||
const backImgInterest = (e: any) => { | |||||
state.interest.imageList = e; | |||||
} | |||||
//删除图片 | |||||
const removeImgInterest = (imgList) => { | |||||
state.interest.imageList = imgList | |||||
} | |||||
/* 删除评价标签 */ | /* 删除评价标签 */ | ||||
const removeTag = (item: any) => { | const removeTag = (item: any) => { | ||||
state.user.tagList.map((tag, index) => { | state.user.tagList.map((tag, index) => { | ||||
/* 发布 */ | /* 发布 */ | ||||
const publish = (e) => { | const publish = (e) => { | ||||
addProduct(); | |||||
} | |||||
const addProduct=()=>{ | |||||
if (state.product.score === 0) { | if (state.product.score === 0) { | ||||
msg('请对产品进行打分!'); | msg('请对产品进行打分!'); | ||||
return; | return; | ||||
} | } | ||||
if (state.haveUser && state.user.score === 0) { | |||||
msg('请对业务员进行打分!'); | |||||
return; | |||||
} | |||||
//若不填评价内容,根据打分规则自动填充评价内容 | //若不填评价内容,根据打分规则自动填充评价内容 | ||||
//差评展示:默认差评 2.5分及以下 | //差评展示:默认差评 2.5分及以下 | ||||
//中评展示:默认中评 2.5以上4.0以下 | //中评展示:默认中评 2.5以上4.0以下 | ||||
state.product.content = "默认好评"; | state.product.content = "默认好评"; | ||||
} | } | ||||
} | } | ||||
if (state.haveUser && !state.user.content) { | |||||
if (state.user.score <= 2.5) { | |||||
state.user.content = "默认差评"; | |||||
} else if (state.user.score > 2.5 && state.user.score < 4) { | |||||
state.user.content = "默认中评"; | |||||
const options = { | |||||
type: 2, | |||||
data: { | |||||
"orderId":state.orderId, | |||||
"serviceType":"product", | |||||
"score":state.product.score, | |||||
"pictureUrl":state.product.imageList.join(";"), | |||||
"message":'', | |||||
"suggestion":state.product.content | |||||
}, | |||||
method: 'POST', | |||||
showLoading: true, | |||||
} | |||||
console.log("options",options) | |||||
debugger; | |||||
request(addEvaluation,options).then((res)=>{ | |||||
if(state.haveInterestsProduct){ | |||||
addProductInterest(); | |||||
}else{ | |||||
confirm('您的评价已发布成功!',()=>{ | |||||
uni.$emit('refreshOrder'); | |||||
uni.navigateBack(); | |||||
},'发布成功',false); | |||||
} | |||||
}) | |||||
} | |||||
const addProductInterest=()=>{ | |||||
if (state.interest.score === 0) { | |||||
msg('请对权益产品进行打分!'); | |||||
return; | |||||
} | |||||
//若不填评价内容,根据打分规则自动填充评价内容 | |||||
//差评展示:默认差评 2.5分及以下 | |||||
//中评展示:默认中评 2.5以上4.0以下 | |||||
//好评展示:默认好评 4.0及4.0以上 | |||||
if (!state.interest.content) { | |||||
if (state.interest.score <= 2.5) { | |||||
state.interest.content = "默认差评"; | |||||
} else if (state.interest.score > 2.5 && state.interest.score < 4) { | |||||
state.interest.content = "默认中评"; | |||||
} else { | } else { | ||||
state.user.content = "默认好评"; | |||||
state.interest.content = "默认好评"; | |||||
} | } | ||||
} | } | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: { | data: { | ||||
"id": state.orderInfo.id, | |||||
'productScore': state.product.score, | |||||
'productAppraise':state.product.content, | |||||
'appraisePics':state.product.imageList.join(";"), | |||||
'staffId':state.orderInfo.staffId, | |||||
'staffName':state.orderInfo.staffName, | |||||
'staffScore':state.user.score, | |||||
'staffTips':getTagIds().join(';'), | |||||
'staffAppraise':state.user.content, | |||||
'opId':getItem(StorageKeys.OpenId) | |||||
"orderId":state.orderId, | |||||
"serviceType":"equity", | |||||
"score":state.interest.score, | |||||
"pictureUrl":state.interest.imageList.join(";"), | |||||
"message":'', | |||||
"suggestion":state.interest.content | |||||
}, | }, | ||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(orderEvaluate,options).then((res)=>{ | |||||
console.log("options",options) | |||||
request(addEvaluation,options).then((res)=>{ | |||||
confirm('您的评价已发布成功!',()=>{ | confirm('您的评价已发布成功!',()=>{ | ||||
uni.$emit('refreshOrder'); | uni.$emit('refreshOrder'); | ||||
uni.navigateBack(); | uni.navigateBack(); | ||||
},'发布成功',false); | },'发布成功',false); | ||||
}) | }) | ||||
} | } | ||||
/* 获取业务员标签ID */ | /* 获取业务员标签ID */ | ||||
const getTagIds = () => { | const getTagIds = () => { | ||||
const list = []; | const list = []; | ||||
}); | }); | ||||
return list; | return list; | ||||
} | } | ||||
/* 获取订单详情 */ | |||||
const getOrderDetails = (id) => { | |||||
// 获取是否有权益产品 | |||||
const isInterestsProduct=(orderId)=>{ | |||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: {"id": id}, | |||||
data: {"orderId": orderId}, | |||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(orderDetail, options).then((res) => { | |||||
console.log("222",stringToJson(res.bizContent)) | |||||
state.orderInfo = stringToJson(res.bizContent); | |||||
state.haveUser = !isBlank(state.orderInfo.staffId); | |||||
request(judageQuanProduct, options).then((res) => { | |||||
console.log("获取是否有业务员",stringToJson(res.bizContent)) | |||||
state.haveInterestsProduct = stringToJson(res.bizContent); | |||||
}) | }) | ||||
} | } | ||||
/* 获取评价标签 */ | |||||
const getEnvTag = () => { | |||||
/* 获取订单详情 */ | |||||
const getOrderDetails = (id) => { | |||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: {}, | |||||
data: {"id": id}, | |||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(orderEvaluateTag, options).then((res) => { | |||||
console.log("111",stringToJson(res.bizContent)) | |||||
state.tagAllList = stringToJson(res.bizContent); | |||||
request(orderDetail, options).then((res) => { | |||||
console.log("获取订单详情",stringToJson(res.bizContent)) | |||||
state.orderInfo = stringToJson(res.bizContent); | |||||
}) | }) | ||||
} | } | ||||
onLoad((option) => { | onLoad((option) => { | ||||
getOrderDetails(option.id); | getOrderDetails(option.id); | ||||
// getEnvTag(); | |||||
state.orderId=option.orderId | |||||
isInterestsProduct(option.orderId); //获取是否有权益产品 | |||||
}) | }) | ||||
</script> | </script> | ||||
</textarea> | </textarea> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="uni-list"> | |||||
<view class="uni-list-cell uni-list-cell-pd"> | |||||
<view class="uni-list-cell-db">是否匿名</view> | |||||
<switch checked /> | |||||
</view> | |||||
</view> | |||||
<view class="btn"> | <view class="btn"> | ||||
<submit-button @submit="publish" title="发布"></submit-button> | <submit-button @submit="publish" title="发布"></submit-button> | ||||
</view> | </view> | ||||
import {confirm, isBlank, msg} from "@/utils/utils"; | import {confirm, isBlank, msg} from "@/utils/utils"; | ||||
import tagPopup from "./components/popup-order-evaluate-tag"; | import tagPopup from "./components/popup-order-evaluate-tag"; | ||||
import { request } from "@/utils/network/request"; | import { request } from "@/utils/network/request"; | ||||
import { orderDetail, orderEvaluate,orderEvaluateTag,salesmanMsg } from "@/utils/network/api"; | |||||
import { orderDetail,orderEvaluateTag,salesmanMsg,addEvaluation,judageSalesman} from "@/utils/network/api"; | |||||
import {onLoad} from "@dcloudio/uni-app"; | import {onLoad} from "@dcloudio/uni-app"; | ||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; | ||||
import { getItem, StorageKeys } from "@/utils/storage"; | import { getItem, StorageKeys } from "@/utils/storage"; | ||||
content: '', //评价内容 | content: '', //评价内容 | ||||
tagList: [], //已选择的评价标签列表 | tagList: [], //已选择的评价标签列表 | ||||
}, | }, | ||||
tagAllList:[] | |||||
tagAllList:[], | |||||
orderId:'', //订单ID | |||||
id:'', | |||||
}) | }) | ||||
/* 确认选择tag 满意度 */ | /* 确认选择tag 满意度 */ | ||||
const confirmSelectTag1 = (selectTag) => { | const confirmSelectTag1 = (selectTag) => { | ||||
/* 发布 */ | /* 发布 */ | ||||
const publish = (e) => { | const publish = (e) => { | ||||
addService(); | |||||
} | |||||
const addService = ()=>{ | |||||
if (state.handle.score === 0) { | if (state.handle.score === 0) { | ||||
msg('请对业务员办理满意度进行打分!'); | msg('请对业务员办理满意度进行打分!'); | ||||
return; | return; | ||||
} | } | ||||
if (state.haveUser && state.user.score === 0) { | |||||
msg('请对业务员进行打分!'); | |||||
return; | |||||
} | |||||
//若不填评价内容,根据打分规则自动填充评价内容 | //若不填评价内容,根据打分规则自动填充评价内容 | ||||
//差评展示:默认差评 2.5分及以下 | //差评展示:默认差评 2.5分及以下 | ||||
//中评展示:默认中评 2.5以上4.0以下 | //中评展示:默认中评 2.5以上4.0以下 | ||||
state.handle.content = "默认好评"; | state.handle.content = "默认好评"; | ||||
} | } | ||||
} | } | ||||
const tagListArr=[]; | |||||
for(var i=0;i<state.handle.tagList.length;i++){ | |||||
tagListArr.push(state.handle.tagList[i].label) | |||||
} | |||||
const options = { | |||||
type: 2, | |||||
data: { | |||||
"orderId":state.orderId, | |||||
"serviceType":"service", | |||||
"score":state.handle.score, | |||||
"message":tagListArr.toString(), | |||||
"suggestion":state.handle.content | |||||
}, | |||||
method: 'POST', | |||||
showLoading: true, | |||||
} | |||||
request(addEvaluation,options).then((res)=>{ | |||||
// 是否对业务员进行评价 | |||||
if(state.haveUser){ | |||||
addStaff(); | |||||
}else{ | |||||
confirm('您的评价已发布成功!',()=>{ | |||||
uni.$emit('refreshOrder'); | |||||
uni.navigateBack(); | |||||
},'发布成功',false); | |||||
} | |||||
}) | |||||
} | |||||
const addStaff = ()=>{ | |||||
if (state.haveUser && state.user.score === 0) { | |||||
msg('请对业务员进行打分!'); | |||||
return; | |||||
} | |||||
if (state.haveUser && !state.user.content) { | if (state.haveUser && !state.user.content) { | ||||
if (state.user.score <= 2.5) { | if (state.user.score <= 2.5) { | ||||
state.user.content = "默认差评"; | state.user.content = "默认差评"; | ||||
state.user.content = "默认好评"; | state.user.content = "默认好评"; | ||||
} | } | ||||
} | } | ||||
const tagListArr=[]; | |||||
for(var i=0;i<state.user.tagList.length;i++){ | |||||
tagListArr.push(state.user.tagList[i].label) | |||||
} | |||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: { | data: { | ||||
"id": state.orderInfo.id, | |||||
'productScore': state.handle.score, | |||||
'productAppraise':state.handle.content, | |||||
// 'appraisePics':state.handle.imageList.join(";"), | |||||
'staffId':state.orderInfo.openId, //业务员ID | |||||
'staffName':state.orderInfo.nickName, | |||||
'staffScore':state.user.score, | |||||
'staffTips':getTagIds().join(';'), | |||||
'staffAppraise':state.user.content, | |||||
'opId':getItem(StorageKeys.OpenId) | |||||
"orderId":state.orderId, | |||||
"serviceType":"staff", | |||||
"score":state.user.score, | |||||
"message":tagListArr.toString(), | |||||
"suggestion":state.user.content | |||||
}, | }, | ||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(orderEvaluate,options).then((res)=>{ | |||||
request(addEvaluation,options).then((res)=>{ | |||||
confirm('您的评价已发布成功!',()=>{ | confirm('您的评价已发布成功!',()=>{ | ||||
uni.$emit('refreshOrder'); | uni.$emit('refreshOrder'); | ||||
uni.navigateBack(); | uni.navigateBack(); | ||||
},'发布成功',false); | },'发布成功',false); | ||||
}) | }) | ||||
} | } | ||||
/* 获取业务员标签ID */ | /* 获取业务员标签ID */ | ||||
const getTagIds = () => { | const getTagIds = () => { | ||||
const list = []; | const list = []; | ||||
return list; | return list; | ||||
} | } | ||||
/* 获取订单详情 */ | |||||
const getOrderDetails = (id) => { | |||||
/* 订单查询业务员简单信息 */ | |||||
const getSalesmanMsg = (id) => { | |||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: {"id": id}, | data: {"id": id}, | ||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(orderDetail, options).then((res) => { | |||||
console.log("stringToJson(res.bizContent)",stringToJson(res.bizContent)) | |||||
request(salesmanMsg, options).then((res) => { | |||||
console.log("订单查询业务员简单信息",stringToJson(res.bizContent)) | |||||
state.orderInfo = stringToJson(res.bizContent); | state.orderInfo = stringToJson(res.bizContent); | ||||
state.haveUser = !isBlank(state.orderInfo.staffId); | |||||
}) | }) | ||||
} | } | ||||
/* 订单查询业务员简单信息 */ | |||||
const getSalesmanMsg = (id) => { | |||||
// 获取是否有业务员 | |||||
const isSalesman=(orderId)=>{ | |||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: {"id": id}, | |||||
data: {"orderId": orderId}, | |||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(salesmanMsg, options).then((res) => { | |||||
console.log("stringToJson(res.bizContent)",stringToJson(res.bizContent)) | |||||
state.orderInfo = stringToJson(res.bizContent); | |||||
// state.haveUser = !isBlank(state.orderInfo.openId); | |||||
state.haveUser = true; | |||||
request(judageSalesman, options).then((res) => { | |||||
console.log("获取是否有业务员",stringToJson(res.bizContent)) | |||||
state.haveUser = stringToJson(res.bizContent); | |||||
getSalesmanMsg(state.id); | |||||
}) | }) | ||||
} | } | ||||
/* 获取评价标签 */ | /* 获取评价标签 */ | ||||
} | } | ||||
onLoad((option) => { | onLoad((option) => { | ||||
// getOrderDetails(option.id); | |||||
getSalesmanMsg(option.id); | |||||
console.log("option",option) | |||||
state.orderId=option.orderId; | |||||
state.id=option.id; | |||||
isSalesman(option.orderId); //获取是否有业务员 | |||||
getEnvTag(); | getEnvTag(); | ||||
}) | }) | ||||
</script> | </script> |
<template> | <template> | ||||
<view class="item-box" v-for="(item,index) in dataList" :key="index"> | <view class="item-box" v-for="(item,index) in dataList" :key="index"> | ||||
<view class="top as-layout-horizontal as-gravity-center-start"> | <view class="top as-layout-horizontal as-gravity-center-start"> | ||||
<view class="as-layout-horizontal as-gravity-center-start"> | |||||
<!-- <view class="as-layout-horizontal as-gravity-center-start"> | |||||
<image :src="`${$imgUrl}user/icon-avatar.png`"></image> | <image :src="`${$imgUrl}user/icon-avatar.png`"></image> | ||||
<text>{{item.name}}</text> | |||||
</view> | |||||
<view class="time">{{item.time}}</view> | |||||
<text>{{item.customerName}}</text> | |||||
</view> --> | |||||
<view class="time">{{item.insertTime}}</view> | |||||
</view> | </view> | ||||
<view class="center"> | <view class="center"> | ||||
<view class="type">这里是业务类型</view> | |||||
<view class="content">{{item.content}}</view> | |||||
<!-- <view class="type">这里是业务办理</view> --> | |||||
<view class="content">{{item.suggestion}}</view> | |||||
</view> | </view> | ||||
<view class="bottom"> | <view class="bottom"> | ||||
box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223,223,223,0.8); | box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223,223,223,0.8); | ||||
border-radius: 20rpx; | border-radius: 20rpx; | ||||
margin-bottom: 30rpx; | margin-bottom: 30rpx; | ||||
.top{ | .top{ | ||||
min-height: 88rpx; | min-height: 88rpx; | ||||
padding: 0rpx 30rpx; | padding: 0rpx 30rpx; | ||||
border-bottom: 1rpx solid #DCDCDC; | border-bottom: 1rpx solid #DCDCDC; | ||||
display: flex; | |||||
justify-content: flex-end; | |||||
image{ | image{ | ||||
width: 50rpx; | width: 50rpx; | ||||
height: 50rpx; | height: 50rpx; |
<view class="top as-layout-horizontal as-gravity-center-start"> | <view class="top as-layout-horizontal as-gravity-center-start"> | ||||
<view class="as-layout-horizontal as-gravity-center-start"> | <view class="as-layout-horizontal as-gravity-center-start"> | ||||
<image :src="`${$imgUrl}order/icon-star-green.png`"></image> | <image :src="`${$imgUrl}order/icon-star-green.png`"></image> | ||||
<text>{{item.title}}</text> | |||||
<text>{{item.equityName}}</text> | |||||
</view> | </view> | ||||
<view class="time">{{item.time}}</view> | |||||
<view class="time">{{item.insertTime}}</view> | |||||
</view> | </view> | ||||
<view class="center"> | <view class="center"> | ||||
<view class="as-layout-horizontal as-gravity-center-start"> | |||||
<!-- <view class="as-layout-horizontal as-gravity-center-start"> | |||||
<image :src="`${$imgUrl}user/icon-avatar.png`" class="avatar"></image> | <image :src="`${$imgUrl}user/icon-avatar.png`" class="avatar"></image> | ||||
<text>{{item.name}}</text> | |||||
</view> | |||||
<view class="content">{{item.content}}</view> | |||||
<text>{{item.customerName}}</text> | |||||
</view> --> | |||||
<view class="content">{{item.suggestion}}</view> | |||||
<view class="images"> | <view class="images"> | ||||
<image class="img" mode="aspectFill" src="https://img0.baidu.com/it/u=1428111848,1239877962&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1677085200&t=f748f4202f23938d5e1cb87b69b0399a" /> | |||||
<image class="img" mode="aspectFill" src="https://img1.baidu.com/it/u=1918872612,2310247544&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1677085200&t=64b412f673823a9c0f3c33044c10f5b8" /> | |||||
<image class="img" mode="aspectFill" src="https://img1.baidu.com/it/u=410286936,2324704554&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1677085200&t=94ac4e946184da00fc51704fdd29626f" /> | |||||
<image class="img" mode="aspectFill" v-for="(itemChild,index) in item.pictureUrl" :src="`${$imgUrl}${itemChild}`" /> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
min-height: 88rpx; | min-height: 88rpx; | ||||
padding: 0rpx 30rpx; | padding: 0rpx 30rpx; | ||||
border-bottom: 1rpx solid #DCDCDC; | border-bottom: 1rpx solid #DCDCDC; | ||||
display: flex; | |||||
justify-content: flex-end; | |||||
image{ | image{ | ||||
width: 48rpx; | width: 48rpx; | ||||
height: 53rpx; | height: 53rpx; |
<view class="top as-layout-horizontal as-gravity-center-start"> | <view class="top as-layout-horizontal as-gravity-center-start"> | ||||
<view class="as-layout-horizontal as-gravity-center-start"> | <view class="as-layout-horizontal as-gravity-center-start"> | ||||
<image :src="`${$imgUrl}order/icon-star-green.png`"></image> | <image :src="`${$imgUrl}order/icon-star-green.png`"></image> | ||||
<text>{{item.title}}</text> | |||||
<text>{{item.productName}}</text> | |||||
</view> | </view> | ||||
<view class="time">{{item.time}}</view> | |||||
<view class="time">{{item.insertTime}}</view> | |||||
</view> | </view> | ||||
<view class="center"> | <view class="center"> | ||||
<view class="as-layout-horizontal as-gravity-center-start"> | |||||
<!-- <view class="as-layout-horizontal as-gravity-center-start"> | |||||
<image :src="`${$imgUrl}user/icon-avatar.png`"></image> | <image :src="`${$imgUrl}user/icon-avatar.png`"></image> | ||||
<text>{{item.name}}</text> | |||||
</view> | |||||
<view class="content">{{item.content}}</view> | |||||
<text>{{item.customerName}}</text> | |||||
</view> --> | |||||
<view class="content">{{item.suggestion}}</view> | |||||
</view> | </view> | ||||
<view class="bottom"> | <view class="bottom"> | ||||
</template> | </template> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
// import {onLoad} from "@dcloudio/uni-app"; | |||||
// const tabClick = defineEmits(['tabClick']) | |||||
defineProps({ | defineProps({ | ||||
//数据列表 | //数据列表 | ||||
dataList:{ | dataList:{ | ||||
} | } | ||||
} | } | ||||
}) | }) | ||||
// onLoad(()=>{ | |||||
// console.log("tabClick",tabClick) | |||||
// }) | |||||
</script> | </script> | ||||
<style lang="scss" scoped> | <style lang="scss" scoped> |
<!-- 业务员满意度评价列表Item --> | <!-- 业务员满意度评价列表Item --> | ||||
<template> | <template> | ||||
业务员满意度评价列表Item(UI未出) | |||||
<view class="item-box" v-for="(item,index) in dataList" :key="index"> | |||||
<view class="top as-layout-horizontal as-gravity-center-start"> | |||||
<view class="as-layout-horizontal as-gravity-center-start"> | |||||
<image :src="`${$imgUrl}user/icon-avatar.png`"></image> | |||||
<text>{{item.staffName}}</text> | |||||
</view> | |||||
<view class="time">{{item.insertTime}}</view> | |||||
</view> | |||||
<view class="center"> | |||||
<!-- <view class="type">这里是业务办理</view> --> | |||||
<view class="content">{{item.suggestion}}</view> | |||||
</view> | |||||
<view class="bottom"> | |||||
<view class="text good" v-if="item.evaluate === '好评'">好评</view> | |||||
<view class="text middle" v-if="item.evaluate === '中评'">中评</view> | |||||
<view class="text bad" v-if="item.evaluate === '差评'">差评</view> | |||||
<view class="score">{{item.score}}分</view> | |||||
</view> | |||||
</view> | |||||
</template> | </template> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
</script> | </script> | ||||
<style lang="scss" scoped> | <style lang="scss" scoped> | ||||
.item-box{ | |||||
background: #ffffff; | |||||
box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223,223,223,0.8); | |||||
border-radius: 20rpx; | |||||
margin-bottom: 30rpx; | |||||
.top{ | |||||
min-height: 88rpx; | |||||
padding: 0rpx 30rpx; | |||||
border-bottom: 1rpx solid #DCDCDC; | |||||
image{ | |||||
width: 50rpx; | |||||
height: 50rpx; | |||||
background: #B2EEE1; | |||||
border-radius: 50%; | |||||
} | |||||
text{ | |||||
margin-left: 20rpx; | |||||
font-size: 30rpx; | |||||
font-family: Noto Sans S Chinese; | |||||
font-weight: 400; | |||||
color: #333333; | |||||
} | |||||
.time{ | |||||
font-size: 26rpx; | |||||
color: #333333; | |||||
text-align: right; | |||||
} | |||||
} | |||||
.center{ | |||||
padding: 28rpx 30rpx; | |||||
border-bottom: 1rpx solid #DCDCDC; | |||||
.type{ | |||||
font-size: 26rpx; | |||||
font-family: Noto Sans S Chinese; | |||||
font-weight: 400; | |||||
color: #999999; | |||||
} | |||||
.content{ | |||||
ffont-size: 26rpx; | |||||
font-family: Noto Sans S Chinese; | |||||
font-weight: 400; | |||||
color: #333333; | |||||
line-height: 46rpx; | |||||
margin-top: 30rpx; | |||||
} | |||||
} | |||||
.bottom{ | |||||
padding: 15rpx 30rpx; | |||||
text-align: right; | |||||
display: flex; | |||||
justify-content: flex-end; | |||||
align-items: center; | |||||
.text{ | |||||
width: 97rpx; | |||||
height: 36rpx; | |||||
line-height: 36rpx; | |||||
border-radius: 18rpx; | |||||
font-size: 26rpx; | |||||
text-align: center; | |||||
} | |||||
.good{ | |||||
background: #FBD9D0; | |||||
color: #DD523E; | |||||
} | |||||
.middle{ | |||||
background: #FBECD0; | |||||
color: #FF9600; | |||||
} | |||||
.bad{ | |||||
background: #E1E1E1; | |||||
color: #999999; | |||||
} | |||||
.score{ | |||||
font-size: 26rpx; | |||||
font-family: Noto Sans S Chinese; | |||||
font-weight: 400; | |||||
color: #333333; | |||||
margin-left: 17rpx; | |||||
} | |||||
} | |||||
} | |||||
</style> | </style> |
<view class="evaluate-btn" v-if="state.type === '2'"> | <view class="evaluate-btn" v-if="state.type === '2'"> | ||||
<submit-button | <submit-button | ||||
title="去评价" | title="去评价" | ||||
@submit="$util.navTo('/subpackage/orders/order-evaluate')" | |||||
@submit="goOrder()" | |||||
></submit-button> | ></submit-button> | ||||
</view> | </view> | ||||
</template> | </template> | ||||
import { reactive } from "vue"; | import { reactive } from "vue"; | ||||
import { request } from "@/utils/network/request"; | import { request } from "@/utils/network/request"; | ||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; | ||||
import { satisfactionEvaluation } from "@/utils/network/api"; | |||||
const state = reactive({ | const state = reactive({ | ||||
type: "", //评价列表类型 1-发行产品评价 2-业务办理满意度评价 3-权益产品评价 4-业务员满意度评价(暂无UI) | type: "", //评价列表类型 1-发行产品评价 2-业务办理满意度评价 3-权益产品评价 4-业务员满意度评价(暂无UI) | ||||
tabs: ["全部", "好评", "中评", "差评"], | tabs: ["全部", "好评", "中评", "差评"], | ||||
curCheckTab: "全部", //当前选择的tab | curCheckTab: "全部", //当前选择的tab | ||||
dataList: [], //评价列表 | dataList: [], //评价列表 | ||||
scoreLevel:0, //0 全部 1 好评 2 中评 3 差评 | |||||
serviceType:'', | |||||
}); | }); | ||||
onLoad((options) => { | onLoad((options) => { | ||||
uni.setNavigationBarTitle({ | uni.setNavigationBarTitle({ | ||||
title: options.title, | title: options.title, | ||||
}); | }); | ||||
if (state.type === "2") { | |||||
state.tabs = [...state.tabs, "业务类型"]; | |||||
} | |||||
// if (state.type === "2") { | |||||
// state.tabs = [...state.tabs, "业务类型"]; | |||||
// } | |||||
fetchList(); | fetchList(); | ||||
}); | }); | ||||
const goOrder=()=>{ | |||||
uni.switchTab({ | |||||
url:"/pages/order/order" | |||||
}) | |||||
} | |||||
/* tab点击 */ | /* tab点击 */ | ||||
const tabClick = (tab) => { | const tabClick = (tab) => { | ||||
console.log("tab",tab) | console.log("tab",tab) | ||||
state.curCheckTab = tab; | |||||
state.curCheckTab = tab; | |||||
if(tab=='全部'){ | |||||
state.scoreLevel=0 | |||||
}else if(tab=='好评'){ | |||||
state.scoreLevel=1 | |||||
}else if(tab=='中评'){ | |||||
state.scoreLevel=2 | |||||
}else{ | |||||
state.scoreLevel=3 | |||||
} | |||||
requestData("11", { type: state.curCheckTab }); | |||||
}; | }; | ||||
/* 根据不同条件获取数据 */ | /* 根据不同条件获取数据 */ | ||||
const fetchList = () => { | const fetchList = () => { | ||||
switch (state.type) { | switch (state.type) { | ||||
case "1": //发行产品评价 | case "1": //发行产品评价 | ||||
state.serviceType='product'; | |||||
requestData("11", { type: state.curCheckTab }); | requestData("11", { type: state.curCheckTab }); | ||||
break; | break; | ||||
case "2": //业务办理满意度评价 | case "2": //业务办理满意度评价 | ||||
state.serviceType='service'; | |||||
requestData("22", { type: state.curCheckTab }); | requestData("22", { type: state.curCheckTab }); | ||||
break; | break; | ||||
case "3": //权益产品评价 | case "3": //权益产品评价 | ||||
state.serviceType='equity'; | |||||
requestData("33", { type: state.curCheckTab }); | requestData("33", { type: state.curCheckTab }); | ||||
break; | break; | ||||
case "4": //业务员满意度评价 | case "4": //业务员满意度评价 | ||||
state.serviceType='staff'; | |||||
requestData("44", { type: state.curCheckTab }); | requestData("44", { type: state.curCheckTab }); | ||||
break; | break; | ||||
default: | default: | ||||
const requestData = (code, data) => { | const requestData = (code, data) => { | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: data, | |||||
data: { | |||||
"serviceType":state.serviceType, | |||||
"scoreLevel":state.scoreLevel, | |||||
}, | |||||
method: "POST", | method: "POST", | ||||
showLoading: true, | showLoading: true, | ||||
}; | }; | ||||
// request(code,options).then((res)=>{ | |||||
// state.dataList = stringToJson(res.bizContent).list; | |||||
// }) | |||||
request(satisfactionEvaluation,options).then((res)=>{ | |||||
//若不填评价内容,根据打分规则自动填充评价内容 | |||||
//差评展示:默认差评 2.5分及以下 | |||||
//中评展示:默认中评 2.5以上4.0以下 | |||||
//好评展示:默认好评 4.0及4.0以上 | |||||
console.log("stringToJson(res.bizContent)",stringToJson(res.bizContent).data) | |||||
const data=stringToJson(res.bizContent).data; | |||||
if(data){ | |||||
for(var i=0;i<data.length;i++){ | |||||
if(data[i].score<=2.5){ | |||||
data[i].evaluate='差评'; | |||||
}else if(data[i].score>2.5 && data[i].score<4){ | |||||
data[i].evaluate='中评'; | |||||
}else{ | |||||
data[i].evaluate='好评'; | |||||
} | |||||
data[i].insertTime = data[i].insertTime.split('T').join(' '); | |||||
// data[i].pictureUrl=data[i].pictureUrl.split(',') | |||||
} | |||||
state.dataList = data; | |||||
}else{ | |||||
state.dataList=[] | |||||
} | |||||
}) | |||||
//TODO 构造假数据 | //TODO 构造假数据 | ||||
state.dataList = [ | |||||
{ | |||||
name: "张三", | |||||
time: "2021-10-01 10:10", | |||||
score: "4.5", | |||||
evaluate: "好评", | |||||
title: "产品A", | |||||
content: | |||||
"这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价", | |||||
}, | |||||
{ | |||||
name: "李四", | |||||
time: "2022-10-01 10:10", | |||||
score: "3.0", | |||||
evaluate: "中评", | |||||
title: "产品B", | |||||
content: | |||||
"这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价", | |||||
}, | |||||
{ | |||||
name: "河西笑傲", | |||||
time: "2023-10-01 10:10", | |||||
score: "2.8", | |||||
evaluate: "差评", | |||||
title: "产品C", | |||||
content: | |||||
"这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价", | |||||
}, | |||||
]; | |||||
// state.dataList = [ | |||||
// { | |||||
// name: "张三", | |||||
// time: "2021-10-01 10:10", | |||||
// score: "4.5", | |||||
// evaluate: "好评", | |||||
// title: "产品A", | |||||
// content: | |||||
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价", | |||||
// }, | |||||
// { | |||||
// name: "李四", | |||||
// time: "2022-10-01 10:10", | |||||
// score: "3.0", | |||||
// evaluate: "中评", | |||||
// title: "产品B", | |||||
// content: | |||||
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价", | |||||
// }, | |||||
// { | |||||
// name: "河西笑傲", | |||||
// time: "2023-10-01 10:10", | |||||
// score: "2.8", | |||||
// evaluate: "差评", | |||||
// title: "产品C", | |||||
// content: | |||||
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价", | |||||
// }, | |||||
// ]; | |||||
}; | }; | ||||
</script> | </script> | ||||
<!-- 满意度评价 --> | <!-- 满意度评价 --> | ||||
<template> | <template> | ||||
<view class="evaluate-box as-layout-horizontal as-gravity-center-start" v-for="(item,index) in list" :key="index" | <view class="evaluate-box as-layout-horizontal as-gravity-center-start" v-for="(item,index) in list" :key="index" | ||||
@click="itemClick(item.id,item.title)"> | |||||
@click="itemClick(item.id,item.title,item)"> | |||||
<view class="icon-bg as-gravity-center"><image :src="`${$imgUrl}remind/${item.icon}.png`"></image></view> | <view class="icon-bg as-gravity-center"><image :src="`${$imgUrl}remind/${item.icon}.png`"></image></view> | ||||
<view class="title">{{item.title}}</view> | <view class="title">{{item.title}}</view> | ||||
</view> | </view> | ||||
] | ] | ||||
/* 跳转到评价列表 */ | /* 跳转到评价列表 */ | ||||
const itemClick = (id,title) => { | |||||
const itemClick = (id,title,item) => { | |||||
const evaluateListUrl = '/subpackage/service/remind/evaluate-list'; | const evaluateListUrl = '/subpackage/service/remind/evaluate-list'; | ||||
navTo(`${evaluateListUrl}?type=${id}&title=${title}`); | navTo(`${evaluateListUrl}?type=${id}&title=${title}`); | ||||
} | } |
export const addProduct="10414819633f46db98158fc7b4e8475e" //加购权益产品 | export const addProduct="10414819633f46db98158fc7b4e8475e" //加购权益产品 | ||||
export const queryDetails="8" //查详情 | export const queryDetails="8" //查详情 | ||||
export const queryHighMsg="64f4a17302774b6eab09f7a1f8364605" //高速快讯查询接口 | |||||
export const addEvaluation="64ed1fdff3b44138ba30d183b613bc7f" //满意度评价-新增 | |||||
export const satisfactionEvaluation="746b5e0375b8474eb3e133b8c79586d8" //满意度评价-分页查询 | |||||
export const judageSalesman="35744a8e282a42ddbc63814303e9e441" //判断是否有业务员 | |||||
export const judageQuanProduct="fe71273c1a394eaa999825afe7daa59b" //判断是否有权益产品 |