index.vue 40 KB

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