Commit a9580391 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 2b7150a6
<template> <template>
<view> <view>
<uni-popup type="center" ref="adPop" :maskClick="false" :isMaskClick="false"> <uni-popup type="center" ref="adPop" :maskClick="false" :isMaskClick="false">
<view class="container"> <view class="container">
<!-- <view class="ad-view"> <!-- <view class="ad-view">
<ad :unit-id="adUnitId" @load="onload" @close="onclose" @error="onerror"></ad> <ad :unit-id="adUnitId" @load="onload" @close="onclose" @error="onerror"></ad>
</view> --> </view> -->
<view class="content"> <view class="content">
<text class="title">恭喜你,获得免费看剧名额</text> <text class="title">恭喜你,获得免费看剧名额</text>
<text class="button" @click="handleClose">看视频免费解锁1集</text> <text class="button" @click="handleClose">看视频免费解锁1集</text>
<text class="downtext">{{countDown}}s后自动进入广告,观看完成解锁第{{vedioIndex+1}}集剧情</text> <text class="downtext">{{countDown}}s后自动进入广告,阅读完成解锁第{{vedioIndex+1}}集剧情</text>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
import { import {
EXPRESS_ID EXPRESS_ID
} from "@/utils/adConstant.js" } from "@/utils/adConstant.js"
export default { export default {
name: 'adPopup', name: 'adPopup',
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
vedioIndex: { vedioIndex: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
} }
}, },
data() { data() {
return { return {
adUnitId: EXPRESS_ID, adUnitId: EXPRESS_ID,
countDown: 3, countDown: 3,
}; };
}, },
methods: { methods: {
handleShow() { handleShow() {
this.$refs.adPop.open('center'); this.$refs.adPop.open('center');
this.startCountdown() this.startCountdown()
}, },
startCountdown() { startCountdown() {
let that = this; let that = this;
var countDownSeconds = 3 var countDownSeconds = 3
that.countDown = countDownSeconds that.countDown = countDownSeconds
const timer = setInterval(() => { const timer = setInterval(() => {
if (countDownSeconds > 0) { if (countDownSeconds > 0) {
that.countDown = countDownSeconds that.countDown = countDownSeconds
countDownSeconds-- countDownSeconds--
} else { } else {
clearInterval(timer) clearInterval(timer)
that.handleClose() that.handleClose()
} }
}, 1000) }, 1000)
}, },
handleClose() { handleClose() {
this.$refs.adPop.close('center'); this.$refs.adPop.close('center');
this.$emit('close'); this.$emit('close');
}, },
onload(e) { onload(e) {
console.log("onload"); console.log("onload");
}, },
onclose(e) { onclose(e) {
console.log("onclose: " + e.detail); console.log("onclose: " + e.detail);
}, },
onerror(e) { onerror(e) {
console.log("onerror: " + e.detail.errCode + " message:: " + e.detail.errMsg); console.log("onerror: " + e.detail.errCode + " message:: " + e.detail.errMsg);
} }
}, },
watch: { watch: {
show: { show: {
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal) { if (newVal) {
this.handleShow(); this.handleShow();
} }
}, },
immediate: true immediate: true
} }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.container { .container {
width: 600rpx; width: 600rpx;
height: 800rpx; height: 800rpx;
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
} }
.ad-view { .ad-view {
width: 600rpx; width: 600rpx;
border-radius: 20rpx; border-radius: 20rpx;
// background-color: white; // background-color: white;
margin-bottom: 10px; margin-bottom: 10px;
} }
.content { .content {
border-radius: 20rpx; border-radius: 20rpx;
background-color: white; background-color: white;
display: flex; display: flex;
width: 600rpx; width: 600rpx;
padding: 30rpx 0; padding: 30rpx 0;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.title { .title {
color: black; color: black;
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.button { .button {
margin: 20rpx 20rpx; margin: 20rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
background-color: orange; background-color: orange;
color: white; color: white;
font-size: 36rpx; font-size: 36rpx;
} }
.downtext{ .downtext{
color: darkgray; color: darkgray;
font-size: 26rpx; font-size: 26rpx;
} }
} }
</style> </style>
\ No newline at end of file
This diff is collapsed.
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
:src="newRecordBean.coverImage" mode="aspectFill"></image> :src="newRecordBean.coverImage" mode="aspectFill"></image>
<view style="margin: 20rpx;"> <view style="margin: 20rpx;">
<view style="font-size: 30rpx; color: white;">{{newRecordBean.title}}</view> <view style="font-size: 30rpx; color: white;">{{newRecordBean.title}}</view>
<view style="font-size: 24rpx;margin-top: 6rpx;color: white;">上次观看至第{{newRecordBean.seeIndex}} <view style="font-size: 24rpx;margin-top: 6rpx;color: white;">上次阅读至第{{newRecordBean.seeIndex}}
</view> </view>
<view style="font-size: 22rpx;" <view style="font-size: 22rpx;"
v-if="newRecordBean.orderTags!=null&&newRecordBean.orderTags.length>0"> v-if="newRecordBean.orderTags!=null&&newRecordBean.orderTags.length>0">
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
color: white; color: white;
font-size: 24rpx; font-size: 24rpx;
margin-right: 20rpx;"> margin-right: 20rpx;">
继续观看 继续阅读
</view> </view>
</view> </view>
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
this.topList = data.list; this.topList = data.list;
} }
}); });
// 最近观看 // 最近阅读
this.post({ this.post({
url: '/vedio/newest', url: '/vedio/newest',
data: {}, data: {},
......
This diff is collapsed.
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
"enable" : true "enable" : true
} }
}, },
"title" : "短剧", "title" : "小说",
"router" : { "router" : {
"base" : "./" "base" : "./"
}, },
......
export default { export default {
data() { data() {
return { return {
share: { share: {
title: '更多好剧,等你来看', title: '更多小说,等你来看',
imageUrl: 'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_movie.png', imageUrl: 'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_movie.png',
path: '/pages/loading?shareId=' path: '/pages/loading?shareId='
} }
} }
}, },
onShareAppMessage(res) { //发送给朋友 onShareAppMessage(res) { //发送给朋友
return { return {
title: this.share.title, title: this.share.title,
imageUrl: this.share.imageUrl, imageUrl: this.share.imageUrl,
path: this.share.path, path: this.share.path,
} }
}, },
onShareTimeline(res) { //分享到朋友圈 onShareTimeline(res) { //分享到朋友圈
return { return {
title: this.share.title, title: this.share.title,
imageUrl: this.share.imageUrl, imageUrl: this.share.imageUrl,
path: this.share.path, path: this.share.path,
} }
}, },
} }
\ No newline at end of file
{ {
"easycom": { "easycom": {
"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue", "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue",
"autoscan": true, "autoscan": true,
"custom": { "custom": {
"^n-(.*)": "@/nPro/$1/$1.vue", // 匹配nPro内的vue文件 "^n-(.*)": "@/nPro/$1/$1.vue", // 匹配nPro内的vue文件
"^nx-(.*)": "@/nProX/$1/$1.vue" // 匹配nProX内的vue文件 "^nx-(.*)": "@/nProX/$1/$1.vue" // 匹配nProX内的vue文件
} }
}, },
"pages": [ "pages": [
// #ifndef APP-PLUS // #ifndef APP-PLUS
{ {
"path": "pages/loading", "path": "pages/loading",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#F2F1FF", "navigationBarBackgroundColor": "#F2F1FF",
"navigationBarTextStyle": "#000000" "navigationBarTextStyle": "#000000"
} }
}, },
// #endif // #endif
{ {
"path": "pages/home", "path": "pages/home",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff", "navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "#000000" "navigationBarTextStyle": "#000000"
} }
}, { }, {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff", "navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "#000000" "navigationBarTextStyle": "#000000"
} }
}, },
{ {
"path": "pages/my/my", "path": "pages/my/my",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff", "navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "#000000" "navigationBarTextStyle": "#000000"
} }
}, { }, {
"path": "pages/brower/brower", "path": "pages/brower/brower",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff", "navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
}, { }, {
"path": "pages/recommend/recommend", "path": "pages/recommend/recommend",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#000000", "navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "#ffffff" "navigationBarTextStyle": "#ffffff"
} }
}, { }, {
"path": "pages/recommend/follow", "path": "pages/recommend/follow",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff", "navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "#000000" "navigationBarTextStyle": "#000000"
} }
}, { }, {
"path": "pages/recommend/recommendVideo", "path": "pages/recommend/recommendVideo",
"style": { "style": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#000000", "navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "#ffffff" "navigationBarTextStyle": "#ffffff"
} }
} }
], ],
// 分包配置 // 分包配置
"subPackages": [{ "subPackages": [{
"root": "pagesA", "root": "pagesA",
"pages": [{ "pages": [{
"path": "vipPay/vipPay", "path": "vipPay/vipPay",
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#2196f3",
"navigationBarTextStyle": "black"
}
}]
}, {
"root": "pagesC",
"pages": [{
"path": "ttvideo/ttVideoDetail",
"style": { "style": {
"backgroundColor": "#000000", "navigationStyle": "default",
"navigationStyle": "default", "navigationBarBackgroundColor": "#2196f3",
"navigationBarBackgroundColor": "#000000", "navigationBarTextStyle": "black"
"navigationBarTextStyle": "#ffffff", }
"usingComponents ": { }]
"video-player": "ext://industry/video-player" }, {
} "root": "pagesC",
} "pages": [{
}] "path": "ttvideo/ttVideoDetail",
}, "style": {
{ "backgroundColor": "#000000",
"root": "pagesD", "navigationStyle": "default",
"pages": [{ "navigationBarBackgroundColor": "#000000",
"path": "watchRecord/watchRecord", "navigationBarTextStyle": "#ffffff",
"style": { "usingComponents ": {
"navigationBarTitleText": "观看记录", "video-player": "ext://industry/video-player"
"navigationStyle": "default", }
"navigationBarBackgroundColor": "#ffffff", }
"navigationBarTextStyle": "black" }]
} },
}, { {
"path": "payRecord/payRecord", "root": "pagesD",
"style": { "pages": [{
"navigationBarTitleText": "我的订单", "path": "watchRecord/watchRecord",
"navigationStyle": "default", "style": {
"navigationBarBackgroundColor": "#ffffff", "navigationBarTitleText": "阅读记录",
"navigationBarTextStyle": "black" "navigationStyle": "default",
} "navigationBarBackgroundColor": "#ffffff",
}, { "navigationBarTextStyle": "black"
"path": "dotRecord/dotRecord", }
"style": { }, {
"navigationBarTitleText": "看点记录", "path": "payRecord/payRecord",
"navigationStyle": "default", "style": {
"navigationBarBackgroundColor": "#ffffff", "navigationBarTitleText": "我的订单",
"navigationBarTextStyle": "black" "navigationStyle": "default",
} "navigationBarBackgroundColor": "#ffffff",
}, { "navigationBarTextStyle": "black"
"path": "useDotRecord/useDotRecord", }
"style": { }, {
"navigationBarTitleText": "消费记录", "path": "dotRecord/dotRecord",
"navigationStyle": "default", "style": {
"navigationBarBackgroundColor": "#ffffff", "navigationBarTitleText": "书豆记录",
"navigationBarTextStyle": "black" "navigationStyle": "default",
} "navigationBarBackgroundColor": "#ffffff",
}] "navigationBarTextStyle": "black"
} }
], }, {
// 分包预载配置 "path": "useDotRecord/useDotRecord",
"preloadRule": { "style": {
// 当我们进入了pages/home页面以后就会预下载pagesA分包 "navigationBarTitleText": "消费记录",
"pages/home": { "navigationStyle": "default",
"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载) "navigationBarBackgroundColor": "#ffffff",
"packages": ["pagesA", "pagesC", "pagesD"] //进入页面后预下载分包 "navigationBarTextStyle": "black"
}, }
"pages/recommend/recommend": { }]
"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载) }
"packages": ["pagesC"] //进入页面后预下载分包 ],
}, // 分包预载配置
"pages/my/my": { "preloadRule": {
"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载) // 当我们进入了pages/home页面以后就会预下载pagesA分包
"packages": ["pagesD"] //进入页面后预下载分包 "pages/home": {
} "network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
}, "packages": ["pagesA", "pagesC", "pagesD"] //进入页面后预下载分包
"globalStyle": { },
"backgroundColor": "#f5f5f5", "pages/recommend/recommend": {
"navigationStyle": "default", "network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"app-plus": { "packages": ["pagesC"] //进入页面后预下载分包
"bounce": "none", },
"scrollIndicator": "none" "pages/my/my": {
} "network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
}, "packages": ["pagesD"] //进入页面后预下载分包
"condition": { //模式配置,仅开发期间生效 }
"current": 0, //当前激活的模式(list 的索引项) },
"list": [{ "globalStyle": {
"name": "", //模式名称 "backgroundColor": "#f5f5f5",
"path": "", //启动页面,必选 "navigationStyle": "default",
"query": "" //启动参数,在页面的onLoad函数里面得到 "app-plus": {
}] "bounce": "none",
} "scrollIndicator": "none"
}
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view style="color: #A231EF;margin-top: 10rpx;font-size: 40rpx;font-size: 40rpx;">欢迎使用</view> <view style="color: #A231EF;margin-top: 10rpx;font-size: 40rpx;font-size: 40rpx;">欢迎使用</view>
<view style="bottom: 0;position: absolute;"> <view style="bottom: 0;position: absolute;">
<image style="width: 540rpx;height: 644rpx;display: flex;align-items: center;margin-bottom: 30%;" <image style="width: 540rpx;height: 644rpx;display: flex;align-items: center;margin-bottom: 30%;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_splash.png" mode="scaleToFill"> src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/book_bg_splash.png" mode="scaleToFill">
</image> </image>
</view> </view>
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
}, },
onLoad(options) { onLoad(options) {
this.tips1 = options.tips1 this.tips1 = options.tips1
this.appName = '幻墨小说阁' this.appName = '幻墨小说阁'
}, },
onShow(options) { onShow(options) {
......
This diff is collapsed.
This diff is collapsed.
<template> <template>
<view class="body"> <view class="body">
<!-- <status-title :showBack="true">看点记录</status-title> --> <!-- <status-title :showBack="true">书豆记录</status-title> -->
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList"> <z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList">
<view v-for="(item, i) in dataList" :key="i"> <view v-for="(item, i) in dataList" :key="i">
<view class="flex m-20 pd-20" style="background-color:white;border-radius:10rpx;"> <view class="flex m-20 pd-20" style="background-color:white;border-radius:10rpx;">
<image style="margin: auto 10rpx;width: 60rpx;height: 60rpx;" src="../../static/ic_coin.png"> <image style="margin: auto 10rpx;width: 60rpx;height: 60rpx;" src="../../static/ic_coin.png">
</image> </image>
<view class="flex1 ml-10"> <view class="flex1 ml-10">
<view class="mt-10" style="font-size: 28rpx;color: black;">{{item.remark}}</view> <view class="mt-10" style="font-size: 28rpx;color: black;">{{item.remark}}</view>
<view class="mt-10" style="font-size: 26rpx;color: darkgray;"> <view class="mt-10" style="font-size: 26rpx;color: darkgray;">
{{item.time}} {{item.time}}
</view> </view>
</view> </view>
<view style="margin:auto 10rpx auto auto;font-size: 36rpx;color: steelblue;"> <view style="margin:auto 10rpx auto auto;font-size: 36rpx;color: steelblue;">
{{ '+'+ item.subValue + '看点'}} {{ '+'+ item.subValue + '书豆'}}
</view> </view>
</view> </view>
</view> </view>
</z-paging> </z-paging>
</view> </view>
</template> </template>
<script> <script>
import common from '@/mixins/common'; import common from '@/mixins/common';
import { import {
formateTime formateTime
} from "@/utils/utils.js" } from "@/utils/utils.js"
export default { export default {
name: 'dotRecord', name: 'dotRecord',
mixins: [common], mixins: [common],
data() { data() {
return { return {
dataList: [] dataList: []
}; };
}, },
methods: { methods: {
show() { show() {
if (this.$refs.paging != null) { if (this.$refs.paging != null) {
this.$refs.paging.refresh(); this.$refs.paging.refresh();
} }
}, },
myFormateTime(time) { myFormateTime(time) {
return formateTime(time, 'yyyy-MM-dd hh:mm:ss') return formateTime(time, 'yyyy-MM-dd hh:mm:ss')
}, },
queryList(page, size) { queryList(page, size) {
this.post({ this.post({
url: '/vedio/assetsRecords/add', url: '/vedio/assetsRecords/add',
data: { data: {
page, page,
size size
}, },
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
this.$refs.paging.complete(data.list); this.$refs.paging.complete(data.list);
} }
}); });
} }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.body { .body {
background-color: whitesmoke; background-color: whitesmoke;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<view class="body"> <view class="body">
<!-- <status-title :showBack="true">消费记录</status-title> --> <!-- <status-title :showBack="true">消费记录</status-title> -->
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList"> <z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList">
<view v-for="(item, i) in dataList" :key="i"> <view v-for="(item, i) in dataList" :key="i">
<view class="flex m-20 pd-20" style="background-color:white;border-radius:10rpx;"> <view class="flex m-20 pd-20" style="background-color:white;border-radius:10rpx;">
<image style="margin: auto 10rpx;width: 60rpx;height: 60rpx;" src="../../static/ic_shop.png"> <image style="margin: auto 10rpx;width: 60rpx;height: 60rpx;" src="../../static/ic_shop.png">
</image> </image>
<view class="flex1 ml-10"> <view class="flex1 ml-10">
<view class="mt-10" style="font-size: 28rpx;color: black;">{{item.remark}} <view class="mt-10" style="font-size: 28rpx;color: black;">{{item.remark}}
</view> </view>
<view class="mt-10" style="font-size: 26rpx;color: darkgray;"> <view class="mt-10" style="font-size: 26rpx;color: darkgray;">
{{item.time}} {{item.time}}
</view> </view>
</view> </view>
<view style="margin:auto 10rpx auto auto;font-size: 36rpx;color: steelblue;"> <view style="margin:auto 10rpx auto auto;font-size: 36rpx;color: steelblue;">
{{ '-'+ item.subValue + '看点'}} {{ '-'+ item.subValue + '书豆'}}
</view> </view>
</view> </view>
</view> </view>
</z-paging> </z-paging>
</view> </view>
</template> </template>
<script> <script>
import common from '@/mixins/common'; import common from '@/mixins/common';
import { import {
formateTime formateTime
} from "@/utils/utils.js" } from "@/utils/utils.js"
export default { export default {
name: 'useDotRecord', name: 'useDotRecord',
mixins: [common], mixins: [common],
data() { data() {
return { return {
dataList: [] dataList: []
}; };
}, },
methods: { methods: {
show() { show() {
if (this.$refs.paging != null) { if (this.$refs.paging != null) {
this.$refs.paging.refresh(); this.$refs.paging.refresh();
} }
}, },
myFormateTime(time) { myFormateTime(time) {
return formateTime(time, 'yyyy-MM-dd hh:mm:ss') return formateTime(time, 'yyyy-MM-dd hh:mm:ss')
}, },
queryList(page, size) { queryList(page, size) {
this.post({ this.post({
url: '/vedio/assetsRecords/sub', url: '/vedio/assetsRecords/sub',
data: { data: {
page, page,
size size
}, },
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
this.$refs.paging.complete(data.list); this.$refs.paging.complete(data.list);
} }
}); });
} }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.body { .body {
background-color: whitesmoke; background-color: whitesmoke;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<view class="body"> <view class="body">
<!-- <status-title :showBack="true">观看记录</status-title> --> <!-- <status-title :showBack="true">阅读记录</status-title> -->
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList" :defaultPageNo="1" <z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList" :defaultPageNo="1"
:defaultPageSize="500"> :defaultPageSize="500">
<view style="font-size: 30rpx;font-weight: 777;margin-left: 12rpx;margin-top: 10rpx;">最近观看</view> <view style="font-size: 30rpx;font-weight: 777;margin-left: 12rpx;margin-top: 10rpx;">最近阅读</view>
<view v-for="(item, i) in dataList" :key="i"> <view v-for="(item, i) in dataList" :key="i">
<view style="display: flex;flex-direction: row;justify-content:space-between;margin: 20rpx;"> <view style="display: flex;flex-direction: row;justify-content:space-between;margin: 20rpx;">
<view style="display: flex;align-items: center;" @click="handleInfo(item)"> <view style="display: flex;align-items: center;" @click="handleInfo(item)">
<image class="img" :src="item.coverImage" mode="aspectFill"></image> <image class="img" :src="item.coverImage" mode="aspectFill"></image>
<view style="display: flex;flex-direction: column;margin-left: 20rpx;"> <view style="display: flex;flex-direction: column;margin-left: 20rpx;">
<view style="font-size: 30rpx;color: black;">{{item.title}}</view> <view style="font-size: 30rpx;color: black;">{{item.title}}</view>
<view style="font-size: 22rpx;color: gray;margin-top: 16rpx;">观看至第{{item.seeIndex}}</view> <view style="font-size: 22rpx;color: gray;margin-top: 16rpx;">阅读至第{{item.seeIndex}}</view>
</view> </view>
</view> </view>
<view style="display: flex;align-items: center;margin-right: 8rpx;"> <view style="display: flex;align-items: center;margin-right: 8rpx;">
<view style="display: flex;flex-direction: column;"> <view style="display: flex;flex-direction: column;">
<image v-if="item.collect==0" @click="handleXing(item)" <image v-if="item.collect==0" @click="handleXing(item)"
style="width: 50rpx;height: 50rpx;display: flex;align-items: right;padding-right: 4rpx;" style="width: 50rpx;height: 50rpx;display: flex;align-items: right;padding-right: 4rpx;"
src="../../static/home_collect_img_0.png"></image> src="../../static/home_collect_img_0.png"></image>
<image v-else @click="handleXing(item)" <image v-else @click="handleXing(item)"
style="width: 50rpx;height: 50rpx;display: flex;align-items: right;padding-right: 4rpx;" style="width: 50rpx;height: 50rpx;display: flex;align-items: right;padding-right: 4rpx;"
src="../../static/home_collect_img_1.png"></image> src="../../static/home_collect_img_1.png"></image>
<view <view
style="font-size: 22rpx;color: gray;margin-top: 10rpx;display: flex;justify-content: center;"> style="font-size: 22rpx;color: gray;margin-top: 10rpx;display: flex;justify-content: center;">
追剧</view> 追剧</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</z-paging> </z-paging>
</view> </view>
</template> </template>
<script> <script>
import common from '@/mixins/common'; import common from '@/mixins/common';
import { import {
getToLocal getToLocal
} from "@/utils/utils.js" } from "@/utils/utils.js"
import { import {
navigateTo, navigateTo,
message, message,
alert, alert,
loading loading
} from '@/utils/fun.js'; } from '@/utils/fun.js';
import { import {
openUrl openUrl
} from '@/utils/app+.js'; } from '@/utils/app+.js';
const app = getApp(); const app = getApp();
export default { export default {
name: 'index', name: 'index',
mixins: [common], mixins: [common],
data() { data() {
return { return {
dataList: [] dataList: []
}; };
}, },
methods: { methods: {
show() { show() {
if (this.$refs.paging != null) { if (this.$refs.paging != null) {
this.$refs.paging.refresh(); this.$refs.paging.refresh();
} }
}, },
queryList(page, size) { queryList(page, size) {
this.post({ this.post({
url: '/vedio/history', url: '/vedio/history',
data: { data: {
page, page,
size size
}, },
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
this.$refs.paging.complete(data.list); this.$refs.paging.complete(data.list);
} }
}); });
}, },
handleInfo(item) { handleInfo(item) {
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)) + navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)) +
'&tt_album_id=' + item.douyinAlbumId + '&tt_episode_id=' + item.douyinEpisodeId); '&tt_album_id=' + item.douyinAlbumId + '&tt_episode_id=' + item.douyinEpisodeId);
}, },
handleXing(item) { handleXing(item) {
var that = this; var that = this;
//0未收藏,1收藏 //0未收藏,1收藏
if (item.collect == 0) { if (item.collect == 0) {
this.post({ this.post({
url: '/vedio/collect', url: '/vedio/collect',
data: { data: {
vedioId: item.vedioId, vedioId: item.vedioId,
}, },
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
that.show(); that.show();
} }
}); });
} else { } else {
this.post({ this.post({
url: '/vedio/cancelCollect', url: '/vedio/cancelCollect',
data: { data: {
vedioId: item.vedioId, vedioId: item.vedioId,
}, },
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
that.show(); that.show();
} }
}); });
} }
} }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/scss/uni.scss'; @import '@/scss/uni.scss';
.body { .body {
background-color: whitesmoke; background-color: whitesmoke;
} }
.img { .img {
position: relative; position: relative;
border-radius: 10rpx; border-radius: 10rpx;
width: 180rpx; width: 180rpx;
height: 240rpx; height: 240rpx;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment