order-list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. <template>
  2. <view class="container mine clearfix">
  3. <view class="tui-header-box first">
  4. <view class="tui-header-search" @click.stop="rDrawer">
  5. <view class="inner">
  6. <text class="iconfont icon-sousuo"></text>
  7. <view class="input">筛选我的订单</view>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="user-section">
  12. <view :class="{'tui-order-list':scrollTop >= 0}" class="clearfix">
  13. <!-- 空白页 -->
  14. <view class="empty-container" v-if="isEmpty">
  15. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AcewRAAEtqt4jZmU397.png"></image>
  16. <text class="error-text">暂无数据^_^</text>
  17. </view>
  18. <!-- 列表 -->
  19. <view v-else class="tui-order-content">
  20. <view class="tui-order-item" v-for="(order,orderIndex) in orderData" :key="orderIndex" @click.stop="detail(order.shopOrderId)">
  21. <view class="order-title">
  22. <view class="order-title-n">
  23. <view class="order-title-name">收货人:{{order.userInfo.receiver}}</view>
  24. <view class="order-title-phone">手机号:{{order.userInfo.mobile}}</view>
  25. </view>
  26. <view class="order-title-t first">
  27. <view class="order-title-num">订单编号:{{ order.shopOrderNo }}</view>
  28. <view class="order-title-tip">结算状态:{{ order.payStatus | payStatusType }}</view>
  29. </view>
  30. <view class="order-title-t">
  31. <view class="order-title-num">下单时间:{{ order.orderTime }}</view>
  32. <view class="order-title-tip">发货状态:<text class="status">{{ order.sendOutStatus | sendOutStatusType }}</text></view>
  33. </view>
  34. </view>
  35. <view class="order-product">
  36. <view class="goods-pros-t clearfix" v-for="(pros,prosIndex) in order.orderProductList" :key="prosIndex">
  37. <view class="pros-product">
  38. <view class="pros-product-img">
  39. <image :src="pros.image" mode=""></image>
  40. </view>
  41. <view class="pros-product-msg">
  42. <view class="name">{{ pros.name }}</view>
  43. <view class="unit">规格:{{ pros.productUnit }}</view>
  44. <view class="price">
  45. <view class="red">¥{{ pros.price | NumFormat}}</view>
  46. <view class="count"><text class="small">X</text> {{ pros.num }}</view>
  47. </view>
  48. <view class="number">
  49. <text>已发货:{{ pros.shipmentsNum }}</text>
  50. <text v-if="order.returnedNum!=null&&order.returnedNum!=0">已退货:{{ pros.actualCancelNum }}</text>
  51. <text v-if="order.returnedNum!=null&&order.returnedNum!=0">取消:{{ pros.actualCancelNum }}</text>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="pros-product-uss">合计:<text class="text">¥{{ pros.totalAmount | NumFormat}}</text></view>
  56. </view>
  57. </view>
  58. <!-- 底部button -->
  59. <order-button ref="orderButton"
  60. :status="order.sendOutStatus"
  61. :orderInfo ="order"
  62. @buttonConfirm="handButtonConfirm">
  63. </order-button>
  64. </view>
  65. <!--加载loadding-->
  66. <tui-loadmore :visible="loadding" :index="3" type="black" />
  67. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText' />
  68. <!--加载loadding-->
  69. </view>
  70. </view>
  71. </view>
  72. <!--右抽屉-->
  73. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  74. <view class="d-container clearfix" :style="{paddingTop:20+'px'}">
  75. <view class="d-label">订单编号:</view>
  76. <view class="d-input">
  77. <input class="input" type="text" value="" v-model="listQuery.shopOrderNo" placeholder="输入订单编号"/>
  78. </view>
  79. <view class="d-label">收货人姓名:</view>
  80. <view class="d-input">
  81. <input class="input" type="text" value="" v-model="listQuery.receiver" placeholder="输入收货人姓名"/>
  82. </view>
  83. <view class="d-label">发货状态:</view>
  84. <view class="d-input">
  85. <picker @change="bindPickerChange($event)" :value="index" :range="StatusArray" range-key="name">
  86. <input class="input" type="text" disabled="false" v-model="showSendOutStatus" value="" placeholder="请选择发货状态"/>
  87. <text class="iconfont icon-xiangyou"></text>
  88. </picker>
  89. </view>
  90. <view class="d-label">结算状态:</view>
  91. <view class="d-input">
  92. <picker @change="bindPickerChange1($event)" :value="index" :range="PayArray" range-key="name">
  93. <input class="input" type="text" disabled="false" v-model="showpayStatus" value="" placeholder="请选择结算状态"/>
  94. <text class="iconfont icon-xiangyou"></text>
  95. </picker>
  96. </view>
  97. <view class="d-input btn">
  98. <view class="d-btn comfrim" @click="handSearchList">确定</view>
  99. <view class="d-btn clear" @click="handSearchClear">重置</view>
  100. </view>
  101. </view>
  102. </tui-drawer>
  103. <!-- 分享弹窗 -->
  104. <share-alert :shopOrderId="btnoRderID"
  105. v-if="isShareModal"
  106. @shareConfirm ='onShareAppMessage'>
  107. </share-alert>
  108. </view>
  109. </template>
  110. <script>
  111. import orderButton from './components/supplierListButton'//底部按钮
  112. import shareAlert from '../components/supplierShareAlert' //分享弹窗
  113. import modalLayer from '@/components/modal-layer'
  114. import empty from '@/components/empty'
  115. import { mapState,mapMutations } from 'vuex'
  116. const defaultListQuery = {
  117. shopId:0,
  118. pageNum: 1,
  119. pageSize: 10,
  120. sendOutStatus: '', // 发货状态
  121. payStatus:'', // 结算状态
  122. shopOrderNo:'', // 订单编号
  123. receiver: '', // 买家名称
  124. }
  125. export default{
  126. components: {
  127. empty,
  128. shareAlert,
  129. orderButton
  130. },
  131. data() {
  132. return{
  133. StatusArray:[
  134. {name:'所有',value:0},
  135. {name:'待发货',value:1},
  136. {name:'部分发货',value:2},
  137. {name:'已发货',value:3},
  138. ],
  139. PayArray:[
  140. {name:'所有',value:0},
  141. {name:'待结算',value:1},
  142. {name:'部分结算',value:2},
  143. {name:'已结算',value:3},
  144. ],
  145. shopId:0,
  146. showSendOutStatus:'',
  147. showpayStatus:'',
  148. CustomBar:this.CustomBar,// 顶部导航栏高度
  149. userID:0,
  150. openId:'',
  151. isShareModal:false,
  152. listQuery:Object.assign({}, defaultListQuery),
  153. orderData: [],
  154. btnoRderID: 0, //点击按钮传入的的订单ID
  155. scrollTop: 0,
  156. deteleType:'',
  157. skeletonShow: true,
  158. isEmpty: false,
  159. isDelete:false,
  160. isModalLayer: false,
  161. loadding: false,
  162. pullUpOn: true,
  163. pullFlag: true,
  164. hasNextPage: false,
  165. navbarHeight:'',
  166. nomoreText: '上拉显示更多',
  167. contentModalText:'',//操作文字提示语句
  168. modal:false,
  169. rightDrawer: false,
  170. OperationType:'',//操作类型
  171. }
  172. },
  173. onLoad(){
  174. },
  175. filters: {
  176. sendOutStatusType(value) {
  177. if (value === null) {
  178. return '未发货'
  179. } else if(value === 1) {
  180. return '待发货'
  181. } else if(value === 2) {
  182. return '部分发货'
  183. } else{
  184. return '已发货'
  185. }
  186. },
  187. payStatusType(value) {
  188. if (value === 1) {
  189. return '待结算'
  190. } else if (value === 2) {
  191. return '部分结算'
  192. } else {
  193. return '已结算'
  194. }
  195. },
  196. NumFormat:function(text) {//处理金额
  197. return Number(text).toFixed(2)
  198. },
  199. },
  200. computed: {
  201. ...mapState(['hasLogin','userInfo'])
  202. },
  203. methods:{
  204. getOrderDatainit(index){
  205. this.listQuery.pageNum = 1
  206. this.ShopService.GetSupplierMyOrderList(this.listQuery).then(response =>{
  207. let data = response.data
  208. this.hasNextPage = data.hasNextPage
  209. if(data.list && data.list.length > 0){
  210. this.isEmpty = false
  211. this.orderData = [...data.list]
  212. if(hasNextPage){
  213. this.pullUpOn = false
  214. this.nomoreText = '上拉显示更多'
  215. }else{
  216. if(this.orderData.length < 5){
  217. this.pullUpOn = true
  218. }else{
  219. this.pullUpOn = false
  220. this.nomoreText = '已至底部'
  221. }
  222. }
  223. }else{
  224. this.isEmpty = true
  225. }
  226. }).catch(error =>{
  227. this.$util.msg(error.msg,2000)
  228. })
  229. },
  230. getOnReachBottomData(index){//上拉加载
  231. this.listQuery.pageNum += 1
  232. this.ShopService.GetSupplierMyOrderList(this.listQuery).then(response =>{
  233. let data = response.data
  234. this.hasNextPage = data.hasNextPage
  235. this.orderData = this.orderData.concat(data.list)
  236. this.pullFlag = false// 防上拉暴滑
  237. setTimeout(()=>{this.pullFlag = true},500)
  238. if(this.total > this.orderData.length){
  239. this.pullUpOn = false
  240. this.nomoreText = '上拉显示更多'
  241. }else{
  242. this.loadding = false
  243. this.pullUpOn = false
  244. this.nomoreText = '已至底部'
  245. }
  246. })
  247. },
  248. detail(shopOrderId) {//订单详情跳转
  249. this.isModalLayer = true
  250. this.$api.navigateTo(`/pages/supplier/order/order-details?shopOrderId=${shopOrderId}`)
  251. },
  252. handButtonConfirm(data) {//获取点击
  253. console.log(data)
  254. this.btnoRderID = data.orderInfo.shopOrderId
  255. console.log(this.btnoRderID )
  256. this.OperationType = data.type
  257. this.handShowAlert(data)
  258. },
  259. handShowAlert(data){//判断点击的按钮类型并执行...
  260. switch(data.type){
  261. case 'record':
  262. this.$api.navigateTo('/pages/supplier/deliver/deliver-record?shopOrderId='+this.btnoRderID)
  263. break
  264. case 'deliver':
  265. this.$api.navigateTo('/pages/supplier/deliver/deliver-goods?shopOrderId='+this.btnoRderID)
  266. break
  267. }
  268. },
  269. rDrawer() {//弹出抽屉
  270. this.rightDrawer = true
  271. },
  272. closeDrawer(e) {//关闭抽屉
  273. this.leftDrawer = false
  274. this.rightDrawer = false
  275. },
  276. bindPickerChange: function(e) {//选择结算状态筛选
  277. this.showSendOutStatus = this.StatusArray[e.target.value].name
  278. this.listQuery.sendOutStatus = this.StatusArray[e.target.value].value
  279. },
  280. bindPickerChange1: function(e) {//选择发货状态筛选
  281. this.showpayStatus = this.PayArray[e.target.value].name
  282. this.listQuery.payStatus = this.PayArray[e.target.value].value
  283. },
  284. handSearchList(){//搜索
  285. this.getOrderDatainit()
  286. this.leftDrawer = false
  287. this.rightDrawer = false
  288. },
  289. handSearchClear(){//重置搜索条件
  290. this.listQuery = Object.assign({}, defaultListQuery)
  291. this.listQuery.shopId = this.shopId
  292. this.showSendOutStatus=''
  293. this.showpayStatus=''
  294. },
  295. },
  296. onShareAppMessage(res){//分享转发
  297. this.isShareModal = false
  298. if (res.from === 'button') {
  299. // 来自页面内转发按钮
  300. }
  301. return {
  302. title: '您有订单待处理,请点击查看~',
  303. path: `/pages/supplier/login/share-info?authority=3&shopOrderId=${this.btnoRderID}`,
  304. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  305. }
  306. },
  307. onReachBottom() {
  308. if(this.hasNextPage){
  309. this.loadding = true
  310. this.pullUpOn = true
  311. this.getOnReachBottomData()
  312. }
  313. },
  314. onPullDownRefresh() {
  315. setTimeout(() => {
  316. this.listQuery.pageNum = 1
  317. this.listQuery.payStatus=''
  318. this.listQuery.showSendOutStatus=''
  319. this.getOrderDatainit()
  320. uni.stopPullDownRefresh()
  321. }, 200)
  322. },
  323. onShow(){
  324. this.$api.getComStorage('userInfo').then((resolve) =>{
  325. this.listQuery.shopId = this.shopId = resolve.shopId
  326. this.getOrderDatainit()
  327. })
  328. }
  329. }
  330. </script>
  331. <style lang="scss">
  332. @import "@/uni.scss";
  333. page{
  334. background:#F7F7F7;
  335. }
  336. .d-container {
  337. width: 560rpx;
  338. padding: 80rpx 30rpx;
  339. .d-title{
  340. width: 100%;
  341. height:80rpx;
  342. line-height: 80rpx;
  343. text-align: center;
  344. color: #4688fa;
  345. font-size: $font-size-32;
  346. float: left;
  347. }
  348. .d-time{
  349. width: 100%;
  350. height: 70rpx;
  351. float: left;
  352. box-sizing: border-box;
  353. padding: 0 10rpx;
  354. border: 1px solid rgba(0,0,0,0.2);
  355. border-radius: 4rpx;
  356. margin-bottom: 30rpx;
  357. .iconfont{
  358. width:70rpx;
  359. height: 60rpx;
  360. display: block;
  361. float: left;
  362. font-size: 50rpx;
  363. color: #666666;
  364. line-height: 70rpx;
  365. text-align: left;
  366. }
  367. .input{
  368. width: 220rpx;
  369. height: 70rpx;
  370. line-height: 70rpx;
  371. float: left;
  372. box-sizing: border-box;
  373. font-size: $font-size-24;
  374. color: #333333;
  375. padding: 0 10rpx;
  376. }
  377. }
  378. .d-label{
  379. width: 100%;
  380. height: 44rpx;
  381. line-height: 44rpx;
  382. text-align: left;
  383. color: #666666;
  384. font-size: $font-size-26;
  385. float: left;
  386. }
  387. .d-input{
  388. width: 100%;
  389. height: 70rpx;
  390. float: left;
  391. box-sizing: border-box;
  392. padding: 0 10rpx;
  393. border: 1px solid rgba(0,0,0,0.2);
  394. border-radius: 4rpx;
  395. margin-bottom: 30rpx;
  396. position: relative;
  397. &.btn{
  398. border: none;
  399. margin-top: 40rpx;
  400. }
  401. .input{
  402. width: 100%;
  403. height: 70rpx;
  404. line-height: 70rpx;
  405. float: left;
  406. box-sizing: border-box;
  407. font-size: $font-size-24;
  408. color: #333333;
  409. padding: 0 10rpx;
  410. padding-right: 68rpx;
  411. }
  412. .iconfont{
  413. width: 50rpx;
  414. height: 68rpx;
  415. display: block;
  416. line-height: 68rpx;
  417. text-align: center;
  418. font-size: 30rpx;
  419. color: #999999;
  420. position: absolute;
  421. right: 0;
  422. top: 0;
  423. }
  424. .d-btn{
  425. width: 210rpx;
  426. height: 84rpx;
  427. border-radius: 42rpx;
  428. background: $btn-confirm;
  429. line-height: 84rpx;
  430. text-align: center;
  431. font-size: $font-size-26;
  432. color: #FFFFFF;
  433. float: right;
  434. &.comfrim{
  435. background: $btn-confirm;
  436. margin-left: 20rpx;
  437. }
  438. &.clear{
  439. background: #e1e1e1;
  440. }
  441. }
  442. }
  443. }
  444. .tui-header-box {
  445. width: 100%;
  446. height: 84rpx;
  447. box-sizing: border-box;
  448. padding:10rpx 24rpx;
  449. display: flex;
  450. align-items: center;
  451. position: fixed;
  452. top: 0;
  453. left: 0;
  454. z-index: 999;
  455. background-color: #FFFFFF;
  456. .tui-header-search{
  457. width: 100%;
  458. height: 100%;
  459. background: #F7F7F7;
  460. border-radius: 32rpx;
  461. position: relative;
  462. .inner{
  463. width: 210rpx;
  464. margin: 0 auto;
  465. .icon-sousuo{
  466. width: 64rpx;
  467. height: 64rpx;
  468. line-height: 64rpx;
  469. text-align: center;
  470. display: block;
  471. font-size: $font-size-38;
  472. float: left;
  473. color: #999999;
  474. }
  475. .input{
  476. height: 64rpx;
  477. float: left;
  478. line-height: 64rpx;
  479. color: #999999;
  480. font-size: $font-size-24;
  481. }
  482. }
  483. }
  484. }
  485. .tui-header {
  486. width: 100%;
  487. font-size: 16px;
  488. font-weight: 500;
  489. height: 32px;
  490. display: flex;
  491. align-items: center;
  492. justify-content: center;
  493. position: relative;
  494. padding: 0 40rpx;
  495. }
  496. .user-section{
  497. width: 100%;
  498. padding-top: 94rpx;
  499. }
  500. .tui-order-content{
  501. width: 100%;
  502. height: auto;
  503. }
  504. .tui-order-list {
  505. width: 100%;
  506. position: relative;
  507. }
  508. .tui-order-item {
  509. display: flex;
  510. flex-direction: column;
  511. width: 100%;
  512. padding:20rpx 24rpx 0 24rpx;
  513. background: #fff;
  514. border-bottom: 20rpx solid #F7F7F7;
  515. box-sizing: border-box;
  516. }
  517. .order-title{
  518. width: 100%;
  519. height: auto;
  520. .order-title-n{
  521. width: 100%;
  522. height: 70rpx;
  523. float: left;
  524. font-size: $font-size-28;
  525. line-height: 70rpx;
  526. border-bottom: 1px solid #e1e1e1;
  527. .order-title-name{
  528. float: left;
  529. text-align: left;
  530. color: $text-color;
  531. }
  532. .order-title-phone{
  533. float: right;
  534. text-align: right;
  535. font-size: $font-size-28;
  536. color: $text-color;
  537. }
  538. }
  539. .order-title-t{
  540. width: 100%;
  541. height: 50rpx;
  542. float: left;
  543. font-size: $font-size-28;
  544. line-height: 50rpx;
  545. &.first{
  546. padding-top: 20rpx;
  547. }
  548. .order-title-num{
  549. float: left;
  550. text-align: left;
  551. color: #666666;
  552. }
  553. .order-title-tip{
  554. float: right;
  555. text-align: right;
  556. font-size: $font-size-28;
  557. color: #666666;
  558. .status{
  559. color: $color-system;
  560. }
  561. }
  562. }
  563. .order-title-b{
  564. width: 100%;
  565. height: 40rpx;
  566. float: left;
  567. margin-top: 8rpx;
  568. font-size: $font-size-28;
  569. line-height: 40rpx;
  570. color: #999999;
  571. text-align: left;
  572. }
  573. }
  574. .order-product{
  575. width: 100%;
  576. height: auto;
  577. float: left;
  578. margin-top: 15rpx;
  579. .goods-pros-t{
  580. width: 100%;
  581. height: auto;
  582. padding: 15rpx 0;
  583. border-bottom: 1px solid #e1e1e1;
  584. .pros-product{
  585. width: 100%;
  586. height: 184rpx;
  587. float: left;
  588. .pros-product-img{
  589. width: 182rpx;
  590. height: 182rpx;
  591. border:1px solid #e1e1e1;
  592. border-radius: 6rpx;
  593. float: left;
  594. margin-right: 17rpx;
  595. image{
  596. width: 182rpx;
  597. height: 182rpx;
  598. display: block;
  599. border-radius: 6rpx;
  600. }
  601. }
  602. .pros-product-msg{
  603. width: 500rpx;
  604. height: 184rpx;
  605. float: left;
  606. .name{
  607. width: 100%;
  608. height: auto;
  609. float: left;
  610. font-size: $font-size-28;
  611. line-height: 38rpx;
  612. color: $text-color;
  613. text-align: left;
  614. white-space: normal;
  615. word-break: break-all;
  616. overflow: hidden;
  617. text-overflow: ellipsis;
  618. display: -webkit-box;
  619. -webkit-box-orient: vertical;
  620. -webkit-line-clamp: 2;
  621. }
  622. .unit{
  623. width: 100%;
  624. float: left;
  625. height: 38rpx;
  626. font-size: $font-size-22;
  627. color: #999999;
  628. line-height: 38rpx;
  629. }
  630. .price{
  631. width: 100%;
  632. float: left;
  633. height: 38rpx;
  634. font-size: $font-size-28;
  635. color: #666666;
  636. line-height: 38rpx;
  637. .red{
  638. color: #f94b4b;
  639. float: left;
  640. font-weight: bold;
  641. }
  642. .count{
  643. float: right;
  644. .small{
  645. font-size: $font-size-20;
  646. }
  647. }
  648. }
  649. .number{
  650. width: 100%;
  651. float: left;
  652. height: 38rpx;
  653. font-size: $font-size-24;
  654. color: #999999;
  655. line-height: 38rpx;
  656. text{
  657. margin-right: 30rpx;
  658. }
  659. }
  660. }
  661. }
  662. .pros-product-uss{
  663. width: 100%;
  664. float: left;
  665. height: 44rpx;
  666. font-size: $font-size-28;
  667. color: #999999;
  668. line-height: 44rpx;
  669. text-align: right;
  670. font-weight: bold;
  671. text{
  672. color: #f94b4b;
  673. margin-left: 10rpx;
  674. }
  675. }
  676. }
  677. }
  678. .order-footer{
  679. width: 100%;
  680. height: 78rpx;
  681. float: left;
  682. border-bottom: 1px solid #EFEFEF;
  683. .order-footer-top{
  684. width: 100%;
  685. height: 34rpx;
  686. line-height: 34rpx;
  687. font-size: $font-size-24;
  688. color: #999999;
  689. text-align: right;
  690. }
  691. .order-footer-bot{
  692. width: 100%;
  693. float: left;
  694. height: 48rpx;
  695. line-height: 48rpx;
  696. font-size: $font-size-28;
  697. color: #999999;
  698. .name{
  699. width: 50%;
  700. float: left;
  701. text-align: left;
  702. }
  703. .money{
  704. width: 50%;
  705. float: right;
  706. text-align: right;
  707. .txt{
  708. color: #FF5000;
  709. }
  710. }
  711. }
  712. }
  713. </style>