| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- <template>
- <view class="content-page-wrap flex-column">
- <top-main title="我的" back></top-main>
- <view class="middle-main">
-
- <image src="@/static/img/my-bg.svg" class="my-bg"></image>
- <view class="flex-column">
- <view class="vip-box" @click="goVip">
- <image src="@/static/img/vip-bg.svg"></image>
- <view class="flex vip-time">
- <view class="flex text">
- VIP剩余
- <h2>
- {{ 366 }}
- </h2>
- 天
- </view>
- <u-icon
- name="arrow-right"
- color="#FFD9AD"
- size="12"
- ></u-icon>
- </view>
- </view>
- <view class="inlet-box flex-column">
- <view class="flex">
- <view class="top-but" @click="goRecord">
- <view>钱包明细</view>
- <view class="icon flex-center"
- ><img src="@/static/img/icon-detail.svg"
- /></view>
- </view>
- <view class="top-but" style="margin-left: 32rpx">
- <view>NFT挖矿</view>
- <view class="icon flex-center"
- ><img src="@/static/img/icon-dig.svg"
- /></view>
- </view>
- </view>
- <view class="flex">
- <view class="bottom-left-but flex-left justify-around">
- <view>老K社区</view>
- <u-icon
- name="arrow-right"
- color="#000E08"
- size="18"
- bold
- ></u-icon>
- </view>
- <view
- class="bottom-right-but flex-left justify-around"
- style="margin-left: 26rpx"
- >
- <view>变更</view>
- <view class="icon flex-center"
- ><img src="@/static/img/icon-change.svg"
- /></view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="video-box">
- <view class="top-content flex justify-between">
- <h4>观看历史</h4>
- <view class="flex-left right-but" @click="goHistory">
- <text>更多</text>
- <u-icon
- name="arrow-right"
- color="#717171"
- size="14"
- bold
- ></u-icon>
- </view>
- </view>
- <view class="flex-left">
- <view
- class="card-row"
- v-for="(item, index) in historyData"
- :key="index"
- @click="goPlayVideo(item)"
- >
- <view class="card-img">
- <u-image
- :src="item.videoPoster"
- radius="8rpx"
- width="120rpx"
- height="180rpx"
- ></u-image>
- <text>{{ secondsToTime(item.duration) }}</text>
- </view>
- <view class="card-name">
- {{ item.videoName }}
- </view>
- </view>
- </view>
- </view>
- <view class="video-box" style="margin-top: 40rpx">
- <view class="top-content flex justify-between">
- <h4>我的收藏</h4>
- <view class="flex-left right-but" @click="goCollect">
- <text>更多</text>
- <u-icon
- name="arrow-right"
- color="#717171"
- size="14"
- bold
- ></u-icon>
- </view>
- </view>
- <view class="flex-left">
- <view
- class="card-row"
- v-for="(item, index) in collectData"
- :key="index"
- @click="goPlayVideo(item)"
- >
- <view class="card-img">
- <u-image
- :src="item.videoPoster"
- radius="8rpx"
- width="120rpx"
- height="180rpx"
- ></u-image>
- <!-- <text>{{ item.playTime }}</text> -->
- </view>
- <view class="card-name">
- {{ item.videoName }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import $req from "@/service/serviceConfig";
- import topMain from "@/components/topMain";
- export default {
- components: {
- topMain,
- },
- data() {
- return {
- historyData: [],
- collectData: [],
- };
- },
- onShow() {
- let vm = this;
- vm.gteHistoryData();
- vm.gteCollectData();
- },
- methods: {
- // 播放视频
- goPlayVideo(row) {
- uni.navigateTo({
- url: `/pages/play/play?url=${row.url}`,
- });
- },
- // 前往历记录列表
- goHistory() {
- uni.navigateTo({
- url: `/pages/my/viewHistorys`,
- });
- },
- // 前往收藏列表
- goCollect() {
- uni.navigateTo({
- url: `/pages/my/myCollect`,
- });
- },
- // 获取历史数据
- gteHistoryData() {
- let vm = this;
- let query = {
- page: 1,
- size: 4,
- };
- uni.showLoading({
- title: "加载中",
- });
- $req.request({ alias: "view-records-page", query })
- .then((res) => {
- uni.hideLoading();
- if (res.code == 0) {
- vm.historyData = res.data.rows;
- }
- })
- .catch(() => {});
- },
- // 获取收藏数据
- gteCollectData() {
- let vm = this;
- let query = {
- page: 1,
- size: 4,
- };
- uni.showLoading({
- title: "加载中",
- });
- $req.request({ alias: "favorite-page", query })
- .then((res) => {
- uni.hideLoading();
- if (res.code == 0) {
- vm.collectData = res.data.rows;
- }
- })
- .catch(() => {});
- },
- goVip() {
- uni.navigateTo({
- url: "/pages/my/vip",
- });
- },
- goRecord() {
- uni.navigateTo({
- url: "/pages/my/record",
- });
- },
- // 秒转换为时分秒
- secondsToTime(seconds) {
- const hours = Math.floor(seconds / 3600)
- .toString()
- .padStart(2, "0");
- const minutes = Math.floor((seconds % 3600) / 60)
- .toString()
- .padStart(2, "0");
- const remainingSeconds = (seconds % 60).toString().padStart(2, "0");
- return hours + ":" + minutes + ":" + remainingSeconds;
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .content-page-wrap {
- overflow-x: hidden;
- padding: 32rpx;
- .middle-main {
- padding: 28rpx 28rpx 42rpx 28rpx;
- .vip-box {
- position: relative;
- display: flex;
- align-items: center;
- height: 72rpx;
- margin-top: 46rpx;
- image {
- height: 100%;
- width: 100%;
- }
- .vip-time {
- position: absolute;
- top: 0;
- right: 0px;
- left: 50px;
- display: flex;
- justify-content: center;
- line-height: 80rpx;
- color: #e5a670;
- font-size: 26rpx;
- width: 100%;
- .text {
- margin-right: 80rpx;
- h2 {
- color: #ffd9ad;
- margin: 0 20rpx;
- }
- }
- }
- }
- .inlet-box {
- margin-top: 40rpx;
- color: #000;
- font-size: 28rpx;
- font-weight: bold;
- .top-but {
- flex: 1;
- height: 216rpx;
- background-color: #e4f2e9;
- border-radius: 30rpx;
- display: flex;
- align-items: center;
- justify-content: space-evenly;
- flex-direction: column;
- margin-bottom: 26rpx;
- .icon {
- width: 148rpx;
- height: 56rpx;
- background-color: #6ae199;
- border-radius: 62rpx;
- }
- }
- .bottom-left-but {
- flex: 1;
- height: 100rpx;
- background-color: #e4f2e9;
- border-radius: 30rpx;
- }
- .bottom-right-but {
- width: 214rpx;
- height: 100rpx;
- background-color: #e4f2e9;
- border-radius: 30rpx;
- .icon {
- width: 48rpx;
- height: 42rpx;
- background: #6ae199;
- border-radius: 62rpx;
- }
- }
- }
- }
- .my-bg {
- position: absolute;
- top: 140rpx;
- right: 0;
- width: 328rpx;
- height: 219.84rpx;
- }
- .video-box {
- width: 100%;
- // height: 344rpx;
- border-radius: 20rpx;
- border: 2rpx solid #e6aa76;
- padding: 48rpx 36rpx;
- .top-content {
- margin-bottom: 40rpx;
- .right-but {
- color: #717171;
- font-size: 24rpx;
- text {
- margin-right: 10rpx;
- }
- }
- }
- .card-row:first-child {
- margin-left: 0;
- }
- .card-row {
- width: 21.5%;
- margin-left: 32rpx;
- .card-img {
- position: relative;
- width: 100%;
- // height: 240rpx;
- text {
- font-size: 20rpx;
- color: #fff;
- position: absolute;
- right: 8rpx;
- bottom: 8rpx;
- }
- }
- .card-name {
- color: #000;
- font-size: 24rpx;
- margin-top: 24rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- }
- }
- }
- </style>
|