diff --git a/api/address.js b/api/address.js index a50a95c..50022aa 100644 --- a/api/address.js +++ b/api/address.js @@ -24,9 +24,9 @@ export const brigadeListApi = (data) => { } export const getMassageCode = (data) => { - return request.post('/brigade', data); + return request.get('/user/user/send_sms', data); } export const setPayPassword = (data) => { - return request.post('/brigade', data); + return request.post('/user/user/set_payPassword', data); } \ No newline at end of file diff --git a/pagesOrder/setPayPassword/index.vue b/pagesOrder/setPayPassword/index.vue index 9c806af..3a98e97 100644 --- a/pagesOrder/setPayPassword/index.vue +++ b/pagesOrder/setPayPassword/index.vue @@ -1,11 +1,15 @@ @@ -178,6 +180,7 @@ checkOrderApi } from "@/api/cart.js"; import { + userInfoApi, addressListsApi, merchantListApi } from "@/api/user.js"; @@ -298,14 +301,6 @@ const searchShop = (e) => { getMerchantList(e) } - - // 拨打电话 - // const callShow = ref(false) - // const phone = ref(''); - // const callphone = (e) => { - // callShow.value = true; - // phone.value = e; - // } const onCall = (e) => { uni.makePhoneCall({ phoneNumber: e, @@ -361,30 +356,25 @@ // 支付密码 const passwordBoardVisible = ref(false); - const handleItemClick = () => { - passwordBoardVisible.value = true; - }; + const passwordBoardProps = { title: '输入支付密码', onComplete(value) { - console.log(value); + password.value = value + passwordBoardVisible.value = false + payFn() } }; + const closeKeyBord = () => { + password.value = '' + } - - const createOrder = () => { - if (!pay_type.value) return uni.$u.toast('请选择支付方式'); + const password = ref('') + const payFn = () => { let shareInfo = uni.getStorageSync('SHARE_INFO'); - - - if (pay_type.value == 3 || pay_type.value == 17) { - passwordBoardVisible.value = true - return - } - - createOrderApi({ + password: password.value, spread_uid: (shareInfo && shareInfo.uid) ? shareInfo.uid : '', cart_id: cartStore.cartList, address_id: addressInfo.value.address_id, @@ -447,6 +437,24 @@ }) } + const showModal = ref(false) + const navgo = (url) => { + showModal.value &&= false + uni.navigateTo({ + url + }) + } + + const createOrder = async () => { + if (!pay_type.value) return uni.$u.toast('请选择支付方式'); + if (pay_type.value == 3 || pay_type.value == 18) { + let res = await userInfoApi() + return res.data.pay_password ? passwordBoardVisible.value = true : showModal.value = true + } + payFn() + } + + const c_price = (price, index = 0) => { price = price + ''; return price.split('.')[index] || (index ? '00' : '0');