(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pages/index/index"],{

/***/ 41:
/*!****************************************************************************************************************!*\
  !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/main.js?{"page":"pages%2Findex%2Findex"} ***!
  \****************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 5);
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
var _index = _interopRequireDefault(__webpack_require__(/*! ./pages/index/index.vue */ 42));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
createPage(_index.default);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))

/***/ }),

/***/ 42:
/*!*********************************************************************************************!*\
  !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/pages/index/index.vue ***!
  \*********************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=57280228& */ 43);
/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ 45);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var _index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=0&lang=scss& */ 51);
/* harmony import */ var _D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 11);

var renderjs





/* normalize component */

var component = Object(_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  _index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__["render"],
  _index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  false,
  null,
  null,
  null,
  false,
  _index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__["components"],
  renderjs
)

component.options.__file = "pages/index/index.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 43:
/*!****************************************************************************************************************************!*\
  !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/pages/index/index.vue?vue&type=template&id=57280228& ***!
  \****************************************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=template&id=57280228& */ 44);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__["render"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228___WEBPACK_IMPORTED_MODULE_0__["components"]; });



/***/ }),

/***/ 44:
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/pages/index/index.vue?vue&type=template&id=57280228& ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components
try {
  components = {
    uNoticeBar: function() {
      return __webpack_require__.e(/*! import() | uview-ui/components/u-notice-bar/u-notice-bar */ "uview-ui/components/u-notice-bar/u-notice-bar").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-notice-bar/u-notice-bar.vue */ 83))
    },
    almostLottery: function() {
      return Promise.all(/*! import() | uni_modules/almost-lottery/components/almost-lottery/almost-lottery */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/almost-lottery/components/almost-lottery/almost-lottery")]).then(__webpack_require__.bind(null, /*! @/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue */ 90))
    },
    adView: function() {
      return __webpack_require__.e(/*! import() | components/ad-view/ad-view */ "components/ad-view/ad-view").then(__webpack_require__.bind(null, /*! @/components/ad-view/ad-view.vue */ 98))
    },
    adCustomView: function() {
      return __webpack_require__.e(/*! import() | components/ad-custom-view/ad-custom-view */ "components/ad-custom-view/ad-custom-view").then(__webpack_require__.bind(null, /*! @/components/ad-custom-view/ad-custom-view.vue */ 105))
    }
  }
} catch (e) {
  if (
    e.message.indexOf("Cannot find module") !== -1 &&
    e.message.indexOf(".vue") !== -1
  ) {
    console.error(e.message)
    console.error("1. 排查组件名称拼写是否正确")
    console.error(
      "2. 排查组件是否符合 easycom 规范，文档：https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
    )
    console.error(
      "3. 若组件不符合 easycom 规范，需手动引入，并在 components 中注册该组件"
    )
  } else {
    throw e
  }
}
var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  var m0 = _vm.getSerialize(
    Object.assign({}, _vm.mpData, { openId: _vm.openId })
  )
  var f0 = _vm.clearTime ? _vm._f("getTimerFilter")(_vm.clearTime) : null

  if (!_vm._isMounted) {
    _vm.e0 = function($event) {
      _vm.prizeIndex = -1
    }

    _vm.e1 = function($event) {
      _vm.popupVIPShow = false
      _vm.startAni(2)
      _vm.showCpAd()
    }

    _vm.e2 = function($event) {
      _vm.popup12Show = false
      _vm.startAni(3)
      _vm.showCpAd()
    }

    _vm.e3 = function($event) {
      _vm.popupGoldShow = false
      _vm.startGold(false)
      _vm.showCpAd()
    }
  }

  _vm.$mp.data = Object.assign(
    {},
    {
      $root: {
        m0: m0,
        f0: f0
      }
    }
  )
}
var recyclableRender = false
var staticRenderFns = []
render._withStripped = true



/***/ }),

/***/ 45:
/*!**********************************************************************************************************************!*\
  !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/pages/index/index.vue?vue&type=script&lang=js& ***!
  \**********************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _D_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=script&lang=js& */ 46);
/* harmony import */ var _D_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
 /* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); 

/***/ }),

/***/ 46:
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/pages/index/index.vue?vue&type=script&lang=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 _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 20));




























































































































































































