@ux-frame/ux-weixin

1.0.1 • Public • Published

logo

UxFrame WeixinSDK 1.0.0

UxFrame WeixinSDK是基于wechatsdk开发的uts原生插件

非常感谢您购买UxFrame WeixinSDK!如果您有任何问题或需要最新的源码,请随时通过QQ群:450704209 与我联系。我会为您提供最专业的解答和帮助,并与您分享与UniAppX开发相关的经验。再次感谢您的信任和支持!

前言介绍

欢迎使用UxFrame WeixinSDK!此插件是基于wechatsdk开发,轻松实现微信授权支付、登录和微信分享等功能!

官方文档

https://www.uxframe.cn

交流反馈

欢迎加入我们的QQ群[450704209]交流反馈:点击跳转

使用方法

详细教程请加入我们的QQ群450704209获取

import * as wxsdk from "@/uni_modules/ux-weixin"

// 注册
wxsdk.register({
	appid: '您的微信appid',
	success: (res) => {
		console.log(res)
	}
} as RegisterOptions)

// 登录
wxsdk.login({
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as LoginOptions)

// 分享图文
wxsdk.share({
	type: 0,
	title: 'UxFrame低代码高性能UI框架',
	summary: 'UxFrame是基于UNI-APP-X开发的低代码高性能原生UI框架',
	href: 'https://www.uxframe.cn',
	imageUrl: 'https://www.uxframe.cn/logo/logo.png',
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as ShareOptions)

// 分享文本
wxsdk.share({
	type: 1,
	title: 'UxFrame低代码高性能UI框架',
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as ShareOptions)

// 分享图片
wxsdk.share({
	type: 2,
	// imageUrl: '/static/logo.png'
	imageUrl: 'https://www.uxframe.cn/logo/logo.png',
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as ShareOptions)

// 分享视频
wxsdk.share({
	type: 4,
	title: 'UxFrame低代码高性能UI框架',
	summary: 'UxFrame是基于UNI-APP-X开发的低代码高性能原生UI框架',
	// imageUrl: '/static/logo.png'
	imageUrl: 'https://www.uxframe.cn/logo/logo.png',
	mediaUrl: 'https://www.uxframe.cn/source/intro/demo.mp4',
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as ShareOptions)

// 分享小程序
wxsdk.share({
	type: 5,
	title: 'UxFrame低代码高性能UI框架',
	summary: 'UxFrame是基于UNI-APP-X开发的低代码高性能原生UI框架',
	// imageUrl: '/static/logo.png'
	imageUrl: 'https://www.uxframe.cn/logo/logo.png',
	miniProgram: {
		id: '小程序id',
		type: 0,
		path: '',
		webUrl: 'https://www.uxframe.cn'
	} as MiniProgram,
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as ShareOptions)

// 微信支付
wxsdk.requestPayment({
	mchid: '商户号',
	prepayId: '预付单',
	sign: '签名',
	signType: '签名类型',
	nonceStr: '随机字符串',
	timeStamp: '时间戳',
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as PayOptions)

// 联系微信企业客服
wxsdk.share({
	openCustomerServiceChat: true,
	corpid: '企业id',
	customerUrl: 'https://work.weixin.qq.com/kfid/kfc********',
	success: (res) => {
		console.log(res);
	},
	fail: (err) => {
		console.log(err);
	}
} as ShareOptions)

// 打开微信
wxsdk.openApp()

// 检测是否安装微信
wxsdk.isInstalled()

Package Sidebar

Install

npm i @ux-frame/ux-weixin

Weekly Downloads

3

Version

1.0.1

License

none

Unpacked Size

24.3 MB

Total Files

25

Last publish

Collaborators

  • ux-frame