123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- // index.js
- // 获取应用实例
- const app = getApp();
- const util = require('../../../utils/jmsUtil.js');
- const api = require('../../../api/jms.js');
- import moment from 'moment'
- Page({
- data: {
-
- serviceId:'',
- orderInfo:{
- changeReason:{
- label: '请选择(必填)',
- value:''
- },
-
- },
- selectValue:'',
- selectVisible:false,
- selectKey:'',
- list:[
- { value: 1, text: '用户退款取消' },
- { value: 2, text: '用户改期取消' },
- { value: 3, text: '用户改派取消' },
- { value: 4, text: '保洁师请假取消' },
- { value: 5, text: '保洁师解约取消' },
- { value: 6, text: '修改订单地址取消' },
- { value: 7, text: '退还权益取消' },
- { value: 16, text: '无法联系到客户' },
- { value: 17, text: '团单不适用无法服务' },
- ]
- },
- // 事件处理函数
-
- onLoad(options) {
- if(options.serviceid){
- this.setData({
- serviceId:options.serviceid
- });
- }
- },
- inputClue(e){
- let obj=e.currentTarget.dataset.obj;
- let item=`clueInfo.${obj}`;
- this.setData({
- [item]:e.detail.value
- });
- // console.log(this.data.clueInfo);
- },
- selectClue(e){
- let obj=e.currentTarget.dataset.obj;
-
- this.setData({
- selectKey:obj,
- selectVisible:true
- });
- console.log(this.data.selectKey);
- },
- onPickerConfirm(e){
- console.log(e);
- let obj={
- label:e.detail.value.text,
- value:e.detail.value.value
- }
- this.setData({
- 'orderInfo.changeReason':obj,
- selectVisible:false
- });
- },
- onPickerCancel(){
- this.setData({
- selectVisible:false
- });
- },
- confTap(){
- if(this.data.orderInfo.changeReason.value==''){
- wx.showToast({
- title: '请选择取消原因',
- icon:'none'
- });
- }else{
- wx.showLoading({
- title: '加载中',
- })
- let params={
- serviceId: this.data.serviceId,
- changeReason: this.data.orderInfo.changeReason.value
- }
- util.request(api.HangUpServiceOrder,
- params
- , 'GET').then(res=>{
- wx.hideLoading();
- if (res.errno == 0) {
-
- wx.showModal({
- title: '提示',
- content: '操作成功',
- showCancel:false,
- complete: (res) => {
- if (res.cancel) {
-
- }
-
- if (res.confirm) {
- wx.navigateBack({
- delta:1
- });
-
- }
- }
- })
-
-
- }else{
- wx.showToast({
- title: res.errmsg,
- icon:'none'
- })
- }
-
- }).catch(err=>{
- wx.hideLoading();
- });
- }
- },
-
- })
|