更新记录

1.0.20260330(2026-03-30)

  1. 支持商家转账用户确认收款
  2. APP调起支付分确认订单页
  3. APP调起支付分订单详情页

1.0.20260204(2026-02-04)

  1. 修正已知问题

1.0.20260129(2026-01-29)

  1. 修正已知问题
查看更多

平台兼容性

uni-app(4.57)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - - - - 5.0 12
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
- - - - - - - - - - - -

uni-app x(4.57)

Chrome Safari Android iOS 鸿蒙 微信小程序
- - 5.0 12 - -

引入插件

点击插件试用引入到项目

  • 按下方修改Android/IOS/Harmony需要修改的内容
  • 打包自定义基座包
  • 按照下方示例测试
  • 先插件试用,完全符合需求后购买
  • 若使用本插件请勿勾选uniapp自带微信支付二者存在冲突

SDK Version

  • IOS Sdk 2.0.5
  • Android Sdk 6.8.34
  • Harmony Sdk 1.0.16

IOS

  • 替换uni_modules/cms-weixin/utssdk/app-ios/Info.plist 文件替换其中【appId】为你自己应用的appId

Android

  • 无额外修改

Harmony鸿蒙

  • 参照链接创建harmony-configs/entry/src/main/module.json5文件, 定义 querySchemes
  • 在harmony-configs/entry/src/main/module.json5的 "module"下增加 "querySchemes": ["weixin","wxopensdk"]
  • 在harmony-configs/entry/src/main/module.json5的 "module/abilities/skills/actions"下增加 "wxentity.action.open"

插件引入

import * as wxUtils from "@/uni_modules/cms-weixin";

插件方法

方法 描述 参数 兼容性
isInstalled():boolean 是否安装微信 Android/IOS/Harmony
openApp():boolean 打开微信 Android/IOS/Harmony
registerApp(RegisterAppOption):boolean 注册App 见下方 Android/IOS/Harmony
login(LoginWxOption):void 授权登录 见下方 Android/IOS/Harmony
sendText(SendWxMessageOption):void 分享文本 见下方 Android/IOS/Harmony
sendImage(SendWxMessageOption):void 分享图片 见下方 Android/IOS/Harmony
sendVideo(SendWxMessageOption):void 分享视频 见下方 Android/IOS/Harmony
sendLink(SendWxMessageOption):void 分享链接 见下方 Android/IOS/Harmony
sendMiniProgram(SendWxMessageOption):void 分享小程序 见下方 Android/IOS/Harmony
openMiniProgram(SendWxMessageOption):void 打开小程序 见下方 Android/IOS/Harmony
openWWService(SendWxMessageOption):void 打开客服 见下方 Android/IOS/Harmony
requestMerchantTransfer(OpenBusinessViewOption):void 商家转账用户确认收款 见下方 Android/IOS
openWxPayScoreUse(OpenBusinessViewOption):void APP调起支付分确认订单页 见下方 Android/IOS/Harmony
openWxPayScoreDetail(OpenBusinessViewOption):void APP调起支付分订单详情页 见下方 Android/IOS/Harmony
wxPay(WxPayOption):void 微信支付 见下方 Android/IOS/Harmony

RegisterAppOption

参数 类型 描述 必填
appId string 微信应用appId
universalLink string iOS Universal Link ios平台必填

LoginWxOption

参数 类型 描述 必填
scope string 应用授权作用域
state string 自定义字符串、成功后会原样返回
success(code:string, state:string):void function 授权成功回调 code是微信返回数据 state 原样返回
fail(errCode, errMsg):void function(number,string) 授权失败回调

SendWxMessageOption

参数 类型 描述 必填
scene number 分享场景:0 对话 1 朋友圈 2收藏,默认0
title string 消息标题 sendLink/sendMiniProgram/openMiniProgram/sendVideo有效
desc string 消息描述 sendLink/sendMiniProgram/openMiniProgram/sendVideo有效
thumbUrl string 消息封面 sendLink/sendMiniProgram/openMiniProgram/sendVideo有效
text string 文本内容 sendText 必填
imagePath string 图片路径 sendImage 必填
videoUrl string 视频链接 sendVideo 必填
videoLowBandUrl string 供低带宽的环境下使用的视频链接 sendVideo有效
webpageUrl string 网页链接 / 小程序兼容低版本的网页链接 sendLink/sendMiniProgram有效 sendLink 必填
userName string 小程序的原始Id sendMiniProgram 必填
path string 小程序的 path sendMiniProgram有效
miniprogramType number 小程序的类型 正式版:0,测试版:1,体验版:2 默认正式版 sendMiniProgram有效
corpId string 打开客服的企业微信Id openWWService 必填
url string 客服URL openWWService 必填
success() function 成功回调
fail(errCode, errMsg) function(number,string) 失败回调

