Pārlūkot izejas kodu

Merge branch 'main' into feature/v1.0.97

yuelujie 5 mēneši atpakaļ
vecāks
revīzija
7596dfd8d9

+ 5 - 0
apps/mobile/src/data/links.js

@@ -229,5 +229,10 @@ export const LINKS = {
     app: '/jyapp/frontPage/sunshine/free/index',
     h5: '/jyapp/frontPage/sunshine/free/index',
     wx: '/weixin/frontPage/sunshine/free/index'
+  },
+  首页: {
+    app: '/jyapp/jylab/mainSearch',
+    h5: '/jyapp/jylab/mainSearch',
+    wx: '/jylab/mainSearch?msg=0'
   }
 }

+ 54 - 23
apps/mobile/src/views/ai-search/index.vue

@@ -34,9 +34,28 @@ const rightAction = ref({
   ]
 })
 
+const canShowDoBackHome = ref(true)
+function doBackHome () {
+  trickClick(`退出页面-首页`)
+  return openAppOrWxPage(LINKS.首页, {
+    query: {
+      from: that.$route.query.from,
+      activity: that.$route.query.from || that.$route.query.activity
+    }
+  })
+}
+
 function doBack() {
   trickClick(`退出页面`)
-  that.$router.back()
+  if (history.length === 1) {
+    if (needBindPhone.value) {
+      checkBindPhone(true)
+    } else {
+      doBackHome()
+    }
+  } else {
+    that.$router.back()
+  }
 }
 
 function onSelectRightAction(action) {
@@ -628,13 +647,13 @@ function doAjaxGetHistoryList() {
   })
 }
 
-function goToDetail(item) {
+function goToDetail(item, isMore = false) {
   savePageState()
   const query = {}
   if (item.splitKeys) {
     query.keywords = item.splitKeys.join(' ')
   }
-  trickClick('点击跳转详情页', {
+  trickClick(isMore ? '查看更多列表点击跳转详情页' : '点击跳转详情页', {
     title: item.title,
     id: item.id
   })
@@ -687,7 +706,7 @@ function doLookMoreList(item) {
     id: item.id
   })
 }
-function doCellAction(item, type) {
+function doCellAction(item, type, isMore = false) {
   console.log(item)
   if (type === 'reload') {
     doAjaxSendMessage(item.message, type)
@@ -703,7 +722,7 @@ function doCellAction(item, type) {
     }).then((res) => {
       // that.$toast('感谢')
     })
-    trickClick('cell-action-点赞', {
+    trickClick(isMore ? 'cell-action-list-点赞' : 'cell-action-点赞', {
       message: item.message,
       id: item.id
     })
@@ -719,7 +738,7 @@ const moreLike = computed(() => {
 })
 
 function doMoreLike() {
-  doCellAction(moreLike.value, 'zan')
+  doCellAction(moreLike.value, 'zan', 'more')
 }
 
 const pageUserInfo = ref({})
@@ -744,17 +763,21 @@ async function getUserInfo() {
   }
 }
 // 绑定手机号
-function checkBindPhone() {
-  if (needLogin.value) {
+function checkBindPhone(skipLogin = false) {
+  if (!skipLogin && needLogin.value) {
     return openLinkOfOther(LINKS.APP登录页.app, {
       query: {
-        to: 'back'
+        to: 'back',
+        from: that.$route.query.from,
+        activity: that.$route.query.from || that.$route.query.activity
       }
     })
   }
   if (needBindPhone.value) {
     const query = {
-      mode: 'mergeBind'
+      mode: 'mergeBind',
+      from: that.$route.query.from,
+      activity: that.$route.query.from || that.$route.query.activity
     }
     return openAppOrWxPage(LINKS.绑定手机号, { query })
   }
@@ -923,20 +946,27 @@ init()
           </div>
         </div>
       </div>
-      <Popover
-        v-model="rightAction.show"
-        placement="bottom-end"
-        :offset="[-16, 12]"
-        trigger="click"
-        :actions="rightAction.actions"
-        @select="onSelectRightAction"
-      >
-        <template #reference>
+      <div>
+        <span v-if='canShowDoBackHome' class="back-icon" style='margin-right: 2px;padding-right: 6px;' @click='doBackHome'>
+          <i class="iconfont icon-nav_un_home" />
+        </span>
+        <Popover
+          v-model="rightAction.show"
+          placement="bottom-end"
+          :offset="[-16, 12]"
+          trigger="click"
+          :actions="rightAction.actions"
+          @select="onSelectRightAction"
+        >
+          <template #reference>
           <span class="right-icon">
             <i class="iconfont icon-gengduo-shuxiang" />
           </span>
-        </template>
-      </Popover>
+          </template>
+        </Popover>
+        <div class='bind-phone-popup' v-if="needBindPhone" @click="checkBindPhone"></div>
+      </div>
+
     </div>
 
     <div class="ai-search--content j-main" ref="contentEl">
@@ -1236,7 +1266,7 @@ init()
           <div
             class="more-header-icon mini-tip-container"
             :class="{ 'is-active': moreLike.like == 1 }"
-            @click="doMoreLike"
+            @click="doMoreLike('more')"
           >
             <img
               v-show="moreLike.like == 0"
@@ -1274,7 +1304,7 @@ init()
                 :keys="cell.splitKeys"
                 :left-top-badge-text="cell.leftTopBadgeText"
                 :tags="cell.tagList"
-                @click="goToDetail(cell)"
+                @click="goToDetail(cell, 'more')"
               >
                 <template slot="icon">
                   <div @click.stop="doCollection(cell, index)">
@@ -1566,6 +1596,7 @@ init()
     }
     .right-icon {
       padding: 10px 12px;
+      padding-left: 6px;
       i {
         display: inline-block;
         font-size: 24px;