Explorar o código

Ltb2020年11月10日13:48:44

老狐\25396 %!s(int64=5) %!d(string=hai) anos
pai
achega
d8eded29da

+ 63 - 0
components/GoEasyAudioPlayer/GoEasyAudioPlayer.vue

@@ -0,0 +1,63 @@
+<template>
+    <div class="goeasy-audio-player" @click="playAudio">
+        <div class="audio-facade" :style="{width:Math.ceil(duration)*7 + 50 + 'px'}">
+            <div class="audio-facade-bg" :class="{'play-icon':play}"> </div>
+            <div>{{Math.ceil(duration) || 1}}</div>
+        </div>
+    </div>
+</template>
+
+<script>
+    const innerAudioContext = uni.createInnerAudioContext();
+    export default {
+        name: "GoEasyAudioPlayer",
+        props : ['src', 'duration'],
+        data () {
+            return {
+                play : false
+            }
+        },
+        methods : {
+            playAudio () {
+                this.play = true;
+                innerAudioContext.src = this.src;
+                innerAudioContext.play();
+                setTimeout(() => {
+                    this.play = false;
+                }, this.duration*1000)
+            }
+        }
+    }
+</script>
+
+<style scoped>
+    .goeasy-audio-player{
+        margin-top: 12rpx;
+        -webkit-tap-highlight-color:rgba(0,0,0,0);
+    }
+    .audio-facade{
+        min-width: 20rpx;
+        padding: 6rpx 10rpx;
+        height: 72rpx;
+        background: #618DFF;
+        font-size: 24rpx;
+        border-radius: 14rpx;
+        color: #ffffff;
+        display: flex;
+		align-items: center;
+    }
+    .audio-facade-bg{
+        background: url("./images/voice.png") no-repeat center;
+        background-size: 30rpx;
+        width: 40rpx;
+		height: 100%;
+    }
+    .audio-facade-bg.play-icon{
+        background: url("./images/play.gif") no-repeat center;
+        background-size: 30rpx;
+        -moz-transform:rotate(180deg);
+        -webkit-transform:rotate(180deg);
+        -o-transform:rotate(180deg);
+        transform:rotate(180deg);
+    }
+</style>

BIN=BIN
components/GoEasyAudioPlayer/images/play.gif


BIN=BIN
components/GoEasyAudioPlayer/images/voice.png


+ 1 - 1
pages.json

@@ -196,7 +196,7 @@
 		"current": 0, //当前激活的模式(list 的索引项)
 		"current": 0, //当前激活的模式(list 的索引项)
 		"list": [{
 		"list": [{
 			"name": "test", //模式名称
 			"name": "test", //模式名称
-			"path": "pages/login/login", //启动页面,必选
+			"path": "pages/Scheduling", //启动页面,必选
 			"query": "" //启动参数,在页面的onLoad函数里面得到
 			"query": "" //启动参数,在页面的onLoad函数里面得到
 		}]
 		}]
 	}
 	}

+ 3 - 1
pages/Scheduling.vue

@@ -307,7 +307,9 @@
 
 
 			//保存
 			//保存
 			bc(e) {
 			bc(e) {
-				console.log(hospitalWeek)
+				uni.switchTab({
+					url:'/pages/index/index'
+				})
 			},
 			},
 			//获取时间
 			//获取时间
 			getTime(){
 			getTime(){

+ 60 - 26
pages/index/index.vue

@@ -237,19 +237,19 @@
 			}
 			}
 		},
 		},
 		onShow() {
 		onShow() {
-			if (!this.hasLogin) {
-				uni.showModal({
-					title: "提示",
-					content: "尚未登录,请前往登录",
-					confirmText: "去登录",
-					showCancel: false,
-					success() {
-						uni.navigateTo({
-							url: "../login/login"
-						})
-					}
-				})
-			};
+			// if (!this.hasLogin) {
+			// 	uni.showModal({
+			// 		title: "提示",
+			// 		content: "尚未登录,请前往登录",
+			// 		confirmText: "去登录",
+			// 		showCancel: false,
+			// 		success() {
+			// 			uni.navigateTo({
+			// 				url: "../login/login"
+			// 			})
+			// 		}
+			// 	})
+			// };
 			// 获取当前登陆人信息
 			// 获取当前登陆人信息
 			this.getDocterInfo();
 			this.getDocterInfo();
 			// 获取当前登录人接收消息
 			// 获取当前登录人接收消息
@@ -279,11 +279,11 @@
 					pageSize: 10
 					pageSize: 10
 				});
 				});
 				if (res.data === null) {
 				if (res.data === null) {
-					uni.showToast({
-						title: '到底了',
-						duration: 5000,
-						icon: 'none'
-					})
+					// uni.showToast({
+					// 	title: '到底了',
+					// 	duration: 5000,
+					// 	icon: 'none'
+					// })
 					return false;
 					return false;
 				}
 				}
 				this.docterMessageList = this.docterMessageList.concat(res.data)
 				this.docterMessageList = this.docterMessageList.concat(res.data)
