userCenter.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!--
  2. * @Description:
  3. * @Author: 欧阳承珺
  4. * @LastEditors: 欧阳承珺
  5. * @Date: 2022-11-01 20:18:40
  6. * @LastEditTime: 2022-11-16 10:16:06
  7. -->
  8. <template>
  9. <div class="font-primary min-w-1200px">
  10. <Navbar></Navbar>
  11. <div class="flex mt-50px px-[10%] mb-30px justify-between">
  12. <div class="w-[27%] min-w-260px px-24px pb-80px mb-20px bg-[#fafafa]">
  13. <div class="person">
  14. <div>
  15. <a href="/members/me/expenses" class="members">
  16. <img v-if="userInfo?.subscriberType === 1" src="http://user-file.17pdf.com/avatars/2020/11/16/0577b907be980556bdafa23fb0be0732-jpg.jpg" >
  17. <img v-else src="http://user-file.17pdf.com/avatars/2018/01/02/f183029426a996325853fa244e7df661-jpg.jpg" >
  18. </a>
  19. <br>
  20. <p class="username">{{userInfo?.name}}</p>
  21. <p class="user-showname block mt-16px">{{userInfo?.email || userInfo?.phone}}</p>
  22. </div>
  23. <div class="flex py-14px mt-20px justify-between text-left">
  24. <div>
  25. <p v-if="userInfo?.subscriberType === 1" class="user-vip text-18px mb-6px text-[#333] font-500 leading-24px">17会员</p>
  26. <p v-else class="text-18px text-[#333] font-500 leading-24px mb-6px">免费用户</p>
  27. <p v-if="userInfo?.subscriberType === 1" class="text-12px text-[#999] pl-28px mb-6px leading-17px">剩余<span class="text-bg-$btn-color-primary">{{userInfo?.day}}</span>天到期</p>
  28. <p v-else class="text-12px text-[#999] leading-17px">订阅会员免费格式转换</p>
  29. </div>
  30. <button class="btn-renew" @click="handlerBuy('vip')">
  31. {{userInfo?.subscriberType === 1 ? '续费' : '订阅会员'}}
  32. </button>
  33. </div>
  34. <div class="flex py-14px my-8px justify-between text-left">
  35. <div class="user-ticket">
  36. <p class="text-18px text-[#333] leading-24px mb-6px"><span class="font-500 text-bg-$btn-color-primary text-18px leading-24px tracking-1px">{{userInfo?.points}}</span><span class="text-bg-$btn-color-primary text-14px leading-18px">张</span><span class="text-14px text-[rgba(0,0,0,0.8)] leading-18px">/{{userInfo?.totalPoints}}张</span></p>
  37. <p class="text-12px text-[#999] leading-17px">转换券</p>
  38. </div>
  39. <button class="btn-recharge" @click="handlerBuy('ticket')">充值</button>
  40. </div>
  41. </div>
  42. <ul class="menus-ul">
  43. <li class="my_convert" :class="{active: $route.path === '/members/me/expenses'}">
  44. <nuxt-link to="/members/me/expenses" class='myexpenses'>我的转档</nuxt-link>
  45. </li>
  46. <li class='my_pricing' :class="{active: $route.path === '/members/me/points'}">
  47. <nuxt-link to="/members/me/points">消费记录</nuxt-link>
  48. <ul :class="{active: $route.path === '/members/me/points'}">
  49. <li >
  50. <nuxt-link :class="{active: $route.path === '/members/me/points'}" to="/members/me/points" class='mypoints'>
  51. 转换券购买
  52. </nuxt-link>
  53. </li>
  54. </ul>
  55. </li>
  56. </ul>
  57. </div>
  58. <Nuxt class="w-[70%]"></Nuxt>
  59. </div>
  60. <FooterBar></FooterBar>
  61. </div>
  62. </template>
  63. <script>
  64. import { mapState } from 'vuex'
  65. import Navbar from './components/NavBar.vue'
  66. import FooterBar from './components/FooterBar.vue'
  67. export default {
  68. components: {
  69. Navbar,
  70. FooterBar,
  71. },
  72. data() {
  73. return {
  74. }
  75. },
  76. computed: {
  77. ...mapState([
  78. 'userInfo',
  79. ]),
  80. },
  81. methods: {
  82. handlerBuy(type) {
  83. this.$store.commit('OPEN_LOGIN', true)
  84. this.$store.commit('SET_INTERFACE', type)
  85. },
  86. },
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .person{
  91. width: 100%;
  92. text-align: center;
  93. padding: 30px 0px 8px;
  94. border-bottom: 1px solid rgb(218,218,218);
  95. a.members {
  96. width: 80px;
  97. height: 80px;
  98. border-radius: 100%;
  99. box-shadow: rgba(0,0,0,0.2);
  100. display: inline-block;
  101. overflow: hidden;
  102. box-shadow: 0px 1px 4px rgba(0,0,0,0.2);
  103. img{
  104. width: 100%;
  105. height: 100%;
  106. }
  107. }
  108. .username{
  109. height: 30px;
  110. font-size: 20px;
  111. color: rgb(51,51,51);
  112. }
  113. .user-showname{
  114. height: 21px;
  115. font-size: 14px;
  116. color: rgb(153,153,153);
  117. }
  118. }
  119. .user-vip{
  120. background: url('~assets/images/common/ic_member.svg') no-repeat;
  121. background-size: 24px;
  122. padding-left: 28px;
  123. }
  124. .user-ticket {
  125. padding-left: 28px;
  126. background: url('~assets/images/common/ic_coupon.svg') no-repeat;
  127. background-size: 24px;
  128. }
  129. .menus-ul {
  130. list-style: none;
  131. font-size: 18px;
  132. padding-left: 0px;
  133. width: 100%;
  134. max-width: 250px;
  135. margin-top: 24px;
  136. li {
  137. margin-bottom: 8px;
  138. cursor: pointer;
  139. a {
  140. color: rgb(51, 51, 51);
  141. display: block;
  142. width: 100%;
  143. height: 48px;
  144. line-height: 48px;
  145. }
  146. ul {
  147. list-style: none;
  148. padding-left: 0px;
  149. display: none;
  150. &.active {
  151. display: block;
  152. }
  153. li {
  154. font-size: 16px;
  155. border: 0px !important;
  156. &:hover{
  157. a{
  158. color: rgb(255, 79, 79);
  159. }
  160. }
  161. a {
  162. color: rgb(153, 153, 153);
  163. &.active{
  164. color: rgb(255, 79, 79);
  165. }
  166. }
  167. }
  168. }
  169. }
  170. }
  171. .my_pricing{
  172. padding: 0px 32px;
  173. background: url(http://cn-file.17pdf.com/website/members/ic_sidebai_consumption_nor.png) no-repeat left 12px;
  174. &:hover{
  175. background: url(http://cn-file.17pdf.com/website/members/ic_sidebai_consumption_elect.png) no-repeat left 12px;
  176. & > a{
  177. color: #ff4f4f;
  178. }
  179. }
  180. &.active:hover{
  181. background: url(http://cn-file.17pdf.com/website/members/ic_sidebai_consumption_nor.png) no-repeat left 12px;
  182. & > a{
  183. color: rgb(51, 51, 51);
  184. }
  185. }
  186. & > a{
  187. background: url(http://cn-file.17pdf.com/website/members/ic_siderbar_cebian.png) no-repeat right 14px;
  188. }
  189. &.active > a{
  190. background: url(http://cn-file.17pdf.com/website/members/ic_siderbar_cebian_normal.png) no-repeat right 14px;
  191. }
  192. }
  193. .my_convert{
  194. padding: 0px 32px;
  195. background: url(http://cn-file.17pdf.com/website/members/ic_sidebar_conversion_nor.png) no-repeat left 12px;
  196. &:hover{
  197. background: url(http://cn-file.17pdf.com/website/members/ic_sidebar_conversion_elect.png) no-repeat left 12px;
  198. & > a{
  199. color: #ff4f4f;
  200. }
  201. }
  202. &.active{
  203. background: url(http://cn-file.17pdf.com/website/members/ic_sidebar_conversion_elect.png) no-repeat left 12px;
  204. a{
  205. color: rgb(255, 79, 79);
  206. }
  207. }
  208. }
  209. .mypoints {
  210. &.active {
  211. a {
  212. color: rgb(255, 79, 79);
  213. }
  214. }
  215. }
  216. </style>