绿满眶商城微信小程序-uniapp
peng
2025-07-21 408d93a7fed0403381400ce2fc028819bb203eec
pages/product/goods.vue
@@ -184,24 +184,24 @@
          <Evaluation id="main5" :goodsDetail="goodsDetail" />
          <!-- 店铺推荐 -->
          <storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
          <!-- <storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" /> -->
          <!-- 宝贝详情 -->
          <GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
            v-if="goodsDetail.id" />
          <!-- 宝贝推荐 -->
          <GoodsRecommend id="main11" :res="likeGoodsList" />
          <!-- <GoodsRecommend id="main11" :res="likeGoodsList" /> -->
        </view>
      </scroll-view>
      <view class="page-bottom mp-iphonex-bottom" id="pageBottom">
        <view class="icon-btn">
          <view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
<!--          <view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
            <u-icon size="34" class="red" name="home-fill"></u-icon>
            <view class="red icon-btn-name">店铺</view>
          </view>
          </view> -->
          <view class="icon-btn-item" @click="linkMsgDetail()">
            <u-icon size="34" name="kefu-ermai"></u-icon>
            <view class="icon-btn-name">客服</view>
@@ -275,6 +275,9 @@
</template>
<script>
import '@/components/uview-components/uview-ui';
/************接口API***************/
import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/goods.js";
import * as API_trade from "@/api/trade.js";
@@ -292,17 +295,19 @@
import PromotionAssembleListLayout from "./product/promotion/-promotion-assemble-list"; //拼团用户列表
import PromotionCoupon from "./product/promotion/-promotion-coupon"; //优惠券组件
import GoodsIntro from "./product/goods/-goods-intro"; //商品介绍组件
import GoodsRecommend from "./product/goods/-goods-recommend"; //宝贝推荐
// import GoodsRecommend from "./product/goods/-goods-recommend"; //宝贝推荐
import storeLayout from "./product/shop/-shop"; //店铺组件
import Evaluation from "./product/evaluation/-evaluation"; //评价组件
import GoodsSwiper from "./product/goods/-goods-swiper"; //轮播图组件
import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
import popupGoods from "@/pages/product/m-buy/goods.vue"; //购物车商品的模块
import popupAddress from "./product/popup/address"; //地址选择模块
import shares from "@/components/m-share/index"; //分享
import popups from "@/components/popups/popups"; //气泡框
import takeDownFormSaleGoods from "@/components/m-take-down-sale-goods/index"; //下架框
import shares from "@/pages/product/m-share/index.vue"; //分享
import popups from "@/pages/subComponents/popups/popups.vue"; //气泡框
import takeDownFormSaleGoods from "@/pages/product/m-take-down-sale-goods/index"; //下架框
import setup from "./product/popup/popup";
   import {
      getSTSToken
   } from '@/api/common.js'
export default {
  components: {
    popups,
@@ -313,7 +318,6 @@
    PromotionAssembleListLayout,
    PromotionCoupon,
    GoodsIntro,
    GoodsRecommend,
    storeLayout,
    Evaluation,
    GoodsSwiper,
@@ -339,21 +343,21 @@
      // #endif
      navbarListData: [
        //导航栏列表栏数据
        {
          title: "首页",
          icon: "home-fill",
          ___type: "other",
        },
        // {
        //   title: "首页",
        //   icon: "home-fill",
        //   ___type: "other",
        // },
        {
          title: "购物车",
          icon: "bag-fill",
          ___type: "other",
        },
        {
          title: "搜索",
          icon: "search",
          ___type: "category",
        },
        // {
        //   title: "搜索",
        //   icon: "search",
        //   ___type: "category",
        // },
        {
          title: "个人中心",
          icon: "account-fill",
@@ -573,8 +577,35 @@
          this.$store.state.distributionId = distributionId;
        }
      }
     const sts = await getSTSToken();
     const stsUrl = sts.data.data.endpoint
     // // 处理数据
     // goodsList.data.result.records.forEach(item => {
     //    if (item.thumbnail !== '' && item.thumbnail !== null && item.thumbnail.indexOf('http') ===
     //       -1) {
     //       item.thumbnail = stsUrl + '/' + item.thumbnail
     //    }
     //    if (item.goodsVideo !== '' && item.goodsVideo !== null && item.goodsVideo.indexOf(
     //          'http') === -1) {
     //       item.goodsVideo = stsUrl + '/' + item.goodsVideo
     //    }
     // })
      /**商品信息以及规格信息存储 */
     console.log('--------------------------1>',response.data.result.data.goodsGalleryList)
     response.data.result.data.goodsGalleryList.forEach((item,index)=>{
           if (item !== '' && item !== null && item.indexOf('http') ===
              -1) {
              response.data.result.data.goodsGalleryList[index] =  stsUrl + '/' + item
            console.log('是否执行-------------》',item)
           }
     })
      console.log('--------------------------2>',response.data.result.data.goodsGalleryList)
      this.goodsDetail = response.data.result.data;
     if (this.goodsDetail.goodsVideo !== '' && this.goodsDetail.goodsVideo !== null && this.goodsDetail.goodsVideo.indexOf(
           'http') === -1) {
        this.goodsDetail.goodsVideo = stsUrl + '/' + this.goodsDetail.goodsVideo
     }
     console.log('--------------------------2>',this.goodsDetail.goodsGalleryList)
      this.wholesaleList = response.data.result.wholesaleList;
      this.goodsSpec = response.data.result.specs;
      this.PromotionList = response.data.result.promotionMap;