1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"102d":function(e,t,o){},"40ad":function(e,t,o){"use strict";(function(e,n){var a=o("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(o("7eb4")),s=a(o("ee10")),r=(a(o("b530")),a(o("7073"))),c=(o("3240"),{data:function(){return{isOpen:!1,chainStoreId:"",indicatorDots:!0,autoplay:!0,interval:3e3,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 o=this;return(0,s.default)(i.default.mark((function n(){var a,s,r,c,l,u,d;return i.default.wrap((function(n){while(1)switch(n.prev=n.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),"WECHAT"!=e.getStorageSync("appltType")){n.next=12;break}return a=decodeURIComponent(t.q),t.q?(s=a.split("?")[1],r="",c="",l="",u="",console.log(111),s.includes("&")?(d=s.split("&"),d.forEach((function(e){e.includes("storeId")?r=e.split("=")[1]:e.includes("staffId")?c=e.split("=")[1]:e.includes("userId")?l=e.split("=")[1]:e.includes("type")&&(u=e.split("=")[1])}))):r=s.split("=")[1],e.setStorageSync("storeId",r),e.setStorageSync("y_type",u),e.setStorageSync("y_userId",l),e.setStorageSync("inviteStaffId",c),o.storeId=e.getStorageSync("storeId"),o.chainStoreId=e.getStorageSync("chainStoreId"),o.staffId=e.getStorageSync("inviteStaffId")):e.getStorageSync("storeId")&&(o.storeId=e.getStorageSync("storeId")),n.next=8,o.getUserAuthority();case 8:return n.next=10,o.getTheJudgmentIsTheSame();case 10:n.next=16;break;case 12:return n.next=14,o.getUserAuthority();case 14:return n.next=16,o.getTheJudgmentIsTheSame();case 16:case"end":return n.stop()}}),n)})))()},onShow:function(){var e=this;return(0,s.default)(i.default.mark((function t(){return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getTheJudgmentIsTheSame();case 2:return t.next=4,e.isJoined();case 4:e.isRecharge();case 5:case"end":return t.stop()}}),t)})))()},components:{tabbar:function(){o.e("components/tabbar/tabbar").then(function(){return resolve(o("45e5"))}.bind(null,o)).catch(o.oe)}},methods:{isRecharge:function(){var e=this;(0,r.default)({url:"business/storeInformation/store/isRecharge",method:"get"}).then((function(t){t.data?e.isOpen=!0:e.isOpen=!1}))},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,r.default)({url:"business/indexBanner/list/"+e.getStorageSync("storeId"),method:"get"}).then((function(e){if(t.list1=e.data,e.data.length>0){for(var o=0;o<e.data.length;o++)e.data[o].bannerUrl.includes("http")?t.list1[o].bannerUrl=e.data[o].bannerUrl:t.list1[o].bannerUrl=t.baseUrl+e.data[o].bannerUrl;console.log(t.list1)}}))},isJoined:function(){var t=this,o={storeId:e.getStorageSync("storeId")};this.AppToken&&(0,r.default)({url:"business/marketingActivity/activeNewlywedsRecords/applet",method:"get",params:o}).then((function(e){console.log("11111"+e),200==e.code&&1==e.data?t.shows=!0:t.shows=!1}))},drawDown:function(){var t=this;(0,r.default)({url:"business/marketingActivity/activeNewlywedsRecords",method:"post",data:{storeId:this.storeId,chainStoreId:this.chainStoreId}}).then((function(o){console.log("11111"+o),200==o.code&&1==o.data?(t.shows=!1,e.showToast({title:"领取成功!"})):(t.shows=!1,e.showToast({title:"领取失败!"}))}))},selectActiveNewlyweds:function(){this.AppToken&&(0,r.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(o){0==o.authSetting["scope.userLocation"]?t.showRefuseLocationPermission():t.getAddress(e.getStorageSync("storeId"))},fail:function(e){console.log("jujuel",e)},complete:function(e){},withSubscriptions:function(e){console.log("4",e)}})},showRefuseLocationPermission:function(){var t=this;n.showModal({title:"提示",content:"需要获取用户位置权限",confirmText:"前往设置",showCancel:!1,success:function(o){o.confirm&&e.openSetting({success:function(e){console.log("打开设置成功",e),e.authSetting["scope.userLocation"]?(console.log("成功授权userLocation"),t.getAddress()):(console.log("用户未授权userLocation"),t.showRefuseLocationPermission())},fail:function(e){console.log("打开设置失败",e)}})}})},getStorageSize:function(){var t=this;e.getStorageInfo({success:function(e){console.log(e),console.log(e.keys),console.log(e.limitSize);var o=e.currentSize;o<1024?t.storageSize=o+" B":o/1024>=1&&o/1024/1024<1?t.storageSize=Math.floor(o/1024*100)/100+" KB":o/1024/1024>=1&&(t.storageSize=Math.floor(o/1024/1024*100)/100+" M")}})},getTheJudgmentIsTheSame:function(){var t=this;return(0,s.default)(i.default.mark((function o(){return i.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(console.log(t.AppToken,547),t.AppToken){o.next=3;break}return o.abrupt("return");case 3:return o.next=5,(0,r.default)({url:"chainStoreInfo/theJudgmentIsTheSame",method:"get",data:{chainStoreId:e.getStorageSync("chainStoreId")}}).then((function(t){t.data||e.removeStorageSync("App-Token")}));case 5:"WECHAT"==e.getStorageSync("appltType")&&n.login({success:function(t){t.code?(0,r.default)({url:"clientApi/sign/mpWxLogin2",method:"POST",data:{code:t.code}}).then((function(t){t.data||e.removeStorageSync("App-Token")})):console.log("登录失败!"+t.errMsg)}}),"ALIPAY"==e.getStorageSync("appltType")&&my.getAuthCode({scopes:"auth_base",success:function(t){var o=t.authCode;console.log(t),(0,r.default)({url:"clientApi/sign/alipayLogin/getUserid2",method:"post",data:{authCode:o,storeId:e.getStorageSync("storeId")}}).then((function(t){console.log(t,85412),t.data||e.removeStorageSync("App-Token")}))},fail:function(e){console.log("my.getAuthCode 调用失败",e)}});case 7:case"end":return o.stop()}}),o)})))()},getStore:function(t){var o=this;(0,r.default)({url:"business/storeInformation/store/queryStoreById",method:"post",data:{storeId:t}}).then((function(t){o.store=t.data;var n=t.data.welfare;if(e.setStorageSync("storeId",t.data.id),e.setStorageSync("chainStoreId",t.data.chainStoreId),n&&(n.includes(",")?o.welfare=t.data.welfare.split(","):o.welfare.push(t.data.welfare)),t.data.doorstepPhoto){var a=JSON.parse(t.data.doorstepPhoto);o.list3=[],a.forEach((function(e){o.list3.push(o.baseUrl+e)}))}})).catch((function(e){}))},getAddress:function(t){var o=this;e.getLocation({type:"gcj02",success:function(n){""==o.longitude&&""==o.latitude&&(o.longitude=n.longitude,o.latitude=n.latitude),console.log("经度: "+o.longitude),console.log("纬度: "+o.latitude),(0,r.default)({url:"business/storeInformation/store/recentlyStore",method:"post",data:{lon:o.longitude,lat:o.latitude,storeId:t,isLogin:o.AppToken?"0":"1"}}).then((function(t){if(console.log(t,"2154"),t.data.store){if(o.distance=Math.ceil(t.data.distance).toFixed(1),o.store=t.data.store,e.setStorageSync("storeId",t.data.store.id),e.setStorageSync("chainStoreId",t.data.store.chainStoreId),console.log(e.getStorageSync("chainStoreId")),t.data.store.welfare&&(t.data.store.welfare.includes(",")?o.welfare=t.data.store.welfare.split(","):o.welfare.push(t.data.store.welfare)),t.data.store.doorstepPhoto){var n=JSON.parse(t.data.store.doorstepPhoto);o.list3=[],n.forEach((function(e){o.list3.push(o.baseUrl+e)}))}o.lon=o.store.longitude,o.lat=o.store.latitude,o.getIndexBanner(),o.getOilType()}else e.showToast({title:"当前店铺已关闭!!!",icon:"none"})})).catch((function(e){}))},fail:function(e){o.getStore(2),console.log("获取位置信息失败: "+e.errMsg)}})},getOilType:function(){var t=this,o={storeId:e.getStorageSync("storeId")};console.log(e.getStorageSync("storeId")),(0,r.default)({url:"business/petrolStationManagement/oilNumber/getList2",method:"get",params:o}).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 o=[];console.log(t.oilTypeList),t.oilTypeList.forEach((function(e){var t={id:e.numberId,label:e.oilName,oilPrice:e.oilPrice,gbPrice:e.gbPrice};o.push(t)})),t.columns=[o]}}))},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 o=e.name,n=e.address,a=e.latitude,i=e.longitude;console.log(o,n,a,i),t.longitude=i,t.latitude=a,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),o=Number(this.lon);e.openLocation({latitude:t,longitude:o,name:this.store.name,address:this.store.address,success:function(){console.log("success")},complete:function(e){console.log(e)}})}}});t.default=c}).call(this,o("df3c")["default"],o("3223")["default"])},"5d7f":function(e,t,o){"use strict";var n=o("102d"),a=o.n(n);a.a},a4c5:function(e,t,o){"use strict";o.d(t,"b",(function(){return a})),o.d(t,"c",(function(){return i})),o.d(t,"a",(function(){return n}));var n={uniIcons:function(){return Promise.all([o.e("common/vendor"),o.e("node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons")]).then(o.bind(null,"069f"))},uSwiper:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-swiper/u-swiper")]).then(o.bind(null,"879f"))},uPicker:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-picker/u-picker")]).then(o.bind(null,"3c1f"))},uOverlay:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-overlay/u-overlay")]).then(o.bind(null,"2dea"))},tabbar:function(){return o.e("components/tabbar/tabbar").then(o.bind(null,"45e5"))}},a=function(){var e=this,t=e.$createElement,o=(e._self._c,e.welfare.length);e._isMounted||(e.e0=function(t){e.show=!1}),e.$mp.data=Object.assign({},{$root:{g0:o}})},i=[]},a964:function(e,t,o){"use strict";o.r(t);var n=o("40ad"),a=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(i);t["default"]=a.a},b3fe:function(e,t,o){"use strict";o.r(t);var n=o("a4c5"),a=o("a964");for(var i in a)["default"].indexOf(i)<0&&function(e){o.d(t,e,(function(){return a[e]}))}(i);o("5d7f");var s=o("828b"),r=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"6c511a24",null,!1,n["a"],void 0);t["default"]=r.exports},f46c:function(e,t,o){"use strict";(function(e,t){var n=o("47a9");o("3cca");n(o("3240"));var a=n(o("b3fe"));e.__webpack_require_UNI_MP_PLUGIN__=o,t(a.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])}},[["f46c","common/runtime","common/vendor"]]]); |