Przeglądaj źródła

添加积分商城页面、本地生活修改

chengjunhui 1 dzień temu
rodzic
commit
f66bb4ff8d

+ 9 - 1
pages.json

@@ -151,7 +151,15 @@
 						"enablePullDownRefresh": true,
 						"navigationBarBackgroundColor": "#f7f7f7"
 					}
-				}
+				},
+				{
+					"path": "pointsMall",
+					"style": {
+						"navigationBarTitleText": "积分商城",
+						"enablePullDownRefresh": true,
+						"navigationBarBackgroundColor": "#f7f7f7"
+					}
+				},
 			]
 		},
 		{

+ 61 - 60
pages/nearbyShop/list.vue

@@ -7,35 +7,21 @@
           <view>{{ cityName }}</view>
         </view>
         <view class="searchBox">
-          <image
-            src="/static/image/order/icon_search.png"
-            mode="widthFix"
-          ></image>
-          <input
-            v-model="param.keyword"
-            type="text"
-            @confirm="search"
-            placeholder-style="color:#B3B3B3"
-            placeholder="请输入关键字"
-            @input="search"
-          />
+          <image src="/static/image/order/icon_search.png" mode="widthFix"></image>
+          <input v-model="param.businessName" type="text" @confirm="search" placeholder-style="color:#B3B3B3"
+            placeholder="请输入关键字" @input="search" />
         </view>
       </view>
       <view class="tabsBox">
         <view class="type-box">
-          <view class="item" @click="show = true">
+          <view class="item" @click.stop="pickerRef.open()">
             <view>{{
               selectIndex === null ? "全部分类" : selector[selectIndex].name
             }}</view>
             <uv-icon name="arrow-down" color="#4d4d4d" size="26rpx"></uv-icon>
           </view>
-          <view
-            class="item"
-            v-for="(v, i) in typeList"
-            :key="i"
-            :class="{ activeCls: tabCurrent == i }"
-            @click="tabsChange2(i)"
-          >
+          <view class="item" v-for="(v, i) in typeList" :key="i" :class="{ activeCls: tabCurrent == i }"
+            @click="tabsChange2(i)">
             <view>{{ v.name }}</view>
           </view>
         </view>
@@ -44,60 +30,43 @@
     <view :style="{ height: placeholderH + 'px' }"></view>
     <view class="shopListBox" v-if="RowsList.length > 0">
       <!-- 附近门店 -->
-      <ShopItem
-        v-for="(v, index) in RowsList"
-        :key="v.businessId"
-        :v="v"
-      />
+      <ShopItem v-for="(v, index) in RowsList" :key="v.businessId" :v="v" />
     </view>
     <view>
-      <loadMore v-if="RowsList.length > 0" :status="LoadStatus"></loadMore>
+      <!-- <loadMore v-if="RowsList.length > 0" :status="LoadStatus"></loadMore> -->
       <noData v-if="RowsList.length <= 0" :config="{ top: 2 }"></noData>
     </view>
 
     <!-- 地区选择 -->
-    <RegionSelection
-      ref="regionSelectionRef"
-      :hierarchy="2"
-      @confirm="addressConfirm"
-    />
-    <uv-picker
-      mode="selector"
-      v-model="show"
-      :range="selector"
-      range-key="name"
-      :default-selector="[sIndex]"
-      @confirm="confirmSelect"
-    ></uv-picker>
+    <RegionSelection ref="regionSelectionRef" :hierarchy="2" @confirm="addressConfirm" />
+    <uv-picker ref="pickerRef" :columns="[selector]" keyName="name" :default-selector="[sIndex]"
+      @confirm="confirmSelect"></uv-picker>
   </view>
 </template>
 
 <script setup>
 import { computed, getCurrentInstance, nextTick, reactive, ref } from "vue";
 import { onLoad, onPullDownRefresh, onShow } from "@dcloudio/uni-app";
-import { getBusinessPage, getBusinessCategoryList } from "@/api/shop.js";
-import { usePageData } from "@/hooks/usePageData.ts";
-
+import { getBusinessList, getBusinessCategoryList } from "@/api/shop.js";
 import ShopItem from "./components/ShopItem.vue";
+const pickerRef = ref(null);
 const regionSelectionRef = ref(null);
-const { RowsList, LoadStatus, initData } = usePageData(getBusinessPage);
-
 const instance = getCurrentInstance();
 
-const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0);
-const sticky = computed(() => statusBarHeight.value + 44);
 const placeholderH = ref(0);
 
 const cityName = ref("武汉市");
 const sIndex = ref(0);
