orderAdmin.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view class="content">
  3. <!-- <view class="search-wrap">
  4. <view class="search flex">
  5. <image src="../../static/icon/search.png" mode=""></image>
  6. <input type="text" placeholder="请输入关键词搜索" confirm-type="search" @confirm="search" v-model="keys"/>
  7. </view>
  8. </view> -->
  9. <!-- <view class="navbar">
  10. <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: current === index }" @click="changeCurrent(index)">{{ item.tit }}</view>
  11. </view> -->
  12. <view style="height: 20rpx;">
  13. </view>
  14. <swiper :current="current" class="swiper-box" :style="{'height': height}" @change="chanageC" disable-touch>
  15. <swiper-item v-for="item in navList" >
  16. <scroll-view scroll-y="true" :style="{'height': height}">
  17. <empty v-if="item.loaded === true && item.list.length === 0"></empty>
  18. <view class="order-item" v-for="items in item.list" @click="lookMore(items)">
  19. <view class="item-top flex">
  20. <view class="order-type">
  21. 预约订单
  22. </view>
  23. <view class="order-id">
  24. 订单编号:{{items.order_id}}
  25. </view>
  26. <view class="order-status">
  27. {{items.agent_status == 0?'待服务':(items.agent_status == 1?'进行中':'已完成')}}
  28. </view>
  29. </view>
  30. <view class="item-user flex">
  31. <image src="../../static/icon/where.png" mode="" class="where"></image>
  32. <view class="">
  33. <view class="">
  34. {{items.user_address}}
  35. </view>
  36. <view class="phone">
  37. {{items.real_name}} <text @click="makeCall(items.user_phone)">{{items.user_phone }}</text>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="item-user flex">
  42. <image src="../../static/icon/time.png" mode="" class="where"></image>
  43. <view class="">
  44. <view class="">
  45. {{items.subscribe_day}} {{items.subscribe_time}}
  46. </view>
  47. </view>
  48. </view>
  49. <view class="goods-box-single" v-for="(goodsItem, goodsIndex) in items._info" :key="goodsIndex">
  50. <image class="goods-img" :src="goodsItem.cart_info.productInfo.image" mode="scaleToFill"></image>
  51. <view class="right">
  52. <view class="flex-start">
  53. <text class="title clamp2">{{ goodsItem.cart_info.productInfo.store_name }}</text>
  54. <!-- <text class="price">{{ goodsItem.cart_info.productInfo.price }}</text> -->
  55. </view>
  56. <view class="row flex">
  57. <!-- <text class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text> -->
  58. <text class="attr-box">服务类型:{{ goodsItem.cart_info.productInfo.is_housekeeping == 1? '家政':(goodsItem.cart_info.productInfo.is_maintenance == 1?'维修': '普通商品') }}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="item-btm flex">
  63. <view class="">
  64. 下单时间:{{items.add_time}}
  65. </view>
  66. <view class="u-btn" @click.stop="cancelSubscribe(items.order_id)" v-if="items.agent_status == 1">
  67. 上传评价
  68. </view>
  69. <view class="u-btn" @click.stop="pass(items)" v-if="items.agent_status == 0">
  70. 订单确认
  71. </view>
  72. <view class="u-btn" @click.stop="lookimg(items)" v-if="items.agent_status == 2 || items.agent_status == 3">
  73. 查看评价
  74. </view>
  75. </view>
  76. </view>
  77. <uni-load-more :status="item.loadingType" v-if="!(item.loaded === true && item.list.length === 0)"></uni-load-more>
  78. </scroll-view>
  79. </swiper-item>
  80. </swiper>
  81. </view>
  82. </template>
  83. <script>
  84. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  85. import empty from '@/components/empty';
  86. import { subscribeList,cancelSubscribe,agentOrder,agentOrderAuth} from '@/api/user.js'
  87. export default {
  88. components: {
  89. empty,
  90. uniLoadMore
  91. },
  92. data() {
  93. return {
  94. keys: '',
  95. height: '',
  96. current: 0,
  97. navList: [
  98. {
  99. tit: '全部',
  100. status: -2,
  101. list: [],
  102. loadingType: 'more',
  103. loaded: true,
  104. page: 1,
  105. limit: 10
  106. },
  107. {
  108. tit: '待确认',
  109. status: 0,
  110. list: [],
  111. loadingType: 'more',
  112. loaded: true,
  113. page: 1,
  114. limit: 10
  115. },
  116. {
  117. tit: '待上传',
  118. status: 1,
  119. list: [],
  120. loadingType: 'more',
  121. loaded: false,
  122. page: 1,
  123. limit: 10
  124. },
  125. {
  126. tit: '已上传',
  127. status: 2,
  128. list: [],
  129. loadingType: 'more',
  130. loaded: false,
  131. page: 1,
  132. limit: 10
  133. },
  134. {
  135. tit: '已完成',
  136. status:3,
  137. list: [],
  138. loadingType: 'more',
  139. loaded: false,
  140. page: 1,
  141. limit: 10
  142. }
  143. ]
  144. }
  145. },
  146. onLoad() {
  147. },
  148. onShow() {
  149. this.getOrderList('re')
  150. },
  151. onReachBottom() {
  152. },
  153. onReady(res) {
  154. var that = this;
  155. uni.getSystemInfo({
  156. success: resu => {
  157. const query = uni.createSelectorQuery();
  158. query.select('.swiper-box').boundingClientRect();
  159. query.exec(function(res) {
  160. that.height = resu.windowHeight - res[0].top + 'px';
  161. });
  162. },
  163. fail: res => {}
  164. });
  165. },
  166. methods: {
  167. makeCall(phone) {
  168. console.log(phone);
  169. if(phone) {
  170. uni.makePhoneCall({
  171. phoneNumber:phone + ''
  172. })
  173. }
  174. },
  175. lookMore(item) {
  176. console.log(item);
  177. uni.navigateTo({
  178. url:'/pages/order/orderDetails?id=' + item.id
  179. })
  180. },
  181. lookimg(item) {
  182. let arr = item.auth_up_file.split(',')
  183. uni.previewImage({
  184. current: 0,
  185. loop: false,
  186. urls: arr,
  187. indicator: 'default'
  188. });
  189. },
  190. search() {
  191. this.getOrderList('re')
  192. },
  193. chanageC(e) {
  194. this.current = e.detail.current;
  195. this.getOrderList('tab')
  196. },
  197. changeCurrent(index) {
  198. if(index == this.current) return;
  199. this.current = index;
  200. },
  201. pass(item) {
  202. // agentOrderAuth({
  203. // id,
  204. // status: 0
  205. // }).then(res => {
  206. // uni.showToast({
  207. // title: '确认成功',
  208. // duration: 2000
  209. // });
  210. // })
  211. uni.navigateTo({
  212. url: '/pages/order/sh?id=' + item.order_id + '&day=' + item.subscribe_day + '&time=' + item.subscribe_time + '&type=' + item.type
  213. })
  214. },
  215. cancelSubscribe(id) {
  216. uni.navigateTo({
  217. url: '/pages/order/upPj?id=' + id
  218. })
  219. },
  220. getOrderList(type) {
  221. let that = this;
  222. let item = that.navList[that.current];
  223. if(type == 'tab' && item.loaded) return;
  224. if(type == 're') {
  225. item.loadingType = 'more'
  226. item.loaded = false
  227. item.page = 1
  228. item.list = []
  229. }
  230. if(item.loadingType == 'loading' || item.loadingType == 'noMore') return;
  231. item.loadingType = 'loading'
  232. agentOrder({
  233. page:item.page,
  234. limit:item.limit,
  235. agent_status: item.status,
  236. key: this.keys
  237. }).then(res => {
  238. let arr = res.data.data
  239. item.list = item.list.concat(arr)
  240. if(arr.length == item.limit) {
  241. item.loadingType = 'more'
  242. }else {
  243. item.loadingType = 'noMore'
  244. }
  245. item.loaded = true
  246. })
  247. }
  248. }
  249. }
  250. </script>
  251. <style lang="scss" scoped>
  252. .navbar {
  253. display: flex;
  254. height: 40px;
  255. padding: 0 5px;
  256. background: #fff;
  257. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  258. position: relative;
  259. z-index: 10;
  260. .nav-item {
  261. flex: 1;
  262. display: flex;
  263. justify-content: center;
  264. align-items: center;
  265. height: 100%;
  266. font-size: 15px;
  267. color: $font-color-dark;
  268. position: relative;
  269. &.current {
  270. color: #000;
  271. font-weight: bold;
  272. &:after {
  273. content: '';
  274. position: absolute;
  275. left: 50%;
  276. bottom: 0;
  277. transform: translateX(-50%);
  278. width: 44px;
  279. height: 0;
  280. border-bottom: 2px solid $base-color;
  281. }
  282. }
  283. }
  284. }
  285. .swiper-box {
  286. }
  287. .order-item {
  288. padding:0 20rpx;
  289. background-color: #fff;
  290. width: 700rpx;
  291. margin: 0 auto 20rpx;
  292. border-radius: 20rpx;
  293. &:last-of-type {
  294. margin-bottom: 0;
  295. }
  296. .item-top {
  297. height: 92rpx;
  298. border-bottom: #f5f5f5 3rpx solid;
  299. font-weight: 500;
  300. .order-type {
  301. // padding: 10;
  302. padding: 8rpx 10rpx;
  303. background: #ffeae5;
  304. border-radius: 0rpx 10rpx 0rpx 10rpx;
  305. font-size: 20rpx;
  306. color: #FF4E00;
  307. }
  308. .order-id {
  309. flex-grow: 1;
  310. font-size: 22rpx;
  311. color: #A3A8BB;
  312. padding-left: 10rpx;
  313. }
  314. .order-status {
  315. font-size: 26rpx;
  316. color: #FF4E00;
  317. }
  318. }
  319. .item-yg {
  320. width: 660rpx;
  321. background: #F5F5F5;
  322. font-size: 24rpx;
  323. color: #666666;
  324. padding: 20rpx 0 20rpx 20rpx;
  325. margin-bottom: 24rpx;
  326. text {
  327. font-weight: bold;
  328. color: #333333;
  329. }
  330. }
  331. .item-btm {
  332. height: 92rpx;
  333. font-size: 24rpx;
  334. color: #A3A8BB;
  335. border-top: #f5f5f5 3rpx solid;
  336. }
  337. .item-user {
  338. justify-content: flex-start;
  339. align-items: flex-start;
  340. font-weight: bold;
  341. font-size: 26rpx;
  342. color: #000000;
  343. margin: 30rpx 0;
  344. .where {
  345. width: 24rpx;
  346. height: 28rpx;
  347. margin-right: 23rpx;
  348. }
  349. .time {
  350. width: 24rpx;
  351. height: 24rpx;
  352. }
  353. image {
  354. flex-shrink: 0;
  355. margin-top:5rpx;
  356. }
  357. .phone {
  358. padding-top: 15rpx;
  359. font-size: 23rpx;
  360. color: #666666;
  361. }
  362. }
  363. }
  364. .search-wrap {
  365. background-color: #ffffff;
  366. padding: 20rpx 0;
  367. .search {
  368. width: 702rpx;
  369. height: 64rpx;
  370. background: #F1F1F1;
  371. border-radius: 32rpx;
  372. margin: auto;
  373. padding: 0 30rpx;
  374. image {
  375. width: 31rpx;
  376. height: 32rpx;
  377. flex-shrink: 0;
  378. }
  379. input {
  380. height: 100%;
  381. flex-grow: 1;
  382. padding-left: 18rpx;
  383. }
  384. }
  385. }
  386. .u-btn {
  387. width: 144rpx;
  388. line-height: 55rpx;
  389. border-radius: 28rpx;
  390. border: 1px solid #FF4C4C;
  391. font-size: 26rpx;
  392. color: #FF4C4C;
  393. text-align: center;
  394. }
  395. /* 单条商品 */
  396. .goods-box-single {
  397. display: flex;
  398. padding: 20rpx 0;
  399. .goods-img {
  400. display: block;
  401. width: 120rpx;
  402. height: 120rpx;
  403. }
  404. .right {
  405. flex: 1;
  406. display: flex;
  407. flex-direction: column;
  408. padding: 0 30rpx 0 24rpx;
  409. overflow: hidden;
  410. .row{
  411. margin-top: 10rpx;
  412. }
  413. .row_title{
  414. padding:5rpx 10rpx;
  415. background-color: #dddddd;
  416. border-radius: 10rpx;
  417. font-size: 22rpx;
  418. color: #ffffff;
  419. }
  420. .title {
  421. font-size: $font-base + 2rpx;
  422. color: $font-color-dark;
  423. line-height: 1;
  424. width: 80%;
  425. }
  426. .attr-box {
  427. display: flex;
  428. justify-content: flex-end;
  429. font-size: $font-sm + 2rpx;
  430. color: $font-color-light;
  431. }
  432. .price {
  433. display: inline;
  434. font-size: $font-base + 2rpx;
  435. color: $font-color-dark;
  436. &:before {
  437. content: '¥';
  438. font-size: $font-sm;
  439. }
  440. }
  441. }
  442. }
  443. </style>