Commit 3958072e by 匡雅琴

方案介绍tab栏切换

1 parent 8d97c3a1
module.exports = Behavior({
data: {
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
// menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
// templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex: 0
// curIntroduceIndex: 0
},
// selectIntroduce(e) {
// console.log(e.currentTarget);
......
......@@ -39,6 +39,8 @@ Page({
curTabIndex: 0,
curIntroduceIndex: 0,
templateMethods: [{"tap": "selectIntroduce"}],
// 0-员工,1-代理商
customerType: 0
},
// tab栏切换
......
......@@ -23,7 +23,7 @@
<!-- 方案介绍 -->
<import src="../../template/menu/menu.wxml" />
<block wx:if="{{curTabIndex === 1 }}">
<template is="menu" data="{{menuList, curIntroduceIndex}}"></template>
<template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType}}"></template>
</block>
<!-- 服务咨询 -->
<view>
......
<template name="menu">
<view class="menu-list">
<block wx:for="{{menuList}}" wx:key="index">
<view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}}" bindtap="selectIntroduce" data-index="{{index}}">
<view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}} {{customerType === 1 && index === curIntroduceIndex ? 'menu-active-agency' : ''}}" bindtap="selectIntroduce" data-index="{{index}}">
{{item}}
</view>
</block>
......
......@@ -11,7 +11,16 @@
}
.menu-active {
color: #5850ff;
font-weight: 500;
font-size: 28rpx;
}
.menu-active-agency {
font-weight: 600;
font-size: 32rpx;
color: #2D2D33;
}
.menu-active::after {
content: '';
display: inline-block;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!