123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- <template>
- <view class="u-page">
- <!-- <u--input placeholder="请输入手机号或订单" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399"-->
- <!-- v-model="numValue"></u--input>-->
- <u-search shape="round" v-model="no" @search="getList(accountId,userId)"
- placeholder="请输入手机号或订单" input-align="center" :show-action="false"></u-search>
- <u-list @scrolltolower="scrolltolower">
- <view v-for="(item, index) in orderList" :key="index">
- <u-cell :value="item.CURRENT_VALUE" :isLink="true" :url="item.URL" :stop="false">
- <view slot="title" class="u-slot-title">
- <text class="u-cell-text">客户单号:{{item.CUSTOMER_REFFERENCE_ID}}</text>
- <u-tag :text="item.STATUS_TEXT" size="mini" :type="item.TEXT_TYPE"></u-tag>
- </view>
- <view slot="title" class="u-slot-title">
- <text class="u-cell-text">货主名称:{{item.CUSTOMER_NAME}}</text>
- </view>
- <view slot="title" class="u-slot-title">
- <text class="u-cell-text">收货方名称:{{item.RECEIVER_NAME}}</text>
- </view>
- <view style="display: flex;flex-direction: column;align-items: flex-start;padding-top: 10px" slot="label">
- <u-row>
- <u-button type="primary" size="mini" @click.native.stop="handleDetails(item)">明细详情</u-button>
- <u-button type="primary" size="mini" @click.native.stop="handleEvaluation($event,item)">{{item.EVALUATION_STATUS}}</u-button>
- </u-row>
- </view>
- </u-cell>
- </view>
- </u-list>
- <u-modal
- :show="show"
- :title="evaluationTitle"
- :showConfirmButton="true"
- :showCancelButton="true"
- @confirm="evaluationConfirm"
- @cancel="evaluationCancel"
- confirmText="提交评价"
- cancelText="取消"
- :closeOnClickOverlay="true"
- >
- <view class="evaluation-container">
- <view class="evaluation-item" v-for="(item, index) in evaluationItems" :key="index">
- <view class="evaluation-label">
- <text>{{item.label}}</text>
- </view>
- <view class="evaluation-rate">
- <u-rate
- :count="item.count"
- v-model="evaluation[item.field]"
- activeColor="#ff9900"
- inactiveColor="#dcdcdc"
- gutter="8"
- size="22"
- ></u-rate>
- </view>
- </view>
-
- <view class="evaluation-textarea">
- <view class="textarea-label">评价建议</view>
- <u--textarea
- v-model="evaluation.evaluationRemark"
- placeholder="请输入您的评价和建议..."
- count
- maxlength="200"
- height="100"
- :customStyle="{
- backgroundColor: '#f5f5f5',
- padding: '12rpx',
- borderRadius: '8rpx'
- }"
- ></u--textarea>
- </view>
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- import {evaluationOrder, getOrderList,getOrderDetailList} from "@/api";
- export default {
- data() {
- return {
- no: undefined,
- accountId:undefined,
- userId:undefined,
- show:false,
- numValue:undefined,
- triggered:false,
- // evaluationShow:false,
- orderList: [],
- driverEvaluationCount: 4,
- customerServiceEvaluationCount: 4,
- warehouseEvaluationCount: 4,
- timelinessEvaluationCount: 4,
- goodsEvaluationCount: 4,
- evaluation: {
- orderCenterOrderId: undefined,
- driverEvaluation: 0,
- customerServiceEvaluation: 0,
- warehouseEvaluation: 0,
- timelinessEvaluation: 0,
- goodsEvaluation: 0,
- evaluationRemark: undefined,
- },
- evaluationTitle: '服务评价',
- evaluationItems: [
- { label: '司机服务', field: 'driverEvaluation', count: 4 },
- { label: '客服态度', field: 'customerServiceEvaluation', count: 4 },
- { label: '仓库服务', field: 'warehouseEvaluation', count: 4 },
- { label: '配送时效', field: 'timelinessEvaluation', count: 4 },
- { label: '货物状态', field: 'goodsEvaluation', count: 4 }
- ],
- indexList: [],
- urls: [
- "https://xxx.com/album/1.jpg",
- "https://xxx.com/album/2.jpg",
- "https://xxx.com/album/3.jpg",
- "https://xxx.com/album/4.jpg",
- "https://xxx.com/album/5.jpg",
- "https://xxx.com/album/6.jpg",
- "https://xxx.com/album/7.jpg",
- "https://xxx.com/album/8.jpg",
- "https://xxx.com/album/9.jpg",
- "https://xxx.com/album/10.jpg",
- ],
- };
- },
- created() {
- if (uni.getStorageSync('accountId')) {
- this.accountId = uni.getStorageSync('accountId')
- }
- if (uni.getStorageSync('userId')) {
- this.userId = uni.getStorageSync('userId')
- }
- this.getList(this.accountId,this.userId)
- },
- onLoad() {
- this.loadmore();
- },
- methods: {
- getList(accountId,userId){
- if(null == accountId || null == userId)
- {
- uni.showToast({
- title: "请重新登录",
- icon: "none"
- })
- return
- }
- // 获取当前订单list
- let params = {
- accountId: accountId,
- userId: userId
- }
- if (this.no){
- params.no = this.no
- }
- getOrderList(params).then(res => {
- if (res.data){
- // 对数据进行处理
- for (let i = 0; i < res.data.length; i++) {
- if (res.data[i].DRIVER_EVALUATION || res.data[i].WAREHOUSE_EVALUATION
- || res.data[i].CUSTOMER_SERVICE_EVALUATION || res.data[i].TIMELINESS_EVALUATION
- || res.data[i].GOODS_EVALUATION) {
- res.data[i].EVALUATION_STATUS = "已评价";
- } else {
- res.data[i].EVALUATION_STATUS = "待评价";
- }
- if (res.data[i].ORDER_CENTER_ORDER_STATUS === 300010) {
- res.data[i].STATUS_TEXT = "已审核";
- }
- else if (res.data[i].ORDER_CENTER_ORDER_STATUS === 300015 || res.data[i].ORDER_CENTER_ORDER_STATUS === 300020
- || res.data[i].ORDER_CENTER_ORDER_STATUS === 300025){
- res.data[i].STATUS_TEXT = "运输中";
- res.data[i].CURRENT_VALUE = "物流轨迹";
- res.data[i].URL = "/pages/index/tracktrace?id=" + res.data[i].ORDER_CENTER_ORDER_ID;
- res.data[i].TEXT_TYPE = "warning";
- }else if (res.data[i].ORDER_CENTER_ORDER_STATUS === 300030){
- res.data[i].STATUS_TEXT = "已签收";
- res.data[i].CURRENT_VALUE = "签收详情";
- res.data[i].URL = "/pages/index/signInfo?id=" + res.data[i].ORDER_CENTER_ORDER_ID;
- res.data[i].TEXT_TYPE = "success";
- }
- }
- this.orderList = res.data;
- }
- }).catch(err => {
- console.error(err);
- });
- },
- handleDetails(item) {
- // 跳转到orderDetailList页面并传递参数
- uni.navigateTo({
- url: `/pages/index/orderDetailList?accountId=${item.ACCOUNT_ID}&userId=${item.USER_ID}&orderCenterOrderId=${item.ORDER_CENTER_ORDER_ID}`
- });
- },
- handleEvaluation(event,item) {
- // 阻止事件冒泡,这样点击按钮就不会触发 u-cell 的点击事件了
- event.stopPropagation();
- if (item.EVALUATION_STATUS === "已评价") {
- uni.showToast({
- title: "当前已评价",
- icon: "none"
- })
- return
- }
- else {
- this.evaluation.orderCenterOrderId = item.ORDER_CENTER_ORDER_ID
- this.show = true
- console.log(this.show)
- }
- },
- evaluationConfirm() {
- // 提交评价
- evaluationOrder(this.evaluation).then(res => {
- if (res.code === "success") {
- uni.showToast({
- title: "评价成功",
- icon: "success"
- })
- this.getList()
- }
- }).catch(err => {
- uni.showToast({
- title: "评价失败",
- icon: err
- })
- })
- this.show = false
- },
- evaluationCancel() {
- // 取消评价
- this.evaluation = {
- orderCenterOrderId: undefined,
- driverEvaluation: 0,
- customerServiceEvaluation: 0,
- warehouseEvaluation: 0,
- timelinessEvaluation: 0,
- goodsEvaluation: 0,
- evaluationRemark: undefined
- },
- this.show = false
- },
- scrolltolower() {
- this.loadmore();
- },
- loadmore() {
- for (let i = 0; i < 30; i++) {
- this.indexList.push({
- url: this.urls[uni.$u.random(0, this.urls.length - 1)],
- });
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- @import '@/common/adaptive.scss';
- .cell-page {
- padding-bottom: 20px;
- }
- .cell-box {
- &__title {
- font-size: 14px;
- color: rgb(143, 156, 162);
- margin: 20px 0px 0px 15px;
- }
- &__block {
- // background-color: #fff;
- margin-top: 20px;
- }
- }
- .u-page {
- padding: 0;
- &__item {
- &__title {
- color: $u-tips-color;
- background-color: $u-bg-color;
- padding: 15px;
- font-size: 15px;
- &__slot-title {
- color: $u-primary;
- font-size: 14px;
- }
- }
- }
- }
- .u-slot-title {
- @include flex;
- flex-direction: row;
- align-items: center;
- margin-bottom: 4px;
- }
- .u-cell-text {
- font-size: 15px;
- line-height: 22px;
- color: #303133;
- margin-right: 5px;
- }
- .u-slot-value {
- line-height: 14px;
- text-align: center;
- font-size: 10px;
- padding: 0 5px;
- height: 17px;
- color: #FFFFFF;
- border-radius: 100px;
- background-color: #f56c6c;
- }
- /deep/ .u-button {
- min-width: 80px;
- margin-right: 10px;
- }
- /deep/ .u-cell {
- margin-bottom: 4px;
- }
- .evaluation-container {
- padding: 20rpx 30rpx;
-
- .evaluation-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 30rpx;
-
- .evaluation-label {
- font-size: 28rpx;
- color: #333;
- min-width: 140rpx;
- }
-
- .evaluation-rate {
- flex: 1;
- display: flex;
- justify-content: flex-end;
- }
- }
-
- .evaluation-textarea {
- margin-top: 20rpx;
-
- .textarea-label {
- font-size: 28rpx;
- color: #333;
- margin-bottom: 16rpx;
- }
- }
- }
- .u-modal {
- /deep/ .u-modal__title {
- font-size: 32rpx;
- font-weight: bold;
- color: #303133;
- }
-
- /deep/ .u-modal__content {
- padding: 30rpx 0;
- }
-
- /deep/ .u-modal__button {
- &--confirm {
- color: #2979ff;
- font-weight: bold;
- }
-
- &--cancel {
- color: #909399;
- }
- }
- }
- .your-component {
- @include respond-to('tablet') {
- // 平板样式
- }
-
- @include respond-to('desktop') {
- // 桌面样式
- }
- }
- </style>
|