Skip to content

Commit 0ab1827

Browse files
author
memakergytcom
committed
resize logo
1 parent ccd0bfe commit 0ab1827

File tree

10 files changed

+39
-48
lines changed

10 files changed

+39
-48
lines changed

README.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Mini-add-tips
22
> 用于提示用户首次进入小程序时,点击右上角菜单进行【添加到我的小程序】操作
33
4-
与支付宝Favorite组件保持一致,支持在自定义导航栏场景下保持一致效果。
4+
## 特性
5+
与支付宝原收藏组件(添加到首页)保持样式一致,支持在自定义导航栏场景下保持一致效果。
56

6-
## 样例
7-
[开发者工具预览](https://developers.weixin.qq.com/s/O5bxd8mY7ii4)
7+
## 样例
8+
[开发者工具预览](https://developers.weixin.qq.com/s/ttRn48me7Lit)
89

9-
![screenshot]](https://imgkr.cn-bj.ufileos.com/25b73c4e-bdb0-4c8f-aeff-18c7d1d9d7b7.gif)
10+
![screenshot](https://imgkr.cn-bj.ufileos.com/25b73c4e-bdb0-4c8f-aeff-18c7d1d9d7b7.gif)
1011
## 安装使用
1112
### 1. 获取组件
1213
#### git
@@ -26,33 +27,25 @@ git clone https://github.com/MakerGYT/mini-add-tips.git
2627
```
2728

2829
### 3. 使用组件
29-
参考[/pages](https://github.com/makergyt/mini-add-tips/tree/master/demo/index/index)
3030
```html
3131
<!-- index.wxml -->
3232
<add-tips name="示例"/>
3333
```
34-
```js
35-
Page({
36-
onAddToFavorites(res) {
37-
38-
}
39-
})
40-
```
41-
34+
自定义导航栏请参考[/pages/index](https://github.com/makergyt/mini-add-tips/tree/master/pages/index/index)
4235
## 属性列表
4336
| 属性 |类型| 默认值|必填|说明|
4437
| -- | --|--|--|--|
45-
| name | String | 测试 | |小程序名称|
46-
| logo | String | 'https://imgkr.cn-bj.ufileos.com/c958e4cd-6bab-43ed-93aa-697207cf33a5.png' ||小程序Logo|
38+
| name | String | 测试 | |小程序名称|
39+
| logo | String | <img src="https://imgkr.cn-bj.ufileos.com/c958e4cd-6bab-43ed-93aa-697207cf33a5.png" width=50/> ||小程序Logo|
4740
| duration | Number | 10 ||持续显示时间(s)|
4841
| custom | Boolean | false ||当前页面是否{"navigationStyle": "custom"}|
4942

5043
## Todo
51-
- [x] 根据用户使用小程序频次、收藏及关闭收藏等行为,智能控制显示时间及疲劳度
44+
- [ ] 根据用户使用小程序频次、收藏等行为,智能控制显示区间及显示时机。
5245

5346
## 开发说明
54-
55-
1. 无法获取当前是否"navigationStyle": "custom",只能由外部传入,
56-
2. 无法获知是否收藏,只能获知组件是否显示过,即仅展示一次
57-
3. 没必要低估用户,提供添加的方法
58-
4. onAddToFavorites是页面的生命周期,不能在组件内监听
47+
鉴于目前微信基础库的设计:
48+
1. 收藏操作与添加到我的小程序对于用户容易混淆,但效应一样,故没必要具体引导用户。目前只有监听用户点击右上角菜单“收藏”按钮的行为,但实际上**兼听不到收藏行为,只能定义收藏内容**
49+
2. 无法获知是否已经收藏、是否已经添加到我的小程序,故提示可能对用户造成干扰。
50+
3. 目前没有可以调起添加小程序的api、button,或许出于"降低干扰度"的考虑,但就迫使手动设置引导,又会造成如2中所述干扰。
51+
4. 即便已经设置{"navigationStyle": "custom"},其[导航栏相关的api](https://developers.weixin.qq.com/miniprogram/dev/api/#%E5%AF%BC%E8%88%AA%E6%A0%8F)依然调用是有效的,无论组件还是页面内均无法据此获知导航栏是否custom,只能由外部传入。

app.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"pages":[
3-
"index/index"
4-
],
5-
"window":{
6-
"backgroundTextStyle":"light",
7-
"navigationBarBackgroundColor": "#fff",
8-
"navigationBarTitleText": "WeChat",
9-
"navigationBarTextStyle":"black"
10-
},
11-
"style": "v2",
12-
"sitemapLocation": "sitemap.json"
13-
}
2+
"pages": [
3+
"pages/index/index"
4+
],
5+
"window": {
6+
"backgroundTextStyle": "light",
7+
"navigationBarBackgroundColor": "#fff",
8+
"navigationBarTitleText": "WeChat",
9+
"navigationBarTextStyle": "black"
10+
},
11+
"style": "v2",
12+
"sitemapLocation": "sitemap.json"
13+
}

index/index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

index/index.wxml

Lines changed: 0 additions & 3 deletions
This file was deleted.

index/index.wxss

Lines changed: 0 additions & 4 deletions
This file was deleted.

pages/index/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Page({})

index/index.json renamed to pages/index/index.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"add-tips": "/components/add-tips/index"
44
},
55
"navigationBarBackgroundColor": "#07c160",
6+
"navigationStyle": "custom",
67
"navigationBarTextStyle": "white"
78
}

pages/index/index.wxml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<view>
2+
<add-tips name="测试" custom/>
3+
<!-- 以下是页面内容 -->
4+
<view></view>
5+
</view>

pages/index/index.wxss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**index.wxss**/
2+
page {
3+
background-image: url(https://imgkr.cn-bj.ufileos.com/17c6635f-2523-413e-80af-8f6f1c8a9a97.png);
4+
background-size: cover;
5+
}

project.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"compileType": "miniprogram",
1818
"libVersion": "2.11.0",
1919
"appid": "touristappid",
20-
"projectname": "favorite",
20+
"projectname": "mini-add-tips",
2121
"debugOptions": {
2222
"hidedInDevtools": []
2323
},

0 commit comments

Comments
 (0)