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
18 KiB
1 lines
18 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user-pages-bell-list"],{"0373":function(e,t,i){"use strict";var a=i("b073"),n=i.n(a);n.a},"1ae1":function(e,t,i){"use strict";i("6a54");var a=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("fd3c"),i("4626"),i("5ac7"),i("8f71"),i("bf0f"),i("aa9c"),i("dd2b"),i("bd06");var n=a(i("2634")),s=a(i("2fdc")),r=a(i("9b1b")),c=i("8f59"),o={components:{},data:function(){return{isLoad:!1,options:{},navTitle:"",tabList:[{id:1,title:"项目升级"},{id:2,title:"项目加钟"}],activeIndex:0,serviceList:[],serviceList_check:[],no_check_id:0,have_check:[],have_check_num:0,have_all_check:!1,can_add_order:0,order_goods:[],order_uprecord:[],goodsInd:0,showGoods:!1,loading:!0,popupInfo:{},lockTap:!1}},computed:(0,c.mapState)({primaryColor:function(e){return e.config.configInfo.primaryColor},subColor:function(e){return e.config.configInfo.subColor},configInfo:function(e){return e.config.configInfo},userInfo:function(e){return e.user.userInfo}}),onLoad:function(e){this.options=e;var t=e.tab,i=void 0===t?0:t;this.activeIndex=i,this.initIndex()},watch:{have_check:function(e){0==this.activeIndex&&this.toFormatHaveCheck()}},filters:{textFormat:function(e){var t=e;return e.length>5&&(t=e.substring(0,5)+"..."),t}},methods:(0,r.default)((0,r.default)((0,r.default)({},(0,c.mapActions)([])),(0,c.mapMutations)(["updateOrderItem"])),{},{initIndex:function(){var e=arguments,t=this;return(0,s.default)((0,n.default)().mark((function i(){var a;return(0,n.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(a=e.length>0&&void 0!==e[0]&&e[0],a||!t.$jweixin.isWechat()){i.next=5;break}return i.next=4,t.$jweixin.initJssdk();case 4:t.$jweixin.wxReady((function(){t.$jweixin.hideOptionMenu()}));case 5:return i.next=7,t.getDetail();case 7:return i.next=9,t.getList();case 9:uni.setNavigationBarTitle({title:t.navTitle}),t.isLoad=!0,t.$util.setNavigationBarColor({bg:t.primaryColor});case 12:case"end":return i.stop()}}),i)})))()},initRefresh:function(){this.initIndex(!0)},getDetail:function(){var e=this;return(0,s.default)((0,n.default)().mark((function t(){var i,a,s,r;return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=e.options.id,t.next=3,e.$api.order.orderInfo({id:i});case 3:a=t.sent,s=a.order_goods,r=a.can_add_order,e.order_goods=s,e.can_add_order=r,e.navTitle=r?"升级/加钟":"升级项目";case 9:case"end":return t.stop()}}),t)})))()},getList:function(){var e=this;return(0,s.default)((0,n.default)().mark((function t(){var i,a,s,r,c,o,l,d,u;return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=e.options,i.id,a=i.coach_id,s=e.order_goods[e.goodsInd],r=s.id,c=s.true_price,o=e.activeIndex,l=0===o?"getUpOrderGoods":"coachServiceList",d=0===o?{order_goods_id:r}:{coach_id:a,order_goods_id:r,is_add:1},t.next=7,e.$api.service[l](d);case 7:return u=t.sent,1==o&&(u=u.data),u.map((function(t){t.is_check=!1,0==o&&(t.init_add_num=1,t.init_add_price=(t.price-c).toFixed(2),t.is_check=e.serviceList_check.includes(t.id))})),e.serviceList=u,t.next=13,e.toFormatHaveCheck(3);case 13:e.loading=!1,e.$util.hideAll();case 15:case"end":return t.stop()}}),t)})))()},handerTabChange:function(e){this.activeIndex=e,this.serviceList=[],this.getList()},toChangeGoods:function(e){var t=this;return(0,s.default)((0,n.default)().mark((function i(){return(0,n.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return t.goodsInd=e,t.showGoods=!1,i.next=4,t.toFormatHaveCheck(2);case 4:t.handerTabChange(0);case 5:case"end":return i.stop()}}),i)})))()},toFormatHaveCheck:function(){var e=arguments,t=this;return(0,s.default)((0,n.default)().mark((function i(){var a,s,r,c,o;return(0,n.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:a=e.length>0&&void 0!==e[0]?e[0]:1,s=t.order_goods[t.goodsInd].id,3!=a&&(r=t.have_check.filter((function(e){return e.order_goods_id==s})),t.have_all_check=r.length==t.serviceList.length,t.serviceList_check=r.map((function(e){return e.id})),c=0,r.map((function(e){c+=e.init_add_num})),t.have_check_num=c),2!=a&&(o=t.serviceList.filter((function(e){return!e.is_check})),t.no_check_id=o.length>0?o[0].id:0);case 4:case"end":return i.stop()}}),i)})))()},changeNum:function(e,t){var i=this;return(0,s.default)((0,n.default)().mark((function a(){var s,r,c,o,l,d,u,v,f,p,_,h,g,m,x,b,w,C;return(0,n.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(s=i.activeIndex,0!=s){a.next=13;break}if(r=i.$util.deepCopy(i.have_check),c=r[t].init_add_num,o=i.order_goods[i.goodsInd].num,l=i.have_check_num,d=c+e,!(l+e>o)&&d){a.next=10;break}return i.$util.showToast({title:d?"数量不可大于".concat(c):"数量至少为1"}),a.abrupt("return");case 10:return r[t].init_add_num=d,i.have_check=r,a.abrupt("return");case 13:if(u=i.options,v=u.id,f=u.coach_id,p=i.serviceList[t],_=p.id,h=p.car_num,g=void 0===h?0:h,m=p.car_id,x=void 0===m?0:m,!i.lockTap){a.next=17;break}return a.abrupt("return");case 17:return i.lockTap=!0,b=e>0?"addCar":"delCar",w=e>0?{service_id:_,coach_id:f,order_id:v,num:1}:{id:x,num:1},a.prev=20,a.next=23,i.$api.order[b](w);case 23:C=a.sent,i.serviceList[t].car_num=g+e,C&&e>0&&!x&&(i.serviceList[t].car_id=C),i.serviceList[t].car_num<1&&(i.serviceList[t].car_id=0),i.lockTap=!1,a.next=33;break;case 30:a.prev=30,a.t0=a["catch"](20),i.lockTap=!1;case 33:case"end":return a.stop()}}),a,null,[[20,30]])})))()},toAddDelItem:function(e,t){var i=this;return(0,s.default)((0,n.default)().mark((function a(){var s,r,c,o,l,d,u,v,f,p;return(0,n.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(s=i.activeIndex,r=i.have_check_num,1!=s){a.next=3;break}return a.abrupt("return");case 3:if(c=i.order_goods[i.goodsInd],o=c.id,l=c.num,d=c.goods_name,1!=e||r!=l){a.next=7;break}return i.$util.showToast({title:"当前项目最多可升级".concat(l,"个服务数量")}),a.abrupt("return");case 7:1==e?(i.serviceList[t].order_goods_id=o,i.serviceList[t].order_goods_name=d,i.serviceList[t].is_check=!0,i.have_check.push(i.serviceList[t])):(u=i.have_check[t],v=u.id,f=u.order_goods_id,i.have_check.splice(t,1),o==f&&(p=i.serviceList.findIndex((function(e){return e.id===v})),i.serviceList[p].is_check=!1));case 8:case"end":return a.stop()}}),a)})))()},toOrder:function(){var e=this;return(0,s.default)((0,n.default)().mark((function t(){var i,a,s,r,c,o,l,d,u;return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=e.have_check,a=e.activeIndex,s=0,1==a&&e.serviceList.map((function(e){s+=e.car_num})),!(0==a&&0==i.length||1==a&&s<1)){t.next=7;break}return r=0==a?"升级":"加钟",e.$util.showToast({title:"请选择".concat(r,"服务")}),t.abrupt("return");case 7:if(c=e.options,o=c.id,l=c.coach_id,d={order_type:a},0!=a){t.next=14;break}u=i.map((function(e){return{order_goods_id:e.order_goods_id,service_id:e.id,num:e.init_add_num}})),d=Object.assign({},d,{order_id:o,order_goods:u}),t.next=17;break;case 14:return d=Object.assign({},d,{coach_id:l,order_id:o}),t.next=17,e.$api.order.checkAddOrder({order_id:o});case 17:e.updateOrderItem({key:"bellOrderParams",val:d}),e.$util.goUrl({url:"/user/pages/bell/order",openType:"redirectTo"});case 19:case"end":return t.stop()}}),t)})))()}})};t.default=o},"3b54":function(e,t,i){var a=i("c86c");t=a(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.pages-user-bell .change-goods-info[data-v-01ac1ffc]{top:%?89?%;right:%?30?%;min-width:%?218?%;min-height:%?280?%;max-height:%?500?%;overflow-y:auto;background:#fff;box-shadow:0 6px 16px 0 hsla(0,0%,87.1%,.37);border-radius:16px;border:1px solid #f5f5f5;z-index:99999}.pages-user-bell .change-goods-info .goods-title[data-v-01ac1ffc]{font-size:%?20?%;margin:%?15?% 0}.pages-user-bell .change-goods-info .cur[data-v-01ac1ffc]{height:%?36?%;padding:0 %?9?%;border-radius:%?4?%}.pages-user-bell .list-item .icon-xuanze[data-v-01ac1ffc],\n.pages-user-bell .list-item .icon-xuanze-fill[data-v-01ac1ffc]{font-size:%?40?%}.pages-user-bell .list-item .cover[data-v-01ac1ffc]{width:%?155?%;height:%?155?%}.pages-user-bell .list-item .time-long[data-v-01ac1ffc]{min-width:%?72?%;height:%?30?%;padding:0 %?5?%;background:linear-gradient(270deg,#4c545a,#282b34);border-radius:%?4?%;font-size:%?20?%;color:#ffeeb9;margin-right:%?16?%}.pages-user-bell .list-item .f-icontext[data-v-01ac1ffc]{font-size:%?18?%}.pages-user-bell .list-item .text-delete[data-v-01ac1ffc]{font-size:%?20?%;color:#b9b9b9}.pages-user-bell .list-item .remove-btn[data-v-01ac1ffc]{width:%?110?%;height:%?54?%;-webkit-transform:rotate(1turn);transform:rotate(1turn)}.pages-user-bell .list-item .shengji-icon-text[data-v-01ac1ffc]{height:%?60?%}.pages-user-bell .change-btn[data-v-01ac1ffc]{width:%?125?%;height:%?46?%;font-size:%?20?%;-webkit-transform:rotate(1turn);transform:rotate(1turn)}.pages-user-bell .change-btn .iconfont[data-v-01ac1ffc]{font-size:%?20?%;-webkit-transform:scale(.8);transform:scale(.8)}',""]),e.exports=t},"4f9b":function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.isLoad?i("v-uni-view",{staticClass:"pages-user-bell"},[e.can_add_order?i("fixed",[i("tab",{attrs:{list:e.tabList,activeIndex:1*e.activeIndex,activeColor:e.primaryColor,width:"50%",height:"100rpx"},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.handerTabChange.apply(void 0,arguments)}}}),i("v-uni-view",{staticClass:"b-1px-b"})],1):e._e(),0==e.activeIndex&&e.have_check.length>0?i("v-uni-view",{staticClass:"pt-lg pl-lg pr-lg"},[i("v-uni-view",{staticClass:"f-desc c-paragraph text-bold"},[e._v("已选择项目")]),e._l(e.have_check,(function(t,a){return[i("v-uni-view",{key:a+"_0",staticClass:"list-item pd-lg fill-base radius-16",class:[{"mt-lg":0==a},{"mt-md":0!=a}]},[i("v-uni-view",{staticClass:"flex-center"},[i("v-uni-view",{staticClass:"cover radius-16"},[i("v-uni-view",{staticClass:"h5-image cover radius-16",style:{backgroundImage:"url('"+t.cover+"')"}})],1),i("v-uni-view",{staticClass:"flex-1 ml-md",staticStyle:{"max-width":"456rpx"}},[i("v-uni-view",{staticClass:"flex-between"},[i("v-uni-view",{staticClass:"f-title c-title text-bold ellipsis",staticStyle:{"max-width":"250rpx"}},[e._v(e._s(t.title))]),i("v-uni-view",{staticClass:"flex-warp"},[i("v-uni-button",{staticClass:"reduce",style:{borderColor:e.primaryColor,color:e.primaryColor},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.changeNum(-1,a)}}},[i("i",{staticClass:"iconfont icon-jian-bold"})]),i("v-uni-button",{staticClass:"addreduce clear-btn"},[e._v(e._s(t.init_add_num||0))]),i("v-uni-button",{staticClass:"add",style:{background:e.primaryColor,borderColor:e.primaryColor},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.changeNum(1,a)}}},[i("i",{staticClass:"iconfont icon-jia-bold"})])],1)],1),i("v-uni-view",{staticClass:"flex-warp mt-sm"},[i("v-uni-view",{staticClass:"time-long flex-center"},[e._v(e._s(t.time_long)+"分钟")]),i("v-uni-view",{staticClass:"f-caption c-caption"},[e._v(e._s(t.total_sale)+"人已预约")])],1),i("v-uni-view",{staticClass:"flex-between mt-md"},[i("v-uni-view",{staticClass:"flex-y-baseline"},[i("v-uni-view",{staticClass:"flex-y-baseline f-icontext c-warning ml-sm mr-sm"},[e._v("¥"),i("v-uni-view",{staticClass:"f-sm-title"},[e._v(e._s(t.price))])],1),e.activeIndex?e._e():i("v-uni-view",{staticClass:"flex-y-baseline f-caption c-paragraph"},[e._v("需补差价:"),i("v-uni-view",{staticClass:"c-warning"},[e._v("¥"+e._s(t.init_add_price))])],1)],1),i("v-uni-view",{staticClass:"remove-btn flex-center f-caption radius",style:{color:e.primaryColor,border:"1rpx solid "+e.primaryColor},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.toAddDelItem(2,a)}}},[e._v("移除")])],1)],1)],1),i("v-uni-view",{staticClass:"flex-between f-desc mt-lg pt-lg b-1px-t",staticStyle:{color:"#2E3541"}},[i("v-uni-view",{staticClass:"flex-y-center"},[e._v(e._s(e._f("textFormat")(t.order_goods_name)))]),i("v-uni-view",{staticClass:"shengji-icon-text flex-1 flex-center flex-column",style:{color:e.primaryColor}},[i("v-uni-view",{staticClass:"f-icontext"},[e._v("升级为")]),i("i",{staticClass:"iconfont iconshengji"})],1),i("v-uni-view",{staticClass:"flex-y-center"},[e._v(e._s(e._f("textFormat")(t.title)))])],1)],1)]}))],2):e._e(),1==e.activeIndex?i("v-uni-view",{staticClass:"pd-md"},[i("v-uni-view",{staticClass:"flex-y-center f-title c-title text-bold"},[e._v("选择加钟项目")])],1):e._e(),0===e.activeIndex?i("v-uni-view",{staticClass:"flex-center pt-lg pb-sm pl-lg pr-lg fill-base mt-md rel"},[i("v-uni-view",{staticClass:"flex-1 flex-y-center f-title c-title text-bold"},[e._v("将"),i("v-uni-view",{style:{color:e.primaryColor}},[e._v(e._s(e._f("textFormat")(e.order_goods[e.goodsInd].goods_name)))]),e._v("升级为以下项目")],1),i("v-uni-view",{staticClass:"change-btn flex-center radius",style:{color:e.primaryColor,border:"1rpx solid "+e.primaryColor},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.showGoods=!e.showGoods}}},[e._v("切换项目"),i("i",{staticClass:"iconfont",class:[{"icon-up-fill":e.showGoods},{"icon-down-fill":!e.showGoods}]})]),e.showGoods?i("v-uni-view",{staticClass:"change-goods-info pd-md abs"},e._l(e.order_goods,(function(t,a){return i("v-uni-view",{key:a,staticClass:"goods-title flex-y-center",class:[{"c-title":e.goodsInd!=a},{"c-base cur":e.goodsInd==a}],style:{background:e.goodsInd==a?e.primaryColor:"",borderColor:e.goodsInd==a?e.primaryColor:""},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.toChangeGoods(a)}}},[e._v(e._s(t.goods_name))])})),1):e._e()],1):e._e(),i("v-uni-view",{class:[{"pl-lg pr-lg fill-base":0==e.activeIndex}]},[e._l(e.serviceList,(function(t,a){return[0==e.activeIndex&&!t.is_check||1==e.activeIndex?i("v-uni-view",{key:a+"_0",staticClass:"list-item flex-center",class:[{"pt-lg pb-lg":0==e.activeIndex},{"ml-md mr-md pd-lg fill-base radius-16":1==e.activeIndex},{"b-1px-t":0!=a&&t.id!=e.no_check_id&&0==e.activeIndex},{"mt-md":0!=a&&1==e.activeIndex}],on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.toAddDelItem(1,a)}}},[0==e.activeIndex?i("i",{staticClass:"iconfont mr-md",class:[{"icon-xuanze":!t.is_check},{"icon-xuanze-fill":t.is_check}],style:{color:t.is_check?e.primaryColor:"#999"}}):e._e(),i("v-uni-view",{staticClass:"flex-center flex-1"},[i("v-uni-view",{staticClass:"cover radius-16"},[i("v-uni-view",{staticClass:"h5-image cover radius-16",style:{backgroundImage:"url('"+t.cover+"')"}})],1),i("v-uni-view",{staticClass:"flex-1 ml-md",style:{maxWidth:0==e.activeIndex?"456rpx":"495rpx"}},[i("v-uni-view",{staticClass:"flex-between"},[i("v-uni-view",{staticClass:"f-title c-title text-bold ellipsis",staticStyle:{"max-width":"250rpx"}},[e._v(e._s(t.title))]),i("v-uni-view",{staticClass:"f-caption c-caption"},[e._v(e._s(t.total_sale)+"人已预约")])],1),i("v-uni-view",{staticClass:"flex-between mt-sm"},[i("v-uni-view",{staticClass:"time-long flex-center"},[e._v(e._s(t.time_long)+"分钟")]),i("v-uni-view",[1*t.material_price>0?i("v-uni-view",{staticClass:"f-caption c-caption"},[e._v("物料费:¥"+e._s(t.material_price))]):e._e()],1)],1),i("v-uni-view",{staticClass:"flex-center mt-md"},[i("v-uni-view",{staticClass:"flex-1 flex-y-baseline f-icontext c-warning ml-sm mr-sm"},[e._v("¥"),i("v-uni-view",{staticClass:"f-sm-title"},[e._v(e._s(t.price))])],1),0==e.activeIndex?i("v-uni-view",{staticClass:"flex-y-center f-paragraph c-paragraph"},[e._v("需补差价"),i("v-uni-view",{staticClass:"c-warning"},[e._v("¥"+e._s(t.init_add_price))])],1):e._e(),1==e.activeIndex?i("v-uni-view",{staticClass:"flex-warp"},[t.car_num?[i("v-uni-button",{staticClass:"reduce",style:{borderColor:e.primaryColor,color:e.primaryColor},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.changeNum(-1,a)}}},[i("i",{staticClass:"iconfont icon-jian-bold"})]),i("v-uni-button",{staticClass:"addreduce clear-btn"},[e._v(e._s(t.car_num||0))])]:e._e(),i("v-uni-button",{staticClass:"add",style:{background:e.primaryColor,borderColor:e.primaryColor},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.changeNum(1,a)}}},[i("i",{staticClass:"iconfont icon-jia-bold"})])],2):e._e()],1)],1)],1)],1):e._e()]})),e.have_all_check||0==e.serviceList.length?i("v-uni-view",{staticClass:"space-md"}):e._e()],2),!e.loading&&0==e.serviceList.length||0==e.activeIndex&&e.have_all_check?i("abnor"):e._e(),i("v-uni-view",{staticClass:"space-max-footer"}),i("fix-bottom-button",{attrs:{text:[{text:"暂不"+e.navTitle,type:"cancel"},{text:"下单",type:"confirm",isAuth:!0}],bgColor:"#fff",classType:2},on:{cancel:function(t){arguments[0]=t=e.$handleEvent(t),e.$util.goUrl({url:1,openType:"navigateBack"})},confirm:function(t){arguments[0]=t=e.$handleEvent(t),e.toOrder.apply(void 0,arguments)}}})],1):e._e()},n=[]},"5b6e":function(e,t,i){"use strict";i.r(t);var a=i("1ae1"),n=i.n(a);for(var s in a)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(s);t["default"]=n.a},a0cf:function(e,t,i){"use strict";i.r(t);var a=i("4f9b"),n=i("5b6e");for(var s in n)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(s);i("0373");var r=i("828b"),c=Object(r["a"])(n["default"],a["b"],a["c"],!1,null,"01ac1ffc",null,!1,a["a"],void 0);t["default"]=c.exports},b073:function(e,t,i){var a=i("3b54");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var n=i("967d").default;n("3ac31adc",a,!0,{sourceMap:!1,shadowMode:!1})}}]); |