order-detail.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view style="padding-bottom: 150rpx;">
  3. <!-- 出发-目的地 -->
  4. <view class="flex plr-36 ptb-20" style="box-shadow: 0px 0px 13px 0px rgba(0,194,142, 0.09);">
  5. <view class="bold">
  6. {{info.start_city}}-{{info.end_city}}
  7. </view>
  8. <view class="green">
  9. {{info.statusText}}
  10. </view>
  11. </view>
  12. <!-- 详情 -->
  13. <view class="plr-36 pb-30 bb">
  14. <view class="list flex1 flex-middle mt-30">
  15. <image src="../../static/icon-1.png" mode=""></image>
  16. <view class="gray-2 mlr-10">【起点】</view>
  17. <view class="">
  18. {{info.start_city}}-{{info.start_name}}
  19. </view>
  20. </view>
  21. <view class="list flex1 flex-middle mt-30">
  22. <image src="../../static/icon-2.png" mode=""></image>
  23. <view class="gray-2 mlr-10">【终点】</view>
  24. <view class="">
  25. {{info.end_city}}-{{info.end_name}}
  26. </view>
  27. </view>
  28. <view class="list flex1 flex-middle mt-30">
  29. <image src="../../static/icon-3.png" mode=""></image>
  30. <view class="gray-2 mlr-10">【出发时间】</view>
  31. <view class="">
  32. {{info.start_time}}
  33. </view>
  34. </view>
  35. <view class="list flex1 flex-middle mt-30" v-if="info.order_type==2&&info.status==1">
  36. <image src="../../static/icon-4.png" mode=""></image>
  37. <view class="gray-2 mlr-10">【余座】</view>
  38. <view class="">
  39. {{info.more_seats}}人
  40. </view>
  41. </view>
  42. <view class="list flex1 flex-middle mt-30" v-else>
  43. <image src="../../static/icon-4.png" mode=""></image>
  44. <view class="gray-2 mlr-10">【预定座位】</view>
  45. <view class="">
  46. {{info.people_num}}人
  47. </view>
  48. </view>
  49. <view class="list flex1 mt-30" v-if="info.order_type==2">
  50. <image src="../../static/icon-5.png" mode=""></image>
  51. <view class="gray-2 mlr-10 mt-6">【路线】</view>
  52. <view class="u-flex-1 mt-6">
  53. {{info.route}}
  54. </view>
  55. </view>
  56. <view class="list flex1 flex-middle mt-30" v-if="info.order_type==2">
  57. <image src="../../static/icon-6.png" mode=""></image>
  58. <view class="gray-2 mlr-10">【车型】</view>
  59. <view class="">
  60. {{info.car_type}}
  61. </view>
  62. </view>
  63. <view class="list flex1 mt-30" v-if="info.remark">
  64. <image src="../../static/icon-7.png" mode=""></image>
  65. <view class="gray-2 mlr-10 mt-6">【备注】</view>
  66. <view class="mt-6">
  67. {{info.remark}}
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 司机-电话 -->
  72. <view style="height: 300rpx;" v-if="info.order_type==1&&info.status==1"></view>
  73. <view class="flex plr-36 ptb-25" v-else>
  74. <view class="flex1 flex-middle">
  75. <view class="img-siji">
  76. <image src="../../static/siji.png" mode=""></image>
  77. </view>
  78. <view class="ml-20">
  79. <view class="size-34 bold">
  80. {{info.truename}}
  81. </view>
  82. <view class="mt-10">
  83. 分摊费用:<text class="red" v-if="info.car_price">¥{{info.car_price}}/座</text><text v-else class="red">暂无报价</text>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="img-tel" @click="call(info.driver_tel)" v-if="info.status!=1&&info.status!=5">
  88. <image src="../../static/tel.png" mode=""></image>
  89. </view>
  90. <!-- 投诉 -->
  91. <view class="img-tel" @click="tousu()" v-if="info.status==5">
  92. <image src="../../static/complaints-icon.png" mode=""></image>
  93. </view>
  94. </view>
  95. <!-- 取消按钮 -->
  96. <view class="plr-36 mt-100" v-if="info.order_type==2&&info.status!=4&&info.status!=5">
  97. <u-button type="primary" @click="book" v-if="info.status==1">预订</u-button>
  98. <u-button type="primary" @click="cancel" v-if="info.status==3">取消预订</u-button>
  99. </view>
  100. <view class="plr-36 mt-100" v-if="info.order_type==1&&info.status!=4&&info.status!=5">
  101. <u-button type="primary" @click="cancel" v-if="[1,2,3].includes(info.status*1)">取消预约</u-button>
  102. </view>
  103. <view class="plr-36 mt-100" v-if="info.status==4&&info.pay_status==0">
  104. <u-button type="primary" @click="pay">立即支付</u-button>
  105. </view>
  106. <view class="plr-36 mt-100" v-if="info.status==4&&info.pay_status==1">
  107. <u-button type="primary" disabled="true">订单已支付</u-button>
  108. </view>
  109. <!-- 评价该服务 -->
  110. <view class="plr-36 ptb-40 mt-100" v-if="info.status==5">
  111. <view class="mb-40">
  112. <text class="bold">评价该服务</text>
  113. <text class="gray-2 size-26 plr-10 mlr-15" style="background: #eee;">匿名</text>
  114. </view>
  115. <view class="center">
  116. <u-rate @change="comment" :count="5" v-model="score" active-color="#EA0000" inactive-color="#999" :disabled="false"
  117. gutter="50" size="50"></u-rate>
  118. </view>
  119. </view>
  120. <!-- 温馨提示 -->
  121. <view class="plr-36 mt-30" v-if="info.order_type==1&&info.status==1">
  122. <view class="">
  123. 温馨提示:
  124. </view>
  125. <view class="size-26 mt-10">
  126. 1.拼单提交成功后,系统会为您匹配与您出行时间相符的车主, 并实时通知给您。
  127. </view>
  128. <view class="size-26 mt-10">
  129. 2.<text class="green">匹配成功,不是预约成功。</text>此功能仅仅是通知提醒功能,拼 友还是要自己判断车主路线是否适合自己,并进行预订。
  130. </view>
  131. </view>
  132. <view class="plr-36 mt-30" v-if="info.order_type==1&&info.status==2">
  133. <view class="">
  134. 温馨提示:
  135. </view>
  136. <view class="size-26 mt-10">
  137. 注:司机接单后,会有司机与您电话联系,并与您协商分摊费 用,请注意接听电话
  138. </view>
  139. </view>
  140. <view class="plr-36 mt-30" v-if="info.status==3">
  141. <view class="">
  142. 温馨提示:
  143. </view>
  144. <view class="size-26 mt-10">
  145. 1.如您行程改变,请尽可能提前退订,<text class="green">{{info.time}}</text>前可退订.
  146. </view>
  147. <view class="size-26 mt-10">
  148. 2.请在上车后,将分摊费用<text class="green">支付给车主</text>,平台不代收费用。
  149. </view>
  150. <view class="size-26 mt-10">
  151. 3.如车主有违规行为,点我<text class="green">投诉车主</text>
  152. </view>
  153. </view>
  154. <bookTip class="fixed-bottom bg-white" v-if="info.order_type==2&&info.status==1"></bookTip>
  155. <u-popup v-model="show" mode="bottom">
  156. <dtPay @close="show=false" @update="init" :info="info"></dtPay>
  157. </u-popup>
  158. </view>
  159. </template>
  160. <script>
  161. export default {
  162. data() {
  163. return {
  164. id: '',
  165. info: {}, //-2 超时-1=已取消,1=待接单,2=待确认,3=待出发,4=行驶中,5=已完成
  166. show:false, //支付
  167. score:0,
  168. arr:[1,2,3,4],
  169. timer:null
  170. };
  171. },
  172. onLoad(option) {
  173. this.id = option.id
  174. },
  175. onShow() {
  176. this.init()
  177. },
  178. onUnload() {
  179. clearInterval(this.timer)
  180. this.timer = null
  181. },
  182. onHide() {
  183. clearInterval(this.timer)
  184. this.timer = null
  185. },
  186. methods: {
  187. init() {
  188. this.$http('/addons/ddrive/sforder/info', {
  189. order_id: this.id
  190. }).then(data => {
  191. this.info = data
  192. if(this.arr.includes(data.status*1)&&!this.timer){
  193. this.timer = setInterval(()=>{
  194. this.update()
  195. },2000)
  196. }
  197. this.score = data.score
  198. uni.setNavigationBarTitle({
  199. title: this.info.statusText
  200. })
  201. })
  202. },
  203. update() {
  204. this.$http('/addons/ddrive/sforder/info', {
  205. order_id: this.id
  206. }).then(data => {
  207. this.info = data
  208. if(!this.arr.includes(data.status*1)&&this.timer){
  209. clearInterval(this.timer)
  210. this.timer = null
  211. }
  212. this.score = data.score
  213. uni.setNavigationBarTitle({
  214. title: this.info.statusText
  215. })
  216. })
  217. },
  218. call(tel) {
  219. uni.makePhoneCall({
  220. phoneNumber: tel //仅为示例
  221. });
  222. },
  223. tousu(){
  224. uni.navigateTo({
  225. url:'../../pages/my/complaints/index?sf_type=1&id='+this.id
  226. })
  227. },
  228. // 预订
  229. book() {
  230. uni.navigateTo({
  231. url: "/pages/shunfeng/confirm-book?id=" + this.id
  232. })
  233. },
  234. cancel() {
  235. if (this.info.status == 3) {
  236. // 原因
  237. uni.navigateTo({
  238. url: '/pages/home/dj-cancel?id=' + this.id + '&type=2'
  239. })
  240. } else {
  241. this.$http('/addons/ddrive/sforder/cancel', {
  242. order_id: this.id
  243. }).then(() => {
  244. uni.showToast({
  245. title: "取消成功"
  246. })
  247. setTimeout(() => {
  248. this.init()
  249. }, 800)
  250. })
  251. }
  252. },
  253. pay(){
  254. this.show=true
  255. },
  256. comment(value){
  257. this.$http('/addons/ddrive/sforder/comment', {
  258. order_id: this.id,
  259. score:value
  260. }).then(() => {
  261. uni.showToast({
  262. title: "评价成功"
  263. })
  264. })
  265. }
  266. }
  267. }
  268. </script>
  269. <style lang="scss">
  270. /deep/.u-primary-hover {
  271. background: linear-gradient(to right,#00b6b4,#00d496) !important;
  272. }
  273. .list {
  274. image {
  275. width: 50rpx;
  276. height: 50rpx;
  277. }
  278. }
  279. .img-siji {
  280. image {
  281. width: 130rpx;
  282. height: 134rpx;
  283. }
  284. }
  285. .img-tel {
  286. image {
  287. width: 86rpx;
  288. height: 86rpx;
  289. }
  290. }
  291. .img-tousu {
  292. image {
  293. width: 86rpx;
  294. height: 86rpx;
  295. }
  296. }
  297. </style>