my.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. }
  166. }
  167. &-info{
  168. margin-left: 20rpx;
  169. &-name{
  170. font-family: PingFang-SC, PingFang-SC;
  171. font-weight: bold;
  172. font-size: 40rpx;
  173. color: #002846;
  174. line-height: 40rpx;
  175. }
  176. &-tip{
  177. font-family: PingFangSC, PingFang SC;
  178. font-weight: 400;
  179. font-size: 26rpx;
  180. color: #86909C;
  181. line-height: 26rpx;
  182. margin-top: 31rpx;
  183. }
  184. &-version{
  185. width: 129rpx;
  186. height: 40rpx;
  187. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/my_version_bg.png') no-repeat;
  188. background-size: 100% 100%;
  189. padding-left: 48rpx;
  190. box-sizing: border-box;
  191. font-family: PingFang-SC, PingFang-SC;
  192. font-weight: bold;
  193. font-size: 22rpx;
  194. color: #795021;
  195. line-height: 40rpx;
  196. margin-top: 24rpx;
  197. }
  198. }
  199. }
  200. &-right{
  201. image{
  202. width: 42rpx;
  203. height: 42rpx;
  204. }
  205. }
  206. }
  207. .num{
  208. margin-top: 48rpx;
  209. &-pre{
  210. width: calc(100% / 3);
  211. &-sz{
  212. font-family: D-DINCondensed, D-DINCondensed;
  213. font-weight: bold;
  214. font-size: 48rpx;
  215. color: #002846;
  216. line-height: 48rpx;
  217. }
  218. &-text{
  219. font-family: PingFangSC, PingFang SC;
  220. font-weight: 400;
  221. font-size: 26rpx;
  222. color: #86909C;
  223. line-height: 26rpx;
  224. text-align: center;
  225. margin-top: 24rpx;
  226. }
  227. }
  228. }
  229. .preill{
  230. margin-top: 49rpx;
  231. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/my_pinggu_bg.png') no-repeat;
  232. background-size: 100% 100%;
  233. padding: 34rpx 24rpx;
  234. &-left{
  235. font-family: PingFangSC, PingFang SC;
  236. font-weight: 400;
  237. font-size: 24rpx;
  238. color: #B0B7C7;
  239. line-height: 24rpx;
  240. padding-top: 42rpx;
  241. }
  242. &-right{
  243. padding: 18rpx 26rpx;
  244. background: linear-gradient( 270deg, #F0E2C7 0%, #E3CD9E 100%);
  245. border-radius: 32rpx;
  246. font-family: PingFangSC, PingFang SC;
  247. font-weight: 400;
  248. font-size: 26rpx;
  249. color: #795021;
  250. line-height: 26rpx;
  251. }
  252. }
  253. .menu{
  254. margin-top: 30rpx;
  255. background: #FFFFFF;
  256. border-radius: 16rpx;
  257. &-item{
  258. padding: 35rpx 30rpx;
  259. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  260. &-left{
  261. image{
  262. width: 40rpx;
  263. height: 40rpx;
  264. }
  265. text{
  266. font-family: PingFangSC, PingFang SC;
  267. font-weight: 400;
  268. font-size: 30rpx;
  269. color: #002846;
  270. line-height: 32rpx;
  271. margin-left: 21rpx;
  272. }
  273. }
  274. &-right{
  275. width: 36rpx;
  276. height: 36rpx;
  277. }
  278. }
  279. }
  280. }
  281. }
  282. </style>