修改确认收货页面

This commit is contained in:
geng.tang@qq.com
2024-01-03 12:06:04 +08:00
parent c6f3f47a80
commit cfca75f681
3 changed files with 40 additions and 17 deletions

View File

@@ -12,6 +12,6 @@ export function image() {
} }
// 发送短信验证码 // 发送短信验证码
export const sendSmsCaptcha = (data) => { export function sendSmsCaptcha(data) {
return request.post(api.sendSmsCaptcha, data) return request.post(api.sendSmsCaptcha, data, { load: false })
} }

View File

@@ -67,13 +67,16 @@
import { import {
uploadFile uploadFile
} from '@/api/upload' } from '@/api/upload'
import {
http
} from '@/websoft/api/index.js'
import { import {
pageOrder, pageOrder,
removeOrder, removeOrder,
receipt, receiptOrder,
getOrder getOrder
} from '@/websoft/api/order.js' } from '@/websoft/api/order.js'
import { sendSmsCaptcha } from '@/api/captcha.js' import { sendSmsCaptcha } from '@/websoft/api/captcha.js'
import { fileUrl } from '@/config.js' import { fileUrl } from '@/config.js'
import { isMobile } from '@/utils/verify' import { isMobile } from '@/utils/verify'
@@ -181,10 +184,11 @@
}) })
return return
} }
sendSmsCaptcha({ sendSmsCaptcha({
phone: that.receiptPhone, phone: that.receiptPhone,
type: 'RECEIPT' type: 'RECEIPT'
}).then(result => { }).then(function (result) {
console.log(result) console.log(result)
if(result){ if(result){
if(result.code == 0) { if(result.code == 0) {
@@ -199,12 +203,9 @@
that.$toast(result.message) that.$toast(result.message)
} }
} }
}).catch(err => { }).catch(err => {
console.log('e2: ',err); console.log('err: ',err);
that.$toast(err.message) that.$toast(err.message)
}).finally(e => {
console.log('e3: ',e);
}) })
}, },
@@ -247,20 +248,34 @@
}, */ }, */
// 表单提交 // 表单提交
handleSubmit() { handleSubmit() {
// if(orderSourceData.length < 5) {
// return
// }
const that = this
const app = this const app = this
const { orderId,orderSourceData,captcha,receiptPhone,emergentUser,officeAddress, homeAddress } = app const { orderId,orderSourceData,captcha,receiptPhone,emergentUser,officeAddress, homeAddress } = app
if(orderSourceData.length < 5) {
return
} receiptOrder({
receipt(app).then(result => { orderId: orderId,
orderSourceData: JSON.stringify(orderSourceData),
captcha: captcha,
receiptPhone: receiptPhone,
emergentUser: emergentUser,
officeAddress: officeAddress,
homeAddress: homeAddress
}).then(result => {
if(result.code == 0) { if(result.code == 0) {
app.$success("上传成功") that.$success("确认收货成功")
uni.navigateBack() // uni.navigateBack()
setTimeout(()=>{
that.$navTo('pages/order/index',{}, 'redirectTo')
}, 1000)
} else { } else {
app.$toast(result.message) that.$toast(result.message)
} }
}).catch(err => { }).catch(err => {
app.$toast(err.message) that.$toast(err.message)
}) })
}, },

8
websoft/api/captcha.js Normal file
View File

@@ -0,0 +1,8 @@
import http from './index.js'
// 发送短信验证码
export const sendSmsCaptcha = (params) => http.post('sendSmsCaptcha', params)
export default {
sendSmsCaptcha
}