main
Wayne 2 years ago
parent 150ab7d9d4
commit eed9a1eaca

@ -7,7 +7,8 @@
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"build:sta": "vite build --mode stage", "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": { "dependencies": {
"@line/liff": "^2.22.4", "@line/liff": "^2.22.4",

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

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

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

@ -709,19 +709,23 @@ const handleChangeTplSubmit = async () => {
<!-- <Footer/> --> <!-- <Footer/> -->
<van-popup class="cropPopup" v-model:show="crop.show" closeable> <van-overlay :show="crop.show" @click="crop.show = false" />
<h5 class="text-center mt-3">檔案裁切上傳</h5> <div class="cropper-section" v-if="crop.show">
<div class="cropper-section"> <h5 class="text-center">檔案裁切上傳</h5>
<div class="crop-area"> <div class="crop-area">
<cropper class="cropper" ref="myCrop" :src="crop.img" :stencil-props="{ <cropper class="cropper" ref="myCrop" :src="crop.img" :stencil-props="{
aspectRatio: 1 / 1, aspectRatio: 1 / 1,
}" :auto-zoom="true" /> }" :auto-zoom="true" />
</div> </div>
<van-button round class="btn-tomatoRed rounded-pill w-50 mt-3" size="small" @click="onCrop"> <div class="crop-btn">
裁切確認 <van-button round class="btn-darkBlue rounded-pill w-50" size="small" @click="() => { crop.show = false }">
</van-button> 取消
</van-button>
<van-button round class="btn-tomatoRed rounded-pill w-50" size="small" @click="onCrop">
裁切確認
</van-button>
</div>
</div> </div>
</van-popup>
</div> </div>
</template> </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> </style>

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

Loading…
Cancel
Save