index.vue 5.6 KB

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