| 1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/me/myBox"],{"0843":function(t,n,e){"use strict";e.r(n);var o=e("0c91"),i=e.n(o);for(var a in o)"default"!==a&&function(t){e.d(n,t,(function(){return o[t]}))}(a);n["default"]=i.a},"0c91":function(t,n,e){"use strict";(function(t){function o(t){return c(t)||r(t)||a(t)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,n){if(t){if("string"===typeof t)return s(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(t,n):void 0}}function r(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function c(t){if(Array.isArray(t))return s(t)}function s(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u=function(){e.e("components/recycle").then(function(){return resolve(e("e95a"))}.bind(null,e)).catch(e.oe)},f={components:{recycle:u},data:function(){return{i:0,page:1,isAll:!1,pages:null,totalNumber:0,boxList:[],donationList:[],recordId:null,donationPhone:null}},watch:{boxList:{handler:function(t){var n=0;this.isAll=t.every((function(t){return t.flag})),0==t.length&&(this.isAll=!1),t.forEach((function(t){t.flag&&n++})),this.totalNumber=n},deep:!0}},methods:{titleName:function(t){switch(t){case 0:return"待提货";case 1:return"已回收";case 2:return"已转赠"}},apply:function(n){var e=this;if(!this.boxList.some((function(t){return t.flag})))return t.showToast({title:"请勾选要"+(0==n?"回收":"发货")+"的商品",icon:"none"});var o=[];this.boxList.forEach((function(t){t.flag&&o.push(t.record_id)})),0==n?t.showModal({cancelText:"取消",confirmText:"确认",title:"一键回收",content:"是否确认一键回收?",success:function(n){n.confirm&&e.$api.exchange({record_ids:o.join(",")}).then((function(n){1===n.code&&(t.showToast({title:n.msg}),e.page=1,e.getMyBox(),e.$refs["recycle"].open(n.data))}))}}):t.navigateTo({url:"/pages/me/applyFaHuo?id="+o.join(",")})},changeAll:function(){var t=this;this.isAll=!this.isAll,this.boxList.forEach((function(n){n.flag=t.isAll}))},changeIndex:function(t){this.i=t,this.page=1,this.boxList=[],this.getMyBox()},getMyBox:function(){var t=this;2!=this.i?this.$api.myBox({status:this.i+1,page:this.page,msg:"数据加载中"}).then((function(n){1===n.code&&(n.data.data.forEach((function(t){t.flag=!1})),t.pages=n.data.last_page,t.boxList=1==t.page?n.data.data:[].concat(o(t.boxList),o(n.data.data)))})):this.$api.echargezs({msg:"数据加载中"}).then((function(n){t.donationList=n.data}))},donationOpen:function(t){this.recordId=t.record_id,this.$refs.donation.open()},donation:function(){var n=this;this.checkPhone()&&this.$api.echargez({record_ids:this.recordId,mobile:this.donationPhone}).then((function(e){if(1===e.code){var o=n.boxList.findIndex((function(t){return t.record_id==n.recordId}));n.boxList.splice(o,1),n.$refs.donation.close(),t.showToast({icon:"success",title:"转赠成功"})}}))},checkPhone:function(){return!!/^1[345789]\d{9}$/.test(this.donationPhone)||(t.showToast({title:"请输入正确的手机号码",icon:"none"}),!1)}},onShow:function(){this.getMyBox()},onReachBottom:function(){2!=this.i&&this.page<this.pages&&(this.page++,this.getMyBox())}};n.default=f}).call(this,e("543d")["default"])},"3e42":function(t,n,e){"use strict";(function(t){e("a940");o(e("66fd"));var n=o(e("45e9"));function o(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=e,t(n.default)}).call(this,e("543d")["createPage"])},"45e9":function(t,n,e){"use strict";e.r(n);var o=e("7b17"),i=e("0843");for(var a in i)"default"!==a&&function(t){e.d(n,t,(function(){return i[t]}))}(a);e("e3c5");var r,c=e("f0c5"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],r);n["default"]=s.exports},"7b17":function(t,n,e){"use strict";e.d(n,"b",(function(){return i})),e.d(n,"c",(function(){return a})),e.d(n,"a",(function(){return o}));var o={uniPopup:function(){return e.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(e.bind(null,"450c"))}},i=function(){var t=this,n=t.$createElement,e=(t._self._c,t.__map(3,(function(n,e){var o=t.__get_orig(n),i=t.titleName(e);return{$orig:o,m0:i}})));t._isMounted||(t.e0=function(t,n){var e=arguments[arguments.length-1].currentTarget.dataset,o=e.eventParams||e["event-params"];n=o.item;n.flag=!n.flag},t.e1=function(t,n){var e=arguments[arguments.length-1].currentTarget.dataset,o=e.eventParams||e["event-params"];n=o.item;n.flag=!n.flag},t.e2=function(n){return t.$refs.donation.close()}),t.$mp.data=Object.assign({},{$root:{l0:e}})},a=[]},e3c5:function(t,n,e){"use strict";var o=e("f02d"),i=e.n(o);i.a},f02d:function(t,n,e){}},[["3e42","common/runtime","common/vendor"]]]);
|