Commit 8d8144bb by kyle

增加引导页

parent ad85629f
...@@ -2,6 +2,21 @@ import request from "../util/request"; ...@@ -2,6 +2,21 @@ import request from "../util/request";
import {baseURL,apiURL,sfpURL} from "../environments/environment"; import {baseURL,apiURL,sfpURL} from "../environments/environment";
export default { 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) { irrAndSimpleCalcute(params) {
return request(`${baseURL}/api/sfp/calcuteUtil/irrAndSimpleCalcute`, "POST", params) return request(`${baseURL}/api/sfp/calcuteUtil/irrAndSimpleCalcute`, "POST", params)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div id="app"><!--app-html--></div> <div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script> <script type="module" src="/main.js"></script>
<!-- 移动端调试 --> <!-- 移动端调试 -->
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/eruda"></script> <!-- <script type="text/javascript" src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script> <script>eruda.init();</script> -->
</body> </body>
</html> </html>
{ {
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/nav/nav",
"style": { "style": {
"topWindow": false, "topWindow": false,
"navigationBarTitleText": "CFFP财策师联盟" "navigationBarTitleText": "CFFP财策师联盟"
...@@ -35,6 +35,13 @@ ...@@ -35,6 +35,13 @@
"navigationBarTitleText": "购房能力测算" "navigationBarTitleText": "购房能力测算"
} }
} }
,{
"path" : "pages/index/index",
"style": {
"topWindow": false,
"navigationBarTitleText": "保单复利单利计算"
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
......
...@@ -154,9 +154,9 @@ ...@@ -154,9 +154,9 @@
<radio-group @change="radioChange" style="display: flex;width: 100%;justify-content: space-evenly;"> <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;"> <label v-for="(item, index) in chartsLegends" :key="item.value" style="display: flex;">
<view style="display: flex;"> <view style="display: flex;">
<radio :value="item.value" :checked="index === chartsLegendsCurrent" /> <radio :value="item.value" :checked="item.value === chartsLegendsCurrent" />
</view> </view>
<view>{{item.name}}</view> <view style="font-size: 28rpx;">{{item.name}}</view>
</label> </label>
</radio-group> </radio-group>
</view> </view>
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
export default{ export default{
data(){ data(){
return{ return{
chartsLegendsCurrent: 0, chartsLegendsCurrent: '1',
chartsLegends:[{ chartsLegends:[{
value: '1', value: '1',
name: '总房款(万元)', name: '总房款(万元)',
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
downPaymentMin:null,//首付款最低成数(百分位) downPaymentMin:null,//首付款最低成数(百分位)
newLoanYear:null,//新房贷款年限【必须大于0】 newLoanYear:null,//新房贷款年限【必须大于0】
firstHouseAmount:null,//初期购房资金(单位万) firstHouseAmount:null,//初期购房资金(单位万)
housePurchaseType:null,//购房用途 housePurchaseType:2,//购房用途
repaymentSpecial:null,//每年还贷专用款(单位万) repaymentSpecial:null,//每年还贷专用款(单位万)
interestRate:null, //贷款年利率 interestRate:null, //贷款年利率
}, },
...@@ -321,8 +321,8 @@ ...@@ -321,8 +321,8 @@
radioChange: function(evt) { radioChange: function(evt) {
for (let i = 0; i < this.chartsLegends.length; i++) { for (let i = 0; i < this.chartsLegends.length; i++) {
if (this.chartsLegends[i].value === evt.detail.value) { if (this.chartsLegends[i].value === evt.detail.value) {
this.chartsLegendsCurrent = i; this.chartsLegendsCurrent = evt.detail.value;
this.drawLine(evt.detail.value) this.drawLine(this.chartsLegendsCurrent)
break; break;
} }
} }
...@@ -541,7 +541,9 @@ ...@@ -541,7 +541,9 @@
return item.priceType == 1; return item.priceType == 1;
})[0]['fvPriceRealization']; })[0]['fvPriceRealization'];
} }
setTimeout(()=>{this.drawLine()}); setTimeout(()=>{
this.drawLine(this.chartsLegendsCurrent)
});
}else{ }else{
common.errorDialog(2,res['message']) common.errorDialog(2,res['message'])
} }
...@@ -783,7 +785,7 @@ ...@@ -783,7 +785,7 @@
} }
.chartsLegend{ .chartsLegend{
button{ button{
margin-right: 10rpx; margin-right: 6rpx;
} }
} }
.mask{ .mask{
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<ul> <ul>
<template v-for="item in editParamLists"> <template v-for="item in editParamLists">
<li :key="item.id" v-if="item.isShow"> <li :key="item.id" v-if="item.isShow">
<div>
<div class="paramName">{{item.name}}</div> <div class="paramName">{{item.name}}</div>
<div class="paramValue"> <div class="paramValue">
<input class="uni-input" type="digit" min='1' maxlength="17" placeholder="" v-model.trim="item.value"/> <input class="uni-input" type="digit" min='1' maxlength="17" placeholder="" v-model.trim="item.value"/>
...@@ -15,12 +16,13 @@ ...@@ -15,12 +16,13 @@
<uni-data-picker v-model="cityId" :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker> <uni-data-picker v-model="cityId" :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
</view> </view>
</div> </div>
<div v-if="item.remark"> </div>
</div>
<div v-if="item.remark" class="tips">
<view> <view>
<text style="font-size: 24rpx;color: #c0c4cc;">{{item.remark}}</text> <text style="font-size: 24rpx;color: #c0c4cc;">{{item.remark}}</text>
</view> </view>
</div> </div>
</div>
</li> </li>
</template> </template>
</ul> </ul>
...@@ -177,11 +179,12 @@ ...@@ -177,11 +179,12 @@
} }
} }
li{ li{
padding: 16rpx 0;
border-bottom: 1px solid #E4E4E4;
div{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around;
padding: 20rpx 0;
border-bottom: 1px solid #E4E4E4;
.paramName{ .paramName{
color: #6B4000; color: #6B4000;
font-size: 30rpx; font-size: 30rpx;
...@@ -205,6 +208,7 @@ ...@@ -205,6 +208,7 @@
flex: 0 0 40%; flex: 0 0 40%;
} }
} }
}
.optionContent{ .optionContent{
height: 94rpx; height: 94rpx;
line-height: 94rpx; line-height: 94rpx;
......
...@@ -40,10 +40,12 @@ ...@@ -40,10 +40,12 @@
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #CEB07D; color: #CEB07D;
flex: 1;
} }
.simpleDataResult .calcNumber{ .simpleDataResult .calcNumber{
text-align: right; text-align: right;
font-size: 20px; font-size: 20px;
flex: 1;
} }
.simpleDataResult .inputItem:last-child{ .simpleDataResult .inputItem:last-child{
border:none; border:none;
......
<template> <template>
<!-- <view v-show="irrFlag == false" > --> <!-- <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> <follow :redirectUrl="'sfp/pages/index/index'" @getFollowData="getFollowData" v-show="isNeedOfficialAccountQrcode"></follow>
<!-- 已关注公众号用户 --> <!-- 已关注公众号用户 -->
<view class="content" v-show="!isNeedOfficialAccountQrcode"> <view class="content" v-show="!isNeedOfficialAccountQrcode">
...@@ -193,10 +188,6 @@ ...@@ -193,10 +188,6 @@
</form> </form>
</scroll-view> </scroll-view>
</view> </view>
<!-- </view> -->
<!-- <view v-show="irrFlag == true">
<dataImport></dataImport>
</view> -->
</template> </template>
<script> <script>
...@@ -212,7 +203,6 @@ ...@@ -212,7 +203,6 @@
export default { export default {
data() { data() {
return { return {
isNeedOfficialAccountQrcode:true, isNeedOfficialAccountQrcode:true,
...@@ -262,37 +252,6 @@ ...@@ -262,37 +252,6 @@
//初始化删除上次批量计算结果 //初始化删除上次批量计算结果
uni.removeStorageSync('resIrrAndSimpleResInfos'); 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){ if(this.yearWithdrawal.length>0){
this.yearWithdrawalInfos.push({...this.yearWithdrawal,withdrawalType:this.withdrawalType?'1':'2'}) this.yearWithdrawalInfos.push({...this.yearWithdrawal,withdrawalType:this.withdrawalType?'1':'2'})
} }
...@@ -626,6 +585,11 @@ ...@@ -626,6 +585,11 @@
this.irrAndSimpleResInfos = []; this.irrAndSimpleResInfos = [];
} }
}else{ }else{
if(res.data.calcuteCode=='0'){
// 没有关注公众号
this.isNeedOfficialAccountQrcode = true;
return false;
}
this.irrAndSimpleResInfos = []; this.irrAndSimpleResInfos = [];
uni.showToast({ uni.showToast({
title: res['message'], 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 api from "../api/api";
import {baseURL,apiURL,sfpURL} from "../environments/environment"; import {baseURL,apiURL,sfpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口 // 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`/api/authorize/obtainToken`] const whiteApiList = [`/api/authorize/obtainToken`,`/api/authorize/checkToken`]
export const interceptor = () => { export const interceptor = () => {
...@@ -17,6 +17,7 @@ export const interceptor = () => { ...@@ -17,6 +17,7 @@ export const interceptor = () => {
}) })
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token // 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) { if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
console.log('-----------')
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
uni.request({ uni.request({
url: '/api/authorize/obtainToken', 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