| | |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | refundUserLifePayOrder(); |
| | | createOrUpdatePromoter(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | async function refundUserLifePayOrder() { |
| | | async function createOrUpdatePromoter() { |
| | | try { |
| | | let params: CreateOrUpdatePromoterInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | |
| | | }; |
| | | let res = await blLifeRecharge.services.createOrUpdatePromoter(params); |
| | | if (res) { |
| | | if (params.phoneNumber === blLifeRecharge.accountModel.phoneNumber) { |
| | | blLifeRecharge.accountModel.setUserPromoterIdNumber(res); |
| | | } |
| | | emit('submit', res); |
| | | } |
| | | } catch (error) {} |