gcz 2 жил өмнө
parent
commit
942fcd17a4

+ 7 - 7
center/center.vue

@@ -8,22 +8,22 @@
 		>
 		</u-navbar>
 		<view class="page-wrap">
-			<view class="top">
-				<view class="code-wrap u-flex u-row-right"  @click="$u.route('/center/paycode')">
+			<view class="top u-flex">
+				<!-- <view class="code-wrap u-flex u-row-right"  @click="$u.route('/center/paycode')">
 					<img class="img" src="../static/img/center-code.png" alt="">
 					<text class="text">推广码</text>
-				</view>
-			<!-- 	<view class="userinfo u-flex">
+				</view> -->
+				<view class="userinfo u-flex">
 					<img class="defaultavatar" src="../static/img/defaultavatar.png" alt="">
 					<view class="text">
 						<view class="name">{{vuex_user_info.username}}</view>
-						<view class="status">
+						<!-- <view class="status">
 							<text>区域代理人/</text>
 							<text>白金/</text>
 							<text>贵阳市云岩区</text>
-						</view>
+						</view> -->
 					</view>
-				</view> -->
+				</view>
 				<img class="center-top-bg" src="../static/img/center-top-bg.png" alt="">
 			</view>
 			<view class="tool-wrap">

+ 47 - 17
center/dealList.vue

@@ -15,16 +15,18 @@
 			 :inactiveStyle="{color:'#999'}"
 			@click="tabsClick"></u-tabs>
 		</view>
+		<view class="totalAmount">
+			{{totalAmount}}
+		</view>
 		<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
-			<view class="page-wrap" v-if="dataList.length>0" >
+			<view class="page-wrap" v-show="dataList.length>0" >
 				<view class="list">
-					<view class="item u-flex u-row-between" @click="$u.route('/shopping/order')" v-for="item in dataList" :key="item.id">
+					<view class="item u-flex u-row-between" v-for="item in dataList" :key="item.id">
 						<view class="left">
-							<view class="name">{{item.recordContent}}</view>
+							<view class="name">{{item.billTitle}}</view>
 							<view class="time">{{item.createTime}}</view>
 						</view>
-						<text class="num" v-if="item.recordType!=1">-{{item.balance}}</text>
-						<text class="num plus" v-else>+{{item.balance}}</text>
+						<text class="num plus">+{{item.earningsMoney}}</text>
 					</view>
 				</view>
 			</view>
@@ -39,7 +41,7 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
-				credit:'',
+				totalAmount:'',
 				downOption: {},
 				// 上拉加载的配置(可选, 绝大部分情况无需配置)
 				upOption: {
@@ -51,9 +53,11 @@
 						tip: '暂无相关数据'
 					}
 				},
-				tabsList:[{name:'昨日',recordType:2},{name:'本月',recordType:1},{name:'历史',recordType:3}],
+				tabsList:[{name:'昨日',recordType:1},{name:'本月',recordType:2},{name:'历史',recordType:3}],
+				recordType:'',
 				params:{
-					recordType:''
+					startTime:'',
+					endTime:'',
 				},
 				activeIndex:0,
 				dataList: []
