From ee5e264c888b95670f3f04e7dbf2b3dbbab76792 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Sat, 29 Jul 2023 18:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=89=E6=8B=A9=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/newArchives/store.vue | 3 - subpkg/newArchives/newArchives.vue | 128 ++++++++++++++++++++++++----- 2 files changed, 109 insertions(+), 22 deletions(-) diff --git a/components/newArchives/store.vue b/components/newArchives/store.vue index 87fee7c..e587e3a 100644 --- a/components/newArchives/store.vue +++ b/components/newArchives/store.vue @@ -82,11 +82,8 @@ - - diff --git a/subpkg/newArchives/newArchives.vue b/subpkg/newArchives/newArchives.vue index a14f9ec..54636cb 100644 --- a/subpkg/newArchives/newArchives.vue +++ b/subpkg/newArchives/newArchives.vue @@ -54,8 +54,18 @@ - - + + + + + + + + + + + @@ -68,22 +78,29 @@ import districtSelector from "@/components/districtSelector/districtSelector.vue" //地区选择器 import residents from "@/components/newArchives/residents.vue" // 常住人口 import breeding from "@/components/newArchives/breeding.vue" // 种养殖 + import store from "@/components/newArchives/store.vue" // 开设店铺 export default { - components:{districtSelector, residents, breeding}, + components: { districtSelector, residents, breeding, store }, data() { return { + demandShow: false, + demandLoading: false, + demandList: ['生产投入明细', '修房装修', '宴席', '生活采购'], //更多需求 + demandListChild: ['种养殖', '开设店铺', '深加工', '粗加工'], //更多二级需求 + showDemandList: [], //更多需求展示列表 formData: { id_card: '', sex: '', name: '', phone: '', //电话 - highway: '',//汽车是否能到家 - smart_phone: '',//是否使用智能手机 + highway: '', //汽车是否能到家 + smart_phone: '', //是否使用智能手机 wechat: '', //微信号 - address: '',//家庭地址 - age: '',//年龄 + address: '', //家庭地址 + age: '', //年龄 category_id: '1', category_child: '2', + data_type: '1', }, rules: { phone: { @@ -124,14 +141,14 @@ trigger: ['change', 'blur'] }, highway: { - validator: (rule, value, callback )=>{ - typeof value==='number'?callback():callback('不能为空') + validator: (rule, value, callback) => { + typeof value === 'number' ? callback() : callback('不能为空') }, trigger: ['change', 'blur'] }, smart_phone: { - validator: (rule, value, callback )=>{ - typeof value==='number'?callback():callback('不能为空') + validator: (rule, value, callback) => { + typeof value === 'number' ? callback() : callback('不能为空') }, trigger: ['change', 'blur'] }, @@ -148,21 +165,25 @@ let flag2 = this.$refs.residentsRef.validate(); let flag3 = this.$refs.breedingRef.validate(); this.$refs.archives.validate().then(async (e) => { - if (e&&flag1&&flag2&&flag3) { + if (e && flag1 && flag2 && flag3) { uni.showLoading() let districtForm = { - area_id:this.$refs.districtSelectorRef.formData.area, - street_id:this.$refs.districtSelectorRef.formData.street, - village_id:this.$refs.districtSelectorRef.formData.village, - brigade_id:this.$refs.districtSelectorRef.formData.brigade, + area_id: this.$refs.districtSelectorRef.formData.area, + street_id: this.$refs.districtSelectorRef.formData.street, + village_id: this.$refs.districtSelectorRef.formData.village, + brigade_id: this.$refs.districtSelectorRef.formData.brigade, } let res = await informationAdd({ ...this.formData, ...districtForm, ...this.$refs.residentsRef.residents, - datas:{ - ...this.$refs.breedingRef.formData - } + datas: [{ + category_id: '1', + category_child: '2', + datas: { + ...this.$refs.breedingRef.formData + } + }] }); uni.hideLoading() uni.showToast({ @@ -178,6 +199,45 @@ }) }, + // 选择更多需求 + changeHandler(e) { + if (e.columnIndex == 0) { //滑动左侧时才加载,右侧不加载 + this.demandLoading = true; + setTimeout(() => { + switch (e.indexs[0]) { + case 0: + this.demandListChild = ['种养殖', '开设店铺', '深加工', '粗加工']; + break; + case 1: + this.demandListChild = ['修房', '装房', '翻新', '买卖房']; + break; + case 2: + this.demandListChild = ['婚宴', '寿宴', '满月酒', '其他庆祝宴', '白事']; + break; + case 3: + this.demandListChild = ['烟酒', '水电气电话', '交通工具', '生活用品', '农副特产品']; + break; + default: + this.demandListChild = []; + break; + } + this.demandLoading = false; + }, 800) + } + }, + // 确认添加需求 + changeDemand(e) { + this.showDemandList.push({ + category_id: e.indexs[0], + category_child: e.indexs[1], + }) + console.log(this.showDemandList); + this.demandShow = false; + }, + // 删除需求 + removeShowDemand(index){ + this.showDemandList.splice(index, 1); + } }, onPullDownRefresh() { uni.stopPullDownRefresh() @@ -227,4 +287,34 @@ text-align: center; } } + + .delete { + margin: 22rpx 0; + // margin-bottom: 40rpx; + width: 100%; + height: 54rpx; + line-height: 54rpx; + background: #f56c6c; + border-radius: 14rpx; + font-size: 28rpx; + color: #fff; + text-align: center; + } + + .plus { + margin: 22rpx 0; + // margin-bottom: 40rpx; + width: 100%; + height: 54rpx; + line-height: 54rpx; + background: $theme-oa-color; + border-radius: 14rpx; + color: #fff; + text-align: center; + } + + .demand { + margin-top: 40rpx; + margin-bottom: 50rpx; + } \ No newline at end of file