qzc提交
parent
8eae3825ba
commit
b180999b39
10
main.js
10
main.js
|
|
@ -13,13 +13,9 @@ $http.beforeRequest = function (options) {
|
|||
uni.showLoading({
|
||||
title: '数据加载中'
|
||||
})
|
||||
if (options.url.indexOf('/my/') !== -1) {
|
||||
options.header = {
|
||||
Authorization: store.state.address.token
|
||||
}
|
||||
console.log(options.header)
|
||||
}
|
||||
if (options.url.indexOf('/getLoginInfo') !== -1) {
|
||||
|
||||
if (options.url.indexOf('/getLoginInfo') == -1) {
|
||||
console.log('token',uni.getStorageSync('Gs-Token'))
|
||||
options.header = {
|
||||
'gs-token': uni.getStorageSync('Gs-Token')
|
||||
}
|
||||
|
|
|
|||
26
pages.json
26
pages.json
|
|
@ -143,6 +143,20 @@
|
|||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/addressBook/follow",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/addressBook/myDept",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
|
@ -150,18 +164,18 @@
|
|||
"color": "#333333",
|
||||
"selectedColor": "#eb4450",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "/static/tabs/my2_icon@2x.png",
|
||||
"selectedIconPath": "static/tabs/my2_icon@2x.png",
|
||||
"text": "pages"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/homeIndex/index",
|
||||
"iconPath": "/static/tabs/首页@2x.png",
|
||||
"selectedIconPath": "static/tabs/首页2@2x.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/addressBook/addressBook",
|
||||
"iconPath": "/static/tabs/my2_icon@2x.png",
|
||||
"selectedIconPath": "static/tabs/my2_icon@2x.png",
|
||||
"text": "通讯录"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mypage/mypage",
|
||||
"iconPath": "/static/images/my1.png",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,148 @@
|
|||
<template>
|
||||
<view :style="{height:'100vh',overflow:'hidden',background:'#f7f7f7'}">
|
||||
<u-status-bar></u-status-bar>
|
||||
<u-navbar
|
||||
title="关注"
|
||||
:autoBack="true"
|
||||
:titleStyle="{
|
||||
fontSize:'18px'
|
||||
}"
|
||||
:height='44'
|
||||
:safeAreaInsetTop=true
|
||||
leftIconSize='20'
|
||||
leftIconColor='rgb(153, 153, 153)'
|
||||
>
|
||||
</u-navbar>
|
||||
<div class="searchBar">
|
||||
<u-search
|
||||
placeholder="请输入姓名或手机号"
|
||||
shape="square"
|
||||
:showAction="false"
|
||||
height="35"
|
||||
v-model="keyword"
|
||||
></u-search>
|
||||
</div>
|
||||
|
||||
<div class="mybody">
|
||||
<div :style="{display:'flex',alignItems:'center',height:'60px'}" v-for="(item,index) in getList">
|
||||
<!-- <u--image :style="{margin:'0 30px'}" :src="'../../static/images/filter.png'" width="22px" height="22px"></u--image> -->
|
||||
<div class="personItemIcon"><text>{{item.userName.slice(0, 1)}}</text></div>
|
||||
<div class="personItemRow_right">
|
||||
<div class="personItemRow_right_top">
|
||||
<div :style="{width:'100px'}"><text>{{item.userName}}</text></div>
|
||||
<div :style="{flex:'1'}"><text>{{item.phone}}</text></div>
|
||||
</div>
|
||||
<div class="personItemRow_right_bottom">
|
||||
<text :style="{fontSize:'12px',color:'rgba(0, 0, 0, 0.4)'}">{{item.duty}}</text>
|
||||
</div>
|
||||
</div>
|
||||
<div class="personItemRow_right2">
|
||||
<u-icon v-if="item.isMyAttendee" name="star-fill" color="#f5dc4d" size="24" @click="follow(false,item.userId)"></u-icon>
|
||||
<u-icon v-if="!item.isMyAttendee" name="star" color="#f5dc4d" size="24" @click="follow(true,item.userId)"></u-icon>
|
||||
<u-icon name="phone" size="24" :style="{margin:'3px 10px 0 10px'}" @click="callNum(item.phone)"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :style="{height:'100px'}"></div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
keyword:'',
|
||||
list:[]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getList() {
|
||||
if(this.keyword){
|
||||
return [...this.list].filter(o=>o.userName.indexOf(this.keyword)!==-1)
|
||||
}else{
|
||||
return [...this.list]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData () {
|
||||
try {
|
||||
const res = await uni.$http.get('/gunshiApp/xfflood/addressbook/my/attendee')
|
||||
this.list = res.data.data
|
||||
} catch (e) {
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
async follow (flag,id) {
|
||||
let url = flag?'/gunshiApp/xfflood/addressbook/attendee/add':'/gunshiApp/xfflood/addressbook/attendee/cancel'
|
||||
const params = {
|
||||
addUserId:id
|
||||
}
|
||||
try {
|
||||
const res = await uni.$http.post(url,params)
|
||||
if(res.data.code === 200){
|
||||
//关注成功
|
||||
this.getData()
|
||||
}
|
||||
} catch (e) {
|
||||
uni.$showMsg()
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchBar{
|
||||
background-color: #ffffff;
|
||||
margin-top: 44px;
|
||||
height: 60px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.mybody{
|
||||
background-color: #ffffff;
|
||||
margin: 5px 5px;
|
||||
padding: 5px 0px;
|
||||
height: calc( 100vh - 100px );
|
||||
overflow: scroll;
|
||||
}
|
||||
.personItemIcon{
|
||||
width: 40px;
|
||||
height:40px;
|
||||
background-color: rgb(53, 133, 249);;
|
||||
border-radius: 20px;
|
||||
margin: 0 20px;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
color: #ffffff;
|
||||
}
|
||||
.personItemRow_right{
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
border-bottom: 1px solid #eee;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.personItemRow_right2{
|
||||
width: 100px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.personItemRow_right_top{
|
||||
margin-top: 5px;
|
||||
display: flex;
|
||||
justify-content: flex-start
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
<template>
|
||||
<view :style="{height:'100vh',overflow:'hidden',background:'#f7f7f7'}">
|
||||
<u-status-bar></u-status-bar>
|
||||
<u-navbar
|
||||
title="我的部门"
|
||||
:autoBack="true"
|
||||
:titleStyle="{
|
||||
fontSize:'18px'
|
||||
}"
|
||||
:height='44'
|
||||
:safeAreaInsetTop=true
|
||||
leftIconSize='20'
|
||||
leftIconColor='rgb(153, 153, 153)'
|
||||
>
|
||||
</u-navbar>
|
||||
<div class="searchBar">
|
||||
<u-search
|
||||
placeholder="请输入姓名或手机号"
|
||||
shape="square"
|
||||
:showAction="false"
|
||||
height="35"
|
||||
v-model="keyword"
|
||||
></u-search>
|
||||
</div>
|
||||
|
||||
<div class="mybody">
|
||||
<div :style="{display:'flex',alignItems:'center',height:'60px'}" v-for="(item,index) in getList">
|
||||
<!-- <u--image :style="{margin:'0 30px'}" :src="'../../static/images/filter.png'" width="22px" height="22px"></u--image> -->
|
||||
<div class="personItemIcon"><text>{{item.userName.slice(0, 1)}}</text></div>
|
||||
<div class="personItemRow_right">
|
||||
<div class="personItemRow_right_top">
|
||||
<div :style="{width:'100px'}"><text>{{item.userName}}</text></div>
|
||||
<div :style="{flex:'1'}"><text>{{item.phone}}</text></div>
|
||||
</div>
|
||||
<div class="personItemRow_right_bottom">
|
||||
<text :style="{fontSize:'12px',color:'rgba(0, 0, 0, 0.4)'}">{{item.duty}}</text>
|
||||
</div>
|
||||
</div>
|
||||
<div class="personItemRow_right2">
|
||||
<u-icon v-if="item.isMyAttendee" name="star-fill" color="#f5dc4d" size="24" @click="follow(false,item.userId)"></u-icon>
|
||||
<u-icon v-if="!item.isMyAttendee" name="star" color="#f5dc4d" size="24" @click="follow(true,item.userId)"></u-icon>
|
||||
<u-icon name="phone" size="24" :style="{margin:'3px 10px 0 10px'}" @click="callNum(item.phone)"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :style="{height:'100px'}"></div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
keyword:'',
|
||||
list:[]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getList() {
|
||||
if(this.keyword){
|
||||
return [...this.list].filter(o=>o.userName.indexOf(this.keyword)!==-1)
|
||||
}else{
|
||||
return [...this.list]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData () {
|
||||
try {
|
||||
const res = await uni.$http.get('/gunshiApp/xfflood/addressbook/my/department')
|
||||
this.list = res.data.data
|
||||
} catch (e) {
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
async follow (flag,id) {
|
||||
let url = flag?'/gunshiApp/xfflood/addressbook/attendee/add':'/gunshiApp/xfflood/addressbook/attendee/cancel'
|
||||
const params = {
|
||||
addUserId:id
|
||||
}
|
||||
try {
|
||||
const res = await uni.$http.post(url,params)
|
||||
if(res.data.code === 200){
|
||||
//关注成功
|
||||
this.getData()
|
||||
}
|
||||
} catch (e) {
|
||||
uni.$showMsg()
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchBar{
|
||||
background-color: #ffffff;
|
||||
margin-top: 44px;
|
||||
height: 60px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.mybody{
|
||||
background-color: #ffffff;
|
||||
margin: 5px 5px;
|
||||
padding: 5px 0px;
|
||||
height: calc( 100vh - 100px );
|
||||
overflow: scroll;
|
||||
}
|
||||
.personItemIcon{
|
||||
width: 40px;
|
||||
height:40px;
|
||||
background-color: rgb(53, 133, 249);;
|
||||
border-radius: 20px;
|
||||
margin: 0 20px;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
color: #ffffff;
|
||||
}
|
||||
.personItemRow_right{
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
border-bottom: 1px solid #eee;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.personItemRow_right2{
|
||||
width: 100px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.personItemRow_right_top{
|
||||
margin-top: 5px;
|
||||
display: flex;
|
||||
justify-content: flex-start
|
||||
}
|
||||
</style>
|
||||
|
|
@ -27,8 +27,8 @@
|
|||
data() {
|
||||
return {
|
||||
formData: {
|
||||
username: '',
|
||||
password: '',
|
||||
username: 'mdx',
|
||||
password: '1234567a',
|
||||
checked: false,
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue