order-history.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="container history clearfix">
  3. <view class="history-main">
  4. <view v-if="isEmpty" class="empty-container">
  5. <image class="club-empty-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AJZvwAAGWWe4DnXk371.png" mode="aspectFit"></image>
  6. <view class="txt">暂无订单数据</view>
  7. </view>
  8. <view v-else class="history-list">
  9. <scroll-view scroll-y="true" >
  10. <view class="list" v-for="(item, index) in historyList" :key="index">
  11. <view class="list-left">
  12. <view class="list-p">订单号:<text class="txt">{{item.orderNo}}</text><text v-if="item.orderSubmitType == 3" class="tag">协销</text></view>
  13. <view class="list-p">总金额:<text class="txt">¥{{orderPriceToFixed(item.payTotalFee)}}</text></view>
  14. <view class="list-p">数量(赠):<text class="txt">{{item.productCount}}({{item.presentCount}})</text></view>
  15. </view>
  16. <view class="list-opea">
  17. <view class="opea-p">{{orderStateExp(item.status)}}</view>
  18. <view class="opea-type-dell" @click.stop="orderDetiles(item.orderID)">
  19. <text>查看详情</text>
  20. </view>
  21. </view>
  22. </view>
  23. <!--加载loadding-->
  24. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  25. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
  26. <!--加载loadding-->
  27. </scroll-view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import authorize from '@/common/config/authorize.js'
  34. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  35. import tuiNomore from "@/components/tui-components/nomore/nomore"
  36. export default {
  37. components:{
  38. tuiLoadmore,
  39. tuiNomore,
  40. },
  41. data() {
  42. return {
  43. clubID:'',
  44. serviceProviderId:'',
  45. isEmpty:false,
  46. nomoreText: '上拉显示更多',
  47. pageNum:1,
  48. pageSize:10,
  49. hasNextPage:false,
  50. loadding: false,
  51. pullUpOn: true,
  52. pullFlag: true,
  53. allowDataStatus:true,
  54. wrapperHeight:'100%',
  55. scrollHeight:'',
  56. deleteAddressId:'',
  57. currPage:'',//当前页面
  58. prevPage:'',//上一个页面
  59. tabCurrentIndex:0,
  60. historyList:[],
  61. }
  62. },
  63. onLoad(option){
  64. this.clubID = option.clubID
  65. },
  66. methods: {
  67. inithistoryList(){
  68. this.$api.getComStorage('orderUserInfo').then((resolve) =>{
  69. let params = {clubID:resolve.clubID,serviceProviderId:this.serviceProviderId,pageNum:1,pageSize:this.pageSize};
  70. this.SellerService.GetSellerClubOrderList(params).then(response =>{
  71. let responseData = response.data
  72. if(responseData.results&&responseData.results.length > 0){
  73. this.isEmpty = false
  74. this.hasNextPage = response.data.hasNextPage
  75. this.historyList =responseData.results
  76. this.pullFlag = false;
  77. setTimeout(()=>{this.pullFlag = true;},500)
  78. if(this.hasNextPage){
  79. this.pullUpOn = false
  80. this.nomoreText = '上拉显示更多'
  81. }else{
  82. this.pullUpOn = true
  83. this.loadding = false
  84. this.nomoreText = '已至底部'
  85. }
  86. }else{
  87. this.isEmpty = true
  88. }
  89. }).catch(error =>{
  90. this.$util.msg(error.msg,2000)
  91. })
  92. })
  93. },
  94. getOnReachBottomData(){
  95. this.pageNum+=1
  96. this.$api.getComStorage('orderUserInfo').then((resolve) =>{
  97. let params = {clubID:resolve.clubID,serviceProviderId:this.serviceProviderId,pageNum:this.pageNum,pageSize:this.pageSize};
  98. this.SellerService.GetSellerClubOrderList(params).then(response =>{
  99. let responseData = response.data
  100. if(responseData.results&&responseData.results.length > 0){
  101. this.hasNextPage = response.data.hasNextPage
  102. this.historyList = this.historyList.concat(responseData.results)
  103. this.pullFlag = false;// 防上拉暴滑
  104. setTimeout(()=>{this.pullFlag = true;},500)
  105. if(this.hasNextPage){
  106. this.pullUpOn = false
  107. this.nomoreText = '上拉显示更多'
  108. }else{
  109. this.pullUpOn = false
  110. this.loadding = false
  111. this.nomoreText = '已至底部'
  112. }
  113. }
  114. }).catch(error =>{
  115. this.$util.msg(error.msg,2000)
  116. })
  117. })
  118. },
  119. orderPriceToFixed (n){
  120. let price ='';
  121. price = n.toFixed(2);
  122. return price
  123. },
  124. //订单状态文字和颜色
  125. orderStateExp (state){
  126. let stateText = '',
  127. stateTextObject={
  128. 0:'待确认',
  129. 4:'交易完成',
  130. 5:'订单完成',
  131. 6:'已关闭',
  132. 7:'交易全退',
  133. 77:'交易全退',
  134. 11:'待付款待发货',
  135. 12:'待付款部分发货',
  136. 13:'待付款已发货',
  137. 21:'部分付款待发货',
  138. 22:'部分付款部分发货',
  139. 23:'部分付款已发货',
  140. 31:'已付款待发货',
  141. 32:'已付款部分发货',
  142. 33:'已付款已发货',
  143. 111:'待付款待发货',
  144. }
  145. Object.keys(stateTextObject).forEach(key => {
  146. if(key == state){
  147. stateText = stateTextObject[key]
  148. }
  149. })
  150. return stateText;
  151. },
  152. orderDetiles(id){
  153. this.$api.navigateTo(`/seller/pages/order/order-details?type=confim&orderID=${id}`)
  154. }
  155. },
  156. onReachBottom() {
  157. if(this.hasNextPage){
  158. this.loadding = true
  159. this.pullUpOn = true
  160. this.getOnReachBottomData()
  161. }
  162. },
  163. onShow() {
  164. this.$api.getStorage().then((resolve) =>{
  165. this.serviceProviderId = resolve.serviceProviderID
  166. this.pageNum = 1;
  167. this.inithistoryList();
  168. })
  169. }
  170. }
  171. </script>
  172. <style lang='scss'>
  173. page {
  174. height: auto;
  175. }
  176. page,.container{
  177. /* padding-bottom: 120upx; */
  178. background: #F7F7F7;
  179. border-top: 1px solid #EBEBEB;
  180. }
  181. .container{
  182. position: relative;
  183. }
  184. .history-main{
  185. .list{
  186. display: flex;
  187. align-items: center;
  188. width: 702rpx;
  189. height: auto;
  190. padding: 24rpx;
  191. background: #FFFFFF;
  192. position: relative;
  193. border-bottom: 1px solid #EBEBEB;
  194. .list-left{
  195. flex: 7;
  196. .list-p{
  197. line-height: 58rpx;
  198. font-size: $font-size-26;
  199. color: $text-color;
  200. text-align: left;
  201. .txt{
  202. margin-left: 20rpx;
  203. }
  204. .tag{
  205. display: inline-block;
  206. width: 60rpx;
  207. height: 28rpx;
  208. line-height: 28rpx;
  209. font-size: $font-size-20;
  210. color: #FFFFFF;
  211. background: $btn-confirm;
  212. text-align: center;
  213. border-radius: 14rpx;
  214. margin-left: 20rpx;
  215. }
  216. }
  217. }
  218. .list-opea{
  219. flex: 3;
  220. color: #166CE1;
  221. align-items: center;
  222. display: flex;
  223. flex-direction: column;
  224. .opea-p{
  225. line-height: 70rpx;
  226. font-size: $font-size-24;
  227. color: #E11616;
  228. text-align: right;
  229. }
  230. .opea-type-dell{
  231. width: 160rpx;
  232. height: 68rpx;
  233. line-height: 68rpx;
  234. font-size: $font-size-24;
  235. text-align: center;
  236. color: #FFFFFF;
  237. border-radius: 10rpx;
  238. background: #166CE1;
  239. margin-top: 24rpx;
  240. }
  241. }
  242. }
  243. }
  244. </style>