yanjie 4 лет назад
Родитель
Сommit
5497132516

+ 2 - 6
pages/doctor_related/doctor_info.vue

xqd xqd xqd
@@ -33,7 +33,7 @@
 						</view>
 					</view>
 					<u-read-more :toggle="true" show-height="0" :shadow-style="shadowStyle" close-text=" " open-text=" ">
-						<rich-text :nodes="content"></rich-text>
+						<rich-text :nodes="doctor.intro"></rich-text>
 					</u-read-more>
 				</view>
 			</view>
@@ -108,7 +108,7 @@
 								</text>
 							</view>
 						</view>
-						<view class="action" style="width: 104rpx;">
+						<view class="action" style="width: 124rpx;">
 							<view class="text-grey text-xs">{{item.created_at}}</view>
 						</view>
 					</view>
@@ -143,10 +143,6 @@
 		},
 		data() {
 			return {
-				content: `浔阳江头夜送客,枫叶荻花秋瑟瑟。主人下马客在船,举酒欲饮无管弦。醉不成欢惨将别,别时茫茫江浸月。
-				忽闻水上琵琶声,主人忘归客不发。寻声暗问弹者谁,琵琶声停欲语迟。移船相近邀相见,添酒回灯重开宴。千呼万唤始出来,犹抱琵琶半遮面。转轴拨弦三两声,未成曲调先有情。弦弦掩抑声声思,似诉平生不得志。低眉信手续续弹,说尽心中无限事。轻拢慢捻抹复挑,初为《霓裳》后《六幺》。大弦嘈嘈如急雨,小弦切切如私语。嘈嘈切切错杂弹,大珠小珠落玉盘。间关莺语花底滑,幽咽泉流冰下难。冰泉冷涩弦凝绝,凝绝不通声暂歇。别有幽愁暗恨生,此时无声胜有声。银瓶乍破水浆迸,铁骑突出刀枪鸣。曲终收拨当心画,四弦一声如裂帛。东船西舫悄无言,唯见江心秋月白。
-				沉吟放拨插弦中,整顿衣裳起敛容。自言本是京城女,家在虾蟆陵下住。十三学得琵琶成,名属教坊第一部。曲罢曾教善才服,妆成每被秋娘妒。五陵年少争缠头,一曲红绡不知数。钿头银篦击节碎,血色罗裙翻酒污。今年欢笑复明年,秋月春风等闲度。弟走从军阿姨死,暮去朝来颜色故。门前冷落鞍马稀,老大嫁作商人妇。商人重利轻别离,前月浮梁买茶去。去来江口守空船,绕船月明江水寒。夜深忽梦少年事,梦啼妆泪红阑干。
-				我闻琵琶已叹息,又闻此语重唧唧。同是天涯沦落人,相逢何必曾相识!我从去年辞帝京,谪居卧病浔阳城。浔阳地僻无音乐,终岁不闻丝竹声。住近湓江地低湿,黄芦苦竹绕宅生。其间旦暮闻何物?杜鹃啼血猿哀鸣。春江花朝秋月夜,往往取酒还独倾。岂无山歌与村笛?呕哑嘲哳难为听。今夜闻君琵琶语,如听仙乐耳暂明。莫辞更坐弹一曲,为君翻作《琵琶行》。感我此言良久立,却坐促弦弦转急。凄凄不似向前声,满座重闻皆掩泣。座中泣下谁最多?江州司马青衫湿。`,
 				doctorid: "",
 				doctor: {},
 				shadowStyle: {

+ 22 - 16
pages/doctor_related/info_write.vue

xqd xqd xqd
@@ -46,7 +46,7 @@
 					<text class="text-grey">咨询费用</text>
 				</view>
 				<view class="action">
-					<text class="text-grey text-sm">{{type==1?doctor.phone_price/100:type==2?doctor.chat_price/100:doctor.appoint_price/100}}元</text>
+					<text class="text-red text-sm">¥{{type==1?doctor.phone_price/100:type==2?doctor.chat_price/100:doctor.appoint_price/100}}元</text>
 				</view>
 			</view>
 			<view class="cu-item" v-if="type==3">
@@ -281,12 +281,6 @@
 			gotopay:async function() {
 				if(this.type==1){
 					if(this.value!=""&&this.phonenum!=""&&this.$util.isPhoneNumber(this.phonenum)){
-						console.log(this.type)
-						console.log(this.doctor.id)
-						console.log(this.huanzheID)
-						console.log(this.price)
-						console.log(this.phonenum)
-						console.log(this.doctor.phone_minutes)
 						let obj={
 							doctorname:this.doctor.name,
 							product_type:this.type,
@@ -300,15 +294,27 @@
 						uni.navigateTo({
 							url:"../order/payment?data="+JSON.stringify(obj)
 						})
-						// let res = await this.$request.post("/api/v1/order/consultPlaceOrder",{
-						// 	product_type:this.type,
-						// 	docter_id:this.doctor.id,
-						// 	patient_id:this.huanzheID,
-						// 	total_amount:this.price,
-						// 	phone:this.phonenum,
-						// 	phone_minutes:this.doctor.phone_minutes,
-						// 	payment_type:2
-						// })
+					}else{
+						uni.showToast({
+							title:"请选择完整",
+							icon:"none"
+						})
+					}
+				}else if(this.type==2){
+					if(this.value!=""&&this.zhengzhuang!=""&&this.imgList.length!=0){
+						let obj={
+							doctorname:this.doctor.name,
+							product_type:this.type,
+							docter_id:this.doctor.id,
+							patient_id:this.huanzheID,
+							total_amount:this.price/100,
+							symptoms:this.zhengzhuang,
+							medical_imgs:this.imgList,
+							payment_type:2
+						}
+						uni.navigateTo({
+							url:"../order/payment?data="+JSON.stringify(obj)
+						})
 					}else{
 						uni.showToast({
 							title:"请选择完整",

+ 34 - 7
pages/doctor_related/select_doctor.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -108,10 +108,12 @@
 					this.istime = false
 				}
 			}
+			if (options.value != "") {
+				this.keyword = options.value
+			}
 		},
 		onShow() {
 			this.getDoctorList()
-
 		},
 		mounted() {
 			this.gettime()
@@ -182,7 +184,8 @@
 				},
 				show: false,
 				istime: false,
-				showtime: ""
+				showtime: "",
+				pageindex: 1
 			}
 		},
 		watch: {
@@ -197,6 +200,9 @@
 				}
 			}
 		},
+		onReachBottom() {
+			this.getDoctorList()
+		},
 		methods: {
 			//监听滚动
 			onPageScroll(e) {
@@ -215,6 +221,10 @@
 				} else {
 					this.istime = false
 				}
+				this.timeday = ""
+				this.timehour = ""
+				this.pageindex = 1
+				this.doctorList = []
 				this.getDoctorList()
 			},
 			city(value) {
@@ -222,6 +232,10 @@
 			},
 			recommend(value) {
 				this.value3 = value
+				this.timeday = ""
+				this.timehour = ""
+				this.pageindex = 1
+				this.doctorList = []
 				this.getDoctorList()
 			},
 			gotoinfo(e) {
@@ -252,7 +266,7 @@
 			},
 			getDoctorList: async function() {
 				let res = await this.$request.post("/api/v1/docter/docterList", {
-					page: 1,
+					page: this.pageindex,
 					list_type: this.value1,
 					name: this.keyword,
 					sort_type: this.value3,
@@ -262,8 +276,15 @@
 					time_period_id: this.timehour
 				}, )
 				if (res.status == 0) {
-					this.doctorList = res.data.data
-					console.log(res)
+					if (this.pageindex > res.data.last_page) {
+						uni.showToast({
+							title: "没有更多了",
+							icon: "none"
+						})
+					} else {
+						this.doctorList = this.doctorList.concat(res.data.data)
+						this.pageindex++
+					}
 				}
 			},
 			gettime: async function() {
@@ -279,6 +300,10 @@
 				}
 			},
 			changeStr() {
+				this.timeday = ""
+				this.timehour = ""
+				this.pageindex = 1
+				this.doctorList = []
 				this.getDoctorList()
 			},
 			xuanzetime() {
@@ -289,6 +314,8 @@
 				this.timeday = this.multiSelector[0][arr[0]]
 				this.timehour = this.multiSelector[1][arr[1]].id
 				this.showtime = this.multiSelector[0][arr[0]] + " " + this.multiSelector[1][arr[1]].start_time_period
+				this.pageindex = 1
+				this.doctorList = []
 				this.getDoctorList()
 			}
 		}
