diff --git a/pages/index/index.vue b/pages/index/index.vue index 4b1f63d..f6b9c35 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,9 +24,8 @@ - + @@ -191,6 +190,74 @@ + + + + + + + + 会员招募信息 + + + 关闭 + + + + + + + 联系人 + + + + + + + + + 联系电话 + + + + + + + + + 企业名称 + + + + + + + + + 企业地址 + + + + + + + + + 经营/热爱的户外运动 + + + + + + 确认提交 + + @@ -237,7 +304,15 @@ ], limit: 6, page: 1, - show: false + show: false, + formShow: false, + formData: { + name: '', + mobile: '', + enterprise_name: '', + enterprise_addr: '', + outdoor_sport: '', + } }; }, onLoad() { @@ -253,7 +328,7 @@ this.videoContext = uni.createVideoContext("myVideo"); //创建视频实例指向video }, onShow() { - + }, beforeDestroy() { this.autoplay = false; @@ -264,16 +339,124 @@ // } }, methods: { - openSwiper(item){ - console.log(item); - if(item.url=='xxx'){ + + + submitDo() { + const token = uni.getStorageSync('token'); + if (!token) { uni.showToast({ - title: '入会申请表单', + title: '请登录', icon: 'none', + duration: 2000, + complete: function() { + setTimeout(function() { + uni.switchTab({ + url: '/pages/my/index', + }); + }, 2000); + } }); - }else{ + return; + } + + if (this.formData.name == '') { + uni.showToast({ + title: '请填写联系人!', + icon: "none", + duration: 2000, + }); + return; + } + if (this.formData.mobile == '') { + uni.showToast({ + title: '请填写联系电话!', + icon: "none", + duration: 2000, + }); + return; + } + if (this.formData.enterprise_name == '') { + uni.showToast({ + title: '请填写企业名称!', + icon: "none", + duration: 2000, + }); + return; + } + if (this.formData.enterprise_addr == '') { + uni.showToast({ + title: '请填写企业地址!', + icon: "none", + duration: 2000, + }); + return; + } + if (this.formData.outdoor_sport == '') { + uni.showToast({ + title: '请填写经营/热爱的户外运动!', + icon: "none", + duration: 2000, + }); + return; + } + uni.$u.http + .post("/api/school.spor_apply/add", this.formData) + .then((res) => { + console.log(res); + if (res.code == 1) { + uni.showToast({ + title: '提交成功!', + icon: "none", + duration: 2000, + }); + this.formShow = false; + this.formData = { + name: '', + mobile: '', + enterprise_name: '', + enterprise_addr: '', + outdoor_sport: '', + }; + } else { + uni.showToast({ + title: res.msg, + icon: "none", + duration: 2000, + }); + } + }) + .catch((error) => { + uni.showToast({ + title: "请求失败,请稍后再试", + icon: "none", + duration: 2000, + }); + }); + }, + openSwiper(item) { + console.log(item); + if (item.url == 'outdoor_sport_apply') { + const token = uni.getStorageSync('token'); + if (!token) { + uni.showToast({ + title: '请登录', + icon: 'none', + duration: 2000, + complete: function() { + setTimeout(function() { + uni.switchTab({ + url: '/pages/my/index', + }); + }, 2000); + } + }); + return; + } else { + this.formShow = true; + } + } else { uni.navigateTo({ - url:item.url + url: item.url }) } }, @@ -1244,7 +1427,7 @@ text-align: center; width: 100%; bottom: 70rpx; - transform: translateZ(0); + transform: translateZ(0); } .fnon_tit { @@ -1296,4 +1479,51 @@ } } } + + .line-row { + margin: 40rpx 0rpx; + height: 1rpx; + width: 100%; + background: #F0F0F0; + } + + .input { + text-align: right; + font-family: PingFang SC, PingFang SC; + font-size: 26rpx; + color: #343434; + line-height: 32rpx; + } + + .plasty { + color: #999999; + font-weight: 300; + font-size: 28rpx; + } + + .textarea_mph { + ::v-deep .u-textarea { + height: 237rpx; + padding: 20rpx; + border: none; + font-size: 26rpx; + color: #9C9C9C; + background-color: #F8F8F8 !important; + border-radius: 18rpx; + } + } + + .btn_1 { + width: 100%; + height: 90rpx; + background: #323232; + border-radius: 198rpx 198rpx 198rpx 198rpx; + font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; + font-weight: 400; + font-size: 32rpx; + color: #BBFC5B; + line-height: 90rpx; + text-align: center; + margin-top: 50rpx; + } \ No newline at end of file