123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- <template>
- <view>
- <!-- <image mode="widthFix" style="width: 100%;" :src="post" v-if="post"></image> -->
- <view class="topBg" :style="'background-image:url('+$getImageUrl('static/images/applet/bg/course.png')+');'">
- <image class="topBg-image" :src="$getImageUrl('static/images/applet/index/hotRighrOne.png')"></image>
- </view>
- <view class="topArea">
- <button class="topArea-btn" @tap="addTrain">添加培训意愿</button>
- </view>
- <view class="course">
- <view class="courseCard" v-for="(item,index) in plist" :key="index">
- <!-- <view class="courseLeft"></view> -->
- <view class="courseRight" :class="index % 2 != 0 ? 'greenBorder' : 'redBorder'">
- <view class="courseCard-header">
- <view class="header-title">{{item.train.title}}</view>
- <image class="header-icon" :src="$getImageUrl('static/images/applet/index/applyCancel.png')" mode="widthFix"
- @tap="delJoin(index, item.id)">
- </image>
- </view>
- <view class="courseCard-item">{{item.train.contact}}</view>
- <view class="courseCard-item">{{item.train.mobile}}</view>
- <view class="courseCard-item">{{item.train.address}}</view>
- </view>
- </view>
- </view>
- <view class="padding flex flex-direction" v-if="false">
- <button class="cu-btn bg-green margin-tb-sm lg" @tap="addTrain">添加培训意愿</button>
- </view>
- <block v-for="(item,index) in plist" :key="index" v-if="false">
- <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item padding-top-sm padding-lr-sm radius">
- <view class="cu-item shadow padding-top-sm padding-bottom">
- <view class="padding-lr flex justify-between align-center">
- <view class="basis-lg text-bold text-lg text-cut">{{item.train.title}}</view>
- <view class="basis-sm text-cut text-right text-gray text-sm">
- <view class="basis-xs text-cut text-right text-red text-sm" @tap="delJoin(index, item.id)">
- 取消报名</view>
- </view>
- </view>
- <view class="padding-lr flex justify-between align-bottom">
- <view class="basis-lg text-bold text-df text-cut">
- <view class="text-gray">{{item.train.contact}}</view>
- </view>
- <view class="basis-sm text-cut text-right text-gray text-sm">
- {{item.train.mobile}}
- </view>
- </view>
- <view class="padding-lr padding-tb-xs text-cut">
- <view class="basis-sm text-cut text-left text-gray text-sm">{{item.train.address}}</view>
- </view>
- </view>
- </view>
- </block>
- <uni-load-more :status="pstatus"></uni-load-more>
- </view>
- </template>
- <script>
- import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
- var _this;
- export default {
- components: {
- uniLoadMore
- },
- data() {
- return {
- userinfo: {},
- pstatus: 'more',
- ppage: 1,
- psize: 20,
- plist: [],
- post: "",
- };
- },
- onLoad: function() {
- _this = this;
- _this.userinfo = _this.checkLogin("/pages/train/joinlist");
- if (_this.userinfo === false) {
- return false;
- }
- _this.$req.ajax({
- path: "index/getConfig",
- data: {
- code: "train_post"
- }
- }).then((data) => {
- _this.post = data;
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
- onShow: function() {
- _this.ppage = 1;
- _this.pstatus = 'more';
- _this.plist = [];
- _this.getMore();
- },
- onPullDownRefresh: function() {
- _this.ppage = 1;
- _this.pstatus = 'more';
- _this.plist = [];
- _this.getMore();
- },
- onReachBottom: function() {
- if (_this.pstatus !== 'more') {
- return;
- }
- _this.getMore();
- },
- methods: {
- delJoin: function(index, id) {
- uni.showModal({
- title: '温馨提示',
- content: '确定要取消吗?',
- success(res) {
- if (res.confirm) {
- _this.$req.ajax({
- path: "train/deljoin",
- data: {
- id: id,
- userid: _this.userinfo.id
- }
- }).then((data) => {
- _this.plist.splice(index, 1);
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- }
- }
- });
- },
- getMore: function() {
- _this.$req.ajax({
- path: "train/joinlist",
- data: {
- ppage: _this.ppage,
- psize: _this.psize,
- userid: _this.userinfo.id
- }
- }).then((data) => {
- _this.pstatus = data.pstatus;
- _this.plist = _this.plist.concat(data.plist);
- _this.ppage += 1;
- uni.stopPullDownRefresh();
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
- addTrain: function() {
- uni.navigateTo({
- url: '/pages/train/list'
- });
- }
- }
- }
- </script>
- <style lang="scss">
- .topBg {
- height: 266rpx;
- padding-right: 54rpx;
- background-size: cover;
- background-position: center;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .topBg-image {
- width: 192rpx;
- height: 170rpx;
- }
- }
- .topArea {
- margin-top: 40rpx;
- padding: 0 26rpx;
- .topArea-btn {
- height: 90rpx;
- line-height: 90rpx;
- border-radius: 10rpx;
- background-color: #CA151C;
- color: #FFFFFF;
- font-size: 33rpx;
- }
- }
- .course {
- margin-top: 48rpx;
- padding: 0 26rpx;
- .courseCard {
- margin-bottom: 26rpx;
- // height: 276rpx;
- background-color: #FFFFFF;
- border-radius: 12rpx;
- display: flex;
- overflow: hidden;
- // .courseLeft {
- // width: 8rpx;
- // height: 100%;
- // background-color: #009600;
- // }
-
- .greenBorder {
- border-left: 5px solid #009600;
- }
-
- .redBorder {
- border-left: 5px solid #CA151C;
- }
- .courseRight {
- flex: 1;
- padding: 22rpx 48rpx;
- font-size: 28rpx;
- color: #747474;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
-
- .courseCard-header {
- // margin-bottom: 10rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .header-title {
- width: 70%;
- font-size: 40rpx;
- font-weight: 600;
- color: #383838;
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-line-clamp: 1;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- }
- .header-icon {
- width: 144rpx;
- }
- }
- .courseCard-item {
- margin-top: 25rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-line-clamp: 1;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- }
- }
- }
- }
- </style>
|