|
|
|
|
@ -11,9 +11,7 @@ import { useCardStore } from '@/store/card';
|
|
|
|
|
import { showToast, showSuccessToast, showConfirmDialog } from "vant";
|
|
|
|
|
import 'vant/es/toast/style';
|
|
|
|
|
|
|
|
|
|
import { Dialog } from "vant";
|
|
|
|
|
|
|
|
|
|
import { login, bindCard, getMovie, getMarquee } from "@/api";
|
|
|
|
|
import { login, bindCard, getMovie, getMarquee, bindUser } from "@/api";
|
|
|
|
|
|
|
|
|
|
import noUserImg from '@/assets/images/upload.jpg'
|
|
|
|
|
|
|
|
|
|
@ -59,9 +57,11 @@ onBeforeMount(async () => {
|
|
|
|
|
if (route.query.act === "openright") {
|
|
|
|
|
if (route.query.verify) {
|
|
|
|
|
//詢問是否綁定
|
|
|
|
|
Dialog.confirm({
|
|
|
|
|
showConfirmDialog({
|
|
|
|
|
title: "卡片綁定",
|
|
|
|
|
message: "確認是否綁定這張卡片",
|
|
|
|
|
confirmButtonText: "確認",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
})
|
|
|
|
|
.then(async () => {
|
|
|
|
|
//確認綁定
|
|
|
|
|
@ -83,7 +83,7 @@ onBeforeMount(async () => {
|
|
|
|
|
sessionStorage.setItem("uid", loginRes.data.uid);
|
|
|
|
|
} else if (loginRes.code === 201) { // 非會員
|
|
|
|
|
if (route.query.act === "openright") { // 開卡
|
|
|
|
|
if (route.query.verify && route.query.user_id) {
|
|
|
|
|
if (route.query.verify) { // 註冊
|
|
|
|
|
router.push({
|
|
|
|
|
path: "/register",
|
|
|
|
|
query: {
|
|
|
|
|
@ -93,6 +93,28 @@ onBeforeMount(async () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}else if(route.query.user_id){ //綁定lineid
|
|
|
|
|
//詢問是否綁定
|
|
|
|
|
showConfirmDialog({
|
|
|
|
|
title: "會員綁定",
|
|
|
|
|
message: "確認是否綁定會員",
|
|
|
|
|
confirmButtonText: "確認",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
})
|
|
|
|
|
.then(async () => {
|
|
|
|
|
//確認綁定
|
|
|
|
|
let bindRes = await bindUser({
|
|
|
|
|
line_id: profile.userId,
|
|
|
|
|
user_id: route.query.user_id,
|
|
|
|
|
});
|
|
|
|
|
if (bindRes.code === 200) {
|
|
|
|
|
showSuccessToast("綁定成功");
|
|
|
|
|
} else {
|
|
|
|
|
showFailToast("綁定失敗");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => { });
|
|
|
|
|
}
|
|
|
|
|
} else if (route.query.aid) { // 會員註冊
|
|
|
|
|
router.push({
|
|
|
|
|
|