Browse Source

替换失效接口

Yuzeguo 5 days ago
parent
commit
9f58a9ef37

+ 0 - 7
litemall/.gitignore

@@ -52,10 +52,3 @@ Servers
 .metadata
 upload
 gen_code
-
-# Maven
-# Node.js
-node_modules/
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*

+ 37 - 37
litemall/litemall-core/src/main/resources/application-core.yml

@@ -1,8 +1,8 @@
 litemall:
   # 开发者应该设置成自己的wx相关信息
   wx:
-    app-id: wxa5b486c6b918ecfb
-    app-secret: e04004829d4c383b4db7769d88dfbca1
+    app-id: wx231b9f009b9753fe
+    app-secret: 19073630748e10f0b4683097e02f9acc
     mch-id: 111111
     mch-key: xxxxxx
     notify-url: http://www.example.com/wx/order/pay-notify
@@ -34,14 +34,14 @@ litemall:
       active: tencent
       sign: litemall
       template:
-      - name: paySucceed
-        templateId: 156349
-      - name: captcha
-        templateId: 156433
-      - name: ship
-        templateId: 158002
-      - name: refund
-        templateId: 159447
+        - name: paySucceed
+          templateId: 156349
+        - name: captcha
+          templateId: 156433
+        - name: ship
+          templateId: 158002
+        - name: refund
+          templateId: 159447
       tencent:
         appid: 111111111
         appkey: xxxxxxxxxxxxxx
@@ -56,32 +56,32 @@ litemall:
     appId: "XXXXXXXXX"
     appKey: "XXXXXXXXXXXXXXXXXXXXXXXXX"
     vendors:
-    - code: "ZTO"
-      name: "中通快递"
-    - code: "YTO"
-      name: "圆通速递"
-    - code: "YD"
-      name: "韵达速递"
-    - code: "YZPY"
-      name: "邮政快递包裹"
-    - code: "EMS"
-      name: "EMS"
-    - code: "DBL"
-      name: "德邦快递"
-    - code: "FAST"
-      name: "快捷快递"
-    - code: "ZJS"
-      name: "宅急送"
-    - code: "TNT"
-      name: "TNT快递"
-    - code: "UPS"
-      name: "UPS"
-    - code: "DHL"
-      name: "DHL"
-    - code: "FEDEX"
-      name: "FEDEX联邦(国内件)"
-    - code: "FEDEX_GJ"
-      name: "FEDEX联邦(国际件)"
+      - code: "ZTO"
+        name: "中通快递"
+      - code: "YTO"
+        name: "圆通速递"
+      - code: "YD"
+        name: "韵达速递"
+      - code: "YZPY"
+        name: "邮政快递包裹"
+      - code: "EMS"
+        name: "EMS"
+      - code: "DBL"
+        name: "德邦快递"
+      - code: "FAST"
+        name: "快捷快递"
+      - code: "ZJS"
+        name: "宅急送"
+      - code: "TNT"
+        name: "TNT快递"
+      - code: "UPS"
+        name: "UPS"
+      - code: "DHL"
+        name: "DHL"
+      - code: "FEDEX"
+        name: "FEDEX联邦(国内件)"
+      - code: "FEDEX_GJ"
+        name: "FEDEX联邦(国际件)"
 
   # 对象存储配置
   storage:
@@ -110,4 +110,4 @@ litemall:
       endpoint: http://pd5cb6ulu.bkt.clouddn.com
       accessKey: 111111
       secretKey: xxxxxx
-      bucketName: litemall
+      bucketName: litemall

+ 1 - 1
litemall/litemall-wx/app.json

