index.js 7.5 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/productWindow/index"],{"22fc":function(t,e,i){"use strict";i.r(e);var s=i("7f37"),r=i.n(s);for(var n in s)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(n);e["default"]=r.a},"7f37":function(t,e,i){"use strict";(function(t){var s=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(i("9523")),n=i("4818"),a=i("f8b7"),o=i("26cb");function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function d(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?u(Object(i),!0).forEach((function(e){(0,r.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var c={computed:d(d({},(0,o.mapState)({nearbyStore:function(t){return t.app.nearbyStore}})),(0,o.mapGetters)(["isLogin"])),components:{addressWindow:function(){i.e("components/addressWindow/index").then(function(){return resolve(i("a8a7"))}.bind(null,i)).catch(i.oe)}},props:{isStoreBuy:{type:Number,value:0},productId:{type:Number|String,value:0},productType:{type:Number|String,value:0},cusPreviewImg:{type:Number,value:0},title:{type:String,default:""},attr:{type:Object,default:function(){}},storeInfo:{type:Object,default:function(){}},limitNum:{type:Number,value:0},isShow:{type:Number,value:0},iSbnt:{type:Number,value:0},iSplus:{type:Number,value:0},iScart:{type:Number,value:0},is_vip:{type:Number,value:0},type:{type:String,default:""},isFooter:{type:Boolean,default:!1}},data:function(){return{flag:1,addressInfo:"",deliveryName:"",distance:"",deliveryAddress:"",address:{address:!1},pagesUrl:"",user_latitude:0,user_longitude:0,isDelivery:!1,storeList:[],deliveryStoreList:[],selfStoreList:[],active:0,isStore:!1}},mounted:function(){try{this.user_latitude=t.getStorageSync("user_latitude"),this.user_longitude=t.getStorageSync("user_longitude")}catch(e){}},watch:{"attr.deliveryType":function(t,e){if(JSON.stringify(t)!=JSON.stringify(e)&&t.length){this.active<1&&this.getList();var i=1;i=1==t[0]&&this.isStoreBuy?t[1]:t[0],this.flag=i,this.$emit("deliveryFun",i)}}},methods:{closeStore:function(){this.isStore=!1},openStore:function(){1!=this.attr.isType&&(this.isStore=!0)},tapStore:function(t,e){this.active=t,this.deliveryName=e.name,this.deliveryAddress=e.detailed_address+" ",this.distance="距您"+e.range+"km",this.isStore=!1,this.$emit("onstoreId",e,this.flag)},OnChangeAddress:function(t,e){this.address.address=!1,this.addressInfo=e.province+"省 "+e.city+" "+e.district+" "+e.street+" "+e.detail,this.$emit("onAddressId",e)},openAddress:function(){this.$refs.addressWindow.getAddressList(),this.address.address=!0,this.pagesUrl="/pages/users/user_address/index"},goCat:function(){this.$emit("goCat")},getAddressList:function(){var t=this;(0,n.getAddressList)({page:1,limit:1}).then((function(e){var i=e.data[0];e.data.length?(t.addressInfo=i.province+"省 "+i.city+" "+i.district+" "+i.street+" "+i.detail,t.$emit("onAddressId",i)):t.addressInfo="点击添加地址"}))},changeClose:function(){this.$set(this.address,"address",!1)},selfLocation:function(){var e=this,i=this;t.getLocation({type:"wgs84",success:function(s){try{e.user_latitude=s.latitude,e.user_longitude=s.longitude,t.setStorageSync("user_latitude",s.latitude),t.setStorageSync("user_longitude",s.longitude)}catch(r){}i.getList()},fail:function(e){t.getSetting({success:function(e){"undefined"==typeof e.authSetting["scope.userLocation"]||e.authSetting["scope.userLocation"]||t.setStorageSync("refuseLocation",!0)}})}})},getList:function(t){var e=this,i={latitude:this.user_latitude||"",longitude:this.user_longitude||"",page:1,limit:100,product_id:this.productId,is_store:"",type:"seckill"==this.type?1:0,store_id:t||this.nearbyStore};(0,a.storeListApi)(i).then((function(i){var s=i.data.list.list;!t&&s.length&&e.attr&&(-1!=e.attr.deliveryType.indexOf("2")&&e.attr.store_self_mention||-1!=e.attr.deliveryType.indexOf("3"))&&(e.isDelivery=!0,e.$store.getters.isLogin&&e.getAddressList());var r=[];s.forEach((function(t,e){1===t.is_store&&r.push(t)})),e.storeList=2==e.flag?r:s,e.selfStoreList=r,e.deliveryStoreList=s,e.active=0,e.deliveryName=s[0].name,e.deliveryAddress=s[0].detailed_address+" ",e.distance="距您"+s[0].range+"km",e.$emit("onstoreId",s[0],e.flag)})).catch((function(t){e.$util.Tips({title:t})}))},bindCode:function(t){this.$emit("iptCartNum",this.attr.productSelect.cart_num)},closeAttr:function(){this.$emit("myevent")},CartNumDes:function(){this.$emit("ChangeCartNum",!1)},CartNumAdd:function(){this.$emit("ChangeCartNum",!0)},tapAttr:function(t,e){this.$emit("attrVal",{indexw:t,indexn:e}),this.$set(this.attr.productAttr[t],"index",this.attr.productAttr[t].attr_values[e]);var i=this.getCheckedValue().join(",");this.$emit("ChangeAttr",i)},getCheckedValue:function(){for(var t=this.attr.productAttr,e=[],i=0;i<t.length;i++)for(var s=0;s<t[i].attr_values.length;s++)t[i].index===t[i].attr_values[s]&&e.push(t[i].attr_values[s]);return e},getstoreInfo:function(e){if(1==e&&this.isStoreBuy)return!1;"2"!==e&&"3"!==e||this.user_latitude&&this.user_longitude||t.getStorageSync("refuseLocation")||this.selfLocation(),"2"===e&&(this.storeList=this.selfStoreList),"3"===e&&(this.storeList=this.deliveryStoreList),this.flag=e,this.active=0,this.deliveryName=this.storeList[0].name,this.deliveryAddress=this.storeList[0].detailed_address+" ",this.distance="距您"+this.storeList[0].range+"km",this.$emit("deliveryFun",e),this.$emit("onstoreId",this.storeList[0],e)},showLocation:function(){this.user_latitude&&this.user_longitude||t.getStorageSync("refuseLocation")||this.selfLocation()},showImg:function(){this.$emit("getImg")}}};e.default=c}).call(this,i("543d")["default"])},af2b:function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var s=function(){var t=this,e=t.$createElement,i=(t._self._c,"points"==t.type?parseFloat(t.attr.productSelect.integral):null),s="points"==t.type?parseFloat(t.attr.productSelect.price)&&parseFloat(t.attr.productSelect.integral):null,r="points"==t.type?parseFloat(t.attr.productSelect.price):null;t.$initSSP();var n=t.isDelivery?t.attr.deliveryType.includes("1"):null,a=t.isDelivery?t.attr.deliveryType.includes("2")&&t.attr.store_self_mention&&t.selfStoreList.length:null,o=t.isDelivery?t.attr.deliveryType.includes("3")&&t.storeList.length:null;t.$mp.data=Object.assign({},{$root:{m0:i,m1:s,m2:r,g0:n,g1:a,g2:o}}),"augmented"===t.$scope.data.scopedSlotsCompiler&&t.$setSSP("bottom",{attr:t.attr}),t.$callSSP()},r=[]},b8ac:function(t,e,i){"use strict";var s=i("f999"),r=i.n(s);r.a},c8cb:function(t,e,i){"use strict";i.r(e);var s=i("af2b"),r=i("22fc");for(var n in r)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(n);i("b8ac");var a=i("f0c5"),o=Object(a["a"])(r["default"],s["b"],s["c"],!1,null,"46938e5d",null,!1,s["a"],void 0);e["default"]=o.exports},f999:function(t,e,i){}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/productWindow/index-create-component',
  4. {
  5. 'components/productWindow/index-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("c8cb"))
  7. })
  8. },
  9. [['components/productWindow/index-create-component']]
  10. ]);