Commit c16dc3ca authored by spc's avatar spc

jump

parent 5afe63e5
......@@ -5,7 +5,7 @@
<image class="back-btn" :src="$baseUrl + 'xingmaLab/1001/backBtn.png'" mode="aspectFit"
@click="handleBack" />
</view>
<view class="lotterypageCon">
<span class="lotterypagebg"
:style="{ backgroundImage: `url(${$baseUrl}${getImageUrl(config.images.background)})` }"></span>
......@@ -126,6 +126,7 @@ import DrawSucModal from './components/drawSucModal/drawSucModal.vue'
import DrawFailModal from './components/drawFailModal/drawFailModal.vue'
import { getAct915LotteryDraw, getAct915LotteryInfo, fetchAct915LotteryJSON } from '../../api/activity0915/index.js'
import md from '../../md.js'
import { jump } from '../../utils/index.js'
// 组件名称
defineOptions({
......@@ -234,7 +235,7 @@ const handleBack = () => {
// componentName: "返回按钮",
// componentContent: "返回"
// });
try {
uni.navigateBack({
delta: 1,
......@@ -282,45 +283,55 @@ const handleAwardClick = () => {
componentName: "抽奖板块",
componentContent: "奖品"
});
// 根据环境获取对应的appId
const getAppId = () => {
// 可以根据实际环境判断
// uat2: wxabebc35e71e66795
// test2: wx18428fc8a569a3c7
// 生产: wx4205ec55b793245e
// 这里可以根据实际需求调整环境判断逻辑
// 例如:根据域名、配置等判断当前环境
const currentEnv = 'prod' // 可以动态获取
const appIdMap = {
'uat2': 'wxabebc35e71e66795',
'test2': 'wx18428fc8a569a3c7',
'prod': 'wx4205ec55b793245e'
}
return appIdMap[currentEnv] || appIdMap['uat2'] // 默认uat2环境
}
const appId = getAppId()
const path = '/subPackages/xmhMainProcess/mine/index'
uni.navigateToMiniProgram({
appId: appId,
path: path,
extraData: {},
envVersion: 'release', // 可以根据环境调整:develop, trial, release
success: (res) => {
console.log('跳转小程序成功:', res)
},
fail: (err) => {
console.error('跳转小程序失败:', err)
// uni.showToast({
// title: '跳转失败',
// icon: 'none'
// })
// // 根据环境获取对应的appId
// const getAppId = () => {
// // 可以根据实际环境判断
// // uat2: wxabebc35e71e66795
// // test2: wx18428fc8a569a3c7
// // 生产: wx4205ec55b793245e
// // 这里可以根据实际需求调整环境判断逻辑
// // 例如:根据域名、配置等判断当前环境
// const currentEnv = 'prod' // 可以动态获取
// const appIdMap = {
// 'uat2': 'wxabebc35e71e66795',
// 'test2': 'wx18428fc8a569a3c7',
// 'prod': 'wx4205ec55b793245e'
// }
// return appIdMap[currentEnv] || appIdMap['uat2'] // 默认uat2环境
// }
jump({
type: JumpType.MINI,
url: '/subPackages/xmhMainProcess/mine/index',
extra: {
appId: 'wx4205ec55b793245e',
envVersion: 'release'
}
})
// const appId = getAppId()
// const path = '/subPackages/xmhMainProcess/mine/index'
// uni.navigateToMiniProgram({
// appId: appId,
// path: path,
// extraData: {},
// envVersion: 'release', // 可以根据环境调整:develop, trial, release
// success: (res) => {
// console.log('跳转小程序成功:', res)
// },
// fail: (err) => {
// console.error('跳转小程序失败:', err)
// // uni.showToast({
// // title: '跳转失败',
// // icon: 'none'
// // })
// }
// })
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment