userCenter.vue 7.1 KB

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