shopDetail.js 4.3 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["detail/shopDetail/shopDetail"],{"0625":function(t,e,n){"use strict";n.r(e);var o=n("4909"),i=n("fc5f");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("7cae");var a=n("f0c5"),u=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=u.exports},"3cc6":function(t,e,n){},4909:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return o}));var o={zsImg:function(){return Promise.all([n.e("common/vendor"),n.e("components/zs-img/index")]).then(n.bind(null,"3acd"))},uEmpty:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-empty/u-empty")]).then(n.bind(null,"8878"))}},i=function(){var t=this,e=t.$createElement,n=(t._self._c,(t.info.shopVo.distance/1e3).toFixed(2)),o=t.freeList.length&&2==t.tab,i=o?t.__map(t.freeList,(function(e,n){var o=t.__get_orig(e),i=t._f("filterType")(e.useType,e),s=t._f("filterType1")(e.validType,e);return{$orig:o,f0:i,f1:s}})):null,s=o?null:t.buyList.length&&1==t.tab,a=!t.freeList.length&&2==t.tab,u=!t.buyList.length&&1==t.tab;t.$mp.data=Object.assign({},{$root:{g0:n,g1:o,l0:i,g2:s,g3:a,g4:u}})},s=[]},5529:function(t,e,n){"use strict";(function(t){var o=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("bb78"),s=o(n("d542")),a=(n("e054"),{data:function(){return{tab:1,open:999,info:null,background:!1,status:"more",_mapContext:null,query:{currentPage:1,pageSize:99,setMealId:0,goodsType:1,shopId:"",userId:""},freeList:[],buyList:[],goodsTypeObj:{}}},filters:{filterType:function(t,e){return 1==t?"无使用限制":2==t?"使用期至"+e.useEndTime:3==t?"每周"+e.day+"可用":4==t?"每月"+e.day+"可用":void 0},filterType1:function(t,e){return 1==t?"有效期:无限制":2==t?"有效期:"+e.validStartTime+"-"+e.validEndTime:void 0}},methods:{handleAdress:function(t){this._mapContext.openMapApp({longitude:Number(t.longitude),latitude:Number(t.latitude),destination:t.shopVo.shopName,complete:function(t){console.log(t)}})},init:function(){var e;e=t.getStorageSync("userInfo")?JSON.parse(t.getStorageSync("userInfo")):{setMealId:0,userId:""},this.info=JSON.parse(t.getStorageSync("shopInfo")),this.query.shopId=this.info.shopVo.id,this.query.setMealId=e.setMealId,this.query.userId=e.userId,this.allCouponByUser(this.tab)},handleTab:function(t){this.tab=t,this.allCouponByUser(t)},handleOpen:function(t,e){t===this[e]?this[e]=7:this[e]=t},handleBuy:function(e){var n=this;if(t.getStorageSync("token")){if(2==e.buySet&&0==e.useCount)return t.showToast({title:"领取次数不足",icon:"none"});(0,i.creat)({discountId:[],goodsList:[e.goodsId],idempotent:(0,s.default)(),shopId:this.query.shopId}).then((function(e){"Success"==e.state&&(t.showToast({title:"领取成功"}),n.allCouponByUser(2))}))}else t.showModal({title:"请登录",confirmText:"去登录",success:function(e){e.confirm&&t.navigateTo({url:"/login/login/login"})}})},goShopDetail:function(e){t.setStorageSync("shopInfo",JSON.stringify(e)),t.navigateTo({url:"../../detail/shopDetail/shopDetail"})},goDetail:function(e){var n=e;n.shopName=this.info.shopVo.shopName,n.address=this.info.district,t.setStorageSync("goodsInfo",JSON.stringify(n)),t.navigateTo({url:"../goodsDetail/index"})},loadMore:function(){},allCouponByUser:function(e){var n=this;this.query.goodsType=e,(0,i.allCouponByUser)(this.query).then((function(o){"Success"==o.state&&(1==e?n.buyList=o.content.records:n.freeList=o.content.records,t.stopPullDownRefresh())}))}},onPullDownRefresh:function(){this.init()},onReady:function(){this._mapContext=t.createMapContext("map",this)},onPageScroll:function(t){},onShow:function(){this.init()},onLoad:function(e){this.goodsTypeObj=JSON.parse(t.getStorageSync("goodsTypeObj"))}});e.default=a}).call(this,n("543d")["default"])},6176:function(t,e,n){"use strict";(function(t,e){var o=n("4ea4");n("b7d7");o(n("66fd"));var i=o(n("0625"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"7cae":function(t,e,n){"use strict";var o=n("3cc6"),i=n.n(o);i.a},fc5f:function(t,e,n){"use strict";n.r(e);var o=n("5529"),i=n.n(o);for(var s in o)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(s);e["default"]=i.a}},[["6176","common/runtime","common/vendor"]]]);