Bladeren bron

修改接口

306132416@qq.com 5 jaren geleden
bovenliggende
commit
2671c61dbe
4 gewijzigde bestanden met toevoegingen van 146 en 34 verwijderingen
  1. 1 1
      pages.json
  2. 72 8
      pages/index/index.vue
  3. 21 21
      pages/selfCenter/cashoutPage/index.vue
  4. 52 4
      pages/selfCenter/index.vue

+ 1 - 1
pages.json

@@ -75,7 +75,7 @@
 		"list": [{
 				"pagePath": "pages/index/index",
 				"iconPath": "/static/tabbar/house-pic-nor.png",
-				"selectedIconPath": "/static/tabbar/house-pic-nor.png",
+				"selectedIconPath": "/static/tabbar/house-pic-active.png",
 				"text": "首页"
 			},
 			{

+ 72 - 8
pages/index/index.vue

@@ -17,7 +17,7 @@
 		
 		<view class="product-title">推荐产品</view>
 	   
-		<view class="recommend-box">
+	<!-- 	<view class="recommend-box">
 			<view class="product-box" v-for="item in productList" :key="item.id"  @click="goDetail(item.id)">
 				<image :src="item.imgUrl"></image>
 				<view class="detail-box">
@@ -25,14 +25,32 @@
 					<view style="color: #999;">¥{{item.price}}</view>
 				</view>
 			</view>
-		</view>
+		</view> -->
+		
+		<!-- <section class="PullScroll-Page"> -->
+		<!--  <s-pull-scroll ref="pullScroll" :back-top="true" :pullDown="pullDown" :pullUp="loadData"> -->
+			<view class="recommend-box">
+				<view class="product-box" v-for="item in productList" :key="item.id"  @click="goDetail(item.id)">
+					<image :src="item.picture"></image>
+					<view class="detail-box">
+						<view>{{item.desc || '-'}}</view>
+						<view style="color: #999;">¥{{item.money || '-'}}</view>
+					</view>
+				</view>
+			</view>
+		 <!-- </s-pull-scroll> -->
+		<!-- </section> -->
 		
 	</view>
 </template>
 
 <script>
 	var md5 = require("../../common/md5.js");
+	import sPullScroll from '@/components/s-pull-scroll';
 	export default {
+		components: {
+		  sPullScroll
+		},
 		data() {
 			return {
 				title: 'Hello',
@@ -66,12 +84,13 @@
 			}
 		},
 		onLoad(options) {
+		  //this.refresh();
 		  getApp().globalData.lastId = options.inviteId ? options.inviteId : getApp().globalData.user_id
           this.loginRequest();
 		  this.getPageProductList(); 
+		  
 		},
 		onShareAppMessage() {
-			console.log(111);
 			  return {
 			      title: '分销小助手',
 			      path:'/pages/index/index?inviteId=' + getApp().globalData.user_id
@@ -102,6 +121,7 @@
 									getApp().globalData.user_headUrl = res.data.msg.headimg;
 									getApp().globalData.session_key = res.data.msg.session_key;
 									getApp().globalData.user_phone = res.data.msg.phone;
+									getApp().globalData.user_status = res.data.msg.status;
 									// getApp().globalData.times = res.data.msg.times;
 									// getApp().globalData.total_times = res.data.msg.total_times;
 									this.getPageInfo(res.data.msg.id);
@@ -132,7 +152,8 @@
 					}
 				});
 			},
-			 getPageProductList(){ //获取首页面产品列表接口
+			 getPageProductList(pullScroll){ //获取首页面产品列表接口
+			    console.log(pullScroll)
 			    let that = this;
 				uni.request({
 					url: getApp().globalData.shareUrl, //需要设置为全局
@@ -143,14 +164,32 @@
 					data: {
 						method: 'getProductsList',
 						timestamp: getApp().globalData.globalTimestamp, //Date.now()
-						page: '',
+						// page: pullScroll.page,
+						// pageSize:4,
+						page:'',
 						pageSize:'',
 						sign: md5('getProductsList' + getApp().globalData.globalTimestamp)
 					},
 					success: res => {
 						if (res.data.code === 200) {
 							console.log(res.data.msg)
-							//that.productList = res.data.msg;
+							that.productList = res.data.msg;
+							// setTimeout(() => {
+							//   if (pullScroll.page == 1) {
+							//     this.productList = res.data.msg;
+							//   }
+							//   const curList = [];
+							//   for (let i = res.data.msg.length; i < res.data.msg.length + 4; i++) {
+							//     curList.push(i);
+							//   }
+							//   this.productList = this.productList.concat(curList);
+							//   if (this.productList.length > 60) {
+							//     // finish(boolean:是否显示finishText,默认显示)
+							//     pullScroll.finish(this.productList.length > 4);
+							//   } else {
+							//     pullScroll.success();
+							//   }
+							// }, 500);
 						}
 					}
 				});
@@ -173,12 +212,36 @@
 						})
 					}
 				})
