| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <template>
- <view class="evaluate">
- <view class="content">
- <view class="title">
- 对客户做出评价
- <image src="/static/store/detele.png" mode="" @click="cut"></image>
- </view>
- <view class="rate">
- 综合评价:<u-rate :count="count" v-model="evaluateGrade" active-icon="heart-fill" inactive-icon="heart" size="56"></u-rate>
- </view>
- <view class="tag">
- <view class="item_tag" :class="item.check?'active':''" v-for="item in tagList" :key="item.id" @click="select(item)">
- {{item.labelContent}}
- </view>
- </view>
- <view class="btn">
- <view class="sub" @click="submit">
- 确定
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default{
- name:'evaluate',
- props:{
- userId:{
- type:String,
- default:''
- },
- taskId:{
- type:String,
- default:''
- }
- },
- data(){
- return{
- count: 5,
- evaluateGrade: 0,
- tagList:[]
- }
- },
- methods:{
- getTag(){
- this.$http.get("/ts/merchant/selectLabel?serviceType="+'1909434886438043649').then(res => {
- console.log(res)
- if (res.data.code == 200) {
- res.data.result.forEach(item => {
- item.check = false
- })
- this.tagList = res.data.result
- }
- })
- },
- select(item){
- item.check = !item.check
- },
- cut(){
- this.$emit('cut')
- },
- submit(){
- let data = {
- merchantId: uni.getStorageSync('login_user_info').merchantId,
- merchantName: uni.getStorageSync('login_user_info').merchantName,
- merchantUserId:uni.getStorageSync('login_user_info').id,
- merchantUserName:uni.getStorageSync('login_user_info').name,
- localTsMerchantEvaluateUserLinkLabel:[],
- evaluateGrade:this.evaluateGrade,
- userId:this.userId,
- taskId:this.taskId
- }
- this.tagList.forEach(item => {
- if(item.check){
- data.localTsMerchantEvaluateUserLinkLabel.push({
- labelId:item.id,
- labelName:item.labelContent
- })
- }
- })
- this.$http.post("/ts/merchant/commentUser",data).then(res => {
- console.log(res)
- if (res.data.code == 200) {
- uni.showToast({
- icon:'none',
- title:'评论成功'
- })
- this.cut()
- }
- })
- }
- },
- mounted() {
- console.log(this.taskId)
- this.getTag()
- }
- }
- </script>
- <style lang="scss" scoped>
- .evaluate{
- position: fixed;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.7);
- width: 100%;
- // height: calc(100vh - 100rpx);
- height: 100vh;
- display: flex;
- align-items: end;
- z-index: 999;
- .content{
- width: 100%;
- background-color: #fff;
- padding: 20rpx 25rpx;
- border-radius: 20rpx;
- .title{
- text-align: center;
- border-bottom: 1px solid #EEEEEE;
- padding-bottom: 20rpx;
- margin-bottom: 44rpx;
- image{
- width:37rpx ;
- height: 37rpx;
- float: right;
- }
- }
- .rate{
- font-weight: 600;
- font-size: 30rpx;
- margin-bottom: 48rpx;
- display: flex;
- align-items: center;
- }
- .tag{
- padding-bottom: 42rpx;
- border-bottom: 1px solid #EEEEEE;
- display: flex;
- .item_tag{
- width: 140rpx;
- height: 52rpx;
- border-radius: 4rpx;
- border: 1px solid #C2C2C2;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 26rpx;
- margin-right: 37rpx;
- }
- .active{
- background: rgba(68,154,255,0.1);
- border-radius: 4rpx;
- border: 1px solid #449AFF;
- color: #2983EC;
- }
- }
- .btn{
- width: 100%;
- height:112rpx ;
- padding: 16rpx 24rpx;
- .sub{
- width: 100%;
- height:100%;
- background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);
- border-radius: 53px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- color: #FFFFFF;
- }
- }
- }
- }
- </style>
|