refundList.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <view>
  3. <u-navbar title="退费记录"></u-navbar>
  4. <view class="balance">
  5. <view class="balanceHead">
  6. <view class="payPrice">
  7. <font>{{account.availableAmount!=null ? account.availableAmount.toFixed(2) : '0.00'}}</font><span>元</span>
  8. </view>
  9. <view class="tips">
  10. <p>可退费金额(元)</p><u-icon name="question-circle" 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>原路退回</font>
  24. <span :class=" 'state'+item.status ">{{item.statusText}}</span>
  25. </view>
  26. <view class="refundList-row" >
  27. <p>{{item.applicationTime}}</p>
  28. <p>{{item.refundAmount!=null ? item.refundAmount.toFixed(2) : '0.00'}}元</p>
  29. </view>
  30. </view>
  31. <!-- <view class="refundList-none">
  32. <u-image width="200px" height="200px" src="/static/img/none.svg"></u-image>
  33. </view> -->
  34. </view>
  35. </view>
  36. </view>
  37. <view>
  38. <u-modal v-model="show" :title="title" :content="content" :show-confirm-button="true" :show-cancel-button='true' @confirm="confirm"></u-modal>
  39. </view>
  40. <view>
  41. <u-modal v-model="showtip" :title="title" :show-confirm-button="true" confirm-text="知道了" confirm-color="#00B962">
  42. <view class="slot-content">
  43. <rich-text :nodes="content1"></rich-text>
  44. </view>
  45. </u-modal>
  46. </view>
  47. <view style="bottom:0;position:absolute;width: 100%;padding: 40rpx;" v-show="account.availableAmount>0">
  48. <u-button shape="circle" style="background-color:#00b962;color:white" @click="show=true">申请退款</u-button>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. let _self;
  54. import * as api from "@/apis/refund.js"
  55. export default {
  56. data() {
  57. return {
  58. elderMode:false,
  59. content1:`本平台仅支持金额全额退费,申请成功后退费金额将于5个工作日内退还至您的充值账户.在本平台,三个月内的支付宝充值,微信支付可申请退费.<br />退费成功后,您可以在退费记录查看退费信息和审核进度.`,
  60. title:'提示',
  61. content:'是否确定提交退费申请?申请成功后退费金额将于5个工作日内退还至您的充值账户',
  62. show:false,
  63. showtip:false,
  64. userId:'',
  65. account:{},
  66. items:[],
  67. }
  68. },
  69. onLoad(){
  70. _self = this;
  71. },
  72. onReady(){
  73. this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
  74. if(this.elderMode)
  75. this.theme('elder')
  76. else
  77. this.theme('standard')
  78. if (this.carhelp.getPersonInfo()) {
  79. this.userId = this.carhelp.getPersonInfo().id;
  80. //('userId'+this.userId)
  81. }
  82. api.personAccount().then(function(res){
  83. if(res.result)
  84. {
  85. _self.account = res.data;
  86. }
  87. //('个人余额信息'+JSON.stringify(res));
  88. },function(err){
  89. uni.showToast({
  90. title: err,
  91. icon: "none"
  92. })
  93. ////('err'+JSON.stringify(err));
  94. });
  95. this.getList();
  96. },
  97. methods: {
  98. getList(){
  99. let data = {pageIndex:1,pageSize:100};
  100. api.personAccountRefundList(data).then(function(res){
  101. if(res.result){
  102. //('res'+JSON.stringify(res));
  103. _self.items = res.data.data;
  104. for(let i = 0;i< _self.items.length;i++){
  105. if(_self.items[i].refundChannel == 'wechat')
  106. _self.items[i].refundChannelText = "微信"
  107. else if (_self.items[i].refundChannel == 'alipay')
  108. _self.items[i].refundChannelText = "支付宝"
  109. if(_self.items[i].status == '0')
  110. _self.items[i].statusText = "退款中"
  111. else if (_self.items[i].status == '1')
  112. _self.items[i].statusText = "退款成功"
  113. else if (_self.items[i].status == '2')
  114. _self.items[i].statusText = "退款拒绝"
  115. else if (_self.items[i].status == '3')
  116. _self.items[i].statusText = "退款失败"
  117. }
  118. // //('res'+JSON.stringify(_self.items));
  119. }
  120. },function(err){
  121. uni.showToast({
  122. title: err,
  123. icon: "none"
  124. })
  125. ////('err'+JSON.stringify(err));
  126. });
  127. },
  128. theme(type) {
  129. if(type == 'elder')
  130. {
  131. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  132. }
  133. else
  134. {
  135. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  136. }
  137. },
  138. refundItem(item){
  139. uni.navigateTo({
  140. url:'refundDet?id='+item.id
  141. })
  142. },
  143. confirm(){
  144. uni.showLoading({
  145. })
  146. var _this=this
  147. let data = {amount:_self.account.availableAmount,refundChannel:'wechat'}
  148. api.personAccountRefundApplication(data).then(function(res){
  149. uni.hideLoading()
  150. if(res.result){
  151. api.personAccount().then(function(res){
  152. if(res.result)
  153. {
  154. _self.account = res.data;
  155. }
  156. //('个人余额信息'+JSON.stringify(res));
  157. },function(err){
  158. uni.showToast({
  159. title: err,
  160. icon: "none"
  161. })
  162. ////('err'+JSON.stringify(err));
  163. });
  164. _this.getList();
  165. }
  166. },function(err){
  167. // uni.showToast({
  168. // title:err
  169. // })
  170. uni.hideLoading();
  171. uni.showModal({
  172. content:err,
  173. title:'提示',
  174. showCancel:false,
  175. confirmText:'知道了'
  176. })
  177. }
  178. );
  179. ////('confirm')
  180. },
  181. showTips(){
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="scss" scoped>
  187. .slot-content {
  188. font-size: 28rpx;
  189. color: $u-content-color;
  190. padding-left: 30rpx;
  191. padding-right: 30rpx;
  192. padding-top: 40rpx;
  193. padding-bottom: 40rpx;
  194. }
  195. .refundList-none{
  196. display: flex;
  197. align-items: center;
  198. justify-content: center;
  199. }
  200. .balanceHead{
  201. background-color: #fff;
  202. padding: 48rpx 0;
  203. display: flex;
  204. flex-direction: column;
  205. align-items: center;
  206. .payPrice{
  207. display: flex;
  208. align-items: flex-end;
  209. justify-content: center;
  210. font{
  211. font-size: 36px;
  212. line-height: 36px;
  213. }
  214. }
  215. .tips{
  216. display: flex;
  217. align-items: center;
  218. margin-top: 8rpx;
  219. p{
  220. color:#999;
  221. margin-right: 8rpx;
  222. }
  223. }
  224. }
  225. .balanceMain{
  226. background-color: #fff;
  227. margin-top: 24rpx;
  228. .balanceMain-title{
  229. display: flex;
  230. align-items: center;
  231. justify-content: space-between;
  232. height: 96rpx;
  233. border-bottom: 2rpx solid #f7f7f7;
  234. padding: 0 32rpx;
  235. .title{
  236. display: flex;
  237. align-items: center;
  238. span{
  239. margin-left: 16rpx;
  240. font-size: 16px;
  241. }
  242. }
  243. }
  244. .refundList-item{
  245. padding: 12px 16px;
  246. .refundList-row{
  247. display: flex;
  248. align-items: center;
  249. justify-content: space-between;
  250. p{
  251. font-size: 12px;
  252. color:#888;
  253. margin-top: 6rpx;
  254. }
  255. .state0{
  256. color:#FF9600;
  257. }
  258. .state1{
  259. color:#00B962;
  260. }
  261. .state2{
  262. color:red;
  263. }
  264. .state3{
  265. color:red;
  266. }
  267. }
  268. }
  269. }
  270. </style>