From 1e86382124ae4aa1212c35781e2a5d9644d51fd8 Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Wed, 21 Aug 2024 00:48:19 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/http.interceptor.js | 4 +-
components/applyForm/index.vue | 34 ++--
.../next-indexed-xlist/next-indexed-xlist.vue | 4 +-
.../wanghexu-timeslot/wanghexu-timeslot.vue | 40 +++-
packages/apply/index.vue | 47 ++++-
packages/booksubmit/index.vue | 32 ++-
packages/mycourse/coursePay.vue | 22 +-
packages/mycourse/courseStatus.vue | 190 +++++++++++++-----
packages/mycourse/detail.vue | 40 +++-
packages/mycourse/index.vue | 2 +-
pages/book/index.vue | 5 +-
pages/course/index.vue | 60 +++++-
pages/me/index.vue | 90 +++++++--
13 files changed, 445 insertions(+), 125 deletions(-)
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index 8811158..f9fa231 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -90,7 +90,7 @@ const install = (Vue, vm) => {
uni.showToast({
icon: "none",
title: res.data.errmsg,
- duration: 1500
+ duration: 2000
})
}
return false;
@@ -102,7 +102,7 @@ const install = (Vue, vm) => {
uni.showToast({
icon: "none",
title: '' + res.statusCode,
- duration: 1500
+ duration: 2000
})
return false;
diff --git a/components/applyForm/index.vue b/components/applyForm/index.vue
index c389852..61738de 100644
--- a/components/applyForm/index.vue
+++ b/components/applyForm/index.vue
@@ -179,20 +179,24 @@
},
// 提交
submit() {
- console.log("course_forms", this.course_forms)
-
- // return
- this.$emit("backForm",this.course_forms)
- // this.$refs.submitForms.validate(valid => {
- // if (valid) {
- // console.log('验证通过');
- // // this.$emit("backForm", this.course_forms)
- // return
- // } else {
- // console.log('验证失败');
- // this.base.toast("验证失败")
- // }
- // });
+ console.log("course_forms", this.course_forms)
+ let errorCount = 0
+ this.course_forms.map(item=>{
+ if(item.rule){
+ if (item.rule.indexOf('required') !== -1) {
+ if(this.base.isNull(item.value)){
+ this.base.toast(`${item.name}不能为空`)
+ errorCount++
+ return
+ }
+ }
+ }
+ })
+ if(errorCount>0){
+ return
+ }else{
+ this.$emit("backForm",this.course_forms)
+ }
},
},
watch: {
@@ -214,7 +218,7 @@
if (item.rule.indexOf('required') !== -1) {
_rule[item.field].push({
required: true,
- message: `请输入${item.name}123`,
+ message: `请输入${item.name}`,
trigger: ['blur'],
})
}
diff --git a/components/next-indexed-xlist/components/next-indexed-xlist/next-indexed-xlist.vue b/components/next-indexed-xlist/components/next-indexed-xlist/next-indexed-xlist.vue
index 61de8b1..4d61423 100644
--- a/components/next-indexed-xlist/components/next-indexed-xlist/next-indexed-xlist.vue
+++ b/components/next-indexed-xlist/components/next-indexed-xlist/next-indexed-xlist.vue
@@ -34,7 +34,7 @@
{{mess['company_position']||''}}
-
+
diff --git a/components/wanghexu-timeslot/wanghexu-timeslot.vue b/components/wanghexu-timeslot/wanghexu-timeslot.vue
index d0f10e0..b439479 100644
--- a/components/wanghexu-timeslot/wanghexu-timeslot.vue
+++ b/components/wanghexu-timeslot/wanghexu-timeslot.vue
@@ -56,7 +56,19 @@ export default {
default: () => {
return "选择时间段";
}
- },
+ },
+ min:{
+ type: Number,
+ default: () => {
+ return 8;
+ }
+ },
+ max:{
+ type: Number,
+ default: () => {
+ return 18;
+ }
+ }
},
data() {
return {
@@ -64,19 +76,37 @@ export default {
isShow:false,//显示
typeList:["开始时间","结束时间"],
typeIndex:0,//下标
- startvalue:[14,0],//默认下标,14时 00分
- endvalue:[15,0],//默认下标,15时 00分
+ startvalue:[0,0],//默认下标,14时 00分
+ endvalue:[17,0],//默认下标,15时 00分
indicatorStyle: 'height: 50px;',
// timeList:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],
timeHour:[],
timeMin:[],//分钟可选项
};
- },
+ },
+ watch:{
+ min(val){
+ console.log("val",val)
+ if(val){
+ //获取时分
+ let timeHour = []
+ let timeMin = []
+ for (let i = this.min; i < this.max+1; i++) {
+ timeHour.push(this.formatNumber(i))
+ }
+ for (let i = 0; i < 60; i++) {
+ timeMin.push(this.formatNumber(i))
+ }
+ this.timeHour = timeHour
+ this.timeMin = timeMin
+ }
+ }
+ },
mounted() {
//获取时分
let timeHour = []
let timeMin = []
- for (let i = 0; i < 24; i++) {
+ for (let i = 8; i < 18; i++) {
timeHour.push(this.formatNumber(i))
}
for (let i = 0; i < 60; i++) {
diff --git a/packages/apply/index.vue b/packages/apply/index.vue
index 101e0b2..48cb149 100644
--- a/packages/apply/index.vue
+++ b/packages/apply/index.vue
@@ -53,7 +53,8 @@
course_id: '',
showPosition: false,
positionList: [],
- dateShow: false,
+ dateShow: false,
+ is_fee:0, //需不需要缴费这个课程
dateParams: {
year: true,
month: true,
@@ -162,7 +163,9 @@
})
if (res.course_forms && res.course_forms.length > 0) {
this.course_forms = res.course_forms
- }
+ }
+ this.is_fee = res.is_fee
+
},
backForm(e) {
console.log("e", e)
@@ -171,7 +174,7 @@
_arr.push({
name: item.name,
field: item.field,
- value: item.value
+ value: item.value?item.value:''
})
// 更新扩展字段
if(item.belong_user===1){
@@ -210,11 +213,41 @@
course_id: this.course_id,
data: this.apply_form
}).then(res => {
- this.base.toast("报名成功")
- uni.redirectTo({
- url: '/packages/mycourse/index'
- })
+ this.base.toast("报名成功")
+ if(this.is_fee){
+ this.newsSubscription()
+ }else{
+ uni.redirectTo({
+ url: '/packages/mycourse/index'
+ })
+ }
})
+ },
+ // 订阅缴费
+ newsSubscription() {
+ let that = this
+ uni.getSetting({
+ withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
+ success(res) {
+ if (res.authSetting['scope.subscribeMessage']) {
+ uni.redirectTo({
+ url: '/packages/mycourse/index'
+ })
+ } else {
+ // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
+ uni.requestSubscribeMessage({
+ tmplIds: ['6bkRNahvR88pG4Tpk0c2aY81kszvFpdaIV-CdC_ENTM'],
+ success(res) {
+ that.base.toast("订阅成功",1500,function(){
+ uni.redirectTo({
+ url: '/packages/mycourse/index'
+ })
+ })
+ }
+ })
+ }
+ }
+ });
},
}
}
diff --git a/packages/booksubmit/index.vue b/packages/booksubmit/index.vue
index ea94baf..aab23af 100644
--- a/packages/booksubmit/index.vue
+++ b/packages/booksubmit/index.vue
@@ -3,15 +3,16 @@
+
+
+
-
-
-
+
@@ -50,7 +51,9 @@
-
+
@@ -99,7 +102,9 @@
},
data() {
return {
- dateShow: false,
+ dateShow: false,
+ hMin:0,
+ hMax:24,
dateParams: {
year: true,
month: true,
@@ -193,7 +198,14 @@
console.log("e", e)
this.form.site = this.siteList[e[0]].id
this.form.siteName = this.siteList[e[0]].name
- this.siteTotal = this.siteList[e[0]].total
+ this.siteTotal = this.siteList[e[0]].total
+ if(this.siteList[e[0]].start_time){
+ let _arr = this.siteList[e[0]].start_time.split(":")
+ this.hMin = parseInt(_arr[0])
+ let _arr1 = this.siteList[e[0]].end_time.split(":")
+ this.hMax = parseInt(_arr1[0])
+ console.log(this.hMin,this.hMax)
+ }
},
plateChange(val,index) {
console.log(val,this.plateIndex)
@@ -275,10 +287,14 @@
if (valid) {
start_time = this.form.date + ' ' + this.form.start_time + ':00'
end_time = this.form.date + ' ' + this.form.end_time + ':00'
- this.form.accompany_total = this.form.accompany.length
- console.log("this.form", this.form)
+ this.form.accompany_total = this.form.accompany.length
+
let _plate = ''
if(this.plateList.length>0){
+ if(this.plateList.length>this.form.accompany_total+1){
+ this.base.toast("车辆数量已经大于预约人数了")
+ return
+ }
this.plateList.map(item=>{
_plate+=item.plate+','
})
diff --git a/packages/mycourse/coursePay.vue b/packages/mycourse/coursePay.vue
index ed59f6a..b6ff0a1 100644
--- a/packages/mycourse/coursePay.vue
+++ b/packages/mycourse/coursePay.vue
@@ -4,22 +4,27 @@
{{courseInfo.name}}
-
+
您已缴费成功。
-
-
+
+
+ 您上传的缴费图片有误,请重新上传。
+
+
+ 您已上传成功,请等待确认。
+
+
+
上传缴费图片:
上传
-
-
+
+
-
-
绑定车牌号
@@ -119,7 +124,8 @@
let files_id = [this.fileList.id]
this.$u.api.courseUpdateSign({
id:this.info.id,
- fee_file_ids:files_id
+ fee_file_ids:files_id,
+ fee_status:3
}).then(res=>{
this.base.toast("上传成功")
// 有缴费图片,证明不是第一次上传,不弹出车位绑定
diff --git a/packages/mycourse/courseStatus.vue b/packages/mycourse/courseStatus.vue
index 7c69fea..af031ad 100644
--- a/packages/mycourse/courseStatus.vue
+++ b/packages/mycourse/courseStatus.vue
@@ -2,28 +2,32 @@
-
-
-
- {{userInfo.username}}:
- 欢迎您报名{{courseInfo.name}},我们将在1-3个工作日内审核并通知您报名结果….
-
-
- {{userInfo.username}}:
- 您已被{{courseInfo.name}}录取!请于{{courseInfo.start_date}}到学院报到。
-
-
- {{userInfo.username}}:
- 很遗憾,您未被{{courseInfo.name}}录取!
-
-
- {{userInfo.username}}:
- 您未被{{courseInfo.name}}纳入备选人才!
-
-
-
-
+
+
+
+ {{userInfo.username}}:
+ {{wait_tip}}
+
+
+ {{userInfo.username}}:
+ {{pass_tip}}
+
+
+ 上传缴费信息
+ 查看录取通知书
+
+
+
+ {{userInfo.username}}:
+ {{fault_tip}}
+
+
+ {{userInfo.username}}:
+ {{back_tip}}
+
+
+
+
@@ -38,13 +42,19 @@
},
data() {
return {
+ course_id: '',
banner_list: [],
info: {},
userInfo: {},
- courseInfo: {}
+ courseInfo: {},
+ wait_tip: "我们将在1-3个工作日内审核并通知您报名结果….",
+ pass_tip: "恭喜您,您已被录取",
+ fault_tip: '很遗憾,您未通过审核。',
+ back_tip: "很遗憾,您未通过审核。",
}
},
onLoad(options) {
+ this.course_id = options.id
this.getCourseDetail(options.id)
this.getBannerList()
},
@@ -57,13 +67,69 @@
this.info = res.detail
this.userInfo = res.detail.user
this.courseInfo = res.detail.course
- },
- async getBannerList(){
- const res = await this.$u.api.otherBanner({
- position:1,
- })
- this.banner_list = res
+ this.courseInfo_type_detail = this.courseInfo.type_detail
+ this.wait_tip = this.courseInfo_type_detail.wait_tip ? this.courseInfo_type_detail.wait_tip :
+ "我们将在1-3个工作日内审核并通知您报名结果…."
+ this.pass_tip = this.courseInfo_type_detail.pass_tip ? this.courseInfo_type_detail.pass_tip :
+ "恭喜您,您已被录取!"
+ this.fault_tip = this.courseInfo_type_detail.fault_tip ? this.courseInfo_type_detail.fault_tip :
+ '很遗憾,您未通过审核。'
+ this.back_tip = this.courseInfo_type_detail.back_tip ? this.courseInfo_type_detail.back_tip :
+ "很遗憾,您未通过审核。"
+ },
+ async getBannerList() {
+ const res = await this.$u.api.otherBanner({
+ position: 1,
+ })
+ this.banner_list = res
+ },
+ toPay() {
+ uni.navigateTo({
+ url: '/packages/mycourse/coursePay?id=' + this.course_id
+ })
},
+ openFiles(files) {
+ console.log("files", files)
+ let that = this
+ uni.downloadFile({
+ url: files[0].url,
+ success: function(res) {
+ if (res.statusCode === 200) {
+ console.log("临时路径", res.tempFilePath)
+ let filePath = res.tempFilePath
+ //调用uni.openDocument打开文件
+ uni.openDocument({
+ filePath: filePath,
+ success: function(res) {
+ console.log("打开文档成功");
+ },
+ fail: function(res) {
+ console.log("uni.openDocument,fail");
+ console.log(res)
+ },
+ complete: function(res) {
+ console.log("uni.openDocument,complete");
+ console.log(res)
+ }
+ });
+ }
+ },
+ fail: function(err) {
+ console.log('文件下载失败', err)
+ }
+ })
+ // uni.openDocument({
+ // filePath: files[0].url,
+ // success: function(res) {
+ // console.log('打开文档成功');
+ // },
+ // fail: function(err) {
+ // that.base.toast("打开文档失败")
+ // console.log('打开文档失败', err);
+ // }
+ // });
+
+ }
}
}
@@ -84,27 +150,51 @@
}
.wrap {
- position: relative;
- height:100%;
- &-status{
- margin:120rpx 20rpx;
- &-name{
- color:#000;
- font-size: 32rpx;
- padding-bottom:20rpx;
- }
- &-content{
- line-height: 2;
- text-indent: 2em;
- }
- }
- &-img{
- image{
- width:260rpx;
- height:314rpx;
- display: block;
- margin:0 auto;
- }
+ position: relative;
+ height: 100%;
+
+ &-status {
+ margin: 120rpx 20rpx;
+
+ &-name {
+ color: #000;
+ font-size: 32rpx;
+ padding-bottom: 20rpx;
+ }
+
+ &-content {
+ line-height: 2;
+ text-indent: 2em;
+ }
+
+ &-btn {
+ text-align: right;
+ text-align: center;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ &>view {
+ width: 45%;
+ display: inline-block;
+ text-align: center;
+ margin: 0 auto;
+ color: #fff;
+ background: linear-gradient(to right, #e4cdb4, #c69c6d);
+ border-radius: 30rpx;
+ padding: 10rpx 20rpx;
+ }
+ }
+ }
+
+ &-img {
+ image {
+ width: 260rpx;
+ height: 314rpx;
+ display: block;
+ margin: 0 auto;
+ }
}
}
diff --git a/packages/mycourse/detail.vue b/packages/mycourse/detail.vue
index 4a02951..ba6184b 100644
--- a/packages/mycourse/detail.vue
+++ b/packages/mycourse/detail.vue
@@ -30,6 +30,8 @@
this.course_id = options.id
this.getCourseDetail(options.id)
},
+ onShow() {
+ },
methods:{
toUrl(type){
if(type===1){
@@ -41,9 +43,17 @@
this.base.toast("请等待审核通过")
return
}
- if(this.info.status>1){
- this.base.toast("您没有权限查看本班通讯录")
- return
+ // 需要缴费
+ if(this.info.course.is_fee===1){
+ if(this.info.status>1 || this.info.fee_status!=1){
+ this.base.toast("您还没有权限查看本班通讯录")
+ return
+ }
+ }else{
+ if(this.info.status>1){
+ this.base.toast("您还没有权限查看本班通讯录")
+ return
+ }
}
uni.navigateTo({
url:'/packages/mycourse/courseTxl?id='+this.course_id
@@ -53,6 +63,22 @@
this.base.toast("当前课程没有课表")
return
}
+ if(this.info.status===0){
+ this.base.toast("请等待审核通过")
+ return
+ }
+ // 需要缴费
+ if(this.info.course.is_fee===1){
+ if(this.info.status>1 || this.info.fee_status!=1){
+ this.base.toast("您还没有权限查看本班课表")
+ return
+ }
+ }else{
+ if(this.info.status>1){
+ this.base.toast("您还没有权限查看本班课表")
+ return
+ }
+ }
uni.navigateTo({
url:'/packages/mycourse/courseContents?id='+this.course_id
})
@@ -61,6 +87,14 @@
this.base.toast("当前课程无需缴费")
return
}
+ if(this.info.status===0){
+ this.base.toast("请等待审核通过")
+ return
+ }
+ if(this.info.status>1){
+ this.base.toast("您无需上传缴费信息")
+ return
+ }
uni.navigateTo({
url:'/packages/mycourse/coursePay?id='+this.course_id
})
diff --git a/packages/mycourse/index.vue b/packages/mycourse/index.vue
index 3f85c12..c5894ab 100644
--- a/packages/mycourse/index.vue
+++ b/packages/mycourse/index.vue
@@ -22,7 +22,7 @@
-
+
历史课程
diff --git a/pages/book/index.vue b/pages/book/index.vue
index 2493d42..97bf44c 100644
--- a/pages/book/index.vue
+++ b/pages/book/index.vue
@@ -49,9 +49,12 @@
can_appointment: false,
is_schoolmate: 0,
}
+ },
+ onShow(){
+ this.getUser()
},
onLoad() {
- this.getUser()
+
},
methods: {
getUser() {
diff --git a/pages/course/index.vue b/pages/course/index.vue
index 8bdcb80..461e591 100644
--- a/pages/course/index.vue
+++ b/pages/course/index.vue
@@ -25,13 +25,13 @@
{{item.name}}
- 报名{{item.sign_date_status}}
+ 报名{{item.sign_date_status}}
- 我要报名
+ 我要报名
@@ -49,17 +49,23 @@
提示
如您已是我方校友,请先绑定账号
+
+ 去绑定
+
如您还不是我方校友,请先注册
+
+ 去注册
+
-
+
@@ -99,11 +105,12 @@
}
},
onLoad() {
- this.getCourseList()
+
this.getBannerList()
},
onShow() {
+ this.getCourseList()
this.showRegister = false
let user = uni.getStorageSync("stbc_lifeData") ? uni.getStorageSync("stbc_lifeData").vuex_user : {}
if(!this.base.isNull(user.mobile)){
@@ -145,7 +152,7 @@
convertToChineseMonth(dateString,dateStatus) {
if (this.base.isNull(dateString) || dateStatus==='待定') {
return {
- month:'待',
+ month:'',
year:"定"
}
}else{
@@ -170,8 +177,19 @@
},
// 报名
- toDetail(id) {
- this.go_course_id = id
+ toDetail(item) {
+ this.go_course_id = item.id
+
+ // 收费的不限制报名人数 total没值也不限制
+
+ // 免费的限制报名人数
+ if(!item.is_fee && (item.total && item.total>0)){
+ // 报名人数已满
+ if(item.sign_total>=item.total){
+ this.base.toast("当前报名人数已满")
+ return
+ }
+ }
if(!this.hasMobile){
this.showRegister = true
return
@@ -333,7 +351,8 @@
color: #fff;
padding: 10rpx 20rpx;
border-radius: 30rpx;
- margin: 20rpx;
+ margin: 20rpx;
+ text-align: center;
}
}
// 未开始
@@ -403,14 +422,33 @@
font-size: 32rpx;
}
&-content{
- height:300rpx;
+ height:450rpx;
padding:0 30rpx;
font-size: 32rpx;
text-align: center;
&>view{
- margin:30rpx 0;
+ margin:30rpx auto;
}
}
+ &-bind {
+ width: 45%;
+ text-align: center;
+ margin: 0 auto;
+ color: #fff;
+ border-radius: 30rpx;
+ padding: 20rpx;
+ background: linear-gradient(to right, #e4cdb4, #c69c6d);
+ }
+
+ &-register {
+ width: 45%;
+ text-align: center;
+ margin: 0 auto;
+ color: #fff;
+ border-radius: 30rpx;
+ padding: 20rpx;
+ background: linear-gradient(to right, #5e5fbc, #0d0398);
+ }
&-btn{
display: flex;
justify-content: space-between;
diff --git a/pages/me/index.vue b/pages/me/index.vue
index 6463429..2e3b48b 100644
--- a/pages/me/index.vue
+++ b/pages/me/index.vue
@@ -39,16 +39,21 @@
+
-
-
+
+
+ X
+
+
+
电子校园卡
-
姓名:
- {{userInfo.name}}
+ {{userInfo.username}}
学籍:
@@ -71,8 +76,11 @@
-
-
+
+
+ X
+
+
@@ -81,17 +89,23 @@
提示
如您已是我方校友,请先绑定账号
+
+ 去绑定
+
如您还不是我方校友,请先注册
+
+ 去注册
+
-
+
@@ -126,7 +140,7 @@
methods: {
refreshCode() {
this.showCard = true
- this.$refs.uqrcodes.make({
+ this.$refs.uqrcode.make({
success: () => {
console.log('生成成功');
},
@@ -134,6 +148,7 @@
console.log(err)
}
});
+
},
tourl(type) {
if (type === 1) {
@@ -267,16 +282,36 @@
}
&-content {
- height: 300rpx;
+ height: 450rpx;
padding: 0 30rpx;
font-size: 32rpx;
text-align: center;
&>view {
- margin: 30rpx 0;
+ margin: 30rpx auto;
}
}
+ &-bind {
+ width: 45%;
+ text-align: center;
+ margin: 0 auto;
+ color: #fff;
+ border-radius: 30rpx;
+ padding: 20rpx;
+ background: linear-gradient(to right, #e4cdb4, #c69c6d);
+ }
+
+ &-register {
+ width: 45%;
+ text-align: center;
+ margin: 0 auto;
+ color: #fff;
+ border-radius: 30rpx;
+ padding: 20rpx;
+ background: linear-gradient(to right, #5e5fbc, #0d0398);
+ }
+
&-btn {
display: flex;
justify-content: space-between;
@@ -292,10 +327,22 @@
}
&-bind {
+ width: 45%;
+ text-align: center;
+ margin: 0 auto;
+ color: #fff;
+ border-radius: 30rpx;
+ padding: 20rpx;
background: linear-gradient(to right, #e4cdb4, #c69c6d);
}
&-register {
+ width: 45%;
+ text-align: center;
+ margin: 0 auto;
+ color: #fff;
+ border-radius: 30rpx;
+ padding: 20rpx;
background: linear-gradient(to right, #5e5fbc, #0d0398);
}
}
@@ -309,13 +356,32 @@
height: 100vh;
background-color: rgba(0, 0, 0, 0.6);
- &>image {
+ .modal-close {
+ width: 80rpx;
+ height: 80rpx;
+ text-align: center;
+ line-height: 80rpx;
+ color: #fff;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 80rpx;
+ position: absolute;
+ top: 0rpx;
+ right: 0rpx;
+ }
+
+ .modal-image {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 70%;
+
+ &>image {
+ width: 100%;
+ height: 100%;
+ }
}
+
}
.modal-xyk {