rechargeRes.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view>
  3. <ujp-navbar :title="title" :is-back="false" ></ujp-navbar>
  4. <view class="paySuccess">
  5. <u-icon :name="detail.payStatus==20?'chenggong':'close-circle-fill'" custom-prefix="custom-icon" size="180" :color="detail.payStatus==20?'#00B962':'#ff9800'"></u-icon>
  6. <view class="title oldTextjp" oldstyle="font-size: 20px;" v-if="detail.type=='1'">{{detail.payStatusStr}}</view>
  7. <view class="title oldTextjp" oldstyle="font-size: 20px;" v-if="detail.type=='2'" >开通{{detail.payStatus==20?'成功':'失败'}}</view>
  8. <view class="payPrice">
  9. <font>{{detail.totalFee?detail.totalFee.toFixed(2):0}}</font><span>元</span>
  10. </view>
  11. <p class="oldTextjp2" oldstyle="font-size: 16px;" >{{detail.payNameStr}}</p>
  12. </view>
  13. <view class="paySuccess-btn" v-if="detail.type=='1'">
  14. <u-button class="success-btn1 oldTextjp2" oldstyle="font-size: 18px;" shape="circle" type="" @click="rechargeContinue">
  15. <span>继续充值</span>
  16. </u-button>
  17. <u-button class="success-btn2 oldTextjp2" oldstyle="font-size: 18px;"
  18. v-if="detail.recordId&&detail.payStatus==20"
  19. shape="circle" type="success" @click="chargeLook2">
  20. <span>前往充电中</span>
  21. </u-button>
  22. <u-button class="success-btn2 oldTextjp2" oldstyle="font-size: 18px;"
  23. v-else-if="charge"
  24. shape="circle" type="success" @click="chargeLook">
  25. <span>前往充电</span>
  26. </u-button>
  27. <u-button class="success-btn2 oldTextjp2" oldstyle="font-size: 18px;"
  28. v-else
  29. shape="circle" type="success" @click="balanceLook">
  30. <span>查看余额</span>
  31. </u-button>
  32. </view>
  33. <view class="paySuccess-btn" v-if="detail.type=='2'">
  34. <u-button class="success-btn1 oldTextjp2" v-if="detail.payStatus!=20" oldstyle="font-size: 18px;" shape="circle" type="" @click="getInfo">
  35. <span>刷新</span>
  36. </u-button>
  37. <u-button class="success-btn2 oldTextjp2" oldstyle="font-size: 18px;" shape="circle" type="" @click="userindex">
  38. <span>返回</span>
  39. </u-button>
  40. </view>
  41. <view class="discounts" style="padding:0 18px;margin-top: 20px;" v-if="bannerList.length" >
  42. <u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList" mode="none" @click="clickBanner"
  43. :name="'picUrl'">
  44. </u-swiper>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import * as API from '@/apis/finance.js'
  50. import * as newsApi from '@/apis/news.js'
  51. export default {
  52. data() {
  53. return {
  54. detail: {},
  55. id: "",
  56. charge:false,
  57. chargeObj:{},
  58. title:'充值结果',
  59. bannerList:[],
  60. }
  61. },
  62. onLoad(op) {
  63. if(op.id){
  64. this.id=op.id
  65. this.getInfo();
  66. }
  67. var obj=this.carhelp.getGunIdCharge();
  68. if(obj){
  69. this.charge=true
  70. this.chargeObj=obj
  71. }
  72. this.getBannerInfo("recharge-end")
  73. },
  74. onReady() {
  75. },
  76. methods: {
  77. clickBanner(index){
  78. var mod= this.bannerList[index]
  79. if(mod.linkUrl.indexOf('http')==0){
  80. window.location=mod.linkUrl;
  81. }
  82. else if(mod.linkUrl.indexOf('#/')==0){
  83. if(mod.linkUrl.indexOf("?")==-1){
  84. mod.linkUrl+='?';
  85. }
  86. //window.location=mod.linkUrl;
  87. var url=mod.linkUrl.split("#")[1]
  88. //window.location = mod.clickUrl;
  89. uni.navigateTo({
  90. url: url
  91. })
  92. }
  93. else if(mod.linkUrl=='#'||mod.linkUrl==''){
  94. }
  95. else{
  96. uni.navigateTo({
  97. url:mod.linkUrl
  98. })
  99. }
  100. },
  101. getBannerInfo(code){
  102. uni.showLoading({
  103. title: "加载中",
  104. mask: true,
  105. })
  106. newsApi.getBannerInfo(code).then((res) => {
  107. uni.hideLoading();
  108. this.bannerList =res.data;
  109. // document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 300px;"
  110. }).catch(error => {
  111. uni.showToast({
  112. title: error,icon: "none"
  113. })
  114. })
  115. },
  116. getInfo() {
  117. uni.showLoading({
  118. title: "加载中",
  119. mask: true,
  120. })
  121. API.accountDetail({
  122. outOrderNo: this.id
  123. }).then((res) => {
  124. uni.hideLoading()
  125. this.detail = res.data.orderInfo;
  126. if(this.detail.type=='2'){
  127. this.title='开通会员'
  128. }
  129. }).catch(error => {
  130. uni.showToast({
  131. title: error,
  132. icon: "none"
  133. })
  134. })
  135. },
  136. userindex() {
  137. uni.redirectTo({
  138. url: '/pages/user/index'
  139. })
  140. },
  141. rechargeContinue() {
  142. uni.redirectTo({
  143. url: '/pages/user/finance/recharge'
  144. })
  145. },
  146. chargeLook2(){
  147. uni.redirectTo({
  148. url:"/pages/searchPile/chargeProcess/dcCharging?id=" + this.detail.recordId
  149. })
  150. },
  151. chargeLook(){
  152. uni.redirectTo({
  153. url:'/pages/searchPile/chargeProcess/charge?isback=1&deviceNo='+this.chargeObj.deviceNo+"&gun="+this.chargeObj.channelNo+"&carNumber="+this.chargeObj.carNumber
  154. })
  155. },
  156. balanceLook() {
  157. uni.redirectTo({
  158. url: '/pages/user/finance/balance'
  159. })
  160. }
  161. }
  162. }
  163. </script>
  164. <style>
  165. page {
  166. background-color: #fff;
  167. }
  168. </style>
  169. <style lang="scss" scoped>
  170. .paySuccess {
  171. text-align: center;
  172. padding: 50px 0;
  173. .title {
  174. font-size: 20px;
  175. margin-top: 20px;
  176. }
  177. .payPrice {
  178. display: flex;
  179. align-items: flex-end;
  180. justify-content: center;
  181. font {
  182. font-size: 36px;
  183. line-height: 36px;
  184. }
  185. margin-top: 20px;
  186. }
  187. p {
  188. color: #999;
  189. margin-top: 4px;
  190. }
  191. }
  192. .paySuccess-btn {
  193. display: flex;
  194. justify-content: space-between;
  195. padding: 0 40px;
  196. }
  197. .success-btn1 {
  198. color: #BBBBBB !important;
  199. background-color: #fff !important;
  200. flex: 0.4;
  201. span {
  202. color: #333;
  203. }
  204. }
  205. .success-btn2 {
  206. background-color: #00B962 !important;
  207. flex: 0.4;
  208. border-color: #00B962 !important;
  209. color: #fff !important;
  210. }
  211. </style>