Commit 1f327ef8ca343919702e405e362b705aeef1ddcb
1 parent
f2ee213c
更新商城的演示地址
Showing
463 changed files
with
2 additions
and
46314 deletions
Too many changes.
To preserve performance only 100 of 463 files are displayed.
README.md
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 62 | | [yudao-ui-admin](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/yudao-ui-admin) | [](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/yudao-ui-admin) [](https://github.com/YunaiV/ruoyi-vue-pro/tree/master/yudao-ui-admin) | 基于 Vue2 + element-ui 实现的管理后台 | |
| 63 | 63 | | [yudao-ui-admin-uniapp](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/yudao-ui-admin-uniapp) | [](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/yudao-ui-admin-uniapp) [](https://github.com/YunaiV/ruoyi-vue-pro/tree/master/yudao-ui-admin-uniapp) | 基于 uni-app + uni-ui 实现的管理后台的小程序 | |
| 64 | 64 | | [yudao-ui-go-view](https://gitee.com/yudaocode/yudao-ui-go-view) | [](https://gitee.com/yudaocode/yudao-ui-go-view) [](https://github.com/yudaocode/yudao-ui-go-view) | 基于 Vue3 + naive-ui 实现的大屏报表 | |
| 65 | -| [yudao-ui-app](https://gitee.com/yudaocode/yudao-mall-uniapp) | [](https://gitee.com/yudaocode/yudao-mall-uniapp) [](https://github.com/yudaocode/yudao-mall-uniapp) | 基于 uni-app 实现的商城小程序 | | |
| 65 | +| [yudao-mall-uniapp](https://gitee.com/yudaocode/yudao-mall-uniapp) | [](https://gitee.com/yudaocode/yudao-mall-uniapp) [](https://github.com/yudaocode/yudao-mall-uniapp) | 基于 uni-app 实现的商城小程序 | | |
| 66 | 66 | |
| 67 | 67 | ## 🐰 分支说明 |
| 68 | 68 | ... | ... |
yudao-ui-app/.editorconfig deleted
| 1 | -# 告诉EditorConfig插件,这是根文件,不用继续往上查找 | |
| 2 | -root = true | |
| 3 | - | |
| 4 | -# 匹配全部文件 | |
| 5 | -[*] | |
| 6 | -# 设置字符集 | |
| 7 | -charset = utf-8 | |
| 8 | -# 缩进风格,可选space、tab | |
| 9 | -indent_style = space | |
| 10 | -# 缩进的空格数 | |
| 11 | -indent_size = 2 | |
| 12 | -# 结尾换行符,可选lf、cr、crlf | |
| 13 | -end_of_line = lf | |
| 14 | -# 在文件结尾插入新行 | |
| 15 | -insert_final_newline = true | |
| 16 | -# 删除一行中的前后空格 | |
| 17 | -trim_trailing_whitespace = true | |
| 18 | - | |
| 19 | -# 匹配md结尾的文件 | |
| 20 | -[*.md] | |
| 21 | -insert_final_newline = false | |
| 22 | -trim_trailing_whitespace = false |
yudao-ui-app/.gitignore deleted
yudao-ui-app/App.vue deleted
| 1 | -<script> | |
| 2 | -export default { | |
| 3 | - onLaunch: function () { | |
| 4 | - console.log('App Launch') | |
| 5 | - // #ifdef H5 | |
| 6 | - //在页面加载时读取sessionStorage里的状态信息 | |
| 7 | - if (sessionStorage.getItem('store')) { | |
| 8 | - this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('store')))) | |
| 9 | - } | |
| 10 | - //在页面刷新时将vuex里的信息保存到sessionStorage里 | |
| 11 | - window.addEventListener('beforeunload', () => { | |
| 12 | - sessionStorage.setItem('store', JSON.stringify(this.$store.state)) | |
| 13 | - }) | |
| 14 | - // #endif | |
| 15 | - }, | |
| 16 | - onShow: function () { | |
| 17 | - console.log('App Show') | |
| 18 | - }, | |
| 19 | - onHide: function () { | |
| 20 | - console.log('App Hide') | |
| 21 | - } | |
| 22 | -} | |
| 23 | -</script> | |
| 24 | - | |
| 25 | -<style lang="scss"> | |
| 26 | -/** 引入全局基本样式 */ | |
| 27 | -@import 'styles/base.scss'; | |
| 28 | - | |
| 29 | -/* 引入 uView 基础样式 */ | |
| 30 | -@import '@/uni_modules/uview-ui/index.scss'; | |
| 31 | - | |
| 32 | -/*每个页面公共scss */ | |
| 33 | -@import 'app.scss'; | |
| 34 | -</style> |
yudao-ui-app/README.md
0 → 100644
| 1 | +迁移至 <https://github.com/yudaocode/yudao-mall-uniapp> 仓库 | ... | ... |
yudao-ui-app/api/address.js deleted
| 1 | -//请求工具参考https://ext.dcloud.net.cn/plugin?id=392 | |
| 2 | -const { http } = uni.$u | |
| 3 | - | |
| 4 | -//获得用户收件地址列表 | |
| 5 | -export const getAddressList = params => http.get('/member/address/list', params) | |
| 6 | -//创建用户收件地址 | |
| 7 | -export const createAddress = data => http.post('/member/address/create', data) | |
| 8 | -//通过ID获得用户收件地址 | |
| 9 | -export const getAddressById = params => http.get('/member/address/get', { params }) | |
| 10 | -//获得默认的用户收件地址 | |
| 11 | -export const getDefaultUserAddress = params => http.get('/member/address/get-default', { params }) | |
| 12 | -//更新用户收件地址 | |
| 13 | -export const updateAddress = params => http.put('/member/address/update', params) | |
| 14 | -//删除用户收件地址 | |
| 15 | -export const deleteAddress = params => http.delete('/member/address/delete', {}, { params }) |
yudao-ui-app/api/auth.js deleted
| 1 | -//请求工具参考https://ext.dcloud.net.cn/plugin?id=392 | |
| 2 | -const { http } = uni.$u | |
| 3 | - | |
| 4 | -//使用手机 + 密码登录 | |
| 5 | -export const passwordLogin = data => http.post('/member/auth/login', data) | |
| 6 | -//发送手机验证码 | |
| 7 | -export const sendSmsCode = data => http.post('/member/auth/send-sms-code', data) | |
| 8 | -//使用手机 + 验证码登录 | |
| 9 | -export const smsLogin = data => http.post('/member/auth/sms-login', data) | |
| 10 | -//微信小程序的一键登录 | |
| 11 | -export const weixinMiniAppLogin = data => http.post('/member/auth/weixin-mini-app-login', data) | |
| 12 | -//刷新令牌 | |
| 13 | -export const refreshToken = data => http.post('/member/auth/refresh-token', {data}) | |
| 14 | -//退出登录 | |
| 15 | -export const logout = data => http.post('/member/auth/logout', data) |
yudao-ui-app/api/cart.js deleted
yudao-ui-app/api/category.js deleted
yudao-ui-app/api/index.js deleted
yudao-ui-app/api/order.js deleted
yudao-ui-app/api/product.js deleted
yudao-ui-app/api/user.js deleted
| 1 | -//请求工具参考https://ext.dcloud.net.cn/plugin?id=392 | |
| 2 | -const { http } = uni.$u | |
| 3 | - | |
| 4 | -//获取用户信息 | |
| 5 | -export const getUserInfo = params => http.get('/member/user/get', params) | |
| 6 | -//修改用户头像 | |
| 7 | -export const updateAvatar = filePath => | |
| 8 | - http.upload('/member/user/update-avatar', { | |
| 9 | - name: 'avatarFile', | |
| 10 | - fileType: 'image', | |
| 11 | - filePath: filePath | |
| 12 | - }) | |
| 13 | -//修改用户昵称 | |
| 14 | -export const updateNickname = params => http.put('/member/user/update-nickname', {}, { params }) |
yudao-ui-app/app.scss deleted
yudao-ui-app/common/config.js deleted
yudao-ui-app/common/mixin.js deleted
yudao-ui-app/common/orderStatus.js deleted
yudao-ui-app/common/props.js deleted
yudao-ui-app/components/w-picker/areadata/areadata.js deleted
| 1 | -const cityData=[{value:'110000',label:'北京市',children:[{value:"110100",label:"北京市",children:[{value:"110101",label:"东城区"},{value:"110102",label:"西城区"},{value:"110105",label:"朝阳区"},{value:"110106",label:"丰台区"},{value:"110107",label:"石景山区"},{value:"110108",label:"海淀区"},{value:"110109",label:"门头沟区"},{value:"110111",label:"房山区"},{value:"110112",label:"通州区"},{value:"110113",label:"顺义区"},{value:"110114",label:"昌平区"},{value:"110115",label:"大兴区"},{value:"110116",label:"怀柔区"},{value:"110117",label:"平谷区"},{value:"110118",label:"密云区"},{value:"110119",label:"延庆区"}]}]},{value:'120000',label:'天津市',children:[{value:"120100",label:"天津市",children:[{value:"120101",label:"和平区"},{value:"120102",label:"河东区"},{value:"120103",label:"河西区"},{value:"120104",label:"南开区"},{value:"120105",label:"河北区"},{value:"120106",label:"红桥区"},{value:"120110",label:"东丽区"},{value:"120111",label:"西青区"},{value:"120112",label:"津南区"},{value:"120113",label:"北辰区"},{value:"120114",label:"武清区"},{value:"120115",label:"宝坻区"},{value:"120116",label:"滨海新区"},{value:"120117",label:"宁河区"},{value:"120118",label:"静海区"},{value:"120119",label:"蓟州区"}]}]},{value:'130000',label:'河北省',children:[{value:"130100",label:"石家庄市",children:[{value:"130102",label:"长安区"},{value:"130104",label:"桥西区"},{value:"130105",label:"新华区"},{value:"130107",label:"井陉矿区"},{value:"130108",label:"裕华区"},{value:"130109",label:"藁城区"},{value:"130110",label:"鹿泉区"},{value:"130111",label:"栾城区"},{value:"130121",label:"井陉县"},{value:"130123",label:"正定县"},{value:"130125",label:"行唐县"},{value:"130126",label:"灵寿县"},{value:"130127",label:"高邑县"},{value:"130128",label:"深泽县"},{value:"130129",label:"赞皇县"},{value:"130130",label:"无极县"},{value:"130131",label:"平山县"},{value:"130132",label:"元氏县"},{value:"130133",label:"赵县"},{value:"130181",label:"辛集市"},{value:"130183",label:"晋州市"},{value:"130184",label:"新乐市"},{value:"130172",label:"石家庄循环化工园区"},{value:"130171",label:"石家庄高新技术产业开发区"}]},{value:"130200",label:"唐山市",children:[{value:"130202",label:"路南区"},{value:"130203",label:"路北区"},{value:"130204",label:"古冶区"},{value:"130205",label:"开平区"},{value:"130207",label:"丰南区"},{value:"130208",label:"丰润区"},{value:"130209",label:"曹妃甸区"},{value:"130223",label:"滦县"},{value:"130224",label:"滦南县"},{value:"130225",label:"乐亭县"},{value:"130227",label:"迁西县"},{value:"130229",label:"玉田县"},{value:"130281",label:"遵化市"},{value:"130283",label:"迁安市"},{value:"130271",label:"唐山市芦台经济技术开发区"},{value:"130272",label:"唐山市汉沽管理区"},{value:"130273",label:"唐山高新技术产业开发区"},{value:"130274",label:"河北唐山海港经济开发区"}]},{value:"130300",label:"秦皇岛市",children:[{value:"130302",label:"海港区"},{value:"130303",label:"山海关区"},{value:"130304",label:"北戴河区"},{value:"130321",label:"青龙满族自治县"},{value:"130322",label:"昌黎县"},{value:"130306",label:"抚宁区"},{value:"130324",label:"卢龙县"},{value:"130371",label:"秦皇岛市经济技术开发区"},{value:"130372",label:"北戴河新区"}]},{value:"130400",label:"邯郸市",children:[{value:"130402",label:"邯山区"},{value:"130403",label:"丛台区"},{value:"130404",label:"复兴区"},{value:"130406",label:"峰峰矿区"},{value:"130421",label:"邯郸县"},{value:"130423",label:"临漳县"},{value:"130424",label:"成安县"},{value:"130425",label:"大名县"},{value:"130426",label:"涉县"},{value:"130427",label:"磁县"},{value:"130407",label:"肥乡区"},{value:"130408",label:"永年区"},{value:"130430",label:"邱县"},{value:"130431",label:"鸡泽县"},{value:"130432",label:"广平县"},{value:"130433",label:"馆陶县"},{value:"130434",label:"魏县"},{value:"130435",label:"曲周县"},{value:"130481",label:"武安市"},{value:"130471",label:"邯郸经济技术开发区"},{value:"130473",label:"邯郸冀南新区"}]},{value:"130500",label:"邢台市",children:[{value:"130502",label:"桥东区"},{value:"130503",label:"桥西区"},{value:"130521",label:"邢台县"},{value:"130522",label:"临城县"},{value:"130523",label:"内丘县"},{value:"130524",label:"柏乡县"},{value:"130525",label:"隆尧县"},{value:"130526",label:"任县"},{value:"130527",label:"南和县"},{value:"130528",label:"宁晋县"},{value:"130529",label:"巨鹿县"},{value:"130530",label:"新河县"},{value:"130531",label:"广宗县"},{value:"130532",label:"平乡县"},{value:"130533",label:"威县"},{value:"130534",label:"清河县"},{value:"130535",label:"临西县"},{value:"130581",label:"南宫市"},{value:"130582",label:"沙河市"},{value:"130571",label:"河北邢台经济开发区"}]},{value:"130600",label:"保定市",children:[{value:"130602",label:"竞秀区"},{value:"130606",label:"莲池区"},{value:"130607",label:"满城区"},{value:"130608",label:"清苑区"},{value:"130623",label:"涞水县"},{value:"130624",label:"阜平县"},{value:"130609",label:"徐水区"},{value:"130626",label:"定兴县"},{value:"130627",label:"唐县"},{value:"130628",label:"高阳县"},{value:"130629",label:"容城县"},{value:"130630",label:"涞源县"},{value:"130631",label:"望都县"},{value:"130632",label:"安新县"},{value:"130633",label:"易县"},{value:"130634",label:"曲阳县"},{value:"130635",label:"蠡县"},{value:"130636",label:"顺平县"},{value:"130637",label:"博野县"},{value:"130638",label:"雄县"},{value:"130681",label:"涿州市"},{value:"130682",label:"定州市"},{value:"130683",label:"安国市"},{value:"130684",label:"高碑店市"},{value:"130671",label:"保定高新技术产业开发区"},{value:"130672",label:"保定白沟新城"}]},{value:"130700",label:"张家口市",children:[{value:"130702",label:"桥东区"},{value:"130703",label:"桥西区"},{value:"130705",label:"宣化区"},{value:"130706",label:"下花园区"},{value:"130708",label:"万全区"},{value:"130709",label:"崇礼区"},{value:"130722",label:"张北县"},{value:"130723",label:"康保县"},{value:"130724",label:"沽源县"},{value:"130725",label:"尚义县"},{value:"130726",label:"蔚县"},{value:"130727",label:"阳原县"},{value:"130728",label:"怀安县"},{value:"130730",label:"怀来县"},{value:"130731",label:"涿鹿县"},{value:"130732",label:"赤城县"},{value:"130733",label:"崇礼县"},{value:"130771",label:"张家口市高新技术产业开发区"},{value:"130772",label:"张家口市察北管理区"},{value:"130773",label:"张家口市塞北管理区"}]},{value:"130800",label:"承德市",children:[{value:"130802",label:"双桥区"},{value:"130803",label:"双滦区"},{value:"130804",label:"鹰手营子矿区"},{value:"130821",label:"承德县"},{value:"130822",label:"兴隆县"},{value:"130881",label:"平泉市"},{value:"130824",label:"滦平县"},{value:"130825",label:"隆化县"},{value:"130826",label:"丰宁满族自治县"},{value:"130827",label:"宽城满族自治县"},{value:"130828",label:"围场满族蒙古族自治县"},{value:"130871",label:"承德高新技术产业开发区"}]},{value:"130900",label:"沧州市",children:[{value:"130902",label:"新华区"},{value:"130903",label:"运河区"},{value:"130921",label:"沧县"},{value:"130922",label:"青县"},{value:"130923",label:"东光县"},{value:"130924",label:"海兴县"},{value:"130925",label:"盐山县"},{value:"130926",label:"肃宁县"},{value:"130927",label:"南皮县"},{value:"130928",label:"吴桥县"},{value:"130929",label:"献县"},{value:"130930",label:"孟村回族自治县"},{value:"130981",label:"泊头市"},{value:"130982",label:"任丘市"},{value:"130983",label:"黄骅市"},{value:"130984",label:"河间市"},{value:"130971",label:"河北沧州经济开发区"},{value:"130972",label:"沧州高新技术产业开发区"},{value:"130973",label:"沧州渤海新区"}]},{value:"131000",label:"廊坊市",children:[{value:"131002",label:"安次区"},{value:"131003",label:"广阳区"},{value:"131022",label:"固安县"},{value:"131023",label:"永清县"},{value:"131024",label:"香河县"},{value:"131025",label:"大城县"},{value:"131026",label:"文安县"},{value:"131028",label:"大厂回族自治县"},{value:"131071",label:"廊坊经济技术开发区"},{value:"131081",label:"霸州市"},{value:"131082",label:"三河市"}]},{value:"131100",label:"衡水市",children:[{value:"131102",label:"桃城区"},{value:"131121",label:"枣强县"},{value:"131122",label:"武邑县"},{value:"131123",label:"武强县"},{value:"131124",label:"饶阳县"},{value:"131125",label:"安平县"},{value:"131126",label:"故城县"},{value:"131127",label:"景县"},{value:"131128",label:"阜城县"},{value:"131103",label:"冀州区"},{value:"131182",label:"深州市"},{value:"131172",label:"衡水滨湖新区"},{value:"131171",label:"河北衡水经济开发区"}]}]},{value:'140000',label:'山西省',children:[{value:"140100",label:"太原市",children:[{value:"140105",label:"小店区"},{value:"140106",label:"迎泽区"},{value:"140107",label:"杏花岭区"},{value:"140108",label:"尖草坪区"},{value:"140109",label:"万柏林区"},{value:"140110",label:"晋源区"},{value:"140121",label:"清徐县"},{value:"140122",label:"阳曲县"},{value:"140123",label:"娄烦县"},{value:"140181",label:"古交市"},{value:"140171",label:"山西转型综合改革示范区"}]},{value:"140200",label:"大同市",children:[{value:"140202",label:"城区"},{value:"140203",label:"矿区"},{value:"140211",label:"南郊区"},{value:"140212",label:"新荣区"},{value:"140221",label:"阳高县"},{value:"140222",label:"天镇县"},{value:"140223",label:"广灵县"},{value:"140224",label:"灵丘县"},{value:"140225",label:"浑源县"},{value:"140226",label:"左云县"},{value:"140227",label:"大同县"},{value:"140271",label:"山西大同经济开发区"}]},{value:"140300",label:"阳泉市",children:[{value:"140302",label:"城区"},{value:"140303",label:"矿区"},{value:"140311",label:"郊区"},{value:"140321",label:"平定县"},{value:"140322",label:"盂县"},{value:"140371",label:"山西阳泉经济开发区"}]},{value:"140400",label:"长治市",children:[{value:"140421",label:"长治县"},{value:"140423",label:"襄垣县"},{value:"140424",label:"屯留县"},{value:"140425",label:"平顺县"},{value:"140426",label:"黎城县"},{value:"140427",label:"壶关县"},{value:"140428",label:"长子县"},{value:"140429",label:"武乡县"},{value:"140430",label:"沁县"},{value:"140431",label:"沁源县"},{value:"140481",label:"潞城市"},{value:"140402",label:"城区"},{value:"140411",label:"郊区"},{value:"140471",label:"山西长治高新技术产业园区"}]},{value:"140500",label:"晋城市",children:[{value:"140502",label:"城区"},{value:"140521",label:"沁水县"},{value:"140522",label:"阳城县"},{value:"140524",label:"陵川县"},{value:"140525",label:"泽州县"},{value:"140581",label:"高平市"}]},{value:"140600",label:"朔州市",children:[{value:"140602",label:"朔城区"},{value:"140603",label:"平鲁区"},{value:"140621",label:"山阴县"},{value:"140622",label:"应县"},{value:"140623",label:"右玉县"},{value:"140624",label:"怀仁县"},{value:"140671",label:"山西朔州经济开发区"}]},{value:"140700",label:"晋中市",children:[{value:"140702",label:"榆次区"},{value:"140721",label:"榆社县"},{value:"140722",label:"左权县"},{value:"140723",label:"和顺县"},{value:"140724",label:"昔阳县"},{value:"140725",label:"寿阳县"},{value:"140726",label:"太谷县"},{value:"140727",label:"祁县"},{value:"140728",label:"平遥县"},{value:"140729",label:"灵石县"},{value:"140781",label:"介休市"}]},{value:"140800",label:"运城市",children:[{value:"140802",label:"盐湖区"},{value:"140821",label:"临猗县"},{value:"140822",label:"万荣县"},{value:"140823",label:"闻喜县"},{value:"140824",label:"稷山县"},{value:"140825",label:"新绛县"},{value:"140826",label:"绛县"},{value:"140827",label:"垣曲县"},{value:"140828",label:"夏县"},{value:"140829",label:"平陆县"},{value:"140830",label:"芮城县"},{value:"140881",label:"永济市"},{value:"140882",label:"河津市"}]},{value:"140900",label:"忻州市",children:[{value:"140902",label:"忻府区"},{value:"140921",label:"定襄县"},{value:"140922",label:"五台县"},{value:"140923",label:"代县"},{value:"140924",label:"繁峙县"},{value:"140925",label:"宁武县"},{value:"140926",label:"静乐县"},{value:"140927",label:"神池县"},{value:"140928",label:"五寨县"},{value:"140929",label:"岢岚县"},{value:"140930",label:"河曲县"},{value:"140931",label:"保德县"},{value:"140932",label:"偏关县"},{value:"140981",label:"原平市"},{value:"140971",label:"五台山风景名胜区"}]},{value:"141000",label:"临汾市",children:[{value:"141002",label:"尧都区"},{value:"141021",label:"曲沃县"},{value:"141022",label:"翼城县"},{value:"141023",label:"襄汾县"},{value:"141024",label:"洪洞县"},{value:"141025",label:"古县"},{value:"141026",label:"安泽县"},{value:"141027",label:"浮山县"},{value:"141028",label:"吉县"},{value:"141029",label:"乡宁县"},{value:"141030",label:"大宁县"},{value:"141031",label:"隰县"},{value:"141032",label:"永和县"},{value:"141033",label:"蒲县"},{value:"141034",label:"汾西县"},{value:"141081",label:"侯马市"},{value:"141082",label:"霍州市"}]},{value:"141100",label:"吕梁市",children:[{value:"141102",label:"离石区"},{value:"141121",label:"文水县"},{value:"141122",label:"交城县"},{value:"141123",label:"兴县"},{value:"141124",label:"临县"},{value:"141125",label:"柳林县"},{value:"141126",label:"石楼县"},{value:"141127",label:"岚县"},{value:"141128",label:"方山县"},{value:"141129",label:"中阳县"},{value:"141130",label:"交口县"},{value:"141181",label:"孝义市"},{value:"141182",label:"汾阳市"}]}]},{value:'150000',label:'内蒙古',children:[{value:"150100",label:"呼和浩特市",children:[{value:"150102",label:"新城区"},{value:"150103",label:"回民区"},{value:"150104",label:"玉泉区"},{value:"150105",label:"赛罕区"},{value:"150121",label:"土默特左旗"},{value:"150122",label:"托克托县"},{value:"150123",label:"和林格尔县"},{value:"150124",label:"清水河县"},{value:"150125",label:"武川县"},{value:"150171",label:"呼和浩特金海工业园区"},{value:"150172",label:"呼和浩特经济技术开发区"}]},{value:"150200",label:"包头市",children:[{value:"150202",label:"东河区"},{value:"150203",label:"昆都仑区"},{value:"150204",label:"青山区"},{value:"150205",label:"石拐区"},{value:"150206",label:"白云矿区"},{value:"150207",label:"九原区"},{value:"150221",label:"土默特右旗"},{value:"150222",label:"固阳县"},{value:"150223",label:"达尔罕茂明安联合旗"},{value:"150271",label:"包头稀土高新技术产业开发区"}]},{value:"150300",label:"乌海市",children:[{value:"150302",label:"海勃湾区"},{value:"150303",label:"海南区"},{value:"150304",label:"乌达区"}]},{value:"150400",label:"赤峰市",children:[{value:"150402",label:"红山区"},{value:"150403",label:"元宝山区"},{value:"150404",label:"松山区"},{value:"150421",label:"阿鲁科尔沁旗"},{value:"150422",label:"巴林左旗"},{value:"150423",label:"巴林右旗"},{value:"150424",label:"林西县"},{value:"150425",label:"克什克腾旗"},{value:"150426",label:"翁牛特旗"},{value:"150428",label:"喀喇沁旗"},{value:"150429",label:"宁城县"},{value:"150430",label:"敖汉旗"}]},{value:"150500",label:"通辽市",children:[{value:"150502",label:"科尔沁区"},{value:"150521",label:"科尔沁左翼中旗"},{value:"150522",label:"科尔沁左翼后旗"},{value:"150523",label:"开鲁县"},{value:"150524",label:"库伦旗"},{value:"150525",label:"奈曼旗"},{value:"150526",label:"扎鲁特旗"},{value:"150581",label:"霍林郭勒市"},{value:"150571",label:"通辽经济技术开发区"}]},{value:"150600",label:"鄂尔多斯市",children:[{value:"150602",label:"东胜区"},{value:"150621",label:"达拉特旗"},{value:"150622",label:"准格尔旗"},{value:"150623",label:"鄂托克前旗"},{value:"150624",label:"鄂托克旗"},{value:"150625",label:"杭锦旗"},{value:"150626",label:"乌审旗"},{value:"150627",label:"伊金霍洛旗"},{value:"150603",label:"康巴什区"}]},{value:"150700",label:"呼伦贝尔市",children:[{value:"150702",label:"海拉尔区"},{value:"150721",label:"阿荣旗"},{value:"150722",label:"莫力达瓦达斡尔族自治旗"},{value:"150723",label:"鄂伦春自治旗"},{value:"150724",label:"鄂温克族自治旗"},{value:"150725",label:"陈巴尔虎旗"},{value:"150726",label:"新巴尔虎左旗"},{value:"150727",label:"新巴尔虎右旗"},{value:"150781",label:"满洲里市"},{value:"150782",label:"牙克石市"},{value:"150783",label:"扎兰屯市"},{value:"150784",label:"额尔古纳市"},{value:"150785",label:"根河市"},{value:"150703",label:"扎赉诺尔区"}]},{value:"150800",label:"巴彦淖尔市",children:[{value:"150802",label:"临河区"},{value:"150821",label:"五原县"},{value:"150822",label:"磴口县"},{value:"150823",label:"乌拉特前旗"},{value:"150824",label:"乌拉特中旗"},{value:"150825",label:"乌拉特后旗"},{value:"150826",label:"杭锦后旗"}]},{value:"150900",label:"乌兰察布市",children:[{value:"150902",label:"集宁区"},{value:"150921",label:"卓资县"},{value:"150922",label:"化德县"},{value:"150923",label:"商都县"},{value:"150924",label:"兴和县"},{value:"150925",label:"凉城县"},{value:"150926",label:"察哈尔右翼前旗"},{value:"150927",label:"察哈尔右翼中旗"},{value:"150928",label:"察哈尔右翼后旗"},{value:"150929",label:"四子王旗"},{value:"150981",label:"丰镇市"}]},{value:"152200",label:"兴安盟",children:[{value:"152201",label:"乌兰浩特市"},{value:"152202",label:"阿尔山市"},{value:"152221",label:"科尔沁右翼前旗"},{value:"152222",label:"科尔沁右翼中旗"},{value:"152223",label:"扎赉特旗"},{value:"152224",label:"突泉县"}]},{value:"152500",label:"锡林郭勒盟",children:[{value:"152501",label:"二连浩特市"},{value:"152502",label:"锡林浩特市"},{value:"152522",label:"阿巴嘎旗"},{value:"152523",label:"苏尼特左旗"},{value:"152524",label:"苏尼特右旗"},{value:"152525",label:"东乌珠穆沁旗"},{value:"152526",label:"西乌珠穆沁旗"},{value:"152527",label:"太仆寺旗"},{value:"152528",label:"镶黄旗"},{value:"152529",label:"正镶白旗"},{value:"152530",label:"正蓝旗"},{value:"152531",label:"多伦县"},{value:"152571",label:"乌拉盖管委会"}]},{value:"152900",label:"阿拉善盟",children:[{value:"152921",label:"阿拉善左旗"},{value:"152922",label:"阿拉善右旗"},{value:"152923",label:"额济纳旗"},{value:"152971",label:"内蒙古阿拉善经济开发区"}]}]},{value:'210000',label:'辽宁省',children:[{value:"210100",label:"沈阳市",children:[{value:"210102",label:"和平区"},{value:"210103",label:"沈河区"},{value:"210104",label:"大东区"},{value:"210105",label:"皇姑区"},{value:"210106",label:"铁西区"},{value:"210111",label:"苏家屯区"},{value:"210112",label:"东陵区"},{value:"210113",label:"新城子区"},{value:"210114",label:"于洪区"},{value:"210115",label:"辽中区"},{value:"210123",label:"康平县"},{value:"210124",label:"法库县"},{value:"210181",label:"新民市"},{value:"210112",label:"浑南区"},{value:"210113",label:"沈北新区"}]},{value:"210200",label:"大连市",children:[{value:"210202",label:"中山区"},{value:"210203",label:"西岗区"},{value:"210204",label:"沙河口区"},{value:"210211",label:"甘井子区"},{value:"210212",label:"旅顺口区"},{value:"210213",label:"金州区"},{value:"210224",label:"长海县"},{value:"210251",label:"开发区"},{value:"210281",label:"瓦房店市"},{value:"210214",label:"普兰店区"},{value:"210283",label:"庄河市"}]},{value:"210300",label:"鞍山市",children:[{value:"210302",label:"铁东区"},{value:"210303",label:"铁西区"},{value:"210304",label:"立山区"},{value:"210311",label:"千山区"},{value:"210321",label:"台安县"},{value:"210323",label:"岫岩满族自治县"},{value:"210381",label:"海城市"}]},{value:"210400",label:"抚顺市",children:[{value:"210402",label:"新抚区"},{value:"210403",label:"东洲区"},{value:"210404",label:"望花区"},{value:"210411",label:"顺城区"},{value:"210421",label:"抚顺县"},{value:"210422",label:"新宾满族自治县"},{value:"210423",label:"清原满族自治县"}]},{value:"210500",label:"本溪市",children:[{value:"210502",label:"平山区"},{value:"210503",label:"溪湖区"},{value:"210504",label:"明山区"},{value:"210505",label:"南芬区"},{value:"210521",label:"本溪满族自治县"},{value:"210522",label:"桓仁满族自治县"}]},{value:"210600",label:"丹东市",children:[{value:"210602",label:"元宝区"},{value:"210603",label:"振兴区"},{value:"210604",label:"振安区"},{value:"210624",label:"宽甸满族自治县"},{value:"210681",label:"东港市"},{value:"210682",label:"凤城市"}]},{value:"210700",label:"锦州市",children:[{value:"210702",label:"古塔区"},{value:"210703",label:"凌河区"},{value:"210711",label:"太和区"},{value:"210726",label:"黑山县"},{value:"210727",label:"义县"},{value:"210781",label:"凌海市"},{value:"210782",label:"北镇市"}]},{value:"210800",label:"营口市",children:[{value:"210802",label:"站前区"},{value:"210803",label:"西市区"},{value:"210804",label:"鲅鱼圈区"},{value:"210811",label:"老边区"},{value:"210881",label:"盖州市"},{value:"210882",label:"大石桥市"}]},{value:"210900",label:"阜新市",children:[{value:"210902",label:"海州区"},{value:"210903",label:"新邱区"},{value:"210904",label:"太平区"},{value:"210905",label:"清河门区"},{value:"210911",label:"细河区"},{value:"210921",label:"阜新蒙古族自治县"},{value:"210922",label:"彰武县"}]},{value:"211000",label:"辽阳市",children:[{value:"211002",label:"白塔区"},{value:"211003",label:"文圣区"},{value:"211004",label:"宏伟区"},{value:"211005",label:"弓长岭区"},{value:"211011",label:"太子河区"},{value:"211021",label:"辽阳县"},{value:"211081",label:"灯塔市"}]},{value:"211100",label:"盘锦市",children:[{value:"211102",label:"双台子区"},{value:"211103",label:"兴隆台区"},{value:"211121",label:"大洼县"},{value:"211122",label:"盘山县"}]},{value:"211200",label:"铁岭市",children:[{value:"211202",label:"银州区"},{value:"211204",label:"清河区"},{value:"211221",label:"铁岭县"},{value:"211223",label:"西丰县"},{value:"211224",label:"昌图县"},{value:"211281",label:"调兵山市"},{value:"211282",label:"开原市"}]},{value:"211300",label:"朝阳市",children:[{value:"211302",label:"双塔区"},{value:"211303",label:"龙城区"},{value:"211321",label:"朝阳县"},{value:"211322",label:"建平县"},{value:"211324",label:"喀喇沁左翼蒙古族自治县"},{value:"211381",label:"北票市"},{value:"211382",label:"凌源市"}]},{value:"211400",label:"葫芦岛市",children:[{value:"211402",label:"连山区"},{value:"211403",label:"龙港区"},{value:"211404",label:"南票区"},{value:"211421",label:"绥中县"},{value:"211422",label:"建昌县"},{value:"211481",label:"兴城市"}]}]},{value:'220000',label:'吉林省',children:[{value:"220100",label:"长春市",children:[{value:"220102",label:"南关区"},{value:"220103",label:"宽城区"},{value:"220104",label:"朝阳区"},{value:"220105",label:"二道区"},{value:"220106",label:"绿园区"},{value:"220112",label:"双阳区"},{value:"220122",label:"农安县"},{value:"220181",label:"九台市"},{value:"220182",label:"榆树市"},{value:"220183",label:"德惠市"},{value:"220171",label:"长春经济技术开发区"},{value:"220172",label:"长春净月高新技术产业开发区"},{value:"220173",label:"长春高新技术产业开发区"},{value:"220174",label:"长春汽车经济技术开发区"}]},{value:"220200",label:"吉林市",children:[{value:"220202",label:"昌邑区"},{value:"220203",label:"龙潭区"},{value:"220204",label:"船营区"},{value:"220211",label:"丰满区"},{value:"220221",label:"永吉县"},{value:"220281",label:"蛟河市"},{value:"220282",label:"桦甸市"},{value:"220283",label:"舒兰市"},{value:"220284",label:"磐石市"},{value:"220271",label:"吉林经济开发区"},{value:"220272",label:"吉林高新技术产业开发区"},{value:"220273",label:"吉林中国新加坡食品区"}]},{value:"220300",label:"四平市",children:[{value:"220302",label:"铁西区"},{value:"220303",label:"铁东区"},{value:"220322",label:"梨树县"},{value:"220323",label:"伊通满族自治县"},{value:"220381",label:"公主岭市"},{value:"220382",label:"双辽市"}]},{value:"220400",label:"辽源市",children:[{value:"220402",label:"龙山区"},{value:"220403",label:"西安区"},{value:"220421",label:"东丰县"},{value:"220422",label:"东辽县"}]},{value:"220500",label:"通化市",children:[{value:"220502",label:"东昌区"},{value:"220503",label:"二道江区"},{value:"220521",label:"通化县"},{value:"220523",label:"辉南县"},{value:"220524",label:"柳河县"},{value:"220581",label:"梅河口市"},{value:"220582",label:"集安市"}]},{value:"220600",label:"白山市",children:[{value:"220602",label:"八道江区"},{value:"220621",label:"抚松县"},{value:"220622",label:"靖宇县"},{value:"220623",label:"长白朝鲜族自治县"},{value:"220605",label:"江源区"},{value:"220681",label:"临江市"},{value:"220602",label:"浑江区"}]},{value:"220700",label:"松原市",children:[{value:"220702",label:"宁江区"},{value:"220721",label:"前郭尔罗斯蒙古族自治县"},{value:"220722",label:"长岭县"},{value:"220723",label:"乾安县"},{value:"220781",label:"扶余市"},{value:"220771",label:"吉林松原经济开发区"}]},{value:"220800",label:"白城市",children:[{value:"220802",label:"洮北区"},{value:"220821",label:"镇赉县"},{value:"220822",label:"通榆县"},{value:"220881",label:"洮南市"},{value:"220882",label:"大安市"},{value:"220871",label:"吉林白城经济开发区"}]},{value:"222400",label:"延边朝鲜族自治州",children:[{value:"222401",label:"延吉市"},{value:"222402",label:"图们市"},{value:"222403",label:"敦化市"},{value:"222404",label:"珲春市"},{value:"222405",label:"龙井市"},{value:"222406",label:"和龙市"},{value:"222424",label:"汪清县"},{value:"222426",label:"安图县"}]}]},{value:'230000',label:'黑龙江省',children:[{value:"230100",label:"哈尔滨市",children:[{value:"230102",label:"道里区"},{value:"230103",label:"南岗区"},{value:"230104",label:"道外区"},{value:"230110",label:"香坊区"},{value:"230107",label:"动力区"},{value:"230108",label:"平房区"},{value:"230109",label:"松北区"},{value:"230111",label:"呼兰区"},{value:"230123",label:"依兰县"},{value:"230124",label:"方正县"},{value:"230125",label:"宾县"},{value:"230126",label:"巴彦县"},{value:"230127",label:"木兰县"},{value:"230128",label:"通河县"},{value:"230129",label:"延寿县"},{value:"230112",label:"阿城区"},{value:"230113",label:"双城区"},{value:"230183",label:"尚志市"},{value:"230184",label:"五常市"}]},{value:"230200",label:"齐齐哈尔市",children:[{value:"230202",label:"龙沙区"},{value:"230203",label:"建华区"},{value:"230204",label:"铁锋区"},{value:"230205",label:"昂昂溪区"},{value:"230206",label:"富拉尔基区"},{value:"230207",label:"碾子山区"},{value:"230208",label:"梅里斯达斡尔族区"},{value:"230221",label:"龙江县"},{value:"230223",label:"依安县"},{value:"230224",label:"泰来县"},{value:"230225",label:"甘南县"},{value:"230227",label:"富裕县"},{value:"230229",label:"克山县"},{value:"230230",label:"克东县"},{value:"230231",label:"拜泉县"},{value:"230281",label:"讷河市"}]},{value:"230300",label:"鸡西市",children:[{value:"230302",label:"鸡冠区"},{value:"230303",label:"恒山区"},{value:"230304",label:"滴道区"},{value:"230305",label:"梨树区"},{value:"230306",label:"城子河区"},{value:"230307",label:"麻山区"},{value:"230321",label:"鸡东县"},{value:"230381",label:"虎林市"},{value:"230382",label:"密山市"}]},{value:"230400",label:"鹤岗市",children:[{value:"230402",label:"向阳区"},{value:"230403",label:"工农区"},{value:"230404",label:"南山区"},{value:"230405",label:"兴安区"},{value:"230406",label:"东山区"},{value:"230407",label:"兴山区"},{value:"230421",label:"萝北县"},{value:"230422",label:"绥滨县"}]},{value:"230500",label:"双鸭山市",children:[{value:"230502",label:"尖山区"},{value:"230503",label:"岭东区"},{value:"230505",label:"四方台区"},{value:"230506",label:"宝山区"},{value:"230521",label:"集贤县"},{value:"230522",label:"友谊县"},{value:"230523",label:"宝清县"},{value:"230524",label:"饶河县"}]},{value:"230600",label:"大庆市",children:[{value:"230602",label:"萨尔图区"},{value:"230603",label:"龙凤区"},{value:"230604",label:"让胡路区"},{value:"230605",label:"红岗区"},{value:"230606",label:"大同区"},{value:"230621",label:"肇州县"},{value:"230622",label:"肇源县"},{value:"230623",label:"林甸县"},{value:"230624",label:"杜尔伯特蒙古族自治县"},{value:"230671",label:"大庆高新技术产业开发区"}]},{value:"230700",label:"伊春市",children:[{value:"230702",label:"伊春区"},{value:"230703",label:"南岔区"},{value:"230704",label:"友好区"},{value:"230705",label:"西林区"},{value:"230706",label:"翠峦区"},{value:"230707",label:"新青区"},{value:"230708",label:"美溪区"},{value:"230709",label:"金山屯区"},{value:"230710",label:"五营区"},{value:"230711",label:"乌马河区"},{value:"230712",label:"汤旺河区"},{value:"230713",label:"带岭区"},{value:"230714",label:"乌伊岭区"},{value:"230715",label:"红星区"},{value:"230716",label:"上甘岭区"},{value:"230722",label:"嘉荫县"},{value:"230781",label:"铁力市"}]},{value:"230800",label:"佳木斯市",children:[{value:"230803",label:"向阳区"},{value:"230804",label:"前进区"},{value:"230805",label:"东风区"},{value:"230811",label:"郊区"},{value:"230822",label:"桦南县"},{value:"230826",label:"桦川县"},{value:"230828",label:"汤原县"},{value:"230833",label:"抚远市"},{value:"230881",label:"同江市"},{value:"230882",label:"富锦市"}]},{value:"230900",label:"七台河市",children:[{value:"230902",label:"新兴区"},{value:"230903",label:"桃山区"},{value:"230904",label:"茄子河区"},{value:"230921",label:"勃利县"}]},{value:"231000",label:"牡丹江市",children:[{value:"231002",label:"东安区"},{value:"231003",label:"阳明区"},{value:"231004",label:"爱民区"},{value:"231005",label:"西安区"},{value:"231086",label:"东宁市"},{value:"231025",label:"林口县"},{value:"231081",label:"绥芬河市"},{value:"231083",label:"海林市"},{value:"231084",label:"宁安市"},{value:"231085",label:"穆棱市"},{value:"231071",label:"牡丹江经济技术开发区"}]},{value:"231100",label:"黑河市",children:[{value:"231102",label:"爱辉区"},{value:"231121",label:"嫩江县"},{value:"231123",label:"逊克县"},{value:"231124",label:"孙吴县"},{value:"231181",label:"北安市"},{value:"231182",label:"五大连池市"}]},{value:"231200",label:"绥化市",children:[{value:"231202",label:"北林区"},{value:"231221",label:"望奎县"},{value:"231222",label:"兰西县"},{value:"231223",label:"青冈县"},{value:"231224",label:"庆安县"},{value:"231225",label:"明水县"},{value:"231226",label:"绥棱县"},{value:"231281",label:"安达市"},{value:"231282",label:"肇东市"},{value:"231283",label:"海伦市"}]},{value:"232700",label:"大兴安岭地区",children:[{value:"232721",label:"呼玛县"},{value:"232722",label:"塔河县"},{value:"232723",label:"漠河县"},{value:"232701",label:"加格达奇区"},{value:"232704",label:"呼中区"},{value:"232703",label:"新林区"}]}]},{value:'310000',label:'上海市',children:[{value:'310100',label:'上海市',children:[{value:"310101",label:"黄浦区"},{value:"310104",label:"徐汇区"},{value:"310105",label:"长宁区"},{value:"310106",label:"静安区"},{value:"310107",label:"普陀区"},{value:"310109",label:"虹口区"},{value:"310110",label:"杨浦区"},{value:"310112",label:"闵行区"},{value:"310113",label:"宝山区"},{value:"310114",label:"嘉定区"},{value:"310115",label:"浦东新区"},{value:"310116",label:"金山区"},{value:"310117",label:"松江区"},{value:"310118",label:"青浦区"},{value:"310120",label:"奉贤区"},{value:"310151",label:"崇明区"}]}]},{value:'320000',label:'江苏省',children:[{value:"320100",label:"南京市",children:[{value:"320102",label:"玄武区"},{value:"320104",label:"秦淮区"},{value:"320105",label:"建邺区"},{value:"320106",label:"鼓楼区"},{value:"320111",label:"浦口区"},{value:"320113",label:"栖霞区"},{value:"320114",label:"雨花台区"},{value:"320115",label:"江宁区"},{value:"320116",label:"六合区"},{value:"320117",label:"溧水区"},{value:"320118",label:"高淳区"}]},{value:"320200",label:"无锡市",children:[{value:"320205",label:"锡山区"},{value:"320206",label:"惠山区"},{value:"320211",label:"滨湖区"},{value:"320281",label:"江阴市"},{value:"320282",label:"宜兴市"},{value:"320213",label:"梁溪区"},{value:"320214",label:"新吴区"}]},{value:"320300",label:"徐州市",children:[{value:"320302",label:"鼓楼区"},{value:"320303",label:"云龙区"},{value:"320305",label:"贾汪区"},{value:"320311",label:"泉山区"},{value:"320321",label:"丰县"},{value:"320322",label:"沛县"},{value:"320324",label:"睢宁县"},{value:"320381",label:"新沂市"},{value:"320382",label:"邳州市"},{value:"320371",label:"徐州经济技术开发区"}]},{value:"320400",label:"常州市",children:[{value:"320402",label:"天宁区"},{value:"320404",label:"钟楼区"},{value:"320411",label:"新北区"},{value:"320412",label:"武进区"},{value:"320481",label:"溧阳市"},{value:"320413",label:"金坛区"}]},{value:"320500",label:"苏州市",children:[{value:"320505",label:"虎丘区"},{value:"320506",label:"吴中区"},{value:"320507",label:"相城区"},{value:"320581",label:"常熟市"},{value:"320582",label:"张家港市"},{value:"320583",label:"昆山市"},{value:"320509",label:"吴江区"},{value:"320585",label:"太仓市"},{value:"320508",label:"姑苏区"},{value:"320571",label:"苏州工业园区"}]},{value:"320600",label:"南通市",children:[{value:"320602",label:"崇川区"},{value:"320611",label:"港闸区"},{value:"320612",label:"通州区"},{value:"320621",label:"海安县"},{value:"320623",label:"如东县"},{value:"320681",label:"启东市"},{value:"320682",label:"如皋市"},{value:"320684",label:"海门市"},{value:"320671",label:"南通经济技术开发区"}]},{value:"320700",label:"连云港市",children:[{value:"320703",label:"连云区"},{value:"320706",label:"海州区"},{value:"320707",label:"赣榆区"},{value:"320722",label:"东海县"},{value:"320723",label:"灌云县"},{value:"320724",label:"灌南县"},{value:"320771",label:"连云港经济技术开发区"},{value:"320772",label:"连云港高新技术产业开发区"}]},{value:"320800",label:"淮安市",children:[{value:"320804",label:"淮阴区"},{value:"320812",label:"清江浦区"},{value:"320826",label:"涟水县"},{value:"320813",label:"洪泽区"},{value:"320830",label:"盱眙县"},{value:"320831",label:"金湖县"},{value:"320803",label:"淮安区"},{value:"320871",label:"淮安经济技术开发区"}]},{value:"320900",label:"盐城市",children:[{value:"320902",label:"亭湖区"},{value:"320903",label:"盐都区"},{value:"320921",label:"响水县"},{value:"320922",label:"滨海县"},{value:"320904",label:"大丰区"},{value:"320923",label:"阜宁县"},{value:"320924",label:"射阳县"},{value:"320925",label:"建湖县"},{value:"320981",label:"东台市"},{value:"320971",label:"盐城经济技术开发区"}]},{value:"321000",label:"扬州市",children:[{value:"321002",label:"广陵区"},{value:"321003",label:"邗江区"},{value:"321011",label:"维扬区"},{value:"321023",label:"宝应县"},{value:"321081",label:"仪征市"},{value:"321084",label:"高邮市"},{value:"321012",label:"江都区"},{value:"321071",label:"扬州经济技术开发区"}]},{value:"321100",label:"镇江市",children:[{value:"321102",label:"京口区"},{value:"321111",label:"润州区"},{value:"321112",label:"丹徒区"},{value:"321181",label:"丹阳市"},{value:"321182",label:"扬中市"},{value:"321183",label:"句容市"},{value:"321171",label:"镇江新区"}]},{value:"321200",label:"泰州市",children:[{value:"321202",label:"海陵区"},{value:"321203",label:"高港区"},{value:"321281",label:"兴化市"},{value:"321282",label:"靖江市"},{value:"321283",label:"泰兴市"},{value:"321204",label:"姜堰区"},{value:"321271",label:"泰州医药高新技术产业开发区"}]},{value:"321300",label:"宿迁市",children:[{value:"321302",label:"宿城区"},{value:"321311",label:"宿豫区"},{value:"321322",label:"沭阳县"},{value:"321323",label:"泗阳县"},{value:"321324",label:"泗洪县"}]}]},{value:'330000',label:'浙江省',children:[{value:"330100",label:"杭州市",children:[{value:"330102",label:"上城区"},{value:"330103",label:"下城区"},{value:"330104",label:"江干区"},{value:"330105",label:"拱墅区"},{value:"330106",label:"西湖区"},{value:"330108",label:"滨江区"},{value:"330109",label:"萧山区"},{value:"330110",label:"余杭区"},{value:"330122",label:"桐庐县"},{value:"330127",label:"淳安县"},{value:"330182",label:"建德市"},{value:"330111",label:"富阳区"},{value:"330112",label:"临安区"},{value:"330186",label:"其它区"}]},{value:"330200",label:"宁波市",children:[{value:"330203",label:"海曙区"},{value:"330205",label:"江北区"},{value:"330206",label:"北仑区"},{value:"330211",label:"镇海区"},{value:"330212",label:"鄞州区"},{value:"330225",label:"象山县"},{value:"330226",label:"宁海县"},{value:"330281",label:"余姚市"},{value:"330282",label:"慈溪市"},{value:"330213",label:"奉化区"}]},{value:"330300",label:"温州市",children:[{value:"330302",label:"鹿城区"},{value:"330303",label:"龙湾区"},{value:"330304",label:"瓯海区"},{value:"330305",label:"洞头区"},{value:"330324",label:"永嘉县"},{value:"330326",label:"平阳县"},{value:"330327",label:"苍南县"},{value:"330328",label:"文成县"},{value:"330329",label:"泰顺县"},{value:"330381",label:"瑞安市"},{value:"330382",label:"乐清市"},{value:"330371",label:"温州经济技术开发区"}]},{value:"330400",label:"嘉兴市",children:[{value:"330402",label:"南湖区"},{value:"330411",label:"秀洲区"},{value:"330421",label:"嘉善县"},{value:"330424",label:"海盐县"},{value:"330481",label:"海宁市"},{value:"330482",label:"平湖市"},{value:"330483",label:"桐乡市"}]},{value:"330500",label:"湖州市",children:[{value:"330502",label:"吴兴区"},{value:"330503",label:"南浔区"},{value:"330521",label:"德清县"},{value:"330522",label:"长兴县"},{value:"330523",label:"安吉县"}]},{value:"330600",label:"绍兴市",children:[{value:"330602",label:"越城区"},{value:"330621",label:"柯桥区"},{value:"330681",label:"诸暨市"},{value:"330604",label:"上虞区"},{value:"330683",label:"嵊州市"},{value:"330624",label:"新昌县"}]},{value:"330700",label:"金华市",children:[{value:"330702",label:"婺城区"},{value:"330703",label:"金东区"},{value:"330723",label:"武义县"},{value:"330726",label:"浦江县"},{value:"330727",label:"磐安县"},{value:"330781",label:"兰溪市"},{value:"330782",label:"义乌市"},{value:"330783",label:"东阳市"},{value:"330784",label:"永康市"}]},{value:"330800",label:"衢州市",children:[{value:"330802",label:"柯城区"},{value:"330803",label:"衢江区"},{value:"330822",label:"常山县"},{value:"330824",label:"开化县"},{value:"330825",label:"龙游县"},{value:"330881",label:"江山市"}]},{value:"330900",label:"舟山市",children:[{value:"330902",label:"定海区"},{value:"330903",label:"普陀区"},{value:"330921",label:"岱山县"},{value:"330922",label:"嵊泗县"}]},{value:"331000",label:"台州市",children:[{value:"331002",label:"椒江区"},{value:"331003",label:"黄岩区"},{value:"331004",label:"路桥区"},{value:"331083",label:"玉环市"},{value:"331022",label:"三门县"},{value:"331023",label:"天台县"},{value:"331024",label:"仙居县"},{value:"331081",label:"温岭市"},{value:"331082",label:"临海市"}]},{value:"331100",label:"丽水市",children:[{value:"331102",label:"莲都区"},{value:"331121",label:"青田县"},{value:"331122",label:"缙云县"},{value:"331123",label:"遂昌县"},{value:"331124",label:"松阳县"},{value:"331125",label:"云和县"},{value:"331126",label:"庆元县"},{value:"331127",label:"景宁畲族自治县"},{value:"331181",label:"龙泉市"}]}]},{value:'340000',label:'安徽省',children:[{value:"340100",label:"合肥市",children:[{value:"340111",label:"包河区"},{value:"340104",label:"蜀山区"},{value:"340103",label:"庐阳区"},{value:"340102",label:"瑶海区"},{value:"340171",label:"合肥高新技术产业开发区"},{value:"340172",label:"合肥经济技术开发区"},{value:"340173",label:"合肥新站高新技术产业开发区"},{value:"340121",label:"长丰县"},{value:"340122",label:"肥东县"},{value:"340123",label:"肥西县"},{value:"340124",label:"庐江县"},{value:"340181",label:"巢湖市"}]},{value:"340200",label:"芜湖市",children:[{value:"340202",label:"镜湖区"},{value:"340203",label:"弋江区"},{value:"340207",label:"鸠江区"},{value:"340208",label:"三山区"},{value:"340221",label:"芜湖县"},{value:"340222",label:"繁昌县"},{value:"340223",label:"南陵县"},{value:"340225",label:"无为县"},{value:"340272",label:"安徽芜湖长江大桥经济开发区"},{value:"340271",label:"芜湖经济技术开发区"}]},{value:"340300",label:"蚌埠市",children:[{value:"340302",label:"龙子湖区"},{value:"340303",label:"蚌山区"},{value:"340304",label:"禹会区"},{value:"340311",label:"淮上区"},{value:"340321",label:"怀远县"},{value:"340322",label:"五河县"},{value:"340323",label:"固镇县"},{value:"340371",label:"蚌埠市高新技术开发区"},{value:"340372 ",label:"蚌埠市经济开发区"}]},{value:"340400",label:"淮南市",children:[{value:"340402",label:"大通区"},{value:"340403",label:"田家庵区"},{value:"340404",label:"谢家集区"},{value:"340405",label:"八公山区"},{value:"340406",label:"潘集区"},{value:"340421",label:"凤台县"},{value:"340422",label:"寿县"}]},{value:"340500",label:"马鞍山市",children:[{value:"340503",label:"花山区"},{value:"340504",label:"雨山区"},{value:"340521",label:"当涂县"},{value:"340506",label:"博望区"},{value:"340522",label:"含山县"},{value:"340523",label:"和县"}]},{value:"340600",label:"淮北市",children:[{value:"340602",label:"杜集区"},{value:"340603",label:"相山区"},{value:"340604",label:"烈山区"},{value:"340621",label:"濉溪县"}]},{value:"340700",label:"铜陵市",children:[{value:"340705",label:"铜官区"},{value:"340706",label:"义安区"},{value:"340711",label:"郊区"},{value:"340722",label:"枞阳县"}]},{value:"340800",label:"安庆市",children:[{value:"340802",label:"迎江区"},{value:"340803",label:"大观区"},{value:"340811",label:"宜秀区"},{value:"340822",label:"怀宁县"},{value:"340824",label:"潜山县"},{value:"340825",label:"太湖县"},{value:"340826",label:"宿松县"},{value:"340827",label:"望江县"},{value:"340828",label:"岳西县"},{value:"340881",label:"桐城市"},{value:"340871",label:"安徽安庆经济开发区"}]},{value:"341000",label:"黄山市",children:[{value:"341002",label:"屯溪区"},{value:"341003",label:"黄山区"},{value:"341004",label:"徽州区"},{value:"341021",label:"歙县"},{value:"341022",label:"休宁县"},{value:"341023",label:"黟县"},{value:"341024",label:"祁门县"}]},{value:"341100",label:"滁州市",children:[{value:"341102",label:"琅琊区"},{value:"341103",label:"南谯区"},{value:"341122",label:"来安县"},{value:"341124",label:"全椒县"},{value:"341125",label:"定远县"},{value:"341126",label:"凤阳县"},{value:"341181",label:"天长市"},{value:"341182",label:"明光市"},{value:"341171",label:"苏滁现代产业园"},{value:"341172",label:"滁州经济技术开发区"}]},{value:"341200",label:"阜阳市",children:[{value:"341202",label:"颍州区"},{value:"341203",label:"颍东区"},{value:"341204",label:"颍泉区"},{value:"341221",label:"临泉县"},{value:"341222",label:"太和县"},{value:"341225",label:"阜南县"},{value:"341226",label:"颍上县"},{value:"341282",label:"界首市"},{value:"341272",label:"阜阳经济技术开发区"},{value:"341271",label:"阜阳合肥现代产业园区"}]},{value:"341300",label:"宿州市",children:[{value:"341302",label:"埇桥区"},{value:"341321",label:"砀山县"},{value:"341322",label:"萧县"},{value:"341323",label:"灵璧县"},{value:"341324",label:"泗县"},{value:"341371",label:"宿州马鞍山现代产业园区"},{value:"341372",label:"宿州经济技术开发区"}]},{value:"341500",label:"六安市",children:[{value:"341502",label:"金安区"},{value:"341503",label:"裕安区"},{value:"341504",label:"叶集区"},{value:"341522",label:"霍邱县"},{value:"341523",label:"舒城县"},{value:"341524",label:"金寨县"},{value:"341525",label:"霍山县"}]},{value:"341600",label:"亳州市",children:[{value:"341602",label:"谯城区"},{value:"341621",label:"涡阳县"},{value:"341622",label:"蒙城县"},{value:"341623",label:"利辛县"}]},{value:"341700",label:"池州市",children:[{value:"341702",label:"贵池区"},{value:"341721",label:"东至县"},{value:"341722",label:"石台县"},{value:"341723",label:"青阳县"}]},{value:"341800",label:"宣城市",children:[{value:"341802",label:"宣州区"},{value:"341821",label:"郎溪县"},{value:"341822",label:"广德县"},{value:"341823",label:"泾县"},{value:"341824",label:"绩溪县"},{value:"341825",label:"旌德县"},{value:"341881",label:"宁国市"},{value:"341871",label:"宣城市经济开发区"}]}]},{value:'350000',label:'福建省',children:[{value:"350100",label:"福州市",children:[{value:"350102",label:"鼓楼区"},{value:"350103",label:"台江区"},{value:"350104",label:"仓山区"},{value:"350105",label:"马尾区"},{value:"350111",label:"晋安区"},{value:"350121",label:"闽侯县"},{value:"350122",label:"连江县"},{value:"350123",label:"罗源县"},{value:"350124",label:"闽清县"},{value:"350125",label:"永泰县"},{value:"350128",label:"平潭县"},{value:"350181",label:"福清市"},{value:"350182",label:"长乐市"}]},{value:"350200",label:"厦门市",children:[{value:"350203",label:"思明区"},{value:"350205",label:"海沧区"},{value:"350206",label:"湖里区"},{value:"350211",label:"集美区"},{value:"350212",label:"同安区"},{value:"350213",label:"翔安区"}]},{value:"350300",label:"莆田市",children:[{value:"350302",label:"城厢区"},{value:"350303",label:"涵江区"},{value:"350304",label:"荔城区"},{value:"350305",label:"秀屿区"},{value:"350322",label:"仙游县"}]},{value:"350400",label:"三明市",children:[{value:"350402",label:"梅列区"},{value:"350403",label:"三元区"},{value:"350421",label:"明溪县"},{value:"350423",label:"清流县"},{value:"350424",label:"宁化县"},{value:"350425",label:"大田县"},{value:"350426",label:"尤溪县"},{value:"350427",label:"沙县"},{value:"350428",label:"将乐县"},{value:"350429",label:"泰宁县"},{value:"350430",label:"建宁县"},{value:"350481",label:"永安市"}]},{value:"350500",label:"泉州市",children:[{value:"350502",label:"鲤城区"},{value:"350503",label:"丰泽区"},{value:"350504",label:"洛江区"},{value:"350505",label:"泉港区"},{value:"350521",label:"惠安县"},{value:"350524",label:"安溪县"},{value:"350525",label:"永春县"},{value:"350526",label:"德化县"},{value:"350527",label:"金门县"},{value:"350581",label:"石狮市"},{value:"350582",label:"晋江市"},{value:"350583",label:"南安市"}]},{value:"350600",label:"漳州市",children:[{value:"350602",label:"芗城区"},{value:"350603",label:"龙文区"},{value:"350622",label:"云霄县"},{value:"350623",label:"漳浦县"},{value:"350624",label:"诏安县"},{value:"350625",label:"长泰县"},{value:"350626",label:"东山县"},{value:"350627",label:"南靖县"},{value:"350628",label:"平和县"},{value:"350629",label:"华安县"},{value:"350681",label:"龙海市"}]},{value:"350700",label:"南平市",children:[{value:"350702",label:"延平区"},{value:"350721",label:"顺昌县"},{value:"350722",label:"浦城县"},{value:"350723",label:"光泽县"},{value:"350724",label:"松溪县"},{value:"350725",label:"政和县"},{value:"350781",label:"邵武市"},{value:"350782",label:"武夷山市"},{value:"350783",label:"建瓯市"},{value:"350703",label:"建阳区"}]},{value:"350800",label:"龙岩市",children:[{value:"350802",label:"新罗区"},{value:"350821",label:"长汀县"},{value:"350803",label:"永定区"},{value:"350823",label:"上杭县"},{value:"350824",label:"武平县"},{value:"350825",label:"连城县"},{value:"350881",label:"漳平市"}]},{value:"350900",label:"宁德市",children:[{value:"350902",label:"蕉城区"},{value:"350921",label:"霞浦县"},{value:"350922",label:"古田县"},{value:"350923",label:"屏南县"},{value:"350924",label:"寿宁县"},{value:"350925",label:"周宁县"},{value:"350926",label:"柘荣县"},{value:"350981",label:"福安市"},{value:"350982",label:"福鼎市"}]}]},{value:'360000',label:'江西省',children:[{value:"360100",label:"南昌市",children:[{value:"360102",label:"东湖区"},{value:"360103",label:"西湖区"},{value:"360104",label:"青云谱区"},{value:"360105",label:"湾里区"},{value:"360111",label:"青山湖区"},{value:"360121",label:"南昌县"},{value:"360112",label:"新建区"},{value:"360123",label:"安义县"},{value:"360124",label:"进贤县"}]},{value:"360200",label:"景德镇市",children:[{value:"360202",label:"昌江区"},{value:"360203",label:"珠山区"},{value:"360222",label:"浮梁县"},{value:"360281",label:"乐平市"}]},{value:"360300",label:"萍乡市",children:[{value:"360302",label:"安源区"},{value:"360313",label:"湘东区"},{value:"360321",label:"莲花县"},{value:"360322",label:"上栗县"},{value:"360323",label:"芦溪县"}]},{value:"360400",label:"九江市",children:[{value:"360402",label:"濂溪区"},{value:"360403",label:"浔阳区"},{value:"360404",label:"柴桑区"},{value:"360423",label:"武宁县"},{value:"360424",label:"修水县"},{value:"360425",label:"永修县"},{value:"360426",label:"德安县"},{value:"360428",label:"都昌县"},{value:"360429",label:"湖口县"},{value:"360430",label:"彭泽县"},{value:"360481",label:"瑞昌市"},{value:"360482",label:"共青城市"},{value:"360483",label:"庐山市"}]},{value:"360500",label:"新余市",children:[{value:"360502",label:"渝水区"},{value:"360521",label:"分宜县"}]},{value:"360600",label:"鹰潭市",children:[{value:"360602",label:"月湖区"},{value:"360622",label:"余江县"},{value:"360681",label:"贵溪市"}]},{value:"360700",label:"赣州市",children:[{value:"360702",label:"章贡区"},{value:"360704",label:"赣县区"},{value:"360722",label:"信丰县"},{value:"360723",label:"大余县"},{value:"360724",label:"上犹县"},{value:"360725",label:"崇义县"},{value:"360726",label:"安远县"},{value:"360727",label:"龙南县"},{value:"360728",label:"定南县"},{value:"360729",label:"全南县"},{value:"360730",label:"宁都县"},{value:"360731",label:"于都县"},{value:"360732",label:"兴国县"},{value:"360733",label:"会昌县"},{value:"360734",label:"寻乌县"},{value:"360735",label:"石城县"},{value:"360781",label:"瑞金市"},{value:"360703",label:"南康区"}]},{value:"360800",label:"吉安市",children:[{value:"360802",label:"吉州区"},{value:"360803",label:"青原区"},{value:"360821",label:"吉安县"},{value:"360822",label:"吉水县"},{value:"360823",label:"峡江县"},{value:"360824",label:"新干县"},{value:"360825",label:"永丰县"},{value:"360826",label:"泰和县"},{value:"360827",label:"遂川县"},{value:"360828",label:"万安县"},{value:"360829",label:"安福县"},{value:"360830",label:"永新县"},{value:"360881",label:"井冈山市"}]},{value:"360900",label:"宜春市",children:[{value:"360902",label:"袁州区"},{value:"360921",label:"奉新县"},{value:"360922",label:"万载县"},{value:"360923",label:"上高县"},{value:"360924",label:"宜丰县"},{value:"360925",label:"靖安县"},{value:"360926",label:"铜鼓县"},{value:"360981",label:"丰城市"},{value:"360982",label:"樟树市"},{value:"360983",label:"高安市"}]},{value:"361000",label:"抚州市",children:[{value:"361002",label:"临川区"},{value:"361021",label:"南城县"},{value:"361022",label:"黎川县"},{value:"361023",label:"南丰县"},{value:"361024",label:"崇仁县"},{value:"361025",label:"乐安县"},{value:"361026",label:"宜黄县"},{value:"361027",label:"金溪县"},{value:"361028",label:"资溪县"},{value:"361003",label:"东乡区"},{value:"361030",label:"广昌县"}]},{value:"361100",label:"上饶市",children:[{value:"361102",label:"信州区"},{value:"361121",label:"上饶县"},{value:"361103",label:"广丰区"},{value:"361123",label:"玉山县"},{value:"361124",label:"铅山县"},{value:"361125",label:"横峰县"},{value:"361126",label:"弋阳县"},{value:"361127",label:"余干县"},{value:"361128",label:"鄱阳县"},{value:"361129",label:"万年县"},{value:"361130",label:"婺源县"},{value:"361181",label:"德兴市"}]}]},{value:'370000',label:'山东省',children:[{value:"370100",label:"济南市",children:[{value:"370102",label:"历下区"},{value:"370103",label:"市中区"},{value:"370104",label:"槐荫区"},{value:"370105",label:"天桥区"},{value:"370112",label:"历城区"},{value:"370113",label:"长清区"},{value:"370124",label:"平阴县"},{value:"370125",label:"济阳县"},{value:"370126",label:"商河县"},{value:"370114",label:"章丘区"},{value:"370171",label:"济南高新技术产业开发区"}]},{value:"370200",label:"青岛市",children:[{value:"370202",label:"市南区"},{value:"370203",label:"市北区"},{value:"370211",label:"黄岛区"},{value:"370212",label:"崂山区"},{value:"370213",label:"李沧区"},{value:"370214",label:"城阳区"},{value:"370281",label:"胶州市"},{value:"370215",label:"即墨区"},{value:"370283",label:"平度市"},{value:"370285",label:"莱西市"},{value:"370271",label:"青岛高新技术产业开发区"}]},{value:"370300",label:"淄博市",children:[{value:"370302",label:"淄川区"},{value:"370303",label:"张店区"},{value:"370304",label:"博山区"},{value:"370305",label:"临淄区"},{value:"370306",label:"周村区"},{value:"370321",label:"桓台县"},{value:"370322",label:"高青县"},{value:"370323",label:"沂源县"}]},{value:"370400",label:"枣庄市",children:[{value:"370402",label:"市中区"},{value:"370403",label:"薛城区"},{value:"370404",label:"峄城区"},{value:"370405",label:"台儿庄区"},{value:"370406",label:"山亭区"},{value:"370481",label:"滕州市"}]},{value:"370500",label:"东营市",children:[{value:"370502",label:"东营区"},{value:"370503",label:"河口区"},{value:"370521",label:"垦利县"},{value:"370522",label:"利津县"},{value:"370523",label:"广饶县"},{value:"370589",label:"西城区"},{value:"370571",label:"东营经济技术开发区"},{value:"370572",label:"东营港经济开发区"}]},{value:"370600",label:"烟台市",children:[{value:"370602",label:"芝罘区"},{value:"370611",label:"福山区"},{value:"370612",label:"牟平区"},{value:"370613",label:"莱山区"},{value:"370634",label:"长岛县"},{value:"370681",label:"龙口市"},{value:"370682",label:"莱阳市"},{value:"370683",label:"莱州市"},{value:"370684",label:"蓬莱市"},{value:"370685",label:"招远市"},{value:"370686",label:"栖霞市"},{value:"370687",label:"海阳市"},{value:"370671",label:"烟台高新技术产业开发区"},{value:"370672",label:"烟台经济技术开发区"}]},{value:"370700",label:"潍坊市",children:[{value:"370702",label:"潍城区"},{value:"370703",label:"寒亭区"},{value:"370704",label:"坊子区"},{value:"370705",label:"奎文区"},{value:"370724",label:"临朐县"},{value:"370725",label:"昌乐县"},{value:"370772",label:"潍坊滨海经济技术开发区"},{value:"370781",label:"青州市"},{value:"370782",label:"诸城市"},{value:"370783",label:"寿光市"},{value:"370784",label:"安丘市"},{value:"370785",label:"高密市"},{value:"370786",label:"昌邑市"}]},{value:"370800",label:"济宁市",children:[{value:"370811",label:"任城区"},{value:"370826",label:"微山县"},{value:"370827",label:"鱼台县"},{value:"370828",label:"金乡县"},{value:"370829",label:"嘉祥县"},{value:"370830",label:"汶上县"},{value:"370831",label:"泗水县"},{value:"370832",label:"梁山县"},{value:"370881",label:"曲阜市"},{value:"370812",label:"兖州区"},{value:"370883",label:"邹城市"},{value:"370871",label:"济宁高新技术产业开发区"}]},{value:"370900",label:"泰安市",children:[{value:"370902",label:"泰山区"},{value:"370903",label:"岱岳区"},{value:"370921",label:"宁阳县"},{value:"370923",label:"东平县"},{value:"370982",label:"新泰市"},{value:"370983",label:"肥城市"}]},{value:"371000",label:"威海市",children:[{value:"371002",label:"环翠区"},{value:"371003",label:"文登区"},{value:"371082",label:"荣成市"},{value:"371083",label:"乳山市"},{value:"371071",label:"威海火炬高技术产业开发区"},{value:"371072",label:"威海经济技术开发区"},{value:"371073",label:"威海临港经济技术开发区"}]},{value:"371100",label:"日照市",children:[{value:"371102",label:"东港区"},{value:"371103",label:"岚山区"},{value:"371121",label:"五莲县"},{value:"371122",label:"莒县"},{value:"371171",label:"日照经济技术开发区"},{value:"371172",label:"日照国际海洋城"}]},{value:"371200",label:"莱芜市",children:[{value:"371202",label:"莱城区"},{value:"371203",label:"钢城区"}]},{value:"371300",label:"临沂市",children:[{value:"371302",label:"兰山区"},{value:"371311",label:"罗庄区"},{value:"371312",label:"河东区"},{value:"371321",label:"沂南县"},{value:"371322",label:"郯城县"},{value:"371323",label:"沂水县"},{value:"371324",label:"兰陵县"},{value:"371325",label:"费县"},{value:"371326",label:"平邑县"},{value:"371327",label:"莒南县"},{value:"371328",label:"蒙阴县"},{value:"371329",label:"临沭县"},{value:"371371",label:"临沂高新技术产业开发区"},{value:"371373",label:"临沂临港经济开发区"},{value:"371372",label:"临沂经济技术开发区"}]},{value:"371400",label:"德州市",children:[{value:"371402",label:"德城区"},{value:"371403",label:"陵城区"},{value:"371422",label:"宁津县"},{value:"371423",label:"庆云县"},{value:"371424",label:"临邑县"},{value:"371425",label:"齐河县"},{value:"371426",label:"平原县"},{value:"371427",label:"夏津县"},{value:"371428",label:"武城县"},{value:"371481",label:"乐陵市"},{value:"371482",label:"禹城市"},{value:"371471",label:"德州经济技术开发区"},{value:"371472",label:"德州运河经济开发区"}]},{value:"371500",label:"聊城市",children:[{value:"371502",label:"东昌府区"},{value:"371521",label:"阳谷县"},{value:"371522",label:"莘县"},{value:"371523",label:"茌平县"},{value:"371524",label:"东阿县"},{value:"371525",label:"冠县"},{value:"371526",label:"高唐县"},{value:"371581",label:"临清市"}]},{value:"371600",label:"滨州市",children:[{value:"371602",label:"滨城区"},{value:"371621",label:"惠民县"},{value:"371622",label:"阳信县"},{value:"371623",label:"无棣县"},{value:"371603",label:"沾化区"},{value:"371625",label:"博兴县"},{value:"371626",label:"邹平县"}]},{value:"371700",label:"菏泽市",children:[{value:"371702",label:"牡丹区"},{value:"371721",label:"曹县"},{value:"371722",label:"单县"},{value:"371723",label:"成武县"},{value:"371724",label:"巨野县"},{value:"371725",label:"郓城县"},{value:"371726",label:"鄄城县"},{value:"371727",label:"定陶区"},{value:"371728",label:"东明县"},{value:"371771",label:"菏泽经济技术开发区"},{value:"371772",label:"菏泽高新技术开发区"}]}]},{value:'410000',label:'河南省',children:[{value:"410100",label:"郑州市",children:[{value:"410102",label:"中原区"},{value:"410103",label:"二七区"},{value:"410104",label:"管城回族区"},{value:"410105",label:"金水区"},{value:"410106",label:"上街区"},{value:"410108",label:"惠济区"},{value:"410122",label:"中牟县"},{value:"410181",label:"巩义市"},{value:"410182",label:"荥阳市"},{value:"410183",label:"新密市"},{value:"410184",label:"新郑市"},{value:"410185",label:"登封市"},{value:"410171",label:"郑州经济技术开发区"},{value:"410172",label:"郑州高新技术产业开发区"},{value:"410173",label:"郑州航空港经济综合实验区"}]},{value:"410200",label:"开封市",children:[{value:"410202",label:"龙亭区"},{value:"410203",label:"顺河回族区"},{value:"410204",label:"鼓楼区"},{value:"410205",label:"禹王台区"},{value:"410211",label:"金明区"},{value:"410221",label:"杞县"},{value:"410222",label:"通许县"},{value:"410223",label:"尉氏县"},{value:"410225",label:"兰考县"},{value:"410212",label:"祥符区"}]},{value:"410300",label:"洛阳市",children:[{value:"410302",label:"老城区"},{value:"410303",label:"西工区"},{value:"410304",label:"廛河回族区"},{value:"410305",label:"涧西区"},{value:"410306",label:"吉利区"},{value:"410307",label:"洛龙区"},{value:"410322",label:"孟津县"},{value:"410323",label:"新安县"},{value:"410324",label:"栾川县"},{value:"410325",label:"嵩县"},{value:"410326",label:"汝阳县"},{value:"410327",label:"宜阳县"},{value:"410328",label:"洛宁县"},{value:"410329",label:"伊川县"},{value:"410381",label:"偃师市"},{value:"410371",label:"洛阳高新技术产业开发区"},{value:"471005",label:"其它区"}]},{value:"410400",label:"平顶山市",children:[{value:"410402",label:"新华区"},{value:"410403",label:"卫东区"},{value:"410404",label:"石龙区"},{value:"410411",label:"湛河区"},{value:"410421",label:"宝丰县"},{value:"410422",label:"叶县"},{value:"410423",label:"鲁山县"},{value:"410425",label:"郏县"},{value:"410481",label:"舞钢市"},{value:"410482",label:"汝州市"},{value:"410471",label:"平顶山高新技术产业开发区"},{value:"410472",label:"平顶山市新城区"}]},{value:"410500",label:"安阳市",children:[{value:"410502",label:"文峰区"},{value:"410503",label:"北关区"},{value:"410505",label:"殷都区"},{value:"410506",label:"龙安区"},{value:"410522",label:"安阳县"},{value:"410523",label:"汤阴县"},{value:"410526",label:"滑县"},{value:"410527",label:"内黄县"},{value:"410581",label:"林州市"},{value:"410571",label:"安阳高新技术产业开发区"}]},{value:"410600",label:"鹤壁市",children:[{value:"410602",label:"鹤山区"},{value:"410603",label:"山城区"},{value:"410611",label:"淇滨区"},{value:"410621",label:"浚县"},{value:"410622",label:"淇县"},{value:"410671",label:"鹤壁经济技术开发区"}]},{value:"410700",label:"新乡市",children:[{value:"410702",label:"红旗区"},{value:"410703",label:"卫滨区"},{value:"410704",label:"凤泉区"},{value:"410711",label:"牧野区"},{value:"410721",label:"新乡县"},{value:"410724",label:"获嘉县"},{value:"410725",label:"原阳县"},{value:"410726",label:"延津县"},{value:"410727",label:"封丘县"},{value:"410728",label:"长垣县"},{value:"410781",label:"卫辉市"},{value:"410782",label:"辉县市"},{value:"410771",label:"新乡高新技术产业开发区"},{value:"410773",label:"新乡市平原城乡一体化示范区"},{value:"410772",label:"新乡经济技术开发区"}]},{value:"410800",label:"焦作市",children:[{value:"410802",label:"解放区"},{value:"410803",label:"中站区"},{value:"410804",label:"马村区"},{value:"410811",label:"山阳区"},{value:"410821",label:"修武县"},{value:"410822",label:"博爱县"},{value:"410823",label:"武陟县"},{value:"410825",label:"温县"},{value:"410882",label:"沁阳市"},{value:"410883",label:"孟州市"},{value:"410871",label:"焦作城乡一体化示范区"}]},{value:"410900",label:"濮阳市",children:[{value:"410902",label:"华龙区"},{value:"410922",label:"清丰县"},{value:"410923",label:"南乐县"},{value:"410926",label:"范县"},{value:"410927",label:"台前县"},{value:"410928",label:"濮阳县"},{value:"410971",label:"河南濮阳工业园区"},{value:"410972",label:"濮阳经济技术开发区"}]},{value:"411000",label:"许昌市",children:[{value:"411002",label:"魏都区"},{value:"411003",label:"建安区"},{value:"411024",label:"鄢陵县"},{value:"411025",label:"襄城县"},{value:"411081",label:"禹州市"},{value:"411082",label:"长葛市"},{value:"411071",label:"许昌经济技术开发区"}]},{value:"411100",label:"漯河市",children:[{value:"411102",label:"源汇区"},{value:"411103",label:"郾城区"},{value:"411104",label:"召陵区"},{value:"411121",label:"舞阳县"},{value:"411122",label:"临颍县"},{value:"411171",label:"漯河经济技术开发区"}]},{value:"411200",label:"三门峡市",children:[{value:"411202",label:"湖滨区"},{value:"411221",label:"渑池县"},{value:"411222",label:"陕县"},{value:"411224",label:"卢氏县"},{value:"411281",label:"义马市"},{value:"411282",label:"灵宝市"},{value:"411203",label:"陕州区"},{value:"411271",label:"河南三门峡经济开发区"}]},{value:"411300",label:"南阳市",children:[{value:"411302",label:"宛城区"},{value:"411303",label:"卧龙区"},{value:"411321",label:"南召县"},{value:"411322",label:"方城县"},{value:"411323",label:"西峡县"},{value:"411324",label:"镇平县"},{value:"411325",label:"内乡县"},{value:"411326",label:"淅川县"},{value:"411327",label:"社旗县"},{value:"411328",label:"唐河县"},{value:"411329",label:"新野县"},{value:"411330",label:"桐柏县"},{value:"411381",label:"邓州市"},{value:"411371",label:"南阳高新技术产业开发区"},{value:"411372",label:"南阳市城乡一体化示范区"}]},{value:"411400",label:"商丘市",children:[{value:"411402",label:"梁园区"},{value:"411403",label:"睢阳区"},{value:"411421",label:"民权县"},{value:"411422",label:"睢县"},{value:"411423",label:"宁陵县"},{value:"411424",label:"柘城县"},{value:"411425",label:"虞城县"},{value:"411426",label:"夏邑县"},{value:"411481",label:"永城市"},{value:"411471",label:"豫东综合物流产业聚集区"},{value:"411472",label:"河南商丘经济开发"}]},{value:"411500",label:"信阳市",children:[{value:"411502",label:"浉河区"},{value:"411503",label:"平桥区"},{value:"411521",label:"罗山县"},{value:"411522",label:"光山县"},{value:"411523",label:"新县"},{value:"411524",label:"商城县"},{value:"411525",label:"固始县"},{value:"411526",label:"潢川县"},{value:"411527",label:"淮滨县"},{value:"411528",label:"息县"},{value:"411571",label:"信阳高新技术产业开发区"}]},{value:"411600",label:"周口市",children:[{value:"411602",label:"川汇区"},{value:"411621",label:"扶沟县"},{value:"411622",label:"西华县"},{value:"411623",label:"商水县"},{value:"411624",label:"沈丘县"},{value:"411625",label:"郸城县"},{value:"411626",label:"淮阳县"},{value:"411627",label:"太康县"},{value:"411628",label:"鹿邑县"},{value:"411681",label:"项城市"},{value:"411671",label:"河南周口经济开发区"}]},{value:"411700",label:"驻马店市",children:[{value:"411702",label:"驿城区"},{value:"411721",label:"西平县"},{value:"411722",label:"上蔡县"},{value:"411723",label:"平舆县"},{value:"411724",label:"正阳县"},{value:"411725",label:"确山县"},{value:"411726",label:"泌阳县"},{value:"411727",label:"汝南县"},{value:"411628",label:"遂平县"},{value:"411729",label:"新蔡县"},{value:"411771",label:"河南驻马店经济开发区"}]}]},{value:'420000',label:'湖北省',children:[{value:"420100",label:"武汉市",children:[{value:"420101",label:"市辖区"},{value:"420102",label:"江岸区"},{value:"420103",label:"江汉区"},{value:"420104",label:"硚口区"},{value:"420105",label:"汉阳区"},{value:"420106",label:"武昌区"},{value:"420107",label:"青山区"},{value:"420111",label:"洪山区"},{value:"420112",label:"东西湖区"},{value:"420113",label:"汉南区"},{value:"420114",label:"蔡甸区"},{value:"420115",label:"江夏区"},{value:"420116",label:"黄陂区"},{value:"420117",label:"新洲区"}]},{value:"420200",label:"黄石市",children:[{value:"420201",label:"市辖区"},{value:"420202",label:"黄石港区"},{value:"420203",label:"西塞山区"},{value:"420204",label:"下陆区"},{value:"420205",label:"铁山区"},{value:"420222",label:"阳新县"},{value:"420281",label:"大冶市"}]},{value:"420300",label:"十堰市",children:[{value:"420301",label:"市辖区"},{value:"420302",label:"茅箭区"},{value:"420303",label:"张湾区"},{value:"420304",label:"郧阳区"},{value:"420322",label:"郧西县"},{value:"420323",label:"竹山县"},{value:"420324",label:"竹溪县"},{value:"420325",label:"房县"},{value:"420381",label:"丹江口市"}]},{value:"420500",label:"宜昌市",children:[{value:"420501",label:"市辖区"},{value:"420502",label:"西陵区"},{value:"420503",label:"伍家岗区"},{value:"420504",label:"点军区"},{value:"420505",label:"猇亭区"},{value:"420506",label:"夷陵区"},{value:"420525",label:"远安县"},{value:"420526",label:"兴山县"},{value:"420527",label:"秭归县"},{value:"420528",label:"长阳土家族自治县"},{value:"420529",label:"五峰土家族自治县"},{value:"420581",label:"宜都市"},{value:"420582",label:"当阳市"},{value:"420583",label:"枝江市"}]},{value:"420600",label:"襄阳市",children:[{value:"420601",label:"市辖区"},{value:"420602",label:"襄城区"},{value:"420606",label:"樊城区"},{value:"420607",label:"襄州区"},{value:"420624",label:"南漳县"},{value:"420625",label:"谷城县"},{value:"420626",label:"保康县"},{value:"420682",label:"老河口市"},{value:"420683",label:"枣阳市"},{value:"420684",label:"宜城市"}]},{value:"420700",label:"鄂州市",children:[{value:"420701",label:"市辖区"},{value:"420702",label:"梁子湖区"},{value:"420703",label:"华容区"},{value:"420704",label:"鄂城区"}]},{value:"420800",label:"荆门市",children:[{value:"420801",label:"市辖区"},{value:"420802",label:"东宝区"},{value:"420804",label:"掇刀区"},{value:"420821",label:"京山县"},{value:"420822",label:"沙洋县"},{value:"420881",label:"钟祥市"}]},{value:"420900",label:"孝感市",children:[{value:"420901",label:"市辖区"},{value:"420902",label:"孝南区"},{value:"420921",label:"孝昌县"},{value:"420922",label:"大悟县"},{value:"420923",label:"云梦县"},{value:"420981",label:"应城市"},{value:"420982",label:"安陆市"},{value:"420984",label:"汉川市"}]},{value:"421000",label:"荆州市",children:[{value:"421001",label:"市辖区"},{value:"421002",label:"沙市区"},{value:"421003",label:"荆州区"},{value:"421022",label:"公安县"},{value:"421023",label:"监利县"},{value:"421024",label:"江陵县"},{value:"421071",label:"荆州经济技术开发区"},{value:"421081",label:"石首市"},{value:"421083",label:"洪湖市"},{value:"421087",label:"松滋市"}]},{value:"421100",label:"黄冈市",children:[{value:"421101",label:"市辖区"},{value:"421102",label:"黄州区"},{value:"421121",label:"团风县"},{value:"421122",label:"红安县"},{value:"421123",label:"罗田县"},{value:"421124",label:"英山县"},{value:"421125",label:"浠水县"},{value:"421126",label:"蕲春县"},{value:"421127",label:"黄梅县"},{value:"421171",label:"龙感湖管理区"},{value:"421181",label:"麻城市"},{value:"421182",label:"武穴市"}]},{value:"421200",label:"咸宁市",children:[{value:"421201",label:"市辖区"},{value:"421202",label:"咸安区"},{value:"421221",label:"嘉鱼县"},{value:"421222",label:"通城县"},{value:"421223",label:"崇阳县"},{value:"421224",label:"通山县"},{value:"421281",label:"赤壁市"}]},{value:"421300",label:"随州市",children:[{value:"421301",label:"市辖区"},{value:"421303",label:"曾都区"},{value:"421321",label:"随县"},{value:"421381",label:"广水市"}]},{value:"422800",label:"恩施土家族苗族自治州",children:[{value:"422801",label:"恩施市"},{value:"422802",label:"利川市"},{value:"422822",label:"建始县"},{value:"422823",label:"巴东县"},{value:"422825",label:"宣恩县"},{value:"422826",label:"咸丰县"},{value:"422827",label:"来凤县"},{value:"422828",label:"鹤峰县"}]},{value:"429000",label:"省直辖县级行政区划",children:[{value:"429004",label:"仙桃市"},{value:"429005",label:"潜江市"},{value:"429006",label:"天门市"},{value:"429021",label:"神农架林区"}]}]},{value:'430000',label:'湖南省',children:[{value:"430100",label:"长沙市",children:[{value:"430101",label:"市辖区"},{value:"430102",label:"芙蓉区"},{value:"430103",label:"天心区"},{value:"430104",label:"岳麓区"},{value:"430105",label:"开福区"},{value:"430111",label:"雨花区"},{value:"430112",label:"望城区"},{value:"430121",label:"长沙县"},{value:"430181",label:"浏阳市"},{value:"430182",label:"宁乡市"}]},{value:"430200",label:"株洲市",children:[{value:"430201",label:"市辖区"},{value:"430202",label:"荷塘区"},{value:"430203",label:"芦淞区"},{value:"430204",label:"石峰区"},{value:"430211",label:"天元区"},{value:"430221",label:"株洲县"},{value:"430223",label:"攸县"},{value:"430224",label:"茶陵县"},{value:"430225",label:"炎陵县"},{value:"430271",label:"云龙示范区"},{value:"430281",label:"醴陵市"}]},{value:"430300",label:"湘潭市",children:[{value:"430301",label:"市辖区"},{value:"430302",label:"雨湖区"},{value:"430304",label:"岳塘区"},{value:"430321",label:"湘潭县"},{value:"430371",label:"湖南湘潭高新技术产业园区"},{value:"430372",label:"湘潭昭山示范区"},{value:"430373",label:"湘潭九华示范区"},{value:"430381",label:"湘乡市"},{value:"430382",label:"韶山市"}]},{value:"430400",label:"衡阳市",children:[{value:"430401",label:"市辖区"},{value:"430405",label:"珠晖区"},{value:"430406",label:"雁峰区"},{value:"430407",label:"石鼓区"},{value:"430408",label:"蒸湘区"},{value:"430412",label:"南岳区"},{value:"430421",label:"衡阳县"},{value:"430422",label:"衡南县"},{value:"430423",label:"衡山县"},{value:"430424",label:"衡东县"},{value:"430426",label:"祁东县"},{value:"430471",label:"衡阳综合保税区"},{value:"430472",label:"湖南衡阳高新技术产业园区"},{value:"430473",label:"湖南衡阳松木经济开发区"},{value:"430481",label:"耒阳市"},{value:"430482",label:"常宁市"}]},{value:"430500",label:"邵阳市",children:[{value:"430501",label:"市辖区"},{value:"430502",label:"双清区"},{value:"430503",label:"大祥区"},{value:"430511",label:"北塔区"},{value:"430521",label:"邵东县"},{value:"430522",label:"新邵县"},{value:"430523",label:"邵阳县"},{value:"430524",label:"隆回县"},{value:"430525",label:"洞口县"},{value:"430527",label:"绥宁县"},{value:"430528",label:"新宁县"},{value:"430529",label:"城步苗族自治县"},{value:"430581",label:"武冈市"}]},{value:"430600",label:"岳阳市",children:[{value:"430601",label:"市辖区"},{value:"430602",label:"岳阳楼区"},{value:"430603",label:"云溪区"},{value:"430611",label:"君山区"},{value:"430621",label:"岳阳县"},{value:"430623",label:"华容县"},{value:"430624",label:"湘阴县"},{value:"430626",label:"平江县"},{value:"430671",label:"岳阳市屈原管理区"},{value:"430681",label:"汨罗市"},{value:"430682",label:"临湘市"}]},{value:"430700",label:"常德市",children:[{value:"430701",label:"市辖区"},{value:"430702",label:"武陵区"},{value:"430703",label:"鼎城区"},{value:"430721",label:"安乡县"},{value:"430722",label:"汉寿县"},{value:"430723",label:"澧县"},{value:"430724",label:"临澧县"},{value:"430725",label:"桃源县"},{value:"430726",label:"石门县"},{value:"430771",label:"常德市西洞庭管理区"},{value:"430781",label:"津市市"}]},{value:"430800",label:"张家界市",children:[{value:"430801",label:"市辖区"},{value:"430802",label:"永定区"},{value:"430811",label:"武陵源区"},{value:"430821",label:"慈利县"},{value:"430822",label:"桑植县"}]},{value:"430900",label:"益阳市",children:[{value:"430901",label:"市辖区"},{value:"430902",label:"资阳区"},{value:"430903",label:"赫山区"},{value:"430921",label:"南县"},{value:"430922",label:"桃江县"},{value:"430923",label:"安化县"},{value:"430971",label:"益阳市大通湖管理区"},{value:"430972",label:"湖南益阳高新技术产业园区"},{value:"430981",label:"沅江市"}]},{value:"431000",label:"郴州市",children:[{value:"431001",label:"市辖区"},{value:"431002",label:"北湖区"},{value:"431003",label:"苏仙区"},{value:"431021",label:"桂阳县"},{value:"431022",label:"宜章县"},{value:"431023",label:"永兴县"},{value:"431024",label:"嘉禾县"},{value:"431025",label:"临武县"},{value:"431026",label:"汝城县"},{value:"431027",label:"桂东县"},{value:"431028",label:"安仁县"},{value:"431081",label:"资兴市"}]},{value:"431100",label:"永州市",children:[{value:"431101",label:"市辖区"},{value:"431102",label:"零陵区"},{value:"431103",label:"冷水滩区"},{value:"431121",label:"祁阳县"},{value:"431122",label:"东安县"},{value:"431123",label:"双牌县"},{value:"431124",label:"道县"},{value:"431125",label:"江永县"},{value:"431126",label:"宁远县"},{value:"431127",label:"蓝山县"},{value:"431128",label:"新田县"},{value:"431129",label:"江华瑶族自治县"},{value:"431171",label:"永州经济技术开发区"},{value:"431172",label:"永州市金洞管理区"},{value:"431173",label:"永州市回龙圩管理区"}]},{value:"431200",label:"怀化市",children:[{value:"431201",label:"市辖区"},{value:"431202",label:"鹤城区"},{value:"431221",label:"中方县"},{value:"431222",label:"沅陵县"},{value:"431223",label:"辰溪县"},{value:"431224",label:"溆浦县"},{value:"431225",label:"会同县"},{value:"431226",label:"麻阳苗族自治县"},{value:"431227",label:"新晃侗族自治县"},{value:"431228",label:"芷江侗族自治县"},{value:"431229",label:"靖州苗族侗族自治县"},{value:"431230",label:"通道侗族自治县"},{value:"431271",label:"怀化市洪江管理区"},{value:"431281",label:"洪江市"}]},{value:"431300",label:"娄底市",children:[{value:"431301",label:"市辖区"},{value:"431302",label:"娄星区"},{value:"431321",label:"双峰县"},{value:"431322",label:"新化县"},{value:"431381",label:"冷水江市"},{value:"431382",label:"涟源市"}]},{value:"433100",label:"湘西土家族苗族自治州",children:[{value:"433101",label:"吉首市"},{value:"433122",label:"泸溪县"},{value:"433123",label:"凤凰县"},{value:"433124",label:"花垣县"},{value:"433125",label:"保靖县"},{value:"433126",label:"古丈县"},{value:"433127",label:"永顺县"},{value:"433130",label:"龙山县"},{value:"433172",label:"湖南吉首经济开发区"},{value:"433173",label:"湖南永顺经济开发区"}]}]},{value:'440000',label:'广东省',children:[{value:"440100",label:"广州市",children:[{value:"440101",label:"市辖区"},{value:"440103",label:"荔湾区"},{value:"440104",label:"越秀区"},{value:"440105",label:"海珠区"},{value:"440106",label:"天河区"},{value:"440111",label:"白云区"},{value:"440112",label:"黄埔区"},{value:"440113",label:"番禺区"},{value:"440114",label:"花都区"},{value:"440115",label:"南沙区"},{value:"440117",label:"从化区"},{value:"440118",label:"增城区"}]},{value:"440200",label:"韶关市",children:[{value:"440201",label:"市辖区"},{value:"440203",label:"武江区"},{value:"440204",label:"浈江区"},{value:"440205",label:"曲江区"},{value:"440222",label:"始兴县"},{value:"440224",label:"仁化县"},{value:"440229",label:"翁源县"},{value:"440232",label:"乳源瑶族自治县"},{value:"440233",label:"新丰县"},{value:"440281",label:"乐昌市"},{value:"440282",label:"南雄市"}]},{value:"440300",label:"深圳市",children:[{value:"440301",label:"市辖区"},{value:"440303",label:"罗湖区"},{value:"440304",label:"福田区"},{value:"440305",label:"南山区"},{value:"440306",label:"宝安区"},{value:"440307",label:"龙岗区"},{value:"440308",label:"盐田区"},{value:"440309",label:"龙华区"},{value:"440310",label:"坪山区"}]},{value:"440400",label:"珠海市",children:[{value:"440401",label:"市辖区"},{value:"440402",label:"香洲区"},{value:"440403",label:"斗门区"},{value:"440404",label:"金湾区"}]},{value:"440500",label:"汕头市",children:[{value:"440501",label:"市辖区"},{value:"440507",label:"龙湖区"},{value:"440511",label:"金平区"},{value:"440512",label:"濠江区"},{value:"440513",label:"潮阳区"},{value:"440514",label:"潮南区"},{value:"440515",label:"澄海区"},{value:"440523",label:"南澳县"}]},{value:"440600",label:"佛山市",children:[{value:"440601",label:"市辖区"},{value:"440604",label:"禅城区"},{value:"440605",label:"南海区"},{value:"440606",label:"顺德区"},{value:"440607",label:"三水区"},{value:"440608",label:"高明区"}]},{value:"440700",label:"江门市",children:[{value:"440701",label:"市辖区"},{value:"440703",label:"蓬江区"},{value:"440704",label:"江海区"},{value:"440705",label:"新会区"},{value:"440781",label:"台山市"},{value:"440783",label:"开平市"},{value:"440784",label:"鹤山市"},{value:"440785",label:"恩平市"}]},{value:"440800",label:"湛江市",children:[{value:"440801",label:"市辖区"},{value:"440802",label:"赤坎区"},{value:"440803",label:"霞山区"},{value:"440804",label:"坡头区"},{value:"440811",label:"麻章区"},{value:"440823",label:"遂溪县"},{value:"440825",label:"徐闻县"},{value:"440881",label:"廉江市"},{value:"440882",label:"雷州市"},{value:"440883",label:"吴川市"}]},{value:"440900",label:"茂名市",children:[{value:"440901",label:"市辖区"},{value:"440902",label:"茂南区"},{value:"440904",label:"电白区"},{value:"440981",label:"高州市"},{value:"440982",label:"化州市"},{value:"440983",label:"信宜市"}]},{value:"441200",label:"肇庆市",children:[{value:"441201",label:"市辖区"},{value:"441202",label:"端州区"},{value:"441203",label:"鼎湖区"},{value:"441204",label:"高要区"},{value:"441223",label:"广宁县"},{value:"441224",label:"怀集县"},{value:"441225",label:"封开县"},{value:"441226",label:"德庆县"},{value:"441284",label:"四会市"}]},{value:"441300",label:"惠州市",children:[{value:"441301",label:"市辖区"},{value:"441302",label:"惠城区"},{value:"441303",label:"惠阳区"},{value:"441322",label:"博罗县"},{value:"441323",label:"惠东县"},{value:"441324",label:"龙门县"}]},{value:"441400",label:"梅州市",children:[{value:"441401",label:"市辖区"},{value:"441402",label:"梅江区"},{value:"441403",label:"梅县区"},{value:"441422",label:"大埔县"},{value:"441423",label:"丰顺县"},{value:"441424",label:"五华县"},{value:"441426",label:"平远县"},{value:"441427",label:"蕉岭县"},{value:"441481",label:"兴宁市"}]},{value:"441500",label:"汕尾市",children:[{value:"441501",label:"市辖区"},{value:"441502",label:"城区"},{value:"441521",label:"海丰县"},{value:"441523",label:"陆河县"},{value:"441581",label:"陆丰市"}]},{value:"441600",label:"河源市",children:[{value:"441601",label:"市辖区"},{value:"441602",label:"源城区"},{value:"441621",label:"紫金县"},{value:"441622",label:"龙川县"},{value:"441623",label:"连平县"},{value:"441624",label:"和平县"},{value:"441625",label:"东源县"}]},{value:"441700",label:"阳江市",children:[{value:"441701",label:"市辖区"},{value:"441702",label:"江城区"},{value:"441704",label:"阳东区"},{value:"441721",label:"阳西县"},{value:"441781",label:"阳春市"}]},{value:"441800",label:"清远市",children:[{value:"441801",label:"市辖区"},{value:"441802",label:"清城区"},{value:"441803",label:"清新区"},{value:"441821",label:"佛冈县"},{value:"441823",label:"阳山县"},{value:"441825",label:"连山壮族瑶族自治县"},{value:"441826",label:"连南瑶族自治县"},{value:"441881",label:"英德市"},{value:"441882",label:"连州市"}]},{value:"441900",label:"东莞市"},{value:"442000",label:"中山市"},{value:"445100",label:"潮州市",children:[{value:"445101",label:"市辖区"},{value:"445102",label:"湘桥区"},{value:"445103",label:"潮安区"},{value:"445122",label:"饶平县"}]},{value:"445200",label:"揭阳市",children:[{value:"445201",label:"市辖区"},{value:"445202",label:"榕城区"},{value:"445203",label:"揭东区"},{value:"445222",label:"揭西县"},{value:"445224",label:"惠来县"},{value:"445281",label:"普宁市"}]},{value:"445300",label:"云浮市",children:[{value:"445301",label:"市辖区"},{value:"445302",label:"云城区"},{value:"445303",label:"云安区"},{value:"445321",label:"新兴县"},{value:"445322",label:"郁南县"},{value:"445381",label:"罗定市"}]}]},{value:'450000',label:'广西壮族',children:[{value:"450100",label:"南宁市",children:[{value:"450101",label:"市辖区"},{value:"450102",label:"兴宁区"},{value:"450103",label:"青秀区"},{value:"450105",label:"江南区"},{value:"450107",label:"西乡塘区"},{value:"450108",label:"良庆区"},{value:"450109",label:"邕宁区"},{value:"450110",label:"武鸣区"},{value:"450123",label:"隆安县"},{value:"450124",label:"马山县"},{value:"450125",label:"上林县"},{value:"450126",label:"宾阳县"},{value:"450127",label:"横县"}]},{value:"450200",label:"柳州市",children:[{value:"450201",label:"市辖区"},{value:"450202",label:"城中区"},{value:"450203",label:"鱼峰区"},{value:"450204",label:"柳南区"},{value:"450205",label:"柳北区"},{value:"450206",label:"柳江区"},{value:"450222",label:"柳城县"},{value:"450223",label:"鹿寨县"},{value:"450224",label:"融安县"},{value:"450225",label:"融水苗族自治县"},{value:"450226",label:"三江侗族自治县"}]},{value:"450300",label:"桂林市",children:[{value:"450301",label:"市辖区"},{value:"450302",label:"秀峰区"},{value:"450303",label:"叠彩区"},{value:"450304",label:"象山区"},{value:"450305",label:"七星区"},{value:"450311",label:"雁山区"},{value:"450312",label:"临桂区"},{value:"450321",label:"阳朔县"},{value:"450323",label:"灵川县"},{value:"450324",label:"全州县"},{value:"450325",label:"兴安县"},{value:"450326",label:"永福县"},{value:"450327",label:"灌阳县"},{value:"450328",label:"龙胜各族自治县"},{value:"450329",label:"资源县"},{value:"450330",label:"平乐县"},{value:"450331",label:"荔浦县"},{value:"450332",label:"恭城瑶族自治县"}]},{value:"450400",label:"梧州市",children:[{value:"450401",label:"市辖区"},{value:"450403",label:"万秀区"},{value:"450405",label:"长洲区"},{value:"450406",label:"龙圩区"},{value:"450421",label:"苍梧县"},{value:"450422",label:"藤县"},{value:"450423",label:"蒙山县"},{value:"450481",label:"岑溪市"}]},{value:"450500",label:"北海市",children:[{value:"450501",label:"市辖区"},{value:"450502",label:"海城区"},{value:"450503",label:"银海区"},{value:"450512",label:"铁山港区"},{value:"450521",label:"合浦县"}]},{value:"450600",label:"防城港市",children:[{value:"450601",label:"市辖区"},{value:"450602",label:"港口区"},{value:"450603",label:"防城区"},{value:"450621",label:"上思县"},{value:"450681",label:"东兴市"}]},{value:"450700",label:"钦州市",children:[{value:"450701",label:"市辖区"},{value:"450702",label:"钦南区"},{value:"450703",label:"钦北区"},{value:"450721",label:"灵山县"},{value:"450722",label:"浦北县"}]},{value:"450800",label:"贵港市",children:[{value:"450801",label:"市辖区"},{value:"450802",label:"港北区"},{value:"450803",label:"港南区"},{value:"450804",label:"覃塘区"},{value:"450821",label:"平南县"},{value:"450881",label:"桂平市"}]},{value:"450900",label:"玉林市",children:[{value:"450901",label:"市辖区"},{value:"450902",label:"玉州区"},{value:"450903",label:"福绵区"},{value:"450921",label:"容县"},{value:"450922",label:"陆川县"},{value:"450923",label:"博白县"},{value:"450924",label:"兴业县"},{value:"450981",label:"北流市"}]},{value:"451000",label:"百色市",children:[{value:"451001",label:"市辖区"},{value:"451002",label:"右江区"},{value:"451021",label:"田阳县"},{value:"451022",label:"田东县"},{value:"451023",label:"平果县"},{value:"451024",label:"德保县"},{value:"451026",label:"那坡县"},{value:"451027",label:"凌云县"},{value:"451028",label:"乐业县"},{value:"451029",label:"田林县"},{value:"451030",label:"西林县"},{value:"451031",label:"隆林各族自治县"},{value:"451081",label:"靖西市"}]},{value:"451100",label:"贺州市",children:[{value:"451101",label:"市辖区"},{value:"451102",label:"八步区"},{value:"451103",label:"平桂区"},{value:"451121",label:"昭平县"},{value:"451122",label:"钟山县"},{value:"451123",label:"富川瑶族自治县"}]},{value:"451200",label:"河池市",children:[{value:"451201",label:"市辖区"},{value:"451202",label:"金城江区"},{value:"451203",label:"宜州区"},{value:"451221",label:"南丹县"},{value:"451222",label:"天峨县"},{value:"451223",label:"凤山县"},{value:"451224",label:"东兰县"},{value:"451225",label:"罗城仫佬族自治县"},{value:"451226",label:"环江毛南族自治县"},{value:"451227",label:"巴马瑶族自治县"},{value:"451228",label:"都安瑶族自治县"},{value:"451229",label:"大化瑶族自治县"}]},{value:"451300",label:"来宾市",children:[{value:"451301",label:"市辖区"},{value:"451302",label:"兴宾区"},{value:"451321",label:"忻城县"},{value:"451322",label:"象州县"},{value:"451323",label:"武宣县"},{value:"451324",label:"金秀瑶族自治县"},{value:"451381",label:"合山市"}]},{value:"451400",label:"崇左市",children:[{value:"451401",label:"市辖区"},{value:"451402",label:"江州区"},{value:"451421",label:"扶绥县"},{value:"451422",label:"宁明县"},{value:"451423",label:"龙州县"},{value:"451424",label:"大新县"},{value:"451425",label:"天等县"},{value:"451481",label:"凭祥市"}]}]},{value:'460000',label:'海南省',children:[{value:"460100",label:"海口市",children:[{value:"460101",label:"市辖区"},{value:"460105",label:"秀英区"},{value:"460106",label:"龙华区"},{value:"460107",label:"琼山区"},{value:"460108",label:"美兰区"}]},{value:"460200",label:"三亚市",children:[{value:"460201",label:"市辖区"},{value:"460202",label:"海棠区"},{value:"460203",label:"吉阳区"},{value:"460204",label:"天涯区"},{value:"460205",label:"崖州区"}]},{value:"460300",label:"三沙市",children:[{value:"460321",label:"西沙群岛"},{value:"460322",label:"南沙群岛"},{value:"460323",label:"中沙群岛的岛礁及其海域"}]},{value:"460400",label:"儋州市"},{value:"469000",label:"省直辖县级行政区划",children:[{value:"469001",label:"五指山市"},{value:"469002",label:"琼海市"},{value:"469005",label:"文昌市"},{value:"469006",label:"万宁市"},{value:"469007",label:"东方市"},{value:"469021",label:"定安县"},{value:"469022",label:"屯昌县"},{value:"469023",label:"澄迈县"},{value:"469024",label:"临高县"},{value:"469025",label:"白沙黎族自治县"},{value:"469026",label:"昌江黎族自治县"},{value:"469027",label:"乐东黎族自治县"},{value:"469028",label:"陵水黎族自治县"},{value:"469029",label:"保亭黎族苗族自治县"},{value:"469030",label:"琼中黎族苗族自治县"}]}]},{value:'500000',label:'重庆',children:[{value:"500100",label:"市辖区",children:[{value:"500101",label:"万州区"},{value:"500102",label:"涪陵区"},{value:"500103",label:"渝中区"},{value:"500104",label:"大渡口区"},{value:"500105",label:"江北区"},{value:"500106",label:"沙坪坝区"},{value:"500107",label:"九龙坡区"},{value:"500108",label:"南岸区"},{value:"500109",label:"北碚区"},{value:"500110",label:"綦江区"},{value:"500111",label:"大足区"},{value:"500112",label:"渝北区"},{value:"500113",label:"巴南区"},{value:"500114",label:"黔江区"},{value:"500115",label:"长寿区"},{value:"500116",label:"江津区"},{value:"500117",label:"合川区"},{value:"500118",label:"永川区"},{value:"500119",label:"南川区"},{value:"500120",label:"璧山区"},{value:"500151",label:"铜梁区"},{value:"500152",label:"潼南区"},{value:"500153",label:"荣昌区"},{value:"500154",label:"开州区"},{value:"500155",label:"梁平区"},{value:"500156",label:"武隆区"}]},{value:"500200",label:"县",children:[{value:"500229",label:"城口县"},{value:"500230",label:"丰都县"},{value:"500231",label:"垫江县"},{value:"500233",label:"忠县"},{value:"500235",label:"云阳县"},{value:"500236",label:"奉节县"},{value:"500237",label:"巫山县"},{value:"500238",label:"巫溪县"},{value:"500240",label:"石柱土家族自治县"},{value:"500241",label:"秀山土家族苗族自治县"},{value:"500242",label:"酉阳土家族苗族自治县"},{value:"500243",label:"彭水苗族土家族自治县"}]}]},{value:'510000',label:'四川省',children:[{value:"510100",label:"成都市",children:[{value:"510101",label:"市辖区"},{value:"510104",label:"锦江区"},{value:"510105",label:"青羊区"},{value:"510106",label:"金牛区"},{value:"510107",label:"武侯区"},{value:"510108",label:"成华区"},{value:"510112",label:"龙泉驿区"},{value:"510113",label:"青白江区"},{value:"510114",label:"新都区"},{value:"510115",label:"温江区"},{value:"510116",label:"双流区"},{value:"510117",label:"郫都区"},{value:"510121",label:"金堂县"},{value:"510129",label:"大邑县"},{value:"510131",label:"蒲江县"},{value:"510132",label:"新津县"},{value:"510181",label:"都江堰市"},{value:"510182",label:"彭州市"},{value:"510183",label:"邛崃市"},{value:"510184",label:"崇州市"},{value:"510185",label:"简阳市"}]},{value:"510300",label:"自贡市",children:[{value:"510301",label:"市辖区"},{value:"510302",label:"自流井区"},{value:"510303",label:"贡井区"},{value:"510304",label:"大安区"},{value:"510311",label:"沿滩区"},{value:"510321",label:"荣县"},{value:"510322",label:"富顺县"}]},{value:"510400",label:"攀枝花市",children:[{value:"510401",label:"市辖区"},{value:"510402",label:"东区"},{value:"510403",label:"西区"},{value:"510411",label:"仁和区"},{value:"510421",label:"米易县"},{value:"510422",label:"盐边县"}]},{value:"510500",label:"泸州市",children:[{value:"510501",label:"市辖区"},{value:"510502",label:"江阳区"},{value:"510503",label:"纳溪区"},{value:"510504",label:"龙马潭区"},{value:"510521",label:"泸县"},{value:"510522",label:"合江县"},{value:"510524",label:"叙永县"},{value:"510525",label:"古蔺县"}]},{value:"510600",label:"德阳市",children:[{value:"510601",label:"市辖区"},{value:"510603",label:"旌阳区"},{value:"510604",label:"罗江区"},{value:"510623",label:"中江县"},{value:"510681",label:"广汉市"},{value:"510682",label:"什邡市"},{value:"510683",label:"绵竹市"}]},{value:"510700",label:"绵阳市",children:[{value:"510701",label:"市辖区"},{value:"510703",label:"涪城区"},{value:"510704",label:"游仙区"},{value:"510705",label:"安州区"},{value:"510722",label:"三台县"},{value:"510723",label:"盐亭县"},{value:"510725",label:"梓潼县"},{value:"510726",label:"北川羌族自治县"},{value:"510727",label:"平武县"},{value:"510781",label:"江油市"}]},{value:"510800",label:"广元市",children:[{value:"510801",label:"市辖区"},{value:"510802",label:"利州区"},{value:"510811",label:"昭化区"},{value:"510812",label:"朝天区"},{value:"510821",label:"旺苍县"},{value:"510822",label:"青川县"},{value:"510823",label:"剑阁县"},{value:"510824",label:"苍溪县"}]},{value:"510900",label:"遂宁市",children:[{value:"510901",label:"市辖区"},{value:"510903",label:"船山区"},{value:"510904",label:"安居区"},{value:"510921",label:"蓬溪县"},{value:"510922",label:"射洪县"},{value:"510923",label:"大英县"}]},{value:"511000",label:"内江市",children:[{value:"511001",label:"市辖区"},{value:"511002",label:"市中区"},{value:"511011",label:"东兴区"},{value:"511024",label:"威远县"},{value:"511025",label:"资中县"},{value:"511071",label:"内江经济开发区"},{value:"511083",label:"隆昌市"}]},{value:"511100",label:"乐山市",children:[{value:"511101",label:"市辖区"},{value:"511102",label:"市中区"},{value:"511111",label:"沙湾区"},{value:"511112",label:"五通桥区"},{value:"511113",label:"金口河区"},{value:"511123",label:"犍为县"},{value:"511124",label:"井研县"},{value:"511126",label:"夹江县"},{value:"511129",label:"沐川县"},{value:"511132",label:"峨边彝族自治县"},{value:"511133",label:"马边彝族自治县"},{value:"511181",label:"峨眉山市"}]},{value:"511300",label:"南充市",children:[{value:"511301",label:"市辖区"},{value:"511302",label:"顺庆区"},{value:"511303",label:"高坪区"},{value:"511304",label:"嘉陵区"},{value:"511321",label:"南部县"},{value:"511322",label:"营山县"},{value:"511323",label:"蓬安县"},{value:"511324",label:"仪陇县"},{value:"511325",label:"西充县"},{value:"511381",label:"阆中市"}]},{value:"511400",label:"眉山市",children:[{value:"511401",label:"市辖区"},{value:"511402",label:"东坡区"},{value:"511403",label:"彭山区"},{value:"511421",label:"仁寿县"},{value:"511423",label:"洪雅县"},{value:"511424",label:"丹棱县"},{value:"511425",label:"青神县"}]},{value:"511500",label:"宜宾市",children:[{value:"511501",label:"市辖区"},{value:"511502",label:"翠屏区"},{value:"511503",label:"南溪区"},{value:"511521",label:"宜宾县"},{value:"511523",label:"江安县"},{value:"511524",label:"长宁县"},{value:"511525",label:"高县"},{value:"511526",label:"珙县"},{value:"511527",label:"筠连县"},{value:"511528",label:"兴文县"},{value:"511529",label:"屏山县"}]},{value:"511600",label:"广安市",children:[{value:"511601",label:"市辖区"},{value:"511602",label:"广安区"},{value:"511603",label:"前锋区"},{value:"511621",label:"岳池县"},{value:"511622",label:"武胜县"},{value:"511623",label:"邻水县"},{value:"511681",label:"华蓥市"}]},{value:"511700",label:"达州市",children:[{value:"511701",label:"市辖区"},{value:"511702",label:"通川区"},{value:"511703",label:"达川区"},{value:"511722",label:"宣汉县"},{value:"511723",label:"开江县"},{value:"511724",label:"大竹县"},{value:"511725",label:"渠县"},{value:"511771",label:"达州经济开发区"},{value:"511781",label:"万源市"}]},{value:"511800",label:"雅安市",children:[{value:"511801",label:"市辖区"},{value:"511802",label:"雨城区"},{value:"511803",label:"名山区"},{value:"511822",label:"荥经县"},{value:"511823",label:"汉源县"},{value:"511824",label:"石棉县"},{value:"511825",label:"天全县"},{value:"511826",label:"芦山县"},{value:"511827",label:"宝兴县"}]},{value:"511900",label:"巴中市",children:[{value:"511901",label:"市辖区"},{value:"511902",label:"巴州区"},{value:"511903",label:"恩阳区"},{value:"511921",label:"通江县"},{value:"511922",label:"南江县"},{value:"511923",label:"平昌县"},{value:"511971",label:"巴中经济开发区"}]},{value:"512000",label:"资阳市",children:[{value:"512001",label:"市辖区"},{value:"512002",label:"雁江区"},{value:"512021",label:"安岳县"},{value:"512022",label:"乐至县"}]},{value:"513200",label:"阿坝藏族羌族自治州",children:[{value:"513201",label:"马尔康市"},{value:"513221",label:"汶川县"},{value:"513222",label:"理县"},{value:"513223",label:"茂县"},{value:"513224",label:"松潘县"},{value:"513225",label:"九寨沟县"},{value:"513226",label:"金川县"},{value:"513227",label:"小金县"},{value:"513228",label:"黑水县"},{value:"513230",label:"壤塘县"},{value:"513231",label:"阿坝县"},{value:"513232",label:"若尔盖县"},{value:"513233",label:"红原县"}]},{value:"513300",label:"甘孜藏族自治州",children:[{value:"513301",label:"康定市"},{value:"513322",label:"泸定县"},{value:"513323",label:"丹巴县"},{value:"513324",label:"九龙县"},{value:"513325",label:"雅江县"},{value:"513326",label:"道孚县"},{value:"513327",label:"炉霍县"},{value:"513328",label:"甘孜县"},{value:"513329",label:"新龙县"},{value:"513330",label:"德格县"},{value:"513331",label:"白玉县"},{value:"513332",label:"石渠县"},{value:"513333",label:"色达县"},{value:"513334",label:"理塘县"},{value:"513335",label:"巴塘县"},{value:"513336",label:"乡城县"},{value:"513337",label:"稻城县"},{value:"513338",label:"得荣县"}]},{value:"513400",label:"凉山彝族自治州",children:[{value:"513401",label:"西昌市"},{value:"513422",label:"木里藏族自治县"},{value:"513423",label:"盐源县"},{value:"513424",label:"德昌县"},{value:"513425",label:"会理县"},{value:"513426",label:"会东县"},{value:"513427",label:"宁南县"},{value:"513428",label:"普格县"},{value:"513429",label:"布拖县"},{value:"513430",label:"金阳县"},{value:"513431",label:"昭觉县"},{value:"513432",label:"喜德县"},{value:"513433",label:"冕宁县"},{value:"513434",label:"越西县"},{value:"513435",label:"甘洛县"},{value:"513436",label:"美姑县"},{value:"513437",label:"雷波县"}]}]},{value:'520000',label:'贵州省',children:[{value:"520100",label:"贵阳市",children:[{value:"520101",label:"市辖区"},{value:"520102",label:"南明区"},{value:"520103",label:"云岩区"},{value:"520111",label:"花溪区"},{value:"520112",label:"乌当区"},{value:"520113",label:"白云区"},{value:"520115",label:"观山湖区"},{value:"520121",label:"开阳县"},{value:"520122",label:"息烽县"},{value:"520123",label:"修文县"},{value:"520181",label:"清镇市"}]},{value:"520200",label:"六盘水市",children:[{value:"520201",label:"钟山区"},{value:"520203",label:"六枝特区"},{value:"520221",label:"水城县"},{value:"520281",label:"盘州市"}]},{value:"520300",label:"遵义市",children:[{value:"520301",label:"市辖区"},{value:"520302",label:"红花岗区"},{value:"520303",label:"汇川区"},{value:"520304",label:"播州区"},{value:"520322",label:"桐梓县"},{value:"520323",label:"绥阳县"},{value:"520324",label:"正安县"},{value:"520325",label:"道真仡佬族苗族自治县"},{value:"520326",label:"务川仡佬族苗族自治县"},{value:"520327",label:"凤冈县"},{value:"520328",label:"湄潭县"},{value:"520329",label:"余庆县"},{value:"520330",label:"习水县"},{value:"520381",label:"赤水市"},{value:"520382",label:"仁怀市"}]},{value:"520400",label:"安顺市",children:[{value:"520401",label:"市辖区"},{value:"520402",label:"西秀区"},{value:"520403",label:"平坝区"},{value:"520422",label:"普定县"},{value:"520423",label:"镇宁布依族苗族自治县"},{value:"520424",label:"关岭布依族苗族自治县"},{value:"520425",label:"紫云苗族布依族自治县"}]},{value:"520500",label:"毕节市",children:[{value:"520501",label:"市辖区"},{value:"520502",label:"七星关区"},{value:"520521",label:"大方县"},{value:"520522",label:"黔西县"},{value:"520523",label:"金沙县"},{value:"520524",label:"织金县"},{value:"520525",label:"纳雍县"},{value:"520526",label:"威宁彝族回族苗族自治县"},{value:"520527",label:"赫章县"}]},{value:"520600",label:"铜仁市",children:[{value:"520601",label:"市辖区"},{value:"520602",label:"碧江区"},{value:"520603",label:"万山区"},{value:"520621",label:"江口县"},{value:"520622",label:"玉屏侗族自治县"},{value:"520623",label:"石阡县"},{value:"520624",label:"思南县"},{value:"520625",label:"印江土家族苗族自治县"},{value:"520626",label:"德江县"},{value:"520627",label:"沿河土家族自治县"},{value:"520628",label:"松桃苗族自治县"}]},{value:"522300",label:"黔西南布依族苗族自治州",children:[{value:"522301",label:"兴义市"},{value:"522322",label:"兴仁县"},{value:"522323",label:"普安县"},{value:"522324",label:"晴隆县"},{value:"522325",label:"贞丰县"},{value:"522326",label:"望谟县"},{value:"522327",label:"册亨县"},{value:"522328",label:"安龙县"}]},{value:"522600",label:"黔东南苗族侗族自治州",children:[{value:"522601",label:"凯里市"},{value:"522622",label:"黄平县"},{value:"522623",label:"施秉县"},{value:"522624",label:"三穗县"},{value:"522625",label:"镇远县"},{value:"522626",label:"岑巩县"},{value:"522627",label:"天柱县"},{value:"522628",label:"锦屏县"},{value:"522629",label:"剑河县"},{value:"522630",label:"台江县"},{value:"522631",label:"黎平县"},{value:"522632",label:"榕江县"},{value:"522633",label:"从江县"},{value:"522634",label:"雷山县"},{value:"522635",label:"麻江县"},{value:"522636",label:"丹寨县"}]},{value:"522700",label:"黔南布依族苗族自治州",children:[{value:"522701",label:"都匀市"},{value:"522702",label:"福泉市"},{value:"522722",label:"荔波县"},{value:"522723",label:"贵定县"},{value:"522725",label:"瓮安县"},{value:"522726",label:"独山县"},{value:"522727",label:"平塘县"},{value:"522728",label:"罗甸县"},{value:"522729",label:"长顺县"},{value:"522730",label:"龙里县"},{value:"522731",label:"惠水县"},{value:"522732",label:"三都水族自治县"}]}]},{value:'530000',label:'云南省',children:[{value:"530100",label:"昆明市",children:[{value:"530101",label:"市辖区"},{value:"530102",label:"五华区"},{value:"530103",label:"盘龙区"},{value:"530111",label:"官渡区"},{value:"530112",label:"西山区"},{value:"530113",label:"东川区"},{value:"530114",label:"呈贡区"},{value:"530115",label:"晋宁区"},{value:"530124",label:"富民县"},{value:"530125",label:"宜良县"},{value:"530126",label:"石林彝族自治县"},{value:"530127",label:"嵩明县"},{value:"530128",label:"禄劝彝族苗族自治县"},{value:"530129",label:"寻甸回族彝族自治县"},{value:"530181",label:"安宁市"}]},{value:"530300",label:"曲靖市",children:[{value:"530301",label:"市辖区"},{value:"530302",label:"麒麟区"},{value:"530303",label:"沾益区"},{value:"530321",label:"马龙县"},{value:"530322",label:"陆良县"},{value:"530323",label:"师宗县"},{value:"530324",label:"罗平县"},{value:"530325",label:"富源县"},{value:"530326",label:"会泽县"},{value:"530381",label:"宣威市"}]},{value:"530400",label:"玉溪市",children:[{value:"530401",label:"市辖区"},{value:"530402",label:"红塔区"},{value:"530403",label:"江川区"},{value:"530422",label:"澄江县"},{value:"530423",label:"通海县"},{value:"530424",label:"华宁县"},{value:"530425",label:"易门县"},{value:"530426",label:"峨山彝族自治县"},{value:"530427",label:"新平彝族傣族自治县"},{value:"530428",label:"元江哈尼族彝族傣族自治县"}]},{value:"530500",label:"保山市",children:[{value:"530501",label:"市辖区"},{value:"530502",label:"隆阳区"},{value:"530521",label:"施甸县"},{value:"530523",label:"龙陵县"},{value:"530524",label:"昌宁县"},{value:"530581",label:"腾冲市"}]},{value:"530600",label:"昭通市",children:[{value:"530601",label:"市辖区"},{value:"530602",label:"昭阳区"},{value:"530621",label:"鲁甸县"},{value:"530622",label:"巧家县"},{value:"530623",label:"盐津县"},{value:"530624",label:"大关县"},{value:"530625",label:"永善县"},{value:"530626",label:"绥江县"},{value:"530627",label:"镇雄县"},{value:"530628",label:"彝良县"},{value:"530629",label:"威信县"},{value:"530630",label:"水富县"}]},{value:"530700",label:"丽江市",children:[{value:"530701",label:"市辖区"},{value:"530702",label:"古城区"},{value:"530721",label:"玉龙纳西族自治县"},{value:"530722",label:"永胜县"},{value:"530723",label:"华坪县"},{value:"530724",label:"宁蒗彝族自治县"}]},{value:"530800",label:"普洱市",children:[{value:"530801",label:"市辖区"},{value:"530802",label:"思茅区"},{value:"530821",label:"宁洱哈尼族彝族自治县"},{value:"530822",label:"墨江哈尼族自治县"},{value:"530823",label:"景东彝族自治县"},{value:"530824",label:"景谷傣族彝族自治县"},{value:"530825",label:"镇沅彝族哈尼族拉祜族自治县"},{value:"530826",label:"江城哈尼族彝族自治县"},{value:"530827",label:"孟连傣族拉祜族佤族自治县"},{value:"530828",label:"澜沧拉祜族自治县"},{value:"530829",label:"西盟佤族自治县"}]},{value:"530900",label:"临沧市",children:[{value:"530901",label:"市辖区"},{value:"530902",label:"临翔区"},{value:"530921",label:"凤庆县"},{value:"530922",label:"云县"},{value:"530923",label:"永德县"},{value:"530924",label:"镇康县"},{value:"530925",label:"双江拉祜族佤族布朗族傣族自治县"},{value:"530926",label:"耿马傣族佤族自治县"},{value:"530927",label:"沧源佤族自治县"}]},{value:"532300",label:"楚雄彝族自治州",children:[{value:"532301",label:"楚雄市"},{value:"532322",label:"双柏县"},{value:"532323",label:"牟定县"},{value:"532324",label:"南华县"},{value:"532325",label:"姚安县"},{value:"532326",label:"大姚县"},{value:"532327",label:"永仁县"},{value:"532328",label:"元谋县"},{value:"532329",label:"武定县"},{value:"532331",label:"禄丰县"}]},{value:"532500",label:"红河哈尼族彝族自治州",children:[{value:"532501",label:"个旧市"},{value:"532502",label:"开远市"},{value:"532503",label:"蒙自市"},{value:"532504",label:"弥勒市"},{value:"532523",label:"屏边苗族自治县"},{value:"532524",label:"建水县"},{value:"532525",label:"石屏县"},{value:"532527",label:"泸西县"},{value:"532528",label:"元阳县"},{value:"532529",label:"红河县"},{value:"532530",label:"金平苗族瑶族傣族自治县"},{value:"532531",label:"绿春县"},{value:"532532",label:"河口瑶族自治县"}]},{value:"532600",label:"文山壮族苗族自治州",children:[{value:"532601",label:"文山市"},{value:"532622",label:"砚山县"},{value:"532623",label:"西畴县"},{value:"532624",label:"麻栗坡县"},{value:"532625",label:"马关县"},{value:"532626",label:"丘北县"},{value:"532627",label:"广南县"},{value:"532628",label:"富宁县"}]},{value:"532800",label:"西双版纳傣族自治州",children:[{value:"532801",label:"景洪市"},{value:"532822",label:"勐海县"},{value:"532823",label:"勐腊县"}]},{value:"532900",label:"大理白族自治州",children:[{value:"532901",label:"大理市"},{value:"532922",label:"漾濞彝族自治县"},{value:"532923",label:"祥云县"},{value:"532924",label:"宾川县"},{value:"532925",label:"弥渡县"},{value:"532926",label:"南涧彝族自治县"},{value:"532927",label:"巍山彝族回族自治县"},{value:"532928",label:"永平县"},{value:"532929",label:"云龙县"},{value:"532930",label:"洱源县"},{value:"532931",label:"剑川县"},{value:"532932",label:"鹤庆县"}]},{value:"533100",label:"德宏傣族景颇族自治州",children:[{value:"533102",label:"瑞丽市"},{value:"533103",label:"芒市"},{value:"533122",label:"梁河县"},{value:"533123",label:"盈江县"},{value:"533124",label:"陇川县"}]},{value:"533300",label:"怒江傈僳族自治州",children:[{value:"533301",label:"泸水市"},{value:"533323",label:"福贡县"},{value:"533324",label:"贡山独龙族怒族自治县"},{value:"533325",label:"兰坪白族普米族自治县"}]},{value:"533400",label:"迪庆藏族自治州",children:[{value:"533401",label:"香格里拉市"},{value:"533422",label:"德钦县"},{value:"533423",label:"维西傈僳族自治县"}]}]},{value:'540000',label:'西藏',children:[{value:"540100",label:"拉萨市",children:[{value:"540101",label:"市辖区"},{value:"540102",label:"城关区"},{value:"540103",label:"堆龙德庆区"},{value:"540121",label:"林周县"},{value:"540122",label:"当雄县"},{value:"540123",label:"尼木县"},{value:"540124",label:"曲水县"},{value:"540126",label:"达孜县"},{value:"540127",label:"墨竹工卡县"},{value:"540171",label:"格尔木藏青工业园区"},{value:"540172",label:"拉萨经济技术开发区"},{value:"540173",label:"西藏文化旅游创意园区"},{value:"540174",label:"达孜工业园区"}]},{value:"540200",label:"日喀则市",children:[{value:"540202",label:"桑珠孜区"},{value:"540221",label:"南木林县"},{value:"540222",label:"江孜县"},{value:"540223",label:"定日县"},{value:"540224",label:"萨迦县"},{value:"540225",label:"拉孜县"},{value:"540226",label:"昂仁县"},{value:"540227",label:"谢通门县"},{value:"540228",label:"白朗县"},{value:"540229",label:"仁布县"},{value:"540230",label:"康马县"},{value:"540231",label:"定结县"},{value:"540232",label:"仲巴县"},{value:"540233",label:"亚东县"},{value:"540234",label:"吉隆县"},{value:"540235",label:"聂拉木县"},{value:"540236",label:"萨嘎县"},{value:"540237",label:"岗巴县"}]},{value:"540300",label:"昌都市",children:[{value:"540302",label:"卡若区"},{value:"540321",label:"江达县"},{value:"540322",label:"贡觉县"},{value:"540323",label:"类乌齐县"},{value:"540324",label:"丁青县"},{value:"540325",label:"察雅县"},{value:"540326",label:"八宿县"},{value:"540327",label:"左贡县"},{value:"540328",label:"芒康县"},{value:"540329",label:"洛隆县"},{value:"540330",label:"边坝县"}]},{value:"540400",label:"林芝市",children:[{value:"540402",label:"巴宜区"},{value:"540421",label:"工布江达县"},{value:"540422",label:"米林县"},{value:"540423",label:"墨脱县"},{value:"540424",label:"波密县"},{value:"540425",label:"察隅县"},{value:"540426",label:"朗县"}]},{value:"540500",label:"山南市",children:[{value:"540501",label:"市辖区"},{value:"540502",label:"乃东区"},{value:"540521",label:"扎囊县"},{value:"540522",label:"贡嘎县"},{value:"540523",label:"桑日县"},{value:"540524",label:"琼结县"},{value:"540525",label:"曲松县"},{value:"540526",label:"措美县"},{value:"540527",label:"洛扎县"},{value:"540528",label:"加查县"},{value:"540529",label:"隆子县"},{value:"540530",label:"错那县"},{value:"540531",label:"浪卡子县"}]},{value:"542400",label:"那曲地区",children:[{value:"542421",label:"那曲县"},{value:"542422",label:"嘉黎县"},{value:"542423",label:"比如县"},{value:"542424",label:"聂荣县"},{value:"542425",label:"安多县"},{value:"542426",label:"申扎县"},{value:"542427",label:"索县"},{value:"542428",label:"班戈县"},{value:"542429",label:"巴青县"},{value:"542430",label:"尼玛县"},{value:"542431",label:"双湖县"}]},{value:"542500",label:"阿里地区",children:[{value:"542521",label:"普兰县"},{value:"542522",label:"札达县"},{value:"542523",label:"噶尔县"},{value:"542524",label:"日土县"},{value:"542525",label:"革吉县"},{value:"542526",label:"改则县"},{value:"542527",label:"措勤县"}]}]},{value:'610000',label:'陕西省',children:[{value:"610100",label:"西安市",children:[{value:"610101",label:"市辖区"},{value:"610102",label:"新城区"},{value:"610103",label:"碑林区"},{value:"610104",label:"莲湖区"},{value:"610111",label:"灞桥区"},{value:"610112",label:"未央区"},{value:"610113",label:"雁塔区"},{value:"610114",label:"阎良区"},{value:"610115",label:"临潼区"},{value:"610116",label:"长安区"},{value:"610117",label:"高陵区"},{value:"610118",label:"鄠邑区"},{value:"610122",label:"蓝田县"},{value:"610124",label:"周至县"}]},{value:"610200",label:"铜川市",children:[{value:"610201",label:"市辖区"},{value:"610202",label:"王益区"},{value:"610203",label:"印台区"},{value:"610204",label:"耀州区"},{value:"610222",label:"宜君县"}]},{value:"610300",label:"宝鸡市",children:[{value:"610301",label:"市辖区"},{value:"610302",label:"渭滨区"},{value:"610303",label:"金台区"},{value:"610304",label:"陈仓区"},{value:"610322",label:"凤翔县"},{value:"610323",label:"岐山县"},{value:"610324",label:"扶风县"},{value:"610326",label:"眉县"},{value:"610327",label:"陇县"},{value:"610328",label:"千阳县"},{value:"610329",label:"麟游县"},{value:"610330",label:"凤县"},{value:"610331",label:"太白县"}]},{value:"610400",label:"咸阳市",children:[{value:"610401",label:"市辖区"},{value:"610402",label:"秦都区"},{value:"610403",label:"杨陵区"},{value:"610404",label:"渭城区"},{value:"610422",label:"三原县"},{value:"610423",label:"泾阳县"},{value:"610424",label:"乾县"},{value:"610425",label:"礼泉县"},{value:"610426",label:"永寿县"},{value:"610427",label:"彬县"},{value:"610428",label:"长武县"},{value:"610429",label:"旬邑县"},{value:"610430",label:"淳化县"},{value:"610431",label:"武功县"},{value:"610481",label:"兴平市"}]},{value:"610500",label:"渭南市",children:[{value:"610501",label:"市辖区"},{value:"610502",label:"临渭区"},{value:"610503",label:"华州区"},{value:"610522",label:"潼关县"},{value:"610523",label:"大荔县"},{value:"610524",label:"合阳县"},{value:"610525",label:"澄城县"},{value:"610526",label:"蒲城县"},{value:"610527",label:"白水县"},{value:"610528",label:"富平县"},{value:"610581",label:"韩城市"},{value:"610582",label:"华阴市"}]},{value:"610600",label:"延安市",children:[{value:"610601",label:"市辖区"},{value:"610602",label:"宝塔区"},{value:"610603",label:"安塞区"},{value:"610621",label:"延长县"},{value:"610622",label:"延川县"},{value:"610623",label:"子长县"},{value:"610625",label:"志丹县"},{value:"610626",label:"吴起县"},{value:"610627",label:"甘泉县"},{value:"610628",label:"富县"},{value:"610629",label:"洛川县"},{value:"610630",label:"宜川县"},{value:"610631",label:"黄龙县"},{value:"610632",label:"黄陵县"}]},{value:"610700",label:"汉中市",children:[{value:"610701",label:"市辖区"},{value:"610702",label:"汉台区"},{value:"610703",label:"南郑区"},{value:"610722",label:"城固县"},{value:"610723",label:"洋县"},{value:"610724",label:"西乡县"},{value:"610725",label:"勉县"},{value:"610726",label:"宁强县"},{value:"610727",label:"略阳县"},{value:"610728",label:"镇巴县"},{value:"610729",label:"留坝县"},{value:"610730",label:"佛坪县"}]},{value:"610800",label:"榆林市",children:[{value:"610801",label:"市辖区"},{value:"610802",label:"榆阳区"},{value:"610803",label:"横山区"},{value:"610822",label:"府谷县"},{value:"610824",label:"靖边县"},{value:"610825",label:"定边县"},{value:"610826",label:"绥德县"},{value:"610827",label:"米脂县"},{value:"610828",label:"佳县"},{value:"610829",label:"吴堡县"},{value:"610830",label:"清涧县"},{value:"610831",label:"子洲县"},{value:"610881",label:"神木市"}]},{value:"610900",label:"安康市",children:[{value:"610901",label:"市辖区"},{value:"610902",label:"汉滨区"},{value:"610921",label:"汉阴县"},{value:"610922",label:"石泉县"},{value:"610923",label:"宁陕县"},{value:"610924",label:"紫阳县"},{value:"610925",label:"岚皋县"},{value:"610926",label:"平利县"},{value:"610927",label:"镇坪县"},{value:"610928",label:"旬阳县"},{value:"610929",label:"白河县"}]},{value:"611000",label:"商洛市",children:[{value:"611001",label:"市辖区"},{value:"611002",label:"商州区"},{value:"611021",label:"洛南县"},{value:"611022",label:"丹凤县"},{value:"611023",label:"商南县"},{value:"611024",label:"山阳县"},{value:"611025",label:"镇安县"},{value:"611026",label:"柞水县"}]}]},{value:'620000',label:'甘肃省',children:[{value:"620100",label:"兰州市",children:[{value:"620101",label:"市辖区"},{value:"620102",label:"城关区"},{value:"620103",label:"七里河区"},{value:"620104",label:"西固区"},{value:"620105",label:"安宁区"},{value:"620111",label:"红古区"},{value:"620121",label:"永登县"},{value:"620122",label:"皋兰县"},{value:"620123",label:"榆中县"},{value:"620171",label:"兰州新区"}]},{value:"620200",label:"嘉峪关市",children:[{value:"620201",label:"市辖区"}]},{value:"620300",label:"金昌市",children:[{value:"620301",label:"市辖区"},{value:"620302",label:"金川区"},{value:"620321",label:"永昌县"}]},{value:"620400",label:"白银市",children:[{value:"620401",label:"市辖区"},{value:"620402",label:"白银区"},{value:"620403",label:"平川区"},{value:"620421",label:"靖远县"},{value:"620422",label:"会宁县"},{value:"620423",label:"景泰县"}]},{value:"620500",label:"天水市",children:[{value:"620501",label:"市辖区"},{value:"620502",label:"秦州区"},{value:"620503",label:"麦积区"},{value:"620521",label:"清水县"},{value:"620522",label:"秦安县"},{value:"620523",label:"甘谷县"},{value:"620524",label:"武山县"},{value:"620525",label:"张家川回族自治县"}]},{value:"620600",label:"武威市",children:[{value:"620601",label:"市辖区"},{value:"620602",label:"凉州区"},{value:"620621",label:"民勤县"},{value:"620622",label:"古浪县"},{value:"620623",label:"天祝藏族自治县"}]},{value:"620700",label:"张掖市",children:[{value:"620701",label:"市辖区"},{value:"620702",label:"甘州区"},{value:"620721",label:"肃南裕固族自治县"},{value:"620722",label:"民乐县"},{value:"620723",label:"临泽县"},{value:"620724",label:"高台县"},{value:"620725",label:"山丹县"}]},{value:"620800",label:"平凉市",children:[{value:"620801",label:"市辖区"},{value:"620802",label:"崆峒区"},{value:"620821",label:"泾川县"},{value:"620822",label:"灵台县"},{value:"620823",label:"崇信县"},{value:"620824",label:"华亭县"},{value:"620825",label:"庄浪县"},{value:"620826",label:"静宁县"},{value:"620871",label:"平凉工业园区"}]},{value:"620900",label:"酒泉市",children:[{value:"620901",label:"市辖区"},{value:"620902",label:"肃州区"},{value:"620921",label:"金塔县"},{value:"620922",label:"瓜州县"},{value:"620923",label:"肃北蒙古族自治县"},{value:"620924",label:"阿克塞哈萨克族自治县"},{value:"620981",label:"玉门市"},{value:"620982",label:"敦煌市"}]},{value:"621000",label:"庆阳市",children:[{value:"621001",label:"市辖区"},{value:"621002",label:"西峰区"},{value:"621021",label:"庆城县"},{value:"621022",label:"环县"},{value:"621023",label:"华池县"},{value:"621024",label:"合水县"},{value:"621025",label:"正宁县"},{value:"621026",label:"宁县"},{value:"621027",label:"镇原县"}]},{value:"621100",label:"定西市",children:[{value:"621101",label:"市辖区"},{value:"621102",label:"安定区"},{value:"621121",label:"通渭县"},{value:"621122",label:"陇西县"},{value:"621123",label:"渭源县"},{value:"621124",label:"临洮县"},{value:"621125",label:"漳县"},{value:"621126",label:"岷县"}]},{value:"621200",label:"陇南市",children:[{value:"621201",label:"市辖区"},{value:"621202",label:"武都区"},{value:"621221",label:"成县"},{value:"621222",label:"文县"},{value:"621223",label:"宕昌县"},{value:"621224",label:"康县"},{value:"621225",label:"西和县"},{value:"621226",label:"礼县"},{value:"621227",label:"徽县"},{value:"621228",label:"两当县"}]},{value:"622900",label:"临夏回族自治州",children:[{value:"622901",label:"临夏市"},{value:"622921",label:"临夏县"},{value:"622922",label:"康乐县"},{value:"622923",label:"永靖县"},{value:"622924",label:"广河县"},{value:"622925",label:"和政县"},{value:"622926",label:"东乡族自治县"},{value:"622927",label:"积石山保安族东乡族撒拉族自治县"}]},{value:"623000",label:"甘南藏族自治州",children:[{value:"623001",label:"合作市"},{value:"623021",label:"临潭县"},{value:"623022",label:"卓尼县"},{value:"623023",label:"舟曲县"},{value:"623024",label:"迭部县"},{value:"623025",label:"玛曲县"},{value:"623026",label:"碌曲县"},{value:"623027",label:"夏河县"}]}]},{value:'630000',label:'青海省',children:[{value:"630100",label:"西宁市",children:[{value:"630101",label:"市辖区"},{value:"630102",label:"城东区"},{value:"630103",label:"城中区"},{value:"630104",label:"城西区"},{value:"630105",label:"城北区"},{value:"630121",label:"大通回族土族自治县"},{value:"630122",label:"湟中县"},{value:"630123",label:"湟源县"}]},{value:"630200",label:"海东市",children:[{value:"630202",label:"乐都区"},{value:"630203",label:"平安区"},{value:"630222",label:"民和回族土族自治县"},{value:"630223",label:"互助土族自治县"},{value:"630224",label:"化隆回族自治县"},{value:"630225",label:"循化撒拉族自治县"}]},{value:"632200",label:"海北藏族自治州",children:[{value:"632221",label:"门源回族自治县"},{value:"632222",label:"祁连县"},{value:"632223",label:"海晏县"},{value:"632224",label:"刚察县"}]},{value:"632300",label:"黄南藏族自治州",children:[{value:"632321",label:"同仁县"},{value:"632322",label:"尖扎县"},{value:"632323",label:"泽库县"},{value:"632324",label:"河南蒙古族自治县"}]},{value:"632500",label:"海南藏族自治州",children:[{value:"632521",label:"共和县"},{value:"632522",label:"同德县"},{value:"632523",label:"贵德县"},{value:"632524",label:"兴海县"},{value:"632525",label:"贵南县"}]},{value:"632600",label:"果洛藏族自治州",children:[{value:"632621",label:"玛沁县"},{value:"632622",label:"班玛县"},{value:"632623",label:"甘德县"},{value:"632624",label:"达日县"},{value:"632625",label:"久治县"},{value:"632626",label:"玛多县"}]},{value:"632700",label:"玉树藏族自治州",children:[{value:"632701",label:"玉树市"},{value:"632722",label:"杂多县"},{value:"632723",label:"称多县"},{value:"632724",label:"治多县"},{value:"632725",label:"囊谦县"},{value:"632726",label:"曲麻莱县"}]},{value:"632800",label:"海西蒙古族藏族自治州",children:[{value:"632801",label:"格尔木市"},{value:"632802",label:"德令哈市"},{value:"632821",label:"乌兰县"},{value:"632822",label:"都兰县"},{value:"632823",label:"天峻县"},{value:"632857",label:"大柴旦行政委员会"},{value:"632858",label:"冷湖行政委员会"},{value:"632859",label:"茫崖行政委员会"}]}]},{value:'640000',label:'宁夏',children:[{value:"640100",label:"银川市",children:[{value:"640101",label:"市辖区"},{value:"640104",label:"兴庆区"},{value:"640105",label:"西夏区"},{value:"640106",label:"金凤区"},{value:"640121",label:"永宁县"},{value:"640122",label:"贺兰县"},{value:"640181",label:"灵武市"}]},{value:"640200",label:"石嘴山市",children:[{value:"640201",label:"市辖区"},{value:"640202",label:"大武口区"},{value:"640205",label:"惠农区"},{value:"640221",label:"平罗县"}]},{value:"640300",label:"吴忠市",children:[{value:"640301",label:"市辖区"},{value:"640302",label:"利通区"},{value:"640303",label:"红寺堡区"},{value:"640323",label:"盐池县"},{value:"640324",label:"同心县"},{value:"640381",label:"青铜峡市"}]},{value:"640400",label:"固原市",children:[{value:"640401",label:"市辖区"},{value:"640402",label:"原州区"},{value:"640422",label:"西吉县"},{value:"640423",label:"隆德县"},{value:"640424",label:"泾源县"},{value:"640425",label:"彭阳县"}]},{value:"640500",label:"中卫市",children:[{value:"640501",label:"市辖区"},{value:"640502",label:"沙坡头区"},{value:"640521",label:"中宁县"},{value:"640522",label:"海原县"}]}]},{value:'650000',label:'新疆',children:[{value:"650100",label:"乌鲁木齐市",children:[{value:"650101",label:"市辖区"},{value:"650102",label:"天山区"},{value:"650103",label:"沙依巴克区"},{value:"650104",label:"新市区"},{value:"650105",label:"水磨沟区"},{value:"650106",label:"头屯河区"},{value:"650107",label:"达坂城区"},{value:"650109",label:"米东区"},{value:"650121",label:"乌鲁木齐县"},{value:"650171",label:"乌鲁木齐经济技术开发区"},{value:"650172",label:"乌鲁木齐高新技术产业开发区"}]},{value:"650200",label:"克拉玛依市",children:[{value:"650201",label:"市辖区"},{value:"650202",label:"独山子区"},{value:"650203",label:"克拉玛依区"},{value:"650204",label:"白碱滩区"},{value:"650205",label:"乌尔禾区"}]},{value:"650400",label:"吐鲁番市",children:[{value:"650402",label:"高昌区"},{value:"650421",label:"鄯善县"},{value:"650422",label:"托克逊县"}]},{value:"650500",label:"哈密市",children:[{value:"650502",label:"伊州区"},{value:"650521",label:"巴里坤哈萨克自治县"},{value:"650522",label:"伊吾县"}]},{value:"652300",label:"昌吉回族自治州",children:[{value:"652301",label:"昌吉市"},{value:"652302",label:"阜康市"},{value:"652323",label:"呼图壁县"},{value:"652324",label:"玛纳斯县"},{value:"652325",label:"奇台县"},{value:"652327",label:"吉木萨尔县"},{value:"652328",label:"木垒哈萨克自治县"}]},{value:"652700",label:"博尔塔拉蒙古自治州",children:[{value:"652701",label:"博乐市"},{value:"652702",label:"阿拉山口市"},{value:"652722",label:"精河县"},{value:"652723",label:"温泉县"}]},{value:"652800",label:"巴音郭楞蒙古自治州",children:[{value:"652801",label:"库尔勒市"},{value:"652822",label:"轮台县"},{value:"652823",label:"尉犁县"},{value:"652824",label:"若羌县"},{value:"652825",label:"且末县"},{value:"652826",label:"焉耆回族自治县"},{value:"652827",label:"和静县"},{value:"652828",label:"和硕县"},{value:"652829",label:"博湖县"},{value:"652871",label:"库尔勒经济技术开发区"}]},{value:"652900",label:"阿克苏地区",children:[{value:"652901",label:"阿克苏市"},{value:"652922",label:"温宿县"},{value:"652923",label:"库车县"},{value:"652924",label:"沙雅县"},{value:"652925",label:"新和县"},{value:"652926",label:"拜城县"},{value:"652927",label:"乌什县"},{value:"652928",label:"阿瓦提县"},{value:"652929",label:"柯坪县"}]},{value:"653000",label:"克孜勒苏柯尔克孜自治州",children:[{value:"653001",label:"阿图什市"},{value:"653022",label:"阿克陶县"},{value:"653023",label:"阿合奇县"},{value:"653024",label:"乌恰县"}]},{value:"653100",label:"喀什地区",children:[{value:"653101",label:"喀什市"},{value:"653121",label:"疏附县"},{value:"653122",label:"疏勒县"},{value:"653123",label:"英吉沙县"},{value:"653124",label:"泽普县"},{value:"653125",label:"莎车县"},{value:"653126",label:"叶城县"},{value:"653127",label:"麦盖提县"},{value:"653128",label:"岳普湖县"},{value:"653129",label:"伽师县"},{value:"653130",label:"巴楚县"},{value:"653131",label:"塔什库尔干塔吉克自治县"}]},{value:"653200",label:"和田地区",children:[{value:"653201",label:"和田市"},{value:"653221",label:"和田县"},{value:"653222",label:"墨玉县"},{value:"653223",label:"皮山县"},{value:"653224",label:"洛浦县"},{value:"653225",label:"策勒县"},{value:"653226",label:"于田县"},{value:"653227",label:"民丰县"}]},{value:"654000",label:"伊犁哈萨克自治州",children:[{value:"654002",label:"伊宁市"},{value:"654003",label:"奎屯市"},{value:"654004",label:"霍尔果斯市"},{value:"654021",label:"伊宁县"},{value:"654022",label:"察布查尔锡伯自治县"},{value:"654023",label:"霍城县"},{value:"654024",label:"巩留县"},{value:"654025",label:"新源县"},{value:"654026",label:"昭苏县"},{value:"654027",label:"特克斯县"},{value:"654028",label:"尼勒克县"}]},{value:"654200",label:"塔城地区",children:[{value:"654201",label:"塔城市"},{value:"654202",label:"乌苏市"},{value:"654221",label:"额敏县"},{value:"654223",label:"沙湾县"},{value:"654224",label:"托里县"},{value:"654225",label:"裕民县"},{value:"654226",label:"和布克赛尔蒙古自治县"}]},{value:"654300",label:"阿勒泰地区",children:[{value:"654301",label:"阿勒泰市"},{value:"654321",label:"布尔津县"},{value:"654322",label:"富蕴县"},{value:"654323",label:"福海县"},{value:"654324",label:"哈巴河县"},{value:"654325",label:"青河县"},{value:"654326",label:"吉木乃县"}]},{value:"659000",label:"自治区直辖县级行政区划",children:[{value:"659001",label:"石河子市"},{value:"659002",label:"阿拉尔市"},{value:"659003",label:"图木舒克市"},{value:"659004",label:"五家渠市"},{value:"659006",label:"铁门关市"}]}]},{value:'660000',label:'台湾省',children:[{value:"660100",label:"台北市",children:[{value:"660101",label:"中正区"},{value:"660102",label:"大同区"},{value:"660103",label:"中山区"},{value:"660104",label:"松山区"},{value:"660105",label:"大安区"},{value:"660106",label:"万华区"},{value:"660107",label:"信义区"},{value:"660108",label:"士林区"},{value:"660109",label:"北投区"},{value:"660110",label:"内湖区"},{value:"660111",label:"南港区"},{value:"660112",label:"文山区"}]},{value:"660200",label:"高雄市",children:[{value:"660201",label:"新兴区"},{value:"660202",label:"前金区"},{value:"660203",label:"芩雅区"},{value:"660204",label:"盐埕区"},{value:"660205",label:"鼓山区"},{value:"660206",label:"旗津区"},{value:"660207",label:"前镇区"},{value:"660208",label:"三民区"},{value:"660209",label:"左营区"},{value:"660210",label:"楠梓区"},{value:"660211",label:"小港区"}]},{value:"660300",label:"台南市",children:[{value:"660301",label:"中西区"},{value:"660302",label:"东区"},{value:"660303",label:"南区"},{value:"660304",label:"北区"},{value:"660305",label:"安平区"},{value:"660306",label:"安南区"}]},{value:"660400",label:"台中市",children:[{value:"660401",label:"中区"},{value:"660402",label:"东区"},{value:"660403",label:"南区"},{value:"660404",label:"西区"},{value:"660405",label:"北区"},{value:"660406",label:"北屯区"},{value:"660407",label:"西屯区"},{value:"660408",label:"南屯区"}]},{value:"660500",label:"金门县",children:[{value:"660501",label:"金门县"}]},{value:"660600",label:"南投县",children:[{value:"660601",label:"南投县",}]},{value:"660700",label:"基隆市",children:[{value:"660701",label:"仁爱区"},{value:"660702",label:"信义区"},{value:"660703",label:"中正区"},{value:"660704",label:"中山区"},{value:"660705",label:"安乐区"},{value:"660706",label:"暖暖区"},{value:"660707",label:"七堵区"}]},{value:"660800",label:"新竹市",children:[{value:"660801",label:"东区"},{value:"660802",label:"北区"},{value:"660803",label:"香山区"}]},{value:"660900",label:"嘉义市",children:[{value:"660901",label:"东区"},{value:"660902",label:"西区"}]},{value:"661000",label:"新北市",children:[{value:"661001",label:"新北市"}]},{value:"661100",label:"宜兰县",children:[{value:"661100",label:"宜兰县"}]},{value:"661200",label:"新竹县",children:[{value:"661201",label:"新竹县"}]},{value:"661300",label:"桃园县",children:[{value:"661301",label:"桃园县"}]},{value:"661400",label:"苗栗县",children:[{value:"661401",label:"苗栗县"}]},{value:"661500",label:"彰化县",children:[{value:"661501",label:"彰化县"}]},{value:"661600",label:"嘉义县",children:[{value:"661601",label:"嘉义县"}]},{value:"661700",label:"云林县",children:[{value:"661701",label:"云林县"}]},{value:"661800",label:"屏东县",children:[{value:"661801",label:"屏东县"}]},{value:"661900",label:"台东县",children:[{value:"661901",label:"台东县"}]},{value:"662000",label:"花莲县",children:[{value:"662001",label:"花莲县"}]},{value:"662100",label:"澎湖县",children:[{value:"662101",label:"澎湖县"}]}]},{value:'670000',label:'香港',children:[{value:"670100",label:"香港岛",children:[{value:"670101",label:"中西区"},{value:"670102",label:"湾仔区"},{value:"670103",label:"东区"},{value:"670104",label:"南区"}]},{value:"670200",label:"九龙半岛",children:[{value:"670201",label:"九龙城区"},{value:"670202",label:"油尖旺区"},{value:"670203",label:"深水埗区"},{value:"670204",label:"黄大仙区"},{value:"670205",label:"观塘区"}]},{value:"670300",label:"新界",children:[{value:"670301",label:"北区"},{value:"670302",label:"大埔区"},{value:"670303",label:"沙田区"},{value:"670304",label:"西贡区"},{value:"670305",label:"元朗区"},{value:"670306",label:"屯门区"},{value:"670307",label:"荃湾区"},{value:"670308",label:"葵青区"},{value:"670309",label:"离岛区"}]}]},{value:'680000',label:'澳门',children:[{value:"680100",label:"澳门半岛",children:[{value:"680101",label:"花地玛堂区"},{value:"680102",label:"圣安多尼堂区"},{value:"680103",label:"大堂区"},{value:"680104",label:"望德堂区"},{value:"680105",label:"风顺堂区"}]},{value:"680200",label:"离岛",children:[{value:"680201",label:"嘉模堂区"},{value:"680202",label:"圣方济各堂区"}]}]}];export default cityData | |
| 2 | 0 | \ No newline at end of file |
yudao-ui-app/components/w-picker/date-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view v-if="fields=='year'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view> | |
| 6 | - </picker-view-column> | |
| 7 | - </picker-view> | |
| 8 | - <picker-view v-if="fields=='month'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 9 | - <picker-view-column> | |
| 10 | - <view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view> | |
| 11 | - </picker-view-column> | |
| 12 | - <picker-view-column> | |
| 13 | - <view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view> | |
| 14 | - </picker-view-column> | |
| 15 | - </picker-view> | |
| 16 | - <picker-view v-if="fields=='day'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 17 | - <picker-view-column> | |
| 18 | - <view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view> | |
| 19 | - </picker-view-column> | |
| 20 | - <picker-view-column> | |
| 21 | - <view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view> | |
| 22 | - </picker-view-column> | |
| 23 | - <picker-view-column> | |
| 24 | - <view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view> | |
| 25 | - </picker-view-column> | |
| 26 | - </picker-view> | |
| 27 | - <picker-view v-if="fields=='hour'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 28 | - <picker-view-column> | |
| 29 | - <view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view> | |
| 30 | - </picker-view-column> | |
| 31 | - <picker-view-column> | |
| 32 | - <view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view> | |
| 33 | - </picker-view-column> | |
| 34 | - <picker-view-column> | |
| 35 | - <view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view> | |
| 36 | - </picker-view-column> | |
| 37 | - <picker-view-column> | |
| 38 | - <view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view> | |
| 39 | - </picker-view-column> | |
| 40 | - </picker-view> | |
| 41 | - <picker-view v-if="fields=='minute'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 42 | - <picker-view-column> | |
| 43 | - <view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view> | |
| 44 | - </picker-view-column> | |
| 45 | - <picker-view-column> | |
| 46 | - <view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view> | |
| 47 | - </picker-view-column> | |
| 48 | - <picker-view-column> | |
| 49 | - <view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view> | |
| 50 | - </picker-view-column> | |
| 51 | - <picker-view-column> | |
| 52 | - <view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view> | |
| 53 | - </picker-view-column> | |
| 54 | - <picker-view-column> | |
| 55 | - <view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item}}分</view> | |
| 56 | - </picker-view-column> | |
| 57 | - </picker-view> | |
| 58 | - <picker-view v-if="fields=='second'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 59 | - <picker-view-column> | |
| 60 | - <view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view> | |
| 61 | - </picker-view-column> | |
| 62 | - <picker-view-column> | |
| 63 | - <view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view> | |
| 64 | - </picker-view-column> | |
| 65 | - <picker-view-column> | |
| 66 | - <view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view> | |
| 67 | - </picker-view-column> | |
| 68 | - <picker-view-column> | |
| 69 | - <view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view> | |
| 70 | - </picker-view-column> | |
| 71 | - <picker-view-column> | |
| 72 | - <view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item}}分</view> | |
| 73 | - </picker-view-column> | |
| 74 | - <picker-view-column> | |
| 75 | - <view class="w-picker-item" v-for="(item,index) in range.seconds" :key="index">{{item}}秒</view> | |
| 76 | - </picker-view-column> | |
| 77 | - </picker-view> | |
| 78 | - </view> | |
| 79 | -</template> | |
| 80 | - | |
| 81 | -<script> | |
| 82 | - export default { | |
| 83 | - data() { | |
| 84 | - return { | |
| 85 | - pickVal:[], | |
| 86 | - range:{ | |
| 87 | - years:[], | |
| 88 | - months:[], | |
| 89 | - days:[], | |
| 90 | - hours:[], | |
| 91 | - minutes:[], | |
| 92 | - seconds:[] | |
| 93 | - }, | |
| 94 | - checkObj:{} | |
| 95 | - }; | |
| 96 | - }, | |
| 97 | - props:{ | |
| 98 | - itemHeight:{ | |
| 99 | - type:String, | |
| 100 | - default:"44px" | |
| 101 | - }, | |
| 102 | - startYear:{ | |
| 103 | - type:[String,Number], | |
| 104 | - default:"" | |
| 105 | - }, | |
| 106 | - endYear:{ | |
| 107 | - type:[String,Number], | |
| 108 | - default:"" | |
| 109 | - }, | |
| 110 | - value:{ | |
| 111 | - type:[String,Array,Number], | |
| 112 | - default:"" | |
| 113 | - }, | |
| 114 | - current:{//是否默认选中当前日期 | |
| 115 | - type:Boolean, | |
| 116 | - default:false | |
| 117 | - }, | |
| 118 | - disabledAfter:{//是否禁用当前之后的日期 | |
| 119 | - type:Boolean, | |
| 120 | - default:false | |
| 121 | - }, | |
| 122 | - fields:{ | |
| 123 | - type:String, | |
| 124 | - default:"day" | |
| 125 | - } | |
| 126 | - }, | |
| 127 | - watch:{ | |
| 128 | - fields(val){ | |
| 129 | - this.initData(); | |
| 130 | - }, | |
| 131 | - value(val){ | |
| 132 | - this.initData(); | |
| 133 | - } | |
| 134 | - }, | |
| 135 | - created() { | |
| 136 | - this.initData(); | |
| 137 | - }, | |
| 138 | - methods:{ | |
| 139 | - formatNum(n){ | |
| 140 | - return (Number(n)<10?'0'+Number(n):Number(n)+''); | |
| 141 | - }, | |
| 142 | - checkValue(value){ | |
| 143 | - let strReg,example | |
| 144 | - switch(this.fields){ | |
| 145 | - case "year": | |
| 146 | - strReg=/^\d{4}$/; | |
| 147 | - example="2019"; | |
| 148 | - break; | |
| 149 | - case "month": | |
| 150 | - strReg=/^\d{4}-\d{2}$/; | |
| 151 | - example="2019-02"; | |
| 152 | - break; | |
| 153 | - case "day": | |
| 154 | - strReg=/^\d{4}-\d{2}-\d{2}$/; | |
| 155 | - example="2019-02-01"; | |
| 156 | - break; | |
| 157 | - case "hour": | |
| 158 | - strReg=/^\d{4}-\d{2}-\d{2} \d{2}(:\d{2}){1,2}?$/; | |
| 159 | - example="2019-02-01 18:00:00或2019-02-01 18"; | |
| 160 | - break; | |
| 161 | - case "minute": | |
| 162 | - strReg=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(:\d{2}){0,1}?$/; | |
| 163 | - example="2019-02-01 18:06:00或2019-02-01 18:06"; | |
| 164 | - break; | |
| 165 | - case "second": | |
| 166 | - strReg=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/; | |
| 167 | - example="2019-02-01 18:06:01"; | |
| 168 | - break; | |
| 169 | - } | |
| 170 | - if(!strReg.test(value)){ | |
| 171 | - console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+"")) | |
| 172 | - } | |
| 173 | - return strReg.test(value); | |
| 174 | - }, | |
| 175 | - resetData(year,month,day,hour,minute){ | |
| 176 | - let curDate=this.getCurrenDate(); | |
| 177 | - let curFlag=this.current; | |
| 178 | - let curYear=curDate.curYear; | |
| 179 | - let curMonth=curDate.curMonth; | |
| 180 | - let curDay=curDate.curDay; | |
| 181 | - let curHour=curDate.curHour; | |
| 182 | - let curMinute=curDate.curMinute; | |
| 183 | - let curSecond=curDate.curSecond; | |
| 184 | - let months=[],days=[],hours=[],minutes=[],seconds=[]; | |
| 185 | - let disabledAfter=this.disabledAfter; | |
| 186 | - let monthsLen=disabledAfter?(year*1<curYear?12:curMonth):12; | |
| 187 | - let totalDays=new Date(year,month,0).getDate();//计算当月有几天; | |
| 188 | - let daysLen=disabledAfter?((year*1<curYear||month*1<curMonth)?totalDays:curDay):totalDays; | |
| 189 | - let hoursLen=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay)?24:curHour+1):24; | |
| 190 | - let minutesLen=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay||hour*1<curHour)?60:curMinute+1):60; | |
| 191 | - let secondsLen=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay||hour*1<curHour||minute*1<curMinute)?60:curSecond+1):60; | |
| 192 | - for(let month=1;month<=monthsLen;month++){ | |
| 193 | - months.push(this.formatNum(month)); | |
| 194 | - }; | |
| 195 | - for(let day=1;day<=daysLen;day++){ | |
| 196 | - days.push(this.formatNum(day)); | |
| 197 | - } | |
| 198 | - for(let hour=0;hour<hoursLen;hour++){ | |
| 199 | - hours.push(this.formatNum(hour)); | |
| 200 | - } | |
| 201 | - for(let minute=0;minute<minutesLen;minute++){ | |
| 202 | - minutes.push(this.formatNum(minute)); | |
| 203 | - } | |
| 204 | - for(let second=0;second<secondsLen;second++){ | |
| 205 | - seconds.push(this.formatNum(second)); | |
| 206 | - } | |
| 207 | - return{ | |
| 208 | - months, | |
| 209 | - days, | |
| 210 | - hours, | |
| 211 | - minutes, | |
| 212 | - seconds | |
| 213 | - } | |
| 214 | - }, | |
| 215 | - isLeapYear (Year) { | |
| 216 | - if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0)) { | |
| 217 | - return true; | |
| 218 | - } else { | |
| 219 | - return false; | |
| 220 | - } | |
| 221 | - }, | |
| 222 | - getData(dVal){ | |
| 223 | - //用来处理初始化数据 | |
| 224 | - let curFlag=this.current; | |
| 225 | - let disabledAfter=this.disabledAfter; | |
| 226 | - let fields=this.fields; | |
| 227 | - let curDate=this.getCurrenDate(); | |
| 228 | - let curYear=curDate.curYear; | |
| 229 | - let curMonthdays=curDate.curMonthdays; | |
| 230 | - let curMonth=curDate.curMonth; | |
| 231 | - let curDay=curDate.curDay; | |
| 232 | - let curHour=curDate.curHour; | |
| 233 | - let curMinute=curDate.curMinute; | |
| 234 | - let curSecond=curDate.curSecond; | |
| 235 | - let defaultDate=this.getDefaultDate(); | |
| 236 | - let startYear=this.getStartDate().getFullYear(); | |
| 237 | - let endYear=this.getEndDate().getFullYear(); | |
| 238 | - //颗粒度,禁用当前之后日期仅对year,month,day,hour生效;分钟秒禁用没有意义, | |
| 239 | - let years=[],months=[],days=[],hours=[],minutes=[],seconds=[]; | |
| 240 | - let year=dVal[0]*1; | |
| 241 | - let month=dVal[1]*1; | |
| 242 | - let day=dVal[2]*1; | |
| 243 | - let hour=dVal[3]*1; | |
| 244 | - let minute=dVal[4]*1; | |
| 245 | - let monthsLen=disabledAfter?(year<curYear?12:curDate.curMonth):12; | |
| 246 | - let daysLen=disabledAfter?((year<curYear||month<curMonth)?defaultDate.defaultDays:curDay):(curFlag?curMonthdays:defaultDate.defaultDays); | |
| 247 | - let hoursLen=disabledAfter?((year<curYear||month<curMonth||day<curDay)?24:curHour+1):24; | |
| 248 | - let minutesLen=disabledAfter?((year<curYear||month<curMonth||day<curDay||hour<curHour)?60:curMinute+1):60; | |
| 249 | - let secondsLen=disabledAfter?((year<curYear||month<curMonth||day<curDay||hour<curHour||minute<curMinute)?60:curSecond+1):60; | |
| 250 | - for(let year=startYear;year<=(disabledAfter?curYear:endYear);year++){ | |
| 251 | - years.push(year.toString()) | |
| 252 | - } | |
| 253 | - for(let month=1;month<=monthsLen;month++){ | |
| 254 | - months.push(this.formatNum(month)); | |
| 255 | - } | |
| 256 | - for(let day=1;day<=daysLen;day++){ | |
| 257 | - days.push(this.formatNum(day)); | |
| 258 | - } | |
| 259 | - for(let hour=0;hour<hoursLen;hour++){ | |
| 260 | - hours.push(this.formatNum(hour)); | |
| 261 | - } | |
| 262 | - for(let minute=0;minute<minutesLen;minute++){ | |
| 263 | - minutes.push(this.formatNum(minute)); | |
| 264 | - } | |
| 265 | - // for(let second=0;second<(disabledAfter?curDate.curSecond+1:60);second++){ | |
| 266 | - // seconds.push(this.formatNum(second)); | |
| 267 | - // } | |
| 268 | - for(let second=0;second<60;second++){ | |
| 269 | - seconds.push(this.formatNum(second)); | |
| 270 | - } | |
| 271 | - return { | |
| 272 | - years, | |
| 273 | - months, | |
| 274 | - days, | |
| 275 | - hours, | |
| 276 | - minutes, | |
| 277 | - seconds | |
| 278 | - } | |
| 279 | - }, | |
| 280 | - getCurrenDate(){ | |
| 281 | - let curDate=new Date(); | |
| 282 | - let curYear=curDate.getFullYear(); | |
| 283 | - let curMonth=curDate.getMonth()+1; | |
| 284 | - let curMonthdays=new Date(curYear,curMonth,0).getDate(); | |
| 285 | - let curDay=curDate.getDate(); | |
| 286 | - let curHour=curDate.getHours(); | |
| 287 | - let curMinute=curDate.getMinutes(); | |
| 288 | - let curSecond=curDate.getSeconds(); | |
| 289 | - return{ | |
| 290 | - curDate, | |
| 291 | - curYear, | |
| 292 | - curMonth, | |
| 293 | - curMonthdays, | |
| 294 | - curDay, | |
| 295 | - curHour, | |
| 296 | - curMinute, | |
| 297 | - curSecond | |
| 298 | - } | |
| 299 | - }, | |
| 300 | - getDefaultDate(){ | |
| 301 | - let value=this.value; | |
| 302 | - let reg=/-/g; | |
| 303 | - let defaultDate=value?new Date(value.replace(reg,"/")):new Date(); | |
| 304 | - let defaultYear=defaultDate.getFullYear(); | |
| 305 | - let defaultMonth=defaultDate.getMonth()+1; | |
| 306 | - let defaultDay=defaultDate.getDate(); | |
| 307 | - let defaultDays=new Date(defaultYear,defaultMonth,0).getDate()*1; | |
| 308 | - return{ | |
| 309 | - defaultDate, | |
| 310 | - defaultYear, | |
| 311 | - defaultMonth, | |
| 312 | - defaultDay, | |
| 313 | - defaultDays | |
| 314 | - } | |
| 315 | - }, | |
| 316 | - getStartDate(){ | |
| 317 | - let start=this.startYear; | |
| 318 | - let startDate=""; | |
| 319 | - let reg=/-/g; | |
| 320 | - if(start){ | |
| 321 | - startDate=new Date(start+"/01/01"); | |
| 322 | - }else{ | |
| 323 | - startDate=new Date("1970/01/01"); | |
| 324 | - } | |
| 325 | - return startDate; | |
| 326 | - }, | |
| 327 | - getEndDate(){ | |
| 328 | - let end=this.endYear; | |
| 329 | - let reg=/-/g; | |
| 330 | - let endDate=""; | |
| 331 | - if(end){ | |
| 332 | - endDate=new Date(end+"/12/01"); | |
| 333 | - }else{ | |
| 334 | - endDate=new Date(); | |
| 335 | - } | |
| 336 | - return endDate; | |
| 337 | - }, | |
| 338 | - getDval(){ | |
| 339 | - let value=this.value; | |
| 340 | - let fields=this.fields; | |
| 341 | - let dVal=null; | |
| 342 | - let aDate=new Date(); | |
| 343 | - let year=this.formatNum(aDate.getFullYear()); | |
| 344 | - let month=this.formatNum(aDate.getMonth()+1); | |
| 345 | - let day=this.formatNum(aDate.getDate()); | |
| 346 | - let hour=this.formatNum(aDate.getHours()); | |
| 347 | - let minute=this.formatNum(aDate.getMinutes()); | |
| 348 | - let second=this.formatNum(aDate.getSeconds()); | |
| 349 | - if(value){ | |
| 350 | - let flag=this.checkValue(value); | |
| 351 | - if(!flag){ | |
| 352 | - dVal=[year,month,day,hour,minute,second] | |
| 353 | - }else{ | |
| 354 | - switch(this.fields){ | |
| 355 | - case "year": | |
| 356 | - dVal=value?[value]:[]; | |
| 357 | - break; | |
| 358 | - case "month": | |
| 359 | - dVal=value?value.split("-"):[]; | |
| 360 | - break; | |
| 361 | - case "day": | |
| 362 | - dVal=value?value.split("-"):[]; | |
| 363 | - break; | |
| 364 | - case "hour": | |
| 365 | - dVal=[...value.split(" ")[0].split("-"),...value.split(" ")[1].split(":")]; | |
| 366 | - break; | |
| 367 | - case "minute": | |
| 368 | - dVal=value?[...value.split(" ")[0].split("-"),...value.split(" ")[1].split(":")]:[]; | |
| 369 | - break; | |
| 370 | - case "second": | |
| 371 | - dVal=[...value.split(" ")[0].split("-"),...value.split(" ")[1].split(":")]; | |
| 372 | - break; | |
| 373 | - } | |
| 374 | - } | |
| 375 | - }else{ | |
| 376 | - dVal=[year,month,day,hour,minute,second] | |
| 377 | - } | |
| 378 | - return dVal; | |
| 379 | - }, | |
| 380 | - initData(){ | |
| 381 | - let startDate,endDate,startYear,endYear,startMonth,endMonth,startDay,endDay; | |
| 382 | - let years=[],months=[],days=[],hours=[],minutes=[],seconds=[]; | |
| 383 | - let dVal=[],pickVal=[]; | |
| 384 | - let value=this.value; | |
| 385 | - let reg=/-/g; | |
| 386 | - let range={}; | |
| 387 | - let result="",full="",year,month,day,hour,minute,second,obj={}; | |
| 388 | - let defaultDate=this.getDefaultDate(); | |
| 389 | - let defaultYear=defaultDate.defaultYear; | |
| 390 | - let defaultMonth=defaultDate.defaultMonth; | |
| 391 | - let defaultDay=defaultDate.defaultDay; | |
| 392 | - let defaultDays=defaultDate.defaultDays; | |
| 393 | - let curFlag=this.current; | |
| 394 | - let disabledAfter=this.disabledAfter; | |
| 395 | - let curDate=this.getCurrenDate(); | |
| 396 | - let curYear=curDate.curYear; | |
| 397 | - let curMonth=curDate.curMonth; | |
| 398 | - let curMonthdays=curDate.curMonthdays; | |
| 399 | - let curDay=curDate.curDay; | |
| 400 | - let curHour=curDate.curHour; | |
| 401 | - let curMinute=curDate.curMinute; | |
| 402 | - let curSecond=curDate.curSecond; | |
| 403 | - let dateData=[]; | |
| 404 | - dVal=this.getDval(); | |
| 405 | - | |
| 406 | - startDate=this.getStartDate(); | |
| 407 | - endDate=this.getEndDate(); | |
| 408 | - startYear=startDate.getFullYear(); | |
| 409 | - startMonth=startDate.getMonth(); | |
| 410 | - startDay=startDate.getDate(); | |
| 411 | - endYear=endDate.getFullYear(); | |
| 412 | - endMonth=endDate.getMonth(); | |
| 413 | - endDay=endDate.getDate(); | |
| 414 | - dateData=this.getData(dVal); | |
| 415 | - years=dateData.years; | |
| 416 | - months=dateData.months; | |
| 417 | - days=dateData.days; | |
| 418 | - hours=dateData.hours; | |
| 419 | - minutes=dateData.minutes; | |
| 420 | - seconds=dateData.seconds; | |
| 421 | - switch(this.fields){ | |
| 422 | - case "year": | |
| 423 | - pickVal=disabledAfter?[ | |
| 424 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0 | |
| 425 | - ]:(curFlag?[ | |
| 426 | - years.indexOf(curYear+'') | |
| 427 | - ]:[ | |
| 428 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0 | |
| 429 | - ]); | |
| 430 | - range={years}; | |
| 431 | - year=dVal[0]?dVal[0]:years[0]; | |
| 432 | - result=full=`${year}`; | |
| 433 | - obj={ | |
| 434 | - year | |
| 435 | - } | |
| 436 | - break; | |
| 437 | - case "month": | |
| 438 | - pickVal=disabledAfter?[ | |
| 439 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 440 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0 | |
| 441 | - ]:(curFlag?[ | |
| 442 | - years.indexOf(curYear+''), | |
| 443 | - months.indexOf(this.formatNum(curMonth)) | |
| 444 | - ]:[ | |
| 445 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 446 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0 | |
| 447 | - ]); | |
| 448 | - range={years,months}; | |
| 449 | - year=dVal[0]?dVal[0]:years[0]; | |
| 450 | - month=dVal[1]?dVal[1]:months[0]; | |
| 451 | - result=full=`${year+'-'+month}`; | |
| 452 | - obj={ | |
| 453 | - year, | |
| 454 | - month | |
| 455 | - } | |
| 456 | - break; | |
| 457 | - case "day": | |
| 458 | - pickVal=disabledAfter?[ | |
| 459 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 460 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 461 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0 | |
| 462 | - ]:(curFlag?[ | |
| 463 | - years.indexOf(curYear+''), | |
| 464 | - months.indexOf(this.formatNum(curMonth)), | |
| 465 | - days.indexOf(this.formatNum(curDay)), | |
| 466 | - ]:[ | |
| 467 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 468 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 469 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0 | |
| 470 | - ]); | |
| 471 | - range={years,months,days}; | |
| 472 | - year=dVal[0]?dVal[0]:years[0]; | |
| 473 | - month=dVal[1]?dVal[1]:months[0]; | |
| 474 | - day=dVal[2]?dVal[2]:days[0]; | |
| 475 | - result=full=`${year+'-'+month+'-'+day}`; | |
| 476 | - obj={ | |
| 477 | - year, | |
| 478 | - month, | |
| 479 | - day | |
| 480 | - } | |
| 481 | - break; | |
| 482 | - case "hour": | |
| 483 | - pickVal=disabledAfter?[ | |
| 484 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 485 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 486 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 487 | - dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0 | |
| 488 | - ]:(curFlag?[ | |
| 489 | - years.indexOf(curYear+''), | |
| 490 | - months.indexOf(this.formatNum(curMonth)), | |
| 491 | - days.indexOf(this.formatNum(curDay)), | |
| 492 | - hours.indexOf(this.formatNum(curHour)), | |
| 493 | - ]:[ | |
| 494 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 495 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 496 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 497 | - dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0 | |
| 498 | - ]); | |
| 499 | - range={years,months,days,hours}; | |
| 500 | - year=dVal[0]?dVal[0]:years[0]; | |
| 501 | - month=dVal[1]?dVal[1]:months[0]; | |
| 502 | - day=dVal[2]?dVal[2]:days[0]; | |
| 503 | - hour=dVal[3]?dVal[3]:hours[0]; | |
| 504 | - result=`${year+'-'+month+'-'+day+' '+hour}`; | |
| 505 | - full=`${year+'-'+month+'-'+day+' '+hour+':00:00'}`; | |
| 506 | - obj={ | |
| 507 | - year, | |
| 508 | - month, | |
| 509 | - day, | |
| 510 | - hour | |
| 511 | - } | |
| 512 | - break; | |
| 513 | - case "minute": | |
| 514 | - pickVal=disabledAfter?[ | |
| 515 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 516 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 517 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 518 | - dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0, | |
| 519 | - dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0 | |
| 520 | - ]:(curFlag?[ | |
| 521 | - years.indexOf(curYear+''), | |
| 522 | - months.indexOf(this.formatNum(curMonth)), | |
| 523 | - days.indexOf(this.formatNum(curDay)), | |
| 524 | - hours.indexOf(this.formatNum(curHour)), | |
| 525 | - minutes.indexOf(this.formatNum(curMinute)), | |
| 526 | - ]:[ | |
| 527 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 528 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 529 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 530 | - dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0, | |
| 531 | - dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0 | |
| 532 | - ]); | |
| 533 | - range={years,months,days,hours,minutes}; | |
| 534 | - year=dVal[0]?dVal[0]:years[0]; | |
| 535 | - month=dVal[1]?dVal[1]:months[0]; | |
| 536 | - day=dVal[2]?dVal[2]:days[0]; | |
| 537 | - hour=dVal[3]?dVal[3]:hours[0]; | |
| 538 | - minute=dVal[4]?dVal[4]:minutes[0]; | |
| 539 | - full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':00'}`; | |
| 540 | - result=`${year+'-'+month+'-'+day+' '+hour+':'+minute}`; | |
| 541 | - obj={ | |
| 542 | - year, | |
| 543 | - month, | |
| 544 | - day, | |
| 545 | - hour, | |
| 546 | - minute | |
| 547 | - } | |
| 548 | - break; | |
| 549 | - case "second": | |
| 550 | - pickVal=disabledAfter?[ | |
| 551 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 552 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 553 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 554 | - dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0, | |
| 555 | - dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0, | |
| 556 | - dVal[5]&&seconds.indexOf(dVal[5])!=-1?seconds.indexOf(dVal[5]):0 | |
| 557 | - ]:(curFlag?[ | |
| 558 | - years.indexOf(curYear+''), | |
| 559 | - months.indexOf(this.formatNum(curMonth)), | |
| 560 | - days.indexOf(this.formatNum(curDay)), | |
| 561 | - hours.indexOf(this.formatNum(curHour)), | |
| 562 | - minutes.indexOf(this.formatNum(curMinute)), | |
| 563 | - seconds.indexOf(this.formatNum(curSecond)), | |
| 564 | - ]:[ | |
| 565 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 566 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 567 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 568 | - dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0, | |
| 569 | - dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0, | |
| 570 | - dVal[5]&&seconds.indexOf(dVal[5])!=-1?seconds.indexOf(dVal[5]):0 | |
| 571 | - ]); | |
| 572 | - range={years,months,days,hours,minutes,seconds}; | |
| 573 | - year=dVal[0]?dVal[0]:years[0]; | |
| 574 | - month=dVal[1]?dVal[1]:months[0]; | |
| 575 | - day=dVal[2]?dVal[2]:days[0]; | |
| 576 | - hour=dVal[3]?dVal[3]:hours[0]; | |
| 577 | - minute=dVal[4]?dVal[4]:minutes[0]; | |
| 578 | - second=dVal[5]?dVal[5]:seconds[0]; | |
| 579 | - result=full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`; | |
| 580 | - obj={ | |
| 581 | - year, | |
| 582 | - month, | |
| 583 | - day, | |
| 584 | - hour, | |
| 585 | - minute, | |
| 586 | - second | |
| 587 | - } | |
| 588 | - break; | |
| 589 | - default: | |
| 590 | - range={years,months,days}; | |
| 591 | - break; | |
| 592 | - } | |
| 593 | - this.range=range; | |
| 594 | - this.checkObj=obj; | |
| 595 | - this.$emit("change",{ | |
| 596 | - result:result, | |
| 597 | - value:full, | |
| 598 | - obj:obj | |
| 599 | - }); | |
| 600 | - this.$nextTick(()=>{ | |
| 601 | - this.pickVal=pickVal; | |
| 602 | - }) | |
| 603 | - }, | |
| 604 | - handlerChange(e){ | |
| 605 | - let arr=[...e.detail.value]; | |
| 606 | - let data=this.range; | |
| 607 | - let year="",month="",day="",hour="",minute="",second=""; | |
| 608 | - let result="",full="",obj={}; | |
| 609 | - let months=null,days=null,hours=null,minutes=null,seconds=null; | |
| 610 | - let disabledAfter=this.disabledAfter; | |
| 611 | - let leapYear=false,resetData={}; | |
| 612 | - year=(arr[0]||arr[0]==0)?data.years[arr[0]]||data.years[data.years.length-1]:""; | |
| 613 | - month=(arr[1]||arr[1]==0)?data.months[arr[1]]||data.months[data.months.length-1]:""; | |
| 614 | - day=(arr[2]||arr[2]==0)?data.days[arr[2]]||data.days[data.days.length-1]:""; | |
| 615 | - hour=(arr[3]||arr[3]==0)?data.hours[arr[3]]||data.hours[data.hours.length-1]:""; | |
| 616 | - minute=(arr[4]||arr[4]==0)?data.minutes[arr[4]]||data.minutes[data.minutes.length-1]:""; | |
| 617 | - second=(arr[5]||arr[5]==0)?data.seconds[arr[5]]||data.seconds[data.seconds.length-1]:""; | |
| 618 | - resetData=this.resetData(year,month,day,hour,minute);//重新拉取当前日期数据; | |
| 619 | - leapYear=this.isLeapYear(year);//判断是否为闰年; | |
| 620 | - switch(this.fields){ | |
| 621 | - case "year": | |
| 622 | - result=full=`${year}`; | |
| 623 | - obj={ | |
| 624 | - year | |
| 625 | - }; | |
| 626 | - break; | |
| 627 | - case "month": | |
| 628 | - result=full=`${year+'-'+month}`; | |
| 629 | - if(this.disabledAfter)months=resetData.months; | |
| 630 | - if(months)this.range.months=months; | |
| 631 | - obj={ | |
| 632 | - year, | |
| 633 | - month | |
| 634 | - } | |
| 635 | - break; | |
| 636 | - case "day": | |
| 637 | - result=full=`${year+'-'+month+'-'+day}`; | |
| 638 | - if(this.disabledAfter){ | |
| 639 | - months=resetData.months; | |
| 640 | - days=resetData.days; | |
| 641 | - }else{ | |
| 642 | - if(leapYear||(month!=this.checkObj.month)||month==2){ | |
| 643 | - days=resetData.days; | |
| 644 | - } | |
| 645 | - } | |
| 646 | - if(months)this.range.months=months; | |
| 647 | - if(days)this.range.days=days; | |
| 648 | - obj={ | |
| 649 | - year, | |
| 650 | - month, | |
| 651 | - day | |
| 652 | - } | |
| 653 | - break; | |
| 654 | - case "hour": | |
| 655 | - result=`${year+'-'+month+'-'+day+' '+hour}`; | |
| 656 | - full=`${year+'-'+month+'-'+day+' '+hour+':00:00'}`; | |
| 657 | - if(this.disabledAfter){ | |
| 658 | - months=resetData.months; | |
| 659 | - days=resetData.days; | |
| 660 | - hours=resetData.hours; | |
| 661 | - }else{ | |
| 662 | - if(leapYear||(month!=this.checkObj.month)||month==2){ | |
| 663 | - days=resetData.days; | |
| 664 | - } | |
| 665 | - } | |
| 666 | - if(months)this.range.months=months; | |
| 667 | - if(days)this.range.days=days; | |
| 668 | - if(hours)this.range.hours=hours; | |
| 669 | - obj={ | |
| 670 | - year, | |
| 671 | - month, | |
| 672 | - day, | |
| 673 | - hour | |
| 674 | - } | |
| 675 | - break; | |
| 676 | - case "minute": | |
| 677 | - full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':00'}`; | |
| 678 | - result=`${year+'-'+month+'-'+day+' '+hour+':'+minute}`; | |
| 679 | - if(this.disabledAfter){ | |
| 680 | - months=resetData.months; | |
| 681 | - days=resetData.days; | |
| 682 | - hours=resetData.hours; | |
| 683 | - minutes=resetData.minutes; | |
| 684 | - }else{ | |
| 685 | - if(leapYear||(month!=this.checkObj.month)||month==2){ | |
| 686 | - days=resetData.days; | |
| 687 | - } | |
| 688 | - } | |
| 689 | - if(months)this.range.months=months; | |
| 690 | - if(days)this.range.days=days; | |
| 691 | - if(hours)this.range.hours=hours; | |
| 692 | - if(minutes)this.range.minutes=minutes; | |
| 693 | - obj={ | |
| 694 | - year, | |
| 695 | - month, | |
| 696 | - day, | |
| 697 | - hour, | |
| 698 | - minute | |
| 699 | - }; | |
| 700 | - break; | |
| 701 | - case "second": | |
| 702 | - result=full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`; | |
| 703 | - if(this.disabledAfter){ | |
| 704 | - months=resetData.months; | |
| 705 | - days=resetData.days; | |
| 706 | - hours=resetData.hours; | |
| 707 | - minutes=resetData.minutes; | |
| 708 | - //seconds=resetData.seconds; | |
| 709 | - }else{ | |
| 710 | - if(leapYear||(month!=this.checkObj.month)||month==2){ | |
| 711 | - days=resetData.days; | |
| 712 | - } | |
| 713 | - } | |
| 714 | - if(months)this.range.months=months; | |
| 715 | - if(days)this.range.days=days; | |
| 716 | - if(hours)this.range.hours=hours; | |
| 717 | - if(minutes)this.range.minutes=minutes; | |
| 718 | - //if(seconds)this.range.seconds=seconds; | |
| 719 | - obj={ | |
| 720 | - year, | |
| 721 | - month, | |
| 722 | - day, | |
| 723 | - hour, | |
| 724 | - minute, | |
| 725 | - second | |
| 726 | - } | |
| 727 | - break; | |
| 728 | - } | |
| 729 | - this.checkObj=obj; | |
| 730 | - this.$emit("change",{ | |
| 731 | - result:result, | |
| 732 | - value:full, | |
| 733 | - obj:obj | |
| 734 | - }) | |
| 735 | - } | |
| 736 | - } | |
| 737 | - } | |
| 738 | -</script> | |
| 739 | - | |
| 740 | -<style lang="scss"> | |
| 741 | - @import "./w-picker.css"; | |
| 742 | -</style> |
yudao-ui-app/components/w-picker/half-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view> | |
| 6 | - </picker-view-column> | |
| 7 | - <picker-view-column> | |
| 8 | - <view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view> | |
| 9 | - </picker-view-column> | |
| 10 | - <picker-view-column> | |
| 11 | - <view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view> | |
| 12 | - </picker-view-column> | |
| 13 | - <picker-view-column> | |
| 14 | - <view class="w-picker-item" v-for="(item,index) in range.sections" :key="index">{{item}}</view> | |
| 15 | - </picker-view-column> | |
| 16 | - </picker-view> | |
| 17 | - </view> | |
| 18 | -</template> | |
| 19 | - | |
| 20 | -<script> | |
| 21 | - export default { | |
| 22 | - data() { | |
| 23 | - return { | |
| 24 | - pickVal:[], | |
| 25 | - range:{}, | |
| 26 | - checkObj:{} | |
| 27 | - }; | |
| 28 | - }, | |
| 29 | - props:{ | |
| 30 | - itemHeight:{ | |
| 31 | - type:String, | |
| 32 | - default:"44px" | |
| 33 | - }, | |
| 34 | - startYear:{ | |
| 35 | - type:String, | |
| 36 | - default:"" | |
| 37 | - }, | |
| 38 | - endYear:{ | |
| 39 | - type:String, | |
| 40 | - default:"" | |
| 41 | - }, | |
| 42 | - value:{ | |
| 43 | - type:[String,Array,Number], | |
| 44 | - default:"" | |
| 45 | - }, | |
| 46 | - current:{//是否默认选中当前日期 | |
| 47 | - type:Boolean, | |
| 48 | - default:false | |
| 49 | - }, | |
| 50 | - disabledAfter:{//是否禁用当前之后的日期 | |
| 51 | - type:Boolean, | |
| 52 | - default:false | |
| 53 | - } | |
| 54 | - }, | |
| 55 | - watch:{ | |
| 56 | - value(val){ | |
| 57 | - this.initData(); | |
| 58 | - } | |
| 59 | - }, | |
| 60 | - created() { | |
| 61 | - this.initData(); | |
| 62 | - }, | |
| 63 | - methods:{ | |
| 64 | - formatNum(n){ | |
| 65 | - return (Number(n)<10?'0'+Number(n):Number(n)+''); | |
| 66 | - }, | |
| 67 | - checkValue(value){ | |
| 68 | - let strReg=/^\d{4}-\d{2}-\d{2} [\u4e00-\u9fa5]{2}$/,example; | |
| 69 | - if(!strReg.test(value)){ | |
| 70 | - console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+"")) | |
| 71 | - } | |
| 72 | - return strReg.test(value); | |
| 73 | - }, | |
| 74 | - resetData(year,month,day){ | |
| 75 | - let curDate=this.getCurrenDate(); | |
| 76 | - let curFlag=this.current; | |
| 77 | - let curYear=curDate.curYear; | |
| 78 | - let curMonth=curDate.curMonth; | |
| 79 | - let curDay=curDate.curDay; | |
| 80 | - let curHour=curDate.curHour; | |
| 81 | - let months=[],days=[],sections=[]; | |
| 82 | - let disabledAfter=this.disabledAfter; | |
| 83 | - let monthsLen=disabledAfter?(year*1<curYear?12:curMonth):12; | |
| 84 | - let totalDays=new Date(year,month,0).getDate();//计算当月有几天; | |
| 85 | - let daysLen=disabledAfter?((year*1<curYear||month*1<curMonth)?totalDays:curDay):totalDays; | |
| 86 | - let sectionFlag=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay)==true?false:true):(curHour>12==true?true:false); | |
| 87 | - sections=["上午","下午"]; | |
| 88 | - for(let month=1;month<=monthsLen;month++){ | |
| 89 | - months.push(this.formatNum(month)); | |
| 90 | - }; | |
| 91 | - for(let day=1;day<=daysLen;day++){ | |
| 92 | - days.push(this.formatNum(day)); | |
| 93 | - } | |
| 94 | - if(sectionFlag){ | |
| 95 | - sections=["上午"]; | |
| 96 | - } | |
| 97 | - return{ | |
| 98 | - months, | |
| 99 | - days, | |
| 100 | - sections | |
| 101 | - } | |
| 102 | - }, | |
| 103 | - getData(dVal){ | |
| 104 | - //用来处理初始化数据 | |
| 105 | - let curFlag=this.current; | |
| 106 | - let disabledAfter=this.disabledAfter; | |
| 107 | - let curDate=this.getCurrenDate(); | |
| 108 | - let curYear=curDate.curYear; | |
| 109 | - let curMonthdays=curDate.curMonthdays; | |
| 110 | - let curMonth=curDate.curMonth; | |
| 111 | - let curDay=curDate.curDay; | |
| 112 | - let curHour=curDate.curHour; | |
| 113 | - let defaultDate=this.getDefaultDate(); | |
| 114 | - let startYear=this.getStartDate().getFullYear(); | |
| 115 | - let endYear=this.getEndDate().getFullYear(); | |
| 116 | - let years=[],months=[],days=[],sections=[]; | |
| 117 | - let year=dVal[0]*1; | |
| 118 | - let month=dVal[1]*1; | |
| 119 | - let day=dVal[2]*1; | |
| 120 | - let monthsLen=disabledAfter?(year<curYear?12:curDate.curMonth):12; | |
| 121 | - let daysLen=disabledAfter?((year<curYear||month<curMonth)?defaultDate.defaultDays:curDay):(curFlag?curMonthdays:defaultDate.defaultDays); | |
| 122 | - let sectionFlag=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay)==true?false:true):(curHour>12==true?true:false); | |
| 123 | - for(let year=startYear;year<=(disabledAfter?curYear:endYear);year++){ | |
| 124 | - years.push(year.toString()) | |
| 125 | - } | |
| 126 | - for(let month=1;month<=monthsLen;month++){ | |
| 127 | - months.push(this.formatNum(month)); | |
| 128 | - } | |
| 129 | - for(let day=1;day<=daysLen;day++){ | |
| 130 | - days.push(this.formatNum(day)); | |
| 131 | - } | |
| 132 | - if(sectionFlag){ | |
| 133 | - sections=["下午"]; | |
| 134 | - }else{ | |
| 135 | - sections=["上午","下午"]; | |
| 136 | - } | |
| 137 | - return { | |
| 138 | - years, | |
| 139 | - months, | |
| 140 | - days, | |
| 141 | - sections | |
| 142 | - } | |
| 143 | - }, | |
| 144 | - getCurrenDate(){ | |
| 145 | - let curDate=new Date(); | |
| 146 | - let curYear=curDate.getFullYear(); | |
| 147 | - let curMonth=curDate.getMonth()+1; | |
| 148 | - let curMonthdays=new Date(curYear,curMonth,0).getDate(); | |
| 149 | - let curDay=curDate.getDate(); | |
| 150 | - let curHour=curDate.getHours(); | |
| 151 | - let curSection="上午"; | |
| 152 | - if(curHour>=12){ | |
| 153 | - curSection="下午"; | |
| 154 | - } | |
| 155 | - return{ | |
| 156 | - curDate, | |
| 157 | - curYear, | |
| 158 | - curMonth, | |
| 159 | - curMonthdays, | |
| 160 | - curDay, | |
| 161 | - curHour, | |
| 162 | - curSection | |
| 163 | - } | |
| 164 | - }, | |
| 165 | - getDefaultDate(){ | |
| 166 | - let value=this.value; | |
| 167 | - let reg=/-/g; | |
| 168 | - let defaultDate=value?new Date(value.split(" ")[0].replace(reg,"/")):new Date(); | |
| 169 | - let defaultYear=defaultDate.getFullYear(); | |
| 170 | - let defaultMonth=defaultDate.getMonth()+1; | |
| 171 | - let defaultDay=defaultDate.getDate(); | |
| 172 | - let defaultDays=new Date(defaultYear,defaultMonth,0).getDate()*1; | |
| 173 | - return{ | |
| 174 | - defaultDate, | |
| 175 | - defaultYear, | |
| 176 | - defaultMonth, | |
| 177 | - defaultDay, | |
| 178 | - defaultDays | |
| 179 | - } | |
| 180 | - }, | |
| 181 | - getStartDate(){ | |
| 182 | - let start=this.startYear; | |
| 183 | - let startDate=""; | |
| 184 | - let reg=/-/g; | |
| 185 | - if(start){ | |
| 186 | - startDate=new Date(start+"/01/01"); | |
| 187 | - }else{ | |
| 188 | - startDate=new Date("1970/01/01"); | |
| 189 | - } | |
| 190 | - return startDate; | |
| 191 | - }, | |
| 192 | - getEndDate(){ | |
| 193 | - let end=this.endYear; | |
| 194 | - let reg=/-/g; | |
| 195 | - let endDate=""; | |
| 196 | - if(end){ | |
| 197 | - endDate=new Date(end+"/12/31"); | |
| 198 | - }else{ | |
| 199 | - endDate=new Date(); | |
| 200 | - } | |
| 201 | - return endDate; | |
| 202 | - }, | |
| 203 | - getDval(){ | |
| 204 | - let value=this.value; | |
| 205 | - let dVal=null; | |
| 206 | - let aDate=new Date(); | |
| 207 | - let year=this.formatNum(aDate.getFullYear()); | |
| 208 | - let month=this.formatNum(aDate.getMonth()+1); | |
| 209 | - let day=this.formatNum(aDate.getDate()); | |
| 210 | - let hour=aDate.getHours(); | |
| 211 | - let section="上午"; | |
| 212 | - if(hour>=12)section="下午"; | |
| 213 | - if(value){ | |
| 214 | - let flag=this.checkValue(value); | |
| 215 | - if(!flag){ | |
| 216 | - dVal=[year,month,day,section] | |
| 217 | - }else{ | |
| 218 | - let v=value.split(" "); | |
| 219 | - dVal=[...v[0].split("-"),v[1]]; | |
| 220 | - } | |
| 221 | - }else{ | |
| 222 | - dVal=[year,month,day,section] | |
| 223 | - } | |
| 224 | - return dVal; | |
| 225 | - }, | |
| 226 | - initData(){ | |
| 227 | - let startDate,endDate,startYear,endYear,startMonth,endMonth,startDay,endDay; | |
| 228 | - let years=[],months=[],days=[],sections=[]; | |
| 229 | - let dVal=[],pickVal=[]; | |
| 230 | - let value=this.value; | |
| 231 | - let reg=/-/g; | |
| 232 | - let range={}; | |
| 233 | - let result="",full="",year,month,day,section,obj={}; | |
| 234 | - let defaultDate=this.getDefaultDate(); | |
| 235 | - let defaultYear=defaultDate.defaultYear; | |
| 236 | - let defaultMonth=defaultDate.defaultMonth; | |
| 237 | - let defaultDay=defaultDate.defaultDay; | |
| 238 | - let defaultDays=defaultDate.defaultDays; | |
| 239 | - let curFlag=this.current; | |
| 240 | - let disabledAfter=this.disabledAfter; | |
| 241 | - let curDate=this.getCurrenDate(); | |
| 242 | - let curYear=curDate.curYear; | |
| 243 | - let curMonth=curDate.curMonth; | |
| 244 | - let curMonthdays=curDate.curMonthdays; | |
| 245 | - let curDay=curDate.curDay; | |
| 246 | - let curSection=curDate.curSection; | |
| 247 | - let dateData=[]; | |
| 248 | - dVal=this.getDval(); | |
| 249 | - startDate=this.getStartDate(); | |
| 250 | - endDate=this.getEndDate(); | |
| 251 | - startYear=startDate.getFullYear(); | |
| 252 | - startMonth=startDate.getMonth(); | |
| 253 | - startDay=startDate.getDate(); | |
| 254 | - endYear=endDate.getFullYear(); | |
| 255 | - endMonth=endDate.getMonth(); | |
| 256 | - endDay=endDate.getDate(); | |
| 257 | - dateData=this.getData(dVal); | |
| 258 | - years=dateData.years; | |
| 259 | - months=dateData.months; | |
| 260 | - days=dateData.days; | |
| 261 | - sections=dateData.sections; | |
| 262 | - pickVal=disabledAfter?[ | |
| 263 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 264 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 265 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 266 | - dVal[3]&§ions.indexOf(dVal[3])!=-1?sections.indexOf(dVal[3]):0 | |
| 267 | - ]:(curFlag?[ | |
| 268 | - years.indexOf(curYear+''), | |
| 269 | - months.indexOf(this.formatNum(curMonth)), | |
| 270 | - days.indexOf(this.formatNum(curDay)), | |
| 271 | - sections.indexOf(curSection), | |
| 272 | - ]:[ | |
| 273 | - dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0, | |
| 274 | - dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0, | |
| 275 | - dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0, | |
| 276 | - dVal[3]&§ions.indexOf(dVal[3])!=-1?sections.indexOf(dVal[3]):0 | |
| 277 | - ]); | |
| 278 | - range={years,months,days,sections}; | |
| 279 | - year=dVal[0]?dVal[0]:years[0]; | |
| 280 | - month=dVal[1]?dVal[1]:months[0]; | |
| 281 | - day=dVal[2]?dVal[2]:days[0]; | |
| 282 | - section=dVal[3]?dVal[3]:sections[0]; | |
| 283 | - result=full=`${year+'-'+month+'-'+day+' '+section}`; | |
| 284 | - obj={ | |
| 285 | - year, | |
| 286 | - month, | |
| 287 | - day, | |
| 288 | - section | |
| 289 | - } | |
| 290 | - this.range=range; | |
| 291 | - this.checkObj=obj; | |
| 292 | - this.$nextTick(()=>{ | |
| 293 | - this.pickVal=pickVal; | |
| 294 | - }); | |
| 295 | - this.$emit("change",{ | |
| 296 | - result:result, | |
| 297 | - value:full, | |
| 298 | - obj:obj | |
| 299 | - }) | |
| 300 | - }, | |
| 301 | - handlerChange(e){ | |
| 302 | - let arr=[...e.detail.value]; | |
| 303 | - let data=this.range; | |
| 304 | - let year="",month="",day="",section=""; | |
| 305 | - let result="",full="",obj={}; | |
| 306 | - let months=null,days=null,sections=null; | |
| 307 | - let disabledAfter=this.disabledAfter; | |
| 308 | - year=(arr[0]||arr[0]==0)?data.years[arr[0]]||data.years[data.years.length-1]:""; | |
| 309 | - month=(arr[1]||arr[1]==0)?data.months[arr[1]]||data.months[data.months.length-1]:""; | |
| 310 | - day=(arr[2]||arr[2]==0)?data.days[arr[2]]||data.days[data.days.length-1]:""; | |
| 311 | - section=(arr[3]||arr[3]==0)?data.sections[arr[3]]||data.sections[data.sections.length-1]:""; | |
| 312 | - result=full=`${year+'-'+month+'-'+day+' '+section}`; | |
| 313 | - let resetData=this.resetData(year,month,day); | |
| 314 | - if(this.disabledAfter){ | |
| 315 | - months=resetData.months; | |
| 316 | - days=resetData.days; | |
| 317 | - sections=resetData.sections; | |
| 318 | - }else{ | |
| 319 | - if(year%4==0||(month!=this.checkObj.month)){ | |
| 320 | - days=resetData.days; | |
| 321 | - } | |
| 322 | - } | |
| 323 | - if(months)this.range.months=months; | |
| 324 | - if(days)this.range.days=days; | |
| 325 | - if(sections)this.range.sections=sections; | |
| 326 | - obj={ | |
| 327 | - year, | |
| 328 | - month, | |
| 329 | - day, | |
| 330 | - section | |
| 331 | - } | |
| 332 | - this.checkObj=obj; | |
| 333 | - this.$emit("change",{ | |
| 334 | - result:result, | |
| 335 | - value:full, | |
| 336 | - obj:obj | |
| 337 | - }) | |
| 338 | - } | |
| 339 | - } | |
| 340 | - } | |
| 341 | -</script> | |
| 342 | - | |
| 343 | -<style lang="scss"> | |
| 344 | - @import "./w-picker.css"; | |
| 345 | -</style> |
yudao-ui-app/components/w-picker/linkage-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column v-for="(group,gIndex) in range" :key="gIndex"> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in group" :key="index">{{item[nodeKey]}}</view> | |
| 6 | - </picker-view-column> | |
| 7 | - </picker-view> | |
| 8 | - </view> | |
| 9 | -</template> | |
| 10 | - | |
| 11 | -<script> | |
| 12 | - export default { | |
| 13 | - data() { | |
| 14 | - return { | |
| 15 | - pickVal:[], | |
| 16 | - range:[], | |
| 17 | - checkObj:{} | |
| 18 | - }; | |
| 19 | - }, | |
| 20 | - props:{ | |
| 21 | - itemHeight:{ | |
| 22 | - type:String, | |
| 23 | - default:"44px" | |
| 24 | - }, | |
| 25 | - value:{ | |
| 26 | - type:[Array,String], | |
| 27 | - default:"" | |
| 28 | - }, | |
| 29 | - defaultType:{ | |
| 30 | - type:String, | |
| 31 | - default:"label" | |
| 32 | - }, | |
| 33 | - options:{ | |
| 34 | - type:Array, | |
| 35 | - default(){ | |
| 36 | - return [] | |
| 37 | - } | |
| 38 | - }, | |
| 39 | - defaultProps:{ | |
| 40 | - type:Object, | |
| 41 | - default(){ | |
| 42 | - return{ | |
| 43 | - lable:"label", | |
| 44 | - value:"value", | |
| 45 | - children:"children" | |
| 46 | - } | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - level:{ | |
| 50 | - //多级联动层级,表示几级联动 | |
| 51 | - type:[Number,String], | |
| 52 | - default:2 | |
| 53 | - } | |
| 54 | - }, | |
| 55 | - computed:{ | |
| 56 | - nodeKey(){ | |
| 57 | - return this.defaultProps.label; | |
| 58 | - }, | |
| 59 | - nodeVal(){ | |
| 60 | - return this.defaultProps.value; | |
| 61 | - }, | |
| 62 | - nodeChild(){ | |
| 63 | - return this.defaultProps.children; | |
| 64 | - } | |
| 65 | - }, | |
| 66 | - watch:{ | |
| 67 | - value(val){ | |
| 68 | - if(this.options.length!=0){ | |
| 69 | - this.initData(); | |
| 70 | - } | |
| 71 | - }, | |
| 72 | - options(val){ | |
| 73 | - this.initData(); | |
| 74 | - } | |
| 75 | - }, | |
| 76 | - created() { | |
| 77 | - if(this.options.length!=0){ | |
| 78 | - this.initData(); | |
| 79 | - } | |
| 80 | - }, | |
| 81 | - methods:{ | |
| 82 | - getData(){ | |
| 83 | - //用来处理初始化数据 | |
| 84 | - let options=this.options; | |
| 85 | - let col1={},col2={},col3={},col4={}; | |
| 86 | - let arr1=options,arr2=[],arr3=[],arr4=[]; | |
| 87 | - let col1Index=0,col2Index=0,col3Index=0,col4Index=0; | |
| 88 | - let a1="",a2="",a3="",a4=""; | |
| 89 | - let dVal=[],obj={}; | |
| 90 | - let value=this.value; | |
| 91 | - let data=[]; | |
| 92 | - a1=value[0]; | |
| 93 | - a2=value[1]; | |
| 94 | - if(this.level>2){ | |
| 95 | - a3=value[2]; | |
| 96 | - } | |
| 97 | - if(this.level>3){ | |
| 98 | - a4=value[3]; | |
| 99 | - }; | |
| 100 | - /*第1列*/ | |
| 101 | - col1Index=arr1.findIndex((v)=>{ | |
| 102 | - return v[this.defaultType]==a1 | |
| 103 | - }); | |
| 104 | - col1Index=value?(col1Index!=-1?col1Index:0):0; | |
| 105 | - col1=arr1[col1Index]; | |
| 106 | - | |
| 107 | - /*第2列*/ | |
| 108 | - arr2=arr1[col1Index][this.nodeChild]; | |
| 109 | - col2Index=arr2.findIndex((v)=>{ | |
| 110 | - return v[this.defaultType]==a2 | |
| 111 | - }); | |
| 112 | - col2Index=value?(col2Index!=-1?col2Index:0):0; | |
| 113 | - col2=arr2[col2Index]; | |
| 114 | - | |
| 115 | - /*第3列*/ | |
| 116 | - if(this.level>2){ | |
| 117 | - arr3=arr2[col2Index][this.nodeChild]; | |
| 118 | - col3Index=arr3.findIndex((v)=>{ | |
| 119 | - return v[this.defaultType]==a3; | |
| 120 | - }); | |
| 121 | - col3Index=value?(col3Index!=-1?col3Index:0):0; | |
| 122 | - col3=arr3[col3Index]; | |
| 123 | - }; | |
| 124 | - | |
| 125 | - | |
| 126 | - /*第4列*/ | |
| 127 | - if(this.level>3){ | |
| 128 | - arr4=arr3[col4Index][this.nodeChild]; | |
| 129 | - col4Index=arr4.findIndex((v)=>{ | |
| 130 | - return v[this.defaultType]==a4; | |
| 131 | - }); | |
| 132 | - col4Index=value?(col4Index!=-1?col4Index:0):0; | |
| 133 | - col4=arr4[col4Index]; | |
| 134 | - }; | |
| 135 | - switch(this.level*1){ | |
| 136 | - case 2: | |
| 137 | - dVal=[col1Index,col2Index]; | |
| 138 | - obj={ | |
| 139 | - col1, | |
| 140 | - col2 | |
| 141 | - } | |
| 142 | - data=[arr1,arr2]; | |
| 143 | - break; | |
| 144 | - case 3: | |
| 145 | - dVal=[col1Index,col2Index,col3Index]; | |
| 146 | - obj={ | |
| 147 | - col1, | |
| 148 | - col2, | |
| 149 | - col3 | |
| 150 | - } | |
| 151 | - data=[arr1,arr2,arr3]; | |
| 152 | - break; | |
| 153 | - case 4: | |
| 154 | - dVal=[col1Index,col2Index,col3Index,col4Index]; | |
| 155 | - obj={ | |
| 156 | - col1, | |
| 157 | - col2, | |
| 158 | - col3, | |
| 159 | - col4 | |
| 160 | - } | |
| 161 | - data=[arr1,arr2,arr3,arr4]; | |
| 162 | - break | |
| 163 | - } | |
| 164 | - return { | |
| 165 | - data, | |
| 166 | - dVal, | |
| 167 | - obj | |
| 168 | - } | |
| 169 | - }, | |
| 170 | - initData(){ | |
| 171 | - let dataData=this.getData(); | |
| 172 | - let data=dataData.data; | |
| 173 | - let arr1=data[0]; | |
| 174 | - let arr2=data[1]; | |
| 175 | - let arr3=data[2]||[]; | |
| 176 | - let arr4=data[3]||[]; | |
| 177 | - let obj=dataData.obj; | |
| 178 | - let col1=obj.col1,col2=obj.col2,col3=obj.col3||{},col4=obj.col4||{}; | |
| 179 | - let result="",value=[]; | |
| 180 | - let range=[]; | |
| 181 | - switch(this.level){ | |
| 182 | - case 2: | |
| 183 | - value=[col1[this.nodeVal],col2[this.nodeVal]]; | |
| 184 | - result=`${col1[this.nodeKey]+col2[this.nodeKey]}`; | |
| 185 | - range=[arr1,arr2]; | |
| 186 | - break; | |
| 187 | - case 3: | |
| 188 | - value=[col1[this.nodeVal],col2[this.nodeVal],col3[this.nodeVal]]; | |
| 189 | - result=`${col1[this.nodeKey]+col2[this.nodeKey]+col3[this.nodeKey]}`; | |
| 190 | - range=[arr1,arr2,arr3]; | |
| 191 | - break; | |
| 192 | - case 4: | |
| 193 | - value=[col1[this.nodeVal],col2[this.nodeVal],col3[this.nodeVal],col4[this.nodeVal]]; | |
| 194 | - result=`${col1[this.nodeKey]+col2[this.nodeKey]+col3[this.nodeKey]+col4[this.nodeKey]}`; | |
| 195 | - range=[arr1,arr2,arr3,arr4]; | |
| 196 | - break; | |
| 197 | - } | |
| 198 | - this.range=range; | |
| 199 | - this.checkObj=obj; | |
| 200 | - this.$nextTick(()=>{ | |
| 201 | - this.pickVal=dataData.dVal; | |
| 202 | - }); | |
| 203 | - this.$emit("change",{ | |
| 204 | - result:result, | |
| 205 | - value:value, | |
| 206 | - obj:obj | |
| 207 | - }) | |
| 208 | - }, | |
| 209 | - handlerChange(e){ | |
| 210 | - let arr=[...e.detail.value]; | |
| 211 | - let col1Index=arr[0],col2Index=arr[1],col3Index=arr[2]||0,col4Index=arr[3]||0; | |
| 212 | - let arr1=[],arr2=[],arr3=[],arr4=[]; | |
| 213 | - let col1,col2,col3,col4,obj={}; | |
| 214 | - let result="",value=[]; | |
| 215 | - arr1=this.options; | |
| 216 | - arr2=(arr1[col1Index]&&arr1[col1Index][this.nodeChild])||arr1[arr1.length-1][this.nodeChild]||[]; | |
| 217 | - col1=arr1[col1Index]||arr1[arr1.length-1]||{}; | |
| 218 | - col2=arr2[col2Index]||arr2[arr2.length-1]||{}; | |
| 219 | - if(this.level>2){ | |
| 220 | - arr3=(arr2[col2Index]&&arr2[col2Index][this.nodeChild])||arr2[arr2.length-1][this.nodeChild]; | |
| 221 | - col3=arr3[col3Index]||arr3[arr3.length-1]||{}; | |
| 222 | - } | |
| 223 | - if(this.level>3){ | |
| 224 | - arr4=(arr3[col3Index]&&arr3[col3Index][this.nodeChild])||arr3[arr3.length-1][this.nodeChild]||[]; | |
| 225 | - col4=arr4[col4Index]||arr4[arr4.length-1]||{}; | |
| 226 | - } | |
| 227 | - switch(this.level){ | |
| 228 | - case 2: | |
| 229 | - obj={ | |
| 230 | - col1, | |
| 231 | - col2 | |
| 232 | - } | |
| 233 | - this.range=[arr1,arr2]; | |
| 234 | - result=`${(col1[this.nodeKey]||'')+(col2[this.nodeKey]||'')}`; | |
| 235 | - value=[col1[this.nodeVal]||'',col2[this.nodeVal]||'']; | |
| 236 | - break; | |
| 237 | - case 3: | |
| 238 | - obj={ | |
| 239 | - col1, | |
| 240 | - col2, | |
| 241 | - col3 | |
| 242 | - } | |
| 243 | - this.range=[arr1,arr2,arr3]; | |
| 244 | - result=`${(col1[this.nodeKey]||'')+(col2[this.nodeKey]||'')+(col3[this.nodeKey]||'')}`; | |
| 245 | - value=[col1[this.nodeVal]||'',col2[this.nodeVal]||'',col3[this.nodeVal]||'']; | |
| 246 | - break; | |
| 247 | - case 4: | |
| 248 | - obj={ | |
| 249 | - col1, | |
| 250 | - col2, | |
| 251 | - col3, | |
| 252 | - col4 | |
| 253 | - } | |
| 254 | - this.range=[arr1,arr2,arr3,arr4]; | |
| 255 | - result=`${(col1[this.nodeKey]||'')+(col2[this.nodeKey]||'')+(col3[this.nodeKey]||'')+(col4[this.nodeKey]||'')}`; | |
| 256 | - value=[col1[this.nodeVal]||'',col2[this.nodeVal]||'',col3[this.nodeVal]||'',col4[this.nodeVal]||'']; | |
| 257 | - break; | |
| 258 | - } | |
| 259 | - this.checkObj=obj; | |
| 260 | - this.pickVal=arr; | |
| 261 | - this.$emit("change",{ | |
| 262 | - result:result, | |
| 263 | - value:value, | |
| 264 | - obj:obj | |
| 265 | - }) | |
| 266 | - } | |
| 267 | - } | |
| 268 | - } | |
| 269 | -</script> | |
| 270 | - | |
| 271 | -<style lang="scss"> | |
| 272 | - @import "./w-picker.css"; | |
| 273 | -</style> | |
| 274 | - |
yudao-ui-app/components/w-picker/range-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column class="w-picker-flex2"> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in range.fyears" :key="index">{{item}}年</view> | |
| 6 | - </picker-view-column> | |
| 7 | - <picker-view-column class="w-picker-flex2"> | |
| 8 | - <view class="w-picker-item" v-for="(item,index) in range.fmonths" :key="index">{{item}}月</view> | |
| 9 | - </picker-view-column> | |
| 10 | - <picker-view-column class="w-picker-flex2"> | |
| 11 | - <view class="w-picker-item" v-for="(item,index) in range.fdays" :key="index">{{item}}日</view> | |
| 12 | - </picker-view-column> | |
| 13 | - <picker-view-column class="w-picker-flex1"> | |
| 14 | - <view class="w-picker-item">-</view> | |
| 15 | - </picker-view-column> | |
| 16 | - <picker-view-column class="w-picker-flex2"> | |
| 17 | - <view class="w-picker-item" v-for="(item,index) in range.tyears" :key="index">{{item}}年</view> | |
| 18 | - </picker-view-column> | |
| 19 | - <picker-view-column class="w-picker-flex2"> | |
| 20 | - <view class="w-picker-item" v-for="(item,index) in range.tmonths" :key="index">{{item}}月</view> | |
| 21 | - </picker-view-column> | |
| 22 | - <picker-view-column class="w-picker-flex2"> | |
| 23 | - <view class="w-picker-item" v-for="(item,index) in range.tdays" :key="index">{{item}}日</view> | |
| 24 | - </picker-view-column> | |
| 25 | - </picker-view> | |
| 26 | - </view> | |
| 27 | -</template> | |
| 28 | - | |
| 29 | -<script> | |
| 30 | - export default { | |
| 31 | - data() { | |
| 32 | - return { | |
| 33 | - pickVal:[], | |
| 34 | - range:{}, | |
| 35 | - checkObj:{} | |
| 36 | - }; | |
| 37 | - }, | |
| 38 | - props:{ | |
| 39 | - itemHeight:{ | |
| 40 | - type:String, | |
| 41 | - default:"44px" | |
| 42 | - }, | |
| 43 | - value:{ | |
| 44 | - type:[String,Array], | |
| 45 | - default(){ | |
| 46 | - return [] | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - current:{//是否默认选中当前日期 | |
| 50 | - type:Boolean, | |
| 51 | - default:false | |
| 52 | - }, | |
| 53 | - startYear:{ | |
| 54 | - type:[String,Number], | |
| 55 | - default:1970 | |
| 56 | - }, | |
| 57 | - endYear:{ | |
| 58 | - type:[String,Number], | |
| 59 | - default:new Date().getFullYear() | |
| 60 | - } | |
| 61 | - }, | |
| 62 | - watch:{ | |
| 63 | - value(val){ | |
| 64 | - this.initData(); | |
| 65 | - } | |
| 66 | - }, | |
| 67 | - created() { | |
| 68 | - this.initData(); | |
| 69 | - }, | |
| 70 | - methods:{ | |
| 71 | - formatNum(n){ | |
| 72 | - return (Number(n)<10?'0'+Number(n):Number(n)+''); | |
| 73 | - }, | |
| 74 | - checkValue(value){ | |
| 75 | - let strReg=/^\d{4}-\d{2}-\d{2}$/,example="2020-04-03"; | |
| 76 | - if(!strReg.test(value[0])||!strReg.test(value[1])){ | |
| 77 | - console.log(new Error("请传入与mode匹配的value值,例["+example+","+example+"]")) | |
| 78 | - } | |
| 79 | - return strReg.test(value[0])&&strReg.test(value[1]); | |
| 80 | - }, | |
| 81 | - resetToData(fmonth,fday,tyear,tmonth){ | |
| 82 | - let range=this.range; | |
| 83 | - let tmonths=[],tdays=[]; | |
| 84 | - let yearFlag=tyear!=range.tyears[0]; | |
| 85 | - let monthFlag=tyear!=range.tyears[0]||tmonth!=range.tmonths[0]; | |
| 86 | - let ttotal=new Date(tyear,tmonth,0).getDate(); | |
| 87 | - for(let i=yearFlag?1:fmonth*1;i<=12;i++){ | |
| 88 | - tmonths.push(this.formatNum(i)) | |
| 89 | - } | |
| 90 | - for(let i=monthFlag?1:fday*1;i<=ttotal;i++){ | |
| 91 | - tdays.push(this.formatNum(i)) | |
| 92 | - } | |
| 93 | - return{ | |
| 94 | - tmonths, | |
| 95 | - tdays | |
| 96 | - } | |
| 97 | - }, | |
| 98 | - resetData(fyear,fmonth,fday,tyear,tmonth){ | |
| 99 | - let fyears=[],fmonths=[],fdays=[],tyears=[],tmonths=[],tdays=[]; | |
| 100 | - let startYear=this.startYear; | |
| 101 | - let endYear=this.endYear; | |
| 102 | - let ftotal=new Date(fyear,fmonth,0).getDate(); | |
| 103 | - let ttotal=new Date(tyear,tmonth,0).getDate(); | |
| 104 | - for(let i=startYear*1;i<=endYear;i++){ | |
| 105 | - fyears.push(this.formatNum(i)) | |
| 106 | - } | |
| 107 | - for(let i=1;i<=12;i++){ | |
| 108 | - fmonths.push(this.formatNum(i)) | |
| 109 | - } | |
| 110 | - for(let i=1;i<=ftotal;i++){ | |
| 111 | - fdays.push(this.formatNum(i)) | |
| 112 | - } | |
| 113 | - for(let i=fyear*1;i<=endYear;i++){ | |
| 114 | - tyears.push(this.formatNum(i)) | |
| 115 | - } | |
| 116 | - for(let i=fmonth*1;i<=12;i++){ | |
| 117 | - tmonths.push(this.formatNum(i)) | |
| 118 | - } | |
| 119 | - for(let i=fday*1;i<=ttotal;i++){ | |
| 120 | - tdays.push(this.formatNum(i)) | |
| 121 | - } | |
| 122 | - return { | |
| 123 | - fyears, | |
| 124 | - fmonths, | |
| 125 | - fdays, | |
| 126 | - tyears, | |
| 127 | - tmonths, | |
| 128 | - tdays | |
| 129 | - } | |
| 130 | - }, | |
| 131 | - getData(dVal){ | |
| 132 | - let start=this.startYear*1; | |
| 133 | - let end=this.endYear*1; | |
| 134 | - let value=dVal; | |
| 135 | - let flag=this.current; | |
| 136 | - let aToday=new Date(); | |
| 137 | - let tYear,tMonth,tDay,tHours,tMinutes,tSeconds,pickVal=[]; | |
| 138 | - let initstartDate=new Date(start.toString()); | |
| 139 | - let endDate=new Date(end.toString()); | |
| 140 | - if(start>end){ | |
| 141 | - initstartDate=new Date(end.toString()); | |
| 142 | - endDate=new Date(start.toString()); | |
| 143 | - }; | |
| 144 | - let startYear=initstartDate.getFullYear(); | |
| 145 | - let startMonth=initstartDate.getMonth()+1; | |
| 146 | - let endYear=endDate.getFullYear(); | |
| 147 | - let fyears=[],fmonths=[],fdays=[],tyears=[],tmonths=[],tdays=[],returnArr=[],startDVal=[],endDVal=[]; | |
| 148 | - let curMonth=flag?value[1]*1:(startDVal[1]*1+1); | |
| 149 | - let curMonth1=flag?value[5][1]*1:(value[5]*1+1); | |
| 150 | - let totalDays=new Date(value[0],value[1],0).getDate(); | |
| 151 | - let totalDays1=new Date(value[4],value[5],0).getDate(); | |
| 152 | - for(let s=startYear;s<=endYear;s++){ | |
| 153 | - fyears.push(this.formatNum(s)); | |
| 154 | - }; | |
| 155 | - for(let m=1;m<=12;m++){ | |
| 156 | - fmonths.push(this.formatNum(m)); | |
| 157 | - }; | |
| 158 | - for(let d=1;d<=totalDays;d++){ | |
| 159 | - fdays.push(this.formatNum(d)); | |
| 160 | - }; | |
| 161 | - for(let s=value[0]*1;s<=endYear;s++){ | |
| 162 | - tyears.push(this.formatNum(s)); | |
| 163 | - }; | |
| 164 | - | |
| 165 | - if(value[4]*1>value[0]*1){ | |
| 166 | - for(let m=1;m<=12;m++){ | |
| 167 | - tmonths.push(this.formatNum(m)); | |
| 168 | - }; | |
| 169 | - for(let d=1;d<=totalDays1;d++){ | |
| 170 | - tdays.push(this.formatNum(d)); | |
| 171 | - }; | |
| 172 | - }else{ | |
| 173 | - for(let m=value[1]*1;m<=12;m++){ | |
| 174 | - tmonths.push(this.formatNum(m)); | |
| 175 | - }; | |
| 176 | - for(let d=value[2]*1;d<=totalDays1;d++){ | |
| 177 | - tdays.push(this.formatNum(d)); | |
| 178 | - }; | |
| 179 | - }; | |
| 180 | - | |
| 181 | - pickVal=[ | |
| 182 | - fyears.indexOf(value[0])==-1?0:fyears.indexOf(value[0]), | |
| 183 | - fmonths.indexOf(value[1])==-1?0:fmonths.indexOf(value[1]), | |
| 184 | - fdays.indexOf(value[2])==-1?0:fdays.indexOf(value[2]), | |
| 185 | - 0, | |
| 186 | - tyears.indexOf(value[4])==-1?0:tyears.indexOf(value[4]), | |
| 187 | - tmonths.indexOf(value[5])==-1?0:tmonths.indexOf(value[5]), | |
| 188 | - tdays.indexOf(value[6])==-1?0:tdays.indexOf(value[6]) | |
| 189 | - ]; | |
| 190 | - return { | |
| 191 | - fyears, | |
| 192 | - fmonths, | |
| 193 | - fdays, | |
| 194 | - tyears, | |
| 195 | - tmonths, | |
| 196 | - tdays, | |
| 197 | - pickVal | |
| 198 | - } | |
| 199 | - }, | |
| 200 | - getDval(){ | |
| 201 | - let value=this.value; | |
| 202 | - let fields=this.fields; | |
| 203 | - let dVal=null; | |
| 204 | - let aDate=new Date(); | |
| 205 | - let fyear=this.formatNum(aDate.getFullYear()); | |
| 206 | - let fmonth=this.formatNum(aDate.getMonth()+1); | |
| 207 | - let fday=this.formatNum(aDate.getDate()); | |
| 208 | - let tyear=this.formatNum(aDate.getFullYear()); | |
| 209 | - let tmonth=this.formatNum(aDate.getMonth()+1); | |
| 210 | - let tday=this.formatNum(aDate.getDate()); | |
| 211 | - if(value&&value.length>0){ | |
| 212 | - let flag=this.checkValue(value); | |
| 213 | - if(!flag){ | |
| 214 | - dVal=[fyear,fmonth,fday,"-",tyear,tmonth,tday] | |
| 215 | - }else{ | |
| 216 | - dVal=[...value[0].split("-"),"-",...value[1].split("-")]; | |
| 217 | - } | |
| 218 | - }else{ | |
| 219 | - dVal=[fyear,fmonth,fday,"-",tyear,tmonth,tday] | |
| 220 | - } | |
| 221 | - return dVal; | |
| 222 | - }, | |
| 223 | - initData(){ | |
| 224 | - let range=[],pickVal=[]; | |
| 225 | - let result="",full="",obj={}; | |
| 226 | - let dVal=this.getDval(); | |
| 227 | - let dateData=this.getData(dVal); | |
| 228 | - let fyears=[],fmonths=[],fdays=[],tyears=[],tmonths=[],tdays=[]; | |
| 229 | - let fyear,fmonth,fday,tyear,tmonth,tday; | |
| 230 | - pickVal=dateData.pickVal; | |
| 231 | - fyears=dateData.fyears; | |
| 232 | - fmonths=dateData.fmonths; | |
| 233 | - fdays=dateData.fdays; | |
| 234 | - tyears=dateData.tyears; | |
| 235 | - tmonths=dateData.tmonths; | |
| 236 | - tdays=dateData.tdays; | |
| 237 | - range={ | |
| 238 | - fyears, | |
| 239 | - fmonths, | |
| 240 | - fdays, | |
| 241 | - tyears, | |
| 242 | - tmonths, | |
| 243 | - tdays, | |
| 244 | - } | |
| 245 | - fyear=range.fyears[pickVal[0]]; | |
| 246 | - fmonth=range.fmonths[pickVal[1]]; | |
| 247 | - fday=range.fdays[pickVal[2]]; | |
| 248 | - tyear=range.tyears[pickVal[4]]; | |
| 249 | - tmonth=range.tmonths[pickVal[5]]; | |
| 250 | - tday=range.tdays[pickVal[6]]; | |
| 251 | - obj={ | |
| 252 | - fyear, | |
| 253 | - fmonth, | |
| 254 | - fday, | |
| 255 | - tyear, | |
| 256 | - tmonth, | |
| 257 | - tday | |
| 258 | - } | |
| 259 | - result=`${fyear+'-'+fmonth+'-'+fday+'至'+tyear+'-'+tmonth+'-'+tday}`; | |
| 260 | - this.range=range; | |
| 261 | - this.checkObj=obj; | |
| 262 | - this.$nextTick(()=>{ | |
| 263 | - this.pickVal=pickVal; | |
| 264 | - }); | |
| 265 | - this.$emit("change",{ | |
| 266 | - result:result, | |
| 267 | - value:result.split("至"), | |
| 268 | - obj:obj | |
| 269 | - }) | |
| 270 | - }, | |
| 271 | - handlerChange(e){ | |
| 272 | - let arr=[...e.detail.value]; | |
| 273 | - let result="",full="",obj={}; | |
| 274 | - let year="",month="",day="",hour="",minute="",second="",note=[],province,city,area; | |
| 275 | - let checkObj=this.checkObj; | |
| 276 | - let days=[],months=[],endYears=[],endMonths=[],endDays=[],startDays=[]; | |
| 277 | - let mode=this.mode; | |
| 278 | - let col1,col2,col3,d,a,h,m; | |
| 279 | - let xDate=new Date().getTime(); | |
| 280 | - let range=this.range; | |
| 281 | - let fyear=range.fyears[arr[0]]||range.fyears[range.fyears.length-1]; | |
| 282 | - let fmonth=range.fmonths[arr[1]]||range.fmonths[range.fmonths.length-1]; | |
| 283 | - let fday=range.fdays[arr[2]]||range.fdays[range.fdays.length-1]; | |
| 284 | - let tyear=range.tyears[arr[4]]||range.tyears[range.tyears.length-1]; | |
| 285 | - let tmonth=range.tmonths[arr[5]]||range.tmonths[range.tmonths.length-1]; | |
| 286 | - let tday=range.tdays[arr[6]]||range.tdays[range.tdays.length-1]; | |
| 287 | - let resetData=this.resetData(fyear,fmonth,fday,tyear,tmonth); | |
| 288 | - if(fyear!=checkObj.fyear||fmonth!=checkObj.fmonth||fday!=checkObj.fday){ | |
| 289 | - arr[4]=0; | |
| 290 | - arr[5]=0; | |
| 291 | - arr[6]=0; | |
| 292 | - range.tyears=resetData.tyears; | |
| 293 | - range.tmonths=resetData.tmonths; | |
| 294 | - range.tdays=resetData.tdays; | |
| 295 | - tyear=range.tyears[0]; | |
| 296 | - checkObj.tyears=range.tyears[0]; | |
| 297 | - tmonth=range.tmonths[0]; | |
| 298 | - checkObj.tmonths=range.tmonths[0]; | |
| 299 | - tday=range.tdays[0]; | |
| 300 | - checkObj.tdays=range.tdays[0]; | |
| 301 | - } | |
| 302 | - if(fyear!=checkObj.fyear||fmonth!=checkObj.fmonth){ | |
| 303 | - range.fdays=resetData.fdays; | |
| 304 | - }; | |
| 305 | - if(tyear!=checkObj.tyear){ | |
| 306 | - arr[5]=0; | |
| 307 | - arr[6]=0; | |
| 308 | - let toData=this.resetToData(fmonth,fday,tyear,tmonth); | |
| 309 | - range.tmonths=toData.tmonths; | |
| 310 | - range.tdays=toData.tdays; | |
| 311 | - tmonth=range.tmonths[0]; | |
| 312 | - checkObj.tmonths=range.tmonths[0]; | |
| 313 | - tday=range.tdays[0]; | |
| 314 | - checkObj.tdays=range.tdays[0]; | |
| 315 | - }; | |
| 316 | - if(tmonth!=checkObj.tmonth){ | |
| 317 | - arr[6]=0; | |
| 318 | - let toData=this.resetToData(fmonth,fday,tyear,tmonth); | |
| 319 | - range.tdays=toData.tdays; | |
| 320 | - tday=range.tdays[0]; | |
| 321 | - checkObj.tdays=range.tdays[0]; | |
| 322 | - }; | |
| 323 | - result=`${fyear+'-'+fmonth+'-'+fday+'至'+tyear+'-'+tmonth+'-'+tday}`; | |
| 324 | - obj={ | |
| 325 | - fyear,fmonth,fday,tyear,tmonth,tday | |
| 326 | - } | |
| 327 | - this.checkObj=obj; | |
| 328 | - this.$nextTick(()=>{ | |
| 329 | - this.pickVal=arr; | |
| 330 | - }) | |
| 331 | - this.$emit("change",{ | |
| 332 | - result:result, | |
| 333 | - value:result.split("至"), | |
| 334 | - obj:obj | |
| 335 | - }) | |
| 336 | - | |
| 337 | - } | |
| 338 | - } | |
| 339 | - } | |
| 340 | -</script> | |
| 341 | - | |
| 342 | -<style lang="scss"> | |
| 343 | - @import "./w-picker.css"; | |
| 344 | -</style> |
yudao-ui-app/components/w-picker/region-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in range.provinces" :key="index">{{item.label}}</view> | |
| 6 | - </picker-view-column> | |
| 7 | - <picker-view-column> | |
| 8 | - <view class="w-picker-item" v-for="(item,index) in range.citys" :key="index">{{item.label}}</view> | |
| 9 | - </picker-view-column> | |
| 10 | - <picker-view-column v-if="!hideArea"> | |
| 11 | - <view class="w-picker-item" v-for="(item,index) in range.areas" :key="index">{{item.label}}</view> | |
| 12 | - </picker-view-column> | |
| 13 | - </picker-view> | |
| 14 | - </view> | |
| 15 | -</template> | |
| 16 | - | |
| 17 | -<script> | |
| 18 | - import areaData from "./areadata/areadata.js" | |
| 19 | - export default { | |
| 20 | - data() { | |
| 21 | - return { | |
| 22 | - pickVal:[], | |
| 23 | - range:{ | |
| 24 | - provinces:[], | |
| 25 | - citys:[], | |
| 26 | - areas:[] | |
| 27 | - }, | |
| 28 | - checkObj:{} | |
| 29 | - }; | |
| 30 | - }, | |
| 31 | - props:{ | |
| 32 | - itemHeight:{ | |
| 33 | - type:String, | |
| 34 | - default:"44px" | |
| 35 | - }, | |
| 36 | - value:{ | |
| 37 | - type:[Array,String], | |
| 38 | - default:"" | |
| 39 | - }, | |
| 40 | - defaultType:{ | |
| 41 | - type:String, | |
| 42 | - default:"label" | |
| 43 | - }, | |
| 44 | - hideArea:{ | |
| 45 | - type:Boolean, | |
| 46 | - default:false | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - watch:{ | |
| 50 | - value(val){ | |
| 51 | - this.initData(); | |
| 52 | - } | |
| 53 | - }, | |
| 54 | - created() { | |
| 55 | - this.initData(); | |
| 56 | - }, | |
| 57 | - methods:{ | |
| 58 | - getData(){ | |
| 59 | - //用来处理初始化数据 | |
| 60 | - let provinces=areaData; | |
| 61 | - let dVal=[]; | |
| 62 | - let value=this.value; | |
| 63 | - let a1=value[0];//默认值省 | |
| 64 | - let a2=value[1];//默认值市 | |
| 65 | - let a3=value[2];//默认值区、县 | |
| 66 | - let province,city,area; | |
| 67 | - let provinceIndex=provinces.findIndex((v)=>{ | |
| 68 | - return v[this.defaultType]==a1 | |
| 69 | - }); | |
| 70 | - provinceIndex=value?(provinceIndex!=-1?provinceIndex:0):0; | |
| 71 | - let citys=provinces[provinceIndex].children; | |
| 72 | - let cityIndex=citys.findIndex((v)=>{ | |
| 73 | - return v[this.defaultType]==a2 | |
| 74 | - }); | |
| 75 | - cityIndex=value?(cityIndex!=-1?cityIndex:0):0; | |
| 76 | - let areas=citys[cityIndex].children; | |
| 77 | - let areaIndex=areas.findIndex((v)=>{ | |
| 78 | - return v[this.defaultType]==a3; | |
| 79 | - }); | |
| 80 | - areaIndex=value?(areaIndex!=-1?areaIndex:0):0; | |
| 81 | - dVal=this.hideArea?[provinceIndex,cityIndex]:[provinceIndex,cityIndex,areaIndex]; | |
| 82 | - province=provinces[provinceIndex]; | |
| 83 | - city=citys[cityIndex]; | |
| 84 | - area=areas[areaIndex]; | |
| 85 | - let obj=this.hideArea?{ | |
| 86 | - province, | |
| 87 | - city | |
| 88 | - }:{ | |
| 89 | - province, | |
| 90 | - city, | |
| 91 | - area | |
| 92 | - } | |
| 93 | - return this.hideArea?{ | |
| 94 | - provinces, | |
| 95 | - citys, | |
| 96 | - dVal, | |
| 97 | - obj | |
| 98 | - }:{ | |
| 99 | - provinces, | |
| 100 | - citys, | |
| 101 | - areas, | |
| 102 | - dVal, | |
| 103 | - obj | |
| 104 | - } | |
| 105 | - }, | |
| 106 | - initData(){ | |
| 107 | - let dataData=this.getData(); | |
| 108 | - let provinces=dataData.provinces; | |
| 109 | - let citys=dataData.citys; | |
| 110 | - let areas=this.hideArea?[]:dataData.areas; | |
| 111 | - let obj=dataData.obj; | |
| 112 | - let province=obj.province,city=obj.city,area=this.hideArea?{}:obj.area; | |
| 113 | - let value=this.hideArea?[province.value,city.value]:[province.value,city.value,area.value]; | |
| 114 | - let result=this.hideArea?`${province.label+city.label}`:`${province.label+city.label+area.label}`; | |
| 115 | - this.range=this.hideArea?{ | |
| 116 | - provinces, | |
| 117 | - citys, | |
| 118 | - }:{ | |
| 119 | - provinces, | |
| 120 | - citys, | |
| 121 | - areas | |
| 122 | - }; | |
| 123 | - this.checkObj=obj; | |
| 124 | - this.$nextTick(()=>{ | |
| 125 | - this.pickVal=dataData.dVal; | |
| 126 | - }); | |
| 127 | - this.$emit("change",{ | |
| 128 | - result:result, | |
| 129 | - value:value, | |
| 130 | - obj:obj | |
| 131 | - }) | |
| 132 | - }, | |
| 133 | - handlerChange(e){ | |
| 134 | - let arr=[...e.detail.value]; | |
| 135 | - let provinceIndex=arr[0],cityIndex=arr[1],areaIndex=this.hideArea?0:arr[2]; | |
| 136 | - let provinces=areaData; | |
| 137 | - let citys=(provinces[provinceIndex]&&provinces[provinceIndex].children)||provinces[provinces.length-1].children||[]; | |
| 138 | - let areas=this.hideArea?[]:((citys[cityIndex]&&citys[cityIndex].children)||citys[citys.length-1].children||[]); | |
| 139 | - let province=provinces[provinceIndex]||provinces[provinces.length-1], | |
| 140 | - city=citys[cityIndex]||[citys.length-1], | |
| 141 | - area=this.hideArea?{}:(areas[areaIndex]||[areas.length-1]); | |
| 142 | - let obj=this.hideArea?{ | |
| 143 | - province, | |
| 144 | - city | |
| 145 | - }:{ | |
| 146 | - province, | |
| 147 | - city, | |
| 148 | - area | |
| 149 | - } | |
| 150 | - if(this.checkObj.province.label!=province.label){ | |
| 151 | - //当省更新的时候需要刷新市、区县的数据; | |
| 152 | - this.range.citys=citys; | |
| 153 | - if(!this.hideArea){ | |
| 154 | - this.range.areas=areas; | |
| 155 | - } | |
| 156 | - | |
| 157 | - } | |
| 158 | - if(this.checkObj.city.label!=city.label){ | |
| 159 | - //当市更新的时候需要刷新区县的数据; | |
| 160 | - if(!this.hideArea){ | |
| 161 | - this.range.areas=areas; | |
| 162 | - } | |
| 163 | - } | |
| 164 | - this.checkObj=obj; | |
| 165 | - this.$nextTick(()=>{ | |
| 166 | - this.pickVal=arr; | |
| 167 | - }) | |
| 168 | - let result=this.hideArea?`${province.label+city.label}`:`${province.label+city.label+area.label}`; | |
| 169 | - let value=this.hideArea?[province.value,city.value]:[province.value,city.value,area.value]; | |
| 170 | - this.$emit("change",{ | |
| 171 | - result:result, | |
| 172 | - value:value, | |
| 173 | - obj:obj | |
| 174 | - }) | |
| 175 | - } | |
| 176 | - } | |
| 177 | - } | |
| 178 | -</script> | |
| 179 | - | |
| 180 | -<style lang="scss"> | |
| 181 | - @import "./w-picker.css"; | |
| 182 | -</style> | |
| 183 | - |
yudao-ui-app/components/w-picker/selector-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in range" :key="index">{{item[nodeKey]}}</view> | |
| 6 | - </picker-view-column> | |
| 7 | - </picker-view> | |
| 8 | - </view> | |
| 9 | -</template> | |
| 10 | - | |
| 11 | -<script> | |
| 12 | - export default { | |
| 13 | - props:{ | |
| 14 | - itemHeight:{ | |
| 15 | - type:String, | |
| 16 | - default:"44px" | |
| 17 | - }, | |
| 18 | - options:{ | |
| 19 | - type:[Array,Object], | |
| 20 | - default(){ | |
| 21 | - return [] | |
| 22 | - } | |
| 23 | - }, | |
| 24 | - value:{ | |
| 25 | - type:String, | |
| 26 | - default:"" | |
| 27 | - }, | |
| 28 | - defaultType:{ | |
| 29 | - type:String, | |
| 30 | - default:"label" | |
| 31 | - }, | |
| 32 | - defaultProps:{ | |
| 33 | - type:Object, | |
| 34 | - default(){ | |
| 35 | - return{ | |
| 36 | - label:"label", | |
| 37 | - value:"value" | |
| 38 | - } | |
| 39 | - } | |
| 40 | - } | |
| 41 | - }, | |
| 42 | - data() { | |
| 43 | - return { | |
| 44 | - pickVal:[] | |
| 45 | - }; | |
| 46 | - }, | |
| 47 | - computed:{ | |
| 48 | - nodeKey(){ | |
| 49 | - return this.defaultProps.label; | |
| 50 | - }, | |
| 51 | - nodeValue(){ | |
| 52 | - return this.defaultProps.value; | |
| 53 | - }, | |
| 54 | - range(){ | |
| 55 | - return this.options | |
| 56 | - } | |
| 57 | - }, | |
| 58 | - watch:{ | |
| 59 | - value(val){ | |
| 60 | - if(this.options.length!=0){ | |
| 61 | - this.initData(); | |
| 62 | - } | |
| 63 | - }, | |
| 64 | - options(val){ | |
| 65 | - this.initData(); | |
| 66 | - } | |
| 67 | - }, | |
| 68 | - created() { | |
| 69 | - if(this.options.length!=0){ | |
| 70 | - this.initData(); | |
| 71 | - } | |
| 72 | - }, | |
| 73 | - methods:{ | |
| 74 | - initData(){ | |
| 75 | - let dVal=this.value||""; | |
| 76 | - let data=this.range; | |
| 77 | - let pickVal=[0]; | |
| 78 | - let cur=null; | |
| 79 | - let label=""; | |
| 80 | - let value,idx; | |
| 81 | - if(this.defaultType==this.nodeValue){ | |
| 82 | - value=data.find((v)=>v[this.nodeValue]==dVal); | |
| 83 | - idx=data.findIndex((v)=>v[this.nodeValue]==dVal); | |
| 84 | - }else{ | |
| 85 | - value=data.find((v)=>v[this.nodeKey]==dVal); | |
| 86 | - idx=data.findIndex((v)=>v[this.nodeKey]==dVal); | |
| 87 | - } | |
| 88 | - pickVal=[idx!=-1?idx:0]; | |
| 89 | - this.$nextTick(()=>{ | |
| 90 | - this.pickVal=pickVal; | |
| 91 | - }); | |
| 92 | - if(this.defaultType==this.nodeValue){ | |
| 93 | - this.$emit("change",{ | |
| 94 | - result:value?value[this.nodeKey]:data[0][this.nodeKey], | |
| 95 | - value:dVal||data[0][this.nodeKey], | |
| 96 | - obj:value?value:data[0] | |
| 97 | - }) | |
| 98 | - }else{ | |
| 99 | - this.$emit("change",{ | |
| 100 | - result:dVal||data[0][this.nodeKey], | |
| 101 | - value:value?value[this.nodeValue]:data[0][this.nodeValue], | |
| 102 | - obj:value?value:data[0] | |
| 103 | - }) | |
| 104 | - } | |
| 105 | - | |
| 106 | - }, | |
| 107 | - handlerChange(e){ | |
| 108 | - let arr=[...e.detail.value]; | |
| 109 | - let pickVal=[arr[0]||0]; | |
| 110 | - let data=this.range; | |
| 111 | - let cur=data[arr[0]]; | |
| 112 | - let label=""; | |
| 113 | - let value=""; | |
| 114 | - this.$nextTick(()=>{ | |
| 115 | - this.pickVal=pickVal; | |
| 116 | - }); | |
| 117 | - this.$emit("change",{ | |
| 118 | - result:cur[this.nodeKey], | |
| 119 | - value:cur[this.nodeValue], | |
| 120 | - obj:cur | |
| 121 | - }) | |
| 122 | - } | |
| 123 | - } | |
| 124 | - } | |
| 125 | -</script> | |
| 126 | - | |
| 127 | -<style lang="scss"> | |
| 128 | - @import "./w-picker.css"; | |
| 129 | -</style> |
yudao-ui-app/components/w-picker/shortterm-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in range.dates" :key="index">{{item.label}}</view> | |
| 6 | - </picker-view-column> | |
| 7 | - <picker-view-column> | |
| 8 | - <view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item.label}}时</view> | |
| 9 | - </picker-view-column> | |
| 10 | - <picker-view-column> | |
| 11 | - <view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item.label}}分</view> | |
| 12 | - </picker-view-column> | |
| 13 | - </picker-view> | |
| 14 | - </view> | |
| 15 | -</template> | |
| 16 | - | |
| 17 | -<script> | |
| 18 | - export default { | |
| 19 | - data() { | |
| 20 | - return { | |
| 21 | - pickVal:[], | |
| 22 | - range:{}, | |
| 23 | - checkObj:{} | |
| 24 | - }; | |
| 25 | - }, | |
| 26 | - props:{ | |
| 27 | - itemHeight:{ | |
| 28 | - type:String, | |
| 29 | - default:"44px" | |
| 30 | - }, | |
| 31 | - value:{ | |
| 32 | - type:[String,Array,Number], | |
| 33 | - default:"" | |
| 34 | - }, | |
| 35 | - current:{//是否默认选中当前日期 | |
| 36 | - type:Boolean, | |
| 37 | - default:false | |
| 38 | - }, | |
| 39 | - expand:{ | |
| 40 | - type:[Number,String], | |
| 41 | - default:30 | |
| 42 | - } | |
| 43 | - }, | |
| 44 | - watch:{ | |
| 45 | - value(val){ | |
| 46 | - this.initData(); | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - created() { | |
| 50 | - this.initData(); | |
| 51 | - }, | |
| 52 | - methods:{ | |
| 53 | - formatNum(n){ | |
| 54 | - return (Number(n)<10?'0'+Number(n):Number(n)+''); | |
| 55 | - }, | |
| 56 | - checkValue(value){ | |
| 57 | - let strReg=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(:\d{2})?$/,example="2019-12-12 18:05:00或者2019-12-12 18:05"; | |
| 58 | - if(!strReg.test(value)){ | |
| 59 | - console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+"")) | |
| 60 | - } | |
| 61 | - return strReg.test(value); | |
| 62 | - }, | |
| 63 | - resetData(year,month,day){ | |
| 64 | - let curDate=this.getCurrenDate(); | |
| 65 | - let curFlag=this.current; | |
| 66 | - let curYear=curDate.curYear; | |
| 67 | - let curMonth=curDate.curMonth; | |
| 68 | - let curDay=curDate.curDay; | |
| 69 | - let curHour=curDate.curHour; | |
| 70 | - let months=[],days=[],sections=[]; | |
| 71 | - let disabledAfter=this.disabledAfter; | |
| 72 | - let monthsLen=disabledAfter?(year*1<curYear?12:curMonth):12; | |
| 73 | - let totalDays=new Date(year,month,0).getDate();//计算当月有几天; | |
| 74 | - for(let month=1;month<=monthsLen;month++){ | |
| 75 | - months.push(this.formatNum(month)); | |
| 76 | - }; | |
| 77 | - for(let day=1;day<=daysLen;day++){ | |
| 78 | - days.push(this.formatNum(day)); | |
| 79 | - } | |
| 80 | - return{ | |
| 81 | - months, | |
| 82 | - days, | |
| 83 | - sections | |
| 84 | - } | |
| 85 | - }, | |
| 86 | - getData(dVal){ | |
| 87 | - //用来处理初始化数据 | |
| 88 | - let curFlag=this.current; | |
| 89 | - let disabledAfter=this.disabledAfter; | |
| 90 | - let dates=[],hours=[],minutes=[]; | |
| 91 | - let curDate=new Date(); | |
| 92 | - let curYear=curDate.getFullYear(); | |
| 93 | - let curMonth=curDate.getMonth(); | |
| 94 | - let curDay=curDate.getDate(); | |
| 95 | - let aDate=new Date(curYear,curMonth,curDay); | |
| 96 | - for(let i=0;i<this.expand*1;i++){ | |
| 97 | - aDate=new Date(curYear,curMonth,curDay+i); | |
| 98 | - let year=aDate.getFullYear(); | |
| 99 | - let month=aDate.getMonth()+1; | |
| 100 | - let day=aDate.getDate(); | |
| 101 | - let label=year+"-"+this.formatNum(month)+"-"+this.formatNum(day); | |
| 102 | - switch(i){ | |
| 103 | - case 0: | |
| 104 | - label="今天"; | |
| 105 | - break; | |
| 106 | - case 1: | |
| 107 | - label="明天"; | |
| 108 | - break; | |
| 109 | - case 2: | |
| 110 | - label="后天"; | |
| 111 | - break | |
| 112 | - } | |
| 113 | - dates.push({ | |
| 114 | - label:label, | |
| 115 | - value:year+"-"+this.formatNum(month)+"-"+this.formatNum(day) | |
| 116 | - }) | |
| 117 | - }; | |
| 118 | - for(let i=0;i<24;i++){ | |
| 119 | - hours.push({ | |
| 120 | - label:this.formatNum(i), | |
| 121 | - value:this.formatNum(i) | |
| 122 | - }) | |
| 123 | - } | |
| 124 | - for(let i=0;i<60;i++){ | |
| 125 | - minutes.push({ | |
| 126 | - label:this.formatNum(i), | |
| 127 | - value:this.formatNum(i) | |
| 128 | - }) | |
| 129 | - } | |
| 130 | - return { | |
| 131 | - dates, | |
| 132 | - hours, | |
| 133 | - minutes | |
| 134 | - } | |
| 135 | - }, | |
| 136 | - getDefaultDate(){ | |
| 137 | - let value=this.value; | |
| 138 | - let reg=/-/g; | |
| 139 | - let defaultDate=value?new Date(value.replace(reg,"/")):new Date(); | |
| 140 | - let defaultYear=defaultDate.getFullYear(); | |
| 141 | - let defaultMonth=defaultDate.getMonth()+1; | |
| 142 | - let defaultDay=defaultDate.getDate(); | |
| 143 | - let defaultDays=new Date(defaultYear,defaultMonth,0).getDate()*1; | |
| 144 | - return{ | |
| 145 | - defaultDate, | |
| 146 | - defaultYear, | |
| 147 | - defaultMonth, | |
| 148 | - defaultDay, | |
| 149 | - defaultDays | |
| 150 | - } | |
| 151 | - }, | |
| 152 | - getDval(){ | |
| 153 | - let value=this.value; | |
| 154 | - let dVal=null; | |
| 155 | - let aDate=new Date(); | |
| 156 | - let year=this.formatNum(aDate.getFullYear()); | |
| 157 | - let month=this.formatNum(aDate.getMonth()+1); | |
| 158 | - let day=this.formatNum(aDate.getDate()); | |
| 159 | - let date=this.formatNum(year)+"-"+this.formatNum(month)+"-"+this.formatNum(day); | |
| 160 | - let hour=aDate.getHours(); | |
| 161 | - let minute=aDate.getMinutes(); | |
| 162 | - if(value){ | |
| 163 | - let flag=this.checkValue(value); | |
| 164 | - if(!flag){ | |
| 165 | - dVal=[date,hour,minute] | |
| 166 | - }else{ | |
| 167 | - let v=value.split(" "); | |
| 168 | - dVal=[v[0],...v[1].split(":")]; | |
| 169 | - } | |
| 170 | - }else{ | |
| 171 | - dVal=[date,hour,minute] | |
| 172 | - } | |
| 173 | - return dVal; | |
| 174 | - }, | |
| 175 | - initData(){ | |
| 176 | - let startDate,endDate,startYear,endYear,startMonth,endMonth,startDay,endDay; | |
| 177 | - let dates=[],hours=[],minutes=[]; | |
| 178 | - let dVal=[],pickVal=[]; | |
| 179 | - let value=this.value; | |
| 180 | - let reg=/-/g; | |
| 181 | - let range={}; | |
| 182 | - let result="",full="",date,hour,minute,obj={}; | |
| 183 | - let defaultDate=this.getDefaultDate(); | |
| 184 | - let defaultYear=defaultDate.defaultYear; | |
| 185 | - let defaultMonth=defaultDate.defaultMonth; | |
| 186 | - let defaultDay=defaultDate.defaultDay; | |
| 187 | - let defaultDays=defaultDate.defaultDays; | |
| 188 | - let curFlag=this.current; | |
| 189 | - let disabledAfter=this.disabledAfter; | |
| 190 | - let dateData=[]; | |
| 191 | - dVal=this.getDval(); | |
| 192 | - dateData=this.getData(dVal); | |
| 193 | - dates=dateData.dates; | |
| 194 | - hours=dateData.hours; | |
| 195 | - minutes=dateData.minutes; | |
| 196 | - pickVal=[ | |
| 197 | - dates.findIndex(n => n.value == dVal[0])!=-1?dates.findIndex(n => n.value == dVal[0]):0, | |
| 198 | - hours.findIndex(n => n.value == dVal[1])!=-1?hours.findIndex(n => n.value == dVal[1]):0, | |
| 199 | - minutes.findIndex(n => n.value == dVal[2])!=-1?minutes.findIndex(n => n.value == dVal[2]):0, | |
| 200 | - ]; | |
| 201 | - range={dates,hours,minutes}; | |
| 202 | - date=dVal[0]?dVal[0]:dates[0].label; | |
| 203 | - hour=dVal[1]?dVal[1]:hours[0].label; | |
| 204 | - minute=dVal[2]?dVal[2]:minutes[0].label; | |
| 205 | - result=full=`${date+' '+hour+':'+minute}`; | |
| 206 | - obj={ | |
| 207 | - date, | |
| 208 | - hour, | |
| 209 | - minute | |
| 210 | - } | |
| 211 | - this.range=range; | |
| 212 | - this.checkObj=obj; | |
| 213 | - this.$nextTick(()=>{ | |
| 214 | - this.pickVal=pickVal; | |
| 215 | - }); | |
| 216 | - this.$emit("change",{ | |
| 217 | - result:result, | |
| 218 | - value:full, | |
| 219 | - obj:obj | |
| 220 | - }) | |
| 221 | - }, | |
| 222 | - handlerChange(e){ | |
| 223 | - let arr=[...e.detail.value]; | |
| 224 | - let data=this.range; | |
| 225 | - let date="",hour="",minute=""; | |
| 226 | - let result="",full="",obj={}; | |
| 227 | - let disabledAfter=this.disabledAfter; | |
| 228 | - date=(arr[0]||arr[0]==0)?data.dates[arr[0]]||data.dates[data.dates.length-1]:""; | |
| 229 | - hour=(arr[1]||arr[1]==0)?data.hours[arr[1]]||data.hours[data.hours.length-1]:""; | |
| 230 | - minute=(arr[2]||arr[2]==0)?data.minutes[arr[2]]||data.minutes[data.minutes.length-1]:""; | |
| 231 | - result=full=`${date.label+' '+hour.label+':'+minute.label+':00'}`; | |
| 232 | - obj={ | |
| 233 | - date, | |
| 234 | - hour, | |
| 235 | - minute | |
| 236 | - } | |
| 237 | - this.checkObj=obj; | |
| 238 | - this.$emit("change",{ | |
| 239 | - result:result, | |
| 240 | - value:full, | |
| 241 | - obj:obj | |
| 242 | - }) | |
| 243 | - } | |
| 244 | - } | |
| 245 | - } | |
| 246 | -</script> | |
| 247 | - | |
| 248 | -<style lang="scss"> | |
| 249 | - @import "./w-picker.css"; | |
| 250 | -</style> |
yudao-ui-app/components/w-picker/time-picker.vue deleted
| 1 | -<template> | |
| 2 | - <view class="w-picker-view"> | |
| 3 | - <picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange"> | |
| 4 | - <picker-view-column> | |
| 5 | - <view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view> | |
| 6 | - </picker-view-column> | |
| 7 | - <picker-view-column> | |
| 8 | - <view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item}}分</view> | |
| 9 | - </picker-view-column> | |
| 10 | - <picker-view-column v-if="second"> | |
| 11 | - <view class="w-picker-item" v-for="(item,index) in range.seconds" :key="index">{{item}}秒</view> | |
| 12 | - </picker-view-column> | |
| 13 | - </picker-view> | |
| 14 | - </view> | |
| 15 | -</template> | |
| 16 | - | |
| 17 | -<script> | |
| 18 | - export default { | |
| 19 | - data() { | |
| 20 | - return { | |
| 21 | - pickVal:[], | |
| 22 | - range:{}, | |
| 23 | - checkObj:{} | |
| 24 | - }; | |
| 25 | - }, | |
| 26 | - props:{ | |
| 27 | - itemHeight:{ | |
| 28 | - type:String, | |
| 29 | - default:"44px" | |
| 30 | - }, | |
| 31 | - value:{ | |
| 32 | - type:[String,Array,Number], | |
| 33 | - default:"" | |
| 34 | - }, | |
| 35 | - current:{//是否默认选中当前日期 | |
| 36 | - type:Boolean, | |
| 37 | - default:false | |
| 38 | - }, | |
| 39 | - second:{ | |
| 40 | - type:Boolean, | |
| 41 | - default:true | |
| 42 | - } | |
| 43 | - }, | |
| 44 | - watch:{ | |
| 45 | - value(val){ | |
| 46 | - this.initData(); | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - created() { | |
| 50 | - this.initData(); | |
| 51 | - }, | |
| 52 | - methods:{ | |
| 53 | - formatNum(n){ | |
| 54 | - return (Number(n)<10?'0'+Number(n):Number(n)+''); | |
| 55 | - }, | |
| 56 | - checkValue(value){ | |
| 57 | - let strReg=/^\d{2}:\d{2}:\d{2}$/,example="18:00:05"; | |
| 58 | - if(!strReg.test(value)){ | |
| 59 | - console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+"")) | |
| 60 | - } | |
| 61 | - return strReg.test(value); | |
| 62 | - }, | |
| 63 | - resetData(year,month,day,hour,minute){ | |
| 64 | - let curDate=this.getCurrenDate(); | |
| 65 | - let curFlag=this.current; | |
| 66 | - let curHour=curDate.curHour; | |
| 67 | - let curMinute=curDate.curMinute; | |
| 68 | - let curSecond=curDate.curSecond; | |
| 69 | - for(let hour=0;hour<24;hour++){ | |
| 70 | - hours.push(this.formatNum(hour)); | |
| 71 | - } | |
| 72 | - for(let minute=0;minute<60;minute++){ | |
| 73 | - minutes.push(this.formatNum(minute)); | |
| 74 | - } | |
| 75 | - for(let second=0;second<60;second++){ | |
| 76 | - seconds.push(this.formatNum(second)); | |
| 77 | - } | |
| 78 | - return{ | |
| 79 | - hours, | |
| 80 | - minutes, | |
| 81 | - seconds | |
| 82 | - } | |
| 83 | - }, | |
| 84 | - getData(curDate){ | |
| 85 | - //用来处理初始化数据 | |
| 86 | - let hours=[],minutes=[],seconds=[]; | |
| 87 | - let curFlag=this.current; | |
| 88 | - let disabledAfter=this.disabledAfter; | |
| 89 | - let fields=this.fields; | |
| 90 | - let curHour=curDate.curHour; | |
| 91 | - let curMinute=curDate.curMinute; | |
| 92 | - let curSecond=curDate.curSecond; | |
| 93 | - for(let hour=0;hour<24;hour++){ | |
| 94 | - hours.push(this.formatNum(hour)); | |
| 95 | - } | |
| 96 | - for(let minute=0;minute<60;minute++){ | |
| 97 | - minutes.push(this.formatNum(minute)); | |
| 98 | - } | |
| 99 | - for(let second=0;second<60;second++){ | |
| 100 | - seconds.push(this.formatNum(second)); | |
| 101 | - } | |
| 102 | - return this.second?{ | |
| 103 | - hours, | |
| 104 | - minutes, | |
| 105 | - seconds | |
| 106 | - }:{ | |
| 107 | - hours, | |
| 108 | - minutes | |
| 109 | - } | |
| 110 | - }, | |
| 111 | - getCurrenDate(){ | |
| 112 | - let curDate=new Date(); | |
| 113 | - let curHour=curDate.getHours(); | |
| 114 | - let curMinute=curDate.getMinutes(); | |
| 115 | - let curSecond=curDate.getSeconds(); | |
| 116 | - return this.second?{ | |
| 117 | - curHour, | |
| 118 | - curMinute, | |
| 119 | - curSecond | |
| 120 | - }:{ | |
| 121 | - curHour, | |
| 122 | - curMinute, | |
| 123 | - } | |
| 124 | - }, | |
| 125 | - getDval(){ | |
| 126 | - let value=this.value; | |
| 127 | - let fields=this.fields; | |
| 128 | - let dVal=null; | |
| 129 | - let aDate=new Date(); | |
| 130 | - let hour=this.formatNum(aDate.getHours()); | |
| 131 | - let minute=this.formatNum(aDate.getMinutes()); | |
| 132 | - let second=this.formatNum(aDate.getSeconds()); | |
| 133 | - if(value){ | |
| 134 | - let flag=this.checkValue(value); | |
| 135 | - if(!flag){ | |
| 136 | - dVal=[hour,minute,second] | |
| 137 | - }else{ | |
| 138 | - dVal=value?value.split(":"):[]; | |
| 139 | - } | |
| 140 | - }else{ | |
| 141 | - dVal=this.second?[hour,minute,second]:[hour,minute] | |
| 142 | - } | |
| 143 | - return dVal; | |
| 144 | - }, | |
| 145 | - initData(){ | |
| 146 | - let curDate=this.getCurrenDate(); | |
| 147 | - let dateData=this.getData(curDate); | |
| 148 | - let pickVal=[],obj={},full="",result="",hour="",minute="",second=""; | |
| 149 | - let dVal=this.getDval(); | |
| 150 | - let curFlag=this.current; | |
| 151 | - let disabledAfter=this.disabledAfter; | |
| 152 | - let hours=dateData.hours; | |
| 153 | - let minutes=dateData.minutes; | |
| 154 | - let seconds=dateData.seconds; | |
| 155 | - let defaultArr=this.second?[ | |
| 156 | - dVal[0]&&hours.indexOf(dVal[0])!=-1?hours.indexOf(dVal[0]):0, | |
| 157 | - dVal[1]&&minutes.indexOf(dVal[1])!=-1?minutes.indexOf(dVal[1]):0, | |
| 158 | - dVal[2]&&seconds.indexOf(dVal[2])!=-1?seconds.indexOf(dVal[2]):0 | |
| 159 | - ]:[ | |
| 160 | - dVal[0]&&hours.indexOf(dVal[0])!=-1?hours.indexOf(dVal[0]):0, | |
| 161 | - dVal[1]&&minutes.indexOf(dVal[1])!=-1?minutes.indexOf(dVal[1]):0 | |
| 162 | - ]; | |
| 163 | - pickVal=disabledAfter?defaultArr:(curFlag?(this.second?[ | |
| 164 | - hours.indexOf(this.formatNum(curDate.curHour)), | |
| 165 | - minutes.indexOf(this.formatNum(curDate.curMinute)), | |
| 166 | - seconds.indexOf(this.formatNum(curDate.curSecond)), | |
| 167 | - ]:[ | |
| 168 | - hours.indexOf(this.formatNum(curDate.curHour)), | |
| 169 | - minutes.indexOf(this.formatNum(curDate.curMinute)) | |
| 170 | - ]):defaultArr); | |
| 171 | - this.range=dateData; | |
| 172 | - this.checkObj=obj; | |
| 173 | - hour=dVal[0]?dVal[0]:hours[0]; | |
| 174 | - minute=dVal[1]?dVal[1]:minutes[0]; | |
| 175 | - if(this.second)second=dVal[2]?dVal[2]:seconds[0]; | |
| 176 | - result=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute}`; | |
| 177 | - full=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute+':00'}`; | |
| 178 | - this.$nextTick(()=>{ | |
| 179 | - this.pickVal=pickVal; | |
| 180 | - }); | |
| 181 | - this.$emit("change",{ | |
| 182 | - result:result, | |
| 183 | - value:full, | |
| 184 | - obj:obj | |
| 185 | - }) | |
| 186 | - }, | |
| 187 | - handlerChange(e){ | |
| 188 | - let arr=[...e.detail.value]; | |
| 189 | - let data=this.range; | |
| 190 | - let hour="",minute="",second="",result="",full="",obj={}; | |
| 191 | - hour=(arr[0]||arr[0]==0)?data.hours[arr[0]]||data.hours[data.hours.length-1]:""; | |
| 192 | - minute=(arr[1]||arr[1]==0)?data.minutes[arr[1]]||data.minutes[data.minutes.length-1]:""; | |
| 193 | - if(this.second)second=(arr[2]||arr[2]==0)?data.seconds[arr[2]]||data.seconds[data.seconds.length-1]:""; | |
| 194 | - obj=this.second?{ | |
| 195 | - hour, | |
| 196 | - minute, | |
| 197 | - second | |
| 198 | - }:{ | |
| 199 | - hour, | |
| 200 | - minute | |
| 201 | - }; | |
| 202 | - this.checkObj=obj; | |
| 203 | - result=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute}`; | |
| 204 | - full=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute+':00'}`; | |
| 205 | - this.$emit("change",{ | |
| 206 | - result:result, | |
| 207 | - value:full, | |
| 208 | - obj:obj | |
| 209 | - }) | |
| 210 | - } | |
| 211 | - } | |
| 212 | - } | |
| 213 | -</script> | |
| 214 | - | |
| 215 | -<style lang="scss"> | |
| 216 | - @import "./w-picker.css"; | |
| 217 | -</style> | |
| 218 | - |
yudao-ui-app/components/w-picker/w-picker.css deleted
| 1 | -.w-picker-flex2{ | |
| 2 | - flex:2; | |
| 3 | -} | |
| 4 | -.w-picker-flex1{ | |
| 5 | - flex:1; | |
| 6 | -} | |
| 7 | -.w-picker-view { | |
| 8 | - width: 100%; | |
| 9 | - height: 476upx; | |
| 10 | - overflow: hidden; | |
| 11 | - background-color: rgba(255, 255, 255, 1); | |
| 12 | - z-index: 666; | |
| 13 | -} | |
| 14 | -.d-picker-view{ | |
| 15 | - height: 100%; | |
| 16 | -} | |
| 17 | - | |
| 18 | -.w-picker-item { | |
| 19 | - text-align: center; | |
| 20 | - width: 100%; | |
| 21 | - height: 88upx; | |
| 22 | - line-height: 88upx; | |
| 23 | - text-overflow: ellipsis; | |
| 24 | - white-space: nowrap; | |
| 25 | - font-size: 30upx; | |
| 26 | -} | |
| 27 | 0 | \ No newline at end of file |
yudao-ui-app/components/w-picker/w-picker.vue deleted
| 1 | -<template name="w-picker"> | |
| 2 | - <view class="w-picker" :key="createKey" :data-key="createKey"> | |
| 3 | - <view class="mask" :class="{'visible':visible}" @tap="onCancel" @touchmove.stop.prevent catchtouchmove="true"></view> | |
| 4 | - <view class="w-picker-cnt" :class="{'visible':visible}"> | |
| 5 | - <view class="w-picker-header" @touchmove.stop.prevent catchtouchmove="true"> | |
| 6 | - <text @tap.stop.prevent="onCancel">取消</text> | |
| 7 | - <slot></slot> | |
| 8 | - <text :style="{'color':themeColor}" @tap.stop.prevent="pickerConfirm">确定</text> | |
| 9 | - </view> | |
| 10 | - <date-picker | |
| 11 | - v-if="mode=='date'" | |
| 12 | - class="w-picker-wrapper" | |
| 13 | - :startYear="startYear" | |
| 14 | - :endYear="endYear" | |
| 15 | - :value="value" | |
| 16 | - :fields="fields" | |
| 17 | - :item-height="itemHeight" | |
| 18 | - :current="current" | |
| 19 | - :disabled-after="disabledAfter" | |
| 20 | - @change="handlerChange" | |
| 21 | - @touchstart="touchStart" | |
| 22 | - @touchend="touchEnd"> | |
| 23 | - </date-picker> | |
| 24 | - | |
| 25 | - <range-picker | |
| 26 | - v-if="mode=='range'" | |
| 27 | - class="w-picker-wrapper" | |
| 28 | - :startYear="startYear" | |
| 29 | - :endYear="endYear" | |
| 30 | - :value="value" | |
| 31 | - :item-height="itemHeight" | |
| 32 | - :current="current" | |
| 33 | - @change="handlerChange" | |
| 34 | - @touchstart="touchStart" | |
| 35 | - @touchend="touchEnd"> | |
| 36 | - </range-picker> | |
| 37 | - | |
| 38 | - <half-picker | |
| 39 | - v-if="mode=='half'" | |
| 40 | - class="w-picker-wrapper" | |
| 41 | - :startYear="startYear" | |
| 42 | - :endYear="endYear" | |
| 43 | - :value="value" | |
| 44 | - :item-height="itemHeight" | |
| 45 | - :current="current" | |
| 46 | - :disabled-after="disabledAfter" | |
| 47 | - @change="handlerChange" | |
| 48 | - @touchstart="touchStart" | |
| 49 | - @touchend="touchEnd"> | |
| 50 | - </half-picker> | |
| 51 | - | |
| 52 | - <shortterm-picker | |
| 53 | - v-if="mode=='shortTerm'" | |
| 54 | - class="w-picker-wrapper" | |
| 55 | - :startYear="startYear" | |
| 56 | - :endYear="endYear" | |
| 57 | - :value="value" | |
| 58 | - :item-height="itemHeight" | |
| 59 | - :current="current" | |
| 60 | - expand="60" | |
| 61 | - :disabled-after="disabledAfter" | |
| 62 | - @change="handlerChange" | |
| 63 | - @touchstart="touchStart" | |
| 64 | - @touchend="touchEnd"> | |
| 65 | - </shortterm-picker> | |
| 66 | - | |
| 67 | - <time-picker | |
| 68 | - v-if="mode=='time'" | |
| 69 | - class="w-picker-wrapper" | |
| 70 | - :value="value" | |
| 71 | - :item-height="itemHeight" | |
| 72 | - :current="current" | |
| 73 | - :disabled-after="disabledAfter" | |
| 74 | - :second="second" | |
| 75 | - @change="handlerChange" | |
| 76 | - @touchstart="touchStart" | |
| 77 | - @touchend="touchEnd"> | |
| 78 | - </time-picker> | |
| 79 | - | |
| 80 | - <selector-picker | |
| 81 | - v-if="mode=='selector'" | |
| 82 | - class="w-picker-wrapper" | |
| 83 | - :value="value" | |
| 84 | - :item-height="itemHeight" | |
| 85 | - :options="options" | |
| 86 | - :default-type="defaultType" | |
| 87 | - :default-props="defaultProps" | |
| 88 | - @change="handlerChange" | |
| 89 | - @touchstart="touchStart" | |
| 90 | - @touchend="touchEnd"> | |
| 91 | - </selector-picker> | |
| 92 | - | |
| 93 | - <region-picker | |
| 94 | - v-if="mode=='region'" | |
| 95 | - class="w-picker-wrapper" | |
| 96 | - :value="value" | |
| 97 | - :hide-area="hideArea" | |
| 98 | - :default-type="defaultType" | |
| 99 | - :item-height="itemHeight" | |
| 100 | - @change="handlerChange" | |
| 101 | - @touchstart="touchStart" | |
| 102 | - @touchend="touchEnd"> | |
| 103 | - </region-picker> | |
| 104 | - | |
| 105 | - <linkage-picker | |
| 106 | - v-if="mode=='linkage'" | |
| 107 | - class="w-picker-wrapper" | |
| 108 | - :value="value" | |
| 109 | - :options="options" | |
| 110 | - :level="level" | |
| 111 | - :default-type="defaultType" | |
| 112 | - :default-props="defaultProps" | |
| 113 | - :item-height="itemHeight" | |
| 114 | - @change="handlerChange" | |
| 115 | - @touchstart="touchStart" | |
| 116 | - @touchend="touchEnd"> | |
| 117 | - </linkage-picker> | |
| 118 | - </view> | |
| 119 | - </view> | |
| 120 | -</template> | |
| 121 | - | |
| 122 | -<script> | |
| 123 | - import datePicker from "./date-picker.vue" | |
| 124 | - import rangePicker from "./range-picker.vue" | |
| 125 | - import halfPicker from "./half-picker.vue" | |
| 126 | - import shorttermPicker from "./shortterm-picker.vue" | |
| 127 | - import timePicker from "./time-picker.vue" | |
| 128 | - import selectorPicker from "./selector-picker.vue" | |
| 129 | - import regionPicker from "./region-picker.vue" | |
| 130 | - import linkagePicker from "./linkage-picker.vue" | |
| 131 | - export default { | |
| 132 | - name:"w-picker", | |
| 133 | - components:{ | |
| 134 | - datePicker, | |
| 135 | - rangePicker, | |
| 136 | - halfPicker, | |
| 137 | - timePicker, | |
| 138 | - selectorPicker, | |
| 139 | - shorttermPicker, | |
| 140 | - regionPicker, | |
| 141 | - linkagePicker | |
| 142 | - }, | |
| 143 | - props:{ | |
| 144 | - mode:{ | |
| 145 | - type:String, | |
| 146 | - default:"date" | |
| 147 | - }, | |
| 148 | - value:{//默认值 | |
| 149 | - type:[String,Array,Number], | |
| 150 | - default:"" | |
| 151 | - }, | |
| 152 | - current:{//是否默认显示当前时间,如果是,传的默认值将失效 | |
| 153 | - type:Boolean, | |
| 154 | - default:false | |
| 155 | - }, | |
| 156 | - themeColor:{//确认按钮主题颜色 | |
| 157 | - type:String, | |
| 158 | - default:"#f5a200" | |
| 159 | - }, | |
| 160 | - fields:{//日期颗粒度:year、month、day、hour、minute、second | |
| 161 | - type:String, | |
| 162 | - default:"date" | |
| 163 | - }, | |
| 164 | - disabledAfter:{//是否禁用当前之后的日期 | |
| 165 | - type:Boolean, | |
| 166 | - default:false | |
| 167 | - }, | |
| 168 | - second:{//time-picker是否显示秒 | |
| 169 | - type:Boolean, | |
| 170 | - default:true | |
| 171 | - }, | |
| 172 | - options:{//selector,region数据源 | |
| 173 | - type:[Array,Object], | |
| 174 | - default(){ | |
| 175 | - return [] | |
| 176 | - } | |
| 177 | - }, | |
| 178 | - defaultProps:{//selector,linkagle字段转换配置 | |
| 179 | - type:Object, | |
| 180 | - default(){ | |
| 181 | - return{ | |
| 182 | - label:"label", | |
| 183 | - value:"value", | |
| 184 | - children:"children" | |
| 185 | - } | |
| 186 | - } | |
| 187 | - }, | |
| 188 | - defaultType:{ | |
| 189 | - type:String, | |
| 190 | - default:"label" | |
| 191 | - }, | |
| 192 | - hideArea:{//mode=region时,是否隐藏区县列 | |
| 193 | - type:Boolean, | |
| 194 | - default:false | |
| 195 | - }, | |
| 196 | - level:{ | |
| 197 | - //多级联动层级,表示几级联动,区间2-4; | |
| 198 | - type:[Number,String], | |
| 199 | - default:2 | |
| 200 | - }, | |
| 201 | - timeout:{//是否开启点击延迟,当快速滚动 还没有滚动完毕点击关闭时得到的值是不准确的 | |
| 202 | - type:Boolean, | |
| 203 | - default:false | |
| 204 | - }, | |
| 205 | - expand:{//mode=shortterm 默认往后拓展天数 | |
| 206 | - type:[Number,String], | |
| 207 | - default:30 | |
| 208 | - }, | |
| 209 | - startYear:{ | |
| 210 | - type:[String,Number], | |
| 211 | - default:1970 | |
| 212 | - }, | |
| 213 | - endYear:{ | |
| 214 | - type:[String,Number], | |
| 215 | - default:new Date().getFullYear() | |
| 216 | - }, | |
| 217 | - visible:{ | |
| 218 | - type:Boolean, | |
| 219 | - default:false | |
| 220 | - } | |
| 221 | - }, | |
| 222 | - created() { | |
| 223 | - this.createKey=Math.random()*1000; | |
| 224 | - }, | |
| 225 | - data() { | |
| 226 | - return { | |
| 227 | - itemHeight:`height: ${uni.upx2px(88)}px;`, | |
| 228 | - result:{}, | |
| 229 | - confirmFlag:true | |
| 230 | - }; | |
| 231 | - }, | |
| 232 | - methods:{ | |
| 233 | - touchStart(){ | |
| 234 | - if(this.timeout){ | |
| 235 | - this.confirmFlag=false; | |
| 236 | - } | |
| 237 | - }, | |
| 238 | - touchEnd(){ | |
| 239 | - if(this.timeout){ | |
| 240 | - setTimeout(()=>{ | |
| 241 | - this.confirmFlag=true; | |
| 242 | - },500) | |
| 243 | - } | |
| 244 | - }, | |
| 245 | - handlerChange(res){ | |
| 246 | - let _this=this; | |
| 247 | - this.result={...res}; | |
| 248 | - }, | |
| 249 | - show(){ | |
| 250 | - this.$emit("update:visible",true); | |
| 251 | - }, | |
| 252 | - hide(){ | |
| 253 | - this.$emit("update:visible",false); | |
| 254 | - }, | |
| 255 | - onCancel(res){ | |
| 256 | - this.$emit("update:visible",false); | |
| 257 | - this.$emit("cancel"); | |
| 258 | - }, | |
| 259 | - pickerConfirm(){ | |
| 260 | - if(!this.confirmFlag){ | |
| 261 | - return; | |
| 262 | - }; | |
| 263 | - this.$emit("confirm",this.result); | |
| 264 | - this.$emit("update:visible",false); | |
| 265 | - } | |
| 266 | - } | |
| 267 | - } | |
| 268 | -</script> | |
| 269 | - | |
| 270 | -<style lang="scss"> | |
| 271 | - .w-picker-item { | |
| 272 | - text-align: center; | |
| 273 | - width: 100%; | |
| 274 | - height: 88upx; | |
| 275 | - line-height: 88upx; | |
| 276 | - text-overflow: ellipsis; | |
| 277 | - white-space: nowrap; | |
| 278 | - font-size: 30upx; | |
| 279 | - } | |
| 280 | - .w-picker{ | |
| 281 | - z-index: 888; | |
| 282 | - .mask { | |
| 283 | - position: fixed; | |
| 284 | - z-index: 1000; | |
| 285 | - top: 0; | |
| 286 | - right: 0; | |
| 287 | - left: 0; | |
| 288 | - bottom: 0; | |
| 289 | - background: rgba(0, 0, 0, 0.6); | |
| 290 | - visibility: hidden; | |
| 291 | - opacity: 0; | |
| 292 | - transition: all 0.3s ease; | |
| 293 | - } | |
| 294 | - .mask.visible{ | |
| 295 | - visibility: visible; | |
| 296 | - opacity: 1; | |
| 297 | - } | |
| 298 | - .w-picker-cnt { | |
| 299 | - position: fixed; | |
| 300 | - bottom: 0; | |
| 301 | - left: 0; | |
| 302 | - width: 100%; | |
| 303 | - transition: all 0.3s ease; | |
| 304 | - transform: translateY(100%); | |
| 305 | - z-index: 3000; | |
| 306 | - background-color: #fff; | |
| 307 | - } | |
| 308 | - .w-picker-cnt.visible { | |
| 309 | - transform: translateY(0); | |
| 310 | - } | |
| 311 | - .w-picker-header{ | |
| 312 | - display: flex; | |
| 313 | - align-items: center; | |
| 314 | - padding: 0 30upx; | |
| 315 | - height: 88upx; | |
| 316 | - background-color: #fff; | |
| 317 | - position: relative; | |
| 318 | - text-align: center; | |
| 319 | - font-size: 32upx; | |
| 320 | - justify-content: space-between; | |
| 321 | - border-bottom: solid 1px #eee; | |
| 322 | - .w-picker-btn{ | |
| 323 | - font-size: 30upx; | |
| 324 | - } | |
| 325 | - } | |
| 326 | - | |
| 327 | - .w-picker-hd:after { | |
| 328 | - content: ' '; | |
| 329 | - position: absolute; | |
| 330 | - left: 0; | |
| 331 | - bottom: 0; | |
| 332 | - right: 0; | |
| 333 | - height: 1px; | |
| 334 | - border-bottom: 1px solid #e5e5e5; | |
| 335 | - color: #e5e5e5; | |
| 336 | - transform-origin: 0 100%; | |
| 337 | - transform: scaleY(0.5); | |
| 338 | - } | |
| 339 | - } | |
| 340 | -</style> |
yudao-ui-app/components/yd-address-select/yd-address-select.vue deleted
| 1 | -<template> | |
| 2 | - <view class="address-box"> | |
| 3 | - <view v-if="!address.area" class="address-empty"> | |
| 4 | - <view class="address-tips"> | |
| 5 | - <u--text :lines="1" size="14px" color="#333" bold="true" text="请选择收货地址"></u--text> | |
| 6 | - <u-icon class="icon-arrow-right" name="arrow-right"></u-icon> | |
| 7 | - </view> | |
| 8 | - </view> | |
| 9 | - | |
| 10 | - <view v-else class="address-selected"> | |
| 11 | - <view class="address-area"> | |
| 12 | - <view class="default-tag">默认</view> | |
| 13 | - <u--text :lines="1" size="12px" color="#666" :text="address.area"></u--text> | |
| 14 | - </view> | |
| 15 | - <view class="address-detail"> | |
| 16 | - <u--text :lines="2" size="14px" color="#333" :bold="true" :text="address.detail"></u--text> | |
| 17 | - <u-icon class="icon-arrow-right" name="arrow-right"></u-icon> | |
| 18 | - </view> | |
| 19 | - <view class="address-user"> | |
| 20 | - <view class="user-text">{{ address.name }}</view> | |
| 21 | - <view class="user-text">{{ address.mobile }}</view> | |
| 22 | - </view> | |
| 23 | - </view> | |
| 24 | - <image class="address-line" src="/static/images/address-line.png"></image> | |
| 25 | - </view> | |
| 26 | -</template> | |
| 27 | - | |
| 28 | -<script> | |
| 29 | -/** | |
| 30 | - * 地址选择 | |
| 31 | - */ | |
| 32 | -export default { | |
| 33 | - name: 'yd-address-select', | |
| 34 | - props: { | |
| 35 | - address: { | |
| 36 | - type: Object, | |
| 37 | - default: () => [] | |
| 38 | - } | |
| 39 | - }, | |
| 40 | - data() { | |
| 41 | - return {} | |
| 42 | - }, | |
| 43 | - methods: {} | |
| 44 | -} | |
| 45 | -</script> | |
| 46 | - | |
| 47 | -<style lang="scss" scoped> | |
| 48 | -.address-box { | |
| 49 | - padding: 0 10rpx; | |
| 50 | - background-color: #fff; | |
| 51 | - border-radius: 0 0 30rpx 30rpx; | |
| 52 | - | |
| 53 | - .address-empty { | |
| 54 | - padding: 20rpx 20rpx 0; | |
| 55 | - .address-tips { | |
| 56 | - @include flex-space-between; | |
| 57 | - padding: 10rpx 0; | |
| 58 | - | |
| 59 | - .icon-arrow-right { | |
| 60 | - margin-left: 50rpx; | |
| 61 | - } | |
| 62 | - } | |
| 63 | - } | |
| 64 | - | |
| 65 | - .address-selected { | |
| 66 | - padding: 20rpx 20rpx 0; | |
| 67 | - .address-area { | |
| 68 | - @include flex-left; | |
| 69 | - | |
| 70 | - .default-tag { | |
| 71 | - font-size: 22rpx; | |
| 72 | - color: $u-primary; | |
| 73 | - border: 1rpx solid $u-primary; | |
| 74 | - padding: 0 6rpx; | |
| 75 | - margin-right: 10rpx; | |
| 76 | - border-radius: 5rpx; | |
| 77 | - } | |
| 78 | - } | |
| 79 | - | |
| 80 | - .address-detail { | |
| 81 | - @include flex-space-between; | |
| 82 | - padding: 10rpx 0; | |
| 83 | - | |
| 84 | - .icon-arrow-right { | |
| 85 | - margin-left: 50rpx; | |
| 86 | - } | |
| 87 | - } | |
| 88 | - | |
| 89 | - .address-user { | |
| 90 | - @include flex-left; | |
| 91 | - | |
| 92 | - .user-text { | |
| 93 | - color: #666; | |
| 94 | - font-size: 24rpx; | |
| 95 | - margin-right: 10rpx; | |
| 96 | - } | |
| 97 | - } | |
| 98 | - } | |
| 99 | - | |
| 100 | - .address-line { | |
| 101 | - width: 100%; | |
| 102 | - margin: 0 auto; | |
| 103 | - height: 5rpx; | |
| 104 | - } | |
| 105 | -} | |
| 106 | -</style> |
yudao-ui-app/components/yd-banner/yd-banner.vue deleted
| 1 | -<template> | |
| 2 | - <u-swiper :list="bannerList" :keyName="keyName" previousMargin="20" nextMargin="20" circular height="150" @change="e => (current = e.current)" :autoplay="true" @click="handleSwiperClick"> | |
| 3 | - <view slot="indicator" class="indicator"> | |
| 4 | - <view class="indicator__dot" v-for="(item, index) in bannerList" :key="index" :class="[index === current && 'indicator__dot--active']"></view> | |
| 5 | - </view> | |
| 6 | - </u-swiper> | |
| 7 | -</template> | |
| 8 | - | |
| 9 | -<script> | |
| 10 | -/** | |
| 11 | - * 广告滚动图 | |
| 12 | - */ | |
| 13 | -export default { | |
| 14 | - name: 'yd-banner', | |
| 15 | - components: {}, | |
| 16 | - props: { | |
| 17 | - keyName: { | |
| 18 | - type: String, | |
| 19 | - default: 'url' | |
| 20 | - }, | |
| 21 | - bannerList: { | |
| 22 | - type: Array, | |
| 23 | - default: () => [] | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - data() { | |
| 27 | - return { | |
| 28 | - current: 0, | |
| 29 | - currentNum: 0 | |
| 30 | - } | |
| 31 | - }, | |
| 32 | - methods: { | |
| 33 | - handleSwiperClick(index) { | |
| 34 | - console.log('点击了图片索引值:', index) | |
| 35 | - } | |
| 36 | - } | |
| 37 | -} | |
| 38 | -</script> | |
| 39 | - | |
| 40 | -<style lang="scss" scoped> | |
| 41 | -.indicator { | |
| 42 | - @include flex(row); | |
| 43 | - justify-content: center; | |
| 44 | - | |
| 45 | - &__dot { | |
| 46 | - height: 15rpx; | |
| 47 | - width: 15rpx; | |
| 48 | - border-radius: 100rpx; | |
| 49 | - background-color: rgba(255, 255, 255, 0.35); | |
| 50 | - margin: 0 10rpx; | |
| 51 | - transition: background-color 0.3s; | |
| 52 | - | |
| 53 | - &--active { | |
| 54 | - background-color: $custom-bg-color; | |
| 55 | - } | |
| 56 | - } | |
| 57 | -} | |
| 58 | -</style> |
yudao-ui-app/components/yd-cart-product/yd-cart-product.vue deleted
| 1 | -<template> | |
| 2 | - <view> | |
| 3 | - <view class="product-item" v-for="(item, index) in productList" :key="item.productId" @click="handleProductItemClick(item.productId)"> | |
| 4 | - <view class="product-check" @click.stop="handleCheckProduct(item.productId, item.checked)"> | |
| 5 | - <u-icon v-if="item.checked" name="checkmark-circle-fill" color="#3c9cff" size="22"></u-icon> | |
| 6 | - <view v-else class="un-check-box"></view> | |
| 7 | - </view> | |
| 8 | - <image class="product-image" :src="item.coverUrl"></image> | |
| 9 | - <view class="item-info"> | |
| 10 | - <view class="info-text"> | |
| 11 | - <u--text :lines="1" size="15px" color="#333333" :text="item.productTitle"></u--text> | |
| 12 | - <u-gap height="2px"></u-gap> | |
| 13 | - <u--text class="info-tips" :lines="1" size="12px" color="#939393" :text="item.tips"></u--text> | |
| 14 | - </view> | |
| 15 | - <view class="price-number-box"> | |
| 16 | - <view class="price-box"> | |
| 17 | - <yd-text-price color="red" size="13" intSize="20" :price="item.sellPrice"></yd-text-price> | |
| 18 | - <yd-text-price v-if="item.strikePrice" style="margin-left: 5px" decoration="line-through" color="#999" size="12" :price="item.sellPrice"></yd-text-price> | |
| 19 | - </view> | |
| 20 | - <view class="number-box" @click.stop> | |
| 21 | - <u-number-box min="1" max="999" bgColor="#fff" integer :disableMinus="false" :disabledInput="true" :name="item.productId" :value="item.productCount" @change="handleProductCountChange"></u-number-box> | |
| 22 | - </view> | |
| 23 | - </view> | |
| 24 | - </view> | |
| 25 | - </view> | |
| 26 | - </view> | |
| 27 | -</template> | |
| 28 | - | |
| 29 | -<script> | |
| 30 | -/** | |
| 31 | - * 购物车商品列表 | |
| 32 | - */ | |
| 33 | -export default { | |
| 34 | - name: 'yd-cart-product', | |
| 35 | - props: { | |
| 36 | - productList: { | |
| 37 | - type: Array, | |
| 38 | - default: () => [] | |
| 39 | - } | |
| 40 | - }, | |
| 41 | - data() { | |
| 42 | - return { | |
| 43 | - //status: 'nomore', | |
| 44 | - loadingText: '加载中...', | |
| 45 | - loadmoreText: '上拉加载更多', | |
| 46 | - nomoreText: '没有更多了' | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - methods: { | |
| 50 | - handleProductItemClick(productId) { | |
| 51 | - uni.$u.route('/pages/product/product', { | |
| 52 | - id: productId | |
| 53 | - }) | |
| 54 | - }, | |
| 55 | - handleItemCartClick(productId) { | |
| 56 | - this.$store.dispatch('CartProductCountChange', { productIds: [productId], productCount: 1, addition: true }).then(res => { | |
| 57 | - uni.$u.toast('已添加到购物车') | |
| 58 | - }) | |
| 59 | - }, | |
| 60 | - handleCheckProduct(productId, checked) { | |
| 61 | - this.$emit('productCheckedChange', productId, !checked) | |
| 62 | - }, | |
| 63 | - handleProductCountChange({ name, value }) { | |
| 64 | - this.$emit('productCartProductCountChange', name, value) | |
| 65 | - } | |
| 66 | - } | |
| 67 | -} | |
| 68 | -</script> | |
| 69 | -<style lang="scss" scoped> | |
| 70 | -.product-item { | |
| 71 | - background: #ffffff; | |
| 72 | - @include flex-space-between; | |
| 73 | - border-bottom: $custom-border-style; | |
| 74 | - padding: 10rpx 0 0 5rpx; | |
| 75 | - | |
| 76 | - .product-check { | |
| 77 | - padding: 20rpx; | |
| 78 | - | |
| 79 | - .un-check-box { | |
| 80 | - width: 20px; | |
| 81 | - height: 20px; | |
| 82 | - border: 1px solid #939393; | |
| 83 | - border-radius: 50%; | |
| 84 | - } | |
| 85 | - } | |
| 86 | - | |
| 87 | - .product-image { | |
| 88 | - width: 180rpx; | |
| 89 | - height: 180rpx; | |
| 90 | - border-radius: 10rpx; | |
| 91 | - } | |
| 92 | - | |
| 93 | - .item-info { | |
| 94 | - flex: 1; | |
| 95 | - padding: 20rpx 20rpx 0; | |
| 96 | - | |
| 97 | - .info-text { | |
| 98 | - height: 70rpx; | |
| 99 | - padding-bottom: 10rpx; | |
| 100 | - } | |
| 101 | - | |
| 102 | - .price-number-box { | |
| 103 | - @include flex-space-between; | |
| 104 | - | |
| 105 | - .price-box { | |
| 106 | - @include flex-left(); | |
| 107 | - } | |
| 108 | - | |
| 109 | - .number-box { | |
| 110 | - height: 100rpx; | |
| 111 | - @include flex-center; | |
| 112 | - } | |
| 113 | - } | |
| 114 | - } | |
| 115 | -} | |
| 116 | -</style> |
yudao-ui-app/components/yd-order-product/yd-order-product.vue deleted
| 1 | -<template> | |
| 2 | - <view> | |
| 3 | - <view class="product-item" v-for="(item, index) in productList" :key="item.productId"> | |
| 4 | - <image class="product-image" :src="item.coverUrl"></image> | |
| 5 | - <view class="item-info"> | |
| 6 | - <view class="info-text"> | |
| 7 | - <u--text :lines="1" size="15px" color="#333333" :text="item.productTitle"></u--text> | |
| 8 | - <u-gap height="10"></u-gap> | |
| 9 | - <yd-text-price class="product-price" size="13" intSize="16" :price="item.sellPrice"></yd-text-price> | |
| 10 | - </view> | |
| 11 | - <view class="price-number-box"> | |
| 12 | - <view class="number-box"> | |
| 13 | - <view class="product-number">共 {{ item.productCount }} 件</view> 小计: | |
| 14 | - </view> | |
| 15 | - <view class="number-box" @click.stop> | |
| 16 | - <yd-text-price size="13" intSize="18" :price="item.totalPrice"></yd-text-price> | |
| 17 | - </view> | |
| 18 | - </view> | |
| 19 | - </view> | |
| 20 | - </view> | |
| 21 | - </view> | |
| 22 | -</template> | |
| 23 | - | |
| 24 | -<script> | |
| 25 | -/** | |
| 26 | - * 订单商品列表 | |
| 27 | - */ | |
| 28 | -export default { | |
| 29 | - name: 'yd-order-product', | |
| 30 | - props: { | |
| 31 | - productList: { | |
| 32 | - type: Array, | |
| 33 | - default: () => [] | |
| 34 | - } | |
| 35 | - }, | |
| 36 | - data() { | |
| 37 | - return {} | |
| 38 | - }, | |
| 39 | - methods: { | |
| 40 | - handleProductItemClick(productId) { | |
| 41 | - uni.$u.route('/pages/product/product', { | |
| 42 | - id: productId | |
| 43 | - }) | |
| 44 | - } | |
| 45 | - } | |
| 46 | -} | |
| 47 | -</script> | |
| 48 | -<style lang="scss" scoped> | |
| 49 | -.product-item { | |
| 50 | - background: #ffffff; | |
| 51 | - @include flex-space-between; | |
| 52 | - border-bottom: $custom-border-style; | |
| 53 | - padding: 10rpx 0 0 5rpx; | |
| 54 | - | |
| 55 | - .product-check { | |
| 56 | - padding: 20rpx; | |
| 57 | - | |
| 58 | - .un-check-box { | |
| 59 | - width: 20px; | |
| 60 | - height: 20px; | |
| 61 | - border: 1px solid #939393; | |
| 62 | - border-radius: 50%; | |
| 63 | - } | |
| 64 | - } | |
| 65 | - | |
| 66 | - .product-image { | |
| 67 | - width: 180rpx; | |
| 68 | - height: 180rpx; | |
| 69 | - border-radius: 10rpx; | |
| 70 | - } | |
| 71 | - | |
| 72 | - .item-info { | |
| 73 | - flex: 1; | |
| 74 | - padding: 0 20rpx; | |
| 75 | - | |
| 76 | - .info-text { | |
| 77 | - padding-bottom: 10rpx; | |
| 78 | - .product-price { | |
| 79 | - margin-top: 15rpx; | |
| 80 | - } | |
| 81 | - } | |
| 82 | - | |
| 83 | - .price-number-box { | |
| 84 | - @include flex-space-between; | |
| 85 | - | |
| 86 | - .number-box { | |
| 87 | - font-size: 24rpx; | |
| 88 | - .product-number { | |
| 89 | - width: 200rpx; | |
| 90 | - } | |
| 91 | - } | |
| 92 | - | |
| 93 | - .number-box { | |
| 94 | - height: 60rpx; | |
| 95 | - @include flex-center; | |
| 96 | - } | |
| 97 | - } | |
| 98 | - } | |
| 99 | -} | |
| 100 | -</style> |
yudao-ui-app/components/yd-product-box/yd-product-box.vue deleted
| 1 | -<template> | |
| 2 | - <view> | |
| 3 | - <view v-if="showType === 'normal'"> | |
| 4 | - <u-gap height="180" bgColor="#398ade"></u-gap> | |
| 5 | - <view class="prod-block"> | |
| 6 | - <view class="bloc-header"> | |
| 7 | - <text class="bloc-title">{{title}}</text> | |
| 8 | - <text class="see-more">查看更多</text> | |
| 9 | - </view> | |
| 10 | - <view class="prod-grid"> | |
| 11 | - <view class="prod-item" v-for="(item, index) in productList" :key="item.id" @click="handleProdItemClick(item.id)"> | |
| 12 | - <image class="prod-image" :src="item.image"></image> | |
| 13 | - <view class="item-info"> | |
| 14 | - <view class="info-text"> | |
| 15 | - <u--text :lines="2" size="14px" color="#333333" :text="item.title"></u--text> | |
| 16 | - </view> | |
| 17 | - <view class="price-and-cart"> | |
| 18 | - <yd-text-price color="red" size="12" intSize="18" :price="item.price"></yd-text-price> | |
| 19 | - <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon> | |
| 20 | - </view> | |
| 21 | - </view> | |
| 22 | - </view> | |
| 23 | - </view> | |
| 24 | - </view> | |
| 25 | - </view> | |
| 26 | - | |
| 27 | - <view v-if="showType === 'half'"> | |
| 28 | - <view class="prod-block half"> | |
| 29 | - <view class="bloc-header"> | |
| 30 | - <text class="bloc-title">{{title}}</text> | |
| 31 | - <text class="more">更多 ></text> | |
| 32 | - </view> | |
| 33 | - <view class="prod-grid half"> | |
| 34 | - <view class="prod-item" v-for="(item, index) in productList" :key="item.id" @click="handleProdItemClick(item.id)"> | |
| 35 | - <image class="prod-image" :src="item.image"></image> | |
| 36 | - <view class="item-info"> | |
| 37 | - <view class="info-text"> | |
| 38 | - <u--text :lines="1" size="14px" color="#333333" :text="item.title"></u--text> | |
| 39 | - <u--text :lines="1" size="12px" color="#939393" :text="item.desc"></u--text> | |
| 40 | - </view> | |
| 41 | - <view class="price-and-cart"> | |
| 42 | - <yd-text-price color="red" size="12" intSize="18" :price="item.price"></yd-text-price> | |
| 43 | - <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon> | |
| 44 | - </view> | |
| 45 | - </view> | |
| 46 | - </view> | |
| 47 | - </view> | |
| 48 | - </view> | |
| 49 | - </view> | |
| 50 | - | |
| 51 | - </view> | |
| 52 | -</template> | |
| 53 | - | |
| 54 | -<script> | |
| 55 | -/** | |
| 56 | - * 商品列表 | |
| 57 | - */ | |
| 58 | -export default { | |
| 59 | - name: 'yd-product-box', | |
| 60 | - components: {}, | |
| 61 | - props: { | |
| 62 | - showType: { | |
| 63 | - type: String, | |
| 64 | - default: 'normal' | |
| 65 | - }, | |
| 66 | - title: { | |
| 67 | - type: String, | |
| 68 | - default: '商品推荐' | |
| 69 | - }, | |
| 70 | - productList: { | |
| 71 | - type: Array, | |
| 72 | - default: () => [] | |
| 73 | - } | |
| 74 | - }, | |
| 75 | - computed: {}, | |
| 76 | - methods: { | |
| 77 | - handleProdItemClick(productId) { | |
| 78 | - uni.$u.route('/pages/product/product', { | |
| 79 | - id: productId | |
| 80 | - }) | |
| 81 | - } | |
| 82 | - } | |
| 83 | -} | |
| 84 | -</script> | |
| 85 | -<style lang="scss" scoped> | |
| 86 | -.prod-block { | |
| 87 | - margin-top: -160px; | |
| 88 | - | |
| 89 | - .bloc-header { | |
| 90 | - @include flex-space-between; | |
| 91 | - padding: 10rpx 20rpx; | |
| 92 | - | |
| 93 | - .bloc-title { | |
| 94 | - color: $custom-bg-color; | |
| 95 | - font-size: 34rpx; | |
| 96 | - } | |
| 97 | - | |
| 98 | - .see-more { | |
| 99 | - color: $custom-bg-color; | |
| 100 | - background: $u-primary; | |
| 101 | - padding: 0 30rpx; | |
| 102 | - height: 50rpx; | |
| 103 | - line-height: 50rpx; | |
| 104 | - border-radius: 50rpx; | |
| 105 | - font-size: 24rpx; | |
| 106 | - } | |
| 107 | - } | |
| 108 | - | |
| 109 | - &.half { | |
| 110 | - margin-top: 0; | |
| 111 | - | |
| 112 | - .bloc-header { | |
| 113 | - margin-top: 50rpx; | |
| 114 | - margin-bottom: 20rpx; | |
| 115 | - | |
| 116 | - .bloc-title { | |
| 117 | - color: #333333; | |
| 118 | - } | |
| 119 | - | |
| 120 | - .more { | |
| 121 | - font-size: 24rpx; | |
| 122 | - } | |
| 123 | - } | |
| 124 | - } | |
| 125 | - | |
| 126 | - .prod-grid { | |
| 127 | - width: 730rpx; | |
| 128 | - margin: 0 auto; | |
| 129 | - @include flex; | |
| 130 | - flex-wrap: wrap; | |
| 131 | - justify-content: left; | |
| 132 | - | |
| 133 | - &.half { | |
| 134 | - .prod-item { | |
| 135 | - width: 345rpx; | |
| 136 | - margin: 10rpx; | |
| 137 | - | |
| 138 | - .prod-image { | |
| 139 | - width: 345rpx; | |
| 140 | - height: 345rpx; | |
| 141 | - } | |
| 142 | - } | |
| 143 | - } | |
| 144 | - | |
| 145 | - .prod-item { | |
| 146 | - width: 223rpx; | |
| 147 | - margin: 10rpx; | |
| 148 | - background: #ffffff; | |
| 149 | - border-radius: 10rpx; | |
| 150 | - box-shadow: 0rpx 6rpx 8rpx rgba(58, 134, 185, 0.2); | |
| 151 | - | |
| 152 | - .prod-image { | |
| 153 | - width: 223rpx; | |
| 154 | - height: 223rpx; | |
| 155 | - border-radius: 10rpx 10rpx 0 0; | |
| 156 | - } | |
| 157 | - | |
| 158 | - .item-info { | |
| 159 | - padding: 15rpx; | |
| 160 | - | |
| 161 | - .info-text { | |
| 162 | - height: 70rpx; | |
| 163 | - padding-bottom: 10rpx; | |
| 164 | - } | |
| 165 | - | |
| 166 | - .price-and-cart { | |
| 167 | - @include flex-space-between; | |
| 168 | - } | |
| 169 | - } | |
| 170 | - } | |
| 171 | - } | |
| 172 | -} | |
| 173 | -</style> |
yudao-ui-app/components/yd-product-more/yd-product-more.vue deleted
| 1 | -<template> | |
| 2 | - <view> | |
| 3 | - <view class="prod-block list"> | |
| 4 | - <view class="bloc-header"> | |
| 5 | - <text class="bloc-title">更多宝贝</text> | |
| 6 | - <text></text> | |
| 7 | - </view> | |
| 8 | - | |
| 9 | - <view class="prod-list" v-for="(item, index) in productList" :key="item.id"> | |
| 10 | - <view class="prod-item" @click="handleProdItemClick(item.id)"> | |
| 11 | - <image class="prod-image" :src="item.image"></image> | |
| 12 | - <view class="item-info"> | |
| 13 | - <view class="info-text"> | |
| 14 | - <u--text :lines="1" size="14px" color="#333333" :text="item.title"></u--text> | |
| 15 | - <u-gap height="2px"></u-gap> | |
| 16 | - <u--text class="info-desc" :lines="2" size="12px" color="#939393" :text="item.desc"></u--text> | |
| 17 | - </view> | |
| 18 | - <view class="price-and-cart"> | |
| 19 | - <yd-text-price color="red" size="12" intSize="18" :price="item.price"></yd-text-price> | |
| 20 | - <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon> | |
| 21 | - </view> | |
| 22 | - </view> | |
| 23 | - </view> | |
| 24 | - </view> | |
| 25 | - </view> | |
| 26 | - | |
| 27 | - <!--加载更多--> | |
| 28 | - <u-loadmore fontSize="28rpx" :line="true" :status="moreStatus" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" /> | |
| 29 | - | |
| 30 | - </view> | |
| 31 | -</template> | |
| 32 | - | |
| 33 | -<script> | |
| 34 | -/** | |
| 35 | - * 商品列表(加载更多) | |
| 36 | - */ | |
| 37 | -export default { | |
| 38 | - name: 'yd-product-more', | |
| 39 | - components: {}, | |
| 40 | - props: { | |
| 41 | - title: { | |
| 42 | - type: String, | |
| 43 | - default: '商品推荐' | |
| 44 | - }, | |
| 45 | - productList: { | |
| 46 | - type: Array, | |
| 47 | - default: () => [] | |
| 48 | - }, | |
| 49 | - moreStatus: { | |
| 50 | - type: String, | |
| 51 | - default: 'nomore' | |
| 52 | - } | |
| 53 | - }, | |
| 54 | - data() { | |
| 55 | - return { | |
| 56 | - //status: 'nomore', | |
| 57 | - loadingText: '加载中...', | |
| 58 | - loadmoreText: '上拉加载更多', | |
| 59 | - nomoreText: '已经到底了' | |
| 60 | - } | |
| 61 | - }, | |
| 62 | - methods: { | |
| 63 | - handleProdItemClick(productId) { | |
| 64 | - uni.$u.route('/pages/product/product', { | |
| 65 | - id: productId | |
| 66 | - }) | |
| 67 | - } | |
| 68 | - } | |
| 69 | -} | |
| 70 | -</script> | |
| 71 | -<style lang="scss" scoped> | |
| 72 | -.prod-block { | |
| 73 | - margin-top: 0; | |
| 74 | - | |
| 75 | - .bloc-header { | |
| 76 | - margin-top: 50rpx; | |
| 77 | - margin-bottom: 20rpx; | |
| 78 | - | |
| 79 | - .bloc-title { | |
| 80 | - margin-left: 20rpx; | |
| 81 | - color: #333333; | |
| 82 | - } | |
| 83 | - } | |
| 84 | - | |
| 85 | - .prod-list { | |
| 86 | - .prod-item { | |
| 87 | - background: #ffffff; | |
| 88 | - @include flex-space-between; | |
| 89 | - border-bottom: $custom-border-style; | |
| 90 | - padding: 20rpx; | |
| 91 | - | |
| 92 | - .prod-image { | |
| 93 | - width: 200rpx; | |
| 94 | - height: 200rpx; | |
| 95 | - border-radius: 10rpx; | |
| 96 | - } | |
| 97 | - | |
| 98 | - .item-info { | |
| 99 | - flex: 1; | |
| 100 | - padding: 20rpx 20rpx 0; | |
| 101 | - | |
| 102 | - .info-text { | |
| 103 | - height: 100rpx; | |
| 104 | - padding-bottom: 10rpx; | |
| 105 | - } | |
| 106 | - | |
| 107 | - .price-and-cart { | |
| 108 | - @include flex-space-between; | |
| 109 | - } | |
| 110 | - } | |
| 111 | - } | |
| 112 | - } | |
| 113 | -} | |
| 114 | -</style> |
yudao-ui-app/components/yd-text-price/yd-text-price.vue deleted
| 1 | -<template> | |
| 2 | - <view> | |
| 3 | - <text v-for="(item, index) in textArray" :key="index" :style="{ fontSize: (index === 1 ? integerSize : size) + 'px', color, textDecoration }"> | |
| 4 | - {{ item }} | |
| 5 | - </text> | |
| 6 | - </view> | |
| 7 | -</template> | |
| 8 | - | |
| 9 | -<script> | |
| 10 | -/** | |
| 11 | - * 此组件简单的显示(驼峰式)的价格 | |
| 12 | - */ | |
| 13 | -export default { | |
| 14 | - name: 'yd-text-price', | |
| 15 | - components: {}, | |
| 16 | - props: { | |
| 17 | - //货币符号 | |
| 18 | - symbol: { | |
| 19 | - type: String, | |
| 20 | - default: '¥' | |
| 21 | - }, | |
| 22 | - price: { | |
| 23 | - type: [String, Number], | |
| 24 | - default: '' | |
| 25 | - }, | |
| 26 | - color: { | |
| 27 | - type: String, | |
| 28 | - default: '#333333' | |
| 29 | - }, | |
| 30 | - //字体大小 | |
| 31 | - size: { | |
| 32 | - type: [String, Number], | |
| 33 | - default: 15 | |
| 34 | - }, | |
| 35 | - //整形部分字体大小可单独定义 | |
| 36 | - intSize: { | |
| 37 | - type: [String, Number], | |
| 38 | - default: '' | |
| 39 | - }, | |
| 40 | - //文字装饰,下划线,中划线等 | |
| 41 | - decoration: { | |
| 42 | - type: String, | |
| 43 | - default: 'none' | |
| 44 | - } | |
| 45 | - }, | |
| 46 | - data() { | |
| 47 | - return { | |
| 48 | - textDecoration: this.decoration | |
| 49 | - } | |
| 50 | - }, | |
| 51 | - computed: { | |
| 52 | - textArray() { | |
| 53 | - let array = [] | |
| 54 | - if (this.price === '' || this.price === undefined) { | |
| 55 | - return [] | |
| 56 | - } | |
| 57 | - array.push(this.symbol) | |
| 58 | - if (!/^\d+(\.\d+)?$/.test(this.price)) { | |
| 59 | - console.error('组件<yd-text-price :text="???" 此处参数应为金额数字') | |
| 60 | - } else { | |
| 61 | - let arr = parseFloat(this.price).toFixed(2).split('.') | |
| 62 | - array.push(arr[0]) | |
| 63 | - array.push('.' + arr[1]) | |
| 64 | - } | |
| 65 | - return array | |
| 66 | - }, | |
| 67 | - integerSize() { | |
| 68 | - return this.intSize ? this.intSize : this.size | |
| 69 | - } | |
| 70 | - } | |
| 71 | -} | |
| 72 | -</script> | |
| 73 | -<style scoped></style> |
yudao-ui-app/index.html deleted
| 1 | -<!DOCTYPE html> | |
| 2 | -<html lang="en"> | |
| 3 | - <head> | |
| 4 | - <meta charset="UTF-8" /> | |
| 5 | - <script> | |
| 6 | - let coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || | |
| 7 | - CSS.supports('top: constant(a)')) | |
| 8 | - document.write( | |
| 9 | - '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + | |
| 10 | - (coverSupport ? ', viewport-fit=cover' : '') + '" />') | |
| 11 | - </script> | |
| 12 | - <title></title> | |
| 13 | - <!--preload-links--> | |
| 14 | - <!--app-context--> | |
| 15 | - </head> | |
| 16 | - <body> | |
| 17 | - <div id="app"><!--app-html--></div> | |
| 18 | - <script type="module" src="/main.js"></script> | |
| 19 | - </body> | |
| 20 | -</html> |
yudao-ui-app/main.js deleted
| 1 | -import Vue from 'vue' | |
| 2 | -import App from './App' | |
| 3 | - | |
| 4 | -// 引入全局uView | |
| 5 | -import uView from '@/uni_modules/uview-ui' | |
| 6 | - | |
| 7 | -// vuex | |
| 8 | -import store from './store' | |
| 9 | - | |
| 10 | -Vue.config.productionTip = false | |
| 11 | -Vue.prototype.$store = store | |
| 12 | - | |
| 13 | - | |
| 14 | - | |
| 15 | -App.mpType = 'app' | |
| 16 | -Vue.use(uView) | |
| 17 | - | |
| 18 | -const app = new Vue({ | |
| 19 | - store, | |
| 20 | - ...App | |
| 21 | -}) | |
| 22 | - | |
| 23 | -// 引入请求封装 | |
| 24 | -require('./utils/request/index')(app) | |
| 25 | - | |
| 26 | -app.$mount() |
yudao-ui-app/manifest.json deleted
| 1 | -{ | |
| 2 | - "name" : "yudao-ui-app", | |
| 3 | - "appid" : "__UNI__CA099E3", | |
| 4 | - "description" : "yudao-ui-app for ruoyi-vue-pro", | |
| 5 | - "versionName" : "1.0.0", | |
| 6 | - "versionCode" : "100", | |
| 7 | - "transformPx" : false, | |
| 8 | - /* 5+App特有相关 */ | |
| 9 | - "app-plus" : { | |
| 10 | - "usingComponents" : true, | |
| 11 | - "nvueStyleCompiler" : "uni-app", | |
| 12 | - "compilerVersion" : 3, | |
| 13 | - "splashscreen" : { | |
| 14 | - "alwaysShowBeforeRender" : true, | |
| 15 | - "waiting" : true, | |
| 16 | - "autoclose" : true, | |
| 17 | - "delay" : 0 | |
| 18 | - }, | |
| 19 | - /* 模块配置 */ | |
| 20 | - "modules" : {}, | |
| 21 | - /* 应用发布信息 */ | |
| 22 | - "distribute" : { | |
| 23 | - /* android打包配置 */ | |
| 24 | - "android" : { | |
| 25 | - "permissions" : [ | |
| 26 | - "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", | |
| 27 | - "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", | |
| 28 | - "<uses-permission android:name=\"android.permission.VIBRATE\"/>", | |
| 29 | - "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", | |
| 30 | - "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", | |
| 31 | - "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", | |
| 32 | - "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", | |
| 33 | - "<uses-permission android:name=\"android.permission.CAMERA\"/>", | |
| 34 | - "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", | |
| 35 | - "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", | |
| 36 | - "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", | |
| 37 | - "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", | |
| 38 | - "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", | |
| 39 | - "<uses-feature android:name=\"android.hardware.camera\"/>", | |
| 40 | - "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" | |
| 41 | - ] | |
| 42 | - }, | |
| 43 | - /* ios打包配置 */ | |
| 44 | - "ios" : {}, | |
| 45 | - /* SDK配置 */ | |
| 46 | - "sdkConfigs" : {} | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - /* 快应用特有相关 */ | |
| 50 | - "quickapp" : {}, | |
| 51 | - /* 小程序特有相关 */ | |
| 52 | - "mp-weixin" : { | |
| 53 | - "appid" : "wx48d7c38b46f2e81c", | |
| 54 | - "setting" : { | |
| 55 | - "urlCheck" : false | |
| 56 | - }, | |
| 57 | - "usingComponents" : true | |
| 58 | - }, | |
| 59 | - "mp-alipay" : { | |
| 60 | - "usingComponents" : true | |
| 61 | - }, | |
| 62 | - "mp-baidu" : { | |
| 63 | - "usingComponents" : true | |
| 64 | - }, | |
| 65 | - "mp-toutiao" : { | |
| 66 | - "usingComponents" : true | |
| 67 | - }, | |
| 68 | - "uniStatistics" : { | |
| 69 | - "enable" : false | |
| 70 | - }, | |
| 71 | - "vueVersion" : "2" | |
| 72 | -} |
yudao-ui-app/pages.json deleted
| 1 | -{ | |
| 2 | - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages | |
| 3 | - { | |
| 4 | - "path": "pages/index/index", | |
| 5 | - "style": { | |
| 6 | - "navigationBarTitleText": "首页" | |
| 7 | - } | |
| 8 | - }, | |
| 9 | - { | |
| 10 | - "path": "pages/category/category", | |
| 11 | - "style": { | |
| 12 | - "navigationBarTitleText": "分类" | |
| 13 | - } | |
| 14 | - }, | |
| 15 | - { | |
| 16 | - "path": "pages/category/product-list", | |
| 17 | - "style": { | |
| 18 | - "navigationBarTitleText": "", | |
| 19 | - "navigationStyle": "custom", | |
| 20 | - "navigationBarTextStyle": "white" | |
| 21 | - } | |
| 22 | - }, | |
| 23 | - { | |
| 24 | - "path": "pages/cart/cart", | |
| 25 | - "style": { | |
| 26 | - "navigationBarTitleText": "购物车" | |
| 27 | - } | |
| 28 | - }, | |
| 29 | - { | |
| 30 | - "path": "pages/user/user", | |
| 31 | - "style": { | |
| 32 | - "navigationBarTitleText": "我的" | |
| 33 | - } | |
| 34 | - }, | |
| 35 | - { | |
| 36 | - "path": "pages/login/social", | |
| 37 | - "style": { | |
| 38 | - "navigationBarTitleText": "授权登录" | |
| 39 | - } | |
| 40 | - }, | |
| 41 | - { | |
| 42 | - "path": "pages/login/mobile", | |
| 43 | - "style": { | |
| 44 | - "navigationBarTitleText": "手机登录" | |
| 45 | - } | |
| 46 | - }, | |
| 47 | - { | |
| 48 | - "path": "pages/forgot/forgot", | |
| 49 | - "style": { | |
| 50 | - "navigationBarTitleText": "忘记密码" | |
| 51 | - } | |
| 52 | - }, | |
| 53 | - { | |
| 54 | - "path": "pages/profile/profile", | |
| 55 | - "style": { | |
| 56 | - "navigationBarTitleText": "个人资料" | |
| 57 | - } | |
| 58 | - }, | |
| 59 | - { | |
| 60 | - "path": "pages/setting/setting", | |
| 61 | - "style": { | |
| 62 | - "navigationBarTitleText": "账户设置" | |
| 63 | - } | |
| 64 | - }, | |
| 65 | - { | |
| 66 | - "path": "pages/product/product", | |
| 67 | - "style": { | |
| 68 | - "navigationBarTitleText": "商品详情" | |
| 69 | - } | |
| 70 | - }, | |
| 71 | - { | |
| 72 | - "path": "pages/checkout/checkout", | |
| 73 | - "style": { | |
| 74 | - "navigationBarTitleText": "填写订单" | |
| 75 | - } | |
| 76 | - }, | |
| 77 | - { | |
| 78 | - "path": "pages/order/list", | |
| 79 | - "style": { | |
| 80 | - "navigationBarTitleText": "我的订单" | |
| 81 | - } | |
| 82 | - }, | |
| 83 | - { | |
| 84 | - "path": "pages/order/detail", | |
| 85 | - "style": { | |
| 86 | - "navigationBarTitleText": "订单详情" | |
| 87 | - } | |
| 88 | - }, | |
| 89 | - { | |
| 90 | - "path": "pages/order/confirm", | |
| 91 | - "style": { | |
| 92 | - "navigationBarTitleText": "确认订单" | |
| 93 | - } | |
| 94 | - }, | |
| 95 | - { | |
| 96 | - "path": "pages/address/list", | |
| 97 | - "style": { | |
| 98 | - "navigationBarTitleText": "收货地址" | |
| 99 | - } | |
| 100 | - }, | |
| 101 | - { | |
| 102 | - "path": "pages/search/search", | |
| 103 | - "style": { | |
| 104 | - "navigationBarTitleText": "搜索" | |
| 105 | - } | |
| 106 | - }, | |
| 107 | - { | |
| 108 | - "path": "pages/address/create", | |
| 109 | - "style": { | |
| 110 | - "navigationBarTitleText": "新增地址" | |
| 111 | - } | |
| 112 | - }, | |
| 113 | - { | |
| 114 | - "path": "pages/address/update", | |
| 115 | - "style": { | |
| 116 | - "navigationBarTitleText": "修改地址" | |
| 117 | - } | |
| 118 | - } | |
| 119 | - ], | |
| 120 | - "tabBar": { | |
| 121 | - "selectedColor": "#333333", | |
| 122 | - "color": "#bfbfbf", | |
| 123 | - "list": [ | |
| 124 | - { | |
| 125 | - "pagePath": "pages/index/index", | |
| 126 | - "text": "首页", | |
| 127 | - "iconPath": "/static/images/tabbar/index.png", | |
| 128 | - "selectedIconPath": "/static/images/tabbar/index-active.png" | |
| 129 | - }, | |
| 130 | - { | |
| 131 | - "pagePath": "pages/category/category", | |
| 132 | - "text": "分类", | |
| 133 | - "iconPath": "/static/images/tabbar/category.png", | |
| 134 | - "selectedIconPath": "/static/images/tabbar/category-active.png" | |
| 135 | - }, | |
| 136 | - { | |
| 137 | - "pagePath": "pages/cart/cart", | |
| 138 | - "text": "购物车", | |
| 139 | - "iconPath": "/static/images/tabbar/cart.png", | |
| 140 | - "selectedIconPath": "/static/images/tabbar/cart-active.png" | |
| 141 | - }, | |
| 142 | - { | |
| 143 | - "pagePath": "pages/user/user", | |
| 144 | - "text": "我的", | |
| 145 | - "iconPath": "/static/images/tabbar/user.png", | |
| 146 | - "selectedIconPath": "/static/images/tabbar/user-active.png" | |
| 147 | - } | |
| 148 | - ] | |
| 149 | - }, | |
| 150 | - "globalStyle": { | |
| 151 | - "navigationBarTextStyle": "black", | |
| 152 | - "navigationBarTitleText": "yudao-ui-app", | |
| 153 | - "navigationBarBackgroundColor": "#ffffff", | |
| 154 | - "backgroundColor": "#ffffff" | |
| 155 | - } | |
| 156 | -} |
yudao-ui-app/pages/address/create.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="address-box"> | |
| 4 | - <u--form labelPosition="left" :model="formData" :rules="rules" ref="form"> | |
| 5 | - <u-form-item label="收件人名称" prop="name" labelWidth="90" borderBottom ref="item-name"> | |
| 6 | - <u-input type="text" maxlength="11" v-model="formData.name" clearable placeholder="请填写收件人名称" border="none"></u-input> | |
| 7 | - </u-form-item> | |
| 8 | - | |
| 9 | - <u-form-item label="手机号" prop="mobile" labelWidth="90" borderBottom ref="item-mobile"> | |
| 10 | - <u-input type="number" maxlength="11" v-model="formData.mobile" clearable placeholder="请填写手机号" border="none"></u-input> | |
| 11 | - </u-form-item> | |
| 12 | - | |
| 13 | - <u-form-item label="省市地区" prop="areaText" labelWidth="90" borderBottom @click=" regionVisible = true; hideKeyboard()" ref="item-areaText"> | |
| 14 | - <u--input v-model="formData.areaText" disabled disabledColor="#ffffff" placeholder="请选择省市地区" border="none"></u--input> | |
| 15 | - <u-icon slot="right" name="arrow-right"></u-icon> | |
| 16 | - <w-picker :visible.sync="regionVisible" mode="region" :value="defaultRegion" default-type="value" :hide-area="false" @confirm="onConfirm($event, 'region')" @cancel="onCancel" ref="region"></w-picker> | |
| 17 | - </u-form-item> | |
| 18 | - | |
| 19 | - <u-form-item label="详细地址" prop="detail" labelWidth="90" borderBottom ref="item-detail"> | |
| 20 | - <u--textarea placeholder="请输入街道门牌号不低于6个字" v-model="formData.detail" count></u--textarea> | |
| 21 | - </u-form-item> | |
| 22 | - | |
| 23 | - <u-form-item label="默认地址" prop="type" labelWidth="90" borderBottom ref="item-type"> | |
| 24 | - <u-radio-group v-model="formData.type"> | |
| 25 | - <u-radio :customStyle="{ marginRight: '16px' }" v-for="(item, index) in typeList" :key="index" :label="item.name" :name="item.value"></u-radio> | |
| 26 | - </u-radio-group> | |
| 27 | - </u-form-item> | |
| 28 | - | |
| 29 | - <view class="btn-group"> | |
| 30 | - <u-button type="primary" text="保存地址" customStyle="margin-top: 50px" @click="handleSubmit"></u-button> | |
| 31 | - </view> | |
| 32 | - </u--form> | |
| 33 | - </view> | |
| 34 | - </view> | |
| 35 | -</template> | |
| 36 | - | |
| 37 | -<script> | |
| 38 | -import { createAddress } from '../../api/address' | |
| 39 | - | |
| 40 | -export default { | |
| 41 | - data() { | |
| 42 | - return { | |
| 43 | - regionVisible: false, | |
| 44 | - defaultRegion: ['110000', '110100', '110101'], | |
| 45 | - typeList: [ | |
| 46 | - { | |
| 47 | - name: '是', | |
| 48 | - value: 1 | |
| 49 | - }, | |
| 50 | - { | |
| 51 | - name: '否', | |
| 52 | - value: 2 | |
| 53 | - } | |
| 54 | - ], | |
| 55 | - formData: { | |
| 56 | - name: '', | |
| 57 | - mobile: '', | |
| 58 | - areaText: '', | |
| 59 | - areaCode: '', | |
| 60 | - detail: '', | |
| 61 | - detailAddress: '', | |
| 62 | - type: 1 | |
| 63 | - }, | |
| 64 | - rules: { | |
| 65 | - name: [ | |
| 66 | - { | |
| 67 | - type: 'string', | |
| 68 | - min: 2, | |
| 69 | - max: 12, | |
| 70 | - required: true, | |
| 71 | - message: '请填写收件人名称', | |
| 72 | - trigger: ['blur', 'change'] | |
| 73 | - }, | |
| 74 | - { | |
| 75 | - message: '收件人名称不能为空', | |
| 76 | - // 触发器可以同时用blur和change | |
| 77 | - trigger: ['change', 'blur'] | |
| 78 | - } | |
| 79 | - ], | |
| 80 | - mobile: [ | |
| 81 | - { | |
| 82 | - type: 'integer', | |
| 83 | - required: true, | |
| 84 | - message: '请填写手机号', | |
| 85 | - trigger: ['blur', 'change'] | |
| 86 | - }, | |
| 87 | - { | |
| 88 | - // 自定义验证函数,见上说明 | |
| 89 | - validator: (rule, value, callback) => { | |
| 90 | - // 上面有说,返回true表示校验通过,返回false表示不通过 | |
| 91 | - // uni.$u.test.mobile()就是返回true或者false的 | |
| 92 | - return uni.$u.test.mobile(value) | |
| 93 | - }, | |
| 94 | - message: '手机号码不正确', | |
| 95 | - // 触发器可以同时用blur和change | |
| 96 | - trigger: ['change', 'blur'] | |
| 97 | - } | |
| 98 | - ], | |
| 99 | - areaText: { | |
| 100 | - type: 'string', | |
| 101 | - required: true, | |
| 102 | - message: '请选择省市地区', | |
| 103 | - trigger: ['blur', 'change'] | |
| 104 | - }, | |
| 105 | - detailAddress: { | |
| 106 | - type: 'string', | |
| 107 | - min: 6, | |
| 108 | - max: 30, | |
| 109 | - required: true, | |
| 110 | - message: '请填写详细地址', | |
| 111 | - trigger: ['blur', 'change'] | |
| 112 | - } | |
| 113 | - } | |
| 114 | - } | |
| 115 | - }, | |
| 116 | - onLoad() {}, | |
| 117 | - methods: { | |
| 118 | - onConfirm(res) { | |
| 119 | - this.formData.areaText = res.result | |
| 120 | - this.formData.areaCode = res.value[2] | |
| 121 | - }, | |
| 122 | - onCancel() {}, | |
| 123 | - hideKeyboard() { | |
| 124 | - uni.hideKeyboard() | |
| 125 | - }, | |
| 126 | - handleSubmit() { | |
| 127 | - this.$refs.form.validate().then(res => { | |
| 128 | - this.formData.detailAddress = this.formData.areaText + this.formData.detail | |
| 129 | - console.log(this.formData) | |
| 130 | - createAddress(this.formData).then(res => { | |
| 131 | - uni.$u.toast('地址已保存') | |
| 132 | - setTimeout(() => { | |
| 133 | - uni.navigateBack() | |
| 134 | - }, 300) | |
| 135 | - }) | |
| 136 | - }) | |
| 137 | - } | |
| 138 | - } | |
| 139 | -} | |
| 140 | -</script> | |
| 141 | - | |
| 142 | -<style lang="scss" scoped> | |
| 143 | -.address-box { | |
| 144 | - width: 690rpx; | |
| 145 | - margin: 0 auto; | |
| 146 | - padding-top: 30rpx; | |
| 147 | -} | |
| 148 | -</style> |
yudao-ui-app/pages/address/list.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="address-list" v-for="(item, index) in addressList" :key="item.id"> | |
| 4 | - <view class="address-item" @click="handleClick" @longpress="handleLongPress(item)"> | |
| 5 | - <view class="left"> | |
| 6 | - <u-avatar :text="item.name ? item.name.slice(0, 1) : 'U'" fontSize="18" randomBgColor></u-avatar> | |
| 7 | - </view> | |
| 8 | - <view class="middle"> | |
| 9 | - <view class="info"> | |
| 10 | - <view class="name">{{ item.name }}</view> | |
| 11 | - <view class="mobile">{{ item.mobile }}</view> | |
| 12 | - <u-tag class="type" v-if="item.type === 1" text="默认" plain size="mini" type="success"></u-tag> | |
| 13 | - </view> | |
| 14 | - <view class="detail"> | |
| 15 | - <u--text :lines="2" size="14" color="#939393" :text="item.detailAddress"></u--text> | |
| 16 | - </view> | |
| 17 | - </view> | |
| 18 | - <navigator class="right" :url="`/pages/address/update?addressId=${item.id}`" open-type="navigate" hover-class="none"> | |
| 19 | - <u-icon name="edit-pen" size="28"></u-icon> | |
| 20 | - </navigator> | |
| 21 | - </view> | |
| 22 | - </view> | |
| 23 | - | |
| 24 | - <navigator class="fixed-btn-box" url="/pages/address/create" open-type="navigate" hover-class="none"> | |
| 25 | - <u-button type="primary" size="large" text="新增地址"></u-button> | |
| 26 | - </navigator> | |
| 27 | - <u-safe-bottom customStyle="background: #ffffff"></u-safe-bottom> | |
| 28 | - </view> | |
| 29 | -</template> | |
| 30 | - | |
| 31 | -<script> | |
| 32 | -import { getAddressList, deleteAddress } from '../../api/address' | |
| 33 | - | |
| 34 | -export default { | |
| 35 | - data() { | |
| 36 | - return { | |
| 37 | - addressList: [] | |
| 38 | - } | |
| 39 | - }, | |
| 40 | - onLoad() {}, | |
| 41 | - onShow() { | |
| 42 | - this.loadAddressListData() | |
| 43 | - }, | |
| 44 | - methods: { | |
| 45 | - loadAddressListData() { | |
| 46 | - getAddressList().then(res => { | |
| 47 | - this.addressList = res.data | |
| 48 | - }) | |
| 49 | - }, | |
| 50 | - handleLongPress(item) { | |
| 51 | - uni.showModal({ | |
| 52 | - title: '提示', | |
| 53 | - content: `删除收件人[${item.name}${item.mobile}]\n地址:${item.detailAddress.slice(0, 5)}......${item.detailAddress.slice(-6)}?`, | |
| 54 | - success: res => { | |
| 55 | - if (res.confirm) { | |
| 56 | - deleteAddress({ id: item.id }).then(res => { | |
| 57 | - uni.$u.toast('地址已删除') | |
| 58 | - this.loadAddressListData(); | |
| 59 | - }) | |
| 60 | - } else if (res.cancel) { | |
| 61 | - //console.log('用户点击取消') | |
| 62 | - } | |
| 63 | - } | |
| 64 | - }) | |
| 65 | - }, | |
| 66 | - handleClick(){ | |
| 67 | - // TODO 提交订单时选择地址逻辑 | |
| 68 | - } | |
| 69 | - } | |
| 70 | -} | |
| 71 | -</script> | |
| 72 | - | |
| 73 | -<style lang="scss" scoped> | |
| 74 | -.address-list { | |
| 75 | - .address-item { | |
| 76 | - padding: 10rpx 0; | |
| 77 | - border-bottom: $custom-border-style; | |
| 78 | - @include flex-space-between; | |
| 79 | - .left { | |
| 80 | - margin: 20rpx; | |
| 81 | - } | |
| 82 | - .middle { | |
| 83 | - flex: 1; | |
| 84 | - margin: 20rpx; | |
| 85 | - @include flex(column); | |
| 86 | - .info { | |
| 87 | - @include flex-left; | |
| 88 | - .name { | |
| 89 | - font-size: 30rpx; | |
| 90 | - font-weight: 700; | |
| 91 | - } | |
| 92 | - .mobile { | |
| 93 | - font-size: 28rpx; | |
| 94 | - margin-left: 15rpx; | |
| 95 | - } | |
| 96 | - .type { | |
| 97 | - margin-left: 15rpx; | |
| 98 | - } | |
| 99 | - } | |
| 100 | - .detail { | |
| 101 | - margin-top: 10rpx; | |
| 102 | - } | |
| 103 | - } | |
| 104 | - .right { | |
| 105 | - margin: 20rpx; | |
| 106 | - } | |
| 107 | - } | |
| 108 | -} | |
| 109 | - | |
| 110 | -.fixed-btn-box { | |
| 111 | - position: fixed; | |
| 112 | - bottom: 0; | |
| 113 | - left: 0; | |
| 114 | - width: 750rpx; | |
| 115 | -} | |
| 116 | -</style> |
yudao-ui-app/pages/address/update.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="address-box"> | |
| 4 | - <u--form labelPosition="left" :model="formData" :rules="rules" ref="form"> | |
| 5 | - <u-form-item label="收件人名称" prop="name" labelWidth="90" borderBottom ref="item-name"> | |
| 6 | - <u-input type="text" maxlength="11" v-model="formData.name" clearable placeholder="请填写收件人名称" border="none"></u-input> | |
| 7 | - </u-form-item> | |
| 8 | - | |
| 9 | - <u-form-item label="手机号" prop="mobile" labelWidth="90" borderBottom ref="item-mobile"> | |
| 10 | - <u-input type="number" maxlength="11" v-model="formData.mobile" clearable placeholder="请填写手机号" border="none"></u-input> | |
| 11 | - </u-form-item> | |
| 12 | - | |
| 13 | - <u-form-item label="省市地区" prop="areaText" labelWidth="90" borderBottom @click=" regionVisible = true; hideKeyboard()" ref="item-areaText"> | |
| 14 | - <u--input v-model="formData.areaText" disabled disabledColor="#ffffff" placeholder="请选择省市地区" border="none"></u--input> | |
| 15 | - <u-icon slot="right" name="arrow-right"></u-icon> | |
| 16 | - <w-picker :visible.sync="regionVisible" mode="region" :value="defaultRegion" default-type="value" :hide-area="false" @confirm="onConfirm($event, 'region')" @cancel="onCancel" ref="region"></w-picker> | |
| 17 | - </u-form-item> | |
| 18 | - | |
| 19 | - <u-form-item label="详细地址" prop="detail" labelWidth="90" borderBottom ref="item-detail"> | |
| 20 | - <u--textarea placeholder="请输入街道门牌号不低于6个字" v-model="formData.detail" count></u--textarea> | |
| 21 | - </u-form-item> | |
| 22 | - | |
| 23 | - <u-form-item label="默认地址" prop="type" labelWidth="90" borderBottom ref="item-type"> | |
| 24 | - <u-radio-group v-model="formData.type"> | |
| 25 | - <u-radio :customStyle="{ marginRight: '16px' }" v-for="(item, index) in typeList" :key="index" :label="item.name" :name="item.value"></u-radio> | |
| 26 | - </u-radio-group> | |
| 27 | - </u-form-item> | |
| 28 | - | |
| 29 | - <view class="btn-group"> | |
| 30 | - <u-button type="primary" text="更新地址" customStyle="margin-top: 50px" @click="handleSubmit"></u-button> | |
| 31 | - </view> | |
| 32 | - </u--form> | |
| 33 | - </view> | |
| 34 | - </view> | |
| 35 | -</template> | |
| 36 | - | |
| 37 | -<script> | |
| 38 | -import { getAddressById, updateAddress } from '../../api/address' | |
| 39 | - | |
| 40 | -export default { | |
| 41 | - data() { | |
| 42 | - return { | |
| 43 | - id: '', | |
| 44 | - regionVisible: false, | |
| 45 | - defaultRegion: ['110000', '110100', '110101'], | |
| 46 | - typeList: [ | |
| 47 | - { | |
| 48 | - name: '是', | |
| 49 | - value: 1 | |
| 50 | - }, | |
| 51 | - { | |
| 52 | - name: '否', | |
| 53 | - value: 2 | |
| 54 | - } | |
| 55 | - ], | |
| 56 | - formData: { | |
| 57 | - id: '', | |
| 58 | - name: '', | |
| 59 | - mobile: '', | |
| 60 | - areaText: '', | |
| 61 | - areaCode: '', | |
| 62 | - detail: '', | |
| 63 | - detailAddress: '', | |
| 64 | - type: 1 | |
| 65 | - }, | |
| 66 | - rules: { | |
| 67 | - name: [ | |
| 68 | - { | |
| 69 | - type: 'string', | |
| 70 | - min: 2, | |
| 71 | - max: 12, | |
| 72 | - required: true, | |
| 73 | - message: '请填写收件人名称', | |
| 74 | - trigger: ['blur', 'change'] | |
| 75 | - }, | |
| 76 | - { | |
| 77 | - message: '收件人名称不能为空', | |
| 78 | - // 触发器可以同时用blur和change | |
| 79 | - trigger: ['change', 'blur'] | |
| 80 | - } | |
| 81 | - ], | |
| 82 | - mobile: [ | |
| 83 | - { | |
| 84 | - type: 'integer', | |
| 85 | - required: true, | |
| 86 | - message: '请填写手机号', | |
| 87 | - trigger: ['blur', 'change'] | |
| 88 | - }, | |
| 89 | - { | |
| 90 | - // 自定义验证函数,见上说明 | |
| 91 | - validator: (rule, value, callback) => { | |
| 92 | - // 上面有说,返回true表示校验通过,返回false表示不通过 | |
| 93 | - // uni.$u.test.mobile()就是返回true或者false的 | |
| 94 | - return uni.$u.test.mobile(value) | |
| 95 | - }, | |
| 96 | - message: '手机号码不正确', | |
| 97 | - // 触发器可以同时用blur和change | |
| 98 | - trigger: ['change', 'blur'] | |
| 99 | - } | |
| 100 | - ], | |
| 101 | - areaText: { | |
| 102 | - type: 'string', | |
| 103 | - required: true, | |
| 104 | - message: '请选择省市地区', | |
| 105 | - trigger: ['blur', 'change'] | |
| 106 | - }, | |
| 107 | - detailAddress: { | |
| 108 | - type: 'string', | |
| 109 | - min: 6, | |
| 110 | - max: 30, | |
| 111 | - required: true, | |
| 112 | - message: '请填写详细地址', | |
| 113 | - trigger: ['blur', 'change'] | |
| 114 | - } | |
| 115 | - } | |
| 116 | - } | |
| 117 | - }, | |
| 118 | - onLoad(e) { | |
| 119 | - if (!e.addressId) { | |
| 120 | - uni.$u.toast('请求参数错误') | |
| 121 | - } else { | |
| 122 | - this.id = e.addressId | |
| 123 | - this.loadAddressData() | |
| 124 | - } | |
| 125 | - }, | |
| 126 | - methods: { | |
| 127 | - loadAddressData() { | |
| 128 | - getAddressById({ id: this.id }).then(res => { | |
| 129 | - this.formData = res.data | |
| 130 | - this.initRegionData() | |
| 131 | - }) | |
| 132 | - }, | |
| 133 | - initRegionData(){ | |
| 134 | - //回显 【省市地区】 和 【详细地址】 信息 | |
| 135 | - if (this.formData.areaCode) { | |
| 136 | - const areaCode = this.formData.areaCode + '' | |
| 137 | - //通过地区code反解析出【省-市-地区】code | |
| 138 | - this.defaultRegion.splice(0, 3, areaCode.substring(0,2).padEnd(6, '0'), areaCode.substring(0,4).padEnd(6, '0'), areaCode) | |
| 139 | - this.$nextTick(res => { | |
| 140 | - let areaText = this.$refs.region._data.result.result | |
| 141 | - this.formData.areaText = areaText | |
| 142 | - //通过从完整详细地址除去【省-市-地区】得到后半段地址信息 | |
| 143 | - this.formData.detail = this.formData.detailAddress.replace(areaText, '') | |
| 144 | - this.$forceUpdate(); | |
| 145 | - }) | |
| 146 | - } | |
| 147 | - }, | |
| 148 | - onConfirm(res) { | |
| 149 | - this.formData.areaText = res.result | |
| 150 | - this.formData.areaCode = res.value[2] | |
| 151 | - }, | |
| 152 | - onCancel() {}, | |
| 153 | - hideKeyboard() { | |
| 154 | - uni.hideKeyboard() | |
| 155 | - }, | |
| 156 | - handleSubmit() { | |
| 157 | - this.$refs.form.validate().then(res => { | |
| 158 | - this.formData.detailAddress = this.formData.areaText + this.formData.detail | |
| 159 | - console.log(this.formData) | |
| 160 | - updateAddress(this.formData).then(res => { | |
| 161 | - uni.$u.toast('地址已更新') | |
| 162 | - setTimeout(() => { | |
| 163 | - uni.navigateBack() | |
| 164 | - }, 300) | |
| 165 | - }) | |
| 166 | - }) | |
| 167 | - } | |
| 168 | - } | |
| 169 | -} | |
| 170 | -</script> | |
| 171 | - | |
| 172 | -<style lang="scss" scoped> | |
| 173 | -.address-box { | |
| 174 | - width: 690rpx; | |
| 175 | - margin: 0 auto; | |
| 176 | - padding-top: 30rpx; | |
| 177 | -} | |
| 178 | -</style> |
yudao-ui-app/pages/cart/cart.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <!-- 购物车为空 --> | |
| 4 | - <view v-if="!hasLogin || cartList.length === 0"> | |
| 5 | - <view class="cart-empty"> | |
| 6 | - <u-empty text="去逛逛添点什么吧" width="500rpx" height="500rpx" icon="/static/images/empty/cart.png"></u-empty> | |
| 7 | - </view> | |
| 8 | - </view> | |
| 9 | - | |
| 10 | - <!-- 购物车列表 --> | |
| 11 | - <scroll-view v-if="hasLogin && cartList.length > 0" class="cart-product" scroll-y="true"> | |
| 12 | - <yd-cart-product :product-list="cartList" @productCheckedChange="handleProductCheckedChange" @productCountChange="handleProductCountChange"></yd-cart-product> | |
| 13 | - </scroll-view> | |
| 14 | - | |
| 15 | - <!-- 未登录 --> | |
| 16 | - <view v-if="!hasLogin" class="login-tips-box"> | |
| 17 | - <view class="login-tips"> | |
| 18 | - <navigator url="/pages/login/social" open-type="navigate" hover-class="none"> | |
| 19 | - <view class="login-link">登录查看</view> | |
| 20 | - </navigator> | |
| 21 | - </view> | |
| 22 | - </view> | |
| 23 | - | |
| 24 | - <!-- 底部菜单 --> | |
| 25 | - <view class="cart-btn-container"> | |
| 26 | - <view class="btn-box"> | |
| 27 | - <view class="product-check-info"> | |
| 28 | - <view class="check-all-btn" @click.stop="handleCheckAllProduct"> | |
| 29 | - <u-icon v-if="isCheckAll" name="checkmark-circle-fill" color="#3c9cff" size="22"></u-icon> | |
| 30 | - <view v-else class="un-check-box"></view> | |
| 31 | - </view> | |
| 32 | - <view class="info-text">合计:</view> | |
| 33 | - <view> | |
| 34 | - <yd-text-price color="red" size="15" intSize="20" :price="totalAmount"></yd-text-price> | |
| 35 | - </view> | |
| 36 | - </view> | |
| 37 | - | |
| 38 | - <view v-if="checkedProduct.length > 0" class="cart-btn-group"> | |
| 39 | - <u-button type="warning" shape="circle" size="small" text="移除" @click="handleRemoveProduct"></u-button> | |
| 40 | - <view class="btn-gap"></view> | |
| 41 | - <u-button style="margin-left: 10px" class="main-btn" type="primary" shape="circle" size="small" text="去结算" @click="handleCheckoutProduct"></u-button> | |
| 42 | - </view> | |
| 43 | - <view v-else class="cart-btn-group"> | |
| 44 | - <u-button type="warning" shape="circle" size="small" text="移除" disabled></u-button> | |
| 45 | - <view class="btn-gap"></view> | |
| 46 | - <u-button style="margin-left: 10px" class="main-btn" type="primary" shape="circle" size="small" text="去结算" disabled></u-button> | |
| 47 | - </view> | |
| 48 | - </view> | |
| 49 | - </view> | |
| 50 | - </view> | |
| 51 | -</template> | |
| 52 | - | |
| 53 | -<script> | |
| 54 | -export default { | |
| 55 | - data() { | |
| 56 | - return { | |
| 57 | - title: '', | |
| 58 | - cartList: [], | |
| 59 | - checkedNumber: 0, | |
| 60 | - totalAmount: 0 | |
| 61 | - } | |
| 62 | - }, | |
| 63 | - computed: { | |
| 64 | - checkedProduct() { | |
| 65 | - return this.cartList.filter(item => { | |
| 66 | - return item.checked | |
| 67 | - }) | |
| 68 | - }, | |
| 69 | - isCheckAll() { | |
| 70 | - if (this.cartList.length < 1) { | |
| 71 | - return false | |
| 72 | - } | |
| 73 | - return this.cartList.every(item => { | |
| 74 | - return item.checked | |
| 75 | - }) | |
| 76 | - }, | |
| 77 | - hasLogin() { | |
| 78 | - return this.$store.getters.hasLogin | |
| 79 | - } | |
| 80 | - }, | |
| 81 | - onShow() { | |
| 82 | - if (this.hasLogin) { | |
| 83 | - this.loadCartDetailData() | |
| 84 | - } else { | |
| 85 | - this.cartList =[] | |
| 86 | - } | |
| 87 | - }, | |
| 88 | - methods: { | |
| 89 | - loadCartDetailData() { | |
| 90 | - this.$store.dispatch('CartProductDetail').then(res => { | |
| 91 | - this.cartList = res.data || [] | |
| 92 | - }) | |
| 93 | - }, | |
| 94 | - /** 商品全选/取消全选 */ | |
| 95 | - handleCheckAllProduct() { | |
| 96 | - if (this.cartList.length < 1) { | |
| 97 | - return | |
| 98 | - } | |
| 99 | - const productIds = this.cartList.map(item => { | |
| 100 | - return item.productId | |
| 101 | - }) | |
| 102 | - this.$store.dispatch('CartProductCheckChange', { productIds, checked: !this.isCheckAll }).then(res => { | |
| 103 | - this.cartList = res.data || [] | |
| 104 | - }) | |
| 105 | - }, | |
| 106 | - /** 商品单选/取消单选 */ | |
| 107 | - handleProductCheckedChange(productId, checked) { | |
| 108 | - this.$store.dispatch('CartProductCheckChange', { productIds: [productId], checked: checked }).then(res => { | |
| 109 | - this.cartList = res.data || [] | |
| 110 | - }) | |
| 111 | - }, | |
| 112 | - /** 修改购物车商品数量 */ | |
| 113 | - handleProductCountChange(productId, number) { | |
| 114 | - this.$store.dispatch('CartProductCountChange', { productIds: [productId], productCount: number }).then(res => { | |
| 115 | - this.cartList = res.data || [] | |
| 116 | - }) | |
| 117 | - }, | |
| 118 | - /** 移除购物车商品 */ | |
| 119 | - handleRemoveProduct() { | |
| 120 | - if (this.checkedProduct < 1) { | |
| 121 | - return | |
| 122 | - } | |
| 123 | - const productIds = this.checkedProduct.map(item => { | |
| 124 | - return item.productId | |
| 125 | - }) | |
| 126 | - | |
| 127 | - uni.showModal({ | |
| 128 | - title: '确定要移除选中的商品?', | |
| 129 | - cancelText: '取消', | |
| 130 | - confirmText: '移除', | |
| 131 | - success: res => { | |
| 132 | - if (res.confirm) { | |
| 133 | - this.$store.dispatch('CartProductCountChange', { productIds: productIds, productCount: 0 }).then(res => { | |
| 134 | - this.cartList = res.data || [] | |
| 135 | - }) | |
| 136 | - } else if (res.cancel) { | |
| 137 | - //console.log('用户点击取消') | |
| 138 | - } | |
| 139 | - } | |
| 140 | - }) | |
| 141 | - }, | |
| 142 | - /** 购物车提交结算 */ | |
| 143 | - handleCheckoutProduct() { | |
| 144 | - if (this.checkedProduct < 1) { | |
| 145 | - return | |
| 146 | - } | |
| 147 | - const checkedProduct = this.checkedProduct.map(item => { | |
| 148 | - return { productId: item.productId, productCount: item.productCount, sellPrice: item.sellPrice } | |
| 149 | - }) | |
| 150 | - uni.$u.route('/pages/checkout/checkout', { | |
| 151 | - checkedProduct: JSON.stringify(checkedProduct) | |
| 152 | - }) | |
| 153 | - } | |
| 154 | - } | |
| 155 | -} | |
| 156 | -</script> | |
| 157 | - | |
| 158 | -<style lang="scss" scoped> | |
| 159 | -.login-tips-box { | |
| 160 | - padding-top: 100rpx; | |
| 161 | - | |
| 162 | - .login-tips { | |
| 163 | - @include flex-center; | |
| 164 | - color: #939393; | |
| 165 | - font-size: 24rpx; | |
| 166 | - letter-spacing: 5rpx; | |
| 167 | - } | |
| 168 | - | |
| 169 | - .login-link { | |
| 170 | - width: 160rpx; | |
| 171 | - height: 50rpx; | |
| 172 | - line-height: 50rpx; | |
| 173 | - border-radius: 50rpx; | |
| 174 | - border: 1px solid #777; | |
| 175 | - color: #777; | |
| 176 | - text-align: center; | |
| 177 | - } | |
| 178 | -} | |
| 179 | - | |
| 180 | -.cart-btn-container { | |
| 181 | - position: fixed; | |
| 182 | - bottom: 0; | |
| 183 | - left: 0; | |
| 184 | - | |
| 185 | - .btn-box { | |
| 186 | - background: $custom-bg-color; | |
| 187 | - border-top: $custom-border-style; | |
| 188 | - | |
| 189 | - width: 750rpx; | |
| 190 | - @include flex-space-between(); | |
| 191 | - height: 100rpx; | |
| 192 | - | |
| 193 | - .product-check-info { | |
| 194 | - @include flex-left; | |
| 195 | - | |
| 196 | - .check-all-btn { | |
| 197 | - padding: 20rpx; | |
| 198 | - | |
| 199 | - .un-check-box { | |
| 200 | - width: 20px; | |
| 201 | - height: 20px; | |
| 202 | - border: 1px solid #939393; | |
| 203 | - border-radius: 50%; | |
| 204 | - } | |
| 205 | - } | |
| 206 | - | |
| 207 | - .info-text { | |
| 208 | - font-size: 26rpx; | |
| 209 | - font-weight: bold; | |
| 210 | - color: #666666; | |
| 211 | - } | |
| 212 | - } | |
| 213 | - | |
| 214 | - .cart-btn-group { | |
| 215 | - @include flex-right(); | |
| 216 | - width: 360rpx; | |
| 217 | - padding-right: 10px; | |
| 218 | - | |
| 219 | - .btn-gap { | |
| 220 | - width: 20rpx; | |
| 221 | - } | |
| 222 | - } | |
| 223 | - } | |
| 224 | -} | |
| 225 | -</style> |
yudao-ui-app/pages/category/category.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <!-- 搜索框 --> | |
| 4 | - <view class="search-wrap"> | |
| 5 | - <u-search placeholder="搜索" disabled height="32" bgColor="#f2f2f2" margin="0 20rpx" :show-action="false" | |
| 6 | - @click="handleSearchClick"></u-search> | |
| 7 | - </view> | |
| 8 | - | |
| 9 | - <!-- 分类内容 --> | |
| 10 | - <view class="category-box"> | |
| 11 | - <!-- 左侧导航栏 --> | |
| 12 | - <scroll-view scroll-y="true" class='box-left'> | |
| 13 | - <view class="category-item" v-for="(item, index) in categoryList" :key="item.id"> | |
| 14 | - <view class="item-title" :class="{ active: currentIndex === index }" @click="handleCategoryClick(index)"> | |
| 15 | - <text>{{ item.name }}</text> | |
| 16 | - </view> | |
| 17 | - </view> | |
| 18 | - </scroll-view> | |
| 19 | - | |
| 20 | - <!-- 右侧分类内容 --> | |
| 21 | - <scroll-view scroll-y="true" class="box-right"> | |
| 22 | - <view class="category-image"> | |
| 23 | - <image :showLoading="true" :src="categoryList[currentIndex].picUrl" mode='widthFix' @click="click"></image> | |
| 24 | - </view> | |
| 25 | - | |
| 26 | - <view class="sub-category-box" v-for="(item, index) in categoryList[currentIndex].children" :key="item.id"> | |
| 27 | - <view class="sub-category-header"> | |
| 28 | - <view class="title">{{ item.name }}</view> | |
| 29 | - <view class="more" @click="handleCategory(item, 0)">查看更多</view> | |
| 30 | - </view> | |
| 31 | - | |
| 32 | - <view class="sub-category-grid"> | |
| 33 | - <u-grid col="3"> | |
| 34 | - <u-grid-item v-for="(subItem, subIndex) in item.children" :key="subItem.id"> | |
| 35 | - <view class="sub-category-item" @click="handleCategory(item, subIndex)"> | |
| 36 | - <u-icon name="photo" :size="80" v-if="subItem.picUrl === null"></u-icon> | |
| 37 | - <image :src="subItem.picUrl" v-if="subItem.picUrl != null" mode='widthFix' /> | |
| 38 | - <text class="sub-category-title">{{ subItem.name }}</text> | |
| 39 | - </view> | |
| 40 | - </u-grid-item> | |
| 41 | - </u-grid> | |
| 42 | - </view> | |
| 43 | - </view> | |
| 44 | - </scroll-view> | |
| 45 | - </view> | |
| 46 | - </view> | |
| 47 | -</template> | |
| 48 | - | |
| 49 | -<script> | |
| 50 | - import { categoryListData } from '../../api/category'; | |
| 51 | - import { handleTree, convertTree } from '../../utils/tree.js'; | |
| 52 | - | |
| 53 | - export default { | |
| 54 | - data() { | |
| 55 | - return { | |
| 56 | - currentIndex: 0, | |
| 57 | - categoryList: [] | |
| 58 | - } | |
| 59 | - }, | |
| 60 | - onLoad() { | |
| 61 | - this.handleCategoryList(); | |
| 62 | - }, | |
| 63 | - methods: { | |
| 64 | - // 点击搜索框 | |
| 65 | - handleSearchClick(e) { | |
| 66 | - uni.$u.route('/pages/search/search') | |
| 67 | - }, | |
| 68 | - // 点击左侧导航栏 | |
| 69 | - handleCategoryClick(index) { | |
| 70 | - if (this.currentIndex !== index) { | |
| 71 | - this.currentIndex = index | |
| 72 | - } | |
| 73 | - }, | |
| 74 | - // 获取分类列表并构建树形结构 | |
| 75 | - handleCategoryList() { | |
| 76 | - categoryListData().then(res => { | |
| 77 | - this.categoryList = handleTree(res.data, "id", "parentId"); | |
| 78 | - }) | |
| 79 | - }, | |
| 80 | - handleCategory(item, index){ | |
| 81 | - // console.log(item) | |
| 82 | - // console.log(index) | |
| 83 | - uni.navigateTo({ | |
| 84 | - url:"./product-list?item="+encodeURIComponent(JSON.stringify(item))+"&index="+index | |
| 85 | - }) | |
| 86 | - } | |
| 87 | - } | |
| 88 | - } | |
| 89 | -</script> | |
| 90 | - | |
| 91 | -<style lang="scss" scoped> | |
| 92 | - .search-wrap { | |
| 93 | - background: #ffffff; | |
| 94 | - position: fixed; | |
| 95 | - top: 0; | |
| 96 | - left: 0; | |
| 97 | - box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.07); | |
| 98 | - padding: 20rpx 0; | |
| 99 | - width: 100%; | |
| 100 | - z-index: 3; | |
| 101 | - } | |
| 102 | - | |
| 103 | - .category-box { | |
| 104 | - position: fixed; | |
| 105 | - display: flex; | |
| 106 | - overflow: hidden; | |
| 107 | - margin-top: 100rpx; | |
| 108 | - height: calc(100% - 100rpx); | |
| 109 | - | |
| 110 | - .box-left { | |
| 111 | - width: 200rpx; | |
| 112 | - padding-top: 5rpx; | |
| 113 | - overflow: scroll; | |
| 114 | - z-index: 2; | |
| 115 | - background-color: #f2f2f2; | |
| 116 | - | |
| 117 | - .category-item { | |
| 118 | - line-height: 80rpx; | |
| 119 | - height: 80rpx; | |
| 120 | - text-align: center; | |
| 121 | - color: #777; | |
| 122 | - | |
| 123 | - .item-title { | |
| 124 | - font-size: 28rpx; | |
| 125 | - | |
| 126 | - &.active { | |
| 127 | - font-size: 28rpx; | |
| 128 | - font-weight: bold; | |
| 129 | - position: relative; | |
| 130 | - background: #fff; | |
| 131 | - color: $u-primary; | |
| 132 | - } | |
| 133 | - | |
| 134 | - &.active::before { | |
| 135 | - position: absolute; | |
| 136 | - left: 0; | |
| 137 | - content: ""; | |
| 138 | - width: 8rpx; | |
| 139 | - height: 32rpx; | |
| 140 | - top: 25rpx; | |
| 141 | - background: $u-primary; | |
| 142 | - } | |
| 143 | - } | |
| 144 | - } | |
| 145 | - } | |
| 146 | - | |
| 147 | - .box-right { | |
| 148 | - width: 550rpx; | |
| 149 | - height: 100%; | |
| 150 | - box-sizing: border-box; | |
| 151 | - z-index: 1; | |
| 152 | - | |
| 153 | - .category-image { | |
| 154 | - width: 510rpx; | |
| 155 | - box-sizing: border-box; | |
| 156 | - overflow: hidden; | |
| 157 | - position: relative; | |
| 158 | - margin: 30rpx 20rpx 0; | |
| 159 | - | |
| 160 | - image { | |
| 161 | - width: 100%; | |
| 162 | - } | |
| 163 | - } | |
| 164 | - | |
| 165 | - .sub-category-box { | |
| 166 | - .sub-category-header { | |
| 167 | - @include flex-space-between; | |
| 168 | - padding: 20rpx 20rpx; | |
| 169 | - | |
| 170 | - .title { | |
| 171 | - font-size: 28rpx; | |
| 172 | - font-weight: bolder; | |
| 173 | - } | |
| 174 | - | |
| 175 | - .more { | |
| 176 | - font-size: 22rpx; | |
| 177 | - color: #939393; | |
| 178 | - } | |
| 179 | - } | |
| 180 | - | |
| 181 | - .sub-category-grid { | |
| 182 | - padding: 0 15rpx; | |
| 183 | - | |
| 184 | - .sub-category-item { | |
| 185 | - @include flex-center(column); | |
| 186 | - background: #fff; | |
| 187 | - | |
| 188 | - image { | |
| 189 | - text-align: center; | |
| 190 | - width: 150rpx; | |
| 191 | - height: 150rpx; | |
| 192 | - line-height: 150rpx; | |
| 193 | - font-size: 0; | |
| 194 | - } | |
| 195 | - | |
| 196 | - .sub-category-title { | |
| 197 | - margin: 15rpx 0; | |
| 198 | - font-size: 22rpx; | |
| 199 | - } | |
| 200 | - } | |
| 201 | - } | |
| 202 | - } | |
| 203 | - } | |
| 204 | - } | |
| 205 | -</style> |
yudao-ui-app/pages/category/product-list.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <u-navbar :title="title" :autoBack="true" placeholder="true" titleStyle="font-size: 28rpx"> | |
| 4 | - </u-navbar> | |
| 5 | - <view class="context"> | |
| 6 | - <!-- 分类列表 --> | |
| 7 | - <!-- TODO @Luowenfeng:不应该展示商品分类;应该是上面一个筛选;之后是【综合】【销量】【价格】的排序 --> | |
| 8 | - <view class="tabs-top"> | |
| 9 | - <u-tabs :list="categoryList" @click="changeTabs" :current="current" lineHeight="2" lineWidth="85rpx" | |
| 10 | - itemStyle="padding-left: 15px; padding-right: 15px; height: 85rpx;"></u-tabs> | |
| 11 | - </view> | |
| 12 | - <!-- 商品列表 --> | |
| 13 | - <scroll-view scroll-y="true" class="product-list" enable-flex="true"> | |
| 14 | - <view class="flex-box"> | |
| 15 | - <block v-for="(item, index) in productList[current]" :key="index"> | |
| 16 | - <view class="product-item"> | |
| 17 | - <view class="product-image"> | |
| 18 | - <image :src="item.picUrls[0]" mode='widthFix' /> | |
| 19 | - </view> | |
| 20 | - <view class="product-button"> | |
| 21 | - <view class="product-text">{{ item.name }}</view> | |
| 22 | - <view class="product-price-button"> | |
| 23 | - <text class="product-price">¥ | |
| 24 | - <text class="price-size">{{ towNumber(item.minPrice) }}</text></text> | |
| 25 | - <text class="product-like-count">销量 {{ item.salesCount }}</text> | |
| 26 | - </view> | |
| 27 | - </view> | |
| 28 | - </view> | |
| 29 | - </block> | |
| 30 | - </view> | |
| 31 | - </scroll-view> | |
| 32 | - </view> | |
| 33 | - </view> | |
| 34 | -</template> | |
| 35 | - | |
| 36 | -<script> | |
| 37 | - import { | |
| 38 | - productSpuPage | |
| 39 | - } from '../../api/product'; | |
| 40 | - | |
| 41 | - export default { | |
| 42 | - data() { | |
| 43 | - return { | |
| 44 | - title: "", | |
| 45 | - current: 0, | |
| 46 | - categoryList: [], | |
| 47 | - productList: {} | |
| 48 | - } | |
| 49 | - }, | |
| 50 | - onLoad(option) { | |
| 51 | - const item = JSON.parse(decodeURIComponent(option.item)) | |
| 52 | - this.title = item.name | |
| 53 | - this.categoryList = item.children | |
| 54 | - this.handleProductSpu(option.index); | |
| 55 | - }, | |
| 56 | - methods: { | |
| 57 | - changeTabs(item) { | |
| 58 | - if (item.index !== this.current) { | |
| 59 | - this.handleProductSpu(item.index) | |
| 60 | - } | |
| 61 | - }, | |
| 62 | - handleProductSpu(index) { | |
| 63 | - let param = {} | |
| 64 | - param.categoryId = this.categoryList[index].id | |
| 65 | - console.log(this.categoryList) | |
| 66 | - console.log(index) | |
| 67 | - productSpuPage(param).then(res => { | |
| 68 | - this.productList[index] = res.data.list | |
| 69 | - this.current = index | |
| 70 | - }) | |
| 71 | - }, | |
| 72 | - towNumber(val) { | |
| 73 | - return (val / 100).toFixed(2) | |
| 74 | - } | |
| 75 | - } | |
| 76 | - } | |
| 77 | -</script> | |
| 78 | - | |
| 79 | -<style lang="scss" scoped> | |
| 80 | - .context { | |
| 81 | - width: 100vw; | |
| 82 | - position: fixed; | |
| 83 | - top: 160rpx; | |
| 84 | - left: 0; | |
| 85 | - } | |
| 86 | - | |
| 87 | - .tabs-top { | |
| 88 | - position: relative; | |
| 89 | - top: 0; | |
| 90 | - width: 100%; | |
| 91 | - height: 85rpx; | |
| 92 | - } | |
| 93 | - | |
| 94 | - .product-list { | |
| 95 | - position: relative; | |
| 96 | - background-color: #f2f2f2; | |
| 97 | - height: calc(100vh - 88rpx - 100rpx - var(--status-bar-height)); | |
| 98 | - width: 100%; | |
| 99 | - | |
| 100 | - .flex-box { | |
| 101 | - width: 730rpx; | |
| 102 | - margin: 0 auto; | |
| 103 | - @include flex; | |
| 104 | - flex-wrap: wrap; | |
| 105 | - justify-content: left; | |
| 106 | - | |
| 107 | - .product-item { | |
| 108 | - width: 345rpx; | |
| 109 | - height: 450rpx; | |
| 110 | - background-color: #ffffff; | |
| 111 | - margin: 20rpx 10rpx 0; | |
| 112 | - border-radius: 20rpx; | |
| 113 | - | |
| 114 | - .product-image { | |
| 115 | - width: 100%; | |
| 116 | - height: 300rpx; | |
| 117 | - overflow: hidden; | |
| 118 | - border-radius: 20rpx; | |
| 119 | - image { | |
| 120 | - width: 100%; | |
| 121 | - } | |
| 122 | - } | |
| 123 | - | |
| 124 | - .product-button { | |
| 125 | - width: 330rpx; | |
| 126 | - margin: 15rpx auto 0; | |
| 127 | - | |
| 128 | - .product-text { | |
| 129 | - font-size: 25rpx; | |
| 130 | - height: 70rpx; | |
| 131 | - overflow: hidden; | |
| 132 | - -webkit-line-clamp: 2; | |
| 133 | - text-overflow: ellipsis; | |
| 134 | - display: -webkit-box; | |
| 135 | - -webkit-box-orient: vertical; | |
| 136 | - } | |
| 137 | - | |
| 138 | - .product-price-button { | |
| 139 | - font-size: 20rpx; | |
| 140 | - margin-top: 20rpx; | |
| 141 | - | |
| 142 | - .product-price { | |
| 143 | - color: red; | |
| 144 | - | |
| 145 | - .price-size { | |
| 146 | - font-size: 26rpx; | |
| 147 | - } | |
| 148 | - } | |
| 149 | - | |
| 150 | - .product-like-count { | |
| 151 | - font-size: 16rpx; | |
| 152 | - margin-left: 10rpx; | |
| 153 | - } | |
| 154 | - } | |
| 155 | - | |
| 156 | - } | |
| 157 | - } | |
| 158 | - | |
| 159 | - } | |
| 160 | - | |
| 161 | - // } | |
| 162 | - | |
| 163 | - } | |
| 164 | -</style> |
yudao-ui-app/pages/checkout/checkout.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <!-- 收货地址选择 --> | |
| 4 | - <yd-address-select :address="address"></yd-address-select> | |
| 5 | - | |
| 6 | - <!-- 订单商品信息 --> | |
| 7 | - <view class="checkout-goods"> | |
| 8 | - <yd-order-goods :goods-list="checkoutList"></yd-order-goods> | |
| 9 | - </view> | |
| 10 | - | |
| 11 | - <view class="freight-coupon-box"> | |
| 12 | - <vidw class="box-row"> | |
| 13 | - <view class="title">运费</view> | |
| 14 | - <yd-text-price class="freight-fee" size="15" :price="freightAmount"></yd-text-price> | |
| 15 | - </vidw> | |
| 16 | - <vidw class="box-row"> | |
| 17 | - <view class="coupon-wrap"> | |
| 18 | - <view class="coupon-title-tag"> | |
| 19 | - <view class="title">优惠券</view> | |
| 20 | - <scroll-view class="coupon-tag-list" scroll-x="true"> | |
| 21 | - <view v-for="item in couponList" :key="item.couponId" class="coupon-tag-item">{{ item.couponTag }}</view> | |
| 22 | - </scroll-view> | |
| 23 | - </view> | |
| 24 | - <yd-text-price class="coupon-fee" color="red" size="15" symbol="-¥" :price="couponAmount"></yd-text-price> | |
| 25 | - </view> | |
| 26 | - <u-icon name="arrow-right"></u-icon> | |
| 27 | - </vidw> | |
| 28 | - </view> | |
| 29 | - | |
| 30 | - <!-- 订单备注信息 --> | |
| 31 | - <view class="user-remark-box"> | |
| 32 | - <view class="title">订单备注</view> | |
| 33 | - <u--input maxlength="50" border="none" fontSize="14" v-model="remark" placeholder="如您需要请备注"></u--input> | |
| 34 | - </view> | |
| 35 | - | |
| 36 | - <view class="cart-btn-container"> | |
| 37 | - <view class="order-total-wrap"> | |
| 38 | - <view class="order-total-info"> | |
| 39 | - <view class="info-text">合计:</view> | |
| 40 | - <view> | |
| 41 | - <yd-text-price color="red" size="15" intSize="20" :price="totalAmount"></yd-text-price> | |
| 42 | - </view> | |
| 43 | - </view> | |
| 44 | - | |
| 45 | - <view class="cart-btn-group"> | |
| 46 | - <u-button style="margin-left: 10px" class="main-btn" type="primary" shape="circle" size="small" text="提交订单" @click="handleSubmitOrder"></u-button> | |
| 47 | - </view> | |
| 48 | - </view> | |
| 49 | - <u-safe-bottom customStyle="background: #ffffff"></u-safe-bottom> | |
| 50 | - </view> | |
| 51 | - </view> | |
| 52 | -</template> | |
| 53 | - | |
| 54 | -<script> | |
| 55 | -import { checkoutCartProduct } from '../../api/order' | |
| 56 | - | |
| 57 | -export default { | |
| 58 | - components: {}, | |
| 59 | - data() { | |
| 60 | - return { | |
| 61 | - checkedProduct: [], | |
| 62 | - address: { | |
| 63 | - name: '客户', | |
| 64 | - mobile: '139****6563', | |
| 65 | - area: 'XXX市XXX区', | |
| 66 | - detail: 'XXX街道XXX小区XXX号楼XX-XXX' | |
| 67 | - }, | |
| 68 | - checkoutList: [], | |
| 69 | - couponList: [ | |
| 70 | - { | |
| 71 | - couponId: 3, | |
| 72 | - couponTag: '6元运费券' | |
| 73 | - } | |
| 74 | - ], | |
| 75 | - totalAmount: 0, | |
| 76 | - freightAmount: 6, | |
| 77 | - couponAmount: 6, | |
| 78 | - remark: '' | |
| 79 | - } | |
| 80 | - }, | |
| 81 | - onLoad(e) { | |
| 82 | - const checkedProduct = e.checkedProduct | |
| 83 | - if (checkedProduct) { | |
| 84 | - this.checkedProduct = JSON.parse(checkedProduct) | |
| 85 | - this.loadCheckoutProductData() | |
| 86 | - } else { | |
| 87 | - uni.$u.toast('请求参数错误') | |
| 88 | - } | |
| 89 | - }, | |
| 90 | - methods: { | |
| 91 | - loadCheckoutProductData() { | |
| 92 | - checkoutCartProduct(this.checkedProduct) | |
| 93 | - .then(res => { | |
| 94 | - this.checkoutList = res.data.checkoutList || [] | |
| 95 | - this.totalAmount = res.data.totalAmount || 0 | |
| 96 | - }) | |
| 97 | - .catch(err => { | |
| 98 | - console.log(err) | |
| 99 | - }) | |
| 100 | - } | |
| 101 | - } | |
| 102 | -} | |
| 103 | -</script> | |
| 104 | - | |
| 105 | -<style lang="scss" scoped> | |
| 106 | -.container { | |
| 107 | - background-color: $custom-bg-color; | |
| 108 | - height: 100vh; | |
| 109 | - overflow-x: scroll; | |
| 110 | -} | |
| 111 | - | |
| 112 | -.checkout-goods { | |
| 113 | - background-color: #fff; | |
| 114 | - margin-top: 20rpx; | |
| 115 | - padding: 20rpx; | |
| 116 | - border-radius: 20rpx; | |
| 117 | -} | |
| 118 | - | |
| 119 | -.freight-coupon-box { | |
| 120 | - background-color: #fff; | |
| 121 | - margin-top: 20rpx; | |
| 122 | - padding: 20rpx 30rpx; | |
| 123 | - border-radius: 20rpx; | |
| 124 | - | |
| 125 | - .box-row { | |
| 126 | - @include flex-space-between; | |
| 127 | - padding: 10rpx 0; | |
| 128 | - | |
| 129 | - .coupon-wrap { | |
| 130 | - @include flex-space-between; | |
| 131 | - width: 670rpx; | |
| 132 | - | |
| 133 | - .coupon-title-tag { | |
| 134 | - @include flex-left; | |
| 135 | - | |
| 136 | - .coupon-tag-list { | |
| 137 | - @include flex-left; | |
| 138 | - overflow-x: scroll; | |
| 139 | - width: 360rpx; | |
| 140 | - .coupon-tag-item { | |
| 141 | - display: inline-block; | |
| 142 | - font-size: 22rpx; | |
| 143 | - color: red; | |
| 144 | - border: 1rpx solid red; | |
| 145 | - padding: 1px 6rpx; | |
| 146 | - margin-right: 10rpx; | |
| 147 | - border-radius: 5rpx; | |
| 148 | - } | |
| 149 | - } | |
| 150 | - } | |
| 151 | - } | |
| 152 | - | |
| 153 | - .title { | |
| 154 | - font-weight: 700; | |
| 155 | - font-size: 30rpx; | |
| 156 | - color: #333; | |
| 157 | - margin-right: 30rpx; | |
| 158 | - } | |
| 159 | - | |
| 160 | - .freight-fee { | |
| 161 | - margin-right: 50rpx; | |
| 162 | - } | |
| 163 | - | |
| 164 | - .coupon-fee { | |
| 165 | - margin-right: 20rpx; | |
| 166 | - } | |
| 167 | - } | |
| 168 | -} | |
| 169 | - | |
| 170 | -.user-remark-box { | |
| 171 | - @include flex-space-between; | |
| 172 | - background-color: #fff; | |
| 173 | - margin-top: 20rpx; | |
| 174 | - padding: 30rpx; | |
| 175 | - border-radius: 20rpx; | |
| 176 | - | |
| 177 | - .title { | |
| 178 | - font-weight: 700; | |
| 179 | - font-size: 30rpx; | |
| 180 | - color: #333; | |
| 181 | - margin-right: 30rpx; | |
| 182 | - } | |
| 183 | -} | |
| 184 | - | |
| 185 | -.cart-btn-container { | |
| 186 | - position: fixed; | |
| 187 | - bottom: 0; | |
| 188 | - left: 0; | |
| 189 | - | |
| 190 | - .order-total-wrap { | |
| 191 | - background: $custom-bg-color; | |
| 192 | - border-top: $custom-border-style; | |
| 193 | - | |
| 194 | - width: 750rpx; | |
| 195 | - @include flex-space-between(); | |
| 196 | - height: 100rpx; | |
| 197 | - | |
| 198 | - .order-total-info { | |
| 199 | - @include flex-left; | |
| 200 | - .info-text { | |
| 201 | - margin-left: 20rpx; | |
| 202 | - font-size: 26rpx; | |
| 203 | - font-weight: bold; | |
| 204 | - color: #666666; | |
| 205 | - } | |
| 206 | - } | |
| 207 | - | |
| 208 | - .cart-btn-group { | |
| 209 | - @include flex-right(); | |
| 210 | - width: 360rpx; | |
| 211 | - padding-right: 10px; | |
| 212 | - | |
| 213 | - .btn-gap { | |
| 214 | - width: 20rpx; | |
| 215 | - } | |
| 216 | - } | |
| 217 | - } | |
| 218 | -} | |
| 219 | -</style> |
yudao-ui-app/pages/forgot/forgot.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="unp-header"> | |
| 4 | - <view class="unp-logo"> | |
| 5 | - <u-avatar size="80" icon="github-circle-fill" fontSize="80"></u-avatar> | |
| 6 | - </view> | |
| 7 | - </view> | |
| 8 | - | |
| 9 | - <view class="unp-box"> | |
| 10 | - <u--form class="unp-form" labelPosition="left" :model="formData" :rules="rules" ref="form"> | |
| 11 | - <u-form-item label="账号" prop="username" borderBottom ref="item-username"> | |
| 12 | - <u-input type="text" maxlength="20" v-model="formData.username" clearable placeholder="账号由数字和字母组成" border="none" @change="handleUsernameChange"></u-input> | |
| 13 | - </u-form-item> | |
| 14 | - | |
| 15 | - <u-gap height="20"></u-gap> | |
| 16 | - | |
| 17 | - <u-form-item label="验证码" prop="code" labelWidth="80" borderBottom> | |
| 18 | - <u--input type="number" maxlength="6" v-model="formData.code" border="none" placeholder="请填写验证码"></u--input> | |
| 19 | - <u-button slot="right" @tap="getCode" :text="tips" type="success" size="mini" :disabled="codeDisabled"></u-button> | |
| 20 | - <u-code ref="uCode" @change="codeChange" seconds="60" @start="codeDisabled = true" @end="codeDisabled = false"></u-code> | |
| 21 | - </u-form-item> | |
| 22 | - | |
| 23 | - <u-gap height="20"></u-gap> | |
| 24 | - | |
| 25 | - <u-form-item label="密码" prop="password" borderBottom ref="item-password"> | |
| 26 | - <u-input :type="inputType" maxlength="20" v-model="formData.password" placeholder="新密码由数字、字母和符号组成" border="none" @change="handlePasswordChange"> | |
| 27 | - <template slot="suffix"> | |
| 28 | - <u-icon v-if="inputType === 'password'" size="20" color="#666666" name="eye-fill" @click="inputType = 'text'"></u-icon> | |
| 29 | - <u-icon v-if="inputType === 'text'" size="20" color="#666666" name="eye-off" @click="inputType = 'password'"></u-icon> | |
| 30 | - </template> | |
| 31 | - </u-input> | |
| 32 | - </u-form-item> | |
| 33 | - | |
| 34 | - <view class="lk-group"> | |
| 35 | - <!-- 占位 --> | |
| 36 | - </view> | |
| 37 | - | |
| 38 | - <u-button type="error" text="重置密码" customStyle="margin-top: 50px" @click="handleSubmit"></u-button> | |
| 39 | - | |
| 40 | - <u-gap height="20"></u-gap> | |
| 41 | - <u-button type="info" text="返回" @click="navigateBack()"></u-button> | |
| 42 | - </u--form> | |
| 43 | - </view> | |
| 44 | - </view> | |
| 45 | -</template> | |
| 46 | - | |
| 47 | -<script> | |
| 48 | -export default { | |
| 49 | - data() { | |
| 50 | - return { | |
| 51 | - codeDisabled: false, | |
| 52 | - tips: '', | |
| 53 | - inputType: 'password', | |
| 54 | - formData: { | |
| 55 | - username: '', | |
| 56 | - code: '', | |
| 57 | - password: '' | |
| 58 | - }, | |
| 59 | - rules: { | |
| 60 | - username: { | |
| 61 | - type: 'string', | |
| 62 | - max: 20, | |
| 63 | - required: true, | |
| 64 | - message: '请输入您的账号', | |
| 65 | - trigger: ['blur', 'change'] | |
| 66 | - }, | |
| 67 | - code: { | |
| 68 | - type: 'number', | |
| 69 | - max: 6, | |
| 70 | - required: true, | |
| 71 | - message: '请输入验证码', | |
| 72 | - trigger: ['blur', 'change'] | |
| 73 | - }, | |
| 74 | - password: { | |
| 75 | - type: 'string', | |
| 76 | - max: 20, | |
| 77 | - required: true, | |
| 78 | - message: '请输入您的新密码', | |
| 79 | - trigger: ['blur', 'change'] | |
| 80 | - } | |
| 81 | - } | |
| 82 | - } | |
| 83 | - }, | |
| 84 | - onLoad() {}, | |
| 85 | - methods: { | |
| 86 | - handleUsernameChange(e) { | |
| 87 | - let str = uni.$u.trim(e, 'all') | |
| 88 | - this.$nextTick(() => { | |
| 89 | - this.formData.username = str | |
| 90 | - }) | |
| 91 | - }, | |
| 92 | - handlePasswordChange(e) { | |
| 93 | - let str = uni.$u.trim(e, 'all') | |
| 94 | - this.$nextTick(() => { | |
| 95 | - this.formData.password = str | |
| 96 | - }) | |
| 97 | - }, | |
| 98 | - codeChange(text) { | |
| 99 | - this.tips = text | |
| 100 | - }, | |
| 101 | - getCode() { | |
| 102 | - if (this.$refs.uCode.canGetCode) { | |
| 103 | - // 模拟向后端请求验证码 | |
| 104 | - uni.showLoading({ | |
| 105 | - title: '正在获取验证码' | |
| 106 | - }) | |
| 107 | - setTimeout(() => { | |
| 108 | - uni.hideLoading() | |
| 109 | - // 这里此提示会被this.start()方法中的提示覆盖 | |
| 110 | - uni.$u.toast('验证码已发送') | |
| 111 | - // 通知验证码组件内部开始倒计时 | |
| 112 | - this.$refs.uCode.start() | |
| 113 | - }, 2000) | |
| 114 | - } else { | |
| 115 | - uni.$u.toast('倒计时结束后再发送') | |
| 116 | - } | |
| 117 | - }, | |
| 118 | - handleSubmit() { | |
| 119 | - this.$refs.form | |
| 120 | - .validate() | |
| 121 | - .then(res => { | |
| 122 | - uni.$u.toast('点击了重置密码') | |
| 123 | - }) | |
| 124 | - }, | |
| 125 | - navigateBack() { | |
| 126 | - uni.navigateBack() | |
| 127 | - } | |
| 128 | - } | |
| 129 | -} | |
| 130 | -</script> | |
| 131 | - | |
| 132 | -<style lang="scss" scoped> | |
| 133 | -.unp-header { | |
| 134 | - height: 400rpx; | |
| 135 | - @include flex-center; | |
| 136 | - .unp-logo { | |
| 137 | - @include flex-center; | |
| 138 | - } | |
| 139 | -} | |
| 140 | - | |
| 141 | -.unp-box { | |
| 142 | - @include flex-center(column); | |
| 143 | - .unp-form { | |
| 144 | - width: 560rpx; | |
| 145 | - } | |
| 146 | -} | |
| 147 | - | |
| 148 | -.lk-group { | |
| 149 | - height: 40rpx; | |
| 150 | - margin-top: 40rpx; | |
| 151 | - @include flex-space-between; | |
| 152 | - font-size: 12rpx; | |
| 153 | - | |
| 154 | - color: $u-primary; | |
| 155 | - text-decoration: $u-primary; | |
| 156 | -} | |
| 157 | -</style> |
yudao-ui-app/pages/index/index.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <!--搜索栏--> | |
| 4 | - <u-sticky style="top: 0" offset-top="0"> | |
| 5 | - <view class="search-wrap"> | |
| 6 | - <u-search placeholder="搜索" disabled height="32" :show-action="false" @click="handleSearchClick"></u-search> | |
| 7 | - </view> | |
| 8 | - </u-sticky> | |
| 9 | - | |
| 10 | - <!--轮播图--> | |
| 11 | - <yd-banner :banner-list="bannerList"></yd-banner> | |
| 12 | - | |
| 13 | - <u-gap height="20px"></u-gap> | |
| 14 | - | |
| 15 | - <!--宫格菜单按钮--> | |
| 16 | - <u-grid :border="false" col="4"> | |
| 17 | - <u-grid-item v-for="(item, index) in menuList" :key="index"> | |
| 18 | - <u-icon :name="item.icon" :size="40"></u-icon> | |
| 19 | - <text class="grid-title">{{ item.title }}</text> | |
| 20 | - </u-grid-item> | |
| 21 | - </u-grid> | |
| 22 | - | |
| 23 | - <u-gap height="15px"></u-gap> | |
| 24 | - | |
| 25 | - <!--消息滚动栏--> | |
| 26 | - <u-notice-bar style="padding: 13px 12px" :text="noticeList" mode="link" direction="column" @click="click"></u-notice-bar> | |
| 27 | - | |
| 28 | - <!--商品展示栏--> | |
| 29 | - <yd-product-box :product-list="productList" :title="'每日上新'" show-type="normal"></yd-product-box> | |
| 30 | - <yd-product-box :product-list="productList" :title="'热卖商品'" show-type="half"></yd-product-box> | |
| 31 | - <yd-product-more :product-list="productList" :more-status="moreStatus"></yd-product-more> | |
| 32 | - | |
| 33 | - <u-gap height="5px"></u-gap> | |
| 34 | - </view> | |
| 35 | -</template> | |
| 36 | - | |
| 37 | -<script> | |
| 38 | -import { getBannerData, getNoticeData } from '../../api/index' | |
| 39 | - | |
| 40 | -export default { | |
| 41 | - components: {}, | |
| 42 | - data() { | |
| 43 | - return { | |
| 44 | - bannerList: [ | |
| 45 | - { | |
| 46 | - id: 1, | |
| 47 | - title: '山不在高,有仙则名', | |
| 48 | - url: 'https://cdn.uviewui.com/uview/swiper/swiper1.png' | |
| 49 | - }, | |
| 50 | - { | |
| 51 | - id: 2, | |
| 52 | - title: '水不在深,有龙则灵', | |
| 53 | - url: 'https://cdn.uviewui.com/uview/swiper/swiper2.png' | |
| 54 | - }, | |
| 55 | - { | |
| 56 | - id: 3, | |
| 57 | - title: '斯是陋室,惟吾德馨', | |
| 58 | - url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png' | |
| 59 | - } | |
| 60 | - ], | |
| 61 | - menuList: [ | |
| 62 | - { icon: 'gift', title: '热门推荐' }, | |
| 63 | - { icon: 'star', title: '收藏转发' }, | |
| 64 | - { icon: 'thumb-up', title: '点赞投币' }, | |
| 65 | - { icon: 'heart', title: '感谢支持' } | |
| 66 | - ], | |
| 67 | - noticeList: ['寒雨连江夜入吴', '平明送客楚山孤', '洛阳亲友如相问', '一片冰心在玉壶'], | |
| 68 | - productList: [ | |
| 69 | - { | |
| 70 | - id: 1, | |
| 71 | - image: 'https://cdn.uviewui.com/uview/album/1.jpg', | |
| 72 | - title: '山不在高,有仙则名。水不在深,有龙则灵。斯是陋室,惟吾德馨。', | |
| 73 | - desc: '山不在于高,有了神仙就会有名气。水不在于深,有了龙就会有灵气。这是简陋的房子,只是我品德好就感觉不到简陋了。', | |
| 74 | - price: '13.00' | |
| 75 | - }, | |
| 76 | - { | |
| 77 | - id: 2, | |
| 78 | - image: 'https://cdn.uviewui.com/uview/album/2.jpg', | |
| 79 | - title: '商品222', | |
| 80 | - desc: '', | |
| 81 | - price: '23.00' | |
| 82 | - }, | |
| 83 | - { | |
| 84 | - id: 3, | |
| 85 | - image: 'https://cdn.uviewui.com/uview/album/3.jpg', | |
| 86 | - title: '商品333', | |
| 87 | - desc: '商品描述信息2', | |
| 88 | - price: '33.00' | |
| 89 | - }, | |
| 90 | - { | |
| 91 | - id: 4, | |
| 92 | - image: 'https://cdn.uviewui.com/uview/album/4.jpg', | |
| 93 | - title: '商品444', | |
| 94 | - desc: '商品描述信息4', | |
| 95 | - price: '43.00' | |
| 96 | - }, | |
| 97 | - { | |
| 98 | - id: 5, | |
| 99 | - image: 'https://cdn.uviewui.com/uview/album/5.jpg', | |
| 100 | - title: '商品555', | |
| 101 | - desc: '商品描述信息5', | |
| 102 | - price: '53.00' | |
| 103 | - } | |
| 104 | - ], | |
| 105 | - moreStatus: 'nomore' | |
| 106 | - } | |
| 107 | - }, | |
| 108 | - onLoad() { | |
| 109 | - this.loadBannerData() | |
| 110 | - this.loadNoticeData() | |
| 111 | - }, | |
| 112 | - methods: { | |
| 113 | - loadBannerData() { | |
| 114 | - getBannerData().then(res => { | |
| 115 | - this.bannerList = res.data | |
| 116 | - }) | |
| 117 | - }, | |
| 118 | - loadNoticeData() { | |
| 119 | - getNoticeData().then(res => { | |
| 120 | - this.noticeList = res.data | |
| 121 | - }) | |
| 122 | - }, | |
| 123 | - handleSearchClick(e) { | |
| 124 | - uni.$u.route('/pages/search/search') | |
| 125 | - } | |
| 126 | - }, | |
| 127 | - computed: { | |
| 128 | - noticeTextList() { | |
| 129 | - return this.noticeList.map(item => { | |
| 130 | - if (item.title) { | |
| 131 | - return item.title | |
| 132 | - } | |
| 133 | - }) | |
| 134 | - } | |
| 135 | - } | |
| 136 | -} | |
| 137 | -</script> | |
| 138 | - | |
| 139 | -<style lang="scss" scoped> | |
| 140 | -.search-wrap { | |
| 141 | - background: $custom-bg-color; | |
| 142 | - padding: 20rpx; | |
| 143 | -} | |
| 144 | - | |
| 145 | -.grid-title { | |
| 146 | - line-height: 50rpx; | |
| 147 | - font-size: 26rpx; | |
| 148 | -} | |
| 149 | -</style> |
yudao-ui-app/pages/login/mobile.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="auth-header"> | |
| 4 | - <view class="auth-logo"> | |
| 5 | - <u-avatar size="100" icon="github-circle-fill" fontSize="100"></u-avatar> | |
| 6 | - </view> | |
| 7 | - </view> | |
| 8 | - | |
| 9 | - <view class="auth-box"> | |
| 10 | - <!-- 登录方式选择 --> | |
| 11 | - <view class="mode-section"> | |
| 12 | - <u-subsection class="subsection" mode="subsection" fontSize="15" :list="loginModeList" :current="currentModeIndex" @change="handleModeChange"></u-subsection> | |
| 13 | - </view> | |
| 14 | - <u-gap height="40"></u-gap> | |
| 15 | - | |
| 16 | - <!-- 登录表单 --> | |
| 17 | - <u--form labelPosition="left" :model="formData" :rules="rules" ref="form"> | |
| 18 | - <u-form-item label="手机号" prop="mobile" labelWidth="60" borderBottom ref="item-mobile"> | |
| 19 | - <u-input type="number" maxlength="11" v-model="formData.mobile" clearable placeholder="请填写手机号" border="none"></u-input> | |
| 20 | - </u-form-item> | |
| 21 | - | |
| 22 | - <u-gap height="20"></u-gap> | |
| 23 | - | |
| 24 | - <u-form-item v-if="currentModeIndex === 0" label="密码" prop="password" labelWidth="60" borderBottom ref="item-password"> | |
| 25 | - <u-input :type="inputType" maxlength="16" v-model="formData.password" placeholder="请填写密码" border="none"> | |
| 26 | - <template slot="suffix"> | |
| 27 | - <u-icon v-if="inputType === 'password'" size="20" color="#666666" name="eye-fill" @click="inputType = 'text'"></u-icon> | |
| 28 | - <u-icon v-if="inputType === 'text'" size="20" color="#666666" name="eye-off" @click="inputType = 'password'"></u-icon> | |
| 29 | - </template> | |
| 30 | - </u-input> | |
| 31 | - </u-form-item> | |
| 32 | - | |
| 33 | - <u-form-item v-else label="验证码" prop="code" labelWidth="60" borderBottom> | |
| 34 | - <u--input type="number" maxlength="4" v-model="formData.code" border="none" placeholder="请填写验证码"></u--input> | |
| 35 | - <u-button slot="right" @tap="getCode" :text="codeTips" type="success" size="mini" :disabled="codeDisabled"></u-button> | |
| 36 | - <u-code ref="uCode" @change="codeChange" seconds="60" @start="codeDisabled = true" @end="codeDisabled = false"></u-code> | |
| 37 | - </u-form-item> | |
| 38 | - | |
| 39 | - <view class="btn-group"> | |
| 40 | - <u-button class="auth-btn" type="primary" customStyle="margin-top: 50px" @click="handleSubmit">立即登录</u-button> | |
| 41 | - </view> | |
| 42 | - </u--form> | |
| 43 | - </view> | |
| 44 | - </view> | |
| 45 | -</template> | |
| 46 | - | |
| 47 | -<script> | |
| 48 | -import { sendSmsCode } from '../../api/auth' | |
| 49 | - | |
| 50 | -export default { | |
| 51 | - data() { | |
| 52 | - return { | |
| 53 | - currentModeIndex: 0, | |
| 54 | - loginModeList: ['密码登录', '验证码登录'], | |
| 55 | - inputType: 'password', | |
| 56 | - codeDisabled: false, | |
| 57 | - codeTips: '', | |
| 58 | - formData: { | |
| 59 | - mobile: '', | |
| 60 | - password: '', | |
| 61 | - code: '' | |
| 62 | - }, | |
| 63 | - rules: { | |
| 64 | - mobile: [ | |
| 65 | - { | |
| 66 | - type: 'integer', | |
| 67 | - required: true, | |
| 68 | - message: '请填写手机号', | |
| 69 | - trigger: ['blur', 'change'] | |
| 70 | - }, | |
| 71 | - { | |
| 72 | - // 自定义验证函数,见上说明 | |
| 73 | - validator: (rule, value, callback) => { | |
| 74 | - // 上面有说,返回true表示校验通过,返回false表示不通过 | |
| 75 | - // uni.$u.test.mobile()就是返回true或者false的 | |
| 76 | - return uni.$u.test.mobile(value) | |
| 77 | - }, | |
| 78 | - message: '手机号码不正确', | |
| 79 | - // 触发器可以同时用blur和change | |
| 80 | - trigger: ['change', 'blur'] | |
| 81 | - } | |
| 82 | - ], | |
| 83 | - password: { | |
| 84 | - type: 'string', | |
| 85 | - min: 4, | |
| 86 | - max: 16, | |
| 87 | - required: true, | |
| 88 | - message: '密码长度4-16位密码', | |
| 89 | - trigger: ['blur', 'change'] | |
| 90 | - }, | |
| 91 | - code: { | |
| 92 | - type: 'integer', | |
| 93 | - len: 4, | |
| 94 | - required: true, | |
| 95 | - message: '请填写4位验证码', | |
| 96 | - trigger: ['blur', 'change'] | |
| 97 | - } | |
| 98 | - } | |
| 99 | - } | |
| 100 | - }, | |
| 101 | - onLoad() {}, | |
| 102 | - onReady() { | |
| 103 | - // 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则 | |
| 104 | - this.$refs.form.setRules(this.rules) | |
| 105 | - }, | |
| 106 | - methods: { | |
| 107 | - handleModeChange(index) { | |
| 108 | - if (index !== this.currentModeIndex) { | |
| 109 | - this.currentModeIndex = index | |
| 110 | - this.$refs.form.clearValidate() | |
| 111 | - } | |
| 112 | - }, | |
| 113 | - codeChange(text) { | |
| 114 | - this.codeTips = text | |
| 115 | - }, | |
| 116 | - getCode() { | |
| 117 | - const mobile = this.formData.mobile | |
| 118 | - if (!mobile) { | |
| 119 | - uni.$u.toast('请填写手机号') | |
| 120 | - } else if (!uni.$u.test.mobile(mobile)) { | |
| 121 | - uni.$u.toast('手机号格式不正确') | |
| 122 | - } else if (this.$refs.uCode.canGetCode) { | |
| 123 | - // 模拟向后端请求验证码 | |
| 124 | - uni.showLoading({ | |
| 125 | - title: '正在获取验证码' | |
| 126 | - }) | |
| 127 | - | |
| 128 | - //scene:1登陆获取验证码场景 | |
| 129 | - sendSmsCode({ mobile: mobile, scene: 1 }).then(res => { | |
| 130 | - //console.log(res) | |
| 131 | - uni.hideLoading() | |
| 132 | - uni.$u.toast('验证码已发送') | |
| 133 | - // 通知验证码组件内部开始倒计时 | |
| 134 | - this.$refs.uCode.start() | |
| 135 | - }) | |
| 136 | - } else { | |
| 137 | - uni.$u.toast('倒计时结束后再发送') | |
| 138 | - } | |
| 139 | - }, | |
| 140 | - handleSubmit() { | |
| 141 | - this.$refs.form.validate().then(res => { | |
| 142 | - uni.login({ | |
| 143 | - provider: 'weixin', | |
| 144 | - success: res => { | |
| 145 | - let data = this.formData | |
| 146 | - data.socialType = 34 //WECHAT_MINI_APP 先指定固定值 | |
| 147 | - data.socialCode = res.code | |
| 148 | - data.socialState = Math.random() // 该参数没有实际意义暂时传随机数 | |
| 149 | - this.mobileLogin(data) | |
| 150 | - }, | |
| 151 | - fail: res => { | |
| 152 | - this.mobileLogin(this.formData) | |
| 153 | - } | |
| 154 | - }) | |
| 155 | - }) | |
| 156 | - }, | |
| 157 | - mobileLogin(data){ | |
| 158 | - this.$store.dispatch('Login', { type: this.currentModeIndex, data: data }).then(res => { | |
| 159 | - uni.$u.toast('登录成功') | |
| 160 | - setTimeout(() => { | |
| 161 | - uni.switchTab({ | |
| 162 | - url: '/pages/user/user' | |
| 163 | - }) | |
| 164 | - }, 300) | |
| 165 | - }) | |
| 166 | - } | |
| 167 | - } | |
| 168 | -} | |
| 169 | -</script> | |
| 170 | - | |
| 171 | -<style lang="scss" scoped> | |
| 172 | -.auth-header { | |
| 173 | - height: 400rpx; | |
| 174 | - @include flex-center; | |
| 175 | - .auth-logo { | |
| 176 | - @include flex-center(column); | |
| 177 | - } | |
| 178 | -} | |
| 179 | - | |
| 180 | -.auth-box { | |
| 181 | - @include flex-center(column); | |
| 182 | - | |
| 183 | - .mode-section { | |
| 184 | - width: 600rpx; | |
| 185 | - .subsection { | |
| 186 | - height: 60rpx; | |
| 187 | - } | |
| 188 | - } | |
| 189 | - .btn-group { | |
| 190 | - width: 600rpx; | |
| 191 | - .auth-btn { | |
| 192 | - height: 90rpx; | |
| 193 | - font-size: 32rpx; | |
| 194 | - } | |
| 195 | - } | |
| 196 | -} | |
| 197 | -</style> |
yudao-ui-app/pages/login/social.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="auth-header"> | |
| 4 | - <view class="auth-logo"> | |
| 5 | - <u-avatar size="100" icon="github-circle-fill" fontSize="100"></u-avatar> | |
| 6 | - </view> | |
| 7 | - </view> | |
| 8 | - | |
| 9 | - <view class="auth-box"> | |
| 10 | - <view class="btn-group"> | |
| 11 | - <!-- #ifdef MP-WEIXIN --> | |
| 12 | - <u-button class="auth-btn" open-type="getPhoneNumber" type="primary" @getphonenumber="getPhoneNumber">一键登录</u-button> | |
| 13 | - <navigator class="reg-login-link" url="/pages/login/mobile" open-type="navigate" hover-class="none">手机号登录/注册 ></navigator> | |
| 14 | - <!-- #endif --> | |
| 15 | - | |
| 16 | - <!-- #ifndef MP-WEIXIN --> | |
| 17 | - <u-button type="primary" text="手机号登录/注册" @click="handleJump"></u-button> | |
| 18 | - <!-- #endif --> | |
| 19 | - </view> | |
| 20 | - <view class="auth-footer"> | |
| 21 | - <view>登录即表示同意<text class="lk-text">《用户协议》</text> 和 <text class="lk-text">《隐私政策》</text></view> | |
| 22 | - </view> | |
| 23 | - </view> | |
| 24 | - </view> | |
| 25 | -</template> | |
| 26 | - | |
| 27 | -<script> | |
| 28 | -export default { | |
| 29 | - data() { | |
| 30 | - return {} | |
| 31 | - }, | |
| 32 | - onLoad() {}, | |
| 33 | - onReady() {}, | |
| 34 | - methods: { | |
| 35 | - getPhoneNumber(e) { | |
| 36 | - let phoneCode = e.detail.code | |
| 37 | - if (!e.detail.code) { | |
| 38 | - uni.showModal({ | |
| 39 | - title: '授权失败', | |
| 40 | - content: '您已拒绝获取绑定手机号登录授权,可以使用其他手机号验证登录', | |
| 41 | - cancelText: '知道了', | |
| 42 | - confirmText: '验证登录', | |
| 43 | - confirmColor: '#3C9CFFFF', | |
| 44 | - success: res => { | |
| 45 | - if (res.confirm) { | |
| 46 | - uni.$u.route('/pages/login/mobile') | |
| 47 | - } else if (res.cancel) { | |
| 48 | - //console.log('用户点击取消') | |
| 49 | - } | |
| 50 | - } | |
| 51 | - }) | |
| 52 | - } else { | |
| 53 | - uni.login({ | |
| 54 | - provider: 'weixin', | |
| 55 | - success: res => { | |
| 56 | - this.$store.dispatch('Login', { type: 2, data: { phoneCode: phoneCode, loginCode: res.code } }).then(res => { | |
| 57 | - uni.$u.toast('登录成功') | |
| 58 | - setTimeout(() => { | |
| 59 | - uni.switchTab({ | |
| 60 | - url: '/pages/user/user' | |
| 61 | - }) | |
| 62 | - }, 300) | |
| 63 | - }) | |
| 64 | - } | |
| 65 | - }) | |
| 66 | - } | |
| 67 | - }, | |
| 68 | - handleJump() { | |
| 69 | - uni.$u.route('/pages/login/mobile') | |
| 70 | - } | |
| 71 | - } | |
| 72 | -} | |
| 73 | -</script> | |
| 74 | - | |
| 75 | -<style lang="scss" scoped> | |
| 76 | -.container { | |
| 77 | - height: calc(100vh - 70px); | |
| 78 | - @include flex-space-between(column); | |
| 79 | -} | |
| 80 | - | |
| 81 | -.auth-header { | |
| 82 | - flex: 2; | |
| 83 | - @include flex-center; | |
| 84 | - .auth-logo { | |
| 85 | - @include flex-center(column); | |
| 86 | - } | |
| 87 | -} | |
| 88 | - | |
| 89 | -.auth-box { | |
| 90 | - @include flex-center(column); | |
| 91 | - | |
| 92 | - .btn-group { | |
| 93 | - width: 600rpx; | |
| 94 | - margin-bottom: 200rpx; | |
| 95 | - .auth-btn { | |
| 96 | - height: 90rpx; | |
| 97 | - font-size: 32rpx; | |
| 98 | - } | |
| 99 | - } | |
| 100 | - | |
| 101 | - .reg-login-link { | |
| 102 | - margin-top: 32rpx; | |
| 103 | - text-align: center; | |
| 104 | - color: #636363; | |
| 105 | - font-size: 30rpx; | |
| 106 | - } | |
| 107 | - | |
| 108 | - .auth-footer { | |
| 109 | - font-size: 26rpx; | |
| 110 | - color: #939393; | |
| 111 | - .lk-text { | |
| 112 | - color: $u-primary; | |
| 113 | - text-decoration: $u-primary; | |
| 114 | - } | |
| 115 | - } | |
| 116 | -} | |
| 117 | -</style> |
yudao-ui-app/pages/order/confirm.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="confirm-con"> | |
| 4 | - <!-- TODO 收货地址 --> | |
| 5 | - <navigator url="/pages/address/list?type=1"> | |
| 6 | - <yd-address-select :address="address"></yd-address-select> | |
| 7 | - </navigator> | |
| 8 | - | |
| 9 | - <!-- TODO 商品信息 --> | |
| 10 | - <view class="goods contain"> | |
| 11 | - <yd-order-product :productList="productList"></yd-order-product> | |
| 12 | - <view class="item row-between"> | |
| 13 | - <view>买家留言</view> | |
| 14 | - <u-input v-model="remark" :clearable="false" | |
| 15 | - placeholder="请添加备注(150 字以内)"></u-input> | |
| 16 | - </view> | |
| 17 | - </view> | |
| 18 | - </view> | |
| 19 | - | |
| 20 | - <!-- TODO 优惠劵 --> | |
| 21 | - | |
| 22 | - <!-- TODO 价格信息 --> | |
| 23 | - | |
| 24 | - <!-- TODO 底部:提交订单 --> | |
| 25 | - </view> | |
| 26 | -</template> | |
| 27 | - | |
| 28 | -<script> | |
| 29 | -export default { | |
| 30 | - data() { | |
| 31 | - return { | |
| 32 | - address: { // 选中的收货地址 | |
| 33 | - name: 'test', | |
| 34 | - mobile: '15601691300', | |
| 35 | - area: '奥特曼奥特曼' | |
| 36 | - }, | |
| 37 | - productList: [{ // 购买的商品列表 | |
| 38 | - coverUrl: '', | |
| 39 | - productTitle: '奥特曼', | |
| 40 | - sellPrice: 1024, | |
| 41 | - productCount: 2048, | |
| 42 | - totalPrice: 1024 | |
| 43 | - }], | |
| 44 | - remark: '', // 备注 | |
| 45 | - x | |
| 46 | - } | |
| 47 | - } | |
| 48 | -} | |
| 49 | -</script> | |
| 50 | - | |
| 51 | -<style> | |
| 52 | - .confirm-con { | |
| 53 | - overflow: hidden; | |
| 54 | - padding-bottom: calc(120rpx + env(safe-area-inset-bottom)); | |
| 55 | - } | |
| 56 | - | |
| 57 | - .contain { | |
| 58 | - border-radius: 14rpx; | |
| 59 | - margin: 20rpx 20rpx 0; | |
| 60 | - background-color: #fff; | |
| 61 | - overflow: hidden; | |
| 62 | - } | |
| 63 | -</style> |
yudao-ui-app/pages/order/detail.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <viwe class="detail-header"> | |
| 4 | - <view class="order-status">{{ order.status | getStatusName }}</view> | |
| 5 | - </viwe> | |
| 6 | - | |
| 7 | - <view class="order-product"> | |
| 8 | - <view class="order-item" v-for="item in order.items" :key="item.id"> | |
| 9 | - <image class="product-image" :src="item.picUrl"></image> | |
| 10 | - <view class="item-info"> | |
| 11 | - <view class="info-text"> | |
| 12 | - <u--text :lines="1" size="15px" color="#333333" :text="item.spuName"></u--text> | |
| 13 | - <u-gap height="10"></u-gap> | |
| 14 | - <yd-text-price class="product-price" size="13" intSize="14" :price="item.originalUnitPrice"></yd-text-price> | |
| 15 | - </view> | |
| 16 | - <view class="price-number-box"> | |
| 17 | - <view class="number-box"> | |
| 18 | - <view class="product-number">共 {{ item.count }} 件</view> | |
| 19 | - 小计: | |
| 20 | - </view> | |
| 21 | - <view class="number-box" @click.stop> | |
| 22 | - <yd-text-price size="13" intSize="16" :price="item.originalPrice"></yd-text-price> | |
| 23 | - </view> | |
| 24 | - </view> | |
| 25 | - </view> | |
| 26 | - </view> | |
| 27 | - </view> | |
| 28 | - | |
| 29 | - <view v-if="order.no" > | |
| 30 | - <view v-if="order.no" class="base-info"> | |
| 31 | - <view class="info-item"> | |
| 32 | - <view class="item-name">订单编号:</view> | |
| 33 | - <view class="item-value">{{ order.no }}</view> | |
| 34 | - </view> | |
| 35 | - <view class="info-item"> | |
| 36 | - <view class="item-name">下单时间:</view> | |
| 37 | - <view class="item-value">{{ order.createTime }}</view> | |
| 38 | - </view> | |
| 39 | - <view v-if="order.payOrderId" class="info-item"> | |
| 40 | - <view class="item-name">支付方式:</view> | |
| 41 | - <view class="item-value">{{ order.payOrderId }}</view> | |
| 42 | - </view> | |
| 43 | - <view v-if="order.payTime" class="info-item"> | |
| 44 | - <view class="item-name">支付时间:</view> | |
| 45 | - <view class="item-value">{{ order.payTime }}</view> | |
| 46 | - </view> | |
| 47 | - </view> | |
| 48 | - | |
| 49 | - <view class="delivery-info"> | |
| 50 | - <view class="info-item"> | |
| 51 | - <view class="item-name">收货地址:</view> | |
| 52 | - <view class="item-value">{{ order.receiverAreaName + order.receiverDetailAddress + order.receiverDetailAddress + order.receiverDetailAddress }}</view> | |
| 53 | - </view> | |
| 54 | - <view v-if="order.receiverName" class="info-item"> | |
| 55 | - <view class="item-name">收货人:</view> | |
| 56 | - <view class="item-value">{{ order.receiverName }}</view> | |
| 57 | - </view> | |
| 58 | - <view v-if="order.receiverMobile" class="info-item"> | |
| 59 | - <view class="item-name">联系电话:</view> | |
| 60 | - <view class="item-value">{{ order.receiverMobile }}</view> | |
| 61 | - </view> | |
| 62 | - </view> | |
| 63 | - | |
| 64 | - <view class="delivery-info"> | |
| 65 | - <view class="info-item"> | |
| 66 | - <view class="item-name">商品总额:</view> | |
| 67 | - <yd-text-price class="product-price" size="13" intSize="16" :price="order.originalPrice"></yd-text-price> | |
| 68 | - </view> | |
| 69 | - <view class="info-item"> | |
| 70 | - <view class="item-name">运费:</view> | |
| 71 | - <yd-text-price class="product-price" size="13" intSize="16" :price="order.deliveryPrice"></yd-text-price> | |
| 72 | - </view> | |
| 73 | - <view class="info-item"> | |
| 74 | - <view class="item-name">优惠:</view> | |
| 75 | - <yd-text-price class="product-price" size="13" intSize="16" symbol="-¥" :price="order.discountPrice"></yd-text-price> | |
| 76 | - </view> | |
| 77 | - <view class="info-item"> | |
| 78 | - <view class="item-name">订单金额:</view> | |
| 79 | - <yd-text-price class="product-price" size="15" intSize="20" :price="order.orderPrice"></yd-text-price> | |
| 80 | - </view> | |
| 81 | - </view> | |
| 82 | - </view> | |
| 83 | - | |
| 84 | - </view> | |
| 85 | -</template> | |
| 86 | - | |
| 87 | -<script> | |
| 88 | -import { getOrderDetail } from '../../api/order' | |
| 89 | -import orderStatus from '@/common/orderStatus' | |
| 90 | - | |
| 91 | -export default { | |
| 92 | - name: 'orderDetail', | |
| 93 | - filters: { | |
| 94 | - getStatusName(status) { | |
| 95 | - return orderStatus[status + ''].name | |
| 96 | - } | |
| 97 | - }, | |
| 98 | - data() { | |
| 99 | - return { | |
| 100 | - orderId: undefined, | |
| 101 | - order: {} | |
| 102 | - } | |
| 103 | - }, | |
| 104 | - onLoad(e) { | |
| 105 | - this.orderId = e.orderId | |
| 106 | - if (!this.orderId) { | |
| 107 | - uni.$u.toast('请求参数错误') | |
| 108 | - } else { | |
| 109 | - this.loadOrderDetailData() | |
| 110 | - } | |
| 111 | - }, | |
| 112 | - methods: { | |
| 113 | - loadOrderDetailData() { | |
| 114 | - getOrderDetail({ id: this.orderId }) | |
| 115 | - .then(res => { | |
| 116 | - this.order = res.data || {} | |
| 117 | - }) | |
| 118 | - .catch(err => { | |
| 119 | - console.log(err) | |
| 120 | - }) | |
| 121 | - } | |
| 122 | - } | |
| 123 | -} | |
| 124 | -</script> | |
| 125 | - | |
| 126 | -<style lang="scss" scoped> | |
| 127 | -.container { | |
| 128 | - background-color: #f3f3f3; | |
| 129 | - height: 100vh; | |
| 130 | -} | |
| 131 | - | |
| 132 | -.detail-header { | |
| 133 | - @include flex-center(); | |
| 134 | - background-color: $custom-bg-color; | |
| 135 | - padding: 10rpx 0; | |
| 136 | - border-radius: 0 0 20rpx 20rpx; | |
| 137 | -} | |
| 138 | - | |
| 139 | -.order-product { | |
| 140 | - background-color: $custom-bg-color; | |
| 141 | - border-radius: 20rpx; | |
| 142 | - margin: 20rpx; | |
| 143 | - padding: 10rpx 20rpx; | |
| 144 | - .order-item { | |
| 145 | - background: #ffffff; | |
| 146 | - @include flex-space-between; | |
| 147 | - padding: 10rpx 0 10rpx 5rpx; | |
| 148 | - | |
| 149 | - .product-check { | |
| 150 | - padding: 20rpx; | |
| 151 | - | |
| 152 | - .un-check-box { | |
| 153 | - width: 20px; | |
| 154 | - height: 20px; | |
| 155 | - border: 1px solid #939393; | |
| 156 | - border-radius: 50%; | |
| 157 | - } | |
| 158 | - } | |
| 159 | - | |
| 160 | - .product-image { | |
| 161 | - width: 180rpx; | |
| 162 | - height: 180rpx; | |
| 163 | - border-radius: 10rpx; | |
| 164 | - } | |
| 165 | - | |
| 166 | - .item-info { | |
| 167 | - flex: 1; | |
| 168 | - padding: 0 20rpx; | |
| 169 | - | |
| 170 | - .info-text { | |
| 171 | - padding-bottom: 10rpx; | |
| 172 | - | |
| 173 | - .product-price { | |
| 174 | - margin-top: 15rpx; | |
| 175 | - } | |
| 176 | - } | |
| 177 | - | |
| 178 | - .price-number-box { | |
| 179 | - @include flex-space-between; | |
| 180 | - | |
| 181 | - .number-box { | |
| 182 | - font-size: 24rpx; | |
| 183 | - | |
| 184 | - .product-number { | |
| 185 | - width: 200rpx; | |
| 186 | - } | |
| 187 | - } | |
| 188 | - | |
| 189 | - .number-box { | |
| 190 | - height: 60rpx; | |
| 191 | - @include flex-center; | |
| 192 | - } | |
| 193 | - } | |
| 194 | - } | |
| 195 | - } | |
| 196 | -} | |
| 197 | - | |
| 198 | -.base-info { | |
| 199 | - background-color: $custom-bg-color; | |
| 200 | - border-radius: 20rpx; | |
| 201 | - margin: 20rpx; | |
| 202 | - padding: 20rpx; | |
| 203 | - .info-item { | |
| 204 | - @include flex-left(); | |
| 205 | - padding: 10rpx 0; | |
| 206 | - .item-name { | |
| 207 | - color: #999; | |
| 208 | - font-size: 26rpx; | |
| 209 | - } | |
| 210 | - .item-value { | |
| 211 | - color: #333; | |
| 212 | - font-size: 26rpx; | |
| 213 | - } | |
| 214 | - } | |
| 215 | -} | |
| 216 | - | |
| 217 | -.delivery-info { | |
| 218 | - background-color: $custom-bg-color; | |
| 219 | - border-radius: 20rpx; | |
| 220 | - margin: 20rpx; | |
| 221 | - padding: 20rpx; | |
| 222 | - .info-item { | |
| 223 | - @include flex-left(); | |
| 224 | - padding: 10rpx 0; | |
| 225 | - .item-name { | |
| 226 | - color: #999; | |
| 227 | - font-size: 26rpx; | |
| 228 | - width: 260rpx; | |
| 229 | - } | |
| 230 | - .item-value { | |
| 231 | - color: #333; | |
| 232 | - font-size: 26rpx; | |
| 233 | - } | |
| 234 | - } | |
| 235 | -} | |
| 236 | - | |
| 237 | -.delivery-info { | |
| 238 | - background-color: $custom-bg-color; | |
| 239 | - border-radius: 20rpx; | |
| 240 | - margin: 20rpx; | |
| 241 | - padding: 20rpx; | |
| 242 | - .info-item { | |
| 243 | - @include flex-space-between(); | |
| 244 | - padding: 10rpx 0; | |
| 245 | - .item-name { | |
| 246 | - color: #999; | |
| 247 | - font-size: 26rpx; | |
| 248 | - } | |
| 249 | - } | |
| 250 | -} | |
| 251 | - | |
| 252 | -</style> |
yudao-ui-app/pages/order/list.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <u-sticky style="top: 0" offset-top="0"> | |
| 4 | - <u-tabs :list="tabArray" :current="tabIndex" itemStyle="padding-left: 18px; padding-right: 18px; height: 36px;" @change="handleStatusChange"></u-tabs> | |
| 5 | - </u-sticky> | |
| 6 | - <view class="order-list"> | |
| 7 | - <view v-for="order in orderList" :key="order.no" class="order-item"> | |
| 8 | - <view class="order-header"> | |
| 9 | - <view class="order-no">订单编号:{{ order.no }}</view> | |
| 10 | - <view class="order-status">{{ order.status | getStatusName }}</view> | |
| 11 | - </view> | |
| 12 | - | |
| 13 | - <view v-if="order.items.length === 1" class="order-single-item" @click="handleOrderClick(order.id)"> | |
| 14 | - <view class="item-wrap" v-for="item in order.items" :key="item.id"> | |
| 15 | - <view class="item-info"> | |
| 16 | - <image class="item-cover" :src="item.picUrl"></image> | |
| 17 | - <u--text :lines="2" size="15px" color="#333333" :text="item.spuName"></u--text> | |
| 18 | - </view> | |
| 19 | - <view class="item-count">共{{ item.count }}件</view> | |
| 20 | - </view> | |
| 21 | - </view> | |
| 22 | - <view v-else class="order-multi-item" @click="handleOrderClick(order.id)"> | |
| 23 | - <u-scroll-list :indicator="false"> | |
| 24 | - <view class="item-wrap" v-for="item in order.items" :key="item.id"> | |
| 25 | - <image class="item-image" :src="item.picUrl"></image> | |
| 26 | - </view> | |
| 27 | - </u-scroll-list> | |
| 28 | - <view class="product-count">共{{ order.productCount }}件</view> | |
| 29 | - </view> | |
| 30 | - | |
| 31 | - <view class="order-btn-group"> | |
| 32 | - <view class="order-btn">再次购买</view> | |
| 33 | - <view class="order-btn">其他操作</view> | |
| 34 | - </view> | |
| 35 | - </view> | |
| 36 | - </view> | |
| 37 | - </view> | |
| 38 | -</template> | |
| 39 | - | |
| 40 | -<script> | |
| 41 | -import { getOrderPage } from '../../api/order' | |
| 42 | -import orderStatus from '@/common/orderStatus' | |
| 43 | - | |
| 44 | -export default { | |
| 45 | - name: 'orderList', | |
| 46 | - filters: { | |
| 47 | - getStatusName(status) { | |
| 48 | - return orderStatus[status + ''].name | |
| 49 | - } | |
| 50 | - }, | |
| 51 | - data() { | |
| 52 | - return { | |
| 53 | - pageNo: 1, | |
| 54 | - tabIndex: 0, | |
| 55 | - orderList: [] | |
| 56 | - } | |
| 57 | - }, | |
| 58 | - computed: { | |
| 59 | - tabArray() { | |
| 60 | - let tabArray = [{ name: '全部', status: 'all' }] | |
| 61 | - for (let status in orderStatus) { | |
| 62 | - if (status !== '40') { | |
| 63 | - tabArray.push({ name: orderStatus[status].name, status: status }) | |
| 64 | - } | |
| 65 | - } | |
| 66 | - return tabArray | |
| 67 | - } | |
| 68 | - }, | |
| 69 | - onLoad(e) { | |
| 70 | - const status = e.status | |
| 71 | - if (status !== undefined) { | |
| 72 | - this.tabArray.forEach((item, index) => { | |
| 73 | - if (item.status === status) { | |
| 74 | - this.tabIndex = index | |
| 75 | - } | |
| 76 | - }) | |
| 77 | - } | |
| 78 | - this.loadOrderPageData() | |
| 79 | - }, | |
| 80 | - methods: { | |
| 81 | - handleStatusChange({ index }) { | |
| 82 | - this.tabIndex = index | |
| 83 | - this.loadOrderPageData() | |
| 84 | - }, | |
| 85 | - loadOrderPageData() { | |
| 86 | - let params = { pageNo: this.pageNo } | |
| 87 | - const status = this.tabArray[this.tabIndex].status | |
| 88 | - if (status !== 'all') { | |
| 89 | - params.orderStatus = status | |
| 90 | - } | |
| 91 | - getOrderPage(params) | |
| 92 | - .then(res => { | |
| 93 | - this.orderList = res.data.list || [] | |
| 94 | - }) | |
| 95 | - .catch(err => { | |
| 96 | - console.log(err) | |
| 97 | - }) | |
| 98 | - }, | |
| 99 | - handleOrderClick(orderId) { | |
| 100 | - uni.$u.route('/pages/order/detail', { | |
| 101 | - orderId: orderId | |
| 102 | - }) | |
| 103 | - } | |
| 104 | - } | |
| 105 | -} | |
| 106 | -</script> | |
| 107 | - | |
| 108 | -<style lang="scss" scoped> | |
| 109 | -.order-list { | |
| 110 | - background-color: #f3f3f3; | |
| 111 | - | |
| 112 | - .order-item { | |
| 113 | - padding: 20rpx; | |
| 114 | - background-color: #ffffff; | |
| 115 | - border-bottom: $custom-border-style; | |
| 116 | - | |
| 117 | - .order-header { | |
| 118 | - @include flex-space-between; | |
| 119 | - height: 80rpx; | |
| 120 | - | |
| 121 | - .order-no { | |
| 122 | - font-size: 28rpx; | |
| 123 | - color: #333; | |
| 124 | - } | |
| 125 | - | |
| 126 | - .order-status { | |
| 127 | - font-size: 24rpx; | |
| 128 | - color: #999; | |
| 129 | - } | |
| 130 | - } | |
| 131 | - | |
| 132 | - .order-single-item { | |
| 133 | - .item-wrap { | |
| 134 | - @include flex-space-between(); | |
| 135 | - | |
| 136 | - .item-info { | |
| 137 | - @include flex-left(); | |
| 138 | - | |
| 139 | - .item-cover { | |
| 140 | - width: 100rpx; | |
| 141 | - height: 100rpx; | |
| 142 | - border-radius: 10rpx; | |
| 143 | - margin-right: 15rpx; | |
| 144 | - } | |
| 145 | - } | |
| 146 | - | |
| 147 | - .item-count { | |
| 148 | - color: #999; | |
| 149 | - font-size: 24rpx; | |
| 150 | - width: 120rpx; | |
| 151 | - text-align: right; | |
| 152 | - } | |
| 153 | - } | |
| 154 | - } | |
| 155 | - | |
| 156 | - .order-multi-item { | |
| 157 | - @include flex-space-between(); | |
| 158 | - | |
| 159 | - .item-wrap { | |
| 160 | - margin-right: 20rpx; | |
| 161 | - | |
| 162 | - .item-image { | |
| 163 | - width: 100rpx; | |
| 164 | - height: 100rpx; | |
| 165 | - border-radius: 10rpx; | |
| 166 | - } | |
| 167 | - } | |
| 168 | - | |
| 169 | - .product-count { | |
| 170 | - color: #999; | |
| 171 | - font-size: 24rpx; | |
| 172 | - width: 120rpx; | |
| 173 | - text-align: right; | |
| 174 | - } | |
| 175 | - } | |
| 176 | - | |
| 177 | - .order-btn-group { | |
| 178 | - margin-top: 10rpx; | |
| 179 | - @include flex-right(); | |
| 180 | - | |
| 181 | - .order-btn { | |
| 182 | - width: 120rpx; | |
| 183 | - height: 36rpx; | |
| 184 | - line-height: 36rpx; | |
| 185 | - border-radius: 36rpx; | |
| 186 | - border: 1px solid #777; | |
| 187 | - color: #777; | |
| 188 | - font-size: 22rpx; | |
| 189 | - text-align: center; | |
| 190 | - margin-left: 15rpx; | |
| 191 | - } | |
| 192 | - } | |
| 193 | - } | |
| 194 | -} | |
| 195 | -</style> |
yudao-ui-app/pages/product/product.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <!-- 商品轮播图 --> | |
| 4 | - <u-swiper :list="spu.picUrls" @change="e => (currentNum = e.current)" :autoplay="false" | |
| 5 | - height="750rpx" radius="0" indicatorStyle="right: 20px"> | |
| 6 | - <view slot="indicator" class="indicator-num"> | |
| 7 | - <text class="indicator-num__text">{{ currentNum + 1 }}/{{ spu.picUrls.length }}</text> | |
| 8 | - </view> | |
| 9 | - </u-swiper> | |
| 10 | - | |
| 11 | - <view class="product-box"> | |
| 12 | - <!-- TODO @Sfmind:样式讨论,要不要改成类似 likeshop 的样子?第一栏:价格 + 分享;第二栏:商品名;第三栏:库存、销量、浏览量 --> | |
| 13 | - <view class="prod-info"> | |
| 14 | - <view class="info-text"> | |
| 15 | - <u--text :lines="2" size="14px" color="#333333" :text="spu.name"></u--text> | |
| 16 | - </view> | |
| 17 | - <view class="price-and-cart"> | |
| 18 | - <!-- TODO @Sfmind:custom-text-price 会报错 --> | |
| 19 | - <custom-text-price color="red" size="16" intSize="26" :price="spu.minPrice"></custom-text-price> | |
| 20 | - </view> | |
| 21 | - </view> | |
| 22 | - <view class="prod-favor"> | |
| 23 | - <u-icon name="star" color="#2979ff" size="28"></u-icon> | |
| 24 | - </view> | |
| 25 | - </view> | |
| 26 | - | |
| 27 | - <u-gap height="8" bgColor="#f3f3f3"></u-gap> | |
| 28 | - <view class="row-box"> | |
| 29 | - <view class="row-left">规格</view> | |
| 30 | - <view class="row-right" @click="skuPopup = true"> | |
| 31 | - <view class="row-content"> | |
| 32 | - <view class="sku-box"> | |
| 33 | - <view v-if="spu.skus.length > 0" class="sku-item"> | |
| 34 | - <view class="sku-desc">{{ spu.skus[currentSkuIndex].desc }}</view> | |
| 35 | - </view> | |
| 36 | - </view> | |
| 37 | - </view> | |
| 38 | - <view class="row-more"> | |
| 39 | - <u-icon name="more-dot-fill" color="#939393" size="14"></u-icon> | |
| 40 | - </view> | |
| 41 | - </view> | |
| 42 | - </view> | |
| 43 | - | |
| 44 | - <!-- 商品 SKU 选择弹窗 --> | |
| 45 | - <u-popup :show="skuPopup" :round="10" :closeable="true" :closeOnClickOverlay="false" @close="skuPopup = false"> | |
| 46 | - <view class="sku-popup-slot"> | |
| 47 | - <view class="current-sku-info"> | |
| 48 | - <u--image class="current-sku-img" :showLoading="true" :src="spu.skus[currentSkuIndex].picUrl" | |
| 49 | - width="120rpx" height="120rpx"></u--image> | |
| 50 | - <view class="current-sku-desc"> | |
| 51 | - <!-- TODO @Sfmind:name 这里的选择规格值的拼接 --> | |
| 52 | - <view class="name">{{ spu.skus[currentSkuIndex].desc }}</view> | |
| 53 | - <custom-text-price color="red" size="12" intSize="18" :price="spu.skus[currentSkuIndex].price"></custom-text-price> | |
| 54 | - <view class="current-sku-stock">库存: {{ 1 }}</view> | |
| 55 | - </view> | |
| 56 | - </view> | |
| 57 | - <view class="sku-selection"> | |
| 58 | - <!-- TODO @Sfmind:name 这里是规格的具体选项 --> | |
| 59 | - <view class="sku-item" :class="{ active: currentSkuIndex === index }" v-for="(item, index) in spu.skus" | |
| 60 | - :key="item.id" @click="handleSkuItemClick(index)">{{ item.desc }}</view> | |
| 61 | - </view> | |
| 62 | - <view class="sku-num-box"> | |
| 63 | - <view class="text">选择数量</view> | |
| 64 | - <u-number-box integer></u-number-box> | |
| 65 | - </view> | |
| 66 | - <view class="sku-btn-group"> | |
| 67 | - <view class="btn-item-main"> | |
| 68 | - <u-button type="warning" shape="circle" size="small" text="加入购物车"></u-button> | |
| 69 | - </view> | |
| 70 | - <view class="btn-item-main"> | |
| 71 | - <u-button type="error" shape="circle" size="small" text="立即购买"></u-button> | |
| 72 | - </view> | |
| 73 | - </view> | |
| 74 | - </view> | |
| 75 | - </u-popup> | |
| 76 | - | |
| 77 | - <u-gap height="8" bgColor="#f3f3f3"></u-gap> | |
| 78 | - <view class="row-box"> | |
| 79 | - <view class="row-left">促销</view> | |
| 80 | - <view class="row-right" v-if="promotionList.length > 0" @click="promotionPopup = true"> | |
| 81 | - <view class="row-content"> | |
| 82 | - <view class="prom-box"> | |
| 83 | - <view class="prom-item"> | |
| 84 | - <view class="prom-title">{{ promotionList[0].title }}</view> | |
| 85 | - <text class="prom-desc">{{ promotionList[0].desc }}</text> | |
| 86 | - </view> | |
| 87 | - </view> | |
| 88 | - </view> | |
| 89 | - <view class="row-more"> | |
| 90 | - <u-icon name="more-dot-fill" color="#939393" size="14"></u-icon> | |
| 91 | - </view> | |
| 92 | - </view> | |
| 93 | - </view> | |
| 94 | - | |
| 95 | - <!-- 促销信息弹窗 --> | |
| 96 | - <u-popup :show="promotionPopup" :round="10" :closeable="true" :closeOnClickOverlay="false" @close="promotionPopup = false"> | |
| 97 | - <view class="prom-popup-slot"> | |
| 98 | - <view class="prom-info">促销信息</view> | |
| 99 | - <view class="prom-list"> | |
| 100 | - <view v-for="(item, index) in promotionList" :key="index.id" class="prom-item"> | |
| 101 | - <view class="prom-title">{{ item.title }}</view> | |
| 102 | - <text class="prom-desc">{{ item.desc }}</text> | |
| 103 | - </view> | |
| 104 | - </view> | |
| 105 | - </view> | |
| 106 | - </u-popup> | |
| 107 | - | |
| 108 | - <u-gap height="8" bgColor="#f3f3f3"></u-gap> | |
| 109 | - <view class="row-box"> | |
| 110 | - <view class="row-left">领券</view> | |
| 111 | - <view class="row-right" @click="handleCouponClick"> | |
| 112 | - <view class="row-content"> | |
| 113 | - <view class="coupon-box"> | |
| 114 | - <view v-if="couponList.length > 0" class="coupon-list"> | |
| 115 | - <view v-for="(item, index) in couponList" :key="item.id" class="coupon-item"> | |
| 116 | - <view v-if="index < 2" class="coupon-desc">{{ item.desc }}</view> | |
| 117 | - </view> | |
| 118 | - </view> | |
| 119 | - <view class="coupon-total">共 {{ couponList.length }} 张</view> | |
| 120 | - </view> | |
| 121 | - </view> | |
| 122 | - <view class="row-more"> | |
| 123 | - <u-icon name="more-dot-fill" color="#939393" size="14"></u-icon> | |
| 124 | - </view> | |
| 125 | - </view> | |
| 126 | - </view> | |
| 127 | - | |
| 128 | - <u-gap height="8" bgColor="#f3f3f3"></u-gap> | |
| 129 | - <view class="evaluation-box-wrap"> | |
| 130 | - <view class="evaluation-box"> | |
| 131 | - <view class="evaluation-title">评价</view> | |
| 132 | - <view class="evaluation-info"> | |
| 133 | - <view class="evan-type-list"> | |
| 134 | - <view class="evan-type-item" :class="{ active: currentEvanIndex === index }" v-for="(item, index) in evanTypeList" :key="item.id" @click="handleEvanTypeClick(index)"> {{ item.name }}({{ item.count }}) </view> | |
| 135 | - </view> | |
| 136 | - <view class="comment-empty" v-if="true"> | |
| 137 | - <u-empty mode="comment" width="350rpx" height="350rpx" icon="/static/images/empty/comment.png"></u-empty> | |
| 138 | - </view> | |
| 139 | - <view v-else class="comment-list" style="min-height: 50px"> </view> | |
| 140 | - </view> | |
| 141 | - </view> | |
| 142 | - </view> | |
| 143 | - | |
| 144 | - <!-- TODO @Sfmind:缺个商品详情 --> | |
| 145 | - | |
| 146 | - <view class="fixed-btn-box"> | |
| 147 | - <view class="btn-group"> | |
| 148 | - <navigator class="btn-item" url="/pages/index/index" open-type="switchTab" hover-class="none"> | |
| 149 | - <u-icon name="home" :size="24"></u-icon> | |
| 150 | - <view class="btn-text">首页</view> | |
| 151 | - </navigator> | |
| 152 | - <navigator class="btn-item" url="/pages/xxx/xxx" open-type="navigate" hover-class="none"> | |
| 153 | - <u-icon name="server-man" :size="24"></u-icon> | |
| 154 | - <view class="btn-text">客服</view> | |
| 155 | - </navigator> | |
| 156 | - <!-- TODO @Sfmind:改成收藏 --> | |
| 157 | - <navigator class="btn-item" url="/pages/cart/cart" open-type="switchTab" hover-class="none"> | |
| 158 | - <u-icon name="star" :size="24"></u-icon> | |
| 159 | - <view class="btn-text">收藏</view> | |
| 160 | - </navigator> | |
| 161 | - <view class="btn-item-main"> | |
| 162 | - <u-button type="warning" shape="circle" size="small" text="加入购物车"></u-button> | |
| 163 | - </view> | |
| 164 | - <view class="btn-item-main"> | |
| 165 | - <u-button type="error" color="#ea322b" shape="circle" size="small" text="立即购买"></u-button> | |
| 166 | - </view> | |
| 167 | - </view> | |
| 168 | - <u-safe-bottom customStyle="background: #ffffff"></u-safe-bottom> | |
| 169 | - </view> | |
| 170 | - </view> | |
| 171 | -</template> | |
| 172 | - | |
| 173 | -<script> | |
| 174 | -import { getSpuDetail } from '../../api/product'; | |
| 175 | - | |
| 176 | -export default { | |
| 177 | - data() { | |
| 178 | - return { | |
| 179 | - current: 0, | |
| 180 | - currentNum: 0, | |
| 181 | - currentSkuIndex: 0, | |
| 182 | - skuPopup: false, | |
| 183 | - spu: { | |
| 184 | - id: '', | |
| 185 | - picUrls: [], | |
| 186 | - minPrice: '13.00', | |
| 187 | - sku: [ | |
| 188 | - { | |
| 189 | - id: 0, | |
| 190 | - picUrl: 'https://cdn.uviewui.com/uview/album/1.jpg', | |
| 191 | - price: 13.0, | |
| 192 | - desc: '山不在高,有仙则名。' | |
| 193 | - }, | |
| 194 | - { | |
| 195 | - id: 1, | |
| 196 | - picUrl: 'https://cdn.uviewui.com/uview/album/2.jpg', | |
| 197 | - price: 11.0, | |
| 198 | - desc: '水不在深,有龙则灵。' | |
| 199 | - }, | |
| 200 | - { | |
| 201 | - id: 2, | |
| 202 | - picUrl: 'https://cdn.uviewui.com/uview/album/3.jpg', | |
| 203 | - price: 10.0, | |
| 204 | - desc: '斯是陋室,惟吾德馨。' | |
| 205 | - } | |
| 206 | - ] | |
| 207 | - }, | |
| 208 | - promotionPopup: false, | |
| 209 | - promotionList: [ | |
| 210 | - { | |
| 211 | - id: 0, | |
| 212 | - title: '满额减', | |
| 213 | - desc: '全场满500减100' | |
| 214 | - }, | |
| 215 | - { | |
| 216 | - id: 1, | |
| 217 | - title: '满额减', | |
| 218 | - desc: '全场满300减50' | |
| 219 | - }, | |
| 220 | - { | |
| 221 | - id: 2, | |
| 222 | - title: '满额减', | |
| 223 | - desc: '全场满200减20' | |
| 224 | - }, | |
| 225 | - { | |
| 226 | - id: 3, | |
| 227 | - title: '满额减', | |
| 228 | - desc: '全场满100减5' | |
| 229 | - } | |
| 230 | - ], | |
| 231 | - couponList: [ | |
| 232 | - { | |
| 233 | - id: 0, | |
| 234 | - title: '优惠券', | |
| 235 | - desc: '满50减10' | |
| 236 | - }, | |
| 237 | - { | |
| 238 | - id: 1, | |
| 239 | - title: '优惠券', | |
| 240 | - desc: '满30减5' | |
| 241 | - }, | |
| 242 | - { | |
| 243 | - id: 2, | |
| 244 | - title: '优惠券', | |
| 245 | - desc: '满20减2' | |
| 246 | - } | |
| 247 | - ], | |
| 248 | - currentEvanIndex: 0, | |
| 249 | - evanTypeList: [ | |
| 250 | - { | |
| 251 | - id: '0', | |
| 252 | - name: '全部', | |
| 253 | - count: 0 | |
| 254 | - }, | |
| 255 | - { | |
| 256 | - id: '1', | |
| 257 | - name: '好评', | |
| 258 | - count: 0 | |
| 259 | - }, | |
| 260 | - { | |
| 261 | - id: '2', | |
| 262 | - name: '中评', | |
| 263 | - count: 0 | |
| 264 | - }, | |
| 265 | - { | |
| 266 | - id: '3', | |
| 267 | - name: '差评', | |
| 268 | - count: 0 | |
| 269 | - }, | |
| 270 | - { | |
| 271 | - id: '4', | |
| 272 | - name: '有图', | |
| 273 | - count: 0 | |
| 274 | - } | |
| 275 | - ] | |
| 276 | - } | |
| 277 | - }, | |
| 278 | - onLoad(e) { | |
| 279 | - if (!e.id) { | |
| 280 | - uni.$u.toast('请求参数错误') | |
| 281 | - return; | |
| 282 | - } | |
| 283 | - | |
| 284 | - // 加载商品详情 | |
| 285 | - this.spu.id = e.id | |
| 286 | - this.loadProductData() | |
| 287 | - }, | |
| 288 | - methods: { | |
| 289 | - loadProductData() { | |
| 290 | - getSpuDetail(this.spu.id).then(res => { | |
| 291 | - // this.spu.desc = res.data.description.replace(/<[^>]*>/g,''); | |
| 292 | - // console.log(res) | |
| 293 | - this.spu = res.data; | |
| 294 | - }) | |
| 295 | - }, | |
| 296 | - handleSkuItemClick(index) { | |
| 297 | - this.currentSkuIndex = index | |
| 298 | - }, | |
| 299 | - handleCouponClick() { | |
| 300 | - // TODO 未登录去登录,登录则跳转优惠券页面 | |
| 301 | - }, | |
| 302 | - handleEvanTypeClick(index) { | |
| 303 | - this.currentEvanIndex = index | |
| 304 | - // TODO 展示评论 | |
| 305 | - } | |
| 306 | - }, | |
| 307 | - computed: { | |
| 308 | - hasLogin() { | |
| 309 | - return this.$store.getters.hasLogin | |
| 310 | - } | |
| 311 | - } | |
| 312 | -} | |
| 313 | -</script> | |
| 314 | - | |
| 315 | -<style lang="scss" scoped> | |
| 316 | -.indicator-num { | |
| 317 | - @include flex-center; | |
| 318 | - padding: 2px 0; | |
| 319 | - background-color: rgba(0, 0, 0, 0.35); | |
| 320 | - border-radius: 100px; | |
| 321 | - width: 35px; | |
| 322 | - | |
| 323 | - &__text { | |
| 324 | - color: #ffffff; | |
| 325 | - font-size: 12px; | |
| 326 | - } | |
| 327 | -} | |
| 328 | - | |
| 329 | -.product-box { | |
| 330 | - padding: 40rpx 40rpx 10rpx 40rpx; | |
| 331 | - @include flex; | |
| 332 | - border-bottom: $custom-border-style; | |
| 333 | - .prod-info { | |
| 334 | - padding-right: 30rpx; | |
| 335 | - .info-text { | |
| 336 | - padding-bottom: 10rpx; | |
| 337 | - } | |
| 338 | - .price-and-cart { | |
| 339 | - @include flex-space-between; | |
| 340 | - } | |
| 341 | - } | |
| 342 | - .prod-favor { | |
| 343 | - margin-top: 15rpx; | |
| 344 | - } | |
| 345 | -} | |
| 346 | - | |
| 347 | -.row-box { | |
| 348 | - @include flex-left; | |
| 349 | - padding: 0 30rpx; | |
| 350 | - height: 70rpx; | |
| 351 | - .row-left { | |
| 352 | - width: 70rpx; | |
| 353 | - font-size: 24rpx; | |
| 354 | - color: #939393; | |
| 355 | - } | |
| 356 | - | |
| 357 | - .row-right { | |
| 358 | - @include flex-space-between; | |
| 359 | - flex: 1; | |
| 360 | - | |
| 361 | - .row-content { | |
| 362 | - flex: 1; | |
| 363 | - | |
| 364 | - .prom-box { | |
| 365 | - @include flex-left; | |
| 366 | - .prom-item { | |
| 367 | - @include flex-left; | |
| 368 | - font-size: 22rpx; | |
| 369 | - .prom-title { | |
| 370 | - padding: 1rpx 10rpx; | |
| 371 | - border: 1rpx solid red; | |
| 372 | - border-radius: 5rpx; | |
| 373 | - color: red; | |
| 374 | - transform: scale(0.9); | |
| 375 | - } | |
| 376 | - .prom-desc { | |
| 377 | - margin-left: 15rpx; | |
| 378 | - } | |
| 379 | - } | |
| 380 | - } | |
| 381 | - | |
| 382 | - .coupon-box { | |
| 383 | - @include flex-space-between; | |
| 384 | - .coupon-list { | |
| 385 | - @include flex-left; | |
| 386 | - .coupon-item { | |
| 387 | - @include flex-left; | |
| 388 | - font-size: 22rpx; | |
| 389 | - .coupon-desc { | |
| 390 | - padding: 2rpx 15rpx; | |
| 391 | - margin-right: 15rpx; | |
| 392 | - background: red; | |
| 393 | - color: #ffffff; | |
| 394 | - } | |
| 395 | - } | |
| 396 | - } | |
| 397 | - .coupon-total { | |
| 398 | - color: #939393; | |
| 399 | - font-size: 12rpx; | |
| 400 | - padding: 0 15rpx; | |
| 401 | - } | |
| 402 | - } | |
| 403 | - | |
| 404 | - .sku-box { | |
| 405 | - @include flex-space-between; | |
| 406 | - .sku-item { | |
| 407 | - @include flex-left; | |
| 408 | - font-size: 22rpx; | |
| 409 | - .sku-desc { | |
| 410 | - margin-left: 15rpx; | |
| 411 | - font-weight: 700; | |
| 412 | - } | |
| 413 | - } | |
| 414 | - } | |
| 415 | - } | |
| 416 | - | |
| 417 | - .row-more { | |
| 418 | - @include flex-right; | |
| 419 | - width: 30rpx; | |
| 420 | - } | |
| 421 | - } | |
| 422 | -} | |
| 423 | - | |
| 424 | -.sku-popup-slot { | |
| 425 | - width: 750rpx; | |
| 426 | - .current-sku-info { | |
| 427 | - @include flex; | |
| 428 | - padding: 30rpx 100rpx 0 30rpx; | |
| 429 | - .current-sku-img { | |
| 430 | - border-radius: 10rpx; | |
| 431 | - /deep/ * { | |
| 432 | - border-radius: 10rpx; | |
| 433 | - } | |
| 434 | - } | |
| 435 | - .current-sku-desc { | |
| 436 | - padding: 0 30rpx; | |
| 437 | - font-size: 28rpx; | |
| 438 | - .current-sku-stock { | |
| 439 | - height: 40rpx; | |
| 440 | - line-height: 40rpx; | |
| 441 | - color: #666666; | |
| 442 | - font-size: 24rpx; | |
| 443 | - } | |
| 444 | - } | |
| 445 | - } | |
| 446 | - .sku-selection { | |
| 447 | - margin: 30rpx; | |
| 448 | - font-size: 26rpx; | |
| 449 | - color: #939393; | |
| 450 | - .sku-item { | |
| 451 | - margin-bottom: 20rpx; | |
| 452 | - border-radius: 6rpx; | |
| 453 | - padding: 5rpx 15rpx; | |
| 454 | - border: 1rpx solid #e3e3e3; | |
| 455 | - width: fit-content !important; | |
| 456 | - &.active { | |
| 457 | - color: #666666; | |
| 458 | - border: 1rpx solid #666666; | |
| 459 | - } | |
| 460 | - } | |
| 461 | - } | |
| 462 | - .sku-num-box { | |
| 463 | - @include flex-space-between padding: 30rpx; | |
| 464 | - .text { | |
| 465 | - font-size: 30rpx; | |
| 466 | - } | |
| 467 | - } | |
| 468 | - .sku-btn-group { | |
| 469 | - @include flex-space-around; | |
| 470 | - height: 100rpx; | |
| 471 | - .btn-item-main { | |
| 472 | - width: 350rpx; | |
| 473 | - } | |
| 474 | - } | |
| 475 | -} | |
| 476 | - | |
| 477 | -.prom-popup-slot { | |
| 478 | - width: 750rpx; | |
| 479 | - min-height: 500rpx; | |
| 480 | - .prom-info { | |
| 481 | - background: #f3f3f3; | |
| 482 | - line-height: 90rpx; | |
| 483 | - padding-left: 30rpx; | |
| 484 | - font-size: 36rpx; | |
| 485 | - border-radius: 10px 10px 0 0; | |
| 486 | - } | |
| 487 | - .prom-list { | |
| 488 | - padding: 30rpx; | |
| 489 | - .prom-item { | |
| 490 | - @include flex-left; | |
| 491 | - font-size: 22rpx; | |
| 492 | - margin-bottom: 15rpx; | |
| 493 | - .prom-title { | |
| 494 | - padding: 1rpx 10rpx; | |
| 495 | - border: 1rpx solid red; | |
| 496 | - border-radius: 5rpx; | |
| 497 | - color: red; | |
| 498 | - transform: scale(0.9); | |
| 499 | - } | |
| 500 | - .prom-desc { | |
| 501 | - margin-left: 15rpx; | |
| 502 | - } | |
| 503 | - } | |
| 504 | - } | |
| 505 | -} | |
| 506 | - | |
| 507 | -.evaluation-box-wrap { | |
| 508 | - background: #f3f3f3; | |
| 509 | - | |
| 510 | - .evaluation-box { | |
| 511 | - border-radius: 20rpx 20rpx 0 0; | |
| 512 | - background: $custom-bg-color; | |
| 513 | - padding-bottom: 120rpx; | |
| 514 | - | |
| 515 | - .evaluation-title { | |
| 516 | - border-radius: 20rpx 20rpx 0 0; | |
| 517 | - padding: 20rpx 30rpx; | |
| 518 | - border-bottom: $custom-border-style; | |
| 519 | - font-size: 30rpx; | |
| 520 | - } | |
| 521 | - | |
| 522 | - .evaluation-info { | |
| 523 | - } | |
| 524 | - | |
| 525 | - .evan-type-list { | |
| 526 | - padding: 20rpx; | |
| 527 | - @include flex-space-around; | |
| 528 | - | |
| 529 | - .evan-type-item { | |
| 530 | - border-radius: 8rpx; | |
| 531 | - padding: 7rpx 12rpx; | |
| 532 | - background: #f3f3f3; | |
| 533 | - font-size: 22rpx; | |
| 534 | - text-align: center; | |
| 535 | - &.active { | |
| 536 | - background: #ffffff; | |
| 537 | - border: 1rpx solid red; | |
| 538 | - padding: 5rpx 10rpx; | |
| 539 | - color: red; | |
| 540 | - } | |
| 541 | - } | |
| 542 | - } | |
| 543 | - | |
| 544 | - .comment-empty { | |
| 545 | - margin-bottom: 100rpx; | |
| 546 | - } | |
| 547 | - } | |
| 548 | -} | |
| 549 | - | |
| 550 | -.fixed-btn-box { | |
| 551 | - position: fixed; | |
| 552 | - bottom: 0; | |
| 553 | - left: 0; | |
| 554 | - .btn-group { | |
| 555 | - background: $custom-bg-color; | |
| 556 | - border-top: $custom-border-style; | |
| 557 | - | |
| 558 | - width: 750rpx; | |
| 559 | - @include flex-space-around; | |
| 560 | - height: 100rpx; | |
| 561 | - | |
| 562 | - .btn-item { | |
| 563 | - width: 80rpx; | |
| 564 | - @include flex-center(column); | |
| 565 | - .btn-text { | |
| 566 | - font-size: 18rpx; | |
| 567 | - color: #666666; | |
| 568 | - } | |
| 569 | - } | |
| 570 | - | |
| 571 | - .btn-item-main { | |
| 572 | - width: 200rpx; | |
| 573 | - } | |
| 574 | - } | |
| 575 | -} | |
| 576 | -</style> |
yudao-ui-app/pages/profile/profile.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="user-info"> | |
| 4 | - <view class="info-item"> | |
| 5 | - <view class="label">头像:</view> | |
| 6 | - <view class="info" @click="handleAvatarClick"> | |
| 7 | - <u-avatar size="50" shape="square" :src="userInfo.avatar"></u-avatar> | |
| 8 | - <u-icon class="btn" name="arrow-right"></u-icon> | |
| 9 | - </view> | |
| 10 | - </view> | |
| 11 | - <view class="info-item"> | |
| 12 | - <view class="label">昵称:</view> | |
| 13 | - <view class="info"> | |
| 14 | - <u--input maxlength="10" border="none" v-model="userInfo.nickname" inputAlign="right" @change="handleNameChange"></u--input> | |
| 15 | - </view> | |
| 16 | - </view> | |
| 17 | - <view class="info-item"> | |
| 18 | - <view class="label">手机:</view> | |
| 19 | - <view class="info"> | |
| 20 | - <view class="value">{{ userInfo.mobile }}</view> | |
| 21 | - </view> | |
| 22 | - </view> | |
| 23 | - </view> | |
| 24 | - | |
| 25 | - <view v-if="nameUpdateVisible" class="btn-group"> | |
| 26 | - <u-button type="primary" text="保存" customStyle="margin-top: 50px" @click="handleSaveBtnClick"></u-button> | |
| 27 | - </view> | |
| 28 | - | |
| 29 | - </view> | |
| 30 | -</template> | |
| 31 | - | |
| 32 | -<script> | |
| 33 | -import { getUserInfo, updateAvatar, updateNickname } from '../../api/user' | |
| 34 | - | |
| 35 | -export default { | |
| 36 | - data() { | |
| 37 | - return { | |
| 38 | - userInfo: { | |
| 39 | - nickname: '', | |
| 40 | - avatar: '', | |
| 41 | - mobile: '' | |
| 42 | - }, | |
| 43 | - avatarFiles: [], | |
| 44 | - tempName: '' | |
| 45 | - } | |
| 46 | - }, | |
| 47 | - computed: { | |
| 48 | - nameUpdateVisible: function () { | |
| 49 | - return this.userInfo.nickname !== this.tempName | |
| 50 | - } | |
| 51 | - }, | |
| 52 | - onLoad() { | |
| 53 | - this.loadUserInfoData() | |
| 54 | - }, | |
| 55 | - methods: { | |
| 56 | - loadUserInfoData() { | |
| 57 | - getUserInfo().then(res => { | |
| 58 | - this.userInfo = res.data | |
| 59 | - this.tempName = this.userInfo.nickname | |
| 60 | - }) | |
| 61 | - }, | |
| 62 | - handleAvatarClick() { | |
| 63 | - uni.chooseImage({ | |
| 64 | - success: chooseImageRes => { | |
| 65 | - const tempFilePaths = chooseImageRes.tempFilePaths | |
| 66 | - updateAvatar(tempFilePaths[0]).then(res => { | |
| 67 | - this.userInfo.avatar = res.data | |
| 68 | - this.$store.commit('SET_USER_INFO', this.userInfo) | |
| 69 | - }) | |
| 70 | - } | |
| 71 | - }) | |
| 72 | - }, | |
| 73 | - handleNameChange(val) { | |
| 74 | - let str = uni.$u.trim(val, 'all') | |
| 75 | - this.$nextTick(() => { | |
| 76 | - this.userInfo.nickname = str | |
| 77 | - }) | |
| 78 | - }, | |
| 79 | - handleSaveBtnClick() { | |
| 80 | - updateNickname({ nickname: this.userInfo.nickname }).then(res => { | |
| 81 | - this.tempName = this.userInfo.nickname | |
| 82 | - this.$store.commit('SET_USER_INFO', this.userInfo) | |
| 83 | - uni.$u.toast('已保存') | |
| 84 | - setTimeout(() => { | |
| 85 | - uni.switchTab({ | |
| 86 | - url: '/pages/user/user' | |
| 87 | - }) | |
| 88 | - }, 300) | |
| 89 | - }) | |
| 90 | - } | |
| 91 | - } | |
| 92 | -} | |
| 93 | -</script> | |
| 94 | - | |
| 95 | -<style lang="scss" scoped> | |
| 96 | -.user-info { | |
| 97 | - .info-item { | |
| 98 | - padding: 20rpx 60rpx; | |
| 99 | - border-bottom: $custom-border-style; | |
| 100 | - @include flex-space-between; | |
| 101 | - .label { | |
| 102 | - font-size: 30rpx; | |
| 103 | - } | |
| 104 | - .info { | |
| 105 | - @include flex-left; | |
| 106 | - .value { | |
| 107 | - font-size: 30rpx; | |
| 108 | - } | |
| 109 | - .btn { | |
| 110 | - margin-left: 30rpx; | |
| 111 | - } | |
| 112 | - } | |
| 113 | - .name-edit { | |
| 114 | - @include flex-left; | |
| 115 | - .edit-btn-group { | |
| 116 | - @include flex; | |
| 117 | - .edit-btn { | |
| 118 | - margin-left: 20rpx; | |
| 119 | - } | |
| 120 | - } | |
| 121 | - } | |
| 122 | - } | |
| 123 | -} | |
| 124 | - | |
| 125 | -.btn-group { | |
| 126 | - padding: 0 30rpx; | |
| 127 | -} | |
| 128 | -</style> |
yudao-ui-app/pages/search/search.vue deleted
yudao-ui-app/pages/setting/setting.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <u-gap height="20"></u-gap> | |
| 4 | - <u-cell-group class="setting-list" :border="false"> | |
| 5 | - <u-cell class="setting-item" icon="lock" title="修改密码" isLink></u-cell> | |
| 6 | - <u-cell class="setting-item" icon="phone" title="换绑手机" isLink></u-cell> | |
| 7 | - <u-cell v-if="hasLogin" class="setting-item" icon="minus-circle" title="用户登出" @click="logout" isLink></u-cell> | |
| 8 | - </u-cell-group> | |
| 9 | - </view> | |
| 10 | -</template> | |
| 11 | - | |
| 12 | -<script> | |
| 13 | -import UGap from '../../uni_modules/uview-ui/components/u-gap/u-gap' | |
| 14 | - | |
| 15 | -export default { | |
| 16 | - components: { UGap }, | |
| 17 | - data() { | |
| 18 | - return {} | |
| 19 | - }, | |
| 20 | - computed: { | |
| 21 | - hasLogin() { | |
| 22 | - return this.$store.getters.hasLogin | |
| 23 | - } | |
| 24 | - }, | |
| 25 | - onLoad() {}, | |
| 26 | - methods: { | |
| 27 | - logout() { | |
| 28 | - uni.showModal({ | |
| 29 | - title: '提示', | |
| 30 | - content: '您确定要退出登录吗', | |
| 31 | - success: res => { | |
| 32 | - if (res.confirm) { | |
| 33 | - this.$store.dispatch('Logout').then(res => { | |
| 34 | - uni.switchTab({ | |
| 35 | - url: '/pages/user/user' | |
| 36 | - }) | |
| 37 | - }) | |
| 38 | - } else if (res.cancel) { | |
| 39 | - //console.log('用户点击取消') | |
| 40 | - } | |
| 41 | - } | |
| 42 | - }) | |
| 43 | - } | |
| 44 | - } | |
| 45 | -} | |
| 46 | -</script> | |
| 47 | - | |
| 48 | -<style lang="scss" scoped> | |
| 49 | -.setting-list { | |
| 50 | - padding: 10rpx 0; | |
| 51 | - background-color: #fff; | |
| 52 | - border-radius: 15rpx; | |
| 53 | - | |
| 54 | - .setting-item { | |
| 55 | - padding: 10rpx 0; | |
| 56 | - | |
| 57 | - &:last-child { | |
| 58 | - border-bottom: none; | |
| 59 | - } | |
| 60 | - } | |
| 61 | -} | |
| 62 | -</style> |
yudao-ui-app/pages/user/user.vue deleted
| 1 | -<template> | |
| 2 | - <view class="container"> | |
| 3 | - <view class="user-header"> | |
| 4 | - <view class="user-info" @click="pageRouter('/pages/profile/profile')"> | |
| 5 | - <u-avatar size="60" shape="square" :src="userInfo.avatar"></u-avatar> | |
| 6 | - <view class="info-text"> | |
| 7 | - <view class="user-nickname">{{ hasLogin ? userInfo.nickname || '会员用户' : '匿名用户' }}</view> | |
| 8 | - <view class="user-mobile">{{ hasLogin ? userInfo.mobile || ' ' : '登录/注册' }}</view> | |
| 9 | - </view> | |
| 10 | - </view> | |
| 11 | - <view class="user-setting"> | |
| 12 | - <u-icon v-if="hasLogin" name="setting" color="#939393" size="22" @click="pageRouter('/pages/setting/setting')"></u-icon> | |
| 13 | - </view> | |
| 14 | - </view> | |
| 15 | - | |
| 16 | - <u-gap height="10" bgColor="#f3f3f3"></u-gap> | |
| 17 | - | |
| 18 | - <view> | |
| 19 | - <view class="order-header"> | |
| 20 | - <text class="order-title">我的订单</text> | |
| 21 | - <view class="see-all" @click="pageRouter(orderPage, -1)"> | |
| 22 | - <text>查看全部</text> | |
| 23 | - <u-icon name="arrow-right"></u-icon> | |
| 24 | - </view> | |
| 25 | - </view> | |
| 26 | - | |
| 27 | - <view class="order-status-box"> | |
| 28 | - <u-grid :border="false" :col="orderStatusList.length"> | |
| 29 | - <u-grid-item v-for="(item, index) in orderStatusList" :key="index" @click="pageRouter(orderPage, item.status)"> | |
| 30 | - <u-icon :name="item.icon" :size="32"></u-icon> | |
| 31 | - <text class="grid-title">{{ item.name }}</text> | |
| 32 | - </u-grid-item> | |
| 33 | - </u-grid> | |
| 34 | - </view> | |
| 35 | - </view> | |
| 36 | - | |
| 37 | - <u-gap height="10" bgColor="#f3f3f3"></u-gap> | |
| 38 | - | |
| 39 | - <view class="stat-box"> | |
| 40 | - <u-grid :border="false" col="3"> | |
| 41 | - <u-grid-item v-for="(item, index) in statList" :key="index"> | |
| 42 | - <text class="grid-value">{{ item.value }}</text> | |
| 43 | - <text class="grid-title">{{ item.title }}</text> | |
| 44 | - </u-grid-item> | |
| 45 | - </u-grid> | |
| 46 | - </view> | |
| 47 | - | |
| 48 | - <u-gap height="10" bgColor="#f3f3f3"></u-gap> | |
| 49 | - | |
| 50 | - <u-cell-group class="fun-list"> | |
| 51 | - <u-cell class="fun-item" :border="false" icon="gift" title="分销中心" isLink></u-cell> | |
| 52 | - <u-cell class="fun-item" :border="false" icon="tags" title="领券中心" isLink></u-cell> | |
| 53 | - <u-cell class="fun-item" :border="false" icon="coupon" title="我的优惠券" isLink></u-cell> | |
| 54 | - <u-cell class="fun-item" :border="false" icon="map" title="收货地址" @click="pageRouter('/pages/address/list')" isLink></u-cell> | |
| 55 | - </u-cell-group> | |
| 56 | - </view> | |
| 57 | -</template> | |
| 58 | - | |
| 59 | -<script> | |
| 60 | -import orderStatus from '@/common/orderStatus' | |
| 61 | - | |
| 62 | -export default { | |
| 63 | - data() { | |
| 64 | - return { | |
| 65 | - orderPage: '/pages/order/list', | |
| 66 | - statList: [ | |
| 67 | - { value: '0', title: '我的收藏' }, | |
| 68 | - { value: '0', title: '我的消息' }, | |
| 69 | - { value: '0', title: '我的足迹' } | |
| 70 | - ] | |
| 71 | - } | |
| 72 | - }, | |
| 73 | - onLoad() { | |
| 74 | - if (this.hasLogin) { | |
| 75 | - this.$store.dispatch('ObtainUserInfo') | |
| 76 | - } | |
| 77 | - }, | |
| 78 | - computed: { | |
| 79 | - userInfo() { | |
| 80 | - return this.$store.getters.userInfo | |
| 81 | - }, | |
| 82 | - hasLogin() { | |
| 83 | - return this.$store.getters.hasLogin | |
| 84 | - }, | |
| 85 | - orderStatusList() { | |
| 86 | - let orderStatusList = [] | |
| 87 | - for (let status in orderStatus) { | |
| 88 | - if (status !== '40') { | |
| 89 | - orderStatusList.push({ name: orderStatus[status].name, status: status, icon: orderStatus[status].icon }) | |
| 90 | - } | |
| 91 | - } | |
| 92 | - return orderStatusList | |
| 93 | - } | |
| 94 | - }, | |
| 95 | - methods: { | |
| 96 | - pageRouter(pageUrl, param) { | |
| 97 | - if (!this.hasLogin) { | |
| 98 | - uni.$u.route('/pages/login/social') | |
| 99 | - } else if (pageUrl === this.orderPage) { | |
| 100 | - uni.$u.route(this.orderPage, { | |
| 101 | - status: param | |
| 102 | - }) | |
| 103 | - } else { | |
| 104 | - uni.$u.route(pageUrl) | |
| 105 | - } | |
| 106 | - }, | |
| 107 | - logout() { | |
| 108 | - uni.showModal({ | |
| 109 | - title: '提示', | |
| 110 | - content: '您确定要退出登录吗', | |
| 111 | - success: res => { | |
| 112 | - if (res.confirm) { | |
| 113 | - this.$store.dispatch('Logout') | |
| 114 | - } else if (res.cancel) { | |
| 115 | - //console.log('用户点击取消') | |
| 116 | - } | |
| 117 | - } | |
| 118 | - }) | |
| 119 | - } | |
| 120 | - } | |
| 121 | -} | |
| 122 | -</script> | |
| 123 | - | |
| 124 | -<style lang="scss" scoped> | |
| 125 | -.user-header { | |
| 126 | - background-color: #fff; | |
| 127 | - @include flex-space-between; | |
| 128 | - padding: 30rpx; | |
| 129 | - height: 200rpx; | |
| 130 | - | |
| 131 | - .user-info { | |
| 132 | - @include flex-left; | |
| 133 | - align-items: center; | |
| 134 | - | |
| 135 | - .info-text { | |
| 136 | - margin-left: 20rpx; | |
| 137 | - | |
| 138 | - .user-nickname { | |
| 139 | - font-size: 30rpx; | |
| 140 | - font-weight: 700; | |
| 141 | - line-height: 50rpx; | |
| 142 | - } | |
| 143 | - | |
| 144 | - .user-mobile { | |
| 145 | - font-size: 24rpx; | |
| 146 | - font-weight: 700; | |
| 147 | - color: #939393; | |
| 148 | - line-height: 50rpx; | |
| 149 | - } | |
| 150 | - } | |
| 151 | - } | |
| 152 | - | |
| 153 | - .user-setting { | |
| 154 | - margin-right: 5rpx; | |
| 155 | - } | |
| 156 | -} | |
| 157 | - | |
| 158 | -.order-header { | |
| 159 | - @include flex-space-between; | |
| 160 | - padding: 20rpx 30rpx; | |
| 161 | - border-bottom: $custom-border-style; | |
| 162 | - | |
| 163 | - .order-title { | |
| 164 | - color: #333333; | |
| 165 | - font-size: 34rpx; | |
| 166 | - } | |
| 167 | - | |
| 168 | - .see-all { | |
| 169 | - height: 40rpx; | |
| 170 | - @include flex-right; | |
| 171 | - color: #666666; | |
| 172 | - font-size: 26rpx; | |
| 173 | - } | |
| 174 | -} | |
| 175 | - | |
| 176 | -.order-status-box { | |
| 177 | - padding: 40rpx 0; | |
| 178 | -} | |
| 179 | - | |
| 180 | -.stat-box { | |
| 181 | - padding: 20rpx 0; | |
| 182 | -} | |
| 183 | - | |
| 184 | -.grid-title { | |
| 185 | - line-height: 50rpx; | |
| 186 | - font-size: 26rpx; | |
| 187 | -} | |
| 188 | - | |
| 189 | -.grid-value { | |
| 190 | - line-height: 50rpx; | |
| 191 | - font-size: 36rpx; | |
| 192 | - font-weight: 700; | |
| 193 | - color: #2b85e4; | |
| 194 | -} | |
| 195 | - | |
| 196 | -.fun-list { | |
| 197 | - .fun-item { | |
| 198 | - padding-top: 10rpx; | |
| 199 | - padding-bottom: 10rpx; | |
| 200 | - border-bottom: $custom-border-style; | |
| 201 | - } | |
| 202 | -} | |
| 203 | -</style> |
yudao-ui-app/sitemap.json deleted
yudao-ui-app/static/images/empty/address.png deleted
19 KB
yudao-ui-app/static/images/empty/cart.png deleted
27.9 KB
yudao-ui-app/static/images/empty/comment.png deleted
13.6 KB
yudao-ui-app/static/images/empty/coupon.png deleted
22.9 KB
yudao-ui-app/static/images/empty/data.png deleted
16.8 KB
yudao-ui-app/static/images/empty/favor.png deleted
16.3 KB
yudao-ui-app/static/images/empty/history.png deleted
26 KB
yudao-ui-app/static/images/empty/list.png deleted
17.2 KB
yudao-ui-app/static/images/empty/message.png deleted
16 KB
yudao-ui-app/static/images/empty/news.png deleted
16.3 KB
yudao-ui-app/static/images/empty/order.png deleted
15.8 KB
yudao-ui-app/static/images/empty/page.png deleted
27.6 KB
yudao-ui-app/static/images/empty/permission.png deleted
19.2 KB
yudao-ui-app/static/images/empty/search.png deleted
18.1 KB
yudao-ui-app/static/images/empty/wifi.png deleted
20.9 KB
yudao-ui-app/static/images/tabbar/cart-active.png deleted
6.16 KB
yudao-ui-app/static/images/tabbar/cart.png deleted
6.02 KB
yudao-ui-app/static/images/tabbar/category-active.png deleted
7.98 KB
yudao-ui-app/static/images/tabbar/category.png deleted
7.71 KB
yudao-ui-app/static/images/tabbar/index-active.png deleted
6.73 KB
yudao-ui-app/static/images/tabbar/index.png deleted
6.61 KB
yudao-ui-app/static/images/tabbar/user-active.png deleted
8.1 KB
yudao-ui-app/static/images/tabbar/user.png deleted
7.88 KB
yudao-ui-app/store/getters.js deleted
yudao-ui-app/store/index.js deleted
| 1 | -import Vue from 'vue' | |
| 2 | -import Vuex from 'vuex' | |
| 3 | -import user from './mudules/user' | |
| 4 | -import cart from './mudules/cart' | |
| 5 | -import getters from './getters' | |
| 6 | - | |
| 7 | -Vue.use(Vuex) // vue的插件机制 | |
| 8 | - | |
| 9 | -// Vuex.Store 构造器选项 | |
| 10 | -const store = new Vuex.Store({ | |
| 11 | - modules: { | |
| 12 | - user, | |
| 13 | - cart | |
| 14 | - }, | |
| 15 | - getters | |
| 16 | -}) | |
| 17 | -export default store |
yudao-ui-app/store/mudules/cart.js deleted
| 1 | -import { getCartDetail } from '@/api/cart' | |
| 2 | - | |
| 3 | -const cart = { | |
| 4 | - state: { | |
| 5 | - cartCount: 0 | |
| 6 | - }, | |
| 7 | - mutations: { | |
| 8 | - //记录购物车商品数量 | |
| 9 | - SET_CART_COUNT(state, data) { | |
| 10 | - const arr = data.length || [] | |
| 11 | - state.cartNumber = arr.length | |
| 12 | - } | |
| 13 | - }, | |
| 14 | - actions: { | |
| 15 | - //获取购物车数据 | |
| 16 | - CartProductDetail({ state, commit }) { | |
| 17 | - return getCartDetail() | |
| 18 | - .then(res => { | |
| 19 | - commit('SET_CART_COUNT', res.data) | |
| 20 | - return Promise.resolve(res) | |
| 21 | - }) | |
| 22 | - .catch(err => { | |
| 23 | - return Promise.reject(err) | |
| 24 | - }) | |
| 25 | - } | |
| 26 | - } | |
| 27 | -} | |
| 28 | -export default cart |
yudao-ui-app/store/mudules/user.js deleted
| 1 | -import { getUserInfo } from '@/api/user' | |
| 2 | -import { passwordLogin, smsLogin, weixinMiniAppLogin, logout } from '@/api/auth' | |
| 3 | - | |
| 4 | -const AccessTokenKey = 'ACCESS_TOKEN' | |
| 5 | -const RefreshTokenKey = 'REFRESH_TOKEN' | |
| 6 | - | |
| 7 | -const user = { | |
| 8 | - state: { | |
| 9 | - accessToken: uni.getStorageSync(AccessTokenKey), // 访问令牌 | |
| 10 | - refreshToken: uni.getStorageSync(RefreshTokenKey), // 刷新令牌 | |
| 11 | - userInfo: {} | |
| 12 | - }, | |
| 13 | - mutations: { | |
| 14 | - // 更新 state 的通用方法 | |
| 15 | - SET_STATE_ATTR(state, param) { | |
| 16 | - if (param instanceof Array) { | |
| 17 | - for (let item of param) { | |
| 18 | - state[item.key] = item.val | |
| 19 | - } | |
| 20 | - } else { | |
| 21 | - state[param.key] = param.val | |
| 22 | - } | |
| 23 | - }, | |
| 24 | - // 更新令牌 | |
| 25 | - SET_TOKEN(state, data) { | |
| 26 | - // 设置令牌 | |
| 27 | - const { accessToken, refreshToken } = data | |
| 28 | - state.accessToken = accessToken | |
| 29 | - state.refreshToken = refreshToken | |
| 30 | - uni.setStorageSync(AccessTokenKey, accessToken) | |
| 31 | - uni.setStorageSync(RefreshTokenKey, refreshToken) | |
| 32 | - | |
| 33 | - // 加载用户信息 | |
| 34 | - this.dispatch('ObtainUserInfo') | |
| 35 | - }, | |
| 36 | - // 更新用户信息 | |
| 37 | - SET_USER_INFO(state, data) { | |
| 38 | - state.userInfo = data | |
| 39 | - }, | |
| 40 | - // 清空令牌 和 用户信息 | |
| 41 | - CLEAR_LOGIN_INFO(state) { | |
| 42 | - uni.removeStorageSync(AccessTokenKey) | |
| 43 | - uni.removeStorageSync(RefreshTokenKey) | |
| 44 | - state.accessToken = '' | |
| 45 | - state.refreshToken = '' | |
| 46 | - state.userInfo = {} | |
| 47 | - } | |
| 48 | - }, | |
| 49 | - actions: { | |
| 50 | - //账号登录 | |
| 51 | - Login({ state, commit }, { type, data }) { | |
| 52 | - if (type === 0) { | |
| 53 | - return passwordLogin(data) | |
| 54 | - .then(res => { | |
| 55 | - commit('SET_TOKEN', res.data) | |
| 56 | - return Promise.resolve(res) | |
| 57 | - }) | |
| 58 | - .catch(err => { | |
| 59 | - return Promise.reject(err) | |
| 60 | - }) | |
| 61 | - } else if (type === 1) { | |
| 62 | - return smsLogin(data) | |
| 63 | - .then(res => { | |
| 64 | - commit('SET_TOKEN', res.data) | |
| 65 | - return Promise.resolve(res) | |
| 66 | - }) | |
| 67 | - .catch(err => { | |
| 68 | - return Promise.reject(err) | |
| 69 | - }) | |
| 70 | - } else { | |
| 71 | - return weixinMiniAppLogin(data) | |
| 72 | - .then(res => { | |
| 73 | - commit('SET_TOKEN', res.data) | |
| 74 | - return Promise.resolve(res) | |
| 75 | - }) | |
| 76 | - .catch(err => { | |
| 77 | - return Promise.reject(err) | |
| 78 | - }) | |
| 79 | - } | |
| 80 | - }, | |
| 81 | - // 退出登录 | |
| 82 | - Logout({ state, commit }) { | |
| 83 | - return logout() | |
| 84 | - .then(res => { | |
| 85 | - return Promise.resolve(res) | |
| 86 | - }) | |
| 87 | - .catch(err => { | |
| 88 | - return Promise.reject(err) | |
| 89 | - }) | |
| 90 | - .finally(() => { | |
| 91 | - commit('CLEAR_LOGIN_INFO') | |
| 92 | - }) | |
| 93 | - }, | |
| 94 | - // 获得用户基本信息 | |
| 95 | - async ObtainUserInfo({ state, commit }) { | |
| 96 | - const res = await getUserInfo() | |
| 97 | - commit('SET_USER_INFO', res.data) | |
| 98 | - } | |
| 99 | - } | |
| 100 | -} | |
| 101 | -export default user |
yudao-ui-app/styles/base.scss deleted
yudao-ui-app/uni.scss deleted
| 1 | -/** | |
| 2 | - * 这里是uni-app内置的常用样式变量 | |
| 3 | - * | |
| 4 | - * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 | |
| 5 | - * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App | |
| 6 | - * | |
| 7 | - */ | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 | |
| 11 | - * | |
| 12 | - * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 | |
| 13 | - */ | |
| 14 | - | |
| 15 | -/* 引入uView主题样式 */ | |
| 16 | -@import '@/uni_modules/uview-ui/theme.scss'; | |
| 17 | - | |
| 18 | -/* 全局自定义scss变量 */ | |
| 19 | - | |
| 20 | -/* 页面背景颜色 */ | |
| 21 | -$custom-bg-color: #ffffff; | |
| 22 | - | |
| 23 | -/* 边框样式 */ | |
| 24 | -$custom-border-style: 1rpx solid #f3f3f3; | |
| 25 | - | |
| 26 | - | |
| 27 | -@mixin flex-left($direction: row) { | |
| 28 | - display: flex; | |
| 29 | - flex-direction: $direction; | |
| 30 | - align-items: center; | |
| 31 | - justify-content: flex-start; | |
| 32 | -} | |
| 33 | - | |
| 34 | -@mixin flex-right($direction: row) { | |
| 35 | - display: flex; | |
| 36 | - flex-direction: $direction; | |
| 37 | - align-items: center; | |
| 38 | - justify-content: flex-end; | |
| 39 | -} | |
| 40 | - | |
| 41 | -@mixin flex-center($direction: row) { | |
| 42 | - display: flex; | |
| 43 | - flex-direction: $direction; | |
| 44 | - align-items: center; | |
| 45 | - justify-content: center; | |
| 46 | -} | |
| 47 | - | |
| 48 | -@mixin flex-space-between($direction: row) { | |
| 49 | - display: flex; | |
| 50 | - flex-direction: $direction; | |
| 51 | - align-items: center; | |
| 52 | - justify-content: space-between; | |
| 53 | -} | |
| 54 | - | |
| 55 | -@mixin flex-space-around($direction: row) { | |
| 56 | - display: flex; | |
| 57 | - flex-direction: $direction; | |
| 58 | - align-items: center; | |
| 59 | - justify-content: space-around; | |
| 60 | -} |
yudao-ui-app/uni_modules/uview-ui/LICENSE deleted
| 1 | -MIT License | |
| 2 | - | |
| 3 | -Copyright (c) 2020 www.uviewui.com | |
| 4 | - | |
| 5 | -Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 6 | -of this software and associated documentation files (the "Software"), to deal | |
| 7 | -in the Software without restriction, including without limitation the rights | |
| 8 | -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 9 | -copies of the Software, and to permit persons to whom the Software is | |
| 10 | -furnished to do so, subject to the following conditions: | |
| 11 | - | |
| 12 | -The above copyright notice and this permission notice shall be included in all | |
| 13 | -copies or substantial portions of the Software. | |
| 14 | - | |
| 15 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 16 | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 17 | -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 18 | -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 19 | -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 20 | -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 21 | -SOFTWARE. | |
| 22 | 0 | \ No newline at end of file |
yudao-ui-app/uni_modules/uview-ui/README.md deleted
| 1 | -<p align="center"> | |
| 2 | - <img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;"> | |
| 3 | -</p> | |
| 4 | -<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView 2.0</h3> | |
| 5 | -<h3 align="center">多平台快速开发的UI框架</h3> | |
| 6 | - | |
| 7 | -[](https://github.com/umicro/uView2.0) | |
| 8 | -[](https://github.com/umicro/uView2.0) | |
| 9 | -[](https://github.com/umicro/uView2.0/issues) | |
| 10 | -[](https://uviewui.com) | |
| 11 | -[](https://gitee.com/umicro/uView2.0/releases) | |
| 12 | -[](https://en.wikipedia.org/wiki/MIT_License) | |
| 13 | - | |
| 14 | -## 说明 | |
| 15 | - | |
| 16 | -uView UI,是[uni-app](https://uniapp.dcloud.io/)全面兼容nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 | |
| 17 | - | |
| 18 | -## [官方文档:https://uviewui.com](https://uviewui.com) | |
| 19 | - | |
| 20 | - | |
| 21 | -## 预览 | |
| 22 | - | |
| 23 | -您可以通过**微信**扫码,查看最佳的演示效果。 | |
| 24 | -<br> | |
| 25 | -<br> | |
| 26 | -<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" > | |
| 27 | - | |
| 28 | - | |
| 29 | -## 链接 | |
| 30 | - | |
| 31 | -- [官方文档](https://www.uviewui.com/) | |
| 32 | -- [更新日志](https://www.uviewui.com/components/changelog.html) | |
| 33 | -- [升级指南](https://www.uviewui.com/components/changeGuide.html) | |
| 34 | -- [关于我们](https://www.uviewui.com/cooperation/about.html) | |
| 35 | - | |
| 36 | -## 交流反馈 | |
| 37 | - | |
| 38 | -欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html) | |
| 39 | - | |
| 40 | -## 关于PR | |
| 41 | - | |
| 42 | -> 我们非常乐意接受各位的优质PR,但在此之前我希望您了解uView2.0是一个需要兼容多个平台的(小程序、h5、ios app、android app)包括nvue页面、vue页面。 | |
| 43 | -> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢! | |
| 44 | - | |
| 45 | -## 安装 | |
| 46 | - | |
| 47 | -#### **uni-app插件市场链接** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593) | |
| 48 | - | |
| 49 | -请通过[官网安装文档](https://www.uviewui.com/components/install.html)了解更详细的内容 | |
| 50 | - | |
| 51 | -## 快速上手 | |
| 52 | - | |
| 53 | -请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 | |
| 54 | - | |
| 55 | -## 使用方法 | |
| 56 | -配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 | |
| 57 | - | |
| 58 | -```html | |
| 59 | -<template> | |
| 60 | - <u-button text="按钮"></u-button> | |
| 61 | -</template> | |
| 62 | -``` | |
| 63 | - | |
| 64 | -## 版权信息 | |
| 65 | -uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。 | |
| 66 | - |
yudao-ui-app/uni_modules/uview-ui/changelog.md deleted
| 1 | -## 2.0.34(2022-09-25) | |
| 2 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 3 | - | |
| 4 | -1. `u-input`、`u-textarea`增加`ignoreCompositionEvent`属性 | |
| 5 | -2. 修复`route`方法调用可能报错的问题 | |
| 6 | -3. 修复`u-no-network`组件`z-index`无效的问题 | |
| 7 | -4. 修复`textarea`组件在h5上confirmType=""报错的问题 | |
| 8 | -5. `u-rate`适配`nvue` | |
| 9 | -6. 优化验证手机号码的正则表达式(根据工信部发布的《电信网编号计划(2017年版)》进行修改。) | |
| 10 | -7. `form-item`添加`labelPosition`属性 | |
| 11 | -8. `u-calendar`修复`maxDate`设置为当前日期,并且当前时间大于08:00时无法显示日期列表的问题 (#724) | |
| 12 | -9. `u-radio`增加一个默认插槽用于自定义修改label内容 (#680) | |
| 13 | -10. 修复`timeFormat`函数在safari重的兼容性问题 (#664) | |
| 14 | -## 2.0.33(2022-06-17) | |
| 15 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 16 | - | |
| 17 | -1. 修复`loadmore`组件`lineColor`类型错误问题 | |
| 18 | -2. 修复`u-parse`组件`imgtap`、`linktap`不生效问题 | |
| 19 | -## 2.0.32(2022-06-16) | |
| 20 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 21 | -1. `u-loadmore`新增自定义颜色、虚/实线 | |
| 22 | -2. 修复`u-swiper-action`组件部分平台不能上下滑动的问题 | |
| 23 | -3. 修复`u-list`回弹问题 | |
| 24 | -4. 修复`notice-bar`组件动画在低端安卓机可能会抖动的问题 | |
| 25 | -5. `u-loading-page`添加控制图标大小的属性`iconSize` | |
| 26 | -6. 修复`u-tooltip`组件`color`参数不生效的问题 | |
| 27 | -7. 修复`u--input`组件使用`blur`事件输出为`undefined`的bug | |
| 28 | -8. `u-code-input`组件新增键盘弹起时,是否自动上推页面参数`adjustPosition` | |
| 29 | -9. 修复`image`组件`load`事件无回调对象问题 | |
| 30 | -10. 修复`button`组件`loadingSize`设置无效问题 | |
| 31 | -10. 其他修复 | |
| 32 | -## 2.0.31(2022-04-19) | |
| 33 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 34 | - | |
| 35 | -1. 修复`upload`在`vue`页面上传成功后没有成功标志的问题 | |
| 36 | -2. 解决演示项目中微信小程序模拟上传图片一直出于上传中问题 | |
| 37 | -3. 修复`u-code-input`组件在`nvue`页面编译到`app`平台上光标异常问题(`app`去除此功能) | |
| 38 | -4. 修复`actionSheet`组件标题关闭按钮点击事件名称错误的问题 | |
| 39 | -5. 其他修复 | |
| 40 | -## 2.0.30(2022-04-04) | |
| 41 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 42 | - | |
| 43 | -1. `u-rate`增加`readonly`属性 | |
| 44 | -2. `tabs`滑块支持设置背景图片 | |
| 45 | -3. 修复`u-subsection` `mode`为`subsection`时,滑块样式不正确的问题 | |
| 46 | -4. `u-code-input`添加光标效果动画 | |
| 47 | -5. 修复`popup`的`open`事件不触发 | |
| 48 | -6. 修复`u-flex-column`无效的问题 | |
| 49 | -7. 修复`u-datetime-picker`索引在特定场合异常问题 | |
| 50 | -8. 修复`u-datetime-picker`最小时间字符串模板错误问题 | |
| 51 | -9. `u-swiper`添加`m3u8`验证 | |
| 52 | -10. `u-swiper`修改判断image和video逻辑 | |
| 53 | -11. 修复`swiper`无法使用本地图片问题,增加`type`参数 | |
| 54 | -12. 修复`u-row-notice`格式错误问题 | |
| 55 | -13. 修复`u-switch`组件当`unit`为`rpx`时,`nodeStyle`消失的问题 | |
| 56 | -14. 修复`datetime-picker`组件`showToolbar`与`visibleItemCount`属性无效的问题 | |
| 57 | -15. 修复`upload`组件条件编译位置判断错误,导致`previewImage`属性设置为`false`时,整个组件都会被隐藏的问题 | |
| 58 | -16. 修复`u-checkbox-group`设置`shape`属性无效的问题 | |
| 59 | -17. 修复`u-upload`的`capture`传入字符串的时候不生效的问题 | |
| 60 | -18. 修复`u-action-sheet`组件,关闭事件逻辑错误的问题 | |
| 61 | -19. 修复`u-list`触顶事件的触发错误的问题 | |
| 62 | -20. 修复`u-text`只有手机号可拨打的问题 | |
| 63 | -21. 修复`u-textarea`不能换行的问题 | |
| 64 | -22. 其他修复 | |
| 65 | -## 2.0.29(2022-03-13) | |
| 66 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 67 | - | |
| 68 | -1. 修复`u--text`组件设置`decoration`属性未生效的问题 | |
| 69 | -2. 修复`u-datetime-picker`使用`formatter`后返回值不正确 | |
| 70 | -3. 修复`u-datetime-picker` `intercept` 可能为undefined | |
| 71 | -4. 修复已设置单位 uni..config.unit = 'rpx'时,线型指示器 `transform` 的位置翻倍,导致指示器超出宽度 | |
| 72 | -5. 修复mixin中bem方法生成的类名在支付宝和字节小程序中失效 | |
| 73 | -6. 修复默认值传值为空的时候,打开`u-datetime-picker`报错,不能选中第一列时间的bug | |
| 74 | -7. 修复`u-datetime-picker`使用`formatter`后返回值不正确 | |
| 75 | -8. 修复`u-image`组件`loading`无效果的问题 | |
| 76 | -9. 修复`config.unit`属性设为`rpx`时,导航栏占用高度不足导致塌陷的问题 | |
| 77 | -10. 修复`u-datetime-picker`组件`itemHeight`无效问题 | |
| 78 | -11. 其他修复 | |
| 79 | -## 2.0.28(2022-02-22) | |
| 80 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 81 | - | |
| 82 | -1. search组件新增searchIconSize属性 | |
| 83 | -2. 兼容Safari/Webkit中传入时间格式如2022-02-17 12:00:56 | |
| 84 | -3. 修复text value.js 判断日期出format错误问题 | |
| 85 | -4. priceFormat格式化金额出现精度错误 | |
| 86 | -5. priceFormat在部分情况下出现精度损失问题 | |
| 87 | -6. 优化表单rules提示 | |
| 88 | -7. 修复avatar组件src为空时,展示状态不对 | |
| 89 | -8. 其他修复 | |
| 90 | -## 2.0.27(2022-01-28) | |
| 91 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 92 | - | |
| 93 | -1.样式修复 | |
| 94 | -## 2.0.26(2022-01-28) | |
| 95 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 96 | - | |
| 97 | -1.样式修复 | |
| 98 | -## 2.0.25(2022-01-27) | |
| 99 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 100 | - | |
| 101 | -1. 修复text组件mode=price时,可能会导致精度错误的问题 | |
| 102 | -2. 添加$u.setConfig()方法,可设置uView内置的config, props, zIndex, color属性,详见:[修改uView内置配置方案](https://uviewui.com/components/setting.html#%E9%BB%98%E8%AE%A4%E5%8D%95%E4%BD%8D%E9%85%8D%E7%BD%AE) | |
| 103 | -3. 优化form组件在errorType=toast时,如果输入错误页面会有抖动的问题 | |
| 104 | -4. 修复$u.addUnit()对配置默认单位可能无效的问题 | |
| 105 | -## 2.0.24(2022-01-25) | |
| 106 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 107 | - | |
| 108 | -1. 修复swiper在current指定非0时缩放有误 | |
| 109 | -2. 修复u-icon添加stop属性的时候报错 | |
| 110 | -3. 优化遗留的通过正则判断rpx单位的问题 | |
| 111 | -4. 优化Layout布局 vue使用gutter时,会超出固定区域 | |
| 112 | -5. 优化search组件高度单位问题(rpx -> px) | |
| 113 | -6. 修复u-image slot 加载和错误的图片失去了高度 | |
| 114 | -7. 修复u-index-list中footer插槽与header插槽存在性判断错误 | |
| 115 | -8. 修复部分机型下u-popup关闭时会闪烁 | |
| 116 | -9. 修复u-image在nvue-app下失去宽高 | |
| 117 | -10. 修复u-popup运行报错 | |
| 118 | -11. 修复u-tooltip报错 | |
| 119 | -12. 修复box-sizing在app下的警告 | |
| 120 | -13. 修复u-navbar在小程序中报运行时错误 | |
| 121 | -14. 其他修复 | |
| 122 | -## 2.0.23(2022-01-24) | |
| 123 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 124 | - | |
| 125 | -1. 修复image组件在hx3.3.9的nvue下可能会显示异常的问题 | |
| 126 | -2. 修复col组件gutter参数带rpx单位处理不正确的问题 | |
| 127 | -3. 修复text组件单行时无法显示省略号的问题 | |
| 128 | -4. navbar添加titleStyle参数 | |
| 129 | -5. 升级到hx3.3.9可消除nvue下控制台样式警告的问题 | |
| 130 | -## 2.0.22(2022-01-19) | |
| 131 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 132 | - | |
| 133 | -1. $u.page()方法优化,避免在特殊场景可能报错的问题 | |
| 134 | -2. picker组件添加immediateChange参数 | |
| 135 | -3. 新增$u.pages()方法 | |
| 136 | -## 2.0.21(2022-01-19) | |
| 137 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 138 | - | |
| 139 | -1. 优化:form组件在用户设置rules的时候提示用户model必传 | |
| 140 | -2. 优化遗留的通过正则判断rpx单位的问题 | |
| 141 | -3. 修复微信小程序环境中tabbar组件开启safeAreaInsetBottom属性后,placeholder高度填充不正确 | |
| 142 | -4. 修复swiper在current指定非0时缩放有误 | |
| 143 | -5. 修复u-icon添加stop属性的时候报错 | |
| 144 | -6. 修复upload组件在accept=all的时候没有作用 | |
| 145 | -7. 修复在text组件mode为phone时call属性无效的问题 | |
| 146 | -8. 处理u-form clearValidate方法 | |
| 147 | -9. 其他修复 | |
| 148 | -## 2.0.20(2022-01-14) | |
| 149 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 150 | - | |
| 151 | -1. 修复calendar默认会选择一个日期,如果直接点确定的话,无法取到值的问题 | |
| 152 | -2. 修复Slider缺少disabled props 还有注释 | |
| 153 | -3. 修复u-notice-bar点击事件无法拿到index索引值的问题 | |
| 154 | -4. 修复u-collapse-item在vue文件下,app端自定义插槽不生效的问题 | |
| 155 | -5. 优化头像为空时显示默认头像 | |
| 156 | -6. 修复图片地址赋值后判断加载状态为完成问题 | |
| 157 | -7. 修复日历滚动到默认日期月份区域 | |
| 158 | -8. search组件暴露点击左边icon事件 | |
| 159 | -9. 修复u-form clearValidate方法不生效 | |
| 160 | -10. upload h5端增加返回文件参数(文件的name参数) | |
| 161 | -11. 处理upload选择文件后url为blob类型无法预览的问题 | |
| 162 | -12. u-code-input 修复输入框没有往左移出一半屏幕 | |
| 163 | -13. 修复Upload上传 disabled为true时,控制台报hoverClass类型错误 | |
| 164 | -14. 临时处理ios app下grid点击坍塌问题 | |
| 165 | -15. 其他修复 | |
| 166 | -## 2.0.19(2021-12-29) | |
| 167 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 168 | - | |
| 169 | -1. 优化微信小程序包体积可在微信中预览,请升级HbuilderX3.3.4,同时在“运行->运行到小程序模拟器”中勾选“运行时是否压缩代码” | |
| 170 | -2. 优化微信小程序setData性能,处理某些方法如$u.route()无法在模板中使用的问题 | |
| 171 | -3. navbar添加autoBack参数 | |
| 172 | -4. 允许avatar组件的事件冒泡 | |
| 173 | -5. 修复cell组件报错问题 | |
| 174 | -6. 其他修复 | |
| 175 | -## 2.0.18(2021-12-28) | |
| 176 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 177 | - | |
| 178 | -1. 修复app端编译报错问题 | |
| 179 | -2. 重新处理微信小程序端setData过大的性能问题 | |
| 180 | -3. 修复边框问题 | |
| 181 | -4. 修复最大最小月份不大于0则没有数据出现的问题 | |
| 182 | -5. 修复SwipeAction微信小程序端无法上下滑动问题 | |
| 183 | -6. 修复input的placeholder在小程序端默认显示为true问题 | |
| 184 | -7. 修复divider组件click事件无效问题 | |
| 185 | -8. 修复u-code-input maxlength 属性值为 String 类型时显示异常 | |
| 186 | -9. 修复当 grid只有 1到2时 在小程序端algin设置无效的问题 | |
| 187 | -10. 处理form-item的label为top时,取消错误提示的左边距 | |
| 188 | -11. 其他修复 | |
| 189 | -## 2.0.17(2021-12-26) | |
| 190 | -## uView正在参与开源中国的“年度最佳项目”评选,之前投过票的现在也可以投票,恳请同学们投一票,[点此帮助uView](https://www.oschina.net/project/top_cn_2021/?id=583) | |
| 191 | - | |
| 192 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 193 | - | |
| 194 | -1. 解决HBuilderX3.3.3.20211225版本导致的样式问题 | |
| 195 | -2. calendar日历添加monthNum参数 | |
| 196 | -3. navbar添加center slot | |
| 197 | -## 2.0.16(2021-12-25) | |
| 198 | -## uView正在参与开源中国的“年度最佳项目”评选,之前投过票的现在也可以投票,恳请同学们投一票,[点此帮助uView](https://www.oschina.net/project/top_cn_2021/?id=583) | |
| 199 | - | |
| 200 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 201 | - | |
| 202 | -1. 解决微信小程序setData性能问题 | |
| 203 | -2. 修复count-down组件change事件不触发问题 | |
| 204 | -## 2.0.15(2021-12-21) | |
| 205 | -## uView正在参与开源中国的“年度最佳项目”评选,之前投过票的现在也可以投票,恳请同学们投一票,[点此帮助uView](https://www.oschina.net/project/top_cn_2021/?id=583) | |
| 206 | - | |
| 207 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 208 | - | |
| 209 | -1. 修复Cell单元格titleWidth无效 | |
| 210 | -2. 修复cheakbox组件ischecked不更新 | |
| 211 | -3. 修复keyboard是否显示"."按键默认值问题 | |
| 212 | -4. 修复number-keyboard是否显示键盘的"."符号问题 | |
| 213 | -5. 修复Input输入框 readonly无效 | |
| 214 | -6. 修复u-avatar 导致打包app、H5时候报错问题 | |
| 215 | -7. 修复Upload上传deletable无效 | |
| 216 | -8. 修复upload当设置maxSize时无效的问题 | |
| 217 | -9. 修复tabs lineWidth传入带单位的字符串的时候偏移量计算错误问题 | |
| 218 | -10. 修复rate组件在有padding的view内,显示的星星位置和可触摸区域不匹配,无法正常选中星星 | |
| 219 | -## 2.0.13(2021-12-14) | |
| 220 | -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) | |
| 221 | - | |
| 222 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 223 | - | |
| 224 | -1. 修复配置默认单位为rpx可能会导致自定义导航栏高度异常的问题 | |
| 225 | -## 2.0.12(2021-12-14) | |
| 226 | -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) | |
| 227 | - | |
| 228 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 229 | - | |
| 230 | -1. 修复tabs组件在vue环境下划线消失的问题 | |
| 231 | -2. 修复upload组件在安卓小程序无法选择视频的问题 | |
| 232 | -3. 添加uni.$u.config.unit配置,用于配置参数默认单位,详见:[默认单位配置](https://www.uviewui.com/components/setting.html#%E9%BB%98%E8%AE%A4%E5%8D%95%E4%BD%8D%E9%85%8D%E7%BD%AE) | |
| 233 | -4. 修复textarea组件在没绑定v-model时,字符统计不生效问题 | |
| 234 | -5. 修复nvue下控制是否出现滚动条失效问题 | |
| 235 | -## 2.0.11(2021-12-13) | |
| 236 | -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) | |
| 237 | - | |
| 238 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 239 | - | |
| 240 | -1. text组件align参数无效的问题 | |
| 241 | -2. subsection组件添加keyName参数 | |
| 242 | -3. upload组件无法判断[Object file]类型的问题 | |
| 243 | -4. 处理notify层级过低问题 | |
| 244 | -5. codeInput组件添加disabledDot参数 | |
| 245 | -6. 处理actionSheet组件round参数无效的问题 | |
| 246 | -7. calendar组件添加round参数用于控制圆角值 | |
| 247 | -8. 处理swipeAction组件在vue环境下默认被打开的问题 | |
| 248 | -9. button组件的throttleTime节流参数无效的问题 | |
| 249 | -10. 解决u-notify手动关闭方法close()无效的问题 | |
| 250 | -11. input组件readonly不生效问题 | |
| 251 | -12. tag组件type参数为info不生效问题 | |
| 252 | -## 2.0.10(2021-12-08) | |
| 253 | -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) | |
| 254 | - | |
| 255 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 256 | - | |
| 257 | -1. 修复button sendMessagePath属性不生效 | |
| 258 | -2. 修复DatetimePicker选择器title无效 | |
| 259 | -3. 修复u-toast设置loading=true不生效 | |
| 260 | -4. 修复u-text金额模式传0报错 | |
| 261 | -5. 修复u-toast组件的icon属性配置不生效 | |
| 262 | -6. button的icon在特殊场景下的颜色优化 | |
| 263 | -7. IndexList优化,增加# | |
| 264 | -## 2.0.9(2021-12-01) | |
| 265 | -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 266 | - | |
| 267 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 268 | - | |
| 269 | -1. 优化swiper的height支持100%值(仅vue有效),修复嵌入视频时click事件无法触发的问题 | |
| 270 | -2. 优化tabs组件对list值为空的判断,或者动态变化list时重新计算相关尺寸的问题 | |
| 271 | -3. 优化datetime-picker组件逻辑,让其后续打开的默认值为上一次的选中值,需要通过v-model绑定值才有效 | |
| 272 | -4. 修复upload内嵌在其他组件中,选择图片可能不会换行的问题 | |
| 273 | -## 2.0.8(2021-12-01) | |
| 274 | -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 275 | - | |
| 276 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 277 | - | |
| 278 | -1. 修复toast的position参数无效问题 | |
| 279 | -2. 处理input在ios nvue上无法获得焦点的问题 | |
| 280 | -3. avatar-group组件添加extraValue参数,让剩余展示数量可手动控制 | |
| 281 | -4. tabs组件添加keyName参数用于配置从对象中读取的键名 | |
| 282 | -5. 处理text组件名字脱敏默认配置无效的问题 | |
| 283 | -6. 处理picker组件item文本太长换行问题 | |
| 284 | -## 2.0.7(2021-11-30) | |
| 285 | -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 286 | - | |
| 287 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 288 | - | |
| 289 | -1. 修复radio和checkbox动态改变v-model无效的问题。 | |
| 290 | -2. 优化form规则validator在微信小程序用法 | |
| 291 | -3. 修复backtop组件mode参数在微信小程序无效的问题 | |
| 292 | -4. 处理Album的previewFullImage属性无效的问题 | |
| 293 | -5. 处理u-datetime-picker组件mode='time'在选择改变时间时,控制台报错的问题 | |
| 294 | -## 2.0.6(2021-11-27) | |
| 295 | -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 296 | - | |
| 297 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 298 | - | |
| 299 | -1. 处理tag组件在vue下边框无效的问题。 | |
| 300 | -2. 处理popup组件圆角参数可能无效的问题。 | |
| 301 | -3. 处理tabs组件lineColor参数可能无效的问题。 | |
| 302 | -4. propgress组件在值很小时,显示异常的问题。 | |
| 303 | -## 2.0.5(2021-11-25) | |
| 304 | -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 305 | - | |
| 306 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 307 | - | |
| 308 | -1. calendar在vue下显示异常问题。 | |
| 309 | -2. form组件labelPosition和errorType参数无效的问题 | |
| 310 | -3. input组件inputAlign无效的问题 | |
| 311 | -4. 其他一些修复 | |
| 312 | -## 2.0.4(2021-11-23) | |
| 313 | -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 314 | - | |
| 315 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 316 | - | |
| 317 | -0. input组件缺失@confirm事件,以及subfix和prefix无效问题 | |
| 318 | -1. component.scss文件样式在vue下干扰全局布局问题 | |
| 319 | -2. 修复subsection在vue环境下表现异常的问题 | |
| 320 | -3. tag组件的bgColor等参数无效的问题 | |
| 321 | -4. upload组件不换行的问题 | |
| 322 | -5. 其他的一些修复处理 | |
| 323 | -## 2.0.3(2021-11-16) | |
| 324 | -## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 325 | - | |
| 326 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 327 | - | |
| 328 | -1. uView2.0已实现全面兼容nvue | |
| 329 | -2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升 | |
| 330 | -3. 目前uView2.0为公测阶段,相关细节可能会有变动 | |
| 331 | -4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html) | |
| 332 | -5. 处理modal的confirm回调事件拼写错误问题 | |
| 333 | -6. 处理input组件@input事件参数错误问题 | |
| 334 | -7. 其他一些修复 | |
| 335 | -## 2.0.2(2021-11-16) | |
| 336 | -## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 337 | - | |
| 338 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 339 | - | |
| 340 | -1. uView2.0已实现全面兼容nvue | |
| 341 | -2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升 | |
| 342 | -3. 目前uView2.0为公测阶段,相关细节可能会有变动 | |
| 343 | -4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html) | |
| 344 | -5. 修复input组件formatter参数缺失问题 | |
| 345 | -6. 优化loading-icon组件的scss写法问题,防止不兼容新版本scss | |
| 346 | -## 2.0.0(2020-11-15) | |
| 347 | -## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU) | |
| 348 | - | |
| 349 | -# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 350 | - | |
| 351 | -1. uView2.0已实现全面兼容nvue | |
| 352 | -2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升 | |
| 353 | -3. 目前uView2.0为公测阶段,相关细节可能会有变动 | |
| 354 | -4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html) | |
| 355 | -5. 修复input组件formatter参数缺失问题 | |
| 356 | - | |
| 357 | - |
yudao-ui-app/uni_modules/uview-ui/components/u--form/u--form.vue deleted
| 1 | -<template> | |
| 2 | - <uvForm | |
| 3 | - ref="uForm" | |
| 4 | - :model="model" | |
| 5 | - :rules="rules" | |
| 6 | - :errorType="errorType" | |
| 7 | - :borderBottom="borderBottom" | |
| 8 | - :labelPosition="labelPosition" | |
| 9 | - :labelWidth="labelWidth" | |
| 10 | - :labelAlign="labelAlign" | |
| 11 | - :labelStyle="labelStyle" | |
| 12 | - :customStyle="customStyle" | |
| 13 | - > | |
| 14 | - <slot /> | |
| 15 | - </uvForm> | |
| 16 | -</template> | |
| 17 | - | |
| 18 | -<script> | |
| 19 | - /** | |
| 20 | - * 此组件存在的理由是,在nvue下,u-form被uni-app官方占用了,u-form在nvue中相当于form组件 | |
| 21 | - * 所以在nvue下,取名为u--form,内部其实还是u-form.vue,只不过做一层中转 | |
| 22 | - */ | |
| 23 | - import uvForm from '../u-form/u-form.vue'; | |
| 24 | - import props from '../u-form/props.js' | |
| 25 | - export default { | |
| 26 | - // #ifdef MP-WEIXIN | |
| 27 | - name: 'u-form', | |
| 28 | - // #endif | |
| 29 | - // #ifndef MP-WEIXIN | |
| 30 | - name: 'u--form', | |
| 31 | - // #endif | |
| 32 | - mixins: [uni.$u.mpMixin, props, uni.$u.mixin], | |
| 33 | - components: { | |
| 34 | - uvForm | |
| 35 | - }, | |
| 36 | - created() { | |
| 37 | - this.children = [] | |
| 38 | - }, | |
| 39 | - methods: { | |
| 40 | - // 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则 | |
| 41 | - setRules(rules) { | |
| 42 | - this.$refs.uForm.setRules(rules) | |
| 43 | - }, | |
| 44 | - validate() { | |
| 45 | - /** | |
| 46 | - * 在微信小程序中,通过this.$parent拿到的父组件是u--form,而不是其内嵌的u-form | |
| 47 | - * 导致在u-form组件中,拿不到对应的children数组,从而校验无效,所以这里每次调用u-form组件中的 | |
| 48 | - * 对应方法的时候,在小程序中都先将u--form的children赋值给u-form中的children | |
| 49 | - */ | |
| 50 | - // #ifdef MP-WEIXIN | |
| 51 | - this.setMpData() | |
| 52 | - // #endif | |
| 53 | - return this.$refs.uForm.validate() | |
| 54 | - }, | |
| 55 | - validateField(value, callback) { | |
| 56 | - // #ifdef MP-WEIXIN | |
| 57 | - this.setMpData() | |
| 58 | - // #endif | |
| 59 | - return this.$refs.uForm.validateField(value, callback) | |
| 60 | - }, | |
| 61 | - resetFields() { | |
| 62 | - // #ifdef MP-WEIXIN | |
| 63 | - this.setMpData() | |
| 64 | - // #endif | |
| 65 | - return this.$refs.uForm.resetFields() | |
| 66 | - }, | |
| 67 | - clearValidate(props) { | |
| 68 | - // #ifdef MP-WEIXIN | |
| 69 | - this.setMpData() | |
| 70 | - // #endif | |
| 71 | - return this.$refs.uForm.clearValidate(props) | |
| 72 | - }, | |
| 73 | - setMpData() { | |
| 74 | - this.$refs.uForm.children = this.children | |
| 75 | - } | |
| 76 | - }, | |
| 77 | - } | |
| 78 | -</script> |
yudao-ui-app/uni_modules/uview-ui/components/u--image/u--image.vue deleted
| 1 | -<template> | |
| 2 | - <uvImage | |
| 3 | - :src="src" | |
| 4 | - :mode="mode" | |
| 5 | - :width="width" | |
| 6 | - :height="height" | |
| 7 | - :shape="shape" | |
| 8 | - :radius="radius" | |
| 9 | - :lazyLoad="lazyLoad" | |
| 10 | - :showMenuByLongpress="showMenuByLongpress" | |
| 11 | - :loadingIcon="loadingIcon" | |
| 12 | - :errorIcon="errorIcon" | |
| 13 | - :showLoading="showLoading" | |
| 14 | - :showError="showError" | |
| 15 | - :fade="fade" | |
| 16 | - :webp="webp" | |
| 17 | - :duration="duration" | |
| 18 | - :bgColor="bgColor" | |
| 19 | - :customStyle="customStyle" | |
| 20 | - @click="$emit('click')" | |
| 21 | - @error="$emit('error')" | |
| 22 | - @load="$emit('load')" | |
| 23 | - > | |
| 24 | - <template v-slot:loading> | |
| 25 | - <slot name="loading"></slot> | |
| 26 | - </template> | |
| 27 | - <template v-slot:error> | |
| 28 | - <slot name="error"></slot> | |
| 29 | - </template> | |
| 30 | - </uvImage> | |
| 31 | -</template> | |
| 32 | - | |
| 33 | -<script> | |
| 34 | - /** | |
| 35 | - * 此组件存在的理由是,在nvue下,u-image被uni-app官方占用了,u-image在nvue中相当于image组件 | |
| 36 | - * 所以在nvue下,取名为u--image,内部其实还是u-iamge.vue,只不过做一层中转 | |
| 37 | - */ | |
| 38 | - import uvImage from '../u-image/u-image.vue'; | |
| 39 | - import props from '../u-image/props.js'; | |
| 40 | - export default { | |
| 41 | - name: 'u--image', | |
| 42 | - mixins: [uni.$u.mpMixin, props, uni.$u.mixin], | |
| 43 | - components: { | |
| 44 | - uvImage | |
| 45 | - }, | |
| 46 | - } | |
| 47 | -</script> | |
| 48 | 0 | \ No newline at end of file |
yudao-ui-app/uni_modules/uview-ui/components/u--input/u--input.vue deleted
| 1 | -<template> | |
| 2 | - <uvInput | |
| 3 | - :value="value" | |
| 4 | - :type="type" | |
| 5 | - :fixed="fixed" | |
| 6 | - :disabled="disabled" | |
| 7 | - :disabledColor="disabledColor" | |
| 8 | - :clearable="clearable" | |
| 9 | - :password="password" | |
| 10 | - :maxlength="maxlength" | |
| 11 | - :placeholder="placeholder" | |
| 12 | - :placeholderClass="placeholderClass" | |
| 13 | - :placeholderStyle="placeholderStyle" | |
| 14 | - :showWordLimit="showWordLimit" | |
| 15 | - :confirmType="confirmType" | |
| 16 | - :confirmHold="confirmHold" | |
| 17 | - :holdKeyboard="holdKeyboard" | |
| 18 | - :focus="focus" | |
| 19 | - :autoBlur="autoBlur" | |
| 20 | - :disableDefaultPadding="disableDefaultPadding" | |
| 21 | - :cursor="cursor" | |
| 22 | - :cursorSpacing="cursorSpacing" | |
| 23 | - :selectionStart="selectionStart" | |
| 24 | - :selectionEnd="selectionEnd" | |
| 25 | - :adjustPosition="adjustPosition" | |
| 26 | - :inputAlign="inputAlign" | |
| 27 | - :fontSize="fontSize" | |
| 28 | - :color="color" | |
| 29 | - :prefixIcon="prefixIcon" | |
| 30 | - :suffixIcon="suffixIcon" | |
| 31 | - :suffixIconStyle="suffixIconStyle" | |
| 32 | - :prefixIconStyle="prefixIconStyle" | |
| 33 | - :border="border" | |
| 34 | - :readonly="readonly" | |
| 35 | - :shape="shape" | |
| 36 | - :customStyle="customStyle" | |
| 37 | - :formatter="formatter" | |
| 38 | - :ignoreCompositionEvent="ignoreCompositionEvent" | |
| 39 | - @focus="$emit('focus')" | |
| 40 | - @blur="e => $emit('blur', e)" | |
| 41 | - @keyboardheightchange="$emit('keyboardheightchange')" | |
| 42 | - @change="e => $emit('change', e)" | |
| 43 | - @input="e => $emit('input', e)" | |
| 44 | - @confirm="e => $emit('confirm', e)" | |
| 45 | - @clear="$emit('clear')" | |
| 46 | - @click="$emit('click')" | |
| 47 | - > | |
| 48 | - <!-- #ifdef MP --> | |
| 49 | - <slot name="prefix"></slot> | |
| 50 | - <slot name="suffix"></slot> | |
| 51 | - <!-- #endif --> | |
| 52 | - <!-- #ifndef MP --> | |
| 53 | - <slot name="prefix" slot="prefix"></slot> | |
| 54 | - <slot name="suffix" slot="suffix"></slot> | |
| 55 | - <!-- #endif --> | |
| 56 | - </uvInput> | |
| 57 | -</template> | |
| 58 | - | |
| 59 | -<script> | |
| 60 | - /** | |
| 61 | - * 此组件存在的理由是,在nvue下,u-input被uni-app官方占用了,u-input在nvue中相当于input组件 | |
| 62 | - * 所以在nvue下,取名为u--input,内部其实还是u-input.vue,只不过做一层中转 | |
| 63 | - */ | |
| 64 | - import uvInput from '../u-input/u-input.vue'; | |
| 65 | - import props from '../u-input/props.js' | |
| 66 | - export default { | |
| 67 | - name: 'u--input', | |
| 68 | - mixins: [uni.$u.mpMixin, props, uni.$u.mixin], | |
| 69 | - components: { | |
| 70 | - uvInput | |
| 71 | - }, | |
| 72 | - } | |
| 73 | -</script> | |
| 74 | 0 | \ No newline at end of file |
yudao-ui-app/uni_modules/uview-ui/components/u--text/u--text.vue deleted
| 1 | -<template> | |
| 2 | - <uvText | |
| 3 | - :type="type" | |
| 4 | - :show="show" | |
| 5 | - :text="text" | |
| 6 | - :prefixIcon="prefixIcon" | |
| 7 | - :suffixIcon="suffixIcon" | |
| 8 | - :mode="mode" | |
| 9 | - :href="href" | |
| 10 | - :format="format" | |
| 11 | - :call="call" | |
| 12 | - :openType="openType" | |
| 13 | - :bold="bold" | |
| 14 | - :block="block" | |
| 15 | - :lines="lines" | |
| 16 | - :color="color" | |
| 17 | - :decoration="decoration" | |
| 18 | - :size="size" | |
| 19 | - :iconStyle="iconStyle" | |
| 20 | - :margin="margin" | |
| 21 | - :lineHeight="lineHeight" | |
| 22 | - :align="align" | |
| 23 | - :wordWrap="wordWrap" | |
| 24 | - :customStyle="customStyle" | |
| 25 | - @click="$emit('click')" | |
| 26 | - ></uvText> | |
| 27 | -</template> | |
| 28 | - | |
| 29 | -<script> | |
| 30 | -/** | |
| 31 | - * 此组件存在的理由是,在nvue下,u-text被uni-app官方占用了,u-text在nvue中相当于input组件 | |
| 32 | - * 所以在nvue下,取名为u--input,内部其实还是u-text.vue,只不过做一层中转 | |
| 33 | - * 不使用v-bind="$attrs",而是分开独立写传参,是因为微信小程序不支持此写法 | |
| 34 | - */ | |
| 35 | -import uvText from "../u-text/u-text.vue"; | |
| 36 | -import props from "../u-text/props.js"; | |
| 37 | -export default { | |
| 38 | - name: "u--text", | |
| 39 | - mixins: [uni.$u.mpMixin, props, uni.$u.mixin], | |
| 40 | - components: { | |
| 41 | - uvText, | |
| 42 | - }, | |
| 43 | -}; | |
| 44 | -</script> |
yudao-ui-app/uni_modules/uview-ui/components/u--textarea/u--textarea.vue deleted
| 1 | -<template> | |
| 2 | - <uvTextarea | |
| 3 | - :value="value" | |
| 4 | - :placeholder="placeholder" | |
| 5 | - :height="height" | |
| 6 | - :confirmType="confirmType" | |
| 7 | - :disabled="disabled" | |
| 8 | - :count="count" | |
| 9 | - :focus="focus" | |
| 10 | - :autoHeight="autoHeight" | |
| 11 | - :fixed="fixed" | |
| 12 | - :cursorSpacing="cursorSpacing" | |
| 13 | - :cursor="cursor" | |
| 14 | - :showConfirmBar="showConfirmBar" | |
| 15 | - :selectionStart="selectionStart" | |
| 16 | - :selectionEnd="selectionEnd" | |
| 17 | - :adjustPosition="adjustPosition" | |
| 18 | - :disableDefaultPadding="disableDefaultPadding" | |
| 19 | - :holdKeyboard="holdKeyboard" | |
| 20 | - :maxlength="maxlength" | |
| 21 | - :border="border" | |
| 22 | - :customStyle="customStyle" | |
| 23 | - :formatter="formatter" | |
| 24 | - :ignoreCompositionEvent="ignoreCompositionEvent" | |
| 25 | - @focus="e => $emit('focus')" | |
| 26 | - @blur="e => $emit('blur')" | |
| 27 | - @linechange="e => $emit('linechange', e)" | |
| 28 | - @confirm="e => $emit('confirm')" | |
| 29 | - @input="e => $emit('input', e)" | |
| 30 | - @keyboardheightchange="e => $emit('keyboardheightchange')" | |
| 31 | - ></uvTextarea> | |
| 32 | -</template> | |
| 33 | - | |
| 34 | -<script> | |
| 35 | - /** | |
| 36 | - * 此组件存在的理由是,在nvue下,u--textarea被uni-app官方占用了,u-textarea在nvue中相当于textarea组件 | |
| 37 | - * 所以在nvue下,取名为u--textarea,内部其实还是u-textarea.vue,只不过做一层中转 | |
| 38 | - */ | |
| 39 | - import uvTextarea from '../u-textarea/u-textarea.vue'; | |
| 40 | - import props from '../u-textarea/props.js' | |
| 41 | - export default { | |
| 42 | - name: 'u--textarea', | |
| 43 | - mixins: [uni.$u.mpMixin, props, uni.$u.mixin], | |
| 44 | - components: { | |
| 45 | - uvTextarea | |
| 46 | - }, | |
| 47 | - } | |
| 48 | -</script> |
yudao-ui-app/uni_modules/uview-ui/components/u-action-sheet/props.js deleted
| 1 | -export default { | |
| 2 | - props: { | |
| 3 | - // 操作菜单是否展示 (默认false) | |
| 4 | - show: { | |
| 5 | - type: Boolean, | |
| 6 | - default: uni.$u.props.actionSheet.show | |
| 7 | - }, | |
| 8 | - // 标题 | |
| 9 | - title: { | |
| 10 | - type: String, | |
| 11 | - default: uni.$u.props.actionSheet.title | |
| 12 | - }, | |
| 13 | - // 选项上方的描述信息 | |
| 14 | - description: { | |
| 15 | - type: String, | |
| 16 | - default: uni.$u.props.actionSheet.description | |
| 17 | - }, | |
| 18 | - // 数据 | |
| 19 | - actions: { | |
| 20 | - type: Array, | |
| 21 | - default: uni.$u.props.actionSheet.actions | |
| 22 | - }, | |
| 23 | - // 取消按钮的文字,不为空时显示按钮 | |
| 24 | - cancelText: { | |
| 25 | - type: String, | |
| 26 | - default: uni.$u.props.actionSheet.cancelText | |
| 27 | - }, | |
| 28 | - // 点击某个菜单项时是否关闭弹窗 | |
| 29 | - closeOnClickAction: { | |
| 30 | - type: Boolean, | |
| 31 | - default: uni.$u.props.actionSheet.closeOnClickAction | |
| 32 | - }, | |
| 33 | - // 处理底部安全区(默认true) | |
| 34 | - safeAreaInsetBottom: { | |
| 35 | - type: Boolean, | |
| 36 | - default: uni.$u.props.actionSheet.safeAreaInsetBottom | |
| 37 | - }, | |
| 38 | - // 小程序的打开方式 | |
| 39 | - openType: { | |
| 40 | - type: String, | |
| 41 | - default: uni.$u.props.actionSheet.openType | |
| 42 | - }, | |
| 43 | - // 点击遮罩是否允许关闭 (默认true) | |
| 44 | - closeOnClickOverlay: { | |
| 45 | - type: Boolean, | |
| 46 | - default: uni.$u.props.actionSheet.closeOnClickOverlay | |
| 47 | - }, | |
| 48 | - // 圆角值 | |
| 49 | - round: { | |
| 50 | - type: [Boolean, String, Number], | |
| 51 | - default: uni.$u.props.actionSheet.round | |
| 52 | - } | |
| 53 | - } | |
| 54 | -} |
yudao-ui-app/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue deleted
| 1 | - | |
| 2 | -<template> | |
| 3 | - <u-popup | |
| 4 | - :show="show" | |
| 5 | - mode="bottom" | |
| 6 | - @close="closeHandler" | |
| 7 | - :safeAreaInsetBottom="safeAreaInsetBottom" | |
| 8 | - :round="round" | |
| 9 | - > | |
| 10 | - <view class="u-action-sheet"> | |
| 11 | - <view | |
| 12 | - class="u-action-sheet__header" | |
| 13 | - v-if="title" | |
| 14 | - > | |
| 15 | - <text class="u-action-sheet__header__title u-line-1">{{title}}</text> | |
| 16 | - <view | |
| 17 | - class="u-action-sheet__header__icon-wrap" | |
| 18 | - @tap.stop="cancel" | |
| 19 | - > | |
| 20 | - <u-icon | |
| 21 | - name="close" | |
| 22 | - size="17" | |
| 23 | - color="#c8c9cc" | |
| 24 | - bold | |
| 25 | - ></u-icon> | |
| 26 | - </view> | |
| 27 | - </view> | |
| 28 | - <text | |
| 29 | - class="u-action-sheet__description" | |
| 30 | - :style="[{ | |
| 31 | - marginTop: `${title && description ? 0 : '18px'}` | |
| 32 | - }]" | |
| 33 | - v-if="description" | |
| 34 | - >{{description}}</text> | |
| 35 | - <slot> | |
| 36 | - <u-line v-if="description"></u-line> | |
| 37 | - <view class="u-action-sheet__item-wrap"> | |
| 38 | - <template v-for="(item, index) in actions"> | |
| 39 | - <!-- #ifdef MP --> | |
| 40 | - <button | |
| 41 | - :key="index" | |
| 42 | - class="u-reset-button" | |
| 43 | - :openType="item.openType" | |
| 44 | - @getuserinfo="onGetUserInfo" | |
| 45 | - @contact="onContact" | |
| 46 | - @getphonenumber="onGetPhoneNumber" | |
| 47 | - @error="onError" | |
| 48 | - @launchapp="onLaunchApp" | |
| 49 | - @opensetting="onOpenSetting" | |
| 50 | - :lang="lang" | |
| 51 | - :session-from="sessionFrom" | |
| 52 | - :send-message-title="sendMessageTitle" | |
| 53 | - :send-message-path="sendMessagePath" | |
| 54 | - :send-message-img="sendMessageImg" | |
| 55 | - :show-message-card="showMessageCard" | |
| 56 | - :app-parameter="appParameter" | |
| 57 | - @tap="selectHandler(index)" | |
| 58 | - :hover-class="!item.disabled && !item.loading ? 'u-action-sheet--hover' : ''" | |
| 59 | - > | |
| 60 | - <!-- #endif --> | |
| 61 | - <view | |
| 62 | - class="u-action-sheet__item-wrap__item" | |
| 63 | - @tap.stop="selectHandler(index)" | |
| 64 | - :hover-class="!item.disabled && !item.loading ? 'u-action-sheet--hover' : ''" | |
| 65 | - :hover-stay-time="150" | |
| 66 | - > | |
| 67 | - <template v-if="!item.loading"> | |
| 68 | - <text | |
| 69 | - class="u-action-sheet__item-wrap__item__name" | |
| 70 | - :style="[itemStyle(index)]" | |
| 71 | - >{{ item.name }}</text> | |
| 72 | - <text | |
| 73 | - v-if="item.subname" | |
| 74 | - class="u-action-sheet__item-wrap__item__subname" | |
| 75 | - >{{ item.subname }}</text> | |
| 76 | - </template> | |
| 77 | - <u-loading-icon | |
| 78 | - v-else | |
| 79 | - custom-class="van-action-sheet__loading" | |
| 80 | - size="18" | |
| 81 | - mode="circle" | |
| 82 | - /> | |
| 83 | - </view> | |
| 84 | - <!-- #ifdef MP --> | |
| 85 | - </button> | |
| 86 | - <!-- #endif --> | |
| 87 | - <u-line v-if="index !== actions.length - 1"></u-line> | |
| 88 | - </template> | |
| 89 | - </view> | |
| 90 | - </slot> | |
| 91 | - <u-gap | |
| 92 | - bgColor="#eaeaec" | |
| 93 | - height="6" | |
| 94 | - v-if="cancelText" | |
| 95 | - ></u-gap> | |
| 96 | - <view hover-class="u-action-sheet--hover"> | |
| 97 | - <text | |
| 98 | - @touchmove.stop.prevent | |
| 99 | - :hover-stay-time="150" | |
| 100 | - v-if="cancelText" | |
| 101 | - class="u-action-sheet__cancel-text" | |
| 102 | - @tap="cancel" | |
| 103 | - >{{cancelText}}</text> | |
| 104 | - </view> | |
| 105 | - </view> | |
| 106 | - </u-popup> | |
| 107 | -</template> | |
| 108 | - | |
| 109 | -<script> | |
| 110 | - import openType from '../../libs/mixin/openType' | |
| 111 | - import button from '../../libs/mixin/button' | |
| 112 | - import props from './props.js'; | |
| 113 | - /** | |
| 114 | - * ActionSheet 操作菜单 | |
| 115 | - * @description 本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。本组件功能类似于uni的uni.showActionSheetAPI,配置更加灵活,所有平台都表现一致。 | |
| 116 | - * @tutorial https://www.uviewui.com/components/actionSheet.html | |
| 117 | - * | |
| 118 | - * @property {Boolean} show 操作菜单是否展示 (默认 false ) | |
| 119 | - * @property {String} title 操作菜单标题 | |
| 120 | - * @property {String} description 选项上方的描述信息 | |
| 121 | - * @property {Array<Object>} actions 按钮的文字数组,见官方文档示例 | |
| 122 | - * @property {String} cancelText 取消按钮的提示文字,不为空时显示按钮 | |
| 123 | - * @property {Boolean} closeOnClickAction 点击某个菜单项时是否关闭弹窗 (默认 true ) | |
| 124 | - * @property {Boolean} safeAreaInsetBottom 处理底部安全区 (默认 true ) | |
| 125 | - * @property {String} openType 小程序的打开方式 (contact | launchApp | getUserInfo | openSetting |getPhoneNumber |error ) | |
| 126 | - * @property {Boolean} closeOnClickOverlay 点击遮罩是否允许关闭 (默认 true ) | |
| 127 | - * @property {Number|String} round 圆角值,默认无圆角 (默认 0 ) | |
| 128 | - * @property {String} lang 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文 | |
| 129 | - * @property {String} sessionFrom 会话来源,openType="contact"时有效 | |
| 130 | - * @property {String} sendMessageTitle 会话内消息卡片标题,openType="contact"时有效 | |
| 131 | - * @property {String} sendMessagePath 会话内消息卡片点击跳转小程序路径,openType="contact"时有效 | |
| 132 | - * @property {String} sendMessageImg 会话内消息卡片图片,openType="contact"时有效 | |
| 133 | - * @property {Boolean} showMessageCard 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效 (默认 false ) | |
| 134 | - * @property {String} appParameter 打开 APP 时,向 APP 传递的参数,openType=launchApp 时有效 | |
| 135 | - * | |
| 136 | - * @event {Function} select 点击ActionSheet列表项时触发 | |
| 137 | - * @event {Function} close 点击取消按钮时触发 | |
| 138 | - * @event {Function} getuserinfo 用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,openType="getUserInfo"时有效 | |
| 139 | - * @event {Function} contact 客服消息回调,openType="contact"时有效 | |
| 140 | - * @event {Function} getphonenumber 获取用户手机号回调,openType="getPhoneNumber"时有效 | |
| 141 | - * @event {Function} error 当使用开放能力时,发生错误的回调,openType="error"时有效 | |
| 142 | - * @event {Function} launchapp 打开 APP 成功的回调,openType="launchApp"时有效 | |
| 143 | - * @event {Function} opensetting 在打开授权设置页后回调,openType="openSetting"时有效 | |
| 144 | - * @example <u-action-sheet :actions="list" :title="title" :show="show"></u-action-sheet> | |
| 145 | - */ | |
| 146 | - export default { | |
| 147 | - name: "u-action-sheet", | |
| 148 | - // 一些props参数和methods方法,通过mixin混入,因为其他文件也会用到 | |
| 149 | - mixins: [openType, button, uni.$u.mixin, props], | |
| 150 | - data() { | |
| 151 | - return { | |
| 152 | - | |
| 153 | - } | |
| 154 | - }, | |
| 155 | - computed: { | |
| 156 | - // 操作项目的样式 | |
| 157 | - itemStyle() { | |
| 158 | - return (index) => { | |
| 159 | - let style = {}; | |
| 160 | - if (this.actions[index].color) style.color = this.actions[index].color | |
| 161 | - if (this.actions[index].fontSize) style.fontSize = uni.$u.addUnit(this.actions[index].fontSize) | |
| 162 | - // 选项被禁用的样式 | |
| 163 | - if (this.actions[index].disabled) style.color = '#c0c4cc' | |
| 164 | - return style; | |
| 165 | - } | |
| 166 | - }, | |
| 167 | - }, | |
| 168 | - methods: { | |
| 169 | - closeHandler() { | |
| 170 | - // 允许点击遮罩关闭时,才发出close事件 | |
| 171 | - if(this.closeOnClickOverlay) { | |
| 172 | - this.$emit('close') | |
| 173 | - } | |
| 174 | - }, | |
| 175 | - // 点击取消按钮 | |
| 176 | - cancel() { | |
| 177 | - this.$emit('close') | |
| 178 | - }, | |
| 179 | - selectHandler(index) { | |
| 180 | - const item = this.actions[index] | |
| 181 | - if (item && !item.disabled && !item.loading) { | |
| 182 | - this.$emit('select', item) | |
| 183 | - if (this.closeOnClickAction) { | |
| 184 | - this.$emit('close') | |
| 185 | - } | |
| 186 | - } | |
| 187 | - }, | |
| 188 | - } | |
| 189 | - } | |
| 190 | -</script> | |
| 191 | - | |
| 192 | -<style lang="scss" scoped> | |
| 193 | - @import "../../libs/css/components.scss"; | |
| 194 | - $u-action-sheet-reset-button-width:100% !default; | |
| 195 | - $u-action-sheet-title-font-size: 16px !default; | |
| 196 | - $u-action-sheet-title-padding: 12px 30px !default; | |
| 197 | - $u-action-sheet-title-color: $u-main-color !default; | |
| 198 | - $u-action-sheet-header-icon-wrap-right:15px !default; | |
| 199 | - $u-action-sheet-header-icon-wrap-top:15px !default; | |
| 200 | - $u-action-sheet-description-font-size:13px !default; | |
| 201 | - $u-action-sheet-description-color:14px !default; | |
| 202 | - $u-action-sheet-description-margin: 18px 15px !default; | |
| 203 | - $u-action-sheet-item-wrap-item-padding:15px !default; | |
| 204 | - $u-action-sheet-item-wrap-name-font-size:16px !default; | |
| 205 | - $u-action-sheet-item-wrap-subname-font-size:13px !default; | |
| 206 | - $u-action-sheet-item-wrap-subname-color: #c0c4cc !default; | |
| 207 | - $u-action-sheet-item-wrap-subname-margin-top:10px !default; | |
| 208 | - $u-action-sheet-cancel-text-font-size:16px !default; | |
| 209 | - $u-action-sheet-cancel-text-color:$u-content-color !default; | |
| 210 | - $u-action-sheet-cancel-text-font-size:15px !default; | |
| 211 | - $u-action-sheet-cancel-text-hover-background-color:rgb(242, 243, 245) !default; | |
| 212 | - | |
| 213 | - .u-reset-button { | |
| 214 | - width: $u-action-sheet-reset-button-width; | |
| 215 | - } | |
| 216 | - | |
| 217 | - .u-action-sheet { | |
| 218 | - text-align: center; | |
| 219 | - &__header { | |
| 220 | - position: relative; | |
| 221 | - padding: $u-action-sheet-title-padding; | |
| 222 | - &__title { | |
| 223 | - font-size: $u-action-sheet-title-font-size; | |
| 224 | - color: $u-action-sheet-title-color; | |
| 225 | - font-weight: bold; | |
| 226 | - text-align: center; | |
| 227 | - } | |
| 228 | - | |
| 229 | - &__icon-wrap { | |
| 230 | - position: absolute; | |
| 231 | - right: $u-action-sheet-header-icon-wrap-right; | |
| 232 | - top: $u-action-sheet-header-icon-wrap-top; | |
| 233 | - } | |
| 234 | - } | |
| 235 | - | |
| 236 | - &__description { | |
| 237 | - font-size: $u-action-sheet-description-font-size; | |
| 238 | - color: $u-tips-color; | |
| 239 | - margin: $u-action-sheet-description-margin; | |
| 240 | - text-align: center; | |
| 241 | - } | |
| 242 | - | |
| 243 | - &__item-wrap { | |
| 244 | - | |
| 245 | - &__item { | |
| 246 | - padding: $u-action-sheet-item-wrap-item-padding; | |
| 247 | - @include flex; | |
| 248 | - align-items: center; | |
| 249 | - justify-content: center; | |
| 250 | - flex-direction: column; | |
| 251 | - | |
| 252 | - &__name { | |
| 253 | - font-size: $u-action-sheet-item-wrap-name-font-size; | |
| 254 | - color: $u-main-color; | |
| 255 | - text-align: center; | |
| 256 | - } | |
| 257 | - | |
| 258 | - &__subname { | |
| 259 | - font-size: $u-action-sheet-item-wrap-subname-font-size; | |
| 260 | - color: $u-action-sheet-item-wrap-subname-color; | |
| 261 | - margin-top: $u-action-sheet-item-wrap-subname-margin-top; | |
| 262 | - text-align: center; | |
| 263 | - } | |
| 264 | - } | |
| 265 | - } | |
| 266 | - | |
| 267 | - &__cancel-text { | |
| 268 | - font-size: $u-action-sheet-cancel-text-font-size; | |
| 269 | - color: $u-action-sheet-cancel-text-color; | |
| 270 | - text-align: center; | |
| 271 | - padding: $u-action-sheet-cancel-text-font-size; | |
| 272 | - } | |
| 273 | - | |
| 274 | - &--hover { | |
| 275 | - background-color: $u-action-sheet-cancel-text-hover-background-color; | |
| 276 | - } | |
| 277 | - } | |
| 278 | -</style> |
yudao-ui-app/uni_modules/uview-ui/components/u-album/props.js deleted
| 1 | -export default { | |
| 2 | - props: { | |
| 3 | - // 图片地址,Array<String>|Array<Object>形式 | |
| 4 | - urls: { | |
| 5 | - type: Array, | |
| 6 | - default: uni.$u.props.album.urls | |
| 7 | - }, | |
| 8 | - // 指定从数组的对象元素中读取哪个属性作为图片地址 | |
| 9 | - keyName: { | |
| 10 | - type: String, | |
| 11 | - default: uni.$u.props.album.keyName | |
| 12 | - }, | |
| 13 | - // 单图时,图片长边的长度 | |
| 14 | - singleSize: { | |
| 15 | - type: [String, Number], | |
| 16 | - default: uni.$u.props.album.singleSize | |
| 17 | - }, | |
| 18 | - // 多图时,图片边长 | |
| 19 | - multipleSize: { | |
| 20 | - type: [String, Number], | |
| 21 | - default: uni.$u.props.album.multipleSize | |
| 22 | - }, | |
| 23 | - // 多图时,图片水平和垂直之间的间隔 | |
| 24 | - space: { | |
| 25 | - type: [String, Number], | |
| 26 | - default: uni.$u.props.album.space | |
| 27 | - }, | |
| 28 | - // 单图时,图片缩放裁剪的模式 | |
| 29 | - singleMode: { | |
| 30 | - type: String, | |
| 31 | - default: uni.$u.props.album.singleMode | |
| 32 | - }, | |
| 33 | - // 多图时,图片缩放裁剪的模式 | |
| 34 | - multipleMode: { | |
| 35 | - type: String, | |
| 36 | - default: uni.$u.props.album.multipleMode | |
| 37 | - }, | |
| 38 | - // 最多展示的图片数量,超出时最后一个位置将会显示剩余图片数量 | |
| 39 | - maxCount: { | |
| 40 | - type: [String, Number], | |
| 41 | - default: uni.$u.props.album.maxCount | |
| 42 | - }, | |
| 43 | - // 是否可以预览图片 | |
| 44 | - previewFullImage: { | |
| 45 | - type: Boolean, | |
| 46 | - default: uni.$u.props.album.previewFullImage | |
| 47 | - }, | |
| 48 | - // 每行展示图片数量,如设置,singleSize和multipleSize将会无效 | |
| 49 | - rowCount: { | |
| 50 | - type: [String, Number], | |
| 51 | - default: uni.$u.props.album.rowCount | |
| 52 | - }, | |
| 53 | - // 超出maxCount时是否显示查看更多的提示 | |
| 54 | - showMore: { | |
| 55 | - type: Boolean, | |
| 56 | - default: uni.$u.props.album.showMore | |
| 57 | - } | |
| 58 | - } | |
| 59 | -} |