|
@@ -1,43 +1,55 @@
|
|
<template>
|
|
<template>
|
|
<view class="main">
|
|
<view class="main">
|
|
<view class="one">
|
|
<view class="one">
|
|
- <view v-if="user._id" class="one_1">
|
|
|
|
- <view class="left">
|
|
|
|
|
|
+ <view class="one_1">
|
|
|
|
+ <view v-if="user._id" class="top">
|
|
<image class="image" :src="user.icon&&item.icon.length>0?item.icon[0].url:'../../static/my.png'"
|
|
<image class="image" :src="user.icon&&item.icon.length>0?item.icon[0].url:'../../static/my.png'"
|
|
mode="widthFix"></image>
|
|
mode="widthFix"></image>
|
|
<text>{{user.nick_name||'微信用户'}}</text>
|
|
<text>{{user.nick_name||'微信用户'}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="right">
|
|
|
|
- <text class="text"><text class="iconfont icon-icon_set_up"></text>编辑资料</text>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view v-else class="one_1">
|
|
|
|
- <view class="left">
|
|
|
|
|
|
+ <view v-else class="top" @tap="toLogin">
|
|
<text class="iconfont icon-yonghu"></text>
|
|
<text class="iconfont icon-yonghu"></text>
|
|
<text>登录/注册</text>
|
|
<text>登录/注册</text>
|
|
</view>
|
|
</view>
|
|
- <view class="right"></view>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <view class="one_2">
|
|
|
|
+ <view class="bottom">
|
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index" @tap="toRoute(item)">
|
|
|
|
+ <text>{{item.num}}</text>
|
|
|
|
+ <text>{{item.title}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="bottom">
|
|
|
|
- <view class="two">
|
|
|
|
- <view class="two_1">
|
|
|
|
- <view class="left">我的订单</view>
|
|
|
|
- <view class="right" @tap="toCommon(`pagesMy/order/index`)">查看全部订单 <text
|
|
|
|
- class="iconfont icon-dayuhao"></text></view>
|
|
|
|
|
|
+ <view class="two">
|
|
|
|
+ <view class="two_1">
|
|
|
|
+ <view class="left">我的订单</view>
|
|
|
|
+ <view class="right" @tap="toCommon(`pagesMy/order/index`)">查看全部订单 <text
|
|
|
|
+ class="iconfont icon-dayuhao"></text></view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="two_2">
|
|
|
|
+ <view class="list" v-for="(item,index) in orderList" :key="index" @tap="toRoute(item)">
|
|
|
|
+ <uni-badge :text="item.num" absolute="rightTop" size="normal">
|
|
|
|
+ <view class="icon">
|
|
|
|
+ <text class="iconfont" :class="[item.icon]"></text>
|
|
|
|
+ </view>
|
|
|
|
+ <text class="title">{{item.title}}</text>
|
|
|
|
+ </uni-badge>
|
|
</view>
|
|
</view>
|
|
- <view class="two_2">
|
|
|
|
- <view class="list" v-for="(item,index) in orderList" :key="index" @tap="toRoute(item)">
|
|
|
|
- <uni-badge :text="item.num" absolute="rightTop" size="normal">
|
|
|
|
- <view class="icon">
|
|
|
|
- <text class="iconfont" :class="[item.icon]"></text>
|
|
|
|
- </view>
|
|
|
|
- <text class="title">{{item.title}}</text>
|
|
|
|
- </uni-badge>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="thr">
|
|
|
|
+ <view class="list" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
|
|
|
|
+ <view class="left">
|
|
|
|
+ <view class="icon">
|
|
|
|
+ <text class="iconfont" :class="[item.icon]"></text>
|
|
</view>
|
|
</view>
|
|
|
|
+ <text class="title">{{item.title}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="right">
|
|
|
|
+ <text class="iconfont icon-dayuhao"></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="thr">111111111</view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -47,8 +59,27 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
user: {},
|
|
user: {},
|
|
|
|
+ // 获赞数
|
|
|
|
+ list: [{
|
|
|
|
+ title: "点赞",
|
|
|
|
+ route: '/pagesIndex/like/index',
|
|
|
|
+ type: '0',
|
|
|
|
+ num: 0
|
|
|
|
+ }, {
|
|
|
|
+ title: "评论",
|
|
|
|
+ route: '/pagesIndex/comment/index',
|
|
|
|
+ type: '2',
|
|
|
|
+ num: 0
|
|
|
|
+ }, {
|
|
|
|
+ title: "收藏",
|
|
|
|
+ route: '/pagesIndex/collect/index',
|
|
|
|
+ type: '1',
|
|
|
|
+ num: 0
|
|
|
|
+ }],
|
|
// 订单图标菜单
|
|
// 订单图标菜单
|
|
- orderList: []
|
|
|
|
|
|
+ orderList: [],
|
|
|
|
+ // 菜单
|
|
|
|
+ menuList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad: async function() {
|
|
onLoad: async function() {
|
|
@@ -77,11 +108,63 @@
|
|
// 查询
|
|
// 查询
|
|
async search() {
|
|
async search() {
|
|
const that = this;
|
|
const that = this;
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ // 登录或注册
|
|
|
|
+ async toLogin() {
|
|
|
|
+ const that = this;
|
|
|
|
+ console.log('登录');
|
|
|
|
+ },
|
|
|
|
+ // 点赞或收藏
|
|
|
|
+ toLike(item) {
|
|
|
|
+ const that = this;
|
|
|
|
+ if (that.user && that.user._id) {
|
|
|
|
+ if (item.type == '2') {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/${item.route}`
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/${item.route}?type=${item.type}`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pagesIndex/login/index`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 订单或维修跳转
|
|
|
|
+ toRoute(item) {
|
|
|
|
+ const that = this;
|
|
|
|
+ if (that.user && that.user._id) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/${item.route}?status=${item.status}`
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pagesIndex/login/index`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 公共跳转
|
|
|
|
+ toCommon(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ if (that.user && that.user._id) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/${e}`
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pagesIndex/login/index`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async searchOther() {
|
|
async searchOther() {
|
|
const that = this;
|
|
const that = this;
|
|
let config = that.$config;
|
|
let config = that.$config;
|
|
that.$set(that, `orderList`, config.orderList);
|
|
that.$set(that, `orderList`, config.orderList);
|
|
|
|
+ that.$set(that, `menuList`, config.menuList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -97,12 +180,12 @@
|
|
|
|
|
|
.one {
|
|
.one {
|
|
background-image: linear-gradient(181.2deg, #FEFEFE 10.5%, #87CEFA 86.8%);
|
|
background-image: linear-gradient(181.2deg, #FEFEFE 10.5%, #87CEFA 86.8%);
|
|
- height: 40vw;
|
|
|
|
|
|
+ height: 45vw;
|
|
|
|
|
|
.one_1 {
|
|
.one_1 {
|
|
padding: 5vw;
|
|
padding: 5vw;
|
|
|
|
|
|
- .left {
|
|
|
|
|
|
+ .top {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
font-size: var(--font20Szie);
|
|
font-size: var(--font20Szie);
|
|
@@ -119,85 +202,118 @@
|
|
padding: 2vw;
|
|
padding: 2vw;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- .right {
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: flex-end;
|
|
|
|
- font-size: var(--font12Szie);
|
|
|
|
|
|
+ .one_2 {
|
|
|
|
+ padding: 5vw;
|
|
|
|
|
|
- .text {
|
|
|
|
- border: 1px solid var(--f85Color);
|
|
|
|
- border-radius: 15px;
|
|
|
|
- padding: 1vw 2vw;
|
|
|
|
- box-shadow: 3px 3px 10px var(--f85Color);
|
|
|
|
|
|
+ .bottom {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
|
|
- text:first-child {
|
|
|
|
- padding: 0 1vw 0 0;
|
|
|
|
- }
|
|
|
|
|
|
+ .list {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- .bottom {
|
|
|
|
- position: fixed;
|
|
|
|
- top: 30vw;
|
|
|
|
- left: 0;
|
|
|
|
- right: 0;
|
|
|
|
|
|
+ .two {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ margin: 2vw;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ background-color: var(--mainColor);
|
|
|
|
|
|
- .two {
|
|
|
|
|
|
+ .two_1 {
|
|
display: flex;
|
|
display: flex;
|
|
- flex-direction: column;
|
|
|
|
|
|
+ justify-content: space-between;
|
|
padding: 2vw;
|
|
padding: 2vw;
|
|
- margin: 2vw 0;
|
|
|
|
- border-radius: 20px;
|
|
|
|
- background-color: var(--mainColor);
|
|
|
|
|
|
+ border-bottom: 1px solid var(--f9Color);
|
|
|
|
+
|
|
|
|
+ .left {
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .right {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+ color: var(--f99Color);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .two_2 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 3vw 4vw;
|
|
|
|
|
|
- .two_1 {
|
|
|
|
|
|
+ .list {
|
|
display: flex;
|
|
display: flex;
|
|
- justify-content: space-between;
|
|
|
|
- padding: 2vw;
|
|
|
|
- border-bottom: 1px solid var(--f9Color);
|
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ text-align: center;
|
|
|
|
|
|
- .left {
|
|
|
|
- font-weight: 600;
|
|
|
|
- font-size: var(--font14Size);
|
|
|
|
|
|
+ .icon {
|
|
|
|
+ .iconfont {
|
|
|
|
+ font-size: 25px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- .right {
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
|
|
+ .title {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin: 1vw 0 0 0;
|
|
font-size: var(--font12Size);
|
|
font-size: var(--font12Size);
|
|
- color: var(--f99Color);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- .two_2 {
|
|
|
|
|
|
+ .thr {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ margin: 0 2vw;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ background-color: var(--mainColor);
|
|
|
|
+
|
|
|
|
+ .list {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ border-bottom: 1px solid var(--f9Color);
|
|
|
|
+
|
|
|
|
+ .left {
|
|
display: flex;
|
|
display: flex;
|
|
- justify-content: space-between;
|
|
|
|
- padding: 3vw 4vw;
|
|
|
|
|
|
+ align-items: center;
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
|
|
- .list {
|
|
|
|
- display: flex;
|
|
|
|
- flex-direction: column;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: center;
|
|
|
|
- text-align: center;
|
|
|
|
|
|
+ .icon {
|
|
|
|
+ padding: 0 1vw 0 0;
|
|
|
|
|
|
- .icon {
|
|
|
|
- .iconfont {
|
|
|
|
- font-size: 25px;
|
|
|
|
- }
|
|
|
|
|
|
+ .iconfont {
|
|
|
|
+ color: var(--f3CColor);
|
|
|
|
+ font-size: var(--font18Szie);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- .title {
|
|
|
|
- display: inline-block;
|
|
|
|
- margin: 1vw 0 0 0;
|
|
|
|
- font-size: var(--font12Size);
|
|
|
|
- }
|
|
|
|
|
|
+ .title {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ font-size: var(--font12Size);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .right {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+ color: var(--f99Color);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|