1 line
6.3 KiB
JavaScript
1 line
6.3 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1fff83d2"],{"04844":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"vending-machine"},[i("div",{staticClass:"header"},[i("van-search",{attrs:{placeholder:"搜索商品名称",disabled:"",shape:"round"},on:{click:function(t){e.$router.push(e.fun.getUrl("search",{},{plugin_type:"vending_machine",machineId:e.$route.query.machine_id}))}},model:{value:e.SearchValue,callback:function(t){e.SearchValue=t},expression:"SearchValue"}}),i("div",{staticClass:"header-right",on:{click:function(t){e.$router.push(e.fun.getUrl("orderlist",{status:0}))}}},[i("i",{staticClass:"iconfont icon-dingdan1"}),i("span",{staticStyle:{"font-size":"0.625rem"}},[e._v("我的订单")])])],1),e.banner?i("div",{staticClass:"my-swipe",on:{click:e.link}},[i("img",{staticStyle:{width:"100%"},attrs:{src:e.banner}})]):e._e(),i("div",{staticClass:"list"},e._l(e.list,(function(t){return i("div",{key:t.id,staticClass:"list-item",on:{click:function(i){e.$router.push(e.fun.getUrl("goods",{id:t.id},{tag:"vending_machine",machineId:e.machineId}))}}},[i("div",{staticClass:"img"},[i("img",{attrs:{src:t.thumb}})]),i("div",{staticClass:"content"},[i("p",{staticClass:"title"},[e._v(e._s(t.title))]),i("p",{staticClass:"count"},[e._v("库存"+e._s(t.stock))]),i("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[i("div",{staticClass:"price"},[i("span",{staticStyle:{"font-size":"0.625rem"}},[e._v(e._s(e.$i18n.t("money")))]),i("span",[e._v(e._s(t.price))])]),i("div",{staticClass:"pay",on:{click:function(i){e.$router.push(e.fun.getUrl("goods",{id:t.id},{tag:"vending_machine",machineId:e.machineId}))}}},[e._v("立即购买 ")])])])])})),0)])},n=[],c=(i("b0c0"),i("99af"),i("ac0d")),s={mixins:[c["a"]],data:function(){return{SearchValue:"",banner_list:[],list:[],last_page:0,current_page:0,isLoadMore:!1,h5_link:"",machineId:""}},activated:function(){this.isLoadMore=!0,this.getData({page:1}),this.getBanner()},methods:{link:function(){this.h5_link&&window.open(this.h5_link,"_blank")},getBanner:function(){var e=this;$http.get("plugin.automat.frontend.index.index",{automat_machine_id:this.$route.query.machine_id}).then((function(t){t.result?(e.banner=t.data.banner,e.h5_link=t.data.web_route,e.machineId=t.data.id,e.fun.setWXTitle(t.data.name)):e.$toast(t.msg)}))},getData:function(e){var t=this,i=e.page,a={automat_machine_id:this.$route.query.machine_id,"search[automat_machine_id]":this.$route.query.machine_id,page:i};$http.get("plugin.automat.frontend.goods.searchGoods",a).then((function(e){var a=e.result,n=e.msg,c=e.data;1==a?(t.last_page=c.last_page,t.current_page=c.current_page,1==i?t.list=c.data||[]:i>1&&(t.list=t.list.concat(c.data))):t.$toast(n),t.isLoadMore=!0}))},getMoreData:function(){if(!(this.current_page>=this.last_page)){this.isLoadMore=!1;var e=this.current_page+1;this.getData({page:e})}}}},r=s,o=(i("4c50"),i("2877")),l=Object(o["a"])(r,a,n,!1,null,"7394bcc2",null);t["default"]=l.exports},"4c50":function(e,t,i){"use strict";i("ceaf")},ac0d:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var a=document.documentElement,n=document.body,c={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var e=0;return a&&a.scrollTop?e=a.scrollTop:n&&(e=n.scrollTop),e},getClientHeight:function(){var e=0;return e=n.clientHeight&&a.clientHeight?Math.min(n.clientHeight,a.clientHeight):Math.max(n.clientHeight,a.clientHeight),e},getScrollHeight:function(){return Math.max(n.scrollHeight,a.scrollHeight)},handleScroll:function(){this.otherScroll();var e=document.documentElement.scrollTop||document.body.scrollTop;this.btnFlag=e>60,this.getScrollTop()+this.getClientHeight()+105>this.getScrollHeight()?(this.isLoadMore&&this.getMoreData(),this.isBottom=!0):this.isBottom=!1},otherScroll:function(){}}}},b571:function(e,t,i){var a=i("24fb");t=a(!1),t.push([e.i,"[data-v-7394bcc2] .van-search{width:100%;padding:0}.vending-machine .title[data-v-7394bcc2]{font-size:.75rem;padding-right:.3438rem;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;word-break:break-all;text-align:left}.vending-machine .pay[data-v-7394bcc2]{color:#fff;background:#f15353;border-radius:100px;padding:.2rem .3rem;font-size:.75rem}.vending-machine .price[data-v-7394bcc2]{font-size:.75rem;color:#f15353}.vending-machine .count[data-v-7394bcc2]{color:#999;font-size:.625rem;text-align:left;margin:.4rem 0 .5rem}.vending-machine .content[data-v-7394bcc2]{padding:.5938rem .5rem .625rem .625rem}.vending-machine img[data-v-7394bcc2]{margin:0}.vending-machine .list[data-v-7394bcc2]{padding:.625rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.vending-machine .list-item[data-v-7394bcc2]{width:49%;border-radius:.3125rem;background:#fff;overflow:hidden}.vending-machine .list-item .img[data-v-7394bcc2]{width:100%;height:10.5938rem}.vending-machine .list-item img[data-v-7394bcc2]{width:100%;height:100%}.vending-machine .my-swipe[data-v-7394bcc2]{margin:.625rem .625rem 0;border-radius:.3125rem;overflow:hidden}.vending-machine .header[data-v-7394bcc2]{background:#fff;padding:.4375rem .9063rem}.vending-machine .header[data-v-7394bcc2],.vending-machine .header-right[data-v-7394bcc2]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.vending-machine .header-right[data-v-7394bcc2]{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin:0 .0313rem 0 1.5938rem;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0}",""]),e.exports=t},ceaf:function(e,t,i){var a=i("b571");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var n=i("499e").default;n("1cfde480",a,!0,{sourceMap:!1,shadowMode:!1})}}]); |