refundList.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view>
  3. <ujp-navbar title="退费记录"></ujp-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-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>原路退回</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!=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. let data = {pageIndex:1,pageSize:10};
  96. api.personAccountRefundList(data).then(function(res){
  97. if(res.result){
  98. //('res'+JSON.stringify(res));
  99. _self.items = res.data.data;
  100. for(let i = 0;i< _self.items.length;i++){
  101. if(_self.items[i].refundChannel == 'wechat')
  102. _self.items[i].refundChannelText = "微信"
  103. else if (_self.items[i].refundChannel == 'alipay')
  104. _self.items[i].refundChannelText = "支付宝"
  105. if(_self.items[i].status == '0')
  106. _self.items[i].statusText = "退款中"
  107. else if (_self.items[i].status == '1')
  108. _self.items[i].statusText = "退款成功"
  109. else if (_self.items[i].status == '2')
  110. _self.items[i].statusText = "退款拒绝"
  111. else if (_self.items[i].status == '3')
  112. _self.items[i].statusText = "退款失败"
  113. }
  114. // //('res'+JSON.stringify(_self.items));
  115. }
  116. },function(err){
  117. uni.showToast({
  118. title: err,
  119. icon: "none"
  120. })
  121. ////('err'+JSON.stringify(err));
  122. });
  123. },
  124. methods: {
  125. theme(type) {
  126. if(type == 'elder')
  127. {
  128. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  129. }
  130. else
  131. {
  132. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  133. }
  134. },
  135. refundItem(item){
  136. uni.navigateTo({
  137. url:'refundDet?id='+item.id
  138. })
  139. },
  140. confirm(){
  141. uni.showLoading({
  142. })
  143. let data = {amount:_self.account.availableAmount,refundChannel:'wechat'}
  144. api.personAccountRefundApplication(data).then(function(res){
  145. uni.hideLoading()
  146. if(res.result){
  147. //('personAccountRefundApplication'+JSON.stringify(res));
  148. uni.redirectTo({
  149. url:'refundApp'
  150. })
  151. }
  152. },function(err){
  153. // uni.showToast({
  154. // title:err
  155. // })
  156. uni.hideLoading();
  157. uni.showModal({
  158. content:err,
  159. title:'提示',
  160. showCancel:false,
  161. confirmText:'知道了'
  162. })
  163. }
  164. );
  165. ////('confirm')
  166. },
  167. showTips(){
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. @import "@/_theme.scss";
  174. .slot-content {
  175. @include themeify{
  176. font-size:themed('font-size2');
  177. }
  178. /* font-size: 28rpx;*/
  179. color: $u-content-color;
  180. padding-left: 30rpx;
  181. padding-right: 30rpx;
  182. padding-top: 40rpx;
  183. padding-bottom: 40rpx;
  184. }
  185. .refundList-none{
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. }
  190. .balanceHead{
  191. background-color: #fff;
  192. padding: 48rpx 0;
  193. display: flex;
  194. flex-direction: column;
  195. align-items: center;
  196. .payPrice{
  197. display: flex;
  198. align-items: flex-end;
  199. justify-content: center;
  200. font{
  201. /* font-size: 36px;
  202. line-height: 36px;*/
  203. @include themeify{
  204. font-size:themed('font-size13');
  205. line-height:themed('font-size13');
  206. }
  207. }
  208. }
  209. .tips{
  210. display: flex;
  211. align-items: center;
  212. margin-top: 8rpx;
  213. p{
  214. color:#999;
  215. margin-right: 8rpx;
  216. }
  217. }
  218. }
  219. .balanceMain{
  220. background-color: #fff;
  221. margin-top: 24rpx;
  222. .balanceMain-title{
  223. display: flex;
  224. align-items: center;
  225. justify-content: space-between;
  226. height: 96rpx;
  227. border-bottom: 2rpx solid #f7f7f7;
  228. padding: 0 32rpx;
  229. .title{
  230. display: flex;
  231. align-items: center;
  232. span{
  233. margin-left: 16rpx;
  234. /* font-size: 16px;*/
  235. @include themeify{
  236. font-size:themed('font-size3');
  237. font-weight: themed('fontWeight');
  238. letter-spacing: themed('letterSpacing');
  239. }
  240. }
  241. }
  242. }
  243. .refundList-item{
  244. padding: 12px 16px;
  245. .refundList-row{
  246. display: flex;
  247. align-items: center;
  248. justify-content: space-between;
  249. p{
  250. @include themeify{
  251. font-size:themed('font-size1');
  252. }
  253. /* font-size: 12px;*/
  254. color:#888;
  255. margin-top: 6rpx;
  256. }
  257. .state1{
  258. color:#FF9600;
  259. }
  260. .state2{
  261. color:#00B962;
  262. }
  263. }
  264. }
  265. }
  266. </style>