Sfoglia il codice sorgente

Merge branch 'master' of https://git.citupro.com/zhengnaiwen_citu/menduner-uniapp

lifanagju_citu 8 mesi fa
parent
commit
5d404f236c
4 ha cambiato i file con 33 aggiunte e 8 eliminazioni
  1. 2 2
      components/PositionList/index.vue
  2. 4 1
      pages/login/index.vue
  3. 8 1
      pagesA/seenMe/index.vue
  4. 19 4
      store/user.js

File diff suppressed because it is too large
+ 2 - 2
components/PositionList/index.vue


+ 4 - 1
pages/login/index.vue

@@ -86,6 +86,9 @@ const state = ref({
   }
 })
 
+// 登录成功后的返回页面
+const backUrl = getCurrentPages().length ? getCurrentPages()[getCurrentPages().length - 2].route : ''
+
 const onClickItem = (e) => {
   current.value = e.currentIndex
 }
@@ -107,7 +110,7 @@ const handleCode = () => {
 const handleLogin = async () => {
   const validate = await unref(current.value === 0 ? smsLoginRef : accountLoginRef).validate()
   if (!validate) return
-  await useUserStore.handleSmsLogin(current.value === 0 ? state.value.sms : state.value.account, current.value === 0 ? true : false)
+  await useUserStore.handleSmsLogin(current.value === 0 ? state.value.sms : state.value.account, current.value === 0 ? true : false, backUrl || 'pages/index/my')
 }
 </script>
 

+ 8 - 1
pagesA/seenMe/index.vue

@@ -2,7 +2,7 @@
   <view class="defaultBgc" style="height: 100vh;">
     <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore">
       <view v-if="list.length > 0">
-        <view v-for="(item, index) in list" :key="index" class="ss-m-t-20">
+        <view v-for="(item, index) in list" :key="index" class="ss-m-t-20" @click="toDetail(item)">
           <view class="sub-li-bottom">
             <view class="avatarBox">
               <image class="r-avatar" :src="getUserAvatar(item.contact.avatar, item.contact.sex)"></image>
@@ -88,6 +88,13 @@ const loadingMore = () => {
   queryParams.value.pageNo++
   getList()
 }
+
+// 企业详情
+const toDetail = (item) => {
+  uni.navigateTo({
+    url: `/pagesB/companyDetail/index?id=${item.enterprise.id}`
+  })
+}
 </script>
 
 <style scoped lang="scss">

+ 19 - 4
store/user.js

@@ -21,6 +21,13 @@ const defaultAccountInfo = {
   userId: ''
 }
 
+const tabUrl = [
+  'pages/index/index',
+  'pages/index/position',
+  'pages/index/communicate',
+  'pages/index/my'
+]
+
 export const userStore = defineStore({
   id: 'user',
   state: () => ({
@@ -32,7 +39,7 @@ export const userStore = defineStore({
 
   actions: {
     // 登录
-    async handleSmsLogin (query, type) {
+    async handleSmsLogin (query, type, route) {
       const api = type ? smsLogin : passwordLogin
       const { data, code } = await api(query)
       if (code === 0) {
@@ -42,9 +49,17 @@ export const userStore = defineStore({
       }
       this.accountInfo = data
       this.getInfo()
-      uni.switchTab({
-        url: '/pages/index/my'
-      })
+
+      // 登录成功后的跳转地址
+      if (tabUrl.includes(route)) {
+        uni.switchTab({
+          url: '/' + route
+        })
+      } else {
+        uni.navigateTo({
+          url: '/' + route
+        })
+      }
     },
     // 获取用户信息
     async getInfo() {

Some files were not shown because too many files changed in this diff