pay.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="page">
  3. <view class="content">
  4. <view class="title">
  5. <text>付款</text>
  6. </view>
  7. <view class="content-main">
  8. <view class="content-main-info">
  9. <text>付款条形码</text>
  10. </view>
  11. <view class="content-main-barcode">
  12. <tki-barcode ref="barcode" :show="true" :val="getVal" :loadMake="true" :opations="opations" @result="barresult" />
  13. </view>
  14. <view class="content-main-qrCode">
  15. <tki-qrcode ref="qrcode" :val="getVal" :onval="true" :size="300" :iconSize="65" unit="upx" background="#ffffff"
  16. foreground="#000000" pdground="#000000" :loadMake="true" :showLoading="true" loadingText="加载中..." @result="qrR" />
  17. </view>
  18. </view>
  19. <view class="footer-msg" @tap="goPath('pay_out')">
  20. <view class="info">
  21. <image src="/static/theme/default/my/shoukuan.png"></image>
  22. <text>二维码收款</text>
  23. </view>
  24. <uni-icons :size="20" class="uni-icon-wrapper" color="white" type="arrowright" />
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import _hook from '../../../common/_hook';
  31. import _data from '../../../common/_data';
  32. import _page from '../../../common/common';
  33. import tkiQrcode from "../../../components/tki-qrcode/tki-qrcode.vue";
  34. export default {
  35. data() {
  36. return {
  37. opations: {
  38. width: 4, //设置条之间的宽度
  39. height: 120, //高度
  40. displayValue: false, //是否在条形码下方显示文字
  41. text: "",//覆盖显示的文本
  42. background: "#FFFFFF", //设置条形码的背景色
  43. margin: 0, //设置条形码周围的空白边距
  44. },
  45. img_path: '',
  46. my_data: {
  47. id: 0
  48. }
  49. }
  50. },
  51. components: {
  52. tkiQrcode
  53. },
  54. onLoad() {
  55. },
  56. onShow() {
  57. _hook.routeSonHook();
  58. let _this = this;
  59. setTimeout(function(){
  60. _this.$refs.barcode._makeCode();
  61. },2000)
  62. /** 监听新的个人数据 */
  63. uni.$on('data_user_info', function(data) {
  64. _this.my_data = data;
  65. });
  66. _this.my_data = _data.data('user_info');
  67. },
  68. computed: {
  69. getVal() {
  70. //付款码
  71. let params = {};
  72. params.user_id = this.my_data.id;
  73. return _page.qrAction.toPage('/pages/my/pay/collect_amount',params);
  74. },
  75. qrPhoto() {
  76. return _data.data('cache').local_photo;
  77. },
  78. myPhoto() {
  79. return _data.staticPhoto() + this.my_data.photo;
  80. }
  81. },
  82. methods: {
  83. qrR(ref) {
  84. this.img_path = ref;
  85. return ref;
  86. },
  87. barresult(res) {
  88. return res;
  89. },
  90. goPath(path) {
  91. if (path) {
  92. uni.navigateTo({
  93. url: path
  94. })
  95. }
  96. },
  97. result(res) {
  98. return res;
  99. }
  100. }
  101. }
  102. </script>
  103. <style>
  104. .footer-msg .info {
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. margin-left: 20upx;
  109. }
  110. .footer-msg .info text {
  111. margin-left: 20upx;
  112. }
  113. .footer-msg image {
  114. width: 40upx;
  115. height: 40upx;
  116. }
  117. .footer-msg {
  118. background-color: #62aba2;
  119. color: white;
  120. border-radius: 20upx;
  121. width: 95%;
  122. margin-top: 40upx;
  123. padding: 25upx 0;
  124. display: flex;
  125. flex-direction: row;
  126. justify-content: space-between;
  127. }
  128. .content-main-info {
  129. display: flex;
  130. align-items: center;
  131. margin-top: 40upx;
  132. margin-bottom: 15upx;
  133. color: #afafaf;
  134. }
  135. .content-main-qrCode {
  136. margin-top: 120upx;
  137. margin-bottom: 120upx;
  138. }
  139. .content-main-barcode img {
  140. width: 750px !important;
  141. }
  142. .content .title {
  143. width: 95%;
  144. background-color: white;
  145. font-size: 14px;
  146. color: #55a298;
  147. border-bottom: 1px solid #d6d6d6;
  148. border-top-left-radius: 10upx;
  149. border-top-right-radius: 10upx;
  150. padding: 20upx 0;
  151. }
  152. .content .title text {
  153. padding-left: 50upx;
  154. }
  155. .content {
  156. display: flex;
  157. align-items: center;
  158. flex-direction: column;
  159. }
  160. .content .content-main {
  161. background-color: white;
  162. display: flex;
  163. flex-direction: column;
  164. align-items: center;
  165. justify-content: center;
  166. border-bottom-left-radius: 10upx;
  167. border-bottom-right-radius: 10upx;
  168. width: 95%;
  169. }
  170. page {
  171. background-color: #4ba198;
  172. }
  173. </style>