Commit 8d97c3a1 by 匡雅琴

修改

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