<template>
	<view class="container-mine">
		<view class="navbar">
			<navbar ref="navbar" :config="config" backColor="#666"></navbar>
		</view>
		<view class="mine-top">
			<view class="mine-left">
				<image class="mine-left-img" v-if="user.headPhoto" :src="$getImgPath(user.headPhoto)">
				</image>
				<image class="mine-left-img" v-else src="/static/default-avatar.png" mode=""></image>
				<view class="name-info">
					<text class="name-text">{{user.certification?user.realName:user.nickname}}</text>
					<text class="name-tag">{{user.mobile}}</text>
				</view>
			</view>
			<view class="mine-right">
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
		<view class="maxBox">
			<view class="pointsBox" @click="goMypoints()">
				<view class="pointsBox_l">
					<image src="/static/czd/myPoint.png" mode=""></image>
					我的积分
				</view>
				<view class="pointsBox_r">
					{{userInformation.integral_able}}积分
					<text class="iconfont_yige">&#xe65f;</text>
				</view>
			</view>
			<view class="shopOrderList">
				<view class="shopOrderList_title">
					<view class="shopOrderList_title_l">商城订单</view>
					<view class="shopOrderList_title_r" @click="toShopOrderList({value:-1})">查看更多<text class="iconfont_yige">&#xe65f;</text></view>
				</view>
				<view class="shopOrderList_b">
					<view class="shopOrderList_item" v-for="(item, index) in orderTab" :key="index" @click="toShopOrderList(item)">
            <view class="anglenum" v-if="item.count=='0'?false:item.count">
              {{item.count}}
            </view>
						<view class="shopOrderList_item_img">
							<image :src="item.icon" mode=""></image>
						</view>
						<view class="shopOrderList_item_lab">{{item.label}} </view>
					</view>
				</view>
			</view>
			<view class="list">
				<view class="list_item" v-for="(item, index) in toolsList" :key="index" @click="goSublevelPage(item.url)">
					<view class="list_item_l">
						<image :src="item.icon" mode=""></image>
						{{item.label}}
					</view>
					<view class="list_item_r">
						<image src="/static/czd/tiaozhuan.png" mode=""></image>
					</view>
				</view>
			</view>
			
			<view class="list" v-if="shopInfo.union_business" >
				<view class="list_title">商城订单</view>
				<view class="list_item"  @click.stop="goWorkTablePage('/pages/workbench/shop/index')">
					<view class="list_item_l">
						<image src="/static/czd/personal_4.png" mode=""></image>
						店铺管理
					</view>
					<view class="list_item_r">
						<image src="/static/czd/tiaozhuan.png" mode=""></image>
					</view>
				</view>
				<view class="list_item" @click="goWorkTablePage('/pages/workbench/goods/index')">
					<view class="list_item_l">
						<image src="/static/czd/personal_4.png" mode=""></image>
						商品管理
					</view>
					<view class="list_item_r">
						<image src="/static/czd/tiaozhuan.png" mode=""></image>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="bgImg">
			<view class="position-ab">
				<view class="other">
					<view class="other-top">
						<view class="left">
							其他工具
						</view>
					</view>
					<view class="option">
						<view class="list" @click.stop="goSublevelPage('/pages/order/gbOrder/gbOrderList')">
							<image class="my-icon" src="./../../static/personal/tool1.png" mode="aspectFit"></image>
							<view class="name-one">我的拼团</view>
						</view>
						<view class="list" @click="goSublevelPage('/pages/user/address/addressList')">
							<image class="my-icon" src="./../../static/personal/tool2.png" mode="aspectFit"></image>
							<view class="name-one">收货地址</view>
						</view>
						<view class="list" @click="goSublevelPage('/pages/research/setup/edit')">
							<image class="my-icon" src="./../../static/personal/tool3.png" mode="aspectFit"></image>
							<view class="name-one">个人信息</view>
						</view>
						<view class="list" @click="goSublevelPage('/pages/research/community/collection')">
							<image class="my-icon" src="./../../static/personal/tool4.png" mode="aspectFit"></image>
							<view class="name-one">我的收藏</view>
						</view>
					</view>
					<view class="option">
						<view class="list" v-if="platform == 'android' || (platform == 'ios' && openProxy == true)"
							@click="goSublevelPage('/pages/user/regional-agency/index')">
							<image class="my-icon" src="./../../static/personal/tool5.png" mode="aspectFit"></image>
							<view class="name-one">区域代理</view>
						</view>
						<view class="list" @click="goToRegisterAndAudit()">
							<image class="my-icon" src="./../../static/personal/tool6.png" mode="aspectFit"></image>
							<view class="name-one">商家入驻</view>
						</view>
						<view class="list" @click="goPhone()">
							<image class="my-icon" src="./../../static/personal/tool7.png" mode="aspectFit"></image>
							<view class="name-one">官方客服</view>
						</view>
						<view class="list" @click="goTocommonproblem()">
							<image class="my-icon" src="./../../static/personal/tool8.png" mode="aspectFit"></image>
							<view class="name-one">常见问题</view>
						</view>
					</view>
					<view class="option">
						<view class="list" @click="tabPage('/pages/couponCenter/index')">
							<image class="my-icon" src="./../../static/personal/tool8.png" mode="aspectFit"></image>
							<view class="name-one">领券中心</view>
						</view>
					</view>
				</view>

				<view class="other tools" v-if="shopInfo.union_business">
					<view class="other-top">
						<view class="left">
							工作台
						</view>
					</view>
					<view class="option">
						<view class="list" @click.stop="goWorkTablePage('/pages/workbench/shop/index')">
							<image class="my-icon" src="./../../static/personal/shop-icon.png" mode="aspectFit"></image>
							<view class="name-one">店铺管理</view>
						</view>
						<view class="list" @click="goWorkTablePage('/pages/workbench/goods/index')">
							<image class="my-icon" src="./../../static/personal/goods-icon.png" mode="aspectFit">
							</image>
							<view class="name-one">商品管理</view>
						</view>
						<view class="list" @click="goWorkTablePage('/pages/workbench/order/index')">
							<image class="my-icon" src="./../../static/personal/order-icon.png" mode="aspectFit">
							</image>
							<view class="name-one">订单上报</view>
						</view>
					</view>
				</view>
			</view>
		</view> -->
		<!-- <div @click="goToMyWallet">aaa</div> -->
		<entrepreneurship-zone-tabbar :current="3"></entrepreneurship-zone-tabbar>
	</view>
	</view>


</template>

<!-- grade: 0 普通会员 ， 1：店长 -->
<!-- activating： 是否激活 -->
<!-- auth_success: 是否认证 -->
<!-- balance：余额 -->
<!-- commission_able： 贡献值 -->
<!-- integral_able： 积分值 -->

<script>
	import {
		getAccountInfo
	} from "@/api/login.js"
	import {
		myStatistics,
		unreadNum
	} from "@/api/userInfo.js"
	import {
		myUserInfo
	} from "@/api/government.js"
	let app = getApp()
	export default {
		data() {
			return {
				config: {
					back: true, //false是tolbar页面 是则不写
					title: '个人中心',
					color: '#1A1A1A',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [1, '#fff'],
					rightSlot: true,
				},
				imgUrl: this.$mConfig.staticUrl,
				//微信小程序用户信息
				userInfo: {
					head_photo: "",
					nickname: "登录/注册"
				},
				hiddenLink: true,
				loginNo: false, //判断显示邀请码
				storage: true,
				isLogin: false, //判断是否登录
				userInformation: {}, //用户信息
				myCommunity: {}, //我的社区
				myMsg: null,
				ispay: app.globalData.openPay,
				numObj: {},
				//value对应订单列表接口的area_feature参数。传0或不传是排除了申购的订单列表（商品订单），传3是申购订单列表
				isSign: false, // 是否签到
				shopInfo: {},
				openProxy: false, // 是否开启区域代理
				platform: 'android',
				careerInfo: {},
				user: {},
        orderTab: [
          {
            label: '待付款',
            icon: '/static/order/order-icon1.png',
            value: 0,
            count: 0,
          },
          {
            label: '待发货',
            icon: '/static/order/order-icon2.png',
            value: 1,
            count: 0,
          },
          {
            label: '待收货',
            icon: '/static/order/order-icon3.png',
            value: 3,
            count: 0,
          },
          {
            label: '待评价',
            icon: '/static/order/order-icon4.png',
            value: 5,
            count: 0,
          },
          {
            label: '退换/售后',
            icon: '/static/order/order-icon5.png',
            value: 6,
            count: 0,
          }
        ],
        // 订单数量
        generalOrder: {
          waitPayNum: "0", //待支付数量
          waitCommentNum: "0", //待评论数量
          waitUseNum: "0", //待使用数量
          waitShipNum: "0", //待发货数量
          waitReceivingNum: "0" //待收货数量
        },
        toolsList: [
          {
            label: '我的拼团',
            icon: '/static/czd/personal_1.png',
            url: '/pages/order/gbOrder/gbOrderList',
          },
          {
            label: '收货地址',
            icon: '/static/czd/personal_2.png',
            url: '/pages/user/address/addressList',
          },
          {
            label: '商家入驻',
            icon: '/static/czd/personal_3.png',
            url: '/pages/user/merchant/settleIn?type=tenants_agreement',
          },
          {
            label: '个人信息',
            icon: '/static/czd/personal_4.png',
            url: '/pages/government/personalData',
          },
          {
            label: '我的收藏',
            icon: '/static/czd/personal_5.png',
            url: '/pages/research/community/collection',
          },
          // {
          //   label: '推送设置',
          //   icon: '/static/czd/personal_6.png',
          //   url: '/pages/index/push',
          // }
        ]
			}
		},
		created() {
			let userInfo = uni.getStorageSync("apiToken")
			let shop = uni.getStorageSync("shop")
		},
		onPageScroll(e) {
			let maxHeight = uni.upx2px(300);
			if (e.scrollTop > maxHeight) {
				// this.$set(this.config, 'backgroundColor', [1, '#2cba28']);
			} else {
				// this.$set(this.config, 'backgroundColor', [e.scrollTop / maxHeight.toFixed(1), '#2cba28']);
			}
			this.$refs.navbar.init();
		},
		//清空数据
		//显示弹出框
		async onShow() {
			var that = this
			let token = uni.getStorageSync("apiToken")
			let shop = uni.getStorageSync("shop")
			this.isOpenProxy()
			this.platform = uni.getSystemInfoSync().platform;
			// let personal = uni.getStorageSync("personal")
			await this.judgeLogin().then(res => {
					// console.log('this.judgeLogin = res', res)
				})
				.catch(err => {
					/**
					 * @description 重置数据
					 */
					this.isLogin = false;
					this.userInformation = {}; //用户信息


					this.isSign = false;
				})
			// let getWxUserInfo = uni.getStorageSync("wxUserInfo")
			// if(getWxUserInfo !=''){
			// 	that.userInfo = JSON.parse(getWxUserInfo)
			// }

			// if (this.isLogin) {
			// 	if (token) {
			// 		this.hiddenLink = false
			// 		this.loginNo = true
			// 		this.getuserInfo()
			// 	}
			// 	await this.getMyStatistics()

			// 获取信息条数
      await this.getGeneralOrderCount()
			await this.getUnreadNum()
			await this.getcareerInfo()

			// 	this.$forceUpdate();
			// }
			this.getUserData()
		},
		onPullDownRefresh() {
			let token = uni.getStorageSync("apiToken")
			this.isOpenProxy()
			if (!token) {
				uni.stopPullDownRefresh();
			} else {
				this.getAll()
			}

		},
		methods: {
			getUserData() {
				myUserInfo().then(res => {
					this.user = res.data;
					uni.stopPullDownRefresh();
				}).catch(() => {
					uni.stopPullDownRefresh();
				})
			},
			// 获取店铺信息
			getShopInfo() {
				this.$http.get('/yxt/shop/my-shop', {
					union_business: true
				}).then(res => {
					if (res.code == 200 && res.data) {
						this.shopInfo = res.data
					} else {
						this.shopInfo.union_business = false
					}
				})
			},
			// 跳转我的积分
			goMypoints(){
				uni.navigateTo({
					url:"/pages/research/community/mypoints"
				})
			},
			isOpenProxy() {
				this.$http.get('/saleconfig/openPayment').then(res => {
					if (res && res.code == 200) {
						this.openProxy = res.openPayment;
					}
				});
			}, // 上部切换
			topDataChange(e) {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
					return;
				}
				if (e.title == '我的爱心' || e.title == '今日爱心') {
					// 跳转 我的爱心
					uni.navigateTo({
						url: "/pages/research/myLove/index"
					})
				} else if (e.title == '公益积分') {
					// 跳转 我的公益积分
					uni.navigateTo({
						url: "/pages/research/myPublicWelfare/index"
					})
				} else if (e.title == '优惠券') {
					uni.navigateTo({
						url: "/pages/couponCenter/index?isMyCoupon=true"
					})
				}
			},
			toolClick(funName) {
				if (!funName) {
					uni.showToast({
						icon: 'none',
						title: '暂无功能'
					})
					return false;
				}
				this[funName]();
			},
			rest() {
				this.userInformation = {}
				this.myCommunity = {}
			},
			async getAll() {
				this.rest() //清空消息
				await this.judgeLogin() //判断是否登录
				if (this.isLogin) {
					// await this.getUnreadNum()	//未读消息
					await this.getMyStatistics() //登录消息
					await this.getuserInfo() //用户消息
          await this.getGeneralOrderCount()
					this.$forceUpdate();
				}
			},
			goaAdress() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
					return;
				}
				uni.navigateTo({
					url: '/pages/user/address/addressList'
				})
			},
			goUnserInfo() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
					return;
				}
				uni.navigateTo({
					url: '/pages/research/setup/edit'
				})
			},
			//获取未读消息
			getUnreadNum() {
				this.$http.get(unreadNum).then(res => {
					uni.stopPullDownRefresh();
					if (res && res.code == 200) {
						this.myMsg = res.data
					} else {
						this.myMsg = 0
					}
				}).catch(err => {
					this.myMsg = 0
				})
			},
			//跳转我的消息
			goToMsg() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
					return;
				}
				uni.navigateTo({
					url: "../research/setup/myMsg"
				})
			},
			//前往我的二维码
			jumpcode() {
				uni.navigateTo({
					url: "../user/invitationCode/invitationCode"
				})
			},
			//前往我的钱包
			goToMyWallet() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../user/wallet/myWallet"
					})
				}

			},
			//前往我的积分
			goToMyPoints() {

				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../research/community/mypoints"
					})
				}
			},
			getMyStatistics() {
				//获取主页数据
				this.$http.get(myStatistics)
					.then(res => {
						uni.stopPullDownRefresh();
						if (res && res.code == 200) {
							this.myCommunity = res.data
						}
					})
			},
			//判断是否登录
			async judgeLogin() {
				let shop = uni.getStorageSync("shop")
				// if (shop) {
				await this.$http.get(getAccountInfo).then(res => {
					uni.stopPullDownRefresh();
					if (res && res.code == 200) {
						this.isLogin = true
						this.userInformation = res.data;
						this.isSign = res.data.sign_in;
						uni.setStorageSync("personal", res.data)
						this.getShopInfo()
					} else {
						this.isLogin = false
					}
				})
				// } else {
				//   this.isLogin = false
				// }

			},
			//跳转成为商家
			goToRegisterAndAudit() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "/pages/user/merchant/settleIn"
					})
					// this.$http.get("/yxt/shopapply/shopApplyInfo").then(res => {
					//   if (res && res.code == 200) {
					//     if (res.data == null) {
					//       uni.navigateTo({
					//         url: "/pages/user/merchant/settleIn"
					//         // url: "../user/merchant/registerAndAudit"
					//       })
					//     } else {
					//       if (res.data.audit_status == 2) {
					//         uni.navigateTo({
					//           url: "/pages/user/merchant/settleIn"
					//         })
					//       } else {
					//         uni.navigateTo({
					//           url: "../user/merchant/audit"
					//         })
					//       }
					//     }
					//   }
					// })
					// 	let personal = uni.getStorageSync("personal")
					// 	let isShop = personal.is_shop
					// 	if(isShop==true){
					// 	uni.navigateTo({
					// 	url:"../research/setup/toBusiness"
					// })}else{
					// 		uni.navigateTo({
					// 		url:"../user/merchant/registerAndAudit"
					// 	})
					// 	}
				}
			},
			//成为网红
			goTobecomeANerStar() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					//获取申请信息
					this.$http.get("/celebrity/info").then(res => {
						if (res && res.code == 200) {
							if (res.data !== null) {
								uni.navigateTo({
									// url:"./toExamine"
									url: "../research/setup/toExamine"
								})
							} else {
								uni.navigateTo({
									url: "../research/setup/becomeANetStar"
								})
							}

						}
					})
				}



			},
			//常见问题
			goTocommonproblem() {
				uni.navigateTo({
					url: "../research/community/commonproblem"
				})
			},

			//跳转我的收藏

			goToCollection() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "/pages/research/community/collection"
					})
				}
			},
			// 区域代理
			goAreaAgency() {
				uni.navigateTo({
					url: '/pages/user/regional-agency/index'
				})
			},
			goMerchantCheck() {
				uni.showToast({
					title: "商家入住",
					icon: 'none'
				})
			},
			//跳转我的银行卡
			goToBankCardList() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {

					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../user/bankCard/bankCardList"
					})
				}

			},

			//跳转分销中心
			goToDistributionCentre() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../user/distribution/distributionCentre"
					})
				}
			},
			// 跳转子级页面
			goSublevelPage(page) {
				if (this.isLogin) {
					uni.navigateTo({
						url: page
					})
				} else {
					this.$mUtil.toast("请先登录")
				}
			},
			//跳转我的拼团
			goToGbOrderList() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../order/gbOrder/gbOrderList"
					})
				}

			},
			//跳转我的评论
			goToMyComment() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../research/community/mycomment?user_id=" + this.userInfo.id
					})
				}

			},
			//跳转我的点赞
			goToMyFabulous() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../research/community/myfabulous?user_id=" + this.userInfo.id
					})
				}

			},
			//跳转我的关注
			goToMyFollow() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../research/community/myfollow?user_id=" + this.userInfo.id
					})
				}

			},
			//跳转我的发布
			goToMyRelease() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					uni.navigateTo({
						url: "../research/community/myrelease?user_id=" + this.userInfo.id
					})
				}

			},
			//跳转我的主页
			goToHomepage() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else {
					let id = this.userInfo.id
					uni.navigateTo({
						url: "../research/community/homepage?user_id=" + id
					})

				}
			},

			//跳转订单列表
			goToEdit() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
				} else if (token) {
					uni.navigateTo({
						url: "../research/setup/management"
					})
				}

			},


			//跳转我的粉丝
			gotoFans() {
				let token = uni.getStorageSync("apiToken")
				if (!token) {
					uni.navigateTo({
						url: "/pages/login/index"
					})
				} else {
					uni.navigateTo({
						url: "../research/community/myfans?user_id=" + this.userInfo.id
					})
				}

			},
			//跳转注册
			goToRegister() {
				uni.navigateTo({
					url: "/pages/login/index"
				})
			},
			//跳转登录
			goToLogin() {
				uni.navigateTo({
					url: "../research/register/login"
				})
			},
			// 实名认证
			goAuthentication() {
				uni.navigateTo({
					url: "/pages/user/authentication"
				})
			},

			getuserInfo() {
				let shop = uni.getStorageSync('shop')
				this.$http.get('/account/getAccountInfo/' + shop.id).then(async res => {
					uni.stopPullDownRefresh();
					if (res && res.code == 200) {
						this.userInfo = res.data
					}
				})
			},
			//跳到登录页面
			// goLogin(url){
			// let token = uni.getStorageSync("apiToken")
			// //判断是否微信授权登录（没有授权登录进wx-login,授权了但没有注册进login）
			// if(!token){
			// 	uni.navigateTo({
			// 		url:"./wx-login"
			// 	})
			// }else if(token){
			// 	this.hiddenLink =false
			// 	uni.navigateTo({
			// 		url:url
			// 	})
			// }
			// },
			//跳到商家页
			goMerchant() {
				let token = uni.getStorageSync("apiToken")
				//判断是否微信授权登录（没有授权登录进wx-login,授权了但没有注册进login）
				if (!token) {
					uni.navigateTo({
						url: "./wx-login"
					})
				} else if (token) {
					this.hiddenLink = false
					this.$http.get('/yxt/shopapply/shopApplyInfo', {}).then(async res => {
						if (res && res.code == 200) {
							if (!res.data) {
								uni.navigateTo({
									url: "../user/merchant/registerAndAudit"
								})
							} else {
								uni.navigateTo({
									url: '../user/merchant/audit'
								})
							}
						}
					})
				}
			},



			//跳到拼团订单
			goGbOrder() {
				uni.navigateTo({
					url: "../order/gbOrder/gbOrderList"
				})
			},
			//常见问题
			goFaq() {
				uni.navigateTo({
					url: "../user/faq"
				})
			},
			//联系客服
			goPhone() {
				this.$http.get('/system/info/info', {}).then(res => {
					if (res && res.code == 200) {
						if (res.data.hotline) {
							uni.makePhoneCall({
								phoneNumber: res.data.hotline
							});
						}
					}
				})
			},



			tabPage(url, needLogin = false) {
				let token = uni.getStorageSync("apiToken")
				if (needLogin && !token) {
					uni.navigateTo({
						url: "../research/register/login"
					})
					return;
				}
				uni.navigateTo({
					url
				})
			},
			// 跳转工作台页面
			goWorkTablePage(page) {
				if (this.isLogin) {
					uni.navigateTo({
						url: page
					})
				} else {
					this.$mUtil.toast("请先登录")
				}
			},

			getcareerInfo() {
				this.$http.get('/account/operating/center/info').then(res => {
					if (res && res.code == 200) {
						this.careerInfo = res.data;
					}
				})
			},
      
      //获取普通订单统计
      getGeneralOrderCount() {
        this.$http.get('/order/general-order-count', {})
          .then(async res => {
            if (res && res.code == 200) {
              if (res.data) {
                this.orderTab[0].count = res.data.wait_pay_num //待支付
                this.orderTab[1].count = res.data.wait_ship_num //待发货
                this.orderTab[2].count = res.data.wait_receiving_num //待收货
                this.orderTab[3].count = res.data.wait_comment_num //待评论
                // this.generalOrder.waitPayNum = res.data.wait_pay_num //待支付
                // this.generalOrder.waitCommentNum = res.data.wait_comment_num //待评论
                // this.generalOrder.waitUseNum = res.data.wait_use_num //待使用
                // this.generalOrder.waitReceivingNum = res.data.wait_receiving_num //待收货
                // this.generalOrder.waitShipNum = res.data.wait_ship_num //待发货
              }
            }
          })
      },
      
      // 跳转商城订单列表页
      toShopOrderList(item) {
        if (this.isLogin) {
        	uni.navigateTo({
        	  url: `/pages/order/orderList/orderList?keys=${item.value}&orderType=0`
        	})
        } else {
        	this.$mUtil.toast("请先登录")
        }
      }
		}
	}
