rk
2026-04-28 908b9876dde97acbb09c53dc6debe3eecbb9d1b4
small-program/pages/index/index.vue
@@ -18,7 +18,7 @@
         <view class="banner-card hero-banner">
            <swiper class="banner-swiper" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="500" :circular="true" :indicator-color="'rgba(255, 255, 255, 0.5)'" :indicator-active-color="'#ffffff'">
                <swiper-item v-for="(item, index) in bannerList" :key="index">
                <swiper-item v-for="(item, index) in bannerList" :key="index" @click="jumpBannerDetail(item)">
                    <image class="banner-image" :src="item.imgurlFull" mode="aspectFill"></image>
                </swiper-item>
            </swiper>
@@ -84,6 +84,7 @@
         </view>
         <view class="toast-btn" @click="handleLocation">开启定位</view>
      </view>
      <auth-login :show="showLogin" @close="showLogin = false"></auth-login>
      <custom-tabbar></custom-tabbar>
   </view>
</template>
@@ -98,7 +99,7 @@
         CustomTabbar
      },
      computed: {
         ...mapState(['navHeight', 'statusbarHeight', 'address', 'latitude', 'cityId', 'longitude']),
         ...mapState(['navHeight', 'statusbarHeight', 'address', 'latitude', 'cityId', 'longitude', 'token']),
         currentAddress() {
            return this.address && this.address !== '定位中' ? this.address : '获取定位'
         }
@@ -107,7 +108,9 @@
         return {
            bannerList: [],
            pointList: [],
            ingOrder: null
            ingOrder: null,
            showLogin: false,
            pendingNavigate: null
         }
      },
      async onLoad() {
@@ -121,7 +124,31 @@
         this.ingOrder =null
         this.getIngorder()
      },
      watch: {
         token(newToken) {
            if (newToken && this.pendingNavigate) {
               const fn = this.pendingNavigate
               this.pendingNavigate = null
               this.showLogin = false
               fn()
            }
         }
      },
      methods: {
         jumpBannerDetail(item) {
            if(!item.content || item.content =='' || item.type==0){
               return
            }
            if (item.type == 1) {
               uni.navigateTo({
                  url: '/shop/pages/article-details/article-details?id=' + item.id
               })
            } else if(item.type == 2) {
               uni.navigateTo({
                  url: '/shop/pages/webview/webview?url=' + item.content
               })
            }
         },
         jumpOrderDetail(id){
            uni.navigateTo({
               url:'/pages/delivery-order-detail/delivery-order-detail?userType=0&id='+id
@@ -135,12 +162,22 @@
            } 
         },
         jumpOrderList(status){
            if (!this.token) {
               this.pendingNavigate = () => this.jumpOrderList(status)
               this.showLogin = true
               return
            }
            uni.setStorageSync("orderStatus",status)
            uni.switchTab({
               url: '/pages/itinerary/itinerary'
            })
         },
         jumpxiadan() {
            if (!this.token) {
               this.pendingNavigate = () => this.jumpxiadan()
               this.showLogin = true
               return
            }
            if (!this.cityId) return uni.showToast({
               title: '当前城市暂未开通',
               icon: 'none'
@@ -219,7 +256,6 @@
                              that.$store.commit('setPosition', locParam)
                              that.$store.commit('clearCityId')
                              that.pointList = []
                              that.getNearbyShopList()
                           }
                        },
                        fail: function(err) {