diff --git a/node_modules/uview-ui/components/u-navbar/u-navbar.vue b/node_modules/uview-ui/components/u-navbar/u-navbar.vue index 2b206b7..ce243dc 100644 --- a/node_modules/uview-ui/components/u-navbar/u-navbar.vue +++ b/node_modules/uview-ui/components/u-navbar/u-navbar.vue @@ -112,7 +112,13 @@ // 如果配置了autoBack,自动返回上一页 this.$emit('leftClick') if(this.autoBack) { - uni.navigateBack() + if (getCurrentPages().length > 1) { + uni.navigateBack() + } else { + uni.switchTab({ + url: "/pages/index/index" + }) + } } }, // 点击右侧区域 diff --git a/packageA/center/applyDetail.vue b/packageA/center/applyDetail.vue index 7c4d069..1b30151 100644 --- a/packageA/center/applyDetail.vue +++ b/packageA/center/applyDetail.vue @@ -4,106 +4,143 @@ --> - - - - - - + - - - - - {{detail.title}} - - - {{detail.address_detail}} + + + + + + + + {{ detail.title }} + + + {{ detail.address_detail }} + - - - - - 活动时间 - {{formattedTime.formattedTime}} - - - - 数量 (剩余{{detail.join_info.stock - detail.join_info.people_number}}张) - - - {{ nummoney }} - - - - - - 支付金额 - ¥{{ priceGem }} - - - - 支付方式 - - - 微信支付 - - - - - - - - 报名信息 - + + + 活动时间 + {{ formattedTime.formattedTime }} - - - 请填写真实的报名人认证信息 - - - - - 李明 - 身份证 410305200001012025 - - - - - - - - - - - - - 添加/删除报名人 - - - - - - - 退款政策 - + + + 数量 + (剩余{{ detail.join_info.stock - detail.join_info.people_number }}张) + + + + {{ nummoney }} + + + - - - - {{detail.refund_info.title}} + + + 支付金额 + ¥{{ priceGem }} + + + + 支付方式 + + + 微信支付 + + + + + + 备注 + + + + - - - - - 退款政策 - - - - 申请退款时间 - 退款比例 - 退款金额 - - - 报名开始后 - 0% - 0 - - - 报名开始至{{ fomartertime }} - 需协商 - 需协商 - - - - 我已知晓 - - - - - 免责声明 - - + + 退款政策 + + + + + + 我已知晓 + + + + + 免责声明 + + + + + + + 活动均为主理人自行发布并组织的活动,请您注意,我们仅为活动提供平台技术支持,活动后续事项有主理人负责组织,费用均为主理人收取。 + 如您因活动发起、组织、撤销、下线、退款等引起的纠纷须由主理人自行解决并承担后果。 + + + - - - 活动均为主理人自行发布并组织的活动,请您注意,粗门仅为活动提供平台技术支持,活动后续事项有主理人负责组织,费用均为主理人收取。 - 如您因活动发起、组织、撤销、下线、退款等引起的纠纷须由主理人自行解决并承担后果。 - - - - - - + - + 立即支付 确认报名 确认报名 - 立即支付 + style="color: #FFFFFF;background: #C1C1C1;">确认报名 + 立即支付 - + - - - - - {{detail.title}} - - ¥{{detail.price}} - 免费 - - + + + + {{ detail.title }} + + ¥{{ detail.price }} + 免费 + + - - - - + + + 立 即 支 付 + 确 认 报 名 + + + - - 立 即 支 付 - 确 认 报 名 - - - - - + - - - 《免责声明》 - - - + + + 《免责声明》 + + + + + + + 我同意 + 我同意 - - - 我同意 - 我同意 - - - + + + 活动二维码 + + + + + 长按识别二维码进群 + 如果无法加入或者开启了群验证,可能是成员已满您即将加入由用户自发组织的户外活动,请知悉 + 确认您已知晓《用户协议》的用户义务与责任平台不对活动真实性作担保,请入群自行辨别 + + 我已知晓 + + @@ -273,7 +322,7 @@ // }, fomartertime() { - return dayjs(this.detail.last_time*1000).format('YYYY-MM-DD HH:mm:ss'); + return dayjs(this.detail.last_time * 1000).format('YYYY-MM-DD HH:mm:ss'); }, formattedTime() { const startTime = dateWeek(this.detail.start_time); @@ -286,25 +335,26 @@ data() { return { + qunShow:false, style: { // 字符串的形式 img: 'width: 100%' }, - tipsShow:false, - nummoney:1, - priceGem:null, + tipsShow: false, + nummoney: 1, + priceGem: null, Negotiate: null, // 入驻协议 agree: false, agreeShow: false, protocolArr: ["<支付协议>"], - value_slide:0, + value_slide: 0, scrollTop: 0, userInfo: {}, path: 'https://testy.hschool.com.cn//uploads/20241219/3406baf51fcc28c63c31ebcee5c9c75e.jpg', uloadingShow: false, show: false, - shows:false, + shows: false, buyShow: false, type: 0, // 0 支付 1 立即购买 2 预约 3确认时间 id: 1, @@ -346,7 +396,11 @@ titleStyle: { color: '#FFFFFF' }, - oper_data:null + oper_data: null, + teamList: [], + down: false, + desc:'', + teamListJson:'' }; }, @@ -376,16 +430,89 @@ // this.getShare() this.getAgreement(); this.getMoneyGetm(); - }, + }, + onShow() { + this.getTeam(); + }, + computed: { + displayedList() { + return this.down ? + this.teamList.filter((_, i) => i < 2) // 保持响应式 + : + this.teamList + } + }, methods: { - addMon(){ + chickTeam(item, index) { + this.$set(this.teamList[index], 'is', !this.teamList[index].is); + //获取this.teamList中is为true的并且拼接成 josn 格式为:[{name:"小明",idnum:"410303199501220515"}] + let teamList = this.teamList.filter(item => item.is).map(item => ({ + name: item.name, + idnum: item.idnum + })); + console.log(teamList); + var key=JSON.stringify(teamList); + //再进行url编码 + key=encodeURIComponent(key); + this.teamListJson=key; + this.getTeamGetm(); + }, + getTeamGetm() { + let num = this.nummoney; + uni.$u.http.post('/api/school.newactivity.order/confirm', { + activity_id: this.id, + order_no: this.order_no, + is_compute: 1, + num: num || 1, + desc:this.desc, + people: this.teamListJson + }).then(res => { + console.log(res); + }).catch(error => { + + }); + }, + getTeam() { + uni.$u.http.get('/api/school.newactivity.activity_join/people_list').then(res => { + console.log(res) + if (res.code == 1) { + //增加一个字段 is 是否选中 + this.teamList = res.data.list; + this.teamList = res.data.list.map(item => ({ + ...item, + is: false + })) + if (res.data.list.length > 2) { + this.down = true; + } + } else { + this.teamList = []; + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }); + } + }) + }, + openUrlSuccess(url) { + uni.redirectTo({ + url: url + }) + }, + openUrl(url) { + uni.navigateTo({ + url: url + }) + }, + addMon() { if (this.detail.feel == 1) { - if (this.nummoney < Number(this.oper_data.free_activity_max_people) && - this.nummoney < (this.detail.join_info.stock - this.detail.join_info.people_number)) { + if (this.nummoney < Number(this.oper_data.free_activity_max_people) && + this.nummoney < (this.detail.join_info.stock - this.detail.join_info.people_number)) { this.nummoney++ this.getMoneyGetm(); - }else{ + } else { uni.showToast({ title: '不能超过免费限制数量和剩余可报名人数', icon: 'none', @@ -393,12 +520,12 @@ }) return; } - }else{ - + } else { + if (this.nummoney < (this.detail.join_info.stock - this.detail.join_info.people_number)) { this.nummoney++ this.getMoneyGetm(); - }else{ + } else { uni.showToast({ title: '不能超过剩余数量', icon: 'none', @@ -408,7 +535,7 @@ } } }, - removeMon(){ + removeMon() { if (this.nummoney > 1) { this.nummoney-- this.getMoneyGetm(); @@ -659,7 +786,9 @@ activity_id: this.id, order_no: this.order_no, is_compute: 1, - num:num || 1 + num: num || 1, + people: this.teamListJson, + desc:this.desc }).then(res => { if (res.code == 1) { this.priceGem = res.data.order_data.totalprice @@ -685,7 +814,9 @@ activity_id: this.id, order_no: this.order_no, is_compute: 1, - num:num || 1 + num: num || 1, + desc:this.desc, + people: this.teamListJson }).then(res => { if (res.code == 1) { this.PayPirce = res.data.order_data.totalprice @@ -706,6 +837,7 @@ }, // 创建订单 create(order_no, PayPirce) { + uni.$u.http.post('/api/school.newactivity.order/create', { order_no: order_no, }).then(res => { @@ -715,17 +847,18 @@ } else { this.uloadingShow = false uni.showToast({ - title: '创建成功', + title: '报名成功', icon: 'success', duration: 2000, - complete: function() { - setTimeout(function() { - uni.redirectTo({ - url: "/packageA/my/success?status=" + "2,3" - }) - }, 2000); - } + // complete: function() { + // setTimeout(function() { + // uni.redirectTo({ + // url: "/packageA/my/success?status=" + "2,3" + // }) + // }, 2000); + // } }); + this.qunShow =true; } } else { uni.showToast({ @@ -760,9 +893,10 @@ success(res) { if (res.errMsg == "requestPayment:ok") { that.order_no = '' - uni.redirectTo({ - url: "/packageA/my/success?status=" + '2,3' - }) + // uni.redirectTo({ + // url: "/packageA/my/success?status=" + '2,3' + // }) + that.qunShow =true; console.log('支付成功', res) } else { that.uloadingShow = false @@ -817,9 +951,10 @@ \ No newline at end of file diff --git a/packageA/center/detail.vue b/packageA/center/detail.vue index 1d10aa2..be518ca 100644 --- a/packageA/center/detail.vue +++ b/packageA/center/detail.vue @@ -80,6 +80,26 @@ + + + + + + + + + 群二维码 + + 上传时间:{{formatTimestamp(detail.updatetime)}} + + + + + 查看 + + + @@ -391,6 +411,11 @@ }, methods: { + openImg(img) { + uni.previewImage({ + urls: [img], + }); + }, // saveClick() { // console.log('saveClick') // // 生成图片 @@ -509,6 +534,16 @@ }); }); }, + formatTimestamp(timestamp) { + const date = new Date(timestamp * 1000); // 10位时间戳需要乘以1000 + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, "0"); + const day = String(date.getDate()).padStart(2, "0"); + const hours = String(date.getHours()).padStart(2, "0"); + const minutes = String(date.getMinutes()).padStart(2, "0"); + const seconds = String(date.getSeconds()).padStart(2, "0"); + return `${year}.${month}.${day}`; + }, // 时间转换函数 timeago(timestamp) { const now = new Date().getTime(); // 当前时间(毫秒) @@ -1176,8 +1211,8 @@ } .imgs { - margin-top: 30rpx; - width: 690rpx; + display: block; + width: 100%; } } @@ -1755,4 +1790,16 @@ // #endif } + .ck-qrcode{ + width: 180rpx; + height: 70rpx; + background: #323232; + border-radius: 198rpx 198rpx 198rpx 198rpx; + font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; + font-weight: 400; + font-size: 42rpx; + color: #BBFC5B; + line-height: 70rpx; + text-align: center; + } \ No newline at end of file diff --git a/packageA/center/detailSys.vue b/packageA/center/detailSys.vue index 2f5f045..132bf73 100644 --- a/packageA/center/detailSys.vue +++ b/packageA/center/detailSys.vue @@ -1,164 +1,270 @@