@@ -63,7 +67,7 @@
 			
 		},
 		onLoad() {
-			this.params.recordType = this.tabsList[this.activeIndex].recordType;
+			this.recordType = this.tabsList[this.activeIndex].recordType;
 			// console.log('1111', this.tabsList[this.activeIndex]);
 		},
 		methods: {
@@ -86,19 +90,41 @@
 			
 				let pageNum = page.num; // 页码, 默认从1开始
 				let pageSize = page.size; // 页长, 默认每页10条isAsc:0//时间排序 0:降序 1:升序 (默认星级降序排序)
+				console.log('recordType',this.recordType);
+				if(this.recordType==1){
+					var yesterday = new Date();
+					yesterday.setDate(yesterday.getDate() - 1);
+					var year = yesterday.getFullYear();
+					var month = yesterday.getMonth() + 1;
+					var date = yesterday.getDate();
+					// 格式化日期,补0操作
+					month = month < 10 ? '0' + month : month;
+					date = date < 10 ? '0' + date : date;
+					var yesterdayStr = year + '-' + month + '-' + date;
+					this.params.startTime = yesterdayStr;
+					this.params.endTime = yesterdayStr;
+				}else if(this.recordType==2){
+					const now = new Date();
+					this.params.startTime =  uni.$u.timeFormat(new Date(now.getFullYear(), now.getMonth(), 1), 'yyyy-mm-dd hh:MM:ss');
+					this.params.endTime =  uni.$u.timeFormat(now, 'yyyy-mm-dd hh:MM:ss');
+				}else if(this.recordType==3){
+					this.params.startTime = '',
+					this.params.endTime =  ''
+				}
 
 				this.params = Object.assign(this.params,{pageNum:pageNum,pageSize:pageSize});
-				this.$u.api.selectBalanceLogList(this.params).then(data => {
+				this.$u.api.achievement(this.params).then(data => {
 					console.log('data',JSON.parse(JSON.stringify(data)));
 					// 接口返回的当前页数据列表 (数组)
-					let curPageData = data.data.rows;
+					let curPageData = data.data.pageList.rows;
+					this.totalAmount = data.data.totalAmount;
 					console.log('curPageData',JSON.parse(JSON.stringify(curPageData)));
 					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
 					let curPageLen = curPageData.length; 
 					// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
 					// let totalPage =  data.data.data.totalPage; 
 					// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
-					let totalSize = data.data.total; 
+					let totalSize = curPageData.total; 
 					// 接口返回的是否有下一页 (true/false)
 					// let hasNext = data.xxx; 
 					// console.log('totalPage',totalPage,'curPageLen',curPageLen);
@@ -121,7 +147,7 @@
 				this.mescroll.resetUpScroll();
 			},
 			tabsClick(item){
-				this.params.recordType = item.recordType;
+				this.recordType = item.recordType;
 				this.reloadList()
 				// console.log('item',item);
 			},
@@ -134,11 +160,11 @@ page{
 }
 </style>
 <style lang="scss" scoped>
-.credit{
+.totalAmount{
 	padding: 20rpx;
 	background-color: #fff;
 	border-radius: 8rpx;
-	margin: 0 20rpx 20rpx;
+	margin: 0 0 20rpx;
 	font-size: 36rpx;
 	font-weight: 600;
 	color: #00A447;
@@ -149,11 +175,11 @@ page{
 }
 .list{
 	border-radius: 8rpx;
-	padding: 0 20rpx 20rpx;
+	padding: 0 20rpx;
 	background-color: #fff;
 	.item{
 		padding: 20rpx 0;
-		border-bottom: 0.5px solid #ddd;
+		background-color: #fff;
 		.name{
 			font-size: 30rpx;
 			font-weight: 400;
@@ -175,6 +201,10 @@ page{
 				color: #00A447;
 			}
 		}
+		&:not(:first-of-type){
+			border-bottom: 0.5px solid #ddd;
+			padding-bottom: 20rpx;
+		}
 	}
 }
 </style>

+ 16 - 4
center/mystore.vue

@@ -19,12 +19,12 @@
 		<view class="page-wrap">
 			<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
 				<view class="u-flex u-flex-wrap u-row-between">
-					<view class="list-item" v-for="item in dataList" :key="item.id">
+					<view class="list-item" v-for="item in dataList" @click="$u.route('/center/store',{id:item.id})" :key="item.id">
 						<view class="item">
 							<view class="image-wrap">
 								<u--image mode="scaleToFill" height="300rpx" :showLoading="true" class="image" :src="item.mainImg"></u--image>
 							</view>
-							<view class="name ellipsis-1">{{item.goodsName}}</view>
+							<view class="name ellipsis-1">{{item.name}}</view>
 						</view>
 					</view>
 				</view>
@@ -43,10 +43,22 @@
 		},
 		data() {
 			return {
+				downOption: {},
+				// 上拉加载的配置(可选, 绝大部分情况无需配置)
+				upOption: {
+					page: {
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					empty: {
+						tip: '暂无相关数据'
+					}
+				},
 				tabsList:[],
 				activeIndex:0,
 				typeId:null,
 				dataList:[]
+				
 			}
 		},
 		onLoad() {
@@ -92,10 +104,10 @@
 					pageSize:pageSize
 				};
 				console.log('params',params);
-				this.$u.api.shopGoods(params).then(data => {
+				this.$u.api.shopList(params).then(data => {
 					console.log('data',JSON.parse(JSON.stringify(data)));
 					// 接口返回的当前页数据列表 (数组)
-					let curPageData = data.data.rows;
+					let curPageData = data.data.list;
 					// console.log('curPageData',JSON.parse(JSON.stringify(curPageData)));
 					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
 					let curPageLen = curPageData.length; 

+ 70 - 0
center/store.vue

@@ -0,0 +1,70 @@
+<template>
+	<view class="pages">
+		<u-navbar
+			title="店铺详情"
+			:placeholder="true"
+			:autoBack="true"
+			 @leftClick="leftClick"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+		<view class="page-wrap">
+			<u-swiper
+				v-if="details.slideImgList.length>0"
+				:list="details.slideImgList"
+				height="700rpx"
+				@change="e => currentNum = e.current"
+				:autoplay="false"
+				indicatorStyle="right: 20px"
+			>
+				<view
+					slot="indicator"
+					class="indicator-num"
+				>
+					<text class="indicator-num__text">{{ currentNum + 1 }}/{{ details.slideImgList.length }}</text>
+				</view>
+			</u-swiper>
+			<view class="info">
+				<view class="title">
+					
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				id:'',
+				details:{slideImgList:[]},
+				currentNum:0,
+			}
+		},
+		onShow() {
+		},
+		onLoad(page) {
+			this.id = page.id;
+			this.getPageData();
+		},
+		methods: {
+			getPageData(){
+				this.$u.api.shopById({id:this.id}).then(res=>{
+					this.details = res.data;
+					console.log('getPageData',this.details);
+				}).catch(err=>{
+					console.log('getPageData',err);
+				})
+			},
+		}
+	}
+</script>
+<style>
+page{
+	background-color: #F5F5F5;
+}
+</style>
+<style lang="scss" scoped>
+
+</style>

+ 15 - 0
common/apiurl.js

@@ -32,6 +32,21 @@ const apiurl = {
 		url: '/agentInfo/memberSta',
 		type: 'get'
 	},
+	//代理人业绩
+	achievement: {
+		url: '/agentInfo/achievement',
+		type: 'get'
+	},
+	//店铺列表
+	shopList: {
+		url: '/agentInfo/shopList',
+		type: 'post'
+	},
+	//ID获取店铺详情
+	shopById: {
+		url: '/agentInfo/shopById',
+		type: 'get'
+	},
 	//轮播图
 	swiperList: {
 		url: '/advList/pageList',

+ 7 - 0
pages.json

@@ -47,6 +47,13 @@
 						"navigationStyle": "custom"
 					}
 				},
+				{
+					"path": "store",
+					"style": {
+						"navigationBarTitleText": "店铺详情",
+						"navigationStyle": "custom"
+					}
+				},
 				{
 					"path": "client",
 					"style": {

+ 1 - 19
pages/index/index.vue

@@ -3,7 +3,7 @@
 		<view class="" :style="{height: navHeight+'px' }"></view>
 		<view class="page-wrap">
 			<view class="user u-flex"  @click="$u.route('/center/center',{})">
-				<u-icon name="account" color="#333" size="36"></u-icon>
+				<u-icon name="../../static/img/icon-user.png" color="#333" size="38rpx"></u-icon>
 				<text class="name">{{vuex_user_info.username}}</text>
 				<!-- <text class="level">白金代理人</text> -->
 			</view>
@@ -118,9 +118,6 @@
 			// console.log('userInfo',userInfo);
 			let that = this;
 			this.swiperList();
-			setTimeout(()=>{
-				that.getCenterImg();
-			},200);
 			this.getSystemInfo();
 			// console.log('statusBarHeight',this.statusBarHeight);
 			// console.log('navigationBarHeight',this.navigationBarHeight);
@@ -149,21 +146,6 @@
 					id: item.id
 				});
 			},
-			getCenterImg(){
-				this.$u.api.swiperList({postion:2}).then(res=>{
-					this.centerImg = res.data.rows;
-					// console.log('res',res.data.rows);
-				}).catch(err=>{
-					console.log('swiperList',err.data);
-				})
-			},
-			centerImgClick(e){
-				let item = this.centerImg[e];
-				uni.$u.route('/xushuo/dynamicdetails', {
-					type: 'swiperDetail',
-					id: item.id
-				});
-			},
 			getHotGoods(){
 				this.$u.api.topGoodList({pageNum:1,pageSize:1}).then(res=>{
 					this.hotGoods = res.data.rows;

BIN
static/img/icon-user.png