iOS 适配

This commit is contained in:
GYJ
2024-12-19 16:22:50 +08:00
parent a147eaab4f
commit 206546aed8
7 changed files with 89 additions and 77 deletions

View File

@@ -185,8 +185,8 @@
<!-- 追剧悬浮 -->
<!-- <drag-button v-if="shodrag && shodrags" @clickClose="clickClose" :videoInfo="videoInfo" :isDock="true"
:existTabBar="true" @btnClick="btnClick" /> -->
<u-image @click="goMsg('/me/choujiang/choujiang')" :src="`../../static/red-pack-new.gif`"
style="width: 200rpx;height: 200rpx;position: fixed;right: 30rpx;bottom: 180rpx;"></u-image>
<u-image v-if="isShowMoneyPay" @click="goMsg('/me/choujiang/choujiang')" :src="`../../static/red-pack-new.gif`"
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;"></u-image>
<!-- #ifdef H5 -->
<div v-if="isWeixin"
style="width: 100%;height: 100%;position: fixed;top: 0;z-index: 999;background: url('../../static/images/open_guide.png') no-repeat center bottom / cover;">
@@ -209,6 +209,7 @@
import recommendVideo from '../../components/recommendVideo/recommendVideo.vue'
import activityComp from '../../components/activityComp/activityComp.vue'
import dragButton from "@/components/drag-button/drag-button.vue";
import httpsRequest from '../../common/httpRequest.js'
export default {
components: {
videoList,
@@ -260,6 +261,7 @@
isWeixin: false,
isIos: true,
scrollTop: 0,
isShowMoneyPay: true,
};
},
onShareAppMessage(res) {
@@ -279,7 +281,6 @@
}
},
onPageScroll(e) {
console.log(e);
this.scrollTop = e.scrollTop
},
onLoad(options) {
@@ -293,6 +294,7 @@
// #endif
console.log(options, '22222222222222222')
if (uni.getStorageSync('qdCode')) {
this.qdCode = uni.getStorageSync('qdCode')
}
@@ -435,6 +437,14 @@
this.shodrag = false
this.videoInfo = []
}
httpsRequest.getT("app/common/type/919", {}).then(res => {
if (res.code == 0) {
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
}
});
},
onReachBottom() {
if (this.page < this.pages) {

View File

@@ -53,7 +53,7 @@
我的积分
</view>
</view> -->
<view class="statistics-box-item" @click="goNav('/me/invite/cashDetail')">
<view v-if="isShowMoneyPay" class="statistics-box-item" @click="goNav('/me/invite/cashDetail')">
<view class="statistics-box-item-top">
{{userInfo.amount || '0.00'}}
</view>
@@ -146,7 +146,7 @@
转盘抽奖
</view>
</view> -->
<view class="tool-box-content-item flex align-center justify-center flex-wrap"
<view v-if="isShowMoneyPay" class="tool-box-content-item flex align-center justify-center flex-wrap"
@click="goNav('/me/invite/index')">
<view class="tool-box-content-item-img">
<image src="../../static/images/me/vfx.png" mode=""></image>
@@ -184,7 +184,7 @@
观看历史
</view>
</view>
<view v-if="rate>0" class="tool-box-content-item flex align-center justify-center flex-wrap"
<view v-if="rate>0 && isShowMoneyPay" class="tool-box-content-item flex align-center justify-center flex-wrap"
@click="goNav('/me/invite/inviteDet')">
<view class="tool-box-content-item-img">
<image src="../../static/images/me/vtd.png" mode=""></image>
@@ -257,6 +257,7 @@
<script>
import ttMsg from '../../components/ttMsg/ttMsg.vue'
import httpsRequest from '../../common/httpRequest.js'
export default {
components: {
ttMsg
@@ -292,6 +293,7 @@
kmPaySel: '否',
isWxIosPay: true, //微信下是否显示支付功能
userInfo: {},
isShowMoneyPay: true,
}
},
onLoad() {
@@ -354,6 +356,15 @@
this.rate = 0
}
this.avatar = uni.getStorageSync('avatar') ? uni.getStorageSync('avatar') : '../../static/images/logo.png'
httpsRequest.getT("app/common/type/919", {}).then(res => {
console.log(res);
if (res.code == 0) {
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
}
});
},
methods: {
//兑换卡密

View File

@@ -9,10 +9,10 @@
export default {
data() {
return {
ordersId:'',
timer:null,
maxAjaxNum:5,
ajaxNum:0,
ordersId: '',
timer: null,
maxAjaxNum: 5,
ajaxNum: 0,
url: null, //要打开的外部链接
viewerUrl: '/hybrid/html/web/viewer.html',
webviewStyles: {
@@ -22,38 +22,41 @@
}
},
onReady() {
// #ifdef APP-PLUS
// console.log('App plus2')
// var currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象
// setTimeout(function() {
// wv = currentWebview.children()[0]
// wv.setStyle({
// scalable: true
// })
// }, 1000); //如果是页面初始化调用时,需要延时一下
// #endif
},
onReady() {},
onShow() {
console.log(this.ordersId);
httpsRequest.getT("/app/wuyou/queryOrder/"+this.ordersId, {}).then(res => {
httpsRequest.getT("/app/wuyou/queryOrder/" + this.ordersId, {}).then(res => {
console.log(res.data);
if(res.data ==1){
if (res.data == 1) {
uni.hideLoading()
uni.showToast({
title:'支付成功',
icon:'none'
})
this.timer= setTimeout(()=>{
clearTimeout(this.timer)
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
console.log("is ios ", isIos);
if (isIos) {
uni.navigateBack()
},500)
}else{
uni.showToast({
title: '支付成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
} else {
uni.showToast({
title: '支付成功',
icon: 'none'
})
this.timer = setTimeout(() => {
clearTimeout(this.timer)
uni.navigateBack()
}, 500)
}
} else {
// #ifdef APP
uni.showLoading({
title:'支付中'
title: '支付中'
})
// #endif
}
@@ -69,29 +72,8 @@
onLoad: function(option) {
console.log(option)
this.url = option.url
this.ordersId=option.ordersId
console.log('this.ordersId'+this.ordersId);
// this.url="https://jiaoyu.xianmxkj.com/file/uploadPath/2023/03/08/b6c0dd4821cc9ce70c897adca3ad22c2.pdf"
// h5使用h5访问的时候记得跨域
// #ifdef H5
// this.url="https://jiaoyu.xianmxkj.com/file/uploadPath/2023/03/08/b6c0dd4821cc9ce70c897adca3ad22c2.pdf"
// this.url = `${this.viewerUrl}?file=${encodeURIComponent(option.url)}`;
// this.url = `${this.viewerUrl}?file=${'https://jiaoyu.xianmxkj.com/file/uploadPath/2023/03/08/b6c0dd4821cc9ce70c897adca3ad22c2.pdf'}`;
// #endif
// 在安卓和ios手机上
// 判断是手机系统安卓使用pdf.js
// #ifdef APP-PLUS
// if(plus.os.name === 'Android') {
// this.url = `${this.viewerUrl}?file=${encodeURIComponent(option.url)}`;
// }
// // ios直接访问pdf所在路径
// else {
// this.url = encodeURIComponent(option.url);
// }
// #endif
this.ordersId = option.ordersId
console.log('this.ordersId' + this.ordersId);
}
}
</script>