order.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. <template>
  2. <view class="pagesCons">
  3. <view class="tab-body">
  4. <view class="uTabs">
  5. <u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
  6. swiperWidth="750"></u-tabs-swiper>
  7. </view>
  8. <swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
  9. <swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
  10. <scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
  11. <view class="check-order-list" v-if="index==current" v-for="(item,sindex) in list" :key="item.id+'-'+sindex"
  12. @click="viewRow(item)">
  13. <view class="check-row">
  14. <view class="createDate">{{item.createDate}}</view>
  15. <view >{{item.orderFlag}}</view>
  16. </view>
  17. <view class="bundle-list" v-for="row in item.itemList" :key="row.id">
  18. <view class="img-cont">
  19. <image :src="row.icon?row.icon:'../../static/tabbar/user.png'"></image>
  20. </view>
  21. <view >
  22. <view class="ellipsis-two">{{row.name}}</view>
  23. <view class="bundle-num">
  24. <view ><b class="price-num">{{row.price}}</b> <text class="price-text">乐豆</text></view>
  25. <view >X {{row.number}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="check-row">
  30. <view class="text-right">
  31. <text class="total-text">
  32. 共{{item.totalNum}}件商品
  33. </text>
  34. <text v-if="item.orderFlag=='待支付'"><text class="money-total">应付</text><b class="price-num">{{item.amount}}</b> <text class="price-text">乐豆</text></text>
  35. <text v-else><text class="money-total">实付</text><b class="price-num">{{item.payedAmount}}</b> <text class="price-text">乐豆</text></text>
  36. </view>
  37. </view>
  38. <view class="check-row">
  39. <view v-if="item.orderFlag=='待支付'" class="text-right">
  40. <text style="margin-right: 30upx;">支付剩余1天45分</text>
  41. <u-button class="btn-cont" shape="circle" type="warning" size="medium">去支付</u-button>
  42. </view>
  43. <view v-if="item.orderFlag=='待发货'" class="text-right">
  44. <u-button class="btn-cont" shape="circle" size="medium">提醒发货</u-button>
  45. </view>
  46. <view v-if="item.orderFlag=='已发货'" class="text-right">
  47. <u-button class="btn-cont" style="margin-right: 20upx;" shape="circle" size="medium">查看物流</u-button>
  48. <u-button class="btn-cont" shape="circle" type="primary" size="medium">确认收货</u-button>
  49. </view>
  50. <view v-if="item.orderFlag=='已完成'" class="text-right">
  51. <u-button class="btn-cont" shape="circle" size="medium">查看物流</u-button>
  52. </view>
  53. </view>
  54. </view>
  55. <u-empty style="padding-top: 10vh;height: auto;" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'"
  56. mode="list"></u-empty>
  57. <view v-if="index==current" style="padding: 20upx;">
  58. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  59. </view>
  60. </scroll-view>
  61. </swiper-item>
  62. </swiper>
  63. </view>
  64. <!-- 待办单查询弹框 -->
  65. <!-- <search-modal :visible="showSearch" @refresh="refresh" @close="showSearch=false"></search-modal> -->
  66. </view>
  67. </template>
  68. <script>
  69. // import {
  70. // getBackLogList
  71. // } from '@/api/backLog.js'
  72. import {
  73. getLookUpDatas,
  74. listLookUp
  75. } from '@/api/data'
  76. // import searchModal from './searchModal.vue'
  77. export default {
  78. components: {
  79. // searchModal
  80. },
  81. data() {
  82. return {
  83. showSearch: false, // 是否显示搜索弹框
  84. searchParams: {}, // 全部查询数据参数
  85. status: 'loadmore',
  86. noDataText: '暂无数据',
  87. background: {
  88. // 渐变色
  89. backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
  90. },
  91. tabList: [
  92. {
  93. dispName: '全部',
  94. typeId: 2,
  95. queryLabel: 'ALL' // tab参数
  96. },
  97. {
  98. dispName: '待支付',
  99. typeId: 1,
  100. queryLabel: 'DZF' // tab参数
  101. },
  102. {
  103. dispName: '待发货',
  104. typeId: 3,
  105. queryLabel: 'DFH' // tab参数
  106. },
  107. {
  108. dispName: '已发货',
  109. typeId: 3,
  110. queryLabel: 'YFH' // tab参数
  111. },
  112. {
  113. dispName: '已完成',
  114. typeId: 3,
  115. queryLabel: 'YWC' // tab参数
  116. },
  117. ],
  118. current: 0,
  119. swiperCurrent: 0,
  120. pageNo: 1,
  121. pageSize: 10,
  122. list: [],
  123. total: 0,
  124. action: 'swiperChange', // 操作类型,上划分页,或左右滑动
  125. }
  126. },
  127. onLoad() {
  128. if (this.$hasPermissions("B_todoList_new_mobile")) {
  129. // #ifdef APP-PLUS
  130. // 设置标题栏按钮
  131. let currentWebview = this.$scope.$getAppWebview();
  132. currentWebview.setTitleNViewButtonStyle(0, {
  133. text: '\ue610 新增',
  134. fontSize: 16,
  135. color: '#eee',
  136. width: '80px',
  137. fontSrc: '/static/iconfont/iconfont.ttf'
  138. });
  139. // #endif
  140. }
  141. // 监听新增后刷新
  142. uni.$on('refreshBL', this.refresh)
  143. // 监听待办处理后刷新
  144. uni.$on('refreshBl-handle', this.handleRefresh)
  145. this.pageInit()
  146. },
  147. onUnload() {
  148. uni.$off('refreshBL', this.refresh)
  149. uni.$off('refreshBl-handle', this.handleRefresh)
  150. },
  151. methods: {
  152. pageInit() {
  153. this.sortIndex = 1
  154. this.searchParams = {}
  155. this.pageNo = 1
  156. this.getRow()
  157. },
  158. handleRefresh() {
  159. this.getRow()
  160. },
  161. // tabs通知swiper切换
  162. tabsChange(index) {
  163. this.swiperCurrent = index;
  164. },
  165. swiperChange(event) {
  166. this.action = 'swiperChange'
  167. this.status = 'loading'
  168. },
  169. // swiper-item左右移动,通知tabs的滑块跟随移动
  170. transition(e) {
  171. let dx = e.detail.dx;
  172. this.$refs.uTabs.setDx(dx);
  173. },
  174. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  175. // swiper滑动结束,分别设置tabs和swiper的状态
  176. animationfinish(e) {
  177. let current = e.detail.current;
  178. let isCurtab = this.current == current
  179. if (this.status != "nomore") {
  180. let loadData = this.action == 'swiperChange' ? !isCurtab : isCurtab;
  181. if (loadData) {
  182. this.$refs.uTabs.setFinishCurrent(current);
  183. this.swiperCurrent = current;
  184. this.current = current;
  185. this.resetPage();
  186. }
  187. }
  188. },
  189. // scroll-view到底部加载更多
  190. onreachBottom() {
  191. this.action = 'onreachBottom'
  192. if (this.list.length < this.total) {
  193. this.pageNo += 1
  194. this.getRow()
  195. } else {
  196. uni.showToast({
  197. title: '已经到底了',
  198. icon: 'none'
  199. });
  200. this.status = "nomore"
  201. }
  202. },
  203. // 查询列表
  204. getRow(pageNo) {
  205. this.status = "loadmore"
  206. this.list = [{
  207. createDate: "2020-10-28 11:15:59",
  208. orderFlag: "待支付",
  209. payedAmount: 0,
  210. id: 11,
  211. amount: 450,
  212. totalNum: 3,
  213. itemList: [
  214. {
  215. name: "八九箭冠",
  216. id: 76435,
  217. number: 1,
  218. price: 150,
  219. icon: ''
  220. },
  221. {
  222. name: "数据库的合法身份觉得很附近发生纠纷解决",
  223. id: 76436,
  224. number: 2,
  225. price: 150,
  226. icon: ''
  227. }
  228. ]
  229. },{
  230. createDate: "2020-10-29 11:15:59",
  231. orderFlag: "待发货",
  232. payedAmount: 300,
  233. id: 112,
  234. amount: 300,
  235. totalNum: 2,
  236. itemList: [
  237. {
  238. name: "捐款事件的看法教科书上的发货角度思考JFK就是的JFK即将开放的",
  239. id: 76440,
  240. number: 2,
  241. price: 150,
  242. icon: ''
  243. }
  244. ]
  245. },{
  246. createDate: "2020-10-29 11:15:59",
  247. orderFlag: "已发货",
  248. payedAmount: 300,
  249. id: 1112,
  250. amount: 300,
  251. totalNum: 2,
  252. itemList: [
  253. {
  254. name: "捐款事件的看法教科书上的发货角度思考JFK就是的JFK即将开放的",
  255. id: 76420,
  256. number: 2,
  257. price: 150,
  258. icon: ''
  259. }
  260. ]
  261. },{
  262. createDate: "2020-10-29 11:15:59",
  263. orderFlag: "已完成",
  264. payedAmount: 300,
  265. id: 1126,
  266. amount: 300,
  267. totalNum: 2,
  268. itemList: [
  269. {
  270. name: "捐款事件的看法教科书上的发货角度思考JFK就是的JFK即将开放的",
  271. id: 76496,
  272. number: 2,
  273. price: 150,
  274. icon: ''
  275. }
  276. ]
  277. }]
  278. return
  279. if (pageNo) {
  280. this.pageNo = pageNo
  281. }
  282. let params = {
  283. pageNo: this.pageNo,
  284. pageSize: this.pageSize,
  285. queryLabel: this.tabList[this.current].queryLabel, // tab分类
  286. }
  287. if (params.queryLabel == 'ALL') {
  288. params.statusList = this.searchParams.status ? this.searchParams.status : [] // 状态(pending 待整改 check_pending待审核 finished 整改完成 expired 已过期)
  289. params.sourceTypeList = this.searchParams.sourceType ? this.searchParams.sourceType : [] // 问题来源(远程巡店 VIDEO_INSPECTION /现场巡店 SPOT_INSPECTION/点检 POINT_INSPECTION /手动创建 MANUAL)
  290. params.putUserName = this.searchParams.putUserName ? this.searchParams.putUserName : '' // 巡店人
  291. params.storeName = this.searchParams.storeName ? this.searchParams.storeName : '' // 门店名称
  292. params.beginDate = this.searchParams.beginDate ? this.searchParams.beginDate : '' // 发起开始时间
  293. params.endDate = this.searchParams.endDate ? this.searchParams.endDate : '' // 发起结束时间
  294. }
  295. this.status = "loading"
  296. getBackLogList(params).then(res => {
  297. if (res.status == 200) {
  298. if (this.pageNo > 1) {
  299. this.list = this.list.concat(res.data.list || [])
  300. } else {
  301. this.list = res.data.list || []
  302. }
  303. this.total = res.data.count || 0
  304. } else {
  305. this.list = []
  306. this.total = 0
  307. this.noDataText = res.message
  308. }
  309. this.status = "loadmore"
  310. })
  311. },
  312. resetPage() {
  313. this.status = 'loading';
  314. // 上划分页
  315. if (this.action == 'onreachBottom') {
  316. this.getRow();
  317. }
  318. // 左右切换tab
  319. if (this.action == 'swiperChange') {
  320. this.list = [];
  321. this.getRow(1);
  322. }
  323. },
  324. // 获取查询参数 刷新列表
  325. refresh(params) {
  326. // console.log(params,'1111111111')
  327. this.searchParams = params
  328. this.getRow(1)
  329. },
  330. // 新增页
  331. onNavigationBarButtonTap(e) {
  332. uni.navigateTo({
  333. url: "/pages/toDoList/addBacklog"
  334. })
  335. },
  336. // 详细页
  337. viewRow(item) {
  338. if (!this.$hasPermissions('M_backlog_detail_mobile')) {
  339. return
  340. }
  341. // 已完成的
  342. uni.navigateTo({
  343. url: "/pages/toDoList/backlogDetail?id=" + item.id
  344. })
  345. },
  346. // 状态颜色处理
  347. clsStatus(status) {
  348. if (status == '待审核') {
  349. return 'dsh'
  350. }
  351. if (status == '待整改') {
  352. return 'dzg'
  353. }
  354. if (status == '整改完成') {
  355. return 'ywc'
  356. }
  357. if (status == '已过期') {
  358. return 'ygq'
  359. }
  360. }
  361. }
  362. }
  363. </script>
  364. <style lang="scss">
  365. page {
  366. height: 100%;
  367. width: 100%;
  368. background: #F8F8F8;
  369. }
  370. .pagesCons {
  371. height: 100%;
  372. width: 100%;
  373. background: #F8F8F8;
  374. display: flex;
  375. flex-direction: column;
  376. .text-right {
  377. text-align: right;
  378. }
  379. .tab-body {
  380. flex: 1;
  381. display: flex;
  382. flex-direction: column;
  383. .uTabs {
  384. border-bottom: 1px solid #EEEEEE;
  385. box-shadow: 1px 1px 3px #eeeeee;
  386. }
  387. .check-list {
  388. flex: 1;
  389. overflow-y: scroll;
  390. .swiper-item {
  391. width: 100%;
  392. height: 100%;
  393. overflow: hidden;
  394. .scroll-view {
  395. width: 100%;
  396. height: 100%;
  397. overflow: auto;
  398. }
  399. }
  400. }
  401. // 列表样式
  402. .check-order-list {
  403. background: #ffffff;
  404. padding: 10upx 20upx;
  405. margin: 25upx;
  406. border-radius: 6upx;
  407. box-shadow: 1px 1px 3px #EEEEEE;
  408. font-size: 28upx;
  409. .check-row {
  410. display: flex;
  411. align-items: center;
  412. padding: 20upx 10upx;
  413. .icon-xian {
  414. text-align: right;
  415. width: 40upx;
  416. }
  417. &:first-child {
  418. border-bottom: 1px dashed #F8F8F8;
  419. .createDate {
  420. color: #666;
  421. font-size: 26upx;
  422. margin-left: 10upx;
  423. }
  424. }
  425. &:last-child {
  426. border-top: 1px dashed #F8F8F8;
  427. }
  428. >view {
  429. &:first-child {
  430. flex: 1;
  431. }
  432. }
  433. }
  434. // 订单中商品列表
  435. .bundle-list {
  436. display: flex;
  437. padding: 20upx 10upx;
  438. font-size: 28upx;
  439. .img-cont {
  440. width: 160upx;
  441. height: 160upx;
  442. >image {
  443. width: 100%;
  444. height: 100%;
  445. }
  446. }
  447. >view {
  448. &:last-child {
  449. padding: 10upx 0;
  450. flex: 1;
  451. margin-left: 20upx;
  452. display: flex;
  453. flex-direction: column;
  454. justify-content: space-between;
  455. }
  456. }
  457. .bundle-num {
  458. display: flex;
  459. justify-content: space-between;
  460. }
  461. }
  462. .btn-cont {
  463. width: 180upx;
  464. font-size: 30upx;
  465. }
  466. .price-text{
  467. font-size: 20upx;
  468. margin-left: 10upx;
  469. }
  470. .price-num{
  471. font-size: 32upx;
  472. }
  473. .total-text{
  474. margin-right: 50upx;
  475. }
  476. .money-total{
  477. margin-right: 10upx;
  478. }
  479. }
  480. }
  481. }
  482. </style>