master
lion 2 years ago
parent 3cffe62b5d
commit 8543f6a2be

@ -64,8 +64,26 @@ const base = {
// 验证手机号
isMobile : (phoneNumber) => {
const regex = /^1[3-9]\d{9}$/;
return regex.test(phoneNumber);
return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phoneNumber)
},
isMail (val) {
return /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(val)
},
// 整数
isInteger(str) {
// 正则表达式,用于匹配整数,包括带正号的情况
const regex = /^[+-]?\d+$/;
// 测试字符串是否匹配正则表达式
return regex.test(str);
},
// 数字
isNumber(str) {
// 正则表达式,用于匹配数字
const regex = /^-?\d+(\.\d+)?$/;
// 测试字符串是否匹配正则表达式
return regex.test(str);
},
// 分享
shareInfo : () => {

@ -12,8 +12,8 @@
@click="showSelect(item,index)" />
</block>
<block v-else-if="item.edit_input==='checkbox'">
<checkbox-group @change="(e)=>{checkboxGroupChange(e,item)}">
<label v-for="(checkboxitem, checkboxindex) in item.select_item">
<checkbox-group style="display: flex;flex-wrap: wrap;" @change="(e)=>{checkboxGroupChange(e,item)}">
<label style="flex-basis: 100%;" v-for="(checkboxitem, checkboxindex) in item.select_item">
<checkbox :value="checkboxitem.value" />{{checkboxitem.value}}
</label>
</checkbox-group>
@ -183,6 +183,7 @@
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}不能为空`)
@ -190,11 +191,54 @@
return
}
}
//
if (!this.base.isNull(item.value) && item.rule.indexOf('mobile') !== -1) {
if(!this.base.isMobile(item.value)){
this.base.toast(`${item.name}不正确`)
errorCount++
return
}
}
//
if (!this.base.isNull(item.value) && item.rule.indexOf('idcard') !== -1) {
if(!this.$u.test.idCard(item.value)){
this.base.toast(`${item.name}不正确`)
errorCount++
return
}
}
//
if (item.rule.indexOf('email') !== -1) {
if(!this.base.isNull(item.value) && !this.base.isMail(item.value)){
this.base.toast(`${item.name}不正确`)
errorCount++
return
}
}
//
if (item.rule.indexOf('integer') !== -1) {
if(!this.base.isNull(item.value) && !this.base.isInteger(item.value)){
this.base.toast(`${item.name}必须为整数`)
errorCount++
return
}
}
//
if (item.rule.indexOf('numeric') !== -1) {
if(!this.base.isNull(item.value) && !this.base.isNumber(item.value)){
this.base.toast(`${item.name}必须为数字`)
errorCount++
return
}
}
}
})
if(errorCount>0){
return
}else{
// return
this.$emit("backForm",this.course_forms)
}
},

@ -42,8 +42,10 @@
<!-- <slot v-if="$slots.phone" name="phone" :data="mess"></slot> -->
<!-- <view class="left-item-card-phone" v-else-if="mess[phoneKey]">{{mess[phoneKey]}}</view> -->
<view style="font-size:28rpx;color:#666;margin-bottom:10rpx">{{mess['company_name']||''}}</view>
<view style="font-size:28rpx;color:#666;margin-bottom:10rpx">{{mess['company_position']||''}}</view>
<view v-if="mess['company_name']" style="font-size:28rpx;color:#666;margin-bottom:10rpx">{{mess['company_name']||''}}</view>
<view v-if="mess['company_position']" style="font-size:28rpx;color:#666;margin-bottom:10rpx">{{mess['company_position']||''}}</view>
<view v-if="showMobile" style="font-size:28rpx;color:#666;margin-bottom:10rpx">{{mess['mobile']||''}}</view>
<!-- <view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需联系方式请联系班主任</view> -->
</view>
</view>
@ -93,7 +95,8 @@
default: () => {
return []
}
},
},
//
//key
idKey: {
type: String,
@ -135,11 +138,13 @@
hasData: true,
nextSearchImgSrc,
noDataImgSrc,
nextScrollRightTopSrc
nextScrollRightTopSrc,
showMobile:false
};
},
created() {
this.$watch(() => this.dataList, (newList) => {
this.$watch(() => this.dataList, (newList) => {
console.log("this.showMobile",this.showMobile)
if (newList && newList.length) this.cleanData(newList)
// if (this.isInterlock) {
// this.$nextTick(() => {
@ -158,9 +163,14 @@
}, {
immediate: true,
deep: true,
})
})
},
methods: {
methods: {
setShowMobile(val){
console.log("val",val)
this.showMobile = val==1?true:false
},
search() {
if (this.searchStr) {
let has = false
@ -217,7 +227,8 @@
[this.imgKey]: res[this.imgKey] || '',
['company_name']: res['company_name'] || '',
['company_position']: res['company_position'] || '',
['course_signs']: res['course_signs'] || []
['course_signs']: res['course_signs'] || [],
['mobile']: res['mobile'] || '',
})
})
this.scrollRightList.forEach(t => {

@ -0,0 +1,116 @@
#### props
| 名称 | 类型 | 默认值 | 说明 |
| ----------- | ------- | -------- | ------------------------------------------------------ |
| width | string | '200px' | 选择框宽度 |
| height | string | '30px' | 选择框高度 |
| bgColor | string | '#fff' | 选择框背景颜色 |
| placeholder | string | '请选择' | 输入框占位文本 |
| valueName | string | 'label' | 显示的内容字段名 |
| keyName | string | 'value' | 绑定的内容字段名 |
| list | array | [] | 展示的内容列表 |
| showClose | boolean | true | 是否显示删除按钮 |
| multiple | boolean | false | 是否开启多选 |
| filterable | boolean | false | 是否开启搜索功能,开启后直接输入值不选择也可以保存内容 |
该组件默认下拉选择器是从底部弹出,当检测到底部高度不足时则会在上面弹出
#### events
| 事件名 | 说明 |
| ------ | --------------------------------------------- |
| change | 选择的内容改变时触发,返回的参数为列表的 item |
#### 基本使用
绑定的值通过`v-model`绑定,如下面的`chooseValue`,需要获取 item 的值可以监听`@change`事件
```vue
<template>
<view class="login">
<w-select
style="margin-left: 20rpx;"
v-model="chooseValue"
:list="list"
valueName="content"
keyName="id"
@change="change"
>
</w-select>
</view>
</template>
<script>
export default {
data() {
return {
chooseValue: "",
list: [
{
id: 1,
content: "张三",
},
{
id: 2,
content: "李四",
},
{
id: 3,
content: "王五",
},
],
};
},
methods: {
change(e) {
console.log("chooseValue", this.chooseValue);
},
},
};
</script>
```
#### 多选
多选开启`multiple`属性,双向绑定的值必须为数组类型,在 change 事件中根据自己需求进行处理。
```vue
<template>
<w-select
v-model="chooseValue"
:list="list"
multiple
valueName="content"
keyName="id"
@change="change"
>
</w-select>
</template>
<script>
export default {
data() {
return {
chooseValue: [],
list: [
{
id: 1,
content: "张三",
},
{
id: 2,
content: "李四",
},
{
id: 3,
content: "王五",
},
],
};
},
methods: {
change(e) {
console.log("chooseValue", this.chooseValue);
},
},
};
</script>
```

@ -0,0 +1,583 @@
<template>
<view
class="w-select"
id="wSelect"
:style="{
'--select-wrap-width': width,
'--select-wrap-height': height,
'--select-bg-color': bgColor
}"
>
<view :class="isShow ? 'select-wrap-active' : ''" class="select-wrap" @click="changeShow">
<view v-if="multiple" class="select-content">
<view class="select-content-item-default" v-if="multiSelectList.length === 0 && !filterable">
{{ placeholder }}
</view>
<view class="select-content-item" v-if="multiSelectList.length > 0">
{{ multiSelectList[0][valueName] }}
</view>
<view class="select-content-item" v-if="multiSelectList.length > 1">
{{ multiLength }}
</view>
</view>
<input
v-if="!multiple || filterable"
type="text"
@input="inputChange"
@blur="blurChange"
:placeholder="multiple ? multiSelectList.length === 0 ? placeholder : '' : placeholder"
:disabled="!filterable"
:style="!filterable ? 'pointer-events: none' : ''"
:value="inputData"
>
<!-- #ifdef VUE2 -->
<view
@click.stop="refreshValue"
class="close-icon"
v-if="showClose && (multiple ? value.length > 0 : value)"
>
<image :src="refreshUrl" mode="" />
</view>
<view
v-if="value.length <= 0 || !showClose"
:class="isShow ? 'w-select-arrow-up' : ''"
class="w-select-arrow "
/>
<!-- #endif -->
<!-- #ifdef VUE3 -->
<view
@click.stop="refreshValue"
class="close-icon"
v-if="showClose && (multiple ? modelValue.length > 0 : modelValue)"
>
<image :src="refreshUrl" mode="" />
</view>
<view
v-if="modelValue.length <= 0 || !showClose"
:class="isShow ? 'w-select-arrow-up' : ''"
class="w-select-arrow "
/>
<!-- #endif -->
<scroll-view
scroll-y
v-show="optionsShow"
:class="[
isShow
? showPosition === 'bottom'
? 'animation-bottom-in'
: 'animation-top-in'
: showPosition === 'bottom'
? 'animation-bottom-out'
: 'animation-top-out',
showPosition === 'bottom'
? 'position-bottom'
: 'position-top'
]"
class="select-options"
>
<!-- #ifdef VUE2 -->
<view
@click.stop="handleClickItem(item)"
:class="
multiple &&
multiSelectList.find(
res => res[keyName] === item[keyName]
)
? 'item-active'
: value === item[keyName]
? 'item-active'
: ''
"
v-for="item in filterList"
:key="item[keyName]"
class="select-option-item"
>
{{ item[valueName] }}
</view>
<!-- #endif -->
<!-- #ifdef VUE3 -->
<view
@click.stop="handleClickItem(item)"
:class="
multiple &&
multiSelectList.find(
res => res[keyName] === item[keyName]
)
? 'item-active'
: modelValue === item[keyName]
? 'item-active'
: ''
"
v-for="item in filterList"
:key="item[keyName]"
class="select-option-item"
>
{{ item[valueName] }}
</view>
<!-- #endif -->
<view class="options-no-data" v-if="filterList.length < 1">
无匹配数据~
</view>
</scroll-view>
</view>
<view v-if="isShow" @click="closeContentSelect" class="contentMask" />
</view>
</template>
<script>
export default {
props: {
width: {
type: String,
default: '200px'
},
height: {
type: String,
default: '30px'
},
bgColor: {
type: String,
default: '#fff'
},
//
multiple: {
type: Boolean,
default: false
},
//
filterable: {
type: Boolean,
default: false
},
//
showClose: {
type: Boolean,
default: false
},
//
list: {
type: Array,
default: () => []
},
// #ifdef VUE3
//
modelValue: {
type: [Array, String, Number],
default: ''
},
// #endif
// #ifdef VUE2
//
value: {
type: [Array, String, Number],
default: ''
},
// #endif
//
placeholder: {
type: String,
default: '请选择'
},
//
valueName: {
type: String,
default: 'label'
},
//
keyName: {
type: String,
default: 'value'
}
},
// #ifdef VUE3
emits: ['update:modelValue', 'change'],
// #endif
watch: {
list: {
immediate: true,
deep: true,
handler (news) {
this.filterList = news
const findItem = news.find(item => {
let isItem = ''
// #ifdef VUE3
if (item[this.keyName] === this.modelValue) {
isItem = true
} else {
isItem = false
}
// #endif
// #ifdef VUE2
if (item[this.keyName] === this.value) {
isItem = true
} else {
isItem = false
}
// #endif
return isItem
})
if (findItem) {
this.inputData = findItem[this.valueName]
}
}
},
// #ifdef VUE2
value: {
handler (newValue) {
if (this.multiple) {
this.multiSelectList = newValue || []
} else {
const findItem = this.list.find(it => it[this.keyName] === newValue)
if (findItem) {
this.inputData = findItem[this.valueName]
}
}
}
},
// #endif
// #ifdef VUE3
modelValue: {
handler (newValue) {
if (this.multiple) {
this.multiSelectList = newValue || []
} else {
const findItem = this.list.find(it => it[this.keyName] === newValue)
if (findItem) {
this.inputData = findItem[this.valueName]
}
}
}
}
// #endif
},
computed: {
multiLength () {
const length = this.multiSelectList.length - 1
return '+' + length
},
bottomDistance () {
return (
this.windowHeight - this.distanceTop - this.curHeight
) //
}
},
data () {
return {
inputData: '',
multiSelectList: [],
isShow: false,
optionsShow: false,
windowHeight: null,
curHeight: null,
distanceTop: null,
showPosition: 'bottom',
filterList: [],
refreshUrl: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDQ4IDQ4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC4wMSIvPjxwYXRoIGQ9Ik0yNCA0NEMzNS4wNDU3IDQ0IDQ0IDM1LjA0NTcgNDQgMjRDNDQgMTIuOTU0MyAzNS4wNDU3IDQgMjQgNEMxMi45NTQzIDQgNCAxMi45NTQzIDQgMjRDNCAzNS4wNDU3IDEyLjk1NDMgNDQgMjQgNDRaIiBmaWxsPSJub25lIiBzdHJva2U9IiM3YzZlNmUiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik0yOS42NTY5IDE4LjM0MzFMMTguMzQzMiAyOS42NTY4IiBzdHJva2U9IiM3YzZlNmUiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTE4LjM0MzIgMTguMzQzMUwyOS42NTY5IDI5LjY1NjgiIHN0cm9rZT0iIzdjNmU2ZSIgc3Ryb2tlLXdpZHRoPSI0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4='
}
},
mounted () {
this.$nextTick(() => {
const res = uni.getSystemInfoSync()
this.windowHeight = res.windowHeight //
uni
.createSelectorQuery()
.in(this)
.select('#wSelect')
.boundingClientRect(data => {
this.distanceTop = data.top //
this.curHeight = data.height
})
.exec()
})
},
methods: {
showPositon () {
this.showPosition = 'bottom'
if (this.bottomDistance < this.windowHeight / 3) {
this.showPosition = 'top'
}
},
changeShow () {
this.isShow = !this.isShow
if (this.isShow === false) {
this.filterList = this.list
setTimeout(() => {
this.optionsShow = false
}, 200)
} else {
this.showPositon()
this.optionsShow = this.isShow
}
},
closeContentSelect () {
this.isShow = false
setTimeout(() => {
this.optionsShow = false
}, 200)
},
setValue (value = '') {
// #ifdef VUE3
this.$emit('update:modelValue', value)
// #endif
// #ifdef VUE2
this.$emit('input', value)
// #endif
},
inputChange (e) {
const value = e.detail.value
if (this.multiple && this.filterable) {
this.inputData = value
} else {
this.setValue(value)
this.inputData = value
}
this.filterList = this.list.filter(item =>
item[this.valueName].includes(value)
)
},
blurChange (e) {
const value = e.detail.value
if (this.multiple && this.filterable && value) {
const curValue = {
[this.keyName]: value,
[this.valueName]: value
}
this.multiSelect(curValue)
}
},
refreshValue () {
this.setValue('')
this.inputData = ''
this.$emit('change', '')
this.filterList = this.list
if (this.multiple) {
this.multiSelectList = []
}
},
handleClickItem (e) {
if (this.multiple) {
this.multiSelect(e)
} else {
this.setValue(e[this.keyName])
this.inputData = e[this.valueName]
this.$emit('change', e)
this.changeShow()
}
},
multiSelect (item) {
const index = this.multiSelectList.findIndex(
res => res[this.valueName] === item[this.valueName]
)
if (index > -1) {
this.multiSelectList.splice(index, 1)
} else {
this.multiSelectList.push(item)
}
this.inputData = ''
this.filterList = this.list
this.setValue(this.multiSelectList)
this.$emit('change', item)
}
}
}
</script>
<style lang="scss" scoped>
.w-select {
--select-wrap-width: 200px;
--select-wrap-height: 30px;
--select-border-radius: 4px;
// --select-border: 1px solid #dcdfe6;
// --select-active-border: 1px solid #409eff;
--select-options-max-height: 150px;
--select-option-item-font-size: 14px;
--select-input-font-size: 14px;
--no-data-default-color: #999999;
--select-options-box-shadow: 0px 0px 12px rgb(0 0 0 / 12%);
--select-bg-color: #ffffff;
.select-wrap {
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
width: var(--select-wrap-width);
height: var(--select-wrap-height);
border: var(--select-border);
border-radius: var(--select-border-radius);
background-color: var(--select-bg-color);
transition: all 0.2s;
input {
padding: 0 2px;
width: 100%;
min-width: 0;
height: 100%;
font-size: var(--select-input-font-size);
flex: 1;
}
.select-content {
display: flex;
align-items: center;
font-size: var(--select-option-item-font-size);
.select-content-item {
margin-left: 5px;
padding: 2px 6px;
border-radius: var(--select-border-radius);
color: #aa93b1;
background-color: #f4f4f5;
}
.select-content-item-default {
margin-left: 5px;
color: var(--no-data-default-color);
}
}
.close-icon {
position: absolute;
top: 50%;
right: 7px;
z-index: 1000;
width: 15px;
height: 15px;
transform: translateY(-50%);
image {
width: 100%;
height: 100%;
}
}
.position-bottom {
top: calc(var(--select-wrap-height) + 10px);
}
.position-top {
bottom: calc(var(--select-wrap-height) + 10px);
}
.select-options {
position: absolute;
right: 0;
left: 0;
z-index: 999;
overflow: scroll;
padding: 10px;
max-height: var(--select-options-max-height);
border-radius: var(--select-border-radius);
background-color: var(--select-bg-color);
box-shadow: var(--select-options-box-shadow);
.select-option-item {
margin-bottom: 5px;
padding: 5px;
font-size: var(--select-option-item-font-size);
transition: background-color 0.2s;
}
.item-active {
font-weight: 700;
color: #409eff;
background-color: #f5f7fa;
}
.options-no-data {
font-size: var(--select-option-item-font-size);
text-align: center;
color: var(--no-data-default-color);
}
}
.w-select-arrow {
display: inline-block;
margin: 3px 10px 0;
width: 8px;
height: 8px;
border-top: 1px solid transparent;
border-right: 1px solid transparent;
border-bottom: 1px solid #999999;
border-left: 1px solid #999999;
transition: all 0.3s;
transform: translateY(-50%) rotate(-45deg);
}
.w-select-arrow-up {
transform: rotate(-225deg);
}
}
.select-wrap-active {
border: var(--select-active-border);
}
.animation-bottom-in {
animation-name: bottom-in;
animation-duration: 0.4s;
animation-timing-function: ease-out;
animation-fill-mode: both;
}
.animation-bottom-out {
animation-name: bottom-out;
animation-duration: 0.2s;
animation-timing-function: ease-out;
animation-fill-mode: both;
}
.animation-top-in {
animation-name: top-in;
animation-duration: 0.4s;
animation-timing-function: ease-out;
animation-fill-mode: both;
}
.animation-top-out {
animation-name: top-out;
animation-duration: 0.2s;
animation-timing-function: ease-out;
animation-fill-mode: both;
}
@keyframes bottom-in {
0% {
opacity: 0;
transform: translateY(-15%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes bottom-out {
0% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 0;
transform: translateY(-20%);
}
}
@keyframes top-in {
0% {
opacity: 0;
transform: translateY(15%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes top-out {
0% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 0;
transform: translateY(20%);
}
}
.contentMask {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 998;
width: 100%;
height: 100%;
}
}
</style>

@ -18,7 +18,6 @@
"license": "ISC",
"dependencies": {
"moment": "^2.30.1",
"solarlunar": "^2.0.7",
"uqrcodejs": "^4.0.7"
}
}

@ -3,15 +3,15 @@
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<!-- <u-divider>个人信息</u-divider> -->
<view class="wrap">
<u-form :model="form" :label-width="140" ref="uForm" :label-align="'left'" :error-type="['message']">
<!-- <u-form :model="form" :label-width="140" ref="uForm" :label-align="'left'" :error-type="['message']">
<u-form-item label="姓名" prop="username" required>
<u-input v-model="form.username" placeholder="请输入姓名" />
</u-form-item>
<u-form-item label="性别" prop="sex" required>
<u-input @click="showSex = true" placeholder="请选择性别" v-model="form.sex" type="select" />
</u-form-item>
<!-- <u-form-item label="身份证号" prop="idcard" required>
<u-input type="idcard" placeholder="请输入身份证号" v-model="form.idcard" /></u-form-item> -->
<u-form-item label="身份证号" prop="idcard" required>
<u-input type="idcard" placeholder="请输入身份证号" v-model="form.idcard" /></u-form-item>
<u-form-item label="联系方式" prop="mobile" required>
<u-input type="number" placeholder="请输入联系方式" v-model="form.mobile" />
</u-form-item>
@ -26,7 +26,7 @@
<u-form-item label="职务" prop="company_position">
<u-input @click="showPosition = true" v-model="form.company_position" type="select"
placeholder="请选择职务" /></u-form-item>
</u-form>
</u-form> -->
<!-- <u-divider>报名信息</u-divider> -->
<applyForm ref="applyForm" @backForm="backForm" :course_forms="course_forms"></applyForm>
</view>
@ -128,14 +128,14 @@
}
},
onReady() {
this.$refs.uForm.setRules(this.rules);
// this.$refs.uForm.setRules(this.rules);
},
onLoad(options) {
this.course_id = options.id
this.getCourseDetail(options.id)
let user = uni.getStorageSync("stbc1_lifeData") ? uni.getStorageSync("stbc1_lifeData").vuex_user : {}
this.form = user
this.getPosition()
// this.getPosition()
},
methods: {
selectSex(e) {
@ -161,8 +161,13 @@
const res = await this.$u.api.courseDetail({
course_id: id
})
if (res.course_forms && res.course_forms.length > 0) {
this.course_forms = res.course_forms
if (res.course_forms && res.course_forms.length > 0) {
res.course_forms.map(item=>{
if(item.belong_user===1){
item.value = this.form[item.field]
}
})
this.course_forms = res.course_forms.sort((a,b)=>(a.sort-b.sort))
}
this.is_fee = res.is_fee
@ -176,26 +181,28 @@
value: item.value ? item.value : ''
})
//
if (item.belong_user === 1) {
if (item.belong_user === 1 && !this.base.isNull(item.value)) {
this.form[item.field] = item.value
}
})
this.apply_form = _arr
console.log("this.apply_form", this.apply_form, this.form)
// return
this.$refs.uForm.validate(valid => {
if (valid) {
this.saveUser()
this.applyCourse()
} else {
console.log('验证失败');
// this.base.toast("")
}
});
// return
this.saveUser()
this.applyCourse()
// this.$refs.uForm.validate(valid => {
// if (valid) {
// } else {
// console.log('');
// // this.base.toast("")
// }
// });
},
async saveUser() {
let that = this
let that = this
this.form.name = this.form.username
await this.$u.api.saveUser(this.form).then(res => {
console.log("user")
// this.$u.api.user().then(res => {
@ -213,7 +220,7 @@
if (this.is_fee) {
this.newsSubscription()
} else {
that.base.toast("报名成功",1500,function(){
that.base.toast("报名已提交",1500,function(){
setTimeout(function(){
uni.redirectTo({
url: '/packages/mycourse/index'
@ -240,7 +247,7 @@
) {
console.log("accept")
//
that.base.toast("报名成功", 1500, function() {
that.base.toast("报名已提交", 1500, function() {
setTimeout(function(){
uni.redirectTo({
url: '/packages/mycourse/index'
@ -261,7 +268,7 @@
'XsR1BJRdE8JtFUC1o3w7DDcscXkCEGu62J8_smMofZI',
],
success(res) {
that.base.toast("报名成功", 1500, function() {
that.base.toast("报名已提交", 1500, function() {
setTimeout(function(){
uni.redirectTo({
url: '/packages/mycourse/index'
@ -271,7 +278,7 @@
})
},
fail(err) {
that.base.toast("报名成功", 1500, function() {
that.base.toast("报名已提交", 1500, function() {
setTimeout(function(){
uni.redirectTo({
url: '/packages/mycourse/index'
@ -282,7 +289,7 @@
}
})
} else {
that.base.toast("报名成功", 1500, function() {
that.base.toast("报名已提交", 1500, function() {
setTimeout(function(){
uni.redirectTo({
url: '/packages/mycourse/index'
@ -296,7 +303,7 @@
}
} else {
console.log("9999")
that.base.toast("报名成功", 1500, function() {
that.base.toast("报名已提交", 1500, function() {
setTimeout(function(){
uni.redirectTo({
url: '/packages/mycourse/index'

@ -127,7 +127,8 @@
timeRange: '',
start_time: '',
end_time: '',
content: '',
content: '',
idcard:'',
site: "",
siteName: '',
accompany: []
@ -177,8 +178,6 @@
}],
},
}
},
onReady() {
@ -383,7 +382,7 @@
if (res.subscriptionsSetting.itemSettings && res.subscriptionsSetting.itemSettings[
'0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0'] === 'accept') {
//
that.base.toast("预约成功",2000,function(){
that.base.toast("预约已提交",2000,function(){
setTimeout(function(){
uni.redirectTo({
url:'/packages/mybook/index'
@ -402,7 +401,7 @@
'0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0',
],
success(res) {
that.base.toast("预约成功",2000,function(){
that.base.toast("预约已提交",2000,function(){
setTimeout(function(){
uni.redirectTo({
url:'/packages/mybook/index'
@ -411,7 +410,7 @@
})
},
fail(err) {
that.base.toast("预约成功",2000,function(){
that.base.toast("预约已提交",2000,function(){
setTimeout(function(){
uni.redirectTo({
url:'/packages/mybook/index'
@ -421,7 +420,7 @@
}
})
} else {
that.base.toast("预约成功",2000,function(){
that.base.toast("预约已提交",2000,function(){
setTimeout(function(){
uni.redirectTo({
url:'/packages/mybook/index'
@ -434,7 +433,7 @@
}
} else {
that.base.toast("预约成功",2000,function(){
that.base.toast("预约已提交",2000,function(){
setTimeout(function(){
uni.redirectTo({
url:'/packages/mybook/index'

@ -37,8 +37,8 @@
</view>
</view>
<view class="list-item-bottom">
<text @click.stop="cancelBook(item)" v-if="item.status<2 && isCanCancel(item.start_time)"></text>
<text v-if="item.status<2 && isCanCancel(item.start_time)">|</text>
<text @click.stop="cancelBook(item)" v-if="item.status<1 && isCanCancel(item.start_time)"></text>
<text v-if="item.status<1 && isCanCancel(item.start_time)">|</text>
<text>查看</text>
</view>
@ -72,7 +72,6 @@
1:'通过',
2:'审核不通过',
3:'已取消',
}
}
},

@ -1,38 +1,52 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="search">
<!-- <view class="select"> -->
<w-select width="220rpx" :showClose="false" style="margin-left: 20rpx;" v-model="chooseValue" :list="selectList" valueName="name"
keyName="id" @change="changeMonth">
</w-select>
<!-- </view> -->
<view class="all" @click="changeAll"></view>
</view>
<view class="wrap">
<view v-if="list.length>0">
<view class="item" v-for="item in list">
<view class="item-date">{{item.date}}</view>
<view v-if="monthList.length>0">
<view class="item" v-for="item in monthList">
<view class="item-date">{{item.monthday}}</view>
<view class="item-period">{{item.period}}</view>
<view class="item-img">
<image :src="base.imgHost('mycourse-c1.png')" style="width:22rpx;height:22rpx"></image>
<text>{{item.theme}}</text>
<view class="item-img">
<image :src="base.imgHost('mycourse-c1.png')" style="width:22rpx;height:22rpx"></image>
<text>{{item.theme}}</text>
</view>
<view class="item-img">
<image :src="base.imgHost('mycourse-c2.png')" style="width:20rpx;height:23rpx"></image>
<text>{{item.teacher?item.teacher.name:''}}</text>
<view class="item-img">
<image :src="base.imgHost('mycourse-c2.png')" style="width:20rpx;height:23rpx"></image>
<text>{{item.teacher?item.teacher.name:''}}</text>
</view>
<view class="item-img">
<image :src="base.imgHost('mycourse-c3.png')" style="width:19rpx;height:27rpx"></image>
<text>{{item.address}}</text>
<view class="item-img">
<image :src="base.imgHost('mycourse-c3.png')" style="width:19rpx;height:27rpx"></image>
<text>{{item.address}}</text>
</view>
</view>
</view>
<view class="nodata" v-else>
<u-empty mode="data"></u-empty>
<u-empty text="当前没有排课" mode="data"></u-empty>
</view>
</view>
</view>
</template>
<script>
import wSelect from "@/components/w-select/w-select.vue"
export default {
components: {},
components: {
wSelect
},
data() {
return {
list: []
list: [],
monthList: [],
chooseValue: '',
selectList: ''
}
},
onLoad(options) {
@ -42,9 +56,67 @@
async getMyCourseContents(id) {
const res = await this.$u.api.courseContent({
course_id: id,
})
this.list = res.list
})
this.list = res.list
if(res.list.length>0){
// this.monthList = res.list
let obj = this.groupByMonthAndSort(res.list)
const currentMonth = this.$moment().format('YYYY年MM月')
if(this.selectList.length>0){
this.selectList.map((item,index)=>{
if(item.name===currentMonth){
this.monthList = item.item
this.chooseValue = item.name
}else{
this.monthList = this.selectList[this.selectList.length-1]['item']
this.chooseValue = item.name
}
})
}
}
},
changeMonth(e) {
console.log("e",e,this.chooseValue)
this.monthList = e.item
},
changeAll(){
this.chooseValue = ''
this.monthList = this.list
},
groupByMonthAndSort(a) {
//
const groupedData = {};
// a
a.forEach(item => {
// date
const date = this.$moment(item.date, 'YYYY-MM-DD');
const monthKey = date.format('YYYY年MM月');
// monthday
item.monthday = date.format('MM月DD日');
// groupedData
if (!groupedData[monthKey]) {
groupedData[monthKey] = [];
}
//
groupedData[monthKey].push(item);
});
let _arr = []
for(var k in groupedData){
_arr.push({
name:k,
item:groupedData[k],
id:k
})
}
this.selectList = _arr
//
return groupedData;
}
}
}
@ -56,6 +128,7 @@
width: 100%;
height: 100vh;
overflow: scroll;
.cbg {
position: absolute;
top: 0;
@ -64,34 +137,59 @@
height: 100vh;
}
.search {
width:100%;
padding: 30rpx;
position: fixed;
top:0;
left:0;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 1rpx -4rpx 15rpx 0 #333;
z-index:9;
background-color: #fff;
height:100rpx;
.all {
font-size: 28rpx;
color:#b89155;
}
}
.wrap {
position: relative;
.item{
background-color: #fff;
padding:30rpx;
margin-bottom: 20rpx;
border-radius: 20rpx;
&-date{
font-size: 32rpx;
color:#b08c6c;
margin-bottom:30rpx
}
&-period{
color:#333333;
margin-left:20rpx;
margin-bottom:20rpx
}
&-img{
color:#666666;
display: flex;
align-items: center;
margin-left:20rpx;
margin-bottom:20rpx;
image{
margin-right:10rpx;
}
}
padding-top:100rpx;
.item {
background-color: #fff;
padding: 30rpx;
margin-bottom: 20rpx;
border-radius: 20rpx;
&-date {
font-size: 32rpx;
color: #b08c6c;
margin-bottom: 20rpx
}
&-period {
color: #333333;
margin-left: 20rpx;
margin-bottom: 10rpx
}
&-img {
color: #666666;
display: flex;
align-items: center;
margin-left: 20rpx;
margin-bottom: 10rpx;
image {
margin-right: 10rpx;
}
}
}
.nodata {
height: 100vh;
}

@ -7,7 +7,7 @@
<view v-if="info.fee_status==1">
您已缴费成功
</view>
<view v-else-if="info.fee_status==2">
<view v-else-if="info.fee_status==2" style="color:red">
您上传的缴费图片有误请重新上传
</view>
<view v-else-if="info.fee_status==3">

@ -13,9 +13,14 @@
<view class="wrap-status-content">{{info.reason?info.reason:pass_tip}}</view>
<!-- v-if="courseInfo.is_fee===1 && info.fee_status!=1" -->
<view class="wrap-status-btn">
<view @click="toPay" v-if="courseInfo.is_fee===1 && info.fee_status!=1"></view>
<view v-if="info.files && info.files.length>0" @click="openFiles(info.files)"></view>
</view>
<view class="wrap-status-btn">
<view @click="toPay" v-if="courseInfo.is_fee===1 && info.fee_status!=1"></view>
</view>
<view class="wrap-status-btn">
<view @click="showCancel = true">我要放弃</view>
</view>
</view>
<view v-else-if="info.status===2">
<view class="wrap-status-name">{{userInfo.username}}:</view>
@ -31,6 +36,21 @@
</view>
</view>
<!-- 我要放弃 -->
<u-modal v-model="showCancel" negative-top="400"
:show-cancel-button="false" :show-confirm-button="false" :show-title="false">
<view class="slot-content">
<view class="slot-content-title">提示</view>
<view class="slot-content-tip">放弃后将无法再次报名本期课程请确认后再提交</view>
<view class="slot-content-input">
<u-input v-model="form.giveup_reason" type="textarea" :border="true" placeholder="请输入放弃原因" />
</view>
<view class="slot-content-btn">
<view @click="showCancel=false"></view>
<view @click="cancelSign"></view>
</view>
</view>
</u-modal>
</view>
</template>
@ -47,10 +67,14 @@
info: {},
userInfo: {},
courseInfo: {},
form: {
giveup_reason: ""
},
wait_tip: "我们将在1-3个工作日内审核并通知您报名结果….",
pass_tip: "恭喜您,您已被录取",
fault_tip: '很遗憾,您未通过审核。',
back_tip: "我们将在1-3个工作日内审核并通知您报名结果….",
showCancel: false
}
},
onLoad(options) {
@ -81,8 +105,10 @@
const res = await this.$u.api.otherBanner({
position: 2,
})
if(res.length>0){
this.banner_list = res.sort((a,b)=>{a.sort-b.sort})
if (res.length > 0) {
this.banner_list = res.sort((a, b) => {
a.sort - b.sort
})
}
},
toPay() {
@ -90,6 +116,13 @@
url: '/packages/mycourse/coursePay?id=' + this.course_id
})
},
cancelSign() {
let that = this
if (this.base.isNull(this.form.giveup_reason)) {
this.base.toast("请输入放弃原因")
return
}
},
openFiles(files) {
console.log("files", files)
let that = this
@ -120,17 +153,6 @@
console.log('文件下载失败', err)
}
})
// uni.openDocument({
// filePath: files[0].url,
// success: function(res) {
// console.log('');
// },
// fail: function(err) {
// that.base.toast("")
// console.log('', err);
// }
// });
}
}
@ -151,6 +173,38 @@
height: 100vh;
}
.slot-content {
padding: 30rpx;
padding-top:20rpx;
&>view{
padding-top:20rpx;
}
&-title{
text-align: center;
}
&-tip{
text-indent: 2em;
}
&-btn{
display: flex;
align-items: center;
justify-content: space-between;
&>view {
width: 40%;
text-align: center;
margin: 0 auto;
color: #fff;
background: linear-gradient(to right, #5e5fbc, #0d0398);
border-radius: 30rpx;
padding: 10rpx;
}
&>view:first-child{
background: #ddd;
color:#333
}
}
}
.wrap {
position: relative;
height: 100%;

@ -3,51 +3,55 @@
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="wrap">
<view v-if="teacher">
<view class="teacher">
<view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx" :src="base.imgHost('txl-teacher.png')"></image>
</view>
<view>
<view class="teacher-name">
<view style="display: flex;align-items: center;">
<text>{{teacher.name}}</text>
<text class="courseName">班主任</text>
</view>
</view>
<view class="teacher-mobile">
<image style="width:22rpx;height:22rpx;margin-right:20rpx" :src="base.imgHost('txl-phone.png')"></image>
<view>{{teacher.mobile?teacher.mobile:''}}</view>
</view>
<view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需学员联系方式请联系班主任</view>
<view class="teacher">
<view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx"
:src="base.imgHost('txl-teacher.png')"></image>
</view>
<view>
<view class="teacher-name">
<view style="display: flex;align-items: center;">
<text>{{teacher.name}}</text>
<text class="courseName">班主任</text>
</view>
</view>
<view class="teacher-mobile">
<image style="width:22rpx;height:22rpx;margin-right:20rpx"
:src="base.imgHost('txl-phone.png')"></image>
<view>{{teacher.mobile?teacher.mobile:''}}</view>
</view>
</view>
</view>
</view>
<view v-if="studentList.length>0">
<view class="teacher" v-for="item in studentList">
<view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx" :src="base.imgHost('txl-student.png')"></image>
</view>
<view>
<view class="teacher-name">
<view style="display: flex;align-items: center;">
<text>{{item.name}}</text>
<text class="courseName">{{item.course_signs[0]['position']}}</text>
</view>
</view>
<view class="teacher-company">{{item.company_name}}</view>
<view class="teacher-company">{{item.company_position}}</view>
<!-- <view class="teacher-mobile">
<view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需联系方式请联系班主任</view>
</view> -->
</view>
</view>
</view>
<view v-if="list.length>0">
<nextIndexedXlist :dataList="list" :show-avatar="false">
</nextIndexedXlist>
</view>
<view v-if="!show_mobile" class="showMobile"></view>
<view v-if="studentList.length>0">
<view class="teacher" v-for="item in studentList">
<view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx"
:src="base.imgHost('txl-student.png')"></image>
</view>
<view>
<view class="teacher-name">
<view style="display: flex;align-items: center;">
<text>{{item.name}}</text>
<text class="courseName">{{item.course_signs[0]['position']}}</text>
</view>
</view>
<view class="teacher-company">{{item.company_name}}</view>
<view class="teacher-company">{{item.company_position}}</view>
<view v-if="show_mobile" class="teacher-company">{{item.mobile}}</view>
<!-- <view class="teacher-mobile">
<view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需联系方式请联系班主任</view>
</view> -->
</view>
</view>
</view>
<!-- <view v-if="list.length>0"> -->
<nextIndexedXlist ref="txllist" :dataList="list" :show-avatar="false">
</nextIndexedXlist>
<!-- </view> -->
<!-- <view class="nodata" v-else>
<u-empty mode="data"></u-empty>
</view> -->
@ -64,13 +68,20 @@
},
data() {
return {
list: [],
teacher: null,
studentList:[]
teacher: null,
studentList: [],
show_mobile: false,
}
},
onLoad(options) {
onLoad(options) {
let that = this
this.show_mobile = options.show_mobile == 1 ? true : false
console.log("this.$refs.txllist",options.show_mobile,this.show_mobile,this.$refs.txllist)
this.$nextTick(function() {
that.$refs.txllist.setShowMobile(options.show_mobile)
})
this.getMyCourseTxl(options.id)
},
methods: {
@ -78,23 +89,25 @@
const res = await this.$u.api.courseUserList({
course_id: id,
type: 2
})
let _student = []
let _other = []
res.list.map(item=>{
if(item.course_signs && item.course_signs.length>0){
if(!this.base.isNull(item.course_signs[0]['position'])){
_student.push(item)
}else{
_other.push(item)
}
}else{
_other.push(item)
}
})
})
let _student = []
let _other = []
res.list.map(item => {
if (item.course_signs && item.course_signs.length > 0) {
if (!this.base.isNull(item.course_signs[0]['position'])) {
_student.push(item)
} else {
_other.push(item)
}
} else {
_other.push(item)
}
})
this.studentList = _student
this.list = _other
this.teacher = res.teacher
},
}
@ -102,7 +115,6 @@
</script>
<style scoped lang="scss">
.container {
padding: 30rpx 60rpx;
width: 100%;
@ -118,8 +130,8 @@
}
.wrap {
position: relative;
height:100%;
position: relative;
height: 100%;
overflow: scroll;
// padding-top: 100rpx;
@ -127,6 +139,14 @@
height: calc(100vh - 160rpx);
}
.showMobile {
font-size: 24rpx;
text-align: left;
padding-left: 30rpx;
color: #999999;
padding-bottom: 20rpx;
}
.teacher {
width: 100%;
background-color: #FFFFFF;
@ -135,10 +155,10 @@
margin-bottom: 30rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 20rpx;
display: flex;
align-items: center;
border-radius: 20rpx;
display: flex;
align-items: center;
&-name {
font-size: 32rpx;
@ -148,23 +168,24 @@
.courseName {
color: #b89155;
margin: 0 20rpx;
font-size: 24rpx;
border-radius: 0rpx 28rpx 28rpx 28rpx;
color: #fff;
padding:0rpx 15rpx;
font-size: 24rpx;
border-radius: 0rpx 28rpx 28rpx 28rpx;
color: #fff;
padding: 0rpx 15rpx;
background: #b89155;
}
}
&-mobile {
display: flex;
align-items: center;
color:#666666;
font-size: 28rpx;
margin-bottom: 10rpx;
}
&-company{
margin-bottom: 10rpx;
&-mobile {
display: flex;
align-items: center;
color: #666666;
font-size: 28rpx;
margin-bottom: 10rpx;
}
&-company {
margin-bottom: 10rpx;
}
}

@ -8,7 +8,7 @@
</view>
<view class="wrap-btn">
<image @click="toUrl(1)" :src="base.imgHost('mycourse-icon1.png')"></image>
<image @click="toUrl(2)" :src="base.imgHost('mycourse-icon2.png')"></image>
<image v-if="info.course?info.course.show_txl:1" @click="toUrl(2)" :src="base.imgHost('mycourse-icon2.png')"></image>
<image @click="toUrl(3)" :src="base.imgHost('mycourse-icon3.png')"></image>
<image @click="toUrl(4)" :src="base.imgHost('mycourse-icon4.png')"></image>
</view>
@ -56,8 +56,10 @@
return
}
}
console.log("detail-mobile",this.info.course.show_mobile)
// return
uni.navigateTo({
url:'/packages/mycourse/courseTxl?id='+this.course_id
url:'/packages/mycourse/courseTxl?id='+this.course_id+"&show_mobile="+this.info.course.show_mobile
})
}else if(type===3){
if(this.info.course.is_arrange!=1){

@ -2,52 +2,65 @@
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="wrap">
<topBanner v-if="banner_list.length>0" :banner_list="banner_list"></topBanner>
<topBanner v-if="banner_list.length>0" :banner_list="banner_list"></topBanner>
<view class="list">
<view>
<view v-if="list.length>0">
<view class="list-item" v-for="item in list">
<view class="list-item-status">
<view :class="{'list-item-status-text':item.course_status===10,'list-item-status-textEnd':item.course_status!=10}">{{item.date_status}}</view>
<view :class="{
'list-item-status-status':item.course_signs[0]['status']===0||item.course_signs[0]['status']===3,
'list-item-status-statusSuccess':item.course_signs[0]['status']===1,
'list-item-status-statusFail':item.course_signs[0]['status']===2
}">{{item.course_signs[0]['status_text']==='备选'?'待审核':item.course_signs[0]['status_text']}}</view>
<view class="list-item" v-for="item in list">
<view class="list-item-status">
<view
:class="{'list-item-status-text':item.course_status===10,'list-item-status-textEnd':item.course_status!=10}">
{{item.date_status}}</view>
<block v-for="state in statusList">
<view :class="state.class" v-if="state.id===item.course_signs[0]['status']">
{{state.text}}
</view>
</block>
<!-- <view :class="{
'list-item-status-status':item.course_signs[0]['status']===0||item.course_signs[0]['status']===3,
'list-item-status-statusSuccess':item.course_signs[0]['status']===1,
'list-item-status-statusFail':item.course_signs[0]['status']===2
}">{{item.course_signs[0]['status_text']==='备选'?'待审核':item.course_signs[0]['status_text']}}</view> -->
</view>
<view class="list-item-name">
<view>
<image :src="base.imgHost('me-icon1.png')"></image>
<text>
<block v-if="item.type">{{item.type_detail?item.type_detail.name+' | ':''}}</block>
{{item.name}}
</text>
</view>
<view>
<image :src="base.imgHost('mybook-icon3.png')"></image>
<text>开课日期{{item.start_date?item.start_date:'待定'}}</text>
</view>
<view class="list-item-name">
<view>
<image :src="base.imgHost('me-icon1.png')"></image>
<text>
<block v-if="item.type">{{item.type_detail?item.type_detail.name+' | ':''}}
</block>
{{item.name}}
</text>
</view>
<view>
<image :src="base.imgHost('mybook-icon3.png')"></image>
<text>开课日期{{item.start_date?item.start_date:'待定'}}</text>
</view>
</view>
<view class="list-item-buttom">
<view>
<u-button v-if="item.course_status===10" size="mini" :custom-style="{'color':'#b79373',
<u-button v-if="item.course_status===10" size="mini" :custom-style="{'color':'#b79373',
'border-color':'transparent','font-size': '26rpx',
'padding': 0}" :hair-line="false" @click="clickShareId(item)" shape="circle" open-type="share">
<image :src="base.imgHost('mycourse-share.png')"></image>
<text>分享</text>
</u-button>
</view>
<view class="list-item-btn">
<text @click="toUrl(item.id,3)" v-if="item.course_signs[0]['status']===1 && item.is_fee===0"></text>
<text @click="toUrl(item.id,1)" v-if="item.course_signs[0]['status']===1 && item.is_fee===1"></text>
<text @click="toUrl(item.id,2)" v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3"></text>
<text @click="toUrl(item.id,2)" v-if="item.course_signs[0]['status']===2"></text>
<view class="list-item-btn">
<text @click="toUrl(item.id,3)"
v-if="item.course_signs[0]['status']===1 && item.is_fee===0">进入</text>
<text @click="toUrl(item.id,1)"
v-if="item.course_signs[0]['status']===1 && item.is_fee===1">进入</text>
<!-- 待审核 备选 -->
<text @click="cancelSign(item)" style="margin-right:20rpx;color:#999999"
v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3">取消报名</text>
<text @click="toUrl(item.id,2)"
v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3">查看进度</text>
<!-- 审核不通过 -->
<text @click="toUrl(item.id,2)" v-if="item.course_signs[0]['status']===2"></text>
</view>
</view>
</view>
</view>
</view>
</view>
@ -67,7 +80,36 @@
banner_list: [],
list: [],
historyList: [],
shareObj: {}
shareObj: {},
statusList: [{
id: 0,
text: '待审核',
class: 'list-item-status-status'
}, {
id: 1,
text: '审核通过',
class: 'list-item-status-statusSuccess'
}, {
id: 2,
text: '审核不通过',
class: 'list-item-status-statusFail'
}, {
id: 3,
text: '待审核',
class: 'list-item-status-status'
}, {
id: 4,
text: '已取消',
class: 'list-item-status-statusFail'
}, {
id: 5,
text: '已放弃',
class: 'list-item-status-statusFail'
}, {
id: 6,
text: '审核不通过',
class: 'list-item-status-statusFail'
}]
}
},
onShareAppMessage(res) {
@ -100,38 +142,58 @@
},
methods: {
async getMyCourse() {
const res = await this.$u.api.courseMy()
const res = await this.$u.api.courseMy()
this.list = res.list.data
},
clickShareId(item) {
this.shareObj = item
},
toUrl(id,type) {
//
if(type===1){
uni.navigateTo({
url: '/packages/mycourse/detail?id=' + id
})
}else if(type===2){
//
uni.navigateTo({
url: '/packages/mycourse/courseStatus?id=' + id
})
}else if(type===3){
//
uni.navigateTo({
url: '/packages/course/freeDetail?id=' + id
})
toUrl(id, type) {
//
if (type === 1) {
uni.navigateTo({
url: '/packages/mycourse/detail?id=' + id
})
} else if (type === 2) {
//
uni.navigateTo({
url: '/packages/mycourse/courseStatus?id=' + id
})
} else if (type === 3) {
//
uni.navigateTo({
url: '/packages/course/freeDetail?id=' + id
})
}
},
//
cancelSign(item) {
let that = this
uni.showModal({
title: '取消报名',
content: '取消后将无法再次报名本期课程,请确认后再提交',
success: function(res) {
if (res.confirm) {
that.submitCancel(item)
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
submitCancel(item){
console.log("item",item)
},
async getBannerList() {
const res = await this.$u.api.otherBanner({
position: 2
})
if(res.length>0){
this.banner_list = res.sort((a,b)=>{a.sort-b.sort})
if (res.length > 0) {
this.banner_list = res.sort((a, b) => {
a.sort - b.sort
})
}
},
}
@ -144,6 +206,7 @@
padding: 30rpx;
width: 100%;
height: 100vh;
padding-top: 0;
.cbg {
position: absolute;
@ -173,63 +236,75 @@
padding: 30rpx;
margin-bottom: 30rpx;
border-radius: 20rpx;
// border-bottom: 2px solid #b79373
// border-bottom: 2px solid #b79373
box-shadow: 0 -1rpx 20rpx #bed2ec;
&-status{
display: flex;
justify-content: space-between;
align-items: center;
font-size:28rpx;
padding-bottom:20rpx;
border-bottom: 1px solid #f5f5f5;
&>view:last-child{
padding:5rpx 20rpx;
border-radius: 28rpx 0 28rpx 28rpx;
color:#fff;
}
&-text{
color:#b08c6c;
font-size:28rpx;
}
&-textEnd{
color:#999;
font-size:28rpx;
}
&-status{
background-color: #bf976e;
font-size:24rpx;
}
&-statusSuccess{
background-color: #00b318;
font-size:24rpx;
}
&-statuFail{
background-color: #999999;
font-size:24rpx;
}
&-status {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
padding-bottom: 20rpx;
border-bottom: 1px solid #f5f5f5;
&>view:last-child {
padding: 5rpx 20rpx;
border-radius: 28rpx 0 28rpx 28rpx;
color: #fff;
}
&-text {
color: #b08c6c;
font-size: 28rpx;
}
&-textEnd {
color: #999;
font-size: 28rpx;
}
&-status {
background-color: #bf976e;
font-size: 24rpx;
}
&-statusSuccess {
background-color: #00b318;
font-size: 24rpx;
}
&-statusFail {
background-color: #999999;
font-size: 24rpx;
}
}
&-name {
padding:20rpx 0;
border-bottom: 1px solid #f5f5f5;
&>view{
display: flex;
justify-content: space-between;
align-items: baseline;
font-size:28rpx;
image{
width:24rpx;
height:24rpx;
margin-right:20rpx;
}
text{
display: inline-block;
width:calc(100% - 44rpx);
font-size: 28rpx;
line-height: 1.5;
}
}
&>view:first-child{
margin-bottom:20rpx;
&-name {
padding: 20rpx 0;
border-bottom: 1px solid #f5f5f5;
&>view {
display: flex;
justify-content: space-between;
align-items: baseline;
font-size: 28rpx;
image {
width: 24rpx;
height: 24rpx;
margin-right: 20rpx;
}
text {
display: inline-block;
width: calc(100% - 44rpx);
font-size: 28rpx;
line-height: 1.5;
}
}
&>view:first-child {
margin-bottom: 20rpx;
}
}
@ -256,8 +331,8 @@
}
}
&-btn {
color:#b08c6c;
&-btn {
color: #b08c6c;
// background: linear-gradient(to right, #5e5fbc, #0d0398);
// border-radius: 30rpx;
// color: #fff;

@ -95,7 +95,7 @@
},{
"path": "mycourse/courseContents",
"style": {
"navigationBarTitleText": "课表"
"navigationBarTitleText": "本班课表"
}
},{
"path": "mycourse/courseTxl",

@ -1,9 +1,14 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('book-bg.png')"></image>
<image class="schoolmate" @click="toUrl(2)" :src="base.imgHost('book-schoolmate.png')"></image>
<image class="book" @click="toUrl(1)" :src="base.imgHost('book-book.png')"></image>
<image class="cbg" :src="base.imgHost('book-bg.png')"></image>
<view class="schoolmate btn">
<image mode="widthFix" @click="toUrl(2)" :src="base.imgHost('book-schoolmate1.png')"></image>
<view>加入我们</view>
</view>
<view class="book btn">
<image mode="widthFix" @click="toUrl(1)" :src="base.imgHost('book-book1.png')"></image>
<view>立即预约</view>
</view>
<tabbar :currentPage="2"></tabbar>
</view>
</template>
@ -96,19 +101,29 @@
width: 100%;
height: 100vh;
}
.schoolmate{
width:367rpx;
height:186rpx;
.btn{
width:320rpx;
// height:136rpx;
position: absolute;
image{
width:100%;
height:100%;
}
view{
text-align: center;
margin-top:10rpx;
color:#806e5c;
font-size:30rpx;
}
}
.schoolmate{
top: 300rpx;
left: 30rpx;
left: 40rpx;
}
.book{
width:367rpx;
height:186rpx;
position: absolute;
bottom: 300rpx;
right: 30rpx;
right: 40rpx;
}

@ -207,7 +207,7 @@
const endyear = parseInt(enddateParts[0], 10);
const endmonthNumber = parseInt(enddateParts[1], 10);
const endday = parseInt(enddateParts[2], 10);
console.log(endmonthNumber, chineseMonths)
// console.log(endmonthNumber, chineseMonths)
const endchineseMonth = chineseMonths[endmonthNumber - 1];
return {
year: year,

@ -4,24 +4,40 @@
<view class="wrap">
<view class="me">
<image class="me-top" :src="base.imgHost('me-top.png')"></image>
<view @click="toUrl(1)" class="me-wrap">
<view class="me-wrap">
<view class="me-name">
<image :src="base.imgHost('me-logo.png')"></image>
<image mode="widthFix" :src="base.imgHost('login-logo.png')"></image>
<view>
<view>
{{userInfo.username?userInfo.username:'-'}}
<view class="userinfo">
<view class="usersigns">
<text>姓名</text>
<text>{{userInfo.username?userInfo.username:'-'}}</text>
</view>
<view class="usersigns" v-if="course_signs.length>0">
<text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</view>
</view>
<view>
{{userInfo.mobile?userInfo.mobile:''}}
<view class="usercode">
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="userInfo.code" :sizeUnit="'rpx'"
:size="160" :options="{
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view>
</view>
</view>
<u-icon name="arrow-right" size="32" color="#fff"></u-icon>
</view>
</view>
<view class="menu">
<view @click="refreshCode">
<view>
<image :src="base.imgHost('me-icon3.png')" style="width:51rpx;height:46rpx;"></image>
<text>电子校友卡</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
<view @click="toUrl(2)">
<view>
<image :src="base.imgHost('me-icon1.png')" style="width:52rpx;height:48rpx;"></image>
@ -36,10 +52,17 @@
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
<view @click="refreshCode">
<view @click="toUrl(5)">
<view>
<image :src="base.imgHost('me-icon3.png')" style="width:51rpx;height:46rpx;"></image>
<text>电子校园卡</text>
<image :src="base.imgHost('me-icon6.png')" style="width:47rpx;height:50rpx;"></image>
<text>我要捐赠</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
<view @click="toUrl(1)">
<view>
<image :src="base.imgHost('me-icon7.png')" style="width:48rpx;height:52rpx;"></image>
<text>个人信息</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
@ -64,45 +87,50 @@
<view class="modal-wrap" v-if="showCard">
<view class="modal-image">
<view class="modal-close" @click="showCard = false">X</view>
<image mode="heightFix" :src="base.imgHost('me-xyk.png')"></image>
<image mode="widthFix" :src="base.imgHost('me-xyk.png')"></image>
</view>
<view class="modal-xyk">
<view>
<view style="margin-bottom:40rpx;text-align: center;">电子校园卡</view>
<view class="modal-xyk-between">
<view class="modal-xyk-item">
<view style="display: flex;justify-content: center;" @click="refreshCode">
<uqrcode ref="uqrcode" canvas-id="qrcode" value="123" :sizeUnit="'rpx'" :size="200"
:options="{
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view>
<view @click="refreshCode" style="margin-top:20rpx;font-size:24rpx">点击二维码刷新</view>
</view>
<view class="modal-xyk-item modal-xyk-name">
<view>
<text>姓名</text>
<text>{{userInfo.username}}</text>
</view>
<view v-if="userInfo.course_signs.length>0">
<text>学籍</text>
<text class="courseName">{{userInfo.course_signs[0]['course'].name}}</text>
</view>
</view>
<view>
<!-- <view style="margin-bottom:40rpx;text-align: center;">电子校园卡</view> -->
<view class="modal-xyk-between">
<view class="modal-xyk-item">
<view style="display: flex;justify-content: center;" @click="refreshCode">
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="userInfo.code" :sizeUnit="'rpx'"
:size="160" :options="{
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view>
</view>
<view class="modal-xyk-item modal-xyk-name">
<view class="modal-xyk-name-course">
<text>姓名</text>
<text>{{userInfo.username}}</text>
</view>
<view class="modal-xyk-name-course" v-if="course_signs.length>0">
<text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</view>
</view>
</view>
<view class="modal-xyk-item-reload" @click="refreshCode">
<image :src="base.imgHost('me-reload.png')"></image>
<view>点击二维码刷新</view>
</view>
</view>
</view>
</view>
<!-- 公众号 -->
<view class="modal-wrap" v-if="showGzh">
<view class="modal-image">
<view class="modal-image" style="height:68%;text-align: center;">
<view class="modal-close" @click="showGzh = false">X</view>
<image mode="heightFix" show-menu-by-longpress :show-menu-by-longpress="true" :src="base.imgHost('me-gzh.png')"></image>
<image mode="heightFix" style="height:100%" show-menu-by-longpress :show-menu-by-longpress="true"
:src="base.imgHost('me-gzh.png')"></image>
</view>
</view>
<!-- 进入后没有手机号的话 绑定 或者 注册 -->
@ -143,8 +171,9 @@
type: 'register',
showGzh: false,
showCard: false,
userInfo: {},
hasMobile:false
userInfo: {},
hasMobile: false,
course_signs: []
}
},
onShareAppMessage() {
@ -165,11 +194,11 @@
},
onLoad() {},
methods: {
refreshCode() {
if(!this.hasMobile){
this.base.toast("请先绑定或注册")
this.showRegister = true
return
refreshCode() {
if (!this.hasMobile) {
this.base.toast("请先绑定或注册")
this.showRegister = true
return
}
this.showCard = true
this.$refs.uqrcode.make({
@ -181,16 +210,14 @@
}
});
},
toUrl(type) {
if(type===1 || type===2 || type===3){
if(!this.hasMobile){
this.base.toast("请先绑定或注册")
this.showRegister = true
return
}
}
toUrl(type) {
if (type === 1 || type === 2 || type === 3) {
if (!this.hasMobile) {
this.base.toast("请先绑定或注册")
this.showRegister = true
return
}
}
if (type === 1) {
uni.navigateTo({
url: '/packages/my/index'
@ -207,6 +234,10 @@
uni.navigateTo({
url: '/packages/webview/index?type=4'
})
} else if (type === 5) {
// uni.navigateTo({
// url: '/packages/webview/index?type=4'
// })
}
},
getUserInfo() {
@ -214,11 +245,12 @@
console.log("res", res)
this.$u.vuex('vuex_user', res.user)
this.userInfo = res.user
this.course_signs = res.user.course_signs ? res.user.course_signs : []
if (this.base.isNull(res.user.mobile)) {
this.showRegister = true
this.showRegister = true
this.hasMobile = false
} else {
this.showRegister = false
this.showRegister = false
this.hasMobile = true
}
})
@ -274,24 +306,52 @@
justify-content: space-between;
align-items: center;
position: absolute;
top: 120rpx;
top: 0rpx;
left: 0;
padding: 0 30rpx;
padding: 30rpx;
width: 100%;
}
&-name {
display: flex;
align-items: center;
width: 100%;
color: #fff;
font-size: 32rpx;
padding: 0 20rpx;
image {
width: 110rpx;
height: 110rpx;
margin-right: 20rpx;
width: 200rpx;
margin-bottom: 30rpx;
// height: 110rpx;
// margin-right: 20rpx;
}
color: #fff;
font-size: 32rpx;
&>view {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
.userinfo {
width: calc(100% - 200rpx);
line-height: 1.5;
}
.usersigns {
display: flex;
&>text:first-child {
width: 100rpx;
}
&>text:last-child {
width: calc(100% - 100rpx);
}
}
.usercode {
width: 160rpx;
}
}
}
}
@ -376,7 +436,7 @@
left: 0;
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.6);
background-color: rgba(0, 0, 0, 0.8);
.modal-close {
width: 80rpx;
@ -384,10 +444,10 @@
text-align: center;
line-height: 80rpx;
color: #fff;
background: rgba(0, 0, 0, 0.5);
background: #6e6e77;
border-radius: 80rpx;
position: absolute;
top: 0rpx;
top: -90rpx;
right: 0rpx;
}
@ -396,7 +456,8 @@
top: 48%;
left: 50%;
transform: translate(-50%, -50%);
height: 60%;
// height: 60%;
width: calc(100% - 60rpx);
&>image {
width: 100%;
@ -408,10 +469,10 @@
.modal-xyk {
position: absolute;
top: 55%;
top: 57%;
left: 50%;
transform: translate(-50%, -50%);
height: 70%;
// height: 70%;
color: #fff;
width: 100%;
display: flex;
@ -420,28 +481,59 @@
justify-content: center;
&>view {
width: 70%;
width: 100%;
padding: 30rpx;
}
&-between{
display: flex;
justify-content: space-between;
// align-items: center;
padding:20rpx;
&-between {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 60rpx;
}
&-item {
margin-bottom: 60rpx;
width:200rpx;
margin-right:20rpx;
// margin-bottom: 60rpx;
width: 160rpx;
margin-right: 60rpx;
&>view {
text-align: center;
}
&-reload {
display: flex;
align-items: center;
padding: 10rpx 40rpx;
font-size:24rpx;
image {
width: 27rpx;
height: 25rpx;
margin-right: 10rpx;
}
}
}
&-name {
width: calc(100% - 220rpx);
margin-right:0;
margin-right: 0;
&>view {
text-align: left;
margin-bottom: 20rpx;
}
&-course {
display: flex;
&>text:first-child {
width: 100rpx;
}
&>text:last-child {
width: calc(100% - 100rpx);
}
}
}
}

Loading…
Cancel
Save