Procházet zdrojové kódy

首页修改、拼团修改

chengjunhui před 1 měsícem
rodič
revize
65307b769d

+ 14 - 0
api/groupbuy.js

@@ -0,0 +1,14 @@
+// 查询今日必拼
+export const activitygoodswillYouSpell_Api = (params) => uni.$uv.http.get(`/groupbuy/activitygoods/will-you-spell`, { params });
+
+// 分页查询今日必拼
+export const activitygoodswillYouSpellPage_Api = (params) => uni.$uv.http.get(`/groupbuy/activitygoods/will-you-spell-page`, { params });
+
+// 查询商家某个拼团活动商品列表
+export const activitygoodsGetGroupBuyGoodsList_Api = (groupBuyId) => uni.$uv.http.get(`/groupbuy/activitygoods/getGroupBuyGoodsList/${groupBuyId}`, { });
+
+// 查询团商品的详情
+export const activitygoodsGoodsInfo_Api = (id) => uni.$uv.http.get(`/groupbuy/activitygoods/goodsInfo/${id}`, { });
+
+// 查询团的详情信息
+export const activitygoodsGroupbuying_Api = (id) => uni.$uv.http.get(`/groupbuy/activitygoods/groupbuying/${id}`, { });

+ 2 - 2
pages.json

