Bläddra i källkod

feat: 微服务接入改造20%(创建订单页面:已完成深圳车场的优惠逻辑)

John-Hong 2 år sedan
förälder
incheckning
68c01df8a4

+ 4 - 5
src/App.vue

@@ -33,11 +33,10 @@ import { getAppIdByGroupIdAndMallId } from '@/utils/index.js';
 
 export default {
   mixins: [loginMinix],
-  created() {
-    console.log('重新打包');
-    this.initEnv();
-    this.requestInit()
-    this.init();
+  async created() {
+    await this.initEnv();
+    await this.requestInit()
+    await this.init();
     // 初始化环境变量
   },
   computed: {

+ 3 - 3
src/api/mockData/check-out.response.json

@@ -62,14 +62,14 @@
     "enableNewMemberPoints": false,
     "enablePoints": true,
     "enableCoupon": true,
-    "enablePaperCoupons": false,
+    "enablePaperCoupons": true,
     "enableConsume": false,
     "enableConsumeSplit": false,
     "remainConsumeTime": 20
   },
   "parkInfo": {
-    "parkName": "计费基础规则:15分钟内免费,首小时15元,其后每小时5元,全天封顶60元。",
-    "description": "深圳收费描述",
+    "parkName": "深圳停车场",
+    "description": "计费基础规则:15分钟内免费,首小时15元,其后每小时5元,全天封顶60元。",
     "parkMallCode": 5
   }
 }

+ 99 - 0
src/api/mockData/checkout.hz.response.json

@@ -0,0 +1,99 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "粤BZ11R2",
+    "enterTime": "2022-11-11 16:11:11",
+    "serviceMin": 1731,
+    "totalFee": 12000,
+    "actualPayFee": 58,
+    "totalFeeInYuan": 120
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 62,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": false,
+        "memberGradeText": "银卡卡",
+        "discountTime": 2,
+        "discountFee": 10
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "maxDiscountTime": 1,
+        "discountTime": 1,
+        "defaultDiscountTime": 3,
+        "redeemSalesAmount": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 3000,
+        "pointsPerUnit": 500,
+        "pointsPerHour": 100,
+        "unitAmount": 5,
+        "newMember": false,
+        "label": "已选择兑换2小时",
+        "memberGradeText": "银卡",
+        "discountFee": 10
+      }
+    ],
+    "coupons": [
+      {
+        "code": "couponCode1",
+        "name": "6元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 6,
+        "defaultSelected": true
+      },
+      {
+        "code": "couponCode2",
+        "name": "6元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 6,
+        "defaultSelected": true
+      },
+      {
+        "code": "couponCode3",
+        "name": "5元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 5,
+        "defaultSelected": false
+      },
+      {
+        "code": "couponCode4",
+        "name": "5元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 5,
+        "defaultSelected": false
+      },
+      {
+        "code": "couponCode5",
+        "name": "5元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 5,
+        "defaultSelected": false
+      }
+    ]
+  },
+  "parkingRule": {
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "maxOneDayCoupons": 2,
+    "remainCoupons": 2,
+    "enablePaperCoupons": false,
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 6,
+    "maxPointsTime": 3,
+    "remainConsumeTime": 5,
+    "maxDiscountTime": 33
+  },
+  "parkInfo": {
+    "parkName": "杭州嘉里城",
+    "description": "杭州收费描述",
+    "parkMallCode": 2
+  }
+}

+ 39 - 0
src/api/mockData/checkout.qh.response

@@ -0,0 +1,39 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "浙A616A1",
+    "enterTime": "2023-01-12 10:15:26",
+    "serviceMin": 40610,
+    "totalFee": 0,
+    "actualPayFee": 0.0,
+    "totalFeeInYuan": 0.0
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 0,
+    "memberLevelDiscount": false,
+    "points": [
+      {
+        "available": 1000, // 用户可用的积分
+        "maxDiscountFee": 20,// 单次上限(元)
+        "pointsPerUnit": 500, // 
+        "unitAmount": 5, // 兑换值(元)
+        "newMember": false,
+        "label": "1000积分可减免"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60,// 每日最大优惠金额
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": false,
+    "enablePaperCoupons": false,
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "remainConsumeTime": 60
+  },
+  "parkInfo": {
+    "parkName": "VLhpfQGTMDYpsBZxvfBoeygjb",
+    "description": "eOMtThyhVNLWUZNRcBaQKxI",
+    "parkMallCode": 999
+  }
+}

+ 66 - 0
src/api/mockData/checkout.qh.response.json

@@ -0,0 +1,66 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "浙A616A1",
+    "enterTime": "2023-01-12 10:15:26",
+    "serviceMin": 40610,
+    "totalFee": 0,
+    "actualPayFee": 0.0,
+    "totalFeeInYuan": 0.0
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 0,
+    "memberLevelDiscount": false,
+    "points": [
+      {
+        "available": 1000,
+        "maxDiscountFee": 20,
+        "pointsPerUnit": 500,
+        "unitAmount": 5,
+        "newMember": false,
+        "label": "1000积分可减免"
+      }
+    ],
+    "coupons": [
+      {
+        "code": "couponCode1",
+        "name": "6元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 6,
+        "superpositionrule": 3,
+        "defaultSelected": true
+      },
+      {
+        "code": "couponCode2",
+        "name": "6元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 6,
+        "superpositionrule": 3,
+        "defaultSelected": true
+      },
+      {
+        "code": "couponCode3",
+        "name": "5元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 5,
+        "superpositionrule": 3,
+        "defaultSelected": false
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "enablePaperCoupons": false,
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "remainConsumeTime": 60,
+    "maxPointsTime": 4
+  },
+  "parkInfo": {
+    "parkName": "VLhpfQGTMDYpsBZxvfBoeygjb",
+    "description": "eOMtThyhVNLWUZNRcBaQKxI",
+    "parkMallCode": 999
+  }
+}

+ 41 - 0
src/api/mockData/checkout.qh2.response.json

@@ -0,0 +1,41 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "浙A616A1",
+    "enterTime": "2023-01-12 10:15:26",
+    "serviceMin": 41804,
+    "totalFee": 0,
+    "actualPayFee": 0.0,
+    "totalFeeInYuan": 0.00
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 0,
+    "memberLevelDiscount": false,
+    "points": [
+      {
+        "available": 1000,
+        "maxDiscountFee": 20,
+        "pointsPerUnit": 500,
+        "unitAmount": 5,
+        "newMember": false,
+        "label": "1000积分可减免"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": false,
+    "enablePaperCoupons": false,
+    "maxPointsTime": 2,
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "remainConsumeTime": 60,
+    "hourPrice": 5
+  },
+  "parkInfo": {
+    "parkName": "VLhpfQGTMDYpsBZxvfBoeygjb",
+    "description": "eOMtThyhVNLWUZNRcBaQKxI",
+    "parkMallCode": 999
+  }
+}

+ 1034 - 0
src/api/mockData/cities.dev.response.json

