{{ active + 1 }}/{{ total }}
@@ -26,46 +26,38 @@
{{ goods.goods_name }}
-
-
-
+
+
+
-
+
-
+
-
+
@@ -76,44 +68,90 @@
-
-
-
- QRCoce
+
+ QRCoce
-
-
-
- 分享連結
+
+ 分享連結
-
-
-
- Line
+
+ Line
-
-
-
- FB
+
+ FB
-
- ${{ goods.shop_price }}
+
-
+ ${{ goods.shop_price }}
${{ goods.market_price }}
{{ discount }}折
@@ -122,11 +160,9 @@
-
- 立即購買
-
+
+
+ 立即購買
@@ -179,7 +215,8 @@
-
-
+
-
+
NFC感應卡片將在三個工作天寄至您的收件地址
- + + + 提領帳戶 + + + + +
+
+
+
-
+
+ 感謝您的購買
-您的訂單已成功下達,您的訂單編號為#{{ order_sn }}
-
+
+
+
+ 感謝您的購買
+您的訂單已成功下達,您的訂單編號為#{{ order_sn }}
+
+
+
金流付款失敗
+您的訂單編號為#{{ order_sn }},請重新下單
+
@@ -58,22 +66,13 @@
import { onMounted } from "vue";
import { useRoute } from "vue-router";
-// import { linePay } from '@/services/order'
-
const route = useRoute();
+const code = route.query.code;
const order_sn = route.query.order_sn;
const paycode = route.query.paycode;
-onMounted(async () => {
- if (order_sn) {
- // let res = await linePay({order_sn})
- // if(res.code === 200){
- // window.location.href = res.data.info.paymentUrl.web
- // }
- // console.log('res',res.data.paymentUrl.web)
- }
-});
+onMounted(async () => {});
diff --git a/src/pages/Cart/Index.vue b/src/pages/Cart/Index.vue
index 886753d..82696ee 100644
--- a/src/pages/Cart/Index.vue
+++ b/src/pages/Cart/Index.vue
@@ -151,22 +151,33 @@ const detail = computed(() => {
});
const goCheckOut = async () => {
- if (Cookies.get("token")) {
- router.push("/checkout");
- } else {
- showConfirmDialog({
- title: "是否先登入會員",
- message: "您目前尚未登入會員,是否先登入會員",
- confirmButtonText: "登入會員",
- cancelButtonText: "暱名購買",
+ //判斷是否有登入
+ if (Cookies.get('uid')) {
+ return router.push('/checkout')
+ }
+ return router.push({
+ path: '/login',
+ query: {
+ redirect: '/checkout'
+ }
})
- .then(() => {
- router.push("/login");
- })
- .catch(() => {
- router.push("/checkout");
- });
- }
+
+ // if (Cookies.get("token")) {
+ // router.push("/checkout");
+ // } else {
+ // showConfirmDialog({
+ // title: "是否先登入會員",
+ // message: "您目前尚未登入會員,是否先登入會員",
+ // confirmButtonText: "登入會員",
+ // cancelButtonText: "暱名購買",
+ // })
+ // .then(() => {
+ // router.push("/login");
+ // })
+ // .catch(() => {
+ // router.push("/checkout");
+ // });
+ // }
};
diff --git a/src/pages/Cart/Payment.vue b/src/pages/Cart/Payment.vue
index 84221cc..6d6d813 100644
--- a/src/pages/Cart/Payment.vue
+++ b/src/pages/Cart/Payment.vue
@@ -86,6 +86,9 @@ onMounted(async () => {
break;
case "linepay":
default:
+ if(pay_code === "cod") {
+ return
+ }
let res = await payment({ order_sn, pay_code });
if (res.code === 200) {
//將回傳的from寫入formContainer中,並且自動submit
diff --git a/src/pages/Goods/Index.vue b/src/pages/Goods/Index.vue
index 59d23b9..9701c65 100644
--- a/src/pages/Goods/Index.vue
+++ b/src/pages/Goods/Index.vue
@@ -316,7 +316,7 @@ onMounted(async () => {
});
const discount = computed(() => {
- return Math.floor((goods.value.shop_price / goods.value.market_price) * 100);
+ return Math.ceil((goods.value.shop_price / goods.value.market_price) * 10);
});
const addToCart = async (id, type) => {
diff --git a/src/pages/Home/Index.vue b/src/pages/Home/Index.vue
index 7647bab..0b0f07e 100644
--- a/src/pages/Home/Index.vue
+++ b/src/pages/Home/Index.vue
@@ -9,10 +9,7 @@
-
-
-
-
-
+
+
diff --git a/src/pages/Login/Index.vue b/src/pages/Login/Index.vue
index fd448dc..e4ff25b 100644
--- a/src/pages/Login/Index.vue
+++ b/src/pages/Login/Index.vue
@@ -54,7 +54,7 @@ import { ref, watch, onUnmounted } from "vue";
import { useRoute, useRouter } from "vue-router";
-import { useShopStore } from "@/store/Shop"
+import { useShopStore } from "@/store/Shop";
import { showToast } from "vant";
import "vant/es/toast/style";
@@ -64,7 +64,7 @@ import { login, sendVerify } from "@/services/auth";
const route = useRoute();
const router = useRouter();
-const shopStore = useShopStore()
+const shopStore = useShopStore();
const form = ref({
username: "",
@@ -76,8 +76,8 @@ const showGetVerifyBtn = ref(false);
const countdown = ref(0);
const handleGetVerify = async () => {
- if(!showGetVerifyBtn.value){
- return
+ if (!showGetVerifyBtn.value) {
+ return;
}
if (!form.value.username) {
return showToast({
@@ -173,17 +173,24 @@ const handleLogin = async () => {
sessionStorage.setItem("reg", form.value.username);
router.push({ name: "Register", query: { type: "mobile" } });
- }else{
+ } else {
showToast({
- message: '登入失敗',
+ message: "登入失敗",
duration: 1000,
});
}
};
const handleLineLogin = async () => {
- const client_id = "1657876696";
- const redirect_uri = "https://" + shopStore.domain + "/m/linelogin/";
+ const client_id = import.meta.env.VITE_APP_LINE_CLIENT_ID;
+ //判斷domain是否包含localhost
+ let redirect_uri = "";
+ if (shopStore.domain.includes("localhost")) {
+ redirect_uri = "http://" + shopStore.domain + ":5173/m/linelogin";
+ } else {
+ redirect_uri = "https://" + shopStore.domain + "/m/linelogin";
+ }
+
let link = "https://access.line.me/oauth2/v2.1/authorize?";
link = link + "response_type=code";
link += "&client_id=" + client_id;
diff --git a/src/pages/Login/LineLogin.vue b/src/pages/Login/LineLogin.vue
index c1a96d0..e257205 100644
--- a/src/pages/Login/LineLogin.vue
+++ b/src/pages/Login/LineLogin.vue
@@ -22,12 +22,20 @@ const code = route.query.code
if(!code){
router.replace('/login')
}else{
+ //判斷domain是否包含localhost
+ let redirect_uri = "";
+ if (shopStore.domain.includes("localhost")) {
+ redirect_uri = "http://" + shopStore.domain + ":5173/m/linelogin";
+ } else {
+ redirect_uri = "https://" + shopStore.domain + "/m/linelogin";
+ }
+
axios.post('https://api.line.me/oauth2/v2.1/token',{
grant_type: 'authorization_code',
code: code,
- redirect_uri: 'https://' + shopStore.domain + '/m/linelogin/',
- client_id: '1657876696',
- client_secret: '2a7930d6143a00ff421812b942cde200'
+ redirect_uri: redirect_uri,
+ client_id: import.meta.env.VITE_APP_LINE_CLIENT_ID,
+ client_secret: import.meta.env.VITE_APP_LINE_CLIENT_SECRET,
},{
headers: {
'content-type': 'application/x-www-form-urlencoded'
diff --git a/src/pages/My/Account/Index.vue b/src/pages/My/Account/Index.vue
index bbe5277..93ff392 100644
--- a/src/pages/My/Account/Index.vue
+++ b/src/pages/My/Account/Index.vue
@@ -114,10 +114,10 @@ const finished = ref(false);
const refreshing = ref(false);
onMounted(async() => {
- let res = await getUserAccInfo();
- if(res.code === 200){
- accInfo.value = res.data;
- }
+ // let res = await getUserAccInfo();
+ // if(res.code === 200){
+ // accInfo.value = res.data;
+ // }
});
const onLoad = async ()=>{
@@ -160,6 +160,14 @@ const form = ref({
});
const onSubmit = async () => {
+ if(form.value.amount < 1000){
+ showToast("提領金額最少為1000");
+ return;
+ }
+ if(form.value.amount > accInfo.value.user_money){
+ showToast("提領金額不足,您目前可提領的金額為" + accInfo.value.user_money);
+ return;
+ }
let res = await addUserAccount(form.value);
if (res.code === 200) {
showToast("申請成功,請等待管理員審核撥款");
diff --git a/src/pages/My/Bank/Index.vue b/src/pages/My/Bank/Index.vue
new file mode 100644
index 0000000..84fc457
--- /dev/null
+++ b/src/pages/My/Bank/Index.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/My/Index.vue b/src/pages/My/Index.vue
index a708706..edb7679 100644
--- a/src/pages/My/Index.vue
+++ b/src/pages/My/Index.vue
@@ -5,12 +5,12 @@
+
+
+ 提領帳戶
+
+ 提交
+
+
-
+
@@ -111,6 +111,15 @@
+