username il y a 1 semaine
Parent
commit
1f705d19ca

+ 2 - 1
package.json

@@ -4,7 +4,7 @@
   "private": true,
   "scripts": {
     "serve": "npm run dev:h5",
-    "build": "npm run build:h5",
+    "build": "npm run build",
     "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
     "build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
     "build:h5": "cross-env UNI_OUTPUT_DIR='build' NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
@@ -48,6 +48,7 @@
     "test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
   },
   "dependencies": {
+    "@aligov/jssdk-mgop": "^3.1.9",
     "@dcloudio/uni-app-plus": "^2.0.1-34920220630001",
     "@dcloudio/uni-h5": "^2.0.1-34920220630001",
     "@dcloudio/uni-helper-json": "^1.0.13",

+ 8 - 8
public/index.html

@@ -19,14 +19,14 @@
       rel="stylesheet"
       href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css"
     />
-    <!--<script-->
-    <!--  type="text/javascript"-->
-    <!--  src="//assets.zjzwfw.gov.cn/assets/ZWJSBridge/1.1.0/zwjsbridge.js"-->
-    <!--&gt;</script>-->
-    <!--<script-->
-    <!--  type="text/javascript"-->
-    <!--  src="//assets.zjzwfw.gov.cn/assets/zwlog/1.0.0/zwlog.js"-->
-    <!--&gt;</script>-->
+    <script
+      type="text/javascript"
+      src="//assets.zjzwfw.gov.cn/assets/ZWJSBridge/1.1.0/zwjsbridge.js"
+    ></script>
+    <script
+      type="text/javascript"
+      src="//assets.zjzwfw.gov.cn/assets/zwlog/1.0.0/zwlog.js"
+    ></script>
   </head>
 
   <body>

+ 2 - 5
src/App.vue

@@ -74,11 +74,8 @@ export default {
     menuRight: "",
   },
   onLaunch() {
-      const url = window.location.href;
-      const urlObj = new URL(url);
-      const params = new URLSearchParams(urlObj.search);
-      const isDebugMode = params.has('debug') && params.get('debug') === 'true';
-      if (isDebugMode) {
+//    new Vconsole();
+      if (localStorage.getItem('debug')==='true') {
         new Vconsole();
       }
   },

+ 0 - 18
src/api/commitment.js

@@ -139,21 +139,3 @@ export function editVerifyTask (data) {
     const url = zlbApi.editVerifyTask;
     return myFetch(url, 'post', data, 'json');
 }
-
-/**
- * 提醒列表
- * /promise/reminder/getReminderList
- */
-export function getReminderList (data) {
-    const url = zlbApi.getReminderList;
-    return myFetch(url, 'get', data, 'json');
-}
-
-/**
- * 提醒详情
- * /promise/reminder/reminderDetails
- */
-export function reminderDetails (data) {
-    const url = zlbApi.reminderDetails;
-    return myFetch(url, 'get', data, 'json');
-}

+ 6 - 15
src/api/control.js

@@ -5,44 +5,35 @@ import zlbApi from '@/api/zlbApi';
 // 服务和门牌搜索 '/doorplateInfoApp/searchDoorplateOrIntegrationAppList'
 export const search = (data) => {
     const url = zlbApi.searchDoorplateOrIntegrationAppList; // '/doorplateInfoApp/searchDoorplateOrIntegrationAppList'
-    return myFetch(url, 'post', data,'json');
+    return myFetch(url, 'post', data);
 }
 
 // 门牌绑定微信 '/doorplateInfoApp/doorplateBindWxAndValid'
 export const bindOpenidAndDoor = (data) => {
     const url = zlbApi.doorplateBindWxAndValid; // '/doorplateInfoApp/doorplateBindWxAndValid'
-    return myFetch(url, 'post', data,'json');
+    return myFetch(url, 'post', data);
 }
 
 // 所有门牌服务列表 '/doorplateInfoApp/getAllIntegrationAppList'
 export const getServiceList = (data) => {
     const url = zlbApi.getAllIntegrationAppList; // '/doorplateInfoApp/getAllIntegrationAppList'
-    return myFetch(url, 'post', data,'json');
+    return myFetch(url, 'post', data);
 }
 
 // 获取门牌信息 '/doorplateInfoApp/getHomePageOneDoorplateFullInfo'
 export const getDoorplateInfo = (data) => {
     const url = zlbApi.getHomePageOneDoorplateFullInfo; // '/doorplateInfoApp/getHomePageOneDoorplateFullInfo'
-    return myFetch(url, 'post', data,'json');
+    return myFetch(url, 'post', data);
 }
 
 // 获取企业门牌的处罚、失信、经营异常列表 '/doorplateInfoApp/getCorpCfSxYcListByDoorplateAndTyshxydm'
 export const getCropRiskList = (data) => {
     const url = zlbApi.getCorpCfSxYcListByDoorplateAndTyshxydm; // '/doorplateInfoApp/getCorpCfSxYcListByDoorplateAndTyshxydm'
-    return myFetch(url, 'post', data,'json');
+    return myFetch(url, 'post', data);
 }
 
 // 门牌户主信息申请 '/doorplateInfoApp/hzInfoApply'
 export const saveHzInfo = (data) => {
     const url = zlbApi.hzInfoApply; // '/doorplateInfoApp/hzInfoApply'
-    return myFetch(url, 'post', data,'json');
-}
-
-/**
- * 新接口 获取门牌详情
- * get /business/applet-house-number/appletHouseNumberInfo
- */
-export const getDoorplateInfoNew=(data)=>{
-    const url = zlbApi.getDoorplateInfoNew;
-    return myFetch(url, 'get', data, 'json');
+    return myFetch(url, 'post', data);
 }

+ 1 - 2
src/api/map.js

@@ -3,8 +3,7 @@ import {  myFetch } from "../utils/fetch";
 const amapFile = require("@/libs/amap-wx.130.js");
 // 高德地图微信组件
 const myAmapFun = new amapFile.AMapWX({
-//  key: "5d8515c6bf9f852b092fb8c297036a9c",
-  key: "6c10de64f2a22f25eebc3b03b7e2fc69",
+  key: "dc4bf920c8c1ef8b6f316f4ebcf0a9e2",
 });
 const mapKey = "8ad6b1c0f18f26a721871ca50e751ef9"; // 高德地图web api
 const API = {

+ 1 - 19
src/api/system.js

@@ -38,23 +38,5 @@ export function downloadFile(data) {
  */
 export function ZzdLogin(data) {
   const url = zlbApi.ZzdLogin;
-    return myFetch(url, "post", data, "json");
-}
-
-/**
- * 浙政钉 获取用户信息
- * /system/exemption
- */
-export function exemption(data) {
-  const url = zlbApi.exemption;
-  return myFetch(url, "post", data, "json");
-}
-
-/**
- * 获取村社链接
- * /business/address/getVillageLink
- */
-export const getVillageLink=(data)=>{
-  const url = zlbApi.getVillageLink
-  return myFetch(url, 'get', data, 'json');
+    return myFetch(url, "get", data, "json");
 }

+ 34 - 44
src/api/zlbApi.js

@@ -68,51 +68,45 @@
 
 
 const zlbApi = {
-    "callingPoliceSave": "/digital-doorplate/callingPolice/save", // 保存反映信息的API路径
-    "callingPolicePageData": "/digital-doorplate/callingPolice/selectPageData", // 查询反映记录的API路径
-    "callingPoliceDetail": "/digital-doorplate/callingPolice/detail", // 查询反映详情的API路径
-    "searchDoorplateOrIntegrationAppList": "/digital-doorplate/doorplateInfoApp/searchDoorplateOrIntegrationAppList", // 服务和门牌搜索的API路径
-    "doorplateBindWxAndValid": "/digital-doorplate/doorplateInfoApp/doorplateBindWxAndValid", // 门牌绑定微信的API路径
-    "getAllIntegrationAppList": "/digital-doorplate/doorplateInfoApp/getAllIntegrationAppList", // 所有门牌服务列表的API路径
-    "getHomePageOneDoorplateFullInfo": "/digital-doorplate/doorplateInfoApp/getHomePageOneDoorplateFullInfo", // 获取门牌信息的API路径
-    "getCorpCfSxYcListByDoorplateAndTyshxydm": "/digital-doorplate/doorplateInfoApp/getCorpCfSxYcListByDoorplateAndTyshxydm", // 获取企业门牌的处罚、失信、经营异常列表的API路径
-    "hzInfoApply": "/digital-doorplate/doorplateInfoApp/hzInfoApply", // 门牌户主信息申请的API路径
-    "getDoorplateFamilyMemberList": "/digital-doorplate/doorplateFamilyMember/getDoorplateFamilyMemberList", // 家庭成员列表查询的API路径
-    "doorplateFamilyMemberGetOneById": "/digital-doorplate/doorplateFamilyMember/getOneById", // 获取单个成员详情数据的API路径
-    "doorplateFamilyMemberAdd": "/digital-doorplate/doorplateFamilyMember/add", // 添加家庭成员的API路径
-    "doorplateFamilyMemberEditById": "/digital-doorplate/doorplateFamilyMember/editById", // 编辑家庭成员的API路径
-    "doorplateFamilyMemberDeleteById": "/digital-doorplate/doorplateFamilyMember/deleteById", // 删除家庭成员的API路径
-    "callingHelpSave": "/digital-doorplate/callingHelp/save", // 保存求助信息的API路径
-    "callingHelpPageData": "/digital-doorplate/callingHelp/selectPageData", // 查询求助记录的API路径
-    "callingHelpDetail": "/digital-doorplate/callingHelp/detail", // 查询求助详情的API路径
-    "getRelateInfo": "/digital-doorplate/callingHelp/getRelateInfo", // 查询门牌关联事件的API路径
-    "noticePage": "/business/Message/getMessagePage", // 查询公告列表的API路径
-    "noticeDetail": "/digital-doorplate/notice/detail", // 查询公告详情的API路径
-    "getNamesCultureByCode": "/digital-doorplate/namesCulture/getByCode", // 获取地名文化信息的API路径
-    "getNamesCultureByName": "/digital-doorplate/namesCulture/page", // 通过名称查询地名文化信息的API路径
-    "fwzlRentOutAdd": "/digital-doorplate/fwzlRentOut/add", // 发布房屋的API路径
-    "getFwzlRentOutListOfMy": "/digital-doorplate/fwzlRentOut/getFwzlRentOutListOfMy", // 查询发布记录的API路径
-    "fwzlRentOutEditById": "/digital-doorplate/fwzlRentOut/editById", // 修改发布记录的API路径
-    "fwzlRentOutGetOneById": "/digital-doorplate/fwzlRentOut/getOneById", // 查询发布房屋详情的API路径
-    "fwzlRentOutDeleteById": "/digital-doorplate/fwzlRentOut/deleteById", // 删除发布记录的API路径
-    "getFwzlRentList": "/digital-doorplate/fwzlRent/getFwzlRentList", // 我要租房列表的API路径
-    "getDictionaryByName": "/digital-doorplate/system/getDictionaryByName", // 字典查询接口的API路径
-    "getDicByNameList": "/digital-doorplate/system/getDicByNameList", // 批量查询字典内容的API路径
-    "listArea": "/digital-doorplate/system/listArea", // 查询地区的API路径
-    "uploadBase64": "/digital-doorplate/file/upload", // 上传文件的API路径
-    "fileDownload": "/digital-doorplate/file/download?fileUuid", // 下载文件的API路径
+    "callingPoliceSave": "/callingPolice/save", // 保存反映信息的API路径
+    "callingPolicePageData": "/callingPolice/selectPageData", // 查询反映记录的API路径
+    "callingPoliceDetail": "/callingPolice/detail", // 查询反映详情的API路径
+    "searchDoorplateOrIntegrationAppList": "/doorplateInfoApp/searchDoorplateOrIntegrationAppList", // 服务和门牌搜索的API路径
+    "doorplateBindWxAndValid": "/doorplateInfoApp/doorplateBindWxAndValid", // 门牌绑定微信的API路径
+    "getAllIntegrationAppList": "/doorplateInfoApp/getAllIntegrationAppList", // 所有门牌服务列表的API路径
+    "getHomePageOneDoorplateFullInfo": "/doorplateInfoApp/getHomePageOneDoorplateFullInfo", // 获取门牌信息的API路径
+    "getCorpCfSxYcListByDoorplateAndTyshxydm": "/doorplateInfoApp/getCorpCfSxYcListByDoorplateAndTyshxydm", // 获取企业门牌的处罚、失信、经营异常列表的API路径
+    "hzInfoApply": "/doorplateInfoApp/hzInfoApply", // 门牌户主信息申请的API路径
+    "getDoorplateFamilyMemberList": "/doorplateFamilyMember/getDoorplateFamilyMemberList", // 家庭成员列表查询的API路径
+    "doorplateFamilyMemberGetOneById": "/doorplateFamilyMember/getOneById", // 获取单个成员详情数据的API路径
+    "doorplateFamilyMemberAdd": "/doorplateFamilyMember/add", // 添加家庭成员的API路径
+    "doorplateFamilyMemberEditById": "/doorplateFamilyMember/editById", // 编辑家庭成员的API路径
+    "doorplateFamilyMemberDeleteById": "/doorplateFamilyMember/deleteById", // 删除家庭成员的API路径
+    "callingHelpSave": "/callingHelp/save", // 保存求助信息的API路径
+    "callingHelpPageData": "/callingHelp/selectPageData", // 查询求助记录的API路径
+    "callingHelpDetail": "/callingHelp/detail", // 查询求助详情的API路径
+    "getRelateInfo": "/callingHelp/getRelateInfo", // 查询门牌关联事件的API路径
+    "noticePage": "/notice/page", // 查询公告列表的API路径
+    "noticeDetail": "/notice/detail", // 查询公告详情的API路径
+    "getNamesCultureByCode": "/namesCulture/getByCode", // 获取地名文化信息的API路径
+    "getNamesCultureByName": "/namesCulture/page", // 通过名称查询地名文化信息的API路径
+    "fwzlRentOutAdd": "/fwzlRentOut/add", // 发布房屋的API路径
+    "getFwzlRentOutListOfMy": "/fwzlRentOut/getFwzlRentOutListOfMy", // 查询发布记录的API路径
+    "fwzlRentOutEditById": "/fwzlRentOut/editById", // 修改发布记录的API路径
+    "fwzlRentOutGetOneById": "/fwzlRentOut/getOneById", // 查询发布房屋详情的API路径
+    "fwzlRentOutDeleteById": "/fwzlRentOut/deleteById", // 删除发布记录的API路径
+    "getFwzlRentList": "/fwzlRent/getFwzlRentList", // 我要租房列表的API路径
+    "getDictionaryByName": "/system/getDictionaryByName", // 字典查询接口的API路径
+    "getDicByNameList": "/system/getDicByNameList", // 批量查询字典内容的API路径
+    "listArea": "/system/listArea", // 查询地区的API路径
+    "uploadBase64": "/file/upload", // 上传文件的API路径
+    "fileDownload": "/file/download?fileUuid", // 下载文件的API路径
     "newDownFile": "", // 新下载文件的API路径(暂无httpApi对应项)
-    "getMyDoorplateAll": "/digital-doorplate/userCenter/getMyDoorplateAll", // 获取已经绑定的门派列表的API路径(暂无httpApi对应项)
+    "getMyDoorplateAll": "/userCenter/getMyDoorplateAll", // 获取已经绑定的门派列表的API路径(暂无httpApi对应项)
     "getDoorplateInfoNew": "/business/applet-house-number/getPersonalHouseNumber",
     "getTemplateList": "/promise/template/getTemplateList", // 获取模板列表的API路径
     "getPromiseDetail": "/promise/manage/getDetail", // 获取承诺详情的API路径
     "templateDetails": "/promise/template/templateDetails", // 获取模板详情的API路径
-    "getUserInfo": "/digital-doorplate/userCenter/getUserInfo", // 获取个人身份信息的API路径
-    "updateUserInfoIdentity": "/digital-doorplate/userCenter/updateUserInfoIdentity", // 更新个人身份信息的API路径
-    "changeMyPriorityDoorplate": "/digital-doorplate/userCenter/changeMyPriorityDoorplate", // 变更用户当前门牌地址的API路径
-    "personSsoUserInfo": "/digital-doorplate/zlbCallback/personSsoUserInfo", // 获取浙里办单点登录后用户信息的API路径
-    "getDoorplatePicUrl": "/digital-doorplate/doorplateInfoApp/getDoorplatePicUrl", // 获取门牌照片地址的API路径
-    "personSsoUserInfoZlbUnify": "/digital-doorplate/personSsoUserInfoZlbUnify", // 同一单点登录用户信息的API路径
 
     "createPromise": "/promise/manage/createPromise", // 创建承诺的API路径
     "getPromiseList": "/promise/manage/getList", //获取承诺列表
@@ -127,10 +121,6 @@ const zlbApi = {
     "uploadFile": '/promise/Indicator/uploadFile', // 上传文件
     "downFileBase64": '/promise/Indicator/downFileBase64', // 下载文件
     "editVerifyTask":'/promise/verify/editVerifyTask', // 编辑核查/批量编辑
-    "getReminderList":'/promise/reminder/getReminderList', // 获取提醒列表
-    "reminderDetails":'/promise/reminder/reminderDetails', // 获取提醒详情"
-    "exemption":'/system/exemption', // 浙政钉 获取用户信息
-    "getVillageLink":'/business/address/getVillageLink', // 获取村社链接
 }
 
 export default zlbApi;

+ 54 - 12
src/common/js/baseUrl.js

@@ -1,20 +1,62 @@
 let httpApi = ""; // 基础服务
 let doorplateImgUrl='';//  门牌二维码图片地址
 //根据运行时版本设置请求url
-function setFetchUrlByEnv() {
-  // 获取当前页面的 URL
-  const currentUrl = window.location.href;
-  console.log("currentUrl", currentUrl);
-  if (currentUrl.includes('debug=true')) {
-    httpApi = 'https://fhszmp.fh.gov.cn:9080';
-    uni.getEnvVersion = ()=> 'development'
-  } else {
-    httpApi = 'https://fhszmp.fh.gov.cn:8080';
-    uni.getEnvVersion = () => 'production'
+function setFetchUrlByEnv(env) {
+  console.log("当前运行", env);
+  switch (env) {
+    case "develop":
+      httpApi = "http://172.18.50.88:8070/digital-doorplate";
+      doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
+      // 微信小程序开发环境在真机上连接外网体验版地址
+      // #ifdef MP-WEIXIN
+      if (__wxConfig && __wxConfig.platform !== "devtools") {
+        httpApi = "http://60.191.98.34:8072/digital-doorplate";
+      }
+      // #endif
+      break;
+    case "trial":
+      // 体验版
+      // #ifdef MP-WEIXIN
+      // httpApi = "http://60.191.98.34:8072/digital-doorplate"; // 基础服务
+      httpApi = "https://zlszmp.fh.gov.cn:8088/digital-doorplate"; // 基础服务
+      // #endif
+      // #ifdef MP-ALIPAY
+      httpApi = "https://zlszmp.fh.gov.cn:8088/digital-doorplate"; // 基础服务
+      // #endif
+      doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
+      break;
+    case "release":
+      // 正式
+      httpApi = "'https://fhszmp.fh.gov.cn:8090/digital-doorplate"; // 基础服务
+      doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
+      break;
+    default:
+      // httpApi = "http://172.18.50.92:8888/digital-doorplate";
+      if (env === "development") {
+//        发版的时候恢复过来
+//         httpApi = window.location.origin + "/digital-doorplate"; //"http://172.18.50.92:8888/digital-doorplate";
+//         doorplateImgUrl='https://zlszmp.fh.gov.cn:8088/digital-doorplateAddrUrl'
+
+        httpApi = "http://192.168.31.51:9080";
+        doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
+      } else {
+        httpApi = "https://zlszmp.fh.gov.cn:8088/digital-doorplate";
+        doorplateImgUrl='https://zlszmp.fh.gov.cn:8088/digital-doorplateAddrUrl'
+      }
+      break;
   }
-  doorplateImgUrl='https://zlszmp.fh.gov.cn:8088/digital-doorplateAddrUrl'
 }
 
-setFetchUrlByEnv();
+uni.getEnvVersion = () => {
+  // #ifdef H5
+  return process.env.NODE_ENV === "production" ? "production" : "development";
+  // #endif
+  // #ifdef MP-WEIXIN || MP-ALIPAY
+  return uni.getAccountInfoSync().miniProgram.envVersion;
+  // #endif
+};
+const envVersion = uni.getEnvVersion();
+
+setFetchUrlByEnv(envVersion);
 
 export { httpApi, doorplateImgUrl};

+ 6 - 23
src/common/js/filters.js

@@ -8,30 +8,13 @@ import moment from 'moment'
  */
 Vue.filter('date', function(value, formatString = 'YYYY-MM-DD HH:mm:ss') {
     if (!value) return '';
-
-    // 检查是否为ISO 8601格式的时间字符串
-    const iso8601Pattern = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{2}:\d{2}/;
-    const normalPattern = /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/;
-
-    // 如果是字符串且匹配ISO 8601格式
-    if (typeof value === 'string' && iso8601Pattern.test(value)) {
-        return moment(value).format(formatString);
-    }
-
-    // 如果是字符串且匹配正常时间格式
-    if (typeof value === 'string' && normalPattern.test(value)) {
-        return moment(value, 'YYYY-MM-DD HH:mm:ss').format(formatString);
-    }
-
-    // 如果是字符串,将其转换为数字
+//  如果是string,转换为number
     if (typeof value === 'string') {
-        value = Number(value);
+        value = Number(value)
     }
-
-    // 如果是秒级时间戳,转换为毫秒级
-    if (typeof value === 'number' && value.toString().length === 10) {
-        value = value * 1000;
+    //如果是秒级时间戳,转换为毫秒级
+    if ( typeof value === 'number' && value.toString().length === 10) {
+        value = value * 1000
     }
-
     return moment(value).format(formatString);
-});
+})

+ 9 - 0
src/main.js

@@ -22,6 +22,15 @@ Vue.use(Vant);
 // #endif
 Vue.mixin(Mixin);
 Vue.prototype.$uiStyle = "normal";
+ZWJSBridge.onReady(() => {
+  console.log('初始化完成后,执行bridge方法')
+  ZWJSBridge.getUiStyle({}).then((result) => {
+    // uistyle normal和elder两种模式
+    Vue.prototype.$uiStyle = result.uiStyle;
+  }).catch(res => {
+    console.log('获取uistyle 失败')
+ });
+})
 
 
 Vue.config.productionTip = false;

+ 32 - 58
src/pages.json

@@ -9,13 +9,7 @@
     {
       "path": "pages/blank/blank",
       "style": {
-        "navigationBarTitleText": "奉化数字门牌"
-      }
-    },
-    {
-      "path": "pages/message/message",
-      "style": {
-        "navigationBarTitleText": "消息"
+        "navigationBarTitleText": "登录中"
       }
     },
     {
@@ -43,15 +37,13 @@
       }
     }
   ],
-  "preloadRule": {
+	"preloadRule": {
     "pages/home/home": {
       "network": "all",
-      "packages": [
-        "subPages"
-      ]
+      "packages": ["subPages"]
     }
   },
-  "subPackages": [
+	"subPackages": [
     {
       "root": "subPages",
       "pages": [
@@ -260,69 +252,51 @@
           }
         },
         {
-          "path": "pages/commitment/home/index",
-          "style": {
-            "navigationBarTitleText": "经营承诺"
-          }
+          "path": "pages/commitment/commitmentDetail/index",
+            "style": {
+                "navigationBarTitleText": "经营承诺详情"
+            }
         },
         {
           "path": "pages/commitment/enterpriseCommitment/index",
-          "style": {
-            "navigationBarTitleText": "企业经营承诺"
-          }
-        },
-        {
-          "path": "pages/commitment/commitmentDetail/index",
-          "style": {
-            "navigationBarTitleText": "经营承诺详情"
-          }
+            "style": {
+                "navigationBarTitleText": "企业经营承诺"
+            }
         },
         {
-          "path": "pages/commitment/remindDetail/index",
+          "path": "pages/commitment/home/index",
           "style": {
-            "navigationBarTitleText": "提醒详情"
+            "navigationBarTitleText": "经营承诺"
           }
         }
       ]
     }
-  ],
+   ],
   "globalStyle": {
     "navigationBarTextStyle": "white",
     "navigationBarTitleText": "uni-app",
     "navigationBarBackgroundColor": "#356eed",
     "backgroundColor": "#F8F8F8",
-    "navigationStyle": "custom",
+    "navigationStyle":"custom",
     "usingComponents": {}
   },
   "tabBar": {
-    "color": "#7A7E83",
-    "selectedColor": "#1676fe",
-    "borderStyle": "black",
-    "backgroundColor": "#ffffff",
-    "list": [
-      {
-        "pagePath": "pages/home/home",
-        "text": "首页",
-        "iconPath": "/static/images/barIcon/home.png",
-        "selectedIconPath": "/static/images/barIcon/home-selected.png"
-      },
-      {
-        "pagePath": "pages/message/message",
-        "text": "消息",
-        "iconPath": "/static/images/barIcon/message.png",
-        "selectedIconPath": "/static/images/barIcon/message-selected.png"
-      },
-      {
-        "pagePath": "pages/my/my",
-        "iconPath": "/static/images/barIcon/user.png",
-        "selectedIconPath": "/static/images/barIcon/user-selected.png",
-        "text": "我的"
-      }
-    ]
-  },
-  "requiredPrivateInfos": [
-    "chooseLocation",
-    "getLocation"
-  ]
+		"color": "#7A7E83",
+		"selectedColor": "#1676fe",
+		"borderStyle": "black",
+		"backgroundColor": "#ffffff",
+		"list": [{
+			"pagePath": "pages/home/home",
+			"text": "首页",
+      "iconPath": "/static/images/barIcon/home.png",
+      "selectedIconPath": "/static/images/barIcon/home-selected.png"
+		}, {
+			"pagePath": "pages/my/my",
+			"iconPath": "/static/images/barIcon/user.png",
+			"selectedIconPath": "/static/images/barIcon/user-selected.png",
+			"text": "我的"
+		}]
+	},
+  "requiredPrivateInfos": ["chooseLocation", "getLocation"]
 }
 

+ 223 - 259
src/pages/blank/blank.vue

@@ -1,7 +1,5 @@
 <template>
-  <view class="blank-page">
-    <van-empty v-if="noAuth" image="error" :description="noAuthDesc" />
-  </view>
+  <view class="blank-page"> 空白页</view>
 </template>
 
 <script>
@@ -12,243 +10,235 @@ import { storageUserInfo } from "@/utils/index";
 import Track from "@/common/js/track";
 import Vconsole from "vconsole";
 import dd from "gdt-jsapi";
-import {exemption, ZzdLogin, ZzdLogin1} from "@/api/system";
-import zlbApi from "@/api/zlbApi";
+import {ZzdLogin} from "@/api/system";
 const app = getApp();
 export default {
   name: "blank",
   components: {},
   props: {},
   data() {
-    return {
-      noAuth:true,
-      noAuthDesc:'请使用浙政钉扫码登录'
-    };
-  },
-  onUnload() {
-    this.noAuth = false
-    this.noAuthDesc = ""
+    return {};
   },
   onShow() {
     this.handleLogin()
   },
   methods: {
-//    async getNewSsoUserInfo(ticket) {
-//      const res = await getSsoUserInfoUnity({ ticketId: ticket });
-//      const userInfo = res.data;
-//      storageUserInfo({
-//        nickName: userInfo.name,
-//        avatarUrl: userInfo.headPicture,
-//        phoneNumber: userInfo.phoneWx,
-//        phoneWx: userInfo.phoneWx,
-//        username: userInfo.name,
-//        openId: userInfo.userIdZlb,
-//        uuid: userInfo.uuid,
-//      });
-//      app.globalData.openid = userInfo.uuid;
-//      // 开始埋点上报
-//      this.startTrack();
-//      if (app.globalData.options.code) {
-//        uni.switchTab({
-//          url: "/pages/home/home",
-//        });
-//      } else {
-//        if (
-//          userInfo.doorplateCount
-//        ) {
-//          uni.switchTab({
-//            url: "/pages/home/home",
-//          });
-//        } else {
-//          uni.reLaunch({
-//            url: "/subPages/pages/scanCode/scanCode",
-//          });
-//        }
-//      }
-//    },
-//    resolveParams(){
-//      const params = this.getQuery(window.location.search);
-//      if (params.qjw_debug) {
-//        localStorage.setItem("debug", "true");
-//        new Vconsole();
-//      } else {
-//        localStorage.setItem("debug", "false");
-//      }
-//      if (params.sp) {
-//          console.error("sp", params.sp);
-//          const spParams = this.getQuery(decodeURIComponent(params.sp));
-//          console.error("spParams", spParams);
-//          app.globalData.options = {
-//            code: spParams.code,
-//          };
-//        }
-//        //门牌code直接在链接上的话,说明从微信小程序过来
-//        if (params.code) {
-//          console.log("应该为微信环境,链接地址:", window.location.href);
-//          console.error("code:", params.code);
-//          app.globalData.options = {
-//            code: params.code,
-//          };
-//        }
-//    },
-//    async unityLogin() {
-//      this.resolveParams()
-//      if (ZWJSBridge.ssoTicket) {
-//        const ssoFlag = await ZWJSBridge.ssoTicket({});
-//        if (ssoFlag && ssoFlag.result === true) {
-//          //使用 IRS“浙里办”统一单点登录组件
-//          if (ssoFlag.ticketId) {
-//            // TODO 应用方服务端单点登录接口
-//            app.globalData.isLogin = true;
-//            this.getNewSsoUserInfo(ssoFlag.ticketId);
-//          } else {
-//            //当“浙里办”单点登录失败或登录态失效时调用 ZWJSBridge.openLink 方法重新获取ticketId。
-//            this.login()
-//          }
-//        } else {
-//          console.log('当前环境不支持 “浙里办”统一单点登录 ')
-//          this.login()
-//        }
-//      } else {
-//        console.log('ZWJSBridge 加载异常')
-//        //异常情况:ZWJSBridge 加载异常
-//      }
-//    },
-//    ssoLogin() {
-//      const platformEnv = getPlatformEnv();
-//      const params = this.getQuery(window.location.search);
-//      let ssoUrl = "";
-//      // 登录
-//      if (platformEnv.bIsAlipayMini) {
-//        console.log("支付宝环境单点登录");
-//        ssoUrl = zlbConfig.alipaySsoUrl;
-//      } else if (platformEnv.bIsDtDreamApp) {
-//        console.log("浙里办环境单点登录");
-//        ssoUrl = zlbConfig.zlbSsoUrl;
-//      } else {
-//        //为了h5测试
-//        ssoUrl = zlbConfig.zlbSsoUrl;
-//      }
-//      if (params.code) {
-//        ssoUrl += `&goto=${window.location.href.split("#")[0]}`;
-//      }
-//      console.log(ssoUrl);
-//      window.location.replace(ssoUrl);
-//    },
-//    login() {
-//      console.log("应用所处地址", window.location.href);
-//      console.log("useragent", window.navigator.userAgent.toLowerCase());
-//      const platformEnv = getPlatformEnv();
-//      const params = this.getQuery(window.location.search);
-//      if (params.qjw_debug) {
-//        localStorage.setItem("debug", "true");
-//      } else {
-//        localStorage.setItem("debug", "false");
-//      }
-//      if (!params.ticket && !platformEnv.bIsWxMini) {
-//        this.ssoLogin();
-//      } else {
-//        app.globalData.isLogin = true;
-//        console.log(
-//          "登录成功后回调地址和参数解析:",
-//          window.location.href,
-//          params
-//        );
-//        // 跳转回来的参数解析
-//        if (params.sp) {
-//          console.error("sp", params.sp);
-//          const spParams = this.getQuery(decodeURIComponent(params.sp));
-//          console.error("spParams", spParams);
-//          app.globalData.options = {
-//            code: spParams.code,
-//          };
-//        }
-//        //门牌code直接在链接上的话,说明从微信小程序过来
-//        if (params.code) {
-//          console.log("应该为微信环境,链接地址:", window.location.href);
-//          console.error("code:", params.code);
-//          app.globalData.options = {
-//            code: params.code,
-//          };
-//        }
-//        let ticket = "";
-//        //浙里办微信是获取ticketId
-//        if (platformEnv.bIsWxMini) {
-//          ticket = params.ticketId;
-//        } else {
-//          ticket = params.ticket;
-//        }
-//        console.log("获取的ticket", ticket);
-//        this.getSsoUserInfo(ticket);
-//      }
-//    },
-//    async getSsoUserInfo(ticket) {
-//      let res = "";
-//      try {
-//        res = await getSsoUserInfo({ ticketId: ticket });
-//      } catch (err) {
-//        uni.setStorageSync("testErr", err);
-//        if (uni.getStorageSync("errNum")) {
-//          let errNum = Number(uni.getStorageSync("errNum"));
-//          if (errNum + 1 < 3) {
-//            uni.setStorageSync("errNum", errNum + 1);
-//          } else {
-//            uni.removeStorageSync("errNum");
-//            return;
-//          }
-//        } else {
-//          uni.setStorageSync("errNum", 1);
-//        }
-//         this.ssoLogin();
-//      }
-//      const userInfo = res.data;
-//      // console.log("单点登录后用户信息", userInfo);
-//      storageUserInfo({
-//        nickName: userInfo.name,
-//        avatarUrl: userInfo.headPicture,
-//        phoneNumber: userInfo.phoneWx,
-//        phoneWx: userInfo.phoneWx,
-//        username: userInfo.name,
-//        openId: userInfo.userIdZlb,
-//        uuid: userInfo.uuid,
-//      });
-//      app.globalData.openid = userInfo.uuid;
-//
-//      // 开始埋点上报
-//      this.startTrack();
-//      history.pushState(null, null, document.URL);
-//      uni.removeStorageSync("errNum");
-//      if (app.globalData.options.code) {
-//        uni.switchTab({
-//          url: "/pages/home/home",
-//        });
-//      } else {
-//        if (
-//          userInfo.doorplateCount
-//        ) {
-//          uni.switchTab({
-//            url: "/pages/home/home",
-//          });
-//        } else {
-//          uni.reLaunch({
-//            url: "/subPages/pages/scanCode/scanCode",
-//          });
-//        }
-//      }
-//    },
-//    startTrack() {
-//      app.globalData.trackIns = new Track();
-//    },
-//    getQuery(url) {
-//      const str = url.substr(url.indexOf("?") + 1);
-//      const arr = str.split("&");
-//      const result = {};
-//      for (let i = 0; i < arr.length; i++) {
-//        const item = arr[i].split("=");
-//        result[item[0]] = item[1];
-//      }
-//      return result;
-//    },
+    async getNewSsoUserInfo(ticket) {  
+      const res = await getSsoUserInfoUnity({ ticketId: ticket });    
+      const userInfo = res.data;
+      storageUserInfo({
+        nickName: userInfo.name,
+        avatarUrl: userInfo.headPicture,
+        phoneNumber: userInfo.phoneWx,
+        phoneWx: userInfo.phoneWx,
+        username: userInfo.name,
+        openId: userInfo.userIdZlb,
+        uuid: userInfo.uuid,
+      });
+      app.globalData.openid = userInfo.uuid;
+      // 开始埋点上报
+      this.startTrack();
+      if (app.globalData.options.code) {
+        uni.switchTab({
+          url: "/pages/home/home",
+        });
+      } else {
+        if (
+          userInfo.doorplateCount
+        ) {
+          uni.switchTab({
+            url: "/pages/home/home",
+          });
+        } else {
+          uni.reLaunch({
+            url: "/subPages/pages/scanCode/scanCode",
+          });
+        }
+      }
+    },
+    resolveParams(){
+      const params = this.getQuery(window.location.search);
+      if (params.qjw_debug) {
+        localStorage.setItem("debug", "true");
+        new Vconsole();
+      } else {
+        localStorage.setItem("debug", "false");
+      }
+      if (params.sp) {
+          console.error("sp", params.sp);
+          const spParams = this.getQuery(decodeURIComponent(params.sp));
+          console.error("spParams", spParams);
+          app.globalData.options = {
+            code: spParams.code,
+          };
+        }
+        //门牌code直接在链接上的话,说明从微信小程序过来
+        if (params.code) {
+          console.log("应该为微信环境,链接地址:", window.location.href);
+          console.error("code:", params.code);
+          app.globalData.options = {
+            code: params.code,
+          };
+        }
+    },
+    async unityLogin() {
+      this.resolveParams()
+      if (ZWJSBridge.ssoTicket) {
+        const ssoFlag = await ZWJSBridge.ssoTicket({});
+        if (ssoFlag && ssoFlag.result === true) {
+          //使用 IRS“浙里办”统一单点登录组件
+          if (ssoFlag.ticketId) {
+            // TODO 应用方服务端单点登录接口
+            app.globalData.isLogin = true;
+            this.getNewSsoUserInfo(ssoFlag.ticketId);
+          } else {
+            //当“浙里办”单点登录失败或登录态失效时调用 ZWJSBridge.openLink 方法重新获取ticketId。
+            this.login()
+          }
+        } else {
+          console.log('当前环境不支持 “浙里办”统一单点登录 ')
+          this.login()
+        }
+      } else {
+        console.log('ZWJSBridge 加载异常')
+        //异常情况:ZWJSBridge 加载异常
+      }
+    },
+    ssoLogin() {
+      const platformEnv = getPlatformEnv();
+      const params = this.getQuery(window.location.search);
+      let ssoUrl = "";
+      // 登录
+      if (platformEnv.bIsAlipayMini) {
+        console.log("支付宝环境单点登录");
+        ssoUrl = zlbConfig.alipaySsoUrl;
+      } else if (platformEnv.bIsDtDreamApp) {
+        console.log("浙里办环境单点登录");
+        ssoUrl = zlbConfig.zlbSsoUrl;
+      } else {
+        //为了h5测试
+        ssoUrl = zlbConfig.zlbSsoUrl;
+      }
+      if (params.code) {
+        ssoUrl += `&goto=${window.location.href.split("#")[0]}`;
+      }
+      console.log(ssoUrl);
+      window.location.replace(ssoUrl);
+    },
+    login() {
+      console.log("应用所处地址", window.location.href);
+      console.log("useragent", window.navigator.userAgent.toLowerCase());
+      const platformEnv = getPlatformEnv();
+      const params = this.getQuery(window.location.search);
+      if (params.qjw_debug) {
+        localStorage.setItem("debug", "true");
+      } else {
+        localStorage.setItem("debug", "false");
+      }
+      if (!params.ticket && !platformEnv.bIsWxMini) {
+        this.ssoLogin();
+      } else {
+        app.globalData.isLogin = true;
+        console.log(
+          "登录成功后回调地址和参数解析:",
+          window.location.href,
+          params
+        );
+        // 跳转回来的参数解析
+        if (params.sp) {
+          console.error("sp", params.sp);
+          const spParams = this.getQuery(decodeURIComponent(params.sp));
+          console.error("spParams", spParams);
+          app.globalData.options = {
+            code: spParams.code,
+          };
+        }
+        //门牌code直接在链接上的话,说明从微信小程序过来
+        if (params.code) {
+          console.log("应该为微信环境,链接地址:", window.location.href);
+          console.error("code:", params.code);
+          app.globalData.options = {
+            code: params.code,
+          };
+        }
+        let ticket = "";
+        //浙里办微信是获取ticketId
+        if (platformEnv.bIsWxMini) {
+          ticket = params.ticketId;
+        } else {
+          ticket = params.ticket;
+        }
+        console.log("获取的ticket", ticket);
+        this.getSsoUserInfo(ticket);
+      }
+    },
+    async getSsoUserInfo(ticket) {
+      let res = "";
+      try {
+        res = await getSsoUserInfo({ ticketId: ticket });
+      } catch (err) {
+        uni.setStorageSync("testErr", err);
+        if (uni.getStorageSync("errNum")) {
+          let errNum = Number(uni.getStorageSync("errNum"));
+          if (errNum + 1 < 3) {
+            uni.setStorageSync("errNum", errNum + 1);
+          } else {
+            uni.removeStorageSync("errNum");
+            return;
+          }
+        } else {
+          uni.setStorageSync("errNum", 1);
+        }
+         this.ssoLogin();
+      }
+      const userInfo = res.data;
+      // console.log("单点登录后用户信息", userInfo);
+      storageUserInfo({
+        nickName: userInfo.name,
+        avatarUrl: userInfo.headPicture,
+        phoneNumber: userInfo.phoneWx,
+        phoneWx: userInfo.phoneWx,
+        username: userInfo.name,
+        openId: userInfo.userIdZlb,
+        uuid: userInfo.uuid,
+      });
+      app.globalData.openid = userInfo.uuid;
+
+      // 开始埋点上报
+      this.startTrack();
+      history.pushState(null, null, document.URL);
+      uni.removeStorageSync("errNum");
+      if (app.globalData.options.code) {
+        uni.switchTab({
+          url: "/pages/home/home",
+        });
+      } else {
+        if (
+          userInfo.doorplateCount
+        ) {
+          uni.switchTab({
+            url: "/pages/home/home",
+          });
+        } else {
+          uni.reLaunch({
+            url: "/subPages/pages/scanCode/scanCode",
+          });
+        }
+      }
+    },
+    startTrack() {
+      app.globalData.trackIns = new Track();
+    },
+    getQuery(url) {
+      const str = url.substr(url.indexOf("?") + 1);
+      const arr = str.split("&");
+      const result = {};
+      for (let i = 0; i < arr.length; i++) {
+        const item = arr[i].split("=");
+        result[item[0]] = item[1];
+      }
+      return result;
+    },
 
 
     /* 获取用户信息,免登 */
@@ -257,36 +247,10 @@ export default {
         corpId: '50329019'
       })
       if(res) {
-        try{
-          const exemptionRes  =  await exemption({
-            code: res.code
-          })
-          if(exemptionRes.code === 0) {
-            console.log('用户信息',exemptionRes.data)
-            storageUserInfo({
-              ...exemptionRes.data.userInfo,
-              nickName: exemptionRes.data.userInfo.realName,
-              avatarUrl: exemptionRes.data.userInfo.headPicture,
-              phoneNumber: exemptionRes.data.userInfo.phoneWx,
-              phoneWx: exemptionRes.data.userInfo.phoneWx,
-              username: exemptionRes.data.userInfo.username,
-              openId: exemptionRes.data.userInfo.id,
-              uuid: exemptionRes.data.userInfo.id,
-            });
-            app.globalData.openid = exemptionRes.data.userInfo.id;
-            uni.reLaunch({
-              url: "/pages/home/home",
-            });
-          }else {
-            this.$toast('获取用户信息失败')
-            this.noAuth = true
-            this.noAuthDesc = exemptionRes.msg
-          }
-        }catch (e) {
-          this.noAuth = true
-          this.noAuthDesc = "当前用户暂无权限"
-          console.log('error',e)
-        }
+        const loginRes  =  await ZzdLogin({
+          code: res.code
+        })
+        console.log('loginRes',loginRes)
       }
     }
   },

