Commit a4139ef5 by sunchao

sfp项目转移

parent 94d94b1f
...@@ -316,5 +316,35 @@ export default { ...@@ -316,5 +316,35 @@ export default {
//统一支付接口 //统一支付接口
unifiedPay(params){ unifiedPay(params){
return request(`${apiURL}/pay/unifiedPay`, "POST", params) return request(`${apiURL}/pay/unifiedPay`, "POST", params)
},
// 保单单利复利计算
irrAndSimpleCalcute(params) {
return request(`${baseURL}/api/sfp/calcuteUtil/irrAndSimpleCalcute`, "POST", params)
},
// 获取unionId
getWxUserInfo(params){
return request(`${baseURL}/api/getWxUserInfo`, "POST", params)
},
//增额寿和年金(单利复利)计算结果查询接口
queryIrrAndSimple(params){
return request(`${baseURL}/api/sfp/calcuteUtil/queryIrrAndSimple`, "POST", params)
},
//获取城市
provCityQry(params){
return request(`${baseURL}/api/metadata/provCityQry`, "POST", params)
},
//购房能力测算
housePurchasePlanAnalysis(params){
return request(`${baseURL}/api/sfp/calcuteUtil/housePurchasePlanAnalysis`, "POST", params)
},
// 各城市商品住宅销售价格查询接口
queryCommercialHousingPrice(params){
return request(`${baseURL}/api/sfp/calcuteConfig/queryCommercialHousingPrice`, "POST", params)
},
// 子女教育测算
educationEstimate(params){
return request(`${baseURL}/api/sfp/calcuteUtil/educationEstimate`, "POST", params)
} }
} }
...@@ -204,6 +204,47 @@ export default { ...@@ -204,6 +204,47 @@ export default {
deviceType = '1'; deviceType = '1';
} }
return deviceType; return deviceType;
} },
// 数据处理
action(data){ // 使用递归函数
// if(!(data?.length <= 0)){
// 等价于
if(!data || data.length <= 0){ // 递归的出口
return null;
}
return data.map(x => { // 循环数据
const model = { // 把后端返回过来的数据里面的键给替换成我想要的键
source: x,
text: x.provinceName ? x.provinceName : x.cityName,
value: x.cityId ? x.cityId : x.provinceId,
};
const children = this.action(x.citys); // 子级数据
if(children){ // 一直往下循环查找有没有children这个键,如果有就直接添加一个子级字段名,这个字段名就是存子级数据
model.children = children;
}
return model; // 返回这个数据
});
},
/*
num:源数据
digitNum:保留几位小数
type:向上(1)取
*/
formatFloat(num,digitNum=2,type=1){
if(num){
if(type===1){
const dataNum = (num * Math.pow(10, digitNum + 1) / Math.pow(10, digitNum + 1)).toString();
if(dataNum.indexOf('.')>-1){
return (Number(dataNum.slice(0, dataNum.indexOf('.') + digitNum + 1)) + 10 / Math.pow(10, digitNum + 1)).toFixed(digitNum)
}else{
return dataNum;
}
}else{
return (num * Math.pow(10, digitNum + 1) / Math.pow(10, digitNum + 1)).toFixed(digitNum)
}
}else{
return num;
}
},
} }
\ No newline at end of file
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
</u-button> --> </u-button> -->
<!-- <u-button @click="clear" type="warning" :plain="true" :ripple="true" ripple-bg-color="#909399">清除 <!-- <u-button @click="clear" type="warning" :plain="true" :ripple="true" ripple-bg-color="#909399">清除
</u-button> --> </u-button> -->
<view class="imgBox" style="margin-top: 20rpx;"> <!-- <view class="imgBox" style="margin-top: 20rpx;">
<image src="../../static/clear.png" @click="clear" mode="widthFix"></image> <image src="../../static/clear.png" @click="clear" mode="widthFix"></image>
</view> </view> -->
<!-- <u-button @click="close" type="error" :plain="true" :ripple="true" ripple-bg-color="#909399">关闭 <!-- <u-button @click="close" type="error" :plain="true" :ripple="true" ripple-bg-color="#909399">关闭
</u-button> --> </u-button> -->
</view> </view>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
}; };
}, },
props: ['showCanvas'], props: ['showCanvas'],
emits: ['sendImage'], emits: ['sendImage',],
methods: { methods: {
//清除签名的图片 //清除签名的图片
obliterate() { obliterate() {
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
}, },
methods: { methods: {
goDetail(item) { goDetail(item) {
console.log(item, 844)
if (item.isShow == true && item.isOpen == true) { if (item.isShow == true && item.isOpen == true) {
if (item.isTips == true) { if (item.isTips == true) {
uni.showModal({ uni.showModal({
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
] ]
}, },
"dependencies": { "dependencies": {
"echarts": "^5.4.1",
"nanoid": "^4.0.0", "nanoid": "^4.0.0",
"vue-signature-pad": "^3.0.2" "vue-signature-pad": "^3.0.2"
} }
......
...@@ -410,6 +410,34 @@ ...@@ -410,6 +410,34 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "sfp/index/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "sfp/housePurchase/housePurchase",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "sfp/childEdu/childEdu",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "sfp/dataImport/data-import",
"style": {
"topWindow": false,
"navigationBarTitleText": "批量数据计算"
}
} }
], ],
// "tabBar": { // "tabBar": {
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
} }
.fixed { .fixed {
position: fixed; position: fixed;
bottom: 0; bottom: 60rpx;
left: 0; left: 0;
right: 0; right: 0;
height: 100rpx; height: 100rpx;
......
...@@ -24,9 +24,12 @@ ...@@ -24,9 +24,12 @@
<text class="page_mark">8/8</text> <text class="page_mark">8/8</text>
</view> </view>
<view class="signatureContent" v-if="!applyParam.personalSignOssPath"> <view class="signatureContent" v-if="!applyParam.personalSignOssPath">
<e-signature :style="{'width':'100vw','height':'80vh'}" :showCanvas="showCanvas" ref="signatureComponent" @sendImage="getImage"></e-signature> <e-signature :style="{'width':'100vw','height':'80vh'}" :showCanvas="showCanvas" ref="signatureComponent" @sendImage="getImage" ></e-signature>
</view> </view>
<image :src="applyParam.personalSignOssPath" mode="widthFix" v-if="applyParam.personalSignOssPath"></image> <image :src="applyParam.personalSignOssPath" mode="widthFix" v-if="applyParam.personalSignOssPath"></image>
<view class="imgBox" style="margin-top: 20rpx;">
<image src="../../static/clear.png" @click="clearImg" mode="widthFix"></image>
</view>
<view class="fixed" url="bank-card" @click="save()"> <view class="fixed" url="bank-card" @click="save()">
{{(this.applyParam.approvalStatus== 0 || this.applyParam.approvalStatus == 2)?'我自愿签订推广人合同书':'下一步'}} {{(this.applyParam.approvalStatus== 0 || this.applyParam.approvalStatus == 2)?'我自愿签订推广人合同书':'下一步'}}
</view> </view>
...@@ -68,7 +71,16 @@ ...@@ -68,7 +71,16 @@
}else{ }else{
this.$refs.signatureComponent.finish() this.$refs.signatureComponent.finish()
} }
},
clearImg(){
//0-未提交,1-待审核,2-审核未通过,3-审核通过
if((this.applyParam.personalSignOssPath && this.applyParam.approvalStatus == 2) ||
(this.applyParam.personalSignOssPath && this.applyParam.approvalStatus == 0)
){
this.applyParam.personalSignOssPath = null;
}else{
this.$refs.signatureComponent.clear();
}
}, },
queryById(id,userId){ queryById(id,userId){
api.queryById({id:id,userId:userId}).then((res)=>{ api.queryById({id:id,userId:userId}).then((res)=>{
...@@ -134,6 +146,7 @@ ...@@ -134,6 +146,7 @@
background: #fff; background: #fff;
margin-top: 20rpx; margin-top: 20rpx;
height: 100%; height: 100%;
position: relative;
} }
.signature_action{ .signature_action{
display: flex; display: flex;
...@@ -141,4 +154,11 @@ ...@@ -141,4 +154,11 @@
margin-top: 20rpx; margin-top: 20rpx;
uni-image{max-width: 120rpx;max-height: 120rpx;} uni-image{max-width: 120rpx;max-height: 120rpx;}
} }
.imgBox{
position: absolute;
top: 75%;
left: 40%;
width: 120rpx;
height: 120rpx;
}
</style> </style>
\ No newline at end of file
...@@ -390,6 +390,9 @@ ...@@ -390,6 +390,9 @@
box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.1); box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.1);
border-radius: 10rpx; border-radius: 10rpx;
} }
.uni-calendar{
padding-bottom: 50rpx;
}
.lineChartBox{ .lineChartBox{
width: 100%; width: 100%;
.chartTips{ .chartTips{
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</view> </view>
</view> </view>
<view class="paymentItem" @click="selectPaymentMethod(1)"> <view class="paymentItem" @click="selectPaymentMethod(1)" v-if="deviceType==3">
<view> <view>
<i class="iconfont icon-py_weixinzhifu"></i> <i class="iconfont icon-py_weixinzhifu"></i>
<text>微信支付</text> <text>微信支付</text>
...@@ -39,6 +39,17 @@ ...@@ -39,6 +39,17 @@
<i class="iconfont icon-duihao"></i> <i class="iconfont icon-duihao"></i>
</view> </view>
</view> </view>
<!-- #ifdef APP-PLUS -->
<view class="paymentItem" @click="selectPaymentMethod(1)" >
<view>
<i class="iconfont icon-py_weixinzhifu"></i>
<text>微信支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===1}">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<!-- #endif -->
</view> </view>
<!-- 底部 --> <!-- 底部 -->
<view class="totalContent"> <view class="totalContent">
...@@ -200,13 +211,41 @@ ...@@ -200,13 +211,41 @@
if(this.paymentMethod==1){ if(this.paymentMethod==1){
// APP:微信app支付 // APP:微信app支付
// #ifdef APP-PLUS // #ifdef APP-PLUS
api.wxAppPay(param).then(res=>{ param.paymentType = 1;
api.unifiedPay(param).then(res=>{
console.log(res)
this.paymentBtnDisabled = false; this.paymentBtnDisabled = false;
}) })
// #endif // #endif
// #ifdef H5 // #ifdef H5
param.paymentType = 2;
//deviceType:PC为1,移动端为2,微信为3 //deviceType:PC为1,移动端为2,微信为3
if(this.deviceType == 3){
//微信h5支付
console.log(this.$queue)
uni.login({
provider: 'weixin',
success: function (loginRes) {
console.log(loginRes)
// 登录成功
uni.getUserInfo({
provider: 'weixin',
success: function(info) {
alert(JSON.stringify(info))
param.openId=info.openId;
}
})
},
fail: function (err) {
// 登录授权失败
// err.code是错误码
}
});
}else{
//微信二维码支付
}
// #endif // #endif
}else if(this.paymentMethod==2){ }else if(this.paymentMethod==2){
......
...@@ -14,31 +14,31 @@ import MenuList from "@/components/menuList/menuList.vue" ...@@ -14,31 +14,31 @@ import MenuList from "@/components/menuList/menuList.vue"
minorMenuLists: [{ minorMenuLists: [{
title: '房贷推销计算器', title: '房贷推销计算器',
icon: 'shareEcode', icon: 'shareEcode',
link: '', link: '/sfp/housePurchase/housePurchase',
isOpen: true, isOpen: true,
isShow: true, isShow: true,
isTips: false, isTips: false,
}, },
{ {
title: '现金流计算器', title: '子女教育计算器',
icon: 'card', icon: 'card',
link: '', link: '/sfp/childEdu/childEdu',
isOpen: true,
isShow: true,
isTips: true,
},
{
title: '货币时间价值计算器',
icon: 'myCertify',
link: '',
isOpen: true, isOpen: true,
isShow: true, isShow: true,
isTips: false, isTips: false,
}, },
// {
// title: '货币时间价值计算器',
// icon: 'myCertify',
// link: '',
// isOpen: true,
// isShow: true,
// isTips: false,
// },
{ {
title: '保单利率计算器', title: '保单利率计算器',
icon: 'myCertify', icon: 'myCertify',
link: '', link: '/sfp/index/index',
isOpen: true, isOpen: true,
isShow: true, isShow: true,
isTips: false, isTips: false,
......
{
"appid": "wx6f51ca088a97f1db",
"compileType": "miniprogram",
"libVersion": "2.28.1",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"simulatorPluginLibVersion": {}
}
\ No newline at end of file
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "CFFP-HB",
"setting": {
"compileHotReLoad": true
}
}
\ No newline at end of file
.listContent .liBox{
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E4E4E4;
padding: 16rpx 0;
font-size: 28rpx;
}
.listContent .multiline{
flex-direction: column;
justify-content: center;
align-items: flex-start;
}
.listContent .liBox >view:last-child{
display: flex;
align-items: center;
white-space: nowrap;
}
.multilineItem{
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
margin-bottom: 12rpx;
}
.selectBtnContent{
display: flex;
}
.selectBtnContent text{
position: relative;
width: 100rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
position: relative;
border: 1px solid #FED597;
margin-right: 20rpx;
border-radius: 6rpx;
}
.selectBtnContent text.actived::after{
position: absolute;
content: '';
display: block;
bottom: 0;
right: 0;
border: 18rpx solid #FED495;
border-left-color: transparent;
border-top-color: transparent;
}
.selectBtnContent text.actived::before{
content: '√';
position: absolute;
display: block;
right: 0;
z-index: 1;
color: #fff;
bottom: -7px;
}
.listContent .planGradeRange{
flex-direction: column;
justify-content: center;
align-items: flex-start;
}
.listContent .planGradeRange > view:last-child{
display: flex;
align-items: center;
justify-content: center;
margin: 12rpx auto;
width: 100%;
}
.listContent view.planGradeRange > view:last-child text{
position: relative;
width: 80rpx;
height: 1px;
background-color: #E4E4E4;
margin: 0 10rpx;
}
.schoolingContent{
margin-top: 10px;
box-shadow: 0px 0px 6px 1px rgb(0 0 0 / 35%);
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
margin: 20rpx 10rpx;
}
.schoolingContent .liBox{
display: flex;
height: 80rpx;
justify-content: center;
align-items: center;
border-bottom: 1px solid #E4E4E4;
padding: 0 10rpx;
}
.schoolingContent .liBox:first-child{
background: linear-gradient(to right,#CEB07D,#FFDDA9);
color: #6B4000;
font-weight: bold;
}
.schoolingContent .liBox > view{
width: 0;
flex: 1;
height: 100%;
white-space: nowrap;
font-size: 24rpx;
border-right: 1rpx solid #E4E4E4;
display: flex;
justify-content: center;
align-items: center;
}
.schoolingContent .liBox > view:last-child{
border-right: none;
}
.settingButton{
border-radius: 8rpx;
background: #F7D295;
color: #6B4000;
padding: 10rpx 20rpx;
}
.summaryContent {
margin: 0 20rpx;
}
.successInfo,.failInfo,.suggestionInfo{
background-color: rgba(35,255,0,0.02);
padding: 20rpx 60rpx;
color: #333;
margin-top: 20rpx;
}
.failInfo{
background-color: #FFE6E6;
}
input{
text-align: right!important;
}
.dialogContainer{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.35);
z-index: 2;
}
.dialogContent{
position: absolute;
left: 50%;
top: 30%;
transform: translateX(-50%);
width: 95%;
background-color: #fff;
border-radius: 10rpx;
padding: 20rpx 40rpx;
box-sizing: border-box;
}
.dialogContent .closeBtn{
text-align: right;
font-size: 56rpx;
}
.dialogContent .ulBox{
border-radius: 5rpx;
box-shadow: 0 0 10rpx 4rpx rgba(0,0,0,0.25);
margin-top: 20rpx;
}
.dialogContent .ulBox .liBox{
display: flex;
height: 80rpx;
border-bottom: 1rpx solid #E4E4E4;
color: #6B4000;
}
.dialogContent .ulBox .liBox:first-child{
background: linear-gradient(to right,#CEB07D,#FFDDA9);
}
.dialogContent .ulBox .liBox > view{
flex: 1;
text-align: center;
height: 100%;
align-items: center;
display: flex;
justify-content: center;
border-right: 1px solid #E4E4E4;
}
.dialogContent .ulBox .liBox > view:last-child{
border-right: none;
}
.dialogContent button{
margin-top: 40rpx;
background: linear-gradient(to bottom right,#CEB07D,#FFDDA9);
color: #6B4000;
border: none;
width: 50%;
font-weight: bold;
}
.dialogContainer .dialogContent input,.schoolingContent .liBox > view input{
text-align: center!important;
padding-left: 10rpx;
}
\ No newline at end of file
/* 保单年度弹窗 */
.policySelectContainer{
position: fixed;
z-index: 2;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.35);
}
.policySelectContainer .policyYearContainer{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 57%;
background-color: #fff;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
padding: 20rpx 30rpx 0;
box-sizing: border-box;
overflow-y: scroll;
}
.policyYearContainer .modalTitle{
display: flex;
justify-content: space-between;
align-items: center;
font-weight: bold;
}
.policyYearContainer .modalTitle text:last-child{
color: #FF0000;
}
.policyYearItemContainer{
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.policyYearItemContainer view{
width: 9%;
height: 0;
padding-bottom: 9%;
margin: 20rpx 0;
color: #fff;
border-radius: 50%;
position: relative;
margin-right: 6rpx;
color: #333;
font-weight: bold;
}
.policyYearItemContainer view.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color:#6B4000;
}
.policyYearItemContainer view text{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-55%);
}
.policyStepContainer{
display: flex;
justify-content: space-around;
margin-top: 40rpx;
}
.policyStepContainer button{
flex: 0 0 30%;
font-size: 32rpx;
color:#000;
font-weight:bold;
border:1px solid #CEB07D;
}
.policyStepContainer uni-button::after{
border:1px solid #CEB07D;
}
.policyStepContainer button.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
}
.policyStepContainer button.actived,.policyStepContainer button.actived::after{
border:none;
}
.confirm button{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
font-weight: bold;
font-size: 36rpx;
margin-top: 56rpx;
width: 300rpx;
}
.confirm button,.confirm button::after{
border: none ;
}
.uni-textarea{
position: relative;
}
.pasteDiscernment{
position: absolute;
right: 0;
bottom: 0;
height: 50rpx;
background: #9B8055;
border-radius: 100px;
color: #fff;
font-size: 24rpx;
}
.batchDataImportContainer{
background-color: #fbfbfb;
height: 90vh;
}
.batchDataLists{
margin-top: 20rpx;
background: #fff;
}
.batchDataLists view{
display: flex;
justify-content: center;
align-items: center;
}
.batchDataLists view text:first-child{
display: inline-block;
width: 100%;
flex: auto;
text-align: center;
border-right: 1px solid #e4e4e4;
}
.batchDataLists view.batchDataTh{
background:linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
min-height: 80rpx;
}
.batchDataTh .pvTitle{
display: flex;
flex-direction: column;
flex: 0 0 65%;
justify-content: center;
align-items: center;
}
.batchDataTh > view:first-child,.batchDataTd > view:first-child{
width: 0;
flex: 0 0 35%;
justify-content: center;
}
.batchDataTh > view:last-child,.batchDataTd > view:last-child{
width: 0;
flex: 0 0 65%;
justify-content: center;
}
.batchDataTh .pvTitle view{
border: none;
}
.batchDataLists view.batchDataTd{
display: flex;
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #e4e4e4;
}
.dataOptionContainer{
margin: 20rpx 20rpx 0;
margin-bottom: 34rpx;
}
.dataOptionContainer .uni-textarea{
background-color: #fff;
margin-bottom: 20rpx;
}
.tips{
font-size: 24rpx;
color: #666;
padding: 0 20rpx 20rpx;
background-color: #fff;
}
.tips text text{
font-size: 28rpx;
color: #9B8055;
font-weight: bold;
}
.selectStepContent,.selectStepContainer{
display: flex;
align-items: center;
}
.selectStepContainer{
justify-content: space-between;
padding: 20rpx 20rpx 0;
background-color: #fff;
}
.stepContent{
display: flex;
align-items: center;
border-bottom: 1px solid #e4e4e4;
padding: 0 5px;
}
.selectStepContainer button{
background-color: transparent;
}
.selectStepContainer button::after{
border: 1px solid #CEB07D;
}
.optionContent{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
}
.optionContent button{
flex: 0 0 46%;
border:2rpx solid #e7c793;
color: #6B4000;
font-size: 36rpx;
}
.optionContent button:last-child{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border: none;
}
.batchDataTd input{
height: 100%;
}
\ No newline at end of file
<template>
<view class="supportDeclarationContainer">
<img src="/static/images/cffpLogo.png" alt="" srcset="">
<text>本工具由CFFP财策师联盟提供技术支持</text>
</view>
</template>
<script>
export default{
data(){
return{}
},
name:'foot',
components:{
},
onLoad(){
},
methods:{
}
}
</script>
<style>
.supportDeclarationContainer{
padding-bottom: 160rpx;
text-align: center;
color: #ccc;
display: flex;
justify-content: center;
align-items: center;
}
.supportDeclarationContainer img{
width: 60rpx;
}
</style>
\ No newline at end of file
<template>
<view class="supportTips">
<img src="/static/images/cffpLogo.png" alt="" srcset="">
<text>本工具由CFFP财策师联盟提供技术支持</text>
</view>
</template>
<script>
export default{
data(){
return{}
},
name:'commonHead',
components:{
},
onLoad(){
},
methods:{
}
}
</script>
<style>
.supportTips{
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
font-size: 26rpx;
width: 100%;
padding: 0rpx 12rpx;
background: rgba(255,255,255,.5);
color: #000;
z-index: 1;
}
.supportTips text{
white-space: nowrap;
}
.supportTips img{
width: 60rpx;
}
</style>
\ No newline at end of file
<template>
<view class="paramsContainer">
<h5>规划参数<span>(点击参数值即可修改参数)</span></h5>
<view class="ulBox">
<template v-for="item in editParamLists">
<view :key="item.id" v-if="item.isShow" class="liBox">
<view>
<view class="paramName">{{item.name}}</view>
<view class="paramValue">
<input class="uni-input" type="digit" min='1' maxlength="17" placeholder="" v-model.trim="item.value"/>
<span>%</span>
</view>
<view class="dataSelect">
<view 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>
</view>
</view>
</view>
<view v-if="item.remark" class="tips">
<view>
<text style="font-size: 24rpx;color: #c0c4cc;">{{item.remark}}</text>
</view>
</view>
</view>
</template>
</view>
<view class="optionContent">
<view class="confirm"><text @click="confirmParams()">确定</text></view>
<view class="reset"><text @click="resetParams()">恢复默认</text></view>
</view>
</view>
</template>
<script>
import {toRefs} from "vue";
import api from '../../api/api';
import common from '../../common/common'
export default{
props:['cityInfo','planningParams'],
emits:['getData'],
data(){
return {
cityId:null,
paramsLists:[
{id:'01',name:'房价增长率',value:5.32,type:'data-picker',remark:'',alias:'housePriceGrowthRate',isShow:true },
{id:'02',name:'房屋折旧率',value:2,type:'number',remark:'',alias:'houseDepreciationRate',isShow:true},
{id:'03',name:'首付款最低成数',value:30,type:'number',remark:'',alias:'downPaymentMin',isShow:true},
{id:'05',name:'资产投资回报率',value:3.74,type:'number',remark:'',alias:'tnvestmentRate',isShow:true},
{id:'06',name:'投入资金增长率',value:0,type:'number',remark:'"每年投入房产资金"将会按照该设定值进行增长型测算',alias:'incomeRate',isShow:true},
{id:'07',name:'可接受本金损失',value:10,type:'number',remark:'',alias:'acceptableLossRate',isShow:true}
],
editParamLists:[],
provinceList:[],
}
},
name:'planningParameters',
components:{
},
onLoad(){
},
setup(props,content){
const cityInfo = props.cityInfo ? props.cityInfo : null;
const planningParams = props.planningParams ? toRefs(props.planningParams) : null;
const sendData = (e) =>{
content.emit('getData',e);
}
return {sendData,cityInfo,planningParams}
},
methods:{
onchange(e) {
// const value = e.detail.value;
},
onnodeclick(node) {
this.cityInfo = {
...this.cityInfo,
cityId: node.value,
provinceId:node.parent_value ? node.parent_value : null,
cityName:node.parent_value ? node.text : this.cityInfo.cityName,
provinceName:node.parent_value ? this.cityInfo.provinceName : node.text,
}
this.queryCommercialHousingPrice()
},
resetParams(){
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists));
this.cityId=null;
this.cityInfo = {cityId:null,provinceId:null,cityName:null,provinceName:null};
},
provCityQry(){
api.provCityQry({insurerId:888}).then((res)=>{
if(res['success']){
this.provinceList = common.action(res['data']['provinces']);
}
})
},
confirmParams(){
for(let i=0;i<this.editParamLists.length;i++){
if(this.editParamLists[i].alias==='tnvestmentRate' && this.editParamLists[i].value>2000){
common.errorDialog(1,`${this.editParamLists[i].name}一般最高不超过2000`) ;
return false;
}
if(this.editParamLists[i].value>100){
common.errorDialog(1,`${this.editParamLists[i].name}最高不应超过100`) ;
return false;
}
}
const params = {
housePriceGrowthRate:(this.editParamLists.filter(item=>item.alias==='housePriceGrowthRate')[0].value / 100).toFixed(4),//房价增长率
houseDepreciationRate:(this.editParamLists.filter(item=>item.alias==='houseDepreciationRate')[0].value / 100).toFixed(4),//房屋折旧率
downPaymentMin:this.editParamLists.filter(item=>item.alias==='downPaymentMin')[0].value,//首付款最低成数(百分位)
tnvestmentRate:(this.editParamLists.filter(item=>item.alias==='tnvestmentRate')[0].value / 100).toFixed(4),//投资回报率
incomeRate:(this.editParamLists.filter(item=>item.alias==='incomeRate')[0].value / 100).toFixed(4),//收入增长率
acceptableLossRate:(this.editParamLists.filter(item=>item.alias==='acceptableLossRate')[0].value / 100).toFixed(4),//可接受本金损失率,
cityId:this.cityInfo.cityId,
provinceId:this.cityInfo.provinceId,
provinceName:this.cityInfo.provinceName,
cityName:this.cityInfo.cityName,
}
this.sendData(params)
},
// 获取房价增长率
queryCommercialHousingPrice(){
api.queryCommercialHousingPrice(this.cityInfo).then(res=>{
if(res['success']){
this.editParamLists.find(item=>item.alias==='housePriceGrowthRate')['value'] = res['data']['priceInfo']['rateB'];
}
})
}
},
mounted() {
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists));
if(!(JSON.stringify(this.planningParams) == '{}')){
const result = this.planningParams;
this.editParamLists.map(item=>{
if(result[item.alias] && result[item.value]){
item.value = result['downPaymentMin'].value;
// 首付成数不需要换算
if(item.alias !== 'downPaymentMin'){
if(result[item.alias].value){
item.value = result[item.alias].value * 100
}
}
}
})
}
this.provCityQry();
this.cityId = this.cityInfo.cityId;
this.queryCommercialHousingPrice()
}
}
</script>
<style lang="scss">
.paramsContainer{
background-color: #fff;
padding: 0 20rpx 44rpx;
h5{
position: relative;
color: #CEB07D;
font-size: 32rpx;
padding-left: 20rpx;
margin-bottom: 40rpx;
span{
font-size: 26rpx;
font-weight: normal;
}
&::before{
content:'';
position:absolute;
left: 0;
top: 50%;
width: 8rpx;
height: 20rpx;
transform: translateY(-50%);
background: linear-gradient(123deg, #CEB07D 0%, #FED495 100%, #D1B27E 100%);
border-radius: 8rpx;
opacity: 1;
}
}
.liBox{
padding: 16rpx 0;
border-bottom: 1px solid #E4E4E4;
view{
display: flex;
align-items: center;
.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{
height: 94rpx;
line-height: 94rpx;
position: relative;
margin-top: 40rpx;
view{
&.confirm{
padding: 0 50px;
box-shadow: 0px 2px 2px 1px rgb(0 0 0 / 35%);
background:linear-gradient(to bottom right,#CEB07D,#FED597);
}
text{
font-size: 36rpx;
font-weight: bold;
color: #6B4000;
letter-spacing: 2px;
}
&.reset{
position: absolute;
right: 0;
bottom: 0;
span{
color: #CEB07D;
background-image:linear-gradient(to bottom right,#CEB07D,#FED597);
background-clip:text;
color:transparent;
font-size:26rpx;
border-bottom: 1px solid #CEB07D;
}
}
}
}
.closeBtn{
position: absolute;
right: 20rpx;
top: 20rpx;
}
}
</style>
\ No newline at end of file
.batchCalculateContent{
display: flex;
flex-direction: column;
align-items: center;
}
.logo {
width: 100%;
}
.tabTitle{
display: flex;
justify-content: space-around;
font-size: 32rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
}
.tabTitle text{
position: relative;
}
.tabTitle text.actived::after{
position: absolute;
bottom: -4rpx;
left: 0;
content: '';
width: 100%;
height: 4rpx;
background: linear-gradient(125deg,#CEB07D,#FED597);
}
.simpleDataResult{
background: #FFFFFF;
box-shadow: 0rpx 0rpx 11rpx 0rpx rgba(0,0,0,0.1);
border-radius: 5rpx;
opacity: 1;
margin: 30rpx 15rpx 56rpx;
padding: 15rpx 17rpx;
scroll-behavior:smooth;
}
.simpleDataResult .resultTitle{
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;
}
.simpleDataResult .inputItem .title{
color: #CEB07D;
font-weight: bold;
}
.reduceInsuranceContent .tableTh,.reduceInsuranceContent .tableTd{
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.reduceInsuranceContent .tableTh text{
flex: 1;
}
.reduceInsuranceContent .tableTh text.withdrawNumber,.reduceInsuranceContent .tableTd text.withdrawNumber{
flex: 2;
}
.reduceInsuranceContent .tableTd .uni-input,.reduceInsuranceContent .tableTh text{
text-align: center;
border-bottom: 1px solid #E4E4E4;
padding: 6rpx 24rpx;
margin-right: 20rpx;
}
.reduceInsuranceContent .tableTh text{
border:none;
white-space: nowrap;
color: #333;
}
.reduceInsuranceContent .tableTd:last-child{
margin-bottom: 20rpx;
}
.resultContent{
margin-bottom: 60rpx;
padding-bottom: 60rpx;
}
.batchDataResult{
box-shadow: 0px 0px 11px 0px rgba(0,0,0,0.1);
margin-top: 32rpx;
}
.batchDataResult .resultTh{
height: 60rpx;
line-height: 60rpx;
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
color: #6B4000;
font-weight: bold;
display: flex;
}
.batchDataResult .resultTd{
display: flex;
height: 60rpx;
align-items: center;
border-bottom: 1px solid #E4E4E4;
}
.batchDataResult .resultTd:last-child{
border-bottom: none;
}
.batchDataResult .resultTh text,.batchDataResult .resultTd text{
flex: 1;
text-align: center;
font-weight: bold;
color: #333333;
}
.batchDataResult .resultTd text.resultNumber{
color: #CEB07D;
}
/* .cashValueContent{
margin-top: 80rpx;
} */
.cashValueContent .title button{
background-color: transparent;
font-size: 30rpx;
color: #333333;
box-sizing: border-box;
line-height: initial;
}
.cashValueContent .title button::after{
border: 2px solid #CEB07D;
border-radius: 12rpx;
}
.cashValueContent .title button:first-child{
margin-right: 40rpx;
}
.cashValueContent .title button.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
}
.reduceInsuranceContent text{
display: inline-block;
width: 40rpx!important;
height: 40rpx!important;
line-height: 40rpx!important;
text-align: center;
font-size: 24rpx;
}
.qrcodeContainer{
width: 100%;
height: 100vh;
overflow: hidden;
}
.qrcodeContainer img{
max-width: 100%;
}
.tips{
position: absolute;
bottom: -30rpx;
left: 28rpx;
width: 100%;
font-size: 24rpx;
text-align: left;
color: red;
}
.banner{
width: 100%;
position: relative;
}
.banner > text{
position: absolute;
bottom: 40px;
left: 0;
color: #fff;
background: rgba(0,0,0,0.35);
padding: 2px 10px;
border-top-right-radius: 20px;
border-bottom-right-radius: 20px;
}
.banner img{
width: 100%;
}
.formInfoContainer{
background: #fff;
margin-top: -32rpx;
position: relative;
z-index: 2;
border-top-right-radius: 30rpx;
border-top-left-radius: 30rpx;
padding: 30rpx;
box-sizing: border-box;
font-size: 30rpx;
color: #333333;
scroll-behavior:smooth;
}
.title{
display: flex;
justify-content: space-between;
align-items: center;
color: #CEB07D;
font-weight: bold;
font-size: 32rpx;
position: relative;
padding-left: 28rpx;
margin: 20rpx 0;
height: 50rpx;
}
.title::before{
content: '';
position: absolute;
left: 0;
top: 15rpx;
width: 6rpx;
height: 20rpx;
background-color: #CEB07D;
border-radius: 8rpx;
}
.radioButton{
position: relative;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 1px solid #CEB07D;
}
.radioButton.selected::after{
content: '';
position: absolute;
left: 0;
top: 0;
width: 20rpx;
height: 20rpx;
transform: translate(10rpx,10rpx);
border-radius: 50%;
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
}
.inputItem{
display: flex;
justify-content: space-between;
align-items: center;
height: 80rpx;
border-bottom: 1px solid #E4E4E4;
}
.inputItem .inputContent{
display: flex;
align-items: center;
justify-content: flex-end;
flex: 0 0 40%;
}
.inputContent .uni-input{
margin-right: 20rpx;
text-align: right;
}
.inputItem text{
flex: 0 0 60%;
}
.uni-input-placeholder{
color: #999999;
font-size: 24rpx;
}
.optionContent{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
padding-bottom: 30rpx;
z-index: 1;
}
.optionContent button{
flex: 0 0 46%;
border:2rpx solid #e7c793!important;
font-size: 36rpx;
}
.sfp_btn{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border: none;
color: #6B4000;
}
\ No newline at end of file
## 1.0.1(2021-11-23)
- 优化 label、label-width 属性
## 1.0.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-combox](https://uniapp.dcloud.io/component/uniui/uni-combox)
## 0.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 0.0.6(2021-05-12)
- 新增 组件示例地址
## 0.0.5(2021-04-21)
- 优化 添加依赖 uni-icons, 导入后自动下载依赖
## 0.0.4(2021-02-05)
- 优化 组件引用关系,通过uni_modules引用组件
## 0.0.3(2021-02-04)
- 调整为uni_modules目录规范
<template>
<view class="uni-combox" :class="border ? '' : 'uni-combox__no-border'">
<view v-if="label" class="uni-combox__label" :style="labelStyle">
<text>{{label}}</text>
</view>
<view class="uni-combox__input-box">
<input class="uni-combox__input" type="text" :placeholder="placeholder"
placeholder-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus"
@blur="onBlur" />
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector">
</uni-icons>
</view>
<view class="uni-combox__selector" v-if="showSelector">
<view class="uni-popper__arrow"></view>
<scroll-view scroll-y="true" class="uni-combox__selector-scroll">
<view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0">
<text>{{emptyTips}}</text>
</view>
<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index"
@click="onSelectorClick(index)">
<text>{{item}}</text>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
/**
* Combox 组合输入框
* @description 组合输入框一般用于既可以输入也可以选择的场景
* @tutorial https://ext.dcloud.net.cn/plugin?id=1261
* @property {String} label 左侧文字
* @property {String} labelWidth 左侧内容宽度
* @property {String} placeholder 输入框占位符
* @property {Array} candidates 候选项列表
* @property {String} emptyTips 筛选结果为空时显示的文字
* @property {String} value 组合框的值
*/
export default {
name: 'uniCombox',
emits: ['input', 'update:modelValue'],
props: {
border: {
type: Boolean,
default: true
},
label: {
type: String,
default: ''
},
labelWidth: {
type: String,
default: 'auto'
},
placeholder: {
type: String,
default: ''
},
candidates: {
type: Array,
default () {
return []
}
},
emptyTips: {
type: String,
default: '无匹配项'
},
// #ifndef VUE3
value: {
type: [String, Number],
default: ''
},
// #endif
// #ifdef VUE3
modelValue: {
type: [String, Number],
default: ''
},
// #endif
},
data() {
return {
showSelector: false,
inputVal: ''
}
},
computed: {
labelStyle() {
if (this.labelWidth === 'auto') {
return ""
}
return `width: ${this.labelWidth}`
},
filterCandidates() {
return this.candidates.filter((item) => {
return item.toString().indexOf(this.inputVal) > -1
})
},
filterCandidatesLength() {
return this.filterCandidates.length
}
},
watch: {
// #ifndef VUE3
value: {
handler(newVal) {
this.inputVal = newVal
},
immediate: true
},
// #endif
// #ifdef VUE3
modelValue: {
handler(newVal) {
this.inputVal = newVal
},
immediate: true
},
// #endif
},
methods: {
toggleSelector() {
this.showSelector = !this.showSelector
},
onFocus() {
this.showSelector = true
},
onBlur() {
setTimeout(() => {
this.showSelector = false
}, 153)
},
onSelectorClick(index) {
this.inputVal = this.filterCandidates[index]
this.showSelector = false
this.$emit('input', this.inputVal)
this.$emit('update:modelValue', this.inputVal)
},
onInput() {
setTimeout(() => {
this.$emit('input', this.inputVal)
this.$emit('update:modelValue', this.inputVal)
})
}
}
}
</script>
<style lang="scss" scoped>
.uni-combox {
font-size: 14px;
border: 1px solid #DCDFE6;
border-radius: 4px;
padding: 6px 10px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
// height: 40px;
flex-direction: row;
align-items: center;
// border-bottom: solid 1px #DDDDDD;
}
.uni-combox__label {
font-size: 16px;
line-height: 22px;
padding-right: 10px;
color: #999999;
}
.uni-combox__input-box {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
align-items: center;
}
.uni-combox__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-combox__input-plac {
font-size: 14px;
color: #999;
}
.uni-combox__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
top: calc(100% + 12px);
left: 0;
width: 100%;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 2;
padding: 4px 0;
}
.uni-combox__selector-scroll {
/* #ifndef APP-NVUE */
max-height: 200px;
box-sizing: border-box;
/* #endif */
}
.uni-combox__selector-empty,
.uni-combox__selector-item {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
line-height: 36px;
font-size: 14px;
text-align: center;
// border-bottom: solid 1px #DDDDDD;
padding: 0px 10px;
}
.uni-combox__selector-item:hover {
background-color: #f9f9f9;
}
.uni-combox__selector-empty:last-child,
.uni-combox__selector-item:last-child {
/* #ifndef APP-NVUE */
border-bottom: none;
/* #endif */
}
// picker 弹出层通用的指示小三角
.uni-popper__arrow,
.uni-popper__arrow::after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
}
.uni-popper__arrow {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
top: -6px;
left: 10%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
.uni-popper__arrow::after {
content: " ";
top: 1px;
margin-left: -6px;
border-top-width: 0;
border-bottom-color: #fff;
}
.uni-combox__no-border {
border: none;
}
</style>
{
"id": "uni-combox",
"displayName": "uni-combox 组合框",
"version": "1.0.1",
"description": "可以选择也可以输入的表单项 ",
"keywords": [
"uni-ui",
"uniui",
"combox",
"组合框",
"select"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
## Combox 组合框
> **组件名:uni-combox**
> 代码块: `uCombox`
组合框组件。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-combox)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
## 1.0.8(2022-09-16)
- 可以使用 uni-scss 控制主题色
## 1.0.7(2022-07-06)
- 优化 pc端图标位置不正确的问题
## 1.0.6(2022-07-05)
- 优化 显示样式
## 1.0.5(2022-07-04)
- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
## 1.0.4(2022-04-19)
- 修复 字节小程序 本地数据无法选择下一级的Bug
## 1.0.3(2022-02-25)
- 修复 nvue 不支持的 v-show 的 bug
## 1.0.2(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式
## 1.0.1(2021-11-23)
- 修复 由上个版本引发的map、v-model等属性不生效的bug
## 1.0.0(2021-11-19)
- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-picker](https://uniapp.dcloud.io/component/uniui/uni-data-picker)
## 0.4.9(2021-10-28)
- 修复 VUE2 v-model 概率无效的 bug
## 0.4.8(2021-10-27)
- 修复 v-model 概率无效的 bug
## 0.4.7(2021-10-25)
- 新增 属性 spaceInfo 服务空间配置 HBuilderX 3.2.11+
- 修复 树型 uniCloud 数据类型为 int 时报错的 bug
## 0.4.6(2021-10-19)
- 修复 非 VUE3 v-model 为 0 时无法选中的 bug
## 0.4.5(2021-09-26)
- 新增 清除已选项的功能(通过 clearIcon 属性配置是否显示按钮),同时提供 clear 方法以供调用,二者等效
- 修复 readonly 为 true 时报错的 bug
## 0.4.4(2021-09-26)
- 修复 上一版本造成的 map 属性失效的 bug
- 新增 ellipsis 属性,支持配置 tab 选项长度过长时是否自动省略
## 0.4.3(2021-09-24)
- 修复 某些情况下级联未触发的 bug
## 0.4.2(2021-09-23)
- 新增 提供 show 和 hide 方法,开发者可以通过 ref 调用
- 新增 选项内容过长自动添加省略号
## 0.4.1(2021-09-15)
- 新增 map 属性 字段映射,将 text/value 映射到数据中的其他字段
## 0.4.0(2021-07-13)
- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 0.3.5(2021-06-04)
- 修复 无法加载云端数据的问题
## 0.3.4(2021-05-28)
- 修复 v-model 无效问题
- 修复 loaddata 为空数据组时加载时间过长问题
- 修复 上个版本引出的本地数据无法选择带有 children 的 2 级节点
## 0.3.3(2021-05-12)
- 新增 组件示例地址
## 0.3.2(2021-04-22)
- 修复 非树形数据有 where 属性查询报错的问题
## 0.3.1(2021-04-15)
- 修复 本地数据概率无法回显时问题
## 0.3.0(2021-04-07)
- 新增 支持云端非树形表结构数据
- 修复 根节点 parent_field 字段等于 null 时选择界面错乱问题
## 0.2.0(2021-03-15)
- 修复 nodeclick、popupopened、popupclosed 事件无法触发的问题
## 0.1.9(2021-03-09)
- 修复 微信小程序某些情况下无法选择的问题
## 0.1.8(2021-02-05)
- 优化 部分样式在 nvue 上的兼容表现
## 0.1.7(2021-02-05)
- 调整为 uni_modules 目录规范
// #ifdef H5
export default {
name: 'Keypress',
props: {
disable: {
type: Boolean,
default: false
}
},
mounted () {
const keyNames = {
esc: ['Esc', 'Escape'],
tab: 'Tab',
enter: 'Enter',
space: [' ', 'Spacebar'],
up: ['Up', 'ArrowUp'],
left: ['Left', 'ArrowLeft'],
right: ['Right', 'ArrowRight'],
down: ['Down', 'ArrowDown'],
delete: ['Backspace', 'Delete', 'Del']
}
const listener = ($event) => {
if (this.disable) {
return
}
const keyName = Object.keys(keyNames).find(key => {
const keyName = $event.key
const value = keyNames[key]
return value === keyName || (Array.isArray(value) && value.includes(keyName))
})
if (keyName) {
// 避免和其他按键事件冲突
setTimeout(() => {
this.$emit(keyName, {})
}, 0)
}
}
document.addEventListener('keyup', listener)
this.$once('hook:beforeDestroy', () => {
document.removeEventListener('keyup', listener)
})
},
render: () => {}
}
// #endif
<template>
<view class="uni-data-pickerview">
<scroll-view class="selected-area" scroll-x="true" scroll-y="false" :show-scrollbar="false">
<view class="selected-list">
<template v-for="(item,index) in selected">
<view class="selected-item"
:class="{'selected-item-active':index==selectedIndex, 'selected-item-text-overflow': ellipsis}"
v-if="item.text" @click="handleSelect(index)">
<text class="">{{item.text}}</text>
</view>
</template>
</view>
</scroll-view>
<view class="tab-c">
<template v-for="(child, i) in dataList" >
<scroll-view class="list" :key="i" v-if="i==selectedIndex" :scroll-y="true">
<view class="item" :class="{'is-disabled': !!item.disable}" v-for="(item, j) in child"
@click="handleNodeClick(item, i, j)">
<text class="item-text item-text-overflow">{{item[map.text]}}</text>
<view class="check" v-if="selected.length > i && item[map.value] == selected[i].value"></view>
</view>
</scroll-view>
</template>
<view class="loading-cover" v-if="loading">
<uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more>
</view>
<view class="error-message" v-if="errorMessage">
<text class="error-text">{{errorMessage}}</text>
</view>
</view>
</view>
</template>
<script>
import dataPicker from "./uni-data-picker.js"
/**
* DataPickerview
* @description uni-data-pickerview
* @tutorial https://ext.dcloud.net.cn/plugin?id=3796
* @property {Array} localdata 本地数据,参考
* @property {Boolean} step-searh = [true|false] 是否分布查询
* @value true 启用分布查询,仅查询当前选中节点
* @value false 关闭分布查询,一次查询出所有数据
* @property {String|DBFieldString} self-field 分布查询当前字段名称
* @property {String|DBFieldString} parent-field 分布查询父字段名称
* @property {String|DBCollectionString} collection 表名
* @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
* @property {String} orderby 排序字段及正序倒叙设置
* @property {String|JQLString} where 查询条件
*/
export default {
name: 'UniDataPickerView',
emits: ['nodeclick', 'change', 'datachange', 'update:modelValue'],
mixins: [dataPicker],
props: {
managedMode: {
type: Boolean,
default: false
},
ellipsis: {
type: Boolean,
default: true
}
},
data() {
return {}
},
created() {
if (this.managedMode) {
return
}
this.$nextTick(() => {
this.load()
})
},
methods: {
onPropsChange() {
this._treeData = []
this.selectedIndex = 0
this.load()
},
load() {
if (this.isLocaldata) {
this.loadData()
} else if (this.dataValue.length) {
this.getTreePath((res) => {
this.loadData()
})
}
},
handleSelect(index) {
this.selectedIndex = index
},
handleNodeClick(item, i, j) {
if (item.disable) {
return
}
const node = this.dataList[i][j]
const text = node[this.map.text]
const value = node[this.map.value]
if (i < this.selected.length - 1) {
this.selected.splice(i, this.selected.length - i)
this.selected.push({
text,
value
})
} else if (i === this.selected.length - 1) {
this.selected.splice(i, 1, {
text,
value
})
}
if (node.isleaf) {
this.onSelectedChange(node, node.isleaf)
return
}
const {
isleaf,
hasNodes
} = this._updateBindData()
if (!this._isTreeView() && !hasNodes) {
this.onSelectedChange(node, true)
return
}
if (this.isLocaldata && (!hasNodes || isleaf)) {
this.onSelectedChange(node, true)
return
}
if (!isleaf && !hasNodes) {
this._loadNodeData((data) => {
if (!data.length) {
node.isleaf = true
} else {
this._treeData.push(...data)
this._updateBindData(node)
}
this.onSelectedChange(node, node.isleaf)
}, this._nodeWhere())
return
}
this.onSelectedChange(node, false)
},
updateData(data) {
this._treeData = data.treeData
this.selected = data.selected
if (!this._treeData.length) {
this.loadData()
} else {
//this.selected = data.selected
this._updateBindData()
}
},
onDataChange() {
this.$emit('datachange')
},
onSelectedChange(node, isleaf) {
if (isleaf) {
this._dispatchEvent()
}
if (node) {
this.$emit('nodeclick', node)
}
},
_dispatchEvent() {
this.$emit('change', this.selected.slice(0))
}
}
}
</script>
<style lang="scss">
$uni-primary: #007aff !default;
.uni-data-pickerview {
flex: 1;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
overflow: hidden;
height: 100%;
}
.error-text {
color: #DD524D;
}
.loading-cover {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(255, 255, 255, .5);
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
align-items: center;
z-index: 1001;
}
.load-more {
/* #ifndef APP-NVUE */
margin: auto;
/* #endif */
}
.error-message {
background-color: #fff;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
padding: 15px;
opacity: .9;
z-index: 102;
}
/* #ifdef APP-NVUE */
.selected-area {
width: 750rpx;
}
/* #endif */
.selected-list {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex-wrap: nowrap;
padding: 0 5px;
border-bottom: 1px solid #f8f8f8;
}
.selected-item {
margin-left: 10px;
margin-right: 10px;
padding: 12px 0;
text-align: center;
/* #ifndef APP-NVUE */
white-space: nowrap;
/* #endif */
}
.selected-item-text-overflow {
width: 168px;
/* fix nvue */
overflow: hidden;
/* #ifndef APP-NVUE */
width: 6em;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
/* #endif */
}
.selected-item-active {
border-bottom: 2px solid $uni-primary;
}
.selected-item-text {
color: $uni-primary;
}
.tab-c {
position: relative;
flex: 1;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
overflow: hidden;
}
.list {
flex: 1;
}
.item {
padding: 12px 15px;
/* border-bottom: 1px solid #f0f0f0; */
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: space-between;
}
.is-disabled {
opacity: .5;
}
.item-text {
/* flex: 1; */
color: #333333;
}
.item-text-overflow {
width: 280px;
/* fix nvue */
overflow: hidden;
/* #ifndef APP-NVUE */
width: 20em;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
/* #endif */
}
.check {
margin-right: 5px;
border: 2px solid $uni-primary;
border-left: 0;
border-top: 0;
height: 12px;
width: 6px;
transform-origin: center;
/* #ifndef APP-NVUE */
transition: all 0.3s;
/* #endif */
transform: rotate(45deg);
}
</style>
{
"id": "uni-data-picker",
"displayName": "uni-data-picker 数据驱动的picker选择器",
"version": "1.0.8",
"description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
"keywords": [
"uni-ui",
"uniui",
"picker",
"级联",
"省市区",
""
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-load-more",
"uni-icons",
"uni-scss"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
## DataPicker 级联选择
> **组件名:uni-data-picker**
> 代码块: `uDataPicker`
> 关联组件:`uni-data-pickerview`、`uni-load-more`。
`<uni-data-picker>` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)
支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。
`<uni-data-picker>` 组件尤其适用于地址选择、分类选择等选择类。
`<uni-data-picker>` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。
`<uni-data-picker>` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。
在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
## 1.3.3(2022-01-20)
- 新增 showText属性 ,是否显示文本
## 1.3.2(2022-01-19)
- 修复 nvue 平台下不显示文本的bug
## 1.3.1(2022-01-19)
- 修复 微信小程序平台样式选择器报警告的问题
## 1.3.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more)
## 1.2.1(2021-08-24)
- 新增 支持国际化
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.8(2021-05-12)
- 新增 组件示例地址
## 1.1.7(2021-03-30)
- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
## 1.1.6(2021-02-05)
- 调整为uni_modules目录规范
{
"uni-load-more.contentdown": "Pull up to show more",
"uni-load-more.contentrefresh": "loading...",
"uni-load-more.contentnomore": "No more data"
}
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
{
"uni-load-more.contentdown": "上拉显示更多",
"uni-load-more.contentrefresh": "正在加载...",
"uni-load-more.contentnomore": "没有更多数据了"
}
{
"uni-load-more.contentdown": "上拉顯示更多",
"uni-load-more.contentrefresh": "正在加載...",
"uni-load-more.contentnomore": "沒有更多數據了"
}
{
"id": "uni-load-more",
"displayName": "uni-load-more 加载更多",
"version": "1.3.3",
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
"keywords": [
"uni-ui",
"uniui",
"加载更多",
"load-more"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
### LoadMore 加载更多
> **组件名:uni-load-more**
> 代码块: `uLoadMore`
用于列表中,做滚动加载使用,展示 loading 的各种状态。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
const eduGradeLists=[
{
text: "幼儿园",
value: "1",
commonYears:3,
minAge:3,
maxAge:5,
publicTuition:9016,
privateTuition:11475,
children: [
{text: "1年级",value: "1-1",tuition:9016},
{text: "2年级",value: "1-2",tuition:null},
{text: "3年级",value: "1-3",tuition:null}
]
},
{
text: "小学",
value: "2",
commonYears:6,
minAge:6,
maxAge:12,
publicTuition:4034,
privateTuition:5738,
children: [
{text: "1年级",value: "2-1",tuition:4034},
{text: "2年级",value: "2-2",tuition:null},
{text: "3年级",value: "2-3",tuition:null},
{text: "4年级",value: "2-4",tuition:null},
{text: "5年级",value: "2-5",tuition:null},
{text: "6年级",value: "2-6",tuition:null},
]
},
{
text: "初中",
value: "3",
commonYears:3,
minAge:13,
maxAge:18,
publicTuition:6095,
privateTuition:10444,
children: [
{text: "1年级",value: "3-1",tuition:6095},
{text: "2年级",value: "3-2",tuition:null},
{text: "3年级",value: "3-3",tuition:null},
]
},
{
text: "高中",
value: "4",
commonYears:3,
minAge:19,
maxAge:22,
publicTuition:7976,
privateTuition:15952,
children: [
{text: "1年级",value: "4-1",tuition:7976},
{text: "2年级",value: "4-2",tuition:null},
{text: "3年级",value: "4-3",tuition:null},
]
},
{
text: "大学",
value: "5",
commonYears:4,
minAge:23,
maxAge:27,
publicTuition:11960,
privateTuition:17940,
children: [
{text: "1年级",value: "5-1",tuition:11960},
{text: "2年级",value: "5-2",tuition:null},
{text: "3年级",value: "5-3",tuition:null},
{text: "4年级",value: "5-4",tuition:null},
]
},
{
text: "硕士",
value: "6",
commonYears:2,
minAge:28,
maxAge:30,
publicTuition:11960,
privateTuition:17940,
children: [
{text: "1年级",value: "6-1",tuition:11960},
{text: "2年级",value: "6-2",tuition:null}
]
},
{
text: "博士",
value: "7",
commonYears:3,
minAge:31,
maxAge:34,
publicTuition:11960,
privateTuition:17940,
children: [
{text: "1年级",value: "7-1",tuition:11960},
{text: "2年级",value: "7-2",tuition:null},
{text: "3年级",value: "7-3",tuition:null}
]
}
]
export {eduGradeLists};
\ No newline at end of file
...@@ -38,7 +38,7 @@ export default function initApp(){ ...@@ -38,7 +38,7 @@ export default function initApp(){
} }
function hasPermission (url) { function hasPermission (url) {
let islogin = uni.getStorageSync("isLogin");//在这可以使用token、vuex let islogin = uni.getStorageSync("isLogin");//在这可以使用token、vuex
islogin = Boolean(Number(islogin));//返回布尔值 // islogin = Boolean(Number(islogin));//返回布尔值
// 在白名单中或有登录判断条件可以直接跳转 // 在白名单中或有登录判断条件可以直接跳转
if(whiteList.indexOf(url.slice(0,url.indexOf('?'))) !== -1 || islogin) { if(whiteList.indexOf(url.slice(0,url.indexOf('?'))) !== -1 || islogin) {
return true return true
......
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