OpenBusinessViewOption

参数 类型 描述 必填
query string query string 格式参数,参照下方示例代码传递
extInfo string 扩展参数,支付分场景可传 {"miniProgramType":0}
success(extMsg, businessType) function(string,string) 拉起回调,返回微信 extMsg(json 字符串)和businessType
fail(errCode, errMsg) function(number,string) 失败回调

错误码

  • 小于0的错误码是微信自己的错误码不在下方列表中
错误码 描述
9010001 未安装微信
9010002 未调用registerApp
9010003 ios send fail
9010004 鸿蒙分享仅支持分享到对话
9020001 sendImage: imagePath未填写
9030001 sendVideo: videoUrl未填写
9030002 sendVideo: 鸿蒙sdk暂不支持分享视频
9040001 sendLink: webpageUrl未填写
9050001 sendMiniProgram: userName未填写
9060001 openWWService: corpId未填写
9060002 openWWService: url未填写
9060003 openWWService: 当前微信版本不支持
9070001 sendText: text未填写
9080001 openMiniProgram:鸿蒙sdk暂不支持打开微信小程序
9090001 openBusinessView: query未填写
9090002 requestMerchantTransfer: 当前平台暂不支持
9090003 requestMerchantTransfer: 当前微信版本不支持
9090004 openWxPayScore: 当前微信版本不支持

uniapp示例

所有方法需在 registerApp() 方法调用之后

<template>
    <view>
        <radio-group @change="radioChange" style="display: flex;align-items: center;margin: 10rpx 0;">
            <label style="display: flex;align-items: center;" v-for="(item, index) in scenes" :key="item.value">
                <view>
                    <radio :value="item.value" :checked="index === scene" />
                </view>
                <view>{{item.name}}</view>
            </label>
        </radio-group>
        <button type="primary" @click="isWXAppInstalled">是否安装微信</button>
        <button type="primary" @click="openApp">打开微信</button>
        <button type="primary" @click="login">登录</button>
        <button type="primary" @click="sendText">分享文本</button>
        <button type="primary" @click="sendLocalImage">分享本地图片</button>
        <button type="primary" @click="sendOnlieImage">分享在线图片(1M内)</button>
        <button type="primary" @click="sendOnlieVideo">分享在线视频</button>
        <button type="primary" @click="sendLink">分享网页</button>
        <button type="primary" @click="sendMiniProgram">分享小程序</button>
        <button type="primary" @click="openMiniProgram">打开小程序</button>
        <button type="primary" @click="openWWService">打开客服</button>
        <button type="primary" @click="requestMerchantTransfer">商家转账确认收款</button>
        <button type="primary" @click="openWxPayScoreUse">调起支付分确认订单</button>
        <button type="primary" @click="openWxPayScoreDetail">调起支付分订单详情</button>
        <button type="primary" @click="wxpay">微信支付</button>
    </view>
</template>

<script>
    import * as wxUtils from "@/uni_modules/cms-weixin";

    export default {
        data() {
            return {
                scene: 0,
                scenes: [
                    { value: 0, name: '对话' },
                    { value: 1, name: '朋友圈' },
                    { value: 2, name: '收藏' }
                ],
            }
        },
        onLoad() {
            wxUtils.registerApp({
                // 此处填写你自己的appId
                appId: "",
                // 此处填写你自己的universalLink
                universalLink: ""
            })
        },
        methods: {
            radioChange(evt) {
                for (let i = 0; i < this.scenes.length; i++) {
                    if (this.scenes[i].value === evt.detail.value) {
                        this.scene = i;
                        break;
                    }
                }
            },
            login() {
                wxUtils.login({
                    state: "wxUtils.login",
                    success(code, state) {
                        console.log('login success:', {
                            code,
                            state
                        })
                    },
                    fail(errCode, errMsg) {
                        console.log('login fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            isWXAppInstalled() {
                uni.showToast({
                    title: wxUtils.isInstalled() ? "已安装微信" : "未安装微信",
                    icon: "none"
                })
            },
            openApp(){
                 wxUtils.openApp()
            },
            sendText() {
                wxUtils.sendText({
                    text: "你好微信",
                    scene: this.scene,
                    success() {
                        console.log('sendText success')
                    },
                    fail(errCode, errMsg) {
                        console.log('sendText fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            sendLocalImage() {
                uni.chooseImage({
                    count: 1,
                    success: (res) => {
                        let absPath = plus.io.convertLocalFileSystemURL(res.tempFilePaths[0]);
                        wxUtils.sendImage({
                            imagePath: absPath,
                            scene: this.scene,
                            success() {
                                console.log('sendImage success')
                            },
                            fail(errCode, errMsg) {
                                console.log('sendImage fail', {
                                    errCode,
                                    errMsg
                                })
                            }
                        });
                    }
                })
            },
            sendOnlieImage() {
                wxUtils.sendImage({
                    imagePath: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
                    scene: this.scene,
                    success() {
                        console.log('sendImage success')
                    },
                    fail(errCode, errMsg) {
                        console.log('sendImage fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            sendOnlieVideo() {
                wxUtils.sendVideo({
                    title: "UTS微信视频",
                    desc: "这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述",
                    videoUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/video.mp4",
                    videoLowBandUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/video.mp4",
                    thumbUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
                    scene: this.scene,
                    success() {
                        console.log('sendVideo success')
                    },
                    fail(errCode, errMsg) {
                        console.log('sendVideo fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            sendLink() {
                wxUtils.sendLink({
                    title: "UTS微信网页",
                    desc: "这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述",
                    thumbUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
                    scene: this.scene,
                    webpageUrl: "https://ext.dcloud.net.cn/publisher?id=365074",
                    success() {
                        console.log('sendVideo success')
                    },
                    fail(errCode, errMsg) {
                        console.log('sendVideo fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            sendMiniProgram() {
                wxUtils.sendMiniProgram({
                    title: "UTS 小程序",
                    desc: "这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述",
                    thumbUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
                    scene: this.scene,
                    webpageUrl: "https://ext.dcloud.net.cn/publisher?id=365074",
                    miniprogramType: 0,
                    // 小程序的原始ID
                    userName: "gh_82f38e6e43c9",
                    // 小程序路径
                    path: "pages/index/index",
                    success() {
                        console.log('sendMiniProgram success')
                    },
                    fail(errCode, errMsg) {
                        console.log('sendMiniProgram fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            openMiniProgram() {
                wxUtils.openMiniProgram({
                    miniprogramType: 0,
                    // 小程序的原始ID
                    userName: "gh_82f38e6e43c9",
                    // 小程序路径
                    path: "pages/index/index",
                    success() {
                        console.log('openMiniProgram success')
                    },
                    fail(errCode, errMsg) {
                        console.log('openMiniProgram fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            openWWService() {
                wxUtils.openWWService({
                    // 此处填写你自己的企业Id
                    corpId: "",
                    // 此处填写你自己的企业微信客服链接
                    url: "",
                    success() {
                        console.log('openWWService success')
                    },
                    fail(errCode, errMsg) {
                        console.log('openWWService fail',{
                            errCode, errMsg
                        })
                    }
                });
            },
            requestMerchantTransfer() {
                wxUtils.requestMerchantTransfer({
                    query: "mchId=1230000000&appId=wx8888888888888888&package=affffddafdfafddffda%3D%3D",
                    success(extMsg,businessType) {
                        console.log('requestMerchantTransfer success', {
                            extMsg
                        })
                    },
                    fail(errCode, errMsg) {
                        console.log('requestMerchantTransfer fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            openWxPayScoreUse() {
                wxUtils.openWxPayScoreUse({
                    query: "package=AAQTnZoAAAABAAAAAAD8m2b8VRdZ2kVdKmHNZiAAAABcwQVtru-5k9MmEOZJ_Pv_Nq7Cw56dNKKN5Ej3Knt5jTHF-NdsP_McFW-iaU3iuJ0gWlNQeG9UihoKi0k2pv1t71M6mpk15X6L1545yNpmPD5uhi3poFV8e_5EdYwi_cbc6tXYVfa0AJUO4OzHGPhMdT4ZMwmFFhD0HQi9mRHQhFRKPwFai4NkkW7vm9mv1test",
                    extInfo: "{\"miniProgramType\":0}",
                    success(extMsg, businessType) {
                        console.log('openWxPayScoreUse success', {
                            extMsg
                        })
                    },
                    fail(errCode, errMsg) {
                        console.log('openWxPayScoreUse fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            openWxPayScoreDetail() {
                wxUtils.openWxPayScoreDetail({
                    query: "mch_id=1230000109&service_id=88888888000011&out_order_no=1234323JKHDFE1243252&timestamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&sign_type=HMAC-SHA256&sign=029B52F67573D7E3BE74904BF9AEA",
                    extInfo: "{\"miniProgramType\":0}",
                    success(extMsg,businessType) {
                        console.log('openWxPayScoreDetail success', {
                            extMsg
                        })
                    },
                    fail(errCode, errMsg) {
                        console.log('openWxPayScoreDetail fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            },
            wxpay() {
                wxUtils.wxpay({
                    partnerId: "1900000109",
                    prepayId: "1101000000140415649af9fc314aa427",
                    package: "Sign=WXPay",
                    nonceStr: "1101000000140429eb40476f8896f4c9",
                    timeStamp: "1398746574",
                    sign: "oR9d8PuhnIc+YZ8cBHFCwfgpaK9gd7vaRvkYD7rthRAZ\/X+QBhcCYL21N7cHCTUxbQ+EAt6Uy+lwSN22f5YZvI45MLko8Pfso0jm46v5hqcVwrk6uddkGuT+Cdvu4WBqDzaDjnNa5UK3GfE1Wfl2gHxIIY5lLdUgWFts17D4WuolLLkiFZV+JSHMvH7eaLdT9N5GBovBwu5yYKUR7skR8Fu+LozcSqQixnlEZUfyE55feLOQTUYzLmR9pNtPbPsu6WVhbNHMS3Ss2+AehHvz+n64GDmXxbX++IOBvm2olHu3PsOUGRwhudhVf7UcGcunXt8cqNjKNqZLhLw4jq\/xDg==",
                    success(obj) {
                        console.log('wxpay success', obj)
                    },
                    fail(errCode, errMsg) {
                        console.log('wxpay fail', {
                            errCode,
                            errMsg
                        })
                    }
                });
            }
        }
    }
</script>

uniappx示例

所有方法需在 registerApp() 方法调用之后

<template>
    <scroll-view class="page-scroll-view">
        <radio-group @change="radioChange" style="display: flex;align-items: center;">
            <radio v-for="(item, index) in scenes" :key="item.value" :checked="index === scene">
                {{ item.name }}
            </radio>
        </radio-group>
        <button type="primary" @click="isWXAppInstalled">是否安装微信</button>
        <button type="primary" @click="openApp">打开微信</button>
        <button type="primary" @click="login">登录</button>
        <button type="primary" @click="sendText">分享文本</button>
        <button type="primary" @click="sendLocalImage">分享本地图片</button>
        <button type="primary" @click="sendOnlieImage">分享在线图片(1M内)</button>
        <button type="primary" @click="sendOnlieVideo">分享在线视频</button>
        <button type="primary" @click="sendLink">分享网页</button>
        <button type="primary" @click="sendMiniProgram">分享小程序</button>
        <button type="primary" @click="openMiniProgram">打开小程序</button>
        <button type="primary" @click="openWWService">打开客服</button>
        <button type="primary" @click="requestMerchantTransfer">商家转账确认收款</button>
        <button type="primary" @click="openWxPayScoreUse">调起支付分确认订单</button>
        <button type="primary" @click="openWxPayScoreDetail">调起支付分订单详情</button>
        <button type="primary" @click="wxpay">微信支付</button>
    </scroll-view>
</template>

<script setup lang="uts">
    import { ref, onMounted } from 'vue'
    import * as wxUtils from "@/uni_modules/cms-weixin";

    // 响应式变量
    const scene = ref(0)
    const scenes = [
        { value: 0, name: '对话' },
        { value: 1, name: '朋友圈' },
        { value: 2, name: '收藏' }
    ]

    // 生命周期
    onMounted(() => {
        wxUtils.registerApp({
            // 此处填写你自己的appId
            appId: "",
            // 此处填写你自己的universalLink
            universalLink: ""
        } as wxUtils.RegisterAppOption)
    })

    // 方法定义
    const radioChange = (evt : UniRadioGroupChangeEvent) => {
        for (let i = 0; i < scenes.length; i++) {
            if (scenes[i].value.toString() == evt.detail.value) {
                scene.value = i;
                break;
            }
        }
    }

    const login = () => {
        wxUtils.login({
            state: "wxUtils.login",
            success(code : string, state : string) {
                console.log('login success:', { code, state })
            },
            fail(errCode : number, errMsg : string) {
                console.log('login fail', { errCode, errMsg })
            }
        } as wxUtils.LoginWxOption);
    }

    const isWXAppInstalled = () => {
        uni.showToast({
            title: wxUtils.isInstalled() ? "已安装微信" : "未安装微信",
            icon: "none"
        })
    }

    const openApp = () => {
        wxUtils.openApp()
    }

    const sendText = () => {
        wxUtils.sendText({
            text: "你好微信",
            scene: scene.value,
            success() {
                console.log('sendText success')
            },
            fail(errCode : number, errMsg : string) {
                console.log('sendText fail', { errCode, errMsg })
            }
        } as wxUtils.SendWxMessageOption);
    }

    const sendLocalImage = () => {
        uni.chooseImage({
            count: 1,
            success: (res) => {

                // #ifdef APP-ANDROID
                let absPath = res.tempFilePaths[0]
                // let absPath = UTSAndroid.getResourcePath(res.tempFilePaths[0])
                // let absPath = UTSAndroid.convert2AbsFullPath(res.tempFilePaths[0])
                // #endif

                // #ifdef APP-IOS
                let absPath = res.tempFilePaths[0]
                // let absPath = UTSiOS.getResourcePath(res.tempFilePaths[0])
                // let absPath = UTSiOS.convert2AbsFullPath(res.tempFilePaths[0])
                // #endif

                wxUtils.sendImage({
                    imagePath: absPath,
                    scene: scene.value,
                    success() {
                        console.log('sendImage success')
                    },
                    fail(errCode : number, errMsg : string) {
                        console.log('sendImage fail', { errCode, errMsg })
                    }
                } as wxUtils.SendWxMessageOption);
            }
        })
    }

    const sendOnlieImage = () => {
        wxUtils.sendImage({
            imagePath: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
            scene: scene.value,
            success() {
                console.log('sendImage success')
            },
            fail(errCode : number, errMsg : string) {
                console.log('sendImage fail', { errCode, errMsg })
            }
        } as wxUtils.SendWxMessageOption);
    }

    const sendOnlieVideo = () => {
        wxUtils.sendVideo({
            title: "UTS微信视频",
            desc: "这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述",
            videoUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/video.mp4",
            videoLowBandUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/video.mp4",
            thumbUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
            scene: scene.value,
            success() {
                console.log('sendVideo success')
            },
            fail(errCode : number, errMsg : string) {
                console.log('sendVideo fail', { errCode, errMsg })
            }
        } as wxUtils.SendWxMessageOption);
    }

    const sendLink = () => {
        wxUtils.sendLink({
            title: "UTS微信网页",
            desc: "这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述",
            thumbUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
            scene: scene.value,
            webpageUrl: "https://ext.dcloud.net.cn/publisher?id=365074",
            success() {
                console.log('sendLink success')
            },
            fail(errCode : number, errMsg : string) {
                console.log('sendLink fail', { errCode, errMsg })
            }
        } as wxUtils.SendWxMessageOption);
    }

    const sendMiniProgram = () => {
        wxUtils.sendMiniProgram({
            title: "UTS 小程序",
            desc: "这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述这是一段描述",
            thumbUrl: "https://env-00jxt1cobn8u-static.normal.cloudstatic.cn/kuaiqucan/108.png",
            scene: scene.value,
            webpageUrl: "https://ext.dcloud.net.cn/publisher?id=365074",
            miniprogramType: 0,
            userName: "gh_82f38e6e43c9",
            path: "pages/index/index",
            success() {
                console.log('sendMiniProgram success')
            },
            fail(errCode : number, errMsg : string) {
                console.log('sendMiniProgram fail', { errCode, errMsg })
            }
        } as wxUtils.SendWxMessageOption);
    }

    const openMiniProgram = () => {
        wxUtils.openMiniProgram({
            miniprogramType: 0,
            userName: "gh_82f38e6e43c9",
            path: "pages/index/index",
            success() {
                console.log('openMiniProgram success')
            },
            fail(errCode : number, errMsg : string) {
                console.log('openMiniProgram fail', { errCode, errMsg })
            }
        } as wxUtils.SendWxMessageOption);
    }

    const openWWService = () => {
        wxUtils.openWWService({
            // 此处填写你自己的企业Id
            corpId: "",
            // 此处填写你自己的企业微信客服链接
            url: "",
            success() {
                console.log('openWWService success')
            },
            fail(errCode : number, errMsg : string) {
                console.log('openWWService fail', { errCode, errMsg })
            }
        } as wxUtils.SendWxMessageOption);
    }

    const requestMerchantTransfer = () => {
        wxUtils.requestMerchantTransfer({
            query: "mchId=1230000000&appId=wx8888888888888888&package=affffddafdfafddffda%3D%3D",
            success(extMsg,businessType) {
                console.log('requestMerchantTransfer success', {
                    extMsg
                })
            },
            fail(errCode, errMsg) {
                console.log('requestMerchantTransfer fail', {
                    errCode,
                    errMsg
                })
            }
        } as wxUtils.OpenBusinessViewOption);
    }

    const openWxPayScoreUse = () => {
        wxUtils.openWxPayScoreUse({
            query: "package=AAQTnZoAAAABAAAAAAD8m2b8VRdZ2kVdKmHNZiAAAABcwQVtru-5k9MmEOZJ_Pv_Nq7Cw56dNKKN5Ej3Knt5jTHF-NdsP_McFW-iaU3iuJ0gWlNQeG9UihoKi0k2pv1t71M6mpk15X6L1545yNpmPD5uhi3poFV8e_5EdYwi_cbc6tXYVfa0AJUO4OzHGPhMdT4ZMwmFFhD0HQi9mRHQhFRKPwFai4NkkW7vm9mv1test",
            extInfo: "{\"miniProgramType\":0}",
            success(extMsg, businessType) {
                console.log('openWxPayScoreUse success', {
                            extMsg
                        })
                    },
                    fail(errCode, errMsg) {
                        console.log('openWxPayScoreUse fail', {
                            errCode,
                            errMsg
                        })
                    }
        } as wxUtils.OpenBusinessViewOption);
    }
    const openWxPayScoreDetail = () => {
        wxUtils.openWxPayScoreDetail({
            query: "mch_id=1230000109&service_id=88888888000011&out_order_no=1234323JKHDFE1243252&timestamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&sign_type=HMAC-SHA256&sign=029B52F67573D7E3BE74904BF9AEA",
            extInfo: "{\"miniProgramType\":0}",
            success(extMsg,businessType) {
                console.log('openWxPayScoreDetail success', {
                    extMsg
                })
            },
            fail(errCode, errMsg) {
                console.log('openWxPayScoreDetail fail', {
                    errCode,
                    errMsg
                })
            }
        } as wxUtils.OpenBusinessViewOption);
    },

    const wxpay = () => {
        wxUtils.wxpay({
            partnerId: "1900000109",
            prepayId: "1101000000140415649af9fc314aa427",
            package: "Sign=WXPay",
            nonceStr: "1101000000140429eb40476f8896f4c9",
            timeStamp: "1398746574",
            sign: `oR9d8PuhnIc+YZ8cBHFCwfgpaK9gd7vaRvkYD7rthRAZX+QBhcCYL21N7cHCTUxbQ+EAt6Uy+lwSN22f5YZvI45MLko8Pfso0jm46v5hqcVwrk6uddkGuT+Cdvu4WBqDzaDjnNa5UK3GfE1Wfl2gHxIIY5lLdUgWFts17D4WuolLLkiFZV+JSHMvH7eaLdT9N5GBovBwu5yYKUR7skR8Fu+LozcSqQixnlEZUfyE55feLOQTUYzLmR9pNtPbPsu6WVhbNHMS3Ss2+AehHvz+n64GDmXxbX++IOBvm2olHu3PsOUGRwhudhVf7UcGcunXt8cqNjKNqZLhLw4jqxDg==`,
            success(obj : UTSJSONObject) {
                console.log('wxpay success', obj)
            },
            fail(errCode : number, errMsg : string) {
                console.log('wxpay fail', { errCode, errMsg })
            }
        } as wxUtils.WxPayOption);
    }
</script>

<style>
    .page-scroll-view {
        height: 100%;
    }
</style>

openMiniProgram / sendMiniProgram 注意事项

参考链接:https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Launching_a_Mini_Program/Launching_a_Mini_Program.html

  • 对于已通过认证的开放平台账号,其移动应用可以跳转至任何合法的小程序,且不限制跳转的小程序数量。
  • 对于未通过认证的开放平台账号,其移动应用仅可以跳转至同一开放平台账号下小程序。

需要帮助?有其他插件的需求?联系我!

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率: