租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
8.2 KiB

3 months ago
  1. <template>
  2. <view class="se-p-40 se-bgc-white">
  3. <uv-form labelPosition="left" :model="form" :rules="rules" ref="form" labelWidth="60" labelStyle="font-size:26rpx;">
  4. <uv-form-item label="姓名" prop="name" >
  5. <uv-input v-model="form.name" type="text" placeholder="请输入请输入真实姓名" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  6. </uv-form-item>
  7. <uv-form-item label="手机号" prop="phone">
  8. <uv-input v-model="form.phone" type="text" placeholder="请输入手机号码" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  9. </uv-form-item>
  10. <uv-form-item label="从业年限" prop="seniority">
  11. <uv-input v-model="form.seniority" type="text" placeholder="请输入从业年限" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  12. </uv-form-item>
  13. <uv-form-item label="标签" prop="tag">
  14. <uv-input v-model="form.tag" type="text" placeholder="多个标签用空格隔开" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  15. </uv-form-item>
  16. <uv-form-item label="主营地区" prop="address" @click="handleAreaChange()">
  17. <uv-input v-model="form.address" @click="handleAreaChange()" disabled disabledColor="#ffffff" placeholder="请选择所在地区" border="none">
  18. </uv-input>
  19. <template v-slot:right>
  20. <uv-icon name="arrow-right"></uv-icon>
  21. </template>
  22. </uv-form-item>
  23. <uv-form-item label="所属门店" prop="shop" @click="handleshopChange()">
  24. <uv-input v-model="form.shop" @click="handleshopChange()" disabled disabledColor="#ffffff" placeholder="请选择所属门店" border="none">
  25. </uv-input>
  26. <template v-slot:right>
  27. <uv-icon name="arrow-right"></uv-icon>
  28. </template>
  29. </uv-form-item>
  30. <uv-form-item label="头像" labelWidth="250" prop="isheadImg" labelPosition="top">
  31. <uv-upload customStyle="margin-top:20rpx;" :fileList="form.headImgList" @afterRead="afterheadImgRead" @delete="deleteOwnershipPic" name="1"
  32. multiple :maxCount="10"></uv-upload>
  33. </uv-form-item>
  34. <uv-form-item label="身份证,工作证件" labelWidth="250" prop="isPicList" labelPosition="top">
  35. <uv-upload customStyle="margin-top:20rpx;" :fileList="form.picList" @afterRead="afterRead" @delete="deletePic" name="1"
  36. multiple :maxCount="10"></uv-upload>
  37. </uv-form-item>
  38. <uv-form-item labelPosition="top">
  39. <uv-checkbox-group @change="checkboxChange" v-model="checked">
  40. <uv-checkbox name="1" activeColor="#FF9F39" label-size="12" shape="circle" label="我已经阅读并了解"></uv-checkbox>
  41. <text class="se-c-orange" @click="open()">经纪人申请协议</text>
  42. </uv-checkbox-group>
  43. </uv-form-item>
  44. <uv-form-item>
  45. <uv-button type="primary" text="申请成为经纪人" customStyle="margin-top: 30px;border:1rpx solid #FF9F39;background-color: #FF9F39;border-radius: 30px;" @click="submit"></uv-button>
  46. </uv-form-item>
  47. </uv-form>
  48. <!-- 地址 -->
  49. <citySelect ref="citySelectRef" :zIndex="0" @city-change="handleCityChange"></citySelect>
  50. <uv-popup ref="popup" :round="20" mode="center" bg-color="transparent" :close-on-click-overlay="false">
  51. <view class="se-w-600 se-bgc-white se-br-40 se-p-40">
  52. <!-- <view class="se-flex se-flex-h-c">
  53. <image class="se-a-80" src="@/static/image/6588.png" mode=""></image>
  54. </view> -->
  55. <view class="se-flex se-flex-h-c se-fs-34 se-fw-6 se-c-black se-mt-40">
  56. 经纪人申请协议
  57. </view>
  58. <view class="se-lh-40 se-mt-40 se-fs-24 se-c-99">
  59. <text>请您务必审慎阅读充分理解用户协议和隐私政策各条款包括但不限于用户注意事项用户行为规范以及为了向你提供服务而收集使用存储你个人信息的情况等你可阅读</text>
  60. <text class="se-c-black se-fw-6" @click="handleOpenPrivacyContract()">租房小程序用户服务协议</text>
  61. <text></text>
  62. <text class="se-c-black se-fw-6" @click="handleOpenPrivacyContract()">租房小程序平台隐私权政策</text>
  63. <text>了解详细信息如你同意请点击下方按钮开始接受我们的服务</text>
  64. </view>
  65. <view class="se-flex se-flex-h-sb se-mt-40">
  66. <view @click="onCancel" class="se-br-20 se-flex-1 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-66 se-bgc-f5">
  67. <text>不同意</text>
  68. </view>
  69. <view @click="onAgree" class="se-br-20 se-ml-20 se-flex-1 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-white se-bgc-orange">
  70. <text class="se-ml-10">同意</text>
  71. </view>
  72. </view>
  73. </view>
  74. </uv-popup>
  75. </view>
  76. </template>
  77. <script>
  78. import citySelect from "@/components/cityselect/index.vue"
  79. export default{
  80. components:{
  81. citySelect
  82. },
  83. data(){
  84. return{
  85. checked:[],
  86. form:{
  87. title:"",//姓名
  88. phone:"",//手机号
  89. seniority:"",//从业年限
  90. tag:"",//标签
  91. address:"",//所属位置
  92. shop:"",//门店
  93. isheadImg:"",
  94. headImgList:[],
  95. isPicList:"",
  96. picList:[],
  97. },
  98. rules:{
  99. title:[
  100. {
  101. type: 'string',
  102. required: true,
  103. message: '请输入姓名',
  104. trigger: ['blur', 'change']
  105. }
  106. ],
  107. phone:[
  108. {
  109. type: 'string',
  110. required: true,
  111. message: '请输入手机号',
  112. trigger: ['blur', 'change']
  113. }
  114. ],
  115. seniority:[
  116. {
  117. type: 'string',
  118. required: true,
  119. message: '请输入从业年限',
  120. trigger: ['blur', 'change']
  121. }
  122. ],
  123. tag:[
  124. {
  125. type: 'string',
  126. required: true,
  127. message: '请输入标签',
  128. trigger: ['blur', 'change']
  129. }
  130. ],
  131. address:[
  132. {
  133. type: 'string',
  134. required: true,
  135. message: '请输入所在地区',
  136. trigger: ['blur', 'change']
  137. }
  138. ],
  139. shop:[
  140. {
  141. type: 'string',
  142. required: true,
  143. message: '请输入所属门店',
  144. trigger: ['blur', 'change']
  145. }
  146. ],
  147. isheadImg:[
  148. {
  149. type: 'string',
  150. required: true,
  151. message: '请选择头像',
  152. trigger: ['blur', 'change']
  153. }
  154. ],
  155. isPicList:[
  156. {
  157. type: 'string',
  158. required: true,
  159. message: '请选择身份证,工作证件',
  160. trigger: ['blur', 'change']
  161. }
  162. ],
  163. }
  164. }
  165. },
  166. watch: {
  167. 'form.headImgList'(newValue, oldValue) {
  168. if (newValue.length > 0) {
  169. this.form.isheadImg = '有'
  170. } else {
  171. this.form.isheadImg = ''
  172. }
  173. },
  174. 'form.picList'(newValue, oldValue) {
  175. if (newValue.length > 0) {
  176. this.form.isPicList = '有'
  177. } else {
  178. this.form.isPicList = ''
  179. }
  180. }
  181. },
  182. onReady() {
  183. this.$refs.form.setRules(this.rules)
  184. },
  185. methods:{
  186. open(){
  187. this.$refs.popup.open();
  188. },
  189. checkboxChange(n) {
  190. console.log('change', n);
  191. },
  192. onCancel(){
  193. this.$refs.popup.close();
  194. this.checked=[];
  195. },
  196. onAgree(){
  197. this.$refs.popup.close();
  198. this.checked=['1'];
  199. },
  200. deletePic(event) {
  201. this.form.picList.splice(event.index, 1)
  202. },
  203. async afterRead(e) {
  204. let self = this
  205. e.file.forEach(file => {
  206. self.$Oss.ossUpload(file.url).then(url => {
  207. self.form.picList.push({
  208. url
  209. })
  210. })
  211. })
  212. },
  213. deleteOwnershipPic(event) {
  214. this.form.headImgList.splice(event.index, 1)
  215. },
  216. async afterheadImgRead(e) {
  217. let self = this
  218. e.file.forEach(file => {
  219. self.$Oss.ossUpload(file.url).then(url => {
  220. self.form.headImgList.push({
  221. url
  222. })
  223. })
  224. })
  225. },
  226. handleAreaChange(){
  227. this.$refs.citySelectRef.open()
  228. },
  229. handleCityChange(e) {
  230. this.form.address = e.province.label + '-' + e.city.label + '-' + e.area.label;
  231. },
  232. submit() {
  233. if(this.checked.length==0){
  234. return uni.showToast({
  235. icon: "none",
  236. title: "请勾选隐私协议"
  237. })
  238. }
  239. this.$refs.form.validate().then(res => {
  240. uni.showToast({
  241. icon: 'none',
  242. title: '校验通过'
  243. })
  244. }).catch(errors => {
  245. uni.showToast({
  246. icon: 'none',
  247. title: '校验失败'
  248. })
  249. })
  250. }
  251. }
  252. }
  253. </script>
  254. <style>
  255. page{
  256. background-color: #f5f5f5;
  257. }
  258. </style>