-const param = reactive({});
-
+const param = reactive({
+  businessName: "",
+  nearMe: true,
+});
+const RowsList = ref([]);
 const tabCurrent = ref(0);
 const typeList = ref([
   { name: "距离优先", order: "distance" },
   { name: "评分优先", order: "average" },
 ]);
-const show = ref(false);
 const selector = ref([]);
 const selectIndex = ref(null);
 
@@ -114,15 +83,28 @@ const getRect = (selectorStr) =>
 
 const tabsChange2 = (index) => {
   tabCurrent.value = index;
-  param.order = typeList.value[index]?.order || "distance";
-  console.log(param);
-  //   initData(param);
+  let order = typeList.value[index]?.order || "distance";
+  // console.log(param);
+  param.nearMe = false;
+  param.orderByColumn = undefined;
+  param.isAsc = undefined;
+  if (order == 'distance') {
+    param.nearMe = true;
+  } else {
+    param.orderByColumn = 'average';
+    param.isAsc = 'desc';
+  }
+  initData(param);
 };
 
 const confirmSelect = (e) => {
-  const idx = e?.[0] ?? 0;
+  // console.log(e);
+  const idx = e?.indexs[0] ?? 0;
+  // console.log(idx);
   selectIndex.value = idx;
   sIndex.value = idx;
+  param.businessCategoryId = selector.value[idx]?.categoryId || undefined;
+  // console.log(param);
   initData(param);
 };
 
