diff --git a/packageA/my/pendinPayDetail.vue b/packageA/my/pendinPayDetail.vue index ffc4847..1d59c94 100644 --- a/packageA/my/pendinPayDetail.vue +++ b/packageA/my/pendinPayDetail.vue @@ -987,7 +987,7 @@ border-radius: 44rpx; .third-top{ font-family: PingFang SC, PingFang SC; - font-weight: 400; + font-weight: 700; font-size: 36rpx; color: #323232; line-height: 50rpx; diff --git a/packageA/my/success.vue b/packageA/my/success.vue new file mode 100644 index 0000000..2b60085 --- /dev/null +++ b/packageA/my/success.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/pages.json b/pages.json index 33326de..284d4e4 100644 --- a/pages.json +++ b/pages.json @@ -45,12 +45,6 @@ "navigationStyle": "custom" //单个页面设置 } }, - { - "path": "pages/center/list", - "style": { - "navigationBarTitleText": "选课中心" - } - }, { "path": "pages/center/detail", "style": { @@ -58,13 +52,7 @@ "navigationStyle": "custom" //单个页面设置 } }, - - { - "path": "pages/center/teacherDetail", - "style": { - "navigationBarTitleText": "教师详情" - } - }, + { "path": "pages/center/MechanismDetail", "style": { @@ -203,6 +191,12 @@ "navigationBarTitleText": "活动核销" } }, + { + "path": "my/success", + "style": { + "navigationBarTitleText": "报名成功" + } + }, { "path": "my/Collect", "style": { diff --git a/pages/center/applyDetail.vue b/pages/center/applyDetail.vue index fd6596d..d160c6c 100644 --- a/pages/center/applyDetail.vue +++ b/pages/center/applyDetail.vue @@ -632,7 +632,7 @@ complete: function() { setTimeout(function() { uni.redirectTo({ - url: "/packageA/my/exercise?status=" + "2,3" + url: "/packageA/my/success?status=" + "2,3" }) }, 2000); } @@ -672,7 +672,7 @@ if (res.errMsg == "requestPayment:ok") { that.order_no = '' uni.redirectTo({ - url: "/packageA/my/exercise?status=" + '2,3' + url: "/packageA/my/success?status=" + '2,3' }) console.log('支付成功', res) } else { diff --git a/pages/center/detail.vue b/pages/center/detail.vue index 0f9d71c..eaedd42 100644 --- a/pages/center/detail.vue +++ b/pages/center/detail.vue @@ -21,8 +21,8 @@ 元/人 - - 免费 + + 免费 @@ -32,7 +32,7 @@ - + {{ detail.user.nickname }} @@ -64,7 +64,7 @@ :maxCount="3"> + style="width: 58rpx;height: 58rpx;margin-left:-20rpx;z-index: 1;"> {{ detail.join_info.people_number }}/{{ detail.join_info.stock >= 10000 ? '9999+' : detail.join_info.stock}} @@ -195,8 +195,10 @@ + + - + + + + + + + + + + + + + + + + + + + + + + + + - 保 存 海 报 - + + + + 保存图片 + + + @@ -251,12 +312,12 @@ import { } from '../../utils/dateFormat' export default { computed: { - formattedTitle() { - if (this.detail.title.length > 9) { - return this.detail.title.slice(0, 9) + '..'; - } - return this.detail.title; - }, + // formattedTitle() { + // if (this.detail.title.length > 9) { + // return this.detail.title.slice(0, 9) + '..'; + // } + // return this.detail.title; + // }, formattedTimeList() { return this.timeList.map(item => { const startTime = dayjs.unix(item.start_time).format('YYYY-MM-DD HH:mm:ss'); @@ -302,7 +363,7 @@ export default { PayPirce: 0, detail: {}, people: {}, - qrUrl: '', + qrUrl: null, is_collect: 0, popupStyle: { width: '690rpx', @@ -367,26 +428,54 @@ export default { }, methods: { - capturePage() { - let that = this; - uni.canvasToTempFilePath({ - x: 0, // 起始x坐标(可选) - y: 0, // 起始y坐标(可选) - width: uni.upx2px(750), // 宽度(单位px) - height: uni.upx2px(1334), // 高度(单位px) - destWidth: 750, // 目标图片宽度(可选) - destHeight: 1334, // 目标图片高度(可选) - canvasId: 'myCanvas', // Canvas组件的id - success: function (res) { - console.log('tempFilePath:', res.tempFilePath); // 图片路径信息输出到控制台或进行其他处理 - uni.previewImage({ urls: [res.tempFilePath] }); - that.save(res.tempFilePath); - }, - fail: function (err) { - console.error(err); // 输出错误信息到控制台进行调试 - } - }); - }, + // saveClick() { + // console.log('saveClick') + // // 生成图片 + // this.$refs.painter.canvasToTempFilePathSync({ + // fileType: "jpg", + // // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url + // pathType: 'url', + // quality: 0.9, + // success: (res) => { + // console.log(res.tempFilePath); + // // 非H5 保存到相册 + // wx.saveImageToPhotosAlbum({ + // filePath: res.tempFilePath, + // success: function() { + // uni.showToast({ + // title: '图片已保存' + // }) + // }, + // fail:function(){ + // uni.showToast({ + // icon: 'error', + // title: '图片保存失败' + // }) + // } + // }); + // }, + // }); + // }, + + // capturePage() { + // let that = this; + // uni.canvasToTempFilePath({ + // x: 0, // 起始x坐标(可选) + // y: 0, // 起始y坐标(可选) + // width: uni.upx2px(750), // 宽度(单位px) + // height: uni.upx2px(1334), // 高度(单位px) + // destWidth: 750, // 目标图片宽度(可选) + // destHeight: 1334, // 目标图片高度(可选) + // canvasId: 'myCanvas', // Canvas组件的id + // success: function (res) { + // console.log('tempFilePath:', res.tempFilePath); // 图片路径信息输出到控制台或进行其他处理 + // that.save(res.tempFilePath); + // }, + // fail: function (err) { + // console.error(err); // 输出错误信息到控制台进行调试 + // } + // }); + // }, // 返回首页 goHome() { if (this.isShare == 1) { @@ -401,11 +490,27 @@ export default { overlayShow() { const token = uni.getStorageSync('token') if (token) { - this.overlay = true - // uni.showToast({ - // title: '开发中,暂未开放', - // icon: 'none' - // }); + + if(this.path == ''){ + let that = this; + uni.showToast({ + title: '海报生成中,请稍等', + icon: 'none', + duration: 2000, + complete: function () { + // 提示框消失后的回调函数 + setTimeout(() => { + // 这里写你的后续操作代码 + that.overlay = true; + }, 1000); + } + }); + + }else{ + this.overlay = true; + } + + } else { uni.showToast({ title: '请登录', @@ -589,72 +694,9 @@ export default { this.show = true this.type = 3 }, - // 确认时间 type = 0 0 支付 1 立即购买 2 预约 3确认时间 - confimTime() { - uni.$u.http.post('/api/school/hour_order/confirm', { - classes_order_id: this.orderId, - classes_lib_spec_id: this.classes_lib_spec_id, - order_no: this.order_no2, - is_compute: 1 - }).then(res => { - if (res.code == 1) { - this.order_no2 = res.data.order_no - this.timeCreat(res.data.order_no) - } else { - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000 - }) - this.type = 2 - // _this.$api.toast(res.msg); - } - }).catch(error => { - }); + - this.show = false - this.type = 0 - }, - // 预约下单 - timeCreat(order_no) { - uni.$u.http.post('/api/school/hour_order/create', { - order_no: order_no, - }).then(res => { - if (res.code == 1) { - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000, - complete: function () { - setTimeout(function () { - uni.reLaunch({ - url: "/packageA/my/makeList?status=" + -1 - }) - }, 2000); - } - - }) - - } else { - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000 - }) - this.type = 2 - // _this.$api.toast(res.msg); - } - }).catch(error => { - - }); - }, - // 教师详情 - toTeacher(id) { - uni.navigateTo({ - url: `/pages/center/teacherDetail?id=${id}` - }) - }, // 导航 toMap(latitude, longitude, name) { uni.openLocation({ @@ -683,50 +725,59 @@ export default { this.selectedTime = null this.buyShow = false }, - + sunccessimg(event){ + this.path = event + }, // 保存海报 - save(e) { - wx.saveImageToPhotosAlbum({ - filePath: e, - success: function(res) { - wx.showToast({ - title: '保存成功', - }) - }, - fail: function(err) { - console.log(err, '失败') - } - }) - // let base64 = this.path.replace(/^data:image\/\w+;base64,/, ""); //图片替换 - // let filePath = wx.env.USER_DATA_PATH + '/qrcode.png'; - // uni.getFileSystemManager().writeFile({ - // filePath: filePath, //创建一个临时文件名 - // data: base64, //写入的文本或二进制数据 - // encoding: 'base64', //写入当前文件的字符编码 - // success: (res) => { - // uni.saveImageToPhotosAlbum({ - // filePath: filePath, - // success: () => { - // uni.showToast({ - // title: '保存成功', - // icon: "none", - // duration: 5000 - // }) - // }, - // fail: (err) => { - // console.log(err); - // uni.showToast({ - // title: '保存失败', - // icon: "none", - // duration: 5000 - // }) - // } + save() { + // wx.saveImageToPhotosAlbum({ + // filePath: e, + // success: function(res) { + // wx.showToast({ + // title: '保存成功', // }) // }, - // fail: (err) => { - // console.log(err) + // fail: function(err) { + // console.log(err, '失败') // } // }) + + + + + let base64 = this.path.replace(/^data:image\/\w+;base64,/, ""); //图片替换 + let filePath = wx.env.USER_DATA_PATH + '/qrcode.png'; + uni.getFileSystemManager().writeFile({ + filePath: filePath, //创建一个临时文件名 + data: base64, //写入的文本或二进制数据 + encoding: 'base64', //写入当前文件的字符编码 + success: (res) => { + uni.saveImageToPhotosAlbum({ + filePath: res, + success: () => { + uni.showToast({ + title: '保存成功', + icon: "none", + duration: 5000 + }) + this.overlay = false; + }, + fail: (err) => { + console.log(err); + uni.showToast({ + title: '保存失败', + icon: "none", + duration: 5000 + }) + this.overlay = false; + } + }) + }, + fail: (err) => { + console.log(err) + this.overlay = false; + } + }) }, //分享发布 sharePoster() { //分享图片给好友按钮的点击事件函数 @@ -1538,6 +1589,11 @@ export default { position: relative; width: 100%; height: 100%; + .posterClose { + position: absolute; + // right: 8rpx; + top: 200rpx; + } } .Poster { @@ -1609,6 +1665,7 @@ export default { margin-top: 30rpx; .c1t1 { + width: 340rpx; color: #202020; font-size: 36rpx; // margin-top: 30rpx; @@ -1640,32 +1697,26 @@ export default { .btnList { - width: 690rpx; position: absolute; - bottom: 150rpx; - left: 30rpx; + bottom: 10rpx; display: flex; - justify-content: space-evenly; - // width: 750rpx; - // height: 247rpx; - // background: #FFFFFF; - // border-radius: 44rpx 44rpx 0rpx 0rpx; - - span { - width: 250rpx; - height: 80rpx; - background: #FFFFFF; - border-radius: 401rpx 401rpx 401rpx 401rpx; - font-family: PingFang SC, PingFang SC; - font-weight: 800; - font-size: 34rpx; - color: #008CFF; + justify-content: space-around; + align-items: self-start; + width: 750rpx; + height: 247rpx; + background: #FFFFFF; + border-radius: 44rpx 44rpx 0rpx 0rpx; + color: #999999; + font-family: PingFang SC Regular, PingFang SC Regular; + font-weight: 400; + font-size: 28rpx; + .save { + margin-top: 60rpx; display: flex; + flex-direction: column; justify-content: center; align-items: center; } - - .save {} } .no-scroll { @@ -1693,23 +1744,14 @@ export default { justify-content: center; /* 水平居中 */ flex-flow: column; - height: 80rpx; + // height: 80rpx; line-height: inherit; - - span { - width: 250rpx; - height: 80rpx; - background: #FFFFFF; - border-radius: 401rpx 401rpx 401rpx 401rpx; - font-family: PingFang SC, PingFang SC; - font-weight: 800; - font-size: 34rpx; - color: #008CFF; - display: flex; - justify-content: center; - align-items: center; - } - } + margin-top: 60rpx; + font-family: PingFang SC Regular, PingFang SC Regular; + font-weight: 400; + font-size: 28rpx; + color: #999999; +} \ No newline at end of file diff --git a/pages/center/list.vue b/pages/center/list.vue deleted file mode 100644 index b1d7063..0000000 --- a/pages/center/list.vue +++ /dev/null @@ -1,410 +0,0 @@ - - - - \ No newline at end of file diff --git a/pages/center/teacherDetail.vue b/pages/center/teacherDetail.vue deleted file mode 100644 index e67ec0a..0000000 --- a/pages/center/teacherDetail.vue +++ /dev/null @@ -1,549 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 616afd1..20000ec 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -7,11 +7,7 @@ backgroundRepeat: 'no-repeat', }" > - - - - - - - 搜索 + + + + 搜索 + + @@ -49,16 +48,22 @@ @click="handleClick(index,tab.id)" > + {{ tab.name }} - + @@ -82,8 +87,10 @@ > {{ item.title }} - - {{ item.user.nickname }} + + + {{ item.user.nickname }} + {{ item.teacher.name }} #{{ items_t }} @@ -99,15 +106,15 @@ - + - + - + @@ -140,37 +147,38 @@ - + - + 我的标签 - + > --> {{ item_bq.name }} - + 全部标签 - + - + > --> {{ item.name }} @@ -228,8 +236,14 @@ export default { { name: "全部", id: 0 + }, + { + name: "夜校", + id: 1 } ], + limit: 6, + page: 1, show: false }; }, @@ -285,12 +299,12 @@ export default { // } // }, //底部翻页 - // onReachBottom() { - // if (this.hotList.length < this.count) { - // this.page++; - // this.getHotList(); - // } - // }, + onReachBottom() { + if (this.hotList.length < this.count) { + this.page++; + this.getHotList(); + } + }, // 重置列表 resetLists() { this.page = 1; @@ -302,6 +316,8 @@ export default { this.current = index; this.cate_ids = val; this.hotList = []; + this.page = 1; + this.limit = 6; this.getHotList(); }, // 搜索 @@ -348,6 +364,7 @@ export default { // 获取标签 getBqList() { + uni.$u.http .get("/api/school.new_activity/cate_list", { params: { @@ -359,9 +376,9 @@ export default { if (res.code == 1) { this.bqList = res.data.list; //初始化默认标签 - if (this.list.length < 3) { - this.list = [...this.list, ...res.data.list.slice(0,3)]; - } + // if (this.list.length < 3) { + // this.list = [...this.list, ...res.data.list.slice(0,2)]; + // } } else { uni.showToast({ title: res.msg, @@ -411,17 +428,52 @@ export default { this.list.splice(i,1); uni.setStorageSync('bqlist',JSON.stringify(this.list)) }, - // 获取热门活动 + + // 获取热门活动 和 课程 getHotList() { - let words = this.keywords - let cate_ids = this.cate_ids - uni.$u.http - .get("/api/school.new_activity/activity_list", { + let words = this.keywords; + let cate_ids = this.cate_ids; + if( cate_ids == 1){ //夜校 + + uni.$u.http.get('https://testy.hschool.com.cn/api/school/classes/classes_list', { + params: { + keywords: this.keywords, + page: this.page, + limit: this.limit, + status: 1, + order: 'normal', + auth_status: 1 + } + }).then(res => { + if (res.code == 1) { + this.count = res.data.list.last_page + if (this.hotList.length >= res.data.list.total) { + this.loadStatus = 'nomore'; + } else { + this.loadStatus = 'loading'; + } + this.hotList = [...this.hotList, ...res.data.list.data]; + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }); + this.loadStatus = 'loading'; + } + }).catch(error => { + console.error('请求失败', error); + this.loadStatus = 'loading'; + }); + + }else{ + //活动 + uni.$u.http.get("/api/school.new_activity/activity_list", { params: { keywords:words, cate_ids:cate_ids, - page: 1, - limit: 6, + page: this.page, + limit: this.limit, order: "normal", status: "2",//5 已结束 auth_status: 1 //审核通过的 @@ -429,15 +481,13 @@ export default { }) .then((res) => { if (res.code == 1) { - // this.count = res.data.list.data.length - // if(this.count){ - // this.loadStatus = 'nomore'; - // this.page++; - // } else { - // this.loadStatus = 'loading'; - // } - // this.hotList = [...this.hotList, ...res.data.list.data]; - this.hotList = res.data.list.data; + this.count = res.data.count; + if(this.hotList.length >= res.data.count){ + this.loadStatus = 'nomore'; + } else { + this.loadStatus = 'loading'; + } + this.hotList = [...this.hotList, ...res.data.list.data]; } else { uni.showToast({ title: res.msg, @@ -453,12 +503,20 @@ export default { duration: 2000, }); }); + } + }, // 跳转详情 detail(id) { - uni.navigateTo({ - url: "/pages/center/detail?id=" + id, - }); + if (this.cate_ids == 1) { //夜校 + // wx.navigateToMiniProgram(Object object); + + }else{ + + uni.navigateTo({ + url: "/pages/center/detail?id=" + id, + }); + } }, // 跳转往期详情 Wqdetail(id) { @@ -521,8 +579,8 @@ export default { right: 0; .imgs_all { - width: 44rpx; - height: 44rpx; + width: 74rpx; + height: 68rpx; } } @@ -545,7 +603,8 @@ export default { font-weight: 400; font-size: 34rpx; color: #9c9c9c; - width: 180rpx; + // width: 200rpx; + padding: 0 45rpx; height: 70rpx; line-height: 70rpx; background: linear-gradient(180deg, #ffffff 44%, #f7f7f7 100%); @@ -622,27 +681,38 @@ export default { margin-top: 65rpx; // #endif } - .serch_top { - margin-top: 10rpx; - margin-bottom: 30rpx; - position: relative; - - .searchBtn{ - position:absolute; - width: 133rpx; - height: 100%; - background: #323232 ; - border-radius: 40rpx; - font-family: PingFang SC, PingFang SC; - font-weight: 400; - font-size: 26rpx; - color: #FFFFFF; - display: flex; - justify-content: center; - align-items: center; - top: 0; + .serch_top{ + display: flex; + + .serch_top1 { + margin-top: 10rpx; + margin-bottom: 30rpx; + position: relative; + width: 530rpx; + .searchBtn{ + position:absolute; + width: 133rpx; + height: 100%; + background: #323232 ; + border-radius: 40rpx; + font-family: PingFang SC, PingFang SC; + font-weight: 400; + font-size: 26rpx; + color: #FFFFFF; + display: flex; + justify-content: center; + align-items: center; + top: 0; + right: 0; + } + } + .imgstop_ye{ + margin-left: 30rpx; + width: 174rpx; + height: 76rpx; + position: absolute; right: 0; - } + } } .hot { @@ -777,7 +847,7 @@ export default { } .bottom { - margin: 32rpx 0 32rpx 24rpx; + margin: 0 0 32rpx 24rpx; width: 655rpx; .toptext{ width: 480rpx; @@ -954,7 +1024,7 @@ export default { z-index: 0; } .bqlist{ - margin-top: 130rpx; + margin-top: 70rpx; z-index: 1; margin-left: 80rpx; .allmybqs{ @@ -966,7 +1036,7 @@ export default { display: flex; overflow-y: scroll; flex-wrap: wrap; - height: 440rpx; + height: 840rpx; width: 692rpx; margin-top:20rpx ; } diff --git a/pages/my/index.vue b/pages/my/index.vue index 2d818f2..c0a49b2 100644 --- a/pages/my/index.vue +++ b/pages/my/index.vue @@ -95,7 +95,7 @@ {{ item.title }} - + {{ item.user.nickname }} - - + 为您授权登陆,授权成功后可参加多种户外活动