gift.js 3.9 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/class/gift"],{"361d":function(t,e,n){"use strict";n.r(e);var r=n("4472"),i=n.n(r);for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);e["default"]=i.a},"422f":function(t,e,n){"use strict";var r,i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.attends,(function(e,n){var r=t.__get_orig(e),i=t.__map(e,(function(e,n){var r=t.__get_orig(e),i=t.checked.includes(e.class_attend_id),a=e.prop.length>0?t.__map(e.prop,(function(e,n){var r=t.__get_orig(e),i=t.checked_props[t.mainCur].prop.includes(e.id+"");return{$orig:r,g1:i}})):null;return{$orig:r,g0:i,l0:a}}));return{$orig:r,l1:i}})));t.$mp.data=Object.assign({},{$root:{l2:n}})},a=[];n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return r}))},4472:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n("cabd"),i=n("2f62");function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(){n.e("components/shop-cart").then(function(){return resolve(n("fcb5"))}.bind(null,n)).catch(n.oe)},u={components:{shopCart:s},data:function(){return{topHeader:this.globalCustomBarHeight,package_id:0,attends:[],weekList:[],attend_id:0,checked:[],checked_props:[],tabCur:1,mainCur:1,verticalNavTop:0}},computed:c({},(0,i.mapGetters)(["kid"])),onLoad:function(t){var e=decodeURIComponent(t.package_id);this.package_id=e,this.init()},methods:{init:function(){var t=this;(0,r._gift)({class_package_id:this.package_id}).then((function(e){t.attends=e.data.attends,Object.keys(t.attends).forEach((function(e){t.$set(t.checked_props,e,{prop:[]})})),t.weekList=e.data.week_list}))},addCart:function(){var e=this,n=this,i=this.checked_props.filter((function(t){return t.class_attend_id})).map((function(t){return{class_attend_id:t.class_attend_id,prop:t.prop.join(","),student_id:e.kid}}));if(i.length<1)return t.showToast({title:"请先选择课程",icon:"none"}),!1;(0,r._joinShops)({list:i}).then((function(t){1===t.code&&n.globalNavigateTo("classCart")}))},TabSelect:function(t){this.tabCur=t.currentTarget.dataset.id,this.mainCur=t.currentTarget.dataset.id,this.verticalNavTop=50*(t.currentTarget.dataset.id-1)},changeClass:function(t){var e=Number(t.detail.value);this.checked[this.mainCur]=e,this.$set(this.checked,this.mainCur,e),this.$set(this.checked_props,this.mainCur,{class_attend_id:e,prop:[]})},propChange:function(t){var e=t.target.dataset.id,n=t.detail.value;this.checked.includes(e)||this.$set(this.checked,this.mainCur,e);var r={class_attend_id:e,prop:n};this.$set(this.checked_props,this.mainCur,r)},VerticalMain:function(t){}}};e.default=u}).call(this,n("543d")["default"])},"5c6d":function(t,e,n){},"924c":function(t,e,n){"use strict";var r=n("5c6d"),i=n.n(r);i.a},e303:function(t,e,n){"use strict";n.r(e);var r=n("422f"),i=n("361d");for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("924c");var c,o=n("f0c5"),s=Object(o["a"])(i["default"],r["b"],r["c"],!1,null,"2f9de799",null,!1,r["a"],c);e["default"]=s.exports},f1db:function(t,e,n){"use strict";(function(t){n("6cdc");r(n("66fd"));var e=r(n("e303"));function r(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])}},[["f1db","common/runtime","common/vendor"]]]);