You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

291 lines
7.7 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## 支付宝交易组件
```
第一步 订购插件和关联小程序
在接入插件之前,确保本账号或者本账号所属的主账号已经订购了本插件,并且已经关联到需要使用本插件的小程序。点击这里查看详细步骤。
第二步 配置主体小程序项目
在小程序开发工具里面打开需要使用插件的项目然后配置app.json
{
"plugins": {
"tradePay": {
"version": "*",// 目前只支持设置 * 拉取当前上架最新版本
"provider": "2021003178648009"
}
}
}
注意请修改上述文件的“tradePay”名称以和使用插件的代码匹配。
uniappmanifest.json插件配置
"mp-alipay" : {
"usingComponents" : true,
"appid" : "2021003197674866",
"plugins": {
"tradePay": {
"version": "*", // 目前只支持设置 * ,自动选择版本
"provider": "2021003178648009" // 组件Id固定不变
},
}
},
uniapppages.jsonsubPackages/order/preview/indexstyle内增加
"usingComponents": {
"discount-card": "plugin://tradePay/discountCard"
}
```
## 商品详情组件插件
```
第一步 订购插件和关联小程序
在接入插件之前,确保本账号或者本账号所属的主账号已经订购了本插件,并且已经关联到需要使用本插件的小程序。点击这里查看详细步骤。
第二步 配置主体小程序项目
在小程序开发工具里面打开需要使用插件的项目然后配置app.json
{
"plugins": {
"theGoodsEdit": {
"version": "*",// 目前只支持设置 * 拉取当前上架最新版本
"provider": "2021003177653028"
}
}
}
注意请修改上述文件的“tradePay”名称以和使用插件的代码匹配。
uniappmanifest.json插件配置
"mp-alipay" : {
"usingComponents" : true,
"appid" : "2021003197674866",
"plugins": {
"theGoodsEdit": {
"lazy",
"genericsImplementation": {
"goodsDetail": {
"detail-images": "/components/detail-images/detail-images" // 商家可以通过修改 /components/detail-images/detail-images 路径,传入自定义组件
}
},
"version": "*", // 目前只支持设置 * ,自动选择版本
"provider": "2021003177653028" // 组件Id固定不变
},
}
},
```
## 本地生活商品插件集成sop
## [文档](https://www.yuque.com/wenheng-68qmd/dthzsu/cnfuc25naz42q61v?singleDoc#OaKw6)
```
第一步 订购插件和关联小程序
在接入插件之前,确保本账号或者本账号所属的主账号已经订购了本插件,并且已经关联到需要使用本插件的小程序。点击这里查看详细步骤。
第二步 配置主体小程序项目
在小程序开发工具里面打开需要使用插件的项目然后配置app.json
{
"plugins": {
"groupPurchaseoucherPlugin": {
"version": "*", // 目前只支持设置 * ,自动选择版本
"provider": "2021003190661263"
},
}
}
<!--
uniappmanifest.json插件配置
"mp-alipay" : {
"usingComponents" : true,
"appid" : "2021003197674866",
"plugins": {
"groupPurchaseoucherPlugin": {
"version": "*", // 目前只支持设置 * ,自动选择版本
"provider": "2021003190661263"
}
}
}, -->
```
## 商家会员卡
## [文档](https://opendocs.alipay.com/open/03sx7u?pathHash=1abe9241&ref=api)
```
第一步 订购插件和关联小程序
在接入插件之前,确保本账号或者本账号所属的主账号已经订购了本插件,并且已经关联到需要使用本插件的小程序。点击这里查看详细步骤。
第二步 配置主体小程序项目
在小程序开发工具里面打开需要使用插件的项目然后配置app.json
{
"plugins": {
"alipassToolKit": { // 请自定义插件名称
"version": "*", // 目前只支持设置 * 拉取当前上架最新版本
"provider": "2021001107697072" // 固定值,插件 ID
}
}
}
装修组件 pages\index\components\TemplateAliMembershipCard.vue
```
## 支付宝支付券(领券组件)插件
```
文档https://opendocs.alipay.com/open/08b369?pathHash=6f84a8c0
微信公众平台,小程序设置,增加支付券插件
{
"plugins": {
"couponPlugin": {
"version": "*", // 拉取当前上架最新版本
"provider": "2021002172680015" // 领券组件插件 ID固定值
}
}
}
注意请修改上述文件的“couponPlugin”名称以和使用插件的代码匹配。
uniappmanifest.json插件配置
"plugins": {
"couponPlugin": {
"version": "*", // 拉取当前上架最新版本
"provider": "2021002172680015" // 领券组件插件 ID固定值
}
}
uniapppages.jsonsubPackages/pay_coupon/infostyle内增加
"usingComponents": {
"get-coupon": "plugin://couponPlugin/get-coupon"
}
```
## 微信支付券插件 - 暂时废弃
```
文档https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_3_1.shtml
微信公众平台,小程序设置,增加支付券插件
{
"plugins": {
"sendCoupon": {
"version": "1.4.13",
"provider": "wxf3f436ba9bd4be7b"
}
}
}
注意请修改上述文件的“sendCoupon”名称以和使用插件的代码匹配。
uniappmanifest.json插件配置
"mp-weixin" : {
"plugins": {
"sendCoupon": {
"version": "1.5.0",
"provider": "wxf3f436ba9bd4be7b"
}
}
},
uniapppages.jsonsubPackages/pay_coupon/indexstyle内增加
"usingComponents": {
"send-coupon": "plugin://sendCoupon/send-coupon"
}
```
## 微信 H5 支付
## [参考文档 前端的微信支付JSSDK支付](https://juejin.cn/post/6844903954355060749#heading-11)
## [参考文档 JSAPI调起支付API](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_4.shtml)
## [参考文档 JS-SDK说明文档](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#59)
// utils/wxConfig.js
// 异步获取配置数据
```JavaScript
async function getConfigData(url) {
// 接口获取签名
return {
app_id: "", // 必填,公众号的唯一标识
timestamp: "", // 必填,生成签名的时间戳
noncestr: "", // 必填,生成签名的随机串
signature: "", // 必填,签名
};
}
```
- subPackages/pay/index.vue
- 发起一个微信支付请求 `subPackages\pay\index.vue`
```JavaScript
wechatPayNow() // h5 调用
```
```JavaScript
//发送给朋友
onShareAppMessage(res) {
if (res.from === 'button') { // 来自页面内分享按钮
console.log(res.target)
}
return {
title: this.control.titleStyle.name,
path: `/pages/index/index?distributor_id=${this.getUser("id")}`,
summary: ""
}
},
```
· 首页 (分销ID) `/pages/index/index`
· 商品详情 (商品ID、分销ID) `/subPackages/goods/goods/index`
· 限时折扣 (折扣ID) `/subPackages/goods/goods/index`
· 满减优惠 (折扣ID) `/subPackages/goods/goods/index`
· 套餐列表 `/subPackages/goods/goods/packageList`
· 套餐详情 (套餐ID、mch_id) `/subPackages/goods/goods/package`
· 分类页面 `/pages/cat/cat`
· 附近门店 `/subPackages/stores/index/index`
· 门店详情 (门店ID) `/subPackages/stores/storesDetails/index`
· 门店列表 (点餐) `/subPackages/stores/restaurantList/index`
· 点餐页面 (门店ID) `/subPackages/takeaway/index`
· 文章列表 `/subPackages/article/index`
· 文章详情 `/subPackages/article/detail`
· 领券中心 `/subPackages/coupons/index/index`
· DIY页面 (页面ID) `/subPackages/diy/index`
· 预约中心 `/subPackages/reservation/index`
· 预约服务 `/subPackages/reservation/serve`
· 预约技师列表 (ID) `/subPackages/reservation/technician`
· 预约技师 (ID) `/subPackages/reservation/technicianDetali`