Commit 8d8144bb by kyle

增加引导页

parent ad85629f
......@@ -2,6 +2,21 @@ import request from "../util/request";
import {baseURL,apiURL,sfpURL} from "../environments/environment";
export default {
//查看token是否已经失效
checkToken(){
const params = {
token:uni.getStorageSync('uni-token'),
ticket:'uni-app'
}
return request(`${baseURL}/api/authorize/checkToken`, "POST", params)
},
// 获取token
obtainToken(){
const params = {
ticket:'uni-app'
}
return request(`${baseURL}/api/authorize/obtainToken`, "POST", params)
},
// 保单单利复利计算
irrAndSimpleCalcute(params) {
return request(`${baseURL}/api/sfp/calcuteUtil/irrAndSimpleCalcute`, "POST", params)
......
......@@ -17,7 +17,7 @@
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
<!-- 移动端调试 -->
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
<!-- <script type="text/javascript" src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script> -->
</body>
</html>
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"path": "pages/nav/nav",
"style": {
"topWindow": false,
"navigationBarTitleText": "CFFP财策师联盟"
......@@ -35,7 +35,14 @@
"navigationBarTitleText": "购房能力测算"
}
}
],
,{
"path" : "pages/index/index",
"style": {
"topWindow": false,
"navigationBarTitleText": "保单复利单利计算"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
......
......@@ -154,9 +154,9 @@
<radio-group @change="radioChange" style="display: flex;width: 100%;justify-content: space-evenly;">
<label v-for="(item, index) in chartsLegends" :key="item.value" style="display: flex;">
<view style="display: flex;">
<radio :value="item.value" :checked="index === chartsLegendsCurrent" />
<radio :value="item.value" :checked="item.value === chartsLegendsCurrent" />
</view>
<view>{{item.name}}</view>
<view style="font-size: 28rpx;">{{item.name}}</view>
</label>
</radio-group>
</view>
......@@ -247,7 +247,7 @@
export default{
data(){
return{
chartsLegendsCurrent: 0,
chartsLegendsCurrent: '1',
chartsLegends:[{
value: '1',
name: '总房款(万元)',
......@@ -283,7 +283,7 @@
downPaymentMin:null,//首付款最低成数(百分位)
newLoanYear:null,//新房贷款年限【必须大于0】
firstHouseAmount:null,//初期购房资金(单位万)
housePurchaseType:null,//购房用途
housePurchaseType:2,//购房用途
repaymentSpecial:null,//每年还贷专用款(单位万)
interestRate:null, //贷款年利率
},
......@@ -321,8 +321,8 @@
radioChange: function(evt) {
for (let i = 0; i < this.chartsLegends.length; i++) {
if (this.chartsLegends[i].value === evt.detail.value) {
this.chartsLegendsCurrent = i;
this.drawLine(evt.detail.value)
this.chartsLegendsCurrent = evt.detail.value;
this.drawLine(this.chartsLegendsCurrent)
break;
}
}
......@@ -541,7 +541,9 @@
return item.priceType == 1;
})[0]['fvPriceRealization'];
}
setTimeout(()=>{this.drawLine()});
setTimeout(()=>{
this.drawLine(this.chartsLegendsCurrent)
});
}else{
common.errorDialog(2,res['message'])
}
......@@ -783,7 +785,7 @@
}
.chartsLegend{
button{
margin-right: 10rpx;
margin-right: 6rpx;
}
}
.mask{
......
......@@ -4,23 +4,25 @@
<ul>
<template v-for="item in editParamLists">
<li :key="item.id" v-if="item.isShow">
<div class="paramName">{{item.name}}</div>
<div class="paramValue">
<input class="uni-input" type="digit" min='1' maxlength="17" placeholder="" v-model.trim="item.value"/>
<span>%</span>
</div>
<div class="dataSelect">
<div v-if="item.type==='data-picker'">
<view>
<uni-data-picker v-model="cityId" :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
</view>
<div>
<div class="paramName">{{item.name}}</div>
<div class="paramValue">
<input class="uni-input" type="digit" min='1' maxlength="17" placeholder="" v-model.trim="item.value"/>
<span>%</span>
</div>
<div v-if="item.remark">
<view>
<text style="font-size: 24rpx;color: #c0c4cc;">{{item.remark}}</text>
</view>
<div class="dataSelect">
<div v-if="item.type==='data-picker'">
<view>
<uni-data-picker v-model="cityId" :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
</view>
</div>
</div>
</div>
<div v-if="item.remark" class="tips">
<view>
<text style="font-size: 24rpx;color: #c0c4cc;">{{item.remark}}</text>
</view>
</div>
</li>
</template>
</ul>
......@@ -177,32 +179,34 @@
}
}
li{
display: flex;
align-items: center;
justify-content: space-around;
padding: 20rpx 0;
padding: 16rpx 0;
border-bottom: 1px solid #E4E4E4;
.paramName{
color: #6B4000;
font-size: 30rpx;
font-weight: bold;
width: 0;
flex: 0 0 35%;
letter-spacing: 1px;
}
.paramValue{
color: #CEB07D;
font-size: 0.8125rem;
font-weight: bold;
div{
display: flex;
width: 0;
flex: 0 0 20%;
align-items: center;
text-align: right;
}
.dataSelect{
width: 0;
flex: 0 0 40%;
.paramName{
color: #6B4000;
font-size: 30rpx;
font-weight: bold;
width: 0;
flex: 0 0 35%;
letter-spacing: 1px;
}
.paramValue{
color: #CEB07D;
font-size: 0.8125rem;
font-weight: bold;
display: flex;
width: 0;
flex: 0 0 20%;
align-items: center;
text-align: right;
}
.dataSelect{
width: 0;
flex: 0 0 40%;
}
}
}
.optionContent{
......
......@@ -40,10 +40,12 @@
font-size: 32rpx;
font-weight: bold;
color: #CEB07D;
flex: 1;
}
.simpleDataResult .calcNumber{
text-align: right;
font-size: 20px;
flex: 1;
}
.simpleDataResult .inputItem:last-child{
border:none;
......
<template>
<!-- <view v-show="irrFlag == false" > -->
<!-- 没有关注公众号须先关注公众号才可以使用 -->
<!-- <view class="qrcodeContainer" >
<view class="qrcodeContent">
<img src="../../static/images/qrcodeBg_1.png" alt="" srcset="">
</view>
</view> -->
<follow :redirectUrl="'sfp/pages/index/index'" @getFollowData="getFollowData" v-show="isNeedOfficialAccountQrcode"></follow>
<!-- 已关注公众号用户 -->
<view class="content" v-show="!isNeedOfficialAccountQrcode">
......@@ -193,10 +188,6 @@
</form>
</scroll-view>
</view>
<!-- </view> -->
<!-- <view v-show="irrFlag == true">
<dataImport></dataImport>
</view> -->
</template>
<script>
......@@ -212,7 +203,6 @@
export default {
data() {
return {
isNeedOfficialAccountQrcode:true,
......@@ -262,37 +252,6 @@
//初始化删除上次批量计算结果
uni.removeStorageSync('resIrrAndSimpleResInfos');
}
// if(dataHandling.getQueryString('subscribe')==0){
// this.isNeedOfficialAccountQrcode = true;
// return false;
// }else{
// this.isNeedOfficialAccountQrcode = false;
// }
// if(dataHandling.getQueryString('openId')) {
// uni.setStorageSync('openId',dataHandling.getQueryString('openId'))
// }else if(!dataHandling.getQueryString('openId') && dataHandling.getQueryString('isBack') != 1){
// api.getWxUserInfo({userApplyType:'1',businessNo:uni.getStorageSync('businessNo')}).then(res=>{
// if(res['success']){
// window.location.href = res.data.paymentForm.action;
// }
// })
// }
// if(
// sessionStorage.getItem('shareTipsFlag')!='1' &&
// !this.isNeedOfficialAccountQrcode &&
// dataHandling.getQueryString('subscribe')=='1'){
// uni.showModal({
// title: '',
// content: '好东西就要分享,您的分享,是我们持续提供好工具的动力',
// showCancel:false,
// confirmText:'确定',
// success: function (res) {
// if (res.confirm) {
// sessionStorage.setItem('shareTipsFlag','1')
// }
// }
// });
// }
if(this.yearWithdrawal.length>0){
this.yearWithdrawalInfos.push({...this.yearWithdrawal,withdrawalType:this.withdrawalType?'1':'2'})
}
......@@ -626,6 +585,11 @@
this.irrAndSimpleResInfos = [];
}
}else{
if(res.data.calcuteCode=='0'){
// 没有关注公众号
this.isNeedOfficialAccountQrcode = true;
return false;
}
this.irrAndSimpleResInfos = [];
uni.showToast({
title: res['message'],
......
<template>
<view>
<ul>
<li v-for="item in moduleLists" :key="item.no">
<navigator :url="item.path" hover-class="other-navigator-hover">
<view class="imgContainer"><img :src="`../../static/images/${item.background}`" alt="" srcset=""></view>
<text :style="{color:item.color}">{{item.name}}</text>
</navigator>
</li>
</ul>
<view style="text-align: center;">更多工具正在开发中,敬请期待。。。</view>
</view>
</template>
<script>
import api from "../../api/api";
export default {
data() {
return {
moduleLists:[
{no:'1',name:'增额终身寿和年金险复利、单利计算',path:'/pages/index/index',background:'irrNavBg.jpg',color:'#EA8A49'},
{no:'2',name:'购房能力测算',path:'/pages/housePurchase/housePurchase',background:'propertyBg.jpg',color:'#6F5AD4'},
// {no:'3',name:'子女教育金测算',path:'',background:'childrenBgNavBg.jpg',color:'#CE8C1B'}
]
}
},
methods: {
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
if(res.success){
uni.setStorageSync('uni-token',res.data['token']);
}
})
}
})
}
},
mounted(){
this.checkToken();
}
}
</script>
<style lang="scss">
ul{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding:20rpx;
li{
width:0;
flex: 0 0 49%;
position: relative;
margin-bottom: 20rpx;
.imgContainer{
img{
max-width: 100%;
height: auto;
}
}
text{
position: absolute;
left: 10px;
top: 10px;
width: 60%;
font-size: 15px;
font-weight: bold;
}
}
}
</style>
import api from "../api/api";
import {baseURL,apiURL,sfpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`/api/authorize/obtainToken`]
const whiteApiList = [`/api/authorize/obtainToken`,`/api/authorize/checkToken`]
export const interceptor = () => {
......@@ -17,6 +17,7 @@ export const interceptor = () => {
})
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
console.log('-----------')
return new Promise((resolve, reject)=>{
uni.request({
url: '/api/authorize/obtainToken',
......
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