|
@@ -184,19 +184,27 @@
|
|
<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
|
|
<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
|
|
:closeOnClickOverlay='true' :showCancelButton='showCancelButton' @confirm="confirmClick"
|
|
:closeOnClickOverlay='true' :showCancelButton='showCancelButton' @confirm="confirmClick"
|
|
@close="cancelClick" @cancel="cancelClick" class="modal">
|
|
@close="cancelClick" @cancel="cancelClick" class="modal">
|
|
- <view style="margin: 0 auto;">
|
|
|
|
- <u-radio-group v-model="radiovalue1" placement="" v-if='isShowTerminationReason'>
|
|
|
|
- <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
|
|
|
|
- :label="item.name" :name="item.name" @change="radioChange">
|
|
|
|
- </u-radio>
|
|
|
|
- </u-radio-group>
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'
|
|
|
|
- v-if='isShowTerminationReason'>
|
|
|
|
- </u--textarea>
|
|
|
|
</u-modal>
|
|
</u-modal>
|
|
-
|
|
|
|
|
|
+ <u-popup :show="show" mode="bottom" @close="close" @open="open">
|
|
|
|
+ <view class="">
|
|
|
|
+ <view ><u-icon @click="closepopup" class='close' name="close" size="20"></u-icon></view>
|
|
|
|
+
|
|
|
|
+ <view style='fon-size:34rpx;margin-bottom:20px;text-align:center;font-weight: 600;'>确认终止订单</view>
|
|
|
|
+ <view style="margin: 0 auto;">
|
|
|
|
+ <u-radio-group iconPlacement="right" v-model="radiovalue1" placement="" >
|
|
|
|
+ <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
|
|
|
|
+ :label="item.name" :name="item.name" @change="radioChange" >
|
|
|
|
+ </u-radio>
|
|
|
|
+ </u-radio-group>
|
|
|
|
+ </view>
|
|
|
|
+ <view style='border-top:10px solid #F2F4F7;position:absolute;left:0;height:0;width:100%;'></view>
|
|
|
|
+ <view style='padding:40rpx 0 30rpx;'>终止原因描述</view>
|
|
|
|
+ <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'>
|
|
|
|
+ </u--textarea>
|
|
|
|
+ <view class='termination' :class="{'active':value2.length>0}" @click='termination'>终止</view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ </u-popup>
|
|
<u-toast ref="uToast"></u-toast>
|
|
<u-toast ref="uToast"></u-toast>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -206,15 +214,20 @@
|
|
import {
|
|
import {
|
|
mapState
|
|
mapState
|
|
} from 'vuex';
|
|
} from 'vuex';
|
|
|
|
+ import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
import {
|
|
import {
|
|
apiGoods
|
|
apiGoods
|
|
} from "@/api/mock.js"
|
|
} from "@/api/mock.js"
|
|
export default {
|
|
export default {
|
|
|
|
+ components:{
|
|
|
|
+ uniPopup
|
|
|
|
+ },
|
|
mixins: [MescrollMixin], // 使用mixin
|
|
mixins: [MescrollMixin], // 使用mixin
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
confirmText: '',
|
|
confirmText: '',
|
|
|
|
+ show:false,
|
|
showCancelButton: true,
|
|
showCancelButton: true,
|
|
type: null,
|
|
type: null,
|
|
objData: {},
|
|
objData: {},
|
|
@@ -484,9 +497,9 @@
|
|
// } else {
|
|
// } else {
|
|
// this.isShowTerminationReason = true
|
|
// this.isShowTerminationReason = true
|
|
// }
|
|
// }
|
|
- this.alertTitle = '确定终止订单?'
|
|
|
|
|
|
+ // this.alertTitle = '确定终止订单?'
|
|
this.id = item.id
|
|
this.id = item.id
|
|
- this.isShowAlert = true
|
|
|
|
|
|
+ this.show = true
|
|
},
|
|
},
|
|
init() {
|
|
init() {
|
|
|
|
|
|
@@ -494,6 +507,42 @@
|
|
del() {
|
|
del() {
|
|
this.isShowAlert = true
|
|
this.isShowAlert = true
|
|
},
|
|
},
|
|
|
|
+ termination(){
|
|
|
|
+ var that=this
|
|
|
|
+ let _terminationReason = ''
|
|
|
|
+ if (this.radiovalue1 == '已与货主协商') {
|
|
|
|
+ _terminationReason = 1
|
|
|
|
+ } else if (this.radiovalue1 == '货主原因终止') {
|
|
|
|
+ _terminationReason = 2
|
|
|
|
+ } else if (this.radiovalue1 == '司机个人原因终止') {
|
|
|
|
+ _terminationReason = 3
|
|
|
|
+ } else if (this.radiovalue1 == '其他') {
|
|
|
|
+ _terminationReason = 4
|
|
|
|
+ }
|
|
|
|
+ this.$request.baseRequest('post', '/orderInfo/api/end', {
|
|
|
|
+ id: this.id,
|
|
|
|
+ terminator: 2,
|
|
|
|
+ terminationReason: _terminationReason,
|
|
|
|
+ terminationReasonDescription: this.value2
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.show=false
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '终止订单成功',
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '终止订单失败',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ that.mescroll.resetUpScroll()
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ uni.$u.toast(res.message);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
confirmClick() {
|
|
confirmClick() {
|
|
var that =this
|
|
var that =this
|
|
// // #ifdef APP-PLUS
|
|
// // #ifdef APP-PLUS
|
|
@@ -523,6 +572,7 @@
|
|
type: 'success',
|
|
type: 'success',
|
|
message: _title,
|
|
message: _title,
|
|
complete() {
|
|
complete() {
|
|
|
|
+ that.upCallback({size: 10,num: 1})
|
|
that.mescroll.resetUpScroll()
|
|
that.mescroll.resetUpScroll()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -536,6 +586,7 @@
|
|
type: 'success',
|
|
type: 'success',
|
|
message: _title,
|
|
message: _title,
|
|
complete() {
|
|
complete() {
|
|
|
|
+ that.upCallback({size: 10,num: 1})
|
|
that.mescroll.resetUpScroll()
|
|
that.mescroll.resetUpScroll()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -570,28 +621,7 @@
|
|
.catch(res => {
|
|
.catch(res => {
|
|
uni.$u.toast(res.message);
|
|
uni.$u.toast(res.message);
|
|
});
|
|
});
|
|
- } else {
|
|
|
|
- this.$request.baseRequest('post', '/orderInfo/api/end', {
|
|
|
|
- id: this.id,
|
|
|
|
- terminator: 2,
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.$refs.uToast.show({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '终止订单成功',
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- this.$refs.uToast.show({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '终止订单失败',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- that.mescroll.resetUpScroll()
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
- uni.$u.toast(res.message);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
cancelClick() {
|
|
cancelClick() {
|
|
this.isShowAlert = false
|
|
this.isShowAlert = false
|
|
@@ -1037,4 +1067,27 @@
|
|
padding: 20rpx;
|
|
padding: 20rpx;
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
}
|
|
}
|
|
|
|
+ /deep/.u-popup__content{
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ padding:20px;
|
|
|
|
+ }
|
|
|
|
+ /deep/.u-radio{
|
|
|
|
+ margin:40rpx 0;
|
|
|
|
+ }
|
|
|
|
+ .close{
|
|
|
|
+ position:absolute;
|
|
|
|
+ right:20px;
|
|
|
|
+ }
|
|
|
|
+ .termination{
|
|
|
|
+ background:#F1F3F6;
|
|
|
|
+ color:#C5CAD4;
|
|
|
|
+ padding:10px;
|
|
|
|
+ border-radius:30px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin-top:30rpx;
|
|
|
|
+ }
|
|
|
|
+ .termination.active{
|
|
|
|
+ background: #2772FB;
|
|
|
|
+ color: white;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|