outBindCarList.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="my-order">
  4. <view class='search acea-row row-between-wrapper'>
  5. <view class='input acea-row row-between-wrapper'>
  6. <text class='iconfont icon-sousuo'></text>
  7. <input type='text' v-model='searchKey' @confirm="inputConfirm" focus
  8. :placeholder='$t(`姓名/手机号/车辆编号`)' placeholder-class='placeholder' @input="setValue"></input>
  9. </view>
  10. <view class='bnt' @tap='searchBut'>{{$t(`搜索`)}}</view>
  11. </view>
  12. <view class="list">
  13. <view class="item" v-for="(item,ind) in orderList">
  14. <view class="acea-row">
  15. <view class="title line2">
  16. 时间:{{item.add_time}}
  17. </view>
  18. </view>
  19. <view class="machine ">
  20. <view class="acea-row row-between">
  21. <view class="it">
  22. 内容:{{item.content}}
  23. </view>
  24. </view>
  25. </view>
  26. <view class="machine ">
  27. <view class="acea-row row-left">
  28. <view class="image-list" v-for="ls in item.images">
  29. <image :src="ls" mode="scaleToFill"></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="machine acea-row row-between-wrapper">
  34. <view class="acea-row row-left">
  35. <view class="it">
  36. 编号:
  37. </view>
  38. <view class="code">
  39. {{item.machine_no}}
  40. </view>
  41. </view>
  42. <view class="acea-row row-rightss" v-if="item.plate_number">
  43. <view class="it">
  44. 车牌号:
  45. </view>
  46. <view class="code">
  47. {{item.plate_number}}
  48. </view>
  49. </view>
  50. <view class="acea-row row-rightss">
  51. <view class="font-color-yellow" v-if="item.type==0">
  52. 解绑
  53. </view>
  54. <view class="font-color-white" v-if="item.type==-1">
  55. 换绑
  56. </view>
  57. </view>
  58. <view class="acea-row row-rightss">
  59. <view class="del-buttom" @click="del(item,ind)">
  60. 撤销
  61. </view>
  62. </view>
  63. </view>
  64. <view v-if="item.status==0" class="text_blue tip ">
  65. 申请中
  66. </view>
  67. <view v-if="item.status==1" class="text_greed tip">
  68. 同意
  69. </view>
  70. <view v-if="item.status==1" class="text_red tip">
  71. 反对
  72. </view>
  73. </view>
  74. </view>
  75. <view class="loadingicon acea-row row-center-wrapper font-color-white" v-if="orderList.length > 0">
  76. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  77. {{ loadTitle }}
  78. </view>
  79. <view v-if="orderList.length == 0">
  80. <emptyPage v-if="!loading" :title="$t(`暂无订单`)"></emptyPage>
  81. <view class="loadingicon acea-row row-center-wrapper">
  82. <text class="loading iconfont icon-jiazai font-color-white" :hidden="loading == false"></text>
  83. </view>
  84. </view>
  85. <navigator url="./outBindCar">
  86. <view class="logOut cartcolor acea-row row-center-wrapper">{{$t(`车辆解绑/换绑`)}}</view>
  87. </navigator>
  88. </view>
  89. <!-- #ifndef MP -->
  90. <home></home>
  91. <!-- #endif -->
  92. </view>
  93. </template>
  94. <script>
  95. import {
  96. storeApply,
  97. delStoreApplyId
  98. } from '@/api/rent.js';
  99. import home from '@/components/home';
  100. import {
  101. toLogin
  102. } from '@/libs/login.js';
  103. import {
  104. mapGetters
  105. } from 'vuex';
  106. import emptyPage from '@/components/emptyPage.vue';
  107. import colors from '@/mixins/color.js';
  108. export default {
  109. components: {
  110. home,
  111. emptyPage,
  112. },
  113. mixins: [colors],
  114. data() {
  115. return {
  116. searchKey: '',
  117. loading: false, //是否加载中
  118. loadend: false, //是否加载完毕
  119. loadTitle: this.$t(`加载更多`), //提示语
  120. orderList: [], //订单数组
  121. orderData: {}, //订单详细统计
  122. page: 1,
  123. limit: 20,
  124. pay_close: false,
  125. pay_order_id: '',
  126. totalPrice: '0',
  127. // 保存当前订单数据
  128. actionOrder: {},
  129. payLoding: false, //判断是否支付中
  130. };
  131. },
  132. computed: mapGetters(['isLogin']),
  133. onShow() {
  134. if (this.isLogin) {
  135. this.page = 1;
  136. this.orderList = []
  137. this.loadend = false;
  138. this.getRentOrder();
  139. } else {
  140. toLogin();
  141. }
  142. },
  143. methods: {
  144. // 撤销申请
  145. del(item, index) {
  146. let that = this;
  147. if (!item.id) {
  148. return that.$util.Tips({
  149. title: that.$t(`缺少订单号无法取消订单`)
  150. })
  151. };
  152. uni.showModal({
  153. title: '提示',
  154. content: '是否撤销申请',
  155. success: res => {
  156. if (res.confirm) {
  157. uni.showLoading({
  158. title:'提交中',
  159. mask:true
  160. })
  161. delStoreApplyId({
  162. id: item.id
  163. })
  164. .then(res => {
  165. uni.hideLoading()
  166. return that.$util.Tips({
  167. title: res.msg,
  168. icon: 'success'
  169. },
  170. function() {
  171. that.orderList.splice(index, 1);
  172. that.$set(that, 'orderList', that.orderList);
  173. }
  174. );
  175. })
  176. .catch(err => {
  177. uni.hideLoading()
  178. return that.$util.Tips({
  179. title: err
  180. });
  181. });
  182. }
  183. },
  184. fail: () => {},
  185. complete: () => {}
  186. });
  187. },
  188. // 回车查询
  189. inputConfirm: function(event) {
  190. if (event.detail.value) {
  191. uni.hideKeyboard();
  192. this.searchBut(event.detail.value);
  193. }
  194. },
  195. // 查询
  196. searchBut() {
  197. this.loadend = false;
  198. this.page = 1;
  199. this.orderList = [];
  200. uni.showLoading({
  201. title: this.$t(`正在搜索中`)
  202. });
  203. this.getRentOrder();
  204. uni.hideLoading();
  205. },
  206. // 设置查询值
  207. setValue: function(event) {
  208. this.$set(this, 'searchKey', event.detail.value);
  209. },
  210. /**
  211. * 获取订单列表
  212. */
  213. getRentOrder: function() {
  214. let that = this;
  215. if (that.loadend) return;
  216. if (that.loading) return;
  217. that.loading = true;
  218. that.loadTitle = that.$t(`加载更多`);
  219. storeApply({
  220. page: that.page,
  221. limit: that.limit,
  222. key: that.searchKey
  223. })
  224. .then(res => {
  225. let list = res.data.list || [];
  226. let loadend = list.length < that.limit;
  227. that.orderList = that.$util.SplitArray(list, that.orderList);
  228. that.$set(that, 'orderList', that.orderList);
  229. that.loadend = loadend;
  230. that.loading = false;
  231. that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
  232. that.page = that.page + 1;
  233. })
  234. .catch(err => {
  235. that.loading = false;
  236. that.loadTitle = that.$t(`加载更多`);
  237. });
  238. },
  239. },
  240. onReachBottom: function() {
  241. this.getRentOrder();
  242. },
  243. // 滚动监听
  244. onPageScroll(e) {
  245. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  246. uni.$emit('scroll');
  247. },
  248. };
  249. </script>
  250. <style scoped lang="scss">
  251. .list {
  252. padding: 30rpx;
  253. padding-top: 126rpx;
  254. .item {
  255. position: relative;
  256. background-color: var(--view-theme-16);
  257. padding: 30rpx;
  258. border-radius: 10rpx;
  259. margin-bottom: 20rpx;
  260. overflow: hidden;
  261. border: 2px solid #333333;
  262. .title {
  263. font-weight: bold;
  264. font-size: $uni-font-size-base;
  265. color: #fff;
  266. }
  267. .machine {
  268. font-size: $uni-font-size-sm;
  269. color: #999999;
  270. margin-top: 20rpx;
  271. .del-buttom {
  272. background-color: #FFFFFF;
  273. border-radius: 100rpx;
  274. color: #333;
  275. padding: 6rpx 20rpx;
  276. line-height: 1;
  277. }
  278. .image-list {
  279. width: 100rpx;
  280. height: 100rpx;
  281. border: 1px solid #333;
  282. background-color: #FFF;
  283. border-radius: 5rpx;
  284. margin-right: 10rpx;
  285. image {
  286. width: 100%;
  287. height: 100%;
  288. }
  289. }
  290. .code {
  291. color: var(--view-priceColor);
  292. background-color: rgba(#75EFFA, 0.2);
  293. padding: 5rpx 10rpx;
  294. border-radius: 10rpx;
  295. }
  296. }
  297. .img {
  298. width: 40rpx;
  299. height: 40rpx;
  300. }
  301. .tip {
  302. position: absolute;
  303. top: 0;
  304. right: 0;
  305. padding: 5rpx 20rpx;
  306. font-size: 20rpx;
  307. border-bottom-left-radius: 10rpx;
  308. &.text_greed {
  309. color: #49D8A8;
  310. background-color: rgba(#49D8A8, 0.2);
  311. }
  312. &.text_red {
  313. color: rgba(254, 92, 45, 1);
  314. background-color: rgba(rgba(254, 92, 45, 1), 0.2);
  315. }
  316. &.text_blue {
  317. color: #1db0fc;
  318. background-color: rgba(#1db0fc, 0.2);
  319. }
  320. }
  321. }
  322. }
  323. .my-order {
  324. background-color: var(--view-theme);
  325. min-height: 100vh;
  326. padding-bottom: 150rpx;
  327. .search {
  328. position: fixed;
  329. top: 0rpx;
  330. left: 0rpx;
  331. z-index: 999;
  332. padding-top: 30rpx;
  333. padding-left: 30rpx;
  334. padding-bottom: 30rpx;
  335. background-color: var(--view-theme);
  336. .bnt {
  337. width: 120rpx;
  338. text-align: center;
  339. height: 66rpx;
  340. line-height: 66rpx;
  341. font-size: 30rpx;
  342. color: #FFFFFF;
  343. }
  344. .input {
  345. width: 598rpx;
  346. background-color: #f7f7f7;
  347. border-radius: 33rpx;
  348. padding: 0 35rpx;
  349. box-sizing: border-box;
  350. height: 66rpx;
  351. input {
  352. width: 472rpx;
  353. font-size: 28rpx;
  354. }
  355. .placeholder {
  356. color: #999;
  357. }
  358. .iconfont {
  359. color: #555;
  360. font-size: 35rpx;
  361. }
  362. }
  363. }
  364. .header {
  365. height: 260rpx;
  366. padding: 0 30rpx;
  367. .picTxt {
  368. height: 190rpx;
  369. .text {
  370. color: rgba(255, 255, 255, 0.8);
  371. font-size: 26rpx;
  372. font-family: 'Guildford Pro';
  373. .name {
  374. font-size: 34rpx;
  375. font-weight: bold;
  376. color: #fff;
  377. margin-bottom: 20rpx;
  378. }
  379. }
  380. .pictrue {
  381. width: 122rpx;
  382. height: 109rpx;
  383. image {
  384. width: 100%;
  385. height: 100%;
  386. }
  387. }
  388. }
  389. }
  390. }
  391. .noCart {
  392. margin-top: 171rpx;
  393. padding-top: 0.1rpx;
  394. .pictrue {
  395. width: 414rpx;
  396. height: 336rpx;
  397. margin: 78rpx auto 56rpx auto;
  398. image {
  399. width: 100%;
  400. height: 100%;
  401. }
  402. }
  403. }
  404. .logOut {
  405. font-size: 32rpx;
  406. text-align: center;
  407. width: 690rpx;
  408. height: 90rpx;
  409. border-radius: 45rpx;
  410. background-color: #FFFFFF;
  411. position: fixed;
  412. bottom: 20rpx;
  413. left: 30rpx;
  414. }
  415. .cartcolor {
  416. color: var(--view-theme);
  417. border: 1px solid var(--view-theme);
  418. }
  419. </style>