refundList.vue 6.7 KB

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