lhl %!s(int64=4) %!d(string=hai) anos
pai
achega
1ead0dda6d
Modificáronse 7 ficheiros con 139 adicións e 112 borrados
  1. 0 34
      api/user.js
  2. 8 0
      api/wallet.js
  3. 14 7
      pages.json
  4. 21 18
      pages/set/userinfo.vue
  5. 3 9
      pages/user/extension.vue
  6. 76 41
      pages/user/integral.vue
  7. 17 3
      pages/user/user.vue

+ 0 - 34
api/user.js

@@ -128,14 +128,6 @@ export function getSpreadPeople(data){
 		data
 	})
 }
-//我的会员
-export function getMyTvillage(data){
-	return request({
-		url:'/api/mytvillage',
-		method:'get',
-		data
-	})
-}
 
 //推广佣金/提现总和 
 //3=佣金,4=提现
@@ -145,30 +137,4 @@ export function getSpreadCount(data,type) {
 		method:'get',
 		data
 	})
-}
-//我的实体店
-export function getMyStore(data) {
-	return request({
-		url:'/api/mystore',
-		method:'get',
-		data
-	})
-}
-
-//申请会员 店长
-export function enter(data) {
-	return request({
-		url:'/api/enter',
-		method:'post',
-		data
-	})
-}
-
-//编辑门店
-export function editStore(data) {
-	return request({
-		url:'/api/store_edit',
-		method:'post',
-		data
-	})
 }

+ 8 - 0
api/wallet.js

@@ -98,5 +98,13 @@ export function balance(data) {
 	});
 }
 
+//积分明细
+export function integral(data,state) {
+	return request({
+		url: '/api/integral/list'+state,
+		method: 'get',
+		data
+	});
+}
 
 

+ 14 - 7
pages.json

@@ -141,11 +141,12 @@
 			}
 		},
 		{
-			"path": "pages/set/userinfo",
-			"style": {
-				"navigationBarTitleText": "修改资料"
-			}
-		}, {
+				"path": "pages/set/userinfo",
+				"style": {
+					"navigationBarTitleText": "修改资料"
+				}
+		},
+		{
 			"path": "pages/cart/cart",
 			"style": {
 				"navigationBarTitleText": "购物车"
@@ -193,8 +194,14 @@
 		{
 			"path": "pages/user/extension",
 			"style": {
-				"navigationStyle": "custom",
-				"navigationBarTitleText": "我的推广"
+				"navigationBarTextStyle": "black",
+				"navigationBarBackgroundColor": "transparent",
+				"app-plus": {
+					"titleNView": {
+						"type": "float",
+						"titleText": "我的推广"
+					}
+				}
 			}
 		},
 		// {

+ 21 - 18
pages/set/userinfo.vue

@@ -38,9 +38,9 @@
   	</view>
   	<view class="row b-b flex" v-if="userInfo.account || userInfo.phone">
   		<text class="tit">用户账号</text>
-  		<input class="input" v-model="userInfo.account || userInfo.phone" type="number" disabled="true" placeholder-class="placeholder" />
+  		<input class="input" v-model="userInfo.account || userInfo.phone" type="number" disabled="true" placeholder-class="placeholder" style="color: #999;"/>
   	</view>
-  	<view class="submit-box flex" >
+  	<view class="submit-box" >
   		<view class="submit" @click="edit">确认修改</view>
   		<view class="submit" @click="toLogout">退出登录</view>
   	</view>
@@ -52,7 +52,7 @@
   import uniList from '@/components/uni-list/uni-list.vue';
   import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
   import { mapState, mapMutations } from 'vuex';
-  import { logout } from '@/api/set.js';
+  import { logout } from '@/api/set.js';
 
   import {
   		uploads,edit,upload
@@ -64,7 +64,7 @@
   	},
   	data() {
   		return {
-  			userInfo:{},
+  			userInfo:{},
 			pics:[],
   		};
   	},
@@ -94,25 +94,28 @@
   				}
   			});
   		},
