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
} }
......
...@@ -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