123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <template>
- <view class="content">
- <view class="order-item">
- <view class="masterWorker flex" v-if="reportDeatil.processor_user">
- <image class="imgUser" src="../../../static/error/missing-face.png" mode="scaleToFill"></image>
- <view class="padding-l-30">
- <view class="masterName">
- {{reportDeatil.processor_user.staff_name}}
- </view>
- <view class="masterTime margin-t-20">
- 完成时间:{{reportDeatil.processor_time}}
- </view>
- </view>
- </view>
- <view class="flex_item zhil" v-for="(item,index) in rateValue">
- <view>{{item.text}}:</view>
- <view>
- <uni-rate text="1" size="20" margin="10" :value="item.value" @change="rateChange($event,index)">
- </uni-rate>
- </view>
- </view>
- </view>
- <view @click.stop="submit" class="base-buttom">
- 提交并结束报修
- </view>
- </view>
- </template>
- <script>
- import {
- question_score,
- } from '@/api/user.js';
- export default {
- data() {
- return {
- rateValue: [{
- text: '响应速度',
- value: 0,
- }, {
- text: '技术评分',
- value: 0,
- }, {
- text: '服务态度',
- value: 0,
- }],
- };
- },
- props: {
- reportDeatil: {
- type: Object,
- default: function() {
- return {
- }
- }
- },
- },
- methods: {
- // 评分
- rateChange(val, index) {
- console.log(val, index);
- this.rateValue[index].value = val.value
- },
-
- submit(e) {
- let obj = this;
- if (this.rateValue[0].value == 0 || this.rateValue[1].value == 0 || this.rateValue[2].value == 0) {
- uni.showModal({
- title: '错误',
- content: '最低评分为一颗星,请重新选择',
- showCancel: false,
- });
- return
- }
- uni.showLoading({
- title: '提交中',
- mask: true
- });
- question_score({
- id: this.reportDeatil.id,
- response_score: this.rateValue[0].value, //响应频分
- skill_score: this.rateValue[1].value, //技术评分
- attitude_score: this.rateValue[2].value, //服务评分
- })
- .then(e => {
- uni.hideLoading();
- uni.showModal({
- title: '提示',
- content: e.msg,
- showCancel: false,
- success: res => {
- uni.navigateBack()
- },
- });
- })
- .catch(e => {
- uni.showToast({
- title: e.msg,
- icon: 'error'
- });
- uni.hideLoading()
- });
- },
-
- navto(e) {
- uni.navigateTo({
- url: e
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .content {
- padding: 0 $page-row-spacing;
- }
- .order-item {
- display: flex;
- flex-direction: column;
- padding: 30rpx 0;
- border-radius: 20rpx;
- background: #fff;
- margin-top: 20rpx;
- .masterWorker {
- padding: 0 30rpx;
- border-bottom: 1px solid $page-color-light;
- padding-bottom: 30rpx;
- justify-content: flex-start;
- .masterTime {
- font-size: 22rpx;
- color: $font-color-light;
- }
- .masterName {
- color: $font-color-base;
- font-size: 28rpx;
- font-weight: bold;
- }
- .imgUser {
- width: 120rpx;
- height: 120rpx;
- border-radius: 100rpx;
- }
- }
- .flex_item {
- margin: 0 30rpx;
- color: $font-color-base;
- font-size: $font-base;
- }
- }
- .zhil {
- font-size: 28rpx !important;
- padding: 15rpx 15rpx;
- }
- .submit-box {
- bottom: 0;
- left: 0;
- width: 750rpx;
- }
- .submit-btn {
- margin-top: 10px;
- display: inline-block;
- width: 670rpx;
- height: 96rpx;
- line-height: 96rpx;
- text-align: center;
- background-color: #1BCC26 !important;
- opacity: 1;
- border-radius: 32rpx;
- border-width: 8rpx;
- border-color: rgba(255, 255, 255, 1);
- box-shadow: 0rpx 8rpx 12rpx rgba(0, 0, 0, 0.16);
- border-radius: 56rpx;
- font-size: 39rpx;
- font-weight: bold;
- color: rgba(255, 255, 255, 1);
- }
- .address-box {
- padding: 15rpx 40rpx;
- margin-bottom: 10px;
- }
- </style>
|