</script>
<style>
	page {
		background-color: #F5F5F5;
	}
</style>
<style lang="scss" scoped>
	.top {
		// position: relative;
		width: 100%;
		height: 296rpx;
		display: flex;
		align-items: center;
		padding-bottom: 86rpx;
		background-color: #fff;
		border-radius: 0 0 70rpx 70rpx;
		// overflow: hidden;


		.head-login {
			width: 100%;

			.login {
				display: flex;
				background-color: #ffffff;

				// align-items: center;
				.message {
					color: #ffffff;
					width: 176rpx;
					height: 70rpx;
					// background: linear-gradient(90deg, #20a635 7%, #108a49);
					background-color: #FA6138;
					border-radius: 35rpx 0 0 35rpx;
					display: flex;
					align-items: center;
					padding-left: 36rpx;
					box-sizing: border-box;
					margin-top: 53rpx;
					transform: translateY(-50%);

					.setup {
						margin-right: 30rpx;
						font-size: 50rpx;
					}

					.setup-one {
						margin-right: 22rpx;
						font-size: 50rpx;
					}

					.iconfont2 {
						font-size: 33rpx;
					}

					.tip {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #ffffff;
						margin-left: 8rpx;
					}
				}
			}



			.name {
				// color: rgba(255, 255, 255, 1);

				color: #1A1A1A;
				font-size: 36rpx;
				margin-left: 22rpx;
				line-height: 100rpx;
				flex: 1;

				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;


				text {
					line-height: 30rpx;
				}

				.right {

					margin-left: 16rpx;
				}
			}

			image {
				width: 115rpx;
				height: 115rpx;
				border-radius: 999rpx;
				margin-left: 30rpx;
			}

			.top-title {
				height: 88rpx;
				line-height: 88rpx;
			}

			.head image {
				width: 106rpx;
				height: 106rpx;
			}

			.login {
				line-height: 106rpx;
			}
		}
	}

	.bgImg {
		position: relative;
		width: 100%;
	}



	.position-ab {


		.other {
			margin: 30rpx;
			background-color: #ffffff;
			padding: 45rpx 28rpx 40rpx 28rpx;
			border-radius: 20rpx;

			&:first-child {
				margin-top: 0;
			}

			.option {
				display: flex;
				// justify-content: space-between;

				&:nth-child(n + 1) {
					margin-top: 54rpx;
				}

				// flex-wrap: wrap;
				.list {
					margin-right: 72rpx;
					text-align: center;

					// width: 25%;
					// flex-shrink: 0;
					// &:nth-child(n + 5){
					// 	
					// }
					.my-icon {
						width: 48rpx;
						height: 46rpx;
					}

					.name-one {
						font-size: 26rpx;
						color: #1a1a1a;
						font-weight: 400;
						margin-top: 18rpx;
					}

					.othernum {
						// position: absolute;
						margin-left: 65rpx;
						margin-top: -10rpx;
						background-color: #ff0000;
						padding: 0px 11rpx;
						border-radius: 100rpx;
						font-weight: 400;
						color: #ffffff;
						font-size: 23rpx;
					}

					.one {
						font-size: 52rpx;
						background: linear-gradient(180deg, #78df6a, #11d688);
						-webkit-background-clip: text;
						color: transparent;
					}

					.two {
						font-size: 50rpx;
						background: linear-gradient(180deg, #dc9c56, #ff7303);
						-webkit-background-clip: text;
						color: transparent;
					}

					.four {
						font-size: 52rpx;
						background: linear-gradient(180deg, #ff5475, #fd4303);
						-webkit-background-clip: text;
						color: transparent;
					}

					.five {
						font-size: 52rpx;
						background: linear-gradient(180deg, #b175f0, #3db3fd);
						-webkit-background-clip: text;
						color: transparent;
					}

					&:last-child {
						margin-right: 0;
					}
				}
			}

			.other-top {
				display: flex;
				padding-bottom: 18rpx;
				align-items: center;
				margin-bottom: 32rpx;
				border-bottom: 1rpx solid #e6e6e6;

				.left {
					flex: 1;
					font-size: 30rpx;
					font-weight: 700;
					color: #1A1A1A;
					line-height: 30rpx;
				}

				.right {
					color: #999999;
					font-size: 28rpx;
					line-height: 30rpx;
					font-weight: 400;
					display: flex;
					align-items: center;

					.other-icon {
						color: #999999;
						margin-left: 16rpx;
						font-size: 15rpx;
					}
				}
			}
		}

		.tools {
			.option {
				justify-content: flex-start;

				.list {
					margin-right: 72rpx;

					&:last-child {
						margin-right: 0;
					}
				}
			}
		}

		.community {
			margin-bottom: 100rpx;

			.community-item {
				display: flex;

				.num-and-item {
					width: 25%;
					text-align: center;

					.num {
						font-size: 36rpx;
						font-weight: 700;
						line-height: 30rpx;
						color: #FF0000;
						padding: 32rpx 0 16rpx 0;
					}

					.and-item {
						font-size: 26rpx;
						font-weight: 400;
						color: #1A1A1A;
						line-height: 30rpx;
						padding-bottom: 40rpx;
					}
				}
			}

			padding: 18rpx 30rpx;
			margin: 30rpx 30rpx;
			background-color: #ffffff;
			border-radius: 20rpx;

			.community-top {
				display: flex;
				padding-bottom: 18rpx;
				background-color: #ffffff;
				border-bottom: 1rpx solid #e6e6e6;

				.my-community {
					flex: 1;
					font-size: 30rpx;
					font-weight: 700;
					color: #1a1a1a;
				}

				.community-right {
					font-size: 28rpx;
					font-weight: 400;
					display: flex;
					align-items: center;
					color: #999999;

					.community-right-top {
						color: #999999;
					}

					.community-top {
						font-size: 24rpx;
						font-weight: 400;
					}

					.community-icon {
						// margin-top: 4rpx;
						margin-left: 16rpx;
						font-size: 35rpx;
					}
				}
			}
		}




		.wallet image {
			width: 32rpx;
			height: 34rpx;
		}


	}






	.career {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 690rpx;
		// height: 200rpx;
		margin: 0 auto 30rpx;
		padding: 30rpx;
		padding-left: 35rpx;
		background: #FA6138;
		border-radius: 20rpx;
		font-size: 24rpx;
		font-family: PingFang SC, PingFang SC-Bold;
		font-weight: 400;
		color: #ffffff;

		.label {
			display: flex;
			align-items: center;
			margin-bottom: 6rpx;
			font-size: 30rpx;
			font-weight: 700;
			color: #f5f5f5;
			margin-left: -8rpx;
		}

		.career-icon {
			font-size: 36rpx;
		}

		.status {
			margin-bottom: 10rpx;
		}

		.look-career {
			width: 195rpx;
			height: 80rpx;
			background: #FA6138;
			border: 2rpx solid #ffffff;
			font-size: 28rpx;
			border-radius: 41rpx;
			text-align: center;
			line-height: 80rpx;
		}
	}

	// czd
	.mine-top {
		display: flex;
		justify-content: space-between;
		align-items: stretch;
		padding: 20rpx 20rpx 70rpx 20rpx;
		background: #fff;

		.mine-left {
			display: flex;
			align-items: center;

			.mine-left-img {
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
				border: 4rpx solid #fff;
			}

			.name-info {
				padding: 0 20rpx;

				.name-text {
					display: block;
					font-size: 32rpx;
					color: #fff;
					font-weight: 700;
					color: #1A1A1A;
				}

				.name-tag {
					display: block;
					font-size: 28rpx;
					margin-top: 6rpx;
					color: #fff;
					color: #808080;
				}
			}
		}

		.mine-right {
			display: flex;
			align-items: center;
			font-size: 32rpx;
			color: #fff;
			margin-right: 40rpx;
		}


	}

	.maxBox {
		width: 100%;
		background: #fff url("@/static/czd/person_bg.png");
		background-size: 100%;
		.pointsBox{
			width: 690rpx;
			height: 100rpx;
			// background: linear-gradient(127deg,#3cb7d2 6%, #46c8d5 93%);
			background: #FA6138;
			border-radius: 20rpx;
			margin: auto;
			position: relative;
			top: -30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 28rpx;
			color: #FFFFFF;
			padding: 0 30rpx;
			.pointsBox_l{
				font-weight: 700;
				image{
					width: 37rpx;
					height: 37rpx;
					vertical-align: middle;
					margin-right: 10rpx;
				}
			}
			.pointsBox_r{
				
			}
		}
		.shopOrderList {
			margin: 0 30rpx 30rpx;
			background: #fff;
			padding: 30rpx 30rpx 0 30rpx;
			border-radius: 20rpx;
		
			box-shadow: 0 2rpx 12rpx 0 rgba(0, 0, 0, 0.1);

			.shopOrderList_title {
				display: flex;
				justify-content: space-between;
				border-bottom: 2rpx solid #DEDEDE;
				padding-bottom: 30rpx;

				.shopOrderList_title_l {
					font-size: 30rpx;
					color: #1A1A1A;
					font-weight: 700;
				}

				.shopOrderList_title_r {
					font-size: 24rpx;
					color: #999999;

					.iconfont_yige {
						font-weight: 700;
					}
				}
			}

			.shopOrderList_b {
				display: flex;
				justify-content: space-between;
				padding: 30rpx 10rpx;

				.shopOrderList_item {
          position: relative;
					text-align: center;
          
          .anglenum {
            position: absolute;
            // margin-left: 75rpx;
            // margin-top: -20rpx;
            background-color: #ff0000;
            padding: 0px 11rpx;
            border-radius: 100rpx;
            font-weight: 400;
            font-size: 23rpx;
            color: #ffffff;
			right: -12rpx;
			top: -20rpx;
          }

					.shopOrderList_item_img {
						image {
							width: 44rpx;
							height: 44rpx;
						}
					}

					.shopOrderList_item_lab {
						font-size: 26rpx;
						color: #1A1A1A;
					}
				}
			}
		}
	}

	.list {
		margin: 0 30rpx;
		padding: 30rpx;
		background: #fff;
		border-radius: 20rpx;
		margin-bottom: 30rpx;
		.list_title{
			    font-size: 15px;
			    color: #1A1A1A;
			    font-weight: 700;
				border-bottom: 1px solid #DEDEDE;
				    padding-bottom: 15px;
		}
		.list_item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx 0;
			border-bottom: 2rpx solid #DEDEDE;
      
      &:last-child {
        border-bottom: none;
      }

			.list_item_l {
				font-size: 28rpx;
				color: #1A1A1A;
				display: flex;
				align-items: center;

				image {
					width: 37rpx;
					height: 37rpx;
					margin-right: 16rpx;
				}
			}

			.list_item_r {
				image {
					width: 14rpx;
					height: 22rpx;
				}
			}
		}
	}
</style>