|
@@ -1,6 +1,6 @@
|
|
-(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
|
|
|
|
-
|
|
|
|
-/***/ 1:
|
|
|
|
|
|
+(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
|
|
|
|
+/* 0 */,
|
|
|
|
+/* 1 */
|
|
/*!************************************************************!*\
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
|
|
!*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
|
|
\************************************************************/
|
|
\************************************************************/
|
|
@@ -1554,137 +1554,7 @@ var uni$1 = uni;var _default =
|
|
uni$1;exports.default = _default;
|
|
uni$1;exports.default = _default;
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
-
|
|
|
|
-/***/ 14:
|
|
|
|
-/*!**********************************************************************************************************!*\
|
|
|
|
- !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
|
|
|
|
- \**********************************************************************************************************/
|
|
|
|
-/*! exports provided: default */
|
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
-
|
|
|
|
-"use strict";
|
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
|
|
|
|
-/* globals __VUE_SSR_CONTEXT__ */
|
|
|
|
-
|
|
|
|
-// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
|
|
-// This module is a runtime utility for cleaner component module output and will
|
|
|
|
-// be included in the final webpack user bundle.
|
|
|
|
-
|
|
|
|
-function normalizeComponent (
|
|
|
|
- scriptExports,
|
|
|
|
- render,
|
|
|
|
- staticRenderFns,
|
|
|
|
- functionalTemplate,
|
|
|
|
- injectStyles,
|
|
|
|
- scopeId,
|
|
|
|
- moduleIdentifier, /* server only */
|
|
|
|
- shadowMode, /* vue-cli only */
|
|
|
|
- components, // fixed by xxxxxx auto components
|
|
|
|
- renderjs // fixed by xxxxxx renderjs
|
|
|
|
-) {
|
|
|
|
- // Vue.extend constructor export interop
|
|
|
|
- var options = typeof scriptExports === 'function'
|
|
|
|
- ? scriptExports.options
|
|
|
|
- : scriptExports
|
|
|
|
-
|
|
|
|
- // fixed by xxxxxx auto components
|
|
|
|
- if (components) {
|
|
|
|
- if (!options.components) {
|
|
|
|
- options.components = {}
|
|
|
|
- }
|
|
|
|
- var hasOwn = Object.prototype.hasOwnProperty
|
|
|
|
- for (var name in components) {
|
|
|
|
- if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
|
|
|
|
- options.components[name] = components[name]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // fixed by xxxxxx renderjs
|
|
|
|
- if (renderjs) {
|
|
|
|
- (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
|
|
|
|
- this[renderjs.__module] = this
|
|
|
|
- });
|
|
|
|
- (options.mixins || (options.mixins = [])).push(renderjs)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // render functions
|
|
|
|
- if (render) {
|
|
|
|
- options.render = render
|
|
|
|
- options.staticRenderFns = staticRenderFns
|
|
|
|
- options._compiled = true
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // functional template
|
|
|
|
- if (functionalTemplate) {
|
|
|
|
- options.functional = true
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // scopedId
|
|
|
|
- if (scopeId) {
|
|
|
|
- options._scopeId = 'data-v-' + scopeId
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var hook
|
|
|
|
- if (moduleIdentifier) { // server build
|
|
|
|
- hook = function (context) {
|
|
|
|
- // 2.3 injection
|
|
|
|
- context =
|
|
|
|
- context || // cached call
|
|
|
|
- (this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
|
|
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
|
|
- // 2.2 with runInNewContext: true
|
|
|
|
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
|
|
- context = __VUE_SSR_CONTEXT__
|
|
|
|
- }
|
|
|
|
- // inject component styles
|
|
|
|
- if (injectStyles) {
|
|
|
|
- injectStyles.call(this, context)
|
|
|
|
- }
|
|
|
|
- // register component module identifier for async chunk inferrence
|
|
|
|
- if (context && context._registeredComponents) {
|
|
|
|
- context._registeredComponents.add(moduleIdentifier)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // used by ssr in case component is cached and beforeCreate
|
|
|
|
- // never gets called
|
|
|
|
- options._ssrRegister = hook
|
|
|
|
- } else if (injectStyles) {
|
|
|
|
- hook = shadowMode
|
|
|
|
- ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
|
|
|
- : injectStyles
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (hook) {
|
|
|
|
- if (options.functional) {
|
|
|
|
- // for template-only hot-reload because in that case the render fn doesn't
|
|
|
|
- // go through the normalizer
|
|
|
|
- options._injectStyles = hook
|
|
|
|
- // register for functioal component in vue file
|
|
|
|
- var originalRender = options.render
|
|
|
|
- options.render = function renderWithStyleInjection (h, context) {
|
|
|
|
- hook.call(context)
|
|
|
|
- return originalRender(h, context)
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- // inject component registration as beforeCreate hook
|
|
|
|
- var existing = options.beforeCreate
|
|
|
|
- options.beforeCreate = existing
|
|
|
|
- ? [].concat(existing, hook)
|
|
|
|
- : [hook]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
- exports: scriptExports,
|
|
|
|
- options: options
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-/***/ }),
|
|
|
|
-
|
|
|
|
-/***/ 2:
|
|
|
|
|
|
+/* 2 */
|
|
/*!******************************************************************************************!*\
|
|
/*!******************************************************************************************!*\
|
|
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
|
|
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
|
|
\******************************************************************************************/
|
|
\******************************************************************************************/
|
|
@@ -7713,8 +7583,7 @@ internalMixin(Vue);
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
-
|
|
|
|
-/***/ 3:
|
|
|
|
|
|
+/* 3 */
|
|
/*!***********************************!*\
|
|
/*!***********************************!*\
|
|
!*** (webpack)/buildin/global.js ***!
|
|
!*** (webpack)/buildin/global.js ***!
|
|
\***********************************/
|
|
\***********************************/
|
|
@@ -7744,1987 +7613,2111 @@ module.exports = g;
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
+/* 4 */
|
|
|
|
+/*!*****************************************************************************!*\
|
|
|
|
+ !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/pages.json ***!
|
|
|
|
+ \*****************************************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
-/***/ 37:
|
|
|
|
-/*!********************************************!*\
|
|
|
|
- !*** ./node_modules/vuex/dist/vuex.esm.js ***!
|
|
|
|
- \********************************************/
|
|
|
|
-/*! exports provided: Store, install, mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers, default */
|
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
+"use strict";
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/***/ }),
|
|
|
|
+/* 5 */
|
|
|
|
+/*!*******************************************************!*\
|
|
|
|
+ !*** ./node_modules/@dcloudio/uni-stat/dist/index.js ***!
|
|
|
|
+ \*******************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
"use strict";
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
|
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
|
|
|
|
-/**
|
|
|
|
- * vuex v3.0.1
|
|
|
|
- * (c) 2017 Evan You
|
|
|
|
- * @license MIT
|
|
|
|
- */
|
|
|
|
-var applyMixin = function (Vue) {
|
|
|
|
- var version = Number(Vue.version.split('.')[0]);
|
|
|
|
|
|
+/* WEBPACK VAR INJECTION */(function(uni) {var _package = __webpack_require__(/*! ../package.json */ 6);function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}
|
|
|
|
|
|
- if (version >= 2) {
|
|
|
|
- Vue.mixin({ beforeCreate: vuexInit });
|
|
|
|
- } else {
|
|
|
|
- // override init and inject vuex init procedure
|
|
|
|
- // for 1.x backwards compatibility.
|
|
|
|
- var _init = Vue.prototype._init;
|
|
|
|
- Vue.prototype._init = function (options) {
|
|
|
|
- if ( options === void 0 ) options = {};
|
|
|
|
|
|
+var STAT_VERSION = _package.version;
|
|
|
|
+var STAT_URL = 'https://tongji.dcloud.io/uni/stat';
|
|
|
|
+var STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
|
|
|
|
+var PAGE_PVER_TIME = 1800;
|
|
|
|
+var APP_PVER_TIME = 300;
|
|
|
|
+var OPERATING_TIME = 10;
|
|
|
|
|
|
- options.init = options.init
|
|
|
|
- ? [vuexInit].concat(options.init)
|
|
|
|
- : vuexInit;
|
|
|
|
- _init.call(this, options);
|
|
|
|
- };
|
|
|
|
|
|
+var UUID_KEY = '__DC_STAT_UUID';
|
|
|
|
+var UUID_VALUE = '__DC_UUID_VALUE';
|
|
|
|
+
|
|
|
|
+function getUuid() {
|
|
|
|
+ var uuid = '';
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ try {
|
|
|
|
+ uuid = plus.runtime.getDCloudId();
|
|
|
|
+ } catch (e) {
|
|
|
|
+ uuid = '';
|
|
|
|
+ }
|
|
|
|
+ return uuid;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * Vuex init hook, injected into each instances init hooks list.
|
|
|
|
- */
|
|
|
|
|
|
+ try {
|
|
|
|
+ uuid = uni.getStorageSync(UUID_KEY);
|
|
|
|
+ } catch (e) {
|
|
|
|
+ uuid = UUID_VALUE;
|
|
|
|
+ }
|
|
|
|
|
|
- function vuexInit () {
|
|
|
|
- var options = this.$options;
|
|
|
|
- // store injection
|
|
|
|
- if (options.store) {
|
|
|
|
- this.$store = typeof options.store === 'function'
|
|
|
|
- ? options.store()
|
|
|
|
- : options.store;
|
|
|
|
- } else if (options.parent && options.parent.$store) {
|
|
|
|
- this.$store = options.parent.$store;
|
|
|
|
|
|
+ if (!uuid) {
|
|
|
|
+ uuid = Date.now() + '' + Math.floor(Math.random() * 1e7);
|
|
|
|
+ try {
|
|
|
|
+ uni.setStorageSync(UUID_KEY, uuid);
|
|
|
|
+ } catch (e) {
|
|
|
|
+ uni.setStorageSync(UUID_KEY, UUID_VALUE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
+ return uuid;
|
|
|
|
+}
|
|
|
|
|
|
-var devtoolHook =
|
|
|
|
- typeof window !== 'undefined' &&
|
|
|
|
- window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
|
|
|
|
+var getSgin = function getSgin(statData) {
|
|
|
|
+ var arr = Object.keys(statData);
|
|
|
|
+ var sortArr = arr.sort();
|
|
|
|
+ var sgin = {};
|
|
|
|
+ var sginStr = '';
|
|
|
|
+ for (var i in sortArr) {
|
|
|
|
+ sgin[sortArr[i]] = statData[sortArr[i]];
|
|
|
|
+ sginStr += sortArr[i] + '=' + statData[sortArr[i]] + '&';
|
|
|
|
+ }
|
|
|
|
+ // const options = sginStr.substr(0, sginStr.length - 1)
|
|
|
|
+ // sginStr = sginStr.substr(0, sginStr.length - 1) + '&key=' + STAT_KEY;
|
|
|
|
+ // const si = crypto.createHash('md5').update(sginStr).digest('hex');
|
|
|
|
+ return {
|
|
|
|
+ sign: '',
|
|
|
|
+ options: sginStr.substr(0, sginStr.length - 1) };
|
|
|
|
|
|
-function devtoolPlugin (store) {
|
|
|
|
- if (!devtoolHook) { return }
|
|
|
|
|
|
+};
|
|
|
|
|
|
- store._devtoolHook = devtoolHook;
|
|
|
|
|
|
+var getSplicing = function getSplicing(data) {
|
|
|
|
+ var str = '';
|
|
|
|
+ for (var i in data) {
|
|
|
|
+ str += i + '=' + data[i] + '&';
|
|
|
|
+ }
|
|
|
|
+ return str.substr(0, str.length - 1);
|
|
|
|
+};
|
|
|
|
|
|
- devtoolHook.emit('vuex:init', store);
|
|
|
|
|
|
+var getTime = function getTime() {
|
|
|
|
+ return parseInt(new Date().getTime() / 1000);
|
|
|
|
+};
|
|
|
|
|
|
- devtoolHook.on('vuex:travel-to-state', function (targetState) {
|
|
|
|
- store.replaceState(targetState);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- store.subscribe(function (mutation, state) {
|
|
|
|
- devtoolHook.emit('vuex:mutation', mutation, state);
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * Get the first item that pass the test
|
|
|
|
- * by second argument function
|
|
|
|
- *
|
|
|
|
- * @param {Array} list
|
|
|
|
- * @param {Function} f
|
|
|
|
- * @return {*}
|
|
|
|
- */
|
|
|
|
-/**
|
|
|
|
- * Deep copy the given object considering circular structure.
|
|
|
|
- * This function caches all nested objects and its copies.
|
|
|
|
- * If it detects circular structure, use cached copy to avoid infinite loop.
|
|
|
|
- *
|
|
|
|
- * @param {*} obj
|
|
|
|
- * @param {Array<Object>} cache
|
|
|
|
- * @return {*}
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * forEach for object
|
|
|
|
- */
|
|
|
|
-function forEachValue (obj, fn) {
|
|
|
|
- Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function isObject (obj) {
|
|
|
|
- return obj !== null && typeof obj === 'object'
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function isPromise (val) {
|
|
|
|
- return val && typeof val.then === 'function'
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function assert (condition, msg) {
|
|
|
|
- if (!condition) { throw new Error(("[vuex] " + msg)) }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-var Module = function Module (rawModule, runtime) {
|
|
|
|
- this.runtime = runtime;
|
|
|
|
- this._children = Object.create(null);
|
|
|
|
- this._rawModule = rawModule;
|
|
|
|
- var rawState = rawModule.state;
|
|
|
|
- this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-var prototypeAccessors$1 = { namespaced: { configurable: true } };
|
|
|
|
|
|
+var getPlatformName = function getPlatformName() {
|
|
|
|
+ var platformList = {
|
|
|
|
+ 'app-plus': 'n',
|
|
|
|
+ 'h5': 'h5',
|
|
|
|
+ 'mp-weixin': 'wx',
|
|
|
|
+ 'mp-alipay': 'ali',
|
|
|
|
+ 'mp-baidu': 'bd',
|
|
|
|
+ 'mp-toutiao': 'tt',
|
|
|
|
+ 'mp-qq': 'qq' };
|
|
|
|
|
|
-prototypeAccessors$1.namespaced.get = function () {
|
|
|
|
- return !!this._rawModule.namespaced
|
|
|
|
|
|
+ return platformList["mp-weixin"];
|
|
};
|
|
};
|
|
|
|
|
|
-Module.prototype.addChild = function addChild (key, module) {
|
|
|
|
- this._children[key] = module;
|
|
|
|
|
|
+var getPackName = function getPackName() {
|
|
|
|
+ var packName = '';
|
|
|
|
+ if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
|
|
|
|
+ // 兼容微信小程序低版本基础库
|
|
|
|
+ if (uni.canIUse('getAccountInfoSync')) {
|
|
|
|
+ packName = uni.getAccountInfoSync().miniProgram.appId || '';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return packName;
|
|
};
|
|
};
|
|
|
|
|
|
-Module.prototype.removeChild = function removeChild (key) {
|
|
|
|
- delete this._children[key];
|
|
|
|
|
|
+var getVersion = function getVersion() {
|
|
|
|
+ return getPlatformName() === 'n' ? plus.runtime.version : '';
|
|
};
|
|
};
|
|
|
|
|
|
-Module.prototype.getChild = function getChild (key) {
|
|
|
|
- return this._children[key]
|
|
|
|
|
|
+var getChannel = function getChannel() {
|
|
|
|
+ var platformName = getPlatformName();
|
|
|
|
+ var channel = '';
|
|
|
|
+ if (platformName === 'n') {
|
|
|
|
+ channel = plus.runtime.channel;
|
|
|
|
+ }
|
|
|
|
+ return channel;
|
|
};
|
|
};
|
|
|
|
|
|
-Module.prototype.update = function update (rawModule) {
|
|
|
|
- this._rawModule.namespaced = rawModule.namespaced;
|
|
|
|
- if (rawModule.actions) {
|
|
|
|
- this._rawModule.actions = rawModule.actions;
|
|
|
|
- }
|
|
|
|
- if (rawModule.mutations) {
|
|
|
|
- this._rawModule.mutations = rawModule.mutations;
|
|
|
|
|
|
+var getScene = function getScene(options) {
|
|
|
|
+ var platformName = getPlatformName();
|
|
|
|
+ var scene = '';
|
|
|
|
+ if (options) {
|
|
|
|
+ return options;
|
|
}
|
|
}
|
|
- if (rawModule.getters) {
|
|
|
|
- this._rawModule.getters = rawModule.getters;
|
|
|
|
|
|
+ if (platformName === 'wx') {
|
|
|
|
+ scene = uni.getLaunchOptionsSync().scene;
|
|
}
|
|
}
|
|
|
|
+ return scene;
|
|
};
|
|
};
|
|
|
|
+var First__Visit__Time__KEY = 'First__Visit__Time';
|
|
|
|
+var Last__Visit__Time__KEY = 'Last__Visit__Time';
|
|
|
|
|
|
-Module.prototype.forEachChild = function forEachChild (fn) {
|
|
|
|
- forEachValue(this._children, fn);
|
|
|
|
|
|
+var getFirstVisitTime = function getFirstVisitTime() {
|
|
|
|
+ var timeStorge = uni.getStorageSync(First__Visit__Time__KEY);
|
|
|
|
+ var time = 0;
|
|
|
|
+ if (timeStorge) {
|
|
|
|
+ time = timeStorge;
|
|
|
|
+ } else {
|
|
|
|
+ time = getTime();
|
|
|
|
+ uni.setStorageSync(First__Visit__Time__KEY, time);
|
|
|
|
+ uni.removeStorageSync(Last__Visit__Time__KEY);
|
|
|
|
+ }
|
|
|
|
+ return time;
|
|
};
|
|
};
|
|
|
|
|
|
-Module.prototype.forEachGetter = function forEachGetter (fn) {
|
|
|
|
- if (this._rawModule.getters) {
|
|
|
|
- forEachValue(this._rawModule.getters, fn);
|
|
|
|
|
|
+var getLastVisitTime = function getLastVisitTime() {
|
|
|
|
+ var timeStorge = uni.getStorageSync(Last__Visit__Time__KEY);
|
|
|
|
+ var time = 0;
|
|
|
|
+ if (timeStorge) {
|
|
|
|
+ time = timeStorge;
|
|
|
|
+ } else {
|
|
|
|
+ time = '';
|
|
}
|
|
}
|
|
|
|
+ uni.setStorageSync(Last__Visit__Time__KEY, getTime());
|
|
|
|
+ return time;
|
|
};
|
|
};
|
|
|
|
|
|
-Module.prototype.forEachAction = function forEachAction (fn) {
|
|
|
|
- if (this._rawModule.actions) {
|
|
|
|
- forEachValue(this._rawModule.actions, fn);
|
|
|
|
|
|
+
|
|
|
|
+var PAGE_RESIDENCE_TIME = '__page__residence__time';
|
|
|
|
+var First_Page_residence_time = 0;
|
|
|
|
+var Last_Page_residence_time = 0;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+var setPageResidenceTime = function setPageResidenceTime() {
|
|
|
|
+ First_Page_residence_time = getTime();
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ uni.setStorageSync(PAGE_RESIDENCE_TIME, getTime());
|
|
}
|
|
}
|
|
|
|
+ return First_Page_residence_time;
|
|
};
|
|
};
|
|
|
|
|
|
-Module.prototype.forEachMutation = function forEachMutation (fn) {
|
|
|
|
- if (this._rawModule.mutations) {
|
|
|
|
- forEachValue(this._rawModule.mutations, fn);
|
|
|
|
|
|
+var getPageResidenceTime = function getPageResidenceTime() {
|
|
|
|
+ Last_Page_residence_time = getTime();
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ First_Page_residence_time = uni.getStorageSync(PAGE_RESIDENCE_TIME);
|
|
}
|
|
}
|
|
|
|
+ return Last_Page_residence_time - First_Page_residence_time;
|
|
};
|
|
};
|
|
-
|
|
|
|
-Object.defineProperties( Module.prototype, prototypeAccessors$1 );
|
|
|
|
-
|
|
|
|
-var ModuleCollection = function ModuleCollection (rawRootModule) {
|
|
|
|
- // register root module (Vuex.Store options)
|
|
|
|
- this.register([], rawRootModule, false);
|
|
|
|
|
|
+var TOTAL__VISIT__COUNT = 'Total__Visit__Count';
|
|
|
|
+var getTotalVisitCount = function getTotalVisitCount() {
|
|
|
|
+ var timeStorge = uni.getStorageSync(TOTAL__VISIT__COUNT);
|
|
|
|
+ var count = 1;
|
|
|
|
+ if (timeStorge) {
|
|
|
|
+ count = timeStorge;
|
|
|
|
+ count++;
|
|
|
|
+ }
|
|
|
|
+ uni.setStorageSync(TOTAL__VISIT__COUNT, count);
|
|
|
|
+ return count;
|
|
};
|
|
};
|
|
|
|
|
|
-ModuleCollection.prototype.get = function get (path) {
|
|
|
|
- return path.reduce(function (module, key) {
|
|
|
|
- return module.getChild(key)
|
|
|
|
- }, this.root)
|
|
|
|
|
|
+var GetEncodeURIComponentOptions = function GetEncodeURIComponentOptions(statData) {
|
|
|
|
+ var data = {};
|
|
|
|
+ for (var prop in statData) {
|
|
|
|
+ data[prop] = encodeURIComponent(statData[prop]);
|
|
|
|
+ }
|
|
|
|
+ return data;
|
|
};
|
|
};
|
|
|
|
|
|
-ModuleCollection.prototype.getNamespace = function getNamespace (path) {
|
|
|
|
- var module = this.root;
|
|
|
|
- return path.reduce(function (namespace, key) {
|
|
|
|
- module = module.getChild(key);
|
|
|
|
- return namespace + (module.namespaced ? key + '/' : '')
|
|
|
|
- }, '')
|
|
|
|
|
|
+var Set__First__Time = 0;
|
|
|
|
+var Set__Last__Time = 0;
|
|
|
|
+
|
|
|
|
+var getFirstTime = function getFirstTime() {
|
|
|
|
+ var time = new Date().getTime();
|
|
|
|
+ Set__First__Time = time;
|
|
|
|
+ Set__Last__Time = 0;
|
|
|
|
+ return time;
|
|
};
|
|
};
|
|
|
|
|
|
-ModuleCollection.prototype.update = function update$1 (rawRootModule) {
|
|
|
|
- update([], this.root, rawRootModule);
|
|
|
|
|
|
+
|
|
|
|
+var getLastTime = function getLastTime() {
|
|
|
|
+ var time = new Date().getTime();
|
|
|
|
+ Set__Last__Time = time;
|
|
|
|
+ return time;
|
|
};
|
|
};
|
|
|
|
|
|
-ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
|
|
|
|
- var this$1 = this;
|
|
|
|
- if ( runtime === void 0 ) runtime = true;
|
|
|
|
|
|
|
|
- if (true) {
|
|
|
|
- assertRawModule(path, rawModule);
|
|
|
|
|
|
+var getResidenceTime = function getResidenceTime(type) {
|
|
|
|
+ var residenceTime = 0;
|
|
|
|
+ if (Set__First__Time !== 0) {
|
|
|
|
+ residenceTime = Set__Last__Time - Set__First__Time;
|
|
}
|
|
}
|
|
|
|
|
|
- var newModule = new Module(rawModule, runtime);
|
|
|
|
- if (path.length === 0) {
|
|
|
|
- this.root = newModule;
|
|
|
|
- } else {
|
|
|
|
- var parent = this.get(path.slice(0, -1));
|
|
|
|
- parent.addChild(path[path.length - 1], newModule);
|
|
|
|
|
|
+ residenceTime = parseInt(residenceTime / 1000);
|
|
|
|
+ residenceTime = residenceTime < 1 ? 1 : residenceTime;
|
|
|
|
+ if (type === 'app') {
|
|
|
|
+ var overtime = residenceTime > APP_PVER_TIME ? true : false;
|
|
|
|
+ return {
|
|
|
|
+ residenceTime: residenceTime,
|
|
|
|
+ overtime: overtime };
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+ if (type === 'page') {
|
|
|
|
+ var _overtime = residenceTime > PAGE_PVER_TIME ? true : false;
|
|
|
|
+ return {
|
|
|
|
+ residenceTime: residenceTime,
|
|
|
|
+ overtime: _overtime };
|
|
|
|
|
|
- // register nested modules
|
|
|
|
- if (rawModule.modules) {
|
|
|
|
- forEachValue(rawModule.modules, function (rawChildModule, key) {
|
|
|
|
- this$1.register(path.concat(key), rawChildModule, runtime);
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
|
|
-ModuleCollection.prototype.unregister = function unregister (path) {
|
|
|
|
- var parent = this.get(path.slice(0, -1));
|
|
|
|
- var key = path[path.length - 1];
|
|
|
|
- if (!parent.getChild(key).runtime) { return }
|
|
|
|
|
|
+ return {
|
|
|
|
+ residenceTime: residenceTime };
|
|
|
|
+
|
|
|
|
|
|
- parent.removeChild(key);
|
|
|
|
};
|
|
};
|
|
|
|
|
|
-function update (path, targetModule, newModule) {
|
|
|
|
- if (true) {
|
|
|
|
- assertRawModule(path, newModule);
|
|
|
|
- }
|
|
|
|
|
|
+var getRoute = function getRoute() {
|
|
|
|
+ var pages = getCurrentPages();
|
|
|
|
+ var page = pages[pages.length - 1];
|
|
|
|
+ var _self = page.$vm;
|
|
|
|
|
|
- // update target module
|
|
|
|
- targetModule.update(newModule);
|
|
|
|
-
|
|
|
|
- // update nested modules
|
|
|
|
- if (newModule.modules) {
|
|
|
|
- for (var key in newModule.modules) {
|
|
|
|
- if (!targetModule.getChild(key)) {
|
|
|
|
- if (true) {
|
|
|
|
- console.warn(
|
|
|
|
- "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
|
|
|
|
- 'manual reload is needed'
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- update(
|
|
|
|
- path.concat(key),
|
|
|
|
- targetModule.getChild(key),
|
|
|
|
- newModule.modules[key]
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
|
|
+ if (getPlatformName() === 'bd') {
|
|
|
|
+ return _self.$mp && _self.$mp.page.is;
|
|
|
|
+ } else {
|
|
|
|
+ return _self.$scope && _self.$scope.route || _self.$mp && _self.$mp.page.route;
|
|
}
|
|
}
|
|
-}
|
|
|
|
-
|
|
|
|
-var functionAssert = {
|
|
|
|
- assert: function (value) { return typeof value === 'function'; },
|
|
|
|
- expected: 'function'
|
|
|
|
};
|
|
};
|
|
|
|
|
|
-var objectAssert = {
|
|
|
|
- assert: function (value) { return typeof value === 'function' ||
|
|
|
|
- (typeof value === 'object' && typeof value.handler === 'function'); },
|
|
|
|
- expected: 'function or object with "handler" function'
|
|
|
|
|
|
+var getPageRoute = function getPageRoute(self) {
|
|
|
|
+ var pages = getCurrentPages();
|
|
|
|
+ var page = pages[pages.length - 1];
|
|
|
|
+ var _self = page.$vm;
|
|
|
|
+ var query = self._query;
|
|
|
|
+ var str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : '';
|
|
|
|
+ // clear
|
|
|
|
+ self._query = '';
|
|
|
|
+ if (getPlatformName() === 'bd') {
|
|
|
|
+ return _self.$mp && _self.$mp.page.is + str;
|
|
|
|
+ } else {
|
|
|
|
+ return _self.$scope && _self.$scope.route + str || _self.$mp && _self.$mp.page.route + str;
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
-var assertTypes = {
|
|
|
|
- getters: functionAssert,
|
|
|
|
- mutations: functionAssert,
|
|
|
|
- actions: objectAssert
|
|
|
|
|
|
+var getPageTypes = function getPageTypes(self) {
|
|
|
|
+ if (self.mpType === 'page' || self.$mp && self.$mp.mpType === 'page' || self.$options.mpType === 'page') {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
};
|
|
};
|
|
|
|
|
|
-function assertRawModule (path, rawModule) {
|
|
|
|
- Object.keys(assertTypes).forEach(function (key) {
|
|
|
|
- if (!rawModule[key]) { return }
|
|
|
|
-
|
|
|
|
- var assertOptions = assertTypes[key];
|
|
|
|
-
|
|
|
|
- forEachValue(rawModule[key], function (value, type) {
|
|
|
|
- assert(
|
|
|
|
- assertOptions.assert(value),
|
|
|
|
- makeAssertionMessage(path, key, type, value, assertOptions.expected)
|
|
|
|
- );
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function makeAssertionMessage (path, key, type, value, expected) {
|
|
|
|
- var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
|
|
|
|
- if (path.length > 0) {
|
|
|
|
- buf += " in module \"" + (path.join('.')) + "\"";
|
|
|
|
|
|
+var calibration = function calibration(eventName, options) {
|
|
|
|
+ // login 、 share 、pay_success 、pay_fail 、register 、title
|
|
|
|
+ if (!eventName) {
|
|
|
|
+ console.error("uni.report \u7F3A\u5C11 [eventName] \u53C2\u6570");
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
- buf += " is " + (JSON.stringify(value)) + ".";
|
|
|
|
- return buf
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-var Vue; // bind on install
|
|
|
|
-
|
|
|
|
-var Store = function Store (options) {
|
|
|
|
- var this$1 = this;
|
|
|
|
- if ( options === void 0 ) options = {};
|
|
|
|
-
|
|
|
|
- // Auto install if it is not done yet and `window` has `Vue`.
|
|
|
|
- // To allow users to avoid auto-installation in some cases,
|
|
|
|
- // this code should be placed here. See #731
|
|
|
|
- if (!Vue && typeof window !== 'undefined' && window.Vue) {
|
|
|
|
- install(window.Vue);
|
|
|
|
|
|
+ if (typeof eventName !== 'string') {
|
|
|
|
+ console.error("uni.report [eventName] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u7C7B\u578B");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ if (eventName.length > 255) {
|
|
|
|
+ console.error("uni.report [eventName] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
- if (true) {
|
|
|
|
- assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
|
|
|
|
- assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
|
|
|
|
- assert(this instanceof Store, "Store must be called with the new operator.");
|
|
|
|
|
|
+ if (typeof options !== 'string' && typeof options !== 'object') {
|
|
|
|
+ console.error("uni.report [options] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u6216 Object \u7C7B\u578B");
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
- var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
|
|
|
|
- var strict = options.strict; if ( strict === void 0 ) strict = false;
|
|
|
|
|
|
+ if (typeof options === 'string' && options.length > 255) {
|
|
|
|
+ console.error("uni.report [options] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
|
|
- var state = options.state; if ( state === void 0 ) state = {};
|
|
|
|
- if (typeof state === 'function') {
|
|
|
|
- state = state() || {};
|
|
|
|
|
|
+ if (eventName === 'title' && typeof options !== 'string') {
|
|
|
|
+ console.error('uni.report [eventName] 参数为 title 时,[options] 参数只能为 String 类型');
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
+};
|
|
|
|
|
|
- // store internal state
|
|
|
|
- this._committing = false;
|
|
|
|
- this._actions = Object.create(null);
|
|
|
|
- this._actionSubscribers = [];
|
|
|
|
- this._mutations = Object.create(null);
|
|
|
|
- this._wrappedGetters = Object.create(null);
|
|
|
|
- this._modules = new ModuleCollection(options);
|
|
|
|
- this._modulesNamespaceMap = Object.create(null);
|
|
|
|
- this._subscribers = [];
|
|
|
|
- this._watcherVM = new Vue();
|
|
|
|
|
|
+var PagesJson = __webpack_require__(/*! uni-pages?{"type":"style"} */ 7).default;
|
|
|
|
+var statConfig = __webpack_require__(/*! uni-stat-config */ 8).default || __webpack_require__(/*! uni-stat-config */ 8);
|
|
|
|
|
|
- // bind commit and dispatch to self
|
|
|
|
- var store = this;
|
|
|
|
- var ref = this;
|
|
|
|
- var dispatch = ref.dispatch;
|
|
|
|
- var commit = ref.commit;
|
|
|
|
- this.dispatch = function boundDispatch (type, payload) {
|
|
|
|
- return dispatch.call(store, type, payload)
|
|
|
|
- };
|
|
|
|
- this.commit = function boundCommit (type, payload, options) {
|
|
|
|
- return commit.call(store, type, payload, options)
|
|
|
|
- };
|
|
|
|
|
|
+var resultOptions = uni.getSystemInfoSync();var
|
|
|
|
|
|
- // strict mode
|
|
|
|
- this.strict = strict;
|
|
|
|
|
|
+Util = /*#__PURE__*/function () {
|
|
|
|
+ function Util() {_classCallCheck(this, Util);
|
|
|
|
+ this.self = '';
|
|
|
|
+ this._retry = 0;
|
|
|
|
+ this._platform = '';
|
|
|
|
+ this._query = {};
|
|
|
|
+ this._navigationBarTitle = {
|
|
|
|
+ config: '',
|
|
|
|
+ page: '',
|
|
|
|
+ report: '',
|
|
|
|
+ lt: '' };
|
|
|
|
|
|
- // init root module.
|
|
|
|
- // this also recursively registers all sub-modules
|
|
|
|
- // and collects all module getters inside this._wrappedGetters
|
|
|
|
- installModule(this, state, [], this._modules.root);
|
|
|
|
|
|
+ this._operatingTime = 0;
|
|
|
|
+ this._reportingRequestData = {
|
|
|
|
+ '1': [],
|
|
|
|
+ '11': [] };
|
|
|
|
|
|
- // initialize the store vm, which is responsible for the reactivity
|
|
|
|
- // (also registers _wrappedGetters as computed properties)
|
|
|
|
- resetStoreVM(this, state);
|
|
|
|
|
|
+ this.__prevent_triggering = false;
|
|
|
|
|
|
- // apply plugins
|
|
|
|
- plugins.forEach(function (plugin) { return plugin(this$1); });
|
|
|
|
|
|
+ this.__licationHide = false;
|
|
|
|
+ this.__licationShow = false;
|
|
|
|
+ this._lastPageRoute = '';
|
|
|
|
+ this.statData = {
|
|
|
|
+ uuid: getUuid(),
|
|
|
|
+ ut: getPlatformName(),
|
|
|
|
+ mpn: getPackName(),
|
|
|
|
+ ak: statConfig.appid,
|
|
|
|
+ usv: STAT_VERSION,
|
|
|
|
+ v: getVersion(),
|
|
|
|
+ ch: getChannel(),
|
|
|
|
+ cn: '',
|
|
|
|
+ pn: '',
|
|
|
|
+ ct: '',
|
|
|
|
+ t: getTime(),
|
|
|
|
+ tt: '',
|
|
|
|
+ p: resultOptions.platform === 'android' ? 'a' : 'i',
|
|
|
|
+ brand: resultOptions.brand || '',
|
|
|
|
+ md: resultOptions.model,
|
|
|
|
+ sv: resultOptions.system.replace(/(Android|iOS)\s/, ''),
|
|
|
|
+ mpsdk: resultOptions.SDKVersion || '',
|
|
|
|
+ mpv: resultOptions.version || '',
|
|
|
|
+ lang: resultOptions.language,
|
|
|
|
+ pr: resultOptions.pixelRatio,
|
|
|
|
+ ww: resultOptions.windowWidth,
|
|
|
|
+ wh: resultOptions.windowHeight,
|
|
|
|
+ sw: resultOptions.screenWidth,
|
|
|
|
+ sh: resultOptions.screenHeight };
|
|
|
|
|
|
- if (Vue.config.devtools) {
|
|
|
|
- devtoolPlugin(this);
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
|
|
-var prototypeAccessors = { state: { configurable: true } };
|
|
|
|
|
|
+ }_createClass(Util, [{ key: "_applicationShow", value: function _applicationShow()
|
|
|
|
|
|
-prototypeAccessors.state.get = function () {
|
|
|
|
- return this._vm._data.$$state
|
|
|
|
-};
|
|
|
|
|
|
+ {
|
|
|
|
+ if (this.__licationHide) {
|
|
|
|
+ getLastTime();
|
|
|
|
+ var time = getResidenceTime('app');
|
|
|
|
+ if (time.overtime) {
|
|
|
|
+ var options = {
|
|
|
|
+ path: this._lastPageRoute,
|
|
|
|
+ scene: this.statData.sc };
|
|
|
|
|
|
-prototypeAccessors.state.set = function (v) {
|
|
|
|
- if (true) {
|
|
|
|
- assert(false, "Use store.replaceState() to explicit replace store state.");
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
+ this._sendReportRequest(options);
|
|
|
|
+ }
|
|
|
|
+ this.__licationHide = false;
|
|
|
|
+ }
|
|
|
|
+ } }, { key: "_applicationHide", value: function _applicationHide(
|
|
|
|
|
|
-Store.prototype.commit = function commit (_type, _payload, _options) {
|
|
|
|
- var this$1 = this;
|
|
|
|
|
|
+ self, type) {
|
|
|
|
|
|
- // check object-style commit
|
|
|
|
- var ref = unifyObjectStyle(_type, _payload, _options);
|
|
|
|
- var type = ref.type;
|
|
|
|
- var payload = ref.payload;
|
|
|
|
- var options = ref.options;
|
|
|
|
|
|
+ this.__licationHide = true;
|
|
|
|
+ getLastTime();
|
|
|
|
+ var time = getResidenceTime();
|
|
|
|
+ getFirstTime();
|
|
|
|
+ var route = getPageRoute(this);
|
|
|
|
+ this._sendHideRequest({
|
|
|
|
+ urlref: route,
|
|
|
|
+ urlref_ts: time.residenceTime },
|
|
|
|
+ type);
|
|
|
|
+ } }, { key: "_pageShow", value: function _pageShow()
|
|
|
|
|
|
- var mutation = { type: type, payload: payload };
|
|
|
|
- var entry = this._mutations[type];
|
|
|
|
- if (!entry) {
|
|
|
|
- if (true) {
|
|
|
|
- console.error(("[vuex] unknown mutation type: " + type));
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- this._withCommit(function () {
|
|
|
|
- entry.forEach(function commitIterator (handler) {
|
|
|
|
- handler(payload);
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
|
|
|
|
-
|
|
|
|
- if (
|
|
|
|
- true &&
|
|
|
|
- options && options.silent
|
|
|
|
- ) {
|
|
|
|
- console.warn(
|
|
|
|
- "[vuex] mutation type: " + type + ". Silent option has been removed. " +
|
|
|
|
- 'Use the filter functionality in the vue-devtools'
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
+ {
|
|
|
|
+ var route = getPageRoute(this);
|
|
|
|
+ var routepath = getRoute();
|
|
|
|
+ this._navigationBarTitle.config = PagesJson &&
|
|
|
|
+ PagesJson.pages[routepath] &&
|
|
|
|
+ PagesJson.pages[routepath].titleNView &&
|
|
|
|
+ PagesJson.pages[routepath].titleNView.titleText ||
|
|
|
|
+ PagesJson &&
|
|
|
|
+ PagesJson.pages[routepath] &&
|
|
|
|
+ PagesJson.pages[routepath].navigationBarTitleText || '';
|
|
|
|
|
|
-Store.prototype.dispatch = function dispatch (_type, _payload) {
|
|
|
|
- var this$1 = this;
|
|
|
|
|
|
+ if (this.__licationShow) {
|
|
|
|
+ getFirstTime();
|
|
|
|
+ this.__licationShow = false;
|
|
|
|
+ // console.log('这是 onLauch 之后执行的第一次 pageShow ,为下次记录时间做准备');
|
|
|
|
+ this._lastPageRoute = route;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- // check object-style dispatch
|
|
|
|
- var ref = unifyObjectStyle(_type, _payload);
|
|
|
|
- var type = ref.type;
|
|
|
|
- var payload = ref.payload;
|
|
|
|
|
|
+ getLastTime();
|
|
|
|
+ this._lastPageRoute = route;
|
|
|
|
+ var time = getResidenceTime('page');
|
|
|
|
+ if (time.overtime) {
|
|
|
|
+ var options = {
|
|
|
|
+ path: this._lastPageRoute,
|
|
|
|
+ scene: this.statData.sc };
|
|
|
|
|
|
- var action = { type: type, payload: payload };
|
|
|
|
- var entry = this._actions[type];
|
|
|
|
- if (!entry) {
|
|
|
|
- if (true) {
|
|
|
|
- console.error(("[vuex] unknown action type: " + type));
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ this._sendReportRequest(options);
|
|
|
|
+ }
|
|
|
|
+ getFirstTime();
|
|
|
|
+ } }, { key: "_pageHide", value: function _pageHide()
|
|
|
|
|
|
- this._actionSubscribers.forEach(function (sub) { return sub(action, this$1.state); });
|
|
|
|
|
|
+ {
|
|
|
|
+ if (!this.__licationHide) {
|
|
|
|
+ getLastTime();
|
|
|
|
+ var time = getResidenceTime('page');
|
|
|
|
+ this._sendPageRequest({
|
|
|
|
+ url: this._lastPageRoute,
|
|
|
|
+ urlref: this._lastPageRoute,
|
|
|
|
+ urlref_ts: time.residenceTime });
|
|
|
|
|
|
- return entry.length > 1
|
|
|
|
- ? Promise.all(entry.map(function (handler) { return handler(payload); }))
|
|
|
|
- : entry[0](payload)
|
|
|
|
-};
|
|
|
|
|
|
+ this._navigationBarTitle = {
|
|
|
|
+ config: '',
|
|
|
|
+ page: '',
|
|
|
|
+ report: '',
|
|
|
|
+ lt: '' };
|
|
|
|
|
|
-Store.prototype.subscribe = function subscribe (fn) {
|
|
|
|
- return genericSubscribe(fn, this._subscribers)
|
|
|
|
-};
|
|
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ } }, { key: "_login", value: function _login()
|
|
|
|
|
|
-Store.prototype.subscribeAction = function subscribeAction (fn) {
|
|
|
|
- return genericSubscribe(fn, this._actionSubscribers)
|
|
|
|
-};
|
|
|
|
|
|
+ {
|
|
|
|
+ this._sendEventRequest({
|
|
|
|
+ key: 'login' },
|
|
|
|
+ 0);
|
|
|
|
+ } }, { key: "_share", value: function _share()
|
|
|
|
|
|
-Store.prototype.watch = function watch (getter, cb, options) {
|
|
|
|
- var this$1 = this;
|
|
|
|
|
|
+ {
|
|
|
|
+ this._sendEventRequest({
|
|
|
|
+ key: 'share' },
|
|
|
|
+ 0);
|
|
|
|
+ } }, { key: "_payment", value: function _payment(
|
|
|
|
+ key) {
|
|
|
|
+ this._sendEventRequest({
|
|
|
|
+ key: key },
|
|
|
|
+ 0);
|
|
|
|
+ } }, { key: "_sendReportRequest", value: function _sendReportRequest(
|
|
|
|
+ options) {
|
|
|
|
|
|
- if (true) {
|
|
|
|
- assert(typeof getter === 'function', "store.watch only accepts a function.");
|
|
|
|
- }
|
|
|
|
- return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
|
|
|
|
-};
|
|
|
|
|
|
+ this._navigationBarTitle.lt = '1';
|
|
|
|
+ var query = options.query && JSON.stringify(options.query) !== '{}' ? '?' + JSON.stringify(options.query) : '';
|
|
|
|
+ this.statData.lt = '1';
|
|
|
|
+ this.statData.url = options.path + query || '';
|
|
|
|
+ this.statData.t = getTime();
|
|
|
|
+ this.statData.sc = getScene(options.scene);
|
|
|
|
+ this.statData.fvts = getFirstVisitTime();
|
|
|
|
+ this.statData.lvts = getLastVisitTime();
|
|
|
|
+ this.statData.tvc = getTotalVisitCount();
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ this.getProperty();
|
|
|
|
+ } else {
|
|
|
|
+ this.getNetworkInfo();
|
|
|
|
+ }
|
|
|
|
+ } }, { key: "_sendPageRequest", value: function _sendPageRequest(
|
|
|
|
|
|
-Store.prototype.replaceState = function replaceState (state) {
|
|
|
|
- var this$1 = this;
|
|
|
|
|
|
+ opt) {var
|
|
|
|
|
|
- this._withCommit(function () {
|
|
|
|
- this$1._vm._data.$$state = state;
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
|
|
+ url =
|
|
|
|
|
|
-Store.prototype.registerModule = function registerModule (path, rawModule, options) {
|
|
|
|
- if ( options === void 0 ) options = {};
|
|
|
|
|
|
|
|
- if (typeof path === 'string') { path = [path]; }
|
|
|
|
|
|
+ opt.url,urlref = opt.urlref,urlref_ts = opt.urlref_ts;
|
|
|
|
+ this._navigationBarTitle.lt = '11';
|
|
|
|
+ var options = {
|
|
|
|
+ ak: this.statData.ak,
|
|
|
|
+ uuid: this.statData.uuid,
|
|
|
|
+ lt: '11',
|
|
|
|
+ ut: this.statData.ut,
|
|
|
|
+ url: url,
|
|
|
|
+ tt: this.statData.tt,
|
|
|
|
+ urlref: urlref,
|
|
|
|
+ urlref_ts: urlref_ts,
|
|
|
|
+ ch: this.statData.ch,
|
|
|
|
+ usv: this.statData.usv,
|
|
|
|
+ t: getTime(),
|
|
|
|
+ p: this.statData.p };
|
|
|
|
|
|
- if (true) {
|
|
|
|
- assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
|
|
- assert(path.length > 0, 'cannot register the root module by using registerModule.');
|
|
|
|
- }
|
|
|
|
|
|
+ this.request(options);
|
|
|
|
+ } }, { key: "_sendHideRequest", value: function _sendHideRequest(
|
|
|
|
|
|
- this._modules.register(path, rawModule);
|
|
|
|
- installModule(this, this.state, path, this._modules.get(path), options.preserveState);
|
|
|
|
- // reset store to update getters...
|
|
|
|
- resetStoreVM(this, this.state);
|
|
|
|
-};
|
|
|
|
|
|
+ opt, type) {var
|
|
|
|
|
|
-Store.prototype.unregisterModule = function unregisterModule (path) {
|
|
|
|
- var this$1 = this;
|
|
|
|
|
|
+ urlref =
|
|
|
|
|
|
- if (typeof path === 'string') { path = [path]; }
|
|
|
|
|
|
+ opt.urlref,urlref_ts = opt.urlref_ts;
|
|
|
|
+ var options = {
|
|
|
|
+ ak: this.statData.ak,
|
|
|
|
+ uuid: this.statData.uuid,
|
|
|
|
+ lt: '3',
|
|
|
|
+ ut: this.statData.ut,
|
|
|
|
+ urlref: urlref,
|
|
|
|
+ urlref_ts: urlref_ts,
|
|
|
|
+ ch: this.statData.ch,
|
|
|
|
+ usv: this.statData.usv,
|
|
|
|
+ t: getTime(),
|
|
|
|
+ p: this.statData.p };
|
|
|
|
|
|
- if (true) {
|
|
|
|
- assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
|
|
- }
|
|
|
|
|
|
+ this.request(options, type);
|
|
|
|
+ } }, { key: "_sendEventRequest", value: function _sendEventRequest()
|
|
|
|
|
|
- this._modules.unregister(path);
|
|
|
|
- this._withCommit(function () {
|
|
|
|
- var parentState = getNestedState(this$1.state, path.slice(0, -1));
|
|
|
|
- Vue.delete(parentState, path[path.length - 1]);
|
|
|
|
- });
|
|
|
|
- resetStore(this);
|
|
|
|
-};
|
|
|
|
|
|
|
|
-Store.prototype.hotUpdate = function hotUpdate (newOptions) {
|
|
|
|
- this._modules.update(newOptions);
|
|
|
|
- resetStore(this, true);
|
|
|
|
-};
|
|
|
|
|
|
|
|
-Store.prototype._withCommit = function _withCommit (fn) {
|
|
|
|
- var committing = this._committing;
|
|
|
|
- this._committing = true;
|
|
|
|
- fn();
|
|
|
|
- this._committing = committing;
|
|
|
|
-};
|
|
|
|
|
|
+ {var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref$key = _ref.key,key = _ref$key === void 0 ? '' : _ref$key,_ref$value = _ref.value,value = _ref$value === void 0 ? "" : _ref$value;
|
|
|
|
+ var route = this._lastPageRoute;
|
|
|
|
+ var options = {
|
|
|
|
+ ak: this.statData.ak,
|
|
|
|
+ uuid: this.statData.uuid,
|
|
|
|
+ lt: '21',
|
|
|
|
+ ut: this.statData.ut,
|
|
|
|
+ url: route,
|
|
|
|
+ ch: this.statData.ch,
|
|
|
|
+ e_n: key,
|
|
|
|
+ e_v: typeof value === 'object' ? JSON.stringify(value) : value.toString(),
|
|
|
|
+ usv: this.statData.usv,
|
|
|
|
+ t: getTime(),
|
|
|
|
+ p: this.statData.p };
|
|
|
|
|
|
-Object.defineProperties( Store.prototype, prototypeAccessors );
|
|
|
|
|
|
+ this.request(options);
|
|
|
|
+ } }, { key: "getNetworkInfo", value: function getNetworkInfo()
|
|
|
|
|
|
-function genericSubscribe (fn, subs) {
|
|
|
|
- if (subs.indexOf(fn) < 0) {
|
|
|
|
- subs.push(fn);
|
|
|
|
- }
|
|
|
|
- return function () {
|
|
|
|
- var i = subs.indexOf(fn);
|
|
|
|
- if (i > -1) {
|
|
|
|
- subs.splice(i, 1);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ {var _this = this;
|
|
|
|
+ uni.getNetworkType({
|
|
|
|
+ success: function success(result) {
|
|
|
|
+ _this.statData.net = result.networkType;
|
|
|
|
+ _this.getLocation();
|
|
|
|
+ } });
|
|
|
|
|
|
-function resetStore (store, hot) {
|
|
|
|
- store._actions = Object.create(null);
|
|
|
|
- store._mutations = Object.create(null);
|
|
|
|
- store._wrappedGetters = Object.create(null);
|
|
|
|
- store._modulesNamespaceMap = Object.create(null);
|
|
|
|
- var state = store.state;
|
|
|
|
- // init all modules
|
|
|
|
- installModule(store, state, [], store._modules.root, true);
|
|
|
|
- // reset vm
|
|
|
|
- resetStoreVM(store, state, hot);
|
|
|
|
-}
|
|
|
|
|
|
+ } }, { key: "getProperty", value: function getProperty()
|
|
|
|
|
|
-function resetStoreVM (store, state, hot) {
|
|
|
|
- var oldVm = store._vm;
|
|
|
|
|
|
+ {var _this2 = this;
|
|
|
|
+ plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
|
|
|
|
+ _this2.statData.v = wgtinfo.version || '';
|
|
|
|
+ _this2.getNetworkInfo();
|
|
|
|
+ });
|
|
|
|
+ } }, { key: "getLocation", value: function getLocation()
|
|
|
|
|
|
- // bind store public getters
|
|
|
|
- store.getters = {};
|
|
|
|
- var wrappedGetters = store._wrappedGetters;
|
|
|
|
- var computed = {};
|
|
|
|
- forEachValue(wrappedGetters, function (fn, key) {
|
|
|
|
- // use computed to leverage its lazy-caching mechanism
|
|
|
|
- computed[key] = function () { return fn(store); };
|
|
|
|
- Object.defineProperty(store.getters, key, {
|
|
|
|
- get: function () { return store._vm[key]; },
|
|
|
|
- enumerable: true // for local getters
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ {var _this3 = this;
|
|
|
|
+ if (statConfig.getLocation) {
|
|
|
|
+ uni.getLocation({
|
|
|
|
+ type: 'wgs84',
|
|
|
|
+ geocode: true,
|
|
|
|
+ success: function success(result) {
|
|
|
|
+ if (result.address) {
|
|
|
|
+ _this3.statData.cn = result.address.country;
|
|
|
|
+ _this3.statData.pn = result.address.province;
|
|
|
|
+ _this3.statData.ct = result.address.city;
|
|
|
|
+ }
|
|
|
|
|
|
- // use a Vue instance to store the state tree
|
|
|
|
- // suppress warnings just in case the user has added
|
|
|
|
- // some funky global mixins
|
|
|
|
- var silent = Vue.config.silent;
|
|
|
|
- Vue.config.silent = true;
|
|
|
|
- store._vm = new Vue({
|
|
|
|
- data: {
|
|
|
|
- $$state: state
|
|
|
|
- },
|
|
|
|
- computed: computed
|
|
|
|
- });
|
|
|
|
- Vue.config.silent = silent;
|
|
|
|
|
|
+ _this3.statData.lat = result.latitude;
|
|
|
|
+ _this3.statData.lng = result.longitude;
|
|
|
|
+ _this3.request(_this3.statData);
|
|
|
|
+ } });
|
|
|
|
|
|
- // enable strict mode for new vm
|
|
|
|
- if (store.strict) {
|
|
|
|
- enableStrictMode(store);
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.statData.lat = 0;
|
|
|
|
+ this.statData.lng = 0;
|
|
|
|
+ this.request(this.statData);
|
|
|
|
+ }
|
|
|
|
+ } }, { key: "request", value: function request(
|
|
|
|
|
|
- if (oldVm) {
|
|
|
|
- if (hot) {
|
|
|
|
- // dispatch changes in all subscribed watchers
|
|
|
|
- // to force getter re-evaluation for hot reloading.
|
|
|
|
- store._withCommit(function () {
|
|
|
|
- oldVm._data.$$state = null;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- Vue.nextTick(function () { return oldVm.$destroy(); });
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ data, type) {var _this4 = this;
|
|
|
|
+ var time = getTime();
|
|
|
|
+ var title = this._navigationBarTitle;
|
|
|
|
+ data.ttn = title.page;
|
|
|
|
+ data.ttpj = title.config;
|
|
|
|
+ data.ttc = title.report;
|
|
|
|
|
|
-function installModule (store, rootState, path, module, hot) {
|
|
|
|
- var isRoot = !path.length;
|
|
|
|
- var namespace = store._modules.getNamespace(path);
|
|
|
|
|
|
+ var requestData = this._reportingRequestData;
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ requestData = uni.getStorageSync('__UNI__STAT__DATA') || {};
|
|
|
|
+ }
|
|
|
|
+ if (!requestData[data.lt]) {
|
|
|
|
+ requestData[data.lt] = [];
|
|
|
|
+ }
|
|
|
|
+ requestData[data.lt].push(data);
|
|
|
|
|
|
- // register in namespace map
|
|
|
|
- if (module.namespaced) {
|
|
|
|
- store._modulesNamespaceMap[namespace] = module;
|
|
|
|
- }
|
|
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ uni.setStorageSync('__UNI__STAT__DATA', requestData);
|
|
|
|
+ }
|
|
|
|
+ if (getPageResidenceTime() < OPERATING_TIME && !type) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ var uniStatData = this._reportingRequestData;
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ uniStatData = uni.getStorageSync('__UNI__STAT__DATA');
|
|
|
|
+ }
|
|
|
|
+ // 时间超过,重新获取时间戳
|
|
|
|
+ setPageResidenceTime();
|
|
|
|
+ var firstArr = [];
|
|
|
|
+ var contentArr = [];
|
|
|
|
+ var lastArr = [];var _loop = function _loop(
|
|
|
|
|
|
- // set state
|
|
|
|
- if (!isRoot && !hot) {
|
|
|
|
- var parentState = getNestedState(rootState, path.slice(0, -1));
|
|
|
|
- var moduleName = path[path.length - 1];
|
|
|
|
- store._withCommit(function () {
|
|
|
|
- Vue.set(parentState, moduleName, module.state);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ i) {
|
|
|
|
+ var rd = uniStatData[i];
|
|
|
|
+ rd.forEach(function (elm) {
|
|
|
|
+ var newData = getSplicing(elm);
|
|
|
|
+ if (i === 0) {
|
|
|
|
+ firstArr.push(newData);
|
|
|
|
+ } else if (i === 3) {
|
|
|
|
+ lastArr.push(newData);
|
|
|
|
+ } else {
|
|
|
|
+ contentArr.push(newData);
|
|
|
|
+ }
|
|
|
|
+ });};for (var i in uniStatData) {_loop(i);
|
|
|
|
+ }
|
|
|
|
|
|
- var local = module.context = makeLocalContext(store, namespace, path);
|
|
|
|
|
|
+ firstArr.push.apply(firstArr, contentArr.concat(lastArr));
|
|
|
|
+ var optionsData = {
|
|
|
|
+ usv: STAT_VERSION, //统计 SDK 版本号
|
|
|
|
+ t: time, //发送请求时的时间戮
|
|
|
|
+ requests: JSON.stringify(firstArr) };
|
|
|
|
|
|
- module.forEachMutation(function (mutation, key) {
|
|
|
|
- var namespacedType = namespace + key;
|
|
|
|
- registerMutation(store, namespacedType, mutation, local);
|
|
|
|
- });
|
|
|
|
|
|
|
|
- module.forEachAction(function (action, key) {
|
|
|
|
- var type = action.root ? key : namespace + key;
|
|
|
|
- var handler = action.handler || action;
|
|
|
|
- registerAction(store, type, handler, local);
|
|
|
|
- });
|
|
|
|
|
|
+ this._reportingRequestData = {};
|
|
|
|
+ if (getPlatformName() === 'n') {
|
|
|
|
+ uni.removeStorageSync('__UNI__STAT__DATA');
|
|
|
|
+ }
|
|
|
|
|
|
- module.forEachGetter(function (getter, key) {
|
|
|
|
- var namespacedType = namespace + key;
|
|
|
|
- registerGetter(store, namespacedType, getter, local);
|
|
|
|
- });
|
|
|
|
|
|
+ if (data.ut === 'h5') {
|
|
|
|
+ this.imageRequest(optionsData);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- module.forEachChild(function (child, key) {
|
|
|
|
- installModule(store, rootState, path.concat(key), child, hot);
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
|
|
+ if (getPlatformName() === 'n' && this.statData.p === 'a') {
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ _this4._sendRequest(optionsData);
|
|
|
|
+ }, 200);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this._sendRequest(optionsData);
|
|
|
|
+ } }, { key: "_sendRequest", value: function _sendRequest(
|
|
|
|
+ optionsData) {var _this5 = this;
|
|
|
|
+ uni.request({
|
|
|
|
+ url: STAT_URL,
|
|
|
|
+ method: 'POST',
|
|
|
|
+ // header: {
|
|
|
|
+ // 'content-type': 'application/json' // 默认值
|
|
|
|
+ // },
|
|
|
|
+ data: optionsData,
|
|
|
|
+ success: function success() {
|
|
|
|
+ // if (process.env.NODE_ENV === 'development') {
|
|
|
|
+ // console.log('stat request success');
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
|
|
+ fail: function fail(e) {
|
|
|
|
+ if (++_this5._retry < 3) {
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ _this5._sendRequest(optionsData);
|
|
|
|
+ }, 1000);
|
|
|
|
+ }
|
|
|
|
+ } });
|
|
|
|
|
|
-/**
|
|
|
|
- * make localized dispatch, commit, getters and state
|
|
|
|
- * if there is no namespace, just use root ones
|
|
|
|
- */
|
|
|
|
-function makeLocalContext (store, namespace, path) {
|
|
|
|
- var noNamespace = namespace === '';
|
|
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * h5 请求
|
|
|
|
+ */ }, { key: "imageRequest", value: function imageRequest(
|
|
|
|
+ data) {
|
|
|
|
+ var image = new Image();
|
|
|
|
+ var options = getSgin(GetEncodeURIComponentOptions(data)).options;
|
|
|
|
+ image.src = STAT_H5_URL + '?' + options;
|
|
|
|
+ } }, { key: "sendEvent", value: function sendEvent(
|
|
|
|
|
|
- var local = {
|
|
|
|
- dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
|
|
|
|
- var args = unifyObjectStyle(_type, _payload, _options);
|
|
|
|
- var payload = args.payload;
|
|
|
|
- var options = args.options;
|
|
|
|
- var type = args.type;
|
|
|
|
|
|
+ key, value) {
|
|
|
|
+ // 校验 type 参数
|
|
|
|
+ if (calibration(key, value)) return;
|
|
|
|
|
|
- if (!options || !options.root) {
|
|
|
|
- type = namespace + type;
|
|
|
|
- if ( true && !store._actions[type]) {
|
|
|
|
- console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ if (key === 'title') {
|
|
|
|
+ this._navigationBarTitle.report = value;
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
+ this._sendEventRequest({
|
|
|
|
+ key: key,
|
|
|
|
+ value: typeof value === 'object' ? JSON.stringify(value) : value },
|
|
|
|
+ 1);
|
|
|
|
+ } }]);return Util;}();var
|
|
|
|
|
|
- return store.dispatch(type, payload)
|
|
|
|
- },
|
|
|
|
|
|
|
|
- commit: noNamespace ? store.commit : function (_type, _payload, _options) {
|
|
|
|
- var args = unifyObjectStyle(_type, _payload, _options);
|
|
|
|
- var payload = args.payload;
|
|
|
|
- var options = args.options;
|
|
|
|
- var type = args.type;
|
|
|
|
|
|
|
|
- if (!options || !options.root) {
|
|
|
|
- type = namespace + type;
|
|
|
|
- if ( true && !store._mutations[type]) {
|
|
|
|
- console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+Stat = /*#__PURE__*/function (_Util) {_inherits(Stat, _Util);_createClass(Stat, null, [{ key: "getInstance", value: function getInstance()
|
|
|
|
+ {
|
|
|
|
+ if (!this.instance) {
|
|
|
|
+ this.instance = new Stat();
|
|
}
|
|
}
|
|
|
|
+ return this.instance;
|
|
|
|
+ } }]);
|
|
|
|
+ function Stat() {var _this6;_classCallCheck(this, Stat);
|
|
|
|
+ _this6 = _possibleConstructorReturn(this, _getPrototypeOf(Stat).call(this));
|
|
|
|
+ _this6.instance = null;
|
|
|
|
+ // 注册拦截器
|
|
|
|
+ if (typeof uni.addInterceptor === 'function' && "development" !== 'development') {
|
|
|
|
+ _this6.addInterceptorInit();
|
|
|
|
+ _this6.interceptLogin();
|
|
|
|
+ _this6.interceptShare(true);
|
|
|
|
+ _this6.interceptRequestPayment();
|
|
|
|
+ }return _this6;
|
|
|
|
+ }_createClass(Stat, [{ key: "addInterceptorInit", value: function addInterceptorInit()
|
|
|
|
|
|
- store.commit(type, payload, options);
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
|
|
+ {
|
|
|
|
+ var self = this;
|
|
|
|
+ uni.addInterceptor('setNavigationBarTitle', {
|
|
|
|
+ invoke: function invoke(args) {
|
|
|
|
+ self._navigationBarTitle.page = args.title;
|
|
|
|
+ } });
|
|
|
|
|
|
- // getters and state object must be gotten lazily
|
|
|
|
- // because they will be changed by vm update
|
|
|
|
- Object.defineProperties(local, {
|
|
|
|
- getters: {
|
|
|
|
- get: noNamespace
|
|
|
|
- ? function () { return store.getters; }
|
|
|
|
- : function () { return makeLocalGetters(store, namespace); }
|
|
|
|
- },
|
|
|
|
- state: {
|
|
|
|
- get: function () { return getNestedState(store.state, path); }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- return local
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function makeLocalGetters (store, namespace) {
|
|
|
|
- var gettersProxy = {};
|
|
|
|
|
|
+ } }, { key: "interceptLogin", value: function interceptLogin()
|
|
|
|
|
|
- var splitPos = namespace.length;
|
|
|
|
- Object.keys(store.getters).forEach(function (type) {
|
|
|
|
- // skip if the target getter is not match this namespace
|
|
|
|
- if (type.slice(0, splitPos) !== namespace) { return }
|
|
|
|
|
|
+ {
|
|
|
|
+ var self = this;
|
|
|
|
+ uni.addInterceptor('login', {
|
|
|
|
+ complete: function complete() {
|
|
|
|
+ self._login();
|
|
|
|
+ } });
|
|
|
|
|
|
- // extract local getter type
|
|
|
|
- var localType = type.slice(splitPos);
|
|
|
|
|
|
+ } }, { key: "interceptShare", value: function interceptShare(
|
|
|
|
|
|
- // Add a port to the getters proxy.
|
|
|
|
- // Define as getter property because
|
|
|
|
- // we do not want to evaluate the getters in this time.
|
|
|
|
- Object.defineProperty(gettersProxy, localType, {
|
|
|
|
- get: function () { return store.getters[type]; },
|
|
|
|
- enumerable: true
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ type) {
|
|
|
|
+ var self = this;
|
|
|
|
+ if (!type) {
|
|
|
|
+ self._share();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ uni.addInterceptor('share', {
|
|
|
|
+ success: function success() {
|
|
|
|
+ self._share();
|
|
|
|
+ },
|
|
|
|
+ fail: function fail() {
|
|
|
|
+ self._share();
|
|
|
|
+ } });
|
|
|
|
|
|
- return gettersProxy
|
|
|
|
-}
|
|
|
|
|
|
+ } }, { key: "interceptRequestPayment", value: function interceptRequestPayment()
|
|
|
|
|
|
-function registerMutation (store, type, handler, local) {
|
|
|
|
- var entry = store._mutations[type] || (store._mutations[type] = []);
|
|
|
|
- entry.push(function wrappedMutationHandler (payload) {
|
|
|
|
- handler.call(store, local.state, payload);
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
|
|
+ {
|
|
|
|
+ var self = this;
|
|
|
|
+ uni.addInterceptor('requestPayment', {
|
|
|
|
+ success: function success() {
|
|
|
|
+ self._payment('pay_success');
|
|
|
|
+ },
|
|
|
|
+ fail: function fail() {
|
|
|
|
+ self._payment('pay_fail');
|
|
|
|
+ } });
|
|
|
|
|
|
-function registerAction (store, type, handler, local) {
|
|
|
|
- var entry = store._actions[type] || (store._actions[type] = []);
|
|
|
|
- entry.push(function wrappedActionHandler (payload, cb) {
|
|
|
|
- var res = handler.call(store, {
|
|
|
|
- dispatch: local.dispatch,
|
|
|
|
- commit: local.commit,
|
|
|
|
- getters: local.getters,
|
|
|
|
- state: local.state,
|
|
|
|
- rootGetters: store.getters,
|
|
|
|
- rootState: store.state
|
|
|
|
- }, payload, cb);
|
|
|
|
- if (!isPromise(res)) {
|
|
|
|
- res = Promise.resolve(res);
|
|
|
|
- }
|
|
|
|
- if (store._devtoolHook) {
|
|
|
|
- return res.catch(function (err) {
|
|
|
|
- store._devtoolHook.emit('vuex:error', err);
|
|
|
|
- throw err
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- return res
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
|
|
+ } }, { key: "report", value: function report(
|
|
|
|
|
|
-function registerGetter (store, type, rawGetter, local) {
|
|
|
|
- if (store._wrappedGetters[type]) {
|
|
|
|
- if (true) {
|
|
|
|
- console.error(("[vuex] duplicate getter key: " + type));
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- store._wrappedGetters[type] = function wrappedGetter (store) {
|
|
|
|
- return rawGetter(
|
|
|
|
- local.state, // local state
|
|
|
|
- local.getters, // local getters
|
|
|
|
- store.state, // root state
|
|
|
|
- store.getters // root getters
|
|
|
|
- )
|
|
|
|
- };
|
|
|
|
-}
|
|
|
|
|
|
+ options, self) {
|
|
|
|
+ this.self = self;
|
|
|
|
+ // if (process.env.NODE_ENV === 'development') {
|
|
|
|
+ // console.log('report init');
|
|
|
|
+ // }
|
|
|
|
+ setPageResidenceTime();
|
|
|
|
+ this.__licationShow = true;
|
|
|
|
+ this._sendReportRequest(options, true);
|
|
|
|
+ } }, { key: "load", value: function load(
|
|
|
|
|
|
-function enableStrictMode (store) {
|
|
|
|
- store._vm.$watch(function () { return this._data.$$state }, function () {
|
|
|
|
- if (true) {
|
|
|
|
- assert(store._committing, "Do not mutate vuex store state outside mutation handlers.");
|
|
|
|
- }
|
|
|
|
- }, { deep: true, sync: true });
|
|
|
|
-}
|
|
|
|
|
|
+ options, self) {
|
|
|
|
+ if (!self.$scope && !self.$mp) {
|
|
|
|
+ var page = getCurrentPages();
|
|
|
|
+ self.$scope = page[page.length - 1];
|
|
|
|
+ }
|
|
|
|
+ this.self = self;
|
|
|
|
+ this._query = options;
|
|
|
|
+ } }, { key: "show", value: function show(
|
|
|
|
|
|
-function getNestedState (state, path) {
|
|
|
|
- return path.length
|
|
|
|
- ? path.reduce(function (state, key) { return state[key]; }, state)
|
|
|
|
- : state
|
|
|
|
-}
|
|
|
|
|
|
+ self) {
|
|
|
|
+ this.self = self;
|
|
|
|
+ if (getPageTypes(self)) {
|
|
|
|
+ this._pageShow(self);
|
|
|
|
+ } else {
|
|
|
|
+ this._applicationShow(self);
|
|
|
|
+ }
|
|
|
|
+ } }, { key: "ready", value: function ready(
|
|
|
|
|
|
-function unifyObjectStyle (type, payload, options) {
|
|
|
|
- if (isObject(type) && type.type) {
|
|
|
|
- options = payload;
|
|
|
|
- payload = type;
|
|
|
|
- type = type.type;
|
|
|
|
- }
|
|
|
|
|
|
+ self) {
|
|
|
|
+ // this.self = self;
|
|
|
|
+ // if (getPageTypes(self)) {
|
|
|
|
+ // this._pageShow(self);
|
|
|
|
+ // }
|
|
|
|
+ } }, { key: "hide", value: function hide(
|
|
|
|
+ self) {
|
|
|
|
+ this.self = self;
|
|
|
|
+ if (getPageTypes(self)) {
|
|
|
|
+ this._pageHide(self);
|
|
|
|
+ } else {
|
|
|
|
+ this._applicationHide(self, true);
|
|
|
|
+ }
|
|
|
|
+ } }, { key: "error", value: function error(
|
|
|
|
+ em) {
|
|
|
|
+ if (this._platform === 'devtools') {
|
|
|
|
+ if (true) {
|
|
|
|
+ console.info('当前运行环境为开发者工具,不上报数据。');
|
|
|
|
+ }
|
|
|
|
+ // return;
|
|
|
|
+ }
|
|
|
|
+ var emVal = '';
|
|
|
|
+ if (!em.message) {
|
|
|
|
+ emVal = JSON.stringify(em);
|
|
|
|
+ } else {
|
|
|
|
+ emVal = em.stack;
|
|
|
|
+ }
|
|
|
|
+ var options = {
|
|
|
|
+ ak: this.statData.ak,
|
|
|
|
+ uuid: this.statData.uuid,
|
|
|
|
+ lt: '31',
|
|
|
|
+ ut: this.statData.ut,
|
|
|
|
+ ch: this.statData.ch,
|
|
|
|
+ mpsdk: this.statData.mpsdk,
|
|
|
|
+ mpv: this.statData.mpv,
|
|
|
|
+ v: this.statData.v,
|
|
|
|
+ em: emVal,
|
|
|
|
+ usv: this.statData.usv,
|
|
|
|
+ t: getTime(),
|
|
|
|
+ p: this.statData.p };
|
|
|
|
|
|
- if (true) {
|
|
|
|
- assert(typeof type === 'string', ("Expects string as the type, but found " + (typeof type) + "."));
|
|
|
|
- }
|
|
|
|
|
|
+ this.request(options);
|
|
|
|
+ } }]);return Stat;}(Util);
|
|
|
|
|
|
- return { type: type, payload: payload, options: options }
|
|
|
|
-}
|
|
|
|
|
|
|
|
-function install (_Vue) {
|
|
|
|
- if (Vue && _Vue === Vue) {
|
|
|
|
- if (true) {
|
|
|
|
- console.error(
|
|
|
|
- '[vuex] already installed. Vue.use(Vuex) should be called only once.'
|
|
|
|
- );
|
|
|
|
|
|
+var stat = Stat.getInstance();
|
|
|
|
+var isHide = false;
|
|
|
|
+var lifecycle = {
|
|
|
|
+ onLaunch: function onLaunch(options) {
|
|
|
|
+ stat.report(options, this);
|
|
|
|
+ },
|
|
|
|
+ onReady: function onReady() {
|
|
|
|
+ stat.ready(this);
|
|
|
|
+ },
|
|
|
|
+ onLoad: function onLoad(options) {
|
|
|
|
+ stat.load(options, this);
|
|
|
|
+ // 重写分享,获取分享上报事件
|
|
|
|
+ if (this.$scope && this.$scope.onShareAppMessage) {
|
|
|
|
+ var oldShareAppMessage = this.$scope.onShareAppMessage;
|
|
|
|
+ this.$scope.onShareAppMessage = function (options) {
|
|
|
|
+ stat.interceptShare(false);
|
|
|
|
+ return oldShareAppMessage.call(this, options);
|
|
|
|
+ };
|
|
}
|
|
}
|
|
- return
|
|
|
|
- }
|
|
|
|
- Vue = _Vue;
|
|
|
|
- applyMixin(Vue);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-var mapState = normalizeNamespace(function (namespace, states) {
|
|
|
|
- var res = {};
|
|
|
|
- normalizeMap(states).forEach(function (ref) {
|
|
|
|
- var key = ref.key;
|
|
|
|
- var val = ref.val;
|
|
|
|
|
|
+ },
|
|
|
|
+ onShow: function onShow() {
|
|
|
|
+ isHide = false;
|
|
|
|
+ stat.show(this);
|
|
|
|
+ },
|
|
|
|
+ onHide: function onHide() {
|
|
|
|
+ isHide = true;
|
|
|
|
+ stat.hide(this);
|
|
|
|
+ },
|
|
|
|
+ onUnload: function onUnload() {
|
|
|
|
+ if (isHide) {
|
|
|
|
+ isHide = false;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ stat.hide(this);
|
|
|
|
+ },
|
|
|
|
+ onError: function onError(e) {
|
|
|
|
+ stat.error(e);
|
|
|
|
+ } };
|
|
|
|
|
|
- res[key] = function mappedState () {
|
|
|
|
- var state = this.$store.state;
|
|
|
|
- var getters = this.$store.getters;
|
|
|
|
- if (namespace) {
|
|
|
|
- var module = getModuleByNamespace(this.$store, 'mapState', namespace);
|
|
|
|
- if (!module) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- state = module.context.state;
|
|
|
|
- getters = module.context.getters;
|
|
|
|
- }
|
|
|
|
- return typeof val === 'function'
|
|
|
|
- ? val.call(this, state, getters)
|
|
|
|
- : state[val]
|
|
|
|
- };
|
|
|
|
- // mark vuex getter for devtools
|
|
|
|
- res[key].vuex = true;
|
|
|
|
- });
|
|
|
|
- return res
|
|
|
|
-});
|
|
|
|
|
|
|
|
-var mapMutations = normalizeNamespace(function (namespace, mutations) {
|
|
|
|
- var res = {};
|
|
|
|
- normalizeMap(mutations).forEach(function (ref) {
|
|
|
|
- var key = ref.key;
|
|
|
|
- var val = ref.val;
|
|
|
|
|
|
+function main() {
|
|
|
|
+ if (true) {
|
|
|
|
+ uni.report = function (type, options) {};
|
|
|
|
+ } else { var Vue; }
|
|
|
|
+}
|
|
|
|
|
|
- res[key] = function mappedMutation () {
|
|
|
|
- var args = [], len = arguments.length;
|
|
|
|
- while ( len-- ) args[ len ] = arguments[ len ];
|
|
|
|
|
|
+main();
|
|
|
|
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
|
|
|
|
- var commit = this.$store.commit;
|
|
|
|
- if (namespace) {
|
|
|
|
- var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
|
|
|
|
- if (!module) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- commit = module.context.commit;
|
|
|
|
- }
|
|
|
|
- return typeof val === 'function'
|
|
|
|
- ? val.apply(this, [commit].concat(args))
|
|
|
|
- : commit.apply(this.$store, [val].concat(args))
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
- return res
|
|
|
|
-});
|
|
|
|
|
|
+/***/ }),
|
|
|
|
+/* 6 */
|
|
|
|
+/*!******************************************************!*\
|
|
|
|
+ !*** ./node_modules/@dcloudio/uni-stat/package.json ***!
|
|
|
|
+ \******************************************************/
|
|
|
|
+/*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, deprecated, description, devDependencies, files, gitHead, homepage, license, main, name, repository, scripts, version, default */
|
|
|
|
+/***/ (function(module) {
|
|
|
|
|
|
-var mapGetters = normalizeNamespace(function (namespace, getters) {
|
|
|
|
- var res = {};
|
|
|
|
- normalizeMap(getters).forEach(function (ref) {
|
|
|
|
- var key = ref.key;
|
|
|
|
- var val = ref.val;
|
|
|
|
|
|
+module.exports = {"_from":"@dcloudio/uni-stat@next","_id":"@dcloudio/uni-stat@2.0.0-26820200330001","_inBundle":false,"_integrity":"sha512-Qzo5LcBl+abS7DvpyTXBYW2VVYHVcHBewduQecjn/gbzAn9e90aOVn02/2VZ82wV6TBiDXbGyloXojOY3InzWA==","_location":"/@dcloudio/uni-stat","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"@dcloudio/uni-stat@next","name":"@dcloudio/uni-stat","escapedName":"@dcloudio%2funi-stat","scope":"@dcloudio","rawSpec":"next","saveSpec":null,"fetchSpec":"next"},"_requiredBy":["#USER","/","/@dcloudio/vue-cli-plugin-uni"],"_resolved":"https://registry.npmjs.org/@dcloudio/uni-stat/-/uni-stat-2.0.0-26820200330001.tgz","_shasum":"880c5c5a4920bb35e9cf691eeb7427a7bf67ffd7","_spec":"@dcloudio/uni-stat@next","_where":"/Users/guoshengqiang/Documents/dcloud-plugins/release/uniapp-cli","author":"","bugs":{"url":"https://github.com/dcloudio/uni-app/issues"},"bundleDependencies":false,"deprecated":false,"description":"","devDependencies":{"@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","eslint":"^6.1.0","rollup":"^1.19.3","rollup-plugin-babel":"^4.3.3","rollup-plugin-clear":"^2.0.7","rollup-plugin-commonjs":"^10.0.2","rollup-plugin-copy":"^3.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-uglify":"^6.0.2"},"files":["dist","package.json","LICENSE"],"gitHead":"57ef7f7b5b6164a74ec425ff12f9fe0a1147841a","homepage":"https://github.com/dcloudio/uni-app#readme","license":"Apache-2.0","main":"dist/index.js","name":"@dcloudio/uni-stat","repository":{"type":"git","url":"git+https://github.com/dcloudio/uni-app.git","directory":"packages/uni-stat"},"scripts":{"build":"NODE_ENV=production rollup -c rollup.config.js","dev":"NODE_ENV=development rollup -w -c rollup.config.js"},"version":"2.0.0-26820200330001"};
|
|
|
|
|
|
- val = namespace + val;
|
|
|
|
- res[key] = function mappedGetter () {
|
|
|
|
- if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if ( true && !(val in this.$store.getters)) {
|
|
|
|
- console.error(("[vuex] unknown getter: " + val));
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- return this.$store.getters[val]
|
|
|
|
- };
|
|
|
|
- // mark vuex getter for devtools
|
|
|
|
- res[key].vuex = true;
|
|
|
|
- });
|
|
|
|
- return res
|
|
|
|
-});
|
|
|
|
|
|
+/***/ }),
|
|
|
|
+/* 7 */
|
|
|
|
+/*!**********************************************************************************************!*\
|
|
|
|
+ !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/pages.json?{"type":"style"} ***!
|
|
|
|
+ \**********************************************************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
-var mapActions = normalizeNamespace(function (namespace, actions) {
|
|
|
|
- var res = {};
|
|
|
|
- normalizeMap(actions).forEach(function (ref) {
|
|
|
|
- var key = ref.key;
|
|
|
|
- var val = ref.val;
|
|
|
|
|
|
+"use strict";
|
|
|
|
+Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": { "pages/index/index": { "navigationBarTitleText": "首页" }, "pages/index/hotel": {}, "pages/myone/oneIndex": { "navigationBarTitleText": "发现" }, "pages/taBar/index": { "navigationBarTitleText": "订单" }, "pages/myCenter/index": { "navigationBarTitleText": "我的" } }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } };exports.default = _default;
|
|
|
|
|
|
- res[key] = function mappedAction () {
|
|
|
|
- var args = [], len = arguments.length;
|
|
|
|
- while ( len-- ) args[ len ] = arguments[ len ];
|
|
|
|
|
|
+/***/ }),
|
|
|
|
+/* 8 */
|
|
|
|
+/*!*********************************************************************************************!*\
|
|
|
|
+ !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/pages.json?{"type":"stat"} ***!
|
|
|
|
+ \*********************************************************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
- var dispatch = this.$store.dispatch;
|
|
|
|
- if (namespace) {
|
|
|
|
- var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
|
|
|
|
- if (!module) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- dispatch = module.context.dispatch;
|
|
|
|
- }
|
|
|
|
- return typeof val === 'function'
|
|
|
|
- ? val.apply(this, [dispatch].concat(args))
|
|
|
|
- : dispatch.apply(this.$store, [val].concat(args))
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
- return res
|
|
|
|
-});
|
|
|
|
|
|
+"use strict";
|
|
|
|
+Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__99C074F" };exports.default = _default;
|
|
|
|
|
|
-var createNamespacedHelpers = function (namespace) { return ({
|
|
|
|
- mapState: mapState.bind(null, namespace),
|
|
|
|
- mapGetters: mapGetters.bind(null, namespace),
|
|
|
|
- mapMutations: mapMutations.bind(null, namespace),
|
|
|
|
- mapActions: mapActions.bind(null, namespace)
|
|
|
|
-}); };
|
|
|
|
|
|
+/***/ }),
|
|
|
|
+/* 9 */,
|
|
|
|
+/* 10 */,
|
|
|
|
+/* 11 */,
|
|
|
|
+/* 12 */
|
|
|
|
+/*!********************************************!*\
|
|
|
|
+ !*** ./node_modules/vuex/dist/vuex.esm.js ***!
|
|
|
|
+ \********************************************/
|
|
|
|
+/*! exports provided: Store, install, mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers, default */
|
|
|
|
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
-function normalizeMap (map) {
|
|
|
|
- return Array.isArray(map)
|
|
|
|
- ? map.map(function (key) { return ({ key: key, val: key }); })
|
|
|
|
- : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
|
|
|
|
-}
|
|
|
|
|
|
+"use strict";
|
|
|
|
+__webpack_require__.r(__webpack_exports__);
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
|
|
|
|
+/**
|
|
|
|
+ * vuex v3.0.1
|
|
|
|
+ * (c) 2017 Evan You
|
|
|
|
+ * @license MIT
|
|
|
|
+ */
|
|
|
|
+var applyMixin = function (Vue) {
|
|
|
|
+ var version = Number(Vue.version.split('.')[0]);
|
|
|
|
|
|
-function normalizeNamespace (fn) {
|
|
|
|
- return function (namespace, map) {
|
|
|
|
- if (typeof namespace !== 'string') {
|
|
|
|
- map = namespace;
|
|
|
|
- namespace = '';
|
|
|
|
- } else if (namespace.charAt(namespace.length - 1) !== '/') {
|
|
|
|
- namespace += '/';
|
|
|
|
- }
|
|
|
|
- return fn(namespace, map)
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ if (version >= 2) {
|
|
|
|
+ Vue.mixin({ beforeCreate: vuexInit });
|
|
|
|
+ } else {
|
|
|
|
+ // override init and inject vuex init procedure
|
|
|
|
+ // for 1.x backwards compatibility.
|
|
|
|
+ var _init = Vue.prototype._init;
|
|
|
|
+ Vue.prototype._init = function (options) {
|
|
|
|
+ if ( options === void 0 ) options = {};
|
|
|
|
|
|
-function getModuleByNamespace (store, helper, namespace) {
|
|
|
|
- var module = store._modulesNamespaceMap[namespace];
|
|
|
|
- if ( true && !module) {
|
|
|
|
- console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
|
|
|
|
|
|
+ options.init = options.init
|
|
|
|
+ ? [vuexInit].concat(options.init)
|
|
|
|
+ : vuexInit;
|
|
|
|
+ _init.call(this, options);
|
|
|
|
+ };
|
|
}
|
|
}
|
|
- return module
|
|
|
|
-}
|
|
|
|
|
|
|
|
-var index_esm = {
|
|
|
|
- Store: Store,
|
|
|
|
- install: install,
|
|
|
|
- version: '3.0.1',
|
|
|
|
- mapState: mapState,
|
|
|
|
- mapMutations: mapMutations,
|
|
|
|
- mapGetters: mapGetters,
|
|
|
|
- mapActions: mapActions,
|
|
|
|
- createNamespacedHelpers: createNamespacedHelpers
|
|
|
|
-};
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Vuex init hook, injected into each instances init hooks list.
|
|
|
|
+ */
|
|
|
|
|
|
|
|
+ function vuexInit () {
|
|
|
|
+ var options = this.$options;
|
|
|
|
+ // store injection
|
|
|
|
+ if (options.store) {
|
|
|
|
+ this.$store = typeof options.store === 'function'
|
|
|
|
+ ? options.store()
|
|
|
|
+ : options.store;
|
|
|
|
+ } else if (options.parent && options.parent.$store) {
|
|
|
|
+ this.$store = options.parent.$store;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
-/* harmony default export */ __webpack_exports__["default"] = (index_esm);
|
|
|
|
|
|
+var devtoolHook =
|
|
|
|
+ typeof window !== 'undefined' &&
|
|
|
|
+ window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
|
|
|
|
|
|
+function devtoolPlugin (store) {
|
|
|
|
+ if (!devtoolHook) { return }
|
|
|
|
|
|
-/***/ }),
|
|
|
|
|
|
+ store._devtoolHook = devtoolHook;
|
|
|
|
|
|
-/***/ 38:
|
|
|
|
-/*!**********************************************************************************!*\
|
|
|
|
- !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/store/logion.js ***!
|
|
|
|
- \**********************************************************************************/
|
|
|
|
-/*! no static exports found */
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
+ devtoolHook.emit('vuex:init', store);
|
|
|
|
|
|
-"use strict";
|
|
|
|
-/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
|
|
|
|
-var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 37));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
|
|
|
|
|
|
+ devtoolHook.on('vuex:travel-to-state', function (targetState) {
|
|
|
|
+ store.replaceState(targetState);
|
|
|
|
+ });
|
|
|
|
|
|
-_vue.default.use(_vuex.default);
|
|
|
|
|
|
+ store.subscribe(function (mutation, state) {
|
|
|
|
+ devtoolHook.emit('vuex:mutation', mutation, state);
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
|
|
-var store = new _vuex.default.Store({
|
|
|
|
- state: {
|
|
|
|
- hasLogin: false,
|
|
|
|
- sessionId: '',
|
|
|
|
- showModal: false, //登录授权弹窗
|
|
|
|
- userInfo: {} },
|
|
|
|
|
|
+/**
|
|
|
|
+ * Get the first item that pass the test
|
|
|
|
+ * by second argument function
|
|
|
|
+ *
|
|
|
|
+ * @param {Array} list
|
|
|
|
+ * @param {Function} f
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+/**
|
|
|
|
+ * Deep copy the given object considering circular structure.
|
|
|
|
+ * This function caches all nested objects and its copies.
|
|
|
|
+ * If it detects circular structure, use cached copy to avoid infinite loop.
|
|
|
|
+ *
|
|
|
|
+ * @param {*} obj
|
|
|
|
+ * @param {Array<Object>} cache
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
|
|
- mutations: {
|
|
|
|
- login: function login(state, provider) {
|
|
|
|
- state.hasLogin = true;
|
|
|
|
- state.userInfo = provider;
|
|
|
|
- uni.setStorage({ //缓存用户登陆状态
|
|
|
|
- key: 'userInfo',
|
|
|
|
- data: provider });
|
|
|
|
|
|
|
|
- console.log(state.userInfo);
|
|
|
|
- },
|
|
|
|
|
|
+/**
|
|
|
|
+ * forEach for object
|
|
|
|
+ */
|
|
|
|
+function forEachValue (obj, fn) {
|
|
|
|
+ Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
|
|
|
|
+}
|
|
|
|
|
|
- setOpenid: function setOpenid(state, provider) {
|
|
|
|
- state.sessionId = provider;
|
|
|
|
- uni.setStorage({ //缓存用户登陆状态
|
|
|
|
- key: 'sessionId',
|
|
|
|
- data: provider });
|
|
|
|
|
|
+function isObject (obj) {
|
|
|
|
+ return obj !== null && typeof obj === 'object'
|
|
|
|
+}
|
|
|
|
|
|
|
|
+function isPromise (val) {
|
|
|
|
+ return val && typeof val.then === 'function'
|
|
|
|
+}
|
|
|
|
|
|
- },
|
|
|
|
- showDialog: function showDialog(state, status) {
|
|
|
|
- state.showModal = status;
|
|
|
|
- uni.setStorage({ //缓存用户登陆状态
|
|
|
|
- key: 'showModal',
|
|
|
|
- data: status });
|
|
|
|
|
|
+function assert (condition, msg) {
|
|
|
|
+ if (!condition) { throw new Error(("[vuex] " + msg)) }
|
|
|
|
+}
|
|
|
|
|
|
- console.log(state.showModal);
|
|
|
|
- },
|
|
|
|
|
|
+var Module = function Module (rawModule, runtime) {
|
|
|
|
+ this.runtime = runtime;
|
|
|
|
+ this._children = Object.create(null);
|
|
|
|
+ this._rawModule = rawModule;
|
|
|
|
+ var rawState = rawModule.state;
|
|
|
|
+ this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
|
|
|
|
+};
|
|
|
|
|
|
|
|
+var prototypeAccessors$1 = { namespaced: { configurable: true } };
|
|
|
|
|
|
- logout: function logout(state) {
|
|
|
|
- state.hasLogin = false;
|
|
|
|
- state.userInfo = {};
|
|
|
|
- state.sessionId = '';
|
|
|
|
- uni.removeStorage({
|
|
|
|
- key: 'userInfo' });
|
|
|
|
|
|
+prototypeAccessors$1.namespaced.get = function () {
|
|
|
|
+ return !!this._rawModule.namespaced
|
|
|
|
+};
|
|
|
|
|
|
- uni.removeStorage({
|
|
|
|
- key: 'sessionId' });
|
|
|
|
|
|
+Module.prototype.addChild = function addChild (key, module) {
|
|
|
|
+ this._children[key] = module;
|
|
|
|
+};
|
|
|
|
|
|
- } }
|
|
|
|
|
|
+Module.prototype.removeChild = function removeChild (key) {
|
|
|
|
+ delete this._children[key];
|
|
|
|
+};
|
|
|
|
|
|
- // actions: {
|
|
|
|
- // // lazy loading openid
|
|
|
|
- // getUserOpenId: async function ({
|
|
|
|
- // commit,
|
|
|
|
- // state
|
|
|
|
- // }) {
|
|
|
|
- // return await new Promise((resolve, reject) => {
|
|
|
|
- // if (state.openid) {
|
|
|
|
- // resolve(state.openid)
|
|
|
|
- // } else {
|
|
|
|
- // uni.login({
|
|
|
|
- // success: (data) => {
|
|
|
|
- // commit('login')
|
|
|
|
- // setTimeout(function () { //模拟异步请求服务器获取 openid
|
|
|
|
- // const openid = '123456789'
|
|
|
|
- // commit('setOpenid', openid)
|
|
|
|
- // resolve(openid)
|
|
|
|
- // }, 1000)
|
|
|
|
- // },
|
|
|
|
- // fail: (err) => {
|
|
|
|
- // console.log('uni.login 接口调用失败,将无法正常使用开放接口等服务', err)
|
|
|
|
- // reject(err)
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-});var _default =
|
|
|
|
|
|
+Module.prototype.getChild = function getChild (key) {
|
|
|
|
+ return this._children[key]
|
|
|
|
+};
|
|
|
|
|
|
-store;exports.default = _default;
|
|
|
|
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
|
|
|
|
+Module.prototype.update = function update (rawModule) {
|
|
|
|
+ this._rawModule.namespaced = rawModule.namespaced;
|
|
|
|
+ if (rawModule.actions) {
|
|
|
|
+ this._rawModule.actions = rawModule.actions;
|
|
|
|
+ }
|
|
|
|
+ if (rawModule.mutations) {
|
|
|
|
+ this._rawModule.mutations = rawModule.mutations;
|
|
|
|
+ }
|
|
|
|
+ if (rawModule.getters) {
|
|
|
|
+ this._rawModule.getters = rawModule.getters;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
-/***/ }),
|
|
|
|
|
|
+Module.prototype.forEachChild = function forEachChild (fn) {
|
|
|
|
+ forEachValue(this._children, fn);
|
|
|
|
+};
|
|
|
|
|
|
-/***/ 4:
|
|
|
|
-/*!*****************************************************************************!*\
|
|
|
|
- !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/pages.json ***!
|
|
|
|
- \*****************************************************************************/
|
|
|
|
-/*! no static exports found */
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
+Module.prototype.forEachGetter = function forEachGetter (fn) {
|
|
|
|
+ if (this._rawModule.getters) {
|
|
|
|
+ forEachValue(this._rawModule.getters, fn);
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
-"use strict";
|
|
|
|
|
|
+Module.prototype.forEachAction = function forEachAction (fn) {
|
|
|
|
+ if (this._rawModule.actions) {
|
|
|
|
+ forEachValue(this._rawModule.actions, fn);
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
|
|
+Module.prototype.forEachMutation = function forEachMutation (fn) {
|
|
|
|
+ if (this._rawModule.mutations) {
|
|
|
|
+ forEachValue(this._rawModule.mutations, fn);
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
-/***/ }),
|
|
|
|
|
|
+Object.defineProperties( Module.prototype, prototypeAccessors$1 );
|
|
|
|
|
|
-/***/ 5:
|
|
|
|
-/*!*******************************************************!*\
|
|
|
|
- !*** ./node_modules/@dcloudio/uni-stat/dist/index.js ***!
|
|
|
|
- \*******************************************************/
|
|
|
|
-/*! no static exports found */
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
+var ModuleCollection = function ModuleCollection (rawRootModule) {
|
|
|
|
+ // register root module (Vuex.Store options)
|
|
|
|
+ this.register([], rawRootModule, false);
|
|
|
|
+};
|
|
|
|
|
|
-"use strict";
|
|
|
|
-/* WEBPACK VAR INJECTION */(function(uni) {var _package = __webpack_require__(/*! ../package.json */ 6);function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}
|
|
|
|
|
|
+ModuleCollection.prototype.get = function get (path) {
|
|
|
|
+ return path.reduce(function (module, key) {
|
|
|
|
+ return module.getChild(key)
|
|
|
|
+ }, this.root)
|
|
|
|
+};
|
|
|
|
|
|
-var STAT_VERSION = _package.version;
|
|
|
|
-var STAT_URL = 'https://tongji.dcloud.io/uni/stat';
|
|
|
|
-var STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
|
|
|
|
-var PAGE_PVER_TIME = 1800;
|
|
|
|
-var APP_PVER_TIME = 300;
|
|
|
|
-var OPERATING_TIME = 10;
|
|
|
|
|
|
+ModuleCollection.prototype.getNamespace = function getNamespace (path) {
|
|
|
|
+ var module = this.root;
|
|
|
|
+ return path.reduce(function (namespace, key) {
|
|
|
|
+ module = module.getChild(key);
|
|
|
|
+ return namespace + (module.namespaced ? key + '/' : '')
|
|
|
|
+ }, '')
|
|
|
|
+};
|
|
|
|
|
|
-var UUID_KEY = '__DC_STAT_UUID';
|
|
|
|
-var UUID_VALUE = '__DC_UUID_VALUE';
|
|
|
|
|
|
+ModuleCollection.prototype.update = function update$1 (rawRootModule) {
|
|
|
|
+ update([], this.root, rawRootModule);
|
|
|
|
+};
|
|
|
|
|
|
-function getUuid() {
|
|
|
|
- var uuid = '';
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- try {
|
|
|
|
- uuid = plus.runtime.getDCloudId();
|
|
|
|
- } catch (e) {
|
|
|
|
- uuid = '';
|
|
|
|
- }
|
|
|
|
- return uuid;
|
|
|
|
- }
|
|
|
|
|
|
+ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
|
|
|
|
+ var this$1 = this;
|
|
|
|
+ if ( runtime === void 0 ) runtime = true;
|
|
|
|
|
|
- try {
|
|
|
|
- uuid = uni.getStorageSync(UUID_KEY);
|
|
|
|
- } catch (e) {
|
|
|
|
- uuid = UUID_VALUE;
|
|
|
|
|
|
+ if (true) {
|
|
|
|
+ assertRawModule(path, rawModule);
|
|
}
|
|
}
|
|
|
|
|
|
- if (!uuid) {
|
|
|
|
- uuid = Date.now() + '' + Math.floor(Math.random() * 1e7);
|
|
|
|
- try {
|
|
|
|
- uni.setStorageSync(UUID_KEY, uuid);
|
|
|
|
- } catch (e) {
|
|
|
|
- uni.setStorageSync(UUID_KEY, UUID_VALUE);
|
|
|
|
- }
|
|
|
|
|
|
+ var newModule = new Module(rawModule, runtime);
|
|
|
|
+ if (path.length === 0) {
|
|
|
|
+ this.root = newModule;
|
|
|
|
+ } else {
|
|
|
|
+ var parent = this.get(path.slice(0, -1));
|
|
|
|
+ parent.addChild(path[path.length - 1], newModule);
|
|
}
|
|
}
|
|
- return uuid;
|
|
|
|
-}
|
|
|
|
|
|
|
|
-var getSgin = function getSgin(statData) {
|
|
|
|
- var arr = Object.keys(statData);
|
|
|
|
- var sortArr = arr.sort();
|
|
|
|
- var sgin = {};
|
|
|
|
- var sginStr = '';
|
|
|
|
- for (var i in sortArr) {
|
|
|
|
- sgin[sortArr[i]] = statData[sortArr[i]];
|
|
|
|
- sginStr += sortArr[i] + '=' + statData[sortArr[i]] + '&';
|
|
|
|
|
|
+ // register nested modules
|
|
|
|
+ if (rawModule.modules) {
|
|
|
|
+ forEachValue(rawModule.modules, function (rawChildModule, key) {
|
|
|
|
+ this$1.register(path.concat(key), rawChildModule, runtime);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- // const options = sginStr.substr(0, sginStr.length - 1)
|
|
|
|
- // sginStr = sginStr.substr(0, sginStr.length - 1) + '&key=' + STAT_KEY;
|
|
|
|
- // const si = crypto.createHash('md5').update(sginStr).digest('hex');
|
|
|
|
- return {
|
|
|
|
- sign: '',
|
|
|
|
- options: sginStr.substr(0, sginStr.length - 1) };
|
|
|
|
-
|
|
|
|
};
|
|
};
|
|
|
|
|
|
-var getSplicing = function getSplicing(data) {
|
|
|
|
- var str = '';
|
|
|
|
- for (var i in data) {
|
|
|
|
- str += i + '=' + data[i] + '&';
|
|
|
|
- }
|
|
|
|
- return str.substr(0, str.length - 1);
|
|
|
|
-};
|
|
|
|
|
|
+ModuleCollection.prototype.unregister = function unregister (path) {
|
|
|
|
+ var parent = this.get(path.slice(0, -1));
|
|
|
|
+ var key = path[path.length - 1];
|
|
|
|
+ if (!parent.getChild(key).runtime) { return }
|
|
|
|
|
|
-var getTime = function getTime() {
|
|
|
|
- return parseInt(new Date().getTime() / 1000);
|
|
|
|
|
|
+ parent.removeChild(key);
|
|
};
|
|
};
|
|
|
|
|
|
-var getPlatformName = function getPlatformName() {
|
|
|
|
- var platformList = {
|
|
|
|
- 'app-plus': 'n',
|
|
|
|
- 'h5': 'h5',
|
|
|
|
- 'mp-weixin': 'wx',
|
|
|
|
- 'mp-alipay': 'ali',
|
|
|
|
- 'mp-baidu': 'bd',
|
|
|
|
- 'mp-toutiao': 'tt',
|
|
|
|
- 'mp-qq': 'qq' };
|
|
|
|
|
|
+function update (path, targetModule, newModule) {
|
|
|
|
+ if (true) {
|
|
|
|
+ assertRawModule(path, newModule);
|
|
|
|
+ }
|
|
|
|
|
|
- return platformList["mp-weixin"];
|
|
|
|
-};
|
|
|
|
|
|
+ // update target module
|
|
|
|
+ targetModule.update(newModule);
|
|
|
|
|
|
-var getPackName = function getPackName() {
|
|
|
|
- var packName = '';
|
|
|
|
- if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
|
|
|
|
- // 兼容微信小程序低版本基础库
|
|
|
|
- if (uni.canIUse('getAccountInfoSync')) {
|
|
|
|
- packName = uni.getAccountInfoSync().miniProgram.appId || '';
|
|
|
|
|
|
+ // update nested modules
|
|
|
|
+ if (newModule.modules) {
|
|
|
|
+ for (var key in newModule.modules) {
|
|
|
|
+ if (!targetModule.getChild(key)) {
|
|
|
|
+ if (true) {
|
|
|
|
+ console.warn(
|
|
|
|
+ "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
|
|
|
|
+ 'manual reload is needed'
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ update(
|
|
|
|
+ path.concat(key),
|
|
|
|
+ targetModule.getChild(key),
|
|
|
|
+ newModule.modules[key]
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return packName;
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+var functionAssert = {
|
|
|
|
+ assert: function (value) { return typeof value === 'function'; },
|
|
|
|
+ expected: 'function'
|
|
};
|
|
};
|
|
|
|
|
|
-var getVersion = function getVersion() {
|
|
|
|
- return getPlatformName() === 'n' ? plus.runtime.version : '';
|
|
|
|
|
|
+var objectAssert = {
|
|
|
|
+ assert: function (value) { return typeof value === 'function' ||
|
|
|
|
+ (typeof value === 'object' && typeof value.handler === 'function'); },
|
|
|
|
+ expected: 'function or object with "handler" function'
|
|
};
|
|
};
|
|
|
|
|
|
-var getChannel = function getChannel() {
|
|
|
|
- var platformName = getPlatformName();
|
|
|
|
- var channel = '';
|
|
|
|
- if (platformName === 'n') {
|
|
|
|
- channel = plus.runtime.channel;
|
|
|
|
- }
|
|
|
|
- return channel;
|
|
|
|
|
|
+var assertTypes = {
|
|
|
|
+ getters: functionAssert,
|
|
|
|
+ mutations: functionAssert,
|
|
|
|
+ actions: objectAssert
|
|
};
|
|
};
|
|
|
|
|
|
-var getScene = function getScene(options) {
|
|
|
|
- var platformName = getPlatformName();
|
|
|
|
- var scene = '';
|
|
|
|
- if (options) {
|
|
|
|
- return options;
|
|
|
|
|
|
+function assertRawModule (path, rawModule) {
|
|
|
|
+ Object.keys(assertTypes).forEach(function (key) {
|
|
|
|
+ if (!rawModule[key]) { return }
|
|
|
|
+
|
|
|
|
+ var assertOptions = assertTypes[key];
|
|
|
|
+
|
|
|
|
+ forEachValue(rawModule[key], function (value, type) {
|
|
|
|
+ assert(
|
|
|
|
+ assertOptions.assert(value),
|
|
|
|
+ makeAssertionMessage(path, key, type, value, assertOptions.expected)
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function makeAssertionMessage (path, key, type, value, expected) {
|
|
|
|
+ var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
|
|
|
|
+ if (path.length > 0) {
|
|
|
|
+ buf += " in module \"" + (path.join('.')) + "\"";
|
|
}
|
|
}
|
|
- if (platformName === 'wx') {
|
|
|
|
- scene = uni.getLaunchOptionsSync().scene;
|
|
|
|
|
|
+ buf += " is " + (JSON.stringify(value)) + ".";
|
|
|
|
+ return buf
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+var Vue; // bind on install
|
|
|
|
+
|
|
|
|
+var Store = function Store (options) {
|
|
|
|
+ var this$1 = this;
|
|
|
|
+ if ( options === void 0 ) options = {};
|
|
|
|
+
|
|
|
|
+ // Auto install if it is not done yet and `window` has `Vue`.
|
|
|
|
+ // To allow users to avoid auto-installation in some cases,
|
|
|
|
+ // this code should be placed here. See #731
|
|
|
|
+ if (!Vue && typeof window !== 'undefined' && window.Vue) {
|
|
|
|
+ install(window.Vue);
|
|
}
|
|
}
|
|
- return scene;
|
|
|
|
-};
|
|
|
|
-var First__Visit__Time__KEY = 'First__Visit__Time';
|
|
|
|
-var Last__Visit__Time__KEY = 'Last__Visit__Time';
|
|
|
|
|
|
|
|
-var getFirstVisitTime = function getFirstVisitTime() {
|
|
|
|
- var timeStorge = uni.getStorageSync(First__Visit__Time__KEY);
|
|
|
|
- var time = 0;
|
|
|
|
- if (timeStorge) {
|
|
|
|
- time = timeStorge;
|
|
|
|
- } else {
|
|
|
|
- time = getTime();
|
|
|
|
- uni.setStorageSync(First__Visit__Time__KEY, time);
|
|
|
|
- uni.removeStorageSync(Last__Visit__Time__KEY);
|
|
|
|
|
|
+ if (true) {
|
|
|
|
+ assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
|
|
|
|
+ assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
|
|
|
|
+ assert(this instanceof Store, "Store must be called with the new operator.");
|
|
}
|
|
}
|
|
- return time;
|
|
|
|
-};
|
|
|
|
|
|
|
|
-var getLastVisitTime = function getLastVisitTime() {
|
|
|
|
- var timeStorge = uni.getStorageSync(Last__Visit__Time__KEY);
|
|
|
|
- var time = 0;
|
|
|
|
- if (timeStorge) {
|
|
|
|
- time = timeStorge;
|
|
|
|
- } else {
|
|
|
|
- time = '';
|
|
|
|
|
|
+ var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
|
|
|
|
+ var strict = options.strict; if ( strict === void 0 ) strict = false;
|
|
|
|
+
|
|
|
|
+ var state = options.state; if ( state === void 0 ) state = {};
|
|
|
|
+ if (typeof state === 'function') {
|
|
|
|
+ state = state() || {};
|
|
}
|
|
}
|
|
- uni.setStorageSync(Last__Visit__Time__KEY, getTime());
|
|
|
|
- return time;
|
|
|
|
-};
|
|
|
|
|
|
|
|
|
|
+ // store internal state
|
|
|
|
+ this._committing = false;
|
|
|
|
+ this._actions = Object.create(null);
|
|
|
|
+ this._actionSubscribers = [];
|
|
|
|
+ this._mutations = Object.create(null);
|
|
|
|
+ this._wrappedGetters = Object.create(null);
|
|
|
|
+ this._modules = new ModuleCollection(options);
|
|
|
|
+ this._modulesNamespaceMap = Object.create(null);
|
|
|
|
+ this._subscribers = [];
|
|
|
|
+ this._watcherVM = new Vue();
|
|
|
|
|
|
-var PAGE_RESIDENCE_TIME = '__page__residence__time';
|
|
|
|
-var First_Page_residence_time = 0;
|
|
|
|
-var Last_Page_residence_time = 0;
|
|
|
|
|
|
+ // bind commit and dispatch to self
|
|
|
|
+ var store = this;
|
|
|
|
+ var ref = this;
|
|
|
|
+ var dispatch = ref.dispatch;
|
|
|
|
+ var commit = ref.commit;
|
|
|
|
+ this.dispatch = function boundDispatch (type, payload) {
|
|
|
|
+ return dispatch.call(store, type, payload)
|
|
|
|
+ };
|
|
|
|
+ this.commit = function boundCommit (type, payload, options) {
|
|
|
|
+ return commit.call(store, type, payload, options)
|
|
|
|
+ };
|
|
|
|
|
|
|
|
+ // strict mode
|
|
|
|
+ this.strict = strict;
|
|
|
|
|
|
-var setPageResidenceTime = function setPageResidenceTime() {
|
|
|
|
- First_Page_residence_time = getTime();
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- uni.setStorageSync(PAGE_RESIDENCE_TIME, getTime());
|
|
|
|
- }
|
|
|
|
- return First_Page_residence_time;
|
|
|
|
-};
|
|
|
|
|
|
+ // init root module.
|
|
|
|
+ // this also recursively registers all sub-modules
|
|
|
|
+ // and collects all module getters inside this._wrappedGetters
|
|
|
|
+ installModule(this, state, [], this._modules.root);
|
|
|
|
|
|
-var getPageResidenceTime = function getPageResidenceTime() {
|
|
|
|
- Last_Page_residence_time = getTime();
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- First_Page_residence_time = uni.getStorageSync(PAGE_RESIDENCE_TIME);
|
|
|
|
- }
|
|
|
|
- return Last_Page_residence_time - First_Page_residence_time;
|
|
|
|
-};
|
|
|
|
-var TOTAL__VISIT__COUNT = 'Total__Visit__Count';
|
|
|
|
-var getTotalVisitCount = function getTotalVisitCount() {
|
|
|
|
- var timeStorge = uni.getStorageSync(TOTAL__VISIT__COUNT);
|
|
|
|
- var count = 1;
|
|
|
|
- if (timeStorge) {
|
|
|
|
- count = timeStorge;
|
|
|
|
- count++;
|
|
|
|
- }
|
|
|
|
- uni.setStorageSync(TOTAL__VISIT__COUNT, count);
|
|
|
|
- return count;
|
|
|
|
-};
|
|
|
|
|
|
+ // initialize the store vm, which is responsible for the reactivity
|
|
|
|
+ // (also registers _wrappedGetters as computed properties)
|
|
|
|
+ resetStoreVM(this, state);
|
|
|
|
+
|
|
|
|
+ // apply plugins
|
|
|
|
+ plugins.forEach(function (plugin) { return plugin(this$1); });
|
|
|
|
|
|
-var GetEncodeURIComponentOptions = function GetEncodeURIComponentOptions(statData) {
|
|
|
|
- var data = {};
|
|
|
|
- for (var prop in statData) {
|
|
|
|
- data[prop] = encodeURIComponent(statData[prop]);
|
|
|
|
|
|
+ if (Vue.config.devtools) {
|
|
|
|
+ devtoolPlugin(this);
|
|
}
|
|
}
|
|
- return data;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
-var Set__First__Time = 0;
|
|
|
|
-var Set__Last__Time = 0;
|
|
|
|
|
|
+var prototypeAccessors = { state: { configurable: true } };
|
|
|
|
|
|
-var getFirstTime = function getFirstTime() {
|
|
|
|
- var time = new Date().getTime();
|
|
|
|
- Set__First__Time = time;
|
|
|
|
- Set__Last__Time = 0;
|
|
|
|
- return time;
|
|
|
|
|
|
+prototypeAccessors.state.get = function () {
|
|
|
|
+ return this._vm._data.$$state
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
-var getLastTime = function getLastTime() {
|
|
|
|
- var time = new Date().getTime();
|
|
|
|
- Set__Last__Time = time;
|
|
|
|
- return time;
|
|
|
|
|
|
+prototypeAccessors.state.set = function (v) {
|
|
|
|
+ if (true) {
|
|
|
|
+ assert(false, "Use store.replaceState() to explicit replace store state.");
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+Store.prototype.commit = function commit (_type, _payload, _options) {
|
|
|
|
+ var this$1 = this;
|
|
|
|
|
|
-var getResidenceTime = function getResidenceTime(type) {
|
|
|
|
- var residenceTime = 0;
|
|
|
|
- if (Set__First__Time !== 0) {
|
|
|
|
- residenceTime = Set__Last__Time - Set__First__Time;
|
|
|
|
- }
|
|
|
|
|
|
+ // check object-style commit
|
|
|
|
+ var ref = unifyObjectStyle(_type, _payload, _options);
|
|
|
|
+ var type = ref.type;
|
|
|
|
+ var payload = ref.payload;
|
|
|
|
+ var options = ref.options;
|
|
|
|
|
|
- residenceTime = parseInt(residenceTime / 1000);
|
|
|
|
- residenceTime = residenceTime < 1 ? 1 : residenceTime;
|
|
|
|
- if (type === 'app') {
|
|
|
|
- var overtime = residenceTime > APP_PVER_TIME ? true : false;
|
|
|
|
- return {
|
|
|
|
- residenceTime: residenceTime,
|
|
|
|
- overtime: overtime };
|
|
|
|
|
|
+ var mutation = { type: type, payload: payload };
|
|
|
|
+ var entry = this._mutations[type];
|
|
|
|
+ if (!entry) {
|
|
|
|
+ if (true) {
|
|
|
|
+ console.error(("[vuex] unknown mutation type: " + type));
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this._withCommit(function () {
|
|
|
|
+ entry.forEach(function commitIterator (handler) {
|
|
|
|
+ handler(payload);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
|
|
|
|
|
|
|
|
+ if (
|
|
|
|
+ true &&
|
|
|
|
+ options && options.silent
|
|
|
|
+ ) {
|
|
|
|
+ console.warn(
|
|
|
|
+ "[vuex] mutation type: " + type + ". Silent option has been removed. " +
|
|
|
|
+ 'Use the filter functionality in the vue-devtools'
|
|
|
|
+ );
|
|
}
|
|
}
|
|
- if (type === 'page') {
|
|
|
|
- var _overtime = residenceTime > PAGE_PVER_TIME ? true : false;
|
|
|
|
- return {
|
|
|
|
- residenceTime: residenceTime,
|
|
|
|
- overtime: _overtime };
|
|
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+Store.prototype.dispatch = function dispatch (_type, _payload) {
|
|
|
|
+ var this$1 = this;
|
|
|
|
+
|
|
|
|
+ // check object-style dispatch
|
|
|
|
+ var ref = unifyObjectStyle(_type, _payload);
|
|
|
|
+ var type = ref.type;
|
|
|
|
+ var payload = ref.payload;
|
|
|
|
|
|
|
|
+ var action = { type: type, payload: payload };
|
|
|
|
+ var entry = this._actions[type];
|
|
|
|
+ if (!entry) {
|
|
|
|
+ if (true) {
|
|
|
|
+ console.error(("[vuex] unknown action type: " + type));
|
|
|
|
+ }
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
- return {
|
|
|
|
- residenceTime: residenceTime };
|
|
|
|
|
|
+ this._actionSubscribers.forEach(function (sub) { return sub(action, this$1.state); });
|
|
|
|
+
|
|
|
|
+ return entry.length > 1
|
|
|
|
+ ? Promise.all(entry.map(function (handler) { return handler(payload); }))
|
|
|
|
+ : entry[0](payload)
|
|
|
|
+};
|
|
|
|
|
|
|
|
+Store.prototype.subscribe = function subscribe (fn) {
|
|
|
|
+ return genericSubscribe(fn, this._subscribers)
|
|
|
|
+};
|
|
|
|
|
|
|
|
+Store.prototype.subscribeAction = function subscribeAction (fn) {
|
|
|
|
+ return genericSubscribe(fn, this._actionSubscribers)
|
|
};
|
|
};
|
|
|
|
|
|
-var getRoute = function getRoute() {
|
|
|
|
- var pages = getCurrentPages();
|
|
|
|
- var page = pages[pages.length - 1];
|
|
|
|
- var _self = page.$vm;
|
|
|
|
|
|
+Store.prototype.watch = function watch (getter, cb, options) {
|
|
|
|
+ var this$1 = this;
|
|
|
|
|
|
- if (getPlatformName() === 'bd') {
|
|
|
|
- return _self.$mp && _self.$mp.page.is;
|
|
|
|
- } else {
|
|
|
|
- return _self.$scope && _self.$scope.route || _self.$mp && _self.$mp.page.route;
|
|
|
|
|
|
+ if (true) {
|
|
|
|
+ assert(typeof getter === 'function', "store.watch only accepts a function.");
|
|
}
|
|
}
|
|
|
|
+ return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
|
|
};
|
|
};
|
|
|
|
|
|
-var getPageRoute = function getPageRoute(self) {
|
|
|
|
- var pages = getCurrentPages();
|
|
|
|
- var page = pages[pages.length - 1];
|
|
|
|
- var _self = page.$vm;
|
|
|
|
- var query = self._query;
|
|
|
|
- var str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : '';
|
|
|
|
- // clear
|
|
|
|
- self._query = '';
|
|
|
|
- if (getPlatformName() === 'bd') {
|
|
|
|
- return _self.$mp && _self.$mp.page.is + str;
|
|
|
|
- } else {
|
|
|
|
- return _self.$scope && _self.$scope.route + str || _self.$mp && _self.$mp.page.route + str;
|
|
|
|
- }
|
|
|
|
|
|
+Store.prototype.replaceState = function replaceState (state) {
|
|
|
|
+ var this$1 = this;
|
|
|
|
+
|
|
|
|
+ this._withCommit(function () {
|
|
|
|
+ this$1._vm._data.$$state = state;
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
-var getPageTypes = function getPageTypes(self) {
|
|
|
|
- if (self.mpType === 'page' || self.$mp && self.$mp.mpType === 'page' || self.$options.mpType === 'page') {
|
|
|
|
- return true;
|
|
|
|
|
|
+Store.prototype.registerModule = function registerModule (path, rawModule, options) {
|
|
|
|
+ if ( options === void 0 ) options = {};
|
|
|
|
+
|
|
|
|
+ if (typeof path === 'string') { path = [path]; }
|
|
|
|
+
|
|
|
|
+ if (true) {
|
|
|
|
+ assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
|
|
+ assert(path.length > 0, 'cannot register the root module by using registerModule.');
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+
|
|
|
|
+ this._modules.register(path, rawModule);
|
|
|
|
+ installModule(this, this.state, path, this._modules.get(path), options.preserveState);
|
|
|
|
+ // reset store to update getters...
|
|
|
|
+ resetStoreVM(this, this.state);
|
|
};
|
|
};
|
|
|
|
|
|
-var calibration = function calibration(eventName, options) {
|
|
|
|
- // login 、 share 、pay_success 、pay_fail 、register 、title
|
|
|
|
- if (!eventName) {
|
|
|
|
- console.error("uni.report \u7F3A\u5C11 [eventName] \u53C2\u6570");
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- if (typeof eventName !== 'string') {
|
|
|
|
- console.error("uni.report [eventName] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u7C7B\u578B");
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- if (eventName.length > 255) {
|
|
|
|
- console.error("uni.report [eventName] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
|
|
+Store.prototype.unregisterModule = function unregisterModule (path) {
|
|
|
|
+ var this$1 = this;
|
|
|
|
|
|
- if (typeof options !== 'string' && typeof options !== 'object') {
|
|
|
|
- console.error("uni.report [options] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u6216 Object \u7C7B\u578B");
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
|
|
+ if (typeof path === 'string') { path = [path]; }
|
|
|
|
|
|
- if (typeof options === 'string' && options.length > 255) {
|
|
|
|
- console.error("uni.report [options] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
|
|
|
|
- return true;
|
|
|
|
|
|
+ if (true) {
|
|
|
|
+ assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
}
|
|
}
|
|
|
|
|
|
- if (eventName === 'title' && typeof options !== 'string') {
|
|
|
|
- console.error('uni.report [eventName] 参数为 title 时,[options] 参数只能为 String 类型');
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
|
|
+ this._modules.unregister(path);
|
|
|
|
+ this._withCommit(function () {
|
|
|
|
+ var parentState = getNestedState(this$1.state, path.slice(0, -1));
|
|
|
|
+ Vue.delete(parentState, path[path.length - 1]);
|
|
|
|
+ });
|
|
|
|
+ resetStore(this);
|
|
};
|
|
};
|
|
|
|
|
|
-var PagesJson = __webpack_require__(/*! uni-pages?{"type":"style"} */ 7).default;
|
|
|
|
-var statConfig = __webpack_require__(/*! uni-stat-config */ 8).default || __webpack_require__(/*! uni-stat-config */ 8);
|
|
|
|
|
|
+Store.prototype.hotUpdate = function hotUpdate (newOptions) {
|
|
|
|
+ this._modules.update(newOptions);
|
|
|
|
+ resetStore(this, true);
|
|
|
|
+};
|
|
|
|
|
|
-var resultOptions = uni.getSystemInfoSync();var
|
|
|
|
|
|
+Store.prototype._withCommit = function _withCommit (fn) {
|
|
|
|
+ var committing = this._committing;
|
|
|
|
+ this._committing = true;
|
|
|
|
+ fn();
|
|
|
|
+ this._committing = committing;
|
|
|
|
+};
|
|
|
|
|
|
-Util = /*#__PURE__*/function () {
|
|
|
|
- function Util() {_classCallCheck(this, Util);
|
|
|
|
- this.self = '';
|
|
|
|
- this._retry = 0;
|
|
|
|
- this._platform = '';
|
|
|
|
- this._query = {};
|
|
|
|
- this._navigationBarTitle = {
|
|
|
|
- config: '',
|
|
|
|
- page: '',
|
|
|
|
- report: '',
|
|
|
|
- lt: '' };
|
|
|
|
|
|
+Object.defineProperties( Store.prototype, prototypeAccessors );
|
|
|
|
|
|
- this._operatingTime = 0;
|
|
|
|
- this._reportingRequestData = {
|
|
|
|
- '1': [],
|
|
|
|
- '11': [] };
|
|
|
|
|
|
+function genericSubscribe (fn, subs) {
|
|
|
|
+ if (subs.indexOf(fn) < 0) {
|
|
|
|
+ subs.push(fn);
|
|
|
|
+ }
|
|
|
|
+ return function () {
|
|
|
|
+ var i = subs.indexOf(fn);
|
|
|
|
+ if (i > -1) {
|
|
|
|
+ subs.splice(i, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
- this.__prevent_triggering = false;
|
|
|
|
|
|
+function resetStore (store, hot) {
|
|
|
|
+ store._actions = Object.create(null);
|
|
|
|
+ store._mutations = Object.create(null);
|
|
|
|
+ store._wrappedGetters = Object.create(null);
|
|
|
|
+ store._modulesNamespaceMap = Object.create(null);
|
|
|
|
+ var state = store.state;
|
|
|
|
+ // init all modules
|
|
|
|
+ installModule(store, state, [], store._modules.root, true);
|
|
|
|
+ // reset vm
|
|
|
|
+ resetStoreVM(store, state, hot);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function resetStoreVM (store, state, hot) {
|
|
|
|
+ var oldVm = store._vm;
|
|
|
|
+
|
|
|
|
+ // bind store public getters
|
|
|
|
+ store.getters = {};
|
|
|
|
+ var wrappedGetters = store._wrappedGetters;
|
|
|
|
+ var computed = {};
|
|
|
|
+ forEachValue(wrappedGetters, function (fn, key) {
|
|
|
|
+ // use computed to leverage its lazy-caching mechanism
|
|
|
|
+ computed[key] = function () { return fn(store); };
|
|
|
|
+ Object.defineProperty(store.getters, key, {
|
|
|
|
+ get: function () { return store._vm[key]; },
|
|
|
|
+ enumerable: true // for local getters
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
|
|
- this.__licationHide = false;
|
|
|
|
- this.__licationShow = false;
|
|
|
|
- this._lastPageRoute = '';
|
|
|
|
- this.statData = {
|
|
|
|
- uuid: getUuid(),
|
|
|
|
- ut: getPlatformName(),
|
|
|
|
- mpn: getPackName(),
|
|
|
|
- ak: statConfig.appid,
|
|
|
|
- usv: STAT_VERSION,
|
|
|
|
- v: getVersion(),
|
|
|
|
- ch: getChannel(),
|
|
|
|
- cn: '',
|
|
|
|
- pn: '',
|
|
|
|
- ct: '',
|
|
|
|
- t: getTime(),
|
|
|
|
- tt: '',
|
|
|
|
- p: resultOptions.platform === 'android' ? 'a' : 'i',
|
|
|
|
- brand: resultOptions.brand || '',
|
|
|
|
- md: resultOptions.model,
|
|
|
|
- sv: resultOptions.system.replace(/(Android|iOS)\s/, ''),
|
|
|
|
- mpsdk: resultOptions.SDKVersion || '',
|
|
|
|
- mpv: resultOptions.version || '',
|
|
|
|
- lang: resultOptions.language,
|
|
|
|
- pr: resultOptions.pixelRatio,
|
|
|
|
- ww: resultOptions.windowWidth,
|
|
|
|
- wh: resultOptions.windowHeight,
|
|
|
|
- sw: resultOptions.screenWidth,
|
|
|
|
- sh: resultOptions.screenHeight };
|
|
|
|
|
|
+ // use a Vue instance to store the state tree
|
|
|
|
+ // suppress warnings just in case the user has added
|
|
|
|
+ // some funky global mixins
|
|
|
|
+ var silent = Vue.config.silent;
|
|
|
|
+ Vue.config.silent = true;
|
|
|
|
+ store._vm = new Vue({
|
|
|
|
+ data: {
|
|
|
|
+ $$state: state
|
|
|
|
+ },
|
|
|
|
+ computed: computed
|
|
|
|
+ });
|
|
|
|
+ Vue.config.silent = silent;
|
|
|
|
|
|
|
|
+ // enable strict mode for new vm
|
|
|
|
+ if (store.strict) {
|
|
|
|
+ enableStrictMode(store);
|
|
|
|
+ }
|
|
|
|
|
|
- }_createClass(Util, [{ key: "_applicationShow", value: function _applicationShow()
|
|
|
|
|
|
+ if (oldVm) {
|
|
|
|
+ if (hot) {
|
|
|
|
+ // dispatch changes in all subscribed watchers
|
|
|
|
+ // to force getter re-evaluation for hot reloading.
|
|
|
|
+ store._withCommit(function () {
|
|
|
|
+ oldVm._data.$$state = null;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ Vue.nextTick(function () { return oldVm.$destroy(); });
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
- {
|
|
|
|
- if (this.__licationHide) {
|
|
|
|
- getLastTime();
|
|
|
|
- var time = getResidenceTime('app');
|
|
|
|
- if (time.overtime) {
|
|
|
|
- var options = {
|
|
|
|
- path: this._lastPageRoute,
|
|
|
|
- scene: this.statData.sc };
|
|
|
|
|
|
+function installModule (store, rootState, path, module, hot) {
|
|
|
|
+ var isRoot = !path.length;
|
|
|
|
+ var namespace = store._modules.getNamespace(path);
|
|
|
|
|
|
- this._sendReportRequest(options);
|
|
|
|
- }
|
|
|
|
- this.__licationHide = false;
|
|
|
|
- }
|
|
|
|
- } }, { key: "_applicationHide", value: function _applicationHide(
|
|
|
|
|
|
+ // register in namespace map
|
|
|
|
+ if (module.namespaced) {
|
|
|
|
+ store._modulesNamespaceMap[namespace] = module;
|
|
|
|
+ }
|
|
|
|
|
|
- self, type) {
|
|
|
|
|
|
+ // set state
|
|
|
|
+ if (!isRoot && !hot) {
|
|
|
|
+ var parentState = getNestedState(rootState, path.slice(0, -1));
|
|
|
|
+ var moduleName = path[path.length - 1];
|
|
|
|
+ store._withCommit(function () {
|
|
|
|
+ Vue.set(parentState, moduleName, module.state);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
- this.__licationHide = true;
|
|
|
|
- getLastTime();
|
|
|
|
- var time = getResidenceTime();
|
|
|
|
- getFirstTime();
|
|
|
|
- var route = getPageRoute(this);
|
|
|
|
- this._sendHideRequest({
|
|
|
|
- urlref: route,
|
|
|
|
- urlref_ts: time.residenceTime },
|
|
|
|
- type);
|
|
|
|
- } }, { key: "_pageShow", value: function _pageShow()
|
|
|
|
|
|
+ var local = module.context = makeLocalContext(store, namespace, path);
|
|
|
|
|
|
- {
|
|
|
|
- var route = getPageRoute(this);
|
|
|
|
- var routepath = getRoute();
|
|
|
|
- this._navigationBarTitle.config = PagesJson &&
|
|
|
|
- PagesJson.pages[routepath] &&
|
|
|
|
- PagesJson.pages[routepath].titleNView &&
|
|
|
|
- PagesJson.pages[routepath].titleNView.titleText ||
|
|
|
|
- PagesJson &&
|
|
|
|
- PagesJson.pages[routepath] &&
|
|
|
|
- PagesJson.pages[routepath].navigationBarTitleText || '';
|
|
|
|
|
|
+ module.forEachMutation(function (mutation, key) {
|
|
|
|
+ var namespacedType = namespace + key;
|
|
|
|
+ registerMutation(store, namespacedType, mutation, local);
|
|
|
|
+ });
|
|
|
|
|
|
- if (this.__licationShow) {
|
|
|
|
- getFirstTime();
|
|
|
|
- this.__licationShow = false;
|
|
|
|
- // console.log('这是 onLauch 之后执行的第一次 pageShow ,为下次记录时间做准备');
|
|
|
|
- this._lastPageRoute = route;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ module.forEachAction(function (action, key) {
|
|
|
|
+ var type = action.root ? key : namespace + key;
|
|
|
|
+ var handler = action.handler || action;
|
|
|
|
+ registerAction(store, type, handler, local);
|
|
|
|
+ });
|
|
|
|
|
|
- getLastTime();
|
|
|
|
- this._lastPageRoute = route;
|
|
|
|
- var time = getResidenceTime('page');
|
|
|
|
- if (time.overtime) {
|
|
|
|
- var options = {
|
|
|
|
- path: this._lastPageRoute,
|
|
|
|
- scene: this.statData.sc };
|
|
|
|
|
|
+ module.forEachGetter(function (getter, key) {
|
|
|
|
+ var namespacedType = namespace + key;
|
|
|
|
+ registerGetter(store, namespacedType, getter, local);
|
|
|
|
+ });
|
|
|
|
|
|
- this._sendReportRequest(options);
|
|
|
|
- }
|
|
|
|
- getFirstTime();
|
|
|
|
- } }, { key: "_pageHide", value: function _pageHide()
|
|
|
|
|
|
+ module.forEachChild(function (child, key) {
|
|
|
|
+ installModule(store, rootState, path.concat(key), child, hot);
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
|
|
- {
|
|
|
|
- if (!this.__licationHide) {
|
|
|
|
- getLastTime();
|
|
|
|
- var time = getResidenceTime('page');
|
|
|
|
- this._sendPageRequest({
|
|
|
|
- url: this._lastPageRoute,
|
|
|
|
- urlref: this._lastPageRoute,
|
|
|
|
- urlref_ts: time.residenceTime });
|
|
|
|
|
|
+/**
|
|
|
|
+ * make localized dispatch, commit, getters and state
|
|
|
|
+ * if there is no namespace, just use root ones
|
|
|
|
+ */
|
|
|
|
+function makeLocalContext (store, namespace, path) {
|
|
|
|
+ var noNamespace = namespace === '';
|
|
|
|
|
|
- this._navigationBarTitle = {
|
|
|
|
- config: '',
|
|
|
|
- page: '',
|
|
|
|
- report: '',
|
|
|
|
- lt: '' };
|
|
|
|
|
|
+ var local = {
|
|
|
|
+ dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
|
|
|
|
+ var args = unifyObjectStyle(_type, _payload, _options);
|
|
|
|
+ var payload = args.payload;
|
|
|
|
+ var options = args.options;
|
|
|
|
+ var type = args.type;
|
|
|
|
|
|
- return;
|
|
|
|
|
|
+ if (!options || !options.root) {
|
|
|
|
+ type = namespace + type;
|
|
|
|
+ if ( true && !store._actions[type]) {
|
|
|
|
+ console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- } }, { key: "_login", value: function _login()
|
|
|
|
|
|
|
|
- {
|
|
|
|
- this._sendEventRequest({
|
|
|
|
- key: 'login' },
|
|
|
|
- 0);
|
|
|
|
- } }, { key: "_share", value: function _share()
|
|
|
|
|
|
+ return store.dispatch(type, payload)
|
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
|
- this._sendEventRequest({
|
|
|
|
- key: 'share' },
|
|
|
|
- 0);
|
|
|
|
- } }, { key: "_payment", value: function _payment(
|
|
|
|
- key) {
|
|
|
|
- this._sendEventRequest({
|
|
|
|
- key: key },
|
|
|
|
- 0);
|
|
|
|
- } }, { key: "_sendReportRequest", value: function _sendReportRequest(
|
|
|
|
- options) {
|
|
|
|
|
|
+ commit: noNamespace ? store.commit : function (_type, _payload, _options) {
|
|
|
|
+ var args = unifyObjectStyle(_type, _payload, _options);
|
|
|
|
+ var payload = args.payload;
|
|
|
|
+ var options = args.options;
|
|
|
|
+ var type = args.type;
|
|
|
|
|
|
- this._navigationBarTitle.lt = '1';
|
|
|
|
- var query = options.query && JSON.stringify(options.query) !== '{}' ? '?' + JSON.stringify(options.query) : '';
|
|
|
|
- this.statData.lt = '1';
|
|
|
|
- this.statData.url = options.path + query || '';
|
|
|
|
- this.statData.t = getTime();
|
|
|
|
- this.statData.sc = getScene(options.scene);
|
|
|
|
- this.statData.fvts = getFirstVisitTime();
|
|
|
|
- this.statData.lvts = getLastVisitTime();
|
|
|
|
- this.statData.tvc = getTotalVisitCount();
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- this.getProperty();
|
|
|
|
- } else {
|
|
|
|
- this.getNetworkInfo();
|
|
|
|
|
|
+ if (!options || !options.root) {
|
|
|
|
+ type = namespace + type;
|
|
|
|
+ if ( true && !store._mutations[type]) {
|
|
|
|
+ console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- } }, { key: "_sendPageRequest", value: function _sendPageRequest(
|
|
|
|
|
|
|
|
- opt) {var
|
|
|
|
|
|
+ store.commit(type, payload, options);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
|
|
- url =
|
|
|
|
|
|
+ // getters and state object must be gotten lazily
|
|
|
|
+ // because they will be changed by vm update
|
|
|
|
+ Object.defineProperties(local, {
|
|
|
|
+ getters: {
|
|
|
|
+ get: noNamespace
|
|
|
|
+ ? function () { return store.getters; }
|
|
|
|
+ : function () { return makeLocalGetters(store, namespace); }
|
|
|
|
+ },
|
|
|
|
+ state: {
|
|
|
|
+ get: function () { return getNestedState(store.state, path); }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
|
|
|
|
+ return local
|
|
|
|
+}
|
|
|
|
|
|
- opt.url,urlref = opt.urlref,urlref_ts = opt.urlref_ts;
|
|
|
|
- this._navigationBarTitle.lt = '11';
|
|
|
|
- var options = {
|
|
|
|
- ak: this.statData.ak,
|
|
|
|
- uuid: this.statData.uuid,
|
|
|
|
- lt: '11',
|
|
|
|
- ut: this.statData.ut,
|
|
|
|
- url: url,
|
|
|
|
- tt: this.statData.tt,
|
|
|
|
- urlref: urlref,
|
|
|
|
- urlref_ts: urlref_ts,
|
|
|
|
- ch: this.statData.ch,
|
|
|
|
- usv: this.statData.usv,
|
|
|
|
- t: getTime(),
|
|
|
|
- p: this.statData.p };
|
|
|
|
|
|
+function makeLocalGetters (store, namespace) {
|
|
|
|
+ var gettersProxy = {};
|
|
|
|
|
|
- this.request(options);
|
|
|
|
- } }, { key: "_sendHideRequest", value: function _sendHideRequest(
|
|
|
|
|
|
+ var splitPos = namespace.length;
|
|
|
|
+ Object.keys(store.getters).forEach(function (type) {
|
|
|
|
+ // skip if the target getter is not match this namespace
|
|
|
|
+ if (type.slice(0, splitPos) !== namespace) { return }
|
|
|
|
|
|
- opt, type) {var
|
|
|
|
|
|
+ // extract local getter type
|
|
|
|
+ var localType = type.slice(splitPos);
|
|
|
|
|
|
- urlref =
|
|
|
|
|
|
+ // Add a port to the getters proxy.
|
|
|
|
+ // Define as getter property because
|
|
|
|
+ // we do not want to evaluate the getters in this time.
|
|
|
|
+ Object.defineProperty(gettersProxy, localType, {
|
|
|
|
+ get: function () { return store.getters[type]; },
|
|
|
|
+ enumerable: true
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
|
|
- opt.urlref,urlref_ts = opt.urlref_ts;
|
|
|
|
- var options = {
|
|
|
|
- ak: this.statData.ak,
|
|
|
|
- uuid: this.statData.uuid,
|
|
|
|
- lt: '3',
|
|
|
|
- ut: this.statData.ut,
|
|
|
|
- urlref: urlref,
|
|
|
|
- urlref_ts: urlref_ts,
|
|
|
|
- ch: this.statData.ch,
|
|
|
|
- usv: this.statData.usv,
|
|
|
|
- t: getTime(),
|
|
|
|
- p: this.statData.p };
|
|
|
|
|
|
+ return gettersProxy
|
|
|
|
+}
|
|
|
|
|
|
- this.request(options, type);
|
|
|
|
- } }, { key: "_sendEventRequest", value: function _sendEventRequest()
|
|
|
|
|
|
+function registerMutation (store, type, handler, local) {
|
|
|
|
+ var entry = store._mutations[type] || (store._mutations[type] = []);
|
|
|
|
+ entry.push(function wrappedMutationHandler (payload) {
|
|
|
|
+ handler.call(store, local.state, payload);
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
|
|
|
|
+function registerAction (store, type, handler, local) {
|
|
|
|
+ var entry = store._actions[type] || (store._actions[type] = []);
|
|
|
|
+ entry.push(function wrappedActionHandler (payload, cb) {
|
|
|
|
+ var res = handler.call(store, {
|
|
|
|
+ dispatch: local.dispatch,
|
|
|
|
+ commit: local.commit,
|
|
|
|
+ getters: local.getters,
|
|
|
|
+ state: local.state,
|
|
|
|
+ rootGetters: store.getters,
|
|
|
|
+ rootState: store.state
|
|
|
|
+ }, payload, cb);
|
|
|
|
+ if (!isPromise(res)) {
|
|
|
|
+ res = Promise.resolve(res);
|
|
|
|
+ }
|
|
|
|
+ if (store._devtoolHook) {
|
|
|
|
+ return res.catch(function (err) {
|
|
|
|
+ store._devtoolHook.emit('vuex:error', err);
|
|
|
|
+ throw err
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ return res
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
|
|
|
|
+function registerGetter (store, type, rawGetter, local) {
|
|
|
|
+ if (store._wrappedGetters[type]) {
|
|
|
|
+ if (true) {
|
|
|
|
+ console.error(("[vuex] duplicate getter key: " + type));
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ store._wrappedGetters[type] = function wrappedGetter (store) {
|
|
|
|
+ return rawGetter(
|
|
|
|
+ local.state, // local state
|
|
|
|
+ local.getters, // local getters
|
|
|
|
+ store.state, // root state
|
|
|
|
+ store.getters // root getters
|
|
|
|
+ )
|
|
|
|
+ };
|
|
|
|
+}
|
|
|
|
|
|
- {var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref$key = _ref.key,key = _ref$key === void 0 ? '' : _ref$key,_ref$value = _ref.value,value = _ref$value === void 0 ? "" : _ref$value;
|
|
|
|
- var route = this._lastPageRoute;
|
|
|
|
- var options = {
|
|
|
|
- ak: this.statData.ak,
|
|
|
|
- uuid: this.statData.uuid,
|
|
|
|
- lt: '21',
|
|
|
|
- ut: this.statData.ut,
|
|
|
|
- url: route,
|
|
|
|
- ch: this.statData.ch,
|
|
|
|
- e_n: key,
|
|
|
|
- e_v: typeof value === 'object' ? JSON.stringify(value) : value.toString(),
|
|
|
|
- usv: this.statData.usv,
|
|
|
|
- t: getTime(),
|
|
|
|
- p: this.statData.p };
|
|
|
|
|
|
+function enableStrictMode (store) {
|
|
|
|
+ store._vm.$watch(function () { return this._data.$$state }, function () {
|
|
|
|
+ if (true) {
|
|
|
|
+ assert(store._committing, "Do not mutate vuex store state outside mutation handlers.");
|
|
|
|
+ }
|
|
|
|
+ }, { deep: true, sync: true });
|
|
|
|
+}
|
|
|
|
|
|
- this.request(options);
|
|
|
|
- } }, { key: "getNetworkInfo", value: function getNetworkInfo()
|
|
|
|
|
|
+function getNestedState (state, path) {
|
|
|
|
+ return path.length
|
|
|
|
+ ? path.reduce(function (state, key) { return state[key]; }, state)
|
|
|
|
+ : state
|
|
|
|
+}
|
|
|
|
|
|
- {var _this = this;
|
|
|
|
- uni.getNetworkType({
|
|
|
|
- success: function success(result) {
|
|
|
|
- _this.statData.net = result.networkType;
|
|
|
|
- _this.getLocation();
|
|
|
|
- } });
|
|
|
|
|
|
+function unifyObjectStyle (type, payload, options) {
|
|
|
|
+ if (isObject(type) && type.type) {
|
|
|
|
+ options = payload;
|
|
|
|
+ payload = type;
|
|
|
|
+ type = type.type;
|
|
|
|
+ }
|
|
|
|
|
|
- } }, { key: "getProperty", value: function getProperty()
|
|
|
|
|
|
+ if (true) {
|
|
|
|
+ assert(typeof type === 'string', ("Expects string as the type, but found " + (typeof type) + "."));
|
|
|
|
+ }
|
|
|
|
|
|
- {var _this2 = this;
|
|
|
|
- plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
|
|
|
|
- _this2.statData.v = wgtinfo.version || '';
|
|
|
|
- _this2.getNetworkInfo();
|
|
|
|
- });
|
|
|
|
- } }, { key: "getLocation", value: function getLocation()
|
|
|
|
|
|
+ return { type: type, payload: payload, options: options }
|
|
|
|
+}
|
|
|
|
|
|
- {var _this3 = this;
|
|
|
|
- if (statConfig.getLocation) {
|
|
|
|
- uni.getLocation({
|
|
|
|
- type: 'wgs84',
|
|
|
|
- geocode: true,
|
|
|
|
- success: function success(result) {
|
|
|
|
- if (result.address) {
|
|
|
|
- _this3.statData.cn = result.address.country;
|
|
|
|
- _this3.statData.pn = result.address.province;
|
|
|
|
- _this3.statData.ct = result.address.city;
|
|
|
|
- }
|
|
|
|
|
|
+function install (_Vue) {
|
|
|
|
+ if (Vue && _Vue === Vue) {
|
|
|
|
+ if (true) {
|
|
|
|
+ console.error(
|
|
|
|
+ '[vuex] already installed. Vue.use(Vuex) should be called only once.'
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ Vue = _Vue;
|
|
|
|
+ applyMixin(Vue);
|
|
|
|
+}
|
|
|
|
|
|
- _this3.statData.lat = result.latitude;
|
|
|
|
- _this3.statData.lng = result.longitude;
|
|
|
|
- _this3.request(_this3.statData);
|
|
|
|
- } });
|
|
|
|
|
|
+var mapState = normalizeNamespace(function (namespace, states) {
|
|
|
|
+ var res = {};
|
|
|
|
+ normalizeMap(states).forEach(function (ref) {
|
|
|
|
+ var key = ref.key;
|
|
|
|
+ var val = ref.val;
|
|
|
|
|
|
- } else {
|
|
|
|
- this.statData.lat = 0;
|
|
|
|
- this.statData.lng = 0;
|
|
|
|
- this.request(this.statData);
|
|
|
|
|
|
+ res[key] = function mappedState () {
|
|
|
|
+ var state = this.$store.state;
|
|
|
|
+ var getters = this.$store.getters;
|
|
|
|
+ if (namespace) {
|
|
|
|
+ var module = getModuleByNamespace(this.$store, 'mapState', namespace);
|
|
|
|
+ if (!module) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ state = module.context.state;
|
|
|
|
+ getters = module.context.getters;
|
|
}
|
|
}
|
|
- } }, { key: "request", value: function request(
|
|
|
|
|
|
+ return typeof val === 'function'
|
|
|
|
+ ? val.call(this, state, getters)
|
|
|
|
+ : state[val]
|
|
|
|
+ };
|
|
|
|
+ // mark vuex getter for devtools
|
|
|
|
+ res[key].vuex = true;
|
|
|
|
+ });
|
|
|
|
+ return res
|
|
|
|
+});
|
|
|
|
|
|
- data, type) {var _this4 = this;
|
|
|
|
- var time = getTime();
|
|
|
|
- var title = this._navigationBarTitle;
|
|
|
|
- data.ttn = title.page;
|
|
|
|
- data.ttpj = title.config;
|
|
|
|
- data.ttc = title.report;
|
|
|
|
|
|
+var mapMutations = normalizeNamespace(function (namespace, mutations) {
|
|
|
|
+ var res = {};
|
|
|
|
+ normalizeMap(mutations).forEach(function (ref) {
|
|
|
|
+ var key = ref.key;
|
|
|
|
+ var val = ref.val;
|
|
|
|
|
|
- var requestData = this._reportingRequestData;
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- requestData = uni.getStorageSync('__UNI__STAT__DATA') || {};
|
|
|
|
- }
|
|
|
|
- if (!requestData[data.lt]) {
|
|
|
|
- requestData[data.lt] = [];
|
|
|
|
- }
|
|
|
|
- requestData[data.lt].push(data);
|
|
|
|
|
|
+ res[key] = function mappedMutation () {
|
|
|
|
+ var args = [], len = arguments.length;
|
|
|
|
+ while ( len-- ) args[ len ] = arguments[ len ];
|
|
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- uni.setStorageSync('__UNI__STAT__DATA', requestData);
|
|
|
|
- }
|
|
|
|
- if (getPageResidenceTime() < OPERATING_TIME && !type) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- var uniStatData = this._reportingRequestData;
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- uniStatData = uni.getStorageSync('__UNI__STAT__DATA');
|
|
|
|
|
|
+ var commit = this.$store.commit;
|
|
|
|
+ if (namespace) {
|
|
|
|
+ var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
|
|
|
|
+ if (!module) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ commit = module.context.commit;
|
|
}
|
|
}
|
|
- // 时间超过,重新获取时间戳
|
|
|
|
- setPageResidenceTime();
|
|
|
|
- var firstArr = [];
|
|
|
|
- var contentArr = [];
|
|
|
|
- var lastArr = [];var _loop = function _loop(
|
|
|
|
|
|
+ return typeof val === 'function'
|
|
|
|
+ ? val.apply(this, [commit].concat(args))
|
|
|
|
+ : commit.apply(this.$store, [val].concat(args))
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ return res
|
|
|
|
+});
|
|
|
|
|
|
- i) {
|
|
|
|
- var rd = uniStatData[i];
|
|
|
|
- rd.forEach(function (elm) {
|
|
|
|
- var newData = getSplicing(elm);
|
|
|
|
- if (i === 0) {
|
|
|
|
- firstArr.push(newData);
|
|
|
|
- } else if (i === 3) {
|
|
|
|
- lastArr.push(newData);
|
|
|
|
- } else {
|
|
|
|
- contentArr.push(newData);
|
|
|
|
- }
|
|
|
|
- });};for (var i in uniStatData) {_loop(i);
|
|
|
|
|
|
+var mapGetters = normalizeNamespace(function (namespace, getters) {
|
|
|
|
+ var res = {};
|
|
|
|
+ normalizeMap(getters).forEach(function (ref) {
|
|
|
|
+ var key = ref.key;
|
|
|
|
+ var val = ref.val;
|
|
|
|
+
|
|
|
|
+ val = namespace + val;
|
|
|
|
+ res[key] = function mappedGetter () {
|
|
|
|
+ if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if ( true && !(val in this.$store.getters)) {
|
|
|
|
+ console.error(("[vuex] unknown getter: " + val));
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
+ return this.$store.getters[val]
|
|
|
|
+ };
|
|
|
|
+ // mark vuex getter for devtools
|
|
|
|
+ res[key].vuex = true;
|
|
|
|
+ });
|
|
|
|
+ return res
|
|
|
|
+});
|
|
|
|
|
|
- firstArr.push.apply(firstArr, contentArr.concat(lastArr));
|
|
|
|
- var optionsData = {
|
|
|
|
- usv: STAT_VERSION, //统计 SDK 版本号
|
|
|
|
- t: time, //发送请求时的时间戮
|
|
|
|
- requests: JSON.stringify(firstArr) };
|
|
|
|
|
|
+var mapActions = normalizeNamespace(function (namespace, actions) {
|
|
|
|
+ var res = {};
|
|
|
|
+ normalizeMap(actions).forEach(function (ref) {
|
|
|
|
+ var key = ref.key;
|
|
|
|
+ var val = ref.val;
|
|
|
|
|
|
|
|
+ res[key] = function mappedAction () {
|
|
|
|
+ var args = [], len = arguments.length;
|
|
|
|
+ while ( len-- ) args[ len ] = arguments[ len ];
|
|
|
|
|
|
- this._reportingRequestData = {};
|
|
|
|
- if (getPlatformName() === 'n') {
|
|
|
|
- uni.removeStorageSync('__UNI__STAT__DATA');
|
|
|
|
|
|
+ var dispatch = this.$store.dispatch;
|
|
|
|
+ if (namespace) {
|
|
|
|
+ var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
|
|
|
|
+ if (!module) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ dispatch = module.context.dispatch;
|
|
}
|
|
}
|
|
|
|
+ return typeof val === 'function'
|
|
|
|
+ ? val.apply(this, [dispatch].concat(args))
|
|
|
|
+ : dispatch.apply(this.$store, [val].concat(args))
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ return res
|
|
|
|
+});
|
|
|
|
|
|
- if (data.ut === 'h5') {
|
|
|
|
- this.imageRequest(optionsData);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+var createNamespacedHelpers = function (namespace) { return ({
|
|
|
|
+ mapState: mapState.bind(null, namespace),
|
|
|
|
+ mapGetters: mapGetters.bind(null, namespace),
|
|
|
|
+ mapMutations: mapMutations.bind(null, namespace),
|
|
|
|
+ mapActions: mapActions.bind(null, namespace)
|
|
|
|
+}); };
|
|
|
|
|
|
- if (getPlatformName() === 'n' && this.statData.p === 'a') {
|
|
|
|
- setTimeout(function () {
|
|
|
|
- _this4._sendRequest(optionsData);
|
|
|
|
- }, 200);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- this._sendRequest(optionsData);
|
|
|
|
- } }, { key: "_sendRequest", value: function _sendRequest(
|
|
|
|
- optionsData) {var _this5 = this;
|
|
|
|
- uni.request({
|
|
|
|
- url: STAT_URL,
|
|
|
|
- method: 'POST',
|
|
|
|
- // header: {
|
|
|
|
- // 'content-type': 'application/json' // 默认值
|
|
|
|
- // },
|
|
|
|
- data: optionsData,
|
|
|
|
- success: function success() {
|
|
|
|
- // if (process.env.NODE_ENV === 'development') {
|
|
|
|
- // console.log('stat request success');
|
|
|
|
- // }
|
|
|
|
- },
|
|
|
|
- fail: function fail(e) {
|
|
|
|
- if (++_this5._retry < 3) {
|
|
|
|
- setTimeout(function () {
|
|
|
|
- _this5._sendRequest(optionsData);
|
|
|
|
- }, 1000);
|
|
|
|
- }
|
|
|
|
- } });
|
|
|
|
|
|
+function normalizeMap (map) {
|
|
|
|
+ return Array.isArray(map)
|
|
|
|
+ ? map.map(function (key) { return ({ key: key, val: key }); })
|
|
|
|
+ : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
|
|
|
|
+}
|
|
|
|
|
|
|
|
+function normalizeNamespace (fn) {
|
|
|
|
+ return function (namespace, map) {
|
|
|
|
+ if (typeof namespace !== 'string') {
|
|
|
|
+ map = namespace;
|
|
|
|
+ namespace = '';
|
|
|
|
+ } else if (namespace.charAt(namespace.length - 1) !== '/') {
|
|
|
|
+ namespace += '/';
|
|
}
|
|
}
|
|
- /**
|
|
|
|
- * h5 请求
|
|
|
|
- */ }, { key: "imageRequest", value: function imageRequest(
|
|
|
|
- data) {
|
|
|
|
- var image = new Image();
|
|
|
|
- var options = getSgin(GetEncodeURIComponentOptions(data)).options;
|
|
|
|
- image.src = STAT_H5_URL + '?' + options;
|
|
|
|
- } }, { key: "sendEvent", value: function sendEvent(
|
|
|
|
|
|
+ return fn(namespace, map)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
- key, value) {
|
|
|
|
- // 校验 type 参数
|
|
|
|
- if (calibration(key, value)) return;
|
|
|
|
|
|
+function getModuleByNamespace (store, helper, namespace) {
|
|
|
|
+ var module = store._modulesNamespaceMap[namespace];
|
|
|
|
+ if ( true && !module) {
|
|
|
|
+ console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
|
|
|
|
+ }
|
|
|
|
+ return module
|
|
|
|
+}
|
|
|
|
|
|
- if (key === 'title') {
|
|
|
|
- this._navigationBarTitle.report = value;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- this._sendEventRequest({
|
|
|
|
- key: key,
|
|
|
|
- value: typeof value === 'object' ? JSON.stringify(value) : value },
|
|
|
|
- 1);
|
|
|
|
- } }]);return Util;}();var
|
|
|
|
|
|
+var index_esm = {
|
|
|
|
+ Store: Store,
|
|
|
|
+ install: install,
|
|
|
|
+ version: '3.0.1',
|
|
|
|
+ mapState: mapState,
|
|
|
|
+ mapMutations: mapMutations,
|
|
|
|
+ mapGetters: mapGetters,
|
|
|
|
+ mapActions: mapActions,
|
|
|
|
+ createNamespacedHelpers: createNamespacedHelpers
|
|
|
|
+};
|
|
|
|
|
|
|
|
|
|
|
|
+/* harmony default export */ __webpack_exports__["default"] = (index_esm);
|
|
|
|
|
|
-Stat = /*#__PURE__*/function (_Util) {_inherits(Stat, _Util);_createClass(Stat, null, [{ key: "getInstance", value: function getInstance()
|
|
|
|
- {
|
|
|
|
- if (!this.instance) {
|
|
|
|
- this.instance = new Stat();
|
|
|
|
- }
|
|
|
|
- return this.instance;
|
|
|
|
- } }]);
|
|
|
|
- function Stat() {var _this6;_classCallCheck(this, Stat);
|
|
|
|
- _this6 = _possibleConstructorReturn(this, _getPrototypeOf(Stat).call(this));
|
|
|
|
- _this6.instance = null;
|
|
|
|
- // 注册拦截器
|
|
|
|
- if (typeof uni.addInterceptor === 'function' && "development" !== 'development') {
|
|
|
|
- _this6.addInterceptorInit();
|
|
|
|
- _this6.interceptLogin();
|
|
|
|
- _this6.interceptShare(true);
|
|
|
|
- _this6.interceptRequestPayment();
|
|
|
|
- }return _this6;
|
|
|
|
- }_createClass(Stat, [{ key: "addInterceptorInit", value: function addInterceptorInit()
|
|
|
|
|
|
|
|
- {
|
|
|
|
- var self = this;
|
|
|
|
- uni.addInterceptor('setNavigationBarTitle', {
|
|
|
|
- invoke: function invoke(args) {
|
|
|
|
- self._navigationBarTitle.page = args.title;
|
|
|
|
- } });
|
|
|
|
|
|
+/***/ }),
|
|
|
|
+/* 13 */,
|
|
|
|
+/* 14 */,
|
|
|
|
+/* 15 */
|
|
|
|
+/*!**********************************************************************************************************!*\
|
|
|
|
+ !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
|
|
|
|
+ \**********************************************************************************************************/
|
|
|
|
+/*! exports provided: default */
|
|
|
|
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
- } }, { key: "interceptLogin", value: function interceptLogin()
|
|
|
|
|
|
+"use strict";
|
|
|
|
+__webpack_require__.r(__webpack_exports__);
|
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
|
|
|
|
+/* globals __VUE_SSR_CONTEXT__ */
|
|
|
|
|
|
- {
|
|
|
|
- var self = this;
|
|
|
|
- uni.addInterceptor('login', {
|
|
|
|
- complete: function complete() {
|
|
|
|
- self._login();
|
|
|
|
- } });
|
|
|
|
|
|
+// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
|
|
+// This module is a runtime utility for cleaner component module output and will
|
|
|
|
+// be included in the final webpack user bundle.
|
|
|
|
|
|
- } }, { key: "interceptShare", value: function interceptShare(
|
|
|
|
|
|
+function normalizeComponent (
|
|
|
|
+ scriptExports,
|
|
|
|
+ render,
|
|
|
|
+ staticRenderFns,
|
|
|
|
+ functionalTemplate,
|
|
|
|
+ injectStyles,
|
|
|
|
+ scopeId,
|
|
|
|
+ moduleIdentifier, /* server only */
|
|
|
|
+ shadowMode, /* vue-cli only */
|
|
|
|
+ components, // fixed by xxxxxx auto components
|
|
|
|
+ renderjs // fixed by xxxxxx renderjs
|
|
|
|
+) {
|
|
|
|
+ // Vue.extend constructor export interop
|
|
|
|
+ var options = typeof scriptExports === 'function'
|
|
|
|
+ ? scriptExports.options
|
|
|
|
+ : scriptExports
|
|
|
|
|
|
- type) {
|
|
|
|
- var self = this;
|
|
|
|
- if (!type) {
|
|
|
|
- self._share();
|
|
|
|
- return;
|
|
|
|
|
|
+ // fixed by xxxxxx auto components
|
|
|
|
+ if (components) {
|
|
|
|
+ if (!options.components) {
|
|
|
|
+ options.components = {}
|
|
|
|
+ }
|
|
|
|
+ var hasOwn = Object.prototype.hasOwnProperty
|
|
|
|
+ for (var name in components) {
|
|
|
|
+ if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
|
|
|
|
+ options.components[name] = components[name]
|
|
}
|
|
}
|
|
- uni.addInterceptor('share', {
|
|
|
|
- success: function success() {
|
|
|
|
- self._share();
|
|
|
|
- },
|
|
|
|
- fail: function fail() {
|
|
|
|
- self._share();
|
|
|
|
- } });
|
|
|
|
-
|
|
|
|
- } }, { key: "interceptRequestPayment", value: function interceptRequestPayment()
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- var self = this;
|
|
|
|
- uni.addInterceptor('requestPayment', {
|
|
|
|
- success: function success() {
|
|
|
|
- self._payment('pay_success');
|
|
|
|
- },
|
|
|
|
- fail: function fail() {
|
|
|
|
- self._payment('pay_fail');
|
|
|
|
- } });
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // fixed by xxxxxx renderjs
|
|
|
|
+ if (renderjs) {
|
|
|
|
+ (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
|
|
|
|
+ this[renderjs.__module] = this
|
|
|
|
+ });
|
|
|
|
+ (options.mixins || (options.mixins = [])).push(renderjs)
|
|
|
|
+ }
|
|
|
|
|
|
- } }, { key: "report", value: function report(
|
|
|
|
|
|
+ // render functions
|
|
|
|
+ if (render) {
|
|
|
|
+ options.render = render
|
|
|
|
+ options.staticRenderFns = staticRenderFns
|
|
|
|
+ options._compiled = true
|
|
|
|
+ }
|
|
|
|
|
|
- options, self) {
|
|
|
|
- this.self = self;
|
|
|
|
- // if (process.env.NODE_ENV === 'development') {
|
|
|
|
- // console.log('report init');
|
|
|
|
- // }
|
|
|
|
- setPageResidenceTime();
|
|
|
|
- this.__licationShow = true;
|
|
|
|
- this._sendReportRequest(options, true);
|
|
|
|
- } }, { key: "load", value: function load(
|
|
|
|
|
|
+ // functional template
|
|
|
|
+ if (functionalTemplate) {
|
|
|
|
+ options.functional = true
|
|
|
|
+ }
|
|
|
|
|
|
- options, self) {
|
|
|
|
- if (!self.$scope && !self.$mp) {
|
|
|
|
- var page = getCurrentPages();
|
|
|
|
- self.$scope = page[page.length - 1];
|
|
|
|
- }
|
|
|
|
- this.self = self;
|
|
|
|
- this._query = options;
|
|
|
|
- } }, { key: "show", value: function show(
|
|
|
|
|
|
+ // scopedId
|
|
|
|
+ if (scopeId) {
|
|
|
|
+ options._scopeId = 'data-v-' + scopeId
|
|
|
|
+ }
|
|
|
|
|
|
- self) {
|
|
|
|
- this.self = self;
|
|
|
|
- if (getPageTypes(self)) {
|
|
|
|
- this._pageShow(self);
|
|
|
|
- } else {
|
|
|
|
- this._applicationShow(self);
|
|
|
|
|
|
+ var hook
|
|
|
|
+ if (moduleIdentifier) { // server build
|
|
|
|
+ hook = function (context) {
|
|
|
|
+ // 2.3 injection
|
|
|
|
+ context =
|
|
|
|
+ context || // cached call
|
|
|
|
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
|
|
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
|
|
+ // 2.2 with runInNewContext: true
|
|
|
|
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
|
|
+ context = __VUE_SSR_CONTEXT__
|
|
}
|
|
}
|
|
- } }, { key: "ready", value: function ready(
|
|
|
|
-
|
|
|
|
- self) {
|
|
|
|
- // this.self = self;
|
|
|
|
- // if (getPageTypes(self)) {
|
|
|
|
- // this._pageShow(self);
|
|
|
|
- // }
|
|
|
|
- } }, { key: "hide", value: function hide(
|
|
|
|
- self) {
|
|
|
|
- this.self = self;
|
|
|
|
- if (getPageTypes(self)) {
|
|
|
|
- this._pageHide(self);
|
|
|
|
- } else {
|
|
|
|
- this._applicationHide(self, true);
|
|
|
|
|
|
+ // inject component styles
|
|
|
|
+ if (injectStyles) {
|
|
|
|
+ injectStyles.call(this, context)
|
|
}
|
|
}
|
|
- } }, { key: "error", value: function error(
|
|
|
|
- em) {
|
|
|
|
- if (this._platform === 'devtools') {
|
|
|
|
- if (true) {
|
|
|
|
- console.info('当前运行环境为开发者工具,不上报数据。');
|
|
|
|
- }
|
|
|
|
- // return;
|
|
|
|
|
|
+ // register component module identifier for async chunk inferrence
|
|
|
|
+ if (context && context._registeredComponents) {
|
|
|
|
+ context._registeredComponents.add(moduleIdentifier)
|
|
}
|
|
}
|
|
- var emVal = '';
|
|
|
|
- if (!em.message) {
|
|
|
|
- emVal = JSON.stringify(em);
|
|
|
|
- } else {
|
|
|
|
- emVal = em.stack;
|
|
|
|
|
|
+ }
|
|
|
|
+ // used by ssr in case component is cached and beforeCreate
|
|
|
|
+ // never gets called
|
|
|
|
+ options._ssrRegister = hook
|
|
|
|
+ } else if (injectStyles) {
|
|
|
|
+ hook = shadowMode
|
|
|
|
+ ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
|
|
|
+ : injectStyles
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (hook) {
|
|
|
|
+ if (options.functional) {
|
|
|
|
+ // for template-only hot-reload because in that case the render fn doesn't
|
|
|
|
+ // go through the normalizer
|
|
|
|
+ options._injectStyles = hook
|
|
|
|
+ // register for functioal component in vue file
|
|
|
|
+ var originalRender = options.render
|
|
|
|
+ options.render = function renderWithStyleInjection (h, context) {
|
|
|
|
+ hook.call(context)
|
|
|
|
+ return originalRender(h, context)
|
|
}
|
|
}
|
|
- var options = {
|
|
|
|
- ak: this.statData.ak,
|
|
|
|
- uuid: this.statData.uuid,
|
|
|
|
- lt: '31',
|
|
|
|
- ut: this.statData.ut,
|
|
|
|
- ch: this.statData.ch,
|
|
|
|
- mpsdk: this.statData.mpsdk,
|
|
|
|
- mpv: this.statData.mpv,
|
|
|
|
- v: this.statData.v,
|
|
|
|
- em: emVal,
|
|
|
|
- usv: this.statData.usv,
|
|
|
|
- t: getTime(),
|
|
|
|
- p: this.statData.p };
|
|
|
|
|
|
+ } else {
|
|
|
|
+ // inject component registration as beforeCreate hook
|
|
|
|
+ var existing = options.beforeCreate
|
|
|
|
+ options.beforeCreate = existing
|
|
|
|
+ ? [].concat(existing, hook)
|
|
|
|
+ : [hook]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- this.request(options);
|
|
|
|
- } }]);return Stat;}(Util);
|
|
|
|
|
|
+ return {
|
|
|
|
+ exports: scriptExports,
|
|
|
|
+ options: options
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
-var stat = Stat.getInstance();
|
|
|
|
-var isHide = false;
|
|
|
|
-var lifecycle = {
|
|
|
|
- onLaunch: function onLaunch(options) {
|
|
|
|
- stat.report(options, this);
|
|
|
|
- },
|
|
|
|
- onReady: function onReady() {
|
|
|
|
- stat.ready(this);
|
|
|
|
- },
|
|
|
|
- onLoad: function onLoad(options) {
|
|
|
|
- stat.load(options, this);
|
|
|
|
- // 重写分享,获取分享上报事件
|
|
|
|
- if (this.$scope && this.$scope.onShareAppMessage) {
|
|
|
|
- var oldShareAppMessage = this.$scope.onShareAppMessage;
|
|
|
|
- this.$scope.onShareAppMessage = function (options) {
|
|
|
|
- stat.interceptShare(false);
|
|
|
|
- return oldShareAppMessage.call(this, options);
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- onShow: function onShow() {
|
|
|
|
- isHide = false;
|
|
|
|
- stat.show(this);
|
|
|
|
- },
|
|
|
|
- onHide: function onHide() {
|
|
|
|
- isHide = true;
|
|
|
|
- stat.hide(this);
|
|
|
|
- },
|
|
|
|
- onUnload: function onUnload() {
|
|
|
|
- if (isHide) {
|
|
|
|
- isHide = false;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- stat.hide(this);
|
|
|
|
- },
|
|
|
|
- onError: function onError(e) {
|
|
|
|
- stat.error(e);
|
|
|
|
- } };
|
|
|
|
|
|
+/***/ }),
|
|
|
|
+/* 16 */
|
|
|
|
+/*!**********************************************************************************!*\
|
|
|
|
+ !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/store/logion.js ***!
|
|
|
|
+ \**********************************************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
+"use strict";
|
|
|
|
+/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
|
|
|
|
+var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 12));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
|
|
|
|
|
|
-function main() {
|
|
|
|
- if (true) {
|
|
|
|
- uni.report = function (type, options) {};
|
|
|
|
- } else { var Vue; }
|
|
|
|
-}
|
|
|
|
|
|
+_vue.default.use(_vuex.default);
|
|
|
|
|
|
-main();
|
|
|
|
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
|
|
|
|
+var store = new _vuex.default.Store({
|
|
|
|
+ state: {
|
|
|
|
+ hasLogin: false,
|
|
|
|
+ sessionId: '',
|
|
|
|
+ showModal: false, //登录授权弹窗
|
|
|
|
+ userInfo: {} },
|
|
|
|
|
|
-/***/ }),
|
|
|
|
|
|
+ mutations: {
|
|
|
|
+ login: function login(state, provider) {
|
|
|
|
+ state.hasLogin = true;
|
|
|
|
+ state.userInfo = provider;
|
|
|
|
+ uni.setStorage({ //缓存用户登陆状态
|
|
|
|
+ key: 'userInfo',
|
|
|
|
+ data: provider });
|
|
|
|
|
|
-/***/ 6:
|
|
|
|
-/*!******************************************************!*\
|
|
|
|
- !*** ./node_modules/@dcloudio/uni-stat/package.json ***!
|
|
|
|
- \******************************************************/
|
|
|
|
-/*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, deprecated, description, devDependencies, files, gitHead, homepage, license, main, name, repository, scripts, version, default */
|
|
|
|
-/***/ (function(module) {
|
|
|
|
|
|
+ },
|
|
|
|
|
|
-module.exports = {"_from":"@dcloudio/uni-stat@next","_id":"@dcloudio/uni-stat@2.0.0-26820200330001","_inBundle":false,"_integrity":"sha512-Qzo5LcBl+abS7DvpyTXBYW2VVYHVcHBewduQecjn/gbzAn9e90aOVn02/2VZ82wV6TBiDXbGyloXojOY3InzWA==","_location":"/@dcloudio/uni-stat","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"@dcloudio/uni-stat@next","name":"@dcloudio/uni-stat","escapedName":"@dcloudio%2funi-stat","scope":"@dcloudio","rawSpec":"next","saveSpec":null,"fetchSpec":"next"},"_requiredBy":["#USER","/","/@dcloudio/vue-cli-plugin-uni"],"_resolved":"https://registry.npmjs.org/@dcloudio/uni-stat/-/uni-stat-2.0.0-26820200330001.tgz","_shasum":"880c5c5a4920bb35e9cf691eeb7427a7bf67ffd7","_spec":"@dcloudio/uni-stat@next","_where":"/Users/guoshengqiang/Documents/dcloud-plugins/release/uniapp-cli","author":"","bugs":{"url":"https://github.com/dcloudio/uni-app/issues"},"bundleDependencies":false,"deprecated":false,"description":"","devDependencies":{"@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","eslint":"^6.1.0","rollup":"^1.19.3","rollup-plugin-babel":"^4.3.3","rollup-plugin-clear":"^2.0.7","rollup-plugin-commonjs":"^10.0.2","rollup-plugin-copy":"^3.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-uglify":"^6.0.2"},"files":["dist","package.json","LICENSE"],"gitHead":"57ef7f7b5b6164a74ec425ff12f9fe0a1147841a","homepage":"https://github.com/dcloudio/uni-app#readme","license":"Apache-2.0","main":"dist/index.js","name":"@dcloudio/uni-stat","repository":{"type":"git","url":"git+https://github.com/dcloudio/uni-app.git","directory":"packages/uni-stat"},"scripts":{"build":"NODE_ENV=production rollup -c rollup.config.js","dev":"NODE_ENV=development rollup -w -c rollup.config.js"},"version":"2.0.0-26820200330001"};
|
|
|
|
|
|
+ setOpenid: function setOpenid(state, provider) {
|
|
|
|
+ state.sessionId = provider;
|
|
|
|
+ uni.setStorage({ //缓存用户登陆状态
|
|
|
|
+ key: 'sessionId',
|
|
|
|
+ data: provider });
|
|
|
|
|
|
-/***/ }),
|
|
|
|
|
|
|
|
-/***/ 7:
|
|
|
|
-/*!**********************************************************************************************!*\
|
|
|
|
- !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/pages.json?{"type":"style"} ***!
|
|
|
|
- \**********************************************************************************************/
|
|
|
|
-/*! no static exports found */
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
+ },
|
|
|
|
+ showDialog: function showDialog(state, status) {
|
|
|
|
+ state.showModal = status;
|
|
|
|
+ uni.setStorage({ //缓存用户登陆状态
|
|
|
|
+ key: 'showModal',
|
|
|
|
+ data: status });
|
|
|
|
|
|
-"use strict";
|
|
|
|
-Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": { "pages/index/index": { "navigationBarTitleText": "uni-app" }, "pages/taBar/one/one": { "navigationBarTitleText": "我得分页1" }, "pages/taBar/three/three": { "navigationBarTitleText": "我得分页3" } }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } };exports.default = _default;
|
|
|
|
|
|
+ console.log(state.showModal);
|
|
|
|
+ },
|
|
|
|
|
|
-/***/ }),
|
|
|
|
|
|
|
|
-/***/ 8:
|
|
|
|
-/*!*********************************************************************************************!*\
|
|
|
|
- !*** C:/Users/Administrator/Documents/HBuilderProjects/myUinapp/pages.json?{"type":"stat"} ***!
|
|
|
|
- \*********************************************************************************************/
|
|
|
|
-/*! no static exports found */
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
+ logout: function logout(state) {
|
|
|
|
+ state.hasLogin = false;
|
|
|
|
+ state.userInfo = {};
|
|
|
|
+ state.sessionId = '';
|
|
|
|
+ uni.removeStorage({
|
|
|
|
+ key: 'userInfo' });
|
|
|
|
|
|
-"use strict";
|
|
|
|
-Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__99C074F" };exports.default = _default;
|
|
|
|
|
|
+ uni.removeStorage({
|
|
|
|
+ key: 'sessionId' });
|
|
|
|
|
|
-/***/ })
|
|
|
|
|
|
+ } }
|
|
|
|
+
|
|
|
|
+ // actions: {
|
|
|
|
+ // // lazy loading openid
|
|
|
|
+ // getUserOpenId: async function ({
|
|
|
|
+ // commit,
|
|
|
|
+ // state
|
|
|
|
+ // }) {
|
|
|
|
+ // return await new Promise((resolve, reject) => {
|
|
|
|
+ // if (state.openid) {
|
|
|
|
+ // resolve(state.openid)
|
|
|
|
+ // } else {
|
|
|
|
+ // uni.login({
|
|
|
|
+ // success: (data) => {
|
|
|
|
+ // commit('login')
|
|
|
|
+ // setTimeout(function () { //模拟异步请求服务器获取 openid
|
|
|
|
+ // const openid = '123456789'
|
|
|
|
+ // commit('setOpenid', openid)
|
|
|
|
+ // resolve(openid)
|
|
|
|
+ // }, 1000)
|
|
|
|
+ // },
|
|
|
|
+ // fail: (err) => {
|
|
|
|
+ // console.log('uni.login 接口调用失败,将无法正常使用开放接口等服务', err)
|
|
|
|
+ // reject(err)
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+});var _default =
|
|
|
|
|
|
-}]);
|
|
|
|
|
|
+store;exports.default = _default;
|
|
|
|
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
|
|
+
|
|
|
|
+/***/ })
|
|
|
|
+]]);
|
|
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
|
|
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
|