123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595 |
- <template>
- <div class="my">
- <!-- <van-nav-bar title="我的" class="van-nav-bar-my-fixed" fixed /> -->
- <!-- right-text="登出"
- -->
- <div class="mine-resume">
- <div class="bgImg">
- <img src="@/assets/images/my/personal/bgImg.png" alt="" />
- </div>
- <div class="my-info">
- <img src="@/assets/images/my/personal/my-info.png" alt="" />
- <div class="mine-resume-main">
- <ul class="clear headerBox">
- <div class="headerImg">
- <img :src="header" alt="" />
- <div class="header-info">
- <p>欢迎您!</p>
- <span>尊敬的金卡用户</span>
- </div>
- </div>
- <div class="headerDesc">
- <li v-if="userData === null">
- <p class="title"><span>登录</span></p>
- </li>
- <li v-else class="usable">
- <span>有效期至{{ userData.expiretime }}</span>
- </li>
- <li class="header-username">
- <span>NO:{{ username }}</span>
- </li>
- </div>
- </ul>
- </div>
- </div>
- <div class="top">
- <!-- 我的页面下待收,待发、售后盒子 -->
- <p>我的订单</p>
- <ul class="cell-vip">
- <li
- v-for="(item, index) in cellVip"
- :key="item.name + index"
- class="vip-item"
- @click="showT(index)"
- >
- <img class="cell-my-img" :src="item.id" alt="" />
- <span class="vip-title">{{ item.name }}</span>
- </li>
- </ul>
- </div>
- <div class="bottom">
- <p class="common">常用功能</p>
- <div class="cell-list">
- <div
- class="box-detaile"
- is-link
- v-for="(item, index) in cellList"
- :key="item.name + index"
- @click="goto(item.anchor, item.name)"
- >
- <div class="detaile-box">
- <div class="cell-my-img">
- <img :src="item.id" alt="" />
- </div>
- <div class="custom-title">
- {{ item.name }}
- </div>
- </div>
- </div>
- </div>
- <div class="my-btn-main">
- <!-- <van-button
- class="my-button"
- block
- type="info"
- @click.native="logout()"
- >
- 退出登录
- </van-button> -->
- <div class="footer">
- <img src="@/assets/images/my/footer.png" />
- </div>
- <div style="height: 50px"></div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import asyncRequest from "@/apis/my/index";
- import resToken from "@/mixins/resToken";
- import { Dialog } from "vant";
- export default {
- mixins: [resToken],
- data() {
- return {
- header: require("@/assets/images/my/header.png"), //用户头像
- userData: null,
- active: require("@/assets/images/my/menu.png"),
- ad: require("@/assets/images/my/ad.png"), //地理定位
- order: require("@/assets/images/my/my-order.png"), //用户订单
- unshipped: require("@/assets/images/my/unshipped.png"), //待发货
- shipped: require("@/assets/images/my/shipped.png"), //待收货
- service: require("@/assets/images/my/service.png"), //客户服务
- vip_bg: require("@/assets/images/my/vip_bg.png"), //vip盒子背景图
- vip_text: require("@/assets/images/my/vip_text.png"), //vip
- saleAfter: require("@/assets/images/my/saleAfter.png"), //售后服务
- loading: false,
- cellList: [],
- cellVip: [],
- canStockBag: "",
- canStockBox: "",
- username: "",
- };
- },
- async created() {
- this.cellList = [
- {
- anchor: "/address",
- id: this.ad,
- name: "我的地址",
- },
- {
- anchor: "/order",
- id: this.order,
- name: "历史订单",
- },
- {
- anchor: "/referMenu",
- id: this.active,
- name: "推荐菜谱",
- },
- {
- anchor: "/aboutUs",
- id: this.service,
- name: "联系我们",
- },
- ];
- // await this.getUserInfor();
- this.cellVip = [
- {
- anchor: "/address",
- id: this.unshipped,
- name: "待发货",
- },
- {
- anchor: "/order",
- id: this.shipped,
- name: "待收货",
- },
- {
- anchor: "/referMenu",
- id: this.saleAfter,
- name: "售后",
- },
- ];
- },
- mounted() {
- this.getStock();
- },
- methods: {
- goto(url, name) {
- window.vm.$router.push({
- path: url,
- query: {
- type: name,
- },
- });
- },
- async getStock() {
- if (!this.loading) {
- let res = await asyncRequest.detail({});
- if (res && res.code == 0) {
- this.userData = res.data;
- this.username = res.data.username;
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.show_title(res.msg);
- }
- }
- },
- showT(index) {
- console.log(index);
- if (index === 2) {
- // Dialog.alert({
- // message: "敬请期待!",
- // }).then(async () => {});
- window.vm.$router.push({
- path: "/referMenu",
- query: {
- type: "售后",
- },
- });
- } else {
- window.vm.$router.push({
- path: "/order",
- query: {
- type: index + 1 + "",
- },
- });
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .my {
- position: relative;
- width: 100%;
- height: 100%;
- .mine-resume {
- padding-top: 46px;
- position: relative;
- box-sizing: border-box;
- width: 100%;
- height: 100vh;
- background: #e6e6dc;
- .mine-resume-main {
- // background:linear-gradient(0deg, rgba(255,255,255,.1) 0%, #fff 80%);;
- // background-color: #fff;
- padding: 0 0;
- // margin: -19vh 0 0 0;
- left: 10px;
- top: 20px;
- position: absolute;
- ul {
- background: transparent;
- li {
- float: left;
- &:first-child {
- width: calc(100% - 60px);
- p {
- width: 188px;
- padding: 0 16px 0 0;
- margin: 0;
- color: #daad70;
- // color: #1a1a1a;
- font-size: 12px;
- line-height: 16px;
- color: #999999;
- &.title {
- color: #daad70;
- // color: #1a1a1a;
- font-weight: bolder;
- font-size: 16px;
- height: 100px;
- line-height: 21px;
- padding: 0 16px 0 0;
- }
- }
- }
- &:last-child {
- // width: 60px;
- text-align: center;
- margin: 0 0 0 0;
- }
- }
- }
- .headerBox {
- width: 80vw;
- margin: 0px auto;
- }
- .headerImg {
- width: 47.5px;
- height: 47.5px;
- border-radius: 50%;
- // position: absolute;
- // left: 35px;
- // top: 20px;
- img {
- width: 100%;
- border-radius: 50%;
- }
- .header-info {
- width: 86px;
- height: 29.5px;
- float: left;
- margin: -43px 0 0 60px;
- // position: absolute;
- // left: 55px;
- // top: 7px;
- p {
- margin: 0;
- // width: 74px;
- height: 15px;
- font-size: 15px;
- font-family: Source Han Sans CN;
- font-weight: 500;
- color: #5c3501;
- line-height: 15px;
- opacity: 0.8;
- }
- span {
- color: #5c3501;
- }
- }
- }
- .headerDesc {
- width: 90vw;
- overflow: hidden;
- display: flex;
- height: 19px;
- margin: 0 0 0 -10px;
- .usable {
- // width: 188px;
- // height: 19px;
- margin: 0 5px 0 0;
- width: 52vw;
- font-size: 0.5rem;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #5c3501;
- line-height: 10px;
- height: 13px;
- // position: absolute;
- overflow: hidden;
- left: 30px;
- top: 110px;
- }
- .header-username {
- margin: 0 0px 0 10px;
- font-size: 0.5rem;
- font-family: Source Han Sans CN;
- font-weight: 500;
- color: #5c3501;
- line-height: 10px;
- height: 10px;
- // position: absolute;
- left: 235px;
- top: 110px;
- }
- }
- }
- /**vip开通框 */
- .vip-box {
- width: 100%;
- height: 50px;
- position: relative;
- .vip-bg {
- border-top-left-radius: 13px;
- border-top-right-radius: 13px;
- width: 80%;
- height: 49px;
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- background-color: #292f46;
- img {
- width: 44px;
- height: 19px;
- display: block;
- position: absolute;
- left: 26px;
- top: 18px;
- }
- }
- .vip-text {
- width: 100px;
- img {
- width: 100%;
- }
- }
- }
- .my-btn-main {
- width: 321.5px;
- margin: 40px auto 0;
- box-sizing: border-box;
- // .my-button {
- // box-sizing: border-box;
- // display: inline-block;
- // border-radius: 20px;
- // background: #dbdbdb;
- // border: 0;
- // }
- .footer {
- width: 321.5px;
- height: 95px;
- img {
- width: 100%;
- }
- }
- }
- // <!-- 我的页面下待收,待发、售后盒子 -->
- .top {
- width: 100%;
- padding: 0 20px;
- box-sizing: border-box;
- background: #e6e6dc;
- margin: 0vh 0 0 0;
- // height:140px;
- p {
- width: 64.5px;
- height: 15px;
- font-size: 16px;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #242424;
- line-height: 13px;
- }
- .vip-box {
- height: 70px;
- background-color: #292f46;
- border-radius: 15px;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- padding: 13px 13px;
- box-sizing: border-box;
- img {
- display: inline-block;
- height: 23px;
- }
- .open-btn {
- background: linear-gradient(90deg, #dfa460 0%, #f0d0a1 100%);
- border-radius: 10px;
- float: right;
- color: #fff;
- line-height: 18px;
- padding: 3px 8px;
- }
- }
- }
- /**vip服务区域样式 */
- .cell-vip {
- // width: 331px;
- height: 81px;
- background: #fcfcf0;
- border-radius: 16px;
- padding: 10px 0px 20px 0;
- height: 50px;
- display: flex;
- margin: 0 0 0 0px;
- .cell-my-img {
- display: block;
- width: 45px;
- height: 45px;
- }
- .vip-title {
- display: inline-block;
- height: 10px;
- line-height: 20px;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #8a8a8a;
- }
- .vip-item {
- height: 45px;
- display: inline-block;
- flex: 1;
- text-align: center;
- font-size: 12px;
- color: #4d4d4d;
- line-height: 6px;
- text-align: center;
- img {
- width: 45px;
- height: 45px;
- display: inline-block;
- }
- span {
- height: 16px;
- display: block;
- }
- }
- }
- }
- .common {
- margin: 10px;
- width: 110px;
- height: 26px;
- font-size: 14px;
- font-weight: 600;
- color: #333333;
- line-height: 26px;
- position: relative;
- top: 0;
- left: 0;
- padding: 8px 0px 8px 15px;
- }
- .bottom {
- width: 100vw;
- box-sizing: border-box;
- background: #e6e6dc;
- margin: 0 0 0 0;
- p {
- margin: 0;
- }
- /**地址栏收获样式 */
- .cell-list {
- padding: 0 20px;
- height: 81px;
- background: #fcfcf0;
- border-radius: 16px;
- padding: 10px 0px;
- height: 50px;
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- margin: 0 20px;
- .van-cell__title {
- width: 200px;
- position: relative;
- left: 0;
- top: 0;
- text-align: center;
- img {
- margin: 0 40px;
- }
- }
- .box-detaile {
- flex: 1;
- text-align: center;
- .detaile-box {
- width: 20vw;
- margin: 0 auto;
- text-align: center;
- .cell-my-img {
- height: 25px;
- width: 100%;
- overflow: hidden;
- img {
- display: inline-block;
- height: 25px;
- width: auto;
- margin: 0 auto;
- }
- }
- .custom-title {
- margin-top: 8px;
- }
- }
- }
- }
- }
- //常用功能下的按钮
- // 改
- .bgImg {
- width: 100%;
- height: 246px;
- position: absolute;
- top: 0px;
- img {
- width: 100%;
- }
- }
- .my-info {
- width: 90vw;
- // float: left;
- position: relative;
- left: 0;
- top: 0;
- margin: 15vh auto 0;
- img {
- position: relative;
- width: 100%;
- }
- }
- @media screen and (min-width: 320px) {
- .mine-resume .mine-resume-main .headerDesc {
- margin-top: 27px;
- }
- }
- @media screen and (min-width: 375px) {
- .mine-resume .mine-resume-main .headerDesc {
- margin-top: 53px;
- margin: 53px 0 0 5px;
- }
- }
- @media screen and (min-width: 414px) {
- .mine-resume .mine-resume-main .headerDesc {
- margin-top: 53px;
- margin: 66px 0 0 5px;
- }
- }
- }
- </style>
|