345 lines
12 KiB
Vue
345 lines
12 KiB
Vue
<template>
|
|
<view class="component">
|
|
<!-- <u-sticky offset-top="0" customNavHeight="0"></u-sticky> -->
|
|
<view class="layout-head flex justify-between align-center" :class="{bgindex: index == 0}">
|
|
<view class="num" @click="isPopup = true">
|
|
<image class="full" src="/static/img/h-num.png" mode=""></image>
|
|
</view>
|
|
<view class="img flex justify-center items-center">
|
|
<image class="full" v-if="!title" src="/static/img/h-center.jpg" mode="" @click="toHome"></image>
|
|
<text class="text-white">{{ title }}</text>
|
|
</view>
|
|
<view class="user flex justify-center align-center">
|
|
<view class="icon">
|
|
<image class="full" src="/static/img/h-user.png" mode=""></image>
|
|
</view>
|
|
<view class="text" @click="loginLink">{{
|
|
(userData && userData.nickname) ? userData.nickname : '未登录'
|
|
}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<u-popup :show="isPopup" mode="top" @close="isPopup = false" :safe-area-inset-bottom="false">
|
|
<view class="popup-box">
|
|
<view class="layout-head bgindex flex justify-between align-center">
|
|
<view class="num" @click="isPopup = false">
|
|
<image class="full" src="/static/img/h-num.png" mode=""></image>
|
|
</view>
|
|
<view class="img">
|
|
<image class="full" src="/static/img/h-center.jpg" mode=""></image>
|
|
</view>
|
|
<view class="user flex justify-center align-center">
|
|
<view class="icon">
|
|
<image class="full" src="/static/img/h-user.png" mode=""></image>
|
|
</view>
|
|
<view class="text" @click="loginLink">
|
|
{{ (userData && userData.nickname) ? userData.nickname : '未登录' }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- <view class="popup-title" @click="toHome">首页</view>-->
|
|
<!-- <view class="nav-box flex justify-start flex-wrap">-->
|
|
<!-- <view class="item" @click="selfLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-1.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">金久信自营</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item" @click="goodsLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-2.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">现货市场</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item" @click="workLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-3.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">找加工</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item" @click="priceLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-4.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">找供应</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item mt-25" @click="junkLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-5.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">旧货交易</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item mt-25" @click="yellowLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-6.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">金久信黄页</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item mt-25" @click="schoolLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-7.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">金久信学堂</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item mt-25" @click="shopLink">-->
|
|
<!-- <view class="icon">-->
|
|
<!-- <image class="full" src="/static/img/nav-8.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text">特产商城</view>-->
|
|
<!-- </view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="popup-title" @click="toUser">个人中心</view>-->
|
|
<view class="nav-box flex justify-start flex-wrap">
|
|
<!-- <view class="item" @click="buyerLink" style="width: 33%">-->
|
|
<!-- <view class="icon icon-2">-->
|
|
<!-- <image class="full" src="/static/img/pu-1.jpg" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text text-2">买家中心</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item" @click="sellerLink" style="width: 33%">-->
|
|
<!-- <view class="icon icon-2">-->
|
|
<!-- <image class="full" src="/static/img/pu-2.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text text-2">卖家中心</view>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="item" @click="orderLink" style="width: 33%;margin-top: 0">-->
|
|
<!-- <view class="icon icon-2">-->
|
|
<!-- <image class="full" src="/static/img/pu-5.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text text-2">订单管理</view>-->
|
|
<!-- </view>-->
|
|
<view class="item mt-25" @click="contractLink" style="width: 33%">
|
|
<view class="icon icon-2">
|
|
<image class="full" src="/static/img/pu-3.png" mode=""></image>
|
|
</view>
|
|
<view class="text text-2">合同管理</view>
|
|
</view>
|
|
<view class="item mt-25" @click="signLink" style="width: 33%">
|
|
<view class="icon icon-2">
|
|
<image class="full" src="/static/img/sign.png" mode=""></image>
|
|
</view>
|
|
<view class="text text-2">金久信签约宝</view>
|
|
</view>
|
|
<!-- <view class="item mt-25" @click="uploadLink" style="width: 33%">-->
|
|
<!-- <view class="icon icon-2">-->
|
|
<!-- <image class="full" src="/static/img/pu-4.png" mode=""></image>-->
|
|
<!-- </view>-->
|
|
<!-- <view class="text text-2">我的上传</view>-->
|
|
<!-- </view>-->
|
|
</view>
|
|
<view class="flex justify-end items-center" v-if="userData && userData.nickname">
|
|
<view class="mr-25 mt-30">
|
|
<u-button size="small" type="primary" @click="logout">退出登录</u-button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</u-popup>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import uinavr from '@/components/index/nav'
|
|
|
|
export default {
|
|
components: {
|
|
uinavr,
|
|
},
|
|
data() {
|
|
return {
|
|
isLogin: false,
|
|
isPopup: false,
|
|
userData: null
|
|
}
|
|
},
|
|
props: {
|
|
index: {
|
|
type: Number,
|
|
default: 1,
|
|
},
|
|
title: {
|
|
type: String,
|
|
default: null
|
|
},
|
|
},
|
|
methods: {
|
|
selfLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/self/self')
|
|
},
|
|
goodsLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/goods/goods')
|
|
},
|
|
workLink() {
|
|
vk.navigateTo('/pages/work/work')
|
|
},
|
|
priceLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/price/price')
|
|
},
|
|
junkLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/junk/junk')
|
|
},
|
|
yellowLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/yellow/yellow')
|
|
},
|
|
schoolLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/school/school')
|
|
},
|
|
shopLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/shop/shop')
|
|
},
|
|
loginLink() {
|
|
this.isPopup = false
|
|
if (this.userData && this.userData.nickname) uni.switchTab({url: '/pages/user/user'})
|
|
else vk.navigateTo('/pages/login/login')
|
|
},
|
|
userLink(index) {
|
|
this.isPopup = false
|
|
console.log('按照顺序判断跳转页面')
|
|
},
|
|
buyerLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/user/buyer')
|
|
},
|
|
sellerLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/user/seller')
|
|
},
|
|
contractLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/public/contract')
|
|
},
|
|
signLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/public/sign')
|
|
},
|
|
uploadLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/school/list')
|
|
},
|
|
orderLink() {
|
|
this.isPopup = false
|
|
vk.navigateTo('/pages/shop/order')
|
|
},
|
|
|
|
logout() {
|
|
vk.userCenter.logout({
|
|
success: () => {
|
|
uni.reLaunch({
|
|
url: '/'
|
|
})
|
|
}
|
|
});
|
|
},
|
|
toHome() {
|
|
uni.switchTab({url: '/pages/index/index'})
|
|
},
|
|
toUser() {
|
|
uni.switchTab({url: '/pages/user/user'})
|
|
}
|
|
},
|
|
mounted() {
|
|
this.userData = vk.getStorageSync('uni_id_user_info')
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.bgindex {
|
|
background: #A92924 !important;
|
|
}
|
|
|
|
.layout-head {
|
|
height: 80rpx;
|
|
padding: 0 30rpx;
|
|
background: #A92924;
|
|
|
|
.num {
|
|
width: 48rpx;
|
|
height: 48rpx;
|
|
}
|
|
|
|
.img {
|
|
width: 240rpx;
|
|
height: 58rpx;
|
|
}
|
|
|
|
.user {
|
|
.icon {
|
|
width: 32rpx;
|
|
height: 32rpx;
|
|
}
|
|
|
|
.text {
|
|
padding-left: 10rpx;
|
|
font-size: 24rpx;
|
|
line-height: 32rpx;
|
|
color: #ffffff;
|
|
}
|
|
}
|
|
}
|
|
|
|
.popup-box {
|
|
width: 100%;
|
|
height: auto;
|
|
padding-bottom: 50rpx;
|
|
background: #ffffff;
|
|
|
|
.popup-title {
|
|
padding: 30rpx 30rpx 10rpx;
|
|
font-size: 28rpx;
|
|
font-weight: 600;
|
|
line-height: 40rpx;
|
|
color: #101010;
|
|
}
|
|
}
|
|
|
|
.nav-box {
|
|
margin: 10rpx 30rpx;
|
|
height: auto;
|
|
padding: 30rpx 0;
|
|
background: #F8F8F8;
|
|
border-radius: 20rpx;
|
|
|
|
.item {
|
|
width: 25%;
|
|
height: auto;
|
|
overflow: hidden;
|
|
|
|
.icon {
|
|
margin: 0 auto;
|
|
width: 100rpx;
|
|
height: 100rpx;
|
|
}
|
|
|
|
.icon-2 {
|
|
width: 120rpx;
|
|
height: 110rpx;
|
|
}
|
|
|
|
.text {
|
|
margin-top: 6rpx;
|
|
height: 36rpx;
|
|
overflow: hidden;
|
|
font-size: 28rpx;
|
|
line-height: 36rpx;
|
|
color: #6C6C6C;
|
|
text-align: center;
|
|
}
|
|
|
|
.text-2 {
|
|
color: #333333;
|
|
}
|
|
}
|
|
|
|
//.item:nth-child(n+3) {
|
|
//margin-top: 20rpx;
|
|
//}
|
|
}
|
|
</style>
|