fix 公众号支付宝支付跳转到PC 界面的bug

fix 个人中心设置背景色没有生效的bug
This commit is contained in:
damonyuan 2024-11-16 00:11:57 +08:00
parent bfd39255c1
commit 95154dec62
3 changed files with 83 additions and 58 deletions

View File

@ -302,7 +302,7 @@ public class PayServiceImpl implements IPayService {
bizContent.put("passback_params", JSONObject.toJSONString(new JSONObject(){{ bizContent.put("passback_params", JSONObject.toJSONString(new JSONObject(){{
put("from", params.getScene()); put("from", params.getScene());
}})); }}));
if (params.getTerminal().equals(ClientEnum.H5.getCode())) { if (params.getTerminal().equals(ClientEnum.H5.getCode()) || params.getTerminal().equals(ClientEnum.OA.getCode())) {
AlipayTradeWapPayRequest alipayRequest = new AlipayTradeWapPayRequest(); AlipayTradeWapPayRequest alipayRequest = new AlipayTradeWapPayRequest();
//alipayRequest.setNotifyUrl("http://y4f8ud.natappfree.cc" + aliPayNotifyUrl); //alipayRequest.setNotifyUrl("http://y4f8ud.natappfree.cc" + aliPayNotifyUrl);
alipayRequest.setNotifyUrl(UrlUtils.getRequestUrl() + aliPayNotifyUrl); alipayRequest.setNotifyUrl(UrlUtils.getRequestUrl() + aliPayNotifyUrl);

View File

@ -13,7 +13,7 @@
:border-bottom="false" :border-bottom="false"
:title-bold="true" :title-bold="true"
:background="{ background: 'rgba(256,256, 256, 0)' }" :background="{ background: 'rgba(256,256, 256, 0)' }"
:title-color="$theme.navColor" :title-color="navColor"
> >
<template #title> <template #title>
<image <image
@ -72,7 +72,11 @@ const props = defineProps({
}, },
isLogin: { isLogin: {
type: Boolean type: Boolean
} },
navColor: {
type: String,
default: "#000000"
}
}) })
const { copy } = useCopy() const { copy } = useCopy()

View File

@ -1,61 +1,82 @@
<template> <template>
<page-meta :page-style="$theme.pageStyle"> <view class="user" :style="pageStyle">
<!-- #ifndef H5 --> <view v-for="(item, index) in state.pages" :key="index">
<navigation-bar <template v-if="item.name == 'user-info'">
:front-color="$theme.navColor" <w-user-info :pageMeta="state.meta" :content="item.content" :styles="item.styles" :user="userInfo"
:background-color="$theme.navBgColor" :is-login="isLogin" :navColor="navColor" />
/> </template>
<!-- #endif --> <template v-if="item.name == 'my-service'">
</page-meta> <w-my-service :content="item.content" :styles="item.styles" />
<view class="user"> </template>
<view v-for="(item, index) in state.pages" :key="index"> <template v-if="item.name == 'user-banner'">
<template v-if="item.name == 'user-info'"> <w-user-banner :content="item.content" :styles="item.styles" />
<w-user-info </template>
:pageMeta="state.meta" </view>
:content="item.content" <tabbar />
:styles="item.styles" </view>
:user="userInfo"
:is-login="isLogin"
/>
</template>
<template v-if="item.name == 'my-service'">
<w-my-service :content="item.content" :styles="item.styles" />
</template>
<template v-if="item.name == 'user-banner'">
<w-user-banner :content="item.content" :styles="item.styles" />
</template>
</view>
<tabbar />
</view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getDecorate } from '@/api/shop' import { getDecorate } from '@/api/shop'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import { onShow } from '@dcloudio/uni-app' import { onShow, onLoad } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { reactive } from 'vue' import { computed, reactive } from 'vue'
const state = reactive<{ const state = reactive<{
meta: any[] meta : any[]
pages: any[] pages : any[]
}>({ }>({
meta: [], meta: [],
pages: [] pages: []
}) })
const getData = async () => { const getData = async () => {
const data = await getDecorate({ id: 2 })
state.meta = JSON.parse(data.meta) console.log('asdasd')
state.pages = JSON.parse(data.data) const data = await getDecorate({ id: 2 })
uni.setNavigationBarTitle({ state.meta = JSON.parse(data.meta)
title: state.meta[0].content.title state.pages = JSON.parse(data.data)
}) uni.setNavigationBarTitle({
} title: state.meta[0].content.title,
const userStore = useUserStore() })
const { userInfo, isLogin } = storeToRefs(userStore) uni.setNavigationBarColor({
onShow(() => { frontColor: '#000000',
userStore.getUser() })
}) console.log(123123)
getData() }
const userStore = useUserStore()
const { userInfo, isLogin } = storeToRefs(userStore)
//
const pageStyle = computed(() => {
const { bg_type, bg_color, bg_image } = state.meta[0]?.content ?? {}
if (bg_type != undefined) {
return bg_type == 1 ? { 'background-color': bg_color } : { 'background-image': `url(${bg_image})` };
} else {
return ""
}
})
const navColor = computed(() => {
const { text_color } = state.meta[0]?.content ?? {}
if (text_color == 2) {
return '#000000';
} else {
return '#ffffff'
}
})
onShow(() => {
userStore.getUser()
})
getData()
</script> </script>
<style></style> <style lang="scss" scoped>
.user {
position: relative;
background-repeat: no-repeat;
background-size: 100% auto;
overflow: hidden;
width: 100%;
transition: all 1s;
min-height: calc(100vh - env(safe-area-inset-bottom));
}
</style>