my.vue 7.5 KB

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