my.vue 7.8 KB

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