oil-station/gasStation-uni/unpackage/dist/build/mp-alipay/pages/index/index.js
2024-08-16 18:26:19 +08:00

1 line
9.3 KiB
JavaScript

(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["pages/index/index"],{"59de":function(e,t,n){"use strict";n.r(t);var o=n("f793"),i=n("6544");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("91a6");var r=n("f0c5"),s=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"6fa78bc9",null,!1,o["a"],void 0);t["default"]=s.exports},6544:function(e,t,n){"use strict";n.r(t);var o=n("f5f8"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},"73df":function(e,t,n){},"91a6":function(e,t,n){"use strict";var o=n("73df"),i=n.n(o);i.a},be30:function(e,t,n){"use strict";(function(e){var t=n("4ea4");n("5e99");t(n("66fd"));var o=t(n("59de"));my.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("c11b")["createPage"])},f5f8:function(e,t,n){"use strict";(function(e,o){var i=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n("2eee")),r=i(n("c973")),s=(i(n("2594")),i(n("648b"))),c=(n("66fd"),{data:function(){return{chainStoreId:"",indicatorDots:!0,autoplay:!0,interval:2e3,duration:500,joinmsg:"",msg:"1",show:!1,shows:"",title:"",oilTypeList:"",columns:[],oilInfo:{oilName:"未添加",oilPrice:"0",gbPrice:"0"},AppToken:e.getStorageSync("App-Token"),list1:[],list3:["http://47.95.206.185:83/topbj.png"],longitude:"",latitude:"",lon:"",lat:"",store:{name:"测试油站",description:"济南分店",address:"济南槐荫区"},welfare:[],distance:"",storeId:"",staffId:"",baseUrl:this.$baseUrl}},onLoad:function(t){var n=this;return(0,r.default)(a.default.mark((function o(){var i,r,s,c,u;return a.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(t.storeId&&e.setStorageSync("storeId",t.storeId),t.type&&e.setStorageSync("y_type",t.type),t.userId&&e.setStorageSync("y_userId",t.userId),i=decodeURIComponent(t.q),!t.q){o.next=20;break}return r=i.split("?")[1],s="19",c="",r.includes("&")?(u=r.split("&"),u.forEach((function(e){e.includes("storeId")?s=e.split("=")[1]:c=e.split("=")[1]}))):s=r.split("=")[1],e.setStorageSync("storeId",s),e.setStorageSync("inviteStaffId",c),n.storeId=e.getStorageSync("storeId"),n.chainStoreId=e.getStorageSync("chainStoreId"),n.staffId=e.getStorageSync("inviteStaffId"),o.next=16,n.getUserAuthority();case 16:return o.next=18,n.getOilType();case 18:o.next=21;break;case 20:e.getStorageSync("storeId")?n.storeId=e.getStorageSync("storeId"):("34",e.setStorageSync("storeId","34"));case 21:return o.next=23,n.getUserAuthority();case 23:return o.next=25,n.getOilType();case 25:return o.next=27,n.getTheJudgmentIsTheSame();case 27:case"end":return o.stop()}}),o)})))()},onShow:function(){this.isJoined(),this.getIndexBanner()},components:{tabbar:function(){n.e("components/tabbar/tabbar").then(function(){return resolve(n("9924"))}.bind(null,n)).catch(n.oe)}},methods:{getBannerUrl:function(e){var t="";return t=e.includes("http")?e:this.baseUrl+e,t},goPage:function(t){e.navigateTo({url:t})},getIndexBanner:function(){var t=this;e.getStorageSync("storeId")&&(0,s.default)({url:"business/indexBanner/list/"+e.getStorageSync("storeId"),method:"get"}).then((function(e){t.list1=e.data;for(var n=0;n<e.data.length;n++)e.data[n].bannerUrl.includes("http")?t.list1[n].bannerUrl=e.data[n].bannerUrl:t.list1[n].bannerUrl=t.baseUrl+e.data[n].bannerUrl;console.log(t.list1)}))},isJoined:function(){var e=this;this.AppToken&&(0,s.default)({url:"business/marketingActivity/activeNewlywedsRecords/applet",method:"get"}).then((function(t){console.log("11111"+t),200==t.code&&1==t.data?e.shows=!0:e.shows=!1}))},drawDown:function(){var t=this;(0,s.default)({url:"business/marketingActivity/activeNewlywedsRecords",method:"post",data:{storeId:this.storeId,chainStoreId:this.chainStoreId}}).then((function(n){console.log("11111"+n),200==n.code&&1==n.data?(t.shows=!1,e.showToast({title:"领取成功!"})):(t.shows=!1,e.showToast({title:"领取失败!"}))}))},selectActiveNewlyweds:function(){this.AppToken&&(0,s.default)({url:"business/marketingActivity/activeNewlyweds/applet",method:"get"}).then((function(e){console.log("11111"+e)}))},isExistStoreId:function(){e.getStorageSync("storeId")?this.getStore(e.getStorageSync("storeId")):this.getAddress(e.getStorageSync("storeId"))},getUserAuthority:function(){var t=this;e.getSetting({success:function(n){n.authSetting["scope.userLocation"],t.getAddress(e.getStorageSync("storeId"))},fail:function(e){}})},getTheJudgmentIsTheSame:function(){var t=this;return(0,r.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.AppToken){n.next=2;break}return n.abrupt("return");case 2:return n.next=4,(0,s.default)({url:"chainStoreInfo/theJudgmentIsTheSame",method:"get",data:{chainStoreId:e.getStorageSync("chainStoreId")}}).then((function(t){t.data||e.removeStorageSync("App-Token")}));case 4:o.login({success:function(t){t.code?(0,s.default)({url:"clientApi/sign/mpWxLogin2",method:"POST",data:{code:t.code}}).then((function(t){t.data||e.removeStorageSync("App-Token")})):console.log("登录失败!"+t.errMsg)}});case 5:case"end":return n.stop()}}),n)})))()},getStore:function(t){var n=this;(0,s.default)({url:"business/storeInformation/store/queryStoreById",method:"post",data:{storeId:t}}).then((function(t){n.store=t.data;var o=t.data.welfare;if(e.setStorageSync("storeId",t.data.id),e.setStorageSync("chainStoreId",t.data.chainStoreId),o&&(o.includes(",")?n.welfare=t.data.welfare.split(","):n.welfare.push(t.data.welfare)),t.data.doorstepPhoto){var i=JSON.parse(t.data.doorstepPhoto);n.list3=[],i.forEach((function(e){n.list3.push(n.baseUrl+e)}))}})).catch((function(e){}))},getAddress:function(t){var n=this;e.getLocation({type:"gcj02",success:function(o){""==n.longitude&&""==n.latitude&&(n.longitude=o.longitude,n.latitude=o.latitude),console.log("经度: "+n.longitude),console.log("纬度: "+n.latitude),(0,s.default)({url:"business/storeInformation/store/recentlyStore",method:"post",data:{lon:n.longitude,lat:n.latitude,storeId:t,isLogin:n.AppToken?"0":"1"}}).then((function(t){if(t.data.store){n.distance=Math.ceil(t.data.distance).toFixed(1),n.store=t.data.store,e.setStorageSync("storeId",t.data.store.id),e.setStorageSync("chainStoreId",t.data.store.chainStoreId);var o=t.data.store.welfare;if(o&&(o.includes(",")?n.welfare=t.data.store.welfare.split(","):n.welfare.push(t.data.store.welfare)),t.data.store.doorstepPhoto){var i=JSON.parse(t.data.store.doorstepPhoto);n.list3=[],i.forEach((function(e){n.list3.push(n.baseUrl+e)}))}n.lon=n.store.longitude,n.lat=n.store.latitude,n.getIndexBanner()}else e.showToast({title:"当前店铺已关闭!!!",icon:"none"})}))},fail:function(e){n.getStore(2),console.log("获取位置信息失败: "+e.errMsg)}})},getOilType:function(){var t=this,n={storeId:e.getStorageSync("storeId")};(0,s.default)({url:"business/petrolStationManagement/oilNumber/getList2",method:"get",params:n}).then((function(e){if(200==e.code){t.oilTypeList=e.data.records,t.oilTypeList.length>0&&(t.oilInfo.oilName=t.oilTypeList[0].oilName,t.oilInfo.oilPrice=t.oilTypeList[0].oilPrice,t.oilInfo.gbPrice=t.oilTypeList[0].gbPrice);var n=[];t.oilTypeList.forEach((function(e){var t={id:e.numberId,label:e.oilName,oilPrice:e.oilPrice,gbPrice:e.gbPrice};n.push(t)})),t.columns=[n],console.log("aaa",t.columns)}}))},confirm:function(e){console.log("选中的油号",e),this.oilInfo.oilName=e.value[0].label,this.oilInfo.oilPrice=e.value[0].oilPrice,this.oilInfo.gbPrice=e.value[0].gbPrice,this.show=!1},cancel:function(){this.show=!1},goActivity:function(){e.navigateTo({url:"/pagesHome/Activity/index"})},goCard:function(){e.navigateTo({url:"/pagesHome/MyCard/MyCard"})},goOil:function(){e.navigateTo({url:"/pages/refuel/refuel"})},goChooseAddress:function(){var t=this;e.chooseLocation({success:function(e){var n=e.name,o=e.address,i=e.latitude,a=e.longitude;console.log(n,o,i,a),t.longitude=a,t.latitude=i,t.getAddress()}})},goMall:function(){e.navigateTo({url:"/pagesHome/PointsMall/PointsMall"})},toQRcode:function(){e.navigateTo({url:"/pagesHome/QRcode/QRcode"})},goGoGo:function(){var t=Number(this.lat),n=Number(this.lon);e.openLocation({latitude:t,longitude:n,success:function(){console.log("success")},complete:function(e){console.log(e)}})}}});t.default=c}).call(this,n("c11b")["default"],n("c11b")["default"])},f793:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var o={uniIcons:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/npm-scope-dcloudio/uni-ui/lib/uni-icons/uni-icons")]).then(n.bind(null,"fefe"))},uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,"52de"))},uSwiper:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-swiper/u-swiper")]).then(n.bind(null,"6964"))},uPicker:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-picker/u-picker")]).then(n.bind(null,"c4f4"))},uOverlay:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-overlay/u-overlay")]).then(n.bind(null,"a2b9"))},tabbar:function(){return n.e("components/tabbar/tabbar").then(n.bind(null,"9924"))}},i=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.show=!0},e.e1=function(t){e.show=!1})},a=[]}},[["be30","common/runtime","common/vendor"]]]);