index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. <template>
  2. <view class="page">
  3. <view class="periodDate">
  4. <text>服务日期:{{orderParam.serviceDate}}</text>
  5. </view>
  6. <view class="store-wrap">
  7. <view class="store-info">
  8. <view class="logo">
  9. <image src="../../static/index/u55.png" mode=""></image>
  10. </view>
  11. <view @click="gotoStoreChoose()" class="store-content">
  12. <view class="h-row">
  13. <view class="store-desc">
  14. <view class="store-name">
  15. <view class="">{{ storeInfo.storeName }}</view>
  16. </view>
  17. </view>
  18. <view class="arrow-right">
  19. <view class="change-store">更换门店</view>
  20. <u-icon name="arrow-right" color="#333" size="16"></u-icon>
  21. </view>
  22. </view>
  23. <view class="h-row">
  24. <text class="address">地址:{{ storeInfo.address }}</text>
  25. <text class="address1">{{storeInfo.distanceDesc}}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="flex-col group">
  31. <view class="serob"><text>服务对象</text></view>
  32. <u-grid :border="false" col="4">
  33. <u-grid-item v-for="(item,index) in serviceObjectList" :key="index">
  34. <view class="serobItem flex-col">
  35. <view class="serobImgView" @click="selectServiceObject(item)">
  36. <image class="serobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/me/ud4.png'">
  37. </image>
  38. </view>
  39. <text class="serobName">{{item.nickName || '未填写'}}</text>
  40. <view class="serobV" v-if="item.select === true">
  41. <image class="serobVicon" src="/static/order/ud20.png"></image>
  42. </view>
  43. </view>
  44. </u-grid-item>
  45. </u-grid>
  46. </view>
  47. <view class="flex-col group" v-for="(item,index) in orderParam.childService">
  48. <view class="flex-row ">
  49. <image class="selectSerobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/me/ud4.png'"></image>
  50. <text class="selectSerobName">{{item.nickName || '未填写'}}</text>
  51. </view>
  52. <view class="serob" >
  53. <text>服务时段</text>
  54. </view>
  55. <view v-if="!item.serviceStartTime" class="noTime flex-row justify-center">
  56. <text>暂无可用的服务时段</text>
  57. </view>
  58. <view v-else>
  59. <u-grid :border="false" col="5">
  60. <u-grid-item v-if="item2.total > 0" v-for="(item2,index2) in item.periodTimeList" :key="index2">
  61. <view class="timeItemView">
  62. <view class="flex-col justify-center timeItem " :class="{selectBack: item2.select}" @click="selectServiceTime(item.periodTimeList,index,index2)">
  63. <view class="flex-row justify-center">
  64. <text class="time">{{item2.label}}</text>
  65. </view>
  66. <!-- <view class="flex-row justify-center">-->
  67. <!-- <text class="price">¥{{item2.price}}</text>-->
  68. <!-- </view>-->
  69. </view>
  70. </view>
  71. </u-grid-item>
  72. </u-grid>
  73. </view>
  74. </view>
  75. <view class="flex-col group ">
  76. <view class="groupItemKey">
  77. <text>取号规则</text>
  78. </view>
  79. <view v-for=" (item,index) in takeNumberRules " class="serobReminder">
  80. <text>{{index+1}}.{{item.dictValue}}。</text>
  81. </view>
  82. <!-- <view class="serobReminder">-->
  83. <!-- <text>1.你已进入不挑师傅不挑时段的单剪造型占位理发服务。</text>-->
  84. <!-- </view>-->
  85. <!-- <view class="serobReminder">-->
  86. <!-- <text>2.预约需要一人一号。</text>-->
  87. <!-- </view>-->
  88. <!-- <view class="serobReminder">-->
  89. <!-- <text>3.到门店先签到,过时没有签到占位时段失效。</text>-->
  90. <!-- </view>-->
  91. <!-- <view class="serobReminder">-->
  92. <!-- <text>4.服务费用到店享受相应服务以后在另行收取。</text>-->
  93. <!-- </view>-->
  94. </view>
  95. <view v-if="recommendActivity" class="flex-row justify-center" style="background: #ffffff;margin-top: 20rpx;padding: 10rpx 32rpx">
  96. <image style="width: 686rpx" :src="activityImg" mode="widthFix" @click="goDetail(recommendActivity)"></image>
  97. </view>
  98. <view class="tabBarLineHeight "></view>
  99. <view class="tabBarView">
  100. <!-- <view v-if="recommendActivity" class="btnTitle1 flex-row justify-between">-->
  101. <!-- <view>-->
  102. <!-- <text>推荐活动:{{recommendActivity.title}}</text>-->
  103. <!-- <text style="margin-left: 10rpx;color: #999999" >({{recommendActivity.description}})</text>-->
  104. <!-- </view>-->
  105. <!-- <view class="btnRight1" @click="goDetail(recommendActivity)">购买({{recommendActivity.salePrice}})</view>-->
  106. <!-- </view>-->
  107. <view class="submitButton " @click="openSetting">提交</view>
  108. </view>
  109. <uni-popup ref="sameDayQueuePopup">
  110. <uni-popup-dialog :type="msgType" cancelText="不再提示" confirmText="已知晓" title="提示" :content="configContent" @confirm="dialogConfirm"
  111. @close="dialogClose"></uni-popup-dialog>
  112. </uni-popup>
  113. <uni-popup ref="showExpireEquityCard">
  114. <view class="flex-col justify-start expirePopup" >
  115. <view class="flex-row justify-center">
  116. <text class="popupTitle">到期提醒</text>
  117. </view>
  118. <scroll-view scroll-y class="flex-col justify-start" :class="[ expireEquityCard.length > 1 ? 'scroll-y1':'scroll-y']" >
  119. <view class="flex-row listView" v-for="(item,index) in expireEquityCard">
  120. <view class="h-text flex-col justify-center ">
  121. <view class="money">
  122. <text>{{ item.faceValue }}</text>
  123. </view>
  124. </view>
  125. <view class="h-center-content flex-col justify-around">
  126. <view class="h-value">
  127. <text>{{ item.title }}</text>
  128. </view>
  129. <view class="title">
  130. 服务对象:{{ item.serviceObjectName || '' }}
  131. </view>
  132. <view class="title">
  133. 适用门店:{{ item.useStoreDesc || '' }}
  134. </view>
  135. <view class="title">
  136. 到期时间:{{ item.effectiveEndTime.slice(0,10) }}
  137. </view>
  138. </view>
  139. <view class="h-right-content flex-col justify-center ">
  140. <!-- <view class="btn" @click="navigateTo(item)">-->
  141. <!-- <text>续费</text>-->
  142. <!-- </view>-->
  143. <view class="btn" @click="upgrade(item)">
  144. <text>续费</text>
  145. </view>
  146. </view>
  147. </view>
  148. </scroll-view>
  149. <view class="expire-popup-footer">
  150. <view class="no-more-prompt" @click="noMoreExpirePrompt = !noMoreExpirePrompt">
  151. <view class="checkbox" :class="{ checked: noMoreExpirePrompt }">
  152. <text v-if="noMoreExpirePrompt" class="check-icon">✓</text>
  153. </view>
  154. <text class="no-more-text">不再提示</text>
  155. </view>
  156. <view class="close-btn" @click="closeExpirePopup">关闭</view>
  157. </view>
  158. </view>
  159. </uni-popup>
  160. <uni-popup ref="upgradePopup" type="center">
  161. <view class="upgradePopupView">
  162. <view class="upgradeTitle">请选择升级活动</view>
  163. <scroll-view class="upgradeScroll" scroll-y>
  164. <view class="upgradeItem" v-for="(act,idx) in upgradeActivityList" :key="idx" @click="selectUpgradeActivity(idx)">
  165. <view class="upgradeItemTitle">{{act.title}}</view>
  166. <view class="upgradeItemPrice">活动价格:<text class="upgradePrice">{{act.salePrice}}元</text></view>
  167. </view>
  168. </scroll-view>
  169. <view class="upgradeCloseBtn" @click="closeUpgradePopup">取消</view>
  170. </view>
  171. </uni-popup>
  172. </view>
  173. </template>
  174. <script>
  175. export default {
  176. components: {
  177. },
  178. data() {
  179. return {
  180. recommendActivity:null,
  181. msgType:null,
  182. configContent:'',
  183. timeoutId:null,
  184. templateId:[],
  185. periodTimeList:[],
  186. userInfo: {},
  187. store: {},
  188. serviceObjectList: [],
  189. requestStatus: false,
  190. upgradeActivityList:[],
  191. orderParam: {
  192. orderType: 1,
  193. serviceAttribute: 1,
  194. serviceStoreId: '',
  195. remark: '',
  196. serviceDate: '',
  197. childService: [
  198. // {
  199. // periodDate:'',//回显需要,不做参数
  200. // serviceObjectId: '',
  201. // facePhotoUrl:'', //回显需要,不做参数
  202. // nickName:'', //回显需要,不做参数
  203. // serviceUserId: '',
  204. // personName:'',//回显需要,不做参数
  205. // fee:'',//回显需要,不做参数
  206. // serviceStartTime: ''
  207. // }
  208. ]
  209. },
  210. takeNumberData:{
  211. pageNum:1,
  212. pageSize:10,
  213. dictType:'today_make_rule'
  214. },
  215. takeNumberRules:[],
  216. storeInfo: {},
  217. expireEquityCard:[], //过期的权益卡
  218. noMoreExpirePrompt: false, // 权益卡到期弹框不再提示
  219. activityImg:"",
  220. }
  221. },
  222. onLoad() {
  223. this.store = uni.getStorageSync('storeInfo')
  224. this.userInfo = uni.getStorageSync('userInfo')
  225. this.orderParam.serviceStoreId = this.store.storeId
  226. let date = new Date();
  227. this.orderParam.serviceDate = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' +
  228. date.getDate()).slice(-2)
  229. this.timeoutId = setTimeout(()=>{
  230. uni.showModal({
  231. title:'温馨提示',
  232. content:'您在下单页面停留太久,请重新进入!',
  233. showCancel:false,
  234. success:res=>{
  235. if (res.confirm){
  236. uni.switchTab({
  237. url: '/pages/index/index',
  238. })
  239. }
  240. }
  241. })
  242. },1000*60*5)
  243. this.getExpireEquityCard()
  244. this.getRecommendActivity();
  245. },
  246. onShow() {
  247. this.getActivityImg()
  248. //获取弹窗设置
  249. let sameDayQueueContent = uni.getStorageSync('same_day_queue_content');
  250. if (!sameDayQueueContent){
  251. this.getConfigKey('same_day_queue_content')
  252. }
  253. // 查询门店信息
  254. const data = uni.getStorageSync('storeInfo');
  255. this.store = uni.getStorageSync('storeInfo')
  256. this.userInfo = uni.getStorageSync('userInfo')
  257. if (!data) {
  258. // 获取位置信息查询门店列表数据
  259. this.getLocation();
  260. } else {
  261. this.storeInfo = data;
  262. }
  263. this.getServicePersonTime()
  264. this.getTemplateList()
  265. this.getSelectionRules(this.takeNumberData)
  266. this.orderParam.childService = []
  267. },
  268. onUnload(){
  269. clearTimeout(this.timeoutId);
  270. },
  271. methods: {
  272. getActivityImg(){
  273. this.$api.getSelectionRules({
  274. dictType:'recommended_images'
  275. }).then(res => {
  276. if (res.data.rows.length > 0){
  277. let url = this.$activityImgUrl
  278. this.activityImg = url + res.data.rows[0].dictValue
  279. console.log("++++++++++this.activityImg++++++++++",this.activityImg)
  280. }
  281. })
  282. },
  283. goDetail(e){
  284. uni.navigateTo({
  285. url:'/orderPages/activityDetail/activityDetail?id=' + e.id
  286. })
  287. },
  288. getRecommendActivity(){
  289. this.$api.getRecommendActivity().then(res=>{
  290. this.recommendActivity = res.data.data
  291. })
  292. },
  293. navigateTo(item){
  294. if(item.activityId){
  295. let list = item.activityId.split(',')
  296. if (list.length == 1){
  297. uni.navigateTo({
  298. url:'/orderPages/activityDetail/activityDetail?id=' + item.activityId +'&renewServiceObjectId=' + item.serviceObjectId
  299. })
  300. }else {
  301. uni.navigateTo({
  302. url:'/orderPages/activityList/activityList?renewServiceObjectId=' + item.serviceObjectId + '&equityCardId=' + item.equityCardId
  303. })
  304. }
  305. }else{
  306. uni.navigateTo({
  307. url:'/orderPages/activityList/activityList'
  308. })
  309. }
  310. },
  311. upgrade(item){
  312. console.log(item,'itemitem')
  313. if (!item.equityCardId){
  314. uni.showToast({
  315. title: '当前权益卡暂无可升级活动',
  316. icon: 'none'
  317. })
  318. return
  319. }
  320. uni.showLoading({title: '加载中'})
  321. this.$api.upgradeList(item.equityCardId).then(res=>{
  322. uni.hideLoading()
  323. const list = (res && res.data && (res.data.data || res.data.rows)) || []
  324. if (!list || list.length === 0){
  325. uni.showToast({
  326. title: '当前权益卡暂无可升级活动',
  327. icon: 'none'
  328. })
  329. return
  330. }
  331. this.currentUpgradeItem = item
  332. if (list.length === 1){
  333. this.goUpgradeDetail(list[0], item)
  334. }else {
  335. this.upgradeActivityList = list
  336. this.$refs.upgradePopup.open()
  337. }
  338. }).catch(()=>{
  339. uni.hideLoading()
  340. })
  341. },
  342. goUpgradeDetail(activity, item){
  343. console.log(activity, item,'activity, item')
  344. if (!activity || !activity.id){
  345. return
  346. }
  347. let url = '/orderPages/activityDetail/activityDetail?id=' + activity.id + '&upgradeEquityCardId=' + item.id
  348. if (item.serviceObjectId){
  349. url += '&renewServiceObjectId=' + item.serviceObjectId
  350. }
  351. uni.navigateTo({url})
  352. },
  353. getExpireEquityCard(){
  354. this.$api.getExpireEquityCard({
  355. serviceObjectId:0
  356. }).then((res)=>{
  357. let list = res.data.data || [];
  358. // 过滤掉用户已标记"不再提示"的卡片
  359. const dismissedIds = uni.getStorageSync('dismissed_expire_equity_cards') || []
  360. const validDismissedIds = []
  361. const newList = []
  362. for (const item of list) {
  363. if (dismissedIds.includes(item.equityCardId)) {
  364. validDismissedIds.push(item.equityCardId)
  365. } else {
  366. newList.push(item)
  367. }
  368. }
  369. // 清理已失效的 dismissed 记录
  370. uni.setStorageSync('dismissed_expire_equity_cards', validDismissedIds)
  371. this.expireEquityCard = newList
  372. if (this.expireEquityCard.length > 0){
  373. this.noMoreExpirePrompt = false
  374. this.$refs.showExpireEquityCard.open()
  375. }
  376. })
  377. },
  378. closeExpirePopup() {
  379. if (this.noMoreExpirePrompt) {
  380. const dismissedIds = uni.getStorageSync('dismissed_expire_equity_cards') || []
  381. for (const item of this.expireEquityCard) {
  382. if (item.equityCardId && !dismissedIds.includes(item.equityCardId)) {
  383. dismissedIds.push(item.equityCardId)
  384. }
  385. }
  386. uni.setStorageSync('dismissed_expire_equity_cards', dismissedIds)
  387. }
  388. this.$refs.showExpireEquityCard.close()
  389. },
  390. dialogConfirm(){
  391. this.configContent = '';
  392. },
  393. dialogClose(){
  394. uni.setStorageSync('same_day_queue_content',true);
  395. this.configContent = '';
  396. },
  397. getConfigKey(key){
  398. this.$api.getConfigKey({key:key}).then(res=>{
  399. console.log('获取到的配置信息',res.data.msg)
  400. if (res.data.msg){
  401. //打开弹窗
  402. this.configContent = res.data.msg
  403. this.$refs.sameDayQueuePopup.open()
  404. }
  405. })
  406. },
  407. // 获取门店列表数据
  408. getStoreListData(data) {
  409. let that = this;
  410. // 用户绑定门店
  411. this.$api.storeList(data).then((res) => {
  412. console.log(res.data.data[0])
  413. that.storeInfo = res.data.data[0]
  414. // 更新用户选择的门店信息
  415. uni.setStorageSync('storeInfo', res.data.data[0])
  416. })
  417. },
  418. // 获取经纬度信息
  419. getLocation() {
  420. let that = this
  421. console.log('+++++++++++++开始获取位置信息++++++++++++++++')
  422. uni.getLocation({
  423. type: 'gcj02',
  424. success: function (res) {
  425. console.log(res)
  426. let latitude = res.latitude; // 纬度
  427. let longitude = res.longitude; // 经度
  428. let speed = res.speed; // 速度
  429. let accuracy = res.accuracy; // 精确度
  430. // 在这里可以对位置信息进行处理
  431. console.log("纬度:" + latitude + ";经度" + longitude)
  432. that.reqParm.latitude = latitude
  433. that.reqParm.longitude = longitude
  434. uni.setStorageSync('location', that.reqParm)
  435. that.getStoreListData(that.reqParm)
  436. },
  437. fail:function (fail) {
  438. console.log('获取用户地址失败==》',fail)
  439. that.getStoreListData(that.reqParm)
  440. },
  441. complete:function (complete) {
  442. console.log('获取用户地址失败or成功==》',complete)
  443. }
  444. });
  445. },
  446. // 去选择门店
  447. gotoStoreChoose() {
  448. uni.setStorageSync('router','1')
  449. uni.navigateTo({
  450. url: '/storePages/store/store-choose?type=1',
  451. })
  452. },
  453. back(){
  454. uni.switchTab({
  455. url: '/pages/index/index',
  456. })
  457. },
  458. selectServiceTime(items,index,index2){
  459. items.forEach(e=>{
  460. e.select=false
  461. })
  462. let oidTime = this.orderParam.childService[index].serviceStartTime
  463. items[index2].select =true // 新选中的时间
  464. this.orderParam.childService[index].serviceStartTime = items[index2].label
  465. for (let i=0;i<this.orderParam.childService.length;i++){
  466. if (index != i){
  467. for (const time of this.orderParam.childService[i].periodTimeList) {
  468. if (time.label == oidTime){
  469. time.total = time.total + 1
  470. }
  471. if (time.label == items[index2].label) {
  472. time.total = time.total - 1
  473. }
  474. }
  475. }
  476. }
  477. this.$forceUpdate()
  478. },
  479. // 查询服务对象信息列表
  480. listServiceObject() {
  481. this.$api.listServiceObject(this.reqParm).then((res) => {
  482. this.serviceObjectList = res.data.data
  483. this.getImgUrlByBannerOssId(this.serviceObjectList);
  484. //不再默认选中第一个
  485. // if (this.periodTimeList.length >0){
  486. // this.orderParam.childService = [],
  487. // this.serviceObjectList[0].select = true
  488. // let periodTimeList = JSON.parse(JSON.stringify(this.periodTimeList))
  489. // periodTimeList[0].select = true
  490. // let childService = {
  491. // periodDate: '',
  492. // serviceObjectId: this.serviceObjectList[0].id,
  493. // facePhotoUrl: this.serviceObjectList[0].facePhotoUrl,
  494. // nickName: this.serviceObjectList[0].nickName,
  495. // serviceUserId: -1,
  496. // fee: '',
  497. // serviceStartTime: periodTimeList[0].label,
  498. // periodTimeList:periodTimeList
  499. // }
  500. // this.orderParam.childService.push(childService)
  501. // }
  502. })
  503. },
  504. // 获取图片
  505. getImgUrlByBannerOssId(items) {
  506. for (let i = 0; i < items.length; i++) {
  507. if (items[i].facePhoto) {
  508. this.$api.getImgUrlByOssId({
  509. ossId: items[i].facePhoto
  510. }).then(res => {
  511. items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  512. this.$set(this.serviceObjectList, i, items[i])
  513. if (i === 0) {
  514. this.orderParam.childService[0].facePhotoUrl = res.data.data[0].url.replace(
  515. /^http:/, "https:")
  516. }
  517. })
  518. }
  519. }
  520. },
  521. addServiceObject() {
  522. uni.navigateTo({
  523. url: '/myPages/ServiceObjectManagement/index'
  524. })
  525. },
  526. getServicePersonTime(){
  527. this.$api.getServicePersonTime({
  528. personId: -1,
  529. date: this.orderParam.serviceDate,
  530. storeId:this.store.storeId
  531. }).then(res=>{
  532. this.periodTimeList = res.data.data
  533. if (this.periodTimeList.length===0){
  534. // uni.$u.toast('暂无可预约排班')
  535. uni.showModal({
  536. title:"温馨提示",
  537. content:"今日线上号段已拿完,理发可先电话咨询门店",
  538. showCancel:false,
  539. confirmText:"知道了"
  540. })
  541. }
  542. // 服务对象
  543. this.listServiceObject()
  544. })
  545. },
  546. selectServiceObject(item) {
  547. if (item.select) {
  548. this.orderParam.childService = this.orderParam.childService.filter(selectServiceObject =>
  549. selectServiceObject.serviceObjectId !== item.id)
  550. } else {
  551. uni.showModal({
  552. title:"温馨提示",
  553. content:"当前默认门店为" + this.storeInfo.storeName + "是否需要更换",
  554. showCancel:false,
  555. confirmText:"知道了"
  556. })
  557. let periodTimeList = JSON.parse(JSON.stringify(this.periodTimeList))
  558. periodTimeList.forEach(i=>{
  559. this.orderParam.childService.forEach(i1=>{
  560. if (i.label == i1.serviceStartTime){
  561. i.total = i.total -1
  562. }
  563. })
  564. })
  565. let childService = {
  566. periodDate: '',
  567. serviceObjectId: item.id,
  568. facePhotoUrl: item.facePhotoUrl,
  569. nickName: item.nickName,
  570. serviceUserId: -1,
  571. fee: '',
  572. serviceStartTime: '',
  573. periodTimeList:periodTimeList
  574. }
  575. for (const time of periodTimeList) {
  576. if (time.total>0){
  577. time.select = true
  578. childService.serviceStartTime = time.label
  579. for (const childService of this.orderParam.childService) {
  580. for (const periodTime of childService.periodTimeList) {
  581. if (time.label == periodTime.label) {
  582. periodTime.total = periodTime.total - 1
  583. }
  584. }
  585. }
  586. break
  587. }
  588. }
  589. this.orderParam.childService.push(childService)
  590. }
  591. item.select = !item.select
  592. this.price = 0
  593. for (let childService of this.orderParam.childService) {
  594. this.price = this.price * 1 + childService.fee * 1
  595. }
  596. },
  597. getTemplateList(){
  598. this.$api.getTemplateList({
  599. type:1
  600. }).then(res=>{
  601. this.templateId=res.data.data.data.map(item=>{
  602. return item.priTmplId
  603. })
  604. })
  605. },
  606. getSelectionRules(data){
  607. this.$api.getSelectionRules(data).then(res=>{
  608. this.takeNumberRules = res.data.rows
  609. })
  610. },
  611. openSetting(){
  612. if (!this.userInfo.phone){
  613. uni.showModal({
  614. title:'温馨提示',
  615. content:'预约叫号是通过手机尾号进行查询,是否确认绑定手机号!',
  616. success:res=>{
  617. if (res.confirm){
  618. uni.navigateTo({
  619. url: '/myPages/setting/setting-telphone',
  620. })
  621. }
  622. }
  623. })
  624. return
  625. }
  626. uni.requestSubscribeMessage({
  627. tmplIds: this.templateId,
  628. success: (res) =>{
  629. let {errMsg,...param} = res
  630. console.log('+++++++++++++success+++++++++++++',param)
  631. this.$api.updateSubscribe(param).then(res=>{
  632. console.log('+++++++++++++updateSubscribe+++++++++++++',res)
  633. })
  634. },
  635. fail:(err)=>{
  636. console.log('+++++++++++++fail+++++++++++++',err)
  637. },
  638. complete:(complete)=>{
  639. console.log('+++++++++++++complete+++++++++++++',complete)
  640. this.commonGeneralOrder()
  641. }
  642. })
  643. },
  644. commonGeneralOrder() {
  645. if (!this.orderParam.childService.length) {
  646. uni.$u.toast('请选择服务对象')
  647. return
  648. }
  649. let flag = false
  650. this.orderParam.childService.forEach(i=>{
  651. if (!i.serviceStartTime){
  652. uni.$u.toast('请选择服务时段')
  653. flag= true
  654. }
  655. })
  656. if (flag){
  657. return;
  658. }
  659. if (this.requestStatus) {
  660. return;
  661. }
  662. this.requestStatus = true
  663. uni.showLoading({
  664. title: '加载中'
  665. });
  666. this.$api.commonGeneralOrder(this.orderParam).then(res => {
  667. this.requestStatus = false
  668. uni.hideLoading();
  669. uni.$u.toast('预约成功')
  670. setTimeout(() => {
  671. uni.switchTab({
  672. url: '/pages/order/index'
  673. })
  674. }, 500)
  675. }).catch(err => {
  676. this.requestStatus = false
  677. })
  678. }
  679. }
  680. }
  681. </script>
  682. <style scoped lang="scss">
  683. @import './index.rpx.scss';
  684. .store-wrap {
  685. margin-top: 10rpx;
  686. background-color: white;
  687. .store-info {
  688. display: flex;
  689. .logo {
  690. width: 10%;
  691. text-align: center;
  692. display: flex;
  693. justify-content: center;
  694. align-items: center;
  695. image {
  696. width: 30px;
  697. height: 30px;
  698. }
  699. }
  700. .store-content {
  701. width: 90%;
  702. padding-bottom: 13px;
  703. .h-row {
  704. display: flex;
  705. align-items: center;
  706. justify-content: space-between;
  707. .store-desc {
  708. width: 90%;
  709. display: flex;
  710. line-height: 30px;
  711. font-size: 14px;
  712. .store-name {
  713. }
  714. }
  715. .arrow-right {
  716. text-align: right;
  717. margin: 0 auto;
  718. cursor: pointer;
  719. padding-top: 3px;
  720. width: 100px;
  721. display: flex;
  722. font-size: 14px;
  723. .change-store {
  724. text-align: right;
  725. color: #666;
  726. }
  727. image {
  728. width: 18px;
  729. height: 18px;
  730. }
  731. }
  732. .address {
  733. color: #999999;
  734. width: 450rpx;
  735. font-size: 24rpx;
  736. }
  737. .address1 {
  738. color: #999999;
  739. font-size: 24rpx;
  740. padding-right: 40rpx;
  741. }
  742. }
  743. }
  744. }
  745. .adress {
  746. font-size: 22rpx;
  747. white-space: nowrap;
  748. overflow: hidden;
  749. text-overflow: ellipsis;
  750. padding-left: 80rpx;
  751. color: #666;
  752. }
  753. }
  754. .expire-popup-footer {
  755. display: flex;
  756. align-items: center;
  757. justify-content: space-between;
  758. padding: 20rpx 32rpx 30rpx;
  759. .no-more-prompt {
  760. display: flex;
  761. align-items: center;
  762. .checkbox {
  763. width: 32rpx;
  764. height: 32rpx;
  765. border: 2rpx solid #ccc;
  766. border-radius: 6rpx;
  767. display: flex;
  768. align-items: center;
  769. justify-content: center;
  770. margin-right: 10rpx;
  771. &.checked {
  772. background-color: #2979ff;
  773. border-color: #2979ff;
  774. }
  775. .check-icon {
  776. color: #fff;
  777. font-size: 22rpx;
  778. font-weight: bold;
  779. }
  780. }
  781. .no-more-text {
  782. font-size: 26rpx;
  783. color: #666;
  784. }
  785. }
  786. .close-btn {
  787. padding: 10rpx 36rpx;
  788. background-color: #2979ff;
  789. color: #fff;
  790. font-size: 28rpx;
  791. border-radius: 30rpx;
  792. }
  793. }
  794. </style>