-			}
+			},
+			refresh () {
+			  this.$nextTick(() => {
+			    this.$refs.pullScroll.refresh();
+			  });
+			},
+			pullDown (pullScroll) {
+			  setTimeout(() => {
+			    this.loadData(pullScroll);
+			  }, 200);
+			},
+			loadData (pullScroll) {
+			  this.getPageProductList(pullScroll)
+			  }
 		}
 	}
 </script>
 
-<style>
+<style lang="scss">
+	// .PullScroll-Page {
+	//   padding: 40rpx;
+	//   .btn {
+	//     width: 100%;
+	//     height: 80rpx;
+	//     font-size: 28rpx;
+	//     &:not(:first-child) {
+	//       margin-top: 40rpx;
+	//     }
+	//   }
+	// }
 	.content {
 		display: flex;
 		flex-direction: column;
@@ -223,6 +286,7 @@
 		margin-bottom: 1%;
 	}
 	.recommend-box {
+		width: 95%;
 		display: flex;
 		flex-direction: column;
 		justify-content: center;

+ 21 - 21
pages/selfCenter/cashoutPage/index.vue

@@ -87,27 +87,27 @@ export default {
 		},
 		 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:getApp().globalData.user_id,
-					 		sign: md5('getWithdrawdepositList' + getApp().globalData.globalTimestamp)
-					 	},
-					 	success: res => {
-					 		if (res.data.code === 200) {
-					 			console.log(res.data.msg)
-								//that.cashOutList = res.data.msg
-					 		}
-					 	}
-					 });
+			 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:getApp().globalData.user_id,
+					sign: md5('getWithdrawdepositList' + getApp().globalData.globalTimestamp)
+				},
+				success: res => {
+					if (res.data.code === 200) {
+						console.log(res.data.msg)
+						//that.cashOutList = res.data.msg
+					}
+				}
+			 });
 		}
 	}
 };

+ 52 - 4
pages/selfCenter/index.vue

@@ -45,7 +45,7 @@
 			<view class="list-content" @click="applyPower">
 				<text class="margin-left5">分销资格</text>
 				<view class="apply-box">
-					<text style="color: #999;">点击申请</text>
+					<text style="color: #999;" :style="{'margin-right':userStatus==='点击申请'? '0':'2px'}" decode="true">{{userStatus}}</text>
 					<image src="../../static/arrow-right2.png" mode=""></image>
 				</view>
 			</view>
@@ -94,15 +94,38 @@ export default {
 			userPhone:getApp().globalData.user_phone  || '156****3232',
 			isAuth:getApp().globalData.isAuth,
 			isAuthPhone:getApp().globalData.user_phone,
-			userInfoObj:{}
+			userInfoObj:{},
+			userStatus:'点击申请',
 		}
 	},
 	onLoad() {
+		this.switchUserStatus(getApp().globalData.user_status)
 	},
 	onShow() {
 		this.getUserInfo();
 	},
 	methods: {
+     switchUserStatus(status){
+		 console.log(status)
+		 let that = this;
+		 switch (status){
+		 	case '1':
+			    that.userStatus = '审核中'+'&nbsp;&nbsp;&nbsp;'
+		 		break;
+			case '2':
+			    that.userStatus = '已认证'+'&nbsp;&nbsp;&nbsp;'
+				break;
+			case '3':
+			    that.userStatus = '已禁用'+'&nbsp;&nbsp;&nbsp;'
+				break;
+			case '4':
+			    that.userStatus = '点击申请'
+				break;			
+		 	default:
+			    that.userStatus = '点击申请'
+		 		break;
+		 }
+	 },		
 	 getUserInfo(){
 		  let that = this;
 			 uni.request({
@@ -179,7 +202,32 @@ export default {
 	 	 });
 	 },
 	 applyPower(){
-		 this.$refs.showtip.open()
+		 let that = this;
+		 if(that.userStatus === '点击申请'){
+		 	uni.request({
+		 				url: getApp().globalData.shareUrl, //需要设置为全局
+		 				method: 'POST',
+		 				header: {
+		 					'content-type': 'application/x-www-form-urlencoded'
+		 				},
+		 				data: {
+		 					method: 'zigeapply',
+		 					timestamp: getApp().globalData.globalTimestamp, //Date.now()
+		 					uid:getApp().globalData.user_id,
+		 					sign: md5('zigeapply' + getApp().globalData.globalTimestamp)
+		 				},
+		 				success: res => {
+		 					if (res.data.code === 200) {
+		 						console.log(res.data.msg)
+		 						this.$refs.showtip.open()
+		 						//that.cashOutList = res.data.msg
+		 					}
+		 				}
+		 	});		 
+		 }else{
+			 return false
+		 }
+		
 	 },
 	 cancel(type) {
 	 	this.$refs.showtip.close()
@@ -325,7 +373,7 @@ export default {
 .apply-box {
 	display: flex;
 	align-items: center;
-	width: 180rpx;
+	width: 200rpx;
 }
 .apply-box image {
 	width: 50rpx;