index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view class="pb-60">
  3. <u-cell-item title="报名城市" :class="[iscity?'':'active']" :value="city" :arrow="iscity" @click="show=true,type=1"></u-cell-item>
  4. <u-cell-item title="居住地" :class="[isaddress?'':'active']" :value="address" :arrow="isaddress" @click="show=true,type=2"></u-cell-item>
  5. <view class="w100" style="height: 20rpx;background: #F8F8F8;"></view>
  6. <u-cell-item title="车辆品牌" :class="[isbrand?'':'active']" :value="model" :arrow="isbrand" @click="goOwner"></u-cell-item>
  7. <u-cell-item title="车牌号" :class="[isplateNo?'':'active']" :arrow="isplateNo" :value="plateNo" @tap="plateShow = true">
  8. <!-- <view slot="right-icon" class="input">
  9. <input type="text" :disabled="true" v-model.trim="plateNo" placeholder="请输入车牌号" />
  10. </view> -->
  11. </u-cell-item>
  12. <plate-input v-if="plateShow" :plate="plateNo" @export="setPlate" @close="plateShow = false" />
  13. <view class="mlr-36">
  14. <view class="mt-40 size-32">
  15. 上传证件
  16. </view>
  17. <view class="img text-center mt-30">
  18. <image :src="img1" mode="" @click="chooseImg1"></image>
  19. </view>
  20. <view class="size-28 text-center mt-10">
  21. 点击上传<text class="ml-10" style="color: #FF5C50;">行驶证正页</text>
  22. </view>
  23. <view class="img text-center mt-60">
  24. <image :src="img2" mode="" @click="chooseImg2"></image>
  25. </view>
  26. <view class="size-28 text-center mt-10">
  27. 点击上传<text class="ml-10" style="color: #FF5C50;">行驶证副页</text>
  28. </view>
  29. </view>
  30. <view class="center mt-40">
  31. <view class="radio center">
  32. <view class="radio-circle">
  33. </view>
  34. </view>
  35. <view class="size-26 ml-10">
  36. 阅读并同意代驾司机加盟须知
  37. </view>
  38. </view>
  39. <u-button type="primary" :disabled="!sign_areas || !areas || !brand || !name || !plateNo || !imgurl1 || !imgurl2" class="mt-60" @click="submit">提交审核</u-button>
  40. <!-- 选择地区 -->
  41. <u-picker v-model="show" mode="region" @confirm="confirm"></u-picker>
  42. </view>
  43. </template>
  44. <script>
  45. import {upload} from '../../../common/common.js'
  46. import plateInput from '@/components/uni-plate-input/uni-plate-input.vue';
  47. export default {
  48. data() {
  49. return {
  50. type:1,//1=报名城市,2=居住地
  51. iscity:true,//是否选择报名城市
  52. city:'请选择',//报名城市
  53. sign_areas:'',//市区号
  54. isaddress:true,//是否选择居住地
  55. address:'请选择',//居住地
  56. areas:'',//区(县)的区号
  57. isbrand:true,//是否选择车辆品牌
  58. model:'请选择车辆品牌',//车辆品牌
  59. brand:'',//车牌
  60. name:'',//车型
  61. isplateNo:true,//是否输入车牌号
  62. plateNo: '请输入车牌号',//车牌号
  63. plateShow: false,//自定义车牌号键盘开关
  64. img1:'../../../static/owner-1.png',
  65. imgurl1:'',
  66. img2:'../../../static/owner-2.png',
  67. imgurl2:'',
  68. show:false,
  69. submitbtn:true
  70. }
  71. },
  72. components: {
  73. plateInput
  74. },
  75. onLoad() {
  76. uni.$on('brand',res=>{
  77. console.log(res);
  78. this.brand = res.brand
  79. this.name = res.name
  80. this.model = res.brand + ' ' + res.name
  81. this.isbrand = false
  82. })
  83. },
  84. methods: {
  85. // 填写车牌号
  86. setPlate(plate) {
  87. if (plate.length >= 7) this.plateNo = plate;
  88. this.plateShow = false;
  89. this.isplateNo = false
  90. },
  91. //选择车辆品牌
  92. goOwner(){
  93. uni.navigateTo({
  94. url:'/pages/my/owner/owner'
  95. })
  96. },
  97. confirm(e){
  98. console.log(e);
  99. if(this.type==1){
  100. this.iscity = false
  101. this.sign_areas = e.city.value + '00'
  102. if(e.province.label == "北京市" || e.province.label == "天津市" || e.province.label == "上海市" || e.province.label == "重庆市"){
  103. this.city = e.province.label
  104. }else{
  105. this.city = e.province.label + '-' + e.city.label
  106. }
  107. }else{
  108. this.isaddress = false
  109. this.areas = e.area.value
  110. if(e.province.label == "北京市" || e.province.label == "天津市" || e.province.label == "上海市" || e.province.label == "重庆市"){
  111. this.address = e.province.label + '-' + e.area.label
  112. }else{
  113. this.address = e.province.label + '-' + e.city.label + '-' + e.area.label
  114. }
  115. }
  116. },
  117. chooseImg1(){
  118. upload().then(data=>{
  119. this.img1 = data[0].img1
  120. this.imgurl1 = data[0].img2
  121. })
  122. },
  123. chooseImg2(){
  124. upload().then(data=>{
  125. this.img2 = data[0].img1
  126. this.imgurl2 = data[0].img2
  127. })
  128. },
  129. submit(){
  130. if(this.submitbtn == true){
  131. this.submitbtn = false
  132. this.$http('/addons/ddrive/user/verified',{
  133. type:3,
  134. truename: '',
  135. idcard: '',
  136. front_card_image: '',
  137. back_card_image: '',
  138. sign_areas: this.sign_areas,
  139. areas: this.areas,
  140. driver_license: '',
  141. driver_front_image: '',
  142. driver_back_image: '',
  143. card_brand: this.brand,
  144. card_type: this.name,
  145. number_plate: this.plateNo,
  146. card_front_image: this.imgurl1,
  147. card_back_image: this.imgurl2
  148. },"POST").then(data=>{
  149. this.$store.dispatch('updateUserInfo')
  150. uni.showToast({
  151. title: '提交成功,请耐心等待',
  152. icon:'none'
  153. })
  154. setTimeout(()=>{
  155. uni.navigateBack({})
  156. },1000)
  157. }).catch(data=>{
  158. this.submitbtn = true
  159. })
  160. }
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. /deep/.u-btn{
  167. height: 96rpx !important;
  168. }
  169. /deep/.u-primary-hover {
  170. background-color: $blue !important;
  171. }
  172. /deep/.u-btn--primary--disabled {
  173. background-color: $bg-1 !important;
  174. }
  175. .active{
  176. /deep/.u-cell__value {
  177. color: $gray !important;
  178. }
  179. }
  180. .input{
  181. input{
  182. text-align: right;
  183. font-size: 26rpx;
  184. }
  185. }
  186. .img{
  187. image{
  188. width: 398rpx;
  189. height: 254rpx;
  190. }
  191. }
  192. .radio{
  193. width: 30rpx;
  194. height: 30rpx;
  195. border-radius: 50%;
  196. border: 1rpx solid #999;
  197. .radio-circle{
  198. width: 22rpx;
  199. height: 22rpx;
  200. background: $blue;
  201. border-radius: 50%;
  202. }
  203. }
  204. </style>