broker.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="broker">
  3. <view class="broker-title">
  4. 基本信息
  5. </view>
  6. <view class="broker-row u-flex">
  7. <view class="broker-row-left u-flex">
  8. <text>姓名</text>
  9. <text>*</text>
  10. </view>
  11. <input type="text" placeholder="请输入" v-model="name" class="input-right">
  12. </view>
  13. <!-- <view class="broker-row u-flex">
  14. <view class="broker-row-left u-flex">
  15. <text>身份证号</text>
  16. <text>*</text>
  17. </view>
  18. <input type="idcard" placeholder="请输入" v-model="card" class="input-right">
  19. </view> -->
  20. <view class="broker-row u-flex">
  21. <view class="broker-row-left u-flex">
  22. <text>手机号</text>
  23. <text>*</text>
  24. </view>
  25. <input type="number" placeholder="请输入" v-model="tel" class="input-right">
  26. </view>
  27. <view class="broker-btn" @click="save">
  28. 确认
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. type: 1,
  37. name: '',
  38. card: '',
  39. tel: '',
  40. title:''
  41. }
  42. },
  43. onLoad(option) {
  44. this.type = option.type
  45. this.title = option.title
  46. this.getuser()
  47. },
  48. onShow() {
  49. if (this.type == 1) {
  50. uni.setNavigationBarTitle({
  51. title: "中介经纪人"
  52. })
  53. } else {
  54. uni.setNavigationBarTitle({
  55. title: "全民经纪人"
  56. })
  57. }
  58. },
  59. methods: {
  60. getuser(){
  61. this.$u.post('/api/Member/member_info').then(res => {
  62. this.name = res.data.broker_name
  63. this.card = res.data.broker_id_card
  64. this.tel = res.data.broker_phone
  65. })
  66. },
  67. save() {
  68. if(!this.name){
  69. this.$u.toast("请输入姓名")
  70. return
  71. }
  72. // if(!this.$u.test.idCard(this.card)){
  73. // this.$u.toast("请输入正确的身份证")
  74. // return
  75. // }
  76. if(!this.$u.test.mobile(this.tel)){
  77. this.$u.toast("请输入正确的手机号")
  78. return
  79. }
  80. uni.showLoading({
  81. mask:true,
  82. title:"请稍后"
  83. })
  84. this.$u.post('/api/Member/submit_broker',{
  85. type:this.type,
  86. name:this.name,
  87. id_card:this.card,
  88. phone:this.tel
  89. }).then(res => {
  90. this.$u.toast('提交成功,请等待后台审核')
  91. if(res.code == 1){
  92. setTimeout(() => {
  93. uni.switchTab({
  94. url: "/pages/index/index"
  95. })
  96. },800)
  97. }
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss">
  104. .broker {
  105. padding: 0 24rpx;
  106. .broker-btn {
  107. width: 702rpx;
  108. line-height: 82rpx;
  109. background: #1F7EFF;
  110. border-radius: 8rpx;
  111. text-align: center;
  112. font-size: 28rpx;
  113. font-family: PingFangSC-Regular, PingFang SC;
  114. font-weight: 400;
  115. color: #FFFFFF;
  116. position: fixed;
  117. bottom: 226rpx;
  118. left: 24rpx;
  119. }
  120. .broker-row {
  121. height: 82rpx;
  122. border-bottom: 2rpx solid #F5F5F5;
  123. .input-right {
  124. flex: 1;
  125. font-size: 24rpx;
  126. }
  127. .broker-row-left {
  128. width: 252rpx;
  129. text:first-child {
  130. font-size: 24rpx;
  131. font-family: PingFangSC-Regular, PingFang SC;
  132. font-weight: 400;
  133. color: #999999;
  134. }
  135. text:nth-child(2) {
  136. font-size: 24rpx;
  137. font-family: PingFangSC-Regular, PingFang SC;
  138. font-weight: 400;
  139. color: #F83838;
  140. }
  141. }
  142. }
  143. .broker-title {
  144. padding: 24rpx 0;
  145. font-size: 28rpx;
  146. font-family: PingFangSC-Medium, PingFang SC;
  147. font-weight: 500;
  148. color: #333333;
  149. }
  150. }
  151. </style>