(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pages/cart/settlement"],{ /***/ 39: /*!*************************************************************************!*\ !*** D:/老农商城/mall-laonong/main.js?{"page":"pages%2Fcart%2Fsettlement"} ***! \*************************************************************************/ /*! 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 */ 4)); var _settlement = _interopRequireDefault(__webpack_require__(/*! ./pages/cart/settlement.vue */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // @ts-ignore wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;createPage(_settlement.default); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"])) /***/ }), /***/ 40: /*!******************************************************!*\ !*** D:/老农商城/mall-laonong/pages/cart/settlement.vue ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./settlement.vue?vue&type=template&id=5371580f& */ 41); /* harmony import */ var _settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./settlement.vue?vue&type=script&lang=js& */ 43); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _settlement_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 _settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony import */ var _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 11); var renderjs /* normalize component */ var component = Object(_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( _settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__["render"], _settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, null, null, false, _settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__["components"], renderjs ) component.options.__file = "pages/cart/settlement.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ 41: /*!*************************************************************************************!*\ !*** D:/老农商城/mall-laonong/pages/cart/settlement.vue?vue&type=template&id=5371580f& ***! \*************************************************************************************/ /*! exports provided: render, staticRenderFns, recyclableRender, components */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./settlement.vue?vue&type=template&id=5371580f& */ 42); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_template_id_5371580f___WEBPACK_IMPORTED_MODULE_0__["components"]; }); /***/ }), /***/ 42: /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./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!D:/老农商城/mall-laonong/pages/cart/settlement.vue?vue&type=template&id=5371580f& ***! \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! 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 = { statusNav: function() { return __webpack_require__.e(/*! import() | components/status-nav/status-nav */ "components/status-nav/status-nav").then(__webpack_require__.bind(null, /*! @/components/status-nav/status-nav.vue */ 137)) } } } 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 l0 = _vm.isLoading ? _vm.__map(_vm.couponList, function(item, index) { var $orig = _vm.__get_orig(item) var g0 = item.amount.split(".") var g1 = item.amount.split(".") var m0 = parseInt(item.condition) var m1 = parseInt(item.amount) return { $orig: $orig, g0: g0, g1: g1, m0: m0, m1: m1 } }) : null if (!_vm._isMounted) { _vm.e0 = function($event) { _vm.wechatCheck = !_vm.wechatCheck } _vm.e1 = function($event) { _vm.priceCheck = !_vm.priceCheck } } _vm.$mp.data = Object.assign( {}, { $root: { l0: l0 } } ) } var recyclableRender = false var staticRenderFns = [] render._withStripped = true /***/ }), /***/ 43: /*!*******************************************************************************!*\ !*** D:/老农商城/mall-laonong/pages/cart/settlement.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 _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./settlement.vue?vue&type=script&lang=js& */ 44); /* harmony import */ var _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_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 _HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_settlement_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ 44: /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./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!D:/老农商城/mall-laonong/pages/cart/settlement.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 _default = { data: function data() { return { orderInfo: {}, //订单信息 default_address: {}, //地址信息 orderShopList: [], // 商品信息 couponList: [], //优惠券列表 couponIndex: 0, //优惠券选择 vipCheck: false, //会员折扣 couponCheck: false, // 优惠选择 scoreCheck: false, //积分抵扣 wechatCheck: true, //微信支付 priceCheck: false, //余额支付 isCoupon: false, //优惠券弹窗 flag: true, preferential_options: 'coupon', //优惠选择 totalPrice: '', //总价 discountPrice: '', //优惠价格 discountNum: 0, //优惠价格数字 isLoading: false, score_rule: 1, //多少积分抵扣 checkedYes: true }; }, onShow: function onShow() { this.getOrderInfo(); }, methods: { // 选择地址 toAddress: function toAddress() { uni.navigateTo({ url: "/pagesA/address/address?type=change" }); }, // 计算价格 computePrice: function computePrice() { // 原需支付 var totalNum = this.orderInfo.total_price; totalNum = parseFloat(this.$toolAll.tools.addXiaoShu(totalNum)); var totalPrice = this.$toolAll.tools.addXiaoShu(totalNum); // 会员折扣 var vipNum = this.orderInfo.vip_level > 0 ? this.orderInfo.total_price * (1 - this.$toolAll.tools.addXiaoShu(this.orderInfo.membership_discount) / 10) : 0; vipNum = parseFloat(this.$toolAll.tools.addXiaoShu(vipNum)); var vipPrice = this.$toolAll.tools.addXiaoShu(vipNum); // 优惠券折扣 var couponNum = this.couponList.length > 0 ? this.couponList[this.couponIndex].amount : 0; couponNum = parseFloat(this.$toolAll.tools.addXiaoShu(couponNum)); var couponPrice = this.$toolAll.tools.addXiaoShu(couponNum); // 积分可抵扣额度 var scoreNum = this.orderInfo.available_score * this.score_rule; scoreNum = parseFloat(this.$toolAll.tools.addXiaoShu(scoreNum)); var scorePrice = this.$toolAll.tools.addXiaoShu(scoreNum); // 只有会员则扣 if (this.vipCheck && !this.scoreCheck) { this.discountNum = vipNum; this.discountPrice = vipPrice; } // 只有优惠券 if (this.couponCheck && !this.scoreCheck) { this.discountNum = couponNum; this.discountPrice = couponPrice; } // 只有积分 if (!this.vipCheck && !this.couponCheck && this.scoreCheck) { if (scoreNum >= totalNum) { this.discountNum = totalNum; this.discountPrice = totalPrice; } else { this.discountNum = scoreNum; this.discountPrice = scorePrice; } } // 会员折扣+积分 if (this.vipCheck && this.scoreCheck) { if (scoreNum + vipNum >= totalNum) { this.discountNum = totalNum; this.discountPrice = totalPrice; } else { this.discountNum = scoreNum + vipNum; this.discountPrice = this.$toolAll.tools.addXiaoShu(scoreNum + vipNum); } } // 优惠券+积分 if (this.couponCheck && this.scoreCheck) { if (scoreNum + couponNum >= totalNum) { this.discountNum = totalNum; this.discountPrice = totalPrice; } else { this.discountNum = scoreNum + couponNum; this.discountPrice = this.$toolAll.tools.addXiaoShu(scoreNum + couponNum); } } // 都不选择 if (!this.vipCheck && !this.couponCheck && !this.scoreCheck) { this.discountNum = 0; this.discountPrice = 0; } // 计算支付价格 this.totalPrice = this.$toolAll.tools.addXiaoShu(totalNum - this.discountNum); }, // 获取订单准备信息 getOrderInfo: function getOrderInfo() {var _this = this; uni.showLoading({ title: '加载中' }); var params = { sku_list: uni.getStorageSync('buyList') }; this.$requst.post('/api/order/prepare-info', params).then(function (res) { if (res.code == 0) { console.log(res, '订单准备信息'); // 其他信息 _this.orderInfo = res.data; // 优惠券信息 var baseArr = res.data.available_coupon_list; var couponArr = baseArr.sort(function (a, b) { return b.amount - a.amount; }); _this.couponList = couponArr; if (_this.couponList.length == 0) { _this.couponCheck = false; } // 商品信息 _this.orderShopList = res.data.list; // 积分抵扣规则 var score_num = res.data.integral_rule.deduction_points_score; var score_value = res.data.integral_rule.deduction_points_score_value; _this.score_rule = parseFloat(score_value) / parseFloat(score_num); // 积分是否可选 var scoreA = _this.orderInfo.available_score * _this.score_rule; var scoreB = parseFloat(_this.$toolAll.tools.addXiaoShu(scoreA)); if (scoreB < 1) { _this.checkedYes = false; } console.log(_this.checkedYes, 1212121212); // 地址信息 var addr_id = uni.getStorageSync('addr_id'); if (addr_id) { // 获取地址 _this.getAddrDetail(addr_id); } else { _this.default_address = res.data.default_address; } // 价格 _this.discountPrice = 0; _this.totalPrice = _this.$toolAll.tools.addXiaoShu(_this.orderInfo.total_price); } uni.hideLoading(); _this.isLoading = true; }); }, // 获取地址 getAddrDetail: function getAddrDetail(id) {var _this2 = this; this.$requst.post('/api/user/address-info', { id: id }).then(function (res) { if (res.code == 0) { console.log(res, '地址详情'); _this2.default_address = res.data; } }); }, // 打开优惠券弹窗 toCoupon: function toCoupon() { if (this.couponList.length) { this.isCoupon = true; } else { this.$toolAll.tools.showToast('暂无可用的优惠券'); } }, // 选择优惠券 changeCoupon: function changeCoupon(index) { if (index !== this.couponIndex) { this.couponIndex = index; } }, //确认选择 useCoupon: function useCoupon() { this.isCoupon = false; this.vipCheck = false; this.couponCheck = true; // 计算价格 this.computePrice(); }, //取消选择 closeCoupon: function closeCoupon() { this.isCoupon = false; this.couponIndex = 0; }, // 选择按钮 chooseEv: function chooseEv(type) { if (type == 'vip' && this.orderInfo.vip_level > 0) { if (this.vipCheck) { this.vipCheck = false; } else { this.vipCheck = true; this.couponCheck = false; } this.computePrice(); } if (type == 'coupon' && this.couponList.length) { if (this.couponCheck) { this.couponCheck = false; } else { this.couponCheck = true; this.vipCheck = false; } this.computePrice(); } if (type == 'score' && this.orderInfo.available_score > 0) { if (this.checkedYes) { if (this.scoreCheck) { this.scoreCheck = false; } else { this.scoreCheck = true; } this.computePrice(); } else { this.$toolAll.tools.showToast('当前积分无法抵扣'); } } }, // 提交 submitEv: function submitEv() {var _this3 = this; this.flag = false; if (this.vipCheck) { this.preferential_options = 'membership_discount'; } if (this.couponCheck) { this.preferential_options = 'coupon'; } if (!this.couponCheck && !this.vipCheck) { this.preferential_options = ''; } if (this.default_address == null) { this.$toolAll.tools.showToast('请填写地址信息'); } else { if (this.wechatCheck || this.priceCheck) { var params = { sku_list: uni.getStorageSync('buyList'), preferential_options: this.preferential_options, coupon_id: this.couponCheck ? this.couponList[this.couponIndex].id : '', deduction_points: this.scoreCheck ? 1 : 0, is_balance: this.priceCheck ? 1 : 0, is_wechat: this.wechatCheck ? 1 : 0, address_id: this.default_address.id }; this.$requst.post('/api/order/create', params).then(function (res) { if (res.code == 0) { console.log(res, '支付返回'); if (res.data.need_wechat_pay == 1) { // 调用微信支付 _this3.callPayMent(res.data.payment_params, res.data.id, res.data.coding); } else { // 成功状态 _this3.successEv(res.data.coding); // 清除缓存 uni.removeStorageSync('addr_id'); // 页面跳转 uni.navigateTo({ url: "/pages/cart/finish?id=".concat(res.data.id) }); } } else { console.log(res.msg, '提示信息'); _this3.$toolAll.tools.showToast(res.msg); _this3.flag = true; } }); } else { this.$toolAll.tools.showToast('请选择支付方式'); } } }, // 调用微信支付 callPayMent: function callPayMent(data, id, coding) {var _this4 = this; //调起支付 wx.requestPayment({ 'timeStamp': data.timeStamp, 'nonceStr': data.nonceStr, 'package': data.package, "signType": data.signType, 'paySign': data.sign, 'success': function success(res) {// 接口调用成功的回调函数 console.log('支付成功:', res); // 成功状态 _this4.successEv(coding); // 清除缓存 uni.removeStorageSync('addr_id'); // 页面跳转 uni.navigateTo({ url: "/pages/cart/finish?id=".concat(id) }); }, 'fail': function fail(res) {// 接口调用失败的回调函数 _this4.$toolAll.tools.showToast('您已取消支付'); setTimeout(function () { // 页面跳转 uni.navigateTo({ url: "/pagesA/order/order?index=1&backTag=backmy" }); }, 1000); } }); }, // 成功状态 successEv: function successEv(coding) {var _this5 = this; this.$requst.post('/api/order/paid', { order_coding: coding }).then(function (res) { if (res.code == 0) { console.log(res, '成功状态'); } else { _this5.$toolAll.tools.showToast(res.msg); } }); } } };exports.default = _default; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"])) /***/ }) },[[39,"common/runtime","common/vendor"]]]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cart/settlement.js.map