|
|
@@ -1,160 +1,295 @@
|
|
|
<template>
|
|
|
- <view class="minepage">
|
|
|
- <!-- 用户 -->
|
|
|
- <UserInfo :data="userInfo" :isLogin="token"></UserInfo>
|
|
|
- <!-- 用户数据 -->
|
|
|
- <!-- <view class="user-count"><LabelCount :ops="mineCountOps"></LabelCount></view> -->
|
|
|
- <!-- 我的订单 -->
|
|
|
- <view class="order-nav">
|
|
|
- <DialNav :mode="5" shadow :list="orderNavOps" nameSize="24rpx" imgSize="72rpx">
|
|
|
- <TitleOperate
|
|
|
- padding="30rpx 30rpx 0 30rpx"
|
|
|
- showMore
|
|
|
- title="我的订单"
|
|
|
- moreLabel="全部订单"
|
|
|
- @clickMore="$u.route({ url: '/pages-mall/pages/order/list' })"
|
|
|
- ></TitleOperate>
|
|
|
- </DialNav>
|
|
|
- </view>
|
|
|
-
|
|
|
-
|
|
|
- <view class="oparbox shadow">
|
|
|
- <!-- <view class="oparTit">
|
|
|
- 常用工具
|
|
|
- </view> -->
|
|
|
- <!-- title="常用工具" -->
|
|
|
- <u-cell-group :border="false">
|
|
|
- <u-cell-item icon="star" title="我的收藏" :border-bottom="false" @click="goUrl('/pages-mine/pages/collection')"></u-cell-item>
|
|
|
- <u-cell-item icon="clock" title="我的足迹" :border-bottom="false" @click="goUrl('/pages-mine/pages/history')"></u-cell-item>
|
|
|
- <u-cell-item icon="coupon" title="我的优惠券" :border-bottom="false" @click="goUrl('/pages-mine/pages/discounts')"></u-cell-item>
|
|
|
- <u-cell-item icon="map" title="地址管理" :border-bottom="false" @click="goUrl('/pages-mine/pages/address/list')"></u-cell-item>
|
|
|
- </u-cell-group>
|
|
|
- </view>
|
|
|
- <view class="oparbox shadow">
|
|
|
- <!-- <view class="oparTit">
|
|
|
- 常用工具
|
|
|
- </view> -->
|
|
|
- <!-- title="常用工具" -->
|
|
|
- <u-cell-group :border="false">
|
|
|
- <u-cell-item icon="info-circle" title="关于我们" :border-bottom="false" @click="goArticleDetail('about_us','关于我们')"></u-cell-item>
|
|
|
- <u-cell-item icon="error-circle" title="投诉/建议" :border-bottom="false" @click="goUrl('/pages-mine/pages/feedback')"></u-cell-item>
|
|
|
- <u-cell-item icon="setting" title="设置中心" :border-bottom="false" @click="goUrl('/pages-mine/pages/setting')"></u-cell-item>
|
|
|
- </u-cell-group>
|
|
|
- </view>
|
|
|
- <!-- <view class="loginBox">
|
|
|
- <u-button type="primary" shape="circle" @click="logout"><text>退出登录</text></u-button>
|
|
|
- </view> -->
|
|
|
- </view>
|
|
|
+ <view class="mine-page">
|
|
|
+ <!-- 顶部用户信息 -->
|
|
|
+ <view class="user-info">
|
|
|
+ <view class="user-header">
|
|
|
+ <view class="user-avatar">
|
|
|
+ <image class="avatar" :src="userInfo.avatar || '/static/img/logo3.png'" mode="aspectFill"></image>
|
|
|
+ </view>
|
|
|
+ <view class="user-detail">
|
|
|
+ <view class="nickname">{{ userInfo.nickname }}</view>
|
|
|
+ <view class="user-tag">{{ userInfo.tag }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 用户数据 -->
|
|
|
+ <view class="user-data">
|
|
|
+ <view class="data-item">
|
|
|
+ <view class="amount">{{ userInfo.balance }}</view>
|
|
|
+ <view class="label">我的钱包</view>
|
|
|
+ </view>
|
|
|
+ <view class="data-item">
|
|
|
+ <view class="amount">{{ userInfo.couponCount }}</view>
|
|
|
+ <view class="label">优惠券</view>
|
|
|
+ <view class="badge" v-if="userInfo.availableCoupons">{{ userInfo.availableCoupons }}张可领</view>
|
|
|
+ </view>
|
|
|
+ <view class="data-item">
|
|
|
+ <view class="amount">{{ userInfo.points }}</view>
|
|
|
+ <view class="label">我的积分</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 卖书订 -->
|
|
|
+ <view class="order-section">
|
|
|
+ <view class="section-header">
|
|
|
+ <text>卖书订单</text>
|
|
|
+ <view class="view-all" @click="viewAllOrders">
|
|
|
+ <text>查看全部</text>
|
|
|
+ <u-icon name="arrow-right" size="24" color="#999"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="order-types" style="padding: 0 20rpx;">
|
|
|
+ <view class="type-item flex-d flex-a-c" v-for="(item, index) in orderTypes" :key="index"
|
|
|
+ @click="navigateToOrder(item.path)">
|
|
|
+ <image class="type-icon" :src="'/pages-mine/static/' + item.icon" mode="aspectFit"></image>
|
|
|
+ <text>{{ item.name }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 实用工具 -->
|
|
|
+ <view class="tools-section">
|
|
|
+ <view class="section-title">实用工具</view>
|
|
|
+ <view class="tools-grid">
|
|
|
+ <view class="tool-item flex-d flex-a-c" v-for="(tool, index) in tools" :key="index"
|
|
|
+ @click="navigateToTool(tool.path)">
|
|
|
+ <image class="tool-icon" :src="'/pages-mine/static/' + tool.icon" mode="aspectFit"></image>
|
|
|
+ <text>{{ tool.name }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import UserInfo from '@/pages/mine/components/user-info.vue';
|
|
|
-import LabelCount from '@/components/nav/label-count.vue';
|
|
|
-import DialNav from '@/components/nav/dial-nav.vue';
|
|
|
-import TitleOperate from '@/components/title-operate.vue';
|
|
|
-import {articleOpar} from '@/pages-pub/mixins/article.js'
|
|
|
export default {
|
|
|
- mixins:[articleOpar],
|
|
|
- components: {
|
|
|
- UserInfo,
|
|
|
- LabelCount,
|
|
|
- DialNav,
|
|
|
- TitleOperate
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- token:'',
|
|
|
- isLogin:false,
|
|
|
- // 用户信息
|
|
|
- userInfo: {
|
|
|
- nickname: '',
|
|
|
- avatar: ''
|
|
|
- },
|
|
|
- // 订单导航配置
|
|
|
- orderNavOps: [
|
|
|
- { name: '待付款', img: require('../../static/nav/mine-order-1.png'), url: '/pages-mall/pages/order/list?tabIndex=1' },
|
|
|
- { name: '待发货', img: require('../../static/nav/mine-order-2.png'), url: '/pages-mall/pages/order/list?tabIndex=2' },
|
|
|
- { name: '待收货', img: require('../../static/nav/mine-order-3.png'), url: '/pages-mall/pages/order/list?tabIndex=3' },
|
|
|
- { name: '已完成', img: require('../../static/nav/mine-order-4.png'), url: '/pages-mall/pages/order/list?tabIndex=4' },
|
|
|
- { name: '退款售后', img: require('../../static/nav/mine-order-5.png'), url: '/pages-mall/pages/after-sales/list' },
|
|
|
- ],
|
|
|
- };
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- this.token = uni.getStorageSync('token');
|
|
|
- },
|
|
|
- onLoad(){
|
|
|
- this.getUserInfo();
|
|
|
- uni.$on('getUserInfo',()=>{
|
|
|
- this.getUserInfo();
|
|
|
- })
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getUserInfo(){
|
|
|
- this.$u.api.getUserBaseInfoAjax().then(({code,data}) => {
|
|
|
- console.log({code,data});
|
|
|
- if(code==1){
|
|
|
- this.userInfo = data;
|
|
|
- // this.isLogin = true;
|
|
|
- }
|
|
|
- }).catch((error)=>{
|
|
|
- console.log('error>>>>',error)
|
|
|
- })
|
|
|
- },
|
|
|
- goUrl(url){
|
|
|
- uni.navigateTo({
|
|
|
- url:url
|
|
|
- })
|
|
|
- },
|
|
|
- // 退出登录
|
|
|
- logout() {
|
|
|
- console.log(11)
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '是否退出当前账号?',
|
|
|
- confirmColor: this.$appTheme.appThemeColor,
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- uni.removeStorageSync('token');
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages/login/index'
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- }
|
|
|
-};
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ userInfo: {
|
|
|
+ avatar: '',
|
|
|
+ nickname: '这里是微信昵称.',
|
|
|
+ tag: '合伙人',
|
|
|
+ balance: '26.00',
|
|
|
+ couponCount: '66',
|
|
|
+ availableCoupons: '99',
|
|
|
+ points: '3630'
|
|
|
+ },
|
|
|
+ orderTypes: [
|
|
|
+ { name: '待初审', icon: '1.png', path: '/pages/order/pending-review' },
|
|
|
+ { name: '待取件', icon: '2.png', path: '/pages/order/pending-pickup' },
|
|
|
+ { name: '待审核', icon: '3.png', path: '/pages/order/pending-audit' },
|
|
|
+ { name: '待到款', icon: '4.png', path: '/pages/order/pending-payment' },
|
|
|
+ { name: '申请退回', icon: '5.png', path: '/pages/order/return-request' }
|
|
|
+ ],
|
|
|
+ tools: [
|
|
|
+ { name: '消息通知', icon: 't1.png', path: '/pages/tools/notification' },
|
|
|
+ { name: '我的收藏', icon: 't2.png', path: '/pages/tools/collection' },
|
|
|
+ { name: '我的足迹', icon: 't3.png', path: '/pages/tools/footprint' },
|
|
|
+ { name: '我的地址', icon: 't4.png', path: '/pages/tools/address' },
|
|
|
+ { name: '我的优惠券', icon: 't5.png', path: '/pages/tools/coupon' },
|
|
|
+ { name: '联系客服', icon: 't6.png', path: '/pages/tools/service' },
|
|
|
+ { name: '意见反馈', icon: 't7.png', path: '/pages/tools/feedback' },
|
|
|
+ { name: '到货提醒', icon: 't8.png', path: '/pages/tools/arrival-notice' },
|
|
|
+ { name: '合伙人计划', icon: 't9.png', path: '/pages/tools/partner' },
|
|
|
+ { name: '买卖答疑', icon: 't10.png', path: '/pages/tools/faq' },
|
|
|
+ { name: '关于书嗨', icon: 't11.png', path: '/pages/tools/about' },
|
|
|
+ { name: '我的余额', icon: 't12.png', path: '/pages/tools/balance' },
|
|
|
+ { name: '用户设置', icon: 't13.png', path: '/pages/tools/settings' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ viewAllOrders() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages-mine/pages/order-page'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ navigateToOrder(path) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: path
|
|
|
+ })
|
|
|
+ },
|
|
|
+ navigateToTool(path) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: path
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .minepage{
|
|
|
- padding-bottom: 20rpx;
|
|
|
- }
|
|
|
-.order-nav{
|
|
|
- margin-top: -70rpx;
|
|
|
-}
|
|
|
-.user-count,
|
|
|
-.order-nav,
|
|
|
-.other-nav {
|
|
|
- position: relative;
|
|
|
- z-index: $app-zIndex-normal;
|
|
|
- padding: 0 30rpx 30rpx 30rpx;
|
|
|
-}
|
|
|
-.oparbox{
|
|
|
- border-radius: 16rpx;
|
|
|
- background-color: $app-theme-bg-color;
|
|
|
- overflow: hidden;
|
|
|
- margin: 0 30rpx 20rpx;
|
|
|
- &.shadow {
|
|
|
- box-shadow: $app-theme-shadow;
|
|
|
- }
|
|
|
- .oparTit{
|
|
|
- padding: 30rpx 30rpx 20rpx;
|
|
|
- font-size: 34rpx;
|
|
|
- }
|
|
|
-}
|
|
|
-.loginBox {
|
|
|
- padding: 60rpx;
|
|
|
+.mine-page {
|
|
|
+ min-height: 100vh;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+
|
|
|
+ .user-info {
|
|
|
+ background-color: #38C148;
|
|
|
+ padding: 20rpx 50rpx 120rpx;
|
|
|
+ color: #fff;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ width: 140%;
|
|
|
+ position: absolute;
|
|
|
+ left: -20%;
|
|
|
+ top: 0;
|
|
|
+ z-index: -1;
|
|
|
+ content: '';
|
|
|
+ border-radius: 0 0 50% 50%;
|
|
|
+ background: #fd6954;
|
|
|
+ }
|
|
|
+
|
|
|
+ .user-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 40rpx;
|
|
|
+
|
|
|
+ .user-avatar {
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ border: 4rpx solid #fff;
|
|
|
+
|
|
|
+ .avatar {
|
|
|
+ width: 120rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .user-detail {
|
|
|
+ .nickname {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .user-tag {
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 22rpx;
|
|
|
+ padding: 4rpx 12rpx;
|
|
|
+ background: linear-gradient(-90deg, #272321, #4B4542);
|
|
|
+ border-radius: 4rpx;
|
|
|
+ margin-top: 8rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .user-data {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ position: relative;
|
|
|
+ z-index: 1;
|
|
|
+ padding: 0 40rpx;
|
|
|
+
|
|
|
+ .data-item {
|
|
|
+ position: relative;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .amount {
|
|
|
+ font-size: 38rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ opacity: 0.9;
|
|
|
+ }
|
|
|
+
|
|
|
+ .badge {
|
|
|
+ position: absolute;
|
|
|
+ top: -15rpx;
|
|
|
+ right: -120%;
|
|
|
+ padding: 0 10rpx;
|
|
|
+ font-size: 20rpx;
|
|
|
+ line-height: 30rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ background: #FF8400;
|
|
|
+ border-radius: 15rpx 15rpx 15rpx 0rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .order-section {
|
|
|
+ margin: -80rpx 30rpx 20rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ padding: 30rpx;
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+
|
|
|
+ .section-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+
|
|
|
+ .view-all {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #999;
|
|
|
+ font-size: 26rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .order-types {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .type-item {
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .type-icon {
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ margin-bottom: 12rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .tools-section {
|
|
|
+ margin: 30rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ padding: 30rpx;
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+
|
|
|
+ .section-title {
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tools-grid {
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(4, 1fr);
|
|
|
+ gap: 30rpx;
|
|
|
+
|
|
|
+ .tool-item {
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .tool-icon {
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ margin-bottom: 12rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|