diff --git a/pages/user/index.vue b/pages/user/index.vue index 28a8231..104e033 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -5,25 +5,19 @@ - - + + - {{ userInfo.nick_name }} - - - - - - - - {{ userInfo.grade.name }} - - + {{ userInfo.username }} + - {{ userInfo.mobile }} + {{ userInfo.cellPhone }} ({{ userInfo.username }}) + + {{userInfo.userType}} + @@ -37,6 +31,21 @@ + + + + + + + + {{ item.name }} + + {{ item.count }} + 99+ + + + + @@ -49,87 +58,13 @@ {{ item.createTime }} - - {{ 11 }} + + {{ item.content }} - - - - - - - {{ isLogin ? assets.balance : '--' }} - - - 账户余额 - - - - - {{ isLogin ? assets.coupon : '--' }} - - - 优惠券 - - - - - - - - - - 我的钱包 - - - - - - - - - - - - {{ item.name }} - - {{ item.count }} - 99+ - - - - - - - 我的服务 - - - - - - - {{ item.name }} - - {{ item.count }} - 99+ - - - - - - - - - @@ -150,28 +85,15 @@ import * as OrderApi from '@/api/order' import { checkLogin } from '@/core/app' - // 订单操作 + // 操作 const orderNavbar = [ - { id: 'all', name: '全部订单', icon: 'qpdingdan' }, - { id: 'payment', name: '待支付', icon: 'daifukuan', count: 0 }, - { id: 'delivery', name: '待发货', icon: 'daifahuo', count: 0 }, - { id: 'received', name: '待收货', icon: 'daishouhuo', count: 0 }, + { id: 'all', name: '我的认证', icon: 'qpdingdan' }, + { id: 'payment', name: '买入订单', icon: 'daifukuan', count: 0 }, + { id: 'delivery', name: '卖出订单', icon: 'order-c', count: 0 }, + { id: 'received', name: '发票管理', icon: 'daishouhuo', count: 0 }, ] - /** - * 我的服务 - * id: 标识; name: 标题名称; icon: 图标; type 类型(link和button); url: 跳转的链接 - */ - const service = [ - { id: 'address', name: '收货地址', icon: 'shouhuodizhi', type: 'link', url: 'pages/address/index' }, - { id: 'coupon', name: '领券中心', icon: 'lingquan', type: 'link', url: 'pages/coupon/index' }, - { id: 'myCoupon', name: '优惠券', icon: 'youhuiquan', type: 'link', url: 'pages/my-coupon/index' }, - { id: 'contact', name: '在线客服', icon: 'kefu', type: 'button', openType: 'contact' }, - { id: 'points', name: '我的积分', icon: 'jifen', type: 'link', url: 'pages/points/log' }, - { id: 'refund', name: '退换/售后', icon: 'shouhou', type: 'link', url: 'pages/refund/index', count: 0 }, - { id: 'orderCenter', name: '订单中心', icon: 'order-c', type: 'link', url: 'pages/order/center' }, - { id: 'help', name: '我的帮助', icon: 'bangzhu', type: 'link', url: 'pages/help/index' }, - ] + export default { components: { @@ -191,10 +113,6 @@ setting: {}, // 当前用户信息 userInfo: {}, - // 账户资产 - assets: { balance: '--', points: '--', coupon: '--' }, - // 我的服务 - service, // 操作日志 oplist:[], // 订单操作 @@ -230,11 +148,9 @@ getPageData(callback) { const app = this app.isLoading = true - Promise.all([/*app.getUserInfo(), app.getUserAssets(), */app.getOplogs()]) + Promise.all([app.getUserInfo(), app.getOplogs()]) .then(result => { app.isFirstload = false - // 初始化我的服务数据 - app.initService() // 初始化订单操作数据 app.initOrderTabbar() // 执行回调函数 @@ -244,23 +160,6 @@ .finally(() => app.isLoading = false) }, - // 初始化我的服务数据 - initService() { - const app = this - const newService = [] - service.forEach(item => { - if (item.id === 'points') { - item.name = '我的' + app.setting[SettingKeyEnum.POINTS.value].points_name - } - // 数据角标 - if (item.count != undefined) { - item.count = app.todoCounts[item.id] - } - newService.push(item) - }) - app.service = newService - }, - // 初始化订单操作数据 initOrderTabbar() { const app = this @@ -278,21 +177,11 @@ // 获取当前用户信息 getUserInfo() { const app = this - return new Promise((resolve, reject) => { - !app.isLogin ? resolve(null) : UserApi.info({}, { load: app.isFirstload }) - .then(result => { - app.userInfo = result.data.userInfo - resolve(app.userInfo) - }) - .catch(err => { - if (err.result && err.result.status == 401) { - app.isLogin = false - resolve(null) - } else { - reject(err) - } - }) - }) + // 从storage 中读取 + if(app.isLogin){ + app.userInfo = uni.getStorageSync("cuser") + } + }, // 用户登录日志 @@ -451,8 +340,8 @@ margin-top: 15rpx; font-size: 28rpx; } - - .user-grade { + + .utype { align-self: baseline; display: flex; align-items: center; @@ -460,19 +349,6 @@ margin-top: 12rpx; border-radius: 10rpx; padding: 4rpx 12rpx; - - .user-grade_icon .image { - display: block; - width: 32rpx; - height: 32rpx; - } - - .user-grade_name { - margin-left: 5rpx; - font-size: 26rpx; - color: #EEE0C3; - } - } .login-tips { @@ -482,9 +358,12 @@ } } - } - +} + // 日志操作 + .oplog{ + background-color: #fff; + } .log-list { padding: 0 30rpx; } @@ -549,23 +428,6 @@ } } - // 我的服务 - .my-service { - margin: 22rpx auto 22rpx auto; - padding: 22rpx 0; - width: 94%; - box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05); - border-radius: 5rpx; - background: #fff; - - .service-title { - padding-left: 24rpx; - margin-bottom: 20rpx; - font-size: 30rpx; - } - - } - // 退出登录 .my-logout { display: flex;