index-legacy.bfa479a5.js 9.4 KB

1234567891011
  1. ;(function(){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 __vite_style__=document.createElement('style');__vite_style__.innerHTML="body{--van-cart: #ff4e19}._item_2zuar_4 .van-card{background:#fff;flex:1;margin:0;padding:.37333rem .32rem}._item_2zuar_4 .van-card__title{font-size:.42667rem;color:#333;font-weight:400;line-height:.58667rem;max-height:1.17333rem}._item_2zuar_4 .van-card__desc{font-size:.37333rem;color:#999;font-weight:400;line-height:.53333rem;max-height:1.06667rem;white-space:break-spaces}._item_2zuar_4 .van-card__thumb{width:auto;height:auto}._item_2zuar_4 .van-image{width:2.66667rem!important;height:2.66667rem!important;border-radius:.21333rem;overflow:hidden}._item_2zuar_4 .van-card__price{color:var(--van-cart)}._shopOrderDetail_ahtdt_1{padding:.32rem .37333rem}._shopOrderDetail_ahtdt_1 .van-cell__title{font-size:.37333rem;color:#999}._shopOrderDetail_ahtdt_1 .van-cell__value{font-size:.37333rem;color:#333}body{background:#f7f8f9}._box_ahtdt_15{background:#fff;border-radius:.26667rem;overflow:hidden;margin-bottom:.32rem;padding:.37333rem}._box_ahtdt_15 .van-card{background:transparent;padding:0}._box_ahtdt_15 .van-cell-group__title{font-size:.42667rem;color:#333;font-weight:500}._addressDetail_ahtdt_31 .van-cell__title{flex:none}._copyWrap_ahtdt_34{display:flex;align-items:center;justify-content:flex-end}\n";document.head.appendChild(__vite_style__);System.register(['./index-legacy.4b2d517a.js','./vendor-legacy.73abbe39.js','./index-legacy.f25f109a10.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a.js','./cart-legacy.e8d257f5.js','./index-legacy.f25f109a4.js','./index-legacy.f25f109a9.js','./index-legacy.f25f109a12.js','./shop-mall-legacy.9b596ca0.js'],function(exports){'use strict';var moneyFormat,request,defineComponent,createVNode,Card,useRoute,ref,onMounted,Divider,Cell,CellGroup,Button,createTextVNode,Fragment,Toast,formateAttr,orderState;return{setters:[function(module){moneyFormat=module.m;request=module.r;},function(module){defineComponent=module.d;createVNode=module.b;Card=module.a3;useRoute=module.a4;ref=module.M;onMounted=module.a5;Divider=module.Z;Cell=module.p;CellGroup=module.m;Button=module.B;createTextVNode=module.j;Fragment=module.F;Toast=module.T;},function(){},function(){},function(){},function(module){formateAttr=module.f;},function(){},function(){},function(){},function(module){orderState=module.o;}],execute:function execute(){var item="_item_2zuar_4";var styles$1={item:item};var ShopItem=defineComponent({name:'shop-item',props:{item:{type:Object,default:{productPic:'',productName:'',productAttr:'',productPrice:0,productQuantity:0}}},setup:function setup(_ref){var item=_ref.item;return function(){return createVNode(Card,{"class":styles$1.item,"thumb":item.productPic,"title":item.productName,"desc":formateAttr(item.productAttr),"price":moneyFormat(item.productPrice),"num":item.productQuantity},null);};}});var shopOrderDetail="_shopOrderDetail_ahtdt_1";var box="_box_ahtdt_15";var addressDetail="_addressDetail_ahtdt_31";var copyWrap="_copyWrap_ahtdt_34";var styles={shopOrderDetail:shopOrderDetail,box:box,addressDetail:addressDetail,copyWrap:copyWrap};var index=exports('default',defineComponent({name:'shop-order-detail',setup:function setup(){var route=useRoute();var items=ref([]);var order=ref({});var getOrderInfo=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var id,_yield$request$get,code,data;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:id=route.query.id;if(id){_context.next=3;break;}return _context.abrupt("return");case 3:_context.prev=3;_context.next=6;return request.get("/api-mall-portal/order/detail/".concat(id));case 6:_yield$request$get=_context.sent;code=_yield$request$get.code;data=_yield$request$get.data;if(code===200){items.value=data.orderItemList;delete data.orderItemList;order.value=data;order.value.address_data=[data.receiverProvince,data.receiverCity,data.receiverRegion,data.receiverDetailAddress].join('');}_context.next=14;break;case 12:_context.prev=12;_context.t0=_context["catch"](3);case 14:case"end":return _context.stop();}}},_callee,null,[[3,12]]);}));return function getOrderInfo(){return _ref2.apply(this,arguments);};}();onMounted(function(){getOrderInfo();});var copyText=function copyText(text){// 数字没有 .length 不能执行selectText 需要转化成字符串
  2. var textString=text.toString();var input=document.querySelector('#copy-input');if(!input){input=document.createElement('input');input.id='copy-input';input.readOnly=true;// 防止ios聚焦触发键盘事件
  3. input.style.position='absolute';input.style.left='-1000px';input.style.zIndex='-1000';document.body.appendChild(input);}input.value=textString;// ios必须先选中文字且不支持 input.select();
  4. selectText(input,0,textString.length);console.log(document.execCommand('copy'),'execCommand');if(document.execCommand('copy')){document.execCommand('copy');Toast('复制成功');}input.blur();// input自带的select()方法在苹果端无法进行选择,所以需要自己去写一个类似的方法
  5. // 选择文本。createTextRange(setSelectionRange)是input方法
  6. function selectText(textbox,startIndex,stopIndex){if(textbox.createTextRange){//ie
  7. var range=textbox.createTextRange();range.collapse(true);range.moveStart('character',startIndex);//起始光标
  8. range.moveEnd('character',stopIndex-startIndex);//结束光标
  9. range.select();//不兼容苹果
  10. }else{//firefox/chrome
  11. textbox.setSelectionRange(startIndex,stopIndex);textbox.focus();}}};return function(){var _order$value,_order$value2,_order$value3,_order$value4,_order$value5,_order$value6,_order$value7;return createVNode(Fragment,null,[items.value.length?createVNode("div",{"class":styles.shopOrderDetail},[createVNode("div",{"class":styles.box},[items.value.map(function(item,index){return createVNode("div",null,[createVNode(ShopItem,{"item":item},null),index===items.value.length-1?null:createVNode(Divider,null,null)]);})]),createVNode("div",{"class":styles.box,"style":{padding:0}},[createVNode(Cell,{"border":false,"title":"商品价格:","value":'¥ '+moneyFormat((_order$value=order.value)===null||_order$value===void 0?void 0:_order$value.totalAmount)},null),createVNode(Cell,{"border":false,"title":"优惠价格:","value":'-¥ '+moneyFormat((_order$value2=order.value)===null||_order$value2===void 0?void 0:_order$value2.couponAmount)},null),createVNode(Cell,{"border":false,"title":"订单状态:","value":orderState[(_order$value3=order.value)===null||_order$value3===void 0?void 0:_order$value3.status]},null),createVNode(Cell,{"border":false,"title":"收货状态:","value":(_order$value4=order.value)!==null&&_order$value4!==void 0&&_order$value4.confirmStatus?'已确认收货':'未确认收货'},null),createVNode(Divider,{"style":{margin:0}},null),createVNode(Cell,{"border":false,"title":"订单号:","value":(_order$value5=order.value)===null||_order$value5===void 0?void 0:_order$value5.orderSn},null),createVNode(Cell,{"border":false,"title":"创建时间:","value":(_order$value6=order.value)===null||_order$value6===void 0?void 0:_order$value6.createTime},null),createVNode(Cell,{"border":false,"title":"付款时间:","value":(_order$value7=order.value)===null||_order$value7===void 0?void 0:_order$value7.paymentTime},null)]),createVNode("div",{"class":styles.box,"style":{padding:0}},[createVNode(CellGroup,{"title":"收货信息","border":false},{default:function _default(){var _order$value8,_order$value9,_order$value10,_order$value11;return[createVNode(Cell,{"border":false,"title":"姓名:","value":(_order$value8=order.value)===null||_order$value8===void 0?void 0:_order$value8.receiverName},null),createVNode(Cell,{"border":false,"title":"手机号:","value":(_order$value9=order.value)===null||_order$value9===void 0?void 0:_order$value9.receiverPhone},null),createVNode(Cell,{"class":styles.addressDetail,"border":false,"title":"地址:","value":(_order$value10=order.value)===null||_order$value10===void 0?void 0:_order$value10.address_data},null),createVNode(Cell,{"class":styles.addressDetail,"border":false,"title":"物流公司(配送方式):","value":(_order$value11=order.value)===null||_order$value11===void 0?void 0:_order$value11.deliveryCompany},null),createVNode(Cell,{"class":styles.addressDetail,"border":false,"title":"运单编号:"},{value:function value(){var _order$value12,_order$value13;return createVNode("div",{"class":styles.copyWrap},[createVNode("span",{"style":{marginRight:'8px'}},[(_order$value12=order.value)===null||_order$value12===void 0?void 0:_order$value12.deliverySn]),((_order$value13=order.value)===null||_order$value13===void 0?void 0:_order$value13.deliverySn)&&createVNode(Button,{"size":"mini","onClick":function onClick(evt){var _order$value14;copyText((_order$value14=order.value)===null||_order$value14===void 0?void 0:_order$value14.deliverySn);}},{default:function _default(){return[createTextVNode("\u70B9\u51FB\u590D\u5236")];}})]);}})];}})])]):null]);};}}));}};});})();