@@ -337,68 +337,102 @@
 					});
 					});
 				}.bind(this), 1000);
 				}.bind(this), 1000);
 			},
 			},
-
+			
+			//如果点击模块   需要判断认证
+			judgerenzheng: function(){
+				if (!this.hasLogin) {
+					uni.showModal({
+						title: "提示",
+						content: "尚未登录,请前往登录",
+						confirmText: "去登录",
+						showCancel: false,
+						success() {
+							uni.reLaunch({
+								url: "../login/login"
+							})
+						}
+					})
+					return false;
+				};
+			},
 
 
 			// 跳转服务设置
 			// 跳转服务设置
 			setservice(e) {
 			setservice(e) {
-				uni.navigateTo({
+				if(this.judgerenzheng()){
+					uni.navigateTo({
 					url: '/pages/service/setservice'
 					url: '/pages/service/setservice'
 				})
 				})
+				}
+				
 			},
 			},
 			//跳转患者管理
 			//跳转患者管理
 			patient(e) {
 			patient(e) {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/patient/patient'
 					url: '/pages/patient/patient'
 				})
 				})
+				}
 			},
 			},
 			editdocter() {
 			editdocter() {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '../index/index'
 					url: '../index/index'
-				})
+				})}
 			},
 			},
 			touchend() {
 			touchend() {
+				if(this.judgerenzheng()){
 				console.log('结束')
 				console.log('结束')
 				clearInterval(this.Loop);
 				clearInterval(this.Loop);
+				}
 			},
 			},
 
 
 			//跳转患者咨询
 			//跳转患者咨询
 			zixun() {
 			zixun() {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/zixun/zixun'
 					url: '/pages/zixun/zixun'
-				})
+				})}
 			},
 			},
 			//排班
 			//排班
 			pb() {
 			pb() {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/Scheduling'
 					url: '/pages/Scheduling'
-				})
+				})}
 			},
 			},
 			//意见
 			//意见
 			yijian() {
 			yijian() {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/opinion/opinion'
 					url: '/pages/opinion/opinion'
-				})
+				})}
 			},
 			},
 			//门诊
 			//门诊
 			mz() {
 			mz() {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/menzhen/menzhen'
 					url: '/pages/menzhen/menzhen'
-				})
+				})}
 			},
 			},
 			//个人信息 右上角的编辑按钮
 			//个人信息 右上角的编辑按钮
 			grxx() {
 			grxx() {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/information/information'
 					url: '/pages/information/information'
-				})
+				})}
 			},
 			},
 			//点击未认证
 			//点击未认证
 			gorz() {
 			gorz() {
+				if(this.judgerenzheng()){
 				this.rzModal = true
 				this.rzModal = true
+				}
 			},
 			},
 			qdrz() {
 			qdrz() {
+				if(this.judgerenzheng()){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/login/doctorRenzheng'
 					url: '/pages/login/doctorRenzheng'
 				})
 				})
+				}
 			}
 			}
 		},
 		},
 		//页面到底监听
 		//页面到底监听

+ 1 - 1
pages/information/information.vue

@@ -49,7 +49,7 @@
 					//头像数组
 					//头像数组
 					imgList:[],
 					imgList:[],
 					//头像
 					//头像
-					src:'https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/头像.png',
+					
 					// 标签输入
 					// 标签输入
 					value: '',
 					value: '',
 					//标签样式
 					//标签样式

+ 4 - 5
pages/login/doctorRenzheng.vue

@@ -40,7 +40,7 @@
 					<view>性别</view>
 					<view>性别</view>
 				</view>
 				</view>
 				<view style="width: 60%;margin-right: 40rpx;">
 				<view style="width: 60%;margin-right: 40rpx;">
-					<u-input v-model="form.sex" type="text" :border="false" placeholder="请选择性别" input-align="right" />
+					<u-input v-model="form.sex" type="text" :border="false" placeholder="请选择性别" input-align="right" maxlength="18"/>
 				</view>
 				</view>
 				<view style="5%" class="flex justify-center align-center">
 				<view style="5%" class="flex justify-center align-center">
 					<u-icon name="arrow-down" color="#dddfe1" @click="sexshow = true"></u-icon>
 					<u-icon name="arrow-down" color="#dddfe1" @click="sexshow = true"></u-icon>
@@ -664,8 +664,7 @@
 			},
 			},
 			// 保存
 			// 保存
 			bc: async function() {
 			bc: async function() {
-				console.log(this.province);
-				return false;
+				// return false;
 				// 提交需要参数
 				// 提交需要参数
 				let froms = {
 				let froms = {
 					doctor_name: '', //姓名
 					doctor_name: '', //姓名
@@ -688,7 +687,7 @@
 				// 注意要 {'doctor_name':'ddd',doctor_sex:1....}分开传值因为我方便拦截垃圾数据
 				// 注意要 {'doctor_name':'ddd',doctor_sex:1....}分开传值因为我方便拦截垃圾数据
 				let res = await this.$request.post('doctor/addthen', froms);
 				let res = await this.$request.post('doctor/addthen', froms);
 				uni.switchTab({
 				uni.switchTab({
-					url: '../index/index'
+					url:'/pages/index/index'
 				})
 				})
 			},
 			},
 			ChooseImage() {
 			ChooseImage() {
@@ -735,7 +734,7 @@
 		justify-content: center;
 		justify-content: center;
 		background-color: #0B73B9;
 		background-color: #0B73B9;
 		color: #FFFFFF;
 		color: #FFFFFF;
-		z-index: 1;
+		z-index: 99;
 		font-size: 32rpx;
 		font-size: 32rpx;
 	}
 	}
 
 

+ 46 - 21
pages/login/login.vue

@@ -44,23 +44,37 @@
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 按钮 -->
 		<!-- 按钮 -->
-		<view  style="height: 30vh;padding: 0 80rpx;">
+		<view style="height: 30vh;padding: 0 80rpx;">
 			<!-- 登录 -->
 			<!-- 登录 -->
-				<u-button @click="startReg()" type="primary" shape="circle" :loading="isRotate">登录</u-button>
-				<view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
-					<u-button @click="getinfo()" shape="circle" style="width: 50%;font-size: 30rpx;color:#84BB43;" :custom-style="customStyle" hair-line="false">微信授权一键登录</u-button>
-					<u-button @click="toindex()"  shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
+			<u-button @click="startReg()" type="primary" shape="circle" :loading="isRotate">登录</u-button>
+			
+			<view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
+				<button style="margin-top: 20rpx;" :class="['buttonBorder',!istrue?'dlbutton':'dlbutton_loading']" open-type="getUserInfo"
+						 @getuserinfo="getinfo">
+							<view :class="istrue?'rotate_loop':''">
+								<text v-if="istrue" class="cuIcon cuIcon-loading1 "></text>
+								<view v-if="!istrue">
+									<slot name="text">微信授权一键登录</slot>
+								</view>
+							</view>
+						</button>
+				<u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
+			</view>
+			<!-- <view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
+				<u-button open-type="getUserInfo" @getuserInfo="getinfo" shape="circle" style="width: 50%;font-size: 30rpx;color:#84BB43;" :custom-style="customStyle"
+				 hair-line="false">微信授权一键登录</u-button>
+				<u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
+			</view> -->
+			<view class="flex align-center justify-between">
+				<view style="width: 50%;text-align: center;">
+					<text style="text-decoration:underline; color: #666666;" @click="goreg">注册账号</text>
 				</view>
 				</view>
-				<view  class="flex align-center justify-between">
-					<view style="width: 50%;text-align: center;">
-						<text style="text-decoration:underline; color: #666666;" @click="goreg">注册账号</text>
-					</view>
-					<view style="width: 50%;text-align: center;">
-						<text style="text-decoration:underline ; color: #666666;"  @click="ispwd">{{ispwdlogin?'验证码':'账号密码'}}登录</text>
-					</view>
-
+				<view style="width: 50%;text-align: center;">
+					<text style="text-decoration:underline ; color: #666666;" @click="ispwd">{{ispwdlogin?'验证码':'账号密码'}}登录</text>
 				</view>
 				</view>
 
 
+			</view>
+
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -90,14 +104,16 @@
 		data() {
 		data() {
 			return {
 			return {
 				//一键登录按钮样式
 				//一键登录按钮样式
-				customStyle: {color: '#84BB43',boxShadow: '0px 0px 16px 0px rgba(0, 0, 0, 0.08)',border:'none'},
-				//短信还是密码
-				loginMethod: 0, //0短信 1密码
+				customStyle: {
+					color: '#84BB43',
+					boxShadow: '0px 0px 16px 0px rgba(0, 0, 0, 0.08)',
+					border: 'none'
+				},
 				//logo图片 base64
 				//logo图片 base64
 				phoneData: '', // 用户/电话
 				phoneData: '', // 用户/电话
 				verCode: "", //验证码
 				verCode: "", //验证码
 				password: "", //密码
 				password: "", //密码
-				ispwdlogin: false,//是否使用密码登录
+				ispwdlogin: false, //是否使用密码登录
 				isRotate: false, //是否登录按钮加载旋转
 				isRotate: false, //是否登录按钮加载旋转
 				istrue: false,
 				istrue: false,
 				num: 1,
 				num: 1,
@@ -137,7 +153,6 @@
 			//验证码点击事件
 			//验证码点击事件
 			getVerCode: async function() {
 			getVerCode: async function() {
 				//获取验证码
 				//获取验证码
-				
 				if (_this.phoneData.length != 11) {
 				if (_this.phoneData.length != 11) {
 					uni.showToast({
 					uni.showToast({
 						icon: 'none',
 						icon: 'none',
@@ -146,8 +161,10 @@
 					});
 					});
 					return false;
 					return false;
 				}
 				}
-				let res = await this.$request.post("common/putverfiy",{'phone':_this.phoneData});
-				console.log(res)
+				console.log(_this.phoneData)
+				let res = await this.$request.post("common/putverfiy", {
+					'phone': _this.phoneData
+				});
 				if (res.status == 0) {
 				if (res.status == 0) {
 					uni.setStorageSync('verfiyCode', res.data);
 					uni.setStorageSync('verfiyCode', res.data);
 					uni.showToast({
 					uni.showToast({
@@ -165,13 +182,15 @@
 						});
 						});
 					}, 3000)
 					}, 3000)
 				} else {
 				} else {
-					console.log('请求失败',this.phoneData)
 					uni.showToast({
 					uni.showToast({
 						icon: 'none',
 						icon: 'none',
 						position: 'bottom',
 						position: 'bottom',
 						title: '请求失败'
 						title: '请求失败'
 					});
 					});
 				}
 				}
+
+
+
 			},
 			},
 
 
 			//点击登录
 			//点击登录
@@ -320,8 +339,14 @@
 			ispwd() {
 			ispwd() {
 				this.ispwdlogin = !this.ispwdlogin
 				this.ispwdlogin = !this.ispwdlogin
 			},
 			},
+			// 一键登录
 			getinfo: async function(e) {
 			getinfo: async function(e) {
 				let that = this;
 				let that = this;
+				uni.login({
+					success:(res) =>{
+						console.log(res.code)
+					}
+				});
 				let meToken = user.loginByWeixin(e.detail.userInfo).then(res => {
 				let meToken = user.loginByWeixin(e.detail.userInfo).then(res => {
 					if (res.status == 0) {
 					if (res.status == 0) {
 						uni.showToast({
 						uni.showToast({

BIN=BIN
static/login/Verification.png


BIN=BIN
static/login/account.png


BIN=BIN
static/login/logo.png


BIN=BIN
static/login/password.png


BIN=BIN
static/login/phone.png