浏览代码

需要登录的地方弄个弹窗

任一存 1 年之前
父节点
当前提交
61fe22be80
共有 3 个文件被更改,包括 35 次插入10 次删除
  1. 1 1
      README.md
  2. 33 8
      src/App.vue
  3. 1 1
      src/components/FeedBack.vue

+ 1 - 1
README.md

@@ -14,4 +14,4 @@ appId: wx0bc995dace29b2ba
 对接unity
 
 ### 微信扫码页面url
-https://open.weixin.qq.com/connect/qrconnect?appid=wx0bc995dace29b2ba&redirect_uri=https%3A%2F%2Fsit-wuxicishan.4dage.com%2FPC%2F%23%2Ftab-1&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect
+https://open.weixin.qq.com/connect/qrconnect?appid=wxaf343d333792a454&redirect_uri=https%3A%2F%2Fsit-wuxicishan.4dage.com%2FPC%2F%23%2Ftab-1&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect

+ 33 - 8
src/App.vue

@@ -106,7 +106,7 @@ import { useRoute, useRouter } from "vue-router"
 import { useStore } from "vuex"
 import StartUp from '@/components/StartUp.vue'
 import FeedBack from "@/components/FeedBack.vue"
-import { ElMessage } from 'element-plus'
+import { ElMessageBox } from 'element-plus'
 
 const route = useRoute()
 const router = useRouter()
@@ -124,16 +124,41 @@ if (store.state.loginStatus === store.getters.loginStatusEnum.notLogin && route.
 
 const isShowFeedBack = ref(false)
 function onClickFeedBack() {
-  // if (store.state.loginStatus === store.getters.loginStatusEnum.wxUser) {
-  isShowFeedBack.value = true
-  // } else {
-  // ElMessage('需登录后才能体验')
-  // }
+  if (store.state.loginStatus === store.getters.loginStatusEnum.wxUser) {
+    isShowFeedBack.value = true
+  } else {
+    ElMessageBox.confirm(
+      '需登录后才能体验',
+      '提示',
+      {
+        confirmButtonText: '去登录',
+        cancelButtonText: '取消',
+        type: 'message',
+      }
+    ).then(() => {
+      isShowFeedBack.value = true
+    }).catch(() => {
+    })
+  }
 }
 
 function onClickShop() {
-  // todo: 要求登录
-  router.push({ name: 'ShopView' })
+  if (store.state.loginStatus === store.getters.loginStatusEnum.wxUser) {
+    isShowFeedBack.value = true
+  } else {
+    ElMessageBox.confirm(
+      '需登录后才能体验',
+      '提示',
+      {
+        confirmButtonText: '去登录',
+        cancelButtonText: '取消',
+        type: 'message',
+      }
+    ).then(() => {
+      isShowFeedBack.value = true
+    }).catch(() => {
+    })
+  }
 }
 </script>
 

+ 1 - 1
src/components/FeedBack.vue

@@ -194,7 +194,7 @@ function onSubmit() {
           font-size: 24px;
           color: #FFFFFF;
           line-height: 1px;
-          letter-spacing: 22px;
+          letter-spacing: 24px;
           margin-right: 15px;
         }
         >input, >textarea{