@@ -137,10 +119,11 @@ const addressConfirm = (e) => {
 const getTppe = async (id) => {
   await getBusinessCategoryList().then((res) => {
     if (res && res.code == 200) {
-      selector.value = [{ name: "全部分类", id: "" }, ...(res.data || [])];
+      selector.value = [{ name: "全部分类", categoryId: "" }, ...(res.data || [])];
+      // console.log(selector.value);
       if (id) {
         selector.value.forEach((v, i) => {
-          if (String(v.id) === String(id)) selectIndex.value = i;
+          if (String(v.categoryId) === String(id)) selectIndex.value = i;
         });
       }
     }
@@ -151,12 +134,12 @@ const getTppe = async (id) => {
 const getLoca = async () => {
   await uni.getLocation({
     type: "gcj02",
-    geocode: true,
     success: (res) => {
-      // param.longitude = res.longitude;
-      // param.latitude = res.latitude;
+      param.userLongitude = res.longitude;
+      param.userLatitude = res.latitude;
+      initData(param);
     },
-    fail: () => {},
+    fail: () => { },
   });
 };
 
@@ -184,9 +167,26 @@ const initPage = async (options = {}) => {
   } catch (error) {
     console.log(error);
   }
-  initData(param);
 };
 
+const initData = (params = {}) => {
+  uni.showLoading({
+    title: '加载中',
+    mask: true
+  })
+  getBusinessList(params).then((res) => {
+    uni.hideLoading();
+    if (res && res.code == 200) {
+      RowsList.value = res.data || [];
+    } else {
+      RowsList.value = [];
+    }
+  }).finally(() => {
+    uni.stopPullDownRefresh();
+  });
+}
+
+
 onLoad((options) => {
   initPage(options || {});
 });
@@ -198,6 +198,7 @@ onShow(async () => {
 });
 
 onPullDownRefresh(() => {
+  initData(param);
   //   Promise.allSettled([getLoca(), initData(param)]).finally(() => {
   //     uni.stopPullDownRefresh();
   //   });

+ 1 - 1
pages/order/logisticsNew.vue

@@ -186,7 +186,7 @@ onLoad((options) => {
 });
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .container {
   padding-bottom: 170rpx;
 }

+ 307 - 0
pages/shop/pointsMall.vue

@@ -0,0 +1,307 @@
+<template>
+    <view class="pointsMall">
+        <view class="background">
+            <view class="me-integral" v-if="userCode">
+                <view class="item"> 我的积分: </view>
+                <view class="num"> {{ userCode || 0 }}积分 </view>
+            </view>
+        </view>
+        <swiper class="commodity" @change="imgActiveFun" :indicator-dots="false" :autoplay="false"
+            v-if="headGoodsList && headGoodsList.length > 0">
+            <swiper-item v-for="item in headGoodsList" :key="item.id" @click="
+                goProductDetails('/pages/product/goods/IntegralGood?id=' + item.id)
+                ">
+                <view class="commodity-item">
+                    <image :src="`${item.coverImage}?x-oss-process=style/w_350`" mode=""></image>
+                    <view class="number u-text2">
+                        {{ item.title }}
+                    </view>
+                    <view class="completed">
+                        {{ item.minPoints ? item.minPoints * 1 : '0' }}<text style="font-size: 30rpx;">积分</text><text
+                            v-if="item.maxSalePrice > 0">
+                            <text style="margin: 0 4rpx;">+</text>¥{{ item.maxSalePrice * 1 }}元</text>
+                    </view>
+                </view>
+            </swiper-item>
+        </swiper>
+        <noData v-else :config="{ top: 1, content: '暂无商品~' }"></noData>
+
+        <view class="option" v-if="RowsList && RowsList.length > 0">
+            <view class="option-item" :class="{ active: activeBannerIndex == index }" v-for="(item, index) in RowsList"
+                :key="index">
+            </view>
+        </view>
+        <view class="selected">
+            <view class="title">
+                <view class="item"> 精选商品 </view>
+                <view class="line"> </view>
+                <view class="hotseparation"> 热销优品快来拼购 </view>
+            </view>
+            <view class="middle" v-if="RowsList && RowsList.length > 0">
+                <view class="item" v-for="(item, index) in RowsList" :key="index" @click="
+                    goProductDetails('/pages/product/goods/IntegralGood?id=' + item.id)
+                    ">
+                    <image :src="`${item.coverImage}?x-oss-process=style/w_350`" mode=""></image>
+                    <view class="titletop ">
+                        {{ item.title }}
+                    </view>
+                    <view class="numintegral">
+                        {{ item.minPoints ? item.minPoints * 1 : '0' }}积分
+                        <text v-if="item.maxSalePrice > 0"><text>+</text>¥{{ item.maxSalePrice * 1 }}元 </text>
+                    </view>
+                </view>
+            </view>
+            <noData v-else :config="{ top: 1, content: '暂无商品~' }"></noData>
+        </view>
+    </view>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import { onLoad } from '@dcloudio/uni-app';
+import { totalIntegral_Api } from "@/api/userInfo.js";
+import { shopProductPage_Api } from "@/api/shop.js";
+import { usePageData } from "@/hooks/usePageData";
+const { RowsList, LoadStatus, initData } = usePageData(shopProductPage_Api);
+
+const activeBannerIndex = ref(0);
+const userCode = ref(null);
+const headGoodsList = ref([]);
+
+const imgActiveFun = (e) => {
+    activeBannerIndex.value = e.detail.current;
+}
+const goProductDetails = (url) => {
+    uni.navigateTo({
+        url: url,
+    });
+}
+
+// 获取我的积分
+const getMyMsg = () => {
+    totalIntegral_Api().then(res => {
+        if (res && res.code == 200) {
+            userCode.value = res.data
+            // console.log(userCode.value)
+        }
+    })
+}
+
+// 获取积分商品列表
+const getHeadGoodsList = (type) => {
+    shopProductPage_Api({
+        pageSize: 6,
+        pageNum: 1,
+        productPaymentMode: 1,
+    }).then((res) => {
+        if (res && res.code == 200) {
+            headGoodsList.value = res.rows || [];
+        }
+    });
+}
+
+onLoad(() => {
+    getMyMsg();
+    getHeadGoodsList();
+    initData({
+        productPaymentMode: 1,
+    })
+})
+</script>
+
+<style lang="scss" scoped>
+.commodity {
+    margin-top: -195rpx;
+    width: 720rpx;
+    margin-left: 30rpx;
+    min-height: 428rpx;
+    overflow: hidden;
+
+    ::v-deep swiper-item {
+        width: 286rpx !important;
+        padding-right: 18rpx;
+    }
+
+    ::v-deep .uni-swiper-slide-frame {
+        width: 42% !important;
+    }
+
+    .commodity-item {
+        // margin-right: 30rpx;
+        border-radius: 16rpx;
+        background-color: #ffffff;
+        // padding: 18rpx;
+        padding-top: 20rpx;
+        text-align: center;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        padding-bottom: 30rpx;
+
+        image {
+            width: 232rpx;
+            height: 232rpx;
+            border-radius: 16rpx;
+        }
+
+        .completed {
+            font-size: 33rpx;
+            margin-top: 14rpx;
+            font-weight: Bold;
+
+            color: #FF0000;
+
+        }
+
+        .number {
+            height: 64rpx;
+            line-height: 32rpx;
+            margin-top: 20rpx;
+            font-size: 22rpx;
+            color: #333333;
+            font-weight: 500;
+
+
+            .zero {
+                margin-left: 20rpx;
+                font-size: 22rpx;
+                color: #ff0000;
+                font-weight: 500;
+            }
+
+            .one {
+                color: #ff0000;
+                font-size: 34rpx;
+                font-weight: 700;
+            }
+
+            .two {
+                color: #ff0000;
+                font-size: 18rpx;
+                font-weight: 700;
+            }
+        }
+    }
+}
+
+.selected {
+    background-color: #ffffff;
+    border-radius: 40rpx 40rpx 0 0;
+    overflow: hidden;
+
+    .middle {
+        padding: 30rpx 0 0 30rpx;
+        display: flex;
+        flex-wrap: wrap;
+        box-sizing: border-box;
+        .item {
+            width: 216rpx;
+            text-align: center;
+            background-color: #ffffff;
+            box-shadow: 0rpx 0rpx 5rpx #e6e6e6;
+            border-radius: 20rpx;
+            margin-bottom: 30rpx;
+            margin-right: 20rpx;
+
+            image {
+                width: 216rpx;
+                height: 216rpx;
+                border-radius: 18rpx;
+            }
+
+            .titletop {
+                font-size: 24rpx;
+                line-height: 34rpx;
+                font-weight: 400;
+                color: #333333;
+                overflow: hidden;
+                white-space: nowrap;
+                text-overflow: ellipsis;
+                padding: 0 10rpx;
+            }
+
+            .numintegral {
+                font-size: 28rpx;
+                font-weight: 500;
+                color: #ff0000;
+                margin-bottom: 12rpx;
+                margin-top: 8rpx;
+            }
+        }
+    }
+
+    .title {
+        display: flex;
+        align-items: center;
+        margin-top: 36rpx;
+        margin-left: 30rpx;
+
+        .item {
+            font-weight: 700;
+            font-size: 36rpx;
+            color: #1a1a1a;
+        }
+
+        .line {
+            width: 1rpx;
+            height: 34rpx;
+            background-color: #707070;
+            margin: 0 15rpx;
+        }
+
+        .hotseparation {
+            font-size: 24rpx;
+            flex: 1;
+            font-weight: 400;
+            color: #666666;
+        }
+    }
+}
+
+.pointsMall {
+    background-color: #f6f6f6;
+}
+
+.option {
+    margin: 30rpx 0;
+    display: flex;
+    justify-content: center;
+
+    .option-item {
+        background-color: #d9d9d9;
+        margin: 0 8rpx;
+        width: 14rpx;
+        height: 14rpx;
+        border-radius: 7rpx;
+    }
+
+    .active {
+        background-color: #ff4e15;
+        width: 35rpx;
+        height: 14rpx;
+        border-radius: 7rpx;
+    }
+}
+
+.background {
+    width: 100%;
+    height: 300rpx;
+    background-color: #FA6138;
+    overflow: hidden;
+
+    .num {
+        color: #ffffff;
+        font-size: 28rpx;
+        font-weight: 500;
+    }
+
+    .me-integral {
+        display: flex;
+        justify-content: center;
+        color: #ffffff;
+        font-size: 28rpx;
+        font-weight: 500;
+        margin-top: 30rpx;
+    }
+}
+</style>

+ 65 - 78
pages/tabtar/city.vue

@@ -1,15 +1,8 @@
 <template>
   <view class="container">
     <uv-sticky :top="0" :customNavHeight="0">
-      <uv-navbar
-        title="本地生活"
-        leftIconSize="0"
-        :border="false"
-        bgColor="#fbcd17"
-        titleStyle="font-weight: 700;color: #1A1A1A;"
-        placeholder
-        :fixed="false"
-      ></uv-navbar>
+      <uv-navbar title="本地生活" leftIconSize="0" :border="false" bgColor="#fbcd17"
+        titleStyle="font-weight: 700;color: #1A1A1A;" placeholder :fixed="false"></uv-navbar>
       <view class="search-top">
         <view class="city-text" @click="regionSelectionRef.open()">
           <uv-icon name="map" color="#000000" size="28rpx"></uv-icon>
@@ -17,21 +10,11 @@
           <uv-icon name="arrow-right" color="#000000" size="30rpx"></uv-icon>
         </view>
         <view class="searchBox">
-          <uv-search
-            v-model="param.keyword"
-            shape="round"
-            :clearabled="false"
-            :showAction="false"
-            height="80rpx"
-            bg-color="#f7f7f7"
-            border-color="#D9D9D9"
-            laceholder-color="#CCCCCC"
-            search-icon="/static/image/order/icon_search.png"
-            @search="$uv.throttle(search, 1000)"
-            @custom="$uv.throttle(search, 1000)"
-          >
+          <uv-search v-model="param.businessName" shape="round" :clearabled="false" :showAction="false" height="80rpx"
+            bg-color="#f7f7f7" border-color="#D9D9D9" laceholder-color="#CCCCCC"
+            search-icon="/static/image/order/icon_search.png" @search="initData(param)">
             <template #suffix>
-              <view class="search-action">搜索</view>
+              <view class="search-action" @click.stop="initData(param)">搜索</view>
             </template>
           </uv-search>
         </view>
@@ -41,32 +24,17 @@
     <view class="u-skeleton">
       <view class="banner" v-if="bannerList.length > 0 || skeletonShow">
         <!-- <image src="/static/shop/banner.png" mode="aspectFill"></image> -->
-        <uv-swiper
-          class="u-skeleton-fillet"
-          :list="bannerList"
-          keyName="image"
-          height="360rpx"
-          :indicatorMode="bannerList.length > 1 ? 'round' : 'none'"
-          bgColor="transparent"
-        ></uv-swiper>
+        <uv-swiper class="u-skeleton-fillet" :list="bannerList" keyName="image" height="360rpx"
+          :indicatorMode="bannerList.length > 1 ? 'round' : 'none'" bgColor="transparent"
+          @click="bannerClick"></uv-swiper>
       </view>
       <view class="menu" v-if="iconList.length > 0 || skeletonShow">
-        <swiper
-          class="swiper u-skeleton-fillet"
-          :indicator-dots="true"
-          :autoplay="false"
-          :current="current"
-          :style="{ height: menuHeight }"
-          @change="swiperChange"
-        >
+        <swiper class="swiper u-skeleton-fillet" :indicator-dots="true" :autoplay="false" :current="current"
+          :style="{ height: menuHeight }" @change="swiperChange">
           <swiper-item class="swiper-item" v-for="(el, k) in iconList" :key="k">
-            <view class="item" v-for="(v, i) in el" :key="i" @click="goShop(v)">
+            <view class="item" v-for="(v, i) in el" :key="i" @click.stop="goShop(v)">
               <view class="img">
-                <image
-                  class="u-skeleton-fillet"
-                  :src="v.icon"
-                  mode="widthFix"
-                ></image>
+                <image class="u-skeleton-fillet" :src="v.categoryIcon" mode="widthFix"></image>
               </view>
               <text class="u-skeleton-fillet">{{ v.name || "加载中" }}</text>
             </view>
@@ -77,48 +45,39 @@
         <view class="store-bg">
           <image class="store-bg-image" src="/static/store.png" mode="">
           </image>
-          <view class="store-bg-btn" @click="goShop()">
+          <view class="store-bg-btn" @click.stop="goShop()">
             <text class="text">查看更多</text>
             <uv-icon name="arrow-right" color="#fbbd1c" size="24rpx"></uv-icon>
           </view>
         </view>
         <view class="items">
-          <ShopItem v-for="(v, index) in RowsList" :key="v.businessId" :v="v" />
+          <ShopItem v-for="(v) in RowsList" :key="v.businessId" :v="v" />
         </view>
       </view>
       <view>
-        <loadMore v-if="RowsList.length > 0" :status="LoadStatus"></loadMore>
         <noData v-if="RowsList.length <= 0" :config="{ top: 2 }"></noData>
       </view>
-      <uv-skeleton
-        :loading="skeletonShow"
-        :animation="true"
-        bgColor="#FFF"
-      ></uv-skeleton>
+      <uv-skeleton :loading="skeletonShow" :animation="true" bgColor="#FFF"></uv-skeleton>
     </view>
 
     <!-- 地区选择 -->
-    <RegionSelection
-      ref="regionSelectionRef"
-      :hierarchy="2"
-      @confirm="addressConfirm"
-    />
+    <RegionSelection ref="regionSelectionRef" :hierarchy="2" @confirm="addressConfirm" />
   </view>
 </template>
 
 <script setup>
 import { computed, reactive, ref } from "vue";
 import { onLoad, onPullDownRefresh } from "@dcloudio/uni-app";
-import { getAdList_Api, getQuickLinkList_Api } from "@/api/index.js";
-import { getBusinessPage } from "@/api/shop.js";
-import { usePageData } from "@/hooks/usePageData.ts";
+import { getAdList_Api } from "@/api/index.js";
+import { getBusinessList, getBusinessCategoryList } from "@/api/shop.js";
 import ShopItem from "../nearbyShop/components/ShopItem.vue";
-
-const { RowsList, LoadStatus, initData } = usePageData(getBusinessPage);
+import $util from "@/util/index";
+const RowsList = ref([]);
 const regionSelectionRef = ref(null);
-const cityName = ref("洪山区");
+const cityName = ref("武汉市");
 const param = reactive({
-  keyword: "",
+  businessName: undefined,
+  // cityCode: 420100, //武汉市
 });
 const iconList = ref([]);
 const bannerList = ref([]);
@@ -134,7 +93,7 @@ const goShop = (item = {}) => {
   uni.navigateTo({
     url:
       "/pages/nearbyShop/list?id=" +
-      (item.id || "") +
+      (item.categoryId || "") +
       "&cityName=" +
       cityName.value +
       "&cityCode=" +
@@ -161,7 +120,7 @@ const chunk = (arr, size) => {
 
 // 获取分类列表
 const getTypeList = () => {
-  getQuickLinkList_Api("local_life").then((res) => {
+  getBusinessCategoryList().then((res) => {
     if (res && res.code == 200) {
       const list = res.data || [];
       iconList.value = chunk(list, 10);
@@ -177,7 +136,6 @@ const getLocation = () =>
   new Promise((resolve, reject) => {
     uni.getLocation({
       type: "gcj02",
-      geocode: true,
       success: resolve,
       fail: reject,
     });
@@ -196,25 +154,52 @@ const addressConfirm = (e = {}) => {
   initData(param);
 };
 
+// 轮播图点击事件
+const bannerClick = (index) => {
+  const item = bannerList.value[index] || {};
+  // console.log(item);
+  $util.imgLink(item);
+};
+
+const initData = (params) => {
+  uni.showLoading({
+    title: '加载中',
+    mask: true
+  })
+  getBusinessList(params).then((res) => {
+    uni.hideLoading();
+    if (res && res.code == 200) {
+      RowsList.value = res.data || [];
+    } else {
+      RowsList.value = [];
+    }
+  }).finally(() => {
+    uni.stopPullDownRefresh();
+  });
+}
+
 onLoad(() => {
   getBanner();
   getTypeList();
-  getLocation().then((res) => {
-    console.log("当前位置", res);
-    param.longitude = res.longitude;
-    param.latitude = res.latitude;
-    // initData({
-    //   latitude: res.latitude,
-    //   longitude: res.longitude,
-    // });
-  });
+  try {
+    getLocation().then((res) => {
+      console.log("当前位置", res);
+      param.userLongitude = res.longitude;
+      param.userLatitude = res.latitude;
+      initData(param);
+    });
+  } catch (error) {
+    console.log(error);
+    initData(param);
+  }
   skeletonShow.value = false;
-  initData();
+  // initData(param);
 });
 
 onPullDownRefresh(() => {
   getBanner();
   getTypeList();
+  initData(param);
 });
 </script>
 
@@ -243,6 +228,7 @@ onPullDownRefresh(() => {
     display: flex;
     align-items: center;
     margin-bottom: 20rpx;
+
     view {
       max-width: 100rpx;
       white-space: nowrap;
@@ -390,6 +376,7 @@ onPullDownRefresh(() => {
       width: 141rpx;
       height: 33rpx;
     }
+
     .store-bg-btn {
       width: 165rpx;
       height: 58rpx;

+ 1 - 1
pages/tabtar/home.vue

@@ -32,7 +32,7 @@
       <!-- 首页一级分类 -->
       <div class="one-cate">
         <!-- cateList.slice(0,4) -->
-        <div class="item" v-for="item in skeletonShow ? 4 : cateList" @click="jumpHxCate(item, 0)" :key="item.id">
+        <div class="item" v-for="item in skeletonShow ? 4 : cateList" @click="$mUtil.imgLink(item, 0)" :key="item.id">
           <!-- ?x-oss-process=style/w_350 -->
           <image class="u-skeleton-fillet" mode="widthFix " :src="`${item.icon}`">
           </image>

+ 1 - 1
pages/user/address/addressList.vue

@@ -199,7 +199,7 @@ onShow(() => {
 });
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 page {
   background-color: #f5f5f5;
 }

+ 12 - 54
util/index.js

@@ -680,66 +680,24 @@ export default {
   },
   // banner跳转
   imgLink (item) {
-    let type = item.model_type
+    let type = item.jumpType
     let id = item.model_id
-    let url = item.url
-    let shopid = item.shop_id
-    if (type == "goods") {
+    // 内部页面
+    if(type == 0){
       uni.navigateTo({
-        url: "/pages/shop/goodsDetails?id=" + id + "&shopid=" + shopid,
+        url: item.innerPageCode,
       });
-    } else if (type == "service") {
-      uni.navigateTo({
-        url: "/pages/product/goods/serviceGood?id=" + id
-      });
-    } else if (type == "point_goods") {
-      // uni.navigateTo({
-      //   url: "/pages/product/goods/IntegralGood?id=" + id
-      // });
-    } else if (type == "shop") {
-      uni.navigateTo({
-        url: `/pages/shop/index?businessId=${id}`
-      })
-    } else if (type == "goods_polymerize") {
-      // 商品聚合页
+    }else if(type == 1){
+      // 外部链接
+      
+    }else if(type == 2){
+      // 内部资源
+      let url = '';
+      if(item.resourceModel){
 
-    } else if (type == "turntable") {
-      uni.navigateTo({
-        url: `/pages/game/Lottery?activityId=${id}`
-      })
-    } else if (type == "url") {
-      if (/^http/.test(url)) {
-        uni.navigateTo({
-          url: "/pages/index/webView?linkUrl=" + url,
-        });
-      } else {
-        uni.navigateTo({
-          url
-        });
-      }
-    } else if (type == 'inner_url') {
-      if (item.inner_code == 0) {
-        uni.switchTab({
-          url: `/pages/index/lidaPage`
-        })
-      } else if (item.inner_code == 1) {
-        uni.navigateTo({
-          url: `/pages/research/nearby/timeLimit`
-        })
-      } else if (item.inner_code == 2) {
-        uni.navigateTo({
-          url: `/pages/research/homepage/groupList`
-        })
-      } else if (item.inner_code == 3) {
-        uni.navigateTo({
-          url: `/pages/pointsMall/index`
-        })
-      } else {
-        uni.navigateTo({
-          url
-        });
       }
     }
+
   },
   // 一行卡号脱敏
   bankAccount (value) {