Commit 0b77380e authored by 肖健's avatar 肖健

新增省市区;更改bug;挪车码领取页面初版

parent a4665bad
{
"id": "active-form",
"name": "表单 动态表单 uniapp最强动态表单 表单校验 快速生成表单 全端支持",
"name": "京东挪车牌",
"version": "1.1.0",
"description": "最强动态表单 以js的方式快速生成表单接口 支持表单校验 ui设计师样式优化",
"description": "京东挪车牌",
"keywords": [
"表单",
"动态表单",
"表单校验",
"快速生成表单",
"全端"
"挪车牌"
],
"dependencies": {
"crypto-js": "^4.1.1",
......
......@@ -57,6 +57,13 @@
{
"path": "pages/login/wv-common/wv-common",
"style": {}
},
{
"path": "pages/mrAct/index",
"style": {
"navigationBarTitleText": "京东挪车码领取",
"enablePullDownRefresh": false
}
}
],
"subPackages": [
......
......@@ -363,7 +363,7 @@
if(jdNavToObj){
uni.removeStorageSync('jdNavToObj')
this.$goToLocation(item)
this.$goToLocation(jdNavToObj)
}
}
......
This diff is collapsed.
## 1.0.3(2022-12-18)
三级联动地区选择器,根据uView的picker选择器二次封装,所以使用时记得安装uVIew和scss
## 1.0.2(2022-12-18)
三级联动地区选择器,根据uView的picker选择器二次封装,所以使用时记得安装uVIew和scss
## 1.0.1(2022-12-18)
基于uView封装的地区选择器,内置了地区数据,只在vue2的微信小程序做了测试,所以其余平台全部是X
## 1.0.0(2022-12-18)
基于uView封装的地区选择器,内置了地区数据,只在vue2的微信小程序做了测试,所以其余平台全部是X
<template>
<view class="">
<u-picker :show="show" ref="uPicker" :title="title" :showToolbar="showToolbar" :itemHeight="itemHeight"
:cancelText="cancelText" :cancelColor="cancelColor" :confirmText="confirmText" :confirmColor="confirmColor"
:loading="loading" :visibleItemCount="visibleItemCount" :defaultIndex="indexs" :columns="columns"
:closeOnClickOverlay="closeOnClickOverlay" @confirm="confirm" @close="close" @cancel="cancel"
@change="changeHandler">
</u-picker>
</view>
</template>
<script>
import area from "../../province-city-county.json"
export default {
props: {
show: {
type: Boolean,
default: () => false
},
title: {
type: String,
default: () => ""
},
showToolbar: {
type: Boolean,
default: () => true
},
itemHeight: {
type: [String, Number],
default: () => 44
},
cancelText: {
type: String,
default: () => "取消"
},
cancelColor: {
type: String,
default: () => "#909193"
},
confirmText: {
type: String,
default: () => "确认"
},
confirmColor: {
type: String,
default: () => "#3c9cff"
},
visibleItemCount: {
type: [String, Number],
default: () => 5
},
loading: {
type: Boolean,
default: () => false
},
indexs: Array,
closeOnClickOverlay: Boolean,
addressData:{
type:Object,
default:()=>{}
}
},
data(){
return {
columns: [],
province: [],
city: [],
area: [],
}
},
mounted(){
this.formatData()
},
methods: {
changeHandler(e) {
const {
columnIndex,
value,
values, // values为当前变化列的数组内容
indexs,
picker = this.$refs.uPicker
} = e
if (columnIndex === 0) {
picker.setColumnValues(1, this.city[indexs[0]].map(v => v.name))
picker.setColumnValues(2, this.area[indexs[0]][0].map(v => v.name))
}
if (columnIndex === 1) {
picker.setColumnValues(2, this.area[indexs[0]][indexs[1]].map(v => v.name))
}
},
formatData() {
this.province = area.map(t => {
return {
name: t.name,
areaId: t.areaId
}
})
this.city = area.map(t => t.children.map(v => {
return {
name: v.name,
areaId: v.areaId
}
}))
this.area = area.map(t => t.children.map(v => v.children.map(i => {
return {
name: i.name,
areaId: i.areaId
}
})))
//默认显示数据
this.columns = [
this.province.map(res => res.name),
this.city[0].map(res => res.name),
this.area[0][0].map(res => res.name)
]
//数据回显
if (this.addressData?.province && this.addressData?.city && this.addressData?.area) {
//省索引
let pIdx = this.province.findIndex(v => v.name == this.addressData.province);
//根据省索引设置默认市数据
this.columns[1] = this.city[pIdx].map(res => res.name)
//市索引
let cIdx = this.city[pIdx].findIndex(v => v.name == this.addressData.city);
//根据市索引设置默认区数据
this.columns[2] = this.area[pIdx][cIdx].map(res => res.name)
//区索引
let aIdx = this.area[pIdx][cIdx].findIndex(v => v.name == this.addressData.area);
this.indexs = [pIdx, cIdx, aIdx];
}
},
confirm(e) {
this.$emit("confirm", e)
},
close() {
this.$emit("close")
},
open() {
this.$emit("open")
this.formatData()
},
cancel(){
this.$emit("cancel")
}
}
}
</script>
<style>
</style>
{
"id": "address-picker",
"displayName": "三级联动地区选择器,address-picker,包含港澳台",
"version": "1.0.3",
"description": "三级联动地区选择器,根据uView的picker选择器二次封装,所以使用时记得安装uVIew和scss",
"keywords": [
"address-picker",
"address",
"picker",
"地区",
"地区选择器"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "n"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "y",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
# address-picker
\ No newline at end of file
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