|
@@ -11,9 +11,9 @@
|
|
<view class="title">
|
|
<view class="title">
|
|
培训详情
|
|
培训详情
|
|
</view>
|
|
</view>
|
|
- <!-- <view class="picture">
|
|
|
|
- <img src="@/assets/img/traniningPicture.png" alt="">
|
|
|
|
- </view> -->
|
|
|
|
|
|
+ <view class="picture" v-if="info.thumbnailImage">
|
|
|
|
+ <img :src="info.thumbnailImage" alt="">
|
|
|
|
+ </view>
|
|
<!-- 详细信息 -->
|
|
<!-- 详细信息 -->
|
|
<view class="details" v-html="info.content">
|
|
<view class="details" v-html="info.content">
|
|
|
|
|
|
@@ -45,7 +45,11 @@
|
|
|
|
|
|
<!-- 报名按钮 -->
|
|
<!-- 报名按钮 -->
|
|
<view class="bottom">
|
|
<view class="bottom">
|
|
- <button class="sign-up">我要报名</button>
|
|
|
|
|
|
+ <button class="sign-up" v-if="getStatus()" :class="{
|
|
|
|
+ isJoin:isJoin
|
|
|
|
+ }" @click="isJoinBtn" >{{isJoin?'取消报名':'我要报名'}}</button>
|
|
|
|
+ <button class="sign-up isEnd" v-else style="background: #999999;">已结束</button>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -56,6 +60,7 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
id: "",
|
|
id: "",
|
|
|
|
+ isJoin: false,
|
|
info: {
|
|
info: {
|
|
|
|
|
|
},
|
|
},
|
|
@@ -66,16 +71,150 @@
|
|
this.getInfo()
|
|
this.getInfo()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getInfo(bl) {
|
|
|
|
|
|
+ getStatus(){
|
|
|
|
+ if(this.info&&this.info.endTime){
|
|
|
|
+ return new Date()<new Date(this.info.endTime)
|
|
|
|
+ }
|
|
|
|
+ return true
|
|
|
|
+ },
|
|
|
|
+ cancelTrainingBtn(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中",
|
|
|
|
+ mask: true,
|
|
|
|
+ })
|
|
|
|
+ API.cancelTraining({
|
|
|
|
+ trainingId: this.id,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.isJoin = false;
|
|
|
|
+ //this.info=res.data.recruitInformationInfo;
|
|
|
|
+
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "取消成功!",
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({icon: 'none',
|
|
|
|
+ title: error,
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ isJoinBtn() {
|
|
|
|
+ if(this.getStatus()){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.isJoin) {
|
|
|
|
+ this.cancelTrainingBtn()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ var user = this.carhelp.getPersonInfo();
|
|
|
|
+
|
|
|
|
+ if (!user) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '登录并实名认证创建简历后可以报名',
|
|
|
|
+ confirmText: "前往登录",
|
|
|
|
+ showCancel: true,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/tab/mine/mine'
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (user.status != 1) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '实名认证并创建简历后可以报名',
|
|
|
|
+ confirmText: "实名认证",
|
|
|
|
+ showCancel: true,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/packages/mine/otherServices/authentication'
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ var jobInformationInfo = this.carhelp.getPersonInfoPlus().jobInformationInfo;
|
|
|
|
+ if (!user) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '创建简历后可以报名',
|
|
|
|
+ confirmText: "创建简历",
|
|
|
|
+ showCancel: true,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/packages/mine/myJobInformation/myJobInformation'
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中",
|
|
|
|
+ mask: true,
|
|
|
|
+ })
|
|
|
|
+ API.joinTraining({
|
|
|
|
+ trainingId: this.id,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.isJoin = true;
|
|
|
|
+ //this.info=res.data.recruitInformationInfo;
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '报名成功',
|
|
|
|
+ showCancel: false,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+
|
|
|
|
+ //uni.navigateBack()
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({icon: 'none',
|
|
|
|
+ title: error,
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getInfo() {
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
title: "加载中",
|
|
mask: true,
|
|
mask: true,
|
|
})
|
|
})
|
|
API.trainingDetail({
|
|
API.trainingDetail({
|
|
- id: this.id,
|
|
|
|
|
|
+ trainingId: this.id,
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
- this.info=res.data.trainingInfo;
|
|
|
|
|
|
+
|
|
|
|
+ this.isJoin = res.data.isJoin;
|
|
|
|
+ var newsDetail=res.data.trainingInfo;
|
|
|
|
+ if(newsDetail.content){
|
|
|
|
+ newsDetail.content=newsDetail.content.replaceAll('alt','width="100%" height="100%" /> <p')
|
|
|
|
+ }
|
|
|
|
+ this.info=newsDetail
|
|
|
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
uni.showToast({icon: 'none',
|
|
uni.showToast({icon: 'none',
|
|
@@ -189,7 +328,8 @@
|
|
bottom: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
left: 0;
|
|
right: 0;
|
|
right: 0;
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
.sign-up {
|
|
.sign-up {
|
|
|
|
|
|
height: 96rpx;
|
|
height: 96rpx;
|
|
@@ -200,5 +340,8 @@
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
+ .isJoin {
|
|
|
|
+ background-color: #19be6d;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|