wuyouAdmin.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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">
  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" >
  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.status == 0?'待服务':(items.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.detail}}
  35. </view>
  36. <view class="phone">
  37. {{items.real_name}} {{items.phone |geTel}}
  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.add_date}} {{items.last_date}}
  46. </view>
  47. </view>
  48. </view> -->
  49. <view class="item-yg">
  50. <view class="">
  51. 商品信息:<text>{{items.goods.name}}</text>
  52. </view>
  53. <!-- <view class="">
  54. 代理人:<text>李丹丹</text>
  55. </view> -->
  56. </view>
  57. <view class="item-btm flex">
  58. <view class="" v-if="item.status != 3">
  59. 下单时间:{{items.add_date}}
  60. </view>
  61. <!-- cashback_money -->
  62. <view class="" v-if="item.status == 3">
  63. 返现金额:{{items.cashback_money}}
  64. </view>
  65. <view class="u-btn" @click="cancelSubscribe(items.order_id)" v-if="items.status == 1">
  66. 上传评价
  67. </view>
  68. <view class="u-btn" @click="pass(items)" v-if="items.status == 0">
  69. 订单确认
  70. </view>
  71. <view class="u-btn" @click="lookimg(items)" v-if="items.status == 2 || items.status == 3">
  72. 查看评价
  73. </view>
  74. </view>
  75. </view>
  76. <uni-load-more :status="item.loadingType" v-if="!(item.loaded === true && item.list.length === 0)"></uni-load-more>
  77. </scroll-view>
  78. </swiper-item>
  79. </swiper>
  80. </view>
  81. </template>
  82. <script>
  83. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  84. import empty from '@/components/empty';
  85. import { wuyouList,cancelSubscribe,agentOrder,agentOrderAuth,wuyouAgentOrderAuth} from '@/api/user.js'
  86. export default {
  87. components: {
  88. empty,
  89. uniLoadMore
  90. },
  91. data() {
  92. return {
  93. keys: '',
  94. height: '',
  95. current: 0,
  96. navList: [
  97. {
  98. tit: '待确认',
  99. status: 0,
  100. list: [],
  101. loadingType: 'more',
  102. loaded: true,
  103. page: 1,
  104. limit: 10
  105. },
  106. {
  107. tit: '待上传',
  108. status: 1,
  109. list: [],
  110. loadingType: 'more',
  111. loaded: false,
  112. page: 1,
  113. limit: 10
  114. },
  115. {
  116. tit: '已上传',
  117. status: 2,
  118. list: [],
  119. loadingType: 'more',
  120. loaded: false,
  121. page: 1,
  122. limit: 10
  123. },
  124. {
  125. tit: '已完成',
  126. status:3,
  127. list: [],
  128. loadingType: 'more',
  129. loaded: false,
  130. page: 1,
  131. limit: 10
  132. }
  133. ]
  134. }
  135. },
  136. onLoad() {
  137. },
  138. onShow() {
  139. this.getOrderList('re')
  140. },
  141. onReachBottom() {
  142. },
  143. onReady(res) {
  144. var that = this;
  145. uni.getSystemInfo({
  146. success: resu => {
  147. const query = uni.createSelectorQuery();
  148. query.select('.swiper-box').boundingClientRect();
  149. query.exec(function(res) {
  150. that.height = resu.windowHeight - res[0].top + 'px';
  151. });
  152. },
  153. fail: res => {}
  154. });
  155. },
  156. methods: {
  157. lookimg(item) {
  158. let arr = item.auth_up_file.split(',')
  159. uni.previewImage({
  160. current: 0,
  161. loop: false,
  162. urls: arr,
  163. indicator: 'default'
  164. });
  165. },
  166. search() {
  167. this.getOrderList('re')
  168. },
  169. chanageC(e) {
  170. this.current = e.detail.current;
  171. this.getOrderList('tab')
  172. },
  173. changeCurrent(index) {
  174. if(index == this.current) return;
  175. this.current = index;
  176. },
  177. pass(item) {
  178. // agentOrderAuth({
  179. // id,
  180. // status: 0
  181. // }).then(res => {
  182. // uni.showToast({
  183. // title: '确认成功',
  184. // duration: 2000
  185. // });
  186. // })
  187. uni.navigateTo({
  188. url: '/pages/order/sht?id=' + item.order_id + '&type=' + item.goods.name
  189. })
  190. },
  191. cancelSubscribe(id) {
  192. uni.navigateTo({
  193. url: '/pages/order/upPj?id=' + id + '&type=1'
  194. })
  195. },
  196. getOrderList(type) {
  197. let that = this;
  198. let item = that.navList[that.current];
  199. if(type == 'tab' && item.loaded) return;
  200. if(type == 're') {
  201. item.loadingType = 'more'
  202. item.loaded = false
  203. item.page = 1
  204. item.list = []
  205. }
  206. if(item.loadingType == 'loading' || item.loadingType == 'noMore') return;
  207. item.loadingType = 'loading'
  208. wuyouList({
  209. page:item.page,
  210. limit:item.limit,
  211. status: item.status,
  212. key: this.keys
  213. }).then(res => {
  214. let arr = res.data.data
  215. item.list = item.list.concat(arr)
  216. if(arr.length == item.limit) {
  217. item.loadingType = 'more'
  218. }else {
  219. item.loadingType = 'noMore'
  220. }
  221. item.loaded = true
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style lang="scss" scoped>
  228. .navbar {
  229. display: flex;
  230. height: 40px;
  231. padding: 0 5px;
  232. background: #fff;
  233. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  234. position: relative;
  235. z-index: 10;
  236. .nav-item {
  237. flex: 1;
  238. display: flex;
  239. justify-content: center;
  240. align-items: center;
  241. height: 100%;
  242. font-size: 15px;
  243. color: $font-color-dark;
  244. position: relative;
  245. &.current {
  246. color: #000;
  247. font-weight: bold;
  248. &:after {
  249. content: '';
  250. position: absolute;
  251. left: 50%;
  252. bottom: 0;
  253. transform: translateX(-50%);
  254. width: 44px;
  255. height: 0;
  256. border-bottom: 2px solid $base-color;
  257. }
  258. }
  259. }
  260. }
  261. .swiper-box {
  262. }
  263. .order-item {
  264. padding:0 20rpx;
  265. background-color: #fff;
  266. width: 700rpx;
  267. margin: 0 auto 20rpx;
  268. border-radius: 20rpx;
  269. &:last-of-type {
  270. margin-bottom: 0;
  271. }
  272. .item-top {
  273. height: 92rpx;
  274. border-bottom: #f5f5f5 3rpx solid;
  275. font-weight: 500;
  276. .order-type {
  277. // padding: 10;
  278. padding: 8rpx 10rpx;
  279. background: #ffeae5;
  280. border-radius: 0rpx 10rpx 0rpx 10rpx;
  281. font-size: 20rpx;
  282. color: #FF4E00;
  283. }
  284. .order-id {
  285. flex-grow: 1;
  286. font-size: 22rpx;
  287. color: #A3A8BB;
  288. padding-left: 10rpx;
  289. }
  290. .order-status {
  291. font-size: 26rpx;
  292. color: #FF4E00;
  293. }
  294. }
  295. .item-yg {
  296. width: 660rpx;
  297. background: #F5F5F5;
  298. font-size: 24rpx;
  299. color: #666666;
  300. padding: 20rpx 0 20rpx 20rpx;
  301. margin-bottom: 24rpx;
  302. text {
  303. font-weight: bold;
  304. color: #333333;
  305. }
  306. }
  307. .item-btm {
  308. height: 92rpx;
  309. font-size: 24rpx;
  310. color: #A3A8BB;
  311. border-top: #f5f5f5 3rpx solid;
  312. }
  313. .item-user {
  314. justify-content: flex-start;
  315. align-items: flex-start;
  316. font-weight: bold;
  317. font-size: 26rpx;
  318. color: #000000;
  319. margin: 30rpx 0;
  320. .where {
  321. width: 24rpx;
  322. height: 28rpx;
  323. margin-right: 23rpx;
  324. }
  325. .time {
  326. width: 24rpx;
  327. height: 24rpx;
  328. }
  329. image {
  330. flex-shrink: 0;
  331. margin-top:5rpx;
  332. }
  333. .phone {
  334. padding-top: 15rpx;
  335. font-size: 23rpx;
  336. color: #666666;
  337. }
  338. }
  339. }
  340. .search-wrap {
  341. background-color: #ffffff;
  342. padding: 20rpx 0;
  343. .search {
  344. width: 702rpx;
  345. height: 64rpx;
  346. background: #F1F1F1;
  347. border-radius: 32rpx;
  348. margin: auto;
  349. padding: 0 30rpx;
  350. image {
  351. width: 31rpx;
  352. height: 32rpx;
  353. flex-shrink: 0;
  354. }
  355. input {
  356. height: 100%;
  357. flex-grow: 1;
  358. padding-left: 18rpx;
  359. }
  360. }
  361. }
  362. .u-btn {
  363. width: 144rpx;
  364. line-height: 55rpx;
  365. border-radius: 28rpx;
  366. border: 1px solid #FF4C4C;
  367. font-size: 26rpx;
  368. color: #FF4C4C;
  369. text-align: center;
  370. }
  371. </style>