offlineCp.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="app-content">
  3. <view class="billing_box_bg">
  4. <view class="top-view"> </view>
  5. <view class="result-view">
  6. <view :class="['iconfont', 'iconchenggong']"></view>
  7. <view class="result-title">充值成功</view>
  8. <view class="textarea-container">
  9. <textarea
  10. class="result-textarea"
  11. v-model="copyText"
  12. readonly
  13. placeholder=""
  14. ></textarea>
  15. </view>
  16. <view style="font-size:34upx;color:#807d7d;">复制上面文字,发给客户</view>
  17. <view class="pay-confirm-content">
  18. <view>
  19. <button class="admin-button-com big" @click="copyBack" style="width:420upx;">复制并返回</button>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { getMallRechargeShortLink } from "@/api/recharge";
  28. export default {
  29. name: "offlineCp",
  30. data() {
  31. return {
  32. orderInfo:[],
  33. copyText:""
  34. }
  35. },
  36. onLoad(){
  37. //返回上一页时刷新
  38. let pages = getCurrentPages();
  39. let prevPage = pages[ pages.length - 2 ];
  40. if(prevPage.$vm){
  41. prevPage.$vm.pageAction = {refresh:1}
  42. }
  43. },
  44. methods: {
  45. init(){
  46. let amount = this.option.amount?parseFloat(this.option.amount):0
  47. let orderId = this.option.orderId?this.option.orderId:0
  48. getMallRechargeShortLink({orderId:orderId}).then(res=>{
  49. if(res.code == 1){
  50. let rechargeAccountLink = res.data.rechargeAccountLink ? res.data.rechargeAccountLink:''
  51. let orderLink = res.data.orderLink?res.data.orderLink:''
  52. this.copyText = "售后金额¥"+amount+"元,已充值到你的账户,点击下面链接查看你的账户余额\n\n余额 "+rechargeAccountLink+"\n\n订单 "+orderLink+"\n\n链接30天后失效"
  53. }
  54. })
  55. },
  56. copyBack(){
  57. uni.setClipboardData({
  58. data: this.copyText,
  59. success: () => {
  60. uni.showToast({ title: '复制成功', icon: 'success', duration: 2000 })
  61. setTimeout(() => {
  62. uni.navigateBack()
  63. }, 800)
  64. },
  65. fail: () => {
  66. uni.showToast({ title: '复制失败', icon: 'none', duration: 2000 })
  67. setTimeout(() => {
  68. uni.navigateBack()
  69. }, 1000)
  70. }
  71. });
  72. }
  73. },
  74. };
  75. </script>
  76. <style lang="scss" scoped>
  77. .billing_box_bg {
  78. position: relative;
  79. padding: 30upx 30upx;
  80. display: flex;
  81. flex-direction: column;
  82. background-color: #f5f5f5;
  83. .top-view {
  84. position: absolute;
  85. top: 0;
  86. left: 0;
  87. width: 100%;
  88. height: 299upx;
  89. background: #3385ff;
  90. border-radius: 0upx 0upx 83upx 83upx;
  91. }
  92. .result-view {
  93. position: relative;
  94. display: flex;
  95. flex-direction: column;
  96. align-items: center;
  97. padding: 80upx 0upx 70upx 0upx;
  98. width: 100%;
  99. background: #ffffff;
  100. border-radius: 20upx;
  101. z-index: 1;
  102. .iconchenggong {
  103. font-size: 130upx;
  104. color: $mainColor1;
  105. }
  106. .result-title {
  107. margin: 50upx 0 30upx;
  108. font-size: 38upx;
  109. }
  110. .textarea-container {
  111. width: 100%;
  112. padding: 0 40upx;
  113. margin-bottom: 40upx;
  114. .result-textarea {
  115. width: 100%;
  116. min-height: 300upx;
  117. padding: 30upx;
  118. background: #f8f9fa;
  119. border: 2upx solid #e9ecef;
  120. border-radius: 16upx;
  121. font-size: 32upx;
  122. line-height: 1.6;
  123. color: #333;
  124. resize: none;
  125. &:focus {
  126. border-color: $mainColor1;
  127. background: #fff;
  128. }
  129. }
  130. }
  131. }
  132. }
  133. .pay-confirm-content {
  134. padding: 40upx 40upx;
  135. text-align: center;
  136. }
  137. </style>