@@ -331,8 +358,8 @@
 
 	.follow_style {
 		position: absolute;
-		bottom: 52rpx;
-		left: 35rpx;
+		bottom: 60rpx;
+		left: 38rpx;
 		z-index: 1;
 		width: 106rpx;
 		height: 40rpx;

+ 47 - 15
pages/index/index.vue

xqd xqd xqd xqd xqd xqd
@@ -1,7 +1,8 @@
 <template>
 	<view class="main">
 		<view class="">
-			<u-search :clearabled="true" shape="round" :show-action="true" placeholder="搜索医生姓名、医院名" v-model="keyword"></u-search>
+			<u-search :clearabled="true" shape="round" @custom="searchvalue" :show-action="true" placeholder="搜索医生姓名、医院名"
+			 v-model="keyword"></u-search>
 		</view>
 		<view class="indexswiper" style="margin-top: 10rpx;">
 			<u-swiper :list="list" mode="dot"></u-swiper>
@@ -13,37 +14,43 @@
 			<u-grid :col="3" :border="false">
 				<view @click="gotoxuanze" data-index="1">
 					<u-grid-item>
-						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexphone.png" shape="circle"></u-image>
+						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexphone.png"
+						 shape="circle"></u-image>
 						<view class="grid-text">电话咨询</view>
 					</u-grid-item>
 				</view>
 				<view class="" @click="gotoxuanze" data-index="2">
 					<u-grid-item>
-						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indextu.png" shape="circle"></u-image>
+						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indextu.png"
+						 shape="circle"></u-image>
 						<view class="grid-text">图文咨询</view>
 					</u-grid-item>
 				</view>
 				<view class="" @click="gotoxuanze" data-index="3">
 					<u-grid-item>
-						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexmen.png" shape="circle"></u-image>
+						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexmen.png"
+						 shape="circle"></u-image>
 						<view class="grid-text">门诊预约</view>
 					</u-grid-item>
 				</view>
 				<view class="">
 					<u-grid-item>
-						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexyimiao.png" shape="circle"></u-image>
+						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexyimiao.png"
+						 shape="circle"></u-image>
 						<view class="grid-text">疫苗接种</view>
 					</u-grid-item>
 				</view>
 				<view class="">
 					<u-grid-item>
-						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexerbao.png" shape="circle"></u-image>
+						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexerbao.png"
+						 shape="circle"></u-image>
 						<view class="grid-text">儿保预约</view>
 					</u-grid-item>
 				</view>
-				<view class="">
+				<view class="" @click="servicepacks">
 					<u-grid-item>
-						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexservice.png" shape="circle"></u-image>
+						<u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexservice.png"
+						 shape="circle"></u-image>
 						<view class="grid-text">服务包</view>
 					</u-grid-item>
 				</view>
@@ -266,9 +273,17 @@
 				],
 				doctorList: [],
 				latitude: 0,
-				longitude: 0
+				longitude: 0,
+				pageindex: 1
 			}
 		},
+		onHide() {
+			this.pageindex = 1
+			this.doctorList = []
+		},
+		onReachBottom() {
+			this.getDoctorList()
+		},
 		methods: {
 			//监听滚动
 			onPageScroll(e) {
@@ -286,15 +301,22 @@
 			},
 			getDoctorList: async function() {
 				let res = await this.$request.post("/api/v1/docter/docterList", {
-					page: 1,
+					page: this.pageindex,
 					latitude: this.latitude,
 					longitude: this.longitude
 				})
 				let status = user.islogin(res)
-				console.log(res)
 				if (status) {
-					this.doctorList = res.data.data
-
+					// this.doctorList = res.data.data
+					if (this.pageindex > res.data.last_page) {
+						uni.showToast({
+							title: "没有更多了",
+							icon: "none"
+						})
+					} else {
+						this.doctorList = this.doctorList.concat(res.data.data)
+						this.pageindex++
+					}
 				}
 			},
 			submitCollect: async function(e) {
@@ -318,6 +340,16 @@
 					}
 				}
 			},
+			servicepacks() {
+				uni.navigateTo({
+					url: "../service_packs/introduce"
+				})
+			},
+			searchvalue(value) {
+				uni.navigateTo({
+					url: "../doctor_related/select_doctor?value=" + value
+				})
+			},
 			//获取当前地址
 			GetCurrentAddress() {
 				getLocation().then(res => {
@@ -369,8 +401,8 @@
 
 	.follow_style {
 		position: absolute;
-		bottom: 52rpx;
-		left: 35rpx;
+		bottom: 60rpx;
+		left: 38rpx;
 		z-index: 1;
 		width: 106rpx;
 		height: 40rpx;

+ 33 - 19
pages/order/order.vue

xqd xqd xqd xqd xqd xqd
@@ -1,6 +1,6 @@
 <template>
 	<view style="padding: 40rpx 30rpx; background-color: #f6f6f6;height: 100vh;width: 100vw;">
-		
+
 		<!-- 卡片 -->
 		<view class="card">
 			<!-- 图片 -->
@@ -16,40 +16,50 @@
 			<!-- 黑字 -->
 			<view class="card_text">
 				<text v-if="product_type=='1'">您已发起电话咨询</text>
-				<text v-else-if="product_type=='2' || product_type=='3'">您已提交预约申请</text>
-				<text v-else-if="product_type=='5'">您已发起儿保医生图文咨询请求</text>
-				<text v-else-if="product_type=='4'">您已发起疫苗接种医生图文咨询请求</text>
-				<text v-else-if="product_type=='7'">您已充值成功</text>
+				<text v-else-if="product_type=='2'">您已发起图文咨询</text>
+				<text v-else-if="product_type=='3'">您已发起门诊预约</text>
+				<text v-else-if="product_type=='4'||product_type=='5'">您已提交预约申请!</text>
+				<text v-else-if="product_type=='6'">您已充值成功</text>
 				<text v-else>您已成功购买服务包</text>
 			</view>
 			<!-- 灰字 -->
-			<view class="describe" v-if="product_type=='1' || product_type=='6'">
-				
-					<view>我们会在预约成功后以短信的方式通知您</view>
-					<view>请注意查收</view>
+			<view class="describe" v-if="product_type=='3' || product_type=='4'||product_type=='5'">
+				<view>我们会在预约成功后以短信的方式通知您</view>
+				<view>请注意查收</view>
 			</view>
 		</view>
 		<view style="height: 50%;"></view>
 		<!-- 按钮 -->
 		<view class="button">
-			<view class="b"><u-button type="primary">查看服务包</u-button></view>
-			<view class="b"><u-button :hair-line="false" style="color: #0B73B9;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">返回首页</u-button></view>
-			
-			
+			<view class="b">
+				<u-button v-if="product_type==1||product_type==2" type="primary">查看咨询</u-button>
+				<u-button v-else-if="product_type==3||product_type==4||product_type==5" type="primary">查看预约</u-button>
+				<u-button v-else type="primary">查看服务包</u-button>
+			</view>
+			<view class="b">
+				<u-button :hair-line="false" @click="gotoindex" style="color: #0B73B9;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">返回首页</u-button>
+			</view>
 		</view>
 	</view>
 </template>
 
 <script>
 	export default {
+		onLoad(op) {
+			this.product_type = op.type
+		},
 		data() {
 			return {
 				// 产品类型
-				product_type: '6'
+				product_type: ''
 			}
 		},
 		methods: {
-
+			gotoindex() {
+				uni.switchTab({
+					url: "../index/index"
+				})
+			}
 		},
 		onShow() {
 
@@ -67,7 +77,7 @@
 		.card_img {
 			height: 40%;
 			width: 100%;
-			display: flex;//
+			display: flex; //
 			justify-content: center;
 			align-items: flex-end;
 
@@ -84,6 +94,7 @@
 			display: flex;
 			justify-content: center;
 			align-items: center;
+
 			text {
 				font-size: 36rpx;
 				font-weight: bold;
@@ -96,6 +107,7 @@
 			width: 100%;
 			display: block;
 			text-align: center;
+
 			view {
 				padding-top: 5rpx;
 				font-size: 28rpx;
@@ -103,15 +115,17 @@
 			}
 		}
 	}
-	.button{
+
+	.button {
 		height: 15%;
 		width: 100%;
 		display: block;
 		align-items: flex-end;
-		.b{
+
+		.b {
 			padding: 10rpx 0;
 			width: 100%;
-			
+
 		}
 	}
 </style>

+ 66 - 10
pages/order/payment.vue

xqd xqd xqd xqd xqd xqd
@@ -15,7 +15,7 @@
 				<!-- 支付方式占20% -->
 				<view style="height: 20%;width: auto;">
 					<view style="font-size: 30rpx;display: flex;align-items: center;height: 100%;">
-						<text>余额支付 (余额¥50.00元)</text>
+						<text>余额支付 (余额¥{{info.balance/100}}元)</text>
 						<!-- <text v-else>微信支付</text> -->
 					</view>
 				</view>
@@ -65,7 +65,6 @@
 				<uni-list-item :border="false" @click="value=item.name" :clickable="true">
 					<view slot="header">
 						<text style="font-size: 28rpx;font-weight: 400;color: #333333;">{{item.name}}</text>
-						<text v-if="item.name=='钱包余额支付' " style="font-size: 28rpx;font-weight: 500;">{{money}}</text>
 					</view>
 					<view slot="footer">
 						<u-radio @change="radioChange" :key="index" :name="item.name" :disabled="item.disabled">
@@ -87,11 +86,15 @@
 </template>
 
 <script>
+	import store from '@/store'
 	export default {
 		onLoad(op) {
 			this.infodata = JSON.parse(op.data)
 			this.norderAmount = this.infodata.total_amount
 		},
+		mounted() {
+			this.getUserInfo()
+		},
 		data() {
 			return {
 				//医生名称
@@ -102,9 +105,6 @@
 				norderAmount: 19.9,
 				//优惠券
 				coupon: '不使用优惠券',
-				//钱包余额
-				money: '',
-				nmoney: 0.00,
 				// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
 				value: '钱包余额支付',
 				paymenMethod: [{
@@ -115,7 +115,8 @@
 				popupShow: false,
 				//订单类型
 				//支付数据类型
-				infodata: {}
+				infodata: {},
+				info: {}
 			}
 		},
 		methods: {
@@ -134,16 +135,71 @@
 			click(e) {
 				console.log(e)
 			},
+			getUserInfo: async function() {
+				let res = await this.$request.post('/api/v1/user/userInfo')
+				if (res.status == 0) {
+					this.info = res.data
+					console.log(this.info)
+				}
+			},
+			payphone: async function() {
+				let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
+					product_type: this.infodata.product_type,
+					docter_id: this.infodata.docter_id,
+					patient_id: this.infodata.patient_id,
+					total_amount: this.infodata.total_amount * 100,
+					phone: this.infodata.phone,
+					phone_minutes: this.infodata.phone_minutes,
+					payment_type: 2,
+				})
+				console.log(res)
+				if (res.status == 0) {
+					this.popupShow = false
+					uni.showToast({
+						title: "支付成功!",
+						duration: 1500
+					})
+					setTimeout(() => {
+						uni.redirectTo({
+							url: "order?type=" + this.infodata.product_type
+						})
+					}, 1500)
+				}
+			},
+			paychat: async function() {
+				let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
+					product_type: this.infodata.product_type,
+					docter_id: this.infodata.docter_id,
+					patient_id: this.infodata.patient_id,
+					total_amount: this.infodata.total_amount * 100,
+					symptoms: this.infodata.symptoms,
+					medical_imgs: JSON.stringify(this.infodata.medical_imgs),
+					payment_type: 2
+				})
+				if (res.status == 0) {
+					this.popupShow = false
+					uni.showToast({
+						title: "支付成功!",
+						duration: 1500
+					})
+					setTimeout(() => {
+						uni.redirectTo({
+							url: "order?type=" + this.infodata.product_type
+						})
+					}, 1500)
+				}
+			},
 			//点击确认支付
 			payment(e) {
-				uni.navigateTo({
-					url: '/pages/order/order'
-				});
+				if (this.infodata.product_type == 1) {
+					this.payphone()
+				} else if (this.infodata.product_type == 2) {
+					this.paychat()
+				}
 			}
 		},
 		onShow() {
 			this.orderAmount = this.norderAmount + "元"
-			this.money = "  ¥" + this.nmoney + "元"
 		},
 		onHide() {
 			this.popupShow = false

+ 34 - 49
pages/service_packs/choicepacks.vue

xqd xqd xqd
@@ -2,19 +2,19 @@
 	<view style="width: 100vw;height: auto;padding: 30rpx 20rpx;background-color: #f6f6f6;">
 		<view style="width: 100%;height: 100%;">
 			<text style="font-size: 30rpx;font-weight: bold;">官方套餐</text>
-			<view v-for="item,index in array" :key='index'>
+			<view v-for="(item,index) in serviceList" :key='index'>
 				<view class="card">
-					<view class="taocan" @click="details">
+					<view class="taocan" :data-id="item.id" @click="details">
 						<view class="tc_left">
-							<text>{{item.title}}</text>
+							<text>{{item.name}}</text>
 						</view>
 						<view class="tc_right">
 							<view style="width: 100%;">
-								<view class="text">{{item.describe1}}</view>
-								<view class="text">{{item.describe2}}</view>
+								<view class="text">{{item.intro}}</view>
+								<view class="text">{{item.desc}}</view>
 								<view class="text">
-									<text style="text-align: left;">时长:{{item.time}}</text>
-									<text style="float: right;color: #FF4F61;font-weight: bold;">¥{{item.price}}</text>
+									<text style="text-align: left;">时长:{{item.effective_days}}天</text>
+									<text style="float: right;color: #FF4F61;font-weight: bold;">¥{{item.price/100}}</text>
 								</view>
 							</view>
 						</view>
@@ -27,55 +27,39 @@
 
 <script>
 	export default {
+		mounted() {
+			this.getservice()
+		},
 		data() {
 			return {
-				array: [{
-					title: '套餐一',
-					describe1: '疫苗接种+门诊预约+儿保预约',
-					describe2: '成都所有社区医院,十名医生专业团队',
-					time: '一年',
-					price: '599.99'
-				}, {
-					title: '套餐二',
-					describe1: '电话咨询+图文咨询',
-					describe2: '不限次数',
-					time: '一年',
-					price: '199.99'
-				}, {
-					title: '套餐三',
-					describe1: '疫苗接种+门诊预约+儿保预约',
-					describe2: '成都所有社区医院,十名医生专业团队',
-					time: '一年',
-					price: '699.99'
-				},{
-					title: '套餐四',
-					describe1: '代码套餐',
-					describe2: '网吧',
-					time: '30min',
-					price: '9999999'
-				},
-				{
-					title: '套餐五',
-					describe1: 'bug套餐',
-					describe2: '网吧',
-					time: '60min',
-					price: '8888888'
-				},
-				{
-					title: '套餐六',
-					describe1: '病毒套餐',
-					describe2: '自己电脑',
-					time: '永久',
-					price: '6666666'
-				}]
+				pageindex: 1,
+				serviceList: []
 			}
 		},
-		methods:{
-			details(e){
+		methods: {
+			details(e) {
 				uni.navigateTo({
-					url:'/pages/service_packs/packs_details'
+					url: '/pages/service_packs/packs_details?id=' + e.currentTarget.dataset.id
+				})
+			},
+			getservice: async function() {
+				let res = await this.$request.post("/api/v1/ServicePack/servicePackList", {
+					page: this.pageindex
 				})
+				console.log(res)
+				if (res.status == 0) {
+					if (this.pageindex > res.data.last_page) {
+						uni.showToast({
+							title: "没有更多了",
+							icon: "none"
+						})
+					} else {
+						this.serviceList = this.serviceList.concat(res.data.data)
+						this.pageindex++
+					}
+				}
 			}
+
 		}
 	}
 </script>
@@ -120,6 +104,7 @@
 		width: 550rpx;
 		padding: 0 20rpx;
 		font-size: 26rpx;
+
 		.text {
 			padding: 10rpx 0rpx;
 			width: 100%;

+ 54 - 101
pages/service_packs/packs_details.vue

xqd xqd xqd xqd xqd xqd
@@ -9,23 +9,22 @@
 				</view>
 				<!-- 放描述 -->
 				<view class="describe">
-					<view style="font-size: 40rpx;font-weight: bold;">{{tcID}}</view>
+					<view style="font-size: 40rpx;font-weight: bold;">{{packs.name}}</view>
 					<view style="font-size: 28rpx;font-weight: bold;padding-top: 60rpx;">有效期</view>
-					<view style="font-size: 26rpx;color: #999999;padding-top: 30rpx;">自购买服务起{{tcTime}}</view>
+					<view style="font-size: 26rpx;color: #999999;padding-top: 30rpx;">自购买服务起{{packs.effective_days}}天</view>
 					<view style="font-size: 28rpx;font-weight: bold;padding-top: 50rpx;">服务包内容介绍</view>
 					<view style="font-size: 26rpx;color: #999999;">
-						<view style="padding: 27rpx 0 12rpx 0;">{{tcContent.content}}</view>
-						<view style="padding: 12rpx 0;">{{tcContent.scope}}</view>
-						<view style="padding: 12rpx 0;">{{tcContent.giving}}</view>
+						<view style="padding: 27rpx 0 12rpx 0;">{{packs.intro}}</view>
+						<view style="padding: 12rpx 0;">{{packs.desc}}</view>
 					</view>
-					<view style="font-size: 28rpx;font-weight: bold;padding-top: 48rpx;">家属团队</view>
-					<view class="list" v-for="item,index in tcTeam" :key='index'>
+					<view style="font-size: 28rpx;font-weight: bold;padding-top: 48rpx;">{{packs.team.name}}</view>
+					<view class="list" v-for="(item,index) in packs.team.docter" :key='index'>
 						<!-- 头像 -->
 						<view class="portrait">
 							<view style="padding-top: 20rpx;">
-								<image class="img" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/头像.png"></image>
-								<view class="bun_true" @click="follow" :data-index="index" v-if="!item.follow">关注</view>
-								<view class="bun_false" @click="follow" :data-index="index" v-else>已关注</view>
+								<image class="img" :src="item.avatar"></image>
+								<view class="bun_true" @click="submitCollect" :data-index="index" :data-id="item.id" v-if="item.is_collect==0">关注</view>
+								<view class="bun_false" @click="submitCollect" :data-index="index" :data-id="item.id" v-else>已关注</view>
 							</view>
 						</view>
 						<!-- 文字 -->
@@ -33,20 +32,19 @@
 							<!-- 名字+标签 -->
 							<view class="name">
 								<view style="margin-right: 15rpx;">{{item.name}}</view>
-								<view class="label">{{item.label1}}</view>
-								<view class="label">{{item.label2}}</view>
+								<view class="label" v-for="(itm,idx) in item.label">{{itm}}</view>
 							</view>
 							<!-- 科室 -->
 							<view class="department">
 								<text>科室:</text>
-								<text style="color: #333333;">{{item.department1}}</text>
-								<text style="color: #333333;">{{item.department2}}</text>
+								<text style="color: #333333;">{{}}</text>
+								<text style="color: #333333;">{{}}</text>
 							</view>
 							<!-- 选项 -->
 							<view class="option">
-								<view>图文</view>
-								<view>电话</view>
-								<view>门诊</view>
+								<view v-if="item.is_chat">图文</view>
+								<view v-if="item.is_phone">电话</view>
+								<view v-if="item.is_appoint">门诊</view>
 							</view>
 						</view>
 					</view>
@@ -82,6 +80,12 @@
 <script>
 	export default {
 		name: 'productdetailspage',
+		onLoad(op) {
+			this.serviceid = op.id
+		},
+		mounted() {
+			this.getservice()
+		},
 		data() {
 			return {
 				//关注
@@ -92,93 +96,41 @@
 					istrue: false,
 					name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
 				},
-				tcID: '套餐一', //ID
-				tcTime: '一年', //套餐有效期
-				tcContent: { //套餐内容
-					content: '套餐一包含包含疫苗接种、门诊预约、儿保预约三项服务', //内容
-					scope: '使用范围:家医团队可用,有效期内无限次、300元额度以内门诊预约与儿保预约无限制', //范围
-					giving: '赠送XXXX保险:保险介绍' //赠送
-				},
-				tcTeam: [{
-					id: '1',
-					name: '熊大',
-					label1: '熊',
-					label2: '主角',
-					department1: '外科',
-					department2: '主任医师',
-					follow: false
-				}, {
-					id: '2',
-					name: '熊二',
-					label1: '熊',
-					label2: '主角',
-					department1: '外科',
-					department2: '主任医师',
-					follow: false
-				}, {
-					id: '3',
-					name: '光头强',
-					label1: '人',
-					label2: '主角',
-					department1: '外科',
-					department2: '主任医师',
-					follow: false
-				}, {
-					id: '4',
-					name: '李老板',
-					label1: '人',
-					label2: '配角',
-					department1: '外科',
-					department2: '主任医师',
-					follow: false
-				}, {
-					id: '5',
-					name: '吉吉国王',
-					label1: '猴子',
-					label2: '配角',
-					department1: '外科',
-					department2: '主任医师',
-					follow: false
-				}, {
-					id: '6',
-					name: '毛毛',
-					label1: '猴子',
-					label2: '配角',
-					department1: '外科',
-					department2: '主任医师',
-					follow: false
-				}, {
-					id: '7',
-					name: '蹦蹦',
-					label1: '猴子',
-					label2: '配角',
-					department1: '外科',
-					department2: '主任医师',
-					follow: false
-				}],
-				packs: {
-					id: '', //ID
-					name: '', //名称
-					intro: '', //简介
-					desc: '', //详细介绍
-					price: '', //价格(单位分)
-					team_id: '', //医生团队ID
-					phone_minutes: '', //电话分钟数
-					chat_num: '', //图文咨询次数
-					appoint_num: '', //门诊预约次数
-					vaccine_limit_amount: '', //疫苗总金额限制
-					nurses_limit_amount: '', //儿保总金额限制
-					effective_days: '', //有效天数
-					created_at: '', //创建时间
-					updated_at: '' //更新时间
-				}
+				packs: {},
+				serviceid: ""
 			}
 		},
 		methods: {
 			//关注
-			follow(e) {
-				console.log(this.tcTeam[e.currentTarget.dataset.index])
-
+			submitCollect: async function(e) {
+				console.log(e)
+				let res = await this.$request.post("/api/v1/collection/submitCollect", {
+					type: 1,
+					relation_id: e.currentTarget.dataset.id
+				})
+				if (res.status == 0) {
+					if (res.data.is_collect == 0) {
+						uni.showToast({
+							title: "取消成功",
+							icon: "none"
+						})
+						this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
+					} else {
+						uni.showToast({
+							title: "关注成功",
+							icon: "none"
+						})
+						this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
+					}
+				}
+			},
+			getservice: async function() {
+				let res = await this.$request.post("/api/v1/ServicePack/servicePackDetail", {
+					service_pack_id: this.serviceid
+				})
+				if (res.status == 0) {
+					this.packs = res.data
+				}
 			},
 			isqueren() {
 				this.num++
@@ -192,7 +144,7 @@
 				}
 			},
 			next(e) {
-				if (this.imgitem.istrue == false) {
+				if (!this.imgitem.istrue) {
 					uni.showToast({
 						icon: 'none',
 						position: 'bottom',
@@ -344,6 +296,7 @@
 					margin-right: 15rpx;
 				}
 			}
+
 			// 选项
 			.option {
 				display: flex;

+ 4 - 1
store/index.js

xqd xqd
@@ -15,6 +15,9 @@ const store = new Vuex.Store({
 		getJwt: state => {
 			return state.jwt;
 		},
+		getusers:state=>{
+			return state.user
+		},
 		// ÑéÖ¤ÊÇ·ñÓÐtoken
 		verifyJwt: state => {
 			if (state.jwt) {
@@ -60,7 +63,7 @@ const store = new Vuex.Store({
 				if (refresh != true && state.user && Object.keys(state.user).length > 0) {
 					resolve(state.user)
 				} else {
-					request.get("/api/user/userInfo", {}, false).then(data => {
+					request.get("/api/v1/user/userInfo", {}, false).then(data => {
 						if (data.code == 200) {
 							commit('setUser', data.data)
 							resolve(data.data)