From ca19590876025c5c492245f8b2cad8fa24c0e7ad Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Mon, 30 Dec 2024 19:29:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 6 ++--- common/http.interceptor.js | 1 - common/httpRequest.js | 2 -- me/detail/detail.nvue | 24 +++++++++--------- me/detail/detail.vue | 45 +++++++++++++++++++--------------- me/feedback/index.vue | 2 +- pages.json | 3 ++- pages/index/index.vue | 2 -- uview-ui/libs/request/index.js | 1 - 9 files changed, 42 insertions(+), 44 deletions(-) diff --git a/common/config.js b/common/config.js index 3d97c82..313c899 100644 --- a/common/config.js +++ b/common/config.js @@ -16,9 +16,9 @@ const ROOTPATH1 = "https://web-api.hnsiyao.cn/czg/"; // const ROOTPATH = "https://web-api.hnsiyao.cn/czg/"; //后台服务域名 const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 -// const ROOTPATH1 = "http://192.168.1.5:8100/czg/"; // -// const ROOTPATH = "http://192.168.1.5:8100/czg/"; //后台服务域名 -// const ROOTPATH2 = "http://192.168.1.5:8100"; //后台服务域名 +// const ROOTPATH1 = "http://192.168.1.41:8100/czg/"; // +// const ROOTPATH = "http://192.168.1.41:8100/czg/"; //后台服务域名 +// const ROOTPATH2 = "http://192.168.1.41:8100"; //后台服务域名 module.exports = { APIHOST: ROOTPATH, diff --git a/common/http.interceptor.js b/common/http.interceptor.js index feb152f..6695859 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -39,7 +39,6 @@ const install = (Vue, vm) => { // 响应拦截,判断状态码是否通过 Vue.prototype.$u.http.interceptor.response = (res) => { - console.log(res); if (res.code == 0) { // res为服务端返回值,可能有code,result等字段 // 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到 diff --git a/common/httpRequest.js b/common/httpRequest.js index 3683f5b..7b40f68 100644 --- a/common/httpRequest.js +++ b/common/httpRequest.js @@ -24,7 +24,6 @@ module.exports = { } } } - console.log(info); return info; }, logout: function() { @@ -186,7 +185,6 @@ module.exports = { let that = this; header = header || "application/x-www-form-urlencoded"; url = that.config("APIHOST1") + url.replace(/^\//, ""); - console.log(url); // let token = uni.getStorageSync("token"); let token = uni.getStorageSync("token"); if (token) { diff --git a/me/detail/detail.nvue b/me/detail/detail.nvue index 707ef48..46acd67 100644 --- a/me/detail/detail.nvue +++ b/me/detail/detail.nvue @@ -371,7 +371,7 @@ num: 1, //当前播放的集数 showPay: false, //购买视频的弹窗 info: {}, //整部的信息 - courseDetailsId: '', //详情id + courseDetailsId: null, //详情id scrollIntoView: '', //当前播放视频的位置 scrollIntoViews: 'video0', //当前播放视频的位置 isVips: '否', //是否显示会员 @@ -536,10 +536,7 @@ // 记录跳转过来的视频总id跟单集id if (e.id) { this.courseId = e.id; - if (e.courseDetailsId && e.courseDetailsId != 'null') { - this.courseDetailsId = e.courseDetailsId - } - console.log(this.courseDetailsId) + // this.getMyLoveStatus() this.getMoneyList() this.getMyMoney() @@ -548,9 +545,7 @@ if (e.allId) { const arr = e.allId.split('-') this.courseId = arr[0]; - if (arr[1] && arr[1] != 'null') { - this.courseDetailsId = arr[1] - } + // this.getMyLoveStatus() this.getMoneyList() this.getMyMoney() @@ -1075,15 +1070,12 @@ //单集解锁 data.courseDetailsId = this.videoList[this.current].courseDetailsId } - console.log(this.videoList[this.current].courseDetailsId) - console.log((num && num == 10) ? '/app/order/insertCourseOrders/limit10' : - '/app/order/insertCourseOrders') + httpsRequest.getT((num && num == 10) ? '/app/order/insertCourseOrders/limit10' : '/app/order/insertCourseOrders', data).then(res => { - console.log(res) + console.log(res) if (res.code == 0) { - console.log(res.status && res.status == 1) if (res.status && res.status == 1) { this.showPay = false //关闭购买选择弹窗 this.isOrder = true @@ -1321,6 +1313,7 @@ token: uni.getStorageSync('token') ? uni.getStorageSync('token') : '' }; console.log("getDataList==="+courseDetailsId) + console.log("getDataList===",data) httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => { if (res.code == 0) { @@ -1330,6 +1323,11 @@ } else { this.isCollect = false } + if( res.data && res.data.courseDetailsId && !this.courseDetailsId && !courseDetailsId) { + this.courseDetailsId = res.data.courseDetailsId + courseDetailsId = res.data.courseDetailsId + } + if (res.data.listsDetail) { this.info = res.data; this.title = this.info.title; diff --git a/me/detail/detail.vue b/me/detail/detail.vue index 3fcff1a..585c9b4 100644 --- a/me/detail/detail.vue +++ b/me/detail/detail.vue @@ -419,7 +419,7 @@ num: 1, //当前播放的集数 showPay: false, //购买视频的弹窗 info: {}, //整部的信息 - courseDetailsId: '', //详情id + courseDetailsId: null, //详情id scrollIntoView: '', //当前播放视频的位置 scrollIntoViews: 'video0', //当前播放视频的位置 isVips: '否', //是否显示会员 @@ -600,10 +600,6 @@ } if (e.id) { this.courseId = e.id - if (e.courseDetailsId && e.courseDetailsId != 'null') { - this.courseDetailsId = e.courseDetailsId - } - console.log(this.courseDetailsId, '跳转进来的id') // this.getMyLoveStatus() } if (e.tt_album_id) { @@ -1334,27 +1330,32 @@ this.$Request.getT((num && num == 10) ? '/app/order/insertCourseOrders/limit10' : '/app/order/insertCourseOrders', data).then(res => { if (res.code == 0) { - this.ordersId = res.data.orders.ordersId //记录订单id - this.payMoney = res.data.orders.payMoney //记录订单价格 - if (type == 1) { //金币 - // this.showPay = false - // this.showMoney = false - this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney); - } else if (type == 2) { //支付宝 - this.showPay = false //关闭购买选择弹窗 - this.isOrder = true - this.payPrice = res.data.orders.payMoney //需要支付的价格 - this.showMoney = true //显示充值弹窗 - } - - } else { - this.isOrder = true + + if ( res.status && res.status == 1) { this.showPay = false //关闭购买选择弹窗 this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId, true); return; + } else { + this.ordersId = res.data.orders.ordersId //记录订单id + this.payMoney = res.data.orders.payMoney //记录订单价格 + if (type == 1) { //金币 + // this.showPay = false + // this.showMoney = false + this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney); + } else if (type == 2) { //支付宝 + this.showPay = false //关闭购买选择弹窗 + this.isOrder = true + this.payPrice = res.data.orders.payMoney //需要支付的价格 + this.showMoney = true //显示充值弹窗 + } } + + + } else { + this.isOrder = true + uni.showToast({ title: res.msg, icon: 'none' @@ -1552,6 +1553,10 @@ this.dyCourseId = "" + res.data.dyCourseId; console.log("dyCourseId__" + this.dyCourseId) } + if( res.data && res.data.courseDetailsId && !this.courseDetailsId && !courseDetailsId) { + this.courseDetailsId = res.data.courseDetailsId + courseDetailsId = res.data.courseDetailsId + } if (res.data && res.data.isCollect && res.data.isCollect > 0) { this.isCollect = true } else { diff --git a/me/feedback/index.vue b/me/feedback/index.vue index f33b378..b5f94b0 100644 --- a/me/feedback/index.vue +++ b/me/feedback/index.vue @@ -111,7 +111,7 @@ uni.showLoading({ title: '加载中...' }) - this.$u.post('/app/message/insertMessage', { + this.$u.post('app/message/sendMessage', { title: this.sendDate.contact, content: JSON.stringify(this.sendDate), state: 2 diff --git a/pages.json b/pages.json index 394d3ad..61639cd 100644 --- a/pages.json +++ b/pages.json @@ -105,8 +105,9 @@ "path": "pages/me/index", "style": { "navigationBarTitleText": "我的", - "navigationStyle": "custom", + "navigationStyle": "custom" // #ifdef H5 + , "enablePullDownRefresh": true // #endif } diff --git a/pages/index/index.vue b/pages/index/index.vue index 0e225e3..ed421b0 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -211,7 +211,6 @@ import dragButton from "@/components/drag-button/drag-button.vue"; import httpsRequest from '../../common/httpRequest.js' import {$cache_index} from '@/store/cashe.js' - console.log($cache_index) export default { components: { videoList, @@ -939,7 +938,6 @@ state: 1 } this.$u.api.msg(data).then(res => { - console.log(res) if (res.code == 0) { this.notice = res.data.list res.data.list.forEach(res => { diff --git a/uview-ui/libs/request/index.js b/uview-ui/libs/request/index.js index b8b12d2..c44b81c 100644 --- a/uview-ui/libs/request/index.js +++ b/uview-ui/libs/request/index.js @@ -25,7 +25,6 @@ class Request { options.params = options.params || {}; options.header = Object.assign({}, this.config.header, options.header); options.method = options.method || this.config.method; - console.log(options); return new Promise((resolve, reject) => { options.complete = (response) => { // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)