Переглянути джерело

视频的充值和消费记录等

pansl 2 роки тому
батько
коміт
3df5799ba5

+ 61 - 130
pages/client/consume/consume.vue

@@ -1,24 +1,29 @@
 <template>
-	<view>
-		<view class="integral-log-main">
-			<view class="pd16_15 bd-bottom flex alcenter">
-				<text class="iconfont iconicon_integral_des ft20 cl-main"></text>
-				<text class="ml10 ft16 ftw600 cl-main">消费明细</text>
-			</view>
-			<view class="pd16_15" v-if="listData.length>0">
-				<block v-for="(item,index) in listData" :key="index">
-					<view class="pb16 mb16 bd-bottom flex alcenter space">
-						<view>
-							<view class="ft14 cl-main">{{item.memo}}</view>
-							<view class="mt8 ft12 cl-notice">{{item.createtime}}</view>
+	<view class="body pd16_15">
+		<view class="jilu-box" v-show="list.length > 0">
+			<view class="pb10 jilu-item" v-for="(item,key) in list" :key="key">
+				<view class="jilu-item-box">
+					<view class="jilu-items">
+						<view class="lines">
+							<text class="ft14" style="font-weight: bold;">{{item.video_name}}</text>
+							<text class="ft12 jilu-txt">{{item.series_name}}</text>
+							<text class="ft12 jilu-txt">{{item.created_at}}</text>
 						</view>
-						<view class="ft18 ftw600 cl-main">{{item.jzt}}{{item.score}}</view>
 					</view>
-				</block>
-				<uni-load-more :status="status" :content-text="contentText" />
+					<view class="lines">
+						<text class="ft14 jilu-txt"
+							style="text-align: right;font-weight: bold;color:  #FF9800;">-{{item.charge_coin_cost}}K币</text>
+					</view>
+				</view>
 			</view>
-
-			<com-empty v-else title="暂无积分记录"></com-empty>
+		</view>
+		<view class="empty-box" v-if="list.length <  1 && show">
+			<image src="/static/img/orders/emty.png" mode=""></image>
+			<p class="ft14 line-1-txt">暂无消费记录</p>
+			<!-- <p class="ft14 line-2-txt mt10">小充一笔,看更多好剧吧</p>
+			<navigator url="/pages/client/pay/pay">
+				<view class="ft16 btn-box mt10"><text class="ft12 btn-cz">去充值</text> </view>
+			</navigator> -->
 		</view>
 	</view>
 </template>
@@ -26,134 +31,60 @@
 <script>
 	import {
 		getUserConsumeRecord
-	} from '@/common/apis/my.js'
+	} from "@/common/apis/my.js"
 	export default {
 		data() {
 			return {
-				userinfo: [],
-				listData: [],
-				last_id: 0,
-				reload: true,
-				status: 'more',
-				userinfo: [],
-				contentText: {
-					contentdown: '上拉加载更多',
-					contentrefresh: '加载中',
-					contentnomore: '没有数据了'
-				}
+				page: 1,
+				hasMore: true,
+				list: [],
+				show: false
 			}
 		},
-		onReachBottom() {
-			this.status = 'more';
+		onLoad() {
+
+		},
+		onShow() {
+			this.page = 1;
+			this.hasMore = true;
 			this.getList();
+			uni.hideLoading();
 		},
-		onLoad() {
-			this.ongrzlTap()
+		onPullDownRefresh() {
+			this.page = 1;
+			this.list = [];
+			this.getList();
+			uni.stopPullDownRefresh();
+		},
+		onReachBottom() {
+			if (!this.hasMore) {
+				return false;
+			}
 			this.getList();
 		},
 		methods: {
-			async ongrzlTap() {
-				let data = {};
-				data.token = uni.getStorageSync("userinfo").token;
-				data.uid = uni.getStorageSync("userinfo").id;
-				uni.request({
-					url: this.configs.webUrl + '/api/user/index',
-					data: data,
-					success: res => {
-						if (res.data.code == 1) {
-							let ionfo = res.data.data
-							this.userinfo = ionfo
-						} else {
-							uni.showToast({
-								title: res.data.msg,
-								icon: "none"
-							});
-						}
-					},
-					fail: (data, code) => {
-						//console.log('fail' + JSON.stringify(data));
+			async getList() {
+
+				if (this.page <= 1) {
+					this.show = false;
+				}
+				let res = await getUserConsumeRecord(this.page);
+				if (res) {
+					if (this.page >= res.last_page) {
+						this.hasMore = false;
+					} else {
+						this.page++;
 					}
-				});
-			},
-			getList() {
-				getUserConsumeRecord().then(res => {
-					console.log(res,'getUserConsumeRecordgetUserConsumeRecordgetUserConsumeRecord')
-				})
-				let data = {
-					//column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
-				};
-				var limit = 10;
-				if (this.last_id > 0) {
-					//说明已有数据,目前处于上拉加载
-					this.status = 'loading';
-					data.offset = this.last_id * limit;
-					data._ = new Date().getTime() + '';
+					res.data.forEach((item, index) => {
+						this.list.push(item);
+					})
 				}
-				data.limit = limit
-				// data.token = uni.getStorageSync("userinfo").token;
-				// uni.request({
-				// 	url: this.configs.webUrl + '/api/user/userscoreinfo',
-				// 	data: data,
-				// 	success: data => {
-				// 		console.log(data.data)
-				// 		if (data.data.total > 0) {
-				// 			let list = data.data.rows;
-				// 			this.listData = this.reload ? list : this.listData.concat(list);
-				// 			this.reload = false;
-				// 			this.last_id = this.last_id + 1;
-				// 			if (data.data.total < this.last_id * limit) {
-				// 				this.status = '';
-				// 			}
-				// 		} else {
-				// 			this.contentText.contentdown = '没有数据'
-				// 		}
-				// 	},
-				// 	fail: (data, code) => {
-				// 		//console.log('fail' + JSON.stringify(data));
-				// 	}
-				// });
+				this.show = true;
 			},
 		}
 	}
 </script>
 
-<style>
-	.integral-log-header {
-		position: relative;
-		height: 252rpx;
-	}
-
-	.integral-log-header .bg {
-		width: 100%;
-		height: 252rpx;
-	}
-
-	.integral-log-header .main {
-		height: 252rpx;
-		width: 100%;
-		position: absolute;
-		left: 0;
-		top: 0;
-	}
-
-	.btn-integral {
-		width: 192rpx;
-		height: 80rpx;
-		background: #FFFFFF;
-		box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
-		border-radius: 40rpx;
-		text-align: center;
-		line-height: 80rpx;
-		color: #6687EF;
-		font-size: 28rpx;
-		font-weight: 500;
-	}
-
-	.integral-log-main {
-		background: #FFFFFF;
-		min-height: 1400rpx;
-		position: relative;
-		margin-top: -32rpx;
-		border-radius: 32rpx 32rpx 0rpx 0rpx;
-	}
+<style scoped lang="scss">
+	@import url("style/orders.css");
 </style>

+ 82 - 0
pages/client/consume/style/orders.css

@@ -0,0 +1,82 @@
+.body {
+	background-color: #ffffff;
+}
+
+.empty-box {
+	padding: 20px;
+	justify-content: center;
+	text-align: center;
+}
+
+.line-1-txt {
+	text-align: center;
+}
+
+.line-2-txt {
+	text-align: center;
+	color: #9e9e9e;
+}
+
+.btn-cz {
+	width: 80px;
+	text-align: center;
+	color: #fff;
+	background-color: #FF9800;
+	text-align: center;
+	border-radius: 100px;
+	padding: 3px 15px;
+}
+
+.btn-box {
+	background-color: #fff;
+	width: 100%;
+	text-align: center;
+	display: block;
+	margin-top: 5px;
+}
+
+.jilu-box {
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	border-radius: 0px;
+	background: #FFFFFF;
+}
+
+.jilu-item {
+	margin-top: 10px;
+	display: flex;
+	flex-direction: column;
+	border-bottom: solid 1rpx #d4d4d4;
+}
+
+.jilu-item:first{
+	margin-top: 0px;
+}
+.jilu-item-box{
+	display: flex;
+	justify-content: space-between;
+}
+.jilu-txt {
+	color: #9e9e9e;
+	margin-top: 6rpx;
+}
+.lines{
+	display: flex;
+	flex-direction: column;
+	justify-content:  flex-end;
+
+}
+.jilu-items{
+	display: flex;
+	flex-direction: row;
+	justify-content: center;
+	
+}
+.pay-icon{
+	margin-top: 15px;
+	margin-right: 10px;
+	align-items: center;
+	width: 30px;
+	height: 30px;
+}

+ 19 - 3
pages/video/index.nvue

@@ -110,7 +110,7 @@
 				</scroll-view>
 			</view>
 			<view v-if="fenji==2"
-				:style="'width: '+ windowWidth +'px;height:500px; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
+				:style="'width: '+ windowWidth +'px;height:70vh; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
 				<view class="charge-wrapper">
 					<view class="top">
 						<text class="charge-title">充值购买后可继续观看{{topTitle}} </text>
@@ -124,6 +124,10 @@
 						<text></text>
 						<text></text>
 					</view>
+					<scroll-view class="scroll-charge" :scroll-y="true" :scroll-top="scrollTop">
+						<recharge :user_info="user_info"> </recharge>
+						<!-- <view style="width: 1px; height: 1px; margin-top: 30px;"></view> -->
+					</scroll-view>
 				</view>
 			</view>
 		</uni-popup>
@@ -132,6 +136,10 @@
 
 
 <script>
+	import recharge from '@/pages/client/components/pay/recharge.vue'
+	import {
+		getUserInfo
+	} from "@/common/apis/my.js";
 	import {
 		getVideoInfo,
 		videoEpisodePlay,
@@ -143,6 +151,9 @@
 	} from '@/common/apis/zju.js'
 	import configs from "@/common/config.js"
 	export default {
+		components: {
+			recharge
+		},
 		data() {
 			return {
 				limitPage: 15,
@@ -176,6 +187,7 @@
 					strShareSummary: "分享总结",
 					strShareImageUrl: ""
 				},
+				user_info: {},
 				isShow: true,
 				fenji: 0,
 				controls: true,
@@ -251,8 +263,8 @@
 			this.windowHeight = uni.getSystemInfoSync().windowHeight - this.safeArea - this.ttuop
 			console.log(this.windowHeight)
 		},
-		onShow() {
-
+		async onShow() {
+			this.user_info = await getUserInfo();
 		},
 		onShareAppMessage: function(res) {
 			// #ifdef MP-WEIXIN
@@ -660,6 +672,10 @@
 		height: 50vh;
 	}
 
+	.scroll-charge {
+		height: 55vh;
+	}
+
 	.ju-wrapper {
 		display: flex;
 		flex-direction: row;