cardBagNew.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view>
  3. <ujp-navbar title="我的卡包"></ujp-navbar>
  4. <view class="tabs">
  5. <view class="tag">
  6. 1
  7. </view>
  8. <u-tabs bar-width="80" active-color="#333333" inactive-color="#999999" :list="list" :is-scroll="false"
  9. :current="current" @change="change"></u-tabs>
  10. </view>
  11. <!-- 未激活 -->
  12. <view class="nonactivated" v-if="current==0">
  13. <view class="card-box">
  14. <img src="@/assets/img/halfoff.png" alt="">
  15. <view class="text">
  16. 可用4500度(有效期365天)
  17. </view>
  18. <img class="corner-mark" src="@/assets/img/nonactivated.png" alt="">
  19. </view>
  20. </view>
  21. <!-- 生效中 -->
  22. <view class="active" v-if="current==1">
  23. <!-- 企业会员 -->
  24. <view class="corporate-member">
  25. <view class="icon">
  26. <img src="@/assets/img/corporateMember.png" alt="">
  27. </view>
  28. <view class="member-details">
  29. <view class="member-name">
  30. 企业会员
  31. </view>
  32. <view class="company-name">
  33. 湖北荆鹏软件开发有限公司
  34. </view>
  35. <view class="balance">
  36. 企业账户余额:4001.92元
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 六折卡 -->
  41. <view class="card-box">
  42. <img src="@/assets/img/0.6off.png" alt="">
  43. <view class="progress">
  44. <view class="time">
  45. 2023.09.16到期 | 剩余29天
  46. </view>
  47. <view class="electric-quantity">
  48. 已用119度 / 共338度
  49. </view>
  50. </view>
  51. <ujp-line-progress active-color="#2979ff" :percent="60"></ujp-line-progress>
  52. </view>
  53. <view class="card-box">
  54. <img src="@/assets/img/halfoff.png" alt="">
  55. <view class="progress">
  56. <view class="time">
  57. 2023.09.16到期 | 剩余29天
  58. </view>
  59. <view class="electric-quantity">
  60. 已用119度 / 共338度
  61. </view>
  62. </view>
  63. <ujp-line-progress active-color="#2979ff" :percent="60"></ujp-line-progress>
  64. </view>
  65. <view class="card-box">
  66. <img src="@/assets/img/monthCard.png" alt="">
  67. <view class="progress">
  68. <view class="time">
  69. 2023.09.16到期 | 剩余29天
  70. </view>
  71. </view>
  72. <ujp-line-progress active-color="#2979ff" :percent="60"></ujp-line-progress>
  73. </view>
  74. </view>
  75. <!-- 已过期 -->
  76. <view class="have-expired" v-if="current==2">
  77. <view class="card-box">
  78. <img src="@/assets/img/haveExpired.png" alt="">
  79. <view class="progress">
  80. <view class="time">
  81. 2023.09.16到期 | 剩余29天
  82. </view>
  83. <view class="electric-quantity">
  84. 已用119度 / 共338度
  85. </view>
  86. </view>
  87. <ujp-line-progress active-color="#2979ff" :percent="0"></ujp-line-progress>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. export default {
  94. data() {
  95. return {
  96. list: [{
  97. name: '未激活'
  98. },
  99. {
  100. name: '生效中'
  101. }, {
  102. name: '已过期'
  103. }
  104. ],
  105. current: 0,
  106. }
  107. },
  108. methods: {
  109. change(index) {
  110. this.current = index;
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .tabs{
  117. position: relative !important;
  118. .tag{
  119. width: 32rpx;
  120. height: 32rpx;
  121. line-height: 32rpx;
  122. background-color: rgba(238, 49, 56, 1);
  123. color: rgba(255, 255, 255, 1);
  124. font-size: 24rpx;
  125. text-align: center;
  126. border-radius: 999px;
  127. position: absolute;
  128. top: 24rpx;
  129. left:190rpx;
  130. }
  131. }
  132. // 未激活
  133. .nonactivated {
  134. padding: 0 32rpx;
  135. .card-box {
  136. border-radius: 12px;
  137. background-color: rgba(55, 59, 80, 1);
  138. margin-top: 24rpx;
  139. padding: 32rpx;
  140. position: relative;
  141. img {
  142. width: 262rpx;
  143. height: 56rpx;
  144. }
  145. .text {
  146. font-size: 24rpx;
  147. color: rgba(219, 219, 219, 1);
  148. }
  149. .corner-mark {
  150. width: 112rpx;
  151. height: 112rpx;
  152. position: absolute;
  153. top: 0;
  154. right: 0;
  155. }
  156. }
  157. }
  158. // 生效中
  159. .active {
  160. padding: 0 32rpx;
  161. // 企业会员
  162. .corporate-member {
  163. border-radius: 12px;
  164. background-color: rgba(55, 59, 80, 1);
  165. margin-top: 24rpx;
  166. padding: 32rpx;
  167. display: flex;
  168. .icon {
  169. width: 80rpx;
  170. height: 80rpx;
  171. img {
  172. width: 100%;
  173. }
  174. }
  175. .member-details {
  176. margin-left: 16rpx;
  177. .member-name {
  178. color: rgba(255, 255, 255, 1);
  179. font-size: 32rpx;
  180. }
  181. .company-name {
  182. color: rgba(204, 204, 204, 1);
  183. font-size: 24rpx;
  184. margin-top: 8rpx;
  185. }
  186. .balance {
  187. color: rgba(219, 219, 219, 1);
  188. font-size: 24rpx;
  189. margin-top: 14rpx;
  190. }
  191. }
  192. }
  193. // 六折卡
  194. .card-box {
  195. border-radius: 12px;
  196. background-color: rgba(55, 59, 80, 1);
  197. padding: 20rpx 24rpx;
  198. margin-top: 24rpx;
  199. img {
  200. width: 262rpx;
  201. height: 56rpx;
  202. }
  203. .progress {
  204. display: flex;
  205. justify-content: space-between;
  206. color: rgba(219, 219, 219, 1);
  207. font-size: 24rpx;
  208. margin-bottom: 16rpx;
  209. }
  210. /deep/.u-active {
  211. background: linear-gradient(84.49deg, rgba(59, 182, 254, 1) 4.25%, rgba(0, 185, 98, 1) 95.02%);
  212. }
  213. }
  214. }
  215. // 已过期
  216. .have-expired{
  217. padding: 0 32rpx;
  218. .card-box {
  219. border-radius: 12px;
  220. background-color: rgba(156, 157, 161, 1);
  221. padding: 20rpx 24rpx;
  222. margin-top: 24rpx;
  223. img {
  224. width: 262rpx;
  225. height: 56rpx;
  226. }
  227. .progress {
  228. display: flex;
  229. justify-content: space-between;
  230. color: #fff;
  231. font-size: 24rpx;
  232. margin-bottom: 16rpx;
  233. }
  234. /deep/.u-active {
  235. background: linear-gradient(84.49deg, rgba(59, 182, 254, 1) 4.25%, rgba(0, 185, 98, 1) 95.02%);
  236. }
  237. }
  238. }
  239. </style>