RefundList.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <seller-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="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" :key="item.refund_id">
  17. <view class="div" @click="goNavigate('/pages/seller/refund/RefundView',{refund_id:item.refund_id})">
  18. <view class="div tips-body">
  19. <text class="span tips"> 申请时间: {{ $moment.unix(item.add_time).format('YYYY年MM月DD日') }} </text>
  20. <text class="span title tips statusTips" >
  21. 店铺{{ item.seller_state_text }},平台{{ item.refund_state_text }}
  22. </text>
  23. </view>
  24. <view class="div order-image multiple" v-if="item.goods_list.length > 1">
  25. <view class="div imagebox">
  26. <image mode="aspectFit" class="img" v-for="(image,index) in item.goods_list" :key="index" :src="image.goods_img_480" />
  27. </view>
  28. </view>
  29. <view class="div order-image" v-else-if="item.goods_list.length == 1">
  30. <view class="div goods_info" v-for="(image,index) in item.goods_list" :key="index">
  31. <view class="div img-wrapper">
  32. <image mode="aspectFit" class="img" :src="image.goods_img_480" />
  33. </view>
  34. <view class="p goods_name">{{image.goods_name}}</view>
  35. <view class="p goods_price">
  36. <view class="price">¥{{item.refund_amount}}</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="div amount">
  41. 退款金额 : <text class="amount_icon">¥</text><text class="i">{{ item.refund_amount }}</text
  42. >
  43. </view>
  44. </view>
  45. <view class="div order-list-opratio">
  46. <!-- 锁定-->
  47. <text class="button" v-if="item.seller_state == 1" @click="goNavigate('/pages/seller/refund/RefundForm',{refund_id:item.refund_id,refund_type,refund_type})">处理</text>
  48. <text class="button" v-if="item.seller_state == 2 && item.return_type == 2 && item.goods_state == 2" @click="receive(item.refund_id)">已收货</text>
  49. <text class="button" v-if="item.seller_state == 2 && item.return_type == 2 && item.goods_state == 2 && item.delay_time>0" @click="unreceive(item.refund_id)">未收货</text>
  50. <text class="button" v-if="item.invoice_no && item.express_id>0" @click="goNavigate('/pages/seller/refund/RefundDeliver',{refund_id:item.refund_id})">物流跟踪</text>
  51. </view>
  52. </view>
  53. </view>
  54. <empty-record v-if="refund_list && !refund_list.length"></empty-record>
  55. </scroll-view>
  56. </view>
  57. </view>
  58. <uni-popup background-color="#fff" ref="confirm" type="dialog">
  59. <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
  60. </uni-popup>
  61. </seller-base>
  62. </template>
  63. <script>
  64. import {getFontSize} from '@/util/common'
  65. import TitleHeader from '../../TitleHeader'
  66. import { urlencode } from '@/util/common'
  67. import SellerBase from '../SellerBase'
  68. import { getRefundList,receiveRefund } from '../../../api/sellerRefund'
  69. import EmptyRecord from '../../EmptyRecord'
  70. export default {
  71. components:{
  72. TitleHeader,
  73. SellerBase,
  74. EmptyRecord
  75. },
  76. name: 'SellerRefundList',
  77. data(){
  78. return {
  79. navHeight: 0,
  80. dialog:{},
  81. refund_type: '',
  82. title: '',
  83. params: { 'page': 0, 'per_page': 10 },
  84. loading: false, // 是否加载更多
  85. isMore: true, // 是否有更多
  86. order_id: 0,
  87. stateType: '',
  88. orderDetailVisible: false,
  89. refund_list: false
  90. }
  91. },
  92. mounted(){
  93. // #ifdef MP-WEIXIN
  94. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  95. // #endif
  96. },
  97. computed:{
  98. fontSize(){
  99. return getFontSize()
  100. },
  101. },
  102. onLoad: function (option) {
  103. this.refund_type = option.refund_type
  104. this.title = option.refund_type == 2 ? '退货' : '退款'
  105. },
  106. onShow(){
  107. this.reload()
  108. },
  109. methods:{
  110. closeDialog(){
  111. },
  112. confirmDialog(value){
  113. switch(this.dialog.condition){
  114. case 1:
  115. receiveRefund(this.dialog.data,4).then(res => {
  116. this.reload()
  117. }).catch(function (error) {
  118. uni.showToast({icon:'none',title: error.message})
  119. })
  120. break
  121. case 2:
  122. receiveRefund(this.dialog.data,3).then(res => {
  123. this.reload()
  124. }).catch(function (error) {
  125. uni.showToast({icon:'none',title: error.message})
  126. })
  127. break
  128. }
  129. },
  130. goNavigate(path,query=false){
  131. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  132. },
  133. goBack(){uni.navigateBack({delta:1})},
  134. loadMore () {
  135. this.loading = true
  136. this.params.page = ++this.params.page
  137. if (this.isMore) {
  138. this.loading = false
  139. this.getRefundList(false)
  140. }
  141. },
  142. reload () {
  143. // 重新加载数据
  144. this.params.page = 0
  145. this.isMore = true
  146. this.refund_list = false
  147. this.loadMore()
  148. },
  149. receive (orderId) {
  150. this.dialog={condition:1,content:'确定已收到货吗?',data:orderId}
  151. this.$refs.confirm.open()
  152. },
  153. unreceive (orderId) {
  154. this.dialog={condition:2,content:'确定未收到货吗?',data:orderId}
  155. this.$refs.confirm.open()
  156. },
  157. getRefundList (ifReplace) {
  158. uni.showLoading({ title: '加载中' })
  159. if (ifReplace) {
  160. this.loading = false
  161. this.params.page = 1
  162. this.isMore = true
  163. }
  164. getRefundList(this.params, this.refund_type).then(res => {
  165. uni.hideLoading()
  166. if (res.result.hasmore) {
  167. this.isMore = true
  168. } else {
  169. this.isMore = false
  170. }
  171. let tRefundGroup = res.result.refund_list
  172. if (tRefundGroup) {
  173. if (ifReplace || !this.refund_list) {
  174. this.refund_list = tRefundGroup
  175. } else {
  176. this.refund_list = this.refund_list.concat(tRefundGroup)
  177. }
  178. }
  179. }).catch(function (error) {
  180. uni.hideLoading()
  181. uni.showToast({icon:'none',title: error.message})
  182. })
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. .scroll-view-wrapper{display: flex;flex-direction: column;}
  189. .scroll-view{flex:1}
  190. .member-order-list {
  191. .order-body {
  192. .list {
  193. width: 100%;
  194. margin-top:0.5rem;
  195. .tips-body {
  196. height: 2.2rem;
  197. background: rgba(255, 255, 255, 1);
  198. box-shadow:0 0.5px 0 0 rgba(232, 234, 237, 1);
  199. display: flex;
  200. justify-content: space-between;
  201. padding:0 0.75rem 0 0.5rem;
  202. .tips {
  203. font-size:$subFontSize;
  204. color: #333;
  205. line-height: 2.2rem;
  206. }
  207. .statusTips {
  208. color: $primaryColor;
  209. }
  210. .img {
  211. width: 3.8rem;
  212. height: 3rem;
  213. }
  214. }
  215. .order-image {
  216. height: 4.55rem;
  217. background: rgba(250, 250, 250, 1);
  218. width: 100%;
  219. overflow: auto;
  220. white-space: nowrap;
  221. .goods_info{
  222. height:4rem;
  223. margin-bottom: .5rem;
  224. display: flex;
  225. align-items: center;
  226. padding-right: $pageSpace;
  227. .img-wrapper{
  228. width: 3rem;
  229. height: 3rem;
  230. margin: .85rem .6rem .5rem .3rem;
  231. .img{
  232. width: 3rem;
  233. height: 3rem;
  234. border-radius: 1px;
  235. }
  236. }
  237. .goods_name{
  238. white-space: normal;
  239. overflow: hidden;
  240. height: 2rem;
  241. width: 10rem;
  242. font-size: .7rem;
  243. }
  244. .goods_price{
  245. margin-left: auto;
  246. padding-right: .75rem;
  247. text-align: right;
  248. .price{
  249. font-size:$subFontSize;
  250. color: rgba(78, 84, 93, 1);
  251. }
  252. }
  253. }
  254. }
  255. .multiple{
  256. .imagebox{
  257. width: 100%;
  258. overflow-x: auto;
  259. white-space: nowrap;
  260. .img{
  261. width: 3rem;
  262. height:3rem;
  263. margin: .85rem .3rem .5rem;
  264. display: inline-block;
  265. }
  266. }
  267. }
  268. .amount {
  269. font-size:$subFontSize;
  270. color: rgba(78, 84, 93, 1);
  271. line-height: 2.2rem;
  272. height: 2.2rem;
  273. background-color: #fff;
  274. padding:0 0.75rem 0 0;
  275. border-bottom: 1px solid #e8eaed;
  276. box-sizing: border-box;
  277. text-align: right;
  278. overflow: hidden;
  279. text-overflow: ellipsis;
  280. white-space: nowrap;
  281. .amount_icon{
  282. font-size:$subFontSize;
  283. color: $primaryColor;
  284. }
  285. .i {
  286. font-size:$h2;
  287. color:$primaryColor;
  288. padding-left:0.15rem;
  289. font-style: normal;
  290. &.freight {
  291. color: #333;
  292. font-size:$fontSize;
  293. }
  294. }
  295. }
  296. }
  297. .loading-wrapper {
  298. text-align: center;
  299. .p {
  300. color: #c3c3c3;
  301. font-size:$fontSize;
  302. font-weight: 'Regular';
  303. margin: 0.5rem auto;
  304. }
  305. }
  306. }
  307. .mint-popup {
  308. width: 100%;
  309. height: 11.75rem;
  310. }
  311. }
  312. .order-list-opratio{height: 2.2rem;display: flex;justify-content: flex-end;background: rgba(255, 255, 255, 1);border-radius: 0.1rem;}
  313. .order-list-opratio .button{width: 4.5rem;height: 1.5rem;font-size:$subFontSize;border-radius: 0.7rem;margin: 0.35rem 0.75rem 0.35rem 0;background-color: #fff;border: 1px solid #ccc;box-shadow: 0 3px 6px 0 rgba(0,0,0,.05);display:flex;align-items:center;justify-content:center;}
  314. .order-list-opratio .line_red{background-color: #fff;color: #f2270c;border: 1px solid #f2270c;box-shadow: 0 3px 6px 0 rgba(242,39,12,.1);}
  315. </style>