12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order-info/order-info"],{156:function(e,n,o){"use strict";(function(e,n){var t=o(4);o(26);t(o(25));var r=t(o(157));e.__webpack_require_UNI_MP_PLUGIN__=o,n(r.default)}).call(this,o(1)["default"],o(2)["createPage"])},157:function(e,n,o){"use strict";o.r(n);var t=o(158),r=o(160);for(var a in r)["default"].indexOf(a)<0&&function(e){o.d(n,e,(function(){return r[e]}))}(a);o(162);var i,s=o(32),c=Object(s["default"])(r["default"],t["render"],t["staticRenderFns"],!1,null,"765d0d26",null,!1,t["components"],i);c.options.__file="pages/order-info/order-info.vue",n["default"]=c.exports},158:function(e,n,o){"use strict";o.r(n);var t=o(159);o.d(n,"render",(function(){return t["render"]})),o.d(n,"staticRenderFns",(function(){return t["staticRenderFns"]})),o.d(n,"recyclableRender",(function(){return t["recyclableRender"]})),o.d(n,"components",(function(){return t["components"]}))},159:function(e,n,o){"use strict";var t;o.r(n),o.d(n,"render",(function(){return r})),o.d(n,"staticRenderFns",(function(){return i})),o.d(n,"recyclableRender",(function(){return a})),o.d(n,"components",(function(){return t}));try{t={tkiQrcode:function(){return Promise.all([o.e("common/vendor"),o.e("components/tki-qrcode/tki-qrcode")]).then(o.bind(null,186))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var e=this,n=e.$createElement,o=(e._self._c,e.orderInfo.user&&e.orderInfo.user?e._f("getName")(e.orderInfo.user.nickname,e.orderInfo.user.phone?10:16):null),t=e._f("getName")(e.storeInfo.name,15),r=e.__map(e.orderInfo.goods,(function(n,o){var t=e.__get_orig(n),r=n.sku[0].price!=n.vip_price?Number(n.price)-Number(n.vip_price)||0:null,a=e.subNum(n),i=e.subtotal(n);return{$orig:t,m0:r,m1:a,m2:i}}));e._isMounted||(e.e0=function(n){n.stopPropagation(),e.isText=!0},e.e1=function(n){e.shareShow=!1},e.e2=function(n){e.payMent(),e.showPop=!1},e.e3=function(n){e.shareNow(),e.showPop=!1},e.e4=function(n){e.showPop=!1}),e.$mp.data=Object.assign({},{$root:{f0:o,f1:t,l0:r}})},a=!1,i=[];r._withStripped=!0},160:function(e,n,o){"use strict";o.r(n);var t=o(161),r=o.n(t);for(var a in t)["default"].indexOf(a)<0&&function(e){o.d(n,e,(function(){return t[e]}))}(a);n["default"]=r.a},161:function(e,n,o){"use strict";(function(e){var t=o(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t(o(42)),a=t(o(44)),i=(o(64),o(71)),s=function(){o.e("components/hint-pop").then(function(){return resolve(o(460))}.bind(null,o)).catch(o.oe)},c=function(){o.e("components/show-modal").then(function(){return resolve(o(467))}.bind(null,o)).catch(o.oe)},d={data:function(){return{orderInfo:"",logInfo:"",storeInfo:"",isPay:!0,order_no:"",storeAds:"",orderTime:"",model:"",canvasWidth:"",canvasHeight:"",code:{val:"",size:200,icon:"",iconsize:25,onval:!0,loadMake:"",showLoading:!0,loadingText:"二维码生成中..."},shareGoods:{},poster:"",shareShow:!1,showMore:!1,isText:!1,goods_img:"",showPop:!1,showModal:!1,remark:""}},components:{hintPop:s,showModal:c},onLoad:function(n){var o=this;n.order_no&&(this.order_no=n.order_no,this.getOrder(this.order_no)),e.getSystemInfo({success:function(e){o.model=e.model,o.canvasWidth=e.windowWidth/375,o.canvasHeight=e.windowHeight}})},onShow:function(){this.storeInfo=e.getStorageSync("store");e.getStorageSync("store").address},computed:{totalNum:function(){var e=0;return this.orderInfo&&this.orderInfo.goods.map((function(n){n.sku.map((function(n){e+=n.num}))})),e},totalPrice:function(){var e=0;return this.orderInfo&&this.orderInfo.goods.map((function(n){n.sku.map((function(n){e+=n.num*n.price}))})),e}},methods:{skip:function(n){var o=this.orderInfo,t=o.order_no,r=o.user_id;if(this.showModal=!1,0===n)return e.navigateTo({url:"../../pagesA/pages/delivery-method/delivery-method?order_no="+t+"&user_id="+r}),!1;e.navigateTo({url:"../../pagesA/pages/merge-order/merge-order?order_no="+t})},scanCode:function(){e.navigateTo({url:"../../pagesA/pages/send-code/send-code?order_no="+this.orderInfo.order_no})},preview:function(){e.previewImage({current:this.poster,urls:[this.poster]})},confirmReceipt:function(n){var o=this;e.showModal({content:"你确定用户已经收到货了吗?",success:function(t){t.confirm&&(0,i.receiveOrder)({order_no:n}).then((function(n){200==n.code?e.showModal({content:"帮客户确认收货成功",showCancel:!1,success:function(e){o.orderInfo.status=3}}):e.showModal({content:n.msg||"确认收货失败",showCancel:!1})}))}})},editRemark:function(){var n=this,o=this.orderInfo,t=o.order_no,r=o.remark;(0,i.editRemark)({order_no:t,remark:r}).then((function(o){200==o.code?(n.isText=!1,e.showToast({title:"修改成功"})):e.showModal({content:o.data||"修改失败",showCancel:!1})}))},shareNow:function(){var n=this,o=this.orderInfo.goods,t=o[0].img.replaceAll("http","https");e.getImageInfo({src:t,success:function(e){n.goods_img=e.path}}),this.shareGoods={price:this.sharePrice(o),num:this.shareNum(o),name:o.length>1?o[0].main_attr+"...等":o[0].main_attr},this.code.val="".concat(this.$config.share_url,"#pages/scan-order/scan-order?order_no=").concat(this.orderInfo.order_no),this.$refs.qrcode._makeCode(),this.shareShow=!0},shareNum:function(e){var n=0;return e.map((function(e){e.sku.map((function(e){n+=e.num}))})),n},sharePrice:function(e){var n=0;return e.map((function(e){e.sku.map((function(e){n+=e.num*e.price}))})),n},drawPoster:function(n){var o=this,t=this;e.showLoading({title:"图片生成中..."});var r=t.shareGoods;e.getImageInfo({src:"https://api.wd.cliu.cc/good_poster.png",success:function(a){e.showLoading({title:"图片加载中..."});var i=e.createCanvasContext("canvas"),s=e.getStorageSync("store");s.name=s.name.length>7?s.name.slice(0,7)+"...的店铺":s.name+"的店铺";var c=t.canvasWidth;i.drawImage(a.path,0,0,270*c,480*c),i.font="normal bold 14px pingfang",i.textAlign="center",i.fillText(s.name,e.upx2px(270),e.upx2px(210)),i.drawImage(o.goods_img,e.upx2px(110),e.upx2px(270),e.upx2px(130),e.upx2px(103)),i.font="normal bold 14px pingfang",i.fillText(r.name,r.name.length>3?e.upx2px(320):e.upx2px(290),e.upx2px(300)),i.font="normal normal 12px pingfang",i.setFillStyle("#999999"),i.fillText("".concat(r.num,"套"),e.upx2px(282),e.upx2px(340)),i.font="normal bold 12px pingfang",i.setFillStyle("#FB231F"),i.fillText("¥",e.upx2px(340),e.upx2px(365)),i.font="normal bold 16px pingfang",i.setFillStyle("#FB231F"),i.fillText(r.price,e.upx2px(400),e.upx2px(365)),i.drawImage(n,e.upx2px(110),e.upx2px(420),e.upx2px(320),e.upx2px(320)),i.font="noraml bold 14px pingfang",i.textAlign="center",i.setFillStyle("#060001"),i.fillText("微信-扫一扫-支付",e.upx2px(270),e.upx2px(790)),setTimeout((function(n){i.draw(!1,(function(){e.canvasToTempFilePath({width:270*c,height:480*c,canvasId:"canvas",success:function(n){e.hideLoading();var t=n.tempFilePath.replace(/\. +/g,"");o.poster=t.replace(/[\r\n]/g,"")},fail:function(){e.hideLoading()}})}))}),500)}})},applyReturn:function(){e.navigateTo({url:"../apply-return/apply-return?order_no="+this.orderInfo.order_no})},refundDetail:function(){e.navigateTo({url:"../refund_detail/refund_detail?order_no="+this.orderInfo.order_no})},shipments:function(){var n=this,o=this.orderInfo,t=o.user_id,r=o.order_no;e.showLoading({title:"加载中..."}),(0,i.getNoSendOrder)({order_no:r}).then((function(o){if(200==o.code){var a=o.data;if(1===a.length)return e.navigateTo({url:"../../pagesA/pages/delivery-method/delivery-method?order_no="+r+"&user_id="+t}),!1;n.showModal=!0}else e.showModal({content:o.data,showCancel:!1});e.hideLoading()})).catch((function(n){e.hideLoading()}))},coutdown:function(e){var n=function(e){return e<10?"0"+e:e},o=Math.floor(Date.now()/1e3),t=Math.floor(Number(e)-o);if(t>0){var r=Math.floor(t/86400),a=Math.floor(t%86400/3600),i=Math.floor((t-86400*r-3600*a)/60),s=Math.floor(t-86400*r-3600*a-60*i);return"".concat(n(i),":").concat(n(s))}return this.timer=null,!1},getTime:function(){var e=this;if(!this.orderInfo.created_at)return!1;var n=this.orderInfo.created_at.replace(/-/g,"/"),o=new Date(n).getTime()/1e3+3600,t=Math.floor(Date.now()/1e3),r=o-t;r>0&&(this.timer=setInterval((function(){e.orderTime=e.coutdown(o)}),1e3))},cancelOrder:function(n){this.showMore=!1,e.showModal({content:"确定要取消该订单么?",success:function(o){o.confirm&&(0,i.cancelOrder)({order_id:n}).then((function(n){200==n.code?e.showModal({content:"取消订单成功",showCancel:!1,success:function(n){n.confirm&&e.reLaunch({url:"../order-manage/order-manage"})}}):e.showModal({content:n.data||"取消订单失败",showCancel:!1})}))}})},skipAudit:function(){e.navigateTo({url:"../cancel-audit/cancel-audit?order_no="+this.orderInfo.order_no})},subNum:function(e){var n=0;return e.sku.map((function(e){n+=e.num})),n},subtotal:function(e){var n=0;return e.sku.map((function(e){n+=e.num*e.price})),n},getOrder:function(n){var o=this;e.showLoading({title:"加载中..."}),(0,i.orderQuery)({order_no:n}).then((function(n){200==n.code?(o.orderInfo=n.data,o.getTime()):e.showModal({content:n.data||"获取订单详情失败",showCancel:!1}),e.hideLoading()})).catch((function(n){e.hideLoading()}))},copy:function(n){e.setClipboardData({data:n,success:function(n){e.showToast({title:"复制成功"})},fail:function(){e.showToast({title:"复制失败",icon:"none"})}})},pickUp:function(n){var o=this;(0,i.pickUp)({order_no:n}).then((function(n){200==n.code?(o.orderInfo.status=2,e.showToast({title:"成功",icon:"none"})):e.showModal({content:n.data||"失败",showCancel:!1})}))},lookLogs:function(){e.navigateTo({url:"../logistics-detail/logistics-detail?order_no="+this.orderInfo.order_no+"&img="+this.orderInfo.goods[0].img})},skipEval:function(){e.navigateTo({url:"../evaluate/evaluate"})},sendGoods:function(){e.navigateTo({url:"../send-goods/send-goods?order_no="+this.orderInfo.order_no})},payMent:function(){var n=this;return(0,a.default)(r.default.mark((function o(){return r.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(n.isPay){o.next=3;break}return e.showModal({content:"请稍后重试~",showCancel:!1}),o.abrupt("return",!1);case 3:n.isPay=!1,e.showLoading({title:"加载中..."}),(0,i.payMent)({order_no:n.orderInfo.order_no}).then((function(o){if(200===o.error_code){var t=o.data;e.requestPayment({timeStamp:t.timestamp,nonceStr:t.nonceStr,package:t.package,signType:t.signType,paySign:t.paySign,success:function(e){n.params.page_index=1,n.params.status=2,n.getOrder()},fail:function(n){e.showModal({content:"支付失败"})}})}else e.showModal({content:o.msg||"支付失败",showCancel:!1});e.hideLoading()})).catch((function(o){n.isPay=!0,e.hideLoading()})).finally((function(){setTimeout((function(){n.isPay=!0}),3e3),e.hideLoading()}));case 6:case"end":return o.stop()}}),o)})))()},callPhone:function(){if(!this.orderInfo.user.phone)return e.showToast({title:"暂无联系方式",icon:"none"}),!1;e.makePhoneCall({phoneNumber:this.orderInfo.user.phone})}}};n.default=d}).call(this,o(2)["default"])},162:function(e,n,o){"use strict";o.r(n);var t=o(163),r=o.n(t);for(var a in t)["default"].indexOf(a)<0&&function(e){o.d(n,e,(function(){return t[e]}))}(a);n["default"]=r.a},163:function(e,n,o){}},[[156,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/order-info/order-info.js.map
|