Commit 4ad2b554 by zhangxw

去除无用组件

1 parent e866833a
......@@ -92,13 +92,11 @@
],
"preloadRule": {},
"usingComponents": {
"tab": "/components/Tab/Tab",
"tab-bar": "/components/TabBar/TabBar",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup",
"nothing-tips": "/components/Nothing-tips/nothingTips",
"glsx-image": "/components/image/index",
"no-product": "/components/NoProduct/index",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index",
"van-popup": "@vant/weapp/popup/index"
},
......
// components/NoProduct/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
img_version: 'v1.0.0'
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/NoProduct/index.wxss */
.no-product {
height: 100vh;
font-weight: 500;
font-size: 48rpx;
color: #2D2D33;
text-align: center;
margin-top: 340rpx;
&-img {
width: 434rpx;
height: 276rpx;
margin-bottom: 50rpx;
}
}
\ No newline at end of file
<!--components/NoProduct/index.wxml-->
<view class="no-product">
<image class="no-product-img" src="{{IMG_URL}}index/productImgs/no-product.png?v={{img_version}}" />
<view>产品已下架</view>
</view>
// components/Service/Service.js
import { IMG_URL } from '~/utils/constantData'
// const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
Component({
/**
* 组件的属性列表
*/
properties: {
isFixed: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
isShow: false
},
/**
* 组件的方法列表
*/
methods: {
handleShow() {
this.setData({
isShow: !this.data.isShow
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/Service/Service.wxss */
.service {
position: fixed;
right: 0rpx;
top: 73%;
z-index: 120;
}
.icon {
width: 64px;
height: 64px;
}
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .8);
}
.poster {
width: 750rpx !important;
height: 720rpx !important;
border-radius: 0;
}
.close {
margin-top: 60rpx;
width: 64rpx;
height: 64rpx;
}
}
\ No newline at end of file
<!--components/Service/Service.wxml-->
<div class="{{isFixed ? 'service' : '' }}">
<image src="{{IMG_URL}}index/service.png" class="icon" bindtap="handleShow"></image>
<view wx:if="{{isShow}}" class="layout">
<view class="bg" bindtap="handleShow" />
<image class="poster" src="{{IMG_URL}}index/service-detail.png" show-menu-by-longpress="{{true}}"></image>
<image src="{{IMG_URL}}index/close.png" class="close" bindtap="handleShow"></image>
</view>
</div>
\ No newline at end of file
// 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
<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:{{itemWidth}}; {{index == 0 ? 'margin-left: 32rpx;' : ''}}" bindtap="click" data-count="{{index}}">
<view class="text text-center" style="{{tabHeight ? 'height: 60rpx;' : ''}}">{{item}}</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
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;
color: #A9A9A9;
justify-content: center;
font-size: 28rpx;
}
.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;
font-size: 38rpx;
transition: all .25s;
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!