123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859 |
- <script setup>
- import { ref, onMounted } from "vue";
- import { Search, Promotion, Avatar } from "@element-plus/icons-vue";
- import { useUser } from "~/store/user.js";
- import ActivateMembership from "~/components/ActivateMembership/index.vue";
- import SvgIcon from "~/components/SvgIcon/index.vue";
- import Login from "~/components/Login/Login.vue";
- import Level from "~/components/Level/index.vue";
- import * as qianApi from "~/api/qiandao";
- import { getPicUrl } from "~/utils/util";
- import * as taskApi from "~/api/task";
- import { useRouter } from "vue-router";
- const tosuccess = (type)=>{
- if(type=='browse'){
- router.replace({
- name:'Forum'
- })
- }
- }
- const router = useRouter();
- const dialogVisible = ref(false);
- const clearLocalStorage = () => {
- localStorage.clear();
- dialogVisible.value = false;
- router.go(0);
- };
- const topersonal = () => {
- router.push({
- path: "/personal",
- });
- };
- let taskList = ref([]);
- const __task__ = async () => {
- try {
- const { data } = await taskApi.list({
- is_page: 0,
-
- });
- taskList.value = data.reverse();
- } catch (error) {}
- };
- onMounted(__task__);
- const User = useUser();
- console.log("user", User.name);
- let wid = User.already_upgrade_rate * 100 || 0;
- console.log(User.already_upgrade_rate);
- const keyword = ref("");
- const levelList = ref([]);
- const __level__ = async () => {
- try {
- const { data } = await qianApi.level({
- is_page: 0,
- });
- levelList.value = data;
- } catch (error) {}
- };
- onMounted(__level__);
- const toget = (id, type) => {
- __leve__(id, type);
- };
- const __leve__ = async (id) => {
- try {
- const { data } = await qianApi.levelPrize({
- id: id,
- address_id: "",
- });
- __level__();
- ElMessage.success({
- message: "领取成功",
- type: "success",
- });
- } catch (error) {}
- };
- const momentList = ref([
- {
- label: "论坛",
- icon: getPicUrl("../../assets/cicons/send-01.png", import.meta.url),
- type: "",
- },
- {
- label: "文章",
- icon: getPicUrl("../../assets/cicons/send-02.png", import.meta.url),
- type: "",
- },
- {
- label: "资讯",
- icon: getPicUrl("../../assets/cicons/send-03.png", import.meta.url),
- type: "",
- },
- {
- label: "视频",
- icon: getPicUrl("../../assets/cicons/send-04.png", import.meta.url),
- type: "",
- },
- {
- label: "草稿箱",
- icon: getPicUrl("../../assets/cicons/send-05.png", import.meta.url),
- type: "",
- },
- ]);
- const handleClickMoment = (moment) => {
- console.log(
- "%c click moment item >>>",
- "background: blue; color: #fff",
- moment
- );
- };
- const toinform = (idx) => {
- if (idx == 0) {
- router.push({
- path: "/conversion",
- query: {},
- });
- }
- };
- const inform = (idx) => {
- router.push({
- path: "/inform",
- query: {},
- });
- };
- let pan = ref(false);
- const member = () => {
- pan.value = true;
- };
- const visibilityLoginDialog = ref(false);
- const handleLogin = () => {
- visibilityLoginDialog.value = true;
- };
- const attention = (idx) => {
- if (idx == 0) {
- router.replace({
- name: "Follow",
- });
- } else {
- router.replace({
- name: "Home",
- });
- }
- };
- </script>
- <template>
- <div class="header-container flex-row flex-aic flex-jc-sb">
- <div class="logo">ny-logo</div>
- <div class="header__content flex-row flex-aic flex-jc-sb">
- <el-input
- v-model="keyword"
- class="searchbox"
- placeholder="VR拍摄"
- :suffix-icon="Search"
- />
- <el-button-group>
- <el-button @click="attention(0)">关注</el-button>
- <el-button @click="attention(1)" type="primary">最新</el-button>
- </el-button-group>
- <div class="header__content__right flex-row flex-aic">
- <el-popover
- popper-class="vip-poperclass"
- placement="bottom"
- :width="332"
- trigger="click"
- >
- <template #reference>
- <el-button class="vip-btn">
- <SvgIcon name="crown" :size="19" :rgap="3" color="#523618" />
- 忆象会员
- </el-button>
- </template>
- <div class="vip-container">
- <div class="vip-card flex-col flex-jc-sb">
- <div class="vip-card__header flex-row">
- <div class="vip-avatar">
- <img :src="User.avatar" :alt="User.name" class="circle" />
- </div>
- <div class="vip-userinfo">
- <div class="vname">{{ User.name }}</div>
- <div class="vdesc">{{ User.introduction }}</div>
- </div>
- </div>
- <div class="vip-card__footer flex-row flex-jc-sb">
- <template v-if="User.is_vip">
- <span style="width: 170px"
- >会员有效期至{{ User.vip_expired_at }}</span
- >
- <span @click="member">立即续费</span>
- </template>
- <template v-else>
- <span>开通会员享权益</span>
- <span @click="member">立即开通</span>
- </template>
- </div>
- </div>
-
-
- <div class="vip-sign-prizes">
- <div
- class="prize-box"
- v-for="(item, idx) in levelList"
- :key="idx"
- >
- <div class="prize-box__img"></div>
- <div class="prize-box__title">等级达到{{ item.level }}级</div>
- <div class="prize-box__sub-title">{{ item.prize_name }}</div>
- <el-button type="primary" disabled v-if="item.is_received == 1"
- >已领取</el-button
- >
- <el-button
- type="primary"
- v-if="item.is_received == 0 && item.is_qualified == 1"
- @click="toget(item.id, item.prize_type)"
- >领取</el-button
- >
- <el-button link disabled v-if="item.is_qualified == 0"
- >未达标</el-button
- >
- </div>
- </div>
- <div class="vip-footer">等级奖励</div>
- </div>
- </el-popover>
-
- <template v-if="User.token">
- <el-button type="primary">
- <SvgIcon name="people" :size="19" color="#ffffff" />
- 邀请好友
- </el-button>
-
- <el-popover placement="bottom" :width="120" trigger="click">
- <template #reference>
- <el-button type="primary" :icon="Promotion">发布</el-button>
- </template>
- <div class="moment-container">
- <ul>
- <li
- v-for="(moment, idx) in momentList"
- :key="idx"
- class="flex-row flex-aic"
- @click="handleClickMoment(moment)"
- >
- <img :src="moment.icon" :alt="moment.label" class="icon" />
- <span class="moment__label">{{ moment.label }}</span>
- </li>
- </ul>
- </div>
- </el-popover>
- <el-button link @click="inform">
- <SvgIcon name="ding" :size="24"></SvgIcon>
- </el-button>
-
- <el-popover placement="bottom-start" :width="276" trigger="click">
- <template #reference>
- <div class="userinfo-avatar">
- <img class="circle" :src="User.avatar" :alt="User.name" />
- </div>
- </template>
- <div class="userinfo-container uc">
- <div class="uc__avatar" @click="topersonal">
- <img class="circle" :src="User.avatar" :alt="User.name" />
- </div>
- <div class="uc__name">{{ User.name }}</div>
-
- <div class="uc__flags">
- <img src="" alt="" />
- </div>
- <div class="uc__integral flex-row flex-aic flex-jc-sb">
- <span class="integral_text"
- >当前积分{{ User.integral_sum }},差{{
- User.left_upgrade
- }}升级</span
- >
- <el-dropdown>
- <el-button class="task-btn" link>任务列表</el-button>
- <template #dropdown>
- <el-dropdown-menu>
-
- <div v-for="(item, idx) in taskList" :key="idx">
- <el-dropdown-item>
- <div
- style="
- width: 320px;
- padding: 12px 8px;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- align-items: center;
- "
- >
- <div style="display: flex">
- <img
- style="width: 34px; height: 34px"
- :src="item.image"
- alt=""
- />
- <div style="margin-left: 8px">
- <div class="title">
- {{ item.name }}({{ item.finished_times }}/{{
- item.times
- }})
- </div>
- <div
- v-if="item.status == 'finished'"
- class="bottom"
- >
- +经验{{ item.integral }}
- </div>
- <div
- v-if="item.status == 'pending'"
- class="bottom"
- style="color: #777777"
- >
- +经验{{ item.integral }}
- </div>
- </div>
- </div>
- <div
- class="success"
- v-if="item.status == 'pending'"
- style="background: #00b0b0"
- @click="tosuccess(item.source_type)"
- >
- 去完成
- </div>
- <div class="success" v-else>已完成</div>
- </div>
- </el-dropdown-item>
- </div>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- </div>
- <div class="uc__grade">
- <div class="uc__grade__show-bar">
- <div class="sb-inside" :style="{ width: wid + '%' }"></div>
- </div>
- <div class="uc__grade_txt flex-row flex-jc-sb">
- <Level :level="User.level" full />
- <Level :level="User.level + 1" />
- </div>
- </div>
- <div class="uc__part">
- <div>
- <div>{{ User.follow_count || 0 }}</div>
- <div>关注</div>
- </div>
- <div>
- <div>{{ User.fans_count || 0 }}</div>
- <div>粉丝</div>
- </div>
- <div>
- <div>{{ User.collect_count || 0 }}</div>
- <div>收藏</div>
- </div>
- <div>
- <div>{{ User.view_count || 0 }}</div>
- <div>足迹</div>
- </div>
- </div>
- <div class="uc__gap"></div>
- <div class="uc__item">
- <div class="itembox" @click="toinform(0)">
- <div class="icon">
- <img
- src="../../assets/cicons/header-01.png"
- style="width: 20px; height: 20px"
- alt=""
- />
- </div>
- <div class="label">兑换记录</div>
- </div>
- <div class="itembox" @click="toinform(1)">
- <div class="icon">
- <img
- src="../../assets/cicons/header-02.png"
- style="width: 20px; height: 20px"
- alt=""
- />
- </div>
- <div class="label">预约记录</div>
- </div>
- <div class="itembox" @click="toinform(2)">
- <div class="icon">
- <img
- src="../../assets/cicons/header-03.png"
- style="width: 20px; height: 20px"
- alt=""
- />
- </div>
- <div class="label">租赁记录</div>
- </div>
- <div class="itembox" @click="toinform(3)">
- <div class="icon">
- <img
- src="../../assets/cicons/header-04.png"
- style="width: 20px; height: 20px"
- alt=""
- />
- </div>
- <div class="label" @click="toinform(4)">签到奖励</div>
- </div>
- <div class="itembox">
- <div class="icon">
- <img
- src="../../assets/cicons/header-05.png"
- style="width: 20px; height: 20px"
- alt=""
- />
- </div>
- <div class="label">积分明细</div>
- </div>
- <div class="itembox" @click="toinform(5)">
- <div class="icon">
- <img
- src="../../assets/cicons/header-06.png"
- style="width: 20px; height: 20px"
- alt=""
- />
- </div>
- <div class="label" @click="dialogVisible = true">
- 退出忆象
- </div>
- </div>
- </div>
- </div>
- </el-popover>
- </template>
- <template v-else>
- <el-button type="primary" @click="handleLogin">登录/注册</el-button>
- </template>
- </div>
- </div>
- </div>
- <ActivateMembership :visiblePay="pan" />
- <Login v-model="visibilityLoginDialog" />
-
- <el-dialog title="提示" v-model="dialogVisible" width="416px">
- <div>确定要退出忆象吗?</div>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="clearLocalStorage">确 定</el-button>
- </span>
- </template>
- </el-dialog>
- </template>
- <style lang="scss" scoped>
- @import "~/styles/variable.scss";
- .bottom {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 10px;
- color: #ff6700;
- line-height: 14px;
- text-align: left;
- font-style: normal;
- }
- .title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 12px;
- color: #222222;
- line-height: 17px;
- text-align: left;
- font-style: normal;
- }
- .success {
- width: 56px;
- height: 24px;
- background: #d7d7d7;
- border-radius: 14px;
- line-height: 24px;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 11px;
- color: #ffffff;
- line-height: 24px;
- text-align: center;
- font-style: normal;
- }
- .header {
- &-container {
- height: 66px;
- background: #ffffff;
- box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.06);
- padding-right: 20px;
- border-bottom: 1px solid rgba(240, 240, 240, 1);
- box-sizing: border-box;
- }
- &__content {
- width: 0;
- flex: 1;
- &__right {
- .vip-btn {
- background-color: rgba(255, 234, 203, 1);
- color: #523618;
- }
- }
- }
- .logo {
- width: 210px;
- height: 66px;
- }
- .searchbox {
- width: 346px;
- height: 36px;
- border-radius: 4px;
- :deep(.el-input__wrapper) {
- background-color: #f4f4f4;
- }
- }
- }
- .vip {
- &-container {
- width: 308px;
- padding: 4px;
- box-sizing: border-box;
- }
- &-poperclass {
- background: #ffffff;
- box-shadow: 0px 0px 20px -8px rgba(0, 0, 0, 0.4);
- border-radius: 8px;
- }
- &-card {
- width: 300px;
- height: 122px;
- border-radius: 10px;
- background-image: url("~/assets/vip/bgc.png");
- background-size: 300px 122px;
- padding: 14px 12px 18px 14px;
- box-sizing: border-box;
- overflow: hidden;
- &__header {
- .vip-avatar {
- width: 36px;
- height: 36px;
- background-color: #fff;
- border-radius: 36px;
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- .vip-userinfo {
- padding-left: 10px;
- .vname {
- font-size: 14px;
- font-weight: 500;
- color: #ffffff;
- line-height: 16px;
- }
- .vdesc {
- font-size: 12px;
- font-weight: 400;
- color: #ffffff;
- line-height: 22px;
- }
- }
- }
- &__footer {
- span {
- &:last-child {
- color: $orange;
- cursor: pointer;
- }
- }
- }
- }
- &-sign-prizes {
- display: grid;
- grid-template-columns: repeat(3, 33.33%);
- padding: 0px 0 20px 0;
- .prize-box {
- text-align: center;
- margin-top: 20px;
- &__img {
- width: 48px;
- height: 48px;
- background: #ff7b15;
- border-radius: 8px;
- opacity: 0.1;
- margin: 0 auto 6px;
- }
- &__title {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- line-height: 26px;
- }
- &__sub-title {
- font-size: 12px;
- font-weight: 400;
- color: #888888;
- line-height: 18px;
- margin-bottom: 6px;
- }
- .el-button.el-button--primary.is-disabled {
- background-color: #d8d8d8;
- }
- }
- }
- &-footer {
- text-align: center;
- font-size: 14px;
- font-weight: 400;
- color: #57c3c2;
- // line-height: 40px;
- padding-top: 16px;
- border-top: 1px solid rgba(204, 204, 204, 0.4);
- }
- }
- .moment {
- &-container {
- ul {
- list-style: none;
- padding-inline-start: 0;
- margin: 0;
- li {
- user-select: none;
- cursor: pointer;
- padding: 8px 7px;
- .icon {
- width: 22px;
- height: 22px;
- margin-right: 10px;
- }
- &:nth-child(4) {
- border-bottom: 1px solid #eaeaea;
- }
- &:last-child {
- padding-bottom: initial;
- }
- }
- }
- }
- &__label {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- line-height: 20px;
- cursor: pointer;
- }
- }
- .userinfo {
- &-avatar {
- cursor: pointer;
- margin-left: 20px;
- display: inline-block;
- width: 36px;
- height: 36px;
- background-color: blue;
- border-radius: 50%;
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- &-container {
- padding: 4px;
- .uc {
- &__avatar {
- width: 58px;
- height: 58px;
- margin: auto;
- border-radius: 50%;
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- &__name {
- font-size: 12px;
- font-weight: 600;
- color: #222222;
- line-height: 17px;
- text-align: center;
- padding: 8px 0;
- }
- &__flags {
- text-align: center;
- img {
- width: 12px;
- height: 12px;
- background-color: green;
- margin-right: 4px;
- &:last-child {
- margin-right: initial;
- }
- }
- }
- &__integral {
- .task-btn {
- font-size: 12px;
- font-weight: 400;
- color: #00b0b0;
- line-height: 14px;
- }
- }
- &__grade {
- padding: 10px 0;
- &__show-bar {
- position: relative;
- z-index: 1;
- height: 3px;
- width: 100%;
- background-color: #ccc;
- &::after,
- &::before {
- position: absolute;
- z-index: 2;
- top: 50%;
- transform: translate(-50%, -50%);
- content: "";
- width: 8px;
- height: 8px;
- border-radius: 8px;
- background: #efefef;
- }
- &::before {
- left: 0;
- background-color: #00b0b0;
- }
- &::after {
- right: -8px;
- }
- .sb-inside {
- width: 0%;
- height: 3px;
- background-color: rgba(0, 176, 176, 1);
- }
- }
- &_txt {
- padding: 6px 0;
- }
- }
- &__part {
- display: flex;
- justify-content: space-between;
- padding-bottom: 10px;
- > div {
- text-align: center;
- div:first-child {
- font-size: 16px;
- font-weight: 400;
- color: #222222;
- line-height: 17px;
- }
- div:last-child {
- padding-top: 4px;
- font-size: 12px;
- font-weight: 400;
- color: #666666;
- line-height: 17px;
- }
- }
- }
- &__gap {
- height: 1px;
- background-color: rgba(225, 225, 225, 0.546);
- }
- &__item {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- padding-top: 10px;
- .itembox {
- width: 33%;
- margin-bottom: 10px;
- text-align: center;
- cursor: pointer;
- }
- }
- }
- }
- }
- </style>
|