LogList.vue 6.3 KB

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