|
|
@@ -26,7 +26,7 @@ |
|
|
|
</u-radio-group>
|
|
|
|
</view>
|
|
|
|
</u-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<u-form-item prop="phone">
|
|
|
|
<view class="from_item" style="background-color: #f7f7f7">
|
|
|
|
<text><text style="color: red"></text>手机号:</text>
|
|
|
@@ -47,8 +47,10 @@ |
|
|
|
</u-form-item>
|
|
|
|
</view>
|
|
|
|
</u-form>
|
|
|
|
<button class="submit" @click="toPage()">下一步</button>
|
|
|
|
|
|
|
|
<button style="margin-top: 50rpx;" class="submit" v-if="apply.data.status === 'APPLY'||!apply.data.status"
|
|
|
|
@click="toPage()">下一步填写资料</button>
|
|
|
|
<button style="margin-top: 30rpx;" class="submit" v-if="apply.data.status" @click="changeCardQueryCancleAction()">撤回申请</button>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
@@ -74,7 +76,9 @@ |
|
|
|
import {
|
|
|
|
sendCode,
|
|
|
|
checkCode,
|
|
|
|
changeCardApply
|
|
|
|
changeCardApply,
|
|
|
|
changeCardQuery,
|
|
|
|
changeCardQueryCancle
|
|
|
|
} from "@/utils/network/api.js";
|
|
|
|
import {
|
|
|
|
stringToJson
|
|
|
@@ -93,6 +97,13 @@ |
|
|
|
code: '',
|
|
|
|
applyRes: ''
|
|
|
|
});
|
|
|
|
const apply = reactive({
|
|
|
|
data: {
|
|
|
|
status: undefined,
|
|
|
|
id: ''
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
//入参
|
|
|
|
const params = reactive({
|
|
|
@@ -167,6 +178,14 @@ |
|
|
|
form.mobile = option.mobile
|
|
|
|
params.cardId = option.cardId
|
|
|
|
params.orderId = option.orderId
|
|
|
|
changeCardQueryAction().then(val => {
|
|
|
|
apply.data = val
|
|
|
|
apply.data.status = val.status;
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const getCode = () => {
|
|
|
@@ -192,6 +211,48 @@ |
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//查询申请单
|
|
|
|
const changeCardQueryAction = () => {
|
|
|
|
var data = {
|
|
|
|
orderId: params.orderId,
|
|
|
|
};
|
|
|
|
const options = {
|
|
|
|
type: 2,
|
|
|
|
data: data,
|
|
|
|
method: "POST",
|
|
|
|
showLoading: true,
|
|
|
|
};
|
|
|
|
return new Promise(async (resolve, reject) => {
|
|
|
|
const res = await request(changeCardQuery, options);
|
|
|
|
const data = stringToJson(res.bizContent);
|
|
|
|
resolve(data);
|
|
|
|
}).catch((error) => {
|
|
|
|
reject(error);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//撤销订单
|
|
|
|
const changeCardQueryCancleAction = () => {
|
|
|
|
var data = {
|
|
|
|
id: apply.data.id,
|
|
|
|
cancelRes: '取消申请单'
|
|
|
|
};
|
|
|
|
const options = {
|
|
|
|
type: 2,
|
|
|
|
data: data,
|
|
|
|
method: "POST",
|
|
|
|
showLoading: true,
|
|
|
|
};
|
|
|
|
return new Promise(async (resolve, reject) => {
|
|
|
|
const res = await request(changeCardQueryCancle, options);
|
|
|
|
const data = stringToJson(res.bizContent);
|
|
|
|
msg('取消申请成功');
|
|
|
|
uni.navigateBack()
|
|
|
|
}).catch((error) => {
|
|
|
|
reject(error);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//申请
|
|
|
|
const queryCckChangejzCardAction = () => {
|
|
|
|
var data = {
|
|
|
@@ -216,46 +277,52 @@ |
|
|
|
|
|
|
|
//下一步
|
|
|
|
const toPage = () => {
|
|
|
|
myForm.value.validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
const options = {
|
|
|
|
type: 2,
|
|
|
|
data: {
|
|
|
|
mobile: form.mobile,
|
|
|
|
code: form.code
|
|
|
|
},
|
|
|
|
method: "POST",
|
|
|
|
showLoading: true,
|
|
|
|
};
|
|
|
|
request(checkCode, options)
|
|
|
|
.then(() => {
|
|
|
|
if (form.applyTypeName === '卡') {
|
|
|
|
form.applyType = 'EXCHANGE_CARD'
|
|
|
|
} else if (form.applyTypeName === 'OBU') {
|
|
|
|
form.applyType = 'EXCHANGE_OBU'
|
|
|
|
} else if (form.applyTypeName === '卡和OBU') {
|
|
|
|
form.applyType = 'EXCHANGE_ALL'
|
|
|
|
}
|
|
|
|
if (form.damageModeName === '人为损坏') {
|
|
|
|
form.damageMode = '0'
|
|
|
|
} else if (form.damageModeName === '自然损坏') {
|
|
|
|
form.damageMode = '1'
|
|
|
|
}
|
|
|
|
|
|
|
|
queryCckChangejzCardAction().then(val => {
|
|
|
|
navTo(
|
|
|
|
`/after-sale/replace-equipment/form?orderId=${params.orderId}&&id=${val.id}`
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.log(err);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
console.log("验证未通过");
|
|
|
|
// myForm.value.validate((valid) => {
|
|
|
|
// if (valid) {
|
|
|
|
// const options = {
|
|
|
|
// type: 2,
|
|
|
|
// data: {
|
|
|
|
// mobile: form.mobile,
|
|
|
|
// code: form.code
|
|
|
|
// },
|
|
|
|
// method: "POST",
|
|
|
|
// showLoading: true,
|
|
|
|
// };
|
|
|
|
// request(checkCode, options)
|
|
|
|
// .then(() => {
|
|
|
|
if (apply.data.status === 'APPLY') {
|
|
|
|
navTo(
|
|
|
|
`/after-sale/replace-equipment/form?orderId=${params.orderId}&&id=${apply.data.id}`
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
if (form.applyTypeName === '卡') {
|
|
|
|
form.applyType = 'EXCHANGE_CARD'
|
|
|
|
} else if (form.applyTypeName === 'OBU') {
|
|
|
|
form.applyType = 'EXCHANGE_OBU'
|
|
|
|
} else if (form.applyTypeName === '卡和OBU') {
|
|
|
|
form.applyType = 'EXCHANGE_ALL'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (form.damageModeName === '人为损坏') {
|
|
|
|
form.damageMode = '0'
|
|
|
|
} else if (form.damageModeName === '自然损坏') {
|
|
|
|
form.damageMode = '1'
|
|
|
|
}
|
|
|
|
|
|
|
|
queryCckChangejzCardAction().then(val => {
|
|
|
|
navTo(
|
|
|
|
`/after-sale/replace-equipment/form?orderId=${params.orderId}&&id=${val.id}`
|
|
|
|
)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// })
|
|
|
|
// .catch((err) => {
|
|
|
|
// console.log(err);
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// console.log("验证未通过");
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
@@ -399,10 +466,6 @@ |
|
|
|
height: 80rpx;
|
|
|
|
color: #fff;
|
|
|
|
border-radius: 100rpx;
|
|
|
|
position: fixed;
|
|
|
|
left: 50%;
|
|
|
|
transform: translate(-50%);
|
|
|
|
bottom: 60rpx;
|
|
|
|
font-size: 32rpx;
|
|
|
|
}
|
|
|
|
</style> |