1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324 |
- <template>
- <view class="content">
- <view class="top" :style="{background:'#'+themeColor}">
- <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
- <view class="logoBox">
- <image src="../../static/img2/indexlogo.png" mode="" class="logoImg"></image>
- </view>
- </view>
- <view>
- <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
- <view style="height: 100rpx;"></view>
- </view>
- <view class="topCont" :style="{background:'#'+themeColor}">
- <view class="carBox">
- <view class="carLeft">
- <view class="carTop">
- <image src="../../static/timg/nocar.png" mode="" class="carLogo"></image>
- <view class="carInfomodel">{{carInfo.brand}} {{carInfo.model}}</view>
- <image src="../../static/img2/xia.png" mode="" class="carXia"></image>
- <view class="plateNumber">{{carInfo.plateNumber}}</view>
- <image src="../../static/img2/carBj.png" mode="" class="carBj"></image>
- </view>
- <view class="carBq">
- <view class="carBqLine">
- <image src="../../static/img2/carDui.png" mode="" class="carDui"></image>
- <view class="carTitle">车况报告</view>
- </view>
- <view class="carBqLine">
- <image src="../../static/img2/carDui.png" mode="" class="carDui"></image>
- <view class="carTitle">车况报告</view>
- </view>
- <view class="carBqLine">
- <image src="../../static/img2/carDui.png" mode="" class="carDui"></image>
- <view class="carTitle">车况报告</view>
- </view>
- </view>
- </view>
- <view class="carRight">
- <image src="../../static/img2/carLogo.png" mode="" class="carLogoBg"></image>
- </view>
- </view>
- </view>
- <view class="contBox">
- <!-- 中间应用模块 -->
- <view class="modular">
- <view class="modularLine">
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle">做保养</view>
- </view>
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle">做保养</view>
- </view>
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle">做保养</view>
- </view>
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle">做保养</view>
- </view>
- </view>
- <view class="modularLine" style="margin-top: 13rpx;">
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle2">做保养</view>
- </view>
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle2">做保养</view>
- </view>
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle2">做保养</view>
- </view>
- <view class="modularMk">
- <view class="modularLogoBox">
- <image src="../../static/img2/icon_1.png" mode="" class="modularLogo"></image>
- </view>
- <view class="modularTitle2">做保养</view>
- </view>
- </view>
- </view>
- <!-- 中间应用模块 -->
- </view>
-
-
- <view style="height: 60rpx;"></view>
- <!-- 手机号授权 -->
- <view class="authorizBox" v-if="authorizShow" @click="authorizShowHide">
- <view class="authorizCont" @click.stop="">
- <view class="authorizName">{{wxOpenData.miniAppName}}</view>
- <view class="authorizMs">未注册的手机号登录后将自动创会员账号,如果您不同意授权获取手机号,会影响您使用我们的产品和服务。</view>
- <view class="sqLine">
- <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
- <view class="sqRefuse" @click="authorizShowHide">拒绝</view>
- </view>
-
- </view>
- <view style="text-align: center;padding-top: 56rpx;">
- <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
- </view>
- </view>
-
-
- <view class="qrBox" v-if="qrSHow">
- <view class="qrimgBox">
- <view class="qrTitle">微信绑定
- <image src="../../static/timg/chahao.png" mode="" class="qrimgchahao" @click="qrclose"></image>
- </view>
- <view class="qrms">扫描/长按下方二维码进行绑定</view>
- <view class="qrms2">绑定后可接收微信消息通知</view>
- <view style="text-align: center;padding-top: 30rpx;">
- <image :src="qrimg" mode="" class="qrimg" :show-menu-by-longpress='true'></image>
- </view>
-
- <view class="qrBtn" @click="qrclose">我知道了</view>
- </view>
- </view>
-
- </view>
- </template>
- <script>
-
- export default {
-
- data() {
- return {
- shopId: '',
- url:'',
- wxOpenData:'',
- code:'',
- carInfo:'',
- homeCardList:'',
- authorizShow:false,
- miniAppName:'',
- iStatusBarHeight:'',
- managerInfo:'',
- unionId:'',
- ext:'',
- duration:500,
- interval:3000,
- InsuranceExpireDate:'',
- NextCareDate:'',
- NextAuditDate:'',
- themeColor:'',
- getwxLoing:false,
- shareID:'',
- discount:'',
- bizUserId:'',
- coCouponsMsg:'',
- coNoNewCustMsg:'',
- qrimg:'',
- qrSHow:false,
- customerInfo:'',
- exitNum:'',
- }
- },
- onLoad(opt) {
- this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
- var that=this;
- //this.$common.getExtStoreId()
- var ext=this.$common.getExtStoreId();
- this.ext=ext
- console.log("ext--themeColor")
- console.log(ext)
- //console.log( String(Date.now()))
- this.shopId=ext.shopId;
- this.url=ext.url;
- this.unionId=ext.unionId;
- var shareID = opt.scene //'F16E7299-6850-4015-ABCE-A9F2794B45B5'
-
- if (shareID) {
- this.shareID = shareID
- console.log('this.shareID==='+this.shareID)
- //this.$store.commit('mutationsshareID', shareID)
- }
- //this.shareID='F16E7299-6850-4015-ABCE-A9F2794B45B5'
- //this.shareID='1BF04FAEC8844ECE9C40E880C3B13721'
-
- //this.unionId="26A1039A-DB10-4D0E-BBA2-541C06274EED";
- //this.ext.appId="wxffd2502e67d37908"
- // uni.setStorage({
- // key: 'extdata',
- // data: {
- // shopId:'E37BB296-5A08-4534-859D-B351BA611AF9',
- // },
- // success: function () {
- // that.uniLogin()
-
- // }
- // });
- //this.userInfo = uni.getStorageSync("userInfo");
- this.userInfo=this.$store.state.userInfo
- if(this.userInfo){
- //this.wxOpenData = uni.getStorageSync("wxOpenData");
- this.getCarList();
- this.queryHomeCardList()
- this.queryManagerInfo()
- }else{
- this.uniLogin()
-
- }
- //版本更新
- this.UpdateManager();
-
- },
- onShow() {
-
- this.userInfo=this.$store.state.userInfo;
- this.wxOpenData=this.$store.state.wxOpenData;
- var indexaddcar = uni.getStorageSync("indexaddcar");
- var themeColor = uni.getStorageSync("themeColor");
- if(themeColor){
- this.themeColor=themeColor
- }
- this.getwxLoing=true;
- this.exitNum=this.$store.state.exitNum;
- if(this.exitNum==1){
- this.carInfo=''
- }else{
- if(indexaddcar==1){
- uni.removeStorageSync('indexaddcar');
- this.getCarList();
- }else{
- this.carInfo=this.$store.state.carInfo;
- console.log("车辆信息")
- console.log(this.carInfo)
- if(!this.carInfo){
- this.getCarList();
- }
- this.jsTime()
- }
- }
-
-
-
-
- },
- onPullDownRefresh(){
- this.getCarList();
- this.queryHomeCardList()
- this.queryManagerInfo()
- setTimeout(() => {
- uni.stopPullDownRefresh(); // 关闭下拉刷新
- }, 1000);
- },
- methods: {
- seeQr(){
- // this.authorizShow = true;
- // return false;
- if (this.userInfo) {
-
- } else {
- this.authorizShow = true;
- return false;
- }
- uni.showLoading({
- title: '加载中'
- })
- this.$request.httpBinary('wxV2/createQrCode', {
- type:'bindWx',
- customerId:this.customerInfo.id,
- unionID:this.customerInfo.unionID,
- }, 'GET').then(res => {
- uni.hideLoading();
- this.qrimg = 'data:image/png;base64,'+uni.arrayBufferToBase64(res);
- this.qrSHow=true;
- //this.img= uni.arrayBufferToBase64(res)
- //console.log('list+=', this.queryShopList);
-
- })
- },
- qrclose(){
- this.qrSHow=false;
- },
- authorizShowHide(){
- this.authorizShow=false
- },
- UpdateManager(){
- const updateManager = uni.getUpdateManager();
- updateManager.onCheckForUpdate(function (res) {
- // 请求完新版本信息的回调
- console.log(res.hasUpdate);
- });
-
- updateManager.onUpdateReady(function (res) {
- uni.showModal({
- title: '更新提示',
- content: '新版本已经准备好,是否重启应用?',
- success(res) {
- if (res.confirm) {
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
- updateManager.applyUpdate();
- }
- }
- });
-
- });
-
- updateManager.onUpdateFailed(function (res) {
- // 新的版本下载失败
- uni.showToast({
- title: '新的版本下载失败',
- icon:'none',
- duration: 3000
- });
- });
- },
- addCar(){
- if(!this.userInfo){
- if(this.exitNum!=1){
- this.authorizShow=true;
- }else{
- this.$common.automaticlogin().then(val => {
- this.userInfo=this.$store.state.userInfo;
- this.wxOpenData=this.$store.state.wxOpenData;
- /* uni.navigateTo({
- url:'../user/addCar/addCar?type=1'
- }) */
- this.exitNum=''
- this.$store.commit('mutationsexitNum', '')
- this.getCarList();
- uni.navigateTo({
- url:'../user/addCar/cailist'
- })
- })
- }
-
- }else{
- uni.navigateTo({
- url:'../user/addCar/addCar?type=1'
- })
- }
- },
- goShop(){
-
- uni.switchTab({
- url:'../shop/shop'
- })
- },
- moreJk(){
- uni.switchTab({
- url:'../activity/activity'
- })
- },
- information(){
- console.log('车辆信息--',this.carInfo);
- uni.navigateTo({
- url:'handbook?mileage='+this.carInfo.milage+'&liyangId='+this.carInfo.nLevelID
- })
- },
- changeCar(){
- /* uni.scanCode({
- success: function (res) {
- console.log('条码类型:' + res.scanType);
- console.log( res);
- }
- });
- return false; */
- uni.navigateTo({
- url:'../user/addCar/cailist'
- })
- },
- goMUsers(){
- if(!this.userInfo){
- this.authorizShow=true;
-
- }else{
- var managerInfo={
- name:this.managerInfo.name,
- shopInfo:{
- shopName:this.managerInfo.shopInfo.shopName,
- provinceName:this.managerInfo.shopInfo.provinceName,
- cityName:this.managerInfo.shopInfo.cityName,
- areaName:this.managerInfo.shopInfo.areaName,
- Address:this.managerInfo.shopInfo.Address,
-
- },
- avatar:this.managerInfo.avatar,
- phone:this.managerInfo.phone,
- shopID:this.managerInfo.shopInfo.id
- }
- uni.navigateTo({
- url:'../index/personalCard?adInfo='+JSON.stringify(managerInfo)
- })
- }
- },
- goGoods(item){
- uni.navigateTo({
- url:'../shop/goodsDetail?id='+item.id
- })
- /* if(!this.userInfo){
- if(this.exitNum!=1){
- this.authorizShow=true;
- }else{
- this.$common.automaticlogin().then(val => {
- this.userInfo=this.$store.state.userInfo;
- this.wxOpenData=this.$store.state.wxOpenData;
- this.exitNum=''
- this.$store.commit('mutationsexitNum', '')
- uni.navigateTo({
- url:'../shop/goodsDetail?id='+item.id
- })
- })
- }
- }else{
- uni.navigateTo({
- url:'../shop/goodsDetail?id='+item.id
- })
- } */
- /* if(!this.userInfo){
- this.authorizShow=true;
- }else{
- uni.navigateTo({
- url:'../shop/goodsDetail?id='+item.id
- })
- } */
- },
- goJk(item){
- uni.navigateTo({
- url:'../activity/jkDetail?id='+item.id
- })
- /* if(!this.userInfo){
- this.authorizShow=true;
- }else{
- uni.navigateTo({
- url:'../activity/jkDetail?id='+item.id
- })
- } */
- /* if(!this.userInfo){
- if(this.exitNum!=1){
- this.authorizShow=true;
- }else{
- this.$common.automaticlogin().then(val => {
- this.userInfo=this.$store.state.userInfo;
- this.wxOpenData=this.$store.state.wxOpenData;
- this.exitNum=''
- this.$store.commit('mutationsexitNum', '')
- uni.navigateTo({
- url:'../activity/jkDetail?id='+item.id
- })
- })
- }
- }else{
- uni.navigateTo({
- url:'../activity/jkDetail?id='+item.id
- })
- } */
-
- },
- goRoter(item){
- /* if(!this.userInfo){
- if(this.exitNum!=1){
- this.authorizShow=true;
- }else{
- this.$common.automaticlogin().then(val => {
- this.userInfo=this.$store.state.userInfo;
- this.wxOpenData=this.$store.state.wxOpenData;
- this.exitNum=''
- this.$store.commit('mutationsexitNum', '')
- this.goRoter2(item)
- })
- }
- }else{
- this.goRoter2(item)
- } */
- this.$common.automaticlogin().then(val => {
- this.userInfo=this.$store.state.userInfo;
- this.wxOpenData=this.$store.state.wxOpenData;
- this.exitNum=''
- this.$store.commit('mutationsexitNum', '')
- this.goRoter2(item)
- })
-
- },
- goRoter2(item){
- console.log(item)
-
- if(!this.userInfo){
- //this.authorizShow=true;
-
- }else{
- if(item.bizType==0){
- if(item.name=='新车'){ //
- uni.navigateTo({
- url:'newCar'
- })
- }else if(item.name=='二手车'){
- uni.navigateTo({
- url:'usedCar'
- })
- }else if(item.name=='爱车估价'){
- uni.navigateTo({
- url:'evaluation'
- })
- }else if(item.sortId==18){ //领券中心
- uni.navigateTo({
- url:'receiveCoupon'
- })
- }else if(item.sortId==19){ //救援测试
-
- uni.navigateTo({
- url:'rescue'
- })
- }
-
- else{
- uni.showToast({
- title: '敬请期待',
- icon:'none',
- duration: 3000
- });
- }
- }else if(item.bizType==1){ //紧急救援
- uni.navigateTo({
- url:'rescue'
- })
- /* uni.showToast({
- title: '敬请期待',
- icon:'none',
- duration: 3000
- }); */
-
- }else if(item.bizType==2){ //钣金喷漆
- uni.navigateTo({
- url:'paint'
- })
- /* uni.navigateTo({
- url:'receiveCoupon'
- }) */
- }else if(item.bizType==3){ //保养
- uni.navigateTo({
- url:'maintain'
- })
- }else if(item.bizType==4){ //在线预约
- uni.navigateTo({
- url:'onlineBooking?naShopId='+item.naShopId
- })
- }else if(item.bizType==5){ //导航
-
- this.getShopinfo(5,item.reShopId)
- }else if(item.bizType==6){ //联系本店
- this.getShopinfo(6,item.orShopId)
-
- }else if(item.bizType==7){ //7门店列表
- uni.navigateTo({
- url:'shopList'
- })
- }else if(item.bizType==8){ //我的会员卡
- uni.navigateTo({
- url:'vipCard'
- })
- }else if(item.bizType==9){ //我的优惠券
- uni.navigateTo({
- url:'discountCard'
- })
- }else if(item.bizType==10){ //我的订单
- uni.navigateTo({
- url:'../user/myOrder/myOrder'
- })
- }else if(item.bizType==11){ //我的预约
- uni.navigateTo({
- url:'../user/myBespeak'
- })
- }else if(item.bizType==12){ //历史消费
- uni.navigateTo({
- url:'../user/historySpend'
- })
- }else if(item.bizType==12){ //历史消费
- uni.navigateTo({
- url:'../user/historySpend'
- })
- }else if(item.bizType==13){ //车检报告
- uni.navigateTo({
- url:'../user/checkReport'
- })
- }else if(item.bizType==14){ //指定商品分类
- uni.setStorage({
- key: 'shopcategoryID',
- data: item.bizId,
- success: function () {
- getApp().globalData.shopcategoryID=item.bizId;
- uni.switchTab({
- url:'../shop/shop?shopcategoryID='+ item.bizId
- })
- }
- });
-
- }else if(item.bizType==15){ //商品详情
- uni.navigateTo({
- url:'../shop/goodsDetail?id='+item.bizId
- })
- }else if(item.bizType==16){ //积分商城
- uni.navigateTo({
- url:'../integral/integral'
- })
- }else if(item.bizType==17){ //公司介绍
- uni.navigateTo({
- url:'aboutUS?unionID='+this.userInfo.unionId
- })
- }else if(item.bizType==18){ //领券中心
- uni.navigateTo({
- url:'receiveCoupon'
- })
- /* uni.navigateTo({
- url:'rescue'
- }) */
- }else if(item.bizType==19){
- //我的车库pages/user/addCar/cailist
-
- uni.navigateTo({
- url:'../user/addCar/cailist'
- })
- }
-
-
- // uni.navigateTo({
- // url:url
- // })
- }
-
- },
- decryptPhoneNumber: function(e) {
- console.log(e);
- this.code=e.detail.code
- this.wxPhoneLogin()
- this.authorizShow=false;
- },
- wxgologin(){
- var that=this;
- uni.getUserProfile({
- lang:'zh_CN',
- desc:'登录',
- success:(res)=>{
- console.log(res);
- that.wxdata=res;
- uni.setStorage({
- key: 'wxdata',
- data: res,
- success: function () {
- that.uniLogin()
-
- }
- });
- },
- fail:(res)=>{
- console.log(res)
- }
- });
- },
- uniLogin(){
- var that=this;
- uni.login({
- provider: 'weixin',
- success: function (loginRes) {
- console.log(loginRes);
- that.getWxOpenID(loginRes)
- }
- });
- },
- getWxOpenID(e){
- var that=this;
- // uni.showLoading({
- // title: '加载中'
- // })
- this.$http('miniApp2/sys/getWxOpenID', {
- code:e.code,
- unionId:this.unionId,
- shareId:this.shareID
- },'GET').then(res => {
- console.log(res.code);
- console.log("授权信息")
- console.log(res)
- //uni.hideLoading();
- if(res.code!=0){
- //uni.hideLoading();
- var msg=res.msg
- if(!msg){
- msg='授权失败'
- }
- console.log(msg);
- // uni.showModal({
- // title: '提示',
- // content: msg,
- // success: function(resTK) {
- // if (resTK.confirm) {
-
- // }
- // }
- // });
- // uni.showToast({
- // title:msg,
- // icon: 'none',
- // duration: 3000
- // });
- //return false
- }
- this.wxOpenData=res.data;
- this.themeColor=res.data.themeColor
- //this.themeColor='FFFFFF'
- this.getwxLoing=true;
- uni.setNavigationBarTitle({
- title:this.wxOpenData.miniAppName
- })
- if(this.themeColor=='6F2BE8'){
- var backgroundImage='/static/tabimg/index6F2BE8.png'
- }
- if(this.themeColor=='1677FF'){
- var backgroundImage='/static/tabimg/index1677FF.png'
- }
- if(this.themeColor=='FF4F00'){
- var backgroundImage='/static/tabimg/indexFF4F00.png'
- }
- if(this.themeColor=='D53533'){
- var backgroundImage='/static/tabimg/index1.png'
- }
- uni.setTabBarStyle({
- // color: '#FF0000',
- selectedColor: '#'+this.themeColor,
- })
- uni.setTabBarItem({
- index: 0,
- text: '首页',
- selectedIconPath: backgroundImage
- })
- if(res.code==0){
- that.queryHomeCardList()
- }
-
- //that.wxPhoneLogin()
- this.$store.commit('mutationswxOpenData', that.wxOpenData)
- uni.setStorage({
- key: 'wxOpenData',
- data: that.wxOpenData,
- success: function () {
- // that.uniLogin()
-
- }
- });
- uni.setStorage({
- key: 'themeColor',
- data: that.themeColor,
- success: function () {
- // that.uniLogin()
- console.log("themeColor=="+that.themeColor)
- }
- });
- if(this.wxOpenData.loginInfo){
- this.$store.commit('mutationsuserInfo', that.wxOpenData.loginInfo.openUser)
- this.userInfo=that.wxOpenData.loginInfo.openUser
- that.queryManagerInfo()
- uni.setStorage({
- key: 'userInfo',
- data: that.wxOpenData.loginInfo.openUser,
- success: function () {
- that.getCarList()
- }
- });
- }else{
- //this.authorizShow=true;
- }
- if(res.data.loginInfo.discount){
- that.discount=res.data.loginInfo.discount;
- if(that.discount==2){
- that.bizUserId=res.data.loginInfo.bizUserId;
- }
- if(that.shareID){
- that.getCouponList()
- }
- }
- if(res.data.loginInfo.coNoNewCustMsg){ //车主合伙人二维码提示
- uni.showModal({
- title: '提示',
- content:res.data.loginInfo.coNoNewCustMsg,
- success: function(resTKk) {
-
- }
- });
- }
-
- //console.log("优惠券")
-
-
-
-
-
- })
- },
- wxPhoneLogin(){
- var that=this;
- this.$http('miniApp2/sys/wxPhoneLogin', {
- appId:this.ext.appId,
- unionId:this.unionId,
- code:this.code,
- openId:this.wxOpenData.openid,
- shareId:this.shareID
- },'POST').then(res => {
- var data = res.data;
- if(data.loginInfo){
- this.userInfo=data.loginInfo.openUser;
- this.customerInfo=data.loginInfo.customerInfo
- this.$store.commit('mutationsuserInfo', this.userInfo);
- this.$store.commit('mutationswxOpenData', data);
-
- uni.setStorage({
- key: 'userInfo',
- data: data.loginInfo.openUser,
- success: function () {
- that.getCarList()
- that.queryHomeCardList()
- that.queryManagerInfo();
- if(data.loginInfo.coCouponsMsg){
- uni.hideLoading()
- that.coCouponsMsg =data.loginInfo.coCouponsMsg;
- that.ownerCoupon()
- }
- if(data.loginInfo.coNoNewCustMsg){
- //console.log(data.loginInfo.coNoNewCustMsg)
- uni.hideLoading()
- that.coNoNewCustMsg =data.loginInfo.coNoNewCustMsg;
- that.coNoNewCust()
- }
- if(data.loginInfo.discount){
- that.discount=data.loginInfo.discount;
-
- if(that.discount==2){
- that.bizUserId=data.loginInfo.bizUserId;
- }
- if(that.shareID&&that.discount==2){
- that.getCouponList()
- }
- }
-
-
-
- }
- });
-
-
- if(!this.customerInfo.wxMiniV2OpenID){
- this.seeQr()
- }
- }
-
- })
- },
- coNoNewCust(){
- console.log(111111)
- var that=this;
- uni.showModal({
- title: '提示',
- content: that.coNoNewCustMsg,
- success: function(resTK) {
-
- }
- });
- },
- ownerCoupon(){
- console.log(22222)
- var that=this;
- uni.showModal({
- title: '提示',
- content: that.coCouponsMsg,
- cancelText:'回到首页',
- confirmText:'查看',
- success: function(resTK) {
- if (resTK.confirm) {
- uni.navigateTo({
- url:'discountCard'
- })
- }
- }
- });
- },
- getCouponList(){
-
- if(this.discount!=2){
- var params={
- discount:this.discount
- }
- }else{
- var params={
- discount:this.discount,
- bizId:this.bizUserId
- }
- }
- var that=this;
- this.$http('opencoupon/getCouponList', params, 'GET').then(res => {
- var list = res.data;
- if(list.length>0){
- uni.showModal({
- title: '提示',
- content: '您有优惠券待领取',
- cancelText:'回到首页',
- confirmText:'查看',
- success: function(resTK) {
- if (resTK.confirm) {
- uni.navigateTo({
- url:'discountDlq?bizUserId='+that.bizUserId+'&discount='+that.discount
- })
- }
- }
- });
- }
-
-
- })
- },
- getCarList(){
- this.$http('opencarOwnerHome/queryCarInfoList', {
-
- },'GET').then(res => {
- if(res.code==401){
- // this.uniLogin()
- this.carInfo=''
- this.$store.commit('mutationscarInfo', '')
- }else{
- this.carInfo=res.data[0]
- //this.carInfo=[]
- this.$store.commit('mutationscarInfo', this.carInfo)
- /* this.carInfo.insuranceExpireDate='2022-11-11';
- this.carInfo.nextAuditDate='2022-08-13'; */
- //this.carInfo.nextCareDate='2022-08-11';
- //this.carInfo.nextCareMilage=11
- this.jsTime()
- }
-
- })
- },
- jsTime(){
- if(this.carInfo.insuranceExpireDate){
- if (Number(new Date().getTime()) > (Number(new Date(this.carInfo.insuranceExpireDate.replace(/-/g, '/')).getTime()) || 0)) {
- console.log("现在时间大于开始时间")
- this.InsuranceExpireDate = 0
- } else {
- this.clock()
- }
- }else{
- this.InsuranceExpireDate=''
- }
- if(this.carInfo.nextCareDate){
- if (Number(new Date().getTime()) > (Number(new Date(this.carInfo.nextCareDate.replace(/-/g, '/')).getTime()) || 0)) {
- this.NextCareDate = 0
- } else {
- this.clock2()
- }
- }else{
- this.NextCareDate = ''
- }
- if(this.carInfo.nextAuditDate){
- if (Number(new Date().getTime()) > (Number(new Date(this.carInfo.nextAuditDate.replace(/-/g, '/')).getTime()) || 0)) {
- this.NextAuditDate = 0
- } else {
- this.clock3()
- }
- }else{
- this.NextAuditDate=''
- }
-
- },
- clock () {
- let _this = this
- let today = new Date() // 当前时间
- let h = today.getHours()
- let m = today.getMinutes()
- let s = today.getSeconds()
- let stopTime = new Date(_this.carInfo.insuranceExpireDate.replace(/-/g, '/')) // 结束时间
- let stopH = stopTime.getHours()
- let stopM = stopTime.getMinutes()
- let stopS = stopTime.getSeconds()
- let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
- let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
- this.InsuranceExpireDate=shengyuD+1;
-
- // setTimeout(_this.clock, 500)
- },
- clock2 () {
- let _this = this
- let today = new Date() // 当前时间
- let stopTime = new Date(_this.carInfo.nextCareDate.replace(/-/g, '/')) // 结束时间
- let stopH = stopTime.getHours()
- let stopM = stopTime.getMinutes()
- let stopS = stopTime.getSeconds()
- let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
- let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
- this.NextCareDate=shengyuD+1;
-
- // setTimeout(_this.clock, 500)
- },
- clock3 () {
- let _this = this
- let today = new Date() // 当前时间
- let stopTime = new Date(_this.carInfo.nextAuditDate.replace(/-/g, '/')) // 结束时间
- let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
- let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
- this.NextAuditDate=shengyuD+1;
-
- // setTimeout(_this.clock, 500)
- },
- queryManagerInfo(){
- console.log("11")
- this.$http('openHome/queryManagerInfo', {
-
- },'GET').then(res => {
- this.managerInfo=res.data
-
- })
- },
- queryHomeCardList(){
- //console.log(this.wxOpenData)
- var that=this;
- uni.showLoading({
- title: '加载中'
- })
- this.$http('openHome/queryHomeCardList', {
- unionId:this.unionId
- },'GET').then(res => {
- uni.hideLoading();
- this.homeCardList=res.data;
- uni.setStorage({
- key: 'openMCar',
- data: res.data.openMCar,
- success: function () {
- that.getCarList()
- }
- });
-
- })
- },
- getShopinfo(num,shopId){
- var that=this;
- uni.showLoading({
- title: '加载中'
- })
- if(!shopId){
- shopId=''
- }
- this.$http('openmy/getShopinfo', {
- shopId:shopId
- },'GET').then(res => {
- uni.hideLoading();
- var res=res.data
- if(num==5){
- uni.openLocation({
- latitude:Number(res.lat),
- longitude:Number(res.lng),
- name: res.shopName,
- address: res.address,
- success: function() {
- console.log('success');
- },
- fail(err) {
- console.log(err)
- }
- });
- }else{
- uni.makePhoneCall({
- phoneNumber: res.mobilePhone
- });
- }
- })
- }
-
- },
- onShareAppMessage(){
-
- }
- }
- </script>
- <style scoped>
- .content{
- background: #F4F4F4;
- }
- .top{
- position: fixed;
- left: 0;
- width: 750rpx;
- top: 0;
- }
- .logoImg{
- height: 72rpx;width: 492rpx;
- }
- .logoBox{
- padding-left: 20rpx;
- padding-bottom: 20rpx;
- padding-top: 8rpx;
- }
- .topCont{
- padding: 8rpx 20rpx;
- padding-bottom: 210rpx;
- }
- .carBox{
- background: #FFFFFF;
- border-radius: 17rpx;
- display: flex;
- justify-content: space-between;
- padding-top: 20rpx;
- padding-right: 24rpx;
- padding-left: 30rpx;
- }
- .carLogoBg{
- width: 123rpx;
- height: 127rpx;
- }
- .carLogo{
- width: 42rpx;height: 42rpx;border-radius: 22rpx;
- }
- .carInfomodel{
- font-size: 30rpx;
- color: #0B0B0B;
- line-height: 42rpx;
- font-weight: 500;
- padding-left: 12rpx;
- }
- .carTop{
- display: flex;
- }
- .carXia{
- width: 12rpx;height: 9rpx;
- margin-left: 4rpx;margin-top: 18rpx;
- }
- .plateNumber{
- color: #0B0B0B;padding-right: 20rpx;
- line-height: 42rpx;
- font-size: 22rpx;padding-left: 20rpx;
- }
- .carBj{
- width: 12rpx;height: 15rpx;margin-top: 16rpx;
- }
- .carBq{
- display: flex;
- width: 446rpx;
- height: 47rpx;
- background: #FBF0E4;
- border-radius: 10rpx;
- margin-top: 18rpx;
- }
- .carDui{
- width: 24rpx;height: 24rpx;
- }
- .carBqLine{
- display: flex;
- padding-left: 20rpx;padding-right: 10rpx;padding-top: 10rpx;
- font-size: 22rpx;
- color: #A26D4F;line-height: 26rpx;
- }
- .carTitle{
- padding-left: 6rpx;
- }
- .modular{
- background: #FFFFFF;
- border-radius: 17rpx;
- padding: 34rpx 0;
- }
- .modularMk{
- padding: 0 38rpx;text-align: center;
- }
- .modularLine{
- display: flex;
- }
- .modularLogo{
- width: 97rpx;height: 97rpx;
- }
- .modularTitle{
- font-weight: 600;
- font-size: 28rpx;
- color: #222222;line-height: 40rpx;
- }
- .modularTitle2{
- font-size: 28rpx;
- color: #222222;line-height: 40rpx;
- }
- .contBox{x`
- padding: 20rpx;
- margin-top: -200rpx;
- }
- .authorizBox{
- width: 100vw;
- height: 100vh;
- background: rgba(0, 0, 0, 0.5);
- position: fixed;
- top: 0;
- left: 0;
- }
- .authorizCont{
- margin-top: 30vh;
- width: 564rpx;
- height: 408rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- margin-left: 93rpx;
- position: relative;
- }
- .authorizCloseImg{
- width: 62rpx;
- height: 62rpx;
- }
- .sqLogoBox{
- width: 180rpx;
- height: 180rpx;
- background: #FFFFFF;
- border-radius: 90rpx;
- text-align: center;
- position: absolute;
- top: -50rpx;
- left: 192rpx;
- }
- .authorizName{
- color: #333333;
- line-height: 42rpx;
- font-size: 30rpx;
- text-align: center;
- padding-top: 58rpx;
- }
- .authorizMs{
- color: #999999;
- line-height: 36rpx;
- font-size: 26rpx;
- width: 452rpx;
- padding-top: 24rpx;
- text-align: center;
- margin-left: 56rpx;
- }
- .authorizContbutton{
- width: 210rpx;
- height: 66rpx;
- background: #D53533;
- border-radius: 44rpx;
- line-height: 66rpx;
- text-align: center;
- font-size:30rpx;
- color: #FFFFFF;
-
- margin-left:40rpx;
- }
- .qrBox{
- position: fixed;
- width: 100vw;
- height: 100vh;
- background: rgba(0,0,0,0.5);
- left: 0;
- top: 0;
- z-index: 11;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- }
- .qrimgBox{
- width: 562rpx;
- height: 704rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- }
- .qrTitle{
- font-size: 30rpx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #333333;
- border-bottom: 1px solid #EEEEEE;
- text-align: center;
- line-height: 90rpx;
- position: relative;
- }
- .qrimgchahao{
- width: 38rpx;
- height: 38rpx;
- position: absolute;
- top: 26rpx;
- right: 20rpx;
- }
- .qrms{
- font-weight: 400;
- color: #999999;
- line-height: 37rpx;
- font-size: 26rpx;
- padding-top: 23rpx;
- text-align: center;
- }
- .qrms2{
- font-weight: 400;
- color: #999999;
- line-height: 37rpx;
- font-size: 26rpx;
- text-align: center;
- }
- .qrimg{
- width: 328rpx;
- height: 328rpx;
- }
- .qrBtn{
- width: 292rpx;
- height: 64rpx;
- background: #D53533;
- border-radius: 32rpx;
- color: #FFFFFF;
- line-height: 64rpx;
- text-align: center;
- margin: 0 auto;
- margin-top:40rpx;
- }
-
-
- </style>
|