LogList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. >
  7. <view class="order-log">
  8. <view v-if="item.orderFlag=='待发货'">待发货</view>
  9. <view v-else>
  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(option) {
  82. if(option.id) {
  83. this.getRow(option.id)
  84. }
  85. },
  86. methods: {
  87. // scroll-view到底部加载更多
  88. onreachBottom() {
  89. this.action = 'onreachBottom'
  90. if (this.list.length < this.total) {
  91. this.pageNo += 1
  92. this.getRow()
  93. } else {
  94. uni.showToast({
  95. title: '已经到底了',
  96. icon: 'none'
  97. });
  98. this.status = "nomore"
  99. }
  100. },
  101. // 查询列表
  102. getRow(id) {
  103. this.status = "loadmore"
  104. this.list = [{
  105. createDate: "2020-10-28 11:15:59",
  106. orderFlag: "待支付",
  107. payedAmount: 0,
  108. id: 11,
  109. amount: 450,
  110. totalNum: 3,
  111. logName: '韵达快递',
  112. logNum: '12454545485',
  113. itemList: [
  114. {
  115. name: "八九箭冠",
  116. id: 76435,
  117. number: 1,
  118. price: 150,
  119. icon: ''
  120. },
  121. {
  122. name: "数据库的合法身份觉得很附近发生纠纷解决",
  123. id: 76436,
  124. number: 2,
  125. price: 150,
  126. icon: ''
  127. }
  128. ]
  129. },
  130. {
  131. createDate: "2020-10-28 11:15:59",
  132. orderFlag: "待支付",
  133. payedAmount: 0,
  134. id: 12,
  135. amount: 450,
  136. totalNum: 3,
  137. logName: '韵达快递',
  138. logNum: '12454545485',
  139. itemList: [
  140. {
  141. name: "八九箭冠",
  142. id: 76435,
  143. number: 1,
  144. price: 150,
  145. icon: ''
  146. },
  147. {
  148. name: "数据库的合法身份觉得很附近发生纠纷解决",
  149. id: 76436,
  150. number: 2,
  151. price: 150,
  152. icon: ''
  153. }
  154. ]
  155. }]
  156. return
  157. this.status = "loading"
  158. queryOrderExpress({id:id}).then(res => {
  159. console.log(res,'rrrrrrrr')
  160. if (res.status == 200) {
  161. this.list = res.data.list || []
  162. } else {
  163. this.list = []
  164. this.total = 0
  165. this.noDataText = res.message
  166. }
  167. this.status = "loadmore"
  168. })
  169. },
  170. // 复制运单编号
  171. copyLogNum () {
  172. // H5 不支持
  173. uni.setClipboardData({
  174. data: this.logData.logNum,
  175. success: function(res) {
  176. uni.getClipboardData({
  177. success: function(res) {
  178. uni.showToast({
  179. title: '已复制到剪贴板'
  180. });
  181. }
  182. });
  183. }
  184. })
  185. },
  186. }
  187. }
  188. </script>
  189. <style lang="scss">
  190. page {
  191. height: 100%;
  192. width: 100%;
  193. background: #F8F8F8;
  194. }
  195. .pagesCons {
  196. height: 100%;
  197. width: 100%;
  198. background: #F8F8F8;
  199. display: flex;
  200. flex-direction: column;
  201. .text-right {
  202. text-align: right;
  203. }
  204. .tab-body {
  205. flex: 1;
  206. display: flex;
  207. flex-direction: column;
  208. .uTabs {
  209. border-bottom: 1px solid #EEEEEE;
  210. box-shadow: 1px 1px 3px #eeeeee;
  211. }
  212. .check-list {
  213. flex: 1;
  214. overflow-y: scroll;
  215. .swiper-item {
  216. width: 100%;
  217. height: 100%;
  218. overflow: hidden;
  219. .scroll-view {
  220. width: 100%;
  221. height: 100%;
  222. overflow: auto;
  223. }
  224. }
  225. }
  226. // 列表样式
  227. .check-order-list {
  228. background: #ffffff;
  229. padding: 10upx 20upx;
  230. margin: 25upx;
  231. border-radius: 6upx;
  232. box-shadow: 1px 1px 3px #EEEEEE;
  233. font-size: 28upx;
  234. .check-row {
  235. display: flex;
  236. align-items: center;
  237. padding: 20upx 10upx;
  238. .icon-xian {
  239. text-align: right;
  240. width: 40upx;
  241. }
  242. &:first-child {
  243. border-bottom: 1px dashed #F8F8F8;
  244. .createDate {
  245. color: #666;
  246. font-size: 26upx;
  247. margin-left: 10upx;
  248. }
  249. }
  250. &:last-child {
  251. border-top: 1px dashed #F8F8F8;
  252. }
  253. >view {
  254. &:first-child {
  255. flex: 1;
  256. }
  257. }
  258. }
  259. // 订单中商品列表
  260. .bundle-list {
  261. display: flex;
  262. padding: 20upx 10upx;
  263. font-size: 28upx;
  264. border-bottom: 1px solid #F8F8F8;
  265. &:last-child {
  266. border-bottom: none;
  267. }
  268. .img-cont {
  269. width: 160upx;
  270. height: 160upx;
  271. >image {
  272. width: 100%;
  273. height: 100%;
  274. }
  275. }
  276. >view {
  277. &:last-child {
  278. flex: 1;
  279. margin-left: 20upx;
  280. display: flex;
  281. flex-direction: column;
  282. justify-content: space-between;
  283. }
  284. }
  285. .bundle-num {
  286. display: flex;
  287. justify-content: space-between;
  288. }
  289. }
  290. .btn-cont {
  291. width: 180upx;
  292. height: 60upx;
  293. float: right;
  294. background-color: #2979ff;
  295. color: #fff;
  296. text-align: center;
  297. border-radius: 100upx;
  298. font-size: 30upx;
  299. }
  300. .price-text{
  301. font-size: 20upx;
  302. margin-left: 10upx;
  303. }
  304. .price-num{
  305. font-size: 32upx;
  306. color: red;
  307. }
  308. .total-text{
  309. margin-right: 50upx;
  310. }
  311. .money-total{
  312. margin-right: 10upx;
  313. }
  314. }
  315. }
  316. // 物流弹窗
  317. .order-log {
  318. padding: 20upx ;
  319. font-size: 28upx;
  320. >view{
  321. line-height: 60upx;
  322. }
  323. }
  324. }
  325. </style>