123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- <template>
- <view class="full-container">
- <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()"
- title="我的" 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>
-
- </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>
- <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>
- <text class="text-black">达标{{days}}天</text>
- </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 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>
- </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'
- ]),
- 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)
- });
- },
- 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'
- });
- },
- 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.navigateTo({
- url: '../../game-page/game/game'
- });
- },
- 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;
- }
- .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: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 159px;
- 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>
|