111
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
// case/pages/agreement/agreement.js
|
||||
import {getDeal,getRubric,getSign} from "../../../api/api"
|
||||
import { throttle } from "../../../utils/util"
|
||||
const dayjs = require("../../../utils/dayjs");
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
node:'',
|
||||
type:'',
|
||||
year:'',
|
||||
month:'',
|
||||
day:'',
|
||||
signImg:'',
|
||||
navName:'项目协议'
|
||||
},
|
||||
handleGetDeal(name,mobile,bankName,bankCardNo,idCardNo){
|
||||
getDeal().then(res=>{
|
||||
let deal=res.replace(/\$\{name\}/g,name).replace(/\$\{mobile\}/g,mobile).replace(/\$\{bankName\}/g,bankName).replace(/\$\{bankCardNo\}/g,bankCardNo).replace(/\$\{idCardNo\}/g,idCardNo);
|
||||
this.setData({
|
||||
node:deal
|
||||
})
|
||||
})
|
||||
},
|
||||
handleFetRubric(){
|
||||
getRubric().then(res=>{
|
||||
this.setData({
|
||||
node:res
|
||||
})
|
||||
})
|
||||
},
|
||||
goSign:throttle(function(){
|
||||
let tokenStr=''
|
||||
const { envVersion } = wx.getAccountInfoSync().miniProgram;
|
||||
if(envVersion=="develop" || envVersion=="trial"){
|
||||
tokenStr="DEV_CASE_TOKEN"
|
||||
}else{
|
||||
tokenStr="PROD_CASE_TOKEN"
|
||||
}
|
||||
let token = wx.getStorageSync(tokenStr);
|
||||
if(token){
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/bankCard/bankCard',
|
||||
complete:function(err){
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/mobileLogin/mobileLogin?redirectUrl='+encodeURIComponent('case/pages/agreement/agreement'),
|
||||
complete:function(err){
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}),
|
||||
handleGetSign(){
|
||||
getSign().then(res=>{
|
||||
if(res && res.signImg){
|
||||
let {signImg,createTime,bankCardNo,bankName,idCardNo,mobile,name}=res;
|
||||
this.handleGetDeal(name,mobile,bankName,bankCardNo,idCardNo);
|
||||
this.setData({
|
||||
signImg:signImg,
|
||||
year:dayjs(createTime).format("YYYY"),
|
||||
month:dayjs(createTime).format("M"),
|
||||
day:dayjs(createTime).format("D"),
|
||||
})
|
||||
}else{
|
||||
this.handleGetDeal('','','','','');
|
||||
}
|
||||
}).catch(error=>{
|
||||
|
||||
if(error.code==30007){
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/mobileLogin/mobileLogin?redirectUrl='+encodeURIComponent('case/pages/agreement/agreement'),
|
||||
complete:function(err){
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if(options.type=="description"){
|
||||
this.handleFetRubric();
|
||||
this.setData({
|
||||
type:'description',
|
||||
navName:'操作说明'
|
||||
})
|
||||
}else{
|
||||
|
||||
this.handleGetSign();
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
// onShareAppMessage() {
|
||||
|
||||
// }
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navBar":"../../../components/navBar/navBar"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<!--case/pages/agreement/agreement.wxml-->
|
||||
<navBar navName="{{navName}}"></navBar>
|
||||
<view class="page">
|
||||
|
||||
<view class="con {{(!type && !signImg)?'active':''}}">
|
||||
<rich-text nodes="{{node}}"></rich-text>
|
||||
</view>
|
||||
<view class="imgbox" wx:if="{{signImg}}">
|
||||
<view class="jiafang">
|
||||
<view>甲方:北京欣欣相照健康科技有限公司</view>
|
||||
<view class="signdate">日期:<text class="signtext">{{year}}</text>年<text class="signtext">{{month}}</text>月<text class="signtext">{{day}}</text>日</view>
|
||||
<image src="../../../static/gdxz.png" mode="" class="company" />
|
||||
</view>
|
||||
<view class="jiafang" style="margin-top: 40rpx;">
|
||||
<view>乙方:北京杏苑爱医科技发展有限公司</view>
|
||||
<view class="signdate">日期:<text class="signtext">{{year}}</text>年<text class="signtext">{{month}}</text>月<text class="signtext">{{day}}</text>日</view>
|
||||
<image src="../../../static/xinlin.png" mode="" class="company company2" />
|
||||
</view>
|
||||
<view class="yifang" style="margin-top: 40rpx;">
|
||||
<view>丙方:</view>
|
||||
<view class="signdate">日期:<text class="signtext">{{year}}</text>年<text class="signtext">{{month}}</text>月<text class="signtext">{{day}}</text>日</view>
|
||||
<image src="{{signImg}}" mode="" class="signimg" />
|
||||
</view>
|
||||
<!-- <image src="../../../static/gdxz.png" mode="" class="company" />
|
||||
|
||||
<image src="{{signImg}}" mode="" class="signimg" /> -->
|
||||
|
||||
</view>
|
||||
<!-- wx:if="{{!type && !signImg}}" -->
|
||||
<view class="btnbox" wx:if="{{!type && !signImg}}">
|
||||
<view class="btn" bind:tap="goSign">同意签署</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,92 @@
|
||||
/* case/pages/agreement/agreement.wxss */
|
||||
.page{
|
||||
background: #F7F9F9;
|
||||
flex:1;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
margin-top: 172rpx;
|
||||
}
|
||||
.con{
|
||||
flex:1;
|
||||
padding:10rpx 32rpx 0;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.con.active{
|
||||
margin-bottom: 150rpx;
|
||||
}
|
||||
.btnbox{
|
||||
z-index:999;
|
||||
padding:0 32rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
box-sizing: border-box;
|
||||
bottom:0;
|
||||
height: 130rpx;
|
||||
width:100%;
|
||||
}
|
||||
.btnbox .btn{
|
||||
margin-top: 15rpx;
|
||||
width:100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.imgbox{
|
||||
margin:30rpx 32rpx 60rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.company{
|
||||
z-index:99;
|
||||
top:-55rpx;
|
||||
position: absolute;
|
||||
width:220rpx;
|
||||
right:206rpx;
|
||||
height:220rpx;
|
||||
}
|
||||
.signimg{
|
||||
top:-40rpx;
|
||||
left:80rpx;
|
||||
position: absolute;
|
||||
width:160rpx;
|
||||
height:120rpx;
|
||||
}
|
||||
.signbox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.jiafang{
|
||||
position: relative;
|
||||
flex:1;
|
||||
font-size:28rpx;
|
||||
margin-bottom:50rpx;
|
||||
}
|
||||
.yifang{
|
||||
font-size:small;
|
||||
flex:1;
|
||||
font-size:28rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
.signdate{
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.company2{
|
||||
top:-90rpx;
|
||||
right:280rpx;
|
||||
width:280rpx;
|
||||
height:300rpx;
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
// case/pages/improveInfo/improveInfo.js
|
||||
// case/pages/register/register.js
|
||||
import {throttle} from "../../../utils/util"
|
||||
import {hostConfig} from "../../../utils/config"
|
||||
import {getArea,addBank} from "../../../api/api"
|
||||
const host=hostConfig().host;
|
||||
const app=getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
showSuccess:false,
|
||||
img_host:app.hostConfig().imghost,
|
||||
showArea:false,
|
||||
cityName:'',
|
||||
areaColumns:[
|
||||
{
|
||||
values: [1,2],
|
||||
className: 'column1',
|
||||
},
|
||||
{
|
||||
values: [3,4],
|
||||
className: 'column2',
|
||||
defaultIndex: 0
|
||||
},
|
||||
{
|
||||
values: [3,4],
|
||||
className: 'column3',
|
||||
defaultIndex: 0
|
||||
},
|
||||
],
|
||||
showArea:false,
|
||||
bankCardNo:'',
|
||||
bankName:'',
|
||||
cityId:'',
|
||||
countyId:'',
|
||||
provId:'',
|
||||
name:'',
|
||||
idCardNo:'',
|
||||
signImg:'',
|
||||
},
|
||||
opeArea(){
|
||||
this.setData({
|
||||
showArea:true
|
||||
})
|
||||
},
|
||||
openOffice(){
|
||||
this.setData({
|
||||
showOffice:true,
|
||||
})
|
||||
},
|
||||
openPosition(){
|
||||
this.setData({
|
||||
showPosition:true,
|
||||
})
|
||||
},
|
||||
onChange(e){
|
||||
const {value} = e.detail;
|
||||
|
||||
const {id}=e.currentTarget.dataset;
|
||||
// console.log(value,id)
|
||||
this.setData({
|
||||
[id]: value
|
||||
});
|
||||
},
|
||||
onChangeArea(event){
|
||||
const { picker, value, index } = event.detail;
|
||||
const provinceId=value[0].id;
|
||||
const cityId=value[1].id;
|
||||
if(index==0){
|
||||
this.handleGetArea(provinceId,2);
|
||||
}else if(index==1){
|
||||
this.handleGetArea(cityId,3)
|
||||
}
|
||||
},
|
||||
confirmArea(event){
|
||||
const {value} = event.detail;
|
||||
console.log(value);
|
||||
let provId=value[0].id;
|
||||
let cityId=value[1].id;
|
||||
let countyId=value[2]?value[2].id:value[1].id;
|
||||
let cityName='';
|
||||
for (let i = 0; i <value.length; i++) {
|
||||
if(value[i]){
|
||||
cityName+=value[i].name
|
||||
};
|
||||
|
||||
};
|
||||
this.setData({
|
||||
provId:provId,
|
||||
cityId:cityId,
|
||||
countyId:countyId,
|
||||
cityName:cityName,
|
||||
showArea:false
|
||||
});
|
||||
|
||||
},
|
||||
cancelArea(){
|
||||
this.setData({
|
||||
showArea:false
|
||||
})
|
||||
},
|
||||
confirmHospital(event){
|
||||
let {value}=event.detail;
|
||||
this.setData({
|
||||
showHospital:false,
|
||||
hospital_uuid:value.uuid,
|
||||
hospital_name:value.name
|
||||
})
|
||||
},
|
||||
cancelHospital(){
|
||||
this.setData({
|
||||
showHospital:false
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
handleAddBank:throttle(function(){
|
||||
let {signImg,bankCardNo,bankName,cityId,countyId,idCardNo,name,provId}=this.data;
|
||||
if (!/^([\u4e00-\u9fa5\·]{2,10})$/.test(name)) {
|
||||
wx.showToast({
|
||||
title: `姓名要求在2-10个汉字`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(idCardNo)){
|
||||
wx.showToast({
|
||||
title: `请输入有效的身份证号`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!provId){
|
||||
wx.showToast({
|
||||
title: `请选择开户行所在城市`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!bankName){
|
||||
wx.showToast({
|
||||
title: `请输入开户行`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!this.luhnCheck(bankCardNo)){
|
||||
wx.showToast({
|
||||
title: `请输入有效银行卡号`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!signImg){
|
||||
wx.showToast({
|
||||
title: `请添加签名`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
addBank({
|
||||
signImg,
|
||||
bankCardNo,
|
||||
bankName,
|
||||
cityId,
|
||||
countyId,
|
||||
idCardNo,
|
||||
name,
|
||||
provId
|
||||
}).then(res=>{
|
||||
wx.showToast({
|
||||
title: '绑定成功',
|
||||
icon:'none',
|
||||
duration:2000,
|
||||
success:function(){
|
||||
let timer=setTimeout(()=>{
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
clearTimeout(timer)
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
})
|
||||
}),
|
||||
luhnCheck(cardNumber) {
|
||||
var sum = 0;
|
||||
var shouldDouble = false;
|
||||
var digit;
|
||||
|
||||
// 去除任何非数字字符
|
||||
cardNumber = cardNumber.replace(/\D/g, '');
|
||||
|
||||
// 从右向左遍历数字
|
||||
for (var i = cardNumber.length - 1; i >= 0; i--) {
|
||||
digit = parseInt(cardNumber.charAt(i), 10);
|
||||
|
||||
if (shouldDouble) {
|
||||
if ((digit *= 2) > 9) digit -= 9;
|
||||
}
|
||||
|
||||
sum += digit;
|
||||
shouldDouble = !shouldDouble;
|
||||
}
|
||||
|
||||
// 如果校验和能被10整除,则卡号有效
|
||||
return (sum % 10) === 0;
|
||||
},
|
||||
goSign:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/signcanvas/signcanvas'
|
||||
})
|
||||
}),
|
||||
handleGetArea(id,type){
|
||||
getArea({
|
||||
parent:id
|
||||
}).then(res=>{
|
||||
if(type==1){
|
||||
let obj='areaColumns[0].values';
|
||||
this.setData({
|
||||
[obj]:res
|
||||
})
|
||||
this.handleGetArea(res[0].id,2)
|
||||
}else if(type==2){
|
||||
let obj='areaColumns[1].values';
|
||||
this.setData({
|
||||
[obj]:res
|
||||
})
|
||||
this.handleGetArea(res[0].id,3)
|
||||
}else{
|
||||
let obj='areaColumns[2].values';
|
||||
this.setData({
|
||||
[obj]:res
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}).catch(error=>{
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
handleGetOffice(){
|
||||
getOfficeList({}).then(res=>{
|
||||
this.setData({
|
||||
officeColumns:res
|
||||
})
|
||||
}).catch(error=>{
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
handleGetPosition(){
|
||||
getPosition().then(res=>{
|
||||
this.setData({
|
||||
positionColumns:res
|
||||
})
|
||||
this.handleNeedInfo();
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.handleGetArea('',1);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
// onShareAppMessage() {
|
||||
|
||||
// }
|
||||
})
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navBar":"../../../components/navBar/navBar",
|
||||
"dialog":"../../../components/dialog/dialog",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-picker": "@vant/weapp/picker/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-cell": "@vant/weapp/cell/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-image": "@vant/weapp/image/index",
|
||||
"van-uploader": "@vant/weapp/uploader/index",
|
||||
"van-cell-group": "@vant/weapp/cell-group/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<!--case/pages/bankCard/bankCard.wxml-->
|
||||
<navBar navName="绑定银行卡"></navBar>
|
||||
<view class="page">
|
||||
<view class="content">
|
||||
<view class="tip">请确定开户人姓名与真实姓名一致</view>
|
||||
<view >
|
||||
<van-cell-group class="group" >
|
||||
<van-field value="{{ name }}" label="姓名" placeholder="请输入您的真实姓名" input-align="right" placeholder-style="color:#999;font-size:15px" bind:change="onChange" data-id="name" extra-event-params/>
|
||||
<van-field value="{{ idCardNo }}" label="身份证号" placeholder="请输入您的身份证号" input-align="right" placeholder-style="color:#999;font-size:15px" bind:change="onChange" data-id="idCardNo" extra-event-params/>
|
||||
|
||||
|
||||
|
||||
|
||||
</van-cell-group>
|
||||
<view style="margin-top: 40rpx;">
|
||||
<van-cell-group class="group" >
|
||||
<van-field value="{{cityName}}" label="所在城市" placeholder="请选择开户行所在城市" right-icon="arrow" placeholder-style="color:#999;font-size:15px"
|
||||
input-align="right" bind:tap="opeArea" readonly/>
|
||||
<van-field value="{{ bankName }}"
|
||||
placeholder-style="color:#999;font-size:15px" bind:change="onChange" data-id="bankName" extra-event-params label="开户行" placeholder="请输入开户行" input-align="right" />
|
||||
<van-field value="{{ bankCardNo }}"
|
||||
placeholder-style="color:#999;font-size:15px" bind:change="onChange" data-id="bankCardNo" extra-event-params label="银行卡号" placeholder="请输入银行卡号" input-align="right" />
|
||||
|
||||
</van-cell-group>
|
||||
</view>
|
||||
<view style="margin-top: 40rpx;">
|
||||
<view class="signbox">
|
||||
<view class="signname"><text class="name">签名</text></view>
|
||||
<view class="uploadbox" bind:tap="goSign" wx:if="{{!signImg}}">
|
||||
<van-icon name="plus" size="40px" color="#999"/>
|
||||
<view class="name">添加签名</view>
|
||||
</view>
|
||||
<image class="uploadbox" src="{{signImg}}" mode="widthFix" wx:else />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="next">
|
||||
<van-button type="primary" block bind:tap="handleAddBank">提交</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<van-popup
|
||||
show="{{ showArea }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ areaColumns }}" value-key="name" bind:change="onChangeArea" title="请选择地区" show-toolbar bind:confirm="confirmArea" bind:cancel="cancelArea"/>
|
||||
</van-popup>
|
||||
@@ -0,0 +1,143 @@
|
||||
/* case/pages/bankCard/bankCard.wxss *//* case/pages/improveInfo/improveInfo.wxss */
|
||||
/* case/pages/register/register.wxss */
|
||||
page{
|
||||
overflow: hidden;
|
||||
}
|
||||
.page{
|
||||
height:calc(100vh - 172rpx);
|
||||
margin-top: 172rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #F4F4F4;
|
||||
}
|
||||
.content{
|
||||
flex:1;
|
||||
overflow: scroll;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.tip{
|
||||
height:80rpx;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
align-items: center;
|
||||
color:#fff;
|
||||
padding:0 32rpx;
|
||||
background: #3881F7;
|
||||
border-bottom:1px solid #ccc;
|
||||
}
|
||||
.next{
|
||||
margin: 40rpx 20rpx!important;
|
||||
}
|
||||
.prev{
|
||||
margin:-20rpx 20rpx 0!important ;
|
||||
}
|
||||
.van-field__label{
|
||||
white-space: nowrap;
|
||||
}
|
||||
.custom-class .van-cell:last-child{
|
||||
background-color: red;
|
||||
}
|
||||
.van-cell__title{
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
color: #646566;
|
||||
align-items: center;
|
||||
}
|
||||
.van-image{
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.van-cell{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.van-field__label,.van-cell__title{
|
||||
position: relative;
|
||||
}
|
||||
.signname .name{
|
||||
width: auto;
|
||||
position: relative;
|
||||
}
|
||||
.van-field__label::after,.cert .van-cell__title::after{
|
||||
content: "*";
|
||||
color:red;
|
||||
position: absolute;
|
||||
top:12rpx;
|
||||
right:-14rpx;
|
||||
}
|
||||
.signname .name::after{
|
||||
content: "*";
|
||||
color:red;
|
||||
position: absolute;
|
||||
top:4rpx;
|
||||
right:-14rpx;
|
||||
}
|
||||
.cert .van-cell__title::after{
|
||||
top:4rpx;
|
||||
}
|
||||
.myclass .van-field__label::after{
|
||||
content: "";
|
||||
}
|
||||
.upload{
|
||||
opacity:0;
|
||||
position: absolute;
|
||||
z-index:99;
|
||||
}
|
||||
.cert .van-cell{
|
||||
overflow: hidden;
|
||||
}
|
||||
.van-button{
|
||||
border-radius: 10rpx!important;
|
||||
}
|
||||
.imgCode{
|
||||
width:200rpx;
|
||||
height:75.6rpx;
|
||||
}
|
||||
.custom-class{
|
||||
min-height:43.5px !important;
|
||||
}
|
||||
.van-field__label{
|
||||
color:#333!important;
|
||||
padding:12rpx 0;
|
||||
font-size: 15px!important;
|
||||
}
|
||||
.van-cell__title{
|
||||
color:#333!important;
|
||||
font-size: 15px!important;
|
||||
}
|
||||
.buttonbox{
|
||||
position: absolute;
|
||||
z-index:99;
|
||||
display: flex;
|
||||
width:600rpx;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
justify-content: space-between;
|
||||
bottom:50rpx;
|
||||
}
|
||||
.van-button--primary{
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%)!important;
|
||||
border-color:#377FF7!important
|
||||
}
|
||||
.signbox{
|
||||
border: 0.5px solid #ebedf0;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
padding:10px 16px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.uploadbox{
|
||||
margin-top: 20rpx;
|
||||
width:300rpx;
|
||||
height:300rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
font-size: 28rpx;
|
||||
color:#666;
|
||||
border-radius: 10rpx;
|
||||
background-color: #f7f8fa;
|
||||
}
|
||||
.uploadbox .name{
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navBar":"../../../components/navBar/navBar",
|
||||
"van-tab": "@vant/weapp/tab/index",
|
||||
"van-tabs": "@vant/weapp/tabs/index",
|
||||
"van-picker": "@vant/weapp/picker/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-uploader": "@vant/weapp/uploader/index",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"dialog":"../../../components/dialog/dialog",
|
||||
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
|
||||
"van-radio": "@vant/weapp/radio/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-radio-group": "@vant/weapp/radio-group/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
||||
@@ -0,0 +1,454 @@
|
||||
<!--case/pages/createCase/createCase.wxml-->
|
||||
<!-- <navBar navName="创建病例"></navBar> -->
|
||||
<view class="ui-navigatorbar" style="background: #FFFFFF">
|
||||
<van-icon name="arrow-left" bindtap="goBack" class="ui-navigatorbar-back" />
|
||||
<view class="ui-title">{{navName}}</view>
|
||||
</view>
|
||||
|
||||
<view class="page">
|
||||
<van-tabs active="{{ active }}" wrap-class="tabwrap" use-before-change="{{ true }}" custom-class="tabbox" bind:before-change="onBeforeChange">
|
||||
<van-tab title="基本信息" class="vantab">
|
||||
<view class="basic {{!showSaveBtn?'active':''}}" >
|
||||
<view class="basiccon">
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
患者姓名(首字母大写)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<input type="text" value="{{case.name}}" bindinput="handleIpt" class="ipt" data-id="name" placeholder="请输入"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
患者ID号<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<input type="text" value="{{case.uid}}" bindinput="handleIpt" class="ipt" data-id="uid" placeholder="请输入" placeholder-class="placeholder" disabled="{{!showSaveBtn}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
性别<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<van-radio-group value="{{ case.sex }}" bind:change="onChange"
|
||||
disabled="{{!showSaveBtn}}"
|
||||
direction="horizontal">
|
||||
<van-radio name="{{1}}">男</van-radio>
|
||||
<van-radio name="{{2}}">女</van-radio>
|
||||
</van-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
年龄<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<input type="number" value="{{case.age}}" bindinput="handleIpt" class="ipt" data-id="age" placeholder="请输入" placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
入院时间<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right" bind:tap="openTime">
|
||||
<input type="text" value="{{case.admissionTime}}" class="ipt" placeholder="请输入" placeholder-class="placeholder" disabled />
|
||||
<van-icon name="arrow" color="#83858a" size="38rpx" class="righticon" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
病例类型<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right" bind:tap="openType">
|
||||
<input type="text" value="{{typeName}}" class="ipt" placeholder="请输入" placeholder-class="placeholder" disabled />
|
||||
<van-icon name="arrow" color="#83858a" size="38rpx" class="righticon" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" style="flex-direction: column;">
|
||||
<view class="left">
|
||||
病案照片(可上传1-6张)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="uploadbox">
|
||||
<van-uploader file-list="{{ fileList_basic }}" name="basic"
|
||||
deletable="{{showSaveBtn}}"
|
||||
show-upload="{{showSaveBtn}}"
|
||||
bind:delete="deleteImg" max-count="6" multiple bind:after-read="afterRead" upload-text="上传" upload-icon="{{img_host+'/upload.png'}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip" style="padding-bottom: 130rpx;">注意:“病案首页”需包含患者住院号或姓名</view>
|
||||
<view class="btnbox" wx:if="{{showSaveBtn}}">
|
||||
<view class="btn" bind:tap="saveBasic">下一步</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</van-tab>
|
||||
<van-tab title="临床资料" disabled="{{disable_ziliao}}">
|
||||
<view class="basic {{!showSaveBtn?'active':''}}" >
|
||||
|
||||
<view class="ziliao" wx:if="{{active!=0}}" >
|
||||
<view class="row" style="flex-direction: column;overflow: hidden;position: relative;">
|
||||
<view class="left" style="font-weight:bold">
|
||||
病历摘要<text class="red"></text>
|
||||
</view>
|
||||
<textarea value="{{case.abstractStr}}"
|
||||
disabled="{{!showSaveBtn}}"
|
||||
class="textArea"
|
||||
placeholder="请输入病历摘要"
|
||||
bind:input="onChangeAbstract"
|
||||
bind:change="onChangeAbstract"
|
||||
placeholder-style="color:rgba(0,0,0,0.25)"
|
||||
confirm-type="done"
|
||||
maxlength="500" auto-height="{{true}}"/>
|
||||
<view class="word">{{wordLength}}/500</view>
|
||||
<!-- <van-field value="{{case.abstractStr}}"
|
||||
name="abstractStr" label="" type="textarea" placeholder="请输入病历摘要" show-word-limit autosize="{{minHeight}}" border="{{ false }}"
|
||||
custom-style="font-size:15px;min-height:100px;background:red;word-wrap:break-word;word-break: break-all;" bind:input="onChangeAbstract" maxlength="500" /> -->
|
||||
</view>
|
||||
|
||||
<view class="row" style="flex-direction: column;" wx:if="{{!(fileList_abstract.length==0 && !showSaveBtn)}}">
|
||||
<view class="left" style="font-weight:bold">
|
||||
病历摘要图片(可上传1-6张)<text class="red"></text>
|
||||
</view>
|
||||
<view class="uploadbox">
|
||||
<van-uploader file-list="{{ fileList_abstract }}" name="abstract" multiple max-count="6"
|
||||
deletable="{{showSaveBtn}}"
|
||||
show-upload="{{showSaveBtn}}"
|
||||
bind:delete="deleteImg" bind:after-read="afterRead" upload-text="上传" upload-icon="{{img_host+'/upload.png'}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnbox" wx:if="{{showSaveBtn}}">
|
||||
<view class="btn" bind:tap="saveAbstract">下一步</view>
|
||||
</view>
|
||||
<view class="tip" >注意:病历摘要,文字填写或者上传图片,二选一</view>
|
||||
</view>
|
||||
</van-tab>
|
||||
<van-tab title="DPMAS治疗记录" disabled="{{disable_record}}">
|
||||
<view class="basic {{!showSaveBtn?'active':''}}">
|
||||
<view class="recordcon">
|
||||
<view class="record" wx:for="{{case.dpmas}}" wx:key="index">
|
||||
<view class="title">
|
||||
<view class="titlename">
|
||||
<view class="bar"></view>
|
||||
<view class="recordtime">第{{index+1}}次治疗</view>
|
||||
</view>
|
||||
<van-icon name="delete-o" size="22" bind:tap="confirmDelRecord" data-index="{{index}}" color="#b9bbbb" wx:if="{{index!=0 && showSaveBtn}}" />
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
治疗时间<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right" bind:tap="openDealTime" data-index="{{index}}">
|
||||
<input type="text" value="{{dpmas_list[index].treatTime}}" class="ipt" placeholder="请选择时间" placeholder-class="placeholder" disabled />
|
||||
<text wx:if="{{dpmas_list[index].treatTime}}">h</text>
|
||||
<van-icon name="arrow" color="#83858a" size="38rpx" class="righticon" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" style="flex-direction: column;border:none">
|
||||
<view class="left" style="white-space: normal;display: block;">
|
||||
治疗凭证,如医嘱、收费明细、处方单(可上传1-3张)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="uploadbox">
|
||||
<van-uploader file-list="{{ dpmas_list[index].fileList}}" bind:delete="deleteImg" multiple max-count="3" name="{{'record'+index}}"
|
||||
show-upload="{{showSaveBtn}}"
|
||||
deletable="{{showSaveBtn}}"
|
||||
bind:after-read="afterRead" upload-text="上传" upload-icon="{{img_host+'/upload.png'}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addrecord" bind:tap="addRecord" wx:if="{{showSaveBtn}}">
|
||||
<van-icon name="plus" size="38rpx" />
|
||||
<view class="recordText">增加记录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip" style="padding-bottom: 120rpx;">
|
||||
<text>
|
||||
注意:“DPMAS治疗凭证”照片需包含患者住院号或姓名
|
||||
1.4次及以上疗程化病例,每次治疗对应一张凭证照片;
|
||||
2.早前期(INR≤1.5)的病例,上传第一次DPMAS治疗前最新的“INR检验报告单”
|
||||
3.早前期(INR≤1.5)的病例,DPMAS治疗时间不能晚于INR出报告时间24小时。
|
||||
</text>
|
||||
</view>
|
||||
<view class="btnbox" wx:if="{{showSaveBtn}}">
|
||||
<view class="btn" bind:tap="saveRecord">下一步</view>
|
||||
</view>
|
||||
<!-- <view class="bottom">
|
||||
<view class="savebtn">保 存</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</van-tab>
|
||||
<van-tab title="实验室检测" disabled="{{disable_check}}">
|
||||
<view class="basic record {{!showSaveBtn?'active':''}}" style="background-color: #fff;">
|
||||
<view class="message"> (早前期为首次治疗前后、4次及以上为疗程化治疗前后)</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
治疗前检测时间<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right" bind:tap="openHeadTime">
|
||||
<input type="text" value="{{case.headTime}}" class="ipt" placeholder="请选择时间" placeholder-class="placeholder" disabled />
|
||||
<text wx:if="{{case.headTime}}">h</text>
|
||||
<van-icon name="arrow" color="#83858a" size="38rpx" class="righticon" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
治疗后检测时间<text class="red">*</text>
|
||||
</view>
|
||||
<view class="right" bind:tap="openAfterTime">
|
||||
<input type="text" value="{{case.afterTime}}" class="ipt" placeholder="请选择时间" placeholder-class="placeholder" disabled />
|
||||
<text wx:if="{{case.afterTime}}">h</text>
|
||||
<van-icon name="arrow" color="#83858a" size="38rpx" class="righticon" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
总胆红素(TB-umol/L)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headTb}}" bindinput="handleIpt" class="ipt" data-id="headTb"
|
||||
data-type="number"
|
||||
placeholder="请输入" placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterTb}}" bindinput="handleIpt" class="ipt" data-id="afterTb"
|
||||
data-type="number"
|
||||
placeholder="请输入" placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="table">
|
||||
<view class="t_title">
|
||||
直接胆红素(DB-umol/L)<text class="red"></text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headDb}}" bindinput="handleIpt" class="ipt" data-id="headDb"
|
||||
data-type="number"
|
||||
placeholder="请输入" placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterDb}}" bindinput="handleIpt" class="ipt" data-id="afterDb"
|
||||
data-type="number" placeholder="请输入" placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="table">
|
||||
<view class="t_title">
|
||||
间接胆红素(IB-umol/L)<text class="red"></text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headIb}}" bindinput="handleIpt" class="ipt" data-id="headIb" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterIb}}" bindinput="handleIpt" class="ipt" data-id="afterIb" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
谷丙转氨酶(ALT-U/L)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headAlt}}" bindinput="handleIpt" class="ipt" data-id="headAlt" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterAlt}}" bindinput="handleIpt" class="ipt" data-id="afterAlt" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
谷草转氨酶(AST-U/L)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headAst}}" bindinput="handleIpt" class="ipt" data-id="headAst" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterAst}}" bindinput="handleIpt" class="ipt" data-id="afterAst" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
国际标准化比值(INR)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headInr}}" bindinput="handleIpt" class="ipt" data-id="headInr" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterInr}}" bindinput="handleIpt" class="ipt" data-id="afterInr" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
白蛋白(ALB-g/L)<text class="red"></text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headAlb}}" bindinput="handleIpt" class="ipt" data-id="headAlb"
|
||||
data-type="number"
|
||||
placeholder="请输入" placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterAlb}}" bindinput="handleIpt" class="ipt" data-id="afterAlb" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
凝血酶原活动度(PTA-%)<text class="red"></text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headPta}}" bindinput="handleIpt" class="ipt" data-id="headPta" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterPta}}" bindinput="handleIpt" class="ipt" data-id="afterPta" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
白介素6(IL-6-ng/L)<text class="red"></text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headIl6}}" bindinput="handleIpt" class="ipt" data-id="headIl6" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterIl6}}" bindinput="handleIpt" class="ipt" data-id="afterIl6" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="t_title">
|
||||
肿瘤坏死因子α(TNF-α-μg/L)<text class="red"></text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗前</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.headTnf}}" bindinput="handleIpt" class="ipt" data-id="headTnf" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="left">治疗后</view>
|
||||
<view class="right">
|
||||
<input type="digit" value="{{case.afterTnf}}" bindinput="handleIpt" class="ipt" data-id="afterTnf" placeholder="请输入"
|
||||
data-type="number"
|
||||
placeholder-class="placeholder" disabled="{{!showSaveBtn}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" style="flex-direction: column;border:none;padding-bottom:120rpx;">
|
||||
<view class="left">
|
||||
检查报告单(可上传1-6张)<text class="red">*</text>
|
||||
</view>
|
||||
<view class="red rederror">至少包含国际标准化比值 (INR)治疗前结果报告</view>
|
||||
<view class="uploadbox">
|
||||
<van-uploader file-list="{{ fileList_check }}" multiple bind:delete="deleteImg" max-count="6" name="check"
|
||||
show-upload="{{showSaveBtn}}"
|
||||
deletable="{{showSaveBtn}}" bind:after-read="afterRead" upload-text="上传" upload-icon="{{img_host+'/upload.png'}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnbox" wx:if="{{showSaveBtn}}">
|
||||
<view class="btn" bind:tap="save">提交</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
<!-- <view class="btnbox">
|
||||
<view class="btn" bind:tap="save">保存</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<van-popup show="{{ showTime }}" round position="bottom" custom-style="height: 50%" bind:close="cancelDate" bind:cancel="cancelDate">
|
||||
<van-datetime-picker bind:confirm="confirmDate" title="{{time_title}}" bind:cancel="cancelDate" type="{{time_type}}" value="{{ currentDate }}" bind:input="onInput" max-date="{{ maxDate }}" min-date="{{ minDate }}" formatter="{{ formatter }}" />
|
||||
</van-popup>
|
||||
|
||||
|
||||
<dialog showDialog="{{showAttention}}" showCancel="{{false}}" bind:confirm="onConfirmAttention" title="注意" confirmText="马上去完善" message="信息并未完善,请继续填写"></dialog>
|
||||
<dialog showDialog="{{showTip}}" showCancel="{{false}}" bind:confirm="onConfirmTip" title="注意" confirmText="确定" message="所提交病例治疗时间需要在2024年度"></dialog>
|
||||
<dialog showDialog="{{showDel}}" showCancel="{{true}}" bind:confirm="onConfirmDel" bind:cancel="onCancelDel" title="删除记录" confirmText="确定" message="确定删除此条治疗记录吗?"></dialog>
|
||||
<dialog showDialog="{{showDraft}}" title="注意" message="是否保存草稿?" confirmText="保存" bind:confirm="onConfirmDraft" bind:cancel="onCancelDraft">
|
||||
</dialog>
|
||||
<dialog showDialog="{{showUseDraft}}" title="提示" message="加载上次草稿?" showCancel="{{false}}" confirmText="确定" bind:confirm="onConfirmUseDraft" bind:cancel="onCancelUseDraft">
|
||||
</dialog>
|
||||
<van-popup show="{{ showType }}" round position="bottom" custom-style="height: 50%">
|
||||
<van-picker columns="{{ columns }}" default-index="{{case.caseType}}" title="请选择病例类型" bind:cancel="onCancelType" show-toolbar bind:confirm="onConfirmType" />
|
||||
|
||||
</van-popup>
|
||||
@@ -0,0 +1,351 @@
|
||||
/* case/pages/createCase/createCase.wxss */
|
||||
page{
|
||||
overflow: hidden;
|
||||
}
|
||||
.page{
|
||||
overflow: hidden;
|
||||
background: #F7F9F9;
|
||||
flex:1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 172rpx;
|
||||
}
|
||||
.van-tab__pane{
|
||||
flex:1;
|
||||
}
|
||||
.tabbox{
|
||||
flex:1;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.van-tabs{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.van-tabs__line{
|
||||
width: 40rpx!important;
|
||||
height: 8rpx!important;
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
|
||||
}
|
||||
.van-tabs__wrap{
|
||||
padding-bottom: 10rpx;
|
||||
border-bottom: 1rpx solid #E3E4E5;
|
||||
}
|
||||
.basic{
|
||||
position: relative;
|
||||
height:calc( 100vh - 172rpx - 100rpx);
|
||||
overflow-y: scroll;
|
||||
margin-bottom: 120rpx;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.basic.active{
|
||||
margin-bottom:0rpx;
|
||||
}
|
||||
.basic .row{
|
||||
margin:0 32rpx;
|
||||
padding:32rpx 0;
|
||||
display: flex;
|
||||
border-bottom: 1rpx solid rgba(0,0,0,0.1);
|
||||
justify-content: space-between;
|
||||
}
|
||||
.basic .row:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
.basic .row .ipt{
|
||||
text-align: right;
|
||||
}
|
||||
.placeholder{
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.25);
|
||||
}
|
||||
.basic .row .left{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.basic .row .right{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.basic .row .left .red{
|
||||
margin-top: 8rpx;
|
||||
margin-left: 6rpx;
|
||||
color: #FF4D4F;
|
||||
}
|
||||
.righticon{
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
.uploadbox{
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.basic .tip{
|
||||
line-height: 44rpx;
|
||||
margin:0 32rpx;
|
||||
padding:24rpx 0;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.45);
|
||||
}
|
||||
.recordcon{
|
||||
background-color: #fff;
|
||||
padding-bottom: 28rpx;
|
||||
}
|
||||
.van-cell {
|
||||
padding:10px 0 !important;
|
||||
}
|
||||
.van-field__word-limit{
|
||||
color: rgba(0,0,0,0.25)!important;
|
||||
}
|
||||
|
||||
.record .title{
|
||||
background: #F7F9F9;
|
||||
padding:0 32rpx;
|
||||
height: 92rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(0,0,0,0.85);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.titlename{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.record .bar{
|
||||
margin-right: 12rpx;
|
||||
width: 8rpx;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
.basic .record .row{
|
||||
border-bottom: 1rpx solid rgba(0,0,0,0.1);
|
||||
}
|
||||
.row .time{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.85);
|
||||
}
|
||||
.addrecord{
|
||||
width:100%;
|
||||
|
||||
|
||||
display:flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
color: #3881F7;
|
||||
justify-content: center;
|
||||
}
|
||||
.recordText{
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.savebtn{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.bottom{
|
||||
left:32rpx;
|
||||
right:32rpx;
|
||||
position: fixed;
|
||||
bottom:20rpx;
|
||||
}
|
||||
.record .left{
|
||||
color: rgba(0,0,0,0.65);
|
||||
}
|
||||
.message{
|
||||
height: 72rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #3881F7;
|
||||
font-size: 28rpx;
|
||||
padding:0 32rpx;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.rederror{
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #FF4D4F;
|
||||
}
|
||||
/* .van-uploader__wrapper,.van-uploader__preview-image,.van-uploader__preview{
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
} */
|
||||
.basiccon,.ziliao{
|
||||
background-color: #fff;
|
||||
}
|
||||
.ziliao{
|
||||
display: block!important;
|
||||
}
|
||||
.ziliao.notshowArea{
|
||||
display: none!important;
|
||||
}
|
||||
.van-tabs__nav{
|
||||
width:800rpx;
|
||||
}
|
||||
.van-tab{
|
||||
padding:0 30rpx!important;
|
||||
flex:none!important;
|
||||
font-size:30rpx!important
|
||||
}
|
||||
/* .van-ellipsis{
|
||||
overflow: auto;
|
||||
} */
|
||||
.van-tabs__scroll{
|
||||
width:750rpx;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.van-tab--active{
|
||||
font-weight: 500;
|
||||
color: rgba(0,0,0,0.85)
|
||||
}
|
||||
.table{
|
||||
margin:24rpx 32rpx 0;
|
||||
overflow: hidden;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid rgba(0,0,0,0.15)
|
||||
}
|
||||
.table .row{
|
||||
border-bottom-style: dashed;
|
||||
margin:0 24rpx;
|
||||
}
|
||||
.t_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
padding:0 24rpx;
|
||||
height: 80rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #3881F7;
|
||||
background: #EBF3FF;
|
||||
}
|
||||
.table .red{
|
||||
margin-top: 8rpx;
|
||||
margin-left: 6rpx;
|
||||
color: #FF4D4F;
|
||||
}
|
||||
.btnbox{
|
||||
position: fixed;
|
||||
bottom:0;
|
||||
z-index:9;
|
||||
height: 120rpx;
|
||||
left:32rpx;
|
||||
right:32rpx;
|
||||
}
|
||||
.btnbox .btn{
|
||||
width:100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.van-tab--disabled{
|
||||
color:#646566!important;
|
||||
}
|
||||
/* components/navBar.wxss */
|
||||
.ui-navigatorbar {
|
||||
position: fixed;
|
||||
z-index:99;
|
||||
top: 0;
|
||||
width: 750rpx;
|
||||
height: 172rpx;
|
||||
background: #F2F2F2;
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.ui-navigatorbar-back {
|
||||
position: absolute;
|
||||
padding-left:40rpx;
|
||||
padding-right:40rpx;
|
||||
|
||||
left: 0rpx;
|
||||
font-size: 40rpx;
|
||||
bottom: 20rpx;
|
||||
}
|
||||
|
||||
.ui-title {
|
||||
position: absolute;
|
||||
width: 350rpx;
|
||||
height: 88rpx;
|
||||
line-height: 56rpx;
|
||||
font-size: 36rpx;
|
||||
white-space: nowrap;
|
||||
color: #000000;
|
||||
bottom: 0;
|
||||
left: 200rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}.van-uploader__preview-delete, .van-uploader__preview-delete:after{
|
||||
|
||||
width: 18px!important;
|
||||
height: 18px!important;
|
||||
}
|
||||
.van-uploader__preview-delete-icon{
|
||||
font-size:18px!important;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
|
||||
}
|
||||
.van-picker-column__item--selected,.van-picker__confirm{
|
||||
color: #3881F7!important;
|
||||
}
|
||||
.textArea{
|
||||
margin-top: 20rpx;
|
||||
width:100%;
|
||||
max-height: 500rpx!important;
|
||||
font-size: 15px;
|
||||
min-height:50rpx!important;
|
||||
padding-bottom: 30px;
|
||||
display: block!important;
|
||||
}
|
||||
|
||||
.word{
|
||||
white-space: pre-wrap;
|
||||
line-height:48rpx;
|
||||
position: absolute;
|
||||
bottom:20rpx;
|
||||
color: rgba(0,0,0,0.25);
|
||||
right:10rpx;
|
||||
}
|
||||
.van-picker__cancel, .van-picker__confirm{
|
||||
font-size: 15px!important;
|
||||
}
|
||||
.van-picker__column:nth-child(5){
|
||||
display: none;
|
||||
}
|
||||
.recordtime{
|
||||
font-weight: bold;
|
||||
}
|
||||
.van-radio__icon--disabled{
|
||||
background-color: #fff!important;
|
||||
}
|
||||
.van-radio__icon--disabled.van-radio__icon--checked{
|
||||
color:#fff!important;
|
||||
background-color: #1989fa!important;
|
||||
border-color:#1989fa ;
|
||||
}
|
||||
.van-radio__label--disabled{
|
||||
color:#000!important;
|
||||
}
|
||||
@@ -0,0 +1,520 @@
|
||||
// case/pages/improveInfo/improveInfo.js
|
||||
// case/pages/register/register.js
|
||||
import {throttle} from "../../../utils/util"
|
||||
import {hostConfig} from "../../../utils/config"
|
||||
import {getArea,getHospital,getOfficeList,getPosition,needInfo,modifyInfo} from "../../../api/api"
|
||||
import {base64src} from "../../../utils/base64ToImg"
|
||||
const host=hostConfig().host;
|
||||
const app=getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
showSuccess:false,
|
||||
img_host:app.hostConfig().imghost,
|
||||
showArea:false,
|
||||
areaColumns:[
|
||||
{
|
||||
values: [1,2],
|
||||
className: 'column1',
|
||||
},
|
||||
{
|
||||
values: [3,4],
|
||||
className: 'column2',
|
||||
defaultIndex: 0
|
||||
},
|
||||
],
|
||||
hospitalColumns:[],
|
||||
officeColumns:[],
|
||||
positionColumns:[],
|
||||
showHospital:false,
|
||||
showOffice:false,
|
||||
showPosition:false,
|
||||
fileList:[],
|
||||
disabled:false,
|
||||
county_id:'',
|
||||
hospital_name:'',
|
||||
hospital_uuid:'',
|
||||
mobile:'',
|
||||
name:'',
|
||||
uuid:'',
|
||||
office_name:'',
|
||||
office_uuid:'',
|
||||
password:'',
|
||||
position_uuid:'',
|
||||
certificate:'',
|
||||
certificate_img:'',
|
||||
codeActive:true,
|
||||
msg:'获取验证码',
|
||||
captchaUuid:'',
|
||||
captchaCode:'',
|
||||
loginDevice:5,
|
||||
imgCode:'',
|
||||
sms:'',
|
||||
timer:null,
|
||||
time:59,
|
||||
smsType:1,
|
||||
showCrop:false,
|
||||
width: 250, //宽度
|
||||
height: 250, //高度
|
||||
max_width: 300,
|
||||
max_height: 300,
|
||||
disable_rotate: true, //是否禁用旋转
|
||||
disable_ratio: false, //锁定比例
|
||||
limit_move: true, //是否限制移动
|
||||
},
|
||||
closeCrop(){
|
||||
this.setData({
|
||||
showCrop:false
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.setData({
|
||||
showCrop:false
|
||||
})
|
||||
this.cropper.getImg((obj) => {
|
||||
this.uploadImg(obj)
|
||||
});
|
||||
},
|
||||
cropperload(e) {
|
||||
console.log('cropper加载完成');
|
||||
},
|
||||
initCrop(options){
|
||||
|
||||
this.cropper = this.selectComponent("#image-cropper");
|
||||
|
||||
|
||||
|
||||
if(options.imgSrc){
|
||||
this.setData({
|
||||
src: options.imgSrc
|
||||
});
|
||||
}
|
||||
|
||||
// if(!options.imgSrc){
|
||||
// this.cropper.upload(); //上传图片
|
||||
// }
|
||||
},
|
||||
loadimage(e) {
|
||||
this.cropper.imgReset();
|
||||
},
|
||||
onConfirmSuccess(){
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
app.method.navigateTo({
|
||||
url:"/case/pages/mobileLogin/mobileLogin"
|
||||
})
|
||||
},
|
||||
opeArea(){
|
||||
this.setData({
|
||||
showArea:true
|
||||
})
|
||||
},
|
||||
openOffice(){
|
||||
this.setData({
|
||||
showOffice:true,
|
||||
})
|
||||
},
|
||||
openPosition(){
|
||||
this.setData({
|
||||
showPosition:true,
|
||||
})
|
||||
},
|
||||
onChange(e){
|
||||
const {value} = e.detail;
|
||||
|
||||
const {id}=e.currentTarget.dataset;
|
||||
// console.log(value,id)
|
||||
this.setData({
|
||||
[id]: value
|
||||
});
|
||||
},
|
||||
onChangeArea(event){
|
||||
const { picker, value, index } = event.detail;
|
||||
const provinceId=value[0].id;
|
||||
this.handleGetArea(provinceId)
|
||||
},
|
||||
confirmArea(event){
|
||||
const {value} = event.detail;
|
||||
const countyId=value[1].id;
|
||||
this.setData({
|
||||
county_id:countyId,
|
||||
showArea:false
|
||||
});
|
||||
this.handleGetHospital(countyId)
|
||||
},
|
||||
cancelArea(){
|
||||
this.setData({
|
||||
showArea:false
|
||||
})
|
||||
},
|
||||
confirmHospital(event){
|
||||
let {value}=event.detail;
|
||||
this.setData({
|
||||
showHospital:false,
|
||||
hospital_uuid:value.uuid,
|
||||
hospital_name:value.name
|
||||
})
|
||||
},
|
||||
cancelHospital(){
|
||||
this.setData({
|
||||
showHospital:false
|
||||
})
|
||||
},
|
||||
confirmOffice(event){
|
||||
let {value}=event.detail;
|
||||
|
||||
this.setData({
|
||||
office_name:value.officeName,
|
||||
office_uuid:value.officeUuid,
|
||||
showOffice:false
|
||||
})
|
||||
},
|
||||
cancelOffice(){
|
||||
this.setData({
|
||||
showOffice:false
|
||||
})
|
||||
},
|
||||
confirmPosition(event){
|
||||
let {value}=event.detail;
|
||||
this.setData({
|
||||
position_uuid:value.uuid,
|
||||
position_name:value.name,
|
||||
showPosition:false
|
||||
})
|
||||
},
|
||||
cancelPosition(){
|
||||
this.setData({
|
||||
showPosition:false
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
handleNeedInfo(){
|
||||
let {mobile,positionColumns}=this.data;
|
||||
needInfo(mobile).then(res=>{
|
||||
let {certificate,certificate_img,county_id,hospital_name,hospital_uuid,name,office_name,office_uuid,position_uuid,uuid}=res;
|
||||
let arr= positionColumns.filter((item)=>item.uuid==position_uuid);
|
||||
console.log(arr);
|
||||
this.setData({
|
||||
certificate,
|
||||
county_id,
|
||||
certificate_img,
|
||||
hospital_name,
|
||||
hospital_uuid,
|
||||
name,
|
||||
position_name:arr.length>0?arr[0].name:'',
|
||||
office_name,
|
||||
office_uuid,
|
||||
position_uuid,
|
||||
uuid
|
||||
})
|
||||
})
|
||||
},
|
||||
handleModifyInfo:throttle(function(){
|
||||
let {certificate,certificate_img,county_id,hospital_name,hospital_uuid,name,office_name,office_uuid,position_uuid,uuid}=this.data;
|
||||
if(!(/^[\u4E00-\u9FA5·]{2,20}$/.test(name))){
|
||||
wx.showToast({
|
||||
title: `请输入您的真实姓名`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!hospital_uuid){
|
||||
wx.showToast({
|
||||
title: `请选择医院`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!office_uuid){
|
||||
wx.showToast({
|
||||
title: `请选择科室`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!position_uuid){
|
||||
wx.showToast({
|
||||
title: `请选择职称`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!certificate_img){
|
||||
wx.showToast({
|
||||
title: `请上传执业医师资格证或工作胸牌`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
modifyInfo({
|
||||
certificate,
|
||||
certificate_img,
|
||||
county_id,
|
||||
hospital_name,
|
||||
hospital_uuid,
|
||||
name,
|
||||
office_name,
|
||||
office_uuid,
|
||||
position_uuid,
|
||||
uuid
|
||||
}).then(res=>{
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
})
|
||||
})
|
||||
}),
|
||||
handleGetArea(id){
|
||||
getArea({
|
||||
parent:id
|
||||
}).then(res=>{
|
||||
if(id){
|
||||
let obj='areaColumns[1].values';
|
||||
this.setData({
|
||||
[obj]:res
|
||||
})
|
||||
}else{
|
||||
let obj='areaColumns[0].values';
|
||||
this.setData({
|
||||
[obj]:res
|
||||
})
|
||||
this.handleGetArea(res[0].id)
|
||||
}
|
||||
|
||||
}).catch(error=>{
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
handleGetHospital(countyId){
|
||||
getHospital(countyId).then(res=>{
|
||||
this.setData({
|
||||
showHospital:true,
|
||||
hospitalColumns:res.concat({uuid:1,name:'其他医院'})
|
||||
})
|
||||
})
|
||||
},
|
||||
handleGetOffice(){
|
||||
getOfficeList({}).then(res=>{
|
||||
this.setData({
|
||||
officeColumns:res
|
||||
})
|
||||
}).catch(error=>{
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
handleGetPosition(){
|
||||
getPosition().then(res=>{
|
||||
this.setData({
|
||||
positionColumns:res
|
||||
})
|
||||
this.handleNeedInfo();
|
||||
})
|
||||
},
|
||||
handleSmsRegister:throttle(function(){
|
||||
let {name,password,hospital_uuid,hospital_name,office_name,office_uuid,position_uuid,certificate,certificate_img,county_id}=this.data;
|
||||
if(!(/^[\u4E00-\u9FA5·]{2,20}$/.test(name))){
|
||||
wx.showToast({
|
||||
title: `请输入您的真实姓名`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
smsRegister({
|
||||
|
||||
name,
|
||||
hospital_uuid,
|
||||
hospital_name,
|
||||
office_name,
|
||||
office_uuid,
|
||||
county_id,
|
||||
position_uuid,
|
||||
certificate,
|
||||
certificate_img
|
||||
}).then(res=>{
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
})
|
||||
})
|
||||
}),
|
||||
handleThrottle:throttle(function(){
|
||||
this.getCode()
|
||||
}),
|
||||
handleGetCaptcha(){
|
||||
getCaptcha().then(res=>{
|
||||
base64src(res.captchaBase64Image,(img)=>{
|
||||
this.setData({
|
||||
imgCode:img,
|
||||
captchaUuid:res.captchaUuid
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
getCode(){
|
||||
if(this.data.disabled)return;
|
||||
let {mobile,captchaCode,captchaUuid,loginDevice,smsType}=this.data;
|
||||
if(!/^1[3456789]\d{9}$/.test(mobile)){
|
||||
wx.showToast({
|
||||
title: `请输入有效的手机号码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!captchaCode){
|
||||
wx.showToast({
|
||||
title: `图形验证码不能为空`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
sendSms({
|
||||
mobile,
|
||||
captchaCode,
|
||||
captchaUuid,
|
||||
smsType,
|
||||
loginDevice
|
||||
}).then((res)=>{
|
||||
let timer=setInterval(() => {
|
||||
if (this.data.time == 0) {
|
||||
clearInterval(this.data.timer);
|
||||
this.setData({
|
||||
time:59,
|
||||
msg:'重新获取验证码',
|
||||
disabled:false,
|
||||
codeActive:true,
|
||||
})
|
||||
} else {
|
||||
let msg= this.data.time + " s 后重新发送";
|
||||
this.setData({
|
||||
disabled:true,
|
||||
msg:msg,
|
||||
codeActive:false,
|
||||
})
|
||||
let time=this.data.time--;
|
||||
this.setData({
|
||||
msg:time + " s 后重新发送"
|
||||
})
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
this.setData({
|
||||
timer:timer
|
||||
})
|
||||
}).catch(()=>{
|
||||
this.handleGetCaptcha();
|
||||
});
|
||||
|
||||
},
|
||||
uploadImg(file){
|
||||
let THIS=this;
|
||||
wx.showLoading({
|
||||
title: '图片上传中',
|
||||
mask: true
|
||||
})
|
||||
|
||||
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
wx.uploadFile({
|
||||
url: host+'/user/uoloadImg', // 仅为示例,非真实的接口地址
|
||||
filePath: file.url,
|
||||
name: 'file',
|
||||
formData: file,
|
||||
success(res) {
|
||||
let result=JSON.parse(res.data);
|
||||
|
||||
if(result.code==200){
|
||||
wx.hideLoading();
|
||||
THIS.setData({
|
||||
certificate_img:result.data
|
||||
});
|
||||
}else{
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title:result.msg,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
complete(res){
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
},
|
||||
afterRead(event) {
|
||||
const {
|
||||
file
|
||||
} = event.detail;
|
||||
this.setData({
|
||||
showCrop:true,
|
||||
src:file.url
|
||||
})
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if(options.mobile){
|
||||
this.setData({
|
||||
mobile:options.mobile
|
||||
})
|
||||
}
|
||||
//this.handleGetCaptcha();
|
||||
this.handleGetArea('');
|
||||
this.handleGetOffice();
|
||||
this.handleGetPosition();
|
||||
this.initCrop(options);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
// onShareAppMessage() {
|
||||
|
||||
// }
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-overlay": "@vant/weapp/overlay/index",
|
||||
"image-cropper": "../../../components/image-cropper/image-cropper",
|
||||
"dialog":"../../../components/dialog/dialog",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-picker": "@vant/weapp/picker/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-cell": "@vant/weapp/cell/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-image": "@vant/weapp/image/index",
|
||||
"van-uploader": "@vant/weapp/uploader/index",
|
||||
"van-cell-group": "@vant/weapp/cell-group/index"
|
||||
|
||||
},
|
||||
"navigationBarTitleText": "完善信息"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<!--case/pages/improveInfo/improveInfo.wxml-->
|
||||
<!--case/pages/register/register.wxml-->
|
||||
<view class="page">
|
||||
|
||||
<view >
|
||||
<van-cell-group class="group" >
|
||||
<van-field value="{{ name }}" label="姓名" placeholder="请输入您的真实姓名" input-align="right" placeholder-style="color:#999;font-size:15px" bind:change="onChange" data-id="name" extra-event-params/>
|
||||
<van-field value="{{ hospital_name }}" label="医院" placeholder="请选择医院" right-icon="arrow" placeholder-style="color:#999;font-size:15px"
|
||||
input-align="right" bind:tap="opeArea" readonly/>
|
||||
<van-field value="{{ office_name }}"
|
||||
placeholder-style="color:#999;font-size:15px"bind:tap="openOffice" label="科室" placeholder="请选择科室" right-icon="arrow" input-align="right" readonly />
|
||||
<van-field value="{{ position_name }}"
|
||||
placeholder-style="color:#999;font-size:15px" bind:tap="openPosition" label="职称" placeholder="请选择职称" right-icon="arrow" input-align="right" readonly />
|
||||
<van-field value="{{ certificate }}" placeholder-style="color:#999;font-size:15px" label="执业证号(选填)" placeholder="请输入执业证号" class="myclass" input-align="right" />
|
||||
<!-- <van-field value="{{ value }}" label="执业医师资格证或工作胸牌" placeholder="请输入您的真实姓名" right-icon="arrow" input-align="right" bind:change="onChange" input-align="right" >
|
||||
<view class="right" slot="input">
|
||||
<van-image width="120rpx" height="80rpx" fit="contain" src="https://dev-wx.igandan.com/public/hcpEducation/images/default.png" />
|
||||
</view>
|
||||
</van-field> -->
|
||||
<van-cell title="执业医师资格证或工作胸牌" is-link class="cert">
|
||||
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" class="upload"/>
|
||||
<van-image width="120rpx" height="80rpx" fit="contain" src="{{certificate_img?certificate_img:img_host+'/default_register.png'}}" class="cert"/>
|
||||
</van-cell>
|
||||
<view class="next">
|
||||
<van-button type="primary" block bind:tap="handleModifyInfo">提交</van-button>
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
</view>
|
||||
<van-popup
|
||||
show="{{ showArea }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ areaColumns }}" value-key="name" bind:change="onChangeArea" title="请选择地区" show-toolbar bind:confirm="confirmArea" bind:cancel="cancelArea"/>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
show="{{ showHospital }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ hospitalColumns }}" value-key="name" title="请选择医院" show-toolbar bind:confirm="confirmHospital" bind:cancel="cancelHospital"/>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
show="{{ showOffice }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ officeColumns }}" value-key="officeName" title="请选择科室" show-toolbar bind:confirm="confirmOffice" bind:cancel="cancelOffice"/>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
show="{{ showPosition }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ positionColumns }}" value-key="name" title="请选择职称" show-toolbar bind:confirm="confirmPosition" bind:cancel="cancelPosition"/>
|
||||
</van-popup>
|
||||
<dialog showDialog="{{showSuccess}}" showCancel="{{false}}" bind:confirm="onConfirmSuccess" title="提示" confirmText="确定" message="完善成功,请等待审核"></dialog>
|
||||
<van-overlay show="{{showCrop}}" >
|
||||
<image-cropper id="image-cropper" bindload="cropperload" bindimageload="loadimage" bindtapcut="clickcut" limit_move="{{limit_move}}" disable_rotate="{{disable_rotate}}" width="{{width}}" height="{{height}}" imgSrc="{{src}}" angle="{{angle}}" disable_width="{{disable_width}}" max_width="{{max_width}}" max_height="{{max_height}}" disable_height="{{disable_height}}" disable_ratio="{{disable_ratio}}"></image-cropper>
|
||||
<view class="buttonbox">
|
||||
<button bindtap='closeCrop' type="default" class="button" size="mini">返回</button>
|
||||
<button bindtap='submit' type="primary" class="button" size="mini">确定</button>
|
||||
</view>
|
||||
</van-overlay>
|
||||
@@ -0,0 +1,84 @@
|
||||
/* case/pages/improveInfo/improveInfo.wxss */
|
||||
/* case/pages/register/register.wxss */
|
||||
.next{
|
||||
margin: 40rpx 20rpx!important;
|
||||
}
|
||||
.prev{
|
||||
margin:-20rpx 20rpx 0!important ;
|
||||
}
|
||||
.van-field__label{
|
||||
white-space: nowrap;
|
||||
}
|
||||
.custom-class .van-cell:last-child{
|
||||
background-color: red;
|
||||
}
|
||||
.van-cell__title{
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
color: #646566;
|
||||
align-items: center;
|
||||
}
|
||||
.van-image{
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.van-cell{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.van-field__label,.van-cell__title{
|
||||
position: relative;
|
||||
}
|
||||
.van-field__label::after,.cert .van-cell__title::after{
|
||||
content: "*";
|
||||
color:red;
|
||||
position: absolute;
|
||||
top:12rpx;
|
||||
right:-14rpx;
|
||||
}
|
||||
.cert .van-cell__title::after{
|
||||
top:4rpx;
|
||||
}
|
||||
.myclass .van-field__label::after{
|
||||
content: "";
|
||||
}
|
||||
.upload{
|
||||
opacity:0;
|
||||
position: absolute;
|
||||
z-index:99;
|
||||
}
|
||||
.cert .van-cell{
|
||||
overflow: hidden;
|
||||
}
|
||||
.van-button{
|
||||
border-radius: 10rpx!important;
|
||||
}
|
||||
.imgCode{
|
||||
width:200rpx;
|
||||
height:75.6rpx;
|
||||
}
|
||||
.custom-class{
|
||||
min-height:43.5px !important;
|
||||
}
|
||||
.van-field__label{
|
||||
color:#333!important;
|
||||
padding:12rpx 0;
|
||||
font-size: 15px!important;
|
||||
}
|
||||
.van-cell__title{
|
||||
color:#333!important;
|
||||
font-size: 15px!important;
|
||||
}
|
||||
.buttonbox{
|
||||
position: absolute;
|
||||
z-index:99;
|
||||
display: flex;
|
||||
width:600rpx;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
justify-content: space-between;
|
||||
bottom:50rpx;
|
||||
}
|
||||
.van-button--primary{
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%)!important;
|
||||
border-color:#377FF7!important
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
|
||||
const app = getApp()
|
||||
import {phoneLogin} from "../../../api/api"
|
||||
import {auth} from "../../../api/auth.js"
|
||||
import {throttle} from "../../../utils/util"
|
||||
let urlHost=app.hostConfig().agreehost;
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
message:'',
|
||||
check: false,
|
||||
mobile:'',
|
||||
showSuccess:false,
|
||||
beforeClose(action){
|
||||
return new Promise((resolve) => {
|
||||
if (action === 'confirm') {
|
||||
resolve(true);
|
||||
} else {
|
||||
// 拦截取消操作
|
||||
resolve(false);
|
||||
}
|
||||
})
|
||||
},
|
||||
showEntryTip:false,
|
||||
showEntryTip_second:false,
|
||||
redirecUrl:'',
|
||||
img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/case/static'
|
||||
|
||||
},
|
||||
onConfirmSuccess(){
|
||||
let {mobile}=this.data;
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/improveInfo/improveInfo?mobile='+mobile
|
||||
})
|
||||
},
|
||||
onCancelSuccess(){
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
},
|
||||
handleAgree(){
|
||||
if(!this.data.check){
|
||||
wx.showToast({
|
||||
title: '请同意《肝胆相照用户服务协议》!',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
};
|
||||
},
|
||||
|
||||
onConfirmEntry(){
|
||||
this.setData({
|
||||
showEntryTip:false
|
||||
})
|
||||
//wx.setStorageSync('hasEntry', true);
|
||||
},
|
||||
onCloseEntry(){
|
||||
this.setData({
|
||||
showEntryTip:true,
|
||||
showEntryTip_second:true
|
||||
})
|
||||
},
|
||||
onConfirmEntry_second(){
|
||||
this.setData({
|
||||
showEntryTip_second:false,
|
||||
});
|
||||
//wx.setStorageSync('hasEntry', true);
|
||||
|
||||
},
|
||||
onCloseEntry_second(){
|
||||
wx.exitMiniProgram({success: (res) => {}})
|
||||
this.setData({
|
||||
showEntryTip_second:false,
|
||||
showEntryTip:false,
|
||||
});
|
||||
|
||||
},
|
||||
goRegister:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/register/register'
|
||||
})
|
||||
}),
|
||||
getPhoneNumber:throttle(function(e) {
|
||||
console.log(e.detail)
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok'){
|
||||
auth().then(res => {
|
||||
phoneLogin('wx415cbcf96f4a3b27',{
|
||||
code:e.detail.code
|
||||
}).then((data)=>{
|
||||
const { envVersion } = wx.getAccountInfoSync().miniProgram;
|
||||
let token=''
|
||||
if(envVersion=="develop" || envVersion=="trial"){
|
||||
token="DEV_CASE_TOKEN"
|
||||
}else{
|
||||
token="PROD_CASE_TOKEN"
|
||||
}
|
||||
wx.setStorageSync(token, data.token);
|
||||
let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index';
|
||||
|
||||
if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1){
|
||||
wx.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}else{
|
||||
wx.reLaunch({
|
||||
url:url
|
||||
})
|
||||
}
|
||||
}).catch(error=>{
|
||||
if(error.code==10007){
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
message:error.msg,
|
||||
mobile:error.data
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
}else if(e.detail.errMsg == 'getPhoneNumber:fail user deny'){
|
||||
console.log('您拒绝手机号授权')
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '手机号授权失败',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
}),
|
||||
goMobile(){
|
||||
let url='/case/pages/mobileLogin/mobileLogin';
|
||||
let redirectUrl=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index';
|
||||
app.method.navigateTo({
|
||||
url: url+"?redirectUrl="+encodeURIComponent(redirectUrl)
|
||||
})
|
||||
},
|
||||
goAgreement:throttle(function(event){
|
||||
let id=event.currentTarget.dataset.id;
|
||||
app.method.navigateTo({
|
||||
url:"/case/pages/linkPage/linkPage?url="+encodeURIComponent(urlHost+'/basic/file/agreement.htm?id='+id)
|
||||
})
|
||||
}),
|
||||
checkboxChange(event) {
|
||||
this.setData({
|
||||
check: event.detail
|
||||
})
|
||||
|
||||
},
|
||||
getRedirect(urlParams){
|
||||
|
||||
let url=decodeURIComponent(urlParams);
|
||||
let index=url.indexOf("redirectUrl=");
|
||||
let cur_url=''
|
||||
if(index!=-1){
|
||||
cur_url=url.substring(index+12,index.length);
|
||||
// console.log(cur_url)
|
||||
this.getRedirect(cur_url);
|
||||
}else{
|
||||
cur_url=url;
|
||||
}
|
||||
return decodeURIComponent(cur_url);
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
beforeClose: this.data.beforeClose.bind(this),
|
||||
})
|
||||
if(options.redirectUrl){
|
||||
//console.log(decodeURIComponent(options.redirectUrl))
|
||||
this.setData({
|
||||
redirectUrl:"/"+decodeURIComponent(options.redirectUrl)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.setData({
|
||||
img_host:app.hostConfig().imghost
|
||||
});
|
||||
wx.getPrivacySetting({
|
||||
success: res => {
|
||||
console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
|
||||
if (res.needAuthorization) {
|
||||
// 需要弹出隐私协议
|
||||
this.setData({
|
||||
showEntryTip:true
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
showEntryTip:false
|
||||
})
|
||||
// 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私
|
||||
}
|
||||
},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"dialog":"../../../components/dialog/dialog",
|
||||
"van-overlay": "@vant/weapp/overlay/index",
|
||||
"van-checkbox": "@vant/weapp/checkbox/index",
|
||||
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
|
||||
"van-dialog": "@vant/weapp/dialog/index"
|
||||
},
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<!--pages/login/login.wxml-->
|
||||
<view class="contain">
|
||||
<view class="zhuce" bind:tap="goRegister">注册</view>
|
||||
<view class="logobox">
|
||||
<image src="https://img.applets.igandanyiyuan.com/applet/patient/static/logo.png"></image>
|
||||
<text class="desc">你好!欢迎登录人工肝病例登记系统</text>
|
||||
</view>
|
||||
<view class="btnbox_shouquan">
|
||||
<button type="primary" bindtap="handleAgree" wx:if="{{check==0}}">手机号快捷登录</button>
|
||||
<button type="primary" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:else>手机号快捷登录</button>
|
||||
<view class="checkbox">
|
||||
<view>
|
||||
<van-checkbox value="{{ check }}" bind:change="checkboxChange"></van-checkbox>
|
||||
</view>
|
||||
<text>我已阅读并同意协议<text class="navigator" bindtap="goAgreement" data-id="3">《肝胆相照用户注册及服务协议》、</text><text class="navigator" bindtap="goAgreement" data-id="2">《隐私协议》、</text><text class="navigator" bindtap="goAgreement" data-id="1">《风险告知书》</text></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer" bindtap="goMobile">输入手机号登录</view>
|
||||
</view>
|
||||
|
||||
<van-overlay show="{{ showEntryTip }}" zIndex="9999">
|
||||
<view class="wrapper">
|
||||
<view class="privacyBox">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="entrymsg">
|
||||
<view> 亲爱的用户,感谢您信任并使用人工肝病例登录系统!我们依据最新法律法规的要求,制定了<text class="navigator" bindtap="goAgreement" data-id="2">《隐私协议》</text>。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。</view>
|
||||
<view>如您同意《隐私协议》,请点击“同意”开始使用我们的产品和服务。</view>
|
||||
</view>
|
||||
<view class="btnbox">
|
||||
<view class="cancel" bindtap="onCloseEntry">不同意</view>
|
||||
<button id="agree-btn"
|
||||
plain
|
||||
class="confirm"
|
||||
open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="onConfirmEntry">同意并继续</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-overlay>
|
||||
|
||||
<van-overlay show="{{ showEntryTip_second }}" zIndex="99999">
|
||||
<view class="wrapper">
|
||||
<view class="privacyBox">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="entrymsg" >
|
||||
<view> 很抱歉,如您不同意《隐私协议》,可能无法继续正常使用我们的服务,请您先同意哦~</view>
|
||||
</view>
|
||||
<view class="btnbox">
|
||||
<view class="cancel" bindtap="onCloseEntry_second">不同意</view>
|
||||
<button id="agree-btn"
|
||||
plain
|
||||
class="confirm"
|
||||
bindtap="onConfirmEntry_second">好的</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-overlay>
|
||||
|
||||
<!-- <van-dialog
|
||||
title="温馨提示"
|
||||
show="{{ showEntryTip_second }}"
|
||||
message="很抱歉,如您不同意《隐私协议》,可能无法继续正常使用我们的服务,请您先同意哦~"
|
||||
show-cancel-button
|
||||
confirm-button-text="好的"
|
||||
cancel-button-text="不同意"
|
||||
confirm-button-color="#3CC7C0"
|
||||
bind:confirm="onConfirmEntry_second"
|
||||
bind:cancel="onCloseEntry_second"
|
||||
>
|
||||
</van-dialog> -->
|
||||
<dialog showDialog="{{showSuccess}}" bind:confirm="onConfirmSuccess" bind:cancel="onCancelSuccess" title="提示" confirmText="完善" message="{{message}}"></dialog>
|
||||
@@ -0,0 +1,108 @@
|
||||
/* pages/login/login.wxss */
|
||||
.contain {
|
||||
padding: 0 30rpx 0rpx;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.logobox{display: flex;flex-direction: column;margin-top: 122rpx;}
|
||||
.logobox image{width: 275rpx;height:56rpx}
|
||||
.logobox .desc{font-size: 40rpx;margin-top: 42rpx;}
|
||||
.btnbox_shouquan{width:100%;margin-top: 280rpx;}
|
||||
.btnbox_shouquan button{display:flex;width:100%;font-size:36rpx;height: 94rpx;background: #09BB07;border-radius: 47rpx;color: #FFFFFF;align-items: center;justify-content: center;font-weight: normal;}
|
||||
.checkbox{display: flex;margin-top: 40rpx;font-size: 28rpx;align-items: flex-start;height:40rpx;}
|
||||
.checkbox view{
|
||||
/* width: 40rpx;height:40rpx;
|
||||
margin-right:14rpx;border-radius: 50%; */
|
||||
display: flex;align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
.checkbox .check{width: 40rpx;height:40rpx;opacity: 0;}
|
||||
.checkbox image{
|
||||
left:5rpx;
|
||||
top:4rpx;
|
||||
position: absolute;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
z-index:1;
|
||||
}
|
||||
.navigator{color: #4384FE;white-space:pre-wrap;word-break: break-all;background-color: none;font-size: 28rpx;}
|
||||
.footer{
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
width:600rpx;
|
||||
position: absolute;
|
||||
bottom:60rpx;
|
||||
text-align: center;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
color: #333333}
|
||||
.entrymsg{
|
||||
-webkit-overflow-scrolling: touch;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
padding: 48rpx;
|
||||
text-align: left;
|
||||
}
|
||||
.navigator{
|
||||
color:#3CC7C0
|
||||
}
|
||||
.wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
.privacyBox {
|
||||
width:90%;
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
.privacyBox .title{
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
line-height:24px;
|
||||
padding-top:24px;
|
||||
text-align: center;
|
||||
font-size:16px;
|
||||
}
|
||||
.privacyBox .btnbox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top:1rpx solid #efefef;
|
||||
width:100%;
|
||||
font-size: 17px;
|
||||
}
|
||||
.privacyBox .btnbox .cancel{
|
||||
flex:1;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.privacyBox .btnbox .confirm{
|
||||
margin: 0;
|
||||
height: 50px;
|
||||
padding: 0;
|
||||
color: #3CC7C0;
|
||||
flex:1;
|
||||
font-size: 17px;
|
||||
border: none!important;
|
||||
border-left:1rpx solid #efefef!important;
|
||||
display: flex;
|
||||
background-color: none!important;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.zhuce{
|
||||
position: absolute;
|
||||
color: rgba(0,0,0,0.65);
|
||||
top:20rpx;
|
||||
right:32rpx;
|
||||
}
|
||||
@@ -0,0 +1,404 @@
|
||||
// pages/mobileLogin/mobileLogin.js
|
||||
import { smsLogin, sendSms,getCaptcha,phoneLogin} from "../../../api/api"
|
||||
const app = getApp();
|
||||
import {auth} from "../../../api/auth.js"
|
||||
import {throttle} from "../../../utils/util"
|
||||
import {base64src} from "../../../utils/base64ToImg"
|
||||
let urlHost=app.hostConfig().agreehost;
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
showSuccess:false,
|
||||
showEntryTip:false,
|
||||
showEntryTip_second:false,
|
||||
show: false,
|
||||
check:false,
|
||||
sms:'',
|
||||
message:'',
|
||||
disabled:true,
|
||||
isActive:false,
|
||||
codeActive:true,
|
||||
imgCode:'',
|
||||
mobile:'',
|
||||
redirecUrl:'',
|
||||
timer:null,
|
||||
time:59,
|
||||
msg:'获取验证码',
|
||||
captchaUuid:'',
|
||||
captchaCode:'',
|
||||
loginDevice:5,
|
||||
smsType:2,
|
||||
img_host:app.hostConfig().imghost
|
||||
},
|
||||
onConfirmEntry(){
|
||||
this.setData({
|
||||
showEntryTip:false
|
||||
})
|
||||
//wx.setStorageSync('hasEntry', true);
|
||||
},
|
||||
onCloseEntry(){
|
||||
this.setData({
|
||||
showEntryTip:true,
|
||||
showEntryTip_second:true
|
||||
})
|
||||
},
|
||||
onConfirmEntry_second(){
|
||||
this.setData({
|
||||
showEntryTip_second:false,
|
||||
});
|
||||
|
||||
},
|
||||
onCloseEntry_second(){
|
||||
wx.exitMiniProgram({success: (res) => {}})
|
||||
this.setData({
|
||||
showEntryTip_second:false,
|
||||
showEntryTip:false,
|
||||
});
|
||||
|
||||
},
|
||||
onConfirmSuccess(){
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
},
|
||||
onCancelSuccess(){
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
},
|
||||
checkboxChange(e) {
|
||||
this.setData({
|
||||
check:e.detail
|
||||
})
|
||||
|
||||
},
|
||||
getPhoneNumber:throttle(function(e) {
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok'){
|
||||
auth().then(res => {
|
||||
phoneLogin('wx415cbcf96f4a3b27',{
|
||||
code:e.detail.code
|
||||
}).then((data)=>{
|
||||
const { envVersion } = wx.getAccountInfoSync().miniProgram;
|
||||
let token=''
|
||||
if(envVersion=="develop" || envVersion=="trial"){
|
||||
token="DEV_CASE_TOKEN"
|
||||
}else{
|
||||
token="PROD_CASE_TOKEN"
|
||||
}
|
||||
wx.setStorageSync(token, data.token);
|
||||
let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index';
|
||||
|
||||
if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1){
|
||||
wx.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}else{
|
||||
wx.reLaunch({
|
||||
url:url
|
||||
})
|
||||
}
|
||||
}).catch(error=>{
|
||||
if(error.code==10007){
|
||||
console.log(error.msg)
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
message:error.msg,
|
||||
mobile:error.data
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
}else if(e.detail.errMsg == 'getPhoneNumber:fail user deny'){
|
||||
console.log('您拒绝手机号授权')
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '手机号授权失败',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
}),
|
||||
onConfirmSuccess(){
|
||||
let {mobile}=this.data;
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/improveInfo/improveInfo?mobile='+mobile
|
||||
})
|
||||
},
|
||||
onCancelSuccess(){
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
},
|
||||
handleAgree(){
|
||||
if(!this.data.check){
|
||||
wx.showToast({
|
||||
title: '请同意《用户服务协议》!',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
};
|
||||
},
|
||||
getUserInfo(event) {
|
||||
this.handlelogin();
|
||||
},
|
||||
onClose() {
|
||||
this.setData({ show: false });
|
||||
},
|
||||
handleThrottle:throttle(function(){
|
||||
this.getCode()
|
||||
}),
|
||||
handleGetCaptcha(){
|
||||
getCaptcha().then(res=>{
|
||||
base64src(res.captchaBase64Image,(img)=>{
|
||||
this.setData({
|
||||
imgCode:img,
|
||||
captchaUuid:res.captchaUuid
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
goPwdLogin:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/pwdLogin/pwdLogin'
|
||||
})
|
||||
}),
|
||||
goRegister:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/register/register'
|
||||
})
|
||||
}),
|
||||
getCode(){
|
||||
let {mobile,captchaCode,captchaUuid,loginDevice,smsType}=this.data;
|
||||
|
||||
if(!/^1[3456789]\d{9}$/.test(mobile)){
|
||||
wx.showToast({
|
||||
title: `请输入有效的手机号码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!captchaCode){
|
||||
wx.showToast({
|
||||
title: `图形验证码不能为空`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
sendSms({
|
||||
mobile,
|
||||
smsType,
|
||||
captchaCode,
|
||||
captchaUuid,
|
||||
loginDevice
|
||||
}).then((res)=>{
|
||||
let timer=setInterval(() => {
|
||||
if (this.data.time == 0) {
|
||||
clearInterval(this.data.timer);
|
||||
this.setData({
|
||||
time:59,
|
||||
msg:'重新获取验证码',
|
||||
isActive:false,
|
||||
codeActive:true,
|
||||
})
|
||||
} else {
|
||||
let msg= this.data.time + " s 后重新发送";
|
||||
this.setData({
|
||||
isActive:true,
|
||||
msg:msg,
|
||||
codeActive:false,
|
||||
})
|
||||
let time=this.data.time--;
|
||||
this.setData({
|
||||
msg:time + " s 后重新发送"
|
||||
})
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
this.setData({
|
||||
timer:timer
|
||||
})
|
||||
|
||||
}).catch(()=>{
|
||||
this.handleGetCaptcha();
|
||||
});
|
||||
|
||||
},
|
||||
goLogin(){
|
||||
let THIS=this;
|
||||
if(!this.data.check){
|
||||
wx.showToast({
|
||||
title: '请同意《肝胆相照用户服务协议》!',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(!/^1[3456789]\d{9}$/.test(this.data.mobile)){
|
||||
wx.showToast({
|
||||
title: `请输入有效的手机号码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!this.data.sms){
|
||||
wx.showToast({
|
||||
title: `请输入验证码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
// 判断它是否为true
|
||||
if (res.authSetting["scope.userInfo"]) {
|
||||
THIS.handlelogin();
|
||||
} else {
|
||||
THIS.setData({
|
||||
show:true
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handlelogin:throttle(function(){
|
||||
let {sms,mobile }=this.data;
|
||||
smsLogin({
|
||||
sms:sms,
|
||||
mobile
|
||||
}).then((data)=>{
|
||||
const { envVersion } = wx.getAccountInfoSync().miniProgram;
|
||||
let token=''
|
||||
if(envVersion=="develop" || envVersion=="trial"){
|
||||
token="DEV_CASE_TOKEN"
|
||||
}else{
|
||||
token="PROD_CASE_TOKEN"
|
||||
}
|
||||
wx.setStorageSync(token, data.token);
|
||||
let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index';
|
||||
if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1 ){
|
||||
wx.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
|
||||
}else{
|
||||
wx.reLaunch({
|
||||
url:url
|
||||
})
|
||||
}
|
||||
}).catch(error=>{
|
||||
if(error.code==10007){
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
message:error.msg,
|
||||
mobile:error.data
|
||||
})
|
||||
}else{
|
||||
this.handleGetCaptcha();
|
||||
}
|
||||
})
|
||||
}),
|
||||
goAgreement:throttle(function(event){
|
||||
app.method.navigateTo({
|
||||
url:"/case/pages/privacy/privacy"
|
||||
})
|
||||
}),
|
||||
inputChange(e){
|
||||
this.setData({
|
||||
[e.target.dataset.id]: e.detail.value
|
||||
});
|
||||
if(e.target.dataset.id=="sms"){
|
||||
if(e.detail.value.trim()){
|
||||
this.setData({
|
||||
disabled: false
|
||||
});
|
||||
}else{
|
||||
this.setData({
|
||||
disabled: true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.handleGetCaptcha();
|
||||
if(options.redirectUrl){
|
||||
this.setData({
|
||||
redirectUrl:"/"+decodeURIComponent(options.redirectUrl)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
wx.getPrivacySetting({
|
||||
success: res => {
|
||||
console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
|
||||
if (res.needAuthorization) {
|
||||
// 需要弹出隐私协议
|
||||
this.setData({
|
||||
showEntryTip:true
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
showEntryTip:false
|
||||
})
|
||||
// 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私
|
||||
}
|
||||
},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
clearInterval(this.data.timer);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
|
||||
})
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navBar":"../../../components/navBar/navBar",
|
||||
"dialog":"../../../components/dialog/dialog",
|
||||
"van-overlay": "@vant/weapp/overlay/index",
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"van-checkbox": "@vant/weapp/checkbox/index",
|
||||
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
|
||||
"nav":"../../../components/navBar/navBar"
|
||||
},
|
||||
"navigationStyle":"custom",
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<!--pages/mobileLogin/mobileLogin.wxml-->
|
||||
<navBar navName="登录" myclass="myclass"></navBar>
|
||||
<view class="page">
|
||||
<!-- <view class="zhuce" bind:tap="goRegister">注册</view> -->
|
||||
<view class="logobox">
|
||||
<image src="../../../static/title_bg.png" class="logobg"></image>
|
||||
<text class="desc">欢迎登录</text>
|
||||
<text class="desc" style="margin-top: 20rpx;">人工肝病例登记系统</text>
|
||||
</view>
|
||||
<view class="iptbox">
|
||||
<view class="iptcell">
|
||||
<!-- <text>+86</text> -->
|
||||
<input type="number" value="{{mobile}}" placeholder="请输入手机号" bindinput="inputChange" data-id="mobile"/>
|
||||
</view>
|
||||
<view class="iptcell">
|
||||
<input type="text" placeholder="请输入图形验证码" class="code" value="{{captchaCode}}" bindinput="inputChange" data-id="captchaCode"/>
|
||||
<image src="{{imgCode}}" mode="aspectFit" class="imgCode" bind:tap="handleGetCaptcha"/>
|
||||
</view>
|
||||
<view class="iptcell">
|
||||
<input type="number" placeholder="请输入短信验证码" class="code" value="{{sms}}" bindinput="inputChange" data-id="sms"/>
|
||||
<button class="{{codeActive?'active':''}}" plain disabled="{{isActive}}" bindtap="handleThrottle">{{msg}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="buttonbox">
|
||||
<view plain="true" hover-class="none" class="btn" disabled="{{disabled}}" bindtap="goLogin">登录</view>
|
||||
|
||||
</view>
|
||||
<view class="type">
|
||||
<view class="mobileLogin" bind:tap="goPwdLogin">密码登录</view>
|
||||
<view class="zhuce" bind:tap="goRegister">注册</view>
|
||||
</view>
|
||||
<view class="wechatbox">
|
||||
<view class="chatmsg">- 手机号快捷登录 -</view>
|
||||
<image src="../../../static/wechat.png" mode="" class="wecaht" bind:tap="handleAgree"/>
|
||||
<button type="primary" class="mobileAuth" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{check}}">手机号快捷登录</button >
|
||||
</view>
|
||||
<!-- <view class="zhuce">注册</view> -->
|
||||
<view class="agree">
|
||||
<van-checkbox value="{{ check }}" bind:change="checkboxChange"></van-checkbox>
|
||||
我已阅读并同意<text class="link" bind:tap="goAgreement">《隐私协议》</text>
|
||||
</view>
|
||||
</view>
|
||||
<dialog showDialog="{{showSuccess}}" bind:confirm="onConfirmSuccess" bind:cancel="onCancelSuccess" title="提示" confirmText="完善" message="{{message}}"></dialog>
|
||||
|
||||
<van-overlay show="{{ showEntryTip }}" zIndex="9999">
|
||||
<view class="wrapper">
|
||||
<view class="privacyBox">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="entrymsg">
|
||||
<view> 亲爱的用户,感谢您信任并使用人工肝病例登录系统!我们依据最新法律法规的要求,制定了<text class="navigator" bindtap="goAgreement" data-id="2">《隐私协议》</text>。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。</view>
|
||||
<view>如您同意《隐私协议》,请点击“同意”开始使用我们的产品和服务。</view>
|
||||
</view>
|
||||
<view class="btnbox_xieyi">
|
||||
<view class="cancel" bindtap="onCloseEntry">不同意</view>
|
||||
<button id="agree-btn"
|
||||
plain
|
||||
class="confirm"
|
||||
open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="onConfirmEntry">同意并继续</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-overlay>
|
||||
|
||||
<van-overlay show="{{ showEntryTip_second }}" zIndex="99999">
|
||||
<view class="wrapper">
|
||||
<view class="privacyBox">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="entrymsg" >
|
||||
<view> 很抱歉,如您不同意《隐私协议》,可能无法继续正常使用我们的服务,请您先同意哦~</view>
|
||||
</view>
|
||||
<view class="btnbox_xieyi">
|
||||
<view class="cancel" bindtap="onCloseEntry_second">不同意</view>
|
||||
<button id="agree-btn"
|
||||
plain
|
||||
class="confirm"
|
||||
bindtap="onConfirmEntry_second">好的</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-overlay>
|
||||
@@ -0,0 +1,304 @@
|
||||
/* pages/mobileLogin/mobileLogin.wxss */
|
||||
.loginbox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
.contain {
|
||||
padding: 0 30rpx 0rpx;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.logo {
|
||||
width: 160rpx;
|
||||
height: 196rpx
|
||||
}
|
||||
|
||||
|
||||
.iptcell {
|
||||
width: 100%;
|
||||
height: 112rpx;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.iptbox {
|
||||
margin-top: 68rpx;
|
||||
}
|
||||
|
||||
.iptcell input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.iptcell text {
|
||||
color: rgba(0, 0, 0, 0.9);
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.iptcell .code {
|
||||
width: 400rpx;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.iptcell button {
|
||||
outline: none;
|
||||
white-space: nowrap;
|
||||
padding: 0 10rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
width: 220rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #3881F7;
|
||||
background-color: transparent;
|
||||
font-size: 26rpx;
|
||||
|
||||
border: none;
|
||||
}
|
||||
|
||||
.iptcell button[disabled] {
|
||||
width: 280rpx !important;
|
||||
}
|
||||
|
||||
/* .iptcell button.active {
|
||||
color: #3CC7C0 !important;
|
||||
border: 1px solid #3CC7C0 !important;
|
||||
} */
|
||||
|
||||
.btnbox {
|
||||
|
||||
margin: 40rpx 47rpx 0;
|
||||
}
|
||||
|
||||
.btnbox button {
|
||||
border: none;
|
||||
outline: none;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
font-size: 36rpx;
|
||||
height: 94rpx;
|
||||
background: #3CC7C0;
|
||||
border-radius: 47rpx;
|
||||
color: #FFFFFF;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: normal;
|
||||
}
|
||||
.btnbox button[disabled]{
|
||||
color: #FFFFFF;
|
||||
background: #8addd9;
|
||||
}
|
||||
.checkbox {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-top: 40rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.checkbox view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.checkbox .check {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.checkbox image {
|
||||
left: 5rpx;
|
||||
top: 4rpx;
|
||||
position: absolute;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.navigator {
|
||||
color: #4384FE;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
background-color: none;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.imgCode{
|
||||
width:200rpx;
|
||||
height:75.6rpx;
|
||||
}
|
||||
page{
|
||||
background-image: linear-gradient( #cdf0ff,#fff 40%);
|
||||
}
|
||||
.myclass{
|
||||
background-color: transparent!important;
|
||||
}
|
||||
.page{
|
||||
position: relative;
|
||||
flex:1;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
margin-top: 172rpx;
|
||||
}
|
||||
.logobox{display: flex;flex-direction: column;margin: 40rpx 47rpx 0;position: relative;}
|
||||
.logobox .desc{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top: 22rpx;
|
||||
font-size: 48rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(0,0,0,0.85);
|
||||
}
|
||||
.logobg{
|
||||
left:90rpx;
|
||||
top:76rpx;
|
||||
z-index:0;
|
||||
position: absolute;
|
||||
width:228rpx;
|
||||
height:22rpx;
|
||||
}
|
||||
.iptbox{
|
||||
margin:70rpx 47rpx 0;
|
||||
}
|
||||
.buttonbox{
|
||||
margin:64rpx 47rpx 0;
|
||||
}
|
||||
.btn{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.iptcell {
|
||||
width: 100%;
|
||||
height: 112rpx;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.type{
|
||||
margin:24rpx 47rpx 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.mobileLogin,.zhuce{
|
||||
font-size: 28rpx;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.65);
|
||||
}
|
||||
.wechatbox{
|
||||
flex:1;
|
||||
position: relative;
|
||||
margin:44rpx 47rpx 100rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chatmsg{
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.45);
|
||||
}
|
||||
.wecaht{
|
||||
margin-top: 42rpx;
|
||||
width:88rpx;
|
||||
height:88rpx;
|
||||
}
|
||||
|
||||
.agree{
|
||||
position: absolute;
|
||||
bottom:40rpx;
|
||||
margin:54rpx 47rpx 0;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: rgba(0,0,0,0.65);
|
||||
}
|
||||
.link{
|
||||
color:#3881F7
|
||||
}
|
||||
.mobileAuth{
|
||||
top:50%;
|
||||
left:50%;
|
||||
margin-top: -10rpx;
|
||||
transform: translate(-50%);
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
.wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
.privacyBox {
|
||||
width:90%;
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
.privacyBox .title{
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
line-height:24px;
|
||||
padding-top:24px;
|
||||
text-align: center;
|
||||
font-size:16px;
|
||||
}
|
||||
.privacyBox .btnbox_xieyi{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top:1rpx solid #efefef;
|
||||
width:100%;
|
||||
font-size: 17px;
|
||||
}
|
||||
.privacyBox .btnbox_xieyi .cancel{
|
||||
flex:1;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.privacyBox .btnbox_xieyi .confirm{
|
||||
margin: 0;
|
||||
height: 50px;
|
||||
padding: 0;
|
||||
color: #3881F7;
|
||||
flex:1;
|
||||
font-size: 17px;
|
||||
border: none!important;
|
||||
border-left:1rpx solid #efefef!important;
|
||||
display: flex;
|
||||
background-color: none!important;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.entrymsg{
|
||||
-webkit-overflow-scrolling: touch;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
padding: 48rpx;
|
||||
text-align: left;
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
import utils from "../../utils/utils";
|
||||
// painting-2.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
hasChoosedImg: false,
|
||||
canvasWidth: 0,
|
||||
canvasHeight: 0, // canvas的完整高度
|
||||
canvasHeightLen: 0, // canvas的临时高度(用在操作栏影响画布高度时)
|
||||
windowHeight: 0, // 屏幕高度
|
||||
prevPosition: [0, 0], // 手指触摸的所在位置
|
||||
background: '', // 背景图片,即导入的图片
|
||||
|
||||
btnInfo: [
|
||||
{
|
||||
type: 'width',
|
||||
background: 'url("http://ov8a2tdri.bkt.clouddn.com/wx-app/icon-1.png"); background-size: 30px 30px;'
|
||||
},
|
||||
{
|
||||
type: 'color',
|
||||
background: 'url("http://ov8a2tdri.bkt.clouddn.com/wx-app/icon-2.png") white no-repeat; background-size: 24px 24px;background-position: 3px 3px;'
|
||||
},
|
||||
{
|
||||
type: 'clear',
|
||||
background: 'url("http://img0.imgtn.bdimg.com/it/u=1358545290,3102156418&fm=26&gp=0.jpg") white no-repeat; background-size: 20px 20px;background-position: 5px 5px;'
|
||||
},
|
||||
{
|
||||
type: 'save',
|
||||
background: 'url("http://ov8a2tdri.bkt.clouddn.com/wx-app/icon-6.png") white no-repeat; background-size: 20px 20px;background-position: 5px 5px;'
|
||||
}
|
||||
],
|
||||
width: false, // 是否开启宽度调整栏
|
||||
color: false, // 是否开启颜色调整栏
|
||||
r: 33,
|
||||
g: 33,
|
||||
b: 33,
|
||||
w: 10,
|
||||
clear: false, // 是否开启清空栏
|
||||
eraser: false, // 是否开启橡皮擦
|
||||
saving: false, // 是否在保存状态
|
||||
scope: false, // 是否有保存图片的权限
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
let that = this;
|
||||
// 获取设备信息,canvas高度用
|
||||
wx.getSystemInfo({
|
||||
success: function(res) {
|
||||
console.log(res);
|
||||
that.setData({
|
||||
canvasWidth: res.windowWidth,
|
||||
canvasHeight: res.windowHeight - 50,
|
||||
windowHeight: res.windowHeight
|
||||
})
|
||||
},
|
||||
})
|
||||
// 选照片
|
||||
this.chooseImg();
|
||||
// 检查权限,保存时提示弹窗用
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (res.authSetting['scope.writePhotosAlbum']) {
|
||||
that.setData({
|
||||
scope: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
tapBtn: function (e) {
|
||||
utils.tapBtn(e, this, 2);
|
||||
},
|
||||
|
||||
addImg: function (e) {
|
||||
this.chooseImg();
|
||||
},
|
||||
|
||||
chooseImg() {
|
||||
let that = this;
|
||||
wx.chooseImage({
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
hasChoosedImg: true,
|
||||
})
|
||||
wx.getImageInfo({
|
||||
src: res.tempFilePaths[0],
|
||||
success: function (res) {
|
||||
// 获取图片信息,主要为宽高,选择合适的自适应方式(将最大边完整显示)
|
||||
let [height, width] = [that.data.canvasWidth / res.width * res.height, that.data.canvasWidth];
|
||||
if (height > that.data.windowHeight - 50) {
|
||||
height = that.data.windowHeight - 50;
|
||||
width = height / res.height * res.width;
|
||||
}
|
||||
that.setData({
|
||||
canvasHeight: height,
|
||||
canvasWidth: width,
|
||||
background: res.path
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log(res);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
touchStart: function (e) {
|
||||
// 开始画图,隐藏所有的操作栏
|
||||
this.setData({
|
||||
prevPosition: [e.touches[0].x, e.touches[0].y],
|
||||
width: false,
|
||||
color: false,
|
||||
canvasHeightLen: 0
|
||||
})
|
||||
},
|
||||
|
||||
touchMove: function (e) {
|
||||
// 触摸移动,绘制中。。。
|
||||
let ctx = wx.createCanvasContext('myCanvas');
|
||||
|
||||
if (this.data.eraser) {
|
||||
ctx.clearRect(e.touches[0].x, e.touches[0].y, 30, 30);
|
||||
ctx.draw(true);
|
||||
} else {
|
||||
ctx.setStrokeStyle("rgb(" + this.data.r + ', ' + this.data.g + ', ' + this.data.b + ')');
|
||||
ctx.setLineWidth(this.data.w);
|
||||
ctx.setLineCap('round');
|
||||
ctx.setLineJoin('round');
|
||||
ctx.moveTo(this.data.prevPosition[0], this.data.prevPosition[1]);
|
||||
ctx.lineTo(e.touches[0].x, e.touches[0].y);
|
||||
ctx.stroke();
|
||||
ctx.draw(true);
|
||||
}
|
||||
|
||||
this.setData({
|
||||
prevPosition: [e.touches[0].x, e.touches[0].y]
|
||||
})
|
||||
},
|
||||
|
||||
clearCanvas: function () {
|
||||
let ctx = wx.createCanvasContext('myCanvas');
|
||||
ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight);
|
||||
ctx.draw();
|
||||
this.setData({
|
||||
clear: false,
|
||||
canvasHeightLen: 0
|
||||
})
|
||||
},
|
||||
|
||||
chooseEraser: function () {
|
||||
this.setData({
|
||||
eraser: !this.data.eraser,
|
||||
clear: false,
|
||||
canvasHeightLen: 0
|
||||
})
|
||||
},
|
||||
|
||||
changeColor: function (e) {
|
||||
utils.changeColor(e, this);
|
||||
},
|
||||
|
||||
changeWidth: function (e) {
|
||||
utils.changeWidth(e, this, (this.data.canvasHeightLen + this.data.w - e.detail.value), 2);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "涂鸦",
|
||||
"navigationBarBackgroundColor": "#9cf",
|
||||
"navigationBarTextStyle": "white",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<!--painting-2.wxml-->
|
||||
<canvas canvas-id="myCanvas" disable-scroll="true" bindtouchstart="touchStart"
|
||||
bindtouchmove="touchMove" bindtouchend="touchEnd" wx:if="{{hasChoosedImg}}"
|
||||
style="height: {{(canvasHeightLen == 0) ? canvasHeight : canvasHeightLen}}px; width: {{canvasWidth}}px; background: url('{{background}}');background-position: 0 0; background-size: {{canvasWidth}}px {{canvasHeight}}px"
|
||||
/>
|
||||
<view class="failText" wx:if="{{!hasChoosedImg}}" bindtap="addImg">没有选择照片,点击重新选择</view>
|
||||
<view class="bottom">
|
||||
<block wx:for="{{btnInfo}}" wx:key="{{index}}">
|
||||
<view class="list-item" data-type="{{item.type}}" style="background: {{item.background}}" bindtap="tapBtn"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="choose-box" wx:if="{{width}}">
|
||||
<view class="color-box" style="background: {{'rgb(' + r + ', ' + g + ', ' + b + ')'}}; height: {{w}}px; border-radius: {{w/2}}px"></view>
|
||||
<slider min="1" max="50" step="1" show-value="true" value="{{w}}" bindchange="changeWidth"/>
|
||||
</view>
|
||||
<view class="choose-box" wx:if="{{color}}">
|
||||
<view class="color-box" style="background: {{'rgb(' + r + ', ' + g + ', ' + b + ')'}}; height: {{w}}px; border-radius: {{w/2}}px"></view>
|
||||
<slider min="0" max="255" step="1" show-value="true" activeColor="red" value="{{r}}" data-color="r" bindchange="changeColor"/>
|
||||
<slider min="0" max="255" step="1" show-value="true" activeColor="green" value="{{g}}" data-color="g" bindchange="changeColor"/>
|
||||
<slider min="0" max="255" step="1" show-value="true" activeColor="blue" value="{{b}}" data-color="b" bindchange="changeColor"/>
|
||||
</view>
|
||||
<view class="choose-box-flex" wx:if="{{clear}}">
|
||||
<view class="choose-item" bindtap="chooseEraser">
|
||||
<view class="choose-img" style='background: url("http://ov8a2tdri.bkt.clouddn.com/wx-app/icon-5.png") white no-repeat; background-size: 26px 26px;background-position: 2px 2px; border: {{eraser ? "2px solid #888" : "2px solid transparent"}}'></view>
|
||||
<view>橡皮擦</view>
|
||||
</view>
|
||||
<view class="choose-item" bindtap="clearCanvas">
|
||||
<view class="choose-img" style='background: url("http://ov8a2tdri.bkt.clouddn.com/wx-app/icon-4.png") white no-repeat; background-size: 26px 26px;background-position: 2px 2px;'></view>
|
||||
<view>清空</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,59 @@
|
||||
/* case/pages/paintCanvas/paintCanvas.wxss *//* painting-2.wxss */
|
||||
page {
|
||||
background: rgba(153, 204, 255, 0.1);
|
||||
}
|
||||
|
||||
.failText {
|
||||
margin-top: 200rpx;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 750rpx;
|
||||
height: 100rpx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin: 20rpx 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.choose-box {
|
||||
width: 750rpx;
|
||||
position: absolute;
|
||||
bottom: 100rpx;
|
||||
}
|
||||
|
||||
.color-box {
|
||||
width: 375rpx;
|
||||
margin: 40rpx auto;
|
||||
}
|
||||
|
||||
slider {
|
||||
margin: 40rpx 60rpx;
|
||||
}
|
||||
|
||||
.choose-box-flex {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 750rpx;
|
||||
position: absolute;
|
||||
bottom: 100rpx;
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
.choose-img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
background: white;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// case/pages/privacy/privacy.js
|
||||
import {getPrivacy} from "../../../api/api"
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
navName:'隐私协议',
|
||||
node:''
|
||||
},
|
||||
handleGetPrivacy(){
|
||||
getPrivacy().then(res=>{
|
||||
this.setData({
|
||||
node:res
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.handleGetPrivacy();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navBar":"../../../components/navBar/navBar"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!--case/pages/privacy/privacy.wxml-->
|
||||
<!--case/pages/agreement/agreement.wxml-->
|
||||
<navBar navName="{{navName}}"></navBar>
|
||||
<view class="page">
|
||||
|
||||
<view class="con">
|
||||
<rich-text nodes="{{node}}"></rich-text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -0,0 +1,15 @@
|
||||
/* case/pages/privacy/privacy.wxss */
|
||||
/* case/pages/agreement/agreement.wxss */
|
||||
.page{
|
||||
background: #fff;
|
||||
flex:1;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
margin-top: 172rpx;
|
||||
}
|
||||
.con{
|
||||
flex:1;
|
||||
padding:10rpx 32rpx 0;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
// case/pages/pwdLogin/pwdLogin.js
|
||||
const app = getApp()
|
||||
import {phoneLogin,getCaptcha,pwdLogin} from "../../../api/api"
|
||||
import {auth} from "../../../api/auth.js"
|
||||
import {throttle} from "../../../utils/util"
|
||||
import {base64src} from "../../../utils/base64ToImg"
|
||||
let urlHost=app.hostConfig().agreehost;
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
checked:false,
|
||||
mobile:'',
|
||||
pwd:'',
|
||||
loginDevice:5,
|
||||
showSuccess:false,
|
||||
redirecUrl:'',
|
||||
imgCode:'',
|
||||
captchaUuid:'',
|
||||
captchaCode:'',
|
||||
},
|
||||
inputChange(e){
|
||||
this.setData({
|
||||
[e.target.dataset.id]: e.detail.value
|
||||
});
|
||||
},
|
||||
goAgreement:throttle(function(event){
|
||||
app.method.navigateTo({
|
||||
url:"/case/pages/privacy/privacy"
|
||||
})
|
||||
}),
|
||||
goRegister:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/register/register'
|
||||
})
|
||||
}),
|
||||
handleGetCaptcha(){
|
||||
getCaptcha().then(res=>{
|
||||
base64src(res.captchaBase64Image,(img)=>{
|
||||
this.setData({
|
||||
imgCode:img,
|
||||
captchaUuid:res.captchaUuid
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
handlePwdLogin:throttle(function(){
|
||||
let {mobile,pwd,loginDevice,captchaUuid,captchaCode,checked}=this.data;
|
||||
if(!checked){
|
||||
wx.showToast({
|
||||
title: '请同意《用户服务协议》!',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(!captchaCode){
|
||||
wx.showToast({
|
||||
title: '请输入图形验证码',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!pwd){
|
||||
wx.showToast({
|
||||
title: '请输入密码',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
pwdLogin({
|
||||
mobile,
|
||||
pwd,
|
||||
loginDevice,
|
||||
captchaUuid,
|
||||
captchaCode
|
||||
|
||||
}).then(data=>{
|
||||
const { envVersion } = wx.getAccountInfoSync().miniProgram;
|
||||
let token=''
|
||||
if(envVersion=="develop" || envVersion=="trial"){
|
||||
token="DEV_CASE_TOKEN"
|
||||
}else{
|
||||
token="PROD_CASE_TOKEN"
|
||||
}
|
||||
wx.setStorageSync(token, data.token);
|
||||
let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index';
|
||||
|
||||
if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1){
|
||||
wx.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}else{
|
||||
wx.reLaunch({
|
||||
url:url
|
||||
})
|
||||
}
|
||||
}).catch(error=>{
|
||||
if(error.code==10007){
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
message:error.msg,
|
||||
mobile:error.data
|
||||
})
|
||||
}else{
|
||||
this.handleGetCaptcha();
|
||||
}
|
||||
})
|
||||
}),
|
||||
getPhoneNumber:throttle(function(e) {
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok'){
|
||||
auth().then(res => {
|
||||
phoneLogin('wx415cbcf96f4a3b27',{
|
||||
code:e.detail.code
|
||||
}).then((data)=>{
|
||||
const { envVersion } = wx.getAccountInfoSync().miniProgram;
|
||||
let token=''
|
||||
if(envVersion=="develop" || envVersion=="trial"){
|
||||
token="DEV_CASE_TOKEN"
|
||||
}else{
|
||||
token="PROD_CASE_TOKEN"
|
||||
}
|
||||
wx.setStorageSync(token, data.token);
|
||||
let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index';
|
||||
|
||||
if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1){
|
||||
wx.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}else{
|
||||
wx.reLaunch({
|
||||
url:url
|
||||
})
|
||||
}
|
||||
}).catch(error=>{
|
||||
if(error.code==10007){
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
message:error.msg,
|
||||
mobile:error.data
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
}else if(e.detail.errMsg == 'getPhoneNumber:fail user deny'){
|
||||
console.log('您拒绝手机号授权')
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '手机号授权失败',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
}),
|
||||
onConfirmSuccess(){
|
||||
let {mobile}=this.data;
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/improveInfo/improveInfo?mobile='+mobile
|
||||
})
|
||||
},
|
||||
onCancelSuccess(){
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
},
|
||||
goMobile(){
|
||||
let url='/case/pages/mobileLogin/mobileLogin';
|
||||
let redirectUrl=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index';
|
||||
app.method.navigateTo({
|
||||
url: url+"?redirectUrl="+encodeURIComponent(redirectUrl)
|
||||
})
|
||||
},
|
||||
|
||||
handleAgree(){
|
||||
if(!this.data.checked){
|
||||
wx.showToast({
|
||||
title: '请同意《用户服务协议》!',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
};
|
||||
},
|
||||
onChange(event) {
|
||||
this.setData({
|
||||
checked: event.detail,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if(options.redirectUrl){
|
||||
if(options.redirectUrl){
|
||||
this.setData({
|
||||
redirectUrl:decodeURIComponent(options.redirectUrl)
|
||||
})
|
||||
};
|
||||
//console.log(decodeURIComponent(options.redirectUrl))
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.handleGetCaptcha();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
// onShareAppMessage() {
|
||||
|
||||
// }
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"dialog":"../../../components/dialog/dialog",
|
||||
"navBar":"../../../components/navBar/navBar",
|
||||
"van-checkbox": "@vant/weapp/checkbox/index",
|
||||
"van-checkbox-group": "@vant/weapp/checkbox-group/index"
|
||||
},
|
||||
"navigationStyle":"custom",
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<!--case/pages/pwdLogin/pwdLogin.wxml-->
|
||||
<navBar navName="登录" myclass="myclass"></navBar>
|
||||
<view class="page">
|
||||
<view class="logobox">
|
||||
<image src="../../../static/title_bg.png" class="logobg"></image>
|
||||
<text class="desc">欢迎登录</text>
|
||||
<text class="desc" style="margin-top: 20rpx;">人工肝病例登记系统</text>
|
||||
</view>
|
||||
<view class="iptbox">
|
||||
<view class="iptcell">
|
||||
<input type="text" placeholder="请输入手机号" value="{{mobile}}" data-id="mobile" bindinput="inputChange"/>
|
||||
</view>
|
||||
<view class="iptcell">
|
||||
<input type="text" placeholder="请输入图形验证码" class="code" value="{{captchaCode}}" bindinput="inputChange" data-id="captchaCode"/>
|
||||
<image src="{{imgCode}}" mode="aspectFit" class="imgCode" bind:tap="handleGetCaptcha"/>
|
||||
</view>
|
||||
<view class="iptcell">
|
||||
<input type="text" bindinput="inputChange" placeholder="请输入密码" value="{{pwd}}" data-id="pwd"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="buttonbox">
|
||||
<view class="btn" bind:tap="handlePwdLogin">登录</view>
|
||||
</view>
|
||||
<view class="type">
|
||||
<view class="mobileLogin" bind:tap="goMobile">手机验证码登录</view>
|
||||
<view class="zhuce" bind:tap="goRegister">注册</view>
|
||||
</view>
|
||||
<view class="wechatbox">
|
||||
<view class="chatmsg">- 手机号快捷登录 -</view>
|
||||
<image src="../../../static/wechat.png" mode="" class="wecaht" bind:tap="handleAgree"/>
|
||||
<button type="primary" class="mobileAuth" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{checked}}">手机号快捷登录</button >
|
||||
</view>
|
||||
<view class="agree">
|
||||
<van-checkbox value="{{ checked }}" bind:change="onChange"></van-checkbox>
|
||||
我已阅读并同意<text class="link" bind:tap="goAgreement">《隐私协议》</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<dialog showDialog="{{showSuccess}}" bind:confirm="onConfirmSuccess" bind:cancel="onCancelSuccess" title="提示" confirmText="完善" message="{{message}}"></dialog>
|
||||
@@ -0,0 +1,120 @@
|
||||
/* case/pages/pwdLogin/pwdLogin.wxss */
|
||||
page{
|
||||
background-image: linear-gradient( #cdf0ff,#fff 40%);
|
||||
}
|
||||
.myclass{
|
||||
background-color: transparent!important;
|
||||
}
|
||||
.page{
|
||||
position: relative;
|
||||
flex:1;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
margin-top: 172rpx;
|
||||
}
|
||||
.logobox{display: flex;flex-direction: column;margin:40rpx 47rpx 0;position: relative;}
|
||||
.logobox .desc{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top: 22rpx;
|
||||
font-size: 48rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(0,0,0,0.85);
|
||||
}
|
||||
.logobg{
|
||||
left:90rpx;
|
||||
top:76rpx;
|
||||
z-index:0;
|
||||
position: absolute;
|
||||
width:228rpx;
|
||||
height:22rpx;
|
||||
}
|
||||
.iptbox{
|
||||
margin:70rpx 47rpx 0;
|
||||
}
|
||||
.buttonbox{
|
||||
margin:64rpx 47rpx 0;
|
||||
}
|
||||
.btn{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%);
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.iptcell {
|
||||
width: 100%;
|
||||
height: 112rpx;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.imgCode{
|
||||
width:200rpx;
|
||||
height:75.6rpx;
|
||||
}
|
||||
.iptcell .code {
|
||||
width: 400rpx;
|
||||
margin-left: 0;
|
||||
}
|
||||
.type{
|
||||
margin:24rpx 47rpx 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.mobileLogin,.zhuce{
|
||||
font-size: 28rpx;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.65);
|
||||
}
|
||||
.wechatbox{
|
||||
flex:1;
|
||||
position: relative;
|
||||
margin:44rpx 47rpx 100rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chatmsg{
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.45);
|
||||
}
|
||||
.wecaht{
|
||||
margin-top: 42rpx;
|
||||
width:88rpx;
|
||||
height:88rpx;
|
||||
}
|
||||
|
||||
.agree{
|
||||
position: absolute;
|
||||
bottom:40rpx;
|
||||
margin:54rpx 47rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.65);
|
||||
}
|
||||
.link{
|
||||
color:#3881F7
|
||||
}
|
||||
.mobileAuth{
|
||||
top:50%;
|
||||
left:50%;
|
||||
margin-top: -10rpx;
|
||||
transform: translate(-50%);
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
@@ -0,0 +1,533 @@
|
||||
// case/pages/register/register.js
|
||||
import {throttle} from "../../../utils/util"
|
||||
import {hostConfig} from "../../../utils/config"
|
||||
import {getArea,getHospital,getOfficeList,getPosition,smsRegister,sendSms,getCaptcha} from "../../../api/api"
|
||||
import {base64src} from "../../../utils/base64ToImg"
|
||||
const host=hostConfig().host;
|
||||
const app=getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
showImprove:false,
|
||||
showSuccess:false,
|
||||
img_host:app.hostConfig().imghost,
|
||||
showArea:false,
|
||||
areaColumns:[
|
||||
{
|
||||
values: [1,2],
|
||||
className: 'column1',
|
||||
},
|
||||
{
|
||||
values: [3,4],
|
||||
className: 'column2',
|
||||
defaultIndex: 0
|
||||
},
|
||||
],
|
||||
hospitalColumns:[],
|
||||
officeColumns:[],
|
||||
positionColumns:[],
|
||||
showHospital:false,
|
||||
showOffice:false,
|
||||
showPosition:false,
|
||||
showNext:false,
|
||||
fileList:[],
|
||||
disabled:false,
|
||||
county_id:'',
|
||||
hospital_name:'',
|
||||
hospital_uuid:'',
|
||||
mobile:'',
|
||||
name:'',
|
||||
office_name:'',
|
||||
office_uuid:'',
|
||||
password:'',
|
||||
position_uuid:'',
|
||||
certificate:'',
|
||||
certificate_img:'',
|
||||
codeActive:true,
|
||||
msg:'获取验证码',
|
||||
captchaUuid:'',
|
||||
captchaCode:'',
|
||||
loginDevice:5,
|
||||
imgCode:'',
|
||||
sms:'',
|
||||
timer:null,
|
||||
time:59,
|
||||
smsType:1,
|
||||
showCrop:false,
|
||||
width: 250, //宽度
|
||||
height: 250, //高度
|
||||
max_width: 300,
|
||||
max_height: 300,
|
||||
disable_rotate: true, //是否禁用旋转
|
||||
disable_ratio: false, //锁定比例
|
||||
limit_move: true, //是否限制移动
|
||||
},
|
||||
closeCrop(){
|
||||
this.setData({
|
||||
showCrop:false
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.setData({
|
||||
showCrop:false
|
||||
})
|
||||
this.cropper.getImg((obj) => {
|
||||
this.uploadImg(obj)
|
||||
});
|
||||
},
|
||||
cropperload(e) {
|
||||
console.log('cropper加载完成');
|
||||
},
|
||||
initCrop(options){
|
||||
|
||||
this.cropper = this.selectComponent("#image-cropper");
|
||||
|
||||
|
||||
|
||||
if(options.imgSrc){
|
||||
this.setData({
|
||||
src: options.imgSrc
|
||||
});
|
||||
}
|
||||
|
||||
// if(!options.imgSrc){
|
||||
// this.cropper.upload(); //上传图片
|
||||
// }
|
||||
},
|
||||
loadimage(e) {
|
||||
this.cropper.imgReset();
|
||||
},
|
||||
onConfirmSuccess(){
|
||||
this.setData({
|
||||
showSuccess:false
|
||||
})
|
||||
app.method.navigateTo({
|
||||
url:"/case/pages/mobileLogin/mobileLogin"
|
||||
})
|
||||
},
|
||||
opeArea(){
|
||||
this.setData({
|
||||
showArea:true
|
||||
})
|
||||
},
|
||||
openOffice(){
|
||||
this.setData({
|
||||
showOffice:true,
|
||||
})
|
||||
},
|
||||
openPosition(){
|
||||
this.setData({
|
||||
showPosition:true,
|
||||
})
|
||||
},
|
||||
onChange(e){
|
||||
const {value} = e.detail;
|
||||
|
||||
const {id}=e.currentTarget.dataset;
|
||||
// console.log(value,id)
|
||||
this.setData({
|
||||
[id]: value
|
||||
});
|
||||
},
|
||||
onChangeArea(event){
|
||||
const { picker, value, index } = event.detail;
|
||||
const provinceId=value[0].id;
|
||||
this.handleGetArea(provinceId)
|
||||
},
|
||||
confirmArea(event){
|
||||
const {value} = event.detail;
|
||||
const countyId=value[1].id;
|
||||
this.setData({
|
||||
county_id:countyId,
|
||||
showArea:false
|
||||
});
|
||||
this.handleGetHospital(countyId)
|
||||
},
|
||||
cancelArea(){
|
||||
this.setData({
|
||||
showArea:false
|
||||
})
|
||||
},
|
||||
confirmHospital(event){
|
||||
let {value}=event.detail;
|
||||
this.setData({
|
||||
showHospital:false,
|
||||
hospital_uuid:value.uuid,
|
||||
hospital_name:value.name
|
||||
})
|
||||
},
|
||||
cancelHospital(){
|
||||
this.setData({
|
||||
showHospital:false
|
||||
})
|
||||
},
|
||||
confirmOffice(event){
|
||||
let {value}=event.detail;
|
||||
|
||||
this.setData({
|
||||
office_name:value.officeName,
|
||||
office_uuid:value.officeUuid,
|
||||
showOffice:false
|
||||
})
|
||||
},
|
||||
cancelOffice(){
|
||||
this.setData({
|
||||
showOffice:false
|
||||
})
|
||||
},
|
||||
confirmPosition(event){
|
||||
let {value}=event.detail;
|
||||
this.setData({
|
||||
position_uuid:value.uuid,
|
||||
position_name:value.name,
|
||||
showPosition:false
|
||||
})
|
||||
},
|
||||
cancelPosition(){
|
||||
this.setData({
|
||||
showPosition:false
|
||||
})
|
||||
},
|
||||
goNext(){
|
||||
let {mobile,sms,password,captchaCode}=this.data;
|
||||
if(!/^1[3456789]\d{9}$/.test(mobile)){
|
||||
wx.showToast({
|
||||
title: `请输入有效的手机号码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!captchaCode){
|
||||
wx.showToast({
|
||||
title: `请输入图形验证码`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!sms){
|
||||
wx.showToast({
|
||||
title: `请输入短信验证码`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/.test(password))){
|
||||
wx.showToast({
|
||||
title: `请输入6-16位字母、数字组合密码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
showNext:true
|
||||
})
|
||||
},
|
||||
showNext(){
|
||||
this.setData({
|
||||
showNext:false
|
||||
})
|
||||
},
|
||||
handleGetArea(id){
|
||||
getArea({
|
||||
parent:id
|
||||
}).then(res=>{
|
||||
if(id){
|
||||
let obj='areaColumns[1].values';
|
||||
this.setData({
|
||||
[obj]:res
|
||||
})
|
||||
}else{
|
||||
let obj='areaColumns[0].values';
|
||||
this.setData({
|
||||
[obj]:res
|
||||
})
|
||||
this.handleGetArea(res[0].id)
|
||||
}
|
||||
|
||||
}).catch(error=>{
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
handleGetHospital(countyId){
|
||||
getHospital(countyId).then(res=>{
|
||||
this.setData({
|
||||
showHospital:true,
|
||||
hospitalColumns:res.concat({uuid:1,name:'其他医院'})
|
||||
})
|
||||
})
|
||||
},
|
||||
handleGetOffice(){
|
||||
getOfficeList({}).then(res=>{
|
||||
this.setData({
|
||||
officeColumns:res
|
||||
})
|
||||
}).catch(error=>{
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
handleGetPosition(){
|
||||
getPosition().then(res=>{
|
||||
this.setData({
|
||||
positionColumns:res
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSmsRegister:throttle(function(){
|
||||
let {mobile,name,sms,password,captchaCode,hospital_uuid,hospital_name,office_name,office_uuid,position_uuid,certificate,certificate_img,county_id}=this.data;
|
||||
if(!/^1[3456789]\d{9}$/.test(mobile)){
|
||||
wx.showToast({
|
||||
title: `请输入有效的手机号码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!captchaCode){
|
||||
wx.showToast({
|
||||
title: `请输入图形验证码`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!sms){
|
||||
wx.showToast({
|
||||
title: `请输入短信验证码`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/.test(password))){
|
||||
wx.showToast({
|
||||
title: `请输入6-16位字母、数字组合密码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!(/^[\u4E00-\u9FA5·]{2,20}$/.test(name))){
|
||||
wx.showToast({
|
||||
title: `请输入您的真实姓名`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!hospital_uuid){
|
||||
wx.showToast({
|
||||
title: `请选择医院`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!office_uuid){
|
||||
wx.showToast({
|
||||
title: `请选择科室`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!position_uuid){
|
||||
wx.showToast({
|
||||
title: `请选择职称`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!certificate_img){
|
||||
wx.showToast({
|
||||
title: `请上传执业医师资格证或工作胸牌`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
smsRegister({
|
||||
mobile,
|
||||
name,
|
||||
sms,
|
||||
password,
|
||||
hospital_uuid,
|
||||
hospital_name,
|
||||
office_name,
|
||||
office_uuid,
|
||||
county_id,
|
||||
position_uuid,
|
||||
certificate,
|
||||
certificate_img
|
||||
}).then(res=>{
|
||||
this.setData({
|
||||
showSuccess:true,
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}),
|
||||
handleThrottle:throttle(function(){
|
||||
this.getCode()
|
||||
}),
|
||||
handleGetCaptcha(){
|
||||
getCaptcha().then(res=>{
|
||||
base64src(res.captchaBase64Image,(img)=>{
|
||||
this.setData({
|
||||
imgCode:img,
|
||||
captchaUuid:res.captchaUuid
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
getCode(){
|
||||
if(this.data.disabled)return;
|
||||
let {mobile,captchaCode,captchaUuid,loginDevice,smsType}=this.data;
|
||||
if(!/^1[3456789]\d{9}$/.test(mobile)){
|
||||
wx.showToast({
|
||||
title: `请输入有效的手机号码!`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(!captchaCode){
|
||||
wx.showToast({
|
||||
title: `图形验证码不能为空`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
sendSms({
|
||||
mobile,
|
||||
captchaCode,
|
||||
captchaUuid,
|
||||
smsType,
|
||||
loginDevice
|
||||
}).then((res)=>{
|
||||
let timer=setInterval(() => {
|
||||
if (this.data.time == 0) {
|
||||
clearInterval(this.data.timer);
|
||||
this.setData({
|
||||
time:59,
|
||||
msg:'重新获取验证码',
|
||||
disabled:false,
|
||||
codeActive:true,
|
||||
})
|
||||
} else {
|
||||
let msg= this.data.time + " s 后重新发送";
|
||||
this.setData({
|
||||
disabled:true,
|
||||
msg:msg,
|
||||
codeActive:false,
|
||||
})
|
||||
let time=this.data.time--;
|
||||
this.setData({
|
||||
msg:time + " s 后重新发送"
|
||||
})
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
this.setData({
|
||||
timer:timer
|
||||
})
|
||||
}).catch(()=>{
|
||||
this.handleGetCaptcha();
|
||||
});
|
||||
|
||||
},
|
||||
uploadImg(file){
|
||||
let THIS=this;
|
||||
wx.showLoading({
|
||||
title: '图片上传中',
|
||||
mask: true
|
||||
})
|
||||
|
||||
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
wx.uploadFile({
|
||||
url: host+'/user/uoloadImg', // 仅为示例,非真实的接口地址
|
||||
filePath: file.url,
|
||||
name: 'file',
|
||||
formData: file,
|
||||
success(res) {
|
||||
let result=JSON.parse(res.data);
|
||||
wx.hideLoading();
|
||||
if(result.code==200){
|
||||
THIS.setData({
|
||||
certificate_img:result.data
|
||||
});
|
||||
}else{
|
||||
wx.showToast({
|
||||
title:result.msg,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
complete(res){
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
},
|
||||
afterRead(event) {
|
||||
const {
|
||||
file
|
||||
} = event.detail;
|
||||
this.setData({
|
||||
showCrop:true,
|
||||
src:file.url
|
||||
})
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.handleGetCaptcha();
|
||||
this.handleGetArea('');
|
||||
this.handleGetOffice();
|
||||
this.handleGetPosition();
|
||||
this.initCrop(options);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
// onShareAppMessage() {
|
||||
|
||||
// }
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-overlay": "@vant/weapp/overlay/index",
|
||||
"image-cropper": "../../../components/image-cropper/image-cropper",
|
||||
"dialog":"../../../components/dialog/dialog",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-picker": "@vant/weapp/picker/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-cell": "@vant/weapp/cell/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-image": "@vant/weapp/image/index",
|
||||
"van-uploader": "@vant/weapp/uploader/index",
|
||||
"van-cell-group": "@vant/weapp/cell-group/index"
|
||||
|
||||
},
|
||||
"navigationBarTitleText": "注册"
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<!--case/pages/register/register.wxml-->
|
||||
<view class="page">
|
||||
<view class="step" hidden="{{showNext}}">
|
||||
<van-cell-group >
|
||||
<van-field value="{{ mobile }}" label="手机号" placeholder="请输入手机号" bind:change="onChange" extra-event-params data-id="mobile" placeholder-style="color:#999;font-size:15px" />
|
||||
<van-field
|
||||
placeholder-style="color:#999;font-size:15px"
|
||||
value="{{ captchaCode }}"
|
||||
bind:change="onChange"
|
||||
data-id="captchaCode"
|
||||
label="图形验证码"
|
||||
extra-event-params
|
||||
placeholder="请输入图形验证码"
|
||||
use-button-slot
|
||||
>
|
||||
<image src="{{imgCode}}" mode="aspectFit" slot="button" class="imgCode" bind:tap="handleGetCaptcha"/>
|
||||
<!-- <van-button slot="button" size="small" type="primary">
|
||||
发送验证码
|
||||
</van-button> -->
|
||||
</van-field>
|
||||
<van-field value="{{ sms }}" data-id="sms" label="短信验证码" placeholder="请输入短信验证码" use-button-slot bind:change="onChange" extra-event-params placeholder-style="color:#999;font-size:15px"
|
||||
>
|
||||
<van-button slot="button" size="small" type="primary" disabled="{{disabled}}" bind:tap="handleThrottle"> {{msg}} </van-button>
|
||||
</van-field>
|
||||
<van-field value="{{ password }}" type="password" label="密码" placeholder="请输入6~16位字母、数字组合"
|
||||
placeholder-style="color:#999;font-size:15px" data-id="password" bind:change="onChange" extra-event-params />
|
||||
|
||||
<view class="next">
|
||||
<van-button type="primary" block bind:tap="goNext">下一步</van-button>
|
||||
</view>
|
||||
|
||||
</van-cell-group>
|
||||
<view class="tip"> 若您有任何疑问或需要我们协助,请与您的小助手联系或直接微信联系<text class="red">igandan1000</text></view>
|
||||
</view>
|
||||
<view hidden="{{!showNext}}">
|
||||
<van-cell-group class="group" >
|
||||
<van-field value="{{ name }}" label="姓名" placeholder="请输入您的真实姓名" input-align="right" placeholder-style="color:#999;font-size:15px" bind:change="onChange" data-id="name" extra-event-params/>
|
||||
<van-field value="{{ hospital_name }}" label="医院" placeholder="请选择医院" right-icon="arrow" placeholder-style="color:#999;font-size:15px"
|
||||
input-align="right" bind:tap="opeArea" readonly/>
|
||||
<van-field value="{{ office_name }}"
|
||||
placeholder-style="color:#999;font-size:15px"bind:tap="openOffice" label="科室" placeholder="请选择科室" right-icon="arrow" input-align="right" readonly />
|
||||
<van-field value="{{ position_name }}"
|
||||
placeholder-style="color:#999;font-size:15px" bind:tap="openPosition" label="职称" placeholder="请选择职称" right-icon="arrow" input-align="right" readonly />
|
||||
<van-field value="{{ certificate }}" placeholder-style="color:#999;font-size:15px" label="执业证号(选填)" placeholder="请输入执业证号" class="myclass" input-align="right" />
|
||||
<!-- <van-field value="{{ value }}" label="执业医师资格证或工作胸牌" placeholder="请输入您的真实姓名" right-icon="arrow" input-align="right" bind:change="onChange" input-align="right" >
|
||||
<view class="right" slot="input">
|
||||
<van-image width="120rpx" height="80rpx" fit="contain" src="https://dev-wx.igandan.com/public/hcpEducation/images/default.png" />
|
||||
</view>
|
||||
</van-field> -->
|
||||
<van-cell title="执业医师资格证或工作胸牌" is-link class="cert">
|
||||
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" class="upload"/>
|
||||
<van-image width="120rpx" height="80rpx" fit="contain" src="{{certificate_img?certificate_img:img_host+'/default_register.png'}}" class="cert"/>
|
||||
</van-cell>
|
||||
<view class="next">
|
||||
<van-button type="primary" block bind:tap="handleSmsRegister">提交</van-button>
|
||||
</view>
|
||||
<view class="prev" >
|
||||
<van-button type="primary" block bind:tap="showNext">上一步</van-button>
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</view>
|
||||
</view>
|
||||
<van-popup
|
||||
show="{{ showArea }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ areaColumns }}" value-key="name" bind:change="onChangeArea" title="请选择地区" show-toolbar bind:confirm="confirmArea" bind:cancel="cancelArea"/>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
show="{{ showHospital }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ hospitalColumns }}" value-key="name" title="请选择医院" show-toolbar bind:confirm="confirmHospital" bind:cancel="cancelHospital"/>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
show="{{ showOffice }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ officeColumns }}" value-key="officeName" title="请选择科室" show-toolbar bind:confirm="confirmOffice" bind:cancel="cancelOffice"/>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
show="{{ showPosition }}"
|
||||
round
|
||||
position="bottom"
|
||||
custom-style="height: 50%"
|
||||
>
|
||||
<van-picker columns="{{ positionColumns }}" value-key="name" title="请选择职称" show-toolbar bind:confirm="confirmPosition" bind:cancel="cancelPosition"/>
|
||||
</van-popup>
|
||||
<dialog showDialog="{{showSuccess}}" showCancel="{{false}}" bind:confirm="onConfirmSuccess" title="提示" confirmText="确定" message="注册成功,请等待审核"></dialog>
|
||||
<van-overlay show="{{showCrop}}" >
|
||||
<image-cropper id="image-cropper" bindload="cropperload" bindimageload="loadimage" bindtapcut="clickcut" limit_move="{{limit_move}}" disable_rotate="{{disable_rotate}}" width="{{width}}" height="{{height}}" imgSrc="{{src}}" angle="{{angle}}" disable_width="{{disable_width}}" max_width="{{max_width}}" max_height="{{max_height}}" disable_height="{{disable_height}}" disable_ratio="{{disable_ratio}}"></image-cropper>
|
||||
<view class="buttonbox">
|
||||
<button bindtap='closeCrop' type="default" class="button" size="mini">返回</button>
|
||||
<button bindtap='submit' type="primary" class="button" size="mini">确定</button>
|
||||
</view>
|
||||
</van-overlay>
|
||||
@@ -0,0 +1,91 @@
|
||||
/* case/pages/register/register.wxss */
|
||||
.next{
|
||||
margin: 40rpx 20rpx!important;
|
||||
}
|
||||
.prev{
|
||||
margin:-20rpx 20rpx 0!important ;
|
||||
}
|
||||
.van-field__label{
|
||||
white-space: nowrap;
|
||||
}
|
||||
.custom-class .van-cell:last-child{
|
||||
background-color: red;
|
||||
}
|
||||
.van-cell__title{
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
color: #646566;
|
||||
align-items: center;
|
||||
}
|
||||
.van-image{
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.van-cell{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.van-field__label,.van-cell__title{
|
||||
position: relative;
|
||||
}
|
||||
.van-field__label::after,.cert .van-cell__title::after{
|
||||
content: "*";
|
||||
color:red;
|
||||
position: absolute;
|
||||
top:12rpx;
|
||||
right:-14rpx;
|
||||
}
|
||||
.cert .van-cell__title::after{
|
||||
top:4rpx;
|
||||
}
|
||||
.myclass .van-field__label::after{
|
||||
content: "";
|
||||
}
|
||||
.upload{
|
||||
opacity:0;
|
||||
position: absolute;
|
||||
z-index:99;
|
||||
}
|
||||
.cert .van-cell{
|
||||
overflow: hidden;
|
||||
}
|
||||
.van-button{
|
||||
border-radius: 10rpx!important;
|
||||
}
|
||||
.imgCode{
|
||||
width:200rpx;
|
||||
height:75.6rpx;
|
||||
}
|
||||
.custom-class{
|
||||
min-height:43.5px !important;
|
||||
}
|
||||
.van-field__label{
|
||||
color:#333!important;
|
||||
padding:12rpx 0;
|
||||
font-size: 15px!important;
|
||||
}
|
||||
.van-cell__title{
|
||||
color:#333!important;
|
||||
font-size: 15px!important;
|
||||
}
|
||||
.buttonbox{
|
||||
position: absolute;
|
||||
z-index:99;
|
||||
display: flex;
|
||||
width:600rpx;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
justify-content: space-between;
|
||||
bottom:50rpx;
|
||||
}
|
||||
.van-button--primary{
|
||||
background: linear-gradient(90deg, #377FF7 0%, #51AAFF 100%)!important;
|
||||
border-color:#377FF7!important
|
||||
}
|
||||
.tip{
|
||||
margin:0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color:#999;
|
||||
}
|
||||
.red{
|
||||
color:red;
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
import { getOssSign} from '../../../api/api'
|
||||
import { FileUtil } from '../../../utils/fileutil'
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
height: app.globalData.height,
|
||||
ctx: null,
|
||||
canvas: null,
|
||||
txt_show: true,
|
||||
template:{
|
||||
width: '676rpx',
|
||||
height: '414rpx',
|
||||
views: [
|
||||
{}
|
||||
],
|
||||
},
|
||||
},
|
||||
onReady() {
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('#sign_panels')
|
||||
.fields({ node: true, size: true })
|
||||
.exec((res) => {
|
||||
const canvas = res[0].node
|
||||
const ctx = canvas.getContext('2d')
|
||||
ctx.lineWidth = 5;
|
||||
// const dpr = wx.getSystemInfoSync().pixelRatio
|
||||
|
||||
canvas.width = res[0].width
|
||||
canvas.height = res[0].height
|
||||
ctx.scale(1, 1)
|
||||
console.log(ctx);
|
||||
this.setData({
|
||||
ctx: ctx,
|
||||
canvas: canvas
|
||||
});
|
||||
|
||||
console.log("onReady onReady start")
|
||||
console.log(ctx)
|
||||
console.log(canvas)
|
||||
console.log("onReady onReady end")
|
||||
})
|
||||
},
|
||||
ontouchmove(e){
|
||||
console.log("ontouchmove ontouchmove ontouchmove");
|
||||
console.log(e);
|
||||
this.data.ctx.lineWidth = 5;
|
||||
this.data.ctx.lineCap="round";
|
||||
this.data.ctx.lineJoin ="round";
|
||||
this.data.ctx.lineTo(e.touches[0].x,e.touches[0].y);
|
||||
this.data.ctx.stroke();
|
||||
},
|
||||
ontouchstart(e){
|
||||
console.log("ontouchstart ontouchstart ontouchstart")
|
||||
this.setData({
|
||||
txt_show: false
|
||||
});
|
||||
console.log(this.data.ctx);
|
||||
this.data.ctx.beginPath();
|
||||
this.data.ctx.moveTo(e.touches[0].x,e.touches[0].y);
|
||||
},
|
||||
toClear() {
|
||||
this.setData({
|
||||
txt_show: true
|
||||
});
|
||||
this.data.ctx.clearRect(0,0,this.data.canvas.width,this.data.canvas.height)
|
||||
},
|
||||
rotate(){
|
||||
let ctx = this.data.ctx;
|
||||
ctx.rotate(90);
|
||||
},
|
||||
toSave(event) {
|
||||
let _this = this;
|
||||
let base64Img = _this.data.canvas.toDataURL();
|
||||
console.log("sign: ", base64Img);
|
||||
wx.canvasToTempFilePath({
|
||||
canvasId: "sign_panels",
|
||||
canvas: _this.data.canvas,
|
||||
x:0,
|
||||
y:0,
|
||||
success(res) {
|
||||
console.log(res.tempFilePath)
|
||||
let filePath = res.tempFilePath;
|
||||
console.log(_this.data.canvas)
|
||||
console.log(_this.data.canvas.width)
|
||||
console.log(_this.data.canvas.height)
|
||||
let cs = (_this.data.canvas.height - _this.data.canvas.width)/2;
|
||||
_this.setData({
|
||||
"template.width": _this.data.canvas.height+"rpx",
|
||||
"template.height": _this.data.canvas.width+"rpx",
|
||||
"template.views[0].css.width": _this.data.canvas.width+"rpx",
|
||||
"template.views[0].css.left": cs+"rpx",
|
||||
"template.views[0].css.top": "-"+cs+"rpx",
|
||||
"template.views[0].url": filePath,
|
||||
"template.views[0].type": "image",
|
||||
"template.views[0].css.rotate": "-90",
|
||||
})
|
||||
// _this.doUploadFile(event, 2, filePath);
|
||||
}
|
||||
})
|
||||
},
|
||||
onImgOK(e){
|
||||
console.log("onImgOK onImgOK onImgOK onImgOK");
|
||||
console.log(e.detail.path);
|
||||
let txt_show = this.data.txt_show;
|
||||
if(!txt_show){
|
||||
this.doUploadFile(e, 2, e.detail.path);
|
||||
}
|
||||
},
|
||||
doUploadFile(event, scene, filePath) {
|
||||
console.log("index douploadFIle: ", event);
|
||||
console.log("scene: ", scene);
|
||||
let _this = this;
|
||||
getOssSign(2).then(response => {
|
||||
console.log(response);
|
||||
console.log("filePath: ", filePath);
|
||||
const filename = FileUtil.UUID()+".png";
|
||||
const host = response.host;
|
||||
const signature = response.signature;
|
||||
const ossAccessKeyId = response.accessid;
|
||||
const policy = response.policy;
|
||||
const key = response.dir+filename;
|
||||
wx.uploadFile({
|
||||
url: host, // 开发者服务器的URL。
|
||||
filePath: filePath,
|
||||
name: 'file', // 必须填file。
|
||||
formData: {
|
||||
key,
|
||||
policy,
|
||||
OSSAccessKeyId: ossAccessKeyId,
|
||||
signature,
|
||||
},
|
||||
success: (res) => {
|
||||
console.log("upload: ", res);
|
||||
if (res.statusCode === 204) {
|
||||
wx.showToast({title: '上传成功'})
|
||||
let url = host+"/"+key;
|
||||
console.log(url);
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = pages[pages.length - 2]
|
||||
prevPage.setData({ //setData给上个页面的data进行赋值
|
||||
signImg:url
|
||||
})
|
||||
wx.navigateBack();
|
||||
//this.handleAddSign(url)
|
||||
}
|
||||
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err);
|
||||
wx.showToast({
|
||||
title: '上传失败',
|
||||
icon: "error"
|
||||
})
|
||||
}
|
||||
});
|
||||
}).catch(error => {
|
||||
|
||||
if(error.code==30007){
|
||||
wx.showToast({
|
||||
title: '您未登录',
|
||||
icon:'none'
|
||||
})
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/mobileLogin/mobileLogin',
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"navBar":"../../../components/navBar/navBar",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"painter":"../../../components/painter/painter"
|
||||
},
|
||||
"disableScroll": true,
|
||||
"navigationStyle":"custom"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<navBar navName="签名"></navBar>
|
||||
<view class="container" style="height: calc(100vh - 96rpx - {{height}}px);">
|
||||
<canvas disable-scroll bindtouchstart="ontouchstart" bindtouchmove="ontouchmove" type="2d" style="width: 100vw; height: calc(100vh - {{height*2 + 20}}px);" id="sign_panels">
|
||||
<view wx:if="{{txt_show}}" class="title">签名面板</view>
|
||||
</canvas>
|
||||
<view class="btn_group">
|
||||
<van-button bindtap="toClear" custom-style="height: 70rpx;border-radius: 10rpx;color:#000;width: 230rpx;">清空</van-button>
|
||||
<van-button bindtap="toSave" custom-style="height: 70rpx;border-radius: 10rpx;color:#fff;width: 230rpx;background: linear-gradient(315deg, #33BFB8 0%, #34BFB8 0%, #3CC7C0 100%);">确认</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<painter palette="{{template}}" style="position: absolute;top: 999999999999999999999999999999999900px;left: 999999999999999999999999999999999px;" bind:imgOK="onImgOK" />
|
||||
@@ -0,0 +1,23 @@
|
||||
.container{
|
||||
height: 100vh;
|
||||
margin-top: 172rpx;
|
||||
background: #FAFAFA;
|
||||
}
|
||||
.title{
|
||||
font-size: 40rpx;
|
||||
width: 160rpx;
|
||||
height: 50rpx;
|
||||
position:absolute;
|
||||
left: calc(50vw - 80rpx);
|
||||
top: calc(50vh - 160rpx);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.btn_group{
|
||||
transform: rotate(90deg);
|
||||
width: 500rpx;
|
||||
position: absolute;
|
||||
left: calc(-215rpx + 50rpx);/* 和按钮的高度有关 (width/2 - 按钮高度/2) */
|
||||
bottom: calc(215rpx + 100rpx);/* 和按钮的高度有关 (width/2 - 按钮高度/2) */
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
function formatTime(date) {
|
||||
var year = date.getFullYear()
|
||||
var month = date.getMonth() + 1
|
||||
var day = date.getDate()
|
||||
|
||||
var hour = date.getHours()
|
||||
var minute = date.getMinutes()
|
||||
var second = date.getSeconds()
|
||||
|
||||
|
||||
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||
}
|
||||
|
||||
function formatNumber(n) {
|
||||
n = n.toString()
|
||||
return n[1] ? n : '0' + n
|
||||
}
|
||||
|
||||
// 公用的修改颜色
|
||||
function changeColor(e, _this) {
|
||||
let tempData = {};
|
||||
tempData[e.target.dataset.color] = e.detail.value;
|
||||
_this.setData({
|
||||
...tempData,
|
||||
eraser: false,
|
||||
});
|
||||
}
|
||||
|
||||
// 公用的修改画笔宽度
|
||||
function changeWidth(e, _this, canvasHeight, pageType) {
|
||||
let c = {};
|
||||
if (pageType === 1) {
|
||||
c.canvasHeight = canvasHeight;
|
||||
} else {
|
||||
c.canvasHeightLen = canvasHeight;
|
||||
}
|
||||
_this.setData({
|
||||
w: e.detail.value,
|
||||
eraser: false,
|
||||
...c,
|
||||
})
|
||||
}
|
||||
|
||||
// 点击按钮触发的事件
|
||||
function tapBtn(e, _this, pageType) {
|
||||
let btnType = e.target.dataset.type;
|
||||
|
||||
let c = {};
|
||||
|
||||
switch (btnType) {
|
||||
// 画笔宽度
|
||||
case 'width':
|
||||
if (pageType === 1) {
|
||||
c.canvasHeight = (!_this.data.width) ? 130 + _this.data.w : 50
|
||||
} else if (pageType === 2) {
|
||||
c.canvasHeightLen = (!_this.data.width) ? Math.min(_this.data.canvasHeight, _this.data.windowHeight - _this.data.w - 130) : 0;
|
||||
} else if (pageType === 3) {
|
||||
c.canvasHeight = 130;
|
||||
}
|
||||
_this.setData({
|
||||
width: !_this.data.width,
|
||||
color: false,
|
||||
clear: false,
|
||||
...c,
|
||||
});
|
||||
return;
|
||||
// 画笔颜色
|
||||
case 'color':
|
||||
if (pageType === 1) {
|
||||
c.canvasHeight = (!_this.data.color) ? 205 + _this.data.w : 50;
|
||||
} else if (pageType === 2) {
|
||||
c.canvasHeightLen = (!_this.data.color) ? Math.min(_this.data.canvasHeight, _this.data.windowHeight - _this.data.w - 205) : 0;
|
||||
}
|
||||
_this.setData({
|
||||
width: false,
|
||||
color: !_this.data.color,
|
||||
clear: false,
|
||||
...c,
|
||||
});
|
||||
return;
|
||||
// 清空按钮
|
||||
case 'clear':
|
||||
if (pageType === 1) {
|
||||
c.canvasHeight = (!_this.data.clear) ? 120 + _this.data.w : 50;
|
||||
} else if (pageType === 2) {
|
||||
c.canvasHeightLen = (!_this.data.clear) ? Math.min(_this.data.canvasHeight, _this.data.windowHeight - _this.data.w - 120) : 0;
|
||||
}
|
||||
_this.setData({
|
||||
width: false,
|
||||
color: false,
|
||||
clear: !_this.data.clear,
|
||||
...c,
|
||||
})
|
||||
return;
|
||||
// 保存
|
||||
case 'save':
|
||||
saveImg(_this, pageType);
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function saveImg(_this, pageType) {
|
||||
let c = {};
|
||||
if (pageType === 1) {
|
||||
c.canvasHeight = 50;
|
||||
} else if (pageType === 2) {
|
||||
c.canvasHeightLen = 0;
|
||||
}
|
||||
// 查看授权
|
||||
if (!_this.data.scope) {
|
||||
wx.showModal({
|
||||
title: '需要授权',
|
||||
content: '保存图片需要获取您的授权',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
wx.openSetting({
|
||||
success: (res) => {
|
||||
if (res.authSetting['scope.writePhotosAlbum']) {
|
||||
_this.setData({
|
||||
scope: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 已经获得授权且不在保存中
|
||||
if (_this.data.scope && !_this.data.saving) {
|
||||
wx.showLoading({
|
||||
title: '保存中',
|
||||
mask: true,
|
||||
})
|
||||
// 关闭所有的操作栏
|
||||
_this.setData({
|
||||
width: false,
|
||||
color: false,
|
||||
clear: false,
|
||||
saving: true,
|
||||
...c,
|
||||
})
|
||||
|
||||
if (pageType === 2) {
|
||||
/*
|
||||
* 对于涂鸦照片,一共分为四步:
|
||||
* 1、将画的内容先保存出来
|
||||
* 2、然后再将照片先画在canvas上
|
||||
* 3、将画的内容覆盖的画在canvas上
|
||||
* 4、最终保存
|
||||
*/
|
||||
wx.canvasToTempFilePath({
|
||||
canvasId: 'myCanvas',
|
||||
success: function (res) {
|
||||
// 把单纯用户画的内容存好了
|
||||
let src = res.tempFilePath;
|
||||
let ctx = wx.createCanvasContext('myCanvas');
|
||||
// 照片
|
||||
ctx.drawImage(_this.data.background, 0, 0, _this.data.canvasWidth, _this.data.canvasHeight);
|
||||
// 覆盖上画的内容
|
||||
ctx.drawImage(src, 0, 0, _this.data.canvasWidth, _this.data.canvasHeight);
|
||||
ctx.draw();
|
||||
|
||||
_canvaseSaveToImg(_this);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
_canvaseSaveToImg(_this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _canvaseSaveToImg(_this) {
|
||||
// 调用微信canvas存为图片
|
||||
wx.canvasToTempFilePath({
|
||||
canvasId: 'myCanvas',
|
||||
success: function (res) {
|
||||
// 转图片成功,继续调用存储相册接口
|
||||
wx.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
// 存储成功
|
||||
success: function (r) {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '保存成功',
|
||||
})
|
||||
_this.setData({
|
||||
saving: false,
|
||||
})
|
||||
},
|
||||
// 失败弹窗
|
||||
fail: function (res) {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '保存失败',
|
||||
icon: 'loading',
|
||||
})
|
||||
_this.setData({
|
||||
saving: false,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function (res) {
|
||||
// canvas转图片失败
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
icon: 'loading',
|
||||
title: '保存失败',
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime: formatTime,
|
||||
changeColor: changeColor,
|
||||
changeWidth: changeWidth,
|
||||
tapBtn: tapBtn,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user