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 { export default {
bannerList: [ 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 @@ ...@@ -2,7 +2,7 @@
* @Descrip: 主页 * @Descrip: 主页
* @Author: your name * @Author: your name
* @Date: 2019-10-10 14:25:15 * @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 * @LastEditors: Please set LastEditors
--> -->
<template> <template>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div slot="left" class="h-header-btn"> <div slot="left" class="h-header-btn">
<!-- <i class="ion-ios-arrow-back" /> --> <!-- <i class="ion-ios-arrow-back" /> -->
<img class="locations" src="@/assets/homePage/location.png" alt="" @click="location"> <img class="locations" src="@/assets/homePage/location.png" alt="" @click="location">
<span>{{ city }}</span> <span class="home-city">{{ city }}</span>
</div> </div>
<div slot="center" @click="getLocation">徐工租赁</div> <div slot="center" @click="getLocation">徐工租赁</div>
</h-header> </h-header>
...@@ -24,12 +24,22 @@ ...@@ -24,12 +24,22 @@
<img src="@/assets/homePage/banner2.png" alt=""> <img src="@/assets/homePage/banner2.png" alt="">
</swipe-item> </swipe-item>
</swipe> </swipe>
<div class="functions">
<function-item
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"> <div class="function">
<function-item <function-item
v-for="(item,index) in functionList" :key="index" :functionIcon="item.functionIcon" v-for="(item,index) in functionList" :key="index" :functionIcon="item.functionIcon"
:functionName="item.functionName" :functionName="item.functionName"
:data="item" class="function-item vue-1px" @clickFunction="goFunctionHome"/> :data="item" class="function-item vue-1px" @clickFunction="goFunctionHome"/>
</div> </div>
</div>
<div class="center-pic"> <div class="center-pic">
<div class="left-pic"> <div class="left-pic">
<img src="@/assets/homePage/1 copy@2x.png" alt=""> <img src="@/assets/homePage/1 copy@2x.png" alt="">
...@@ -69,33 +79,43 @@ ...@@ -69,33 +79,43 @@
</h-view> </h-view>
</template> </template>
<script> <script>
import functionState from './functionState'
export default { export default {
name: 'HomePage', name: 'HomePage',
data () { data () {
return { return {
city: '', city: '',
province: '', province: '',
user_bp_status: '',
user_bp_class: '',
bp_id: '',
moduleSeparateList: [],
functionList: [ functionList: [
{ {
functionIcon: require('@/assets/homePage/product-select.png'), functionIcon: require('@/assets/userBind/np.png'),
functionName: '产品查询', functionName: '用户绑定',
functionState: 'UserBind', functionState: 'UserBind',
}, },
{ {
functionIcon: require('@/assets/homePage/product-trial.png'), functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '产品试算', functionName: '绑定查询',
functionState: 'NaturePersonReadOnly', functionState: 'NaturePersonReadOnly',
}, },
{ {
functionIcon: require('@/assets/homePage/contract-query.png'), functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '合同查询', functionName: '进件审批',
functionState: 'IntoList', functionState: 'IntoList',
}, },
{ {
functionIcon: require('@/assets/homePage/replay.png'), functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '还款计划', functionName: '经销商签约',
functionState: 'ContractList', functionState: 'ContractList',
}, },
{
functionIcon: require('@/assets/intoApproval/introduce.png'),
functionName: '合同签约',
functionState: 'ContractSigning',
},
], ],
} }
}, },
...@@ -104,6 +124,14 @@ export default { ...@@ -104,6 +124,14 @@ export default {
created () { created () {
this.getLocation() this.getLocation()
}, },
beforeRouteEnter (to, from, next) {
next(vm => {
// if (from.name === 'Login') {
vm.moduleSeparateList = [...functionState.moduleSeparateList]
vm.userQuery()
// }
})
},
methods: methods:
{ {
// 定位 // 定位
...@@ -128,29 +156,29 @@ export default { ...@@ -128,29 +156,29 @@ export default {
}, {enableHighAccuracy: true}) }, {enableHighAccuracy: true})
}, },
goFunctionHome (data) { goFunctionHome (data) {
// if (data.functionState === 'NaturePersonReadOnly') { if (data.functionState === 'NaturePersonReadOnly') {
// if (this.user_bp_status === 'APPROVED' && this.user_bp_class === 'NP') { if (this.user_bp_status !== 'APPROVING' && this.user_bp_class === 'NP') {
// this.$router.push({ this.$router.push({
// name: 'NaturePersonReadOnly', name: 'NaturePersonReadOnly',
// params: { params: {
// 'bp_id': this.bp_id, 'bp_id': this.bp_id,
// }, },
// }) })
// } else if (this.user_bp_status === 'APPROVED' && this.user_bp_class === 'ORG') { } else if (this.user_bp_status !== 'APPROVING' && this.user_bp_class === 'ORG') {
// this.$router.push({ this.$router.push({
// name: 'EnterpriseReadOnly', name: 'EnterpriseReadOnly',
// params: { params: {
// 'bp_id': this.bp_id, 'bp_id': this.bp_id,
// }, },
// }) })
// } else { } else {
// this.hlsPopup.showLongCenter('您的绑定申请还在流程中') this.hlsPopup.showLongCenter('您的绑定申请还在流程中')
// } }
// } else { } else {
// this.$router.push({ this.$router.push({
// name: data.functionState, name: data.functionState,
// }) })
// } }
}, },
location () { location () {
this.$router.push({ this.$router.push({
...@@ -161,15 +189,114 @@ export default { ...@@ -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> </script>
<style lang='less' scoped> <style lang='less' scoped>
@import "../../styles/vue-1px";
#homePage { #homePage {
.home-city {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.h-header .h-header-left .h-header-btn:first-of-type { .h-header .h-header-left .h-header-btn:first-of-type {
padding-left: 0.2rem; 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{ .h-header .h-header-center div{
text-align: left!important; text-align: left!important;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Descrip""/>User Settings Edit * @Descrip""/>User Settings Edit
* @Author: your name * @Author: your name
* @Date: 2019-10-11 09:39:51 * @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 * @LastEditors: Please set LastEditors
--> -->
<template> <template>
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
<span>选择地区</span> <span>选择地区</span>
</div> </div>
</h-header> </h-header>
<section>
<h-content>
<div class="sec">
<div class="current-location"> <div class="current-location">
<div class="img-box"> <div class="img-box">
<img src="@/assets/homePage/location.png" alt=""> <img src="@/assets/homePage/location.png" alt="">
...@@ -42,8 +45,7 @@ ...@@ -42,8 +45,7 @@
<p :class="{styles:!flag}" @click="changeStyle(1)">{{ province }}</p> <p :class="{styles:!flag}" @click="changeStyle(1)">{{ province }}</p>
<p :class="{styles:flag}" @click="changeStyle(2)">{{ city }}</p> <p :class="{styles:flag}" @click="changeStyle(2)">{{ city }}</p>
</div> </div>
</section> </div>
<section>
<!-- 省份 --> <!-- 省份 -->
<scroll v-show="province_flag" :pullUp="false" class="content-scroll"> <scroll v-show="province_flag" :pullUp="false" class="content-scroll">
...@@ -65,7 +67,7 @@ ...@@ -65,7 +67,7 @@
</list-item> </list-item>
</scroll> </scroll>
</section> </h-content>
</h-view> </h-view>
</template> </template>
<script> <script>
...@@ -191,6 +193,9 @@ export default { ...@@ -191,6 +193,9 @@ export default {
line-height: 24px; line-height: 24px;
} }
} }
// .sec {
// position: fixed;
// }
.current-location { .current-location {
height: 34px; height: 34px;
width: 100%; 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> <template>
<div id="tab" style="height: 100%;width:100%;"> <div id="tab" style="height: 100%;width:100%;">
<transition> <transition>
...@@ -9,7 +16,7 @@ ...@@ -9,7 +16,7 @@
<router-view v-if="!$route.meta.keepAlive"/> <router-view v-if="!$route.meta.keepAlive"/>
</transition> </transition>
<tabbar slot="bottom" class="vux-tabbar" icon-class="vux-center"> <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-active" src="../assets/image/tab/home@2x.png">
<img slot="icon" src="../assets/image/tab/n_home@2x.png"> <img slot="icon" src="../assets/image/tab/n_home@2x.png">
<span slot="label">主页</span> <span slot="label">主页</span>
...@@ -50,7 +57,7 @@ export default { ...@@ -50,7 +57,7 @@ export default {
this.pathList.push(to.path) this.pathList.push(to.path)
this.$router.isBack = false this.$router.isBack = false
} }
if (to.path === '/tab/home') { if (to.path === '/tab/home-page') {
this.$router.isBack = true this.$router.isBack = true
this.pathList = [] this.pathList = []
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @Author: your name * @Author: your name
* @Date: 2019-09-24 12:34:06 * @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 * @LastEditors: Please set LastEditors
*/ */
import Vue from 'vue' import Vue from 'vue'
...@@ -83,10 +83,10 @@ export default new Router({ ...@@ -83,10 +83,10 @@ export default new Router({
path: '/tab', path: '/tab',
component: Tab, component: Tab,
name: 'Tab', name: 'Tab',
redirect: '/tab/home', redirect: '/tab/home-page',
meta: {keepAlive: true}, meta: {keepAlive: true},
children: [ 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}}, {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