@@ -0,0 +1,1034 @@
+{
+  "code": "000000",
+  "message": "成功",
+  "data": [
+    {
+      "city": {
+        "id": "1",
+        "name": "北京",
+        "pinyinAbbreviation": "BJ"
+      },
+      "centers": [
+        {
+          "id": "BKC",
+          "name": "北京嘉里中心",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "1",
+          "cityName": "北京",
+          "address": "北京市朝阳区光华路1号",
+          "propertyManagementCo": "42010",
+          "propertyDevelopmentCo": "31007",
+          "privacy": false,
+          "note": "2",
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634044529701-36ywci.jpg",
+          "formats": "RETAIL,OFFICE,APARTMENT,PARKING",
+          "lon": "116.459349",
+          "lat": "39.914053",
+          "createdBy": "lisa.cx.lin",
+          "createdDate": "2021-09-16 06:59:51",
+          "lastModifiedDate": "2022-12-14 07:39:41",
+          "lastModifiedBy": "Kevin.BC.Li"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa80b47c784020017c78b205ba0023",
+          "name": "北京嘉里中心",
+          "lng": "116.465774",
+          "lat": "39.919719",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "北京市朝阳区光华路1号",
+          "code": "BKC0004",
+          "enable": "ENABLE",
+          "projectId": "BKC",
+          "brand": {
+            "id": "8aaa82ea804d07cd01805174dd3b000c",
+            "name": "KerryOn"
+          },
+          "logo": {
+            "id": "123",
+            "logoName": "KerryOn",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650634051795708241/KO.png"
+          }
+        },
+        {
+          "id": "8aaa83397bf7310e017bf7cab2f6000c",
+          "name": "北京嘉里中心办公楼",
+          "lng": "116.466862",
+          "lat": "39.919746",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "北京市朝阳区光华路1号",
+          "code": "BKC0002",
+          "enable": "ENABLE",
+          "projectId": "BKC",
+          "brand": {
+            "id": "4028e3817c2b7748017c2b8061400000",
+            "name": "Kerry+ 北京"
+          },
+          "logo": {
+            "id": "106",
+            "logoName": "Kerry+ 北京",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1633945591895-yc7xhl.jpg"
+          }
+        },
+        {
+          "id": "8aaa82ae7c78d5ad017c78e5af680000",
+          "name": "北京嘉里中心公寓",
+          "lng": "116.465694",
+          "lat": "39.919463",
+          "format": "APARTMENT",
+          "defaultFlag": false,
+          "address": "北京市朝阳区光华路1号",
+          "code": "BKC0003",
+          "enable": "ENABLE",
+          "projectId": "BKC",
+          "brand": {
+            "id": "4028e3817c2b7748017c2b8061400000",
+            "name": "Kerry+ 北京"
+          },
+          "logo": {
+            "id": "106",
+            "logoName": "Kerry+ 北京",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1633945591895-yc7xhl.jpg"
+          }
+        }
+      ]
+    },
+    {
+      "city": {
+        "id": "10",
+        "name": "成都",
+        "pinyinAbbreviation": "CD"
+      }
+    },
+    {
+      "city": {
+        "id": "11",
+        "name": "福州",
+        "pinyinAbbreviation": "FZ"
+      },
+      "centers": [
+        {
+          "id": "FZJLZX",
+          "name": "榕城江上图",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "11",
+          "cityName": "福州",
+          "address": "福州13",
+          "propertyManagementCo": "41027",
+          "propertyDevelopmentCo": "31039",
+          "privacy": false,
+          "formats": "OFFICE,RETAIL,APARTMENT",
+          "lon": "119.305925",
+          "lat": "26.075789",
+          "createdBy": "yunfei.xu",
+          "createdDate": "2022-04-28 06:55:33",
+          "lastModifiedDate": "2023-01-05 09:42:50",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "FZHYF",
+          "name": "福州灏云峯",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "11",
+          "cityName": "福州",
+          "propertyManagementCo": "31007",
+          "propertyDevelopmentCo": "31039",
+          "privacy": false,
+          "formats": "RESIDENCE",
+          "lon": "119.389938",
+          "lat": "26.007383",
+          "createdBy": "shirley.jj.wu",
+          "createdDate": "2022-04-22 13:36:01",
+          "lastModifiedDate": "2022-12-14 03:34:12",
+          "lastModifiedBy": "Kevin.BC.Li"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8a8481f68059f17501805eaf6b8a0000",
+          "name": "福州城市广场",
+          "lng": "119.390347",
+          "lat": "26.008726",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "code": "FZKC00001",
+          "enable": "ENABLE",
+          "projectId": "FZJLZX",
+          "brand": {
+            "id": "8a8480f9805e8c7201805eaa0d520000",
+            "name": "Kerry+福州"
+          },
+          "logo": {
+            "id": "114",
+            "logoName": "Kerry+福州",
+            "logoPicture": "https://kip-public-qa.oss-cn-shanghai.aliyuncs.com/1650855641036521979/%E7%A6%8F%E5%B7%9E%20logo.png"
+          }
+        },
+        {
+          "id": "8a8480fa805eafc301805eb2dbd00000",
+          "name": "福州灏云峯",
+          "pinyinAbbreviation": "FZHYF",
+          "lng": "119.389938",
+          "lat": "26.007383",
+          "format": "RESIDENCE",
+          "defaultFlag": false,
+          "code": "FZKC00003",
+          "enable": "ENABLE",
+          "projectId": "FZHYF",
+          "brand": {
+            "id": "8a8480f9805e8c7201805eaa0d520000",
+            "name": "Kerry+福州"
+          },
+          "logo": {
+            "id": "114",
+            "logoName": "Kerry+福州",
+            "logoPicture": "https://kip-public-qa.oss-cn-shanghai.aliyuncs.com/1650855641036521979/%E7%A6%8F%E5%B7%9E%20logo.png"
+          },
+          "weChatOfficialAccountsAppId": "wx2bd99ca94d6acd7e"
+        },
+        {
+          "id": "8a8480fd805ebf5a01805ec49e740000",
+          "name": "福州江南岸",
+          "pinyinAbbreviation": "FZJNA",
+          "lng": "119.388082",
+          "lat": "26.010215",
+          "format": "APARTMENT",
+          "defaultFlag": false,
+          "code": "FZKC00004",
+          "enable": "ENABLE",
+          "projectId": "FZJLZX",
+          "brand": {
+            "id": "8a8480f9805e8c7201805eaa0d520000",
+            "name": "Kerry+福州"
+          },
+          "logo": {
+            "id": "114",
+            "logoName": "Kerry+福州",
+            "logoPicture": "https://kip-public-qa.oss-cn-shanghai.aliyuncs.com/1650855641036521979/%E7%A6%8F%E5%B7%9E%20logo.png"
+          }
+        },
+        {
+          "id": "8a8481f68059f17501805eb0ed520001",
+          "name": "福州江上图",
+          "pinyinAbbreviation": "FZJST",
+          "lng": "119.390627",
+          "lat": "26.008327",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "code": "FZKC00002",
+          "enable": "ENABLE",
+          "projectId": "FZJLZX",
+          "brand": {
+            "id": "8a8480f9805e8c7201805eaa0d520000",
+            "name": "Kerry+福州"
+          },
+          "logo": {
+            "id": "114",
+            "logoName": "Kerry+福州",
+            "logoPicture": "https://kip-public-qa.oss-cn-shanghai.aliyuncs.com/1650855641036521979/%E7%A6%8F%E5%B7%9E%20logo.png"
+          }
+        }
+      ]
+    },
+    {
+      "city": {
+        "id": "3",
+        "name": "杭州",
+        "pinyinAbbreviation": "HZ"
+      },
+      "centers": [
+        {
+          "id": "HKC",
+          "name": "杭州嘉里中心",
+          "areaId": "3",
+          "areaName": "华东",
+          "cityId": "3",
+          "cityName": "杭州",
+          "address": "浙江省杭州市拱墅区延安路385号",
+          "propertyManagementCo": "41018",
+          "propertyDevelopmentCo": "31017",
+          "privacy": false,
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634043129256-xhkpsp.jpg",
+          "formats": "OFFICE,RETAIL",
+          "lon": "120.162567",
+          "lat": "30.260341",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2021-09-09 04:13:55",
+          "lastModifiedDate": "2022-12-14 06:58:56",
+          "lastModifiedBy": "Kevin.BC.Li"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa80b47c784020017c78b00d060022",
+          "name": "杭州嘉里中心",
+          "lng": "120.162567",
+          "lat": "30.260341",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "浙江省杭州市拱墅区延安路385号",
+          "code": "HKC0002",
+          "enable": "ENABLE",
+          "projectId": "HKC",
+          "brand": {
+            "id": "4028e3817c2b3f79017c2b48c54c0000",
+            "name": "Kerry+ 杭州"
+          },
+          "logo": {
+            "id": "105",
+            "logoName": "Kerry+ 杭州",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/Hangzhou.png"
+          }
+        },
+        {
+          "id": "4028e3817bf860f3017bf86279b50001",
+          "name": "杭州嘉里中心办公楼",
+          "lng": "120.169024",
+          "lat": "30.26573",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "浙江省杭州市拱墅区延安路385号",
+          "code": "HKC0001",
+          "enable": "ENABLE",
+          "projectId": "HKC",
+          "brand": {
+            "id": "4028e3817c2b3f79017c2b48c54c0000",
+            "name": "Kerry+ 杭州"
+          },
+          "logo": {
+            "id": "105",
+            "logoName": "Kerry+ 杭州",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/Hangzhou.png"
+          },
+          "weChatOfficialAccountsAppId": "wxb81a622ed6d60adf"
+        }
+      ]
+    },
+    {
+      "city": {
+        "id": "5",
+        "name": "上海",
+        "pinyinAbbreviation": "SH"
+      },
+      "centers": [
+        {
+          "id": "190",
+          "name": "嘉里华庭II",
+          "areaId": "3",
+          "areaName": "华东",
+          "cityId": "5",
+          "cityName": "上海",
+          "propertyManagementCo": "42007",
+          "propertyDevelopmentCo": "31005",
+          "privacy": false,
+          "formats": "APARTMENT,RESIDENCE",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-12-14 08:51:09",
+          "lastModifiedDate": "2023-01-31 03:13:52",
+          "lastModifiedBy": "XinRui Zhang"
+        },
+        {
+          "id": "KEC3",
+          "name": "上海企业中心",
+          "areaId": "5",
+          "areaName": "华西",
+          "cityId": "5",
+          "cityName": "上海",
+          "propertyManagementCo": "42011",
+          "propertyDevelopmentCo": "31002",
+          "privacy": false,
+          "note": "1",
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634105732963-w5x7ed.jpg",
+          "formats": "OFFICE,APARTMENT",
+          "lon": "121.45832",
+          "lat": "31.244593",
+          "createdBy": "系统管理员一",
+          "createdDate": "2021-10-13 06:15:34",
+          "lastModifiedDate": "2022-12-15 01:28:02",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "PKC",
+          "name": "浦东嘉里城",
+          "areaId": "3",
+          "areaName": "华东",
+          "cityId": "5",
+          "cityName": "上海",
+          "address": "上海市浦东新区花木路1378号",
+          "propertyManagementCo": "42008",
+          "propertyDevelopmentCo": "32001",
+          "privacy": false,
+          "note": "1",
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634047679563-ro5ej0.jpg",
+          "formats": "OFFICE,RETAIL,APARTMENT",
+          "lon": "121.563761",
+          "lat": "31.212535",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2021-09-09 03:27:44",
+          "lastModifiedDate": "2022-12-14 08:22:02",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "JAKC",
+          "name": "静安嘉里中心",
+          "areaId": "3",
+          "areaName": "华东",
+          "cityId": "5",
+          "cityName": "上海",
+          "address": "上海市静安区南京西路1515号",
+          "propertyManagementCo": "42004",
+          "propertyDevelopmentCo": "31003",
+          "privacy": false,
+          "note": "1",
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634047291945-axfno8.jpg",
+          "formats": "OFFICE,RETAIL,APARTMENT,PARKING",
+          "lon": "121.456091",
+          "lat": "31.230261",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2021-09-09 03:22:38",
+          "lastModifiedDate": "2022-12-14 07:54:00",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "KEC1",
+          "name": "嘉里不夜城一期",
+          "areaId": "5",
+          "areaName": "华西",
+          "cityId": "5",
+          "cityName": "上海",
+          "address": "上海市静安区梅园路228号企业广场2楼(近汉中路)",
+          "propertyManagementCo": "42001",
+          "propertyDevelopmentCo": "31002",
+          "privacy": false,
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634046770164-dafyd8.jpg",
+          "formats": "OFFICE,RESIDENCE",
+          "lon": "121.457108",
+          "lat": "31.243751",
+          "createdBy": "系统管理员一",
+          "createdDate": "2021-09-09 04:19:46",
+          "lastModifiedDate": "2022-12-14 06:45:47",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "kevin-test",
+          "name": "kevin-test",
+          "areaId": "5",
+          "areaName": "华西",
+          "cityId": "5",
+          "cityName": "上海",
+          "address": "1",
+          "propertyManagementCo": "1",
+          "propertyDevelopmentCo": "1",
+          "privacy": false,
+          "note": "1",
+          "formats": "RESIDENCE",
+          "lon": "1",
+          "lat": "1",
+          "createdBy": "lisa.cx.lin",
+          "createdDate": "2022-05-19 03:09:18",
+          "lastModifiedDate": "2022-05-19 03:09:18",
+          "lastModifiedBy": "lisa.cx.lin"
+        },
+        {
+          "id": "keivn-test",
+          "name": "1",
+          "areaId": "5",
+          "areaName": "华西",
+          "cityId": "5",
+          "cityName": "上海",
+          "address": "1",
+          "propertyManagementCo": "1",
+          "propertyDevelopmentCo": "1",
+          "privacy": false,
+          "formats": "APARTMENT,RESIDENCE",
+          "lon": "1",
+          "lat": "1",
+          "createdBy": "lisa.cx.lin",
+          "createdDate": "2022-03-18 06:42:21",
+          "lastModifiedDate": "2022-03-18 06:42:21",
+          "lastModifiedBy": "lisa.cx.lin"
+        },
+        {
+          "id": "ZYJ",
+          "name": "卓悦居西区",
+          "areaId": "5",
+          "areaName": "华西",
+          "cityId": "5",
+          "cityName": "上海",
+          "propertyManagementCo": "31003",
+          "propertyDevelopmentCo": "42004",
+          "privacy": false,
+          "formats": "PARKING,RESIDENCE,APARTMENT",
+          "createdBy": "Lily",
+          "createdDate": "2021-11-02 09:23:34",
+          "lastModifiedDate": "2022-01-20 03:06:09",
+          "lastModifiedBy": "Lily"
+        },
+        {
+          "id": "1222",
+          "name": "M测试楼盘",
+          "areaId": "1",
+          "areaName": "华中",
+          "cityId": "5",
+          "cityName": "上海",
+          "address": "11111",
+          "propertyManagementCo": "1111",
+          "propertyDevelopmentCo": "111",
+          "privacy": false,
+          "formats": "APARTMENT,RESIDENCE,OFFICE,RETAIL,PARKING",
+          "createdBy": "系统管理员一",
+          "createdDate": "2021-09-10 06:58:14",
+          "lastModifiedDate": "2021-10-13 07:13:51",
+          "lastModifiedBy": "系统管理员一"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa84077c0bb1a5017c0d1f570a0000",
+          "name": "嘉里不夜城一期办公楼",
+          "lng": "121.456725",
+          "lat": "31.24507",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "上海市静安区天目西路218号",
+          "code": "KEC10001",
+          "enable": "ENABLE",
+          "projectId": "KEC1",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c7201e82d0001",
+            "name": "Kerry+ 上海"
+          },
+          "logo": {
+            "id": "117",
+            "logoName": "Kerry+ 上海",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634048639498-41hk5n.jpg"
+          }
+        },
+        {
+          "id": "8aaa81cb7c836c6b017c83e2c76f0000",
+          "name": "静安嘉里中心",
+          "lng": "121.450228",
+          "lat": "31.224355",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "上海市静安区南京西路1515号",
+          "code": "JAKC0001",
+          "enable": "ENABLE",
+          "projectId": "JAKC",
+          "brand": {
+            "id": "8aaa82ea804d07cd01805174dd3b000c",
+            "name": "KerryOn"
+          },
+          "logo": {
+            "id": "123",
+            "logoName": "KerryOn",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650634051795708241/KO.png"
+          }
+        },
+        {
+          "id": "8aaa80ae7c741565017c74ea1efe004d",
+          "name": "静安嘉里中心办公楼",
+          "lng": "121.450228",
+          "lat": "31.224355",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "上海市静安区南京西路街道南京西路1539号",
+          "code": "JAKC0002",
+          "enable": "ENABLE",
+          "projectId": "JAKC",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c7201e82d0001",
+            "name": "Kerry+ 上海"
+          },
+          "logo": {
+            "id": "117",
+            "logoName": "Kerry+ 上海",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634048639498-41hk5n.jpg"
+          }
+        },
+        {
+          "id": "8aaa81cb7c836c6b017c83e46b110001",
+          "name": "浦东嘉里城",
+          "lng": "121.563478",
+          "lat": "31.212621",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "上海市浦东新区花木路1378号",
+          "code": "PKC0001",
+          "enable": "ENABLE",
+          "projectId": "PKC",
+          "brand": {
+            "id": "8aaa82ea804d07cd01805174dd3b000c",
+            "name": "KerryOn"
+          },
+          "logo": {
+            "id": "123",
+            "logoName": "KerryOn",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650634051795708241/KO.png"
+          }
+        },
+        {
+          "id": "8aaa80ae7c741565017c74dbedd0004c",
+          "name": "浦东嘉里城办公楼",
+          "lng": "121.563478",
+          "lat": "31.212621",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "上海市浦东新区花木路1378号",
+          "code": "PKC0002",
+          "enable": "ENABLE",
+          "projectId": "PKC",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c7201e82d0001",
+            "name": "Kerry+ 上海"
+          },
+          "logo": {
+            "id": "117",
+            "logoName": "Kerry+ 上海",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634048639498-41hk5n.jpg"
+          }
+        },
+        {
+          "id": "8aaa82fc7d11fee4017d1313585c0000",
+          "name": "企业中心",
+          "lng": "121.463091",
+          "lat": "31.250861",
+          "format": "OFFICE",
+          "defaultFlag": true,
+          "address": "上海市静安区共和路209号",
+          "code": "KEC0002",
+          "enable": "ENABLE",
+          "projectId": "KEC3",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c7201e82d0001",
+            "name": "Kerry+ 上海"
+          },
+          "logo": {
+            "id": "117",
+            "logoName": "Kerry+ 上海",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634048639498-41hk5n.jpg"
+          }
+        },
+        {
+          "id": "4028e3817da24c28017da2525b830000",
+          "name": "企业公馆",
+          "lng": "121.457945",
+          "lat": "31.244582",
+          "format": "APARTMENT",
+          "defaultFlag": false,
+          "address": "上海市企业中心企业公馆",
+          "code": "KEC3-001",
+          "enable": "ENABLE",
+          "projectId": "KEC3",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c7201e82d0001",
+            "name": "Kerry+ 上海"
+          },
+          "logo": {
+            "id": "117",
+            "logoName": "Kerry+ 上海",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634048639498-41hk5n.jpg"
+          }
+        },
+        {
+          "id": "8aaa87f57ddb1726017ddb2b27820000",
+          "name": "嘉里华庭二期",
+          "lng": "121.434757",
+          "lat": "31.212873",
+          "format": "APARTMENT",
+          "defaultFlag": false,
+          "address": "上海市长宁区华山路1038弄166号",
+          "code": "SHKC0001",
+          "enable": "ENABLE",
+          "projectId": "190",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c7201e82d0001",
+            "name": "Kerry+ 上海"
+          },
+          "logo": {
+            "id": "117",
+            "logoName": "Kerry+ 上海",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634048639498-41hk5n.jpg"
+          },
+          "weChatOfficialAccountsAppId": "wxb81a622ed6d60adf"
+        }
+      ]
+    },
+    {
+      "city": {
+        "id": "6",
+        "name": "沈阳",
+        "pinyinAbbreviation": "SY"
+      },
+      "centers": [
+        {
+          "id": "SYYSJ",
+          "name": "沈阳雅颂居",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "6",
+          "cityName": "沈阳",
+          "propertyManagementCo": "41009",
+          "propertyDevelopmentCo": "31019",
+          "privacy": false,
+          "formats": "RESIDENCE",
+          "lon": "123.44591",
+          "lat": "41.77886",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-12-15 01:40:15",
+          "lastModifiedDate": "2022-12-15 01:40:15",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "SYYSDY",
+          "name": "沈阳雅颂大苑",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "6",
+          "cityName": "沈阳",
+          "propertyManagementCo": "41009",
+          "propertyDevelopmentCo": "31019",
+          "privacy": false,
+          "formats": "RESIDENCE",
+          "lon": "123.444011",
+          "lat": "41.782562",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-12-15 01:31:23",
+          "lastModifiedDate": "2022-12-15 01:31:23",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "SKC",
+          "name": "沈阳嘉里中心",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "6",
+          "cityName": "沈阳",
+          "address": "沈阳市沈河区文化路70号",
+          "propertyManagementCo": "41009",
+          "propertyDevelopmentCo": "31019",
+          "privacy": false,
+          "formats": "RETAIL,OFFICE,PARKING",
+          "lon": "123.444587",
+          "lat": "41.782935",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-04-22 10:42:56",
+          "lastModifiedDate": "2022-12-14 07:12:29",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "ZYJXQV2",
+          "name": "测试楼盘",
+          "areaId": "5",
+          "areaName": "华西",
+          "cityId": "6",
+          "cityName": "沈阳",
+          "propertyManagementCo": "12345",
+          "propertyDevelopmentCo": "12345",
+          "privacy": false,
+          "formats": "OFFICE,APARTMENT,RESIDENCE,PARKING,RETAIL",
+          "createdBy": "lisa.cx.lin",
+          "createdDate": "2022-01-05 03:15:57",
+          "lastModifiedDate": "2022-03-17 01:05:09",
+          "lastModifiedBy": "lisa.cx.lin"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa82ea804d07cd01805171768b0009",
+          "name": "沈阳嘉里城",
+          "lng": "123.442623",
+          "lat": "41.780627",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "辽宁省沈阳市沈河区青年大街123号",
+          "code": "SKC0001",
+          "enable": "ENABLE",
+          "projectId": "SKC",
+          "brand": {
+            "id": "8aaa82ea804d07cd01805175c3a8000d",
+            "name": "Kerry+沈阳"
+          },
+          "logo": {
+            "id": "124",
+            "logoName": "Kerry+沈阳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650634110615844257/Shenyang.png"
+          }
+        },
+        {
+          "id": "8aaa87bc7ce98224017ce995fd8a0002",
+          "name": "沈阳嘉里中心企业广场",
+          "lng": "123.443",
+          "lat": "41.781867",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "code": "SKC0002",
+          "enable": "ENABLE",
+          "projectId": "SKC",
+          "brand": {
+            "id": "8aaa82ea804d07cd01805175c3a8000d",
+            "name": "Kerry+沈阳"
+          },
+          "logo": {
+            "id": "124",
+            "logoName": "Kerry+沈阳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650634110615844257/Shenyang.png"
+          }
+        },
+        {
+          "id": "8aaa87bc7ce98224017ce9974ab90003",
+          "name": "沈阳雅颂居",
+          "lng": "123.46987",
+          "lat": "41.80515",
+          "format": "RESIDENCE",
+          "defaultFlag": false,
+          "code": "SKC0003",
+          "enable": "ENABLE",
+          "projectId": "SYYSJ",
+          "brand": {
+            "id": "8aaa82ea804d07cd01805175c3a8000d",
+            "name": "Kerry+沈阳"
+          },
+          "logo": {
+            "id": "124",
+            "logoName": "Kerry+沈阳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650634110615844257/Shenyang.png"
+          }
+        }
+      ]
+    },
+    {
+      "city": {
+        "id": "2",
+        "name": "深圳",
+        "pinyinAbbreviation": "SZ"
+      },
+      "centers": [
+        {
+          "id": "192",
+          "name": "前海嘉里中心",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "2",
+          "cityName": "深圳",
+          "address": "深圳前海",
+          "propertyManagementCo": "31007",
+          "propertyDevelopmentCo": "31038",
+          "privacy": false,
+          "note": "1",
+          "formats": "OFFICE,APARTMENT,PARKING,RETAIL",
+          "lon": "113.892103",
+          "lat": "22.526097",
+          "createdBy": "lisa.cx.lin",
+          "createdDate": "2021-09-09 03:32:27",
+          "lastModifiedDate": "2023-01-09 03:35:33",
+          "lastModifiedBy": "byron.yu"
+        },
+        {
+          "id": "SZXP",
+          "name": "深圳嘉里建设广场",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "2",
+          "cityName": "深圳",
+          "propertyManagementCo": "41006",
+          "propertyDevelopmentCo": "31010",
+          "privacy": false,
+          "formats": "OFFICE,RETAIL,PARKING",
+          "lon": "114.058096",
+          "lat": "22.535934",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-12-15 01:57:02",
+          "lastModifiedDate": "2022-12-15 01:57:02",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "SZKP",
+          "name": "测试广场",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "2",
+          "cityName": "深圳",
+          "address": "深圳",
+          "propertyManagementCo": "41006",
+          "propertyDevelopmentCo": "31010",
+          "privacy": false,
+          "note": "1",
+          "formats": "OFFICE,RETAIL,PARKING",
+          "lon": "114.058096",
+          "lat": "22.535934",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2021-09-09 03:45:49",
+          "lastModifiedDate": "2022-12-15 01:55:46",
+          "lastModifiedBy": "Kevin.BC.Li"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa83397bf7310e017bf7ca147f000b",
+          "name": "深圳嘉里建设广场",
+          "lng": "114.063516",
+          "lat": "22.541292",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "广东省深圳市福田区福田街道福安社区中心四路1号",
+          "code": "SZKP0001",
+          "enable": "DISABLE",
+          "projectId": "SZXP",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          },
+          "weChatOfficialAccountsAppId": "wxb81a622ed6d60adf"
+        },
+        {
+          "id": "8aaa83397bf7310e017bf7c8fb740009",
+          "name": "前海嘉里中心办公楼",
+          "lng": "113.891891",
+          "lat": "22.527004",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "广东省深圳市南山区南山街道前海嘉里中心",
+          "code": "QHKC0001",
+          "enable": "ENABLE",
+          "projectId": "192",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          },
+          "weChatOfficialAccountsAppId": "wxb81a622ed6d60adf"
+        },
+        {
+          "id": "8aaa83397bf7310e017bf7c95f49000a",
+          "name": "前海湾",
+          "lng": "113.898859",
+          "lat": "22.533041",
+          "format": "APARTMENT",
+          "defaultFlag": false,
+          "address": "广东省深圳市南山区南山街道前海嘉里中心",
+          "code": "QHKC0002",
+          "enable": "ENABLE",
+          "projectId": "192",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          },
+          "weChatOfficialAccountsAppId": "wx2bd99ca94d6acd7e"
+        },
+        {
+          "id": "8aaa82ea804d07cd0180516ff03b0008",
+          "name": "前海嘉湾汇",
+          "lng": "113.898367",
+          "lat": "22.532623",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "深圳市南山区前海蛇口片区前海大道与临海大道交汇处",
+          "code": "QHKC0003",
+          "enable": "ENABLE",
+          "projectId": "192",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          }
+        }
+      ]
+    },
+    {
+      "city": {
+        "id": "4",
+        "name": "天津",
+        "pinyinAbbreviation": "TJ"
+      },
+      "centers": [
+        {
+          "id": "TJYSJ",
+          "name": "天津雅颂居",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "4",
+          "cityName": "天津",
+          "propertyManagementCo": "41008",
+          "propertyDevelopmentCo": "32002",
+          "privacy": false,
+          "formats": "RESIDENCE",
+          "lon": "117.223257",
+          "lat": "39.133301",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-12-15 01:50:23",
+          "lastModifiedDate": "2022-12-15 01:50:23",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "TKC",
+          "name": "天津嘉里中心",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "4",
+          "cityName": "天津",
+          "address": "天津市河东区六纬路238号",
+          "propertyManagementCo": "41008",
+          "propertyDevelopmentCo": "32002",
+          "privacy": false,
+          "note": "3",
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634046075765-hesem5.jpg",
+          "formats": "RETAIL,PARKING",
+          "lon": "117.216952",
+          "lat": "39.127342",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2021-10-12 13:41:17",
+          "lastModifiedDate": "2022-12-14 06:59:46",
+          "lastModifiedBy": "Kevin.BC.Li"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa809f8056fc2001805a5af5760000",
+          "name": "天津嘉里汇",
+          "lng": "117.223578",
+          "lat": "39.133346",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "天津市河东区六纬路238号",
+          "code": "TKC0001",
+          "enable": "ENABLE",
+          "projectId": "TKC",
+          "brand": {
+            "id": "8aaa82ea804d07cd018051736b5c000b",
+            "name": "Kerry+ 天津"
+          },
+          "logo": {
+            "id": "122",
+            "logoName": "Kerry+ 天津",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650633957194891051/Tianjin.png"
+          }
+        }
+      ]
+    }
+  ]
+}

+ 233 - 0
src/api/mockData/cities.dev2.response.json

@@ -0,0 +1,233 @@
+{
+  "code": "000000",
+  "message": "成功",
+  "data": [
+    {
+      "city": {
+        "id": "2",
+        "name": "深圳",
+        "pinyinAbbreviation": "SZ"
+      },
+      "centers": [
+        {
+          "id": "192",
+          "name": "前海嘉里中心",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "2",
+          "cityName": "深圳",
+          "address": "深圳前海",
+          "propertyManagementCo": "31007",
+          "propertyDevelopmentCo": "31038",
+          "privacy": false,
+          "note": "1",
+          "formats": "OFFICE,APARTMENT,PARKING,RETAIL",
+          "lon": "113.892103",
+          "lat": "22.526097",
+          "createdBy": "lisa.cx.lin",
+          "createdDate": "2021-09-09 03:32:27",
+          "lastModifiedDate": "2023-01-09 03:35:33",
+          "lastModifiedBy": "byron.yu"
+        },
+        {
+          "id": "SZXP",
+          "name": "深圳嘉里建设广场",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "2",
+          "cityName": "深圳",
+          "propertyManagementCo": "41006",
+          "propertyDevelopmentCo": "31010",
+          "privacy": false,
+          "formats": "OFFICE,RETAIL,PARKING",
+          "lon": "114.058096",
+          "lat": "22.535934",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-12-15 01:57:02",
+          "lastModifiedDate": "2022-12-15 01:57:02",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "SZKP",
+          "name": "测试广场",
+          "areaId": "2",
+          "areaName": "华南",
+          "cityId": "2",
+          "cityName": "深圳",
+          "address": "深圳",
+          "propertyManagementCo": "41006",
+          "propertyDevelopmentCo": "31010",
+          "privacy": false,
+          "note": "1",
+          "formats": "OFFICE,RETAIL,PARKING",
+          "lon": "114.058096",
+          "lat": "22.535934",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2021-09-09 03:45:49",
+          "lastModifiedDate": "2022-12-15 01:55:46",
+          "lastModifiedBy": "Kevin.BC.Li"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa83397bf7310e017bf7ca147f000b",
+          "name": "深圳嘉里建设广场",
+          "lng": "114.063516",
+          "lat": "22.541292",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "广东省深圳市福田区福田街道福安社区中心四路1号",
+          "code": "SZKP0001",
+          "enable": "DISABLE",
+          "projectId": "SZXP",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          },
+          "weChatOfficialAccountsAppId": "wxb81a622ed6d60adf"
+        },
+        {
+          "id": "8aaa83397bf7310e017bf7c8fb740009",
+          "name": "前海嘉里中心办公楼",
+          "lng": "113.891891",
+          "lat": "22.527004",
+          "format": "OFFICE",
+          "defaultFlag": false,
+          "address": "广东省深圳市南山区南山街道前海嘉里中心",
+          "code": "QHKC0001",
+          "enable": "ENABLE",
+          "projectId": "192",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          },
+          "weChatOfficialAccountsAppId": "wxb81a622ed6d60adf"
+        },
+        {
+          "id": "8aaa83397bf7310e017bf7c95f49000a",
+          "name": "前海湾",
+          "lng": "113.898859",
+          "lat": "22.533041",
+          "format": "APARTMENT",
+          "defaultFlag": false,
+          "address": "广东省深圳市南山区南山街道前海嘉里中心",
+          "code": "QHKC0002",
+          "enable": "ENABLE",
+          "projectId": "192",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          },
+          "weChatOfficialAccountsAppId": "wx2bd99ca94d6acd7e"
+        },
+        {
+          "id": "8aaa82ea804d07cd0180516ff03b0008",
+          "name": "前海嘉湾汇",
+          "lng": "113.898367",
+          "lat": "22.532623",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "深圳市南山区前海蛇口片区前海大道与临海大道交汇处",
+          "code": "QHKC0003",
+          "enable": "ENABLE",
+          "projectId": "192",
+          "brand": {
+            "id": "8aaa81947c6e1ca0017c73c13cc30006",
+            "name": "Kerry+ 深圳"
+          },
+          "logo": {
+            "id": "118",
+            "logoName": "Kerry+ 深圳",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+          }
+        }
+      ]
+    },
+    {
+      "city": {
+        "id": "4",
+        "name": "天津",
+        "pinyinAbbreviation": "TJ"
+      },
+      "centers": [
+        {
+          "id": "TJYSJ",
+          "name": "天津雅颂居",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "4",
+          "cityName": "天津",
+          "propertyManagementCo": "41008",
+          "propertyDevelopmentCo": "32002",
+          "privacy": false,
+          "formats": "RESIDENCE",
+          "lon": "117.223257",
+          "lat": "39.133301",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2022-12-15 01:50:23",
+          "lastModifiedDate": "2022-12-15 01:50:23",
+          "lastModifiedBy": "Kevin.BC.Li"
+        },
+        {
+          "id": "TKC",
+          "name": "天津嘉里中心",
+          "areaId": "4",
+          "areaName": "华北",
+          "cityId": "4",
+          "cityName": "天津",
+          "address": "天津市河东区六纬路238号",
+          "propertyManagementCo": "41008",
+          "propertyDevelopmentCo": "32002",
+          "privacy": false,
+          "note": "3",
+          "photo": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634046075765-hesem5.jpg",
+          "formats": "RETAIL,PARKING",
+          "lon": "117.216952",
+          "lat": "39.127342",
+          "createdBy": "Kevin.BC.Li",
+          "createdDate": "2021-10-12 13:41:17",
+          "lastModifiedDate": "2022-12-14 06:59:46",
+          "lastModifiedBy": "Kevin.BC.Li"
+        }
+      ],
+      "lbs": [
+        {
+          "id": "8aaa809f8056fc2001805a5af5760000",
+          "name": "天津嘉里汇",
+          "lng": "117.223578",
+          "lat": "39.133346",
+          "format": "RETAIL",
+          "defaultFlag": false,
+          "address": "天津市河东区六纬路238号",
+          "code": "TKC0001",
+          "enable": "ENABLE",
+          "projectId": "TKC",
+          "brand": {
+            "id": "8aaa82ea804d07cd018051736b5c000b",
+            "name": "Kerry+ 天津"
+          },
+          "logo": {
+            "id": "122",
+            "logoName": "Kerry+ 天津",
+            "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1650633957194891051/Tianjin.png"
+          }
+        }
+      ]
+    }
+  ]
+}

+ 570 - 0
src/api/mockData/lbs.dev.response.json

@@ -0,0 +1,570 @@
+{
+  "code": "000000",
+  "message": "成功",
+  "data": [
+    {
+      "city": {
+        "id": "2",
+        "name": "深圳",
+        "pinyinAbbreviation": "SZ"
+      },
+      "project": {
+        "id": "192",
+        "name": "前海嘉里中心"
+      },
+      "lbs": {
+        "id": "8aaa83397bf7310e017bf7c8fb740009",
+        "name": "前海嘉里中心办公楼",
+        "lng": "113.891891",
+        "lat": "22.527004",
+        "format": "OFFICE",
+        "defaultFlag": false,
+        "address": "广东省深圳市南山区南山街道前海嘉里中心",
+        "code": "QHKC0001",
+        "enable": "ENABLE",
+        "projectId": "192",
+        "brand": {
+          "id": "8aaa81947c6e1ca0017c73c13cc30006",
+          "name": "Kerry+ 深圳"
+        },
+        "logo": {
+          "id": "118",
+          "logoName": "Kerry+ 深圳",
+          "logoPicture": "https://kip-public-dev.oss-cn-shanghai.aliyuncs.com/1634719300292-2q2oob.jpg"
+        },
+        "weChatOfficialAccountsAppId": "wxb81a622ed6d60adf"
+      },
+      "buildings": [
+        {
+          "building": {
+            "id": "192-192-QHKC-T7",
+            "name": "T7",
+            "projectId": "192",
+            "propertyManagementBU": "43295202",
+            "propertyDeveloperBU": "32054202",
+            "propertyManagementCo": "31007",
+            "propertyDeveloperCo": "31007",
+            "floorNum": 18,
+            "visitorPassportMaxUsage": 0,
+            "visitorValidityInDays": 0,
+            "verifyVisitorIdentity": false,
+            "temporaryVisitorApply": false,
+            "alias": "T7",
+            "formats": "OFFICE",
+            "lbsId": "8aaa83397bf7310e017bf7c8fb740009",
+            "lbsCode": "QHKC0001",
+            "status": "ENABLE",
+            "floorIdSet": [
+              "8aaa8194830c63e7018316b59d4e0000",
+              "8aaa801882d454f30182d46c0efc0001",
+              "8aaa801882d454f30182d46c228d0002",
+              "8aaa801882d454f30182d46c465d0004",
+              "8aaa801882d454f30182d46c34340003",
+              "8aaa8194830c63e7018316b5ba640001",
+              "8aaa801882d454f30182d46bb6970000"
+            ]
+          },
+          "tenants": [
+            {
+              "id": "8aaa801982d7f44b0182d82ba0610000",
+              "brandName": "前海二期T7办公测试租户一",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa801882d454f30182d59fdd94000e",
+                "8aaa801882d454f30182d59fdd94000f"
+              ],
+              "floorIdSet": [
+                "8aaa801882d454f30182d46c0efc0001",
+                "8aaa801882d454f30182d46bb6970000"
+              ],
+              "buildingIdSet": [
+                "192-192-QHKC-T7"
+              ]
+            },
+            {
+              "id": "8aaa87ce8316b659018316ba2dca0004",
+              "name": "前海二期T7低区测试租户二",
+              "brandName": "前海二期T7低区测试租户二zxr",
+              "status": "DISABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 50.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa87ce8316b659018316b7208a0001"
+              ],
+              "floorIdSet": [
+                "8aaa8194830c63e7018316b59d4e0000"
+              ],
+              "buildingIdSet": [
+                "192-192-QHKC-T7"
+              ],
+              "doCoSet": [
+                "279417"
+              ]
+            },
+            {
+              "id": "8aaa87ce8316b659018316b9cd170002",
+              "name": "前海二期T7高区测试租户四",
+              "brandName": "前海二期T7高区测试租户四",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 100.01,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa87ce8316b659018316b720820000"
+              ],
+              "floorIdSet": [
+                "8aaa8194830c63e7018316b5ba640001"
+              ],
+              "buildingIdSet": [
+                "192-192-QHKC-T7"
+              ],
+              "doCoSet": [
+                "279419"
+              ]
+            }
+          ]
+        },
+        {
+          "building": {
+            "id": "QHKC-T1",
+            "name": "T1",
+            "projectId": "192",
+            "propertyManagementBU": "41225200,43285200",
+            "propertyDeveloperBU": "31384200",
+            "propertyManagementCo": "31007",
+            "propertyManagementName": "嘉里建设管理(上海)有限公司前海分公司",
+            "propertyDeveloperCo": "31007",
+            "propertyDeveloperName": "寰安置业(深圳)有限公司",
+            "floorNum": 29,
+            "visitorPassportMaxUsage": 0,
+            "visitorValidityInDays": 0,
+            "verifyVisitorIdentity": false,
+            "temporaryVisitorApply": false,
+            "alias": "T1",
+            "formats": "OFFICE",
+            "lbsId": "8aaa83397bf7310e017bf7c8fb740009",
+            "lbsCode": "QHKC0001",
+            "status": "ENABLE",
+            "lon": "113.892103",
+            "lat": "22.526097",
+            "floorIdSet": [
+              "8aaa836f850e445901850ed3e868001c",
+              "8aaa827a82396aed01823df1e3ed000d",
+              "4028e3817bce7d8e017bce7dc0310000",
+              "8aaa83f87becd1fe017bed71a2f90016",
+              "8aaa836f850e445901850ed444460020",
+              "4028e3817bdcbcb9017bdcbf01770004",
+              "4028e3817bdcbcb9017bdcbf01770003",
+              "4028e3817bdcbcb9017bdcbf01770002",
+              "4028e3817bdcbcb9017bdcbf01770001",
+              "8aaa836f850e445901850ed3fbf5001d",
+              "8aaa849d7bcf2b8b017bdcce9e630003",
+              "8aaa836f850e445901850ed38bc80018",
+              "8aaa83987bc9c2e8017bca18e13d0006",
+              "8aaa836f850e445901850ed3bd9d001a",
+              "8aaa836f850e445901850ed3708f0017",
+              "8aaa87967ee19ada017ee2ea52b70002",
+              "8aaa836f850e445901850ed4148d001e",
+              "8aaa89827be2e831017be33775be0000",
+              "8aaa895f7bcdd01f017bce3d2fe70000",
+              "8aaa82007ee7e8ca017ee7f37e840001",
+              "8aaa84767bc4837f017bc9381fa20014",
+              "8aaa82007ee7e8ca017ee7f4bafb0002",
+              "8aaa87387d230b9d017d231be0420000",
+              "8aaa87967ee19ada017ee2df57430001",
+              "8aaa836f850e445901850ed33c860015",
+              "8aaa836f850e445901850ed353e60016",
+              "8aaa836f850e445901850ed3a7ff0019",
+              "8aaa836f850e445901850ed42b1c001f",
+              "8aaa82007ee7e8ca017ee7f11c7c0000",
+              "8aaa836f850e445901850ed3d0ac001b",
+              "4028e3817bdcbcb9017bdcbfd1cd0001"
+            ]
+          },
+          "tenants": [
+            {
+              "id": "8aaa89587bca444b017bcd45984d0002",
+              "name": "环球影画(北京)咨询有限公司",
+              "brandName": "环球影画",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": true,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa89587bca444b017bcd4300780000"
+              ],
+              "floorIdSet": [
+                "8aaa83987bc9c2e8017bca18e13d0006"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ],
+              "passageIdSet": [
+                "8aaa899c7be74804017be760691a0007"
+              ],
+              "doCoSet": [
+                "271988"
+              ]
+            },
+            {
+              "id": "8aaa827a82396aed01823dff1b540010",
+              "name": "M前海T1租户1",
+              "brandName": "M前海测试租户4",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa827a82396aed0182399b6f110006"
+              ],
+              "floorIdSet": [
+                "8aaa83987bc9c2e8017bca18e13d0006"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ],
+              "doCoSet": [
+                "279387"
+              ]
+            },
+            {
+              "id": "8aaa806480226c50018045c7774a0006",
+              "brandName": "kevin-test",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa81b87c7cdf9f017c7fbf34eb0068"
+              ],
+              "floorIdSet": [
+                "8aaa849d7bcf2b8b017bdcce9e630003"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ]
+            },
+            {
+              "id": "4028e3817deb9d27017deba250cb0003",
+              "brandName": "肯德基",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": true,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "4028e3817dd6b7d7017dd6bc62bd0000"
+              ],
+              "floorIdSet": [
+                "8aaa849d7bcf2b8b017bdcce9e630003"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ],
+              "passageIdSet": [
+                "8aaa84767bc4837f017bc9383a840015",
+                "8aaa899c7be74804017be760691a0007"
+              ]
+            },
+            {
+              "id": "8aaa80b281dd3e620181ebd2edb9000b",
+              "brandName": "Zucker-test",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": true,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa827a82396aed0182399b6f110007",
+                "4028e3817c77b5bc017c77bbdf1c01a4",
+                "8aaa827a82396aed01823dfd8e65000e",
+                "4028e3817c77b5bc017c77bc10ab0244",
+                "8aaa827a82396aed01823dfd8e66000f",
+                "4028e3817c77b5bc017c77bc159e0256",
+                "4028e3817c77b5bc017c77bc11290246",
+                "8aaa827a82396aed0182399b6f110006"
+              ],
+              "floorIdSet": [
+                "8aaa895f7bcdd01f017bce3d2fe70000",
+                "8aaa827a82396aed01823df1e3ed000d",
+                "8aaa84767bc4837f017bc9381fa20014",
+                "8aaa849d7bcf2b8b017bdcce9e630003",
+                "8aaa83987bc9c2e8017bca18e13d0006"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ],
+              "passageIdSet": [
+                "8aaa80bc7d326b0e017d3605dff60078"
+              ]
+            },
+            {
+              "id": "8aaa84d87be8203e017be8d233c50003",
+              "brandName": "XXX",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa89827be2e831017be33816300001"
+              ],
+              "floorIdSet": [
+                "8aaa84767bc4837f017bc9381fa20014"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ]
+            },
+            {
+              "id": "8aaa820881f111510181f13470da0000",
+              "brandName": "前海办公测试租户1",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": true,
+              "area": 34.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa89587bca444b017bcd4300780000"
+              ],
+              "floorIdSet": [
+                "8aaa83987bc9c2e8017bca18e13d0006"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ]
+            },
+            {
+              "id": "8aaa89827be2e831017be33fca990004",
+              "brandName": "培训演示公司",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": true,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa89827be2e831017be33816300001",
+                "8aaa89827be2e831017be33816400002"
+              ],
+              "floorIdSet": [
+                "8aaa84767bc4837f017bc9381fa20014"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ],
+              "passageIdSet": [
+                "8aaa84767bc4837f017bc9383a840015",
+                "8aaa899c7be74804017be760691a0007"
+              ]
+            },
+            {
+              "id": "8aaa82d28359bf3d01835ec748ae0002",
+              "brandName": "test-tenant",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa81b87c7cdf9f017c7fbf34eb0068",
+                "8aaa8a1b7bdd629a017be1d15f250016"
+              ],
+              "floorIdSet": [
+                "8aaa849d7bcf2b8b017bdcce9e630003"
+              ],
+              "buildingIdSet": [
+                "QHKC-T1"
+              ]
+            }
+          ]
+        },
+        {
+          "building": {
+            "id": "QHKC-T2",
+            "name": "T2",
+            "projectId": "192",
+            "propertyManagementBU": "41225200,43285200",
+            "propertyDeveloperBU": "31384200",
+            "propertyManagementCo": "31007",
+            "propertyDeveloperCo": "31007",
+            "floorNum": 29,
+            "visitorPassportMaxUsage": 0,
+            "visitorValidityInDays": 0,
+            "verifyVisitorIdentity": false,
+            "temporaryVisitorApply": false,
+            "alias": "T2",
+            "formats": "OFFICE",
+            "lbsId": "8aaa83397bf7310e017bf7c8fb740009",
+            "lbsCode": "QHKC0001",
+            "status": "ENABLE",
+            "lon": "120",
+            "lat": "20",
+            "floorIdSet": [
+              "8aaa836f850e445901850ed89e61002e",
+              "8aaa836f850e445901850ed7bded0024",
+              "8aaa82fc7d11fee4017d213d6b9e0002",
+              "8aaa836f850e445901850ed906ff0031",
+              "8aaa836f850e445901850ed945fd0034",
+              "8aaa836f850e445901850ed8827c002d",
+              "8aaa836f850e445901850ed8b78a002f",
+              "8aaa836f850e445901850ed7a93d0023",
+              "8aaa836f850e445901850ed9956f0037",
+              "8aaa836f850e445901850ed84fc7002b",
+              "8aaa836f850e445901850ed7e5b30026",
+              "8aaa836f850e445901850ed9b67b0038",
+              "8aaa836f850e445901850ed9da0b0039",
+              "8aaa80677d02c241017d02ebb5180000",
+              "8aaa836f850e445901850ed9173b0032",
+              "8aaa827a82396aed018239a4a9cd0008",
+              "8aaa836f850e445901850ed81f2f0029",
+              "8aaa836f850e445901850ed7f7eb0027",
+              "8aaa836f850e445901850ed7978a0022",
+              "8aaa836f850e445901850ed80c670028",
+              "8aaa836f850e445901850ed95e2e0035",
+              "8aaa836f850e445901850ed8684d002c",
+              "8aaa82fc7d11fee4017d213d921e0003",
+              "8aaa836f850e445901850ed975a40036",
+              "8aaa87307f9aff6a017f9c14d60a0000",
+              "8aaa80cb8200cc45018200ed19b60004",
+              "8aaa836f850e445901850ed929e10033",
+              "8aaa836f850e445901850ed784170021",
+              "8aaa836f850e445901850ed833a5002a",
+              "8aaa836f850e445901850ed8f7560030",
+              "8aaa836f850e445901850ed7d31b0025"
+            ]
+          },
+          "tenants": [
+            {
+              "id": "8aaa80377d9cc8c8017d9e199ce10006",
+              "name": "M前海T2测试租户3",
+              "brandName": "T2培训演示",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa827a82396aed018239a535720009"
+              ],
+              "floorIdSet": [
+                "8aaa827a82396aed018239a4a9cd0008"
+              ],
+              "buildingIdSet": [
+                "QHKC-T2"
+              ],
+              "doCoSet": [
+                "279389"
+              ]
+            },
+            {
+              "id": "8aaa80cb8200cc45018200e2f9410000",
+              "name": "M前海T2租户",
+              "brandName": "前海办公测试租户2",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa827a82396aed018239a535720009",
+                "8aaa80cb8200cc45018200e906200002",
+                "8aaa827a82396aed018239a53572000a",
+                "8aaa80cb8200cc45018200ede8850005"
+              ],
+              "floorIdSet": [
+                "8aaa80677d02c241017d02ebb5180000",
+                "8aaa80cb8200cc45018200ed19b60004",
+                "8aaa827a82396aed018239a4a9cd0008"
+              ],
+              "buildingIdSet": [
+                "QHKC-T2"
+              ],
+              "doCoSet": [
+                "272010",
+                "279388",
+                "271998"
+              ]
+            }
+          ]
+        },
+        {
+          "building": {
+            "id": "192-QHKC-T8",
+            "name": "T8",
+            "projectId": "192",
+            "propertyManagementBU": "43295201",
+            "propertyDeveloperBU": "32054201",
+            "propertyManagementCo": "31007",
+            "propertyDeveloperCo": "31007",
+            "floorNum": 27,
+            "visitorPassportMaxUsage": 0,
+            "visitorValidityInDays": 0,
+            "verifyVisitorIdentity": false,
+            "temporaryVisitorApply": false,
+            "alias": "T8",
+            "formats": "OFFICE",
+            "lbsId": "8aaa83397bf7310e017bf7c8fb740009",
+            "lbsCode": "QHKC0001",
+            "status": "ENABLE",
+            "floorIdSet": [
+              "8aaa801882d454f30182d46cb9ad0009",
+              "8aaa801882d454f30182d46c6c430005",
+              "8aaa801882d454f30182d46c7fcc0006",
+              "8aaa801882d454f30182d46c93630007",
+              "8aaa801882d454f30182d46ca5a70008"
+            ]
+          },
+          "tenants": [
+            {
+              "id": "8aaa801982d7f44b0182d82c399e0002",
+              "name": "前海二期T8办公测试租户一",
+              "brandName": "前海二期T8办公测试租户一",
+              "status": "ENABLE",
+              "administrativeToiletEnabled": true,
+              "useFlexibleSpace": true,
+              "salesReported": false,
+              "area": 0.00,
+              "visitorAccessApproveSwitch": true,
+              "roomIdSet": [
+                "8aaa801882d454f30182d59fddd20013"
+              ],
+              "floorIdSet": [
+                "8aaa801882d454f30182d46cb9ad0009"
+              ],
+              "buildingIdSet": [
+                "192-QHKC-T8"
+              ],
+              "doCoSet": [
+                "279412"
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 12 - 0
src/api/parking/index.js

@@ -36,3 +36,15 @@ export function orderInfo(orderId) {
 export function orders(params) {
   return window.requestms.get(`/orders`, { params, loading: true });
 }
+
+// 1.20 用户优惠信息校验
+export function calculateDiscount(params) {
+  return window.requestms.post(`/parking/calculate-discount`, params, {
+    loading: true,
+  });
+}
+
+// 1.13 下单并发起支付
+export function ordersAndPrepay(params) {
+  return window.requestms.post(`/orders-and-prepay`, params, { loading: true });
+}

+ 26 - 14
src/api/request.js

@@ -81,7 +81,7 @@ const cancelLoading = () => {
 
 export const createAxiosByinterceptors = (config) => {
   const instance = axios.create({
-    timeout: 1000, //超时配置
+    timeout: 100000, //超时配置
     baseURL: `${window.profileApi}/temporary-parking-service`,
     // baseURL: `https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service`,
     withCredentials: true, //跨域携带cookie
@@ -99,21 +99,27 @@ export const createAxiosByinterceptors = (config) => {
         ...config.headers,
         ...handleConfig().header,
         'X-Conversation-Id': uuidv4(),
-        // 'X-User': JSON.stringify({
-        //   userId: store.state.member.id, // K+用户ID
-        //   sourceType: 'WECHAT', // 登录来源: WECHAT/ALIPAY/H5/APP
-        //   cId: store.state.openId, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-        //   // projectId: store.state.member.groupId, // 楼盘id
-        //   projectId: '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id
-        //   // buildingId: store.state.member.mallid, // 楼栋id
-        //   // buildingId: '8aaa80b47c784020017c78b00d060022', // 楼栋id
-        //   buildingId: 'shenzhen01', // 楼栋id
-        //   mobile: store.state.mobile, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-        //   vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-        // })
+        /*'X-User': JSON.stringify({"userId": "5106534569910475","sourceType": "WECHAT","nickName": "yedUsFwdkelQbxeTeQOvaScfqIOOmaa","mobile": "18521563898","projectId": "paroject1","buildingId": "shenzhen01","cid": "8aaa809d835ba76d018378bc57180006","vipCode":"KERRY100213505"})*/
+        'X-User': JSON.stringify({
+          // userId: store.state.member.id, // K+用户ID
+          userId: '36cec68f3a9a4f4b9e04a59268ba20f2', // K+用户ID
+          sourceType: 'WECHAT', // 登录来源: WECHAT/ALIPAY/H5/APP
+          cId: store.state.openid, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+          // projectId: store.state.member.groupId, // 楼盘id
+          projectId: store.state.projectId || '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id
+          // buildingId: store.state.member.mallid, // 楼栋id
+          // buildingId: '8aaa80b47c784020017c78b00d060022', // 楼栋id
+          // buildingId: store.state.buildingId || 'shenzhen01', // 楼栋id
+          buildingId: store.state.buildingId || 'QHKC-P1', // 楼栋id
+          phoneNumber: store.state.mobile, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+          // vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+          // vipCode: 'KERRY100213815', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+          vipCode: 'KERRY100213505', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+        })
       }
       // console.log(111111, config.headers, handleConfig().header)
       // console.log(111111, handleConfig().header)
+      // console.log(123, config);
       return config;
     },
     function (error) {
@@ -148,6 +154,8 @@ export const createAxiosByinterceptors = (config) => {
       }*/
     },
     function (error) {
+      // console.log(158, error.response.data)
+
       // 对响应错误做点什么
       console.log('error-response:', error.response);
       console.log('error-config:', error.config);
@@ -162,8 +170,12 @@ export const createAxiosByinterceptors = (config) => {
         }
       }
       // 错误信息提示
+      const {code, langMessage } = error.response.data
+      if ( code === 'INTERNAL_SERVER_ERROR') {
+        uni.showToast({title:langMessage, duration: 3000,icon: 'fail'})
+      }
       // Message.error(error?.response?.data?.message || '服务端异常');
-      return Promise.reject(error);
+      return Promise.reject(error.response.data);
     }
   );
   return instance;

+ 26 - 0
src/common/js/BaseDictionary.js

@@ -35,6 +35,23 @@ const HKC = {
     projectId: '186',
   },
 };
+
+const QHKC = {
+  qa: {
+    ...testAppIdInfo,
+    groupId: '8a84819f7c6e260e017c72669bbe01c2',
+    mallId: '8a8486a37f48f7bd017f4e5bddd10000',
+    projectId: 'HKC',
+  },
+  prod: {
+    // TODO: 等待对应公众号上线
+    ...testAppIdInfo,
+    groupId: '8a888a087cc59dc0017cc622f9ad0000',
+    mallId: '8a88a9fd7f73ffcd017f968739870006',
+    projectId: '186',
+  },
+}
+
 export const lbsDictionary = {
   '8aaa87bc7ce98224017ce995fd8a0002': {
     ...SKC,
@@ -57,6 +74,15 @@ export const lbsDictionary = {
   '8a8883557cca9463017ccaedb04f0000': {
     ...HKC,
   },
+  '8aaa83397bf7310e017bf7c8fb740009': {
+    ...QHKC,
+  },
+  '8a84819f7c6e260e017c72315c9f01c1': {
+    ...QHKC,
+  },
+  '8a8884e77cc9e70a017cca3ad6170006': {
+    ...QHKC,
+  }
 };
 
 

+ 3 - 3
src/pages/parkingFee/components/base/parkingFee.vue

@@ -222,11 +222,11 @@
 </template>
 
 <script>
-import homeJs from '../../mixins/home';
+import parkingFeeJs from '../../mixins/parkingFee';
 
 export default {
-  mixins: [homeJs],
-  name: 'baseCom',
+  mixins: [parkingFeeJs],
+  name: 'parkingFeeCom',
 };
 </script>
 

+ 3 - 2
src/pages/parkingFee/components/officeBlue/home.vue → src/pages/parkingFee/components/officeBlue/parkingFee.vue

@@ -187,9 +187,10 @@
 </template>
 
 <script>
-import homeJs from '../../mixins/home';
+import parkingFeeJs from '../../mixins/parkingFee';
+
 export default {
-  mixins: [homeJs],
+  mixins: [parkingFeeJs],
   name: 'officeBlueCom',
 };
 </script>

+ 12 - 12
src/pages/parkingFee/components/officeBlue/parkingFeeCoupon.vue

@@ -3,18 +3,17 @@
     <scroll-view scroll-y="true" class="scroll-Y">
       <div class="parkingFeeCoupon">
         <van-checkbox-group
-          v-model="checkedCouponList"
-          @change="checkboxChange"
+          :value="checkedCouponList"
         >
-          <div class="card-list" v-if="list.length">
-            <div class="item" v-for="(item, index) in list" :key="index">
+          <div class="card-list" v-if="couponList.length">
+            <div class="item" v-for="(item, index) in couponList" :key="index">
               <div class="item-image cro">
                 <div class="cro_right_top"></div>
                 <div class="cro_right_bottom"></div>
                 <div class="img">
                   <div>
                     <span style="font-weight: bold; color: #064c8a">¥</span>
-                    <span class="itemValue">{{ item.value }}</span>
+                    <span class="itemValue">{{ item.discountFee }}</span>
                   </div>
                   <span style="color: #064c8a; font-size: 30px">停车劵</span>
                 </div>
@@ -23,15 +22,16 @@
                 <div class="cro_left_top"></div>
                 <div class="cro_left_bottom"></div>
                 <div class="content">
-                  <span class="h3">{{ item.ticketName }}</span>
-                  <span class="span">有效期至 {{ item.cancelEndTime }}</span>
+                  <span class="h3">{{ item.name }}</span>
+                  <span class="span">有效期至 {{ item.expirationDate }}</span>
                 </div>
                 <div class="erwm_box">
                   <van-checkbox
                     color="#fff"
+                    @click="checkboxItemChange(`coupon${index}`, index)"
                     checked-color="#064C8A"
                     :disabled="item.disabled"
-                    :name="index"
+                    :name="`coupon${index}`"
                   />
                 </div>
               </div>
@@ -44,7 +44,7 @@
         </van-checkbox-group>
         <!-- 为避免冲突,小程序 和 H5 跳转 CRM小程序:积分商城 的逻辑分开处理 -->
         <div
-          :class="['guide-box', 'mgb-110', !list?.length && 'flex-bottom']"
+          :class="['guide-box', 'mgb-110', !couponList?.length && 'flex-bottom']"
           v-if="platform === 'miniprogram'"
         >
           <div class="guide-title">优惠券兑换指导</div>
@@ -55,7 +55,7 @@
           </div>
         </div>
         <div
-          :class="['guide-box', 'mgb-110', !list?.length && 'flex-bottom']"
+          :class="['guide-box', 'mgb-110', !couponList?.length && 'flex-bottom']"
           v-if="platform === 'micromessenger'"
         >
           <div class="guide-title">优惠券兑换指导</div>
@@ -85,10 +85,10 @@
         <div style="color: #333; font-size: 24px; padding-top: 5px">合计:</div>
         <div class="actualFee-box">
           <div style="color: #333333; font-size: 32px; padding-left: 5px">
-            {{ actualFee | currency }}
+            {{ actualPayFee | currency }}
           </div>
           <div style="color: #ee4d3f; font-size: 24px; padding-left: 5px">
-            已优惠{{ discountFee | currency }}元
+            已优惠{{ usingTotalDiscount | currency }}元
           </div>
         </div>
       </div>

+ 36 - 59
src/pages/parkingFee/components/officeBlue/parkingFeeDetail.vue

@@ -1,7 +1,7 @@
 <template>
-  <div>
+  <div v-if="orderDetail && orderDetail.parkingRecord && orderDetail.parkingRecord.vehicleNo">
     <scroll-view class="scroll-Y">
-      <div>
+      <div >
         <!-- <div @click="scan">扫一扫</div> -->
         <div class="warp">
           <div
@@ -10,41 +10,38 @@
               warp_index1: true,
             }"
           >
-            {{ parkInfo.carno | formatCarno }}
+            {{ orderDetail.parkingRecord.vehicleNo | formatCarno }}
+            <!-- {{ $route.query.carno | formatCarno }} -->
           </div>
           <div class="warp_index">
             <div>停车场</div>
-            <div class="warp_index_color">{{ parkInfo.parkname }}</div>
+            <div class="warp_index_color">{{ orderDetail.parkInfo.parkName }}</div>
           </div>
           <div class="warp_index">
             <div>入场时间</div>
-            <div class="warp_index_color">{{ parkInfo.entertime }}</div>
+            <div class="warp_index_color">{{ orderDetail.parkingRecord.enterTime }}</div>
           </div>
           <div class="warp_index">
             <div>已停车时长</div>
-            <div class="warp_index_color">{{ parkingTime }}</div>
+            <div class="warp_index_color">{{ orderDetail.parkingRecord.serviceMin }}</div>
           </div>
           <div class="warp_index">
             <div>应缴</div>
             <div class="warp_index_color">
-              {{ (parkInfo.servicefee / 100) | currency }}
+              {{ (orderDetail.parkingRecord.totalFee / 100) | currency }}
             </div>
           </div>
         </div>
         <div class="warp">
           <div
             class="warp_index warp_index_da"
-            v-if="
-              parkFee.parkInfoEntity &&
-              (parkFee.parkInfoEntity.consumeReduce ||
-                parkFee.parkInfoEntity.memberLevelReduce)
-            "
+            v-if="enableConsume"
           >
             <div>停车优惠</div>
             <div class="warp_index_color" @click="discounts">
               <div
                 style="margin-right: 10px"
-                :class="hasDiscount ? 'text-red' : ''"
+                :class="discountDesc === '暂无可用优惠' ?  '' : 'text-red'"
               >
                 {{ discountDesc }}
               </div>
@@ -54,17 +51,14 @@
           </div>
           <div
             class="warp_index warp_index_da"
-            v-if="
-              parkFee.parkInfoEntity &&
-              parkFee.parkInfoEntity.isuseintegral === 1
-            "
+            v-if="enablePoints"
           >
             <div>积分减免</div>
-            <div class="warp_index_color" @click="toggle('bottom')">
+            <div class="warp_index_color" @click="showPointsMathPopup('bottom')">
               <div
                 style="margin-right: 10px"
                 :class="
-                  bonusCopy > integral || duration ? 'text-red' : 'text-disable'
+                  integralDesc === '今日已达上限' ? 'text-disable' : 'text-red'
                 "
               >
                 {{ integralDesc }}
@@ -75,15 +69,13 @@
           </div>
           <div
             class="warp_index warp_index_da"
-            v-if="
-              parkFee.parkInfoEntity && parkFee.parkInfoEntity.isuseticket === 1
-            "
+            v-if="enableCoupon"
           >
             <div>优惠劵</div>
             <div class="warp_index_color" @click="coupon">
               <div
                 style="margin-right: 10px"
-                :class="couponCount > 0 ? 'text-red' : 'text-disable'"
+                :class="maxOneDayCoupons > 0 ? 'text-red' : 'text-disable'"
               >
                 {{ couponDesc }}
               </div>
@@ -94,11 +86,7 @@
           <!-- 纸质券 -->
           <div
             class="warp_index warp_index_da"
-            v-if="
-              (parkFee.parkInfoEntity &&
-                parkFee.parkInfoEntity.papercoupons === 1) ||
-              isShowPapercoupons
-            "
+            v-if="enablePaperCoupons"
           >
             <div>纸质优惠劵</div>
             <div class="warp_index_color" @click="paperCoupon">
@@ -117,7 +105,7 @@
           >
             <div>优惠金额:</div>
             <div class="warp_index_color" style="color: #333">
-              -{{ discountTotalFee | currency }}
+              -{{ usingTotalDiscount | currency }}
             </div>
           </div>
           <div
@@ -125,32 +113,32 @@
           >
             <div>应付金额:</div>
             <div class="warp_index_color" style="color: #333">
-              {{ actualFee | currency }}
+              {{ actualPayFee | currency }}
             </div>
           </div>
         </div>
         <div
           class="top_content"
-          v-if="parkFee.parkInfoEntity && parkFee.parkInfoEntity.payinstruction"
+          v-if="orderDetail.parkInfo && orderDetail.parkInfo.description"
         >
           <div class="title_box">
             <span class="title">缴费说明</span>
           </div>
-          <div class="info" :class="!isShow ? 'info_show' : ''">
-            <span>{{ parkFee.parkInfoEntity.payinstruction }}</span>
+          <div class="info" :class="!isShowDescription ? 'info_show' : ''">
+            <span>{{ orderDetail.parkInfo.description }}</span>
           </div>
 
           <div
             class="top_down"
             @click="togglePayinstruction"
-            v-if="!isShow && parkFee.parkInfoEntity.payinstruction.length > 60"
+            v-if="!isShowDescription && orderDetail.parkInfo.description.length > 60"
           >
             <van-icon name="arrow-down" />
           </div>
           <div
             class="top_down"
             @click="togglePayinstruction"
-            v-if="isShow && parkFee.parkInfoEntity.payinstruction.length > 60"
+            v-if="isShowDescription && orderDetail.parkInfo.description.length > 60"
           >
             <van-icon name="arrow-up" />
           </div>
@@ -171,16 +159,16 @@
     <div class="flewx">
       <div class="flewx-content">
         合计<span style="color: #333; font-size: 36px; padding-left: 20px">{{
-          actualFee | currency
+          actualPayFee | currency
         }}</span>
         <span style="color: #dc5948; padding-left: 30px; font-size: 28px"
-        >已优惠{{ discountTotalFee | currency }}元</span
+        >已优惠{{ usingTotalDiscount | currency }}元</span
         >
         <!-- <van-count-down :time="3 * 60 * 1000" /> -->
         <div class="count-down-box">
           <van-count-down
-            v-if="payCarno"
+            v-if="orderDetail.parkingRecord.vehicleNo"
             format="mm:ss"
             :time="refreshTime * 1000"
             @finish="resetCountDown()"
@@ -213,29 +201,29 @@
         <div class="popue_box_index">
           <div>减免规则</div>
           <div style="color: #999999">
-            {{ integral }}积分抵扣{{
-              parkMallCode === 5 ? integralToValue + '元' : '1小时'
+            {{ pointsPerHour }}积分抵扣{{
+              orderDetail.parkInfo.parkMallCode === 5 ? integralToValue + '元' : '1小时'
             }}
           </div>
         </div>
         <div class="popue_box_index">
           <div>可用积分</div>
-          <div style="color: #999999">{{ bonus }}分</div>
+          <div style="color: #999999">{{ available }}分</div>
         </div>
         <div class="popue_box_index">
-          <div>抵扣{{ parkMallCode === 5 ? '金额' : '时长' }}</div>
+          <div>抵扣{{ orderDetail.parkInfo.parkMallCode === 5 ? '金额' : '时长' }}</div>
           <div class="popue_box_index" style="width: 325px">
             <div class="popue_box_index4_xs">
-              <div class="popue_box_index4_xs_index1" @click="durationMinus">
+              <div class="popue_box_index4_xs_index1" @click="$store.dispatch('order/pointsMath',{type: 'minus'})">
                 -
               </div>
-              <div class="popue_box_index4_xs_index2">{{ duration }}</div>
-              <div class="popue_box_index4_xs_index3" @click="durationAdd">
+              <div class="popue_box_index4_xs_index2">{{ pointsTime }}</div>
+              <div class="popue_box_index4_xs_index3" @click="$store.dispatch('order/pointsMath',{type: 'add'})">
                 +
               </div>
             </div>
             <div style="color: #808080">
-              {{ parkMallCode === 5 ? '元' : '小时' }}
+              {{ orderDetail.parkInfo.parkMallCode === 5 ? '元' : '小时' }}
             </div>
           </div>
         </div>
@@ -243,20 +231,16 @@
           <div
             :class="{
               popue_box_index4_by: true,
-              blue_popue_box_index4_by: custTypeId === 1,
-              green_popue_box_index4_by: custTypeId === 2,
             }"
-            @click="cancel(1)"
+            @click="cancelPointsMathPopup()"
           >
             取消
           </div>
           <div
             :class="{
               popue_box_index4_by1: true,
-              blue_popue_box_index4_by1: custTypeId === 1,
-              green_popue_box_index4_by1: custTypeId === 2,
             }"
-            @click="confirm(1)"
+            @click="savePointsMathPopup()"
           >
             确定
           </div>
@@ -1205,13 +1189,6 @@ export default {
     border: 1px solid #064c8a;
   }
 
-  .blue_popue_box_index4_by1 {
-    .color-background-color('blue');
-  }
-
-  .green_popue_box_index4_by1 {
-    .color-background-color('green');
-  }
 }
 
 .text-purple {

+ 21 - 41
src/pages/parkingFee/mixins/home.js → src/pages/parkingFee/mixins/parkingFee.js

@@ -13,7 +13,7 @@ import uni from '@/utils/uniHooks';
 // import greenCom from '../components/green/home.vue';
 // import officeBlueCom from '../components/officeBlue/home.vue';
 // import purpleCom from '../components/purple/home.vue';
-import { parkingLots, checkOut } from '@/api/parking';
+import { parkingLots } from '@/api/parking';
 
 export default {
   components: {
@@ -91,7 +91,6 @@ export default {
       });
     }, 300);
     if (this.openid) {
-      console.log(939393939393);
       this.getParkInfo();
       this.showSq = false;
     } else {
@@ -341,20 +340,33 @@ export default {
       uni.setStorageSync('carList', [
         ...new Set([this.vehicleNumber, ...this.carList]),
       ]);
+      this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
+        name: 'parkingFeeDetail',
+      });
       this.$router.push({
         path: 'parkingFeeDetail',
         query: {
-          carno: this.vehicleNumber,
+          vehicleNo: this.vehicleNumber,
         },
       });
-
-      // this.throttle(() => {
-      //   this.handleSearch(this.vehicleNumber);
-      // }, 3000);
     },
     // 历史车牌快速查询
     toHandleSearch(carno) {
-      uni.getStorageSync('carList');
+      // uni.getStorageSync('carList');
+
+      uni.setStorageSync('carList', [...new Set([carno, ...this.carList])]);
+
+      this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
+        name: 'parkingFeeDetail',
+      });
+
+      this.$router.push({
+        path: 'parkingFeeDetail',
+        query: {
+          vehicleNo: carno,
+        },
+      });
+
       // this.throttle(() => {
       //   this.handleSearch(carno, '$ClickHistoryAndPayment');
       // }, 3000);
@@ -420,7 +432,7 @@ export default {
             this.$router.push({
               path: 'parkingFeeDetail',
               query: {
-                carno,
+                vehicleNo: carno,
               },
             });
             parkTime = res.data?.data?.serviceMin;
@@ -497,39 +509,7 @@ export default {
 
       // 纸质优惠券
       uni.removeStorageSync('paperCouponInfo');
-      // uni.removeStorageSync('isReload');
     },
-    // 车牌号校验
-    // isVehicleNumber(vehicleNumber) {
-    // 	if (vehicleNumber.length == 7) {
-    // 		this.vehicleNumber = vehicleNumber.join('')
-    // 		var express =
-    // 			/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/;
-    // 		if (!express.test(this.vehicleNumber)) {
-    // 			uni.showToast({
-    // 				title: '请输入正确的车牌号',
-    // 				duration: 2000,
-    // 				icon: 'none'
-    // 			})
-    // 			return false
-    // 		}
-    // 		return true
-    // 	}
-    // 	if (vehicleNumber.length == 8) {
-    // 		this.vehicleNumber = vehicleNumber.join('')
-    // 		var express =
-    // 			/^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[a-zA-Z](([DF]((?![IO])[a-zA-Z0-9](?![IO]))[0-9]{4})|([0-9]{5}[DF]))|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$/;
-    // 		if (!express.test(this.vehicleNumber)) {
-    // 			uni.showToast({
-    // 				title: '请输入正确的车牌号',
-    // 				duration: 2000,
-    // 				icon: 'none'
-    // 			})
-    // 			return false
-    // 		}
-    // 		return true
-    // 	}
-    // },
     // 缴费记录
     doRouter: function () {
       if (this.$store.state.isLogin === '3') {

+ 263 - 336
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -1,267 +1,170 @@
-
 import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
 // import { initWxJsSdkConfig } from '@/utils/login';
 import { Toast } from 'vant';
 import { getPlatform, getAppIdByGroupIdAndMallId, isInWeixinH5 } from '@/utils';
 import { initWxJsSdkConfig } from '@/utils/login';
+import { compare } from '@/utils/location.js';
+// import { v4 as uuidv4 } from 'uuid';
 
 export default {
-  created() {
-    // 纸质优惠券
-    if (uni.getStorageSync('paperCouponInfo')) {
-      this.paperCouponFee =
-        uni.getStorageSync('paperCouponInfo').paperDiscountFee || 0;
-    }
-    this.servicefee = uni.getStorageSync('servicefee'); // 应缴金额
-    this.parkDiscountTotal = uni.getStorageSync('parkingTotal'); // 总停车优惠
-    // 本页面数据缓存
-    this.couponInfo = uni.getStorageSync('couponInfo');
-    if (this.couponInfo) {
-      this.parkDiscountTotal.feeCopy -= this.couponInfo.couponfee;
-    }
-    // console.log('定位报错原因', uni.getStorageSync('checkedCouponList'));
-    const checkedCouponList = uni.getStorageSync('checkedCouponList');
-    console.log('定位报错原因', checkedCouponList);
-    this.checkedCouponList = checkedCouponList
-      ? typeof checkedCouponList === 'string'
-        ? JSON.parse(checkedCouponList)
-        : checkedCouponList
-      : [];
-    // JSON.parse(uni.getStorageSync('checkedCouponList')) || [];
+  created() {},
+  data() {
+    return {
+      checkedCouponList: [],
+      couponList: [],
+      launchPath: '', // H5跳转CRM微信小程序
+      envVersion: window.env === 'qa' ? 'trial' : 'release', // 所需跳转的小程序版本,合法值为:正式版release、开发版develop、体验版trial(支持的微信版本:iOS 8.0.18及以上、Android 8.0.19及以上)
+      platform: getPlatform(),
+      maxCouponFee: 0, // 计算优惠券已选的总金额
+      remainPrice: 0, // 剩余可用优惠额度
+    };
+  },
+  computed: {
+    ...mapState({
+      custTypeId: (state) => state.custTypeId,
+      actualPayFee: (state) => state.order.actualPayFee,
+      orderDetail: (state) => state.order.orderDetail,
+      coupons: (state) => state.order.coupons,
+      maxOneDayDiscountFee: (state) => state.order.maxOneDayDiscountFee, // 深圳单日单次使用上限
+      usingTotalDiscount: (state) => state.order.usingTotalDiscount, // 当前已使用优惠
+    }),
   },
+
   mounted() {
-    if (isInWeixinH5()) {
-      initWxJsSdkConfig(
-        ['checkJsApi', 'chooseImage'],
-        ['wx-open-launch-weapp']
-      );
-    }
+    console.log('parkingFeeCoupon.js');
     setTimeout(() => {
       uni.setNavigationBarTitle({
         title: '优惠券',
       });
-      this.launchPathInit();
+      if (isInWeixinH5()) {
+        initWxJsSdkConfig(
+          ['checkJsApi', 'chooseImage'],
+          ['wx-open-launch-weapp']
+        );
+        // this.launchPathInit();
+      }
     }, 300);
+    this.pageInit();
+    console.log(44);
+  },
+/*watch:{
+  checkedCouponList(oldVal,newVal) {
 
-    // console.log('查看结果', uni.getStorageSync('list'));
-    const list = uni.getStorageSync('list');
-    const parkFee = uni.getStorageSync('parkFee');
-    if ( !parkFee ) {
-      this.$router.replace({path: 'home'})
-      return
-    }
-    this.parkFee = JSON.parse(parkFee);
-    this.parkFee.parkInfoEntity.useReduceTime = this.parkFee.parkInfoEntity
-      .useReduceTime
-      ? this.parkFee.parkInfoEntity.useReduceTime
-      : 0;
-    this.parkMallCode = this.parkFee.parkInfoEntity.parkMallCode;
+    console.log({newVal,oldVal})
+  }
+},*/
+  methods: {
+    remainPriceInit() {
+      this.usingTotalDiscount
 
-    const parkInfo = uni.getStorageSync('parkInfo');
-    this.parkInfo = parkInfo ? JSON.parse(uni.getStorageSync('parkInfo')) : {};
+      // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
+      // const {
+      //   usingTotalDiscount, // 使用总抵扣
+      //   coupons
+      // } = checkOutResponse.discountInfo;
+      // const {
+      //   totalFee, // 应缴
+      //   actualPayFee // 应付金额
+      // } = checkOutResponse.parkingRecord;
+      // // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
+      // let remainPrice = remainConsumeTime * hourPrice;
+      // if ( remainPrice > actualPayFee ) {
+      //   remainPrice = actualPayFee;
+      // }
+      // let couponPrice = 0
+      // // 确认优惠券是否可选择
+      // let couponsList = coupons.sort((itema,itemb) => itema.discountFee - itemb.discountFee)
+      // couponsList = couponsList.map(elm => {
+      //   if ( !elm.defaultSelected ) {
+      //     if ( elm.discountFee <=  remainPrice && couponPrice <= remainPrice) {
+      //       elm.disabled = false
+      //     } else {
+      //       elm.disabled = true
+      //     }
+      //   }
+      // })
+      // console.log(343, {couponsList});
+      // commit('setCoupons', couponsList);
+    },
+    pageInit() {
 
+      // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
+      // const {
+      //   usingTotalDiscount, // 使用总抵扣
+      //   coupons
+      // } = checkOutResponse.discountInfo;
+      // const {
+      //   totalFee, // 应缴
+      //   actualPayFee // 应付金额
+      // } = checkOutResponse.parkingRecord;
+      // // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
+      // let remainPrice = remainConsumeTime * hourPrice;
+      // if ( remainPrice > actualPayFee ) {
+      //   remainPrice = actualPayFee;
+      // }
+      // let couponPrice = 0
+      // // 确认优惠券是否可选择
+      // let couponsList = coupons.sort((itema,itemb) => itema.discountFee - itemb.discountFee)
+      // couponsList = couponsList.map(elm => {
+      //   if ( !elm.defaultSelected ) {
+      //     if ( elm.discountFee <=  remainPrice && couponPrice <= remainPrice) {
+      //       elm.disabled = false
+      //     } else {
+      //       elm.disabled = true
+      //     }
+      //   }
+      // })
+      // console.log(343, {couponsList});
+      // commit('setCoupons', couponsList);
 
-    console.log('parkMallCode', this.parkMallCode);
-    // 上限金额
-    this.maxonetimediscountFee =
-      this.parkFee.parkInfoEntity.maxonetimediscount *
-      this.parkFee.parkInfoEntity.needmoney;
-    // 深圳特殊处理(单位:金额)
-    if (this.parkMallCode === 5) {
-      this.maxonedaydiscountFee =
-        this.parkFee.parkInfoEntity.maxOneDayHour -
-        this.parkFee.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour ||
-        0;
-    } else {
-      this.maxonedaydiscountFee =
-        (this.parkFee.parkInfoEntity.maxOneDayHour -
-          this.parkFee.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour) *
-        this.parkFee.parkInfoEntity.needmoney || 0;
-    }
-    if (this.maxonedaydiscountFee < 0) {
-      this.maxonedaydiscountFee = 0;
-    }
-    if (list && list.length > 0) {
-      this.list = list;
-      // console.log(144, this.checkedCouponList);
-      if (this.checkedCouponList.length > 0) {
-        const index = this.checkedCouponList[0];
-        const item = this.list[index];
-        // 根据电子券规则判断是否可选
-        this.isDisabledByRule(item);
-      } else {
-        this.list.map((e) => {
-          // 没有选中项初始化状态
-          e.checked = false;
-          e.disabled = false;
+
+      /*
+       * 电子优惠券初始化逻辑(后端处理)
+       *
+       * 1、每次change之后,需要重新计算每个电子优惠券的逻辑
+       * 2、superpositionrule  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加);
+       * */
+      this.couponList = [...this.coupons];
+      if (this.couponList.length) {
+        this.couponList = this.couponList.map((elm, index) => {
+          if (elm.defaultSelected) {
+            this.maxCouponFee = this.maxCouponFee + elm.discountFee;
+            this.checkedCouponList.push(`coupon${index}`);
+            elm.disabled = false
+          } else {
+            elm.disabled = true
+          }
+          return elm
         });
+        // 验证剩余优惠券是否可勾选(无需验证:后端已计算可勾选的优惠券)
       }
-      // 浦东上限控制
-      if (
-        this.parkMallCode === 1 ||
-        this.parkMallCode === 4 ||
-        this.parkMallCode === 5
-      ) {
-        if (this.crossMessage()) {
-          this.list.forEach((item) => {
-            if (!item.checked) {
-              item.disabled = true;
-            }
-          });
-        }
-      }
-    } else {
-      this.list = this.parkFee.memberTicketList;
-      console.log(181, this.list);
-      this.list.forEach((item) => {
-        item.disabled = false;
-        item.checked = false;
-        if (
-          (this.parkMallCode === 1 ||
-            this.parkMallCode === 4 ||
-            this.parkMallCode === 5) &&
-          this.crossMessage()
-        ) {
-          item.disabled = true;
-        }
-        if (item.carType == '2') {
-          item.value = item.parktime * this.parkFee.parkInfoEntity.needmoney;
-        } else if (item.carType == '1') {
-          item.value = item.ticketValue;
-        }
-      });
-      // this.list = [
-      //   {
-      //     value: '50',
-      //     ticketName: 'ticketName',
-      //     cancelEndTime: 'cancelEndTime',
-      //     disabled: false,
-      //     checked: false,
-      //   },
-      // ];
-      // console.log(164, this.list);
-    }
-  },
-  data() {
-    return {
-      parkFee: {}, // 停车规则信息及优惠信息
-      list: [], // 电子券列表
-      checkedCouponList: [], // 选中的电子券列表
-      couponCode: [], // 选中的电子券码组
-      servicefee: 0, // 应缴金额
-      parkDiscountTotal: {}, // 总停车优惠
-      couponInfo: {}, // 页面缓存(电子券优惠)
-      maxonetimediscountFee: 0, // 每次优惠上限金额
-      maxonedaydiscountFee: 0, // 每天优惠上限金额
-      parkMallCode: 1, // 0静安 1浦东 2杭州 3北京 4沈阳 5深圳
-      paperCouponFee: 0, // 纸质优惠金额
-      platform: getPlatform(),
-      launchPath: '', // H5跳转CRM微信小程序
-      envVersion: window.env === 'qa' ? 'trial' : 'release', // 所需跳转的小程序版本,合法值为:正式版release、开发版develop、体验版trial(支持的微信版本:iOS 8.0.18及以上、Android 8.0.19及以上)
-      parkInfo: {},
-      // env: window.env === 'qa' ? 'trial' : 'release',
-    };
-  },
-  computed: {
-    // 电子券优惠金额总计
-    totalFee() {
-      this.couponCode = [];
-      let total = 0;
-      this.checkedCouponList.forEach((i) => {
-        // console.log(221, this.list);
-        if (this.list && this.list[i]) {
-          this.couponCode.push(this.list[i].couponCode);
-          total += this.list[i].value;
-        }
-      });
-      return total;
     },
-    // 实际支付金额
-    actualFee() {
-      const fee = this.servicefee - this.discountFee;
-      return fee > 0 ? fee : 0;
+    item2Number(i) {
+      return Number.parseInt(i.replace(/coupon/g, ''))
     },
-    // 已优惠金额
-    discountFee() {
-      let total = this.parkDiscountTotal?.feeCopy + this.totalFee;
-      // 超出上限按上限计算
-      if (this.parkMallCode === 1) {
-        if (total - this.paperCouponFee > this.maxonetimediscountFee) {
-          total = this.maxonetimediscountFee + this.paperCouponFee;
-        }
-      }
-      if (this.parkMallCode === 4) {
-        if (
-          total - this.paperCouponFee - this.parkDiscountTotal?.bonusfee >
-          this.maxonedaydiscountFee
-        ) {
-          total =
-            this.maxonedaydiscountFee +
-            this.parkDiscountTotal.bonusfee +
-            this.paperCouponFee;
-        }
-      }
-      if (this.parkMallCode === 5) {
-        if (total > this.maxonedaydiscountFee) {
-          total = this.maxonedaydiscountFee;
-        }
-      }
-      return total;
-    },
-    ...mapState({
-      custTypeId: (state) => state.custTypeId,
-    }),
-  },
-  methods: {
-    // 选择回调
-    checkboxChange(value) {
-      // console.log(269, item);
-      // 获取动作项目索引
-      // const current = value;
-      // const pre = this.checkedCouponList;
-      // console.log(273, pre.concat(current));
-      // const diff = pre
-      //   .concat(current)
-      //   .map((i) => {
-      //     console.log(281, `${i}`);
-      //     return `${i}`;
-      //   })
-      //   .filter((v, i, arr) => {
-      //     console.log(
-      //       275,
-      //       arr.indexOf(v),
-      //       arr.lastIndexOf(v),
-      //       arr.indexOf(v) === arr.lastIndexOf(v)
-      //     );
-      //     return arr.indexOf(v) === arr.lastIndexOf(v);
-      //   });
-      // console.log(diff);
-      this.checkedCouponList = value;
-      // console.log('如果有选中项', this.list);
-      // return
-      // 如果有选中项
-      if (this.checkedCouponList.length > 0) {
-        const index = this.checkedCouponList[0];
-        const item = this.list[index];
-        // console.log('根据电子券规则判断是否可选', index, item);
-        // 根据电子券规则判断是否可选
-        this.isDisabledByRule(item);
-      } else {
-        this.list.map((e) => {
-          // 没有选中项初始化状态
-          e.checked = false;
-          e.disabled = false;
+    checkboxItemChange(name, index){
+      console.log(7676, name);
+      // 取消勾选时
+      if ( this.checkedCouponList.indexOf(name) > -1 ) {
+        this.couponList = this.couponList.map((elm, index) => {
+          elm.disabled = false
+          return elm
         });
+        this.checkedCouponList = this.checkedCouponList.filter(i => i !== name)
+        return
       }
-      // console.log(this.list);
+      // 如果有选中项
+      const item = this.couponList[index];
+      this.checkedCouponList.push(`coupon${index}`);
+      // 根据电子券规则判断是否可选
+      this.isDisabledByRule(item);
     },
-
     // 根据电子券规则判断是否可选
     isDisabledByRule(item) {
-      // console.log('根据电子券规则判断是否可选', item);
+      const { parkMallCode } = this.orderDetail.parkInfo
       // 杭州电子券使用上限(单位: 张)
-      if (this.parkMallCode === 2) {
+      /*if (this.parkMallCode === 2) {
         // 达到上限
         if (
           this.checkedCouponList.length ===
@@ -275,65 +178,58 @@ export default {
               e.checked = true;
             }
           });
-          return Toast({
-            message: `电子券每天最多可使用${this.parkFee.parkInfoEntity.useTicketNum}张`,
-            icon: 'none',
+          return uni.showToast({
+            title: `电子券每天最多可使用${this.parkFee.parkInfoEntity.useTicketNum}张`,
+            icon: "none",
           });
-          // return uni.showToast({
-          //   title: `电子券每天最多可使用${this.parkFee.parkInfoEntity.useTicketNum}张`,
-          //   icon: 'none',
-          // });
         } else {
           this.list.forEach((e) => {
             e.disabled = false;
           });
         }
-      }
+      }*/
 
       // 浦东每次缴费超限控制、沈阳每日超限控制
       if (
-        (this.parkMallCode === 1 ||
-          this.parkMallCode === 4 ||
-          this.parkMallCode === 5) &&
+        (parkMallCode === 1 ||
+          parkMallCode === 4 ||
+          parkMallCode === 5 ||
+          parkMallCode === 999 ||
+          parkMallCode === 6) &&
         this.crossMessage()
       ) {
-        // console.log(331, '浦东每次缴费超限控制、沈阳每日超限控制');
-        this.list = this.list.map((e, i) => {
-          if (this.checkedCouponList.findIndex((c) => c == i) === -1) {
+        this.couponList.forEach((e, i) => {
+          if (this.checkedCouponList.findIndex((c) => c === `coupon${i}`) === -1) {
             e.disabled = true;
-            e.checked = false;
-          } else {
-            e.checked = true;
           }
-          return e;
         });
         return;
       }
 
       // 选中状态赋值
-      this.list = this.list.map((e, i) => {
-        if (this.checkedCouponList.findIndex((c) => c == i) !== -1) {
+      this.couponList.forEach((e, i) => {
+        if (this.checkedCouponList.findIndex((c) => c === `coupon${i}`) !== -1) {
           e.checked = true;
         } else {
           e.checked = false;
         }
-        // console.log(376, item.superpositionrule);
         // superpositionrule  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加)
-        if (item.superpositionrule == '1') {
+        if (item.superpositionrule === "1") {
           if (e.couponCode !== item.couponCode) {
             e.disabled = true;
           }
-        } else if (item.superpositionrule == '2') {
-          if (e.superpositionrule == '2') {
+        } else if (item.superpositionrule === "2") {
+          if (e.superpositionrule === "2") {
             // 统计当前(同类型&同可叠加次数)
             let count = 0;
             this.checkedCouponList.forEach((i) => {
-              if (this.list[i].ticketId === item.ticketId) {
+              const index = this.item2Number(i)
+              if (this.couponList[index].code === item.code) {
                 count++;
               }
             });
-            // console.log(item.ticketId + '合计:' + count);
-            if (item.ticketId === e.ticketId) {
+            console.log(item.code + "合计:" + count);
+            if (item.code === e.code) {
               // 超限判断
               if (item.limitUseNum !== 0 && count + 1 > item.limitUseNum) {
                 if (e.checked === false) {
@@ -353,14 +249,109 @@ export default {
           // 类型3可叠加
           e.disabled = false;
         }
-        return e;
       });
     },
     // 是否选中
     isCheck(val) {
       return this.checkedCouponList.findIndex((e) => e == val) !== -1;
     },
+    // 超限提示
+    crossMessage() {
+      const { parkMallCode } = this.orderDetail.parkInfo
+      const {maxOneDayCoupons,maxonedaydiscountFee, remainConsumeTime, hourPrice} = this.orderDetail.parkingRule;
+      const {
+        usingTotalDiscount, // 使用总抵扣
+        coupons
+      } = this.orderDetail.discountInfo;
+      const {
+        // totalFee, // 应缴
+        actualPayFee // 应付金额
+      } = this.orderDetail.parkingRecord;
+      // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
+      let remainPrice = remainConsumeTime * hourPrice;
+      if ( remainPrice > actualPayFee ) {
+        remainPrice = actualPayFee;
+      }
+      // let totalFee = this.parkDiscountTotal.feeCopy;
+      // totalFee += this.totalFee;
+      // 电子券优惠金额总计
+      // 浦东每次优惠上限
+      /*if (
+        parkMallCode === 1 &&
+        totalFee - this.paperCouponFee >= this.maxonetimediscountFee
+      ) {
+        //  uni.showToast({
+        //   title: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
+        //   icon: 'none',
+        // });
+        return Toast({
+          message: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
+          icon: 'none',
+        });
+        return;
+      }*/
+      // 沈阳超限处理(maxonedaydiscountFee 会员、消费、电子券减免)
+      /*if (
+        parkMallCode === 4 &&
+        totalFee - this.paperCouponFee - this.parkDiscountTotal.bonusfee >=
+          this.maxonedaydiscountFee
+      ) {
+        return Toast({
+          message: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
+          icon: 'none',
+        });
+        // return uni.showToast({
+        //   title: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
+        //   icon: 'none',
+        // });
+      }*/
+      // 深圳超限处理
+      if (parkMallCode === 5 && totalFee >= remainPrice) {
+        return Toast({
+          message: `每日最高可抵扣${remainPrice}元`,
+          icon: 'none',
+        });
+        // return uni.showToast({
+        //   title: `每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元`,
+        //   icon: 'none',
+        // });
+      }
+    },
+    // 确认
+    confirm() {
+      // 重新计算兑换券优惠
+      const checkedCouponList = this.checkedCouponList.map(i => this.item2Number(i));
+      const  couponList = this.couponList.map((elm, index) => {
+        if ( checkedCouponList[index] > -1 ) {
+          elm.defaultSelected = false
+        }
+        return elm
+      })
+      this.$store.dispatch('order/saveCouponMath', {
+        couponList: couponList,
+        callback:() => {
+          this.$router.back();
+        }
+      })
 
+      /*uni.setStorageSync('checkedCouponList', this.checkedCouponList);
+      uni.setStorageSync('list', this.list);
+      uni.setStorageSync('couponInfo', {
+        couponfee: this.totalFee,
+        couponcode: this.couponCode.join('#'),
+      });
+      this.$router.back();*/
+    },
+    launchPathInit() {
+      const groupId = uni.getStorageSync('groupId');
+      const mallId = uni.getStorageSync('mallId');
+      const { projectId } = getAppIdByGroupIdAndMallId({
+        groupId: groupId,
+        mallId: mallId,
+        type: 'all',
+      });
+      this.launchPath = `?trackSourceType=运营位&trackSourceName=功能球&projectId=${projectId}&groupId=${groupId}&mallId=${mallId}&source=tparkingH5`;
+    },
     // 跳转小程序
     navigateToMiniProgram() {
       if (this.platform === 'miniprogram') {
@@ -380,7 +371,7 @@ export default {
         window.subscribe('navigateToMiniProgramOver', (options) => {
           if (options.navigateToMiniProgramOver === 'ok') {
             this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
-              name: 'parkingFeeDetail'
+              name: 'parkingFeeDetail',
             });
             this.$router.go(-2);
           }
@@ -415,84 +406,20 @@ export default {
         // });
       }
     },
-    // 超限提示
-    crossMessage() {
-      let totalFee = this.parkDiscountTotal.feeCopy;
-      totalFee += this.totalFee;
-      // 浦东每次优惠上限
-      if (
-        this.parkMallCode === 1 &&
-        totalFee - this.paperCouponFee >= this.maxonetimediscountFee
-      ) {
-        //  uni.showToast({
-        //   title: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
-        //   icon: 'none',
-        // });
-        return Toast({
-          message: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
-          icon: 'none',
-        });
-        return;
-      }
-      // 沈阳超限处理(maxonedaydiscountFee 会员、消费、电子券减免)
-      if (
-        this.parkMallCode === 4 &&
-        totalFee - this.paperCouponFee - this.parkDiscountTotal.bonusfee >=
-        this.maxonedaydiscountFee
-      ) {
-        return Toast({
-          message: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
-          icon: 'none',
-        });
-        // return uni.showToast({
-        //   title: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
-        //   icon: 'none',
-        // });
-      }
-      // 深圳超限处理
-      if (this.parkMallCode === 5 && totalFee >= this.maxonedaydiscountFee) {
-        return Toast({
-          message: `每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元`,
-          icon: 'none',
-        });
-        // return uni.showToast({
-        //   title: `每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元`,
-        //   icon: 'none',
-        // });
-      }
-    },
-
-    // 确认
-    confirm() {
-      uni.setStorageSync('checkedCouponList', this.checkedCouponList);
-      uni.setStorageSync('list', this.list);
-      uni.setStorageSync('couponInfo', {
-        couponfee: this.totalFee,
-        couponcode: this.couponCode.join('#'),
-      });
-      this.$router.back();
-    },
-    launchPathInit() {
-      const groupId = uni.getStorageSync('groupId');
-      const mallId = uni.getStorageSync('mallId');
-      const { projectId } = getAppIdByGroupIdAndMallId({
-        groupId: groupId,
-        mallId: mallId,
-        type: 'all',
-      });
-      this.launchPath = `?trackSourceType=运营位&trackSourceName=功能球&projectId=${projectId}&groupId=${groupId}&mallId=${mallId}&source=tparkingH5`;
-    },
     // H5 跳转到小程序
-    launchFn({ appId, extInfo}) {
-      console.log(584, JSON.stringify({appId, extInfo}))
+    launchFn({ appId, extInfo }) {
+      console.log(584, JSON.stringify({ appId, extInfo }));
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
-        name: 'parkingFeeDetail'
+        name: 'parkingFeeDetail',
       });
       this.$router.go(-2);
       console.log('H5 跳转到 嘉里中心小程序: success');
     },
-    launchErrorFn({errMsg,appId,extInfo}) {
-      console.log('H5 跳转到 嘉里中心小程序: fail', JSON.stringify({errMsg,appId,extInfo}));
+    launchErrorFn({ errMsg, appId, extInfo }) {
+      console.log(
+        'H5 跳转到 嘉里中心小程序: fail',
+        JSON.stringify({ errMsg, appId, extInfo })
+      );
     },
     onLaunchReady() {
       console.log('H5 跳转到 嘉里中心小程序 的标签 渲染了');

+ 142 - 212
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -6,65 +6,21 @@ import uni from '@/utils/uniHooks';
 import { initWxJsSdkConfig } from '@/utils/login';
 import { getAppIdByGroupIdAndMallId, getIsWxh5, getPlatform } from '@/utils';
 import { Dialog, Toast } from 'vant';
-import { checkOut } from '@/api/parking';
-import checkOutResponse from '@/api/mockData/check-out.response.json'
+import { ordersAndPrepay } from '@/api/parking';
+// import checkOutResponse from '@/api/mockData/checkout.hz.response'
 
 export default {
   name: 'parkingFeeDetail',
   data() {
     return {
-      bindflag: '',
-      initFlag: true, // 用作应缴费用为0时的提示弹框标记
-      animationChilc: false,
-      duration: 0, // 积分兑换时长
-      durationNew: 0, // 北京新会员积分兑换时长
-      durationCopy: 0, // 积分兑换时长备份
-      durationNewCopy: 0, // 积分兑换时长备份
-      orderno: '',
-      params: {},
-      integral: 0, // 积分
-      integralNew: 0, // 北京新会员积分
-      bonus: 0, // 当前积分
-      // bonusCopy: 0, // 积分备份
-      bonusfee: 0, // 积分减免金额
-      newBonusfee: 0, // 新会员减免金额
-      hourMoney: 15,
-      payCarno: '',
-      picUrl: '',
-      parkInfo: {},
+      hasDiscount: false,
       parkFee: {},
-      checkedTotal: 0, // 已选择优惠项目数
-      discountTotal: {}, // 已选择优惠项目统计(时间、费用)
-      couponCount: 0, // 可选优惠券数量
-      checkedCouponCount: 0, // 已选优惠券数量
-      couponInfo: {}, // 已选择电子券信息
-      paperCouponInfo: {}, // 已选择纸质优惠券信息
-      isShowPapercoupons: false, // 未登录时显示纸质优惠券
-      // dimension: 1, // 计算维度 浦东0.5小时 其它停车场1小时
-      maxonetimediscountFee: 0, // 每次优惠上限金额
-      maxonedaydiscountFee: 0, // 每天优惠上限金额
-      discountTotalFeeCopy: 0, // 用于超限判断
-      parkMallCode: 0, // 0静安 1浦东 2杭州 3北京 4沈阳 5深圳
-      hasDiscount: false, // 是否有会员减免、消费减免
-      isShow: true, // 缴费说明true:显示全部 false:显示部分
-      orderCreateTime: '', // 订单创建时间
       refreshTime: 180, // 停车场重置费用倒计时3分钟
-      isPageHide: false, // 用于其它有人吗倒计时重置时不再弹出优惠框
-      isShowPopup: false, // 优惠提示是否显示
-      preUrl: '',
-      popup: false,
-      newpopup: false,
-      integralToValue: 0, // 深圳前海停车500积分兑换5元
-      integralMaxMoney: 0, // 深圳前海停车积分上限
-      integralNewToValue: 0, // 北京新会员积分
-      integralNewMaxMoney: 0, // 北京新会员积分
-      discountKind: null,
-      parkingTrack: null,
-      reFresh: '',
-      // 是否重载
-      // isReload: '1',
-      Toastloading: null,
+      // 微服务接口字段
+      isShowDescription: true, // 缴费说明true:显示全部 false:显示部分
       btnLoading: false,
+      popup: false,
+      msData: {},
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -76,182 +32,156 @@ export default {
     next();
   },
   computed: {
+    ...mapState({
+      orderDetail: (state) => state.order.orderDetail,
+      discountDesc: (state) => state.order.discountDesc,
+      enableNewMemberPoints: (state) => state.order.enableNewMemberPoints,
+      enablePoints: (state) => state.order.enablePoints,
+      integralDesc: (state) => state.order.integralDesc,
+      enableCoupon: (state) => state.order.enableCoupon,
+      maxOneDayCoupons: (state) => state.order.maxOneDayCoupons,
+      coupons: (state) => state.order.coupons,
+      couponDesc: (state) => state.order.couponDesc,
+      enablePaperCoupons: (state) => state.order.enablePaperCoupons,
+      custTypeId: (state) => state.custTypeId,
+      usingTotalDiscount: (state) => state.order.usingTotalDiscount,
+      actualPayFee: (state) => state.order.actualPayFee,
+      available: (state) => state.order.available,
+      member: (state) => state.member,
+      maxPointsTime: (state) => state.order.maxPointsTime,
+      pointsTime: (state) => state.order.pointsTime,
+      pointsPerHour: (state) => state.order.pointsPerHour,
+      usePoints: (state) => state.order.usePoints,
+      usePointsTime: (state) => state.order.usePointsTime,
+      enableConsume: (state) => state.order.enableConsume,
+      // checkedTotal: state => state.order.checkedTotal,
+    }),
     // 支付按钮状态
     payBtnDisabled() {
       return (
-        !this.parkInfo.servicefee ||
-        (JSON.stringify(this.member) !== '{}' && !this.parkFee.parkInfoEntity)
+        !this.actualPayFee ||
+        (JSON.stringify(this.member) !== '{}' && !this.orderDetail.parkInfo)
       );
     },
-    // 已停车时长
-    parkingTime() {
-      const time = this.parkInfo.serviceMin;
-      const days = parseInt(time / 60 / 24);
-      const hours = parseInt((time / 60) % 24);
-      const minutes = parseInt(time % 60);
-      if (days > 0) {
-        return `${days}天 ${hours}小时 ${minutes}分钟`;
-      }
-      if (hours > 0) {
-        return `${hours}小时 ${minutes}分钟`;
+  },
+  created() {
+    this.pageInit();
+  },
+  methods: {
+    // 前往支付
+    async toPay() {
+      console.log('orderDetail', this.orderDetail);
+      const { parkingRecord, discountInfo } = this.orderDetail;
+      try {
+        const params = {
+          // vehicleNo: '', // 车牌号
+          // points
+          parkingRecord: {
+            vehicleNo: parkingRecord.vehicleNo,
+            enterTime: parkingRecord.enterTime,
+            serviceMin: parkingRecord.serviceMin,
+            totalFee: parkingRecord.totalFee, //应缴
+            actualPayFee: parkingRecord.actualPayFee, //应付金额
+          },
+          discountInfo: {
+            usingTotalDiscount: discountInfo.usingTotalDiscount, //优惠金额"
+            actualUsedDiscount: discountInfo.usingTotalDiscount, //实际优惠金额
+            points: [
+              {
+                discountTime: 60,
+                // 如果是深圳的话,是金额,还得计算出对应的积分
+                discountFee: discountInfo.points[0].maxDiscountFee,
+                discountPoints:
+                  (discountInfo.points[0].pointsPerUnit /
+                    discountInfo.points[0].unitAmount) *
+                  discountInfo.points[0].maxDiscountFee,
+              },
+            ],
+          },
+        };
+        const res = await ordersAndPrepay(params);
+        console.log('orderDetail', res);
+      } catch (err) {
+        console.log(err);
       }
-      return `${minutes}分钟`;
     },
+    // 初始化
+    async pageInit() {
+      // console.log(247, checkOutResponse);
+      // this.msData.detail = checkOutResponse
+      // 停车优惠
+      // this.discounts(this.msData.detail)
+      // 积分减免
+      // 优惠券
+      // 纸质优惠券
+      // 优惠金额
+      // 应付金额
+      console.log(83838383);
 
-    // 停车优惠(首停、会员减免、消费减免)
-    discountDesc() {
-      if (this.hasDiscount) {
-        // console.log('判断当前位置是否打印', this.checkedTotal);
-        if (this.checkedTotal > 0) {
-          return `已选择${this.checkedTotal}项优惠`;
-        }
-        return '立即使用';
-      } else {
-        return '暂无可用优惠';
-      }
+      // this.$store.commit('order/SET_ORDER_DETAIL', checkOutResponse);
+      this.$store.dispatch('order/orderInit', this.$route.query.vehicleNo);
+      // try {
+      //   const res = await checkOut(this.$route.query.carno)
+      //   console.log(res)
+      // } catch ( err ) {
+      //   console.log(err)
+      // }
     },
-
-    // 积分减免
-    integralDesc() {
-      if (this.duration > 0) {
-        // 深圳特殊处理(单位:金额)
-        if (this.parkMallCode === 5) {
-          return `已选择兑换${this.duration}元`;
-        }
-        return `已选择兑换${this.duration}小时`;
-      }
-      if (this.bonusCopy < this.integral) {
-        return `${this.integral}积分可停车1小时`;
-      }
-      if (
-        this.parkMallCode === 3 &&
-        this.member?.currnentintegral >= this.integral &&
-        !this.bonus
-      ) {
-        return `今日已达上限`;
-      }
-      return `${this.bonus}积分可减免`;
+    // 停车优惠
+    discounts() {
+      if (!this.enableConsume && orderDetail.parkInfo.parkMallCode !== 2) {
+        return Toast({
+          message: '暂无可用优惠',
+        });
+      }
+      this.$router.push({
+        path: 'parkingFeeDiscounts',
+      });
     },
-    // 北京新会员积分减免
-    integralDescNew() {
-      if (this.durationNew > 0) {
-        return `已选择兑换${this.durationNew}小时`;
-      }
-      if (this.bonusCopy < this.integralNew) {
-        return `${this.integralNew}积分可停车1小时`;
-      }
-      if (
-        this.parkMallCode === 3 &&
-        app.globalData.member?.currnentintegral >= this.integralNew &&
-        !this.bonus
-      ) {
-        return `今日已达上限`;
-      }
-      return `${this.bonus}积分可减免`;
+    // 是否展示优惠信息
+    // isShowDiscounts(params) {
+    //   console.log(277, params?.parkingRule?.enableCoupon);
+    //   return params?.parkingRule?.enableCoupon
+    // },
+    //
+    // 计算优惠信息
+    discountssss(params) {
+      console.log(275, params);
+      console.log(275, params.discountInfo);
+      console.log(275, params.discountInfo.consume);
+      return 1;
     },
-    // 电子券
-    couponDesc() {
-      if (this.checkedCouponCount > 0) {
-        return `已选择${this.checkedCouponCount}张优惠劵`;
-      } else {
-        if (this.couponCount > 0) {
-          return `您有${this.couponCount}张可用优惠劵`;
-        }
-        return `暂无可用优惠券`;
-      }
+    coupon() {
+      this.$router.push({
+        path: 'parkingFeeCoupon',
+      });
     },
-
-    // 实际支付金额
-    actualFee() {
-      const fee = this.parkInfo.servicefee / 100 - this.discountTotalFee;
-      return fee > 0 ? fee : 0;
+    paperCoupon() {},
+    duration() {},
+    couponCount() {},
+    // 重置倒计时
+    resetCountDown() {
+      this.refreshTime = 0;
+      // 重新创建订单
+      // this.createParkOrder();
     },
-
-    // 优惠金额
-    discountTotalFee() {
-      // console.log('定位问题', this.discountTotal);
-      let total = 0;
-      if (this.discountTotal?.fee > 0) {
-        total += this.discountTotal.fee; // 首停、会员、消费减免
-      }
-      if (this.bonusfee > 0) {
-        total += this.bonusfee; // 积分减免
-      }
-      if (this.newBonusfee > 0) {
-        total += this.newBonusfee; // 积分减免
-      }
-      if (this.couponInfo?.couponfee > 0) {
-        total += this.couponInfo.couponfee; // 电子券减免
-      }
-      this.discountTotalFeeCopy = total;
-      // 超出上限按上限计算(parkMallCode: 0静安 1浦东 2杭州 3北京 4沈阳 5深圳)
-      if (this.parkMallCode === 1) {
-        if (total > this.maxonetimediscountFee) {
-          total = this.maxonetimediscountFee;
-        }
-      }
-      if (this.parkMallCode === 5) {
-        if (total > this.maxonedaydiscountFee) {
-          total = this.maxonedaydiscountFee;
-        }
-      }
-      // 沈阳超限处理(maxonedaydiscountFee 会员、消费、电子券减免)
-      if (this.parkMallCode === 4) {
-        if (total - this.bonusfee > this.maxonedaydiscountFee) {
-          total = this.maxonedaydiscountFee + this.bonusfee;
-        }
-      }
-      if (this.paperCouponInfo.paperDiscountFee > 0) {
-        total += this.paperCouponInfo.paperDiscountFee; // 纸质券减免
-        this.discountTotalFeeCopy += this.paperCouponInfo.paperDiscountFee;
-      }
-      uni.setStorageSync('parkingTotal', {
-        time: total / this.hourMoney,
-        fee: total,
-        feeCopy: this.discountTotalFeeCopy,
-        bonusfee: this.bonusfee || 0,
-      });
-      return total;
+    //缴费说明隐藏显示
+    togglePayinstruction() {
+      this.isShowDescription = !this.isShowDescription;
     },
-    // 页面初始化出发条件
-    isInit() {
-      // console.log(426426426426, this.member);
-      return {
-        projectId: this.projectId,
-        member: this.member,
-      };
+    // 积分修改框
+    showPointsMathPopup() {
+      this.popup = true;
     },
-    ...mapState({
-      custTypeId: (state) => state.custTypeId,
-      // paramsScene: (state) => state.paramsScene,
-      mallid: (state) => state.mallId,
-      openId: (state) => state.openid,
-      member: (state) => state.member,
-      groupId: (state) => state.groupId,
-      mobile: (state) => state.mobile,
-      projectId: (state) => state.projectId,
-      bonusCopy: (state) => state.bonusCopy,
-      source: (state) => state.source,
-      appId: (state) => state.appId,
-    }),
-  },
-  created() {
-    this.pageInit();
-  },
-  methods: {
-    toPay() {},
-    durationMinus() {},
-    durationAdd() {},
-    // 初始化
-    async pageInit() {
-      console.log(247, checkOutResponse);
-      try {
-        const res = await checkOut(this.$route.query.carno)
-        console.log(res)
-      } catch ( err ) {
-        console.log(err)
-      }
-
+    cancelPointsMathPopup() {
+      this.$store.dispatch('order/cancelPointsMath', () => {
+        this.popup = false;
+      });
+    },
+    savePointsMathPopup() {
+      this.$store.dispatch('order/savePointsMath', () => {
+        this.popup = false;
+      });
     }
   },
 };

+ 12 - 6
src/pages/parkingFee/mixins/parkingFeeDetailSuccess.js

@@ -1,7 +1,7 @@
 import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
-import { orders } from '@/api/parking';
-import ordersInfoMockData from '@/api/mockData/ordersInfo.json'
+import { orderInfo } from '@/api/parking';
+import ordersInfoMockData from '@/api/mockData/ordersInfo.json';
 
 export default {
   data() {
@@ -47,13 +47,19 @@ export default {
     }),
   },
   methods: {
-    getData() {
+    async getData() {
       const params = {
         orderno: this.orderNo,
       };
       /*uni.showLoading({
-        title: '加载中',
-      });*/
+       title: '加载中',
+       });*/
+      try {
+        const res = await orderInfo(this.orderNo);
+        console.log(59595959, res);
+      } catch (err) {
+        console.log(err);
+      }
       this.detail = ordersInfoMockData;
       const isInvoice = this.detail.isInvoice;
       if (isInvoice == 0) {
@@ -67,7 +73,7 @@ export default {
       } else if (isInvoice == 4) {
         this.isInvoiceName = '开票失败';
       }
-      return
+      return;
       this.$md(params);
       uni.request({
         url: this.$baseURL + 'api/1.0/park/parkOrderDetail',

+ 10 - 8
src/pages/parkingFee/mixins/parkingFeeList.js

@@ -6,7 +6,7 @@ import { orders } from '@/api/parking';
 import orderMockData from '@/api/mockData/orders.json'
 
 let canloading = true;
-let pageNum = 1;
+let pageNum = 0;
 // import moment from 'moment';
 // import authorize from '@/components/authorize/authorize.vue';
 import { mapState } from 'vuex';
@@ -19,6 +19,7 @@ export default {
   data() {
     return {
       list: [],
+      pageNum: 0,
     };
   },
   computed: {
@@ -38,7 +39,7 @@ export default {
     this.list = [];
     // 重新获取数据
     canloading = true;
-    pageNum = 1;
+    pageNum = 0;
     const member = uni.getStorageSync('member');
     console.log(4141, member)
     this.loadData();
@@ -115,16 +116,17 @@ export default {
         mallid: this.mallId,
         vipcode: this.member?.vipcode,
         openId: this.openId,
-        page: pageNum || 1,
+        page: pageNum || 0,
         pageSize: 4,
       };
       console.log(120, orderMockData);
       try {
-        // const res = await orders({
-        //   page: params.page,
-        //   pageSize: params.pageSize,
-        // })
-        const res = orderMockData
+        const res = await orders({
+          page: params.page,
+          pageSize: params.pageSize,
+        })
+        console.log('res2', res);
+        // const res = orderMockData
         const records = res.content || [];
         if (records.length) {
           const list = this.list;

+ 1 - 1
src/pages/parkingFee/parkingFee.vue

@@ -3,7 +3,7 @@
 </template>
 
 <script>
-import officeBlueCom from './components/officeBlue/home.vue';
+import officeBlueCom from './components/officeBlue/parkingFee.vue';
 import baseParkingFeeCom from './components/base/parkingFee.vue';
 import baseMixins from './mixins/base'
 export default {

+ 5 - 1
src/store/index.js

@@ -5,6 +5,7 @@ import { crmQueryMemberInfo } from '@/utils/api-crm-member';
 import uni from '@/utils/uniHooks';
 import { kipAllCities, kipGetUserDetail } from '@/utils/api-kip';
 import cachedViews from './cachedViews';
+import order from './order';
 import { lbsDictionary } from '@/common/js/BaseDictionary';
 import { getGroupIdAndMallIdByLsbId } from '@/utils';
 // import { parkingLots } from '@/utils/api-crm-ms';
@@ -138,8 +139,9 @@ const store = new Vuex.Store({
       state.curMarket = payload;
     },
     SET_IS_INIT(state, payload) {
+      // TODO: 与小程序通信时打开
       state.isInit = payload;
-    }
+    },
   },
   actions: {
     async baseInit({ commit, dispatch }, { options, callback }) {
@@ -172,6 +174,7 @@ const store = new Vuex.Store({
           // brandInfo = {},
           // curMarket = {}
         } = options;
+        console.log({ lbsId });
 
         /* {
          buildingId: mallId,
@@ -248,6 +251,7 @@ const store = new Vuex.Store({
   },
   modules: {
     cachedViews,
+    order,
   },
 });
 

+ 413 - 0
src/store/order.js

@@ -0,0 +1,413 @@
+import { checkOut, calculateDiscount, ordersAndPrepay} from '@/api/parking';
+import checkOutQHResponse from '@/api/mockData/checkout.qh.response.json'
+
+// 微服务接口字段
+const state = {
+  // 微服务接口字段
+  orderDetail: {}, // 订单原始数据
+  isShowDiscounts: false, // 是否展示会员登记优惠
+  discountDesc: '', // 停车优惠(首停、会员减免、消费减免)
+  checkedTotal: 0, // 选中count数
+  enableNewMemberPoints: false, // 是否开启新会员积分
+  enablePoints: false, // 是否开启积分减免
+  usePoints: 0, // 用户已选择的积分
+  isFirst: 0, // 判断用户是否首次进入
+  integralDesc: '', // 积分减免说明文案
+  pointsPerHour: 0, // 每小时兑换积分
+  enableCoupon: false, // 电子优惠券是否启用
+  maxOneDayCoupons: 0, // 单日可选优惠券上限
+  coupons: [], // 可选优惠券数量
+  couponCount: 0, // 已选择优惠券
+  couponDesc: '', // 优惠券说明文案
+  enablePaperCoupons: false, // 启动纸质优惠券
+  usingTotalDiscount: 0, // 优惠金额
+  actualPayFee: 0, // 应付金额
+  available: 0, // 用户可用积分
+  maxPointsTime: '', // 积分最大兑换时长
+  pointsTime: '', // 已兑换的积分时间
+  // 停车优惠:会员等级和消费减免
+  memberLevelDiscount: false, // 是否开启会员等级
+  enableConsume: false, // 是否开启消费减免
+  pointsPerUnit: 0, //
+}
+
+const mutations = {
+  setOrderDetail(state, payload) {
+    state.orderDetail = payload;
+  },
+  setIsShowDiscounts(state, payload) {
+    state.isShowDiscounts = payload;
+  },
+  setCheckedTotal(state, payload) {
+    state.checkedTotal = payload;
+  },
+  setDiscountDesc(state, payload) {
+    state.discountDesc = payload;
+  },
+  setEnableNewMemberPoints(state, payload) {
+    state.enableNewMemberPoints = payload;
+  },
+  setEnablePoints(state, payload) {
+    state.enablePoints = payload;
+  },
+  setIsFirst(state, payload) {
+    state.isFirst = payload;
+  },
+  setIntegralDesc(state, payload) {
+    state.integralDesc = payload;
+  },
+  setUsePoints(state, payload) {
+    state.usePoints = payload;
+  },
+  setEnableCoupon(state, payload) {
+    state.enableCoupon = payload;
+  },
+  setMaxOneDayCoupons(state, payload) {
+    state.maxOneDayCoupons = payload;
+  },
+  setCoupons(state, payload) {
+    console.log('setCoupons', payload)
+    state.coupons = payload;
+  },
+  setCouponCount(state, payload) {
+    state.couponCount = payload;
+  },
+  setCouponDesc(state, payload) {
+    state.couponDesc = payload;
+  },
+  setEnablePaperCoupons(state, payload) {
+    state.enablePaperCoupons = payload;
+  },
+  setUsingTotalDiscount(state, payload) {
+    state.usingTotalDiscount = payload;
+  },
+  setActualPayFee(state, payload) {
+    state.actualPayFee = payload;
+  },
+  setPointsPerHour(state, payload) {
+    state.pointsPerHour = payload;
+  },
+  setAvailable(state, payload) {
+    state.available = payload;
+  },
+  setMaxPointsTime(state, payload) {
+    state.maxPointsTime = payload;
+  },
+  setPointsTime(state, payload) {
+    state.pointsTime = payload;
+  },
+  setEnableConsume(state, payload) {
+    state.enableConsume = payload;
+  },
+  setMemberLevelDiscount(state, payload) {
+    state.memberLevelDiscount = payload;
+  },
+  setPointsPerUnit(state, payload) {
+    state.pointsPerUnit = payload;
+  },
+  setMaxOneDayDiscountFee(state, payload) {
+    state.maxOneDayDiscountFee = payload;
+  },
+}
+
+const actions = {
+  async orderInit({ commit, dispatch, state }, vehicleNo = '浙A616A1') {
+    try {
+      // 请求接口
+      // ...
+      // ...
+      // if(state.isFirst < 1) {
+      //   setIsFirst(1);
+      // }
+      // const res = await checkOut('浙A616A1');
+      // console.log('浙A616A1', res);
+      // 所有的优惠时间长转为金额
+      // console.log(112, '所有的优惠时间长转为金额');
+      dispatch('orderInitRule', checkOutQHResponse);
+      // dispatch('orderInitRule', res);
+    } catch (error) {
+      console.log(error);
+    }
+  },
+  orderInitRule({ commit, dispatch, state }, checkOutResponse) {
+    console.log(119, checkOutResponse);
+    commit('setOrderDetail', checkOutResponse);
+    // 是否展示优惠
+    commit('setIsShowDiscounts', checkOutResponse?.parkingRule?.enableCoupon || false);
+    // 会员等级减免
+    // 停车优惠(首停、会员减免、消费减免)
+    dispatch('getCheckedTotal', checkOutResponse);
+    // 是否开启新会员积分(hold)
+    commit('setEnableNewMemberPoints', checkOutResponse.parkingRule.enableNewMemberPoints);
+    // 积分减免
+    dispatch('pointsRule', checkOutResponse);
+    // dispatch('getIntegralDesc', checkOutResponse.parkingRule.enablePoints);
+    // 电子优惠券:是否启用
+    // 处理电子优惠券相关逻辑
+    dispatch('couponRule', checkOutResponse)
+    // 纸质优惠券(hold)
+    commit('setEnablePaperCoupons', checkOutResponse.parkingRule.enablePaperCoupons);
+    // 其他数据收集
+    commit('setUsingTotalDiscount', checkOutResponse.discountInfo.usingTotalDiscount);
+    commit('setActualPayFee', checkOutResponse.parkingRecord.actualPayFee);
+  },
+  // 停车优惠(首停、会员减免、消费减免)
+  getCheckedTotal({ commit, dispatch }, orderDetail) {
+    let checkedTotal = 0;
+    console.log(orderDetail);
+    if (orderDetail?.discountInfo.memberLevelDiscount && orderDetail?.discountInfo?.memberGrade.length) {
+      orderDetail.discountInfo.memberGrade.forEach(elm => {
+        if (elm.defaultSelected) {
+          checkedTotal++
+        }
+      })
+    }
+    if (orderDetail?.discountInfo?.consume?.length) {
+      orderDetail.discountInfo.consume.forEach(elm => {
+        if (elm.defaultSelected) {
+          checkedTotal++
+        }
+      })
+    }
+    commit('setMemberLevelDiscount', orderDetail.discountInfo.memberLevelDiscount);
+    commit('setCheckedTotal', checkedTotal);
+    dispatch('getDiscountDesc', {
+      orderDetail,
+      checkedTotal
+    })
+  },
+  getDiscountDesc({ commit, dispatch }, { orderDetail, checkedTotal }) {
+    if (orderDetail.parkingRule.enableConsume) {
+      commit('setEnableConsume', orderDetail.parkingRule.enableConsume);
+      if (checkedTotal > 0) {
+        return commit('setDiscountDesc', `已选择${checkedTotal}项优惠`)
+      }
+      return commit('setDiscountDesc', `立即使用`)
+    } else {
+      return commit('setDiscountDesc', `暂无可用优惠`)
+    }
+  },
+  // 积分相关计算(仅计算用户可使用的积分)
+  pointsRule({ commit, dispatch, state }, { discountInfo, parkingRule, parkInfo }) {
+    const { points,
+      usingTotalDiscount // 当前车辆的已使用优惠的总上限
+    } = discountInfo
+    const {
+      maxPointsTime = 0, // 最大积分
+      enablePoints,
+      maxOneDayDiscountFee // 每日最大优惠金额(深圳车场)
+    } = parkingRule
+    const [{
+      pointsPerHour,
+      available, // 用户可用的积分(当前车辆在) available是用户选择抵扣N小时后剩余的可用积分
+      maxDiscountFee,// 单次上限(元)
+      unitAmount, // 兑换值(元)
+      pointsPerUnit = 0 // 500积分对应的价值
+    }] = points
+
+    //
+    // // 如果当前车辆的已使用优惠的总上限小于每日最大优惠金额(深圳车场),自动计算积分逻辑
+    // if (usingTotalDiscount < maxOneDayDiscountFee) {
+    //   // 剩余可使用的优惠金额
+
+    //   // 计算当前用户的剩余积分可兑换的优惠金额
+    //   const discountFee = available / (pointsPerUnit / unitAmount);
+    //   // 如果用户的可兑换优惠金额大于 每日最大优惠金额(深圳车场)
+    //   console.log({ discountFee });
+    // }
+    commit('setEnablePoints', enablePoints);
+    commit('setAvailable', available);
+    commit('setMaxPointsTime', maxPointsTime);
+    commit('setPointsTime', maxPointsTime);
+    commit('setPointsPerUnit', pointsPerUnit);
+    commit('setMaxOneDayDiscountFee', maxOneDayDiscountFee)
+    // commit('setPointsPerHour', pointsPerHour)
+
+    console.log({pointsPerHour});
+    // 如果是深圳车场,动态计算已兑换的积分
+    if (maxPointsTime > 0) {
+      // // 需要在页面展示已选的积分
+      // // 先计算已选择的积分
+      // const usePoints = maxPointsTime * pointsPerUnit;
+      // console.log({ usePoints });
+      // commit('setUsePoints', maxPointsTime);
+      // console.log({maxPointsTime});
+      // if (usePoints && usePoints > pointsPerUnit) {
+
+      // }
+      // maxPointsTime
+      // 控制积分是否可选
+      // 深圳特殊处理(单位:金额
+      if (parkInfo.parkMallCode === 999) {
+        return commit('setIntegralDesc', `已选择兑换${maxPointsTime}元`)
+      }
+      return commit('setIntegralDesc', `已选择兑换${maxPointsTime}小时`)
+    }
+    if (available < pointsPerHour) {
+      return `${pointsPerHour}积分可停车1小时`;
+    }
+    if (
+      parkInfo.parkMallCode === 3 &&
+      enablePoints && !maxPointsTime
+    ) {
+      return commit('setIntegralDesc', `今日已达上限`);
+    }
+    return commit('setIntegralDesc', `${available}积分可减免`);
+  },
+  pointsMath({ commit, dispatch, state }, { type }) {
+    if (type === 'add' && state.pointsTime < state.maxPointsTime) {
+      const pointsTime = state.pointsTime + 1
+      // 如果是深圳车场
+      commit('setAvailable', state.available - state.pointsPerUnit);
+      commit('setPointsTime', pointsTime);
+    }
+    if (type === 'minus' && state.pointsTime > 0) {
+      const pointsTime = state.pointsTime - 1
+      // 如果是深圳车场
+      commit('setAvailable', state.available + state.pointsPerUnit);
+      commit('setPointsTime', pointsTime);
+    }
+  },
+  cancelPointsMath({ commit, dispatch, state }, callback) {
+    const { discountInfo: { points }, parkingRule } = state.orderDetail;
+    const [{ pointsPerHour, available }] = points
+    const { maxPointsTime, enablePoints } = parkingRule
+    commit('setAvailable', available);
+    commit('setPointsTime', maxPointsTime)
+    callback && callback()
+  },
+  async savePointsMath({ commit, dispatch, state }, callback) {
+    const orderDetail = { ...state.orderDetail };
+    // 计算积分修改之后的金额,返回给后端
+    orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount
+    try {
+      const res = await calculateDiscount({
+        ...orderDetail
+      })
+      console.log({res});
+      dispatch('orderInitRule', orderDetail)
+      callback && callback()
+    } catch (err) {
+      console.log('积分修改失败!', err);
+      callback && callback()
+    }
+    //
+  },
+  async saveCouponMath({ commit, dispatch, state }, {couponList, callback}) {
+    const orderDetail = { ...state.orderDetail };
+    orderDetail.discountInfo.coupons = couponList;
+
+    try {
+      const res = await calculateDiscount({
+        ...orderDetail
+      })
+      console.log({res});
+      dispatch('orderInitRule', orderDetail)
+      callback && callback()
+    } catch (err) {
+      console.log('积分修改失败!', err);
+      callback && callback()
+    }
+    // commit('setCoupons', checkOutResponse.discountInfo.coupons);
+
+  },
+  getIntegralDesc() {
+    // 自动勾选积分优惠
+    // 深圳是最大抵扣金额
+
+    // available
+
+    /*
+    if (this.duration > 0) {
+        // 深圳特殊处理(单位:金额)
+        if (this.parkMallCode === 5) {
+          return `已选择兑换${this.duration}元`;
+        }
+        return `已选择兑换${this.duration}小时`;
+      }
+      if (this.bonusCopy < this.integral) {
+        return `${this.integral}积分可停车1小时`;
+      }
+      if (
+        this.parkMallCode === 3 &&
+        this.member?.currnentintegral >= this.integral &&
+        !this.bonus
+      ) {
+        return `今日已达上限`;
+      }
+      return `${this.bonus}积分可减免`;
+    */
+  },
+  // 电子优惠券
+  couponRule({ commit, dispatch, state }, checkOutResponse) {
+    commit('setEnableCoupon', checkOutResponse.parkingRule.enableCoupon);
+    if (checkOutResponse.parkingRule.enableCoupon) {
+      // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
+      // const {
+      //   usingTotalDiscount, // 使用总抵扣
+      //   coupons
+      // } = checkOutResponse.discountInfo;
+      // const {
+      //   totalFee, // 应缴
+      //   actualPayFee // 应付金额
+      // } = checkOutResponse.parkingRecord;
+      // // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
+      // let remainPrice = remainConsumeTime * hourPrice;
+      // if ( remainPrice > actualPayFee ) {
+      //   remainPrice = actualPayFee;
+      // }
+      // let couponPrice = 0
+      // // 确认优惠券是否可选择
+      // let couponsList = coupons.sort((itema,itemb) => itema.discountFee - itemb.discountFee)
+      // couponsList = couponsList.map(elm => {
+      //   if ( !elm.defaultSelected ) {
+      //     if ( elm.discountFee <=  remainPrice && couponPrice <= remainPrice) {
+      //       elm.disabled = false
+      //     } else {
+      //       elm.disabled = true
+      //     }
+      //   }
+      // })
+      // console.log(343, {couponsList});
+      // commit('setCoupons', couponsList);
+
+      commit('setMaxOneDayCoupons', checkOutResponse.parkingRule.maxOneDayCoupons);// 仅在杭州使用
+      commit('setCoupons', checkOutResponse.discountInfo.coupons);
+      // 统计已选择优惠券
+      let couponCount = 0
+      checkOutResponse.discountInfo.coupons.forEach(elm => {
+        if (elm.defaultSelected) {
+          couponCount++
+        }
+      })
+      commit('setCouponCount', couponCount);
+      if (couponCount > 0) {
+        return commit('setCouponDesc', `已选择${couponCount}张优惠劵`);
+      } else {
+        if (couponCount > 0) {
+          return commit('setCouponDesc', `您有${couponCount}张可用优惠劵`);
+        }
+        return commit('setCouponDesc', `暂无可用优惠券`);
+      }
+    }
+  }
+
+  // 是否展示优惠
+  // getIsShowDiscounts({commit, dispatch}, orderDetail) {
+  //   params?.parkingRule?.enableCoupon
+  // }
+  // calculateDiscount
+
+  /*
+    如果积分发生变化
+  */
+}
+
+export default {
+  //开启命名模块
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}
+

+ 1 - 0
src/utils/index.js

@@ -122,6 +122,7 @@ export function getUrlParams(url = window.location.href) {
 
 // 根据不同环境和lsbid返回 groupId 和 mallId
 export function getGroupIdAndMallIdByLsbId(lbsId) {
+  console.log(125, lbsId);
   const lbsObj = lbsDictionary[lbsId];
   if (window.env === 'prod') {
     return lbsObj['prod'];

+ 407 - 384
src/utils/location.js

@@ -1,18 +1,21 @@
 // 获取位置信息
 // var QQMapWX = require('mixins/js/qqmap-wx-jssdk.js')
-import QQMapWX from '@/common/js/qqmap-wx-jssdk.js'
+import QQMapWX from '@/common/js/qqmap-wx-jssdk.js';
+
 var qqmapsdk = null;
-import log from './log'
+import log from './log';
 // import store from '@/store/install.js'
-import { kipAllCities } from '@/utils/api-kip.js'
-import { isKOMiniApp, isKOBrand } from './utils.js'
-import CacheTool from '@/utils/cache-tool.js'
+import { kipAllCities } from '@/utils/api-kip.js';
+import { isKOMiniApp, isKOBrand } from './utils.js';
+import CacheTool from '@/utils/cache-tool.js';
+
 export function location(that, mallid, scene, key) {
-	if (!mallid && (that.globalData.mallid || that.globalData.mallid !== '')) {
-		that.$isResolve()
-		return false
-	}
+  if (!mallid && (that.globalData.mallid || that.globalData.mallid !== '')) {
+    that.$isResolve();
+    return false;
+  }
 }
+
 // 	if (that.globalData.marketList.length == 0) {
 // 		kipAllCities().then(resp => {
 // 			if (!resp || !resp.hasOwnProperty("data")) {
@@ -183,127 +186,130 @@ export function location(that, mallid, scene, key) {
 // }
 
 export function compare(property) {
-	return function(a, b) {
-		var value1 = a[property];
-		var value2 = b[property];
-		return value1 - value2
-	}
+  return function (a, b) {
+    var value1 = a[property];
+    var value2 = b[property];
+    return value1 - value2;
+  };
 }
-export function getLocationAndSetDefaultMarket(app, store, setDefaultMarket) {
-	const mapKey = app.globalData.key;
-	qqmapsdk = new QQMapWX({
-		key: mapKey // 必填
-	})
-	let marketList = uni.getStorageSync("marketList") || app.globalData.marketList;
-	// crm 只保留定位杭州
-	if (!isKOMiniApp()) {
-		let crmArry = [];
-		marketList.map(item => {
-			if (!isKOBrand(item.groupId)){
-				crmArry.push(item);
-			}
-		})
-		marketList = crmArry;
-	}
-	const curMarket = uni.getStorageSync("curMarket");
-	if (curMarket) {
-		const { mallid } = curMarket
-		console.log(`===>获取到缓存中的商场信息, 缓存中的商场: ${mallid}`)
-		console.log(curMarket);
-		setDefaultMarket(app, store, marketList, mallid)
-		return;
-	}
-	var to = ""
-	marketList.forEach(item => {
-		if (item && item.latitude && item.longitude) {
-			to += (item.latitude + ',' + item.longitude + ';')
-		}
-	})
-	to = to.slice(0, to.length - 1)
-	uni.getLocation({
-		 type: 'wgs84',
-		 success (res) {
-			const latitude = res.latitude
-			const longitude = res.longitude
-			const location = latitude + ','+longitude
-			app.globalData.location = location;
-			qqmapsdk.calculateDistance({
-				from: location,
-				to: to,
-				success: (mapres) => {
-					console.log('===> 请求位置信息并计算最近的商场1')
-					for (let element of mapres.result.elements) {
-						for (let market of marketList) {
-							var latitude = parseFloat(market.latitude)
-							var longitude = parseFloat(market.longitude)
 
-							if (element.to.lat == latitude && element.to.lng ==
-								longitude) {
-								if (element.distance === 0) {
-									console.log(market)
-								}
-								market.distance = element.distance
-								break
-							}
-						}
-					}
-					// 移除无效的商场
-					marketList.sort(compare('distance'))
-					uni.setStorageSync("marketList", marketList);
-					let curMarket = marketList[0]  || {}
-					const { mallid } = curMarket
-					setDefaultMarket(app, store, marketList, mallid)
+export function getLocationAndSetDefaultMarket(app, store, setDefaultMarket) {
+  const mapKey = app.globalData.key;
+  qqmapsdk = new QQMapWX({
+    key: mapKey, // 必填
+  });
+  let marketList =
+    uni.getStorageSync('marketList') || app.globalData.marketList;
+  // crm 只保留定位杭州
+  if (!isKOMiniApp()) {
+    let crmArry = [];
+    marketList.map((item) => {
+      if (!isKOBrand(item.groupId)) {
+        crmArry.push(item);
+      }
+    });
+    marketList = crmArry;
+  }
+  const curMarket = uni.getStorageSync('curMarket');
+  if (curMarket) {
+    const { mallid } = curMarket;
+    console.log(`===>获取到缓存中的商场信息, 缓存中的商场: ${mallid}`);
+    console.log(curMarket);
+    setDefaultMarket(app, store, marketList, mallid);
+    return;
+  }
+  var to = '';
+  marketList.forEach((item) => {
+    if (item && item.latitude && item.longitude) {
+      to += item.latitude + ',' + item.longitude + ';';
+    }
+  });
+  to = to.slice(0, to.length - 1);
+  uni.getLocation({
+    type: 'wgs84',
+    success(res) {
+      const latitude = res.latitude;
+      const longitude = res.longitude;
+      const location = latitude + ',' + longitude;
+      app.globalData.location = location;
+      qqmapsdk.calculateDistance({
+        from: location,
+        to: to,
+        success: (mapres) => {
+          console.log('===> 请求位置信息并计算最近的商场1');
+          for (let element of mapres.result.elements) {
+            for (let market of marketList) {
+              var latitude = parseFloat(market.latitude);
+              var longitude = parseFloat(market.longitude);
 
-				},
-				fail: (err) => {
-					log.error(err);
-					console.error(`===> 计算最近距离失败(getLocationAndSetDefaultMarket):使用默认商场`)
-					uni.showModal({
-						title: '提示',
-						content: '计算距离错误,请手动选择商场',
-						confirmText: '去选择',
-						showCancel: false,
-						success() {
-							setTimeout(() => {
-								if (app.$isResolve) {
-									app.$isResolve()
-									console.log('===>location $isResolve')
-								}
-								uni.navigateTo({
-									url: '/pages/chooseProject/chooseProject'
-								})
-							}, 1500)
-						}
-					})
-					// const list = marketList.filter(e => e.defaultFlag)
-					// let curMarket = list[0] || marketList[0]
-					// const { mallid } = curMarket
-					// setDefaultMarket(app, store, marketList, mallid)
-				}
-			})
-		},
-		fail () {
-			console.warn("===> 用户取消位置授权0")
-			log.warn('用户取消位置授权0')
-			if (app.$isResolve) {
-				app.$isResolve()
-				console.log('===>location $isResolve')
-			}
-			uni.navigateTo({
-				url: '/pages/chooseProject/chooseProject'
-			})
-			// const list = marketList.filter(e => e.defaultFlag)
-			// let curMarket = list[0]  || marketList[0]
-			// const { mallid } = curMarket
-			// setDefaultMarket(app, store, marketList, mallid)
-		}
-	})
+              if (element.to.lat == latitude && element.to.lng == longitude) {
+                if (element.distance === 0) {
+                  console.log(market);
+                }
+                market.distance = element.distance;
+                break;
+              }
+            }
+          }
+          // 移除无效的商场
+          marketList.sort(compare('distance'));
+          uni.setStorageSync('marketList', marketList);
+          let curMarket = marketList[0] || {};
+          const { mallid } = curMarket;
+          setDefaultMarket(app, store, marketList, mallid);
+        },
+        fail: (err) => {
+          log.error(err);
+          console.error(
+            `===> 计算最近距离失败(getLocationAndSetDefaultMarket):使用默认商场`
+          );
+          uni.showModal({
+            title: '提示',
+            content: '计算距离错误,请手动选择商场',
+            confirmText: '去选择',
+            showCancel: false,
+            success() {
+              setTimeout(() => {
+                if (app.$isResolve) {
+                  app.$isResolve();
+                  console.log('===>location $isResolve');
+                }
+                uni.navigateTo({
+                  url: '/pages/chooseProject/chooseProject',
+                });
+              }, 1500);
+            },
+          });
+          // const list = marketList.filter(e => e.defaultFlag)
+          // let curMarket = list[0] || marketList[0]
+          // const { mallid } = curMarket
+          // setDefaultMarket(app, store, marketList, mallid)
+        },
+      });
+    },
+    fail() {
+      console.warn('===> 用户取消位置授权0');
+      log.warn('用户取消位置授权0');
+      if (app.$isResolve) {
+        app.$isResolve();
+        console.log('===>location $isResolve');
+      }
+      uni.navigateTo({
+        url: '/pages/chooseProject/chooseProject',
+      });
+      // const list = marketList.filter(e => e.defaultFlag)
+      // let curMarket = list[0]  || marketList[0]
+      // const { mallid } = curMarket
+      // setDefaultMarket(app, store, marketList, mallid)
+    },
+  });
 }
 
-export function getMarketListDefault (marketList) {
-	if (!marketList) return null;
-	const list = marketList.filter(e => e.defaultFlag)
+export function getMarketListDefault(marketList) {
+  if (!marketList) return null;
+  const list = marketList.filter((e) => e.defaultFlag);
 }
+
 /**
  * 如果当前缓存中没有mallid则获取会员位置并计算最近的商场并将商场为默认mallid
  * @param {Object} app
@@ -311,283 +317,300 @@ export function getMarketListDefault (marketList) {
  * @param {Object} isQrcode
  * @param {Object} setDefaultMarket
  */
-export function getLocationAndSetDefaultMarketNotUseCache(app, store, setDefaultMarket, isQrcode) {
-	const mapKey = app.globalData.key;
-	qqmapsdk = new QQMapWX({
-		key: mapKey // 必填
-	})
-	let marketList = uni.getStorageSync("marketList") || app.globalData.marketList;
-	// crm杭州小程序
-	if (!isKOMiniApp()) {
-		let crmArry = [];
-		marketList.map(item => {
-			if (!isKOBrand(item.groupId)){
-				crmArry.push(item);
-			}
-	     })
-		marketList = crmArry;
-	}
-	var to = ""
-	marketList.forEach(item => {
-		if (item && item.latitude && item.longitude) {
-			to += (item.latitude + ',' + item.longitude.trim() + ';')
-		}
-	})
-	to = to.slice(0, to.length - 1);
-	uni.getLocation({
-		type: 'wgs84',
-		success (res) {
-			const latitude = res.latitude
-			const longitude = res.longitude
-			const location = latitude + ','+longitude
-			app.globalData.location = location;
-			qqmapsdk.calculateDistance({
-				from: location,
-				to: to,
-				success: (mapres) => {
-					console.log('===> 请求位置信息并计算最近的商场2')
-					for (let element of mapres.result.elements) {
-						for (let market of marketList) {
-							var latitude = parseFloat(market.latitude)
-							var longitude = parseFloat(market.longitude.trim())
-
-							if (element.to.lat == latitude && element.to.lng ==
-								longitude) {
-								if (element.distance === 0) {
-									console.log(market)
-								}
-								market.distance = element.distance
-								break
-							}
-						}
-					}
-					// 移除无效的商场
-					marketList.sort(compare('distance'))
-					uni.setStorageSync("marketList", marketList);
-					// 如果没有商场则设置最近的商场否则只计算不保存
-					const currentMallid = uni.getStorageSync("mallid");
-					if (!currentMallid) {
-						let curMarket = marketList[0]  || {}
-						const { mallid } = curMarket
-						setDefaultMarket(app, store, marketList, mallid, isQrcode)
-					}
-				},
-				fail: (err) => {
-					log.error(err);
-					console.error(`===> 计算最近距离错误(getLocationAndSetDefaultMarketNotUseCache):使用默认商场`)
-					uni.showModal({
-						title: '提示',
-						content: '计算距离错误,请手动选择商场',
-						confirmText: '去选择',
-						showCancel: false,
-						success() {
-							setTimeout(() => {
-								if (app.$isResolve) {
-									app.$isResolve()
-									console.log('===>location1 $isResolve')
-								}
-								uni.navigateTo({
-									url: '/pages/chooseProject/chooseProject'
-								})
-							}, 1500)
-						}
-					})
-					// const list = marketList.filter(e => e.defaultFlag)
-					// let curMarket = list[0] || marketList[0]
-					// const { mallid } = curMarket
-					// setDefaultMarket(app, store, marketList, mallid, isQrcode)
-				}
-			})
-		},
-		fail () {
-			console.warn("===> 用户取消位置授权1")
-			log.warn('用户取消位置授权1')
-			if (app.$isResolve) {
-				app.$isResolve()
-				console.log('===>location1 $isResolve')
-			}
-			uni.navigateTo({
-				url: '/pages/chooseProject/chooseProject'
-			})
-			// const currentMallid = uni.getStorageSync("mallid");
-			// if (!currentMallid) {
-			// 	const list = marketList.filter(e => e.defaultFlag)
-			// 	let curMarket = list[0]  || marketList[0]
-			// 	const { mallid } = curMarket
-			// 	setDefaultMarket(app, store, marketList, mallid, isQrcode)
-			// }
+export function getLocationAndSetDefaultMarketNotUseCache(
+  app,
+  store,
+  setDefaultMarket,
+  isQrcode
+) {
+  const mapKey = app.globalData.key;
+  qqmapsdk = new QQMapWX({
+    key: mapKey, // 必填
+  });
+  let marketList =
+    uni.getStorageSync('marketList') || app.globalData.marketList;
+  // crm杭州小程序
+  if (!isKOMiniApp()) {
+    let crmArry = [];
+    marketList.map((item) => {
+      if (!isKOBrand(item.groupId)) {
+        crmArry.push(item);
+      }
+    });
+    marketList = crmArry;
+  }
+  var to = '';
+  marketList.forEach((item) => {
+    if (item && item.latitude && item.longitude) {
+      to += item.latitude + ',' + item.longitude.trim() + ';';
+    }
+  });
+  to = to.slice(0, to.length - 1);
+  uni.getLocation({
+    type: 'wgs84',
+    success(res) {
+      const latitude = res.latitude;
+      const longitude = res.longitude;
+      const location = latitude + ',' + longitude;
+      app.globalData.location = location;
+      qqmapsdk.calculateDistance({
+        from: location,
+        to: to,
+        success: (mapres) => {
+          console.log('===> 请求位置信息并计算最近的商场2');
+          for (let element of mapres.result.elements) {
+            for (let market of marketList) {
+              var latitude = parseFloat(market.latitude);
+              var longitude = parseFloat(market.longitude.trim());
 
-		}
-	})
+              if (element.to.lat == latitude && element.to.lng == longitude) {
+                if (element.distance === 0) {
+                  console.log(market);
+                }
+                market.distance = element.distance;
+                break;
+              }
+            }
+          }
+          // 移除无效的商场
+          marketList.sort(compare('distance'));
+          uni.setStorageSync('marketList', marketList);
+          // 如果没有商场则设置最近的商场否则只计算不保存
+          const currentMallid = uni.getStorageSync('mallid');
+          if (!currentMallid) {
+            let curMarket = marketList[0] || {};
+            const { mallid } = curMarket;
+            setDefaultMarket(app, store, marketList, mallid, isQrcode);
+          }
+        },
+        fail: (err) => {
+          log.error(err);
+          console.error(
+            `===> 计算最近距离错误(getLocationAndSetDefaultMarketNotUseCache):使用默认商场`
+          );
+          uni.showModal({
+            title: '提示',
+            content: '计算距离错误,请手动选择商场',
+            confirmText: '去选择',
+            showCancel: false,
+            success() {
+              setTimeout(() => {
+                if (app.$isResolve) {
+                  app.$isResolve();
+                  console.log('===>location1 $isResolve');
+                }
+                uni.navigateTo({
+                  url: '/pages/chooseProject/chooseProject',
+                });
+              }, 1500);
+            },
+          });
+          // const list = marketList.filter(e => e.defaultFlag)
+          // let curMarket = list[0] || marketList[0]
+          // const { mallid } = curMarket
+          // setDefaultMarket(app, store, marketList, mallid, isQrcode)
+        },
+      });
+    },
+    fail() {
+      console.warn('===> 用户取消位置授权1');
+      log.warn('用户取消位置授权1');
+      if (app.$isResolve) {
+        app.$isResolve();
+        console.log('===>location1 $isResolve');
+      }
+      uni.navigateTo({
+        url: '/pages/chooseProject/chooseProject',
+      });
+      // const currentMallid = uni.getStorageSync("mallid");
+      // if (!currentMallid) {
+      // 	const list = marketList.filter(e => e.defaultFlag)
+      // 	let curMarket = list[0]  || marketList[0]
+      // 	const { mallid } = curMarket
+      // 	setDefaultMarket(app, store, marketList, mallid, isQrcode)
+      // }
+    },
+  });
 }
 
 // 过滤 KO 的商城
 export function filterKOMarket(marketList) {
-	if (!isKOMiniApp()) {
-		let crmArry = [];
-		marketList.map(item => {
-			if (!isKOBrand(item.groupId)){
-				crmArry.push(item);
-			}
-		})
-		return crmArry;
-	}
-	return marketList
+  if (!isKOMiniApp()) {
+    let crmArry = [];
+    marketList.map((item) => {
+      if (!isKOBrand(item.groupId)) {
+        crmArry.push(item);
+      }
+    });
+    return crmArry;
+  }
+  return marketList;
 }
 
 // 构建 腾讯地图-计算距离 需要用到的参数
-	export function buildQQMapSdkCalculateParams(marketList) {
-	let to = ""
-	marketList.forEach(item => {
-		if (item && item.latitude && item.longitude) {
-			to += (item.latitude + ',' + item.longitude + ';')
-		}
-	})
-	to = to.slice(0, to.length - 1)
-	return to;
+export function buildQQMapSdkCalculateParams(marketList) {
+  let to = '';
+  marketList.forEach((item) => {
+    if (item && item.latitude && item.longitude) {
+      to += item.latitude + ',' + item.longitude + ';';
+    }
+  });
+  to = to.slice(0, to.length - 1);
+  return to;
 }
 
 // 设置商城与当前会员定位的距离,如有 限制距离 则根据限制距离过滤
-export function setMarketDistanceByLbsCalculResult (marketList, calculResult, limitDistance) {
-	for (let element of calculResult) {
-		for (let market of marketList) {
-			const latitude = parseFloat(market.latitude)
-			const longitude = parseFloat(market.longitude)
-			if (element.to.lat == latitude  && element.to.lng == longitude) {
-				market.distance = element.distance
-				break
-			}
-		}
-	}
-	marketList.sort(compare('distance'))
-	uni.setStorageSync('marketList', marketList)
-	let newLbsList = [];
-	if (limitDistance && limitDistance > 0) {
-		const km = limitDistance * 1000;
-		if (marketList && marketList.length > 0) {
-			marketList.forEach(item => {
-				if (item.distance <= km) {
-					newLbsList.push(item);
-				}
-			})
-		}
-	} else {
-		newLbsList = marketList;
-	}
-	return newLbsList;
+export function setMarketDistanceByLbsCalculResult(
+  marketList,
+  calculResult,
+  limitDistance
+) {
+  for (let element of calculResult) {
+    for (let market of marketList) {
+      const latitude = parseFloat(market.latitude);
+      const longitude = parseFloat(market.longitude);
+      if (element.to.lat == latitude && element.to.lng == longitude) {
+        market.distance = element.distance;
+        break;
+      }
+    }
+  }
+  marketList.sort(compare('distance'));
+  uni.setStorageSync('marketList', marketList);
+  let newLbsList = [];
+  if (limitDistance && limitDistance > 0) {
+    const km = limitDistance * 1000;
+    if (marketList && marketList.length > 0) {
+      marketList.forEach((item) => {
+        if (item.distance <= km) {
+          newLbsList.push(item);
+        }
+      });
+    }
+  } else {
+    newLbsList = marketList;
+  }
+  return newLbsList;
 }
 
 export function getLocationIsLimit(preGetLocationTime) {
-	const curTime = new Date().getTime();
-	if (!preGetLocationTime) {
-		return false;
-	}
-	const limit = curTime - preGetLocationTime;
-	const REQ_lOCATION_TIME_LIMIT = CacheTool.getCurEnvConst().REQ_lOCATION_TIME_LIMIT;
-	if (limit < REQ_lOCATION_TIME_LIMIT) {
-		return true;
-	} else {
-		return false;
-	}
-}
-export function getLocation (app, store, marketList) {
-	return new Promise((resolve, reject) => {
-		const isLimit = getLocationIsLimit(store.state.getLocationTime);
-		if (isLimit) {
-			const REQ_lOCATION_TIME_LIMIT = CacheTool.getCurEnvConst().REQ_lOCATION_TIME_LIMIT;
-			const s = (REQ_lOCATION_TIME_LIMIT / 1000)
-			reject(`获取定位太频繁,请间隔${s}秒`)
-		} else {
-			marketList = filterKOMarket(marketList);
-			// 检查定位权限
-			uni.getSetting({
-				success(res) {
-					if (res.authSetting['scope.userLocation']) {
-						getLocationByPromise(app, store, marketList, resolve, reject)
-					} else if (!res.authSetting['scope.userLocation']) {
-						// 请求获取定位权限
-						uni.authorize({
-							scope: 'scope.userLocation',
-							success(res) {
-								getLocationByPromise(app, store, marketList, resolve, reject)
-							},
-							fail() {
-								// 手动打开定位权限
-								uni.showModal({
-									title: '提示',
-									content: '是否打开定位',
-									success(res) {
-										if (res.confirm) {
-											uni.openSetting({
-												success(res) {
-													log.info('打开授权成功');
-													console.info('===>打开授权成功')
-													reject('授权定位成功,请重新定位')
-												},
-												fail() {
-													reject('打开定位失败')
-												}
-											})
-										}
-									},
-								})
-							}
-						})
-					}
-				},
-				fail() {
-					reject('获取授权信息失败')
-				},
-			})
-		}
-	})
+  const curTime = new Date().getTime();
+  if (!preGetLocationTime) {
+    return false;
+  }
+  const limit = curTime - preGetLocationTime;
+  const REQ_lOCATION_TIME_LIMIT =
+    CacheTool.getCurEnvConst().REQ_lOCATION_TIME_LIMIT;
+  if (limit < REQ_lOCATION_TIME_LIMIT) {
+    return true;
+  } else {
+    return false;
+  }
 }
 
-export function getLocationByPromise (app, store, marketList, resolve, reject) {
-	uni.showLoading({
-		mask: true,
-	})
-	uni.getLocation({
-		 type: 'wgs84',
-		 success (res) {
-			const latitude = res.latitude
-			const longitude = res.longitude
-			const location = latitude + ','+longitude
-			const to = buildQQMapSdkCalculateParams(marketList)
-			const mapKey = app.globalData.key;
-			qqmapsdk = new QQMapWX({
-				key: mapKey
-			})
-			qqmapsdk.calculateDistance({
-				from: location,
-				to: to,
-				success: (mapres) => {
-					const calculResult = mapres.result.elements;
-					const LOCATION_DISTANCE_RANGE = CacheTool.getCurEnvConst().LOCATION_DISTANCE_RANGE;
-					const newLbsList = setMarketDistanceByLbsCalculResult(marketList, calculResult, LOCATION_DISTANCE_RANGE);
-					if (newLbsList && newLbsList.length > 0) {
-						resolve(newLbsList)
-					} else {
-						reject(`您附近${LOCATION_DISTANCE_RANGE}公里范围内无位置信息`)
-					}
-					store.commit('saveGetLocationTime')
+export function getLocation(app, store, marketList) {
+  return new Promise((resolve, reject) => {
+    const isLimit = getLocationIsLimit(store.state.getLocationTime);
+    if (isLimit) {
+      const REQ_lOCATION_TIME_LIMIT =
+        CacheTool.getCurEnvConst().REQ_lOCATION_TIME_LIMIT;
+      const s = REQ_lOCATION_TIME_LIMIT / 1000;
+      reject(`获取定位太频繁,请间隔${s}秒`);
+    } else {
+      marketList = filterKOMarket(marketList);
+      // 检查定位权限
+      uni.getSetting({
+        success(res) {
+          if (res.authSetting['scope.userLocation']) {
+            getLocationByPromise(app, store, marketList, resolve, reject);
+          } else if (!res.authSetting['scope.userLocation']) {
+            // 请求获取定位权限
+            uni.authorize({
+              scope: 'scope.userLocation',
+              success(res) {
+                getLocationByPromise(app, store, marketList, resolve, reject);
+              },
+              fail() {
+                // 手动打开定位权限
+                uni.showModal({
+                  title: '提示',
+                  content: '是否打开定位',
+                  success(res) {
+                    if (res.confirm) {
+                      uni.openSetting({
+                        success(res) {
+                          log.info('打开授权成功');
+                          console.info('===>打开授权成功');
+                          reject('授权定位成功,请重新定位');
+                        },
+                        fail() {
+                          reject('打开定位失败');
+                        },
+                      });
+                    }
+                  },
+                });
+              },
+            });
+          }
+        },
+        fail() {
+          reject('获取授权信息失败');
+        },
+      });
+    }
+  });
+}
 
-				},
-				fail: (err) => {
-					log.error(err);
-					console.error(`===> 计算最近距离失败(getLocation)`)
-					store.commit('saveGetLocationTime')
-					reject('计算距离失败')
-				}
-			})
-		},
-		fail () {
-			console.warn("===> 用户取消位置授权(getLocation)")
-			log.warn('用户取消位置授权(getLocation)')
-			store.commit('saveGetLocationTime')
-			reject('位置授权失败')
-		}
-	})
+export function getLocationByPromise(app, store, marketList, resolve, reject) {
+  uni.showLoading({
+    mask: true,
+  });
+  uni.getLocation({
+    type: 'wgs84',
+    success(res) {
+      const latitude = res.latitude;
+      const longitude = res.longitude;
+      const location = latitude + ',' + longitude;
+      const to = buildQQMapSdkCalculateParams(marketList);
+      const mapKey = app.globalData.key;
+      qqmapsdk = new QQMapWX({
+        key: mapKey,
+      });
+      qqmapsdk.calculateDistance({
+        from: location,
+        to: to,
+        success: (mapres) => {
+          const calculResult = mapres.result.elements;
+          const LOCATION_DISTANCE_RANGE =
+            CacheTool.getCurEnvConst().LOCATION_DISTANCE_RANGE;
+          const newLbsList = setMarketDistanceByLbsCalculResult(
+            marketList,
+            calculResult,
+            LOCATION_DISTANCE_RANGE
+          );
+          if (newLbsList && newLbsList.length > 0) {
+            resolve(newLbsList);
+          } else {
+            reject(`您附近${LOCATION_DISTANCE_RANGE}公里范围内无位置信息`);
+          }
+          store.commit('saveGetLocationTime');
+        },
+        fail: (err) => {
+          log.error(err);
+          console.error(`===> 计算最近距离失败(getLocation)`);
+          store.commit('saveGetLocationTime');
+          reject('计算距离失败');
+        },
+      });
+    },
+    fail() {
+      console.warn('===> 用户取消位置授权(getLocation)');
+      log.warn('用户取消位置授权(getLocation)');
+      store.commit('saveGetLocationTime');
+      reject('位置授权失败');
+    },
+  });
 }
 
 // export default {

+ 2 - 0
vue.config.js

@@ -108,6 +108,8 @@ module.exports = {
       },
       '/msApi': {
         target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
+        // target: 'http://172.21.203.140:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL   2023-2-9
+        // target: 'http://172.21.203.20:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
         //ws: true, // proxy websockets
         //pathRewrite方法重写url