123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440 |
- <template>
- <view style="padding-bottom: 90rpx;">
- <view class="top_view">
- <view class="top_title" v-if="order.status==3">司机正在努力赶来</view>
- <view class="top_title" v-if="order.status==1">等待用户支付...</view>
- <view class="top_title" v-if="order.status==2">等待附近司机接单...</view>
- <view class="top_title" v-if="order.status==6">订单已取消</view>
- <view class="top_title" v-if="order.status==4">订单进行中</view>
- <view class="top_title" v-if="order.status==5">已到达终点</view>
- </view>
- <view class="top_box">
- <view v-if="order.status!=3 && order.status!=4 && order.status!=5">
- <view class="topbox_addview justify-between">
- <view class="flex align-center" style="margin-bottom: 4rpx;">
- <view class="green"></view>
- <view class="topbox_addName">{{order.shipAddress}}</view>
- </view>
- <image v-if="globalImages" :src="globalImages + 'images/static/upload/up.png'"></image>
- <view class="flex align-center">
- <view class="orgin"></view>
- <view class="topbox_addName">{{order.deliveryAddress}}</view>
- </view>
- </view>
- <view class="flex justify-between margin-tb-sm">
- <view class="topbox_title">{{order.appointmentNum}}人·{{order.appointmentType == 1 ? '独享' : '拼车'}}
- </view>
- <view class="topbox_title">{{order.appointmentStartTime}}-{{order.appointmentEndTime}}</view>
- </view>
- </view>
- <view class="cph_item" v-if="order.status == 3 || order.status == 4 || order.status == 5">
- <view v-if="order.driver">
- <view class="cphitem_name">{{order.driver.driverPlate}}</view>
- <view class="cphitem_name flex align-center" style="font-size: 28rpx;margin-top: 20rpx;">
- <view>{{order.driver.driverColor}}</view>
- <view class="blackdian"></view>
- <view>{{order.driver.driverBrand}}</view>
- </view>
- <view class="flex align-center margin-top">
- <view class="sj_name">{{order.driver.driverName}}</view>
- <view style="width: 10rpx;height: 20rpx;margin: 0rpx 20rpx;">
- <u-line direction="col" color="#ababab" />
- </view>
- <view class="sj_name">接单{{order.ordersCount ? order.ordersCount : 1}}次</view>
- </view>
- </view>
- <image v-if="globalImages" :src="globalImages + 'images/static/upload/orderimage.png'"></image>
- </view>
- <map class="orderMap" id="orderMap" scale="12" :latitude="latitude" :longitude="longitude" :markers="covers"
- :polyline="polyline">
- </map>
- <u-line color="#E6E6E6" />
- <view class="order_btn">
- <view class="btn3" v-if="order.status == 1 || order.status == 2" @tap.stop="bindorderOff()">取消行程</view>
- <view class="btn2 margin-left" @click.stop="backindex()">再来一单</view>
- <view class="btn2 margin-left" v-if="order.status==1" @click.stop="orderpay()">
- 立即支付</view>
- <!-- <view class="btn2 margin-left" v-if="order.status==5" @tap.stop="bindcomment()">
- 去评价
- </view>
- <view class="btn2 margin-left" v-if="order.status==5" @tap.stop="bindtousu()">
- 去投诉
- </view> -->
- <view class="btn2 margin-left" v-if="order.status == 4 || order.status==3 && order.driver"
- @tap.stop="bindPhone">
- 致电车主
- </view>
- <view class="btn2 margin-left" v-if="order.status == 4 || order.status==3 && order.driver && zxMsg === '是'"
- @tap.stop="goMsg">
- 在线联系
- </view>
- </view>
- </view>
- <view v-if="order.status != 2">
-
- <view class="box ">
- <view>订单信息</view>
- <view class="flex align-center justify-between margin-top">
- <view>订单编号</view>
- <view @click.stop="copyClick(order.ordersNo)">{{order.ordersNo}}
- <image src="../static/copy.png" style="width:28rpx;height: 28rpx;margin-left: 10rpx;"></image>
- </view>
- </view>
- <!--<view class="flex align-center justify-between margin-top" v-if="order.couponMoney">
- <view>优惠券</view>
- <view>-¥{{order.couponMoney}}</view>
- </view> -->
- <view class="flex align-center justify-between margin-top">
- <view>下单时间</view>
- <view>{{order.createTime}}</view>
- </view>
- <view class="flex align-center justify-between margin-top" v-if="order.payWay">
- <view>支付方式</view>
- <!-- 支付方式 1微信小程序 2微信公众号 3微信app 4支付宝 5季钱 -->
- <view v-if="order.payWay==1">微信小程序支付</view>
- <view v-if="order.payWay==2">微信公众号支付</view>
- <view v-if="order.payWay==3">微信app支付</view>
- <view v-if="order.payWay==4">支付宝支付</view>
- <view v-if="order.payWay==5">零钱支付</view>
- <view v-if="order.payWay==6">线下支付</view>
- </view>
- <view class="flex align-center justify-between margin-top" v-if="order.driverRoute && order.driverRoute.isHighSpeedPrice">
- <view>高速费用</view>
- <!-- <view>{{order.driverRoute.isHighSpeedPrice == 1 ? '司机承担高速费' : '用户承担高速费'}}</view> -->
- <view v-if="order.driverRoute.isHighSpeedPrice == 1">
- ·司机承担</view>
- <view v-if="order.driverRoute.isHighSpeedPrice == 2">
- ·乘客承担</view>
- <view v-if="order.driverRoute.isHighSpeedPrice == 3">
- ·费用AA</view>
-
- </view>
- <view class="margin-tb" v-if="order.remark">
- <view>备注</view>
- <view class="margin-top-xs">{{order.remark}}</view>
- </view>
- </view>
- <view class="boxs">
- <!-- <view class="titls">出行信息</view> -->
- <view class="flex align-center padding-tb-sm">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/tiem.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">预约出发时间</view>
- <view>{{order.appointmentStartTime}}</view>
- </view>
- </view>
- <view class="flex align-center padding-tb-sm">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/tiem.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">预约到达时间</view>
- <view>{{order.appointmentEndTime}}</view>
- </view>
- </view>
- <view class="flex align-center padding-tb-sm">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/phone.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">联系方式</view>
- <view>{{order.shipUserPhone}}</view>
- </view>
- </view>
- <view class="flex align-center padding-tb-sm margin-top-xs">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/chufa.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">出发地</view>
- <view>{{order.shipAddress}}</view>
- </view>
- </view>
- <view class="flex align-center padding-tb-sm">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/mididi.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">目的地</view>
- <view>{{order.deliveryAddress}}</view>
- </view>
- </view>
- <view class="flex align-center padding-tb-sm">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/chengcheren.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">乘车人数</view>
- <view>{{order.appointmentNum}}人</view>
- </view>
- </view>
- <view v-if="order.kmDistance" class="flex align-center padding-tb-sm">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/chufa.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">总行程</view>
- <view>{{order.kmDistance}}公里</view>
- </view>
- </view>
- <view class="flex align-center padding-tb-sm">
- <view>
- <image v-if="globalImages" :src="globalImages + 'images/order/leixing.png'" style="width: 80rpx;height: 80rpx;" mode=""></image>
- </view>
- <view style="margin-left: 30rpx; line-height: 40rpx;">
- <view style="color: #999;">用车类型</view>
- <view>需要加一下</view>
- </view>
- </view>
- </view>
- <view class="boxa">
- <view class="align-center justify-between" style="padding-bottom: 30rpx; border-bottom: #ccc 1rpx solid;margin: 0 30rpx;">
- <view class="titls2">订单信息</view>
- <view class="flex align-center justify-between margin-top">
- <view>基础费用</view>
- <view >¥123123</view>
- </view>
- <view class="flex align-center justify-between margin-top">
- <view>里程费</view>
- <view >¥123123</view>
- </view>
- <view class="flex align-center justify-between margin-top">
- <view>市场费</view>
- <view >¥123123</view>
- </view>
- <view class="flex align-center justify-between margin-top" v-if="order.couponMoney">
- <view>优惠券</view>
- <view >-¥123123</view>
- </view>
- </view>
- <view class="flex align-center justify-between padding-lr" style="margin-top: 30rpx;">
- <view>总计</view>
- <view class="order_money">¥{{order.payMoney}}</view>
- </view>
- </view>
- </view>
- <view v-if="order.status == 2" style="padding: 0rpx 30rpx;">
- <view class="titls">联系车主接单</view>
- <view class="list_item" v-for="(item,index) in list">
- <view class="flex" style="padding: 30rpx 30rpx 20rpx;">
- <image v-if="globalImages" :src="globalImages + 'images/static/upload/ordercz.png'"></image>
- <view class="margin-left-sm">
- <view class="flex">
- <view class="item_time">{{item.startTime}}</view>
- <view class="item_shunlu">{{item.similarity ? item.similarity : 0}}%顺路</view>
- </view>
- <view class="flex align-center" style="margin-top: 6rpx;">
- <view class="sj_name" v-if="item.driver">
- {{item.driver.driverColor}}·{{item.driver.driverBrand}}
- </view>
- <view style="width: 10rpx;height: 20rpx;margin: 0rpx 20rpx;">
- <u-line direction="col" color="#ababab" />
- </view>
- <view class="sj_name">接单{{item.ordersCount ? item.ordersCount : 1}}次</view>
- </view>
- </view>
- </view>
- <u-line color="#E6E6E6" />
- <view class="padding">
- <view class="flex align-center" style="margin-bottom: 4rpx;margin-left: 6rpx;">
- <view class="green"></view>
- <view class="item_addName">{{item.shipAddress}}</view>
- <view class="item_juli" v-if="item.startDistance">{{item.startDistance}}km</view>
- </view>
- <image v-if="globalImages" :src="globalImages + 'images/static/upload/up.png'" style="width: 6rpx;height: 24rpx;margin-left: 12rpx;"></image>
- <view class="flex align-center" style="margin-left: 6rpx;">
- <view class="orgin"></view>
- <view class="item_addName">{{item.deliveryAddress}}</view>
- <view class="item_juli" v-if="item.endDistance">{{item.endDistance}}km</view>
- </view>
- <view class="flex align-center margin-top-sm" v-if="item.seatNum">
- <image v-if="globalImages" :src="globalImages + 'images/static/upload/person.png'" style="width: 24rpx;height: 30rpx;"></image>
- <view style="margin-left: 16rpx;" class="add_name">
- {{item.seatNum}}人乘车·{{item.isFriends === '1' ? '有亲友' : '无亲友'}}
- <text v-if="item.isHighSpeedPrice && item.isHighSpeedPrice == 1">·司机承担</text>
- <text v-if="item.isHighSpeedPrice && item.isHighSpeedPrice == 2">·乘客承担</text>
- <text v-if="item.isHighSpeedPrice && item.isHighSpeedPrice == 3">·费用AA</text>
- </view>
- </view>
- </view>
- <u-line color="#E6E6E6" />
- <view class="flex justify-between padding">
- <view class="item_xunzhao" style="font-size: 28rpx;">正在寻找顺路乘客...</view>
- <view class="item_btns" v-if="item.messageCount && item.messageCount == 1">已邀请</view>
- <view class="item_btn" v-else @tap="yqSave(item)">邀请接单</view>
- </view>
- </view>
- <view class="empty" v-if="list.length == 0">
- <view style="width: 100%;margin: 0 auto;text-align: center;">
- <image v-if="globalImages" :src="globalImages + 'images/static/image/emety.png'" style="width: 300rpx;height: 300rpx;"></image>
- <view style="color: #CCCCCC;">暂无顺路内容</view>
- </view>
- </view>
- </view>
- <u-popup v-model="showpay" mode="bottom">
- <view class="popup_pay">
- <view class=" margin-top padding-lr radius">
- <view style="padding: 0 20upx;margin-top: 36rpx;">
- <view
- style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
- v-for="(item,index) in openLists" :key='index'>
- <image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
- </image>
- <view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
- {{item.name}} <text @click="goconz" class="margin-left text-sm" style="color:#3699FF;"
- v-if="item.id==3">去充值</text>
- </view>
- <radio-group name="openWay" style="margin-left: 45rpx;" @tap='selectWay(item)'>
- <label class="tui-radio">
- <radio color="#3699FF" :checked="openWay == item.id ? true : false" />
- </label>
- </radio-group>
- </view>
- </view>
- </view>
- <view class="pay_btns" @click="pay()">确认支付</view>
- </view>
- </u-popup>
- <view class="sos" @click="goJinji()">
- <image v-if="globalImages" :src="globalImages + 'images/static/image/my/jjqz.png'" mode=""></image>
- </view>
- </view>
- </template>
- <script>
- import QQMapWX from '@/components/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js'
- import { waitForGlobalImages } from '@/utils/globalImageLoader'
- export default {
- data() {
- return {
- list: [],
- indentNumber: '',
- order: [],
- showpay: false,
- openWay: 1,
- openLists: [],
- creditScore: 0,
- AllcreditScore: 0,
- zxMsg: '是',
- myPhone: '',
- timer: null, //订单详情定时器
- qqmapsdk: {}, // 腾讯地图小程序的SDK
- latitude: '',
- longitude: '',
- covers: [], // 地图上面的标记点
- to: { // 目的地坐标
- latitude: '',
- longitude: '',
- },
- polyline: [], //路线
- polylines: '',
- globalImages: ''
- }
- },
- onLoad(option) {
- waitForGlobalImages().then((path) => {
- console.log('✅ 全局图片路径:', path)
- this.globalImages = path
- })
- this.getInitMap()
- this.zxMsg = this.$queue.getData('zxMsg');
- if (option.indentNumber) {
- this.indentNumber = option.indentNumber
- this.getDetail()
- }
- this.getUserInfo();
- // #ifdef MP-WEIXIN
- this.openLists = [{
- id: 1,
- image: '../../static/image/icon_weixin.png',
- name: '微信'
- }, {
- id: 3,
- image: '../../static/image/lingian.png',
- name: '余额'
- }]
- // #endif
- // #ifdef H5
- let ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf('micromessenger') !== -1) {
- //公众号是否自动登录 443
- this.$Request.get('/app/common/type/443').then(res => {
- if (res.data && res.data.value && res.data.value == '是') {
- this.openLists = [{
- id: 1,
- image: '../../static/image/icon_weixin.png',
- name: '微信'
- }, {
- id: 3,
- image: '../../static/image/lingian.png',
- name: '余额'
- }];
- this.openWay = 1;
- } else {
- this.openLists = [{
- id: 3,
- image: '../../static/image/lingian.png',
- name: '余额'
- }];
- this.openWay = 3;
- }
- })
- } else {
- this.openLists = [{
- id: 2,
- image: '../../static/image/zhifubao.png',
- name: '支付宝'
- }, {
- id: 3,
- image: '../../static/image/lingian.png',
- name: '余额'
- }];
- this.openWay = 3;
- }
- // #endif
- // #ifdef APP-PLUS
- this.openLists = [{
- id: 1,
- image: '../../static/image/icon_weixin.png',
- name: '微信'
- },
- {
- id: 2,
- image: '../../static/image/zhifubao.png',
- name: '支付宝'
- }, {
- id: 3,
- image: '../../static/image/lingian.png',
- name: '余额'
- }
- ]
- this.openWay = 3;
- // #endif
- let that = this
- that.$Request.getT('/app/common/type/364').then(res => { // 每次取消扣除的信用分数量 364
- if (res.code == 0) {
- if (res.data && res.data.value) {
- that.creditScore = res.data.value
- }
- }
- })
- that.$Request.getT('/app/common/type/365').then(res => { // 低于多少不能接单和下单 365
- if (res.code == 0) {
- if (res.data && res.data.value) {
- that.AllcreditScore = res.data.value
- }
- }
- })
- },
- onShow() {
- if (this.indentNumber) {
- this.timer = setInterval(() => {
- this.getDetail()
- }, 5000)
- }
- },
- onHide() {
- clearInterval(this.timer)
- this.timer = null
- },
- onUnload() {
- clearInterval(this.timer)
- this.timer = null
- },
- methods: {
- getUserInfo(){
- this.$Request.getT('/app/user/selectUserById').then(res => {
- console.log(res)
- if (res.code == 0) {
- this.myPhone = res.data.phone
- this.$queue.setData("userId", res.data.userId);
- this.$queue.setData("mobile", res.data.phone);
- this.$queue.setData("invitationCode", res.data.invitationCode ? res.data.invitationCode :
- '0');
- this.$queue.setData("status", res.data.status);
- this.$queue.setData("nickName", res.data.nickName ? res.data.nickName : res
- .data.userName);
- this.$queue.setData("image_url", this.image_url);
- }
- });
- },
- goMsg() {
- let userId = this.$queue.getData('userId');
- let data = {
- userId: userId,
- focusedUserId: this.order.driver.userId,
- ordersId: this.indentNumber,
- userType: 1
- }
- this.$Request.postJson('/app/chat/insertChatConversation', data).then(res => {
- if (res.code == 0) {
- let id = userId == res.data.userId ? res.data.focusedUserId : res.data.userId
- uni.navigateTo({
- url: '/my/kefu/im?chatConversationId=' + res.data.chatConversationId +
- '&byUserId=' + id + '&ordersId=' + res.data.ordersId
- })
- }
- })
- },
- //初始化地图
- getInitMap() {
- this.$Request.getT('/app/common/type/128').then(res => { //用户端腾讯地图key
- if (res.code === 0) {
- this.qqmapsdk = new QQMapWX({
- key: res.data.value // 自己申请的key值
- })
- }
- });
- },
- goJinji() {
- uni.navigateTo({
- url: '/my/setting/jinji'
- })
- },
- yqSave(item) {
- uni.showModal({
- title: '温馨提示',
- content: '确认邀请当前司机接单吗?',
- showCancel: true,
- cancelText: '取消',
- confirmText: '确认',
- success: res => {
- if (res.confirm) {
- this.$Request.postT('/app/driverRoute/insertMessageByDriver?ordersId=' + this
- .indentNumber + '&driverRouteId=' + item.driverRouteId)
- .then(res => {
- if (res.code == 0) {
- uni.showToast({
- title: '邀请成功,等待车主同意!'
- });
- setTimeout(d => {
- this.getDetail()
- }, 1500)
- } else {
- uni.hideLoading();
- uni.showModal({
- showCancel: false,
- title: '订单邀请失败',
- content: res.msg
- });
- }
- });
- }
- }
- });
- },
- goconz() {
- uni.navigateTo({
- url: '/my/wallet/Txmoney'
- })
- },
- copyClick(copy) {
- uni.setClipboardData({
- data: copy,
- success: function(res) {
- uni.getClipboardData({
- success: function(res) {
- uni.showToast({
- title: "复制成功",
- icon: 'none',
- });
- },
- });
- },
- });
- },
- // 一键导航
- openMap(latitude, longitude, name) {
- uni.openLocation({
- latitude: latitude - 0, //要去的纬度-地址
- longitude: longitude - 0, //要去的经度-地址
- name: name, //地址名称
- address: name, //详细地址名称
- success: function() {
- console.log('导航成功');
- },
- fail: function(error) {
- console.log(error)
- }
- });
- },
- goriderMap() { //查看司机位置
- uni.navigateTo({
- url: '/my/order/orderMap?indentNumber=' + this.order.indentNumber
- })
- },
- // 去评价
- bindcomment(e) {
- uni.navigateTo({
- url: '/my/order/comments?indentNumber=' + this.order.indentNumber + '&riderUserId=' + this
- .order.riderUserId
- })
- },
- bindtousu(e) { //投诉
- uni.navigateTo({
- url: '/my/order/complaint?indentNumber=' + this.order.indentNumber + '&riderUserId=' + this
- .order.riderUserId
- })
- },
- selectWay: function(item) {
- this.openWay = item.id;
- },
- orderpay() {
- this.showpay = true
- },
- bindPhone() {
- let ysPhone = this.$queue.getData('ysPhone');
- if (ysPhone === '是') {
- this.$Request.getT('/app/user/insertVirtualPhone?phoneA=' + this.order.driver.phone + '&phoneB=' + this.myPhone).then(
- res => {
- if (res.code == 0) {
- if (res.data) {
- uni.makePhoneCall({
- phoneNumber: res.data //仅为示例
- });
- } else {
- this.$queue.showToast('手机号获取失败!');
- }
- } else {
- this.$queue.showToast(res.msg);
- }
- });
- } else {
- uni.makePhoneCall({
- phoneNumber: this.order.driver.phone //仅为示例
- });
- }
- // uni.makePhoneCall({
- // phoneNumber: this.order.driver.phone //仅为示例
- // });
- },
- getsjList() {
- this.$Request.getT('/app/driverRoute/selectDriverRouteList?page=1&limit=40&status=1&ordersId=' + this
- .indentNumber + '&shipCity=' + this.order.shipCity)
- .then(res => {
- if (res.code === 0 && res.data) {
- this.list = res.data.list
- }
- uni.hideLoading()
- });
- },
- getDetail() {
- this.$Request.getT('/app/orders/selectOrdersDetails?ordersId=' + this.indentNumber).then(res => {
- if (res.code === 0) {
- this.order = res.data
- this.getsjList();
- this.latitude = this.order.shipAddressLatitude
- this.longitude = this.order.shipAddressLongitude
- this.to.latitude = this.order.deliveryAddressLatitude
- this.to.longitude = this.order.deliveryAddressLongitude
- this.covers = [{
- id: 1,
- latitude: this.order.shipAddressLatitude,
- longitude: this.order.shipAddressLongitude,
- iconPath: '../../static/image/qi.png',
- width: 32,
- height: 44,
- callout: { //自定义标记点上方的气泡窗口 点击有效
- content: this.order.shipAddress, //文本
- color: '#333333', //文字颜色
- fontSize: 10, //文本大小
- padding: 10, //附近留白
- borderRadius: 6, //边框圆角
- bgColor: '#FFFFFF', //背景颜色
- display: 'ALWAYS', //常显
- },
- }, {
- id: 2,
- latitude: this.order.deliveryAddressLatitude,
- longitude: this.order.deliveryAddressLongitude,
- iconPath: '../../static/image/zd.png',
- width: 32,
- height: 44,
- callout: { //自定义标记点上方的气泡窗口 点击有效
- content: this.order.deliveryAddress, //文本
- color: '#333333', //文字颜色
- fontSize: 10, //文本大小
- padding: 10, //附近留白
- borderRadius: 6, //边框圆角
- bgColor: '#FFFFFF', //背景颜色
- display: 'ALWAYS', //常显
- },
- }]
- this.polylines = this.order.polyline
- // #ifdef MP-WEIXIN
- this.routePlanning()
- // #endif
- }
- uni.hideLoading()
- });
- },
- //规划路线
- routePlanning() {
- let that = this
- that.qqmapsdk.direction({
- mode: 'driving', // 驾车
- from: { // 起始位置(当前位置)坐标
- latitude: that.latitude,
- longitude: that.longitude
- },
- to: that.to, // 目的地位置坐标
- success(res) {
- console.log(res, '=======')
- // var coors = JSON.parse(that.polylines)
- // console.log(coors,'11111111111111')
- var coors = res.result.routes[0].polyline
- // console.log(coors2,'11111111111111')
- var pl = [] // 点串数组
- // 坐标解压(返回的点串坐标,通过前向差分进行压缩)
- var kr = 1000000
- for (var i = 2; i < coors.length; i++) {
- coors[i] = Number(coors[i - 2]) + Number(coors[i]) / kr
- }
- // 将解压后的坐标放入点串数组pl中
- for (var i = 0; i < coors.length; i += 2) {
- pl.push({
- latitude: coors[i],
- longitude: coors[i + 1]
- })
- }
- // 设置polyline属性,将路线显示出来,将解压坐标第一个数据作为起点
- that.polyline = [{
- points: pl,
- color: '#346EF6',
- width: 4
- }]
- }
- })
- },
- backindex() {
- uni.switchTab({
- url: '/pages/index/index'
- })
- },
- // 取消订单
- bindorderOff() {
- let content = ''
- uni.showModal({
- title: '温馨提示',
- content: '确认取消行程吗?',
- showCancel: true,
- cancelText: '取消',
- confirmText: '确认',
- success: res => {
- if (res.confirm) {
- this.$Request.postT('/app/orders/cancelOrders?ordersId=' + this.indentNumber + '&isDriver=0')
- .then(res => {
- if (res.code == 0) {
- uni.showToast({
- title: '订单取消成功'
- });
- this.getDetail()
- } else {
- uni.hideLoading();
- uni.showModal({
- showCancel: false,
- title: '订单失败',
- content: res.msg
- });
- }
- });
- }
- }
- });
- },
- pay() {
- if (this.openWay == 0) {
- this.$queue.showToast('请选择支付方式!')
- return;
- }
- this.showpay = false;
- if (this.openWay == 1) {
- // #ifdef APP-PLUS
- let data = {
- ordersId: this.indentNumber,
- type: 1
- }
- // 微信APP支付 根据订单id获取支付信息
- this.$Request.postT("/app/wxPay/payOrders", data).then(res => {
- console.log(JSON.stringify(res), '微信支付信息')
- this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data));
- });
- // #endif
- // #ifdef MP-WEIXIN
- let data = {
- ordersId: this.indentNumber,
- type: 3
- }
- let that = this
- that.$Request.postT("/app/wxPay/payOrders", data).then(res => {
- if (res.code == 0) {
- uni.requestPayment({
- provider: 'wxpay',
- timeStamp: res.data.timestamp,
- nonceStr: res.data.noncestr,
- package: res.data.package,
- signType: res.data.signType,
- paySign: res.data.sign,
- success: function(res) {
- console.log(res)
- uni.hideLoading();
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- });
- setTimeout(function() {
- uni.switchTab({
- url: '/pages/order/order'
- })
- }, 1000)
- },
- fail: function(err) {
- console.log('fail:' + JSON.stringify(err));
- uni.hideLoading();
- that.$queue.showToast('支付失败');
- }
- });
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- }
- });
- // #endif
- // #ifdef H5
- let ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf('micromessenger') !== -1) {
- let data = {
- ordersId: this.indentNumber,
- type: 2
- }
- this.$Request.postT("/app/wxPay/payOrders", data).then(res => {
- if (res.code == 0) {
- this.callPay(res.data);
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- }
- });
- }
- // #endif
- } else if (this.openWay == 2) {
- // APP支付宝支付
- // #ifdef H5
- let data = {
- ordersId: this.indentNumber,
- type: 1
- }
- this.$Request.postT("/app/aliPay/payOrders", data).then(res => {
- if (res.code == 0) {
- const div = document.createElement('div')
- div.innerHTML = res.data //此处form就是后台返回接收到的数据
- document.body.appendChild(div)
- document.forms[0].submit()
- } else {
- uni.showToast({
- icon: 'none',
- title: '支付失败!'
- });
- }
- });
- // #endif
- // #ifdef APP
- let data = {
- ordersId: this.indentNumber,
- type: 2
- }
- this.$Request.postT("/app/aliPay/payOrders", data).then(res => {
- console.log(JSON.stringify(res), '支付宝支付信息')
- this.isCheckPay(res.code, 'alipay', res.data)
- });
- // #endif
- } else if (this.openWay == 3) {
- let data = {
- ordersId: this.indentNumber
- }
- let that = this
- that.$Request.postT("/app/orders/payOrders", data).then(res => {
- if (res.code == 0) {
- uni.hideLoading();
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- });
- setTimeout(function() {
- that.getDetail();
- }, 1000)
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- }
- });
- }
- },
- callPay: function(response) {
- if (typeof WeixinJSBridge === "undefined") {
- if (document.addEventListener) {
- document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
- } else if (document.attachEvent) {
- document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
- document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
- }
- } else {
- this.onBridgeReady(response);
- }
- },
- onBridgeReady: function(response) {
- let that = this;
- // if (!response.package) {
- // return;
- // }
- console.log(response, 111111)
- WeixinJSBridge.invoke(
- 'getBrandWCPayRequest', {
- "appId": response.appid, //公众号名称,由商户传入
- "timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
- "nonceStr": response.noncestr, //随机串
- "package": response.package,
- "signType": response.signType, //微信签名方式:
- "paySign": response.sign //微信签名
- },
- function(res) {
- console.log(res, '/*-/*-/*-')
- if (res.err_msg === "get_brand_wcpay_request:ok") {
- // 使用以上方式判断前端返回,微信团队郑重提示:
- //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
- uni.showLoading({
- title: '支付成功'
- });
- setTimeout(function() {
- uni.hideLoading();
- that.getDetail();
- }, 1000);
- } else {
- uni.hideLoading();
- }
- WeixinJSBridge.log(response.err_msg);
- }
- );
- },
- isCheckPay(status, name, order) {
- if (status == 0) {
- this.setPayment(name, order);
- } else {
- uni.hideLoading();
- uni.showToast({
- title: '支付信息有误',
- icon: 'none'
- });
- }
- },
- setPayment(name, order) {
- console.log(name, '*-*-*', order)
- uni.requestPayment({
- provider: name,
- orderInfo: order, //微信、支付宝订单数据
- success: function(res) {
- console.log(res)
- uni.hideLoading();
- uni.showLoading({
- title: '支付成功'
- });
- setTimeout(function() {
- that.getDetail();
- }, 1000);
- },
- fail: function(err) {
- console.log(err)
- uni.hideLoading();
- },
- complete() {
- uni.hideLoading();
- }
- });
- },
- }
- }
- </script>
- <style lang="less">
- page {
- background: #F5F5F5;
- }
- .orderMap {
- width: 100%;
- height: 230rpx;
- border-radius: 14rpx;
- }
- .sos {
- width: 70rpx;
- height: 70rpx;
- position: fixed;
- bottom: 290rpx;
- left: 32rpx;
- z-index: 99;
-
- image {
- width: 70rpx;
- height: 70rpx;
- }
- }
- .bg {
- background: #FFFFFF;
- }
- .order_money {
- font-family: PingFang SC;
- font-weight: 800;
- font-size: 38rpx;
- color: #FF4B36;
- }
- .green {
- width: 16rpx;
- height: 16rpx;
- background: #1FC657;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .orgin {
- width: 16rpx;
- height: 16rpx;
- background: #FBAC04;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .boxs {
- background: #FFFFFF;
- border-radius: 24rpx;
- margin: 30rpx;
- padding: 30rpx;
- }
- .boxa {
- background: #FFFFFF;
- border-radius: 24rpx;
- margin: 30rpx;
- padding: 30rpx 0;
- }
- .sj_name {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 24rpx;
- color: #999999;
- }
- .top_box {
- width: 686rpx;
- // height: 370rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- margin: 30rpx;
- padding: 30rpx;
- position: relative;
- margin-top: -230rpx;
- z-index: 99;
- .cph_item {
- width: 624rpx;
- height: 220rpx;
- margin: 0 auto;
- display: flex;
- justify-content: space-between;
- // align-items: center;
- image {
- width: 250rpx;
- height: 110rpx;
- margin-top: 30rpx;
- }
- .cphitem_name {
- font-family: PingFang SC;
- font-weight: 800;
- font-size: 38rpx;
- color: #1A1A1A;
- }
- .blackdian {
- width: 6rpx;
- height: 6rpx;
- background: #333333;
- border-radius: 50%;
- margin-right: 10rpx;
- margin-left: 10rpx;
- }
- .sj_sg {
- width: 1rpx;
- height: 20rpx;
- border: 1rpx solid #A0A0A0;
- margin: 0rpx 20rpx;
- }
- }
- .topbox_addview {
- width: 624rpx;
- min-height: 100rpx;
- background: #EFF4FF;
- border-radius: 16rpx;
- border: 1px solid #346EF6;
- margin: 0 auto;
- // display: flex;
- align-items: center;
- padding: 20rpx 30rpx;
- image {
- width: 6rpx;
- height: 24rpx;
- margin-left: 6rpx;
- }
- .topbox_title {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #151515;
- }
- }
- }
- .topbox_addName {
- font-family: PingFang SC;
- font-weight: 800;
- font-size: 28rpx;
- color: #1A1A1A;
- width: 520rpx;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- .top_view {
- width: 750rpx;
- height: 325rpx;
- background: linear-gradient(to bottom, #346EF6 0%, #8EB0FF 70%, #F5F5F5 90%);
- padding: 40rpx;
- position: relative;
- .top_title {
- font-family: PingFang SC;
- font-weight: bold;
- font-size: 38rpx;
- color: #FFFFFF;
- }
- }
- .list_item {
- width: 686rpx;
- // height: 366rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- margin-top: 20rpx;
- .item_time {
- font-family: PingFang SC;
- font-weight: bold;
- font-size: 28rpx;
- color: #242424;
- }
- .item_addName {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #1A1A1A;
- width: 520rpx;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- .item_juli {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- color: #999999;
- width: 100rpx;
- text-align: right;
- }
- .item_xunzhao {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- color: #999999;
- }
- .item_btn {
- width: 150rpx;
- height: 58rpx;
- background: #346EF6;
- border-radius: 29rpx;
- text-align: center;
- line-height: 58rpx;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 24rpx;
- color: #FFFFFF;
- }
- .item_btns {
- width: 150rpx;
- height: 58rpx;
- border: 2px solid #232323;
- border-radius: 29rpx;
- text-align: center;
- line-height: 52rpx;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 24rpx;
- color: #232323;
- }
- .item_shunlu {
- font-family: PingFang SC;
- font-weight: bold;
- font-size: 28rpx;
- color: #346EF6;
- margin-left: 20rpx;
- }
- image {
- width: 68rpx;
- height: 68rpx;
- }
- }
- .box {
- background: #FFFFFF;
- border-radius: 24rpx;
- padding: 30rpx;
- margin: 30rpx;
- }
- .titls {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
-
- .titls2 {
- font-size: 32rpx;
- font-family: PingFang SC;
- color: #333333;
- }
- .bb {
- width: 110rpx;
- height: 38rpx;
- // background: #49A5FF;
- // opacity: 0.32;
- background-color: rgba(73, 165, 255, 0.3);
- border-radius: 4rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #359CFF;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-left: 10rpx;
- }
- .addbox {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 30rpx;
- height: 110rpx;
- border-radius: 16rpx;
- }
- .add_cont {
- display: flex;
- align-items: center;
- }
- .empty {
- width: 100%;
- background: #ffffff;
- height: 800rpx;
- margin-top: 20rpx;
- padding-top: 200rpx;
- }
- .order_btn {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- margin-top: 30rpx;
- .btn3 {
- width: 150rpx;
- height: 60rpx;
- border: 1px solid #CCCCCC;
- border-radius: 50rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .btn2 {
- width: 150rpx;
- height: 60rpx;
- background: #EFF4FF;
- border: 1px solid #346EF6;
- border-radius: 50rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- line-height: 60rpx;
- font-weight: 500;
- color: #346EF6;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .btn1 {
- width: 150rpx;
- height: 60rpx;
- border: 1px solid #999999;
- border-radius: 50rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- line-height: 60rpx;
- color: #999999;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- .add_tit {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .bg {
- background: #F5F5F5;
- }
- .bgs {
- background: #F5F8FF;
- }
- .tabber {
- background: #FFFFFF;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- z-index: 9;
- display: flex;
- align-items: center;
- justify-content: end;
- padding: 10rpx 30rpx;
- .btn {
- flex: 1;
- // width: 330rpx;
- height: 78rpx;
- border: 1px solid #A0A0A0;
- border-radius: 16rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #9C9C9C;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .btn1 {
- // width: 330rpx;
- flex: 1;
- height: 78rpx;
- background: #346EF6;
- border-radius: 16rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .btn2 {
- flex: 1;
- // width: 330rpx;
- height: 78rpx;
- background: #3699FF;
- border-radius: 16rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- /* 支付弹框 */
- .popup_pay {
- width: 100%;
- }
- .pay_btns {
- width: 90%;
- margin: 0 auto 40rpx;
- text-align: center;
- background: #3699FF;
- height: 80rpx;
- border-radius: 16rpx;
- color: #ffffff;
- line-height: 80rpx;
- margin-top: 20rpx;
- }
- </style>
|