123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- <template>
- <!-- title="我的" -->
- <view class="full-container">
- <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()"
- color="#000000" fixed="true" :border="false">
- <!-- <view slot="left">
- <view class=" flex align-center margin-left">
- <image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
- </view>
- </view> -->
- <view slot="right">
- <!-- <view class="flex justify-center align-center"
- style="margin-left: 220rpx; ">
- <view class="flex align-center" style="margin-right: 40rpx; padding: 0 18px; height: 56rpx; background-color: rgba(183,183,183,0.33); border-radius: 13.5px;">
- <image class="png-more" style="margin-right: 16rpx;"
- src="/static/common/sideBar/sGold.png"></image>
- <view class="text-14px" style="line-height: 28rpx;">{{cGold}}</view>
- </view>
- <view class="flex align-center" style="padding: 0 18px; height: 56rpx; background-color: rgba(183,183,183,0.33); border-radius: 13.5px;">
- <image class="png-more" style="margin-right: 16rpx; "
- src="/static/common/sideBar/sDiamond.png"></image>
- <view class="text-14px" style="line-height: 28rpx;">{{cDiamond}}</view>
- </view>
- </view> -->
-
- <view class="flex justify-center align-center" style="margin-right: 400rpx;">
- <view class="flex align-center justify-between"
- style="margin-right: 40rpx; padding: 0 16rpx; height: 56rpx; background-color: rgba(183,183,183,0.33); border-radius: 13.5px;">
- <image class="png-more" style="margin-right: 16rpx;"
- src="/static/common/sideBar/sGold.png">
- </image>
- <view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cGold}}</view>
- </view>
- <view class="flex align-center justify-between"
- style="padding: 0 16rpx; height: 56rpx; background-color: rgba(183,183,183,0.33); border-radius: 13.5px;">
- <image style="margin-right: 16rpx; width: 38rpx; height: 34rpx; "
- src="/static/common/sideBar/sDiamond.png">
- </image>
- <view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cDiamond}}</view>
- </view>
- </view>
- </view>
-
- </uni-nav-bar>
- <!-- <view class="cu-bar ">
- <view class="action">
- </view>
- <view class="action">
- <text class="text-df text-purple" @tap="onNavUser">编辑</text>
- </view>
- </view> -->
- <image class="bg-image" src="../../../static/loginBg.png" mode="aspectFill"></image>
-
- <scroll-view :style="{ height: scrollviewHight + 'px' }" scroll-y="true">
- <view class="card-view flex align-center " style="position: relative; margin-top: 113px;">
- <view class="avatar-size">
- <image class="avatar-img round" :src="avatarUrl"></image>
- </view>
- <view class="avatar-group text-upload">
- <view class="text-lg flex justify-between align-center justify-center">
- <text class="text-black text-bold">{{userName}}</text>
- <view style="width: 126rpx;height: 50rpx; position: relative;" class="flex align-center justify-center" >
- <image style="height: 50rpx; width: 100%;" src="/static/bg-days.png"></image>
- <text class="text-white text-13px" style="line-height: 50rpx; position: absolute;top: 3rpx;right: 10rpx;">{{days}}天</text>
- </view>
- </view>
- <!-- <view class="text-xs padding-top">
- <text class="text-black">{{days}}</text>
- </view> -->
- <view class="text-gray padding-top">{{signature}}</view>
- </view>
-
- <view class="only-arrow" @tap="onNavUser"></view>
-
- </view>
-
- <view class="card-view flex align-center " style="position: relative; height: 132rpx; margin-top: 8px;">
- <image class="achievement-img round" src="../../../static/achievement/11-07@2x.png"></image>
- <view class="text-lg flex justify-between align-center justify-center">
- <text class="text-gray text-14px">我的成就</text>
- </view>
- <view class="only-arrow" @tap="onNavAchievement"></view>
-
- </view>
-
- <view class="card-view article ">
- <view class="title">
- 最近在玩
- </view>
- <view class="cu-item shadow">
- <view class="cu-form-group margin-top">
- <view v-if="playGames.length!=0" class="grid col-3 homepage-grid-square flex-sub ">
- <view v-for="(item,index) in playGames" :key="index" v-if="index<6" @tap="onViewImage(item)">
- <image class="item-img" :src="item.gameIcon" mode="aspectFill"></image>
- <view class="border text-center text-cut">{{item.gameName}}</view>
- </view>
- </view>
- <view v-else class="text-center text-gray" :style="{width:'100%'}">去玩吧~</view>
- <view v-if="playGames.length!=0" class="homepage-arrow" @tap="onNavList('recently')"></view>
- </view>
- </view>
- </view>
- <view v-if="favoriteGames.length==0" class="card-view flex align-center">
- <view class="content flex flex-direction align-start margin-top">
- <view class="title">关注</view>
- <view class="text-grey" style="margin: 0rpx 40rpx 40rpx;">有好多好玩的视频等着你关注哦</view>
- </view>
- <view class=" margin-sm button-fav " @tap="onGoToFollow">
- <image style="width: 21px;height: 21px; margin-right: 12rpx;" src="../../../static/add_w.png"></image>
- 去关注
- </view>
- </view>
- <view v-else class="card-view article">
- <view class="title">
- 已关注的
- </view>
- <view class="cu-item shadow">
- <view class="cu-form-group margin-top">
- <view v-if="favoriteGames.length!=0" class="grid col-3 homepage-grid-square flex-sub ">
- <view class="text-center " v-for="(item,index) in favoriteGames" :key="index" v-if="index<6" @tap="onViewImage(item)">
- <image class="item-img" :src="item.gameIcon" mode="aspectFill"></image>
- <view class="border text-cut">{{item.gameName}}</view>
- </view>
- </view>
- <view v-else class="text-center text-gray" :style="{width:'100%'}">去关注更多的游戏吧~</view>
- <view v-if="favoriteGames.length!=0" class="homepage-arrow" @tap="onNavList('watchGame')"></view>
- </view>
- </view>
- </view>
-
- <view class="homepage-action-row">
- <view class=" ">哔蹦</view>
- <view class="text-bold text-decoration" style="
- color: #007AFF; border-bottom: solid 1rpx #007AFF;" @tap="onSwitchAgree('agreement')">用户协议</view>
- <view class=" ">和</view>
- <view class="text-bold text-decoration" style="
- color: #007AFF; border-bottom: solid 1rpx #007AFF;" @tap="onSwitchAgree('privacy')">隐私政策</view>
- </view>
- </scroll-view>
-
-
- </view>
- </template>
- <script>
- import config from '../../../common/config.js';
- import reqUtil from "@/util/util-js/requstUtil.js";
- import {
- mapState
- } from 'vuex'
- export default {
- computed: mapState(['forcedLogin', 'hasLogin', 'userName', 'avatarUrl', 'playGames', 'favoriteGames', 'days',
- 'signature','platform','gamePlatform','cGold','cDiamond',
- 'systemInfo','navHeight','tabbarHeight',
- ]),
- data() {
- return {
- scrollviewHight:0
- }
- },
- onLoad() {
- let that = this;
- reqUtil.requestData(config.URL.RECENTLYPLAYINGGETBYPLATFORM).then(res => {
- console.log('RECENTLYPLAYINGGETBYPLATFORM =====', res);
- if (res.code == 0) {
- that.$store.state.playGames = res.data.gameList;
- }
- },
- e => {
- console.log(e)
- });
- reqUtil.requestData(config.URL.FAVORITESGETBYPLATFORM).then(res => {
- console.log('FAVORITESGETBYPLATFORM =====', res);
- if (res.code == 0) {
- that.$store.state.favoriteGames = res.data.gameList;
- }
- },
- e => {
- console.log(e)
- });
- },
- onReady() {
- let phoneHeight = this.systemInfo.windowHeight;
- // 计算组件的高度
- this.scrollviewHight = phoneHeight - this.navHeight - this.tabbarHeight - this.systemInfo.statusBarHeight;
- },
- methods: {
- onViewImage(item) {
- let temItem = encodeURIComponent(JSON.stringify(item));
- uni.navigateTo({
- url: "../../game-page/game-detail/game-detail?item=" + temItem
- })
- },
- onNavUser() {
- uni.navigateTo({
- url: '../userInfo/userInfo'
- });
- },
- onNavAchievement(){
- uni.navigateTo({
- url: '../achievement/achievement'
- });
- },
- onNavList(type) {
- if (type == "recently" && this.playGames.length == 0) {
- uni.showModal({
- title: "提示",
- content: "没有最近在玩的游戏数据"
- })
- return;
- } else if (type == "watchGame" && this.favoriteGames.length == 0) {
- uni.showModal({
- title: "提示",
- content: "没有关注的游戏数据"
- })
- return;
- }
- uni.navigateTo({
- url: '../../personal-page/list/list?type='+type
- });
- },
- onGoToFollow() {
- // uni.showModal({
- // title: "提示",
- // content: "功能尚未开放"
- // })
- uni.switchTab({
- url: '../../game-page/game-video/game-video'
- });
- },
- onBack(){
- uni.navigateBack({
- delta:1
- })
- },
- onSwitchAgree(data) {
- uni.navigateTo({
- url: "../../login-page/userAgreement/userAgreement?type=" + data
- })
- },
- }
- }
- </script>
- <style>
- .avatar-group {
- display: flex;
- flex-direction: column;
- /* justify-content: center; */
- /* align-items: center; */
- text-align: start;
- background-color: #FFFFFF;
- display: block;
- border-radius: 10rpx;
- margin: 0 54rpx 0 30rpx;
- width: 100%;
- }
- .avatar-size {
- position: relative;
- margin-left: 47rpx;
- width: 140rpx;
- height: 140rpx;
- flex-shrink: 0;
- }
- .avatar-img {
- position: absolute;
- top: 0px;
- left: 0;
- width: 140rpx;
- height: 140rpx;
- }
-
- .achievement-img{
- margin: 0 26rpx 0 46rpx;
- width: 82rpx;
- height: 82rpx;
- }
- .text-upload {
- font-size: 13px;
- color: rgba(166, 166, 166, 1);
- padding: 40px 35rpx 40px 0;
- }
- .homepage-grid-square {
- width: 250rpx;
- /* height: 250rpx; */
- align-items: start;
- }
- .homepage-grid-square image {
- width: 176rpx;
- height: 176rpx;
- }
- .homepage-arrow {
- position: relative;
- width: 35rpx;
- }
- .homepage-arrow::before {
- position: absolute;
- top: 0;
- right: 0upx;
- bottom: 0;
- display: block;
- margin: auto;
- width: 30upx;
- height: 30upx;
- color: #8799a3;
- content: "\e6a3";
- text-align: center;
- font-size: 34upx;
- font-family: cuIcon;
- line-height: 30upx
- }
- .button-fav {
- background-color: rgba(153, 150, 252, 255);
- color: #FFFFFF;
- border-radius: 10px;
- width: 184rpx;
- height: 90rpx;
- display: flex;
- justify-content: center;
- text-align: center;
- align-items: center;
- }
- .title {
- text-align: justify;
- /* padding: 40rpx 30rpx; */
- font-size: 15px;
- position: relative;
- height: 30px;
- line-height: 60upx;
- margin: 20rpx 40rpx;
- font-weight: 400;
- color: rgba(26, 26, 26, 1);
- }
- .bg-image {
- position: fixed;
- top: 46px;
- left: 0;
- width: 100%;
- height: 164px;
- opacity: 1;
- }
-
- .border{
- width: 176rpx;
- font-size: 30rpx;
- color:rgba(175, 175, 175, 1);
- font-weight: 400;
- text-align: center;
- margin-top: 22rpx;
- margin-bottom: 40rpx;
- }
-
- .item-img{
- border-radius: 20rpx;
- /* border: 1rpx solid #EEEEEE; */
- box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23);
- }
-
- .homepage-action-row{
- margin-top: 25px;
- display: flex;
- flex-direction: row;
- justify-content: center;
- padding: 20px;
- }
- </style>
|