123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391 |
- <template>
- <view>
- <view class="background">
- <!-- 个人信息 @click="gotoUrl('/pages/mine/personInfos')" -->
-
- <view class="person-infos" >
- <view class="photo">
-
- <image class="img" src="@/assets/img/默认头像.png" mode=""></image>
- </view>
- <view class="else">
- <view class="name">
- {{regUser.name}}
- </view>
- <view class="company">
- {{personInfo.fullName}}
- </view>
-
- </view>
- </view>
- <!-- 地址 -->
- <view class="address-box" >
- <view class="address">
- <view class="address-title">
- {{personInfo.name}}
- </view>
- <view class="address-value" v-if="false" >
- <!-- -->
- <u-icon name="map" v-if="personInfo.remark"></u-icon>{{personInfo.remark}}
- <!-- {{companyInfo.typeN}} -->
- </view>
- </view>
- <!-- 切换 -->
- <u-picker v-model="changeUserShow" mode="selector" :range="userList"
- :default-selector="[defaultIndex]" range-key="tenantName" @confirm="selector1confirm" ></u-picker>
-
- <view class="change" @click="changeUserShowBtn" v-if="userList&&userList.length>1">
- 切换
- </view>
- <view class="image" >
- <image class="img" src="@/assets/img/mineBackground.svg" mode=""></image>
- </view>
- </view>
- </view>
- <!-- 功能 -->
- <view class="function-group">
- <view class="function-item" v-if="false" @click="gotoUrl('/pages/mine/tenantInformation')" >
- <view class="icon">
- <image class="img" src="@/assets/img/riLine-contacts-book-line.svg" mode=""></image>
- </view>
- <view class="name">
- 用户信息
- </view>
- <view class="arrow">
- <u-icon name="arrow-right" color="#b2b2b2"></u-icon>
- </view>
- </view>
- <view class="function-item" v-if="false">
- <view class="icon">
- <image class="img" src="@/assets/img/riLine-pie-chart-line.svg" mode=""></image>
- </view>
- <view class="name">
- 用电监控
- </view>
- <view class="arrow">
- <u-icon name="arrow-right" color="#b2b2b2"></u-icon>
- </view>
- </view>
-
- <view class="function-item" v-if="false">
- <view class="icon">
- <image class="img" src="@/assets/img/riLine-book-2-line.svg" mode=""></image>
- </view>
- <view class="name">
- 用电常识
- </view>
- <view class="arrow">
- <u-icon name="arrow-right" color="#b2b2b2"></u-icon>
- </view>
- </view>
-
- <view class="function-item" @click="gotoUrl('/pages/invoiceManagement/invoiceManagement')" >
- <view class="icon">
- <image class="img" src="@/assets/img/iconPark-order2.svg" mode=""></image>
- </view>
- <view class="name">
- 发票管理
- </view>
- <view class="arrow">
- <u-icon name="arrow-right" color="#b2b2b2"></u-icon>
- </view>
- </view>
-
- <view class="function-item" @click="gotoUrl('/pages/mine/contactService')" >
- <view class="icon">
- <image class="img" src="@/assets/img/riLine-customer-service-2-line.svg" mode=""></image>
- </view>
- <view class="name">
- 客服热线
- </view>
- <view class="arrow">
- <u-icon name="arrow-right" color="#b2b2b2"></u-icon>
- </view>
- </view>
-
- </view>
-
- <view class="function-group" v-if="false">
- <view class="function-item">
- <view class="icon">
- <image class="img" src="@/assets/img/riLine-user-settings-line.svg" mode=""></image>
- </view>
- <view class="name">
- 个人信息
- </view>
- <view class="arrow">
- <u-icon name="arrow-right" color="#b2b2b2"></u-icon>
- </view>
- </view>
-
- </view>
-
- <view class="function-group" >
- <view class="function-item" @click="gotoUrl('/pages/mine/setting')">
- <view class="icon">
- <image class="img" src="@/assets/img/riLine-settings-2-line.svg" mode=""></image>
- </view>
- <view class="name">
- 设置
- </view>
- <view class="arrow">
- <u-icon name="arrow-right" color="#b2b2b2"></u-icon>
- </view>
- </view>
-
- </view>
-
- <Tabbar :current="2" :prefetchNum="prefetchNum" ></Tabbar>
- </view>
- </template>
- <script>
- import * as API from '@/apis/pagejs/index.js'
- import * as API_user from '@/apis/pagejs/user.js'
-
- import * as API_message from '@/apis/pagejs/message.js'
-
- import Tabbar from '@/components/Tabbar.vue'
- export default {
- components: {
- Tabbar
- },
- data() {
- return {
- companyInfo:{},
- regUser:{},
- userList:[],
- changeUserShow:false,
- defaultIndex:0,
- prefetchNum:0,
- personInfo:{
-
- }
- }
- },
- onLoad() {
- this.personInfo=this.carhelp.getPersonInfo()
- this.homePage()
-
- this.userList=this.carhelp.getPersonInfoPlus().userList
- this.prefetch()
- //this.personalCenter()
- },
- methods: {
- prefetch(){
- API_message.prefetch({
-
- }).then((response) => {
- //this.prefetchNum=response.data
- }).catch(error => {
- //uni.hideLoading();
-
- })
- },
- query(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API_user.findByOpenId({
- noerror:true,
- openId: this.carhelp.getOpenId(),
-
- }).then((response) => {
- //this.loginset(response)
- uni.hideLoading();
- var token = response ? response.data.token : '';
-
- this.carhelp.setToken(token);
- this.carhelp.setPersonInfo(response.data.tenantInfo);
- this.carhelp.setPersonInfoPlus(response.data)
-
- this.companyInfo=response.data.companyInfo;
- this.regUser=response.data.regUser;
-
- this.personInfo=response.data.tenantInfo;
- this.prefetch();
- //this.homePage()
-
- }).catch(error => {
- uni.hideLoading();
-
- })
- },
- changeUserShowBtn(){
- this.defaultIndex=this.userList.findIndex(item=>{
- return item.id==this.regUser.id
- })
-
- this.changeUserShow=true
- },
- selector1confirm(e){
- var obj=this.userList[e[0]]
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API_user.changeUser({
- id:obj.id,
- openId:this.carhelp.getOpenId()
- }).then((response) => {
- this.query()
-
-
- //this.companyInfo=response.data.companyInfo;
- }).catch(error => {
- uni.hideLoading();
-
- })
- },
- personalCenter(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API_user.personalCenter({
-
- }).then((response) => {
-
- uni.hideLoading();
- //this.companyInfo=response.data.companyInfo;
- }).catch(error => {
- uni.hideLoading();
-
- })
- },
- homePage(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API.homePage({
-
- }).then((response) => {
- uni.hideLoading();
- this.companyInfo=response.data.companyInfo;
- this.regUser=response.data.regUser;
-
- this.personInfo=response.data.tenantInfo;
-
- }).catch(error => {
- uni.hideLoading();
-
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .background{
- background: linear-gradient(180deg, rgba(194,219,255,1) 53%,rgba(180,211,255,0) 100%);
- padding: 72rpx 32rpx;
- // 个人信息
- .person-infos{
- display: flex;
- align-items: center;
- .photo{
- width: 112rpx;
- height: 112rpx;
- border-radius: 50px;
- .img{
- width: 100%;
- height: 100%;
- }
- }
- .else{
- margin-left: 24rpx;
- .name{
- color: rgb(16,16,16);
- font-size: 36rpx;
- font-weight: bold;
- }
- .company{
- color: rgba(16,16,16,1);
- }
- }
-
- }
- // 地址
- .address-box{
- border-radius: 8px;
- background: linear-gradient(90deg, rgba(49,110,207,1) 2%,rgba(20,73,159,1) 100%);
- color: #fff;
- padding:40rpx 32rpx;
- margin-top: 40rpx;
- display: flex;
- align-items: center;
- position: relative;
- .address{
- .address-title{
- font-size: 40rpx;
- }
- .address-value{
- font-size: 24rpx;
- margin-top: 8rpx;
- }
- }
-
- // 切换
- .change{
- border: 1px solid rgba(255,255,255,1);
- width: 128rpx;
- height: 64rpx;
- line-height: 64rpx;
- border-radius: 50px;
- color: rgba(255,255,255,1);
- text-align: center;
- margin-left: auto;
- z-index: 99;
- }
- .image {
- width: 174rpx;
- height: 174rpx;
- position: absolute;
- right: 0;
- top: 20rpx;
-
- .img {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- // 功能
- .function-group{
- border-radius: 8px;
- background-color: #fff;
- margin: 0 32rpx 24rpx;
- .function-item{
- display: flex;
- align-items: center;
- padding: 26rpx 26rpx 26rpx 0;
- margin-left: 26rpx;
- border-bottom: 1px solid rgba(221,221,221,1);
- .icon{
- width: 40rpx;
- height: 40rpx;
- .img{
- width: 100%;
- height: 100%;
- }
- }
- .name{
- color: rgba(51,51,51,1);
- font-size: 30rpx;
- margin-left: 26rpx;
- }
- .arrow{
- margin-left: auto;
- }
- }
- }
- </style>
|