zizhong.wang преди 6 години
родител
ревизия
c39c790af6
променени са 6 файла, в които са добавени 445 реда и са изтрити 225 реда
  1. 88 2
      App.vue
  2. 47 1
      pages/index/index.vue
  3. 24 0
      pages/selfCenter/awardPage/index.vue
  4. 28 8
      pages/selfCenter/cashoutPage/index.vue
  5. 23 1
      pages/selfCenter/helpPage/index.vue
  6. 235 213
      pages/selfCenter/index.vue

+ 88 - 2
App.vue

@@ -1,14 +1,100 @@
 <script>
+	var md5 = require("./common/md5.js");
 	export default {
+		globalData: {  //https://stock.xazhima.com/
+		    //shareUrl:'https://stock.xazhima.com/api/api.php',
+			shareUrl: 'http://fenxiao.xazhima.com/api/api.php', //开发环境全局接口域名 线上:https://guolu.xazhima.com/
+			globalTimestamp: (Date.now()).toString(),
+			user_id: '',
+			open_id:'',
+			user_name:'',
+			user_headUrl:'',
+			isAuth:true,
+			sessionId: '',
+			cleanPayTime: '',
+			pageSize: '', // 列表加载的pageSize
+			isAndroid:Boolean,
+			isIos:false,
+			globalShareCounts:'',
+		},
 		onLaunch: function() {
-			console.log('App Launch')
+			// console.log('App Launch')
+		    // let equType = uni.getSystemInfoSync().platform;
+			//  switch(equType){
+			//     case 'android':
+			//        console.log('运行Android上')
+			//        break;
+			//     case 'ios':
+			//        console.log('运行iOS上');
+			//        setTimeout(()=>{
+			// 		  getApp().globalData.isIos = true 
+			// 	   },100)
+			//        break;
+			//     default:
+			//        console.log('运行在开发者工具上')
+			//        break;
+			// }
 		},
 		onShow: function() {
 			console.log('App Show')
 		},
 		onHide: function() {
 			console.log('App Hide')
-		}
+		},
+		methods:{
+			getCodeRabot(res){
+				uni.request({
+					url:getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'login',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						code: res.code,
+						sign: md5('login' + getApp().globalData.globalTimestamp),
+						// invited:'invited'
+					},
+					success: res => {
+						// 通过openid发起会员登录
+						 getApp().globalData.user_id = res.data.msg.id;
+						 getApp().globalData.open_id = res.data.msg.openid;
+						 getApp().globalData.isAuth = res.data.msg.isauth === '0';
+						 getApp().globalData.user_name = res.data.msg.name;
+						 getApp().globalData.user_headUrl = res.data.msg.headimg;
+						 getApp().globalData.times = res.data.msg.times;
+						 getApp().globalData.total_times = res.data.msg.total_times;
+					} 
+				});
+			},
+		 	loginRabot(){
+				uni.request({
+					url: getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'login',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						wx_openid: res.data.data.openid,
+						sign: md5('login' + getApp().globalData.globalTimestamp)
+					},
+					success: res => {
+						if (res.data.code === 200) {
+							if (res.data.data === 0) {
+								// 没有会员数据,走默认注册逻辑
+							} else {
+								// 获取每个页面需要的memberId
+								let member_id = res.data.data.member_id;
+								getApp().globalData.member_id = member_id;
+							}
+						}
+					}
+				});
+			}
+		},
 	}
 </script>
 

+ 47 - 1
pages/index/index.vue

@@ -31,10 +31,12 @@
 </template>
 
 <script>
