From 54250730ce0a08707bd14364169eec69c312184f Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Mon, 23 Dec 2024 16:38:42 +0800 Subject: [PATCH] =?UTF-8?q?index=E6=96=87=E4=BB=B6=E5=A4=B9=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 12 ++-- pages/index/course/courseList.vue | 44 +++++++-------- pages/index/course/orderDet.vue | 92 +++++++++++++++---------------- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/common/config.js b/common/config.js index f8c138b..ff61669 100644 --- a/common/config.js +++ b/common/config.js @@ -1,10 +1,10 @@ -const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; // -const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名 -const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名 +// const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; // +// const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名 +// const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名 -// const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // -// const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 -// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 +const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // +const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 +const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 // const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; // // const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名 diff --git a/pages/index/course/courseList.vue b/pages/index/course/courseList.vue index d2a451f..d8590c3 100644 --- a/pages/index/course/courseList.vue +++ b/pages/index/course/courseList.vue @@ -2,15 +2,15 @@ - + - + @@ -19,7 +19,7 @@ - + @@ -44,16 +44,16 @@ courseListIos: [], //资源列表 pageIos: 1, limitIos: 10, + pagesIos: 0, sortIos: '', - count: 0, - keyword: '', - isPrice: '', //是否免费 2:免费 + keywordIos: '', + isPriceIos: '', //是否免费 2:免费 } }, onShow() { this.enableIos = true - this.getCourseList() + this.getCourseListIos() }, onHide() { this.enableIos = false @@ -62,34 +62,34 @@ uni.setNavigationBarTitle({ title: option.title }) - this.getBannerList() + this.getBannerListIos() if (option.sort) { this.sortIos = option.sort } if (option.isPrice) { - this.isPrice = option.isPrice + this.isPriceIos = option.isPrice } }, methods: { - goPage(url) { + goPageIos(url) { uni.navigateTo({ url: url }) }, //点击回调 - posterSuccess(item) { + posterSuccessIos(item) { uni.navigateTo({ url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId }) }, //最新热播 - getCourseList() { + getCourseListIos() { let data = { limit: this.limitIos, page: this.pageIos, sort: this.sortIos ? this.sortIos : '', - title: this.keyword, + title: this.keywordIos, } // #ifdef MP-WEIXIN data.wxShow = 1 @@ -97,13 +97,13 @@ // #ifdef MP-TOUTIAO data.dyShow = 1 // #endif - if (this.isPrice) { - data.isPrice = this.isPrice + if (this.isPriceIos) { + data.isPrice = this.isPriceIos } this.$u.api.courseList(data).then(res => { if (res.code == 0) { - this.pages = res.data.totalPage - if (this.pageIos < this.pages) { + this.pagesIos = res.data.totalPage + if (this.pageIos < this.pagesIos) { this.statusIos = 'loadmore' } else { this.statusIos = 'nomore' @@ -128,7 +128,7 @@ }) }, // 获取轮播图列表 - getBannerList() { + getBannerListIos() { this.$u.api.bannerList({ classify: '1' }).then(res => { @@ -151,10 +151,10 @@ }, onReachBottom: function() { - if (this.pageIos < this.pages) { + if (this.pageIos < this.pagesIos) { this.pageIos += 1 this.statusIos = 'loading' - this.getCourseList() + this.getCourseListIos() } else { this.statusIos = 'nomore' @@ -163,7 +163,7 @@ }, onPullDownRefresh: function() { this.pageIos = 1; - this.getCourseList() + this.getCourseListIos() }, } diff --git a/pages/index/course/orderDet.vue b/pages/index/course/orderDet.vue index 491249f..d802950 100644 --- a/pages/index/course/orderDet.vue +++ b/pages/index/course/orderDet.vue @@ -1,44 +1,44 @@ @@ -47,17 +47,17 @@ export default { data() { return { - courseId: '', - courseList: [], + courseIdIos: '', + courseListIos: [], - openLists: [], - openWay: 1, - flag: true + openListsIos: [], + openWayIos: 1, + flagIos: true } }, onLoad(option) { // #ifdef APP - this.openLists = [{ + this.openListsIos = [{ image: '../../../static/images/index/weixin.png', text: '微信支付', id: 1 @@ -66,22 +66,22 @@ text: '支付宝', id: 2 }], - this.openWay = 1; + this.openWayIos = 1; // #endif // #ifdef MP-WEIXIN - this.openLists = [{ + this.openListsIos = [{ image: '../../../static/images/index/weixin.png', text: '微信支付', id: 1 }], - this.openWay = 1; + this.openWayIos = 1; // #endif // #ifdef H5 let ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('micromessenger') !== -1) { - this.openLists = [{ + this.openListsIos = [{ image: '../../../static/images/index/weixin.png', text: '微信支付', id: 1 @@ -90,39 +90,39 @@ text: '支付宝', id: 2 }], - this.openWay = 1; + this.openWayIos = 1; } else { - this.openLists = [{ + this.openListsIos = [{ image: '../../../static/images/index/zhifubao.png', text: '支付宝', id: 2 }], - this.openWay = 2; + this.openWayIos = 2; } - // this.openLists = [{ + // this.openListsIos = [{ // image: '../../../static/images/index/zhifubao.png', // text: '支付宝', // id: 2 // }], - // this.openWay = 2; + // this.openWayIos = 2; // #endif if (option.courseId) { - this.courseId = option.courseId - this.getDataList(this.courseId) + this.courseIdIos = option.courseId + this.getDataListIos(this.courseIdIos) } }, methods: { - selectWay(e) { - this.openWay = e.id; + selectWayIos(e) { + this.openWayIos = e.id; }, // 资源详情 - getDataList(id) { + getDataListIos(id) { let data = { id } this.$u.api.courseDet(data).then(res => { if (res.code == 0) { - this.courseList = res.data + this.courseListIos = res.data } else { uni.showToast({ title: res.msg, @@ -133,12 +133,12 @@ }) }, - pay() { + payIos() { let that = this - if (that.flag) { - that.flag = false + if (that.flagIos) { + that.flagIos = false let data = { - courseId: that.courseList.courseId + courseId: that.courseListIos.courseId } that.$u.api.courseOrder(data).then(res => { if (res.code == 0 && res.data.flag == 1) { @@ -146,12 +146,12 @@ title: '已获取资源', icon: 'success' }) - that.getDataList(that.courseId); + that.getDataListIos(that.courseIdIos); } else if (res.code == 0 && res.data.flag == 2) { uni.showLoading({ title: '支付中...' }) - if (that.openWay == 1) { + if (that.openWayIos == 1) { // #ifdef MP-WEIXIN that.$u.post('app/wxPay/wxPayJsApiOrder?orderId=' + res.data.orders.ordersId, {}) .then( @@ -219,7 +219,7 @@ } }); // #endif - } else if (that.openWay == 2) { + } else if (that.openWayIos == 2) { // #ifdef H5 that.$u.post('/app/aliPay/payOrder?orderId=' + res.data.orders.ordersId + '&classify=2').then( @@ -261,11 +261,11 @@ icon: 'none', // duration: 1500 }) - // that.getDataList(that.courseId); + // that.getDataListIos(that.courseId); } }) setTimeout(() => { - that.flag = true + that.flagIos = true }, 1500) } @@ -364,14 +364,14 @@ background: #F5F5F5; } - .popup_pay { + .popup_pay_ios { background: #FFFFFF; border-radius: 24rpx; margin: 30rpx 30rpx; padding: 30rpx 30rpx 20rpx 30rpx; } - .taber { + .taber_ios { position: fixed; bottom: 0; left: 0; @@ -384,7 +384,7 @@ justify-content: space-between; } - .btn { + .btn_ios { width: 260rpx; height: 78rpx; background: #5074FF;