Commit 8d97c3a1 by 匡雅琴

修改

1 parent 0a0f7170
module.exports = Behavior({ module.exports = Behavior({
data: { data: {
menuList: [ menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
{ // templateMethods: [{"tap": "selectIntroduce"}],
name: '企微魔方' curIntroduceIndex: 0
}, },
{
name: '数字化权益'
},
{
name: '智能线索'
},
{
name: 'D+增值转化'
}
]
}
})
\ No newline at end of file \ No newline at end of file
// selectIntroduce(e) {
// console.log(e.currentTarget);
// const curIntroduceIndex = e.currentTarget.dataset.index;
// this.setData({
// curIntroduceIndex: curIntroduceIndex,
// });
// },
// methods: {
// // 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
// },
});
...@@ -6,36 +6,39 @@ ...@@ -6,36 +6,39 @@
* @LastEditTime: 2022-09-02 13:48:49 * @LastEditTime: 2022-09-02 13:48:49
*/ */
// pages/tab/index/index.js // pages/tab/index/index.js
import { menuMixin } from "../../../mixins/index";
Page({ Page({
// behaviors: [menuMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tabList: [ tabList: [
{ {
name:'公司介绍', name: "公司介绍",
icon: 'icon-company', icon: "icon-company",
icon1: 'icon-company1' icon1: "icon-company1",
}, },
{ {
name:'方案介绍', name: "方案介绍",
icon: 'icon-product', icon: "icon-product",
icon1: 'icon-product1' icon1: "icon-product1",
}, },
{ {
name:'视频直播', name: "视频直播",
icon: 'icon-video', icon: "icon-video",
icon1: 'icon-video' icon1: "icon-video",
}, },
{ {
name:'合作申请', name: "合作申请",
icon: 'icon-cooperation', icon: "icon-cooperation",
icon1: 'icon-cooperation' icon1: "icon-cooperation",
}, },
], ],
menuList: ['企微魔方','数字化权益','智能线索','D+增值转化'], menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
curTabIndex: 0, curTabIndex: 0,
curIntroduceIndex: 0 curIntroduceIndex: 0,
templateMethods: [{"tap": "selectIntroduce"}],
}, },
// tab栏切换 // tab栏切换
...@@ -49,7 +52,7 @@ Page({ ...@@ -49,7 +52,7 @@ Page({
wx.$router.go("applicationPartener"); wx.$router.go("applicationPartener");
break; break;
case 2: case 2:
console.log('跳转直播') console.log("跳转直播");
break; break;
default: default:
this.setData({ this.setData({
...@@ -62,13 +65,12 @@ Page({ ...@@ -62,13 +65,12 @@ Page({
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化 // 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) { selectIntroduce(e) {
console.log(e.currentTarget); console.log(e.currentTarget);
const curIntroduceIndex = e.currentTarget.dataset.index const curIntroduceIndex = e.currentTarget.dataset.index;
this.setData({ this.setData({
curIntroduceIndex: curIntroduceIndex, curIntroduceIndex: curIntroduceIndex,
}); });
}, },
jump() { jump() {
wx.$router.go("applicationAccount"); wx.$router.go("applicationAccount");
}, },
...@@ -79,6 +81,7 @@ Page({ ...@@ -79,6 +81,7 @@ Page({
// setTimeout(() => { // setTimeout(() => {
// wx.$router.go('application') // wx.$router.go('application')
// }, 2e3) // }, 2e3)
console.log(this.data.menuMixin);
}, },
/** /**
......
...@@ -21,13 +21,10 @@ ...@@ -21,13 +21,10 @@
<template is="company"></template> <template is="company"></template>
</block> </block>
<!-- 方案介绍 --> <!-- 方案介绍 -->
<view class="menu-list" hidden="{{curTabIndex !== 1}}"> <import src="../../template/menu/menu.wxml" />
<block wx:for="{{menuList}}" wx:key="index"> <block wx:if="{{curTabIndex === 1 }}">
<view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}}" bindtap="selectIntroduce" data-index="{{index}}"> <template is="menu" data="{{menuList, curIntroduceIndex}}"></template>
{{item}} </block>
</view>
</block>
</view>
<!-- 服务咨询 --> <!-- 服务咨询 -->
<view> <view>
<image mode="widthFix" class="icon-consult" webp src="{{IMGURL}}home/custom.png"></image> <image mode="widthFix" class="icon-consult" webp src="{{IMGURL}}home/custom.png"></image>
......
...@@ -39,10 +39,10 @@ page { ...@@ -39,10 +39,10 @@ page {
.icon-hot { .icon-hot {
width: 56rpx; width: 56rpx;
height: 24rpx; height: 24rpx;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
} }
.tab-img { .tab-img {
...@@ -57,30 +57,10 @@ right: 0; ...@@ -57,30 +57,10 @@ right: 0;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
} }
/* 方案介绍 */
.menu-list { .icon-consult {
display: flex; width: 80rpx;
justify-content: space-evenly;
}
.menu-item {
position: relative;
font-size: 26rpx;
color: #6E6E7A;
height: 88rpx;
line-height: 88rpx;
}
.menu-active {
color: #5850ff;
}
.menu-active::after {
content: '';
display: inline-block;
position: absolute; position: absolute;
bottom: 0; right: 6rpx;
left: 50%; bottom: 76rpx;
transform: translateX(-50%);
width: 48rpx;
height: 6rpx;
background-color: #5850ff;
border-radius: 0.8rpx;
} }
\ No newline at end of file \ No newline at end of file
<template name="menu"> <template name="menu">
<view class="menu-list"> <view class="menu-list">
<block wx:for="{{menuList}}"> <block wx:for="{{menuList}}" wx:key="index">
<view class="menu-item">{{item.name}}</view> <view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}}" bindtap="selectIntroduce" data-index="{{index}}">
{{item}}
</view>
</block> </block>
</view> </view>
</template> </template>
\ No newline at end of file \ No newline at end of file
/* 方案介绍 */
.menu-list { .menu-list {
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!