init version kelfy-mini for new gitea
This commit is contained in:
331
pages/money/money.js
Normal file
331
pages/money/money.js
Normal file
@@ -0,0 +1,331 @@
|
||||
// pages/record/record.js
|
||||
var app = getApp()
|
||||
let common = require('../../config/common.js')
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
list:[],
|
||||
moneyList:[
|
||||
{id:0,num:"50"},
|
||||
{id:1,num:"100"},
|
||||
{id:2,num:"200"},
|
||||
{id:3,num:"500"},
|
||||
{id:4,num:"1000"},
|
||||
],
|
||||
show:false,
|
||||
name:'',
|
||||
painId:'',
|
||||
relate:'',
|
||||
card:'',
|
||||
cardNum:'',
|
||||
cardType:'',
|
||||
curId:'6',
|
||||
money1:'',
|
||||
money2:'',
|
||||
ye:'',
|
||||
money:''
|
||||
},
|
||||
confirmCz(){
|
||||
let money = this.data.money
|
||||
if(isNaN(parseFloat(money))){
|
||||
wx.showToast(
|
||||
{
|
||||
title: '请输入正确金额',
|
||||
icon: 'error'
|
||||
}
|
||||
);
|
||||
}else if(money == ''){
|
||||
wx.showToast(
|
||||
{
|
||||
title: '请选择充值金额',
|
||||
icon: 'error'
|
||||
}
|
||||
);
|
||||
}else if(money < 0.01){
|
||||
wx.showToast({
|
||||
title: '金额不低于0.01',
|
||||
})
|
||||
}else{
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/getPayRequest?openid&totalAmount&patid',
|
||||
method:"GET",
|
||||
data:{
|
||||
openid:app.globalData.openId,
|
||||
totalAmount:money,
|
||||
patid:this.data.painId,
|
||||
cardno:this.data.cardNum,
|
||||
cardtype:this.data.cardType
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res)=> {
|
||||
if(res.data.errCode == "BAD_REQUEST") {
|
||||
wx.showToast(
|
||||
{
|
||||
title: '请输入正确金额',
|
||||
icon: 'error'
|
||||
}
|
||||
);
|
||||
}else if(res.data.error){
|
||||
wx.showToast({
|
||||
title: '检查输入金额',
|
||||
icon:"error"
|
||||
})
|
||||
}else if(res.data.errCode == "LossReported"){
|
||||
wx.showToast({
|
||||
title: res.data.errMsg,
|
||||
icon:"none"
|
||||
})
|
||||
}else{
|
||||
console.log(res,"获取银联商务支付信息")
|
||||
let noncestr = res.data.miniPayRequest.nonceStr
|
||||
let timeStamp = res.data.miniPayRequest.timeStamp
|
||||
let package1 = res.data.miniPayRequest.package
|
||||
let sign = res.data.miniPayRequest.paySign
|
||||
let signType = res.data.miniPayRequest.signType
|
||||
let merOrderId = res.data.merOrderId
|
||||
wx.requestPayment({
|
||||
timeStamp: timeStamp+'',
|
||||
nonceStr: noncestr,
|
||||
package:package1,
|
||||
signType:signType,
|
||||
paySign: sign,
|
||||
success (res) {
|
||||
console.log(res,"支付")
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/addHisRecharge?merOrderId',
|
||||
method:"GET",
|
||||
data:{
|
||||
merOrderId:merOrderId
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res)=> {
|
||||
console.log(res,"支付回写")
|
||||
}
|
||||
})
|
||||
},
|
||||
fail (res) {
|
||||
console.log(res,"fail")
|
||||
},
|
||||
complete (res) {
|
||||
console.log(res,'支付完成');
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
naviToCz(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/record/record?id=3',
|
||||
})
|
||||
},
|
||||
sel(e){
|
||||
console.log(e.currentTarget.dataset.item)
|
||||
let item = e.currentTarget.dataset.item
|
||||
this.setData({
|
||||
curId:item.id,
|
||||
money:item.num
|
||||
})
|
||||
},
|
||||
sel2(){
|
||||
this.setData({
|
||||
curId:5
|
||||
})
|
||||
},
|
||||
getPerMsg(cardno,cardtype,hzxm){
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/his/getPatient?cardno&cardtype&hzxm',
|
||||
method:"GET",
|
||||
data:{
|
||||
cardno:cardno,
|
||||
cardtype:cardtype,
|
||||
hzxm:hzxm
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res)=> {
|
||||
console.log(res.data,"患者详细信息")
|
||||
this.setData({
|
||||
ye:res.data.list[0].zhye
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getPerList(){
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/getPatientByOpenid?openid',
|
||||
method:"GET",
|
||||
data:{
|
||||
openid:app.globalData.openId
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res)=> {
|
||||
console.log(res,"患者")
|
||||
if(res.data.length > 0){
|
||||
let data = res.data
|
||||
data.map((item,index) =>{
|
||||
if(item.TYPE == 0){
|
||||
let cardno = item.MEDICAL_CARD
|
||||
let cardtype = item.CARD_TYPE
|
||||
this.getPerMsg(cardno,cardtype,item.TRUE_NAME)
|
||||
this.setData({
|
||||
name:item.TRUE_NAME,
|
||||
painId:item.PATIENT_ID,
|
||||
relate:item.RELATE,
|
||||
cardNum:item.MEDICAL_CARD,
|
||||
cardType:item.CARD_TYPE
|
||||
})
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
list:data
|
||||
})
|
||||
}else{
|
||||
wx.showModal({
|
||||
title: '',
|
||||
content: '您还未绑定就诊人,请先绑定就诊人信息!',
|
||||
cancelText:"否",
|
||||
confirmText:'是',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/userMsgDel/userMsgDel?state=0',
|
||||
})
|
||||
}else{
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
showPop(){
|
||||
this.setData({ show: true });
|
||||
},
|
||||
onClose() {
|
||||
this.setData({ show: false });
|
||||
},
|
||||
confirm(e){
|
||||
console.log(e.currentTarget.dataset.item)
|
||||
let user = e.currentTarget.dataset.item
|
||||
let cardNum = user.MEDICAL_CARD
|
||||
let cardType = user.CARD_TYPE
|
||||
this.setData({
|
||||
name:user.TRUE_NAME,
|
||||
painId:user.PATIENT_ID,
|
||||
relate:user.RELATE,
|
||||
card:user.ID_CARD,
|
||||
cardNum:user.MEDICAL_CARD,
|
||||
cardType:user.CARD_TYPE,
|
||||
show:false
|
||||
});
|
||||
this.getPerMsg(cardNum,cardType,user.TRUE_NAME)
|
||||
},
|
||||
money:function(e){
|
||||
let price = e.detail.value
|
||||
// if(isNaN(parseFloat(price))){
|
||||
// wx.showToast(
|
||||
// {
|
||||
// title: '请输入正确金额',
|
||||
// icon: 'error'
|
||||
// }
|
||||
// );
|
||||
// }else{
|
||||
this.setData({
|
||||
money:price
|
||||
})
|
||||
// }
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
if(app.globalData.openId == ""||app.globalData.openId==null){
|
||||
common.checkGlobalOpenId().then(res=>{
|
||||
console.log(res)
|
||||
app.globalData.openId = res
|
||||
this.getPerList()
|
||||
},
|
||||
err=>{
|
||||
//初始化失败,弹框提示
|
||||
})
|
||||
}else{
|
||||
this.getPerList()
|
||||
}
|
||||
this.setData({
|
||||
name:app.globalData.name,
|
||||
painId:app.globalData.painId,
|
||||
type:app.globalData.relate,
|
||||
card:app.globalData.sfId,
|
||||
cardNum:app.globalData.cardNum
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
wx.setNavigationBarTitle({
|
||||
title: "门诊充值"
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
// this.getPerList()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
5
pages/money/money.json
Normal file
5
pages/money/money.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-popup": "@vant/weapp/popup/index"
|
||||
}
|
||||
}
|
||||
63
pages/money/money.wxml
Normal file
63
pages/money/money.wxml
Normal file
@@ -0,0 +1,63 @@
|
||||
<!--pages/record/record.wxml-->
|
||||
<view class="main">
|
||||
<view class="content">
|
||||
<view class="item">
|
||||
<view class="up">
|
||||
<view class="name">{{name}}</view>
|
||||
<view class="msg">
|
||||
<view wx:if="{{relate == 0}}" class="t1">本人</view>
|
||||
<view wx:elif="{{relate == 1}}" class="t1">子女</view>
|
||||
<view wx:elif="{{relate == 2}}" class="t1">夫妻 </view>
|
||||
<view wx:elif="{{relate == 3}}" class="t1">父母 </view>
|
||||
<view wx:elif="{{relate == 4}}" class="t1">朋友 </view>
|
||||
<view class="icon" bindlongtap="qiehuan" bindtap="showPop"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="down">
|
||||
<view>{{cardNum}}</view>
|
||||
<view>切换就诊人</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ye">
|
||||
<view class="c1">卡内余额</view>
|
||||
<view class="c2">¥{{ye}}</view>
|
||||
</view>
|
||||
<view class="jg">自助退款功能正在开发中,退款请到收费窗口办理!</view>
|
||||
<view class="title">在线充值(元)</view>
|
||||
<view class="itemWrap">
|
||||
<view class="item2 {{item.id == curId? 'active' : ''}}" wx:for="{{moneyList}}" bindtap="sel" wx:key="item" data-item="{{item}}">{{item.num}}</view>
|
||||
<view class="item2 {{curId == 5? 'active' : ''}}" bindtap="sel2">
|
||||
<input class="sr" bindinput='money' type='digit' value="{{ money2 }}" placeholder-class="placeholder" placeholder="自定义"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title2" bindtap="naviToCz">充值记录</view>
|
||||
<view class="btn" bindtap="confirmCz"> 确认充值</view>
|
||||
</view>
|
||||
|
||||
<van-popup
|
||||
show="{{ show }}"
|
||||
round
|
||||
closeable
|
||||
position="bottom"
|
||||
bind:close="onClose">
|
||||
<view class="popWrap">
|
||||
<view class="title1">选择就诊人</view>
|
||||
<view class="userWrap">
|
||||
<view class="userItem" wx:for="{{list}}" wx:key="item" data-item="{{item}}" bindtap="confirm">
|
||||
<view class="msg1">
|
||||
<view class="up1">
|
||||
<view class="name1">{{item.TRUE_NAME}}</view>
|
||||
<view wx:if="{{item.RELATE == 0}}" class="guanxi1">本人</view>
|
||||
<view wx:elif="{{item.RELATE == 1}}" class="guanxi1">子女</view>
|
||||
<view wx:elif="{{item.RELATE == 2}}" class="guanxi1">夫妻 </view>
|
||||
<view wx:elif="{{item.RELATE == 3}}" class="guanxi1">父母 </view>
|
||||
<view wx:elif="{{item.RELATE == 4}}" class="guanxi1">朋友 </view>
|
||||
</view>
|
||||
<view class="down1">{{item.MEDICAL_CARD}}</view>
|
||||
</view>
|
||||
<view class="icon1">></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
</view>
|
||||
245
pages/money/money.wxss
Normal file
245
pages/money/money.wxss
Normal file
@@ -0,0 +1,245 @@
|
||||
/* pages/record/record.wxss */
|
||||
.main{
|
||||
margin: 30rpx 0;
|
||||
width: 750rpx;
|
||||
}
|
||||
.content{
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.item{
|
||||
height: 200rpx;
|
||||
width: 100%;
|
||||
border-radius: 5rpx;
|
||||
margin: 40rpx auto;
|
||||
box-shadow:0px 0px 5rpx #e2e2e2;
|
||||
background: rgba(245,249,255);
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.up{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.name{
|
||||
font-size: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
color: #333;
|
||||
}
|
||||
.msg{
|
||||
flex: 1;
|
||||
height: 70rpx;
|
||||
line-height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.t1{
|
||||
height: 50rpx;
|
||||
width: 130rpx;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
font-size:33rpx;
|
||||
border-radius: 25rpx;
|
||||
color: rgba(45,135,255);
|
||||
background: rgba(226,237,254);
|
||||
}
|
||||
.mr{
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
}
|
||||
.down{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
}
|
||||
.icon{
|
||||
height: 50rpx;
|
||||
width: 50rpx;
|
||||
padding: 10rpx;
|
||||
box-sizing: border-box;
|
||||
margin-right: 50rpx;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(0,110,255);
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAZpJREFUaEPtV7tKBEEQrIoEf8Bc/AFzES8yEMFEEMFEBD9AMFVjwdhEzBTMhItMVMz9ATH3BwSzkoWLltu9me7hZlZnk022uuvRM80SA384cP6oAnInWBOoCTgdqCPkNNAN/98JSNoCsEfywG2lsYA5AUnrAF4nfa9Inhg5uGAmAZJWAby3Ol+QPHexMYCjBUhaAfBRAvmGQ5QASUsAvkohHyVA0iKA75LIBwuQtADgp0X+xTCyZgjJ0TTwzBGStAzg09w5EZDkVK69AiStAXhLxMFVJlqApF0AD66uCcFRAiRtTJ03cq5zH6J/5hkIKZLzmyogp/vBeyA3yb7+f3eEJKkg509JXkZt4oIEHJK87TKzc4QKEbBNcmw6A5Ke5zxC7eU5YsDizH6IJTV/cWctszZJPoUYmFVAB/kdko8h5LPugQ7y+yTvQ8lnE9BB/ojkTQz5bAKaxpKuARxPCPdelaZbKNYJy/eS7gCMSTZv05P1EJsYt0BVQAoXPTVqAh73UmBrAilc9NSoCXjcS4GtCaRw0VNj8An8AqTHZDFDvpKtAAAAAElFTkSuQmCC);
|
||||
background-size:100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.popWrap{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 10rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.title1{
|
||||
height: 100rpx;
|
||||
width: 100%;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
font-size: 33rpx;
|
||||
color: #333;
|
||||
}
|
||||
.userWrap{
|
||||
height: 100%;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.userWrap :last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
.userItem{
|
||||
height: 160rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx solid #f8f8f8;
|
||||
}
|
||||
.msg1{
|
||||
height: 160rpx;
|
||||
width: 500rpx;
|
||||
}
|
||||
.up1{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
.name1{
|
||||
font-size: 33rpx;
|
||||
height: 80rpx;
|
||||
color: #333;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.guanxi1{
|
||||
height: 60rpx;
|
||||
width: 120rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(228,240,255);
|
||||
border-radius: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: rgba(0,110,255);
|
||||
font-size: 32rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.down1{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
font-size: 33rpx;
|
||||
color: rgb(158, 154, 154);
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.icon1{
|
||||
color: rgb(180, 179, 179);
|
||||
padding-right:15rpx ;
|
||||
}
|
||||
.jg{
|
||||
height: 60rpx;
|
||||
width: 100%;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: red;
|
||||
}
|
||||
.ye{
|
||||
height: 120rpx;
|
||||
width: 100%;
|
||||
border-radius: 5rpx;
|
||||
margin: 20rpx auto;
|
||||
box-shadow:0px 0px 15rpx #e2e2e2;
|
||||
padding:30rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.c1{
|
||||
font-size: 35rpx;
|
||||
color: #666;
|
||||
}
|
||||
.c2{
|
||||
font-size: 35rpx;
|
||||
color: #333;
|
||||
}
|
||||
.title{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
font-size: 35rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 20rpx auto;
|
||||
}
|
||||
.itemWrap{
|
||||
height: 200rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.item2{
|
||||
height: 80rpx;
|
||||
width: 30%;
|
||||
background: rgba(242,242,242);
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #333;
|
||||
font-size: 35rpx;
|
||||
}
|
||||
.active{
|
||||
height: 80rpx;
|
||||
width: 30%;
|
||||
background: rgba(227,239,255);
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid rgba(0,110,255);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: rgba(0,110,255);
|
||||
font-size: 35rpx;
|
||||
}
|
||||
.sr{
|
||||
border: 0;
|
||||
text-align: center;
|
||||
}
|
||||
.placeholder{
|
||||
color: #333;
|
||||
font-size: 35rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.title2{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
font-size: 35rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 auto;
|
||||
color: rgba(0,110,255);
|
||||
text-align: right;
|
||||
}
|
||||
.btn{
|
||||
height: 100rpx;
|
||||
margin-top: 50rpx;
|
||||
width: 100%;
|
||||
background: rgba(0,110,255);
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 100rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 35rpx;
|
||||
letter-spacing: 5rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user