|
|
@@ -4,7 +4,11 @@
|
|
|
<view class="user-info">
|
|
|
<view class="user-header" @tap="handleUpdateUserInfo">
|
|
|
<view class="user-avatar">
|
|
|
- <image class="avatar" :src="userInfo.imgPath || 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/logo3.png'" mode="aspectFill"></image>
|
|
|
+ <image
|
|
|
+ class="avatar"
|
|
|
+ :src="userInfo.imgPath || 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/logo3.png'"
|
|
|
+ mode="aspectFill"
|
|
|
+ ></image>
|
|
|
</view>
|
|
|
<view class="user-detail">
|
|
|
<view class="nickname">{{ userInfo.nickName }}</view>
|
|
|
@@ -39,9 +43,13 @@
|
|
|
<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)">
|
|
|
+ <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 class="badge" v-if="item.badge">{{ item.badge }}</view>
|
|
|
@@ -53,8 +61,12 @@
|
|
|
<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)">
|
|
|
+ <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>
|
|
|
@@ -69,10 +81,10 @@ export default {
|
|
|
return {
|
|
|
userInfo: {
|
|
|
userId: 0,
|
|
|
- openid: '',
|
|
|
- imgPath: '',
|
|
|
- nickName: '这里是微信昵称.',
|
|
|
- mobile: '',
|
|
|
+ openid: "",
|
|
|
+ imgPath: "",
|
|
|
+ nickName: "这里是微信昵称.",
|
|
|
+ mobile: "",
|
|
|
tags: [],
|
|
|
accountMoney: 0,
|
|
|
couponNum: 0,
|
|
|
@@ -81,82 +93,123 @@ export default {
|
|
|
pickUpNum: 0,
|
|
|
auditNum: 0,
|
|
|
payNum: 0,
|
|
|
- refundNum: 0
|
|
|
+ refundNum: 0,
|
|
|
},
|
|
|
orderTypes: [
|
|
|
- { name: '待初审', icon: '1.png', badge: 0,key:"firstAuditNum", path: '/pages-mine/pages/order-page?status=2' },
|
|
|
- { name: '待取件', icon: '2.png', badge: 0,key:"pickUpNum", path: '/pages-mine/pages/order-page?status=3' },
|
|
|
- { name: '待审核', icon: '3.png', badge: 0,key:"auditNum", path: '/pages-mine/pages/order-page?status=8' },
|
|
|
- { name: '待到款', icon: '4.png', badge: 0,key:"payNum", path: '/pages-mine/pages/order-page?status=10' },
|
|
|
- { name: '申请退回', icon: '5.png', badge: 0,key:"refundNum", path: '/pages-mine/pages/apply-return' }
|
|
|
+ {
|
|
|
+ name: "待初审",
|
|
|
+ icon: "1.png",
|
|
|
+ badge: 0,
|
|
|
+ key: "firstAuditNum",
|
|
|
+ path: "/pages-mine/pages/order-page?status=2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "待取件",
|
|
|
+ icon: "2.png",
|
|
|
+ badge: 0,
|
|
|
+ key: "pickUpNum",
|
|
|
+ path: "/pages-mine/pages/order-page?status=3",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "待审核",
|
|
|
+ icon: "3.png",
|
|
|
+ badge: 0,
|
|
|
+ key: "auditNum",
|
|
|
+ path: "/pages-mine/pages/order-page?status=8",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "待到款",
|
|
|
+ icon: "4.png",
|
|
|
+ badge: 0,
|
|
|
+ key: "payNum",
|
|
|
+ path: "/pages-mine/pages/order-page?status=10",
|
|
|
+ },
|
|
|
+ { name: "申请退回", icon: "5.png", badge: 0, key: "refundNum", path: "/pages-mine/pages/apply-return" },
|
|
|
],
|
|
|
tools: [
|
|
|
- { name: '消息通知', icon: 't1.png', path: '/pages-mine/pages/notice' },
|
|
|
- { name: '我的收藏', icon: 't2.png', path: '' },
|
|
|
- { name: '我的足迹', icon: 't3.png', path: '' },
|
|
|
- { name: '我的地址', icon: 't4.png', path: '/pages-mine/pages/address/list' },
|
|
|
- { name: '我的优惠券', icon: 't5.png', path: '' },
|
|
|
- { name: '联系客服', icon: 't6.png', path: '/pages/tools/service' },
|
|
|
- { name: '意见反馈', icon: 't7.png', path: '/pages-mine/pages/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-mine/pages/wallet' },
|
|
|
- { name: '用户设置', icon: 't13.png', path: '/pages/tools/settings' }
|
|
|
- ]
|
|
|
- }
|
|
|
+ { name: "消息通知", icon: "t1.png", path: "/pages-mine/pages/notice" },
|
|
|
+ { name: "我的收藏", icon: "t2.png", path: "" },
|
|
|
+ { name: "我的足迹", icon: "t3.png", path: "" },
|
|
|
+ { name: "我的地址", icon: "t4.png", path: "/pages-mine/pages/address/list" },
|
|
|
+ { name: "我的优惠券", icon: "t5.png", path: "" },
|
|
|
+ { name: "联系客服", icon: "t6.png", path: "/pages/tools/service" },
|
|
|
+ { name: "意见反馈", icon: "t7.png", path: "/pages-mine/pages/feedback" },
|
|
|
+ { name: "到货提醒", icon: "t8.png", path: "/pages/tools/arrival-notice" },
|
|
|
+ { name: "合伙人计划", icon: "t9.png", path: "/pages-mine/pages/partner/partner-apply" },
|
|
|
+ { name: "买卖答疑", icon: "t10.png", path: "/pages/tools/faq" },
|
|
|
+ { name: "关于书嗨", icon: "t11.png", path: "/pages/tools/about" },
|
|
|
+ { name: "我的余额", icon: "t12.png", path: "/pages-mine/pages/wallet" },
|
|
|
+ { name: "用户设置", icon: "t13.png", path: "/pages/tools/settings" },
|
|
|
+ ],
|
|
|
+ };
|
|
|
},
|
|
|
methods: {
|
|
|
//用户信息
|
|
|
handleUpdateUserInfo() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages-mine/pages/setting'
|
|
|
- })
|
|
|
+ url: "/pages-mine/pages/setting",
|
|
|
+ });
|
|
|
},
|
|
|
//查看全部订单
|
|
|
viewAllOrders() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages-mine/pages/order-page?status=-1'
|
|
|
- })
|
|
|
+ url: "/pages-mine/pages/order-page?status=-1",
|
|
|
+ });
|
|
|
},
|
|
|
//跳转订单
|
|
|
navigateToOrder(path) {
|
|
|
uni.navigateTo({
|
|
|
- url: path
|
|
|
- })
|
|
|
+ url: path,
|
|
|
+ });
|
|
|
},
|
|
|
//跳转工具
|
|
|
navigateToTool(path) {
|
|
|
- if(!path) return uni.showToast({
|
|
|
- title:"开发中...",
|
|
|
- icon:"none"
|
|
|
- })
|
|
|
+ if (!path)
|
|
|
+ return uni.showToast({
|
|
|
+ title: "开发中...",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
uni.navigateTo({
|
|
|
- url: path
|
|
|
- })
|
|
|
+ url: path,
|
|
|
+ });
|
|
|
},
|
|
|
//获取用户信息
|
|
|
getUserInfo() {
|
|
|
- uni.$u.http.get('/token/user/detail').then(res => {
|
|
|
- console.log(res)
|
|
|
+ uni.$u.http.get("/token/user/detail").then((res) => {
|
|
|
+ console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
- this.userInfo = res.data
|
|
|
+ this.userInfo = res.data;
|
|
|
|
|
|
- this.orderTypes.forEach(item => {
|
|
|
- item.badge = this.userInfo[item.key]
|
|
|
- })
|
|
|
+ this.orderTypes.forEach((item) => {
|
|
|
+ item.badge = this.userInfo[item.key];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取合伙人状态
|
|
|
+ getPartnerStatus() {
|
|
|
+ uni.$u.get("/token/getUserPartnerInfo").then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let { status } = res.data;
|
|
|
+ let item = this.tools.find((item) => item.name == "合伙人计划");
|
|
|
+ if (status == -1) {
|
|
|
+ item.path = "/pages-mine/pages/partner/partner-apply";
|
|
|
+ } else if (status == 1) {
|
|
|
+ item.path = "/pages-mine/pages/partner/partner-home";
|
|
|
+ } else {
|
|
|
+ item.path = "/pages-mine/pages/partner/partner-status";
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
onShow() {
|
|
|
- let token = uni.getStorageSync('token')
|
|
|
+ let token = uni.getStorageSync("token");
|
|
|
if (token) {
|
|
|
- this.getUserInfo()
|
|
|
+ this.getUserInfo();
|
|
|
}
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -165,7 +218,7 @@ export default {
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
.user-info {
|
|
|
- background-color: #38C148;
|
|
|
+ background-color: #38c148;
|
|
|
padding: 20rpx 50rpx 120rpx;
|
|
|
color: #fff;
|
|
|
position: relative;
|
|
|
@@ -176,7 +229,7 @@ export default {
|
|
|
left: -20%;
|
|
|
top: 0;
|
|
|
z-index: -1;
|
|
|
- content: '';
|
|
|
+ content: "";
|
|
|
border-radius: 0 0 50% 50%;
|
|
|
background: #fd6954;
|
|
|
}
|
|
|
@@ -211,7 +264,7 @@ export default {
|
|
|
display: inline-block;
|
|
|
font-size: 22rpx;
|
|
|
padding: 4rpx 12rpx;
|
|
|
- background: linear-gradient(-90deg, #272321, #4B4542);
|
|
|
+ background: linear-gradient(-90deg, #272321, #4b4542);
|
|
|
border-radius: 4rpx;
|
|
|
margin-top: 8rpx;
|
|
|
margin-right: 10rpx;
|
|
|
@@ -250,7 +303,7 @@ export default {
|
|
|
font-size: 20rpx;
|
|
|
line-height: 30rpx;
|
|
|
height: 30rpx;
|
|
|
- background: #FF8400;
|
|
|
+ background: #ff8400;
|
|
|
border-radius: 15rpx 15rpx 15rpx 0rpx;
|
|
|
}
|
|
|
}
|