Commit be373ece by 李君

自定义tabbar

1 parent 81e10957
{
"pages": [
"pages/login/index",
"pages/tour/point/index",
"pages/tour/titem/index",
"pages/homes/index",
"pages/tour/list/index",
"pages/tour/gate/index",
"pages/tour/webview/index",
"pages/tour/index/index",
"pages/index/index",
"pages/me/index",
"pages/editPwd/editPwd",
"pages/shopSelect/index",
"pages/accountHome/index"
],
"subPackages": [
{
"root": "pages/zong",
"name": "zong",
"pages": [
"basic/index",
"condition/index",
"contrast/index",
"entry-rate/index",
"holiday-comparison/index",
"ranking/index",
"selectFollr/index",
"selectGate/index",
"selectMall/index",
"selectZone/index",
"sequential/index",
"timeTravel/index"
]
}
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"tabBar": {
"color": "#8181A5",
"selectedColor": "#0069FF",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"custom": true,
"list": [
{
"pagePath": "pages/accountHome/index",
"iconPath": "images/home.png",
"selectedIconPath": "images/home-b.png",
"text": "集团首页"
},
{
"pagePath": "pages/homes/index",
"iconPath": "images/cong.png",
"selectedIconPath": "images/cong-b.png",
"text": "店铺首页"
},
{
"pagePath": "pages/me/index",
"iconPath": "images/me.png",
"selectedIconPath": "images/me-b.png",
"text": "我的"
}
]
},
"useExtendedLib": {
"weui": true
},
"usingComponents": {
"navbar2": "/components/navbar2/index",
"malllist": "/components/mallList/index",
"van-icon": "@vant/weapp/icon/index",
"arrow": "/components/arrow/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-cell": "@vant/weapp/cell/index",
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index",
"van-empty": "@vant/weapp/empty/index",
"van-button": "@vant/weapp/button/index",
"van-divider": "@vant/weapp/divider/index",
"van-field": "@vant/weapp/field/index"
},
"lazyCodeLoading": "requiredComponents",
"sitemapLocation": "sitemap.json"
"pages": [
"index/index",
"index/index2",
"index/me",
"pages/login/index",
"pages/homes/index",
"pages/editPwd/editPwd",
"pages/shopSelect/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"tabBar": {
"color": "#8181A5",
"selectedColor": "#0069FF",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"custom": true,
"list": [{
"pagePath": "index/index",
"iconPath": "images/home.png",
"selectedIconPath": "images/home-b.png",
"text": "集团首页"
},
{
"pagePath": "index/index2",
"iconPath": "images/cong.png",
"selectedIconPath": "images/cong-b.png",
"text": "店铺首页"
},
{
"pagePath": "index/me",
"iconPath": "images/me.png",
"selectedIconPath": "images/me-b.png",
"text": "我的"
}
]
},
"useExtendedLib": {
"weui": true
},
"usingComponents": {
"basic":"/components/echart/basic/index",
"navbar": "/components/navbar/index",
"navbar2": "/components/navbar2/index",
"malllist": "/components/mallList/index",
"van-icon": "@vant/weapp/icon/index",
"arrow": "/components/arrow/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-cell": "@vant/weapp/cell/index",
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index",
"van-empty": "@vant/weapp/empty/index",
"van-button": "@vant/weapp/button/index",
"van-divider": "@vant/weapp/divider/index",
"van-field": "@vant/weapp/field/index"
},
"lazyCodeLoading": "requiredComponents",
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
......@@ -4,13 +4,14 @@ view {
box-sizing: border-box;
}
page{
background: linear-gradient(154deg, #C7D3FF 0%, #E9F9FF 48%, #FFFFFF 100%) !important;
/* background: linear-gradient(154deg, #C7D3FF 0%, #E9F9FF 48%, #FFFFFF 100%) !important; */
--tabs-bottom-bar-color:#1972F5;
}
.backgroundColor{
padding: 0 28rpx;
width: 100%;
/* background: linear-gradient(154deg, #C7D3FF 0%, #E9F9FF 48%, #FFFFFF 100%); */
background: linear-gradient(154deg, #C7D3FF 0%, #E9F9FF 48%, #FFFFFF 100%);
padding-top: 120rpx;
}
.van-picker__confirm{
color: #000!important;
......@@ -22,7 +23,7 @@ page{
.ellipsis{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.container {
width: 100%;
position: relative;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
......
Component({
/**
* 页面的初始数据
*/
data: {
curClick: 1, // 判断当前点击的索引下标
curClick: 1,
color: "#7A7E83",
selectedColor: "#3cc51f",
list: [{
"pagePath": "/pages/index/index",
"iconPath": "../images/home.png",
"selectedIconPath": "../images/home-b.png",
"text": "首页",
"curr": 1
},
{
"pagePath": "/pages/home/index",
"iconPath": "../images/cong.png",
"selectedIconPath": "../images/cong-b.png",
"text": "工作台",
"curr": 2
},
{
"pagePath": "/pages/me/index",
"iconPath": "../images/me.png",
"selectedIconPath": "../images/me-b.png",
"text": "我的",
"curr": 3
}
]
"pagePath": "/index/index",
"iconPath": "../images/home.png",
"selectedIconPath": "../images/home-b.png",
"text": "集团首页",
"curr": 1
}, {
"pagePath": "/index/index2",
"iconPath": "../images/cong.png",
"selectedIconPath": "../images/cong-b.png",
"text": "店铺首页",
"curr": 2
}, {
"pagePath": "/index/me",
"iconPath": "../images/me.png",
"selectedIconPath": "../images/me-b.png",
"text": "我的",
"curr": 3
}]
},
attached:function(){
attached() {
let userType = wx.getStorageSync('userrole_type');
if(userType==3){
this.setData({
curClick:2,
list:[
{
"pagePath": "/pages/home/index",
"pagePath": "/index/index2",
"iconPath": "../images/cong.png",
"selectedIconPath": "../images/cong-b.png",
"text": "工作台",
"curr": 2
},
{
"pagePath": "/pages/me/index",
"pagePath": "/index/me",
"iconPath": "../images/me.png",
"selectedIconPath": "../images/me-b.png",
"text": "我的",
......@@ -52,18 +47,15 @@ Component({
}
},
methods: {
NavChange(e) {
// 获取穿过来的参数
// let curIndex = e.currentTarget.dataset.cur;
// 获取穿过来的参数
let path = e.currentTarget.dataset.path;
// 更新data中值
switchTab(e) {
const data = e.currentTarget.dataset
const url = data.path
wx.switchTab({
url: path,
url
})
},
this.setData({
selected: data.index
})
}
}
})
\ No newline at end of file
<view class="tabbar_wrap">
<block>
<cover-view wx:for="{{list}}" wx:key="index" class="tabbar_item" bindtap="NavChange" data-cur="{{item.curr}}" data-path="{{item.pagePath}}">
<cover-image class="img" src="{{curClick==item.curr?item.selectedIconPath:item.iconPath}}"></cover-image>
<cover-view class="{{curClick==item.curr?'active text':'text'}}">
{{item.text}}
</cover-view>
</cover-view>
</block>
</view>
\ No newline at end of file
<!--miniprogram/custom-tab-bar/index.wxml-->
<view class="tab-bar">
<view class="tab-bar-border"></view>
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
<image src="{{curClick === item.curr ? item.selectedIconPath : item.iconPath}}"></image>
<view class="{{curClick === item.curr ? 'active text' : 'text'}}">{{item.text}}</view>
</view>
</view>
.tabbar_wrap {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
display: flex;
align-items: center;
background-color: #FFFFFF;
height: 110rpx;
border-top: 1px solid #CCc;
padding-bottom: env(safe-area-inset-bottom);
.tab-bar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 110rpx;
background: white;
display: flex;
flex-direction: row;
padding-bottom: env(safe-area-inset-bottom);
pointer-events: auto;
}
.tabbar_wrap .tabbar_item {
flex: 1;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.tab-bar-border {
background-color: rgba(0, 0, 0, 0.33);
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 1px;
transform: scaleY(0.5);
}
.tabbar_wrap .tabbar_item .img {
width: 45rpx;
height: 45rpx;
.tab-bar-item {
flex: 1;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.tabbar_wrap .tabbar_item .text {
font-size: 28rpx;
margin-top: 5rpx;
.tab-bar-item image {
width: 27px;
height: 27px;
}
.tabbar_wrap .tabbar_item .active {
color: #597BFF;
.tab-bar-item view {
font-size: 10px;
}
.tabbar_wrap .tabbar_item .addBtn {
width: 90rpx;
height: 90rpx;
padding: 10rpx;
background-color: #Ffffff;
border-radius: 100rpx;
position: absolute;
top: -40rpx;
.active.text {
color: #597BFF;
}
.tabbar_wrap .tabbar_item .subMsg {
.text {
font-size: 28rpx;
margin-top: 50rpx;
}
\ No newline at end of file
margin-top: 5rpx;
}
{
"usingComponents": {
"navbar": "/components/navbar/index",
"basic":"/components/echart/basic/index",
"van-calendar": "@vant/weapp/calendar/index",
"van-progress": "@vant/weapp/progress/index",
"van-button": "@vant/weapp/button/index",
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index"
},
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0268FF",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
"usingComponents": {
"navbar": "/components/navbar/index",
"basic":"/components/echart/basic/index",
"van-calendar": "@vant/weapp/calendar/index",
"van-progress": "@vant/weapp/progress/index",
"van-button": "@vant/weapp/button/index",
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index"
},
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0268FF",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
<view class="~backgroundColor">
<!-- 名称 -->
<view class="contianer_shop">
<image src="../../images/banner.png" class='images'></image>
<image src="../images/banner.png" class='images'></image>
<view class="shop_name">{{selectName}}</view>
<view class="shop_time">
<text>开业门店总数:254个</text>
......@@ -19,28 +19,28 @@
<text class="text_tltle {{types==5?'actives':'defaults'}}" bindtap="ClickTab" data-type='5'>自定义</text>
</view>
<view class="time_input">
<image src="../../images/rili.png" style="width:20px;height:20px;margin-right:20rpx"></image>
<image src="../images/rili.png" style="width:20px;height:20px;margin-right:20rpx"></image>
<text>{{currentTime}}</text>
</view>
<!-- 卡片 -->
<view class="card">
<view class="card_passage">
<image src="../../images/keliulaing.png" class="card_image"></image>
<image src="../images/keliulaing.png" class="card_image"></image>
<view class="cardName"> 路过客流量</view>
<view class="cardNum"> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/keliuliangyellow.png" class="card_image"></image>
<image src="../images/keliuliangyellow.png" class="card_image"></image>
<view class="cardName"> 客流量</view>
<view class="cardNum"> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/customer.png" class="card_image"></image>
<image src="../images/customer.png" class="card_image"></image>
<view class="cardName"> 顾客人数</view>
<view class="cardNum"> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/jindianlv.png" class="card_image"></image>
<image src="../images/jindianlv.png" class="card_image"></image>
<view class="cardName"> 进店率</view>
<view class="cardNum"> 35480</view>
</view>
......
/* pages/homes/index.wxss */
.container{
height: 100%;
}
.contianer_shop {
width: 100%;
height: 168rpx;
position: relative;
margin-top: 20rpx;
}
.images {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.shop_name {
padding: 30rpx 0 10rpx 28rpx;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 56rpx;
position: absolute;
}
.shop_time {
position: absolute;
top: 90rpx;
margin-left: 28rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.65);
}
.tab_tll {
padding: 0 10rpx;
width: 100%;
margin-top: 30rpx;
}
.tab_tll .text_tltle {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
margin-right: 30rpx;
}
.actives {
color: #000000;
border-bottom: 4px solid #447BFF;
}
.defaults {
color: rgba(0, 0, 0, 0.65);
}
.time_input {
margin-top: 30rpx;
width: 100%;
height: 80rpx;
background-color: rgba(131, 164, 255, 0.39);
border-radius: 40rpx;
display: flex;
align-items: center;
padding: 0 0 0 50rpx;
}
.card {
width: 100%;
margin-top: 30rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.card_passage {
width: 48%;
height: 148rpx;
position: relative;
padding: 20rpx 20rpx 0;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.cardName{
position: absolute;
font-size: 28rpx;
}
.cardNum{
position: absolute;
top: 65rpx;
}
.card>view:nth-child(n+3) {
margin-top: 30rpx;
}
.card_image {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 148rpx;
}
.keliuliang {
width: 100%;
padding: 20rpx;
border-radius: 20rpx;
background-color: #fff;
margin-top: 30rpx;
}
.keliuliang>text {
height: 44rpx;
line-height: 44rpx;
display: flex;
align-items: center;
}
.keliuliang>text::before {
content: '';
width: 6rpx;
height: 30rpx;
margin-right: 10rpx;
background: #5889FF;
border-radius: 3rpx;
}
.title_chart {
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
.stome_time {
margin-top: 20rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
}
.stome_time text {
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #5A95EC;
}
.indexList .desc_content {
padding: 0 !important;
border: 2rpx solid #DCDFE6;
border-radius: 100rpx;
}
.indexList .desc_info {
height: 50rpx;
margin-bottom: 10rpx;
border-radius: 100rpx;
}
.indexList .desc_info:nth-child(4) {
margin-right: 0 !important;
}
.indexList .desc_text {
margin-bottom: 8px;
font-size: 24rpx;
}
.indexList .desc_content_active {
padding: 0 !important;
/* border: 2rpx solid#447BFF; */
background-color: #447BFF;
border-radius: 100rpx;
}
.indexList .desc_text_active {
margin-bottom: 8px;
font-size: 25rpx;
color: #fff;
}
.van-hairline--surround::after {
border: none
}
.van-hairline--bottom::after,
.van-hairline--left::after,
.van-hairline--right::after,
.van-hairline--surround::after,
.van-hairline--top-bottom::after,
.van-hairline--top::after,
.van-hairline::after {
border: none !important
}
.list {
position: relative;
padding-top: 20rpx;
}
.list .item {
position: relative;
padding: 10rpx 0;
border-bottom: 1rpx solid #fafafa;
}
.list .item .info {
display: flex;
justify-content: space-between;
font-size: 24rpx;
}
.list .item .shopName {
color: rgba(0, 0, 0, 0.85);
}
.list .item .shopName .idx {
margin-right: 5rpx;
}
.list .item .progress {
padding: 10rpx 0rpx;
display: flex;
align-items: center;
}
.list .item .progress .bar {
width: 100%;
position: relative;
}
.list .item .num {
color: #4C83FF;
/* width:100rpx; */
text-align: right;
font-size: 28rpx;
font-weight: 900;
/* pages/homes/index.wxss */
.container{
height: 100%;
}
.contianer_shop {
width: 100%;
height: 168rpx;
position: relative;
margin-top: 20rpx;
}
.images {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.shop_name {
padding: 30rpx 0 10rpx 28rpx;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 56rpx;
position: absolute;
}
.shop_time {
position: absolute;
top: 90rpx;
margin-left: 28rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.65);
}
.tab_tll {
padding: 0 10rpx;
width: 100%;
margin-top: 30rpx;
}
.tab_tll .text_tltle {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
margin-right: 30rpx;
}
.actives {
color: #000000;
border-bottom: 4px solid #447BFF;
}
.defaults {
color: rgba(0, 0, 0, 0.65);
}
.time_input {
margin-top: 30rpx;
width: 100%;
height: 80rpx;
background-color: rgba(131, 164, 255, 0.39);
border-radius: 40rpx;
display: flex;
align-items: center;
padding: 0 0 0 50rpx;
}
.card {
width: 100%;
margin-top: 30rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.card_passage {
width: 48%;
height: 148rpx;
position: relative;
padding: 20rpx 20rpx 0;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.cardName{
position: absolute;
font-size: 28rpx;
}
.cardNum{
position: absolute;
top: 65rpx;
}
.card>view:nth-child(n+3) {
margin-top: 30rpx;
}
.card_image {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 148rpx;
}
.keliuliang {
width: 100%;
padding: 20rpx;
border-radius: 20rpx;
background-color: #fff;
margin-top: 30rpx;
}
.keliuliang>text {
height: 44rpx;
line-height: 44rpx;
display: flex;
align-items: center;
}
.keliuliang>text::before {
content: '';
width: 6rpx;
height: 30rpx;
margin-right: 10rpx;
background: #5889FF;
border-radius: 3rpx;
}
.title_chart {
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
.stome_time {
margin-top: 20rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
}
.stome_time text {
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #5A95EC;
}
.indexList .desc_content {
padding: 0 !important;
border: 2rpx solid #DCDFE6;
border-radius: 100rpx;
}
.indexList .desc_info {
height: 50rpx;
margin-bottom: 10rpx;
border-radius: 100rpx;
}
.indexList .desc_info:nth-child(4) {
margin-right: 0 !important;
}
.indexList .desc_text {
margin-bottom: 8px;
font-size: 24rpx;
}
.indexList .desc_content_active {
padding: 0 !important;
/* border: 2rpx solid#447BFF; */
background-color: #447BFF;
border-radius: 100rpx;
}
.indexList .desc_text_active {
margin-bottom: 8px;
font-size: 25rpx;
color: #fff;
}
.van-hairline--surround::after {
border: none
}
.van-hairline--bottom::after,
.van-hairline--left::after,
.van-hairline--right::after,
.van-hairline--surround::after,
.van-hairline--top-bottom::after,
.van-hairline--top::after,
.van-hairline::after {
border: none !important
}
.list {
position: relative;
padding-top: 20rpx;
}
.list .item {
position: relative;
padding: 10rpx 0;
border-bottom: 1rpx solid #fafafa;
}
.list .item .info {
display: flex;
justify-content: space-between;
font-size: 24rpx;
}
.list .item .shopName {
color: rgba(0, 0, 0, 0.85);
}
.list .item .shopName .idx {
margin-right: 5rpx;
}
.list .item .progress {
padding: 10rpx 0rpx;
display: flex;
align-items: center;
}
.list .item .progress .bar {
width: 100%;
position: relative;
}
.list .item .num {
color: #4C83FF;
/* width:100rpx; */
text-align: right;
font-size: 28rpx;
font-weight: 900;
}
\ No newline at end of file
Component({
pageLifetimes: {
show() {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
// 当前页面的 tabBar 索引
curClick: 2
})
}
}
}
})
{
"usingComponents": {}
}
\ No newline at end of file
<view class="intro">接口</view>
\ No newline at end of file
.intro {
margin: 30px;
text-align: center;
padding-top: 60px
}
\ No newline at end of file
// index/me.js
const App = getApp();
import basicApi from '../api/basic.js'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
navHeight: App.globalData.navHeight,
windowHeight: App.globalData.windowHeight,
accountName: '',
name: '',
menuItems: [{
name: '切换服务器地址',
icon: 'position',
}],
userForm: {},
rolesList: []
},
pageLifetimes: {
show() {
const name = wx.getStorageSync('name');
const accountName = wx.getStorageSync('accountName');
this.setData({
name: name,
accountName: accountName
})
this.getUserInfo()
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
// 当前页面的 tabBar 索引
curClick: 3
})
}
}
},
/**
* 组件的方法列表
*/
methods: {
All(e) {
console.log(e)
},
inputBlur(e) {
this.data.userForm.realName = e.detail
},
inputBlur2(e) {
this.data.userForm.tel = e.detail
},
inputBlur3(e) {
this.data.userForm.email = e.detail
},
getUserInfo() {
basicApi.singleUser(wx.getStorageSync('uid')).then(res => {
this.getRolePermission(res.data)
})
},
getRolePermission(resData) {
basicApi.getPermission(resData.unid).then(res => {
let roles = []
res.roles.forEach(item => {
roles.push(item.name)
})
resData.roles = roles.toString()
this.setData({
userForm: resData
})
})
},
onSubmit(e) {
basicApi.editUserInfo({
userId: this.data.userForm.id,
email: this.data.userForm.email,
loginName: this.data.userForm.loginName,
realName: this.data.userForm.realName,
tel: this.data.userForm.tel,
}).then(res => {
if (res.code == 200) {
wx.showToast({
title: '修改成功',
icon: 'success'
})
this.getUserInfo()
}
})
},
undatePwd() {
wx.navigateTo({
url: '/pages/editPwd/editPwd'
})
},
logout: () => {
wx.getStorageInfo({
success: (res) => {
res.keys.forEach(item => {
if (item !== 'name' && item !== 'password' && item !== 'requestUrl' && item !== 'baseUrl' && item !== 'deploymentType') {
wx.removeStorage({
key: item,
success: function (res) {}
})
}
})
}
})
wx.reLaunch({
url: '/pages/login/index'
})
},
goOtherPage: async function (e) {
const {
value
} = e.target.dataset
if (value.name === '切换服务器地址') {
await wx.setStorage({
data: 'success',
key: 'modalShow',
})
wx.getStorageInfo({
success: (res) => {
res.keys.forEach(item => {
if (item !== 'name' && item !== 'password' && item !== 'requestUrl' && item !== 'baseUrl' && item !== 'deploymentType' && item !== 'modalShow') {
wx.removeStorage({
key: item,
success: function (res) {}
})
}
})
}
})
wx.reLaunch({
url: '/pages/login/index'
})
}
}
}
})
\ No newline at end of file
{
"usingComponents": {
"navbar": "/components/navbar/index"
},
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0268FF",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
<view class="container" style="height:{{windowHeight}}px">
<navbar page-name="我的" bg-color="RGBA(213, 227, 255, 1)" navbar-color="#000">
</navbar>
<view class="~backgroundColor">
<view class="header">
<image src="../images/me/avatar.png" class="avatar" />
<view class="name">
<view class="username">{{name}}</view>
<view class="company">{{accountName}}</view>
</view>
</view>
<view class="zong-content">
<van-form>
<van-cell-group>
<van-field value="{{userForm.realName}}" class="vanField" name="姓名" label="姓名" label-class='label' input-class='input' placeholder="姓名" bind:change='inputBlur' right-icon="edit" right-icon-class='editClass' />
<van-field class="vanField" value="{{userForm.tel}}" name="电话号码" label-class='label' input-class='input' label="电话号码" placeholder="电话号码" bind:change='inputBlur2' right-icon="edit" right-icon-class='editClass' />
<van-field border="{{ false }}" class="vanField" value="{{userForm.email}}" name="邮箱" label-class='label' input-class='input' label="邮箱" placeholder="邮箱" bind:change='inputBlur3' right-icon="edit" right-icon-class='editClass' />
</van-cell-group>
</van-form>
</view>
<view class="items">
<view class="item" bindtap="undatePwd">
<text>修改密码</text>
<image src="../images/arrow-r.png" class="arrow" />
</view>
<view class="item logout" bindtap="logout">
<text>退出登录</text>
<image src="../images/arrow-r.png" class="arrow" />
</view>
</view>
<view class="btn">
<van-button color="#597BFF" round block type="primary" bindtap="onSubmit">提交</van-button>
</view>
</view>
</view>
\ No newline at end of file
/* pages/me/index.wxss */
.header {
width: 100%;
height: 224rpx;
background-color: #fff;
border-radius: 16rpx;
box-sizing: border-box;
margin-top: 30rpx;
padding: 12rpx 0rpx 0 50rpx;
display: flex;
align-items: center;
}
.header .avatar {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
margin-right: 32rpx;
}
.header .name {
font-family: PingFangSC-Medium, PingFang SC;
color: #000;
}
.header .username {
font-weight: 500;
font-size: 40rpx;
line-height: 40rpx;
margin-bottom: 12rpx;
}
.header .company {
box-sizing: border-box;
height: 40rpx;
line-height: 40rpx;
color: rgba(0, 0, 0, 0.55);
font-size: 28rpx;
}
.btn {
margin-top: 30rpx;
}
.zong-content {
padding: 10rpx 0;
width: 100%;
height: 324rpx;
margin-top: 24rpx;
border-radius: 16rpx;
background-color: #fff;
}
.label {
color: rgba(0, 0, 0, 0.9) !important;
font-size: 28rpx;
height: 66rpx;
line-height: 66rpx;
/* padding: 5px; */
}
.input {
color: rgba(0, 0, 0, 0.7) !important;
font-size: 28rpx;
}
.editClass{
color: #597BFF;
font-size: 32rpx !important;
font-weight: 600 !important;
right: 25rpx;
}
.vanField .van-field__body{
height: 66rpx;
line-height: 66rpx;
}
.items{
margin-top: 24rpx;
border-radius: 16rpx;
background-color: #fff;
padding: 5px 10rpx 5rpx 23rpx;
}
.items .item {
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
color: rgba(0,0,0,0.9);
font-size: 28rpx;
box-sizing: border-box;
padding: 0 23rpx 0 17rpx;
position: relative;
border-bottom: 1rpx solid #E1E1E1;
}
.items .logout{
border-width: 0;
}
.items .item .arrow {
position: absolute;
right: 38rpx;
color: rgba(0, 0, 0, .2);
width: 24rpx;
height: 24rpx;
}
\ No newline at end of file
......@@ -44,9 +44,11 @@ Page({
}
const modalShow = wx.getStorageSync('modalShow');
if (atoken) {
wx.reLaunch({
url: '/pages/index/index',
})
if(wx.getStorageSync('userrole_type')==3){
wx.reLaunch({ url: '/index/index2' })
}else{
wx.reLaunch({ url: '/index/index' })
}
} else {
if (!deploymentType || deploymentType === '') {
this.setData({ modalShow: true })
......@@ -132,9 +134,9 @@ Page({
//wx.setStorage({ data: datas, key: 'accountList' })
wx.setStorage({ data: datas[0].name, key: 'accountName' })
if(res.data.user.type==3){
wx.reLaunch({ url: '/pages/home/index' })
wx.reLaunch({ url: '/index/index2' })
}else{
wx.reLaunch({ url: '/pages/index/index' })
wx.reLaunch({ url: '/index/index' })
}
}
......
......@@ -11,11 +11,7 @@ Page({
{
name: '切换服务器地址',
icon: 'position',
},
// {
// name: '修改密码',
// icon: 'password'
// }
}
],
userForm:{},
rolesList:[]
......
<view class="container" style="padding-top: {{navHeight}}px;height:{{windowHeight}}px">
<navbar page-name="我的" bg-color="" navbar-color="#000">
<view class="container" style="height:{{windowHeight}}px">
<navbar page-name="我的" bg-color="RGBA(213, 227, 255, 1)" navbar-color="#000">
</navbar>
<view class="~backgroundColor">
<view class="header">
......
......@@ -5,7 +5,7 @@
background-color: #fff;
border-radius: 16rpx;
box-sizing: border-box;
margin-top: 40rpx;
margin-top: 30rpx;
padding: 12rpx 0rpx 0 50rpx;
display: flex;
align-items: center;
......
{
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": true,
"autoAudits": true,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": false,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false,
"useStaticServer": true,
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.14.4",
"appid": "wx220b5d2dbb82ce64",
"projectname": "miniProject",
"cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": [
{
"id": -1,
"name": "pages/accountHome/index",
"pathName": "pages/accountHome/index",
"scene": null
}
]
}
}
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": true,
"autoAudits": true,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": false,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false,
"useStaticServer": true,
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.14.4",
"appid": "wx220b5d2dbb82ce64",
"projectname": "miniProject",
"cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/accountHome/index",
"pathName": "pages/accountHome/index",
"query": "",
"scene": null
}
]
}
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!