apply.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <template>
  2. <view class="content">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  9. </image>
  10. </view>
  11. <view class="zdyNavTitle">网约车优享</view>
  12. <view style="width: 50px;"></view>
  13. </view>
  14. </view>
  15. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  16. <view style="height: 44px;"></view>
  17. <view class="top">
  18. 填写认证信息
  19. </view>
  20. <view class="box">
  21. <view class="cont">
  22. <view class="line">
  23. <view class="lineLeft">姓名</view>
  24. <view class="lineRight">
  25. <input type="text" v-model="customerName" class="lineInput" placeholder="请填写姓名"/>
  26. </view>
  27. </view>
  28. <view class="line">
  29. <view class="lineLeft">手机号</view>
  30. <view class="lineRight">
  31. <input type="text" v-model="mobilePhone" class="lineInput" placeholder="请填写手机号"/>
  32. </view>
  33. </view>
  34. <view class="line">
  35. <view class="lineLeft">车牌号</view>
  36. <view class="lineRight">
  37. <input type="text" v-model="plateNumber" class="lineInput" placeholder="请填写车牌号"/>
  38. </view>
  39. </view>
  40. <view class="line">
  41. <view class="lineLeft">车型</view>
  42. <view class="lineRight2">
  43. <view class="cxBox" @click="carmodel(1)">
  44. <img src="../../static/img/icon_checked.png" v-if="carmodelType==1" alt="" class="cxIcon"/>
  45. <img src="../../static/img/ckn.png" v-if="carmodelType==2" alt="" class="cxIcon"/>
  46. <span>丰田网约车</span>
  47. </view>
  48. <view class="cxBox" @click="carmodel(2)" style="padding-left: 20rpx;">
  49. <img src="../../static/img/icon_checked.png" v-if="carmodelType==2" alt="" class="cxIcon"/>
  50. <img src="../../static/img/ckn.png" v-if="carmodelType==1" alt="" class="cxIcon"/>
  51. <span>其他网约车</span>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="line">
  56. <view class="lineLeft">上传图片</view>
  57. <view class="lineImgBOx">
  58. <view class="lineimghz" v-for="(item,index) in imgListArr">
  59. <img src="../../static/img/del.png" alt="" class="lineimgdel" @click="delimg(index)" >
  60. <img :src="item" alt="" class="lineimg" @click="previewImage(item)">
  61. </view>
  62. <view class="lineimghz" @click="upimg">
  63. <img src="../../static/img/scimg.png" alt="" class="lineimg">
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="submit" @click="submit">提交</view>
  70. <w-compress ref='wCompress' />
  71. </view>
  72. </template>
  73. <script>
  74. import WCompress from '@/components/w-compress/w-compress.vue'
  75. export default {
  76. components: {
  77. WCompress
  78. },
  79. data() {
  80. return {
  81. iStatusBarHeight:'',
  82. rzShow:false,
  83. imgListArr:[],
  84. file:'',
  85. customerName:'',
  86. mobilePhone:'',
  87. plateNumber:'',
  88. carmodelType:1,
  89. shopID:'86B933FF-3782-4F82-A192-176E7A45AA13',
  90. shopName:'fzh123',
  91. sourceUserID:'00958045-3341-4AF7-9460-801F5B52E3E2',
  92. sourceName:'姜国远',
  93. }
  94. },
  95. onLoad(opt) {
  96. this.shopID=opt.shopID;
  97. this.shopName=opt.shopName;
  98. this.sourceUserID=opt.sourceUserID;
  99. this.sourceName=opt.sourceName;
  100. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  101. },
  102. created() {
  103. },
  104. methods: {
  105. submit(){
  106. var regex = /(^[安京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-HJ-NP-Z0-9]{5})|([A-HJ-NP-Z0-9]{6}))$)|(^[安京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-HJ-NP-Z0-9]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$)/u;
  107. if (regex.test(this.plateNumber)) {
  108. } else {
  109. uni.showToast({
  110. title: '请输入正确车牌号',
  111. icon: 'none',
  112. duration: 3000
  113. });
  114. return false;
  115. }
  116. uni.showLoading({
  117. title: '加载中'
  118. });
  119. this.isload = false;
  120. this.$http('api/online-apply/add', {
  121. customerName:this.customerName,
  122. mobilePhone:this.mobilePhone,
  123. plateNumber:this.plateNumber,
  124. carmodelType:this.carmodelType,
  125. shopID:this.shopID,
  126. shopName:this.shopName,
  127. sourceUserID:this.sourceUserID,
  128. sourceName:this.sourceName,
  129. imgs:this.imgListArr.join(','),
  130. }, 'POST').then(res => {
  131. uni.hideLoading();
  132. this.isload = true;
  133. if(res.code==0){
  134. uni.navigateTo({
  135. url:'/pages/wyCar/success'
  136. })
  137. }else{
  138. }
  139. })
  140. },
  141. carmodel(num){
  142. this.carmodelType=num
  143. },
  144. delimg(index){
  145. this.imgListArr.splice(index, 1)
  146. },
  147. previewImage(img){
  148. var arr=[]
  149. arr.push(img)
  150. uni.previewImage({
  151. urls: arr,
  152. longPressActions: {
  153. itemList: ['发送给朋友', '保存图片',],
  154. success: function(data) {},
  155. fail: function(err) {}
  156. }
  157. });
  158. },
  159. upimg(){
  160. var that = this;
  161. uni.chooseImage({
  162. sourceType: ['album','camera'],
  163. count:9,
  164. sizeType:['compressed'],
  165. success: (chooseImageRes) => {
  166. const tempFilePaths = chooseImageRes.tempFilePaths;
  167. //console.log(tempFilePaths)
  168. that.file=tempFilePaths
  169. that.$refs.wCompress.start(that.file, {
  170. pixels: 600000, // 最大分辨率,默认二百万
  171. quality: 0.9, // 压缩质量,默认0.8
  172. type: 'png', // 图片类型,默认jpg
  173. base64: true, // 是否返回base64,默认false,非H5有效
  174. }).then(resxx => {
  175. // console.log(resxx)
  176. resxx.forEach(item=>{
  177. uni.uploadFile({
  178. url: that.$request.baseUrl+'api/online-apply/uploadFile', //仅为示例,非真实的接口地址
  179. filePath: item,
  180. name: 'file',
  181. formData: {
  182. 'user': 'test'
  183. },
  184. success: (uploadFileRes) => {
  185. that.imgListArr=that.imgListArr.concat(JSON.parse(uploadFileRes.data).data)
  186. }
  187. });
  188. })
  189. }).catch(e => {
  190. })
  191. }
  192. });
  193. },
  194. goback(){
  195. //app交互
  196. var standalone = window.navigator.standalone
  197. var userAgent = window.navigator.userAgent.toLowerCase()
  198. var safari = /safari/.test(userAgent)
  199. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  200. var android = /android/.test(userAgent)
  201. if (ios) {
  202. if ( true) {//!standalone&& !safari
  203. window.webkit.messageHandlers.goMyNav.postMessage(null)
  204. }
  205. } else if (android) {
  206. window.android.postMessage()
  207. }
  208. },
  209. }
  210. }
  211. </script>
  212. <style scoped>
  213. .box{
  214. padding: 0 24rpx;
  215. }
  216. .submit{
  217. width: 493rpx;
  218. height: 74rpx;
  219. background: #FF8130;
  220. border-radius: 37rpx;
  221. font-weight: 500;
  222. color: #FFFFFF;
  223. font-size: 30rpx;
  224. line-height: 74rpx;
  225. text-align: center;
  226. margin: 0 auto;
  227. margin-top: 40rpx;
  228. }
  229. .cont{
  230. background: #FFFFFF;border-radius: 10rpx;
  231. padding: 0 20rpx;
  232. }
  233. .cxBox{
  234. display: flex;line-height: 28rpx;
  235. padding-top: 6rpx;
  236. }
  237. .cxBox span{
  238. color: #3C3C3C;padding-left: 8rpx;
  239. }
  240. .cxIcon{
  241. width: 28rpx;
  242. height: 28rpx;
  243. }
  244. .lineImgBOx{
  245. display: flex;
  246. flex-wrap: wrap;
  247. width: 540rpx;
  248. }
  249. .lineimghz{
  250. margin-right: 24rpx;
  251. position: relative;
  252. margin-bottom: 24rpx;
  253. }
  254. .lineimg{
  255. width: 150rpx;
  256. height: 150rpx;
  257. border-radius: 6rpx;
  258. }
  259. .lineimgdel{
  260. width: 37rpx;
  261. height: 37rpx;
  262. position: absolute;
  263. top: -18rpx;
  264. right: -18rpx;
  265. }
  266. .lineRight2{
  267. display: flex;
  268. }
  269. .line{
  270. display: flex;font-size: 28rpx;
  271. color: #666666;padding: 29rpx 0;
  272. border-bottom: 1px solid #EEEEEE;
  273. }
  274. .lineLeft{
  275. width: 130rpx;
  276. }
  277. .lineInput{
  278. font-size: 28rpx; color: #3c3c3c;
  279. }
  280. .top{
  281. color: #666666;font-size: 28rpx;
  282. line-height: 40rpx;padding: 20rpx 44rpx;
  283. }
  284. .content{
  285. min-height: 100vh;
  286. background: #F6F6F6;
  287. }
  288. .zdyNavBox {
  289. width: 100vw;
  290. background: #FFFFFF;
  291. position: fixed;
  292. top: 0;
  293. left: 0;
  294. z-index: 99;
  295. }
  296. .zdyNav {
  297. height: 44px;
  298. display: flex;
  299. justify-content: space-between;
  300. align-items: center;
  301. }
  302. .backImg {
  303. width: 44rpx;
  304. height: 44rpx;
  305. margin-left: 10rpx;
  306. margin-right: 20rpx;
  307. }
  308. .homeImg {
  309. width: 44rpx;
  310. height: 44rpx;
  311. }
  312. .zdyNavLeft {
  313. display: flex;
  314. align-items: center;
  315. }
  316. .zdyNavTitle {
  317. height: 44px;
  318. background: #FFFFFF;
  319. text-align: center;
  320. font-size: 34rpx;
  321. line-height: 44px;
  322. }
  323. .tab {
  324. background: #FFFFFF;
  325. display: flex;
  326. justify-content: space-between;
  327. line-height: 92rpx;
  328. /* position: fixed; */
  329. width: calc(100vw - 100rpx);
  330. padding-left: 50rpx;
  331. padding-right: 50rpx;
  332. height: 92rpx;
  333. z-index: 11;
  334. border-top: 1px solid #EEEEEE;
  335. }
  336. .tabLine {
  337. font-size: 28rpx;
  338. color: #333333;
  339. text-align: center;
  340. }
  341. .tabActive {
  342. color: #FF0000;
  343. font-weight: bold;
  344. border-bottom: 4rpx solid #FF0000;
  345. }
  346. .main {
  347. padding-top: 260rpx;
  348. padding-bottom: 20rpx;
  349. background-color: #F4F5F7;
  350. }
  351. .itemBg {
  352. margin: 20rpx 24rpx;
  353. background-color: #FFFFFF;
  354. border-radius: 10rpx;
  355. padding: 20rpx;
  356. }
  357. .itemTop {
  358. display: flex;
  359. justify-content: space-between;
  360. }
  361. .itemType {
  362. color: #999999;
  363. font-size: 24rpx;
  364. }
  365. .itemSheetState {
  366. font-size: 24rpx;
  367. color: #999999
  368. }
  369. .redColor {
  370. color: #FF0000;
  371. }
  372. .orangeColor {
  373. color: #F19D01;
  374. }
  375. .greenColor {
  376. color: #00A040;
  377. }
  378. .itemShopBg {
  379. display: flex;
  380. justify-content: space-between;
  381. margin-top: 20rpx;
  382. }
  383. .shopName {
  384. color: #333333;
  385. font-size: 30rpx;
  386. font-weight: bold;
  387. /* 隐藏文字显示 ...不换行 */
  388. overflow: hidden;
  389. text-overflow: ellipsis;
  390. white-space: nowrap;
  391. }
  392. .price {
  393. color: #333333;
  394. font-weight: bold;
  395. font-size: 32rpx;
  396. }
  397. .itemName {
  398. color: #666666;
  399. font-size: 24rpx;
  400. padding-top: 16rpx;
  401. height: 30rpx;
  402. overflow: hidden;
  403. text-overflow: ellipsis;
  404. white-space: nowrap;
  405. }
  406. .plateBg {
  407. display: flex;
  408. justify-content: space-between;
  409. align-items: center;
  410. }
  411. .plateNumber {
  412. color: #666666;
  413. font-size: 24rpx;
  414. margin-bottom: 20rpx;
  415. display: flex;
  416. }
  417. .itemLineBottom {
  418. display: flex;
  419. justify-content: flex-end;
  420. }
  421. .itemBtn1 {
  422. width: 150rpx;
  423. height: 56rpx;
  424. border-radius: 36rpx;
  425. border: 2rpx solid #DDDDDD;
  426. text-align: center;
  427. line-height: 56rpx;
  428. font-size: 28rpx;
  429. color: #3C3C3C;
  430. margin-left: 40rpx;
  431. }
  432. .itemBtn2 {
  433. width: 150rpx;
  434. height: 56rpx;
  435. border-radius: 36rpx;
  436. border: 2rpx solid #FF4F00;
  437. text-align: center;
  438. line-height: 56rpx;
  439. font-size: 28rpx;
  440. color: #FF4F00;
  441. margin-left: 40rpx;
  442. }
  443. .orderState {
  444. color: #F19D01;
  445. font-size: 24rpx;
  446. padding-left: 20rpx;
  447. }
  448. .renBox{
  449. color: #1A1A1A;
  450. background: #F7F7F7;
  451. border-radius: 10rpx;
  452. display: flex;
  453. padding: 20rpx;font-size: 24rpx;
  454. line-height: 30rpx;
  455. margin-top: 16rpx;
  456. }
  457. .renimg{
  458. width: 30rpx;height: 30rpx;
  459. }
  460. .renMobilePhone{
  461. padding-left: 13rpx;
  462. }
  463. .itemaddress{
  464. font-size: 24rpx;display: flex;
  465. color: #3C3C3C;padding-top: 16rpx;
  466. line-height: 33rpx;
  467. }
  468. .addressDD{
  469. width: 10rpx;
  470. height: 10rpx;
  471. background: #FF0000;
  472. border-radius: 50%;
  473. margin-top: 10rpx;
  474. margin-right: 5rpx;
  475. }
  476. .sschahao{
  477. width: 40rpx;
  478. height: 40rpx;
  479. padding-top: 16rpx;
  480. }
  481. </style>