|
|
|
|
@ -0,0 +1,250 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="container">
|
|
|
|
|
<image class="bg" src="/static/ylbtbg.png" mode="widthFix"></image>
|
|
|
|
|
<view class="content">
|
|
|
|
|
<image class="title" src="/static/ylbttitle.png" mode="widthFix"></image>
|
|
|
|
|
|
|
|
|
|
<view class="steps">
|
|
|
|
|
<image class="step-icon" src="/static/ylbticon1.png" mode="aspectFit"></image>
|
|
|
|
|
<image class="step-icon" src="/static/ylbticon2.png" mode="aspectFit"></image>
|
|
|
|
|
<image class="step-icon" src="/static/ylbticon3.png" mode="aspectFit"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="benefit-text">
|
|
|
|
|
<view class="line1"><text>【专属福利】</text>您家60岁以上失能老人</view>
|
|
|
|
|
<view class="line2">每月最高领<text>800元!</text></view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="form-card">
|
|
|
|
|
<view class="form-row">
|
|
|
|
|
<text class="required">*</text>
|
|
|
|
|
<text class="label">手机号:</text>
|
|
|
|
|
<input
|
|
|
|
|
class="mobile-input"
|
|
|
|
|
type="number"
|
|
|
|
|
maxlength="11"
|
|
|
|
|
placeholder="请填写您的联系电话"
|
|
|
|
|
v-model="form.mobile"
|
|
|
|
|
/>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="divider"></view>
|
|
|
|
|
<textarea
|
|
|
|
|
class="content-input"
|
|
|
|
|
v-model="form.content"
|
|
|
|
|
maxlength="500"
|
|
|
|
|
placeholder="请简单描述您要咨询内容(内容加密保护)"
|
|
|
|
|
/>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="submit-btn" @click="submit">提交咨询信息</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
form: {
|
|
|
|
|
mobile: '',
|
|
|
|
|
content: ''
|
|
|
|
|
},
|
|
|
|
|
submitting: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
token() {
|
|
|
|
|
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
this.initMobile()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async initMobile() {
|
|
|
|
|
if (this.vuex_user?.mobile) {
|
|
|
|
|
this.form.mobile = this.vuex_user.mobile
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!this.token) return
|
|
|
|
|
try {
|
|
|
|
|
const { user } = await this.$u.api.getUserInfo()
|
|
|
|
|
if (user) {
|
|
|
|
|
this.$u.vuex('vuex_user', user)
|
|
|
|
|
this.form.mobile = user.mobile || ''
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
validateForm() {
|
|
|
|
|
if (!this.form.mobile) {
|
|
|
|
|
this.$u.toast('请填写手机号')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (!/^1[3-9]\d{9}$/.test(this.form.mobile)) {
|
|
|
|
|
this.$u.toast('手机号格式不正确')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (!this.form.content || !this.form.content.trim()) {
|
|
|
|
|
this.$u.toast('请填写咨询内容')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
},
|
|
|
|
|
async submit() {
|
|
|
|
|
if (this.submitting) return
|
|
|
|
|
if (!this.token) {
|
|
|
|
|
this.$u.route({
|
|
|
|
|
url: '/pages/login/login',
|
|
|
|
|
type: 'redirect'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!this.validateForm()) return
|
|
|
|
|
this.submitting = true
|
|
|
|
|
try {
|
|
|
|
|
await this.$u.api.oldAgeAllowanceSubmit({
|
|
|
|
|
mobile: this.form.mobile,
|
|
|
|
|
content: this.form.content.trim()
|
|
|
|
|
})
|
|
|
|
|
this.$u.toast('提交成功')
|
|
|
|
|
this.form.content = ''
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/index/index'
|
|
|
|
|
})
|
|
|
|
|
}, 1500)
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err)
|
|
|
|
|
} finally {
|
|
|
|
|
this.submitting = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.container {
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
background: #f7cfa7;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bg {
|
|
|
|
|
width: 100%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
z-index: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
padding: 36rpx 38rpx 80rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
display: block;
|
|
|
|
|
width: 620rpx;
|
|
|
|
|
margin: 40rpx auto 0;
|
|
|
|
|
margin-top:120rpx;
|
|
|
|
|
margin-bottom:120rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.steps {
|
|
|
|
|
margin-top: 34rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom:70rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.step-icon {
|
|
|
|
|
width: 200rpx;
|
|
|
|
|
height: 200rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-card {
|
|
|
|
|
margin-top: 34rpx;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
padding: 32rpx 26rpx 26rpx;
|
|
|
|
|
box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.06);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.benefit-text {
|
|
|
|
|
margin-top: 25rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #d43c40;
|
|
|
|
|
|
|
|
|
|
.line1 {
|
|
|
|
|
font-size: 34rpx;
|
|
|
|
|
margin-bottom:25rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.line2 {
|
|
|
|
|
font-size: 27rpx;
|
|
|
|
|
margin-bottom:100rpx;
|
|
|
|
|
& > text {
|
|
|
|
|
font-size: 52rpx;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color:#d43c40
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
color: #222;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.required {
|
|
|
|
|
color: #dd8b31;
|
|
|
|
|
margin-right: 8rpx;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.label {
|
|
|
|
|
margin-right: 18rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mobile-input {
|
|
|
|
|
flex: 1;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
height: 64rpx;
|
|
|
|
|
text-align:right;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.divider {
|
|
|
|
|
height: 2rpx;
|
|
|
|
|
background: #efefef;
|
|
|
|
|
margin: 12rpx 0 24rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content-input {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 220rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
background: #fafafa;
|
|
|
|
|
border: 2rpx solid #ededed;
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.submit-btn {
|
|
|
|
|
margin: 70rpx auto 0;
|
|
|
|
|
width: 460rpx;
|
|
|
|
|
height: 86rpx;
|
|
|
|
|
line-height: 86rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-size: 34rpx;
|
|
|
|
|
border-radius: 43rpx;
|
|
|
|
|
background: linear-gradient(90deg, #df0000 0%, #f1556d 100%);
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|