+ 1118 - 165
src/pages/home/home.vue

@@ -1,192 +1,1145 @@
-<script>
-import TopSearchShow from "./components/topSearchShow/index.vue";
-import ContentMenu from "./components/contentMenu/index.vue";
-import PromiseList from "../components/promiseList/index.vue";
-import EnterPriseList from "./components/enterpriseList/index.vue";
-import TemplateList from "./components/templateList/index.vue";
-import RecentlySearch from "./components/recentlySearch/index.vue";
-import {searchCommitment} from "@/api/commitment";
+<template>
+  <view class="home-page home-page--h5" :class="{ 'home-page--elder': $uiStyle === 'elder' }" v-if="isBinded">
+    <image class="home-bg" :src="homeBg"></image>
+    <uni-search-bar class="custom-search" v-model="searchValue" radius="20" maxlength="200" cancelButton="none"
+      bgColor="rgba(255,255,255,0.2)" placeholder="搜服务、搜门牌" @focus="handleSearchFocus"></uni-search-bar>
+    <view class="info">
+      <view class="user">
+        <!-- <view class="user-avatar" @click="handleAvatarClick">
+          <image :src="userInfo.avatarUrl || '/static/images/common/avatar.png'" />
+        </view> -->
+        <view class="user-address">
+          <view class="user-address__detail">
+            {{ userInfo.doorName }}
+          </view>
+          <view class="user-address__area">
+            {{ userInfo.address }}
+          </view>
+        </view>
+      </view>
+      <!-- <view v-if="bindStatus !== DOOR_BIND_STATUS.BINDED.VALUE" class="btn-mine" type="primary" @tap="goToBind">
+        码户绑定
+      </view> -->
+      <view class="door">
+        <view class="door-code" @tap="handleQr">
+          <image src="/static/images/common/icon_qr.png" />
+          <text>门牌二维码</text>
+        </view>
+        <view class="door-detail" @tap="handleDoor">
+          <image src="/static/images/common/icon_door.png" />
+          <text>门牌详情</text>
+        </view>
+      </view>
+    </view>
+    <!-- <view class="notice" @tap="handleInform">
+      <uni-icons
+        class="custom-uni-icon"
+        type="sound"
+        size="27"
+        color="#1676fe"
+      ></uni-icons>
+      <swiper
+        :vertical="true"
+        class="notice-swiper"
+        :autoplay="autoPlay"
+        :circular="true"
+        @change="noticeChanged"
+      >
+        <swiper-item
+          v-for="(item, index) in noticeBarText"
+          :key="index"
+          :item-id="String(item.id)"
+        >
+          <view class="swiper-item" style="color: #1676fe">{{
+            item.messageHeader
+          }}</view>
+        </swiper-item>
+      </swiper>
+    </view> -->
+    <view class="notice">
+      <image class="notice-logo" src="/static/images/home/notice-title.png" mode="scaleToFill" />
+      <view class="notice-list" @tap="handleInform">
+        <view v-for="item in noticeBarText" :key="item.id" class="item">
+          <text>{{ item.messageHeader }}</text>
+          <!-- <text class="notice-tag"></text>
+          <uni-tag v-show="index === 0" text="最新" size="mini" type="error" /> -->
+        </view>
+      </view>
+    </view>
+    <view class="help">
+      <!--   <view class="help-item custom-gray">
+        <image src="/static/images/home/help.png" />
+      </view> -->
+      <view class="help-item" @tap="handleAlarm" style="width: 100%">
+        <image src="/static/images/home/police_2.png" style="width: 100%" />
+      </view>
+    </view>
+    <view class="service-list">
+      <view class="list" v-for="(list, index) in serviceList" :key="index">
+        <view class="list-title">{{ list.module }}</view>
+        <swiper :indicator-dots="indicatorDots" style="height: 170px" adjust-height="none">
+          <swiper-item class="list-cont" v-for="(item, itemIndex) in list.cleanAppList" :key="itemIndex">
+            <!--  <view
+            class="list-cont"
+            v-for="(item, itemIndex) in list.cleanAppList"
+            :key="itemIndex"> -->
+            <view class="list-cell" v-for="(cell, cellIndex) in item" @click="handleModule(cell)" :key="cellIndex">
+              <view class="list-cell__icon">
+                <image :src="cell.picUrl" />
+              </view>
+
+              <text>{{ cell.name }}</text>
+            </view>
+            <!--   </view> -->
+          </swiper-item>
+        </swiper>
+      </view>
+      <view class="list local-feature">
+        <view class="list-title">地区特色</view>
+        <view class="list-cont" style="height: auto">
+          <image src="/static/images/home/dmwh.png" @click="handlePlaceCulture" />
+          <!--  <image src="/static/images/home/dmcx.png" @click="handlePlaceQuery" /> -->
+          <!--  <image src="/static/images/home/dmhy.png" @click="handleQrMerge" /> -->
+        </view>
+      </view>
+    </view>
+    <view class="map-wrapper">
+      <view class="map-head">
+        <view class="map-head__title">15分钟生活圈</view>
+        <view class="map-head__more" @tap="handleToLife">更多></view>
+      </view>
+      <map class="map" :markers="markers" :latitude="latitude" :longitude="longitude" title="啦啦啦"
+        @markertap="handleMarkerTap">
+        <cover-view class="map-cover">
+          <view class="address">
+            <text class="address__detail">{{ addressInfo.title }}</text>
+            <text class="address__area">{{ addressInfo.address }}</text>
+          </view>
+          <view class="navigation" @tap="handleAddressGo" :data-addressinfo="addressInfo">
+            <image class="navagation-icon" src="/static/images/home/navigation.png"></image>
+          </view>
+        </cover-view>
+      </map>
+      <!--搜索栏-->
+      <view class="search-bar">
+        <van-search v-model="searchMapValue" @search="handleMapSearch" placeholder="请输入搜索关键词" />
+      </view>
+      <custom-tabs type="c1" :value="activeTab" @change="handleTabChange" :animation="true" class="custom-tabs">
+        <block v-for="(item, index) in tabs" :key="index">
+          <custom-tab-pane class="custom-tab-pane" :label="item" :name="'c1_' + index"></custom-tab-pane>
+        </block>
+      </custom-tabs>
+      <view class="address-list">
+        <view class="list-cell" v-for="(item, index) in addressList" :key="index">
+          <view class="list-cell__cont" @click="handleMarker" :data-addressinfo="item">
+            <image class="point-icon" mode="aspectFit" src="/static/images/common/life_point.png">
+            </image>
+            <view>
+              <view class="list-cell__title">{{ item.title }}</view>
+              <view class="list-cell__distance">距离{{ item.distance }}KM</view>
+              <view class="list-cell__address">{{ item.address }}</view>
+            </view>
+          </view>
+          <image class="phone-icon" src="/static/images/common/phone_icon.png" @click="handlePhoneCall(item)"></image>
+        </view>
+      </view>
+    </view>
+    <!-- #ifdef MP-WEIXIN -->
+    <view v-if="!hasBaseInfo" class="auth-mask" @click="handleAuthProfile"></view>
+    <!-- #endif -->
+    <!-- #ifdef MP-ALIPAY -->
+    <button v-if="!hasBaseInfo" class="auth-mask" open-type="getAuthorize" scope="userInfo" hover-class="none"
+      @getAuthorize="handleAuthProfile" @error="onAuthError"></button>
+    <!-- #endif -->
+    <auth-dialog ref="authDialogRef" class="custom-auth-popup" @close="authDialogClose"></auth-dialog>
+    <uni-popup ref="popupQrCode" type="center">
+      <view style="padding: 10px; background-color: #fff">
+        <image style="width: 180px; height: 180px" mode="scaleToFill" @longpress="handleLongpress" :src="qrCodePath" />
+      </view>
+    </uni-popup>
+    <custom-footer :class="{ 'custom-footer--elder': $uiStyle === 'elder' }"></custom-footer>
+  </view>
+</template>
 
+<script>
+import { geocoder, apiSearch } from "@/api/map.js";
+import {
+  getServiceList,
+  getDoorplateInfo,
+  getDoorList,
+} from "@/api/control.js";
+import {
+  DOOR_PLATE_INFO,
+  DOOR_BIND_STATUS,
+  USER_INFO,
+  JUMP_TYPE,
+} from "@/utils/const";
+import { getQrCode } from "@/api/wx";
+import { getNoticeList } from "@/api/notice.js";
+import { httpApi, doorplateImgUrl } from "@/common/js/baseUrl";
+import { getUserInfo, updateUserInfo, getDoorplatePicUrl } from "@/api/user";
+import { storageUserInfo } from "@/utils/index";
+import { splitArr, getPlatformEnv } from "@/utils";
+import { maskPhoneCall, getPointResByLabel } from "@/utils";
 
+const app = getApp();
 export default {
-  components: {
-    TopSearchShow,
-    ContentMenu,
-    PromiseList,
-    EnterPriseList,
-    TemplateList,
-    RecentlySearch
-  },
   data() {
     return {
-      activeIndex: 0, // 当前激活的菜单索引
-      showSearch: false, // 是否显示搜索框
-      searchValue: "", // 搜索框的值
-      resultActive: 0, // 搜索结果的tab索引
-      showSearchResult: false, // 是否显示搜索结果
-      resultList: [], // 搜索结果列表
-      activeTemplateId: null // 当前激活的模板的uuid
+      options: null,
+      isBinded: true,
+      cur: "userInfo",
+      scanedInfo: {
+        avatarUrl: "",
+        address: "",
+        doorName: "",
+      },
+      userInfo: {
+        avatarUrl: "",
+        address: "",
+        doorName: "",
+      },
+      searchValue: "",
+      noticeBarText: [
+        { id: "1", messageHeader: "" },
+        { id: "2", messageHeader: "" },
+        { id: "3", messageHeader: "" },
+      ],
+      currentNoticeId: "",
+
+      autoPlay: true,
+      circular: true,
+      serviceList: [],
+      homeBg: "/static/images/home/bg.png",
+      cardBg: "/static/images/home/card_bg.png",
+      latitude: 29.65945,
+      longitude: 121.4405,
+      markers: [],
+      doorMarker: [],
+      addressInfo: {
+        title: "",
+        address: "",
+        latitude: 29.65945,
+        longitude: 121.4405,
+      },
+      activeTab: 0,
+      active: 2,
+      addressList: [],
+      sourceAddressList:[],
+      searchMapValue: "",
+      tabs: ["文物古迹", "超市", "美食", "加油站", "酒店", "学校", "医院"],
+      phoneNumber: "",
+      qrCode: "",
+      hasBaseInfo: false,
+      bindStatus: DOOR_BIND_STATUS.BINDED.VALUE,
+      DOOR_BIND_STATUS,
+      defaultQr: "",
+      codeToQr: [
+        {
+          code: "11b11178adc94e348924b6da67f5cc09",
+          qr: "/static/images/common/2-504.png",
+        },
+        {
+          code: "05fbf95a93e94987bf9f1d774dc88212",
+          qr: "/static/images/common/252.png",
+        },
+      ],
+      qrCodePath: "",
+      indicatorDots: true, //swiper的指示点
     };
   },
-  methods:{
-    // 搜索
-    async onSearch(type=0) {
-      this.showSearchResult = true;
-      this.resultActive = type;
-      try {
-        const res = await searchCommitment({
-          searchCriteria: this.searchValue,
-          createUser: uni.getStorageSync("userInfo").id || '',
-          type
-        })
-        if(type === 0) {
-          this.resultList = res.data || [];
-          this.resultList = this.resultList.map(item => {
-            return {
-              ...item,
-              company_name: item.item,
-              create_time: item.time,
-              remark: item.name
-            }
-          })
-        }else if(type === 1) {
-          this.resultList = res.data || [];
-          this.resultList = this.resultList.map(item => {
-            return {
-              ...item,
-              createTime: item.time,
-              companyName: item.name
+  created() {
+    console.log("home created");
+  },
+  onLoad: function (params) {
+    const options = this.configOptions(params);
+    if (options && options.code) {
+      app.globalData.NBID = options.NBID;
+      app.globalData.options = options;
+    }
+    const userInfo = uni.getStorageSync(USER_INFO) || {};
+    this.userInfo = { ...this.userInfo, ...userInfo };
+    //多次请求了,删除
+    /*  if (app.globalData.openid) {
+       this.getUserInfo();
+     } else {
+       app.watch("openid", this.getUserInfo.bind(this));
+     } */
+    this.getServiceList();
+    this.getNoticeList();
+  },
+  onShow: function () {
+    const userInfo = uni.getStorageSync(USER_INFO) || {};
+    this.userInfo = { ...this.userInfo, ...userInfo };
+    if (this.userInfo.avatarUrl && this.userInfo.phoneWx) {
+      this.hasBaseInfo = true;
+    }
+    if (
+      app.globalData.doorplateInfo.code &&
+      app.globalData.doorplateInfo.code !== app.globalData.options.code
+    ) {
+      app.globalData.options.code = app.globalData.doorplateInfo.code;
+    }
+    /* console.error(app.globalData.openid) */
+    app.globalData.openid = userInfo.uuid; //h5端测试用
+    if (app.globalData.openid) {
+      this.getUserInfo();
+    }
+    this.getServiceList(); //以防设置长辈版,重新分配
+  },
+  destroyed() {
+    console.log("homeview destoryed");
+  },
+  methods: {
+    authDialogClose() {
+      uni.showTabBar();
+      this.getUserInfo();
+    },
+    handleAvatarClick() {
+      const _that = this;
+      if (!this.userInfo.avatarUrl) {
+        // #ifdef MP-WEIXIN || MP-ALIPAY
+        uni.getUserProfile({
+          desc: "用于完善用户资料",
+          success: (res) => {
+            updateUserInfo({
+              openId: app.globalData.openid,
+              nickName: res.userInfo.nickName,
+              phoneWx: "",
+            });
+            storageUserInfo(res.userInfo);
+            _that.userInfo = { ...this.userInfo, ...res.data };
+          },
+        });
+        // #endif
+        // #ifdef H5
+        uni.showToast({ title: "去浙里办上传头像" });
+        // #endif
+      }
+    },
+    configOptions(options) {
+      const envVersion = uni.getEnvVersion();
+      if (envVersion === "release") {
+        return options;
+      } else if (options.code) {
+        return options;
+      } else {
+        return {
+          NBID: "",
+          Type: "",
+          code: "",
+        };
+      }
+    },
+    handleAuthProfile() {
+      const _that = this;
+      if (!this.userInfo.avatarUrl) {
+        // #ifdef MP-WEIXIN
+        uni.getUserProfile({
+          desc: "用于完善用户资料",
+          success: (res) => {
+            // updateUserInfo({
+            //   openId: app.globalData.openid,
+            //   nickName: res.userInfo.nickName,
+            //   phoneWx: ''
+            // });
+            storageUserInfo(res.userInfo);
+            _that.userInfo = { ..._that.userInfo, ...res.userInfo };
+            _that.$refs.authDialogRef.open();
+            uni.hideTabBar();
+          },
+        });
+        // #endif
+        // #ifdef MP-ALIPAY
+        uni.getUserInfo({
+          success: function (res) {
+            // updateUserInfo({
+            //   openId: app.globalData.openid,
+            //   nickName: res.userInfo.nickName,
+            //   phoneWx: ''
+            // });
+            storageUserInfo(res.userInfo);
+            _that.userInfo = { ..._that.userInfo, ...res.userInfo };
+            _that.$refs.authDialogRef.open();
+          },
+          fail: function (error) {
+            console.log("获取会员基本信息失败:", error);
+          },
+        });
+        // #endif
+      } else if (!this.userInfo.phoneWx) {
+        _that.$refs.authDialogRef.open();
+      }
+    },
+    // 支付宝授权用户基本信息失败
+    onAuthError() {
+      const _this = this;
+      uni.showModal({
+        title: "提示",
+        content: "取消授权,可能会使部分服务无法使用,或页面信息不完整",
+        showCancel: false,
+        confirmText: "我知道了",
+        success: function (res) {
+          if (res.confirm) {
+            console.log("用户点击确定");
+          } else if (res.cancel) {
+            console.log("用户取消授权");
+          }
+        },
+      });
+    },
+
+    async getUserInfo() {
+      const res = await getUserInfo({
+        openId: app.globalData.openid,
+      });
+      console.log("获取系统用户信息", res);
+      if (res.data.uuid) {
+        const userInfoStored = uni.getStorageSync("userInfo") || {};
+        this.userInfo = { ...this.userInfo, ...res.data, ...userInfoStored };
+        storageUserInfo(this.userInfo);
+      }
+      if (this.userInfo.avatarUrl && this.userInfo.phoneWx) {
+        this.hasBaseInfo = true;
+      }
+      this.getDoorplateInfo();
+    },
+    isPhoneNumberPass() {
+      const phoneNumber = uni.getStorageSync(USER_INFO).phoneWx;
+      if (!phoneNumber) {
+        uni.hideTabBar();
+        this.$refs.authDialogRef.open();
+      }
+      return phoneNumber;
+    },
+    goToBind() {
+      console.log("码户绑定点击", this.bindStatus);
+      if (this.bindStatus === DOOR_BIND_STATUS.WAIT.VALUE) {
+        uni.navigateTo({
+          url: "/subPages/pages/bind/bind",
+        });
+      } else if (this.bindStatus === DOOR_BIND_STATUS.SUBMITTED.VALUE) {
+        uni.navigateTo({
+          url: "/subPages/pages/door/complete",
+        });
+      } else {
+        uni.navigateTo({
+          url: "/subPages/pages/door/door",
+        });
+      }
+    },
+    async getDoorList() {
+      const res = await getDoorList({
+        userInfoId: this.userInfo.uuid,
+      });
+      // if
+      if (res.data.length) {
+        console.log("有绑定列表");
+        this.isBinded = true;
+        uni.setStorage({
+          key: DOOR_PLATE_INFO,
+          data: res.data,
+        });
+        this.bindStatus = DOOR_BIND_STATUS.BINDED.VALUE;
+        app.globalData.bindStatus = DOOR_BIND_STATUS.BINDED.VALUE;
+        app.globalData.doorInfo = res.data[0];
+        if (res.data[0] && res.data[0].baseInfo) {
+          app.globalData.options = {
+            NBID: "",
+            Type: res.data[0].baseInfo.type,
+            code: res.data[0].baseInfo.doorplateCode,
+          };
+        }
+        this.setDoorInfo();
+      } else {
+        console.error('scancode1')
+        uni.showToast({
+          title: '该门牌数据不存在',
+          icon: "none",
+          duration: 2000,
+        });
+        setTimeout(() => {
+          uni.navigateTo({ url: "/subPages/pages/scanCode/scanCode" });
+        }, 1000)
+      }
+    },
+    /* 获取门牌信息后初始化打点 */
+    initDoorMarker() {
+      /* 打点 */
+      this.doorMarker = [
+        {
+          id: 10000,
+          iconPath: "/static/images/common/point_common.png",
+          longitude: this.longitude,
+          latitude: this.latitude,
+          width: 22,
+          height: 32,
+        },
+      ];
+    },
+    async nearbySearch() {
+      const { addressList, markers } = await apiSearch({
+        location: `${this.longitude},${this.latitude}`,
+        keyword: this.tabs[this.activeTab],
+        numberLimit: 5,
+      });
+      this.addressList = addressList;
+      this.sourceAddressList = addressList;
+      const pointRes = getPointResByLabel(this.tabs[this.activeTab]);
+      markers.forEach((item) => {
+        item.iconPath = pointRes.iconPath;
+        item.width = 40;
+        item.height = 40;
+      });
+      this.markers = [...this.doorMarker, ...markers];
+    },
+    async setAddressInfo() {
+      let address = "";
+      // 为了防止请求经纬度失败去展示默认信息
+      this.addressInfo = {
+        title: app.globalData.doorInfo.baseInfo.bzdz,
+        address: app.globalData.doorInfo.baseInfo.bzdz1,
+      };
+      if (
+        app.globalData.doorInfo.baseInfo.x1 &&
+        app.globalData.doorInfo.baseInfo.y1
+      ) {
+        this.longitude = app.globalData.doorInfo.baseInfo.x1;
+        this.latitude = app.globalData.doorInfo.baseInfo.y1;
+      } else {
+        address = app.globalData.doorInfo.baseInfo.bzdz1;
+        if (
+          app.globalData.doorInfo.baseInfo.bzdz1.indexOf("宁波市奉化区") === -1
+        ) {
+          address = "宁波市奉化区" + app.globalData.doorInfo.baseInfo.bzdz1;
+        } else {
+          address = app.globalData.doorInfo.baseInfo.bzdz1;
+        }
+        try {
+          const res = await geocoder({
+            address,
+          });
+          const location = res.geocodes[0].location.split(",").map(Number);
+          this.longitude = location[0];
+          this.latitude = location[1];
+          // 容错,暂时测试用
+          app.globalData.doorInfo.baseInfo.x1 = location[0];
+          app.globalData.doorInfo.baseInfo.y1 = location[1];
+        } catch {
+          uni.showToast({ title: "该门牌地址没有经纬度" });
+        }
+      }
+      /* 设置门牌地址信息,用于搜索周边 */
+      this.addressInfo = {
+        ...this.addressInfo,
+        longitude: this.longitude,
+        latitude: this.latitude,
+      };
+    },
+    async setDoorInfo() {
+      this.userInfo.address = app.globalData.doorInfo.baseInfo.bzdz1;
+      this.userInfo.doorName = app.globalData.doorInfo.baseInfo.bzdz;
+      // this.getUserInfo();
+      await this.setAddressInfo();
+      this.initDoorMarker();
+      this.nearbySearch();
+    },
+    async getDoorplateInfo() {
+      const res = await getDoorplateInfo({
+        doorplateCode: app.globalData.options.code || "",
+        userInfoId: this.userInfo.uuid || "",
+      });
+      if (res.data && res.data.baseInfo) {
+        app.globalData.options = {
+          NBID: "",
+          Type: res.data.baseInfo.type,
+          code: res.data.baseInfo.doorplateCode,
+        };
+        this.bindStatus = res.data.wxBindStatus;
+        app.globalData.bindStatus = res.data.wxBindStatus;
+        app.globalData.doorInfo = res.data;
+        this.setDoorInfo();
+      } else {
+        // 有门牌code,但是门牌信息有误
+        if (res.code == 1 && this.userInfo.uuid) {
+          this.getDoorList();
+        } else {
+          console.error('scancode2')
+          uni.showToast({
+            title: '该门牌数据不存在',
+            icon: "none",
+            duration: 2000,
+          });
+          setTimeout(() => {
+            uni.navigateTo({ url: "/subPages/pages/scanCode/scanCode" });
+          }, 1000)
+        }
+      }
+    },
+    getNoticeList() {
+      const data = {
+        current: 1,
+        size: 3,
+        status: 2
+      };
+      getNoticeList(data).then((res) => {
+        this.noticeBarText = res.data.records;
+        if (this.noticeBarText.length < 3) {
+          let arr = [];
+          for (let i = 0; i < (3 - this.noticeBarText.length); i++) {
+            arr.push({ id: 'id' + i, messageHeader: '' })
+          }
+          this.noticeBarText = this.noticeBarText.concat(arr);
+        }
+        app.globalData.noticeList = res.data;
+        if (res.data && res.data.length > 0) {
+          this.currentNoticeId = res.data[0].uuid;
+        }
+      });
+    },
+    async getServiceList() {
+      const res = await getServiceList();
+      console.log("getServiceList", res);
+      res.data.forEach((item) => {
+        item.appList.forEach((item2) => {
+          item2.picUrl = "/static/images/home/" + item2.picUrl + ".png";
+        });
+        item.appList = item.appList.filter(
+          (serviceItem) =>
+            serviceItem.jumpType != JUMP_TYPE.WX_APP.VALUE &&
+            serviceItem.name !== "为老服务" &&
+            serviceItem.name !== "流动人口" &&
+            serviceItem.name !== "家门口"
+        ); //zlb过滤掉微信跳转相关服务
+        const appListLen = item.appList.length;
+        // #ifdef MP-WEIXIN || MP-ALIPAY
+        item.cleanAppList = splitArr(item.appList, 8);
+        // #endif
+        // #ifdef H5
+        if (this.$uiStyle === "elder") {
+          item.cleanAppList = splitArr(item.appList, 6);
+          this.indicatorDots = appListLen > 6 ? true : false;
+        } else {
+          item.cleanAppList = splitArr(item.appList, 8);
+          this.indicatorDots = appListLen > 8 ? true : false;
+        }
+        // #endif
+      });
+      console.log("servicelist", res.data);
+      this.serviceList = res.data;
+    },
+    handleToLife() {
+      uni.navigateTo({
+        url: "/subPages/pages/life/life",
+      });
+    },
+
+    noticeChanged(event) {
+      // this.currentNoticeId = event.detail.currentItemId;
+      const index = event.detail.current;
+      this.currentNoticeId = this.noticeBarText[index].id;
+    },
+
+    handleInform() {
+      uni.navigateTo({
+        url: `/subPages/pages/inform/InformList`,
+      });
+    },
+
+    handleHelp() {
+      if (!this.isPhoneNumberPass()) {
+        return;
+      }
+      uni.navigateTo({
+        url: "/subPages/pages/help/helpCall",
+      });
+    },
+
+    handleAlarm() {
+      if (!this.isPhoneNumberPass()) {
+        return;
+      }
+      uni.navigateTo({
+        url: "/subPages/pages/alarm/alarmCall",
+      });
+    },
+
+    handleSearchFocus() {
+      uni.navigateTo({
+        url: "/subPages/pages/search/search",
+      });
+    },
+
+    async handleQr() {
+      const baseUrl = httpApi.slice(0, httpApi.lastIndexOf("/"));
+      let qrUrl = "";
+      const env = uni.getEnvVersion();
+      console.log(env);
+      if (env === "release" || env === "production") {
+        const res = await getDoorplatePicUrl({
+          code: app.globalData.options.code,
+        });
+        if (res.code === 0) {
+          qrUrl = doorplateImgUrl + "/" + res.data;
+        }
+      } else {
+        qrUrl = this.defaultQr;
+      }
+      // #ifdef MP-WEIXIN
+      if (env === "release") {
+        wx.downloadFile({
+          url: qrUrl,
+          success(res) {
+            if (res.statusCode === 200) {
+              wx.showShareImageMenu({
+                path: res.tempFilePath,
+              });
             }
-          })
+          },
+        });
+      } else {
+        wx.showShareImageMenu({
+          path: qrUrl,
+        });
+      }
+      // #endif
+      // #ifdef MP-ALIPAY || H5
+      console.log("qrUrl", doorplateImgUrl);
+      this.qrCodePath = qrUrl;
+      this.$refs.popupQrCode.open();
+      // #endif
+    },
+    /* 浙里办长按保存 */
+    handleLongpress(type) {
+      console.error("长按", type);
+      // #ifdef H5
+      ZWJSBridge.saveImage({
+        url: this.qrCodePath,
+      })
+        .then((result) => {
+          console.log(result);
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+      // #endif
+    },
+    handleDoor() {
+      if (this.bindStatus === DOOR_BIND_STATUS.SUBMITTED.VALUE) {
+        uni.navigateTo({
+          url: "/subPages/pages/door/submitDetail",
+        });
+      } else {
+        uni.navigateTo({
+          url: "/subPages/pages/door/door",
+        });
+      }
+    },
+    handleToggle() {
+      uni.getUserInfo({
+        success: (res) => {
+          console.log(res);
+        },
+      });
+      if (this.cur === "scaned") {
+        this.cur = "user";
+      } else {
+        this.cur = "scaned";
+      }
+    },
+
+    handleTabChange(e) {
+      this.setData({
+        activeTab: this.tabs.indexOf(e.label),
+      });
+      console.log("activeTab", this.activeTab);
+      this.nearbySearch();
+    },
+
+    handleModule(item) {
+      const platformEnv = getPlatformEnv();
+      switch (item.jumpType) {
+        case JUMP_TYPE.H5.VALUE:
+          app.globalData.jumpUrl = item.jumpUrl;
+          if (item.name === "户籍管理") {
+            app.globalData.jumpUrl =
+              "http://portal.zjzwfw.gov.cn/download/?_aaid=4&preferredContainer=zlb&goto=zwfw%3A%2F%2Fwebview%3Fh5Url%3Dhttps%3A%2F%2Fportal.zjzwfw.gov.cn%2Fportal%2Fpage%2Fathena-view.html%3FpageId%3D11276%26_tesseract_%3Dtrue";
+          }
+          // #ifdef MP-WEIXIN || H5
+          if (platformEnv.bIsWxMini) {
+            uni.navigateTo({
+              url: "/pages/home/webView",
+            });
+          } else {
+            ZWJSBridge.openLink({
+              url: app.globalData.jumpUrl,
+            })
+              .then((result) => {
+                console.log("打开新页面成功", result);
+              })
+              .catch((error) => {
+                console.log("打开新页面失败", error);
+              });
+          }
+
+          // #endif
+          // #ifdef MP-ALIPAY
+          if (uni.getEnvVersion() === "develop") {
+            uni.navigateTo({
+              url: "/pages/home/webView",
+            });
+          } else {
+            uni.showToast({ title: "暂未开放", duration: 1000 });
+          }
+          // #endif
+          break;
+        case JUMP_TYPE.WX_APP.VALUE:
+          uni.navigateToMiniProgram({
+            appId: item.jumpUrl,
+          });
+          break;
+        case JUMP_TYPE.ZFB_APP.VALUE:
+          if (item.jumpUrl) {
+            uni.navigateToMiniProgram({
+              appId: item.jumpUrl,
+            });
+          } else {
+            uni.showToast({ title: "暂未开放" });
+          }
+          break;
+        case JUMP_TYPE.WX_INSIDE.VALUE:
+          app.globalData.jumpUrl = item.jumpUrl;
+          uni.navigateTo({
+            url: item.jumpUrl,
+          });
+          break;
+        case JUMP_TYPE.MAP.VALUE:
+          uni.navigateTo({
+            url: `/subPages/pages/mapService/mapService?category=${item.jumpUrl}&keyword=${item.name}`,
+          });
+          break;
+        case JUMP_TYPE.INSIDE.VALUE:
+          uni.navigateTo({
+            url: item.jumpUrl,
+          });
+          break;
+        default:
+          break;
+      }
+    },
+
+    handleAddressGo(e) {
+      console.log("导航去那些位置");
+      console.log(e);
+      console.log(e.currentTarget.dataset["addressinfo"]);
+      const targetAddress = e.currentTarget.dataset["addressinfo"];
+      uni.openLocation({
+        latitude: Number(targetAddress.latitude),
+        longitude: Number(targetAddress.longitude),
+        scale: 5,
+        name: targetAddress.title,
+        address: targetAddress.address,
+
+        success(res) {
+          console.log(res, "wx.getLocation");
+        },
+      });
+    },
+
+    handleMarker(e) {
+      console.log("打点位置", e.currentTarget.dataset["addressinfo"]);
+      this.addressInfo = e.currentTarget.dataset["addressinfo"];
+      this.marker();
+    },
+
+    marker() {
+      const targetAddress = this.addressInfo;
+      const pointRes = getPointResByLabel(this.tabs[this.activeTab]);
+      let markers = JSON.parse(JSON.stringify(this.markers));
+      markers.forEach((item) => {
+        if (item.title === targetAddress.title) {
+          item.iconPath = pointRes.iconPathSelected;
+          item.width = 50;
+          item.height = 54;
+        } else {
+          if (item.id !== 10000) {
+            item.iconPath = pointRes.iconPath;
+            item.width = 40;
+            item.height = 40;
+          }
+        }
+      });
+      this.markers = markers;
+      this.latitude = targetAddress.latitude;
+      this.longitude = targetAddress.longitude;
+    },
+    /* 地图上点击的打点 */
+    handleMarkerTap(e) {
+      console.log("地图上被点击的点", e.detail.markerId);
+      // 10000代表门牌地址
+      if (e.detail.markerId === 10000) {
+        return;
+      }
+      const pointRes = getPointResByLabel(this.tabs[this.activeTab]);
+      let markers = JSON.parse(JSON.stringify(this.markers));
+      markers.forEach((item) => {
+        if (item.id === e.detail.markerId) {
+          console.log("选中的点", item);
+          item.iconPath = pointRes.iconPathSelected;
+          item.width = 50;
+          item.height = 54;
+          this.addressInfo = {
+            title: item.title,
+            address: "宁波市奉化区" + item.address,
+            latitude: item.latitude,
+            longitude: item.longitude,
+          };
+        } else {
+          if (item.id !== 10000) {
+            item.iconPath = pointRes.iconPath;
+            item.width = 40;
+            item.height = 40;
+          }
         }
-      }catch (e) {
-        console.log(e);
+      });
+
+      this.markers = markers;
+    },
+    handlePhoneCall(item) {
+      if (!item.tel.length) {
+        uni.showToast({
+          title: "该商家暂未提供电话",
+        });
+        return;
       }
+      const phoneNumber = item.tel.split(";")[0];
+      maskPhoneCall(phoneNumber);
     },
-    handleRecentlySearch(searchCriteria) {
-      this.searchValue = searchCriteria;
-      this.onSearch();
+    handlePlaceCulture() {
+      const street = app.globalData.doorInfo.baseInfo.xiangzhen;
+      const community = app.globalData.doorInfo.baseInfo.shequ;
+      app.globalData.showPlaceCulture = false;
+      uni.navigateTo({
+        url: `/subPages/pages/placeCulture/placeCulture?street=${street}&community=${community}`,
+        success: function (res) {
+          // 通过eventChannel向被打开页面传送数据
+          res.eventChannel.emit("directToPlaceDesc", {
+            data: {
+              street,
+              community,
+            },
+          });
+        },
+      });
     },
-    // 取消搜索
-    onCancel() {
-      this.showSearch = false;
-      this.showSearchResult = false;
-      this.searchValue = "";
+    handlePlaceQuery() {
+      app.globalData.jumpUrl = "https://nbfh.diming123.com/db";
+      // #ifdef MP-WEIXIN || H5
+      uni.navigateTo({
+        url: "/pages/home/webView",
+      });
+      // #endif
+      // #ifdef MP-ALIPAY
+      if (uni.getEnvVersion() === "develop") {
+        uni.navigateTo({
+          url: "/pages/home/webView",
+        });
+      } else {
+        uni.showToast({ title: "暂未开放", duration: 1000 });
+      }
+      // #endif
     },
-    handleTabsClick(name) {
-      this.onSearch(name)
+    handleQrMerge() {
+      uni.navigateTo({
+        url: "/subPages/pages/multiCodeMerge/multiCodeMerge",
+      });
     },
-    /* 模板点击搜索承诺 */
-    handleTemplateClick(item) {
-      this.activeTemplateId = item.uuid
-    }
-  }
+    perfectInfo() {
+      uni.navigateTo({
+        url: "/pages/my/perfectInfo",
+      });
+    },
+    async handleMapSearch(){
+      //前端对addressList的title做一个模糊匹配
+      if(!this.searchMapValue){
+        await this.nearbySearch()
+      }else {
+        this.addressList = this.sourceAddressList.filter(item => item.title.includes(this.searchMapValue))
+      }
+    },
+  },
 };
 </script>
+<style>
+@import "./home.css";
+</style>
+<style lang="scss" scoped>
+.address-list {
+  flex: 1;
+  overflow-y: scroll;
+  display: flex;
+  flex-direction: column;
+  margin-bottom: 20rpx;
+  background: #fff;
+  min-height: 20vh;
 
-<template>
-  <view>
-    <transition name="fade" mode="out-in">
-      <!-- 使用 key 属性区分不同的渲染内容 -->
-      <view v-if="!showSearch" class="content" key="not-search">
-        <view class="top-search">
-          <TopSearchShow :value.sync="showSearch"></TopSearchShow>
-          <ContentMenu class='menu' :value.sync="activeIndex"></ContentMenu>
-        </view>
-        <TemplateList
-            v-show="activeIndex === 0"
-            class="template-style"
-            :activeTemplateId="activeTemplateId"
-            @click="handleTemplateClick"></TemplateList>
-        <PromiseList
-            v-show="activeIndex === 0"
-            class="promise-style"
-            :templateId="activeTemplateId"
-        ></PromiseList>
-        <view class="enterprise-top-style" v-show="activeIndex === 1">
-          <span>综合</span>
-        </view>
-        <EnterPriseList v-if="activeIndex === 1" class="enter-style"></EnterPriseList>
-      </view>
-      <view v-else key="search" class="search-page">
-        <van-search
-            v-model="searchValue"
-            show-action
-            autofocus
-            :clearable="false"
-            placeholder="请输入搜索关键词"
-            @search="()=>onSearch(0)"
-            @cancel="onCancel"
-        />
-        <RecentlySearch v-if="!showSearchResult" @search="handleRecentlySearch" class="recently-search"></RecentlySearch>
-        <view v-else>
-          <van-tabs v-model="resultActive" background='white' color='#1492FF' type='card' @click="handleTabsClick" class="tabs-style">
-            <van-tab title="承诺信息">
-              <PromiseList :no-request="true" :prop-data-list="resultList"></PromiseList>
-            </van-tab>
-            <van-tab title="企业信息">
-              <EnterPriseList :no-request="true" :prop-data-list="resultList"></EnterPriseList>
-            </van-tab>
-          </van-tabs>
-        </view>
-      </view>
-    </transition>
-  </view>
-</template>
+  .list-cell {
+    display: flex;
+    padding: 20rpx 36rpx;
+    justify-content: space-between;
+    align-items: center;
+    border-bottom: 1px dashed #dedede;
 
-<style scoped>
-.top-search {
-  height: 101px;
-  position: relative;
-  background-color: #1492FF;
+    &__cont {
+      flex: 1;
+      display: flex;
 
-}
-.menu {
-  position: absolute;
-  top: 58px;
-  left: 0;
-  width: 100%;
-  z-index: 1;
-}
-.template-style {
-  background-color: #fff;
-}
+      .point-icon {
+        width: 16px;
+        height: 16px;
+        margin-right: 5px;
+        margin-top: 8px;
+      }
+    }
 
-.promise-style {
-  min-height: calc(100vh - 308px);
-  background-color: transparent;
-  padding: 0 10px;
-}
+    &__title {
+      font-size: 28rpx;
+      font-weight: bold;
+      padding: 14rpx 0;
+    }
 
-.enter-style {
-  margin-top: 10px;
-}
-.enterprise-top-style {
-  width: 375px;
-  height: 51px;
-  background-image: linear-gradient(180deg, #FFFFFF 35%, #F2F3F5 100%);
-  border-radius: 0 0 6px 6px;
-  position: relative;
+    &__distance {
+      font-size: 20rpx;
+      line-height: 28rpx;
+      color: #999999;
+    }
 
+    &__address {
+      font-size: 20rpx;
+      line-height: 28rpx;
+      color: #999999;
+    }
+
+    /* 电话图标 */
+    .phone-icon {
+      width: 36px;
+      height: 36px;
+    }
+  }
 }
-span {
-  position: absolute;
-  font-weight: 600;
-  font-size: 16px;
-  color: #333333;
-  left: 20px;
-  bottom: 15px;
-}
 
-.fade-enter-active, .fade-leave-active {
-  transition: opacity 0.2s;
+.home-page--elder {
+  .info {
+    .user {
+      .user-address {
+        &__detail {
+          font-size: calc(18px * $zlb-elder-font-scale);
+        }
+
+        &__area {
+          font-size: calc(11px * $zlb-elder-font-scale);
+        }
+      }
+    }
+
+    .door {
+      uni-text {
+        font-size: calc(14px * $zlb-elder-font-scale);
+      }
+    }
+  }
+
+  .notice {
+    .notice-swiper {
+      font-size: calc(16px * $zlb-elder-font-scale) !important;
+    }
+  }
+
+  /* */
+  .service-list {
+    ::v-deep uni-swiper {
+      height: 256px !important;
+    }
+
+    .list-title {
+      font-size: calc(16px * $zlb-elder-font-scale);
+    }
+
+    .list-cont {
+      .list-cell {
+        flex: 0 0 33%;
+
+        uni-text {
+          font-size: calc(12px * $zlb-elder-font-scale);
+        }
+
+        image {
+          width: 72px;
+          height: 72px;
+        }
+      }
+    }
+  }
+
+  .map-head {
+    &__title {
+      font-size: calc(16px * $zlb-elder-font-scale);
+      line-height: calc(16px * $zlb-elder-font-scale);
+    }
+
+    &__more {
+      font-size: calc(11px * $zlb-elder-font-scale);
+      line-height: calc(11px * $zlb-elder-font-scale);
+    }
+  }
+
+  .map {
+    .address {
+      &__detail {
+        font-size: calc(18px * $zlb-elder-font-scale);
+        line-height: calc(28px * $zlb-elder-font-scale);
+      }
+
+      &__area {
+        font-size: calc(13px * $zlb-elder-font-scale);
+        line-height: calc(24px * $zlb-elder-font-scale);
+      }
+    }
+  }
+
+  .custom-tabs ::v-deep .txt {
+    font-size: calc(14px * $zlb-elder-font-scale);
+  }
+
+  .address-list {
+    .list-cell {
+      &__title {
+        font-size: calc(14px * $zlb-elder-font-scale);
+      }
+
+      &__distance {
+        font-size: calc(10px * $zlb-elder-font-scale);
+        line-height: calc(14px * $zlb-elder-font-scale);
+      }
+
+      &__address {
+        font-size: calc(10px * $zlb-elder-font-scale);
+        line-height: calc(14px * $zlb-elder-font-scale);
+      }
+    }
+
+    .phone-icon {
+      width: calc(36px * $zlb-elder-font-scale);
+      height: calc(36px * $zlb-elder-font-scale);
+    }
+  }
 }
-.fade-enter, .fade-leave-to {
-  opacity: 0;
+
+.home-page--h5 {
+  padding-bottom: 50px;
 }
-.tabs-style {
-  .van-tabs__nav--card{
-    margin: 0;
-  }
+
+.custom-footer--elder {
+  font-size: calc(12px * $zlb-elder-font-scale);
 }
-</style>
+</style>

+ 40 - 0
src/pages/my/my.vue

@@ -60,6 +60,38 @@
           src="/static/images/common/arrow.png"
         />
       </view>
+      <!--我的承诺-->
+      <view class="button" @click="checkDetail('commitment')">
+        <view class="left">
+          <image
+            class="icon"
+            mode="aspectFit"
+            src="/static/images/commitment/myPromise.png"
+          />
+          <view class="text">我的承诺</view>
+        </view>
+        <image
+          style="width: 20px; height: 20px"
+          mode="scaleToFill"
+          src="/static/images/common/arrow.png"
+        />
+      </view>
+      <!--承诺提醒-->
+      <view class="button" @click="checkDetail('commitmentRemind')">
+        <view class="left">
+          <image
+            class="icon"
+            mode="aspectFit"
+            src="/static/images/commitment/promiseRemind.png"
+          />
+          <view class="text">承诺提醒</view>
+        </view>
+        <image
+          style="width: 20px; height: 20px"
+          mode="scaleToFill"
+          src="/static/images/common/arrow.png"
+        />
+      </view>
       <view class="button" @click="checkDetail('alarm')">
         <view class="left">
           <image
@@ -369,6 +401,14 @@ export default {
             url: "/subPages/pages/familyMember/familyMember",
           });
         }
+      } else if(val === 'commitment') {
+        uni.navigateTo({
+          url: '/subPages/pages/commitment/myCommitment/index'
+        })
+      } else if(val === 'commitmentRemind') {
+        uni.navigateTo({
+          url: '/subPages/pages/commitment/myCommitmentRemind/index'
+        })
       }
     },
   },

+ 5 - 5
src/store/modules/template.js

@@ -11,11 +11,11 @@ const state = {
 
 const mutations = {
     setTemplateComponents(state, data) {
-        Vue.set(state,'templateJson',data)
+        Vue.set(state.templateJson,'components',data)
     },
     setIndicatorList(state, data) {
         Vue.set(state, 'indicatorList', data)
-    },
+    }
 
 }
 
@@ -26,10 +26,9 @@ const actions = {
                 uuid
             })
             if (result.data && result.data.promiseBody) {
-                let promiseBody = JSON.parse(result.data.promiseBody)
-                commit('setTemplateComponents',promiseBody )
+                commit('setTemplateComponents', JSON.parse(result.data.promiseBody))
             } else {
-                commit('setTemplateComponents', {})
+                commit('setTemplateComponents', [])
             }
             if(result.data && result.data.list) {
                 commit('setIndicatorList', result.data.list.records)
@@ -40,6 +39,7 @@ const actions = {
         catch (e) {
             console.log(e)
         }
+
     }
 }
 

+ 135 - 103
src/subPages/pages/commitment/commitmentDetail/components/IndicatorComponents.vue

@@ -1,31 +1,27 @@
 <script>
 import {downFileBase64, editVerifyTask, uploadFile} from "@/api/commitment";
 import {v4 as uuidv4} from "uuid";
-import CommitmentConfirmForm from "@/subPages/pages/commitment/components/commitmentConfirmForm/index.vue";
 
 export default {
   name: "IndicatorComponents",
-  components: {CommitmentConfirmForm},
   computed: {
     indicatorList() {
-      return this.$store.state.template.indicatorList
+      return this.$store.state.template.indicatorList.map(item => {
+        if (item.indicatorInputBody) {
+          item.indicatorInputBody = item.indicatorInputBody.replace('&', item.inputBody + item.inputSegment)
+        }
+        return item
+      })
     },
   },
   watch: {
     indicatorList: {
       handler(value) {
         if (value && value.length > 0 && !this.formStatesInitFlag) {
-          value.forEach((indicatorItem) => {
+          value.forEach((item) => {
             this.$nextTick(() => {
-              this.$set(this.formStates, indicatorItem.uuid, {
-                ...indicatorItem,
-                auditResult: this.checkResultColumns.find(item => item.value === indicatorItem.auditResult) && this.checkResultColumns.find(item => item.value === indicatorItem.auditResult).text,
-                auditScore: indicatorItem.auditResult === 3 ? '' : indicatorItem.auditScore, //后端会直接返回过来具体的分数
-                fileList: indicatorItem.expandStr ? indicatorItem.expandStr.split(',').map(item => {
-                  return {
-                    uuid: item
-                  }
-                }) : []
+              this.$set(this.formStates, item.uuid, {
+                fileList: []
               })
             })
           })
@@ -34,19 +30,10 @@ export default {
       },
       immediate: true,
       deep: true
-    },
-    "$route.query.uuid": {
-        handler(value) {
-          if(value) {
-            this.formStatesInitFlag = false
-          }
-        },
-        deep: true
-      }
+    }
   },
   data() {
     return {
-      //表单状态初始化标志
       formStatesInitFlag: false,
       formStates: {},
       checkResultColumns: [
@@ -82,12 +69,8 @@ export default {
     }
   },
   methods: {
-    /* 重新核查 */
-    handleReCommitment(indicateItem) {
-      indicateItem.auditResult = 3
-      indicateItem.auditScore = ''
-    },
     onCheckResultSubmit(indicateItem) {
+      console.log(this.formStates)
       editVerifyTask([
         {
           uuid: indicateItem.uuid,
@@ -95,8 +78,9 @@ export default {
           indicatorId: indicateItem.indicatorId,
           indicatorInput: indicateItem.indicatorInput,
           indicatorInputBody: indicateItem.indicatorInputBody,
-          auditor: uni.getStorageSync("userInfo").realName,
-          auditResult: this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditResult) && this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditResult).value,
+          auditor: '张三', // 为了调试写死
+          auditResult: this.checkResultColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditResult).value,
+          auditScore: this.checkGoalColumns.find(item => item.text === this.formStates[indicateItem.uuid].auditScore).value,
           auditRemark: this.formStates[indicateItem.uuid].auditRemark,
           //文件上传字段
           expandStr: this.formStates[indicateItem.uuid].fileList.map(item => item.uuid).join(','),
@@ -105,10 +89,38 @@ export default {
       ]).then(res => {
         if (res.code === 0) {
           this.$toast('核查成功')
-          this.formStatesInitFlag = false
-          this.$store.dispatch('template/getPromiseDetail',this.$route.query.uuid)
-        }else {
-          this.$toast('核查失败' + res.msg)
+        }
+      })
+    },
+    handleCheckResultConfirm(value, uuid) {
+      this.formStates[uuid].auditResult = value.text
+      this.checkResultPopupVisible = false
+    },
+    handleCheckGoalConfirm(value, uuid) {
+      this.formStates[uuid].auditScore = value.text
+      this.checkScorePopupVisible = false
+    },
+    beforeUpload(file) {
+      const isLt50M = file.size / 1024 / 1024 < 50;
+      if (!isLt50M) {
+        this.$toast('上传的图片大小不能超过 50MB!');
+        return false;
+      }
+      return true;
+    },
+    afterRead(file, uuid) {
+      const formData = new FormData()
+
+      uploadFile({
+        uuid: uuidv4(),
+        file: formData
+      }).then(res => {
+        if (res.code === 0) {
+          this.formStates[uuid].fileList.push({
+            uuid: res.data,
+            url: URL.createObjectURL(file.file)
+          })
+          console.log('上传成功', this.formStates)
         }
       })
     },
@@ -133,24 +145,97 @@ export default {
   <view>
     <view v-for="(item,index) in indicatorList" :key="index" class="indicator-style">
       <view class="indicator-body">
-        {{ item.indicatorInputBody.replace('&', item.inputBody + item.inputSegment) }}
-      </view>
-      <view class="title">监管核查
-        <view>涉及整改、整改扣分结果,需要走审批二次确认</view>
+        {{ item.indicatorInputBody }}
       </view>
-      <van-divider/>
-      <CommitmentConfirmForm v-if="item.auditResult === 3"
-                             v-model="formStates[item.uuid]">
-        <template #footer>
+      <view v-if="!item.approvalStatus && item.approvalStatus !== 0">
+        <view class="title">监管核查
+          <view>涉及整改、整改扣分结果,需要走审批二次确认</view>
+        </view>
+        <van-divider/>
+        <van-form v-if="formStates[item.uuid]" @submit="onCheckResultSubmit(item)">
+          <!--核查结果-->
+          <van-field
+              readonly
+              clickable
+              name="auditResult"
+              :value="formStates[item.uuid].auditResult"
+              label="核查结果"
+              placeholder="请选择核查结果"
+              @click="checkResultPopupVisible = true"
+          />
+          <van-popup v-model="checkResultPopupVisible" position="bottom">
+            <van-picker
+                show-toolbar
+                value-key="text"
+                :columns="checkResultColumns"
+                @confirm="(value)=>handleCheckResultConfirm(value,item.uuid)"
+                @cancel="checkResultPopupVisible = false"
+            />
+          </van-popup>
+          <!--核查得分-->
+          <van-field
+              readonly
+              clickable
+              name="auditScore"
+              :value="formStates[item.uuid].auditScore"
+              label="核查得分"
+              placeholder="请选择核查得分"
+              @click="checkScorePopupVisible = true"
+          />
+          <van-popup v-model="checkScorePopupVisible" position="bottom">
+            <van-picker
+                show-toolbar
+                value-key="text"
+                :columns="checkGoalColumns"
+                @confirm="(value)=>handleCheckGoalConfirm(value,item.uuid)"
+                @cancel="checkScorePopupVisible = false"
+            />
+          </van-popup>
+          <!--核查说明-->
+          <van-field
+              clickable
+              name="auditRemark"
+              v-model="formStates[item.uuid].auditRemark"
+              label="核查说明"
+              type="textarea"
+              placeholder="请输入核查说明"
+          />
+          <!--附件上传-->
+          <van-field label="文件上传">
+            <template #input>
+              <view class="upload-files">
+                <view
+                    v-for="item in formStates[item.uuid].fileList"
+                >
+                  <img :src="item.url" style="width: 80px; height: 80px;"/>
+                </view>
+                <van-uploader v-if="formStates[item.uuid].fileList.length < 3"
+                              :before-upload="beforeUpload"
+                              accept="image/*,pdf"
+                              :after-read="(file)=>afterRead(file,item.uuid)"
+                >
+                </van-uploader>
+              </view>
+              <view class="upload-description">
+                <view>
+                  支持png、jpg、pdf,最大50M
+                </view>
+                <view>
+                  最多3个附件
+                </view>
+              </view>
+            </template>
+          </van-field>
+
           <view style="margin: 16px;">
-            <van-button round block type="info" @click="onCheckResultSubmit(item)">核查确认</van-button>
+            <van-button round block type="info" native-type="submit">核查确认</van-button>
           </view>
-        </template>
-      </CommitmentConfirmForm>
+        </van-form>
+      </view>
       <view v-else>
         <view class="other-title">
           监管核查
-          <view style="color: #15BE50" v-if="item.approvalStatus === 0">
+          <view style="color: #FF6B00" v-if="item.approvalStatus === 0">
             审批状态:待审批
           </view>
           <view style="color: #15BE50" v-if="item.approvalStatus === 1">
@@ -179,7 +264,8 @@ export default {
               label="核查得分"
           >
             <template #input>
-              {{item.auditScore }}
+              <view v-if="item.auditScore === 0">0分</view>
+              <view v-if="item.auditScore === -10">-10分</view>
             </template>
           </van-field>
           <!--核查说明-->
@@ -196,68 +282,14 @@ export default {
               label="附件"
           >
             <template #input>
-              <view v-if="item.expandStr" class="file-style">
-                <view v-for="(item,index) in item.expandStr.split(',')" @click="handleFileDown(item)" :key="index">
+              <view class="file-style">
+                <view v-for="(item,index) in item.expandStr.split(',')" @click="handleFileDown(item)">
                   附件{{ index + 1 }}
                 </view>
               </view>
             </template>
           </van-field>
-          <!--核查人员-->
-          <van-field
-              style="margin-top: 16px"
-              name="auditor"
-              label="核查人员"
-          >
-            <template #input>
-              {{ item.auditor }}
-            </template>
-          </van-field>
-          <!--核查时间-->
-          <van-field
-              name="auditTime"
-              label="核查时间"
-          >
-            <template #input>
-              {{ item.updateTime | date }}
-            </template>
-          </van-field>
-
-          <view v-if="item.approvalStatus !== 0">
-            <van-divider></van-divider>
-            <view class="other-title">核查审批</view>
-            <!--审批人员-->
-            <van-field
-                name="approvalPerson"
-                label="审批人员"
-            >
-              <template #input>
-                {{ item.approvalPerson }}
-              </template>
-            </van-field>
-            <!--审批时间-->
-            <van-field
-                name="approvalTime"
-                label="审批时间"
-            >
-              <template #input>
-                {{ item.approvalTime | date }}
-              </template>
-            </van-field>
-            <!--审批说明-->
-            <van-field
-                name="approvalRemark"
-                label="审批说明"
-            >
-              <template #input>
-                {{ item.approvalRemark }}
-              </template>
-            </van-field>
-          </view>
         </van-form>
-        <view v-if="item.approvalStatus === 2" style="margin: 16px;">
-          <van-button round block type="info" @click="handleReCommitment(item)">重新核查</van-button>
-        </view>
       </view>
     </view>
   </view>

+ 10 - 140
src/subPages/pages/commitment/commitmentDetail/index.vue

@@ -1,34 +1,14 @@
 <script>
+import {createPromise, templateDetails} from "@/api/commitment";
 import DescriptionText from "@/subPages/pages/commitment/commitmentDetail/components/DescriptionText.vue";
 import InputComponents from "@/subPages/pages/commitment/commitmentDetail/components/InputComponents.vue";
 import DividerComponents from "@/subPages/pages/commitment/commitmentDetail/components/DividerComponents.vue";
 import IndicatorComponents from "@/subPages/pages/commitment/commitmentDetail/components/IndicatorComponents.vue";
-import {downFileBase64, editVerifyTask} from "@/api/commitment";
-import CommitmentConfirmForm from "@/subPages/pages/commitment/components/commitmentConfirmForm/index.vue";
 
 export default {
-  components: {CommitmentConfirmForm, IndicatorComponents, DividerComponents, InputComponents, DescriptionText},
+  components: {IndicatorComponents, DividerComponents, InputComponents, DescriptionText},
   data() {
     return {
-      actionSheetShow: false,
-      currentStep: 0,
-      batchCheckForm:{
-        fileList:[]
-      },
-      checkResultColumns: [
-        {
-          text: '整改',
-          value: 1
-        },
-        {
-          text: '整改扣分',
-          value: 2
-        },
-        {
-          text: '符合',
-          value: 0
-        }
-      ]
     };
   },
   computed: {
@@ -39,91 +19,17 @@ export default {
       set(value) {
         this.$store.commit('template/setTemplateComponents', value)
       }
-    },
-    noDownload() {
-      return this.$route.query.noDownload
-    },
-    indicatorList:{
-      get() {
-        return this.$store.state.template.indicatorList
-      },
-      set(value) {
-        this.$store.commit('template/setIndicatorList', value)
-      }
-    },
-    /* 批量核查的列表,只有auditResult为3(未核查的)和approvalStatus已拒绝(0)的 */
-    batchCheckIndicatorList(){
-      return this.indicatorList.filter(item => item.auditResult === 3 || item.approvalStatus === 0)
     }
   },
-  watch:{
-    '$route.query.uuid':{
-      handler(val){
-        if(val) {
-          this.currentStep = 0
-          this.$store.dispatch('template/getPromiseDetail', this.$route.query.uuid)
-        }
-      },
-      immediate:true
-    }
+  mounted() {
+    this.$store.dispatch('template/getPromiseDetail', this.$route.query.uuid)
   },
   methods: {
     handleClose() {
-      this.$router.go(-1)
+      window.history.go(-1)
     },
     handleDownPdf() {
-     if(!this.templateJson.attmentId){
-       this.$toast('暂无承诺书')
-     }else {
-       downFileBase64({
-         uuid:this.templateJson.attmentId
-       }).then(res => {
-         if (res.code === 0) {
-           const a = document.createElement('a')
-           a.href = res.data
-           a.download = '承诺书.pdf'
-           a.click()
-         }
-       })
-     }
-    },
-    /* 批量核查显示 */
-    handleBatchCommitment() {
-      this.actionSheetShow = true
-    },
-    /* 批量核查下一步 */
-    handleNextStep() {
-      this.currentStep = 1
-    },
-    handlePrevStep() {
-      this.currentStep = 0
-    },
-    onCheckResultSubmit(){
-      const result = []
-      this.batchCheckIndicatorList.forEach(item => {
-        result.push({
-          "uuid": item.uuid,
-          "promiseId": item.promiseId,
-          "indicatorId": item.indicatorId,
-          "indicatorInput": item.indicatorInput,
-          "indicatorInputBody": item.indicatorInputBody,
-          "auditor": uni.getStorageSync("userInfo").realName,
-          "auditResult": this.checkResultColumns.find(item => item.text === this.batchCheckForm.auditResult)
-              && this.checkResultColumns.find(item => item.text === this.batchCheckForm.auditResult).value,
-          "auditRemark": this.batchCheckForm.auditRemark,
-          "expandStr": this.batchCheckForm.fileList.map(item => item.uuid).join(','),
-        })
-      })
-      editVerifyTask(result).then( async res => {
-        if (res.code === 0) {
-          this.$toast('核查成功')
-          this.actionSheetShow = false
-          this.batchCheckForm={}
-          await this.$store.dispatch('template/getPromiseDetail', this.$route.query.uuid)
-        }else{
-          this.$toast('核查失败' + res.msg)
-        }
-      })
+      this.$router.push({path: '/commitment'})
     }
   }
 }
@@ -133,49 +39,18 @@ export default {
   <view class="h5-page">
     <view class="page-content">
       <view
-          v-for="(item,index) in templateJson.components" :key="index"
+          v-for="(item,index) in templateJson.components.slice(0,6)" :key="index"
       >
         <DescriptionText v-if="item.base.moduleName === 'InstructionsText'" :index="index"></DescriptionText>
         <InputComponents v-else-if="item.base.moduleName === 'Input'" :index="index"></InputComponents>
         <DividerComponents v-else-if="item.base.moduleName === 'divider'" :index="index"></DividerComponents>
       </view>
-      <view class="commit-title" v-if="batchCheckIndicatorList.length > 0" @click="handleBatchCommitment">批量核查</view>
       <IndicatorComponents></IndicatorComponents>
     </view>
     <view class="page-bottom">
       <van-button plain type="primary" @click="handleClose">关闭</van-button>
-      <van-button v-if="!noDownload" type="info" @click="handleDownPdf">下载PDF</van-button>
+      <van-button type="info" @click="handleDownPdf">下载PDF</van-button>
     </view>
-    <van-action-sheet v-model="actionSheetShow" title="批量核查">
-      <div class="content">
-        <view v-show="currentStep === 0" class="first-step">
-          <van-checkbox
-              shape="square"
-              style="margin-top: 20px"
-              v-for="(item,index) in batchCheckIndicatorList" :key="index" :name="index"
-              v-model="batchCheckIndicatorList[index].selectValue">
-            {{ item.indicatorInputBody }}
-          </van-checkbox>
-
-          <van-button round block type="info" style="margin-top: 20px"
-                      @click="handleNextStep">下一步</van-button>
-        </view>
-        <view
-          v-show="currentStep === 1"
-          class="second-step"
-        >
-          <CommitmentConfirmForm
-                                 v-model="batchCheckForm">
-            <template #footer>
-              <view style="margin: 16px;">
-                <van-button round block type="info" @click="handlePrevStep">上一步</van-button>
-                <van-button style="margin-top: 20px" round block type="info" @click="onCheckResultSubmit">核查确认</van-button>
-              </view>
-            </template>
-          </CommitmentConfirmForm>
-        </view>
-      </div>
-    </van-action-sheet>
   </view>
 </template>
 
@@ -248,12 +123,7 @@ export default {
 .h5-page::-webkit-scrollbar-thumb {
   background: #faf4f4; /* 滚动条颜色 */
 }
-.commit-title {
-  color: #4476E9;
-  text-align: end;
-}
-.content {
-  padding: 16px 16px 160px;
-}
+
+
 
 </style>

+ 68 - 0
src/subPages/pages/commitment/enterpriseCommitment/components/number-list/index.vue

@@ -0,0 +1,68 @@
+<script>
+export default {
+  props: {
+//    经营信用分
+    creditScore: {
+      type: Number,
+      default: 0
+    },
+//    经营性承诺数量
+    commitmentNum: {
+      type: Number,
+      default: 0
+    },
+    //承诺项目提醒数
+    commitmentRemindNum: {
+      type: Number,
+      default: 0
+    },
+  }
+}
+</script>
+
+<template>
+  <view class="box">
+    <!--经营信用分-->
+      <view class="box-item">
+        <view class="box-item-content" style="color: #FF6B00">{{creditScore}}</view>
+        <view class="box-item-title">经营信用分</view>
+      </view>
+    <!--经营性承诺数量-->
+      <view class="box-item">
+        <view class="box-item-content" style="color: #FF1492FF">{{commitmentNum}}</view>
+        <view class="box-item-title">经营性承诺数量</view>
+      </view>
+    <!--承诺项目提醒数-->
+      <view class="box-item">
+        <view class="box-item-content" style="color: #d30302">{{commitmentRemindNum}}</view>
+        <view class="box-item-title">承诺项目提醒数</view>
+      </view>
+  </view>
+</template>
+
+<style scoped lang="scss">
+.box {
+  height: 89px;
+  background: #FFFFFF;
+  box-shadow: 0 1px 20px 0 #e0e0e080;
+  border-radius: 6px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 0 20px;
+  .box-item {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    .box-item-content {
+      font-size: 20px;
+      font-weight: bold;
+    }
+    .box-item-title {
+      font-size: 12px;
+      color: #999999;
+    }
+  }
+}
+
+</style>

+ 62 - 41
src/subPages/pages/commitment/enterpriseCommitment/index.vue

@@ -1,41 +1,53 @@
 <script>
-import ScoreList from "@/subPages/pages/commitment/enterpriseCommitment/components/score-list/index.vue";
+import NumberList from "@/subPages/pages/commitment/enterpriseCommitment/components/number-list/index.vue";
 import {getEnterpriseDetail, getPromiseList} from "@/api/commitment";
-import PromiseList from "@/subPages/pages/commitment/components/promiseList/index.vue";
-import RemindList from "@/components/bussinessComponents/remind-list/index.vue";
 
 export default {
-  components: {
-    PromiseList,
-    ScoreList,
-    RemindList
-  },
+  components: {NumberList},
   data() {
     return {
-      enterpriseDetail: {},
-      active: 0
+      loading: false,
+      finished: false,
+      page: 0,
+      pageSize: 10,
+      promiseList: [],
+      enterpriseDetail: {}
     }
   },
-  watch:{
-    "$route.query.uuid": {
-      handler(value) {
-        if(value && this.$route.path === '/subPages/pages/commitment/enterpriseCommitment/index') {
-          this.handleGetEnterpriseDetail()
+  computed: {
+    listData() {
+      return this.promiseList.map((item) => {
+        return {
+          ...item,
+          content: item.content ? JSON.parse(item.content) : {}
         }
-      },
-      immediate: true
+      })
     }
   },
-  deactivated() {
-    this.enterpriseDetail = {}
-    this.active = 0
+  mounted() {
+    this.handleGetEnterpriseDetail()
+    this.getPromiseList()
   },
   methods: {
+    async getPromiseList() {
+      this.loading = true;
+      const res = await getPromiseList({
+        companyId: 'e1',
+        current: this.page + 1,
+        size: this.pageSize
+      })
+      if (res.code === 0) {
+        this.promiseList = this.promiseList.concat(res.data.records || [])
+        this.page++;
+        this.finished = res.data.records.length < this.pageSize
+      }
+      this.loading = false
+    },
     /* 获取企业详情 */
     async handleGetEnterpriseDetail() {
       try {
         const res = await getEnterpriseDetail({
-          uuid: this.$route.query.uuid
+          companyId: 'e1'
         })
         if (res.code === 0) {
           this.enterpriseDetail = res.data
@@ -52,28 +64,37 @@ export default {
 <template>
   <view class="page">
     <view class="top">
-      <view class="company">{{ enterpriseDetail.companyName }}</view>
-      <view class="code">组织机构代码: {{ enterpriseDetail.companyId }}</view>
+      <view class="company">xxxxxxxx</view>
+      <view class="code">组织机构代码: xxxxxxxx</view>
     </view>
     <view class="page-content">
-      <ScoreList :creditScore="enterpriseDetail.creditGoal" :commitmentNum="enterpriseDetail.promiseCount"
-                 :commitmentRemindNum="enterpriseDetail.warnCount"></ScoreList>
-      <van-tabs v-model="active">
-        <van-tab  title="全部承诺">
-          <PromiseList
-              v-if="active === 0"
-              class="promise-style"
-              :company-id="enterpriseDetail.uuid"
-              :show-status="true"
-          ></PromiseList>
-        </van-tab>
-        <van-tab title="整改提醒">
-          <RemindList v-if="enterpriseDetail.uuid && active === 1" :type="0" :company-id="enterpriseDetail.uuid"></RemindList>
-        </van-tab>
-        <van-tab title="系统提醒">
-          <RemindList v-if="enterpriseDetail.uuid && active === 2" :type="1" :company-id="enterpriseDetail.uuid"></RemindList>
-        </van-tab>
-      </van-tabs>
+      <NumberList :creditScore="100" :commitmentNum="100" :commitmentRemindNum="100"></NumberList>
+      <van-list
+          v-model="loading"
+          :finished="finished"
+          finished-text="没有更多了"
+          style="min-height: 300px"
+          @load="getPromiseList"
+      >
+        <van-cell class="promise-list-item" v-for="(item, index) in listData" :key="index">
+          <template #default>
+            <view class="item-top">
+              <view class="left-title">{{ item.title }}</view>
+              <view class="status">{{ item.status }}</view>
+            </view>
+            <view class="list-content">
+              <view class="content-item" v-for="key in Object.keys(item.content)" :key="key">
+                <view class="content-key">{{ key }}</view>
+                <view class="content-value">{{ item.content[key] }}</view>
+              </view>
+              <view class="content-item">
+                <view class="content-key">签署时间</view>
+                <view class="content-value">{{ item.create_time | date }}</view>
+              </view>
+            </view>
+          </template>
+        </van-cell>
+      </van-list>
     </view>
 
   </view>

+ 24 - 33
src/subPages/pages/commitment/home/components/enterpriseList/index.vue

@@ -26,6 +26,8 @@ export default {
     if(this.noRequest) {
       this.finished = true;
       this.loading = false;
+    }else {
+      this.handleGetEnterpriseList()
     }
   },
   watch: {
@@ -49,7 +51,6 @@ export default {
         });
         if (res.data.records) {
           this.enterpriseList = this.enterpriseList.concat(res.data.records || [])
-          this.current++;
           this.finished = res.data.records.length < this.size;  // 判断是否还有更多数据
         }
         this.loading = false;  // 加载结束
@@ -57,46 +58,36 @@ export default {
         console.log(e);
         this.loading = false;
       }
-    },
-    handleClick(item) {
-      this.$router.push({
-        path: '/subPages/pages/commitment/enterpriseCommitment/index',
-        query: {
-          uuid: item.uuid
-        }
-      })
     }
   }
 };
 </script>
 
 <template>
-    <van-list
-        v-model="loading"
-        @load="handleGetEnterpriseList"
-        :finished="finished"
-        finished-text="没有更多数据了"
+  <van-list
+      v-model="loading"
+      @load="handleGetEnterpriseList"
+      :finished="finished"
+      finished-text="没有更多数据了"
+  >
+    <van-cell
+        v-for="(item, index) in enterpriseList"
+        :key="item.uuid"
+        class="box"
     >
-      <van-cell
-          v-for="(item, index) in enterpriseList"
-          :key="item.uuid"
-          class="box"
-          @click="handleClick(item)"
-      >
-        <template #default>
-          <view class="top">
-            <view class="name">
-              {{ item.companyName }}
-              <!--后端计算量大,先去掉-->
-              <!--<van-tag round color="#f4a40d" style="margin-left: 5px"> {{item.creditGoal || '暂无' }}</van-tag>-->
-            </view>
-          </view>
-          <view class="details">
-            最新承诺时间 : {{ item.createTime | date("YYYY-MM-DD HH:mm:ss") }}
+      <template #default>
+        <view class="top">
+          <view class="name">
+            {{ item.companyName }}
+            <van-tag round color="#f4a40d" style="margin-left: 5px"> {{item.creditGoal }}</van-tag>
           </view>
-        </template>
-      </van-cell>
-    </van-list>
+        </view>
+        <view class="details">
+          最新承诺时间 : {{ item.createTime | date("YYYY-MM-DD HH:mm:ss") }}
+        </view>
+      </template>
+    </van-cell>
+  </van-list>
 </template>
 
 

+ 152 - 0
src/subPages/pages/commitment/home/components/promiseList/index.vue

@@ -0,0 +1,152 @@
+<script>
+import {getPromiseList} from "@/api/commitment";
+
+export default {
+  props:{
+    propDataList: {
+      type: Array,
+      default: () => []
+    },
+    /* 如果为true则不再使用接口请求 */
+    noRequest: {
+      type: Boolean,
+      default: false
+    },
+    /* 模板的uuid */
+    templateId: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      promiseList: [],
+      loading:false,
+      finished:false,
+      current:0
+    };
+  },
+  mounted() {
+    if(this.noRequest) {
+      this.finished = true;
+      this.loading = false;
+    }
+  },
+  watch: {
+    propDataList: {
+      handler(val) {
+        if(this.noRequest) {
+          this.promiseList = val
+        }
+      },
+      deep:true
+    },
+    templateId: {
+      handler(val) {
+        if(val) {
+          this.promiseList = []
+          this.current = 0
+          this.handleGetPromiseList()
+        }
+      },
+      immediate:true
+    }
+  },
+  methods: {
+    /* 获取承诺列表 */
+    async handleGetPromiseList() {
+      try {
+        this.loading = true;  // 开始加载
+        const res = await getPromiseList({
+          current:this.current + 1,
+          size:10,
+          templateId:this.templateId ? this.templateId : undefined //暂时隐藏掉,以便看到数据
+        })
+       if(res.code === 0) {
+         this.promiseList = this.promiseList.concat(res.data.records || [])
+         this.current++;
+         this.finished = res.data.records.length < 10;
+       }
+       this.loading = false;  // 加载结束
+      } catch (e) {
+        console.log(e)
+        this.loading = false
+      }
+    },
+    handleParseTitle(title) {
+      if (!title) return ''
+      try {
+        return JSON.parse(title).title
+      } catch (e) {
+        return ''
+      }
+    },
+    handlePromiseClick(item) {
+      this.$router.push({
+        path: '/subPages/pages/commitment/commitmentDetail/index',
+        query: {
+          uuid: item.uuid
+        }
+      })
+    }
+  },
+};
+</script>
+
+<template>
+  <van-list v-model="loading" @load="handleGetPromiseList" :finished="finished" finished-text="没有更多数据了">
+    <van-cell v-for="(item,index) in promiseList" :key="index" class="box" @click="handlePromiseClick(item)">
+      <template #default>
+        <view class="top">
+          <view class="title">{{ handleParseTitle(item.remark) }}</view>
+          <view class="time">{{ item.create_time | date("MM-DD HH:mm:ss") }}</view>
+        </view>
+        <view class="content">承诺企业 : {{ item.company_name }}</view>
+      </template>
+    </van-cell>
+  </van-list>
+</template>
+
+<style scoped lang="scss">
+.box {
+  min-height: 78px;
+  background: #FFFFFF;
+  border-radius: 6px;
+  margin: 12px auto;
+
+  view:first-child {
+    margin-top: 0;
+  }
+}
+
+.top {
+  display: flex;
+  justify-content: space-between;
+  padding: 10px 20px;
+}
+
+.title {
+  font-size: 16px;
+  font-weight: bold;
+  flex: 1;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.time {
+  font-size: 12px;
+  color: #999999;
+  width: 100px;
+}
+
+.content {
+  padding: 0 20px;
+  font-size: 14px;
+  color: #666666;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+</style>

+ 26 - 67
src/subPages/pages/commitment/home/components/templateList/index.vue

@@ -1,84 +1,57 @@
 <script>
-import {downFileBase64, getTemplateList} from "@/api/commitment";
-import TemplateImg from "@/static/images/commitment/template.png";
+import {getTemplateList} from "@/api/commitment";
 
 export default {
-  props: {
+  props:{
     activeTemplateId: {
       type: String,
-      default: '',
+      default: ''
     }
   },
   data() {
     return {
-      /* 二维数组 */
-      templateList: [],
-      current: 1,
-      size: 16
+      templateList:[]
     };
   },
   async mounted() {
-    await this.getTemplateList();
-    this.templateList.length && this.$emit('click', this.templateList[0][0]);
+    await this.getTemplateList()
+    this.templateList.length && this.$emit('click', this.templateList[0])
   },
   methods: {
     /* 获取模板列表 */
     async getTemplateList() {
       try {
         const res = await getTemplateList({
-          current: this.current,
-          size: this.size,
-          departmentId: uni.getStorageSync("userInfo").deptId
-        });
-        if(res.data && res.data.records.length > 0) {
-          //每8个一组作为一个数组,push到templateList中
-          for (let i = 0; i < res.data.records.length; i += 8) {
-            this.templateList.push(res.data.records.slice(i, i + 8));
-//            //依次下载每个模板的图片
-            for (const item of this.templateList[this.templateList.length - 1]) {
-              await this.handleDownImg(item);
-            }
-          }
-        }
+          current: 1,
+          size: 8,
+          departmentId:undefined,// 等登录了联调
+        })
+        this.templateList = res.data.records || []
       } catch (e) {
-        console.log(e);
+        console.log(e)
       }
     },
     /* 点击模板 */
     handleClick(item) {
-      this.$emit('click', item);
+      this.$emit('click', item)
     },
-    async handleDownImg(item) {
-      if (!item.iconUrl) {
-        item.imgUrl = TemplateImg;
-      } else if(!item.imgUrl) {
-        let res = await downFileBase64({
-          uuid: item.iconUrl
-        });
-        item.imgUrl = 'data:image/jpeg;base64,' + res.data;
-      }
-    }
-  }
+  },
 };
 </script>
 
 <template>
-  <van-swipe class="my-swipe" @change="onChange"  indicator-color="white" :loop="false">
-    <van-swipe-item  v-for="(groupItem,index) in templateList" :key="index">
-      <view class="box">
-        <view v-for="item in groupItem" :key="item.uuid"
-              @click="handleClick(item)"
-              :class="{active: item.uuid === activeTemplateId}">
-          <img :src="item.imgUrl" style="border-radius: 5px" alt="">
-          <view class="text-overflow">{{ item.name }}</view>
-        </view>
-      </view>
-    </van-swipe-item>
-  </van-swipe>
+  <view class="box">
+    <view v-for="item in templateList" :key="item.uuid"
+          @click="handleClick(item)"
+          :class="{active: item.uuid === activeTemplateId}">
+      <img src="" alt="">
+      <view>{{item.name}}</view>
+    </view>
+  </view>
 </template>
 
 <style scoped lang="scss">
-// box每行显示4个,超出换行,靠右
+//box每行显示4个,超出换行,靠右
 .box {
   display: flex;
   flex-wrap: wrap;
@@ -88,39 +61,25 @@ export default {
   box-sizing: border-box;
   padding: 20px 10px;
   background-image: linear-gradient(180deg, #FFFFFF 87%, #F2F3F5 100%);
-
-  > view {
+  view {
     margin: 0 2% 0 0;
     width: 23%;
     display: flex;
     flex-direction: column;
     align-items: center;
-
-    > view {
+    view {
       overflow: hidden;
       text-overflow: ellipsis;
       white-space: nowrap;
       width: 100%;
-      text-align: center;
     }
-
     img {
       width: 42px;
       height: 42px;
     }
   }
 }
-
 .active {
   transform: scale(1.1);
 }
-
-.text-overflow {
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-  width: 100%;
-  display: block;
-  box-sizing: border-box;
-}
-</style>
+</style>

+ 7 - 6
src/subPages/pages/commitment/home/index.vue

@@ -1,7 +1,7 @@
 <script>
 import TopSearchShow from "./components/topSearchShow/index.vue";
 import ContentMenu from "./components/contentMenu/index.vue";
-import PromiseList from "../components/promiseList/index.vue";
+import PromiseList from "./components/promiseList/index.vue";
 import EnterPriseList from "./components/enterpriseList/index.vue";
 import TemplateList from "./components/templateList/index.vue";
 import RecentlySearch from "./components/recentlySearch/index.vue";
@@ -36,7 +36,7 @@ export default {
       try {
         const res = await searchCommitment({
           searchCriteria: this.searchValue,
-          createUser: uni.getStorageSync("userInfo").id || '',
+          createUser: 2,
           type
         })
         if(type === 0) {
@@ -54,8 +54,9 @@ export default {
           this.resultList = this.resultList.map(item => {
             return {
               ...item,
-              createTime: item.time,
-              companyName: item.name
+              company_name: item.item,
+              create_time: item.time,
+              remark: item.name
             }
           })
         }
@@ -106,7 +107,7 @@ export default {
         <view class="enterprise-top-style" v-show="activeIndex === 1">
           <span>综合</span>
         </view>
-        <EnterPriseList v-if="activeIndex === 1" class="enter-style"></EnterPriseList>
+        <EnterPriseList v-show="activeIndex === 1" class="enter-style"></EnterPriseList>
       </view>
       <view v-else key="search" class="search-page">
         <van-search
@@ -125,7 +126,7 @@ export default {
               <PromiseList :no-request="true" :prop-data-list="resultList"></PromiseList>
             </van-tab>
             <van-tab title="企业信息">
-              <EnterPriseList :no-request="true" :prop-data-list="resultList"></EnterPriseList>
+              <EnterPriseList :no-request="true" ::prop-data-list="resultList"></EnterPriseList>
             </van-tab>
           </van-tabs>
         </view>

+ 1 - 0
src/subPages/pages/commitment/indicatorConfirm/index.vue

@@ -30,6 +30,7 @@ export default {
         this.formData = await getPromiseVerifyList({
           uuid: this.uuid
         })
+        console.log(this.formData,'1212')
       } catch (e) {
         console.log(e)
       }

+ 6 - 6
src/subPages/pages/scanCode/scanCode.vue

@@ -49,12 +49,12 @@ export default {
   },
   onLoad(options) {
     // console.log(options);
-//    ZWJSBridge.getLocation({}).then(res => {
-//      console.log(res)
-//      this.getVicinity(res);
-//    }).catch(err => {
-//      console.log(err)
-//    })
+    ZWJSBridge.getLocation({}).then(res => {
+      console.log(res)
+      this.getVicinity(res);
+    }).catch(err => {
+      console.log(err)
+    })
     // wx.getLocation().then(res => {
     //   // console.log(res);
     //   this.getVicinity(res);

+ 1 - 1
src/utils/fetch/handleReqLoading.js

@@ -3,7 +3,7 @@
  * 接收一个boolean值,如果为true则loading + 1,否则loading -1
  */
 let requestNum = 0;
-const handleReqLoading = (loadingStatus,dataType='json') => {
+const handleReqLoading = (loadingStatus) => {
     if (loadingStatus) {
         requestNum++;
     } else {

+ 185 - 5
src/utils/fetch/index.js

@@ -1,8 +1,190 @@
+import {mgop} from "@aligov/jssdk-mgop";
+import zlbConfig from "@/common/js/zlbConfig";
 import {httpApi} from "@/common/js/baseUrl";
 import {handleHttpError, handleNormalResponse} from "@/utils/fetch/responseHandler";
 import handleReqLoading from "@/utils/fetch/handleReqLoading";
 import {handleRequest} from "@/utils/fetch/requestHandler";
 
+function download(url, type = "get", data = {}) {
+    return new Promise((resolve, reject) => {
+        uni.request({
+            url: url,
+            method: type,
+            responseType: "arraybuffer",
+            header: {
+                "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
+                src: "wechat",
+            },
+            data: data,
+            timeout: 10000,
+            success: function (res) {
+                console.log("返回结果:", res);
+                if (res.statusCode === 200) {
+                    resolve(res);
+                } else {
+                    reject(); // 接口不正常 reject
+                    uni.showToast({title: "服务异常", icon: "none"});
+                }
+            },
+            fail: function (err) {
+                uni.showToast({title: "服务异常", icon: "none"});
+                reject(err);
+            },
+        });
+    });
+}
+
+// 通用版upload
+function commonUpload(url, data, config = {}) {
+    return new Promise((resolve, reject) => {
+        uni.uploadFile({
+            url: httpApi + url,
+            ...data,
+            ...config,
+            header: {
+                "content-type": "multipart/form-data",
+                Token: '1'
+            },
+            // 设置请求的 header
+            success: function (res) {
+            },
+            fail: function (res) {
+                uni.showToast({
+                    title: "服务异常",
+                    icon: "none",
+                    duration: 2000,
+                });
+                reject();
+            },
+        });
+    });
+}
+
+function index(url, type = "get", data = {}, dataType) {
+    return new Promise((resolve, reject) => {
+        (url && url.startsWith("mgop.alibaba")) ? handleMgop(url, type, data, dataType, resolve, reject) : handleFetch(url, type, data, dataType, resolve, reject);
+    });
+}
+
+function handleMgop(url, type, data, dataType, resolve, reject) {
+    let extraHeader = {};
+    /*  当请求头 isTestUrl 为 "1" 时,使用联调环境 */
+    extraHeader.isTestUrl = "1";
+    mgop({
+        api: url, // 必填
+        // host: 'https://mapi.zjzwfw.gov.cn/',
+        dataType: "JSON",
+        type: type,
+        data: data,
+        appKey: zlbConfig.appKey, // 必填
+        header: {
+            "Content-Type":
+                dataType === "form"
+                    ? "application/x-www-form-urlencoded"
+                    : "application/json",
+            src: "wechat", // 小程序免登陆
+            ...extraHeader,
+        },
+        onSuccess: (res) => {
+            const code = res.ret[0].split("::")[0];
+            if (code === "1000") {
+                if (
+                    res.data.code === 0 ||
+                    res.data.code === "0" ||
+                    res.data.status === 0 ||
+                    res.data.status === "1" //高德地图
+                ) {
+                    resolve(res.data);
+                } else {
+                    //特殊处理下,获取门牌数据的接口code是1 ,是业务错误
+                    if (res.api === "mgop.alibaba.digitalDoorplate.getHomePageOneDoorplateFullInfo") {
+                        resolve(res.data);
+                    } else {
+                        reject(res);
+                        if (res.data.message || res.data.msg) {
+                            uni.showToast({
+                                title: res.data.message || res.data.msg,
+                                icon: "none",
+                                duration: 2000,
+                            });
+                        }
+                    }
+
+                }
+            } else {
+                reject(res); // 接口不正常 reject
+                uni.showToast({
+                    title: "服务异常",
+                    icon: "none",
+                    duration: 2000,
+                });
+            }
+        },
+        onFail: (err) => {
+            reject(err);
+        },
+    });
+}
+
+
+function handleFetch(url, type, data, dataType, resolve, reject) {
+    let header = {
+        "Content-Type":
+            dataType === "form"
+                ? "application/x-www-form-urlencoded"
+                : "application/json",
+        Token: '1'
+    };
+    uni.request({
+        url: httpApi + url,
+        method: type,
+        header,
+        data: data,
+        timeout: 60000,
+        success: function (res) {
+            if (res.statusCode === 200) {
+                if (
+                    res.data.code === 0 ||
+                    res.data.code === "0" ||
+                    res.data.status === 0 ||
+                    res.data.status === "1" //高德地图
+                ) {
+                    resolve(res.data);
+                } else {
+                    reject();
+                    if (res.data.message || res.data.msg) {
+                        uni.showToast({
+                            title: res.data.message || res.data.msg,
+                            icon: "none",
+                            duration: 2000,
+                        });
+                    }
+                }
+            } else {
+                reject(); // 接口不正常 reject
+
+                uni.showToast({
+                    title: "服务异常",
+                    icon: "none",
+                    duration: 2000,
+                });
+            }
+        },
+        fail: function (err) {
+            uni.showToast({
+                title: "服务异常",
+                icon: "none",
+                duration: 2000,
+            });
+            reject(err);
+        },
+        complete: function () {
+        },
+    });
+}
+
+//export {index, download, commonUpload};
+
 /**
  * 封装请求
  * @param url 请求地址
@@ -19,20 +201,18 @@ export const myFetch = async (url, type = "get", data = {}, dataType) => {
         timeout: 60000,
         header: {
             'content-type': 'application/json',
-            Token: '1',
-            appId:'2002407848',
+            Token: '1'
         },
     }
 
     try {
-        handleReqLoading(true,dataType);
+        handleReqLoading(true);
         const response = await handleRequest(reqConfig);
         const responseData = handleNormalResponse(response);
-        handleReqLoading(false,dataType);
+        handleReqLoading(false);
         //返回一个promise对象
         return responseData;
     }catch (err) {
-        handleReqLoading(false,dataType);
         return handleHttpError(err);
     }
 }

+ 31 - 62
src/utils/fetch/requestHandler.js

@@ -1,68 +1,37 @@
-export const handleRequest = (reqConfig) => {
-    //删除reqConfig为undefined的属性
-    for (let key in reqConfig.data) {
-        if (reqConfig.data[key] === undefined) {
-            delete reqConfig.data[key];
-        }
-    }
-    const promises = [];
+export const handleRequest = async (reqConfig) => {
+    return new Promise((resolve, reject) => {
 
-    /** 普通请求 */
-    if (reqConfig.dataType === 'json') {
-        const promise = new Promise((resolve, reject) => {
-            uni.request({
-                ...reqConfig,
-                success: function (res) {
-                    resolve(res.data);
-                },
-                fail: function (err) {
-                    reject(err);
-                },
-            });
+        /** 普通请求 */
+        reqConfig.dataType === 'json' && uni.request({
+            ...reqConfig,
+            success: function (res) {
+                resolve(res.data);
+            },
+            fail: function (err) {
+                reject(err);
+            },
         });
-        promises.push(promise);
-    }
 
-    /** 文件上传 */
-    if (reqConfig.dataType === 'formData') {
-        const promise = new Promise((resolve, reject) => {
-            const uploadParams = JSON.parse(JSON.stringify(reqConfig));
-            delete uploadParams.data.file;
-            uni.uploadFile({
-                url: reqConfig.url,
-                formData: uploadParams.data,
-                file: reqConfig.data.file.file,
-                success: function (res) {
-                    resolve(JSON.parse(res.data));
-                },
-                fail: function (err) {
-                    reject(err);
-                },
-            });
+        /** 文件上传 */
+        const uploadParams = JSON.parse(JSON.stringify(reqConfig));
+        // 上传会自己带
+        delete uploadParams.data.file;
+        reqConfig.dataType === 'formData' && uni.uploadFile({
+            url: reqConfig.url,
+            formData: uploadParams.data,
+            header: {
+               Token:uploadParams.header.Token
+            },
+            success: function (res) {
+                resolve(JSON.parse(res.data));
+            },
+            fail: function (err) {
+                reject(err);
+            },
         });
-        promises.push(promise);
-    }
 
-    /** 文件下载 */
-    if (reqConfig.dataType === 'base64') {
-        const promise = new Promise((resolve, reject) => {
-            const url = reqConfig.url + '?' + Object.keys(reqConfig.data).map(key => key + '=' + reqConfig.data[key]).join('&');
-            uni.downloadFile({
-                url,
-                header: {
-                    ...reqConfig.header
-                },
-                success: function (res) {
-                    resolve(res.tempFilePath);
-                },
-                fail: function (err) {
-                    reject(err);
-                },
-            });
-        });
-        promises.push(promise);
-    }
+        /** 文件下载 */
+        const downloadParams = JSON.parse(JSON.stringify(reqConfig));
 
-    // 返回一个包含所有异步操作的 Promise 数组
-    return Promise.all(promises);
-}
+    });
+}

+ 4 - 5
src/utils/fetch/responseHandler.js

@@ -4,7 +4,7 @@ import {errCodeMsgKV} from "@/utils/fetch/errCode";
  * 处理状态码不为200的响应
  */
 export function handleHttpError(err) {
-    const msg = errCodeMsgKV[err.code] ? errCodeMsgKV[err.code] + ':' + err.errMsg : err.errMsg;
+    const msg = errCodeMsgKV[err.code] + ':' + err.msg || err.msg;
     uni.showToast({
         title: msg,
         icon: "none",
@@ -18,9 +18,8 @@ export function handleHttpError(err) {
  * 处理http响应码为200的响应
  * @return {Promise<unknown>}
  */
-export function handleNormalResponse(resList) {
-    const res = resList[0]
-    return res && new Promise((resolve, reject) => {
+export function handleNormalResponse(res) {
+    return new Promise((resolve, reject) => {
         if (res.code || res.code === 0) {
             switch (res.code) {
                 case 200:
@@ -32,7 +31,7 @@ export function handleNormalResponse(resList) {
                 default:
                     reject(res);
                     uni.showToast({
-                        title: res.msg,
+                        title:res.msg,
                         icon: "none",
                         duration: 2000,
                     });