Forráskód Böngészése

fix: 修复返回方法使用入参问题

liangan 6 napja
szülő
commit
219cb2d62d

+ 1 - 1
src/pages/bestSellers/bestSellers.vue

@@ -65,7 +65,7 @@ function getRankNumber(index: number) {
       <view class="relative from-[#FA2B19] to-[#FE6232] bg-gradient-to-br" :style="{ paddingTop: `${safeAreaInsets?.top}px` }">
         <wd-navbar :bordered="false" custom-class="bg-transparent!">
           <template #left>
-            <wd-icon name="thin-arrow-left" color="#fff" size="32rpx" @click="goBack" />
+            <wd-icon name="thin-arrow-left" color="#fff" size="32rpx" @click="() => goBack()" />
           </template>
           <template #title>
             <view class="text-white font-bold text-32rpx!">

+ 1 - 1
src/pages/forgotPassword/forgotPassword.vue

@@ -208,7 +208,7 @@ onUnmounted(() => {
       <!-- 自定义导航栏 -->
       <view :style="{ paddingTop: `${safeAreaInsets?.top}px` }">
         <view class="h-88rpx flex items-center px-24rpx">
-          <wd-icon name="thin-arrow-left" size="32rpx" @click="goBack" />
+          <wd-icon name="thin-arrow-left" size="32rpx" @click="() => goBack()" />
         </view>
       </view>
 

+ 1 - 1
src/pages/login/login.vue

@@ -94,7 +94,7 @@ async function handleLogin() {
       <!-- 自定义导航栏 -->
       <view :style="{ paddingTop: `${safeAreaInsets?.top}px` }">
         <view class="h-88rpx flex items-center px-24rpx">
-          <wd-icon name="thin-arrow-left" size="32rpx" @click="goBack" />
+          <wd-icon name="thin-arrow-left" size="32rpx" @click="() => goBack()" />
         </view>
       </view>
 

+ 1 - 1
src/pages/mine/share.vue

@@ -81,7 +81,7 @@ function handleShare(platform: string) {
       <!-- 自定义导航栏 -->
       <view :style="{ paddingTop: `${safeAreaInsets?.top}px` }">
         <view class="h-88rpx flex items-center px-24rpx">
-          <wd-icon name="thin-arrow-left" size="32rpx" @click="goBack" />
+          <wd-icon name="thin-arrow-left" size="32rpx" @click="() => goBack()" />
         </view>
       </view>
     </view>

+ 2 - 2
src/pages/productDetail/productDetail.vue

@@ -290,8 +290,8 @@ onShow(() => {
     <wd-navbar :bordered="false" safe-area-inset-top fixed :left-arrow="false" :custom-style="`background: ${navBgColor}; transition: background 0.3s;`" custom-class="h-auto!">
       <template #title>
         <view class="box-border h-full flex items-center justify-between p-24rpx">
-          <image :src="`/static/icons/left-icon${navBgColor === '#ffffff' ? '-tr' : ''}.png`" class="h-56rpx w-56rpx" @click="goBack" />
-          <image :src="`/static/icons/menu-icon${navBgColor === '#ffffff' ? '-tr' : ''}.png`" class="h-56rpx w-56rpx" @click="goBack" />
+          <image :src="`/static/icons/left-icon${navBgColor === '#ffffff' ? '-tr' : ''}.png`" class="h-56rpx w-56rpx" @click="() => goBack()" />
+          <image :src="`/static/icons/menu-icon${navBgColor === '#ffffff' ? '-tr' : ''}.png`" class="h-56rpx w-56rpx" @click="() => goBack()" />
         </view>
       </template>
     </wd-navbar>

+ 1 - 1
src/pages/referEarn/referEarn.vue

@@ -44,7 +44,7 @@ async function queryList(pageNo: number, pageSize: number) {
 <template>
   <wd-navbar custom-class="bg-transparent!" safe-area-inset-top :bordered="false" fixed>
     <template #left>
-      <wd-icon name="thin-arrow-left" color="#fff" size="32rpx" @click="goBack" />
+      <wd-icon name="thin-arrow-left" color="#fff" size="32rpx" @click="() => goBack()" />
     </template>
     <template #title>
       <view class="text-white font-bold text-32rpx!">

+ 1 - 1
src/pages/register/register.vue

@@ -183,7 +183,7 @@ onUnmounted(() => {
       <!-- 自定义导航栏 -->
       <view :style="{ paddingTop: `${safeAreaInsets?.top}px` }">
         <view class="h-88rpx flex items-center px-24rpx">
-          <wd-icon name="thin-arrow-left" size="32rpx" @click="goBack" />
+          <wd-icon name="thin-arrow-left" size="32rpx" @click="() => goBack()" />
         </view>
       </view>
 

+ 1 - 1
src/pages/search/search.vue

@@ -114,7 +114,7 @@ onLoad(() => {
           <template #title>
             <view class="content">
               <view class="back">
-                <wd-icon name="thin-arrow-left" size="32rpx" @click="goBack" />
+                <wd-icon name="thin-arrow-left" size="32rpx" @click="() => goBack()" />
               </view>
               <input v-model.trim="formData.storeName" class="search-input" type="text" :placeholder="$t('search.placeholder')" @confirm="queryList(1, 20)">
               <wd-icon name="search" custom-class="search-icon" color="#999" size="32rpx" />

+ 1 - 1
src/pages/topChampions/topChampions.vue

@@ -69,7 +69,7 @@ async function queryList(pageNo: number, pageSize: number) {
       >
         <wd-navbar :bordered="false" custom-class="bg-transparent!">
           <template #left>
-            <wd-icon name="thin-arrow-left" color="#fff" size="32rpx" @click="goBack" />
+            <wd-icon name="thin-arrow-left" color="#fff" size="32rpx" @click="() => goBack()" />
           </template>
           <template #title>
             <view class="text-white font-bold text-32rpx!">

+ 1 - 1
src/pages/wallet/withdraw.vue

@@ -65,7 +65,7 @@ onLoad((options) => {
       :title="t('wallet.withdraw.title')"
     >
       <template #left>
-        <wd-icon name="thin-arrow-left" size="32rpx" @click="goBack" />
+        <wd-icon name="thin-arrow-left" size="32rpx" @click="() => goBack()" />
       </template>
       <template #right>
         <text class="text-28rpx" @click="toPage('/pages/wallet/withdrawRecord', { type: queryParams.type })">

+ 2 - 0
src/utils/page.ts

@@ -1,5 +1,7 @@
 //  uniapp 返回 入参为堆栈
 export function goBack(delta = 1) {
+  console.log(delta)
+
   uni.navigateBack({ delta })
 }