index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459
  1. <template>
  2. <view class="content-wrap bg-color">
  3. <view class="head-wrap">
  4. <view class="content-info ">
  5. <view class="h-bg">
  6. <!-- 轮播图 -->
  7. <u-swiper :circular="true" :list="bannerList" :height="340"></u-swiper>
  8. </view>
  9. <view class="content">
  10. <!-- 通知栏 -->
  11. <view v-if="noticeList.length > 0" class="h-notice-bar">
  12. <scroll-notice :dataList="noticeList" :type="2" :interval="3000" :height="46" :fontSize="12"
  13. color="#666666" @click="handleNoticeClick"></scroll-notice>
  14. </view>
  15. <!-- 个人信息、钱包、商店 -->
  16. <view class="h-content-wrap">
  17. <!-- 欢迎语 -->
  18. <view class="welcome-wrap">
  19. <view class="logo">
  20. <image :src="userInfo.selfPhotoUrl || '/static/me/ud4.png'" mode=""></image>
  21. </view>
  22. <view class="text">
  23. <view class="phone">{{ userInfo.ncikName || '' }}</view>
  24. <!-- <view class="welcome">尊敬的{{ userInfo.ncikName || ''}},下午好~</view>-->
  25. </view>
  26. <view v-if="isShowCoupon" @click="goQrCode" class="arrow-right">
  27. <!-- <image v-if="userInfo.wxQrCode" class="qrcode" :src="userInfo.qrcode" mode=""></image> -->
  28. <!-- <image class="qrcode" src="../../static/index/qrcode.png" mode=""></image>
  29. <view class="h-text">会员码</view> -->
  30. <view class="coupon-wrap">
  31. <!-- <u-icon name="/static/me/u5.png" color="#ffb83d" size="22"></u-icon>-->
  32. <text>邀约有礼</text>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 余额信息 -->
  37. <!-- <view class="balance-info">-->
  38. <!-- <view @click="gotoRechargeService()" class="balance-amount">-->
  39. <!-- <text class="number" v-if="userInfo.balance">¥{{ userInfo.balance }}</text>-->
  40. <!-- <text class="number" v-else>¥0.00</text>-->
  41. <!-- <view class="">余额</view>-->
  42. <!-- </view>-->
  43. <!-- <view class="score-info">-->
  44. <!-- <text class="number" v-if="userInfo.integral">{{ userInfo.integral }}</text>-->
  45. <!-- <text class="number" v-else>0</text>-->
  46. <!-- <view class="">积分</view>-->
  47. <!-- </view>-->
  48. <!-- <view @click="gotoCoupon()" class="coupon-info">-->
  49. <!-- <text class="number" v-if="userInfo.coupon">{{ userInfo.coupon }}</text>-->
  50. <!-- <text class="number" v-else>0</text>-->
  51. <!-- <view class="">优惠券</view>-->
  52. <!-- </view>-->
  53. <!-- <view class="e-currency-info">-->
  54. <!-- <text class="number" v-if="userInfo.electronicCurrency">{{ userInfo.electronicCurrency }}</text>-->
  55. <!-- <text class="number" v-else>0</text>-->
  56. <!-- <view class="">电子币</view>-->
  57. <!-- </view>-->
  58. <!-- </view>-->
  59. <view class="custom-line"></view>
  60. <view class="store-wrap">
  61. <view class="store-info">
  62. <view class="logo">
  63. <image src="../../static/index/u55.png" mode=""></image>
  64. </view>
  65. <view @click="gotoStoreChoose()" class="store-content">
  66. <view class="h-row">
  67. <view class="store-desc">
  68. <view class="store-name">
  69. <view class="">{{ storeInfo.storeName }}</view>
  70. </view>
  71. </view>
  72. <view class="arrow-right">
  73. <view class="change-store">更换门店</view>
  74. <u-icon name="arrow-right" color="#333" size="16"></u-icon>
  75. </view>
  76. </view>
  77. <view class="h-row">
  78. <text class="address">地址:{{ storeInfo.address }}</text>
  79. <text class="address1">{{ storeInfo.distanceDesc }}</text>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 上次订单 -->
  86. <view class="nav-wrap ">
  87. <view class="upper-order-wrap">
  88. <!-- 左边内容 -->
  89. <view @click="gotoServiceOrder()" class="left-content">
  90. <view class="title">
  91. 当日排队
  92. </view>
  93. <view class="desc">
  94. <!-- 多种服务模式任您选择-->
  95. </view>
  96. <view class="bg-img">
  97. <image src="../../static/index/2.png" mode=""></image>
  98. </view>
  99. </view>
  100. <!-- 右边内容 -->
  101. <view class="right-content" @click="goBookService()">
  102. <view class="title">
  103. 明日预约
  104. </view>
  105. <view class="desc">
  106. <!-- 拼命研发中敬请期待...-->
  107. </view>
  108. <view class="bg-img">
  109. <image src="../../static/index/1.png" mode=""></image>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- 导航菜单 -->
  114. <view class="horizontal-dashed-line"></view>
  115. <view class="menu-tab">
  116. <!-- <view class="button-wrap">-->
  117. <!-- <view @click="gotoComeOrder()" class="btn">-->
  118. <!-- <view class="icon">-->
  119. <!-- <u-icon name="/static/index/u213.png" color="red" size="30"></u-icon>-->
  120. <!-- </view>-->
  121. <!-- <view class="name">-->
  122. <!-- 再来一单-->
  123. <!-- </view>-->
  124. <!-- </view>-->
  125. <!-- </view>-->
  126. <view class="button-wrap">
  127. <view @click="gotoRechargeService()" class="btn">
  128. <view class="icon">
  129. <u-icon name="/static/index/u215.png" color="red" size="30"></u-icon>
  130. </view>
  131. <view class="name">
  132. 储值服务
  133. </view>
  134. </view>
  135. </view>
  136. <!-- <view class="button-wrap">-->
  137. <!-- <view @click="gotoOrder()" class="btn">-->
  138. <!-- <view class="icon">-->
  139. <!-- <u-icon name="/static/index/u217.png" color="red" size="30"></u-icon>-->
  140. <!-- </view>-->
  141. <!-- <view class="name">-->
  142. <!-- 当前订单-->
  143. <!-- </view>-->
  144. <!-- </view>-->
  145. <!-- </view>-->
  146. <view class="button-wrap">
  147. <view @click="gotoReceiveCoupons()" class="btn">
  148. <view class="icon">
  149. <u-icon name="/static/index/u247.png" color="red" size="30"></u-icon>
  150. </view>
  151. <view class="name">
  152. 领券中心
  153. </view>
  154. </view>
  155. </view>
  156. <view class="button-wrap">
  157. <view @click="goRights()" class="btn">
  158. <view class="icon">
  159. <u-icon name="/static/index/equity_card.png" color="red" size="30"></u-icon>
  160. </view>
  161. <view class="name">
  162. 权益卡
  163. </view>
  164. </view>
  165. </view>
  166. <view class="button-wrap">
  167. <view @click="goActivity()" class="btn">
  168. <view class="icon">
  169. <u-icon name="/static/index/huodong.png" color="red" size="30"></u-icon>
  170. </view>
  171. <view class="name">
  172. 活动中心
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. <!-- 为你推荐 -->
  179. <!-- <view class="recommend-wrap">-->
  180. <!-- <view class="recommend-nav">-->
  181. <!-- <view class="icon">-->
  182. <!-- <image src="/static/index/u87.png" mode=""></image>-->
  183. <!-- </view>-->
  184. <!-- <view class="title">-->
  185. <!-- 为你推荐-->
  186. <!-- </view>-->
  187. <!-- </view>-->
  188. <!-- &lt;!&ndash; 分割线 &ndash;&gt;-->
  189. <!-- <view class="custom-line"></view>-->
  190. <!-- &lt;!&ndash; 门店列表 &ndash;&gt;-->
  191. <!-- <view class="store-wrap ">-->
  192. <!-- <view class="store-list">-->
  193. <!-- <view class="store-content">-->
  194. <!-- <view class="store-img">-->
  195. <!-- <image src="../../static/logo.png" mode=""></image>-->
  196. <!-- </view>-->
  197. <!-- <view class="h-store-content">-->
  198. <!-- <view class="title">-->
  199. <!-- <text>{{ storeInfo.storeName }}</text>-->
  200. <!-- </view>-->
  201. <!-- <view class="adress">-->
  202. <!-- 地址:{{ storeInfo.address }}-->
  203. <!-- </view>-->
  204. <!-- <view class="desc">-->
  205. <!-- <view class="price">-->
  206. <!-- </view>-->
  207. <!-- <view @click="gotoGoods()" class="order-btn">-->
  208. <!-- <view class="btn">去下单</view>-->
  209. <!-- </view>-->
  210. <!-- </view>-->
  211. <!-- </view>-->
  212. <!-- </view>-->
  213. <!-- </view>-->
  214. <!-- </view>-->
  215. <!-- </view>-->
  216. <!-- <view class="footer ">-->
  217. <!-- <view class="">-&#45;&#45;到底了-&#45;&#45;</view>-->
  218. <!-- </view>-->
  219. </view>
  220. </view>
  221. </view>
  222. <!-- <view class="tabBarView">-->
  223. <!-- <tab-bar :tabIndex="tabIndex"></tab-bar>-->
  224. <!-- </view>-->
  225. <uni-popup :mask-click="false" ref="strategyListPoup">
  226. <view class="flex-col justify-start expirePopup" style="position: relative;">
  227. <view class="flex-row justify-between" style="position: absolute;top: 20rpx;right: 20rpx"
  228. @click="closeStrategyListPoup">
  229. <u-icon size="20" name="close-circle-fill"></u-icon>
  230. </view>
  231. <view class="flex-row justify-center">
  232. <text class="popupTitle">新人专享</text>
  233. </view>
  234. <scroll-view scroll-y class="flex-col justify-start scroll-y1">
  235. <view class="flex-col">
  236. <u--form
  237. labelPosition="left"
  238. :model="phoneParam"
  239. :rules="rules"
  240. ref="form1"
  241. >
  242. <u-form-item
  243. label="手机号"
  244. prop="phonenumber"
  245. labelWidth="auto"
  246. labelAlign="right"
  247. >
  248. <u--input
  249. v-model="phoneParam.phonenumber"
  250. placeholder="请输入手机号"
  251. border="bottom"
  252. type="number"
  253. maxlength="11"
  254. ></u--input>
  255. </u-form-item>
  256. <u-form-item
  257. labelWidth="auto"
  258. labelAlign="right"
  259. label="验证码"
  260. prop="smsCode"
  261. width="120"
  262. >
  263. <u--input
  264. v-model="phoneParam.smsCode"
  265. disabledColor="#ffffff"
  266. placeholder="请输入验证码"
  267. border="bottom"
  268. maxlength="4"
  269. ></u--input>
  270. <template #right>
  271. <view class="identifying-code">
  272. <u-code
  273. ref="uCode3"
  274. @change="codeChange2"
  275. keep-running
  276. start-text="获取验证码"
  277. ></u-code>
  278. <text
  279. @tap="getCode2"
  280. :text="tips2"
  281. class="u-page__code-text"
  282. >{{ tips2 }}
  283. </text>
  284. </view>
  285. </template>
  286. </u-form-item>
  287. </u--form>
  288. <view class="flex-col justify-start">
  289. <text style="font-size: 28rpx;color: #333333;text-align: center">{{ rule.title }}</text>
  290. </view>
  291. <view class="flex-col " v-for="(item,index) in rule.strategyList" :key="index">
  292. <view class="flex-row justify-start quan " :class="[item.select == 1 ? 'row-list' : 'listBackground']"
  293. @click="selectQuan(item,index)">
  294. <view class=" h-text flex-col justify-center ">
  295. <view class="money">
  296. <text class="money" v-if="item.discountsType == 2">{{ item.discount }}折</text>
  297. <text class="money" v-else>{{ `减` + item.discountsPrice }}</text>
  298. </view>
  299. <view class="desc">
  300. <text>满{{ item.reachPrice }}可用</text>
  301. </view>
  302. </view>
  303. <view class=" h-center-content flex-col justify-around">
  304. <view class="h-value">
  305. <text>{{ item.name }}</text>
  306. </view>
  307. <view>
  308. <view class="title">
  309. 可用次数:{{ item.degree }}
  310. </view>
  311. </view>
  312. <view class="title flex-row">
  313. <text @click="showRemark(item)">使用说明</text>
  314. <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>
  315. <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>
  316. </view>
  317. </view>
  318. </view>
  319. <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
  320. <view class="remarkText">
  321. <view>
  322. 可用门店:
  323. <text>{{ item.useStoreDesc }}</text>
  324. </view>
  325. <view>
  326. 适用项目:
  327. <text>{{ item.useServiceDesc }}</text>
  328. </view>
  329. <view v-if="item.remark !=null">
  330. 使用说明:
  331. <text>{{ item.remark }}</text>
  332. </view>
  333. <text v-else class="remarkText">该优惠券暂无使用说明</text>
  334. </view>
  335. </view>
  336. </view>
  337. </view>
  338. </scroll-view>
  339. <view @click="userBindMember" class="op-btn-wrap">
  340. <view class="h-btn">
  341. <text v-if="rule.isAllReceived == 1">全部领取</text>
  342. <text v-else>确定 (可选{{ rule.receivedCount }}张优惠券)</text>
  343. </view>
  344. </view>
  345. </view>
  346. </uni-popup>
  347. </view>
  348. </template>
  349. <script>
  350. import tabBar from "../../components/tabBar/tabBar";
  351. import ScrollNotice from '../../components/scroll-notice/ScrollNotice.vue';
  352. export default {
  353. components: {
  354. ScrollNotice,
  355. tabBar
  356. },
  357. data() {
  358. return {
  359. isShowCoupon: false,
  360. isGetAddress: true, //是否获取到了经纬度
  361. noticeList: [],
  362. notice: '',
  363. userInfo: {},
  364. bannerList: [],
  365. reqParm: {
  366. auth: true,
  367. appid: 46,
  368. telphone: '',
  369. latitude: 26.5737,
  370. longitude: 106.7135,
  371. },
  372. storeList: [],
  373. storeInfo: {},
  374. showRemarkId: '',
  375. rule: [],
  376. tips2: '',
  377. phoneParam: {
  378. phonenumber: '',
  379. smsCode: '',
  380. },
  381. rules: {
  382. phonenumber: [
  383. {
  384. required: true,
  385. min: 11,
  386. max: 11,
  387. message: '请输入11位电话号码',
  388. trigger: ['blur', 'change'],
  389. },
  390. {
  391. // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
  392. validator: (rule, value, callback) => {
  393. // 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
  394. return !this.$isDataEmpty(value);
  395. },
  396. message: "请认真填写电话号码",
  397. trigger: ['blur', 'change'],
  398. }
  399. ],
  400. smsCode: {
  401. required: true,
  402. min: 4,
  403. max: 6,
  404. message: '请输入4位验证码',
  405. trigger: ['blur', 'change'],
  406. },
  407. },
  408. myActivityList: [],
  409. };
  410. },
  411. onShow() {
  412. // this.getRuleById()
  413. this.myActivity()
  414. this.updateApp()
  415. this.userInfo = uni.getStorageSync('userInfo');
  416. if (this.userInfo.selfPhoto) {
  417. this.getImgUrlByOssId(this.userInfo.selfPhoto);
  418. }
  419. // 查询门店信息
  420. const data = uni.getStorageSync('storeInfo');
  421. if (!data) {
  422. setTimeout(e => {
  423. console.log('定时器要执行了 isGetAddress =>', this.isGetAddress)
  424. if (this.isGetAddress) {
  425. console.log('定时器执行了isGetAddress =>', this.isGetAddress)
  426. this.isGetAddress = !this.isGetAddress
  427. this.getStoreListData(this.reqParm)
  428. }
  429. }, 3000)
  430. // 获取位置信息查询门店列表数据
  431. this.getLocation();
  432. } else {
  433. this.storeInfo = data;
  434. }
  435. },
  436. onLoad(e) {
  437. //程序启动时自动登录成功时触发的事件
  438. uni.$off('loginSuccess')
  439. uni.$on('loginSuccess', this.getRuleById)
  440. console.log(e)
  441. if (e.shareUserId) {
  442. //用户点击分享到好友或者朋友圈传递过来的参数
  443. uni.setStorageSync('shareUserId', e.shareUserId)
  444. }
  445. if (e.q) {
  446. //用户扫技师端或者拓客端二维码传递过来的参数
  447. const q = decodeURIComponent(e.q)
  448. let a = q.split('?')
  449. let b = a[1].split('&')
  450. let param = {} //技师端分享过来的参数
  451. for (let i = 0; i < b.length; i++) {
  452. param[b[i].split('=')[0]] = b[i].split('=')[1]
  453. }
  454. if (param.expandUserId) { //从拓客端进来的用户
  455. console.log('扫拓客端二维码进入小程序')
  456. uni.setStorageSync('expandParam', param)
  457. } else if (param.scene) {
  458. console.log('扫用户的会员码进入小程序')
  459. uni.setStorageSync('shareUserId', param.scene)
  460. } else if (param.techNo) { //从技师端进来的用户
  461. console.log('扫技师二维码进入小程序')
  462. uni.setStorageSync('promotionParam', param)
  463. uni.removeStorageSync('storeParam');
  464. this.operLog()
  465. } else {
  466. //用户扫门店的二维码进入小程序
  467. uni.setStorageSync('storeParam', param)
  468. uni.removeStorageSync('promotionParam');
  469. }
  470. console.log("用户扫技师端或者拓客端二维码传递过来的参数", param)
  471. }
  472. //公告信息
  473. this.getNoticeListData();
  474. // 获取banner图列表
  475. this.getSlideshowList();
  476. // 用户信息
  477. setTimeout(() => {
  478. this.userInfo = uni.getStorageSync('userInfo');
  479. if (this.userInfo.selfPhoto) {
  480. this.getImgUrlByOssId(this.userInfo.selfPhoto);
  481. }
  482. }, 2000)
  483. },
  484. //分享到朋友圈
  485. onShareTimeline(option) {
  486. return {
  487. title: '娇骄儿造型',
  488. imageUrl: '/static/logo.png',
  489. query: `shareUserId='${this.userInfo.id}`,
  490. success(res) {
  491. uni.showToast({
  492. title: '分享成功'
  493. })
  494. },
  495. fail(res) {
  496. uni.showToast({
  497. title: '分享失败',
  498. icon: 'none'
  499. })
  500. }
  501. };
  502. },
  503. //分享到好友
  504. onShareAppMessage: function (res) {
  505. return {
  506. title: '娇骄儿造型',
  507. imageUrl: '/static/logo.png',
  508. path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
  509. success(res) {
  510. uni.showToast({
  511. title: '分享成功'
  512. })
  513. },
  514. fail(res) {
  515. uni.showToast({
  516. title: '分享失败',
  517. icon: 'none'
  518. })
  519. }
  520. };
  521. },
  522. methods: {
  523. myActivity() {
  524. // this.$api.myActivity({
  525. // pageNum: 1,
  526. // pageSize: 10,
  527. // }).then(res => {
  528. // this.myActivityList = res.data.rows
  529. //
  530. // })
  531. this.$api.myActivityIsShow().then(res =>{
  532. this.isShowCoupon = res.data.data
  533. })
  534. },
  535. closeStrategyListPoup() {
  536. this.$refs.strategyListPoup.close()
  537. //关闭弹窗
  538. console.log('拓客端推广用户绑定失败!')
  539. console.log('+++++++++++++++expandParam+++++++++++++++++++++++', expandParam)
  540. that.$api.addRecordForAttach({
  541. ...expandParam,
  542. isNew: 1,
  543. isBindSuccess: 0,
  544. }).then(res => {
  545. console.log('+++++++++新用户,扫码推广失败记录!++++++++++++++++')
  546. })
  547. uni.removeStorageSync('expandParam');
  548. },
  549. userBindMember() {
  550. let expandParam = uni.getStorageSync('expandParam')
  551. let that = this
  552. this.$refs.form1.validate().then(res => {
  553. let couponIds = []
  554. for (const strategy of this.rule.strategyList) {
  555. if (strategy.select == 1) {
  556. couponIds.push(strategy.id)
  557. }
  558. }
  559. if (couponIds.length !== this.rule.receivedCount) {
  560. uni.showToast({
  561. title: '请选择' + this.rule.receivedCount + '张优惠券',
  562. duration: 2000,
  563. icon: "error"
  564. });
  565. return
  566. }
  567. //用户扫码拓客端进入小程序
  568. that.$api.userBindMember(
  569. {
  570. ...expandParam,
  571. memberId: this.userInfo.id,
  572. memberPhone: this.phoneParam.phonenumber,
  573. smsCode: this.phoneParam.smsCode,
  574. couponIds: couponIds
  575. }
  576. ).then(res1 => {
  577. //关闭弹窗
  578. this.$refs.strategyListPoup.close()
  579. uni.showToast({
  580. title: '领取成功',
  581. duration: 2000,
  582. icon: "success"
  583. });
  584. setTimeout(() => {
  585. uni.navigateTo({
  586. url: "/orderPages/myCoupon/index"
  587. })
  588. }, 2000)
  589. console.log('拓客端推广用户绑定成功!')
  590. console.log('+++++++++++++++expandParam+++++++++++++++++++++++', expandParam)
  591. that.$api.addRecordForAttach({
  592. ...expandParam,
  593. isNew: 1,
  594. isBindSuccess: 1,
  595. }).then(res => {
  596. console.log('+++++++++新用户,扫码推广成功记录!++++++++++++++++')
  597. })
  598. uni.removeStorageSync('expandParam');
  599. })
  600. }).catch(errors => {
  601. console.log(errors)
  602. uni.$u.toast('校验失败,请认真填写')
  603. })
  604. },
  605. codeChange2(text) {
  606. this.tips2 = text;
  607. },
  608. getCode2() {
  609. let that = this;
  610. if (this.$refs.uCode3.canGetCode) {
  611. that.getPhoneCode();
  612. } else {
  613. uni.$u.toast('倒计时结束后再发送');
  614. }
  615. },
  616. // 获取验证码
  617. getPhoneCode() {
  618. let that = this;
  619. // 模拟向后端请求验证码
  620. uni.showLoading({
  621. title: '正在获取验证码'
  622. })
  623. this.$api.getSmsCodeByType({phonenumber: this.phoneParam.phonenumber, auth: true, type: 0}).then((res) => {
  624. uni.hideLoading();
  625. // 这里此提示会被this.start()方法中的提示覆盖
  626. uni.$u.toast('验证码已发送');
  627. // 通知验证码组件内部开始倒计时
  628. that.$refs.uCode3.start();
  629. })
  630. },
  631. showRemark(item) {
  632. if (this.showRemarkId == item.id) {
  633. this.showRemarkId = ''
  634. } else {
  635. this.showRemarkId = item.id
  636. }
  637. },
  638. getRuleById() {
  639. let expandParam = uni.getStorageSync('expandParam')
  640. this.$api.getRuleById({
  641. id: expandParam.ruleId
  642. }).then(res => {
  643. this.rule = res.data.data
  644. if (this.rule.strategyList.length > 0) {
  645. for (const strategy of this.rule.strategyList) {
  646. if (this.rule.isAllReceived == 1) {
  647. strategy.select = 1
  648. } else {
  649. strategy.select = 0
  650. }
  651. }
  652. this.$refs.strategyListPoup.open()
  653. }
  654. })
  655. },
  656. selectQuan(item, index) {
  657. if (this.rule.isAllReceived == 1) {
  658. return
  659. }
  660. console.log(item)
  661. item.select = item.select ? 0 : 1
  662. this.$set(this.rule.strategyList, index, item)
  663. },
  664. operLog() {
  665. let param = uni.getStorageSync('promotionParam')
  666. let userInfo = uni.getStorageSync('userInfo')
  667. // #ifdef MP-WEIXIN
  668. const accountInfo = wx.getAccountInfoSync();
  669. console.log(accountInfo.miniProgram.version, '小程序版本号')
  670. // #endif
  671. const data = {
  672. title: "小程序扫码记录",
  673. operParam: param.techNo,
  674. operName: userInfo.no,
  675. deptName: param.storeId,
  676. errorMsg: accountInfo.miniProgram.version
  677. }
  678. console.log(data)
  679. this.$api.scanLogs(data).then(res => {
  680. console.log('------日志发送成功---------')
  681. }).catch(errors => {
  682. console.log(errors, '------日志发送失败---------')
  683. })
  684. },
  685. goQrCode() {
  686. uni.navigateTo({
  687. // url: '/pages/qrCode/index'
  688. url: '/myPages/myActivity/myActivity'
  689. })
  690. },
  691. goActivity() {
  692. uni.navigateTo({
  693. url: '/orderPages/activityList/activityList'
  694. })
  695. },
  696. goRights() {
  697. uni.navigateTo({
  698. url: '/storePages/rights/index'
  699. })
  700. },
  701. // 去服务点单页面
  702. gotoServiceOrder() {
  703. uni.navigateTo({
  704. url: '/orderPages/storeService/index'
  705. })
  706. },
  707. goBookService() {
  708. uni.navigateTo({
  709. url: '/orderPages/bookService/index'
  710. })
  711. },
  712. //点击通知
  713. handleNoticeClick(e) {
  714. console.log(e)
  715. uni.navigateTo({
  716. url: '/storePages/notice/index?noticeId=' + e.noticeId,
  717. })
  718. },
  719. // 去优惠劵大厅
  720. gotoReceiveCoupons() {
  721. uni.navigateTo({
  722. url: '/orderPages/receiveCoupons/index'
  723. })
  724. },
  725. // 去我的优惠劵页面
  726. gotoCoupon() {
  727. uni.navigateTo({
  728. url: '/orderPages/myCoupon/index'
  729. })
  730. },
  731. // 储值服务
  732. gotoRechargeService() {
  733. uni.navigateTo({
  734. url: '/myPages/recharge/index?name=lisa',
  735. })
  736. },
  737. // 获取banner图片
  738. getSlideshowList() {
  739. let that = this;
  740. this.$api.getSlideshowList({
  741. data: this.reqParm
  742. }).then((res) => {
  743. this.getImgUrlByBannerOssId(res.data.data);
  744. })
  745. },
  746. async getImgUrlByBannerOssId(items) {
  747. for (let i = 0; i < items.length; i++) {
  748. if (items[i].slideshowId) {
  749. this.$api.getImage(items[i].slideshowId).then(res => {
  750. this.bannerList.push(res.data.data[0].url.replace(/^http:/, "https:"))
  751. })
  752. }
  753. }
  754. },
  755. // 获取门店列表数据
  756. getStoreListData(data) {
  757. let that = this;
  758. // 用户绑定门店
  759. this.$api.storeList(data).then((res) => {
  760. console.log(res.data.data[0])
  761. that.storeInfo = res.data.data[0]
  762. // 更新用户选择的门店信息
  763. uni.setStorageSync('storeInfo', res.data.data[0])
  764. })
  765. },
  766. getNoticeListData() {
  767. let req = {
  768. auth: true,
  769. noticeType: 2,
  770. status: 0
  771. }
  772. this.$api.noticeList(req).then((res) => {
  773. if (res.data.rows.length === 1) {
  774. this.noticeList.push(res.data.rows[0])
  775. this.noticeList.push(res.data.rows[0])
  776. } else {
  777. this.noticeList = res.data.rows;
  778. }
  779. })
  780. },
  781. getImgUrlByOssId(ossId) {
  782. if (ossId) {
  783. this.$api.getImage(ossId).then(res => {
  784. this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  785. this.$set(this.userInfo)
  786. })
  787. }
  788. },
  789. // 获取经纬度信息f
  790. getLocation() {
  791. let that = this
  792. console.log('+++++++++++++开始获取位置信息++++++++++++++++')
  793. uni.getLocation({
  794. type: 'gcj02',
  795. success: function (res) {
  796. console.log(res)
  797. let latitude = res.latitude; // 纬度
  798. let longitude = res.longitude; // 经度
  799. let speed = res.speed; // 速度
  800. let accuracy = res.accuracy; // 精确度
  801. // 在这里可以对位置信息进行处理
  802. console.log("纬度:" + latitude + ";经度" + longitude)
  803. that.reqParm.latitude = latitude
  804. that.reqParm.longitude = longitude
  805. uni.setStorageSync('location', that.reqParm)
  806. },
  807. fail: function (fail) {
  808. console.log('获取用户地址失败==》', fail)
  809. },
  810. complete: function (complete) {
  811. console.log('获取用户地址失败or成功==》', complete)
  812. if (that.isGetAddress) {
  813. console.log("根据位置获取门店执行了 isGetAddress =>", that.isGetAddress)
  814. that.isGetAddress = !that.isGetAddress
  815. that.getStoreListData(that.reqParm)
  816. }
  817. }
  818. });
  819. },
  820. // 去选择门店
  821. gotoStoreChoose() {
  822. uni.navigateTo({
  823. url: '/storePages/store/store-choose?type=1',
  824. })
  825. },
  826. // 去再来一单
  827. gotoComeOrder() {
  828. uni.$u.route({
  829. url: '/pages/index/tabbar',
  830. params: {
  831. PageCur: 'orderList',
  832. status: '4'
  833. }
  834. })
  835. },
  836. // 去订单页面
  837. gotoOrder() {
  838. uni.setStorageSync('orderListIndex', 1)
  839. uni.switchTab({
  840. url: '/pages/order/index',
  841. })
  842. },
  843. // 去商品下单页面
  844. gotoGoods() {
  845. uni.navigateTo({
  846. url: '/orderPages/bookService/index',
  847. })
  848. },
  849. // 用户绑定门店
  850. userBindStore() {
  851. let that = this;
  852. // 用户绑定门店
  853. this.$api.userBindStore(this.reqParm).then((res) => {
  854. console.log(this.reqParm)
  855. })
  856. },
  857. updateApp() {
  858. const updateManager = uni.getUpdateManager();
  859. updateManager.onCheckForUpdate(function (res) {
  860. // 请求完新版本信息的回调
  861. console.log('++++++++++onCheckForUpdate++++++++++', res.hasUpdate);
  862. if (res.hasUpdate) {
  863. updateManager.onUpdateReady(function (res) {
  864. console.log('+++++++++onUpdateReady+++++++++++++', res)
  865. uni.showModal({
  866. title: '更新提示',
  867. content: '新版本已经准备好,是否重启应用?',
  868. showCancel: false,
  869. success(res) {
  870. if (res.confirm) {
  871. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  872. updateManager.applyUpdate();
  873. }
  874. }
  875. });
  876. });
  877. updateManager.onUpdateFailed(function (res) {
  878. // 新的版本下载失败
  879. console.log('+++++++++onUpdateFailed+++++++++++++', res)
  880. uni.showModal({
  881. title: '更新提示',
  882. content: '检测到小程序更新,但是下载失败,请检查网络',
  883. showCancel: false
  884. });
  885. });
  886. }
  887. });
  888. },
  889. }
  890. };
  891. </script>
  892. <style scoped lang="scss">
  893. @import "index.rpx.css";
  894. /* 头部内容 */
  895. .head-wrap {
  896. height: 100vh;
  897. background: #FFE05C;
  898. overflow: auto;
  899. .content-info {
  900. position: relative;
  901. .h-bg {
  902. height: 680rpx;
  903. }
  904. .content {
  905. position: absolute;
  906. top: 460rpx;
  907. left: 24rpx;
  908. right: 24rpx;
  909. border-radius: 12rpx;
  910. padding-bottom: 40rpx;
  911. .h-notice-bar {
  912. padding-left: 20rpx;
  913. background: #FFFFFF;
  914. box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(237, 86, 159, 0.05);
  915. border-radius: 20rpx;
  916. }
  917. .noticeCard {
  918. margin-top: 10rpx;
  919. padding: 10rpx;
  920. background: #FFFFFF;
  921. box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(237, 86, 159, 0.05);
  922. border-radius: 10px;
  923. }
  924. .h-content-wrap {
  925. background: #fff;
  926. border-radius: 10px;
  927. /* 欢迎语 */
  928. .welcome-wrap {
  929. padding-top: 12px;
  930. display: flex;
  931. margin-left: 12px;
  932. margin-right: 12px;
  933. margin-top: 16px;
  934. align-items: center;
  935. .logo {
  936. width: 13%;
  937. image {
  938. border-radius: 18px;
  939. width: 36px;
  940. height: 36px;
  941. }
  942. }
  943. .text {
  944. width: 60%;
  945. font-size: 14px;
  946. .welcome-wrap {
  947. font-size: 12px;
  948. color: #999999;
  949. }
  950. .welcome {
  951. font-size: 12px;
  952. color: #999999;
  953. }
  954. }
  955. .arrow-right {
  956. width: 30%;
  957. text-align: center;
  958. cursor: pointer;
  959. display: flex;
  960. justify-content: center;
  961. background: #fff8db;
  962. // background: red;
  963. height: 32px;
  964. align-items: center;
  965. border-radius: 16px;
  966. .qrcode {
  967. height: 20px;
  968. width: 20px;
  969. }
  970. .h-text {
  971. font-size: 12px;
  972. color: #999999;
  973. }
  974. .coupon-wrap {
  975. display: flex;
  976. font-size: 14px;
  977. align-items: center;
  978. }
  979. }
  980. }
  981. /* 钱包信息 */
  982. .balance-info {
  983. font-size: 12px;
  984. padding-left: 12px;
  985. margin-bottom: 16px;
  986. margin-top: 12px;
  987. color: #666;
  988. display: flex;
  989. justify-content: space-around;
  990. text-align: center;
  991. .balance-amount {
  992. padding-right: 4px;
  993. }
  994. .score-info {
  995. padding-right: 4px;
  996. }
  997. .coupon-info {
  998. padding-right: 4px;
  999. }
  1000. .e-currency-info {
  1001. padding-right: 4px;
  1002. }
  1003. .number {
  1004. color: #333333;
  1005. font-size: 14px;
  1006. }
  1007. }
  1008. /* 商店信息 */
  1009. .store-wrap {
  1010. margin: 10px;
  1011. .store-info {
  1012. display: flex;
  1013. .logo {
  1014. width: 10%;
  1015. text-align: center;
  1016. display: flex;
  1017. justify-content: center;
  1018. align-items: center;
  1019. image {
  1020. width: 30px;
  1021. height: 30px;
  1022. }
  1023. }
  1024. .store-content {
  1025. width: 90%;
  1026. padding-bottom: 13px;
  1027. .h-row {
  1028. display: flex;
  1029. align-items: center;
  1030. justify-content: space-between;
  1031. .store-desc {
  1032. width: 90%;
  1033. display: flex;
  1034. line-height: 30px;
  1035. font-size: 14px;
  1036. .store-name {
  1037. }
  1038. }
  1039. .arrow-right {
  1040. text-align: right;
  1041. margin: 0 auto;
  1042. cursor: pointer;
  1043. padding-top: 3px;
  1044. width: 100px;
  1045. display: flex;
  1046. font-size: 14px;
  1047. .change-store {
  1048. text-align: right;
  1049. color: #666;
  1050. }
  1051. image {
  1052. width: 18px;
  1053. height: 18px;
  1054. }
  1055. }
  1056. .address {
  1057. width: 400rpx;
  1058. color: #999999;
  1059. font-size: 12px;
  1060. padding-right: 12px;
  1061. }
  1062. .address1 {
  1063. color: #999999;
  1064. font-size: 12px;
  1065. padding-right: 12px;
  1066. }
  1067. }
  1068. }
  1069. }
  1070. .adress {
  1071. font-size: 22rpx;
  1072. white-space: nowrap;
  1073. overflow: hidden;
  1074. text-overflow: ellipsis;
  1075. padding-left: 80rpx;
  1076. color: #666;
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. }
  1083. /* 上次订单 */
  1084. .nav-wrap {
  1085. background: #fff;
  1086. border-radius: 8px;
  1087. margin-top: 16px;
  1088. .upper-order-wrap {
  1089. display: flex;
  1090. border-radius: 6px;
  1091. justify-content: center;
  1092. .left-content {
  1093. margin-top: 20px;
  1094. width: 50%;
  1095. font-size: 12px;
  1096. text-align: center;
  1097. border-radius: 10px;
  1098. .title {
  1099. font-size: 18px;
  1100. text-align: center;
  1101. }
  1102. .desc {
  1103. padding-top: 6px;
  1104. color: #999999;
  1105. }
  1106. .bg-img {
  1107. text-align: center;
  1108. height: 100px;
  1109. display: flex;
  1110. justify-content: center;
  1111. align-items: center;
  1112. image {
  1113. width: 78px;
  1114. height: 78px;
  1115. }
  1116. }
  1117. }
  1118. .right-content {
  1119. margin-top: 20px;
  1120. width: 50%;
  1121. font-size: 12px;
  1122. text-align: center;
  1123. .title {
  1124. font-size: 18px;
  1125. text-align: center;
  1126. }
  1127. .desc {
  1128. padding-top: 6px;
  1129. color: #999999;
  1130. }
  1131. .bg-img {
  1132. height: 100px;
  1133. text-align: center;
  1134. display: flex;
  1135. justify-content: center;
  1136. align-items: center;
  1137. image {
  1138. width: 78px;
  1139. height: 78px;
  1140. }
  1141. }
  1142. }
  1143. }
  1144. .menu-tab {
  1145. display: flex;
  1146. justify-content: space-around; // 平均分布
  1147. justify-content: center;
  1148. padding-bottom: 8px;
  1149. .button-wrap {
  1150. flex: 1;
  1151. display: flex;
  1152. align-items: center;
  1153. justify-content: center;
  1154. margin-top: 16px;
  1155. margin-bottom: 18px;
  1156. .name {
  1157. padding-top: 3px;
  1158. font-size: 12px;
  1159. color: #666666;
  1160. }
  1161. .btn {
  1162. padding-left: 12px;
  1163. padding-right: 12px;
  1164. height: 36px;
  1165. border-radius: 18px;
  1166. .icon {
  1167. display: flex;
  1168. padding-right: 6px;
  1169. align-items: center;
  1170. justify-content: center;
  1171. image {
  1172. height: 14px;
  1173. width: 14px;
  1174. }
  1175. }
  1176. }
  1177. }
  1178. }
  1179. }
  1180. /* 为你推荐 */
  1181. .recommend-wrap {
  1182. margin-top: 16px;
  1183. background: #fff;
  1184. border-radius: 8px;
  1185. .recommend-nav {
  1186. display: flex;
  1187. margin-left: 12px;
  1188. padding-top: 8px;
  1189. padding-bottom: 4px;
  1190. align-items: center;
  1191. .icon {
  1192. padding-right: 4px;
  1193. image {
  1194. height: 26px;
  1195. width: 26px;
  1196. }
  1197. }
  1198. .title {
  1199. font-size: 16px;
  1200. }
  1201. }
  1202. /* 门店列表 */
  1203. .store-wrap {
  1204. margin: 12px;
  1205. height: 100px;
  1206. .store-list {
  1207. margin-top: 16px;
  1208. .store-content {
  1209. display: flex;
  1210. .store-img {
  1211. width: 30%;
  1212. image {
  1213. width: 100%;
  1214. height: 78px;
  1215. border-radius: 6px;
  1216. }
  1217. }
  1218. .h-store-content {
  1219. width: 70%;
  1220. padding-left: 8px;
  1221. padding-top: 4px;
  1222. .title {
  1223. font-size: 18px;
  1224. font-family: "黑体", sans-serif;
  1225. }
  1226. .adress {
  1227. font-size: 28rpx;
  1228. line-height: 36rpx;
  1229. -webkit-box-orient: vertical;
  1230. -webkit-line-clamp: 1;
  1231. white-space: nowrap;
  1232. overflow: hidden;
  1233. text-overflow: ellipsis;
  1234. color: #666;
  1235. }
  1236. .price {
  1237. color: #666;
  1238. width: 60%;
  1239. font-size: 14px;
  1240. line-height: 22px;
  1241. .red {
  1242. color: red;
  1243. font-size: 16px;
  1244. }
  1245. }
  1246. .desc {
  1247. display: flex;
  1248. padding-top: 3px;
  1249. .price {
  1250. width: 60%;
  1251. font-size: 14px;
  1252. line-height: 22px;
  1253. }
  1254. .order-btn {
  1255. width: 100%;
  1256. .btn {
  1257. background: #FFE05C;
  1258. text-align: center;
  1259. border-radius: 14px;
  1260. height: 26px;
  1261. line-height: 26px;
  1262. color: #333;
  1263. font-size: 12px;
  1264. }
  1265. }
  1266. }
  1267. }
  1268. }
  1269. }
  1270. }
  1271. }
  1272. /* 底部 */
  1273. .footer {
  1274. margin-top: 30px;
  1275. height: 60px;
  1276. font-size: 12px;
  1277. text-align: center;
  1278. color: #666;
  1279. margin-bottom: 40px;
  1280. background-color: #FFE05C;
  1281. }
  1282. .tabBarView {
  1283. position: fixed;
  1284. bottom: 0;
  1285. }
  1286. </style>