(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pages-mine/common/vendor"],{ /***/ 281: /*!*****************************************************!*\ !*** E:/书嗨项目/book-hi/pages-mine/mixin/btnAction.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 { actionList: [], showReportSheet: false, order: {} }; }, onShow: function onShow() { var selectEditAddr = uni.getStorageSync('selectEditAddr'); if (selectEditAddr.id) { this.handleAddressSubmit(selectEditAddr.id); } }, methods: { //操作成功之后的回调 successFeedback: function successFeedback() { uni.$emit('btnActionSuccess'); }, //修改地址 handleAddressSubmit: function handleAddressSubmit(addressId) { var _this = this; var params = { orderId: this.order.orderId, addressId: addressId }; uni.$u.http.post('/token/order/modifyAddress', params).then(function (res) { if (res.code === 200) { uni.showToast({ title: '地址修改成功', icon: 'none' }); _this.$emit('success'); _this.successFeedback(); uni.removeStorageSync('selectEditAddr'); } else { uni.showToast({ title: res.msg, icon: 'none' }); } }).finally(function () { uni.removeStorageSync('selectEditAddr'); uni.hideLoading(); }); }, //根据code获取字典 /token/common/getDictOptions getDict: function getDict(code) { return uni.$u.http.get('/token/common/getDictOptions?type=' + code); }, //获取一键上报的选项 code user_report_options getReportOptions: function getReportOptions() { var _this2 = this; this.getDict('user_report_options').then(function (res) { if (res.code === 200) { _this2.actionList = res.data.map(function (item) { return { text: item.dictLabel, value: item.dictValue }; }); } }); }, //一键上报相关操作 handleReportSelect: function handleReportSelect(index) { var _this$actionList$inde; this.showReportSheet = false; var reason = this.actionList[index].value; if ((_this$actionList$inde = this.actionList[index]) !== null && _this$actionList$inde !== void 0 && _this$actionList$inde.isCancel) { this.submitCancel(reason); } else { this.submitReport(reason); } }, submitReport: function submitReport(reason) { var _this3 = this; var params = { orderId: this.order.orderId, reason: reason }; uni.$u.http.post('/token/order/userReport', params).then(function (res) { if (res.code === 200) { uni.showToast({ title: '一键上报已上报给管理员', icon: 'none' }); _this3.$emit('success'); _this3.successFeedback(); } }); }, //订单取消字典 order_cancel_reason_user getCancelReason: function getCancelReason() { var _this4 = this; this.getDict('order_cancel_reason_user').then(function (res) { if (res.code === 200) { _this4.actionList = res.data.map(function (item) { return { text: item.dictLabel, value: item.dictValue, isCancel: true }; }); } }); }, // 订单操作方法 handleAction: function handleAction(_ref) { var type = _ref.type, order = _ref.order; console.log('handleAction', type, order); this.order = order; switch (type) { case 'submit': uni.navigateTo({ url: "/pages-home/pages/book-order" }); uni.setStorageSync('orderId', this.order.orderId); break; case 'editAddress': uni.navigateTo({ url: "/pages-mine/pages/address/list?id=".concat(this.order.addressId, "&isSelect=1&editAddress=1") }); break; case 'cancel': this.showReportSheet = true; this.getCancelReason(); break; case 'report': this.showReportSheet = true; this.getReportOptions(); break; case 'remindAudit': this.submitRemindAudit(); break; case 'complaint': uni.navigateTo({ url: "/pages-mine/pages/complaint?orderId=".concat(this.order.orderId) }); break; case 'compensation': this.$emit('compensation', this.order); break; } }, submitCancel: function submitCancel(reason) { var _this5 = this; var params = { orderId: this.order.orderId, reason: reason }; uni.$u.http.post('/token/order/userCancel', params).then(function (res) { if (res.code === 200) { uni.showToast({ title: '您的订单已取消', icon: 'none' }); _this5.$emit('success'); _this5.successFeedback(); } }); }, //提醒审核 submitRemindAudit: function submitRemindAudit() { uni.$u.http.post('/api/token/order/urgeOrder', { orderId: this.order.orderId }).then(function (res) { if (res.code === 200) { uni.showToast({ title: '已提醒给管理员进行加急审核', icon: 'none' }); } else { uni.showToast({ title: res.msg, icon: 'none' }); } }); } } }; exports.default = _default; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"])) /***/ }) }]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages-mine/common/vendor.js.map