card.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <view>
  3. <view class="view1">
  4. <view class="cardView">
  5. <u-row>
  6. <u-col span="5">
  7. <view class="lableStyle">
  8. 卡片编号:
  9. </view>
  10. </u-col>
  11. <u-col span="7">
  12. <view class="cardNoValue">
  13. {{cardInfo.cardCode}}
  14. </view>
  15. </u-col>
  16. </u-row>
  17. <u-row>
  18. <u-col span="5">
  19. <view class="lableStyle">
  20. 当前积分:
  21. </view>
  22. </u-col>
  23. <u-col span="7">
  24. <view class="integralValue">
  25. {{cardInfo.integral}}
  26. </view>
  27. </u-col>
  28. </u-row>
  29. </view>
  30. </view>
  31. <view class="view2">
  32. <u--text class="payMode1" text="所属机构" :size="26" bold block></u--text>
  33. <u--text class="payMode2" :text="cardInfo.orgName" :size="18" bold color="#b4b4b4"></u--text>
  34. </view>
  35. <view class="view3">
  36. <view class="payCodeView">
  37. <u--image :showLoading="true" :src="imgSrc"></u--image>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. cardInfo: {
  47. cardCode: '',
  48. integral: '',
  49. orgName: '',
  50. },
  51. imgSrc: "../../static/uview/willalpImg/750x560-.png",
  52. from: {
  53. userName: uni.getStorageSync('userInfo').userName,
  54. organizationCode: uni.getStorageSync('orgInfo').organizationCode,
  55. }
  56. }
  57. },
  58. onLoad() {
  59. this.getCardInfo()
  60. },
  61. methods: {
  62. async getCardInfo() {
  63. const orgInfo = uni.getStorageSync("orgInfo")
  64. this.from.organizationName = orgInfo.organizationName
  65. this.from.userName = uni.getStorageSync('userInfo').userName
  66. this.from.organizationCode = orgInfo.organizationCode
  67. // 发送请求
  68. const {
  69. data: res
  70. } = await this.$httpRequest({
  71. url: '/app/getCardInfo',
  72. data: this.from,
  73. urlType: this.$getUrlType()
  74. });
  75. if (res.code === 200) {
  76. if (!res.data.cardCode) {
  77. uni.showToast({
  78. duration: 2000,
  79. title: '没有绑定卡片',
  80. icon: 'error'
  81. });
  82. setTimeout(() => {
  83. this.$goBack()
  84. }, 1000)
  85. return;
  86. }
  87. this.cardInfo.cardCode = res.data.cardCode
  88. this.cardInfo.integral = uni.getStorageSync('userInfo').integral
  89. }
  90. }
  91. }
  92. }
  93. </script>
  94. <style>
  95. .view1 {
  96. margin: 0 10px;
  97. border-radius: 10px 10px 0 0;
  98. padding: 5%;
  99. padding-bottom: 30px;
  100. background: linear-gradient(to bottom right, #89c7c5, #f1fef9);
  101. }
  102. .view2 {
  103. margin: 0 10px;
  104. border-radius: 0 0 20px 20px;
  105. background-color: #f1f1f1;
  106. }
  107. .view3 {
  108. border-radius: 20px;
  109. display: flex;
  110. flex-direction: row;
  111. justify-content: center;
  112. margin: 10px 10px;
  113. padding: 5px;
  114. background-color: #eaeaea;
  115. }
  116. .lableStyle {
  117. color: #555555;
  118. font-size: 26px;
  119. font-weight: bold;
  120. }
  121. .cardNoValue {
  122. color: #555555;
  123. font-size: 26px;
  124. font-weight: bold;
  125. }
  126. .integralValue {
  127. color: #ff6c6c;
  128. font-size: 26px;
  129. font-weight: bold;
  130. }
  131. .cardView {
  132. /* padding: 10px;
  133. height: 40%;
  134. display: flex;
  135. flex-direction: row;
  136. justify-content: center; */
  137. }
  138. .sxButton {
  139. width: 100px;
  140. display: flex;
  141. flex-direction: column;
  142. align-items: center;
  143. }
  144. .payMode1 {
  145. padding: 10px 0 5px 30px;
  146. }
  147. .payMode2 {
  148. padding: 5px 0 15px 30px;
  149. }
  150. </style>