11b31c5e by simon

1.表单功能

2.打点统计
1 parent 1c64b1c0
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// module.exports = {
// root: true,
// parserOptions: {
// parser: 'babel-eslint',
// sourceType: 'module'
// },
// env: {
// browser: true,
// node: true,
// es6: true,
// },
// extends: ['plugin:vue/recommended', 'eslint:recommended'],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"vue/max-attributes-per-line": [2, {
"singleline": 10,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}],
"vue/name-property-casing": ["error", "PascalCase"],
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': [2, 'allow-null'],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 2,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, {
'vars': 'all',
'args': 'none'
}],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
}
}
// // add your custom rules here
// //it is base on https://github.com/vuejs/eslint-config-vue
// rules: {
// "vue/max-attributes-per-line": [2, {
// "singleline": 10,
// "multiline": {
// "max": 1,
// "allowFirstLine": false
// }
// }],
// "vue/name-property-casing": ["error", "PascalCase"],
// 'accessor-pairs': 2,
// 'arrow-spacing': [2, {
// 'before': true,
// 'after': true
// }],
// 'block-spacing': [2, 'always'],
// 'brace-style': [2, '1tbs', {
// 'allowSingleLine': true
// }],
// 'camelcase': [0, {
// 'properties': 'always'
// }],
// 'comma-dangle': [2, 'never'],
// 'comma-spacing': [2, {
// 'before': false,
// 'after': true
// }],
// 'comma-style': [2, 'last'],
// 'constructor-super': 2,
// 'curly': [2, 'multi-line'],
// 'dot-location': [2, 'property'],
// 'eol-last': 2,
// 'eqeqeq': [2, 'allow-null'],
// 'generator-star-spacing': [2, {
// 'before': true,
// 'after': true
// }],
// 'handle-callback-err': [2, '^(err|error)$'],
// 'indent': [2, 2, {
// 'SwitchCase': 1
// }],
// 'jsx-quotes': [2, 'prefer-single'],
// 'key-spacing': [2, {
// 'beforeColon': false,
// 'afterColon': true
// }],
// 'keyword-spacing': [2, {
// 'before': true,
// 'after': true
// }],
// 'new-cap': [2, {
// 'newIsCap': true,
// 'capIsNew': false
// }],
// 'new-parens': 2,
// 'no-array-constructor': 2,
// 'no-caller': 2,
// 'no-console': 'off',
// 'no-class-assign': 2,
// 'no-cond-assign': 2,
// 'no-const-assign': 2,
// 'no-control-regex': 2,
// 'no-delete-var': 2,
// 'no-dupe-args': 2,
// 'no-dupe-class-members': 2,
// 'no-dupe-keys': 2,
// 'no-duplicate-case': 2,
// 'no-empty-character-class': 2,
// 'no-empty-pattern': 2,
// 'no-eval': 2,
// 'no-ex-assign': 2,
// 'no-extend-native': 2,
// 'no-extra-bind': 2,
// 'no-extra-boolean-cast': 2,
// 'no-extra-parens': [2, 'functions'],
// 'no-fallthrough': 2,
// 'no-floating-decimal': 2,
// 'no-func-assign': 2,
// 'no-implied-eval': 2,
// 'no-inner-declarations': [2, 'functions'],
// 'no-invalid-regexp': 2,
// 'no-irregular-whitespace': 2,
// 'no-iterator': 2,
// 'no-label-var': 2,
// 'no-labels': [2, {
// 'allowLoop': false,
// 'allowSwitch': false
// }],
// 'no-lone-blocks': 2,
// 'no-mixed-spaces-and-tabs': 2,
// 'no-multi-spaces': 2,
// 'no-multi-str': 2,
// 'no-multiple-empty-lines': [2, {
// 'max': 1
// }],
// 'no-native-reassign': 2,
// 'no-negated-in-lhs': 2,
// 'no-new-object': 2,
// 'no-new-require': 2,
// 'no-new-symbol': 2,
// 'no-new-wrappers': 2,
// 'no-obj-calls': 2,
// 'no-octal': 2,
// 'no-octal-escape': 2,
// 'no-path-concat': 2,
// 'no-proto': 2,
// 'no-redeclare': 2,
// 'no-regex-spaces': 2,
// 'no-return-assign': [2, 'except-parens'],
// 'no-self-assign': 2,
// 'no-self-compare': 2,
// 'no-sequences': 2,
// 'no-shadow-restricted-names': 2,
// 'no-spaced-func': 2,
// 'no-sparse-arrays': 2,
// 'no-this-before-super': 2,
// 'no-throw-literal': 2,
// 'no-trailing-spaces': 2,
// 'no-undef': 2,
// 'no-undef-init': 2,
// 'no-unexpected-multiline': 2,
// 'no-unmodified-loop-condition': 2,
// 'no-unneeded-ternary': [2, {
// 'defaultAssignment': false
// }],
// 'no-unreachable': 2,
// 'no-unsafe-finally': 2,
// 'no-unused-vars': [2, {
// 'vars': 'all',
// 'args': 'none'
// }],
// 'no-useless-call': 2,
// 'no-useless-computed-key': 2,
// 'no-useless-constructor': 2,
// 'no-useless-escape': 0,
// 'no-whitespace-before-property': 2,
// 'no-with': 2,
// 'one-var': [2, {
// 'initialized': 'never'
// }],
// 'operator-linebreak': [2, 'after', {
// 'overrides': {
// '?': 'before',
// ':': 'before'
// }
// }],
// 'padded-blocks': [2, 'never'],
// 'quotes': [2, 'single', {
// 'avoidEscape': true,
// 'allowTemplateLiterals': true
// }],
// 'semi': [2, 'never'],
// 'semi-spacing': [2, {
// 'before': false,
// 'after': true
// }],
// 'space-before-blocks': [2, 'always'],
// 'space-before-function-paren': [2, 'never'],
// 'space-in-parens': [2, 'never'],
// 'space-infix-ops': 2,
// 'space-unary-ops': [2, {
// 'words': true,
// 'nonwords': false
// }],
// 'spaced-comment': [2, 'always', {
// 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
// }],
// 'template-curly-spacing': [2, 'never'],
// 'use-isnan': 2,
// 'valid-typeof': 2,
// 'wrap-iife': [2, 'any'],
// 'yield-star-spacing': [2, 'both'],
// 'yoda': [2, 'never'],
// 'prefer-const': 2,
// 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// 'object-curly-spacing': [2, 'always', {
// objectsInObjects: false
// }],
// 'array-bracket-spacing': [2, 'never']
// }
// }
......
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>天宝公众号</title>
</head>
<body>
</head>
<body>
<script src="./static/js/weixin-1.1.0.js"></script>
<script src="./static/js/hdp-4.4.0.min.js"></script>
<script src="./static/js/as.js"></script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</body>
</html>
......
......@@ -9,3 +9,66 @@ export default {
name: 'App'
}
</script>
<style lang="scss">
// @import "./styles/common";
// @import "./styles/vars";
body {
margin: 0px;
padding: 0px;
// background: @color-primary;
// font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
// Microsoft YaHei, SimSun, sans-serif;
// font-size: 14px;
// -webkit-font-smoothing: antialiased;
}
#app {
position: absolute;
top: 0px;
bottom: 0px;
width: 100%;
}
.el-submenu [class^="fa"] {
vertical-align: baseline;
margin-right: 10px;
}
.el-menu-item [class^="fa"] {
vertical-align: baseline;
margin-right: 10px;
}
.toolbar {
background: #f2f2f2;
padding: 10px;
margin: 10px 0px;
.el-form-item {
margin-bottom: 10px;
}
}
.fade-enter-active,
.fade-leave-active {
transition: all 0.2s ease;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
.avatar-wrap {
display: flex;
justify-content: flex-start;
align-items: center;
.avatar {
width: 40px;
height: 40px;
}
}
</style>
......
module.exports = {
testListGet: '/xxx/xxx/list'
testListGet: '/xxx/xxx/list',
exportTable: exportTable,
}
function exportTable(params) {
let url = 'https://api.k.wxpai.cn/awp/plugins/export/' + params.func + '?id=' + params.appId + '&key=' + params.appKey + '&val=' + params.data;
console.log("url:", url);
window.open(url)
}
......
/**
* 获取当前链接参数
* @param {*} name
*/
export const getLinkParam = name => {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null;
};
/**
* 去掉字符串两端空格 trim
* @param {string} str
*/
export const trim = str => {
return str.replace(/(^\s*)|(\s*$)/g, '');
}
/**
* 验证邮箱
* @param {string} str
*/
export const checkEmail = str => {
let re = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
if (re.test(str)) {
return true;
} else {
return false;
}
}
/**
* 验证手机 1开头+10位数
* @param {string} str
*/
export const checkMobile = str => {
let re = /^1\d{10}$/;
// let re = /^(13[0-9]|14[57]|15[0-9]|17[0-9]|18[0-9])\d{8}$/; //严格模式
if (re.test(str)) {
return true;
} else {
return false;
}
}
/**
* 获取Uuid
*/
export const uuid = () => {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
}
/**
* 设置cookies
* @param {*} name
* @param {*} value
* @param {*} Days
*/
export const setCookie = (name, value, Days = 0) => {
if (Days <= 0) Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + encodeURI(value) + ";expires=" + exp.toUTCString();
}
/**
* 获取cookies
* @param {*} name
* @param {*} value
* @param {*} Days
*/
export const getCookie = (name) => {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg)) {
return decodeURI(arr[2]);
} else {
return "";
}
}
/**
* 删除cookies
* @param {*} name
*/
export const deleteCookie = (name) => {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval != null)
document.cookie = name + "=" + cval + ";expires=" + exp.toUTCString();
}
/**
* 判断是否微信客户端
* @param {*} name
*/
export const isWeiXin = () => {
var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
return true;
} else {
return false;
}
}
/**
* 时间戳格式化(yyyy-MM-dd hh:mm:ss)
* @param {*} timestamp
* @param {*} format
*/
export const timestampFormat = (timestamp, format) => {
Date.prototype.Format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
return fmt;
}
if (timestamp && timestamp.length == 10) timestamp += "000";
var date = new Date();
if (timestamp) date.setTime(timestamp);
if (format == null || format == "") {
format = "yyyy-MM-dd hh:mm:ss";
}
return date.Format(format);
};
/**
* 日期转时间戳
* @param {*} stringTime
*/
export const dateParse = stringTime => {
if (stringTime) {
var date = new Date(stringTime);
} else {
var date = new Date();
}
return Date.parse(date);
};
/**
* 生成指定范围内的随机数
* @param {*} min
* @param {*} max
*/
export const getRandom = (min, max) => {
var c = max - min + 1;
return Math.floor(Math.random() * c + min);
};
/**
* 日期格式化
*/
export const formatDate = {
SIGN_REGEXP: /([yMdhsm])(\1*)/g,
DEFAULT_PATTERN: 'yyyy-MM-dd',
padding: function (s, len) {
var len = len - (s + '').length;
for (var i = 0; i < len; i++) {
s = '0' + s;
}
return s;
},
format: function (date, pattern) {
pattern = pattern || formatDate.DEFAULT_PATTERN;
return pattern.replace(formatDate.SIGN_REGEXP, function ($0) {
switch ($0.charAt(0)) {
case 'y':
return formatDate.padding(date.getFullYear(), $0.length);
case 'M':
return formatDate.padding(date.getMonth() + 1, $0.length);
case 'd':
return formatDate.padding(date.getDate(), $0.length);
case 'w':
return date.getDay() + 1;
case 'h':
return formatDate.padding(date.getHours(), $0.length);
case 'm':
return formatDate.padding(date.getMinutes(), $0.length);
case 's':
return formatDate.padding(date.getSeconds(), $0.length);
}
});
},
parse: function (dateString, pattern) {
var matchs1 = pattern.match(formatDate.SIGN_REGEXP);
var matchs2 = dateString.match(/(\d)+/g);
if (matchs1.length == matchs2.length) {
var _date = new Date(1970, 0, 1);
for (var i = 0; i < matchs1.length; i++) {
var _int = parseInt(matchs2[i]);
var sign = matchs1[i];
switch (sign.charAt(0)) {
case 'y':
_date.setFullYear(_int);
break;
case 'M':
_date.setMonth(_int - 1);
break;
case 'd':
_date.setDate(_int);
break;
case 'h':
_date.setHours(_int);
break;
case 'm':
_date.setMinutes(_int);
break;
case 's':
_date.setSeconds(_int);
break;
}
}
return _date;
}
return null;
}
}
......@@ -22,22 +22,29 @@ import Layout from '../views/layout/Layout'
breadcrumb: false if false, the item will hidden in breadcrumb(default is true)
}
**/
export const constantRouterMap = [
{ path: '/login', component: () => import('@/views/login/index'), hidden: true },
{ path: '/404', component: () => import('@/views/404'), hidden: true },
export const constantRouterMap = [{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
name: 'Dashboard',
hidden: true,
children: [{
path: 'dashboard',
component: () => import('@/views/dashboard/index')
}]
path: '/404',
component: () => import('@/views/404'),
hidden: true
},
/* {
// {
// path: '/',
// component: Layout,
// redirect: '/dashboard',
// name: 'Dashboard',
// hidden: true,
// children: [{
// path: 'dashboard',
// component: () => import('@/views/dashboard/index')
// }]
// },
/* {
path: '/form',
component: Layout,
children: [
......@@ -49,104 +56,179 @@ export const constantRouterMap = [
}
]
},*/
{
path: '/qrcode',
path: '/',
component: Layout,
children: [
{
path: 'index',
name: 'Qrcode',
component: () => import('@/views/scene/index'),
meta: { title: '订阅信息', icon: 'form' }
redirect: '/dictionary/reservation',
name: 'dictionary',
meta: {
title: '天宝宝典',
icon: 'nested'
},
children: [{
path: '/dictionary/reservation',
name: 'reservation',
component: () => import('@/views/dictionary/reservation'),
meta: {
title: '预约明细',
icon: ''
}
]
},
/*{
path: '/example',
component: Layout,
redirect: '/example/table',
name: 'Example',
meta: { title: 'Example', icon: 'example' },
children: [
{
path: 'table',
name: 'Table',
component: () => import('@/views/table/index'),
meta: { title: 'Table', icon: 'table' }
path: '/dictionary/pvpage',
name: 'pvpage',
component: () => import('@/views/dictionary/pvpage'),
meta: {
title: '页面访问明细',
icon: ''
}
},
{
path: 'tree',
name: 'Tree',
component: () => import('@/views/tree/index'),
meta: { title: 'Tree', icon: 'tree' }
path: '/dictionary/pvproduct',
name: 'pvproduct',
component: () => import('@/views/dictionary/pvproduct'),
meta: {
title: '产品访问明细',
icon: ''
}
},
]
},*/
/*
},
{
path: '/nested',
path: '/calculator',
component: Layout,
redirect: '/nested/menu1',
name: 'Nested',
redirect: '/calculator/pvpage',
name: 'dictionary',
meta: {
title: 'Nested',
title: '天宝计算器',
icon: 'nested'
},
children: [
{
path: 'menu1',
component: () => import('@/views/nested/menu1/index'), // Parent router-view
name: 'Menu1',
meta: { title: 'Menu1' },
children: [
{
path: 'menu1-1',
component: () => import('@/views/nested/menu1/menu1-1'),
name: 'Menu1-1',
meta: { title: 'Menu1-1' }
},
{
path: 'menu1-2',
component: () => import('@/views/nested/menu1/menu1-2'),
name: 'Menu1-2',
meta: { title: 'Menu1-2' },
children: [
{
path: 'menu1-2-1',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
name: 'Menu1-2-1',
meta: { title: 'Menu1-2-1' }
},
{
path: 'menu1-2-2',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
name: 'Menu1-2-2',
meta: { title: 'Menu1-2-2' }
path: '/calculator/pvpage',
name: 'pvpage',
component: () => import('@/views/calculator/pvpage'),
meta: {
title: '页面访问明细',
icon: ''
}
]
},
{
path: 'menu1-3',
component: () => import('@/views/nested/menu1/menu1-3'),
name: 'Menu1-3',
meta: { title: 'Menu1-3' }
path: '/calculator/pvfunc',
name: 'pvfunc',
component: () => import('@/views/calculator/pvfunc'),
meta: {
title: '功能访问明细',
icon: ''
}
},
]
},
{
path: 'menu2',
component: () => import('@/views/nested/menu2/index'),
meta: { title: 'menu2' }
path: '/qrcode',
component: Layout,
children: [{
path: 'index',
name: 'Qrcode',
component: () => import('@/views/scene/index'),
meta: {
title: '订阅信息',
icon: 'form'
}
]
}]
},
*/
// {
// path: '/example',
// component: Layout,
// redirect: '/example/table',
// name: 'Example',
// meta: {
// title: 'Example',
// icon: 'example'
// },
// children: [{
// path: 'table',
// name: 'Table',
// component: () => import('@/views/table/index'),
// meta: {
// title: 'Table',
// icon: 'table'
// }
// },
// {
// path: 'tree',
// name: 'Tree',
// component: () => import('@/views/tree/index'),
// meta: {
// title: 'Tree',
// icon: 'tree'
// }
// }
// ]
// },
// {
// path: '/nested',
// component: Layout,
// redirect: '/nested/menu1',
// name: 'Nested',
// meta: {
// title: 'Nested',
// icon: 'nested'
// },
// children: [
// {
// path: 'menu1',
// component: () => import('@/views/nested/menu1/index'), // Parent router-view
// name: 'Menu1',
// meta: { title: 'Menu1' },
// children: [
// {
// path: 'menu1-1',
// component: () => import('@/views/nested/menu1/menu1-1'),
// name: 'Menu1-1',
// meta: { title: 'Menu1-1' }
// },
// {
// path: 'menu1-2',
// component: () => import('@/views/nested/menu1/menu1-2'),
// name: 'Menu1-2',
// meta: { title: 'Menu1-2' },
// children: [
// {
// path: 'menu1-2-1',
// component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
// name: 'Menu1-2-1',
// meta: { title: 'Menu1-2-1' }
// },
// {
// path: 'menu1-2-2',
// component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
// name: 'Menu1-2-2',
// meta: { title: 'Menu1-2-2' }
// }
// ]
// },
// {
// path: 'menu1-3',
// component: () => import('@/views/nested/menu1/menu1-3'),
// name: 'Menu1-3',
// meta: { title: 'Menu1-3' }
// }
// ]
// },
// {
// path: 'menu2',
// component: () => import('@/views/nested/menu2/index'),
// meta: { title: 'menu2' }
// }
// ]
// },
// {
// path: 'external-link',
......@@ -159,11 +241,17 @@ export const constantRouterMap = [
// ]
// },
{ path: '*', redirect: '/404', hidden: true }
{
path: '*',
redirect: '/404',
hidden: true
}
]
export default new Router({
// mode: 'history', //后端支持可开
scrollBehavior: () => ({ y: 0 }),
scrollBehavior: () => ({
y: 0
}),
routes: constantRouterMap
})
......
<template>
<div class="page-container">
<div class="tool-wrap">
<div>
<el-form :inline="true" :model="filters">
<el-form-item>
<el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入使用功能"></el-input>
</el-form-item>
<el-form-item>
<el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" v-on:click="reqQuery">查询</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-button class="reset-btn" @click="showDialog()">导出数据</el-button>
</div>
</div>
<el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;">
<el-table-column prop="func_name" label="使用功能">
</el-table-column>
<el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间">
</el-table-column>
<el-table-column prop="nickname" label="微信昵称">
</el-table-column>
<el-table-column label="微信头像">
<template slot-scope="scope">
<div class="avatar-wrap">
<img class="avatar" :src="scope.row.avatar" alt="">
</div>
</template>
</el-table-column>
<el-table-column prop="openid" label="openid">
</el-table-column>
</el-table>
<!--工具条-->
<el-col :span="24" class="toolbar">
<div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div>
<el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;">
</el-pagination>
</el-col>
<el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false">
<span class="tips">导出日期</span>
<el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
<div slot="footer" class="dialog-footer">
<el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button>
<el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { Base64 } from "js-base64";
import { exportTable } from "./../../api/api.js";
import { formatDate } from "./../../common/utils.js";
export default {
data() {
return {
exportDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date().getTime()
],
exportDialogVisible: false,
listLoading: false,
page: 1,
pageSize: 10,
total: 0,
totalData: {
reservationList: []
},
selDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date()
],
pickerOptions2: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
filters: {
mobilePhone: "",
date: ""
}
};
},
computed: {
pageNum() {
return Math.ceil(this.total / this.pageSize);
},
startTime() {
let date = this.filters.date;
let result = (date && date[0]) || "";
if (result) {
result = date[0].getTime();
}
return result;
},
endTime() {
let date = this.filters.date;
let result = (date && date[1]) || "";
if (result) {
result = date[1].getTime() + 1000 * 60 * 60 * 24;
}
return result;
}
},
methods: {
changeHandler() {
this.reqQuery();
},
exportHandler() {
let data = {
start_time: new Date(this.exportDate[0]).getTime(),
end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24,
mobile_phone: "",
startIndex: 0,
size: 1000000
};
var encoder = HDP.getEncoder();
var encrypted = encoder.encode(JSON.stringify(data));
let params = {
appId: "0489fba68acd11e98c527cd30aeb749e",
appKey: "9524a3c59a5d4460bd141a2a93a5db17",
func: "queryStatFuncListAppjqos",
data: encrypted
};
exportTable(params);
},
showDialog() {
this.exportDialogVisible = true;
},
formatTableDate(row, column) {
return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm");
},
handleCurrentChange(val) {
this.page = val;
this.reqQuery();
},
reqQuery() {
let _this = this;
_this.listLoading = true;
let data = {
startIndex: (this.page - 1) * this.pageSize,
size: this.pageSize,
query: this.filters.mobilePhone,
start_time: this.startTime,
end_time: this.endTime
};
as.queryFunV2("queryStatFuncListAppjqos", data, res => {
_this.page = 1;
_this.listLoading = false;
if (res) {
let reservationList = res[0];
let total = res[1][0].total;
_this.total = total;
_this.$set(_this.totalData, "reservationList", reservationList);
}
});
}
},
mounted() {
this.reqQuery();
},
created() {}
};
</script>
<style lang="scss" scoped>
.page-container {
padding: 20px;
}
.tool-wrap {
padding: 24px 0;
display: flex;
border-bottom: solid 1px #cccccc;
justify-content: space-between;
}
.toolbar {
display: flex;
justify-content: space-between;
.page-tips {
height: 32px;
line-height: 32px;
color: #333333;
}
}
.dialog {
.tips {
margin-right: 24px;
}
}
</style>
<template>
<div class="page-container">
<div class="tool-wrap">
<div>
<el-form :inline="true" :model="filters">
<el-form-item>
<el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入访问页面"></el-input>
</el-form-item>
<el-form-item>
<el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" v-on:click="reqQuery">查询</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-button class="reset-btn" @click="showDialog()">导出数据</el-button>
</div>
</div>
<el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;">
<el-table-column prop="page_name" label="访问页面">
</el-table-column>
<el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间">
</el-table-column>
<el-table-column prop="nickname" label="微信昵称">
</el-table-column>
<el-table-column label="微信头像">
<template slot-scope="scope">
<div class="avatar-wrap">
<img class="avatar" :src="scope.row.avatar" alt="">
</div>
</template>
</el-table-column>
<el-table-column prop="openid" label="openid">
</el-table-column>
</el-table>
<!--工具条-->
<el-col :span="24" class="toolbar">
<div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div>
<el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;">
</el-pagination>
</el-col>
<el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false">
<span class="tips">导出日期</span>
<el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
<div slot="footer" class="dialog-footer">
<el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button>
<el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { Base64 } from "js-base64";
import { exportTable } from "./../../api/api.js";
import { formatDate } from "./../../common/utils.js";
export default {
data() {
return {
exportDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date().getTime()
],
exportDialogVisible: false,
listLoading: false,
page: 1,
pageSize: 10,
total: 0,
totalData: {
reservationList: []
},
selDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date()
],
pickerOptions2: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
filters: {
mobilePhone: "",
date: ""
}
};
},
computed: {
pageNum() {
return Math.ceil(this.total / this.pageSize);
},
startTime() {
let date = this.filters.date;
let result = (date && date[0]) || "";
if (result) {
result = date[0].getTime();
}
return result;
},
endTime() {
let date = this.filters.date;
let result = (date && date[1]) || "";
if (result) {
result = date[1].getTime() + 1000 * 60 * 60 * 24;
}
return result;
}
},
methods: {
changeHandler() {
this.reqQuery();
},
exportHandler() {
let data = {
start_time: new Date(this.exportDate[0]).getTime(),
end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24,
mobile_phone: "",
startIndex: 0,
size: 1000000
};
var encoder = HDP.getEncoder();
var encrypted = encoder.encode(JSON.stringify(data));
let params = {
appId: "0489fba68acd11e98c527cd30aeb749e",
appKey: "9524a3c59a5d4460bd141a2a93a5db17",
func: "queryStatPageListAppjqos",
data: encrypted
};
exportTable(params);
},
showDialog() {
this.exportDialogVisible = true;
},
formatTableDate(row, column) {
return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm");
},
handleCurrentChange(val) {
this.page = val;
this.reqQuery();
},
reqQuery() {
let _this = this;
_this.listLoading = true;
let data = {
startIndex: (this.page - 1) * this.pageSize,
size: this.pageSize,
query: this.filters.mobilePhone,
start_time: this.startTime,
end_time: this.endTime
};
as.queryFunV2("queryStatPageListAppjqos", data, res => {
_this.page = 1;
_this.listLoading = false;
if (res) {
let reservationList = res[0];
let total = res[1][0].total;
_this.total = total;
_this.$set(_this.totalData, "reservationList", reservationList);
}
});
}
},
mounted() {
this.reqQuery();
},
created() {}
};
</script>
<style lang="scss" scoped>
.page-container {
padding: 20px;
}
.tool-wrap {
padding: 24px 0;
display: flex;
border-bottom: solid 1px #cccccc;
justify-content: space-between;
}
.toolbar {
display: flex;
justify-content: space-between;
.page-tips {
height: 32px;
line-height: 32px;
color: #333333;
}
}
.dialog {
.tips {
margin-right: 24px;
}
}
</style>
<template>
<div class="page-container">
<div class="tool-wrap">
<div>
<el-form :inline="true" :model="filters">
<el-form-item>
<el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入访问页面"></el-input>
</el-form-item>
<el-form-item>
<el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" v-on:click="reqQuery">查询</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-button class="reset-btn" @click="showDialog()">导出数据</el-button>
</div>
</div>
<el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;">
<el-table-column prop="page_name" label="访问页面">
</el-table-column>
<el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间">
</el-table-column>
<el-table-column prop="nickname" label="微信昵称">
</el-table-column>
<el-table-column label="微信头像">
<template slot-scope="scope">
<div class="avatar-wrap">
<img class="avatar" :src="scope.row.avatar" alt="">
</div>
</template>
</el-table-column>
<el-table-column prop="openid" label="openid">
</el-table-column>
</el-table>
<!--工具条-->
<el-col :span="24" class="toolbar">
<div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div>
<el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;">
</el-pagination>
</el-col>
<el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false">
<span class="tips">导出日期</span>
<el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
<div slot="footer" class="dialog-footer">
<el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button>
<el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { Base64 } from "js-base64";
import { exportTable } from "./../../api/api.js";
import { formatDate } from "./../../common/utils.js";
export default {
data() {
return {
exportDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date().getTime()
],
exportDialogVisible: false,
listLoading: false,
page: 1,
pageSize: 10,
total: 0,
totalData: {
reservationList: []
},
selDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date()
],
pickerOptions2: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
filters: {
mobilePhone: "",
date: ""
}
};
},
computed: {
pageNum() {
return Math.ceil(this.total / this.pageSize);
},
startTime() {
let date = this.filters.date;
let result = (date && date[0]) || "";
if (result) {
result = date[0].getTime();
}
return result;
},
endTime() {
let date = this.filters.date;
let result = (date && date[1]) || "";
if (result) {
result = date[1].getTime() + 1000 * 60 * 60 * 24;
}
return result;
}
},
methods: {
changeHandler() {
this.reqQuery();
},
exportHandler() {
let data = {
start_time: new Date(this.exportDate[0]).getTime(),
end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24,
mobile_phone: "",
startIndex: 0,
size: 1000000
};
var encoder = HDP.getEncoder();
var encrypted = encoder.encode(JSON.stringify(data));
let params = {
appId: "0489fba68acd11e98c527cd30aeb749e",
appKey: "9524a3c59a5d4460bd141a2a93a5db17",
func: "queryStatPageList",
data: encrypted
};
exportTable(params);
},
showDialog() {
this.exportDialogVisible = true;
},
formatTableDate(row, column) {
return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm");
},
handleCurrentChange(val) {
this.page = val;
this.reqQuery();
},
reqQuery() {
let _this = this;
_this.listLoading = true;
let data = {
startIndex: (this.page - 1) * this.pageSize,
size: this.pageSize,
mobile_phone: this.filters.mobilePhone,
start_time: this.startTime,
end_time: this.endTime
};
as.queryFunV2("queryStatPageList", data, res => {
_this.page = 1;
_this.listLoading = false;
if (res) {
let reservationList = res[0];
let total = res[1][0].total;
_this.total = total;
_this.$set(_this.totalData, "reservationList", reservationList);
}
});
}
},
mounted() {
this.reqQuery();
},
created() {}
};
</script>
<style lang="scss" scoped>
.page-container {
padding: 20px;
}
.tool-wrap {
padding: 24px 0;
display: flex;
border-bottom: solid 1px #cccccc;
justify-content: space-between;
}
.toolbar {
display: flex;
justify-content: space-between;
.page-tips {
height: 32px;
line-height: 32px;
color: #333333;
}
}
.dialog {
.tips {
margin-right: 24px;
}
}
</style>
<template>
<div class="page-container">
<div class="tool-wrap">
<div>
<el-form :inline="true" :model="filters">
<el-form-item>
<el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入访问产品"></el-input>
</el-form-item>
<el-form-item>
<el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" v-on:click="reqQuery">查询</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-button class="reset-btn" @click="showDialog()">导出数据</el-button>
</div>
</div>
<el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;">
<el-table-column prop="product_name" label="访问产品">
</el-table-column>
<el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间">
</el-table-column>
<el-table-column prop="nickname" label="微信昵称">
</el-table-column>
<el-table-column label="微信头像">
<template slot-scope="scope">
<div class="avatar-wrap">
<img class="avatar" :src="scope.row.avatar" alt="">
</div>
</template>
</el-table-column>
<el-table-column prop="openid" label="openid">
</el-table-column>
</el-table>
<!--工具条-->
<el-col :span="24" class="toolbar">
<div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div>
<el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;">
</el-pagination>
</el-col>
<el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false">
<span class="tips">导出日期</span>
<el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
<div slot="footer" class="dialog-footer">
<el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button>
<el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { Base64 } from "js-base64";
import { exportTable } from "./../../api/api.js";
import { formatDate } from "./../../common/utils.js";
export default {
data() {
return {
exportDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date().getTime()
],
exportDialogVisible: false,
listLoading: false,
page: 1,
pageSize: 10,
total: 0,
totalData: {
reservationList: []
},
selDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date()
],
pickerOptions2: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
filters: {
mobilePhone: "",
date: ""
}
};
},
computed: {
pageNum() {
return Math.ceil(this.total / this.pageSize);
},
startTime() {
let date = this.filters.date;
let result = (date && date[0]) || "";
if (result) {
result = date[0].getTime();
}
return result;
},
endTime() {
let date = this.filters.date;
let result = (date && date[1]) || "";
if (result) {
result = date[1].getTime() + 1000 * 60 * 60 * 24;
}
return result;
}
},
methods: {
changeHandler() {
this.reqQuery();
},
exportHandler() {
let data = {
start_time: new Date(this.exportDate[0]).getTime(),
end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24,
mobile_phone: "",
startIndex: 0,
size: 1000000
};
var encoder = HDP.getEncoder();
var encrypted = encoder.encode(JSON.stringify(data));
let params = {
appId: "0489fba68acd11e98c527cd30aeb749e",
appKey: "9524a3c59a5d4460bd141a2a93a5db17",
func: "queryStatProductList",
data: encrypted
};
exportTable(params);
},
showDialog() {
this.exportDialogVisible = true;
},
formatTableDate(row, column) {
return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm");
},
handleCurrentChange(val) {
this.page = val;
this.reqQuery();
},
reqQuery() {
let _this = this;
_this.listLoading = true;
let data = {
startIndex: (this.page - 1) * this.pageSize,
size: this.pageSize,
mobile_phone: this.filters.mobilePhone,
start_time: this.startTime,
end_time: this.endTime
};
as.queryFunV2("queryStatProductList", data, res => {
_this.page = 1;
_this.listLoading = false;
if (res) {
let reservationList = res[0];
let total = res[1][0].total;
_this.total = total;
_this.$set(_this.totalData, "reservationList", reservationList);
}
});
}
},
mounted() {
this.reqQuery();
},
created() {}
};
</script>
<style lang="scss" scoped>
.page-container {
padding: 20px;
}
.tool-wrap {
padding: 24px 0;
display: flex;
border-bottom: solid 1px #cccccc;
justify-content: space-between;
}
.toolbar {
display: flex;
justify-content: space-between;
.page-tips {
height: 32px;
line-height: 32px;
color: #333333;
}
}
.dialog {
.tips {
margin-right: 24px;
}
}
</style>
<template>
<div class="page-container">
<div class="tool-wrap">
<div>
<el-form :inline="true" :model="filters">
<el-form-item>
<el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-form-item>
<el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" v-on:click="reqQuery">查询</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-button class="reset-btn" @click="showDialog()">导出数据</el-button>
</div>
</div>
<el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;">
<el-table-column prop="product_name" label="产品名称">
</el-table-column>
<el-table-column prop="advisory" label="申请类型">
</el-table-column>
<el-table-column prop="name" label="姓名">
</el-table-column>
<el-table-column prop="mobile" label="联系方式">
</el-table-column>
<el-table-column prop="office" label="单位">
</el-table-column>
<el-table-column prop="province" label="省份">
</el-table-column>
<el-table-column prop="hdp_created" :formatter="formatTableDate" label="申请时间">
</el-table-column>
<el-table-column prop="nickname" label="微信昵称">
</el-table-column>
<el-table-column label="微信头像">
<template slot-scope="scope">
<div class="avatar-wrap">
<img class="avatar" :src="scope.row.avatar" alt="">
</div>
</template>
</el-table-column>
<el-table-column prop="openid" label="openid">
</el-table-column>
</el-table>
<!--工具条-->
<el-col :span="24" class="toolbar">
<div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div>
<el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;">
</el-pagination>
</el-col>
<el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false">
<span class="tips">导出日期</span>
<el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2">
</el-date-picker>
<div slot="footer" class="dialog-footer">
<el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button>
<el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { Base64 } from "js-base64";
import { exportTable } from "./../../api/api.js";
import { formatDate } from "./../../common/utils.js";
export default {
data() {
return {
exportDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date().getTime()
],
exportDialogVisible: false,
listLoading: false,
page: 1,
pageSize: 10,
total: 0,
totalData: {
reservationList: []
},
selDate: [
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7),
new Date()
],
pickerOptions2: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
filters: {
mobilePhone: "",
date: ""
}
};
},
computed: {
pageNum() {
return Math.ceil(this.total / this.pageSize);
},
startTime() {
let date = this.filters.date;
let result = (date && date[0]) || "";
if (result) {
result = date[0].getTime();
}
return result;
},
endTime() {
let date = this.filters.date;
let result = (date && date[1]) || "";
if (result) {
result = date[1].getTime() + 1000 * 60 * 60 * 24;
}
return result;
}
},
methods: {
changeHandler() {
this.reqQuery();
},
exportHandler() {
let data = {
start_time: new Date(this.exportDate[0]).getTime(),
end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24,
mobile_phone: "",
startIndex: 0,
size: 1000000
};
var encoder = HDP.getEncoder();
var encrypted = encoder.encode(JSON.stringify(data));
let params = {
appId: "0489fba68acd11e98c527cd30aeb749e",
appKey: "9524a3c59a5d4460bd141a2a93a5db17",
func: "queryInquiryList",
data: encrypted
};
exportTable(params);
},
showDialog() {
this.exportDialogVisible = true;
},
formatTableDate(row, column) {
return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm");
},
handleCurrentChange(val) {
this.page = val;
this.reqQuery();
},
reqQuery() {
let _this = this;
_this.listLoading = true;
let data = {
startIndex: (this.page - 1) * this.pageSize,
size: this.pageSize,
mobile_phone: this.filters.mobilePhone,
start_time: this.startTime,
end_time: this.endTime
};
as.queryFunV2("queryInquiryList", data, res => {
console.log("queryInquiryList res:", res);
_this.page = 1;
_this.listLoading = false;
if (res) {
let reservationList = res[0];
let total = res[1][0].total;
_this.total = total;
_this.$set(_this.totalData, "reservationList", reservationList);
}
});
}
},
mounted() {
this.reqQuery();
},
created() {}
};
</script>
<style lang="scss" scoped>
.page-container {
padding: 20px;
}
.tool-wrap {
padding: 24px 0;
display: flex;
border-bottom: solid 1px #cccccc;
justify-content: space-between;
}
.toolbar {
display: flex;
justify-content: space-between;
.page-tips {
height: 32px;
line-height: 32px;
color: #333333;
}
}
.dialog {
.tips {
margin-right: 24px;
}
}
</style>
......@@ -97,6 +97,7 @@ export default {
.then(() => {
this.loading = false
this.$router.push({ path: this.redirect || '/' })
// this.$router.push({ path: '/dictionary/pv' })
})
.catch(() => {
this.loading = false
......
// var HDP = require("./hdp-4.4.0.min.js")
var as = {};
/*------------------初始化基础数据 start---------------------*/
as.domains = "https://" + document.domain + "/4Gh6/";
as.AppID = "0489fba68acd11e98c527cd30aeb749e";
as.AppKey = "9524a3c59a5d4460bd141a2a93a5db17";
//默认头像
as.defineAvatar = "http://cdn.aiwanpai.com/s/d.jpg";
as.shareLink = as.domains + "index.html";
as.shareTitle = "";
as.shareDesc = "";
as.shareImgUrl = as.domains + "share.jpg";
as.success = function () {};
as.appSuccess = function () {};
as.openid = "";
as.wxUserInfo = {};
as.isSubscribe = false; //是否关注
as.rankName = "rank"; //排行榜名称
/*------------------初始化基础数据 end-----------------------*/
/*------------------HDP初始化 start---------------------*/
HDP.init(as.AppID, as.AppKey);
weixinGetConfig();
//隐藏分享到朋友圈
hideMenuItemsTimeLink();
//隐藏微信右上角菜单
// hideOptionMenu();
//以下初始化不需要使用可以注释掉
as.weixin = HDP.weixin(); //微信
as.redis = HDP.redis(); //keyvaluestore
as.func = HDP.getFunction(); //自定义函数
as.rand = HDP.rand(); //抽奖
// as.piplus = HDP.getPiplus(); //派加接口
as.co = HDP.getAppCooperation(); //协作
// as.rank = HDP.rank(); //排行榜
// as.jpgCdn = HDP.getJpgCDN(); //图片路径转换
as.wxMultimedia = HDP.wxMultimedia(); //语音
as.file = HDP.getFile(); //上传图片
/*------------------HDP初始化 end-----------------------*/
/*------------------微信相关 start---------------------*/
//分享设置
as.setShare = function (link, title, desc, imgurl) {
as.weixin.initShare({
"link": (link != "") ? link : as.shareLink,
"appMessageTitle": (title != "") ? title : as.shareTitle,
"appMessageDesc": (desc != "") ? desc : as.shareDesc,
"appMessageImgUrl": (imgurl != "") ? imgurl : as.shareImgUrl,
"appMessageShareSucc": as.appSuccess,
"timelineTitle": (desc != "") ? desc : as.shareDesc,
"timelineImgUrl": (imgurl != "") ? imgurl : as.shareImgUrl,
"timelineShareSucc": as.success
});
};
as.setShare("", "", "", "");
//获取用户微信信息
as.getWxUserInfo = function (callback) {
as.weixin.getUserInfoV2({
"success": function (res) {
if (res && res.nickname) {
if (res.nickname.indexOf('"') > -1) {
res.nickname = res.nickname.replace(/"/g, '“');
}
if (res.nickname.indexOf("'") > -1) {
res.nickname = res.nickname.replace(/'/g, "‘");
}
}
if (res && res.avatar == "") {
res.avatar = as.defineAvatar;
}
as.wxUserInfo = res;
if (as.wxUserInfo && as.wxUserInfo.openid) {
as.openid = as.wxUserInfo.openid;
}
if (typeof callback == "function") {
callback(as.openid)
};
},
"error": function (res) {
if (typeof callback == "function") {
callback("")
};
}
});
};
//判断是否关注了公众号
as.isAttention = function (callback) {
as.weixin.isSubscribe({
"success": function (res) {
as.isSubscribe = (res["subscribe"] == 1) ? true : false;
if (typeof callback == "function")
callback(as.isSubscribe);
},
"error": function (res) {
if (typeof callback == "function")
callback(false);
}
});
};
//领取卡券
as.addCard = function (cardId, openid, callback) {
as.weixin.addCard({
"cardId": cardId,
"code": "",
"openid": openid,
"succ": function (res) {
console.log('领取卡券成功');
if (typeof callback == "function")
callback(true);
},
"error": function (res) {
console.log('领取卡券失败');
if (typeof callback == "function")
callback(false);
}
});
};
/*------------------微信相关 end---------------------*/
/*------------------keyvaluestore start---------------------*/
as.setRedisKeyValue = function (key, value, callback) {
var redisOp = {
"param": {
"valueKey": key,
"value": value
},
"success": function (res) {
var bool = res.code == "180001";
if (typeof callback == "function") callback(bool);
},
"error": function (res) {
if (typeof callback == "function") callback(false);
}
};
as.redis.set(redisOp);
};
as.getRedisKeyValue = function (key, callback) {
var redisOp = {
"param": {
"valueKey": key
},
"success": function (res) {
if (res.code == "181001") {
if (typeof callback == "function") callback(res["returnMap"][key]);
} else {
if (typeof callback == "function") callback(null);
}
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
};
as.redis.get(redisOp);
};
as.getRedisList = function (key, callback) {
var redisOp = {
"param": {
"valueKey": key
},
"success": function (res) {
if (res.code == "181001") {
if (typeof callback == "function") callback(res["returnMap"]);
} else {
if (typeof callback == "function") callback(null);
}
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
};
as.redis.getList(redisOp);
};
/*------------------keyvaluestore end-----------------------*/
/*------------------自定义函数 start---------------------*/
//单语句查询
as.queryFun = function (funName, data, callback) {
as.func.runFunction(funName, {
"param": data,
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
//插入,修改,多语句查询
as.queryFunV2 = function (funName, data, callback) {
as.func.runFunctionV2(funName, {
"param": data,
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
/*------------------自定义函数 end---------------------*/
/*------------------抽奖相关 start---------------------*/
//抽奖
as.gameLottery = function (callback) {
as.rand.rand({
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback({
"result": false
});
}
});
};
//时间戳格式化(YYYY-mm-dd)
as.timestampFormat = function (timestamp) {
var myDate = new Date();
if (timestamp) myDate.setTime(timestamp);
var year = myDate.getFullYear();
var month = myDate.getMonth() + 1;
if (month < 10) month = "0" + month;
var day = myDate.getDate();
if (day < 10) day = "0" + day;
var format = "";
format += year + "-" + month + "-" + day;
return format;
};
/*------------------抽奖相关 end-----------------------*/
/*------------------协作相关 start---------------------*/
//从当前链接中获取邀请码 hdp_cooperation_id
as.getCodeFromCurrentUrl = function (callback) {
as.co.getCodeFromCurrentUrl(function (cooperationId) {
if (typeof callback == "function") callback(cooperationId);
});
};
//根据邀请码重置分享链接
as.cooperationSetShareLink = function (resourceId, desc) {
if (resourceId != "") {
if (as.shareLink.indexOf("?") > 0) {
var link = as.shareLink + "&hdp_cooperation_id=" + resourceId;
} else {
var link = as.shareLink + "?hdp_cooperation_id=" + resourceId;
}
as.setShare(link, "", desc, "");
}
};
//生成邀请码
as.insertResourceId = function (jsonStr, callback) {
if (typeof (jsonStr) != 'string') {
jsonStr = JSON.stringify(jsonStr);
}
as.co.uploadAppCooperationInfo({
"param": {
"jsonStr": jsonStr
},
"success": function (res) {
if (res && res.success) {
if (typeof callback == "function") callback(res.content);
} else {
if (typeof callback == "function") callback("");
}
},
"error": function (res) {
if (typeof callback == "function") callback("");
}
});
};
//判断当前邀请码状态,分辨邀请者身份
as.checkResourceId = function (resourceId, callback) {
as.co.checkAppCooperationInfoSelfOrNot({
"param": {
"resourceId": resourceId
},
"success": function (res) {
if (res && res.success) {
//res.content :"not exist"非邀请链接;"true"自己的分享链接;"false"他人的分享链接
if (typeof callback == "function") callback(res.content);
} else {
if (typeof callback == "function") callback("not exist");
}
},
"error": function (res) {
if (typeof callback == "function") callback("not exist");
}
});
};
//读取用户所有邀请码
as.getResourceId = function (callback) {
as.co.queryCurrentUserAppCooperationInfoIdList({
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback([]);
}
});
};
//读取当前邀请码信息
as.getUserInfoByResourceId = function (resourceId, callback) {
as.co.queryCurrentAppCooperationInfo({
"param": {
"resourceId": resourceId
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
//为邀请码点赞
as.addPraise = function (resourceId, callback) {
as.co.praise({
"param": {
"resourceId": resourceId
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(false);
}
});
};
//读取邀请码的点赞数
as.getPraise = function (resourceId, callback) {
as.co.getPraiseRecordTotalByResourceId({
"param": {
"resourceId": resourceId
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(0);
}
});
};
//判断用户是否为邀请码点赞
as.checkUserPraise = function (resourceId, callback) {
as.co.checkCurrentUserPraiseOrNot({
"param": {
"resourceId": resourceId
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(false);
}
});
};
as.getPraiseLog = function (resourceId, page, size, callback) {
as.co.queryPraiseRecordListByResourceId({
"param": {
"resourceId": resourceId,
"page": page,
"size": size
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback([]);
}
});
};
//为邀请码评论
as.addComment = function (resourceId, content, callback) {
as.co.comment({
"param": {
"resourceId": resourceId,
"content": content,
"parentId": "",
"remark": ""
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
//评论列表
as.queryCommentList = function (resourceId, page, size, callback) {
as.co.queryAppCooperationInfoCommentRecordList({
"param": {
"resourceId": resourceId,
"page": page,
"size": size,
"ascending": false
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback([]);
}
});
};
//读取邀请码评论数
as.queryCommentCount = function (resourceId, callback) {
as.co.getAppCooperationInfoCommentRecordTotal({
"param": {
"resourceId": resourceId
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(0);
}
});
};
//当前用户对邀请码的评论总数
as.queryCommentCountByUser = function (resourceId, callback) {
as.co.getCurrentUserAppCooperationInfoCommentRecordTotal({
"param": {
"resourceId": resourceId
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(0);
}
});
};
/*------------------协作相关 end-----------------------*/
/*------------------排行榜相关 start---------------------*/
/*
* 提交成绩
* rankName : 排行榜名字
* score : 游戏分数
* spendTime : 游戏耗时
*/
as.rankSubmitScore = function (score, spendTime, callback) {
as.rank.saveRankScore({
"param": {
"rankName": as.rankName,
"score": score,
"spendTime": spendTime
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
//查询排行榜(包含当前用户的排行记录)
as.rankQueryRankList = function (page, size, callback) {
as.rank.queryRankList({
"param": {
"rankName": as.rankName,
"selfInclude": true,
"page": page,
"size": size
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
//查询当前用户排名
as.rankQueryUserRankRecord = function (callback) {
as.rank.queryUserRankRecord({
"param": {
"rankName": as.rankName
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
//查询当前用户的记录
as.rankQueryRankHistory = function (callback) {
as.rank.queryRankHistory({
"param": {
"rankName": as.rankName
},
"success": function (res) {
console.log(res, "rankQueryUserRankRecord success");
if (typeof callback == "function") callback(res);
},
"error": function (res) {
console.log(res.response, "rankQueryUserRankRecord error");
if (typeof callback == "function") callback(null);
}
});
};
/*------------------排行榜相关 end-----------------------*/
/*------------------派加接口相关 start---------------------*/
//读取用户积分
as.getIntegral = function (callback) {
as.piplus.readUserIntegral({
"success": function (res) {
if (res && res.integral) {
if (typeof callback == "function") callback(res.integral);
} else {
if (typeof callback == "function") callback(0);
}
},
"error": function (res) {
if (typeof callback == "function") callback(0);
}
});
};
//判断当前用户是否会员
as.checkMember = function (callback) {
as.piplus.isMember({
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback({
"isMember": false,
"integral": 0
});
}
});
};
//查询当前用户会员信息
as.readMember = function (callback) {
as.piplus.readMember({
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback({
"status": false
});
}
});
};
//同步会员信息
as.commonSaveUserInfo = function (user_name, mobile, province, city, area, address, birthday, tags, callback) {
as.piplus.commonSaveUserInfo({
"param": {
"user_name": user_name,
"mobile": mobile,
"province": province,
"city": city,
"area": area,
"address": address,
"birthday": birthday,
"tags": tags
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback({
"status": false
});
}
});
};
//获取省份
as.getProvinces = function (callback) {
as.piplus.getProvinces({
"success": function (res) {
if (res.http_status && res.errmsg == "success") {
if (typeof callback == "function") callback(res.data);
} else {
if (typeof callback == "function") callback([]);
}
},
"error": function (res) {
if (typeof callback == "function") callback([]);
}
});
};
//获取城市
as.getCity = function (regionId, callback) {
as.piplus.getCity({
"param": {
"regionId": regionId
},
"success": function (res) {
if (res.http_status && res.errmsg == "success") {
if (typeof callback == "function") callback(res.data);
} else {
if (typeof callback == "function") callback([]);
}
},
"error": function (res) {
if (typeof callback == "function") callback([]);
}
});
};
//获取区域
as.getArea = function (regionId, callback) {
as.piplus.getCity({
"param": {
"regionId": regionId
},
"success": function (res) {
if (res.http_status && res.errmsg == "success") {
if (typeof callback == "function") callback(res.data);
} else {
if (typeof callback == "function") callback([]);
}
},
"error": function (res) {
if (typeof callback == "function") callback([]);
}
});
};
/*------------------派加接口相关 end-----------------------*/
/*------------------图片路径转换 start---------------------*/
as.getJpgCdnUrl = function (imgUrl, callback) {
as.jpgCdn.getJpgCDNUrl({
"param": {
"imgUrl": imgUrl
},
"success": function (res) {
if (res && res.success) {
if (typeof callback == "function") callback(res.content);
} else {
if (typeof callback == "function") callback(null);
}
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
as.getCdnImg = function (imgName, callback) {
if (typeof callback == "function")
callback(as.jpgCdn.getCDNImg(imgName));
};
as.designImg = function (imgName, height, callback) {
if (typeof callback == "function")
callback(as.jpgCdn.designImg(imgName, height));
};
/*------------------图片路径转换 end-----------------------*/
/*------------------上传照片相关 start---------------------*/
as.uploadBase64 = function (base64, callback) {
as.file.uploadBase64(base64, as.AppID, {
"success": function (res) {
var obj = {
"result": true,
"data": res
};
if (typeof callback == "function") callback(obj);
},
"error": function (res) {
if (typeof callback == "function") callback({
"result": false
});
}
});
};
/*------------------上传照片相关 end-----------------------*/
/*------------------微信语音 start---------------------*/
//开始录音
as.startRecord = function (callback) {
if (typeof wx != "undefined" && wx != void 0) {
var completeFn = function (res) {
if (res["errMsg"] == "startRecord:ok") {
if (typeof callback == "function") callback(true);
}
}
wx.startRecord({
cancel: function () {
alert('用户拒绝授权录音');
if (typeof callback == "function") callback(false);
},
complete: completeFn,
});
// if (typeof callback == "function") callback(true);
} else {
if (typeof callback == "function") callback(false);
}
};
//停止录音
as.stopRecord = function (callback) {
if (typeof wx != "undefined" && wx != void 0) {
wx.stopRecord({
success: function (res) {
if (typeof callback == "function") callback(res.localId);
}
});
} else {
if (typeof callback == "function") callback("");
}
};
//上传语音到微信服务器
as.uploadVoice = function (localId, callback) {
if (typeof wx != "undefined" && wx != void 0 && localId != "") {
wx.uploadVoice({
"localId": localId, // 需要上传的音频的本地ID,由stopRecord接口获得
"isShowProgressTips": 1, // 默认为1,显示进度提示
"success": function (res) {
if (typeof callback == "function") callback(res.serverId);
}
});
} else {
if (typeof callback == "function") callback("");
}
};
//下载微信服务语音到本地
as.downloadVoice = function (serverId, callback) {
if (typeof wx != "undefined" && wx != void 0 && serverId != "") {
wx.downloadVoice({
"serverId": serverId, // 需要下载的音频的服务器端ID,由uploadVoice接口获得
"isShowProgressTips": 1, // 默认为1,显示进度提示
"success": function (res) {
if (res && res.localId) {
if (typeof callback === "function") callback(res.localId);
} else {
if (typeof callback === "function") callback("");
}
}
});
} else {
if (typeof callback === "function") callback("");
}
};
//保存录音
as.saveUserVoice = function (vid, serverId, callback) {
as.wxMultimedia.record({
"param": {
"vId": vid,
"serverId": serverId
},
"success": function (res) {
if (res && res.code == 10000) {
if (typeof callback == "function") callback(true);
} else {
if (typeof callback == "function") callback(false);
}
},
"error": function (res) {
if (typeof callback == "function") callback(false);
}
});
};
//读取单个录音
as.getUserVoice = function (vid, callback) {
try {
as.wxMultimedia.get({
"param": {
"vId": vid
},
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
} catch (e) {
if (typeof callback == "function") callback(null);
}
};
//播放声音
as.playVoice = function (localId, voiceStatus, voiceUrl, serverId, callback) {
if (localId != "") {
as.playRecord(localId, function () {
if (typeof callback == "function") callback(true, null);
});
} else if ((voiceStatus == "CONVERT_SUCCESS" || voiceStatus == 6) && voiceUrl != "") {
var dom = document.getElementsByTagName("body")[0];
var nDiv = document.createElement("div");
nDiv.style.width = "0px";
nDiv.style.height = "0px";
nDiv.style.position = "absolute";
var sound = document.createElement("audio");
sound.src = voiceUrl;
//sound.preload= "preload";
//sound.src = src;
nDiv.appendChild(sound);
dom.appendChild(nDiv);
sound.addEventListener("ended", function () {
if (typeof callback === "function") callback(true, null);
}, false);
sound.play();
} else if (serverId != "") {
as.downloadVoice(serverId, function (res) {
as.playRecord(res, function () {
if (typeof callback == "function") callback(true, res);
});
});
} else {
if (typeof callback === "function") callback(false, null);
}
};
//播放录音(微信)
as.playRecord = function (localId, callback) {
if (typeof wx != "undefined" && wx != void 0 && localId != "") {
wx.playVoice({
localId: localId // 需要播放的音频的本地ID,由stopRecord接口获得
});
wx.onVoicePlayEnd({
success: function (res) {
if (typeof callback === "function") callback(true);
}
});
} else {
if (typeof callback === "function") callback(false);
}
};
//停止播放录音(微信)
as.stopVoice = function (localId) {
if (typeof wx != "undefined" && wx != void 0 && localId != "") {
wx.stopVoice({
localId: localId
});
}
};
/*------------------微信语音 end---------------------*/
/*------------------其它 start---------------------*/
/*
* tableName 要存的表的名字
* data 为字典结构
* 例如 data = {}
* data["key"] = value;
*/
as.saveTable = function (tableName, value, callback) {
var table = HDP.getTable(tableName);
for (var key in value) {
table.set(key, value[key]);
}
table.save({
"success": function (res) {
if (typeof callback == "function") callback(res);
},
"error": function (res) {
if (typeof callback == "function") callback(null);
}
});
};
/*------------------其它 end-----------------------*/
/*------------------ 以下为定制化接口 ---------------------*/
as.bizInterface = null;
//多奖池抽奖
as.bizManyLottery = function (appId, callback) {
if (as.bizInterface == null) {
as.bizInterface = HDP.getBizInterface();
}
if (appId == undefined || appId == null || appId == "") {
if (typeof callback == "function") callback({
"result": false
});
}
as.bizInterface.manyLottery({
"param": {
"appId": appId
},
"success": function (res) {
if (res && res.success && res.content) {
if (typeof callback == "function") callback(res.content);
} else {
if (typeof callback == "function") callback({
"result": false
});
}
},
"error": function (res) {
if (typeof callback == "function") callback({
"result": false
});
}
});
};
// module.exports = as;
This diff could not be displayed because it is too large.
!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(this,function(e,n){function i(n,i,t){e.WeixinJSBridge?WeixinJSBridge.invoke(n,o(i),function(e){c(n,e,t)}):u(n,t)}function t(n,i,t){e.WeixinJSBridge?WeixinJSBridge.on(n,function(e){t&&t.trigger&&t.trigger(e),c(n,e,i)}):t?u(n,t):u(n,i)}function o(e){return e=e||{},e.appId=P.appId,e.verifyAppId=P.appId,e.verifySignType="sha1",e.verifyTimestamp=P.timestamp+"",e.verifyNonceStr=P.nonceStr,e.verifySignature=P.signature,e}function r(e){return{timeStamp:e.timestamp+"",nonceStr:e.nonceStr,package:e.package,paySign:e.paySign,signType:e.signType||"SHA1"}}function a(e){return e.postalCode=e.addressPostalCode,delete e.addressPostalCode,e.provinceName=e.proviceFirstStageName,delete e.proviceFirstStageName,e.cityName=e.addressCitySecondStageName,delete e.addressCitySecondStageName,e.countryName=e.addressCountiesThirdStageName,delete e.addressCountiesThirdStageName,e.detailInfo=e.addressDetailInfo,delete e.addressDetailInfo,e}function c(e,n,i){"openEnterpriseChat"==e&&(n.errCode=n.err_code),delete n.err_code,delete n.err_desc,delete n.err_detail;var t=n.errMsg;t||(t=n.err_msg,delete n.err_msg,t=s(e,t),n.errMsg=t),(i=i||{})._complete&&(i._complete(n),delete i._complete),t=n.errMsg||"",P.debug&&!i.isInnerInvoke&&alert(JSON.stringify(n));var o=t.indexOf(":");switch(t.substring(o+1)){case"ok":i.success&&i.success(n);break;case"cancel":i.cancel&&i.cancel(n);break;default:i.fail&&i.fail(n)}i.complete&&i.complete(n)}function s(e,n){var i=e,t=h[i];t&&(i=t);var o="ok";if(n){var r=n.indexOf(":");"confirm"==(o=n.substring(r+1))&&(o="ok"),"failed"==o&&(o="fail"),-1!=o.indexOf("failed_")&&(o=o.substring(7)),-1!=o.indexOf("fail_")&&(o=o.substring(5)),"access denied"!=(o=(o=o.replace(/_/g," ")).toLowerCase())&&"no permission to execute"!=o||(o="permission denied"),"config"==i&&"function not exist"==o&&(o="ok"),""==o&&(o="fail")}return n=i+":"+o}function d(e){if(e){for(var n=0,i=e.length;n<i;++n){var t=e[n],o=g[t];o&&(e[n]=o)}return e}}function u(e,n){if(!(!P.debug||n&&n.isInnerInvoke)){var i=h[e];i&&(e=i),n&&n._complete&&delete n._complete,console.log('"'+e+'",',n||"")}}function l(e){if(!(I||T||P.debug||C<"6.0.2"||x.systemType<0)){var n=new Image;x.appId=P.appId,x.initTime=V.initEndTime-V.initStartTime,x.preVerifyTime=V.preVerifyEndTime-V.preVerifyStartTime,b.getNetworkType({isInnerInvoke:!0,success:function(e){x.networkType=e.networkType;var i="https://open.weixin.qq.com/sdk/report?v="+x.version+"&o="+x.isPreVerifyOk+"&s="+x.systemType+"&c="+x.clientVersion+"&a="+x.appId+"&n="+x.networkType+"&i="+x.initTime+"&p="+x.preVerifyTime+"&u="+x.url;n.src=i}})}}function p(){return(new Date).getTime()}function f(n){w&&(e.WeixinJSBridge?n():S.addEventListener&&S.addEventListener("WeixinJSBridgeReady",n,!1))}function m(){b.invoke||(b.invoke=function(n,i,t){e.WeixinJSBridge&&WeixinJSBridge.invoke(n,o(i),t)},b.on=function(n,i){e.WeixinJSBridge&&WeixinJSBridge.on(n,i)})}if(!e.jWeixin){var g={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},h=function(){var e={};for(var n in g)e[g[n]]=n;return e}(),S=e.document,y=S.title,v=navigator.userAgent.toLowerCase(),_=navigator.platform.toLowerCase(),I=!(!_.match("mac")&&!_.match("win")),T=-1!=v.indexOf("wxdebugger"),w=-1!=v.indexOf("micromessenger"),k=-1!=v.indexOf("android"),M=-1!=v.indexOf("iphone")||-1!=v.indexOf("ipad"),C=function(){var e=v.match(/micromessenger\/(\d+\.\d+\.\d+)/)||v.match(/micromessenger\/(\d+\.\d+)/);return e?e[1]:""}(),V={initStartTime:p(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},x={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:M?1:k?2:-1,clientVersion:C,url:encodeURIComponent(location.href)},P={},A={_completes:[]},B={state:0,data:{}};f(function(){V.initEndTime=p()});var b={config:function(e){P=e,u("config",e);var n=!1!==P.check;f(function(){if(n)i(g.config,{verifyJsApiList:d(P.jsApiList)},function(){A._complete=function(e){V.preVerifyEndTime=p(),B.state=1,B.data=e},A.success=function(e){x.isPreVerifyOk=0},A.fail=function(e){A._fail?A._fail(e):B.state=-1};var e=A._completes;return e.push(function(){l()}),A.complete=function(n){for(var i=0,t=e.length;i<t;++i)e[i]();A._completes=[]},A}()),V.preVerifyStartTime=p();else{B.state=1;for(var e=A._completes,t=0,o=e.length;t<o;++t)e[t]();A._completes=[]}}),P.beta&&m()},ready:function(e){0!=B.state?e():(A._completes.push(e),!w&&P.debug&&e())},error:function(e){C<"6.0.2"||(-1==B.state?e(B.data):A._fail=e)},checkJsApi:function(e){var n=function(e){var n=e.checkResult;for(var i in n){var t=h[i];t&&(n[t]=n[i],delete n[i])}return e};i("checkJsApi",{jsApiList:d(e.jsApiList)},(e._complete=function(e){if(k){var i=e.checkResult;i&&(e.checkResult=JSON.parse(i))}e=n(e)},e))},onMenuShareTimeline:function(e){t(g.onMenuShareTimeline,{complete:function(){i("shareTimeline",{title:e.title||y,desc:e.title||y,img_url:e.imgUrl||"",link:e.link||location.href,type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareAppMessage:function(e){t(g.onMenuShareAppMessage,{complete:function(n){"favorite"===n.scene?i("sendAppMessage",{title:e.title||y,desc:e.desc||"",link:e.link||location.href,img_url:e.imgUrl||"",type:e.type||"link",data_url:e.dataUrl||""}):i("sendAppMessage",{title:e.title||y,desc:e.desc||"",link:e.link||location.href,img_url:e.imgUrl||"",type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareQQ:function(e){t(g.onMenuShareQQ,{complete:function(){i("shareQQ",{title:e.title||y,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareWeibo:function(e){t(g.onMenuShareWeibo,{complete:function(){i("shareWeiboApp",{title:e.title||y,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareQZone:function(e){t(g.onMenuShareQZone,{complete:function(){i("shareQZone",{title:e.title||y,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},startRecord:function(e){i("startRecord",{},e)},stopRecord:function(e){i("stopRecord",{},e)},onVoiceRecordEnd:function(e){t("onVoiceRecordEnd",e)},playVoice:function(e){i("playVoice",{localId:e.localId},e)},pauseVoice:function(e){i("pauseVoice",{localId:e.localId},e)},stopVoice:function(e){i("stopVoice",{localId:e.localId},e)},onVoicePlayEnd:function(e){t("onVoicePlayEnd",e)},uploadVoice:function(e){i("uploadVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadVoice:function(e){i("downloadVoice",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},translateVoice:function(e){i("translateVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},chooseImage:function(e){i("chooseImage",{scene:"1|2",count:e.count||9,sizeType:e.sizeType||["original","compressed"],sourceType:e.sourceType||["album","camera"]},(e._complete=function(e){if(k){var n=e.localIds;try{n&&(e.localIds=JSON.parse(n))}catch(e){}}},e))},previewImage:function(e){i(g.previewImage,{current:e.current,urls:e.urls},e)},uploadImage:function(e){i("uploadImage",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadImage:function(e){i("downloadImage",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},getNetworkType:function(e){var n=function(e){var n=e.errMsg;e.errMsg="getNetworkType:ok";var i=e.subtype;if(delete e.subtype,i)e.networkType=i;else{var t=n.indexOf(":"),o=n.substring(t+1);switch(o){case"wifi":case"edge":case"wwan":e.networkType=o;break;default:e.errMsg="getNetworkType:fail"}}return e};i("getNetworkType",{},(e._complete=function(e){e=n(e)},e))},openLocation:function(e){i("openLocation",{latitude:e.latitude,longitude:e.longitude,name:e.name||"",address:e.address||"",scale:e.scale||28,infoUrl:e.infoUrl||""},e)},getLocation:function(e){e=e||{},i(g.getLocation,{type:e.type||"wgs84"},(e._complete=function(e){delete e.type},e))},hideOptionMenu:function(e){i("hideOptionMenu",{},e)},showOptionMenu:function(e){i("showOptionMenu",{},e)},closeWindow:function(e){i("closeWindow",{},e=e||{})},hideMenuItems:function(e){i("hideMenuItems",{menuList:e.menuList},e)},showMenuItems:function(e){i("showMenuItems",{menuList:e.menuList},e)},hideAllNonBaseMenuItem:function(e){i("hideAllNonBaseMenuItem",{},e)},showAllNonBaseMenuItem:function(e){i("showAllNonBaseMenuItem",{},e)},scanQRCode:function(e){i("scanQRCode",{needResult:(e=e||{}).needResult||0,scanType:e.scanType||["qrCode","barCode"]},(e._complete=function(e){if(M){var n=e.resultStr;if(n){var i=JSON.parse(n);e.resultStr=i&&i.scan_code&&i.scan_code.scan_result}}},e))},openAddress:function(e){i(g.openAddress,{},(e._complete=function(e){e=a(e)},e))},openProductSpecificView:function(e){i(g.openProductSpecificView,{pid:e.productId,view_type:e.viewType||0,ext_info:e.extInfo},e)},addCard:function(e){for(var n=e.cardList,t=[],o=0,r=n.length;o<r;++o){var a=n[o],c={card_id:a.cardId,card_ext:a.cardExt};t.push(c)}i(g.addCard,{card_list:t},(e._complete=function(e){var n=e.card_list;if(n){for(var i=0,t=(n=JSON.parse(n)).length;i<t;++i){var o=n[i];o.cardId=o.card_id,o.cardExt=o.card_ext,o.isSuccess=!!o.is_succ,delete o.card_id,delete o.card_ext,delete o.is_succ}e.cardList=n,delete e.card_list}},e))},chooseCard:function(e){i("chooseCard",{app_id:P.appId,location_id:e.shopId||"",sign_type:e.signType||"SHA1",card_id:e.cardId||"",card_type:e.cardType||"",card_sign:e.cardSign,time_stamp:e.timestamp+"",nonce_str:e.nonceStr},(e._complete=function(e){e.cardList=e.choose_card_info,delete e.choose_card_info},e))},openCard:function(e){for(var n=e.cardList,t=[],o=0,r=n.length;o<r;++o){var a=n[o],c={card_id:a.cardId,code:a.code};t.push(c)}i(g.openCard,{card_list:t},e)},consumeAndShareCard:function(e){i(g.consumeAndShareCard,{consumedCardId:e.cardId,consumedCode:e.code},e)},chooseWXPay:function(e){i(g.chooseWXPay,r(e),e)},openEnterpriseRedPacket:function(e){i(g.openEnterpriseRedPacket,r(e),e)},startSearchBeacons:function(e){i(g.startSearchBeacons,{ticket:e.ticket},e)},stopSearchBeacons:function(e){i(g.stopSearchBeacons,{},e)},onSearchBeacons:function(e){t(g.onSearchBeacons,e)},openEnterpriseChat:function(e){i("openEnterpriseChat",{useridlist:e.userIds,chatname:e.groupName},e)}};return n&&(e.wx=e.jWeixin=b),b}});
\ No newline at end of file