| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591 | 
							- <template>
 
- 	<view>
 
- 		<view class="top-cont">
 
- 			<view class="top-inner">			
 
- 				<!-- 这里是状态栏 -->
 
- 				<view class="status_bar" :style="{height: statusBarHeight}"></view>
 
- 				<view class="user-info">
 
- 					<view class="left" @click="openPersonInfo()">
 
- 						<view class="head-img">
 
- 							<image :src="user.avatar==null?'/static/images/detault_head.jpg':user.avatar" mode="aspectFill"></image>
 
- 						</view>
 
- 						<view class="name-phone">
 
- 							<view class="name">{{user.nickname}}</view>
 
- 							<view class="phone" v-if="user.phone!=''">{{utils.parsePhone(user.phone)}}</view>
 
- 						</view>
 
- 					</view>
 
- 					<view class="right">
 
- 						
 
- 						<uni-badge size="small" :text="msgNum" absolute="rightTop" type="error">
 
- 							<view class="set" @click="navgetTo('/pages_user/user/personInfo')">
 
- 								<image src="../../static/images/icon-set.png" mode=""></image>
 
- 							</view>
 
- 						</uni-badge>
 
- 						<uni-badge size="small" :text="msgNum" absolute="rightTop" type="error">
 
- 							<view class="msg-box" @click="navgetTo('/pages_user/user/message')">
 
- 								<image src="../../static/images/icon-msg.png" mode=""></image>
 
- 							</view>
 
- 							
 
- 						</uni-badge>
 
- 					</view>
 
- 					
 
- 				</view>
 
- 				<!-- 我的订单 -->
 
- 				<view class="my-order">
 
- 					<view class="inner">
 
- 						<view class="title-box">
 
- 							<text class="title">我的订单</text>
 
- 							<view class="all-order" @click="showOrder('')">
 
- 								<text class="text">全部订单</text>
 
- 								<image src="../../static/images/arrow4.png" mode=""></image>
 
- 							</view>
 
- 						</view>
 
- 						<view class="status-box">
 
- 							<uni-badge size="small" :text=count0 absolute="rightTop" type="error">
 
- 								<view class="item" @click="showOrder('0')">
 
- 									<image src="../../static/images/payment.png" mode=""></image>
 
- 									<text class="text">待付款</text>
 
- 								</view>
 
- 							</uni-badge>
 
- 							<uni-badge size="small" :text=count1 absolute="rightTop" type="error">
 
- 							<view class="item" @click="showOrder('1')">
 
- 								<image src="../../static/images/send_goods.png" mode=""></image>
 
- 								<text class="text">待发货</text>
 
- 							</view>
 
- 							</uni-badge>
 
- 							<uni-badge size="small" :text=count2 absolute="rightTop" type="error">
 
- 							<view class="item" @click="showOrder('2')">
 
- 								<image src="../../static/images/sou_goods.png" mode=""></image>
 
- 								<text class="text">待收货</text>
 
- 							</view>
 
- 							</uni-badge>
 
- 							<view class="item" @click="showOrder('3')">
 
- 								<image src="../../static/images/completed.png" mode=""></image>
 
- 								<text class="text">已完成</text>
 
- 							</view>
 
- 							<uni-badge size="small" :text=afterSalesCount absolute="rightTop" type="error">
 
- 							<view class="item" @click="navgetTo('/pages_user/user/refundOrderList')">
 
- 								<image src="../../static/images/after_sales.png" mode=""></image>
 
- 								<text class="text">售后/退款</text>
 
- 							</view>
 
- 							</uni-badge>
 
- 						</view>
 
- 					</view>
 
- 				</view>
 
- 				<view class="content">
 
- 					<!-- 常用工具 -->
 
- 					<view class="used-tools">
 
- 						<view class="title">常用工具</view>
 
- 						<view class="tools-list">
 
- 							<!-- <view 
 
- 								v-for="(item,index) in toolsArr" 
 
- 								:key="index" 
 
- 								@click="navgetTo(item.url)" 
 
- 								:class="(toolsArr.length - index) > toolsRemain?'item':'item no-marin-bottom'">
 
- 								<image :src="item.img" mode=""></image>
 
- 								<text class="text">{{ item.name }}</text>
 
