DdcheshouyeN.nvue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. <template>
  2. <view>
  3. <view class="topContentV">
  4. <view class="contentInRowS" style="width:700rpx">
  5. <image style="width: 56rpx;height: 56rpx;" src="/static/images/fanhuiy@3x.png" mode="scaleToFill" @click="fanhui"></image>
  6. <image style="width: 44rpx;height: 44rpx;" src="/static/images/dache/546@3x.png" mode="scaleToFill" @click="navbarsel(0)"></image>
  7. </view>
  8. </view>
  9. <view class="leftpopo">
  10. <uni-drawer ref="showLeft" mode="left" :width="250" @change="change($event,'showLeft')">
  11. <view class="leftpopo">
  12. <view class="contentInRowR" style="margin-top: 100rpx;margin-right: 16rpx;" @click="closeDrawer('showLeft')">
  13. <image style="width: 60rpx;height: 60rpx;" src="/static/images/dache/dacha@3x.png" mode="scaleToFill"></image>
  14. </view>
  15. <view class="contentInRowL" style="margin-top: 20rpx;margin-bottom: 30rpx;margin-left: 30rpx;align-items: center;" @click="gotousercenter">
  16. <netImage class="iconImg" width="120" height="120" bradius="60" :mysrc="userInfo.avatar" mymode="scaleToFill"></netImage>
  17. <view v-if="userInfo!=''" class="contentColumn" style="padding-left: 20rpx;">
  18. <text class="nameText">{{userInfo.nickName}}</text>
  19. <text class="phoneText">{{userInfo.userName}}</text>
  20. </view>
  21. </view>
  22. <view class="contentInRowL drawerlist" @click="gotochezhurz(1)">
  23. <image class="drawerlistIcon" src="/static/images/dache/xingchengjil.png" mode="scaleToFill"></image>
  24. <text class="drawerlisttext">{{i18n('dache.xingchengjl')}}</text>
  25. </view>
  26. <view class="contentInRowL drawerlist" @click="gotochezhurz(2)">
  27. <image class="drawerlistIcon" src="/static/images/dache/kfzx@3x.png" mode="scaleToFill"></image>
  28. <text class="drawerlisttext">{{i18n('dache.lianxikefu')}}</text>
  29. </view>
  30. </view>
  31. </uni-drawer>
  32. </view>
  33. <view class="" v-if="isShow">
  34. <web-view style="background-color: #fafafa;" ref="webview" :style="{ height: statusBarHeight + 'px' }" @onPostMessage="getMessage" :src="webUrl"></web-view>
  35. </view>
  36. <view v-if="Keyboar" class="bottomfloatV">
  37. <dachexingcheng v-if="actIndex==0" :XChengObj="XChengObj" :xiugai="xiugaimdd" :weizhifu="wzfState" v-on:EXCactSelect="XCactSelect"></dachexingcheng>
  38. <dachexuancx v-if="actIndex==1" :XChengObj="XChengObj" v-on:EQuerenhj="Querenhj"></dachexuancx>
  39. <dachedengdai v-if="actIndex==2" :timeInde="dengdai" v-on:EddSelect="dengdaiSel"></dachedengdai>
  40. <dachesijijied v-if="actIndex==3" :XChengObj="XChengObj" v-on:EJDactSelect="JDactSelect"></dachesijijied>
  41. <dachejiesuan v-if="actIndex==4" :XChengObj="XChengObj" :qibuf="qibuf" v-on:EZfSelect="ZfSelect"></dachejiesuan>
  42. </view>
  43. <uni-popup style="z-index: 9999;" ref="popMsg" type="center" :isMaskClick="true" :safeArea="true">
  44. <view class="contentColumnC popviewContent">
  45. <text style="text-align: center;font-size: 32rpx;margin-top: 80rpx;">订单已超5分钟,此时取消 需支付一定的费用</text>
  46. <view class="contentInRowS" style="width: 80%;">
  47. <text class="quxiaoBt" @click="popQueren(0)">取消</text>
  48. <text class="querenBt" @click="popQueren(1)">确认</text>
  49. </view>
  50. </view>
  51. </uni-popup>
  52. </view>
  53. </template>
  54. <script>
  55. import api from "@/pages/api/api.js"
  56. export default {
  57. data() {
  58. return {
  59. statusBarHeight: 0, //可视屏幕的高度
  60. webUrl: '',
  61. isShow: false,
  62. lat: '',
  63. lng: '',
  64. Keyboar:true,
  65. isReady:false,
  66. showLeft: false,
  67. userInfo:'',
  68. actIndex:0,//0选择目的地,1确认叫车,2等待司机接单,3司机接单,4结算
  69. xiugaimdd:0,
  70. wzfState:0,
  71. TPricesObj:'',
  72. XChengObj:'',
  73. qibuf:0,
  74. dengdai:0,
  75. timer:'',
  76. wv:'',
  77. };
  78. },
  79. onLoad(e) {
  80. uni.onKeyboardHeightChange(this.onKeyboardHeightChange);
  81. this.computedScreenHeight();
  82. // #ifdef APP-PLUS
  83. this.getlocetion();
  84. // #endif
  85. // #ifdef H5
  86. this.lng = 113.64360881345777;
  87. this.lat = 34.738282020827825;
  88. //this.webUrl = '/hybrid/html/maps/mapindex.html?lat=' + this.lat + '&lng=' + this.lng+'&nlng=0&nlat=0';
  89. this.isShow = true;
  90. // #endif
  91. var token = getApp().globalData.token;
  92. this.getUserMsg(token);
  93. uni.onPushMessage((res) => {
  94. console.log('onPushMessage',res);
  95. if(null==res.data.payload||undefined==res.data.payload||''==res.data.payload){
  96. return;
  97. }
  98. if(this.isReady){
  99. this.getOrderlist();
  100. }
  101. });
  102. },
  103. onReady() {
  104. this.getTaxiPrices();
  105. this.getOrderlist();
  106. this.isReady=true;
  107. },
  108. onShow() {
  109. if(this.isReady){
  110. this.getOrderlist();
  111. }
  112. },
  113. onUnload() {
  114. uni.offKeyboardHeightChange(this.onKeyboardHeightChange);
  115. },
  116. methods: {
  117. onKeyboardHeightChange(res) {
  118. const { height, duration } = res;
  119. // 键盘弹起
  120. if (height > 0) {
  121. console.log('键盘弹起');
  122. this.Keyboar=false;
  123. }
  124. // 键盘收回
  125. else {
  126. console.log('键盘收回');
  127. this.Keyboar=true;
  128. }
  129. },
  130. i18n(str){
  131. return getApp().globalData.$t(str);
  132. },
  133. navbarsel(index){
  134. this.$refs.showLeft.open()
  135. },
  136. closeDrawer(e){
  137. this.$refs[e].close()
  138. },
  139. // 抽屉状态发生变化触发
  140. change(e, type) {
  141. //console.log((type === 'showLeft' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
  142. this[type] = e
  143. },
  144. fanhui(){
  145. uni.navigateBack();
  146. },
  147. gotousercenter(){
  148. uni.navigateTo({
  149. url:'/pages/UserCenter/UserCenter'
  150. })
  151. },
  152. gotochezhurz(index){
  153. if(index==1){
  154. uni.navigateTo({
  155. url:'/pages/dache/XingchengList'
  156. })
  157. }
  158. if(index==2){//联系客服,直接打电话
  159. uni.showModal({
  160. title:'提示',
  161. content:'确定联系客服吗?',
  162. confirmText:'确认',
  163. cancelText:'取消',
  164. success: function (res) {
  165. if (res.confirm) { //这里是点击了确定以后
  166. plus.device.dial('', false );
  167. } else { //这里是点击了取消以后
  168. console.log('点击取消')
  169. }
  170. }
  171. })
  172. }
  173. },
  174. getUserMsg(token){
  175. //console.log('getUserMsg')
  176. api('getUserMsg',{
  177. },res=>{
  178. //console.log(res.data)
  179. if(res.data.code==200){
  180. console.log('this.userInfo',res.data)
  181. this.userInfo=res.data.data;
  182. uni.setStorageSync('userInfo',res.data.data);
  183. if(res.data.data.userType==1){
  184. this.isShangjia=true;
  185. }
  186. }
  187. },failc=>{
  188. //console.log('getadvertis----',failc)
  189. })
  190. },
  191. popQueren(index){
  192. if(index==0){
  193. this.$refs.popMsg.close();
  194. return;
  195. }
  196. if(index==1){
  197. this.$refs.popMsg.close();
  198. console.log('确认')
  199. return;
  200. }
  201. if(index==3){
  202. this.$refs.popMsg.open('center');
  203. }
  204. },
  205. XCactSelect(index,mdaddr){
  206. if(index==0){//处理未完成订单
  207. uni.navigateTo({
  208. url:'/pages/dache/XingchengList'
  209. })
  210. return;
  211. }
  212. if(index==1){//刷新定位
  213. this.getlocetion();
  214. }
  215. if(index==2){//我要叫车
  216. if(this.XChengObj==''){
  217. uni.showToast({
  218. title:'请选择目的地',//that.i18n('api.wangluoshibai'),
  219. icon: 'none',
  220. duration: 2500
  221. })
  222. return
  223. }
  224. if(this.XChengObj.downLatitude==0||this.XChengObj.downLongitude==0){
  225. uni.showToast({
  226. title:'请选择目的地',//that.i18n('api.wangluoshibai'),
  227. icon: 'none',
  228. duration: 2500
  229. })
  230. return;
  231. }
  232. this.actIndex=1;
  233. //this.jisuanxingcheng();
  234. }
  235. if(index==3){//确认修改目的地
  236. this.actIndex=0;
  237. this.$refs.webview.evalJs("showInputView()");
  238. }
  239. if(index==4){//输入目的地
  240. }
  241. },
  242. Querenhj(obj){
  243. var distance=obj.distance;
  244. var fare = (distance-this.TPricesObj.startingDistance)*this.TPricesObj.skipPrice;
  245. var amount=fare+this.TPricesObj.startingPrice;
  246. obj.fare = fare;
  247. obj.amount = amount;
  248. this.addTxorder(obj);
  249. },
  250. JDactSelect(index){
  251. if(index==0){//取消订单
  252. var that = this;
  253. uni.showModal({
  254. title:'取消行程',
  255. content:'确认取消行程吗?',
  256. cancelText:that.i18n('order.quxiao'),
  257. confirmText:that.i18n('comp.queren'),
  258. success: function (res) {
  259. if (res.confirm) { //这里是点击了确定以后
  260. var data = {
  261. id:that.XChengObj.id,
  262. state:6
  263. }
  264. that.SetTxorder(data,0);
  265. } else { //这里是点击了取消以后
  266. console.log('用户点击取消')
  267. }
  268. }
  269. })
  270. }
  271. if(index==1){//打电话
  272. var that = this;
  273. uni.showModal({
  274. title:'提示',
  275. content:'确定联系司机吗?',
  276. confirmText:'确认',
  277. cancelText:'取消',
  278. success: function (res) {
  279. if (res.confirm) { //这里是点击了确定以后
  280. plus.device.dial(that.XChengObj.driver.phone, false );
  281. } else { //这里是点击了取消以后
  282. console.log('点击取消')
  283. }
  284. }
  285. })
  286. return;
  287. }
  288. if(index==2){//司机聊天
  289. uni.navigateTo({
  290. url:'/pages/dache/Xiaoxijiaohu?id='+this.XChengObj.id
  291. })
  292. }
  293. if(index==3){//一键报警
  294. var that = this;
  295. uni.showModal({
  296. title:'提示',
  297. content:'拨打110报警吗?(请谨慎拨打)',
  298. confirmText:'确认',
  299. cancelText:'取消',
  300. success: function (res) {
  301. if (res.confirm) { //这里是点击了确定以后
  302. plus.device.dial('110', false );
  303. } else { //这里是点击了取消以后
  304. console.log('点击取消')
  305. }
  306. }
  307. })
  308. return;
  309. }
  310. if(index==4){//客服中心,直接电话联系
  311. uni.showModal({
  312. title:'提示',
  313. content:'确定联系客服吗?',
  314. confirmText:'确认',
  315. cancelText:'取消',
  316. success: function (res) {
  317. if (res.confirm) { //这里是点击了确定以后
  318. plus.device.dial('', false );
  319. } else { //这里是点击了取消以后
  320. console.log('点击取消')
  321. }
  322. }
  323. })
  324. }
  325. if(index==5){//申请修改目的地
  326. this.actIndex=0;
  327. this.xiugaimdd=1;
  328. this.drowRoute(1);
  329. }
  330. if(index==6){//语音留言
  331. uni.showToast({
  332. title:'待完善',//that.i18n('api.wangluoshibai'),
  333. icon: 'none',
  334. duration: 2500
  335. })
  336. }
  337. },
  338. ZfSelect(index){
  339. if(index==1){
  340. this.actIndex=0;
  341. this.XChengObj = '';
  342. this.wzfState=0;
  343. this.getlocetion();
  344. }
  345. },
  346. startTime(){
  347. this.dengdai=0;
  348. this.timer = setInterval(() => {
  349. this.dengdai=this.dengdai+1;
  350. }, 1000);
  351. },
  352. endTime(){
  353. this.dengdai=0;
  354. clearInterval(this.timer);
  355. },
  356. dengdaiSel(index){
  357. //取消订单
  358. var that = this;
  359. uni.showModal({
  360. title:'取消行程',
  361. content:'确认取消行程吗?',
  362. cancelText:that.i18n('order.quxiao'),
  363. confirmText:that.i18n('comp.queren'),
  364. success: function (res) {
  365. if (res.confirm) { //这里是点击了确定以后
  366. var data = {
  367. id:that.XChengObj.id,
  368. state:6
  369. }
  370. that.SetTxorder(data,0);
  371. } else { //这里是点击了取消以后
  372. console.log('用户点击取消')
  373. }
  374. }
  375. })
  376. },
  377. //data ready--------------------
  378. drowRoute(index){
  379. console.log('drowRoute');
  380. var slat,slng,nlat,nlng;
  381. slat=this.XChengObj.intoLatitude;
  382. slng=this.XChengObj.intoLongitude;
  383. nlat=this.XChengObj.downLatitude;
  384. nlng=this.XChengObj.downLongitude;
  385. //this.webUrl = '/hybrid/html/maps/mapindex.html?lat='+slat+'&lng='+slng+'&nlat='+nlat+'&nlng='+nlng;
  386. if(index==1){
  387. setTimeout(()=>{
  388. this.$refs.webview.evalJs("showInputView()");
  389. },1000)
  390. }
  391. else{
  392. setTimeout(()=>{
  393. this.$refs.webview.evalJs("hidInputView()");
  394. },1000)
  395. }
  396. },
  397. jisuanxingcheng(){
  398. var distance=20.5;
  399. var fare = (distance-this.TPricesObj.startingDistance)*this.TPricesObj.skipPrice;
  400. var amount=fare+this.TPricesObj.startingPrice;
  401. this.XChengObj={
  402. "fare":fare, //路程车费
  403. "taxiType": "0", //订单类型(0快车,1顺风车)
  404. "amount": amount, //订单实制金额
  405. "intoLongitude":this.longitude, //上车经度
  406. "intoLatitude":this.latitude, //上车纬度
  407. "notes": "", //备注
  408. "coupon": 0, //优惠金额
  409. "distance":distance, //路程距离
  410. "boardingAddress": "衡阳路112号栖木咖啡", //上车地址
  411. "estimatedDuration": "56分钟", //路上预计用时
  412. "userId": this.userInfo.userId,
  413. "downLatitude": 108.562067, //下车维度
  414. "downLongitude": 22.745051, //下车经度
  415. "downAddress": "民族大道民歌湖广场" //下车地址
  416. }
  417. },
  418. //net work---------------------------------
  419. getTaxiPrices(){
  420. api('getTaxiPrices',{
  421. },res=>{
  422. console.log('getTaxiPrices-------',res)
  423. if(res.data.code==200){
  424. this.TPricesObj=res.data.data;
  425. }
  426. else{
  427. uni.showToast({
  428. title:'获取打车价格失败',//that.i18n('api.wangluoshibai'),
  429. icon: 'none',
  430. duration: 2500
  431. })
  432. }
  433. },failc=>{
  434. //console.log('getTaxiPrices----',failc)
  435. uni.showToast({
  436. title:'网络错误',//that.i18n('api.wangluoshibai'),
  437. icon: 'none',
  438. duration: 2500
  439. })
  440. })
  441. },
  442. addTxorder(data){
  443. api('addTxorder',data,res=>{
  444. console.log('addTxorder-------',res)
  445. if(res.data.code==200){
  446. this.actIndex=2;
  447. this.XChengObj=res.data.data;
  448. this.startTime();
  449. uni.setStorageSync('dachexiaoxi','');
  450. setTimeout(()=>{
  451. this.$refs.webview.evalJs("hidInputView()");
  452. },1000)
  453. }
  454. else{
  455. uni.showToast({
  456. title:'叫车失败',//that.i18n('api.wangluoshibai'),
  457. icon: 'none',
  458. duration: 2500
  459. })
  460. }
  461. },failc=>{
  462. //console.log('getTaxiPrices----',failc)
  463. uni.showToast({
  464. title:'网络错误',//that.i18n('api.wangluoshibai'),
  465. icon: 'none',
  466. duration: 2500
  467. })
  468. })
  469. },
  470. SetTxorder(data,index){
  471. api('SetTxorder',data,res=>{
  472. console.log('SetTxorder------',res)
  473. if(res.data.code==200){
  474. this.actIndex=index;
  475. if(index==0){//取消成功
  476. this.$refs.webview.evalJs("showInputView()");
  477. uni.showToast({
  478. title:'取消成功',//that.i18n('api.wangluoshibai'),
  479. icon: 'none',
  480. duration: 2500
  481. })
  482. this.XChengObj = '';
  483. this.wzfState=0;
  484. this.endTime();
  485. this.getlocetion();
  486. return;
  487. }
  488. uni.showToast({
  489. title:'修改成功',//that.i18n('api.wangluoshibai'),
  490. icon: 'none',
  491. duration: 2500
  492. })
  493. }
  494. else{
  495. uni.showToast({
  496. title:'修改失败',//that.i18n('api.wangluoshibai'),
  497. icon: 'none',
  498. duration: 2500
  499. })
  500. }
  501. },failc=>{
  502. //console.log('getTaxiPrices----',failc)
  503. uni.showToast({
  504. title:'网络错误',//that.i18n('api.wangluoshibai'),
  505. icon: 'none',
  506. duration: 2500
  507. })
  508. })
  509. },
  510. getOrderlist(){
  511. console.log('-----getOrderlist')
  512. api('getUsTxorder',{
  513. page:1,
  514. size:20,
  515. state:'',
  516. type:0
  517. },res=>{
  518. console.log('getUsTxorder-------',res)
  519. if(res.data.code==200){
  520. for(var i=0;i<res.data.data.length;i++){
  521. var tempObj = res.data.data[i];
  522. if(tempObj.state<4){
  523. this.XChengObj = tempObj;
  524. this.getObjDetail(this.XChengObj.id);
  525. this.qibuf=this.TPricesObj.startingPrice;
  526. if(tempObj.state==0){
  527. this.actIndex=2
  528. this.startTime();
  529. }
  530. if(tempObj.state==1||tempObj.state==2){
  531. this.actIndex=3
  532. }
  533. if(tempObj.state==3){
  534. this.actIndex=4
  535. }
  536. this.wzfState=1;
  537. this.drowRoute(0);
  538. return;
  539. }
  540. }
  541. }
  542. else{
  543. uni.showToast({
  544. title:'获取列表失败',//that.i18n('api.wangluoshibai'),
  545. icon: 'none',
  546. duration: 2500
  547. })
  548. }
  549. },failc=>{
  550. //console.log('getTaxiPrices----',failc)
  551. uni.showToast({
  552. title:'网络错误',//that.i18n('api.wangluoshibai'),
  553. icon: 'none',
  554. duration: 2500
  555. })
  556. })
  557. },
  558. getObjDetail(id){
  559. api('getTxorder',{
  560. id:id,
  561. },res=>{
  562. console.log('getTxorder:',res)
  563. if(res.data.code==200){
  564. }
  565. },failc=>{
  566. //console.log('getadvertis----',failc)
  567. })
  568. },
  569. /**
  570. * 获取当前定位
  571. *
  572. * */
  573. getlocetion() {
  574. const self = this;
  575. // 使用高德地图 也可以使用下方的原生插件定位
  576. uni.getLocation({
  577. geocode: true,
  578. type: 'wgs84',
  579. accuracy: "best",
  580. isHighAccuracy: true,
  581. success: (res) => {
  582. console.log('当前位置的经度11:' + JSON.stringify(res));
  583. // console.log('当前位置的经度:' + res.longitude);
  584. // console.log('当前位置的纬度:' + res.latitude);
  585. self.lat = res.latitude;
  586. self.lng = res.longitude;
  587. //self.webUrl = '/hybrid/html/maps/mapindex.html?lat=' + self.lat +'&lng=' +self.lng+'&nlng=0&nlat=0';
  588. self.isShow = true;
  589. }
  590. });
  591. return
  592. let systemInfo = uni.getSystemInfoSync();
  593. let dariusAppSign = uni.requireNativePlugin(systemInfo.platform != 'android' ? 'Darius-GoogleMap' :
  594. 'DCloud-RichAlert');
  595. if (!dariusAppSign) {
  596. return;
  597. }
  598. dariusAppSign.show({
  599. command: 'dingwei'
  600. },
  601. result => {
  602. console.log('dariusAppSign')
  603. var data = result;
  604. if (uni.getSystemInfoSync().platform == 'ios') {
  605. self.lat = data.latitude;
  606. self.lng = data.longitude;
  607. } else {
  608. self.lat = data.longitude;
  609. self.lng = data.latitude;
  610. }
  611. //self.webUrl = '/hybrid/html/maps/mapindex.html?lat=' + self.lat + '&lng=' +self.lng+'&nlng=0&nlat=0';
  612. this.isShow = true;
  613. }
  614. );
  615. },
  616. /**
  617. * 特别注意这里 nvue和vue页面 web-view---->vue ||nvue方式不一样 详情请查看官网 https://uniapp.dcloud.net.cn/component/web-view.html#web-view
  618. *
  619. * */
  620. getMessage(e) {
  621. console.log("--getMessage--",e.detail.data[0]);
  622. if(this.actIndex!=0){
  623. return;
  624. }
  625. var msgObj=e.detail.data[0];
  626. var xcObj=this.XChengObj;
  627. if(xcObj==''){
  628. xcObj={
  629. "fare":'', //路程车费
  630. "taxiType": "0", //订单类型(0快车,1顺风车)
  631. "amount": '', //订单实制金额
  632. "intoLongitude":0, //上车经度
  633. "intoLatitude":0, //上车纬度
  634. "notes": "", //备注
  635. "coupon": 0, //优惠金额
  636. "distance":'', //路程距离
  637. "boardingAddress":'', //上车地址
  638. "estimatedDuration": '', //路上预计用时
  639. "userId": this.userInfo.userId,
  640. "downLatitude":0, //下车维度
  641. "downLongitude":0, //下车经度
  642. "downAddress":'' //下车地址
  643. }
  644. }
  645. if(msgObj.type==0){
  646. var addr=msgObj.cityInfo.city+msgObj.cityInfo.district+msgObj.cityInfo.street;
  647. xcObj.intoLongitude=msgObj.position.lng;//上车经度
  648. xcObj.intoLatitude=msgObj.position.lat; //上车纬度
  649. xcObj.boardingAddress=addr; //上车地址
  650. }
  651. else if(msgObj.type==1){
  652. xcObj.downLongitude=msgObj.position.lng;//下车经度
  653. xcObj.downLatitude=msgObj.position.lat; //下车纬度
  654. xcObj.downAddress=msgObj.cityInfo.name; //下车地址
  655. }
  656. else if(msgObj.type==2){
  657. var distance=parseFloat(msgObj.distance);
  658. console.log(distance);
  659. var fare = (distance-this.TPricesObj.startingDistance)*this.TPricesObj.skipPrice;
  660. var amount=fare+this.TPricesObj.startingPrice;
  661. xcObj.distance=distance;
  662. xcObj.fare=fare;
  663. xcObj.amount=amount;
  664. xcObj.estimatedDuration=msgObj.duration;
  665. }
  666. this.XChengObj=xcObj;
  667. },
  668. // 计算屏幕的高度
  669. computedScreenHeight() {
  670. uni.getSystemInfo({
  671. success: function(e) {
  672. // #ifndef MP
  673. Vue.prototype.StatusBar = e.statusBarHeight;
  674. if (e.platform == 'android') {
  675. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  676. } else {
  677. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  678. }
  679. // #endif
  680. // #ifdef MP-WEIXIN
  681. Vue.prototype.StatusBar = e.statusBarHeight;
  682. let custom = wx.getMenuButtonBoundingClientRect();
  683. Vue.prototype.Custom = custom;
  684. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  685. // #endif
  686. // #ifdef MP-ALIPAY
  687. Vue.prototype.StatusBar = e.statusBarHeight;
  688. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  689. // #endif
  690. let unitRatio = 750 / uni.getSystemInfoSync().windowWidth;
  691. Vue.prototype.StatusBarRpx = Vue.prototype.StatusBar * unitRatio;
  692. Vue.prototype.CustomBarRpx = Vue.prototype.CustomBar * unitRatio;
  693. Vue.prototype.unitRatio = unitRatio;
  694. Vue.mixin({
  695. data() {
  696. return {
  697. StatusBar: Vue.prototype.StatusBar, //状态栏高度(px)
  698. CustomBar: Vue.prototype.CustomBar, //整个标题栏高度(px)
  699. StatusBarRpx: Vue.prototype.StatusBarRpx, //状态栏高度(rpx)
  700. CustomBarRpx: Vue.prototype.CustomBarRpx //整个标题栏高度(rpx)
  701. };
  702. }
  703. });
  704. }
  705. });
  706. // 状态栏高度 导航高度 tab切换的高度 底部导航的高度
  707. this.statusBarHeight = uni.getSystemInfoSync().screenHeight;
  708. },
  709. },
  710. onNavigationBarButtonTap(e) {
  711. if (this.showLeft) {
  712. this.$refs.showLeft.close()
  713. } else {
  714. this.$refs.showLeft.open()
  715. }
  716. },
  717. // app端拦截返回事件 ,仅app端生效
  718. onBackPress() {
  719. if (this.showLeft) {
  720. this.$refs.showLeft.close()
  721. return true
  722. }
  723. },
  724. }
  725. </script>
  726. <style lang="scss">
  727. .mapbody{
  728. position: absolute;
  729. width: 750rpx;
  730. }
  731. .mapcontentV{
  732. position: absolute;
  733. width: 750rpx;
  734. background-color:deeppink;
  735. }
  736. .leftpopo{
  737. z-index: 9999;
  738. }
  739. .topContentV{
  740. position: fixed;
  741. justify-content: center;
  742. align-items: center;
  743. padding-top: 100rpx;
  744. left: 0;
  745. right: 0;
  746. top: 0;
  747. z-index: 999;
  748. }
  749. .iconImg{
  750. margin-top: 20rpx;
  751. margin-bottom: 20rpx;
  752. width: 110rpx;
  753. height: 110rpx;
  754. border-radius: 55rpx;
  755. background-color: #1A1A1A;
  756. }
  757. .nameText{
  758. font-size: 32rpx;
  759. color: black;
  760. }
  761. .phoneText{
  762. font-size: 26rpx;
  763. color: black;
  764. }
  765. .drawerlist{
  766. width: 400rpx;
  767. height: 100rpx;
  768. align-items: center;
  769. border: solid lavender;
  770. border-width: 0px 0px 1rpx 0px;
  771. }
  772. .drawerlistIcon{
  773. margin-left: 30rpx;
  774. width: 60rpx;
  775. height: 60rpx;
  776. }
  777. .drawerlisttext{
  778. font-size: 26rpx;
  779. margin-left: 8rpx;
  780. width: 280rpx;
  781. }
  782. .popviewContent{
  783. width:80vw;
  784. background-color: white;
  785. border-radius: 10rpx;
  786. }
  787. .quxiaoBt{
  788. margin-top: 30rpx;
  789. margin-bottom: 30rpx;
  790. padding-left: 50rpx;
  791. padding-right: 50rpx;
  792. font-size: 32rpx;
  793. font-weight: bold;
  794. line-height: 60rpx;
  795. border-radius: 30rpx;
  796. text-align: center;
  797. background-color: #E86E48;
  798. color: white;
  799. }
  800. .querenBt{
  801. margin-top: 30rpx;
  802. margin-bottom: 30rpx;
  803. padding-left: 50rpx;
  804. padding-right: 50rpx;
  805. font-size: 32rpx;
  806. font-weight: bold;
  807. border: 1rpx solid darkgray;
  808. line-height: 60rpx;
  809. border-radius: 30rpx;
  810. text-align: center;
  811. background-color: white;
  812. color: #1A1A1A;
  813. }
  814. .bottomfloatV{
  815. position: fixed;
  816. flex-direction: row;
  817. justify-content: center;
  818. align-items: center;
  819. left: 0;
  820. right: 0;
  821. bottom: 80rpx;
  822. z-index: 999;
  823. }
  824. </style>