(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{1668:function(t,n,e){"use strict";e.r(n);var i=e("7977"),o=e.n(i);for(var a in i)"default"!==a&&function(t){e.d(n,t,(function(){return i[t]}))}(a);n["default"]=o.a},"32ce":function(t,n,e){"use strict";e.r(n);var i=e("96a1"),o=e("1668");for(var a in o)"default"!==a&&function(t){e.d(n,t,(function(){return o[t]}))}(a);e("f89d");var r,c=e("f0c5"),s=Object(c["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],r);n["default"]=s.exports},"53f9":function(t,n,e){"use strict";(function(t){e("8d0c");i(e("66fd"));var n=i(e("32ce"));function i(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=e,t(n.default)}).call(this,e("543d")["createPage"])},7977:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(e("a34a"));function o(t){return t&&t.__esModule?t:{default:t}}function a(t,n,e,i,o,a,r){try{var c=t[a](r),s=c.value}catch(u){return void e(u)}c.done?n(s):Promise.resolve(s).then(i,o)}function r(t){return function(){var n=this,e=arguments;return new Promise((function(i,o){var r=t.apply(n,e);function c(t){a(r,i,o,c,s,"next",t)}function s(t){a(r,i,o,c,s,"throw",t)}c(void 0)}))}}var c=function(){e.e("components/struggler-uniapp-add-tip/struggler-uniapp-add-tip").then(function(){return resolve(e("a7cb"))}.bind(null,e)).catch(e.oe)},s=function(){e.e("components/drag-button/drag-button").then(function(){return resolve(e("75f4"))}.bind(null,e)).catch(e.oe)},u=function(){e.e("components/uni-notice-bar/uni-notice-bar").then(function(){return resolve(e("94af"))}.bind(null,e)).catch(e.oe)},d={components:{addtip:c,dragButton:s,uniNoticeBar:u},data:function(){return{bttext:"客服",tip:"点击「添加小程序」,下次访问更便捷",duration:5,banner:[],cardCur:0,typeList:[{id:3,name:"粮油类",sort:2,icon:"http://m2.chinause.cn:8888/8img/mini/liangyou.png"}],pcdesc:[],productList:[],tjproductList:[],loadingText:"正在加载...",miaosstyle:"miaos",goodsList:[],text:"欢迎进入中龙小程序商城",backcolor:"#E8E8E8",color:"#F23E05",gg_zezhao:"none",gg_model:"none"}},methods:{baseinfo:function(t){var n=this;return r(i.default.mark((function e(){var o;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n.$api.baseinfo({action:"baseinfo",key:t});case 2:o=e.sent,"gscolor"==t?n.color=o.data.info:"gsbgcolor"==t&&(n.backcolor=o.data.info);case 4:case"end":return e.stop()}}),e)})))()},btnClick:function(){console.log("btnClick")},btnTouchstart:function(){console.log("btnTouchstart")},btnTouchend:function(){console.log("btnTouchend")},cardSwiper:function(t){this.cardCur=t.detail.current},toSearch:function(){t.showLoading({title:"加载中..."}),t.navigateTo({url:"/pages/search/search"}),t.hideLoading()},topcate:function(n){if("#"!=n&&void 0!=n){console.log(n);var e=n.split("?");console.log(e[1],"tourl[1]");var i=e[1].split("&"),o=i[0],a=i[1];console.log("xflid="+a+"===dflid="+o),getApp().globalData.dflid=o,getApp().globalData.xflid=a,getApp().globalData.tid=1,console.log(getApp().globalData.xflid,"保存好的id"),t.switchTab({url:e[0]})}},addcollection:function(n,e,o){var a=this;return r(i.default.mark((function r(){var c,s,u;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(c=t.getStorageSync("userinfo"),s=0==o?!a.tjproductList[e].iscollect:!a.productList[e].iscollect,!c){i.next=10;break}return i.next=5,a.$api.addcollection({action:"addcollection",type:s,uid:c.uid,id:n});case 5:u=i.sent,t.showToast({title:u.msg,icon:"none"}),1==u.code&&(0==o?a.tjproductList[e].iscollect=!a.tjproductList[e].iscollect:a.productList[e].iscollect=!a.productList[e].iscollect),i.next=11;break;case 10:t.navigateTo({url:"/pages/user/login"});case 11:case"end":return i.stop()}}),r)})))()},toFavorite:function(t,n,e){this.addcollection(t,n,e)},getgoodlist:function(){var n=this;return r(i.default.mark((function e(){var o,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return o=t.getStorageSync("userinfo"),e.next=3,n.$api.getgoodlist({action:"goodlist2",type:1,uid:o.uid});case 3:a=e.sent,n.productList=a.data.map((function(t,n){return t.checked=!1,t.shownum=0,t.miaosstyle="miaos",t})),n.checkshownum();case 6:case"end":return e.stop()}}),e)})))()},gettjgoodlist:function(){var n=this;return r(i.default.mark((function e(){var o,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return o=t.getStorageSync("userinfo"),e.next=3,n.$api.getgoodlist({action:"goodlist2",type:2,uid:o.uid});case 3:a=e.sent,n.tjproductList=a.data.map((function(t,n){return t.checked=!1,t.shownum=0,t.miaosstyle="miaos",t})),n.checkshownum();case 6:case"end":return e.stop()}}),e)})))()},getbanner:function(){var t=this;return r(i.default.mark((function n(){var e;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$api.getbanner({action:"banner"});case 2:e=n.sent,t.banner=e.data;case 4:case"end":return n.stop()}}),n)})))()},getnotice:function(){var t=this;return r(i.default.mark((function n(){var e;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$api.notice({action:"notice"});case 2:e=n.sent,t.text=e.data[0].info;case 4:case"end":return n.stop()}}),n)})))()},getMore:function(n){t.showModal({title:"",content:this.text,showCancel:!1,buttonText:"确定",success:function(t){t.confirm}})},getitem:function(){var t=this;return r(i.default.mark((function n(){var e;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$api.getitem({action:"item1"});case 2:e=n.sent,t.typeList=e.data;case 4:case"end":return n.stop()}}),n)})))()},getcpdesc:function(){var t=this;return r(i.default.mark((function n(){var e;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$api.getcpdesc({action:"cpdesc"});case 2:e=n.sent,t.pcdesc=e.data;case 4:case"end":return n.stop()}}),n)})))()},toGoods:function(n){t.navigateTo({url:"../product/detail?gid="+n.id+"&price="+n.price})},toCategory:function(n){getApp().globalData.dflid=n,getApp().globalData.xflid=0,t.switchTab({url:"/pages/category/category"})},todetail:function(n){t.navigateTo({url:"/pages/advdetail/advdetail?id="+n})},changemiaosstyle:function(t){var n=this.productList[t];n.checked=!n.checked,"miaos"==n.miaosstyle?n.miaosstyle="miaosshow":n.miaosstyle="miaos",this.$set(this.productList,t,n)},sub:function(n){for(var e=t.getStorageSync("cartlist"),i=this.findidfromstor(n),o=0;oi[a].kcnum){t.showToast({title:"库存不足!",icon:"none"});break}i[a].total=parseFloat(i[a].num*i[a].price*100)/100,t.setStorageSync("cartlist",i);break}}else{1==e?i.push(this.findarrbyid(n)):i.push(this.findarrbyid_tj(n));for(var r=0;r0){var o=t.getStorageSync("cartlist");if(n>i)return void t.showToast({title:"库存不足",icon:"none"});for(var a=0;a