index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="container" :style="viewColor">
  3. <!-- #ifdef H5 -->
  4. <!--公众号-->
  5. <view class="payCount" v-if="isWeixin">
  6. <view class="count">
  7. <view class="main">
  8. <view>点击右上角
  9. <text class='iconfont icon-gengduo2'></text>
  10. <image class="image" :src="`${domain}/static/images/guide.png`"></image>
  11. </view>
  12. <view>选择在<text class="text">浏览器</text>中打开,去支付宝支付</view>
  13. </view>
  14. </view>
  15. <view class="pay_count">
  16. <navigator v-if="type == 0" url="/pages/users/order_list/index?status=1" class="payBtn">完成支付</navigator>
  17. <navigator v-if="type == 10" url="/pages/users/user_payment/index" class="payBtn bg-none">返回</navigator>
  18. <navigator v-else-if="type == 11" url="/pages/annex/vip_paid/index" class="payBtn bg-none">返回</navigator>
  19. <navigator v-else url="/pages/users/order_list/index?status=0" class="payBtn bg-none">返回查看订单</navigator>
  20. </view>
  21. </view>
  22. <!--H5-->
  23. <view v-else>
  24. <view class="alipay">
  25. <image class="alipay_wait" :src="domain+'/static/diy/alipay_wait'+keyColor+'.png'"></image>
  26. <view class="alipay_text">正在跳转支付... </view>
  27. </view>
  28. <view class="pay_count">
  29. <navigator v-if="type == 0" url="/pages/users/order_list/index?status=1" class="payBtn">完成支付</navigator>
  30. <navigator v-if="type == 10" url="/pages/users/user_payment/index" class="payBtn bg-none">返回</navigator>
  31. <navigator v-else-if="type == 11" url="/pages/annex/vip_paid/index" class="payBtn bg-none">返回</navigator>
  32. <navigator v-else url="/pages/users/order_list/index?status=0" class="payBtn bg-none">返回查看订单</navigator>
  33. </view>
  34. </view>
  35. <!-- #endif -->
  36. <!-- #ifdef MP -->
  37. <!--小程序-->
  38. <view class="payCount">
  39. <view class="count">
  40. <view class="main_text">
  41. <view>去支付,请长按网址复制后 使用浏览器访问</view>
  42. <text class='copy' @tap='copy'>{{url}}</text>
  43. </view>
  44. </view>
  45. <view class="pay_count">
  46. <navigator v-if="type == 10" url="/pages/users/user_payment/index" class="payBtn">完成支付</navigator>
  47. <navigator v-else-if="type == 11" url="/pages/annex/vip_paid/index" class="payBtn">完成支付</navigator>
  48. <navigator v-else url="/pages/users/order_list/index?status=1" class="payBtn">完成支付</navigator>
  49. <navigator v-if="type == 10" url="/pages/users/user_payment/index" class="payBtn bg-none">返回</navigator>
  50. <navigator v-else-if="type == 11" url="/pages/annex/vip_paid/index" class="payBtn bg-none">返回</navigator>
  51. <navigator v-else url="/pages/users/order_list/index?status=0" class="payBtn bg-none">返回查看订单</navigator>
  52. </view>
  53. </view>
  54. <!-- #endif -->
  55. </view>
  56. </template>
  57. <script>
  58. // +----------------------------------------------------------------------
  59. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  60. // +----------------------------------------------------------------------
  61. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  62. // +----------------------------------------------------------------------
  63. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  64. // +----------------------------------------------------------------------
  65. // | Author: CRMEB Team <admin@crmeb.com>
  66. // +----------------------------------------------------------------------
  67. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  68. import { getCallBackUrlApi } from "@/api/order";
  69. import { mapGetters } from "vuex";
  70. import { HTTP_REQUEST_URL } from '@/config/app';
  71. export default {
  72. computed: mapGetters(['viewColor','keyColor']),
  73. data() {
  74. return {
  75. domain: HTTP_REQUEST_URL,
  76. isWeixin: false,
  77. url: '',
  78. keyCode: '',
  79. type: 0
  80. };
  81. },
  82. /**
  83. * 生命周期函数--监听页面显示
  84. */
  85. onShow: function() {
  86. },
  87. onReady: function() {
  88. // #ifdef H5
  89. this.$nextTick(function() {
  90. const clipboard = new ClipboardJS(".copy-data");
  91. clipboard.on("success", () => {
  92. this.$util.Tips({
  93. title: '复制成功'
  94. });
  95. });
  96. });
  97. // #endif
  98. },
  99. onLoad: function(options){
  100. let that = this;
  101. that.url = options.url;
  102. that.type = options.type || 0;
  103. if(options.keyCode && options.url){
  104. // #ifdef H5
  105. that.keyCode = options.keyCode;
  106. that.getCallBackUrl(that.keyCode);
  107. // 公众号
  108. if(that.$wechat.isWeixin()){
  109. that.isWeixin = true;
  110. }else{
  111. setTimeout(function(){
  112. window.location.href = that.url;
  113. },2000)
  114. }
  115. // #endif
  116. }
  117. },
  118. methods: {
  119. /**
  120. *
  121. * 剪切订单号
  122. */
  123. // #ifndef H5
  124. copy: function() {
  125. let that = this;
  126. uni.setClipboardData({
  127. data: that.url,
  128. success: function(res){
  129. }
  130. });
  131. },
  132. // #endif
  133. getCallBackUrl: function(key){
  134. let that = this;
  135. getCallBackUrlApi(key)
  136. .then(res => {
  137. that.url = res.message;
  138. })
  139. .catch(res => {
  140. that.$util.Tips({
  141. title: res
  142. });
  143. });
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. .container{
  150. height: 100vh;
  151. background: #F5F5F5;
  152. }
  153. .payCount{
  154. padding-bottom: 60rpx;
  155. .count{
  156. padding-top: 260rpx;
  157. }
  158. .main{
  159. position: relative;
  160. padding: 0 100rpx;
  161. color: #111111;
  162. font-size: 32rpx;
  163. line-height: 60rpx;
  164. .text{
  165. color: #000000;
  166. font-size: 36rpx;
  167. margin: 0 4px;
  168. font-weight: 700;
  169. }
  170. .image{
  171. width: 200rpx;
  172. height: 200rpx;
  173. position: absolute;
  174. right: 50rpx;
  175. top: -200rpx;
  176. }
  177. }
  178. .main_text{
  179. position: relative;
  180. color: #111111;
  181. font-size: 32rpx;
  182. line-height: 60rpx;
  183. text-align: center;
  184. width: 600rpx;
  185. margin: 0 auto;
  186. }
  187. .copy{
  188. display: block;
  189. margin-top: 100rpx;
  190. font-weight: bold;
  191. word-break:break-all;
  192. }
  193. }
  194. .pay_count{
  195. padding: 0 15px;
  196. box-sizing: border-box;
  197. margin-top: 180rpx;
  198. }
  199. .payBtn{
  200. width: 690rpx;
  201. margin: 0 auto;
  202. height: 86rpx;
  203. border-radius: 50rpx;
  204. text-align: center;
  205. line-height: 86rpx;
  206. font-size: 30rpx;
  207. color: #fff;
  208. background-color: var(--view-theme);
  209. &.bg-none{
  210. color: var(--view-theme);
  211. background-color: #fff;
  212. border: 1px solid var(--view-theme);
  213. margin-top: 30rpx;
  214. }
  215. }
  216. .alipay{
  217. text-align: center;
  218. .alipay_wait{
  219. width: 502rpx;
  220. height: 400rpx;
  221. margin-top: 200rpx;
  222. }
  223. .alipay_text{
  224. color: #111111;
  225. font-size: 32rpx;
  226. margin-top: 40rpx;
  227. }
  228. }
  229. </style>