Commit b15584ee authored by haiyoucuv's avatar haiyoucuv

init

parents
# 顶部的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',
},
},
],
};
.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/
dist/
!dist/index.html
\ 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';
import { logClick, logExposure } from "@spark/utils/src-js/md";
let appId = CFG.appID;
const dcm = '202.' + CFG.projectId + '.0.0';
const domain = '//embedlog.duiba.com.cn';
const dom = `${CFG.channel}.0.0.0`;
const MDList = new Array(52).fill("").map((v, i) => {
return {
ele: `.md${i + 1}`,
data: {
dpm: `${appId}.110.${i + 1}.1`,
dcm,
domain,
appId,
dom,
},
once: false,
};
});
export default () =>
MD({
show: MDList, // 曝光
click: MDList // 点击
});
export function handleLogExposure(id, id2 = 1) {
logExposure({
dpm: `${appId}.110.${id}.${id2}`,
dcm,
domain,
appId,
dom,
});
}
export function handleLogClick(id, id2 = 1) {
logClick({
dpm: `${appId}.110.${id}.${id2}`,
dcm,
domain,
appId,
dom,
});
}
### 注意事项
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: /noRem/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"
]
}
{
"compilerOptions": {
"experimentalDecorators": true,
"baseUrl": "./",
"paths": {
"@src/*": ["src/*"]
}
},
"exclude": [
"node_modules"
]
}
\ No newline at end of file
{"numOfComponents":5048,"numOfProject":5162}
\ No newline at end of file
const {AES, enc, mode, pad} = require("crypto-js");
const getOptions = (iv) => {
return {
iv: enc.Utf8.parse(iv),
mode: mode.CBC,
padding: pad.ZeroPadding,
};
}
/** 加密 */
exports.AESEncrypt = (str, key, iv) => {
const options = getOptions(iv);
return AES.encrypt(str, enc.Utf8.parse(key), options).toString();
};
/** 解密 */
exports.AESDecrypt = (cipherText, key, iv) => {
const options = getOptions(iv);
return AES.decrypt(cipherText, enc.Utf8.parse(key), options)
.toString(enc.Utf8)
.trim()
.replace(//g, '')
.replace(//g, '')
.replace(/\v/g, '')
.replace(/\x00/g, '');
};
module.exports = {
"code": 200,
"data": "consectetur Excepteur occaecat tempor",
"message": "sint minim magna est mollit",
"status": true
}
\ No newline at end of file
module.exports = {
"success": true,
"message": "报错了~",
"code": null,
"data": {
"test_config_01": "前端配置项测试",
"test_config_03": null,
"test_config_02": "111",
"shareInfo": {
"title": "许愿迎新春",
"content": "参与活动生成你的专属烟花吧~",
"thumbnail": "https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg",
"imgUrl": "https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg"
},
"shareInfoZan": {
"title": "许愿迎新春",
"content": "参与活动生成你的专属烟花吧~",
"thumbnail": "https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg",
"imgUrl": "https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg"
},
"shareInfoInvite": {
"title": "许愿迎新春",
"content": "参与活动生成你的专属烟花吧~",
"thumbnail": "https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg",
"imgUrl": "https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg"
},
"Url": "https://lifeapp-test.picclife.cn/portal-web/app_manager/downloadapps.html?operate_link=https%3A%2F%2Flifeapp-api-test.picclife.cn%2Flifeapi%2Flifeapp-svc-rel-gw%2Fapi%2Fauth_code%2Fauthorize%2Fv1%3Factivity_code%3D6130%26redirect_type%3D0%26redirect_uri%3Dhttps%253A%252F%252F96094.activity-19.m.duiba.com.cn%252FcustomShare%252Fshare%253Fid%253DDid1NTk5NTk&isBindManager=1&isNeedAuth=1",
"SaleManUrl":"http://activity.m.duibatest.com.cn/projectx/pd2a9a8c1/index.html?appID=19487",
}
};
\ No newline at end of file
module.exports = {
"code": 200,
"data": "veniam Duis est consectetur",
"message": "esse quis dolore sed laborum",
"success": true
}
\ No newline at end of file
module.exports = {
"data": 3,
"success": true
}
\ No newline at end of file
module.exports = {
"code": 200,
"data": {
"totalCount": 63423987.750740975,
"currentPage": 11314315.075550228,
"totalPage": -36371444.33874133,
"record": [
{
"worksNum": "in Duis culpa reprehenderit",
"worksImg": "ut id",
"worksDesc": "proident reprehenderit sed quis",
"uploadTime": 99647971.65115526,
"worksTitle": "ex cupidatat ullamco magna",
"sex": "consequat voluptate deserunt sed minim"
},
{
"worksNum": "ad",
"worksImg": "sed eu",
"worksDesc": "ea Duis",
"uploadTime": 15444091.361747697,
"worksTitle": "tempor Lorem do officia irure",
"sex": "ut laboris sed do"
},
{
"worksNum": "ipsum consequat",
"worksImg": "nulla ut nisi",
"worksDesc": "et quis laboris",
"uploadTime": 69808334.32919586,
"worksTitle": "voluptate quis irure sunt",
"sex": "Lorem cillum quis consequat Duis"
}
]
},
"message": "qui consequat esse in fugiat",
"success": true
}
\ No newline at end of file
module.exports = {
"code": 200,
"data": "in dolore consequat",
"message": "ea",
"success": true
}
\ No newline at end of file
module.exports = {
"code": 200,
"data": {
"worksInfo": {
"status": 0,
"worksNum": "123123",
"worksTitle": "Duis",
"sex": "in ex commodo sit aute",
"worksImg": "aliqua sed irure",
"worksDesc": "magna ut ipsum incididunt",
"rankIndex": "-1"
},
"rankPrizeInfo": [
{
"prizeName": "officia laboris ex",
"prizeImg": "quis in ut",
"ranking": "aliqua"
},
{
"prizeName": "officia laboris ex",
"prizeImg": "quis in ut",
"ranking": "aliqua"
},
{
"prizeName": "in voluptate",
"prizeImg": "Duis cillum",
"ranking": "cupidatat dolore"
},
{
"prizeName": "voluptate eiusmod esse velit Lorem",
"prizeImg": "esse Duis tempor",
"ranking": "aliquip in"
}
],
"remainThumbsTimes": 9999,
"openTime": 40255347.05613828,
"currentTime": -59725751.158325166,
"rankInfos": [
{rank: 1, sex: "1", thumbsNum: 7, worksDesc: "过去的岁月勇敢的挑战自我,去体验,去挑战,我就是了不起的自己!"},
{rank: 2, sex: "2", thumbsNum: 6, worksDesc: "过去的岁月勇敢的挑战自我,去体验,去挑战,我就是了不起的自己!"},
{rank: 3, sex: "1", thumbsNum: 5, worksDesc: "过去的岁月勇敢的挑战自我,去体验,去挑战,我就是了不起的自己!"},
{rank: 4, sex: "2", thumbsNum: 4, worksDesc: "过去的岁月勇敢的挑战自我,去体验,去挑战,我就是了不起的自己!"},
],
"maxAwardRank": -22713682.647017077
},
"message": "enim mollit deserunt",
"success": true
};
\ No newline at end of file
module.exports = {
"data": "<p>以下是游戏规则:手速要快,点击红包雨。。333。。。。。。。。。。。。。。。。。。。。11111111111111sadasdadadsad5555555557777777777799999999999911111111111111111111111222222222222222222222222222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333333311111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333331111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333333333333</p>",
"success": true
}
\ No newline at end of file
module.exports = {
"code": 200,
"data": {
"prizeName": "voluptate quis",
"productInfos": [
{
"productImg": "anim exercitation enim",
"productText": "cillum sit proident anim in"
},
{
"productImg": "id",
"productText": "do Excepteur amet minim veniam"
}
],
"prizeId": "thanks",
"prizeImg": "elit dolor nisi aliqua"
},
"message": "ad",
"success": true
}
\ No newline at end of file
module.exports = {
"code": 200,
"data": {
"agreeFlag": false,
"ruleGuidePopFlag": false,
"examinePop": {
"needPop": false,
"result": true,
"sendDrawNum": -30112326
},
"rankPop": {
"needPop": false,
"result": true,
"prizeName": "sit minim dolore",
"rank": -76350536.98477012,
"prizeImg": "in amet"
},
"uid": "123123123",
"actStartTime": Date.now() - 10000,
"currentTime": Date.now(),
"actEndTime": Date.now() + 100000,
"guideFlag": true,
"ruleText": "cupidatat",
"showAgentIcon": true,
"agreeText": "ullamco ipsum cupidatat nulla Duis",
"agentCode": null,
"boundYkCode": "fugiat ex",
"agent": false,
"vaildUid": true,
awardDesc: "好久啊上课的话就撒撒点话费"
},
"message": "veniam",
"success": true
};
\ No newline at end of file
module.exports = {
"code": 200,
"data": "cillum",
"message": "amet ut occaecat ullamco",
"success": true,
}
\ No newline at end of file
const rule = require("./common/rule");
const drawNum = require("./common/drawNum");
const coopFrontVariable = require("./common/coopFrontVariable");
const coopSendCode = require("./common/coopSendCode");
const coopCheckCode = require("./common/coopCheckCode");
const saveOrUpdateWork = require("./common/saveOrUpdateWork");
const salesManIndex = require("./common/salesManIndex");
const examineIndex = require("./common/examineIndex");
const lockAgree = require("./common/lockAgree");
const productSearch = require("./common/productSearch");
const saleDraw = require("./common/saleDraw");
const {AESEncrypt} = require("./Crypto");
const proxy = {
...require("./project"),
"GET /projectRule.query": rule,
"GET /drawNum.query": drawNum,
"GET /coop_frontVariable.query": coopFrontVariable,
"POST /examine/coop_sendCode.do": coopSendCode,
"POST /examine/coop_checkCode.do": coopCheckCode,
"POST /works/saveOrUpdateWork.do": saveOrUpdateWork,
"GET /works/index.do": salesManIndex,
"POST /examine/examineIndex.do": examineIndex,
"GET /works/lockAgree.do": lockAgree,
"GET /works/productSearch.do": productSearch,
"GET /works/draw.do":saleDraw,
// 图片上传
"POST /customActivity/duiba/imgUploadUrl": {
code: null,
data: "//yun.duiba.com.cn/upload/20240627/ad414a55.png",
success: true,
desc: "sdgdfhbdfhbgdf",
timestamp: 1719456693066,
},
"GET /spring/start.do": {
"code": "code",
"success": true,
"message": "message",
"timeStamp": Date.now(),
"data": AESEncrypt(JSON.stringify({
"startId": "officia",
"countDown": 30
}), "1696BD3E5BB915A0", "cDOiBC1n2QrkAY2P"),
},
};
module.exports = proxy;
module.exports = {
"/customActivity/piccLife/check": {
"code": "ut",
"data": {
"bind": true, // 是否绑定,为true是
"url": "http://localhost:8089/", // 免登链接
"url": null
},
"desc": "sit magna",
"success": true,
"timestamp": -84973885.23733975
},
"/customActivity/piccLife/sendSmsCode": {
"code": "0900101",
"desc": "nostrud aliqua irure dolore mollit",
"success": true,
"timestamp": -15469760.648778364
},
"/customActivity/piccLife/bindWithCode": {
"code": "est quis nostrud esse",
"data": "aute", // 免登链接
"desc": "minim",
"success": true,
"timestamp": -35269541.090369485
},
"/inviteAssist_1/outside.do": {
"success": true,
"code": "est",
"message": "mollit",
"data": {
"actStartTimestamp": 64844732.27800217,
"actEndTimestamp": 98617892.73875144,
"currentTimestamp": 23618881.683875963,
"uid": "nisi",
"validUid": false,
"boundYkCode": "officia commodo"
}
}
}
module.exports = {
"GET /draw/index.do": {
"success": true,
"message": "报错了~",
"code": null,
timeStamp: Date.now(),
"data": {
"remainDrawTimes": 1, // 抽奖次数
"carouselVos": new Array(10).fill().map((_, index) => {
return {
"escapePhone": `132****211${index}`, // 轮播手机号
"prizeName": `奖品名称奖品名称奖品名称${index}`, // 奖品名称
"time": +new Date() - index * 24 * 60 * 60 * 1000, // 获得时间,13位时间戳
};
}),
"prizeVOs": [
{
prizeName: `奖品名称奖品名称奖品名称奖品名称1`,
prizeImg: `//yun.duiba.com.cn/polaris/jinmoqiang.9e5bbc004f69ab6a3f34d93daeda028616a9f00d.png`,
prizeId: `thanks1`,
},
{
prizeName: `奖品名称2`,
prizeImg: `//yun.duiba.com.cn/polaris/kouzhao.dc55dac6db1ff94c4666c2602d6cb0ac84139982.png`,
prizeId: `thanks2`,
},
{
prizeName: `奖品名称3`,
prizeImg: `//yun.duiba.com.cn/polaris/mac.fe55aa43e5a231d568973dcdd0b91e0263d5a12c.png`,
prizeId: `thanks3`,
},
{
prizeName: `奖品名称4`,
prizeImg: `//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png`,
prizeId: `thanks4`,
},
{
prizeName: `奖品名称5`,
prizeImg: `//yun.duiba.com.cn/polaris/qq.73ad13cd0c6fd705327d12957c12e9d5b2e77baa.png`,
prizeId: `thanks5`,
},
{
prizeName: `奖品名称6`,
prizeImg: `//yun.duiba.com.cn/polaris/xx.e2f6a49a2954673d16d956d7b3bba25c2b6c667e.png`,
prizeId: `thanks6`,
},
{
prizeName: `奖品名称7`,
prizeImg: `//yun.duiba.com.cn/polaris/xx.e2f6a49a2954673d16d956d7b3bba25c2b6c667e.png`,
prizeId: `thanks7`,
},
{
prizeName: `谢谢参与`,
prizeImg: `https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg`,
prizeId: `thanks`,
},
]
}
},
"GET /draw/doDraw.do": {
"code": null,
"data": {
"prizeId": 1,
"productInfos": {
"productId": "1",
"productInfos": [{
"productImg": "//yun.duiba.com.cn/polaris/1.7e95eb40b81b5b15997565f27d7ba22283010265.png",
"productText": "养老专属年龄广,裕享岁月财富长,三五交费投入短,保障期间随心选。"
}, {
"productImg": "//yun.duiba.com.cn/polaris/%E7%BB%84%2093704.1121f8d0e44dee56fbe1d8aa8cabad8312036c55.png",
"productText": "养老年金固定领,满期给付有保障,搭配万能好运作,岁岁丰裕金满堂。"
}]
}
},
"message": null,
"success": true,
"timeStamp": 1739176246085
},
};
\ No newline at end of file
const fs = require('fs')
let proxy = {}
fs.readdirSync(__dirname)
.some(filename => {
if (filename !== 'index.js') {
proxy = Object.assign(proxy, require('./' + filename))
}
})
module.exports = proxy;
module.exports = {
"GET /inviteAssist_1/index.do": {
code: null,
data: {
inviteUser: [],
maxRedNum: 666,
prizeVo: [
{
prizeId: "od74b603d",
prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
prizeName: "cs测试优惠券奖品6",
},
{
prizeId: "od74b603d",
prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
prizeName: "cs测试优惠券奖品6",
},
// {
// prizeId: "od74b603d",
// prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
// prizeName: "cs测试优惠券奖品6",
// },
// {
// prizeId: "od74b603d",
// prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
// prizeName: "cs测试优惠券奖品6",
// },
// {
// prizeId: "od74b603d",
// prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
// prizeName: "cs测试优惠券奖品6",
// },
// {
// prizeId: "od74b603d",
// prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
// prizeName: "cs测试优惠券奖品6",
// },
// {
// prizeId: "od74b603d",
// prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
// prizeName: "cs测试优惠券奖品6",
// },
// {
// prizeId: "od74b603d",
// prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
// prizeName: "cs测试优惠券奖品6",
// },
// {
// prizeId: "od74b603d",
// prizeImg: "//yun.dui88.com/images/202312/sg4xhsdksl.png",
// prizeName: "cs测试优惠券奖品6",
// },
],
},
message: null,
success: true,
timeStamp: 1735365189825,
},
"POST /inviteAssist_1/getInviteCode.do": {
code: -13246634.7225824,
message: "fugiat irure aliqua",
success: true,
data: {
dueTime: null,
extra: null,
inviteCode: "4KSYU0",
timestamp: 1673491076505,
},
},
"POST /inviteAssist_1/doAssist.do": {
code: "200304",
data: null,
message: "不能为自己助力",
success: false,
timeStamp: 1735356528944,
},
"GET /inviteAssist_1/draw.do": {
data: {
prizeVO: {
prizeId: "adipisicing",
prizeImg: "https://yun.dui88.com/images/202203/unet6gpw1c.jpeg",
prizeName: "ut dolor",
},
},
success: true,
code: null,
message: null,
},
};
\ No newline at end of file
module.exports = {
"GET /works/beThumbsRecords.do": {
"success": true,
"message": "报错了~",
"code": null,
timeStamp: Date.now(),
"data": {
totalCount: 128, // 记录总数
totalPage: 7, // 总页数
list: new Array(20).fill("").map((v, i) => {
return {
changeNum: i + 1, // 变更数量
changeDesc: `132****930${i}`, // 点赞用户昵称,托敏
changeType: i % 2, // 变更类型 1-加 2-减
time: Date.now() - 2 * 24 * 60 * 60 * 1000, // 变更时间,13位时间戳
}
}),
}
},
"GET /works/myThumbsRecords.do": {
"success": true,
"message": "报错了~",
"code": null,
timeStamp: Date.now(),
"data": {
totalCount: 128, // 记录总数
totalPage: 2, // 总页数
list: new Array(20).fill("").map((v, i) => {
return {
changeNum: i + 1, // 变更数量
changeDesc: i == 0 ? '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' : `作品编号00000000000${i}`, // 点赞用户昵称,托敏
changeType: i % 2, // 变更类型 1-加 2-减
time: Date.now() - 2 * 24 * 60 * 60 * 1000, // 变更时间,13位时间戳
}
}),
}
},
}
\ No newline at end of file
module.exports = {
"GET /works/workDetail.do": {
"code": null,
"data": {
"remainThumbsTimes": 1,
"salesmanFlag": false,
"worksInfo": {
"meFlag": false,
"rank": 1,
"sex": "1",
"thumbsNum": 13,
"worksDesc": "作品描述01",
"worksImg": "https://yun.duiba.com.cn/upload/20250211/b4a78707.png",
"worksNum": "tkh2urj38i",
"worksTitle": "作品标题"
}
},
"message": null,
"success": true,
"timeStamp": 1738999317142
},
"GET /works/thumbsUp.do": {
"code": null,
"data": {
awardDrawTimes: 1
},
"message": 'null',
"success": true,
"timeStamp": 1738999317142
},
"GET /works/commentRecords.do": {
"code": null,
"data": {
"list": [
{
"avatar": null,
"content": "评论3",
"nickname": "157****1111",
"time": 1739005224000
},
{
"avatar": null,
"content": "霸王差距",
"nickname": "157****3681",
"time": 1737772863000
},
{
"avatar": null,
"content": "茶百道",
"nickname": "157****3681",
"time": 1737772853000
},
{
"avatar": null,
"content": "蜜雪冰城甜蜜蜜",
"nickname": "157****3681",
"time": 1737772844000
},
{
"avatar": null,
"content": "你为什么不喝",
"nickname": "4012516130575933",
"time": 1737772507000
},
{
"avatar": null,
"content": "他奶奶的",
"nickname": "4012516130575933",
"time": 1737772498000
},
{
"avatar": null,
"content": "他妈",
"nickname": "4012516130575933",
"time": 1737772488000
}
],
"totalCount": 7,
"totalPage": 1
},
"message": null,
"success": true,
"timeStamp": 1739005828760
}
}
\ No newline at end of file
module.exports = {
'GET /crecord/getrecordmn':
// {
// "data": [
// {
// "extra": {
// "name": "行方奖品3",
// "icon": "//yun.duiba.com.cn/polaris/C-油.caf0249d78567653b712fb5bc090cad2d5c8b9b5.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385249000,
// "id": 500668088,
// "prizeId": "sp_money_3",
// "strategyId": "ru_normal_draw"
// },
// {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// },
// {
// "extra": {
// "name": "祝福语卡片111",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1,
// "refType": "virtual"
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// }, {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// }, {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// }, {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// }, {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// }, {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// }, {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385225000,
// "id": 500668199,
// "prizeId": "sp_blessing_card",
// "strategyId":
// "ru_normal_draw"
// },
// {
// "extra": {
// "name": "游戏次数",
// "icon": "//yun.duiba.com.cn/polaris/活力值.6405a66426d5d9c3fec41b565b3d55640aa4b785.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385207000,
// "id": 500668210,
// "prizeId": "sp_times",
// "strategyId": "spPrize@sp_times@1"
// },
// {
// "extra": {
// "name": "游戏次数",
// "icon": "//yun.duiba.com.cn/polaris/活力值.6405a66426d5d9c3fec41b565b3d55640aa4b785.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385202000,
// "id": 500668085,
// "prizeId": "sp_times",
// "strategyId": "spPrize@sp_times@1"
// },
// {
// "extra": {
// "name": "祝福语卡片",
// "icon": "//yun.duiba.com.cn/polaris/龙福.c38f47b9c0e128f126f8a4de4d28bbca0d28519a.png",
// "type": 1,
// "sendCount": 1
// },
// "gmtCreate": 1705385172000,
// "id": 500668209, "prizeId":
// "sp_blessing_card",
// "strategyId": "ru_first_draw"
// }
// ],
// // "data": [],
// "timeStamp": 1705385860774,
// "success": true
// },
{
"records": [
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "sp_bean",
"bonus": true,
"title": "保豆-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": true,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": true, // true expire
"projectId": "p8a32cdec",
"extraJson": "{\"expireTime\":\"2023-09-01 00:00:00\"}",
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
{
"img": "//yun.dui88.com/images/202203/unet6gpw1c.jpeg",
"itemType": "object",
"bonus": false,
"title": "11奖品名称超级长的实物奖品-漫漫测试-不可删除-不可删除-奖品名称超级长",
"type": 1,
"orderTypeTitle": "星速台活动获得",
"recordId": 500727400,
"new": false,
"quantity": 1,
"gmtCreate": "2024-06-18 00:10:38",
"url": "/aaw/projectx/takePrize?projectOrderNo=500727400",
"statusText": "<span>已中奖</span>",
"invalid": false,
"projectId": "p8a32cdec"
},
],
"success": true,
"nextPage": false,
"projectTabList": [
{
"prizeExpire": "2024-09-01 00:00:00",
"projectId": "p4aac6378",
"projectName": "人保-共享- "
},
{
"prizeExpire": "2024-09-01 00:00:00",
"projectId": "p8a32cdec",
"projectName":
"人保-共享繁花-测试项目"
},
{
"prizeExpire": "2023-09-01 00:00:00",
"projectId": "pfd218fc6",
"projectName": "人保口红机"
},
{
"prizeExpire": "2024-09-01 00:00:00",
"projectId": "p48102f2e",
"projectName": "人保多巴胺运动馆"
}
],
"invalidPage": false
},
}
\ No newline at end of file
module.exports = {
"GET /inviteAssist_1/outside.do": {
"success": true,
"code": "",
"message": "",
"data": {
"actStartTimestamp": 1704038400000,
"actEndTimestamp": 1735660799000,
"currentTimestamp": 1718613524280,
"uid": "15812345678",
"validUid": false,
"boundYkCode": "xxx",
"cardPrizeName": "10元京东卡"
}
}
}
\ No newline at end of file
module.exports = {
"GET /task_1/queryTasks.do": {
code: null,
data: {
endTimestamp: 1780196578000,
item: [
{
buttonText: "去完成",
code: "browse_zeng_yuan_1",
completedSize: 1,
desc: null,
extra: '{"answerTimes":0,"drawTimes":0}',
icon: "//yun.duiba.com.cn/polaris/Image2.b9419702802eff6ec5ba50ac072086df45409bfd.jpg",
id: "0l0cha7n",
index: null,
indexes: null,
intervalLimitSize: 1,
intervalType: 4,
jumpUrl: "//yun.duiba.com.cn/aurora/assets/27f733e7771780689de2169ed291cad18feeab42.png",
options: [
{
degree: null,
icon: null,
icon2: null,
id: "sp_draw_times",
index: null,
name: "完成任务发放答题次数占位道具",
prizeId: "sp_draw_times",
prizeType: null,
refId: null,
refType: null,
sendCount: 1,
},
],
playwayId: "customTask1",
prizePendingCode: "",
prizePendingCodeList: [{ code: "", index: 1 }],
ruleId: "spPrize@sp_draw_times@1",
sendPrize: true,
subTitle: "抽奖次数+1抽奖次数+1抽奖次数+1",
taskStatus: 0,
title: "邀请任务",
},
{
buttonText: "去完成",
code: "bt_3_1",
completedSize: 1,
desc: null,
extra: '{"answerTimes":0,"drawTimes":0}',
icon: "//yun.duiba.com.cn/polaris/Image2.b9419702802eff6ec5ba50ac072086df45409bfd.jpg",
id: "sc2o1emu",
index: null,
indexes: null,
intervalLimitSize: 1,
intervalType: 4,
jumpUrl: "https://doublerecording-prd-new.obs.cn-south-1.myhuaweicloud.com/bigCorse/%E6%B6%88%E4%BF%9D%E6%B4%BB%E5%8A%A8/VIP%E6%9C%8D%E5%8A%A1%E5%AE%A3%E4%BC%A0/2024%E5%B9%B4VIP%E6%9C%8D%E5%8A%A1%E5%AE%A3%E4%BC%A0%E8%A7%86%E9%A2%91%EF%BC%88%E5%B0%8F%E6%A0%BC%E5%BC%8F%EF%BC%89.mp4",
options: [
{
degree: null,
icon: null,
icon2: null,
id: "sp_draw_times",
index: null,
name: "完成任务发放答题次数占位道具",
prizeId: "sp_draw_times",
prizeType: null,
refId: null,
refType: null,
sendCount: 1,
},
],
playwayId: "customTask1",
prizePendingCode: "",
prizePendingCodeList: [{ code: "", index: 1 }],
ruleId: "spPrize@sp_draw_times@1",
sendPrize: true,
subTitle: "抽奖次数+1",
taskStatus: 0,
title: "看视频15s",
},
{
buttonText: "去完成",
code: "common_answer",
completedSize: 0,
desc: null,
extra: '{"taskCode":"task_third_1_asset_growth_1","answerTimes":1,"drawTimes":0,"gear":1}',
icon: "//yun.duiba.com.cn/polaris/Image2.b9419702802eff6ec5ba50ac072086df45409bfd.jpg",
id: "abwha4qz",
index: null,
indexes: null,
intervalLimitSize: 1,
intervalType: 3,
jumpUrl: "appjumpurl$$$ykjumpurl$$$otherjumpurl",
options: null,
playwayId: "customTask1",
prizePendingCode: null,
prizePendingCodeList: null,
ruleId: "spPrize@undefined@undefined",
sendPrize: null,
subTitle: "抽奖次数+1",
taskStatus: 1,
title: "答题任务",
},
{
buttonText: "去完成",
code: "common_sign",
completedSize: 0,
desc: null,
extra: '{"taskCode":"task_third_1_asset_growth_1","answerTimes":1,"drawTimes":0,"gear":1}',
icon: "//yun.duiba.com.cn/polaris/Image2.b9419702802eff6ec5ba50ac072086df45409bfd.jpg",
id: "abwha4qz",
index: null,
indexes: null,
intervalLimitSize: 1,
intervalType: 3,
jumpUrl: "appjumpurl$$$ykjumpurl$$$otherjumpurl",
options: null,
playwayId: "customTask1",
prizePendingCode: null,
prizePendingCodeList: null,
ruleId: "spPrize@undefined@undefined",
sendPrize: null,
subTitle: "抽奖次数+1",
taskStatus: 0,
title: "签到任务",
},
{
buttonText: "去完成",
code: "common_sign",
completedSize: 0,
desc: null,
extra: '{"taskCode":"task_third_1_asset_growth_1","answerTimes":1,"drawTimes":0,"gear":1}',
icon: "//yun.duiba.com.cn/polaris/Image2.b9419702802eff6ec5ba50ac072086df45409bfd.jpg",
id: "abwha4qz",
index: null,
indexes: null,
intervalLimitSize: 1,
intervalType: 3,
jumpUrl: "appjumpurl$$$ykjumpurl$$$otherjumpurl",
options: null,
playwayId: "customTask1",
prizePendingCode: null,
prizePendingCodeList: null,
ruleId: "spPrize@undefined@undefined",
sendPrize: null,
subTitle: "抽奖次数+1",
taskStatus: 1,
title: "签到任务",
},
{
buttonText: "去完成",
code: "common_sign",
completedSize: 0,
desc: null,
extra: '{"taskCode":"task_third_1_asset_growth_1","answerTimes":1,"drawTimes":0,"gear":1}',
icon: "//yun.duiba.com.cn/polaris/Image2.b9419702802eff6ec5ba50ac072086df45409bfd.jpg",
id: "abwha4qz",
index: null,
indexes: null,
intervalLimitSize: 1,
intervalType: 3,
jumpUrl: "appjumpurl$$$ykjumpurl$$$otherjumpurl",
options: null,
playwayId: "customTask1",
prizePendingCode: null,
prizePendingCodeList: null,
ruleId: "spPrize@undefined@undefined",
sendPrize: null,
subTitle: "抽奖次数+1",
taskStatus: 2,
title: "签到任务",
},
],
startTimestamp: 1713841378000,
timestamp: 1714284614182,
},
message: null,
success: true,
timeStamp: 1714284614467,
},
"POST /task_1/sendPrize.do": {
code: null,
data: {
extra: "1",
options: [
{
optionId: "officia",
optionImg: "id ipsum",
optionName: "nulla cupidatat",
position: 63597682.59836808,
prizeId: "incididunt",
prizeType: -3079265.394056648,
ruleId: "reprehenderit aute deserunt",
url: "sunt",
sendCount: 3,
},
{
optionId: "esse ut laboris dolor reprehenderit",
optionImg: "anim ut",
optionName: "occaecat tempor aliquip amet",
position: -93793131.65854914,
prizeId: "in enim Ut anim",
prizeType: -83505282.2731905,
ruleId: "incididunt et",
url: "ipsum eu laborum nostrud",
sendCount: 3,
},
{
optionId: "dolor do in et consectetur",
optionImg: "laborum Excepteur sit",
optionName: "irure officia eiusmod",
position: 62914584.39450729,
prizeId: "nostrud nisi et ipsum",
prizeType: -87226701.41384046,
ruleId: "in labore reprehenderit Duis est",
url: "pariatur sit",
sendCount: 3,
},
{
optionId: "irure in reprehenderit sed",
optionImg: "reprehenderit",
optionName: "fugiat",
position: 86398415.66680664,
prizeId: "dolor elit adipisicing",
prizeType: -51881234.24195088,
ruleId: "minim occaecat",
url: "enim eiusmod",
sendCount: 3,
},
],
},
message: null,
success: true,
},
"POST /task_1/finishTask.do": {
"data": {
"timestamp": -35003075.452821575,
"sendPrize": true,
"icon": "qui nisi amet magna",
"desc": "dolore voluptate",
"code": "browser_insurance_C",
"id": "nulla elit exercitation ea", // 任务id
"buttonText": "voluptate tempor",
"extra": "elit sit sunt laboris",
"options": [
{
"url": "in non",
"optionId": "dolore",
"sendCount": "id anim",
"index": 57723729.46539241,
"ruleId": "dolore",
"prizeId": "dolore laborum",
"optionName": "elit sed culpa adipisicing",
"optionImg": "quis",
"prizeType": -87661811
}
]
},
"success": true,
"code": null,
"message": null
},
};
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "temp_base",
"version": "3.6.8",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development node ./config/scripts/assets/generateAssetList.js && node ./config/webpack.dev.config.js",
"imgmin": "node ./config/scripts/assets/index.js imgmin",
"imgup": "node ./config/scripts/assets/index.js imgup",
"imgminup": "node ./config/scripts/assets/index.js imgmin imgup",
"spark:prebuild": "ncu @spark/pre-build -u && yarn && npx pre-build",
"lint": "eslint --ext .js,jsx,.html src public",
"prod": "rimraf ./dist &&cross-env NODE_ENV=production node ./config/webpack.prod.config.js",
"build": "rimraf ./dist &&cross-env NODE_ENV=production node ./config/scripts/assets/generateAssetList.js && node ./config/scripts/assets/index.js imgmin imgup && node ./config/webpack.prod.config.js"
},
"dependencies": {
"@spark/api-base": "^2.0.7",
"@spark/circle-turntable": "^1.0.3",
"@spark/dbdomain": "^1.0.25",
"@spark/share": "^2.0.340",
"@spark/svgaplayer": "^2.0.5",
"@spark/ui": "^2.0.8",
"@spark/utils": "^2.0.17",
"antd-mobile": "^5.38.1",
"classnames": "^2.5.1",
"crypto-js": "^4.2.0",
"dplayer": "^1.27.1",
"duiba-utils": "^1.0.2",
"history": "^4.10.1",
"javascript-obfuscator": "^4.1.0",
"mobx": "^6.2.0",
"mobx-react": "^7.1.0",
"qrcode": "^1.5.4",
"qs": "^6.9.4",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"sa-sdk-javascript": "^1.27.2",
"spark-utils": "^0.0.12",
"swiper": "8.3.2",
"terser-webpack-plugin": "4.2.3"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-decorators": "^7.13.15",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@spark/eslint-plugin-best-practices": "^0.0.1-beta.2",
"@spark/eslint-plugin-security": "^0.0.1-beta.5",
"@spark/pre-build": "^0.0.1-beta.11",
"@types/crypto-js": "^4.2.2",
"autoprefixer": "^9.8.6",
"babel-loader": "^8.2.2",
"chalk": "^4.1.0",
"clean-webpack-plugin": "^3.0.0",
"commander": "^11.1.0",
"cross-env": "^7.0.3",
"css-loader": "^3.6.0",
"eslint": "^8.22.0",
"eslint-plugin-html": "^6.2.0",
"eslint-plugin-react": "^7.29.4",
"fs-extra": "^9.0.1",
"html-webpack-plugin": "^4.5.1",
"less": "^4.1.0",
"less-loader": "^7.2.1",
"mini-css-extract-plugin": "^1.3.4",
"mocker-api": "^2.7.5",
"npm-check-updates": "^12.5.4",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"postcss-loader": "^3.0.0",
"postcss-px2rem-exclude": "0.0.6",
"prettier": "^2.0.5",
"progress-bar-webpack-plugin": "^2.1.0",
"rimraf": "^3.0.2",
"script-ext-html-webpack-plugin": "^2.1.5",
"spark-assets": "^2.6.5",
"spark-log-event": "^1.0.4",
"style-loader": "^1.2.1",
"url-loader": "^4.1.1",
"webpack": "^4.43.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2"
}
}
{"proSetting":{"projectxIDs":{"testId":[{"label":"test","value":"pe2caadcd"}],"prodId":[{"label":"test","value":"pb74a3aec"},{"label":"prod","value":"p7925c40f"}]},"skinVariables":[],"mockSetting":{"projectId":"","pageId":""}},"envSetting":{},"psdSetting":{"psdFSSetting":true,"psdCenterSetting":true}}
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="dns-prefetch" href="//yun.duiba.com.cn" />
<link rel="preconnect" href="//embedlog.duiba.com.cn">
<title>闪亮瞬间</title>
<script type="text/javascript">
if (localStorage && localStorage.isWebp) {
document
.getElementsByTagName('html')[0]
.setAttribute('duiba-webp', 'true');
}
</script>
<script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"></script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script src="//yun.duiba.com.cn/h5/lib/zepto.min.js"></script>
<script src="https://m.picclife.cn/Life-H5/html/clause/PICCLifeJsBrage.js"></script>
<script>
var CFG = CFG || {};
CFG.projectId = location.pathname.split('/')[2] || '1';
function getUrlParam(name) {
var search = window.location.search;
var matched = search
.slice(1)
.match(new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'));
return search.length ? matched && matched[2] : null;
}
CFG.operationId = '6130'
CFG.appID = "${APPID}";
CFG.domain = location.origin;
// 首页
CFG.indexUrl = "/projectx/" + CFG.projectId + "/index.html?appID=" + getUrlParam("appID");
// 普通分享落地页
CFG.shareUrl = "/projectx/" + CFG.projectId + "/sharepage.html?appID=" + getUrlParam("appID");
// CFG.shareUrl = '/projectx/' + CFG.projectId + '/share.html?appKey=4AoRyTuR6XNfjNa4w5exe1bPmqDS&openBs=openbs&appID=' + CFG.appID;
// 普通分享落地页
// CFG.fireShareUrl = "/projectx/" + CFG.projectId + "/firesharepage.html?appID=" + getUrlParam("appID");
// 我的奖品页
CFG.prizeUrl = "/projectx/" + CFG.projectId + "/prize.html?appID=" + getUrlParam("appID");
// 作品详情页
CFG.workPage = "/projectx/" + CFG.projectId + "/workPage.html?appID=" + getUrlParam("appID");
//actPlatforms
CFG.actPlatforms = getUrlParam("actPlatforms") || "";
//actPlatforms
CFG.agentCode = getUrlParam("agentCode") || "";
//actPlatforms
CFG.actId = getUrlParam("actId") || "";
// 特殊的业务员code
CFG.spcCode = getUrlParam("code") || "";
// 业务员code
CFG.workerCode = getUrlParam("ykCode") || CFG.spcCode;
// 渠道 1-9
CFG.channel = getUrlParam("channel") || "2";
// 默认渠道 除了友客渠道,其他统一按照2处理
// CFG.defaultChannel = CFG.channel == 5 ? 5 : CFG.channel == 3 ? 3 : 2;
CFG.defaultChannel = CFG.channel || "2";
// 助力参数
CFG.inviteCode = getUrlParam("inviteCode");
// 微信授权链接
CFG.indexLogin = "/wechat/access?apk=4AoRyTuR6XNfjNa4w5exe1bPmqDS&dbredirect=";
// 奖品页唤端链接
CFG.toAppPrizeUrl =
"https://lifeapp.picclife.cn/portal/app_manager/downloadapps.html?operate_link=https%3A%2F%2Flifeapp-api.picclife.cn%2Flifeapi%2Flifeapp-svc-gw%2Fapi%2Fauth_code%2Fauthorize%2Fv1%3Factivity_code%3D612102%26redirect_type%3D0%26redirect_uri%3Dhttps%3A%2F%2F96094.activity-19.m.duiba.com.cn%2FcustomShare%2Fshare%3Fid%3DDid1NTgxOTk&isBindManager=1&isNeedAuth=1";
CFG.sensorUrl = "https://mdglfxpt.piccgroup.cn:18443/sa?project=picclife_consumer";
//代理人仅分享渠道
CFG.agentShare = getUrlParam("agentShare") || 0;
// 环境,test测试,prod生产 todo
CFG.env = "prod"; //注意sdk 也分环境!
if (CFG.env == "test") {
// 测试
// eslint-disable-next-line @spark/best-practices/no-url-in-js
CFG.sensorUrl = "https://mdglfxpt-test.piccgroup.cn:18443/sa?project=picclife_consumer";
CFG.toAppPrizeUrl =
"https://lifeapp-test.picclife.cn/portal-web/app_manager/downloadapps.html?operate_link=https%3A%2F%2Flifeapp-api-test.picclife.cn%2Flifeapi%2Flifeapp-svc-rel-gw%2Fapi%2Fauth_code%2Fauthorize%2Fv1%3Factivity_code%3D612102%26redirect_type%3D0%26redirect_uri%3Dhttps%253A%252F%252F96094.activity-19.m.duiba.com.cn%252FcustomShare%252Fshare%253Fid%253DDid1NTgxNTE&isBindManager=1&isNeedAuth=1";
}
if (!getUrlParam("appID")) {
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}
</script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
\ No newline at end of file
{"proName":"20250122_RBShine","proDesc":"","proPath":"/Users/duibagroup/Documents/Duiba/人保-闪亮瞬间/20250122_RBShine","createTime":1737539929733}
module.exports ={
"OUTPUT_DIR": "dist",
"SOURCE_DIR": "src",
"TEMP_DIR": "./.temp",
"ENTRY": "src/app.jsx",
"TEMPLATE": "./public/index.html",
"API_MOCK": true,
"PX2REM": true,
"IMAGE_Q1": 0.6,
"IMAGE_Q2": 0.8,
"RES_PATH": "/src/assets/",
"RES_PATH_PROD": "//yun.duiba.com.cn/spark/v2/temp_base/1740713467902",
"JS_PATH_PROD": "https://yun.duiba.com.cn/spark/v2/temp_base/1740761360988/js"
}
\ No newline at end of file
{"assetsPathArr":["//yun.duiba.com.cn/spark/v2/temp_base/1678169645525/loadingDemo/上面.png","//yun.duiba.com.cn/spark/v2/temp_base/1678169645525/loadingDemo/底部173.png","//yun.duiba.com.cn/spark/v2/temp_base/1678169645525/loadingDemo/背景.jpg"]}
\ No newline at end of file
import API from "@src/api";
import {
setCookieId
} from "@src/api/utils";
/**
* 普通跳转客服
* 注意:小程序需要额外增加业务域名 https://duiba.qiyukf.com/
*/
export function jumpService() {
location.href = location.origin + '/faq/index'
}
export function appJump(url, hideNavbar = false, data = {}) {
API.tempSaveCookie().then((res) => {
if (res?.data) {
localStorage.setItem("db_temp_cookie", res.data);
// setCookieId(res.data);
}
}).finally(() => {
// app对应跳转方法
window.MarsJSBridge.invoke("pushPage", {
uri: url,
data,
pageParams: {
hideNavbar,
}
});
});
}
import { generateAPI } from "./utils.js";
const API = generateAPI({
/** 获取活动规则 */
getRule: "projectRule.query",
/** 获取前端配置项 */
getFrontVariable: "coop_frontVariable.query",
/** 参与接口 post请求 */
doJoin: {
uri: "join.do",
method: "post"
},
/** 签到 */
doSign: {
uri: "checkin_1/doSign.do",
withToken: true, // 携带token
},
// cookie丢失-临时保存cookie
tempSaveCookie: {
uri: "/autoLogin/tempSaveCookie",
showMsg: false,
},
// cookie丢失-重新设置cookie
resetCookie: "/autoLogin/resetCookie",
userLogin: {
uri: "userLogin.check",
showMsg: false,
},
buriedPoint: {
uri: "home/buriedPoint.do",
showMsg: false,
},
/** 获取任务列表 */
getTaskInfo: {
uri: "task_1/queryTasks.do",
},
/** 完成任务 */
doCompleted: {
uri: "task_1/doCompleted.do",
method: "post",
withToken: true,
},
/** 领取奖励 */
sendPrize: {
uri: "task_1/sendPrize.do",
method: "post",
withToken: true,
},
/** 绑定友客业务员信息接口 */
bindYk: {
uri: "agent/bindYk.do",
method: "post",
showMsg: false,
},
/** 生成唤端二维码 */
getLongLinkQrcode: `/customActivity/qrcode/getQrcode`,
// /** 获取邀请码 */
// getInviteCode: {
// uri: "customInvite1/getInviteCode.do",
// method: "post",
// withToken: true,
// },
// /** 助力 */
// doAssist: {
// uri: "customInvite1/doAssist.do",
// method: "post",
// withToken: true,
// showMsg: false,
// },
/** 落地页 */
coop_getLoadingInfo: "customInvite1/outside.do",
/** 获取地区 */
getParentCode: "/gaw/address/getChildrenByParentCode",
/** 抽奖首页 */
drawIndex: "draw/index.do",
/** 抽奖 */
drawJoin: {
uri: "draw/doDraw.do",
withToken: true,
},
/** 被点赞记录 */
beThumbsRecords: "works/beThumbsRecords.do",
/** 我的点赞记录 */
myThumbsRecords: "works/myThumbsRecords.do",
/** 校验验证码并登录 */
coopCheckCode: {
uri: "examine/coop_checkCode.do",
method: "post",
},
getCode: {
uri: "/customActivity/piccLife/sendSmsCode",
// showMsg: false,
},
/** 发送验证码 */
coopSendCode: {
uri: "examine/coop_sendCode.do",
method: "post",
},
/** 校验是否绑定手机号 */
checkBind: "/customActivity/piccLife/check",
/** 奖品页 */
prize: "/crecord/getrecordmn",
/** 助力 */
doAssist: {
uri: "inviteAssist_1/doAssist.do",
method: "post",
withToken: true,
// showMsg: false,
},
/** 获取邀请码 */
getInviteCode: {
uri: "inviteAssist_1/getInviteCode.do",
method: "post",
withToken: true,
},
/** 保存/修改作品信息*/
saveOrUpdateWork: {
uri: "works/saveOrUpdateWork.do",
method: "post",
contentType: "json",
headers: {
"Content-Type": "application/json",
},
},
/** 上传图片 */
uploadImg: {
uri: "/customActivity/duiba/imgUploadUrl",
method: "post",
contentType: "json",
},
/** 业务员首页*/
salesManIndex: {
uri: "works/index.do",
showMsg: false,
},
/** 审核玩法-审核首页*/
examineIndex: {
uri: "examine/examineIndex.do",
method: "post",
},
/** 同意隐私协议接口*/
lockAgree: {
uri: "works/lockAgree.do",
},
/** 投稿玩法-作品排行榜*/
productSearch: {
uri: "works/productSearch.do",
},
// 投稿玩法-作品详情
workDetail: 'works/workDetail.do',
// 投稿玩法-作品评论记录
commentRecords: 'works/commentRecords.do',
// 投稿玩法-作品评论
comment: {
uri: "works/comment.do",
method: "post",
contentType:"json",
},
// 投稿玩法-作品点赞
thumbsUp: {
uri: 'works/thumbsUp.do',
withToken: true,
},
/** 同意隐私协议接口 */
agreePrivacy: {
uri: "game/agreePrivacy.do",
withToken: true,
method: "post",
},
// 推送使用
outside: `inviteAssist_1/outside.do`,
bindPhone: {
uri: "/customActivity/piccLife/bindWithCode",
method: "post",
showMsg: false,
},
/** 业务员抽奖接口 */
salesManDraw: {
uri: "works/draw.do",
withToken: true,
}
});
// console.log('======', API)
export default API;
declare type Methods = 'get' | 'post';
declare interface APIArguments {
uri: string,
method?: Methods | Uppercase<Methods>,
headers?: any
withToken?: boolean
secret?: string,
secretKey?: string,
contentType?: string,
showMsg?:boolean,
showLoading?: boolean;
}
declare type APIConfig = APIArguments | string
declare interface GenerateAPIParams {
[key: string]: APIConfig
}
declare type RequestParamType = Record<string, any>
declare interface ResponseType<T = any> {
code: number,
success: boolean,
message: string,
data: T
}
export declare function generateAPI<
T extends GenerateAPIParams = GenerateAPIParams,
P = RequestParamType,
Q = ResponseType>
(apiList: T): {
[key in keyof T]: (args?: P) => Promise<Q>
}
import { callApi } from '@spark/api-base'
import { Loading, Toast } from '@spark/ui'
import { isFromShare, newUser } from 'duiba-utils';
import { errorHandler } from "@src/utils/errorHandler";
import API from "@src/api/index";
import { getPxToken } from "@src/built-in/getPxToken";
const mergeData = {
user_type: newUser ? '0' : '1',
is_from_share: isFromShare ? '0' : '1',
from: CFG.channel,
actPlatforms: CFG.actPlatforms || "",
agentCode: CFG.agentCode || "",
actId: CFG.actId || "",
}
// let tempCookieId = "";
//
// export function setCookieId(cookieId) {
// tempCookieId = cookieId;
// }
export function resetBackCookie(duibaTempCookieId) {
return new Promise((resolve) => {
callApi("/autoLogin/resetCookie", {
duibaTempCookieId
}).then((resp) => {
return resolve('success');
}, (e) => {
return resolve(e);
});
});
}
/**
* 请求方法get、post处理
* @param {*} value
* @returns
*/
function getRequestParams(value) {
if (typeof value === 'string') {
return {
uri: value,
method: 'get'
}
} else if (typeof value === 'object') {
const { uri, method = 'get', showMsg = true, showLoading = false, headers, withToken, secret, secretKey, contentType = 'form' } = value;
return {
uri,
method,
headers,
withToken,
secret,
secretKey,
contentType,
showLoading,
showMsg
}
} else {
console.error('getRequestParams: 传参有误');
}
}
/**
* 请求API通用处理
* @param {*} value
* @returns
*/
export function generateAPI(apiList) {
const api = {};
for (const key in apiList) {
const value = apiList[key];
const { method, uri, headers: mHeaders, withToken, secret, secretKey, contentType, showLoading, showMsg = true } = getRequestParams(value);
api[key] = async (params = {}, headers) => {
// cookie丢失的问题
// 如遇跳转Cookie丢失,打开如下代码
// const duibaTempCookieId = localStorage.getItem("db_temp_cookie");
// // const duibaTempCookieId = tempCookieId;
//
// if (duibaTempCookieId) {
// localStorage.removeItem("db_temp_cookie");
// // tempCookieId = "";
//
// const res = await API.userLogin()
// .catch(async () => {
// await resetBackCookie(duibaTempCookieId);
// });
//
// if (!res || !res.success) {
// await resetBackCookie(duibaTempCookieId);
// }
// }
// 根据接口配置showLoading展示loading
// 600ms内结束的请求不显示loading,避免闪烁
let query = false;
showLoading && setTimeout(() => {
if (!query) {
Loading.show();
}
}, 600);
let token;
if (withToken) { // 是否携带token
try {
token = await getPxToken(); // 获取token
} catch (e) {
Toast('网络异常,请稍后再试~');
query = true;
showLoading && Loading.hide();// 根据接口配置showLoading关闭loading
return ({ success: false, data: '' });
}
}
const mergedHeaders = { ...mHeaders, ...headers }
if (withToken && token) {
params.token = token;
}
params = { ...params, ...mergeData };
const result = await callApi(uri, params, method, mergedHeaders, false, secret, secretKey, contentType)
.catch(e => {
query = true;
// 捕获网络异常
showMsg && Toast(e.message || '网络异常,请稍后再试~');
showLoading && Loading.hide();
});
query = true;
showLoading && Loading.hide();// 根据接口配置showLoading关闭loading
return new Promise((resolve) => {
if (result) {
// 判断接口错误
if (!result.success && showMsg) {
errorHandler(result);
}
// 返回整个结果
resolve(result);
} else {
resolve({ success: false, data: '' });
}
})
}
}
return api;
}
/**
* 活动主入口
*/
import React, { Component } from "react";
import ReactDOM from "react-dom";
import { observer } from "mobx-react";
import "./app.less";
import store from "./store/index";
import Modal from "./modal/modal";
import "./utils/checkwebp"; // webp检查
import MD from "../MD"; // 埋点
MD();
// 此处为spark-cli动态生成
import LoadingDemo from "@src/pages/LoadingDemo/LoadingDemo";
import HomeDemo from "@src/pages/HomeDemo/HomeDemo";
import { PAGE_MAP } from "./utils/constants";
import SaleManPage from "@src/pages/SaleManPage/SaleManPage";
import Likelogpage from "./pages/likelogpage/likelogpage";
import Drawpage from "./pages/drawpage/drawpage";
import Sharepage from "./pages/sharepage/sharepage";
import AgentSharepage from "./pages/agentSharepage/sharepage";
import Prizepage from "./pages/prizepage/prizepage";
import Userhomepage from "./pages/userhomepage/userhomepage";
import Opuspage from "./pages/opuspage/opuspage";
import shareStore from "./store/share";
import { isWeChat, onInitShare, onUpdateShare } from "./utils/share";
import { isMiniprogram } from "./utils/utils";
import { domain, ensureDomain } from "@spark/dbdomain";
/**
* 所有页面场景
*/
const pageMap = {
[PAGE_MAP.LOADING_PAGE]: <LoadingDemo />,
[PAGE_MAP.HOME_PAGE]: <HomeDemo />,
[PAGE_MAP.SALE_PAGE]: <SaleManPage />,
[PAGE_MAP.SHARE_PAGE]: <Sharepage />,
[PAGE_MAP.AGENT_SHARE_PAGE]: <AgentSharepage />,
[PAGE_MAP.LIKE_LOG_PAGE]: <Likelogpage />,
[PAGE_MAP.DRAW_PAGE]: <Drawpage />,
[PAGE_MAP.PRIZE_PAGE]: <Prizepage />,
[PAGE_MAP.USER_HOME_PAGE]: <Userhomepage />,
[PAGE_MAP.OPUS_PAGE]: <Opuspage />
};
@observer
class App extends Component {
async componentDidMount() {
// 获取前端开发配置,依据项目需要,酌情添加 !!!
await store.getFrontVariable();
await onInitShare();
// 获取动态域名
await ensureDomain();
CFG.domain = domain;
if (isMiniprogram()) {
//小程序域名写死
CFG.domain = "https://96094.activity-24.m.duiba.com.cn";
}
console.info("分享默认渠道===", CFG.workerCode);
if (store.curPage != PAGE_MAP.SHARE_PAGE ) {
// 首页
// 初始化分享
let shareUrl = `${CFG.domain}${CFG.shareUrl}`;
shareUrl += `&ykCode=${CFG.workerCode || CFG.agentCode || ""}`;
shareUrl += `&channel=${CFG.defaultChannel}&agentCode=${CFG.agentCode || ""}&actPlatforms=${CFG.actPlatforms || ""
}&actId=${CFG.actId || ""}`;
onUpdateShare({
...JSON.parse(store.frontVariable.shareInfo),
url: `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(shareUrl)}`,
});
} else if (store.curPage == PAGE_MAP.SHARE_PAGE) {
let shareUrl = `${CFG.domain}${CFG.shareUrl}${getUrlParam("inviteCode") ? "&inviteCode=" + getUrlParam("inviteCode") : ""
}${getUrlParam("worksNum") ? "&worksNum=" + getUrlParam("worksNum") : ""
}`;
shareUrl += `&ykCode=${CFG.workerCode || CFG.agentCode || ""}`;
if (CFG.channel)
shareUrl += `&channel=${CFG.defaultChannel}&agentCode=${CFG.agentCode || ""}&actPlatforms=${CFG.actPlatforms || ""
}&actId=${CFG.actId || ""}`;
let _shareInfo = JSON.parse(store.frontVariable.shareInfo);
if(getUrlParam("worksNum")) {
_shareInfo = JSON.parse(store.frontVariable.shareInfoZan);
} else if(getUrlParam("inviteCode")) {
_shareInfo = JSON.parse(store.frontVariable.shareInfoInvite);
}
onUpdateShare({
..._shareInfo,
url: `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(shareUrl)}`,
});
}
}
render() {
const { curPage, pageData } = store;
return (
<>
{{ ...pageMap[curPage], props: { ...pageData } }}
<Modal />
</>
);
}
}
ReactDOM.render(<App />, document.getElementById("root"));
* {
margin: 0;
padding: 0;
-webkit-touch-callout: none; /*系统默认菜单被禁用*/
-khtml-user-select: none; /*早期浏览器*/
-moz-user-select: none; /*火狐*/
-ms-user-select: none; /*IE10*/
-webkit-tap-highlight-color: transparent;
user-select: text;
-webkit-user-select: text;
}
*:not(input,textarea) {
-webkit-touch-callout: none;
-webkit-user-select: none;
}
html,
body {
font-size: 24px;
width: 100%;
height: 100%;
-webkit-text-size-adjust: 100% !important;
text-size-adjust: 100% !important;
-moz-text-size-adjust: 100% !important;
overflow: hidden;
}
.modal_center {
left: 0 !important;
top: 0 !important;
bottom: 0 !important;
right: 0 !important;
margin: auto;
}
#root {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
.com_Container {
width: 100%;
height: 100%;
position: relative;
overflow-x: hidden;
overflow-y: auto;
}
.line() {
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 使用省略号表示超出的文本 */
}
\ No newline at end of file
{"preLoadImg":[],"asyncLoadImg":["CodePop/bg.png","CodePop/code.png","commentPop/bg.png","commentPop/btn.png","commentPop/close.png","common/back.png","common/closeBtn.png","common/happyBtn.png","common/light.png","ConfirmPop/bg.png","ConfirmPop/cancel.png","ConfirmPop/confirm.png","drawChancePop/bg.png","drawChancePop/know_btn.png","drawChancePop/light.png","drawPage/bg.png","drawPage/cover.png","drawPage/draw_btn.png","drawPage/logo.png","drawPage/pointer.png","drawPage/prize_btn.png","drawPage/prize_info_bg.png","drawPage/prize_info_laba.png","drawPage/rule_btn.png","drawPage/title.png","drawPage/turantable_bg.png","drawPage/turantable_box.png","FillAddress/填写收货地址.png","FillAddress/提交信息按钮-不可点击.png","FillAddress/提交信息按钮-可点击.png","FillAddress/直线.png","FillAddress/返回按钮.png","FillAddress/选择按钮.png","GuidePop/bg.png","GuidePop/btn.png","GuidePop/card.png","GuidePop/ip.png","GuidePop/ip2.png","GuidePop/light.png","GuidePop/prize.png","GuidePop/title.png","GuidePop/upload.png","likeLogPage/back.png","likeLogPage/bg.png","likeLogPage/item_line.png","likeLogPage/list_bg.png","likeLogPage/title.png","LoadingPage/loadingBg.jpg","LoadingPage/loadingFill.png","LoadingPage/loadingIp.png","LoginPop/bg.png","LoginPop/cannotSubmit.png","LoginPop/canSubmitBtn.png","music/bgm.mp3","noPointPop/bg.png","noPointPop/btn.png","noPointPop/close.png","noPointPop/li8ght.png","NoPrizeCard/bg.png","NoPrizeCard/bg2.png","NoPrizeCard/camera.png","NoPrizeCard/exchange.png","NoPrizeCard/exchange2.png","NoPrizeCard/prizeImg.png","NoPrizeCard/title.png","opusPage/avatar.png","opusPage/back.png","opusPage/bg.png","opusPage/bg2.png","opusPage/big_pinglun.png","opusPage/dianzan.png","opusPage/infobg.png","opusPage/line.png","opusPage/pinglun.png","opusPage/zan.png","pointSucPop/bg.png","pointSucPop/box.png","pointSucPop/btn.png","pointSucPop/close.png","pointSucPop/light.png","PrivacyPop/bg.png","PrizePage/back.png","PrizePage/bg.png","PrizePage/bg2.png","PrizePage/bg_item.png","PrizePage/go-btn.png","PrizePage/gray_btn.png","PrizePage/img.png","PrizePage/stick.png","PrizePop/bg.png","RankNoPrizePop/bg.png","RankNoPrizePop/know.png","RankPrizePop/bg.png","RankPrizePop/light.png","RankPrizePop/prizePicture.png","ReviewFailedPop/bg.png","ReviewFailedPop/reSubmit.png","ReviewSucPop/chou.png","ReviewSucPop/gift.png","ReviewSucPop/light.png","ReviewSucPop/title.png","RulePop/bg.png","SaleManPage/bg.png","SaleManPage/bianhaoBg.png","SaleManPage/good.png","SaleManPage/idbg.png","SaleManPage/IP.png","SaleManPage/iptxt.png","SaleManPage/logo.png","SaleManPage/man.png","SaleManPage/music_close.png","SaleManPage/music_open.png","SaleManPage/myPhoto.png","SaleManPage/myRank.png","SaleManPage/myRank_btn.png","SaleManPage/nothing.png","SaleManPage/pass.png","SaleManPage/PeizeList_item_bg.png","SaleManPage/pic.png","SaleManPage/PictureBG.png","SaleManPage/pictureList_item_bianhaoBg.png","SaleManPage/prize.png","SaleManPage/rank.png","SaleManPage/rule.png","SaleManPage/shareBtn.png","SaleManPage/smalltitle.png","SaleManPage/title.png","SaleManPage/uoloadBtn.png","SaleManPage/uploadBg.png","SaleManPage/visit.png","SaleManPage/wait.png","SaleManPage/woman.png","sharePage/agentBg.png","sharePage/assist_btn.png","sharePage/assist_text.png","sharePage/bg.png","sharePage/btn.png","sharePage/hand.png","sharePage/join_btn.png","sharePage/logo.png","sharePage/normal.png","sharePage/share_btn.png","sharePage/zanBg.png","sharePage/zanBtn.png","SVG/1输出闪亮瞬间标题.svga","SVG/2输出去拜访icon.svga","SVG/3输出首页氛围.svga","SVG/4输出弹窗氛围.svga","SVG/5输出点击切换.svga","SVG/6输出礼盒氛围.svga","SVG/7输出礼盒动效.svga","TaskPop/already_btn.png","TaskPop/bg.png","TaskPop/bg_item.png","TaskPop/close.png","TaskPop/complete_btn.png","TaskPop/icon.png","TaskPop/longBackBtn.png","TaskPop/receive_btn.png","TaskPop/toShare_btn.png","UploadPop/bg.png","UploadPop/btn.png","UploadPop/cancel.png","UploadPop/confirm.png","UploadPop/gary_confirm.png","UploadPop/uplaod.png","UploadPop/white.png","userHomePage/3输出首页氛围.svga","userHomePage/bg.png","userHomePage/diolog.png","userHomePage/draw_btn.png","userHomePage/likeNum_icon.png","userHomePage/myLike_btn.png","userHomePage/nothing.png","userHomePage/prize_btn.png","userHomePage/produtBg.png","userHomePage/rule_btn.png","userHomePage/search_bg.png","userHomePage/search_btn.png","userHomePage/search_icon.png","userHomePage/sex1_icon.png","userHomePage/sex2_icon.png","userHomePage/task_btn.png","userHomePage/userIdBg.png","yinsirulepop/bg.png","yinsirulepop/btn.png","yinsirulepop/close.png"]}
\ No newline at end of file
export class CodeError {
name = 'CodeError';
code = '';
message = '';
stack;
payload;
constructor(input, message) {
if (typeof input === 'number' || typeof input === 'string') {
this.code = input + '';
} else if (typeof input === 'object') {
if (input['code']) {
this.code = input['code'];
} else {
if (input instanceof Error) {
this.code = input['message'];
} else {
console.warn('input without code field:', JSON.stringify(input));
}
}
if (input['message']) {
this.message = input['message'];
}
if (input['payload']) {
this.payload = input['payload'];
}
}
if (message) {
this.message = message;
}
this.stack = (new Error()).stack;
if (!Error['captureStackTrace'])
this.stack = (new Error()).stack;
else
Error['captureStackTrace'](this, this.constructor);
}
}
export const Errors = {
UNKNOWN: 200001, // 未知异常
NET_ERROR: 210001, // 网络异常
// REQUEST_TIMEOUT, // 请求超时
// POLLING_TIMEOUT, // 轮询超时
// INVALID_RESPONSE, // 无效的响应体
// CALL_LIMITING, // 接口限流
GET_PX_TOKEN_FAILED: 220001, // 获取星速台token失败
};
import { callApi, jsonp } from '@spark/api-base';
import { evalJsScript } from '@spark/utils';
import { CodeError } from "./common-helpers/CodeError";
import { Errors as ERRORS } from "./common-helpers/errors";
const isProd = location.href.indexOf('.com.cn/projectx') >= 0;
let pxTokenKeyValid = false;
let getting = false;
const _queue = [];
/**
* 获取token
* @ctype PROCESS
* @description 获取星速台防刷token
* @returns
* token string token
* @example 一般用法
* const token = await getPxToken().catch(e=>{
* console.log('获取失败,失败原因:', e.message)
* })
* if(token){
* console.log('获取成功,token:', token)
* }
*/
export async function getPxToken() {
if (!isProd) {
console.log('[Mock] getPxToken');
return 'test_token';
}
return new Promise((resolve, reject) => {
_queue.push({resolve, reject});
setTimeout(_getPxToken, 10);
});
}
async function _getPxToken() {
if (getting) {
return;
}
if (_queue.length > 0) {
const p = _queue.shift();
try {
getting = true;
const token = await _tryGetPxToken();
p.resolve(token);
getting = false;
setTimeout(_getPxToken, 10);
} catch (e) {
getting = false;
p.reject(e);
}
}
}
async function _tryGetPxToken() {
let token, err;
for (let i = 0; i < 2; i++) {
try {
token = await _doGetPxToken();
break;
} catch (e) {
err = e;
invalidPxTokenKey();
}
}
if (token) {
return token;
} else {
throw err;
}
}
async function _doGetPxToken() {
if (!pxTokenKeyValid) {
await refreshPxTokenKey();
}
return getToken();
}
/**
* 让tokenKey失效
* @ctype PROCESS
* @description 比如活动页跳转到其他星速台页面,回来的时候就需要监听history然后让tokenKey失效
* @example 一般用法
* invalidPxTokenKey()
*/
export function invalidPxTokenKey() {
pxTokenKeyValid = false;
}
async function refreshPxTokenKey() {
if (!isProd) {
pxTokenKeyValid = true;
console.log('[Mock] refreshPxTokenKey');
return;
}
pxTokenKeyValid = false;
await jsonp('getTokenKey?_t=' + Date.now());
pxTokenKeyValid = true;
}
async function getToken() {
const resp = await callApi('getToken', undefined, undefined, undefined, false);
if (resp.success) {
evalJsScript(resp.data);
const token = window['ohjaiohdf']();
if (token) {
return token;
}
throw new CodeError(ERRORS.GET_PX_TOKEN_FAILED, '获取token失败,请查明key是否被覆盖');
} else {
throw new CodeError(resp);
}
}
/**
* index.jsx
* Created by 还有醋v on 2022/10/10 下午3:03.
* Copyright © 2022 haiyoucuv. All rights reserved.
*/
import React, { useState } from "react";
/**
* @param children
* @param className
* @param onClick
* @param style
* @return {React.DetailedReactHTMLElement<{onTouchStart: onTouchStart, onClick: (function(): any), onTouchCancel: onTouchEnd, className, style: {transform: string, transitionDuration: number}, onTouchEnd: onTouchEnd}, HTMLElement>}
* @constructor
*/
export const Button = ({ children, className, onClick = () => void 0, style = {} }) => {
const [scale, setScale] = useState("unset");
const onTouchStart = () => {
setScale("scale(0.9,0.9)");
};
const onTouchEnd = () => {
setScale("unset");
};
const onTouchCancel = onTouchEnd;
return React.createElement("div", {
className, onTouchStart, onTouchEnd, onTouchCancel, onClick, style: {
transitionDuration: 0.5, transform: scale, ...style
}
}, children);
};
import React from "react";
import {observer} from "mobx-react";
import "./CodePop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import QRCode from "qrcode";
import store from "@src/store";
import {LOG_KEY, pageView, sensorLog} from "@src/utils/sensors";
@observer
class CodePop extends React.Component {
state = {
codeImg: ""
};
componentDidMount = async () => {
await this.creatCode();
pageView("b12119", {
page_name: "扫码唤端页",
});
sensorLog(LOG_KEY.exposure, "b12119", "d12120", {
page_name: "扫码唤端页",
button_name: "关闭按钮",
});
};
/** 生成二维码*/
creatCode = async () => {
await store.getFrontVariable();
const url = await QRCode.toDataURL(store.frontVariable?.Url,{
errorCorrectionLevel: 'L', // 纠错级别,可选值:'L'、'M'、'Q'、'H'
margin: 1, // 边距,单位:像素
});
this.setState({
codeImg: url
});
};
/** 关闭 */
clickClose = () => {
modalStore.closePop();
sensorLog(LOG_KEY.click, "b12119", "d12120", {
page_name: "扫码唤端页",
button_name: "关闭按钮",
});
};
render() {
const {codeImg} = this.state;
return <div className="CodePop modal_center">
<div className="light"/>
<div className="bg">
<img className="code" src={codeImg}/>
</div>
<Button className="close md48" onClick={this.clickClose}/>
</div>;
}
}
export default CodePop;
@import "../../res.less";
.CodePop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.light {
position: absolute;
left: 79px;
top: 275px;
width: 593px;
height: 593px;
// .sparkBg("common/light.png");
}
.bg {
position: absolute;
left: 110px;
top: 505px;
width: 529px;
height: 562px;
.sparkBg("CodePop/bg.png")
}
.code {
position: absolute;
left: 165px;
top: 272px;
width: 199px;
height: 197px;
//.sparkBg("CodePop/code.png")
}
.rankText {
font-size: 30px;
color: rgb(239, 125, 30);
text-transform: uppercase;
line-height: 1;
position: absolute;
left: 15px;
top: 360px;
text-align: center;
width: 490px;
.lineClamp1()
}
.know {
position: absolute;
left: 180px;
top: 829px;
width: 373px;
height: 110px;
.sparkBg("RankNoPrizePop/know.png")
}
.close {
position: absolute;
left: 345px;
top: 1097px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./ConfirmPop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import {Toast} from "@spark/ui";
import API from "@src/api";
import store from "@src/store";
import {PAGE_MAP} from "@src/utils/constants";
import {_asyncThrottle} from "@src/utils/utils";
@observer
class ConfirmPop extends React.Component {
clickCancel = () => {
modalStore.closePop("ConfirmPop");
};
clickConfirm = _asyncThrottle( async () => {
const {title, photoImg, content, confirm} = this.props.popData;
const {success} = await API.saveOrUpdateWork({
worksImg: photoImg,
worksTitle: title,
worksDesc: content,
lockAgree: confirm,
});
if (!success) return;
modalStore.closePopAll();
store.changePage(PAGE_MAP.HOME_PAGE);
Toast("上传成功,请耐心等待审核~");
});
render() {
const {title, photoImg} = this.props.popData;
console.log(title, photoImg);
return <div className="ConfirmPop modal_center">
<div className="light"/>
<div className="bg">
<div className="title">
活动期间仅可上传1张照片哦
</div>
<img className="picture" src={photoImg}/>
<div className="txt">
{title}
</div>
</div>
<Button className="confirm md18" onClick={this.clickConfirm}/>
<Button className="cancel md17" onClick={this.clickCancel}/>
</div>;
}
}
export default ConfirmPop;
@import "../../res.less";
.ConfirmPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.bg {
position: absolute;
left: 110px;
top: 456px;
width: 529px;
height: 662px;
.sparkBg("ConfirmPop/bg.png")
}
.title {
font-size: 25px;
color: rgb(239, 125, 30);
line-height: 3.823;
text-align: center;
position: absolute;
left: 110px;
top: 120px;
}
.picture {
border-radius: 26px;
background-color: rgb(233, 219, 189);
position: absolute;
left: 155px;
top: 245px;
width: 220px;
height: 218px;
}
.txt{
font-size: 25px;
color: rgb(239, 125, 30);
line-height: 3.823;
text-align: center;
position: absolute;
left: 30px;
width: 460px;
top: 455px;
}
.confirm {
position: absolute;
left: 375px;
top: 985px;
width: 207px;
height: 80px;
.sparkBg("ConfirmPop/confirm.png")
}
.cancel {
position: absolute;
left: 168px;
top: 992px;
width: 191px;
height: 71px;
.sparkBg("ConfirmPop/cancel.png")
}
}
\ No newline at end of file
import React, { useState } from "react";
import { observer } from "mobx-react";
import "./FillAddress.less";
import store from "@src/store";
import { emojiReg, REG_TEL, specialStrReg } from "@src/utils/constants";
// import modalStore from "@src/store/modal";
// import { Button } from "@src/components/Button";
import { Toast } from "@spark/ui";
import API from "@src/api";
import { callApi } from "@spark/api-base";
// import { LOG_KEY, pageView, sensorLog } from "@src/utils/sensors";
import taskStore from "@src/store/task";
import { _asyncThrottle } from "../../utils/utils";
import modalStore from "../../store/modal";
import { Button } from "../Button";
import { handleLogClick, handleLogExposure } from "../../../MD";
// wzjTODO 换皮
@observer
class FillAddress extends React.Component {
fillMd=false
state = {
name: "",
mobile: "",
area: "",
province: "",
city: "",
street: "",
detail: "",
addrCode: "",
}
componentDidMount() {
handleLogExposure(32)
// this.initSensor();
}
initSensor(){
pageView("b7391", {
page_name: "地址填写页",
});
sensorLog(LOG_KEY.exposure, "b7391", "d7393", {
page_name: "地址填写页",
button_name: "提交信息按钮",
});
}
ClickClose = () => {
modalStore.closePop("FillAddress")
}
onNameInput = (e) => {
let value = e.target.value
// value = value.replace(emojiReg, '');
// value = value.replace(specialStrReg, '');
this.setState({
name: value,
});
};
onMobileInput = (e) => {
this.setState({
mobile: e.target.value.replace(/[^\d]/g, ''),
});
};
onDetailInput = (e) => {
let value = e.target.value;
// value = value.replace(emojiReg, '');
// value = value.replace(specialStrReg, '');
this.setState({
detail: value,
});
};
clickArea = () => {
modalStore.pushPop("Selectmodal", {
doSelect: this.doSelect,
},true);
}
doSelect = ({province, city, area, street, addrCode,}) => {
this.setState({
province,
city,
area,
street,
addrCode,
});
}
clickSubmit = _asyncThrottle(async () => {
handleLogClick(32)
// sensorLog(LOG_KEY.click, "b7391", "d7393", {
// page_name: "地址填写页",
// button_name: "提交信息按钮",
// });
const {
name, mobile,
area, province, city, street, addrCode,
detail
} = this.state;
if (!REG_TEL.test(mobile)) {
return Toast('请输入正确的手机号~');
}
const { projectId, saveAddresUrl, getPrize, recordId, agentCode, prizeProjectId} = this.props?.popData;
let res = await callApi(saveAddresUrl, {
province,
city,
area,
detail,
name,
mobile,
recordId,
agentCode,
street,
projectId:prizeProjectId,
addrCode,
from: CFG.channel || "2",
actPlatforms: CFG.actPlatforms,
actId: CFG.actId,
});
getPrize(projectId);
modalStore.closePop("FillAddress");
// const {success, data} = await API.saveOrUpdateAddress({
// name, mobile,
// province, city, area, street,
// addrCode,
// detail,
// });
// if (!success) return;
// store.changePage("ClaimList");
});
clickSubmitNoAct = () => {
handleLogClick(32)
Toast("请先填写完整信息", 1800, {hideOthers: true});
}
render() {
const {name, mobile, area, province, city, street, detail} = this.state;
const isFill = Boolean(name && mobile && area && province && city && detail);
if(this.fillMd != isFill){
console.log("曝光埋点")
handleLogExposure(32);
this.fillMd = isFill;
}
return <div className="FillAddress">
<div className="bg" />
<Button className="button-return" onClick={this.ClickClose} />
<div className="infoList">
<div className="inputG inputName">
<div className="igLabel">收货人</div>
<input
className="igInput inputStyle"
placeholder="收货人姓名"
value={name}
maxLength={10}
onChange={this.onNameInput}
/>
</div>
<div className="inputG inputMobile">
<div className="igLabel">手机号码</div>
<input
className="igInput inputStyle"
placeholder="收货人手机号码"
value={mobile}
maxLength="11"
onChange={this.onMobileInput}
/>
</div>
<div className="inputG inputArea">
<div className="igLabel">所在地区</div>
<div
className={`igDiv ${province ? "" : "igInputGray"}`}
placeholder="选择省/市/区"
onClick={this.clickArea}
>
{province ? `${province}/${city}/${area}${!!street ? `/${street}` : ""}` : "选择省/市/区/街道"}
</div>
<div className="button-select" onClick={this.clickArea} />
</div>
<div className="inputG inputAddress">
<div className="igLabel">详细地址</div>
<input
className="igInput inputStyle"
placeholder="请填写详细地址"
value={detail}
onChange={this.onDetailInput}
maxLength={100}
/>
</div>
</div>
{
isFill
? <Button className="submitAct" onClick={this.clickSubmit} />
: <Button className="submitNoAct" onClick={this.clickSubmitNoAct} />
}
</div>;
}
}
export default FillAddress;
@import "../../res.less";
.FillAddress {
.bg {
position: absolute;
left: 0px;
top: 0px;
width: 750px;
height: 1624px;
.sparkBg("FillAddress/填写收货地址.png");
}
.button-return {
position: absolute;
left: 51px;
top: 183px;
width: 23px;
height: 32px;
// transform-origin: left center;
.sparkBg("FillAddress/返回按钮.png");
}
.submitNoAct {
// opacity: 0.502;
position: absolute;
left: 154px;
top: 850px;
width: 442px;
height: 104px;
.sparkBg("FillAddress/提交信息按钮-不可点击.png");
}
.submitAct {
position: absolute;
left: 154px;
top: 850px;
width: 442px;
height: 104px;
.sparkBg("FillAddress/提交信息按钮-可点击.png");
}
.infoList {
position: absolute;
top: 300px;
width: 750px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.inputG {
position: relative;
margin-bottom: 51px;
width: 634px;
height: 80px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
display: flex;
align-items: center;
font-size: 30px;
color: #656565;
.igLabel {
margin-left: 8px;
margin-right: auto;
}
.igInput {
font-size: 30px;
width: 70%;
height: 100%;
border: none;
}
.igInputGray {
color: #7f7f7f;
}
.igDiv {
font-size: 30px;
width: 70%;
height: 100%;
border: none;
display: flex;
align-items: center;
justify-content: flex-start;
}
}
.button-select {
width: 15px;
height: 26px;
.sparkBg("FillAddress/选择按钮.png");
position: absolute;
right: 0;
}
}
}
import React from "react";
import {observer} from "mobx-react";
import "./GuidePop.less";
import store from "@src/store";
import {PAGE_MAP} from "@src/utils/constants";
import modalStore from "@src/store/modal";
@observer
class GuidePop extends React.Component {
state = {
guideStep: 1,
};
clickNext = () => {
const {guideStep} = this.state;
this.setState({
guideStep: guideStep + 1,
});
};
clickToHomePage = () => {
modalStore.closePop();
store.changePage(PAGE_MAP.SALE_PAGE)
};
render() {
const {guideStep} = this.state;
return <div className="GuidePop modal_center">
<div className="bg"/>
{
guideStep === 1 && <div className="guide1 md4" onClick={this.clickNext}>
<div className="title"/>
<div className="light"/>
<div className="card"/>
<div className="btn"/>
</div>
}
{
guideStep === 2 && <div className="guide2 md5" onClick={this.clickNext}>
<div className="ip"/>
<div className="upload"/>
<div className="txt">
点击屏幕继续
</div>
</div>
}
{
guideStep === 3 && <div className="guide3 md6" onClick={this.clickToHomePage}>
<div className="prize"/>
<div className="ip2"/>
<div className="txt2">
点击屏幕继续
</div>
</div>
}
</div>;
}
}
export default GuidePop;
@import "../../res.less";
.GuidePop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.bg {
position: absolute;
left: 0px;
top: 0px;
width: 750px;
height: 1624px;
.sparkBg("GuidePop/bg.png")
}
.guide1 {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.title {
position: absolute;
left: 110px;
top: 266px;
width: 540px;
height: 210px;
.sparkBg("GuidePop/title.png")
}
.light {
position: absolute;
left: 2px;
top: 370px;
width: 769px;
height: 868px;
.sparkBg("GuidePop/light.png")
}
.card {
position: absolute;
left: 150px;
top: 521px;
width: 545px;
height: 708px;
.sparkBg("GuidePop/card.png")
}
.btn {
position: absolute;
left: 180px;
top: 1221px;
width: 373px;
height: 110px;
.sparkBg("GuidePop/btn.png")
}
}
.guide2 {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.ip {
position: absolute;
left: 103px;
top: 856px;
width: 598px;
height: 245px;
.sparkBg("GuidePop/ip.png")
}
.upload {
position: absolute;
left: 20px;
top: 1173px;
width: 709px;
height: 207px;
.sparkBg("GuidePop/upload.png")
}
.txt {
font-size: 24px;
color: rgb(222, 222, 222);
position: absolute;
left: 0px;
width: 750px;
text-align: center;
top: 1393px;
}
}
.guide3 {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.prize {
position: absolute;
left: 9px;
top: 724px;
width: 149px;
height: 139px;
.sparkBg("GuidePop/prize.png")
}
.ip2 {
position: absolute;
left: 87px;
top: 856px;
width: 614px;
height: 245px;
.sparkBg("GuidePop/ip2.png")
}
.txt2 {
font-size: 24px;
color: rgb(222, 222, 222);
position: absolute;
left: 0px;
width: 750px;
text-align: center;
top: 1393px;
}
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./LoginPop.less";
import {Button} from "@src/components/Button";
import {Toast} from "@spark/ui";
import API from "@src/api";
import {_asyncThrottle, getUrlParam} from "@src/utils/utils";
import {REG_TEL} from "@src/utils/constants";
import modalStore from "@src/store/modal";
import {LOG_KEY, pageView, sensorLog} from "@src/utils/sensors";
@observer
class LoginPop extends React.Component {
state = {
phone: "",
code: "",
isSend: false,
reSend: false,
cd: 60,
};
componentDidMount() {
pageView("b12081", {
page_name: "手机号登录页",
});
sensorLog(LOG_KEY.exposure, "b12081", "d12083", {
page_name: "手机号登录页",
button_name: "登录按钮",
});
sensorLog(LOG_KEY.exposure, "b12081", "d12082", {
page_name: "手机号登录页",
button_name: "发送验证码按钮",
});
}
startCd = () => {
this.cdInterval = setInterval(() => {
const cd = this.state.cd -= 1;
this.setState({
cd,
});
if (cd <= 0) {
clearInterval(this.cdInterval);
this.setState({
isSend: false,
reSend: true,
});
}
}, 1000);
};
clickSend = _asyncThrottle(async () => {
sensorLog(LOG_KEY.click, "b12081", "d12082", {
page_name: "手机号登录页",
button_name: "发送验证码按钮",
});
const {phone} = this.state;
if (!phone) {
return Toast("请输入手机号");
}
if (!REG_TEL.test(phone)) {
return Toast("请输入正确的手机号~");
}
await this.getCode(phone);
});
closeLogin = _asyncThrottle(async () => {
sensorLog(LOG_KEY.click, "b12081", "d12083", {
page_name: "手机号登录页",
button_name: "登录按钮",
});
const {phone, code} = this.state;
if (!phone) {
return Toast("请输入手机号");
}
if (!REG_TEL.test(phone)) {
return Toast("请输入正确的手机号~");
}
if (!code) { // 未输入验证码
return Toast("请输入验证码");
}
await this.bindPhone();
});
getCode = async (phoneNum) => {
const params = {
appId: getUrlParam("appID"),
mobile: phoneNum,
};
const {success} = await API.getCode(params);
if (success) {
Toast("验证码已发送");
this.setState({
isSend: true,
cd: 60,
});
this.startCd();
}
};
bindPhone = async () => {
const {phone, code} = this.state;
const param = {
mobile: phone,
code: code,
redirectUrl: encodeURIComponent(window.location.href),
};
const {success, data, desc} = await API.bindPhone(param);
if (success) {
if(location.href.indexOf('localhost') > -1){
modalStore.closePop('Login')
}else{
location.replace(data);
}
} else {
Toast(desc);
}
};
// 输入手机号
onPhoneInput = (e) => {
let lastValue = "";
let currentValue = e.target.value;
if (currentValue !== lastValue) {
this.setState({
reSend: false
});
}
this.setState({
phone: e.target.value.replace(/[^\d]/g, ""),
});
};
onCodeInput = (e) => {
this.setState({
code: e.target.value.replace(/[^\d]/g, ""),
});
};
render() {
const {phone, code, isSend, cd, reSend} = this.state;
const loginBtnCls = phone && code ? "LoginBtn md2" : "LoginBtnNoAct md2";
return <div className="LoginPop modal_center">
<div className="light"/>
<div className="bg">
<input
className="input phoneInput"
placeholder="输入手机号"
maxLength="11"
value={phone}
autoComplete="off"
onChange={this.onPhoneInput}
/>
<input
className="input codeInput"
placeholder="输入验证码"
maxLength="8"
value={code}
autoComplete="off"
onChange={this.onCodeInput}
/>
{
isSend ? <div className="sendCode">{cd}s</div>
: <div
className={reSend ? "sendCode" : "sendBtn md1"}
onClick={this.clickSend}>
{reSend ? "重新发送" : "发送验证码"}
</div>
}
<Button className={loginBtnCls} onClick={this.closeLogin}/>
</div>
</div>;
}
}
export default LoginPop;
@import "../../res.less";
.LoginPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.BG {
position: absolute;
left: 0px;
top: 0px;
width: 750px;
height: 1624px;
.sparkBg("SaleManPage/PictureBG.png");
}
.light {
position: absolute;
left: 79px;
top: 275px;
width: 593px;
height: 593px;
// .sparkBg("common/light.png");
}
.bg {
position: absolute;
left: 110px;
top: 506px;
width: 529px;
height: 565px;
.sparkBg("LoginPop/bg.png");
.input {
background-color: #fff2dc;
position: absolute;
left: 57px;
width: 410px;
height: 73px;
border-radius: 10px;
padding: 0 10px;
box-sizing: border-box;
font-size: 26px;
outline: none;
border: none;
border: 2px solid #e49224;
// border-width: 2px;
// border-color: #e49224;
color: #b66019;
}
input::placeholder {
color: #d3bd97;
}
.phoneInput {
top: 204px;
}
.codeInput {
width: 221px;
top: 293px;
}
.sendBtn {
width: 198px;
height: 73px;
line-height: 73px;
font-size: 26px;
text-decoration: underline;
text-underline-offset: 7px;
color: #ef7d1e;
text-align: center;
position: absolute;
left: 280px;
top: 293px;
display: flex;
align-items: center;
justify-content: center;
}
.sendCode {
width: 198px;
height: 73px;
line-height: 73px;
font-size: 26px;
text-decoration: underline;
text-underline-offset: 5px;
color: #ef7d1e;
text-align: center;
position: absolute;
left: 280px;
top: 293px;
display: flex;
align-items: center;
justify-content: center;
}
.LoginBtn {
position: absolute;
left: 70px;
top: 391px;
width: 373px;
height: 110px;
.webpBg("LoginPop/canSubmitBtn.png");
}
.LoginBtnNoAct {
position: absolute;
left: 70px;
top: 391px;
width: 373px;
height: 110px;
.webpBg("LoginPop/cannotSubmit.png");
}
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./NoPrizeCard.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import {SvgaPlayer} from "@spark/svgaplayer";
import {RES_PATH} from "../../../sparkrc";
import {Swiper} from "antd-mobile";
import {LOG_KEY, pageView, sensorLog} from "@src/utils/sensors";
@observer
class NoPrizeCard extends React.Component {
state = {
card: true
};
componentDidMount() {
pageView("b12137", {
page_name: "祝福语翻转页",
});
sensorLog(LOG_KEY.exposure, "b12137", "d12138", {
page_name: "祝福语翻转页",
button_name: "点击切换有惊喜按钮",
});
}
/** 切换按钮*/
clickExchange1 = () => {
sensorLog(LOG_KEY.click, "b12137", "d12138", {
page_name: "祝福语翻转页",
button_name: "点击切换有惊喜按钮",
});
this.setState({
card: false,
svg: true
});
setTimeout(()=>{
this.setState({
svg: false,
card: false,
});
},2000)
};
/** 关闭按钮*/
clickClose = () => {
modalStore.closePop();
};
render() {
const {card,svg} = this.state;
const {data,type} = this.props.popData;
console.log(data,123123,type);
return <div className="NoPrizeCard modal_center">
{
card === true ? <div className="card1">
<div className="bg"/>
<div className="camera"/>
<div className="title"/>
</div>
: (type === 1 ? <Swiper className="prodSwiper"
indicatorProps={{ style: { display: "none" } }}
>
{
data?.productInfos?.map((item,index)=>{
return <Swiper.Item className="prodItem" key={index}>
<img className="bg2" src={item?.productImg}/>
<div className="txt">
{item?.productText}
</div>
</Swiper.Item>
})
}
</Swiper> : <Swiper className="prodSwiper"
indicatorProps={{ style: { display: "none" } }}
>
{
data?.productInfos?.productInfos?.map((item,index)=>{
return <Swiper.Item className="prodItem" key={index}>
<img className="bg2" src={item?.productImg}/>
<div className="txt">
{item?.productText}
</div>
</Swiper.Item>
})
}
</Swiper>
)
}
{
svg && <SvgaPlayer className="svgcard" src={RES_PATH + "SVG/5输出点击切换.svga"}/>
}
{
card === true && <Button className="exchange1 md46" onClick={this.clickExchange1}/>
}
<Button className="close md47" onClick={this.clickClose}/>
</div>;
}
}
export default NoPrizeCard;
@import "../../res.less";
.NoPrizeCard {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.bg {
position: absolute;
left: 107px;
top: 412px;
width: 542px;
height: 736px;
.sparkBg("NoPrizeCard/bg.png")
}
.camera {
position: absolute;
left: 98px;
top: 935px;
width: 541px;
height: 210px;
.sparkBg("NoPrizeCard/camera.png")
}
.prodSwiper {
position: absolute;
top: 0px;
width: 750px;
height: 1258px;
transition: transform 288ms linear;
transition-delay: 288ms;
.prodItem {
display: flex;
align-items: center;
justify-content: center;
.bg2 {
position: absolute;
left: 107px;
top: 412px;
width: 542px;
height: 736px;
}
.prize {
position: absolute;
left: 160px;
top: 463px;
width: 430px;
height: 465px;
object-fit: contain;
.sparkBg("NoPrizeCard/prizeImg.png")
}
.txt {
font-size: 24px;
color: rgb(163, 55, 33);
line-height: 1.333;
text-align: left;
position: absolute;
left: 162px;
top: 960px;
width: 422px;
height: 125px;
.lineClampN(4)
}
}
}
.title {
position: absolute;
left: 286px;
top: 955px;
width: 180px;
height: 125px;
.sparkBg("NoPrizeCard/title.png")
}
.exchange1 {
position: absolute;
left: 279px;
top: 1170px;
width: 191px;
height: 29px;
.sparkBg("NoPrizeCard/exchange.png")
}
.exchange2 {
position: absolute;
left: 304px;
top: 1170px;
width: 132px;
height: 29px;
.sparkBg("NoPrizeCard/exchange2.png")
}
.close {
position: absolute;
left: 345px;
top: 1258px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
.svgcard {
position: absolute;
left: 42px;
top: 412px;
width: 611px;
height: 777px;
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./PrivacyPop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
@observer
class PrivacyPop extends React.Component {
clickClose = () => {
modalStore.closePop("PrivacyPop");
};
render() {
const {agreeText} = this.props.popData;
return <div className="PrivacyPop modal_center">
<div className="light"/>
<div className="bg">
<div className="rankText" dangerouslySetInnerHTML={{__html:agreeText}}/>
</div>
<Button className="close md44" onClick={this.clickClose}/>
</div>;
}
}
export default PrivacyPop;
@import "../../res.less";
.PrivacyPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.bg {
position: absolute;
left: 109px;
top: 321px;
width: 529px;
height: 924px;
.sparkBg("yinsirulepop/bg.png")
}
.rankText {
font-size: 24px;
color: rgb(75, 38, 20);
line-height: 1.5;
text-align: left;
position: absolute;
left: 40px;
top: 400px;
width: 480px;
height: 630px;
overflow-x: hidden;
overflow-y: auto;
}
.close {
position: absolute;
left: 345px;
top: 1343px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./PrizePop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import {RES_PATH} from "../../../sparkrc";
import {SvgaPlayer} from "@spark/svgaplayer";
import {LOG_KEY, pageView, sensorLog} from "@src/utils/sensors";
@observer
class PrizePop extends React.Component {
componentDidMount() {
pageView("b12121", {
page_name: "中奖弹窗",
});
sensorLog(LOG_KEY.exposure, "b12121", "d12123", {
page_name: "中奖弹窗",
button_name: "关闭按钮",
});
sensorLog(LOG_KEY.exposure, "b12121", "d12122", {
page_name: "中奖弹窗",
button_name: "开心收下按钮",
});
}
clickHappy = () => {
modalStore.closePop();
sensorLog(LOG_KEY.click, "b12121", "d12122", {
page_name: "中奖弹窗",
button_name: "开心收下按钮",
});
};
clickClose = () => {
modalStore.closePop();
sensorLog(LOG_KEY.click, "b12121", "d12123", {
page_name: "中奖弹窗",
button_name: "关闭按钮",
});
};
render() {
const {data} = this.props.popData;
console.log(data, 123123);
return <div className="PrizePop modal_center">
<SvgaPlayer className="light" src={RES_PATH + "SVG/6输出礼盒氛围.svga"}/>
<div className="bg">
<img className="prizeImg" src={data?.prizeImg}/>
<div className="prizeText">
{data?.prizeName}
</div>
<div className="txt">
奖品可在首页-[奖品]中查看
</div>
</div>
<Button className="happy md22" onClick={this.clickHappy}/>
<Button className="close" onClick={this.clickClose}/>
</div>;
}
}
export default PrizePop;
@import "../../res.less";
.PrizePop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.light {
position: absolute;
left: 0px;
top: 350px;
width: 750px;
height: 966px;
}
.bg {
position: absolute;
left: 56px;
top: 313px;
width: 620px;
height: 865px;
.sparkBg("PrizePop/bg.png")
}
.rankText {
font-size: 24px;
color: rgb(239, 125, 30);
text-transform: uppercase;
line-height: 3.2;
position: absolute;
left: 10px;
top: 280px;
text-align: center;
width: 465px;
.lineClamp1()
}
.prizeImg {
position: absolute;
left: 207px;
top: 417px;
width: 220px;
height: 220px;
.sparkBg("RankPrizePop/prizePicture.png")
}
.prizeText {
color: rgb(239, 125, 30);
font-size: 24px;
text-transform: uppercase;
line-height: 2;
position: absolute;
left: 80px;
top: 643px;
text-align: center;
width: 460px;
.lineClamp1()
}
.txt {
font-size: 19px;
color: rgb(204, 135, 70);
text-transform: uppercase;
line-height: 1.2;
text-align: center;
position: absolute;
left: 90px;
width: 460px;
top: 801px;
}
.happy {
position: absolute;
left: 199px;
top: 1029 - 40px;
width: 348px;
height: 102px;
.sparkBg("common/happyBtn.png")
}
.close {
position: absolute;
left: 345px;
top: 1243px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
import React from "react";
import {observer} from "mobx-react";
import "./RankNoPrizePop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import store from "@src/store";
@observer
class RankNoPrizePop extends React.Component {
clickClose = () => {
modalStore.closePop();
}
render() {
const {data} = this.props.popData;
return <div className="RankNoPrizePop modal_center">
<div className="light"/>
<div className="bg">
<div className="rankText">
最终排名为{+data.rank == -1 ? "500+" : data.rank}
</div>
</div>
<Button className="know md41" onClick={this.clickClose}/>
<Button className="close" onClick={this.clickClose}/>
</div>;
}
}
export default RankNoPrizePop;
@import "../../res.less";
.RankNoPrizePop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.light {
position: absolute;
left: 79px;
top: 275px;
width: 593px;
height: 593px;
// .sparkBg("common/light.png");
}
.bg {
position: absolute;
left: 110px;
top: 482px;
width: 529px;
height: 520px;
.sparkBg("RankNoPrizePop/bg.png")
}
.rankText {
font-size: 30px;
color: rgb(239, 125, 30);
text-transform: uppercase;
line-height: 1;
position: absolute;
left: 15px;
top: 267px;
text-align: center;
width: 490px;
.lineClamp1()
}
.know {
position: absolute;
left: 180px;
top: 829px;
width: 373px;
height: 110px;
.sparkBg("RankNoPrizePop/know.png")
}
.close {
position: absolute;
left: 345px;
top: 1082px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./RankPrizePop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import {SvgaPlayer} from "@spark/svgaplayer";
import {RES_PATH} from "../../../sparkrc";
@observer
class RankPrizePop extends React.Component {
clickClose = () => {
modalStore.closePop();
}
render() {
const {data} = this.props.popData;
return <div className="RankPrizePop modal_center">
<SvgaPlayer className="light" src={RES_PATH + "SVG/6输出礼盒氛围.svga"}/>
<div className="bg">
<div className="rankText">
最终排名为{data?.rank}
</div>
<img className="prizeImg" src={data?.prizeImg}/>
<div className="prizeText">
{data?.prizeName}
</div>
<div className="txt">
奖品可在首页_我的奖品中查看
</div>
</div>
<Button className="happy md40" onClick={this.clickClose}/>
<Button className="close" onClick={this.clickClose}/>
</div>;
}
}
export default RankPrizePop;
@import "../../res.less";
.RankPrizePop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.light {
position: absolute;
left: 0px;
top: 350px;
width: 750px;
height: 966px;
}
.bg {
position: absolute;
left: 56px;
top: 337px;
width: 620px;
height: 865px;
.sparkBg("RankPrizePop/bg.png")
}
.rankText {
font-size: 24px;
color: rgb(239, 125, 30);
text-transform: uppercase;
line-height: 3.2;
position: absolute;
left: 60px;
top: 305px;
text-align: center;
width: 500px;
.lineClamp1()
}
.prizeImg {
position: absolute;
left: 207px;
top: 425px;
width: 220px;
height: 220px;
.sparkBg("RankPrizePop/prizePicture.png")
}
.prizeText {
color: #ef7d1e;
font-size: 24px;
line-height: 2;
position: absolute;
left: 85px;
top: 651px;
text-align: center;
width: 450px;
.lineClamp1()
}
.txt {
font-size: 19px;
color: rgb(204, 135, 70);
text-transform: uppercase;
line-height: 1.2;
text-align: center;
position: absolute;
left: 60px;
width: 500px;
top: 805px;
}
.happy {
position: absolute;
left: 199px;
top: 1029px;
width: 348px;
height: 102px;
.sparkBg("common/happyBtn.png")
}
.close {
position: absolute;
left: 345px;
top: 1243px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
import React from "react";
import {observer} from "mobx-react";
import "./ReviewFailedPop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
@observer
class ReviewFailedPop extends React.Component {
/** 关闭按钮*/
clickClose = () => {
modalStore.closePop();
}
render() {
return <div className="ReviewFailedPop modal_center">
<div className="light"/>
<div className="bg">
<div className="rankText">
您上传的照片不符合上传规范, <br/>请认真阅读上传规则后重新上传~
</div>
</div>
<Button className="reSubmit md19" onClick={this.clickClose}/>
<Button className="close" onClick={this.clickClose}/>
</div>;
}
}
export default ReviewFailedPop;
@import "../../res.less";
.ReviewFailedPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.light {
position: absolute;
left: 79px;
top: 275px;
width: 593px;
height: 593px;
// .sparkBg("common/light.png");
}
.bg {
position: absolute;
left: 110px;
top: 515px;
width: 529px;
height: 512px;
.sparkBg("ReviewFailedPop/bg.png")
}
.rankText {
font-size: 25px;
color: rgb(239, 125, 30);
line-height: 1.449;
text-align: center;
position: absolute;
left: 15px;
top: 243px;
width: 490px;
.lineClampN(2)
}
.reSubmit {
position: absolute;
left: 180px;
top: 856px;
width: 373px;
height: 110px;
.sparkBg("ReviewFailedPop/reSubmit.png")
}
.close {
position: absolute;
left: 345px;
top: 1082px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./ReviewSucPop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import {CHANNEL_PARAMS} from "@src/utils/constants";
import {Toast} from "@spark/ui";
import API from "@src/api";
import {isWeChat} from "@src/utils/share";
import {SvgaPlayer} from "@spark/svgaplayer";
import {RES_PATH} from "../../../sparkrc";
import {_asyncThrottle} from "@src/utils/utils";
@observer
class ReviewSucPop extends React.Component {
state = {
drawResultInfo: {},
};
/** 去抽奖按钮*/
clickPrize = _asyncThrottle( async () => {
// 微信端拦截
if (isWeChat()) {
// 友客小程序
if (CFG.channel == CHANNEL_PARAMS.YK_MINI) {
return Toast("请前往人保寿险管家app活动抽奖~");
}
// 其他微信端 提醒唤端弹窗
else {
modalStore.closePop("ReviewSucPop");
return modalStore.pushPop("CodePop");
}
}
// 管家端拦截
if (CFG.channel == CHANNEL_PARAMS.RB_APP) {
const {success, data} = await API.salesManDraw();
if (!success) return;
this.setState({
drawResultInfo: data,
});
console.log(this.state.drawResultInfo, 321312);
if (this.state.drawResultInfo?.prizeId == "thanks") {
modalStore.closePop("ReviewSucPop");
modalStore.pushPop("NoPrizeCard", {data: this.state.drawResultInfo, type: 1});
} else {
modalStore.closePop("ReviewSucPop");
modalStore.pushPop("PrizePop", {data: this.state.drawResultInfo,type: 1});
}
}
});
render() {
const {data} = this.props.popData;
return <div className="ReviewSucPop modal_center">
<div className="title"/>
<div className="changeTxt">
成功获得抽奖机会+{data}
</div>
<SvgaPlayer className="light" src={RES_PATH + "SVG/6输出礼盒氛围.svga"}/>
<SvgaPlayer className="gift" src={RES_PATH + "SVG/7输出礼盒动效.svga"}/>
<Button className="chou md21" onClick={this.clickPrize}/>
</div>;
}
}
export default ReviewSucPop;
@import "../../res.less";
.ReviewSucPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.title {
position: absolute;
left: 150px;
top: 348px;
width: 446px;
height: 125px;
.sparkBg("ReviewSucPop/title.png")
}
.changeTxt {
font-size: 24px;
color: rgb(255, 255, 255);
line-height: 3.254;
text-align: center;
position: absolute;
left: 0;
width: 750px;
top: 480px;
.lineClamp1();
}
.light {
position: absolute;
left: 2px;
top: 379px;
width: 750px;
height: 966px;
}
.gift {
position: absolute;
left: 125px;
top: 600px;
width: 534px;
height: 519px;
}
.bg {
position: absolute;
left: 111px;
top: 363px;
width: 522px;
height: 630px;
.sparkBg("ReviewFailedPop/bg.png")
}
.chou {
position: absolute;
left: 180px;
top: 1180px;
width: 373px;
height: 110px;
.sparkBg("ReviewSucPop/chou.png")
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./RulePop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import store from "@src/store";
@observer
class RulePop extends React.Component {
clickClose = () => {
modalStore.closePop();
};
render() {
const { ruleText } = store.setIndex || {};
return <div className="RulePop modal_center">
<div className="light"/>
<div className="bg">
<div className="rankText" dangerouslySetInnerHTML={{__html: ruleText}}/>
</div>
<Button className="close md42" onClick={this.clickClose}/>
</div>;
}
}
export default RulePop;
@import "../../res.less";
.RulePop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.bg {
position: absolute;
left: 106px;
top: 337px;
width: 529px;
height: 908px;
.sparkBg("RulePop/bg.png")
}
.rankText {
font-size: 24px;
color: rgb(75, 38, 20);
line-height: 1.5;
text-align: left;
position: absolute;
left: 52px;
top: 242px;
width: 434px;
height: 599px;
// overflow-x: hidden;
overflow-y: auto;
word-wrap: break-word;
}
.close {
position: absolute;
left: 345px;
top: 1279px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./UploadPop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import {_asyncThrottle} from "@src/utils/utils";
import API from "@src/api";
import {Toast} from "@spark/ui";
import store from "@src/store";
import {LOG_KEY, pageView, sensorLog} from "@src/utils/sensors";
@observer
class UploadPop extends React.Component {
state = {
confirm: false, // 是否勾选协议
photoImg: "", // 图片
title: "", // 标题
content: "", // 内容
};
componentDidMount() {
pageView("b12101", {
page_name: "业务员端-上传作品页",
});
sensorLog(LOG_KEY.exposure, "b12101", "d12103", {
page_name: "业务员端-上传作品页",
button_name: "返回按钮",
});
sensorLog(LOG_KEY.exposure, "b12101", "d12102", {
page_name: "业务员端-上传作品页",
button_name: "确认上传按钮",
});
}
/** 关闭按钮*/
clickToBack = () => {
modalStore.closePop("UploadPop");
sensorLog(LOG_KEY.click, "b12101", "d12103", {
page_name: "业务员端-上传作品页",
button_name: "返回按钮",
});
};
/** 隐私协议打勾按钮*/
clickToConfirm = async () => {
this.setState({
confirm: true
});
};
/** 选择图片按钮*/
selectImg = _asyncThrottle(async (e) => {
const imgFile = e.target.files[0];
if (imgFile) {
const isLt1M = imgFile.size / 10240 / 10240 < 30;
if (!isLt1M) {
Toast("上传图片大小不能超过30Mb!");
return;
}
const reader = new FileReader();
reader.readAsDataURL(imgFile);
reader.onload = async () => {
const {success, data} = await API.uploadImg({
img64: reader.result,
});
if (success) {
this.setState({photoImg: data});
}
};
}
});
/** 标题输入框*/
onTitleInput = (e) => {
let value = e.target.value;
this.setState({
title: value,
});
};
/** 内容输入框*/
onContentInput = (e) => {
let value = e.target.value;
this.setState({
content: value,
});
};
/** 隐私协议弹窗按钮*/
clickToPrivacy = _asyncThrottle( async () => {
await store.getProductSearch();
modalStore.pushPop("PrivacyPop", {agreeText: store.setProductSearch?.worksAgreementText}, true);
});
/** 确认提交按钮*/
clickSubmit = _asyncThrottle(async () => {
sensorLog(LOG_KEY.click, "b12101", "d12102", {
page_name: "业务员端-上传作品页",
button_name: "确认上传按钮",
});
const {photoImg, title, content, confirm,} = this.state;
console.log(photoImg, 123, title, 123, content, 123, confirm, 123);
modalStore.pushPop("ConfirmPop", {photoImg, title, content, confirm}, true);
});
/** 置灰确认提交按钮*/
clickGarySubmit = _asyncThrottle(() => {
sensorLog(LOG_KEY.click, "b12101", "d12102", {
page_name: "业务员端-上传作品页",
button_name: "确认上传按钮",
});
const {photoImg, title, content, confirm,} = this.state;
if (!photoImg) {
return Toast("请先上传照片~");
} else if (!title) {
return Toast("请先输入作品标题~");
} else if (!content) {
return Toast("请先输入作品介绍~");
} else if (!confirm) {
return Toast("请勾选同意授权~");
}
});
cancel = () => {
this.setState({
photoImg: "",
});
};
render() {
const {confirm, title, content, photoImg} = this.state;
const isFill = title && content && photoImg && confirm;
return <div className="UploadPop">
<div className="bg"/>
<Button className="back md15" onClick={this.clickToBack}/>
<div className="white"/>
<input className="title"
value={title}
maxLength="10"
placeholder="请输入作品标题,10个字以内"
onChange={this.onTitleInput}
/>
<div className="line"/>
<textarea className="content"
value={content}
maxLength="200"
placeholder="请输入作品介绍,建议在100字以内(上传作品字数控制200字)"
onChange={this.onContentInput}
/>
{
photoImg ?
<>
<img className="upload_img" src={photoImg}/>
<Button className="cancel" onClick={this.cancel}/>
</>
:
<>
<Button className="upload_btn">
<input type="file" accept="image/*" onChange={this.selectImg}></input>
</Button>
</>
}
<div className="describe">
格式要求jpg、png大小不超过30kb 尺寸1024x768px
</div>
{
confirm ? <Button className="confirm_btn"/>
: <Button className="circle_btn" onClick={this.clickToConfirm}/>
}
<span className="txt">
我已阅读并同意
<Button className="privacy" onClick={this.clickToPrivacy}>
《用户协议》
</Button>
</span>
{
isFill ? <Button className="btn md16" onClick={this.clickSubmit}/>
: <Button className="gary_btn" onClick={this.clickGarySubmit}/>
}
</div>;
}
}
export default UploadPop;
@import "../../res.less";
.UploadPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 100%;
display: flex;
overflow-x: hidden;
overflow-y: scroll;
.back {
position: absolute;
left: 32px;
top: 85px;
width: 58px;
height: 58px;
.sparkBg("common/back.png")
}
.bg {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.sparkBg("UploadPop/bg.png")
}
.white {
position: absolute;
left: 17px;
top: 190px;
width: 727px;
height: 1435px;
.sparkBg("UploadPop/white.png")
}
input::placeholder {
color: rgb(181, 172, 153);
}
textarea::placeholder {
color: rgb(181, 172, 153);
}
.title {
position: absolute;
font-size: 33px;
background: #fffcf7;
width: 630px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
text-align: left;
left: 50px;
top: 253px;
border: none;
outline: none;
}
.line {
border-width: 0.01px;
border-color: rgb(143, 143, 143);
border-style: solid;
position: absolute;
left: 54px;
top: 328px;
width: 627px;
}
.content {
position: absolute;
font-size: 26px;
width: 630px;
height: 300px;
display: flex;
background: #fffcf7;
align-items: flex-start; // 修改为向上排列
justify-content: flex-start; // 修改为向左排列
text-align: left; // 设置文本左对齐
left: 50px;
top: 353px;
border: none;
outline: none;
word-wrap: break-word; // 强制文字在单词内换行
overflow-y: auto; // 当内容超出高度时显示滚动条
white-space: normal; // 允许文字换行
}
.circle_btn {
border-width: 2px;
border-color: rgb(181, 172, 153);
border-style: solid;
border-radius: 50%;
position: absolute;
left: 231px;
top: 1324px;
width: 19px;
height: 19px;
}
.confirm_btn {
position: absolute;
left: 231px;
top: 1320px;
width: 25px;
height: 27px;
.sparkBg("UploadPop/confirm.png")
}
.txt {
font-size: 22px;
color: rgb(181, 172, 153);
line-height: 1.864;
text-align: left;
position: absolute;
left: 262px;
top: 1315px;
}
.privacy {
font-size: 22px;
color: #ff8d2e;
line-height: 1.864;
text-align: left;
position: absolute;
left: 150px;
top: 0px;
width: 200px;
text-decoration: underline;
text-underline-offset: 5px;
}
.upload_img {
border-radius: 26px;
background-color: rgb(233, 219, 189);
position: absolute;
left: 70px;
top: 874px;
width: 256px;
height: 254px;
object-fit: contain;
}
.cancel {
position: absolute;
left: 292px;
top: 864px;
width: 47px;
height: 47px;
.sparkBg("UploadPop/cancel.png")
}
.upload_btn {
position: absolute;
left: 70px;
top: 874px;
width: 256px;
height: 254px;
.sparkBg("UploadPop/uplaod.png");
input {
position: absolute;
width: 256px;
height: 254px;
opacity: 0;
}
}
.describe {
font-size: 26px;
font-family: "SourceHanSansCN";
color: rgb(181, 172, 153);
line-height: 1.577;
text-align: left;
position: absolute;
left: 71px;
top: 1158px;
width: 406px;
}
.gary_btn {
position: absolute;
left: 188px;
top: 1352px;
width: 373px;
height: 110px;
.sparkBg("UploadPop/gary_confirm.png")
}
.btn {
position: absolute;
left: 188px;
top: 1352px;
width: 373px;
height: 110px;
.sparkBg("UploadPop/btn.png")
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './commentpop.less';
import { _asyncThrottle } from '@src/utils/utils';
import store from '@src/store';
import modalStore from '@src/store/modal';
import { Toast } from '@spark/ui';
import { Button } from '../Button';
@observer
class Commentpop extends React.Component {
constructor(props) {
super(props);
this.state = {
labNum: 0,
lab: ""
}
}
inputMes = (obj) => {
console.log(obj.target.value)
console.log(obj.target.id)
this.setState({
labNum: obj.target.value.length,
lab: obj.target.value
})
}
doComment = _asyncThrottle(() => {
if (this.state.labNum <= 0) {
Toast("请输入评论~")
return
}
store.doComment(this.state.lab)
})
closePop() {
modalStore.closePop("Commentpop")
}
render() {
return (
<div className="commentpop modal_center">
<span className="bg"></span>
<Button className="btn md3" onClick={this.doComment}></Button>
{/* <span className="lab">请输入评论内容50字以内</span> */}
<textarea className='labarea' maxLength={50} id="commentInfo" placeholder="请输入评论内容50字以内" onChange={this.inputMes}
autoComplete="off"></textarea>
<span className="labNum">{this.state.labNum}/50</span>
<Button className="close" onClick={this.closePop}></Button>
</div>
);
}
}
export default Commentpop;
@import "../../res.less";
.commentpop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
width: 565px;
height: 478px;
left: 98px;
top: 504px;
position: absolute;
.sparkBg("commentPop/bg.png");
}
.btn {
width: 329px;
height: 97px;
left: 210px;
top: 860px;
position: absolute;
.sparkBg("commentPop/btn.png");
}
.lab {
width: 258px;
height: 22px;
left: 148px;
top: 549px;
position: absolute;
font-size: 22px;
line-height: 22px;
color: rgba(139, 139, 139, 1);
}
.labarea {
width: 465px;
height: 242px;
left: 148px;
top: 549px;
position: absolute;
font-size: 22px;
line-height: 28px;
color: rgba(139, 139, 139, 1);
border: none;//不要边框
outline: none;//不要边框
background-color: transparent;// 背景色透明
}
.labNum {
width: 100px;
height: 22px;
left: 513px;
top: 802px;
text-align: right;
position: absolute;
font-size: 22px;
line-height: 22px;
color: rgba(139, 139, 139, 1);
}
.close {
width: 61px;
height: 62px;
left: 345px;
top: 1065px;
position: absolute;
.sparkBg("commentPop/close.png");
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './drawchancepop.less';
import { Button } from '../Button';
import { _throttle } from '@src/utils/utils';
import modalStore from '@src/store/modal';
@observer
class Drawchancepop extends React.Component {
constructor(props) {
super(props);
}
/** 关闭弹窗 */
closeDialog = _throttle(() => {
modalStore.closePop();
})
render() {
return (
<div className="drawchancepop modal_center md37">
<span className="light"></span>
<span className="bg"></span>
<span className="text">点赞任一闪光瞬间照片即可<br />获得一次抽奖机会哦~</span>
<Button className="know_btn" onClick={this.closeDialog}></Button>
<Button className="close" onClick={this.closeDialog}></Button>
</div>
);
}
}
export default Drawchancepop;
@import "../../res.less";
.drawchancepop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.light {
position: absolute;
left: 79px;
top: 275px;
width: 593px;
height: 593px;
// .sparkBg("drawChancePop/light.png");
}
.bg {
left: 110px;
top: 519px;
width: 529px;
height: 481px;
position: absolute;
.sparkBg("drawChancePop/bg.png");
}
.text {
width: 490px;
height: 50px;
left: 130px;
top: 753px;
position: absolute;
font-size: 25px;
line-height: 33px;
color: rgb(239, 125, 30);
text-align: center;
}
.know_btn {
left: 180px;
top: 840px;
width: 373px;
height: 110px;
position: absolute;
.sparkBg("drawChancePop/know_btn.png");
}
.close {
width: 61px;
height: 61px;
left: 345px;
top: 1082px;
position: absolute;
.sparkBg("common/closeBtn.png");
}
}
"use strict";
import React from "react";
import { observer } from "mobx-react";
import "./longImgPop.less";
import modalStore from "@src/store/modal";
import { _throttle } from "@src/utils/utils";
import { Button } from "../Button";
import DPlayer from "dplayer";
@observer
class LongImgPop extends React.Component {
constructor(props) {
super(props);
this.state = {
isFinish: false,
countdownTime: 15, // 单位s
};
this.timer = "";
this.isStart = false;
this.stop = false;
this.dp = null;
}
componentDidMount() {
if (this.props?.popData?.type == 2) {
this.dp = new DPlayer({
container: this.videoNode,
video: {
url: this.props?.popData?.imgUrl,
},
loop: true,
});
this.dp.on("play", () => {
this.startInterval();
});
this.dp.on("pause", () => {
// this.endCountDown()
});
}
if (this.props.popData?.noCount) {
this.setState({
isFinish: true,
});
} else {
if(this.props?.popData?.type == 2) return
this.startInterval();
}
}
componentWillUnmount() {
if (this.timer) clearInterval(this.timer);
}
/** 开始倒计时 */
startInterval = () => {
if (this.timer) clearInterval(this.timer);
this.timer = setInterval(async () => {
if (this.state.countdownTime === 0) {
this.setState({
isFinish: true,
});
clearInterval(this.timer);
this.timer = "";
// 完成任务
const { taskSucCb } = this.props?.popData || {};
taskSucCb && taskSucCb();
return;
}
this.setState({
countdownTime: Math.max(0, this.state.countdownTime - 1),
});
}, 1000);
};
/** 关闭当前页面 */
closeHandle = () => {
modalStore.closePop("LongImgPop");
if (!this.props.popData.noCount) {
modalStore.pushPop("Taskpop");
}
};
render() {
const { imgUrl, type } = this.props.popData || {};
const { isFinish, countdownTime } = this.state;
return (
<div className="longImgPop">
{type == 1 && <img src={imgUrl} alt="" className="mainImg" />}
{type == 2 && (
<div className="v-wrapper">
<div ref={(node) => (this.videoNode = node)} id="my-player" className="video-js"></div>
</div>
)}
<Button className="back_home" onClick={this.closeHandle}></Button>
{!isFinish && <span className="countdown">{`${countdownTime}s`}</span>}
</div>
);
}
}
export default LongImgPop;
@import "../../res.less";
.longImgPop {
position: absolute;
width: 100vw;
height: 100vh;
left: 0px;
top: 0px;
overflow-y: auto;
overflow-x: hidden;
background-color: rgba(0, 0, 0, 0.8);
.mainImg {
position: relative;
width: 100%;
height: auto;
}
.back_home {
width: 60px;
height: 60px;
left: 40px;
top: 65px;
position: fixed;
.sparkBg("PrizePage/back.png");
// .sparkBg("TaskPop/longBackBtn.png");
}
.countdown {
width: 113px;
height: 50px;
text-align: center;
position: fixed;
left: 588px;
top: 65px;
color: #fff;
border: 2px solid rgb(255, 255, 255);
border-left: none;
border-radius: 8px;
background-color: rgba(70, 0, 0, 0.302);
box-shadow: inset 0.707px 0.707px 2px 0px rgba(225, 253, 255, 0.83);
font-size: 31px;
text-align: center;
line-height: 50px;
box-sizing: border-box;
}
.v-wrapper {
width: 100%;
height: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.vjs-tech {
width: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
// .dplayer-controller{
// display: none;
// }
#my-player {
width: 100% !important;
// height: 420px;
position: absolute;
top: 50%;
transform: translateY(-50%);
// pointer-events: none;
}
.dplayer-setting-loop {
display: none !important;
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './nopointpop.less';
import modalStore from '@src/store/modal';
import { Button } from '../Button';
@observer
class Nopointpop extends React.Component {
constructor(props) {
super(props);
}
closePop() {
modalStore.closePop("Nopointpop")
}
openTask() {
modalStore.closePop("Nopointpop")
modalStore.pushPop("Taskpop")
}
render() {
return (
<div className="nopointpop modal_center">
<span className="li8ght"></span>
<span className="bg"></span>
<span className="lab">做任务可获得点赞次数哦~</span>
<Button className="btn md39" onClick={this.openTask}></Button>
<Button className="close" onClick={this.closePop}></Button>
</div>
);
}
}
export default Nopointpop;
@import "../../res.less";
.nopointpop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.li8ght {
width: 593px;
height: 593px;
left: 79px;
top: 275px;
position: absolute;
// .sparkBg("noPointPop/li8ght.png");
}
.bg {
width: 529px;
height: 481px;
left: 110px;
top: 520px;
position: absolute;
.sparkBg("noPointPop/bg.png");
}
.lab {
width: 322px;
height: 24px;
left: 217px;
top: 768px;
position: absolute;
font-size: 25px;
line-height: 24px;
color: rgba(239, 125, 30, 1);
}
.btn {
width: 373px;
height: 110px;
left: 180px;
top: 829px;
position: absolute;
.sparkBg("noPointPop/btn.png");
}
.close {
width: 61px;
height: 61px;
left: 345px;
top: 1082px;
position: absolute;
.sparkBg("noPointPop/close.png");
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './pointsucpop.less';
import modalStore from '@src/store/modal';
import store from '@src/store';
import { PAGE_MAP } from '@src/utils/constants';
@observer
class Pointsucpop extends React.Component {
constructor(props) {
super(props);
}
closePop() {
modalStore.closePop("Pointsucpop")
}
goDraw() {
modalStore.closePop("Pointsucpop")
store.changePage(PAGE_MAP.DRAW_PAGE)
}
render() {
return (
<div className="pointsucpop modal_center">
<span className="light"></span>
<span className="bg"></span>
<div className="prizebox">
<span className="lab">成功获得抽奖机会+{this.props.popData}</span>
<span className="box"></span>
</div>
<span className="btn md34" onClick={this.goDraw}></span>
<span className="close" onClick={this.closePop}></span>
</div>
);
}
}
export default Pointsucpop;
@import "../../res.less";
.pointsucpop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.light {
width: 750px;
height: 1093px;
left: 0px;
top: 235px;
position: absolute;
.sparkBg("pointSucPop/light.png");
}
.bg {
width: 620px;
height: 865px;
left: 56px;
top: 293px;
position: absolute;
.sparkBg("pointSucPop/bg.png");
}
.prizebox {
width: 252px;
height: 286px;
left: 243px;
top: 701px;
position: absolute;
.lab {
width: 227px;
height: 24px;
left: 28px;
top: 0px;
position: absolute;
font-size: 23px;
line-height: 24px;
color: rgba(239, 125, 30, 1);
}
.box {
width: 252px;
height: 232px;
left: 0px;
top: 54px;
position: absolute;
.sparkBg("pointSucPop/box.png");
}
}
.btn {
width: 348px;
height: 102px;
left: 199px;
top: 995px;
position: absolute;
.sparkBg("pointSucPop/btn.png");
}
.close {
width: 61px;
height: 61px;
left: 345px;
top: 1202px;
position: absolute;
.sparkBg("pointSucPop/close.png");
}
}
import React from "react";
import { observer } from "mobx-react";
import "./selectmodal.less";
import { Swiper, SwiperSlide } from "swiper/react";
// import 'style-loader!css-loader!swiper/swiper-bundle.css';
import "../../../src/swiper-bundle.css";
import API from "../../api";
import { _throttle } from "../../utils/utils";
import modalStore from "../../store/modal";
import { Button } from "../Button";
// 地址选择器 什么都别改直接复制
@observer
class Selectmodal extends React.Component {
constructor(props) {
super(props);
this.state = {
provinceList: [],
cityList: [],
areaList: [],
streetList: [],
provinceCode: 0,
cityCode: 0,
areaCode: 0,
streetCode: 0,
};
}
swiperRef;
swiperRef2;
swiperRef3;
// getParentCode
async componentDidMount() {
//获取省
await this.getCodeList(null, "provinceList");
//获取市
const { provinceList, provinceCode } = this.state;
await this.getCodeList(provinceList[provinceCode]?.adCode, "cityList");
//获取区
const { cityList, cityCode } = this.state;
await this.getCodeList(cityList[cityCode]?.adCode, "areaList");
//获取街道
const { areaList, areaCode } = this.state;
await this.getCodeList(areaList[areaCode]?.adCode, "streetList");
}
/**获取省市区接口 */
async getCodeList(parentCode, type) {
const params = {};
if (parentCode) {
params.parentCode = parentCode;
}
const { success, data } = await API.getParentCode(params);
if (success) {
this.setState({
[type]: data,
});
}
}
/**
* 省选择
* @param {*} swiper
*/
onProvinceSwiper = (swiper) => {
if (swiper) {
swiper.on("slideChange", (swiper) => {
console.error("Slide changed!", swiper.activeIndex);
this.setState(
{
provinceCode: swiper.activeIndex,
},
async () => {
//获取市
const { provinceList } = this.state;
await this.getCodeList(provinceList[swiper.activeIndex]?.adCode, "cityList");
//获取区
const { cityList, cityCode } = this.state;
await this.getCodeList(cityList[cityCode]?.adCode, "areaList");
//获取街道
const { areaList, areaCode } = this.state;
await this.getCodeList(areaList[areaCode]?.adCode, "streetList");
}
);
this.swiperRef?.slideTo(0);
this.swiperRef2?.slideTo(0);
this.swiperRef3?.slideTo(0);
});
}
};
/**
* 市选择
*/
onCitySwiper = (swiper) => {
console.error("Slide changed!", swiper.activeIndex);
this.setState(
{
cityCode: swiper.activeIndex,
},
async () => {
//获取区
const { cityList } = this.state;
await this.getCodeList(cityList[swiper.activeIndex]?.adCode, "areaList");
//获取街道
const { areaList, areaCode } = this.state;
await this.getCodeList(areaList[areaCode]?.adCode, "streetList");
}
);
this.swiperRef2?.slideTo(0);
this.swiperRef3?.slideTo(0);
};
/**
* 区选择
* @param {*} swiper
*/
onAreaSwiper = (swiper) => {
console.error("Slide changed!", swiper.activeIndex);
this.setState(
{
areaCode: swiper.activeIndex,
},
async () => {
//获取街道
const { areaList, areaCode } = this.state;
await this.getCodeList(areaList[areaCode]?.adCode, "streetList");
}
);
this.swiperRef3?.slideTo(0);
};
/**
* 街道选择
* @param {*} swiper
*/
onStreetSwiper = (swiper) => {
console.error("Slide changed!", swiper.activeIndex);
this.setState({
streetCode: swiper.activeIndex,
});
};
/**
* 确认选择
*/
doSelect = _throttle(() => {
const { provinceList, cityList, areaList, streetList, provinceCode, cityCode, areaCode, streetCode } = this.state;
const province = provinceList[provinceCode]?.name;
const city = cityList[cityCode]?.name;
const area = areaList[areaCode]?.name;
const street = streetList[streetCode]?.name;
const addrCode = streetList[streetCode]?.adCode || areaList[areaCode]?.adCode;
console.log(province + "" + city + "" + area + "" + street);
//确定展示到页面
const { doSelect } = this.props.popData;
doSelect && doSelect({ province, city, area, street, addrCode });
modalStore.closePop("Selectmodal");
});
/** 取消 */
doCancel = () => {
modalStore.closePop("Selectmodal");
};
onClose() {
modalStore.closePop("Selectmodal");
}
render() {
const { provinceList, cityList, areaList, streetList } = this.state;
return (
<div className="selectmodal">
<span className="bg" />
<Button className="cancelbtn" onClick={this.doCancel}>
取消
</Button>
<Button className="confirmbtn" onClick={this.doSelect}>
确认
</Button>
<div className="dateCont">
<div className="dates">
<Swiper
slidesPerView={5}
initialSlide={0}
centeredSlides={true}
direction="vertical"
className="_date"
onSwiper={this.onProvinceSwiper}>
{provinceList?.map((item, index) => (
<SwiperSlide className="dateItem" key={index}>
<div>{item?.name}</div>
</SwiperSlide>
))}
</Swiper>
</div>
<div className="hours">
<Swiper
slidesPerView={5}
initialSlide={0}
centeredSlides={true}
direction="vertical"
className="_date"
onSwiper={(swiper) => (this.swiperRef = swiper)}
onSlideChange={(swiper) => this.onCitySwiper(swiper)}>
{cityList?.map((item, index) => (
<SwiperSlide className="dateItem" key={index}>
<div>{item?.name}</div>
</SwiperSlide>
))}
</Swiper>
</div>
<div className="minutes">
<Swiper
slidesPerView={5}
initialSlide={0}
centeredSlides={true}
direction="vertical"
className="_date"
onSwiper={(swiper) => (this.swiperRef2 = swiper)}
onSlideChange={(swiper) => this.onAreaSwiper(swiper)}>
{areaList?.map((item, index) => (
<SwiperSlide className="dateItem" key={index}>
<div>{item?.name}</div>
</SwiperSlide>
))}
</Swiper>
</div>
<div className="street">
<Swiper
slidesPerView={5}
initialSlide={0}
centeredSlides={true}
direction="vertical"
className="_date"
onSwiper={(swiper) => (this.swiperRef3 = swiper)}
onSlideChange={(swiper) => this.onStreetSwiper(swiper)}>
{streetList?.map((item, index) => (
<SwiperSlide className="dateItem" key={index}>
<div>{item?.name}</div>
</SwiperSlide>
))}
</Swiper>
</div>
</div>
</div>
);
}
}
export default Selectmodal;
@import "../../res.less";
.selectmodal {
width: 750px;
height: 550px;
left: 0;
bottom: 0;
position: absolute;
animation: frombottom 300ms forwards;
.bg {
width: 750px;
height: 550px;
left: 0;
top: 0;
position: absolute;
background-color: white;
}
.cancelbtn {
width: 217px;
height: 82px;
left: 69px;
top: 435px;
position: absolute;
border-radius: 42px;
border: 4px solid #333333;
display: flex;
align-items: center;
justify-content: center;
font-size: 42px;
box-sizing: border-box;
}
.confirmbtn {
width: 355px;
height: 82px;
left: 330px;
top: 435px;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
font-size: 42px;
background-color: #ffce85;
border-radius: 42px;
}
.dateCont {
width: 685px;
display: flex;
position: absolute;
top: 30px;
left: calc(50% - 685px / 2);
text-align: center;
flex-direction: row;
&::after {
content: '';
width: 722px;
height: 71px;
left: -20px;
top: calc(50% - 60px / 2);
position: absolute;
background-color: #ffce85;
}
.dates {
width: calc(100% / 4);
flex: 1;
z-index: 1;
}
.hours {
width: calc(100% / 4);
flex: 1;
z-index: 1;
}
.minutes {
width: calc(100% / 4);
flex: 1;
z-index: 1;
}
.street {
width: calc(100% / 4);
flex: 1;
z-index: 1;
}
._date {
width: 100%;
height: 380px;
.dateItem {
width: 100%;
height: 79px;
line-height: 79px;
color: rgb(116, 116, 116);
font-size: 36px;
text-align: center;
div {
width: 100%;
display: inline-block;
.lineClamp1();
}
&.swiper-slide-active {
font-size: 42px;
color: black;
font-weight: 700;
}
}
}
}
@keyframes frombottom {
0% {
bottom: -614px;
}
100% {
bottom: 0;
}
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './taskpop.less';
import { unwatchPageVisibility, watchPageVisibility } from '@spark/utils';
import { handleLogClick, handleLogExposure } from '../../../MD';
import { SvgaPlayer } from '@spark/svgaplayer';
import { RES_PATH } from '../../../sparkrc';
import modalStore from '../../store/modal';
import { _throttle,_asyncThrottle, getUrlParam } from '../../utils/utils';
import { TASK_CODE,CHANNEL_PARAMS, PAGE_MAP } from '../../utils/constants';
import { setCookies } from '../../store/fetcher';
import taskStore from '../../store/task';
import store from '../../store';
import { LOG_KEY, MatterShareOpt, MatterViewOpt, pageView, sensorLog } from '../../utils/sensors';
import { Button } from '../Button';
@observer
class Taskpop extends React.Component {
constructor(props) {
super(props);
}
async componentDidMount() {
window.infoCallBack = taskStore.getInfoCallback;
window.browseCallBack = taskStore.getBrowseCallback;
await taskStore.getTaskList();
taskStore.taskList?.map((item, index) => {
if(item?.taskStatus == 1) {
sensorLog(LOG_KEY.exposure, "b12104", "d12106", {
page_name: "赚点赞次数弹窗",
button_name: "领取奖励按钮",
});
handleLogExposure(30, 2)
}
if(item?.taskStatus == 0) {
sensorLog(LOG_KEY.exposure, "b12104", "d12105", {
page_name: "赚点赞次数弹窗",
button_name: "去完成按钮",
});
if(item?.code == TASK_CODE.INVITE) {
handleLogExposure(30, 3)
} else {
handleLogExposure(30, 1)
}
}
})
watchPageVisibility(this.onPageVisibilityChange);
this.initSensor();
}
initSensor() {
pageView("b12104", {
page_name: "赚点赞次数弹窗",
});
// sensorLog(LOG_KEY.exposure,"b7870","d8729");
sensorLog(LOG_KEY.exposure, "b12104", "d12107", {
page_name: "赚点赞次数弹窗",
button_name: "返回按钮",
});
}
componentWillUnmount() {
unwatchPageVisibility(this.onPageVisibilityChange);
}
onPageVisibilityChange = async (visible) => {
if (visible) {
await setCookies();
await taskStore.getTaskList();
}
};
/** 去完成 */
taskDoHandle = _asyncThrottle(async (item) => {
const {taskStatus, code} = item || {};
// if(code == TASK_CODE.INVITE){
// MatterShareOpt(LOG_KEY.click,"b7870","d8729")
// }
handleLogClick(30, 1);
sensorLog(LOG_KEY.click, "b12104", "d12105", {
page_name: "赚点赞次数弹窗",
button_name: "去完成按钮",
});
await taskStore.doTask(item);
taskStore.taskList?.map((item, index) => {
if(item?.taskStatus == 1) {
sensorLog(LOG_KEY.exposure, "b12104", "d12106", {
page_name: "赚点赞次数弹窗",
button_name: "领取奖励按钮",
});
handleLogExposure(30, 2)
}
})
})
/** 领奖 */
taskPrizeHandle = _asyncThrottle(async (item) => {
const { code, taskStatus } = item || {};
handleLogClick(30, 2);
sensorLog(LOG_KEY.click, "b12104", "d12106", {
page_name: "赚点赞次数弹窗",
button_name: "领取奖励按钮",
});
await taskStore.getTaskPrize(item);
})
close = _asyncThrottle(async() => {
// sensorLog(LOG_KEY.click, "b7394", "d7398", {
// page_name: "做任务赚骰子页",
// button_name: "关闭按钮",
// });
sensorLog(LOG_KEY.click, "b12104", "d12107", {
page_name: "赚点赞次数弹窗",
button_name: "返回按钮",
});
modalStore.closePop("Taskpop");
// store.getHomeInfo()
if(store.curPage == PAGE_MAP.OPUS_PAGE) {
store.workDetailNum = getUrlParam("worksNum")
await store.getOpusInfo()
} else {
await store.getSalesManIndex();
await store.getProductSearch();
}
})
render() {
const {taskList} = taskStore;
return (
<div className="taskpop topPop_move">
{/* <SvgaPlayer src={`${RES_PATH}svga/5输出弹窗氛围1.svga`} className="basic_svga" /> */}
{/* <span className="icon2"></span> */}
<span className="bg"></span>
<Button className="close md29" onClick={this.close}></Button>
<span className="bg_list"></span>
<div className="list">
{
taskList?.length > 0 &&
taskList.map((val, key) => {
// val?.taskStatus == 0 && handleLogExposure(37, 1)
// val?.taskStatus == 1 && handleLogExposure(37, 2)
return (
<div className="item" key={key}>
<span className="bg_item"></span>
<div className="center_info">
<span className="title">{`${val?.title}(${val?.completedSize}/${val?.intervalLimitSize})`}</span>
{/* 「浏览企业人人保」、「浏览畅行保产品计划A赠险」、「浏览畅行保产品计划B赠险」 app端任务描述取描述 后端直接接口处理了 */}
<span className="subtitle textover">{val?.subTitle}</span>
</div>
<img src={val?.icon} className="icon" />
<div className="btns">
{/* 去完成 */}
{
val?.taskStatus == 0 &&
// (
// CFG.channel != CHANNEL_PARAMS.RB_APP ||
// (CFG.channel == CHANNEL_PARAMS.RB_APP && val?.code?.indexOf(TASK_CODE.BROWSE_SPECIAL_SHOW) < 0)
// ) &&
<Button className="complete_btn" onClick={() => this.taskDoHandle(val)}></Button>
}
{/* 待领取 */}
{val?.taskStatus == 1 &&
<Button className="receive_btn" onClick={() => this.taskPrizeHandle(val)}></Button>}
{/* 已完成 */}
{val?.taskStatus == 2 && <Button className="already_btn"></Button>}
</div>
</div>
)
})
}
</div>
</div>
);
}
}
export default Taskpop;
@import "../../res.less";
.taskpop {
width: 750px;
height: 1077px;
left: 0px;
position: absolute;
bottom: 0px;
// animation: frombottom 600ms forwards;
.bg {
width: 750px;
height: 1059px;
left: 0px;
bottom: 0;
position: absolute;
.sparkBg("TaskPop/bg.png");
}
.icon2 {
width: 573px;
height: 491px;
left: 94px;
top: -170px;
position: absolute;
.sparkBg("TaskPop/icon.png");
}
.close {
width: 62px;
height: 62px;
left: 656px;
top: -15px;
position: absolute;
.sparkBg("TaskPop/close.png");
}
.bg_list {
width: 687px;
height: 685px;
left: 31px;
top: 99px;
position: absolute;
// .sparkBg("TaskPop/bg_list.png");
}
.list {
width: 719px;
height: 843px;
left: 21px;
top: 191px;
position: absolute;
overflow-y: scroll;
.item {
margin-bottom: 3px;
width: 719px;
height: 162px;
left: 0px;
top: 0px;
position: relative;
.bg_item {
width: 710px;
height: 162px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("TaskPop/bg_item.png");
}
.center_info {
width: 315px;
height: 162px;
left: 196px;
// top: 37px;
position: absolute;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
.title {
width: 90%;
// height: 30px;
font-size: 34px;
// line-height: 30px;
color: #f99823;
.lineClamp1();
font-weight: 700;
margin-bottom: 10px;
}
.subtitle {
width: 100%;
// max-height: 50px;
font-size: 25px;
color: #c18c52;
// line-height: 25px;
// .lineClampN(2);
}
}
.icon {
width: 104px;
height: 105px;
left: 58px;
top: 23px;
position: absolute;
border-radius: 50%;
}
.btns {
// display: flex;
// align-items: center;
// justify-content: center;
width: 161px;
height: 63px;
left: 527px;
top: 43px;
position: absolute;
.receive_btn {
width: 132px;
height: 47px;
left: 15px;
top: 8px;
position: absolute;
.sparkBg("TaskPop/receive_btn.png");
}
.complete_btn {
width: 161px;
height: 63px;
left: 0;
top: 0;
position: absolute;
.sparkBg("TaskPop/complete_btn.png");
}
.already_btn {
width: 161px;
height: 63px;
left: 0;
top: 0;
position: absolute;
.sparkBg("TaskPop/already_btn.png");
}
.share_btn {
width: 157px;
height: 77px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("TaskPop/toShare_btn.png");
}
}
}
}
@keyframes frombottom {
0% {
bottom: -1708px;
}
100% {
bottom: 0px;
}
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './yinsirulepop.less';
import store from '@src/store';
import API from '@src/api';
import { _asyncThrottle } from '@src/utils/utils';
import modalStore from '@src/store/modal';
import { PAGE_MAP } from '@src/utils/constants';
@observer
class Yinsirulepop extends React.Component {
constructor(props) {
super(props);
}
clickClose = () => {
modalStore.closePop("Yinsirulepop");
}
clickTo = _asyncThrottle(async () => {
const {success} = await API.lockAgree()
if (!success) return
store.changePage(PAGE_MAP.PRIZE_PAGE, { from: this.props.popData?.from });
store.getSalesManIndex()
modalStore.closePop("Yinsirulepop");
})
render() {
return (
<div className="yinsirulepop modal_center">
<div className="cont">
<span className="bg"></span>
<span className="close" onClick={this.clickClose}></span>
<div className="ruletext"
dangerouslySetInnerHTML={{
__html: store.setIndex?.agreeText,
}}/>
<span className="btn md44" onClick={this.clickTo}></span>
</div>
</div>
);
}
}
export default Yinsirulepop;
@import "../../res.less";
.yinsirulepop {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.popupCenterShow();
.cont {
width: 529px;
height: 1088px;
left: 109px;
top: 321px;
position: absolute;
.bg {
width: 529px;
height: 924px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("yinsirulepop/bg.png");
}
.close {
width: 61px;
height: 61px;
left: 234px;
top: 984px;
position: absolute;
.sparkBg("common/closeBtn.png");
}
.ruletext {
width: 436px;
height: 492px;
left: 49px;
top: 246px;
position: absolute;
font-size: 24px;
color: #4b2614;
word-wrap: break-word;
overflow-y: scroll;
// background-color: #4b2614;
}
.btn {
width: 373px;
height: 110px;
left: 70px;
top: 769px;
position: absolute;
.sparkBg("yinsirulepop/btn.png");
}
}
}
import React, { Component } from "react";
import "./modal.less";
import { observer } from "mobx-react";
import modalStore from "../store/modal";
import { toJS } from "mobx";
import RankPrizePop from "@src/components/RankPrizePop/RankPrizePop";
import RankNoPrizePop from "@src/components/RankNoPrizePop/RankNoPrizePop";
import ReviewFailedPop from "@src/components/ReviewFailedPop/ReviewFailedPop";
import ReviewSucPop from "@src/components/ReviewSucPop/ReviewSucPop";
import NoPrizeCard from "@src/components/NoPrizeCard/NoPrizeCard";
import CodePop from "@src/components/CodePop/CodePop";
import PrivacyPop from "@src/components/PrivacyPop/PrivacyPop";
import ConfirmPop from "@src/components/ConfirmPop/ConfirmPop";
import LoginPop from "@src/components/LoginPop/LoginPop";
import Taskpop from "@src/components/taskpop/taskpop";
import Drawchancepop from "@src/components/drawchancepop/drawchancepop";
import RulePop from "@src/components/RulePop/RulePop";
import FillAddress from "../components/FillAddress/FillAddress";
import Selectmodal from "../components/selectmodal/selectmodal";
import Yinsirulepop from "../components/yinsirulepop/yinsirulepop";
import GuidePop from "@src/components/GuidePop/GuidePop";
import UploadPop from "@src/components/UploadPop/UploadPop";
import PrizePop from "@src/components/PrizePop/PrizePop";
import Commentpop from "../components/commentpop/commentpop";
import Pointsucpop from "../components/pointsucpop/pointsucpop";
import Nopointpop from "../components/nopointpop/nopointpop";
import LongImgPop from "@src/components/longImgPop/longImgPop";
/**
* 弹窗配置
*/
export const cfg = {
// 任务弹窗
Taskpop,
Drawchancepop: Drawchancepop,
// 排行榜中奖弹窗
RankPrizePop,
// 排行榜未中奖弹窗
RankNoPrizePop,
// 审核未通过弹窗
ReviewFailedPop,
// 审核通过弹窗
ReviewSucPop,
// 中奖弹窗
PrizePop,
// 未中奖弹窗(卡片切换)
NoPrizeCard,
// 二维码弹窗
CodePop,
// 隐私弹窗
PrivacyPop,
// 上传确认弹窗
ConfirmPop,
// 登录弹窗
LoginPop,
// 规则弹窗
RulePop,
// 选择地址弹窗
FillAddress: FillAddress,
// 地址选择器
Selectmodal: Selectmodal,
// 隐私协议
Yinsirulepop,
// 新手引导弹窗
GuidePop,
// 上传弹窗
UploadPop,
// 没有点赞次数弹窗
Nopointpop: Nopointpop,
// 点赞成功弹窗
Pointsucpop: Pointsucpop,
// 评论弹窗
Commentpop: Commentpop,
// 增援海报视频弹窗
LongImgPop,
};
@observer
class Modal extends Component {
constructor(props) {
super(props);
}
componentDidMount() {}
render() {
const list = toJS(modalStore.popList);
if (!list.length) {
// TODO:此处根据需要自行修改
// document.body.style.overflow='auto';
return <section></section>;
}
let PopUpMulti, popUpMultiData;
if (list.length > 1 && list[list.length - 1].isMulti == true) {
const popObj2 = list[list.length - 1];
PopUpMulti = cfg[popObj2.key];
popUpMultiData = popObj2.data;
}
const popObj = list[0];
const PopUp = cfg[popObj.key];
const popData = popObj.data;
if (PopUp || PopUpMulti) {
document.body.style.overflow='hidden';
}
return <section className="modal-hoc-bg" style={{
zIndex: modalStore.popList.length ? 1000 : -1,
display: modalStore.popList.length ? 'block' : 'none'
}}>
{PopUp && <PopUp popData={popData} />}
{PopUpMulti && <section className="modal-hoc-bg" style={{
zIndex: modalStore.popList.length ? 1000 : -1,
display: modalStore.popList.length ? 'block' : 'none'
}}><PopUpMulti popData={popUpMultiData} />
</section>}
</section>;
}
}
export default Modal;
\ No newline at end of file
.modal-hoc-bg {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
z-index: 1000;
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./HomeDemo.less";
import store from "@src/store";
import {PAGE_MAP} from "@src/utils/constants";
import {isWeChat} from "@src/utils/share";
import modalStore from "@src/store/modal";
import shareStore from "@src/store/share";
@observer
class HomeDemo extends React.Component {
async componentDidMount() {
if (isWeChat()) {
if (!await store.checkBindStatus()) return;
}
await shareStore.doAssist();
await store.getSalesManIndex();
if (store.setIndex?.agent) {
store.changePage(PAGE_MAP.SALE_PAGE);
} else {
store.changePage(PAGE_MAP.USER_HOME_PAGE);
}
/** 绑定手机号判断 */
if (isWeChat()) {
if (!store.setIndex.validUid) {
modalStore.pushPop("LoginPop");
}
}
}
render() {
return <div className="homeDemo">
<div className="bg"></div>
</div>;
}
}
export default HomeDemo;
@import "../../res.less";
.homeDemo {
.bg {
position: absolute;
left: 0px;
top: 0px;
width: 750px;
height: 2192px;
.sparkBg("SaleManPage/bg.png")
}
}
import React from "react";
import {observer} from "mobx-react";
import store from "../../store/index";
import "./LoadingDemo.less";
import {preloadAsset} from "@src/utils/preload1.3.js";
import assetList from "@src/assetList.json";
import {PAGE_MAP} from "@src/utils/constants";
@observer
class LoadingDemo extends React.Component {
state = {
curPercentage: 0
}
curPercentage = 0;
intervalId = 0;
isEvenLoad = true; // 是否匀速加载进度条
componentDidMount() {
this.preloadAssetInit();
}
/**
* 资源预加载
*/
preloadAssetInit = async () => {
const imageList = assetList.preLoadImg;
preloadAsset(
imageList,
3,
this.onLoadingProgress,
).then(() => {
// 预加载资源完成
// 异步加载默认关闭
// setTimeout(() => {
// // 异步加载资源开始
// const asyncImageList = assetList.asyncLoadImg;
// preloadAsset(asyncImageList, 1)
// }, 5000);
});
};
jump = () => {
setTimeout(() => {
store.changePage(PAGE_MAP.HOME_PAGE); // 跳转页面
}, 100);
};
/**
* 资源加载进度回调
* @param {*} progress
*/
onLoadingProgress = (progress) => {
const percentage = Math.floor(progress * 100);
console.log("progress", percentage);
if (this.isEvenLoad) {
this.setEvenProgress(percentage);
} else {
if (percentage == 100) {
this.jump();
}
}
};
/**
* 以1%匀速加载进度
* @param {*} percentage
*/
setEvenProgress = (percentage) => {
this.intervalId && clearInterval(this.intervalId);
let curPercentage = this.curPercentage;
this.intervalId = setInterval(() => {
if (curPercentage >= percentage) {
clearInterval(this.intervalId);
this.jump();
return;
}
curPercentage += 1;
this.curPercentage = curPercentage;
this.setState({
curPercentage,
});
}, 10);
};
render() {
const {curPercentage} = this.state;
return <div className="loading">
<div className="loading-ip"/>
<div className="progressBarBg"/>
<div className="progressBar">
<div className="progressBarFill" style={{
transform: `translateX(${curPercentage - 100}%)`
}}/>
</div>
<span className="progressTxt">金豆正在路上...... {curPercentage}%</span>
</div>;
}
}
export default LoadingDemo;
@import "../../res.less";
.loading {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
//background: linear-gradient(152deg, #AEE7FF 6%, #F1DEFC 43%, #F3E7FB 73%);
.webpBg("LoadingPage/loadingBg.jpg");
background-size: 750px 1624px;
.loading-ip {
position: absolute;
left: 198px;
top: 572-153px;
width: 570px;
height: 508px;
.webpBg("LoadingPage/loadingIp.png");
}
.progressBarBg {
position: absolute;
left: 82px;
top: 898-153px;
width: 590px;
height: 30px;
border-radius: 118px;
background: #FCE4D4;
border: 2px solid #FFFFFF;
}
.progressBar {
position: absolute;
left: 84px;
top: 900-153px;
width: 590px;
height: 30px;
overflow: hidden;
border-radius: 118px;
.progressBarFill {
position: absolute;
left: 0;
top: 0;
width: 590px;
height: 30px;
.webpBg("LoadingPage/loadingFill.png")
}
}
.progressTxt {
position: absolute;
left: 246px;
top: 952-153px;
width: 256px;
height: 22px;
opacity: 1;
font-size: 24px;
font-weight: normal;
line-height: 22px;
color: #999999;
}
}
import React from "react";
import {observer} from "mobx-react";
import "./SaleManPage.less";
import {Button} from "@src/components/Button";
import musicStore from "@src/store/musicStore";
import {Swiper} from "antd-mobile";
import modalStore from "@src/store/modal";
import store from "@src/store";
import {_asyncThrottle, _throttle, dateFormatter, windowJumpUrl, getUrlParam} from "@src/utils/utils";
import {CHANNEL_PARAMS, PAGE_MAP} from "@src/utils/constants";
import {RES_PATH} from "../../../sparkrc";
import {SvgaPlayer} from "@spark/svgaplayer";
import share from "@src/store/share";
import {LOG_KEY, MatterShareOpt, MatterViewDuration, MatterViewOpt, pageView, sensorLog} from "@src/utils/sensors";
@observer
class SaleManPage extends React.Component {
startTime = +new Date();
componentDidMount = async () => {
// modalStore.pushPop("CodePop");
await store.getProductSearch();
if (CFG.channel == CHANNEL_PARAMS.YK_MINI) {
MatterViewOpt("b12091", {
page_name: "业务员端首页-友客小程序",
});
sensorLog(LOG_KEY.exposure, "b12091", "d12093", {
page_name: "业务员端首页-友客小程序",
button_name: "去拜访按钮",
});
sensorLog(LOG_KEY.exposure, "b12091", "d12092", {
page_name: "业务员端首页-友客小程序",
button_name: "分享按钮",
});
} else {
MatterViewOpt("b12084", {
page_name: "业务员端-活动首页",
});
}
sensorLog(LOG_KEY.exposure, "b12084", "d12090", {
page_name: "业务员端-活动首页",
button_name: "点赞明细按钮",
});
sensorLog(LOG_KEY.exposure, "b12084", "d12089", {
page_name: "业务员端-活动首页",
button_name: "邀好友点赞按钮",
});
sensorLog(LOG_KEY.exposure, "b12084", "d12087", {
page_name: "业务员端-活动首页",
button_name: "上传照片按钮",
});
sensorLog(LOG_KEY.exposure, "b12084", "d12086", {
page_name: "业务员端-活动首页",
button_name: "奖品按钮",
});
sensorLog(LOG_KEY.exposure, "b12084", "d12085", {
page_name: "业务员端-活动首页",
button_name: "规则按钮",
});
};
componentWillUnmount() {
// alert(getUrlParam("ykCode"))
if (CFG.channel == CHANNEL_PARAMS.YK_MINI) {
MatterViewDuration("b12091", +new Date() - this.startTime, {
page_name: "业务员端首页-友客小程序",
sales_id: getUrlParam("ykCode") || CFG.spcCode || store.setIndex?.agentCode,
});
} else {
MatterViewDuration("b12084", +new Date() - this.startTime, {
page_name: "业务员端-活动首页",
sales_id: getUrlParam("ykCode") || CFG.spcCode || store.setIndex?.agentCode,
});
}
}
/** 规则按钮*/
clickRule = _asyncThrottle(() => {
sensorLog(LOG_KEY.click, "b12084", "d12085", {
page_name: "业务员端-活动首页",
button_name: "规则按钮",
});
if (!store.checkActTime("rule")) return;
modalStore.pushPop("RulePop");
});
/** 奖品按钮*/
clickPrize = _asyncThrottle(() => {
sensorLog(LOG_KEY.click, "b12084", "d12086", {
page_name: "业务员端-活动首页",
button_name: "奖品按钮",
});
if (!store.checkActTime("prize")) return;
if (!store.setIndex?.agreeFlag) {
modalStore.pushPop("Yinsirulepop");
return;
}
store.changePage(PAGE_MAP.PRIZE_PAGE);
});
/** 分享按钮-友客小程序且业务员身份*/
clickShare = _asyncThrottle(() => {
sensorLog(LOG_KEY.click, "b12091", "d12092", {
page_name: "业务员端首页-友客小程序",
button_name: "分享按钮",
});
if (!store.checkActTime()) return;
share.doShare();
});
/** 暂停音乐按钮*/
toStop = _asyncThrottle(() => {
if (!store.checkActTime()) return;
musicStore.changeMusicStatus();
});
/** 播放音乐按钮*/
toPlay = _asyncThrottle(() => {
if (!store.checkActTime()) return;
musicStore.changeMusicStatus();
});
/** 去拜访按钮-友客小程序banner渠道首页且业务员身份*/
clickVisit = _asyncThrottle(() => {
MatterShareOpt("b12091", "d12093", {
page_name: "业务员端首页-友客小程序",
button_name: "去拜访按钮",
});
if (!store.checkActTime()) return;
if (!CFG.channel == CHANNEL_PARAMS.YK_MINI) return;
// windowJumpUrl(store.frontVariable?.SaleManUrl);
windowJumpUrl(store.frontVariable?.SaleManUrl
+ "&actPlatforms=" + getUrlParam("actPlatforms")
+ "&agentCode=" + getUrlParam("agentCode")
+ "&actId=" + getUrlParam("actId")
+ "&channel=" + CFG.channel);
});
/** 去投稿按钮*/
clickToUpload = _asyncThrottle(() => {
sensorLog(LOG_KEY.click, "b12084", "d12087", {
page_name: "业务员端-活动首页",
button_name: "上传照片按钮",
});
if (!store.checkActTime()) return;
modalStore.pushPop("UploadPop");
});
/** 邀好友点赞按钮*/
clickToShow = _asyncThrottle((num) => {
MatterShareOpt( "b12084", "d12089", {
page_name: "业务员端-活动首页",
button_name: "邀好友点赞按钮",
});
if (!store.checkActTime()) return;
share.doInviteZan(num);
});
/** 点赞明细按钮按钮*/
clickToZan = _asyncThrottle(() => {
sensorLog(LOG_KEY.click, "b12084", "d12090", {
page_name: "业务员端-活动首页",
button_name: "点赞明细按钮",
});
if (!store.checkActTime()) return;
store.changePage(PAGE_MAP.LIKE_LOG_PAGE);
});
showOpus = _asyncThrottle((data) => {
if (!store.checkActTime()) return;
store.workDetailNum = data;
store.changePage(PAGE_MAP.OPUS_PAGE);
});
render() {
const {setIndex} = store;
return (setIndex?.agent ? <div className="SaleManPage">
<div className="bg"/>
<div className="logo"/>
<SvgaPlayer className="pic" src={RES_PATH + "SVG/3输出首页氛围.svga"}/>
<div className="title">
<div className="txt">
活动时间:{dateFormatter(store.setIndex?.actStartTime, "yyyy年MM月dd号")}-{dateFormatter(store.setIndex?.actEndTime, "MM月dd号")}
</div>
</div>
<div className="useridbox">
<span className="useridbg"></span>
<span className="userid">用户ID:{setIndex?.uid}</span>
</div>
{
CFG.channel == CHANNEL_PARAMS.YK_MINI && <Button className="shareBtn md11" onClick={this.clickShare}/>
}
{
musicStore?.status
? <Button className="music_open md9" onClick={this.toStop}/>
: <Button className="music_close md9" onClick={this.toPlay}/>
}
<Button className="prize md7" onClick={this.clickPrize}/>
<Button className="rule md8" onClick={this.clickRule}/>
{
CFG.channel == CHANNEL_PARAMS.YK_MINI &&
<SvgaPlayer className="visit md10" src={RES_PATH + "SVG/2输出去拜访icon.svga"} onClick={this.clickVisit}/>
}
<div className="IP"/>
<div className="iptxt">
<div className="txt1">
截止{dateFormatter(store.setProductSearch?.openTime, "MM月dd号")},照片点赞数排行前{store.setProductSearch?.maxAwardRank}名可得专属好礼
</div>
</div>
{
store.setProductSearch?.rankPrizeInfo?.length > 3 && <Swiper
className="PrizeList"
indicator={() => ""}
direction="horizontal"
trackOffset={0}
slideSize={35}
stuckAtBoundary={false}
loop={true}
autoplay={true}
autoplayInterval={3000}
allowTouchMove={true}
>
{
store.setProductSearch?.rankPrizeInfo?.map((item, index) => {
return <Swiper.Item className="PeizeList_item" key={index} style={{marginLeft: 145}}>
<div className="PeizeList_item_bg">
<img className="PeizeList_item_img" src={item.prizeImg}/>
<div className="PeizeList_item_name">
{item.prizeName}
</div>
</div>
</Swiper.Item>;
})
}
</Swiper>
}
{
store.setProductSearch?.rankPrizeInfo?.length <= 3 && <Swiper
className="PrizeList"
indicator={() => ""}
direction="horizontal"
trackOffset={2}
slideSize={33.33}
stuckAtBoundary={false}
loop={true}
autoplay={false}
autoplayInterval={3000}
allowTouchMove={false}
>
{
store.setProductSearch?.rankPrizeInfo?.map((item, index) => {
return <Swiper.Item className="PeizeList_item" key={index}>
<div className="PeizeList_item_bg">
<img className="PeizeList_item_img" src={item.prizeImg}/>
<div className="PeizeList_item_name">
{item.prizeName}
</div>
</div>
</Swiper.Item>;
})
}
</Swiper>
}
{
store.setProductSearch?.rankInfos?.length > 0 ? (<div className="pictureList">
{
store.setProductSearch?.rankInfos?.map((item, index) => {
return <div className="pictureList_item" key={index} onClick={() => {
this.showOpus(item.worksNum);
}}>
<img className="pictureList_item_img" src={item.worksImg}/>
{/* 排名 */}
<div className="pictureList_item_numBg">
<div className="pictureList_item_num">
{item.rank}
</div>
</div>
{/* 编号 */}
<div className="pictureList_item_bianhaoBg">
<div className="pictureList_item_bianhao">
作品编号:{item.worksNum}
</div>
</div>
{/* 标题 */}
<div className="pictureList_item_txt">
<span className="pictureList_item_name">
{item.worksTitle}
</span>
<div className="pictureList_item_btn"/>
<span className="pictureList_item_line">
{item.thumbsNum}
</span>
</div>
{/* 性别 */}
<img className="pictureList_item_sexImg"
src={+item.sex === 1 && RES_PATH + "SaleManPage/man.png" || +item.sex === 2 && RES_PATH + "SaleManPage/woman.png"}/>
</div>;
})
}
</div>)
: (<div className="nothing"/>)
}
{/* 状态0-未投稿 状态3-已投稿已失败*/}
{
(store.setProductSearch?.worksInfo?.status === 0
|| store.setProductSearch?.worksInfo?.status === 3
|| store.setProductSearch?.worksInfo === null
) && <div className="uploadBg">
<Button className="uploadBtn md13" onClick={this.clickToUpload}/>
<div className="uploadTxt">
请于{dateFormatter(store.setProductSearch?.openTime, "MM月dd号")}前上传您的照片
</div>
</div>
}
{/* 状态1-已投稿未审核 */}
{
store.setProductSearch?.worksInfo?.status === 1 && <div className="myPhoto">
<img className="myPhoto_Pic" src={store.setProductSearch?.worksInfo?.worksImg}/>
<div className="myPhoto_title">
--
</div>
<div className="kuang">
<span className="myPhoto_txt">
作品编号:--
</span>
<div className="wait"/>
</div>
</div>
}
{/* 状态2-已投稿已通过 */}
{
store.setProductSearch?.worksInfo?.status === 2 && <div className="myRank">
<img className="myRank_Pic" src={store.setProductSearch?.worksInfo?.worksImg}/>
<div className="myRank_title">
{/* todo */}
我的排名:{store.setProductSearch?.worksInfo?.rankIndex == -1 ? "500+" : store.setProductSearch?.worksInfo?.rankIndex}
</div>
<div className="myRank_name">
{store.setProductSearch?.worksInfo?.worksTitle}
</div>
<div className="kuang2">
<span className="myRank_txt">
作品编号:{store.setProductSearch?.worksInfo?.worksNum}
</span>
<div className="pass"/>
</div>
<Button className="myRank_btn md14"
onClick={() => this.clickToShow(store.setProductSearch?.worksInfo?.worksNum)}/>
</div>
}
<SvgaPlayer className="smallTitle" src={RES_PATH + "SVG/1输出闪亮瞬间标题.svga"}/>
<Button className="rank md12" onClick={this.clickToZan}/>
</div> : "");
}
}
export default SaleManPage;
@import "../../res.less";
.SaleManPage {
position: absolute;
left: 0;
top: 0;
//width: 750px;
//height: 1624px;
width: 100%;
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
.bg {
position: absolute;
left: 0px;
top: 0px;
width: 750px;
height: 2192px;
.sparkBg("SaleManPage/bg.png")
}
.logo {
position: absolute;
left: 232px;
top: 79px;
width: 290px;
height: 28px;
.sparkBg("SaleManPage/logo.png")
}
.prize {
position: absolute;
left: 0px;
top: 209px;
width: 100px;
height: 50px;
transform-origin: left;
.sparkBg("SaleManPage/prize.png")
}
.rule {
position: absolute;
left: 648px;
top: 209px;
width: 100px;
height: 50px;
transform-origin: right;
.sparkBg("SaleManPage/rule.png")
}
.music_close {
position: absolute;
left: 689px;
top: 353px;
width: 54px;
height: 53px;
.sparkBg("SaleManPage/music_close.png")
}
.music_open {
position: absolute;
left: 689px;
top: 353px;
width: 54px;
height: 53px;
.sparkBg("SaleManPage/music_open.png")
}
.shareBtn {
position: absolute;
left: 12px;
top: 740px;
width: 136px;
height: 125px;
.sparkBg("SaleManPage/shareBtn.png")
}
.visit {
position: absolute;
left: 515px;
top: 320px;
width: 243px;
height: 388px;
}
.IP {
position: absolute;
left: 535px;
top: 650px;
width: 211px;
height: 245px;
.sparkBg("SaleManPage/IP.png")
}
.iptxt {
position: absolute;
left: 242px;
top: 780px;
width: 344px;
height: 93px;
.sparkBg("SaleManPage/iptxt.png");
.txt1 {
left: 20px;
top: 15px;
font-size: 23px;
color: rgb(255, 255, 255);
position: absolute;
width: 280px;
height: 60px;
display: flex;
overflow-x: hidden;
overflow-y: auto;
word-wrap: break-word;
}
}
.pic {
position: absolute;
left: 60px;
top: 148px;
width: 638px;
height: 764px;
}
.title {
position: absolute;
left: 100px;
top: 311px;
width: 532px;
height: 44px;
.sparkBg("SaleManPage/title.png");
.txt {
font-size: 26px;
color: rgb(26, 69, 80);
text-align: center;
position: absolute;
left: 0px;
width: 100%;
top: 5px;
.lineClamp1()
}
}
.useridbox {
width: auto;
height: 39px;
left: 0px;
top: 380px;
position: absolute;
// .useridbg {
// width: 171px;
// height: 39px;
// left: 0px;
// top: 0px;
// position: absolute;
// .sparkBg("userHomePage/userIdBg.png");
// }
.userid {
width: auto;
height: 20px;
// left: 9px;
top: 10px;
// position: absolute;
font-size: 21px;
border-radius: 0 8px 8px 0;
padding: 10px 5px 10px 9px;
// line-height: 20px;
color: rgba(255, 255, 255, 1);
background-color: #0d363d;
}
}
.PrizeList {
position: absolute;
top: 920px;
width: 710px;
left: 10px;
height: 258px;
display: flex;
justify-content: center;
}
.PeizeList_item {
position: relative;
left: 0px;
top: 0px;
width: 710px;
height: 258px;
.PeizeList_item_bg {
position: absolute;
left: 0px;
top: 0px;
width: 201px;
height: 247px;
.sparkBg("SaleManPage/PeizeList_item_bg.png");
.PeizeList_item_img {
position: absolute;
border-radius: 15px;
background-color: rgb(255, 255, 255);
left: 17px;
top: 16px;
width: 168px;
height: 168px;
}
.PeizeList_item_name {
font-size: 22.417px;
color: rgb(255, 255, 255);
text-align: center;
position: absolute;
left: 10px;
top: 200px;
width: 180px;
height: 40px;
.lineClamp1();
}
}
}
.uploadBg {
position: absolute;
left: 21px;
top: 1192px;
width: 709px;
height: 206px;
.sparkBg("SaleManPage/uploadBg.png");
.uploadBtn {
position: absolute;
left: 419 - 21px;
top: 1244 - 1192px;
width: 282px;
height: 84px;
.sparkBg("SaleManPage/uoloadBtn.png")
}
.uploadTxt {
font-size: 17px;
color: rgb(116, 116, 116);
text-align: center;
position: absolute;
left: 450 - 21px;
top: 1339 - 1192px;
}
}
.myPhoto {
position: absolute;
left: 21px;
top: 1192px;
width: 709px;
height: 206px;
.sparkBg("SaleManPage/myPhoto.png");
.myPhoto_Pic {
border-radius: 11px;
background-color: rgb(255, 208, 149);
position: absolute;
left: 59 - 21px;
top: 1254 - 1192px;
width: 120px;
height: 120px;
object-fit: contain;
}
.myPhoto_title {
font-size: 28px;
color: rgb(7, 43, 55);
font-weight: bold;
text-align: center;
position: absolute;
left: 215 - 21px;
top: 1283 - 1192px;
}
.kuang {
position: absolute;
left: 215 - 21px;
top: 1324 - 1192px;
display: flex;
align-items: center;
justify-content: start;
.myPhoto_txt {
font-size: 22px;
color: rgb(148, 148, 148);
line-height: 1.504;
text-align: left;
left: 215 - 21px;
top: 1324 - 1192px;
width: 280px;
.lineClamp1();
margin-right: auto;
}
.wait {
width: 69px;
height: 25px;
.sparkBg("SaleManPage/wait.png")
}
}
}
.myRank {
position: absolute;
left: 21px;
top: 1192px;
width: 709px;
height: 206px;
.sparkBg("SaleManPage/myRank.png");
.myRank_Pic {
border-radius: 11px;
background-color: rgb(255, 208, 149);
position: absolute;
left: 59 - 21px;
top: 1254 - 1192px;
width: 120px;
height: 120px;
}
.myRank_title {
font-size: 32.87px;
color: rgb(255, 255, 255);
font-weight: bold;
text-align: center;
position: absolute;
width: 255px;
height: 40px;
left: 260 - 31px;
top: 1204 - 1192px;
.lineClamp1();
}
.myRank_name {
font-size: 28px;
color: rgb(7, 43, 55);
font-weight: bold;
text-align: center;
position: absolute;
left: 215 - 21px;
top: 1283 - 1192px;
}
.kuang2 {
position: absolute;
left: 215 - 21px;
top: 1324 - 1192px;
display: flex;
align-items: center;
justify-content: start;
.myRank_txt {
font-size: 22px;
color: rgb(148, 148, 148);
line-height: 1.504;
text-align: left;
width: 210px;
.lineClamp1();
margin-right: auto;
left: 215 - 21px;
top: 1324 - 1192px;
}
.pass {
width: 69px;
height: 25px;
.sparkBg("SaleManPage/pass.png")
}
}
.myRank_btn {
position: absolute;
left: 506 - 21px;
top: 1270 - 1192px;
width: 207px;
height: 79px;
.sparkBg("SaleManPage/myRank_btn.png")
}
}
.smallTitle {
position: absolute;
left: 109px;
top: 1422px;
width: 526px;
height: 77px;
}
.rank {
position: absolute;
left: 617px;
top: 1432px;
width: 133px;
height: 102px;
transform-origin: right;
.sparkBg("SaleManPage/rank.png")
}
.nothing {
position: absolute;
left: 0px;
top: 993px;
width: 750px;
height: 1199px;
.sparkBg("SaleManPage/nothing.png")
}
.pictureList {
position: absolute;
left: 0;
top: 1554px;
//margin-top: 1554px;
width: 750px;
height: 460px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 10px;
padding-top: 20px;
padding-bottom: 100px;
background: linear-gradient(to bottom, #f19839, #ef7d1e);
overflow-x: hidden;
overflow-y: auto;
}
.pictureList_item {
position: relative;
border-style: solid;
border-width: 2px;
border-color: rgb(255, 255, 255);
border-radius: 22px;
background-color: rgb(255, 255, 255);
box-shadow: 5.033px 7.461px 8px 0px rgba(237, 149, 31, 0.51);
left: 21px;
top: 1554 - 1554px;
width: 325px;
height: 230px;
margin-bottom: 50px;
.pictureList_item_img {
position: inherit;
border-radius: 20px;
//background-color: rgb(0, 0, 0);
left: 10px;
top: 10px;
width: 305px;
height: 210px;
object-fit: contain;
}
.pictureList_item_numBg {
border-radius: 22px 0px;
background-color: rgb(236, 96, 48);
position: absolute;
left: -1px;
top: 1501 - 1504px;
width: 140px;
height: 50px;
.pictureList_item_num {
font-size: 25px;
color: rgb(255, 255, 255);
width: 140px;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
.lineClamp1();
}
}
.pictureList_item_bianhaoBg {
position: absolute;
left: -2px;
top: 140px;
width: 330px;
height: 93px;
border-radius: 20px;
.sparkBg("SaleManPage/pictureList_item_bianhaoBg.png");
.pictureList_item_bianhao {
font-size: 18.32px;
color: rgb(255, 255, 255);
text-align: center;
position: absolute;
left: 0px;
top: 60px;
width: 330px;
.lineClamp1();
}
}
.pictureList_item_txt {
position: absolute;
width: 325px;
top: 230px;
//background: #000;
display: flex;
align-items: center;
justify-content: start;
.pictureList_item_name {
font-size: 25px;
color: rgb(255, 255, 255);
font-weight: bold;
text-align: left;
.lineClamp1();
margin-right: auto;
}
.pictureList_item_btn {
width: 27px;
height: 25px;
flex-shrink: 0;
.sparkBg("SaleManPage/good.png");
transition: transform 0.3s ease; // 添加过渡效果
margin-right: 2px;
}
.pictureList_item_line {
font-size: 23px;
color: rgb(255, 255, 255);
font-weight: bold;
}
}
.pictureList_item_sexImg {
position: absolute;
left: 210px;
top: -20px;
width: 120px;
height: 48px;
}
.pictureList_item_sexImg[src=""] {
border: none;
}
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './sharepage.less';
import { _throttle, dateFormatter, getUrlParam, windowJumpUrl } from '@src/utils/utils';
import { accessLog } from 'duiba-utils';
import store from '@src/store';
import API from '@src/api';
import { extranceName, PAGE_MAP } from '@src/utils/constants';
import modalStore from '@src/store/modal';
import { handleLogClick, handleLogExposure } from '../../../MD';
import shareStore from '@src/store/share';
import { LOG_KEY, MatterShareOpt, MatterViewOpt, sensorLog } from '@src/utils/sensors';
// wxjTODO 换皮 客经页面
@observer
class AgentSharepage extends React.Component {
constructor(props) {
super(props);
this.state = {
shareInfo: {}
}
this.shareRef = null;
}
async componentDidMount() {
MatterViewOpt("b12112", {
page_name: "分享落地页",
});
sensorLog(LOG_KEY.exposure, "b12112", "d12115", {
button_name: "分享活动按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
}
getShareInfo = async () => {
const { success, data } = await API.coop_getLoadingInfo();
if (success && data) {
this.setState({
shareInfo: data
})
}
}
/** 跳转微信端活动 */
toWeActHandle = () => {
CFG.workerCode = getUrlParam("ykCode");
let url = CFG.domain + CFG.indexUrl + '&channel=' + CFG.channel + `${!!getUrlParam("inviteCode") ? ("&inviteCode=" + getUrlParam("inviteCode")) : ""}` + `${!!CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""}`
location.href = url
}
handleShareAct = _throttle(() => {
MatterShareOpt("b12112", "d12115", {
button_name: "分享活动按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
shareStore.doShare()
})
render() {
// const { actStartTimestamp, actEndTimestamp } = this.state?.shareInfo || {};
return (
<div className="agentsharepage_wrap" ref={r => this.shareRef = r}>
<div className="sharepage modal_center">
<span className="bg"></span>
{/* <span className="title"></span> */}
<span className="normal_btn md51" onClick={this.handleShareAct}></span>
{/* <span className="time">活动时间:{dateFormatter(actStartTimestamp, "yyyy年MM月dd日")}-{dateFormatter(actEndTimestamp, "MM月dd日")}</span> */}
{/* {
getUrlParam("inviteCode") ?
<span className="assist_btn" ></span>
:
<span className="normal_btn"></span>
} */}
{/* <span className="click_area" onClick={() => this.toWeActHandle()}></span> */}
{/* <span className="hand"></span> */}
{/* <span className="logo"></span> */}
</div>
</div>
);
}
}
export default AgentSharepage;
@import "../../res.less";
.agentsharepage_wrap {
width: 750px;
height: 100vh;
left: 0px;
top: 0px;
position: absolute;
// overflow-y: scroll;
.sharepage {
width: 750px;
height: 1624px;
left: 0px;
top: 0;
position: absolute;
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("sharePage/agentBg.png");
}
.time {
width: 600px;
height: 40px;
left: calc(50% - 300px);
top: 380px;
position: absolute;
color: #fff;
font-size: 24px;
font-weight: 600;
text-align: center;
}
.title {
left: 93px;
top: 236px;
width: 559px;
height: 198px;
position: absolute;
.sparkBg("homePage/title.png");
}
.enter_btn {
width: 417px;
height: 131px;
left: 167px;
top: 1258px;
position: absolute;
.sparkBg("sharePage/btn.png");
}
.assist_btn {
width: 417px;
height: 131px;
left: 167px;
top: 1258px;
position: absolute;
.sparkBg("sharePage/assist_btn.png");
}
.normal_btn {
width: 456px;
height: 133px;
left: 146px;
top: 1286px;
position: absolute;
.sparkBg("sharePage/share_btn.png");
}
.click_area {
left: 112px;
top: 1290px;
width: 513px;
height: 115px;
position: absolute;
}
.hand {
position: absolute;
left: 557px;
top: 1352px;
width: 121px;
height: 94px;
.sparkBg("sharePage/hand.png");
pointer-events: none;
}
.logo {
width: 318px;
height: 31px;
left: calc(50% - 159px);
top: 190px;
position: absolute;
.sparkBg("homePage/logo.png");
}
}
}
\ No newline at end of file
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './drawpage.less';
import API from '@src/api';
import { _asyncThrottle, _throttle } from '@src/utils/utils';
import modalStore from '@src/store/modal';
import store from '@src/store';
import { CHANNEL_PARAMS, PAGE_MAP } from '@src/utils/constants';
import { CircleTurntable } from '@spark/circle-turntable'
import { Button } from '@src/components/Button';
import { Marquee, Toast } from '@spark/ui';
import { isWeChat } from '@src/utils/share';
import { LOG_KEY, pageView, sensorLog } from '@src/utils/sensors';
@observer
class Drawpage extends React.Component {
constructor(props) {
super(props);
this.state = {
drawInfo: {}
}
this.btnStarting = false // 转盘是否启动
this.turntableRef = null // 大转盘
this.drawResultInfo = {}
}
componentDidMount() {
this.getDrawInfo()
pageView("b12117", {
page_name: "抽奖大转盘",
});
sensorLog(LOG_KEY.exposure, "b12117", "d12118", {
page_name: "抽奖大转盘",
button_name: "立即抽奖按钮",
});
}
/** 获取转盘信息 */
getDrawInfo = async () => {
const { success, data } = await API.drawIndex()
if (success && data) {
this.setState({
drawInfo: data || {}
})
}
}
// 开始抽奖
lottteryHandle = _asyncThrottle(async () => {
sensorLog(LOG_KEY.click, "b12117", "d12118", {
page_name: "抽奖大转盘",
button_name: "立即抽奖按钮",
});
// 微信端拦截
if (isWeChat()) {
// 友客小程序
if (CFG.channel == CHANNEL_PARAMS.YK_MINI) {
return Toast("请前往人保寿险管家app活动抽奖~")
}
// 其他微信端 提醒唤端弹窗
else {
return modalStore.pushPop("CodePop")
}
}
const { prizeVOs, remainDrawTimes } = this.state.drawInfo
// 无抽奖次数
if (!remainDrawTimes) {
return modalStore.pushPop("Drawchancepop")
}
if (this.btnStarting) return false
const { success, data } = await API.drawJoin()
if (success && data) {
this.btnStarting = true
// 转盘转动开始抽奖
this.turntableRef.launch()
this.drawResultInfo = data || {}
// 转盘停止转动,指针停在index
const index = prizeVOs?.findIndex(item => item.prizeId === this.drawResultInfo.prizeId)
console.info('index', index)
this.turntableRef.braking(index);
} else {
this.btnStarting = false
this.getDrawInfo()
}
})
// 转盘停止处理
stopOkHandle = () => {
this.btnStarting = false
if (!this.drawResultInfo?.prizeId) {
modalStore.pushPop("NoPrizeCard", { data:this.drawResultInfo })
} else {
modalStore.pushPop("PrizePop", { data:this.drawResultInfo })
}
this.getDrawInfo()
}
/** 返回 */
backHome = _throttle(() => {
if (this.btnStarting) return false
store.changePage(PAGE_MAP.HOME_PAGE)
})
/** 奖品 */
prizeHandle = _throttle(async () => {
if (this.btnStarting) return false
if (!store.setIndex?.agreeFlag) {
modalStore.pushPop("Yinsirulepop", { from: PAGE_MAP.DRAW_PAGE });
return;
}
store.changePage(PAGE_MAP.PRIZE_PAGE, { from: PAGE_MAP.DRAW_PAGE })
})
/** 规则 */
ruleHandle = _throttle(async () => {
if (this.btnStarting) return false
modalStore.pushPop("RulePop")
})
render() {
const { prizeVOs, remainDrawTimes, carouselVos } = this.state.drawInfo
return (
<div className="drawpage modal_center md35">
<span className="bg"></span>
<span className="logo"></span>
<span className="title"></span>
<Button className="back_btn" onClick={this.backHome} />
<Button className="rule_btn" onClick={this.ruleHandle}></Button>
<Button className="prize_btn" onClick={this.prizeHandle}></Button>
{/* 奖品轮播 */}
<div className="prize_info">
<div className="prize_info_bg"></div>
<div className="prize_info_laba"></div>
<div className="prize_info_list">
<Marquee
baseData={carouselVos || []}
time={2000}
direction="top"
renderItem={(item) => (
<div className="prize_info_item">用户 {item.escapePhone} 获得了{item.prizeName}</div>
)}
></Marquee>
</div>
</div>
<Button className="draw_btn_box md36" onClick={this.lottteryHandle}>
<span className="draw_btn"></span>
<span className="left_num">剩余次数:{remainDrawTimes || 0}</span>
</Button>
<div className="turantable">
<CircleTurntable
className="turantable_box"
ref={ref => this.turntableRef = ref}
options={prizeVOs || []}
angleOffset={20} // 角度偏移量
radian={100} // 奖项半径
launchDuration={1000} // 启动时间
// 大转盘背景
renderBackground={<div className="turantable_bg"></div>}
// 大转盘指针
renderStartButton={<></>}
// 渲染奖品信息
renderOption={(option) => {
return <div className="prize_item">
{/* 因为按照8格子 正常偏移量得是23 但中第三奖品停不下来 就只能调成20 然后样式调一下往右靠 */}
{option.prizeName?.length > 6
? <div className="prize_name long">{option.prizeName.slice(0, 6)}...</div>
: <div className="prize_name">{option.prizeName}</div>
}
<img className="prize_img" src={option.prizeImg} alt="" />
</div>
}}
didStop={this.stopOkHandle}
/>
<span className="pointer"></span>
</div>
<span className="cover"></span>
</div>
);
}
}
export default Drawpage;
@import "../../res.less";
.drawpage {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("drawPage/bg.png");
}
.logo {
position: absolute;
left: 230px;
top: 216px;
width: 290px;
height: 28px;
.sparkBg("drawPage/logo.png");
}
.title {
width: 510px;
height: 164px;
left: 119px;
top: 291px;
position: absolute;
.sparkBg("drawPage/title.png");
}
.back_btn {
left: 10px;
top: 240px;
width: 58px;
height: 58px;
position: absolute;
.sparkBg("common/back.png");
}
.rule_btn {
width: 110px;
height: 49px;
right: 0px;
top: 327px;
position: absolute;
.sparkBg("drawPage/rule_btn.png");
transform-origin: right center;
}
.prize_btn {
width: 92px;
height: 49px;
left: 0px;
top: 327px;
position: absolute;
.sparkBg("drawPage/prize_btn.png");
transform-origin: left center;
}
.prize_info {
position: absolute;
left: 57px;
top: 470px;
width: 615px;
height: 46px;
.prize_info_bg {
position: absolute;
left: 0;
top: 0;
width: 615px;
height: 46px;
.sparkBg("drawPage/prize_info_bg.png");
}
.prize_info_laba {
position: absolute;
left: 142px;
top: 11px;
width: 31px;
height: 25px;
.sparkBg("drawPage/prize_info_laba.png");
}
.prize_info_list {
width: 360px;
height: 46px;
position: absolute;
left: 185px;
top: 0;
.prize_info_item {
width: 100%;
height: 46px;
font-size: 20px;
color: rgb(40, 85, 84);
line-height: 46px;
text-align: left;
.lineClamp1();
}
}
}
.draw_btn_box {
width: 443px;
height: 130px;
left: 144px;
top: 1290px;
position: absolute;
.draw_btn {
width: 443px;
height: 130px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("drawPage/draw_btn.png");
}
.left_num {
width: 100%;
height: 27px;
left: 0px;
top: 88px;
position: absolute;
font-size: 19px;
line-height: 19px;
color: rgba(255, 255, 255, 1);
text-align: center;
font-weight: bold;
}
}
.turantable {
width: 710px;
height: 707px;
left: 20px;
top: 586px;
position: absolute;
.sparkBg("drawPage/turantable_box.png");
pointer-events: none;
.turantable_box {
width: 584px;
height: 584px;
position: absolute;
top: 56px;
left: 56px;
}
.turantable_bg {
width: 584px;
height: 584px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("drawPage/turantable_bg.png");
}
.prize_item {
width: 190px;
height: 150px;
text-align: center;
color: rgba(248, 103, 89, 1);
font-size: 22px;
padding-left: 16px;
box-sizing: border-box;
.prize_name {
width: 100%;
&.long {
padding-left: 10px;
// .lineClamp1();
}
font-weight: bold;
}
.prize_img {
width: 80px;
height: 70px;
object-fit: contain;
margin-top: 10px;
}
}
.pointer {
width: 145px;
height: 168px;
left: 276px;
top: 251px;
position: absolute;
.sparkBg("drawPage/pointer.png");
}
}
.cover {
width: 696px;
height: 788px;
left: 65px;
top: 554px;
position: absolute;
.sparkBg("drawPage/cover.png");
pointer-events: none;
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './likelogpage.less';
import API from '@src/api';
import { Button } from '@src/components/Button';
import store from '@src/store';
import { _asyncThrottle, dateFormatter } from '@src/utils/utils';
import { PAGE_MAP } from '@src/utils/constants';
@observer
class Likelogpage extends React.Component {
constructor(props) {
super(props);
this.state = {
logList: [], // 列表数据
isSearching: false, // 是否在请求列表中
}
this.pageNum = 1;
this.pageSize = 20;
this.isLoadedAll = false;
}
async componentDidMount() {
await this.getLogList()
}
/**
* 获取列表数据
*/
getLogList = async () => {
if (this.state.isSearching) return;
if (this.isLoadedAll) return;
this.setState({ isSearching: true })
const params = {
pageNum: this.pageNum, // 第几页,从1开始
pageSize: this.pageSize, // 每页大小
}
const { success, data } = await API[
store.setIndex?.agent ? 'beThumbsRecords' : 'myThumbsRecords'
](params);
if (success) {
const _list = this.state.logList.concat(data?.list || [])
this.setState({
isSearching: false,
logList: _list,
});
this.isLoadedAll = data?.totalPage <= this.pageNum;
this.pageNum++;
}
}
/**
* 监听页面滚动
*/
handScroll = (e) => {
if (
e.target.scrollTop + e.target.clientHeight + 10 >=
e.target.scrollHeight
) {
this.getLogList();
}
};
// 返回
backHandle = _asyncThrottle(() => {
store.changePage(PAGE_MAP.HOME_PAGE)
// if (store.setIndex?.agent) {
// store.changePage(PAGE_MAP.SALE_PAGE)
// } else {
// store.changePage(PAGE_MAP.USER_HOME_PAGE)
// }
})
render() {
const { logList } = this.state;
const { agent } = store.setIndex || {};
return (
<div className={`likelogpage modal_center ${agent ? 'md20' : 'md45'}`}>
<span className="bg"></span>
<span className="list_bg"></span>
<div className="detail_list" onScroll={this.handScroll}>
{logList?.map((item, index) => (
<div className="detail_item" key={index}>
<div className="left_info">
<span className="item_title">{item.changeDesc}</span>
<span className="item_time">{dateFormatter(item.time, "yyyy.MM.dd hh:mm")}</span>
</div>
<span className="item_num">{item.changeType == 1 ? '+' : '-'}{item.changeNum}</span>
<span className="item_line"></span>
</div>
))}
</div>
<span className="title"></span>
<Button className="back" onClick={this.backHandle}></Button>
</div>
);
}
}
export default Likelogpage;
@import "../../res.less";
.likelogpage {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("likeLogPage/bg.png");
}
.list_bg {
width: 750px;
height: 1286px;
left: 0px;
top: 338px;
position: absolute;
.sparkBg("likeLogPage/list_bg.png");
}
.detail_list {
width: 703px;
height: auto;
left: 29px;
top: 380px;
bottom: 0px;
position: absolute;
overflow-x: hidden;
overflow-y: auto;
padding-right: 20px;
box-sizing: border-box;
.detail_item {
width: 683px;
height: 139px;
position: relative;
.left_info {
width: 550px;
height: 100%;
left: 16px;
top: 0px;
position: absolute;
display: flex;
flex-direction: column;
justify-content: center;
}
.item_title {
width: 550px;
max-height: 68px;
font-size: 32px;
line-height: 34px;
color: rgba(239, 143, 0, 1);
font-weight: bold;
margin-bottom: 16px;
word-wrap: break-word;
.lineClampN(2);
}
.item_time {
width: 550px;
height: 17px;
font-size: 23px;
line-height: 17px;
color: rgba(163, 163, 163, 1);
}
.item_num {
width: 39px;
height: 24px;
right: 20px;
top: 50px;
position: absolute;
font-size: 32px;
line-height: 24px;
color: rgba(239, 143, 0, 1);
text-align: right;
}
.item_line {
width: 683px;
height: 5px;
left: 0px;
bottom: 0px;
position: absolute;
opacity: 0.4;
.sparkBg("likeLogPage/item_line.png");
}
}
}
.title {
width: 448px;
height: 63px;
left: 155px;
top: 253px;
position: absolute;
.sparkBg("likeLogPage/title.png");
}
.back {
width: 56px;
height: 56px;
left: 32px;
top: 262px;
position: absolute;
.sparkBg("likeLogPage/back.png");
}
}
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './opuspage.less';
import { _asyncThrottle, dateFormatter } from '@src/utils/utils';
import store from '@src/store';
import modalStore from '@src/store/modal';
import { Button } from '@src/components/Button';
import { PAGE_MAP } from '@src/utils/constants';
import { LOG_KEY, pageView, sensorLog } from '@src/utils/sensors';
@observer
class Opuspage extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.flushIndex()
pageView("b12108", {
page_name: "作品详情页",
});
sensorLog(LOG_KEY.exposure, "b12108", "d12109", {
page_name: "作品详情页",
button_name: "返回按钮",
});
sensorLog(LOG_KEY.exposure, "b12108", "d12110", {
page_name: "作品详情页",
button_name: "评论按钮",
});
sensorLog(LOG_KEY.exposure, "b12108", "d12111", {
page_name: "作品详情页",
button_name: "点赞按钮",
});
}
flushIndex = async () => {
await store.getOpusInfo()
}
doComment = () => {
sensorLog(LOG_KEY.click, "b12108", "d12110", {
page_name: "作品详情页",
button_name: "评论按钮",
});
modalStore.pushPop("Commentpop")
}
doThumbsUp = _asyncThrottle(() => {
if (!store.endOpus) {
return
}
sensorLog(LOG_KEY.click, "b12108", "d12111", {
page_name: "作品详情页",
button_name: "点赞按钮",
});
if (store.opusInfo?.remainThumbsTimes > 0) {
store.doThumbsUp()
} else {
modalStore.pushPop("Nopointpop")
}
})
handleOnScroll = _asyncThrottle(async () => {
let dom = document.getElementById("commentlist")
const contentScrollTop = dom.scrollTop; //滚动条距离顶部
const clientHeight = dom.clientHeight; //可视区域
const scrollHeight = dom.scrollHeight;//滚动区域总高度
if (contentScrollTop + clientHeight >= scrollHeight - 10) {
if (store.nowPage >= store.totalPage) {
return
}
await store.getCommentInfo(store.nowPage + 1)
}
// console.log(contentScrollTop, clientHeight, scrollHeight)
})
backHandle = () => {
sensorLog(LOG_KEY.click, "b12108", "d12109", {
page_name: "作品详情页",
button_name: "返回按钮",
});
store.changePage(PAGE_MAP.HOME_PAGE)
}
render() {
return (
<div className="opuspage">
<span className="bg2"></span>
<span className="bg"></span>
<div className='infoList'>
<div className='list' id="commentlist"
onScrollCapture={() => this.handleOnScroll()} >
{
store.commentInfo?.map((item, index) => {
return (
<div className="commentbox" key={"com" + index}>
<div className='comInfoBox'>
<span className="commentinfo">{item.content}</span>
<span className="time">{dateFormatter(item.time, "yyyy/MM/dd hh:mm:ss")}</span>
</div>
<span className="uid">{item.nickname}</span>
<span className="avatar">
<img src={item.avatar}></img>
</span>
</div>
)
})
}
</div>
{
store.opusInfo?.salesmanFlag ? <Button className="big_pinglun md32" onClick={this.doComment}></Button> :
<div>
<Button className="dianzan md33" onClick={this.doThumbsUp}></Button>
<Button className="pinglun md32" onClick={this.doComment}></Button>
</div>
}
{/* */}
<div className="infobox">
<span className="infotitle">{store.opusInfo?.worksInfo?.worksTitle}</span>
<span className="infolab">
{store.opusInfo?.worksInfo?.worksDesc}
</span>
<span className="line"></span>
<span className="infobg">
<img src={store.opusInfo?.worksInfo?.worksImg}></img>
</span>
</div>
</div>
<Button className="back md31" onClick={this.backHandle}></Button>
{/* <span className="zan"></span> */}
</div>
);
}
}
export default Opuspage;
@import "../../res.less";
.opuspage {
width: 750px;
height: 100vh;
left: 0px;
top: 0px;
position: absolute;
overflow-y: hidden;
.bg2 {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("opusPage/bg2.png");
}
.bg {
width: 750px;
height: 1456px;
left: 0px;
top: 168px;
position: absolute;
.sparkBg("opusPage/bg.png");
}
.infoList {
width: 646px;
height: auto;
left: 59px;
top: 223px;
bottom: 10px;
overflow-y: scroll;
position: fixed;
overflow-x: hidden;
}
.list {
width: 646px;
height: 169px;
left: 2px;
top: 1190px;
position: absolute;
}
.commentbox {
width: 636px;
height: 189px;
left: 0px;
top: 0px;
position: relative;
.comInfoBox {
width: 554px;
height: 130px;
left: 92px;
top: 54px;
position: absolute;
}
.commentinfo {
width: 554px;
height: auto;
left: 0px;
top: 0px;
position: relative;
display: block;
font-size: 26px;
color: rgba(59, 59, 59, 1);
}
.uid {
width: 102px;
height: 25px;
left: 91px;
top: 20px;
position: absolute;
font-size: 26px;
line-height: 25px;
color: rgba(59, 59, 59, 1);
}
.time {
width: 290px;
height: 19px;
left: 0px;
// top: 111px;
margin-top: 10px;
position: relative;
display: block;
font-size: 20px;
line-height: 19px;
color: rgba(174, 174, 174, 1);
}
.avatar {
width: 74px;
height: 74px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("opusPage/avatar.png");
img {
width: 74px;
height: 74px;
left: 0px;
top: 0px;
position: absolute;
border-radius: 90px;
}
}
}
.dianzan {
width: 283px;
height: 108px;
left: 330px;
top: 1019px;
position: absolute;
.sparkBg("opusPage/dianzan.png");
}
.pinglun {
width: 283px;
height: 108px;
left: -10px;
top: 1019px;
position: absolute;
.sparkBg("opusPage/pinglun.png");
}
.big_pinglun {
width: 373px;
height: 110px;
left: 129px;
top: 1019px;
position: absolute;
.sparkBg("opusPage/big_pinglun.png");
}
.infobox {
width: 632px;
height: 981px;
left: 0;
top: 0;
position: absolute;
.infotitle {
width: 609px;
height: 45px;
left: 10px;
top: 750px;
position: absolute;
font-size: 38px;
line-height: 37px;
color: rgba(244, 148, 31, 1);
overflow-x:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
.infolab {
width: 608px;
height: 148px;
left: 11px;
top: 833px;
position: absolute;
font-size: 26px;
color: rgba(59, 59, 59, 1);
overflow-x: hidden;
overflow-y: auto;
word-wrap: break-word;
}
.line {
width: 612px;
height: 2px;
left: 9px;
top: 810px;
position: absolute;
opacity: 0.49;
.sparkBg("opusPage/line.png");
}
.infobg {
width: 632px;
height: 705px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("opusPage/infobg.png");
img {
width: 632px;
height: 705px;
left: 0px;
top: 0px;
position: absolute;
border-radius: 30px;
object-fit: contain;
}
}
}
.back {
width: 58px;
height: 58px;
left: 32px;
top: 85px;
position: absolute;
.sparkBg("opusPage/back.png");
}
.zan {
width: 487px;
height: 487px;
left: 130px;
top: 505px;
position: absolute;
.sparkBg("opusPage/zan.png");
}
}
"use strict";
import React from "react";
import { observer } from "mobx-react";
import "./prizepage.less";
import { callApi } from "@spark/api-base";
import { stopSound } from "@spark/utils";
import { Toast } from "@spark/ui";
import modalStore from "../../store/modal";
// import shareStore from "../../store/share";
import { isWeChat } from "../../utils/share";
import { LOG_KEY, pageView, sensorLog } from "../../utils/sensors";
import { PAGE_MAP, extranceName } from "../../utils/constants";
import { Button } from "../../components/Button";
import API from "../../api";
import store from "../../store";
import { _throttle, dateFormatter, getUrlParam, isMiniprogram } from "../../utils/utils";
import shareStore from "@src/store/share";
// wzjTODO 换皮
@observer
class Prizepage extends React.Component {
constructor(props) {
super(props);
this.state = {
records: [],
tabActive: 0,
prizeInfo: {},
projectTabList: [],
};
this.projectId = null;
}
async componentDidMount() {
// modalStore.pushPop("Yinsirulepop")
// modalStore.pushPop("FillAddress")
await this.getPrize();
pageView("b12124", { page_name: "我的奖品页" });
sensorLog(LOG_KEY.exposure, "b12124", "d12126", { page_name: "我的奖品页", button_name: "返回" })
}
fetchData = async () => {
const ps = [];
ps.push(callApi("/crecord/getrecordmn", { page: 1 }, undefined, undefined, false));
const [oldRecordsResp] = await Promise.all(ps);
let records = [];
if (oldRecordsResp) {
for (let item of oldRecordsResp.records) {
if (item.itemType.indexOf("sp_") == -1) {
const { title, url, img } = item;
records.push({
url,
name: title,
icon: img,
data: item,
});
}
}
}
this.setState({ records });
};
getPrize = async (projectId) => {
let params = {};
console.log("!!!!", store.homeInfo?.prod)
if (projectId) {
params = {
projectId: projectId,
page: 1,
prod: true//store.homeInfo?.prod !== null ? (store.homeInfo?.prod || false) : true
};
} else {
params = {
page: 1,
prod: true//store.homeInfo?.prod !== null ? (store.homeInfo?.prod || false) : true,
};
}
const res = await API.prize(params);
if (res?.success) {
let tabList = [];
let PrizeList = [];
if (res?.projectTabList?.length > 0) {
tabList = [{ projectName: "全部" }, ...res?.projectTabList];
} else {
tabList = [{ projectName: "全部" }];
}
if (res?.records?.length > 0) {
res.records.map((item) => {
if (item.itemType.indexOf("sp_") == -1) {
PrizeList.push(item);
} else {
if (item.itemType.startsWith("sp_bean")) {
PrizeList.push(item);
}
}
});
}
this.setState({
prizeInfo: res,
records: PrizeList,
projectTabList: tabList,
});
PrizeList.forEach((item) => {
if (!item?.invalid) {
sensorLog(LOG_KEY.exposure, "b12124", "d12125", {
button_name: "去领取",
page_name: "我的奖品页",
entrance: extranceName[CFG.channel],
operation_name: "去领取",
});
}
});
}
};
/** 奖品跳转 app渠道可正常跳转领奖;微信公众号用户中奖后在我的奖品页点击【进入详情】按钮需换端app领奖 */
// sp_bean 保豆跳转特殊处理
goPrizeDetail = _throttle(async (item) => {
if (item?.invalid) {
Toast("奖品已过期");
return;
}
sensorLog(LOG_KEY.click, "b12124", "d12125", {
button_name: "去领取",
page_name: "我的奖品页",
operation_name: "去领取",
});
// stopSound('bg_music')
const { recordId, url, itemType, recordInfo, projectId, drawStatus } = item;
const { projectTabList } = this.state;
if (isMiniprogram()) {
//小程序渠道toast
Toast("请前往人保寿险管家app领奖~");
return;
} else if (isWeChat()) {
// 微信渠道唤端
shareStore.goAppPrize();
} else {
// app直接跳
if (itemType?.startsWith("sp_bean")) {
// 保豆app端跳转
console.info("保豆");
const thirdBrowseParams = {
url: "picclifeapp://MyPolicyBeansActivity",
// is_back: "true",
// functionType: "1",
};
setTimeout(async () => {
window.PICCLifeJsBrage.callNative({
module: "Router",
method: "",
params: JSON.stringify(thirdBrowseParams),
callback: "jscallback",
});
}, 300);
} else {
console.info("其他奖品");
const { tabActive, projectTabList } = this.state;
//是否走人保定制流程(走流程+绑定业务员+未填写地址+未领取)
let codeUrl = "";
let rbClaim = "";
let saveAddresUrl = "";
for (let i = 0; i < projectTabList?.length; i++) {
if (projectTabList[i]?.projectId == projectId) {
codeUrl = projectTabList[i]?.queryBindAgentCodeUrl;
rbClaim = projectTabList[i]?.rbClaim;
saveAddresUrl = projectTabList[i]?.saveAddressUrl;
console.info(codeUrl, rbClaim, saveAddresUrl);
}
}
if (rbClaim && itemType.indexOf("object") != -1 && drawStatus == "2") {
let res = await callApi(`${codeUrl}`);
if (!recordInfo && !!res?.boundYkCode) {
//未填写地址切绑定业务员
modalStore.pushPop("FillAddress", {
projectId: this.projectId,
saveAddresUrl: saveAddresUrl,
getPrize: this.getPrize,
recordId,
agentCode: res?.boundYkCode,
prizeProjectId: projectId,
});
} else {
//已填写地址或未绑定业务员
if (recordInfo?.status == "0") {
Toast("已领取,请耐心等待发货~");
} else {
location.href = `/aaw/projectx/takePrize?projectOrderNo=${recordId}`;
}
}
} else {
setTimeout(() => {
if (url) {
location.href = url;
} else {
location.href = `/aaw/projectx/takePrize?projectOrderNo=${recordId}`;
}
}, 300);
}
}
}
});
switchTab = _throttle(async (val, key) => {
if (val?.projectId) {
await this.getPrize(val?.projectId);
this.projectId = val?.projectId;
} else {
// 全部
await this.getPrize();
this.projectId = null;
}
this.setState({
tabActive: key,
});
});
back = _throttle(async () => {
store.changePage(this.props?.from || PAGE_MAP.HOME_PAGE);
sensorLog(LOG_KEY.click, "b12124", "d12126", {
operation_name: "返回",
button_name: "返回",
operation_id: CFG.operationId,
});
});
render() {
const { records, tabActive, projectTabList } = this.state;
return (
<div className="prizepage_wrap modal_center">
<div className="prizepage">
<span className="bg"></span>
<div className="all_tab">
{projectTabList?.length > 0 &&
projectTabList.map((val, key) => {
return (
<Button
className={key == tabActive ? "tab_item" : "tab_item opacity"}
key={key}
onClick={() => this.switchTab(val, key)}>
{val?.projectName}
<span className={key == tabActive ? "stick" : "opacity"}></span>
</Button>
);
})}
</div>
<div className="list">
{records?.length > 0 ? (
records.map((item, index) => {
return (
<div className="item" key={index} onClick={() => this.goPrizeDetail(item)}>
<span className="bg_item"></span>
<img src={item?.img} className="img" />
<span className="name">{item?.title}</span>
<span className="prize_time">中奖时间:{dateFormatter(item?.gmtCreate, "yyyy-MM-dd hh:mm:ss")}</span>
<span className="expire_time">
领奖截止日期:{dateFormatter(item?.expireTime, "yyyy-MM-dd hh:mm:ss")}
</span>
{item?.invalid ? <Button className="gray_btn grey"></Button> : <Button className="gobtn"></Button>}
</div>
);
})
) : (
<span className="empty">暂无数据</span>
)}
</div>
<Button className="back md43" onClick={this.back}></Button>
</div>
</div>
);
}
}
export default Prizepage;
@import "../../res.less";
.prizepage_wrap {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
background-color: #fff5d3;
.prizepage {
width: 750px;
height: 1624px;
left: 0px;
// top: -200px;
position: absolute;
background-color: #fff5d3;
// transform: translateY(-50%);
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("PrizePage/bg2.png");
}
.all_tab {
width: 665px;
height: 80px;
position: absolute;
left: 40px;
top: 367px;
overflow-x: auto;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
.hideScrollbar();
.tab_item {
width: 122px;
height: 80px;
text-align: center;
left: 0;
top: 0;
position: relative;
margin-right: 40px;
flex-shrink: 0;
font-size: 30px;
color: #fff;
font-weight: 700;
line-height: 80px;
.lineClamp1();
.stick {
position: absolute;
left: 0px;
top: 70px;
width: 121px;
height: 4px;
.sparkBg("PrizePage/stick.png");
}
}
.opacity {
background-image:none !important;
// opacity: 0.6;
}
}
.list {
width: 683px;
height: calc(50vh + 300px);
left: 31px;
top: 483px;
// bottom: 20px;
position: absolute;
overflow-y: scroll;
.item {
width: 683px;
height: 155px;
left: 0px;
top: 0px;
position: relative;
margin-bottom: 13px;
.bg_item {
width: 683px;
height: 155px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("PrizePage/bg_item.png");
}
.img {
width: 110px;
height: 110px;
left: 26px;
top: 24px;
position: absolute;
// border: 1px solid #e5c362;
border-radius: 15px;
}
.name {
width: 350px;
// height: 28px;
left: 160px;
top: 24px;
position: absolute;
font-size: 30px;
// line-height: 28px;
color: #262626;
.lineClamp1();
font-weight: bold;
}
.prize_time {
width: 450px;
height: 28px;
left: 160px;
top: 75px;
position: absolute;
font-size: 18px;
// line-height: 28px;
color: #afafaf;
.lineClamp1();
}
.expire_time {
width: 450px;
height: 28px;
left: 160px;
top: 105px;
position: absolute;
font-size: 18px;
// line-height: 28px;
color: #afafaf;
.lineClamp1();
}
.gobtn {
width: 152px;
height: 57px;
left: 510px;
top: 60px;
position: absolute;
.sparkBg("PrizePage/go-btn.png");
}
.gray_btn {
width: 152px;
height: 57px;
left: 510px;
top: 60px;
position: absolute;
.sparkBg("PrizePage/gray_btn.png");
}
}
.empty {
width: 100%;
height: 30px;
line-height: 30px;
top: 300px;
position: absolute;
left: 0;
text-align: center;
font-size: 30px;
color: #fff5d3;
}
}
.back {
left: 29px;
top: 262px;
width: 58px;
height: 58px;
transform-origin: left center;
position: absolute;
.sparkBg("PrizePage/back.png");
}
}
}
\ No newline at end of file
"use strict";
import React from "react";
import { observer } from "mobx-react";
import "./sharepage.less";
import { dateFormatter, getUrlParam, isMiniprogram, windowJumpUrl } from "@src/utils/utils";
import API from "@src/api";
import { handleLogClick, handleLogExposure } from "../../../MD";
import store from "../../store";
import { LOG_KEY, MatterShareOpt, MatterViewDuration, MatterViewOpt, pageView, pageViewD, sensorLog } from "../../utils/sensors";
import { extranceName } from "../../utils/constants";
import { isFlowCancellationError } from "mobx";
@observer
class Sharepage extends React.Component {
constructor(props) {
super(props);
this.state = {
shareInfo: {},
};
this.shareRef = null;
this.startTime = +new Date();
}
async componentDidMount() {
// accessLog(506)
await store.checkBindStatus();
API.outside();
// await this.getShareInfo();
MatterViewOpt("b12112", {
page_name: "分享落地页",
});
if (getUrlParam("inviteCode")) {
sensorLog(LOG_KEY.exposure, "b12112", "d12113", {
button_name: "为TA助力按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
} else if(getUrlParam("worksNum")){
sensorLog(LOG_KEY.exposure, "b12112", "d12116", {
button_name: "为TA点赞按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
} else {
sensorLog(LOG_KEY.exposure, "b12112", "d12114", {
button_name: "立即参与按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
}
// setTimeout(() => {
// this.shareRef.scrollTo(0, 70)
// }, 50)
}
componentWillUnmount() {
MatterViewDuration("b12112", +new Date() - this.startTime,{
page_name: "分享落地页",
});
}
getShareInfo = async () => {
const { success, data } = await API.coop_getLoadingInfo();
if (success && data) {
this.setState({
shareInfo: data,
});
}
// if (!data?.validUid) {
// modalStore.pushPop("Loginpop")
// }
};
/** 跳转微信端活动 */
toWeActHandle = () => {
let indexUrl = CFG.indexUrl
const worksNum = getUrlParam("worksNum")
MatterViewDuration("b12112", +new Date() - this.startTime);
if (getUrlParam("inviteCode")) {
// handleLogClick(38);
// MatterShareOpt( "b12112", "d12113", {
// button_name: "立即为他助力按钮",
// page_name: "分享落地页",
// entrance: extranceName[CFG.channel],
// // operation_name: "立即为他助力按钮",
// });
sensorLog(LOG_KEY.click, "b12112", "d12113", {
button_name: "为TA助力按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
handleLogClick(49)
} else if(worksNum){
indexUrl = CFG.workPage
sensorLog(LOG_KEY.click, "b12112", "d12116", {
button_name: "立即参与",
page_name: "为TA点赞按钮",
entrance: extranceName[CFG.channel],
});
// handleLogClick(35);
// MatterShareOpt("b12112", "d12116", {
// button_name: "为TA点赞按钮",
// page_name: "分享落地页",
// entrance: extranceName[CFG.channel],
// });
handleLogClick(52)
} else {
// MatterShareOpt("b12112", "d12116", {
// button_name: "立即参与按钮",
// page_name: "分享落地页",
// entrance: extranceName[CFG.channel],
// });
sensorLog(LOG_KEY.click, "b12112", "d12114", {
button_name: "立即参与按钮",
page_name: "分享落地页",
entrance: extranceName[CFG.channel],
});
handleLogClick(50)
}
CFG.workerCode = getUrlParam("ykCode");
if(isMiniprogram()){ //小程序域名写死
CFG.domain = "https://96094.activity-24.m.duiba.com.cn";
}else{
CFG.domain = location.origin
}
let url =
CFG.domain +
indexUrl +
"&channel=" +
CFG.channel +
`${!!getUrlParam("inviteCode") ? "&inviteCode=" + getUrlParam("inviteCode") : ""}` +
`${!!CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""}` +
`${!!worksNum ? `&worksNum=${worksNum}` : ""}` +
`&agentCode=${CFG.agentCode || ""}&actPlatforms=${CFG.actPlatforms || ""}&actId=${CFG.actId || ""}`;
// alert(url)
location.href = url;
};
judgeBtn = () => {
const inviteCode = getUrlParam("inviteCode")
const worksNum = getUrlParam("worksNum")
if(inviteCode) {
return <span className="assist_btn md49"></span>
} else if(worksNum) {
return <span className="zan_btn md52"></span>
} else {
return <span className="normal_btn md50"></span>
}
}
componentWillUnmount() {
MatterViewDuration("b12112", +new Date() - this.startTime);
}
render() {
// const { actStartTimestamp, actEndTimestamp } = this.state?.shareInfo || {};
let inviteCode = getUrlParam("inviteCode")
const worksNum = getUrlParam("worksNum")
return (
<div className="sharepage_wrap" ref={(r) => (this.shareRef = r)}>
<div className="sharepage modal_center">
<span className={worksNum ? "zanBg" : "bg"}></span>
{!!inviteCode && <span className="invite_text"></span>}
{/* <span className="title"></span> */}
{/* <span className="time">
活动时间:{dateFormatter(actStartTimestamp, "yyyy年MM月dd日")}-{dateFormatter(actEndTimestamp, "MM月dd日")}
</span> */}
{this.judgeBtn()}
{/* {getUrlParam("inviteCode") ? <span className="assist_btn"></span> : <span className="normal_btn"></span>} */}
<span className="click_area" onClick={() => this.toWeActHandle()}></span>
</div>
</div>
);
}
}
export default Sharepage;
@import "../../res.less";
.sharepage_wrap {
width: 750px;
height: 100vh;
left: 0px;
top: 0px;
position: absolute;
// overflow-y: scroll;
.sharepage {
width: 750px;
height: 1624px;
left: 0px;
top: 0;
position: absolute;
.invite_text{
width: 416px;
height: 102px;
left: 128px;
top: 1139px;
position: absolute;
.sparkBg("sharePage/assist_text.png");
}
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("sharePage/agentBg.png");
}
.zanBg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("sharePage/zanBg.png");
}
.time {
width: 600px;
height: 40px;
left: calc(50% - 300px);
top: 380px;
position: absolute;
color: #fff;
font-size: 24px;
font-weight: 600;
text-align: center;
}
.title {
left: 93px;
top: 236px;
width: 559px;
height: 198px;
position: absolute;
.sparkBg("homePage/title.png");
}
.enter_btn {
width: 417px;
height: 131px;
left: 167px;
top: 1158px;
position: absolute;
.sparkBg("sharePage/btn.png");
}
.zan_btn {
width: 456px;
height: 133px;
left: 146px;
top: 1286px;
position: absolute;
.sparkBg("sharePage/zanBtn.png");
}
.assist_btn {
width: 456px;
height: 133px;
left: 146px;
top: 1286px;
position: absolute;
.sparkBg("sharePage/assist_btn.png");
}
.normal_btn {
width: 456px;
height: 133px;
left: 146px;
top: 1286px;
position: absolute;
.sparkBg("sharePage/normal.png");
}
.click_area {
width: 456px;
height: 133px;
left: 146px;
top: 1286px;
position: absolute;
}
.hand {
position: absolute;
left: 557px;
top: 1352px;
width: 121px;
height: 94px;
.sparkBg("sharePage/hand.png");
pointer-events: none;
}
.logo {
width: 264px;
height: 25px;
left: calc(50% - 264px);
top: 190px;
position: absolute;
.sparkBg("homePage/logo.png");
}
}
}
\ No newline at end of file
"use strict";
import React from "react";
import { observer } from "mobx-react";
import "./userhomepage.less";
import store from "@src/store";
import { _asyncThrottle, _throttle, dateFormatter } from "@src/utils/utils";
import modalStore from "@src/store/modal";
import { PAGE_MAP, emojiReg, specialStrReg } from "@src/utils/constants";
import musicStore from "@src/store/musicStore";
import { Button } from "@src/components/Button";
import { SvgaPlayer } from "@spark/svgaplayer";
import { RES_PATH } from "../../../sparkrc";
import { LOG_KEY, pageView, sensorLog } from "@src/utils/sensors";
@observer
class Userhomepage extends React.Component {
constructor(props) {
super(props);
this.state = {
workNum: "",
};
}
async componentDidMount() {
await store.getProductSearch();
pageView("b12094", {
page_name: "用户端-活动首页",
});
sensorLog(LOG_KEY.exposure, "b12094", "d12095", {
page_name: "用户端-活动首页",
button_name: "规则按钮",
});
sensorLog(LOG_KEY.exposure, "b12094", "d12096", {
page_name: "用户端-活动首页",
button_name: "奖品按钮",
});
sensorLog(LOG_KEY.exposure, "b12094", "d12097", {
page_name: "用户端-活动首页",
button_name: "抽奖按钮",
});
sensorLog(LOG_KEY.exposure, "b12094", "d12098", {
page_name: "用户端-活动首页",
button_name: "赚点赞次数按钮",
});
sensorLog(LOG_KEY.exposure, "b12094", "d12098", {
page_name: "用户端-活动首页",
button_name: "赚点赞次数按钮",
});
sensorLog(LOG_KEY.exposure, "b12094", "d12099", {
page_name: "用户端-活动首页",
button_name: "搜索作品按钮",
});
sensorLog(LOG_KEY.exposure, "b12094", "d12100", {
page_name: "用户端-活动首页",
button_name: "我的点赞按钮",
});
}
/** 规则按钮*/
clickRule = () => {
sensorLog(LOG_KEY.click, "b12094", "d12095", {
page_name: "用户端-活动首页",
button_name: "规则按钮",
});
if (!store.checkActTime("rule")) return;
modalStore.pushPop("RulePop");
};
/** 奖品按钮*/
clickPrize = () => {
sensorLog(LOG_KEY.click, "b12094", "d12096", {
page_name: "用户端-活动首页",
button_name: "奖品按钮",
});
if (!store.checkActTime("prize")) return;
if (!store.setIndex?.agreeFlag) {
modalStore.pushPop("Yinsirulepop");
return;
}
store.changePage(PAGE_MAP.PRIZE_PAGE, { from: PAGE_MAP.USER_HOME_PAGE });
};
/** 暂停音乐按钮*/
toStop = () => {
if (!store.checkActTime()) return;
musicStore.changeMusicStatus();
};
/** 播放音乐按钮*/
toPlay = () => {
if (!store.checkActTime()) return;
musicStore.changeMusicStatus();
};
/** 任务按钮*/
clickTask = () => {
sensorLog(LOG_KEY.click, "b12094", "d12098", {
page_name: "用户端-活动首页",
button_name: "赚点赞次数按钮",
});
if (!store.checkActTime()) return;
modalStore.pushPop("Taskpop");
};
/** 抽奖按钮*/
clickDraw = () => {
sensorLog(LOG_KEY.click, "b12094", "d12097", {
page_name: "用户端-活动首页",
button_name: "抽奖按钮",
});
if (!store.checkActTime()) return;
store.changePage(PAGE_MAP.DRAW_PAGE);
};
/** 点赞明细按钮*/
clickLikeDetail = () => {
sensorLog(LOG_KEY.click, "b12094", "d12100", {
page_name: "用户端-活动首页",
button_name: "我的点赞按钮",
});
if (!store.checkActTime()) return;
store.changePage(PAGE_MAP.LIKE_LOG_PAGE);
};
onNumInput = (e) => {
let value = e.target.value;
value = value.replace(emojiReg, "");
value = value.replace(specialStrReg, "").replace(/\s+/g, "");
this.setState({
workNum: value,
});
};
search = _asyncThrottle(() => {
sensorLog(LOG_KEY.click, "b12094", "d12099", {
page_name: "用户端-活动首页",
button_name: "搜索作品按钮",
});
const { workNum } = this.state;
// if (!workNum) return;
store.getProductSearch(workNum);
}, 1000);
clickDetails = _throttle((workNum) => {
if (!store.checkActTime()) return;
store.workDetailNum = workNum;
store.changePage(PAGE_MAP.OPUS_PAGE)
})
render() {
const { setIndex, setProductSearch } = store;
const { workNum } = this.state;
return (
<div className="com_Container">
<div className="userhomepage">
<span className="bg"></span>
<SvgaPlayer className="svga1" src={`${RES_PATH}userHomePage/3输出首页氛围.svga`}></SvgaPlayer>
<span className="diaologBg"></span>
{musicStore?.status ? (
<Button className="music_open md25" onClick={this.toStop} />
) : (
<Button className="music_close md25" onClick={this.toPlay} />
)}
<div className="productbox">
{setProductSearch?.rankInfos?.length > 0 ? (
setProductSearch?.rankInfos?.map((item, index) => {
return (
<div className="productitem" key={"rank" + index}>
<span className="produtbg"></span>
<span className="produtImg" onClick={this.clickDetails.bind(this,item?.worksNum)}>
<img src={item?.worksImg} alt="" />
</span>
<span className="pictureList_item_bianhaoBg"></span>
<span className="produtRankBg"></span>
<span className="productrank">{item?.rank}</span>
<span className="productnum">作品编号:{item?.worksNum}</span>
<span className="producttitle textover">{item?.worksTitle}</span>
<div className="likenumbox">
<span className="likenum">{item?.thumbsNum > 999999 ? "999999+" : item?.thumbsNum}</span>
<span className="likenum_icon"></span>
</div>
{item?.sex == 1 && <span className="sex1_icon"></span>}
{item?.sex == 2 && <span className="sex2_icon"></span>}
</div>
);
})
) : (
<div className="nothing" />
)}
</div>
<span className="acttime">
活动时间:{dateFormatter(setIndex?.actStartTime, "yyyy年MM月dd")} -{" "}
{dateFormatter(setIndex?.actEndTime, "MM月dd号")}
</span>
<span className="mylastlikenum">
我的点赞次数:{setProductSearch?.remainThumbsTimes > 9999 ? "9999+" : setProductSearch?.remainThumbsTimes}
</span>
<Button className="mylike_btn md28" onClick={this.clickLikeDetail}></Button>
<div className="searchbox">
<input
className="search_bg inputStyle"
placeholder="搜索作品编号"
value={workNum}
maxLength={50}
onChange={this.onNumInput}></input>
</div>
<span className="prizename">
每点赞1次可获得1次抽奖机会
<br />
有机会抽取{setIndex?.awardDesc}
</span>
<div className="useridbox">
<span className="useridbg"></span>
<span className="userid">用户ID:{setIndex?.uid}</span>
</div>
<Button className="task_btn md27" onClick={this.clickTask}></Button>
<Button className="rule_btn md24" onClick={this.clickRule}></Button>
<Button className="prize_btn md23" onClick={this.clickPrize}></Button>
<span className="search_btn"></span>
<span className="search_icon" onClick={this.search}></span>
<Button className="draw_btn md26" onClick={this.clickDraw}></Button>
</div>
</div>
);
}
}
export default Userhomepage;
@import "../../res.less";
.userhomepage {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.bg {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("userHomePage/bg.png");
}
.diaologBg{
width: 704px;
height: 266px;
left: 37px;
top: 712px;
position: absolute;
.sparkBg("userHomePage/diolog.png");
}
.svga1{
width: 638px;
height: 764px;
left: 56px;
top: 150px;
position: absolute;
}
.music_close {
position: absolute;
left: 680px;
top: 353px;
width: 54px;
height: 53px;
.sparkBg("SaleManPage/music_close.png");
}
.music_open {
position: absolute;
left: 680px;
top: 353px;
width: 54px;
height: 53px;
.sparkBg("SaleManPage/music_open.png");
}
.productbox {
width: 660px;
height: 471px;
left: 45px;
top: 1139px;
position: absolute;
overflow-y: scroll;
overflow-x: hidden;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.nothing {
position: absolute;
left: 140px;
top: 100px;
width: 389px;
height: 316px;
.sparkBg("userHomePage/nothing.png");
}
.productitem {
width: 314px;
height: 271px;
left: 0px;
top: 0px;
position: relative;
margin-right: 15px;
.pictureList_item_bianhaoBg {
position: absolute;
left: 0px;
top: 140px;
width: 305px;
height: 93px;
border-radius: 20px;
.sparkBg("SaleManPage/pictureList_item_bianhaoBg.png");
pointer-events: none;
}
.produtRankBg {
width: 90px;
height: 36px;
left: 0px;
top: 16px;
position: absolute;
background-color: #ec6030;
border-radius: 22px 0 22px 0;
}
.produtbg {
width: 314px;
height: 230px;
left: 0px;
top: 16px;
position: absolute;
.sparkBg("userHomePage/produtBg.png");
}
.produtImg {
width: 314px;
height: 225px;
left: 0px;
top: 16px;
position: absolute;
overflow: hidden;
border-radius: 22px;
img {
max-width: 300px;
max-height: 200px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}
}
.productrank {
width: 126px;
// height: 19px;
left: 16px;
top: 24px;
position: absolute;
font-size: 19px;
line-height: 20px;
color: rgba(255, 255, 255, 1);
}
.productnum {
width: 100%;
height: 17px;
// left: 85px;
text-align: center;
top: 200px;
position: absolute;
font-size: 16px;
line-height: 17px;
color: rgba(255, 255, 255, 1);
pointer-events: none;
}
.producttitle {
width: 230px;
// height: 25px;
left: 0px;
top: 245px;
position: absolute;
font-size: 22px;
line-height: 26px;
color: rgba(255, 141, 46, 1);
}
.likenumbox {
width: 86px;
height: 23px;
left: 220px;
top: 244px;
position: absolute;
.likenum {
width: 67px;
height: 16px;
left: 29px;
top: 5px;
position: absolute;
font-size: 20px;
line-height: 16px;
color: rgba(252, 151, 56, 1);
}
.likenum_icon {
width: 25px;
height: 23px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("userHomePage/likeNum_icon.png");
}
}
.sex2_icon {
width: 120px;
height: 48px;
left: 192px;
top: 0px;
position: absolute;
.sparkBg("userHomePage/sex2_icon.png");
}
.sex1_icon {
width: 120px;
height: 48px;
left: 192px;
top: 0px;
position: absolute;
.sparkBg("userHomePage/sex1_icon.png");
}
}
}
.acttime {
width: 100%;
// height: 25px;
// left: 184px;
font-weight: 500;
text-align: center;
top: 328px;
position: absolute;
font-size: 25px;
line-height: 25px;
color: rgba(26, 69, 80, 1);
}
.mylastlikenum {
width: 281px;
// height: 27px;
left: 235px;
top: 1012px;
text-align: center;
position: absolute;
font-size: 28px;
// line-height: 27px;
color: rgba(255, 255, 255, 1);
}
.mylike_btn {
width: 173px;
height: 84px;
left: 553px;
top: 1052px;
position: absolute;
.sparkBg("userHomePage/myLike_btn.png");
transform-origin: right center;
}
.searchbox {
width: 245px;
height: 46px;
left: 47px;
top: 1079px;
position: absolute;
.search_bg {
width: 150px;
height: 42px;
left: 0px;
top: 0px;
position: absolute;
padding-left: 50px;
padding-right: 140px;
font-size: 20px;
border-radius: 30px;
border: solid 2px #ff8d2e;
// .sparkBg("userHomePage/search_bg.png");
}
}
.prizename {
width: 307px;
height: 65px;
left: 66px;
top: 894px;
position: absolute;
font-size: 22px;
color: rgba(92, 92, 92, 1);
overflow-y: scroll;
}
.useridbox {
width: auto;
height: 39px;
left: 0px;
top: 380px;
position: absolute;
// .useridbg {
// width: 171px;
// height: 39px;
// left: 0px;
// top: 0px;
// position: absolute;
// .sparkBg("userHomePage/userIdBg.png");
// }
.userid {
width: auto;
height: 20px;
// left: 9px;
top: 10px;
// position: absolute;
font-size: 21px;
border-radius: 0 8px 8px 0;
padding: 10px 5px 10px 9px;
// line-height: 20px;
color: rgba(255, 255, 255, 1);
background-color: #0d363d;
}
}
.task_btn {
width: 161px;
height: 63px;
left: 372px;
top: 894px;
position: absolute;
.sparkBg("userHomePage/task_btn.png");
}
.rule_btn {
width: 110px;
height: 50px;
left: 640px;
top: 266px;
position: absolute;
.sparkBg("userHomePage/rule_btn.png");
transform-origin: right center;
}
.prize_btn {
width: 92px;
height: 50px;
left: 0px;
top: 266px;
position: absolute;
.sparkBg("userHomePage/prize_btn.png");
transform-origin: left center;
}
.search_icon{
width: 132px;
height: 51px;
left: 259px;
top: 1075px;
position: absolute;
.sparkBg("userHomePage/search_icon.png");
}
.search_btn {
width: 27px;
height: 26px;
left: 64px;
top: 1090px;
position: absolute;
.sparkBg("userHomePage/search_btn.png");
}
.draw_btn {
width: 149px;
height: 139px;
left: 18px;
top: 660px;
position: absolute;
.sparkBg("userHomePage/draw_btn.png");
}
}
@RES_PATH: '/src/assets/';
@webp: '?x-oss-process=image/format,webp';
.sparkBg(@value) {
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: left top;
background-image: url("@{RES_PATH}@{value}");
[duiba-webp='true'] & {
background-image: url("@{RES_PATH}@{value}@{webp}");
}
}
.webpBg(@value) {
.sparkBg("@{value}");
}
.mask(@value) {
mask-image: url("@{RES_PATH}@{value}");
-webkit-mask-image: url("@{RES_PATH}@{value}");
mask-repeat: no-repeat;
}
// 定位-水平垂直居中
.transform_center() {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
position: absolute;
}
// flex-水平垂直居中
.flex_center() {
display: flex;
justify-content: center;
align-items: center;
}
/* 文本过长隐藏文字并显示省略号 单行*/
.lineClamp1() {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.lineClampN(@num) {
text-overflow: -o-ellipsis-lastline;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: @num;
overflow: hidden;
}
// 按钮呼吸动效
.breathAnimation() {
animation: scale 1s linear infinite alternate;
@keyframes scale {
0% {
transform: scale(1);
}
100% {
transform: scale(1.12);
}
}
}
// 弹窗居中缩放动效
// 注意 加该样式的元素居中方式不能用translate(-50%, -50%)
// 可以用margin-left、margin-top为负的宽度、高度的一半
.popupCenterShow() {
animation: centerShowAni 300ms ease-out;
@keyframes centerShowAni {
0% {
transform: scale(0);
}
66.7% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
}
// 渐入动画
.fade-in {
opacity: 0;
animation: fadeIn ease-in 1;
animation-fill-mode: forwards;
animation-duration: 1s;
}
@keyframes fadeIn {
0% {
opacity: 0;
}
70% {
opacity: 0;
}
100% {
opacity: 1;
}
}
// 隐藏滚动条
.hideScrollbar() {
scrollbar-width: none;
/* firefox */
-ms-overflow-style: none;
/* IE 10+ */
&::-webkit-scrollbar {
display: none;
/* Chrome Safari */
}
}
.ruleStyle {
overflow-x: hidden;
overflow-y: scroll;
word-break: break-all;
}
// 上滑弹窗动画
.topPop_move {
animation: move_top_ani 500ms ease-in-out;
@keyframes move_top_ani {
0% {
transform: translateY(100%);
}
100% {
transform: translateY(0);
}
}
}
.inputStyle{
border: none;
outline: none;
background-color: transparent;
// padding-left: 30px;
// padding-right: 20px;
font-size: 28px;
-webkit-user-select: auto !important;
-khtml-user-select: auto !important;
-moz-user-select: auto !important;
-ms-user-select: auto !important;
-o-user-select: auto !important;
user-select: auto !important;
}
.textover {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// 多行显示省略号
.textover2 {
-webkit-box-orient: vertical; // 避免压缩后删除此行
-webkit-line-clamp: 2; // 显示省略号行数
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
}
import { Toast } from "@spark/ui";
import store from ".";
import { callApi } from "@spark/api-base";
import { getDomain } from "@spark/dbdomain";
/** 判断活动状态 */
export const judgeActivity = (arr = ['start', 'end']) => {
const { currentTimestamp, actStartTimestamp, actEndTimestamp } = store?.homeInfo || {};
if (currentTimestamp < actStartTimestamp && arr.includes("start")) {
Toast("活动未开始", 2000, {hideOthers: true});
return false;
} else if (currentTimestamp > actEndTimestamp && arr.includes("end")) {
Toast("活动已结束", 2000, {hideOthers: true});
return false;
}
return true;
};
/** 处理cookie */
export const saveCookies = async () => {
// const strCookie = document.cookie;
// localStorage.setItem("userCookies", strCookie);
// console.info(`%c 设置cookies: ${strCookie}`, "font-size: 20px");
const domain = await getDomain();
const data = await callApi(`${domain}/autoLogin/tempSaveCookie`);
console.info(`%c cookieId: ${data}`, "font-size: 20px; color: orange");
if (!!data) {
localStorage.setItem("cookieId", data);
}
};
/** 设置cookies */
export const setCookies = async () => {
// alert(1)
// console.info("setCookies执行")
// console.info("setCookies1")
const cookieId = localStorage.getItem("cookieId");
const domain = await getDomain();
// console.info("setCookies2")
if (!!cookieId) {
// console.info("setCookies3")
await callApi(`${domain}/autoLogin/resetCookie?duibaTempCookieId=${cookieId}`);
localStorage.removeItem("cookieId");
// console.info("setCookies4")
}
};
import { PAGE_MAP } from "@src/utils/constants";
import { makeAutoObservable } from "mobx";
import API from "../api/index";
import { GetCurrSkinId, getCustomShareId, getUrlParam, waitTime } from "@src/utils/utils";
import { Toast } from "@spark/ui";
import modalStore from "@src/store/modal";
import shareStore from "./share";
import ReviewSucPop from "@src/components/ReviewSucPop/ReviewSucPop";
import RankNoPrizePop from "@src/components/RankNoPrizePop/RankNoPrizePop";
const skinId = GetCurrSkinId() || getCustomShareId();
const store = makeAutoObservable({
/** 活动规则 */
ruleInfo: "",
/** 前端开发配置 */
frontVariable: {},
/** 当前页面 */
curPage: (CFG.agentShare == "1" ? PAGE_MAP.AGENT_SHARE_PAGE : null) || {
// TODO 举例子,自定义页面,因为mng更新原因原数字id会对应一个新的字符串id
"5055": "sharePage",
Did1NDA0NDc: "sharePage",
prize: PAGE_MAP.PRIZE_PAGE,
sharepage: PAGE_MAP.SHARE_PAGE,
index: PAGE_MAP.HOME_PAGE,
workPage: PAGE_MAP.OPUS_PAGE,
}[skinId] || PAGE_MAP.HOME_PAGE,
pageData: {},
/** 绑定友客业务员 */
async bindYkCode(code) {
const res = await API.bindYk({
code: code,
});
return res;
},
//分享活动
shareAct() {
shareStore.doShare();
},
/** 场景切换 */
changePage(page, data = {}) {
this.pageData = data;
this.curPage = page;
},
homeInfo: {},
/** 获取首页信息 */
async getHomeInfo() {
const resp = await API.getHomeInfo();
if (resp.success) {
this.homeInfo = resp.data;
// todo 首页接口把绑定逻辑加上
/** 绑定业务员code判断 */
if (data?.boundYkCode) {
// 已绑定
if (resp?.data?.agent) {
CFG.workerCode = resp?.data?.agentCode;
} else {
CFG.workerCode = resp?.data?.boundYkCode;
}
} else {
// 未绑定 从链接上取-无论是否有都要调用
if (!resp?.data?.agent) {
/**后端说增加非业务员才调用 */
const { success: success1, data: data1 } = await this.bindYkCode(CFG.workerCode || "");
if (success1 && data1?.code) {
CFG.workerCode = data1?.code;
}
} else {
CFG.workerCode = resp?.data?.agentCode;
}
}
}
},
/** 获取活动规则 */
async initRule() {
// 模拟获取远程的数据
const { data } = await API.getRule();
this.ruleInfo = data;
},
/** 获取前端配置项 */
async getFrontVariable() {
// 获取前端开发配置
const { data } = await API.getFrontVariable();
this.frontVariable = data || {};
console.log("前端开发配置", data);
},
/** 绑定手机号接口返回状态 */
isApiCheckBack: false,
setIsApiCheckBack(status) {
this.isApiCheckBack = status;
},
/** 校验是否绑定手机号 */
async checkBindStatus() {
const { success, data } = await API.checkBind({
appId: getUrlParam("appId"),
dbredirect: encodeURIComponent(window.location.href),
});
console.info("%c data", "font-size: 30px", data);
if (success && data) {
if (data?.bind) {
if (data?.url) {
location.replace(data?.url);
} else {
// 已经绑定过,跳转完后端返回的免登链接时,展示页面
this.setIsApiCheckBack(true); // 助力
return true;
}
} else {
this.setIsApiCheckBack(true);
modalStore.pushPop("LoginPop");
}
await waitTime(200);
}
return false;
},
setIndex: {},
/** 首页 */
async getSalesManIndex() {
const { success, data } = await API.salesManIndex();
if (!success) return;
this.setIndex = data || {};
if (!data.guideFlag && data?.agent) {
modalStore.pushPop("GuidePop");
}
if (data?.ruleGuidePopFlag) {
modalStore.pushPop("RulePop");
}
// 首页接口把绑定逻辑加上
/** 绑定业务员code判断 */
if (data?.boundYkCode) {
// 已绑定
if (data?.agent) {
CFG.workerCode = data?.agentCode;
} else {
CFG.workerCode = data?.boundYkCode;
}
} else {
// 未绑定 从链接上取-无论是否有都要调用
if (!data?.agent) {
/**后端说增加非业务员才调用 */
const { success: success1, data: data1 } = await this.bindYkCode(CFG.workerCode || "");
if (success1 && data1?.code) {
CFG.workerCode = data1?.code;
}
} else {
CFG.workerCode = data?.agentCode;
}
}
// 审核弹窗
if (this.setIndex?.examinePop?.needPop) {
if (this.setIndex?.examinePop.result) {
modalStore.pushPop("ReviewSucPop", { data: this.setIndex?.examinePop?.sendDrawNum });
} else {
modalStore.pushPop("ReviewFailedPop");
}
}
// 排行榜弹窗
if (this.setIndex?.rankPop?.needPop) {
if (this.setIndex?.rankPop.result) {
modalStore.pushPop("RankPrizePop", { data: this.setIndex?.rankPop });
} else {
modalStore.pushPop("RankNoPrizePop", { data: this.setIndex?.rankPop });
}
}
},
/** 判断活动时间 */
checkActTime(type) {
const { actStartTime, currentTime, actEndTime } = this.setIndex;
if (currentTime < actStartTime && !["rule", "prize"].includes(type)) {
Toast("活动未开始");
return false;
}
if (currentTime > actEndTime && !["rule", "prize"].includes(type)) {
Toast("活动已结束");
return false;
}
return true;
},
setExamineIndex: {},
/** 审核首页 */
async getExamineIndex() {
const { success, data } = await API.examineIndex();
if (!success) return;
this.setExamineIndex = data || {};
},
setProductSearch: {},
/** 作品排行榜 */
async getProductSearch(workNum = "") {
const { success, data } = await API.productSearch({ content: workNum });
if (!success) return;
this.setProductSearch = data || {};
},
workDetailNum: getUrlParam("worksNum"),//作品详情页作品编号
opusInfo: {},
endOpus: false,
async getOpusInfo() {
this.endOpus = false
const { success, data } = await API.workDetail({ worksNum: this.workDetailNum });
if (success) {
this.opusInfo = data;
this.nowPage = 1;
this.commentInfo = [];
this.getCommentInfo(1);
}
this.endOpus = true
},
commentInfo: [],
totalPage: 0,
nowPage: 1,
timeStamp: 0,
async getCommentInfo(pageNum) {
const { success, data, timeStamp } = await API.commentRecords({ worksNum: this.workDetailNum, pageNum, pageSize: 20 });
if (success) {
this.timeStamp = timeStamp;
this.commentInfo = this.commentInfo.concat(data.list);
this.totalPage = data.totalPage;
this.nowPage = pageNum;
}
},
async doComment(content) {
const { success, data } = await API.comment({ worksNum: this.workDetailNum, content });
if (success) {
modalStore.closePop("Commentpop");
Toast("发送成功~");
this.getOpusInfo();
}
},
async doThumbsUp() {
const { success, data } = await API.thumbsUp({ worksNum: this.workDetailNum });
if (success) {
modalStore.pushPop("Pointsucpop", data.awardDrawTimes);
}
},
});
export default store;
import {makeAutoObservable} from "mobx";
// 此处配置页面的优先级,越大优先级越高
// PopIndex:11
/**
* 弹窗优先级 可以是负数, 不写默认是10, 数值越小,层级越高
*/
const modalIndex = {
// 优先级:手机号验证码登陆>新手引导>活动规则弹窗;
// 排行榜弹窗>审核通过抽奖弹窗
"LoginPop": 3,
"GuidePop": 2,
"RulePop": 1,
"RankNoPrizePop": 2,
"RankPrizePop": 2,
"ReviewSucPop": 1,
};
const modalStore = makeAutoObservable({
popList: [],
/**
*
* @param {*} key 弹窗名,一般是类名的字符串
* @param {*} data 需要传递的数据,弹窗中使用 const {popData} = props; 获取
* @param {*} isMulti 是否是二级弹窗,在不关闭已有弹窗的基础上,弹出当前弹窗。注意,如果是二级弹窗,关闭时必须传key
*/
pushPop(key, data = {}, isMulti = false) {
if (this.popList.length) {
let cacheList = this.popList.slice();
cacheList.push({key, data, isMulti});
cacheList = cacheList.sort((a, b) => ((modalIndex[b.key] ? modalIndex[b.key] : 10) - (modalIndex[a.key] ? modalIndex[a.key] : 10)));
this.popList.clear();
this.popList.push(...cacheList);
} else {
this.popList.push({key, data, isMulti});
}
// console.log("this.popList:::",toJS(this.popList));
},
/**
*
* @param {*} key 弹窗名,一般是类名的字符串,关闭指定弹窗,若未指定,则关闭当前弹窗
*/
closePop(key) {
if (key) {
let cacheList = this.popList.slice();
cacheList = cacheList.filter(obj => (obj.key != key));
this.popList.clear();
this.popList.push(...cacheList);
} else {
this.popList.shift();
}
},
/**
* 关闭所有弹窗
*/
closePopAll() {
this.popList.clear();
}
});
export default modalStore;
import { makeAutoObservable } from "mobx"; // 从mobx库导入makeAutoObservable,用于自动观察类的状态变化
import { playSound, preloadSounds, registerSounds, stopSound, watchPageVisibility, mute, unmute } from "@spark/utils"; // 从工具库导入多个声音控制的函数
import { RES_PATH } from "../../sparkrc"; // 导入资源路径常量
// 创建一个音乐存储的类并使用mobx的makeAutoObservable进行自动观察
const musicStore = makeAutoObservable(new class {
// 定义音乐状态,开发环境下默认不播放音乐,初始值为true(音乐播放)
status = true;
constructor() {
// 注册背景音乐的声音资源
registerSounds({
'bg_music': RES_PATH + 'music/bgm.mp3', // 将背景音乐的路径与名称进行关联
});
// 预加载声音资源
preloadSounds(null, () => {
// 加个判断 防止出现:音乐还未加载完用户点击了暂停,等加载完音乐还会播放
musicStore.status && playSound('bg_music', { 'loop': true }); // 如果状态为true,则循环播放背景音乐
});
// 监听页面可见性变化
watchPageVisibility(this.onPageVisibilityChange);
}
// 页面可见性变化的处理函数
onPageVisibilityChange = async (visible) => {
if (visible) {
console.info('页面可见',this.status);
// 如果页面可见,判断当前状态决定是否播放背景音乐
this.status ? await playSound('bg_music', {'loop': true}) : stopSound('bg_music');
} else {
// 如果页面不可见,停止播放背景音乐
stopSound('bg_music');
console.info('页面不可见',this.status);
}
}
// 切换音乐状态的方法
changeMusicStatus () {
// 切换当前状态, 播放或停止音乐, 添加默认淡入淡出效果
this.status = !this.status;
this.status ? playSound('bg_music', { 'loop': true, 'fade': true }) : stopSound('bg_music', { 'fade': true });
}
});
// 导出音乐存储实例,以便在其他模块使用
export default musicStore;
import { makeAutoObservable } from "mobx";
import API from "../api/index";
import { showShareGuide } from "@spark/share";
import store from ".";
import { isWeChat, onUpdateShare } from "@src/utils/share";
import { Toast } from "@spark/ui";
import { assistTip } from "@src/utils/constants";
import { isMiniprogram, windowJumpUrl } from "@src/utils/utils";
import modalStore from "./modal";
import { isIOS } from "@spark/utils";
function isEnterpriseWeChat() {
//企业微信
const userAgent = navigator.userAgent.toLowerCase();
return /wxwork/.test(userAgent); // 检查是否包含 "wxwork"
}
const shareStore = makeAutoObservable({
/** 普通分享 */
async doShare(showGuide = true) {
const shareInfo = JSON.parse(store.frontVariable.shareInfo);
if (isWeChat()) {
// 微信环境分享
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${`&ykCode=${CFG.workerCode || CFG.agentCode || ""
}`}${`&channel=${CFG.defaultChannel}`}&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId
}`
)}`;
console.info("分享链接", _url);
if (isMiniprogram()) {
const query = JSON.stringify({
imgUrl: shareInfo?.imgUrl,
isYKShare: "1",
link: _url,
title: shareInfo?.title,
});
// 小程序
wx.miniProgram.navigateTo({
url: `/subpackages/h5/miniProgramWebShare/index?YKMiniprogramShare=${encodeURIComponent(query)}`,
});
} else if (isEnterpriseWeChat()) {
//微通 (企业微信)
if(location.href.indexOf("test") > -1) {
location.href = `https://mtest.picclife.cn/refactor-web/index.html?v=${Date.now()}#/duibaSharePage?link=${encodeURIComponent(
_url
)}&title=${shareInfo?.title}&desc=${shareInfo?.content}&imgUrl=${shareInfo?.imgUrl}`;
} else {
location.href = `https://m.picclife.cn/refactor-web/index.html?v=${Date.now()}#/duibaSharePage?link=${encodeURIComponent(
_url
)}&title=${shareInfo?.title}&desc=${shareInfo?.content}&imgUrl=${shareInfo?.imgUrl}`;
}
} else {
showGuide && showShareGuide();
//H5
onUpdateShare({
...shareInfo,
url: _url, // 带授权链接的活动链接
});
}
} else {
// app分享
// app参数
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${`&ykCode=${CFG.workerCode || CFG.agentCode || ""
}`}${`&channel=${CFG.defaultChannel}`}&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId
}`
)}`;
console.info("分享链接", _url);
if (CFG.channel == "1") {
//管家
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
shareUrl: _url,
thumbUrl: shareInfo.thumbnail,
shareType: "0", // 1分享网页 2分享图片 3分享视频4分享音乐 5分享文本
};
window.PICCLifeJsBrage.callNative({
module: "Share",
method: "options",
params: JSON.stringify(params),
callback: "",
});
}
if (CFG.channel == "6") {
//e通
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
url: _url,
thumbImage: shareInfo.thumbnail,
};
window.inAppShare({
type: "shareLink",
activity: "richMan",
params: JSON.stringify(params),
});
}
}
},
/** 邀请好友 */
async doInvite() {
const shareInfo = JSON.parse(store.frontVariable.shareInfoInvite);
const { success, data } = await API.getInviteCode();
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
}${`&channel=${CFG.defaultChannel}`}` +
(data?.inviteCode ? `&inviteCode=${data.inviteCode}` : "") +
`&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
)}`;
console.info("邀请链接>>>", _url);
// const { success:success2, data:data2 } = await API.getLongLinkQrcode({
// width: 220,
// height: 220,
// content: encodeURIComponent(_url),
// });
// return data2;
if (success) {
if (isWeChat()) {
// 微信环境分享
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
}${`&channel=${CFG.defaultChannel}`}` +
(data?.inviteCode ? `&inviteCode=${data.inviteCode}` : "") +
`&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
)}`;
console.info("邀请链接>>>", _url);
if (isMiniprogram()) {
const query = JSON.stringify({
imgUrl: shareInfo?.imgUrl,
isYKShare: "1",
link: _url,
title: shareInfo?.title,
});
// 小程序
wx.miniProgram.navigateTo({
url: `/subpackages/h5/miniProgramWebShare/index?YKMiniprogramShare=${encodeURIComponent(query)}`,
});
} else if (isEnterpriseWeChat()) {
location.href = `https://m.picclife.cn/refactor-web/index.html?v=${Date.now()}#/duibaSharePage?link=${encodeURIComponent(
_url
)}&title=${shareInfo?.title}&desc=${shareInfo?.content}&imgUrl=${shareInfo?.imgUrl}`;
} else {
// showShareGuide('点击右上角...分享', 0.7, 0, () => {
// const _url1 = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
// `${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
// }${`&channel=${CFG.defaultChannel}`}` +
// `&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
// )}`;
// onUpdateShare({
// ...shareInfo,
// url: _url1, // 带授权链接的活动链接
// });
// });
showShareGuide();
onUpdateShare({
...shareInfo,
url: _url, // 带授权链接的活动链接
});
}
} else {
// app分享
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
}${`&channel=${CFG.defaultChannel}`}` +
(data?.inviteCode ? `&inviteCode=${data.inviteCode}` : "") +
`&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
)}`;
console.info("分享链接>>>", _url);
// app参数
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
shareUrl: _url,
thumbUrl: shareInfo.thumbnail,
shareType: "0", // 1分享网页 2分享图片 3分享视频4分享音乐 5分享文本
};
window.PICCLifeJsBrage.callNative({
module: "Share",
method: "options",
params: JSON.stringify(params),
callback: "",
});
}
}
},
/** 邀请作品点赞 */
async doInviteZan(worksNum) {
const shareInfo = JSON.parse(store.frontVariable.shareInfoZan);
// const { success, data } = await API.getInviteCode();
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
}${`&channel=${CFG.defaultChannel}`}&worksNum=${worksNum}` +
`&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
)}`;
console.info("作品链接>>>", _url);
// const { success:success2, data:data2 } = await API.getLongLinkQrcode({
// width: 220,
// height: 220,
// content: encodeURIComponent(_url),
// });
// return data2;
// if (success) {
if (isWeChat()) {
// 微信环境分享
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
}${`&channel=${CFG.defaultChannel}`}&worksNum=${worksNum}` +
`&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
)}`;
console.info("分享链接>>>", _url);
if (isMiniprogram()) {
const query = JSON.stringify({
imgUrl: shareInfo?.imgUrl,
isYKShare: "1",
link: _url,
title: shareInfo?.title,
});
// 小程序
wx.miniProgram.navigateTo({
url: `/subpackages/h5/miniProgramWebShare/index?YKMiniprogramShare=${encodeURIComponent(query)}`,
});
} else if (isEnterpriseWeChat()) {
location.href = `https://m.picclife.cn/refactor-web/index.html?v=${Date.now()}#/duibaSharePage?link=${encodeURIComponent(
_url
)}&title=${shareInfo?.title}&desc=${shareInfo?.content}&imgUrl=${shareInfo?.imgUrl}`;
} else {
// showShareGuide('点击右上角...分享', 0.7, 0, () => {
// const _url1 = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
// `${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
// }${`&channel=${CFG.defaultChannel}`}` +
// `&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
// )}`;
// onUpdateShare({
// ...shareInfo,
// url: _url1, // 带授权链接的活动链接
// });
// });
showShareGuide();
onUpdateShare({
...shareInfo,
url: _url, // 带授权链接的活动链接
});
}
} else {
// app分享
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.shareUrl}${CFG.workerCode ? `&ykCode=${CFG.workerCode}` : ""
}${`&channel=${CFG.defaultChannel}`}&worksNum=${worksNum}` +
`&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId}`
)}`;
console.info("分享链接>>>", _url);
// app参数
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
shareUrl: _url,
thumbUrl: shareInfo.thumbnail,
shareType: "0", // 1分享网页 2分享图片 3分享视频4分享音乐 5分享文本
};
window.PICCLifeJsBrage.callNative({
module: "Share",
method: "options",
params: JSON.stringify(params),
callback: "",
});
}
// }
},
/** 助力 */
async doAssist() {
if (!CFG.inviteCode) return false;
console.info("进入助力!!!");
if (sessionStorage.getItem("inviteCode")) return false;
const { success, code, data, message } = await API.doAssist({ inviteCode: CFG.inviteCode });
if (success) {
Toast("助力成功~")
// modalStore.pushPop("Assistsuccesspop");
// modalStore.pushPop("AssistSuccess");
} else {
// modalStore.pushPop("AssistFail", {message, code});
// modalStore.pushPop("Assistfailpop", { message, code });
}
sessionStorage.setItem("inviteCode", CFG.inviteCode);
history.replaceState({}, "", location.href.replace(new RegExp(`[?&]inviteCode=[^&]*`), ""));
},
/** 奖品页唤端 */
goAppPrize() {
// windowJumpUrl(CFG.toAppPrizeUrl);
//CFG.projectId三元判断为真,前面的是正式,需要修改的地方为中间页链接,可咨询东哥链接(奖品页唤端) ios需要多encode一次
const testCustomId = "Did1NTk5Njc";
const prodCustomId = "Did1NjAwODc";
windowJumpUrl(
CFG.projectId == "p7925c40f"
? "https://lifeapp.picclife.cn/portal/app_manager/downloadapps.html?operate_link=" +
encodeURIComponent(
`https://lifeapp-api.picclife.cn/lifeapi/lifeapp-svc-gw/api/auth_code/authorize/v1?activity_code=613002&redirect_type=0&redirect_uri=${isIOS
? encodeURIComponent(
encodeURIComponent(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=${prodCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}`
)
)
: encodeURIComponent(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=${prodCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}`
)
}`
) +
"&isBindManager=1&isNeedAuth=1&operate_type=3"
: "https://lifeapp-test.picclife.cn/portal-web/app_manager/downloadapps.html?operate_link=" +
encodeURIComponent(
`https://lifeapp-api-test.picclife.cn/lifeapi/lifeapp-svc-rel-gw/api/auth_code/authorize/v1?activity_code=613002&redirect_type=0&redirect_uri=${isIOS
? encodeURIComponent(
encodeURIComponent(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=${testCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}`
)
)
: encodeURIComponent(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=${testCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}`
)
}`
) +
"&isBindManager=1&isNeedAuth=1&operate_type=3"
);
},
});
export default shareStore;
import { makeAutoObservable } from "mobx";
import API from "../api/index";
import store from ".";
import { Toast } from "@spark/ui";
import modalStore from "./modal";
import { md5 } from "@spark/utils";
import { saveCookies, setCookies } from "./fetcher";
import { showShareGuide } from "@spark/share";
import shareStore from "./share";
import { handleLogClick, handleLogExposure } from "../../MD";
import { isWeChat } from "../utils/share";
import { appJump, getUrlParam, windowJumpUrl } from "../utils/utils";
import { CHANNEL_PARAMS, TASK_CODE } from "../utils/constants";
const taskStore = makeAutoObservable({
/** 当前任务 */
curTask: {},
setCurTask(data) {
this.curTask = data;
},
/** 任务列表 */
taskList: [],
/** 获取任务 */
async getTaskList() {
const { success, data } = await API.getTaskInfo({
// 展示对应任务数据逻辑: 优先取分享人code 其次取url参数code 最终取绑定的业务员code(这个后端会自己取)
code: getUrlParam("ykCode") || getUrlParam("code") || "",
from: CFG.channel,
});
if ((success, data)) {
this.taskList = data?.item || [];
}
},
/** 去完成 */
async doTask(item) {
// jumpUrl 后端已经根据渠道返回对应的链接
const { code, jumpUrl } = item || {};
switch (true) {
//签到
case code == "common_sign":
console.info("签到任务");
await taskStore.complete(item);
break;
//邀请
case code == TASK_CODE.INVITE:
console.info("邀请任务");
// const res =
await shareStore.doInvite();
// modalStore.pushPop("Shareposter", { qrCode: res }, true);
break;
//增员介绍 海报or视频
case code?.indexOf("browse_zeng_yuan") > -1:
// if(code == "browser_zeng_yuan_1"){
modalStore.closePop("Taskpop");
modalStore.pushPop("LongImgPop", {
imgUrl: jumpUrl,
taskSucCb: async () => {
await this.complete(item);
},
noCount: false,
type: code == "browse_zeng_yuan_1" ? 1 : 2, //1海报 2视频
});
// }
break;
case code?.indexOf("browse_shui_yue") > -1:
await taskStore.complete(item);
break;
// 七秒浏览 or 税优关爱百万任务
default:
console.info("七秒浏览任务", CFG.spcCode, CFG.workerCode);
if (isWeChat()) {
// 微信端
await taskStore.complete(item);
setTimeout(() => {
if (CFG.channel == CHANNEL_PARAMS.YK_PUBLIC || CFG.channel == CHANNEL_PARAMS.YK_MINI) {
// 友客渠道 需要单独拼参数 参数key直接配置在链接上 value取code
// btt2_开头的任务 不需要前端拼code
// let _url =
// code.indexOf(TASK_CODE.BROWSE_AREA) >= 0 ? jumpUrl : `${jumpUrl}${CFG.spcCode || CFG.workerCode || ""}`;
// alert(CFG.spcCode || CFG.workerCode || "")
let _url = `${jumpUrl}${CFG.spcCode || CFG.workerCode || ""}`;
console.info("_url", _url);
// alert(_url)
windowJumpUrl(_url);
} else {
windowJumpUrl(jumpUrl);
}
}, 500);
} else {
// app
taskStore.setCurTask(item);
saveCookies();
const thirdBrowseParams = {
hyper_link: jumpUrl,
is_back: "true",
functionType: "1",
};
setTimeout(() => {
appJump("queryUserBindCustomerManger", "", thirdBrowseParams, "infoCallBack");
}, 300);
}
break;
}
},
/** app获取绑定信息回调 */
getInfoCallback(res) {
console.info("info", res, res?.agentCode);
const resObj = res ? JSON.parse(res) : {};
const { curTask } = taskStore;
console.info("curTask", curTask);
if (JSON.stringify(curTask) == "{}") return;
const agentCode = curTask.jumpUrl?.match(/agent_code=(\d+)/)?.[1];
const _jumpUrl = !!agentCode
? curTask.jumpUrl?.replace(agentCode, resObj?.agentCode)
: `${curTask.jumpUrl}&agent_code=${resObj?.agentCode}`;
const thirdBrowseParams = {
hyper_link: _jumpUrl,
is_back: "true",
function_type: "5",
};
console.info(`%c jumpUrl: ${_jumpUrl}`, "font-size: 20px; color: pink");
appJump("Router", "duibaMethod", thirdBrowseParams, "browseCallBack");
},
/** app7s浏览跳转回调 */
async getBrowseCallback(res) {
const { curTask } = taskStore;
console.info("curTask", curTask);
if (JSON.stringify(curTask) == "{}") return;
await setCookies();
console.info("回调数据", res);
let resObj = res ? JSON.parse(res) : {};
if (curTask?.code?.indexOf("browse_shui_yue") > -1) {
//税悦不管时间
const res = await taskStore.complete(curTask);
if (res?.success) {
await taskStore.getTaskList();
}
return;
}
if (resObj.isSuccess == 1 && Number(resObj.time) >= 7) {
const res = await taskStore.complete(curTask, resObj.time);
if (res?.success) {
await taskStore.getTaskList();
}
}
},
/** 完成任务 */
async complete(item, time) {
const { id, code } = item || {};
const { userId } = store.homeInfo || {};
// const systemTime = Date.now();
// const sign = md5(`${userId}_${code}_${systemTime}_9f733a0ccf92439d`);
let params = {
// taskId: id,
taskCode: code,
// timestamp: systemTime,
// sign: sign,
};
// if (time) {
// params.time = time;
// }
const res = await API.doCompleted(params);
if(item?.jumpUrl && item?.jumpUrl !== '/' && code.indexOf("browse_shui_yue") > -1) {
location.href = item?.jumpUrl;
}
if (code.indexOf("browse_") > -1 && isWeChat()) {
setTimeout(async () => {
await this.getTaskList();
await store.getSalesManIndex();
await store.getProductSearch()
}, 1500);
} else {
await this.getTaskList();
await store.getSalesManIndex();
await store.getProductSearch()
}
return res;
},
/** 领奖 */
async getTaskPrize(item) {
const { id, code, prizePendingCode } = item || {};
// if (isWeChat()) {
// // 出二维码提示弹窗
// modalStore.closePop("Taskpop");
// modalStore.pushPop("TaskQrcode");
// return;
// }
const { success, data } = await API.sendPrize({
taskId: id,
taskCode: code,
prizePendingCode: prizePendingCode,
});
await store.getSalesManIndex();
await store.getProductSearch();
if (success && data) {
// Toast(`保豆+${data?.options?.[0]?.sendCount || 0}`);
Toast(`点赞次数+${data?.options?.[0]?.sendCount || 0}`);
await taskStore.getTaskList();
// await store.getHomeInfo();
}
},
});
export default taskStore;
/**
* Swiper 8.4.5
* Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com
*
* Copyright 2014-2022 Vladimir Kharlampidi
*
* Released under the MIT License
*
* Released on: November 21, 2022
*/
@font-face {
font-family: 'swiper-icons';
src: url('data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA');
font-weight: 400;
font-style: normal;
}
:root {
--swiper-theme-color: #007aff;
}
.swiper {
margin-left: auto;
margin-right: auto;
position: relative;
overflow: hidden;
list-style: none;
padding: 0;
/* Fix of Webkit flickering */
z-index: 1;
}
.swiper-vertical > .swiper-wrapper {
flex-direction: column;
}
.swiper-wrapper {
position: relative;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
transition-property: transform;
box-sizing: content-box;
}
.swiper-android .swiper-slide,
.swiper-wrapper {
transform: translate3d(0px, 0, 0);
}
.swiper-pointer-events {
touch-action: pan-y;
}
.swiper-pointer-events.swiper-vertical {
touch-action: pan-x;
}
.swiper-slide {
flex-shrink: 0;
width: 100%;
height: 100%;
position: relative;
transition-property: transform;
}
.swiper-slide-invisible-blank {
visibility: hidden;
}
/* Auto Height */
.swiper-autoheight,
.swiper-autoheight .swiper-slide {
height: auto;
}
.swiper-autoheight .swiper-wrapper {
align-items: flex-start;
transition-property: transform, height;
}
.swiper-backface-hidden .swiper-slide {
transform: translateZ(0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
/* 3D Effects */
.swiper-3d,
.swiper-3d.swiper-css-mode .swiper-wrapper {
perspective: 1200px;
}
.swiper-3d .swiper-wrapper,
.swiper-3d .swiper-slide,
.swiper-3d .swiper-slide-shadow,
.swiper-3d .swiper-slide-shadow-left,
.swiper-3d .swiper-slide-shadow-right,
.swiper-3d .swiper-slide-shadow-top,
.swiper-3d .swiper-slide-shadow-bottom,
.swiper-3d .swiper-cube-shadow {
transform-style: preserve-3d;
}
.swiper-3d .swiper-slide-shadow,
.swiper-3d .swiper-slide-shadow-left,
.swiper-3d .swiper-slide-shadow-right,
.swiper-3d .swiper-slide-shadow-top,
.swiper-3d .swiper-slide-shadow-bottom {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 10;
}
.swiper-3d .swiper-slide-shadow {
background: rgba(0, 0, 0, 0.15);
}
.swiper-3d .swiper-slide-shadow-left {
background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
.swiper-3d .swiper-slide-shadow-right {
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
.swiper-3d .swiper-slide-shadow-top {
background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
.swiper-3d .swiper-slide-shadow-bottom {
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
/* CSS Mode */
.swiper-css-mode > .swiper-wrapper {
overflow: auto;
scrollbar-width: none;
/* For Firefox */
-ms-overflow-style: none;
/* For Internet Explorer and Edge */
}
.swiper-css-mode > .swiper-wrapper::-webkit-scrollbar {
display: none;
}
.swiper-css-mode > .swiper-wrapper > .swiper-slide {
scroll-snap-align: start start;
}
.swiper-horizontal.swiper-css-mode > .swiper-wrapper {
scroll-snap-type: x mandatory;
}
.swiper-vertical.swiper-css-mode > .swiper-wrapper {
scroll-snap-type: y mandatory;
}
.swiper-centered > .swiper-wrapper::before {
content: '';
flex-shrink: 0;
order: 9999;
}
.swiper-centered.swiper-horizontal > .swiper-wrapper > .swiper-slide:first-child {
margin-inline-start: var(--swiper-centered-offset-before);
}
.swiper-centered.swiper-horizontal > .swiper-wrapper::before {
height: 100%;
min-height: 1px;
width: var(--swiper-centered-offset-after);
}
.swiper-centered.swiper-vertical > .swiper-wrapper > .swiper-slide:first-child {
margin-block-start: var(--swiper-centered-offset-before);
}
.swiper-centered.swiper-vertical > .swiper-wrapper::before {
width: 100%;
min-width: 1px;
height: var(--swiper-centered-offset-after);
}
.swiper-centered > .swiper-wrapper > .swiper-slide {
scroll-snap-align: center center;
}
.swiper-virtual .swiper-slide {
-webkit-backface-visibility: hidden;
transform: translateZ(0);
}
.swiper-virtual.swiper-css-mode .swiper-wrapper::after {
content: '';
position: absolute;
left: 0;
top: 0;
pointer-events: none;
}
.swiper-virtual.swiper-css-mode.swiper-horizontal .swiper-wrapper::after {
height: 1px;
width: var(--swiper-virtual-size);
}
.swiper-virtual.swiper-css-mode.swiper-vertical .swiper-wrapper::after {
width: 1px;
height: var(--swiper-virtual-size);
}
:root {
--swiper-navigation-size: 44px;
/*
--swiper-navigation-color: var(--swiper-theme-color);
*/
}
.swiper-button-prev,
.swiper-button-next {
position: absolute;
top: 50%;
width: calc(var(--swiper-navigation-size) / 44 * 27);
height: var(--swiper-navigation-size);
margin-top: calc(0px - (var(--swiper-navigation-size) / 2));
z-index: 10;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--swiper-navigation-color, var(--swiper-theme-color));
}
.swiper-button-prev.swiper-button-disabled,
.swiper-button-next.swiper-button-disabled {
opacity: 0.35;
cursor: auto;
pointer-events: none;
}
.swiper-button-prev.swiper-button-hidden,
.swiper-button-next.swiper-button-hidden {
opacity: 0;
cursor: auto;
pointer-events: none;
}
.swiper-navigation-disabled .swiper-button-prev,
.swiper-navigation-disabled .swiper-button-next {
display: none !important;
}
.swiper-button-prev:after,
.swiper-button-next:after {
font-family: swiper-icons;
font-size: var(--swiper-navigation-size);
text-transform: none !important;
letter-spacing: 0;
font-variant: initial;
line-height: 1;
}
.swiper-button-prev,
.swiper-rtl .swiper-button-next {
left: 10px;
right: auto;
}
.swiper-button-prev:after,
.swiper-rtl .swiper-button-next:after {
content: 'prev';
}
.swiper-button-next,
.swiper-rtl .swiper-button-prev {
right: 10px;
left: auto;
}
.swiper-button-next:after,
.swiper-rtl .swiper-button-prev:after {
content: 'next';
}
.swiper-button-lock {
display: none;
}
:root {
/*
--swiper-pagination-color: var(--swiper-theme-color);
--swiper-pagination-bullet-size: 8px;
--swiper-pagination-bullet-width: 8px;
--swiper-pagination-bullet-height: 8px;
--swiper-pagination-bullet-inactive-color: #000;
--swiper-pagination-bullet-inactive-opacity: 0.2;
--swiper-pagination-bullet-opacity: 1;
--swiper-pagination-bullet-horizontal-gap: 4px;
--swiper-pagination-bullet-vertical-gap: 6px;
*/
}
.swiper-pagination {
position: absolute;
text-align: center;
transition: 300ms opacity;
transform: translate3d(0, 0, 0);
z-index: 10;
}
.swiper-pagination.swiper-pagination-hidden {
opacity: 0;
}
.swiper-pagination-disabled > .swiper-pagination,
.swiper-pagination.swiper-pagination-disabled {
display: none !important;
}
/* Common Styles */
.swiper-pagination-fraction,
.swiper-pagination-custom,
.swiper-horizontal > .swiper-pagination-bullets,
.swiper-pagination-bullets.swiper-pagination-horizontal {
bottom: 10px;
left: 0;
width: 100%;
}
/* Bullets */
.swiper-pagination-bullets-dynamic {
overflow: hidden;
font-size: 0;
}
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
transform: scale(0.33);
position: relative;
}
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active {
transform: scale(1);
}
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main {
transform: scale(1);
}
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev {
transform: scale(0.66);
}
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev {
transform: scale(0.33);
}
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next {
transform: scale(0.66);
}
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next {
transform: scale(0.33);
}
.swiper-pagination-bullet {
width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
display: inline-block;
border-radius: 50%;
background: var(--swiper-pagination-bullet-inactive-color, #000);
opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);
}
button.swiper-pagination-bullet {
border: none;
margin: 0;
padding: 0;
box-shadow: none;
-webkit-appearance: none;
appearance: none;
}
.swiper-pagination-clickable .swiper-pagination-bullet {
cursor: pointer;
}
.swiper-pagination-bullet:only-child {
display: none !important;
}
.swiper-pagination-bullet-active {
opacity: var(--swiper-pagination-bullet-opacity, 1);
background: var(--swiper-pagination-color, var(--swiper-theme-color));
}
.swiper-vertical > .swiper-pagination-bullets,
.swiper-pagination-vertical.swiper-pagination-bullets {
right: 10px;
top: 50%;
transform: translate3d(0px, -50%, 0);
}
.swiper-vertical > .swiper-pagination-bullets .swiper-pagination-bullet,
.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet {
margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0;
display: block;
}
.swiper-vertical > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic,
.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic {
top: 50%;
transform: translateY(-50%);
width: 8px;
}
.swiper-vertical > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,
.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
display: inline-block;
transition: 200ms transform, 200ms top;
}
.swiper-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet,
.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet {
margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);
}
.swiper-horizontal > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic,
.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic {
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
}
.swiper-horizontal > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,
.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
transition: 200ms transform, 200ms left;
}
.swiper-horizontal.swiper-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
transition: 200ms transform, 200ms right;
}
/* Progress */
.swiper-pagination-progressbar {
background: rgba(0, 0, 0, 0.25);
position: absolute;
}
.swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
background: var(--swiper-pagination-color, var(--swiper-theme-color));
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
transform: scale(0);
transform-origin: left top;
}
.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
transform-origin: right top;
}
.swiper-horizontal > .swiper-pagination-progressbar,
.swiper-pagination-progressbar.swiper-pagination-horizontal,
.swiper-vertical > .swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,
.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite {
width: 100%;
height: 4px;
left: 0;
top: 0;
}
.swiper-vertical > .swiper-pagination-progressbar,
.swiper-pagination-progressbar.swiper-pagination-vertical,
.swiper-horizontal > .swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,
.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite {
width: 4px;
height: 100%;
left: 0;
top: 0;
}
.swiper-pagination-lock {
display: none;
}
/* Scrollbar */
.swiper-scrollbar {
border-radius: 10px;
position: relative;
-ms-touch-action: none;
background: rgba(0, 0, 0, 0.1);
}
.swiper-scrollbar-disabled > .swiper-scrollbar,
.swiper-scrollbar.swiper-scrollbar-disabled {
display: none !important;
}
.swiper-horizontal > .swiper-scrollbar,
.swiper-scrollbar.swiper-scrollbar-horizontal {
position: absolute;
left: 1%;
bottom: 3px;
z-index: 50;
height: 5px;
width: 98%;
}
.swiper-vertical > .swiper-scrollbar,
.swiper-scrollbar.swiper-scrollbar-vertical {
position: absolute;
right: 3px;
top: 1%;
z-index: 50;
width: 5px;
height: 98%;
}
.swiper-scrollbar-drag {
height: 100%;
width: 100%;
position: relative;
background: rgba(0, 0, 0, 0.5);
border-radius: 10px;
left: 0;
top: 0;
}
.swiper-scrollbar-cursor-drag {
cursor: move;
}
.swiper-scrollbar-lock {
display: none;
}
.swiper-zoom-container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.swiper-zoom-container > img,
.swiper-zoom-container > svg,
.swiper-zoom-container > canvas {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
.swiper-slide-zoomed {
cursor: move;
}
/* Preloader */
:root {
/*
--swiper-preloader-color: var(--swiper-theme-color);
*/
}
.swiper-lazy-preloader {
width: 42px;
height: 42px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -21px;
margin-top: -21px;
z-index: 10;
transform-origin: 50%;
box-sizing: border-box;
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
border-radius: 50%;
border-top-color: transparent;
}
.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,
.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader {
animation: swiper-preloader-spin 1s infinite linear;
}
.swiper-lazy-preloader-white {
--swiper-preloader-color: #fff;
}
.swiper-lazy-preloader-black {
--swiper-preloader-color: #000;
}
@keyframes swiper-preloader-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* a11y */
.swiper .swiper-notification {
position: absolute;
left: 0;
top: 0;
pointer-events: none;
opacity: 0;
z-index: -1000;
}
.swiper-free-mode > .swiper-wrapper {
transition-timing-function: ease-out;
margin: 0 auto;
}
.swiper-grid > .swiper-wrapper {
flex-wrap: wrap;
}
.swiper-grid-column > .swiper-wrapper {
flex-wrap: wrap;
flex-direction: column;
}
.swiper-fade.swiper-free-mode .swiper-slide {
transition-timing-function: ease-out;
}
.swiper-fade .swiper-slide {
pointer-events: none;
transition-property: opacity;
}
.swiper-fade .swiper-slide .swiper-slide {
pointer-events: none;
}
.swiper-fade .swiper-slide-active,
.swiper-fade .swiper-slide-active .swiper-slide-active {
pointer-events: auto;
}
.swiper-cube {
overflow: visible;
}
.swiper-cube .swiper-slide {
pointer-events: none;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
z-index: 1;
visibility: hidden;
transform-origin: 0 0;
width: 100%;
height: 100%;
}
.swiper-cube .swiper-slide .swiper-slide {
pointer-events: none;
}
.swiper-cube.swiper-rtl .swiper-slide {
transform-origin: 100% 0;
}
.swiper-cube .swiper-slide-active,
.swiper-cube .swiper-slide-active .swiper-slide-active {
pointer-events: auto;
}
.swiper-cube .swiper-slide-active,
.swiper-cube .swiper-slide-next,
.swiper-cube .swiper-slide-prev,
.swiper-cube .swiper-slide-next + .swiper-slide {
pointer-events: auto;
visibility: visible;
}
.swiper-cube .swiper-slide-shadow-top,
.swiper-cube .swiper-slide-shadow-bottom,
.swiper-cube .swiper-slide-shadow-left,
.swiper-cube .swiper-slide-shadow-right {
z-index: 0;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.swiper-cube .swiper-cube-shadow {
position: absolute;
left: 0;
bottom: 0px;
width: 100%;
height: 100%;
opacity: 0.6;
z-index: 0;
}
.swiper-cube .swiper-cube-shadow:before {
content: '';
background: #000;
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
filter: blur(50px);
}
.swiper-flip {
overflow: visible;
}
.swiper-flip .swiper-slide {
pointer-events: none;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
z-index: 1;
}
.swiper-flip .swiper-slide .swiper-slide {
pointer-events: none;
}
.swiper-flip .swiper-slide-active,
.swiper-flip .swiper-slide-active .swiper-slide-active {
pointer-events: auto;
}
.swiper-flip .swiper-slide-shadow-top,
.swiper-flip .swiper-slide-shadow-bottom,
.swiper-flip .swiper-slide-shadow-left,
.swiper-flip .swiper-slide-shadow-right {
z-index: 0;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.swiper-creative .swiper-slide {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
overflow: hidden;
transition-property: transform, opacity, height;
}
.swiper-cards {
overflow: visible;
}
.swiper-cards .swiper-slide {
transform-origin: center bottom;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
overflow: hidden;
}
import {AES, enc, mode, pad} from "crypto-js";
const getOptions = (iv) => {
return {
iv: enc.Utf8.parse(iv),
mode: mode.CBC,
padding: pad.ZeroPadding,
};
}
/** 加密 */
export const AESEncrypt = (str, key, iv) => {
const options = getOptions(iv);
return AES.encrypt(str, enc.Utf8.parse(key), options).toString();
};
/** 解密 */
export const AESDecrypt = (cipherText, key, iv) => {
const options = getOptions(iv);
return AES.decrypt(cipherText, enc.Utf8.parse(key), options)
.toString(enc.Utf8)
.trim()
.replace(//g, '')
.replace(//g, '')
.replace(/\v/g, '')
.replace(/\x00/g, '');
};
/**
* 检查是否支持.webp 格式图片
* 支持 webp CDN ?x-oss-process=image/format,webp
* 不支持 CDN ?x-oss-process=image/quality,Q_80
*/
(function () {
let urlArr = [];
let flag = false,
lowAdr = false;
const ua = navigator.userAgent.toLowerCase()
const isAndroid = ua.indexOf('android') > -1 || ua.indexOf('adr') > -1;
if (isAndroid) {
const ver = parseFloat(ua.substr(ua.indexOf('android') + 8, 3));
lowAdr = ver < 4.4;
}
if (lowAdr && localStorage) {
delete localStorage.isWebp;
}
if (localStorage && !localStorage.isWebp) {
const img = new Image()
img.onload = function () {
if (img.width === 1 && !lowAdr) {
localStorage.isWebp = true;
document.getElementsByTagName('html')[0].setAttribute('duiba-webp', 'true')
} else {
localStorage.isWebp = '';
}
}
img.onerror = function () {
flag = true
localStorage.isWebp = ''
}
img.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA='
}
})()
/*
* @Author: super
* @Date: 2021-01-20 14:08:27
* @LastEditTime: 2021-01-20 14:53:39
* @LastEditors: super
* @Description:
*/
/**
* 弹窗优先级 可以是负数, 不写默认是10, 数值越小,层级越高
*/
import {isIOS} from "@spark/utils";
import {isMiniprogram} from "./utils";
export const MODAL_INDEX = {
// rank: 1,
};
/** 网络异常默认展示 */
export const DEFAULT_NET_ERROR = "网络异常,请稍后再试";
export const PAGE_MAP = {
HOME_PAGE: "homePage",
LOADING_PAGE: "loadingPage",
SHARE_PAGE: "sharepage",
AGENT_SHARE_PAGE: "agentSharePage",
LIKE_LOG_PAGE: "likeLogPage",
DRAW_PAGE: "drawPage",
PRIZE_PAGE: "prize",
SALE_PAGE: "SaleManPage",
USER_HOME_PAGE:"userHomePage",
OPUS_PAGE:"opusPage"
};
/** 渠道参数 */
export const CHANNEL_PARAMS = {
/** 人保寿险管家app */
RB_APP: 1,
/** 人保寿险企业家助手微信公众号 */
RB_WX_PUBLIC: 2,
/** 友客微信公众号 */
YK_PUBLIC: 3,
/** 人保寿险E服务公众号h5 */
E_MINI: 4,
/** 友客小程序 */
YK_MINI: 5,
/** e通app */
ET_APP: 6,
/** 微通(企业微信) */
WT_YK_PUBLIC: 7,
/** 友客获客公众号 */
YKHK_PUBLIC: 8,
};
/* 电话号码验证规则 **/
export const REG_TEL = /^1[0-9]{10}$/;
/**
* 任务code
* 3. 保豆签到任务,code为:sign;
* 4. 展示渠道不做过滤展示,可直接在展示渠道完成的浏览任务,如:浏览美满赢家、浏览康宁嘉倍、浏览运动意外伤害保险 等,code以:btt1_ 开头,示例:btt1_1、btt1_2、btt1_zx1
* 5. 友客端需要做特殊展示限制的浏览任务,如:浏览关爱百万医疗、浏览关爱百万2019医疗保险组合、乐业福 等,code以:btt2_ 开头,示例:btt2_1、btt2_2、btt2_3;产品组合编码配置在任务描述里面,示例:1111、2222;
* 6. app端展示,但不可完成的浏览任务,如:浏览企业人人保、浏览畅行保产品计划A赠险、浏览畅行保产品计划B赠险 等,code以:btt3_ 开头,示例:btt3_1、btt3_zx2、btt3_zx3;
* 7. 赠险浏览任务,不需要浏览7s,code包含zx;
*/
export const TASK_CODE = {
/** 签到任务 */
THIRD_SIGN: "sign",
/** 答题任务 */
ANSRWER: "common_answer",
/** 分享任务 */
SHARE: "share",
/** 留资任务 */
FILL: "common_fill",
/** 邀请任务 */
INVITE: "common_invite",
/** 正常展示的浏览任务:app内有秒限制,根据端内跳转回调算完成;友客端需要链接后拼code值 */
BROWSE_COMMON: "browse_",
/** 友客端需要做销售限制特殊展示的浏览任务:app内有秒限制,根据端内跳转回调算完成;友客端不需要链接后拼code值 */
BROWSE_AREA: "btt2_",
/** 展示特殊处理浏览任务:app端不展示去完成按钮 */
BROWSE_SPECIAL_SHOW: "btt3_",
/** 浏览赠险任务(会在bttx_后面追加_zx进行区分):app内无秒限制,点击即完成;友客端需要链接后拼code值 */
BROWSE_INSURE: "_zx",
};
/* 表情包 正则 **/
export const emojiReg = /(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]/g;
/* 特殊字符 正则 **/
export const specialStrReg =
/[`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、「」]/g;
export const platFormName = {
/** 人保寿险管家app */
1: "人保寿险管家app",
/** 人保寿险企业家助手微信公众号 */
2: "人保寿险E服务",
/** 友客微信公众号 */
3: "友客微信公众号",
/** 人保寿险E服务公众号h5 */
4: "e服务公众号",
/** 友客小程序 */
5: "人保友客",
/** e通app */
6: "人保e通-寿险板块",
/** 微通(企业微信) */
7: "微通(企业微信)",
/** 友客获客公众号 */
8: isMiniprogram() ? "人保友客" : "友客微信公众号",
};
export const platformType = {
/** 人保寿险管家app */
1: isIOS ? "iOS" : "Android",
/** 人保寿险企业家助手微信公众号 */
2: "微信公众号",
/** 友客微信公众号 */
3: "微信公众号",
/** 人保寿险E服务公众号h5 */
4: "微信公众号",
/** 友客小程序 */
5: "微信小程序",
/** e通app */
6: isIOS ? "iOS" : "Android",
/** 微通(企业微信) */
7: "微信公众号",
/** 友客获客公众号 */
8: isMiniprogram() ? "微信小程序" : "微信公众号",
};
export const extranceName = {
1: "人保寿险管家app",
2: "人保寿险企业家助手微信公众号",
3: "友客微信公众号",
4: "e服务公众号",
5: "人保友客",
6: "人保e通-寿险板块",
7: "微通(企业微信)",
8: "人保友客",
};
/** @Author: all
* @Date: 2022-04-12 11:26:44
**/
import { Toast } from "@spark/ui";
import { DEFAULT_NET_ERROR } from "./constants";
// 需要过滤的错误码
export const filterCode = ["600002"];
export const errMessageMap = {
200302: "非新用户,助力失败",
200306: "无法为自己助力",
20002: "活动已结束",
200002: "活动已结束",
200304: "好友今日助力次数已达上限",
3008:"减少输入内容哦~",
};
/**
* 统一错误处理
* @param e
*/
export function errorHandler(e) {
if ((e.code == 0 && e.message == "请稍后再试") || filterCode.indexOf(`${e.code}`) >= 0) return;
switch (e.code) {
default: {
const msg = errMessageMap[e.code] || e.message || DEFAULT_NET_ERROR;
Toast(msg, 2000, { hideOthers: true });
break;
}
}
}
import { loadSvga } from '@spark/svgaplayer'
// import * as FYGE from 'fyge';
// import { Howl } from 'howler';
import { RES_PATH } from '../../sparkrc'
/**
* 预加载资源(/png|jpg|jpeg|svga|spi|json|mp3|wav/)
* @param {string[]} urlList 资源地址列表
* @param {number} batchNum 每批并行加载的资源个数(一般来说该数字越大整体加载速度越快,但加载前期会更卡顿)
* @param {Function} [onProgress] 加载进度回调,每加载完一个资源回调一次,入参为进度值(0,1]
* @returns {Promise} 返回一个只会resolve(loadedData)的promise,loadedData保存了所有预加载好的资源,可通过相对路径索引
* @example
* //例
* const loadedData = await PreloadAsset(urlList, 10, onProgress);
* const image = loadedData['image/fish.png'];
* const svgaData = loadedData['svga/fish.svga'];
* const spiData = loadedData['spine/fish.spi'];
* const lottieData = loadedData['lottie/fish.json'];
*/
export function preloadAsset(urlList, batchNum, onProgress) {
return new Promise((resolve) => {
/** 要加载资源总数 */
const totalNum = urlList.length;
/** 要加载的资源索引 */
let assetIndex = -1;
/** 已加载完毕的资源个数 */
let loadedNum = 0;
/** 存放加载好的数据,用地址索引 */
const loadedData = {};
/** 加载逻辑 */
const doLoad = async () => {
if (loadedNum >= totalNum) {
totalNum == 0 && onProgress && onProgress(1); // 无加载资源时,即为假loading
resolve(loadedData); // 加载完毕
} else {
assetIndex++;
if (assetIndex >= totalNum) return
const key = urlList[assetIndex];
const url = RES_PATH + urlList[assetIndex];
const result = await loadOneAsset(url);
if (!result) {
console.warn('加载异常', url);
}
loadedData[key] = result;
loadedNum++;
onProgress && onProgress(loadedNum / totalNum);
doLoad();
}
}
batchNum = batchNum || 1;
for (let index = 0; index < batchNum; index++) {
doLoad();
}
})
}
/**
* 加载一个资源
* @param {string} url 地址
*/
async function loadOneAsset(url) {
const fileType = url.split('.').pop();
switch (true) {
case (/png|jpg|jpeg/).test(fileType):
return await loadOneImg(url);
case (/svga/).test(fileType):
return await loadOneSvga(url);
// case (/spi/).test(fileType):
// return await loadOneSpi(url);
// case (/json/).test(fileType):
// return await loadOneJson(url);
// case (/mp3|wav/).test(fileType):
// return await loadOneAudio(url);
default:
console.warn('非法资源', url);
return false;
}
}
/**
* 加载一张图片
* @param {string} url 地址
*/
function loadOneImg(url) {
const isWebp = localStorage.isWebp;
return new Promise(resolve => {
const img = new Image();
img.onload = () => resolve(img);
img.onerror = err => {
console.warn('load', url, err);
resolve(false)
};
img.crossOrigin = 'Anonymous'
img.src = url + (isWebp ? '?x-oss-process=image/format,webp' : '');
})
}
/**
* 加载一个svga
* @param {string} url 地址
*/
function loadOneSvga(url) {
return new Promise(resolve => {
loadSvga(url).then((data) => resolve(data[0])).catch(err => {
console.warn('load', url, err);
resolve(false)
});
})
}
// /**
// * 加载一个spine
// * @param {string} url 地址
// */
// function loadOneSpi(url) {
// return new Promise(resolve => {
// FYGE.loadSpine(url, spineData => {
// resolve(spineData);
// }, err => {
// console.warn('load', url, err);
// resolve(false);
// })
// })
// }
// /**
// * 加载一个Json
// * @param {string} url 地址
// */
// function loadOneJson(url) {
// return new Promise(resolve => {
// FYGE.GlobalLoader.loadJson((result, res) => {
// if (result) {
// resolve(res);
// } else {
// console.warn('load fail', url);
// resolve(false);
// }
// }, url)
// })
// }
// /**
// * 加载一个音频
// * @param {string} url 地址
// */
// function loadOneAudio(url) {
// return new Promise(resolve => {
// const sound = new Howl({
// src: url,
// onload: () => resolve(sound),
// onloaderror: err => {
// console.warn('load fail', url, err);
// resolve(false);
// },
// });
// })
// }
import { objectAssign } from "@spark/utils";
import sensors from "sa-sdk-javascript/dist/web/sensorsdata.es6";
import SMEncryption from "sa-sdk-javascript/dist/web/plugin/sm-encryption/index.es6";
import { extranceName, platFormName, platformType } from "./constants";
import { GetCurrSkinId } from "./utils";
import store from "../store";
const ENV = {
test: "test",
prod: "prod",
};
// todo 正式修改
const env = location.href.indexOf("duibatest") > -1 ? ENV.test : ENV.prod; // 测试
// const env = ENV.test; // 测试
/** 上报地址 */
const serverUrl = {
[ENV.test]: "https://mdglfxpt-test.piccgroup.cn:18443/sa?project=picclife_consumer",
[ENV.prod]: "https://mdglfxpt.piccgroup.cn:18443/sa?project=picclife_consumer",
};
/** 神策加密key */
const pub_key = {
[ENV.test]:
"04115969d70075438379dd348f650b4dcb27d0b12b92d9378b2b5d989b48dd9266d4654f08161cdb272b4c9069d64f77bb96fca6efcb1d1635bd7dcc36d058e07c",
[ENV.prod]:
"041717d6728d0f4efd409aeed420f64d3ef684d7e9d21b7b50cd427ce49c47c153916159009cd2f52039718a0e2ce3322cd954a0356c219effef262a5f1eddf8b3",
};
/** 人保加密 */
sensors.use(SMEncryption, {
pkv: 2,
pub_key: pub_key[env],
});
/** 渠道映射 */
export const CHANNEL_MAP = {
1: "人保寿险管家app",
2: "人保寿险企业家助手微信公众号",
3: "友客微信公众号-精选专题",
4: "e服务公众号",
5: "友客小程序",
6: "e通app",
7: "微通",
8: "友客-获客活动",
};
/** 埋点key */
export const LOG_KEY = {
click: "click",
exposure: "exposure",
pageview: "pageview",
result: "result",
MatterView: "MatterView",
MatterShare: "MatterShare",
pageViewTime: "pageViewTime",
};
/** 埋点Event */
export const EVENT_NAME = {
[LOG_KEY.click]: "actPageClick",
[LOG_KEY.exposure]: "actPageExposure",
[LOG_KEY.pageview]: "actPageView",
[LOG_KEY.result]: "ActPageResult",
[LOG_KEY.MatterView]: "MatterView",
[LOG_KEY.MatterShare]: "MatterShare",
[LOG_KEY.pageViewTime]: "MatterViewDuration"
};
let isInit = false;
/** 埋点事件 */
export const MD_EVENT = {
PAGE_VIEW: "actPageExposure",
PAGE_CLICK: "actPageClick",
};
export const initSensors = (uid) => {
sensors.init({
server_url: serverUrl[env],
app_js_bridge: true,
is_track_single_page: true,
use_client_time: true,
show_log: true,
send_type: "beacon",
heatmap: {
clickmap: "default",
scroll_notice_map: "not_collect",
},
});
sensors.login(uid);
const publicObjec = objectAssign(
{
currentUrl: location.href,
referrer: document.referrer,
theme_name: "闪亮瞬间",
act_name: "闪亮瞬间",
avtivity_name: "闪亮瞬间",
source_entry: CHANNEL_MAP[CFG.channel],
source: CHANNEL_MAP[CFG.channel],
platform_name: extranceName[CFG.channel],
platform_type: platformType[CFG.channel],
requirement_id: 1029,
is_login: uid ? "是" : "否",
operation_name: "闪亮瞬间",
source_platform: CHANNEL_MAP?.[CFG.channel] || CFG.channel,
entrance: extranceName[CFG.channel],
},
window["__tbSensorsObj__"]
);
sensors.registerPage(publicObjec);
sensors.quick("autoTrack");
isInit = true;
};
/**
* 真正的埋点 - 不区分曝光和点击,直接打
* @param {string} eventName
* @param {{page_name:string,button_name:string,operation_name:string}} options
*/
export const sensorLog = (logKey, bid, did, options) => {
if (!isInit) {
console.info(`%c 神策上报地址: ${serverUrl[env]} 当前环境: ${env}`, "font-size: 12px; color: green");
const uid = store.setIndex?.uid;
initSensors(uid);
}
// console.log(`%c type: ${logKey} track_sign: ${`aL06Activity.${bid}.${did}.${logKey}.${EVENT_NAME[logKey]}`}`, "font-size: 20px; color: rgb(244, 123, 93)");
sensors.track(EVENT_NAME[logKey], {
track_sign: `aL06Activity.${bid}.${did}.${logKey}.${EVENT_NAME[logKey]}`,
avtivity_name: "闪亮瞬间",
operation_id: CFG.operationId,
act_type: "客经",
location_type: "活动",
agent_code: store.setIndex?.agentCode,
act_id: CFG.actId,
...options
});
};
export const pageViewD = (bid, did, options) => {
if (!isInit) {
console.info(`%c 神策上报地址: ${serverUrl[env]} 当前环境: ${env}`, "font-size: 12px; color: green");
const uid = store.setIndex?.uid;
initSensors(uid);
}
// console.log(`%c type: ${logKey} track_sign: ${`aL06Activity.${bid}.${did}.${logKey}.${EVENT_NAME[logKey]}`}`, "font-size: 20px; color: rgb(244, 123, 93)");
sensors.track(EVENT_NAME[LOG_KEY.pageview], {
track_sign: `aL06Activity.${bid}.${did}.${LOG_KEY.pageview}.${EVENT_NAME[LOG_KEY.pageview]}`,
operation_id: CFG.operationId,
avtivity_name: "闪亮瞬间",
act_type: "客经",
location_type: "活动",
agent_code: store.setIndex?.agentCode,
act_id: CFG.actId,
...options
});
};
/**
* 真正的埋点 - 不区分曝光和点击,直接打
* @param {string} eventName
* @param {{page_name:string,button_name:string,pop_name:string}} options
*/
export const pageView = (bid, options) => {
if (!isInit) {
console.info(`%c 神策上报地址: ${serverUrl[env]} 当前环境: ${env}`, "font-size: 12px; color: green");
const uid = store.setIndex?.uid;
initSensors(uid);
}
// console.log(`%c type: ${logKey} track_sign: ${`aL06Activity.${bid}.${did}.${logKey}.${EVENT_NAME[logKey]}`}`, "font-size: 20px; color: rgb(244, 123, 93)");
sensors.track(EVENT_NAME[LOG_KEY.pageview], {
track_sign: `aL06Activity.${bid}.${LOG_KEY.pageview}.${EVENT_NAME[LOG_KEY.pageview]}`,
operation_id: CFG.operationId,
avtivity_name: "闪亮瞬间",
act_type: "客经",
location_type: "活动",
agent_code: store.setIndex?.agentCode,
act_id: CFG.actId,
...options
});
};
export const MatterViewOpt = (bid, options) => {
if (!isInit) {
console.info(`%c 神策上报地址: ${serverUrl[env]} 当前环境: ${env}`, "font-size: 12px; color: green");
const uid = store.setIndex?.uid;
initSensors(uid);
}
sensors.track(EVENT_NAME[LOG_KEY.MatterView], {
track_sign: `aL06Activity.${bid}.${LOG_KEY.pageview}.${EVENT_NAME[LOG_KEY.MatterView]}`,
operation_id: CFG.operationId,
agent_code: CFG.workerCode || store.setIndex?.agentCode,
act_id: CFG.actId,
act_type: "客经",
location_type: "活动",
entrance: extranceName[CFG.channel],
sales_id: CFG.workerCode || store.setIndex?.agentCode, // todo
avtivity_name: "闪亮瞬间",
...options
});
};
export const MatterShareOpt = (bid, did, options) => {
if (!isInit) {
console.info(`%c 神策上报地址: ${serverUrl[env]} 当前环境: ${env}`, "font-size: 12px; color: green");
const uid = store.setIndex?.uid;
initSensors(uid);
}
sensors.track(EVENT_NAME[LOG_KEY.MatterShare], {
track_sign: `aL06Activity.${bid}.${did}.click.${EVENT_NAME[LOG_KEY.MatterShare]}`,
operation_id: CFG.operationId,
agent_code: store.setIndex?.agentCode,
act_id: CFG.actId,
act_type: "客经",
location_type: "活动",
entrance: extranceName[CFG.channel],
sales_id: CFG.workerCode || store.setIndex?.agentCode, // todo
avtivity_name: "闪亮瞬间",
...options
});
};
export const MatterViewDuration = (bid, time, options) => {
if (!isInit) {
console.info(`%c 神策上报地址: ${serverUrl[env]} 当前环境: ${env}`, "font-size: 12px; color: green");
const uid = store.setIndex?.uid;
initSensors(uid);
}
sensors.track(EVENT_NAME[LOG_KEY.pageViewTime], {
track_sign: `aL06Activity.${bid}.${LOG_KEY.pageViewTime}.${EVENT_NAME[LOG_KEY.pageViewTime]}`,
operation_id: CFG.operationId,
agent_code: CFG.workerCode || store.setIndex?.agentCode,
act_id: CFG.actId,
act_type: "客经",
location_type: "活动",
entrance: extranceName[CFG.channel],
sales_id: CFG.workerCode || store.setIndex?.agentCode, // todo
avtivity_name: "闪亮瞬间",
$event_duration: time,
...options
});
};
\ No newline at end of file
import {
start,
updateShare,
callShare,
Weixin,
} from "@spark/share"
/**
* @description: 小程序跳转
* @param {*}
* @return {*}
*/
export const miniGoUrl = (url) => {
wx.miniProgram.navigateTo({ url: url });
}
/**
* 判断是否为ios系统
*/
export function isIos() {
return navigator.userAgent.match(/iphone|ipod|ipad/gi)
}
/** 判断微信环境 */
export function isWeChat() {
const ua = window.navigator.userAgent.toLowerCase()
return ua.match(/MicroMessenger/i) == 'micromessenger'
}
/**
* 初始化分享
*/
export async function onInitShare(cb) {
await start([Weixin], function (success) {
console.log("share result:----", success)
cb && cb()
})
}
/**
* 更新分享
* @param {*} shareParams
* @param {*} justUpdate
*/
export function onUpdateShare(shareParams) {
console.info("更新分享", shareParams)
updateShare(shareParams)
}
/**
* 被动分享 - 北京银行
* @param {*} shareParams
*/
export function onCallShare(shareParams) {
console.info("分享链接", shareParams)
callShare(shareParams);
}
/**
* @description: 分享处理中心
* @param {Object} 分享信息
*/
export const requireShare = (opts) => {
const shareData = {
title: opts.shareTitle,
content: opts.shareContent,
url: opts.shareUrl,
images: [{ image: opts.shareThumbnail, type: "url" }],
};
console.log('分享数据', opts);
const shareStr = JSON.stringify(shareData);
return shareStr;
};
/**
* @description: 小程序分享
* @param {*}
* @return {*}
*/
export const miniDoShare = (opts) => {
console.log(opts);
wx.miniProgram.postMessage({
data: {
title: opts.title, // 标题
desc: opts.desc, // 描述
imgUrl: opts.imgUrl, // 图片
link: opts.link // 链接
}
});
}
/*
* @Author: all
* @Date: 2021-11-01 09:30:00
* @LastEditTime: 2021-11-02 18:30:00
* @LastEditors: all
* @Description:
*/
import { useRef, useEffect, useCallback } from "react";
export function getQueryString(params){
const paramArr = [];
for (const key in params) {
paramArr.push(key + "=" + params[key]);
}
return paramArr.join("&");
}
export {
_throttle, // 节流
useThrottle, // 节流,函数组件
_debounce, // 防抖
getCookie, // 获取cookie的值
getUrlParam, // 获取url参数
delUrlParam, // 删除url中的参数
subStringCE, // 截取字符串 中2英1
check2Object, // 判断两个对象相等
getThousandToK, // 转换k
dateFormatter, // 日期格式化
dealTime, // 时间格式化
second2Date, // 秒转时间对象
waitTime, // 等待一段时间再执行
randomNum, // 获取区间随机数 [min,max)
shuffleArr, // 随机打乱数组
flatten, // 数据扁平化
onCtrScroll, // 控制滚动--兼容ios
trimSpace, // 去除字符串空格
GetCurrSkinId, // 获取当前链接皮肤id
windowJumpUrl // window的跳转链接
}
/**
* @description: 函数节流,普通防连点
* @param {(Function, number?)}
* @return {Function}
*/
const _throttle = (fun, delay = 2000) => {
let last, deferTimer;
return function () {
const now = +new Date();
if (last && now < last + delay) {
// clearTimeout(deferTimer);
// deferTimer = setTimeout(() => {
// last = now;
// }, delay);
} else {
last = now;
fun.apply(this, arguments);
}
};
};
/**
* @description: 支持异步函数的节流,防止接口时间太长击穿防连点
* @return {Function}
* @param fun
* @param delay
*/
export const _asyncThrottle = (fun, delay = 2000) => {
let last, deferTimer;
let canClick = true;
return function () {
const now = Date.now();
if (!canClick) return;
if (last && now < last + delay) {
// clearTimeout(deferTimer);
// deferTimer = setTimeout(() => {
// last = now;
// }, delay);
} else {
last = now;
const ps = fun.apply(this, arguments);
if (ps instanceof Promise) {
canClick = false;
ps.finally(() => {
canClick = true;
});
}
}
};
};
function useThrottle(fn, delay = 2000, dep = []) {
const { current } = useRef({ fn, timer: null });
useEffect(function () {
current.fn = fn;
}, [fn]);
return useCallback(function f(...args) {
if (!current.timer) {
current.timer = setTimeout(() => {
delete current.timer;
}, delay);
current.fn.call(this, ...args);
}
}, dep);
}
/**
* @description: 函数防抖
* @param {(Function, number?, boolean? )}
* @return {Function}
*/
const _debounce = (fn, wait = 2000, immediate = false) => {
let timer = null
return function () {
const later = function () {
fn.apply(this, arguments)
}
if (immediate && !timer) {
later()
}
if (timer) clearTimeout(timer)
timer = setTimeout(later, wait)
}
}
/**
* 获取cookie的值
* @param {*} cookieName
*/
function getCookie(cookieName) {
const strCookie = document.cookie;
const arrCookie = strCookie.split('; ');
for (let i = 0; i < arrCookie.length; i++) {
const arr = arrCookie[i].split('=');
if (cookieName == arr[0]) {
return arr[1];
}
}
return '';
}
/**
* 获取url参数
* @param {string} name
*/
function getUrlParam(name) {
const search = window.location.search;
const matched = search
.slice(1)
.match(new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'));
return search.length ? matched && matched[2] : null;
}
/**
* 删除url中的参数
* @param {*} url
* @param {*} arg
*/
function delUrlParam(url, paramKey) {
const _url = new URL(url)
const search = new URLSearchParams(_url.search)
search.delete(paramKey)
_url.search = search.toString();
return _url.href;
}
/**
* 日期格式化
* @param date 接收可以被new Date()方法转换的内容
* @param format 字符串,需要的格式例如:'yyyy/MM/dd hh:mm:ss'
* @returns {String}
*/
const dateFormatter = (date, format = "yyyy/MM/dd") => {
if (!date) return "-";
date = new Date(
typeof date === "string" && isNaN(date)
? date.replace(/-/g, "/")
: Number(date)
);
const o = {
"M+": date.getMonth() + 1,
"d+": date.getDate(),
"h+": date.getHours(),
"m+": date.getMinutes(),
"s+": date.getSeconds(),
"q+": Math.floor((date.getMonth() + 3) / 3),
S: date.getMilliseconds(),
};
if (/(y+)/.test(format)) {
format = format.replace(
RegExp.$1,
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
);
}
for (const k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(
RegExp.$1,
RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
);
}
}
return format;
};
/** 时间格式化 */
const dealTime = (msTime) => {
const time = msTime / 1000;
let hour = Math.floor(time / 60 / 60) % 24;
let minute = Math.floor(time / 60) % 60;
let second = Math.floor(time) % 60;
hour = hour > 9 ? hour : "0" + hour;
minute = minute > 9 ? minute : "0" + minute;
second = second > 9 ? second : "0" + second;
return `${hour}:${minute}:${second}`;
}
/**
* 转换k
* @param {*} num
*/
function getThousandToK(num) {
let s_x;
if (num >= 1000) {
let result = num / 1000;
result = Math.floor(result * 10) / 10;
s_x = result.toString();
let pos_decimal = s_x.indexOf(".");
if (pos_decimal < 0) {
pos_decimal = s_x.length;
s_x += ".";
}
while (s_x.length <= pos_decimal + 1) {
s_x += "0";
}
s_x += "k";
} else {
s_x = num;
}
return s_x;
}
/**
* 截取字符串 中2英1
* @param {*} str
* @param {*} sub_length
*/
function subStringCE(str, sub_length) {
const temp1 = str.replace(/[^\x20-\xff]/g, "**");
const temp2 = temp1.substring(0, sub_length);
const x_length = temp2.split("*").length - 1;
const hanzi_num = x_length / 2;
sub_length = sub_length - hanzi_num;
const res = str.substring(0, sub_length);
let endStr;
if (sub_length < str.length) {
endStr = res + "...";
} else {
endStr = res;
}
return endStr;
}
/**
* 随机打乱数组
* @param {*} arr
* @returns
*/
function shuffleArr(arr) {
for (let i = arr.length - 1; i >= 0; i--) {
const randomIndex = Math.floor(Math.random() * (i + 1))
const itemAtIndex = arr[randomIndex]
arr[randomIndex] = arr[i]
arr[i] = itemAtIndex
}
return arr
}
/**
* 获取区间随机数 [min,max)
* @export
* @param {*} min
* @param {*} max
* @return {*}
*/
function randomNum(min, max) {
return Math.floor(Math.random() * (max - min)) + min
}
/**
* 数据扁平化
* @export
* @param {*} arr
* @return {*}
*/
function flatten(arr) {
return arr.reduce((result, item) => {
return result.concat(Array.isArray(item) ? flatten(item) : item)
}, [])
}
/** 判断两个对象相等 */
const check2Object = (obj1, obj2) => {
const o1 = obj1 instanceof Object
const o2 = obj2 instanceof Object
if (!o1 || !o2) { /* 判断不是对象 */
return obj1 === obj2
}
if (Object.keys(obj1).length !== Object.keys(obj2).length) {
return false
}
for (const attr in obj1) {
const t1 = obj1[attr] instanceof Object
const t2 = obj2[attr] instanceof Object
if (t1 && t2) {
return check2Object(obj1[attr], obj2[attr])
} else if (obj1[attr] !== obj2[attr]) {
return false
}
}
return true
}
/**
* 秒转时间对象
* @param {Number} totalSecond 总秒数
* @return {{
* day: String,
* hour: String,
* minute: String,
* second: String
* }}
*/
const second2Date = (totalSecond) => {
const millisecond = totalSecond % 1000
totalSecond = totalSecond / 1000
// 获得总分钟数
const totalMinute = totalSecond / 60
// 获得剩余秒数
const second = totalSecond % 60
// 获得小时数
const totalHour = totalMinute / 60
// 获得分钟数
const minute = totalMinute % 60
// 获得天数
const day = totalHour / 24
// 获得剩余小时数
const hour = totalHour % 24
// 格式化的键值
const includesKey = ['month', 'day', 'hour', 'minute', 'second', 'totalHour', 'totalMinute']
// 日期对象
const dateObj = { day, hour, minute, second, millisecond, totalHour, totalMinute }
return Object.keys(dateObj).reduce((preVal, key) => {
// 值取整
const value = parseInt(dateObj[key])
if (includesKey.includes(key) && value < 10) {
if (value < 0) {
preVal[key] = '00'
} else {
preVal[key] = '0' + value
}
} else {
if (value.toString() === 'NaN') {
preVal[key] = '0'
} else {
preVal[key] = value.toString()
}
}
return preVal
}, {})
}
/**
* 等待一段时间再执行
* @param {number} time 等待的时间ms
*/
function waitTime(time) {
return new Promise(resolve => setTimeout(resolve, time))
}
/** 控制滚动--兼容ios */
const bodyScroll = (event) => {
event.preventDefault();
}
const onCtrScroll = (flag = true) => {
if (flag) { // 禁止滚动
document.body.addEventListener('touchmove', bodyScroll, { passive: false });
} else { // 开启滚动
document.body.removeEventListener('touchmove', bodyScroll, { passive: false });
}
}
/**
* 删除中间所有的空格
* @param {string} str
* @returns
*/
const trimSpace = (str) => {
let result;
result = str.replace(/(^\s+)|(\s+$)/g, "");
result = result.replace(/\s/g, "");
return result;
}
/**
* 获取当前皮肤id
* @returns
*/
const GetCurrSkinId = () => {
// eslint-disable-next-line no-useless-escape
const matched = location.pathname.match(/\/([^\/]*).html/);
const currSkinId = matched ? matched && matched[1] : ''
console.log('当前皮肤id', currSkinId)
return currSkinId
}
export const getCustomShareId = () => {
const matched = location.href.match(/\/share\?id=(.*)/);
const shareId = matched ? matched && matched[1] : '';
console.log('自定义活动页id', shareId);
return shareId;
};
/** 跳转 */
const windowJumpUrl = (url) => {
url && (location.href = url);
};
/** 判断小程序 */
export const isMiniprogram = () => {
const ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("miniprogram") > -1) return true
return false
}
/** 端内跳转 */
export const appJump = (module, method, params, callback) => {
window.PICCLifeJsBrage.callNative({
module: module,
method: method,
params: JSON.stringify(params),
callback: callback,
});
}
Active code page: 65001
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