Ver código fonte

登录修改

zuypeng 1 ano atrás
pai
commit
9af47ab6df

+ 1 - 1
src/components/login-bar/index.vue

@@ -18,7 +18,7 @@ const state= reactive({
 
 onShow(()=>{
   let userData = getApp<any>().globalData.user;
-  state.isLogin =userData&&userData.id;
+  state.isLogin =!!(userData&&userData.id);
   console.log("login bar onLoad>>>>", userData, state.isLogin)
 })
 

+ 0 - 2
src/components/station/index.vue

@@ -42,12 +42,10 @@
 </template>
 
 <script setup lang="ts" name="Station">
-import {onMounted, reactive, ref} from 'vue'
 
 const props = defineProps({
   item: {
     type: Object,
-    require: true
   }
 })
 

+ 11 - 2
src/components/tab-bar/index.vue

@@ -6,7 +6,7 @@
             :class="[item.centerItem ? ' center-item' : '']"
             @click="handleTabbarClick(item)">
         <view class="item-top"><image :src="state.currentItem == item.id ? item.selectIcon : item.icon"></image></view>
-        <view class="item-bottom" :class="[state.currentItem == item.id ? 'item-active' : '']">
+        <view class="item-bottom" :class="[state.currentItem == item.id ? 'item-active' : '',state.isIOS?'ios':'']">
           <text>{{ item.text }}</text>
         </view>
       </view>
@@ -27,6 +27,8 @@
 
   const state = reactive({
     currentItem:0,
+    isIOS:false,
+
     tabbarList:[
       {
         id: 0,
@@ -57,10 +59,13 @@
 
   onLoad(() => {
     state.currentItem = props.index;
+
   })
 
   onShow(() => {
     state.currentItem = props.index;
+    const device = uni.getSystemInfoSync();
+    state.isIOS = device.osName === "ios";
   })
 
   onMounted(()=>{
@@ -146,6 +151,10 @@ view {
 }
 .tabbar-container .center-item .item-bottom {
   position: absolute;
-  bottom: 30rpx;
+  bottom: 0;
+}
+
+.ios{
+  bottom: 30rpx !important;
 }
 </style>

+ 40 - 5
src/manifest.json

@@ -7,16 +7,51 @@
     "transformPx" : false,
     "mp-weixin" : {
         "appid" : "wxe466e6b630cc47ae",
-        "setting" : {
-            "urlCheck" : false
+        "optimization": { "subPackages": true },
+        "setting": {
+            "urlCheck": false,
+            "es6": true,
+            "enhance": true,
+            "postcss": true,
+            "preloadBackgroundData": false,
+            "minified": true,
+            "newFeature": false,
+            "coverView": true,
+            "nodeModules": false,
+            "autoAudits": false,
+            "showShadowRootInWxmlPanel": true,
+            "scopeDataCheck": false,
+            "uglifyFileName": true,
+            "checkInvalidKey": true,
+            "checkSiteMap": true,
+            "uploadWithSourceMap": true,
+            "compileHotReLoad": false,
+            "lazyloadPlaceholderEnable": false,
+            "useMultiFrameRuntime": true,
+            "useIsolateContext": false,
+            "userConfirmedBundleSwitch": false,
+            "minifyWXSS": true,
+            "disableUseStrict": false,
+            "minifyWXML": true,
+            "showES6CompileOption": false,
+            "ignoreUploadUnusedFiles": true,
+            "useStaticServer": true,
+            "condition": false
         },
+        "useExtendedLib": {
+            "weui": true
+        },
+        "style": "v2",
+        "darkmode": false,
+        "resizable": false,
+        "lazyCodeLoading": "requiredComponents",
+        "usingComponents": true,
         "requiredPrivateInfos": ["getLocation"],
         "permission": {
             "scope.userLocation": {
-                "desc": "你的位置信息将用于获取附近洗车网点位置"
+                "desc": "你的位置信息将用于获取附近充电桩位置"
             }
-        },
-        "usingComponents" : true
+        }
     },
     "uniStatistics": {
         "enable": false

+ 4 - 1
src/pages.json

@@ -5,11 +5,14 @@
       "^uv-(.*)": "@climblee/uv-ui/components/uv-$1/uv-$1.vue"
     }
   },
+  "entryPagePath": "pages/index/index",
   "pages": [
     {
       "path": "pages/index/index",
       "style": {
-        "navigationBarTitleText": "iWash洗车"
+        "navigationBarTitleText": "iWash洗车",
+        "enablePullDownRefresh": true,
+        "disableScroll": true
       }
     },
     {

+ 36 - 5
src/pages/index/index.vue

@@ -36,7 +36,21 @@
     <view class="w100 gap"></view>
 
     <!--    站点清单  start-->
-    <view class="w100 content_station">
+    <view class="w100 content_station" >
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
+      <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
       <WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
     </view>
     <!--    站点清单  end-->
@@ -44,9 +58,9 @@
 <!--    <cover-view class="login_bar">
       <login-bar class="w100 text-center"></login-bar>
     </cover-view>-->
-    <cover-view class="login_bar" v-if="!isLogin">
+<!--    <cover-view class="login_bar" v-show="!isLogin">-->
       <login-bar class="w100 text-center"></login-bar>
-    </cover-view>
+<!--    </cover-view>-->
     <tab-bar :index="0" ></tab-bar>
   </view>
 </template>
@@ -120,8 +134,15 @@ onShow(() => {
   if (userData&&userData.id) {
     isLogin.value = true;
   }
-  console.log("show index>>>>",isLogin.value)
+  console.log("show index>>>>",isLogin.value,state.stationList,state.location)
+  let locationData = getApp<any>().globalData.location;
+  if(!locationData||!locationData.longitude){
+
   loadCurrentLocation();
+  }else{
+    state.location = locationData;
+    loadWashStationList();
+  }
   uni.$on('loginEvent', function (data) {
     isLogin.value = data.isLogin;
   })
@@ -156,10 +177,12 @@ const loadCurrentLocation = () => {
       uni.getLocation({
         type: 'gcj02', //返回可以用于uni.openLocation的经纬度
         success: res => {
-          state.location = {
+         let location = {
             latitude: res.latitude,
             longitude: res.longitude
           }
+          getApp<any>().globalData.location  = location;
+         state.location = location
           loadWashStationList();
           console.log("loadCurrentLocation location", res)
         }
@@ -250,6 +273,9 @@ const handleNavStation = (station: any) => {
   margin-bottom: 10rpx;
 }
 
+.swiper-content{
+  height: 200rpx;
+}
 .guide-content {
   text-align: center;
 }
@@ -258,4 +284,9 @@ const handleNavStation = (station: any) => {
   position: fixed;
   bottom: 20rpx;
 }
+
+.content_station{
+  height: calc(100vh - 600rpx );
+  overflow: scroll;
+}
 </style>

+ 2 - 2
src/utils/https.ts

@@ -20,8 +20,8 @@ const apis = {
         fileUrl: "https://zyp-1258963180.cos.ap-guangzhou.myqcloud.com/"
     },
     prd: {
-        serverUrl: "https://wash.kuaiyuman.cn/api/",
-        fileUrl: "https://wash.kuaiyuman.cn",
+        serverUrl: "https://dev-wash.kuaiyuman.cn/api",
+        fileUrl: "https://dev-wash.kuaiyuman.cn",
     },
 };
 // @ts-ignore