Commit 00324d76 by 张立顺

初始化页面

1 parent 9a19d709
// components/Tab/Tab.js
// behaviors: [LocationBehavior],
import { imgUrlMixin } from '~/mixins/index'
Component({
behaviors: [imgUrlMixin],
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
outClassName:String,
tab: Array,
openScroll: Boolean,
tabHeight: {
type: Boolean,
value: false
},
productHeight: {
type: Boolean,
value: false
},
index: {
type: Number,
observer: function (n) {
this.setData({
count: n,
to: `to-${n}`
})
}
},
itemWidth: String,
align: {
type: String,
value: ''
},
// 是否有红点
unreadClueCount: {
type: Number,
value: 0
},
},
/**
* 组件的初始数据
*/
data: {
count: 0,
to: ''
},
// lifetimes:{
// attached: function() {
// console.log('unreadClueCount',this.data.unreadClueCount)
// }
// },
/**
* 组件的方法列表
*/
methods: {
click(e) {
let { count } = e.currentTarget.dataset
this.setData({
count,
to: `to-${count}`,
unreadClueCount:0
})
this.triggerEvent('click', count)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<wxs src="./Tab.wxs" module="filterUtils" />
<block wx:if="{{openScroll}}">
<scroll-view class="tab-box {{align}} {{outClassName}}" style="{{productHeight ? 'height: 72rpx;' : ''}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}">
<view class="text" style="{{productHeight ? 'height: 60rpx;' : ''}}">{{item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line" style="{{productHeight ? 'height: 4rpx;' : ''}}" />
</view>
</block>
</scroll-view>
</block>
<block wx:else>
<view class="tab-box flex" style="{{tabHeight ? 'height: 60rpx;' : ''}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" style="width:{{item.width}}; {{index == 0 ? 'margin-left: 32rpx;' : ''}}" bindtap="click" data-count="{{index}}">
<view class="text text-center" style="{{tabHeight ? 'height: 60rpx;' : ''}}">{{item.label}}</view>
<view class="line" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" />
<!-- -->
<!-- <view wx:if="{{filterUtils.hasRedpoint(unreadClueCount)}}" class="redpoint" /> -->
</view>
</block>
</view>
</block>
\ No newline at end of file \ No newline at end of file
var hasRedpoint = function (unreadClueCount) {
// console.log('unreadClueCount: ', unreadClueCount);
if(unreadClueCount>0){
return true
}else{
return false;
}
};
module.exports = {
hasRedpoint: hasRedpoint,
};
/* components/Tab/Tab.wxss */
.tab-box {
display: flex;
/* display: grid; */
width: 100%;
height: 92rpx;
box-sizing: border-box;
}
.tab-box.left {
padding-left: 32rpx;
}
.left .tab {
padding-right: 40rpx;
}
/* .flex .tab {
flex: 1;
} */
.tab {
position: relative;
flex-shrink: 0;
}
.tab .text {
height: 84rpx;
display: flex;
align-items: center;
box-sizing: border-box;
justify-content: center;
font-weight: 400;
font-size: 34rpx;
color: #636465;
}
.left .text {
justify-content: flex-start;
}
.flex .tab .text {
padding: 0;
}
.tab + .tab{
margin-left: 20rpx;
}
.tab.active .text {
/* font-weight: 500; */
font-weight: 600;
transition: all .25s;
font-size: 34rpx;
color: #323436;
/* font-size: 38rpx; */
/* color: #2C2C2C; */
font-family: PingFangSC-S0pxibold;
}
.tab .line {
width: 48rpx;
height: var(--borderRadius);
background: var(--btnColor);
border-radius: 2rpx;
margin: 0 auto;
transform: scale(0);
transition: all .25s;
}
.tab.active .line {
transform: scale(1);
}
.tab-box::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.active .redpoint {
display: none;
}
.redpoint {
position: absolute;
top: 10px;
right: 5px;
/* top: 8px;
right: 10px; */
width: 10px;
height: 10px;
background: #EB4E4E;
border-radius: 50%;
}
/* 外部出进来的自定义样式 */
.project-tab {
padding-left: 20px;
padding-right: 20px;
}
.project-tab .tab {
margin-right: 28px;
}
.project-tab .tab.active .text {
font-size: 28rpx;
color: var(--btnColor);
}
.project-tab .tab .line {
width: auto;
}
\ No newline at end of file \ No newline at end of file
...@@ -11,7 +11,16 @@ Component({ ...@@ -11,7 +11,16 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
tabList: [{
label:'精品升级-太阳膜',
width: '34%'
},{
label:'众筹活动',
width: '25%'
},{
label:'会员权益/升级',
width: '30%'
},],
}, },
/** /**
......
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"tab": "../../components/Tab/Tab",
"output-echart": "../../components//outputEchart/outputEchart",
"output-crowdfund": "../../components/outputCrowdfund/outputCrowdfund"
},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
/* packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxss */ /* packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxss */
.layout {
box-sizing: border-box;
position: relative;
// padding: 400rpx 16rpx 0;
// padding-top: 400rpx;
padding-top: 88rpx;
font-size: 24rpx;
color: #8A8C90;
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
&::after {
content: '';
width: 100%;
// height: 486rpx;
height: 350rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/bg.png') no-repeat;
background-size: 100% 264rpx;
background-color: #fff;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.merchantTitle{
height: 88rpx;
}
.tabContainer {
height: 100rpx;
font-weight: 600;
// padding: 0 32rpx;
// background-color: #F2F3F7;
}
.tab.active{
.text{
font-size: 34rpx!important;
color: #323436!important;
}
}
.comCom {
// flex: 1;
height: calc(100% - 100rpx);
overflow: scroll;
// background-color: #fff;
background-color: #F2F3F7;
}
.comCom::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml--> <!--packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml-->
<text>packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml</text> <!-- <text>packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml</text> -->
<view class="layout" >
<view class="merchantTitle">广西弘泽汽车销售服务…</view>
<tab tab="{{tabList}}" itemWidth="{{'30%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" />
<!-- <output-echart></output-echart>
<output-crowdfund></output-crowdfund> -->
</view>
<!-- pages/tab/output/output.wxml --> <!-- pages/tab/output/output.wxml -->
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady"> <navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<!-- <picker
range="{{merchantRange}}"
value="{{subIndex}}"
range-key="merchantName"
bindchange="changePicker"
bindtap="tapPicker"
bindcancel="tapPicker"
disabled="{{merchantRange.length < 2}}"> -->
<view class="navigation-title" bindtap="tapPicker"> <view class="navigation-title" bindtap="tapPicker">
<view class="navigation-title-text text-hide"> <view class="navigation-title-text text-hide">
{{merchantRange[subIndex].merchantName||userInfo.merchantName}} {{merchantRange[subIndex].merchantName||userInfo.merchantName}}
......
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "2.27.2",
"condition": {
"miniprogram": {
"list": [
{
"name": "看产值",
"pathName": "pages/tab/output/output",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "携带目标页面",
"pathName": "login/loading/loading",
"query": "url=%2Fpages%2Ftab%2Fmine%2Fmine%3Fid%3D123",
"launchMode": "default",
"scene": null
},
{
"name": "选择账号",
"pathName": "login/accountItems/accountItems",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "个人中心",
"pathName": "pages/tab/mine/mine",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "login/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "客户管理",
"pathName": "packagesList/mineDetail/pages/customerManagement",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "消息盒子",
"pathName": "packagesList/mineDetail/pages/messageBox",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "开通门店",
"pathName": "pages/apply/apply",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/checkProduct/checkProduct",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "看线索",
"pathName": "pages/tab/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "申请业务+产品",
"pathName": "packagesList/apply/pages/apply",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "login/loading/loading",
"query": "scene=sceneId%3D22402",
"launchMode": "default",
"scene": 1047
}
]
}
},
"setting": {}
}
\ 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!