LogList.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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,index) in list" :key="item.id"
  6. >
  7. <view class="order-log">
  8. <view v-if="!item.expressNum">待发货</view>
  9. <view v-else>
  10. <view>
  11. 快递公司:<text class="address-title">{{item.expressName}}</text>
  12. <u-button v-if="item.expressState=='WAIT_SIGN'"
  13. :custom-style="btnStyle"
  14. @click="handleGet(index)"
  15. type="primary" shape="circle" size="mini" >确认收货</u-button>
  16. </view>
  17. <view>
  18. <text>运单编号:</text>
  19. <text>{{item.expressNum}}</text>
  20. <u-button @click="copyLogNum(item.expressNum)" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
  21. </view>
  22. </view>
  23. </view>
  24. <u-gap height="10" bg-color="#f8f8f8"></u-gap>
  25. <view class="bundle-list" v-for="row in item.orderGoodsList" :key="row.id">
  26. <view class="img-cont">
  27. <image :src="row.goodsImages"></image>
  28. </view>
  29. <view >
  30. <view class="ellipsis-two">{{row.goodsName}}</view>
  31. <view class="bundle-num">
  32. <view ><text class="price-num">{{row.payGold}}</text> <text class="price-text">乐豆</text></view>
  33. <view >X {{row.buyQty}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <u-empty style="padding-top: 10vh;height: auto;" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'"
  39. mode="list"></u-empty>
  40. <view style="padding: 20upx;">
  41. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import { queryOrderExpress, finishOrder } from '@/api/order.js'
  49. export default {
  50. components: {
  51. },
  52. data() {
  53. return {
  54. btnStyle:{
  55. width: '180rpx',
  56. fontSize: '30rpx',
  57. float: 'right'
  58. },
  59. isShow: false, // 是否显示物流弹框
  60. status: 'loadmore',
  61. noDataText: '暂无数据',
  62. list: [],
  63. total: 0,
  64. orderSn: '' // 订单编号
  65. }
  66. },
  67. onLoad(option) {
  68. if(option.orderNo) {
  69. this.orderSn = option.orderNo
  70. this.getRow()
  71. }
  72. },
  73. methods: {
  74. // scroll-view到底部加载更多
  75. onreachBottom() {
  76. if (this.list.length < this.total) {
  77. this.pageNo += 1
  78. this.getRow()
  79. } else {
  80. uni.showToast({
  81. title: '已经到底了',
  82. icon: 'none'
  83. });
  84. this.status = "nomore"
  85. }
  86. },
  87. // 查询列表
  88. getRow() {
  89. this.status = "loading"
  90. queryOrderExpress({orderSn:this.orderSn}).then(res => {
  91. console.log(res,'rrrrrrrr')
  92. if (res.status == 200) {
  93. this.list = res.data || []
  94. } else {
  95. this.list = []
  96. this.total = 0
  97. this.noDataText = res.message
  98. }
  99. this.status = "loadmore"
  100. })
  101. },
  102. // 确认收货
  103. handleGet(index) {
  104. console.log(index,'iiiiiiiiii')
  105. let params = {
  106. "expressNo": this.list[index].expressNo,
  107. "orderNo": this.list[index].orderNo,
  108. }
  109. finishOrder(params).then(res=>{
  110. if(res.status==200) {
  111. uni.$emit('refresh')
  112. uni.showToast({
  113. title:res.message,
  114. icon: 'none'
  115. })
  116. this.getRow()
  117. }
  118. })
  119. },
  120. // 复制运单编号
  121. copyLogNum (logNum) {
  122. // H5 不支持
  123. uni.setClipboardData({
  124. data: logNum,
  125. success: function(res) {
  126. uni.getClipboardData({
  127. success: function(res) {
  128. uni.showToast({
  129. title: '已复制到剪贴板',
  130. icon: 'none'
  131. });
  132. }
  133. });
  134. }
  135. })
  136. },
  137. }
  138. }
  139. </script>
  140. <style lang="scss">
  141. page {
  142. height: 100%;
  143. width: 100%;
  144. background: #F8F8F8;
  145. }
  146. .pagesCons {
  147. height: 100%;
  148. width: 100%;
  149. background: #F8F8F8;
  150. display: flex;
  151. flex-direction: column;
  152. .text-right {
  153. text-align: right;
  154. }
  155. .tab-body {
  156. flex: 1;
  157. display: flex;
  158. flex-direction: column;
  159. .uTabs {
  160. border-bottom: 1px solid #EEEEEE;
  161. box-shadow: 1px 1px 3px #eeeeee;
  162. }
  163. .check-list {
  164. flex: 1;
  165. overflow-y: scroll;
  166. .swiper-item {
  167. width: 100%;
  168. height: 100%;
  169. overflow: hidden;
  170. .scroll-view {
  171. width: 100%;
  172. height: 100%;
  173. overflow: auto;
  174. }
  175. }
  176. }
  177. // 列表样式
  178. .check-order-list {
  179. background: #ffffff;
  180. padding: 10upx 20upx;
  181. margin: 25upx;
  182. border-radius: 6upx;
  183. box-shadow: 1px 1px 3px #EEEEEE;
  184. font-size: 28upx;
  185. .check-row {
  186. display: flex;
  187. align-items: center;
  188. padding: 20upx 10upx;
  189. .icon-xian {
  190. text-align: right;
  191. width: 40upx;
  192. }
  193. &:first-child {
  194. border-bottom: 1px dashed #F8F8F8;
  195. .createDate {
  196. color: #666;
  197. font-size: 26upx;
  198. margin-left: 10upx;
  199. }
  200. }
  201. &:last-child {
  202. border-top: 1px dashed #F8F8F8;
  203. }
  204. >view {
  205. &:first-child {
  206. flex: 1;
  207. }
  208. }
  209. }
  210. // 订单中商品列表
  211. .bundle-list {
  212. display: flex;
  213. padding: 20upx 10upx;
  214. font-size: 28upx;
  215. border-bottom: 1px solid #F8F8F8;
  216. &:last-child {
  217. border-bottom: none;
  218. }
  219. .img-cont {
  220. width: 160upx;
  221. height: 160upx;
  222. >image {
  223. width: 100%;
  224. height: 100%;
  225. }
  226. }
  227. >view {
  228. &:last-child {
  229. flex: 1;
  230. margin-left: 20upx;
  231. padding: 10upx 0upx;
  232. display: flex;
  233. flex-direction: column;
  234. justify-content: space-between;
  235. }
  236. }
  237. .bundle-num {
  238. display: flex;
  239. justify-content: space-between;
  240. }
  241. }
  242. .btn-cont {
  243. width: 180upx;
  244. height: 60upx;
  245. float: right;
  246. // background-color: #2979ff;
  247. // color: #fff;
  248. // text-align: center;
  249. // border-radius: 100upx;
  250. font-size: 30upx;
  251. }
  252. .price-text{
  253. font-size: 20upx;
  254. margin-left: 10upx;
  255. }
  256. .price-num{
  257. font-size: 32upx;
  258. color: red;
  259. }
  260. .total-text{
  261. margin-right: 50upx;
  262. }
  263. .money-total{
  264. margin-right: 10upx;
  265. }
  266. }
  267. }
  268. // 物流弹窗
  269. .order-log {
  270. padding: 20upx ;
  271. font-size: 28upx;
  272. >view{
  273. line-height: 60upx;
  274. }
  275. }
  276. }
  277. </style>