9.17提交

This commit is contained in:
zoujiandong 2025-09-17 09:24:02 +08:00
parent 7799c04883
commit 8883dded38
14 changed files with 152 additions and 62 deletions

View File

@ -106,6 +106,9 @@ function getActivityStatus(){
return request('/caseplatformCase/activity','get',{},false) return request('/caseplatformCase/activity','get',{},false)
} }
function getMobileModel(data){
return request('/upload/mobileModel','post',data,false)
}
// function getCaseNum(){//获取项目病例总数 // function getCaseNum(){//获取项目病例总数
@ -150,5 +153,6 @@ module.exports={
getBankInfo, getBankInfo,
getfangxinSite, getfangxinSite,
ocrIdCard, ocrIdCard,
ocrImg ocrImg,
getMobileModel
} }

28
app.js
View File

@ -2,7 +2,35 @@
import { hostConfig} from "./utils/config" import { hostConfig} from "./utils/config"
import router from './utils/router.js' import router from './utils/router.js'
App({ App({
getNetSataus(){
wx.onNetworkStatusChange(function (res) {
if(!res.isConnected){
wx.showModal({
title: '提示',
showCancel:false,
content: '当前网络不佳,请稍后重试',
complete: (res) => {
}
})
}
if(res.networkType=="3g" || res.networkType=="2g" || res.networkType=="none"){
wx.showModal({
title: '提示',
showCancel:false,
content: '当前网络不佳,请稍后重试',
complete: (res) => {
}
})
}
})
},
onHide (options) {
// Do something when hide.
},
onShow:function(){ onShow:function(){
wx.getSystemInfo({ wx.getSystemInfo({
success: (res) => { success: (res) => {
// windows | mac为pc端 // windows | mac为pc端

View File

@ -245,9 +245,9 @@ Page({
return false return false
}; };
let {signImg,bankCardNo,bankName,cityId,countyId,idCardNo,idCardName,provId}=this.data; let {signImg,bankCardNo,bankName,cityId,countyId,idCardNo,idCardName,provId}=this.data;
if (!/^([\u4e00-\u9fa5\·]{2,10})$/.test(idCardName)) { if (!/^([\u4e00-\u9fa5\·]{2,30})$/.test(idCardName)) {
wx.showToast({ wx.showToast({
title: `姓名要求在2-10个汉字`, title: `姓名要求在2-30个汉字`,
icon: 'none', icon: 'none',
}); });
return false; return false;

View File

@ -1,5 +1,5 @@
// case/pages/createCase/createCase.js // case/pages/createCase/createCase.js
import {addCase,caseDetail,editCase,getOssSign,ocrImg} from "../../../api/api" import {addCase,caseDetail,editCase,getOssSign,ocrImg,getMobileModel} from "../../../api/api"
const dayjs = require("../../../utils/dayjs"); const dayjs = require("../../../utils/dayjs");
import {throttle} from "../../../utils/util" import {throttle} from "../../../utils/util"
import { FileUtil } from '../../../utils/fileutil' import { FileUtil } from '../../../utils/fileutil'
@ -56,7 +56,7 @@ Page({
fileList_bio:[], fileList_bio:[],
fileList_coa:[], fileList_coa:[],
fileList_inf:[], fileList_inf:[],
dpmas_list:[{fileList:[],treatTime:''}], dpmas_list:[{fileList:[],treatTime:'',temp_list:[]}],
disable_ziliao:false, disable_ziliao:false,
disable_record:false, disable_record:false,
disable_check:false, disable_check:false,
@ -912,11 +912,14 @@ Page({
let imgList=item.dpmasImg.split(','); let imgList=item.dpmasImg.split(',');
let objFile="dpmas_list["+index+"].fileList"; let objFile="dpmas_list["+index+"].fileList";
let tempFile="dpmas_list["+index+"].temp_list"
let objTime="dpmas_list["+index+"].treatTime" let objTime="dpmas_list["+index+"].treatTime"
this.setData({ let newArr=imgList.map(item1=>{
[objFile]:imgList.map(item1=>{
return {url:item1,type:'image',isImage: true} return {url:item1,type:'image',isImage: true}
}), });
this.setData({
[objFile]:newArr,
[tempFile]:newArr,
[objTime]:item.treatTime?dayjs(item.treatTime).format('YYYY-MM-DD'):'' [objTime]:item.treatTime?dayjs(item.treatTime).format('YYYY-MM-DD'):''
}) })
} }
@ -1245,7 +1248,7 @@ Page({
if(dpmas.length<=1){ if(dpmas.length<=1){
this.setData({ this.setData({
'case.dpmas':dpmas.concat([obj]), 'case.dpmas':dpmas.concat([obj]),
'dpmas_list':dpmas_list.concat([{fileList:[],treatTime:''}]) 'dpmas_list':dpmas_list.concat([{fileList:[],treatTime:'',temp_list:[]}])
}) })
} }
@ -1460,7 +1463,6 @@ Page({
}) })
return false; return false;
} }
}; };
if(caseType.length==1 && caseType[0]==1){ if(caseType.length==1 && caseType[0]==1){
if(dpmas.length<=1){ if(dpmas.length<=1){
@ -2216,15 +2218,20 @@ Page({
fileList_inf.push({ url: url,type:'image',isImage: true }); fileList_inf.push({ url: url,type:'image',isImage: true });
THIS.setData({ fileList_inf}); THIS.setData({ fileList_inf});
}else if(name.indexOf("record")!=-1){ }else if(name.indexOf("record")!=-1){
let {dpmas_list}=THIS.data;
let recordIndex=Number(name.split("record")[1]); let recordIndex=Number(name.split("record")[1]);
console.log("recordIndex:"+recordIndex); console.log("recordIndex:"+recordIndex);
let objArr="dpmas_list[" +recordIndex +"]" let objArr="dpmas_list[" +recordIndex +"]"
let obj="dpmas_list[" +recordIndex +"].fileList" let obj="dpmas_list[" +recordIndex +"].fileList";
if(!(THIS.data.dpmas_list[recordIndex])){ let tempObj="dpmas_list[" +recordIndex +"].temp_list"
console.log(333) try {
THIS.setData({ if(!(dpmas_list[recordIndex])){
[objArr]:{fileList:[],treatTime:''} THIS.setData({
}) [objArr]:{fileList:[],treatTime:'',temp_list:[]}
})
}
} catch (error) {
} }
THIS.setData({ THIS.setData({
[obj]:THIS.data.dpmas_list[recordIndex].fileList.concat([{ url: url,type:'image',isImage: true}]) [obj]:THIS.data.dpmas_list[recordIndex].fileList.concat([{ url: url,type:'image',isImage: true}])
@ -2271,13 +2278,14 @@ Page({
showPaint:true showPaint:true
}) })
console.log(file) console.log(file)
// let fileArr=[file]
// wx.showLoading({ // wx.showLoading({
// title: '图片上传中', // title: '图片上传中',
// mask: true // mask: true
// }) // })
// var promiseFun = []; // var promiseFun = [];
// for (let i = 0; i < file.length; i++) { // for (let i = 0; i < fileArr.length; i++) {
// var cur_file = file[i].url; // var cur_file = fileArr[i].url;
// promiseFun.push( // promiseFun.push(
// this.uploadImg(cur_file,name) // this.uploadImg(cur_file,name)
// ) // )
@ -2299,6 +2307,17 @@ Page({
// wx.hideLoading(); // wx.hideLoading();
// }); // });
}, },
getModal(){
const deviceInfo = wx.getDeviceInfo();
const accountInfo = wx.getAccountInfoSync();
console.log(accountInfo); // 输出当前小程序的版本号
console.log(deviceInfo);
getMobileModel({
mod:'型号:'+deviceInfo.brand +' 设备型号:'+deviceInfo.model+' 操作系统:'+deviceInfo.system +' 线上小程序版本号:' +accountInfo.miniProgram.version
}).then(res=>{
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -2350,7 +2369,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.getModal();
}, },
/** /**

View File

@ -497,10 +497,14 @@
<view class="red rederror"> <view class="red rederror">
上传照片请进行隐私信息脱敏 上传照片请进行隐私信息脱敏
</view> </view>
<view class="uploadbox"> <view class="uploadbox" >
<van-uploader file-list="{{ dpmas_list[index].fileList}}" bind:delete="deleteImg" <van-uploader file-list="{{dpmas_list[index].fileList}}" bind:delete="deleteImg"
readonly="{{dpmas_list[index].fileList.length>=3}}" max-count="3" name="{{'record'+index}}" show-upload="{{showSaveBtn}}" deletable="{{showSaveBtn}}" bind:after-read="afterRead" upload-text="上传" upload-icon="{{img_host+'/upload.png'}}" /> readonly="{{dpmas_list[index].fileList.length>=3}}" max-count="3" name="{{'record'+index}}" show-upload="{{showSaveBtn}}" deletable="{{showSaveBtn}}" bind:after-read="afterRead" upload-text="上传" upload-icon="{{img_host+'/upload.png'}}" />
</view> </view>
<!-- <view class="uploadbox" wx:else>
<van-uploader file-list="{{dpmas_list[index].temp_list}}" bind:delete="deleteImg"
readonly="{{dpmas_list[index].temp_list.length>=3}}" max-count="3" name="{{'record'+index}}" show-upload="{{showSaveBtn}}" deletable="{{showSaveBtn}}" bind:after-read="afterRead" upload-text="上传" upload-icon="{{img_host+'/upload.png'}}" />
</view> -->
</view> </view>
</view> </view>
<view class="addrecord" bind:tap="addRecord" wx:if="{{showSaveBtn}}"> <view class="addrecord" bind:tap="addRecord" wx:if="{{showSaveBtn}}">

View File

@ -27,9 +27,10 @@
</view> </view>
<view class="type"> <view class="type">
<view class="mobileLogin" bind:tap="goPwdLogin">密码登录</view> <view class="mobileLogin" bind:tap="goPwdLogin">密码登录</view>
<view class="zhuce" bind:tap="goRegister">注册</view> <!-- <view class="zhuce" bind:tap="goRegister">注册</view> -->
</view> </view>
<view class="wechatbox"> <view class="wechatbox">
<view class="chatmsg">本平台仅供已注册肝胆相照平台的用户使用</view>
<view class="chatmsg">- 手机号快捷登录 -</view> <view class="chatmsg">- 手机号快捷登录 -</view>
<image src="../../../static/wechat.png" mode="" class="wecaht" bind:tap="handleAgree"/> <image src="../../../static/wechat.png" mode="" class="wecaht" bind:tap="handleAgree"/>
<button type="primary" class="mobileAuth" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{check}}">手机号快捷登录</button > <button type="primary" class="mobileAuth" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{check}}">手机号快捷登录</button >

View File

@ -28,9 +28,10 @@
</view> </view>
<view class="type"> <view class="type">
<view class="mobileLogin" bind:tap="goMobile">手机验证码登录</view> <view class="mobileLogin" bind:tap="goMobile">手机验证码登录</view>
<view class="zhuce" bind:tap="goRegister">注册</view> <!-- <view class="zhuce" bind:tap="goRegister">注册</view> -->
</view> </view>
<view class="wechatbox"> <view class="wechatbox">
<view class="chatmsg">本平台仅供已注册肝胆相照平台的用户使用</view>
<view class="chatmsg">- 手机号快捷登录 -</view> <view class="chatmsg">- 手机号快捷登录 -</view>
<image src="../../../static/wechat.png" mode="" class="wecaht" bind:tap="handleAgree"/> <image src="../../../static/wechat.png" mode="" class="wecaht" bind:tap="handleAgree"/>
<button type="primary" class="mobileAuth" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{checked}}">手机号快捷登录</button > <button type="primary" class="mobileAuth" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{checked}}">手机号快捷登录</button >

View File

@ -30,6 +30,9 @@
</view> </view>
</van-cell-group> </van-cell-group>
<view class="tip">1、仅限受邀的白名单用户进行注册人工审核通过后方可登录。
</view>
<view class="tip">2、非邀请用户注册后不会通过人工审核无法登录本平台。</view>
<view class="tip"> 若您有任何疑问或需要我们协助,请与您的小助手联系或直接微信联系<text class="red">igandan1000</text></view> <view class="tip"> 若您有任何疑问或需要我们协助,请与您的小助手联系或直接微信联系<text class="red">igandan1000</text></view>
</view> </view>
<view hidden="{{!showNext}}"> <view hidden="{{!showNext}}">

View File

@ -131,6 +131,7 @@ Component({
this.setData({ this.setData({
width: false, // 是否开启宽度调整栏 width: false, // 是否开启宽度调整栏
color: false, color: false,
isSmall:false,
clear: false, // 是否开启清空栏 clear: false, // 是否开启清空栏
eraser: false, // 是否开启橡皮擦 eraser: false, // 是否开启橡皮擦
saving: false, saving: false,
@ -146,7 +147,7 @@ Component({
title: '图片上传中', title: '图片上传中',
mask: true mask: true
}) })
utils.tapBtn(e, this, 2,this.data.paintFrom); utils.tapBtn(e, this, 2,this.data.paintFrom,this.data.isSmall);
this.hideBarsHandler() this.hideBarsHandler()
}, },
showBarsHandler(e) { showBarsHandler(e) {
@ -192,6 +193,11 @@ Component({
wx.getImageInfo({ wx.getImageInfo({
src: res.tempFilePaths[0], src: res.tempFilePaths[0],
success: function (res) { success: function (res) {
if(res.size/1024<1024){
this.setData({
isSmall:true
})
}
// 获取图片信息,主要为宽高,选择合适的自适应方式(将最大边完整显示) // 获取图片信息,主要为宽高,选择合适的自适应方式(将最大边完整显示)
let [height, width] = [that.data.canvasWidth / res.width * res.height, that.data.canvasWidth]; let [height, width] = [that.data.canvasWidth / res.width * res.height, that.data.canvasWidth];
if (height > that.data.windowHeight - 50) { if (height > that.data.windowHeight - 50) {

View File

@ -12,6 +12,7 @@ Page({
editId:'', editId:'',
showDraft:true, showDraft:true,
reason:'', reason:'',
isLogin:false,
status_title:'病例状态', status_title:'病例状态',
casetype_title:'治疗类型', casetype_title:'治疗类型',
draftTime:'', draftTime:'',
@ -470,8 +471,14 @@ getBank(){
} }
let token = wx.getStorageSync(tokenStr); let token = wx.getStorageSync(tokenStr);
if(token){ if(token){
this.setData({
isLogin:true
})
return true return true
}else { }else {
this.setData({
isLogin:false
})
return false return false
} }
}, },
@ -481,9 +488,8 @@ getBank(){
fields: [,"active"], fields: [,"active"],
actions: ["updateActive"], actions: ["updateActive"],
}); });
if(this.isHasToken()){ this.isHasToken()
this.getAuthStatus(); this.getAuthStatus();
}
}, },
onUnload() { onUnload() {

View File

@ -59,6 +59,7 @@
<image src="{{img_host+'/noCase.png'}}" class="nocase" /> <image src="{{img_host+'/noCase.png'}}" class="nocase" />
<view class="nodatatip">暂无病例,<text class="link" bind:tap="goCreate">点击创建病例</text></view> <view class="nodatatip">暂无病例,<text class="link" bind:tap="goCreate">点击创建病例</text></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>

View File

@ -112,6 +112,21 @@ Page({
url: '/case/pages/bankCard/bankCard', url: '/case/pages/bankCard/bankCard',
}) })
}), }),
isHasToken(){
let tokenStr=''
const { envVersion } = wx.getAccountInfoSync().miniProgram;
if(envVersion=="develop" || envVersion=="trial"){
tokenStr="DEV_CASE_TOKEN"
}else{
tokenStr="PROD_CASE_TOKEN"
}
let token = wx.getStorageSync(tokenStr);
if(token){
return true
}else {
return false
}
},
goDescription: throttle(function () { goDescription: throttle(function () {
app.method.navigateTo({ app.method.navigateTo({
url: '/case/pages/agreement/agreement?type=description', url: '/case/pages/agreement/agreement?type=description',
@ -191,6 +206,7 @@ Page({
waitSubmitNum: 0 waitSubmitNum: 0
}) })
} }
this.handleGetInfo(); this.handleGetInfo();
this.updateActive('center') this.updateActive('center')
}, },

View File

@ -63,7 +63,7 @@ let token = wx.getStorageSync(tokenStr);
}else if (Number(res.data.code) == 30007 ) { }else if (Number(res.data.code) == 30007 ) {
wx.hideLoading() wx.hideLoading()
let redirectUrl=formatUrl(); let redirectUrl=formatUrl();
wx.setStorageSync(tokenStr,'');
wx.reLaunch({ wx.reLaunch({
url: '/case/pages/mobileLogin/mobileLogin?redirectUrl='+redirectUrl url: '/case/pages/mobileLogin/mobileLogin?redirectUrl='+redirectUrl
}); });

View File

@ -42,7 +42,7 @@ function formatTime(date) {
} }
// 点击按钮触发的事件 // 点击按钮触发的事件
function tapBtn(e, _this, pageType,from) { function tapBtn(e, _this, pageType,from,isSmall=false) {
let btnType = e.target.dataset.type; let btnType = e.target.dataset.type;
let c = {}; let c = {};
@ -94,14 +94,14 @@ function formatTime(date) {
return; return;
// 保存 // 保存
case 'save': case 'save':
saveImg(_this, pageType,from); saveImg(_this, pageType,from,isSmall);
return; return;
default: default:
return; return;
} }
} }
function saveImg(_this, pageType,from) { function saveImg(_this, pageType,from,isSmall) {
let c = {}; let c = {};
if (pageType === 1) { if (pageType === 1) {
c.canvasHeight = 50; c.canvasHeight = 50;
@ -177,7 +177,7 @@ function formatTime(date) {
// } // }
} }
function _canvaseSaveToImg(_this,from) { function _canvaseSaveToImg(_this,from,isSmall) {
let that=_this; let that=_this;
console.log(from) console.log(from)
console.log(_this); console.log(_this);
@ -187,6 +187,7 @@ function formatTime(date) {
wx.canvasToTempFilePath({ wx.canvasToTempFilePath({
canvasId: 'myCanvas', canvasId: 'myCanvas',
fileType:'png', fileType:'png',
quality:isSmall?0.8:1,
success: function (res) { success: function (res) {
// wx.previewImage({ // wx.previewImage({
// urls:[res.tempFilePath], // urls:[res.tempFilePath],
@ -197,32 +198,32 @@ function formatTime(date) {
name:from name:from
}) })
// 转图片成功,继续调用存储相册接口 // 转图片成功,继续调用存储相册接口
// wx.saveImageToPhotosAlbum({ // wx.saveImageToPhotosAlbum({
// filePath: res.tempFilePath, // filePath: res.tempFilePath,
// // 存储成功 // // 存储成功
// success: function (r) { // success: function (r) {
// wx.hideLoading(); // wx.hideLoading();
// wx.showToast({ // wx.showToast({
// title: '保存成功', // title: '保存成功',
// }) // })
// _this.setData({ // _this.setData({
// saving: false, // saving: false,
// showPaint:false // showPaint:false
// }) // })
// }, // },
// // 失败弹窗 // // 失败弹窗
// fail: function (res) { // fail: function (res) {
// wx.hideLoading(); // wx.hideLoading();
// wx.showToast({ // wx.showToast({
// title: '保存失败', // title: '保存失败',
// icon: 'loading', // icon: 'loading',
// }) // })
// _this.setData({ // _this.setData({
// saving: false, // saving: false,
// showPaint:false // showPaint:false
// }) // })
// } // }
// }) // })
}, },
fail: function (res) { fail: function (res) {
// canvas转图片失败 // canvas转图片失败