123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import Taro, { preloadData } from '@tarojs/taro'
-
-
- export function getConfig() {
-
- const systemInfo = Taro.getStorageSync('systemInfo')
- const { windowWidth, pixelRatio: dpr } = systemInfo
-
-
- const canvas = {
- width: windowWidth * dpr,
-
- height: windowWidth * dpr * 2.16,
- }
-
-
- const poster = {
- width: canvas.width,
- height: canvas.width * 16 / 9,
- x: 0,
- y: 0,
- }
-
- const marign = 22.5 * dpr;
- const innerMargin = 15 * dpr
-
-
- const avatar = {
- arc: true,
- width: 66 * dpr,
- height: 66 * dpr,
- x: marign,
- y: poster.height + (39 * dpr),
- }
-
-
- const miniCode = {
- arc: true,
- width: 99 * dpr,
- height: 99 * dpr,
- x: canvas.width - (99 * dpr) - marign,
- y: poster.height + (20 * dpr),
- }
-
-
- const name = {
-
- font: `${15 * dpr}px serif`,
-
- fillStyle: '#333333',
-
-
-
- maxWidth: canvas.width - (marign * 2) - avatar.width - miniCode.width - (innerMargin * 2),
-
- x: marign + avatar.width + innerMargin,
- y: poster.height + (65 * dpr),
- }
-
-
- const desc = {
- font: `${10 * dpr}px serif`,
- fillStyle: '#666666',
- maxWidth: name.maxWidth,
- x: name.x,
- y: poster.height + (89.5 * dpr),
- }
-
- return {
- systemInfo,
- canvas,
- poster,
- miniCode,
- avatar,
- name,
- desc,
- }
- }
|