|
|
- <template>
- <view class="page">
-
- <navbar title="个人中心" bgColor="#001B3C" color="#FFFFFF" />
-
- <view class="head">
- <view class="headImage">
- <!-- todo: 换回接口提供的 -->
- <image src="@/static/image/center/temp-avatar.png" mode=""></image>
- </view>
- <view class="info">
- <view class="name">
- <!-- todo: 换回接口提供的 -->
- 裂变星1号
- </view>
- <view class="tags">
- <!-- todo: 换回接口提供的 -->
- <view class="tag">
- <text class="tag-label">ID:</text>
- <text>12345678</text>
- </view>
- <view v-if="isAgent" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
- <image src="@/static/image/center/agent-icon.png"></image>
- </view>
- <view v-else class="tag">
- 普通会员
- </view>
- </view>
- </view>
- <view class="setting" @click="goSetting">
- <uv-icon name="setting" color="#FFFFFF" size="48rpx"></uv-icon>
- </view>
- </view>
-
- <view class="tools-box">
- <image class="tools-bg" src="@/static/image/center/tools-bg.png"></image>
- <view class="flex activate">
- <template v-if="isAgent">
- <view class="activate-tips" style="padding-left: 27rpx;">
- <view>代理商权益</view>
- <view>
- 将于<text class="activate-highlight">{{ agentDeadline }}</text>到期
- </view>
- </view>
- <view class="btn-activate" @click="onActivate">
- <image src="@/static/image/center/btn-activate-again.png"></image>
- </view>
- </template>
- <template v-else>
- <view class="activate-tips">
- 升级成为代理商享受更多权益
- </view>
- <view class="btn-activate" @click="onActivate">
- <image src="@/static/image/center/btn-activate.png"></image>
- </view>
- </template>
- </view>
- <view class="tools flex">
- <view class="tool" @click="$utils.navigateTo('/pages_order/mine/sharing')">
- <view class="tool-icon">
- <image src="@/static/image/center/tool-share.png"></image>
- </view>
- <text>分享好友</text>
- </view>
- <view class="tool" @click="onActivate">
- <view class="tool-icon">
- <image src="@/static/image/center/tool-activate.png"></image>
- </view>
- <text>激活码</text>
- </view>
- <view class="tool" @click="$utils.navigateTo('/pages_order/mine/wallet')">
- <view class="tool-icon">
- <image src="@/static/image/center/tool-wallet.png"></image>
- </view>
- <text>我的钱包</text>
- </view>
- <view class="tool" @click="$utils.navigateTo('/pages_order/mine/team')">
- <view class="tool-icon">
- <image src="@/static/image/center/tool-team.png"></image>
- </view>
- <text>我的团队</text>
- </view>
- </view>
- </view>
-
- <view class="content">
- <view class="card notice">
- <view class="notice-icon">
- <image src="@/static/image/center/notice.png"></image>
- </view>
- <uv-notice-bar
- :text="notice"
- bgColor="transparent"
- color="#001B3C"
- :icon="false"
- fontSize="28rpx"
- :customStyle="{
- padding: 0,
- }"
- ></uv-notice-bar>
- </view>
-
- <view class="card updates">
- <view class="updates-header">
- <view class="updates-header-bg">
- <image src="@/static/image/center/title-bg.png"></image>
- </view>
- <view class="updates-header-content">
- 动态更新
- </view>
- </view>
- <view class="updates-content">
- <view class="card updates-item"
- v-for="item in updateList"
- :key="item.id"
- @click="goToSharingDetail(item.id, item.state)"
- >
- <view class="updates-item-img">
- <image :src="item.imageUrl"></image>
- </view>
- <view class="updates-item-info">
- <view class="updates-item-title">{{ item.title }}</view>
- <view class="updates-item-desc">{{ item.description }}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
-
- <view class="service" @click="$utils.navigateTo('/pages_order/mine/service')">
- <image src="@/static/image/center/service.png" mode=""></image>
- </view>
-
- <popupActivate ref="popupActivate"></popupActivate>
- <popupSharing ref="popupSharing"></popupSharing>
-
- <tabber select="center" />
- </view>
- </template>
-
- <script>
- import tabber from '@/components/base/tabbar.vue'
- import {
- mapGetters
- } from 'vuex'
- import popupActivate from '@/components/center/popupActivate.vue'
-
- const URL_MAPPING = { // state -> url
- '-1': '/pages_order/sharing/personal',
- '0': '/pages_order/sharing/video',
- '1': '/pages_order/sharing/group',
- '2': '/pages_order/sharing/article',
- }
-
- export default {
- components: {
- tabber,
- popupActivate,
- },
- computed: {
- ...mapGetters(['userShop']),
- },
- data() {
- return {
- isAgent: false,
- agentDeadline: '2025年12月31日',
- notice: '如果您在使用中有任何问题或建议,请联系客服',
- updateList: [
- {
- id: '001',
- imageUrl: '../../static/image/center/temp.png',
- times: 10,
- qrCode: null,
- title: '裂变星轻松获客',
- description: '如此好用的赚钱项目,赶快加入吧!',
- auditStatus: 2,
- createTime: '2025年2月1日',
- state: -1,
- },
- {
- id: '002',
- imageUrl: '../../static/image/center/temp.png',
- times: 10,
- qrCode: null,
- title: '裂变星轻松获客',
- description: '如此好用的赚钱项目,赶快加入吧!',
- auditStatus: 2,
- createTime: '2025年2月1日',
- state: 0,
- },
- {
- id: '003',
- imageUrl: '../../static/image/center/temp.png',
- times: 10,
- qrCode: null,
- title: '裂变星轻松获客',
- description: '如此好用的赚钱项目,赶快加入吧!',
- auditStatus: 2,
- createTime: '2025年2月1日',
- state: 1,
- },
- {
- id: '004',
- imageUrl: '../../static/image/center/temp.png',
- times: 10,
- qrCode: null,
- title: '裂变星轻松获客',
- description: '如此好用的赚钱项目,赶快加入吧!',
- auditStatus: 2,
- createTime: '2025年2月1日',
- state: 2,
- },
- ]
- }
- },
- onShow() {
- // todo: 获取信息(用户信息、最新动态)
- },
- onReachBottom() {
- // todo: 获取更多动态?
- },
- methods: {
- headBtn() {
- let self = this
- uni.showModal({
- title: '演示切换角色之后的效果',
- success(res) {
- if (res.confirm) {
- self.$store.state.shop = !self.$store.state.shop
- }
- }
- })
- },
- goSetting() {
- // todo
- },
- onActivate() {
- this.$refs.popupActivate.open(this.isAgent)
- },
- goToSharingDetail(id, state) {
- uni.navigateTo({
- url: `${URL_MAPPING[state]}?id=${id}`
- })
- },
- }
- }
- </script>
-
- <style scoped lang="scss">
- .page {
-
- background-color: #001B3C;
- min-height: 100vh;
- }
-
- image {
- width: 100%;
- height: 100%;
- }
-
- .head {
- display: flex;
- padding: 20rpx 26rpx 18rpx 40rpx;
- align-items: center;
- position: relative;
-
- .headImage {
- width: 143rpx;
- height: 143rpx;
- overflow: hidden;
- border-radius: 50%;
- margin-right: 40rpx;
- }
-
- .info {
- .name {
- color: #FFFFFF;
- font-size: 38rpx;
- margin-bottom: 12rpx;
- }
-
- .tags {
-
- }
- }
-
- .headBtn {
- margin-left: auto;
- padding: 15rpx 20rpx;
- background-color: $uni-color;
- color: #fff;
- border-radius: 20rpx;
- margin-top: 50rpx;
- }
-
- .setting {
- position: absolute;
- right: 26rpx;
- top: 37rpx;
- }
- }
-
- .tag {
- display: inline-block;
- padding: 6rpx 21rpx;
- border: 1rpx solid #999999;
- color: #FFFFFF;
- font-size: 24rpx;
- border-radius: 23rpx;
- margin-right: 20rpx;
-
- vertical-align: top;
-
- &-label {
- color: #999999;
- }
- }
-
-
- .tools {
- &-box {
- width: 100vw;
- height: 406rpx;
- padding: 0 5rpx;
- box-sizing: border-box;
- position: relative;
- }
-
- position: absolute;
- width: calc(100vw - 69rpx*2);
- left: 69rpx;
- bottom: 64rpx;
-
- justify-content: space-between;
- }
-
-
- .activate {
- position: absolute;
- width: calc(100% - 199rpx);
- height: 80rpx;
- top: 31rpx;
- right: 37rpx;
-
- &-tips {
- flex: 1;
- color: #976224;
- font-size: 28rpx;
- }
-
- &-highlight {
- color: #FF6868;
- }
-
- .btn-activate {
- width: 172rpx;
- height: 80rpx;
- }
- }
-
- .tool {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-
- color: #57595B;
- font-size: 28rpx;
-
- &-icon {
- width: 88rpx;
- height: 88rpx;
- margin-bottom: 10rpx;
- }
- }
-
- .content {
- padding: 0 20rpx 20rpx 20rpx;
- }
-
- .notice {
- padding: 22rpx 21rpx;
- display: flex;
- &-icon {
- width: 49rpx;
- height: 49rpx;
- margin-right: 20rpx;
- }
- }
-
- .updates {
- margin-top: 20rpx;
- padding: 20rpx;
-
- &-header {
- position: relative;
-
- &-bg {
- height: 51rpx;
- width: 58rpx;
- margin-left: 40rpx;
- }
-
- &-content {
- color: #262626;
- font-size: 38rpx;
- font-weight: 900;
-
- position: absolute;
- top: 0;
- }
- }
-
- &-item {
- padding: 0;
- border-radius: 16rpx;
- box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
- margin-top: 20rpx;
-
- &-img {
- width: 100%;
- height: 252rpx;
- }
-
- &-info {
- padding: 15rpx 18rpx 8rpx 18rpx;
- }
-
- &-title {
- color: #474747;
- font-size: 32rpx;
- }
-
- &-desc {
- color: #CCCCCC;
- font-size: 20rpx;
- }
- }
- }
-
- .service {
- position: fixed;
- right: 29rpx;
- bottom: 312rpx;
- width: 149rpx;
- height: 158rpx;
- }
-
- </style>
|