12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457 |
- <template>
- <view class="content">
- <view class="indexTop" :style="{background:'#'+themeColor}" v-if="getwxLoing">
- <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
- <view class="indexnav">{{wxOpenData.unionName}}</view>
- </view>
- <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
- <view style="height: 43px;"></view>
- <view class="topBox" :style="{background:'#'+themeColor}" v-if="getwxLoing"></view>
- <view class="yuanhu" :style="{background:'#'+themeColor}" v-if="getwxLoing"></view>
- <view class="shoptopbox2" v-if="!carInfo">
- <view class="carinfoBox2">
- <view class="carinfoBoxNocar" @click="addCar">
- <img src="../../static/timg/addcar.png" alt="" class="carinfonocarIcon">
- <view class="carinfoBoxNocarRight">
- <view class="carinfoBoxNocarRightTitle">添加我的爱车</view>
- <view class="carinfoBoxNocarRightMS">按照车型推荐合适的商品</view>
- </view>
- </view>
-
- </view>
- </view>
- <view class="shoptopbox" v-if="carInfo">
- <view class="carinfoBox" >
- <view class="carinfoBoxTop">
- <img :src="carInfo.brandLogo" alt="" class="carLogo" v-if="carInfo.brandLogo">
- <img src="../../static/timg/nocar.png" alt="" class="carLogo" v-else>
- <view class="carinfoBoxTopCont">
- <view class="carinfoBoxTopContTop">
- <view class="carInfoplateNumber">{{carInfo.plateNumber}}</view>
- <view class="carTnfomilage" v-if="carInfo.milage">{{carInfo.milage}}km</view>
- </view>
- <view class="carInfocarModel" v-if="carInfo.carModel">{{carInfo.carModel}}</view>
- <view class="carInfocarModel" v-else>暂无</view>
- </view>
- <view class="carinfoBoxTopRight" @click="changeCar">
- <img src="../../static/timg/icon_change@2x.png" alt="" class="carinfoBoxTopRightIcon">
- <view class="huancheBtn">换车</view>
- </view>
- </view>
- <!-- <view class="carInfoBottom">
- <view class="carInfoBottomLine">
- <view class="carInfoBottomLineTitle">下次保养里程</view>
- <view class="carInfoBottomLineTxt" v-if="carInfo.nextCareMilage">{{carInfo.nextCareMilage}}</view>
- <view class="carInfoBottomLineTxt" v-else>暂无</view>
- </view>
- <view class="carInfoBottomLine">
- <view class="carInfoBottomLineTitle">下次保养日期</view>
- <view class="carInfoBottomLineTxt" v-if="carInfo.nextCareDate">{{carInfo.nextCareDate.slice(0,10)}}</view>
- <view class="carInfoBottomLineTxt" v-else>暂无</view>
- </view>
- <view class="carInfoBottomLine">
- <view class="carInfoBottomLineTitle">保养手册</view>
- <view class="carInfoBottomLineTxt" @click="information">点击查看</view>
- </view>
- </view> -->
- <view class="bxBox">
- <view class="bxline bxline1">
- <img src="../../static/timg/car1.png" alt="" class="bxlineIcon">
- <view class="bxlineTitle">保险</view>
- <view class="bxlineMs1" v-if="carInfo.insuranceExpireDate">{{InsuranceExpireDate}}天到期</view>
- <view class="bxlineMs2" v-else>--</view>
- </view>
- <view class="bxline bxline2">
- <img src="../../static/timg/car2.png" alt="" class="bxlineIcon" >
- <view class="bxlineTitle">下次保养</view>
- <view class="bxlineMs1" v-if="carInfo.nextCareDate||carInfo.nextCareMilage">
- <span v-if="NextCareDate||NextCareDate===0">{{NextCareDate}}天后</span>
- <span v-if="NextCareDate===0&&carInfo.nextCareMilage">或</span>
- <span v-if="carInfo.nextCareMilage&&NextCareDate">或</span>
- <span v-if="carInfo.nextCareMilage">{{carInfo.nextCareMilage}}km</span>
- </view>
- <view class="bxlineMs2" v-else>--</view>
- </view>
- <view class="bxline bxline1">
- <img src="../../static/timg/car3.png" alt="" class="bxlineIcon" >
- <view class="bxlineTitle">年审</view>
- <view class="bxlineMs1" v-if="carInfo.nextAuditDate">{{NextAuditDate}}天到期</view>
- <view class="bxlineMs2" v-else>--</view>
- </view>
- <view class="bxline bxline2">
- <img src="../../static/timg/car4.png" alt="" class="bxlineIcon" >
- <view class="bxlineTitle">保养手册</view>
- <view class="bxlineMs2" @click="information">点击查看</view>
- </view>
- </view>
- </view>
- </view>
-
- <!-- 服务顾问 -->
- <view v-if="homeCardList.openMUsers">
- <view class="adviser" v-if="homeCardList.openMUsers.showType!=2&&managerInfo" @click="goMUsers()">
- <view class="adviserLeft">
- <img v-if="managerInfo.avatar" :src="managerInfo.avatar" alt="" class="advisertx">
- <img v-else src="../../static/timg/pic_def_ava@2x.png" alt="" class="advisertx">
- <view class="adviserNema">{{managerInfo.name}}</view>
- <view class="adviserms" :style="{border:'1px solid #'+themeColor,color:'#'+themeColor}">服务顾问</view>
- </view>
- <img src="../../static/timg/icon_arrow_right.png" alt="" class="adviserJt">
- </view>
- </view>
-
- <!-- 中间功能应用模块 -->
- <view class="modular" v-if="homeCardList.application.length>0">
- <view class="swiper-item">
- <view class="itemLine" @click="goRoter(item)" v-for="(item,index) in homeCardList.application">
- <view><img :src="item.icon" alt="" class="itemImg"></view>
- <view class="Menusline">{{item.name}}</view>
- </view>
- </view>
- </view>
-
- <view class="advertisement" v-if="homeCardList.ad1.length>0">
- <swiper class="swiper2" circular :autoplay="true" :interval="interval"
- :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" :indicator-active-color="'#'+themeColor">
- <swiper-item v-for="(item,index) in homeCardList.ad1">
- <view class="swiper-item2" @click="goRoter(item)">
- <image class="swiper-item2Img" :src="item.icon" mode=""></image>
- </view>
- </swiper-item>
- </swiper>
- </view>
- <view class="advertisement" v-if="homeCardList.ad2.length>0">
- <swiper class="swiper2" circular :autoplay="true" :interval="interval"
- :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" :indicator-active-color="'#'+themeColor">
- <swiper-item v-for="(item,index) in homeCardList.ad2">
- <view class="swiper-item2" @click="goRoter(item)">
- <image class="swiper-item2Img" :src="item.icon" mode=""></image>
- </view>
- </swiper-item>
- </swiper>
- </view>
- <view class="advertisement" v-if="homeCardList.ad3.length>0">
- <swiper class="swiper2" circular :autoplay="true" :interval="interval"
- :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" :indicator-active-color="'#'+themeColor">
- <swiper-item v-for="(item,index) in homeCardList.ad3">
- <view class="swiper-item2" @click="goRoter(item)">
- <image class="swiper-item2Img" :src="item.icon" mode=""></image>
- </view>
- </swiper-item>
- </swiper>
- </view>
- <!-- 热门活动 -->
- <view v-if="homeCardList.openMActivity">
- <view class="Hot" v-if="homeCardList.openMActivity.openCollectingList.length>0">
- <view class="hotTop">
- <view class="hotLeft">
- <view class="hotSx" :style="{background:'#'+themeColor}"></view>
- <view class="hottitle">热门活动</view>
- </view>
- <view class="hotRight" @click="moreJk">
- <view class="hotMore">更多</view>
- <img src="../../static/timg/icon_arrow_right.png" alt="" class="hotMoreJt">
- </view>
- </view>
- <view class="hotLine" @click="goJk(item)" v-for="(item,index) in homeCardList.openMActivity.openCollectingList" v-if="index<homeCardList.openMActivity.showCount">
- <view class="hotLineTop">
- <image class="hotLineTopImg" :src="item.img" mode=""></image>
- <view class="hotlineTimebox">
- <!-- <view class="hotlinestate1" v-if="item.state==2">进行中</view>
- <view class="hotlinestate2" v-if="item.state==1">未开始</view> -->
- <image class="jkStateImg" v-if="item.state==2" src="../../static/img/bg_huangse.png" mode="" ></image>
- <image class="jkStateImg" v-if="item.state==1" src="../../static/img/bg_hongse.png" mode="" ></image>
- <view class="hotTime">{{item.startTime.slice(0,10)}}-{{item.endTime.slice(0,10)}}</view>
- </view>
- </view>
- <view class="hotName">{{item.activityName}}</view>
- </view>
-
- </view>
- </view>
-
- <!-- 热门车型 -->
- <view v-if="homeCardList.openMGoods">
- <view class="" v-if="homeCardList.openMGoods.length>0">
- <view class="Hot" v-if="homeCardList.openMGoods.showType==1">
- <view class="hotTop">
- <view class="hotLeft">
- <view class="hotSx" :style="{background:'#'+themeColor}"></view>
- <view class="hottitle">热门商品</view>
- </view>
- <view class="hotRight" @click="goShop">
- <view class="hotMore">更多</view>
- <img src="../../static/timg/icon_arrow_right.png" alt="" class="hotMoreJt">
- </view>
- </view>
- <view class="hotGoodsLine" v-for="(item,index) in homeCardList.openMGoods.goodsList" @click="goGoods(item)" v-if="index<homeCardList.openMGoods.showCount">
- <view>
- <image :src="item.url" mode="" class="hotGoodsLineImg"></image>
- </view>
- <view class="hotGoodsLineRIght">
- <view class="goodsName">{{item.name}}</view>
- <view class="Sold">
- <view v-if="item.showLabel&&item.showLabel.indexOf('3')!=-1">
- 已售 {{item.saleQty>0?item.saleQty:0}}
- </view>
- </view>
- <view class="goodsPrice">
- <view class="goodsPrice1" >{{item.saleLabel}}</view><!-- :style="{color:'#'+themeColor}" -->
- <view class="goodsPrice2" >¥</view>
- <view class="goodsPrice3" >{{item.salePrice}}
- <span v-if="item.categoryIds=='7B97D114-C419-42B2-9C1E-0B4CA284CDA0'">万</span>
- </view>
- <view class="goodsPrice4" v-if="item.showLabel&&item.scribingPrice&&item.showLabel.indexOf('1')!=-1">¥{{item.scribingPrice}}</view>
- </view>
- </view>
- </view>
-
- </view>
- </view>
- </view>
-
-
-
-
- <view style="height: 60rpx;"></view>
- <!-- 手机号授权 -->
- <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
- <view class="authorizCont" @click.stop="">
- <view class="authorizName">{{wxOpenData.miniAppName}}</view>
- <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
- <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
- </view>
- <view style="text-align: center;padding-top: 56rpx;">
- <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
- </view>
- </view>
-
-
- <!-- <view @getphonenumber="decryptPhoneNumber" >shopId:{{shopId}}</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:'',
- }
- },
- onLoad(opt) {
- this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
- var that=this;
- //this.$common.getExtStoreId()
- var ext=this.$common.getExtStoreId();
- this.ext=ext
- 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
- //this.$store.commit('mutationsshareID', shareID)
- }
- //this.shareID='C01DF9DA51A341888754DE0C4ADB29D9'
- //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()
- }
-
-
- },
- onShow() {
- this.userInfo=this.$store.state.userInfo;
- this.wxOpenData=this.$store.state.wxOpenData;
- var indexaddcar = uni.getStorageSync("indexaddcar");
- this.getwxLoing=true;
- if(indexaddcar==1){
- uni.removeStorageSync('indexaddcar');
- this.getCarList();
- }else{
- this.carInfo=this.$store.state.carInfo;
- this.jsTime()
- }
-
-
-
- },
- onPullDownRefresh(){
- this.getCarList();
- this.queryHomeCardList()
- this.queryManagerInfo()
- setTimeout(() => {
- uni.stopPullDownRefresh(); // 关闭下拉刷新
- }, 1000);
- },
- methods: {
- addCar(){
- if(!this.userInfo){
- this.authorizShow=true;
- }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){
- if(!this.userInfo){
- this.authorizShow=true;
- }else{
- uni.navigateTo({
- url:'../shop/goodsDetail?id='+item.id
- })
- }
- },
- goJk(item){
- if(!this.userInfo){
- this.authorizShow=true;
- }else{
- uni.navigateTo({
- url:'../activity/jkDetail?id='+item.id
- })
- }
-
- },
- goRoter(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{
- 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'
- })
- }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'
- })
- }
-
- // 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
- })
- 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()
-
- }
- });
- 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.$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()
- }
- }
-
-
-
- }
- });
-
- }
-
- })
- },
- 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()
- }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)
- uni.showLoading({
- title: '加载中'
- })
- this.$http('openHome/queryHomeCardList', {
- unionId:this.unionId
- },'GET').then(res => {
- uni.hideLoading();
- this.homeCardList=res.data
- })
- },
- 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
- });
- }
- })
- }
-
- }
- }
- </script>
- <style scoped>
- .bxBox{
- display: flex;
- flex-wrap: wrap;
- }
- .bxline{
- display: flex;
-
- padding-top: 22rpx;
- }
- .bxline1{
- width: 40%;
- }
- .bxline2{
- width: 60%;
- }
- .bxlineTitle{
- color: #333333;
- font-size: 26rpx;
- line-height: 37rpx;
- padding-left: 10rpx;
- }
- .bxlineMs1{
- line-height: 37rpx;
- color: #D53533;
- font-size: 26rpx;
- padding-left: 12rpx;
- }
- .bxlineMs2{
- line-height: 37rpx;
- color: #999999;
- font-size: 24rpx;
- padding-left: 12rpx;
- }
- .bxlineIcon{
- width: 34rpx;
- height: 34rpx;
- margin-left: 24rpx;
- }
- .indexTop{
- background: #D53533;
- width: 750rpx;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 11;
- }
- .indexnav{
- height: 44px;
- line-height: 44px;
- text-align: center;
- font-size: 36rpx;
- color: #FFFFFF;
- }
- .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: 422rpx;
- height: 88rpx;
- background: #D53533;
- border-radius: 44rpx;
- line-height: 88rpx;
- text-align: center;
- font-size:30rpx;
- color: #FFFFFF;
- margin-top: 62rpx;
- margin-left:71rpx;
- }
- .content{
- min-height: 100vh;
- background: #F4F5F7;
- }
- .topBox{
- width: 750rpx;
- height: 150rpx;
- background: #D53533;
- }
- .yuanhu{
- width: 750rpx;
- height: 50rpx;
- background: #D53533;
- border-radius: 0 0 100% 100%;
- }
- .carinfoBox{
- width: 702rpx;
- /* height: 250rpx; */
- background: #FFFFFF;
- border-radius: 10rpx;
- margin-left: 24rpx;
- overflow: hidden;
- height: 270rpx;
-
- }
- .carinfoBox2{
- width: 702rpx;
- height: 180rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
- margin-left: 24rpx;
- overflow: hidden;
-
- }
- .carinfoBox2{
-
- }
- .carinfoBox .carLogo{
- width: 60rpx;height: 60rpx;
- margin-top: 6rpx;
- }
- .carinfoBoxTop{
- display: flex;
- justify-content: space-between;
- padding-top: 29rpx;
- padding-left: 24rpx;
- padding-right: 20rpx;
- padding-bottom: 24rpx;
- border: 1px solid #EEEEEE;
- }
- .carinfoBoxTopCont{
- width: 454rpx;
- }
- .carinfoBoxTopContTop{
- display: flex;
- }
- .carInfoplateNumber{
- font-weight: 500;
- color: #3C3C3C;
- font-size: 30rpx;
- line-height: 42rpx;
- padding-right: 16rpx;
- }
- .carTnfomilage{
- color: #F19D01;
- font-size: 22rpx;
- padding: 0rpx 10rpx;
- border-radius: 4rpx;
- border: 1px solid #F19D01;
- height: 32rpx;
- line-height: 34rpx;
- margin-top: 2rpx;
- margin-left: 2rpx;
- }
- .carInfocarModel{
- width: 454rpx;
- color: #666666;
- font-size: 26rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .carinfoBoxTopRight{
- display: flex;padding-top: 25rpx;
- }
- .carinfoBoxTopRightIcon{
- width: 29rpx;
- height: 31rpx;
- }
- .huancheBtn{
- color: #666666; font-size: 26rpx;line-height: 31rpx;
- padding-left: 10rpx;
- }
- .carInfoBottom{
- display: flex;
- justify-content: space-around;
- }
- .carInfoBottomLineTitle{
- color: #999999;font-size: 24rpx;
- text-align: center;
- padding-top: 24rpx;
- }
- .carInfoBottomLineTxt{
- color: #3C3C3C;
- font-size: 26rpx;
- padding-top: 5rpx;
- text-align: center;
- }
- .carinfonocarIcon{
- width: 72rpx;
- height: 72rpx;
- }
- .carinfoBoxNocar{
- display: flex;
- padding-top: 50rpx;
- padding-left: 20rpx;
- }
- .carinfoBoxNocarRightTitle{
- font-weight: 500;
- color: #3C3C3C;
- font-size: 30rpx;
- }
- .carinfoBoxNocarRightMS{
- color: #666666;
- font-size: 26rpx;
- }
- .carinfoBoxNocarRight{
- padding-left: 24rpx;
- }
- .shoptopbox{
- margin-top: -170rpx;
- }
- .shoptopbox2{
- margin-top: -170rpx;
- }
- .adviser{
- width: 662rpx;
- margin-left: 24rpx;
- background: #FFFFFF;
- border-radius: 10px;
- display: flex;
- justify-content: space-between;
- padding: 18rpx 20rpx;
- margin-top: 20rpx;
- }
- .adviserLeft{
- display: flex;
- }
- .advisertx{
- width: 62rpx;height: 62rpx;
- }
- .adviserNema{
- color: #333333;font-size: 30rpx;
- line-height: 62rpx;padding-left: 24rpx;
- }
- .adviserms{
- width: 118rpx;
- height: 36rpx;
- border-radius: 4rpx;
- border: 1px solid #D53533;
- line-height: 36rpx;
- text-align: center;
- margin-top: 12rpx;
- margin-left: 20rpx;
- color: #D53533;
- font-size: 24rpx;
- }
- .adviserJt{
- width: 12rpx;
- height: 20rpx;
- margin-top: 20rpx;
- }
- .modular{
- width: 702rpx;
- /* height: 313rpx; */
- background: #FFFFFF;
- border-radius: 10px;
- margin-top: 20rpx;
- margin-left: 24rpx;
- padding-bottom: 40rpx;
- }
- .swiper-item{
- display: flex;
- flex-wrap: wrap;
- }
- .itemImg{
- width: 46rpx;
- height: 46rpx;
- }
- .Menusline{
- font-size: 24rpx;
- color: #333333;
- }
- .itemLine{
- width: 20%;
- text-align: center;
- padding-top: 40rpx;
- }
- .advertisement{
- width: 702rpx;
- height: 280rpx;
- margin-top: 20rpx;
- margin-left: 24rpx;
- border-radius: 20rpx;
- }
- .swiper-item2{
- width: 702rpx;
- height: 280px;
- }
- .swiper-item2Img{
- width: 702rpx;
- height: 280rpx;
- }
- .hotMoreJt{
- width: 12rpx;
- height: 20rpx;
- margin-top: 6rpx;
- }
- .Hot{
- width: 702rpx;
- margin-top: 20rpx;
- margin-left: 24rpx;
- }
- .hotTop{
- display: flex;
- justify-content: space-between;
- padding: 6rpx 0;
- }
- .hotSx{
- width: 8rpx;
- height: 30rpx;
- background: #FF0000;
- border-radius: 5rpx;
- }
- .hotLeft{
- display: flex;
- }
- .hottitle{
- font-weight: 500;
- color: #333333;
- font-size: 30rpx;
- line-height: 30rpx;
- margin-left: 16rpx;
- }
- .hotRight{
- display: flex;
- }
- .hotMore{
- line-height: 30rpx;color: #666666;font-size: 24rpx;
- margin-right: 16rpx;
- }
- .hotLineTopImg{
- width: 702rpx;
- height: 280rpx;
- display: block;
- }
- .hotLineTop{
- position: relative;
- height: 280rpx;
- }
- .hotLine{
- margin-top: 20rpx;
- border-radius: 10rpx;
- background: #FFFFFF;
- overflow: hidden;
-
- }
- .hotlinestate1{
- width: 102rpx;
- height: 44rpx;
- background:#FBBF00 ;
- line-height: 44rpx;
- font-weight: 500;
- color: #333333;
- font-size: 24rpx;
- text-align: center;
- }
- .hotlinestate2{
- width: 102rpx;
- height: 44rpx;
- background:#FF0000 ;
- line-height: 44rpx;
- font-weight: 500;
- color: #FFFFFF;
- font-size: 24rpx;
- text-align: center;
- }
- .hotlineTimebox{
- position: absolute;
- left: 0;
- bottom: 0;
-
- display: flex;
- align-items: flex-end;
- }
- .hotTime{
- background: rgba(0, 0, 0, 0.5);
- font-weight: 400;
- color: #FFFFFF;
- font-size: 24rpx;
- /* line-height: 44rpx; */
- padding: 5rpx 20rpx;
- margin-top: 9rpx;
- margin-left: -8rpx;
- border-radius: 0px 10rpx 0px 0px;
- }
- .hotName{
- padding: 24rpx 20rpx;
- color: #333333;
- line-height: 40rpx;
- font-size: 28rpx;
- }
- .hotGoodsLine{
- margin-top: 30rpx;
- padding: 20rpx;
- background: #FFFFFF;
- border-radius: 16rpx;
- display: flex;
- }
- .hotGoodsLineImg{
- width: 208rpx;
- height: 194rpx;
- border-radius: 16rpx;
- border: 1px solid #EEEEEE;
- display: block;
- }
- .goodsName{
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 40rpx;
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .hotGoodsLineRIght{
- padding-left: 24rpx;
- }
- .goodsPrice{
- display: flex;
- padding-top: 10rpx;
- }
- .goodsPrice1{
- font-size: 24rpx;
- font-weight: 400;
- color: #FF0000;
- padding-top: 8rpx;
- }
- .goodsPrice2{
- font-size: 22rpx;
- font-weight: 400;
- color: #FF0000;
- padding-top: 10rpx;
- }
- .goodsPrice3{
- font-size: 32rpx;
- font-weight: 500;
- color: #FF0000;
- }
-
- .goodsPrice4{
- font-size: 24rpx;
- font-weight: 400;
- color: #999999;
- padding-top: 8rpx;
- padding-left: 10rpx;
- text-decoration:line-through;
- }
- .Sold{
- font-weight: 400;
- color: #999999;
- font-size: 24rpx;
- padding-top: 8rpx;
- }
- .jkStateImg{
- width: 102rpx;
- height: 53rpx;
- position: relative;
- }
- </style>
|