添加首页统计跳转页面
This commit is contained in:
@@ -42,6 +42,13 @@ Page({
|
||||
block: [] as any[],
|
||||
authInfo: {} as any,
|
||||
menuList: [] as any,
|
||||
blockUrls: {
|
||||
今日销售订单: '/pages/orders/ordersList/ordersList?type=today',
|
||||
今日请购订单: '/pages/purchase/requestOrder/requestOrder?type=today',
|
||||
今日采购订单: '/pages/purchase/buyOrder/buyOrder?type=today',
|
||||
今日采购入库: '/pages/purchase/buyInOrder/buyInOrder?type=today',
|
||||
今日原料出库单: '/pages/other/outbound/outbound?type=today',
|
||||
} as any,
|
||||
},
|
||||
handleLogin(e: any) {
|
||||
this.setData({ isLogin: e.detail });
|
||||
@@ -49,7 +56,6 @@ Page({
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
init() {
|
||||
this.data.authInfo = {};
|
||||
const companyInfo = toObject(wx.getStorageSync('company_info'));
|
||||
@@ -85,6 +91,14 @@ Page({
|
||||
this.setData({ block });
|
||||
});
|
||||
},
|
||||
onBlockNavTo(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const item = this.data.block[data.index];
|
||||
const url = this.data.blockUrls[item.name];
|
||||
if (url) {
|
||||
wx.navigateTo({ url });
|
||||
}
|
||||
},
|
||||
nav(e: any) {
|
||||
const data = getDataSet(e);
|
||||
wx.navigateTo({ url: data.url });
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
bind:handleLogin="handleLogin" hasTabBar="1">
|
||||
<view class="block-box">
|
||||
<block wx:for="{{block}}" wx:key="index">
|
||||
<view class="block-item-box" style="background: {{BGColors[index]}};">
|
||||
<view class="block-item-box" style="background: {{BGColors[index]}};" bind:tap="onBlockNavTo"
|
||||
data-index="{{index}}">
|
||||
<view class="block-item-name">{{item.name}}</view>
|
||||
<view class="block-item-value">
|
||||
<text>{{item.value}}</text>
|
||||
@@ -15,8 +16,9 @@
|
||||
<view class="menu-box">
|
||||
<view class="menu-title">
|
||||
<t-icon name="{{ item.icon }}"
|
||||
style="color: {{item.iconColor}};font-size: 1.2em;margin-right: 8rpx;" />
|
||||
<text style="font-weight: bold;font-size: 1.1em;">{{ item.title }}</text>
|
||||
style="color: {{item.iconColor}};font-size: 1.2em;margin-right: 16rpx;" />
|
||||
<text
|
||||
style="font-weight: bold;font-size: 1.1em;color: {{item.iconColor}}">{{ item.title }}</text>
|
||||
</view>
|
||||
<view class="menu-children-box">
|
||||
<block wx:for="{{ item.children }}" wx:key="index" wx:for-item="child">
|
||||
|
||||
Reference in New Issue
Block a user