fix:错误问题
This commit is contained in:
@@ -1,224 +0,0 @@
|
||||
<template>
|
||||
<div class="stepBox">
|
||||
<div class="title">全部活动</div>
|
||||
<div class="home-card">
|
||||
<div class="home-item" v-for="item in activityInfo" :key="item.key">
|
||||
<img class="home-img" :src="item.url" alt="" />
|
||||
<div class="home-bottom">
|
||||
<div class="bottom-title">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
<div
|
||||
class="bottom-btn"
|
||||
v-if="item.isClick"
|
||||
style="background: #1c6fff"
|
||||
@click="openClick"
|
||||
>
|
||||
<span>{{ item.btn }}</span>
|
||||
</div>
|
||||
<div class="bottom-btn" v-else style="background: #d9d8d8">
|
||||
<span>{{ item.btn }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-modal v-model:visible="visible" title="开通活动" footer="">
|
||||
<div class="activity-set">
|
||||
<div class="set-img" v-if="isShow">
|
||||
<div class="set-img-url">
|
||||
<img :src="imgInfo.url" alt="" />
|
||||
</div>
|
||||
<div class="set-img-title">活动设置</div>
|
||||
</div>
|
||||
<div class="set-prompt" v-else>活动次数已用完,请联系管理员购买活动次数</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, onBeforeMount, watch, onMounted } from "vue";
|
||||
import {
|
||||
PlusOutlined,
|
||||
//SearchOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
// 引入router
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
// 引入store
|
||||
import { useStore } from "vuex";
|
||||
import { getActivityList, setUrl } from "@/api/activity";
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useStore();
|
||||
const visible = ref(false);
|
||||
const imgInfo = ref({
|
||||
url: "",
|
||||
aid: "",
|
||||
});
|
||||
let isShow = ref(false);
|
||||
let activityInfo = ref([
|
||||
{
|
||||
key: "1",
|
||||
url: require("@/assets/img/activity/open_activity.jpg"),
|
||||
title: "知识达人争夺赛",
|
||||
btn: "开通活动",
|
||||
isClick: true,
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
url: require("@/assets/img/activity/more_activity.jpg"),
|
||||
title: "测试挑战,你敢吗?",
|
||||
btn: "开通活动",
|
||||
isClick: false,
|
||||
},
|
||||
]);
|
||||
// const requestURL =
|
||||
// process.env.NODE_ENV === "production"
|
||||
// ? "https://www.questiongorilla.com/#/answer?"
|
||||
// : "https://planetg.test.automark.cc/#/answer?";
|
||||
const requestURL = "";
|
||||
// 获取活动列表
|
||||
function openClick() {
|
||||
console.log("开通活动");
|
||||
let url = window.location.href;
|
||||
let num = url.indexOf("?");
|
||||
url = url.substr(num + 1);
|
||||
getActivityList({ status: 2 }).then((res) => {
|
||||
visible.value = true;
|
||||
console.log(res, "res数据");
|
||||
if (res.data.length != 0) {
|
||||
isShow.value = true;
|
||||
imgInfo.value = {
|
||||
url: res.data[0].activity_code,
|
||||
aid: res.data[0].activity_id,
|
||||
};
|
||||
setUrl({ aid: imgInfo.value.aid, url: requestURL + url }).then((res) => {
|
||||
console.log(res, "成功");
|
||||
});
|
||||
} else {
|
||||
isShow.value = false;
|
||||
imgInfo.value = {
|
||||
url: "",
|
||||
aid: "",
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.stepBox {
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
line-height: 24px;
|
||||
position: relative;
|
||||
padding-left: 15px;
|
||||
&::after {
|
||||
content: "";
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #1c6efc;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
.home-card {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
padding: 40px 0px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.home-item {
|
||||
background: #f8faff;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #cbdeff;
|
||||
// width: calc(20% - 30px);
|
||||
width: 259px;
|
||||
height: 533px;
|
||||
// padding: 20px 0px 20px 20px;
|
||||
margin-right: 80px;
|
||||
margin-bottom: 10px;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
&:nth-child(5) {
|
||||
margin-right: 0;
|
||||
}
|
||||
.home-img {
|
||||
display: inline-block;
|
||||
width: 258px;
|
||||
height: 439px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.home-bottom {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
margin-left: 10px;
|
||||
.bottom-title {
|
||||
margin: 0 auto;
|
||||
padding: 12px 0;
|
||||
font-size: 16px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #17315d;
|
||||
line-height: 22px;
|
||||
}
|
||||
.bottom-btn {
|
||||
margin: 0 auto;
|
||||
width: 218px;
|
||||
height: 32px;
|
||||
background: #1c6fff;
|
||||
border-radius: 16px;
|
||||
cursor: pointer;
|
||||
span {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #ffffff;
|
||||
line-height: 31px;
|
||||
padding-left: 82px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.activity-set {
|
||||
height: 254px;
|
||||
.set-img {
|
||||
.set-img-url {
|
||||
width: 172px;
|
||||
height: 166px;
|
||||
margin: 0 auto;
|
||||
margin-top: 20px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.set-img-title {
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #262626;
|
||||
line-height: 100px;
|
||||
}
|
||||
}
|
||||
.set-prompt {
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #262626;
|
||||
line-height: 220px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const AutoImport = require('unplugin-auto-import/webpack')
|
||||
const Components = require('unplugin-vue-components/webpack')
|
||||
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
|
||||
const AutoImport = require('unplugin-auto-import/webpack');
|
||||
const Components = require('unplugin-vue-components/webpack');
|
||||
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers');
|
||||
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
||||
const LodashModuleReplacementPlugin = require("lodash-webpack-plugin");
|
||||
const { proxyUrl, proxyUrlDelivery } = require('./src/config');
|
||||
@@ -9,10 +9,10 @@ const { baseOss } = require('./src/config');
|
||||
const path = require('path');
|
||||
|
||||
const mode = process.env.NODE_ENV;
|
||||
console.log(mode);
|
||||
const isDev = mode === 'development'
|
||||
// console.log(mode);
|
||||
const isDev = mode === 'development';
|
||||
|
||||
function resolve (dir) {
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ module.exports = {
|
||||
less: {
|
||||
lessOptions: {
|
||||
modifyVars: {
|
||||
'primary-color': '#70b936',// 修改全局主题色
|
||||
'primary-color': '#70b936', // 修改全局主题色
|
||||
},
|
||||
javascriptEnabled: true,
|
||||
}
|
||||
@@ -87,8 +87,8 @@ module.exports = {
|
||||
config.plugin("loadshReplace").use(new LodashModuleReplacementPlugin());
|
||||
config.plugin('html').tap(args => {
|
||||
args[0].title = "智能调研工具";
|
||||
return args
|
||||
})
|
||||
return args;
|
||||
});
|
||||
// config.module
|
||||
// .rule('vue')
|
||||
// .test(/\.vue$/)
|
||||
|
||||
Reference in New Issue
Block a user