绿满眶商城微信小程序-uniapp
peng
2025-07-22 3e84a2c746727e91b25dca19e5c289fa594c2132
解决bug
5个文件已修改
90 ■■■■■ 已修改文件
config/api.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/coupon/myCoupon.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/commodity-square/commoditySquare.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/api.js
@@ -10,18 +10,27 @@
  // store: "http://192.168.0.15:8889",
  // common: "http://192.168.0.113:8890",
  // buyer: "http://192.168.0.113:8888",
  // im: "http://192.168.0.113:8885",
  im: "http://1.95.67.54:888",
  common: "http://1.95.67.54:888",
  buyer: "http://1.95.67.54:888",
  store: "http://1.95.67.54:888",
  // im: "http://192.168.0.113:8885",s
  im: "https://myk.9village.cn",
  common: "https://myk.9village.cn",
  buyer: "https://myk.9village.cn",
  store: "https://myk.9village.cn",
  // im: "https://www.meiyikuang.com/mykapi",
  // common: "https://www.meiyikuang.com/mykapi",
  // buyer: "https://www.meiyikuang.com/mykapi",
  // store: "https://www.meiyikuang.com/mykapi",
};
// 生产环境
const prod = {
  im: "http://1.95.67.54:888",
  common: "http://1.95.67.54:888",
  buyer: "http://1.95.67.54:888",
  store: "http://1.95.67.54:888",
  // im: "http://1.95.67.54:888",
  // common: "http://1.95.67.54:888",
  // buyer: "http://1.95.67.54:888",
  // store: "http://1.95.67.54:888",
  im: "https://myk.9village.cn",
  common: "https://myk.9village.cn",
  buyer: "https://myk.9village.cn",
  store: "https://myk.9village.cn",
};
//默认生产环境
pages.json
@@ -1438,7 +1438,11 @@
        {
          "path": "coupon/index",
          "style": {
            "navigationBarTitleText": "优惠券"
            "navigationBarTitleText": "优惠券",
            "componentPlaceholder": {
              "u-tabs": "view",
              "u-empty": "view"
            }
          }
        },
        {
pages/cart/coupon/myCoupon.vue
@@ -247,9 +247,14 @@
     * 立即使用优惠券
     */
    useItNow(item) {
      uni.navigateTo({
        url: `/pages/navigation/search/searchPage?promotionsId=${item.couponId}&promotionType=COUPON`,
      });
        console.log('优惠卷详情--------------------->',JSON.stringify(item))
      // uni.navigateTo({
      //   url: `/pages/navigation/search/searchPage?promotionsId=${item.couponId}&promotionType=COUPON`,
      // });
      uni.navigateTo({
          url: '/pages/commodity-square/commoditySquare'
      });
    },
    /**
pages/commodity-square/commoditySquare.vue
@@ -17,7 +17,7 @@
            </view>
            <view class="goodsInfos" >
                <scroll-view :scroll-y="true" :show-scrollbar="false" style="height: 100%;">
                <scroll-view :scroll-y="true" :show-scrollbar="false" style="height: 100%;" @scrolltolower="loadMoreData()">
                    <view class="goodsItem" v-for="item in goodsList" :key="item.id"
                        @click.prevent="goToGoodsInfo(item.id)"
@@ -246,6 +246,7 @@
            },
            //触底获取数据
            async loadMoreData() {
                console.log("触底加载------------》",this.maxPages)
                if (this.getGoodsParam.pageNumber < this.maxPages) {
                    this.getGoodsParam.pageNumber++;
                    await this.getgoodsData()
@@ -285,8 +286,9 @@
                        item.cardNum = cardItem.num;
                    }
                })
                this.goodsList = goodsList.data.result.records;
                console.log('this.goodsList----------------------->',JSON.stringify(this.goodsList))
                this.goodsList = [...this.goodsList,...goodsList.data.result.records];
                this.maxPages = goodsList.data.result.pages
                console.log('this.goodsList----------------------->',JSON.stringify(goodsList.data.result))
            },
            async chooseCategory(id) {
vue.config.js
@@ -1,21 +1,21 @@
module.exports = {
    /**
     *  此处为发行h5,微信小程序,app中删除console
     *  如需显示console 需要注释此处重新运行
     */
    chainWebpack: (config) => {
        // 发行或运行时启用了压缩时会生效
        config.optimization.minimizer('terser').tap((args) => {
            const compress = args[0].terserOptions.compress
            // 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...)
            compress.drop_console = true
            compress.pure_funcs = [
                '__f__', // App 平台 vue 移除日志代码
                // 'console.debug' // 可移除指定的 console 方法
            ]
            return args
        })
// module.exports = {
//     /**
//      *  此处为发行h5,微信小程序,app中删除console
//      *  如需显示console 需要注释此处重新运行
//      */
//     chainWebpack: (config) => {
//         // 发行或运行时启用了压缩时会生效
//         config.optimization.minimizer('terser').tap((args) => {
//             const compress = args[0].terserOptions.compress
//             // 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...)
//             compress.drop_console = true
//             compress.pure_funcs = [
//                 '__f__', // App 平台 vue 移除日志代码
//                 // 'console.debug' // 可移除指定的 console 方法
//             ]
//             return args
//         })
    }
}
//     }
// }