0.0.3 • Published 2 years ago

@kasite/active-service v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

acitve-service 主动式服务插件

使用说明

1、小程序引入插件

在app.json中添加plugins

"plugins": {
    "active-service-plugin": {
        "version": "dev", // 演示线版本
        "provider": "wx849faa4762f4ca14", // 演示线appid
    }
}

2、app.js进行初始化

const activeService = requirePlugin('active-service-plugin') // 引入插件
const request = require("../../utils/request.js"); // 请求函数

async onLoad() {
    activeService.init({
      request,
      apiRootUrl: ApiRootUrl,
      setInterval: 0,
    })
}

插件提供了init函数,参数说明如下 |参数名|描述|类型|是否必须|默认值| |---|---|---|---|---| | request | 用于发起post请求 | request | 是 | - | | apiRootUrl | request请求的服务器根路径 | string | 否 | https://demo.kasitesoft.com | | setInterval | 刷新的时间,0则不刷新 | number | 否 | 60000 |

3、页面调用

<process-component bind:swapPatient="swapPatient" bind:registrtion="registrtion" bind:bindPatient="bindPatient" bind:jumpPage="jumpPage" bind:navigateToDesc="navigateToDesc" userInfo="{{userInfo}}">
    <image slot="image" src="/images/medicare-card-green.png"></image>
</process-component>

插件暴露了一些接口,主要是用来跳转页面的,以及暴露一个slot,用来覆盖就诊卡图片的,默认是绿色的样式 |接口名|描述| |---|---| | bindPatient | 绑定就诊人 | | swapPatient | 切换就诊人 | | registrtion | 预约登记 | | jumpPage | 流程上的按钮跳转页面 | | navigateToDesc | 跳转详情页(详情也是做成组件) |

然后传入 userInfo 参数,提供给插件查询用户的最后操作人,需要的参数如下 |参数名|描述| |---|---| | hosId | 医院ID | | openId | 用户OpenId | | unionId | 用户UnionId |