You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							179 lines
						
					
					
						
							5.5 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							179 lines
						
					
					
						
							5.5 KiB
						
					
					
				
								<template>
							 | 
						|
									<view>
							 | 
						|
										<lf-nav title="兑换记录" :showIcon="true" bgColor="#fff"></lf-nav>
							 | 
						|
										<view class="head">
							 | 
						|
											<u-search placeholder="搜你想要的" v-model="value" @custom="customClick"></u-search>
							 | 
						|
										</view>
							 | 
						|
										<scroll-view :style="{height: autoHeight}" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher"
							 | 
						|
											@scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
							 | 
						|
											<view class="content">
							 | 
						|
												<view class="card" v-for="(item, index) in list" :key="index" @click="$url('/pages/order/newdetail/newdetail?type=point&order_id='+item.order_no)">
							 | 
						|
													<view>
							 | 
						|
														<text class="lf-iconfont icon-Group- lf-font-30"></text>
							 | 
						|
														<text class="shop-name">{{item.from}}</text>
							 | 
						|
														<text class="lf-iconfont icon-xiangyou lf-font-24"></text>
							 | 
						|
													</view>
							 | 
						|
													<view class="lf-flex lf-m-t-20" v-for="(item2,index2) of item.items" :key="index2">
							 | 
						|
														<image class="goods-img" :src="item2.item_meta.image"></image>
							 | 
						|
														<view class="info">
							 | 
						|
															<view class="lf-font-26 lf-color-333 lf-line-2">{{item2.item_name}}</view>
							 | 
						|
															<view class="lf-row-between" style="line-height: 1;">
							 | 
						|
																<text class="lf-font-24 lf-color-777">{{item2.item_meta.specs_text}}</text>
							 | 
						|
																<text class="lf-font-32 lf-color-primary lf-font-bold">{{item2.total_yuan}}</text>
							 | 
						|
															</view>
							 | 
						|
														</view>
							 | 
						|
													</view>
							 | 
						|
													<view class="order-num">
							 | 
						|
														<text>{{item.status_text}}</text>
							 | 
						|
														<!-- <text style="color: #F63434;">删除订单</text> -->
							 | 
						|
													</view>
							 | 
						|
												</view>
							 | 
						|
												<!-- 空数据的情况 -->
							 | 
						|
												<view class="loading-more">
							 | 
						|
													<text v-if="list.length != 0"
							 | 
						|
														:class="{'loading-more-text': loadingClass}">{{ loadingText }}</text>
							 | 
						|
													<lf-nocontent src="/static/images/empty.png" v-else></lf-nocontent>
							 | 
						|
												</view>
							 | 
						|
											</view>
							 | 
						|
										</scroll-view>
							 | 
						|
										<u-back-top :scrollTop="pageScrollTop"></u-back-top>
							 | 
						|
									</view>
							 | 
						|
								</template>
							 | 
						|
								
							 | 
						|
								<script>
							 | 
						|
									export default {
							 | 
						|
										data(){
							 | 
						|
											return {
							 | 
						|
												value: '',
							 | 
						|
												list: [],
							 | 
						|
												page: 1,
							 | 
						|
												isPage: true,
							 | 
						|
												loadingClass: true,
							 | 
						|
												loadingText: '正在加载中',
							 | 
						|
												scrollH: 0,
							 | 
						|
												nav_height: 0,
							 | 
						|
												isRefresher: true,
							 | 
						|
												pageSize: 10
							 | 
						|
											}
							 | 
						|
										},
							 | 
						|
										computed: {
							 | 
						|
											autoHeight(){
							 | 
						|
												return `calc(${this.scrollH}px - ${this.nav_height}px - 180rpx)`;
							 | 
						|
											}
							 | 
						|
										},
							 | 
						|
										onLoad(){
							 | 
						|
											let info = uni.getSystemInfoSync();
							 | 
						|
											this.scrollH = info.screenHeight;
							 | 
						|
											this.getPointOrder()
							 | 
						|
										},
							 | 
						|
										methods: {
							 | 
						|
											// 页面触底,加载下一页
							 | 
						|
											onScrolltolower(){
							 | 
						|
												if(this.isPage){
							 | 
						|
													this.page = this.page + 1;
							 | 
						|
													this.getPointOrder();
							 | 
						|
												}
							 | 
						|
											},
							 | 
						|
											// 下拉刷新处理
							 | 
						|
											refreshFn(options){
							 | 
						|
												this.page = 1;
							 | 
						|
												this.isPage = true;
							 | 
						|
												this.loadingClass = true;
							 | 
						|
												this.list = []
							 | 
						|
												this.loadingText = '正在加载中';
							 | 
						|
												this.getPointOrder(options);
							 | 
						|
											},
							 | 
						|
											// scroll-view 下拉刷新
							 | 
						|
											onRefresherrefresh(){
							 | 
						|
												this.isRefresher = true;
							 | 
						|
												this.refreshFn({type: 'scrollRefresh'});
							 | 
						|
											},
							 | 
						|
											customClick(event){
							 | 
						|
												console.log(event)
							 | 
						|
											},
							 | 
						|
											getPointOrder(options = {}){
							 | 
						|
												this.$http.get({
							 | 
						|
													api: 'api/order/point/list',
							 | 
						|
													header: {
							 | 
						|
													   Authorization: `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjVkYTY5YjM5NWFhYzM5NzVmMzI3ZTEwZDEyMzAzZjI5MzE4ZmU2OGE2Njg0MTU0MWVjMjQ2NWM4ZWJkYjRlMTUwMmY1NWM0NDlkOTcxZDdjIn0.eyJhdWQiOiIzIiwianRpIjoiNWRhNjliMzk1YWFjMzk3NWYzMjdlMTBkMTIzMDNmMjkzMThmZTY4YTY2ODQxNTQxZWMyNDY1YzhlYmRiNGUxNTAyZjU1YzQ0OWQ5NzFkN2MiLCJpYXQiOjE2MzIzODY3NDAsIm5iZiI6MTYzMjM4Njc0MCwiZXhwIjoxNjYzOTIyNzQwLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.am-szF_sZcjtyOnEJT1DHMnr1hjAZ90MJc1Pc3AD3FrcQU5xb-u43ddL70ZmM3OxxLTZlmrB8OA3XJYREMtcz26MzwOMfopB9A5AH1EjHiFCV_368cq4ZpXNFi_Sn_LrY9Wje0-WMvkznF8tbrdCNrZn5YyIV47cwEnUNQrrREX4OhcgrSfNvwnh8_O_fueBwws9yY3tTlvVB7-AvG2urFI5XCzygsE3llE0wxF5ZJO1T5QRYLDse2BQ3d9feFzO5_7FiVspKr8DrJUlZP-Zz02UgIDIA_PX0UO2M0KeBwqPYq2d5uEnXT8or7K9coSnHRqbbr4qn6iczxDu4ofM58oCcaPycbtI3RvP2SMZuWmX8fXw-T99XltK_uJEU_wlIkrjvabzyo3tkrxRrwmzJEb3Yf4Lbah_xtfi24Nsu9SRjdw8YoiF6YhuuU5YaOn-wLltgmugfYpkFpEOneVAxoMjkm5IxZAJYMXF-DeSpdOoiTmuIRZYX4GDa55s_31r0YMyF6IIQNUvOjHHk-sJSHG0kPd5QivLP7dxE5XndwyFKAOeM97X2TjdYMhJz0EBCyS4Y_pI6AFWsxJkKsa0aqvBAeJyOV9k8kbYwtPeeBhBNsDWSlGBEZYMcoAv-C-IBZzd7gu2Ceh_MJPItrnsvj8W43Cv1TwxD26bJyt9EUY`
							 | 
						|
													},
							 | 
						|
													data: {
							 | 
						|
														page: this.page
							 | 
						|
													}
							 | 
						|
												}).then(res => {
							 | 
						|
													console.log("----", res);
							 | 
						|
													let isPage = this.page < res.data.meta.pagination.total_pages?true:false;
							 | 
						|
													this.isPage = isPage;
							 | 
						|
													if(!isPage) {
							 | 
						|
														this.loadingClass = false;
							 | 
						|
														this.loadingText = '没有更多数据啦~';
							 | 
						|
													}
							 | 
						|
													if(options.type == 'pageRefresh') {
							 | 
						|
														uni.stopPullDownRefresh();
							 | 
						|
													}else if(options.type == 'scrollRefresh') {
							 | 
						|
														this.isRefresher = false;
							 | 
						|
													}
							 | 
						|
													if(this.page == 1) {
							 | 
						|
														this.list = res.data.data;
							 | 
						|
													}else {
							 | 
						|
														this.list.push(...res.data.data);
							 | 
						|
													}
							 | 
						|
													
							 | 
						|
												})
							 | 
						|
											}
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
								</script>
							 | 
						|
								
							 | 
						|
								<style>
							 | 
						|
									page{
							 | 
						|
										background-color: #F8F8F8;
							 | 
						|
									}
							 | 
						|
								</style>
							 | 
						|
								<style lang="scss" scoped="scoped">
							 | 
						|
									.head{
							 | 
						|
										padding: 30rpx 32rpx;
							 | 
						|
										background-color: #FFFFFF;
							 | 
						|
									}
							 | 
						|
									.content{
							 | 
						|
										padding: 30rpx 32rpx;
							 | 
						|
										.card{
							 | 
						|
											width: 686rpx;
							 | 
						|
											height: 323rpx;
							 | 
						|
											background: #FFFFFF;
							 | 
						|
											border-radius: 20rpx;
							 | 
						|
											padding: 30rpx;
							 | 
						|
											box-sizing: border-box;
							 | 
						|
											&:nth-child(n+2){
							 | 
						|
												margin-top: 20rpx;
							 | 
						|
											}
							 | 
						|
											.shop-name{
							 | 
						|
												font-size: 28rpx;
							 | 
						|
												color: #222222;
							 | 
						|
												font-weight: bold;
							 | 
						|
												margin: 0 15rpx;
							 | 
						|
											}
							 | 
						|
											.goods-img{
							 | 
						|
												width: 130rpx;
							 | 
						|
												height: 130rpx;
							 | 
						|
												border-radius: 5rpx;
							 | 
						|
												margin-right: 15rpx;
							 | 
						|
												background-color: #EEEEEE;
							 | 
						|
											}
							 | 
						|
											.info{
							 | 
						|
												width: 480rpx;
							 | 
						|
												height: 130rpx;
							 | 
						|
												display: flex;
							 | 
						|
												flex-direction: column;
							 | 
						|
												justify-content: space-between;
							 | 
						|
											}
							 | 
						|
											.order-num{
							 | 
						|
												font-size: 24rpx;
							 | 
						|
												color: #555555;
							 | 
						|
												display: flex;
							 | 
						|
												justify-content: space-between;
							 | 
						|
												margin-top: 28rpx;
							 | 
						|
											}
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
								</style>
							 |