流程初步走通
This commit is contained in:
parent
9a713fdfb9
commit
93198dc163
@ -13,4 +13,7 @@ npm run dev
|
|||||||
### Compiles and minifies for production
|
### Compiles and minifies for production
|
||||||
```
|
```
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
TODO:
|
||||||
|
1.部分代码需要重构
|
||||||
|
2.优化部分流程
|
66
app.js
66
app.js
@ -11,30 +11,54 @@ App({
|
|||||||
// var logs = wx.getStorageSync('logs') || []
|
// var logs = wx.getStorageSync('logs') || []
|
||||||
// logs.unshift(Date.now())
|
// logs.unshift(Date.now())
|
||||||
// wx.setStorageSync('logs', logs)
|
// wx.setStorageSync('logs', logs)
|
||||||
var openId = wx.getStorageSync('openId') || '';
|
let userInfo = wx.getStorageSync('userinfo');
|
||||||
|
let openId = wx.getStorageSync('openId') || '';
|
||||||
this.globalData.openId = openId
|
this.globalData.openId = openId
|
||||||
|
if (userInfo) {
|
||||||
|
this.globalData.userInfo = userInfo;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (openId) { // 已经有openid了 可以直接获取用户信息
|
if (openId) { // 已经有openid了 可以直接获取用户信息
|
||||||
console.log('init get user info');
|
console.log('init get user info');
|
||||||
await this.getUserInfo(openId);
|
await this.getUserInfo(openId);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
// 登录并获取openid
|
console.log('await user login');
|
||||||
wx.login({
|
let code = await this.getLoginCode();
|
||||||
success: res => {
|
if (code) {
|
||||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
await this.processLogin(code);
|
||||||
console.log('login==>', res);
|
}
|
||||||
if (res.errMsg == 'login:ok') {
|
|
||||||
this.processLogin(res.code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
|
|
||||||
},
|
},
|
||||||
|
async getLoginCode() {
|
||||||
|
let loginCode = null;
|
||||||
|
// 登录并获取openid
|
||||||
|
try {
|
||||||
|
loginCode = await (() => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
wx.login({
|
||||||
|
success: res => {
|
||||||
|
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||||
|
console.log('login==>', res);
|
||||||
|
if (res.errMsg == 'login:ok') {
|
||||||
|
resolve(res.code)
|
||||||
|
} else {
|
||||||
|
reject(res);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
reject(res);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})();
|
||||||
|
} catch (e) {
|
||||||
|
console.log('get login code error,', e);
|
||||||
|
}
|
||||||
|
return loginCode;
|
||||||
|
},
|
||||||
async processLogin(code) {
|
async processLogin(code) {
|
||||||
try {
|
try {
|
||||||
let data = await api.userLogin(code);
|
let data = await api.userLogin(code);
|
||||||
@ -49,11 +73,11 @@ App({
|
|||||||
},
|
},
|
||||||
getOpenId() {
|
getOpenId() {
|
||||||
return new Promise(async(resolve, reject) => {
|
return new Promise(async(resolve, reject) => {
|
||||||
if(this.globalData.openId){
|
if (this.globalData.openId) {
|
||||||
resolve(this.globalData.openId)
|
resolve(this.globalData.openId)
|
||||||
}else{
|
} else {
|
||||||
wx.login({
|
wx.login({
|
||||||
success:async res => {
|
success: async res => {
|
||||||
if (res.errMsg == 'login:ok') {
|
if (res.errMsg == 'login:ok') {
|
||||||
await this.processLogin(res.code);
|
await this.processLogin(res.code);
|
||||||
resolve(this.globalData.openId)
|
resolve(this.globalData.openId)
|
||||||
@ -62,7 +86,7 @@ App({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getUserInfo() {
|
async getUserInfo() {
|
||||||
try {
|
try {
|
||||||
let openid = this.globalData.openId;
|
let openid = this.globalData.openId;
|
||||||
@ -73,7 +97,11 @@ App({
|
|||||||
console.log('init user info error', e);
|
console.log('init user info error', e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async refreshUserInfo() {
|
||||||
|
let userInfo = await api.userInfo(null, false);
|
||||||
|
console.log('refresh user info data', userInfo);
|
||||||
|
this.globalData.userInfo = userInfo;
|
||||||
|
},
|
||||||
globalData: {
|
globalData: {
|
||||||
wxuserInfo: null,
|
wxuserInfo: null,
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
|
4
app.json
4
app.json
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
"pages/init/userinfo",
|
"pages/user/index",
|
||||||
"pages/user/result",
|
"pages/user/result",
|
||||||
"pages/user/evaluation",
|
"pages/user/evaluation",
|
||||||
"pages/user/index",
|
"pages/init/userinfo",
|
||||||
"pages/init/agreement"
|
"pages/init/agreement"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
|
@ -7,7 +7,7 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
bindAgreeTap: function () {
|
bindAgreeTap: function () {
|
||||||
wx.navigateTo({
|
wx.redirectTo({
|
||||||
url: 'userinfo',
|
url: 'userinfo',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,24 @@
|
|||||||
import allCities from './../../utils/allCities.js';
|
import allCities from './../../utils/allCities.js';
|
||||||
import api from './../../utils/api.js';
|
import api from './../../utils/api.js';
|
||||||
|
|
||||||
// const { regeneratorRuntime } = global
|
const medicalList = [
|
||||||
|
{ checked: false, text: '慢性支气管炎、支气管哮喘、支气管扩张病、肺心病' },
|
||||||
|
{ checked: false, text: '高血压、冠心病、心肌病、先天性心脏病、风湿性心脏病' },
|
||||||
|
{ checked: false, text: '反流性食道炎、慢性胃炎、胃溃疡、慢性胰腺炎、肠易激惹综合征、结肠炎' },
|
||||||
|
{ checked: false, text: '3个月内脑梗塞和/或脑出血、癫痫、脑炎、脑膜炎' },
|
||||||
|
{ checked: false, text: '特发性或继发性肺动脉高压症' },
|
||||||
|
{ checked: false, text: '其他疾病' }
|
||||||
|
];
|
||||||
|
const smokeList = [
|
||||||
|
{ checked: false, text: '不吸烟' },
|
||||||
|
{ checked: false, text: '10支/天以下' },
|
||||||
|
{ checked: false, text: '10~20支/天' },
|
||||||
|
{ checked: false, text: '20支/天以上' }
|
||||||
|
];
|
||||||
|
const cacheData = {
|
||||||
|
key:'',
|
||||||
|
value:''
|
||||||
|
};
|
||||||
const app =getApp();
|
const app =getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@ -17,29 +34,20 @@ Page({
|
|||||||
realname: '',
|
realname: '',
|
||||||
},
|
},
|
||||||
subjects: {
|
subjects: {
|
||||||
smoke: [
|
smoke: [],
|
||||||
'不吸烟',
|
medical_histories: []
|
||||||
'10支/天以下',
|
|
||||||
'10~20支/天',
|
|
||||||
'20支/天以上',
|
|
||||||
],
|
|
||||||
medical_histories: [
|
|
||||||
'慢性支气管炎、支气管哮喘、支气管扩张病、肺心病',
|
|
||||||
'高血压、冠心病、心肌病、先天性心脏病、风湿性心脏病',
|
|
||||||
'反流性食道炎、慢性胃炎、胃溃疡、慢性胰腺炎、肠易激惹综合征、结肠炎',
|
|
||||||
'3个月内脑梗塞和/或脑出血、癫痫、脑炎、脑膜炎',
|
|
||||||
'特发性或继发性肺动脉高压症',
|
|
||||||
'其他疾病'
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
provinces: allCities,
|
provinces: allCities,
|
||||||
cities: allCities[0].children,
|
cities: allCities[0].children,
|
||||||
|
province:0,
|
||||||
|
city:0,
|
||||||
showRecord: true,
|
showRecord: true,
|
||||||
dialog: {
|
dialog: {
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
default: '',
|
default: '请输入',
|
||||||
show: false,
|
show: false,
|
||||||
value: ''
|
value: '',
|
||||||
|
key:null
|
||||||
},
|
},
|
||||||
userDetail: {},
|
userDetail: {},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
@ -59,13 +67,43 @@ Page({
|
|||||||
evaluationData.forEach((o,i) => {
|
evaluationData.forEach((o,i) => {
|
||||||
tags.push(true);
|
tags.push(true);
|
||||||
})
|
})
|
||||||
|
let d = app.globalData.userInfo.detail;
|
||||||
|
medicalList.forEach((o, i) => {
|
||||||
|
medicalList[i].checked = d.medical_history.indexOf(i) != -1
|
||||||
|
})
|
||||||
|
smokeList[d.smoke].checked = true;
|
||||||
|
// d['address'] = this.parseUserAddress(
|
||||||
|
// d.province,d.city
|
||||||
|
// )
|
||||||
this.setData({
|
this.setData({
|
||||||
userDetail:app.globalData.userInfo.detail,
|
userDetail:d,
|
||||||
userInfo: app.globalData.userInfo,
|
userInfo: app.globalData.userInfo,
|
||||||
dataList: evaluationData,
|
dataList: evaluationData,
|
||||||
collapseTags: tags
|
collapseTags: tags,
|
||||||
|
subjects: {
|
||||||
|
smoke:smokeList,
|
||||||
|
medical_histories: medicalList
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
parseUserAddress(province,city){
|
||||||
|
if (province && province > 0){
|
||||||
|
for(var i = 0;i < allCities.length;i++){
|
||||||
|
if(allCities[i].code == province){
|
||||||
|
if (!city || city < 1){
|
||||||
|
return allCities[i].name;
|
||||||
|
}
|
||||||
|
for (var j = 0; j < allCities[i].children.length;j ++){
|
||||||
|
if(allCities[i].children[j].code == city){
|
||||||
|
return allCities[i].name + ' ' + allCities[i].children[j].name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '未知';
|
||||||
|
},
|
||||||
switchView() {
|
switchView() {
|
||||||
this.setData({
|
this.setData({
|
||||||
showRecord: !this.data.showRecord
|
showRecord: !this.data.showRecord
|
||||||
@ -79,19 +117,51 @@ Page({
|
|||||||
collapseTags: this.data.collapseTags
|
collapseTags: this.data.collapseTags
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/* 输入框相关样式 */
|
||||||
bindDialogInput: function(e) {
|
bindDialogInput: function(e) {
|
||||||
this.setData({
|
this.setDialog('value',e.detail.value)
|
||||||
dialog: {
|
},
|
||||||
value: e.detail.value
|
|
||||||
}
|
async updateUserDetail(key,value){
|
||||||
})
|
try{
|
||||||
|
let data = {};
|
||||||
|
data[key] = value
|
||||||
|
await api.updateUserDetail(data)
|
||||||
|
this.setUserDetail(key,value);
|
||||||
|
}catch(e){
|
||||||
|
console.log('update error',e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setUserDetail(key, value) {
|
||||||
|
let d = this.data.userDetail;
|
||||||
|
d[key] = value;
|
||||||
|
this.setData({ userDetail: d });
|
||||||
|
},
|
||||||
|
setDialog(key,value){
|
||||||
|
/*
|
||||||
|
title: '姓名',
|
||||||
|
default: '请输入',
|
||||||
|
show: false,
|
||||||
|
value: '',
|
||||||
|
key:null
|
||||||
|
*/
|
||||||
|
let d = this.data.dialog;
|
||||||
|
d[key] = value;
|
||||||
|
this.setData({dialog:d});
|
||||||
},
|
},
|
||||||
hideInputDialog() {
|
hideInputDialog() {
|
||||||
this.setData({
|
this.setDialog('show',false);
|
||||||
dialog: {
|
},
|
||||||
show: false
|
checkInputDialog(){
|
||||||
}
|
let data = this.data.dialog.value
|
||||||
})
|
if(!data){
|
||||||
|
wx.showToast({
|
||||||
|
title: '请填写内容后确定',icon:'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.hideInputDialog();
|
||||||
|
this.updateUserDetail(this.data.dialog.key,data);
|
||||||
},
|
},
|
||||||
showModal(e) {
|
showModal(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -103,13 +173,72 @@ Page({
|
|||||||
modalName: null
|
modalName: null
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
async updateAddress() {
|
||||||
|
|
||||||
|
let { province,city,userDetail} = this.data;
|
||||||
|
let privinceCode = allCities[province].code,
|
||||||
|
cityCode = allCities[province].children[city].code,
|
||||||
|
address = allCities[province].name + ' ' + allCities[province].children[city].name;
|
||||||
|
this.hideModal();
|
||||||
|
if (privinceCode == userDetail.province && cityCode == userDetail.city){
|
||||||
|
console.log('not modify');
|
||||||
|
}else{
|
||||||
|
// 更新地址
|
||||||
|
await api.updateUserDetail({
|
||||||
|
province:privinceCode,
|
||||||
|
city:cityCode,
|
||||||
|
address
|
||||||
|
})
|
||||||
|
this.setUserDetail('province', privinceCode);
|
||||||
|
this.setUserDetail('city', cityCode);
|
||||||
|
this.setUserDetail('address', address);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 城市选择
|
||||||
bindCityChange(e) {
|
bindCityChange(e) {
|
||||||
let data = e.detail.value;
|
let data = e.detail.value;
|
||||||
|
let province = data[0],city = data[1]
|
||||||
this.setData({
|
this.setData({
|
||||||
cities: allCities[data[0]].children
|
cities: allCities[province].children,
|
||||||
|
province,city
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
showAlert() {
|
// 显示可输入的值
|
||||||
|
showAlert(e) {
|
||||||
|
let key = e.currentTarget.dataset.key;
|
||||||
|
let title = e.currentTarget.dataset.title;
|
||||||
|
let value = this.data.userDetail[key];
|
||||||
|
this.setData({
|
||||||
|
dialog:{
|
||||||
|
default: '请输入' + title,
|
||||||
|
show: true,
|
||||||
|
title,value,key
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
noTap() { },
|
||||||
|
bindSelectChange(e){
|
||||||
|
cacheData.key = e.currentTarget.dataset.key;
|
||||||
|
cacheData.value = e.detail.value;
|
||||||
|
if (Array.isArray(cacheData.value)){
|
||||||
|
cacheData.value.forEach((v,i)=>{
|
||||||
|
cacheData.value[i] = parseInt(v);
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
cacheData.value = parseInt(cacheData.value);
|
||||||
|
}
|
||||||
|
console.log(cacheData);
|
||||||
|
},
|
||||||
|
// 更新数据
|
||||||
|
async updateSelectData(e){
|
||||||
|
this.hideModal();
|
||||||
|
if(!cacheData.key){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cacheData.value = Array.isArray(cacheData.value) ? cacheData.value.join(',') : cacheData.value;
|
||||||
|
var data = {};
|
||||||
|
data[cacheData.key] = cacheData.value;
|
||||||
|
await api.updateUserDetail(data)
|
||||||
|
this.setUserDetail(cacheData.key, cacheData.value);
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -1,13 +1,13 @@
|
|||||||
<!--pages/user/index.wxml-->
|
<!--pages/user/index.wxml-->
|
||||||
<view class="cu-list menu-avatar user-info">
|
<view class="cu-list menu-avatar user-info">
|
||||||
<view class="cu-item" bindtap="onUserInfoTap">
|
<view class="cu-item">
|
||||||
<view class="cu-avatar round lg" style="background-image:url({{userInfo.avatarUrl}});"></view>
|
<view class="cu-avatar round lg" style="background-image:url({{userInfo.avatarUrl}});"></view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="">
|
<view class="">
|
||||||
<text class="text-cut nickname">{{userDetail.realname}}</text>
|
<text class="text-cut nickname">{{userDetail.realname}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class=" text-sm flex">
|
<view class=" text-sm flex">
|
||||||
<text class="text-cut">地区: <text>{{userInfo.address}}</text></text>
|
<text class="text-cut">地区: <text>{{userDetail.address}}</text></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="action" bindtap="switchView">
|
<view class="action" bindtap="switchView">
|
||||||
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{showRecord}}">
|
<!-- 评估数据列表 -->
|
||||||
|
<view class="evaluation" wx:if="{{showRecord}}">
|
||||||
<view class="collapse">
|
<view class="collapse">
|
||||||
<view class="item" wx:for="{{dataList}}" wx:key="collapse_item" wx:for-item="item">
|
<view class="item" wx:for="{{dataList}}" wx:key="collapse_item" wx:for-item="item">
|
||||||
<view class="title" bindtap="toggleCollapse" data-index="{{index}}">
|
<view class="title" bindtap="toggleCollapse" data-index="{{index}}">
|
||||||
@ -77,7 +78,7 @@
|
|||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">姓名</view>
|
<view class="title">姓名</view>
|
||||||
|
|
||||||
<view class="action" bindtap="showAlert">
|
<view class="action" bindtap="showAlert" data-key="realname" data-title="姓名">
|
||||||
<view class="">
|
<view class="">
|
||||||
{{userDetail.realname}}
|
{{userDetail.realname}}
|
||||||
<text class="cuIcon-right"></text>
|
<text class="cuIcon-right"></text>
|
||||||
@ -98,8 +99,7 @@
|
|||||||
<!-- 年龄 -->
|
<!-- 年龄 -->
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">年龄</view>
|
<view class="title">年龄</view>
|
||||||
|
<view class="action" bindtap="showAlert" data-key="age" data-title="年龄">
|
||||||
<view class="action" bindtap="showModal" data-target="ChooseModal">
|
|
||||||
<view class="">
|
<view class="">
|
||||||
{{userDetail.age}}
|
{{userDetail.age}}
|
||||||
<text class="cuIcon-right"></text>
|
<text class="cuIcon-right"></text>
|
||||||
@ -109,8 +109,7 @@
|
|||||||
<!-- 身高 -->
|
<!-- 身高 -->
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">身高</view>
|
<view class="title">身高</view>
|
||||||
|
<view class="action" bindtap="showAlert" data-key="height" data-title="身高">
|
||||||
<view class="action" bindtap="showModal" data-target="ChooseModal">
|
|
||||||
<view class="">
|
<view class="">
|
||||||
{{userDetail.height}}cm
|
{{userDetail.height}}cm
|
||||||
<text class="cuIcon-right"></text>
|
<text class="cuIcon-right"></text>
|
||||||
@ -120,7 +119,7 @@
|
|||||||
<!-- 体重 -->
|
<!-- 体重 -->
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">体重</view>
|
<view class="title">体重</view>
|
||||||
<view class="action" bindtap="showModal" data-target="ChooseModal">
|
<view class="action" bindtap="showAlert" data-key="weight" data-title="体重">
|
||||||
<view class="">
|
<view class="">
|
||||||
{{userDetail.weight}}kg
|
{{userDetail.weight}}kg
|
||||||
<text class="cuIcon-right"></text>
|
<text class="cuIcon-right"></text>
|
||||||
@ -133,12 +132,21 @@
|
|||||||
<view class="title">世居地</view>
|
<view class="title">世居地</view>
|
||||||
<view class="action" bindtap="showModal" data-target="ChooseCityModal">
|
<view class="action" bindtap="showModal" data-target="ChooseCityModal">
|
||||||
<view class="">
|
<view class="">
|
||||||
北京市 东城区
|
{{userDetail.address}}
|
||||||
<text class="cuIcon-right"></text>
|
<text class="cuIcon-right"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseCityModal'?'show':''}}" bindtap="hideModal">
|
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseCityModal'?'show':''}}" bindtap="hideModal">
|
||||||
<view class="cu-dialog" catchtap>
|
<view class="cu-dialog" catchtap>
|
||||||
|
<view class="row actionsheet-btns">
|
||||||
|
<view class="col text-left">
|
||||||
|
<text class="" bindtap="hideModal">取消</text>
|
||||||
|
</view>
|
||||||
|
<view class="col text-right">
|
||||||
|
<text class="text-red" bindtap="updateAddress">确定</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
<picker-view indicator-style="height: 36px;" style="width: 100%; height: 200px;" value="{{value}}" bindchange="bindCityChange">
|
<picker-view indicator-style="height: 36px;" style="width: 100%; height: 200px;" value="{{value}}" bindchange="bindCityChange">
|
||||||
<picker-view-column>
|
<picker-view-column>
|
||||||
<view wx:for="{{provinces}}" wx:key="item" style="line-height: 36px">{{item.name}}</view>
|
<view wx:for="{{provinces}}" wx:key="item" style="line-height: 36px">{{item.name}}</view>
|
||||||
@ -152,28 +160,104 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 首次进藏 -->
|
<!-- 首次进藏 -->
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">抽次进藏</view>
|
<view class="title">首次进藏</view>
|
||||||
<view class="action" bindtap="showModal" data-target="ChooseModal">
|
<view class="action" bindtap="showModal" data-target="ChooseTibetModal">
|
||||||
<view class="">
|
<view class="">
|
||||||
{{userDetail.gender==1?'是':'否'}}
|
{{userDetail.is_first_to_tibet==1?'是':'否'}}
|
||||||
<text class="cuIcon-right"></text>
|
<text class="cuIcon-right"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseModal'?'show':''}}" bindtap="hideModal">
|
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseTibetModal'?'show':''}}" catchtap="hideModal" >
|
||||||
<view class="cu-dialog" catchtap>
|
<view class="cu-dialog" catchtap="noTap">
|
||||||
<view class="list-item-se">
|
<view class="list-item-se">
|
||||||
<text class="dialog-head-title">首次进藏</text>
|
<text class="dialog-head-title">首次进藏</text>
|
||||||
<radio-group>
|
<radio-group bindchange="bindSelectChange" data-key="is_first_to_tibet">
|
||||||
<label class="radio" c>
|
<view class="item">
|
||||||
<radio value="1" checked="true" />是
|
<label class="radio" c>
|
||||||
</label>
|
<radio value="1" checked="true" checked="{{userDetail.is_first_to_tibet == 1}}" />是
|
||||||
<label class="radio">
|
</label>
|
||||||
<radio value="0" />否
|
</view>
|
||||||
</label>
|
<view class="item">
|
||||||
|
<label class="radio">
|
||||||
|
<radio value="0" checked="{{userDetail.is_first_to_tibet == 0}}" />否
|
||||||
|
</label>
|
||||||
|
</view>
|
||||||
</radio-group>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view>
|
<view>
|
||||||
<button class="text-red" bindtap="hideModal">确定</button>
|
<button class="text-red" bindtap="updateSelectData">确定</button>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<button bindtap="hideModal">取消</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 饮酒情况 -->
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">饮酒情况</view>
|
||||||
|
<view class="action" bindtap="showModal" data-target="ChooseDrinkModal">
|
||||||
|
<view class="">
|
||||||
|
{{userDetail.drink==1?'长期饮酒':'不饮酒'}}
|
||||||
|
<text class="cuIcon-right"></text>
|
||||||
|
</view>
|
||||||
|
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseDrinkModal'?'show':''}}" catchtap="hideModal" >
|
||||||
|
<view class="cu-dialog" catchtap="noTap">
|
||||||
|
<view class="list-item-se">
|
||||||
|
<text class="dialog-head-title">饮酒情况</text>
|
||||||
|
<radio-group bindchange="bindSelectChange" data-key="drink">
|
||||||
|
<view class="item">
|
||||||
|
<label class="radio">
|
||||||
|
<radio value="1" checked="{{userDetail.drink == 1}}" />长期饮酒
|
||||||
|
</label>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<label class="radio">
|
||||||
|
<radio value="0" checked="{{userDetail.drink == 0}}" />不饮酒
|
||||||
|
</label>
|
||||||
|
</view>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
<view class="btns">
|
||||||
|
<view>
|
||||||
|
<button class="text-red" bindtap="updateSelectData">确定</button>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<button bindtap="hideModal">取消</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 抽烟情况 -->
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">抽烟情况</view>
|
||||||
|
<view class="action" bindtap="showModal" data-target="ChooseSmokeModal">
|
||||||
|
<view class="">
|
||||||
|
{{subjects.smoke[userDetail.smoke].text}}
|
||||||
|
<text class="cuIcon-right"></text>
|
||||||
|
</view>
|
||||||
|
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseSmokeModal'?'show':''}}" catchtap="hideModal">
|
||||||
|
<view class="cu-dialog" catchtap="noTap">
|
||||||
|
<view class="list-item-se">
|
||||||
|
<text class="dialog-head-title">抽烟情况</text>
|
||||||
|
<radio-group bindchange="bindSelectChange" data-key="smoke">
|
||||||
|
<view class="item" wx:for="{{subjects.smoke}}" wx:key="item">
|
||||||
|
<label class="radio">
|
||||||
|
<radio value="{{index}}" checked="{{item.checked}}" />
|
||||||
|
<text>{{item.text}}</text>
|
||||||
|
</label>
|
||||||
|
</view>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
<view class="btns">
|
||||||
|
<view>
|
||||||
|
<button class="text-red" bindtap="updateSelectData">确定</button>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<button bindtap="hideModal">取消</button>
|
<button bindtap="hideModal">取消</button>
|
||||||
@ -184,35 +268,30 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 既往病史 -->
|
<!-- 既往病史 -->
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group" bindtap="showModal" data-target="ChooseModal">
|
||||||
<view class="title">既往病史</view>
|
<view class="title">既往病史</view>
|
||||||
<!-- <picker bindchange="PickerChange" value="{{index}}" range="{{userInfo.subjects.medical_histories}}">
|
|
||||||
<view class="picker">
|
|
||||||
{{index?userInfo.subjects.medical_histories[index]:'禁止换行,超出容器部分会以 ... 方式截断'}}
|
|
||||||
</view>
|
|
||||||
</picker> -->
|
|
||||||
|
|
||||||
<view class="action" bindtap="showModal" data-target="ChooseModal">
|
<view class="action">
|
||||||
<view class="">
|
<view class="">
|
||||||
<text class="cuIcon-right"></text>
|
<text class="cuIcon-right"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseModal'?'show':''}}" bindtap="hideModal">
|
<view class="cu-modal actionsheet bottom-modal {{modalName=='ChooseModal'?'show':''}}" catchtap="hideModal">
|
||||||
<view class="cu-dialog" catchtap>
|
<view class="cu-dialog" catchtap="noTap">
|
||||||
<view class=" medical-info-select">
|
<view class=" medical-info-select">
|
||||||
<text class="dialog-head-title">既往疾病(多选)</text>
|
<text class="dialog-head-title">既往疾病(多选)</text>
|
||||||
<checkbox-group>
|
<checkbox-group bindchange="bindSelectChange" data-key="medical_history">
|
||||||
<view class="item" wx:for="{{subjects.medical_histories}}" wx:key="item">
|
<view class="item" wx:for="{{subjects.medical_histories}}" wx:key="item">
|
||||||
<label>
|
<label>
|
||||||
<checkbox value="{{index}}" />
|
<checkbox value="{{index}}" checked="{{item.checked}}" />
|
||||||
<text>{{item}}</text>
|
<text>{{item.text}}</text>
|
||||||
</label>
|
</label>
|
||||||
</view>
|
</view>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view>
|
<view>
|
||||||
<button class="text-red" bindtap="hideModal">确定</button>
|
<button class="text-red" bindtap="updateSelectData">确定</button>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<button bindtap="hideModal">取消</button>
|
<button bindtap="hideModal">取消</button>
|
||||||
@ -231,7 +310,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="toast-main">
|
<view class="toast-main">
|
||||||
<view class="toast-input">
|
<view class="toast-input">
|
||||||
<input placeholder="请输入" bindinput="setValue" data-name="stuEidtName" />
|
<input placeholder="{{dialog.default}}" value="{{dialog.value}}" bindinput="bindDialogInput" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="toast-button">
|
<view class="toast-button">
|
||||||
@ -239,7 +318,7 @@
|
|||||||
<button bindtap="hideInputDialog">取消</button>
|
<button bindtap="hideInputDialog">取消</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="button2">
|
<view class="button2">
|
||||||
<button bindtap="hideInputDialog">确定</button>
|
<button bindtap="checkInputDialog">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -25,34 +25,40 @@ text.nickname {
|
|||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox-group {
|
checkbox-group,radio-group {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox-group .item {
|
.cu-dialog .item {
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox-group .item:last-child {
|
.cu-dialog.item:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox-group .item>label {
|
.cu-dialog .item>label {
|
||||||
display: flex;
|
display: flex;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox-group .item>label>checkbox {
|
.cu-dialog .item>label>checkbox,
|
||||||
|
.cu-dialog .item>label>radio {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.medical-info-select {
|
.medical-info-select,.cu-dialog .list-item-se {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
.medical-info-select .item,.cu-dialog .item{
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
.cu-dialog .list-item-se radio-group{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
/* dialog */
|
/* dialog */
|
||||||
|
|
||||||
.toast-box {
|
.toast-box {
|
||||||
@ -131,8 +137,9 @@ checkbox-group .item>label>checkbox {
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-button button:active {
|
.toast-button button:hover {
|
||||||
background-color: solid 1px rgba(220, 223, 230, 0.7) !important;
|
background-color: rgba(220, 223, 230, 0.4) !important;
|
||||||
|
color:#000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.picker {
|
.picker {
|
||||||
@ -194,7 +201,7 @@ checkbox-group .item>label>checkbox {
|
|||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
.text-right>text {
|
.evaluation .text-right>text {
|
||||||
background-color: #259b24;
|
background-color: #259b24;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -231,3 +238,25 @@ checkbox-group .item>label>checkbox {
|
|||||||
.result .level-3 {
|
.result .level-3 {
|
||||||
color: #e51c23;
|
color: #e51c23;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cu-modal{
|
||||||
|
/* background: rgba(220, 223, 230, 0.4); */
|
||||||
|
}
|
||||||
|
.actionsheet-btns{
|
||||||
|
background: #fff;
|
||||||
|
padding:20rpx;
|
||||||
|
}
|
||||||
|
.actionsheet-btns .col{
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
.actionsheet-btns::after{
|
||||||
|
content: ' ';
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
.actionsheet-btns .left{
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
.actionsheet-btns .right{
|
||||||
|
float:right;
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
const API_URL = 'http://127.0.0.1:8000';
|
const API_URL = 'http://192.168.10.121:8000';
|
||||||
|
|
||||||
const getOpenId = () => {
|
const getOpenId = () => {
|
||||||
return getApp().globalData.openId;
|
return getApp().globalData.openId;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user