Commit f43e7d92 authored by 李智书's avatar 李智书

1.收费项目;

parent 7cd5b6b1
...@@ -99,12 +99,12 @@ function postRequest(params, data = {}) { ...@@ -99,12 +99,12 @@ function postRequest(params, data = {}) {
} }
//token //token
let token = uni.getStorageSync("token") let personalInfo = uni.getStorageSync("personalInfo");
//用户id
// let userId = uni.getStorageSync("userId")
// data.userId = data.userId || userId;
params.header = { params.header = {
"token": token || "" seesionID: personalInfo.seesionID || '',
sessionid: personalInfo.seesionID || '',
token: personalInfo.seesionID || '',
wechattype: 1
}; };
params.method = "POST"; params.method = "POST";
params.dataType = "JSON" params.dataType = "JSON"
...@@ -124,24 +124,6 @@ function postRequest(params, data = {}) { ...@@ -124,24 +124,6 @@ function postRequest(params, data = {}) {
reslt.data = reslt.data reslt.data = reslt.data
//TODO handle the exception //TODO handle the exception
} }
if (reslt.data.code != 200) {
//token失效或者错误
if (reslt.data.code == 401) {
uni.showToast({
icon: "none",
title: reslt.data.message,
duration: 3000
})
setTimeout(function() {
//401跳转登录
uni.redirectTo({
url: "/pages/index/index"
})
uni.clearStorage()
}, 1000);
reject(reslt.data.message)
}
}
uni.hideLoading(); uni.hideLoading();
resolve(reslt.data) resolve(reslt.data)
}).catch(e => { }).catch(e => {
...@@ -171,12 +153,12 @@ function getRequest(params, data) { ...@@ -171,12 +153,12 @@ function getRequest(params, data) {
}); });
try { try {
//token //token
let token = uni.getStorageSync("token") let personalInfo = uni.getStorageSync("personalInfo");
//用户id
let userId = uni.getStorageSync("userId")
data.userId = data.userId || userId;
params.header = { params.header = {
"token": token || "" seesionID: personalInfo.seesionID || '',
sessionid: personalInfo.seesionID || '',
token: personalInfo.seesionID || '',
wechattype: 1
}; };
params.method = "GET"; params.method = "GET";
params.dataType = "JSON" params.dataType = "JSON"
...@@ -196,30 +178,6 @@ function getRequest(params, data) { ...@@ -196,30 +178,6 @@ function getRequest(params, data) {
reslt.data = reslt.data reslt.data = reslt.data
//TODO handle the exception //TODO handle the exception
} }
if (reslt.data.code != 200) {
//token失效或者错误
if (reslt.data.code == 401) {
uni.showToast({
icon: "none",
title: reslt.data.message,
duration: 3000
})
uni.hideLoading();
//401跳转登录
uni.redirectTo({
url: "/pages/index/index"
})
reject(reslt.data.message)
}
uni.showToast({
icon: "none",
title: reslt.data.message,
duration: 3000
})
uni.hideLoading();
reject(reslt.data.message)
}
console.log(reslt);
uni.hideLoading(); uni.hideLoading();
resolve(reslt.data) resolve(reslt.data)
}).catch(e => { }).catch(e => {
......
...@@ -24,6 +24,52 @@ Vue.prototype.$ImgUrl = 'https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static ...@@ -24,6 +24,52 @@ Vue.prototype.$ImgUrl = 'https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static
import Vant from 'vant'; import Vant from 'vant';
Vue.use(Vant); Vue.use(Vant);
let ua = navigator.userAgent.toLocaleString();
if (ua.match("/MicroMessenger/i") == "micromessenger") {
console.log("微信浏览器环境");
Vue.prototype.env = "wx"
} else {
console.log("普通览器环境");
Vue.prototype.env = "h5"
}
// JSSDK授权
async function JssdkAuth() {
try {
let [err, res] = await uni.request({
url: "https://pay.xiaopay.net/mp_wechat/svmpwechat/GetWechatJSSDKConfig",
method: "POST",
data: {
"mp_session_id": uni.getStorageSync("personalInfo").seesionID,
"url": encodeURIComponent(window.location.href.split("#")[0]),
}
})
console.log(err, res);
} catch (e) {
//TODO handle the exception
//TODO handle the exception
console.log(e);
uni.showToast({
icon: "none",
mask: true,
title: e.message
})
}
}
// WeixinJSBridge内置对象在其他浏览器中无效。
setTimeout(function() {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
Vue.prototype.JSBridge = false
} else if (document.attachEvent) {
Vue.prototype.JSBridge = false
}
} else {
Vue.prototype.JSBridge = true
}
}, 1000)
// echarts图标 // echarts图标
var echarts = require('echarts') var echarts = require('echarts')
......
{ {
"name" : "xzf_uniapp-wechat-web", "name": "xzf_uniapp-wechat-web",
"appid" : "__UNI__6500A3F", "appid": "__UNI__6500A3F",
"description" : "", "description": "",
"versionName" : "1.0.0", "versionName": "1.0.0",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus": {
"usingComponents" : true, "usingComponents": true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler": "uni-app",
"compilerVersion" : 3, "compilerVersion": 3,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
}, },
/* 模块配置 */ /* 模块配置 */
"modules" : {}, "modules": {},
/* 应用发布信息 */ /* 应用发布信息 */
"distribute" : { "distribute": {
/* android打包配置 */ /* android打包配置 */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios" : {}, "ios": {},
/* SDK配置 */ /* SDK配置 */
"sdkConfigs" : {} "sdkConfigs": {}
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : true "enable": true
} }
}, },
/* 快应用特有相关 */ /* 快应用特有相关 */
"quickapp" : {}, "quickapp": {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin": {
"appid" : "", "appid": "",
"setting" : { "setting": {
"urlCheck" : false "urlCheck": false
}, },
"usingComponents" : true, "usingComponents": true,
"uniStatistics" : { "uniStatistics": {
"enable" : true "enable": true
} }
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true, "usingComponents": true,
"uniStatistics" : { "uniStatistics": {
"enable" : true "enable": true
} }
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true, "usingComponents": true,
"uniStatistics" : { "uniStatistics": {
"enable" : true "enable": true
} }
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true, "usingComponents": true,
"uniStatistics" : { "uniStatistics": {
"enable" : true "enable": true
} }
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : true "enable": true
}, },
"h5" : { "h5": {
"devServer" : { "devServer": {
"port" : 80, "port": 80,
"disableHostCheck" : true, "disableHostCheck": true,
"proxy" : { "proxy": {
"/api" : { "/": {
"target" : "https://uat.xiaopay.net", "target": "https://dev-az-order-api.xiaopay.net",
"changeOrigin" : true, "changeOrigin": true,
"secure" : false, "secure": false
"pathRewrite" : { }
"^/api" : "/" }
} },
} "router": {
} "mode": "hash",
}, "base": "./"
"router" : { },
"mode" : "hash", "title": "电子校园卡",
"base" : "./" "optimization": {
}, "treeShaking": {
"title" : "电子校园卡", "enable": false
"optimization" : { }
"treeShaking" : { },
"enable" : false "uniStatistics": {
} "enable": true
}, },
"uniStatistics" : { "template": "template.h5.html"
"enable" : true },
}, "mp-qq": {
"template" : "template.h5.html" "uniStatistics": {
}, "enable": true
"mp-qq" : { }
"uniStatistics" : { }
"enable" : true
}
}
} }
...@@ -335,8 +335,9 @@ ...@@ -335,8 +335,9 @@
}, { }, {
"path": "pages/StudentPayment/PayOrderDetails/PayOrderDetails", "path": "pages/StudentPayment/PayOrderDetails/PayOrderDetails",
"style": { "style": {
"navigationStyle": "custom",
"navigationBarTitleText": "交费订单明细", "navigationBarTitleText": "交费订单明细",
"navigationBarTextStyle":"white",
"navigationBarBackgroundColor":"#01CB88",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
......
...@@ -20,25 +20,24 @@ ...@@ -20,25 +20,24 @@
<view class="headerImg"> <view class="headerImg">
<view class="cardInfo"> <view class="cardInfo">
<view class="title"> <view class="title">
2022高一春季开学费用 {{ChargeProDetail.chargeName||""}}
</view> </view>
<view class="title2"> <view class="title2">
该收费项目主要收取学校的开学学费,根据需要自行选择 {{ChargeProDetail.descInfo||""}}
及备注。
</view> </view>
<van-divider style="margin-top: 50rpx;" /> <van-divider />
<view class="botto"> <view class="botto">
<view class="rowInfo"> <view class="rowInfo">
<text class="name">学生姓名:</text> <text class="name">学生姓名:</text>
<text class="value">张三</text> <text class="value">{{ChargeProDetail.userName||""}}</text>
</view> </view>
<view class="rowInfo"> <view class="rowInfo">
<text class="name">年级班级:</text> <text class="name">年级班级:</text>
<text class="value">三年级 101</text> <text class="value">{{ChargeProDetail.userGrade||""}} {{ChargeProDetail.userClass||""}}</text>
</view> </view>
<view class="rowInfo"> <view class="rowInfo">
<text class="name">订单编号:</text> <text class="name">订单编号:</text>
<text class="value">2022022800001</text> <text class="value">{{ChargeProDetail.tradeId||""}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -58,21 +57,21 @@ ...@@ -58,21 +57,21 @@
</view> </view>
<!-- Project --> <!-- Project -->
<view class="ProjectBox"> <view class="ProjectBox">
<view class="ProjectItem" v-for="(item,index) in PayProjectList" :key="index" <view class="ProjectItem" v-for="(item,index) in ChargeProDetail.items" :key="index"
:class="selectPayProject == index?'selectProjectItem':''"> :class="SPayProject(index)?'selectProjectItem':''">
<view class="tabNames" @click="selectProject(index)"> <view class="tabNames" @click="selectProject(item,index)">
<view class="ProjectName"> <view class="ProjectName">
<image v-if="selectPayProject==index" style="width: 32rpx;height: 32rpx;" <image v-if="SPayProject(index)" style="width: 32rpx;height: 32rpx;"
:src="ImgUrl+'StudentPayment/gx.png'" mode='widthFix'></image> :src="ImgUrl+'StudentPayment/gx.png'" mode='widthFix'></image>
<image v-else style="width: 32rpx;height: 32rpx;" :src="ImgUrl+'StudentPayment/wgx.png'" <image v-else style="width: 32rpx;height: 32rpx;" :src="ImgUrl+'StudentPayment/wgx.png'"
mode='widthFix'></image> mode='widthFix'></image>
<text>{{item.name}}</text> <text>{{item.itemName}}</text>
</view> </view>
<view class="ProjectType"> <view class="ProjectType">
{{item.type}} {{['选缴项目','必缴项目'][item.mustFlag]}}
</view> </view>
<view class="money"> <view class="money">
{{item.money}} {{itemAmount(item.itemAmount)}}
</view> </view>
</view> </view>
</view> </view>
...@@ -82,10 +81,10 @@ ...@@ -82,10 +81,10 @@
<!-- 备注 --> <!-- 备注 -->
<view class="remarks"> <view class="remarks">
<text class="remarksTxt"> <text class="remarksTxt">
备注 {{remarksType[ChargeProDetail.notesType-1]}}
</text> </text>
<textarea value="" placeholder="请输入身份证号" :cursor="10" placeholder-class="remarksTextarea" :maxlength="40" <textarea :placeholder="ChargeProDetail.notesTips" :cursor="10" placeholder-class="remarksTextarea"
:auto-height="true" /> :maxlength="40" :auto-height="true" v-model="remarks" />
</view> </view>
<!-- 底部操作按钮 --> <!-- 底部操作按钮 -->
<view class="bottomOper"> <view class="bottomOper">
...@@ -111,42 +110,129 @@ ...@@ -111,42 +110,129 @@
</template> </template>
<script> <script>
/**
* 对象转拼接字符串
* @param {*} res Object 需要转换的数据对象
*/
function OforS(res) {
var resL = 0;
var outS = "";
for (var i in res) {
if (resL == 0) {
outS += "" + i + "=" + res[i];
} else {
outS += "&" + i + "=" + res[i];
}
resL++;
}
return outS;
}
export default { export default {
name: "PayOrderDetails", name: "PayOrderDetails",
data() { data() {
return { return {
ImgUrl: this.$ImgUrl, ImgUrl: this.$ImgUrl,
PayProjectList: [{ payMoney: "0.00",
name: "春季开学费用", // 选择收费子项目
type: "必缴项目", selectPayProject: [],
money: "10.00" // 选择收费子项目
}, { selectPayProjectObj: {},
name: "高一春季开...", selectCount: 0,
type: "选缴项目",
money: "100.00"
}, {
name: "高一春季开...",
type: "选缴项目",
money: "1.00"
}],
payMoney: "100.00",
selectPayProject: 0,
dialogShow: false, dialogShow: false,
PaymentRsults: 1 PaymentRsults: 1,
allData: {},
// 交费项目详情信息
ChargeProDetail: {},
// 备注信息
remarks: "",
remarksType: ["备注", "邮箱", "手机号码", "身份证"],
// 费用id
chargeItemIds: []
} }
}, },
onLoad: function(options) { onLoad: function(options) {
let this_ = this; let this_ = this;
uni.showLoading({ let personalInfo = uni.getStorageSync("personalInfo")
mask: true, this.allData = Object.assign(options, personalInfo)
title: "查询支付结果" if (options.PayResult) {
}) uni.showLoading({
setTimeout(function() { mask: true,
uni.hideLoading() title: "查询支付结果"
this_.dialogShow = true })
}, 1000) setTimeout(function() {
uni.hideLoading()
this_.getPayParams(uni.getStorageSync("prepayId"))
}, 1000)
} else {
this.queryChargeProDetail()
}
},
onShow: function() {
// uni.showLoading({
// mask: true,
// title: "查询支付结果"
// })
// setTimeout(function() {
// uni.hideLoading()
// this_.dialogShow = true
// }, 1000)
},
computed: {
itemAmount() {
return function(Amount) {
if (Amount) {
return (Amount / 100).toFixed(2)
} else {
return ""
}
}
},
SPayProject() {
return function(index) {
if (index == 0 || index > 0) {
return this.selectPayProject.includes(index)
} else {
return false
}
}
}
}, },
methods: { methods: {
// 查询交费订单明细信息
async queryChargeProDetail() {
try {
let data = await this.$http.post({
url: '/order-charge/app/charge/project/queryChargeProDetail'
}, {
"chargeId": this.allData.chargeId,
"schoolId": this.allData.schoolId,
"userId": this.allData.userId
})
if (data.code != 200 || !data.data) {
uni.showToast({
icon: "none",
mask: true,
title: data.msg
})
return
}
this.ChargeProDetail = data.data;
// 收费类型必缴项目默认选择
for (let i = 0; i < data.data.items.length; i++) {
if (data.data.items[i].mustFlag == 1) {
this.selectProject(data.data.items[i], i)
}
}
} catch (e) {
//TODO handle the exception
console.log(e);
uni.showToast({
icon: "none",
mask: true,
title: e.message
})
}
},
// 支付结果页面关闭 // 支付结果页面关闭
async dialogClosed() { async dialogClosed() {
try { try {
...@@ -158,43 +244,192 @@ ...@@ -158,43 +244,192 @@
} }
}, },
// 选择支付的项目 // 选择支付的项目
async selectProject(index) { async selectProject(data, index) {
try { try {
console.log(index) if (!this.selectPayProject.includes(index)) {
this.selectPayProject = index this.selectPayProject.push(index)
return this.selectPayProjectObj[index + ''] = data
if (!this.selectPayProject[index + '']) {
this.selectPayProject[index + ''] = index
} else { } else {
this.selectPayProject[index + ''] = '' let indexOf = this.selectPayProject.indexOf(index)
this.selectPayProject.splice(indexOf, 1)
delete this.selectPayProjectObj[index + '']
}
// 计算金额
let payMoney = 0,
// 选择的项目数
selectCount = 0,
// 费用id
chargeItemIds = [];
for (let key in this.selectPayProjectObj) {
selectCount++
payMoney += this.selectPayProjectObj[key].itemAmount;
chargeItemIds.push(this.selectPayProjectObj[key].id)
}
this.selectCount = selectCount;
this.payMoney = (payMoney / 100).toFixed(2);
this.chargeItemIds = chargeItemIds;
} catch (e) {
//TODO handle the exception
console.log(e);
}
},
// 微信公众号H5支付
async getBrandWCPayRequest() {
try {
if (this.JSBridge) {
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId": "wx2421b1c4370ec43b", //公众号ID,由商户传入
"timeStamp": "1395712654", //时间戳,自1970年以来的秒数
"nonceStr": "e61463f8efa94090b1f366cccfbbb444", //随机串
"package": "prepay_id=u802345jgfjsdfgsdg888",
"signType": "MD5", //微信签名方式:
"paySign": "70EA570631E4BB79628FBCA90534C63FF7FADD89" //微信签名
},
function(res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
} else {
uni.showToast({
icon: "none",
mask: true,
title: "支付异常"
})
}
});
return
} }
console.log(this.selectPayProject); uni.showToast({
icon: "none",
mask: true,
title: "支付环境异常"
})
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
uni.showToast({
icon: "none",
mask: true,
title: e.message
})
} }
}, },
// 点击缴费 // 点击缴费下单接口
async clickPay() { async clickPay() {
try { try {
console.log("clickPay", "点击缴费"); console.log(this.JSBridge);
this.dialogClosed() if (this.selectCount == 0) {
uni.showLoading({ uni.showToast({
icon: "none",
mask: true,
title: "请选择缴费项目"
})
return
}
if (this.ChargeProDetail.notesFlag == 1) {
if (!this.remarks) {
uni.showToast({
icon: "none",
mask: true,
title: "请填写备注信息"
})
return
}
}
let data = await this.$http.post({
url: '/order-charge/app/charge/project/createOrder'
}, {
amount: this.selectCount * 100, // 金额 false
chargeItemIds: this.chargeItemIds.join(","), // 交费用项id集合多个交费项之间使用逗号分隔 false
mchId: this.ChargeProDetail.mchid, // 微信商户号 false
openId: this.allData.openId, // 用户标识 false
payPeopleType: 1, // 交费人类型1家长、2教师、3运营人员 false
payway: 1, // 交费方式1.小程序交费、2.现金交费 false
tradeId: this.ChargeProDetail.tradeId, // 订单号 false
userName: this.ChargeProDetail.userName, // 用户姓名 false
remark: this.remarks || '', // 备注 false
wechatChannel: 1, //微信交费渠道1.小程序交费 2.微信公众号交费
chargeId: this.allData.chargeId,
schoolId: this.allData.schoolId,
userId: this.allData.userId
})
if (data.code != 200) {
uni.showToast({
icon: "none",
mask: true,
title: data.msg || "缴费下单失败"
})
return
}
// 获取支付参数
await this.getPayParams(data.data)
uni.setStorageSync("prepayId", data.data)
} catch (e) {
//TODO handle the exception
console.log(e);
uni.showToast({
icon: "none",
mask: true, mask: true,
title: "缴费中..." title: e.message
}) })
await new Promise((res, rjt) => { }
setTimeout(function() { },
res() // 获取支付参数
}, 3000) async getPayParams(prepayId) {
try {
let data = await this.$http.get({
url: '/order-charge/app/charge/project/getPayParams'
}, {
prepayId
}) })
this.PaymentRsults = 2 if (data.data.code != 200 || !data.data.data) {
this.dialogShow = true uni.showToast({
uni.hideLoading() icon: "none",
mask: true,
title: data.data.msg || "获取支付参数失败"
})
return
}
console.warn(`/pages/WxPay/main?` + OforS(data.data))
jWeixin.miniProgram.switchTab({
url: `/pages/WxPay/main?` + OforS(data.data),
});
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
uni.showToast({
icon: "none",
mask: true,
title: e.message
})
}
},
// 返回支付结果
async returnPaymentResult(tradeId) {
try {
let data = await this.$http.get({
url: '/order-charge/app/charge/project/returnPaymentResult'
}, {
tradeId
})
if (data.data.code != 200 || !data.data.data) {
uni.showToast({
icon: "none",
mask: true,
title: data.data.msg || "返回支付结果失败"
})
return
}
this_.dialogShow = true
} catch (e) {
//TODO handle the exception
console.log(e);
uni.showToast({
icon: "none",
mask: true,
title: e.message
})
} }
} }
} }
...@@ -241,7 +476,7 @@ ...@@ -241,7 +476,7 @@
.PayProject { .PayProject {
height: 460rpx; height: 460rpx;
margin-top: 192rpx; margin-top: 20rpx;
.ProjectBox { .ProjectBox {
height: 350rpx; height: 350rpx;
...@@ -296,6 +531,7 @@ ...@@ -296,6 +531,7 @@
} }
.ProjectType { .ProjectType {
width: 120rpx;
margin-left: 40rpx; margin-left: 40rpx;
} }
...@@ -339,6 +575,7 @@ ...@@ -339,6 +575,7 @@
textarea { textarea {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-left: 30rpx;
} }
.remarksTxt { .remarksTxt {
...@@ -383,7 +620,7 @@ ...@@ -383,7 +620,7 @@
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #CCCCCC; color: #CCCCCC;
padding-left: 30rpx; // padding-left: 30rpx;
} }
} }
...@@ -485,18 +722,19 @@ ...@@ -485,18 +722,19 @@
border-radius: 16rpx; border-radius: 16rpx;
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
top: 206rpx; top: 37rpx;
overflow: hidden; overflow: hidden;
font-family: PingFang SC; font-family: PingFang SC;
.title { .title {
width: 370rpx; width: 370rpx;
height: 34rpx; // height: 34rpx;
font-size: 36rpx; font-size: 36rpx;
font-weight: 800; font-weight: 800;
color: #333333; color: #333333;
margin: 0 auto; margin: 0 auto;
margin-top: 52rpx; margin-top: 60rpx;
text-align: center;
} }
.title2 { .title2 {
......
...@@ -11,20 +11,19 @@ ...@@ -11,20 +11,19 @@
@tap="PayOrderDetails(item)"> @tap="PayOrderDetails(item)">
<view class="listitem top"> <view class="listitem top">
<view class="title"> <view class="title">
2022高一春季收费 {{item.chargeName}}
</view> </view>
<view class="money"> <view class="money">
100.00 {{item.amountMust}}
</view> </view>
</view> </view>
<view class="listitem center"> <view class="listitem center">
<text class="describe"> <text class="describe">
本次收费需要收取高一春季开学相关费用,并根据 {{item.descInfo}}
备注输入相关信息。
</text> </text>
</view> </view>
<view class="listitem botto" style="align-items: baseline;"> <view class="listitem botto" style="align-items: baseline;">
<van-icon name="clock-o" /> <text class="Tips">5天后收费结束</text> <van-icon name="clock-o" /> <text class="Tips">{{item.diffTime}} 天后收费结束</text>
</view> </view>
</view> </view>
<view class="bottomtxt">已经到底啦~</view> <view class="bottomtxt">已经到底啦~</view>
...@@ -77,6 +76,8 @@ ...@@ -77,6 +76,8 @@
</template> </template>
<script> <script>
// 时间处理模块
import dayjs from 'dayjs'
export default { export default {
name: "PayProject", name: "PayProject",
data() { data() {
...@@ -84,12 +85,29 @@ ...@@ -84,12 +85,29 @@
ImgUrl: this.$ImgUrl, ImgUrl: this.$ImgUrl,
active: 0, active: 0,
vanTab: ['收费项目', '交费历史'], vanTab: ['收费项目', '交费历史'],
PayProjectList: [1, 2, 3], PayProjectList: [1, 2, 3, 4, 5],
PayProjectHistory: [1, 2, 3] PayProjectHistory: [],
pageCurrent: 1,
pageSize: 10,
total: 0,
allData: {}
} }
}, },
onLoad: function(options) { onLoad: function(options) {
console.log("PayProject"); console.log("PayProject", options);
if (options.seesionID && options.userID && options.schoolId) {
uni.setStorageSync("personalInfo", {
userId: options.userID || '',
seesionID: options.seesionID || '',
schoolId: options.schoolId || '',
openId: options.openId
})
this.allData = options
} else {
let personalInfo = uni.getStorageSync("personalInfo")
this.allData = Object.assign(options, personalInfo)
}
this.getPayProject()
}, },
onPullDownRefresh: function(e) { onPullDownRefresh: function(e) {
console.log("onPullDownRefresh", e); console.log("onPullDownRefresh", e);
...@@ -102,19 +120,57 @@ ...@@ -102,19 +120,57 @@
// 切换tab // 切换tab
async PayProjectTab(index) { async PayProjectTab(index) {
try { try {
console.log(index); if (index > 0) {
return
}
this.getPayProject(index)
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
} }
}, },
// 获取收费项目 // 交费项目信息分页查询
async getPayProject(index) { async getPayProject(index) {
try { try {
console.log(index); let data = await this.$http.post({
url: '/order-charge/app/charge/project/queryChargeProjectPage'
}, {
"pageCurrent": this.pageCurrent,
"pageSize": this.pageSize,
"schoolId": this.allData.schoolId,
"userId": this.allData.userId || this.allData.userID
})
if (data.code != 200) {
uni.showToast({
icon: "none",
mask: true,
title: data.msg
})
this.PayProjectList = []
return
}
if (data.data.records && Array.isArray(data.data.records)) {
let tmp = data.data.records;
let newArr = []
for (let s of tmp) {
let diffTime = dayjs().diff(s.endTime, 'day');
s.diffTime = Math.abs(diffTime)
s.amountMust = s.amountMust.toFixed(2)
newArr.push(s)
}
this.PayProjectList = newArr
} else {
this.PayProjectList = []
}
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
uni.showToast({
icon: "none",
mask: true,
title: e.message
})
} }
}, },
// 收费项目详情 // 收费项目详情
...@@ -123,7 +179,7 @@ ...@@ -123,7 +179,7 @@
console.log(data); console.log(data);
uni.setStorageSync("PayOrderDetails", data) uni.setStorageSync("PayOrderDetails", data)
uni.navigateTo({ uni.navigateTo({
url: "../PayOrderDetails/PayOrderDetails" url: "../PayOrderDetails/PayOrderDetails?chargeId=" + data.id || ''
}) })
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
...@@ -172,6 +228,7 @@ ...@@ -172,6 +228,7 @@
.top { .top {
.title { .title {
width: 266rpx;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment