12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649 |
- <template>
- <view>
- <zj-page-layout
- :hasFooter="false"
- :isScroll="true"
- :isLoading="isLoading"
- :refresherTriggered="refresherTriggered"
- @refresherrefresh="refresherrefresh"
- >
- <!-- <view style="color: #fff; background: red; height: 50px" @click="quzhifu">支付测试</view> -->
- <Loading v-if="isError || !isLogin" :type="3" :loadStatus="2" :showText="'加载失败,请下拉重新加载'" />
- <view class="all-container" v-else>
- <view class="noticebar-container" v-if="noticeContent">
- <u-notice-bar :text="noticeContent"></u-notice-bar>
- </view>
- <!-- 去除商城和服务业务 -->
- <!-- <view class="swiper-container" v-if="bannerList.length > 0">
- <u-swiper
- :list="bannerList"
- keyName="imgSrc"
- autoplay
- circular
- indicator
- indicatorMode="line"
- height="175"
- @click="clickBanner"
- ></u-swiper>
- </view>
- <view class="noticebar-container" v-if="noticeContent">
- <u-notice-bar :text="noticeContent"></u-notice-bar>
- </view>
- <block v-if="categoryList.length > 0">
- <view
- class="service-container card"
- v-for="(item, index) in categoryList.filter(o => o.sub.length > 0)"
- :key="index"
- >
- <view class="home-title">
- <view class="left">{{ item.name }}</view>
- <view class="right" @tap="toClassifyList(item.categoryId)">
- <text class="text">查看更多</text>
- <text class="iconfont icon-jinru"></text>
- </view>
- </view>
- <view class="list">
- <view
- class="item"
- v-for="(it, idx) in item.sub.slice(0, 4)"
- :key="idx"
- @tap="toGoodsList(item.categoryId, it.categoryId, it.name)"
- >
- <image :src="it.imgUrl" mode="aspectFill"></image>
- <text>{{ it.name }}</text>
- </view>
- </view>
- </view>
- </block> -->
- <!-- 自助服务 -->
- <!-- <view class="service-container card">
- <view class="home-title">
- <view class="left">自助服务</view>
- <view class="right" @tap="toWorkorder">
- <text class="text">我的服务单</text>
- <text class="iconfont icon-jinru"></text>
- </view>
- </view>
- <view class="list">
- <view class="item" v-for="(item, index) in serviceList" :key="index" @tap="toPage(item.url)">
- <image :src="item.icon" mode="aspectFill" v-if="item.icon"></image>
- <image
- :src="require(`@/static/images/home/service-icon${item.code}.png`)"
- mode="aspectFill"
- v-else-if="item.code"
- ></image>
- <text>{{ item.title }}</text>
- </view>
- <view class="item" v-if="userInfo.isShowLease" @tap="toPage('/packageHome/pages/service/tenancy')">
- <image :src="require(`@/static/images/home/service-icon5.png`)" mode="aspectFill"></image>
- <text>设备租赁</text>
- </view>
- </view>
- </view> -->
- <!-- 扫码活动 -->
- <view class="swiper2-container" v-if="codeActivityList.length > 0">
- <u-swiper
- :list="codeActivityList"
- keyName="banner"
- autoplay
- circular
- indicator
- indicatorMode="line"
- height="100"
- @click="toCodeActivityList"
- ></u-swiper>
- </view>
- <!-- 增值服务 -->
- <!-- <view class="other-container card" v-if="userInfo.moduleYb">
- <view class="home-title">
- <view class="left">增值服务</view>
- </view>
- <view class="list">
- <view
- class="item"
- v-for="(item, index) in addvalueList.filter(o => !o.root || (o.root && o.root.includes(userInfo.type)))"
- :key="index"
- @tap="item.fn ? toFn(item.fn) : toPage(item.url)"
- >
- <image :src="require(`@/static/images/home/other-icon${item.code}.png`)" mode=""></image>
- <text>{{ item.title }}</text>
- </view>
- </view>
- </view> -->
- <!-- 工程维保服务 -->
- <!-- <view
- class="other-container card"
- v-if="(isWorkerUser || isShowMaintenance) && userInfo.moduleWb && userInfo.mobile"
- >
- <view class="home-title">
- <view class="left">工程维保服务</view>
- </view>
- <view class="list">
- <view
- class="item"
- v-for="(item, index) in maintenanceList"
- :key="index"
- @tap="item.fn ? toFn(item.fn) : toPage(item.url)"
- >
- <image :src="require(`@/static/images/home/other-icon${item.code}.png`)" mode=""></image>
- <text>{{ item.title }}</text>
- </view>
- </view>
- </view> -->
- <!-- 二手商城 -->
- <!-- <view class="other-container card" v-if="(isServiceUser || isWorkerUser) && userInfo.moduleEs">
- <view class="home-title">
- <view class="left">二手商城</view>
- </view>
- <view class="list">
- <view
- class="item"
- v-for="(item, index) in recycleList.filter(
- o => !o.root || (o.root == 1 && userInfo.isEs) || (o.root == 2 && !userInfo.isEs)
- )"
- :key="index"
- @tap="item.fn ? toFn(item.fn) : toPage(item.url)"
- >
- <image :src="require(`@/static/images/home/other-icon${item.code}.png`)" mode=""></image>
- <text>{{ item.title }}</text>
- </view>
- </view>
- </view> -->
- <!-- 分享收益 -->
- <!-- <view class="share-container card" v-if="isServiceUser || isWorkerUser">
- <view class="home-title">
- <view class="left">分享收益</view>
- <view class="right" @tap="toPage(`/packageMine/pages/order/list?tab=`)">
- <text class="text">我的订单</text>
- <text class="iconfont icon-jinru"></text>
- </view>
- </view>
- <view class="list">
- <view class="item" @tap="toMall()">
- <image src="@/static/images/home/share-icon1.png"></image>
- <view class="text">分销商城</view>
- </view>
- <view class="item" @tap="toActivityList(5)">
- <image src="@/static/images/home/share-icon2.png"></image>
- <view class="text">活动专区</view>
- </view>
- </view>
- </view> -->
- <!-- 工单管理 -->
- <view class="order-container card">
- <view class="home-title">
- <view class="left">工单管理</view>
- </view>
- <view class="list">
- <view
- class="item"
- style="position: relative"
- v-for="(item, index) in orderList"
- :key="index"
- @tap="toPageaa(item.url, item.tab)"
- >
- <image :src="require(`@/static/images/home/order-icon${item.code}.png`)" mode=""></image>
- <text>{{ item.title }}</text>
- <text
- v-if="statusCount[['djd', 'fwz', '', 'ycd'][index]]"
- style="position: absolute; top: -10rpx; right: -10rpx"
- >{{ statusCount[['djd', 'fwz', '', 'ycd'][index]] }}</text
- >
- </view>
- </view>
- </view>
- <!-- 其他 -->
- <view class="other-container card">
- <view class="home-title">
- <view class="left">辅材</view>
- <view class="right" @tap="toPage(`/packageMaterial/pages/index?type=M`)">
- <text class="text">查看详细</text>
- <text class="iconfont icon-jinru"></text>
- </view>
- </view>
- <view class="list">
- <view
- class="item"
- style="position: relative"
- v-for="(item, index) in otherList"
- :key="index"
- @tap="toPage(item.url)"
- >
- <image :src="require(`@/static/images/home/other-icon${item.code}.png`)" mode=""></image>
- <text>{{ item.title }}</text>
- <text v-if="index == 1 && fucaidzf" style="position: absolute; top: 0rpx; right: 8rpx">{{
- fucaidzf
- }}</text>
- </view>
- </view>
- </view>
- <view class="other-container card">
- <view class="home-title">
- <view class="left">配件</view>
- <view class="right" @tap="toPage(`/packageMaterial/pages/index?type=P`)">
- <text class="text">查看详细</text>
- <text class="iconfont icon-jinru"></text>
- </view>
- </view>
- <view class="list">
- <view
- class="item"
- style="position: relative"
- v-for="(item, index) in otherList2"
- :key="index"
- @tap="toPage(item.url)"
- >
- <image :src="require(`@/static/images/home/other-icon${item.code}.png`)" mode=""></image>
- <text>{{ item.title }}</text>
- <text v-if="index == 1 && peijiandzf" style="position: absolute; top: 0rpx; right: 8rpx">{{
- peijiandzf
- }}</text>
- </view>
- </view>
- </view>
- <!-- 联系我们 -->
- <view class="contact-container card">
- <view class="home-title">
- <view class="left">联系我们</view>
- </view>
- <view class="list">
- <!-- <button open-type="contact" class="item bb">
- <image src="@/static/images/home/home-icon1.png"></image>
- <view class="title">在线客服</view>
- <text class="iconfont icon-jinru"></text>
- </button> -->
- <view class="item" :class="isShowContact1 ? '' : 'bb'" @tap="isShowContact1 = !isShowContact1">
- <image src="@/static/images/home/home-icon2.png"></image>
- <view class="title">服务网点</view>
- <text class="iconfont icon-jinru"></text>
- </view>
- <view class="wrap1" v-if="isShowContact1">
- <view class="it" v-for="(item, index) in websitList" :key="index">
- <view class="top">
- <view class="left">{{ item.name }} {{ item.websitPhone || '' }}</view>
- <view class="right" @tap="$callPhone(item.websitPhone)" v-if="item.websitPhone"
- ><text class="iconfont icon-call"></text
- ></view>
- </view>
- <view class="address">{{ item.address }}</view>
- </view>
- </view>
- <!-- <view class="item" @tap="isShowContact2 = !isShowContact2">
- <image src="@/static/images/home/home-icon3.png"></image>
- <view class="title">投诉热线</view>
- <text class="iconfont icon-jinru"></text>
- </view>
- <view class="wrap2" v-if="isShowContact2">
- <view class="left">投诉电话:{{ userInfo.companyWechatMobile || '暂无' }}</view>
- <view class="right" @tap="$callPhone(userInfo.companyWechatMobile)" v-if="userInfo.companyWechatMobile"
- ><text class="iconfont icon-call"></text
- ></view>
- </view> -->
- </view>
- </view>
- </view>
- </zj-page-layout>
- <!-- <view class="dialog-container" v-if="couponDialogImgUrl && isShowCouponDialog">
- <uni-transition ref="dialog" mode-class="zoom-in" :duration="500" :show="couponDialogImgUrl && isShowCouponDialog">
- <image class="image" :src="couponDialogImgUrl" mode="widthFix" @tap="handleCoupon()"></image>
- </uni-transition>
- <uni-transition ref="dialogBtn" mode-class="fade" :duration="500" :show="couponDialogImgUrl && isShowCouponDialog">
- <text class="iconfont icon-close2" @tap="closeDialog()"></text>
- </uni-transition>
- </view> -->
- <view class="top-tooltip" v-if="isShowTopTooltip">
- <view class="content">
- <view class="left">
- <view>点击<text class="iconfont icon-gengduo"></text>添加到我的小程序</view>
- <view>微信下拉使用更方便哟!</view>
- </view>
- <text class="iconfont icon-close2 close" @tap="isShowTopTooltip = false"></text>
- </view>
- <view class="arrow"></view>
- </view>
- <view class="bottom-tooltip" v-if="isShowBottomTooltip">
- <view class="left">
- <text class="iconfont icon-close2 close" @tap="isShowBottomTooltip = false"></text>
- <view class="text">关注公众号及时获取服务进度</view>
- </view>
- <view class="btn" @tap="toWxLink()">前往关注</view>
- </view>
- <!-- 保险过期提示弹窗 -->
- <insuranceDialog ref="insuranceDialog" :data="baoxiandangqianxianxitishi"> </insuranceDialog>
- </view>
- </template>
- <script>
- import { getNoticeNum, getOrderNum, selectionChange, mini_env } from '@/common/utils/util.js'
- import insuranceDialog from '@/components/insuranceDialog'
- export default {
- components: {
- insuranceDialog
- },
- data() {
- return {
- isLoading: true,
- refresherTriggered: false, // 下拉刷新状态
- userInfo: {},
- configInfo: {},
- scene: {
- // 页面参数(扫码进入小程序时产生)
- type: '',
- goodsId: '',
- orderId: '',
- serviceId: '',
- couponId: ''
- },
- isCouponDialog: false, // 是否显示过期优惠券弹窗
- isReceiveDialog: false,
- isSmsReceive: false,
- isShowTopTooltip: false,
- isShowBottomTooltip: false,
- noticeContent: '', // 公告内容
- categoryList: [],
- serviceList: [],
- baseServiceList: [
- // 自助服务列表
- { code: 3, title: '收费标准', url: `/packageHome/pages/service/chargeStandard` },
- { code: 4, title: '故障自查', url: `/packageHome/pages/service/troubleshoot` }
- ],
- addvalueList: [
- // 增值服务列表
- { code: 1, title: '延保服务', fn: 'toServiceIndex' },
- { code: 2, title: '我的延保', url: `/packageHome/pages/addvalue/orderList` },
- { code: 3, title: '服务记录', fn: `toServiceRecods` },
- { code: 3, title: '延保查询', url: `/packageHome/pages/addvalue/check`, root: ['WORKER'] }
- ],
- maintenanceList: [
- // 工程维保服务列表
- { code: 1, title: '创建维保单', fn: `toMaintenanceCreate` },
- { code: 2, title: '维保单记录', fn: `toMaintenanceRecods` },
- { code: 3, title: '费用申请单', url: `/packageHome/pages/maintenance/applyList` }
- ],
- recycleList: [
- { code: 1, title: '二手商城', url: `/packageHome/pages/recycle/index`, root: 0 },
- { code: 2, title: '已发布的', url: `/packageHome/pages/recycle/issue/list`, root: 1 },
- { code: 3, title: '我买到的', url: `/packageHome/pages/recycle/order/list`, root: 2 }
- ],
- orderList: [
- // 工单管理列表
- { code: 1, title: '待接单', url: `/packageWorkorder/pages/orderList?tab=DJD`, tab: 'DJD' },
- { code: 2, title: '服务中', url: `/packageWorkorder/pages/orderList?tab=FWZ`, tab: 'FWZ' },
- { code: 3, title: '已完成', url: `/packageWorkorder/pages/orderList?tab=YWG`, tab: 'YWG' },
- { code: 4, title: '异常单', url: `/packageWorkorder/pages/orderList?tab=YCD`, tab: 'YCD' }
- ],
- otherList: [
- // 其他列表
- { code: 1, title: '辅材管理', url: `/packageMaterial/pages/stock/index` },
- { code: 2, title: '辅材收款', url: `/packageMaterial/pages/sale/orderList?type=M&tabCurrent=1` }
- // { code: 2, title: '辅材收款', url: `/packageMaterial/pages/sale/index?type=M` }
- ],
- otherList2: [
- // 其他列表
- { code: 1, title: '配件管理', url: `/packageAttachment/pages/fittingsManagement/index` },
- { code: 2, title: '配件收款', url: `/packageMaterial/pages/newSale/orderList?type=P&tabCurrent=1` }
- // { code: 2, title: '配件收款', url: `/packageMaterial/pages/newSale/index?type=P` }
- ],
- bannerList: [], // 轮播图列表
- couponList: [], // 可领取优惠券列表
- codeActivityList: [],
- couponDialogImgUrl: '',
- isShowCouponDialog: true,
- isError: false,
- websitList: [],
- isShowContact1: false,
- isShowContact2: false,
- isShowMaintenance: false,
- baoxiandangqianxianxitishi: [],
- statusCount: {},
- peijiandzf: 0,
- fucaidzf: 0
- }
- },
- computed: {
- isLogin() {
- return this.$store.state.user.token ? true : false
- },
- isServiceUser() {
- // 是否业务员
- return this.userInfo && this.userInfo.type === 'SERVICE'
- },
- isWorkerUser() {
- // 是否师傅
- return this.userInfo && this.userInfo.type === 'WORKER'
- }
- },
- async onShow() {
- selectionChange()
- try {
- await this.$onLaunched
- this.configInfo = await this.$getConfigInfo()
- await this.getBannerList()
- this.getNoticebar()
- if (this.isLogin) {
- try {
- this.userInfo = await this.$getUserInfo()
- if (!this.userInfo.isGZSign && !this.userInfo.isFSSign) {
- // this.isShowMaintenance = await this.checkMaintenance()
- this.getCategoryList()
- this.getServiceList()
- this.getCouponList()
- this.getWebsitList()
- this.getCodeActivityList()
- getNoticeNum()
- getOrderNum()
- } else {
- if (this.userInfo.isGZSign) {
- if (
- (
- await this.$api.post('/worker/check/manual/sign/confirm', {
- type: 'gz'
- })
- )?.data
- ) {
- uni.showModal({
- title: '温馨提示',
- content: '您未签署确认书!',
- cancelText: '取消',
- confirmText: '去签署',
- success: res => {
- if (res.confirm) {
- this.navToPage('/pages/repairConfirmation?type=gz')
- }
- }
- })
- } else {
- uni.showModal({
- title: '温馨提示',
- content: '签署确认书正在审核!',
- cancelText: '取消',
- confirmText: '知道了',
- success: res => {}
- })
- }
- } else if (this.userInfo.isFSSign) {
- if (
- (
- await this.$api.post('/worker/check/manual/sign/confirm', {
- type: 'fs'
- })
- )?.data
- ) {
- uni.showModal({
- title: '温馨提示',
- content: '您未签署确认书!',
- cancelText: '取消',
- confirmText: '去签署',
- success: res => {
- if (res.confirm) {
- this.navToPage('/pages/repairConfirmation?type=fs')
- }
- }
- })
- } else {
- uni.showModal({
- title: '温馨提示',
- content: '签署确认书正在审核!',
- cancelText: '取消',
- confirmText: '知道了',
- success: res => {}
- })
- }
- }
- }
- } catch (error) {}
- }
- this.$nextTick(() => {
- this.isError = false
- this.isLoading = false
- this.refresherTriggered = false
- })
- } catch {
- this.isError = true
- this.isLoading = false
- }
- },
- async onLoad({
- scene, // 扫码进入的参数
- goodsId, // 商品id
- serviceId, // 业务员id
- smsServiceId, // 短信业务员id
- otherType, // 类型:groupbuyList=团购活动,activityList=专区活动,orderList=订单列表,workOrderList=工单列表,couponList=优惠券列表,workOrderDetail
- activityType, // 专区活动类型
- appOrderId, // 师傅端app订单id(下单支付)
- orderId, // 订单id(进入订单详情)
- workOrderId, // 工单id(进入工单详情)
- workOrderTypeId,
- workOrderType,
- workOrderImgUrl,
- mpOpenId,
- type,
- objId,
- isYB,
- isWB,
- sharerOpenId
- }) {
- await this.$onLaunched
- setTimeout(() => {
- this.isShowTopTooltip = false
- this.isShowBottomTooltip = false
- }, 10000)
- if (this.isLogin) {
- this.checkCoupon()
- }
- // if (mpOpenId) {
- // uni.login({
- // provider: 'weixin',
- // success: loginRes => {
- // this.$api.post('/user/auth', {
- // code: loginRes.code,
- // mpOpenId: mpOpenId
- // })
- // }
- // })
- // }
- if (sharerOpenId) {
- this.$api
- .post('/user/bind', {
- serviceOpenId: sharerOpenId,
- userId: this.$store.state.user.userId
- })
- .then(res => {
- console.log('绑定成功:' + res.message)
- })
- }
- try {
- this.userInfo = await this.$getUserInfo()
- if (!this.userInfo.isGZSign && !this.userInfo.isFSSign) {
- // 点击短信链接进入小程序
- if (smsServiceId) {
- this.bindUser(smsServiceId)
- if (this.userInfo.type !== 'SERVICE') {
- this.isSmsReceive = true
- this.isReceiveDialog = true
- }
- }
- // 从链接进入小程序
- if (serviceId) {
- this.bindUser(serviceId)
- }
- if (goodsId) {
- setTimeout(() => {
- this.toGoodsDetail(goodsId)
- }, 1000)
- }
- if (isYB) {
- setTimeout(() => {
- this.toServiceIndex()
- }, 1000)
- }
- // if (isWB) {
- // setTimeout(() => {
- // this.toMaintenanceCreate()
- // }, 1000)
- // }
- if (otherType) {
- // 团购列表
- if (otherType === 'groupbuyList') {
- this.navToPage('/packageMine/pages/groupbuy/list')
- }
- // 活动专区列表
- if (otherType === 'activityList') {
- this.navToPage('/packageGoods/pages/activity?type=' + activityType)
- }
- // 订单列表
- if (otherType === 'orderList') {
- this.navToPage('/packageMine/pages/order/list')
- }
- // 工单列表
- if (otherType === 'workOrderList') {
- this.navToPage('/packageMine/pages/workOrder/list')
- }
- // 优惠券列表
- if (otherType === 'couponList') {
- this.navToPage('/packageMine/pages/coupon/list')
- }
- }
- if (orderId) {
- this.navToPage(`/packageMine/pages/order/detail?orderId=${orderId}`)
- } else if (workOrderId && workOrderTypeId && workOrderType) {
- workOrderType = workOrderType.replace(/\\\\/g, '\\')
- this.navToPage(
- `/packageMine/pages/workOrder/detail?id=${workOrderTypeId}&type=${workOrderType}&orderNo=${workOrderId}`
- )
- } else if (workOrderId) {
- this.navToPage(`/packageMine/pages/workOrder/list`)
- } else if (workOrderImgUrl) {
- this.navToPage(`/packageMine/pages/workOrder/receipt?imgurl=${workOrderImgUrl}`)
- }
- // 扫码进入小程序
- if (scene) {
- console.log(scene)
- // 拿scene的id去获取
- this.$api
- .get('/common/scene', {
- scene: scene
- })
- .then(res => {
- let newScene = res.data.split('&')
- this.scene.type = newScene[0]
- this.scene.serviceId = newScene[2] || ''
- // 如果是商品
- if (newScene[0] == 'goods') {
- this.scene.goodsId = newScene[1]
- this.toGoodsDetail(this.scene.goodsId)
- }
- // 如果是优惠券
- else if (newScene[0] == 'coupon') {
- this.scene.couponId = newScene[1]
- this.isReceiveDialog = true
- // this.receiveCoupon(this.scene.couponId);
- }
- // 如果是团购分享码
- else if (newScene[0] == 'promotion_group') {
- this.navToPage('/packageMine/pages/groupbuy/list')
- }
- // 如果是活动专区分享码
- else if (newScene[0] == 'HDZQ') {
- this.navToPage('/packageGoods/pages/activity?type=' + newScene[1])
- }
- // 如果是工程维保
- else if (newScene[0] == 'ENGIN_PROJECT_REPAIR') {
- this.$navToPage({
- url: `/packageHome/pages/maintenance/create?projectId=${newScene[1]}`
- })
- }
- console.log(this.scene)
- if (this.scene.serviceId) {
- this.bindUser(this.scene.serviceId)
- }
- })
- }
- this.$api.post('/worker/remind').then(res => {
- this.baoxiandangqianxianxitishi = res.data
- })
- this.$api.post('/pg/order/base/status/count', {}).then(res => {
- this.statusCount = res.data
- })
- this.$api
- .post('/pay/orderCount', {
- goodsType: 'P'
- })
- .then(res => {
- this.peijiandzf = res.data.dzf
- console.log(res.data)
- })
- this.$api
- .post('/pay/orderCount', {
- goodsType: 'M'
- })
- .then(res => {
- this.fucaidzf = res.data.dzf
- console.log(res.data)
- })
- }
- } catch (error) {}
- },
- methods: {
- quqianming(err) {},
- // 测试支付
- quzhifu() {
- mini_env(bool => {
- this.$api
- .post('/order/buytest', {
- orderId: Date.now(),
- amount: 0.01
- })
- .then(res => {
- // 小程序环境
- if (bool) {
- uniWebview.navigateTo({
- url: `/pages/pay/pay?${Object.entries({
- ...res.data,
- payPackage: res.data.payPackage.split('=')[0] || '',
- payPackageVal: res.data.payPackage.split('=')[1] || ''
- })
- .map(item => item.join('='))
- .join('&')}`
- })
- }
- })
- })
- },
- // 获取公告栏
- getNoticebar() {
- this.$api.get('/shpping/cart/notice').then(res => {
- this.noticeContent = res.data
- })
- },
- // 触发下拉刷新
- async refresherrefresh(e) {
- this.refresherTriggered = true
- this.configInfo = await this.$getConfigInfo()
- await this.getBannerList()
- try {
- if (this.isLogin) {
- this.userInfo = await this.$getUserInfo()
- if (!this.userInfo.isGZSign && !this.userInfo.isFSSign) {
- this.getCategoryList()
- this.getServiceList()
- this.getCouponList()
- this.getWebsitList()
- this.getCodeActivityList()
- }
- } else {
- // await this.wxLogin()
- this.userInfo = await this.$getUserInfo()
- if (!this.userInfo.isGZSign && !this.userInfo.isFSSign) {
- this.getCategoryList()
- this.getServiceList()
- this.getCouponList()
- this.getWebsitList()
- this.getCodeActivityList()
- }
- }
- } catch (error) {}
- this.$nextTick(() => {
- this.$isResolve()
- this.isError = false
- this.refresherTriggered = false
- })
- },
- async wxLogin() {
- return new Promise((resolve, reject) => {
- uni.login({
- provider: 'weixin',
- success: loginRes => {
- this.$api
- .post('/user/auth', {
- code: loginRes.code
- })
- .then(async res => {
- this.$store.commit('user/set_token', res.data.token)
- this.$store.commit('user/set_openId', res.data.openId)
- this.$store.commit('user/set_name', res.data.nickName)
- this.$store.commit('user/set_avatar', res.data.avatar)
- this.$store.commit('user/set_userId', res.data.userId)
- if (res.data.mobile) {
- this.$store.commit('user/set_mobile', res.data.mobile)
- }
- if (!res.data.avatar || !res.data.nickName) {
- await this.saveUserInfo(res.data)
- }
- resolve(1)
- })
- .catch(() => {
- this.refresherTriggered = false
- reject(0)
- })
- }
- })
- })
- },
- // 保存用户信息
- async saveUserInfo(userInfo) {
- let randomNum = new Date().getTime().toString().substr(-6)
- let configInfo = await this.$getConfigInfo()
- return new Promise((resolve, reject) => {
- this.$api
- .post('/user/userinfo/save', {
- userId: userInfo.userId,
- avatarUrl: configInfo.minLogo3,
- nickName: `微信用户_${randomNum}`
- })
- .then(res => {
- resolve(res.data)
- })
- })
- },
- getCategoryList() {
- this.$api
- .get('/goods/category/list/all', {
- isServiceShow: true
- })
- .then(res => {
- this.categoryList = res.data
- })
- },
- getServiceList() {
- this.$api.post('/pg/order/base/type/list').then(res => {
- let list = res.data.map(item => {
- return {
- title: item.orderSmallTypeText,
- icon: item.imgUrl,
- url: `/packageWorkorder/pages/create/index?typeId=${item.id}&typeName=${item.orderSmallTypeText}`
- }
- })
- this.serviceList = [...list, ...this.baseServiceList]
- })
- },
- getWebsitList() {
- this.$api
- .get('/user/apply/websit', {
- // isAll: false,
- examineStatus: 'OK'
- })
- .then(res => {
- this.websitList = res.data || []
- })
- },
- toPage(url) {
- if (!url) return this.$toast('敬请期待~')
- this.navToPage(url)
- },
- toPageaa(url, tab) {
- if (!url) return this.$toast('敬请期待~')
- this.navToPage(url)
- this.$nextTick(() => {
- this.crossPage.$emit('refreshWorkorderList', { tab: tab })
- })
- },
- toFn(fn) {
- if (!fn) return this.$toast('敬请期待~')
- this[fn]()
- },
- toServiceIndex() {
- if (this.isWorkerUser) {
- this.navToPage(`/packageHome/pages/addvalue/serviceBuy`)
- } else {
- this.navToPage(`/packageHome/pages/addvalue/explainList`)
- }
- },
- toServiceRecods() {
- if (this.isWorkerUser) {
- this.navToPage(`/packageWorkorder/pages/orderList?isYb=true`)
- } else {
- this.navToPage(`/packageWorkorder/pages/userWorkorderList`)
- }
- },
- async checkMaintenance() {
- const hasApply = await this.$api
- .post('/engin/material/list/page', {
- pageNum: 1,
- pageSize: -1,
- examineStatus: ''
- })
- .then(res => {
- return res.data.records && res.data.records.length > 0
- })
- const hasOrder = await this.$api
- .post('/pg/order/base/list', {
- pageNum: 1,
- pageSize: -1,
- isWb: true
- })
- .then(res => {
- return res.data.records && res.data.records.length > 0
- })
- return hasApply || hasOrder
- },
- toMaintenanceCreate() {
- if ((this.isWorkerUser || this.isShowMaintenance) && this.userInfo.mobile) {
- this.navToPage(`/packageHome/pages/maintenance/create`)
- } else {
- this.$tips('您暂无维保工程')
- }
- },
- toMaintenanceRecods() {
- if (this.isWorkerUser) {
- this.navToPage(`/packageWorkorder/pages/orderList?isWb=true`)
- } else {
- this.navToPage(`/packageWorkorder/pages/userWorkorderList?isWb=1`)
- }
- },
- toMall() {
- this.$navToPage(
- {
- url: '/pages/goods/index'
- },
- 'switchTab'
- )
- },
- // 获取轮播图列表
- async getBannerList() {
- return new Promise((resolve, reject) => {
- this.$api
- .get('/common/list/page', {
- pageNum: 1,
- pageSize: 10,
- state: true,
- port: 'SHOP'
- })
- .then(res => {
- this.bannerList = res.data.records
- resolve(1)
- })
- .catch(res => {
- reject(0)
- })
- })
- },
- // 点击轮播图
- clickBanner(index) {
- let item = this.bannerList[index]
- if (item.type == 3) {
- this.toActivityList(item.goodsId)
- } else {
- this.toGoodsDetail(item.goodsId)
- }
- },
- // 获取扫码活动列表
- async getCodeActivityList() {
- return new Promise((resolve, reject) => {
- this.$api
- .post('/promotion/questionnaire/list', {
- state: 1
- })
- .then(res => {
- this.codeActivityList = res.data
- resolve(1)
- })
- .catch(res => {
- reject(0)
- })
- })
- },
- // 获取可领优惠券列表
- getCouponList() {
- this.$api
- .get('/coupon/list/all', {
- userId: this.$store.state.user.userId
- })
- .then(res => {
- this.couponList = res.data.filter(item => {
- return item.obtainType === 1
- })
- if (this.couponList && this.couponList.length > 0) {
- this.couponDialogImgUrl = this.couponList[0].imgSrc
- }
- })
- },
- // 关闭弹窗
- closeDialog() {
- this.$refs.dialog.step(
- {
- scale: 0
- },
- {
- duration: 400
- }
- )
- this.$refs.dialog.run(() => {
- this.isShowCouponDialog = false
- })
- this.$refs.dialogBtn.step(
- {
- scale: 0
- },
- {
- duration: 400
- }
- )
- this.$refs.dialogBtn.run(() => {
- this.isShowCouponDialog = false
- })
- },
- // 领取优惠券
- handleCoupon() {
- let ids = this.couponList.map(item => {
- return item.couponId
- })
- this.$api
- .post('/coupon/obtain', {
- userId: this.$store.state.user.userId,
- couponIds: ids.join(',')
- })
- .then(res => {
- this.closeDialog()
- setTimeout(() => {
- this.$tips('优惠券领取成功,请及时使用!')
- }, 500)
- })
- },
- // 进入商品详情
- toGoodsDetail(id) {
- if (!id) {
- return false
- }
- this.$navToPage({
- url: '/packageGoods/pages/detail?id=' + id
- })
- },
- // 进入活动列表
- toActivityList(type) {
- this.$navToPage({
- url: '/packageGoods/pages/activity?type=' + type
- })
- },
- // 进入扫码活动列表
- toCodeActivityList() {
- this.$navToPage({
- url: '/packageHome/pages/codeActivity/activityList'
- })
- },
- // 绑定用户关系
- bindUser(serviceId) {
- this.$api
- .post('/user/bind', {
- serviceId: serviceId,
- userId: this.$store.state.user.userId
- })
- .then(res => {
- console.log('绑定成功:' + res.message)
- })
- },
- // 去分类列表
- toClassifyList(categoryId) {
- this.navToPage(`/packageGoods/pages/classify?categoryId=${categoryId}`)
- },
- // 点击二级分类
- toGoodsList(pid, cid, cname) {
- this.$navToPage({
- url: `/packageGoods/pages/list?pid=${pid}&cid=${cid}&cname=${cname}`
- })
- },
- // 进入商品详情
- toGoodsDetail(id) {
- if (!id) {
- return false
- }
- this.$navToPage({
- url: '/packageGoods/pages/detail?id=' + id
- })
- },
- // 检查是否有优惠券过期
- checkCoupon() {
- this.$api.get('/coupon/timeout').then(res => {
- if (res.data) {
- this.isCouponDialog = true
- }
- })
- },
- // 进入我的优惠券
- toMyCoupon() {
- this.isCouponDialog = false
- this.navToPage('/packageMine/pages/coupon/list')
- },
- // 领取优惠券
- receiveCoupon(id) {
- if (!this.isLogin) {
- return this.navToPage('/pages/login/indexs')
- }
- if (this.isSmsReceive) {
- this.$api
- .get('/coupon/obtain')
- .then(res => {
- this.isReceiveDialog = false
- this.$modal({
- content: '领取成功',
- confirmText: '去看看'
- })
- .then(() => {
- this.toMyCoupon()
- })
- .catch(() => {})
- })
- .catch(res => {
- this.isReceiveDialog = false
- this.$tips(`领取失败:${res.message}`)
- })
- } else {
- this.$api
- .get('/coupon/transfer/coupon2', {
- userCouponId: this.scene.couponId,
- shareUserId: this.scene.serviceId
- })
- .then(res => {
- this.isReceiveDialog = false
- this.$modal({
- content: '领取成功',
- confirmText: '去看看'
- })
- .then(() => {
- this.toMyCoupon()
- })
- .catch(() => {})
- })
- .catch(res => {
- this.isReceiveDialog = false
- this.$tips(`领取失败:${res.message}`)
- })
- }
- },
- // 跳转微信公众号链接
- toWxLink() {
- let link = this.configInfo.pubOfficeAddr
- if (!link) return false
- this.navToPage('/pages/index/webview?link=' + link)
- },
- navToPage(url) {
- this.$navToPage({
- url
- })
- },
- toWorkorder() {
- this.$navToPage({
- url: `/packageWorkorder/pages/userWorkorderList`
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .all-container {
- box-sizing: border-box;
- padding: 1rpx 20rpx 20rpx;
- }
- .top-tooltip {
- width: 390rpx;
- transform-origin: center bottom;
- z-index: 1025;
- position: fixed;
- top: 20rpx;
- right: 20rpx;
- background: rgba(0, 0, 0, 0.8);
- min-width: 150px;
- border-radius: 8rpx;
- padding: 15rpx 20rpx;
- color: #ffffff;
- text-align: justify;
- box-shadow: 0 4rpx 24rpx 0 rgba(0, 0, 0, 0.1);
- word-break: break-all;
- box-sizing: border-box;
- .content {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left {
- view {
- color: #ffffff;
- font-size: 24rpx;
- display: flex;
- align-items: center;
- &:last-child {
- margin-top: 8rpx;
- }
- }
- .iconfont {
- color: #ffffff;
- font-size: 36rpx;
- margin: 0 4rpx;
- }
- }
- .close {
- flex-shrink: 0;
- font-size: 34rpx;
- color: #ffffff;
- margin-left: 20rpx;
- }
- }
- .arrow {
- top: -6px;
- right: 110rpx;
- margin-right: 3px;
- border-top-width: 0;
- border-bottom-color: #ebeef5;
- border-width: 6px;
- filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
- &::after {
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
- top: -12px;
- margin-left: -6px;
- border-top-width: 0;
- border-bottom-color: rgba(0, 0, 0, 0.8);
- content: ' ';
- border-width: 6px;
- }
- }
- }
- .bottom-tooltip {
- z-index: 1025;
- position: fixed;
- bottom: 20rpx;
- left: 20rpx;
- width: 710rpx;
- background: rgba(0, 0, 0, 0.8);
- border-radius: 8rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 72rpx;
- padding: 0 20rpx 0 30rpx;
- box-sizing: border-box;
- .left {
- display: flex;
- align-items: center;
- .close {
- font-size: 34rpx;
- color: #ffffff;
- }
- .text {
- font-size: 24rpx;
- color: #ffffff;
- margin-left: 16rpx;
- }
- }
- .btn {
- font-size: 24rpx;
- color: #ffffff;
- background: #ff3f42;
- padding: 0 16rpx;
- height: 48rpx;
- line-height: 48rpx;
- border-radius: 48rpx;
- }
- }
- .home-title {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left {
- font-size: 34rpx;
- color: $main-font;
- font-weight: bold;
- }
- .right {
- display: flex;
- align-items: center;
- .text {
- color: $sec-font;
- font-size: 28rpx;
- }
- .iconfont {
- font-size: 24rpx;
- color: $sec-font;
- margin-left: 8rpx;
- }
- }
- }
- .home-container {
- background: #f5f5f5;
- }
- .all-container {
- padding: 1rpx 20rpx 20rpx;
- }
- .card {
- @include zj-card;
- padding: 30rpx;
- margin-top: 20rpx;
- background: linear-gradient(180deg, #f3f9fe 0%, #ffffff 100%);
- }
- .swiper-container {
- @include zj-card;
- margin-top: 20rpx;
- padding: 0 20rpx;
- ::v-deep .u-swiper {
- height: 350rpx !important;
- .u-swiper__wrapper {
- height: 350rpx !important;
- }
- .u-swiper__wrapper__item__wrapper__image {
- height: 350rpx !important;
- }
- }
- }
- .swiper2-container {
- @include zj-card;
- position: relative;
- margin-top: 20rpx;
- ::v-deep .u-swiper {
- height: 188rpx !important;
- .u-swiper__wrapper {
- height: 188rpx !important;
- }
- .u-swiper__wrapper__item__wrapper__image {
- height: 188rpx !important;
- }
- }
- }
- .noticebar-container {
- margin-top: 30rpx;
- }
- .service-container {
- padding: 0;
- .home-title {
- padding: 30rpx 30rpx 0;
- }
- .list {
- display: flex;
- margin-top: 40rpx;
- flex-wrap: wrap;
- padding-bottom: 30rpx;
- .item {
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- box-sizing: border-box;
- margin-bottom: 20rpx;
- &:nth-child(5),
- &:nth-child(6),
- &:nth-child(7),
- &:nth-child(8) {
- margin-bottom: 0;
- }
- image {
- width: 76rpx;
- height: 76rpx;
- }
- text {
- font-size: 26rpx;
- font-weight: 500;
- margin-top: 16rpx;
- }
- }
- }
- }
- .share-container {
- .list {
- display: flex;
- margin-top: 40rpx;
- .item {
- flex: 1;
- padding: 20rpx;
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- image {
- flex-shrink: 0;
- width: 88rpx;
- height: 88rpx;
- }
- .text {
- margin-left: 20rpx;
- font-size: 32rpx;
- }
- &:first-child {
- margin-right: 30rpx;
- background: #e8f5fe;
- .text {
- color: #6ca2f8;
- }
- }
- &:last-child {
- background: #fff9f4;
- .text {
- color: #d87e3b;
- }
- }
- }
- }
- }
- .order-container {
- .list {
- display: flex;
- justify-content: space-between;
- margin-top: 40rpx;
- .item {
- display: flex;
- flex-direction: column;
- align-items: center;
- box-sizing: border-box;
- padding: 0 10rpx;
- image {
- width: 76rpx;
- height: 76rpx;
- }
- text {
- font-size: 26rpx;
- font-weight: 500;
- margin-top: 16rpx;
- }
- }
- }
- }
- .other-container {
- padding: 30rpx 0;
- .home-title {
- padding: 0 30rpx;
- }
- .list {
- display: flex;
- margin-top: 40rpx;
- .item {
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- box-sizing: border-box;
- padding: 0 10rpx;
- image {
- width: 76rpx;
- height: 76rpx;
- }
- text {
- font-size: 26rpx;
- font-weight: 500;
- margin-top: 16rpx;
- }
- }
- }
- }
- .contact-container {
- .list {
- margin-top: 20rpx;
- .item {
- display: flex;
- align-items: center;
- height: 100rpx;
- background: none;
- padding: 0;
- &::after {
- border: none;
- }
- image {
- width: 44rpx;
- height: 44rpx;
- margin-right: 20rpx;
- }
- .title {
- flex: 1;
- font-size: 30rpx;
- font-weight: 500;
- text-align: left;
- line-height: 1;
- }
- .iconfont {
- font-size: 26rpx;
- color: $sec-font;
- }
- }
- .wrap1 {
- // border-bottom: 1px solid #eaeaea;
- padding-bottom: 20rpx;
- padding-left: 60rpx;
- .it {
- padding: 20rpx 0;
- border-bottom: 1px solid #f5f5f5;
- &:last-child {
- border-bottom: none;
- }
- .top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left {
- font-size: 28rpx;
- }
- .right {
- .iconfont {
- font-size: 36rpx;
- color: $theme-color;
- }
- }
- }
- .address {
- margin-top: 12rpx;
- font-size: 28rpx;
- color: $sec-font;
- }
- }
- }
- .wrap2 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-left: 60rpx;
- .left {
- font-size: 28rpx;
- }
- .right {
- .iconfont {
- font-size: 36rpx;
- color: $theme-color;
- }
- }
- }
- }
- }
- .dialog-container {
- position: fixed;
- z-index: 1000000;
- top: 0;
- left: 0;
- width: 100%;
- height: 100vh;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background: rgba($color: #000000, $alpha: 0.6);
- .image {
- width: 600rpx;
- display: block;
- border-radius: 20rpx;
- margin-top: 40rpx;
- }
- .iconfont {
- font-size: 68rpx;
- color: #ffffff;
- margin-top: 40rpx;
- }
- }
- </style>
- <style>
- ::-webkit-scrollbar {
- display: none;
- width: 0 !important;
- height: 0 !important;
- -webkit-appearance: none;
- background: transparent;
- color: transparent;
- }
- </style>
|