Commit bc1d797e by 李伟康

fix 修复BUG&增加area-data依赖

1 parent be348b21
......@@ -2,6 +2,11 @@
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@vant/area-data": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@vant/area-data/-/area-data-1.5.1.tgz",
"integrity": "sha512-gR5TPEzTbxN1cTK1aDhCoyikSCLX7DAacxyXoKyI4SAsYYTZrDl/nLgQFIm9vLsvWzlPIda8xV8/U3x7M9k6ww=="
},
"@vant/weapp": {
"version": "1.10.24",
"resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.24.tgz",
......
{
"dependencies": {
"@vant/area-data": "^1.5.1",
"@vant/weapp": "^1.10.24",
"glsx-applet-component": "^1.1.25",
"glsx-common-sdk": "^0.2.8",
"number-precision": "^1.6.0",
"rfdc": "^1.3.0",
"glsx-common-sdk": "^0.2.8"
"rfdc": "^1.3.0"
}
}
// packageEquity/pages/carEquity/components/GLForm/GLForm.js
import { areaList } from '@vant/area-data';
Component({
externalClasses: ['custom-class'],
options: {
......@@ -50,7 +51,8 @@ Component({
* 组件的初始数据
*/
data: {
targetIdx: -1
targetIdx: -1,
areaList// 省市区数据
},
lifetimes: {
......@@ -200,8 +202,14 @@ Component({
break
}
},
showAreaFun(){
this.setData({
showArea:!this.data.showArea
})
},
bindRegionChange(e) {
this.triggerEvent('RegionChange', e)
this.showAreaFun()
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
"usingComponents": {
"van-area": "@vant/weapp/area/index",
"van-popup": "@vant/weapp/popup/index"
}
}
......@@ -61,9 +61,25 @@
</view>
</picker>
<!-- 省市区 -->
<picker
<block wx:if="{{item.type == 'region'}}">
<view class="picker" bindtap="showAreaFun">
<image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.labelName]}}">
{{formData[item.labelName]}}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
<van-popup
show="{{ showArea }}"
position="bottom"
bind:close="showAreaFun"
>
<van-area area-list="{{ areaList }}" columns-num="{{ item.columnsNum }}" title="{{item.label}}" bind:confirm="bindRegionChange" bind:cancel="showAreaFun" />
</van-popup>
</block>
<!-- <picker
mode="region"
wx:if="{{item.type == 'region'}}"
bindchange="bindRegionChange"
data-target="{{item}}"
value="{{index}}"
......@@ -76,7 +92,7 @@
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
</picker>
</picker> -->
<!-- 时间选择器 -->
<picker
wx:if="{{item.type == 'pickerTime'}}"
......
......@@ -248,10 +248,11 @@ Component({
bindRegionChange(e) {
const thisPage = wx.$router.getPageInstance(),
{
value
values
} = e.detail.detail
let city = Array.from(new Set([...values.map(e => e.name)]))
thisPage.setData({
['owner.city']: value.join('-')
['owner.city']: city.join('-')
})
},
// 品牌车型
......
......@@ -30,9 +30,9 @@
</view>
<gl-form disable="{{disable}}" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{first.customerFormList}}" bindRegionChange="bindRegionChange">
<view class="gender-box" slot="ownerGender">
<view class="block text-center {{ serviceInfo.ownerGender==1?'':'right' }}" />
<view class="male text-center {{ serviceInfo.ownerGender == 1?'active':'' }}" bindtap="changeGender" data-gender="1">男</view>
<view class="woman text-center {{ serviceInfo.ownerGender == 2?'active':'' }}" bindtap="changeGender" data-gender="2">女</view>
<view class="block text-center {{ serviceInfo.ownerGender=='男'?'':'right' }}" />
<view class="male text-center {{ serviceInfo.ownerGender == '男'?'active':'' }}" bindtap="changeGender" data-gender="男">男</view>
<view class="woman text-center {{ serviceInfo.ownerGender == '女'?'active':'' }}" bindtap="changeGender" data-gender="女">女</view>
</view>
</gl-form>
</view>
......
......@@ -152,10 +152,7 @@ const firstObj = {
name: 'city',
labelName: 'city',
type: 'region',
level:'city',
optionList: constantList.ageList,
optionId: 'optionId',
optionLabel: 'optionLabel',
columnsNum:'2',
placeholder: '点击选择(非必填)',
configItem: true
},
......@@ -172,7 +169,8 @@ const firstObj = {
type: 'input',
maxlength: '200',
fieldType: 'textarea',
configItem: true
configItem: true,
noCellHeight: true,
},
{
label: '陪伴人员',
......@@ -180,7 +178,8 @@ const firstObj = {
type: 'input',
maxlength: '200',
fieldType: 'textarea',
configItem: true
configItem: true,
noCellHeight: true,
},
],
carFormList: [
......@@ -271,10 +270,7 @@ const firstObjSimple = {
name: 'city',
labelName: 'city',
type: 'region',
level:'city',
optionList: constantList.ageList,
optionId: 'optionId',
optionLabel: 'optionLabel',
columnsNum:'2',
placeholder: '点击选择(非必填)',
configItem: true
},
......@@ -291,7 +287,8 @@ const firstObjSimple = {
type: 'input',
maxlength: '200',
fieldType: 'textarea',
configItem: true
configItem: true,
noCellHeight: true,
},
{
label: '陪伴人员',
......@@ -299,7 +296,8 @@ const firstObjSimple = {
type: 'input',
maxlength: '200',
fieldType: 'textarea',
configItem: true
configItem: true,
noCellHeight: true,
},
],
carFormList: [
......
......@@ -29,7 +29,7 @@ Page({
price: '',
confirmStatus: false,
saveStatus: false,
ownerGender: 1,
ownerGender: '男',
city: '',
ageRange: '',
hobby: '',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!