Commit 7cd5b6b1 authored by 李智书's avatar 李智书

1.校智付缴费项目

parent da4835b5
let baseUrl = window.location.origin //稳定版本环境
const baseUrl = 'https://szcf.superbest.wang/API' //稳定版本环境
let UrlReg = /^http:\/\/.*/i let UrlReg = /^http:\/\/.*/i
let UrlReg2 = /^https:\/\/.*/i let UrlReg2 = /^https:\/\/.*/i
if (process.env.NODE_ENV === 'development') {
console.log('开发环境');
// baseUrl = 'https://dev-az-order-api.xiaopay.net/insure-order';
} else {
// baseUrl = 'https://dev-az-order-api.xiaopay.net/insure-orders';
}
function uploadFile(params) { function uploadFile(params) {
var _this = this, var _this = this,
...@@ -52,7 +57,8 @@ function downloadFile(params) { ...@@ -52,7 +57,8 @@ function downloadFile(params) {
function request(params, data) { function request(params, data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: (UrlReg.test(params.url) || UrlReg2.test(params.url)) ? params.url : baseUrl + params.url, url: (UrlReg.test(params.url) || UrlReg2.test(params.url)) ? params.url : baseUrl + params
.url,
method: params.method, method: params.method,
dataType: params.dataType, dataType: params.dataType,
data, data,
...@@ -86,17 +92,17 @@ function postRequest(params, data = {}) { ...@@ -86,17 +92,17 @@ function postRequest(params, data = {}) {
try { try {
//登录错误提示 //登录错误提示
let duration; let duration;
if(params.url == '/user/login/pwd'){ if (params.url == '/user/login/pwd') {
duration = 20000 duration = 20000
}else{ } else {
duration = 3000 duration = 3000
} }
//token //token
let token = uni.getStorageSync("token") let token = uni.getStorageSync("token")
//用户id //用户id
let userId = uni.getStorageSync("userId") // let userId = uni.getStorageSync("userId")
data.userId = data.userId || userId; // data.userId = data.userId || userId;
params.header = { params.header = {
"token": token || "" "token": token || ""
}; };
...@@ -119,33 +125,23 @@ function postRequest(params, data = {}) { ...@@ -119,33 +125,23 @@ function postRequest(params, data = {}) {
//TODO handle the exception //TODO handle the exception
} }
if (reslt.data.code != 200) { if (reslt.data.code != 200) {
//token失效或者错误 ----401 //token失效或者错误
//账号已在其他地方登录! -----1006 if (reslt.data.code == 401) {
if (reslt.data.code == 401 || reslt.data.code == 1006) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: reslt.data.message, title: reslt.data.message,
duration duration: 3000
}) })
uni.hideLoading(); setTimeout(function() {
//401跳转登录 //401跳转登录
uni.redirectTo({ uni.redirectTo({
// url: "/pages/notecheck/notecheck?phone=13428967050", url: "/pages/index/index"
// url: "/pages/notecheck/notecheck",
url: "/pages/login/login"
}) })
uni.clearStorage()
}, 1000);
reject(reslt.data.message) reject(reslt.data.message)
} }
uni.showToast({
icon: "none",
title: reslt.data.message,
duration
})
uni.hideLoading();
reject(reslt.data.message)
} }
console.log(reslt);
uni.hideLoading(); uni.hideLoading();
resolve(reslt.data) resolve(reslt.data)
}).catch(e => { }).catch(e => {
...@@ -188,7 +184,7 @@ function getRequest(params, data) { ...@@ -188,7 +184,7 @@ function getRequest(params, data) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "url不能为空", title: "url不能为空",
duration:3000 duration: 3000
}) })
uni.hideLoading(); uni.hideLoading();
reject("url不能为空") reject("url不能为空")
...@@ -206,21 +202,19 @@ function getRequest(params, data) { ...@@ -206,21 +202,19 @@ function getRequest(params, data) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: reslt.data.message, title: reslt.data.message,
duration:3000 duration: 3000
}) })
uni.hideLoading(); uni.hideLoading();
//401跳转登录 //401跳转登录
uni.redirectTo({ uni.redirectTo({
// url: "/pages/notecheck/notecheck?phone=13428967050", url: "/pages/index/index"
// url: "/pages/notecheck/notecheck",
url: "/pages/login/login"
}) })
reject(reslt.data.message) reject(reslt.data.message)
} }
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: reslt.data.message, title: reslt.data.message,
duration:3000 duration: 3000
}) })
uni.hideLoading(); uni.hideLoading();
reject(reslt.data.message) reject(reslt.data.message)
...@@ -260,7 +254,7 @@ async function Login(params, data) { ...@@ -260,7 +254,7 @@ async function Login(params, data) {
await uni.showToast({ await uni.showToast({
icon: "none", icon: "none",
title: "url不能为空", title: "url不能为空",
duration:3000 duration: 3000
}) })
await uni.hideLoading(); await uni.hideLoading();
throw Error("url不能为空") throw Error("url不能为空")
...@@ -278,16 +272,16 @@ async function Login(params, data) { ...@@ -278,16 +272,16 @@ async function Login(params, data) {
await uni.showToast({ await uni.showToast({
icon: "none", icon: "none",
title: JSON.stringify(err), title: JSON.stringify(err),
duration:3000 duration: 3000
}) })
await uni.hideLoading(); await uni.hideLoading();
throw Error(JSON.stringify(err)) throw Error(JSON.stringify(err))
} }
if (reslt.data.code != 200) { if (reslt.data.code != 1000) {
await uni.showToast({ await uni.showToast({
icon: "none", icon: "none",
title: reslt.data.message, title: reslt.data.message,
duration:3000 duration: 3000
}) })
await uni.hideLoading(); await uni.hideLoading();
throw Error(reslt.data.message) throw Error(reslt.data.message)
...@@ -310,7 +304,7 @@ async function Login(params, data) { ...@@ -310,7 +304,7 @@ async function Login(params, data) {
await uni.showToast({ await uni.showToast({
icon: "none", icon: "none",
title: JSON.stringify(LoginErr), title: JSON.stringify(LoginErr),
duration:3000 duration: 3000
}) })
await uni.hideLoading(); await uni.hideLoading();
throw Error(JSON.stringify(LoginErr)) throw Error(JSON.stringify(LoginErr))
...@@ -319,7 +313,7 @@ async function Login(params, data) { ...@@ -319,7 +313,7 @@ async function Login(params, data) {
await uni.showToast({ await uni.showToast({
icon: "none", icon: "none",
title: LoginInfo.data.message, title: LoginInfo.data.message,
duration:3000 duration: 3000
}) })
await uni.hideLoading(); await uni.hideLoading();
throw Error(LoginInfo.data.message) throw Error(LoginInfo.data.message)
......
...@@ -292,36 +292,54 @@ ...@@ -292,36 +292,54 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/pdfPreview/pdfPreview",
"path" : "pages/pdfPreview/pdfPreview", "style": {
"style" :
{
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/OpenAccountAgreementBOC/OpenAccountAgreementBOC",
"path" : "pages/OpenAccountAgreementBOC/OpenAccountAgreementBOC", "style": {
"style" :
{
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "渤海银行线上个人银行Ⅱ、Ⅲ类账户服务协议", "navigationBarTitleText": "渤海银行线上个人银行Ⅱ、Ⅲ类账户服务协议",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/UserAgreement/UserAgreement",
"path" : "pages/UserAgreement/UserAgreement", "style": {
"style" :
{
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "消费用户协议", "navigationBarTitleText": "消费用户协议",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "pages/StudentPayment/StudentPayment",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "日常收费",
"enablePullDownRefresh": false
}
}, {
"path": "pages/StudentPayment/PayProject/PayProject",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "日常收费",
"enablePullDownRefresh": false
}
}, {
"path": "pages/StudentPayment/PayOrderDetails/PayOrderDetails",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "交费订单明细",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {
......
This diff is collapsed.
<template>
<view class="tainer">
<van-tabs ref="tabs" title-inactive-color="#999999" title-active-color="#333333" sticky animated
v-model:active="active" swipeable color="#01CB88" background="#FFFFFF" line-width="30px" line-height="4px"
@change="PayProjectTab">
<van-tab :title="vanTab[0]" title-class="PayProjectTab PayProjectList">
<!-- 收费项目 -->
<view class="ListBox">
<view class="" v-if="PayProjectList.length>0">
<view class="container ProjectList" v-for="(item,index) in PayProjectList" :key="index"
@tap="PayOrderDetails(item)">
<view class="listitem top">
<view class="title">
2022高一春季收费
</view>
<view class="money">
100.00
</view>
</view>
<view class="listitem center">
<text class="describe">
本次收费需要收取高一春季开学相关费用,并根据
备注输入相关信息。
</text>
</view>
<view class="listitem botto" style="align-items: baseline;">
<van-icon name="clock-o" /> <text class="Tips">5天后收费结束</text>
</view>
</view>
<view class="bottomtxt">已经到底啦~</view>
</view>
<!-- 没有数据 -->
<view class="noData" v-else>
<image style="width: 301rpx;height: 258rpx;" :src="ImgUrl+'StudentPayment/NoRecord.png'"
mode='widthFix'></image>
<view>暂无收费项目</view>
</view>
</view>
</van-tab>
<van-tab :title="vanTab[1]" title-class="PayProjectTab PayProjectHistory">
<!-- 缴费历史 -->
<view class="ListBox">
<view class="" v-if="PayProjectHistory.length>0">
<view class="container ProjectHistory" v-for="(item,index) in PayProjectHistory" :key="index"
@tap="PayOrderDetails(item)">
<view class="listitem top">
<view class="title">
2022高一春季收费
</view>
<view class="money">
100.00
</view>
</view>
<view class="listitem center">
<text class="describe">
本次收费需要收取高一春季开学相关费用,并根据
备注输入相关信息。
</text>
</view>
<view class="listitem botto" style="align-items: baseline;">
<van-icon name="clock-o" /> <text class="Tips">5天后收费结束</text>
</view>
</view>
<view class="bottomtxt">已经到底啦~</view>
</view>
<!-- 没有数据 -->
<view class="noData" v-else>
<image style="width: 290rpx;height: 242rpx;" :src="ImgUrl+'StudentPayment/development.png'"
mode='widthFix'></image>
<view>程序员正在玩命开发</view>
<view class="bottomtxt">详情请联系客服</view>
</view>
</view>
</van-tab>
</van-tabs>
</view>
</template>
<script>
export default {
name: "PayProject",
data() {
return {
ImgUrl: this.$ImgUrl,
active: 0,
vanTab: ['收费项目', '交费历史'],
PayProjectList: [1, 2, 3],
PayProjectHistory: [1, 2, 3]
}
},
onLoad: function(options) {
console.log("PayProject");
},
onPullDownRefresh: function(e) {
console.log("onPullDownRefresh", e);
},
onReachBottom: function(e) {
console.log("onReachBottom", e);
this.PayProjectList.push(Array(7).fill(1))
},
methods: {
// 切换tab
async PayProjectTab(index) {
try {
console.log(index);
} catch (e) {
//TODO handle the exception
console.log(e);
}
},
// 获取收费项目
async getPayProject(index) {
try {
console.log(index);
} catch (e) {
//TODO handle the exception
console.log(e);
}
},
// 收费项目详情
async PayOrderDetails(data) {
try {
console.log(data);
uni.setStorageSync("PayOrderDetails", data)
uni.navigateTo({
url: "../PayOrderDetails/PayOrderDetails"
})
} catch (e) {
//TODO handle the exception
console.log(e);
}
}
}
}
</script>
<style lang="scss">
page {
background: #F3F5F6;
}
.noData {
text-align: center;
margin-top: 316rpx;
image {
position: relative;
}
}
.ListBox {
width: 750rpx;
min-height: 100%;
background: #F3F5F6;
padding-top: 12rpx;
padding-bottom: 100rpx;
.container {
width: 686rpx;
height: 250rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin: 0 auto;
margin-top: 20rpx;
}
.container {
font-family: PingFang SC;
.top {
.title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 36rpx;
padding-left: 31rpx;
padding-top: 30rpx;
}
.money {
font-size: 36rpx;
font-family: DIN;
font-weight: bold;
color: #01CB88;
line-height: 36rpx;
padding-left: 230rpx;
padding-top: 30rpx;
}
.money::before {
content: "¥";
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #01CB88;
}
}
.center {
.describe {
width: 614rpx;
height: 63rpx;
font-size: 28rpx;
font-weight: 500;
color: #666666;
line-height: 36rpx;
padding-top: 38rpx;
padding-left: 32rpx;
}
}
.botto {
padding-top: 30rpx;
padding-left: 32rpx;
font-size: 24rpx;
font-weight: 500;
color: #BABABA;
.Tips {
padding-left: 10rpx;
}
}
}
.ProjectHistory {}
.listitem {
display: flex;
align-items: center;
}
.bottomtxt {
height: 21rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
line-height: 90rpx;
text-align: center;
}
}
.van-tabs__content {
width: 100%;
height: 100%;
position: fixed;
left: 0;
z-index: 999;
overflow: scroll
}
.van-tabs {
.PayProjectTab {
height: 200rpx;
}
}
</style>
<template>
<view>
</view>
</template>
<script>
export default {
name: "StudentPayment",
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss">
</style>
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