Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # pages.json
This commit is contained in:
commit
8237ef8e04
@ -4,14 +4,31 @@ import request from "../../request.js"
|
||||
export function getOpenId(code) {
|
||||
return request({
|
||||
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({
|
||||
url: `/applet/register/getCurrentResident/${data.openid}/${data.cityCode}`,
|
||||
method: 'GET'
|
||||
url: `/applet/register/getCurrentResident/${openid}/${cityCode}`,
|
||||
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"
|
||||
|
||||
export function getWeChatUser(loginCode, phoneCode) {
|
||||
export function getWeChatUser(code) {
|
||||
return request({
|
||||
url: `/nurseApplet/login/getWeChatUserInfo?loginCode=${loginCode}&phoneCode=${phoneCode}`,
|
||||
url: `/applet/register/getOpenId/${code}`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import request from "../../request.js"
|
||||
|
||||
// 注册
|
||||
export function register(data) {
|
||||
export function registerdata(data) {
|
||||
return request({
|
||||
url: `/applet/register`,
|
||||
url: '/applet/register',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import baseurl from './baseurl.js'
|
||||
|
||||
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
var request = function(config) {
|
||||
return new Promise((resolve, rejected) => {
|
||||
uni.showLoading({
|
||||
@ -10,9 +11,7 @@ var request = function(config) {
|
||||
data: config.data,
|
||||
method: config.method,
|
||||
timeout: 10000,
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
},
|
||||
header:config.header,
|
||||
success(res) {
|
||||
uni.hideLoading();
|
||||
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" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wxdc32268eca6b78f9",
|
||||
"appid" : "wxccb16a452ab5e4b4",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"postcss" : true,
|
||||
|
||||
36
pages.json
36
pages.json
@ -260,24 +260,23 @@
|
||||
}, {
|
||||
"path": "ProductList/ProductList", //商品列表
|
||||
"style": {
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarTitleText": "医路优品",
|
||||
"onReachBottomDistance": 20, //距离底部多远时触发 单位为px
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px
|
||||
"enablePullDownRefresh": true //设置参数为true
|
||||
}
|
||||
}, {
|
||||
"path": "nursestation/nursestation",
|
||||
"style": {
|
||||
"navigationBarTitleText": "护理服务详情"
|
||||
// "onReachBottomDistance": 40, //距离底部多远时触发 单位为px
|
||||
// "enablePullDownRefresh": true //设置参数为true
|
||||
"navigationBarTitleText": "护理机构详情",
|
||||
"onReachBottomDistance": 100, //距离底部多远时触发 单位为px
|
||||
"enablePullDownRefresh": true //设置参数为true
|
||||
}
|
||||
}, {
|
||||
"path": "site/site",
|
||||
"style": {
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarTitleText": "护理服务",
|
||||
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px
|
||||
"navigationBarTitleText": "护理机构",
|
||||
"onReachBottomDistance": 100, //距离底部多远时触发 单位为px
|
||||
"enablePullDownRefresh": true //设置参数为true
|
||||
}
|
||||
}, {
|
||||
@ -367,14 +366,12 @@
|
||||
"navigationBarTitleText": "筛查结果",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}, {
|
||||
"path": "screeningRecord/screeningRecord",
|
||||
"style": {
|
||||
"navigationBarTitleText": "筛查记录",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}, {
|
||||
"path": "SelectItem/SelectItem",
|
||||
"style": {
|
||||
@ -387,7 +384,26 @@
|
||||
"navigationBarTitleText": "我的签约",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "myfamilydoctorteam/myfamilydoctorteam",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的家庭医生团队",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "performancedetails/performancedetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "履约详情",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "contractsigningprotocol/contractsigningprotocol",
|
||||
"style": {
|
||||
"navigationBarTitleText": "签约协议",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}, {
|
||||
"root": "pagesC",
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
请拍摄本人头像
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="contentV">
|
||||
<view class="mark"></view>
|
||||
<image v-if="tempImg" mode="widthFix" :src="tempImg" />
|
||||
@ -16,6 +17,7 @@
|
||||
flash="off" resolution='high' />
|
||||
<view v-show="!tempImg && tipsText" class="tipV">{{ tipsText }}</view>
|
||||
</view>
|
||||
|
||||
<view class="footerV">
|
||||
<view style="width: 100%;">
|
||||
<view v-if="!tempImg" style="width: 100%;">
|
||||
@ -157,6 +159,7 @@
|
||||
if (this.tipsText != "" && this.tipsText != "请拍照") {
|
||||
return;
|
||||
}
|
||||
|
||||
uni.getSetting({
|
||||
success: (res) => {
|
||||
if (!res.authSetting['scope.camera']) {
|
||||
@ -177,6 +180,9 @@
|
||||
tempImagePath
|
||||
}) => {
|
||||
this.tempImg = tempImagePath
|
||||
//全局事件订阅只要注册的页面都可以收到回调值
|
||||
// uni.$emit("headPictureUrl",this.tempImg)
|
||||
|
||||
console.log("=======tempImg:", this.tempImg)
|
||||
}
|
||||
})
|
||||
@ -197,10 +203,14 @@
|
||||
duration: 2000,
|
||||
})
|
||||
}, 2000);
|
||||
uni.navigateTo({
|
||||
url:`/pages/register/register?headPictureUrl=${this.tempImg}`
|
||||
})
|
||||
},
|
||||
|
||||
// 点击 - 取消上传
|
||||
handleCancelClick() {
|
||||
console.log(this.tempImg)
|
||||
this.tempImg = ''
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,10 @@
|
||||
<view class="app">
|
||||
<view class="content">
|
||||
<image src="/static/pageC/homepage.png" mode=""></image>
|
||||
<view class="loginmount" @tap='gologin'>
|
||||
<view class="loginmount">
|
||||
<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 class="contentcenter">
|
||||
@ -26,7 +27,7 @@
|
||||
服务预约
|
||||
</view>
|
||||
</view>
|
||||
<view class="home">
|
||||
<view class="home" @tap="count">
|
||||
<image src="/static/pageC/exchange.png" mode=""></image>
|
||||
<view class="name">
|
||||
积分兑换
|
||||
@ -59,29 +60,72 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getOpenId,
|
||||
getCurrentUser
|
||||
getCurrentUser,
|
||||
detail
|
||||
|
||||
} from '@/api/pages/homepage/homepage.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
openid: null,
|
||||
title: 'Hello',
|
||||
patientName:'',
|
||||
userinfo:{},
|
||||
identity:'',
|
||||
cityCode:'',
|
||||
Code:'',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.login()
|
||||
},
|
||||
onShow() {
|
||||
this.openid = uni.getStorageSync('openid');
|
||||
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: {
|
||||
nologin() {
|
||||
// 登录
|
||||
login(){
|
||||
this.gologin();
|
||||
|
||||
},
|
||||
gologin() {
|
||||
this.$refs.uToast.show({
|
||||
title: '您未登录,请先登录',
|
||||
type: 'error',
|
||||
@ -89,115 +133,214 @@
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
},
|
||||
//家医签约
|
||||
goonline() {
|
||||
if (this.openid) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/mysigning/mysigning'
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url: '/pagesC/Onlinesigning/Onlinesigning'
|
||||
// })
|
||||
} else {
|
||||
this.nologin()
|
||||
}
|
||||
// 是否签约
|
||||
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.openid) {
|
||||
if(!this.userinfo){
|
||||
this.gologin();
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/Healthrecords/Healthrecords'
|
||||
})
|
||||
} else {
|
||||
this.nologin()
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
// 筛查记录
|
||||
gorecords() {
|
||||
if (this.openid) {
|
||||
if(!this.userinfo){
|
||||
this.gologin();
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/Screeningrecords/Screeningrecords'
|
||||
})
|
||||
} else {
|
||||
this.nologin()
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
// 健康自评
|
||||
healthtest() {
|
||||
if (this.openid) {
|
||||
if(!this.userinfo){
|
||||
this.gologin();
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/healthtest/healthtest'
|
||||
})
|
||||
} else {
|
||||
this.nologin()
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 体征检测
|
||||
sign() {
|
||||
if (this.openid) {
|
||||
if(!this.userinfo){
|
||||
this.gologin();
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/Physicalexamination/Physicalexamination'
|
||||
})
|
||||
} else {
|
||||
this.nologin()
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 服务预约
|
||||
goappoint() {
|
||||
if (this.openid) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/ServiceAppointment/ServiceAppointment'
|
||||
})
|
||||
} else {
|
||||
this.nologin()
|
||||
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: '/pagesC/ServiceAppointment/ServiceAppointment'
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
// 服务记录
|
||||
servicerecord() {
|
||||
if (this.openid) {
|
||||
if(!this.userinfo){
|
||||
this.gologin();
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/servicerecord/servicerecord'
|
||||
})
|
||||
} else {
|
||||
this.nologin()
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
// 我的预约
|
||||
myappointment() {
|
||||
if (this.openid) {
|
||||
if(!this.userinfo){
|
||||
this.gologin();
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/Myappointment/Myappointment'
|
||||
})
|
||||
} else {
|
||||
this.nologin()
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
gologin() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
},
|
||||
login() {
|
||||
const _this = this
|
||||
uni.login({
|
||||
success(res) {
|
||||
getOpenId(res.code).then(Res => {
|
||||
if (Res.code == 200) {
|
||||
_this.isWxBing(Res.msg, '1')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
isWxBing(openid, cityCode) {
|
||||
getCurrentUser(openid, cityCode).then(res => {
|
||||
console.log(res);
|
||||
if (!res.data) {
|
||||
// 注册
|
||||
}
|
||||
})
|
||||
}
|
||||
// login() {
|
||||
// const _this = this
|
||||
// uni.login({
|
||||
// success(res) {
|
||||
// getOpenId(res.code).then(Res => {
|
||||
// if (Res.code == 200) {
|
||||
// _this.isWxBing(Res.msg, '1')
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
return {
|
||||
phonecode: undefined,
|
||||
logincode: undefined,
|
||||
code:undefined,
|
||||
timer: undefined,
|
||||
scenenurseStationId: undefined
|
||||
};
|
||||
@ -28,6 +29,7 @@
|
||||
onShow() {
|
||||
this.phonecode = undefined
|
||||
this.logincode = undefined
|
||||
this.code = undefined
|
||||
this.scenenurseStationId = uni.getStorageSync('scenenurseStationId');
|
||||
},
|
||||
methods: {
|
||||
@ -38,16 +40,19 @@
|
||||
wx.login({
|
||||
provider: 'weixin',
|
||||
success: function(loginRes) {
|
||||
that.logincode = loginRes.code
|
||||
console.log(loginRes)
|
||||
|
||||
// uni.$emit('code',loginRes.code)
|
||||
that.code = loginRes.code
|
||||
that.pwdlogin();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
login() {
|
||||
getWeChatUser(this.logincode, this.phonecode).then(res => {
|
||||
getWeChatUser(this.code).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.setStorageSync("openid", res.data.openid)
|
||||
uni.setStorageSync("openid", res.data)
|
||||
uni.setStorageSync("patientId", res.data.id)
|
||||
uni.setStorageSync("phone", res.data.phone)
|
||||
this.$refs.uToast.show({
|
||||
@ -55,17 +60,18 @@
|
||||
type: 'success',
|
||||
duration: '1500'
|
||||
})
|
||||
console.log(this.logincode)
|
||||
this.phonecode = undefined
|
||||
this.logincode = undefined
|
||||
uni.setStorageSync("Refresh", 'Refresh')
|
||||
if (this.timer) {
|
||||
clearTimeout(this.timer)
|
||||
}
|
||||
this.timer = setTimeout(e => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
// this.timer = setTimeout(e => {
|
||||
// uni.navigateBack({
|
||||
// delta: 1
|
||||
// })
|
||||
// }, 500)
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: '登录失败',
|
||||
@ -78,13 +84,17 @@
|
||||
pwdlogin() {
|
||||
var that = this
|
||||
uni.clearStorageSync();
|
||||
createMobileToken().then(res => {
|
||||
uni.setStorageSync("token", res.data.token)
|
||||
if (this.scenenurseStationId) {
|
||||
uni.setStorageSync("scenenurseStationId", this.scenenurseStationId)
|
||||
}
|
||||
that.login()
|
||||
uni.navigateTo({
|
||||
url:`/pages/register/register?code=${this.logincode}`
|
||||
})
|
||||
that.login()
|
||||
// createMobileToken().then(res => {
|
||||
// uni.setStorageSync("token", res.data.token)
|
||||
// if (this.scenenurseStationId) {
|
||||
// uni.setStorageSync("scenenurseStationId", this.scenenurseStationId)
|
||||
// }
|
||||
// that.login()
|
||||
// })
|
||||
},
|
||||
}, //1.分享给朋友
|
||||
onShareAppMessage(res) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user