Commit 4bdad8c5 authored by 786817560's avatar 786817560

'主页合并'

parent edb9778b
/*
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-09-24 12:34:06
* @LastEditTime: 2019-09-24 12:34:06
* @LastEditors: your name
*/
export default {
bannerList: [
{
......
/*
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-09-24 12:34:06
* @LastEditTime: 2019-10-15 11:13:36
* @LastEditors: Please set LastEditors
*/
export default {
bannerList: [
// {
// pictureUrl: require('../assets/image/home/bannerWrap@2x.png'),
// },
// {
// pictureUrl: require('../assets/image/home/bannerWrap2@2x.png'),
// },
],
moduleSeparateList: [
{
'moduleId': 1,
'moduleCode': 'PARTNER',
'moduleName': '产品查询',
'moduleIcon': require('@/assets/homePage/product-select.png'),
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
},
{
'moduleId': 2,
'moduleCode': 'PROJECT',
'moduleName': '产品试算',
'moduleIcon': require('@/assets/homePage/product-trial.png'),
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
},
{
'moduleId': 3,
'moduleCode': 'CONTRACT',
'moduleName': '合同查询',
'moduleIcon': require('@/assets/homePage/contract-query.png'),
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
},
{
'moduleId': 4,
'moduleCode': 'PERSONAL',
'moduleName': '还款计划',
'moduleIcon': require('@/assets/homePage/replay.png'),
'roleId': 1,
'roleCode': 'ADMIN',
'roleName': '管理员',
},
],
}
......@@ -2,7 +2,7 @@
* @Descrip: 主页
* @Author: your name
* @Date: 2019-10-10 14:25:15
* @LastEditTime: 2019-10-14 13:57:37
* @LastEditTime: 2019-10-15 14:06:37
* @LastEditors: Please set LastEditors
-->
<template>
......@@ -11,7 +11,7 @@
<div slot="left" class="h-header-btn">
<!-- <i class="ion-ios-arrow-back" /> -->
<img class="locations" src="@/assets/homePage/location.png" alt="" @click="location">
<span>{{ city }}</span>
<span class="home-city">{{ city }}</span>
</div>
<div slot="center" @click="getLocation">徐工租赁</div>
</h-header>
......@@ -24,11 +24,21 @@
<img src="@/assets/homePage/banner2.png" alt="">
</swipe-item>
</swipe>
<div class="function">
<div class="functions">
<function-item
v-for="(item,index) in functionList" :key="index" :functionIcon="item.functionIcon"
:functionName="item.functionName"
:data="item" class="function-item vue-1px" @clickFunction="goFunctionHome"/>
v-for="item in moduleSeparateList.slice(0,4)" :key="item.moduleId" :functionIcon="item.moduleIcon"
:functionName="item.moduleName"
:data="item"/>
</div>
<div class="middle-box">
<header>常用应用</header>
<div class="function">
<function-item
v-for="(item,index) in functionList" :key="index" :functionIcon="item.functionIcon"
:functionName="item.functionName"
:data="item" class="function-item vue-1px" @clickFunction="goFunctionHome"/>
</div>
</div>
<div class="center-pic">
<div class="left-pic">
......@@ -69,33 +79,43 @@
</h-view>
</template>
<script>
import functionState from './functionState'
export default {
name: 'HomePage',
data () {
return {
city: '',
province: '',
user_bp_status: '',
user_bp_class: '',
bp_id: '',
moduleSeparateList: [],
functionList: [
{
functionIcon: require('@/assets/homePage/product-select.png'),
functionName: '产品查询',
functionIcon: require('@/assets/userBind/np.png'),
functionName: '用户绑定',
functionState: 'UserBind',
},
{
functionIcon: require('@/assets/homePage/product-trial.png'),
functionName: '产品试算',
functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '绑定查询',
functionState: 'NaturePersonReadOnly',
},
{
functionIcon: require('@/assets/homePage/contract-query.png'),
functionName: '合同查询',
functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '进件审批',
functionState: 'IntoList',
},
{
functionIcon: require('@/assets/homePage/replay.png'),
functionName: '还款计划',
functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '经销商签约',
functionState: 'ContractList',
},
{
functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '合同签约',
functionState: 'ContractSigning',
},
],
}
},
......@@ -104,6 +124,14 @@ export default {
created () {
this.getLocation()
},
beforeRouteEnter (to, from, next) {
next(vm => {
// if (from.name === 'Login') {
vm.moduleSeparateList = [...functionState.moduleSeparateList]
vm.userQuery()
// }
})
},
methods:
{
// 定位
......@@ -128,29 +156,29 @@ export default {
}, {enableHighAccuracy: true})
},
goFunctionHome (data) {
// if (data.functionState === 'NaturePersonReadOnly') {
// if (this.user_bp_status === 'APPROVED' && this.user_bp_class === 'NP') {
// this.$router.push({
// name: 'NaturePersonReadOnly',
// params: {
// 'bp_id': this.bp_id,
// },
// })
// } else if (this.user_bp_status === 'APPROVED' && this.user_bp_class === 'ORG') {
// this.$router.push({
// name: 'EnterpriseReadOnly',
// params: {
// 'bp_id': this.bp_id,
// },
// })
// } else {
// this.hlsPopup.showLongCenter('您的绑定申请还在流程中')
// }
// } else {
// this.$router.push({
// name: data.functionState,
// })
// }
if (data.functionState === 'NaturePersonReadOnly') {
if (this.user_bp_status !== 'APPROVING' && this.user_bp_class === 'NP') {
this.$router.push({
name: 'NaturePersonReadOnly',
params: {
'bp_id': this.bp_id,
},
})
} else if (this.user_bp_status !== 'APPROVING' && this.user_bp_class === 'ORG') {
this.$router.push({
name: 'EnterpriseReadOnly',
params: {
'bp_id': this.bp_id,
},
})
} else {
this.hlsPopup.showLongCenter('您的绑定申请还在流程中')
}
} else {
this.$router.push({
name: data.functionState,
})
}
},
location () {
this.$router.push({
......@@ -161,15 +189,114 @@ export default {
},
})
},
// 用户信息查询
userQuery () {
let vm = this
let url = $config.basePath + 'user_query'
let param = {
'phone': window.localStorage.getItem('user_phone'),
}
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
vm.user_bp_status = res.info.user_bp_status
vm.user_bp_class = res.info.user_bp_class
vm.bp_id = res.info.user_bp_id
}
})
},
},
}
</script>
<style lang='less' scoped>
@import "../../styles/vue-1px";
#homePage {
.h-header .h-header-left .h-header-btn:first-of-type {
.home-city {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.h-header .h-header-left .h-header-btn:first-of-type {
padding-left: 0.2rem;
}
.functions {
height: 82px;
width: 100%;
background: #fff;
padding-top: 10px;
display: flex;
justify-content: space-between;
&:before {
content: ''
}
&:after {
content: ''
}
.function-item {
text-align: center;
}
}
.middle-box {
margin-top: 8px;
background: white;
header {
height: 33px;
display: flex;
align-items: center;
line-height: 100%;
color: #5D98F6;
position: relative;
&:before {
content: '';
width: 4px;
height: 15px;
margin-right: 9px;
margin-left: 10px;
background-image: linear-gradient(-180deg, #5D98F6 0%, #76BCEE 100%);
border-radius: 2px;
}
&:after {
.setBottomLine()
}
span {
font-size: 12px;
color: #878A8D;
position: absolute;
right: 15px;
}
}
.function{
display: flex;
flex-wrap: wrap;
.function-item {
width: 25%;
height: 89px;
font-size: 12px;
// border: 1px solid rgba(169,169,169,0.1); /*no*/
/deep/ img {
height: 30px;
width: 30px;
margin: 23px 28px 9px 33px;
}
&:before {
.setBottomLine();
}
&:after {
.setRightLine();
}
}
}
}
.h-header .h-header-center div{
text-align: left!important;
}
......
......@@ -2,7 +2,7 @@
* @Descrip""/>User Settings Edit
* @Author: your name
* @Date: 2019-10-11 09:39:51
* @LastEditTime: 2019-10-15 10:26:04
* @LastEditTime: 2019-10-15 10:42:44
* @LastEditors: Please set LastEditors
-->
<template>
......@@ -13,37 +13,39 @@
<span>选择地区</span>
</div>
</h-header>
<section>
<div class="current-location">
<div class="img-box">
<img src="@/assets/homePage/location.png" alt="">
<h-content>
<div class="sec">
<div class="current-location">
<div class="img-box">
<img src="@/assets/homePage/location.png" alt="">
</div>
<p>当前位置</p>
</div>
<p>当前位置</p>
</div>
<list-item>
<item :proportion="[5,2]">
<section slot="name" class="place">{{ places }}</section>
<section slot="content" class="relocation">
<div>
<img src="@/assets/homePage/relocation.png" alt="">
<p @click="relocation">重新定位</p>
</div>
<list-item>
<item :proportion="[5,2]">
<section slot="name" class="place">{{ places }}</section>
<section slot="content" class="relocation">
<div>
<img src="@/assets/homePage/relocation.png" alt="">
<p @click="relocation">重新定位</p>
</div>
</section>
</item>
</list-item>
</section>
</item>
</list-item>
<div class="current-location">
<p class="select-location" @click="switchCity">选择位置</p>
</div>
<div class="provinces">
<p :class="{styles:!flag}" @click="changeStyle(1)">{{ province }}</p>
<p :class="{styles:flag}" @click="changeStyle(2)">{{ city }}</p>
<div class="current-location">
<p class="select-location" @click="switchCity">选择位置</p>
</div>
<div class="provinces">
<p :class="{styles:!flag}" @click="changeStyle(1)">{{ province }}</p>
<p :class="{styles:flag}" @click="changeStyle(2)">{{ city }}</p>
</div>
</div>
</section>
<section>
<!-- 省份 -->
<scroll v-show="province_flag" :pullUp="false" class="content-scroll">
......@@ -65,7 +67,7 @@
</list-item>
</scroll>
</section>
</h-content>
</h-view>
</template>
<script>
......@@ -191,6 +193,9 @@ export default {
line-height: 24px;
}
}
// .sec {
// position: fixed;
// }
.current-location {
height: 34px;
width: 100%;
......
<!--
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-09-24 12:34:06
* @LastEditTime: 2019-10-15 13:55:04
* @LastEditors: Please set LastEditors
-->
<template>
<div id="tab" style="height: 100%;width:100%;">
<transition>
......@@ -9,7 +16,7 @@
<router-view v-if="!$route.meta.keepAlive"/>
</transition>
<tabbar slot="bottom" class="vux-tabbar" icon-class="vux-center">
<tabbar-item :link="{path:'/tab/home'}" :selected="$route.path === '/' || $route.path==='/tab/home'">
<tabbar-item :link="{path:'/tab/home-page'}" :selected="$route.path === '/' || $route.path==='/tab/home-page'">
<img slot="icon-active" src="../assets/image/tab/home@2x.png">
<img slot="icon" src="../assets/image/tab/n_home@2x.png">
<span slot="label">主页</span>
......@@ -50,7 +57,7 @@ export default {
this.pathList.push(to.path)
this.$router.isBack = false
}
if (to.path === '/tab/home') {
if (to.path === '/tab/home-page') {
this.$router.isBack = true
this.pathList = []
}
......
......@@ -2,7 +2,7 @@
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-09-24 12:34:06
* @LastEditTime: 2019-10-14 13:47:34
* @LastEditTime: 2019-10-15 13:52:13
* @LastEditors: Please set LastEditors
*/
import Vue from 'vue'
......@@ -83,10 +83,10 @@ export default new Router({
path: '/tab',
component: Tab,
name: 'Tab',
redirect: '/tab/home',
redirect: '/tab/home-page',
meta: {keepAlive: true},
children: [
{path: '/tab/home', component: Home, name: 'Home', meta: {keepAlive: true}},
{path: '/tab/home-page', component: HomePage, name: 'HomePage', meta: {keepAlive: false}},
{path: '/tab/my-info', component: MyInfo, name: 'MyInfo', meta: {keepAlive: true}},
],
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment