H5端 uni-load-more 触底不刷新问题

uni-page标签 height不能写成100%,要写height: auto;.

微信小程序更改CheckBox样式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* #ifdef APP-PLUS || MP-WEIXIN */
checkbox .wx-checkbox-input{
border-radius: 50%;
width: 30rpx;
height: 30rpx;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked{
background-color: @theme;
color: #FFFFFF !important;
border-color: @theme;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
transform: translate(-50%,-50%) scale(.45);
}
/* #endif */

微信小程序更改radio样式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

/* #ifdef APP-PLUS || MP-WEIXIN */
radio .wx-radio-input {
width: 30rpx;
height: 30rpx;
}
radio .wx-radio-input.wx-radio-input-checked {
width: 30rpx;
height: 30rpx;
background:@theme !important;
border-color: @theme !important;
}
radio .wx-radio-input.wx-radio-input-checked::before {
transform: translate(-50%,-50%) scale(.5);
}
/* #endif */

微信小程序修改switch样式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* #ifdef APP-PLUS || MP-WEIXIN  */
switch .wx-switch-input{
height: 56rpx ;
background: @theme !important;
border-color: #ccc !important;
}
/*白色样式(false的样式)*/
switch .wx-switch-input::before{
height: 52rpx ;
}
/*(true的样式)*/
switch .wx-switch-input::after{
width: 52rpx;
height: 52rpx;
}
/* #endif */


动态修改导航栏的icon

此方案改了icon样式后,onNavigationBarButtonTap将不再触发,坑!还是用自定义导航栏吧;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
data() {
return {
flag: true
}
},
computed: {
...mapState({
list: state => state.home.list,
theme: state => state.common.theme,
})
},
onNavigationBarButtonTap(btn) {
console.log(btn)
// 分享
if (btn.index === 0) {
uni.showToast({
icon: 'none',
title:'分享'
})
}
// 爱心
if (btn.index === 1) {
let pages = getCurrentPages();
let page = pages[pages.length - 1];
// #ifdef APP-PLUS
let currentWebview = page.$getAppWebview();
let titleObj = currentWebview.getStyle().titleNView;
if (!titleObj.buttons) {
return;
}

if (this.flag) {
titleObj.buttons[1].fontSrc = "/static/style/fonts/font.ttf";
titleObj.buttons[1].text = "\ue645";
titleObj.buttons[1].fontSize = 24;
titleObj.buttons[1].color = this.theme == 'theme-deep-pink'? '#FC6BC0':'#ffb1a7';
} else {
titleObj.buttons[1].text = "/static/style/fonts/other.ttf";
titleObj.buttons[1].text = "\ue900";
titleObj.buttons[1].fontSize = 18;
titleObj.buttons[1].color = '#333333';
}

this.flag = !this.flag;

// console.log(this.flag);

titleObj.buttons[1].width = '40px';
currentWebview.setStyle({
titleNView: titleObj
});
// #endif
}

},


页面展示base64图片不显示的坑

这个是字符串太长传输中加入回车导致, 需要把回车和换行都去掉

1
const url = base64Data.replace(/[\r\n]/g, '');