<template>
	<view class="doctor-import-com">
		<view class="float-button" @click="goBackToDoctor">
			<img :src="cssUrl+'import_icon.svg'">
			<text class="button-text PfScMedium">回医生端</text>
		</view>
	</view>
</template>

<script>
export default {
	name: "doctorImport",
	props: {
		showuinfo: {
			type: Boolean,
			default: () => true
		},
		dataitem: {
			type: Object,
			default: () => {}
		},
		index: {
			type: Number,
			default: () => -1
		},
	},
	data() {
		return {
			cssUrl: this.cssUrl,
		}
	},
	methods: {
    async goBackToDoctor() {
      // #ifdef MP-WEIXIN
			await this.$http.req('api/user/get_jump_doctor_info', {}, 'POST').then(data=>{
				if(data == -1) return

				wx.navigateToMiniProgram({
					appId: data.appid,
					path: data.path+'?did='+data.param.did,
					envVersion: 'release', // 打开的小程序版本，有 develop（开发版），trial（体验版），release（正式版）
					success(res) {
						console.log('跳转成功')
					},
					fail(err) {
						// 打开失败的回调
						console.error('跳转失败', err)
						uni.showToast({
							title: '跳转失败',
							icon: 'none'
						})
					}
				})
			});
      // #endif
    },
	}
};

</script>

<style lang="scss" scoped>
.doctor-import-com {
	position: fixed;
	right: 0;
	bottom: 16.31vh;
	z-index: 899;
}

.float-button {
	width: auto;
	height: 92rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 16rpx 24rpx;
	border-radius: 200rpx 0px 0px 200rpx;
	background: #FFFFFF;
	box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0, 0, 0, 0.16);
	box-sizing: border-box;
	img{
		width: 60rpx;
		height: 60rpx;
		z-index: 0;
	}

	.button-text {
		color: #333333;
		font-size: 24rpx;
	}

}
</style>
