refundList.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view>
  3. <u-navbar title="退费记录"></u-navbar>
  4. <view class="balance">
  5. <view class="balanceHead">
  6. <view class="payPrice">
  7. <span>¥</span><font>{{account.totalAmount}}</font>
  8. </view>
  9. <view class="tips">
  10. <p>可退费金额(元)</p><u-icon name="question-line" custom-prefix="custom-icon" color="#00B962" size="32" @click="showtip = true"></u-icon>
  11. </view>
  12. </view>
  13. <view class="balanceMain">
  14. <view class="balanceMain-title">
  15. <view class="title">
  16. <u-icon name="todo-fill" custom-prefix="custom-icon" color="#6BC6A7" size="40"></u-icon>
  17. <span>退费记录</span>
  18. </view>
  19. </view>
  20. <view class="refundList">
  21. <view class="refundList-item" v-for="(item,index) in items" :key="index" @click="refundItem(item)">
  22. <view class="refundList-row">
  23. <font>退至 {{item.refundChannelText}}</font>
  24. <span :class="item.status == '0'? 'state1':'state2' ">{{item.statusText}}</span>
  25. </view>
  26. <view class="refundList-row" >
  27. <p>{{item.applicationTime}}</p>
  28. <p>¥{{item.refundAmount.toFixed(2)}}</p>
  29. </view>
  30. </view>
  31. <!--
  32. <view class="refundList-item">
  33. <view class="refundList-row">
  34. <font>退至 微信</font>
  35. <span class="state2">已退款</span>
  36. </view>
  37. <view class="refundList-row">
  38. <p>2021-12-31 09:00</p>
  39. <p>¥15.00</p>
  40. </view>
  41. </view>-->
  42. <!-- <view class="refundList-none">
  43. <u-image width="200px" height="200px" src="/static/img/none.svg"></u-image>
  44. </view> -->
  45. </view>
  46. </view>
  47. </view>
  48. <view>
  49. <u-modal v-model="show" :title="title" :content='content' :show-confirm-button="true" :show-cancel-button='true' @confirm="confirm"></u-modal>
  50. </view>
  51. <view>
  52. <u-modal v-model="showtip" :title="title" :content='content1' :show-confirm-button="true" confirm-text="知道了" ></u-modal>
  53. </view>
  54. <view style="bottom:0rpx;position:absolute;width: 100%;" v-show="account.totalAmount>0">
  55. <u-button shape="circle" style="background-color: green;color:white" @click="show=true">申请退款</u-button>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. let _self;
  61. import * as api from "@/apis/refund.js"
  62. export default {
  63. data() {
  64. return {
  65. content1:'本平台仅支持可支持金额全额退费,申请成功后退费金额将于5个工作日内退还至您的充值账户.在本平台,三个月内的支付宝充值,微信支付可申请退费. 退费成功后,您可以在退费记录查看退费信息和审核进度.',
  66. title:'提示',
  67. content:'是否确定提交退费申请?申请成功后退费金额将于5个工作日内退还至您的充值账户',
  68. show:false,
  69. showtip:false,
  70. userId:'',
  71. account:{},
  72. items:[],
  73. }
  74. },
  75. onLoad(){
  76. _self = this;
  77. },
  78. onReady(){
  79. if (this.carhelp.getPersonInfo()) {
  80. this.userId = this.carhelp.getPersonInfo().id;
  81. }
  82. api.personAccount().then(function(res){
  83. if(res.result)
  84. {
  85. _self.account = res.data;
  86. }
  87. // console.log('个人余额信息'+JSON.stringify(res));
  88. },function(err){
  89. console.log('个人信息余额错误'+JSON.stringify(err));
  90. });
  91. let data = {pageIndex:1,pageSize:10};
  92. api.personAccountRefundList(data).then(function(res){
  93. if(res.result){
  94. // console.log('res'+JSON.stringify(res));
  95. _self.items = res.data.data;
  96. for(let i = 0;i< _self.items.length;i++){
  97. if(_self.items[i].refundChannel == 'wechat')
  98. _self.items[i].refundChannelText = "微信"
  99. else if (_self.items[i].refundChannel == 'alipay')
  100. _self.items[i].refundChannelText = "支付宝"
  101. if(_self.items[i].status == '0')
  102. _self.items[i].statusText = "退款中"
  103. else if (_self.items[i].status == '1')
  104. _self.items[i].statusText = "退款成功"
  105. else if (_self.items[i].status == '2')
  106. _self.items[i].statusText = "退款拒绝"
  107. else if (_self.items[i].status == '3')
  108. _self.items[i].statusText = "退款失败"
  109. }
  110. // console.log('res'+JSON.stringify(_self.items));
  111. }
  112. });
  113. },
  114. methods: {
  115. refundItem(item){
  116. uni.navigateTo({
  117. url:'refundDet?id='+item.id
  118. })
  119. },
  120. confirm(){
  121. let data = {amount:_self.account.availableAmount,refundChannel:'wechat'}
  122. api.personAccountRefundApplication(data).then(function(res){
  123. if(res.result){
  124. console.log('personAccountRefundApplication'+JSON.stringify(res));
  125. uni.navigateTo({
  126. url:'refundApp'
  127. })
  128. }
  129. },function(err){
  130. }
  131. );
  132. //console.log('confirm')
  133. },
  134. showTips(){
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .refundList-none{
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. }
  145. .balanceHead{
  146. background-color: #fff;
  147. padding: 24px 0;
  148. display: flex;
  149. flex-direction: column;
  150. align-items: center;
  151. .payPrice{
  152. display: flex;
  153. align-items: flex-end;
  154. justify-content: center;
  155. font{
  156. font-size: 36px;
  157. line-height: 36px;
  158. }
  159. }
  160. .tips{
  161. display: flex;
  162. align-items: center;
  163. margin-top: 4px;
  164. p{
  165. color:#999;
  166. margin-right: 4px;
  167. }
  168. }
  169. }
  170. .balanceMain{
  171. background-color: #fff;
  172. margin-top: 12px;
  173. .balanceMain-title{
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-between;
  177. height: 48px;
  178. border-bottom: 1px solid #f7f7f7;
  179. padding: 0 16PX;
  180. .title{
  181. display: flex;
  182. align-items: center;
  183. span{
  184. margin-left: 8px;
  185. font-size: 16px;
  186. }
  187. }
  188. }
  189. .refundList-item{
  190. padding: 12px 16px;
  191. .refundList-row{
  192. display: flex;
  193. align-items: center;
  194. justify-content: space-between;
  195. p{
  196. font-size: 12px;
  197. color:#888;
  198. margin-top: 3px;
  199. }
  200. .state1{
  201. color:#FF9600;
  202. }
  203. .state2{
  204. color:#00B962;
  205. }
  206. }
  207. }
  208. }
  209. </style>