-  		imgsub() {
-			let obj = this
-			upload({
-				filename: ''
-			}).then(res => {
-				console.log(res[0].url)
-				obj.userInfo.avatar = res[0].url
+  		imgsub() {
+			let obj = this
+			upload({
+				filename: ''
+			}).then(res => {
+				console.log(res[0].url)
+				obj.userInfo.avatar = res[0].url
 			});
   		},
   		edit() {
-  			const that = this;
-			uni.showLoading({
-				title: '提交中...',
-				mask:true
-			})
+  			const that = this;
+			uni.showLoading({
+				title: '提交中...',
+				mask:true
+			})
+			if(this.userInfo.nickname == '') {
+				return this.$api.msg('昵称不能为空!')
+			}
   			edit({
   				avatar: this.userInfo.avatar,
   				nickname: this.userInfo.nickname
-  			}).then( e =>{
+  			}).then( e =>{
 				uni.hideLoading()
   				that.$api.msg('修改成功');
   				setTimeout(()=> {
@@ -191,7 +194,7 @@
   		.submit{
   			margin: 40rpx auto;
   			width: 560rpx;
-  			background-color: #ff4c4b;
+  			background-color: #6EAB4E;
   			color: #FFFFFF;
   			text-align: center;
   			padding:26rpx 0rpx;

+ 3 - 9
pages/user/extension.vue

@@ -2,14 +2,8 @@
  	<view class="content">
  		<view class="content-money">
  			<view class="money-box">
- 				<!-- <view class="goback-box" @click="toBack">
- 					<image class="goback" src="../../static/img/tgbg.png" mode=""></image>
- 				</view> -->
- 				<!-- <view class="header">我的推广</view> -->
  				<image class="tuiguang_bg" src="../../static/image/jiedian.png"></image>
- 			 <!--  <view class="money_img"><image :src="list.avatar || img"></image></view> -->
  			 <view class="money-frame">
- 				 <!-- <view class="money_name">我的推广</view> -->
  				 <view class="money_num">
  					{{userInfo.spread_count || '0'}}
  					<text class="money_ren">人</text>
@@ -255,7 +249,7 @@
  			
  			font-size: 32rpx;
  			font-weight: bold;
- 			color: #921a23;
+ 			color: #3F7C1F;
  		}
  		.text {
  			padding-bottom: 26rpx;
@@ -263,7 +257,7 @@
  			font-weight: 500;
  			color: #666666;
  			&.current {
- 				border-bottom: 2px solid #921a23;
+ 				border-bottom: 2px solid #3F7C1F;
  			}
  		}
  		.icon {
@@ -355,7 +349,7 @@
  		font-size: 72rpx;
  		font-family: PingFang SC;
  		font-weight: bold;
- 		color: #FF4C4C;
+ 		color: #3F7C1F;
  		.money_ren {
  			font-size: 36rpx;
  		}

+ 76 - 41
pages/user/integral.vue

@@ -9,17 +9,16 @@
 		<view class="navbar">
 			<view class="nav-item" v-for="(item, index) in navList" :key="index"
 				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
-		
+
 		</view>
-		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab"
-			>
+		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab">
 			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
 				<!-- 空白页 -->
-				<!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
+				<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
 				<!-- 推广奖励 -->
-				<scroll-view class="scorll" scroll-y="true" >
+				<scroll-view class="scorll" scroll-y="true">
 					<view class="cost">
-						<view class="award" v-for="item in 10">
+						<view class="award" v-for="item in tabItem ">
 							<view class="award-left">
 								<view class="text">消费赠送</view>
 								<view class="time">2021-8-26 09:30</view>
@@ -28,20 +27,30 @@
 						</view>
 					</view>
 				</scroll-view>
-		
+
 			</swiper-item>
 		</swiper>
-	</view>
-</template>
-
+	</view>
+</template>
+
 <script>
-export default {
-	data () {
-		return {
-			height: '',
+	// 组件
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import empty from '@/components/empty';
+	//接口
+	import { integral } from '@/api/wallet.js';
+	export default {
+		components: {
+			empty,
+			uniLoadMore
+		},
+		data() {
+			return {
+				height: '',
 				tabCurrentIndex: 0,
-				navList: [{
-						state: 1,
+				navList: [
+					{
+						state: 0,
 						text: '收入',
 						loadingType: 'more',
 						orderList: [],
@@ -49,7 +58,7 @@ export default {
 						limit: 10 //每次信息条数
 					},
 					{
-						state: 2,
+						state: 1,
 						text: '支出',
 						loadingType: 'more',
 						orderList: [],
@@ -59,50 +68,75 @@ export default {
 				],
 				list: [],
 				money: ''
-		}
-	},
-	methods: {
-		//swiper 切换
-		changeTab (e) {
-			this.tabCurrentIndex = e.target.current;
-			this.loadData('tabChange')
+			}
 		},
-		//顶部tab点击
-		tabClick(index) {
-			this.tabCurrentIndex = index;
+		methods: {
+			//swiper 切换
+			changeTab(e) {
+				this.tabCurrentIndex = e.target.current;
+				this.loadData('tabChange')
+			},
+			//顶部tab点击
+			tabClick(index) {
+				this.tabCurrentIndex = index;
+			},
+			loadData(type) {
+				let obj = this
+				let index = obj.tabCurrentIndex
+				let navItem = obj.navList[index]
+				if(navItem.loadingType == 'loading' || navItem.loadingType == 'noMore') {
+					return 
+				}
+				if(type == 'tabChange' && navItem.loaded == 'loaded') {
+					return 
+				}
+				navItem.loadingType == 'loading';
+				integral({
+					page: navItem.page,
+					limit: navItem.limit
+				},navItem.state).then( res => {
+					console.log(res)
+				})
+				
+			}
 		}
 	}
-}
-</script>
-
+</script>
+
 <style lang="scss">
 	.container {
 		width: 750rpx;
 		height: 1334rpx;
 		background-color: #f1f1f1;
+
 		.header {
+			position: relative;
 			image {
 				width: 750rpx;
 				height: 400rpx;
 			}
+
 			.money {
 				font-size: 72rpx;
 				font-family: PingFang SC;
 				font-weight: 500;
 				color: #3F7C1F;
-				top: 15%;
 				position: absolute;
+				top: 50%;
 				left: 50%;
-				transform: translate(-50%);
+				transform: translate(-50% ,-50%);
 			}
 		}
+
 		.swiper-box {
 			height: calc(100% - 500rpx);
 			background-color: #FFFFFF;
 		}
+
 		.scorll {
 			height: 90%;
 		}
+
 		.navbar {
 			display: flex;
 			height: 100rpx;
@@ -112,7 +146,7 @@ export default {
 			position: relative;
 			z-index: 10;
 			margin-top: 25rpx;
-		
+
 			.nav-item {
 				flex: 1;
 				display: flex;
@@ -122,10 +156,10 @@ export default {
 				font-size: 15px;
 				color: #999999;
 				position: relative;
-		
+
 				&.current {
 					color: #333333;
-		
+
 					&:after {
 						content: '';
 						position: absolute;
@@ -139,11 +173,12 @@ export default {
 				}
 			}
 		}
+
 		.cost {
 			width: 750rpx;
 			height: auto;
 			background-color: #fff;
-		
+
 			.award {
 				width: 701rpx;
 				height: 132rpx;
@@ -152,13 +187,13 @@ export default {
 				display: flex;
 				justify-content: space-between;
 				align-items: center;
-		
+
 				.award-left {
 					width: 221rpx;
 					height: 40rpx;
 					margin-left: 30rpx;
 					margin-bottom: 35rpx;
-		
+
 					.text {
 						width: 182rpx;
 						height: 30rpx;
@@ -168,7 +203,7 @@ export default {
 						color: #666666;
 						margin-bottom: 16rpx;
 					}
-		
+
 					.time {
 						width: 221rpx;
 						height: 20rpx;
@@ -178,7 +213,7 @@ export default {
 						color: #AEAEAE;
 					}
 				}
-		
+
 				.award-right {
 					font-size: 36rpx;
 					font-family: PingFang SC;
@@ -188,5 +223,5 @@ export default {
 				}
 			}
 		}
-	}
+	}
 </style>

+ 17 - 3
pages/user/user.vue

@@ -11,11 +11,11 @@
 					<image :src=" userInfo.avatar || '../../static/error/missing-face.png' "></image>
 					<view class="info-box">
 						<view class="username">{{ userInfo.nickname || '游客' }}</view>
-						<view class="phone">{{userInfo.phone}}</view>
+						<view class="phone" v-if="userInfo.phone">{{userInfo.phone | phone}}</view>
 					</view>
 				</view>
 				<!-- 设置 -->
-				<view class="infor-right" @click="nav('/pages/user/shezhi')">
+				<view class="infor-right" @click="nav('/pages/set/userinfo')">
 					<image src="../../static/img/img18.png" mode="scaleToFill"></image>
 					<view class="setting">设置</view>
 				</view>
@@ -63,7 +63,7 @@
 					<image src="../../static/img/img24.png" mode="scaleToFill"></image>
 					<view class="text">我的积分</view>
 				</view>
-				<view class="order-item" @click="nav('/pages/user/extend')">
+				<view class="order-item" @click="nav('/pages/user/extension')">
 					<image src="../../static/img/img25.png" mode="scaleToFill"></image>
 					<view class="text">我的推广</view>
 				</view>
@@ -121,6 +121,7 @@
 	import uniPopup from '@/components/uni-popup/uni-popup.vue';
 	import uniCopy from '@/utils/uni-copy.js';
 	import { mapState, mapMutations } from 'vuex';
+	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 	export default {
 		components: {
 			uniPopup
@@ -130,6 +131,16 @@
 				text:'123465'
 			}
 		},
+		filters: {
+			phone(val) {
+				let str = ''
+				if(val) {
+					val = "" + val;
+					str = val.substr(0,3) + "****" + val.substr(7)
+				}
+				return str
+			}
+		},
 		onShow() {
 			//判断是否已经登录
 			if (this.hasLogin) {
@@ -257,6 +268,8 @@
 				image {
 					width: 126.5rpx;
 					height: 126.5rpx;
+					border-radius: 50%;
+					flex-shrink: 0;
 				}
 
 				.info-box {
@@ -271,6 +284,7 @@
 				}
 
 				.phone {
+					padding-top: 10rpx;
 					font-size: 26rpx;
 					font-family: PingFang SC;
 					font-weight: 500;