平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
15 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"1b51":function(t,e,o){"use strict";(function(t,n){var i=o("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(o("7eb4")),s=i(o("ee10")),u=o("8f59"),r={computed:(0,u.mapState)(["userId","shopIndex","avatar"]),data:function(){return{type:"",src:"http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg",inventoryList:[],settingShow:!1,isCancel:!1,showFormula:!1,chartData:{},showDan:"",returnList:new Map,shopName:"",waimaiRight:"-70rpx",showDayPrice:!1,shijiPrice:!1,opts:{padding:[15,10,0,15],dataLabel:!0,dataPointShape:!1,enableScroll:!1,legend:{},xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2,data:[{min:0}]},extra:{column:{type:"group",width:30,customColor:["#44fd6d","#91CB74"],activeBgColor:"#000000",activeBgOpacity:.08,seriesGap:10,barBorderCircle:!0,barBorderRadius:[20,20,0,0],linearType:"custom"}}},shopInfo:{totalAmount:0,totalAlreadyEarn:0,totalPayAmount:0,totalCCount:0,totalCount:0,totalJCount:0,totalProfit:0,saleReturnCost:0,returnTotalAmount:0,returnTotalCount:0,totalAlreadyEarnDetail:0},waitCount:{},enDayShow:!1,endDay:"",textArr:[]}},components:{cmdNavBar:function(){o.e("components/cmd-nav-bar/cmd-nav-bar").then(function(){return resolve(o("63fc"))}.bind(null,o)).catch(o.oe)}},filters:{spliceMsg:function(t){return t}},onLoad:function(){var e=this;t.getLocation({type:"gcj02",success:function(t){}}),n.getStorage({key:"shopName",success:function(t){e.shopName=t.data}}),n.getStorage({key:"type",success:function(t){e.type=t.data}});var o=new Date,i=o.getDate();n.getStorageSync("publicize")==i||(n.setStorageSync("publicize",i),this.$refs.publicizepopup.open("center")),this.getSaleInfo(),this.getEndTime()},onTabItemTap:function(t){this.getSaleInfo()},methods:{getEndTime:function(){var t=this;this.textArr=[],this.tui.request("/app/shop/getShopInfoById","post",{id:n.getStorageSync("shopId")},!1,!0).then((function(e){n.setStorageSync("endTime",e.result.endTime),t.endTime=e.result.endTime,t.endDay=t.daysUntil(e.result.endTime),t.endDay<7&&(t.enDayShow=!0)})),setTimeout((function(e){if(void 0!=t.endTime){var o="您的店铺有效期至"+t.endTime+",还有"+t.endDay+"天到期,请及时联系管理员续费或开通";t.textArr.push(o),console.log(t.textArr)}}),500)},daysUntil:function(t){var e=new Date(t),o=new Date,n=e-o,i=Math.ceil(n/864e5);return i},changeFormula:function(t){var e=this;console.log(t),this.showFormula=!0,this.showDan=t,setTimeout((function(t){e.showFormula=!1}),2e3)},popClose:function(){this.$refs.publicizepopup.close()},getReturnOrder:function(t){var e=this;return(0,s.default)(a.default.mark((function o(){var n;return a.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:return n=e,o.next=3,e.tui.request("/app/return/list","post",{remark:3,saleId:t},!1,!1).then((function(t){200==t.code&&null!=t.result&&void 0!=t.result?""!=t.result&&t.result.forEach((function(t){e.tui.request("/app/return/get/"+t.id,"GET",null,!1,!1).then((function(t){if(200==t.code&&null!=t.result&&void 0!=t.result)for(var e=0;e<t.result.saleDetailDTOList.length;e++){t.result.saleDetailDTOList[e].returnPrice=t.result.saleDetailDTOList[e].discountAmount,t.result.saleDetailDTOList[e].stockLogList=new Map,n.returnList.set(t.result.saleDetailDTOList[e].productId,t.result.saleDetailDTOList[e]);for(var o=0;o<t.result.saleDetailDTOList[e].stockLogList1.length;o++)t.result.saleDetailDTOList[e].stockLogList1[o].productCount=0-t.result.saleDetailDTOList[e].stockLogList1[o].productCount,n.returnList.get(t.result.saleDetailDTOList[e].productId).stockLogList.set(t.result.saleDetailDTOList[e].stockLogList1[o].attributeList,t.result.saleDetailDTOList[e].stockLogList1[o])}})).catch((function(t){}))})):e.tui.toast(t.message)}));case 3:case"end":return o.stop()}}),o)})))()},cancelOrder:function(t,e){var o=this;return(0,s.default)(a.default.mark((function n(){var i;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=o,n.next=3,o.getReturnOrder(t.id);case 3:return n.next=5,o.tui.modal("提示","goPay"==e?"您确定要撤销订单并重新开单吗?":"您确定要撤销订单吗?",!0,(function(o){o?i.cancelSale(t,e):i.returnList=new Map}));case 5:case"end":return n.stop()}}),n)})))()},cancelSale:function(t,e){var o=this;this.tui.request("/app/sale/cancelSale","POST",{id:t.id},!0,!0).then((function(n){200==n.code?"goPay"==e?(o.isCancel=!0,o.goSaleGoods(t,"cancel")):o.getSaleInfo():o.tui.toast(res.message)})).catch((function(t){}))},getOrderInfoList:function(t,e){var o=this;0==t.status||1==t.status?this.tui.request("/app/sale/status","POST",{status:4,orderId:t.id},!0,!0).then((function(n){200==n.code?o.cancelSale(t,e):o.tui.toast(res.message)})).catch((function(t){})):this.cancelSale(t,e)},sliceMsg:function(t){var e="";if("string"==typeof t){var o=JSON.parse(t);for(var n in o)e+=o[n]+"/"}return e},goSaleGoods:function(t,e){var o=this,i=[];if(null!=t.saleDetailDTOList&&""!=t.saleDetailDTOList||(t.saleDetailDTOList=[]),this.returnList.forEach((function(e,o){t.saleDetailDTOList.push(e)})),t.saleDetailDTOList)for(var a=0;a<t.saleDetailDTOList.length;a++){for(var s={},u=new Map,r=[],l=0,c=0;c<t.saleDetailDTOList[a].stockLogList1.length;c++)if(1==u.has(t.saleDetailDTOList[a].stockLogList1[c].attributeList)){var d=u.get(t.saleDetailDTOList[a].stockLogList1[c].attributeList);r[d].productCount=Number(r[d].productCount)+Number(t.saleDetailDTOList[a].stockLogList1[c].productCount),1==this.isCancel&&(r[d].stockCount=r[d].stockCount+r[d].productCount)}else t.saleDetailDTOList[a].stockLogList1[c].name=this.sliceMsg(t.saleDetailDTOList[a].stockLogList1[c].attributeList),1==this.isCancel&&(t.saleDetailDTOList[a].stockLogList1[c].stockCount=t.saleDetailDTOList[a].stockLogList1[c].stockCount+t.saleDetailDTOList[a].stockLogList1[c].productCount),r.push(t.saleDetailDTOList[a].stockLogList1[c]),u.set(t.saleDetailDTOList[a].stockLogList1[c].attributeList,l),l++;s.saleDetailQueryDTO=r,s.num=0,s.id=t.saleDetailDTOList[a].productId,s.attrId=t.saleDetailDTOList[a].attrId,s.buyCount=t.saleDetailDTOList[a].buyCount-1,s.price=t.saleDetailDTOList[a].price,s.lsprice=t.saleDetailDTOList[a].price,s.discount=t.saleDetailDTOList[a].discount,s.categoryId=t.saleDetailDTOList[a].categoryId,s.zPrice=t.saleDetailDTOList[a].discountAmount,s.customerCategoryRule=null!=t.saleDetailDTOList[a].customerCategoryRule?JSON.parse(t.saleDetailDTOList[a].customerCategoryRule):null,s.productName=t.saleDetailDTOList[a].productName,null!=t.saleDetailDTOList[a].productPicture&&""!=t.saleDetailDTOList[a].productPicture?s.productPicture=t.saleDetailDTOList[a].productPicture+"?time="+(new Date).getTime():s.productPicture="",s.productSn=t.saleDetailDTOList[a].productSn,s.wholesalePrice=t.saleDetailDTOList[a].wholesalePrice,s.discountAmount=t.saleDetailDTOList[a].discountAmount,s.returnPrice=t.saleDetailDTOList[a].returnPrice,s.saleId=t.id,s.remark=t.remark,s.xsyId=t.createBy,s.createByName=t.createByName,s.unitPrice="cancel"==e?this.getUnitPrice(t,t.saleDetailDTOList[a]):t.saleDetailDTOList[a].discountAmount,i.push(s)}else{var p={num:0,price:0};p.saleId=t.id,p.remark=t.remark,p.xsyId=t.createBy,p.createByName=t.createByName,i.push(p)}this.$nextTick((function(){o.tui.request("/app/debt/selectByUserId","post",{shopId:n.getStorageSync("shopId"),userId:t.userId},!1,!0).then((function(e){200==e.code&&(o.returnList=new Map,e.result.noEarn=e.result.amountOwed,e.result.name=e.result.userName,e.result.id=t.userId,n.setStorageSync("khName",JSON.stringify(e.result)),n.setStorageSync("carList1",JSON.stringify(i)),n.setStorageSync("discountAll",null!=t.discount?t.discount:10),n.setStorageSync("hangOrder",!0),n.switchTab({url:"/pages/inventory/goodsList1"}))}))}))},getUnitPrice:function(t,e){return 10!=t.discount?null==t.discount||0==t.discount||void 0==t.discount?e.discountAmount:(1e4*e.discountAmount/(100*t.discount)/10).toFixed(2):10!=e.discount?null==e.discount||0==e.discount||void 0==e.discount?e.discountAmount:(1e4*e.discountAmount/(100*e.discount)/10).toFixed(2):e.discountAmount||e.wholesalePrice},getSaleInfo:function(){var t=this;this.shopInfo={totalAmount:0,totalAlreadyEarn:0,totalPayAmount:0,totalCCount:0,totalCount:0,totalJCount:0,totalProfit:0,saleReturnCost:0,returnTotalAmount:0,returnTotalCount:0,totalAlreadyEarnDetail:0},this.inventoryList=[],this.tui.request("/app/sale/getShopAll","POST",{pageVo:{pageSize:5,pageNumber:1}},!1,!1).then((function(e){if(200==e.code){t.shopInfo={totalAmount:e.result.totalAmount,totalAlreadyEarn:e.result.totalAlreadyEarn,totalPayAmount:e.result.totalPayAmount,totalCCount:e.result.totalCCount,totalCount:e.result.totalCount,totalJCount:e.result.totalJCount,totalProfit:e.result.totalProfit,saleReturnCost:e.result.saleReturnCost,returnTotalAmount:e.result.returnTotalAmount,returnTotalCount:e.result.returnTotalCount,totalAlreadyEarnDetail:e.result.totalAlreadyEarnDetail};var o={categories:t.getWeek(),series:[{name:"七天营收统计",linearColor:[[0,"#1890FF"],[.33,"#00B5FF"],[.66,"#00D1ED"],[1,"#00E6BB"],[1,"#90F489"]],setShadow:[3,8,10,"#00E6BB"],data:e.result.weekSale}]};t.chartData=JSON.parse(JSON.stringify(o)),t.waitCount=e.result.countMap;for(var n=0;n<e.result.salePage.records.length;n++)e.result.salePage.records[n].img="/static/images/dingdan/dd"+n+".png",t.inventoryList=e.result.salePage.records}else t.tui.toast(e.message)}))},goToInfo:function(){this.settingShow=!0},quwaimai:function(){var t=this;"-70rpx"==this.waimaiRight?this.waimaiRight="20rpx":n.openEmbeddedMiniProgram({appId:"wxf5362b6e97ecee2f"}),setTimeout((function(e){t.waimaiRight="-70rpx"}),2e3)},gotoSearchData:function(){n.navigateTo({url:"/package1/index/dataStatistics"})},showPayType:function(){var t=this;this.showDayPrice=!0,setTimeout((function(e){t.showDayPrice=!1}),2e3)},outLogin:function(t){var e=this;n.showModal({title:"提示",content:"确定退出登录吗?",success:function(t){t.confirm&&e.tui.request("/oauth2/logout","POST",{},!1,!1).then((function(t){200==t.code?(e.tui.toast("退出登录成功"),n.removeStorage({key:"hiver_token"}),n.navigateTo({url:"/pages/login/login"})):e.tui.toast(t.message)}))}})},getWeek:function(){var t=["周日","周一","周二","周三","周四","周五","周六"],e=Array.from({length:7},(function(t,e){return e})).map((function(e){var o=new Date;return o.setDate(o.getDate()-e),t[o.getDay()]}));return e.reverse()},gotoDetail:function(t){n.navigateTo({url:"/package1/index/orderDetail?id="+t})},goSonPage:function(t){"/package1/index/waitStorage?inStorageStatus=0"!=t||0==this.type?n.navigateTo({url:t}):this.tui.toast("暂无查看权限!")}}};e.default=r}).call(this,o("3223")["default"],o("df3c")["default"])},"2eaf":function(t,e,o){"use strict";(function(t,e){var n=o("47a9");o("18e5");n(o("3240"));var i=n(o("55779"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(i.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},55779:function(t,e,o){"use strict";o.r(e);var n=o("db52"),i=o("ff22");for(var a in i)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return i[t]}))}(a);o("b356");var s=o("828b"),u=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=u.exports},"80ed":function(t,e,o){},b356:function(t,e,o){"use strict";var n=o("80ed"),i=o.n(n);i.a},db52:function(t,e,o){"use strict";o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return a})),o.d(e,"a",(function(){return n}));var n={cmdNavBar:function(){return o.e("components/cmd-nav-bar/cmd-nav-bar").then(o.bind(null,"63fc"))},uNoticeBar:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-notice-bar/u-notice-bar")]).then(o.bind(null,"76e6"))},uGrid:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-grid/u-grid")]).then(o.bind(null,"119a"))},uGridItem:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-grid-item/u-grid-item")]).then(o.bind(null,"5dcd"))},uCountTo:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-count-to/u-count-to")]).then(o.bind(null,"3fff"))},uniIcons:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(o.bind(null,"c5b1"))},qiunDataCharts:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts")]).then(o.bind(null,"254a"))},uniCard:function(){return o.e("uni_modules/uni-card/components/uni-card/uni-card").then(o.bind(null,"05b0"))},uEmpty:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-empty/u-empty")]).then(o.bind(null,"94c2"))},uPopup:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(o.bind(null,"b45bc"))},uCellGroup:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-cell-group/u-cell-group")]).then(o.bind(null,"9bd1"))},uCell:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-cell/u-cell")]).then(o.bind(null,"678a"))},uniPopup:function(){return o.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(o.bind(null,"c64c"))}},i=function(){var t=this,e=t.$createElement,o=(t._self._c,0==t.type?(t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null),n=t.inventoryList.length,i=t.showDayPrice?t.shopInfo.totalAlreadyEarnDetail.length:null,a=!t.showFormula||3!=t.showDan||0==t.shopInfo.totalProfit&&0==t.shopInfo.totalAmount?null:(t.shopInfo.totalProfit/t.shopInfo.totalAmount*100).toFixed(2),s=t.showFormula&&2==t.showDan?(t.shopInfo.totalAmount-(t.shopInfo.totalAmount-t.shopInfo.totalProfit)-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null,u=t.showFormula&&2==t.showDan&&t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost!=0?((t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost)/(t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount)*100).toFixed(2):null,r=t.showFormula&&1==t.showDan?(t.shopInfo.totalAmount-(t.shopInfo.totalAmount-t.shopInfo.totalProfit)-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null,l=t.shijiPrice?(t.shopInfo.totalAmount-t.shopInfo.totalProfit).toFixed(2):null,c=t.shijiPrice?(t.shopInfo.totalAmount-(t.shopInfo.totalAmount-t.shopInfo.totalProfit)-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null,d=t.shijiPrice&&0!=t.shopInfo.totalProfit&&null!=t.shopInfo.totalProfit&&0!=t.shopInfo.totalAmount&&null!=t.shopInfo.totalAmount?(t.shopInfo.totalProfit/t.shopInfo.totalAmount*100).toFixed(2):null,p=t.shijiPrice&&t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost!=0&&t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost!=null&&t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount!=0&&t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount!=null?((t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost)/(t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount)*100).toFixed(2):null;t._isMounted||(t.e0=function(e){t.shijiPrice=!0},t.e1=function(e){t.settingShow=!1},t.e2=function(e){t.shijiPrice=!1}),t.$mp.data=Object.assign({},{$root:{g0:o,g1:n,g2:i,g3:a,g4:s,g5:u,g6:r,g7:l,g8:c,g9:d,g10:p}})},a=[]},ff22:function(t,e,o){"use strict";o.r(e);var n=o("1b51"),i=o.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(a);e["default"]=i.a}},[["2eaf","common/runtime","common/vendor"]]]);