<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		post: function(url, data, method) {
			var promise = new Promise((resolve, reject) => {
				//init
				let that = this,
					token = uni.getStorageSync('token'),
					header = {
						'token': token || ''
					},
					postData;
				//网络请求
				uni.request({
					url: this.globalData.baseUrl + url,
					data: data,
					method: method,
					header: header,
					success: function(res) {
						//返回取得的数据
						if (res.data.code == '1') {
							resolve(res.data.data);
						} else {
		
							reject(res.data);
						}
					},
					fail: function(e) {
						reject('网络出错');
						uni.hideNavigationBarLoading();
					}
				});
			});
			return promise;
		},
		globalData: {
			userInfo: null,
			baseUrl: 'http://knew.t.brotop.cn/api/',
			
		},
		
	}
</script>

<style>
	/*每个页面公共css */
	/* 搜索 */
	.nodata{
		color:#999;
		font-size: 32rpx;
		text-align: center;
		margin-top:100rpx
	}
	image{
		width:100%;
		height: 100%;
	}
	.searhtoppage{
		width:100%;
		background: #fff;
		position: fixed;
		top:0;
		left:0;
		z-index:99
	}
	.searchtop{
		width: 688rpx;
		height: 64rpx;
		background: #f2f4f8;
		border-radius: 32rpx;
		padding: 14rpx 32rpx;
		box-sizing: border-box;
		margin:0 auto
	
	}
	.searchtopk{
		width: 608rpx;
		height: 64rpx;
		background: #f2f4f8;
		border-radius: 32rpx;
		padding: 14rpx 32rpx;
		box-sizing: border-box;
		
	}
	.cancelname{
		color:#252F3E;
		font-size: 32rpx;
		font-weight: bold;
	}
	.searchleft{
		color:#9B9B9B;
		font-size:28rpx;
		flex:1;
		text-align: left;
		padding-left: 20rpx;
	}
	.searchleft input{
		width:100%
	}
	.search{
		width:26rpx;
		height: 26rpx;
	}
	.register {
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 999;
	}
	
	
	/* 右箭头 */
	.more{
		color:#707070;
		font-size: 24rpx;
	}
	.yourow{
		width:14rpx;
		height: 14rpx;
		margin-left:20rpx;
	}
	
	.flex {
	        display: flex;
	    }
	
	    .flexone {
	        display: flex;
	        align-items: center;
	    }
	
	    .flextwo {
	        display: flex;
	        align-items: center;
	        justify-content: space-between;
	    }
	
	    .flexthree {
	        display: flex;
	        align-items: center;
	        justify-content: center;
	    }
	
	    .flexfour {
	        display: flex;
	        flex-direction: column;
	        align-items: center;
	        justify-content: center;
	    }
	    .flexfive {
	        display: flex;
	        flex-direction: column;
	        align-items: center;
	        justify-content: space-around;
	}

</style>