提交 89af4964 编写于 作者: G gongfuxiang

微信小重新

上级 3a26acba
{
"pages": [
"pages": ["pages/user/user",
"pages/index/index",
"pages/goods-category/goods-category",
"pages/cart/cart",
"pages/user/user",
"pages/web-view/web-view",
"pages/login/login",
"pages/paytips/paytips",
......
// components/badge.js
Component({
/**
* 组件的属性列表
*/
properties: {
propNumber: Number,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view wx:if="{{propNumber > 0}}" class="am-badge">
<view class="am-badge-text {{(propNumber > 99) ? 'am-badge-text-max' : ''}}">
<text>{{(propNumber > 99) ? '99+' : propNumber}}</text>
</view>
</view>
\ No newline at end of file
.am-badge {
display: inline-block;
position: relative;
vertical-align: middle;
}
.am-badge-text {
display: inline-block;
position: absolute;
right: 0;
transform: translate(50%, -50%);
top: 0px;
min-width: 16px;
padding: 0;
height: 16px;
line-height: 16px;
text-align: center;
background-color: #FF3B30;
border-radius: 16px;
color: #fff;
font-size: 10px;
padding: 2px 2px;
}
.am-badge-text-max {
padding:2px 3px;
}
\ No newline at end of file
......@@ -231,7 +231,7 @@ Page({
temp_data_list[index]['status_name'] = '待发货';
this.setData({ data_list: temp_data_list });
app.showToast({'支付成功');
app.showToast('支付成功');
} else {
wx.tradePay({
tradeNO: res.data.data.data,
......
{
"enablePullDownRefresh": true,
"usingComponents": {
"badge": "mini-antui/es/badge/index"
"component-badge": "/components/badge/badge"
}
}
\ No newline at end of file
......@@ -40,7 +40,9 @@
<block wx:for="{{user_order_status_list}}" wx:for-item="items">
<navigator url="/pages/{{item.url}}/{{item.url}}?status={{items.status}}" hover-class="none">
<view class="items fl tc">
<badge wx:if="{{items.count > 0}}" text="{{items.count}}" dot="{{false}}"></badge>
<view class="badge-icon">
<component-badge prop-number="{{items.count}}"></component-badge>
</view>
<image src="/images/user-index-nav-order-icon-{{items.status}}.png" class="items-icon" mode="aspectFill" />
<view class="items-name">{{items.name}}</view>
</view>
......
......@@ -78,7 +78,7 @@
height: 60rpx;
margin-bottom: 6rpx;
}
.items-list .items .am-badge {
.items-list .items .badge-icon {
position: absolute;
top: 0;
left: calc(50% + 30rpx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册