@@ -3,9 +3,9 @@
 		{
 			"path": "pages/tabtar/home",
 			"style": {
-				"navigationBarTitleText": "店铺信息",
+				"navigationBarTitleText": "首页",
 				"navigationStyle": "custom",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true
 			}
 		},
 		{

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 89 - 121
pages/groupBuying/details.vue


+ 31 - 33
pages/groupBuying/list.vue

@@ -21,24 +21,25 @@
         "
       >
         <view class="commodity-item">
+          <!-- ?x-oss-process=style/w_350 -->
           <image
-            :src="`${item.cover}?x-oss-process=style/w_350`"
+            :src="`${item.coverImage}`"
             mode=""
           ></image>
           <view class="number">
-            <text>{{ item.group_people_num }}人团 </text>
+            <text>{{ item.groupPeopleNum }}人团 </text>
             <view class="u-FF0000" style="font-weight: Bold">
               <rich-text
-                :nodes="$mUtil.priceBigSmall(item.min_price)"
+                :nodes="$mUtil.priceBigSmall(item.minPrice)"
               ></rich-text>
             </view>
           </view>
-          <view class="completed" v-if="item.result_sale_num / 10000 > 1">
-            已有<text>{{ (item.result_sale_num / 10000).toFixed(1) }}万</text>
+          <view class="completed" v-if="item.resultSaleNum / 10000 > 1">
+            已有<text>{{ (item.resultSaleNum / 10000).toFixed(1) }}万</text>
             人拼
           </view>
           <view class="completed" v-else>
-            已有<text>{{ item.result_sale_num }}</text> 人拼
+            已有<text>{{ item.resultSaleNum }}</text> 人拼
           </view>
         </view>
       </swiper-item>
@@ -72,7 +73,7 @@
         >
           <view class="image">
             <image
-              :src="`${item.cover}?x-oss-process=style/w_350`"
+              :src="`${item.coverImage}`"
               mode=""
             ></image>
           </view>
@@ -85,18 +86,18 @@
                 <view class="number">
                   <view class="large">
                     <rich-text
-                      :nodes="$mUtil.priceBigSmall(item.min_price)"
+                      :nodes="$mUtil.priceBigSmall(item.minPrice)"
                     ></rich-text>
                   </view>
                   <view class="small">
                     <rich-text
-                      :nodes="$mUtil.priceBigSmall(item.min_sale_price)"
+                      :nodes="$mUtil.priceBigSmall(item.minSalePrice)"
                     ></rich-text>
                   </view>
                 </view>
                 <view class="three-people">
-                  {{ item.group_people_num }}人拼,已拼<text>{{
-                    item.result_sale_num
+                  {{ item.groupPeopleNum }}人拼,已拼<text>{{
+                    item.resultSaleNum
                   }}</text
                   >件
                 </view>
@@ -121,9 +122,16 @@ import {
   onPullDownRefresh,
   onReachBottom,
 } from "@dcloudio/uni-app";
+import {
+  activitygoodswillYouSpellPage_Api,
+  activitygoodswillYouSpell_Api,
+} from "@/api/groupbuy";
+
 import { usePageData } from "@/hooks/usePageData.ts";
 
-// const { RowsList, LoadStatus, initData } = usePageData(getSalesPageApi);
+const { RowsList, LoadStatus, initData } = usePageData(
+  activitygoodswillYouSpellPage_Api
+);
 const groupList = ref([]);
 const activeBannerIndex = ref(0);
 
@@ -139,40 +147,30 @@ const imgActiveFun = (e) => {
 };
 
 const getGroup = () => {
-  return;
-  globalThis.$http
-    .get(
-      `/groupbuy/activitygoods/will-you-spell`,
-      {
-        limit: 12,
-        page: 1,
-        ...params.value,
-      },
-      false
-    )
-    .then((res) => {
-      if (res && res.code == 200) {
-        groupList.value = res.list;
-      }
-    });
+  // return;
+  activitygoodswillYouSpell_Api({
+    limit: 12,
+    page: 1,
+  }).then((res) => {
+    if (res && res.code == 200) {
+      groupList.value = res.list;
+    }
+  });
 };
 
-
 // 页面生命周期函数
 onLoad((options) => {
-  if (options.shopid) {
-    params.value.shop_id = options.shopid;
-  }
+  initData();
 });
 
 onShow(() => {
   getGroup();
-  //   initData();
 });
 
 // 下拉刷新
 onPullDownRefresh(() => {
   getGroup();
+  initData();
 });
 </script>
 

+ 20 - 4
pages/tabtar/components/ChoiceZone.vue

@@ -21,11 +21,8 @@
 </template>
 
 <script setup>
+import { ref, onMounted } from "vue";
 const props = defineProps({
-  hxCateList: {
-    type: Array,
-    default: () => []
-  },
   skeletonShow: {
     type: Boolean,
     default: false
@@ -33,10 +30,29 @@ const props = defineProps({
 });
 
 const emit = defineEmits(['jumpHxCate']);
+const hxCateList = ref([]);
 
 const jumpHxCate = (item) => {
   emit('jumpHxCate', item);
 };
+
+const getHxCateList = () => {
+  return
+  uni.$uv.$http.get("/hxcategory/home/recommend/4").then((res) => {
+    if (res && res.code == 200) {
+      hxCateList.value = res.list;
+    }
+  });
+};
+// getHxCateList();
+onMounted(() => {
+  getHxCateList();
+});
+
+defineExpose({
+  init: getHxCateList,
+});
+
 </script>
 
 <style scoped lang="scss">

+ 31 - 17
pages/tabtar/components/GroupBuy.vue

@@ -26,14 +26,13 @@
       >
         <view
           class="middle"
-          @click="
-            goProductDetails('/pages/groupBuying/details?id=' + item.id)
-          "
+          @click="goProductDetails('/pages/groupBuying/details?id=' + item.id)"
         >
           <view class="middle-left">
+            <!-- ?x-oss-process=style/w_350 -->
             <image
-              v-if="item && item.cover"
-              :src="`${item.cover}?x-oss-process=style/w_350`"
+              v-if="item && item.coverImage"
+              :src="`${item.coverImage}`"
               mode="aspectFill"
             >
             </image>
@@ -45,14 +44,14 @@
                 <view class="contain">
                   <view class="large">
                     <rich-text
-                      :nodes="$mUtil.priceBigSmall(item.min_price)"
+                      :nodes="$mUtil.priceBigSmall(item.minPrice)"
                     ></rich-text>
                   </view>
-                  <view class="small">¥ {{ item.min_sale_price }}</view>
+                  <view class="small">¥ {{ item.minSalePrice }}</view>
                 </view>
                 <view class="three"
-                  >{{ item.group_people_num }}人团,已拼
-                  <text style="color: red"> {{ item.result_sale_num }}</text>
+                  >{{ item.groupPeopleNum }}人团,已拼
+                  <text style="color: red"> {{ item.resultSaleNum }}</text>
                   件</view
                 >
               </view>
@@ -67,15 +66,10 @@
 </template>
 
 <script setup>
-import { getCurrentInstance } from "vue";
-const { proxy } = getCurrentInstance();
-const $mUtil = proxy.$mUtil;
+import { ref, onMounted } from "vue";
+import { activitygoodswillYouSpellPage_Api } from "@/api/groupbuy";
 
 const props = defineProps({
-  groupList: {
-    type: Array,
-    default: () => [],
-  },
   skeletonShow: {
     type: Boolean,
     default: false,
@@ -87,7 +81,7 @@ const props = defineProps({
 });
 
 const emit = defineEmits(["goDetail", "goProductDetails"]);
-
+const groupList = ref([]);
 const goDetail = (url) => {
   emit("goDetail", url);
 };
@@ -95,6 +89,26 @@ const goDetail = (url) => {
 const goProductDetails = (url) => {
   emit("goProductDetails", url);
 };
+
+/**团购 */
+const getgroupList = () => {
+  activitygoodswillYouSpellPage_Api({
+    pageSize: 10,
+    pageNum: 1,
+  }).then((res) => {
+    if (res && res.code == 200) {
+      groupList.value = res.rows || [];
+    }
+  });
+};
+
+onMounted(() => {
+  getgroupList();
+});
+
+defineExpose({
+  init: getgroupList,
+});
 </script>
 
 <style scoped lang="scss">

+ 44 - 11
pages/tabtar/components/GuessYouLike.vue

@@ -57,15 +57,10 @@
 </template>
 
 <script setup>
-import { getCurrentInstance } from "vue";
-const { proxy } = getCurrentInstance();
-const $mUtil = proxy.$mUtil;
+import { ref, onMounted } from "vue";
+import { usePageData } from "@/hooks/usePageData.ts";
 
 const props = defineProps({
-  goodsList: {
-    type: Array,
-    default: () => []
-  },
   skeletonShow: {
     type: Boolean,
     default: false
@@ -74,13 +69,11 @@ const props = defineProps({
     type: String,
     default: ''
   },
-  status: {
-    type: String,
-    default: 'more'
-  }
 });
 
 const emit = defineEmits(['goDetail', 'goProductDetails']);
+const status = ref("more");
+const goodsList = ref([]);
 
 const goDetail = (url, isNeedLogin, tabShow) => {
   emit('goDetail', url, isNeedLogin, tabShow);
@@ -89,6 +82,46 @@ const goDetail = (url, isNeedLogin, tabShow) => {
 const goProductDetails = (url) => {
   emit('goProductDetails', url);
 };
+
+// 列表查询数据
+// const { RowsList, LoadStatus, initData } = usePageData();
+
+
+// /**猜你喜欢 */
+// const guessLike = () => {
+//   keyWord.value = uni.getStorageSync("history")
+//     ? uni.getStorageSync("history").join(",")
+//     : "";
+//   uni.$uv.$http
+//     .get(
+//       `/goods/smart`,
+//       {
+//         page: page.value,
+//         limit: 6,
+//         keywords: keyWord.value,
+//       },
+//       false
+//     )
+//     .then((res) => {
+//       if (res && res.code == 200) {
+//         goodsList.value =
+//           page.value == 1
+//             ? res.page.list
+//             : goodsList.value.concat(res.page.list);
+//         if (res.page.totalPage <= res.page.currPage) {
+//           status.value = "noMore";
+//         } else {
+//           status.value = "more";
+//         }
+//         skeletonShow.value = false;
+//       }
+//     });
+// };
+
+onMounted(() => {
+  // initData();
+});
+
 </script>
 
 <style scoped lang="scss">

+ 23 - 5
pages/tabtar/components/HotRecommend.vue

@@ -53,14 +53,11 @@
 </template>
 
 <script setup>
-import { getCurrentInstance } from "vue";
+import { ref, onMounted } from "vue";
+import { shopProductList_Api } from "@/api/shop";
 
 
 const props = defineProps({
-  recommendList: {
-    type: Array,
-    default: () => []
-  },
   skeletonShow: {
     type: Boolean,
     default: false
@@ -72,6 +69,7 @@ const props = defineProps({
 });
 
 const emit = defineEmits(['goDetail', 'goProductDetails']);
+const recommendList = ref([]); //推荐
 
 const goDetail = (url, isNeedLogin, tabShow) => {
   emit('goDetail', url, isNeedLogin, tabShow);
@@ -80,6 +78,26 @@ const goDetail = (url, isNeedLogin, tabShow) => {
 const goProductDetails = (url) => {
   emit('goProductDetails', url);
 };
+
+/**热门推荐 */
+const recommend = () => {
+  shopProductList_Api({
+    limit: 6,
+    recommendStatus: 1,
+  }).then((res) => {
+    if (res && res.code == 200) {
+      recommendList.value = res.data;
+    }
+  });
+};
+
+onMounted(() => {
+  recommend();
+});
+
+defineExpose({
+  init: recommend,
+});
 </script>
 
 <style scoped lang="scss">

+ 44 - 4
pages/tabtar/components/MonthlyBestSeller.vue

@@ -66,9 +66,8 @@
 </template>
 
 <script setup>
-import { getCurrentInstance } from "vue";
-const { proxy } = getCurrentInstance();
-const $mUtil = proxy.$mUtil;
+import { ref, onMounted } from "vue";
+import { shopProductList_Api } from "@/api/shop";
 
 const props = defineProps({
   hotList: {
@@ -98,6 +97,11 @@ const props = defineProps({
 });
 
 const emit = defineEmits(['goDetail', 'goProductDetails', 'imgActiveFun']);
+const hotList = ref([]); //本月热销
+const lineList = ref(0);
+const itemsDis = ref(1);
+const activeBannerIndex = ref(0);
+
 
 const goDetail = (url, isNeedLogin, tabShow) => {
   emit('goDetail', url, isNeedLogin, tabShow);
@@ -108,8 +112,44 @@ const goProductDetails = (url) => {
 };
 
 const imgActiveFun = (e) => {
-  emit('imgActiveFun', e);
+  activeBannerIndex.value = e.detail.current;
+};
+
+/**本月热销 */
+const hotSale = () => {
+  shopProductList_Api({
+    limit: 12,
+    hot: 1,
+  }).then((res) => {
+    if (res && res.code == 200) {
+      let list = res.data || [];
+      hotList.value = res.data;
+      if (hotList.value.length > 2) {
+        lineList.value = hotList.value.length - 2;
+      }
+      if (list.length <= 3) {
+        itemsDis.value = list.length;
+      }
+      if (list.length > 3 && list.length <= 6) {
+        itemsDis.value = 3;
+      }
+      if (list.length > 6 && list.length <= 9) {
+        itemsDis.value = 3;
+      }
+      if (list.length > 9 && list.length <= 12) {
+        itemsDis.value = 3;
+      }
+    }
+  });
 };
+
+onMounted(() => {
+  hotSale();
+});
+
+defineExpose({
+  init: hotSale,
+});
 </script>
 
 <style scoped lang="scss">

+ 42 - 31
pages/tabtar/components/Seckill.vue

@@ -4,27 +4,30 @@
     v-if="(currSeckill && currSeckill.length > 0) || skeletonShow"
   >
     <view class="seckill-item">
-      <view
-        class="seckill-top"
-        @click="goDetail('/pages/seckill/list')"
-      >
+      <view class="seckill-top" @click="goDetail('/pages/seckill/list')">
         <view class="left">限时秒杀</view>
         <view class="line" v-if="currTime"></view>
         <view class="time" v-if="currTime">{{ currTime }}点场 剩余</view>
         <view class="reciprocal" v-if="currTime">
-          <!-- <uni-countdown
+          <uv-count-down
             :time="finishTime"
-            :backgroundColor="'none'"
-            :color="'#fff'"
-            :splitorColor="'#fff'"
-            :show-day="time2[0] > 0"
-            :day="time2[0]"
-            :hour="time2[1]"
-            :minute="time2[2]"
-            :second="time2[3]"
+            format="HH:mm:ss"
+            @change="onChange"
           >
-          </uni-countdown> -->
-          <uv-count-down :time="finishTime" format="HH:mm:ss"></uv-count-down>
+            <view>
+              <text class="time__item" v-if="timeData.hours != null"
+                >{{
+                  timeData.hours > 10 ? timeData.hours : "0" + timeData.hours
+                }}:</text
+              >
+              <text class="time__item" v-if="timeData.minutes != null"
+                >{{ timeData.minutes }}:</text
+              >
+              <text class="time__item" v-if="timeData.seconds != null">{{
+                timeData.seconds
+              }}</text>
+            </view>
+          </uv-count-down>
         </view>
       </view>
       <view
@@ -84,27 +87,35 @@
 </template>
 
 <script setup>
-import { ref } from "vue";
+import { ref, onMounted } from "vue";
 import { seckillActivityProductFlash_Api } from "@/api/seckill.js";
 
 const props = defineProps({
   skeletonShow: {
     type: Boolean,
-    default: false
-  }
+    default: false,
+  },
 });
 
-const emit = defineEmits(['goDetail', 'overDown2', 'imgActiveFun2', 'goProductDetails']);
-
+const emit = defineEmits([
+  "goDetail",
+  "overDown2",
+  "imgActiveFun2",
+  "goProductDetails",
+]);
+const timeData = ref({});
 const currSeckill = ref([]); //秒杀
 const currTime = ref(null);
 const finishTime = ref(null);
 const itemsDis2 = ref(1);
 const activeBannerIndex2 = ref(0);
 
+const onChange = (e) => {
+  timeData.value = e;
+};
 
 const goDetail = (url) => {
-  emit('goDetail', url);
+  emit("goDetail", url);
 };
 
 const imgActiveFun2 = (e) => {
@@ -112,7 +123,7 @@ const imgActiveFun2 = (e) => {
 };
 
 const goProductDetails = (url) => {
-  emit('goProductDetails', url);
+  emit("goProductDetails", url);
 };
 
 const oneArrToTwoArr = (data) => {
@@ -133,7 +144,6 @@ const oneArrToTwoArr = (data) => {
   return newData;
 };
 
-
 /**限时秒杀 */
 const getSeckillList = () => {
   seckillActivityProductFlash_Api({ limit: 10 }).then((res) => {
@@ -148,10 +158,11 @@ const getSeckillList = () => {
     }
   });
 };
-getSeckillList();
-
+onMounted(() => {
+  getSeckillList();
+});
 defineExpose({
-  getSeckillList
+  init: getSeckillList,
 });
 </script>
 
@@ -234,16 +245,16 @@ defineExpose({
         font-weight: Bold;
         border-radius: 30rpx;
         margin-left: 30rpx;
-
-        &:deep(.uv-count-down__text) {
-          color: #ffffff;
-          font-size: 24rpx;
-        }
       }
     }
   }
 }
 
+.time__item {
+  color: #ffffff !important;
+  font-size: 24rpx;
+}
+
 .slide-box {
   display: flex;
   justify-content: center;

+ 36 - 172
pages/tabtar/home.vue

@@ -14,11 +14,11 @@
         <view class="input-placeholder" @click="searchClick"
           >请输入检索关键字</view
         >
-        <text class="iconfont2 msgCenter" @click="goToMsg()">
+        <view class="msgCenter" @click="goToMsg()">
           <!-- &#xe67c; -->
           <uv-icon name="chat" color="#ffffff" size="28"></uv-icon>
           <text v-if="msgCenter == 0 ? false : msgCenter">{{ msgCenter }}</text>
-        </text>
+        </view>
       </view>
     </view>
     <view class="u-skeleton">
@@ -86,24 +86,22 @@
       </view>
       <!-- 惠选专区 hxCateList-->
       <ChoiceZone
-        :hxCateList="hxCateList"
+        ref="choiceZoneRef"
         :skeletonShow="skeletonShow"
         @jumpHxCate="jumpHxCate"
       />
 
       <!-- 限时秒杀 -->
       <Seckill
+        ref="seckillRef"
         :skeletonShow="skeletonShow"
-        :itemsDis2="itemsDis2"
-        :activeBannerIndex2="activeBannerIndex2"
         @goDetail="goDetail"
-        @imgActiveFun2="imgActiveFun2"
         @goProductDetails="goProductDetails"
       />
 
       <!-- 拼团购 -->
       <GroupBuy
-        :groupList="groupList"
+        ref="groupBuyRef"
         :skeletonShow="skeletonShow"
         :bgImage="bgImage.image2"
         @goDetail="goDetail"
@@ -112,7 +110,7 @@
 
       <!-- 热门推荐 -->
       <HotRecommend
-        :recommendList="recommendList"
+        ref="hotRecommendRef"
         :skeletonShow="skeletonShow"
         :bgImage="bgImage.image3"
         @goDetail="goDetail"
@@ -121,23 +119,19 @@
 
       <!-- 本月热销 -->
       <MonthlyBestSeller
-        :hotList="hotList"
+        ref="monthlyBestSellerRef"
         :skeletonShow="skeletonShow"
         :bgImage="bgImage.image4"
-        :itemsDis="itemsDis"
-        :lineList="lineList"
-        :activeBannerIndex="activeBannerIndex"
         @goDetail="goDetail"
         @goProductDetails="goProductDetails"
-        @imgActiveFun="imgActiveFun"
       />
 
       <!-- 猜你喜欢 -->
       <GuessYouLike
+        ref="guessYouLikeRef"
         :goodsList="goodsList"
         :skeletonShow="skeletonShow"
         :bgImage="bgImage.image5"
-        :status="status"
         @goDetail="goDetail"
         @goProductDetails="goProductDetails"
       />
@@ -156,17 +150,15 @@
 </template>
 
 <script setup>
-import { ref, reactive, onMounted, getCurrentInstance } from "vue";
+import { ref, reactive } from "vue";
 import {
   onLoad,
   onShow,
   onPullDownRefresh,
-  onReachBottom,
   onPageScroll,
   onShareAppMessage,
 } from "@dcloudio/uni-app";
 import { getAdList_Api, getQuickLinkList_Api } from "@/api/index.js";
-import { shopProductList_Api } from "@/api/shop.js";
 import { messageUnreadNum_Api } from "@/api/userInfo.js";
 
 import ChoiceZone from "./components/ChoiceZone.vue";
@@ -177,6 +169,13 @@ import MonthlyBestSeller from "./components/MonthlyBestSeller.vue";
 import GuessYouLike from "./components/GuessYouLike.vue";
 import utils from "@/util/index.js";
 
+const choiceZoneRef = ref(null);
+const seckillRef = ref(null);
+const groupBuyRef = ref(null);
+const hotRecommendRef = ref(null);
+const monthlyBestSellerRef = ref(null);
+// const guessYouLikeRef = ref(null);
+
 // 响应式数据
 const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight);
 const menuButtonHeight = ref(0);
@@ -186,22 +185,10 @@ try {
   console.log(error);
 }
 const showTopSearch = ref(true);
-
-const keyWord = ref("");
-const groupList = ref([]); //团购
-const hotList = ref([]); //本月热销
-const recommendList = ref([]); //推荐
 const shopBanner = ref([]); //轮播图
 const goodsList = ref([]); //猜你喜欢
-const itemsDis = ref(1);
-const activeBannerIndex = ref(0);
-
-const page = ref(1);
-const status = ref("more");
 const msgCenter = ref(null);
 const cateList = ref([]); // 一级分类
-const hxCateList = ref([]);
-const lineList = ref(0);
 const homeBanner1 = ref({});
 const skeletonShow = ref(true);
 
@@ -234,11 +221,10 @@ const getHomeBanner1 = () => {
   });
 };
 
-const init = () => {
-  page.value = 1;
-  getAll();
+const init = () => {  
+  getBanner();
   getOneCate();
-  // getHxCateList();
+  getHomeBanner1();
 };
 
 // 跳转消息页面
@@ -262,15 +248,6 @@ const goProductDetails = (url) => {
   });
 };
 
-const getAll = () => {
-  // rest();
-  getBanner();
-  // seckillList();
-  // getgroupList();
-  recommend();
-  hotSale();
-  // guessLike();
-};
 
 /**获得消息数量 */
 const getmessageNum = () => {
@@ -296,14 +273,6 @@ const getOneCate = () => {
   });
 };
 
-const getHxCateList = () => {
-  uni.$uv.$http.get("/hxcategory/home/recommend/4").then((res) => {
-    if (res && res.code == 200) {
-      hxCateList.value = res.list;
-    }
-  });
-};
-
 
 const jumpHxCate = (item, area_feature) => {
   let url = `/pages/freeCollection/index`;
@@ -332,103 +301,6 @@ const getBanner = () => {
     });
 };
 
-const imgActiveFun = (e) => {
-  activeBannerIndex.value = e.detail.current;
-};
-
-
-
-/**团购 */
-const getgroupList = () => {
-  uni.$uv.$http
-    .get(
-      `/groupbuy/activitygoods/will-you-spell`,
-      {
-        limit: 10,
-        page: 1,
-      },
-      false
-    )
-    .then((res) => {
-      if (res && res.code == 200) {
-        if (res.list.length > 0) {
-          groupList.value = res.list;
-        }
-      }
-    });
-};
-
-/**热门推荐 */
-const recommend = () => {
-  shopProductList_Api({
-    limit: 6,
-    recommendStatus: 1,
-  }).then((res) => {
-    if (res && res.code == 200) {
-      recommendList.value = res.data;
-    }
-  });
-};
-
-/**本月热销 */
-const hotSale = () => {
-  shopProductList_Api({
-    limit: 12,
-    hot: 1,
-  }).then((res) => {
-    if (res && res.code == 200) {
-      let list = res.data || [];
-      hotList.value = res.data;
-      if (hotList.value.length > 2) {
-        lineList.value = hotList.value.length - 2;
-      }
-      if (list.length <= 3) {
-        itemsDis.value = list.length;
-      }
-      if (list.length > 3 && list.length <= 6) {
-        itemsDis.value = 3;
-      }
-      if (list.length > 6 && list.length <= 9) {
-        itemsDis.value = 3;
-      }
-      if (list.length > 9 && list.length <= 12) {
-        itemsDis.value = 3;
-      }
-    }
-  });
-};
-
-/**猜你喜欢 */
-const guessLike = () => {
-  keyWord.value = uni.getStorageSync("history")
-    ? uni.getStorageSync("history").join(",")
-    : "";
-  uni.$uv.$http
-    .get(
-      `/goods/smart`,
-      {
-        page: page.value,
-        limit: 6,
-        keywords: keyWord.value,
-      },
-      false
-    )
-    .then((res) => {
-      if (res && res.code == 200) {
-        goodsList.value =
-          page.value == 1
-            ? res.page.list
-            : goodsList.value.concat(res.page.list);
-        if (res.page.totalPage <= res.page.currPage) {
-          status.value = "noMore";
-        } else {
-          status.value = "more";
-        }
-        skeletonShow.value = false;
-      }
-    });
-};
-
 const goDetail = (url, isNeedLogin, tabShow = false) => {
   if ((isNeedLogin && uni.getStorageSync("apiToken") == "") || null) {
     uni.$uv.toast("请先登录");
@@ -445,15 +317,6 @@ const goDetail = (url, isNeedLogin, tabShow = false) => {
   }
 };
 
-/**重置数据*/
-const rest = () => {
-  goodsList.value = [];
-  shopBanner.value = [];
-  recommendList.value = [];
-  hotList.value = [];
-  groupList.value = [];
-};
-
 const toCartPage = () => {
   uni.switchTab({
     url: "/pages/tabtar/shoppingCart",
@@ -464,7 +327,6 @@ const toCartPage = () => {
 onLoad(() => {
   skeletonShow.value = false;
   init();
-  getHomeBanner1();
 });
 
 onShow(() => {
@@ -472,24 +334,26 @@ onShow(() => {
 });
 
 onPullDownRefresh(() => {
-  return;
-  page.value = 1;
-  getAll();
-  getOneCate();
-  getHxCateList();
-  getHomeBanner1();
+  init();
+  if(choiceZoneRef.value) choiceZoneRef.value.init();
+  if(seckillRef.value) seckillRef.value.init();
+  if(groupBuyRef.value) groupBuyRef.value.init();
+  if(hotRecommendRef.value) hotRecommendRef.value.init();
+  if(monthlyBestSellerRef.value) monthlyBestSellerRef.value.init();
+  // if(guessYouLikeRef.value) guessYouLikeRef.value.init();
+
   setTimeout(() => {
     uni.stopPullDownRefresh();
   }, 300);
 });
 
-onReachBottom(() => {
-  return;
-  if (status.value == "more") {
-    page.value++;
-    guessLike();
-  }
-});
+// onReachBottom(() => {
+//   return;
+//   if (status.value == "more") {
+//     page.value++;
+//     guessLike();
+//   }
+// });
 
 onPageScroll((e) => {
   //nvue暂不支持滚动监听,可用bindingx代替
@@ -508,7 +372,7 @@ onShareAppMessage((res) => {
   }
   return {
     title: "商城",
-    path: `/pages/index/lidaPage?shareId=${user.id || ""}`,
+    path: `/pages/tabtar/home?shareId=${user.id || ""}`,
   };
 });
 </script>
@@ -780,7 +644,7 @@ onShareAppMessage((res) => {
       padding-left: 80rpx;
       // color: #666666;
       background: rgba(255, 255, 255, 0.3);
-      // background-image: url("/static/czd/search.png");
+      background-image: url("/static/search.png");
       background-size: 40rpx 40rpx;
       background-position: 24rpx 50%;
       background-repeat: no-repeat;

binární
static/search.png


+ 30 - 0
uni_modules/uni-countdown/changelog.md

@@ -0,0 +1,30 @@
+## 1.2.5(2025-04-14)
+- 修复 filterShow 导致的运行报错
+## 1.2.4(2024-09-21)
+- 新增 支持控制显示位数 默认显示2位
+## 1.2.3(2024-02-20)
+- 新增 支持控制小时,分钟的显隐:showHour showMinute
+## 1.2.2(2022-01-19)
+- 修复 在微信小程序中样式不生效的bug
+## 1.2.1(2022-01-18)
+- 新增 update 方法 ,在动态更新时间后,刷新组件
+## 1.2.0(2021-11-19)
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-countdown](https://uniapp.dcloud.io/component/uniui/uni-countdown)
+## 1.1.3(2021-10-18)
+- 重构
+- 新增 font-size 支持自定义字体大小
+## 1.1.2(2021-08-24)
+- 新增 支持国际化
+## 1.1.1(2021-07-30)
+- 优化 vue3下小程序事件警告的问题
+## 1.1.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.0.5(2021-06-18)
+- 修复 uni-countdown 重复赋值跳两秒的 bug
+## 1.0.4(2021-05-12)
+- 新增 组件示例地址
+## 1.0.3(2021-05-08)
+- 修复 uni-countdown 不能控制倒计时的 bug
+## 1.0.2(2021-02-04)
+- 调整为uni_modules目录规范

+ 6 - 0
uni_modules/uni-countdown/components/uni-countdown/i18n/en.json

@@ -0,0 +1,6 @@
+{
+	"uni-countdown.day": "day",
+	"uni-countdown.h": "h",
+	"uni-countdown.m": "m",
+	"uni-countdown.s": "s"
+}

+ 8 - 0
uni_modules/uni-countdown/components/uni-countdown/i18n/index.js

@@ -0,0 +1,8 @@
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+	en,
+	'zh-Hans': zhHans,
+	'zh-Hant': zhHant
+}

+ 6 - 0
uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hans.json

@@ -0,0 +1,6 @@
+{
+	"uni-countdown.day": "天",
+	"uni-countdown.h": "时",
+	"uni-countdown.m": "分",
+	"uni-countdown.s": "秒"
+}

+ 6 - 0
uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hant.json

@@ -0,0 +1,6 @@
+{
+	"uni-countdown.day": "天",
+	"uni-countdown.h": "時",
+	"uni-countdown.m": "分",
+	"uni-countdown.s": "秒"
+}

+ 278 - 0
uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue

@@ -0,0 +1,278 @@
+<template>
+	<view class="uni-countdown">
+		<text v-if="showDay" :style="[timeStyle]" class="uni-countdown__number">{{ d }}</text>
+		<text v-if="showDay" :style="[splitorStyle]" class="uni-countdown__splitor">{{dayText}}</text>
+		<text v-if="showHour" :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
+		<text v-if="showHour" :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
+		<text v-if="showMinute" :style="[timeStyle]" class="uni-countdown__number">{{ i }}</text>
+		<text v-if="showMinute" :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</text>
+		<text :style="[timeStyle]" class="uni-countdown__number">{{ s }}</text>
+		<text v-if="!showColon" :style="[splitorStyle]" class="uni-countdown__splitor">{{secondText}}</text>
+	</view>
+</template>
+<script>
+	import {
+		initVueI18n
+	} from '@dcloudio/uni-i18n'
+	import messages from './i18n/index.js'
+	const {
+		t
+	} = initVueI18n(messages)
+	/**
+	 * Countdown 倒计时
+	 * @description 倒计时组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=25
+	 * @property {String} backgroundColor 背景色
+	 * @property {String} color 文字颜色
+	 * @property {Number} day 天数
+	 * @property {Number} hour 小时
+	 * @property {Number} minute 分钟
+	 * @property {Number} second 秒
+	 * @property {Number} timestamp 时间戳
+	 * @property {Boolean} showDay = [true|false] 是否显示天数
+	 * @property {Boolean} showHour = [true|false] 是否显示小时
+	 * @property {Boolean} showMinute = [true|false] 是否显示分钟
+	 * @property {Boolean} show-colon = [true|false] 是否以冒号为分隔符
+	 * @property {String} splitorColor 分割符号颜色
+	 * @event {Function} timeup 倒计时时间到触发事件
+	 * @example <uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
+	 */
+	export default {
+		name: 'UniCountdown',
+		emits: ['timeup'],
+		props: {
+			showDay: {
+				type: Boolean,
+				default: true
+			},
+			showHour: {
+				type: Boolean,
+				default: true
+			},
+			showMinute: {
+				type: Boolean,
+				default: true
+			},
+			showColon: {
+				type: Boolean,
+				default: true
+			},
+			start: {
+				type: Boolean,
+				default: true
+			},
+			backgroundColor: {
+				type: String,
+				default: ''
+			},
+			color: {
+				type: String,
+				default: '#333'
+			},
+			fontSize: {
+				type: Number,
+				default: 14
+			},
+			splitorColor: {
+				type: String,
+				default: '#333'
+			},
+			day: {
+				type: Number,
+				default: 0
+			},
+			hour: {
+				type: Number,
+				default: 0
+			},
+			minute: {
+				type: Number,
+				default: 0
+			},
+			second: {
+				type: Number,
+				default: 0
+			},
+			timestamp: {
+				type: Number,
+				default: 0
+			},
+			filterShow : {
+				type:Object,
+				default () {
+					return {}
+				}
+			}
+		},
+		data() {
+			return {
+				timer: null,
+				syncFlag: false,
+				d: '00',
+				h: '00',
+				i: '00',
+				s: '00',
+				leftTime: 0,
+				seconds: 0
+			}
+		},
+		computed: {
+			dayText() {
+				return t("uni-countdown.day")
+			},
+			hourText(val) {
+				return t("uni-countdown.h")
+			},
+			minuteText(val) {
+				return t("uni-countdown.m")
+			},
+			secondText(val) {
+				return t("uni-countdown.s")
+			},
+			timeStyle() {
+				const {
+					color,
+					backgroundColor,
+					fontSize
+				} = this
+				return {
+					color,
+					backgroundColor,
+					fontSize: `${fontSize}px`,
+					width: `${fontSize * 22 / 14}px`, // 按字体大小为 14px 时的比例缩放
+ 					lineHeight: `${fontSize * 20 / 14}px`,
+					borderRadius: `${fontSize * 3 / 14}px`,
+				}
+			},
+			splitorStyle() {
+				const { splitorColor, fontSize, backgroundColor } = this
+				return {
+					color: splitorColor,
+					fontSize: `${fontSize * 12 / 14}px`,
+					margin: backgroundColor ? `${fontSize * 4 / 14}px` : ''
+				}
+			}
+		},
+		watch: {
+			day(val) {
+				this.changeFlag()
+			},
+			hour(val) {
+				this.changeFlag()
+			},
+			minute(val) {
+				this.changeFlag()
+			},
+			second(val) {
+				this.changeFlag()
+			},
+			start: {
+				immediate: true,
+				handler(newVal, oldVal) {
+					if (newVal) {
+						this.startData();
+					} else {
+						if (!oldVal) return
+						clearInterval(this.timer)
+					}
+				}
+
+			}
+		},
+		created: function(e) {
+			this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
+			this.countDown()
+		},
+		// #ifndef VUE3
+		destroyed() {
+			clearInterval(this.timer)
+		},
+		// #endif
+		// #ifdef VUE3
+		unmounted() {
+			clearInterval(this.timer)
+		},
+		// #endif
+		methods: {
+			toSeconds(timestamp, day, hours, minutes, seconds) {
+				if (timestamp) {
+					return timestamp - parseInt(new Date().getTime() / 1000, 10)
+				}
+				return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds
+			},
+			timeUp() {
+				clearInterval(this.timer)
+				this.$emit('timeup')
+			},
+			countDown() {
+				let seconds = this.seconds
+				let [day, hour, minute, second] = [0, 0, 0, 0]
+				if (seconds > 0) {
+					day = Math.floor(seconds / (60 * 60 * 24))
+					hour = Math.floor(seconds / (60 * 60)) - (day * 24)
+					minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
+					second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
+				} else {
+					this.timeUp()
+				}
+				this.d  = String(day).padStart(this.validFilterShow(this.filterShow.d), '0')
+				this.h = String(hour).padStart(this.validFilterShow(this.filterShow.h), '0')
+				this.i = String(minute).padStart(this.validFilterShow(this.filterShow.m), '0')
+				this.s = String(second).padStart(this.validFilterShow(this.filterShow.s), '0')
+			},
+			validFilterShow(filter){
+				return (filter && filter > 0) ? filter : 2;
+			},
+			startData() {
+				this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
+				if (this.seconds <= 0) {
+					this.seconds = this.toSeconds(0, 0, 0, 0, 0)
+					this.countDown()
+					return
+				}
+				clearInterval(this.timer)
+				this.countDown()
+				this.timer = setInterval(() => {
+					this.seconds--
+					if (this.seconds < 0) {
+						this.timeUp()
+						return
+					}
+					this.countDown()
+				}, 1000)
+			},
+			update(){
+				this.startData();
+			},
+			changeFlag() {
+				if (!this.syncFlag) {
+					this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
+					this.startData();
+					this.syncFlag = true;
+				}
+			}
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	$font-size: 14px;
+
+	.uni-countdown {
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+		align-items: center;
+
+		&__splitor {
+			margin: 0 2px;
+			font-size: $font-size;
+			color: #333;
+		}
+
+		&__number {
+			border-radius: 3px;
+			text-align: center;
+			font-size: $font-size;
+		}
+	}
+</style>

+ 86 - 0
uni_modules/uni-countdown/package.json

@@ -0,0 +1,86 @@
+{
+  "id": "uni-countdown",
+  "displayName": "uni-countdown 倒计时",
+  "version": "1.2.5",
+  "description": "CountDown 倒计时组件",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "countdown",
+    "倒计时"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": ["uni-scss"],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y",
+        "alipay": "n"
+      },
+      "client": {
+        "App": {
+            "app-vue": "y",
+            "app-nvue": "y",
+            "app-harmony": "u",
+            "app-uvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

+ 10 - 0
uni_modules/uni-countdown/readme.md

@@ -0,0 +1,10 @@
+
+
+## CountDown 倒计时
+> **组件名:uni-countdown**
+> 代码块: `uCountDown`
+
+倒计时组件。
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-countdown)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839