+	var md5 = require("../../common/md5.js");
 	export default {
 		data() {
 			return {
 				title: 'Hello',
+				pageInfo:{},
 				productList:[
 					{   
 						id:'1',
@@ -64,7 +66,8 @@
 			}
 		},
 		onLoad() {
-
+          this.getPageInfo();
+		  this.getPageProductList();
 		},
 		onShareAppMessage() {
 			console.log(111);
@@ -74,6 +77,49 @@
 			    }
 		},
 		methods: {
+			 getPageInfo(){ //获取首页面基本信息接口
+				 let that = this;
+				uni.request({
+					url: getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'getHomePageInfo',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						id: 1,
+						sign: md5('getHomePageInfo' + getApp().globalData.globalTimestamp)
+					},
+					success: res => {
+						if (res.data.code === 200) {
+							that.pageInfo = res.data.msg
+							console.log(res.data.msg)
+						}
+					}
+				});
+			},
+			 getPageProductList(){ //获取首页面产品列表接口
+				uni.request({
+					url: getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'getProductsList',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						page: '',
+						pageSize:'',
+						sign: md5('getProductsList' + getApp().globalData.globalTimestamp)
+					},
+					success: res => {
+						if (res.data.code === 200) {
+							console.log(res.data.msg)
+						}
+					}
+				});
+			},
 			goDetail(){
 				uni.navigateTo({
 					url: '/pages/index/detailPage/index',

+ 24 - 0
pages/selfCenter/awardPage/index.vue

@@ -37,6 +37,7 @@
 </template>
 
 <script>
+	var md5 = require('../../../common/md5.js')
 export default {
 	data() {
 		return {
@@ -70,8 +71,31 @@ export default {
 		};
 	},
 	onLoad() {
+		this.getScoreList();
 	},
 	methods: {
+		 getScoreList(){
+					 uni.request({
+					 	url: getApp().globalData.shareUrl, //需要设置为全局
+					 	method: 'POST',
+					 	header: {
+					 		'content-type': 'application/x-www-form-urlencoded'
+					 	},
+					 	data: {
+					 		method: 'getScoreList',
+					 		timestamp: getApp().globalData.globalTimestamp, //Date.now()
+					 		page: '',
+					 		pageSize:'',
+							uid:'1',
+					 		sign: md5('getScoreList' + getApp().globalData.globalTimestamp)
+					 	},
+					 	success: res => {
+					 		if (res.data.code === 200) {
+					 			console.log(res.data.msg)
+					 		}
+					 	}
+					 });
+		}
 	}
 };
 </script>

+ 28 - 8
pages/selfCenter/cashoutPage/index.vue

@@ -18,7 +18,7 @@
 				提现明细
 			</view>
 			
-			<view class="leader-info" v-for="item in teamList" :key='item.id'>
+			<view class="leader-info" v-for="item in cashOutList" :key='item.id'>
 				<view class="leader-column">
 					<view>
 						<text style="font-size: 30rpx;">{{item.time}}</text>
@@ -40,34 +40,31 @@
 </template>
 
 <script>
+var md5 = require('../../../common/md5.js')
 export default {
 	data() {
 		return {
 			title: 'selfCenter',
-			teamList: [
+			cashOutList: [
 				{
-					name: '晚霞',
 					money: '28.35',
 					time: '2019-02-14 00:00',
 					status:'进行中',
 					id: 1
 				},
 				{
-					name: '午霞',
 					money: '66.12',
 					time: '2019-02-15 00:00',
 					status:'已到账',
 					id: 2
 				},
 				{
-					name: '午霞A',
 					money: '32.15',
 					time: '2019-02-15 01:00',
 					status:'进行中',
 					id:3
 				},
 				{
-					name: '午霞2',
 					money: '12.00',
 					time: '2019-02-16 00:00',
 					status:'已到账',
@@ -77,6 +74,7 @@ export default {
 		};
 	},
 	onLoad() {
+		this.getCashOutList()
 	},
 	methods: {
 		goApplyCash(){
@@ -86,14 +84,36 @@ export default {
 				fail: () => {},
 				complete: () => {}
 			});
+		},
+		 getCashOutList(){
+			 let that = this;
+					 uni.request({
+					 	url: getApp().globalData.shareUrl, //需要设置为全局
+					 	method: 'POST',
+					 	header: {
+					 		'content-type': 'application/x-www-form-urlencoded'
+					 	},
+					 	data: {
+					 		method: 'getWithdrawdepositList',
+					 		timestamp: getApp().globalData.globalTimestamp, //Date.now()
+					 		page: '',
+					 		pageSize:'',
+							uid:'1',
+					 		sign: md5('getWithdrawdepositList' + getApp().globalData.globalTimestamp)
+					 	},
+					 	success: res => {
+					 		if (res.data.code === 200) {
+					 			console.log(res.data.msg)
+								//that.cashOutList = res.data.msg
+					 		}
+					 	}
+					 });
 		}
 	}
 };
 </script>
 
 <style>
-	
-	
 	.header-box {
 		width: 100%;
 		height: 180rpx;

+ 23 - 1
pages/selfCenter/helpPage/index.vue

@@ -13,6 +13,7 @@
 </template>
 
 <script>
+	    var md5 = require('../../../common/md5.js')
 		export default {
 		data() {
 			return {
@@ -41,7 +42,7 @@
 			}
 		},
 		onLoad() {
-	
+	       this.getHelpList();
 		},
 		methods: {
 	     goHelpDetail(id){
@@ -52,6 +53,27 @@
 			 	complete: () => {}
 			 });
 		 },
+		 getHelpList(){
+			 uni.request({
+			 	url: getApp().globalData.shareUrl, //需要设置为全局
+			 	method: 'POST',
+			 	header: {
+			 		'content-type': 'application/x-www-form-urlencoded'
+			 	},
+			 	data: {
+			 		method: 'getHelpList',
+			 		timestamp: getApp().globalData.globalTimestamp, //Date.now()
+			 		page: '',
+			 		pageSize:'',
+			 		sign: md5('getHelpList' + getApp().globalData.globalTimestamp)
+			 	},
+			 	success: res => {
+			 		if (res.data.code === 200) {
+			 			console.log(res.data.msg)
+			 		}
+			 	}
+			 });
+		 }
 		}
 	}
 </script>

+ 235 - 213
pages/selfCenter/index.vue

@@ -1,27 +1,26 @@
 <template>
 	<view class="content">
-		
 		<view class="selfInfo-box">
-			 <view class="self-auth">
-				 <image src="../../static/bed-bg.png" mode=""></image>
-				 <view>
-					 <text>棉花糖</text>
-					 <text style="margin-left: 30%;font-size: 28rpx;">156****3232</text>
-				 </view>
-			 </view>
-			 
-			 <view class="self-content">
-				 <view>
-					 <text>13982</text>
-					 <text style="font-size: 28rpx;">我的积分</text>
-				 </view>
-				 <view>
-				 	 <text>127.83元</text>
-				 	 <text style="font-size: 28rpx;">已提现</text>
-				 </view>
-			 </view>
+			<view class="self-auth">
+				<image src="../../static/bed-bg.png" mode=""></image>
+				<view>
+					<text>棉花糖</text>
+					<text style="margin-left: 30%;font-size: 28rpx;">156****3232</text>
+				</view>
+			</view>
+
+			<view class="self-content">
+				<view>
+					<text>13982</text>
+					<text style="font-size: 28rpx;">我的积分</text>
+				</view>
+				<view>
+					<text>127.83元</text>
+					<text style="font-size: 28rpx;">已提现</text>
+				</view>
+			</view>
 		</view>
-		
+
 		<view class="function-box">
 			<view class="function-content" @click="goRecommend">
 				<image src="../../static/commend.png" mode=""></image>
@@ -36,7 +35,7 @@
 				<text>提现记录</text>
 			</view>
 		</view>
-		
+
 		<view class="list-box">
 			<view class="list-content" @click="applyPower">
 				<text class="margin-left5">分销资格</text>
@@ -45,7 +44,7 @@
 					<image src="../../static/arrow-right2.png" mode=""></image>
 				</view>
 			</view>
-			
+
 			<view class="list-content" @click="goTeamDetail">
 				<text class="margin-left5">分销团队</text>
 				<view class="apply-box">
@@ -53,7 +52,7 @@
 					<image src="../../static/arrow-right2.png" mode=""></image>
 				</view>
 			</view>
-			
+
 			<view class="list-content" style="border-bottom: none;" @click="goHelpPage">
 				<text class="margin-left5">帮助中心</text>
 				<view class="apply-box">
@@ -62,7 +61,7 @@
 				</view>
 			</view>
 		</view>
-			<uni-popup ref="showtip" type="center" :mask-click="false" @change="change">
+		<uni-popup ref="showtip" type="center" :mask-click="false" @change="change">
 			<view class="uni-tip">
 				<!-- <text class="uni-tip-title">警告</text> -->
 				<text class="uni-tip-content">您的申请需要后台审核,确定后请耐心等待结果。</text>
@@ -76,199 +75,222 @@
 </template>
 
 <script>
-	import uniPopup from '@/components/uni-popup/uni-popup.vue'
-	export default {
-		components: {
-			uniPopup,
-		},
-		data() {
-			return {
-				title: 'selfCenter'
-			}
-		},
-		onLoad() {
-
-		},
-		methods: {
-         goTeamDetail(){
-			 uni.navigateTo({
-			 	url: '/pages/selfCenter/recommendTeam/index',
-			 	success: res => {},
-			 	fail: () => {},
-			 	complete: () => {}
-			 });
-		 },
-		 goRecommend(){
-			uni.switchTab({
-				url:'/pages/index/index'
-			})
-		 },
-		 goAward(){
-			  uni.navigateTo({
-			 	url: '/pages/selfCenter/awardPage/index',
-			 	success: res => {},
-			 	fail: () => {},
-			 	complete: () => {}
-			 });
-		 },
-		 goCashOut(){
-		 	uni.navigateTo({
-		 		url: '/pages/selfCenter/cashoutPage/index',
-		 		success: res => {},
-		 		fail: () => {},
-		 		complete: () => {}
-		 	 });
-		 },
-		  goHelpPage(){
-		 	uni.navigateTo({
-		 		url: '/pages/selfCenter/helpPage/index',
-		 		success: res => {},
-		 		fail: () => {},
-		 		complete: () => {}
-		 	 });
-		 },
-		 applyPower(){
-			 this.$refs.showtip.open()
-		 },
-		 cancel(type) {
-		 	this.$refs.showtip.close()
-		 },
-		 change(e) {
-		 	console.log('是否打开:' + e.show)
-		 }
+import uniPopup from '@/components/uni-popup/uni-popup.vue'
+var md5 = require('../../common/md5.js')
+export default {
+	components: {
+		uniPopup,
+	},
+	data() {
+		return {
+			title: 'selfCenter'
 		}
+	},
+	onLoad() {
+      this.getUserInfo();
+	},
+	methods: {
+	 getUserInfo(){
+		  let that = this;
+			 uni.request({
+				url: getApp().globalData.shareUrl, //需要设置为全局
+				method: 'POST',
+				header: {
+					'content-type': 'application/x-www-form-urlencoded'
+				},
+				data: {
+					method: 'getUserInfo',
+					timestamp: getApp().globalData.globalTimestamp, //Date.now()
+					uid:'1',
+					sign: md5('getUserInfo' + getApp().globalData.globalTimestamp)
+				},
+				success: res => {
+					if (res.data.code === 200) {
+						console.log(res.data.msg)
+						//that.cashOutList = res.data.msg
+					}
+				}
+			 });
+	 },
+        goTeamDetail(){
+		 uni.navigateTo({
+		 	url: '/pages/selfCenter/recommendTeam/index',
+		 	success: res => {},
+		 	fail: () => {},
+		 	complete: () => {}
+		 });
+	 },
+	 goRecommend(){
+		uni.switchTab({
+			url:'/pages/index/index'
+		})
+	 },
+	 goAward(){
+		  uni.navigateTo({
+		 	url: '/pages/selfCenter/awardPage/index',
+		 	success: res => {},
+		 	fail: () => {},
+		 	complete: () => {}
+		 });
+	 },
+	 goCashOut(){
+	 	uni.navigateTo({
+	 		url: '/pages/selfCenter/cashoutPage/index',
+	 		success: res => {},
+	 		fail: () => {},
+	 		complete: () => {}
+	 	 });
+	 },
+	 goHelpPage(){
+	 	uni.navigateTo({
+	 		url: '/pages/selfCenter/helpPage/index',
+	 		success: res => {},
+	 		fail: () => {},
+	 		complete: () => {}
+	 	 });
+	 },
+	 applyPower(){
+		 this.$refs.showtip.open()
+	 },
+	 cancel(type) {
+	 	this.$refs.showtip.close()
+	 },
+	 change(e) {
+	 	console.log('是否打开:' + e.show)
+	 }
 	}
+}
 </script>
 
 <style>
-	.content {
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-	}
-	
-	.selfInfo-box {
-		width: 100%;
-		height: 320rpx;
-		background: #1fa1fb;
-		padding-top: 5%;
-		color: #fff;
-	}
-	.self-auth {
-		display: flex;
-		align-items: center;
-	}
-    .self-auth image{
-		margin-left: 5%;
-    	height:120rpx;
-    	width:120rpx;
-    	border-radius: 50%;
-    }
-	.self-auth view{
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-	}
-    
-	.self-content  {
-		margin-top: 10%;
-		display: flex;
-		justify-content: space-around;
-		align-items: center;
-	}
-	.self-content view{
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-	}
+.content {
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+}
 
-	.function-box {
-		display: flex;
-		justify-content: space-around;
-		align-items: center;
-		background: #fff;
-		width: 100%;
-		height: 240rpx;
-	}
-	
-	.function-content {
-		display: flex;
-		flex-direction: column;
-		justify-content: space-around;
-		align-items: center;
-		background: #ff685a;
-		width: 200rpx;
-		height: 180rpx;
-		border-radius: 10rpx;
-		font-size: 30rpx;
-		color: #fff;
-	}
-	.function-content image {
-		width: 75rpx;
-		height: 75rpx;
-		margin-top: 5%;
-	}
-	.function-content text {
-		margin-bottom: 5%;
-	}
-	
-	.list-box {
-		width: 100%;
-		margin-top: 3%;
-		font-size: 30rpx;
-	}
-	
-	.list-content {
-		background: #fff;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		height: 100rpx;
-		border-bottom: 1px solid #dbdbdb;
-	}
-	.apply-box {
-		display: flex;
-		align-items: center;
-		width: 180rpx;
-	}
-	.apply-box image {
-		width: 50rpx;
-		height: 50rpx;
-		margin-right: 5%;
-	}
-	.margin-left5 {
-		margin-left: 5%;
-	}
-	 /* 提示窗口 */
-	.uni-tip {
-		padding: 15px;
-		background: #fff;
-		box-sizing: border-box;
-		border-radius: 10px;
-	}
-	
-	.uni-tip-title {
-		text-align: center;
-		/* font-weight: bold; */
-		font-size: 28upx;
-		color: #333;
-	}
-	
-	.uni-tip-content {
-		font-size: 14px;
-		color: #666;
-	}
-	
-	.uni-tip-group-button {
-		margin-top: 10px;
-		display: flex;
-	}
-	
-	.uni-tip-button {
-		width: 100%;
-		text-align: center;
-		font-size: 14px;
-		color: #3b4144;
-	}
+.selfInfo-box {
+	width: 100%;
+	height: 320rpx;
+	background: #1fa1fb;
+	padding-top: 5%;
+	color: #fff;
+}
+.self-auth {
+	display: flex;
+	align-items: center;
+}
+.self-auth image {
+	margin-left: 5%;
+	height: 120rpx;
+	width: 120rpx;
+	border-radius: 50%;
+}
+.self-auth view {
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+}
+
+.self-content {
+	margin-top: 10%;
+	display: flex;
+	justify-content: space-around;
+	align-items: center;
+}
+.self-content view {
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+}
+
+.function-box {
+	display: flex;
+	justify-content: space-around;
+	align-items: center;
+	background: #fff;
+	width: 100%;
+	height: 240rpx;
+}
+
+.function-content {
+	display: flex;
+	flex-direction: column;
+	justify-content: space-around;
+	align-items: center;
+	background: #ff685a;
+	width: 200rpx;
+	height: 180rpx;
+	border-radius: 10rpx;
+	font-size: 30rpx;
+	color: #fff;
+}
+.function-content image {
+	width: 75rpx;
+	height: 75rpx;
+	margin-top: 5%;
+}
+.function-content text {
+	margin-bottom: 5%;
+}
+
+.list-box {
+	width: 100%;
+	margin-top: 3%;
+	font-size: 30rpx;
+}
+
+.list-content {
+	background: #fff;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	height: 100rpx;
+	border-bottom: 1px solid #dbdbdb;
+}
+.apply-box {
+	display: flex;
+	align-items: center;
+	width: 180rpx;
+}
+.apply-box image {
+	width: 50rpx;
+	height: 50rpx;
+	margin-right: 5%;
+}
+.margin-left5 {
+	margin-left: 5%;
+}
+/* 提示窗口 */
+.uni-tip {
+	padding: 15px;
+	background: #fff;
+	box-sizing: border-box;
+	border-radius: 10px;
+}
+
+.uni-tip-title {
+	text-align: center;
+	/* font-weight: bold; */
+	font-size: 28upx;
+	color: #333;
+}
+
+.uni-tip-content {
+	font-size: 14px;
+	color: #666;
+}
+
+.uni-tip-group-button {
+	margin-top: 10px;
+	display: flex;
+}
+
+.uni-tip-button {
+	width: 100%;
+	text-align: center;
+	font-size: 14px;
+	color: #3b4144;
+}
 </style>