Răsfoiți Sursa

登录优化

15102826049 1 săptămână în urmă
părinte
comite
f36cc54a16
5 a modificat fișierele cu 19 adăugiri și 10 ștergeri
  1. 2 2
      .env.development
  2. 0 1
      src/hooks/useDraw.ts
  3. 2 2
      src/pages/my/index.vue
  4. 6 3
      src/pagesOne/winner/index.vue
  5. 9 2
      src/utils/system.ts

+ 2 - 2
.env.development

@@ -10,5 +10,5 @@ VITE_APP_BASE_API = ''
 # 路由懒加载
 VITE_CLI_BABEL_TRANSPILE_MODULES = true
 
-# VITE_API_URL=http://192.168.168.104:8090
-VITE_API_URL=https://test-coupon.qiuyutech.com.cn/stage-api
+VITE_API_URL=http://192.168.168.104:8090
+# VITE_API_URL=https://test-coupon.qiuyutech.com.cn/stage-api

+ 0 - 1
src/hooks/useDraw.ts

@@ -76,7 +76,6 @@ export function useDraw(props?: any, emit?: any) {
         }
       })
       .catch((err) => {
-        console.log("-----------------------");
         uni.showToast({ icon: "none", title: err.msg });
       });
     setTimeout(() => {

+ 2 - 2
src/pages/my/index.vue

@@ -8,9 +8,9 @@
       <image class="avatar" :src="imgObj.user" mode="scaleToFill" />
       <view class="nickName">
         <text class="name">{{ phone || mobile || "用户昵称" }}</text>
-        <text v-if="!phone && !mobile" class="login" @click="onLogin"
+        <!-- <text v-if="!phone && !mobile" class="login" @click="onLogin"
           >点击登录</text
-        >
+        > -->
       </view>
     </view>
     <view class="dataBox" :style="{ marginTop: navTop + 290 + 'rpx' }">

+ 6 - 3
src/pagesOne/winner/index.vue

@@ -123,7 +123,7 @@ let list = ref([] as Receipt[]);
 const openid = uni.getStorageSync("openid");
 
 const isAddress = computed(() => {
-  return aData.authCheck.includes("2") ? true : false;
+  return aData?.authCheck.includes("2") ? true : false;
 });
 
 const params = reactive({
@@ -142,7 +142,10 @@ const getList = () => {
   getActivity(appid)
     .then((res: any) => {
       aData = res.data[0] || {};
-      aData.authCheck = aData.authCheck.split(",");
+      if (aData?.authCheck) {
+        aData.authCheck = aData.authCheck.split(",");
+      }
+
       list.value = aData.discounts.map((item: Receipt) => {
         return {
           ...item,
@@ -247,7 +250,7 @@ const onValidate = async () => {
   }
 };
 const handledUpload = async () => {
-  if (!aData.authCheck.includes("2")) {
+  if (!aData?.authCheck || !aData.authCheck.includes("2")) {
     showUpload.value = true;
 
     return;

+ 9 - 2
src/utils/system.ts

@@ -92,6 +92,13 @@ export const isGetPhone = () => {
   const authCheck = data?.authCheck?.split(",") || [];
   const isCheck = authCheck.includes("1");
   const isPhone = !!uni.getStorageSync("phone");
-
-  return isCheck && isPhone;
+  if (!isCheck) {
+    return true;
+  }
+  if (isCheck && !isPhone) {
+    return false;
+  }
+  if (isCheck && isPhone) {
+    return true;
+  }
 };