LogList.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <template>
  2. <view class="pagesCons">
  3. <view class="tab-body">
  4. <scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
  5. <view class="check-order-list" v-for="(item,sindex) in list" :key="item.id"
  6. @click="viewRow(item)">
  7. <view class="order-log">
  8. <view v-if="item.orderFlag=='待发货'">待发货</view>
  9. <view>
  10. <view>
  11. 快递公司:<text class="address-title">{{item.logName}}</text>
  12. <text class="btn-cont" @click="copyLogNum" style="float: right;">确认收货</text>
  13. </view>
  14. <view>
  15. <text>运单编号:</text>
  16. <text>{{item.logNum}}</text>
  17. <u-button @click="copyLogNum" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
  18. </view>
  19. </view>
  20. </view>
  21. <u-gap height="10" bg-color="#f8f8f8"></u-gap>
  22. <view class="bundle-list" v-for="row in item.itemList" :key="row.id">
  23. <view class="img-cont">
  24. <image :src="row.icon?row.icon:'../../static/goods.png'"></image>
  25. </view>
  26. <view >
  27. <view class="ellipsis-two">{{row.name}}</view>
  28. <view class="bundle-num">
  29. <view ><text class="price-num">{{row.price}}</text> <text class="price-text">乐豆</text></view>
  30. <view >X {{row.number}}</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <u-empty style="padding-top: 10vh;height: auto;" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'"
  36. mode="list"></u-empty>
  37. <view style="padding: 20upx;">
  38. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  39. </view>
  40. </scroll-view>
  41. </view>
  42. <!-- 查看物流弹窗 -->
  43. <view>
  44. <u-modal v-model="isShow" :show-title="false" confirm-text="好的">
  45. <view class="slot-content">
  46. <view>
  47. 快递公司:{{logData.logName}}
  48. </view>
  49. <view>
  50. 运单编号:{{logData.logNum}}
  51. <u-button @click="copyLogNum" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
  52. </view>
  53. </view>
  54. </u-modal>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import { queryOrderExpress } from '@/api/order.js'
  60. export default {
  61. components: {
  62. },
  63. data() {
  64. return {
  65. isShow: false, // 是否显示物流弹框
  66. status: 'loadmore',
  67. noDataText: '暂无数据',
  68. current: 0,
  69. swiperCurrent: 0,
  70. pageNo: 1,
  71. pageSize: 10,
  72. list: [],
  73. logData: { // 物流信息
  74. logName: '韵达快递',
  75. logNum: 12356544544
  76. },
  77. total: 0,
  78. action: 'swiperChange', // 操作类型,上划分页,或左右滑动
  79. }
  80. },
  81. onLoad() {
  82. this.pageInit()
  83. },
  84. onUnload() {
  85. uni.$off('refreshBL', this.refresh)
  86. uni.$off('refreshBl-handle', this.handleRefresh)
  87. },
  88. methods: {
  89. pageInit() {
  90. this.sortIndex = 1
  91. this.pageNo = 1
  92. this.getRow()
  93. },
  94. handleRefresh() {
  95. this.getRow()
  96. },
  97. // scroll-view到底部加载更多
  98. onreachBottom() {
  99. this.action = 'onreachBottom'
  100. if (this.list.length < this.total) {
  101. this.pageNo += 1
  102. this.getRow()
  103. } else {
  104. uni.showToast({
  105. title: '已经到底了',
  106. icon: 'none'
  107. });
  108. this.status = "nomore"
  109. }
  110. },
  111. // 查询列表
  112. getRow(pageNo) {
  113. this.status = "loadmore"
  114. this.list = [{
  115. createDate: "2020-10-28 11:15:59",
  116. orderFlag: "待支付",
  117. payedAmount: 0,
  118. id: 11,
  119. amount: 450,
  120. totalNum: 3,
  121. logName: '韵达快递',
  122. logNum: '12454545485',
  123. itemList: [
  124. {
  125. name: "八九箭冠",
  126. id: 76435,
  127. number: 1,
  128. price: 150,
  129. icon: ''
  130. },
  131. {
  132. name: "数据库的合法身份觉得很附近发生纠纷解决",
  133. id: 76436,
  134. number: 2,
  135. price: 150,
  136. icon: ''
  137. }
  138. ]
  139. },
  140. {
  141. createDate: "2020-10-28 11:15:59",
  142. orderFlag: "待支付",
  143. payedAmount: 0,
  144. id: 12,
  145. amount: 450,
  146. totalNum: 3,
  147. logName: '韵达快递',
  148. logNum: '12454545485',
  149. itemList: [
  150. {
  151. name: "八九箭冠",
  152. id: 76435,
  153. number: 1,
  154. price: 150,
  155. icon: ''
  156. },
  157. {
  158. name: "数据库的合法身份觉得很附近发生纠纷解决",
  159. id: 76436,
  160. number: 2,
  161. price: 150,
  162. icon: ''
  163. }
  164. ]
  165. }]
  166. return
  167. if (pageNo) {
  168. this.pageNo = pageNo
  169. }
  170. let params = {
  171. pageNo: this.pageNo,
  172. pageSize: this.pageSize,
  173. queryLabel: this.tabList[this.current].queryLabel, // tab分类
  174. }
  175. this.status = "loading"
  176. getBackLogList(params).then(res => {
  177. if (res.status == 200) {
  178. if (this.pageNo > 1) {
  179. this.list = this.list.concat(res.data.list || [])
  180. } else {
  181. this.list = res.data.list || []
  182. }
  183. this.total = res.data.count || 0
  184. } else {
  185. this.list = []
  186. this.total = 0
  187. this.noDataText = res.message
  188. }
  189. this.status = "loadmore"
  190. })
  191. },
  192. resetPage() {
  193. this.status = 'loading';
  194. // 上划分页
  195. if (this.action == 'onreachBottom') {
  196. this.getRow();
  197. }
  198. // 左右切换tab
  199. if (this.action == 'swiperChange') {
  200. this.list = [];
  201. this.getRow(1);
  202. }
  203. },
  204. // 获取查询参数 刷新列表
  205. refresh(params) {
  206. // console.log(params,'1111111111')
  207. this.searchParams = params
  208. this.getRow(1)
  209. },
  210. // 复制运单编号
  211. copyLogNum () {
  212. // H5 不支持
  213. uni.setClipboardData({
  214. data: this.logData.logNum,
  215. success: function(res) {
  216. uni.getClipboardData({
  217. success: function(res) {
  218. uni.showToast({
  219. title: '已复制到剪贴板'
  220. });
  221. }
  222. });
  223. }
  224. })
  225. },
  226. // 详细页
  227. viewRow(item) {
  228. // if (!this.$hasPermissions('M_backlog_detail_mobile')) {
  229. // return
  230. // }
  231. // 已完成的
  232. uni.navigateTo({
  233. url: "/pages/order/orderDetail?id=" + item.id
  234. })
  235. },
  236. }
  237. }
  238. </script>
  239. <style lang="scss">
  240. page {
  241. height: 100%;
  242. width: 100%;
  243. background: #F8F8F8;
  244. }
  245. .pagesCons {
  246. height: 100%;
  247. width: 100%;
  248. background: #F8F8F8;
  249. display: flex;
  250. flex-direction: column;
  251. .text-right {
  252. text-align: right;
  253. }
  254. .tab-body {
  255. flex: 1;
  256. display: flex;
  257. flex-direction: column;
  258. .uTabs {
  259. border-bottom: 1px solid #EEEEEE;
  260. box-shadow: 1px 1px 3px #eeeeee;
  261. }
  262. .check-list {
  263. flex: 1;
  264. overflow-y: scroll;
  265. .swiper-item {
  266. width: 100%;
  267. height: 100%;
  268. overflow: hidden;
  269. .scroll-view {
  270. width: 100%;
  271. height: 100%;
  272. overflow: auto;
  273. }
  274. }
  275. }
  276. // 列表样式
  277. .check-order-list {
  278. background: #ffffff;
  279. padding: 10upx 20upx;
  280. margin: 25upx;
  281. border-radius: 6upx;
  282. box-shadow: 1px 1px 3px #EEEEEE;
  283. font-size: 28upx;
  284. .check-row {
  285. display: flex;
  286. align-items: center;
  287. padding: 20upx 10upx;
  288. .icon-xian {
  289. text-align: right;
  290. width: 40upx;
  291. }
  292. &:first-child {
  293. border-bottom: 1px dashed #F8F8F8;
  294. .createDate {
  295. color: #666;
  296. font-size: 26upx;
  297. margin-left: 10upx;
  298. }
  299. }
  300. &:last-child {
  301. border-top: 1px dashed #F8F8F8;
  302. }
  303. >view {
  304. &:first-child {
  305. flex: 1;
  306. }
  307. }
  308. }
  309. // 订单中商品列表
  310. .bundle-list {
  311. display: flex;
  312. padding: 20upx 10upx;
  313. font-size: 28upx;
  314. border-bottom: 1px solid #F8F8F8;
  315. &:last-child {
  316. border-bottom: none;
  317. }
  318. .img-cont {
  319. width: 160upx;
  320. height: 160upx;
  321. >image {
  322. width: 100%;
  323. height: 100%;
  324. }
  325. }
  326. >view {
  327. &:last-child {
  328. flex: 1;
  329. margin-left: 20upx;
  330. display: flex;
  331. flex-direction: column;
  332. justify-content: space-between;
  333. }
  334. }
  335. .bundle-num {
  336. display: flex;
  337. justify-content: space-between;
  338. }
  339. }
  340. .btn-cont {
  341. width: 180upx;
  342. height: 60upx;
  343. float: right;
  344. background-color: #2979ff;
  345. color: #fff;
  346. text-align: center;
  347. border-radius: 100upx;
  348. font-size: 30upx;
  349. }
  350. .price-text{
  351. font-size: 20upx;
  352. margin-left: 10upx;
  353. }
  354. .price-num{
  355. font-size: 32upx;
  356. color: red;
  357. }
  358. .total-text{
  359. margin-right: 50upx;
  360. }
  361. .money-total{
  362. margin-right: 10upx;
  363. }
  364. }
  365. }
  366. // 物流弹窗
  367. .order-log {
  368. padding: 20upx ;
  369. font-size: 28upx;
  370. >view{
  371. line-height: 60upx;
  372. }
  373. }
  374. }
  375. </style>