- 								<button v-if="item.url == ''" class="contact-btn" open-type="contact"></button>
 
- 							</view> -->
 
- 							<!-- <view class="item" @click="navgetTo('/pages_user/user/doctorOrder')">
 
- 								<image src="../../static/images/my_ask.png" mode=""></image>
 
- 								<text class="text">我的问诊</text>
 
- 							</view> -->
 
- 							<view class="item no-marin-bottom" @click="navgetTo('/pages_shopping/live/order')">
 
- 								<image src="../../static/images/live.png" mode=""></image>
 
- 								<text class="text">直播订单</text>
 
- 							</view>
 
- 							<view class="item" @click="navgetTo('/pages_user/user/prescribeOrder')">
 
- 								<image src="../../static/images/prescription.png" mode=""></image>
 
- 								<text class="text">我的处方</text>
 
- 							</view>
 
- 							<view class="item" @click="navgetTo('/pages_user/user/patient')">
 
- 								<image src="../../static/images/management.png" mode=""></image>
 
- 								<text class="text">就诊人管理</text>
 
- 							</view>
 
- 							<view class="item" @click="navgetTo('/pages_user/user/address')">
 
- 								<image src="../../static/images/address.png" mode=""></image>
 
- 								<text class="text">收货地址</text>
 
- 							</view>
 
- 							<!-- <view class="item no-marin-bottom" @click="navgetTo('/pages_user/user/integral')">
 
- 								<image src="../../static/images/integral.png" mode=""></image>
 
- 								<text class="text">积分管理</text>
 
- 							</view> -->
 
- 							<view class="item no-marin-bottom"  @click="navgetTo('/pages_shopping/shopping/myCoupon')">
 
- 								<image src="../../static/images/mycoupon.png" mode=""></image>
 
- 								<text class="text">优惠券</text>
 
- 							</view>
 
- 							<view class="item no-marin-bottom" @click="navgetTo('/pages_user/user/storeProductRelation')">
 
- 								<image src="../../static/images/service_file.png" mode=""></image>
 
- 								<text class="text">我的足迹</text>
 
- 							</view>
 
- 							<view class="item no-marin-bottom" @click="openH5(1)">
 
- 								<image src="../../static/images/service_file.png" mode=""></image>
 
- 								<text class="text">用户协议</text>
 
- 							</view>
 
- 							<view class="item no-marin-bottom align-top"  @click="openH5(2)">
 
- 								<image src="../../static/images/advice.png" mode=""></image>
 
- 								<text class="text">隐私保护</text>
 
- 							</view>
 
- 							<view class="item no-marin-bottom">
 
- 								<image src="../../static/images/customer1.png" mode=""></image>
 
- 								<text class="text">专属客服</text>
 
- 								<button class="contact-btn" open-type="contact"></button>
 
- 							</view>
 
- 							<view v-if="user.isPromoter==0" class="item no-marin-bottom"  @click="navgetTo('/pages_user/user/userTuiAdd')">
 
- 								<image src="../../static/images/my_promotion.png" mode=""></image>
 
- 								<text class="text">申请健康大使</text>
 
- 							</view>
 
- 							<view v-if="user.isPromoter==1" class="item no-marin-bottom"  @click="navgetTo('/pages_user/user/userTui')">
 
- 								<image src="../../static/images/my_promotion.png" mode=""></image>
 
- 								<text class="text">我的推广</text>
 
- 							</view>
 
- 							<view class="item no-marin-bottom"  @click="navgetTo('/pages/home/cert')">
 
- 								<image src="../../static/images/service_file.png" mode=""></image>
 
- 								<text class="text">资质证书</text>
 
- 							</view>
 
- 	
 
- 							<view class="item no-marin-bottom" @click="toManager()">
 
- 								<image src="../../static/images/management.png" mode=""></image>
 
- 								<text class="text">销售管理</text>
 
- 							</view>
 
- 							
 
- 							 <!-- <view class="item no-marin-bottom" @click="toManagerCourse()">
 
- 							 	<image src="../../static/images/management.png" mode=""></image>
 
- 							 	<text class="text">销售管理</text>
 
- 							 </view> -->
 
- 						</view>
 
- 					</view>
 
- 					<!-- 退出登录按钮 -->
 
- 				</view>
 
