| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520 |
- <template>
- <view class="content-wrap bg-color">
- <view class="head-wrap">
- <view class="content-info ">
- <view class="h-bg">
- <!-- 轮播图 -->
- <u-swiper :circular="true" :list="bannerList" :height="340"></u-swiper>
- </view>
- <view class="content">
- <!-- 通知栏 -->
- <view v-if="noticeList.length > 0" class="h-notice-bar">
- <scroll-notice :dataList="noticeList" :type="2" :interval="3000" :height="46" :fontSize="12"
- color="#666666" @click="handleNoticeClick"></scroll-notice>
- </view>
- <!-- 个人信息、钱包、商店 -->
- <view class="h-content-wrap">
- <!-- 欢迎语 -->
- <view class="welcome-wrap">
- <view class="logo">
- <image :src="userInfo.selfPhotoUrl || '/static/me/ud4.png'" mode=""></image>
- </view>
- <view class="text">
- <view class="phone">{{ userInfo.ncikName || '' }}</view>
- <!-- <view class="welcome">尊敬的{{ userInfo.ncikName || ''}},下午好~</view>-->
- </view>
- <view v-if="isShowCoupon" @click="goQrCode" class="arrow-right">
- <!-- <image v-if="userInfo.wxQrCode" class="qrcode" :src="userInfo.qrcode" mode=""></image> -->
- <!-- <image class="qrcode" src="../../static/index/qrcode.png" mode=""></image>
- <view class="h-text">会员码</view> -->
- <view class="coupon-wrap">
- <!-- <u-icon name="/static/me/u5.png" color="#ffb83d" size="22"></u-icon>-->
- <text>邀约有礼</text>
- </view>
- </view>
- </view>
- <!-- 余额信息 -->
- <!-- <view class="balance-info">-->
- <!-- <view @click="gotoRechargeService()" class="balance-amount">-->
- <!-- <text class="number" v-if="userInfo.balance">¥{{ userInfo.balance }}</text>-->
- <!-- <text class="number" v-else>¥0.00</text>-->
- <!-- <view class="">余额</view>-->
- <!-- </view>-->
- <!-- <view class="score-info">-->
- <!-- <text class="number" v-if="userInfo.integral">{{ userInfo.integral }}</text>-->
- <!-- <text class="number" v-else>0</text>-->
- <!-- <view class="">积分</view>-->
- <!-- </view>-->
- <!-- <view @click="gotoCoupon()" class="coupon-info">-->
- <!-- <text class="number" v-if="userInfo.coupon">{{ userInfo.coupon }}</text>-->
- <!-- <text class="number" v-else>0</text>-->
- <!-- <view class="">优惠券</view>-->
- <!-- </view>-->
- <!-- <view class="e-currency-info">-->
- <!-- <text class="number" v-if="userInfo.electronicCurrency">{{ userInfo.electronicCurrency }}</text>-->
- <!-- <text class="number" v-else>0</text>-->
- <!-- <view class="">电子币</view>-->
- <!-- </view>-->
- <!-- </view>-->
- <view class="custom-line"></view>
- <view class="store-wrap">
- <view class="store-info">
- <view class="logo">
- <image src="../../static/index/u55.png" mode=""></image>
- </view>
- <view @click="gotoStoreChoose()" class="store-content">
- <view class="h-row">
- <view class="store-desc">
- <view class="store-name">
- <view class="">{{ storeInfo.storeName }}</view>
- </view>
- </view>
- <view class="arrow-right">
- <view class="change-store">更换门店</view>
- <u-icon name="arrow-right" color="#333" size="16"></u-icon>
- </view>
- </view>
- <view class="h-row">
- <text class="address">地址:{{ storeInfo.address }}</text>
- <text class="address1">{{ storeInfo.distanceDesc }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 上次订单 -->
- <view class="nav-wrap ">
- <view class="upper-order-wrap">
- <!-- 左边内容 -->
- <view @click="gotoServiceOrder()" class="left-content">
- <view class="title">
- 当日排队
- </view>
- <view class="desc">
- <!-- 多种服务模式任您选择-->
- </view>
- <view class="bg-img">
- <image src="../../static/index/2.png" mode=""></image>
- </view>
- </view>
- <!-- 右边内容 -->
- <view class="right-content" @click="goBookService()">
- <view class="title">
- 明日预约
- </view>
- <view class="desc">
- <!-- 拼命研发中敬请期待...-->
- </view>
- <view class="bg-img">
- <image src="../../static/index/1.png" mode=""></image>
- </view>
- </view>
- </view>
- <!-- 导航菜单 -->
- <view class="horizontal-dashed-line"></view>
- <view class="menu-tab">
- <!-- <view class="button-wrap">-->
- <!-- <view @click="gotoComeOrder()" class="btn">-->
- <!-- <view class="icon">-->
- <!-- <u-icon name="/static/index/u213.png" color="red" size="30"></u-icon>-->
- <!-- </view>-->
- <!-- <view class="name">-->
- <!-- 再来一单-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <view class="button-wrap">
- <view @click="gotoRechargeService()" class="btn">
- <view class="icon">
- <u-icon name="/static/index/u215.png" color="red" size="30"></u-icon>
- </view>
- <view class="name">
- 储值服务
- </view>
- </view>
- </view>
- <!-- <view class="button-wrap">-->
- <!-- <view @click="gotoOrder()" class="btn">-->
- <!-- <view class="icon">-->
- <!-- <u-icon name="/static/index/u217.png" color="red" size="30"></u-icon>-->
- <!-- </view>-->
- <!-- <view class="name">-->
- <!-- 当前订单-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <view class="button-wrap">
- <view @click="gotoReceiveCoupons()" class="btn">
- <view class="icon">
- <u-icon name="/static/index/u247.png" color="red" size="30"></u-icon>
- </view>
- <view class="name">
- 领券中心
- </view>
- </view>
- </view>
- <view class="button-wrap">
- <view @click="goRights()" class="btn">
- <view class="icon">
- <u-icon name="/static/index/equity_card.png" color="red" size="30"></u-icon>
- </view>
- <view class="name">
- 权益卡
- </view>
- </view>
- </view>
- <view class="button-wrap">
- <view @click="goActivity()" class="btn">
- <view class="icon">
- <u-icon name="/static/index/huodong.png" color="red" size="30"></u-icon>
- </view>
- <view class="name">
- 活动中心
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 为你推荐 -->
- <!-- <view class="recommend-wrap">-->
- <!-- <view class="recommend-nav">-->
- <!-- <view class="icon">-->
- <!-- <image src="/static/index/u87.png" mode=""></image>-->
- <!-- </view>-->
- <!-- <view class="title">-->
- <!-- 为你推荐-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <!– 分割线 –>-->
- <!-- <view class="custom-line"></view>-->
- <!-- <!– 门店列表 –>-->
- <!-- <view class="store-wrap ">-->
- <!-- <view class="store-list">-->
- <!-- <view class="store-content">-->
- <!-- <view class="store-img">-->
- <!-- <image src="../../static/logo.png" mode=""></image>-->
- <!-- </view>-->
- <!-- <view class="h-store-content">-->
- <!-- <view class="title">-->
- <!-- <text>{{ storeInfo.storeName }}</text>-->
- <!-- </view>-->
- <!-- <view class="adress">-->
- <!-- 地址:{{ storeInfo.address }}-->
- <!-- </view>-->
- <!-- <view class="desc">-->
- <!-- <view class="price">-->
- <!-- </view>-->
- <!-- <view @click="gotoGoods()" class="order-btn">-->
- <!-- <view class="btn">去下单</view>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="footer ">-->
- <!-- <view class="">---到底了---</view>-->
- <!-- </view>-->
- </view>
- </view>
- </view>
- <!-- <view class="tabBarView">-->
- <!-- <tab-bar :tabIndex="tabIndex"></tab-bar>-->
- <!-- </view>-->
- <uni-popup :mask-click="false" ref="strategyListPoup">
- <view class="flex-col justify-start expirePopup" style="position: relative;">
- <view class="flex-row justify-between" style="position: absolute;top: 20rpx;right: 20rpx"
- @click="closeStrategyListPoup">
- <u-icon size="20" name="close-circle-fill"></u-icon>
- </view>
- <view class="flex-row justify-center">
- <text class="popupTitle">新人专享</text>
- </view>
- <scroll-view scroll-y class="flex-col justify-start scroll-y1">
- <view class="flex-col">
- <u--form
- labelPosition="left"
- :model="phoneParam"
- :rules="rules"
- ref="form1"
- >
- <u-form-item
- label="手机号"
- prop="phonenumber"
- labelWidth="auto"
- labelAlign="right"
- >
- <u--input
- v-model="phoneParam.phonenumber"
- placeholder="请输入手机号"
- border="bottom"
- type="number"
- maxlength="11"
- ></u--input>
- </u-form-item>
- <u-form-item
- labelWidth="auto"
- labelAlign="right"
- label="验证码"
- prop="smsCode"
- width="120"
- >
- <u--input
- v-model="phoneParam.smsCode"
- disabledColor="#ffffff"
- placeholder="请输入验证码"
- border="bottom"
- maxlength="4"
- ></u--input>
- <template #right>
- <view class="identifying-code">
- <u-code
- ref="uCode3"
- @change="codeChange2"
- keep-running
- start-text="获取验证码"
- ></u-code>
- <text
- @tap="getCode2"
- :text="tips2"
- class="u-page__code-text"
- >{{ tips2 }}
- </text>
- </view>
- </template>
- </u-form-item>
- </u--form>
- <view class="flex-col justify-start">
- <text style="font-size: 28rpx;color: #333333;text-align: center">{{ rule.title }}</text>
- </view>
- <view class="flex-col " v-for="(item,index) in rule.strategyList" :key="index">
- <view class="flex-row justify-start quan " :class="[item.select == 1 ? 'row-list' : 'listBackground']"
- @click="selectQuan(item,index)">
- <view class=" h-text flex-col justify-center ">
- <view class="money">
- <text class="money" v-if="item.discountsType == 2">{{ item.discount }}折</text>
- <text class="money" v-else>{{ `减` + item.discountsPrice }}</text>
- </view>
- <view class="desc">
- <text>满{{ item.reachPrice }}可用</text>
- </view>
- </view>
- <view class=" h-center-content flex-col justify-around">
- <view class="h-value">
- <text>{{ item.name }}</text>
- </view>
- <view>
- <view class="title">
- 可用次数:{{ item.degree }}
- </view>
- </view>
- <view class="title flex-row">
- <text @click="showRemark(item)">使用说明</text>
- <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>
- <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>
- </view>
- </view>
- </view>
- <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
- <view class="remarkText">
- <view>
- 可用门店:
- <text>{{ item.useStoreDesc }}</text>
- </view>
- <view>
- 适用项目:
- <text>{{ item.useServiceDesc }}</text>
- </view>
- <view v-if="item.remark !=null">
- 使用说明:
- <text>{{ item.remark }}</text>
- </view>
- <text v-else class="remarkText">该优惠券暂无使用说明</text>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- <view @click="userBindMember" class="op-btn-wrap">
- <view class="h-btn">
- <text v-if="rule.isAllReceived == 1">全部领取</text>
- <text v-else>确定 (可选{{ rule.receivedCount }}张优惠券)</text>
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import tabBar from "../../components/tabBar/tabBar";
- import ScrollNotice from '../../components/scroll-notice/ScrollNotice.vue';
- export default {
- components: {
- ScrollNotice,
- tabBar
- },
- data() {
- return {
- isShowCoupon: false,
- isGetAddress: true, //是否获取到了经纬度
- noticeList: [],
- notice: '',
- userInfo: {},
- bannerList: [],
- reqParm: {
- auth: false,
- appid: 46,
- telphone: '',
- latitude: 26.5737,
- longitude: 106.7135,
- },
- storeList: [],
- storeInfo: {},
- showRemarkId: '',
- rule: [],
- tips2: '',
- phoneParam: {
- phonenumber: '',
- smsCode: '',
- },
- rules: {
- phonenumber: [
- {
- required: true,
- min: 11,
- max: 11,
- message: '请输入11位电话号码',
- trigger: ['blur', 'change'],
- },
- {
- // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
- validator: (rule, value, callback) => {
- // 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
- return !this.$isDataEmpty(value);
- },
- message: "请认真填写电话号码",
- trigger: ['blur', 'change'],
- }
- ],
- smsCode: {
- required: true,
- min: 4,
- max: 6,
- message: '请输入4位验证码',
- trigger: ['blur', 'change'],
- },
- },
- myActivityList: [],
- };
- },
- onShow() {
- const accessToken = uni.getStorageSync('accessToken')
- if (accessToken) {
- this.myActivity()
- }
- this.updateApp()
- this.userInfo = uni.getStorageSync('userInfo');
- if (this.userInfo.selfPhoto) {
- this.getImgUrlByOssId(this.userInfo.selfPhoto);
- }
- // 查询门店信息
- const data = uni.getStorageSync('storeInfo');
- if (!data) {
- setTimeout(e => {
- console.log('定时器要执行了 isGetAddress =>', this.isGetAddress)
- if (this.isGetAddress) {
- console.log('定时器执行了isGetAddress =>', this.isGetAddress)
- this.isGetAddress = !this.isGetAddress
- this.getStoreListData(this.reqParm)
- }
- }, 3000)
- // 获取位置信息查询门店列表数据
- this.getLocation();
- } else {
- this.storeInfo = data;
- }
- // 用户主动登录后,处理拓客端扫码逻辑
- this.handleExpandParam()
- },
- onLoad(e) {
- //程序启动时自动登录成功时触发的事件
- uni.$off('loginSuccess')
- uni.$on('loginSuccess', this.getRuleById)
- console.log(e)
- if (e.shareUserId) {
- //用户点击分享到好友或者朋友圈传递过来的参数
- uni.setStorageSync('shareUserId', e.shareUserId)
- }
- if (e.q) {
- //用户扫技师端或者拓客端二维码传递过来的参数
- const q = decodeURIComponent(e.q)
- let a = q.split('?')
- let b = a[1].split('&')
- let param = {} //技师端分享过来的参数
- for (let i = 0; i < b.length; i++) {
- param[b[i].split('=')[0]] = b[i].split('=')[1]
- }
- if (param.expandUserId) { //从拓客端进来的用户
- console.log('扫拓客端二维码进入小程序')
- uni.setStorageSync('expandParam', param)
- } else if (param.scene) {
- console.log('扫用户的会员码进入小程序')
- uni.setStorageSync('shareUserId', param.scene)
- } else if (param.techNo) { //从技师端进来的用户
- console.log('扫技师二维码进入小程序')
- uni.setStorageSync('promotionParam', param)
- uni.removeStorageSync('storeParam');
- this.operLog()
- } else {
- //用户扫门店的二维码进入小程序
- uni.setStorageSync('storeParam', param)
- uni.removeStorageSync('promotionParam');
- }
- console.log("用户扫技师端或者拓客端二维码传递过来的参数", param)
- }
- //公告信息
- this.getNoticeListData();
- // 获取banner图列表
- this.getSlideshowList();
- // 用户信息
- setTimeout(() => {
- this.userInfo = uni.getStorageSync('userInfo');
- if (this.userInfo.selfPhoto) {
- this.getImgUrlByOssId(this.userInfo.selfPhoto);
- }
- }, 2000)
- },
- //分享到朋友圈
- onShareTimeline(option) {
- return {
- title: '娇骄儿造型',
- imageUrl: '/static/logo.png',
- query: `shareUserId='${this.userInfo.id}`,
- success(res) {
- uni.showToast({
- title: '分享成功'
- })
- },
- fail(res) {
- uni.showToast({
- title: '分享失败',
- icon: 'none'
- })
- }
- };
- },
- //分享到好友
- onShareAppMessage: function (res) {
- return {
- title: '娇骄儿造型',
- imageUrl: '/static/logo.png',
- path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
- success(res) {
- uni.showToast({
- title: '分享成功'
- })
- },
- fail(res) {
- uni.showToast({
- title: '分享失败',
- icon: 'none'
- })
- }
- };
- },
- methods: {
- // 处理拓客端扫码逻辑(用户从登录页回来后调用)
- handleExpandParam() {
- let expandParam = uni.getStorageSync('expandParam')
- console.log('========handleExpandParam expandParam=======', expandParam)
- if (!expandParam || expandParam.isUse == 1) {
- console.log('========handleExpandParam 无参数或已使用,直接返回=======')
- return
- }
- // 检查是否已登录(有 accessToken)
- const accessToken = uni.getStorageSync('accessToken')
- if (!accessToken) {
- console.log('========handleExpandParam 未登录,直接返回=======')
- return
- }
- // 二维码过期检查
- if (new Date().getTime() > expandParam.timestamp) {
- uni.showModal({
- title: '温馨提示',
- content: '当前二维码已过期,请重新扫码',
- showCancel: false
- });
- expandParam.isUse = 1
- uni.setStorageSync('expandParam', expandParam)
- return
- }
- const isNew = uni.getStorageSync('wxLoginIsNew')
- console.log('========handleExpandParam isNew=======', isNew)
- if (isNew) {
- this.getRuleById()
- } else {
- this.$api.addRecordForAttach({
- ...expandParam,
- isNew: 0,
- isBindSuccess: 0,
- }).then(res => {
- expandParam.isUse = 1
- uni.setStorageSync('expandParam', expandParam)
- console.log('+++++++++老用户,扫码推广失败记录!++++++++++++++++')
- })
- }
- },
- myActivity() {
- // this.$api.myActivity({
- // pageNum: 1,
- // pageSize: 10,
- // }).then(res => {
- // this.myActivityList = res.data.rows
- //
- // })
- this.$api.myActivityIsShow().then(res =>{
- this.isShowCoupon = res.data.data
- })
- },
- closeStrategyListPoup() {
- this.$refs.strategyListPoup.close()
- //关闭弹窗
- console.log('拓客端推广用户绑定失败!')
- console.log('+++++++++++++++expandParam+++++++++++++++++++++++', expandParam)
- that.$api.addRecordForAttach({
- ...expandParam,
- isNew: 1,
- isBindSuccess: 0,
- }).then(res => {
- expandParam.isUse = 1
- uni.setStorageSync('expandParam', expandParam)
- console.log('+++++++++新用户,扫码推广失败记录!++++++++++++++++')
- })
- // uni.removeStorageSync('expandParam');
- },
- userBindMember() {
- let expandParam = uni.getStorageSync('expandParam')
- let that = this
- this.$refs.form1.validate().then(res => {
- let couponIds = []
- for (const strategy of this.rule.strategyList) {
- if (strategy.select == 1) {
- couponIds.push(strategy.id)
- }
- }
- if (couponIds.length !== this.rule.receivedCount && this.rule.isAllReceived !== 1) {
- uni.showToast({
- title: '请选择' + this.rule.receivedCount + '张优惠券',
- duration: 2000,
- icon: "error"
- });
- return
- }
- //用户扫码拓客端进入小程序
- that.$api.userBindMember(
- {
- ...expandParam,
- memberId: this.userInfo.id,
- memberPhone: this.phoneParam.phonenumber,
- smsCode: this.phoneParam.smsCode,
- couponIds: couponIds
- }
- ).then(res1 => {
- //关闭弹窗
- this.$refs.strategyListPoup.close()
- uni.showToast({
- title: '领取成功',
- duration: 2000,
- icon: "success"
- });
- setTimeout(() => {
- uni.navigateTo({
- url: "/orderPages/myCoupon/index"
- })
- }, 2000)
- console.log('拓客端推广用户绑定成功!')
- console.log('+++++++++++++++expandParam+++++++++++++++++++++++', expandParam)
- that.$api.addRecordForAttach({
- ...expandParam,
- isNew: 1,
- isBindSuccess: 1,
- }).then(res => {
- console.log('+++++++++新用户,扫码推广成功记录!++++++++++++++++')
- })
- expandParam.isUse = 1
- uni.setStorageSync('expandParam', expandParam)
- // uni.removeStorageSync('expandParam');
- })
- }).catch(errors => {
- console.log(errors)
- uni.$u.toast('校验失败,请认真填写')
- })
- },
- codeChange2(text) {
- this.tips2 = text;
- },
- getCode2() {
- let that = this;
- if (this.$refs.uCode3.canGetCode) {
- that.getPhoneCode();
- } else {
- uni.$u.toast('倒计时结束后再发送');
- }
- },
- // 获取验证码
- getPhoneCode() {
- let that = this;
- // 模拟向后端请求验证码
- uni.showLoading({
- title: '正在获取验证码'
- })
- this.$api.getSmsCodeByType({phonenumber: this.phoneParam.phonenumber, auth: true, type: 0}).then((res) => {
- uni.hideLoading();
- // 这里此提示会被this.start()方法中的提示覆盖
- uni.$u.toast('验证码已发送');
- // 通知验证码组件内部开始倒计时
- that.$refs.uCode3.start();
- })
- },
- showRemark(item) {
- if (this.showRemarkId == item.id) {
- this.showRemarkId = ''
- } else {
- this.showRemarkId = item.id
- }
- },
- getRuleById() {
- let expandParam = uni.getStorageSync('expandParam')
- console.log('========getRuleById expandParam=======', expandParam)
- console.log('========getRuleById ruleId=======', expandParam.ruleId)
- this.$api.getRuleById({
- id: expandParam.ruleId
- }).then(res => {
- console.log('========getRuleById res=======', res)
- this.rule = res.data.data
- if (this.rule.strategyList && this.rule.strategyList.length > 0) {
- for (const strategy of this.rule.strategyList) {
- if (this.rule.isAllReceived == 1) {
- strategy.select = 1
- } else {
- strategy.select = 0
- }
- }
- this.$refs.strategyListPoup.open()
- console.log('========拓客弹窗已打开=======')
- } else {
- console.log('========strategyList为空,不弹窗=======')
- }
- }).catch(err => {
- console.log('========getRuleById 请求失败=======', err)
- })
- },
- selectQuan(item, index) {
- if (this.rule.isAllReceived == 1) {
- return
- }
- console.log(item)
- item.select = item.select ? 0 : 1
- this.$set(this.rule.strategyList, index, item)
- },
- operLog() {
- let param = uni.getStorageSync('promotionParam')
- let userInfo = uni.getStorageSync('userInfo')
- // #ifdef MP-WEIXIN
- const accountInfo = wx.getAccountInfoSync();
- console.log(accountInfo.miniProgram.version, '小程序版本号')
- // #endif
- const data = {
- title: "小程序扫码记录",
- operParam: param.techNo,
- operName: userInfo.no,
- deptName: param.storeId,
- errorMsg: accountInfo.miniProgram.version
- }
- console.log(data)
- this.$api.scanLogs(data).then(res => {
- console.log('------日志发送成功---------')
- }).catch(errors => {
- console.log(errors, '------日志发送失败---------')
- })
- },
- goQrCode() {
- uni.navigateTo({
- // url: '/pages/qrCode/index'
- url: '/myPages/myActivity/myActivity'
- })
- },
- goActivity() {
- uni.navigateTo({
- url: '/orderPages/activityList/activityList'
- })
- },
- goRights() {
- uni.navigateTo({
- url: '/storePages/rights/index'
- })
- },
- // 去服务点单页面
- gotoServiceOrder() {
- uni.navigateTo({
- url: '/orderPages/storeService/index'
- })
- },
- goBookService() {
- uni.navigateTo({
- url: '/orderPages/bookService/index'
- })
- },
- //点击通知
- handleNoticeClick(e) {
- console.log(e)
- uni.navigateTo({
- url: '/storePages/notice/index?noticeId=' + e.noticeId,
- })
- },
- // 去优惠劵大厅
- gotoReceiveCoupons() {
- uni.navigateTo({
- url: '/orderPages/receiveCoupons/index'
- })
- },
- // 去我的优惠劵页面
- gotoCoupon() {
- uni.navigateTo({
- url: '/orderPages/myCoupon/index'
- })
- },
- // 储值服务
- gotoRechargeService() {
- uni.navigateTo({
- url: '/myPages/recharge/index?name=lisa',
- })
- },
- // 获取banner图片
- getSlideshowList() {
- let that = this;
- this.$api.getSlideshowList({
- data: this.reqParm
- }).then((res) => {
- this.getImgUrlByBannerOssId(res.data.data);
- })
- },
- async getImgUrlByBannerOssId(items) {
- for (let i = 0; i < items.length; i++) {
- if (items[i].slideshowId) {
- this.$api.getImage(items[i].slideshowId).then(res => {
- this.bannerList.push(res.data.data[0].url.replace(/^http:/, "https:"))
- })
- }
- }
- },
- // 获取门店列表数据
- getStoreListData(data) {
- let that = this;
- // 用户绑定门店
- this.$api.storeList(data).then((res) => {
- console.log(res.data.data[0])
- that.storeInfo = res.data.data[0]
- // 更新用户选择的门店信息
- uni.setStorageSync('storeInfo', res.data.data[0])
- })
- },
- getNoticeListData() {
- let req = {
- auth: false,
- noticeType: 2,
- status: 0
- }
- this.$api.noticeList(req).then((res) => {
- if (res.data.rows.length === 1) {
- this.noticeList.push(res.data.rows[0])
- this.noticeList.push(res.data.rows[0])
- } else {
- this.noticeList = res.data.rows;
- }
- })
- },
- getImgUrlByOssId(ossId) {
- if (ossId) {
- this.$api.getImage(ossId).then(res => {
- this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
- this.$set(this.userInfo)
- })
- }
- },
- // 获取经纬度信息f
- getLocation() {
- let that = this
- console.log('+++++++++++++开始获取位置信息++++++++++++++++')
- uni.getLocation({
- type: 'gcj02',
- success: function (res) {
- console.log(res)
- let latitude = res.latitude; // 纬度
- let longitude = res.longitude; // 经度
- let speed = res.speed; // 速度
- let accuracy = res.accuracy; // 精确度
- // 在这里可以对位置信息进行处理
- console.log("纬度:" + latitude + ";经度" + longitude)
- that.reqParm.latitude = latitude
- that.reqParm.longitude = longitude
- uni.setStorageSync('location', that.reqParm)
- },
- fail: function (fail) {
- console.log('获取用户地址失败==》', fail)
- },
- complete: function (complete) {
- console.log('获取用户地址失败or成功==》', complete)
- if (that.isGetAddress) {
- console.log("根据位置获取门店执行了 isGetAddress =>", that.isGetAddress)
- that.isGetAddress = !that.isGetAddress
- that.getStoreListData(that.reqParm)
- }
- }
- });
- },
- // 去选择门店
- gotoStoreChoose() {
- uni.navigateTo({
- url: '/storePages/store/store-choose?type=1',
- })
- },
- // 去再来一单
- gotoComeOrder() {
- uni.$u.route({
- url: '/pages/index/tabbar',
- params: {
- PageCur: 'orderList',
- status: '4'
- }
- })
- },
- // 去订单页面
- gotoOrder() {
- uni.setStorageSync('orderListIndex', 1)
- uni.switchTab({
- url: '/pages/order/index',
- })
- },
- // 去商品下单页面
- gotoGoods() {
- uni.navigateTo({
- url: '/orderPages/bookService/index',
- })
- },
- // 用户绑定门店
- userBindStore() {
- let that = this;
- // 用户绑定门店
- this.$api.userBindStore(this.reqParm).then((res) => {
- console.log(this.reqParm)
- })
- },
- updateApp() {
- const updateManager = uni.getUpdateManager();
- updateManager.onCheckForUpdate(function (res) {
- // 请求完新版本信息的回调
- console.log('++++++++++onCheckForUpdate++++++++++', res.hasUpdate);
- if (res.hasUpdate) {
- updateManager.onUpdateReady(function (res) {
- console.log('+++++++++onUpdateReady+++++++++++++', res)
- uni.showModal({
- title: '更新提示',
- content: '新版本已经准备好,是否重启应用?',
- showCancel: false,
- success(res) {
- if (res.confirm) {
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
- updateManager.applyUpdate();
- }
- }
- });
- });
- updateManager.onUpdateFailed(function (res) {
- // 新的版本下载失败
- console.log('+++++++++onUpdateFailed+++++++++++++', res)
- uni.showModal({
- title: '更新提示',
- content: '检测到小程序更新,但是下载失败,请检查网络',
- showCancel: false
- });
- });
- }
- });
- },
- }
- };
- </script>
- <style scoped lang="scss">
- @import "index.rpx.css";
- /* 头部内容 */
- .head-wrap {
- height: 100vh;
- background: #FFE05C;
- overflow: auto;
- .content-info {
- position: relative;
- .h-bg {
- height: 680rpx;
- }
- .content {
- position: absolute;
- top: 460rpx;
- left: 24rpx;
- right: 24rpx;
- border-radius: 12rpx;
- padding-bottom: 40rpx;
- .h-notice-bar {
- padding-left: 20rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(237, 86, 159, 0.05);
- border-radius: 20rpx;
- }
- .noticeCard {
- margin-top: 10rpx;
- padding: 10rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(237, 86, 159, 0.05);
- border-radius: 10px;
- }
- .h-content-wrap {
- background: #fff;
- border-radius: 10px;
- /* 欢迎语 */
- .welcome-wrap {
- padding-top: 12px;
- display: flex;
- margin-left: 12px;
- margin-right: 12px;
- margin-top: 16px;
- align-items: center;
- .logo {
- width: 13%;
- image {
- border-radius: 18px;
- width: 36px;
- height: 36px;
- }
- }
- .text {
- width: 60%;
- font-size: 14px;
- .welcome-wrap {
- font-size: 12px;
- color: #999999;
- }
- .welcome {
- font-size: 12px;
- color: #999999;
- }
- }
- .arrow-right {
- width: 30%;
- text-align: center;
- cursor: pointer;
- display: flex;
- justify-content: center;
- background: #fff8db;
- // background: red;
- height: 32px;
- align-items: center;
- border-radius: 16px;
- .qrcode {
- height: 20px;
- width: 20px;
- }
- .h-text {
- font-size: 12px;
- color: #999999;
- }
- .coupon-wrap {
- display: flex;
- font-size: 14px;
- align-items: center;
- }
- }
- }
- /* 钱包信息 */
- .balance-info {
- font-size: 12px;
- padding-left: 12px;
- margin-bottom: 16px;
- margin-top: 12px;
- color: #666;
- display: flex;
- justify-content: space-around;
- text-align: center;
- .balance-amount {
- padding-right: 4px;
- }
- .score-info {
- padding-right: 4px;
- }
- .coupon-info {
- padding-right: 4px;
- }
- .e-currency-info {
- padding-right: 4px;
- }
- .number {
- color: #333333;
- font-size: 14px;
- }
- }
- /* 商店信息 */
- .store-wrap {
- margin: 10px;
- .store-info {
- display: flex;
- .logo {
- width: 10%;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
- image {
- width: 30px;
- height: 30px;
- }
- }
- .store-content {
- width: 90%;
- padding-bottom: 13px;
- .h-row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .store-desc {
- width: 90%;
- display: flex;
- line-height: 30px;
- font-size: 14px;
- .store-name {
- }
- }
- .arrow-right {
- text-align: right;
- margin: 0 auto;
- cursor: pointer;
- padding-top: 3px;
- width: 100px;
- display: flex;
- font-size: 14px;
- .change-store {
- text-align: right;
- color: #666;
- }
- image {
- width: 18px;
- height: 18px;
- }
- }
- .address {
- width: 400rpx;
- color: #999999;
- font-size: 12px;
- padding-right: 12px;
- }
- .address1 {
- color: #999999;
- font-size: 12px;
- padding-right: 12px;
- }
- }
- }
- }
- .adress {
- font-size: 22rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- padding-left: 80rpx;
- color: #666;
- }
- }
- }
- }
- }
- }
- /* 上次订单 */
- .nav-wrap {
- background: #fff;
- border-radius: 8px;
- margin-top: 16px;
- .upper-order-wrap {
- display: flex;
- border-radius: 6px;
- justify-content: center;
- .left-content {
- margin-top: 20px;
- width: 50%;
- font-size: 12px;
- text-align: center;
- border-radius: 10px;
- .title {
- font-size: 18px;
- text-align: center;
- }
- .desc {
- padding-top: 6px;
- color: #999999;
- }
- .bg-img {
- text-align: center;
- height: 100px;
- display: flex;
- justify-content: center;
- align-items: center;
- image {
- width: 78px;
- height: 78px;
- }
- }
- }
- .right-content {
- margin-top: 20px;
- width: 50%;
- font-size: 12px;
- text-align: center;
- .title {
- font-size: 18px;
- text-align: center;
- }
- .desc {
- padding-top: 6px;
- color: #999999;
- }
- .bg-img {
- height: 100px;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
- image {
- width: 78px;
- height: 78px;
- }
- }
- }
- }
- .menu-tab {
- display: flex;
- justify-content: space-around; // 平均分布
- justify-content: center;
- padding-bottom: 8px;
- .button-wrap {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 16px;
- margin-bottom: 18px;
- .name {
- padding-top: 3px;
- font-size: 12px;
- color: #666666;
- }
- .btn {
- padding-left: 12px;
- padding-right: 12px;
- height: 36px;
- border-radius: 18px;
- .icon {
- display: flex;
- padding-right: 6px;
- align-items: center;
- justify-content: center;
- image {
- height: 14px;
- width: 14px;
- }
- }
- }
- }
- }
- }
- /* 为你推荐 */
- .recommend-wrap {
- margin-top: 16px;
- background: #fff;
- border-radius: 8px;
- .recommend-nav {
- display: flex;
- margin-left: 12px;
- padding-top: 8px;
- padding-bottom: 4px;
- align-items: center;
- .icon {
- padding-right: 4px;
- image {
- height: 26px;
- width: 26px;
- }
- }
- .title {
- font-size: 16px;
- }
- }
- /* 门店列表 */
- .store-wrap {
- margin: 12px;
- height: 100px;
- .store-list {
- margin-top: 16px;
- .store-content {
- display: flex;
- .store-img {
- width: 30%;
- image {
- width: 100%;
- height: 78px;
- border-radius: 6px;
- }
- }
- .h-store-content {
- width: 70%;
- padding-left: 8px;
- padding-top: 4px;
- .title {
- font-size: 18px;
- font-family: "黑体", sans-serif;
- }
- .adress {
- font-size: 28rpx;
- line-height: 36rpx;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- color: #666;
- }
- .price {
- color: #666;
- width: 60%;
- font-size: 14px;
- line-height: 22px;
- .red {
- color: red;
- font-size: 16px;
- }
- }
- .desc {
- display: flex;
- padding-top: 3px;
- .price {
- width: 60%;
- font-size: 14px;
- line-height: 22px;
- }
- .order-btn {
- width: 100%;
- .btn {
- background: #FFE05C;
- text-align: center;
- border-radius: 14px;
- height: 26px;
- line-height: 26px;
- color: #333;
- font-size: 12px;
- }
- }
- }
- }
- }
- }
- }
- }
- /* 底部 */
- .footer {
- margin-top: 30px;
- height: 60px;
- font-size: 12px;
- text-align: center;
- color: #666;
- margin-bottom: 40px;
- background-color: #FFE05C;
- }
- .tabBarView {
- position: fixed;
- bottom: 0;
- }
- </style>
|