Commit b433d2e5 authored by Step_by_step's avatar Step_by_step

fix: 登录模块调整

parent 3647d0ac
...@@ -26,11 +26,11 @@ npm run preview 本地预览打包完的文件 ...@@ -26,11 +26,11 @@ npm run preview 本地预览打包完的文件
### 子应用 ### 子应用
1. 融资计算器 ✅✋.5) 1. 融资计算器 ✅ (纯前端,等额本息) ✋.5)
2. 融资意向 ✅✋.5) 2. 融资意向 ✅✋.5)
3. 项目查询 (✋1.5 项目信息明细页面需要重头画) 3. 项目查询 (✋ 1.5 项目信息明细页面需要重头画)
4. 合同签约 (E签宝, 预览签署文件)✅✋ 2) 4. 合同签约 (E签宝, 预览签署文件, 由消息推送后做✅✋ 2)
5. 还款计划 (支付)(✋ 2) 5. 还款计划 (支付, 只能从上到下支付)(✋ 2)
6. 还款计划查询 (发票预览下载) (✋ 2) 6. 还款计划查询 (发票预览下载) (✋ 2)
7. 自助服务 ✅✋.5) 7. 自助服务 ✅✋.5)
8. 客户信息变更 ✅✋ 1) 8. 客户信息变更 ✅✋ 1)
...@@ -53,4 +53,8 @@ npm run preview 本地预览打包完的文件 ...@@ -53,4 +53,8 @@ npm run preview 本地预览打包完的文件
- 消息推送 (极光推送)(✋ 1) - 消息推送 (极光推送)(✋ 1)
### **合计:** 22.5 (接口完毕情况下) ### **合计:** 22.5 (接口完毕情况下)
\ No newline at end of file
问题: 支付,ios证书等,代码版权
...@@ -31,15 +31,23 @@ export default { ...@@ -31,15 +31,23 @@ export default {
}, },
async mounted() { async mounted() {
const TempAccess = import.meta.env.DEV ? '60243b9f-5f2b-41f8-8007-67984b5ae1cd' : '' const TempAccess = import.meta.env.DEV ? '60243b9f-5f2b-41f8-8007-67984b5ae1cd' : ''
let homePage = { path: "applications", replace: true }
if (import.meta.env.PROD) { if (import.meta.env.PROD) {
let index = this.$router.getRoutes().filter(route => route.meta.title) // 得保证 每个子应用中首页有 title
this.$router.push({ path: index[0].path, replace: true }); let jumRouter = await login(TempAccess);
return;
if (jumRouter.path) {
// 通过消息传入跳转页面的情况
homePage = { ...homePage, jumRouter }
} else {
// 一般点击进入
let index = this.$router.getRoutes().filter(route => route.meta.title);
homePage.path = index[0];
}
} }
const jumpRouter = await login(TempAccess) this.$router.push(homePage);
this.$router.push({ path: jumpRouter.path ? jumpRouter : "applications", replace: true });
} }
}; };
</script> </script>
......
<template>
<div class="container">
<NavBar title="还款计划查询" left-arrow @click-left="goBack" />
<section class="list">
<Search v-model="searchVal" placeholder="请输入项目编号/融资金额" />
<Notice detail="只可对已关联的项目还款" />
<PullRefresh v-model="refreshing" @refresh="onRefresh" class="scroll">
<List :finished="finished" finished-text="没有更多了" @load="loadApproval">
<ListItem v-for="item in listValue" :other_title="item.other_title" :title="item.title" :values="item.values"
@click="jump" />
</List>
</PullRefresh>
</section>
</div>
</template>
<script setup>
import { goBack } from "@/utils/globalFun"
import { NavBar, List, PullRefresh, Search } from "vant";
import Notice from '@/components/Notice.vue'
import ListItem from '@/components/ListItem.vue'
import api from "../api";
import { useRouter } from "vue-router";
const searchVal = $ref('');
const listValue = $ref([
{
title: '202204-DB001-001',
other_title: "2022-07-18",
values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
},
{
title: '202204-DB001-001',
other_title: "2022-07-18",
values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
},
])
const refreshing = $ref(true);
const finished = $ref(true);
const onRefresh = () => {
// 下拉重置参数,重新加载
};
const loadApproval = () => {
}
const router = useRouter();
const jump = () => {
router.push({ name: 'repayPlan-views-plan' })
}
</script>
<style scoped lang="less">
.list {
box-sizing: border-box;
height: calc(100vh - var(--van-nav-bar-height));
display: flex;
flex-direction: column;
justify-content: space-between;
padding-bottom: 10px;
}
.scroll {
box-sizing: border-box;
height: calc(100vh - 30vw);
overflow-y: auto;
}
</style>
<route>
{
meta: {
title: '还款计划查询'
}
}
</route>
...@@ -5,7 +5,7 @@ export function bridgeLogin() { ...@@ -5,7 +5,7 @@ export function bridgeLogin() {
return new Promise((resolve) => { return new Promise((resolve) => {
// 调用成功返回 // 调用成功返回
window.onSuccess = function (message) { window.onSuccess = function (message) {
console.log(message, '测试打印') console.log('BaseBridge:', message)
let object = handleSpecialCharacters(message) let object = handleSpecialCharacters(message)
const data = { const data = {
token: object.token, token: object.token,
...@@ -35,39 +35,39 @@ export function bridgeLogin() { ...@@ -35,39 +35,39 @@ export function bridgeLogin() {
export default async function login(token = '') { export default async function login(token = '') {
let result = {} let result = {}
if (token === '') { if (token === '') {
console.log('登录返回信息', JSON.stringify(result))
result = await bridgeLogin() // 本地子应用 result = await bridgeLogin() // 本地子应用
console.log('登录返回信息', JSON.stringify(result))
} else { } else {
result.token = token result.token = token
} }
window.localStorage.access_token = result.token window.localStorage.access_token = result.token
return NoticeAndReplaceRouter(result.pushExtra) return NoticeAndReplaceRouter(result.pushExtra)
} }
export function handleSpecialCharacters(jsonStr) { export function handleSpecialCharacters(jsonStr) {
let obj = {}; let obj = {};
if (jsonStr && Object.prototype.toString.call(jsonStr) == "[object String]" && jsonStr != 'null') { if (jsonStr && Object.prototype.toString.call(jsonStr) == "[object String]" && jsonStr != 'null') {
jsonStr = jsonStr.replace(/\r/g, "\\r"); jsonStr = jsonStr.replace(/\r/g, "\\r");
jsonStr = jsonStr.replace(/\n/g, "\\n"); jsonStr = jsonStr.replace(/\n/g, "\\n");
jsonStr = jsonStr.replace(/\t/g, "\\t"); jsonStr = jsonStr.replace(/\t/g, "\\t");
jsonStr = jsonStr.replace(/\\/g, "\\\\"); jsonStr = jsonStr.replace(/\\/g, "\\\\");
jsonStr = jsonStr.replace(/\'/g, "&#39;"); jsonStr = jsonStr.replace(/\'/g, "&#39;");
jsonStr = jsonStr.replace(/ /g, "&nbsp;"); jsonStr = jsonStr.replace(/ /g, "&nbsp;");
jsonStr = jsonStr.replace(/</g, "$lt;"); jsonStr = jsonStr.replace(/</g, "$lt;");
jsonStr = jsonStr.replace(/>/g, "$gt;"); jsonStr = jsonStr.replace(/>/g, "$gt;");
try{ try {
obj = JSON.parse(jsonStr)
} catch (e) {
let jsonArr = jsonStr.split('')
let start = jsonStr.indexOf('"project":') + '"project":'.length
let end = jsonStr.indexOf('}"', start)
jsonArr.splice(start, 1)
jsonArr.splice(end, 1)
jsonStr = jsonArr.join('')
obj = JSON.parse(jsonStr) obj = JSON.parse(jsonStr)
}catch(e){
let jsonArr=jsonStr.split('')
let start=jsonStr.indexOf('"project":')+'"project":'.length
let end=jsonStr.indexOf('}"',start)
jsonArr.splice(start,1)
jsonArr.splice(end,1)
jsonStr=jsonArr.join('')
obj=JSON.parse(jsonStr)
// let token=jsonStr.slice(jsonStr.indexOf('token')+'token'.length+3,jsonStr.indexOf('userId')-3) // let token=jsonStr.slice(jsonStr.indexOf('token')+'token'.length+3,jsonStr.indexOf('userId')-3)
...@@ -85,18 +85,18 @@ export function handleSpecialCharacters(jsonStr) { ...@@ -85,18 +85,18 @@ export function handleSpecialCharacters(jsonStr) {
} }
} }
return obj; return obj;
} }
// 通知消息跳转页面 // 通知消息跳转页面
function NoticeAndReplaceRouter(message) { function NoticeAndReplaceRouter(message) {
if (!message || !message.path) return {}; if (!message || !message.path) return {};
const path = message.path.match(/#(.*)\?/)[1] const path = message.path.match(/#(.*)\?/)[1]
const query = getQuery(message.path) const query = getQuery(message.path)
query.name=message.workflowTaskName query.name = message.workflowTaskName
console.log(path, query, '跳转参数与地址'); console.log(path, query, '跳转参数与地址');
return {path, query} return { path, query }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment