my.vue 7.6 KB

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