userCenter.vue 6.9 KB

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