apply.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  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. uni.showLoading({
  107. title: '加载中'
  108. });
  109. this.isload = false;
  110. this.$http('api/online-apply/add', {
  111. customerName:this.customerName,
  112. mobilePhone:this.mobilePhone,
  113. plateNumber:this.plateNumber,
  114. carmodelType:this.carmodelType,
  115. shopID:this.shopID,
  116. shopName:this.shopName,
  117. sourceUserID:this.sourceUserID,
  118. sourceName:this.sourceName,
  119. imgs:this.imgListArr.join(','),
  120. }, 'POST').then(res => {
  121. uni.hideLoading();
  122. this.isload = true;
  123. if(res.code==0){
  124. uni.navigateTo({
  125. url:'/pages/wyCar/success'
  126. })
  127. }else{
  128. }
  129. })
  130. },
  131. carmodel(num){
  132. this.carmodelType=num
  133. },
  134. delimg(index){
  135. this.imgListArr.splice(index, 1)
  136. },
  137. previewImage(img){
  138. var arr=[]
  139. arr.push(img)
  140. uni.previewImage({
  141. urls: arr,
  142. longPressActions: {
  143. itemList: ['发送给朋友', '保存图片',],
  144. success: function(data) {},
  145. fail: function(err) {}
  146. }
  147. });
  148. },
  149. upimg(){
  150. var that = this;
  151. uni.chooseImage({
  152. sourceType: ['album','camera'],
  153. count:9,
  154. sizeType:['compressed'],
  155. success: (chooseImageRes) => {
  156. const tempFilePaths = chooseImageRes.tempFilePaths;
  157. that.file=tempFilePaths[0]
  158. that.$refs.wCompress.start(that.file, {
  159. pixels: 600000, // 最大分辨率,默认二百万
  160. quality: 0.9, // 压缩质量,默认0.8
  161. type: 'png', // 图片类型,默认jpg
  162. base64: true, // 是否返回base64,默认false,非H5有效
  163. }).then(resxx => {
  164. uni.uploadFile({
  165. url: that.$request.baseUrl+'api/online-apply/uploadFile', //仅为示例,非真实的接口地址
  166. filePath: resxx,
  167. name: 'file',
  168. formData: {
  169. 'user': 'test'
  170. },
  171. success: (uploadFileRes) => {
  172. that.imgListArr=that.imgListArr.concat(JSON.parse(uploadFileRes.data).data)
  173. }
  174. });
  175. }).catch(e => {
  176. })
  177. }
  178. });
  179. },
  180. goback(){
  181. //app交互
  182. var standalone = window.navigator.standalone
  183. var userAgent = window.navigator.userAgent.toLowerCase()
  184. var safari = /safari/.test(userAgent)
  185. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  186. var android = /android/.test(userAgent)
  187. if (ios) {
  188. if ( true) {//!standalone&& !safari
  189. window.webkit.messageHandlers.goMyNav.postMessage(null)
  190. }
  191. } else if (android) {
  192. window.android.postMessage()
  193. }
  194. },
  195. }
  196. }
  197. </script>
  198. <style scoped>
  199. .box{
  200. padding: 0 24rpx;
  201. }
  202. .submit{
  203. width: 493rpx;
  204. height: 74rpx;
  205. background: #FF8130;
  206. border-radius: 37rpx;
  207. font-weight: 500;
  208. color: #FFFFFF;
  209. font-size: 30rpx;
  210. line-height: 74rpx;
  211. text-align: center;
  212. margin: 0 auto;
  213. margin-top: 40rpx;
  214. }
  215. .cont{
  216. background: #FFFFFF;border-radius: 10rpx;
  217. padding: 0 20rpx;
  218. }
  219. .cxBox{
  220. display: flex;line-height: 28rpx;
  221. padding-top: 6rpx;
  222. }
  223. .cxBox span{
  224. color: #3C3C3C;padding-left: 8rpx;
  225. }
  226. .cxIcon{
  227. width: 28rpx;
  228. height: 28rpx;
  229. }
  230. .lineImgBOx{
  231. display: flex;
  232. flex-wrap: wrap;
  233. }
  234. .lineimghz{
  235. margin-right: 24rpx;
  236. position: relative;
  237. margin-bottom: 24rpx;
  238. }
  239. .lineimg{
  240. width: 150rpx;
  241. height: 150rpx;
  242. }
  243. .lineimgdel{
  244. width: 37rpx;
  245. height: 37rpx;
  246. position: absolute;
  247. top: -18rpx;
  248. right: -18rpx;
  249. }
  250. .lineRight2{
  251. display: flex;
  252. }
  253. .line{
  254. display: flex;font-size: 28rpx;
  255. color: #666666;padding: 29rpx 0;
  256. border-bottom: 1px solid #EEEEEE;
  257. }
  258. .lineLeft{
  259. width: 130rpx;
  260. }
  261. .lineInput{
  262. font-size: 28rpx;
  263. }
  264. .top{
  265. color: #666666;font-size: 28rpx;
  266. line-height: 40rpx;padding: 20rpx 44rpx;
  267. }
  268. .content{
  269. min-height: 100vh;
  270. background: #F6F6F6;
  271. }
  272. .zdyNavBox {
  273. width: 100vw;
  274. background: #FFFFFF;
  275. position: fixed;
  276. top: 0;
  277. left: 0;
  278. z-index: 99;
  279. }
  280. .zdyNav {
  281. height: 44px;
  282. display: flex;
  283. justify-content: space-between;
  284. align-items: center;
  285. }
  286. .backImg {
  287. width: 44rpx;
  288. height: 44rpx;
  289. margin-left: 10rpx;
  290. margin-right: 20rpx;
  291. }
  292. .homeImg {
  293. width: 44rpx;
  294. height: 44rpx;
  295. }
  296. .zdyNavLeft {
  297. display: flex;
  298. align-items: center;
  299. }
  300. .zdyNavTitle {
  301. height: 44px;
  302. background: #FFFFFF;
  303. text-align: center;
  304. font-size: 34rpx;
  305. line-height: 44px;
  306. }
  307. .tab {
  308. background: #FFFFFF;
  309. display: flex;
  310. justify-content: space-between;
  311. line-height: 92rpx;
  312. /* position: fixed; */
  313. width: calc(100vw - 100rpx);
  314. padding-left: 50rpx;
  315. padding-right: 50rpx;
  316. height: 92rpx;
  317. z-index: 11;
  318. border-top: 1px solid #EEEEEE;
  319. }
  320. .tabLine {
  321. font-size: 28rpx;
  322. color: #333333;
  323. text-align: center;
  324. }
  325. .tabActive {
  326. color: #FF0000;
  327. font-weight: bold;
  328. border-bottom: 4rpx solid #FF0000;
  329. }
  330. .main {
  331. padding-top: 260rpx;
  332. padding-bottom: 20rpx;
  333. background-color: #F4F5F7;
  334. }
  335. .itemBg {
  336. margin: 20rpx 24rpx;
  337. background-color: #FFFFFF;
  338. border-radius: 10rpx;
  339. padding: 20rpx;
  340. }
  341. .itemTop {
  342. display: flex;
  343. justify-content: space-between;
  344. }
  345. .itemType {
  346. color: #999999;
  347. font-size: 24rpx;
  348. }
  349. .itemSheetState {
  350. font-size: 24rpx;
  351. color: #999999
  352. }
  353. .redColor {
  354. color: #FF0000;
  355. }
  356. .orangeColor {
  357. color: #F19D01;
  358. }
  359. .greenColor {
  360. color: #00A040;
  361. }
  362. .itemShopBg {
  363. display: flex;
  364. justify-content: space-between;
  365. margin-top: 20rpx;
  366. }
  367. .shopName {
  368. color: #333333;
  369. font-size: 30rpx;
  370. font-weight: bold;
  371. /* 隐藏文字显示 ...不换行 */
  372. overflow: hidden;
  373. text-overflow: ellipsis;
  374. white-space: nowrap;
  375. }
  376. .price {
  377. color: #333333;
  378. font-weight: bold;
  379. font-size: 32rpx;
  380. }
  381. .itemName {
  382. color: #666666;
  383. font-size: 24rpx;
  384. padding-top: 16rpx;
  385. height: 30rpx;
  386. overflow: hidden;
  387. text-overflow: ellipsis;
  388. white-space: nowrap;
  389. }
  390. .plateBg {
  391. display: flex;
  392. justify-content: space-between;
  393. align-items: center;
  394. }
  395. .plateNumber {
  396. color: #666666;
  397. font-size: 24rpx;
  398. margin-bottom: 20rpx;
  399. display: flex;
  400. }
  401. .itemLineBottom {
  402. display: flex;
  403. justify-content: flex-end;
  404. }
  405. .itemBtn1 {
  406. width: 150rpx;
  407. height: 56rpx;
  408. border-radius: 36rpx;
  409. border: 2rpx solid #DDDDDD;
  410. text-align: center;
  411. line-height: 56rpx;
  412. font-size: 28rpx;
  413. color: #3C3C3C;
  414. margin-left: 40rpx;
  415. }
  416. .itemBtn2 {
  417. width: 150rpx;
  418. height: 56rpx;
  419. border-radius: 36rpx;
  420. border: 2rpx solid #FF4F00;
  421. text-align: center;
  422. line-height: 56rpx;
  423. font-size: 28rpx;
  424. color: #FF4F00;
  425. margin-left: 40rpx;
  426. }
  427. .orderState {
  428. color: #F19D01;
  429. font-size: 24rpx;
  430. padding-left: 20rpx;
  431. }
  432. .renBox{
  433. color: #1A1A1A;
  434. background: #F7F7F7;
  435. border-radius: 10rpx;
  436. display: flex;
  437. padding: 20rpx;font-size: 24rpx;
  438. line-height: 30rpx;
  439. margin-top: 16rpx;
  440. }
  441. .renimg{
  442. width: 30rpx;height: 30rpx;
  443. }
  444. .renMobilePhone{
  445. padding-left: 13rpx;
  446. }
  447. .itemaddress{
  448. font-size: 24rpx;display: flex;
  449. color: #3C3C3C;padding-top: 16rpx;
  450. line-height: 33rpx;
  451. }
  452. .addressDD{
  453. width: 10rpx;
  454. height: 10rpx;
  455. background: #FF0000;
  456. border-radius: 50%;
  457. margin-top: 10rpx;
  458. margin-right: 5rpx;
  459. }
  460. .sschahao{
  461. width: 40rpx;
  462. height: 40rpx;
  463. padding-top: 16rpx;
  464. }
  465. </style>