1.表单功能
2.打点统计
Showing
15 changed files
with
2670 additions
and
310 deletions
| 1 | module.exports = { | 1 | // module.exports = { |
| 2 | root: true, | 2 | // root: true, |
| 3 | parserOptions: { | 3 | // parserOptions: { |
| 4 | parser: 'babel-eslint', | 4 | // parser: 'babel-eslint', |
| 5 | sourceType: 'module' | 5 | // sourceType: 'module' |
| 6 | }, | 6 | // }, |
| 7 | env: { | 7 | // env: { |
| 8 | browser: true, | 8 | // browser: true, |
| 9 | node: true, | 9 | // node: true, |
| 10 | es6: true, | 10 | // es6: true, |
| 11 | }, | 11 | // }, |
| 12 | extends: ['plugin:vue/recommended', 'eslint:recommended'], | 12 | // extends: ['plugin:vue/recommended', 'eslint:recommended'], |
| 13 | 13 | ||
| 14 | // add your custom rules here | 14 | // // add your custom rules here |
| 15 | //it is base on https://github.com/vuejs/eslint-config-vue | 15 | // //it is base on https://github.com/vuejs/eslint-config-vue |
| 16 | rules: { | 16 | // rules: { |
| 17 | "vue/max-attributes-per-line": [2, { | 17 | // "vue/max-attributes-per-line": [2, { |
| 18 | "singleline": 10, | 18 | // "singleline": 10, |
| 19 | "multiline": { | 19 | // "multiline": { |
| 20 | "max": 1, | 20 | // "max": 1, |
| 21 | "allowFirstLine": false | 21 | // "allowFirstLine": false |
| 22 | } | 22 | // } |
| 23 | }], | 23 | // }], |
| 24 | "vue/name-property-casing": ["error", "PascalCase"], | 24 | // "vue/name-property-casing": ["error", "PascalCase"], |
| 25 | 'accessor-pairs': 2, | 25 | // 'accessor-pairs': 2, |
| 26 | 'arrow-spacing': [2, { | 26 | // 'arrow-spacing': [2, { |
| 27 | 'before': true, | 27 | // 'before': true, |
| 28 | 'after': true | 28 | // 'after': true |
| 29 | }], | 29 | // }], |
| 30 | 'block-spacing': [2, 'always'], | 30 | // 'block-spacing': [2, 'always'], |
| 31 | 'brace-style': [2, '1tbs', { | 31 | // 'brace-style': [2, '1tbs', { |
| 32 | 'allowSingleLine': true | 32 | // 'allowSingleLine': true |
| 33 | }], | 33 | // }], |
| 34 | 'camelcase': [0, { | 34 | // 'camelcase': [0, { |
| 35 | 'properties': 'always' | 35 | // 'properties': 'always' |
| 36 | }], | 36 | // }], |
| 37 | 'comma-dangle': [2, 'never'], | 37 | // 'comma-dangle': [2, 'never'], |
| 38 | 'comma-spacing': [2, { | 38 | // 'comma-spacing': [2, { |
| 39 | 'before': false, | 39 | // 'before': false, |
| 40 | 'after': true | 40 | // 'after': true |
| 41 | }], | 41 | // }], |
| 42 | 'comma-style': [2, 'last'], | 42 | // 'comma-style': [2, 'last'], |
| 43 | 'constructor-super': 2, | 43 | // 'constructor-super': 2, |
| 44 | 'curly': [2, 'multi-line'], | 44 | // 'curly': [2, 'multi-line'], |
| 45 | 'dot-location': [2, 'property'], | 45 | // 'dot-location': [2, 'property'], |
| 46 | 'eol-last': 2, | 46 | // 'eol-last': 2, |
| 47 | 'eqeqeq': [2, 'allow-null'], | 47 | // 'eqeqeq': [2, 'allow-null'], |
| 48 | 'generator-star-spacing': [2, { | 48 | // 'generator-star-spacing': [2, { |
| 49 | 'before': true, | 49 | // 'before': true, |
| 50 | 'after': true | 50 | // 'after': true |
| 51 | }], | 51 | // }], |
| 52 | 'handle-callback-err': [2, '^(err|error)$'], | 52 | // 'handle-callback-err': [2, '^(err|error)$'], |
| 53 | 'indent': [2, 2, { | 53 | // 'indent': [2, 2, { |
| 54 | 'SwitchCase': 1 | 54 | // 'SwitchCase': 1 |
| 55 | }], | 55 | // }], |
| 56 | 'jsx-quotes': [2, 'prefer-single'], | 56 | // 'jsx-quotes': [2, 'prefer-single'], |
| 57 | 'key-spacing': [2, { | 57 | // 'key-spacing': [2, { |
| 58 | 'beforeColon': false, | 58 | // 'beforeColon': false, |
| 59 | 'afterColon': true | 59 | // 'afterColon': true |
| 60 | }], | 60 | // }], |
| 61 | 'keyword-spacing': [2, { | 61 | // 'keyword-spacing': [2, { |
| 62 | 'before': true, | 62 | // 'before': true, |
| 63 | 'after': true | 63 | // 'after': true |
| 64 | }], | 64 | // }], |
| 65 | 'new-cap': [2, { | 65 | // 'new-cap': [2, { |
| 66 | 'newIsCap': true, | 66 | // 'newIsCap': true, |
| 67 | 'capIsNew': false | 67 | // 'capIsNew': false |
| 68 | }], | 68 | // }], |
| 69 | 'new-parens': 2, | 69 | // 'new-parens': 2, |
| 70 | 'no-array-constructor': 2, | 70 | // 'no-array-constructor': 2, |
| 71 | 'no-caller': 2, | 71 | // 'no-caller': 2, |
| 72 | 'no-console': 'off', | 72 | // 'no-console': 'off', |
| 73 | 'no-class-assign': 2, | 73 | // 'no-class-assign': 2, |
| 74 | 'no-cond-assign': 2, | 74 | // 'no-cond-assign': 2, |
| 75 | 'no-const-assign': 2, | 75 | // 'no-const-assign': 2, |
| 76 | 'no-control-regex': 2, | 76 | // 'no-control-regex': 2, |
| 77 | 'no-delete-var': 2, | 77 | // 'no-delete-var': 2, |
| 78 | 'no-dupe-args': 2, | 78 | // 'no-dupe-args': 2, |
| 79 | 'no-dupe-class-members': 2, | 79 | // 'no-dupe-class-members': 2, |
| 80 | 'no-dupe-keys': 2, | 80 | // 'no-dupe-keys': 2, |
| 81 | 'no-duplicate-case': 2, | 81 | // 'no-duplicate-case': 2, |
| 82 | 'no-empty-character-class': 2, | 82 | // 'no-empty-character-class': 2, |
| 83 | 'no-empty-pattern': 2, | 83 | // 'no-empty-pattern': 2, |
| 84 | 'no-eval': 2, | 84 | // 'no-eval': 2, |
| 85 | 'no-ex-assign': 2, | 85 | // 'no-ex-assign': 2, |
| 86 | 'no-extend-native': 2, | 86 | // 'no-extend-native': 2, |
| 87 | 'no-extra-bind': 2, | 87 | // 'no-extra-bind': 2, |
| 88 | 'no-extra-boolean-cast': 2, | 88 | // 'no-extra-boolean-cast': 2, |
| 89 | 'no-extra-parens': [2, 'functions'], | 89 | // 'no-extra-parens': [2, 'functions'], |
| 90 | 'no-fallthrough': 2, | 90 | // 'no-fallthrough': 2, |
| 91 | 'no-floating-decimal': 2, | 91 | // 'no-floating-decimal': 2, |
| 92 | 'no-func-assign': 2, | 92 | // 'no-func-assign': 2, |
| 93 | 'no-implied-eval': 2, | 93 | // 'no-implied-eval': 2, |
| 94 | 'no-inner-declarations': [2, 'functions'], | 94 | // 'no-inner-declarations': [2, 'functions'], |
| 95 | 'no-invalid-regexp': 2, | 95 | // 'no-invalid-regexp': 2, |
| 96 | 'no-irregular-whitespace': 2, | 96 | // 'no-irregular-whitespace': 2, |
| 97 | 'no-iterator': 2, | 97 | // 'no-iterator': 2, |
| 98 | 'no-label-var': 2, | 98 | // 'no-label-var': 2, |
| 99 | 'no-labels': [2, { | 99 | // 'no-labels': [2, { |
| 100 | 'allowLoop': false, | 100 | // 'allowLoop': false, |
| 101 | 'allowSwitch': false | 101 | // 'allowSwitch': false |
| 102 | }], | 102 | // }], |
| 103 | 'no-lone-blocks': 2, | 103 | // 'no-lone-blocks': 2, |
| 104 | 'no-mixed-spaces-and-tabs': 2, | 104 | // 'no-mixed-spaces-and-tabs': 2, |
| 105 | 'no-multi-spaces': 2, | 105 | // 'no-multi-spaces': 2, |
| 106 | 'no-multi-str': 2, | 106 | // 'no-multi-str': 2, |
| 107 | 'no-multiple-empty-lines': [2, { | 107 | // 'no-multiple-empty-lines': [2, { |
| 108 | 'max': 1 | 108 | // 'max': 1 |
| 109 | }], | 109 | // }], |
| 110 | 'no-native-reassign': 2, | 110 | // 'no-native-reassign': 2, |
| 111 | 'no-negated-in-lhs': 2, | 111 | // 'no-negated-in-lhs': 2, |
| 112 | 'no-new-object': 2, | 112 | // 'no-new-object': 2, |
| 113 | 'no-new-require': 2, | 113 | // 'no-new-require': 2, |
| 114 | 'no-new-symbol': 2, | 114 | // 'no-new-symbol': 2, |
| 115 | 'no-new-wrappers': 2, | 115 | // 'no-new-wrappers': 2, |
| 116 | 'no-obj-calls': 2, | 116 | // 'no-obj-calls': 2, |
| 117 | 'no-octal': 2, | 117 | // 'no-octal': 2, |
| 118 | 'no-octal-escape': 2, | 118 | // 'no-octal-escape': 2, |
| 119 | 'no-path-concat': 2, | 119 | // 'no-path-concat': 2, |
| 120 | 'no-proto': 2, | 120 | // 'no-proto': 2, |
| 121 | 'no-redeclare': 2, | 121 | // 'no-redeclare': 2, |
| 122 | 'no-regex-spaces': 2, | 122 | // 'no-regex-spaces': 2, |
| 123 | 'no-return-assign': [2, 'except-parens'], | 123 | // 'no-return-assign': [2, 'except-parens'], |
| 124 | 'no-self-assign': 2, | 124 | // 'no-self-assign': 2, |
| 125 | 'no-self-compare': 2, | 125 | // 'no-self-compare': 2, |
| 126 | 'no-sequences': 2, | 126 | // 'no-sequences': 2, |
| 127 | 'no-shadow-restricted-names': 2, | 127 | // 'no-shadow-restricted-names': 2, |
| 128 | 'no-spaced-func': 2, | 128 | // 'no-spaced-func': 2, |
| 129 | 'no-sparse-arrays': 2, | 129 | // 'no-sparse-arrays': 2, |
| 130 | 'no-this-before-super': 2, | 130 | // 'no-this-before-super': 2, |
| 131 | 'no-throw-literal': 2, | 131 | // 'no-throw-literal': 2, |
| 132 | 'no-trailing-spaces': 2, | 132 | // 'no-trailing-spaces': 2, |
| 133 | 'no-undef': 2, | 133 | // 'no-undef': 2, |
| 134 | 'no-undef-init': 2, | 134 | // 'no-undef-init': 2, |
| 135 | 'no-unexpected-multiline': 2, | 135 | // 'no-unexpected-multiline': 2, |
| 136 | 'no-unmodified-loop-condition': 2, | 136 | // 'no-unmodified-loop-condition': 2, |
| 137 | 'no-unneeded-ternary': [2, { | 137 | // 'no-unneeded-ternary': [2, { |
| 138 | 'defaultAssignment': false | 138 | // 'defaultAssignment': false |
| 139 | }], | 139 | // }], |
| 140 | 'no-unreachable': 2, | 140 | // 'no-unreachable': 2, |
| 141 | 'no-unsafe-finally': 2, | 141 | // 'no-unsafe-finally': 2, |
| 142 | 'no-unused-vars': [2, { | 142 | // 'no-unused-vars': [2, { |
| 143 | 'vars': 'all', | 143 | // 'vars': 'all', |
| 144 | 'args': 'none' | 144 | // 'args': 'none' |
| 145 | }], | 145 | // }], |
| 146 | 'no-useless-call': 2, | 146 | // 'no-useless-call': 2, |
| 147 | 'no-useless-computed-key': 2, | 147 | // 'no-useless-computed-key': 2, |
| 148 | 'no-useless-constructor': 2, | 148 | // 'no-useless-constructor': 2, |
| 149 | 'no-useless-escape': 0, | 149 | // 'no-useless-escape': 0, |
| 150 | 'no-whitespace-before-property': 2, | 150 | // 'no-whitespace-before-property': 2, |
| 151 | 'no-with': 2, | 151 | // 'no-with': 2, |
| 152 | 'one-var': [2, { | 152 | // 'one-var': [2, { |
| 153 | 'initialized': 'never' | 153 | // 'initialized': 'never' |
| 154 | }], | 154 | // }], |
| 155 | 'operator-linebreak': [2, 'after', { | 155 | // 'operator-linebreak': [2, 'after', { |
| 156 | 'overrides': { | 156 | // 'overrides': { |
| 157 | '?': 'before', | 157 | // '?': 'before', |
| 158 | ':': 'before' | 158 | // ':': 'before' |
| 159 | } | 159 | // } |
| 160 | }], | 160 | // }], |
| 161 | 'padded-blocks': [2, 'never'], | 161 | // 'padded-blocks': [2, 'never'], |
| 162 | 'quotes': [2, 'single', { | 162 | // 'quotes': [2, 'single', { |
| 163 | 'avoidEscape': true, | 163 | // 'avoidEscape': true, |
| 164 | 'allowTemplateLiterals': true | 164 | // 'allowTemplateLiterals': true |
| 165 | }], | 165 | // }], |
| 166 | 'semi': [2, 'never'], | 166 | // 'semi': [2, 'never'], |
| 167 | 'semi-spacing': [2, { | 167 | // 'semi-spacing': [2, { |
| 168 | 'before': false, | 168 | // 'before': false, |
| 169 | 'after': true | 169 | // 'after': true |
| 170 | }], | 170 | // }], |
| 171 | 'space-before-blocks': [2, 'always'], | 171 | // 'space-before-blocks': [2, 'always'], |
| 172 | 'space-before-function-paren': [2, 'never'], | 172 | // 'space-before-function-paren': [2, 'never'], |
| 173 | 'space-in-parens': [2, 'never'], | 173 | // 'space-in-parens': [2, 'never'], |
| 174 | 'space-infix-ops': 2, | 174 | // 'space-infix-ops': 2, |
| 175 | 'space-unary-ops': [2, { | 175 | // 'space-unary-ops': [2, { |
| 176 | 'words': true, | 176 | // 'words': true, |
| 177 | 'nonwords': false | 177 | // 'nonwords': false |
| 178 | }], | 178 | // }], |
| 179 | 'spaced-comment': [2, 'always', { | 179 | // 'spaced-comment': [2, 'always', { |
| 180 | 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] | 180 | // 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] |
| 181 | }], | 181 | // }], |
| 182 | 'template-curly-spacing': [2, 'never'], | 182 | // 'template-curly-spacing': [2, 'never'], |
| 183 | 'use-isnan': 2, | 183 | // 'use-isnan': 2, |
| 184 | 'valid-typeof': 2, | 184 | // 'valid-typeof': 2, |
| 185 | 'wrap-iife': [2, 'any'], | 185 | // 'wrap-iife': [2, 'any'], |
| 186 | 'yield-star-spacing': [2, 'both'], | 186 | // 'yield-star-spacing': [2, 'both'], |
| 187 | 'yoda': [2, 'never'], | 187 | // 'yoda': [2, 'never'], |
| 188 | 'prefer-const': 2, | 188 | // 'prefer-const': 2, |
| 189 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | 189 | // 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, |
| 190 | 'object-curly-spacing': [2, 'always', { | 190 | // 'object-curly-spacing': [2, 'always', { |
| 191 | objectsInObjects: false | 191 | // objectsInObjects: false |
| 192 | }], | 192 | // }], |
| 193 | 'array-bracket-spacing': [2, 'never'] | 193 | // 'array-bracket-spacing': [2, 'never'] |
| 194 | } | 194 | // } |
| 195 | } | 195 | // } |
| 196 | 196 | ... | ... |
| 1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
| 2 | <html> | 2 | <html> |
| 3 | <head> | 3 | |
| 4 | <meta charset="utf-8"> | 4 | <head> |
| 5 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> | 5 | <meta charset="utf-8"> |
| 6 | <title>天宝公众号</title> | 6 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
| 7 | </head> | 7 | <title>天宝公众号</title> |
| 8 | <body> | 8 | </head> |
| 9 | <div id="app"></div> | 9 | |
| 10 | <!-- built files will be auto injected --> | 10 | <body> |
| 11 | </body> | 11 | |
| 12 | <script src="./static/js/weixin-1.1.0.js"></script> | ||
| 13 | <script src="./static/js/hdp-4.4.0.min.js"></script> | ||
| 14 | <script src="./static/js/as.js"></script> | ||
| 15 | <div id="app"></div> | ||
| 16 | <!-- built files will be auto injected --> | ||
| 17 | </body> | ||
| 18 | |||
| 12 | </html> | 19 | </html> | ... | ... |
| ... | @@ -9,3 +9,66 @@ export default { | ... | @@ -9,3 +9,66 @@ export default { |
| 9 | name: 'App' | 9 | name: 'App' |
| 10 | } | 10 | } |
| 11 | </script> | 11 | </script> |
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | <style lang="scss"> | ||
| 16 | // @import "./styles/common"; | ||
| 17 | // @import "./styles/vars"; | ||
| 18 | body { | ||
| 19 | margin: 0px; | ||
| 20 | padding: 0px; | ||
| 21 | // background: @color-primary; | ||
| 22 | // font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, | ||
| 23 | // Microsoft YaHei, SimSun, sans-serif; | ||
| 24 | // font-size: 14px; | ||
| 25 | // -webkit-font-smoothing: antialiased; | ||
| 26 | } | ||
| 27 | |||
| 28 | #app { | ||
| 29 | position: absolute; | ||
| 30 | top: 0px; | ||
| 31 | bottom: 0px; | ||
| 32 | width: 100%; | ||
| 33 | } | ||
| 34 | |||
| 35 | .el-submenu [class^="fa"] { | ||
| 36 | vertical-align: baseline; | ||
| 37 | margin-right: 10px; | ||
| 38 | } | ||
| 39 | |||
| 40 | .el-menu-item [class^="fa"] { | ||
| 41 | vertical-align: baseline; | ||
| 42 | margin-right: 10px; | ||
| 43 | } | ||
| 44 | |||
| 45 | .toolbar { | ||
| 46 | background: #f2f2f2; | ||
| 47 | padding: 10px; | ||
| 48 | margin: 10px 0px; | ||
| 49 | .el-form-item { | ||
| 50 | margin-bottom: 10px; | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | .fade-enter-active, | ||
| 55 | .fade-leave-active { | ||
| 56 | transition: all 0.2s ease; | ||
| 57 | } | ||
| 58 | |||
| 59 | .fade-enter, | ||
| 60 | .fade-leave-active { | ||
| 61 | opacity: 0; | ||
| 62 | } | ||
| 63 | |||
| 64 | .avatar-wrap { | ||
| 65 | display: flex; | ||
| 66 | justify-content: flex-start; | ||
| 67 | align-items: center; | ||
| 68 | .avatar { | ||
| 69 | width: 40px; | ||
| 70 | height: 40px; | ||
| 71 | } | ||
| 72 | } | ||
| 73 | |||
| 74 | </style> | ... | ... |
| 1 | module.exports = { | 1 | module.exports = { |
| 2 | testListGet: '/xxx/xxx/list' | ||
| 3 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 2 | testListGet: '/xxx/xxx/list', | ||
| 3 | exportTable: exportTable, | ||
| 4 | } | ||
| 5 | |||
| 6 | function exportTable(params) { | ||
| 7 | let url = 'https://api.k.wxpai.cn/awp/plugins/export/' + params.func + '?id=' + params.appId + '&key=' + params.appKey + '&val=' + params.data; | ||
| 8 | console.log("url:", url); | ||
| 9 | window.open(url) | ||
| 10 | } | ... | ... |
src/common/utils.js
0 → 100644
| 1 | /** | ||
| 2 | * 获取当前链接参数 | ||
| 3 | * @param {*} name | ||
| 4 | */ | ||
| 5 | export const getLinkParam = name => { | ||
| 6 | return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null; | ||
| 7 | }; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * 去掉字符串两端空格 trim | ||
| 11 | * @param {string} str | ||
| 12 | */ | ||
| 13 | export const trim = str => { | ||
| 14 | return str.replace(/(^\s*)|(\s*$)/g, ''); | ||
| 15 | } | ||
| 16 | |||
| 17 | /** | ||
| 18 | * 验证邮箱 | ||
| 19 | * @param {string} str | ||
| 20 | */ | ||
| 21 | export const checkEmail = str => { | ||
| 22 | let re = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; | ||
| 23 | if (re.test(str)) { | ||
| 24 | return true; | ||
| 25 | } else { | ||
| 26 | return false; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | /** | ||
| 31 | * 验证手机 1开头+10位数 | ||
| 32 | * @param {string} str | ||
| 33 | */ | ||
| 34 | export const checkMobile = str => { | ||
| 35 | let re = /^1\d{10}$/; | ||
| 36 | // let re = /^(13[0-9]|14[57]|15[0-9]|17[0-9]|18[0-9])\d{8}$/; //严格模式 | ||
| 37 | if (re.test(str)) { | ||
| 38 | return true; | ||
| 39 | } else { | ||
| 40 | return false; | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 44 | /** | ||
| 45 | * 获取Uuid | ||
| 46 | */ | ||
| 47 | export const uuid = () => { | ||
| 48 | var s = []; | ||
| 49 | var hexDigits = "0123456789abcdef"; | ||
| 50 | for (var i = 0; i < 36; i++) { | ||
| 51 | s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); | ||
| 52 | } | ||
| 53 | s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 | ||
| 54 | s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 | ||
| 55 | s[8] = s[13] = s[18] = s[23] = "-"; | ||
| 56 | |||
| 57 | var uuid = s.join(""); | ||
| 58 | return uuid; | ||
| 59 | } | ||
| 60 | |||
| 61 | |||
| 62 | /** | ||
| 63 | * 设置cookies | ||
| 64 | * @param {*} name | ||
| 65 | * @param {*} value | ||
| 66 | * @param {*} Days | ||
| 67 | */ | ||
| 68 | export const setCookie = (name, value, Days = 0) => { | ||
| 69 | if (Days <= 0) Days = 30; | ||
| 70 | var exp = new Date(); | ||
| 71 | exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); | ||
| 72 | document.cookie = name + "=" + encodeURI(value) + ";expires=" + exp.toUTCString(); | ||
| 73 | } | ||
| 74 | |||
| 75 | |||
| 76 | /** | ||
| 77 | * 获取cookies | ||
| 78 | * @param {*} name | ||
| 79 | * @param {*} value | ||
| 80 | * @param {*} Days | ||
| 81 | */ | ||
| 82 | export const getCookie = (name) => { | ||
| 83 | var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); | ||
| 84 | if (arr = document.cookie.match(reg)) { | ||
| 85 | return decodeURI(arr[2]); | ||
| 86 | } else { | ||
| 87 | return ""; | ||
| 88 | } | ||
| 89 | } | ||
| 90 | |||
| 91 | /** | ||
| 92 | * 删除cookies | ||
| 93 | * @param {*} name | ||
| 94 | */ | ||
| 95 | export const deleteCookie = (name) => { | ||
| 96 | var exp = new Date(); | ||
| 97 | exp.setTime(exp.getTime() - 1); | ||
| 98 | var cval = getCookie(name); | ||
| 99 | if (cval != null) | ||
| 100 | document.cookie = name + "=" + cval + ";expires=" + exp.toUTCString(); | ||
| 101 | } | ||
| 102 | |||
| 103 | /** | ||
| 104 | * 判断是否微信客户端 | ||
| 105 | * @param {*} name | ||
| 106 | */ | ||
| 107 | export const isWeiXin = () => { | ||
| 108 | var ua = window.navigator.userAgent.toLowerCase(); | ||
| 109 | if (ua.match(/MicroMessenger/i) == 'micromessenger') { | ||
| 110 | return true; | ||
| 111 | } else { | ||
| 112 | return false; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | |||
| 117 | /** | ||
| 118 | * 时间戳格式化(yyyy-MM-dd hh:mm:ss) | ||
| 119 | * @param {*} timestamp | ||
| 120 | * @param {*} format | ||
| 121 | */ | ||
| 122 | export const timestampFormat = (timestamp, format) => { | ||
| 123 | Date.prototype.Format = function (fmt) { | ||
| 124 | var o = { | ||
| 125 | "M+": this.getMonth() + 1, //月份 | ||
| 126 | "d+": this.getDate(), //日 | ||
| 127 | "h+": this.getHours(), //小时 | ||
| 128 | "m+": this.getMinutes(), //分 | ||
| 129 | "s+": this.getSeconds(), //秒 | ||
| 130 | "q+": Math.floor((this.getMonth() + 3) / 3), //季度 | ||
| 131 | "S": this.getMilliseconds() //毫秒 | ||
| 132 | }; | ||
| 133 | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); | ||
| 134 | for (var k in o) { | ||
| 135 | if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); | ||
| 136 | } | ||
| 137 | return fmt; | ||
| 138 | } | ||
| 139 | |||
| 140 | if (timestamp && timestamp.length == 10) timestamp += "000"; | ||
| 141 | |||
| 142 | var date = new Date(); | ||
| 143 | if (timestamp) date.setTime(timestamp); | ||
| 144 | if (format == null || format == "") { | ||
| 145 | format = "yyyy-MM-dd hh:mm:ss"; | ||
| 146 | } | ||
| 147 | return date.Format(format); | ||
| 148 | }; | ||
| 149 | |||
| 150 | /** | ||
| 151 | * 日期转时间戳 | ||
| 152 | * @param {*} stringTime | ||
| 153 | */ | ||
| 154 | export const dateParse = stringTime => { | ||
| 155 | if (stringTime) { | ||
| 156 | var date = new Date(stringTime); | ||
| 157 | } else { | ||
| 158 | var date = new Date(); | ||
| 159 | } | ||
| 160 | return Date.parse(date); | ||
| 161 | }; | ||
| 162 | |||
| 163 | |||
| 164 | /** | ||
| 165 | * 生成指定范围内的随机数 | ||
| 166 | * @param {*} min | ||
| 167 | * @param {*} max | ||
| 168 | */ | ||
| 169 | export const getRandom = (min, max) => { | ||
| 170 | var c = max - min + 1; | ||
| 171 | return Math.floor(Math.random() * c + min); | ||
| 172 | }; | ||
| 173 | |||
| 174 | |||
| 175 | /** | ||
| 176 | * 日期格式化 | ||
| 177 | */ | ||
| 178 | export const formatDate = { | ||
| 179 | SIGN_REGEXP: /([yMdhsm])(\1*)/g, | ||
| 180 | DEFAULT_PATTERN: 'yyyy-MM-dd', | ||
| 181 | padding: function (s, len) { | ||
| 182 | var len = len - (s + '').length; | ||
| 183 | for (var i = 0; i < len; i++) { | ||
| 184 | s = '0' + s; | ||
| 185 | } | ||
| 186 | return s; | ||
| 187 | }, | ||
| 188 | format: function (date, pattern) { | ||
| 189 | pattern = pattern || formatDate.DEFAULT_PATTERN; | ||
| 190 | return pattern.replace(formatDate.SIGN_REGEXP, function ($0) { | ||
| 191 | switch ($0.charAt(0)) { | ||
| 192 | case 'y': | ||
| 193 | return formatDate.padding(date.getFullYear(), $0.length); | ||
| 194 | case 'M': | ||
| 195 | return formatDate.padding(date.getMonth() + 1, $0.length); | ||
| 196 | case 'd': | ||
| 197 | return formatDate.padding(date.getDate(), $0.length); | ||
| 198 | case 'w': | ||
| 199 | return date.getDay() + 1; | ||
| 200 | case 'h': | ||
| 201 | return formatDate.padding(date.getHours(), $0.length); | ||
| 202 | case 'm': | ||
| 203 | return formatDate.padding(date.getMinutes(), $0.length); | ||
| 204 | case 's': | ||
| 205 | return formatDate.padding(date.getSeconds(), $0.length); | ||
| 206 | } | ||
| 207 | }); | ||
| 208 | }, | ||
| 209 | parse: function (dateString, pattern) { | ||
| 210 | var matchs1 = pattern.match(formatDate.SIGN_REGEXP); | ||
| 211 | var matchs2 = dateString.match(/(\d)+/g); | ||
| 212 | if (matchs1.length == matchs2.length) { | ||
| 213 | var _date = new Date(1970, 0, 1); | ||
| 214 | for (var i = 0; i < matchs1.length; i++) { | ||
| 215 | var _int = parseInt(matchs2[i]); | ||
| 216 | var sign = matchs1[i]; | ||
| 217 | switch (sign.charAt(0)) { | ||
| 218 | case 'y': | ||
| 219 | _date.setFullYear(_int); | ||
| 220 | break; | ||
| 221 | case 'M': | ||
| 222 | _date.setMonth(_int - 1); | ||
| 223 | break; | ||
| 224 | case 'd': | ||
| 225 | _date.setDate(_int); | ||
| 226 | break; | ||
| 227 | case 'h': | ||
| 228 | _date.setHours(_int); | ||
| 229 | break; | ||
| 230 | case 'm': | ||
| 231 | _date.setMinutes(_int); | ||
| 232 | break; | ||
| 233 | case 's': | ||
| 234 | _date.setSeconds(_int); | ||
| 235 | break; | ||
| 236 | } | ||
| 237 | } | ||
| 238 | return _date; | ||
| 239 | } | ||
| 240 | return null; | ||
| 241 | } | ||
| 242 | |||
| 243 | } |
| ... | @@ -22,131 +22,213 @@ import Layout from '../views/layout/Layout' | ... | @@ -22,131 +22,213 @@ import Layout from '../views/layout/Layout' |
| 22 | breadcrumb: false if false, the item will hidden in breadcrumb(default is true) | 22 | breadcrumb: false if false, the item will hidden in breadcrumb(default is true) |
| 23 | } | 23 | } |
| 24 | **/ | 24 | **/ |
| 25 | export const constantRouterMap = [ | 25 | export const constantRouterMap = [{ |
| 26 | { path: '/login', component: () => import('@/views/login/index'), hidden: true }, | 26 | path: '/login', |
| 27 | { path: '/404', component: () => import('@/views/404'), hidden: true }, | 27 | component: () => import('@/views/login/index'), |
| 28 | 28 | hidden: true | |
| 29 | { | ||
| 30 | path: '/', | ||
| 31 | component: Layout, | ||
| 32 | redirect: '/dashboard', | ||
| 33 | name: 'Dashboard', | ||
| 34 | hidden: true, | ||
| 35 | children: [{ | ||
| 36 | path: 'dashboard', | ||
| 37 | component: () => import('@/views/dashboard/index') | ||
| 38 | }] | ||
| 39 | }, | 29 | }, |
| 40 | /* { | ||
| 41 | path: '/form', | ||
| 42 | component: Layout, | ||
| 43 | children: [ | ||
| 44 | { | ||
| 45 | path: 'index', | ||
| 46 | name: 'Form', | ||
| 47 | component: () => import('@/views/form/index'), | ||
| 48 | meta: { title: 'Form', icon: 'form' } | ||
| 49 | } | ||
| 50 | ] | ||
| 51 | },*/ | ||
| 52 | { | 30 | { |
| 53 | path: '/qrcode', | 31 | path: '/404', |
| 54 | component: Layout, | 32 | component: () => import('@/views/404'), |
| 55 | children: [ | 33 | hidden: true |
| 56 | { | ||
| 57 | path: 'index', | ||
| 58 | name: 'Qrcode', | ||
| 59 | component: () => import('@/views/scene/index'), | ||
| 60 | meta: { title: '订阅信息', icon: 'form' } | ||
| 61 | } | ||
| 62 | ] | ||
| 63 | }, | 34 | }, |
| 64 | 35 | ||
| 36 | // { | ||
| 37 | // path: '/', | ||
| 38 | // component: Layout, | ||
| 39 | // redirect: '/dashboard', | ||
| 40 | // name: 'Dashboard', | ||
| 41 | // hidden: true, | ||
| 42 | // children: [{ | ||
| 43 | // path: 'dashboard', | ||
| 44 | // component: () => import('@/views/dashboard/index') | ||
| 45 | // }] | ||
| 46 | // }, | ||
| 47 | /* { | ||
| 48 | path: '/form', | ||
| 49 | component: Layout, | ||
| 50 | children: [ | ||
| 51 | { | ||
| 52 | path: 'index', | ||
| 53 | name: 'Form', | ||
| 54 | component: () => import('@/views/form/index'), | ||
| 55 | meta: { title: 'Form', icon: 'form' } | ||
| 56 | } | ||
| 57 | ] | ||
| 58 | },*/ | ||
| 65 | 59 | ||
| 66 | 60 | { | |
| 67 | /*{ | 61 | path: '/', |
| 68 | path: '/example', | ||
| 69 | component: Layout, | 62 | component: Layout, |
| 70 | redirect: '/example/table', | 63 | redirect: '/dictionary/reservation', |
| 71 | name: 'Example', | 64 | name: 'dictionary', |
| 72 | meta: { title: 'Example', icon: 'example' }, | 65 | meta: { |
| 73 | children: [ | 66 | title: '天宝宝典', |
| 67 | icon: 'nested' | ||
| 68 | }, | ||
| 69 | children: [{ | ||
| 70 | path: '/dictionary/reservation', | ||
| 71 | name: 'reservation', | ||
| 72 | component: () => import('@/views/dictionary/reservation'), | ||
| 73 | meta: { | ||
| 74 | title: '预约明细', | ||
| 75 | icon: '' | ||
| 76 | } | ||
| 77 | }, | ||
| 74 | { | 78 | { |
| 75 | path: 'table', | 79 | path: '/dictionary/pvpage', |
| 76 | name: 'Table', | 80 | name: 'pvpage', |
| 77 | component: () => import('@/views/table/index'), | 81 | component: () => import('@/views/dictionary/pvpage'), |
| 78 | meta: { title: 'Table', icon: 'table' } | 82 | meta: { |
| 83 | title: '页面访问明细', | ||
| 84 | icon: '' | ||
| 85 | } | ||
| 79 | }, | 86 | }, |
| 80 | { | 87 | { |
| 81 | path: 'tree', | 88 | path: '/dictionary/pvproduct', |
| 82 | name: 'Tree', | 89 | name: 'pvproduct', |
| 83 | component: () => import('@/views/tree/index'), | 90 | component: () => import('@/views/dictionary/pvproduct'), |
| 84 | meta: { title: 'Tree', icon: 'tree' } | 91 | meta: { |
| 85 | } | 92 | title: '产品访问明细', |
| 93 | icon: '' | ||
| 94 | } | ||
| 95 | }, | ||
| 86 | ] | 96 | ] |
| 87 | },*/ | 97 | }, |
| 88 | |||
| 89 | |||
| 90 | /* | ||
| 91 | 98 | ||
| 92 | { | 99 | { |
| 93 | path: '/nested', | 100 | path: '/calculator', |
| 94 | component: Layout, | 101 | component: Layout, |
| 95 | redirect: '/nested/menu1', | 102 | redirect: '/calculator/pvpage', |
| 96 | name: 'Nested', | 103 | name: 'dictionary', |
| 97 | meta: { | 104 | meta: { |
| 98 | title: 'Nested', | 105 | title: '天宝计算器', |
| 99 | icon: 'nested' | 106 | icon: 'nested' |
| 100 | }, | 107 | }, |
| 101 | children: [ | 108 | children: [ |
| 102 | { | 109 | { |
| 103 | path: 'menu1', | 110 | path: '/calculator/pvpage', |
| 104 | component: () => import('@/views/nested/menu1/index'), // Parent router-view | 111 | name: 'pvpage', |
| 105 | name: 'Menu1', | 112 | component: () => import('@/views/calculator/pvpage'), |
| 106 | meta: { title: 'Menu1' }, | 113 | meta: { |
| 107 | children: [ | 114 | title: '页面访问明细', |
| 108 | { | 115 | icon: '' |
| 109 | path: 'menu1-1', | 116 | } |
| 110 | component: () => import('@/views/nested/menu1/menu1-1'), | ||
| 111 | name: 'Menu1-1', | ||
| 112 | meta: { title: 'Menu1-1' } | ||
| 113 | }, | ||
| 114 | { | ||
| 115 | path: 'menu1-2', | ||
| 116 | component: () => import('@/views/nested/menu1/menu1-2'), | ||
| 117 | name: 'Menu1-2', | ||
| 118 | meta: { title: 'Menu1-2' }, | ||
| 119 | children: [ | ||
| 120 | { | ||
| 121 | path: 'menu1-2-1', | ||
| 122 | component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'), | ||
| 123 | name: 'Menu1-2-1', | ||
| 124 | meta: { title: 'Menu1-2-1' } | ||
| 125 | }, | ||
| 126 | { | ||
| 127 | path: 'menu1-2-2', | ||
| 128 | component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'), | ||
| 129 | name: 'Menu1-2-2', | ||
| 130 | meta: { title: 'Menu1-2-2' } | ||
| 131 | } | ||
| 132 | ] | ||
| 133 | }, | ||
| 134 | { | ||
| 135 | path: 'menu1-3', | ||
| 136 | component: () => import('@/views/nested/menu1/menu1-3'), | ||
| 137 | name: 'Menu1-3', | ||
| 138 | meta: { title: 'Menu1-3' } | ||
| 139 | } | ||
| 140 | ] | ||
| 141 | }, | 117 | }, |
| 142 | { | 118 | { |
| 143 | path: 'menu2', | 119 | path: '/calculator/pvfunc', |
| 144 | component: () => import('@/views/nested/menu2/index'), | 120 | name: 'pvfunc', |
| 145 | meta: { title: 'menu2' } | 121 | component: () => import('@/views/calculator/pvfunc'), |
| 146 | } | 122 | meta: { |
| 123 | title: '功能访问明细', | ||
| 124 | icon: '' | ||
| 125 | } | ||
| 126 | }, | ||
| 147 | ] | 127 | ] |
| 148 | }, | 128 | }, |
| 149 | */ | 129 | |
| 130 | { | ||
| 131 | path: '/qrcode', | ||
| 132 | component: Layout, | ||
| 133 | children: [{ | ||
| 134 | path: 'index', | ||
| 135 | name: 'Qrcode', | ||
| 136 | component: () => import('@/views/scene/index'), | ||
| 137 | meta: { | ||
| 138 | title: '订阅信息', | ||
| 139 | icon: 'form' | ||
| 140 | } | ||
| 141 | }] | ||
| 142 | }, | ||
| 143 | |||
| 144 | |||
| 145 | // { | ||
| 146 | // path: '/example', | ||
| 147 | // component: Layout, | ||
| 148 | // redirect: '/example/table', | ||
| 149 | // name: 'Example', | ||
| 150 | // meta: { | ||
| 151 | // title: 'Example', | ||
| 152 | // icon: 'example' | ||
| 153 | // }, | ||
| 154 | // children: [{ | ||
| 155 | // path: 'table', | ||
| 156 | // name: 'Table', | ||
| 157 | // component: () => import('@/views/table/index'), | ||
| 158 | // meta: { | ||
| 159 | // title: 'Table', | ||
| 160 | // icon: 'table' | ||
| 161 | // } | ||
| 162 | // }, | ||
| 163 | // { | ||
| 164 | // path: 'tree', | ||
| 165 | // name: 'Tree', | ||
| 166 | // component: () => import('@/views/tree/index'), | ||
| 167 | // meta: { | ||
| 168 | // title: 'Tree', | ||
| 169 | // icon: 'tree' | ||
| 170 | // } | ||
| 171 | // } | ||
| 172 | // ] | ||
| 173 | // }, | ||
| 174 | |||
| 175 | // { | ||
| 176 | // path: '/nested', | ||
| 177 | // component: Layout, | ||
| 178 | // redirect: '/nested/menu1', | ||
| 179 | // name: 'Nested', | ||
| 180 | // meta: { | ||
| 181 | // title: 'Nested', | ||
| 182 | // icon: 'nested' | ||
| 183 | // }, | ||
| 184 | // children: [ | ||
| 185 | // { | ||
| 186 | // path: 'menu1', | ||
| 187 | // component: () => import('@/views/nested/menu1/index'), // Parent router-view | ||
| 188 | // name: 'Menu1', | ||
| 189 | // meta: { title: 'Menu1' }, | ||
| 190 | // children: [ | ||
| 191 | // { | ||
| 192 | // path: 'menu1-1', | ||
| 193 | // component: () => import('@/views/nested/menu1/menu1-1'), | ||
| 194 | // name: 'Menu1-1', | ||
| 195 | // meta: { title: 'Menu1-1' } | ||
| 196 | // }, | ||
| 197 | // { | ||
| 198 | // path: 'menu1-2', | ||
| 199 | // component: () => import('@/views/nested/menu1/menu1-2'), | ||
| 200 | // name: 'Menu1-2', | ||
| 201 | // meta: { title: 'Menu1-2' }, | ||
| 202 | // children: [ | ||
| 203 | // { | ||
| 204 | // path: 'menu1-2-1', | ||
| 205 | // component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'), | ||
| 206 | // name: 'Menu1-2-1', | ||
| 207 | // meta: { title: 'Menu1-2-1' } | ||
| 208 | // }, | ||
| 209 | // { | ||
| 210 | // path: 'menu1-2-2', | ||
| 211 | // component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'), | ||
| 212 | // name: 'Menu1-2-2', | ||
| 213 | // meta: { title: 'Menu1-2-2' } | ||
| 214 | // } | ||
| 215 | // ] | ||
| 216 | // }, | ||
| 217 | // { | ||
| 218 | // path: 'menu1-3', | ||
| 219 | // component: () => import('@/views/nested/menu1/menu1-3'), | ||
| 220 | // name: 'Menu1-3', | ||
| 221 | // meta: { title: 'Menu1-3' } | ||
| 222 | // } | ||
| 223 | // ] | ||
| 224 | // }, | ||
| 225 | // { | ||
| 226 | // path: 'menu2', | ||
| 227 | // component: () => import('@/views/nested/menu2/index'), | ||
| 228 | // meta: { title: 'menu2' } | ||
| 229 | // } | ||
| 230 | // ] | ||
| 231 | // }, | ||
| 150 | 232 | ||
| 151 | // { | 233 | // { |
| 152 | // path: 'external-link', | 234 | // path: 'external-link', |
| ... | @@ -159,11 +241,17 @@ export const constantRouterMap = [ | ... | @@ -159,11 +241,17 @@ export const constantRouterMap = [ |
| 159 | // ] | 241 | // ] |
| 160 | // }, | 242 | // }, |
| 161 | 243 | ||
| 162 | { path: '*', redirect: '/404', hidden: true } | 244 | { |
| 245 | path: '*', | ||
| 246 | redirect: '/404', | ||
| 247 | hidden: true | ||
| 248 | } | ||
| 163 | ] | 249 | ] |
| 164 | 250 | ||
| 165 | export default new Router({ | 251 | export default new Router({ |
| 166 | // mode: 'history', //后端支持可开 | 252 | // mode: 'history', //后端支持可开 |
| 167 | scrollBehavior: () => ({ y: 0 }), | 253 | scrollBehavior: () => ({ |
| 254 | y: 0 | ||
| 255 | }), | ||
| 168 | routes: constantRouterMap | 256 | routes: constantRouterMap |
| 169 | }) | 257 | }) | ... | ... |
src/views/calculator/pvfunc.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="page-container"> | ||
| 4 | <div class="tool-wrap"> | ||
| 5 | <div> | ||
| 6 | <el-form :inline="true" :model="filters"> | ||
| 7 | <el-form-item> | ||
| 8 | <el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入使用功能"></el-input> | ||
| 9 | </el-form-item> | ||
| 10 | <el-form-item> | ||
| 11 | <el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 12 | </el-date-picker> | ||
| 13 | </el-form-item> | ||
| 14 | <el-form-item> | ||
| 15 | <el-button type="primary" v-on:click="reqQuery">查询</el-button> | ||
| 16 | </el-form-item> | ||
| 17 | </el-form> | ||
| 18 | </div> | ||
| 19 | <div> | ||
| 20 | <el-button class="reset-btn" @click="showDialog()">导出数据</el-button> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | |||
| 24 | <el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;"> | ||
| 25 | <el-table-column prop="func_name" label="使用功能"> | ||
| 26 | </el-table-column> | ||
| 27 | <el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间"> | ||
| 28 | </el-table-column> | ||
| 29 | <el-table-column prop="nickname" label="微信昵称"> | ||
| 30 | </el-table-column> | ||
| 31 | <el-table-column label="微信头像"> | ||
| 32 | <template slot-scope="scope"> | ||
| 33 | <div class="avatar-wrap"> | ||
| 34 | <img class="avatar" :src="scope.row.avatar" alt=""> | ||
| 35 | </div> | ||
| 36 | </template> | ||
| 37 | </el-table-column> | ||
| 38 | <el-table-column prop="openid" label="openid"> | ||
| 39 | </el-table-column> | ||
| 40 | |||
| 41 | </el-table> | ||
| 42 | |||
| 43 | <!--工具条--> | ||
| 44 | <el-col :span="24" class="toolbar"> | ||
| 45 | <div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div> | ||
| 46 | <el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;"> | ||
| 47 | </el-pagination> | ||
| 48 | </el-col> | ||
| 49 | |||
| 50 | <el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false"> | ||
| 51 | <span class="tips">导出日期</span> | ||
| 52 | <el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 53 | </el-date-picker> | ||
| 54 | <div slot="footer" class="dialog-footer"> | ||
| 55 | <el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button> | ||
| 56 | <el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button> | ||
| 57 | </div> | ||
| 58 | </el-dialog> | ||
| 59 | |||
| 60 | </div> | ||
| 61 | </template> | ||
| 62 | |||
| 63 | <script> | ||
| 64 | import { Base64 } from "js-base64"; | ||
| 65 | import { exportTable } from "./../../api/api.js"; | ||
| 66 | import { formatDate } from "./../../common/utils.js"; | ||
| 67 | |||
| 68 | export default { | ||
| 69 | data() { | ||
| 70 | return { | ||
| 71 | exportDate: [ | ||
| 72 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 73 | new Date().getTime() | ||
| 74 | ], | ||
| 75 | exportDialogVisible: false, | ||
| 76 | listLoading: false, | ||
| 77 | page: 1, | ||
| 78 | pageSize: 10, | ||
| 79 | total: 0, | ||
| 80 | totalData: { | ||
| 81 | reservationList: [] | ||
| 82 | }, | ||
| 83 | selDate: [ | ||
| 84 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 85 | new Date() | ||
| 86 | ], | ||
| 87 | pickerOptions2: { | ||
| 88 | disabledDate(time) { | ||
| 89 | return time.getTime() > Date.now(); | ||
| 90 | } | ||
| 91 | }, | ||
| 92 | filters: { | ||
| 93 | mobilePhone: "", | ||
| 94 | date: "" | ||
| 95 | } | ||
| 96 | }; | ||
| 97 | }, | ||
| 98 | computed: { | ||
| 99 | pageNum() { | ||
| 100 | return Math.ceil(this.total / this.pageSize); | ||
| 101 | }, | ||
| 102 | startTime() { | ||
| 103 | let date = this.filters.date; | ||
| 104 | let result = (date && date[0]) || ""; | ||
| 105 | if (result) { | ||
| 106 | result = date[0].getTime(); | ||
| 107 | } | ||
| 108 | return result; | ||
| 109 | }, | ||
| 110 | endTime() { | ||
| 111 | let date = this.filters.date; | ||
| 112 | let result = (date && date[1]) || ""; | ||
| 113 | if (result) { | ||
| 114 | result = date[1].getTime() + 1000 * 60 * 60 * 24; | ||
| 115 | } | ||
| 116 | return result; | ||
| 117 | } | ||
| 118 | }, | ||
| 119 | methods: { | ||
| 120 | changeHandler() { | ||
| 121 | this.reqQuery(); | ||
| 122 | }, | ||
| 123 | exportHandler() { | ||
| 124 | let data = { | ||
| 125 | start_time: new Date(this.exportDate[0]).getTime(), | ||
| 126 | end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24, | ||
| 127 | mobile_phone: "", | ||
| 128 | startIndex: 0, | ||
| 129 | size: 1000000 | ||
| 130 | }; | ||
| 131 | var encoder = HDP.getEncoder(); | ||
| 132 | var encrypted = encoder.encode(JSON.stringify(data)); | ||
| 133 | let params = { | ||
| 134 | appId: "0489fba68acd11e98c527cd30aeb749e", | ||
| 135 | appKey: "9524a3c59a5d4460bd141a2a93a5db17", | ||
| 136 | func: "queryStatFuncListAppjqos", | ||
| 137 | data: encrypted | ||
| 138 | }; | ||
| 139 | exportTable(params); | ||
| 140 | }, | ||
| 141 | showDialog() { | ||
| 142 | this.exportDialogVisible = true; | ||
| 143 | }, | ||
| 144 | formatTableDate(row, column) { | ||
| 145 | return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm"); | ||
| 146 | }, | ||
| 147 | handleCurrentChange(val) { | ||
| 148 | this.page = val; | ||
| 149 | this.reqQuery(); | ||
| 150 | }, | ||
| 151 | reqQuery() { | ||
| 152 | let _this = this; | ||
| 153 | _this.listLoading = true; | ||
| 154 | let data = { | ||
| 155 | startIndex: (this.page - 1) * this.pageSize, | ||
| 156 | size: this.pageSize, | ||
| 157 | query: this.filters.mobilePhone, | ||
| 158 | start_time: this.startTime, | ||
| 159 | end_time: this.endTime | ||
| 160 | }; | ||
| 161 | as.queryFunV2("queryStatFuncListAppjqos", data, res => { | ||
| 162 | _this.page = 1; | ||
| 163 | _this.listLoading = false; | ||
| 164 | if (res) { | ||
| 165 | let reservationList = res[0]; | ||
| 166 | let total = res[1][0].total; | ||
| 167 | _this.total = total; | ||
| 168 | _this.$set(_this.totalData, "reservationList", reservationList); | ||
| 169 | } | ||
| 170 | }); | ||
| 171 | } | ||
| 172 | }, | ||
| 173 | mounted() { | ||
| 174 | this.reqQuery(); | ||
| 175 | }, | ||
| 176 | created() {} | ||
| 177 | }; | ||
| 178 | </script> | ||
| 179 | |||
| 180 | <style lang="scss" scoped> | ||
| 181 | .page-container { | ||
| 182 | padding: 20px; | ||
| 183 | } | ||
| 184 | |||
| 185 | .tool-wrap { | ||
| 186 | padding: 24px 0; | ||
| 187 | display: flex; | ||
| 188 | border-bottom: solid 1px #cccccc; | ||
| 189 | justify-content: space-between; | ||
| 190 | } | ||
| 191 | |||
| 192 | .toolbar { | ||
| 193 | display: flex; | ||
| 194 | justify-content: space-between; | ||
| 195 | .page-tips { | ||
| 196 | height: 32px; | ||
| 197 | line-height: 32px; | ||
| 198 | color: #333333; | ||
| 199 | } | ||
| 200 | } | ||
| 201 | |||
| 202 | .dialog { | ||
| 203 | .tips { | ||
| 204 | margin-right: 24px; | ||
| 205 | } | ||
| 206 | } | ||
| 207 | </style> |
src/views/calculator/pvpage.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="page-container"> | ||
| 4 | <div class="tool-wrap"> | ||
| 5 | <div> | ||
| 6 | <el-form :inline="true" :model="filters"> | ||
| 7 | <el-form-item> | ||
| 8 | <el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入访问页面"></el-input> | ||
| 9 | </el-form-item> | ||
| 10 | <el-form-item> | ||
| 11 | <el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 12 | </el-date-picker> | ||
| 13 | </el-form-item> | ||
| 14 | <el-form-item> | ||
| 15 | <el-button type="primary" v-on:click="reqQuery">查询</el-button> | ||
| 16 | </el-form-item> | ||
| 17 | </el-form> | ||
| 18 | </div> | ||
| 19 | <div> | ||
| 20 | <el-button class="reset-btn" @click="showDialog()">导出数据</el-button> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | |||
| 24 | <el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;"> | ||
| 25 | <el-table-column prop="page_name" label="访问页面"> | ||
| 26 | </el-table-column> | ||
| 27 | <el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间"> | ||
| 28 | </el-table-column> | ||
| 29 | <el-table-column prop="nickname" label="微信昵称"> | ||
| 30 | </el-table-column> | ||
| 31 | <el-table-column label="微信头像"> | ||
| 32 | <template slot-scope="scope"> | ||
| 33 | <div class="avatar-wrap"> | ||
| 34 | <img class="avatar" :src="scope.row.avatar" alt=""> | ||
| 35 | </div> | ||
| 36 | </template> | ||
| 37 | </el-table-column> | ||
| 38 | <el-table-column prop="openid" label="openid"> | ||
| 39 | </el-table-column> | ||
| 40 | |||
| 41 | </el-table> | ||
| 42 | |||
| 43 | <!--工具条--> | ||
| 44 | <el-col :span="24" class="toolbar"> | ||
| 45 | <div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div> | ||
| 46 | <el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;"> | ||
| 47 | </el-pagination> | ||
| 48 | </el-col> | ||
| 49 | |||
| 50 | <el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false"> | ||
| 51 | <span class="tips">导出日期</span> | ||
| 52 | <el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 53 | </el-date-picker> | ||
| 54 | <div slot="footer" class="dialog-footer"> | ||
| 55 | <el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button> | ||
| 56 | <el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button> | ||
| 57 | </div> | ||
| 58 | </el-dialog> | ||
| 59 | |||
| 60 | </div> | ||
| 61 | </template> | ||
| 62 | |||
| 63 | <script> | ||
| 64 | import { Base64 } from "js-base64"; | ||
| 65 | import { exportTable } from "./../../api/api.js"; | ||
| 66 | import { formatDate } from "./../../common/utils.js"; | ||
| 67 | |||
| 68 | export default { | ||
| 69 | data() { | ||
| 70 | return { | ||
| 71 | exportDate: [ | ||
| 72 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 73 | new Date().getTime() | ||
| 74 | ], | ||
| 75 | exportDialogVisible: false, | ||
| 76 | listLoading: false, | ||
| 77 | page: 1, | ||
| 78 | pageSize: 10, | ||
| 79 | total: 0, | ||
| 80 | totalData: { | ||
| 81 | reservationList: [] | ||
| 82 | }, | ||
| 83 | selDate: [ | ||
| 84 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 85 | new Date() | ||
| 86 | ], | ||
| 87 | pickerOptions2: { | ||
| 88 | disabledDate(time) { | ||
| 89 | return time.getTime() > Date.now(); | ||
| 90 | } | ||
| 91 | }, | ||
| 92 | filters: { | ||
| 93 | mobilePhone: "", | ||
| 94 | date: "" | ||
| 95 | } | ||
| 96 | }; | ||
| 97 | }, | ||
| 98 | computed: { | ||
| 99 | pageNum() { | ||
| 100 | return Math.ceil(this.total / this.pageSize); | ||
| 101 | }, | ||
| 102 | startTime() { | ||
| 103 | let date = this.filters.date; | ||
| 104 | let result = (date && date[0]) || ""; | ||
| 105 | if (result) { | ||
| 106 | result = date[0].getTime(); | ||
| 107 | } | ||
| 108 | return result; | ||
| 109 | }, | ||
| 110 | endTime() { | ||
| 111 | let date = this.filters.date; | ||
| 112 | let result = (date && date[1]) || ""; | ||
| 113 | if (result) { | ||
| 114 | result = date[1].getTime() + 1000 * 60 * 60 * 24; | ||
| 115 | } | ||
| 116 | return result; | ||
| 117 | } | ||
| 118 | }, | ||
| 119 | methods: { | ||
| 120 | changeHandler() { | ||
| 121 | this.reqQuery(); | ||
| 122 | }, | ||
| 123 | exportHandler() { | ||
| 124 | let data = { | ||
| 125 | start_time: new Date(this.exportDate[0]).getTime(), | ||
| 126 | end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24, | ||
| 127 | mobile_phone: "", | ||
| 128 | startIndex: 0, | ||
| 129 | size: 1000000 | ||
| 130 | }; | ||
| 131 | var encoder = HDP.getEncoder(); | ||
| 132 | var encrypted = encoder.encode(JSON.stringify(data)); | ||
| 133 | let params = { | ||
| 134 | appId: "0489fba68acd11e98c527cd30aeb749e", | ||
| 135 | appKey: "9524a3c59a5d4460bd141a2a93a5db17", | ||
| 136 | func: "queryStatPageListAppjqos", | ||
| 137 | data: encrypted | ||
| 138 | }; | ||
| 139 | exportTable(params); | ||
| 140 | }, | ||
| 141 | showDialog() { | ||
| 142 | this.exportDialogVisible = true; | ||
| 143 | }, | ||
| 144 | formatTableDate(row, column) { | ||
| 145 | return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm"); | ||
| 146 | }, | ||
| 147 | handleCurrentChange(val) { | ||
| 148 | this.page = val; | ||
| 149 | this.reqQuery(); | ||
| 150 | }, | ||
| 151 | reqQuery() { | ||
| 152 | let _this = this; | ||
| 153 | _this.listLoading = true; | ||
| 154 | let data = { | ||
| 155 | startIndex: (this.page - 1) * this.pageSize, | ||
| 156 | size: this.pageSize, | ||
| 157 | query: this.filters.mobilePhone, | ||
| 158 | start_time: this.startTime, | ||
| 159 | end_time: this.endTime | ||
| 160 | }; | ||
| 161 | as.queryFunV2("queryStatPageListAppjqos", data, res => { | ||
| 162 | _this.page = 1; | ||
| 163 | _this.listLoading = false; | ||
| 164 | if (res) { | ||
| 165 | let reservationList = res[0]; | ||
| 166 | let total = res[1][0].total; | ||
| 167 | _this.total = total; | ||
| 168 | _this.$set(_this.totalData, "reservationList", reservationList); | ||
| 169 | } | ||
| 170 | }); | ||
| 171 | } | ||
| 172 | }, | ||
| 173 | mounted() { | ||
| 174 | this.reqQuery(); | ||
| 175 | }, | ||
| 176 | created() {} | ||
| 177 | }; | ||
| 178 | </script> | ||
| 179 | |||
| 180 | <style lang="scss" scoped> | ||
| 181 | .page-container { | ||
| 182 | padding: 20px; | ||
| 183 | } | ||
| 184 | |||
| 185 | .tool-wrap { | ||
| 186 | padding: 24px 0; | ||
| 187 | display: flex; | ||
| 188 | border-bottom: solid 1px #cccccc; | ||
| 189 | justify-content: space-between; | ||
| 190 | } | ||
| 191 | |||
| 192 | .toolbar { | ||
| 193 | display: flex; | ||
| 194 | justify-content: space-between; | ||
| 195 | .page-tips { | ||
| 196 | height: 32px; | ||
| 197 | line-height: 32px; | ||
| 198 | color: #333333; | ||
| 199 | } | ||
| 200 | } | ||
| 201 | |||
| 202 | .dialog { | ||
| 203 | .tips { | ||
| 204 | margin-right: 24px; | ||
| 205 | } | ||
| 206 | } | ||
| 207 | </style> |
src/views/dictionary/pvpage.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="page-container"> | ||
| 4 | <div class="tool-wrap"> | ||
| 5 | <div> | ||
| 6 | <el-form :inline="true" :model="filters"> | ||
| 7 | <el-form-item> | ||
| 8 | <el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入访问页面"></el-input> | ||
| 9 | </el-form-item> | ||
| 10 | <el-form-item> | ||
| 11 | <el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 12 | </el-date-picker> | ||
| 13 | </el-form-item> | ||
| 14 | <el-form-item> | ||
| 15 | <el-button type="primary" v-on:click="reqQuery">查询</el-button> | ||
| 16 | </el-form-item> | ||
| 17 | </el-form> | ||
| 18 | </div> | ||
| 19 | <div> | ||
| 20 | <el-button class="reset-btn" @click="showDialog()">导出数据</el-button> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | |||
| 24 | <el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;"> | ||
| 25 | <el-table-column prop="page_name" label="访问页面"> | ||
| 26 | </el-table-column> | ||
| 27 | <el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间"> | ||
| 28 | </el-table-column> | ||
| 29 | <el-table-column prop="nickname" label="微信昵称"> | ||
| 30 | </el-table-column> | ||
| 31 | <el-table-column label="微信头像"> | ||
| 32 | <template slot-scope="scope"> | ||
| 33 | <div class="avatar-wrap"> | ||
| 34 | <img class="avatar" :src="scope.row.avatar" alt=""> | ||
| 35 | </div> | ||
| 36 | </template> | ||
| 37 | </el-table-column> | ||
| 38 | <el-table-column prop="openid" label="openid"> | ||
| 39 | </el-table-column> | ||
| 40 | |||
| 41 | </el-table> | ||
| 42 | |||
| 43 | <!--工具条--> | ||
| 44 | <el-col :span="24" class="toolbar"> | ||
| 45 | <div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div> | ||
| 46 | <el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;"> | ||
| 47 | </el-pagination> | ||
| 48 | </el-col> | ||
| 49 | |||
| 50 | <el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false"> | ||
| 51 | <span class="tips">导出日期</span> | ||
| 52 | <el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 53 | </el-date-picker> | ||
| 54 | <div slot="footer" class="dialog-footer"> | ||
| 55 | <el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button> | ||
| 56 | <el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button> | ||
| 57 | </div> | ||
| 58 | </el-dialog> | ||
| 59 | |||
| 60 | </div> | ||
| 61 | </template> | ||
| 62 | |||
| 63 | <script> | ||
| 64 | import { Base64 } from "js-base64"; | ||
| 65 | import { exportTable } from "./../../api/api.js"; | ||
| 66 | import { formatDate } from "./../../common/utils.js"; | ||
| 67 | |||
| 68 | export default { | ||
| 69 | data() { | ||
| 70 | return { | ||
| 71 | exportDate: [ | ||
| 72 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 73 | new Date().getTime() | ||
| 74 | ], | ||
| 75 | exportDialogVisible: false, | ||
| 76 | listLoading: false, | ||
| 77 | page: 1, | ||
| 78 | pageSize: 10, | ||
| 79 | total: 0, | ||
| 80 | totalData: { | ||
| 81 | reservationList: [] | ||
| 82 | }, | ||
| 83 | selDate: [ | ||
| 84 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 85 | new Date() | ||
| 86 | ], | ||
| 87 | pickerOptions2: { | ||
| 88 | disabledDate(time) { | ||
| 89 | return time.getTime() > Date.now(); | ||
| 90 | } | ||
| 91 | }, | ||
| 92 | filters: { | ||
| 93 | mobilePhone: "", | ||
| 94 | date: "" | ||
| 95 | } | ||
| 96 | }; | ||
| 97 | }, | ||
| 98 | computed: { | ||
| 99 | pageNum() { | ||
| 100 | return Math.ceil(this.total / this.pageSize); | ||
| 101 | }, | ||
| 102 | startTime() { | ||
| 103 | let date = this.filters.date; | ||
| 104 | let result = (date && date[0]) || ""; | ||
| 105 | if (result) { | ||
| 106 | result = date[0].getTime(); | ||
| 107 | } | ||
| 108 | return result; | ||
| 109 | }, | ||
| 110 | endTime() { | ||
| 111 | let date = this.filters.date; | ||
| 112 | let result = (date && date[1]) || ""; | ||
| 113 | if (result) { | ||
| 114 | result = date[1].getTime() + 1000 * 60 * 60 * 24; | ||
| 115 | } | ||
| 116 | return result; | ||
| 117 | } | ||
| 118 | }, | ||
| 119 | methods: { | ||
| 120 | changeHandler() { | ||
| 121 | this.reqQuery(); | ||
| 122 | }, | ||
| 123 | exportHandler() { | ||
| 124 | let data = { | ||
| 125 | start_time: new Date(this.exportDate[0]).getTime(), | ||
| 126 | end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24, | ||
| 127 | mobile_phone: "", | ||
| 128 | startIndex: 0, | ||
| 129 | size: 1000000 | ||
| 130 | }; | ||
| 131 | var encoder = HDP.getEncoder(); | ||
| 132 | var encrypted = encoder.encode(JSON.stringify(data)); | ||
| 133 | let params = { | ||
| 134 | appId: "0489fba68acd11e98c527cd30aeb749e", | ||
| 135 | appKey: "9524a3c59a5d4460bd141a2a93a5db17", | ||
| 136 | func: "queryStatPageList", | ||
| 137 | data: encrypted | ||
| 138 | }; | ||
| 139 | exportTable(params); | ||
| 140 | }, | ||
| 141 | showDialog() { | ||
| 142 | this.exportDialogVisible = true; | ||
| 143 | }, | ||
| 144 | formatTableDate(row, column) { | ||
| 145 | return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm"); | ||
| 146 | }, | ||
| 147 | handleCurrentChange(val) { | ||
| 148 | this.page = val; | ||
| 149 | this.reqQuery(); | ||
| 150 | }, | ||
| 151 | reqQuery() { | ||
| 152 | let _this = this; | ||
| 153 | _this.listLoading = true; | ||
| 154 | let data = { | ||
| 155 | startIndex: (this.page - 1) * this.pageSize, | ||
| 156 | size: this.pageSize, | ||
| 157 | mobile_phone: this.filters.mobilePhone, | ||
| 158 | start_time: this.startTime, | ||
| 159 | end_time: this.endTime | ||
| 160 | }; | ||
| 161 | as.queryFunV2("queryStatPageList", data, res => { | ||
| 162 | _this.page = 1; | ||
| 163 | _this.listLoading = false; | ||
| 164 | if (res) { | ||
| 165 | let reservationList = res[0]; | ||
| 166 | let total = res[1][0].total; | ||
| 167 | _this.total = total; | ||
| 168 | _this.$set(_this.totalData, "reservationList", reservationList); | ||
| 169 | } | ||
| 170 | }); | ||
| 171 | } | ||
| 172 | }, | ||
| 173 | mounted() { | ||
| 174 | this.reqQuery(); | ||
| 175 | }, | ||
| 176 | created() {} | ||
| 177 | }; | ||
| 178 | </script> | ||
| 179 | |||
| 180 | <style lang="scss" scoped> | ||
| 181 | .page-container { | ||
| 182 | padding: 20px; | ||
| 183 | } | ||
| 184 | |||
| 185 | .tool-wrap { | ||
| 186 | padding: 24px 0; | ||
| 187 | display: flex; | ||
| 188 | border-bottom: solid 1px #cccccc; | ||
| 189 | justify-content: space-between; | ||
| 190 | } | ||
| 191 | |||
| 192 | .toolbar { | ||
| 193 | display: flex; | ||
| 194 | justify-content: space-between; | ||
| 195 | .page-tips { | ||
| 196 | height: 32px; | ||
| 197 | line-height: 32px; | ||
| 198 | color: #333333; | ||
| 199 | } | ||
| 200 | } | ||
| 201 | |||
| 202 | .dialog { | ||
| 203 | .tips { | ||
| 204 | margin-right: 24px; | ||
| 205 | } | ||
| 206 | } | ||
| 207 | </style> |
src/views/dictionary/pvproduct.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="page-container"> | ||
| 4 | <div class="tool-wrap"> | ||
| 5 | <div> | ||
| 6 | <el-form :inline="true" :model="filters"> | ||
| 7 | <el-form-item> | ||
| 8 | <el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入访问产品"></el-input> | ||
| 9 | </el-form-item> | ||
| 10 | <el-form-item> | ||
| 11 | <el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 12 | </el-date-picker> | ||
| 13 | </el-form-item> | ||
| 14 | <el-form-item> | ||
| 15 | <el-button type="primary" v-on:click="reqQuery">查询</el-button> | ||
| 16 | </el-form-item> | ||
| 17 | </el-form> | ||
| 18 | </div> | ||
| 19 | <div> | ||
| 20 | <el-button class="reset-btn" @click="showDialog()">导出数据</el-button> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | |||
| 24 | <el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;"> | ||
| 25 | <el-table-column prop="product_name" label="访问产品"> | ||
| 26 | </el-table-column> | ||
| 27 | <el-table-column prop="hdp_created" :formatter="formatTableDate" label="访问时间"> | ||
| 28 | </el-table-column> | ||
| 29 | <el-table-column prop="nickname" label="微信昵称"> | ||
| 30 | </el-table-column> | ||
| 31 | <el-table-column label="微信头像"> | ||
| 32 | <template slot-scope="scope"> | ||
| 33 | <div class="avatar-wrap"> | ||
| 34 | <img class="avatar" :src="scope.row.avatar" alt=""> | ||
| 35 | </div> | ||
| 36 | </template> | ||
| 37 | </el-table-column> | ||
| 38 | <el-table-column prop="openid" label="openid"> | ||
| 39 | </el-table-column> | ||
| 40 | |||
| 41 | </el-table> | ||
| 42 | |||
| 43 | <!--工具条--> | ||
| 44 | <el-col :span="24" class="toolbar"> | ||
| 45 | <div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div> | ||
| 46 | <el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;"> | ||
| 47 | </el-pagination> | ||
| 48 | </el-col> | ||
| 49 | |||
| 50 | <el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false"> | ||
| 51 | <span class="tips">导出日期</span> | ||
| 52 | <el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 53 | </el-date-picker> | ||
| 54 | <div slot="footer" class="dialog-footer"> | ||
| 55 | <el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button> | ||
| 56 | <el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button> | ||
| 57 | </div> | ||
| 58 | </el-dialog> | ||
| 59 | |||
| 60 | </div> | ||
| 61 | </template> | ||
| 62 | |||
| 63 | <script> | ||
| 64 | import { Base64 } from "js-base64"; | ||
| 65 | import { exportTable } from "./../../api/api.js"; | ||
| 66 | import { formatDate } from "./../../common/utils.js"; | ||
| 67 | |||
| 68 | export default { | ||
| 69 | data() { | ||
| 70 | return { | ||
| 71 | exportDate: [ | ||
| 72 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 73 | new Date().getTime() | ||
| 74 | ], | ||
| 75 | exportDialogVisible: false, | ||
| 76 | listLoading: false, | ||
| 77 | page: 1, | ||
| 78 | pageSize: 10, | ||
| 79 | total: 0, | ||
| 80 | totalData: { | ||
| 81 | reservationList: [] | ||
| 82 | }, | ||
| 83 | selDate: [ | ||
| 84 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 85 | new Date() | ||
| 86 | ], | ||
| 87 | pickerOptions2: { | ||
| 88 | disabledDate(time) { | ||
| 89 | return time.getTime() > Date.now(); | ||
| 90 | } | ||
| 91 | }, | ||
| 92 | filters: { | ||
| 93 | mobilePhone: "", | ||
| 94 | date: "" | ||
| 95 | } | ||
| 96 | }; | ||
| 97 | }, | ||
| 98 | computed: { | ||
| 99 | pageNum() { | ||
| 100 | return Math.ceil(this.total / this.pageSize); | ||
| 101 | }, | ||
| 102 | startTime() { | ||
| 103 | let date = this.filters.date; | ||
| 104 | let result = (date && date[0]) || ""; | ||
| 105 | if (result) { | ||
| 106 | result = date[0].getTime(); | ||
| 107 | } | ||
| 108 | return result; | ||
| 109 | }, | ||
| 110 | endTime() { | ||
| 111 | let date = this.filters.date; | ||
| 112 | let result = (date && date[1]) || ""; | ||
| 113 | if (result) { | ||
| 114 | result = date[1].getTime() + 1000 * 60 * 60 * 24; | ||
| 115 | } | ||
| 116 | return result; | ||
| 117 | } | ||
| 118 | }, | ||
| 119 | methods: { | ||
| 120 | changeHandler() { | ||
| 121 | this.reqQuery(); | ||
| 122 | }, | ||
| 123 | exportHandler() { | ||
| 124 | let data = { | ||
| 125 | start_time: new Date(this.exportDate[0]).getTime(), | ||
| 126 | end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24, | ||
| 127 | mobile_phone: "", | ||
| 128 | startIndex: 0, | ||
| 129 | size: 1000000 | ||
| 130 | }; | ||
| 131 | var encoder = HDP.getEncoder(); | ||
| 132 | var encrypted = encoder.encode(JSON.stringify(data)); | ||
| 133 | let params = { | ||
| 134 | appId: "0489fba68acd11e98c527cd30aeb749e", | ||
| 135 | appKey: "9524a3c59a5d4460bd141a2a93a5db17", | ||
| 136 | func: "queryStatProductList", | ||
| 137 | data: encrypted | ||
| 138 | }; | ||
| 139 | exportTable(params); | ||
| 140 | }, | ||
| 141 | showDialog() { | ||
| 142 | this.exportDialogVisible = true; | ||
| 143 | }, | ||
| 144 | formatTableDate(row, column) { | ||
| 145 | return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm"); | ||
| 146 | }, | ||
| 147 | handleCurrentChange(val) { | ||
| 148 | this.page = val; | ||
| 149 | this.reqQuery(); | ||
| 150 | }, | ||
| 151 | reqQuery() { | ||
| 152 | let _this = this; | ||
| 153 | _this.listLoading = true; | ||
| 154 | let data = { | ||
| 155 | startIndex: (this.page - 1) * this.pageSize, | ||
| 156 | size: this.pageSize, | ||
| 157 | mobile_phone: this.filters.mobilePhone, | ||
| 158 | start_time: this.startTime, | ||
| 159 | end_time: this.endTime | ||
| 160 | }; | ||
| 161 | as.queryFunV2("queryStatProductList", data, res => { | ||
| 162 | _this.page = 1; | ||
| 163 | _this.listLoading = false; | ||
| 164 | if (res) { | ||
| 165 | let reservationList = res[0]; | ||
| 166 | let total = res[1][0].total; | ||
| 167 | _this.total = total; | ||
| 168 | _this.$set(_this.totalData, "reservationList", reservationList); | ||
| 169 | } | ||
| 170 | }); | ||
| 171 | } | ||
| 172 | }, | ||
| 173 | mounted() { | ||
| 174 | this.reqQuery(); | ||
| 175 | }, | ||
| 176 | created() {} | ||
| 177 | }; | ||
| 178 | </script> | ||
| 179 | |||
| 180 | <style lang="scss" scoped> | ||
| 181 | .page-container { | ||
| 182 | padding: 20px; | ||
| 183 | } | ||
| 184 | |||
| 185 | .tool-wrap { | ||
| 186 | padding: 24px 0; | ||
| 187 | display: flex; | ||
| 188 | border-bottom: solid 1px #cccccc; | ||
| 189 | justify-content: space-between; | ||
| 190 | } | ||
| 191 | |||
| 192 | .toolbar { | ||
| 193 | display: flex; | ||
| 194 | justify-content: space-between; | ||
| 195 | .page-tips { | ||
| 196 | height: 32px; | ||
| 197 | line-height: 32px; | ||
| 198 | color: #333333; | ||
| 199 | } | ||
| 200 | } | ||
| 201 | |||
| 202 | .dialog { | ||
| 203 | .tips { | ||
| 204 | margin-right: 24px; | ||
| 205 | } | ||
| 206 | } | ||
| 207 | </style> |
src/views/dictionary/reservation.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="page-container"> | ||
| 3 | <div class="tool-wrap"> | ||
| 4 | <div> | ||
| 5 | <el-form :inline="true" :model="filters"> | ||
| 6 | <el-form-item> | ||
| 7 | <el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入手机号"></el-input> | ||
| 8 | </el-form-item> | ||
| 9 | <el-form-item> | ||
| 10 | <el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 11 | </el-date-picker> | ||
| 12 | </el-form-item> | ||
| 13 | <el-form-item> | ||
| 14 | <el-button type="primary" v-on:click="reqQuery">查询</el-button> | ||
| 15 | </el-form-item> | ||
| 16 | </el-form> | ||
| 17 | </div> | ||
| 18 | <div> | ||
| 19 | <el-button class="reset-btn" @click="showDialog()">导出数据</el-button> | ||
| 20 | </div> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;"> | ||
| 24 | |||
| 25 | <el-table-column prop="product_name" label="产品名称"> | ||
| 26 | </el-table-column> | ||
| 27 | <el-table-column prop="advisory" label="申请类型"> | ||
| 28 | </el-table-column> | ||
| 29 | <el-table-column prop="name" label="姓名"> | ||
| 30 | </el-table-column> | ||
| 31 | <el-table-column prop="mobile" label="联系方式"> | ||
| 32 | </el-table-column> | ||
| 33 | <el-table-column prop="office" label="单位"> | ||
| 34 | </el-table-column> | ||
| 35 | <el-table-column prop="province" label="省份"> | ||
| 36 | </el-table-column> | ||
| 37 | <el-table-column prop="hdp_created" :formatter="formatTableDate" label="申请时间"> | ||
| 38 | </el-table-column> | ||
| 39 | <el-table-column prop="nickname" label="微信昵称"> | ||
| 40 | </el-table-column> | ||
| 41 | <el-table-column label="微信头像"> | ||
| 42 | <template slot-scope="scope"> | ||
| 43 | <div class="avatar-wrap"> | ||
| 44 | <img class="avatar" :src="scope.row.avatar" alt=""> | ||
| 45 | </div> | ||
| 46 | </template> | ||
| 47 | </el-table-column> | ||
| 48 | <el-table-column prop="openid" label="openid"> | ||
| 49 | </el-table-column> | ||
| 50 | |||
| 51 | </el-table> | ||
| 52 | |||
| 53 | <!--工具条--> | ||
| 54 | <el-col :span="24" class="toolbar"> | ||
| 55 | <div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div> | ||
| 56 | <el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;"> | ||
| 57 | </el-pagination> | ||
| 58 | </el-col> | ||
| 59 | |||
| 60 | <el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false"> | ||
| 61 | <span class="tips">导出日期</span> | ||
| 62 | <el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
| 63 | </el-date-picker> | ||
| 64 | <div slot="footer" class="dialog-footer"> | ||
| 65 | <el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button> | ||
| 66 | <el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button> | ||
| 67 | </div> | ||
| 68 | </el-dialog> | ||
| 69 | |||
| 70 | </div> | ||
| 71 | </template> | ||
| 72 | |||
| 73 | <script> | ||
| 74 | import { Base64 } from "js-base64"; | ||
| 75 | import { exportTable } from "./../../api/api.js"; | ||
| 76 | import { formatDate } from "./../../common/utils.js"; | ||
| 77 | |||
| 78 | export default { | ||
| 79 | data() { | ||
| 80 | return { | ||
| 81 | exportDate: [ | ||
| 82 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 83 | new Date().getTime() | ||
| 84 | ], | ||
| 85 | exportDialogVisible: false, | ||
| 86 | listLoading: false, | ||
| 87 | page: 1, | ||
| 88 | pageSize: 10, | ||
| 89 | total: 0, | ||
| 90 | totalData: { | ||
| 91 | reservationList: [] | ||
| 92 | }, | ||
| 93 | selDate: [ | ||
| 94 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
| 95 | new Date() | ||
| 96 | ], | ||
| 97 | pickerOptions2: { | ||
| 98 | disabledDate(time) { | ||
| 99 | return time.getTime() > Date.now(); | ||
| 100 | } | ||
| 101 | }, | ||
| 102 | filters: { | ||
| 103 | mobilePhone: "", | ||
| 104 | date: "" | ||
| 105 | } | ||
| 106 | }; | ||
| 107 | }, | ||
| 108 | computed: { | ||
| 109 | pageNum() { | ||
| 110 | return Math.ceil(this.total / this.pageSize); | ||
| 111 | }, | ||
| 112 | startTime() { | ||
| 113 | let date = this.filters.date; | ||
| 114 | let result = (date && date[0]) || ""; | ||
| 115 | if (result) { | ||
| 116 | result = date[0].getTime(); | ||
| 117 | } | ||
| 118 | return result; | ||
| 119 | }, | ||
| 120 | endTime() { | ||
| 121 | let date = this.filters.date; | ||
| 122 | let result = (date && date[1]) || ""; | ||
| 123 | if (result) { | ||
| 124 | result = date[1].getTime() + 1000 * 60 * 60 * 24; | ||
| 125 | } | ||
| 126 | return result; | ||
| 127 | } | ||
| 128 | }, | ||
| 129 | methods: { | ||
| 130 | changeHandler() { | ||
| 131 | this.reqQuery(); | ||
| 132 | }, | ||
| 133 | exportHandler() { | ||
| 134 | let data = { | ||
| 135 | start_time: new Date(this.exportDate[0]).getTime(), | ||
| 136 | end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24, | ||
| 137 | mobile_phone: "", | ||
| 138 | startIndex: 0, | ||
| 139 | size: 1000000 | ||
| 140 | }; | ||
| 141 | var encoder = HDP.getEncoder(); | ||
| 142 | var encrypted = encoder.encode(JSON.stringify(data)); | ||
| 143 | let params = { | ||
| 144 | appId: "0489fba68acd11e98c527cd30aeb749e", | ||
| 145 | appKey: "9524a3c59a5d4460bd141a2a93a5db17", | ||
| 146 | func: "queryInquiryList", | ||
| 147 | data: encrypted | ||
| 148 | }; | ||
| 149 | exportTable(params); | ||
| 150 | }, | ||
| 151 | showDialog() { | ||
| 152 | this.exportDialogVisible = true; | ||
| 153 | }, | ||
| 154 | formatTableDate(row, column) { | ||
| 155 | return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm"); | ||
| 156 | }, | ||
| 157 | handleCurrentChange(val) { | ||
| 158 | this.page = val; | ||
| 159 | this.reqQuery(); | ||
| 160 | }, | ||
| 161 | reqQuery() { | ||
| 162 | let _this = this; | ||
| 163 | _this.listLoading = true; | ||
| 164 | let data = { | ||
| 165 | startIndex: (this.page - 1) * this.pageSize, | ||
| 166 | size: this.pageSize, | ||
| 167 | mobile_phone: this.filters.mobilePhone, | ||
| 168 | start_time: this.startTime, | ||
| 169 | end_time: this.endTime | ||
| 170 | }; | ||
| 171 | as.queryFunV2("queryInquiryList", data, res => { | ||
| 172 | console.log("queryInquiryList res:", res); | ||
| 173 | _this.page = 1; | ||
| 174 | _this.listLoading = false; | ||
| 175 | if (res) { | ||
| 176 | let reservationList = res[0]; | ||
| 177 | let total = res[1][0].total; | ||
| 178 | _this.total = total; | ||
| 179 | _this.$set(_this.totalData, "reservationList", reservationList); | ||
| 180 | } | ||
| 181 | }); | ||
| 182 | } | ||
| 183 | }, | ||
| 184 | mounted() { | ||
| 185 | this.reqQuery(); | ||
| 186 | }, | ||
| 187 | created() {} | ||
| 188 | }; | ||
| 189 | </script> | ||
| 190 | |||
| 191 | <style lang="scss" scoped> | ||
| 192 | .page-container { | ||
| 193 | padding: 20px; | ||
| 194 | } | ||
| 195 | |||
| 196 | .tool-wrap { | ||
| 197 | padding: 24px 0; | ||
| 198 | display: flex; | ||
| 199 | border-bottom: solid 1px #cccccc; | ||
| 200 | justify-content: space-between; | ||
| 201 | } | ||
| 202 | |||
| 203 | .toolbar { | ||
| 204 | display: flex; | ||
| 205 | justify-content: space-between; | ||
| 206 | .page-tips { | ||
| 207 | height: 32px; | ||
| 208 | line-height: 32px; | ||
| 209 | color: #333333; | ||
| 210 | } | ||
| 211 | } | ||
| 212 | |||
| 213 | .dialog { | ||
| 214 | .tips { | ||
| 215 | margin-right: 24px; | ||
| 216 | } | ||
| 217 | } | ||
| 218 | </style> |
| ... | @@ -97,6 +97,7 @@ export default { | ... | @@ -97,6 +97,7 @@ export default { |
| 97 | .then(() => { | 97 | .then(() => { |
| 98 | this.loading = false | 98 | this.loading = false |
| 99 | this.$router.push({ path: this.redirect || '/' }) | 99 | this.$router.push({ path: this.redirect || '/' }) |
| 100 | // this.$router.push({ path: '/dictionary/pv' }) | ||
| 100 | }) | 101 | }) |
| 101 | .catch(() => { | 102 | .catch(() => { |
| 102 | this.loading = false | 103 | this.loading = false | ... | ... |
static/js/as.js
0 → 100644
| 1 | // var HDP = require("./hdp-4.4.0.min.js") | ||
| 2 | |||
| 3 | var as = {}; | ||
| 4 | |||
| 5 | /*------------------初始化基础数据 start---------------------*/ | ||
| 6 | as.domains = "https://" + document.domain + "/4Gh6/"; | ||
| 7 | as.AppID = "0489fba68acd11e98c527cd30aeb749e"; | ||
| 8 | as.AppKey = "9524a3c59a5d4460bd141a2a93a5db17"; | ||
| 9 | |||
| 10 | //默认头像 | ||
| 11 | as.defineAvatar = "http://cdn.aiwanpai.com/s/d.jpg"; | ||
| 12 | |||
| 13 | as.shareLink = as.domains + "index.html"; | ||
| 14 | as.shareTitle = ""; | ||
| 15 | as.shareDesc = ""; | ||
| 16 | as.shareImgUrl = as.domains + "share.jpg"; | ||
| 17 | as.success = function () {}; | ||
| 18 | as.appSuccess = function () {}; | ||
| 19 | |||
| 20 | as.openid = ""; | ||
| 21 | as.wxUserInfo = {}; | ||
| 22 | as.isSubscribe = false; //是否关注 | ||
| 23 | as.rankName = "rank"; //排行榜名称 | ||
| 24 | /*------------------初始化基础数据 end-----------------------*/ | ||
| 25 | |||
| 26 | /*------------------HDP初始化 start---------------------*/ | ||
| 27 | HDP.init(as.AppID, as.AppKey); | ||
| 28 | weixinGetConfig(); | ||
| 29 | |||
| 30 | //隐藏分享到朋友圈 | ||
| 31 | hideMenuItemsTimeLink(); | ||
| 32 | //隐藏微信右上角菜单 | ||
| 33 | // hideOptionMenu(); | ||
| 34 | |||
| 35 | //以下初始化不需要使用可以注释掉 | ||
| 36 | as.weixin = HDP.weixin(); //微信 | ||
| 37 | as.redis = HDP.redis(); //keyvaluestore | ||
| 38 | as.func = HDP.getFunction(); //自定义函数 | ||
| 39 | as.rand = HDP.rand(); //抽奖 | ||
| 40 | // as.piplus = HDP.getPiplus(); //派加接口 | ||
| 41 | as.co = HDP.getAppCooperation(); //协作 | ||
| 42 | // as.rank = HDP.rank(); //排行榜 | ||
| 43 | // as.jpgCdn = HDP.getJpgCDN(); //图片路径转换 | ||
| 44 | as.wxMultimedia = HDP.wxMultimedia(); //语音 | ||
| 45 | as.file = HDP.getFile(); //上传图片 | ||
| 46 | /*------------------HDP初始化 end-----------------------*/ | ||
| 47 | |||
| 48 | /*------------------微信相关 start---------------------*/ | ||
| 49 | //分享设置 | ||
| 50 | as.setShare = function (link, title, desc, imgurl) { | ||
| 51 | as.weixin.initShare({ | ||
| 52 | "link": (link != "") ? link : as.shareLink, | ||
| 53 | "appMessageTitle": (title != "") ? title : as.shareTitle, | ||
| 54 | "appMessageDesc": (desc != "") ? desc : as.shareDesc, | ||
| 55 | "appMessageImgUrl": (imgurl != "") ? imgurl : as.shareImgUrl, | ||
| 56 | "appMessageShareSucc": as.appSuccess, | ||
| 57 | |||
| 58 | "timelineTitle": (desc != "") ? desc : as.shareDesc, | ||
| 59 | "timelineImgUrl": (imgurl != "") ? imgurl : as.shareImgUrl, | ||
| 60 | "timelineShareSucc": as.success | ||
| 61 | }); | ||
| 62 | }; | ||
| 63 | as.setShare("", "", "", ""); | ||
| 64 | |||
| 65 | //获取用户微信信息 | ||
| 66 | as.getWxUserInfo = function (callback) { | ||
| 67 | as.weixin.getUserInfoV2({ | ||
| 68 | "success": function (res) { | ||
| 69 | if (res && res.nickname) { | ||
| 70 | if (res.nickname.indexOf('"') > -1) { | ||
| 71 | res.nickname = res.nickname.replace(/"/g, '“'); | ||
| 72 | } | ||
| 73 | if (res.nickname.indexOf("'") > -1) { | ||
| 74 | res.nickname = res.nickname.replace(/'/g, "‘"); | ||
| 75 | } | ||
| 76 | } | ||
| 77 | if (res && res.avatar == "") { | ||
| 78 | res.avatar = as.defineAvatar; | ||
| 79 | } | ||
| 80 | as.wxUserInfo = res; | ||
| 81 | if (as.wxUserInfo && as.wxUserInfo.openid) { | ||
| 82 | as.openid = as.wxUserInfo.openid; | ||
| 83 | } | ||
| 84 | |||
| 85 | if (typeof callback == "function") { | ||
| 86 | callback(as.openid) | ||
| 87 | }; | ||
| 88 | }, | ||
| 89 | "error": function (res) { | ||
| 90 | if (typeof callback == "function") { | ||
| 91 | callback("") | ||
| 92 | }; | ||
| 93 | } | ||
| 94 | }); | ||
| 95 | }; | ||
| 96 | //判断是否关注了公众号 | ||
| 97 | as.isAttention = function (callback) { | ||
| 98 | as.weixin.isSubscribe({ | ||
| 99 | "success": function (res) { | ||
| 100 | as.isSubscribe = (res["subscribe"] == 1) ? true : false; | ||
| 101 | if (typeof callback == "function") | ||
| 102 | callback(as.isSubscribe); | ||
| 103 | }, | ||
| 104 | "error": function (res) { | ||
| 105 | if (typeof callback == "function") | ||
| 106 | callback(false); | ||
| 107 | } | ||
| 108 | }); | ||
| 109 | }; | ||
| 110 | //领取卡券 | ||
| 111 | as.addCard = function (cardId, openid, callback) { | ||
| 112 | as.weixin.addCard({ | ||
| 113 | "cardId": cardId, | ||
| 114 | "code": "", | ||
| 115 | "openid": openid, | ||
| 116 | "succ": function (res) { | ||
| 117 | console.log('领取卡券成功'); | ||
| 118 | if (typeof callback == "function") | ||
| 119 | callback(true); | ||
| 120 | }, | ||
| 121 | "error": function (res) { | ||
| 122 | console.log('领取卡券失败'); | ||
| 123 | if (typeof callback == "function") | ||
| 124 | callback(false); | ||
| 125 | } | ||
| 126 | }); | ||
| 127 | }; | ||
| 128 | /*------------------微信相关 end---------------------*/ | ||
| 129 | |||
| 130 | /*------------------keyvaluestore start---------------------*/ | ||
| 131 | as.setRedisKeyValue = function (key, value, callback) { | ||
| 132 | var redisOp = { | ||
| 133 | "param": { | ||
| 134 | "valueKey": key, | ||
| 135 | "value": value | ||
| 136 | }, | ||
| 137 | "success": function (res) { | ||
| 138 | var bool = res.code == "180001"; | ||
| 139 | if (typeof callback == "function") callback(bool); | ||
| 140 | }, | ||
| 141 | "error": function (res) { | ||
| 142 | if (typeof callback == "function") callback(false); | ||
| 143 | } | ||
| 144 | }; | ||
| 145 | as.redis.set(redisOp); | ||
| 146 | }; | ||
| 147 | as.getRedisKeyValue = function (key, callback) { | ||
| 148 | var redisOp = { | ||
| 149 | "param": { | ||
| 150 | "valueKey": key | ||
| 151 | }, | ||
| 152 | "success": function (res) { | ||
| 153 | if (res.code == "181001") { | ||
| 154 | if (typeof callback == "function") callback(res["returnMap"][key]); | ||
| 155 | } else { | ||
| 156 | if (typeof callback == "function") callback(null); | ||
| 157 | } | ||
| 158 | }, | ||
| 159 | "error": function (res) { | ||
| 160 | if (typeof callback == "function") callback(null); | ||
| 161 | } | ||
| 162 | }; | ||
| 163 | as.redis.get(redisOp); | ||
| 164 | }; | ||
| 165 | as.getRedisList = function (key, callback) { | ||
| 166 | var redisOp = { | ||
| 167 | "param": { | ||
| 168 | "valueKey": key | ||
| 169 | }, | ||
| 170 | "success": function (res) { | ||
| 171 | if (res.code == "181001") { | ||
| 172 | if (typeof callback == "function") callback(res["returnMap"]); | ||
| 173 | } else { | ||
| 174 | if (typeof callback == "function") callback(null); | ||
| 175 | } | ||
| 176 | }, | ||
| 177 | "error": function (res) { | ||
| 178 | if (typeof callback == "function") callback(null); | ||
| 179 | } | ||
| 180 | }; | ||
| 181 | as.redis.getList(redisOp); | ||
| 182 | }; | ||
| 183 | /*------------------keyvaluestore end-----------------------*/ | ||
| 184 | |||
| 185 | /*------------------自定义函数 start---------------------*/ | ||
| 186 | //单语句查询 | ||
| 187 | as.queryFun = function (funName, data, callback) { | ||
| 188 | as.func.runFunction(funName, { | ||
| 189 | "param": data, | ||
| 190 | "success": function (res) { | ||
| 191 | if (typeof callback == "function") callback(res); | ||
| 192 | }, | ||
| 193 | "error": function (res) { | ||
| 194 | if (typeof callback == "function") callback(null); | ||
| 195 | } | ||
| 196 | }); | ||
| 197 | }; | ||
| 198 | //插入,修改,多语句查询 | ||
| 199 | as.queryFunV2 = function (funName, data, callback) { | ||
| 200 | as.func.runFunctionV2(funName, { | ||
| 201 | "param": data, | ||
| 202 | "success": function (res) { | ||
| 203 | if (typeof callback == "function") callback(res); | ||
| 204 | }, | ||
| 205 | "error": function (res) { | ||
| 206 | if (typeof callback == "function") callback(null); | ||
| 207 | } | ||
| 208 | }); | ||
| 209 | }; | ||
| 210 | /*------------------自定义函数 end---------------------*/ | ||
| 211 | |||
| 212 | /*------------------抽奖相关 start---------------------*/ | ||
| 213 | //抽奖 | ||
| 214 | as.gameLottery = function (callback) { | ||
| 215 | as.rand.rand({ | ||
| 216 | "success": function (res) { | ||
| 217 | if (typeof callback == "function") callback(res); | ||
| 218 | }, | ||
| 219 | "error": function (res) { | ||
| 220 | if (typeof callback == "function") callback({ | ||
| 221 | "result": false | ||
| 222 | }); | ||
| 223 | } | ||
| 224 | }); | ||
| 225 | }; | ||
| 226 | //时间戳格式化(YYYY-mm-dd) | ||
| 227 | as.timestampFormat = function (timestamp) { | ||
| 228 | var myDate = new Date(); | ||
| 229 | if (timestamp) myDate.setTime(timestamp); | ||
| 230 | var year = myDate.getFullYear(); | ||
| 231 | var month = myDate.getMonth() + 1; | ||
| 232 | if (month < 10) month = "0" + month; | ||
| 233 | var day = myDate.getDate(); | ||
| 234 | if (day < 10) day = "0" + day; | ||
| 235 | |||
| 236 | var format = ""; | ||
| 237 | format += year + "-" + month + "-" + day; | ||
| 238 | return format; | ||
| 239 | }; | ||
| 240 | /*------------------抽奖相关 end-----------------------*/ | ||
| 241 | |||
| 242 | /*------------------协作相关 start---------------------*/ | ||
| 243 | //从当前链接中获取邀请码 hdp_cooperation_id | ||
| 244 | as.getCodeFromCurrentUrl = function (callback) { | ||
| 245 | as.co.getCodeFromCurrentUrl(function (cooperationId) { | ||
| 246 | if (typeof callback == "function") callback(cooperationId); | ||
| 247 | }); | ||
| 248 | }; | ||
| 249 | //根据邀请码重置分享链接 | ||
| 250 | as.cooperationSetShareLink = function (resourceId, desc) { | ||
| 251 | if (resourceId != "") { | ||
| 252 | if (as.shareLink.indexOf("?") > 0) { | ||
| 253 | var link = as.shareLink + "&hdp_cooperation_id=" + resourceId; | ||
| 254 | } else { | ||
| 255 | var link = as.shareLink + "?hdp_cooperation_id=" + resourceId; | ||
| 256 | } | ||
| 257 | as.setShare(link, "", desc, ""); | ||
| 258 | } | ||
| 259 | }; | ||
| 260 | //生成邀请码 | ||
| 261 | as.insertResourceId = function (jsonStr, callback) { | ||
| 262 | if (typeof (jsonStr) != 'string') { | ||
| 263 | jsonStr = JSON.stringify(jsonStr); | ||
| 264 | } | ||
| 265 | as.co.uploadAppCooperationInfo({ | ||
| 266 | "param": { | ||
| 267 | "jsonStr": jsonStr | ||
| 268 | }, | ||
| 269 | "success": function (res) { | ||
| 270 | if (res && res.success) { | ||
| 271 | if (typeof callback == "function") callback(res.content); | ||
| 272 | } else { | ||
| 273 | if (typeof callback == "function") callback(""); | ||
| 274 | } | ||
| 275 | }, | ||
| 276 | "error": function (res) { | ||
| 277 | if (typeof callback == "function") callback(""); | ||
| 278 | } | ||
| 279 | }); | ||
| 280 | }; | ||
| 281 | //判断当前邀请码状态,分辨邀请者身份 | ||
| 282 | as.checkResourceId = function (resourceId, callback) { | ||
| 283 | as.co.checkAppCooperationInfoSelfOrNot({ | ||
| 284 | "param": { | ||
| 285 | "resourceId": resourceId | ||
| 286 | }, | ||
| 287 | "success": function (res) { | ||
| 288 | if (res && res.success) { | ||
| 289 | //res.content :"not exist"非邀请链接;"true"自己的分享链接;"false"他人的分享链接 | ||
| 290 | if (typeof callback == "function") callback(res.content); | ||
| 291 | } else { | ||
| 292 | if (typeof callback == "function") callback("not exist"); | ||
| 293 | } | ||
| 294 | }, | ||
| 295 | "error": function (res) { | ||
| 296 | if (typeof callback == "function") callback("not exist"); | ||
| 297 | } | ||
| 298 | }); | ||
| 299 | }; | ||
| 300 | //读取用户所有邀请码 | ||
| 301 | as.getResourceId = function (callback) { | ||
| 302 | as.co.queryCurrentUserAppCooperationInfoIdList({ | ||
| 303 | "success": function (res) { | ||
| 304 | if (typeof callback == "function") callback(res); | ||
| 305 | }, | ||
| 306 | "error": function (res) { | ||
| 307 | if (typeof callback == "function") callback([]); | ||
| 308 | } | ||
| 309 | }); | ||
| 310 | }; | ||
| 311 | //读取当前邀请码信息 | ||
| 312 | as.getUserInfoByResourceId = function (resourceId, callback) { | ||
| 313 | as.co.queryCurrentAppCooperationInfo({ | ||
| 314 | "param": { | ||
| 315 | "resourceId": resourceId | ||
| 316 | }, | ||
| 317 | "success": function (res) { | ||
| 318 | if (typeof callback == "function") callback(res); | ||
| 319 | }, | ||
| 320 | "error": function (res) { | ||
| 321 | if (typeof callback == "function") callback(null); | ||
| 322 | } | ||
| 323 | }); | ||
| 324 | }; | ||
| 325 | //为邀请码点赞 | ||
| 326 | as.addPraise = function (resourceId, callback) { | ||
| 327 | as.co.praise({ | ||
| 328 | "param": { | ||
| 329 | "resourceId": resourceId | ||
| 330 | }, | ||
| 331 | "success": function (res) { | ||
| 332 | if (typeof callback == "function") callback(res); | ||
| 333 | }, | ||
| 334 | "error": function (res) { | ||
| 335 | if (typeof callback == "function") callback(false); | ||
| 336 | } | ||
| 337 | }); | ||
| 338 | }; | ||
| 339 | //读取邀请码的点赞数 | ||
| 340 | as.getPraise = function (resourceId, callback) { | ||
| 341 | as.co.getPraiseRecordTotalByResourceId({ | ||
| 342 | "param": { | ||
| 343 | "resourceId": resourceId | ||
| 344 | }, | ||
| 345 | "success": function (res) { | ||
| 346 | if (typeof callback == "function") callback(res); | ||
| 347 | }, | ||
| 348 | "error": function (res) { | ||
| 349 | if (typeof callback == "function") callback(0); | ||
| 350 | } | ||
| 351 | }); | ||
| 352 | }; | ||
| 353 | //判断用户是否为邀请码点赞 | ||
| 354 | as.checkUserPraise = function (resourceId, callback) { | ||
| 355 | as.co.checkCurrentUserPraiseOrNot({ | ||
| 356 | "param": { | ||
| 357 | "resourceId": resourceId | ||
| 358 | }, | ||
| 359 | "success": function (res) { | ||
| 360 | if (typeof callback == "function") callback(res); | ||
| 361 | }, | ||
| 362 | "error": function (res) { | ||
| 363 | if (typeof callback == "function") callback(false); | ||
| 364 | } | ||
| 365 | }); | ||
| 366 | }; | ||
| 367 | as.getPraiseLog = function (resourceId, page, size, callback) { | ||
| 368 | as.co.queryPraiseRecordListByResourceId({ | ||
| 369 | "param": { | ||
| 370 | "resourceId": resourceId, | ||
| 371 | "page": page, | ||
| 372 | "size": size | ||
| 373 | }, | ||
| 374 | "success": function (res) { | ||
| 375 | if (typeof callback == "function") callback(res); | ||
| 376 | }, | ||
| 377 | "error": function (res) { | ||
| 378 | if (typeof callback == "function") callback([]); | ||
| 379 | } | ||
| 380 | }); | ||
| 381 | }; | ||
| 382 | //为邀请码评论 | ||
| 383 | as.addComment = function (resourceId, content, callback) { | ||
| 384 | as.co.comment({ | ||
| 385 | "param": { | ||
| 386 | "resourceId": resourceId, | ||
| 387 | "content": content, | ||
| 388 | "parentId": "", | ||
| 389 | "remark": "" | ||
| 390 | }, | ||
| 391 | "success": function (res) { | ||
| 392 | if (typeof callback == "function") callback(res); | ||
| 393 | }, | ||
| 394 | "error": function (res) { | ||
| 395 | if (typeof callback == "function") callback(null); | ||
| 396 | } | ||
| 397 | }); | ||
| 398 | }; | ||
| 399 | //评论列表 | ||
| 400 | as.queryCommentList = function (resourceId, page, size, callback) { | ||
| 401 | as.co.queryAppCooperationInfoCommentRecordList({ | ||
| 402 | "param": { | ||
| 403 | "resourceId": resourceId, | ||
| 404 | "page": page, | ||
| 405 | "size": size, | ||
| 406 | "ascending": false | ||
| 407 | }, | ||
| 408 | "success": function (res) { | ||
| 409 | if (typeof callback == "function") callback(res); | ||
| 410 | }, | ||
| 411 | "error": function (res) { | ||
| 412 | if (typeof callback == "function") callback([]); | ||
| 413 | } | ||
| 414 | }); | ||
| 415 | }; | ||
| 416 | //读取邀请码评论数 | ||
| 417 | as.queryCommentCount = function (resourceId, callback) { | ||
| 418 | as.co.getAppCooperationInfoCommentRecordTotal({ | ||
| 419 | "param": { | ||
| 420 | "resourceId": resourceId | ||
| 421 | }, | ||
| 422 | "success": function (res) { | ||
| 423 | if (typeof callback == "function") callback(res); | ||
| 424 | }, | ||
| 425 | "error": function (res) { | ||
| 426 | if (typeof callback == "function") callback(0); | ||
| 427 | } | ||
| 428 | }); | ||
| 429 | }; | ||
| 430 | //当前用户对邀请码的评论总数 | ||
| 431 | as.queryCommentCountByUser = function (resourceId, callback) { | ||
| 432 | as.co.getCurrentUserAppCooperationInfoCommentRecordTotal({ | ||
| 433 | "param": { | ||
| 434 | "resourceId": resourceId | ||
| 435 | }, | ||
| 436 | "success": function (res) { | ||
| 437 | if (typeof callback == "function") callback(res); | ||
| 438 | }, | ||
| 439 | "error": function (res) { | ||
| 440 | if (typeof callback == "function") callback(0); | ||
| 441 | } | ||
| 442 | }); | ||
| 443 | }; | ||
| 444 | /*------------------协作相关 end-----------------------*/ | ||
| 445 | |||
| 446 | /*------------------排行榜相关 start---------------------*/ | ||
| 447 | /* | ||
| 448 | * 提交成绩 | ||
| 449 | * rankName : 排行榜名字 | ||
| 450 | * score : 游戏分数 | ||
| 451 | * spendTime : 游戏耗时 | ||
| 452 | */ | ||
| 453 | as.rankSubmitScore = function (score, spendTime, callback) { | ||
| 454 | as.rank.saveRankScore({ | ||
| 455 | "param": { | ||
| 456 | "rankName": as.rankName, | ||
| 457 | "score": score, | ||
| 458 | "spendTime": spendTime | ||
| 459 | }, | ||
| 460 | "success": function (res) { | ||
| 461 | if (typeof callback == "function") callback(res); | ||
| 462 | }, | ||
| 463 | "error": function (res) { | ||
| 464 | if (typeof callback == "function") callback(null); | ||
| 465 | } | ||
| 466 | }); | ||
| 467 | }; | ||
| 468 | //查询排行榜(包含当前用户的排行记录) | ||
| 469 | as.rankQueryRankList = function (page, size, callback) { | ||
| 470 | as.rank.queryRankList({ | ||
| 471 | "param": { | ||
| 472 | "rankName": as.rankName, | ||
| 473 | "selfInclude": true, | ||
| 474 | "page": page, | ||
| 475 | "size": size | ||
| 476 | }, | ||
| 477 | "success": function (res) { | ||
| 478 | if (typeof callback == "function") callback(res); | ||
| 479 | }, | ||
| 480 | "error": function (res) { | ||
| 481 | if (typeof callback == "function") callback(null); | ||
| 482 | } | ||
| 483 | }); | ||
| 484 | }; | ||
| 485 | //查询当前用户排名 | ||
| 486 | as.rankQueryUserRankRecord = function (callback) { | ||
| 487 | as.rank.queryUserRankRecord({ | ||
| 488 | "param": { | ||
| 489 | "rankName": as.rankName | ||
| 490 | }, | ||
| 491 | "success": function (res) { | ||
| 492 | if (typeof callback == "function") callback(res); | ||
| 493 | }, | ||
| 494 | "error": function (res) { | ||
| 495 | if (typeof callback == "function") callback(null); | ||
| 496 | } | ||
| 497 | }); | ||
| 498 | }; | ||
| 499 | //查询当前用户的记录 | ||
| 500 | as.rankQueryRankHistory = function (callback) { | ||
| 501 | as.rank.queryRankHistory({ | ||
| 502 | "param": { | ||
| 503 | "rankName": as.rankName | ||
| 504 | }, | ||
| 505 | "success": function (res) { | ||
| 506 | console.log(res, "rankQueryUserRankRecord success"); | ||
| 507 | if (typeof callback == "function") callback(res); | ||
| 508 | }, | ||
| 509 | "error": function (res) { | ||
| 510 | console.log(res.response, "rankQueryUserRankRecord error"); | ||
| 511 | if (typeof callback == "function") callback(null); | ||
| 512 | } | ||
| 513 | }); | ||
| 514 | }; | ||
| 515 | /*------------------排行榜相关 end-----------------------*/ | ||
| 516 | |||
| 517 | /*------------------派加接口相关 start---------------------*/ | ||
| 518 | //读取用户积分 | ||
| 519 | as.getIntegral = function (callback) { | ||
| 520 | as.piplus.readUserIntegral({ | ||
| 521 | "success": function (res) { | ||
| 522 | if (res && res.integral) { | ||
| 523 | if (typeof callback == "function") callback(res.integral); | ||
| 524 | } else { | ||
| 525 | if (typeof callback == "function") callback(0); | ||
| 526 | } | ||
| 527 | }, | ||
| 528 | "error": function (res) { | ||
| 529 | if (typeof callback == "function") callback(0); | ||
| 530 | } | ||
| 531 | }); | ||
| 532 | }; | ||
| 533 | //判断当前用户是否会员 | ||
| 534 | as.checkMember = function (callback) { | ||
| 535 | as.piplus.isMember({ | ||
| 536 | "success": function (res) { | ||
| 537 | if (typeof callback == "function") callback(res); | ||
| 538 | }, | ||
| 539 | "error": function (res) { | ||
| 540 | if (typeof callback == "function") callback({ | ||
| 541 | "isMember": false, | ||
| 542 | "integral": 0 | ||
| 543 | }); | ||
| 544 | } | ||
| 545 | }); | ||
| 546 | }; | ||
| 547 | //查询当前用户会员信息 | ||
| 548 | as.readMember = function (callback) { | ||
| 549 | as.piplus.readMember({ | ||
| 550 | "success": function (res) { | ||
| 551 | if (typeof callback == "function") callback(res); | ||
| 552 | }, | ||
| 553 | "error": function (res) { | ||
| 554 | if (typeof callback == "function") callback({ | ||
| 555 | "status": false | ||
| 556 | }); | ||
| 557 | } | ||
| 558 | }); | ||
| 559 | }; | ||
| 560 | //同步会员信息 | ||
| 561 | as.commonSaveUserInfo = function (user_name, mobile, province, city, area, address, birthday, tags, callback) { | ||
| 562 | as.piplus.commonSaveUserInfo({ | ||
| 563 | "param": { | ||
| 564 | "user_name": user_name, | ||
| 565 | "mobile": mobile, | ||
| 566 | "province": province, | ||
| 567 | "city": city, | ||
| 568 | "area": area, | ||
| 569 | "address": address, | ||
| 570 | "birthday": birthday, | ||
| 571 | "tags": tags | ||
| 572 | }, | ||
| 573 | "success": function (res) { | ||
| 574 | if (typeof callback == "function") callback(res); | ||
| 575 | }, | ||
| 576 | "error": function (res) { | ||
| 577 | if (typeof callback == "function") callback({ | ||
| 578 | "status": false | ||
| 579 | }); | ||
| 580 | } | ||
| 581 | }); | ||
| 582 | }; | ||
| 583 | //获取省份 | ||
| 584 | as.getProvinces = function (callback) { | ||
| 585 | as.piplus.getProvinces({ | ||
| 586 | "success": function (res) { | ||
| 587 | if (res.http_status && res.errmsg == "success") { | ||
| 588 | if (typeof callback == "function") callback(res.data); | ||
| 589 | } else { | ||
| 590 | if (typeof callback == "function") callback([]); | ||
| 591 | } | ||
| 592 | }, | ||
| 593 | "error": function (res) { | ||
| 594 | if (typeof callback == "function") callback([]); | ||
| 595 | } | ||
| 596 | }); | ||
| 597 | }; | ||
| 598 | //获取城市 | ||
| 599 | as.getCity = function (regionId, callback) { | ||
| 600 | as.piplus.getCity({ | ||
| 601 | "param": { | ||
| 602 | "regionId": regionId | ||
| 603 | }, | ||
| 604 | "success": function (res) { | ||
| 605 | if (res.http_status && res.errmsg == "success") { | ||
| 606 | if (typeof callback == "function") callback(res.data); | ||
| 607 | } else { | ||
| 608 | if (typeof callback == "function") callback([]); | ||
| 609 | } | ||
| 610 | }, | ||
| 611 | "error": function (res) { | ||
| 612 | if (typeof callback == "function") callback([]); | ||
| 613 | } | ||
| 614 | }); | ||
| 615 | }; | ||
| 616 | //获取区域 | ||
| 617 | as.getArea = function (regionId, callback) { | ||
| 618 | as.piplus.getCity({ | ||
| 619 | "param": { | ||
| 620 | "regionId": regionId | ||
| 621 | }, | ||
| 622 | "success": function (res) { | ||
| 623 | if (res.http_status && res.errmsg == "success") { | ||
| 624 | if (typeof callback == "function") callback(res.data); | ||
| 625 | } else { | ||
| 626 | if (typeof callback == "function") callback([]); | ||
| 627 | } | ||
| 628 | }, | ||
| 629 | "error": function (res) { | ||
| 630 | if (typeof callback == "function") callback([]); | ||
| 631 | } | ||
| 632 | }); | ||
| 633 | }; | ||
| 634 | /*------------------派加接口相关 end-----------------------*/ | ||
| 635 | |||
| 636 | /*------------------图片路径转换 start---------------------*/ | ||
| 637 | as.getJpgCdnUrl = function (imgUrl, callback) { | ||
| 638 | as.jpgCdn.getJpgCDNUrl({ | ||
| 639 | "param": { | ||
| 640 | "imgUrl": imgUrl | ||
| 641 | }, | ||
| 642 | "success": function (res) { | ||
| 643 | if (res && res.success) { | ||
| 644 | if (typeof callback == "function") callback(res.content); | ||
| 645 | } else { | ||
| 646 | if (typeof callback == "function") callback(null); | ||
| 647 | } | ||
| 648 | }, | ||
| 649 | "error": function (res) { | ||
| 650 | if (typeof callback == "function") callback(null); | ||
| 651 | } | ||
| 652 | }); | ||
| 653 | }; | ||
| 654 | as.getCdnImg = function (imgName, callback) { | ||
| 655 | if (typeof callback == "function") | ||
| 656 | callback(as.jpgCdn.getCDNImg(imgName)); | ||
| 657 | }; | ||
| 658 | as.designImg = function (imgName, height, callback) { | ||
| 659 | if (typeof callback == "function") | ||
| 660 | callback(as.jpgCdn.designImg(imgName, height)); | ||
| 661 | }; | ||
| 662 | /*------------------图片路径转换 end-----------------------*/ | ||
| 663 | |||
| 664 | /*------------------上传照片相关 start---------------------*/ | ||
| 665 | as.uploadBase64 = function (base64, callback) { | ||
| 666 | as.file.uploadBase64(base64, as.AppID, { | ||
| 667 | "success": function (res) { | ||
| 668 | var obj = { | ||
| 669 | "result": true, | ||
| 670 | "data": res | ||
| 671 | }; | ||
| 672 | if (typeof callback == "function") callback(obj); | ||
| 673 | }, | ||
| 674 | "error": function (res) { | ||
| 675 | if (typeof callback == "function") callback({ | ||
| 676 | "result": false | ||
| 677 | }); | ||
| 678 | } | ||
| 679 | }); | ||
| 680 | }; | ||
| 681 | /*------------------上传照片相关 end-----------------------*/ | ||
| 682 | |||
| 683 | /*------------------微信语音 start---------------------*/ | ||
| 684 | //开始录音 | ||
| 685 | as.startRecord = function (callback) { | ||
| 686 | if (typeof wx != "undefined" && wx != void 0) { | ||
| 687 | var completeFn = function (res) { | ||
| 688 | if (res["errMsg"] == "startRecord:ok") { | ||
| 689 | if (typeof callback == "function") callback(true); | ||
| 690 | } | ||
| 691 | } | ||
| 692 | |||
| 693 | wx.startRecord({ | ||
| 694 | cancel: function () { | ||
| 695 | alert('用户拒绝授权录音'); | ||
| 696 | if (typeof callback == "function") callback(false); | ||
| 697 | }, | ||
| 698 | complete: completeFn, | ||
| 699 | }); | ||
| 700 | // if (typeof callback == "function") callback(true); | ||
| 701 | } else { | ||
| 702 | if (typeof callback == "function") callback(false); | ||
| 703 | } | ||
| 704 | }; | ||
| 705 | //停止录音 | ||
| 706 | as.stopRecord = function (callback) { | ||
| 707 | if (typeof wx != "undefined" && wx != void 0) { | ||
| 708 | wx.stopRecord({ | ||
| 709 | success: function (res) { | ||
| 710 | if (typeof callback == "function") callback(res.localId); | ||
| 711 | } | ||
| 712 | }); | ||
| 713 | } else { | ||
| 714 | if (typeof callback == "function") callback(""); | ||
| 715 | } | ||
| 716 | }; | ||
| 717 | //上传语音到微信服务器 | ||
| 718 | as.uploadVoice = function (localId, callback) { | ||
| 719 | if (typeof wx != "undefined" && wx != void 0 && localId != "") { | ||
| 720 | wx.uploadVoice({ | ||
| 721 | "localId": localId, // 需要上传的音频的本地ID,由stopRecord接口获得 | ||
| 722 | "isShowProgressTips": 1, // 默认为1,显示进度提示 | ||
| 723 | "success": function (res) { | ||
| 724 | if (typeof callback == "function") callback(res.serverId); | ||
| 725 | } | ||
| 726 | }); | ||
| 727 | } else { | ||
| 728 | if (typeof callback == "function") callback(""); | ||
| 729 | } | ||
| 730 | }; | ||
| 731 | //下载微信服务语音到本地 | ||
| 732 | as.downloadVoice = function (serverId, callback) { | ||
| 733 | if (typeof wx != "undefined" && wx != void 0 && serverId != "") { | ||
| 734 | wx.downloadVoice({ | ||
| 735 | "serverId": serverId, // 需要下载的音频的服务器端ID,由uploadVoice接口获得 | ||
| 736 | "isShowProgressTips": 1, // 默认为1,显示进度提示 | ||
| 737 | "success": function (res) { | ||
| 738 | if (res && res.localId) { | ||
| 739 | if (typeof callback === "function") callback(res.localId); | ||
| 740 | } else { | ||
| 741 | if (typeof callback === "function") callback(""); | ||
| 742 | } | ||
| 743 | } | ||
| 744 | }); | ||
| 745 | } else { | ||
| 746 | if (typeof callback === "function") callback(""); | ||
| 747 | } | ||
| 748 | }; | ||
| 749 | |||
| 750 | //保存录音 | ||
| 751 | as.saveUserVoice = function (vid, serverId, callback) { | ||
| 752 | as.wxMultimedia.record({ | ||
| 753 | "param": { | ||
| 754 | "vId": vid, | ||
| 755 | "serverId": serverId | ||
| 756 | }, | ||
| 757 | "success": function (res) { | ||
| 758 | if (res && res.code == 10000) { | ||
| 759 | if (typeof callback == "function") callback(true); | ||
| 760 | } else { | ||
| 761 | if (typeof callback == "function") callback(false); | ||
| 762 | } | ||
| 763 | }, | ||
| 764 | "error": function (res) { | ||
| 765 | if (typeof callback == "function") callback(false); | ||
| 766 | } | ||
| 767 | }); | ||
| 768 | }; | ||
| 769 | //读取单个录音 | ||
| 770 | as.getUserVoice = function (vid, callback) { | ||
| 771 | try { | ||
| 772 | as.wxMultimedia.get({ | ||
| 773 | "param": { | ||
| 774 | "vId": vid | ||
| 775 | }, | ||
| 776 | "success": function (res) { | ||
| 777 | if (typeof callback == "function") callback(res); | ||
| 778 | }, | ||
| 779 | "error": function (res) { | ||
| 780 | if (typeof callback == "function") callback(null); | ||
| 781 | } | ||
| 782 | }); | ||
| 783 | } catch (e) { | ||
| 784 | if (typeof callback == "function") callback(null); | ||
| 785 | } | ||
| 786 | }; | ||
| 787 | |||
| 788 | //播放声音 | ||
| 789 | as.playVoice = function (localId, voiceStatus, voiceUrl, serverId, callback) { | ||
| 790 | if (localId != "") { | ||
| 791 | as.playRecord(localId, function () { | ||
| 792 | if (typeof callback == "function") callback(true, null); | ||
| 793 | }); | ||
| 794 | } else if ((voiceStatus == "CONVERT_SUCCESS" || voiceStatus == 6) && voiceUrl != "") { | ||
| 795 | var dom = document.getElementsByTagName("body")[0]; | ||
| 796 | var nDiv = document.createElement("div"); | ||
| 797 | nDiv.style.width = "0px"; | ||
| 798 | nDiv.style.height = "0px"; | ||
| 799 | nDiv.style.position = "absolute"; | ||
| 800 | var sound = document.createElement("audio"); | ||
| 801 | sound.src = voiceUrl; | ||
| 802 | //sound.preload= "preload"; | ||
| 803 | //sound.src = src; | ||
| 804 | nDiv.appendChild(sound); | ||
| 805 | dom.appendChild(nDiv); | ||
| 806 | sound.addEventListener("ended", function () { | ||
| 807 | if (typeof callback === "function") callback(true, null); | ||
| 808 | }, false); | ||
| 809 | sound.play(); | ||
| 810 | } else if (serverId != "") { | ||
| 811 | as.downloadVoice(serverId, function (res) { | ||
| 812 | as.playRecord(res, function () { | ||
| 813 | if (typeof callback == "function") callback(true, res); | ||
| 814 | }); | ||
| 815 | }); | ||
| 816 | } else { | ||
| 817 | if (typeof callback === "function") callback(false, null); | ||
| 818 | } | ||
| 819 | }; | ||
| 820 | //播放录音(微信) | ||
| 821 | as.playRecord = function (localId, callback) { | ||
| 822 | if (typeof wx != "undefined" && wx != void 0 && localId != "") { | ||
| 823 | wx.playVoice({ | ||
| 824 | localId: localId // 需要播放的音频的本地ID,由stopRecord接口获得 | ||
| 825 | }); | ||
| 826 | |||
| 827 | wx.onVoicePlayEnd({ | ||
| 828 | success: function (res) { | ||
| 829 | if (typeof callback === "function") callback(true); | ||
| 830 | } | ||
| 831 | }); | ||
| 832 | } else { | ||
| 833 | if (typeof callback === "function") callback(false); | ||
| 834 | } | ||
| 835 | }; | ||
| 836 | //停止播放录音(微信) | ||
| 837 | as.stopVoice = function (localId) { | ||
| 838 | if (typeof wx != "undefined" && wx != void 0 && localId != "") { | ||
| 839 | wx.stopVoice({ | ||
| 840 | localId: localId | ||
| 841 | }); | ||
| 842 | } | ||
| 843 | }; | ||
| 844 | /*------------------微信语音 end---------------------*/ | ||
| 845 | |||
| 846 | /*------------------其它 start---------------------*/ | ||
| 847 | /* | ||
| 848 | * tableName 要存的表的名字 | ||
| 849 | * data 为字典结构 | ||
| 850 | * 例如 data = {} | ||
| 851 | * data["key"] = value; | ||
| 852 | */ | ||
| 853 | as.saveTable = function (tableName, value, callback) { | ||
| 854 | var table = HDP.getTable(tableName); | ||
| 855 | for (var key in value) { | ||
| 856 | table.set(key, value[key]); | ||
| 857 | } | ||
| 858 | table.save({ | ||
| 859 | "success": function (res) { | ||
| 860 | if (typeof callback == "function") callback(res); | ||
| 861 | }, | ||
| 862 | "error": function (res) { | ||
| 863 | if (typeof callback == "function") callback(null); | ||
| 864 | } | ||
| 865 | }); | ||
| 866 | }; | ||
| 867 | /*------------------其它 end-----------------------*/ | ||
| 868 | |||
| 869 | /*------------------ 以下为定制化接口 ---------------------*/ | ||
| 870 | as.bizInterface = null; | ||
| 871 | //多奖池抽奖 | ||
| 872 | as.bizManyLottery = function (appId, callback) { | ||
| 873 | if (as.bizInterface == null) { | ||
| 874 | as.bizInterface = HDP.getBizInterface(); | ||
| 875 | } | ||
| 876 | |||
| 877 | if (appId == undefined || appId == null || appId == "") { | ||
| 878 | if (typeof callback == "function") callback({ | ||
| 879 | "result": false | ||
| 880 | }); | ||
| 881 | } | ||
| 882 | |||
| 883 | as.bizInterface.manyLottery({ | ||
| 884 | "param": { | ||
| 885 | "appId": appId | ||
| 886 | }, | ||
| 887 | "success": function (res) { | ||
| 888 | if (res && res.success && res.content) { | ||
| 889 | if (typeof callback == "function") callback(res.content); | ||
| 890 | } else { | ||
| 891 | if (typeof callback == "function") callback({ | ||
| 892 | "result": false | ||
| 893 | }); | ||
| 894 | } | ||
| 895 | }, | ||
| 896 | "error": function (res) { | ||
| 897 | if (typeof callback == "function") callback({ | ||
| 898 | "result": false | ||
| 899 | }); | ||
| 900 | } | ||
| 901 | }); | ||
| 902 | }; | ||
| 903 | |||
| 904 | // module.exports = as; |
static/js/hdp-4.4.0.min.js
0 → 100644
This diff could not be displayed because it is too large.
static/js/weixin-1.1.0.js
0 → 100644
| 1 | !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 | ... | \ No newline at end of file |
-
Please register or sign in to post a comment