feat: 初始化项目配置和样式- 添加项目环境变量配置文件 (.env)
- 创建代码忽略文件列表 (.gitignore) - 设置代码格式化规则 (.prettierrc)- 添加各种样式文件,包括背景、边框、按钮、卡片等组件样式 - 创建暗黑主题样式文件 - 添加表单和代码样式文件
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import user from './user';
|
||||
import goods from './goods';
|
||||
import groupon from './groupon';
|
||||
import SocialApi from '@/sheep/api/member/social';
|
||||
|
||||
export function getPosterData(options) {
|
||||
switch (options.shareInfo.poster.type) {
|
||||
case 'user':
|
||||
return user(options);
|
||||
case 'goods':
|
||||
return goods(options);
|
||||
case 'groupon':
|
||||
return groupon(options);
|
||||
}
|
||||
}
|
||||
|
||||
export function formatImageUrlProtocol(url) {
|
||||
// #ifdef H5
|
||||
// H5平台 https协议下需要转换
|
||||
if (window.location.protocol === 'https:' && url.indexOf('http:') === 0) {
|
||||
url = url.replace('http:', 'https:');
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 小程序平台 需要强制转换为https协议
|
||||
if (url.indexOf('http:') === 0) {
|
||||
url = url.replace('http:', 'https:');
|
||||
}
|
||||
// #endif
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
// 获得微信小程序码 (Base64 image)
|
||||
export async function getWxaQrcode(path, query) {
|
||||
const res = await SocialApi.getWxaQrcode(path, query);
|
||||
return 'data:image/png;base64,' + res.data;
|
||||
}
|
||||
Reference in New Issue
Block a user