7.14 提交
This commit is contained in:
+81
-22
@@ -1,17 +1,19 @@
|
||||
// index.js
|
||||
const app = getApp()
|
||||
import {caseList,getExpertSign,getProjectStatus,getBankInfo,getfangxinSite} from "../../api/api"
|
||||
import {caseList,getExpertSign,getProjectStatus,getBankInfo,getfangxinSite,limitCount,getDeal} from "../../api/api"
|
||||
import {throttle} from "../../utils/util"
|
||||
import {createStoreBindings} from "mobx-miniprogram-bindings"
|
||||
import {store} from '../../store/store.js'
|
||||
Page({
|
||||
data: {
|
||||
showDelDraft:false,
|
||||
authMessage:'',
|
||||
showAuth:false,
|
||||
editId:'',
|
||||
showDraft:true,
|
||||
reason:'',
|
||||
status_title:'病例状态',
|
||||
casetype_title:'病例类型',
|
||||
casetype_title:'治疗类型',
|
||||
draftTime:'',
|
||||
caseDraft:{},
|
||||
hasDraft:false,
|
||||
@@ -24,11 +26,11 @@ Page({
|
||||
{ text: '已通过', value: 1,select:false },
|
||||
],
|
||||
typeList:[{
|
||||
text:'四次及以上疗程化',
|
||||
text:'DPMAS及联合模式',
|
||||
value:1,
|
||||
select:false,
|
||||
},{
|
||||
text:'早前期(INR≤1.5)',
|
||||
text:'CA280及联合模式',
|
||||
value:2,
|
||||
select:false,
|
||||
}],
|
||||
@@ -51,9 +53,44 @@ Page({
|
||||
pageSize:10,
|
||||
img_host:app.hostConfig().imghost
|
||||
},
|
||||
handleGetDeal(){
|
||||
getDeal().then(res=>{
|
||||
this.setData({
|
||||
authMessage:res,
|
||||
showAuth:true
|
||||
})
|
||||
})
|
||||
},
|
||||
getAuthStatus(){
|
||||
getProjectStatus().then(res=>{
|
||||
getBankInfo().then(result=>{
|
||||
if(result){
|
||||
getExpertSign().then(response=>{
|
||||
if(response.taskStatus==2){
|
||||
this.handleGetDeal()
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.handleGetDeal()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleGetProjectStatus(){
|
||||
getProjectStatus().then(res=>{
|
||||
this.handleGetSign()
|
||||
limitCount({
|
||||
type:4
|
||||
}).then(result=>{
|
||||
if(result<4){
|
||||
this.handleGetSign()
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '每人参与病例征集不得超过20例',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}).catch((error)=>{
|
||||
if(error.code==30007){
|
||||
wx.showToast({
|
||||
@@ -67,6 +104,19 @@ Page({
|
||||
}
|
||||
})
|
||||
},
|
||||
onConfirmAuth(){
|
||||
this.setData({
|
||||
showAuth:false
|
||||
});
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/bankCard/bankCard',
|
||||
})
|
||||
},
|
||||
onCancleAuth(){
|
||||
this.setData({
|
||||
showAuth:false
|
||||
});
|
||||
},
|
||||
onConfirmDelDraft(){
|
||||
wx.setStorageSync('caseDraft', '');
|
||||
this.setData({
|
||||
@@ -110,11 +160,11 @@ Page({
|
||||
|
||||
}),
|
||||
goCreate:throttle(function(){
|
||||
//this.handleGetProjectStatus();
|
||||
this.handleGetProjectStatus();
|
||||
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/createCase/createCase',
|
||||
})
|
||||
// app.method.navigateTo({
|
||||
// url: '/case/pages/createCase/createCase',
|
||||
// })
|
||||
|
||||
}),
|
||||
goAgreement:throttle(function(event){
|
||||
@@ -132,15 +182,19 @@ Page({
|
||||
getBank(){
|
||||
getBankInfo().then(res=>{
|
||||
if(!res){
|
||||
wx.showToast({
|
||||
title: '请先绑定信息',
|
||||
icon:"none",
|
||||
duration:3000
|
||||
this.handleGetDeal();
|
||||
// this.setData({
|
||||
// showAgree:true
|
||||
// })
|
||||
// wx.showToast({
|
||||
// title: '请先绑定信息',
|
||||
// icon:"none",
|
||||
// duration:3000
|
||||
|
||||
})
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/bankCard/bankCard',
|
||||
})
|
||||
// })
|
||||
// app.method.navigateTo({
|
||||
// url: '/case/pages/bankCard/bankCard',
|
||||
// })
|
||||
}else{
|
||||
this.setData({
|
||||
showAgree:true
|
||||
@@ -156,6 +210,9 @@ getBank(){
|
||||
url: '/case/pages/createCase/createCase',
|
||||
})
|
||||
}else{
|
||||
// this.setData({
|
||||
// showAuth:true
|
||||
// })
|
||||
this.getBank();
|
||||
}
|
||||
}).catch(error=>{
|
||||
@@ -228,10 +285,10 @@ getBank(){
|
||||
this.setData({
|
||||
showAgree:false
|
||||
});
|
||||
this.getSite();
|
||||
// app.method.navigateTo({
|
||||
// url:'/case/pages/agreement/agreement'
|
||||
// })
|
||||
//this.getSite();
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/bankCard/bankCard'
|
||||
})
|
||||
},
|
||||
onCancelAgree(){
|
||||
this.setData({
|
||||
@@ -409,12 +466,14 @@ getBank(){
|
||||
fields: [,"active"],
|
||||
actions: ["updateActive"],
|
||||
});
|
||||
this.getAuthStatus();
|
||||
},
|
||||
onUnload() {
|
||||
this.storeBindings.destroyStoreBindings();
|
||||
|
||||
},
|
||||
onShow(){
|
||||
console.log("show")
|
||||
|
||||
this.updateActive('list');
|
||||
let nav=this.selectComponent('#nav');
|
||||
nav.clearKeyWord();
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<dialog showDialog="{{showCheck}}" showCancel="{{showCancel}}" bind:confirm="onConfirm" bind:cancel="onCancel" title="审核未通过" confirmText="去修改" showTip="{{true}}" message="{{reason}}"></dialog>
|
||||
<dialog showDialog="{{showAgree}}" showCancel="{{showCancel}}" bind:confirm="onConfirmAgree" bind:cancel="onCancelAgree" title="项目协议" confirmText="查看" message="创建病例前需签署《人工肝病例登记系统》电子协议书"></dialog>
|
||||
<dialog showDialog="{{showAgree}}" bind:confirm="onConfirmAgree" bind:cancel="onCancelAgree" title="项目协议" confirmText="查看" message="创建病例前需签署《人工肝病例登记系统》电子协议书"></dialog>
|
||||
<dialog showDialog="{{showAuth}}" bind:confirm="onConfirmAuth"
|
||||
showCancel="{{showCancel}}"bind:cancel="onCancelAuth" confirmText="去认证" showCancel="{{false}}" message="{{authMessage}}"></dialog>
|
||||
<dialog showDialog="{{showDelDraft}}" showCancel="{{showCancel}}" bind:confirm="onConfirmDelDraft" bind:cancel="onCancelDelDraft" title="注意" confirmText="确定" message="确定删除草稿?"></dialog>
|
||||
<van-overlay show="{{ showEntryTip }}" zIndex="9999999">
|
||||
<view class="wrapper">
|
||||
|
||||
@@ -1,80 +1,158 @@
|
||||
// pages/personCenter/personCenter.js
|
||||
import {getInfo,logout} from "../../api/api"
|
||||
import {throttle} from "../../utils/util"
|
||||
import {createStoreBindings} from "mobx-miniprogram-bindings"
|
||||
import {store} from '../../store/store.js'
|
||||
const app=getApp();
|
||||
import {
|
||||
getInfo,
|
||||
logout,
|
||||
applyActivity,
|
||||
limitCount,
|
||||
getActivityStatus
|
||||
} from "../../api/api"
|
||||
import {
|
||||
throttle
|
||||
} from "../../utils/util"
|
||||
import {
|
||||
createStoreBindings
|
||||
} from "mobx-miniprogram-bindings"
|
||||
import {
|
||||
store
|
||||
} from '../../store/store.js'
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
isLogin:false,
|
||||
userInfo:{
|
||||
hospitalName:'',
|
||||
name:'',
|
||||
photo:'',
|
||||
passNum:'',
|
||||
waitNum:'',
|
||||
refuseNum:'',
|
||||
|
||||
isLogin: false,
|
||||
showApply: false,
|
||||
showCancle: true,
|
||||
userInfo: {
|
||||
hospitalName: '',
|
||||
name: '',
|
||||
photo: '',
|
||||
passNum: '',
|
||||
waitNum: '',
|
||||
refuseNum: '',
|
||||
|
||||
},
|
||||
waitSubmitNum:0,
|
||||
img_host:app.hostConfig().imghost
|
||||
waitSubmitNum: 0,
|
||||
img_host: app.hostConfig().imghost
|
||||
},
|
||||
goLogin:throttle(function(){
|
||||
onCancelApply() {
|
||||
this.setData({
|
||||
showApply: false
|
||||
})
|
||||
},
|
||||
onConfirmApply: throttle(function () {
|
||||
this.setData({
|
||||
showApply: false
|
||||
})
|
||||
this.handleApply();
|
||||
}),
|
||||
goApply() {
|
||||
getActivityStatus().then(result=>{
|
||||
if(result){
|
||||
if(result.status==1){
|
||||
wx.showToast({
|
||||
title:'恭喜您,您的病例交流活动申请已通过审核',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
}else if(result.status==2){
|
||||
wx.showToast({
|
||||
title:'您的病例交流活动申请正在审核中',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
}else{
|
||||
this.getLimit();
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
getLimit(){
|
||||
limitCount({
|
||||
type:3
|
||||
}).then(result => {
|
||||
console.log(result);
|
||||
if (result < 2) {
|
||||
wx.showToast({
|
||||
title: '病例审核通过2份及以上可申请病例交流活动',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
showApply:true
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
handleApply() {
|
||||
applyActivity().then(res => {
|
||||
// wx.showToast({
|
||||
// title: '申请成功',
|
||||
// icon: 'none'
|
||||
// })
|
||||
})
|
||||
},
|
||||
goLogin: throttle(function () {
|
||||
app.method.navigateTo({
|
||||
url:'/case/pages/mobileLogin/mobileLogin'
|
||||
})
|
||||
}),
|
||||
goAgree:throttle(function(){
|
||||
url: '/case/pages/mobileLogin/mobileLogin'
|
||||
})
|
||||
}),
|
||||
goAgree: throttle(function () {
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/agreement/agreement',
|
||||
})
|
||||
}),
|
||||
goBind:throttle(function(){
|
||||
})
|
||||
}),
|
||||
goBind: throttle(function () {
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/bankCard/bankCard',
|
||||
})
|
||||
}),
|
||||
goDescription:throttle(function(){
|
||||
})
|
||||
}),
|
||||
goDescription: throttle(function () {
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/agreement/agreement?type=description',
|
||||
})
|
||||
}),
|
||||
handleLogout:throttle(function(){
|
||||
logout().then(res=>{
|
||||
// wx.clearStorageSync()
|
||||
const { envVersion } = wx.getAccountInfoSync().miniProgram;
|
||||
let token=''
|
||||
if(envVersion=="develop" || envVersion=="trial"){
|
||||
token="DEV_CASE_TOKEN"
|
||||
}else{
|
||||
token="PROD_CASE_TOKEN"
|
||||
})
|
||||
}),
|
||||
handleLogout: throttle(function () {
|
||||
logout().then(res => {
|
||||
// wx.clearStorageSync()
|
||||
const {
|
||||
envVersion
|
||||
} = wx.getAccountInfoSync().miniProgram;
|
||||
let token = ''
|
||||
if (envVersion == "develop" || envVersion == "trial") {
|
||||
token = "DEV_CASE_TOKEN"
|
||||
} else {
|
||||
token = "PROD_CASE_TOKEN"
|
||||
}
|
||||
wx.setStorageSync(token,'');
|
||||
wx.setStorageSync('draftTime','');
|
||||
wx.setStorageSync(token, '');
|
||||
wx.setStorageSync('draftTime', '');
|
||||
wx.reLaunch({
|
||||
url:'/case/pages/mobileLogin/mobileLogin'
|
||||
url: '/case/pages/mobileLogin/mobileLogin'
|
||||
})
|
||||
})
|
||||
}),
|
||||
handleGetInfo(){
|
||||
let {userInfo}=this.data;
|
||||
getInfo().then(res=>{
|
||||
}),
|
||||
handleGetInfo() {
|
||||
let {
|
||||
userInfo
|
||||
} = this.data;
|
||||
getInfo().then(res => {
|
||||
this.setData({
|
||||
isLogin:true
|
||||
isLogin: true
|
||||
});
|
||||
for (const key in userInfo) {
|
||||
this.setData({
|
||||
['userInfo.'+key]:res[key]
|
||||
})
|
||||
}
|
||||
}).catch(error=>{
|
||||
if(error.code==30007){
|
||||
this.setData({
|
||||
isLogin:false
|
||||
['userInfo.' + key]: res[key]
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
if (error.code == 30007) {
|
||||
this.setData({
|
||||
isLogin: false
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -83,13 +161,13 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
this.storeBindings = createStoreBindings(this, {
|
||||
store,
|
||||
fields: [,"active"],
|
||||
actions: ["updateActive"],
|
||||
});
|
||||
|
||||
|
||||
this.storeBindings = createStoreBindings(this, {
|
||||
store,
|
||||
fields: [, "active"],
|
||||
actions: ["updateActive"],
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -102,20 +180,20 @@ Page({
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow(){
|
||||
let caseDraft=wx.getStorageSync('caseDraft');
|
||||
if(caseDraft){
|
||||
this.setData({
|
||||
waitSubmitNum:1
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
waitSubmitNum:0
|
||||
})
|
||||
}
|
||||
this.handleGetInfo();
|
||||
this.updateActive('center')
|
||||
},
|
||||
onShow() {
|
||||
let caseDraft = wx.getStorageSync('caseDraft');
|
||||
if (caseDraft) {
|
||||
this.setData({
|
||||
waitSubmitNum: 1
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
waitSubmitNum: 0
|
||||
})
|
||||
}
|
||||
this.handleGetInfo();
|
||||
this.updateActive('center')
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-image": "@vant/weapp/image/index",
|
||||
"dialog":"../../components/dialog/dialog",
|
||||
"van-icon": "@vant/weapp/icon/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
|
||||
@@ -39,20 +39,20 @@
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
<image src="../../static/info.png" mode="" class="item"/>
|
||||
<view class="name">绑定信息</view>
|
||||
<view class="name">个人认证</view>
|
||||
</view>
|
||||
<van-icon name="arrow" color="#8c8c8c"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="cell" bind:tap="goAgree">
|
||||
<view class="cell" bind:tap="goApply">
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
<image src="{{img_host+'/xiangmu.png'}}" mode="" class="item"/>
|
||||
<view class="name">项目协议</view>
|
||||
<view class="name">千帆杯病例交流活动申请</view>
|
||||
</view>
|
||||
<van-icon name="arrow" color="#8c8c8c"/>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="cell" bind:tap="goDescription">
|
||||
<view class="row">
|
||||
<view class="left">
|
||||
@@ -64,4 +64,5 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="logout" wx:if="{{isLogin}}" bind:tap="handleLogout">退出登录</view>
|
||||
</view>
|
||||
</view>
|
||||
<dialog showDialog="{{showApply}}" bind:confirm="onConfirmApply" cancelText="否" bind:cancel="onCancelApply" confirmText="是" message="您是否需要申请千帆杯病例交流活动"></dialog>
|
||||
Reference in New Issue
Block a user