金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
4.4 KiB

  1. <template>
  2. <view class="page">
  3. <lf-nav title="会员码" bgColor="transparent" :spreadOut="false" titleColor="#fff" :showIcon="true"></lf-nav>
  4. <view class="bg-viewleft"></view>
  5. <view class="bg-viewright"></view>
  6. <view class="content">
  7. <view class="top">
  8. <view class="lf-flex">
  9. <view class="avatar">
  10. <image src="https://picsum.photos/200"></image>
  11. </view>
  12. <view class="phone">182****5380</view>
  13. </view>
  14. <view class="card">
  15. <text class="lf-iconfont icon--1"></text>
  16. </view>
  17. </view>
  18. <view class="balance">余额 ¥1829.83</view>
  19. <view class="barcode">
  20. <lf-barcode :options="config.bar"></lf-barcode>
  21. </view>
  22. <view class="qrcode">
  23. <lf-qrcode :options="config.qrc"></lf-qrcode>
  24. </view>
  25. <view class="tips">{{ num }}s后自动刷新</view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import lfBarcode from '@/components/lf-code/lf-barcode.vue';
  31. import lfQrcode from '@/components/lf-code/lf-qrcode.vue';
  32. export default {
  33. components: {
  34. lfBarcode,
  35. lfQrcode
  36. },
  37. data(){
  38. return {
  39. config: {
  40. bar: {
  41. code: 'E01181016286106',
  42. color: '#000', // 条形码的颜色
  43. bgColor: '#FFFFFF', // 背景色
  44. width: 586, // 宽度
  45. height: 210 // 高度
  46. },
  47. qrc: {
  48. code: "https://weixin.qq.com/g/AwYAAHO3aO4zlasEij6bLsk4hlZd5XNFkkBmqyS55mLPFxmn5c9PaI1omqLhd24fABCD23333",
  49. size: 352, // 二维码大小
  50. level: 4, //等级 0~4
  51. bgColor: '#FFFFFF', //二维码背景色 默认白色
  52. // border: {
  53. // color: ['#8A2387', '#F27121'], //边框颜色支持渐变色
  54. // lineWidth: 3, //边框宽度
  55. // },
  56. // img: '/static/logo.png', //图片
  57. // iconSize: 40, //二维码图标的大小
  58. color: '#000000', //边框颜色支持渐变色
  59. }
  60. },
  61. timer: null,
  62. num: 90
  63. }
  64. },
  65. onLoad(){
  66. this.refreshCode();
  67. },
  68. onUnload(){
  69. if(this.timer){
  70. clearInterval(this.timer);
  71. this.timer = null;
  72. }
  73. },
  74. methods: {
  75. // rpx 转 px
  76. rpxTransformPx(num){
  77. let systemInfo = uni.getSystemInfoSync();
  78. let pxWidth = num / 750 * systemInfo.windowWidth;
  79. return pxWidth;
  80. },
  81. // 刷新code
  82. refreshCode(){
  83. if(this.timer){
  84. clearInterval(this.timer);
  85. this.timer = null;
  86. }
  87. this.timer = setInterval(() => {
  88. this.num--;
  89. if(this.num <= 0){
  90. clearInterval(this.timer);
  91. this.timer = null;
  92. this.num = 90;
  93. this.refreshCode(); // 重新执行
  94. }
  95. }, 1000);
  96. }
  97. }
  98. }
  99. </script>
  100. <style>
  101. page{
  102. overflow: hidden;
  103. }
  104. </style>
  105. <style lang="scss" scoped="scoped">
  106. .page{
  107. width: 100vw;
  108. height: 100vh;
  109. background: linear-gradient(270deg, #187B7A 0%, #2FAAA7 100%, #22A2A0 100%);
  110. position: relative;
  111. overflow: hidden;
  112. .bg-viewleft{
  113. position: absolute;
  114. left: -100rpx;
  115. top: 59rpx;
  116. width: 585rpx;
  117. height: 585rpx;
  118. border-radius: 50%;
  119. background-color: rgba(255,255,255,0.04);
  120. }
  121. .bg-viewright{
  122. position: absolute;
  123. right: -38rpx;
  124. top: 102rpx;
  125. width: 127rpx;
  126. height: 127rpx;
  127. border-radius: 50%;
  128. background-color: rgba(255,255,255,0.04);
  129. }
  130. .content{
  131. position: absolute;
  132. top: 260rpx;
  133. left: calc(50% - 343rpx);
  134. width: 686rpx;
  135. height: 986rpx;
  136. background: #FFFFFF;
  137. border-radius: 20rpx;
  138. .top{
  139. display: flex;
  140. justify-content: space-between;
  141. padding: 0 40rpx;
  142. width: 100%;
  143. box-sizing: border-box;
  144. align-items: center;
  145. margin-top: -20rpx;
  146. .avatar{
  147. width: 160rpx;
  148. height: 160rpx;
  149. border-radius: 50%;
  150. background-color: #FFFFFF;
  151. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(21, 113, 110, 0.2);
  152. border: 5rpx solid #FFFFFF;
  153. display: flex;
  154. justify-content: center;
  155. align-items: center;
  156. margin-right: 20rpx;
  157. &>image{
  158. width: 148rpx;
  159. height: 148rpx;
  160. border-radius: 50%;
  161. }
  162. }
  163. .phone{
  164. font-size: 36rpx;
  165. font-weight: bold;
  166. color: #15716E;
  167. }
  168. .card{
  169. padding: 10rpx 20rpx;
  170. &>text{
  171. font-size: 40rpx;
  172. color: #15716E;
  173. }
  174. }
  175. }
  176. .balance{
  177. font-size: 32rpx;
  178. color: #555555;
  179. text-align: center;
  180. font-weight: bold;
  181. margin-top: 60rpx;
  182. line-height: 1;
  183. }
  184. .barcode, .qrcode{
  185. display: flex;
  186. justify-content: center;
  187. margin-top: 30rpx;
  188. }
  189. .tips{
  190. font-size: 24rpx;
  191. color: #777777;
  192. text-align: center;
  193. margin-top: 30rpx;
  194. }
  195. }
  196. }
  197. </style>