# openMiniProgram^8.12
美居打开小程序# 请求参数
| Prop | Type | Required | Default | Comment | 
|---|---|---|---|---|
miniProgramType |  Number |  N |  0 | 小程序版本类型, 默认为0。0-正式版,1-测试版,2-预览版 | 
miniProgramUserName |  String |  Y |  N/A | 小程序原始id,需要询问对应小程序开发查询 | 
miniProgramPath |  String |  Y |  N/A | 小程序的路径 | 
# 接口调用示例
this.$bridge.getAppInfo(res => {
  let appVersion = res.appVersion
  const versionList = appVersion.split('.')
  //版本大于8.12,则使用openMiniProgram接口
  if(versionList >= 2 && ( (versionList[0] == 8 && versionList[1] > 12) || versionList[0] > 8 )){
    //文档暂未更新,只有这三个参数
    this.$bridge.openMiniProgram({
      miniProgramType: 0,//小程序版本类型, 默认为0。0-正式版,1-测试版,2-预览版
      miniProgramUserName: 'ghxxxxxx',//小程序原始id,需要质询对应小程序开发查询
      miniProgramPath: 'xxxxx',//小程序的路径
    })
  }else{
    //这个URL由微信中控提供
    this.$bridge.openURL('https://d.midea.com/d/DD4bKcfpdhw')
  }
})
 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 接口返回示例
N/A
 1
2
3
2
3