Commit 7bb58304 authored by wangzhujun's avatar wangzhujun

init

parent 5929d98d
# 顶部的EditorConfig文件
root = true
# unix风格的换行符,每个文件都以换行符结尾
[*]
end_of_line = lf
insert_final_newline = true
# 设置默认字符集
charset = utf-8
# 去除行尾空白字符
trim_trailing_whitespace = true
# 使用空格缩进,设置2个空格缩进
indent_style = space
indent_size = 2
# 忽略eslint校验路径,例如:
# src/libs/@spark
\ No newline at end of file
module.exports = {
parser: '@babel/eslint-parser',
env: {
browser: true,
es6: true,
node: true,
},
globals: {
CFG: true,
wx: true,
FYGE: true,
SPARK_ESLINT_PLUGIN: true,
remScale: true,
},
plugins: ['html', 'react', '@spark/best-practices', '@spark/security'],
extends: ['eslint:recommended', 'plugin:react/recommended'],
settings: {
react: {
version: 'detect',
},
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 7,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
babelOptions: {
configFile: './node_modules/@spark/code-inspector/static/babel.config.js',
},
},
rules: {
'no-undef': 'error',
'no-unused-vars': ['error', { vars: 'all', args: 'after-used', argsIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true }],
'no-dupe-keys': 'error',
'no-fallthrough': 'error',
'no-global-assign': 'error',
'no-implied-eval': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true }],
'no-useless-escape': 'error',
'no-empty-pattern': 'error',
'no-empty-function': ['error', { allow: ['arrowFunctions', 'functions', 'methods'] }],
'no-var': 'error',
'no-dupe-class-members': 'error',
'no-unsafe-optional-chaining': 'error',
'no-const-assign': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'prefer-const': 'warn',
'no-extra-boolean-cast': 'warn',
'no-mixed-spaces-and-tabs': 'warn',
'no-alert': 'warn',
'no-new-wrappers': 'warn',
'no-useless-concat': 'warn',
'no-useless-return': 'warn',
'prefer-promise-reject-errors': ['warn', { allowEmptyReject: true }],
'spaced-comment': 'warn',
'react/prop-types': 'off',
'react/display-name': 'off',
'react/jsx-pascal-case': 'error',
'jsx-quotes': 'warn',
// 'react/jsx-tag-spacing': 'error',
'react/require-resnder-return': 'error',
'semi': [1]
},
overrides: [
{
files: ['public/**/*.html'],
rules: {
'no-var': 'off',
'@spark/security/third-party-whitelist': 'error',
'@spark/best-practices/no-url-in-js': 'error',
'@spark/best-practices/no-arrow-function': 'error',
'@spark/best-practices/no-es6-variable-declaration': 'error',
},
},
{
files: ['src/**/*.{js,jsx}'],
rules: {
'@spark/best-practices/no-url-in-js': 'error',
},
},
],
};
node_modules
node_modules
.DS_Store
node_modules/
___cache/
__cache/
coverage/
npm-debug.log
selenium-debug.log
.idea
.builds
.project
.vscode
yarn-error.log
.yarn
.package-lock
yarn.lock
.cache
packages/**/package-lock.json
released
output.js
output.js.map
.psd
.psb
#src/assets/
\ No newline at end of file
registry = http://npm.dui88.com
\ No newline at end of file
module.exports = {
semi: true, // 结尾加分号
singleQuote: false, // 使用单引号
jsxSingleQuote: false, // jsx中使用单引号
bracketSpacing: true, // 括号和参数之间有空格
jsxBracketSameLine: true, // 标签属性较多时,标签箭头>另起一行
quoteProps: 'as-needed', // 属性加引号需要加时再加
printWidth: 120, // 每行字符个数
};
registry "http://npm.dui88.com"
\ No newline at end of file
import MD from 'spark-utils/out/md/index.js';
let appId = CFG.appID;
const dcm = '202.' + CFG.projectId + '.0.0';
const domain = '//embedlog.duiba.com.cn';
let MDList = [
{
ele: `.test-md1`,
data: {
dpm: `${appId}.110.5.1`,
dcm,
domain,
appId
},
once: false
}
];
export default () =>
MD({
show: MDList, // 曝光
click: MDList // 点击
});
### 注意事项
xxxxxxx
### 迭代日志
## 20230202 [大雁链接](https://www.bilibili.com)
+ haha
+ haha1
+ haha2
\ No newline at end of file
/*
将此文件放到project/config/scripts/assets/目录下
在package.json文件的"scripts"字段下,分别修改dev和build命令:
"dev": "node ./config/scripts/assets/generateAssetList.js && node ./config/webpack.dev.config.js"
"build": "node ./config/scripts/assets/generateAssetList.js && node ./config/scripts/assets/index.js imgmin imgup && node ./config/webpack.prod.config.js"
*/
const fs = require('fs')
const path = require('path')
/* 请先配置:预加载的资源文件夹名称,或者设置预加载、异步加载资源路径*/
const preloadFolder = []; // 在/src/assets文件夹下,请设置需要预加载的资源文件目录,默认值预加载为loading文件夹, 其他均为异步加载
const otherFolder = ['loadingDemo']; // 在/src/assets文件夹下,不做任务处理的文件夹,不需要预加载, 也不需要异步加载
const initAssetList = { // 初始化预设资源处理
preLoadImg:[], // 设置预加载图片,例如:["loading/bg174.png","loading/上面.png","loading/底部173.png"]
asyncLoadImg:[] // 设置异步加载图片
}
/**
* 搜索文件夹里的文件
* @param {*} folderList 预加载文件夹名称数组
* @param {*} folderPath 文件夹地址,绝对路径
* @param {*} regExp 正则表达式,用于匹配目标文件
* @returns {string[]} 返回文件相对路径地址
*/
function searchFileFromFolder(folderPath='/src/assets', regExp=/\.(png|jpg|jpeg|svga|spi|json|mp3|wav)$/i) {
const preLoadImg = [], asyncLoadImg = [];
const searchOneDir = (absolutePath, relativePath) => {
fs.readdirSync(absolutePath).forEach(v => {
const absPath = absolutePath + '/' + v;
const relPath = relativePath ? relativePath + '/' + v : v;
if(fs.statSync(absPath).isFile()) {
if(regExp.test(v)){
if(preloadFolder.includes(relPath.split('/')[0])){
preLoadImg.push(relPath);
}else if(!otherFolder.includes(relPath.split('/')[0])){
asyncLoadImg.push(relPath)
}
}
}else {
searchOneDir(absPath, relPath);
}
});
}
searchOneDir(path.resolve('.') + folderPath, '');
console.log('资源预处理成功~')
return {
preLoadImg: [
...initAssetList.preLoadImg,
...preLoadImg
],
asyncLoadImg: [
...initAssetList.asyncLoadImg,
...asyncLoadImg
]
};
}
// 读资源目录
const assetList = searchFileFromFolder();
// 写资源列表json
fs.writeFileSync(path.resolve('.') + '/src/assetList.json', JSON.stringify(assetList))
\ No newline at end of file
const { assets } = require("spark-assets");
const args = process.argv.splice(2);
let argsObj = {
imgmin: false,
imgup: false
}
if (args.length == 1) {
argsObj.imgmin = 'imgmin' == args[0];
argsObj.imgup = 'imgup' == args[0];
} else if (args.length == 2) {
argsObj.imgmin = 'imgmin' == args[0];
argsObj.imgup = 'imgup' == args[1];
}
assets(argsObj)
\ No newline at end of file
exports.SPARK_CONFIG_DIR_KEY = ['OUTPUT_DIR', 'SOURCE_DIR', 'TEMP_DIR', 'ENTRY', 'TEMPLATE']
exports.SPARK_CONFIG = 'sparkrc.js'
//对应项目在线素材存储的cdn配置,用于迭代开发从线上拉取素材到本地
exports.SPARK_CDN_RES_CFG='sparkrescfg.json'
\ No newline at end of file
const loaderUtils = require('loader-utils');
module.exports = function (source) {
const options = loaderUtils.getOptions(this);
let result = source;
if (options.arr) {
options.arr.map(op => {
result = result.replace(op.replaceFrom, op.replaceTo);
})
} else {
result = source.replace(options.replaceFrom, options.replaceTo);
}
return result
};
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { exec } = require('child_process');
class GitToHtmlPlugin {
process(htmlPluginData) {
return new Promise(function (resolve) {
let gitStr = '';
exec('git remote -v & git branch --show-current & git config --global user.name', (_err, stdout, _stderr) => {
if (stdout) {
gitStr = `<script>CFG.___G___='${encodeURIComponent(stdout.replace(/\n/g, ';'))}'</script>`
}
htmlPluginData.html = htmlPluginData.html.replace('</body>', `${gitStr}</body>`);
resolve();
});
});
};
apply(compiler) {
compiler.hooks.compilation.tap('GitToHtmlPlugin', (compilation) => {
HtmlWebpackPlugin.getHooks(compilation).afterTemplateExecution.tapAsync(
"GitToHtmlPlugin",
async (html, cb) => {
await this.process(html);
cb(null, html);
}
);
});
}
}
module.exports = GitToHtmlPlugin;
const babel = require('@babel/core');
const HtmlWebpackPlugin = require("html-webpack-plugin");
class HtmlJsToES5Plugin {
process(htmlPluginData) {
return new Promise(function (resolve) {
const scriptRegExp = /<script>[\s\S]*?<\/script>/gis;
htmlPluginData.html = htmlPluginData.html.replace(scriptRegExp, function (match) {
const code = match.replace("<script>", "").replace("</script>", "");
const es5Code = babel.transform(code, { 'presets': ['@babel/preset-env'] }).code;
return `<script>${es5Code}</script>`;
});
resolve();
});
};
apply(compiler){
compiler.hooks.compilation.tap('HtmlJsToES5Plugin', (compilation) => {
HtmlWebpackPlugin.getHooks(compilation).afterTemplateExecution.tapAsync(
"HtmlJsToES5Plugin",
async (html, cb) => {
await this.process(html);
cb(null, html);
}
);
});
}
}
// exports.default = HtmlJsToES5Plugin;
module.exports = HtmlJsToES5Plugin;
// 端口是否被占用
const net = require("net");
exports.getProcessIdOnPort=function(port) {
try {
const execOptions = {
encoding: 'utf8',
stdio: [
'pipe',
'pipe',
'ignore',
],
};
return execSync('lsof -i:' + port + ' -P -t -sTCP:LISTEN', execOptions)
.split('\n')[0]
.trim();
} catch (e) {
return null;
}
}
exports.isPortAvailable = function (port, host = "localhost") {
return new Promise((resolve) => {
if (isNaN(port) || port != parseInt(port) || port < 0 || port > 65536) {
resolve(false);
}
try {
const tester = net.createServer()
// catch errors, and resolve false
.once('error', err => {
resolve(false);
})
// return true if succed
.once('listening', (err) => {
tester
.once('close', () => {
resolve(true);
})
.close()
})
.listen(port, host);
} catch (e) {
resolve(false);
}
})
}
const childProcessSync=async function(cmd, params, cwd, printLog = true) {
return new Promise((resolve, reject) => {
let proc = childProcess(cmd, params, cwd, printLog);
proc.on('close', (code) => {
if (code === 0) {
resolve(proc['logContent']);
} else {
reject(code);
}
});
});
}
const getGitBranch=async function(cwd) {
try {
const result = await childProcessSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], cwd, false);
if (!result.startsWith('fatal:')) {
return result.trim();
}
} catch (e) {
return undefined;
}
}
const getProjectNameByPackage=function() {
return require(`${process.cwd()}/package.json`).name
}
/**
* 理论上每个项目独一无二的文件夹名字-默认取分支名
* 如果当前未创建分支,取包名+日期
* (实际很多情况是直接clone老项目,包名相同,以防资源被替换,所以用日期加一下)
*/
exports.getCdnFolderName=async function() {
const branch = await getGitBranch(process.cwd());
const date = Date.now();
if (branch) {
return branch + "/" + date;
}
let foldername = getProjectNameByPackage() + "/" + date;
return foldername;
}
const path = require('path');
const { SPARK_CONFIG_DIR_KEY, SPARK_CONFIG } = require('./scripts/constant');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const ProgressBarPlugin = require("progress-bar-webpack-plugin");
module.exports = function (isProd) {
const appPath = process.cwd();
const sparkConfig = require(path.join(appPath, SPARK_CONFIG));
const cssReg = /\.(css|less)$/;
// 处理相对路径
SPARK_CONFIG_DIR_KEY.map((key) => {
sparkConfig[key] = path.resolve(appPath, sparkConfig[key]);
});
const stylePlugins = [
require("autoprefixer")({
overrideBrowserslist: ["> 1%", "last 2 versions", "not ie <= 8"],
})
];
if (sparkConfig.PX2REM) {
stylePlugins.push(
require("postcss-px2rem-exclude")({
remUnit: 100, // 注意算法,这是750设计稿,html的font-size按照750比例
exclude: /node_modules/i,
})
);
}
const styleLoader = (cssOptions = {}) => {
return [
{
loader: "style-loader",
},
isProd && {
loader: MiniCssExtractPlugin.loader,
options: {
esModule: false,
},
},
{
loader: "css-loader",
options: {
...cssOptions,
importLoaders: 2, // 如果遇到css里面的 @import 执行后面两个loader。 不然如果import了less,css-loader是解析不了
},
},
{
loader: "postcss-loader",
options: {
sourceMap: isProd,
plugins: stylePlugins,
},
},
{
loader: require.resolve("less-loader"),
options: {
sourceMap: isProd,
lessOptions: {
modifyVars: {
"@RES_PATH": `"${isProd ? sparkConfig.RES_PATH_PROD + '/' : sparkConfig.RES_PATH}"`,
},
}
},
},
].filter(Boolean);
};
return {
entry: sparkConfig.ENTRY,
mode: isProd ? 'production' : 'development',
devtool: isProd ? "source-map" : "cheap-module-source-map",
output: {
path: path.resolve(__dirname, sparkConfig.OUTPUT_DIR),
filename: "js/[name].js",
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
alias: {
"@src": path.resolve(__dirname, sparkConfig.SOURCE_DIR),
},
},
module: {
strictExportPresence: true,
rules: [
{
test: cssReg,
use: styleLoader(),
include: sparkConfig.SOURCE_DIR,
},
{
test: /\.(js|jsx)$/,
loader: require.resolve("babel-loader"),
// exclude: [path.resolve("node_modules")],
options: {
presets: [
require("@babel/preset-env").default,
require("@babel/preset-react").default
],
plugins: [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose": false }],
require("@babel/plugin-transform-runtime").default,
],
sourceType: 'unambiguous'
},
},
{
test: [/\.(jpg|jpeg|png|svg|bmp)$/, /\.(eot|woff2?|ttf|svg)$/],
loader: require.resolve("url-loader"),
options: {
name: "[path][name].[ext]", // name默认是加上hash值。这里做了更改,不让加
outputPath: "images",
limit: 10240, // url-loader处理图片默认是转成base64, 这里配置如果小于10kb转base64,否则使用file-loader打包到images文件夹下
},
},
].filter(Boolean),
},
plugins: [
isProd &&
new MiniCssExtractPlugin({
filename: "styles/[name].[hash].css",
}),
new HtmlWebpackPlugin({
template: sparkConfig.TEMPLATE,
minify: !sparkConfig.UNMINIFY_INDEX && isProd,
}),
new CleanWebpackPlugin({
// cleanOnceBeforeBuildPatterns:['**/*', 'dist'] // 这里不用写 是默认的。 路径会根据output 输出的路径去清除
}),
new ProgressBarPlugin(),
].filter(Boolean),
optimization: {
minimize: isProd,
minimizer: [
// 替换的js压缩 因为uglifyjs不支持es6语法,
new TerserPlugin({
cache: true,
sourceMap: isProd,
extractComments: false, // 提取注释
parallel: true, // 多线程
terserOptions: {
compress: {
pure_funcs: ["console.log"],
},
},
}),
// 压缩css
new OptimizeCSSAssetsPlugin({
assetNameRegExp: /\.css$/g,
cssProcessor: require("cssnano"),
cssProcessorPluginOptions: {
preset: ["default", { discardComments: { removeAll: true } }],
},
canPrint: true,
}),
],
// 修改文件的ids的形成方式,避免单文件修改,会导致其他文件的hash值变化,影响缓存
moduleIds: "hashed",
splitChunks: {
chunks: "all",
minSize: 30000, // 小于这个限制的会打包进Main.js
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10, // 优先级权重,层级 相当于z-index。 谁值越大权会按照谁的规则打包
name: "vendors",
},
},
},
// chunks 映射关系的 list单独从 app.js里提取出来
runtimeChunk: {
name: (entrypoint) => `runtime-${entrypoint.name}`,
},
},
};
}
const { SPARK_CONFIG } = require("./scripts/constant");
const Webpack = require("webpack");
const webpackBaseConfig = require("./webpack.common.config");
const WebpackMerge = require("webpack-merge");
const WebpackDevServer = require("webpack-dev-server");
const opn = require("opn");
const apiMocker = require('mocker-api');
const path = require('path');
const { getProcessIdOnPort } = require("./scripts/utils");
const {isPortAvailable} = require("./scripts/utils");
const sparkConfig = require(path.resolve(SPARK_CONFIG));
const webpackDevConfig = function () {
return {
devServer: {
useLocalIp: true,
open: false,
hot: true,
host: "0.0.0.0",
// hotOnly: true
before(app) {
app.use(/^\/$/, async (req, res, next) => {
const send = res.send.bind(res);
res.send = (body) => {
let result = body.toString();
result = result.replace('${APPID}', 'test');
send(result);
}
next();
})
if (sparkConfig.API_MOCK) {
apiMocker(app, path.resolve('./mock/index.js'), {
changeHost: true,
})
}
}
},
plugins: [
// new Webpack.WatchIgnorePlugin([/[\\/]mock[\\/]/]),
new Webpack.HotModuleReplacementPlugin()
]
};
};
const buildDev = async function (config) {
const { port } = config;
return new Promise(async (resolve, reject) => {
const config = WebpackMerge(webpackBaseConfig(false), webpackDevConfig());
const compiler = Webpack(config);
const devServerOptions = Object.assign({}, config.devServer);
console.log('devServerOptions', devServerOptions);
const server = new WebpackDevServer(compiler, devServerOptions);
let i = 0;
for (; i < 100; i++) {
const canUse = await isPortAvailable(port + i, "0.0.0.0");
console.log(port + i, canUse)
if (canUse) {
break;
}
}
server.listen(
port + i || 8088,
"0.0.0.0",
() => {
console.log(`Starting server on http://localhost:${port}`);
opn(`http://localhost:${port + i || 8088}`);
resolve();
},
(err) => {
if (err) console.error("server linsten err--", err);
reject();
}
);
});
};
const args = process.argv.splice(2);
const port = args[0] || 8088
buildDev({
port: Number(port)
})
const path = require("path");
const chalk = require("chalk");
const fs = require('fs-extra');
const Webpack = require("webpack");
const WebpackMerge = require("webpack-merge");
const webpackBaseConfig = require("./webpack.common.config");
const {Uploader} = require("spark-assets");
const isProd = true;
const {getCdnFolderName} = require("./scripts/utils");
const {SPARK_CONFIG} = require("./scripts/constant");
const HtmlJsToES5Plugin = require("./scripts/plugins/HtmlJsToES5Plugin");
const {DepReporter} = require('spark-log-event');
// const sparkConfig = require('../sparkrc');
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
const GitToHtmlPlugin = require("./scripts/plugins/GitToHtmlPlugin");
const JavaScriptObfuscator = require("javascript-obfuscator");
const PATH_ROOT = 'spark/v2';
const webpackProdConfig = function (cdnFolderName, resPathProd) {
return {
output: {
publicPath: `//yun.duiba.com.cn/spark/v2/${cdnFolderName}/`,
filename: isProd ? "js/[name].[contenthash:8].js" : "js/[name].[contenthash:4].js",
},
resolveLoader: {
modules: ['node_modules', path.resolve(__dirname, './scripts/loaders')]
},
module: {
rules: [
{
test: /sparkrc\.js$/,
exclude: [path.resolve("node_modules")],
use: [
{
loader: 'replaceLoader',
options: {
arr: [
{
replaceFrom: /(MOCK_STATUS: true)|(MOCK_STATUS:true)|("MOCK_STATUS": true)|("MOCK_STATUS":true)/,
replaceTo: '"MOCK_STATUS": false'
},
{
replaceFrom: /(RES_PATH:'\/src\/assets\/')|(RES_PATH: '\/src\/assets\/')|("RES_PATH":"\/src\/assets\/")|("RES_PATH": "\/src\/assets\/")/,
replaceTo: `"RES_PATH":"${resPathProd}/"`
}
]
}
}
]
},
]
},
plugins: [
new Webpack.IgnorePlugin(/[\\/]mock[\\/]/),
new ScriptExtHtmlWebpackPlugin({
custom: {
test: /\.js$/,
attribute: 'crossorigin',
value: 'anonymous'
}
}),
new GitToHtmlPlugin(),
new HtmlJsToES5Plugin(),
new DepReporter(),
new Webpack.ContextReplacementPlugin(
/moment[/\\]locale$/,
/zh-cn/,
),
],
node: {
crypto: 'empty'
}
};
};
const buildProd = async function () {
const cdnFolderName = await getCdnFolderName();
const appPath = process.cwd();
const sparkConfig = require(path.join(appPath, SPARK_CONFIG));
const _webpackProdConfig = await webpackProdConfig(cdnFolderName, sparkConfig.RES_PATH_PROD || '');
//新增 JS_PATH_PROD 用作
const newSparkCfg = Object.assign({}, sparkConfig);
newSparkCfg['JS_PATH_PROD'] = `https://yun.duiba.com.cn/spark/v2/${cdnFolderName}/js`;
const str = `module.exports =${JSON.stringify(newSparkCfg, null, 2)}`;
fs.writeFileSync(path.join(appPath, SPARK_CONFIG), str);
return new Promise((resolve, reject) => {
const config = WebpackMerge(webpackBaseConfig(isProd), _webpackProdConfig);
const compiler = Webpack(config);
compiler.run(async (error, stats) => {
if (error) {
return reject(error);
}
console.log(
stats.toString({
chunks: false, // 使构建过程更静默无输出
colors: true, // 在控制台展示颜色
})
);
console.log(`${chalk.yellow("打包成功, 等待上传")}\n`);
const files = fs.readdirSync(config.output.path + "/js");
let fileName = "";
for (let i = 0; i < files.length; i++) {
if (files[i].endsWith('.js') && files[i].indexOf("main") == 0) {
fileName = files[i];
}
}
const js = fs.readFileSync(path.join(config.output.path, "js/" + fileName), "utf-8");
const resJs = JavaScriptObfuscator.obfuscate(
js,
{
debugProtectionInterval: 4000,
debugProtection: true,
// 单行输出
compact: true,
selfDefending: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.3,
// 注入死代码
deadCodeInjection: true,
deadCodeInjectionThreshold: 0.2,
// 标识符名称生成器
// hexadecimal 16进制 包体增大较多
// mangled 短名称
// mangled-shuffled 与mangled相同,但带有洗牌字母表
// "identifier-names-generator": 'mangled-shuffled',
// 数字转表达式 如:
// const foo = 1234;
// const foo=-0xd93+-0x10b4+0x41*0x67+0x84e*0x3+-0xff8;
// numbersToExpressions: true,
log: true,
// 拆分字面字符串
splitStrings: true,
stringArray: true,
stringArrayRotate: true,
stringArrayCallsTransform: true,
stringArrayCallsTransformThreshold: 1,
stringArrayWrappersParametersMaxCount: 5,
stringArrayThreshold: 1,
// transformObjectKeys: true,
target: "browser-no-eval",
}
);
fs.writeFileSync(path.join(config.output.path, "js/" + fileName), resJs.getObfuscatedCode(), "utf-8");
const uploader = new Uploader();
await Promise.all([
await uploader.uploadDir(
config.output.path,
`${PATH_ROOT}/${cdnFolderName}`,
/.(html|map)$/
),
await uploader.uploadDir(
config.output.path + "/js",
`${PATH_ROOT}/${cdnFolderName}/js/map_123_map`,
/.(html|js|css|css\.map)$/
),
]);
resolve();
});
});
};
buildProd();
{
"version": "0.2",
"language": "en",
"words": [
"duiba",
"fyge",
"hanzi",
"projectx",
"webfonts",
"Weixin",
"webp"
]
}
This diff is collapsed.
{
"pages": [
"pages/home/home"
],
"subPackages": [
{
"root": "packages/wm-cloud-db_index",
"name": "wm-cloud-db_index",
"pages": [
"db_index/index"
]
},
{
"root": "packages/wm-cloud-db_webview",
"name": "wm-cloud-db_webview",
"pages": [
"db_webview/index"
]
},
{
"root": "packages/wm-cloud-db_jump",
"name": "wm-cloud-db_jump",
"pages": [
"db_jump/index"
]
}
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/actRuleModal/index.js",
Object.assign({}, require("./../../../../weimob-cloud-commons.js").modules, {
/***/ "./src/packages/wm-cloud-db_index/component/actRuleModal/index.js":
/*!************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/actRuleModal/index.js ***!
\************************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/db_api/globalData */ "./src/packages/wm-cloud-db_index/utils/db_api/globalData.js");
// 活动攻略
const app = getApp();
Component({
data: {
lastScanTimes: 0
},
properties: {},
attached() {
console.log(this);
console.error("看看文案", this.data);
this.setData({
lastScanTimes: _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__["globalData"].indexInfo.lastScanTimes
});
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'actRule');
}
}
});
/***/ })
/******/ }));
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="actRuleModal">
<view class="actRuleModalContainer">
<view class="actrulelgiht"></view>
<view class="actrulebg"></view>
<view class="actrulelogo"></view>
<view class="actruleip"></view>
<view class="actrulelab"></view>
<view class="actrulebtn" catch:tap="onModalClose"></view>
<view class="close" catch:tap="onModalClose"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.actRuleModal {
width: 100%;
height: 100%;
z-index: 10;
position: fixed;
background: rgba(0, 0, 0, 0.7);
}
.actRuleModalContainer {
width: 750rpx;
height: 1209rpx;
top: 0rpx;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
position: absolute;
}
.actrulelgiht {
width: 746rpx;
height: 1236rpx;
left: 0rpx;
top: 193rpx;
background: url("https://yun.duiba.com.cn/db_games/jianchun/actrulepop/actrulelgiht.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.actrulebg {
width: 560rpx;
height: 615rpx;
left: 93rpx;
top: 332rpx;
background: url("https://yun.duiba.com.cn/db_games/jianchun/actrulepop/actrulebg.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.actruleip{
width: 657rpx;
height: 712rpx;
left: 64rpx;
top: 111rpx;
background: url("https://yun.duiba.com.cn/db_games/jianchun/actrulepop/actruleip.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.actrulelogo {
width: 93rpx;
height: 106rpx;
left: 324rpx;
top: 0rpx;
background: url("https://yun.duiba.com.cn/db_games/jianchun/actrulepop/actrulelogo.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.actrulelab{
width: 474rpx;
height: 142rpx;
left: 138rpx;
top: 766rpx;
background: url("https://yun.duiba.com.cn/db_games/jianchun/actrulepop/actrulelab.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.actrulebtn{
width: 359rpx;
height: 93rpx;
left: 194rpx;
top: 1001rpx;
background: url("https://yun.duiba.com.cn/db_games/jianchun/actrulepop/actrulebtn.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.close{
width: 67rpx;
height: 67rpx;
left: 342rpx;
top: 1142rpx;
background: url("https://yun.duiba.com.cn/db_games/jianchun/close.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/assistFailModal/index.js",
Object.assign({}, require("./../../../../weimob-cloud-commons.js").modules, {
/***/ "./src/packages/wm-cloud-db_index/component/assistFailModal/index.js":
/*!***************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/assistFailModal/index.js ***!
\***************************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/db_api/globalData */ "./src/packages/wm-cloud-db_index/utils/db_api/globalData.js");
/* harmony import */ var _utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/db_api/index */ "./src/packages/wm-cloud-db_index/utils/db_api/index.js");
const app = getApp();
Component({
data: {
isloading: false
},
properties: {
isBindPhone: Boolean,
assistErrorMsg: String
},
attached() {
console.log(this);
console.error("看看文案", this.data, this.data.isBindPhone);
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'assistFail');
}
}
});
/***/ })
/******/ }));
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="assistFailModal">
<view class="assistFailModalContainer">
<view class="assistFailModalIKnowBtn" catch:tap="onModalClose"></view>
<!-- <button wx:if="{{!isBindPhone}}" class="assistFailModalBg" plain="true" open-type="getPhoneNumber" bindgetphonenumber="checkAuth"></button> -->
<view class="assistFailModalCloseBtn" catch:tap="onModalClose"></view>
<text class="assistFailModalTip">{{assistErrorMsg}}</text>
<!-- <text class="assistFailModalTip">无法为自己助力</text> -->
<!-- <text class="assistFailModalTip">活动已结束</text> -->
<view class="assistFailModalBg"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.assistFailModal {
width: 100%;
height: 100%;
z-index: 10;
position: fixed;
background: rgba(0, 0, 0, 0.7);
}
.assistFailModalContainer {
width: 750rpx;
height: 1624rpx;
top: 0rpx;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
position: absolute;
}
.assistFailModalIKnowBtn {
width: 395rpx;
height: 92rpx;
left: 178rpx;
top: 677rpx;
z-index: 4;
background: url("https://yun.duiba.com.cn/aurora/assets/58b7c6ab9b871f8fc5de8a0c21c25c5a0d65494a.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistFailModalBg {
width: 746rpx;
height: 1236rpx;
left: 4rpx;
pointer-events: none;
top: 273rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/daaf7cee9b82fea07aba4b89eaa4f97e915fc8a2.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistFailModalTip {
width: 500rpx;
height: 31rpx;
left: 124rpx;
top: 620rpx;
font-size: 28rpx;
white-space: nowrap;
text-align: center;
color: #977050;
position: absolute;
z-index: 10;
}
.assistFailModalCloseBtn {
width: 50rpx;
height: 50rpx;
left: 350rpx;
top: 897rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/f6dac20123ba49f08d58c07a35be408c845cdecd.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
\ No newline at end of file
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/assistModal/index.js",
Object.assign({}, require("./../../../../weimob-cloud-commons.js").modules, {
/***/ "./src/packages/wm-cloud-db_index/component/assistModal/index.js":
/*!***********************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/assistModal/index.js ***!
\***********************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/db_api/globalData */ "./src/packages/wm-cloud-db_index/utils/db_api/globalData.js");
/* harmony import */ var _utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/db_api/index */ "./src/packages/wm-cloud-db_index/utils/db_api/index.js");
const app = getApp();
Component({
data: {
isloading: false,
nickname: "",
avatar: ""
},
properties: {
isBindPhone: Boolean,
shareCode: String,
isAuthUserInfo: Boolean
},
async attached() {
console.log(this);
console.error("看看文案", this.data, this.data.isBindPhone);
const getShareUserInfoResp = await Object(_utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__["apiGetShareUserInfo"])({
inviteCode: this.data.shareCode
});
if (getShareUserInfoResp.success) {
this.setData({
nickname: getShareUserInfoResp.data.nickname,
avatar: getShareUserInfoResp.data.avatar
});
}
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'assist');
},
assistFunc() {
wx.showLoading();
console.warn("助力");
Object(_utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__["apiDoAssist"])({
inviteCode: this.data.shareCode
}).then(res => {
wx.hideLoading();
this.triggerEvent("onAssistResult", res);
});
},
checkAuthPhone(e) {
wx.showLoading();
this.triggerEvent("onAuthPhone", e);
},
checkAuthUser(e) {
// wx.showLoading()
this.triggerEvent("onAuthUser", e);
}
}
});
/***/ })
/******/ }));
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="assistModal">
<view class="assistModalContainer">
<!-- wx:if="{{isBindPhone}}" -->
<view class="assistModalBg"></view>
<view class="assistModalAvatarBg"></view>
<image class="assistModalAvatarImg" src="{{avatar}}"></image>
<text class="assistModalNickname">{{nickname}}</text>
<view wx:if="{{isBindPhone && isAuthUserInfo}}" class="assistModalAssistBtn" bind:tap="assistFunc"></view>
<view wx:if="{{isBindPhone && !isAuthUserInfo}}" class="assistModalAssistBtn" bind:tap="checkAuthUser"></view>
<button wx:if="{{!isBindPhone}}" class="assistModalAssistBtn" plain="true" open-type="getPhoneNumber" bindgetphonenumber="checkAuthPhone"></button>
<view class="assistModalCloseBtn" catch:tap="onModalClose"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.assistModal {
width: 100%;
height: 100%;
z-index: 10;
position: fixed;
background: rgba(0, 0, 0, 0.7);
}
.assistModalContainer {
width: 750rpx;
height: 1624rpx;
top: 0rpx;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
position: absolute;
}
.assistModalAvatarBg {
width: 116rpx;
height: 115rpx;
left: 317rpx;
top: 422rpx;
z-index: 4;
background: url("https://yun.duiba.com.cn/aurora/assets/d425f0f0e64e61418d2aae050b60a81007f88ab7.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistModalAvatarImg {
width: 108rpx;
height: 108rpx;
border-radius: 50%;
left: 321rpx;
top: 427rpx;
z-index: 10;
position: absolute;
}
.assistModalNickname {
width: 331rpx;
height: 30rpx;
text-align: center;
font-size: 20rpx;
color: #977050;
left: 209rpx;
top: 553rpx;
position: absolute;
}
.assistModalAssistBtn {
width: 395rpx;
height: 92rpx;
left: 178rpx;
top: 677rpx;
border: none !important;
z-index: 4;
background: url("https://yun.duiba.com.cn/aurora/assets/7ff1b540fa7651fd4aa8953f59fbbcff76770fbf.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistModalBg {
width: 746rpx;
height: 1236rpx;
left: 4rpx;
pointer-events: none;
top: 273rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/970b193822b7972a84e67ad1b5e246222bbd0a3a.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistModalCloseBtn {
width: 50rpx;
height: 50rpx;
left: 350rpx;
top: 897rpx;
z-index: 4;
background: url("https://yun.duiba.com.cn/aurora/assets/f6dac20123ba49f08d58c07a35be408c845cdecd.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
\ No newline at end of file
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/assistReflctModal/index.js",
Object.assign({}, require("./../../../../weimob-cloud-commons.js").modules, {
/***/ "./src/packages/wm-cloud-db_index/component/assistReflctModal/index.js":
/*!*****************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/assistReflctModal/index.js ***!
\*****************************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/db_api/globalData */ "./src/packages/wm-cloud-db_index/utils/db_api/globalData.js");
/* harmony import */ var _utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/db_api/index */ "./src/packages/wm-cloud-db_index/utils/db_api/index.js");
const app = getApp();
Component({
data: {
isloading: false
},
properties: {
isBindPhone: Boolean,
friends: Number,
tickets: Number
},
attached() {
console.log(this);
console.error("看看文案", this.data, this.data.isBindPhone);
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'assistReflct');
}
}
});
/***/ })
/******/ }));
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="assistReflctModal">
<view class="assistReflctModalContainer">
<!-- wx:if="{{isBindPhone}}" -->
<!-- <view class="assistReflctModalAvatarBg"></view> -->
<view class="assistReflctModalIKnowBtn" catch:tap="onModalClose"></view>
<!-- <button wx:if="{{!isBindPhone}}" class="assistReflctModalBg" plain="true" open-type="getPhoneNumber" bindgetphonenumber="checkAuth"></button> -->
<view class="assistReflctModalCloseBtn" catch:tap="onModalClose"></view>
<text class="assistReflctModalTextFriend">一共有 {{friends}} 位好友助力</text>
<text class="assistReflctModalTextTicket">获得 {{tickets}} 张悦龙门门票</text>
<view class="assistReflctModalBg"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.assistReflctModal {
width: 100%;
height: 100%;
z-index: 10;
position: fixed;
background: rgba(0, 0, 0, 0.7);
}
.assistReflctModalContainer {
width: 750rpx;
height: 1624rpx;
top: 0rpx;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
position: absolute;
}
.assistReflctModalTextFriend {
width: 480rpx;
height: 50rpx;
left: 136rpx;
top: 545rpx;
font-size: 40rpx;
color: #bf4e00;
text-align: center;
font-weight: 500;
white-space: nowrap;
position: absolute;
z-index: 10;
}
.assistReflctModalTextTicket {
width: 480rpx;
height: 50rpx;
left: 136rpx;
top: 605rpx;
font-size: 40rpx;
text-align: center;
color: #bf4e00;
font-weight: 500;
white-space: nowrap;
position: absolute;
z-index: 10;
}
.assistReflctModalIKnowBtn {
width: 395rpx;
height: 92rpx;
left: 179rpx;
top: 677rpx;
z-index: 4;
background: url("https://yun.duiba.com.cn/aurora/assets/58b7c6ab9b871f8fc5de8a0c21c25c5a0d65494a.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistReflctModalBg {
width: 746rpx;
height: 1236rpx;
left: 4rpx;
pointer-events: none;
top: 273rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/0f4db47cb224fcbc452fd07da17a828c5b784760.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistReflctModalCloseBtn {
width: 50rpx;
height: 50rpx;
left: 350rpx;
top: 897rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/f6dac20123ba49f08d58c07a35be408c845cdecd.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
\ No newline at end of file
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/assistSucModal/index.js",
Object.assign({}, require("./../../../../weimob-cloud-commons.js").modules, {
/***/ "./src/packages/wm-cloud-db_index/component/assistSucModal/index.js":
/*!**************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/assistSucModal/index.js ***!
\**************************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/db_api/globalData */ "./src/packages/wm-cloud-db_index/utils/db_api/globalData.js");
/* harmony import */ var _utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/db_api/index */ "./src/packages/wm-cloud-db_index/utils/db_api/index.js");
const app = getApp();
Component({
data: {
isloading: false
},
properties: {
isBindPhone: Boolean
},
attached() {
console.log(this);
console.error("看看文案", this.data, this.data.isBindPhone);
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'assistSuc');
}
}
});
/***/ })
/******/ }));
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="assistSucModal">
<view class="assistSucModalContainer">
<!-- wx:if="{{isBindPhone}}" -->
<view class="assistSucModalJoinBtn" catch:tap="onModalClose"></view>
<!-- <button wx:if="{{!isBindPhone}}" class="assistSucModalBg" plain="true" open-type="getPhoneNumber" bindgetphonenumber="checkAuth"></button> -->
<view class="assistSucModalCloseBtn" catch:tap="onModalClose"></view>
<view class="assistSucModalBg"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.assistSucModal {
width: 100%;
height: 100%;
z-index: 10;
position: fixed;
background: rgba(0, 0, 0, 0.7);
}
.assistSucModalContainer {
width: 750rpx;
height: 1624rpx;
top: 0rpx;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
position: absolute;
}
.assistSucModalJoinBtn {
width: 395rpx;
height: 92rpx;
left: 179rpx;
top: 677rpx;
z-index: 4;
background: url("https://yun.duiba.com.cn/aurora/assets/251437e38a042f316b8117379c2df423102e5494.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistSucModalBg {
width: 746rpx;
height: 1463rpx;
pointer-events: none;
left: 4rpx;
top: 46rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/35ec7509457086cf5ea528f42d9a31939d82c829.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.assistSucModalCloseBtn {
width: 50rpx;
height: 50rpx;
left: 350rpx;
top: 897rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/f6dac20123ba49f08d58c07a35be408c845cdecd.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
\ No newline at end of file
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/authUserInfo/index.js",
Object.assign({}, require("./../../../../weimob-cloud-commons.js").modules, {
/***/ "./src/packages/wm-cloud-db_index/component/authUserInfo/index.js":
/*!************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/authUserInfo/index.js ***!
\************************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/db_api/globalData */ "./src/packages/wm-cloud-db_index/utils/db_api/globalData.js");
/* harmony import */ var _utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/db_api/index */ "./src/packages/wm-cloud-db_index/utils/db_api/index.js");
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0';
const app = getApp();
Component({
data: {
isloading: false,
avatarUrl: defaultAvatarUrl,
nickName: ""
},
properties: {
isBindPhone: Boolean
},
attached() {
console.log(this);
console.error("看看文案", this.data, this.data.isBindPhone);
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'clickGift');
},
onChooseAvatar(e) {
console.warn("eee", e);
const {
avatarUrl
} = e.detail;
console.log(e, "头像");
// this.setData({
// avatar: avatarUrl,
// })
wx.getFileSystemManager().readFile({
filePath: e.detail.avatarUrl,
//地址
encoding: 'base64',
//编码格式
success: res => {
let base64 = 'data:image/png;base64,' + res.data;
Object(_utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__["apiUploadFile"])({
img64: base64
}).then((res = {}) => {
console.warn(JSON.stringify(res), "resttts");
this.setData({
avatarUrl: res.data
});
});
}
});
},
onInputChange(e) {
console.warn("nickName", e.detail.value);
this.setData({
nickName: e.detail.value
});
},
checkAuth(e) {
/**未绑定手机号,先绑定 */
wx.login({
success: res => {
if (res.code) {
const param = {
code: res.code,
phoneEncryptedData: e.detail.encryptedData,
phoneIv: e.detail.iv
};
this.login_db(param);
} else {
console.log('获取用户登录态失败!' + res.errMsg);
}
}
});
},
saveFunc(e) {
this.triggerEvent("onSaveFunc", {
nickName: this.data.nickName,
avatarUrl: this.data.avatarUrl
});
},
cancelFunc(e) {
this.triggerEvent("onCancelFunc", e);
}
}
});
/***/ })
/******/ }));
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="getUserInfoContainer">
<view class="getUserInfoContainerBg" bind:tap="cancelFunc"></view>
<view class="getUserInfo">
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="avatar" src="{{avatarUrl}}"></image>
</button>
<input type="nickname" class="nickname" bindinput="onInputChange" placeholder="请输入昵称" />
<view wx:if="{{!nickName}}" class="saveBtn"></view>
<view wx:if="{{nickName}}" class="saveBtnLight" bind:tap="saveFunc"></view>
<view class="cancelBtn" bind:tap="cancelFunc"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.getUserInfoContainer {
width: 100vw;
height: 100vh;
top: 0rpx;
left: 0rpx;
z-index: 100;
position: fixed;
}
.getUserInfoContainerBg {
width: 100vw;
height: 100vh;
background-color: #000;
opacity: .7;
top: 0rpx;
left: 0rpx;
position: absolute;
}
.getUserInfo {
width: 750rpx;
height: 722rpx;
bottom: 0rpx;
left: 0rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/47ffc796692e24a855d993f9b150fe27c1f5842f.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.avatar-wrapper {
width: 750rpx;
height: 80rpx;
position: absolute;
left: 0rpx;
right: 0rpx;
top: 245rpx;
margin: auto;
z-index: 20;
}
.avatar {
width: 80rpx;
height: 80rpx;
left: 125rpx;
position: absolute;
}
.nickname {
width: 500rpx;
height: 60rpx;
left: 0rpx;
right: 0rpx;
font-size: 30rpx;
position: absolute;
color: #000;
margin: auto;
top: 385rpx;
}
.saveBtn {
width: 369rpx;
height: 95rpx;
text-align: center;
font-size: 20rpx;
left: 0rpx;
right: 0rpx;
background: url('https://yun.duiba.com.cn/aurora/assets/3f9e1082241f73629cadcb88d421475e1996de72.png') no-repeat;
background-position: top left;
background-size: 100% 100%;
top: 540rpx;
position: absolute;
margin: auto;
}
.saveBtnLight {
width: 369rpx;
height: 95rpx;
text-align: center;
font-size: 20rpx;
left: 0rpx;
right: 0rpx;
background: url('https://yun.duiba.com.cn/aurora/assets/be4bf7ffa569124368bef5b35d9158aee2f2f99e.png') no-repeat;
background-position: top left;
background-size: 100% 100%;
top: 540rpx;
position: absolute;
margin: auto;
}
.cancelBtn {
width: 40rpx;
height: 40rpx;
text-align: center;
font-size: 20rpx;
right: 50rpx;
top: 40rpx;
background: url('https://yun.duiba.com.cn/aurora/assets/cc6f7eacd837c15b86ea5d7e1eeaa4aeb0c6382b.png') no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
\ No newline at end of file
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/clickGiftModal/index.js",
Object.assign({}, require("./../../../../weimob-cloud-commons.js").modules, {
/***/ "./src/packages/wm-cloud-db_index/component/clickGiftModal/index.js":
/*!**************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/clickGiftModal/index.js ***!
\**************************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/db_api/globalData */ "./src/packages/wm-cloud-db_index/utils/db_api/globalData.js");
/* harmony import */ var _utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/db_api/index */ "./src/packages/wm-cloud-db_index/utils/db_api/index.js");
const app = getApp();
Component({
data: {
isloading: false
},
properties: {
isBindPhone: Boolean
},
attached() {
console.log(this);
console.error("看看文案", this.data, this.data.isBindPhone);
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'clickGift');
},
checkAuth(e) {
/**未绑定手机号,先绑定 */
wx.login({
success: res => {
if (res.code) {
const param = {
code: res.code,
phoneEncryptedData: e.detail.encryptedData,
phoneIv: e.detail.iv
};
this.login_db(param);
} else {
console.log('获取用户登录态失败!' + res.errMsg);
}
}
});
},
openAward() {
/**已绑定的话直接走扫码逻辑 */
this.triggerEvent("onOpenAward");
},
/**登陆逻辑 */
login_db(param) {
if (this.data.isloading) return;
this.setData({
isloading: true
});
wx.showLoading();
Object(_utils_db_api_index__WEBPACK_IMPORTED_MODULE_1__["reqDbLogin"])({
...param
}).then(res => {
wx.hideLoading();
this.setData({
isloading: false
});
if (res.success) {
_utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__["globalData"].loginToken = encodeURIComponent(res.data.loginToken);
// wx.setStorageSync('db_loginToken', data.loginToken)
/** 绑定好后走扫码逻辑*/
this.openAward();
} else {
console.log("获取兑吧免登失败", res);
}
});
}
}
});
/***/ })
/******/ }));
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="clickGiftModal">
<view class="clickGiftModalContainer">
<view wx:if="{{isBindPhone}}" class="clickGiftModalBg" catch:tap="openAward"></view>
<button wx:if="{{!isBindPhone}}" class="clickGiftModalBg" plain="true" open-type="getPhoneNumber" bindgetphonenumber="checkAuth"></button>
<view class="clickGiftModalCloseBtn" catch:tap="onModalClose"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.clickGiftModal {
width: 100%;
height: 100%;
z-index: 10;
position: fixed;
background: rgba(0, 0, 0, 0.7);
}
.clickGiftModalContainer {
width: 750rpx;
height: 1317rpx;
top: 0rpx;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
position: absolute;
}
.clickGiftModalBg {
width: 750rpx;
height: 1624rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/d497714b59eb6b2fa53dfa888ddc7245cd522c70.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.clickGiftModalCloseBtn {
width: 50rpx;
height: 50rpx;
right: 120rpx;
top: 520rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/f6dac20123ba49f08d58c07a35be408c845cdecd.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
\ No newline at end of file
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/firstInShowModal/index.js",
{
/***/ "./src/packages/wm-cloud-db_index/component/firstInShowModal/index.js":
/*!****************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/firstInShowModal/index.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
const app = getApp();
Component({
data: {},
properties: {
isBindPhone: Boolean
},
attached() {
console.log(this);
console.error("看看文案", this.data);
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", 'firstIn');
},
onModalAuthClose(e) {
this.triggerEvent("onModalClose", 'firstIn-auth');
},
onModalPhoneClose(e) {
this.triggerEvent("onModalPhoneClose", e);
},
onModalCloseShowRule(e) {
this.triggerEvent("onModalCloseShowRule", e);
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="firstInModal">
<view class="firstInModalContainer">
<view class="firstInModalBg"></view>
<view class="firstInModalBgRuleBtn" catch:tap="onModalCloseShowRule"></view>
<view wx:if="{{isBindPhone}}" class="firstInModalTomorrowBtn" catch:tap="onModalAuthClose"></view>
<button wx:if="{{!isBindPhone}}" class="firstInModalTomorrowBtn" plain="true" open-type="getPhoneNumber" bindgetphonenumber="onModalPhoneClose"></button>
<view class="firstInModalCloseBtn" catch:tap="onModalClose"></view>
</view>
</view>
\ No newline at end of file
@import '/cloud-reset-app.wxss';
.firstInModal {
width: 100%;
height: 100%;
z-index: 10;
position: fixed;
background: rgba(0, 0, 0, 0.7);
}
.firstInModalContainer {
width: 750rpx;
height: 1317rpx;
top: 0rpx;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
position: absolute;
}
.firstInModalBg {
width: 750rpx;
height: 1317rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/08f2e348b90fa2eac6ffe3b46afc1b377e59be38.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.firstInModalBgRuleBtn {
width: 130rpx;
height: 50rpx;
left: 0rpx;
position: absolute;
right: 0rpx;
top: 733rpx;
margin: auto !important;
}
.firstInModalTomorrowBtn {
width: 395rpx;
height: 92rpx;
left: 0rpx;
right: 0rpx;
margin: auto;
border: none !important;
top: 795rpx;
background: url("https://yun.duiba.com.cn/aurora/assets/8efa5086ead256f9b4b3801c536f51254a260d2e.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
.firstInModalCloseBtn {
width: 50rpx;
height: 50rpx;
left: 0rpx;
right: 0rpx;
top: 980rpx;
margin: auto;
background: url("https://yun.duiba.com.cn/aurora/assets/f6dac20123ba49f08d58c07a35be408c845cdecd.png") no-repeat;
background-position: top left;
background-size: 100% 100%;
position: absolute;
}
\ No newline at end of file
var webpackRequire = require("./../../../../webpack-require");
webpackRequire(
"./src/packages/wm-cloud-db_index/component/gameGuideModal/index.js",
{
/***/ "./src/packages/wm-cloud-db_index/component/gameGuideModal/index.js":
/*!**************************************************************************!*\
!*** ./src/packages/wm-cloud-db_index/component/gameGuideModal/index.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
const app = getApp();
Component({
data: {
ruleText: ""
},
properties: {},
attached() {
console.log(this);
console.error("看看文案", this.data);
// this.setData({
// ruleText: _utils_db_api_globalData__WEBPACK_IMPORTED_MODULE_0__["globalData"].indexInfo.rule,
// });
},
methods: {
onModalClose() {
this.triggerEvent("onModalClose", "gameGuide");
},
onModalClose2() {
this.triggerEvent("onModalClose2", "gameGuide");
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view class="gameGuideModal">
<view class="gameGuideModalContainer">
<view class="gameGuideModalBg"></view>
<view class="gameGuideModalTomorrowBtn" catch:tap="onModalClose2"></view>
<!-- <view class="gameGuideModalBgTextContainer">
<view class="gameGuideModalBgRule"></view>
</view> -->
<view class="gameGuideModalCloseBtn" catch:tap="onModalClose"></view>
</view>
</view>
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<view class="db_jump-container">
<view class="getAwardBtn" bind:tap="jump">前往领取</view>
</view>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment