LogList.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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 = "loading"
  104. queryOrderExpress({id:id}).then(res => {
  105. console.log(res,'rrrrrrrr')
  106. if (res.status == 200) {
  107. this.list = res.data || []
  108. } else {
  109. this.list = []
  110. this.total = 0
  111. this.noDataText = res.message
  112. }
  113. this.status = "loadmore"
  114. })
  115. },
  116. // 复制运单编号
  117. copyLogNum () {
  118. // H5 不支持
  119. uni.setClipboardData({
  120. data: this.logData.logNum,
  121. success: function(res) {
  122. uni.getClipboardData({
  123. success: function(res) {
  124. uni.showToast({
  125. title: '已复制到剪贴板'
  126. });
  127. }
  128. });
  129. }
  130. })
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. page {
  137. height: 100%;
  138. width: 100%;
  139. background: #F8F8F8;
  140. }
  141. .pagesCons {
  142. height: 100%;
  143. width: 100%;
  144. background: #F8F8F8;
  145. display: flex;
  146. flex-direction: column;
  147. .text-right {
  148. text-align: right;
  149. }
  150. .tab-body {
  151. flex: 1;
  152. display: flex;
  153. flex-direction: column;
  154. .uTabs {
  155. border-bottom: 1px solid #EEEEEE;
  156. box-shadow: 1px 1px 3px #eeeeee;
  157. }
  158. .check-list {
  159. flex: 1;
  160. overflow-y: scroll;
  161. .swiper-item {
  162. width: 100%;
  163. height: 100%;
  164. overflow: hidden;
  165. .scroll-view {
  166. width: 100%;
  167. height: 100%;
  168. overflow: auto;
  169. }
  170. }
  171. }
  172. // 列表样式
  173. .check-order-list {
  174. background: #ffffff;
  175. padding: 10upx 20upx;
  176. margin: 25upx;
  177. border-radius: 6upx;
  178. box-shadow: 1px 1px 3px #EEEEEE;
  179. font-size: 28upx;
  180. .check-row {
  181. display: flex;
  182. align-items: center;
  183. padding: 20upx 10upx;
  184. .icon-xian {
  185. text-align: right;
  186. width: 40upx;
  187. }
  188. &:first-child {
  189. border-bottom: 1px dashed #F8F8F8;
  190. .createDate {
  191. color: #666;
  192. font-size: 26upx;
  193. margin-left: 10upx;
  194. }
  195. }
  196. &:last-child {
  197. border-top: 1px dashed #F8F8F8;
  198. }
  199. >view {
  200. &:first-child {
  201. flex: 1;
  202. }
  203. }
  204. }
  205. // 订单中商品列表
  206. .bundle-list {
  207. display: flex;
  208. padding: 20upx 10upx;
  209. font-size: 28upx;
  210. border-bottom: 1px solid #F8F8F8;
  211. &:last-child {
  212. border-bottom: none;
  213. }
  214. .img-cont {
  215. width: 160upx;
  216. height: 160upx;
  217. >image {
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. >view {
  223. &:last-child {
  224. flex: 1;
  225. margin-left: 20upx;
  226. display: flex;
  227. flex-direction: column;
  228. justify-content: space-between;
  229. }
  230. }
  231. .bundle-num {
  232. display: flex;
  233. justify-content: space-between;
  234. }
  235. }
  236. .btn-cont {
  237. width: 180upx;
  238. height: 60upx;
  239. float: right;
  240. background-color: #2979ff;
  241. color: #fff;
  242. text-align: center;
  243. border-radius: 100upx;
  244. font-size: 30upx;
  245. }
  246. .price-text{
  247. font-size: 20upx;
  248. margin-left: 10upx;
  249. }
  250. .price-num{
  251. font-size: 32upx;
  252. color: red;
  253. }
  254. .total-text{
  255. margin-right: 50upx;
  256. }
  257. .money-total{
  258. margin-right: 10upx;
  259. }
  260. }
  261. }
  262. // 物流弹窗
  263. .order-log {
  264. padding: 20upx ;
  265. font-size: 28upx;
  266. >view{
  267. line-height: 60upx;
  268. }
  269. }
  270. }
  271. </style>