@@ -45,7 +45,7 @@
   "window": {
     "navigationBarBackgroundColor": "#FFFFFF",
     "navigationBarTitleText": "litemall小程序商城",
-    "enablePullDownRefresh": false,
+    "enablePullDownRefresh": true,
     "navigationBarTextStyle": "black",
     "backgroundColor": "#FFFFFF",
     "backgroundTextStyle": "dark"

+ 2 - 0
litemall/litemall-wx/app配置.txt

@@ -0,0 +1,2 @@
+appid=	wx231b9f009b9753fe
+appSecret=19073630748e10f0b4683097e02f9acc

+ 5 - 5
litemall/litemall-wx/lib/vant-weapp/common/utils.js

@@ -18,14 +18,14 @@ export function nextTick(fn) {
 }
 let systemInfo = null;
 export function getSystemInfoSync() {
-    if (systemInfo == null) {
+    if (!systemInfo) {
       const deviceInfo = wx.getDeviceInfo();
-      const oldSystemName = deviceInfo.osName; 
+      const oldSystemName = deviceInfo.osName; // 直接使用新接口的规范
       systemInfo = {
-          system: oldSystemName
+         system: oldSystemName
       };
-  }
-  return systemInfo;
+    }
+    return systemInfo;
 }
 export function addUnit(value) {
     if (!isDef(value)) {

+ 2 - 2
litemall/litemall-wx/lib/vant-weapp/uploader/index.js

@@ -14,7 +14,7 @@ VantComponent({
             observer: 'setComputedPreviewSize'
         },
         name: {
-            optionalTypes:  [Number, String],
+            type: [Number, String],
             value: ''
         },
         accept: {
@@ -77,7 +77,7 @@ VantComponent({
             // 设置为只选择图片的时候使用 chooseImage 来实现
             if (accept === 'image') {
                 chooseFile = new Promise((resolve, reject) => {
-                    wx.chooseImage({
+                    wx.chooseMedia({
                         count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1,
                         sourceType: capture,
                         success: resolve,

+ 21 - 22
litemall/litemall-wx/lib/wxParse/wxParse.js

@@ -86,30 +86,29 @@ function calMoreImageInfo(e, idx, that, bindName) {
 
 // 计算视觉优先的图片宽高
 function wxAutoImageCal(originalWidth, originalHeight,that,bindName) {
-  //获取图片的原始长宽s
-
-  const windowInfo = wx.getWindowInfoSync();
+    // 使用同步接口获取窗口信息
+    const windowInfo = wx.getWindowInfo();
   
-  // 安全获取边距配置(防止undefined错误)
-  const padding = that.data?.[bindName]?.view?.imagePadding || 0;
-
-  // 计算可用显示宽度(窗口宽度 - 左右边距)
-  const maxWidth = windowInfo.windowWidth - 2 * padding;
+    // 安全获取边距配置(防止undefined错误)
+    const padding = that.data?.[bindName]?.view?.imagePadding || 0;
   
-  let targetWidth = originalWidth;
-  let targetHeight = originalHeight;
-
-  // 按宽度比例缩放
-  if (targetWidth > maxWidth) {
-    targetWidth = maxWidth;
-    targetHeight = (targetWidth * originalHeight) / originalWidth;
-  }
-
-  // 返回标准化命名的结果(驼峰命名)
-  return { 
-    imageWidth: targetWidth,
-    imageHeight: targetHeight // 修正原代码拼写错误 (imageheight → imageHeight)
-  };
+    // 计算可用显示宽度(窗口宽度 - 左右边距)
+    const maxWidth = windowInfo.windowWidth - 2 * padding;
+    
+    let targetWidth = originalWidth;
+    let targetHeight = originalHeight;
+  
+    // 按宽度比例缩放
+    if (targetWidth > maxWidth) {
+      targetWidth = maxWidth;
+      targetHeight = (targetWidth * originalHeight) / originalWidth;
+    }
+  
+    // 返回标准化命名的结果(驼峰命名)
+    return { 
+      imageWidth: targetWidth,
+      imageHeight: targetHeight // 修正原代码拼写错误 (imageheight → imageHeight)
+    };
 }
 
 function wxParseTemArray(temArrayName,bindNameReg,total,that){

+ 5 - 10
litemall/litemall-wx/pages/category/category.js

@@ -23,16 +23,11 @@ Page({
       });
     }
 
-    wx.getSystemInfo({
-      success: function(res) {
-        that.setData({
-          scrollHeight: res.windowHeight
-        });
-      }
-    });
-
-
-    this.getCategoryInfo();
+    const windowInfo = wx.getWindowInfo();
+    that.setData({
+      scrollHeight: windowInfo.windowHeight
+    })
+    this.getCategoryInfo()
 
   },
   getCategoryInfo: function() {

+ 1 - 1
litemall/litemall-wx/pages/ucenter/order/order.js

@@ -29,7 +29,7 @@ Page({
       limit: that.data.limit
     }).then(function(res) {
       if (res.errno === 0) {
-        console.log(res.data);
+        // console.log(res.data);
         that.setData({
           orderList: that.data.orderList.concat(res.data.list),
           totalPages: res.data.pages

+ 1 - 1
litemall/litemall-wx/project.config.json

@@ -41,7 +41,7 @@
     "disableSWC": true
   },
   "compileType": "miniprogram",
-  "libVersion": "2.4.0",
+  "libVersion": "3.8.0",
   "appid": "wx231b9f009b9753fe",
   "projectname": "litemall-wx",
   "simulatorType": "wechat",

+ 47 - 0
litemall/litemall-wx/问题.docx

@@ -0,0 +1,47 @@
+                                      序
+                                       
+                                       
+                                      号
+                                 问题类型
+                                 问题描述
+                                 是否解决
+                                 解决时间
+                                 解决方法
+                                       1
+                                    代码
+           wx.getsysteminfo和wx.getsysteminfosync接口停止维修
+                                       N
+                                       
+                                       
+                                       2
+                                 功能缺失
+个人页面必备工具里"联系客服"功能js、wxml文件缺失相关组件
+                                       N
+                                       
+                                       
+                                       3
+                                    代码
+                       Wx.chooseImage接口停止维修
+                                       Y
+                                   2025.4.18
+                      将chooseImage替换为chooseMedia
+                                       4
+                                    优化
+                     缺少顶层向下滑动刷新功能
+                                       Y
+                                   2025.4.19
+--------------------------------------------------------------------------------
+在app.json文件中"window"的"enablePullDownRefresh"参数改为 true
+                                       5
+                                    优化
+包体无依赖部分过大(202kb/1.1mb),影响小程序启动速度和响应
+                                       N
+                                       
+                                       
+                                       
+                                       
+                                       
+                                       
+                                       
+                                       
+                          微信小程序问题汇总

+ 17 - 3
litemall/renard-wx/project.config.json

@@ -24,11 +24,20 @@
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
-    "minifyWXSS": true
+    "minifyWXSS": true,
+    "compileWorklet": false,
+    "enhance": false,
+    "minifyWXML": true,
+    "localPlugins": false,
+    "disableUseStrict": false,
+    "useCompilerPlugins": false,
+    "condition": false,
+    "swc": false,
+    "disableSWC": true
   },
   "compileType": "miniprogram",
   "libVersion": "2.4.0",
-  "appid": "wxa5b486c6b918ecfb",
+  "appid": "wx231b9f009b9753fe",
   "projectname": "Renard",
   "simulatorType": "wechat",
   "simulatorPluginLibVersion": {},
@@ -199,5 +208,10 @@
         }
       ]
     }
-  }
+  },
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "editorSetting": {}
 }

+ 24 - 0
litemall/renard-wx/project.private.config.json

@@ -0,0 +1,24 @@
+{
+  "libVersion": "3.8.0",
+  "projectname": "Renard",
+  "condition": {},
+  "setting": {
+    "urlCheck": false,
+    "coverView": false,
+    "lazyloadPlaceholderEnable": false,
+    "skylineRenderEnable": false,
+    "preloadBackgroundData": false,
+    "autoAudits": false,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "showShadowRootInWxmlPanel": false,
+    "useStaticServer": false,
+    "useLanDebug": false,
+    "showES6CompileOption": false,
+    "compileHotReLoad": true,
+    "checkInvalidKey": true,
+    "ignoreDevUnusedFiles": true,
+    "bigPackageSizeSupport": false,
+    "useIsolateContext": true
+  }
+}