Commit 78356bd1 authored by 刘用法's avatar 刘用法

金额输入框修改

parent 7b7b882f
......@@ -2,7 +2,7 @@
<template>
<view :style="{'width': fieldsWidth}">
<u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC"/>
:custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength"/>
</view>
</template>
......@@ -23,18 +23,26 @@
// }
},
data() {
return {}
return {
maxlength: 140,
}
},
computed: {
type() {
let ty = this.item.fieldsType.toLocaleLowerCase()
if (this.item && ty == 'password') {
return this.item.fieldsType
}else if (this.item && ty == 'text') {
return 'textarea'
}else {
return 'text'
if (this.item.fieldsId == 200) {
this.maxlength = 9
return 'digit'
} else {
if (this.item && ty == 'password') {
return this.item.fieldsType
}else if (this.item && ty == 'text') {
return 'textarea'
} else {
return 'text'
}
}
},
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
......
......@@ -211,7 +211,6 @@
}
},
orderDistance() {
console.log('orderData.contactAddressLatitud:',this.orderData.contactAddressLatitud,'orderData.contactAddressLongitud',this.orderData.contactAddressLongitud, 'location:',this.location[0], this.location[1])
return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1])
}
},
......@@ -291,7 +290,6 @@
* @return float 浮点数
*/
distance(lat1, lng1, lat2, lng2) {
console.log(lat1, lng1, lat2, lng2)
var radLat1 = this.Rad(lat1);
var radLat2 = this.Rad(lat2);
var a = radLat1 - radLat2;
......@@ -300,7 +298,6 @@
Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
s = s *6378.137 ;// EARTH_RADIUS;
s = Math.round(s * 10000)/10000 //输出为米
console.log("计算结果",s,'M');
return Number(s?s.toFixed(2):0);
},
Rad(d){
......
......@@ -22,9 +22,9 @@
<view class="class-item" :key="groupIndex" v-show="current == groupIndex">
<view class="title" v-if="groupItem.name !== '基本信息'">{{groupItem.name}}</view>
<view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex"
label-position="top" :prop="item.fieldsName" :border-bottom="false">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="typeToComponentType(item.fieldsType)!=='location'">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" v-if="typeToComponentType(item.fieldsType)!=='location'"
label-position="top" :prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}}
</view>
......@@ -124,6 +124,7 @@
inGuaranteePeriod:'',
list: [],
tabIndex: 0,
show200: true, // 基础信息显示金额输入框
scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0,
current: 0, // 预设当前项的值
......@@ -385,6 +386,7 @@
if (groupItem.items) {
innerItem = groupItem.items[data.itemIndex]
}
if(innerItem.fieldsType ==='multiInput'){
// 多个输入框的值触发
let key = Object.keys(data.value)[0]
......@@ -392,6 +394,7 @@
}else{
this.$set(this.form,innerItem.fieldsName,data.value)
}
this.show200 = innerItem.fieldsId != 199 || data.value != '03'
console.log(this.form)
},
nextStep() {
......
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