Commit b0e411d0 authored by mengcuiguang's avatar mengcuiguang

添加订单页、观看记录页

parent e7c064e8
......@@ -17,8 +17,6 @@ export default {
options: {},
auth: false, // 登录验证
paying: false, // 支付按钮状态
info: false, // 三要素&实名认证
realNameStatus: false, // 实名认证状态
};
},
onLoad(options) {
......@@ -27,20 +25,6 @@ export default {
},
onShow() {
this.loadData();
// if (app.globalData.token) {
// if (!app.globalData.userInfo) {
// // this.getUserInfo();
// } else {
// this.infoAuth();
// }
// } else {
// if (this.auth) {
// this.login();
// } else {
// this.loadData();
// }
// }
},
onHide() {
if (this.xhrPool.size) {
......@@ -69,54 +53,6 @@ export default {
}
},
loadData() {},
authSuccess() {
console.log('authSuccess');
},
authFail() {
console.log('authFail');
},
infoAuth() {
console.log('infoAuth')
this.loadData();
if (app.globalData.auth) {
this.authSuccess();
return;
}
if (this.info) {
if (!app.globalData.userInfo.identityNo) {
confirm({
title: '提示',
content: '您还未进行实名认证',
confirmText: '去认证',
cancelText: '取消',
success() {
navigateTo('user/realname');
},
cancel() {
redirectTo('index');
}
});
this.authFail();
return;
}
app.globalData.auth = true;
this.authSuccess();
}
},
getUserInfo() {
this.post({
url: '/user/info',
auth: true,
showLoading: false,
success: ({
data
}) => {
app.globalData.userInfo = data;
this.infoAuth();
}
});
},
startPay() {
loading.show();
this.paying = true;
......
......@@ -88,12 +88,19 @@
}, {
"root": "pagesD",
"pages": [{
"path": "friends/friends",
"path": "watchRecord/watchRecord",
"style": {
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#2196f3",
"navigationBarTextStyle": "black" //用于配置状态栏的字体颜色
}
}, {
"path": "payRecord/payRecord",
"style": {
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#2196f3",
"navigationBarTextStyle": "black"
}
}]
}],
......
<template>
<view class="body">
<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 class="content">
<swiper class="banner" style="margin-top: 20rpx;" :indicator-dots="true" :autoplay="true" :interval="2000" :duration="500">
<swiper class="banner" style="margin-top: 20rpx;" :indicator-dots="true" :autoplay="true"
:interval="2000" :duration="500">
<swiper-item v-for="banner in bannerList" :key="banner.vedioId"
@click="handleBanner(banner.vedioId)">
<image class="banner-img" :src="banner.coverImage" mode="aspectFill"></image>
<image class="banner-img" :src="banner.tabImage" mode="aspectFill"></image>
</swiper-item>
</swiper>
......@@ -26,12 +26,12 @@
<image
style="width: 20rpx;height: 20rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="../../static/index/ic_index_play.png"></image>
<view style="font-size: 20rpx;color: white;">{{item.showNum}}</view>
<view style="font-size: 22rpx;color: white;">{{item.showNum}}</view>
</view>
</view>
</view>
<view style="font-size: 18rpx;margin-top: 10rpx;">{{item.title}}</view>
<view style="font-size: 16rpx;margin-top: 10rpx;"
<view style="font-size: 20rpx;margin-top: 10rpx;">{{item.title}}</view>
<view style="font-size: 18rpx;margin-top: 10rpx;"
v-if="item.orderTags!=null&&item.orderTags.length>0">
<template v-for="t in item.orderTags">{{t+' '}} </template>
</view>
......@@ -58,9 +58,10 @@
<image
style="width: 20rpx;height: 20rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="../../static/index/ic_index_play.png"></image>
<view style="font-size: 20rpx;color: white;">{{item.showNum}}</view>
<view style="font-size: 22rpx;color: white;">{{item.showNum}}</view>
</view>
<view style="font-size: 22rpx;color: white;font-weight: 777;">全{{item.vedioTotal}}集
</view>
<view style="font-size: 20rpx;color: white;">全{{item.vedioTotal}}集</view>
</view>
</view>
</view>
......@@ -79,9 +80,10 @@
<image
style="width: 20rpx;height: 20rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="../../static/index/ic_index_play.png"></image>
<view style="font-size: 20rpx;color: white;">{{item.showNum}}</view>
<view style="font-size: 22rpx;color: white;">{{item.showNum}}</view>
</view>
<view style="font-size: 22rpx;color: white;font-weight: 777;">全{{item.vedioTotal}}集
</view>
<view style="font-size: 20rpx;color: white;">全{{item.vedioTotal}}集</view>
</view>
</view>
</view>
......@@ -111,7 +113,8 @@
</view>
<view style="display: flex;flex-direction: column;align-items: flex-end;">
<image @click="handleBottomClose()" style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin: 10rpx;"
<image @click="handleBottomClose()"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin: 10rpx;"
src="../../static/index/ic_quit_white.png" mode="aspectFill"></image>
<view @click="handleBottomPlay(newRecordBean.vedioId)" style="width: 160rpx;height: 50rpx;background-color: red;border-radius:30rpx;color: white;font-size: 24rpx;justify-content: center;
align-items: center;display: flex;padding-bottom: 4rpx;margin-right: 20rpx;">
......@@ -156,12 +159,8 @@
};
},
methods: {
show() {
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
},
queryList(page, size) {
loadData() {
// 轮播图
this.post({
url: '/vedio/topTabs',
showLoading: false,
......@@ -171,6 +170,7 @@
this.bannerList = data.list;
}
});
// 排行榜
this.post({
url: '/vedio/orders',
showLoading: false,
......@@ -180,35 +180,32 @@
this.topList = data.list;
}
});
// this.post({
// url: '/url/newestRecord',
// showLoading: false,
// success: ({
// data
// }) => {
// if(data.list!=null&&data.list.length>0){
// this.newRecordBean = data.list[0];
// }
// }
// });
// this.post({
// url: '/vedio/listByType',
// data: {
// page,
// typeId:1,
// size
// },
// showLoading: false,
// success: ({
// data
// }) => {
// this.$refs.paging.complete(data);
// }
// });
// 最近观看剧
this.post({
url: '/vedio/orders',
url: '/vedio/newest',
showLoading: false,
success: ({
data
}) => {
if (data.list != null && data.list.length > 0) {
this.newRecordBean = data.list[0];
}
}
});
},
show() {
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
},
queryList(page, size) {
// 推荐列表
this.post({
url: '/vedio/list',
data: {
page,
size
},
showLoading: false,
success: ({
data
......@@ -218,22 +215,31 @@
});
},
handleBanner(vedioId) {
message.notify('vedioId='+vedioId);
message.notify('vedioId=' + vedioId);
},
handleInfo(item) {
message.notify('vedioId='+item.vedioId);
message.notify('vedioId=' + item.vedioId);
// navigateTo(`/pagesA/product/product?data=` + encodeURIComponent(JSON.stringify(item)))
},
handleTop(item) {
message.notify('vedioId='+item.vedioId);
message.notify('vedioId=' + item.vedioId);
// navigateTo(`/pagesA/product/product?data=` + encodeURIComponent(JSON.stringify(item)))
},
handleBottomPlay(vedioId) {
message.notify('vedioId='+vedioId);
message.notify('vedioId=' + vedioId);
},
handleBottomClose() {
this.newRecordBean=null;
// this.post({
// url: '/vedio/colseNewest',
// showLoading: false,
// success: ({
// data
// }) => {
// }
// });
this.newRecordBean = null;
message.notify('handleBottomClose');
navigateTo(`/pagesD/payRecord/payRecord`)
}
}
};
......
<template>
<view class="body">
<status-title>我的好友</status-title>
<view class="titleClass">
<view style="display: flex;align-items: center;justify-content: center;width: 25%;">
头像
</view>
<view style="display: flex;align-items: center;justify-content: center;width: 25%;">
昵称
</view>
<view @click="handleTest" style="display: flex;align-items: center;justify-content: center;width: 25%;">
手机号码
</view>
<view @click="handleTest2" style="display: flex;align-items: center;justify-content: center;width: 25%;">
已完成订单数
</view>
</view>
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList"
style="height: 76%;width: 100%;background-color: white;padding: 10rpx 0;">
<view v-for="(item, i) in dataList" :key="i">
<view
style="display: flex;flex-direction: row;justify-content:space-around;height: 100rpx;align-items: center;">
<view style="display: flex;align-items: center;justify-content: center;width: 25%;">
<image style="width: 80rpx;height: 80rpx;border-radius: 80rpx;" :src="item.avatarUrl||logoUrl"
mode="widthFix">
</image>
</view>
<view style="display: flex;align-items: center;justify-content: center;width: 25%;">
{{item.nickName}}
</view>
<view style="display: flex;align-items: center;justify-content: center;width: 25%;">
{{item.phone}}
</view>
<view style="display: flex;align-items: center;justify-content: center;width: 25%;">
{{item.orderNum}}
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
import common from '@/mixins/common';
import {
message,
navigateTo
} from '@/utils/fun';
const app = getApp();
export default {
name: 'center',
mixins: [common],
data() {
return {
dataList: [],
logoUrl: '/static/logo-about.png'
};
},
methods: {
queryList(page, size) {
this.post({
url: '/order/friendList',
data: {
page,
size
},
auth: true,
showLoading: false,
success: ({
data
}) => {
this.$refs.paging.complete(data.list);
}
});
},
handleTest() {
var mintstest = uni.getStorageSync('mintstest') || 0
var channel = uni.getStorageSync('channel') || ''
var clueToken = uni.getStorageSync('clueToken') || ''
var adId = uni.getStorageSync('adId') || ''
var advertiserId = uni.getStorageSync('advertiserId') || ''
var reqId = uni.getStorageSync('reqId') || ''
var creativeId = uni.getStorageSync('creativeId') || ''
var content = "mintstest -> " + mintstest + "\r\n channel -> " + channel + "\r\n clueToken -> " +
clueToken + "\r\n adId -> " + adId +
"\r\n reqId -> " +
reqId + "\r\n creativeId -> " + creativeId + "\r\n advertiserId -> " + advertiserId
if (mintstest == 1) {
uni.showModal({
content: content,
})
}
},
handleTest2() {
var mintstest = uni.getStorageSync('mintstest') || 0
var channel = uni.getStorageSync('channel') || ''
var clueToken = uni.getStorageSync('clueToken') || ''
var adId = uni.getStorageSync('adId') || ''
var advertiserId = uni.getStorageSync('advertiserId') || ''
var reqId = uni.getStorageSync('reqId') || ''
var creativeId = uni.getStorageSync('creativeId') || ''
var content = "mintstest -> " + mintstest + "\r\n channel -> " + channel + "\r\n clueToken -> " +
clueToken + "\r\n adId -> " + adId +
"\r\n reqId -> " +
reqId + "\r\n creativeId -> " + creativeId + "\r\n advertiserId -> " + advertiserId
if (mintstest == 0) {
uni.showModal({
content: content,
})
}
}
}
};
</script>
<style lang="scss">
@import '@/scss/uni.scss';
.body {
padding: 0 20rpx;
background-color: #F4F4F4;
}
.titleClass {
color: #7E7E7E;
background: url(https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_companionx/bg_friends_item.png);
margin-top: 20rpx;
padding-left: 10rpx;
padding-right: 10rpx;
display: flex;
flex-direction: row;
border-radius: 30rpx 30rpx 0 0;
height: 90rpx;
justify-content: space-around;
}
</style>
<template>
<view class="body">
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList">
<view v-for="(item, i) in dataList" :key="i">
<view style="display: flex;flex-direction: row;justify-content:space-between;margin: 20rpx;background-color:white;border-radius:10rpx;padding: 20rpx;">
<view style="display: flex;flex-direction: column;">
<view style="font-size: 28rpx;color: black;">{{item.title}}</view>
<view style="font-size: 22rpx;color: gray;margin-top: 16rpx;">付款时间:{{item.time}}</view>
<view style="font-size: 22rpx;color: gray;margin-top: 1rpx;">订单编号:{{item.orderid}}</view>
</view>
<view style="display: flex;align-items: center;margin-right: 8rpx;font-size: 36rpx;color: red;">
{{item.balance}}
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
import common from '@/mixins/common';
import {
getToLocal
} from "@/utils/utils.js"
import {
navigateTo,
message,
alert,
loading
} from '@/utils/fun.js';
import {
openUrl
} from '@/utils/app+.js';
const app = getApp();
export default {
name: 'index',
mixins: [common],
data() {
return {
dataList: []
};
},
methods: {
show() {
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
},
queryList(page, size) {
this.post({
url: '/vip/getOrderList',
showLoading: false,
success: ({
data
}) => {
this.$refs.paging.complete(data.list);
}
});
}
}
};
</script>
<style lang="scss">
@import '@/scss/uni.scss';
.body {
background-color: whitesmoke;
}
.img {
position: relative;
border-radius: 10rpx;
width: 180rpx;
height: 240rpx;
}
</style>
\ No newline at end of file
<template>
<view class="body">
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList">
<view style="font-size: 30rpx;font-weight: 777;margin-left: 12rpx;margin-top: 18rpx;">最近观看</view>
<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;align-items: center;" @click="handleInfo(item)">
<image class="img" :src="item.coverImage" mode="aspectFill"></image>
<view style="display: flex;flex-direction: column;margin-left: 20rpx;">
<view style="font-size: 30rpx;color: black;">{{item.title}}</view>
<view style="font-size: 22rpx;color: gray;margin-top: 16rpx;">观看至第{{item.seeIndex}}</view>
</view>
</view>
<view style="display: flex;align-items: center;margin-right: 8rpx;">
<view style="display: flex;flex-direction: column;">
<image v-if="item.collect==0" @click="handleXing(item)"
style="width: 50rpx;height: 50rpx;display: flex;align-items: right;padding-right: 4rpx;"
src="../../static/home_collect_img_0.png"></image>
<image v-else @click="handleXing(item)"
style="width: 50rpx;height: 50rpx;display: flex;align-items: right;padding-right: 4rpx;"
src="../../static/home_collect_img_1.png"></image>
<view
style="font-size: 22rpx;color: gray;margin-top: 10rpx;display: flex;justify-content: center;">
追剧</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
import common from '@/mixins/common';
import {
getToLocal
} from "@/utils/utils.js"
import {
navigateTo,
message,
alert,
loading
} from '@/utils/fun.js';
import {
openUrl
} from '@/utils/app+.js';
const app = getApp();
export default {
name: 'index',
mixins: [common],
data() {
return {
dataList: []
};
},
methods: {
show() {
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
},
queryList(page, size) {
this.post({
url: '/vedio/history',
showLoading: false,
success: ({
data
}) => {
this.$refs.paging.complete(data.list);
}
});
},
handleInfo(item) {
message.notify('vedioId=' + item.vedioId);
// navigateTo(`/pagesA/product/product?data=` + encodeURIComponent(JSON.stringify(item)))
},
handleXing(item) {
var that = this;
//0未收藏,1收藏
if (item.collect == 0) {
this.post({
url: '/vedio/collect',
data: {
vedioId: item.vedioId,
},
showLoading: false,
success: ({
data
}) => {
that.show();
}
});
} else {
this.post({
url: '/vedio/cancelCollect',
data: {
vedioId: item.vedioId,
},
showLoading: false,
success: ({
data
}) => {
that.show();
}
});
}
}
}
};
</script>
<style lang="scss">
@import '@/scss/uni.scss';
.body {
background-color: whitesmoke;
}
.img {
position: relative;
border-radius: 10rpx;
width: 180rpx;
height: 240rpx;
}
</style>
\ No newline at end of file
.banner {
width: 100%;
height: 324rpx;
height: 340rpx;
vertical-align: bottom;
&-img {
......
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