index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <view class="my-box">
  3. <my-nav @navHeight="setNavHeight"></my-nav>
  4. <view class="my-data" :style="{'height':'calc(100vh - '+navHeight+'rpx)'}">
  5. <scroll-view :scroll-y="true" :style="{'height':'calc(100vh - '+navHeight+'rpx)'}" @scrolltolower="scrolltolower">
  6. <view class="my-item">
  7. <view class="my-content">
  8. <view class="content-basic">
  9. <view class="basic-left" @click="goToUrl(1)">
  10. <image class="basic-img" :src="memberInfo.avatar" mode="aspectFill"></image>
  11. </view>
  12. <view class="basic-right">
  13. <view @click="goToUrl(1)" class="basic-name">
  14. <view class="name-text sys-color-black-0 sys-weight-600">{{memberInfo.nickname}}</view>
  15. <view class="name-vip" v-show="memberInfo.vipLevel" >
  16. <image class="name-img" v-if="memberInfo.vipLevel==='VIP1'" src="/static/img/my/vip.png" mode="heightFix"></image>
  17. <image class="name-img" v-else src="/static/img/my/svip.png" mode="heightFix"></image>
  18. </view>
  19. <view class="name-ok " :class="{'name-no':memberInfo.verified===false}">
  20. <image class="name-img" src="/static/img/my/open.png" mode="heightFix"></image>
  21. </view>
  22. </view>
  23. <view @click="goToUrl(1)" class="basic-signature sys-color-gray-9">
  24. {{memberInfo.slogan}}
  25. </view>
  26. <view class="basic-wallet">
  27. <view class="wallet-item" @click="goToUrl(2)">
  28. <image class="wallet-img" src="/static/img/my/wallet.png" mode="aspectFill"></image>
  29. <view class="wallet-text sys-color-gray-6">钱包</view>
  30. </view>
  31. <view class="wallet-item" @click="goToUrl(3)">
  32. <view class="wallet-text sys-color-gray-6">波点兑换</view>
  33. <image class="exchange-img" src="/static/img/my/right.png" mode="aspectFill"></image>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="content-statistics">
  39. <view class="statistics-item" @click="goToUrl(4)" v-if="false">
  40. <view class="statistics-num sys-color-black sys-weight-600">{{memberInfo.mylikeCount}}
  41. <view class="statistics-dot sys-color-white" v-show="memberInfo.newMylikeCount>0">{{memberInfo.newMylikeCount>99?'..':memberInfo.newMylikeCount}}</view>
  42. </view>
  43. <view class="statistics-text sys-color-gray-9 sys-weight-400">礼物墙</view>
  44. </view>
  45. <view class="statistics-item" @click="goToUrl(5)">
  46. <view class="statistics-num sys-color-black sys-weight-600">{{memberInfo.mylikeCount}}
  47. <view class="statistics-dot sys-color-white" v-show="memberInfo.newMylikeCount>0">{{memberInfo.newMylikeCount>99?'..':memberInfo.newMylikeCount}}</view>
  48. </view>
  49. <view class="statistics-text sys-color-gray-9 sys-weight-400">心动足迹</view>
  50. </view>
  51. <view class="statistics-item" @click="goToUrl(6)">
  52. <view class="statistics-num sys-color-black sys-weight-600">{{memberInfo.guestCount}}
  53. <view class="statistics-dot sys-color-white" v-show="memberInfo.newGuestCount>0">{{memberInfo.newGuestCount>99?'..':memberInfo.newGuestCount}}</view>
  54. </view>
  55. <view class="statistics-text sys-color-gray-9 sys-weight-400">访客</view>
  56. </view>
  57. <view class="statistics-item" @click="goToUrl(7)">
  58. <view class="statistics-num sys-color-black sys-weight-600">
  59. {{memberInfo.admireCount}}
  60. <view class="statistics-dot sys-color-white" v-show="memberInfo.newAdmireCount>0">{{memberInfo.newAdmireCount>99?'..':memberInfo.newAdmireCount}}</view>
  61. </view>
  62. <view class="statistics-text sys-color-gray-9 sys-weight-400">谁喜欢我</view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="vip-content">
  67. <view class="vip-data">
  68. <view class="vip-left">
  69. <view class="vip-left-one">
  70. <image class="vip-left-img" src="/static/img/my/crown.png" mode="aspectFill"></image>
  71. <view class="vip-left-vip sys-weight-600">VIP</view>
  72. <view class="vip-left-text sys-weight-500">首季195元</view>
  73. </view>
  74. <view class="vip-left-two">
  75. 22.7元/月解锁9项高级特权
  76. </view>
  77. </view>
  78. <view class="vip-right">
  79. 立即开通
  80. </view>
  81. </view>
  82. <view class="vip-discounts sys-color-white sys-weight-600">
  83. 立减99元
  84. </view>
  85. </view>
  86. <view class="subscription sys-color-gray-9">
  87. 自动订阅,随时取消;付款费用将记入itunes账户;到期前24小时会自动扣费并续订
  88. 服务,购买后可随时前往iTunse商店设置页面取消订 阅。点击购买即表示同意《用
  89. 户服务协议》《连续包月协议》 《用户隐私政策》
  90. </view>
  91. <view class="my-tag">
  92. <view class="tag-item" @click="setTagNum(0)" :class="{'tag-pitch':tagNum===0}">动态</view>
  93. <view class="tag-item" @click="setTagNum(1)" :class="{'tag-pitch':tagNum===1}">赞过</view>
  94. <!-- <view class="tag-item" @click="setTagNum(2)" :class="{'tag-pitch':tagNum===2}">活动</view>-->
  95. </view>
  96. </view>
  97. <view class="halving-line"></view>
  98. <view class="my-item">
  99. <view class="my-dynamic" v-if="tagNum===0">
  100. <dynamic-items :type="2" text-color="#141414" operate-color="#999999" tag-color="#999999" tag-bg="#F2F2F2" division-color="#F2F2F2" :show-add="true" ref="dynamicObj"></dynamic-items>
  101. </view>
  102. <view class="my-praise" v-else>
  103. <my-praise ref="praiseObj"></my-praise>
  104. </view>
  105. </view>
  106. </scroll-view>
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. import MyNav from "@/pages/my/model/my-nav";
  112. import DynamicItems from "@/pages/common/dynamic/dynamic-items";
  113. import MyPraise from "@/pages/my/model/my-praise";
  114. import {getMemberInfo,getUserVip,buyVip} from "@/api/my";
  115. export default {
  116. components: {MyPraise, DynamicItems, MyNav},
  117. data() {
  118. return {
  119. navHeight:0,
  120. tagNum:0,
  121. memberInfo:{
  122. admireCount:'',
  123. nickname:'',
  124. }
  125. }
  126. },
  127. mounted() {
  128. this.getUserVip()
  129. },
  130. onLoad(query) {
  131. this.getMemberInfo()
  132. },
  133. methods: {
  134. getUserVip(){
  135. getUserVip().then((res)=>{
  136. console.log(res);
  137. })
  138. },
  139. scrolltolower(){
  140. if(this.tagNum===0){
  141. this.$refs.dynamicObj.getMyMoments()
  142. }else {
  143. this.$refs.praiseObj.getMyLikeMoments()
  144. }
  145. },
  146. getMemberInfo(){
  147. getMemberInfo().then((res)=>{
  148. console.log(res)
  149. if(res.code===0){
  150. this.memberInfo=res.data
  151. }else {
  152. uni.reLaunch({
  153. 'url':'/pages/login/index'
  154. })
  155. }
  156. })
  157. },
  158. setNavHeight(navHeight){
  159. this.navHeight=navHeight
  160. },
  161. setTagNum(tagNum){
  162. if(this.tagNum!==tagNum){
  163. this.tagNum=tagNum
  164. }
  165. },
  166. goToUrl(type){
  167. if(type===1){
  168. uni.navigateTo({
  169. 'url':'./editInformation'
  170. })
  171. }else if(type === 2){
  172. // 钱包
  173. uni.navigateTo({
  174. 'url':'/pages/wallet/wallet'
  175. })
  176. }else if(type === 3){
  177. // 波点兑换
  178. uni.navigateTo({
  179. 'url':'/pages/wallet/wave-point'
  180. })
  181. }else if(type === 4){
  182. // 礼物墙
  183. uni.navigateTo({
  184. 'url':'/pages/wallet/gift-wall'
  185. })
  186. }else if(type === 5){
  187. // 喜欢的人
  188. uni.navigateTo({
  189. 'url':'/pages/wallet/like-user?isUrlType=1'
  190. })
  191. }else if(type === 6){
  192. // 喜欢的人
  193. uni.navigateTo({
  194. 'url':'/pages/wallet/visitor'
  195. })
  196. }else if(type === 7){
  197. // 喜欢我的人
  198. uni.navigateTo({
  199. 'url':'/pages/wallet/like-me'
  200. })
  201. }
  202. }
  203. }
  204. }
  205. </script>
  206. <style scoped lang="scss">
  207. .my-box{
  208. background-image: url("/static/img/my/bg.png");
  209. background-repeat: no-repeat;//不平铺
  210. background-position: top center;//居中
  211. background-size: contain;//随容器大小
  212. height: calc(100vh - 50px - env(safe-area-inset-bottom));
  213. .my-data{
  214. background-color: #fff;
  215. border-radius: 30rpx 30rpx 0 0;
  216. padding: 40rpx 0 10rpx 0;
  217. .my-item{
  218. padding: 0 32rpx ;
  219. }
  220. .halving-line{
  221. background-color: #F2F2F2;
  222. height: 1rpx;
  223. }
  224. .my-content{
  225. .content-basic{
  226. display: flex;
  227. justify-content: space-between;
  228. height: 168rpx;
  229. .basic-left{
  230. .basic-img{
  231. border-radius: 50%;
  232. width: 168rpx;
  233. height: 168rpx;
  234. }
  235. }
  236. .basic-right{
  237. width: calc(100% - 168rpx);
  238. padding-left: 24rpx;
  239. .basic-name{
  240. display: flex;
  241. justify-content: flex-start;
  242. height: 56rpx;
  243. align-items: center;
  244. .name-text{
  245. font-size: 40rpx;
  246. line-height: 56rpx;
  247. }
  248. .name-img{
  249. height: 28rpx;
  250. }
  251. .name-vip{
  252. margin-left: 8rpx;
  253. }
  254. .name-ok{
  255. margin-left: 8rpx;
  256. }
  257. .name-no{
  258. filter: grayscale(100%);
  259. }
  260. }
  261. .basic-signature{
  262. width: 100%;
  263. display: -webkit-box;
  264. -webkit-line-clamp: 1;
  265. -webkit-box-orient: vertical;
  266. overflow: hidden;
  267. font-size: 28rpx;
  268. height: 40rpx;
  269. line-height: 40rpx;
  270. }
  271. .basic-wallet{
  272. display: flex;
  273. justify-content: flex-start;
  274. margin-top: 24rpx;
  275. .wallet-item{
  276. padding: 0 16rpx;
  277. height: 40rpx;
  278. background: #F2F2F2;
  279. border-radius: 200rpx;
  280. display: flex;
  281. justify-content: center;
  282. align-items: center;
  283. margin-right: 20rpx;
  284. .wallet-text{
  285. height: 40rpx;
  286. line-height: 40rpx;
  287. font-size: 26rpx;
  288. }
  289. .wallet-img{
  290. width: 40rpx;
  291. height: 40rpx;
  292. margin-right: 4rpx;
  293. }
  294. .exchange-img{
  295. width: 24rpx;
  296. height: 24rpx;
  297. margin-left: 4rpx;
  298. }
  299. }
  300. }
  301. }
  302. }
  303. .content-statistics{
  304. margin-top: 24rpx;
  305. padding: 16rpx 40rpx 0 40rpx;
  306. display: flex;
  307. justify-content: space-between;
  308. .statistics-item{
  309. .statistics-num{
  310. position: relative;
  311. display: flex;
  312. justify-content: center;
  313. font-size: 40rpx;
  314. .statistics-dot{
  315. position: absolute;
  316. top: -16rpx;
  317. right: -12rpx;
  318. border-radius: 200rpx;
  319. width: 24rpx;
  320. height: 24rpx;
  321. line-height: 24rpx;
  322. text-align: center;
  323. font-size: 18rpx;
  324. background-color: #ED301D;
  325. }
  326. }
  327. .statistics-text{
  328. margin-top: 8rpx;
  329. font-size: 26rpx;
  330. }
  331. }
  332. }
  333. }
  334. .vip-content{
  335. margin-top: 66rpx;
  336. border-radius: 20rpx;
  337. background: linear-gradient(137deg, #FED18E 0%, #FFDFA4 100%);
  338. //height: 118rpx;
  339. padding: 34rpx 30rpx 40rpx 28rpx;
  340. position: relative;
  341. .vip-data{
  342. display: flex;
  343. justify-content: space-between;
  344. align-items: center;
  345. .vip-left{
  346. .vip-left-one{
  347. display: flex;
  348. justify-content: flex-start;
  349. align-items: center;
  350. height: 64rpx;
  351. .vip-left-img{
  352. width: 64rpx;
  353. height: 64rpx;
  354. margin-right: 10rpx;
  355. }
  356. .vip-left-vip{
  357. font-size: 44rpx;
  358. background: linear-gradient(355deg, #6A4420 0%, #94673D 100%);
  359. -webkit-text-fill-color: transparent;
  360. -webkit-background-clip: text;
  361. margin-right: 12rpx;
  362. height: 64rpx;
  363. line-height: 64rpx;
  364. }
  365. .vip-left-text{
  366. font-size: 36rpx;
  367. height: 64rpx;
  368. line-height: 64rpx;
  369. color: #6A4420;
  370. }
  371. }
  372. .vip-left-two{
  373. margin-top: 10rpx;
  374. height: 44rpx;
  375. line-height: 44rpx;
  376. font-size: 28rpx;
  377. color: #925C29;
  378. font-weight: 400;
  379. }
  380. }
  381. .vip-right{
  382. border-radius: 200rpx;
  383. padding: 10rpx 24rpx;
  384. background: #6A4420;
  385. height: 40rpx;
  386. line-height: 40rpx;
  387. font-size: 28rpx;
  388. font-weight: 600;
  389. color: #FFDDA1;
  390. }
  391. }
  392. .vip-discounts{
  393. background: linear-gradient(270deg, #FE2315 0%, #FE6915 100%);
  394. border-radius: 0 20rpx 0 20rpx;
  395. height: 40rpx;
  396. line-height: 40rpx;
  397. padding: 0 16rpx;
  398. font-size: 24rpx;
  399. position:absolute;
  400. top: 0;
  401. right: 0;
  402. }
  403. }
  404. .subscription{
  405. margin-top: 36rpx;
  406. font-size: 18rpx;
  407. }
  408. .my-tag{
  409. margin-top: 36rpx;
  410. padding-bottom: 30rpx;
  411. display: flex;
  412. justify-content: space-around;
  413. .tag-item{
  414. height: 44rpx;
  415. line-height: 44rpx;
  416. font-size: 32rpx;
  417. color: #999;
  418. font-weight: 500;
  419. transition: .5s ease;
  420. }
  421. .tag-pitch{
  422. color: #141414;
  423. font-weight: 600;
  424. transition: .5s ease;
  425. }
  426. }
  427. }
  428. }
  429. </style>