|
@@ -0,0 +1,160 @@
|
|
|
+import Taro, { Component } from '@tarojs/taro'
|
|
|
+import { View } from '@tarojs/components'
|
|
|
+import LFormGroup from '@/c/lform/formGroup'
|
|
|
+import './apply2.scss'
|
|
|
+
|
|
|
+class Index extends Component {
|
|
|
+ onShareAppMessage() {
|
|
|
+ const {eId, eName} = this.$router.params
|
|
|
+ return {
|
|
|
+ title: '南昌买房,来洪楼领取专属优惠',
|
|
|
+ path: `/pagesPlan/apply2?eId=${eId}&eName=${eName}`,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onShareTimeline () {
|
|
|
+ return {
|
|
|
+ title: '南昌买房,来洪楼领取专属优惠',
|
|
|
+ path: `/pagesPlan/apply2?eId=${eId}&eName=${eName}`,
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ constructor (props) {
|
|
|
+ super(props)
|
|
|
+ this.state = {
|
|
|
+ formObj: {},
|
|
|
+ isMoreShow: false,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ config = {
|
|
|
+ navigationBarTitleText: '报名看房',
|
|
|
+ // navigationStyle: 'custom',
|
|
|
+ // navigationBarTextStyle: 'white'
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillMount () {
|
|
|
+ Taro.$AHU(this)
|
|
|
+ }
|
|
|
+
|
|
|
+ saveHandle () {
|
|
|
+ const that = this
|
|
|
+ const { formObj } = this.state
|
|
|
+ if (formObj.name && formObj.phone) {
|
|
|
+ const userInfo = Taro.getStorageSync('APP_userInfo')
|
|
|
+ const {eId} = this.$router.params
|
|
|
+ Taro.api.other.planadd({
|
|
|
+ ...formObj,
|
|
|
+ estate_id: eId || '',
|
|
|
+ userinfo: userInfo ? JSON.stringify(userInfo) : ''
|
|
|
+ }).then(res => {
|
|
|
+ Taro.$msgConfirm('提交成功,洪楼将根据您的情况联系您', () => {
|
|
|
+ that.linkPrev()
|
|
|
+ }, () => {
|
|
|
+ that.linkPrev()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Taro.$msg('请输入您的称呼和手机号~')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ baseFormChange (key, val) {
|
|
|
+ let { formObj } = this.state
|
|
|
+ formObj[key] = val
|
|
|
+ this.setState({
|
|
|
+ formObj
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ renderGoHome () {
|
|
|
+ const {eId} = this.$router.params
|
|
|
+ const icon = require('./img/apply/btn.png')
|
|
|
+ const icon2 = require('./img/apply/btn2.png')
|
|
|
+ const btn = eId ? icon : icon2
|
|
|
+ return (
|
|
|
+ <Image className="scoped-prev" src={btn} onClick={this.linkPrev.bind(this)}/>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ linkPrev () {
|
|
|
+ const {eId} = this.$router.params
|
|
|
+ if (eId) {
|
|
|
+ Taro.reLaunch({
|
|
|
+ url: `/pagesHouse/indexDtl?id=${eId}`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Taro.reLaunch({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ openMore () {
|
|
|
+ this.setState({
|
|
|
+ isMoreShow: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ render () {
|
|
|
+ const {eName} = this.$router.params
|
|
|
+ const { formObj } = this.state
|
|
|
+ const bg = require('./img/apply/bg.jpg')
|
|
|
+ return (
|
|
|
+ <View className="l-box scoped-box">
|
|
|
+ {this.renderGoHome()}
|
|
|
+ <View className="sb-bg">
|
|
|
+ <Image src={bg} className="img" />
|
|
|
+ </View>
|
|
|
+ <View className="sb-title">{eName || '洪楼Plus'}</View>
|
|
|
+ <View className="sb-main">
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.name}
|
|
|
+ valStr="name"
|
|
|
+ keyStr="您的称呼(必填)"
|
|
|
+ keyStr2="请输入您的称呼"
|
|
|
+ labelWidth="30%"
|
|
|
+ bc={this.baseFormChange.bind(this)}
|
|
|
+ />
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.phone}
|
|
|
+ valStr="phone"
|
|
|
+ keyStr="联系方式(必填)"
|
|
|
+ keyStr2="请输入联系方式"
|
|
|
+ inputType="digit"
|
|
|
+ labelWidth="30%"
|
|
|
+ bc={this.baseFormChange.bind(this)}
|
|
|
+ />
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.sfk}
|
|
|
+ valStr="sfk"
|
|
|
+ keyStr="首付款"
|
|
|
+ keyStr2="请输入"
|
|
|
+ inputType="digit"
|
|
|
+ typeStr="inputFont"
|
|
|
+ inputFont="万"
|
|
|
+ bc={this.baseFormChange.bind(this)}
|
|
|
+ />
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.ygys}
|
|
|
+ valStr="ygys"
|
|
|
+ keyStr="月供预算"
|
|
|
+ keyStr2="请输入"
|
|
|
+ inputType="digit"
|
|
|
+ typeStr="inputFont"
|
|
|
+ inputFont="元"
|
|
|
+ bc={this.baseFormChange.bind(this)}
|
|
|
+ />
|
|
|
+ <View className="l-floor-footer t2">
|
|
|
+ <View className="lff-flex">
|
|
|
+ <View className="lff-btn full t6 b" onClick={this.saveHandle.bind(this)}>提交</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View className="scoped-tips">平台一直严格保护用户隐私,请放心填写</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export default Index
|