原子操作

飞道科技

界面

  1. 1. 交互
    1. 1.1. 隐藏 loading 提示框
    2. 1.2. 隐藏消息提示框
    3. 1.3. 显示操作菜单
    4. 1.4. 显示 loading 提示框
    5. 1.5. 显示模态对话框
    6. 1.6. 显示消息提示框
  2. 2. 下拉刷新
    1. 2.1. 开始下拉刷新
    2. 2.2. 停止当前页面下拉刷新
  3. 3. 滚动
    1. 3.1. 将页面滚动到目标位置
  4. 4. 导航栏
    1. 4.1. 在当前页面隐藏导航条加载动画
    2. 4.2. 设置页面导航条颜色
    3. 4.3. 动态设置当前页面的标题
    4. 4.4. 在当前页面显示导航条加载动画
  5. 5. 置顶
    1. 5.1. 动态设置置顶栏文字内容

1. 交互

1.1. 隐藏 loading 提示框

import hide_loading from '@feidao/web/atom/wx/app/api/interaction/hide-loading';
hide_loading();

1.2. 隐藏消息提示框

import hide_toast from '@feidao/web/atom/wx/app/api/interaction/hide-toast';
hide_toast();
// 

1.3. 显示操作菜单

import show_action_sheet from '@feidao/web/atom/wx/app/api/interaction/show-action-sheet';
const res = show_action_sheet(['A','B','C']);
const res = show_action_sheet(['A','B','C'], 'red');
// 

1.4. 显示 loading 提示框

import show_loading from '@feidao/web/atom/wx/app/api/interaction/show-loading';
const res = show_loading('title');
const res = show_loading('title', true);

// 

1.5. 显示模态对话框

import show_modal from '@feidao/web/atom/wx/app/api/interaction/show-modal';
const res = show_modal('title', 'content');
const res = show_modal('title', 'content', 'cancel');
const res = show_modal('title', 'content', 'cancel', true);
const res = show_modal('title', 'content', 'cancel', true, '#00000');
const res = show_modal('title', 'content', 'cancel', true, '#00000', 'sure');
const res = show_modal('title', 'content', 'cancel', true, '#00000', 'sure', '#22222');
// 

1.6. 显示消息提示框

import show_toast from '@feidao/web/atom/wx/app/api/interaction/show-toast';
const res = show_toast('title', 'success');
const res = show_toast('title', 'success', 100);
const res = show_toast('title', 'success', 100, 'image');
const res = show_toast('title', 'success', 100, 'image', true);

// 

2. 下拉刷新

2.1. 开始下拉刷新

注意:调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。

import start_pull_down_refresh from '@feidao/web/atom/wx/app/api/interaction/start-pull-down-refresh';
start_pull_down_refresh('interactionPath');
// 

2.2. 停止当前页面下拉刷新

import stop_pull_down_refresh from '@feidao/web/atom/wx/app/api/interaction/stop-pull-down-refresh';
stop_pull_down_refresh('interactionPath');
// 

3. 滚动

3.1. 将页面滚动到目标位置

import page_scroll_to from '@feidao/web/atom/wx/app/api/interaction/page-scroll-to';
page_scroll_to(200, 0);
page_scroll_to(200, 300);
// 

4. 导航栏

4.1. 在当前页面隐藏导航条加载动画

import hide_nav_bar_loading from '@feidao/web/atom/wx/app/api/interaction/hide-nav-bar-loading';
hide_nav_bar_loading('interactionPath');
// 

4.2. 设置页面导航条颜色

import set_nav_bar_color from '@feidao/web/atom/wx/app/api/interaction/set-nav-bar-color';
const res = set_nav_bar_color('#ffffff', '#251562');
const res = set_nav_bar_color('#ffffff', '#251562',{duration: 200});
const res = set_nav_bar_color('#ffffff', '#251562',{duration: 200, timingFunc: 'easeIn'});
// 

4.3. 动态设置当前页面的标题

import set_nav_bar_title from '@feidao/web/atom/wx/app/api/interaction/set-nav-bar-title';
const res = set_nav_bar_title('标题');
// 

4.4. 在当前页面显示导航条加载动画

import show_nav_bar_loading from '@feidao/web/atom/wx/app/api/interaction/show-nav-bar-loading';
show_nav_bar_loading();
// 

5. 置顶

5.1. 动态设置置顶栏文字内容

注意:只有当前小程序被置顶时能生效,如果当前小程序没有被置顶,也能调用成功,但是不会立即生效,只有在用户将这个小程序置顶后才换上设置的文字内容

import set_top_bar_text from '@feidao/web/atom/wx/app/api/interaction/set-top-bar-text';
const res = set_top_bar_text('置顶');
//