my.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的' bgColor="transparent" :showback="false"></cus-header>
  4. <image class="topbg" :src="imgBase+'my_topbg.png'" mode="widthFix"></image>
  5. <view class="box">
  6. <view class="top adfacjb">
  7. <view class="top-left adfac">
  8. <view class="top-left-img">
  9. <image :src="userInfo.headUrl||(imgBase+'my_avatar.png')"></image>
  10. </view>
  11. <view class="top-left-info">
  12. <view class="top-left-info-name">{{userInfo.realName||'未登录'}}</view>
  13. <view class="top-left-info-tip" v-if="!userInfo.id" @click="handleLogin">点击立即登录</view>
  14. <view class="top-left-info-version" v-else>{{typeCfg[headData.type]||'基础版'}}</view>
  15. </view>
  16. </view>
  17. <view class="top-right">
  18. <image :src="imgBase+'my_set.png'" @click="handleTurn('/pagesMy/userSet')"></image>
  19. </view>
  20. </view>
  21. <view class="num adf">
  22. <view class="num-pre adffcac">
  23. <view class="num-pre-sz">{{headData.basicCount||0}}</view>
  24. <view class="num-pre-text">基础版次数</view>
  25. </view>
  26. <view class="num-pre adffcac">
  27. <view class="num-pre-sz">{{headData.proCount||0}}</view>
  28. <view class="num-pre-text">专业版次数</view>
  29. </view>
  30. <view class="num-pre adffcac">
  31. <view class="num-pre-sz">{{headData.teamCount||0}}</view>
  32. <view class="num-pre-text">我的团队</view>
  33. </view>
  34. </view>
  35. <view class="preill adfacjb">
  36. <view class="preill-left">深入了解支撑高价值团队的关键因素</view>
  37. <view class="preill-right" @click="handleTurn('/pagesPublish/rechargeCenter')">立即购买</view>
  38. </view>
  39. <view class="menu">
  40. <view class="menu-item adfacjb" v-for="(item,index) in menuList" :key="index" @click="handleTurn(item.path)">
  41. <view class="menu-item-left adfac">
  42. <image :src="item.img"></image>
  43. <text>{{item.title}}</text>
  44. </view>
  45. <image class="menu-item-right" :src="imgBase+'my_arrow_right.png'"></image>
  46. </view>
  47. </view>
  48. </view>
  49. <Tabbar :tabbarIndex="2"></Tabbar>
  50. </view>
  51. </template>
  52. <script>
  53. import Tabbar from '@/components/CusTabbar/index.vue'
  54. export default {
  55. components:{ Tabbar },
  56. data(){
  57. return {
  58. userInfo:{
  59. avatar:this.$imgBase+'my_avatar.png',
  60. name:''
  61. },
  62. headData:null,
  63. typeCfg:{
  64. 1:'基础版',
  65. 2:'专业版',
  66. 3:'专家版',
  67. },
  68. menuList:[
  69. {
  70. img:this.$imgBase+'my_order.png',
  71. title:'我的订单',
  72. path:'/pagesMy/order'
  73. },
  74. {
  75. img:this.$imgBase+'my_record.png',
  76. title:'推荐记录',
  77. path:'/pagesMy/recommendHistory'
  78. },
  79. {
  80. img:this.$imgBase+'my_program.png',
  81. title:'我的团队',
  82. path:'/pagesMy/team'
  83. },
  84. {
  85. img:this.$imgBase+'my_teamusers.png',
  86. title:'团队成员',
  87. path:'/pagesMy/teamUser'
  88. },
  89. {
  90. img:this.$imgBase+'my_friends.png',
  91. title:'邀请好友',
  92. path:''
  93. }
  94. ]
  95. }
  96. },
  97. onLoad(options) {
  98. if(uni.getStorageSync('userInfo')){
  99. this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
  100. this.getMyInfo(this.userInfo.id)
  101. }
  102. },
  103. methods:{
  104. getMyInfo(userId){
  105. this.$api.get(`/wx/myCount/${userId}`,this.params).then(({data:res})=>{
  106. if(res.code!==0) return this.$showToast(res.msg)
  107. this.headData = res.data;
  108. })
  109. },
  110. handleLogin(){
  111. uni.reLaunch({
  112. url:'/pages/login'
  113. })
  114. },
  115. handleTurn(url){
  116. if(!this.isLogin()) return
  117. if(!url) return
  118. uni.navigateTo({ url })
  119. },
  120. }
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. .tabPage{
  125. .topbg{
  126. width: 100%;
  127. position: absolute;
  128. left: 0;
  129. top: 0;
  130. }
  131. .box{
  132. position: relative;
  133. padding-top: 40rpx;
  134. .top{
  135. padding: 0 22rpx 0 16rpx;
  136. &-left{
  137. &-img{
  138. image{
  139. width: 128rpx;
  140. height: 128rpx;
  141. }
  142. }
  143. &-info{
  144. margin-left: 20rpx;
  145. &-name{
  146. font-family: PingFang-SC, PingFang-SC;
  147. font-weight: bold;
  148. font-size: 40rpx;
  149. color: #002846;
  150. line-height: 40rpx;
  151. }
  152. &-tip{
  153. font-family: PingFangSC, PingFang SC;
  154. font-weight: 400;
  155. font-size: 26rpx;
  156. color: #86909C;
  157. line-height: 26rpx;
  158. margin-top: 31rpx;
  159. }
  160. &-version{
  161. width: 129rpx;
  162. height: 40rpx;
  163. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/my_version_bg.png') no-repeat;
  164. background-size: 100% 100%;
  165. padding-left: 48rpx;
  166. box-sizing: border-box;
  167. font-family: PingFang-SC, PingFang-SC;
  168. font-weight: bold;
  169. font-size: 22rpx;
  170. color: #795021;
  171. line-height: 40rpx;
  172. margin-top: 24rpx;
  173. }
  174. }
  175. }
  176. &-right{
  177. image{
  178. width: 42rpx;
  179. height: 42rpx;
  180. }
  181. }
  182. }
  183. .num{
  184. margin-top: 48rpx;
  185. &-pre{
  186. width: calc(100% / 3);
  187. &-sz{
  188. font-family: D-DINCondensed, D-DINCondensed;
  189. font-weight: bold;
  190. font-size: 48rpx;
  191. color: #002846;
  192. line-height: 48rpx;
  193. }
  194. &-text{
  195. font-family: PingFangSC, PingFang SC;
  196. font-weight: 400;
  197. font-size: 26rpx;
  198. color: #86909C;
  199. line-height: 26rpx;
  200. text-align: center;
  201. margin-top: 24rpx;
  202. }
  203. }
  204. }
  205. .preill{
  206. margin-top: 49rpx;
  207. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/my_pinggu_bg.png') no-repeat;
  208. background-size: 100% 100%;
  209. padding: 34rpx 24rpx;
  210. &-left{
  211. font-family: PingFangSC, PingFang SC;
  212. font-weight: 400;
  213. font-size: 24rpx;
  214. color: #B0B7C7;
  215. line-height: 24rpx;
  216. padding-top: 42rpx;
  217. }
  218. &-right{
  219. padding: 18rpx 26rpx;
  220. background: linear-gradient( 270deg, #F0E2C7 0%, #E3CD9E 100%);
  221. border-radius: 32rpx;
  222. font-family: PingFangSC, PingFang SC;
  223. font-weight: 400;
  224. font-size: 26rpx;
  225. color: #795021;
  226. line-height: 26rpx;
  227. }
  228. }
  229. .menu{
  230. margin-top: 30rpx;
  231. background: #FFFFFF;
  232. border-radius: 16rpx;
  233. &-item{
  234. padding: 35rpx 30rpx;
  235. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  236. &-left{
  237. image{
  238. width: 40rpx;
  239. height: 40rpx;
  240. }
  241. text{
  242. font-family: PingFangSC, PingFang SC;
  243. font-weight: 400;
  244. font-size: 30rpx;
  245. color: #002846;
  246. line-height: 32rpx;
  247. margin-left: 21rpx;
  248. }
  249. }
  250. &-right{
  251. width: 36rpx;
  252. height: 36rpx;
  253. }
  254. }
  255. }
  256. }
  257. }
  258. </style>