loanCalc.jsx 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. import Taro, { Component } from '@tarojs/taro'
  2. import { View } from '@tarojs/components'
  3. import { AtTabs, AtTabsPane } from 'taro-ui'
  4. import LFormGroup from '@/c/lform/formGroup'
  5. import './loanCalc.scss'
  6. class Index extends Component {
  7. onShareAppMessage() {
  8. return {
  9. title: `房贷税费计算工具`,
  10. }
  11. }
  12. onShareTimeline () {
  13. return {
  14. title: `房贷税费计算工具`,
  15. }
  16. }
  17. constructor (props) {
  18. super(props)
  19. this.state = {
  20. curNav: 0,
  21. formObj: {},
  22. }
  23. }
  24. config = {
  25. navigationBarTitleText: '房贷税费计算工具',
  26. }
  27. componentWillMount () {
  28. Taro.$AHU(this)
  29. Taro.showLoading({
  30. mask: true,
  31. title: '加载中..'
  32. })
  33. setTimeout(() => {
  34. Taro.hideLoading()
  35. }, 1000)
  36. }
  37. saveHandle () {
  38. const { feedback_count, formObj, imgArr } = this.state
  39. if (feedback_count && formObj.feedback_type) {
  40. Taro.api.base.apifeedbackadd({
  41. feedback_type: formObj.feedback_type,
  42. contact: formObj.contact,
  43. feedback_count: feedback_count,
  44. images: imgArr.join(','),
  45. }).then(res => {
  46. Taro.$msgConfirm('反馈成功~感谢您的宝贵建议', () => {
  47. Taro.navigateBack({
  48. delta: 1
  49. })
  50. }, () => {
  51. Taro.navigateBack({
  52. delta: 1
  53. })
  54. })
  55. })
  56. } else {
  57. Taro.$msg('请输入提问的类型和内容')
  58. }
  59. }
  60. baseFormChange (key, val) {
  61. let { formObj } = this.state
  62. formObj[key] = val
  63. this.setState({
  64. formObj
  65. })
  66. }
  67. navClick (value) {
  68. this.setState({
  69. curNav: value,
  70. })
  71. }
  72. render () {
  73. // const dictData = Taro.getStorageSync('dictData')
  74. // const startRateMoreOptions = {arr: [{key: '20%', val: 0.2}, {key: '30%', val: 0.3}, {key: '35%', val: 0.35}, {key: '40%', val: 0.4}, {key: '50%', val: 0.5}, {key: '60%', val: 0.6}, {key: '70%', val: 0.7}, {key: '80%', val: 0.8}, {key: '90%', val: 0.9}]}
  75. // const loanDateMoreOptions = {arr: [{key: '30年', val: 30}, {key: '20年', val: 20}, {key: '10年', val: 10}, {key: '5年', val: 5},]}
  76. // const tabList = [{ title: '商业贷款' }, { title: '公积金贷款' }, { title: '组合贷款' }]
  77. // const { curNav, formObj } = this.state
  78. return (
  79. <View className="l-box">
  80. <WebView src="https://houseloan.honglounews.com"/>
  81. {/* <AtTabs className="scoped-fixed" current={curNav} tabList={tabList} onClick={this.navClick.bind(this)}>
  82. <AtTabsPane current={curNav} index={0} >
  83. <View className="l-floor-pos">
  84. <LFormGroup
  85. val={formObj.totalPrice}
  86. valStr="totalPrice"
  87. keyStr="房屋总价"
  88. typeStr="inputFont"
  89. inputFont="万"
  90. bc={this.baseFormChange.bind(this)}
  91. />
  92. <LFormGroup
  93. val={formObj.startRate}
  94. valStr="startRate"
  95. keyStr="首付比例"
  96. typeStr="select"
  97. moreOptions={startRateMoreOptions}
  98. bc={this.baseFormChange.bind(this)}
  99. />
  100. <LFormGroup
  101. val={formObj.loanPrice}
  102. valStr="loanPrice"
  103. keyStr="商贷金额"
  104. typeStr="inputFont"
  105. inputFont="万"
  106. bc={this.baseFormChange.bind(this)}
  107. />
  108. <LFormGroup
  109. val={formObj.loanDate}
  110. valStr="loanDate"
  111. keyStr="商贷年限"
  112. typeStr="select"
  113. moreOptions={loanDateMoreOptions}
  114. bc={this.baseFormChange.bind(this)}
  115. />
  116. <LFormGroup
  117. val={formObj.loanInterestRate}
  118. valStr="loanInterestRate"
  119. keyStr="商贷利率"
  120. typeStr="inputFont"
  121. inputFont="%"
  122. bc={this.baseFormChange.bind(this)}
  123. />
  124. </View>
  125. </AtTabsPane>
  126. <AtTabsPane current={curNav} index={1} >
  127. 2
  128. </AtTabsPane>
  129. <AtTabsPane current={curNav} index={2} >
  130. 3
  131. </AtTabsPane>
  132. </AtTabs>
  133. <View className="l-floor-footer t2">
  134. <View className="lff-flex">
  135. <View className="lff-btn full" onClick={this.saveHandle.bind(this)}>提交</View>
  136. </View>
  137. </View> */}
  138. </View>
  139. )
  140. }
  141. }
  142. export default Index