var _api = __webpack_require__(/*! @/api/api.js */ 47);
var _almostUtils = __webpack_require__(/*! @/uni_modules/almost-lottery/utils/almost-utils.js */ 49);
var _ad_config = __webpack_require__(/*! @/utils/ad_config.js */ 50);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _objectWithoutProperties(source, excluded) {if (source == null) return {};var target = _objectWithoutPropertiesLoose(source, excluded);var key, i;if (Object.getOwnPropertySymbols) {var sourceSymbolKeys = Object.getOwnPropertySymbols(source);for (i = 0; i < sourceSymbolKeys.length; i++) {key = sourceSymbolKeys[i];if (excluded.indexOf(key) >= 0) continue;if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;target[key] = source[key];}}return target;}function _objectWithoutPropertiesLoose(source, excluded) {if (source == null) return {};var target = {};var sourceKeys = Object.keys(source);var key, i;for (i = 0; i < sourceKeys.length; i++) {key = sourceKeys[i];if (excluded.indexOf(key) >= 0) continue;target[key] = source[key];}return target;}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};} //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var timer = null,powerOnTimer = null,adTimer = null,lqTimer = null;var AlmostLottery = function AlmostLottery() {Promise.all(/*! require.ensure | uni_modules/almost-lottery/components/almost-lottery/almost-lottery */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/almost-lottery/components/almost-lottery/almost-lottery")]).then((function () {return resolve(__webpack_require__(/*! @/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue */ 90));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var adView = function adView() {__webpack_require__.e(/*! require.ensure | components/ad-view/ad-view */ "components/ad-view/ad-view").then((function () {return resolve(__webpack_require__(/*! @/components/ad-view/ad-view.vue */ 98));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var adCustomView = function adCustomView() {__webpack_require__.e(/*! require.ensure | components/ad-custom-view/ad-custom-view */ "components/ad-custom-view/ad-custom-view").then((function () {return resolve(__webpack_require__(/*! @/components/ad-custom-view/ad-custom-view.vue */ 105));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var systemInfo = uni.getSystemInfoSync();var _default = { components: { AlmostLottery: AlmostLottery, adView: adView, adCustomView: adCustomView }, data: function data() {return { title: 'Hello', adConfig: { bannerAd: _ad_config.bannerAd, singleLatticeAd: _ad_config.singleLatticeAd }, list: ['恭喜用户 “9016” 成功提现 2000书币', '恭喜用户 “9017” 成功提现 10书币', '恭喜用户 “9018” 成功提现 20书币', '恭喜用户 “9019” 成功提现 100书币'], // canvas id、宽、高
      canvasConfig: { canvasId: 'almostLotteryCanvas', width: 280, height: 280, outerWidth: 305, outerHeight: 305, colors: ['#FEE3C6', '#FFFFFF'] }, // 以下是奖品配置数据
      // 奖品数据
      prizeList: [], // 中奖下标
      prizeIndex: -1, // 是否正在抽奖中，避免重复触发
      prizeing: false, // 以下为业务需求有关示例数据
      // 当日免费抽奖次数余额
      freeNum: 10, // 以下是
      // 活动规则开关控制
      activityRules: false, // 弹窗控制
      popupShow: false, // 抽到VIP碎片弹窗控制
      popupVIPShow: false, // 抽到12碎片弹窗控制
      popup12Show: false, // 抽到金币弹窗控制
      popupGoldShow: false, openId: '', mpData: {}, prizeCountDtoList: [], // 碎片列表
      mpName: null, // 渠道号 
      userId: 91874, // 
      luckyDay: {}, // 中奖信息
      doubleKey: "", // 领取key
      clearTime: "", // 碎片有效期
      scale: 1, animation: null, // 动画实例
      animationData: null, // 动画
      animationDatas: [null, null, null, null, null, null, null, null], // 动画组
      animationDataTs: null, prizeType: 3, // 奖品类型
      durationMath: 20, // 防止动画每次都一样
      durationMath1: 20, durationMath2: 20, goldData: [{ top: '404rpx', left: '300rpx' }, { top: '434rpx', left: '240rpx' }, { top: '430rpx', left: '398rpx' }, { top: '448rpx', left: '424rpx' }, { top: '380rpx', left: '412rpx' }, { top: '332rpx', left: '332rpx' }, { top: '356rpx', left: '240rpx' }, { top: '474rpx', left: '294rpx' }], tsTitle: '', //提示信息
      remoteVersion: null, loading: false, _isLoaded: false, powerOnCount: 0, // 记录开机秒数
      powerOnTimer: new Date().getTime(), // 保存当前进入页面的时间挫
      videoType: null, // 1 前面两次看视频翻倍 2 后面8次看视频抽奖
      // 本地
      weightTotal: 0, // 权重数组
      weightArr: [], balanceCount: 0 };}, computed: { isApple: function isApple() {return uni.getSystemInfoSync().platform === 'ios';} }, onLoad: function onLoad(options) {var _this = this; // 请求奖品数据
    this.mpData = options;this.getData();this.animation = uni.createAnimation({ timingFunction: 'ease' });(0, _api.getVersion)({ appId: _api.config.appid }).then(function (res) {_this.remoteVersion = res.data;});}, onUnload: function onUnload() {uni.hideLoading();timer && clearInterval(timer);lqTimer && clearInterval(lqTimer);adTimer && clearTimeout(adTimer);powerOnTimer && clearInterval(powerOnTimer);this.interstitialAd.destroy();}, onHide: function onHide() {console.log('页面隐藏');timer && clearInterval(timer);lqTimer && clearTimeout(lqTimer);adTimer && clearTimeout(adTimer);powerOnTimer && clearInterval(powerOnTimer);}, onShareAppMessage: function onShareAppMessage() {}, filters: { getTimerFilter: function getTimerFilter(value) {// 获取年月日时分秒
      if (!value) return "";var timestamp = Date.parse(new Date(value));var date = new Date(timestamp);var Y = date.getFullYear();var M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();var H = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();var minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();var S = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();return "".concat(Y, "-").concat(M, "-").concat(D, " ").concat(H, ":").concat(minute, ":").concat(S);} }, onPullDownRefresh: function onPullDownRefresh() {var _this2 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return _this2.handleInitCanvas();case 2:_context.next = 4;return _this2.getList();case 4:uni.stopPullDownRefresh();case 5:case "end":return _context.stop();}}}, _callee);}))();}, onReady: function onReady() {if (_ad_config.urgeVideoAd) {this.createInterstitialAd();this.powerOnShowAd();}}, watch: { // 监听获奖序号的变动
    popupShow: function popupShow(newVal, oldVal) {this.openAniBt(newVal);}, popupVIPShow: function popupVIPShow(newVal) {this.openAniBt(newVal);}, popup12Show: function popup12Show(newVal) {this.openAniBt(newVal);}, popupGoldShow: function popupGoldShow(newVal) {this.openAniBt(newVal);} }, methods: { // 获取金币余额
    getBookCurr: function getBookCurr() {var _this3 = this;(0, _api.getBalance)({ appId: _api.config.appid, mpAppId: this.mpData.mpAppId, mpOpenId: this.mpData.mpOpenId }).then(function (res) {_this3.balanceCount = res.data || 0;});}, powerOnShowAd: function powerOnShowAd() {var _this4 = this; // 开机25秒调取弹窗广告 以后没5分钟调取
      powerOnTimer = setInterval(function () {_this4.powerOnCount += 1;if (_this4.powerOnCount === 25 || _this4.powerOnCount % 325 === 0) {_this4.showInterstitialAd();}}, 1000);}, // 创建插屏广告 激励视频广告
    createInterstitialAd: function createInterstitialAd() {var _this5 = this; // 创建插屏广告
      var interstitialAd = this.interstitialAd = uni.createInterstitialAd({ adUnitId: _ad_config.insertScreenAd });interstitialAd.onLoad(function () {// 插屏 广告加载成功 
        console.log("插屏 广告加载成功");_this5.loading = false;});interstitialAd.onClose(function () {// 用户点击了关闭或返回键(仅Android有返回键)
        console.log("插屏 广告关闭");});interstitialAd.onError(function (err) {// 插屏 广告加载失败
        console.log("插屏 广告加载失败", err);_this5.loading = false;}); // 广告实例创建成功后默认会执行一次 load，加载广告数据
      // 如果界面有 "显示广告" 按钮，需要先禁用掉，防止用户点击，等待广告数据加载成功后在放开
      this.loading = true; // 激励视频广告
      this._isLoaded = false;var rewardedVideoAd = this._rewardedVideoAd = uni.createRewardedVideoAd({ adUnitId: _ad_config.urgeVideoAd });rewardedVideoAd.onLoad(function () {_this5._isLoaded = true;console.log('onLoad event'); // 加载激励视频成功
        // 当激励视频被关闭时，默认预载下一条数据，加载完成时仍然触发 `onLoad` 事件
      });rewardedVideoAd.onError(function (err) {// 加载激励视频失败
        _this5._isLoaded = false;console.log('onError event', err);});rewardedVideoAd.onClose(function (res) {// 用户点击了【关闭广告】按钮
        console.log('==============>', res);if (res && res.isEnded) {// 正常播放结束
          if (_this5.videoType === 1) {// 看视频翻倍领取
            _this5.receiveGold(true);} else if (_this5.videoType === 2) {// 看视频抽奖
            if (!_this5.mpName) {// 首次没有重公众号进入
              _this5.localGetPrizeIndex();return;}_this5.remoteGetPrizeIndex();
          }
        } else {
          // 播放中途退出
          _this5.prizeing = false;
          _this5.freeNum++;
        }
      });
    },
    // 抽完奖显示插屏广告
    showCpAd: function showCpAd() {var _this6 = this;
      lqTimer && clearTimeout(lqTimer);
      setTimeout(function () {
        _this6.showInterstitialAd();
      }, 10000);
    },
    // 显示插屏广告广告
    showInterstitialAd: function showInterstitialAd() {var _this7 = this;
      // 调用 interstitialAd.show()，如果数据正在加载中不会显示广告，加载成功后才显示
      // 在数据没有加载成功时，需要防止用户频繁点击显示广告
      if (!_ad_config.insertScreenAd) {
        console.log('没有插屏广告');
        return;
      }
      if (adTimer) {
        clearTimeout(adTimer);
      }
      var newT = new Date().getTime();
      if (newT / 1000 - this.powerOnTimer / 1000 < 15) {// 判断是否开机15秒
        adTimer = setTimeout(function () {
          if (_this7.loading == true) {
            return;
          }
          _this7.loading = true;
          _this7.interstitialAd.show().then(function (res) {
            console.log('插屏广告成功---》', res);
            _this7.loading = false;
          }).catch(function (err) {
            console.log('插屏广告错误---》', err);
          });
          clearTimeout(adTimer);
        }, newT - this.powerOnTimer + 1000);
        return;
      }
      if (this.loading == true) {
        return;
      }
      console.log(11111);
      this.loading = true;
      this.interstitialAd.show().then(function (res) {
        console.log('插屏广告成功---》', res);
        _this7.loading = false;
      }).catch(function (err) {
        console.log('插屏广告错误---》', err);
      });
    },
    // 显示激励视频广告
    showVideoAd: function showVideoAd(type) {var _this8 = this;
      console.log('显示激励视频广告');
      this.videoType = type;
      if (this._isLoaded) {
        uni.showLoading({
          title: '正在拉取~~' });

        this._rewardedVideoAd.show().then(function () {
          uni.hideLoading();
          console.log('拉取视频then');
        }).catch(function (err) {
          console.log('拉取视频catch', err);
          uni.hideLoading();
          _this8._rewardedVideoAd && _this8._rewardedVideoAd.load().then(function () {return _this8._rewardedVideoAd && _this8._rewardedVideoAd.show();}).catch(function (err) {
            uni.showToast({
              title: '当前无视频广告',
              icon: 'none' });

          });
        });
      } else {
        if (this.videoType === 1) {// 看视频翻倍领取
          this.receiveGold(true);
        } else if (this.videoType === 2) {// 看视频抽奖
          if (!this.mpName) {// 首次没有重公众号进入
            this.localGetPrizeIndex();
            return;
          }
          this.remoteGetPrizeIndex();
        }
      }
    },
    // 是否开始呼吸开关动画
    openAniBt: function openAniBt(val) {var _this9 = this;
      if (val) {
        timer = setInterval(function () {
          if (_this9.scale === 1) {
            _this9.scale = 0.92;
          } else {
            _this9.scale = 1;
          }
        }, 500);
      } else {
        timer && clearInterval(timer);
      }
    },
    // 开始动画 12 vip 碎片
    startAni: function startAni() {var prizeType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
      if (prizeType === 3 || prizeType === 2) {
        this.prizeType = prizeType;
        this.startTsAni(false);
        var index = this.prizeCountDtoList.findIndex(function (item) {return item.prizeType === prizeType;});
        var left = index !== -1 ? index === 0 ? '150rpx' : '500rpx' : '500rpx';
        this.animation.opacity(1).step({ duration: this.durationMath });
        if (this.durationMath >= 50) {
          this.durationMath = 20;
        } else {
          this.durationMath = this.durationMath + 1;
        }
        // this.animation.top('1300rpx').left(left).step({ duration: 1200, delay: 100 })
        this.animation.top('76rpx').left('60rpx').step({ duration: 1000, delay: 100 });
        this.animation.opacity(0).top('453rpx').left('331rpx').step({ duration: 0 });
        this.animationData = this.animation.export();
      }
    },
    startGold: function startGold(watchVideos) {var _this10 = this;
      this.prizeType = 1;
      this.startTsAni(watchVideos);
      if (this.durationMath1 >= 50) {
        this.durationMath1 = 20;
      } else {
        this.durationMath1 = this.durationMath1 + 1;
      }
      this.animationDatas = this.goldData.map(function (item) {
        var animation = uni.createAnimation({ timingFunction: 'ease' });
        animation.opacity(1).step({ duration: _this10.durationMath1 });
        animation.top('76rpx').left('60rpx').step({ duration: Math.floor(Math.random() * 101) + 1000, delay: 100 }); //  
        animation.opacity(0).top(item.top).left(item.left).step({ duration: 0 });
        return animation.export();
      });
    },
    startTsAni: function startTsAni(watchVideos) {
      if (this.prizeType === 1) {
        if (watchVideos) {
          this.tsTitle = '+' + this.luckyDay.prizeCount * 2 + this.luckyDay.prizeName;
        } else {
          this.tsTitle = '+' + this.luckyDay.name;
        }
      } else {
        this.tsTitle = this.luckyDay.prizeName + '+1';
      }
      if (this.durationMath2 >= 50) {
        this.durationMath2 = 20;
      } else {
        this.durationMath2 = this.durationMath2 + 1;
      }
      var animation = uni.createAnimation({ timingFunction: 'ease' });
      animation.opacity(1).step({ duration: this.durationMath2 });
      animation.top('250rpx').step({ duration: 1000, delay: 100 });
      animation.opacity(0).top('450rpx').step({ duration: 0 });
      this.animationDataTs = animation.export();
    },
    // 再次抽奖
    againLuckDraw: function againLuckDraw(type) {
      if (type === 'vip') {
        this.popupVIPShow = false;
      } else if (type === '12') {
        this.popup12Show = false;
      } else {
        this.popupGoldShow = false;
      }
      this.handleDrawStart();
    },
    // 看视频双倍
    lookVideo: function lookVideo() {
      this.showVideoAd(1);
    },
    // 领取金币
    receiveGold: function receiveGold() {var _this11 = this;var watchVideos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      if (!this.mpName) {// 首次没有重公众号进入
        this.startGold(watchVideos);
        this.popupShow = false;
        return;
      }
      if (this.doubleKey) {
        (0, _api.setReceive)(_objectSpread({ appId: _api.config.appid, doubleKey: this.doubleKey, openId: this.openId, watchVideos: watchVideos }, this.mpData)).then(function (res) {
          _this11.startGold(watchVideos);
          _this11.popupShow = false;
          _this11.doubleKey = "";
          _this11.getList();
          if (watchVideos) {

          } else {
            _this11.showInterstitialAd();
          }
        });
      }
    },
    // 
    getData: function getData() {var _this12 = this;
      uni.login({
        success: function () {var _success = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(res) {var openIDInfo, response;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:if (!
                    res.code) {_context2.next = 18;break;}_context2.next = 3;return (
                      (0, _api.getOpenId)({ appId: _api.config.appid, code: res.code }));case 3:openIDInfo = _context2.sent;
                    _this12.openId = openIDInfo.data;_context2.next = 7;return (
                      _this12.getList());case 7:response = _context2.sent;if (!
                    response) {_context2.next = 14;break;}_context2.next = 11;return (
                      _this12.getPrizeList());case 11:
                    (0, _api.getBanner)({ appId: _api.config.appid, openId: _this12.openId, mpAppId: _this12.mpData.mpAppId }).then(function (res) {
                      _this12.list = res.data;
                    });_context2.next = 18;break;case 14:

                    _this12.prizeList = [
                    { "prizeId": 1, "name": "100书币", "stock": 100, "prizeCount": 100, "prizeName": '书币', "weight": 0.1, "prizeType": 1, "prizeImage": "/static/turntable_golds.png" },
                    { "prizeId": 2, "name": "书城VIP碎片", "stock": 100, "weight": 5, "prizeType": 2, "prizeImage": "/static/turntable_VIP.png" },
                    { "prizeId": 3, "name": "30书币", "stock": 100, "prizeCount": 30, "prizeName": '书币', "weight": 1, "prizeType": 1, "prizeImage": "/static/turntable_gold.png" },
                    { "prizeId": 4, "name": "书城VIP碎片", "stock": 100, "weight": 5, "prizeType": 2, "prizeImage": "/static/turntable_VIP.png" },
                    { "prizeId": 5, "name": "10书币", "stock": 100, "prizeCount": 10, "prizeName": '书币', "weight": 10000, "prizeType": 1, "prizeImage": "/static/turntable_gold.png" },
                    { "prizeId": 6, "name": "50书币", "stock": 100, "weight": 1, "prizeCount": 50, "prizeName": '书币', "prizeType": 1, "prizeImage": "/static/turntable_golds.png" },
                    { "prizeId": 7, "name": "iPhone12碎片", "stock": 100, "weight": 5, "prizeType": 3, "prizeImage": "/static/turntable_iPhone12.png" },
                    { "prizeId": 8, "name": "20书币", "stock": 100, "prizeCount": 20, "prizeName": '书币', "weight": 10000, "prizeType": 1, "prizeImage": "/static/turntable_gold.png" }];
                    _this12.prizeCountDtoList = [{ "prizeType": 2, "prizeCount": 0, "prizeName": "书城VIP碎片", "maxCount": 30 }, { "prizeType": 3, "prizeCount": 0, "prizeName": "iPhone12碎片", "maxCount": 50 }];

                    _this12.prizeList.forEach(function (item) {return _this12.weightTotal += item.weight;});
                    _this12.weightArr = _this12.prizeList.map(function (item) {return item.weight;});case 18:case "end":return _context2.stop();}}}, _callee2);}));function success(_x) {return _success.apply(this, arguments);}return success;}() });




    },
    // 跳转小程序
    jumpSign: function jumpSign() {
      var path = 'pages/index/index';
      if (Object.keys(this.mpData).length > 0) {
        path = path + this.getSerialize(this.mpData);
      }
      uni.navigateToMiniProgram({
        appId: 'wx162370635292eef2',
        path: path,
        success: function success(res) {
          // 打开成功
        } });

    },
    // 对象序列化成 a=1&b=2
    getSerialize: function getSerialize(value) {
      if (Object.prototype.toString.call(value) === "[object Object]") {
        var path = "";
        for (var key in value) {
          if (Object.prototype.hasOwnProperty.call(value, key)) {
            var element = value[key];
            if (path === "") {
              path = "?".concat(key, "=").concat(element);
            } else {
              path = path + "&".concat(key, "=").concat(element);
            }
          }
        }
        return path;
      } else {
        return "";
      }
    },
    // 活动规则
    activityRulesHandle: function activityRulesHandle() {
      this.activityRules = !this.activityRules;
    },
    // 关闭弹窗
    closeHandle: function closeHandle() {
      this.receiveGold(false);
      this.popupShow = false;
    },
    // 重新生成
    handleInitCanvas: function handleInitCanvas() {
      (0, _almostUtils.clearCacheFile)();
      this.prizeList = [];
      this.getPrizeList();
    },
    // 获取首页信息
    getList: function getList() {var _this13 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {var res, data;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return (
                  (0, _api.getHome)(_objectSpread({ appId: _api.config.appid, openId: _this13.openId, userSource: 1 }, _this13.mpData)));case 2:res = _context3.sent;
                data = res.data;if (!
                data) {_context3.next = 15;break;}
                _this13.userId = data.userId;
                _this13.clearTime = data.clearTime;
                _this13.prizeCountDtoList = data.prizeCountDtoList;
                _this13.mpName = data.mpName;
                _this13.freeNum = data.luckDraw;
                _this13.mpData = {
                  mpAppId: data.mpAppId,
                  mpName: data.mpName,
                  mpOpenId: data.mpOpenId };

                _this13.getBookCurr();return _context3.abrupt("return",
                Promise.resolve(true));case 15:return _context3.abrupt("return",

                Promise.resolve(false));case 16:case "end":return _context3.stop();}}}, _callee3);}))();

    },
    // 获取奖品列表
    getPrizeList: function getPrizeList() {var _this14 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4() {var res;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:
                uni.showLoading({
                  title: '奖品准备中...' });_context4.next = 3;return (

                  (0, _api.getPond)({ appId: _api.config.appid, openId: _this14.openId, mpAppId: _this14.mpData.mpAppId }));case 3:res = _context4.sent;
                if (res.data && res.data.length > 0) {
                  _this14.prizeList = res.data.map(function (item) {
                    var prizeImage = "";
                    if (item.prizeType === 1) {
                      prizeImage = '/static/turntable_gold.png';
                      if (item.prizeCount > 30) {
                        prizeImage = '/static/turntable_golds.png';
                      }
                      return {
                        prizeId: item.id,
                        name: item.prizeCount + item.prizeName,
                        stock: 100,
                        weight: 10,
                        prizeImage: prizeImage,
                        prizeType: item.prizeType,
                        prizeCount: item.prizeCount,
                        prizeName: item.prizeName };

                    } else {
                      prizeImage = '/static/turntable_iPhone12.png';
                      if (item.prizeType === 2) {
                        prizeImage = '/static/turntable_VIP.png';
                      }
                      return {
                        prizeId: item.id,
                        name: item.prizeName,
                        stock: 100,
                        weight: 10,
                        prizeImage: prizeImage,
                        prizeType: item.prizeType,
                        prizeCount: item.prizeCount,
                        prizeName: item.prizeName };

                    }
                  });
                } else {
                  uni.hideLoading();
                  uni.showToast({
                    title: '获取奖品失败' });

                }case 5:case "end":return _context4.stop();}}}, _callee4);}))();
    },
    // 本次抽奖开始
    handleDrawStart: function handleDrawStart() {
      console.log('触发抽奖按钮');
      if (systemInfo.system.includes('indows')) {
        uni.showToast({
          title: '请到手机端抽奖!',
          icon: 'error',
          duration: 4000 });

        return;
      }
      if (!this.mpName) {// 首次没有重公众号进入
        if (this.remoteVersion !== _api.config.version) {
          uni.showToast({
            title: '请先关注公众号~~',
            icon: 'none' });

        }
        // uni.navigateTo({
        // 	url: '../officialAccount/officialAccount'
        // })
        // 没有公众号本地抽奖
        if (this.freeNum > 0) {
          // 更新免费次数或金币余额
          if (this.freeNum > 0) {
            this.freeNum--;
          }
          if (this.freeNum < 8) {
            // 看视频
            this.showVideoAd(2);
          } else {
            // 发起抽奖
            this.localGetPrizeIndex();
          }
        }
        return;
      }
      if (this.prizeing) return;
      this.prizeing = true;

      // 还有免费数次或者剩余金币足够抽一次
      if (this.freeNum > 0) {
        // 更新免费次数或金币余额
        if (this.freeNum > 0) {
          this.freeNum--;
        }
        lqTimer && clearTimeout(lqTimer);
        if (this.freeNum < 8) {
          // 看视频
          this.showVideoAd(2);
        } else {
          // 发起抽奖
          this.remoteGetPrizeIndex();
        }
      } else {
        this.prizeing = false;
        uni.showToast({
          title: '抽奖次数不足',
          icon: 'none' });

      }
    },
    // 远程请求接口获取中奖下标
    remoteGetPrizeIndex: function remoteGetPrizeIndex() {var _this15 = this;
      console.warn('###当前处于模拟的请求接口，并返回了中奖信息###');var _this$mpData =
      this.mpData,mpName = _this$mpData.mpName,mp = _objectWithoutProperties(_this$mpData, ["mpName"]);
      (0, _api.setDrawGain)(_objectSpread({ appId: _api.config.appid, openId: this.openId }, mp)).then(function (res) {
        var data = res.data;
        _this15.doubleKey = data.doubleKey;
        var prizeIndex = _this15.prizeList.findIndex(function (item) {return item.prizeId === data.id;});
        if (prizeIndex !== -1) {
          _this15.prizeIndex = prizeIndex;
        } else {
          uni.showToast({
            title: '抽奖异常，请稍后重试' });

        }
      });
    },
    // 没有公众号模拟抽奖
    // 本地获取中奖下标
    localGetPrizeIndex: function localGetPrizeIndex() {
      console.warn('###当前处于前端控制中奖概率，安全起见，强烈建议由后端控制###');
      // 前端控制概率的情况下，需要拿到最接近随机权重且大于随机权重的值
      // 后端控制概率的情况下，通常会直接返回 prizeId
      if (!this.weightTotal) {
        console.warn('###当前已开启前端控制中奖概率，但是奖品数据列表中的 weight 参数似乎配置不正确###');
        return;
      }
      console.log('当前权重总和为 =>', this.weightTotal);

      // 注意这里使用了 Math.ceil，如果某个权重的值为 0，则始终无法中奖
      var weight = Math.ceil(Math.random() * this.weightTotal);
      console.log('本次权重随机数 =>', weight);

      var list = _toConsumableArray(this.prizeList);

      // 生成大于等于随机权重的数组
      var tempMaxArrs = [];
      list.forEach(function (item) {
        if (item.weight >= weight) {
          tempMaxArrs.push(item.weight);
        }
      });

      // 如果大于随机权重的数组有值，先对这个数组排序然后取值
      // 反之新建一个临时的包含所有权重的已排序数组，然后取值
      var tempMaxArrsLen = tempMaxArrs.length;
      if (tempMaxArrsLen) {
        tempMaxArrs.sort(function (a, b) {return a - b;});
        // 取值时，如果存在多个值，分两种情况
        if (tempMaxArrsLen > 1) {
          // 值不相等的情况下取最接近的值，也就是第1个值
          var sumWeight = tempMaxArrs.reduce(function (a, b) {return a + b;});
          if (sumWeight / tempMaxArrsLen !== tempMaxArrs[0]) {
            this.prizeIndex = this.weightArr.indexOf(tempMaxArrs[0]);
          } else {
            // 值相等时，随机取值，当然这里你可以自己决定是否随机取值
            var sameWeight = tempMaxArrs[0];
            var sameWeightArr = [];
            var sameWeightItem = {};
            this.weightArr.forEach(function (item, index) {
              if (item === sameWeight) {
                sameWeightArr.push({
                  weight: item,
                  index: index });

              }
            });
            console.log('sameWeightArr', sameWeightArr);
            sameWeightItem = sameWeightArr[Math.floor(Math.random() * sameWeightArr.length)];
            console.log('sameWeightItem', sameWeightItem);
            this.prizeIndex = sameWeightItem.index;
          }
        } else {
          this.prizeIndex = this.weightArr.indexOf(tempMaxArrs[0]);
        }
      } else {
        var tempWeightArr = _toConsumableArray(this.weightArr);
        tempWeightArr.sort(function (a, b) {return a - b;});
        this.prizeIndex = this.weightArr.indexOf(tempWeightArr[tempWeightArr.length - 1]);
      }

      console.log('本次抽中奖品 =>', this.prizeList[this.prizeIndex].name);
    },
    // 本次抽奖结束
    handleDrawEnd: function handleDrawEnd() {
      console.log('旋转结束，执行拿到结果后到逻辑');
      // 旋转结束后，开始处理拿到结果后的逻辑
      this.prizeing = false;
      var prizeName = this.prizeList[this.prizeIndex].name;var _this$prizeList$this$ =
      this.prizeList[this.prizeIndex],prizeType = _this$prizeList$this$.prizeType,prizeCount = _this$prizeList$this$.prizeCount;

      console.log('1111->', this.prizeList[this.prizeIndex]);
      this.luckyDay = this.prizeList[this.prizeIndex];

      if (prizeName === '谢谢参与') {
      } else if (prizeName.indexOf('碎片') === -1 && this.freeNum >= 8) {
        this.popupShow = true;
        return;
      } else {
        if (prizeType === 1) {
          this.popupGoldShow = true;
        } else if (prizeType === 2) {
          this.popupVIPShow = true;
        } else if (prizeType === 3) {
          this.popup12Show = true;
        }
      }

      if (!this.mpName) {// 首次没有重公众号进入
        console.log("首次没有重公众号进入");
        return;
      }
      this.getList();
    },
    // 抽奖转盘绘制完成
    handleDrawFinish: function handleDrawFinish(res) {
      console.log('抽奖转盘绘制完成', res);
      uni.showToast({
        title: res.msg,
        duration: 800,
        mask: true,
        icon: 'none' });

    } } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

/***/ }),

/***/ 51:
/*!*******************************************************************************************************************************!*\
  !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/pages/index/index.vue?vue&type=style&index=0&lang=scss& ***!
  \*******************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _D_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=style&index=0&lang=scss& */ 52);
/* harmony import */ var _D_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
 /* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a); 

/***/ }),

/***/ 52:
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw-yanguang/pages/index/index.vue?vue&type=style&index=0&lang=scss& ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

// extracted by mini-css-extract-plugin
    if(false) { var cssReload; }
  

/***/ })

},[[41,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map