2 lines
8.2 KiB
JavaScript
2 lines
8.2 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4628bce2"],{b4c3:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"navtitleright nb"},[e("a",{attrs:{href:"page.html"}},[t._v("首页")]),t._l(t.productInfo.classPath,(function(s,a){return e("span",{key:a,staticClass:"color-change"},[t._v(" > "),e("a",{on:{click:function(e){return t._jumpToPageByClassId(s.classId)}}},[t._v(t._s(s.className))])])}))],2),e("div",{staticClass:"indbody pro-style"},[e("el-row",{staticClass:"nb recom-box"},[e("el-col",{attrs:{span:24}},[e("div",{staticClass:"part-price-sort"},[e("ul",{staticClass:"pps"},[e("li",{staticClass:"readychoose"},[e("div",{staticClass:"lside-name"},[t._v("已选择")]),e("div",{staticClass:"rside-navtitle"},[t.productInfo.goodsClass.hktName?e("a",{staticStyle:{"margin-right":"10px"},attrs:{title:"取消选择"},on:{click:function(e){return t._jumpToPageByCancel("class")}}},[t._v(" 分类:"),e("span",[t._v(t._s(t.productInfo.goodsClass.hktName)),e("em",[t._v("×")])])]):t._e(),t.minPrice||t.maxPrice?e("a",{staticStyle:{"margin-right":"10px"},attrs:{title:"取消选择"},on:{click:function(e){return t._jumpToPageByCancel("price")}}},[t._v(" 价格:"),e("span",[t._v(t._s(t.minPrice)+"-"+t._s(t.maxPrice)),e("em",[t._v("×")])])]):t._e()])]),t.productInfo.goodsClass.children?e("li",[e("div",{staticClass:"lside-name"},[t._v("分类")]),e("div",{staticClass:"rside-navtitle"},t._l(t.productInfo.goodsClass.children,(function(s,a){return e("a",{key:a,on:{click:function(e){return t._jumpToPageByClassId(s.classId)}}},[t._v(" "+t._s(s.hktName)+" ")])})),0)]):t._e(),e("li",[e("div",{staticClass:"lside-name"},[t._v("价格")]),e("div",{staticClass:"rside-navtitle"},[e("a",{staticClass:"red",attrs:{href:"17rec-1.html"}},[t._v("全部")]),e("span",{staticClass:"setprice"},[e("el-input",{attrs:{type:"text",id:"price-min"},on:{input:function(e){t.minPrice=t.minPrice.replace(/[^0-9]/g,"")}},model:{value:t.minPrice,callback:function(e){t.minPrice=e},expression:"minPrice"}}),t._v(" - "),e("el-input",{attrs:{type:"text",id:"price-max"},on:{input:function(e){t.maxPrice=t.maxPrice.replace(/[^0-9]/g,"")}},model:{value:t.maxPrice,callback:function(e){t.maxPrice=e},expression:"maxPrice"}}),e("el-button",{attrs:{id:"btnprice"},on:{click:function(e){return t._jumpToPageByPrice()}}},[t._v("确定")])],1)])]),e("li",[e("div",{staticClass:"lside-name"},[t._v("排序方式")]),e("div",{staticClass:"rside-navtitle some-px"},[e("a",{staticClass:"red",attrs:{href:"javascript:void(0)"}},[t._v("默认")])])])])]),e("ul",{staticClass:"yourlike clearovermartb nobottompad"},t._l(t.productInfo.products,(function(s,a){return e("li",{key:a},[e("a",{staticClass:"picbox",on:{click:function(e){return t._jumpToProductDetail(s.productId)}}},[e("img",{attrs:{src:s.coverPhoto,alt:"",height:"192px",width:"192px"}})]),e("div",{staticClass:"elli color-change"},[e("a",{on:{click:function(e){return t._jumpToProductDetail(s.productId)}}},[t._v(t._s(s.prodName))])]),e("span",{staticClass:"color-change"},[e("a",{staticClass:"price",on:{click:function(e){return t._jumpToProductDetail(s.productId)}}},[t._v("¥"),e("span",[t._v(t._s(s.price))])])]),e("div",{staticClass:"probottom"},[e("a",{staticClass:"buy",attrs:{href:"javascript:void(0);"},on:{click:function(e){return t._addToCart(s)}}},[t._v("加入购物车")]),e("i",{staticClass:"line"}),e("a",{staticClass:"addcart",attrs:{href:"javascript:void(0);"},on:{click:function(e){return t._buyNow(s)}}},[t._v("立即购买")])])])})),0),e("div",{staticClass:"pages"},[e("el-pagination",{attrs:{"current-page":t.currentPage,"page-size":t.pageSize,layout:"total, prev, pager, next",total:t.total},on:{"current-change":t.handleCurrentChange}})],1)])],1)],1)])},r=[],o=s("b775");function i(t){return new Promise((e,s)=>{Object(o["a"])({url:"/product.queryProduct",method:"get",params:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}function c(t){return new Promise((e,s)=>{Object(o["a"])({url:"/housekeepingType.queryHousekeepingType",method:"get",params:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}function n(t){return new Promise((e,s)=>{Object(o["a"])({url:"/goodsClass.listGoodsClasses",method:"post",data:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}function d(t){return new Promise((e,s)=>{Object(o["a"])({url:"/storeCart.saveStoreCart",method:"post",data:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}function l(t){return new Promise((e,s)=>{Object(o["a"])({url:"/websiteAccessLog.saveWebsiteAccessLog",method:"post",data:t}).then(t=>{const s=t.data;e(s)}).catch(t=>{s(t)})})}var u=s("7323"),h={name:"Product",data(){return{DEFAULT_PAGE:1,DEFAULT_ROWS:10,productInfo:{goodsClass:{},products:[],classPath:[],records:"",pages:[]},minPrice:"",maxPrice:"",searchKey:"",state:"2002",currentPage:1,pageSize:10,total:0,shopId:""}},created(){this.shopId=Object(u["f"])(),this._initMethod()},methods:{_initMethod(){this.searchKey=this.$route.query.searchKey,this.$route.query.hktId?(this._queryProductByCondition(this.$route.query.hktId,this.DEFAULT_PAGE,this.DEFAULT_ROWS),this._queryClassByClassId(this.$route.query.hktId)):(this.minPrice=this.$route.query.minPrice,this.maxPrice=this.$route.query.maxPrice,this._queryProductByCondition("",this.DEFAULT_PAGE,this.DEFAULT_ROWS),this._queryClassByClassId()),this.websiteAccessLog(),console.log(this.state)},handleCurrentChange(t){this.currentPage=t,this._queryProductByCondition(this.$route.query.hktId,t,this.DEFAULT_ROWS)},_queryClassByClassId(t){const e={page:-1,row:100,hktId:t};c(e).then(e=>{t?this.productInfo.goodsClass=e.data[0]:this.productInfo.goodsClass.children=e.data}).catch(t=>{console.log("请求失败处理",t)})},_queryClassesByClassIdPath(t){const e={page:-1,row:100,classIds:t};n(e).then(e=>{const s=[],a=t.split("-");for(let t=0;t<a.length;t++)for(let r=0;r<e.data.length;r++)a[t]===e.data[r].classId&&s.push(e.data[r]);this.productInfo.classPath=s}).catch(t=>{console.log("请求失败处理",t)})},_queryProductByCondition(t,e,s){const a={page:e,row:s,hktId:t,minPrice:this.minPrice,maxPrice:this.maxPrice,prodNameLike:this.searchKey};i(a).then(t=>{this.productInfo.total=t.total,this.productInfo.records=t.records,this.total=t.total,this.currentPage=e,this.productInfo.products=t.data}).catch(t=>{console.log("请求失败处理",t)})},_jumpToPageByClassId(t){this.$router.push({path:"/pages/plateform/product",query:{classId:t}})},_jumpToPageByPrice(){(this.minPrice||this.maxPrice)&&this._queryProductByCondition(this.$route.query.hktId,this.DEFAULT_PAGE,this.DEFAULT_ROWS)},_jumpToPageByCancel(t){const e=this.minPrice,s=this.maxPrice;switch(t){case"class":this.$router.push({path:"/pages/plateform/product",query:{minPrice:e,maxPrice:s}});break;case"price":this.minPrice="",this.maxPrice="",this._queryProductByCondition(this.$route.query.hktId,this.DEFAULT_PAGE,this.DEFAULT_ROWS);break}},_jumpToProductDetail(t){this.$router.push({path:"/pages/plateform/productDetail",query:{productId:t}})},_addToCart(t){const e={prodName:t.prodName,productId:t.productId,valueId:t.valueId,storeId:t.storeId,price:t.price,shopId:t.shopId,cartNum:"1"};d(e).then(t=>{0===t.code?this.$message.success("加入购物车成功"):404===t.code?this.$message.error(t.msg):this.$message.error(t.data)}).catch(t=>{console.log("请求失败处理",t),this.$message.error(t)})},_buyNow(t){const e={prodName:t.prodName,productId:t.productId,valueId:t.valueId,storeId:t.storeId,price:t.price,shopId:t.shopId,cartNum:"1"};d(e).then(e=>{0===e.code?(this.$message.success("加入购物车成功"),this.$router.push({path:"/pages/plateform/order",query:{productId:t.productId,shopId:t.shopId,valueId:t.valueId,goodsNum:1}})):404===e.code?this.$message.error(e.msg):this.$message.error(e.data)}).catch(t=>{console.log("请求失败处理",t),this.$message.error(t)})},websiteAccessLog(){const t=this.$store.getters.user;let e={};e=t?{loginName:t.name,loginId:t.userId,accessUrl:window.location.href,loginState:"1"}:{accessUrl:window.location.href,loginState:"0"},l(e).then(t=>{t.code}).catch(t=>{console.log("请求失败处理",t),this.$message.error(t)})}}},p=h,m=(s("e41f"),s("2877")),g=Object(m["a"])(p,a,r,!1,null,"74e6f4f6",null);e["default"]=g.exports},e41f:function(t,e,s){"use strict";s("ff7c")},ff7c:function(t,e,s){}}]);
|
||
//# sourceMappingURL=chunk-4628bce2.02fb4326.js.map
|