Commit be373ece by 李君

自定义tabbar

1 parent 81e10957
{ {
"pages": [ "pages": [
"pages/login/index", "index/index",
"pages/tour/point/index", "index/index2",
"pages/tour/titem/index", "index/me",
"pages/homes/index", "pages/login/index",
"pages/tour/list/index", "pages/homes/index",
"pages/tour/gate/index", "pages/editPwd/editPwd",
"pages/tour/webview/index", "pages/shopSelect/index"
"pages/tour/index/index", ],
"pages/index/index", "window": {
"pages/me/index", "backgroundTextStyle": "light",
"pages/editPwd/editPwd", "navigationBarBackgroundColor": "#fff",
"pages/shopSelect/index", "navigationBarTitleText": "Weixin",
"pages/accountHome/index" "navigationBarTextStyle": "black",
], "navigationStyle": "custom"
"subPackages": [ },
{ "tabBar": {
"root": "pages/zong", "color": "#8181A5",
"name": "zong", "selectedColor": "#0069FF",
"pages": [ "borderStyle": "black",
"basic/index", "backgroundColor": "#ffffff",
"condition/index", "custom": true,
"contrast/index", "list": [{
"entry-rate/index", "pagePath": "index/index",
"holiday-comparison/index", "iconPath": "images/home.png",
"ranking/index", "selectedIconPath": "images/home-b.png",
"selectFollr/index", "text": "集团首页"
"selectGate/index", },
"selectMall/index", {
"selectZone/index", "pagePath": "index/index2",
"sequential/index", "iconPath": "images/cong.png",
"timeTravel/index" "selectedIconPath": "images/cong-b.png",
] "text": "店铺首页"
} },
], {
"window": { "pagePath": "index/me",
"backgroundTextStyle": "light", "iconPath": "images/me.png",
"navigationBarBackgroundColor": "#fff", "selectedIconPath": "images/me-b.png",
"navigationBarTitleText": "Weixin", "text": "我的"
"navigationBarTextStyle": "black", }
"navigationStyle": "custom" ]
}, },
"tabBar": { "useExtendedLib": {
"color": "#8181A5", "weui": true
"selectedColor": "#0069FF", },
"borderStyle": "black", "usingComponents": {
"backgroundColor": "#ffffff", "basic":"/components/echart/basic/index",
"custom": true, "navbar": "/components/navbar/index",
"list": [ "navbar2": "/components/navbar2/index",
{ "malllist": "/components/mallList/index",
"pagePath": "pages/accountHome/index", "van-icon": "@vant/weapp/icon/index",
"iconPath": "images/home.png", "arrow": "/components/arrow/index",
"selectedIconPath": "images/home-b.png", "van-tab": "@vant/weapp/tab/index",
"text": "集团首页" "van-tabs": "@vant/weapp/tabs/index",
}, "van-row": "@vant/weapp/row/index",
{ "van-col": "@vant/weapp/col/index",
"pagePath": "pages/homes/index", "van-cell": "@vant/weapp/cell/index",
"iconPath": "images/cong.png", "van-collapse": "@vant/weapp/collapse/index",
"selectedIconPath": "images/cong-b.png", "van-collapse-item": "@vant/weapp/collapse-item/index",
"text": "店铺首页" "van-empty": "@vant/weapp/empty/index",
}, "van-button": "@vant/weapp/button/index",
{ "van-divider": "@vant/weapp/divider/index",
"pagePath": "pages/me/index", "van-field": "@vant/weapp/field/index"
"iconPath": "images/me.png", },
"selectedIconPath": "images/me-b.png", "lazyCodeLoading": "requiredComponents",
"text": "我的" "sitemapLocation": "sitemap.json"
}
]
},
"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"
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,13 +4,14 @@ view { ...@@ -4,13 +4,14 @@ view {
box-sizing: border-box; box-sizing: border-box;
} }
page{ 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; --tabs-bottom-bar-color:#1972F5;
} }
.backgroundColor{ .backgroundColor{
padding: 0 28rpx; padding: 0 28rpx;
width: 100%; 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{ .van-picker__confirm{
color: #000!important; color: #000!important;
...@@ -22,7 +23,7 @@ page{ ...@@ -22,7 +23,7 @@ page{
.ellipsis{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;} .ellipsis{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.container { .container {
width: 100%; width: 100%;
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
......
Component({ Component({
/**
* 页面的初始数据
*/
data: { data: {
curClick: 1, // 判断当前点击的索引下标 curClick: 1,
color: "#7A7E83",
selectedColor: "#3cc51f",
list: [{ list: [{
"pagePath": "/pages/index/index", "pagePath": "/index/index",
"iconPath": "../images/home.png", "iconPath": "../images/home.png",
"selectedIconPath": "../images/home-b.png", "selectedIconPath": "../images/home-b.png",
"text": "首页", "text": "集团首页",
"curr": 1 "curr": 1
}, }, {
{ "pagePath": "/index/index2",
"pagePath": "/pages/home/index", "iconPath": "../images/cong.png",
"iconPath": "../images/cong.png", "selectedIconPath": "../images/cong-b.png",
"selectedIconPath": "../images/cong-b.png", "text": "店铺首页",
"text": "工作台", "curr": 2
"curr": 2 }, {
}, "pagePath": "/index/me",
{ "iconPath": "../images/me.png",
"pagePath": "/pages/me/index", "selectedIconPath": "../images/me-b.png",
"iconPath": "../images/me.png", "text": "我的",
"selectedIconPath": "../images/me-b.png", "curr": 3
"text": "我的", }]
"curr": 3
}
]
}, },
attached:function(){ attached() {
let userType = wx.getStorageSync('userrole_type'); let userType = wx.getStorageSync('userrole_type');
if(userType==3){ if(userType==3){
this.setData({ this.setData({
curClick:2, curClick:2,
list:[ list:[
{ {
"pagePath": "/pages/home/index", "pagePath": "/index/index2",
"iconPath": "../images/cong.png", "iconPath": "../images/cong.png",
"selectedIconPath": "../images/cong-b.png", "selectedIconPath": "../images/cong-b.png",
"text": "工作台", "text": "工作台",
"curr": 2 "curr": 2
}, },
{ {
"pagePath": "/pages/me/index", "pagePath": "/index/me",
"iconPath": "../images/me.png", "iconPath": "../images/me.png",
"selectedIconPath": "../images/me-b.png", "selectedIconPath": "../images/me-b.png",
"text": "我的", "text": "我的",
...@@ -52,18 +47,15 @@ Component({ ...@@ -52,18 +47,15 @@ Component({
} }
}, },
methods: { methods: {
NavChange(e) { switchTab(e) {
// 获取穿过来的参数 const data = e.currentTarget.dataset
// let curIndex = e.currentTarget.dataset.cur; const url = data.path
// 获取穿过来的参数
let path = e.currentTarget.dataset.path;
// 更新data中值
wx.switchTab({ wx.switchTab({
url: path, url
}) })
this.setData({
}, selected: data.index
})
}
} }
}) })
\ No newline at end of file \ 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 \ 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 { .tab-bar {
position: fixed; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
width: 100%; height: 110rpx;
display: flex; background: white;
align-items: center; display: flex;
background-color: #FFFFFF; flex-direction: row;
height: 110rpx; padding-bottom: env(safe-area-inset-bottom);
border-top: 1px solid #CCc; pointer-events: auto;
padding-bottom: env(safe-area-inset-bottom);
} }
.tabbar_wrap .tabbar_item { .tab-bar-border {
flex: 1; background-color: rgba(0, 0, 0, 0.33);
display: flex; position: absolute;
justify-content: center; left: 0;
flex-direction: column; top: 0;
align-items: center; width: 100%;
height: 1px;
transform: scaleY(0.5);
} }
.tabbar_wrap .tabbar_item .img { .tab-bar-item {
width: 45rpx; flex: 1;
height: 45rpx; text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
} }
.tabbar_wrap .tabbar_item .text { .tab-bar-item image {
font-size: 28rpx; width: 27px;
margin-top: 5rpx; height: 27px;
} }
.tabbar_wrap .tabbar_item .active { .tab-bar-item view {
color: #597BFF; font-size: 10px;
} }
.active.text {
.tabbar_wrap .tabbar_item .addBtn { color: #597BFF;
width: 90rpx;
height: 90rpx;
padding: 10rpx;
background-color: #Ffffff;
border-radius: 100rpx;
position: absolute;
top: -40rpx;
} }
.text {
.tabbar_wrap .tabbar_item .subMsg {
font-size: 28rpx; font-size: 28rpx;
margin-top: 50rpx;
}
\ No newline at end of file \ No newline at end of file
margin-top: 5rpx;
}
// pages/homes/index.js
const App = getApp();
import moment from 'moment'
import {
getMalls,
} from "../../api/login";
import { import {
getCardData, getCardData,
getTrendData, getTrendData,
getStopTimeData, getStopTimeData,
getAgeSexData, getAgeSexData,
getShopDetailData getShopDetailData
} from '../../api/shop' } from '../api/shop'
Page({ import moment from 'moment'
Component({
/** pageLifetimes: {
* 页面的初始数据 show() {
*/ setTimeout(() => {
data: { // console.log(8888)
navHeight: App.globalData.navHeight, this.setData({
windowHeight: App.globalData.windowHeight, chartData: this.getLineConfig(), //客流趋势分析数据
currentTime: moment().format("YYYY-MM-DD"), chartDatastop: this.getStopTimeConfig(),
types: 1, //选中的时间类型 selectName: wx.getStorageSync('accountName')
trendtypes: 1, //选中的业态趋势类型 })
chartData: {}, //客流趋势分析数据 }, 1000)
chartDatastop: {}, //停留时长统计 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
show: false, //显示日期自定义选择 this.getTabBar().setData({
minDate: new Date(2022, 0, 1).getTime(), //自定义时间的开始日期 // 当前页面的 tabBar 索引
maxDate: new Date(2022, 11, 31).getTime(), //自定义时间的结束日期 curClick:1
// maxDate: new Date(2025, 11, 31).getTime(), //自定义时间的结束日期 })
rankData: [{name:'我婆婆呃呃呃',value:2000,percentage:80},{name:'我婆婆呃呃呃',value:2000,percentage:80},{name:'我婆婆呃呃呃',value:2000,percentage:80}], }
indexVal:'PassengerFlow',
indexList: [{
name: '客流量',
val: 'PassengerFlow'
}, {
name: '过店人次',
val: 'Exposure'
}, {
name: '进店率',
val: 'IntoStoreRate'
}, {
name: '顾客人数',
val: 'CustomerNum'
},{
name: '平均停留时间',
val: 'AvgResidenceTime'
}, {
name: '深逛人数',
val: 'DeepShoppingNum'
}, {
name: '深逛率',
val: 'DeepShoppingRate'
}, {
name: '集客力',
val: 'PerAreaValue'
}],
},
onShow:function(){
this.activeTabBar(1)
},
activeTabBar(currentMenu) {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
// 当前页面的 tabBar 索引
curClick: currentMenu
})
}
},
// 关闭自定义日期选择
onClose() {
this.setData({
show: false
});
},
// 点击指标
clickIndex(event){
this.setData({
indexVal:event.target.dataset.val
});
},
// 点击自定义日期选择器的确定
onConfirm(event) {
const [start, end] = event.detail;
let startDate = moment(start).format("YYYY-MM-DD")
let endDate = moment(end).format("YYYY-MM-DD")
this.setData({
show: false,
currentTime: startDate + '至' + endDate
},()=>{
this.loadData()
});
},
// 点击时间选择类型触发
ClickTab(e) {
let dateType = e.target.dataset.type,
time
switch (dateType) {
case '1':
time = moment().format("YYYY-MM-DD")
break;
case '2':
time = moment().subtract(1, "days").format("YYYY-MM-DD")
break;
case '3':
time = moment().subtract(6, "days").format("YYYY-MM-DD") + '至' + moment().format("YYYY-MM-DD")
break;
case '4':
time = moment().subtract(29, "days").format("YYYY-MM-DD") + '至' + moment().format("YYYY-MM-DD")
break;
default:
this.setData({
show: true,
types: e.target.dataset.type,
})
break;
}
if (dateType != 5) {
this.setData({
types: e.target.dataset.type,
currentTime: time
},()=>{
this.loadData()
})
}
},
// 获取卡片数据
getCardList() {
// console.log(this.data.currentTime,this.data.selectId,this.data.selectName)
let startTime=this.data.currentTime,endTime=this.data.currentTime
if (this.data.currentTime.includes('至')) {
let timeArr=this.data.currentTime.split('至')
startTime=timeArr[0]
endTime=timeArr[1]
}
console.log(startTime,endTime)
getCardData().then(res => {})
},
// 获取业态客流趋势
getTrendList() {
getTrendData().then(res => {})
},
// 获取停留时长统计
getStopTimeList() {
getStopTimeData().then(res => {})
},
// 获取所有数据
loadData() {
this.getCardList()
this.getTrendList()
this.getStopTimeList()
},
//点击业态客流趋势top5中的tab触发
ClickPassageFlow(e) {
this.setData({
trendtypes: e.target.dataset.type
},()=>{
this.getTrendList()
})
},
// 返回趋势图配置项
getLineConfig(res) {
// let xasix = res.xaxis.data
// let legendList = res.series.map(item => item.name)
// let seriesList = res.series
// if (seriesList.length < 1) {
// return {
// title: {
// text: '暂无数据',
// x: 'center',
// y: 'center',
// textStyle: {
// fontSize: 16,
// fontWeight: 'normal',
// }
// }
// }
// }
return {
grid: {
top: 30,
right: 20,
bottom: 20,
left: 5,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: "line",
lineStyle: {
color: "#444",
},
},
formatter: function (params) {
let html = ''
params.forEach(item => {
html += item.axisValue + '\n' + item.seriesName + ': ' + item.value
})
return html
} }
}, },
xAxis: { data: {
axisLabel: { currentTime: moment().format("YYYY-MM-DD"),
color: '#8C8D95' types: 1, //选中的时间类型
}, trendtypes: 1, //选中的业态趋势类型
boundaryGap: false, chartData: {}, //客流趋势分析数据
axisTick: { chartDatastop: {}, //停留时长统计
show: true show: false, //显示日期自定义选择
minDate: new Date(2022, 0, 1).getTime(), //自定义时间的开始日期
maxDate: new Date(2022, 11, 31).getTime(), //自定义时间的结束日期
// maxDate: new Date(2025, 11, 31).getTime(), //自定义时间的结束日期
rankData: [{
name: '我婆婆呃呃呃',
value: 2000,
percentage: 80
}, {
name: '我婆婆呃呃呃',
value: 2000,
percentage: 80
}, {
name: '我婆婆呃呃呃',
value: 2000,
percentage: 80
}],
indexVal: 'PassengerFlow',
indexList: [{
name: '客流量',
val: 'PassengerFlow'
}, {
name: '过店人次',
val: 'Exposure'
}, {
name: '进店率',
val: 'IntoStoreRate'
}, {
name: '顾客人数',
val: 'CustomerNum'
}, {
name: '平均停留时间',
val: 'AvgResidenceTime'
}, {
name: '深逛人数',
val: 'DeepShoppingNum'
}, {
name: '深逛率',
val: 'DeepShoppingRate'
}, {
name: '集客力',
val: 'PerAreaValue'
}],
},
methods: {
// 关闭自定义日期选择
onClose() {
this.setData({
show: false
});
}, },
axisLine: { // 点击指标
lineStyle: { clickIndex(event) {
color: 'rgba(140,141,149,0.35)', this.setData({
width: 1 indexVal: event.target.dataset.val
} });
}, },
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] // 点击自定义日期选择器的确定
}, onConfirm(event) {
yAxis: { const [start, end] = event.detail;
type: 'value', let startDate = moment(start).format("YYYY-MM-DD")
axisLabel: { let endDate = moment(end).format("YYYY-MM-DD")
color: '#8C8D95', this.setData({
formatter: function (value, index) { show: false,
if (value >= 10000 && value < 1000000) { currentTime: startDate + '至' + endDate
value = value / 10000 + "万"; }, () => {
} else if (value >= 1000000) { this.loadData()
value = value / 1000000 + "百万"; });
}
return value;
},
}, },
axisTick: { // 点击时间选择类型触发
show: true, ClickTab(e) {
let dateType = e.target.dataset.type,
time
switch (dateType) {
case '1':
time = moment().format("YYYY-MM-DD")
break;
case '2':
time = moment().subtract(1, "days").format("YYYY-MM-DD")
break;
case '3':
time = moment().subtract(6, "days").format("YYYY-MM-DD") + '至' + moment().format("YYYY-MM-DD")
break;
case '4':
time = moment().subtract(29, "days").format("YYYY-MM-DD") + '至' + moment().format("YYYY-MM-DD")
break;
}, default:
axisLine: { this.setData({
show: false, show: true,
types: e.target.dataset.type,
})
break;
}
if (dateType != 5) {
this.setData({
types: e.target.dataset.type,
currentTime: time
}, () => {
this.loadData()
})
}
}, },
splitLine: { // 获取卡片数据
show: false getCardList() {
} // console.log(this.data.currentTime,this.data.selectId,this.data.selectName)
}, let startTime = this.data.currentTime,
color: ['#FD8C5E', '#6FD3FF', '#BC7FF8', '#4F75FF', '#FF9AC1'], endTime = this.data.currentTime
// series:seriesList.map(item=>({...item,symbol: 'none',smooth: true,})) if (this.data.currentTime.includes('至')) {
series: [{ let timeArr = this.data.currentTime.split('至')
name: '客流量', startTime = timeArr[0]
smooth: true, endTime = timeArr[1]
lineStyle: { }
color: '#34BFFF' console.log(startTime, endTime)
}, getCardData().then(res => {})
areaStyle: {
// 区域颜色
color: {
type: 'linear',
x: 0, //右
y: 0, //下
x2: 0, //左
y2: 1, //上
colorStops: [{
offset: 0.1,
color: '#EAF3FF' // 0% 处的颜色
},
{
offset: 1,
color: '#FFFFFF' // 100% 处的颜色
}
]
},
},
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
symbol: "none",
showSymbol: false,
symbolSize: 20,
}]
}
},
// 返回停留时长配置
getStopTimeConfig(confingData) {
let data_sample = [
["type", "停留时长", ''],
["进样", 50, 200],
["离心", 10, 200],
["去盖", 30, 200],
["侧轨", 15, 200],
["侧轨1", 15, 200],
["侧轨2", 15, 200],
["侧轨3", 15, 200],
["出样", 18, 200]
];
// let data_sample = [];
// confingData.xaxis.data.forEach((item, i) => {
// let arr = [];
// arr[0] = item;
// arr[1] = confingData.series[0].data[i];
// arr[2] = 100;
// data_sample.push(arr);
// });
// data_sample.unshift(["type", confingData.title, ""]);
return {
color: ["#33CCFF", "#CCEEFF"],
legend: {
show: false
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
top: "10px",
containLabel: true
},
xAxis: {
type: "value",
// boundaryGap: [0, 0.01],
axisLine: {
show: false
},
splitLine: {
show: false
}, },
axisTick: { // 获取业态客流趋势
show: false getTrendList() {
getTrendData().then(res => {})
}, },
axisLabel: { // 获取停留时长统计
show: false getStopTimeList() {
} getStopTimeData().then(res => {})
},
yAxis: {
type: "category",
inverse: true,
axisLine: {
show: false
}, },
splitLine: { // 获取所有数据
show: false loadData() {
this.getCardList()
this.getTrendList()
this.getStopTimeList()
}, },
axisTick: { //点击业态客流趋势top5中的tab触发
show: false ClickPassageFlow(e) {
} this.setData({
}, trendtypes: e.target.dataset.type
dataset: { }, () => {
source: data_sample this.getTrendList()
}, })
series: [{
name: "停留时长",
type: "bar",
barWidth: "40%",
label: {
show: true,
formatter: function (params) {
return params.data[1] + "%";
},
position: ["102%", "0%"]
},
itemStyle: {
color: "#679BFF"
},
z: 3 //让实时在总计上面
}, },
{ // 返回趋势图配置项
name: "", getLineConfig(res) {
type: "bar", // let xasix = res.xaxis.data
barWidth: "40%", // let legendList = res.series.map(item => item.name)
itemStyle: { // let seriesList = res.series
color: "#F5F7F9" // if (seriesList.length < 1) {
}, // return {
barGap: "-100%" // title: {
} // text: '暂无数据',
] // x: 'center',
}; // y: 'center',
// textStyle: {
}, // fontSize: 16,
/** // fontWeight: 'normal',
* 生命周期函数--监听页面加载 // }
*/ // }
onLoad: function (options) { // }
// }
}, return {
grid: {
/** top: 30,
* 生命周期函数--监听页面初次渲染完成 right: 20,
*/ bottom: 20,
onReady: function () { left: 5,
// getMalls({ containLabel: true
// url: '/report/malls', },
// accountId: wx.getStorageSync('accountId') tooltip: {
// }).then((res) => { trigger: 'axis',
// this.setData({ axisPointer: {
// shopList: res.data, type: "line",
// selectName: res.data[0] && res.data[0].name, lineStyle: {
// selectId: res.data[0] && res.data[0].id, color: "#444",
// columnsListName: res.data && res.data.map(item => item.name) },
// }, () => { },
// wx.setStorageSync('shopName', res.data[0] && res.data[0].name) formatter: function (params) {
// this.loadData() let html = ''
// }) params.forEach(item => {
// }) html += item.axisValue + '\n' + item.seriesName + ': ' + item.value
}, })
return html
/** }
* 生命周期函数--监听页面显示 },
*/ xAxis: {
onShow: function () { axisLabel: {
setTimeout(() => { color: '#8C8D95'
// console.log(8888) },
this.setData({ boundaryGap: false,
chartData:this.getLineConfig() , //客流趋势分析数据 axisTick: {
chartDatastop: this.getStopTimeConfig(), show: true
selectName:wx.getStorageSync('accountName') },
}) axisLine: {
}, 2000) lineStyle: {
// if (wx.getStorageSync('shopName')&&this.data.shopList.length>0) { color: 'rgba(140,141,149,0.35)',
// let selectId = this.data.shopList.find(item => item.name == wx.getStorageSync('shopName')).id width: 1
// this.setData({ }
// selectName: wx.getStorageSync('shopName'), },
// selectId data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
// }, () => { },
// this.loadData() yAxis: {
// }) type: 'value',
axisLabel: {
color: '#8C8D95',
formatter: function (value, index) {
if (value >= 10000 && value < 1000000) {
value = value / 10000 + "万";
} else if (value >= 1000000) {
value = value / 1000000 + "百万";
}
return value;
},
},
axisTick: {
show: true,
// } },
}, axisLine: {
show: false,
/** },
* 生命周期函数--监听页面隐藏 splitLine: {
*/ show: false
onHide: function () { }
},
}, color: ['#FD8C5E', '#6FD3FF', '#BC7FF8', '#4F75FF', '#FF9AC1'],
// series:seriesList.map(item=>({...item,symbol: 'none',smooth: true,}))
/** series: [{
* 生命周期函数--监听页面卸载 name: '客流量',
*/ smooth: true,
onUnload: function () { lineStyle: {
}, color: '#34BFFF'
},
/** areaStyle: {
* 页面相关事件处理函数--监听用户下拉动作 // 区域颜色
*/ color: {
onPullDownRefresh: function () { type: 'linear',
x: 0, //右
}, y: 0, //下
x2: 0, //左
/** y2: 1, //上
* 页面上拉触底事件的处理函数 colorStops: [{
*/ offset: 0.1,
onReachBottom: function () { color: '#EAF3FF' // 0% 处的颜色
},
}, {
offset: 1,
/** color: '#FFFFFF' // 100% 处的颜色
* 用户点击右上角分享 }
*/ ]
onShareAppMessage: function () { },
},
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
symbol: "none",
showSymbol: false,
symbolSize: 20,
}]
}
},
// 返回停留时长配置
getStopTimeConfig(confingData) {
let data_sample = [
["type", "停留时长", ''],
["进样", 50, 200],
["离心", 10, 200],
["去盖", 30, 200],
["侧轨", 15, 200],
["侧轨1", 15, 200],
["侧轨2", 15, 200],
["侧轨3", 15, 200],
["出样", 18, 200]
];
// let data_sample = [];
// confingData.xaxis.data.forEach((item, i) => {
// let arr = [];
// arr[0] = item;
// arr[1] = confingData.series[0].data[i];
// arr[2] = 100;
// data_sample.push(arr);
// });
// data_sample.unshift(["type", confingData.title, ""]);
return {
color: ["#33CCFF", "#CCEEFF"],
legend: {
show: false
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
top: "10px",
containLabel: true
},
xAxis: {
type: "value",
// boundaryGap: [0, 0.01],
axisLine: {
show: false
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
}
},
yAxis: {
type: "category",
inverse: true,
axisLine: {
show: false
},
splitLine: {
show: false
},
axisTick: {
show: false
}
},
dataset: {
source: data_sample
},
series: [{
name: "停留时长",
type: "bar",
barWidth: "40%",
label: {
show: true,
formatter: function (params) {
return params.data[1] + "%";
},
position: ["102%", "0%"]
},
itemStyle: {
color: "#679BFF"
},
z: 3 //让实时在总计上面
},
{
name: "",
type: "bar",
barWidth: "40%",
itemStyle: {
color: "#F5F7F9"
},
barGap: "-100%"
}
]
};
} },
}
}) })
\ No newline at end of file \ 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 \ 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 \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="~backgroundColor"> <view class="~backgroundColor">
<!-- 名称 --> <!-- 名称 -->
<view class="contianer_shop"> <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_name">{{selectName}}</view>
<view class="shop_time"> <view class="shop_time">
<text>开业门店总数:254个</text> <text>开业门店总数:254个</text>
...@@ -19,28 +19,28 @@ ...@@ -19,28 +19,28 @@
<text class="text_tltle {{types==5?'actives':'defaults'}}" bindtap="ClickTab" data-type='5'>自定义</text> <text class="text_tltle {{types==5?'actives':'defaults'}}" bindtap="ClickTab" data-type='5'>自定义</text>
</view> </view>
<view class="time_input"> <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> <text>{{currentTime}}</text>
</view> </view>
<!-- 卡片 --> <!-- 卡片 -->
<view class="card"> <view class="card">
<view class="card_passage"> <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="cardName"> 路过客流量</view>
<view class="cardNum"> 35480</view> <view class="cardNum"> 35480</view>
</view> </view>
<view class="card_passage"> <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="cardName"> 客流量</view>
<view class="cardNum"> 35480</view> <view class="cardNum"> 35480</view>
</view> </view>
<view class="card_passage"> <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="cardName"> 顾客人数</view>
<view class="cardNum"> 35480</view> <view class="cardNum"> 35480</view>
</view> </view>
<view class="card_passage"> <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="cardName"> 进店率</view>
<view class="cardNum"> 35480</view> <view class="cardNum"> 35480</view>
</view> </view>
......
/* pages/homes/index.wxss */ /* pages/homes/index.wxss */
.container{ .container{
height: 100%; height: 100%;
} }
.contianer_shop { .contianer_shop {
width: 100%; width: 100%;
height: 168rpx; height: 168rpx;
position: relative; position: relative;
margin-top: 20rpx; margin-top: 20rpx;
} }
.images { .images {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.shop_name { .shop_name {
padding: 30rpx 0 10rpx 28rpx; padding: 30rpx 0 10rpx 28rpx;
font-size: 40rpx; font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
line-height: 56rpx; line-height: 56rpx;
position: absolute; position: absolute;
} }
.shop_time { .shop_time {
position: absolute; position: absolute;
top: 90rpx; top: 90rpx;
margin-left: 28rpx; margin-left: 28rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 0.65); color: rgba(255, 255, 255, 0.65);
} }
.tab_tll { .tab_tll {
padding: 0 10rpx; padding: 0 10rpx;
width: 100%; width: 100%;
margin-top: 30rpx; margin-top: 30rpx;
} }
.tab_tll .text_tltle { .tab_tll .text_tltle {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
margin-right: 30rpx; margin-right: 30rpx;
} }
.actives { .actives {
color: #000000; color: #000000;
border-bottom: 4px solid #447BFF; border-bottom: 4px solid #447BFF;
} }
.defaults { .defaults {
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
} }
.time_input { .time_input {
margin-top: 30rpx; margin-top: 30rpx;
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
background-color: rgba(131, 164, 255, 0.39); background-color: rgba(131, 164, 255, 0.39);
border-radius: 40rpx; border-radius: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 0 0 50rpx; padding: 0 0 0 50rpx;
} }
.card { .card {
width: 100%; width: 100%;
margin-top: 30rpx; margin-top: 30rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
} }
.card_passage { .card_passage {
width: 48%; width: 48%;
height: 148rpx; height: 148rpx;
position: relative; position: relative;
padding: 20rpx 20rpx 0; padding: 20rpx 20rpx 0;
font-size: 40rpx; font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
} }
.cardName{ .cardName{
position: absolute; position: absolute;
font-size: 28rpx; font-size: 28rpx;
} }
.cardNum{ .cardNum{
position: absolute; position: absolute;
top: 65rpx; top: 65rpx;
} }
.card>view:nth-child(n+3) { .card>view:nth-child(n+3) {
margin-top: 30rpx; margin-top: 30rpx;
} }
.card_image { .card_image {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 148rpx; height: 148rpx;
} }
.keliuliang { .keliuliang {
width: 100%; width: 100%;
padding: 20rpx; padding: 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
background-color: #fff; background-color: #fff;
margin-top: 30rpx; margin-top: 30rpx;
} }
.keliuliang>text { .keliuliang>text {
height: 44rpx; height: 44rpx;
line-height: 44rpx; line-height: 44rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.keliuliang>text::before { .keliuliang>text::before {
content: ''; content: '';
width: 6rpx; width: 6rpx;
height: 30rpx; height: 30rpx;
margin-right: 10rpx; margin-right: 10rpx;
background: #5889FF; background: #5889FF;
border-radius: 3rpx; border-radius: 3rpx;
} }
.title_chart { .title_chart {
font-size: 32rpx; font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
.stome_time { .stome_time {
margin-top: 20rpx; margin-top: 20rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
} }
.stome_time text { .stome_time text {
font-size: 30rpx; font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #5A95EC; color: #5A95EC;
} }
.indexList .desc_content { .indexList .desc_content {
padding: 0 !important; padding: 0 !important;
border: 2rpx solid #DCDFE6; border: 2rpx solid #DCDFE6;
border-radius: 100rpx; border-radius: 100rpx;
} }
.indexList .desc_info { .indexList .desc_info {
height: 50rpx; height: 50rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
border-radius: 100rpx; border-radius: 100rpx;
} }
.indexList .desc_info:nth-child(4) { .indexList .desc_info:nth-child(4) {
margin-right: 0 !important; margin-right: 0 !important;
} }
.indexList .desc_text { .indexList .desc_text {
margin-bottom: 8px; margin-bottom: 8px;
font-size: 24rpx; font-size: 24rpx;
} }
.indexList .desc_content_active { .indexList .desc_content_active {
padding: 0 !important; padding: 0 !important;
/* border: 2rpx solid#447BFF; */ /* border: 2rpx solid#447BFF; */
background-color: #447BFF; background-color: #447BFF;
border-radius: 100rpx; border-radius: 100rpx;
} }
.indexList .desc_text_active { .indexList .desc_text_active {
margin-bottom: 8px; margin-bottom: 8px;
font-size: 25rpx; font-size: 25rpx;
color: #fff; color: #fff;
} }
.van-hairline--surround::after { .van-hairline--surround::after {
border: none border: none
} }
.van-hairline--bottom::after, .van-hairline--bottom::after,
.van-hairline--left::after, .van-hairline--left::after,
.van-hairline--right::after, .van-hairline--right::after,
.van-hairline--surround::after, .van-hairline--surround::after,
.van-hairline--top-bottom::after, .van-hairline--top-bottom::after,
.van-hairline--top::after, .van-hairline--top::after,
.van-hairline::after { .van-hairline::after {
border: none !important border: none !important
} }
.list { .list {
position: relative; position: relative;
padding-top: 20rpx; padding-top: 20rpx;
} }
.list .item { .list .item {
position: relative; position: relative;
padding: 10rpx 0; padding: 10rpx 0;
border-bottom: 1rpx solid #fafafa; border-bottom: 1rpx solid #fafafa;
} }
.list .item .info { .list .item .info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
} }
.list .item .shopName { .list .item .shopName {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
.list .item .shopName .idx { .list .item .shopName .idx {
margin-right: 5rpx; margin-right: 5rpx;
} }
.list .item .progress { .list .item .progress {
padding: 10rpx 0rpx; padding: 10rpx 0rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.list .item .progress .bar { .list .item .progress .bar {
width: 100%; width: 100%;
position: relative; position: relative;
} }
.list .item .num { .list .item .num {
color: #4C83FF; color: #4C83FF;
/* width:100rpx; */ /* width:100rpx; */
text-align: right; text-align: right;
font-size: 28rpx; font-size: 28rpx;
font-weight: 900; font-weight: 900;
} }
\ No newline at end of file \ 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 \ No newline at end of file
<view class="intro">接口</view>
\ No newline at end of file \ No newline at end of file
.intro {
margin: 30px;
text-align: center;
padding-top: 60px
}
\ No newline at end of file \ 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 \ No newline at end of file
{
"usingComponents": {
"navbar": "/components/navbar/index"
},
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0268FF",
"navigationBarTextStyle": "white"
}
\ No newline at end of file \ 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 \ 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 \ No newline at end of file
...@@ -44,9 +44,11 @@ Page({ ...@@ -44,9 +44,11 @@ Page({
} }
const modalShow = wx.getStorageSync('modalShow'); const modalShow = wx.getStorageSync('modalShow');
if (atoken) { if (atoken) {
wx.reLaunch({ if(wx.getStorageSync('userrole_type')==3){
url: '/pages/index/index', wx.reLaunch({ url: '/index/index2' })
}) }else{
wx.reLaunch({ url: '/index/index' })
}
} else { } else {
if (!deploymentType || deploymentType === '') { if (!deploymentType || deploymentType === '') {
this.setData({ modalShow: true }) this.setData({ modalShow: true })
...@@ -132,9 +134,9 @@ Page({ ...@@ -132,9 +134,9 @@ Page({
//wx.setStorage({ data: datas, key: 'accountList' }) //wx.setStorage({ data: datas, key: 'accountList' })
wx.setStorage({ data: datas[0].name, key: 'accountName' }) wx.setStorage({ data: datas[0].name, key: 'accountName' })
if(res.data.user.type==3){ if(res.data.user.type==3){
wx.reLaunch({ url: '/pages/home/index' }) wx.reLaunch({ url: '/index/index2' })
}else{ }else{
wx.reLaunch({ url: '/pages/index/index' }) wx.reLaunch({ url: '/index/index' })
} }
} }
......
...@@ -11,11 +11,7 @@ Page({ ...@@ -11,11 +11,7 @@ Page({
{ {
name: '切换服务器地址', name: '切换服务器地址',
icon: 'position', icon: 'position',
}, }
// {
// name: '修改密码',
// icon: 'password'
// }
], ],
userForm:{}, userForm:{},
rolesList:[] rolesList:[]
......
<view class="container" style="padding-top: {{navHeight}}px;height:{{windowHeight}}px"> <view class="container" style="height:{{windowHeight}}px">
<navbar page-name="我的" bg-color="" navbar-color="#000"> <navbar page-name="我的" bg-color="RGBA(213, 227, 255, 1)" navbar-color="#000">
</navbar> </navbar>
<view class="~backgroundColor"> <view class="~backgroundColor">
<view class="header"> <view class="header">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
box-sizing: border-box; box-sizing: border-box;
margin-top: 40rpx; margin-top: 30rpx;
padding: 12rpx 0rpx 0 50rpx; padding: 12rpx 0rpx 0 50rpx;
display: flex; display: flex;
align-items: center; align-items: center;
......
{ {
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": { "packOptions": {
"ignore": [], "ignore": [],
"include": [] "include": []
}, },
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": true, "es6": true,
"enhance": true, "enhance": true,
"postcss": true, "postcss": true,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": true, "minified": true,
"newFeature": false, "newFeature": false,
"coverView": true, "coverView": true,
"nodeModules": true, "nodeModules": true,
"autoAudits": true, "autoAudits": true,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false, "uglifyFileName": false,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"useIsolateContext": false, "useIsolateContext": false,
"useCompilerModule": false, "useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false, "userConfirmedUseCompilerModuleSwitch": false,
"lazyloadPlaceholderEnable": false, "lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true, "useApiHook": true,
"useApiHostProcess": true, "useApiHostProcess": true,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true, "minifyWXSS": true,
"disableUseStrict": false, "disableUseStrict": false,
"minifyWXML": true, "minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"ignoreDevUnusedFiles": false, "ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false, "ignoreUploadUnusedFiles": false,
"useStaticServer": true, "useStaticServer": true,
"condition": false "condition": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.14.4", "libVersion": "2.14.4",
"appid": "wx220b5d2dbb82ce64", "appid": "wx220b5d2dbb82ce64",
"projectname": "miniProject", "projectname": "miniProject",
"cloudfunctionTemplateRoot": "cloudfunctionTemplate/", "cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
"editorSetting": { "editorSetting": {
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
"tabSize": 4 "tabSize": 4
}, },
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {
"search": { "miniprogram": {
"current": -1, "list": [
"list": [] {
}, "name": "pages/accountHome/index",
"conversation": { "pathName": "pages/accountHome/index",
"current": -1, "query": "",
"list": [] "scene": null
}, }
"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
}
]
}
}
} }
\ No newline at end of file \ 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!