注册
This commit is contained in:
parent
57a2609364
commit
3904763ddb
@ -4,14 +4,31 @@ import request from "../../request.js"
|
|||||||
export function getOpenId(code) {
|
export function getOpenId(code) {
|
||||||
return request({
|
return request({
|
||||||
url: `/applet/register/getOpenId/${code}`,
|
url: `/applet/register/getOpenId/${code}`,
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
|
header: {
|
||||||
|
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前注册居民
|
// 获取当前注册居民
|
||||||
export function getCurrentUser(data) {
|
export function getCurrentUser(openid, cityCode) {
|
||||||
return request({
|
return request({
|
||||||
url: `/applet/register/getCurrentResident/${data.openid}/${data.cityCode}`,
|
url: `/applet/register/getCurrentResident/${openid}/${cityCode}`,
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
|
header: {
|
||||||
|
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取签约信息
|
||||||
|
export function detail(identity,region) {
|
||||||
|
return request({
|
||||||
|
url: `/applet/signinfo/detail/${identity}`,
|
||||||
|
method: 'GET',
|
||||||
|
header: {
|
||||||
|
region: region,
|
||||||
|
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
import request from "../../request.js"
|
import request from "../../request.js"
|
||||||
|
|
||||||
export function getWeChatUser(loginCode, phoneCode) {
|
export function getWeChatUser(code) {
|
||||||
return request({
|
return request({
|
||||||
url: `/nurseApplet/login/getWeChatUserInfo?loginCode=${loginCode}&phoneCode=${phoneCode}`,
|
url: `/applet/register/getOpenId/${code}`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import request from "../../request.js"
|
import request from "../../request.js"
|
||||||
|
|
||||||
// 注册
|
// 注册
|
||||||
export function register(data) {
|
export function registerdata(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/applet/register`,
|
url: '/applet/register',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import baseurl from './baseurl.js'
|
import baseurl from './baseurl.js'
|
||||||
|
|
||||||
|
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
var request = function(config) {
|
var request = function(config) {
|
||||||
return new Promise((resolve, rejected) => {
|
return new Promise((resolve, rejected) => {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@ -10,9 +11,7 @@ var request = function(config) {
|
|||||||
data: config.data,
|
data: config.data,
|
||||||
method: config.method,
|
method: config.method,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
header: {
|
header:config.header,
|
||||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
|
||||||
},
|
|
||||||
success(res) {
|
success(res) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
|
|||||||
340
components/ld-select/ld-select.vue
Normal file
340
components/ld-select/ld-select.vue
Normal file
@ -0,0 +1,340 @@
|
|||||||
|
<template>
|
||||||
|
<view class="main">
|
||||||
|
<view class="input" :style="disabled?'background-color:#f5f7fa':''">
|
||||||
|
<input @click="showModal" v-model="_value" :style="disabled?'color:#c0c4cc':''" :placeholder="placeholder" disabled/>
|
||||||
|
<text v-if="clearable&&!disabled" @click="empty" class="selectIcon iconcross"></text>
|
||||||
|
</view>
|
||||||
|
<view class="select-modal" :class="isShowModal?'show':''" @tap="hideModal">
|
||||||
|
<view class="select-dialog" @tap.stop="" :style="{backgroundColor:bgColor}">
|
||||||
|
<view class="select-bar bg-white">
|
||||||
|
<view class="action text-blue" @tap="cancelClick">{{cancelText}}</view>
|
||||||
|
<view class="action text-green" @tap="confirmClick">{{confirmText}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="select-content">
|
||||||
|
<view class="select-item" v-for="(item,index) in list" :key="index"
|
||||||
|
:style="valueIndexOf(item)?'color:'+selectColor+';background-color:'+selectBgColor+';':'color:'+color+';'"
|
||||||
|
@click="select(item)">
|
||||||
|
<view class="title">{{getLabelKeyValue(item)}}</view>
|
||||||
|
<text class="selectIcon icongou" v-if="valueIndexOf(item)"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isShowModal:false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
value:{
|
||||||
|
type:[Number,String,Array,Object],
|
||||||
|
default:null
|
||||||
|
},
|
||||||
|
placeholder:{ // 占位符
|
||||||
|
default: "",
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
multiple:{ // 是否多选
|
||||||
|
default: false,
|
||||||
|
type: Boolean
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
default: () => [],
|
||||||
|
type: Array
|
||||||
|
},
|
||||||
|
valueKey:{ // 指定list中valueKey的值作为下拉框绑定内容
|
||||||
|
default: 'value',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
labelKey:{ // 指定list中labelKey的值作为下拉框显示内容
|
||||||
|
default: 'label',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
default: false,
|
||||||
|
type: Boolean
|
||||||
|
},
|
||||||
|
clearable:{
|
||||||
|
default: false,
|
||||||
|
type: Boolean
|
||||||
|
},
|
||||||
|
cancelText:{
|
||||||
|
default: "取消",
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
confirmText:{
|
||||||
|
default: "确定",
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
color:{
|
||||||
|
default: "#000000",
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
selectColor:{
|
||||||
|
default: "#0081ff",
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
bgColor:{
|
||||||
|
default: "#F1F1F1",
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
selectBgColor:{
|
||||||
|
default: "#FFFFFF",
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
_value: {
|
||||||
|
get() {
|
||||||
|
return this.get_value(this.value);
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
console.log(this.value)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
get_value(val){ // 将数组值转换为以,隔开的字符串
|
||||||
|
if(val || val===0){
|
||||||
|
if(Array.isArray(val)){
|
||||||
|
let chooseAttr = []
|
||||||
|
val.forEach(item=>{
|
||||||
|
let choose = this.list.find(temp => {
|
||||||
|
let val_val = this.getValueKeyValue(temp)
|
||||||
|
return item === val_val
|
||||||
|
})
|
||||||
|
if(choose) {
|
||||||
|
chooseAttr.push(choose)
|
||||||
|
} else {
|
||||||
|
choose = {}
|
||||||
|
this.$set(choose, this.valueKey, item)
|
||||||
|
this.$set(choose, this.labelKey, item)
|
||||||
|
chooseAttr.push(choose)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let values = chooseAttr.map(temp => this.getLabelKeyValue(temp)).join(',')
|
||||||
|
return values
|
||||||
|
} else {
|
||||||
|
let choose = this.list.find(temp => {
|
||||||
|
let val_val = this.getValueKeyValue(temp)
|
||||||
|
return val === val_val
|
||||||
|
})
|
||||||
|
if(choose) {
|
||||||
|
return this.getLabelKeyValue(choose)
|
||||||
|
} else {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
select(item){ // 点击选项
|
||||||
|
let val = this.getValueKeyValue(item);
|
||||||
|
if(this.multiple){
|
||||||
|
let _value = this.value;
|
||||||
|
console.log(_value,this.value)
|
||||||
|
let index = _value.indexOf(val);
|
||||||
|
if(index!=-1){
|
||||||
|
_value.splice(index,1)
|
||||||
|
this.setInput(_value);
|
||||||
|
} else {
|
||||||
|
_value.push(val)
|
||||||
|
this.setInput(_value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.setInput(val);
|
||||||
|
this.hideModal()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
valueIndexOf(item){
|
||||||
|
let val = this.getValueKeyValue(item);
|
||||||
|
if(Array.isArray(this.value)){
|
||||||
|
return this.value.indexOf(val)!=-1
|
||||||
|
} else {
|
||||||
|
return this.value === val
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getLabelKeyValue(item){ // 获取label
|
||||||
|
return item[this.labelKey]
|
||||||
|
// if(item){
|
||||||
|
// return item[this.labelKey]
|
||||||
|
// } else {
|
||||||
|
// return item
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
getValueKeyValue(item){ // 获取value
|
||||||
|
return item[this.valueKey]
|
||||||
|
},
|
||||||
|
empty(){ // 清空
|
||||||
|
if(this.multiple){
|
||||||
|
this.setInput([]);
|
||||||
|
} else {
|
||||||
|
this.setInput('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setInput(val){
|
||||||
|
this.$emit('change', val)
|
||||||
|
this.$emit('input', val)
|
||||||
|
},
|
||||||
|
cancelClick(){ // 点击取消
|
||||||
|
this.$emit('cancel', this.value)
|
||||||
|
this.hideModal()
|
||||||
|
},
|
||||||
|
confirmClick(){ // 点击确定
|
||||||
|
this.$emit('confirm', this.value)
|
||||||
|
this.hideModal()
|
||||||
|
},
|
||||||
|
showModal(){ // 显示model
|
||||||
|
if(!this.disabled){
|
||||||
|
this.isShowModal = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hideModal(){ // 隐藏model
|
||||||
|
this.isShowModal = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
@font-face {font-family: "selectIcon";
|
||||||
|
src: url('//at.alicdn.com/t/font_1833441_ycfzdhg2u3.eot?t=1590375117208'); /* IE9 */
|
||||||
|
src: url('//at.alicdn.com/t/font_1833441_ycfzdhg2u3.eot?t=1590375117208#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||||
|
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAMEAAsAAAAABvQAAAK4AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDBgqBRIFCATYCJAMMCwgABCAFhQUHNRsfBsg+QCa3uoO0oAJTMwhxVu965keqWBy1hkbwtfzWb2Z279/shRhJisKF6FApKLI7oyBbpAaHo3w24k+ca9EUJbDmjaeznUdZ/FOUlkWdJ33rizZY/Pw6J5Xw0qKYxHTMesePHVT6EFpaC4zV70sKi2bYgNPc1w0WHnDVC/e/UnNTgyP+4Jq6BBpIHoisgypLaIAFEtU0wgeaIG8Yu4nAIZwnUK1QgFfOT6nUUoBpgXjj2lqplTMpiuXtCW3N2iK+aPTS2/Qdnzny8d+5IEiaDMy99exklra//FrKnX48pChmgrq5QcYRQCEe17ruqgqLAKv8WntwqwhpLms/nB5yW/iHRxJEC0QOgT3NnfgF01NBKvOuIzNoZdh5gJuAeGrsozE8vOJ7u5D832oz55039W5G+S52K0H+zNf1TJz07k26kqoQybRfwVFV4rjDS/K8EXUyuF1cXnT3weKS9Rvdm/xe7h8oA1hLwOR18R+Y4n4zwpr4z5SU089Vc+cpfWL+mn5APmT3Z39jeOs/GbWjK+DnmsuL/u6ehMX4j4yedSVkAUUuPh3TY022MtKZUEOtPqCb8Bkvnr5XT6imU0gGrEJW7aAL/gw0OhegVV2F6pC7uTOppirKIA4MFQhTrpCM+AbZlDu64L/QmAkQWlMhQXU75D07O9Gtl0PUYjTBLyAzOLNQYtypIEEjvsXtBLQTooV2nrQrGEau2gKmZlR4L8gwnGtBJbUn1diCOOQUnEkTkRAOeci9KHOQxvFro+tx3ZcGAaeljstCSBNDJuArgIyBYyy6OdZxAhHIELu1IC9AtgShCVtLltEKrSff1XoHJo3RC33hM63o3j6pSNkmqmIWEAtxFHB2OwoRBAfyeqE3r2ogHeF42dBhs7gvf7CukH5MmlUGOCpHihxFfs6TehDyKCqVAA==') format('woff2'),
|
||||||
|
url('//at.alicdn.com/t/font_1833441_ycfzdhg2u3.woff?t=1590375117208') format('woff'),
|
||||||
|
url('//at.alicdn.com/t/font_1833441_ycfzdhg2u3.ttf?t=1590375117208') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
||||||
|
url('//at.alicdn.com/t/font_1833441_ycfzdhg2u3.svg?t=1590375117208#selectIcon') format('svg'); /* iOS 4.1- */
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectIcon {
|
||||||
|
position: absolute;
|
||||||
|
right: 16rpx;
|
||||||
|
font-family: "selectIcon" !important;
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icongou:before {
|
||||||
|
content: "\e61c";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconcross:before {
|
||||||
|
content: "\e61a";
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .input.data-v-2ee6bce8{
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
}
|
||||||
|
.main{
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.bg-white{
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
.text-blue{
|
||||||
|
color: #0081ff;
|
||||||
|
}
|
||||||
|
.text-green{
|
||||||
|
color: #39b54a;
|
||||||
|
}
|
||||||
|
.input {
|
||||||
|
display: flex;
|
||||||
|
align-items:center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1rpx;
|
||||||
|
border-color: rgba(0, 0, 0, 0.1);
|
||||||
|
input{
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.select-modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 9999;
|
||||||
|
opacity: 0;
|
||||||
|
outline: 0;
|
||||||
|
text-align: center;
|
||||||
|
-ms-transform: scale(1.185);
|
||||||
|
transform: scale(1.185);
|
||||||
|
backface-visibility: hidden;
|
||||||
|
perspective: 2000rpx;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
transition: all 0.3s ease-in-out 0s;
|
||||||
|
pointer-events: none;
|
||||||
|
margin-bottom: -1000rpx;
|
||||||
|
&::before {
|
||||||
|
content: "\200B";
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
.select-dialog {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 0;
|
||||||
|
.select-content{
|
||||||
|
// background-color: #F1F1F1;
|
||||||
|
max-height: 420rpx;
|
||||||
|
overflow:auto;
|
||||||
|
.select-item{
|
||||||
|
position: relative;
|
||||||
|
padding: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
.title{
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.select-modal.show {
|
||||||
|
opacity: 1;
|
||||||
|
transition-duration: 0.3s;
|
||||||
|
-ms-transform: scale(1);
|
||||||
|
transform: scale(1);
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
pointer-events: auto;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.select-bar {
|
||||||
|
padding: 0 20rpx;
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 80rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
.action {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wxdc32268eca6b78f9",
|
"appid" : "wxccb16a452ab5e4b4",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"postcss" : true,
|
"postcss" : true,
|
||||||
|
|||||||
22
pages.json
22
pages.json
@ -64,6 +64,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "disease/disease",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "疾病类型选择",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "screenorder/screenorder",
|
"path": "screenorder/screenorder",
|
||||||
"style": {
|
"style": {
|
||||||
@ -381,6 +388,7 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}, {
|
}, {
|
||||||
"root": "pagesC",
|
"root": "pagesC",
|
||||||
@ -398,13 +406,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
"path": "Filinginformation/Filinginformation",
|
// "path": "Filinginformation/Filinginformation",
|
||||||
"style": {
|
// "style": {
|
||||||
"navigationBarTitleText": "查看建档信息"
|
// "navigationBarTitleText": "查看建档信息"
|
||||||
// "enablePullDownRefresh": false
|
// // "enablePullDownRefresh": false
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
"path": "Onlinesigning/Onlinesigning",
|
"path": "Onlinesigning/Onlinesigning",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
请拍摄本人头像
|
请拍摄本人头像
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="contentV">
|
<view class="contentV">
|
||||||
<view class="mark"></view>
|
<view class="mark"></view>
|
||||||
<image v-if="tempImg" mode="widthFix" :src="tempImg" />
|
<image v-if="tempImg" mode="widthFix" :src="tempImg" />
|
||||||
@ -16,6 +17,7 @@
|
|||||||
flash="off" resolution='high' />
|
flash="off" resolution='high' />
|
||||||
<view v-show="!tempImg && tipsText" class="tipV">{{ tipsText }}</view>
|
<view v-show="!tempImg && tipsText" class="tipV">{{ tipsText }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="footerV">
|
<view class="footerV">
|
||||||
<view style="width: 100%;">
|
<view style="width: 100%;">
|
||||||
<view v-if="!tempImg" style="width: 100%;">
|
<view v-if="!tempImg" style="width: 100%;">
|
||||||
@ -157,6 +159,7 @@
|
|||||||
if (this.tipsText != "" && this.tipsText != "请拍照") {
|
if (this.tipsText != "" && this.tipsText != "请拍照") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.getSetting({
|
uni.getSetting({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (!res.authSetting['scope.camera']) {
|
if (!res.authSetting['scope.camera']) {
|
||||||
@ -177,6 +180,9 @@
|
|||||||
tempImagePath
|
tempImagePath
|
||||||
}) => {
|
}) => {
|
||||||
this.tempImg = tempImagePath
|
this.tempImg = tempImagePath
|
||||||
|
//全局事件订阅只要注册的页面都可以收到回调值
|
||||||
|
// uni.$emit("headPictureUrl",this.tempImg)
|
||||||
|
|
||||||
console.log("=======tempImg:", this.tempImg)
|
console.log("=======tempImg:", this.tempImg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -197,10 +203,14 @@
|
|||||||
duration: 2000,
|
duration: 2000,
|
||||||
})
|
})
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pages/register/register?headPictureUrl=${this.tempImg}`
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击 - 取消上传
|
// 点击 - 取消上传
|
||||||
handleCancelClick() {
|
handleCancelClick() {
|
||||||
|
console.log(this.tempImg)
|
||||||
this.tempImg = ''
|
this.tempImg = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,8 @@
|
|||||||
<image src="/static/pageC/homepage.png" mode=""></image>
|
<image src="/static/pageC/homepage.png" mode=""></image>
|
||||||
<view class="loginmount">
|
<view class="loginmount">
|
||||||
<image src="/static/pageC/TAB.png" mode=""></image>
|
<image src="/static/pageC/TAB.png" mode=""></image>
|
||||||
<text>你好,请登录</text>
|
<text v-if="patientName">{{patientName}}</text>
|
||||||
|
<text @tap="login" v-else>你好,请登录</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="contentcenter">
|
<view class="contentcenter">
|
||||||
@ -26,7 +27,7 @@
|
|||||||
服务预约
|
服务预约
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="home">
|
<view class="home" @tap="count">
|
||||||
<image src="/static/pageC/exchange.png" mode=""></image>
|
<image src="/static/pageC/exchange.png" mode=""></image>
|
||||||
<view class="name">
|
<view class="name">
|
||||||
积分兑换
|
积分兑换
|
||||||
@ -59,98 +60,291 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getOpenId,
|
getOpenId,
|
||||||
getCurrentUser
|
getCurrentUser,
|
||||||
|
detail
|
||||||
|
|
||||||
} from '@/api/pages/homepage/homepage.js'
|
} from '@/api/pages/homepage/homepage.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: 'Hello'
|
title: 'Hello',
|
||||||
|
patientName:'',
|
||||||
|
userinfo:{},
|
||||||
|
identity:'',
|
||||||
|
cityCode:'',
|
||||||
|
Code:'',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.login()
|
// this.login()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
var that = this
|
||||||
|
this.userinfo= uni.getStorageSync('userinfo');
|
||||||
|
|
||||||
|
this.cityCode = this.userinfo.cityCode;
|
||||||
|
var openid = this.userinfo.openid;
|
||||||
|
that.identity = this.userinfo.cardNo;
|
||||||
|
if (!openid && !that.cityCode) {
|
||||||
|
// that.appPersonallist = null
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
title: '您未登录,请先登录',
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(openid&&that.cityCode){
|
||||||
|
// isWxBing(openid, cityCode) {
|
||||||
|
|
||||||
|
getCurrentUser(openid,that.cityCode).then(res => {
|
||||||
|
this.patientName=res.data.patientName
|
||||||
|
console.log(res);
|
||||||
|
// if (!res.data) {
|
||||||
|
// // 注册
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goonline() {
|
// 登录
|
||||||
uni.navigateTo({
|
login(){
|
||||||
url: '/pagesB/mysigning/mysigning'
|
this.gologin();
|
||||||
})
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pagesC/Onlinesigning/Onlinesigning'
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
goHealthrecords() {
|
gologin() {
|
||||||
uni.navigateTo({
|
this.$refs.uToast.show({
|
||||||
url: '/pagesC/Healthrecords/Healthrecords'
|
title: '您未登录,请先登录',
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 是否签约
|
||||||
|
parentinfo() {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '未签约,请先签约',
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
// url: '/pages/login/login'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 签约信息
|
||||||
|
// detailinfo(){
|
||||||
|
// this.region=this.cityCode
|
||||||
|
// detail(this.identity,this.region).then(res => {
|
||||||
|
// this.Code=res.code
|
||||||
|
// if(this.Code==500){
|
||||||
|
// this.$refs.uToast.show({
|
||||||
|
// title: res.msg,
|
||||||
|
// type: 'error',
|
||||||
|
// duration: '1000',
|
||||||
|
// // url: '/pages/login/login'
|
||||||
|
// })
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// })
|
||||||
|
|
||||||
|
// },
|
||||||
|
// 家医签约
|
||||||
|
goonline() {
|
||||||
|
if(!this.userinfo){
|
||||||
|
this.gologin();
|
||||||
|
}else{
|
||||||
|
if(this.identity){
|
||||||
|
this.region=this.cityCode
|
||||||
|
detail(this.identity,this.region).then(res => {
|
||||||
|
this.Code=res.code
|
||||||
|
if(this.Code==500){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '未签约,请先签约',
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesB/mysigning/mysigning'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
// 积分兑换
|
||||||
|
count(){
|
||||||
|
if(!this.userinfo){
|
||||||
|
this.gologin();
|
||||||
|
}else{
|
||||||
|
if(this.identity){
|
||||||
|
this.region=this.cityCode
|
||||||
|
detail(this.identity,this.region).then(res => {
|
||||||
|
this.Code=res.code
|
||||||
|
if(this.Code==500){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '未签约,请先签约',
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 健康档案
|
||||||
|
goHealthrecords() {
|
||||||
|
if(!this.userinfo){
|
||||||
|
this.gologin();
|
||||||
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/Healthrecords/Healthrecords'
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
// 筛查记录
|
// 筛查记录
|
||||||
gorecords() {
|
gorecords() {
|
||||||
uni.navigateTo({
|
if(!this.userinfo){
|
||||||
url: '/pagesC/Screeningrecords/Screeningrecords'
|
this.gologin();
|
||||||
})
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/Screeningrecords/Screeningrecords'
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 健康自评
|
// 健康自评
|
||||||
healthtest() {
|
healthtest() {
|
||||||
uni.navigateTo({
|
if(!this.userinfo){
|
||||||
url: '/pagesC/healthtest/healthtest'
|
this.gologin();
|
||||||
})
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/healthtest/healthtest'
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 体征检测
|
// 体征检测
|
||||||
sign() {
|
sign() {
|
||||||
uni.navigateTo({
|
if(!this.userinfo){
|
||||||
url: '/pagesC/Physicalexamination/Physicalexamination'
|
this.gologin();
|
||||||
})
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/Physicalexamination/Physicalexamination'
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 服务预约
|
// 服务预约
|
||||||
goappoint() {
|
goappoint() {
|
||||||
uni.navigateTo({
|
if(!this.userinfo){
|
||||||
url: '/pagesC/ServiceAppointment/ServiceAppointment'
|
this.gologin();
|
||||||
})
|
}else{
|
||||||
|
if(this.identity){
|
||||||
|
this.region=this.cityCode
|
||||||
|
detail(this.identity,this.region).then(res => {
|
||||||
|
this.Code=res.code
|
||||||
|
if(this.Code==500){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '未签约,请先签约',
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/ServiceAppointment/ServiceAppointment'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 服务记录
|
// 服务记录
|
||||||
servicerecord() {
|
servicerecord() {
|
||||||
uni.navigateTo({
|
if(!this.userinfo){
|
||||||
url: '/pagesC/servicerecord/servicerecord'
|
this.gologin();
|
||||||
})
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/servicerecord/servicerecord'
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 我的预约
|
// 我的预约
|
||||||
myappointment() {
|
myappointment() {
|
||||||
uni.navigateTo({
|
if(!this.userinfo){
|
||||||
url: '/pagesC/Myappointment/Myappointment'
|
this.gologin();
|
||||||
})
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/Myappointment/Myappointment'
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
login() {
|
// login() {
|
||||||
const _this = this
|
// const _this = this
|
||||||
uni.login({
|
// uni.login({
|
||||||
success(res) {
|
// success(res) {
|
||||||
getOpenId(res.code).then(Res => {
|
// getOpenId(res.code).then(Res => {
|
||||||
if (Res.code == 200) {
|
// if (Res.code == 200) {
|
||||||
_this.isWxBing(Res.msg, '1')
|
// _this.isWxBing(Res.msg, '1')
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
isWxBing(openid, cityCode) {
|
|
||||||
getCurrentUser(openid, cityCode).then(res => {
|
|
||||||
console.log(res);
|
|
||||||
if (!res.data) {
|
|
||||||
// 注册
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./homepage.scss";
|
@import "./homepage.scss";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
return {
|
return {
|
||||||
phonecode: undefined,
|
phonecode: undefined,
|
||||||
logincode: undefined,
|
logincode: undefined,
|
||||||
|
code:undefined,
|
||||||
timer: undefined,
|
timer: undefined,
|
||||||
scenenurseStationId: undefined
|
scenenurseStationId: undefined
|
||||||
};
|
};
|
||||||
@ -28,6 +29,7 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.phonecode = undefined
|
this.phonecode = undefined
|
||||||
this.logincode = undefined
|
this.logincode = undefined
|
||||||
|
this.code = undefined
|
||||||
this.scenenurseStationId = uni.getStorageSync('scenenurseStationId');
|
this.scenenurseStationId = uni.getStorageSync('scenenurseStationId');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -38,16 +40,19 @@
|
|||||||
wx.login({
|
wx.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: function(loginRes) {
|
success: function(loginRes) {
|
||||||
that.logincode = loginRes.code
|
console.log(loginRes)
|
||||||
|
|
||||||
|
// uni.$emit('code',loginRes.code)
|
||||||
|
that.code = loginRes.code
|
||||||
that.pwdlogin();
|
that.pwdlogin();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
login() {
|
login() {
|
||||||
getWeChatUser(this.logincode, this.phonecode).then(res => {
|
getWeChatUser(this.code).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.setStorageSync("openid", res.data.openid)
|
uni.setStorageSync("openid", res.data)
|
||||||
uni.setStorageSync("patientId", res.data.id)
|
uni.setStorageSync("patientId", res.data.id)
|
||||||
uni.setStorageSync("phone", res.data.phone)
|
uni.setStorageSync("phone", res.data.phone)
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
@ -55,17 +60,18 @@
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
duration: '1500'
|
duration: '1500'
|
||||||
})
|
})
|
||||||
|
console.log(this.logincode)
|
||||||
this.phonecode = undefined
|
this.phonecode = undefined
|
||||||
this.logincode = undefined
|
this.logincode = undefined
|
||||||
uni.setStorageSync("Refresh", 'Refresh')
|
uni.setStorageSync("Refresh", 'Refresh')
|
||||||
if (this.timer) {
|
if (this.timer) {
|
||||||
clearTimeout(this.timer)
|
clearTimeout(this.timer)
|
||||||
}
|
}
|
||||||
this.timer = setTimeout(e => {
|
// this.timer = setTimeout(e => {
|
||||||
uni.navigateBack({
|
// uni.navigateBack({
|
||||||
delta: 1
|
// delta: 1
|
||||||
})
|
// })
|
||||||
}, 500)
|
// }, 500)
|
||||||
} else {
|
} else {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '登录失败',
|
title: '登录失败',
|
||||||
@ -78,13 +84,17 @@
|
|||||||
pwdlogin() {
|
pwdlogin() {
|
||||||
var that = this
|
var that = this
|
||||||
uni.clearStorageSync();
|
uni.clearStorageSync();
|
||||||
createMobileToken().then(res => {
|
uni.navigateTo({
|
||||||
uni.setStorageSync("token", res.data.token)
|
url:`/pages/register/register?code=${this.logincode}`
|
||||||
if (this.scenenurseStationId) {
|
|
||||||
uni.setStorageSync("scenenurseStationId", this.scenenurseStationId)
|
|
||||||
}
|
|
||||||
that.login()
|
|
||||||
})
|
})
|
||||||
|
that.login()
|
||||||
|
// createMobileToken().then(res => {
|
||||||
|
// uni.setStorageSync("token", res.data.token)
|
||||||
|
// if (this.scenenurseStationId) {
|
||||||
|
// uni.setStorageSync("scenenurseStationId", this.scenenurseStationId)
|
||||||
|
// }
|
||||||
|
// that.login()
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
}, //1.分享给朋友
|
}, //1.分享给朋友
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user