fix(custom): 修复若干问题

This commit is contained in:
2024-03-07 18:55:38 +08:00
parent fbbdecf2e0
commit 714b980b28
21 changed files with 292 additions and 155 deletions

View File

@@ -42,6 +42,15 @@
>
</form>
</view>
<nut-dialog v-model:visible="visible" no-cancel-btn>
<template #header>提示</template>
<template #default
>客户手机号:
<text style="color: #fd0100">{{ formVal.phone }}</text>
没有注册捷兑
请通知他登录捷兑通小程序注册</template
>
</nut-dialog>
</view>
</template>
@@ -49,6 +58,7 @@
import { ref } from "vue";
import Taro from "@tarojs/taro";
import BackComponent from "../../../../components/Back.vue";
import { checkPhone } from "../../../../api/admin";
const formVal = ref({
seat: "",
@@ -56,23 +66,41 @@ const formVal = ref({
notes: "",
});
const visible = ref(false);
const formSubmit = async ({ detail }: any) => {
if (!detail.value.seat || !detail.value.phone)
if (!detail.value.seat)
return Taro.showToast({
title: "请填写完整信息",
title: "请填写台号",
icon: "none",
});
const user_info = await Taro.getStorageSync("userInfo");
Taro.navigateTo({
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}&notes=${formVal.value.notes}`,
success: () => {
formVal.value = {
seat: "",
phone: "",
notes: "",
};
},
});
if (
!/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(
detail.value.phone
)
)
return Taro.showToast({
title: "请输入正确的手机号码",
icon: "none",
});
try {
const res = await checkPhone({ phone: detail.value.phone });
console.log(res);
const user_info = await Taro.getStorageSync("userInfo");
Taro.navigateTo({
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}&notes=${formVal.value.notes}`,
success: () => {
formVal.value = {
seat: "",
phone: "",
notes: "",
};
},
});
} catch (error) {
console.log(error);
visible.value = true;
}
};
</script>