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

金额输入框修改

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