1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_goods_collection-index"],{"2eb0":function(t,e,o){"use strict";o.r(e);var i=o("f039"),n=o("897d");for(var a in n)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(a);o("8ac1");var r=o("828b"),c=Object(r["a"])(n["default"],i["b"],i["c"],!1,null,"2cebcfd1",null,!1,i["a"],void 0);e["default"]=c.exports},"3ac9":function(t,e,o){"use strict";o("6a54");var i=o("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o("dd2b"),o("c223"),o("bf0f"),o("2797"),o("8f71"),o("aa9c");var n=o("7e00"),a=o("4a82"),r=o("d727"),c=o("8f59"),s=o("96e0"),u=o("aa10"),d=i(o("23ab")),l=o("e44d"),f={components:{easyLoadimage:d.default},data:function(){return{hostProduct:[],loadTitle:"加载更多",loading:!1,loadend:!1,collectProductList:[],checkedArr:[],limit:10,page:1,hotScroll:!1,hotPage:1,hotLimit:10,domain:u.HTTP_REQUEST_URL,storeList:[],isScroll:!0,storePage:1,storeLimit:10,total:0,isEdit:!1,isAllSelect:!1,tabIndex:1,tabList:[{title:"商品"},{title:"店铺"}]}},computed:(0,s.configMap)({recommend_switch:0,hide_mer_status:0},(0,c.mapGetters)(["isLogin","viewColor","keyColor"])),onLoad:function(t){this.tabIndex=t.tab||1,this.isLogin?(this.get_user_collect_product(),this.getList()):(0,l.toLogin)()},methods:{handleEdit:function(){this.isEdit=!this.isEdit},goStore:function(t){1!=this.hide_mer_status&&uni.navigateTo({url:"/pages/store/home/index?id=".concat(t.merchant.mer_id)})},goDetail:function(t){var e=this;(0,a.goShopDetail)(t,this.uid).then((function(o){e.isLogin?(0,r.initiateAssistApi)(t.activity_id).then((function(t){var e=t.data.product_assist_set_id;uni.hideLoading(),uni.navigateTo({url:"/pages/activity/assist_detail/index?id="+e})})).catch((function(t){uni.showToast({title:t,icon:"none"})})):(0,l.toLogin)()}))},bindTab:function(t){this.tabIndex=t+1},bindDetele:function(t,e){var o=this;(0,n.userCollectDel)({type:10,type_id:[t.type_id]}).then((function(t){uni.showToast({title:"已取消",icon:"none"}),o.storeList.splice(e,1)}))},getList:function(){var t=this;this.isScroll&&(0,n.getMerchantLst)({page:this.storePage,limit:this.storeLimit}).then((function(e){t.isScroll=e.data.list.length>=t.limit,t.storeList=t.storeList.concat(e.data.list),t.storePage+=1}))},get_user_collect_product:function(){var t=this;t.loading||t.loadend||(t.loading=!0,t.loadTitle="",(0,n.getCollectUserList)({page:t.page,limit:t.limit}).then((function(e){t.total=e.data.count;var o=e.data.list,i=o.length<t.limit;o.forEach((function(e,o){e.check||t.$set(e,"check",!1)})),t.collectProductList=t.$util.SplitArray(o,t.collectProductList),t.$set(t,"collectProductList",t.collectProductList),t.loadend=i,t.loadTitle=i?"我也是有底线的":"加载更多",t.page=t.page+1,t.loading=!1})).catch((function(e){t.loading=!1,t.loadTitle="加载更多"})))},subCollect:function(){var t=this;(0,n.userCollectDel)({type:1,type_id:t.getSelectGoods()}).then((function(e){return t.$util.Tips({title:"取消收藏成功",icon:"success"},(function(){t.reloadData()}))})).catch((function(e){return t.$util.Tips({title:e})}))},reloadData:function(){var t=this;this.checkedArr.forEach((function(e,o){t.collectProductList=t.collectProductList.filter((function(t){return t!=e}))})),this.total-=this.checkedArr.length},collectCheck:function(t){t.check=!t.check,this.cartAllCheck("goodsCheck")},checkboxAllChange:function(){this.isAllSelect=!this.isAllSelect,this.cartAllCheck("allCheck")},cartAllCheck:function(t){var e=this,o=[];this.collectProductList.forEach((function(i,n){"goodsCheck"==t||(i.check=e.isAllSelect),i.check&&o.push(i)})),this.checkedArr=o,this.isAllSelect=o.length==this.collectProductList.length},getSelectGoods:function(){var t=[];return this.collectProductList.forEach((function(e,o){e.check&&t.push(e.type_id)})),t}},onReachBottom:function(){1==this.tabIndex?this.get_user_collect_product():this.getList()},onPageScroll:function(t){uni.$emit("scroll")}};e.default=f},"4a82":function(t,e,o){"use strict";o("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.goShopDetail=fun
|