9.17提交
This commit is contained in:
parent
7799c04883
commit
8883dded38
@ -106,6 +106,9 @@ function getActivityStatus(){
|
||||
return request('/caseplatformCase/activity','get',{},false)
|
||||
}
|
||||
|
||||
function getMobileModel(data){
|
||||
return request('/upload/mobileModel','post',data,false)
|
||||
}
|
||||
|
||||
|
||||
// function getCaseNum(){//获取项目病例总数
|
||||
@ -150,5 +153,6 @@ module.exports={
|
||||
getBankInfo,
|
||||
getfangxinSite,
|
||||
ocrIdCard,
|
||||
ocrImg
|
||||
ocrImg,
|
||||
getMobileModel
|
||||
}
|
||||
|
||||
28
app.js
28
app.js
@ -2,7 +2,35 @@
|
||||
import { hostConfig} from "./utils/config"
|
||||
import router from './utils/router.js'
|
||||
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(){
|
||||
|
||||
wx.getSystemInfo({
|
||||
success: (res) => {
|
||||
// windows | mac为pc端
|
||||
|
||||
@ -245,9 +245,9 @@ Page({
|
||||
return false
|
||||
};
|
||||
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({
|
||||
title: `姓名要求在2-10个汉字`,
|
||||
title: `姓名要求在2-30个汉字`,
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 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");
|
||||
import {throttle} from "../../../utils/util"
|
||||
import { FileUtil } from '../../../utils/fileutil'
|
||||
@ -56,7 +56,7 @@ Page({
|
||||
fileList_bio:[],
|
||||
fileList_coa:[],
|
||||
fileList_inf:[],
|
||||
dpmas_list:[{fileList:[],treatTime:''}],
|
||||
dpmas_list:[{fileList:[],treatTime:'',temp_list:[]}],
|
||||
disable_ziliao:false,
|
||||
disable_record:false,
|
||||
disable_check:false,
|
||||
@ -912,11 +912,14 @@ Page({
|
||||
let imgList=item.dpmasImg.split(',');
|
||||
|
||||
let objFile="dpmas_list["+index+"].fileList";
|
||||
let tempFile="dpmas_list["+index+"].temp_list"
|
||||
let objTime="dpmas_list["+index+"].treatTime"
|
||||
this.setData({
|
||||
[objFile]:imgList.map(item1=>{
|
||||
let newArr=imgList.map(item1=>{
|
||||
return {url:item1,type:'image',isImage: true}
|
||||
}),
|
||||
});
|
||||
this.setData({
|
||||
[objFile]:newArr,
|
||||
[tempFile]:newArr,
|
||||
[objTime]:item.treatTime?dayjs(item.treatTime).format('YYYY-MM-DD'):''
|
||||
})
|
||||
}
|
||||
@ -1245,7 +1248,7 @@ Page({
|
||||
if(dpmas.length<=1){
|
||||
this.setData({
|
||||
'case.dpmas':dpmas.concat([obj]),
|
||||
'dpmas_list':dpmas_list.concat([{fileList:[],treatTime:''}])
|
||||
'dpmas_list':dpmas_list.concat([{fileList:[],treatTime:'',temp_list:[]}])
|
||||
|
||||
})
|
||||
}
|
||||
@ -1459,8 +1462,7 @@ Page({
|
||||
icon:'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
if(caseType.length==1 && caseType[0]==1){
|
||||
if(dpmas.length<=1){
|
||||
@ -2216,15 +2218,20 @@ Page({
|
||||
fileList_inf.push({ url: url,type:'image',isImage: true });
|
||||
THIS.setData({ fileList_inf});
|
||||
}else if(name.indexOf("record")!=-1){
|
||||
let {dpmas_list}=THIS.data;
|
||||
let recordIndex=Number(name.split("record")[1]);
|
||||
console.log("recordIndex:"+recordIndex);
|
||||
let objArr="dpmas_list[" +recordIndex +"]"
|
||||
let obj="dpmas_list[" +recordIndex +"].fileList"
|
||||
if(!(THIS.data.dpmas_list[recordIndex])){
|
||||
console.log(333)
|
||||
THIS.setData({
|
||||
[objArr]:{fileList:[],treatTime:''}
|
||||
})
|
||||
let obj="dpmas_list[" +recordIndex +"].fileList";
|
||||
let tempObj="dpmas_list[" +recordIndex +"].temp_list"
|
||||
try {
|
||||
if(!(dpmas_list[recordIndex])){
|
||||
THIS.setData({
|
||||
[objArr]:{fileList:[],treatTime:'',temp_list:[]}
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
THIS.setData({
|
||||
[obj]:THIS.data.dpmas_list[recordIndex].fileList.concat([{ url: url,type:'image',isImage: true}])
|
||||
@ -2271,13 +2278,14 @@ Page({
|
||||
showPaint:true
|
||||
})
|
||||
console.log(file)
|
||||
// let fileArr=[file]
|
||||
// wx.showLoading({
|
||||
// title: '图片上传中',
|
||||
// mask: true
|
||||
// })
|
||||
// var promiseFun = [];
|
||||
// for (let i = 0; i < file.length; i++) {
|
||||
// var cur_file = file[i].url;
|
||||
// for (let i = 0; i < fileArr.length; i++) {
|
||||
// var cur_file = fileArr[i].url;
|
||||
// promiseFun.push(
|
||||
// this.uploadImg(cur_file,name)
|
||||
// )
|
||||
@ -2299,6 +2307,17 @@ Page({
|
||||
// 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=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
@ -2335,7 +2354,7 @@ Page({
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// console.log(this.data.case)
|
||||
},
|
||||
|
||||
@ -2350,7 +2369,7 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
this.getModal();
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -497,10 +497,14 @@
|
||||
<view class="red rederror">
|
||||
上传照片请进行隐私信息脱敏
|
||||
</view>
|
||||
<view class="uploadbox">
|
||||
<van-uploader file-list="{{ dpmas_list[index].fileList}}" bind:delete="deleteImg"
|
||||
<view class="uploadbox" >
|
||||
<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'}}" />
|
||||
</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 class="addrecord" bind:tap="addRecord" wx:if="{{showSaveBtn}}">
|
||||
|
||||
@ -27,9 +27,10 @@
|
||||
</view>
|
||||
<view class="type">
|
||||
<view class="mobileLogin" bind:tap="goPwdLogin">密码登录</view>
|
||||
<view class="zhuce" bind:tap="goRegister">注册</view>
|
||||
<!-- <view class="zhuce" bind:tap="goRegister">注册</view> -->
|
||||
</view>
|
||||
<view class="wechatbox">
|
||||
<view class="chatmsg">本平台仅供已注册肝胆相照平台的用户使用</view>
|
||||
<view class="chatmsg">- 手机号快捷登录 -</view>
|
||||
<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 >
|
||||
|
||||
@ -28,9 +28,10 @@
|
||||
</view>
|
||||
<view class="type">
|
||||
<view class="mobileLogin" bind:tap="goMobile">手机验证码登录</view>
|
||||
<view class="zhuce" bind:tap="goRegister">注册</view>
|
||||
<!-- <view class="zhuce" bind:tap="goRegister">注册</view> -->
|
||||
</view>
|
||||
<view class="wechatbox">
|
||||
<view class="chatmsg">本平台仅供已注册肝胆相照平台的用户使用</view>
|
||||
<view class="chatmsg">- 手机号快捷登录 -</view>
|
||||
<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 >
|
||||
|
||||
@ -30,6 +30,9 @@
|
||||
</view>
|
||||
|
||||
</van-cell-group>
|
||||
<view class="tip">1、仅限受邀的白名单用户进行注册,人工审核通过后方可登录。
|
||||
</view>
|
||||
<view class="tip">2、非邀请用户注册后,不会通过人工审核,无法登录本平台。</view>
|
||||
<view class="tip"> 若您有任何疑问或需要我们协助,请与您的小助手联系或直接微信联系<text class="red">igandan1000</text></view>
|
||||
</view>
|
||||
<view hidden="{{!showNext}}">
|
||||
|
||||
@ -131,6 +131,7 @@ Component({
|
||||
this.setData({
|
||||
width: false, // 是否开启宽度调整栏
|
||||
color: false,
|
||||
isSmall:false,
|
||||
clear: false, // 是否开启清空栏
|
||||
eraser: false, // 是否开启橡皮擦
|
||||
saving: false,
|
||||
@ -146,7 +147,7 @@ Component({
|
||||
title: '图片上传中',
|
||||
mask: true
|
||||
})
|
||||
utils.tapBtn(e, this, 2,this.data.paintFrom);
|
||||
utils.tapBtn(e, this, 2,this.data.paintFrom,this.data.isSmall);
|
||||
this.hideBarsHandler()
|
||||
},
|
||||
showBarsHandler(e) {
|
||||
@ -192,6 +193,11 @@ Component({
|
||||
wx.getImageInfo({
|
||||
src: res.tempFilePaths[0],
|
||||
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];
|
||||
if (height > that.data.windowHeight - 50) {
|
||||
|
||||
@ -12,6 +12,7 @@ Page({
|
||||
editId:'',
|
||||
showDraft:true,
|
||||
reason:'',
|
||||
isLogin:false,
|
||||
status_title:'病例状态',
|
||||
casetype_title:'治疗类型',
|
||||
draftTime:'',
|
||||
@ -470,8 +471,14 @@ getBank(){
|
||||
}
|
||||
let token = wx.getStorageSync(tokenStr);
|
||||
if(token){
|
||||
this.setData({
|
||||
isLogin:true
|
||||
})
|
||||
return true
|
||||
}else {
|
||||
this.setData({
|
||||
isLogin:false
|
||||
})
|
||||
return false
|
||||
}
|
||||
},
|
||||
@ -481,9 +488,8 @@ getBank(){
|
||||
fields: [,"active"],
|
||||
actions: ["updateActive"],
|
||||
});
|
||||
if(this.isHasToken()){
|
||||
this.getAuthStatus();
|
||||
}
|
||||
this.isHasToken()
|
||||
this.getAuthStatus();
|
||||
|
||||
},
|
||||
onUnload() {
|
||||
|
||||
@ -59,6 +59,7 @@
|
||||
<image src="{{img_host+'/noCase.png'}}" class="nocase" />
|
||||
<view class="nodatatip">暂无病例,<text class="link" bind:tap="goCreate">点击创建病例</text></view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -112,6 +112,21 @@ Page({
|
||||
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 () {
|
||||
app.method.navigateTo({
|
||||
url: '/case/pages/agreement/agreement?type=description',
|
||||
@ -191,7 +206,8 @@ Page({
|
||||
waitSubmitNum: 0
|
||||
})
|
||||
}
|
||||
this.handleGetInfo();
|
||||
|
||||
this.handleGetInfo();
|
||||
this.updateActive('center')
|
||||
},
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ let token = wx.getStorageSync(tokenStr);
|
||||
}else if (Number(res.data.code) == 30007 ) {
|
||||
wx.hideLoading()
|
||||
let redirectUrl=formatUrl();
|
||||
|
||||
wx.setStorageSync(tokenStr,'');
|
||||
wx.reLaunch({
|
||||
url: '/case/pages/mobileLogin/mobileLogin?redirectUrl='+redirectUrl
|
||||
});
|
||||
|
||||
@ -42,9 +42,9 @@ function formatTime(date) {
|
||||
}
|
||||
|
||||
// 点击按钮触发的事件
|
||||
function tapBtn(e, _this, pageType,from) {
|
||||
function tapBtn(e, _this, pageType,from,isSmall=false) {
|
||||
let btnType = e.target.dataset.type;
|
||||
|
||||
|
||||
let c = {};
|
||||
|
||||
switch (btnType) {
|
||||
@ -94,14 +94,14 @@ function formatTime(date) {
|
||||
return;
|
||||
// 保存
|
||||
case 'save':
|
||||
saveImg(_this, pageType,from);
|
||||
saveImg(_this, pageType,from,isSmall);
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function saveImg(_this, pageType,from) {
|
||||
function saveImg(_this, pageType,from,isSmall) {
|
||||
let c = {};
|
||||
if (pageType === 1) {
|
||||
c.canvasHeight = 50;
|
||||
@ -177,7 +177,7 @@ function formatTime(date) {
|
||||
// }
|
||||
}
|
||||
|
||||
function _canvaseSaveToImg(_this,from) {
|
||||
function _canvaseSaveToImg(_this,from,isSmall) {
|
||||
let that=_this;
|
||||
console.log(from)
|
||||
console.log(_this);
|
||||
@ -187,6 +187,7 @@ function formatTime(date) {
|
||||
wx.canvasToTempFilePath({
|
||||
canvasId: 'myCanvas',
|
||||
fileType:'png',
|
||||
quality:isSmall?0.8:1,
|
||||
success: function (res) {
|
||||
// wx.previewImage({
|
||||
// urls:[res.tempFilePath],
|
||||
@ -197,32 +198,32 @@ function formatTime(date) {
|
||||
name:from
|
||||
})
|
||||
// 转图片成功,继续调用存储相册接口
|
||||
// wx.saveImageToPhotosAlbum({
|
||||
// filePath: res.tempFilePath,
|
||||
// // 存储成功
|
||||
// success: function (r) {
|
||||
// wx.hideLoading();
|
||||
// wx.showToast({
|
||||
// title: '保存成功',
|
||||
// })
|
||||
// _this.setData({
|
||||
// saving: false,
|
||||
// showPaint:false
|
||||
// })
|
||||
// },
|
||||
// // 失败弹窗
|
||||
// fail: function (res) {
|
||||
// wx.hideLoading();
|
||||
// wx.showToast({
|
||||
// title: '保存失败',
|
||||
// icon: 'loading',
|
||||
// })
|
||||
// _this.setData({
|
||||
// saving: false,
|
||||
// showPaint:false
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// wx.saveImageToPhotosAlbum({
|
||||
// filePath: res.tempFilePath,
|
||||
// // 存储成功
|
||||
// success: function (r) {
|
||||
// wx.hideLoading();
|
||||
// wx.showToast({
|
||||
// title: '保存成功',
|
||||
// })
|
||||
// _this.setData({
|
||||
// saving: false,
|
||||
// showPaint:false
|
||||
// })
|
||||
// },
|
||||
// // 失败弹窗
|
||||
// fail: function (res) {
|
||||
// wx.hideLoading();
|
||||
// wx.showToast({
|
||||
// title: '保存失败',
|
||||
// icon: 'loading',
|
||||
// })
|
||||
// _this.setData({
|
||||
// saving: false,
|
||||
// showPaint:false
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
},
|
||||
fail: function (res) {
|
||||
// canvas转图片失败
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user