Răsfoiți Sursa

小程序调试

skyline 1 lună în urmă
părinte
comite
7fd40ee53c

+ 4 - 2
haha-admin-web/src/views/layer-template/utils/hook.ts

@@ -190,7 +190,8 @@ export function useProduct(tableRef?: Ref) {
 
       console.log("设备API返回数据:", res); // 调试日志
 
-      if (res.code === 0 && res.data?.list && Array.isArray(res.data.list)) {
+      // 注意:后端成功响应的 code 是 200,不是 0
+      if ((res.code === 200 || res.code === 0) && res.data?.list && Array.isArray(res.data.list)) {
         // 根据 Device 实体类的实际字段进行映射:
         // - deviceId: 设备ID/SN号
         // - name: 设备名称(注意不是 deviceName!)
@@ -432,7 +433,8 @@ export function useProduct(tableRef?: Ref) {
       const res = await batchSyncLayerTemplates(allDeviceIds);
       console.log("批量同步API返回:", res);
 
-      if (res.code === 0) {
+      // 注意:后端成功响应的 code 是 200,不是 0
+      if (res.code === 200 || res.code === 0) {
         message(`成功提交 ${allDeviceIds.length} 个设备的同步请求`, {
           type: "success"
         });

Fișier diff suprimat deoarece este prea mare
+ 600 - 244
haha-mp/package-lock.json


+ 25 - 24
haha-mp/package.json

@@ -37,34 +37,35 @@
     "type-check": "vue-tsc --noEmit"
   },
   "dependencies": {
-    "@dcloudio/uni-app": "3.0.0-4080420251103001",
-    "@dcloudio/uni-app-harmony": "3.0.0-4080420251103001",
-    "@dcloudio/uni-app-plus": "3.0.0-4080420251103001",
-    "@dcloudio/uni-components": "3.0.0-4080420251103001",
-    "@dcloudio/uni-h5": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-alipay": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-baidu": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-harmony": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-jd": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-kuaishou": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-lark": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-qq": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-toutiao": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-weixin": "3.0.0-4080420251103001",
-    "@dcloudio/uni-mp-xhs": "3.0.0-4080420251103001",
-    "@dcloudio/uni-quickapp-webview": "3.0.0-4080420251103001",
+    "@dcloudio/uni-app": "3.0.0-5000720260410001",
+    "@dcloudio/uni-app-harmony": "3.0.0-5000720260410001",
+    "@dcloudio/uni-app-plus": "3.0.0-5000720260410001",
+    "@dcloudio/uni-components": "3.0.0-5000720260410001",
+    "@dcloudio/uni-h5": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-alipay": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-baidu": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-harmony": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-jd": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-kuaishou": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-lark": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-qq": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-toutiao": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-weixin": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-xhs": "3.0.0-5000720260410001",
+    "@dcloudio/uni-quickapp-webview": "3.0.0-5000720260410001",
     "pinia": "^3.0.4",
-    "vue": "^3.4.21",
-    "vue-i18n": "^9.1.9"
+    "vue": "3.5.32",
+    "vue-i18n": "9.14.4"
   },
   "devDependencies": {
-    "@dcloudio/types": "^3.4.8",
-    "@dcloudio/uni-automator": "3.0.0-4080420251103001",
-    "@dcloudio/uni-cli-shared": "3.0.0-4080420251103001",
-    "@dcloudio/uni-stacktracey": "3.0.0-4080420251103001",
-    "@dcloudio/vite-plugin-uni": "3.0.0-4080420251103001",
-    "@vue/runtime-core": "^3.4.21",
+    "@dcloudio/types": "3.4.28",
+    "@dcloudio/uni-automator": "3.0.0-5000720260410001",
+    "@dcloudio/uni-cli-shared": "3.0.0-5000720260410001",
+    "@dcloudio/uni-stacktracey": "3.0.0-5000720260410001",
+    "@dcloudio/vite-plugin-uni": "3.0.0-5000720260410001",
+    "@vue/runtime-core": "3.5.32",
     "@vue/tsconfig": "^0.1.3",
+    "sass": "^1.99.0",
     "typescript": "^4.9.4",
     "vite": "5.2.8",
     "vue-tsc": "^1.0.24"

+ 2 - 2
haha-mp/src/pages/index/index.vue

@@ -47,7 +47,7 @@
       </view>
       <view class="info-item" @tap="callService">
         <text class="info-icon">📞</text>
-        <text class="info-text">客服: 400-0759-515</text>
+        <text class="info-text">客服: 400-0755-315</text>
       </view>
     </view>
   </view>
@@ -235,7 +235,7 @@ const goToCouponCenter = () => {
 const callService = () => {
   uni.vibrateShort({ type: 'light' })
   uni.makePhoneCall({
-    phoneNumber: '4000759515',
+    phoneNumber: '4000755315',
     success: () => {
       console.log('[首页] 拨号成功')
     },

+ 24 - 1
haha-mp/src/pages/orderDetail/orderDetail.vue

@@ -37,7 +37,16 @@
           <text class="product-quantity">x{{ product.quantity }}</text>
         </view>
 
-        <!-- 总价 -->
+        <!-- 优惠金额(仅当有优惠时显示) -->
+        <view v-if="order.discountAmount && order.discountAmount > 0" class="amount-row discount-row">
+          <text class="amount-label">优惠金额</text>
+          <view class="amount-value-wrapper">
+            <text class="amount-prefix">-¥</text>
+            <text class="amount-discount">{{ order.discountAmount.toFixed(2) }}</text>
+          </view>
+        </view>
+        
+        <!-- 实付款 -->
         <view class="amount-row">
           <text class="amount-label">实付款</text>
           <view class="amount-value-wrapper">
@@ -526,6 +535,13 @@ const viewVideo = (url: string) => {
   background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF5 100%);
 }
 
+/* 优惠金额行样式 */
+.discount-row {
+  background: linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 100%);
+  border-top: none;
+  padding: 24rpx 32rpx;
+}
+
 .amount-label {
   font-size: 28rpx;
   color: #999999;
@@ -554,6 +570,13 @@ const viewVideo = (url: string) => {
   font-weight: 800;
 }
 
+/* 优惠金额数值样式 */
+.amount-discount {
+  font-size: 32rpx;
+  color: #10B981;
+  font-weight: 700;
+}
+
 .card-footer-actions {
   display: flex;
   justify-content: flex-end;

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff