优化退款密码
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<scanModal ref="scanModalRef" fast :amount="money" :selecttype="props.type" :orderId="props.userInfo.id"
|
||||
<scanModal ref="scanModalRef" fast :amount="money" :money="money" :selecttype="props.type" :orderId="props.userInfo.id"
|
||||
@success="scanCodeSuccess" />
|
||||
<takeFoodCode ref="takeFoodCodeRef" title="支付密码" :type="2" input-type="password" placeholder="请输入支付密码"
|
||||
@success="passwordSuccess" />
|
||||
@@ -78,6 +78,7 @@ import { useUser } from "@/store/user.js";
|
||||
import { clearNoNum } from "@/utils";
|
||||
import md5 from "js-md5";
|
||||
|
||||
import { queryPwdInfo } from '@/api/user.js'
|
||||
import scanModal from "@/components/payCard/scanModal.vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import takeFoodCode from "@/components/takeFoodCode.vue";
|
||||
@@ -128,14 +129,14 @@ function payTypeChange(index, item) {
|
||||
}
|
||||
|
||||
// 获取支付密码
|
||||
async function passwordSuccess(e) {
|
||||
async function passwordSuccess(e = '') {
|
||||
try {
|
||||
payLoading.value = true;
|
||||
await accountPaymember({
|
||||
shopId: store.userInfo.shopId,
|
||||
memberId: props.userInfo.id,
|
||||
amount: money.value,
|
||||
pwd: md5(e),
|
||||
pwd: e ? md5(e) : '',
|
||||
});
|
||||
payLoading.value = false;
|
||||
ElMessage.success("支付成功");
|
||||
@@ -175,8 +176,15 @@ async function confirmOrder() {
|
||||
emit("paySuccess");
|
||||
} else {
|
||||
// 会员充值
|
||||
takeFoodCodeRef.value.show();
|
||||
// passwordSuccess()
|
||||
|
||||
let res = await queryPwdInfo()
|
||||
if (res.isMemberIn == 1) {
|
||||
takeFoodCodeRef.value.show();
|
||||
} else {
|
||||
passwordSuccess()
|
||||
}
|
||||
// takeFoodCodeRef.value.show();
|
||||
// // passwordSuccess()
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<script setup>
|
||||
import _ from "lodash";
|
||||
import { ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import icon from "@/assets/icon_scan.png";
|
||||
import { scanpay, queryOrder, quickPay, queryQuickPayStatus, accountPay, queryScanPay } from "@/api/pay";
|
||||
import { useUser } from "@/store/user.js";
|
||||
@@ -117,8 +117,8 @@ async function submitHandle() {
|
||||
memberId: props.orderId,
|
||||
amount: props.amount,
|
||||
authCode: scanCode.value,
|
||||
payAmount: props.money < props.amount ? props.money : '',
|
||||
discountAmount: props.money < props.amount ? formatDecimal(props.amount - props.money) : ''
|
||||
// payAmount: props.money < props.amount ? props.money : '',
|
||||
// discountAmount: props.money < props.amount ? formatDecimal(props.amount - props.money) : ''
|
||||
});
|
||||
} else {
|
||||
if (props.fast) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<el-button type="primary" style="width: 100%" @click="confirmHandle">确认</el-button>
|
||||
<el-button type="primary" style="width: 100%" :loading="loading" @click="confirmHandle">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -69,6 +69,7 @@ function delHandle() {
|
||||
number.value = number.value.substring(0, number.value.length - 1);
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
// 确认
|
||||
function confirmHandle() {
|
||||
if (!number.value) return
|
||||
@@ -77,8 +78,12 @@ function confirmHandle() {
|
||||
ElMessage.error('请输入正确的密码')
|
||||
return
|
||||
} else {
|
||||
loading.value = true
|
||||
emit("success", number.value);
|
||||
dialogVisible.value = false;
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 1000)
|
||||
}
|
||||
} else {
|
||||
emit("success", number.value);
|
||||
|
||||
Reference in New Issue
Block a user