RefundList.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div member-order-list">
  3. <view class="div common-header-wrap">
  4. <view class="status-holder"></view>
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="退款列表" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="scroll-view div" style="position:relative">
  14. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
  15. <view class="div order-body" v-if="refund_list && refund_list.length">
  16. <view class="div list" v-for="(item, index) in refund_list" v-bind:key="item.refund_id">
  17. <view class="div" @click="goNavigate('/pages/member/refund/RefundView',{refund_id:item.refund_id})">
  18. <view class="div tips-body">
  19. <text class="span tips"> 退款编号: {{ item.refund_sn }} </text>
  20. <text class="span title tips statusTips" >{{ item.admin_state }}</text>
  21. </view>
  22. <view class="div order-image multiple" v-if="item.goods_list.length > 1">
  23. <view class="div imagebox">
  24. <image mode="aspectFit" class="img" v-for="(image,index) in item.goods_list" :key="index" v-bind:src="image.goods_img_480" />
  25. </view>
  26. </view>
  27. <view class="div order-image" v-else-if="item.goods_list.length == 1">
  28. <view class="div goods_info" v-for="(image,index) in item.goods_list" :key="index">
  29. <view class="div img-wrapper">
  30. <image mode="aspectFit" class="img" v-bind:src="image.goods_img_480" />
  31. </view>
  32. <view class="p goods_name">{{image.goods_name}}</view>
  33. <view class="p goods_price">
  34. <view class="price">¥{{item.refund_amount}}</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="div amount">
  39. 退款金额 : <text class="amount_icon">¥</text><text class="i">{{ item.refund_amount }}</text
  40. >
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <empty-record v-else-if="refund_list && !refund_list.length"></empty-record>
  46. </scroll-view>
  47. </view>
  48. </view></member-base>
  49. </template>
  50. <script>
  51. import {getFontSize} from '@/util/common'
  52. import TitleHeader from '../../TitleHeader'
  53. import { urlencode } from '@/util/common'
  54. import MemberBase from '../MemberBase'
  55. import { getRefundList } from '../../../api/memberRefund'
  56. import EmptyRecord from '../../EmptyRecord'
  57. export default {
  58. components:{
  59. TitleHeader,
  60. MemberBase,
  61. EmptyRecord
  62. },
  63. name:'MemberRefundList',
  64. data(){
  65. return {
  66. navHeight: 0,
  67. params: { 'page': 0, 'per_page': 10 },
  68. loading: false, // 是否加载更多
  69. isMore: true, // 是否有更多
  70. order_id: 0,
  71. stateType: '',
  72. orderDetailVisible: false,
  73. wrapperHeight: 0,
  74. refund_list: false
  75. }
  76. },
  77. mounted(){
  78. // #ifdef MP-WEIXIN
  79. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  80. // #endif
  81. this.wrapperHeight = uni.getSystemInfoSync().windowHeight - 130
  82. },
  83. computed:{
  84. fontSize(){
  85. return getFontSize()
  86. },
  87. },
  88. onShow: function () {
  89. this.reload()
  90. },
  91. methods:{
  92. goNavigate(path,query=false){
  93. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  94. },
  95. goBack(){uni.navigateBack({delta:1})},
  96. loadMore () {
  97. this.loading = true
  98. this.params.page = ++this.params.page
  99. if (this.isMore) {
  100. this.loading = false
  101. this.getRefundList(false)
  102. }
  103. },
  104. reload () {
  105. // 重新加载数据
  106. this.params.page = 0
  107. this.isMore = true
  108. this.refund_list = false
  109. this.loadMore()
  110. },
  111. getRefundList (ifReplace) {
  112. uni.showLoading({ title: '加载中' })
  113. if (ifReplace) {
  114. this.loading = false
  115. this.params.page = 1
  116. this.isMore = true
  117. }
  118. getRefundList(this.params).then(res => {
  119. uni.hideLoading()
  120. if (res.result.hasmore) {
  121. this.isMore = true
  122. } else {
  123. this.isMore = false
  124. }
  125. let tRefundGroup = res.result.refund_list
  126. if (tRefundGroup) {
  127. if (ifReplace || !this.refund_list) {
  128. this.refund_list = tRefundGroup
  129. } else {
  130. this.refund_list = this.refund_list.concat(tRefundGroup)
  131. }
  132. }
  133. }).catch(function (error) {
  134. uni.hideLoading()
  135. uni.showToast({icon:'none',title: error.message})
  136. })
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .scroll-view-wrapper{display: flex;flex-direction: column;}
  143. .scroll-view{flex:1}
  144. .member-order-list {
  145. .order-body {
  146. .list {
  147. width: 100%;
  148. margin-top: 0.5rem;
  149. .tips-body {
  150. height:2.2rem;
  151. background: rgba(255, 255, 255, 1);
  152. box-shadow: 0 0.5px 0 0 rgba(232, 234, 237, 1);
  153. display: flex;
  154. justify-content: space-between;
  155. padding: 0 0.75rem 0 0.5rem;
  156. .tips {
  157. font-size:$subFontSize;
  158. color: #333;
  159. line-height:2.2rem;
  160. }
  161. .statusTips {
  162. color: $primaryColor;
  163. }
  164. .img {
  165. width:3.8rem;
  166. height:3rem;
  167. }
  168. }
  169. .order-image {
  170. height:4.5rem;
  171. background: rgba(250, 250, 250, 1);
  172. width: 100%;
  173. overflow:hidden;
  174. overflow-x: auto;
  175. white-space: nowrap;
  176. .goods_info{
  177. height:4rem;
  178. margin-bottom: .5rem;
  179. display: flex;
  180. align-items: center;
  181. padding-right: $pageSpace;
  182. .img-wrapper{
  183. width: 3rem;
  184. height: 3rem;
  185. margin: .85rem .6rem .5rem .3rem;
  186. .img{
  187. width: 3rem;
  188. height: 3rem;
  189. border-radius: 1px;
  190. }
  191. }
  192. .goods_name{
  193. white-space: normal;
  194. overflow: hidden;
  195. height: 2rem;
  196. width: 10rem;
  197. font-size: .7rem;
  198. }
  199. .goods_price{
  200. margin-left: auto;
  201. padding-right: .75rem;
  202. text-align: right;
  203. .price{
  204. font-size:$subFontSize;
  205. color: rgba(78, 84, 93, 1);
  206. }
  207. }
  208. }
  209. }
  210. .multiple{
  211. .imagebox{
  212. width: 100%;
  213. overflow-x: auto;
  214. white-space: nowrap;
  215. .img{
  216. width: 3rem;
  217. height:3rem;
  218. margin: .85rem .3rem .5rem;
  219. display: inline-block;
  220. }
  221. }
  222. }
  223. .amount {
  224. font-size:$subFontSize;
  225. color: rgba(78, 84, 93, 1);
  226. line-height:2.2rem;
  227. height:2.2rem;
  228. background-color: #fff;
  229. padding: 0 0.75rem 0 0;
  230. border-bottom: 1px solid #e8eaed;
  231. box-sizing: border-box;
  232. text-align: right;
  233. overflow: hidden;
  234. text-overflow: ellipsis;
  235. white-space: nowrap;
  236. .amount_icon{
  237. font-size:$subFontSize;
  238. color: $primaryColor;
  239. }
  240. .i {
  241. font-size:$h2;
  242. color:$primaryColor;
  243. padding-left:0.15rem;
  244. font-style: normal;
  245. &.freight {
  246. color: #333;
  247. font-size:$fontSize;
  248. }
  249. }
  250. }
  251. }
  252. .loading-wrapper {
  253. text-align: center;
  254. .p {
  255. color: #c3c3c3;
  256. font-size:$fontSize;
  257. font-weight: 'Regular';
  258. margin:0.5rem auto;
  259. }
  260. }
  261. }
  262. .mint-popup {
  263. width: 100%;
  264. height:12rem;
  265. }
  266. }
  267. </style>