| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import { http } from '@/http/alova'
- import { ContentTypeEnum } from '@/http/tools/enum'
- export function getReceiveCouponDetail(couponId: string) {
- return http.Get('/couponCenter/APP/shareRecord/queryTemplateBySendUserId', {
- params: {
- id: couponId,
- }
- })
- }
- // 新增:获取优惠券分享短链的接口
- export function getCouponShareLink(params) {
- return http.Get('/couponCenter/APP/shareRecord/createShareWechatUrl', {
- params: {
- templateId: params.templateId,
- pathUrl: params.pathUrl,
- }
- })
- }
- // 生成微信小程序码
- export function getWxacode(token, id) {
- return uni.request({
- url: `https://api.weixin.qq.com/wxa/getwxacode?access_token=${token}`,
- method: 'POST',
- data: {
- "path": `pages/home/home?couponCenter_shareId=${id}`,
- "env_version": 'release',
- "width": 280,
- },
- contentType: ContentTypeEnum.JSON,
- responseType: 'arraybuffer',
- })
- }
- export function getWxToken() {
- return uni.request({
- url: 'https://api.weixin.qq.com/cgi-bin/token',
- method: 'GET',
- data: {
- "grant_type": 'client_credential',
- "appid": 'wxab9634bf98628a03',
- "secret": 'b0f8b0c5372fb825be9cf3d89c3fb28c',
- },
- })
- }
- export function getWxQcCode(params) {
- return http.Post('/couponCenter/APP/shareRecord/createQRCode', params, {
- responseType: 'arraybuffer',
- cacheFor: null,
- meta: {
- returnResponse: true,
- }
- })
- }
|