From fab7947fb07b2ee8c2f1a052e873766e18790009 Mon Sep 17 00:00:00 2001 From: lisl <1223762861@qq.com> Date: Thu, 16 Sep 2021 16:44:55 +0800 Subject: [PATCH] =?UTF-8?q?update:=E6=9B=B4=E6=96=B0=E6=94=BF=E7=AD=96?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontCode2/sunshine_levy/index.html | 23 +++-- .../sunshine_levy/src/common/apis/requests.js | 19 ++-- .../sunshine_levy/src/common/util/index.js | 29 +++--- .../sunshine_levy/src/common/util/request.js | 20 +++++ FrontCode2/sunshine_levy/src/views/index.vue | 89 ++++++++++--------- .../src/views/policyInfo/policyInfo.vue | 48 +++++++--- 6 files changed, 135 insertions(+), 93 deletions(-) create mode 100644 FrontCode2/sunshine_levy/src/common/util/request.js diff --git a/FrontCode2/sunshine_levy/index.html b/FrontCode2/sunshine_levy/index.html index 3054231..b24f3f9 100644 --- a/FrontCode2/sunshine_levy/index.html +++ b/FrontCode2/sunshine_levy/index.html @@ -2,9 +2,8 @@ - - + + 房屋征收 @@ -13,7 +12,8 @@
diff --git a/FrontCode2/sunshine_levy/src/common/apis/requests.js b/FrontCode2/sunshine_levy/src/common/apis/requests.js index e1c76aa..bc885ba 100644 --- a/FrontCode2/sunshine_levy/src/common/apis/requests.js +++ b/FrontCode2/sunshine_levy/src/common/apis/requests.js @@ -1,19 +1,18 @@ // 接口文档地址 // https://docs.qq.com/doc/DZkdyS3hNT2V4Q3VJ -const url_prefix='http://183.136.157.9:7099/api' +const url_prefix = "http://183.136.157.9:7099/api"; const url = { - // 登录 - login: '/webapi/account.ashx?action=login', + // 登录 + login: "/webapi/account.ashx?action=login", - // 个人信息 - account: '/webapi/account.ashx?action=userinfo', + // 个人信息 + account: "/webapi/account.ashx?action=userinfo", - // 项目数统计信息 - projectStatistics: '/webapi/project.ashx?action=getStatistics', - - getprjdata: '/project/list', - get_policies_info: '/policies/info', + // 项目数统计信息 + projectStatistics: "/webapi/project.ashx?action=getStatistics", + getprjdata: "/project/list", + get_policies_info: "/policies/info" }; export default url; \ No newline at end of file diff --git a/FrontCode2/sunshine_levy/src/common/util/index.js b/FrontCode2/sunshine_levy/src/common/util/index.js index fdae065..5ce80e6 100644 --- a/FrontCode2/sunshine_levy/src/common/util/index.js +++ b/FrontCode2/sunshine_levy/src/common/util/index.js @@ -1,27 +1,32 @@ -import axios from "axios" +import axios from "axios"; const instance = axios.create({ - baseURL: "https://some-domain.com/api/", - timeout: 5000, - -}) + baseURL: "http://183.136.157.9:7099/api", + timeout: 5000 +}); // 添加请求拦截器 -axios.interceptors.request.use(function(config) { +axios.interceptors.request.use( + function(config) { // 在发送请求之前做些什么 return config; -}, function(error) { + }, + function(error) { // 对请求错误做些什么 return Promise.reject(error); -}); + } +); // 添加响应拦截器 -axios.interceptors.response.use(function(response) { +axios.interceptors.response.use( + function(response) { // 对响应数据做点什么 return response; -}, function(error) { + }, + function(error) { // 对响应错误做点什么 return Promise.reject(error); -}); + } +); -export default instance \ No newline at end of file +export default instance; \ No newline at end of file diff --git a/FrontCode2/sunshine_levy/src/common/util/request.js b/FrontCode2/sunshine_levy/src/common/util/request.js new file mode 100644 index 0000000..89a3554 --- /dev/null +++ b/FrontCode2/sunshine_levy/src/common/util/request.js @@ -0,0 +1,20 @@ +import request from "./index"; + +export function PolicyInfo(data) { + return request({ + url: "/policies/info", + params: data + }); +} + +export function Login() { + return request({ + url: "/webapi/account.ashx?action=login" + }); +} + +export function Account() { + return request({ + url: "/webapi/account.ashx?action=userinfo" + }); +} \ No newline at end of file diff --git a/FrontCode2/sunshine_levy/src/views/index.vue b/FrontCode2/sunshine_levy/src/views/index.vue index 978ad40..838c781 100644 --- a/FrontCode2/sunshine_levy/src/views/index.vue +++ b/FrontCode2/sunshine_levy/src/views/index.vue @@ -69,6 +69,7 @@
+
@@ -114,6 +115,7 @@
+
+
+
+
征收政策
共{{ data.policiesRegulationsLists.totalCount }}条 -
-
+
+
+
{{ item.title }}
import "./home.css"; import { apis } from "@/common/apis"; -import { token } from "@/common/token"; -import request from "@/common/util"; import { mgop } from "@aligov/jssdk-mgop"; - export default { name: "home", data() { return { data: { - idCard:'加载中...', - userName:'加载中...', + idCard: "加载中...", + userName: "加载中...", policiesRegulationsLists: { - totalCount: 0, - }, - }, - // userInfoData: {} // 用户个人信息 + totalCount: 0 + } + } }; }, - created() { + async created() { this.onInit(); console.log("this", this); }, - mounted() {}, methods: { - onLoad() {}, + // 获取数据 onInit() { mgop({ - api: "mgop.kykj.houseexpropriat.getprjlist", // 必须 + api: "mgop.kykj.houseexpropriat.getprjlist", host: "https://mapi.zjzwfw.gov.cn/", dataType: "JSON", type: "POST", data: { - ticket: this.$route.query.ticket, + // ticket: this.$route.query.ticket + ticket: "8a118a427bda7bed017bed084ec10622-ticket" }, - appKey: "es4b8zmz+2001833218+dehllx", // 必须 - onSuccess: (data) => { - console.log("data", data); + appKey: "es4b8zmz+2001833218+dehllx", + onSuccess: data => { + console.log("首页数据", data); if (data.data && data.data.success == true) { this.data = data.data.data; + // 埋点 this.setZwUserAplus(this.data.idCard, this.data.userName); } else { var errorCodes = [6001, 6501]; + // 跳转到政务系统 if (errorCodes.indexOf(data.data.bizCode) > -1) { window.location.replace( "https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=fwzs" @@ -323,22 +325,16 @@ export default { } else console.log("用户无数据,不展示"); } }, - onFail: (err) => { + onFail: err => { console.log("用户无数据,不展示"); - }, + } }); - //获取当前数据 - // apis.getprjdata({ ticket: this.$route.query.ticket }).then((prjdata) => { - // debugger; - // console.log(prjdata); - // this.user.name = prjdata.data.UserName; - // this.user.identityId = prjdata.data.IdCard; - // }); }, + // 跳转项目详情 gotoProject(type) { this.$router.push({ name: "projectSelect", - params: { type: type, ticket: this.$route.query.ticket }, + params: { type: type, ticket: this.$route.query.ticket } }); }, onLoadStatistic() { @@ -346,32 +342,37 @@ export default { this.statistics = result; }); }, - // 页面跳转 - pageJump(type) { - this.$router.push({ - name: "policyInfo", - params: { type: type, ticket: this.$route.query.ticket }, - }); + // 政策信息页面跳转 + pageJump(id) { + // this.$router.push({ + // name: "policyInfo", + // params: { type: type, ticket: this.$route.query.ticket } + // }); + window.location.replace( + "http://localhost:8080/#/policyInfo?id=" + + id + + "&ticket=8a118a427bda7bed017bed084ec10622-ticket" + ); }, setZwUserAplus(Userid, userName) { // 设置用户信息埋点 aplus_queue.push({ action: "aplus.setMetaInfo", - arguments: ["_hold", "BLOCK"], + arguments: ["_hold", "BLOCK"] }); aplus_queue.push({ action: "aplus.setMetaInfo", - arguments: ["_user_nick", userName], // this.userInfoData.username], + arguments: ["_user_nick", userName] // this.userInfoData.username], }); aplus_queue.push({ action: "aplus.setMetaInfo", - arguments: ["_user_id", Userid], + arguments: ["_user_id", Userid] }); aplus_queue.push({ action: "aplus.setMetaInfo", - arguments: ["_hold", "START"], + arguments: ["_hold", "START"] }); - }, - }, + } + } }; diff --git a/FrontCode2/sunshine_levy/src/views/policyInfo/policyInfo.vue b/FrontCode2/sunshine_levy/src/views/policyInfo/policyInfo.vue index 17bb03a..2b97542 100644 --- a/FrontCode2/sunshine_levy/src/views/policyInfo/policyInfo.vue +++ b/FrontCode2/sunshine_levy/src/views/policyInfo/policyInfo.vue @@ -1,41 +1,61 @@