main
Wayne 2 years ago
parent 150ab7d9d4
commit eed9a1eaca

@ -7,7 +7,8 @@
"dev": "vite",
"build": "vite build",
"build:sta": "vite build --mode stage",
"preview": "vite preview"
"preview": "vite preview",
"postbuild:sta" : "scp -r ./dist/* root@207.148.89.145:/www/wwwroot/utel.zltest.com.tw/public/home"
},
"dependencies": {
"@line/liff": "^2.22.4",

@ -1,7 +1,5 @@
import { createRouter, createWebHistory } from "vue-router";
import store from "@/store";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
@ -146,7 +144,9 @@ router.beforeEach((to, from, next) => {
if (to.path !== "/" && to.path !== "/login" && to.path !== "/actlogin" && to.path !== "/register") {
if (!sessionStorage.getItem("token")) {
console.log('to',to);
sessionStorage.setItem("redirect", to.fullPath);
sessionStorage.setItem("refer", to.query.cardid);
return next("/actlogin");
}

@ -26,13 +26,10 @@ const selectOpt2 = ref([{ text: '重要', value: '重要' }, { text: '普通', v
const addressList = ref([]);
onBeforeMount(async () => {
onMounted(async () => {
if (route.query.act === 'add') {
let res = await addUserFavi({ uf_user_id: route.query.cardid });
}
});
onMounted(async () => {
initData();
getCateList();
});

@ -93,7 +93,7 @@ onBeforeMount(async () => {
});
return;
}else if(route.query.user_id){ //lineid
} else if (route.query.user_id) { //lineid
//
showConfirmDialog({
title: "會員綁定",
@ -198,7 +198,7 @@ const onUpdateValue = (newValue) => {
cancelButtonText: "取消",
}).then(() => {
let res = userStore.setSendWithAd(newValue)
console.log('aaa',userInfo.value.is_send_ad)
console.log('aaa', userInfo.value.is_send_ad)
}).catch(() => {
// on cancel
@ -263,12 +263,15 @@ const doShare = () => {
};
const bindTggo = () => {
let url;
if (userInfo.value.uniqid) {
let url = `https://www.tggo.com.tw/u.cgi?&mnm=mybinding&ncode=${userInfo.value.uniqid}&name=${userInfo.value.real_name}&openExternalBrowser=1`;
window.open(url, "_blank");
return;
url = `https://www.tggo.com.tw/u.cgi?&mnm=mybinding&ncode=${userInfo.value.uniqid}&name=${userInfo.value.real_name}&openExternalBrowser=1`;
} else {
url = `https://www.tggo.com.tw/u.cgi?user=1111&from=portal&openExternalBrowser=1`;
}
showToast('您的帳號尚未綁定感應卡');
window.open(url, "_blank");
return;
// showToast('');
};
const handleLogout = () => {

@ -709,19 +709,23 @@ const handleChangeTplSubmit = async () => {
<!-- <Footer/> -->
<van-popup class="cropPopup" v-model:show="crop.show" closeable>
<h5 class="text-center mt-3">檔案裁切上傳</h5>
<div class="cropper-section">
<van-overlay :show="crop.show" @click="crop.show = false" />
<div class="cropper-section" v-if="crop.show">
<h5 class="text-center">檔案裁切上傳</h5>
<div class="crop-area">
<cropper class="cropper" ref="myCrop" :src="crop.img" :stencil-props="{
aspectRatio: 1 / 1,
}" :auto-zoom="true" />
</div>
<van-button round class="btn-tomatoRed rounded-pill w-50 mt-3" size="small" @click="onCrop">
裁切確認
</van-button>
<div class="crop-btn">
<van-button round class="btn-darkBlue rounded-pill w-50" size="small" @click="() => { crop.show = false }">
取消
</van-button>
<van-button round class="btn-tomatoRed rounded-pill w-50" size="small" @click="onCrop">
裁切確認
</van-button>
</div>
</div>
</van-popup>
</div>
</template>
@ -834,4 +838,29 @@ const handleChangeTplSubmit = async () => {
}
}
}
.cropper-section {
margin: 0 auto;
position: fixed;
text-align: center;
top: 50px;
height: 350px;
width: 100%;
max-width: 500px;
background: hsl(0, 0%, 87%);
z-index: 8888;
.crop-area {
margin: 5 auto;
width: 100%;
// height: 330px;
}
.crop-btn {
text-align: center;
display: flex;
justify-content: space-between;
}
}
</style>

@ -130,11 +130,10 @@ const onSubmit = async () => {
line_name: profile.displayName,
line_picture: profile.pictureUrl,
token: id_token,
refer: sessionStorage.getItem("refer") || null,
...form.value,
});
console.log("regRes.code",regRes)
if (regRes.code === 500) {
if (liff.isLoggedIn()) {
liff.logout();
@ -145,7 +144,10 @@ const onSubmit = async () => {
showToast("註冊成功");
sessionStorage.setItem("token", regRes.data.token);
sessionStorage.setItem("uid", regRes.data.uid);
return router.push("/");
let redirect = sessionStorage.getItem("redirect") || "/";
sessionStorage.removeItem("redirect");
sessionStorage.removeItem("refer");
return router.push(redirect);
} else {
showToast("註冊失敗");
return;

Loading…
Cancel
Save