Commit 4c149dff authored by 劳琪峰's avatar 劳琪峰

chore: 修改1015活动页测试入口

parent eeec8ba5
......@@ -22,9 +22,6 @@
:debug-mode="true"
/>
</template>
<GotPrizeModal :visible="showGotPrizeModal" :award-name="currentAwardName" :award-image-url="currentAwardImageUrl"
@close="handleGotPrizeModalClose" @happy-get="handleHappyGet"/>
</view>
</template>
......@@ -34,7 +31,6 @@ import {ref, onMounted, computed, getCurrentInstance, provide} from 'vue'
import {fetchPageConfig} from './api.ts'
import {useHomeStore} from '@/stores/home'; // Assuming homeStore path
import {useUserStore} from '@/stores/user'; // Import userStore
import GotPrizeModal from './components/GotPrizeModal.vue'; // Import GotPrizeModal if needed
import ClickArea from "./components/ClickArea.vue";
import ImageSwiper from "./components/ImageSwiper.vue";
import InviteTask from "./components/InviteTask.vue";
......
<template>
<view class="rulemodal" v-if="visible">
<!-- 蒙层 -->
<view class="rulemodal-mask" @click="handleCloseClick"></view>
<!-- 弹窗内容 -->
<view class="rulemodal-content">
<view class="rulemodal" v-if="visible">
<!-- 蒙层 -->
<view class="rulemodal-mask" @click="handleCloseClick"></view>
<!-- 弹窗内容 -->
<view class="rulemodal-content">
<p class="rulemodal-title">活动规则</p>
<!-- 规则内容区域 - 支持滚动 -->
<view class="rulemodal-text-container">
<image class="rulemodaltextimg"
:src="`${$baseUrl}${getRuleImgUrl()}`"
mode="widthFix"
@load="console.log('规则图片加载成功')"
@error="console.log('规则图片加载失败')"></image>
</view>
<!-- 规则内容区域 - 支持滚动 -->
<view class="rulemodal-text-container">
<!-- <image class="rulemodaltextimg"
:src="`${$baseUrl}${getRuleImgUrl()}`"
mode="widthFix"
@load="console.log('规则图片加载成功')"
@error="console.log('规则图片加载失败')"></image>-->
<view class="rulemodal-text">
<p v-for="(item, index) in ruleLines" :key="index">{{ item }}</p>
</view>
</view>
<span class="rulemodalclosebtn"
:style="{ backgroundImage: `url(${getImageUrl(config.images.closeBtn)})` }"
@click="handleCloseClick"></span>
</view>
</view>
<span class="rulemodalclosebtn"
:style="{ backgroundImage: `url(${getImageUrl(config.images.closeBtn)})` }"
@click="handleCloseClick"></span>
</view>
</view>
</template>
<script setup>
import { act1015RuleModalConfig, getImageUrl } from './config.js'
import { getCurrentInstance } from 'vue'
import {act1015RuleModalConfig, getImageUrl} from './config.js'
import {getCurrentInstance, computed} from 'vue'
// 组件名称
defineOptions({
name: 'RuleModal'
name: 'RuleModal'
})
// 获取全局属性
const { proxy } = getCurrentInstance()
const {proxy} = getCurrentInstance()
const $baseUrl = proxy.$baseUrl
// Props
const props = defineProps({
visible: {
type: Boolean,
default: false
},
rules: {
type: String,
default: ''
},
config: {
type: Object,
default: () => ({})
}
visible: {
type: Boolean,
default: false
},
rules: {
type: String,
default: ''
},
config: {
type: Object,
default: () => ({})
}
})
// Emits
const emit = defineEmits(['close'])
const ruleLines = computed(()=>{
return props.rules.split('\n')
})
// 配置对象
const config = act1015RuleModalConfig
// 获取规则图片URL
const getRuleImgUrl = () => {
// 优先使用接口返回的 ruleImg
if (props.config && props.config.ruleImg) {
console.log('使用接口返回的 ruleImg:', props.config.ruleImg)
return props.config.ruleImg
}
// 回退到默认配置
console.log('使用默认配置的 textImg:', config.images.textImg)
const defaultUrl = getImageUrl(config.images.textImg)
console.log('默认图片URL:', defaultUrl)
return defaultUrl
// 优先使用接口返回的 ruleImg
if (props.config && props.config.ruleImg) {
console.log('使用接口返回的 ruleImg:', props.config.ruleImg)
return props.config.ruleImg
}
// 回退到默认配置
console.log('使用默认配置的 textImg:', config.images.textImg)
const defaultUrl = getImageUrl(config.images.textImg)
console.log('默认图片URL:', defaultUrl)
return defaultUrl
}
// 关闭按钮点击处理
const handleCloseClick = () => {
console.log('关闭规则弹窗')
emit('close')
console.log('关闭规则弹窗')
emit('close')
}
</script>
......
......@@ -81,6 +81,10 @@
object-fit: contain;
display: block;
}
.rulemodal-text{
padding: 40rpx;
}
}
.rulemodalclosebtn {
......
const version = 'v1'
const baseUrl = 'http://127.0.0.1:8080/activity/1015'
//const baseUrl = 'http://127.0.0.1:8080/activity/1015'
const baseUrl = 'https://course.feihe.com/momclub-picture/activity/1015'
function getCdnUrl(path){
return `${baseUrl}/${version}/${path}`
......
This diff is collapsed.
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