Commit 561ec67b authored by Junling Bu's avatar Junling Bu
Browse files

feat[litemall-wx]: 采用vant-weapp tag组件

parent 52c0f60d
/* eslint-disable */
var REGEXP = getRegExp('{|}|"', 'g');
function keys(obj) {
return JSON.stringify(obj)
.replace(REGEXP, '')
.split(',')
.map(function(item) {
return item.split(':')[0];
});
}
module.exports.keys = keys;
var bem = require('./bem.wxs').bem;
var memoize = require('./memoize.wxs').memoize;
module.exports = {
bem: memoize(bem),
memoize: memoize
};
'use strict';
Component({
externalClasses: ['custom-class'],
/**
* 组件的属性列表
* 用于组件自定义设置
*/
properties: {
// 颜色状态
type: {
type: String,
value: ''
},
// 自定义颜色
color: {
type: String,
value: ''
},
// 左侧内容
leftText: {
type: String,
value: ''
},
// 右侧内容
rightText: {
type: String,
value: ''
}
}
});
\ No newline at end of file
<view class="custom-class zan-capsule zan-capsule--{{type}}">
<block wx:if="{{color}}">
<view class="zan-capsule__left" style="background: {{ color }}; border-color: {{ color }}">{{ leftText }}</view>
<view class="zan-capsule__right" style="color: {{ color }}; border-color: {{ color }}">{{ rightText }}</view>
</block>
<block wx:else>
<view class="zan-capsule__left">{{ leftText }}</view>
<view class="zan-capsule__right">{{ rightText }}</view>
</block>
</view>
\ No newline at end of file
.zan-capsule {
display: inline-block;
font-size: 12px;
vertical-align: middle;
line-height: 19px;
-webkit-transform: scale(0.83);
transform: scale(0.83);
}
.zan-capsule__left, .zan-capsule__right {
display: inline-block;
line-height: 17px;
height: 19px;
vertical-align: middle;
box-sizing: border-box;
}
.zan-capsule__left {
padding: 0 2px;
color: #fff;
background: #999;
border-radius: 2px 0 0 2px;
border: 1rpx solid #999;
}
.zan-capsule__right {
padding: 0 5px;
color: #999;
border-radius: 0 2px 2px 0;
border: 1rpx solid #999;
}
.zan-capsule--danger .zan-capsule__left {
color: #fff;
background: #f24544;
border-color: #f24544;
}
.zan-capsule--danger .zan-capsule__right {
color: #f24544;
border-color: #f24544;
}
{
"navigationBarTitleText": "团购专区",
"usingComponents": {
"zan-capsule": "/lib/zanui-weapp/capsule/index"
}
"navigationBarTitleText": "团购专区"
}
\ No newline at end of file
......@@ -8,9 +8,7 @@
<view class="text">
<view class="header">
<text class="name">{{item.name}}</text>
<view class="capsule-tag">
<zan-capsule color="#a78845" leftText="{{item.grouponMember}}人成团" rightText="立减{{item.grouponDiscount}}" />
</view>
<van-tag type="warning">{{item.grouponMember}}人成团</van-tag>
</view>
<text class="desc">{{item.brief}}</text>
<view class="price">
......
......@@ -54,16 +54,6 @@ page, .container {
font-size: 30rpx;
}
.groupon-list .capsule-tag {
float: right;
padding-right: 0rpx;
padding-top: 8rpx;
}
.groupon-list .zan-capsule + .zan-capsule {
margin-left: 10px;
}
.groupon-list .desc {
width: 476rpx;
display: block;
......
{
"navigationBarTitleText": "我的团购",
"usingComponents": {
"zan-capsule": "../../../lib/zanui-weapp/capsule/index"
}
"navigationBarTitleText": "我的团购"
}
\ No newline at end of file
......@@ -40,12 +40,8 @@
</view>
<view class="b">
<view class="l">实付:¥{{item.actualPrice}}</view>
<view class="capsule-tag">
<zan-capsule color="#a78845" leftText="状态" rightText="{{item.joinerCount>=item.rules.discountMember?'已达成':'团购中'}}" />
</view>
<view class="capsule-tag">
<zan-capsule color="#a78845" leftText="发起" rightText="{{item.creator}}" wx:if="{{!item.isCreator}}" />
</view>
<van-tag type="primary">{{item.joinerCount>=item.rules.discountMember?'已达成':'团购中'}}</van-tag>
<van-tag round type="warning" wx:if="{{!item.isCreator}}">{{item.creator}}发起</van-tag>
</view>
</navigator>
</view>
......
......@@ -4,15 +4,6 @@ page {
background: #f4f4f4;
}
.capsule-tag {
float: right;
/* padding-right: 10rpx; */
}
.zan-capsule + .zan-capsule {
margin-left: 5px;
}
.orders-switch {
width: 100%;
background: #fff;
......
{
"navigationBarTitleText": "首页",
"enablePullDownRefresh": true,
"usingComponents": {
"zan-capsule": "../../lib/zanui-weapp/capsule/index"
}
"enablePullDownRefresh": true
}
\ No newline at end of file
......@@ -72,9 +72,7 @@
<view class="text">
<view class="header">
<text class="name">{{item.name}}</text>
<view class="capsule-tag">
<zan-capsule color="#a78845" leftText="{{item.grouponMember}}人成团" rightText="立减{{item.grouponDiscount}}" />
</view>
<van-tag type="warning">{{item.grouponMember}}人成团</van-tag>
</view>
<text class="desc">{{item.brief}}</text>
<view class="price">
......
......@@ -242,16 +242,6 @@
font-size: 30rpx;
}
.a-groupon .capsule-tag {
float: right;
padding-right: 0rpx;
padding-top: 8rpx;
}
.a-groupon .zan-capsule + .zan-capsule {
margin-left: 10px;
}
.a-groupon .b .desc {
width: 476rpx;
display: block;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment