init version kelfy-mini for new gitea
This commit is contained in:
748
pages/userRefund/userRefund.js
Normal file
748
pages/userRefund/userRefund.js
Normal file
@@ -0,0 +1,748 @@
|
||||
const util = require('../../utils/util.js');
|
||||
const api = require('../../config/api.js');
|
||||
|
||||
// 使用引入的模块进行相关操作
|
||||
Page({
|
||||
data: {
|
||||
|
||||
width:380,//宽度
|
||||
height: 250,//高度
|
||||
max_width:400,
|
||||
max_height:500,
|
||||
showCropper: false,
|
||||
croppedImageSrc: '',
|
||||
orgImageSrc: '',
|
||||
orgImageName: '',
|
||||
|
||||
isalert: false,
|
||||
isalert1: false,
|
||||
isShowBankManual: false,
|
||||
ifchild: false,
|
||||
showbanktype: false,
|
||||
tipsdialog: false,
|
||||
refname: null,
|
||||
refidcard: null,
|
||||
refbankcard: null,
|
||||
refbankcardname: null,
|
||||
refbanktype: null,
|
||||
refbanktypeinfo: null,
|
||||
refbankmanual: null,
|
||||
reftel: null,
|
||||
imageUrlIdcard: '', // 用于存储上传的图片路径
|
||||
resIdcardImgUrl: '',
|
||||
imageUrlBankcard: '', // 用于存储上传的图片路径
|
||||
resBankcardImgUrl: '',
|
||||
imageUrlChildId: '', // 用于存储上传的图片路径
|
||||
resChildIdImgUrl: '',
|
||||
bankType: [
|
||||
{ name: '中国银行', value: 0 ,msg:"请输入中国银行卡号"},
|
||||
{ name: '中国工商银行', value: 1 ,msg:'请输入中国工商银行卡号'},
|
||||
{ name: '中国建设银行', value: 2 ,msg:'请输入中国建设银行卡号'},
|
||||
{ name: '中国农业银行', value: 3 ,msg:'请输入中国农业银行卡号'},
|
||||
{ name: '中国邮政储蓄银行', value: 4 ,msg:'请输入中国邮政储蓄银行卡号'},
|
||||
{ name: '新疆农村信用社', value: 5 ,msg:'请输入新疆农村信用社卡号'},
|
||||
{ name: '新疆昆仑银行', value: 6 ,msg:'请输入新疆昆仑银行卡号'},
|
||||
{ name: '其他(手工填写)', value: 7 ,msg:'其他(手工填写)'},
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
onLoad: function (options) {
|
||||
console.log('onload');
|
||||
},
|
||||
|
||||
onReady: function() {
|
||||
console.log('onReady');
|
||||
this.onShowTips();
|
||||
},
|
||||
|
||||
//裁剪图片开始
|
||||
preventDefault() {
|
||||
// 阻止默认点击事件
|
||||
},
|
||||
// 裁剪器加载完成
|
||||
onCropperLoad() {
|
||||
console.log('裁剪器加载完成');
|
||||
},
|
||||
OnCropperloadimage(e){
|
||||
wx.hideLoading();
|
||||
console.log("图片加载完成",e.detail);
|
||||
//图片重置一下
|
||||
this.selectComponent("#image-cropper").imgReset();
|
||||
},
|
||||
|
||||
// 触发裁剪操作
|
||||
triggerCut() {
|
||||
const cropper = this.selectComponent("#image-cropper")
|
||||
console.log(cropper, 'triggerCut被点击');
|
||||
|
||||
if (cropper) {
|
||||
// 模拟触发裁剪事件
|
||||
cropper.triggerEvent('tapcut');
|
||||
}
|
||||
},
|
||||
// 确认裁剪
|
||||
onCropperConfirm(e) {
|
||||
console.log('裁剪按钮被点击');
|
||||
let that = this;
|
||||
const cropper = this.selectComponent("#image-cropper")
|
||||
cropper.getImg((obj) => {
|
||||
//app.globalData.imgSrc = obj.url;
|
||||
console.log('裁剪后的图片路径1:', obj.url);
|
||||
that.setData({
|
||||
showCropper: false
|
||||
});
|
||||
if(this.data.orgImageName == 'idcard'){
|
||||
that.uploadImageIdcard(obj.url); // 上传图片
|
||||
}
|
||||
else if(this.data.orgImageName == 'bankcard'){
|
||||
that.uploadImageBankcard(obj.url); // 上传图片
|
||||
|
||||
}else if(this.data.orgImageName == 'childcard'){
|
||||
that.uploadImageChildId(obj.url); // 上传图片
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 取消裁剪
|
||||
onCropperCancel() {
|
||||
this.setData({
|
||||
showCropper: false
|
||||
});
|
||||
},
|
||||
rotate() {
|
||||
//在用户旋转的基础上旋转90°
|
||||
const cropper = this.selectComponent("#image-cropper")
|
||||
cropper.setAngle(cropper.data.angle += 90);
|
||||
},
|
||||
end(e) {
|
||||
clearInterval(this.data[e.currentTarget.dataset.type]);
|
||||
},
|
||||
//裁剪图片结束
|
||||
|
||||
|
||||
handleSubmit:function(){
|
||||
var that = this;
|
||||
console.log(this.data.refname, "refname");
|
||||
console.log(this.data.refidcard, "refidcard");
|
||||
console.log(this.data.refbankcard, "refbankcard");
|
||||
console.log(this.data.refbankcardname, "refbankcardname");
|
||||
console.log(this.data.refbanktypeinfo, "refbanktypeinfo");
|
||||
console.log(this.data.refbanktype, "refbanktype");
|
||||
console.log(this.data.refbankmanual, "refbankmanual");
|
||||
console.log(this.data.reftel, "reftel");
|
||||
console.log(this.data.resIdcardImgUrl, "resIdcardImgUrl");
|
||||
console.log(this.data.resBankcardImgUrl, "resBankcardImgUrl");
|
||||
console.log(this.data.resChildIdImgUrl, "resChildIdImgUrl");
|
||||
|
||||
util.requestPost(api.createRefund, {
|
||||
refname: that.data.refname,
|
||||
refidcard: that.data.refidcard,
|
||||
refbankcard: that.data.refbankcard,
|
||||
refbankcardname: that.data.refbankcardname,
|
||||
refbanktype: that.data.refbanktype,
|
||||
reftel: that.data.reftel,
|
||||
zidcardimg: that.data.resIdcardImgUrl,
|
||||
zbankcardimg: that.data.resBankcardImgUrl,
|
||||
childidcardimg: that.data.resChildIdImgUrl,
|
||||
})
|
||||
.then(function(res) {
|
||||
if (res.code === 0) {
|
||||
console.log("createRefund res:");
|
||||
console.log(res);
|
||||
console.log("createRefund resdata:");
|
||||
console.log(res.data);
|
||||
wx.showToast({
|
||||
title: '申请上传成功',
|
||||
icon: 'success',
|
||||
});
|
||||
setTimeout(() => {
|
||||
// 使用 wx.switchTab 切换到带有 tabBar 的首页
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}, 1000);
|
||||
}else if (res.code == 1002025012){
|
||||
that.setData({
|
||||
isalert1: true
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '申请上传失败',
|
||||
icon: 'success',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleReset:function(){
|
||||
this.setData({
|
||||
refname: '',
|
||||
refidcard: '',
|
||||
refbankcard: '',
|
||||
refbankcardname: '',
|
||||
refbanktype: '',
|
||||
refbanktypeinfo: '',
|
||||
refbankmanual: '',
|
||||
reftel: '',
|
||||
imageUrlIdcard: '', // 用于存储上传的图片路径
|
||||
resIdcardImgUrl: '',
|
||||
imageUrlBankcard: '', // 用于存储上传的图片路径
|
||||
resBankcardImgUrl: '',
|
||||
imageUrlChildId: '', // 用于存储上传的图片路径
|
||||
resChildIdImgUrl: '',
|
||||
})
|
||||
},
|
||||
|
||||
onConfirmTips: function(){
|
||||
this.setData({
|
||||
tipsdialog: false
|
||||
})
|
||||
},
|
||||
onShowTips: function(){
|
||||
this.setData({
|
||||
tipsdialog: true
|
||||
})
|
||||
},
|
||||
|
||||
onhandleSubmit: function(){
|
||||
this.setData({
|
||||
isalert: true
|
||||
})
|
||||
},
|
||||
|
||||
onConfirmAlert1: function(){
|
||||
this.setData({
|
||||
isalert1: false
|
||||
})
|
||||
},
|
||||
|
||||
onConfirmAlert: function(){
|
||||
this.setData({
|
||||
isalert: false
|
||||
})
|
||||
|
||||
console.log(this.data.refname, "refname");
|
||||
console.log(this.data.refidcard, "refidcard");
|
||||
console.log(this.data.refbankcard, "refbankcard");
|
||||
console.log(this.data.refbankcardname, "refbankcardname");
|
||||
console.log(this.data.refbanktypeinfo, "refbanktypeinfo");
|
||||
console.log(this.data.refbanktype, "refbanktype");
|
||||
console.log(this.data.refbankmanual, "refbankmanual");
|
||||
console.log(this.data.reftel, "reftel");
|
||||
console.log(this.data.resIdcardImgUrl, "resIdcardImgUrl");
|
||||
console.log(this.data.resBankcardImgUrl, "resBankcardImgUrl");
|
||||
console.log(this.data.resChildIdImgUrl, "resChildIdImgUrl");
|
||||
|
||||
if(this.data.refname =='' || this.data.refname == null){
|
||||
wx.showModal({
|
||||
content: '就诊卡登记姓名不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
else if(this.data.refidcard =='' || this.data.refidcard == null){
|
||||
wx.showModal({
|
||||
content: '身份证号不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
else if(this.data.refbankcard =='' || this.data.refbankcard == null){
|
||||
wx.showModal({
|
||||
content: '银行卡号不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
else if(this.data.refbankcardname =='' || this.data.refbankcardname == null){
|
||||
wx.showModal({
|
||||
content: '银行卡持卡人姓名不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.data.reftel =='' || this.data.reftel == null){
|
||||
wx.showModal({
|
||||
content: '手机号码不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.data.resIdcardImgUrl =='' || this.data.resIdcardImgUrl == null){
|
||||
wx.showModal({
|
||||
content: '身份证正面不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.data.resBankcardImgUrl =='' || this.data.resBankcardImgUrl == null){
|
||||
wx.showModal({
|
||||
content: '银行卡正面不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
|
||||
}
|
||||
else if((this.data.resChildIdImgUrl =='' || this.data.resChildIdImgUrl == null)&&
|
||||
(this.data.ifchild == true)){
|
||||
wx.showModal({
|
||||
content: '儿童证件不能为空',
|
||||
showCancel: false,
|
||||
})
|
||||
|
||||
}
|
||||
else{
|
||||
this.handleSubmit();
|
||||
}
|
||||
},
|
||||
onCancelAlert: function(){
|
||||
this.setData({
|
||||
isalert: false
|
||||
})
|
||||
},
|
||||
|
||||
showPopBankType(){
|
||||
this.setData({ showbanktype: true });
|
||||
},
|
||||
onCloseBankType() {
|
||||
this.setData({ showbanktype: false, });
|
||||
},
|
||||
|
||||
confirmBankType(e){
|
||||
console.log(e.currentTarget.dataset.item)
|
||||
let item = e.currentTarget.dataset.item
|
||||
this.setData({
|
||||
showbanktype: false,
|
||||
refbanktype: item.name,
|
||||
refbanktypeinfo: item.name
|
||||
})
|
||||
if(item.value == 7){
|
||||
this.setData({
|
||||
isShowBankManual: true
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
isShowBankManual: false
|
||||
})
|
||||
}
|
||||
},
|
||||
onChangeBankType: function(e){
|
||||
this.setData({
|
||||
refbanktype: e.detail
|
||||
})
|
||||
},
|
||||
|
||||
onChangeRefname: function(e){
|
||||
this.setData({
|
||||
refname: e.detail
|
||||
})
|
||||
},
|
||||
onChangeRefbankcard: function(e){
|
||||
this.setData({
|
||||
refbankcard: e.detail
|
||||
})
|
||||
},
|
||||
onChangeRefbankcardname: function(e){
|
||||
this.setData({
|
||||
refbankcardname: e.detail
|
||||
})
|
||||
},
|
||||
onChangeReftel: function(e){
|
||||
this.setData({
|
||||
reftel: e.detail
|
||||
})
|
||||
},
|
||||
|
||||
// 从身份证号码中提取生日信息(格式为YYYYMMDD)
|
||||
getBirthdayFromIdCard: function(idCard){
|
||||
return idCard.substring(6, 14); // 这里假设身份证号码长度为18位并按照标准格式存放
|
||||
|
||||
},
|
||||
// 将字符串类型的生日转换成Date对象
|
||||
convertToDateObject: function(birthdayString){
|
||||
const year = birthdayString.substr(0, 4);
|
||||
const month = birthdayString.substr(4, 2);
|
||||
const day = birthdayString.substr(6, 2);
|
||||
|
||||
return new Date(`${year}-${month}-${day}`);
|
||||
|
||||
},
|
||||
|
||||
// 计算年龄函数
|
||||
calculateAge: function(idCard){
|
||||
console.log(idCard);
|
||||
// 获取当前日期
|
||||
const currentDate = new Date();
|
||||
|
||||
const birthdate = this.convertToDateObject(this.getBirthdayFromIdCard(idCard));
|
||||
let age;
|
||||
|
||||
if (currentDate >= birthdate && !isNaN(currentDate)) {
|
||||
age = Math.floor((currentDate - birthdate) / (365 * 24 * 60 * 60 * 1000));
|
||||
console.log(age, "age0");
|
||||
|
||||
} else {
|
||||
console.error('无效的身份证号码或者未知错误');
|
||||
}
|
||||
|
||||
return age || '';
|
||||
|
||||
},
|
||||
isValidID:function (id) {
|
||||
if (!/^\d{17}(\d|X)$/.test(id)) return false; // 检查格式是否正确
|
||||
|
||||
// 计算第18位校验码
|
||||
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
|
||||
const checkCode = '10X98765432';
|
||||
let sum = 0;
|
||||
for (let i = 0; i < id.length - 1; i++) {
|
||||
sum += parseInt(id[i], 10) * weights[i];
|
||||
}
|
||||
sum = sum % 11;
|
||||
|
||||
// 验证第18位校验码是否正确
|
||||
return checkCode[sum] === id[17].toUpperCase();
|
||||
},
|
||||
|
||||
onChangeIdcard(e) {
|
||||
this.data.refidcard = e.detail;
|
||||
console.log(this.data.refidcard, "idcard");
|
||||
if(this.isValidID(this.data.refidcard) == false) return;
|
||||
|
||||
let age = this.calculateAge(this.data.refidcard);
|
||||
console.log(age, "age");
|
||||
if(age <= 15){
|
||||
this.setData({
|
||||
ifchild: true,
|
||||
});
|
||||
console.log(this.data.ifchild, "child");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 选择银行卡图片
|
||||
chooseImageBankcard() {
|
||||
let that = this;
|
||||
wx.showActionSheet({
|
||||
itemList: ['拍照', '从相册选择'],
|
||||
success: (res) => {
|
||||
const sourceType = res.tapIndex === 0 ? ['camera'] : ['album']; // 0: 拍照, 1: 相册
|
||||
// wx.chooseImage({
|
||||
wx.chooseImage({
|
||||
count: 1, // 只能选择一张图片
|
||||
sizeType: ['compressed'], // 压缩图片
|
||||
sourceType: sourceType, // 调用相机或相册
|
||||
success: (res) => {
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
|
||||
const tempFilePaths = res.tempFilePaths;
|
||||
// this.setData({
|
||||
// imageUrlBankcard: tempFilePaths[0], // 更新图片路径
|
||||
// });
|
||||
|
||||
that.setData({
|
||||
showCropper: true}, () => {
|
||||
// setData 的回调函数,确保页面已经重新渲染
|
||||
const cropperInstance1 = this.selectComponent("#image-cropper");
|
||||
if (cropperInstance1) {
|
||||
// 调用组件的方法
|
||||
console.log('找到组件实例');
|
||||
} else {
|
||||
console.log('未找到组件实例');
|
||||
}
|
||||
});
|
||||
that.setData({
|
||||
orgImageSrc: tempFilePaths[0], // 更新图片路径
|
||||
orgImageName: 'bankcard'
|
||||
});
|
||||
|
||||
//this.uploadImageBankcard(tempFilePaths[0]); // 上传图片
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('选择银行卡图片失败', err);
|
||||
wx.showToast({
|
||||
title: '选择银行卡图片失败',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开选择器失败', err);
|
||||
},
|
||||
});
|
||||
},
|
||||
// 选择身份证图片
|
||||
chooseImageChildId() {
|
||||
let that = this;
|
||||
|
||||
wx.showActionSheet({
|
||||
itemList: ['拍照', '从相册选择'],
|
||||
success: (res) => {
|
||||
const sourceType = res.tapIndex === 0 ? ['camera'] : ['album']; // 0: 拍照, 1: 相册
|
||||
// wx.chooseImage({
|
||||
wx.chooseImage({
|
||||
count: 1, // 只能选择一张图片
|
||||
sizeType: ['compressed'], // 压缩图片
|
||||
sourceType: sourceType, // 调用相机或相册
|
||||
success: (res) => {
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
|
||||
const tempFilePaths = res.tempFilePaths;
|
||||
// this.setData({
|
||||
// imageUrlChildId: tempFilePaths[0], // 更新图片路径
|
||||
// });
|
||||
that.setData({
|
||||
showCropper: true}, () => {
|
||||
// setData 的回调函数,确保页面已经重新渲染
|
||||
const cropperInstance1 = this.selectComponent("#image-cropper");
|
||||
if (cropperInstance1) {
|
||||
// 调用组件的方法
|
||||
console.log('找到组件实例');
|
||||
} else {
|
||||
console.log('未找到组件实例');
|
||||
}
|
||||
});
|
||||
that.setData({
|
||||
orgImageSrc: tempFilePaths[0], // 更新图片路径
|
||||
orgImageName: 'childcard'
|
||||
});
|
||||
|
||||
//this.uploadImageChildId(tempFilePaths[0]); // 上传图片
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('选择儿童证件图片失败', err);
|
||||
wx.showToast({
|
||||
title: '选择儿童证件图片失败',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开选择器失败', err);
|
||||
},
|
||||
});
|
||||
},
|
||||
// 选择身份证图片
|
||||
chooseImageIdcard() {
|
||||
let that = this;
|
||||
wx.showActionSheet({
|
||||
itemList: ['拍照', '从相册选择'],
|
||||
success: (res) => {
|
||||
const sourceType = res.tapIndex === 0 ? ['camera'] : ['album']; // 0: 拍照, 1: 相册
|
||||
wx.chooseImage({
|
||||
count: 1, // 只能选择一张图片
|
||||
sizeType: ['compressed'], // 压缩图片
|
||||
sourceType: sourceType, // 调用相机或相册
|
||||
success: (res) => {
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
|
||||
const tempFilePaths = res.tempFilePaths;
|
||||
console.log(tempFilePaths, "tempFilePaths");
|
||||
that.setData({
|
||||
showCropper: true}, () => {
|
||||
// setData 的回调函数,确保页面已经重新渲染
|
||||
const cropperInstance1 = this.selectComponent("#image-cropper");
|
||||
if (cropperInstance1) {
|
||||
// 调用组件的方法
|
||||
console.log('找到组件实例');
|
||||
} else {
|
||||
console.log('未找到组件实例');
|
||||
}
|
||||
});
|
||||
that.setData({
|
||||
orgImageSrc: tempFilePaths[0], // 更新图片路径
|
||||
orgImageName: 'idcard'
|
||||
});
|
||||
//this.uploadImageIdcard(tempFilePaths[0]); // 上传图片
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('选择身份证图片失败', err);
|
||||
wx.showToast({
|
||||
title: '选择身份证图片失败',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开选择器失败', err);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片
|
||||
uploadImageIdcard(filePath) {
|
||||
wx.showLoading({
|
||||
title: '图片上传中',
|
||||
})
|
||||
|
||||
wx.uploadFile({
|
||||
url: 'https://xytj.btlsoln.com/app-api/member/dept-info/upload',
|
||||
// url: 'http://192.168.10.172:58080/app-api/member/dept-info/upload',
|
||||
filePath: filePath, // 图片路径
|
||||
name: 'file', // 文件对应的 key
|
||||
// 设置请求头
|
||||
header: {
|
||||
'tenant-id':'1', // 示例:设置授权信息
|
||||
'Content-Type': 'multipart/form-data' // 可以根据需要修改
|
||||
},
|
||||
formData: {
|
||||
type: 'id_card_front', // 上传文件类型
|
||||
},
|
||||
success: (res) => {
|
||||
wx.hideLoading();
|
||||
try{
|
||||
const data = JSON.parse(res.data); // 解析服务器返回的数据
|
||||
console.log('上传成功', data.data);
|
||||
wx.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
});
|
||||
this.setData({
|
||||
imageUrlIdcard: filePath
|
||||
});
|
||||
|
||||
this.setData({
|
||||
resIdcardImgUrl: data.data, // 更新后端图片路径,用于请求
|
||||
});
|
||||
|
||||
}catch(error){
|
||||
// 解析失败,捕获错误信息
|
||||
console.log('JSON 解析出错:', error);
|
||||
wx.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none',
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('上传失败', err);
|
||||
wx.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 上传图片
|
||||
uploadImageBankcard(filePath) {
|
||||
wx.showLoading({
|
||||
title: '图片上传中',
|
||||
})
|
||||
|
||||
wx.uploadFile({
|
||||
url: 'https://xytj.btlsoln.com/app-api/member/dept-info/upload',
|
||||
// url: 'http://192.168.10.172:58080/app-api/member/dept-info/upload',
|
||||
filePath: filePath, // 图片路径
|
||||
name: 'file', // 文件对应的 key
|
||||
// 设置请求头
|
||||
header: {
|
||||
'tenant-id':'1', // 示例:设置授权信息
|
||||
'Content-Type': 'multipart/form-data' // 可以根据需要修改
|
||||
},
|
||||
formData: {
|
||||
type: 'id_card_front', // 上传文件类型
|
||||
},
|
||||
success: (res) => {
|
||||
wx.hideLoading();
|
||||
try {
|
||||
const data = JSON.parse(res.data); // 解析服务器返回的数据
|
||||
console.log('上传成功', data.data);
|
||||
wx.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
});
|
||||
this.setData({
|
||||
imageUrlBankcard: filePath
|
||||
});
|
||||
|
||||
this.setData({
|
||||
resBankcardImgUrl: data.data, // 更新后端图片路径,用于请求
|
||||
});
|
||||
}catch(error){
|
||||
// 解析失败,捕获错误信息
|
||||
console.log('JSON 解析出错:', error);
|
||||
wx.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none',
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('上传失败', err);
|
||||
wx.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 上传图片
|
||||
uploadImageChildId(filePath) {
|
||||
wx.showLoading({
|
||||
title: '图片上传中',
|
||||
})
|
||||
|
||||
wx.uploadFile({
|
||||
url: 'https://xytj.btlsoln.com/app-api/member/dept-info/upload',
|
||||
// url: 'http://192.168.10.172:58080/app-api/member/dept-info/upload',
|
||||
filePath: filePath, // 图片路径
|
||||
name: 'file', // 文件对应的 key
|
||||
// 设置请求头
|
||||
header: {
|
||||
'tenant-id':'1', // 示例:设置授权信息
|
||||
'Content-Type': 'multipart/form-data' // 可以根据需要修改
|
||||
},
|
||||
formData: {
|
||||
type: 'id_card_front', // 上传文件类型
|
||||
},
|
||||
success: (res) => {
|
||||
wx.hideLoading();
|
||||
try {
|
||||
const data = JSON.parse(res.data); // 解析服务器返回的数据
|
||||
console.log('上传成功', data.data);
|
||||
wx.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
});
|
||||
this.setData({
|
||||
imageUrlChildId: filePath
|
||||
});
|
||||
|
||||
this.setData({
|
||||
resChildIdImgUrl: data.data, // 更新后端图片路径,用于请求
|
||||
});
|
||||
|
||||
}catch(error){
|
||||
// 解析失败,捕获错误信息
|
||||
console.log('JSON 解析出错:', error);
|
||||
wx.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('上传失败', err);
|
||||
wx.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
5
pages/userRefund/userRefund.json
Normal file
5
pages/userRefund/userRefund.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"image-cropper": "../../component/image-cropper/image-cropper"
|
||||
}
|
||||
}
|
||||
263
pages/userRefund/userRefund.wxml
Normal file
263
pages/userRefund/userRefund.wxml
Normal file
@@ -0,0 +1,263 @@
|
||||
|
||||
<view>
|
||||
<view class="container">
|
||||
<view style="text-indent: 2em;margin-right: 1em;">为积极响应国家关于提升医疗服务质量和效率的号召,库尔勒市妇幼保健院开展就诊卡门诊预交金余额清退工作,旨在简化就医流程,推广身份证、电子健康码、医保码等便捷就医方式,逐步淘汰实体就诊卡。</view>
|
||||
<view style="text-indent: 2em;margin-bottom: 1em;">本院向您郑重承诺,您的个人信息仅用于就诊卡退费使用。</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="container-titile">
|
||||
<view class="container-text">
|
||||
填写收款信息
|
||||
<span style="text-indent: 2em;color:rgb(247, 8, 8); margin-right: 5em;">
|
||||
(请填写本人信息确保以下内容均为同一人)
|
||||
</span>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class = "container-info">
|
||||
<van-field
|
||||
value="{{ refname }}"
|
||||
required
|
||||
clearable
|
||||
label="就诊卡登记姓名"
|
||||
placeholder="请填写身份证上的全名,不要有错字"
|
||||
bind:change="onChangeRefname"
|
||||
style="z-index: 2;"
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ refidcard }}"
|
||||
label="身份证号"
|
||||
placeholder="请输入就诊卡人的身份证号"
|
||||
type="idcard"
|
||||
required
|
||||
border="{{ false }}"
|
||||
bind:change="onChangeIdcard"
|
||||
style="z-index: 2;"
|
||||
|
||||
/>
|
||||
<van-field
|
||||
value="{{ refbankcard }}"
|
||||
label="银行卡号"
|
||||
placeholder="请输入银行卡号"
|
||||
required
|
||||
border="{{ false }}"
|
||||
bind:change="onChangeRefbankcard"
|
||||
style="z-index: 2;"
|
||||
|
||||
/>
|
||||
<van-field
|
||||
value="{{ refbankcardname }}"
|
||||
label="银行卡持卡人姓名"
|
||||
placeholder="请输入银行卡持卡人姓名"
|
||||
required
|
||||
border="{{ false }}"
|
||||
bind:change="onChangeRefbankcardname"
|
||||
style="z-index: 2;"
|
||||
|
||||
/>
|
||||
<van-field
|
||||
value="{{ refbanktypeinfo }}"
|
||||
label="开户行"
|
||||
placeholder="请选择银行卡开户行类型"
|
||||
required
|
||||
border="{{ false }}"
|
||||
right-icon="arrow-down"
|
||||
readonly="true"
|
||||
bind:click-input="showPopBankType"
|
||||
bind:click-icon="showPopBankType"
|
||||
style="z-index: 2;"
|
||||
|
||||
/>
|
||||
<view class="wsbanktype" wx:if="{{ isShowBankManual }}">
|
||||
<van-field
|
||||
value="{{ refbankmanual }}"
|
||||
placeholder="请输入银行卡开户行类型"
|
||||
border="{{ false }}"
|
||||
bind:change="onChangeBankType"
|
||||
style="z-index: 2;"
|
||||
|
||||
/>
|
||||
</view>
|
||||
<van-field
|
||||
value="{{ reftel }}"
|
||||
label="手机号"
|
||||
placeholder="请输入手机号"
|
||||
required
|
||||
border="{{ false }}"
|
||||
bind:change="onChangeReftel"
|
||||
style="z-index: 2;"
|
||||
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="itemStu" wx:if="{{ !ifchild }}">
|
||||
<view class="leftStu">
|
||||
<span style="color: red;">*</span>身份证正面
|
||||
</view>
|
||||
<view class="rightStu">
|
||||
<!-- 图片容器 -->
|
||||
<view class="image-container" bindtap="chooseImageIdcard">
|
||||
<!-- 显示上传的图片 -->
|
||||
<image
|
||||
src="{{imageUrlIdcard || 'https://hnwjyy.oss-cn-shanghai.aliyuncs.com/idcard-bg.png'}}"
|
||||
mode="aspectFill"
|
||||
class="upload-image"
|
||||
></image>
|
||||
<!-- 提示文字 -->
|
||||
<view wx:if="{{!imageUrlIdcard}}" class="placeholder-text">成年人请上传本人身份证正面</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="itemStu" wx:if="{{ ifchild }}">
|
||||
<view class="leftStu">
|
||||
<span style="color: red;">*</span>身份证正面
|
||||
</view>
|
||||
<view class="rightStu">
|
||||
<!-- 图片容器 -->
|
||||
<view class="image-container" bindtap="chooseImageIdcard">
|
||||
<!-- 显示上传的图片 -->
|
||||
<image
|
||||
src="{{imageUrlIdcard || 'https://hnwjyy.oss-cn-shanghai.aliyuncs.com/idcard-bg.png'}}"
|
||||
mode="aspectFill"
|
||||
class="upload-image"
|
||||
></image>
|
||||
<!-- 提示文字 -->
|
||||
<view wx:if="{{!imageUrlIdcard}}" class="placeholder-text">请上传收款人身份证正面</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="itemStu" wx:if="{{ ifchild }}" >
|
||||
<view class="leftStu">
|
||||
<span style="color: red;">*</span>身份证正面或户口本本人页或出生证明
|
||||
</view>
|
||||
<view class="rightStu">
|
||||
<!-- 图片容器 -->
|
||||
<view class="image-container" bindtap="chooseImageChildId">
|
||||
<!-- 显示上传的图片 -->
|
||||
<image
|
||||
src="{{imageUrlChildId || 'https://hnwjyy.oss-cn-shanghai.aliyuncs.com/idcard-bg.png'}}"
|
||||
mode="aspectFill"
|
||||
class="upload-image"
|
||||
></image>
|
||||
<!-- 提示文字 -->
|
||||
<view wx:if="{{!imageUrlChildId}}" class="placeholder-text">儿童请上传收款人身份证及儿童的身份证或户口本或出生证明三选一</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="itemStu" >
|
||||
<view class="leftStu">
|
||||
<span style="color: red;">*</span>银行卡正面
|
||||
</view>
|
||||
<view class="rightStu">
|
||||
<!-- 图片容器 -->
|
||||
<view class="image-container" bindtap="chooseImageBankcard">
|
||||
<!-- 显示上传的图片 -->
|
||||
<image
|
||||
src="{{imageUrlBankcard || 'https://hnwjyy.oss-cn-shanghai.aliyuncs.com/idcard-bg.png'}}"
|
||||
mode="aspectFill"
|
||||
class="upload-image"
|
||||
></image>
|
||||
<!-- 提示文字 -->
|
||||
<view wx:if="{{!imageUrlBankcard}}" class="placeholder-text">银行卡正面(显示银行卡号码)</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view wx:if="{{showCropper}}" class="mask" bindtap="preventDefault"></view> -->
|
||||
<view id="cropperR" class="clsCropper" wx:if="{{ showCropper }}">
|
||||
<image-cropper
|
||||
id="image-cropper"
|
||||
imgSrc="{{orgImageSrc}}"
|
||||
bindload="onCropperLoad"
|
||||
bindimageload="OnCropperloadimage"
|
||||
bindtapcut="onCropperConfirm"
|
||||
width="{{width}}"
|
||||
height="{{height}}"
|
||||
max_width="{{max_width}}"
|
||||
max_height="{{max_height}}"
|
||||
></image-cropper>
|
||||
|
||||
<view class = "buttonRfooter" >
|
||||
<button id="specialButton1" class="buttonR" bindtap="onCropperCancel">取消</button>
|
||||
<button id="specialButton2" class="buttonR" catchtouchstart='rotate' catchtouchend='end' data-type="rotate">旋转</button>
|
||||
<button id="specialButton3" class="buttonR" bindtap="triggerCut">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- </van-cell-group> -->
|
||||
|
||||
<van-popup
|
||||
show="{{ showbanktype }}"
|
||||
round
|
||||
closeable
|
||||
position="bottom"
|
||||
bind:close="onCloseBankType">
|
||||
<view class="popWrap">
|
||||
<view class="title1">选择银行卡开户行类型</view>
|
||||
<view class="msgItem" wx:for="{{bankType}}" wx:key="item" data-item="{{item}}" bindtap="confirmBankType">{{item.name}}</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
|
||||
<view class="rw-class">
|
||||
<van-dialog
|
||||
use-slot
|
||||
bind:confirm="onConfirmTips"
|
||||
id="van-dialog1"
|
||||
|
||||
show="{{ tipsdialog }}"
|
||||
>
|
||||
<view class="rwTitle">就诊卡退费</view>
|
||||
<view class="wrapStu" >
|
||||
<text class="rwtips" >尊敬的各位患者及家属:
|
||||
为积极响应国家关于提升医疗服务质量和效率的号召,库尔勒市妇幼保健院开展就诊卡门诊预交金余额清退工作,旨在简化就医流程,推广身份证、电子健康码、医保码等便捷就医方式,逐步淘汰实体就诊卡。
|
||||
本院向您郑重承诺,您的个人信息仅用于就诊卡退费使用。 </text>
|
||||
</view>
|
||||
</van-dialog>
|
||||
</view>
|
||||
|
||||
<view class="rw-class">
|
||||
<van-dialog
|
||||
use-slot
|
||||
bind:confirm="onConfirmAlert"
|
||||
bind:cancel="onCancelAlert"
|
||||
id="van-dialog1"
|
||||
show-cancel-button
|
||||
cancel-button-text="再看看"
|
||||
show="{{ isalert }}"
|
||||
>
|
||||
<view class="rwTitle">提示</view>
|
||||
<view class="wrapStu" >
|
||||
<text class="wrapAlert" >提交后无法修改,确认提交?</text>
|
||||
</view>
|
||||
</van-dialog>
|
||||
</view>
|
||||
|
||||
<view class="rw-class">
|
||||
<van-dialog
|
||||
use-slot
|
||||
bind:confirm="onConfirmAlert1"
|
||||
id="van-dialog1"
|
||||
show="{{ isalert1 }}"
|
||||
>
|
||||
<view class="rwTitle">提示</view>
|
||||
<view class="wrapStu" >
|
||||
<text class="wrapAlert" >信息已上传,审核中处理中,请耐心等待</text>
|
||||
</view>
|
||||
</van-dialog>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view>
|
||||
<text class="footertips" >请保证以上信息真实有效,提交后无法修改,代办经本人授权处理,由此产生的纠纷与本院无关。</text>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<button class="btn reset" bindtap="handleReset">重置</button>
|
||||
<button class="btn submit" bindtap="onhandleSubmit">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
262
pages/userRefund/userRefund.wxss
Normal file
262
pages/userRefund/userRefund.wxss
Normal file
@@ -0,0 +1,262 @@
|
||||
/* 图片容器样式 */
|
||||
.image-container {
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
border: 1px dashed #ccc;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 图片样式 */
|
||||
.upload-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 占位文字样式 */
|
||||
.placeholder-text {
|
||||
position: absolute;
|
||||
margin-top: 80rpx;
|
||||
color: #888;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
/* 自定义 label 宽度 */
|
||||
.custom-label {
|
||||
width: 600px !important;
|
||||
color: red !important;
|
||||
}
|
||||
.leftStu{
|
||||
width: 22%;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
.rightStu{
|
||||
width: 72%;
|
||||
height: 100%;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.itemStu{
|
||||
height: 400rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 2rpx solid #e2e2e2;
|
||||
}
|
||||
|
||||
.container{
|
||||
width: 100%;
|
||||
background-color: #FFF6ED;
|
||||
font-size: 24rpx;
|
||||
color:rgb(247, 8, 8);
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.container-title{
|
||||
width: 100%;
|
||||
background-color: #FFF6ED;
|
||||
font-size: 30rpx;
|
||||
color:rgb(247, 8, 8);
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.container-text{
|
||||
width: 90%;
|
||||
background-color: #FFF6ED;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
line-height: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
/* 底部按钮区域 */
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: space-between; /* 按钮左右分布 */
|
||||
padding: 10px 20px;
|
||||
background-color: #f8f8f8; /* 底部背景色 */
|
||||
border-top: 1px solid #ddd; /* 顶部边框 */
|
||||
}
|
||||
|
||||
/* 按钮样式 */
|
||||
.btn {
|
||||
flex: 1; /* 按钮平均分配宽度 */
|
||||
margin: 0 10px; /* 按钮之间的间距 */
|
||||
}
|
||||
|
||||
/* 重置按钮 */
|
||||
.reset {
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
/* 提交按钮 */
|
||||
.submit {
|
||||
background-color: #07c160;
|
||||
color: #fff;
|
||||
}
|
||||
.popWrap{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 10rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.popWrap :last-child{
|
||||
border: none;
|
||||
}
|
||||
|
||||
.title1{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
font-size: 33rpx;
|
||||
color: #666;
|
||||
line-height: 80rpx;
|
||||
text-align: center
|
||||
}
|
||||
.msgItem{
|
||||
height: 80rpx;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
border-bottom: 1rpx solid #f8f8f8;
|
||||
}
|
||||
|
||||
.rwTitle{
|
||||
font-size: 35rpx;
|
||||
font-weight: bold;
|
||||
/* color: rgb(253, 6, 6); */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 30rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.rwtips{
|
||||
font-size: 30rpx;
|
||||
/* color: rgb(253, 6, 6); */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 20rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.wrapAlert{
|
||||
font-size: 30rpx;
|
||||
/* color: rgb(253, 6, 6); */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* page.wxss 文件 */
|
||||
.rw-class .van-dialog__confirm,
|
||||
.rw-class .van-dialog__cancel {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.footertips{
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: rgb(247, 8, 8);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 10rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.wsbanktype{
|
||||
margin-left: 6em;
|
||||
}
|
||||
|
||||
/* 容器样式 */
|
||||
.containerCanvas {
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* 裁剪框样式 */
|
||||
.crop-box {
|
||||
position: absolute;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
|
||||
pointer-events: none; /* 防止裁剪框拦截点击事件 */
|
||||
}
|
||||
|
||||
.buttonR {
|
||||
font-size: 27rpx;
|
||||
/* z-index: 2; */
|
||||
padding: 0 20rpx;
|
||||
height: 60rpx;
|
||||
min-width: 100rpx;
|
||||
z-index: 1000; /* 确保按钮在遮罩层之上 */
|
||||
pointer-events: auto; /*允许按钮响应点击事件 */
|
||||
|
||||
}
|
||||
.buttonRfooter {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-around; /* 按钮左右分布 */
|
||||
margin-bottom: 30rpx;
|
||||
background-color: #f8f8f8; /* 底部背景色 */
|
||||
border-top: 10px solid rgb(252, 250, 250); /* 顶部边框 */
|
||||
/* border:10px solid rgb(252, 8, 8); */
|
||||
|
||||
}
|
||||
|
||||
.clsCropper{
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin-bottom: 80rpx;
|
||||
/* border:10px solid rgb(252, 8, 8); */
|
||||
|
||||
}
|
||||
|
||||
#cropperR{
|
||||
z-index: 1000; /* 确保按钮在遮罩层之上 */
|
||||
pointer-events: auto; /* 允许按钮响应点击事件 */
|
||||
}
|
||||
#specialButton1 {
|
||||
position: relative;
|
||||
z-index: 1000; /* 确保按钮在遮罩层之上 */
|
||||
pointer-events: auto; /* 允许按钮响应点击事件 */
|
||||
}
|
||||
#specialButton2 {
|
||||
position: relative;
|
||||
z-index: 1000; /* 确保按钮在遮罩层之上 */
|
||||
pointer-events: auto; /* 允许按钮响应点击事件 */
|
||||
}
|
||||
#specialButton3 {
|
||||
position: relative;
|
||||
z-index: 1000; /* 确保按钮在遮罩层之上 */
|
||||
pointer-events: auto; /* 允许按钮响应点击事件 */
|
||||
}
|
||||
.mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0); /* 透明背景 */
|
||||
z-index: 999; /* 确保遮罩层在其他元素之上 */
|
||||
}
|
||||
.container-info{
|
||||
z-index: 2;
|
||||
}
|
||||
Reference in New Issue
Block a user