- 				<view style="padding-bottom: 20rpx;" v-if="user.phone!=''">
 
- 					<view @tap="loginOUt" class="log-out x-c" >退出登录</view>
 
- 				</view>
 
- 				<!-- <view class="banner">
 
- 					<image src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20221125/71ddd95044bb46d5b27e19a5f61cf5ab.png"></image>
 
- 					<view class="tel_btn" @click="callService()"></view>
 
- 				</view> -->
 
- 				<view class="like-product">
 
- 					<likeProduct  ref="product" />
 
- 				</view>
 
- 			</view>
 
- 			
 
- 		</view>
 
- 		
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import {getOrderCount} from '@/api/storeOrder'
 
- 	import {getUserInfo} from '@/api/user'
 
- 	import likeProduct from '@/components/likeProduct.vue'
 
- 	export default {
 
- 		components: {
 
- 			likeProduct
 
- 		},
 
- 		data() {
 
- 			return {
 
- 				count0:0,
 
- 				count1:0,
 
- 				count2:0,
 
- 				afterSalesCount:0,
 
- 				user:{
 
- 					isPromoter:0,
 
- 					isWeixinAuth:0,
 
- 					phone:"",
 
- 					nickname:"请登录",
 
- 					avatarUrl:"/static/images/detault_head.png"
 
- 				},
 
- 				// 状态栏的高度
 
- 				statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
 
- 				// 消息数量
 
- 				msgNum: 0,
 
- 				
 
- 				 
 
- 			};
 
- 		},
 
- 		onLoad() {
 
- 			console.log("onload")
 
- 		},
 
- 		onShow() {
 
- 			console.log("onshow")
 
- 			var that=this;
 
- 			if(uni.getStorageSync('AppToken')){
 
- 				that.getUserInfo();
 
- 				that.getOrderCount();
 
- 			}
 
- 			// this.utils.isLogin().then(res => {
 
- 			// 	that.getUserInfo();
 
- 			// 	that.getOrderCount();
 
- 			// })
 
- 			
 
- 		},
 
- 		onReachBottom() {
 
- 			console.log("onReachBottom")
 
- 			this.$refs.product.getGoodsProducts();
 
- 		},
 
- 		methods: {
 
- 			toManagerCourse(){
 
- 				if(uni.getStorageSync('ManageToken')){
 
- 					uni.navigateTo({
 
- 						url: '/pages_manage/index'
 
- 					})
 
- 				}
 
- 				else{
 
- 					uni.navigateTo({
 
- 						url: '/pages_manage/login'
 
- 					})
 
- 				}
 
- 				
 
- 			},
 
- 			loginOUt(){
 
- 				this.utils.loginOut();
 
- 				this.getUserInfo();
 
- 				// uni.switchTab({
 
- 				// 	url:'/pages/home/index'
 
- 				// })
 
- 			},
 
- 			openPersonInfo(){
 
- 				this.utils.isLogin().then(res => {
 
- 					uni.navigateTo({
 
- 						url:"/pages_user/user/personInfo"
 
- 					})
 
- 				})
 
- 				 
 
- 			},
 
- 			callService(){
 
- 				 uni.makePhoneCall({
 
- 					phoneNumber:"4000717770",
 
- 					success:function(){
 
- 						console.log('拨打电话成功');
 
- 					},
 
- 					fail() {
 
- 						console.log('打电话失败了');
 
- 					}
 
- 				})
 
- 			},
 
- 			 
 
- 			getOrderCount(){
 
- 				getOrderCount().then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							this.count0=res.count0;
 
- 							this.count1=res.count1; 
 
- 							this.count2=res.count2; 
 
- 							this.afterSalesCount=res.afterSalesCount; 
 
- 						} 
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 			toManager(){
 
- 				if(this.utils.checkCompanyUserLoginState()){
 
- 					uni.navigateTo({
 
- 						url: '/pages_company/index'
 
- 					})
 
- 				}
 
- 				else{
 
- 					uni.navigateTo({
 
- 						url: '/pages_company/auth/login'
 
- 					})
 
- 				}
 
- 				
 
- 			},
 
- 			openH5(type){
 
- 				var requestPath = uni.getStorageSync('requestPath');
 
- 				// uni.setStorageSync('url',requestPath+url);
 
- 				uni.navigateTo({
 
- 					url: '../home/h5?type='+type
 
- 				})
 
- 			},
 
- 			getUserInfo(){
 
- 				getUserInfo().then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							if(res.user!=null){
 
- 								this.user=res.user;
 
- 								uni.setStorageSync('userData',res.user)
 
- 							}
 
- 							else{
 
- 								this.utils.loginOut();
 
- 							}
 
- 							
 
- 						}else{
 
- 							uni.showToast({
 
- 								icon:'none',
 
- 								title: "请求失败",
 
- 							});
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 			// 跳转页面
 
- 			navgetTo(url) {
 
- 				this.utils.isLogin().then(res => {
 
- 					if(res){
 
- 						uni.navigateTo({
 
- 							url: url
 
- 						})
 
- 					}
 
- 				})
 
- 			},
 
- 			// 查看订单
 
- 			showOrder(status) {
 
- 				uni.navigateTo({
 
- 					url: '/pages_user/user/storeOrder?status=' + status
 
- 				})
 
- 			}
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	.top-cont{
 
- 		width: 100%;
 
- 		height: 494upx;
 
- 		position: relative;
 
- 		background-image: url(../../static/images/personl_top_bg.png);
 
- 		background-repeat: repeat-x;
 
- 		background-size: 40upx 100%;
 
- 		.top-inner{
 
- 			width: 100%;
 
- 			height: 100%;
 
- 			position: absolute;
 
- 			top: 0;
 
- 			left: 0;
 
- 			z-index: 2;
 
- 			.user-info{
 
- 				padding: 88upx 30upx 0 30upx;
 
- 				display: flex;
 
- 				align-items: center;
 
- 				justify-content: space-between;
 
- 				.left{
 
- 					position: relative;
 
- 					display: flex;
 
- 					.head-img{
 
- 						width: 120upx;
 
- 						height: 120upx;
 
- 						border-radius: 50%;
 
- 						overflow: hidden;
 
- 						margin-right: 30upx;
 
- 						border: 4upx solid #FFFFFF;
 
- 						box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
 
- 						image{
 
- 							width: 100%;
 
- 							height: 100%;
 
- 						}
 
- 					}
 
- 					.name-phone{
 
- 						padding-top: 15upx;
 
- 						.name{
 
- 							font-size: 40upx;
 
- 							font-family: PingFang SC;
 
- 							font-weight: bold;
 
- 							color: #111111;
 
- 							line-height: 1;
 
- 						}
 
- 						.phone{
 
- 							font-size: 28upx;
 
- 							font-family: PingFang SC;
 
- 							font-weight: 500;
 
- 							color: #666666;
 
- 							line-height: 1;
 
- 							margin-top: 30upx;
 
- 						}
 
- 					}
 
- 				}
 
- 				.right{
 
- 					display: flex;
 
- 					align-items: center;
 
- 					justify-content: center;
 
- 					.msg-box{
 
- 						margin-left: 10upx;
 
- 						width: 44upx;
 
- 						height: 44upx;
 
- 						image{
 
- 							width: 100%;
 
- 							height: 100%;
 
- 						}
 
- 					}
 
- 					.set{
 
- 						
 
- 						width: 44upx;
 
- 						height: 44upx;
 
- 						image{
 
- 							width: 100%;
 
- 							height: 100%;
 
- 						}
 
- 					}
 
- 				}
 
- 				
 
- 			}
 
- 			.my-order{
 
- 				padding: 50upx 20upx 0;
 
- 				.inner{
 
- 					box-sizing: border-box;
 
- 					height: 245upx;
 
- 					background: #FFFFFF;
 
- 					border-radius: 16upx;
 
- 					padding: 40upx 30upx;
 
- 					display: flex;
 
- 					flex-direction: column;
 
- 					justify-content: space-between;
 
- 					.title-box{
 
- 						display: flex;
 
- 						align-items: center;
 
- 						justify-content: space-between;
 
- 						.title{
 
- 							font-size: 34upx;
 
- 							font-family: PingFang SC;
 
- 							font-weight: bold;
 
- 							color: #222222;
 
- 							line-height: 1;
 
- 						}
 
- 						.all-order{
 
- 							display: flex;
 
- 							align-items: center;
 
- 							.text{
 
- 								font-size: 26upx;
 
- 								font-family: PingFang SC;
 
- 								font-weight: 500;
 
- 								color: #999999;
 
- 								line-height: 1;
 
- 								margin-right: 8upx;
 
- 							}
 
- 							image{
 
- 								width: 14upx;
 
- 								height: 24upx;
 
- 							}
 
- 						}
 
- 					}
 
- 					.status-box{
 
- 						display: flex;
 
- 						align-items: center;
 
- 						justify-content: space-between;
 
- 						padding: 0 10upx;
 
- 						.item{
 
- 							display: flex;
 
- 							flex-direction: column;
 
- 							align-items: center;
 
- 							justify-content: center;
 
- 							image{
 
- 								width: 40upx;
 
- 								height: 40upx;
 
- 								margin-bottom: 18upx;
 
- 							}
 
- 							.text{
 
- 								font-size: 26upx;
 
- 								font-family: PingFang SC;
 
- 								font-weight: 500;
 
- 								color: #111111;
 
- 								line-height: 1;
 
- 							}
 
- 						}
 
- 					}
 
- 				}
 
- 			}
 
- 			
 
- 		}
 
- 	}
 
- 	.content{
 
- 		margin-top: 20upx;
 
- 		padding: 0 20upx;
 
- 		display: flex;
 
- 		align-items: center;
 
- 		justify-content: center;
 
- 		.used-tools{
 
- 			box-sizing: border-box;
 
- 			background: #FFFFFF;
 
- 			border-radius: 16upx;
 
- 			padding: 40upx 30upx;
 
- 			
 
- 			.title{
 
- 				font-size: 34upx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: bold;
 
- 				color: #222222;
 
- 				line-height: 1;
 
- 			}
 
- 			.tools-list{
 
- 				margin-top: 50upx;
 
- 				display: flex;
 
- 				flex-wrap: wrap;
 
- 				width: 100%;
 
- 				.item{
 
- 					box-sizing: border-box;
 
- 					width: 25%;
 
- 					display: flex;
 
- 					flex-direction: column;
 
- 					align-items: center;
 
- 					justify-content: center;
 
- 					margin-bottom: 50upx;
 
- 					position: relative;
 
- 					image{
 
- 						width: 44upx;
 
- 						height: 44upx;
 
- 					}
 
- 					.text{
 
- 						font-size: 24upx;
 
- 						font-family: PingFang SC;
 
- 						font-weight: 500;
 
- 						color: #111111;
 
- 						line-height: 1;
 
- 						margin-top: 20upx;
 
- 					}
 
- 					.contact-btn{
 
- 						display: inline-block;
 
- 						position: absolute;
 
- 						top: 0;
 
- 						left: 0;
 
- 						width: 100%;
 
- 						height: 100%;
 
- 						opacity: 0;
 
- 					}
 
- 				}
 
- 			}
 
- 		}
 
- 		
 
- 	}
 
- 	.sub-btn{
 
- 		position: absolute;
 
- 		width: 100%;
 
- 		height: 100%;
 
- 		opacity: 0;
 
- 	}
 
- 	.like-product{
 
- 		padding: 0 20rpx;
 
- 		 
 
- 	}
 
- 	.banner{
 
- 		padding: 20rpx 20rpx 0rpx 20rpx;
 
- 		height: 200rpx;
 
- 		position: relative;
 
- 		display: flex;
 
- 		align-items: center;
 
- 		justify-content: center;
 
- 		image{
 
- 			width:100%;
 
- 			height: 100%;
 
- 		}
 
- 		.tel_btn{
 
- 			width: 100%;
 
- 			height: 100%;
 
- 			top:0upx;
 
- 			position: absolute;
 
- 			opacity:0.0;
 
- 		}
 
- 	}
 
- 	.log-out{
 
- 		height: 80upx;
 
- 		margin: 20upx;
 
- 		line-height: 80upx;
 
- 		text-align: center;
 
- 		font-size: 26upx;
 
- 		font-family: PingFang SC;
 
- 		font-weight: 500;
 
- 		color: #666666;
 
- 		background: #FFFFFF;
 
- 		border-radius: 16upx;
 
- 		margin-top: 20upx;
 
- 	}
 
- </style>
 
 
  |