Explorar o código

拼团修改、秒杀修改

chengjunhui hai 1 mes
pai
achega
6308f5cbbc

+ 15 - 0
api/groupbuy.js

@@ -12,3 +12,18 @@ export const activitygoodsGoodsInfo_Api = (id) => uni.$uv.http.get(`/groupbuy/ac
 
 // 查询团的详情信息
 export const activitygoodsGroupbuying_Api = (id) => uni.$uv.http.get(`/groupbuy/activitygoods/groupbuying/${id}`, { });
+
+// 拼团商品中显示,进行中的团
+export const groupbuyingList_Api = (businessId, activityGoodsId) => uni.$uv.http.get(`/groupbuy/team/list/${businessId}/${activityGoodsId}`, { });
+
+// 查询团详情
+export const groupbuyTeamInfo_Api = (teamId) => uni.$uv.http.get(`/groupbuy/team/info/${teamId}`, { });
+
+// 查询我的团订单
+export const groupbuyingTeamMy_Api = (params) => uni.$uv.http.get(`/groupbuy/team/my`, { params });
+
+// 查询我的团订单详情
+export const groupbuyingTeamTeamorder_Api = (memberId) => uni.$uv.http.get(`/groupbuy/team/teamorder/${memberId}`, { });
+
+// 查询团的详情信息
+export const groupbuyActivityInfo_Api = (id) => uni.$uv.http.get(`/groupbuy/activity/info/${id}`, { });

+ 2 - 2
config/global.config.js

@@ -1,8 +1,8 @@
 const CONFIG = {
     staticUrl: 'https://shop.xiaocaituan.com/image', // 所有图片服务器地址 https://shop.xiaocaituan.com/image
 
-    // baseUrl: 'http://192.168.0.152:8300/api', // 后台接、口请求地址
-    baseUrl: 'http://192.168.0.70:8300/api', // 后台接、口请求地址
+    baseUrl: 'http://192.168.0.152:8300/api', // 后台接、口请求地址
+    // baseUrl: 'http://192.168.0.70:8300/api', // 后台接、口请求地址
 		
     // baseUrl: 'https://shop.xiaocaituan.com/hd-api/api', // 正式接口请求地址
     telRegex: /^1[3-9]\d{9}$/, //手机正则

+ 4 - 2
pages.json

@@ -502,7 +502,8 @@
 					"path": "list",
 					"style": {
 						"navigationBarTitleText": "拼团",
-						"enablePullDownRefresh": true
+						"enablePullDownRefresh": true,
+						"navigationStyle": "custom"
 					}
 				},
 				{
@@ -532,7 +533,8 @@
 					"path": "list",
 					"style": {
 						"navigationBarTitleText": "限时秒杀",
-						"enablePullDownRefresh": true
+						"enablePullDownRefresh": true,
+						"navigationStyle": "custom"
 					}
 				},
 				{

+ 3 - 3
pages/distribution/index.vue

@@ -198,7 +198,7 @@ const copy = (code) => {
   .bg {
     width: 100%;
     height: 185rpx;
-    background-color: #00bf5a;
+    background-color: #fa6138;
   }
 
   .userInfo {
@@ -220,7 +220,7 @@ const copy = (code) => {
 
       .font80 {
         font-size: 80rpx;
-        color: #00bf5a;
+        color: #fa6138;
       }
     }
   }
@@ -228,7 +228,7 @@ const copy = (code) => {
   .list-item {
     .bg-E8F9EF {
       background-color: #e8f9ef;
-      color: #00bf5a;
+      color: #fa6138;
       padding: 10rpx;
       width: 50rpx;
       height: 50rpx;

+ 4 - 4
pages/distribution/moneyList.vue

@@ -29,7 +29,7 @@
                 <view class="u-flex" style="align-items: center">
                   <text
                     class="iconfont2 u-font40"
-                    style="padding-top: 2rpx; color: #00bf5a"
+                    style="padding-top: 2rpx; color: #fa6138"
                     >&#xe611;</text
                   >
                   <text class="u-1A1A1A u-font30 u-ml15">{{
@@ -281,14 +281,14 @@ const clickBtn = (index) => {
   }
 
   > .active {
-    color: #00bf5a;
+    color: #fa6138;
 
     &::after {
       display: block;
       width: 100%;
       height: 4rpx;
       content: "";
-      background: #00bf5a;
+      background: #fa6138;
       position: absolute;
       bottom: 0;
       left: 0;
@@ -374,7 +374,7 @@ const clickBtn = (index) => {
   }
 
   .active {
-    background: #00bf5a;
+    background: #fa6138;
     color: #ffffff;
   }
 }

+ 2 - 2
pages/distribution/withdrawTwo.vue

@@ -149,7 +149,7 @@ page {
       opacity: 0.82;
       padding: 10rpx 30rpx;
       background-color: #eed9a9;
-      color: #00bf5a;
+      color: #fa6138;
     }
   }
 }
@@ -188,7 +188,7 @@ page {
   margin-top: 80rpx;
 
   button {
-    background: #00bf5a;
+    background: #fa6138;
     color: #ffffff;
   }
 }

+ 177 - 300
pages/groupBuying/details.vue

@@ -56,7 +56,7 @@
               <view class="p-ab u-flex-center">
                 <view class="triangle-bottomright"></view>
                 <view class="seckill u-text-center u-font28">
-                  <!-- active_state 0:未开始 * 1:进行中 * 2:已结束 -->
+                  <!-- activeState 0:未开始 * 1:进行中 * 2:已结束 -->
                   <view
                     class="u-bold"
                     style="padding: 20rpx"
@@ -111,9 +111,7 @@
                   已售
                   <text class="u-FF0000">{{ dataForm.resultSaleNum }}</text>
                   件,仅剩
-                  <text class="u-FF0000">{{
-                    dataForm.residueStockTotal
-                  }}</text>
+                  <text class="u-FF0000">{{ dataForm.residueStockTotal }}</text>
                 </text>
               </view>
@@ -197,8 +195,7 @@
                       >
                         还差
                         <text class="u-FF0000">{{
-                          item.groupPeopleNum -
-                          item.memberUserInfos.length
+                          item.groupPeopleNum - item.memberUserInfos.length
                         }}</text>
                         人拼成
                       </view>
@@ -221,18 +218,18 @@
           <view class="u-plr30 u-flex-center-sb pt-pb35">
             <view class="u-flex-center" @click="goShop">
               <view>
-                <image class="u-avatar104" :src="shop.logo"></image>
+                <image class="u-avatar104" :src="shop.image"></image>
               </view>
               <view class="u-ml25">
                 <view class="u-font28 u-1A1A1A u-bold">{{
-                  shop.shopName
+                  shop.businessName
                 }}</view>
                 <view class="u-999 u-font24 u-mt5 u-text2">
                   <text
                     class="iconfont"
                     style="color: #fa6138"
                     @click.stop="goLocal"
-                    >&#xe6db;</text
+                    >&#xe990;</text
                   >
                   {{ shop.provinceName }}{{ shop.cityName }}{{ shop.areaName
                   }}{{ shop.address }}
@@ -267,7 +264,7 @@
             <view class="richText ql-editor-box">
               <uv-parse
                 class="custom-parse"
-                :content="goodsInfo.mobileDetail"
+                :content="goodsInfo.content"
               ></uv-parse>
             </view>
           </view>
@@ -295,7 +292,7 @@
         <view class="u-flex-center" v-if="!selectGroup">
           <button
             class="gb-btn btn-bg-dccda4 u-00321E btn-bg-dccda4-48"
-            @click="goProduct(dataForm.goodsId)"
+            @click="goProduct(dataForm.productId)"
           >
             <view>
               <view class="u-font36 u-bold"
@@ -308,7 +305,7 @@
           </button>
 
           <button
-            v-if="dataForm.active_state == 1"
+            v-if="dataForm.activeState == 1"
             class="gb-btn btn-bg-00320E u-DCCDA4 btn-bg-dccda4-482"
             @click="buy(1, dataForm.id)"
           >
@@ -322,7 +319,7 @@
             <view class="u-font22">发起拼团</view>
           </button>
           <button
-            v-if="dataForm.active_state == 0"
+            v-if="dataForm.activeState == 0"
             class="gb-btn btn-bg-00320E u-DCCDA4 btn-bg-dccda4-482"
             @click="notStarted()"
           >
@@ -336,7 +333,7 @@
             <view class="u-font22">发起拼团</view>
           </button>
           <button
-            v-if="dataForm.active_state == 2"
+            v-if="dataForm.activeState == 2"
             class="gb-btn btn-bg-00320E u-DCCDA4 btn-bg-dccda4-482"
             @click="itSover()"
           >
@@ -355,7 +352,7 @@
         <view class="u-flex-center" v-if="selectGroup">
           <button
             class="gb-btn btn-bg-dccda4 u-00321E"
-            @click="goProduct(dataForm.goodsId)"
+            @click="goProduct(dataForm.productId)"
           >
             <view>
               <view class="u-font36 u-bold"
@@ -379,7 +376,7 @@
           </button>
           <button
             class="gb-btn btn-bg-dccda4 u-00321E"
-            @click="goGdProduct(dataForm.goodsId)"
+            @click="goGdProduct(dataForm.productId)"
           >
             <view>
               <view class="u-font36 u-bold"
@@ -395,63 +392,44 @@
     </view>
 
     <!--规格-->
-    <uv-popup type="bottom" ref="specOpenRef" :touchmove="true">
+    <uv-popup mode="bottom" ref="specOpenRef" :touchmove="true" round="30rpx">
       <view class="u-bg-fff spec">
         <view class="u-plr30 flex-sb u-border-one-one pb30">
           <view class="u-flex-center">
-            <image
-              class="u-goods200"
-              :src="choseConfig.coverImage ? choseConfig.coverImage : cover"
-            ></image>
+            <image class="u-goods200" :src="skuObj.cover"></image>
             <view class="u-ml20">
               <view class="u-999 u-font24 price-zhe">
                 <view class="u-FF0000 u-font36"
                   ><rich-text
-                    :nodes="
-                      $mUtil.priceBigSmall(
-                        choseConfig.activityPrice
-                          ? choseConfig.activityPrice
-                          : moPrice
-                      )
-                    "
+                    :nodes="$mUtil.priceBigSmall(skuObj.salePrice)"
                   ></rich-text>
                 </view>
                 <text class="u-del u-ml15"
-                  >¥{{
-                    choseConfig.marketPrice
-                      ? choseConfig.marketPrice
-                      : moDelPrice
-                  }}</text
+                  >¥{{ skuObj.originalSalePrice }}</text
                 >
                 <!-- <text class="u-ml10">{{ dataForm.discount }}折</text> -->
               </view>
               <view class="u-font22 u-999 u-mt5">
-                活动库存 {{ stock }} 件
-                <text class="u-ml30"
-                  >商品库存{{
-                    choseConfig.ableStock
-                      ? choseConfig.ableStock
-                      : goodsTotalStock
-                  }}件</text
-                >
+                活动库存 {{ skuObj.stock }} 件
               </view>
 
-              <view class="u-font22 u-999 u-mt5"
-                ><!-- 商品库存 {{goodsTotalStock}}件 --></view
-              >
+              <view class="u-font22 u-999 u-mt5"></view>
               <view class="u-1A1A1A u-mt25">{{
-                choseConfig.skuSetName ? choseConfig.skuSetName : "请选择"
+                skuObj.skuSetName ? skuObj.skuSetName : "请选择"
               }}</view>
             </view>
           </view>
-          <view class="iconfont u-999 closeIcon" @click="specOpenClose"
+          <!-- <view class="iconfont u-999 closeIcon" @click="specOpenClose"
             >&#xe612;</view
-          >
+          > -->
+          <view class="closeIcon" @click.stop="specOpenClose">
+            <uv-icon name="close-circle" color="#999999" size="36rpx"></uv-icon>
+          </view>
         </view>
 
         <view>
           <view class="content">
-            <scroll-view scroll-y="true">
+            <scroll-view scroll-y style="max-height: 30vh">
               <view class="">
                 <view
                   class="u-mt30 bottom-bor"
@@ -480,19 +458,15 @@
             <view class="u-flex-center-sb">
               <view>购买数量</view>
               <view class="u-flex-center">
-                <view class="iconfont minus" @click="resNum">&#xe60b;</view>
-                <view class="num">{{ addNumber }}</view>
-                <view class="iconfont plus-sign" @click="addNum">&#xe686;</view>
+                <uv-number-box
+                  v-model="addNumber"
+                  disabledInput
+                ></uv-number-box>
               </view>
             </view>
             <view class="specOpen-btn">
-              <view v-if="btnType == 0"
-                ><button class="u-btn-two" @click="btnBuy(btnType)">
-                  立即购买
-                </button></view
-              >
-              <view v-else
-                ><button class="u-btn-two" @click="btnBuy(btnType)">
+              <view
+                ><button class="u-btn-two" @click="btnBuy(1)">
                   立即购买
                 </button></view
               >
@@ -502,7 +476,12 @@
       </view>
     </uv-popup>
     <!--更多拼团-->
-    <uv-popup type="center" backgroundColor="transparent" ref="gbOpenRef">
+    <uv-popup
+      mode="center"
+      backgroundColor="transparent"
+      ref="gbOpenRef"
+      round="30rpx"
+    >
       <view class="iconfont u-text-right u-font40 u-FFF" @click="gbClose"
         >&#xe603;</view
       >
@@ -574,35 +553,35 @@
 <script setup>
 import { ref, reactive, onMounted } from "vue";
 import { onLoad, onShow, onShareAppMessage } from "@dcloudio/uni-app";
+import {
+  activitygoodsGoodsInfo_Api,
+  groupbuyingList_Api,
+  groupbuyTeamInfo_Api,
+  activitygoodsGroupbuying_Api,
+} from "@/api/groupbuy";
+import {
+  getBusinessInfoId_Api,
+  productInfo,
+  shopOrderCommentPage,
+} from "@/api/shop.js";
 import comment from "@/components/ld-comment/ld-comment.vue";
 import jVideo from "@/components/j-video/j-video.vue";
+import utils from "@/util/index.js";
 const gbOpenRef = ref();
 const specOpenRef = ref();
 // 响应式数据
 const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight);
 
 const imglist = ref([]);
-const goodsTotalStock = ref(null);
 const isChecked = ref(0);
 const btnName = ref("");
-const btnType = ref("");
+
 const dataForm = ref({});
 const shop = ref({});
-const shopDiscounts = ref({});
-const stock = ref(0);
-const cover = ref("");
 const loading = ref(true);
-const moDelPrice = ref("");
-const moPrice = ref("");
-const goodsSkuList = ref([]);
 const skuTab = ref([]);
-const goodsId = ref(null);
-const limitBuyNum = ref(0);
-const choseConfig = ref({});
 const hasId = ref("");
 const addNumber = ref(1);
-const goStatus = ref(0);
-const shopId = ref(0);
 const commentList = ref([]);
 const commentListLength = ref(0);
 const goodsInfo = ref({});
@@ -610,13 +589,12 @@ const time1 = ref([0, 0, 0, 0]);
 const time2 = ref([0, 0, 0, 0]);
 const teamlist = ref([]);
 const selectGroup = ref(null);
-const show = ref(false);
 const teamId = ref(null);
-const id = ref(null);
+
+const skuObj = ref({});
 
 // 页面生命周期
 onLoad((options) => {
-  id.value = options.id;
   if (options.id) {
     getDetailInfo(options.id);
   }
@@ -638,9 +616,11 @@ onShareAppMessage((res) => {
   return {
     title: dataForm.value.shareTitle,
     imageUrl: dataForm.value.shareImg,
-    path: `/pages/product/goods/puzzleGoods?id=${dataForm.value.id}&Sshopid=${
-      shopId.value
-    }&teamId=${teamId.value || ""}&share=1&shareId=${user.id || ""}`,
+    path: `/pages/product/goods/puzzleGoods?id=${
+      dataForm.value.id
+    }&SbusinessId=${dataForm.value.businessId}&teamId=${
+      teamId.value || ""
+    }&share=1&shareId=${user.id || ""}`,
   };
 });
 
@@ -666,11 +646,12 @@ const goLocal = () => {
 
 const goShop = () => {
   uni.navigateTo({
-    url: "/pages/convenienceService/shopDetails?shopId=" + shopId.value,
+    url: "/pages/shop/index?businessId=" + dataForm.value.businessId,
   });
 };
 
 const recordSave = (shareUserId, goodsId) => {
+  return;
   globalThis.$http
     .post("/share/record/save", {
       shareUserId: shareUserId,
@@ -686,12 +667,10 @@ const groupGoBuy = () => {
 
 const gogroup = (item) => {
   gbOpenRef.value.close();
-  btnType.value = 1;
-
-  globalThis.$http.get(`/groupbuy/team/info/${item.id}`).then((res) => {
+  groupbuyTeamInfo_Api(item.id).then((res) => {
     if (res && res.code == 200) {
-      time2.value = uni.$uv
-        .countDown(Math.floor(res.data.count_down_end_time))
+      time2.value = utils
+        .countDown(Math.floor(res.data.countDownEndTime))
         .split(":")
         .map((val) => Number(val));
       console.log(time2.value, 123);
@@ -702,118 +681,102 @@ const gogroup = (item) => {
 };
 
 const goGdProduct = () => {
-  checkSku(selectGroup.value.group_buy_goodsId);
+  // checkSku(selectGroup.value.groupBuyGoodsId);
+  specOpenRef.value.open();
 };
 
 const overDown2 = () => {
   getTeam();
 };
 
-const getIndexList = (shopid) => {
-  globalThis.$http.get("/yxt/shop/info/" + shopid).then((res) => {
-    uni.stopPullDownRefresh();
-    loading.value = false;
-    if (res.data && res.code == 200) {
-      shop.value = res.data;
-    }
-  });
-};
-
-const getByShop = (id) => {
-  globalThis.$http.get("/marketing/firstOrder/getByShop/" + id).then((res) => {
-    if (res && res.code == 200) {
-      shopDiscounts.value = res.data;
+// 获取店铺信息
+const getIndexList = (businessId) => {
+  getBusinessInfoId_Api(businessId).then((ret) => {
+    if (ret.data && ret.code == 200) {
+      shop.value = ret.data;
     }
   });
 };
 
 const getTeam = () => {
-  globalThis.$http
-    .get(`/groupbuy/team/list/${shopId.value}/${dataForm.value.id}`)
-    .then((res) => {
+  // console.log(dataForm.value.businessId, dataForm.value.id);
+  if (!dataForm.value.businessId || !dataForm.value.id) return;
+  groupbuyingList_Api(dataForm.value.businessId, dataForm.value.id).then(
+    (res) => {
       if (res && res.code == 200) {
-        res.list.forEach((val) => {
-          val.time = uni.$uv
-            .countDown(Math.floor(val.end_time / 1000))
+        res.data = res.data.map((val) => {
+          val.time = utils
+            .countDown(val.endTime)
             .split(":")
             .map((val) => Number(val));
+          return val;
         });
-        teamlist.value = res.list;
+        teamlist.value = res.data;
         if (teamId.value) {
-          btnType.value = 1;
-          selectGroup.value = teamlist.value.filter(
-            (val) => val.id == teamId.value
-          )[0];
+          selectGroup.value = res.data.find((val) => val.id == teamId.value);
           console.log("团队信息2" + JSON.stringify(selectGroup.value));
-          time2.value = uni.$uv
-            .countDown(Math.floor(selectGroup.value.end_time / 1000))
+          time2.value = utils
+            .countDown(selectGroup.value.endTime)
             .split(":")
             .map((val) => Number(val));
         }
       }
-    });
+    }
+  );
 };
 
 const getDetailInfo = (id) => {
-  globalThis.$http
-    .get("/groupbuy/activitygoods/goodsInfo/" + id)
-    .then((res) => {
-      loading.value = false;
-
-      if (res && res.code == 200) {
-        dataForm.value = res.data;
-        shopId.value = res.data.shopId;
-        imglist.value = res.data.cover.split(",");
-        getByShop(shopId.value);
-        getIndexList(shopId.value);
-
-        if (res.data.active_state == 0) {
-          time1.value = uni.$uv
-            .countDown(res.data.activity_start_time)
-            .split(":")
-            .map((val) => Number(val));
-        } else {
-          time1.value = uni.$uv
-            .countDown(res.data.finish_time)
-            .split(":")
-            .map((val) => Number(val));
-        }
-
-        globalThis.$http
-          .get(`/goods/content/${dataForm.value.goodsId}`)
-          .then((res) => {
-            if (res && res.code == 200) {
-              goodsInfo.value = res.data;
-              globalThis.$http
-                .get("/marketing/firstOrder/getByShop/" + shopId.value)
-                .then((res) => {
-                  if (res && res.code == 200) {
-                    shopDiscounts.value = res.data;
-                  }
-                });
-            }
-          });
+  activitygoodsGoodsInfo_Api(id).then((res) => {
+    loading.value = false;
+    if (res && res.code == 200) {
+      dataForm.value = res.data;
+      dataForm.value.businessId = res.data.businessId;
+      getIndexList(dataForm.value.businessId);
+      if (res.data.activeState == 0) {
+        time1.value = utils
+          .countDown(res.data.startTime)
+          .split(":")
+          .map((val) => Number(val));
+      } else {
+        time1.value = utils
+          .countDown(res.data.finishTime)
+          .split(":")
+          .map((val) => Number(val));
+      }
 
-        globalThis.$http
-          .get(
-            `/comment/orderGoods/getgoodscomments/${dataForm.value.goodsId}`
-          )
-          .then((res) => {
-            if (res && res.code == 200) {
-              commentList.value = res.list;
-              commentListLength.value =
-                res.list && res.list.length ? res.list.length : 0;
+      productInfo(dataForm.value.productId).then((ret) => {
+        if (ret && ret.code == 200) {
+          goodsInfo.value = ret.data;
+          imglist.value = ret.data.images;
+          skuTab.value = ret.data.skuTable.map((item) => {
+            if (item.values) {
+              item.values[0].flag = true;
             }
+            return item;
           });
+        }
+      });
+
+      shopOrderCommentPage({
+        productId: dataForm.value.productId,
+        pageNum: 1,
+        pageSize: 10,
+      }).then((ret) => {
+        if (ret && ret.code == 200) {
+          commentList.value = ret.rows;
+          commentListLength.value = ret.total;
+          // console.log(commentListLength.value);
+        }
+      });
 
-        getTeam();
-      }
-    });
+      getTeam();
+    }
+  });
 };
 
 const goProduct = (id) => {
   uni.navigateTo({
-    url: "./goods?id=" + id,
+    url: "/pages/shop/goodsDetails?id=" + id,
   });
 };
 
@@ -830,33 +793,21 @@ const change = (i) => {
 };
 
 const buy = (i, id) => {
-  btnType.value = i;
   selectGroup.value = null;
-  checkSku(id);
-  if (i == 0) {
-    btnName.value = "加入购物车";
-  } else {
-    btnName.value = "立即购买";
-  }
-};
-
-const resNum = () => {
-  if (addNumber.value > 1) {
-    addNumber.value--;
-  }
-};
-
-const addNum = () => {
-  addNumber.value++;
+  chonseSku();
+  btnName.value = "立即购买";
+  specOpenRef.value.open();
 };
 
 const chonseSku = (index, id) => {
-  skuTab.value[index].values.forEach((res) => {
-    res.flag = false;
-    if (res.id == id) {
-      res.flag = true;
-    }
-  });
+  if (index != null) {
+    skuTab.value[index].values.forEach((res) => {
+      res.flag = false;
+      if (res.id == id) {
+        res.flag = true;
+      }
+    });
+  }
   let choseId = [];
   skuTab.value.forEach((res) => {
     res.values.forEach((Key) => {
@@ -865,116 +816,49 @@ const chonseSku = (index, id) => {
       }
     });
   });
-  let totalId = choseId.sort((a, b) => a - b).join("|");
+  let totalId = choseId.sort((a, b) => a - b).join("_");
+  totalId = "_" + totalId + "_";
   hasId.value = totalId;
-  goodsSkuList.value.forEach((res) => {
-    let temp = res.sku_hash_code;
-    let sku_hash_code_val = temp
-      .split("|")
-      .sort((a, b) => a - b)
-      .join("|");
-    if (sku_hash_code_val == totalId) {
-      choseConfig.value = res;
-      stock.value = dataForm.value.real_stock_total;
-      // able_stock should be defined
-    }
-  });
-};
-
-const checkSku = (id) => {
-  globalThis.$http
-    .get(`/groupbuy/activitygoods/skus/${dataForm.value.id}`)
-    .then((res) => {
-      loading.value = false;
-      if (res && res.code == 200) {
-        choseConfig.value = {};
-        hasId.value = "";
-        goodsTotalStock.value = res.data.goodsTotalStock;
-
-        res.data.goods.sku_table.forEach((keys) => {
-          keys.values.forEach((val) => {
-            val.flag = false;
-          });
-        });
-
-        limitBuyNum.value = dataForm.value.limitBuyNum;
-        goodsId.value = dataForm.value.goodsId;
-        goodsSkuList.value = res.data.goods_sku_list;
-        moPrice.value = dataForm.value.min_price;
-        moDelPrice.value = dataForm.value.min_sale_price;
-        cover.value = imglist.value[0];
-        stock.value = dataForm.value.real_stock_total;
-
-        if (res.data.goods_auth) {
-          if (res.data.goods_auth.added) {
-            specOpenRef.value.open();
-          } else {
-            uni.$uv.toast("该商品已经下架");
-          }
-        } else {
-          uni.$uv.toast("没有经营权限");
-        }
-
-        if (skuTab.value.length == 0) {
-          skuTab.value = res.data.goods.sku_table;
-          for (let i in skuTab.value) {
-            skuTab.value[i].values[0].flag = true;
-          }
-        }
-        chonseSku(0, skuTab.value[0].values[0].id);
+  if (goodsInfo.value.singleSku) {
+    if(dataForm.value.productSkuSetList.length>0) skuObj.value = dataForm.value.productSkuSetList[0];
+  } else {
+    dataForm.value.productSkuSetList.forEach((res) => {
+      if (res.skuHashCode == totalId) {
+        skuObj.value = res;
       }
     });
+  }
 };
 
+
 const specOpenClose = () => {
   specOpenRef.value.close();
 };
 
 const btnBuys = () => {
-  if (skuTab.value.length > 0 && hasId.value == "") {
-    uni.$uv.toast("请选中sku");
+  if (!skuObj.value.id && hasId.value == "") {
+    uni.$uv.toast("请选中 sku");
     return false;
   }
 
-  if (addNumber.value > limitBuyNum.value && limitBuyNum.value != 0) {
-    uni.$uv.toast("商品限购" + limitBuyNum.value + "件");
+  if (
+    Number(addNumber.value) > dataForm.value.limitBuyNum &&
+    dataForm.value.limitBuyNum != 0
+  ) {
+    uni.$uv.toast("商品限购" + dataForm.value.limitBuyNum + "件");
     return false;
   }
 
   //判断库存
-  if (goodsSkuList.value.length > 0 && stock.value < addNumber.value) {
-    uni.$uv.toast("商品库存只有" + stock.value + "件");
-    globalThis.$http
-      .post(`/singlegoods/understockrecord/save`, {
-        shopId: shopId.value,
-        goodsId: goodsId.value,
-        single_goodsId: choseConfig.value.single_goodsId,
-        sku_set_name: choseConfig.value.sku_set_name,
-        buy_num: addNumber.value,
-      })
-      .then((res) => {});
+  if (
+    dataForm.value.productSkuSetList.length > 0 &&
+    Number(skuObj.value.stock) < Number(addNumber.value)
+  ) {
+    uni.$uv.toast("商品库存只有" + skuObj.value.stock + "件");
     return false;
   }
 
-  if (goStatus.value == 0) {
-    let data = {
-      goodsId: goodsId.value,
-      sku_hash_code: choseConfig.value.sku_hash_code,
-      addNumber: addNumber.value,
-      source_shopId: shopId.value.toString(),
-    };
-    globalThis.$http.post(`/cart/add`, data).then((res) => {
-      if (res && res.code == 200) {
-        uni.$uv.toast("添加成功");
-        show.value = false;
-        choseConfig.value = {};
-        addNumber.value = 1;
-        // cartList();
-      }
-    });
-  } else {
-    psotJson();
-  }
+  // psotJson();
 };
 
 const psotJson = () => {
@@ -983,28 +867,28 @@ const psotJson = () => {
   let parendArr = [];
 
   childArr.push({
-    user_cart_id: 0,
-    activity_goodsId: choseConfig.value.activity_goodsId,
-    goodsId: goodsId.value,
+    userCartId: 0,
+    activityGoodsId: skuObj.value.activityGoodsId,
+    productId: dataForm.value.productId,
     num: addNumber.value,
-    sku_hash_code: choseConfig.value.sku_hash_code,
+    skuHashCode: skuObj.value.skuHashCode,
   });
 
   parendArr.push({
-    shopId: shop.value.id,
-    source_shopId: shop.value.id,
-    activity_id: dataForm.value.group_buy_id,
-    sponsor_activity_id: selectGroup.value ? selectGroup.value.id : 0,
-    user_remark: "",
+    businessId: dataForm.value.businessId,
+    sourceShopId: shop.value.id,
+    activityId: dataForm.value.groupBuyId,
+    sponsorActivityId: selectGroup.value ? selectGroup.value.id : 0,
+    userRemark: "",
     items: childArr,
   });
 
   dataJson = {
-    is_cart: false,
-    receipt_id: null,
-    shipment_mode: 0,
-    shop_orders: parendArr,
-    marketing_type: 2,
+    isCart: false,
+    receiptId: null,
+    shipmentMode: 0,
+    shopOrders: parendArr,
+    marketingType: 2,
   };
 
   uni.setStorageSync("dataJson", dataJson);
@@ -1014,14 +898,7 @@ const psotJson = () => {
 };
 
 const btnBuy = (i) => {
-  goStatus.value = i;
-  let token = uni.getStorageSync("apiToken");
-  if (!token) {
-    uni.navigateTo({
-      url: "/pages/login/index",
-    });
-  } else {
-    // $u.throttle(btnBuys, 500);
+  if (!utils.isLoginTo(true)) {
     btnBuys();
   }
 };
@@ -1338,7 +1215,7 @@ page {
 .spec {
   border-radius: 18rpx 18rpx 0rpx 0rpx;
   padding-top: 30rpx;
-  max-height: 900rpx;
+  // max-height: 900rpx;
   overflow-y: auto;
 
   // position: fixed;

+ 4 - 3
pages/groupBuying/list.vue

@@ -1,5 +1,6 @@
 <template>
   <view class="group-list">
+    <uv-navbar title="拼团" autoBack bgColor="#fa6138" placeholder leftIconColor="#ffffff" titleStyle="color: #ffffff"></uv-navbar>
     <view class="today">
       <view class="today-item">
         <view class="today-left"> 今日必拼 </view>
@@ -17,7 +18,7 @@
         v-for="(item, index) in groupList"
         :key="index"
         @click="
-          goProductDetails('/pages/product/goods/puzzleGoods?id=' + item.id)
+          goProductDetails('/pages/groupBuying/details?id=' + item.id)
         "
       >
         <view class="commodity-item">
@@ -68,7 +69,7 @@
           v-for="(item, index) in RowsList"
           :key="index"
           @click="
-            goProductDetails('/pages/product/goods/puzzleGoods?id=' + item.id)
+            goProductDetails('/pages/groupBuying/details?id=' + item.id)
           "
         >
           <view class="image">
@@ -153,7 +154,7 @@ const getGroup = () => {
     page: 1,
   }).then((res) => {
     if (res && res.code == 200) {
-      groupList.value = res.list;
+      groupList.value = res.data || [];
     }
   });
 };

+ 1 - 1
pages/index/index.vue

@@ -337,7 +337,7 @@ onLoad(() => {
 
           .gooods_item_r_price {
             font-size: 36rpx;
-            color: #00bf5a;
+            color: #fa6138;
             font-weight: 600;
 
             text {

+ 32 - 30
pages/seckill/list.vue

@@ -1,5 +1,6 @@
 <template>
   <view class="time-limit">
+    <uv-navbar title="限时秒杀" autoBack bgColor="#fa6138" placeholder leftIconColor="#ffffff" titleStyle="color: #ffffff"></uv-navbar>
     <view class="top">
       <view class="box">
         <scroll-view scroll-x="true">
@@ -39,7 +40,10 @@
         <view class="transverse"> </view>
         <view class="surplus-content" v-if="activeState == 1">
           <view class="lable"> 本场剩余 </view>
-          <uv-count-down :time="remainingTime" format="HH:mm:ss"></uv-count-down>
+          <uv-count-down
+            :time="remainingTime"
+            format="HH:mm:ss"
+          ></uv-count-down>
         </view>
         <view class="surplus-content" v-if="activeState == 0">
           <view class="lable">即将开始</view>
@@ -62,9 +66,7 @@
         class="commodity-item"
         v-for="(item, key) in goodList"
         :key="item.id"
-        @click="
-          goProductDetails('/pages/seckill/seckillGoods?id=' + item.id)
-        "
+        @click="goProductDetails('/pages/seckill/seckillGoods?id=' + item.id)"
       >
         <view
           :class="[activeBannerIndex == key ? 'active-back' : 'swiper-back']"
@@ -132,9 +134,7 @@
           class="item"
           v-for="(item, index) in goodList"
           :key="index"
-          @click="
-            goProductDetails('/pages/seckill/seckillGoods?id=' + item.id)
-          "
+          @click="goProductDetails('/pages/seckill/seckillGoods?id=' + item.id)"
         >
           <view class="item-left">
             <!-- ?x-oss-process=style/w_350 -->
@@ -337,8 +337,10 @@ onPullDownRefresh(() => {
 
 // 上拉加载
 onReachBottom(() => {
-  page.value++;
-  getList();
+  if (status.value != "noMore") {
+    page.value++;
+    getList();
+  }
 });
 </script>
 <style>
@@ -378,20 +380,20 @@ page {
       width: 153rpx;
       height: 10rpx;
       border-radius: 6rpx;
-      border: 2rpx solid #00bf5a;
+      border: 2rpx solid #fa6138;
       margin-right: 10rpx;
 
       .orange {
         width: 50rpx;
         height: 10rpx;
         border-radius: 5rpx;
-        background-color: #00bf5a;
+        background-color: #fa6138;
       }
     }
 
     .complete {
       font-size: 20rpx;
-      color: #00bf5a;
+      color: #fa6138;
       line-height: 24rpx;
       font-weight: 500;
     }
@@ -431,7 +433,7 @@ page {
 
     .large {
       font-size: 36rpx;
-      color: #00bf5a;
+      color: #fa6138;
       font-weight: bold;
 
       text {
@@ -519,7 +521,7 @@ page {
       color: #333333;
 
       text {
-        color: #00bf5a;
+        color: #fa6138;
       }
     }
 
@@ -534,18 +536,18 @@ page {
       .zero {
         margin-left: 20rpx;
         font-size: 22rpx;
-        color: #00bf5a;
+        color: #fa6138;
         font-weight: 500;
       }
 
       .one {
-        color: #00bf5a;
+        color: #fa6138;
         font-size: 34rpx;
         font-weight: 700;
       }
 
       .two {
-        color: #00bf5a;
+        color: #fa6138;
         font-size: 18rpx;
         font-weight: 700;
       }
@@ -567,7 +569,7 @@ page {
   }
 
   .active {
-    background-color: #00bf5a;
+    background-color: #fa6138;
     width: 35rpx;
     height: 14rpx;
     border-radius: 7rpx;
@@ -624,7 +626,7 @@ page {
 
           .large {
             font-size: 36rpx;
-            color: #00bf5a;
+            color: #fa6138;
             font-weight: Bold;
             margin-right: 17rpx;
 
@@ -646,7 +648,7 @@ page {
           font-size: 28rpx;
           font-weight: 500;
           padding: 12rpx 34rpx;
-          background-color: #00bf5a;
+          background-color: #fa6138;
           border-radius: 32rpx;
         }
       }
@@ -659,21 +661,21 @@ page {
         .soon-item {
           width: 153rpx;
           height: 10rpx;
-          border: 2rpx solid #00bf5a;
+          border: 2rpx solid #fa6138;
           border-radius: 6rpx;
           margin-right: 10rpx;
 
           .orange {
             width: 50rpx;
             height: 10rpx;
-            background-color: #00bf5a;
+            background-color: #fa6138;
             border-radius: 5rpx;
           }
         }
 
         .complete {
           font-size: 20rpx;
-          color: #00bf5a;
+          color: #fa6138;
           font-weight: 500;
         }
       }
@@ -689,7 +691,7 @@ page {
   .spot-item {
     width: 35rpx;
     height: 14rpx;
-    background-color: #00bf5a;
+    background-color: #fa6138;
     margin-right: 16rpx;
   }
 
@@ -724,7 +726,7 @@ page {
 
     .two-large {
       font-size: 20rpx;
-      color: #00bf5a;
+      color: #fa6138;
       font-weight: bold;
 
       text {
@@ -764,20 +766,20 @@ page {
     width: 153rpx;
     height: 10rpx;
     border-radius: 6rpx;
-    border: 1rpx solid #00bf5a;
+    border: 1rpx solid #fa6138;
     margin-right: 10rpx;
 
     .two-orange {
       width: 50rpx;
       height: 10rpx;
       border-radius: 5rpx;
-      background-color: #00bf5a;
+      background-color: #fa6138;
     }
   }
 
   .two-complete {
     font-size: 20rpx;
-    color: #00bf5a;
+    color: #fa6138;
     line-height: 24rpx;
     font-weight: 500;
   }
@@ -831,7 +833,7 @@ page {
 
     text,
     &:deep(.uv-count-down__text) {
-      color: #00bf5a;
+      color: #fa6138;
       padding: 1rpx 4rpx;
       background-color: #dccda4;
       border-radius: 4rpx;
@@ -857,7 +859,7 @@ page {
 }
 
 .top {
-  background-color: #00bf5a;
+  background-color: #fa6138;
 
   .box {
     padding: 0 30rpx;

+ 48 - 42
pages/seckill/seckillGoods.vue

@@ -1,6 +1,5 @@
 <template>
   <view class="container">
-    <navbar :config="config" backColor="#666"></navbar>
     <view id="page-top">
       <view class="product">
         <view class="u-bg-fff pb40">
@@ -104,7 +103,7 @@
                 <view class="u-999 u-font24 u-mt5 u-text2">
                   <text
                     class="iconfont"
-                    style="color: #00bf5a"
+                    style="color: #fa6138"
                     @click.stop="goLocal"
                     >&#xe990;</text
                   >
@@ -206,7 +205,7 @@
               <view class="u-999 u-font24 u-flex-center">
                 <view class="u-00BF5A u-font36">
                   <rich-text
-                    :nodes="$mUtil.priceBigSmall(skuObj.marketPrice || 0)"
+                    :nodes="$mUtil.priceBigSmall(skuObj.salePrice || 0)"
                   ></rich-text>
                 </view>
 
@@ -231,33 +230,38 @@
         </view>
 
         <view>
-          <view class="">
-            <view
-              class="u-mt30"
-              v-for="(item, index) in skuTab"
-              :key="item.head.id"
-            >
-              <view class="u-plr30">{{ item.head.name }}</view>
-              <view class="u-mt20 u-border-one-one pb30">
-                <view class="u-plr30 u-flex u-flex-warp">
-                  <view
-                    class="spec-item"
-                    :class="childrenItem.flag ? 'activeColor' : ''"
-                    @click="chonseSku(index, childrenItem.id)"
-                    v-for="childrenItem in item.values"
-                    :key="childrenItem.id"
-                    >{{ childrenItem.name }}</view
-                  >
+          <scroll-view scroll-y style="max-height: 30vh">
+            <view class="">
+              <view
+                class="u-mt30"
+                v-for="(item, index) in skuTab"
+                :key="item.head.id"
+              >
+                <view class="u-plr30">{{ item.head.name }}</view>
+                <view class="u-mt20 u-border-one-one pb30">
+                  <view class="u-plr30 u-flex u-flex-warp">
+                    <view
+                      class="spec-item"
+                      :class="childrenItem.flag ? 'activeColor' : ''"
+                      @click="chonseSku(index, childrenItem.id)"
+                      v-for="childrenItem in item.values"
+                      :key="childrenItem.id"
+                      >{{ childrenItem.name }}</view
+                    >
+                  </view>
                 </view>
               </view>
             </view>
-          </view>
+          </scroll-view>
 
           <view class="u-plr30 u-mt30">
             <view class="u-flex-center-sb">
               <view>购买数量</view>
               <view class="u-flex-center">
-                <uv-number-box v-model="addNumber" disabledInput></uv-number-box>
+                <uv-number-box
+                  v-model="addNumber"
+                  disabledInput
+                ></uv-number-box>
               </view>
             </view>
             <view class="specOpen-btn">
@@ -364,18 +368,16 @@ const goLocal = () => {
 
 const goShop = () => {
   uni.navigateTo({
-    url:
-      "/pages/convenienceService/shopDetails?businessId=" +
-      dataForm.value.businessId,
+    url: "/pages/shop/index?businessId=" + dataForm.value.businessId,
   });
 };
 
-const recordSave = (shareUserId, productI) => {
+const recordSave = (shareUserId, productId) => {
   return;
   $http
     .post("/share/record/save", {
       shareUserId: shareUserId,
-      productI: productI,
+      productId: productId,
     })
     .then((res) => {});
 };
@@ -385,7 +387,6 @@ const getDetailInfo = (id) => {
     loading.value = false;
     if (res && res.code == 200) {
       dataForm.value = res.data;
-      imglist.value = res.data.coverImage.split(",");
 
       if (res.data.activeTimeState == 1) {
         remainingTime.value = res.data.finishTime * 1000 - new Date().getTime();
@@ -394,6 +395,7 @@ const getDetailInfo = (id) => {
       productInfo(dataForm.value.productId).then((ret) => {
         if (ret && ret.code == 200) {
           productObj.value = ret.data;
+          imglist.value = ret.data.images;
           skuTab.value = ret.data.skuTable.map((item) => {
             if (item.values) {
               item.values[0].flag = true;
@@ -456,11 +458,15 @@ const chonseSku = (index, id) => {
   let totalId = choseId.sort((a, b) => a - b).join("_");
   totalId = "_" + totalId + "_";
   hasId.value = totalId;
-  dataForm.value.productSkuSetList.forEach((res) => {
-    if (res.skuHashCode == totalId) {
-      skuObj.value = res;
-    }
-  });
+  if (productObj.value.singleSku) {
+    if(dataForm.value.productSkuSetList.length>0) skuObj.value = dataForm.value.productSkuSetList[0];
+  } else {
+    dataForm.value.productSkuSetList.forEach((res) => {
+      if (res.skuHashCode == totalId) {
+        skuObj.value = res;
+      }
+    });
+  }
 };
 
 const btnBuys = () => {
@@ -495,7 +501,7 @@ const psotJson = () => {
   childArr.push({
     userCartId: 0,
     activityGoodsId: skuObj.value.activityGoodsId,
-    productI: dataForm.value.productI,
+    productId: dataForm.value.productId,
     num: addNumber.value,
     skuHashCode: skuObj.value.skuHashCode,
   });
@@ -590,7 +596,7 @@ const btnBuy = (i) => {
 }
 
 .br-FF0000 {
-  border: 1rpx solid #00bf5a;
+  border: 1rpx solid #fa6138;
   border-radius: 24rpx;
   padding: 6rpx 12rpx;
 }
@@ -637,7 +643,7 @@ const btnBuy = (i) => {
     // position: absolute;
     top: 460rpx;
     // background: linear-gradient(90deg,#20a733, #0a824b);
-    background: #00bf5a;
+    background: #fa6138;
     border-radius: 20rpx 20rpx 0px 0px;
     position: relative;
     top: -16rpx;
@@ -677,7 +683,7 @@ const btnBuy = (i) => {
 
 .seckill {
   background-color: #dccda4;
-  color: #00bf5a;
+  color: #fa6138;
   padding: 12rpx 15rpx;
   box-sizing: border-box;
   border-radius: 5rpx 20rpx 0px 0px;
@@ -735,13 +741,13 @@ const btnBuy = (i) => {
       transform: translateX(-50%);
       width: 0;
       height: 2px;
-      background: #00bf5a;
+      background: #fa6138;
       transition: all 0.3s;
     }
 
     &.active {
       font-size: 30rpx;
-      color: #00bf5a;
+      color: #fa6138;
       font-weight: 700;
 
       &::before {
@@ -797,7 +803,7 @@ const btnBuy = (i) => {
 .spec {
   border-radius: 18rpx 18rpx 0rpx 0rpx;
   padding-top: 30rpx;
-  max-height: 900rpx;
+  // max-height: 900rpx;
   overflow-y: auto;
 
   .spec-item {
@@ -813,7 +819,7 @@ const btnBuy = (i) => {
   .activeColor {
     background-color: #e1e6e3;
     border: 1px solid #3775f6;
-    color: #00bf5a;
+    color: #fa6138;
     border-radius: 4px;
   }
 
@@ -854,7 +860,7 @@ const btnBuy = (i) => {
     padding-bottom: 34rpx;
 
     button {
-      background-color: #00bf5a;
+      background-color: #fa6138;
       color: #ffffff;
     }
   }

+ 31 - 8
pages/shop/components/GroupBuyingGood.vue

@@ -4,12 +4,12 @@
       <view class="group_title_l">拼团购</view>
       <view
         class="group_title_r"
-        @click="goProductDetails('/pages/research/homepage/groupList')"
+        @click="goProductDetails('/pages/groupBuying/list')"
       >
         查看更多
         <!-- <text class="iconfont">&#xe65f;</text> -->
-        <view style="display: inline-block;">
-            <uv-icon name="arrow-right" color="#333333" size="26rpx"></uv-icon>
+        <view style="display: inline-block">
+          <uv-icon name="arrow-right" color="#333333" size="26rpx"></uv-icon>
         </view>
       </view>
     </view>
@@ -20,7 +20,7 @@
         v-for="(item, index) in groupList"
         :key="index"
         @click="
-          goProductDetails('/pages/product/goods/puzzleGoods?id=' + item.id)
+          goProductDetails('/pages/groupBuying/details?id=' + item.id)
         "
       >
         <view class="goods_item_img">
@@ -57,7 +57,14 @@
 </template>
 
 <script setup>
-import { ref, watch } from "vue";
+import { ref, onMounted } from "vue";
+import { activitygoodswillYouSpell_Api } from "@/api/groupbuy.js";
+const props = defineProps({
+  businessId: {
+    type: [Number, String],
+    default: "",
+  },
+});
 
 const groupList = ref([]);
 
@@ -66,8 +73,24 @@ const goProductDetails = (url) => {
     url: url,
   });
 };
-</script>
 
+const activitygoodswillYouSpell = () => {
+  activitygoodswillYouSpell_Api({
+    businessId: props.businessId,
+    limit: 10,
+  }).then((res) => {
+    groupList.value = res.data || [];
+  });
+};
+
+onMounted(() => {
+  activitygoodswillYouSpell();
+});
+
+defineExpose({
+  init: activitygoodswillYouSpell,
+});
+</script>
 <style lang="scss" scoped>
 .groupCard {
   margin: auto;
@@ -173,7 +196,7 @@ const goProductDetails = (url) => {
               display: flex;
               align-items: flex-end;
               font-size: 20rpx;
-              color: #00bf5a;
+              color: #fa6138;
 
               text {
                 font-size: 36rpx;
@@ -204,7 +227,7 @@ const goProductDetails = (url) => {
           .goods_item_data_box_r {
             width: 138rpx;
             height: 63rpx;
-            background: #00bf5a;
+            background: #fa6138;
             border-radius: 32rpx;
             font-size: 28rpx;
             display: flex;

+ 51 - 23
pages/shop/components/SeckillGood.vue

@@ -4,13 +4,14 @@
       <view class="limitCard_top_title">限时秒杀</view>
       <view class="limitCard_top_lab">{{ currTime }}点场 剩余</view>
       <!-- <view class="limitCard_top_time">3天 17 : 26 : 35</view> -->
-      <view class="limitCard_top_time">
+      <view class="limitCard_top_time" v-if="finishTime">
         <uv-count-down
-          :time="9 * 60 * 1000"
+          :time="finishTime"
           format="DD:HH:mm:ss"
           autoStart
           millisecond
           @change="onChange"
+          @finish="onFinish"
         >
           <view class="time">
             <text class="time__item" v-if="timeData.days"
@@ -21,7 +22,13 @@
                 timeData.hours > 10 ? timeData.hours : "0" + timeData.hours
               }}:</text
             >
-            <text class="time__item">{{ timeData.minutes > 10 ? timeData.minutes : "0" + timeData.minutes }}:</text>
+            <text class="time__item"
+              >{{
+                timeData.minutes > 10
+                  ? timeData.minutes
+                  : "0" + timeData.minutes
+              }}:</text
+            >
             <text class="time__item">{{ timeData.seconds }}</text>
           </view>
         </uv-count-down>
@@ -43,11 +50,9 @@
             class="listBox_item"
             v-for="itemSon in item"
             @click="
-              goProductDetails(
-                '/pages/product/goods/seckillGoods?id=' + itemSon.id
-              )
+              goProductDetails('/pages/seckill/seckillGoods?id=' + itemSon.id)
             "
-            :key="item.id"
+            :key="itemSon.id"
           >
             <!-- ?x-oss-process=style/w_350 -->
             <image
@@ -70,30 +75,27 @@
 </template>
 
 <script setup>
-import { ref, watch } from "vue";
+import { ref, onMounted } from "vue";
+import { seckillActivityProductFlash_Api } from "@/api/seckill.js";
 const props = defineProps({
-  currSeckill: {
-    type: Array,
-    default: () => [],
+  businessId: {
+    type: [Number, String],
+    default: "",
   },
 });
-
 const currSeckill = ref([]);
-const currTime = ref(7);
+const currTime = ref(0);
 const timeData = ref({});
-
-// // 监听限时秒杀数据
-// watch(
-//   () => props.currSeckill,
-//   (newValue) => {
-//     currSeckill.value = oneArrToTwoArr(newValue || []);
-//   }
-// );
+const finishTime = ref(0);
 
 const onChange = (e) => {
   timeData.value = e;
 };
 
+const onFinish = () => {
+  seckillActivityProductFlash();
+};
+
 // 一维数组转二维数组
 const oneArrToTwoArr = (data) => {
   let newData = [];
@@ -113,17 +115,43 @@ const oneArrToTwoArr = (data) => {
   return newData;
 };
 
+const seckillActivityProductFlash = () => {
+  seckillActivityProductFlash_Api({
+    businessId: props.businessId,
+    limit: 10,
+  }).then((res) => {
+    // console.log(res);
+    if (res.code == 200) {
+      currSeckill.value = oneArrToTwoArr(res.data.list || []);
+      currTime.value = res.data.startHour;
+      // finishTime.value = res.data.finishTime;
+      if (res.data.finishTime) {
+        finishTime.value = res.data.finishTime - new Date().getTime();
+      }else{
+        finishTime.value = 0;
+      }
+    }
+  });
+};
 const goProductDetails = (url) => {
   uni.navigateTo({
     url,
   });
 };
+
+onMounted(() => {
+  seckillActivityProductFlash();
+});
+
+defineExpose({
+  init: seckillActivityProductFlash,
+});
 </script>
 
 <style lang="scss" scoped>
 .limitCard {
   margin: auto;
-//   width: 720rpx;
+  //   width: 720rpx;
   height: 410rpx;
   padding: 0 30rpx;
   // background: url("/static/convenienceService/cardBg.png") 0 0 no-repeat;
@@ -180,7 +208,7 @@ const goProductDetails = (url) => {
       padding: 25rpx 20rpx;
       display: flex;
       box-sizing: border-box;
-      
+
       .listBox_item {
         margin-right: 20rpx;
 

+ 9 - 7
pages/shop/index.vue

@@ -29,10 +29,11 @@
       </view>
     </view>
 
+
     <!-- 限时秒杀 -->
-    <SeckillGood />
+    <SeckillGood ref="seckillGoodRef" :businessId="details.businessId"/>
     <!-- 拼团购 -->
-    <GroupBuyingGood />
+    <GroupBuyingGood ref="groupBuyingGoodRef" :businessId="details.businessId"/>
 
     <view class="tabsBox">
       <uv-tabs
@@ -88,7 +89,8 @@ import {
 } from "@dcloudio/uni-app";
 import SeckillGood from "./components/SeckillGood.vue"; // 限时秒杀组件
 import GroupBuyingGood from "./components/GroupBuyingGood.vue"; // 拼团购组件
-
+const seckillGoodRef = ref(null);
+const groupBuyingGoodRef = ref(null);
 const details = ref({});
 const value = ref("");
 const status = ref("loadmore");
@@ -126,6 +128,9 @@ onLoad((options) => {
 });
 // 下拉刷新
 onPullDownRefresh(() => {
+  if(seckillGoodRef.value) seckillGoodRef.value.init();
+  if(groupBuyingGoodRef.value) groupBuyingGoodRef.value.init();
+
   params.value.pageNum = 1;
   getProductList();
 });
@@ -136,10 +141,7 @@ onReachBottom(() => {
     getProductList();
   }
 });
-const goBack = () => {
-  // uni.navigateBack()
-  uni.navigateTo({ url: "/pages/index/index" });
-};
+
 const getTabs = () => {
   getProductCategoryList({ businessId: params.value.businessId }).then(
     (res) => {

+ 7 - 7
pages/tabtar/components/GroupBuy.vue

@@ -67,7 +67,7 @@
 
 <script setup>
 import { ref, onMounted } from "vue";
-import { activitygoodswillYouSpellPage_Api } from "@/api/groupbuy";
+import { activitygoodswillYouSpellPage_Api, activitygoodswillYouSpell_Api } from "@/api/groupbuy";
 
 const props = defineProps({
   skeletonShow: {
@@ -92,12 +92,12 @@ const goProductDetails = (url) => {
 
 /**团购 */
 const getgroupList = () => {
-  activitygoodswillYouSpellPage_Api({
-    pageSize: 10,
-    pageNum: 1,
+  activitygoodswillYouSpell_Api({
+    limit: 10,
+    page: 1,
   }).then((res) => {
     if (res && res.code == 200) {
-      groupList.value = res.rows || [];
+      groupList.value = res.data || [];
     }
   });
 };
@@ -234,7 +234,7 @@ defineExpose({
       }
 
       .large {
-        color: #00bf5a;
+        color: #ff0000;
         font-size: 36rpx;
         font-weight: Bold;
         line-height: 24rpx;
@@ -257,7 +257,7 @@ defineExpose({
       line-height: 60rpx;
       color: #ffffff;
       font-size: 28rpx;
-      background: #069d4d;
+      background: #fa6138;
       border-radius: 32rpx;
     }
   }

+ 1 - 1
pages/tabtar/components/GuessYouLike.vue

@@ -169,7 +169,7 @@ onMounted(() => {
         margin: 8rpx 20rpx 0 20rpx;
 
         .number-red {
-          color: #00bf5a;
+          color: #fa6138;
           font-size: 36rpx;
           font-weight: 700;
         }

+ 1 - 1
pages/tabtar/components/HotRecommend.vue

@@ -122,7 +122,7 @@ defineExpose({
     }
 
     .hot-large {
-      color: #00bf5a;
+      color: #fa6138;
       font-size: 36rpx;
       font-weight: Bold;
       line-height: 24rpx;

+ 1 - 1
pages/tabtar/components/MonthlyBestSeller.vue

@@ -237,7 +237,7 @@ defineExpose({
       margin-top: 16rpx;
       font-size: 36rpx;
       line-height: 24rpx;
-      color: #00bf5a;
+      color: #fa6138;
       font-weight: bold;
       text-align: center;
     }

+ 1 - 1
pages/tabtar/components/Seckill.vue

@@ -11,7 +11,7 @@
         <view class="reciprocal" v-if="currTime">
           <uv-count-down
             :time="finishTime"
-            format="HH:mm:ss"
+            format="DD:HH:mm:ss"
             @change="onChange"
           >
             <view>

+ 1 - 1
pages/tabtar/home.vue

@@ -583,7 +583,7 @@ onShareAppMessage((res) => {
   width: 100%;
 
   &.hide {
-    background: #069d4d;
+    background: #fa6138;
   }
 
   .title {

+ 5 - 3
static/style/common.scss

@@ -322,14 +322,14 @@
           font-size: 20rpx;
           font-family: PingFang SC, PingFang SC-Medium;
           font-weight: 500;
-          color: #00bf5a;
+          color: #fa6138;
           line-height: 24rpx;
         }
         .num {
           font-size: 36rpx;
           font-family: PingFang SC, PingFang SC-Medium;
           font-weight: bold;
-          color: #00bf5a;
+          color: #fa6138;
           line-height: 24rpx;
         }
       }
@@ -531,7 +531,7 @@
 }
 
 .u-00BF5A {
-  color: #00BF5A;
+  color: #fa6138;
 }
 
 // 字体大小相关
@@ -760,6 +760,8 @@
 .u-avatar104{
   width: 104rpx;
   height: 104rpx;
+  border-radius: 20rpx;
+  margin-right: 10rpx;
 }
 
 .u-del{

+ 1 - 1
util/index.js

@@ -698,7 +698,7 @@ export default {
       // });
     } else if (type == "shop") {
       uni.navigateTo({
-        url: `/pages/convenienceService/shopDetails?shopId=${id}`
+        url: `/pages/shop/index?businessId=${id}`
       })
     } else if (type == "goods_polymerize") {
       // 商品聚合页