You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.3 KiB

3 years ago
<template>
<view class="page">
<view class="team">
<uni-data-picker class="picker-input" placeholder="切换团队" popup-title="切换团队" preload :clear-icon="false" :localdata="list" v-model="partnerId" @change="teamChange"></uni-data-picker>
</view>
<image class="banner" src="../../static/image/index/index1.png" mode="widthFix"></image>
<ul class="entry">
<li @click="$util.to('../clients/clients')">
<image class="icon" src="../../static/image/index/index3.png" mode="widthFix"></image>
<view class="text">客户</view>
</li>
<li @click="$util.to('../plans/plans')">
<image class="icon" src="../../static/image/index/index4.png" mode="widthFix"></image>
<view class="text">方案</view>
</li>
<li @click="$util.to('../orders/orders')">
<image class="icon" src="../../static/image/index/index5.png" mode="widthFix"></image>
<view class="text">订单</view>
</li>
<li @click="$util.to('../products/products')">
<image class="icon" src="../../static/image/index/index6.png" mode="widthFix"></image>
<view class="text">产品</view>
</li>
</ul>
3 years ago
</view>
</template>
<script>
import { getTeamsByAccountId } from '@/apis/modules/client.js'
3 years ago
export default {
data() {
return {
partnerId: uni.getStorageSync('partnerId') || '',
list: [],
3 years ago
}
},
onShow() {
this.getInfo()
3 years ago
},
methods: {
// 获取团队
getInfo() {
getTeamsByAccountId().then(({ data }) => {
const result = []
data.map(e => {
result.push({
text: e.partnerClassificationName,
value: e.partnerId
})
})
console.log(22, result)
if (result.length === 1) {
const val = result[0].value
this.partnerId = val
uni.setStorageSync('partnerId', val)
}
this.list = result
}).catch(e => {})
},
// 团队选择回调
teamChange() {
uni.setStorageSync('partnerId', this.partnerId)
}
3 years ago
}
}
</script>
<style scoped lang="scss">
.page {
min-height: 100%;
padding: 30rpx 22rpx;
background: url(../../static/image/index/index2.png) 0 0/100% 100% no-repeat;
}
.team {
width: 200rpx;
margin-bottom: 30rpx;
}
.banner {
width: 100%;
}
.entry {
display: flex;
justify-content: space-around;
align-items: center;
margin-top: 10rpx;
text-align: center;
.icon {
width: 78rpx;
}
.text {
font-size: 28rpx;
color: #333;
}
}
3 years ago
</style>