1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-drugspush-drugsPush"],{"263c":function(t,e,i){"use strict";var a=i("4ea4");i("99af"),i("caad"),i("2532"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("b742"),o=i("37f6"),r=a(i("8e28")),c=a(i("bd50")),s=a(i("d107")),f={data:function(){return{showTab:!0,isCheckBox:!1,pattern:{buttonColor:"#307aff"},currentTabIndex:0,chooseClassifyIndex:0,page:1,pageSize:10,loadingType:0,page0:1,pageSize0:10,loadingType0:0,page1:1,pageSize1:10,loadingType1:0,page2:1,pageSize2:10,loadingType2:0,contentText:{contentdown:"上拉加载更多",contentrefresh:"正在加载...",contentnomore:"没有更多数据了"},index:0,kinds:["熟食","凉菜","热菜","蔬菜","主食","水果"],foodName:"",reason:"",materialName:"",imgs:[],userId:(0,n.getStorage)("userInfo").id,foodList:[],title:"checkbox 复选框",newfoodList:[],dateInfo:null,cindex:1,content:[{text:"发布",iconPath:"/static/icons/fb.png"},{text:"推荐",iconPath:"/static/icons/fb.png"}],mydrugsList:[],publicdrugsList:[],releaseDrugsList:[]}},watch:{currentTabIndex:function(t,e){0==t?(this.page0=1,this.loadingType0=0,this.getReleaseDrugsList()):1==t?(this.cancel(),this.page1=1,this.loadingType1=0,this.getPublicDrugsPush()):2==t&&(this.page2=1,this.loadingType2=0,this.getMySubmitDrugsPush())}},components:{loadMore:r.default,contentNone:c.default,uniFab:s.default},onLoad:function(t){this.currentTabIndex=t.currentTabIndex||0,0==this.currentTabIndex?(this.page0=1,this.loadingType0=0,this.getReleaseDrugsList()):1==this.currentTabIndex?(this.cancel(),this.page1=1,this.loadingType1=0,this.getPublicDrugsPush()):2==this.currentTabIndex&&(this.page2=1,this.loadingType2=0,this.getMySubmitDrugsPush())},methods:{checkboxChange:function(t){for(var e=this.publicdrugsList,i=t.detail.value,a=0,n=e.length;a<n;++a){var o=e[a];i.includes(o.id)?this.$set(o,"checked",!0):this.$set(o,"checked",!1)}},cancel:function(){this.isCheckBox=!1,this.showTab=!0},trigger:function(t){0==t.index?1==this.cindex&&(this.isCheckBox=!0,this.showTab=!1):1==t.index&&uni.navigateTo({url:"/pages/drugspush/drugspush-add"})},getMySubmitDrugsPush:function(){var t=this,e={method:o.getMySubmitDrugsPush,data:{creator:this.userId,pageNum:this.page2,pageSize:this.pageSize2}};(0,n.callbackRequest)(e).then((function(e){1==e.data.returnCode&&(e=e.data,1==t.page2?(t.mydrugsList=e.returnData||[],console.log(t.mydrugsList)):e.returnData.length>0?(t.mydrugsList=t.mydrugsList.concat(e.returnData),t.loadingType2=0):t.loadingType2=2)}))},getPublicDrugsPush:function(){var t=this,e={method:o.getPublicDrugsPush,data:{creator:this.userId,pageNum:this.page1,pageSize:this.pageSize1}};(0,n.callbackRequest)(e).then((function(e){1==e.data.returnCode&&(e=e.data,1==t.page1?t.publicdrugsList=e.returnData||[]:e.returnData.length>0?(t.publicdrugsList=t.publicdrugsList.concat(e.returnData),t.loadingType1=0):t.loadingType1=2)}))},getReleaseDrugsList:function(){var t=this,e={method:o.getReleaseDrugsList,data:{creator:this.userId,pageNum:this.page0,pageSize:this.pageSize0}};(0,n.callbackRequest)(e).then((function(e){1==e.data.returnCode&&(e=e.data,1==t.page0?t.releaseDrugsList=e.returnData||[]:e.returnData.length>0?(t.releaseDrugsList=t.releaseDrugsList.concat(e.returnData),t.loadingType0=0):t.loadingType0=2)}))},vote:function(t,e){var i=this,a={method:o.drugsPushVote,data:{voteUser:this.userId,featureId:e}};(0,n.callbackRequest)(a).then((function(e){1==e.data.returnCode?(i.publicdrugsList[t].vote_no++,i.publicdrugsList[t].is_vote=1):(0,n.alertTip)(e.data.returnMsg)}))},submitDrugsRelease:function(){for(var t="",e=0;e<this.publicdrugsList.length;e++)0!=e&&(t+=","),this.publicdrugsList[e].checked&&(t+=this.publicdrugsList[e].id);var i={method:o.submitDrugsRelease,data:{creator:this.userId,ids:t}};(0,n.callbackRequest)(i).then((function(t){t=t.data,1==t.returnCode?((0,n.alertTip)(t.returnMsg),setTimeout((function(){uni.navigateTo({url:"/pages/drugspush/drugsPush?currentTabIndex=0"})}),1500)):(0,n.alertTip)(t.returnMsg)}))}},onReachBottom:function(){if(0==this.currentTabIndex
|