checkout.vue 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106
  1. <template>
  2. <view class="container">
  3. <view v-if="isNeedAppoint">
  4. <view class="address-box">
  5. <view class="address-item" @tap="selectAddress" v-if="checkedAddress.id > 0">
  6. <image class="map-icon" mode="aspectFit" src="/static/images/address/dingwei.png"></image>
  7. <view class="m">
  8. <text class="address">{{ checkedAddress.addressDetail }}</text>
  9. <view class="address-bottom">
  10. <text class="user-name">{{ checkedAddress.name }}</text>
  11. <text>{{ checkedAddress.tel }}</text>
  12. </view>
  13. </view>
  14. <view class="r">
  15. <van-icon name="arrow" />
  16. </view>
  17. </view>
  18. <view class="address-item address-empty" @tap="selectAddress" v-else>
  19. <view class="m">还没有收货地址,去添加</view>
  20. <view class="r">
  21. <van-icon name="arrow" />
  22. </view>
  23. </view>
  24. </view>
  25. <view style="text-align: right; height: 48rpx; line-height: 48rpx; font-size: 22rpx ;color: #d77958;"
  26. class="jz-color">*请确保服务地址正确,确保服务者顺利上门!</view>
  27. </view>
  28. <!-- 商品详情 -->
  29. <view class="goods-items">
  30. <view class="item" v-for="(item, index) in checkedGoodsList" :key="index">
  31. <!-- <view class="name">{{item.goodsName}}</view> -->
  32. <view style="display: flex">
  33. <view class="img">
  34. <image :src="item.picUrl" mode="aspectFill"></image>
  35. </view>
  36. <view class="info">
  37. <view class="name">{{ item.goodsName }}</view>
  38. <view class="m" style="margin-top: 10rpx">规格:{{ item.specifications[0] }}</view>
  39. <view class="m" v-if="item.goodsType == 4">服务次数:{{ item.product.serviceTimes }}</view>
  40. <view class="m" v-else-if="">购买份数:{{ item.number }}</view>
  41. <view class="b">单价:¥{{ item.price }}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 加购 -->
  47. <view class="plus-order" v-if="increaseSumPrice > 0">
  48. <view class="plus-title">加购</view>
  49. <view class="plus-name">
  50. {{ checkedGoodsList[0].product.specifications }}
  51. <text>x</text>
  52. <!-- <text class="plus-num">{{checkedGoodsList[0].unitPrice}}*{{checkedGoodsList[0].unitIncreaseNumber}}</text> -->
  53. <text class="plus-num">{{ checkedGoodsList[0].unitIncreaseNumber }}</text>
  54. </view>
  55. <view class="plus-amount">{{ increaseSumPrice }}</view>
  56. </view>
  57. <view class="appoint-server"
  58. v-if="showLastServiceBtn" @tap="chooseLastOrder">
  59. <view class="server-tip" >优先匹配上一单的服务者</view>
  60. <image mode="aspectFit"
  61. src="https://mall.zhaijieshi.cc/file/wx-huawang/dian2.png" class="radio-img" v-if="isPreOrder"
  62. ></image>
  63. <image mode="aspectFit"
  64. src="https://jzmall.lifejingzhi.com/file/jzmall-dy/icon-unselect-popup.png" v-else
  65. class="radio-img" ></image>
  66. </view>
  67. <!-- 预约时间 -->
  68. <view class="appoint-time-block" v-if="goodsType != 6 && goodsType != 4 && (isNeedAppoint || couponId == 24)">
  69. <view class="appoint-time-operate" @tap="showAppoint">
  70. <view class="operate-left" v-if="!isFinishAppoint||!isOneAppoint" style="margin: 20rpx 0rpx;">预约上门时段
  71. </view>
  72. <view class="operate-left" v-if="isFinishAppoint&&isOneAppoint">
  73. <text>{{ oneTimeAppoint }}</text>
  74. <view class="" style="margin-top: 20rpx;">
  75. 距离今日<text
  76. style="color: #D77958; display: inline-block;margin-right:4rpx;margin-left: 4rpx;">{{daysDifference}}</text>天
  77. </view>
  78. </view>
  79. <view class="operate-right">
  80. <text class="not-select" v-if="!isFinishAppoint" style="color: #D77958;">请选择</text>
  81. <text v-if="isFinishAppoint" style="color: #D77958;">更改</text>
  82. <van-icon name="arrow" color="##D77958" />
  83. </view>
  84. </view>
  85. <view class="appoint-time-show" v-if="isFinishAppoint">
  86. <view class="multi-times" v-if="!isOneAppoint">
  87. <view class="multi-times-item">
  88. <text>服务频率</text>
  89. <text>{{ activeTab == 3? '两周一次' : activeTab == 5 ? '一月一次' : '两月一次' }}</text>
  90. </view>
  91. <view class="multi-times-item">
  92. <text>服务时间</text>
  93. <text>{{ selectedDateList[0].weekStr + ' ' + selectedDateList[0].time }}</text>
  94. </view>
  95. <view class="multi-times-item">
  96. <text>首次服务时间</text>
  97. <text>{{ firstAppointList[firstDateIndex].date }}</text>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="coupon-box">
  103. <!-- 优惠 -->
  104. <view class="discount-title">
  105. <image mode="aspectFit" src="/static/images/new/icon-minus.png"></image>
  106. <text>优惠</text>
  107. </view>
  108. <view class="coupon-item" @tap="selectCoupon">
  109. <view class="l" v-if="couponId == 0">
  110. <text class="name">没有可用的优惠券</text>
  111. <text class="txt">0张</text>
  112. </view>
  113. <view class="l" v-else-if="couponId == -1">
  114. <text class="name">优惠券</text>
  115. <text class="txt">{{ availableCouponLength }}张</text>
  116. </view>
  117. <view class="l" v-else>
  118. <text class="name">优惠券</text>
  119. <text class="txt">{{ couponName }}</text>
  120. </view>
  121. <view class="r">
  122. <van-icon name="arrow" color="#85868A" />
  123. </view>
  124. </view>
  125. <view class="discount-line">
  126. <view class="l">
  127. <text class="name">已选择</text>
  128. <text class="txt">-¥{{ couponPrice }}</text>
  129. </view>
  130. </view>
  131. </view>
  132. <!-- 多次预约结果 -->
  133. <view class="appoint-result" v-if="appointFailTip">
  134. 根据您的预约需求,有
  135. <text class="orange-font">{{ noSerTimes }}</text>
  136. 个日期暂时无法提供预约服务,为您保留
  137. <text class="orange-font">{{ noSerTimes }}</text>
  138. 个保洁次卡,下单成功后在"
  139. <text class="orange-font">我的订单-查看服务</text>
  140. "里预约服务
  141. </view>
  142. <view class="order-box">
  143. <view class="order-item no-border">
  144. <view class="l">
  145. <text class="name">备注</text>
  146. </view>
  147. <view class="r">
  148. <input class="txt message-item" :disabled="remarkDisable" @input="bindMessageInput"
  149. placeholder="如需要,请输入备注信息" :value="message" />
  150. </view>
  151. </view>
  152. </view>
  153. <view class="order-box code-module" v-if="isRecommend">
  154. <view class="order-item no-border">
  155. <view class="l">
  156. <text class="name">推荐码</text>
  157. </view>
  158. <view class="r">
  159. <input class="txt message-item" :disabled="remarkDisable" @input="bindCodeInput" type="number"
  160. maxlength="9" placeholder="请输入" :value="recCode" />
  161. </view>
  162. </view>
  163. <view class="codeTips" :class="{'no-match': isNoMatch}" v-if="codeShow" :disabled="remarkDisable">
  164. {{recommendTips}}
  165. </view>
  166. </view>
  167. <view class="coupon-price">
  168. 优惠券:
  169. <text>¥{{ couponPrice }}</text>
  170. </view>
  171. <view class="actual-price">
  172. 需支付:
  173. <text>¥{{ actualPrice }}</text>
  174. </view>
  175. <view class="go-pay-wrapper">
  176. <van-button block round @tap="submitOrder" color="#d77958" v-if="!isNeedAppoint">去支付</van-button>
  177. <van-button block round @tap="submitOrdera" color="#d77958" v-else>支付并预约</van-button>
  178. </view>
  179. <!-- custom-style="height: 80%" -->
  180. <van-popup :show="choosePopup" round position="bottom" @click-overlay="onClose">
  181. <view :class="'popup-wrapper ' + (popupType == 1 ? 'popup-wrapper-special' : '')">
  182. <!-- 标题 -->
  183. <view class="popup-title popup-title-special popup-title-new">
  184. <view>{{ popupType == 1 ? '请选择服务开始时间' : popupType == 2 ? '请选择服务频次' : '请选择首次服务日期' }}</view>
  185. <view v-if="selectTimeValue >= 17" class="fee-tips">您选的时间段可能会加收夜间服务费,具体以与商家的沟通为准</view>
  186. </view>
  187. <block v-if="popupType == 1">
  188. <view :class="'popup-content ' + (popupType == 1 ? 'popup-content-special' : '')">
  189. <view class="time-select-top" style="display: flex;">
  190. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="0">
  191. <view class="time-select-left-item" @tap="dateCheck" :data-index="index"
  192. :data-week="item.week" :data-date="item.date" :data-isbook="item.isBook"
  193. v-for="(item, index) in dateList" :key="index" style="display: inline-block;">
  194. <view class="date-line-wrapper">
  195. <view :class="[
  196. 'date-msg',
  197. dateIndex == index ? 'current-date' : '',
  198. item.dateMsg == '不可约' ? 'avail-date' : ''
  199. ]">
  200. {{item.weekOfDay}}
  201. </view>
  202. <view :class="[
  203. 'date-msg1',
  204. dateIndex == index ? 'current-date' : '',
  205. item.dateMsg == '不可约' ? 'avail-date' : ''
  206. ]"> {{ item.bookdate | formatDate }}</view>
  207. <view :class="[
  208. dateIndex == index ? 'current-line' : '',
  209. item.dateMsg == '不可约' ? 'current-line0' : ''
  210. ]"></view>
  211. </view>
  212. </view>
  213. </scroll-view>
  214. </view>
  215. <view class="time-select-middle">
  216. <view class="noon-select">
  217. <view :class="'noon-item' + (noonType == '1' ? 'active-noon' : '')" data-noon="1"
  218. @tap="noonTab">上午</view>
  219. <view class="divider"></view>
  220. <view :class="'noon-item' + (noonType == '2' ? 'active-noon' : '')" data-noon="2"
  221. @tap="noonTab">下午</view>
  222. </view>
  223. <view class="time-item-wrapper">
  224. <view @tap="timeCheck" :data-stock="item.stock" :data-index="index"
  225. :data-msg="item.timeMsg" :data-toastmsg="item.toastMsg" :class="[
  226. 'time-msg',
  227. timeIndex == index ? 'current-time' : '',
  228. item.timeMsg == '不可约' ? 'avail-time' : ''
  229. ]" v-for="(item, index) in timeList" :key="index">
  230. <view :class="timeIndex === index ? 'current-time' : ''">{{ item.begin }}</view>
  231. </view>
  232. </view>
  233. <view class="appointment-tips">
  234. <view> <span></span>
  235. <text>可预约</text>
  236. </view>
  237. <view> <span class="selected"></span>
  238. <text>已选择</text>
  239. </view>
  240. <view> <span class="no-appointment"></span>
  241. <text>不可约</text>
  242. </view>
  243. </view>
  244. <view class="time-select-bottom" v-if="date!==''&week!==''&time!==''">
  245. <span>当前选择:</span>
  246. {{date}}
  247. ({{week}}){{time}}
  248. </view>
  249. </view>
  250. </view>
  251. </block>
  252. <!-- 选择频次 -->
  253. <!-- -->
  254. <block v-if="popupType == 2">
  255. <van-tabs title-style="color:red;" v-if="choosePopup" :active="activeTab" color="#d77958"
  256. @change="onTabChange">
  257. <van-tab title="两周1次" name="3"></van-tab>
  258. <van-tab title="一月1次" name="5"></van-tab>
  259. <van-tab title="两月1次" name="6"></van-tab>
  260. </van-tabs>
  261. <view class="popup-content select-week-times">
  262. <view class=" week-select-left">
  263. <view class="time-select-left-item" @tap="weekCheck" :data-index="index"
  264. :data-weekday="item.week" v-for="(item, index) in weekArrList" :key="index">
  265. <view :class="'week-str ' + (weekIndex == index ? 'current-date' : '')">{{ item.week }}
  266. </view>
  267. </view>
  268. </view>
  269. <view class="time-select-right time-select-middle">
  270. <view class="time-select-right-a">
  271. <view class="time-select-right-item" @tap="timeSelect" :data-index="index"
  272. :data-time="item.time" v-for="(item, index) in timeList" :key="index">
  273. <view :class="
  274. selectTimeIndex==index
  275. ? 'current-time'
  276. : ''
  277. ">
  278. {{ item.time }}
  279. </view>
  280. </view>
  281. </view>
  282. <view class="appointment-tips appointment-tips1">
  283. <view> <span></span>
  284. <text>可预约</text>
  285. </view>
  286. <view> <span class="selected"></span>
  287. <text>已选择</text>
  288. </view>
  289. <view> <span class="no-appointment"></span>
  290. <text>不可约</text>
  291. </view>
  292. </view>
  293. <view class="time-select-bottom1" v-if="selectweek!==''&weekday!==''&selecttime!==''">
  294. 周期卡服务频次,可按照您的习惯选择特定频率上门,后续可修改。
  295. </view>
  296. <view class="time-select-bottom" v-if="selectweek!==''&weekday!==''&selecttime!==''">
  297. <span>当前选择:</span>
  298. {{selectweek}}
  299. <span style=" display: inline-block;
  300. width: 2px;
  301. height: 10px;
  302. background-color: #d77958;
  303. position: relative;
  304. top: 1px;
  305. margin: 0 5px;"></span>
  306. {{weekday}}({{selecttime}})
  307. </view>
  308. </view>
  309. </view>
  310. </block>
  311. <!-- 选择首次预约时间 -->
  312. <block v-if="popupType == 3">
  313. <view class="popup-content">
  314. <view class="first-appoint-date-list">
  315. <view class="first-appoint-date-item" @tap="firstDateCheck" :data-index="index" :data-firstdate="item.date" :data-firstweek="item.week"
  316. v-for="(item, index) in firstAppointList" :key="index">
  317. <view :class="firstDateIndex == index ? 'current-date' : ''">
  318. {{ item.date + ' ' + item.week }}
  319. </view>
  320. </view>
  321. <view class="time-select-bottom2" v-if="firstdate!==''&firstweek!==''&selecttime!==''">
  322. <span>当前选择:</span>
  323. {{firstdate}}({{firstweek}}){{selecttime}}
  324. </view>
  325. </view>
  326. </view>
  327. </block>
  328. </view>
  329. <!-- 确认按钮 -->
  330. <view :class="'popup-btn-wrapper ' + (popupType == 1 ? 'popup-btn-special' : '')">
  331. <van-button color="#d77958" block round @tap.native="confirmTime">确定</van-button>
  332. </view>
  333. </van-popup>
  334. <!-- 支付失败弹框 -->
  335. <van-overlay :show="payFailShow">
  336. <view class="overlay-wrapper">
  337. <view class="fail-wrapper">
  338. <image src="https://mall.zhaijieshi.cc/file/wx-huawang/bj3.png" mode=""
  339. style="width: 100%;height: 300rpx;display: block;"></image>
  340. <image src="https://mall.zhaijieshi.cc/file/wx-huawang/cc.png"
  341. style="position: absolute;top: 50rpx; left: 248rpx;width: 161rpx; height: 161rpx;"></image>
  342. <view class="fail-top">
  343. <view class="fail-text">支付失败</view>
  344. <view class="sub-color">支付遇到问题,请尝试重新支付</view>
  345. </view>
  346. <view class="fail-bottom">
  347. <view class="cancel-btn" @tap="cancelPay">取消</view>
  348. <view class="repay-btn" @tap="rePay">重新支付</view>
  349. </view>
  350. </view>
  351. </view>
  352. </van-overlay>
  353. </view>
  354. </template>
  355. <script module="formatFuc" lang="wxs" src="@/utils/formatFuc.wxs"></script>
  356. <script>
  357. var util = require('../../utils/util.js');
  358. var user = require('../../utils/user.js');
  359. var api = require('../../config/api.js');
  360. var check = require('../../utils/check.js');
  361. var app = getApp();
  362. export default {
  363. filters: {
  364. formatDate: function(value, format) {
  365. // 这里可以根据format来格式化日期
  366. if (value) {
  367. return value.substring(0, 10).split('-').slice(1).join('-');
  368. }
  369. }
  370. },
  371. data() {
  372. return {
  373. traceId: '',
  374. //视频号的traceid
  375. requireOrder: 0,
  376. //视频号 是否需要推单,1:需要,0:不需要
  377. increaseSumPrice: 0,
  378. isRecommend: false,
  379. isNoMatch: true,
  380. codeShow: false,
  381. recCode: '',
  382. recommendTips: '',
  383. memberDiscount: '',
  384. isMember: false,
  385. orderId: '',
  386. payFailShow: false,
  387. choosePopup: false,
  388. noSerTimes: '',
  389. popupType: 1,
  390. //1单次预约 2 选择服务频次 3选择首次预约时间
  391. // timeList: check.getTimeList(1),
  392. timeList: [],
  393. // dateList: util.getDateList(new Date(new Date().getTime() + 60 * 60 * 1000 * 24 * 0), 1, 21),
  394. dateList: [],
  395. // firstAppointList:util.getDateList(new Date(new Date().getTime()+60*60*1000*24),7),
  396. firstAppointList: [],
  397. timeIndex: '',
  398. //选中的时间段
  399. dateIndex: 0,
  400. //单次预约选中的日期
  401. firstDateIndex: 0,
  402. //首次预约时间
  403. activeTab: 5,
  404. //频次
  405. weekIndex: 0,
  406. //选中的周几
  407. weekArrList: [{
  408. id: 1,
  409. week: '周一',
  410. num: 0
  411. },
  412. {
  413. id: 2,
  414. week: '周二',
  415. num: 0
  416. },
  417. {
  418. id: 3,
  419. week: '周三',
  420. num: 0
  421. },
  422. {
  423. id: 4,
  424. week: '周四',
  425. num: 0
  426. },
  427. {
  428. id: 5,
  429. week: '周五',
  430. num: 0
  431. },
  432. {
  433. id: 6,
  434. week: '周六',
  435. num: 0
  436. },
  437. {
  438. id: 0,
  439. week: '周日',
  440. num: 0
  441. }
  442. ],
  443. selectedWeekList: [],
  444. selectedDateList: [],
  445. selectTimeIndex: 'null',
  446. //选中的时间段
  447. oneTimeAppoint: '2021-04-22 周一 13:00-14:00',
  448. isNeedAppoint: false,
  449. //是否需要预约
  450. isFinishAppoint: false,
  451. //已选择预约
  452. isOneAppoint: true,
  453. //单次卡
  454. appointFailTip: false,
  455. //预约失败提示
  456. bookStartDate: '',
  457. //可预约时间段
  458. bookEndDate: '',
  459. multiIndex: [0, 0, 0, 0, 0, 0],
  460. multiArray: [],
  461. array: [],
  462. year: '',
  463. month: '',
  464. day: '',
  465. startHour: '',
  466. endHour: '',
  467. orderData: '',
  468. //此时间为预计上门时间
  469. checkedGoodsList: [],
  470. checkedAddress: {
  471. id: 0,
  472. addressDetail: '',
  473. name: '',
  474. tel: ''
  475. },
  476. availableCouponLength: 0,
  477. // 可用的优惠券数量
  478. goodsTotalPrice: 0,
  479. //商品总价
  480. freightPrice: 0,
  481. //快递费
  482. couponPrice: 0,
  483. //优惠券的价格
  484. grouponPrice: 0,
  485. //团购优惠价格
  486. orderTotalPrice: 0,
  487. //订单总价
  488. actualPrice: 0,
  489. //实际需要支付的总价
  490. cartId: 0,
  491. addressId: 0,
  492. addressMsg: '',
  493. couponId: 0,
  494. userCouponId: 0,
  495. message: '',
  496. grouponLinkId: 0,
  497. //参与的团购
  498. grouponRulesId: 0,
  499. //团购规则ID
  500. nurseId: 0,
  501. //安心包认证id
  502. petinfo: null,
  503. //宠物保险内容
  504. shareId: 0,
  505. userInfo: {},
  506. remarkDisable: false,
  507. fraId: '',
  508. //加盟商id
  509. rId: '',
  510. //阿姨推荐码
  511. channelId: 112,
  512. //渠道id
  513. goodsType: 1,
  514. //商品类型 如果是6 可以不填写预约时间,
  515. serviceDuration: '',
  516. noonType: 1,
  517. selectTimeValue: '',
  518. Varieties: '',
  519. Warehouse: '',
  520. unitIncreaseNumber: '',
  521. weekStr: '',
  522. time: '',
  523. date: '',
  524. week: '',
  525. daysDifference: '',
  526. appType: 0,
  527. couponName: '',
  528. selectweek: '两周1次',
  529. weekday: '周一',
  530. selecttime: '',
  531. showLastServiceBtn:false,
  532. isPreOrder:false,
  533. firstweek:'',
  534. firstdate:''
  535. };
  536. },
  537. onReady: function() {
  538. // 页面渲染完成
  539. },
  540. onShow: function() {
  541. // 页面显示
  542. user.checkLogin()
  543. .then((res) => {
  544. app.globalData.hasLogin = true;
  545. console.info('session 未过期');
  546. })
  547. .catch(() => {
  548. console.info('session 过期');
  549. app.globalData.hasLogin = false;
  550. uni.navigateTo({
  551. url: '/pages/auth/login/login'
  552. });
  553. });
  554. uni.showLoading({
  555. title: '加载中...'
  556. });
  557. try {
  558. var cartId = uni.getStorageSync('cartId');
  559. if (cartId === '') {
  560. cartId = 0;
  561. }
  562. var addressId = uni.getStorageSync('addressId');
  563. if (addressId === '') {
  564. addressId = 0;
  565. } else if (typeof addressId === 'number') {} else if ((typeof addressId === 'string' && addressId
  566. .indexOf("{") !== -1) || addressId.length > 20) {
  567. addressId = JSON.parse(addressId).id;
  568. }
  569. var couponId = uni.getStorageSync('couponId');
  570. if (couponId === '') {
  571. couponId = 0;
  572. }
  573. var userCouponId = uni.getStorageSync('userCouponId');
  574. if (userCouponId === '') {
  575. userCouponId = 0;
  576. }
  577. var grouponRulesId = uni.getStorageSync('grouponRulesId');
  578. if (grouponRulesId === '') {
  579. grouponRulesId = 0;
  580. }
  581. var grouponLinkId = uni.getStorageSync('grouponLinkId');
  582. if (grouponLinkId === '') {
  583. grouponLinkId = 0;
  584. }
  585. //客户点选的预约动作
  586. var appType = uni.getStorageSync('appType');
  587. console.info(appType);
  588. this.setData({
  589. cartId: cartId,
  590. addressId: addressId,
  591. couponId: couponId,
  592. userCouponId: userCouponId,
  593. grouponRulesId: grouponRulesId,
  594. grouponLinkId: grouponLinkId,
  595. appType: appType
  596. });
  597. this.getCheckoutInfo(appType);
  598. } catch (e) {
  599. console.log('CatchClause', e);
  600. // Do something when catch error
  601. console.log(e);
  602. }
  603. },
  604. onHide: function() {
  605. // 页面隐藏
  606. },
  607. onUnload: function() {
  608. // 页面关闭
  609. //清空宠物保险的缓存数据
  610. console.info('checkout onload');
  611. //wx.setStorageSync('petinfo'+this.data.cartId, null);
  612. },
  613. /**
  614. * 生命周期函数--监听页面加载
  615. */
  616. onLoad: function(options) {
  617. this.setData({
  618. userInfo: app.globalData.userInfo
  619. });
  620. let that = this;
  621. if (options.nurseId) {
  622. this.setData({
  623. nurseId: options.nurseId
  624. });
  625. }
  626. var rId = uni.getStorageSync('rId');
  627. if (rId) {
  628. this.setData({
  629. rId: rId,
  630. recCode: rId
  631. });
  632. }
  633. var fraId = uni.getStorageSync('fraId');
  634. if (fraId) {
  635. this.setData({
  636. fraId: fraId
  637. });
  638. }
  639. var channelId = uni.getStorageSync('channelId');
  640. if (channelId) {
  641. this.setData({
  642. channelId: parseInt(channelId)
  643. });
  644. }
  645. if (typeof options.shareId != 'undefined' && options.shareId > 0) {
  646. that.setData({
  647. shareId: options.shareId
  648. });
  649. }
  650. //视频号,校验 wx.checkBeforeAddOrder
  651. uni.checkBeforeAddOrder({
  652. success(res) {
  653. console.log('checkBeforeAddOrder-success:', res);
  654. if (res.data.errcode == 0) {
  655. that.setData({
  656. traceId: res.data.traceId,
  657. requireOrder: res.data.requireOrder
  658. });
  659. }
  660. },
  661. fail(res) {
  662. console.log('checkBeforeAddOrder-fail:', res);
  663. }
  664. });
  665. var date = new Date();
  666. var year = date.getFullYear();
  667. var month = date.getMonth() + 1;
  668. var day = date.getDate();
  669. var hour = date.getHours();
  670. var surplusMonth = that.surplusMonth(year);
  671. console.log(surplusMonth);
  672. var surplusDay = this.surplusDay(year, month, day);
  673. console.log(surplusDay);
  674. var surplusHour = this.surplusHour(year, month, day, hour);
  675. console.log(surplusHour);
  676. //初始化picker
  677. that.setData({
  678. multiArray: [
  679. [year + '年', year + 1 + '年', year + 2 + '年'], surplusMonth, surplusDay, surplusHour[0],
  680. ['~'], surplusHour[1]
  681. ],
  682. year: year,
  683. month: month,
  684. day: day,
  685. startHour: surplusHour[0][0],
  686. endHour: surplusHour[1][0]
  687. });
  688. },
  689. methods: {
  690. //获取checkou信息
  691. getCheckoutInfo: function(appType) {
  692. let that = this;
  693. util.request(api.CartCheckout, {
  694. cartId: that.cartId,
  695. addressId: that.addressId,
  696. couponId: that.couponId,
  697. userCouponId: that.userCouponId,
  698. grouponRulesId: that.grouponRulesId,
  699. shareId: that.shareId,
  700. createOrderType: that.appType
  701. }).then(function(res) {
  702. console.log("1aaa", res);
  703. if (res.errno === 0) {
  704. that.setData({
  705. isRecommend: res.data.checkedGoodsList[0].goods.attribute != 1,
  706. isMember: res.data.isMember,
  707. memberDiscount: res.data.memberDiscount,
  708. checkedGoodsList: res.data.checkedGoodsList,
  709. checkedAddress: res.data.checkedAddress,
  710. availableCouponLength: res.data.availableCouponLength,
  711. actualPrice: res.data.actualPrice,
  712. couponPrice: res.data.couponPrice,
  713. grouponPrice: res.data.grouponPrice,
  714. freightPrice: res.data.freightPrice,
  715. goodsTotalPrice: res.data.goodsTotalPrice,
  716. orderTotalPrice: res.data.orderTotalPrice,
  717. addressId: res.data.addressId,
  718. addressMsg: res.data.addressMsg,
  719. couponId: res.data.couponId,
  720. userCouponId: res.data.userCouponId,
  721. grouponRulesId: res.data.grouponRulesId,
  722. isNeedAppoint: appType == '1' ? true : false,
  723. //0需要预约 服务类商品,1保险 2中介 3买约分离次卡res.data.checkedGoodsList[0].goods.type === 0 ||
  724. isOneAppoint: res.data.checkedGoodsList[0].product.serviceTimes == 1 ?
  725. true : false,
  726. //1为单次,其余为多次
  727. popupType: res.data.checkedGoodsList[0].product.serviceTimes == 1 ? 1 : 2,
  728. bookStartDate: res.data.bookStartDate,
  729. bookEndDate: res.data.bookEndDate,
  730. goodsType: res.data.goodsType,
  731. increaseSumPrice: res.data.increaseSumPrice,
  732. serviceDuration: res.data.serviceDuration,
  733. couponName: res.data.couponName,
  734. showLastServiceBtn:res.data.showLastServiceBtn
  735. });
  736. let serviceDuration = res.data.checkedGoodsList[0].product.serviceDuration;
  737. if (that.popupType == 2) {
  738. let timeList = [];
  739. if (res.data.timeRange != null && res.data.timeRange.length > 0) {
  740. res.data.timeRange.forEach((time, index) => {
  741. timeList.push({
  742. id: index + 1,
  743. time: time
  744. });
  745. });
  746. } else {
  747. timeList = check.getTimeList(serviceDuration);
  748. }
  749. that.setData({
  750. timeList: timeList
  751. });
  752. console.log("timeList", that.timeList);
  753. }
  754. if (res.data.addressId == null && res.data.addressMsg != null) {
  755. uni.showToast({
  756. title: res.data.addressMsg,
  757. icon: 'none',
  758. duration: 2000
  759. });
  760. }
  761. // that.LimitCanAppointmentDate();
  762. }
  763. uni.hideLoading();
  764. });
  765. },
  766. LimitCanAppointmentDate() {
  767. //特殊商品 如果需要限制可预约的时间范围 在次方法中实现
  768. if (this.checkedGoodsList[0].goodsId == 1190332) {
  769. let dates = [];
  770. this.dateList.forEach((item) => {
  771. if (item.date < '2022-04-01') {
  772. dates.push(item);
  773. }
  774. });
  775. this.setData({
  776. dateList: dates
  777. });
  778. }
  779. //控制可预约时间范围
  780. let that = this;
  781. if (that.bookStartDate) {
  782. let dates = [];
  783. let dateIndex = -1;
  784. that.dateList.forEach((item, index) => {
  785. if (item.date < that.bookStartDate || item.date > that.bookEndDate) {
  786. item.isBook = false;
  787. item.mark = '不可约';
  788. } else {
  789. //设置第一个可预约的时间index
  790. if (dateIndex < 0) {
  791. dateIndex = index;
  792. }
  793. }
  794. dates.push(item);
  795. });
  796. that.setData({
  797. dateList: dates,
  798. dateIndex: dateIndex
  799. });
  800. }
  801. console.info(that.dateList);
  802. console.info(that.dateIndex);
  803. //设置默认起始可预约 index:dateIndex 近7天如果有周六 周日 不允许预约
  804. //存在一种情况 如果今天是周四,如果起始index=2 则周日允许预约 虽然页面显示为”约满"
  805. // if(this.data.dateList[3].id==0) {
  806. // console.info(" dateIndex:4")
  807. // this.setData({
  808. // dateIndex:4
  809. // })
  810. // }else{
  811. // if(this.data.dateList[2].id==0) {
  812. // console.info(" dateIndex:3")
  813. // this.setData({
  814. // dateIndex:3
  815. // })
  816. // }
  817. // }
  818. },
  819. selectAddress() {
  820. uni.navigateTo({
  821. url: '/pages/ucenter/address/address'
  822. });
  823. },
  824. selectCoupon() {
  825. uni.navigateTo({
  826. url: '/pages/ucenter/couponSelect/couponSelect'
  827. });
  828. },
  829. bindMessageInput: function(e) {
  830. this.setData({
  831. message: e.detail.value
  832. });
  833. },
  834. bindCodeInput: function(e) {
  835. this.setData({
  836. recCode: e.detail.value
  837. });
  838. if (e.detail.value.length == 5) {
  839. // 校验服务者真实性
  840. this.recCodeCheck();
  841. // this.setData({
  842. // codeShow:true
  843. // })
  844. } else {
  845. this.setData({
  846. codeShow: false
  847. });
  848. }
  849. },
  850. recCodeCheck() {
  851. uni.showLoading({
  852. title: '加载中'
  853. });
  854. util.request(
  855. api.checkRecommend, {
  856. recCode: this.recCode
  857. },
  858. 'GET'
  859. )
  860. .then((res) => {
  861. uni.hideLoading();
  862. if (res.errno == 0) {
  863. if (res.data) {
  864. this.setData({
  865. codeShow: true,
  866. isNoMatch: false,
  867. recommendTips: '推荐人:' + res.data
  868. });
  869. } else {
  870. this.setData({
  871. codeShow: true,
  872. isNoMatch: true,
  873. recommendTips: '未匹配到推荐者,请您和推荐人核对'
  874. });
  875. }
  876. } else {
  877. this.setData({
  878. codeShow: false
  879. });
  880. uni.showToast({
  881. title: res.errmsg,
  882. icon: 'none',
  883. duration: 2000
  884. });
  885. }
  886. })
  887. .catch(function(err) {
  888. uni.hideLoading();
  889. this.setData({
  890. codeShow: false
  891. });
  892. uni.showToast({
  893. title: err.errMsg,
  894. icon: 'none'
  895. });
  896. });
  897. },
  898. submitOrder: function() {
  899. console.log("submitOrder");
  900. let that = this;
  901. // if (that.addressId <= 0) {
  902. // console.log("无地址");
  903. // //所选地址无服务门店,或选择其他地址
  904. // let errmsg = that.addressMsg == '' ? '请选择收货地址' : that.addressMsg;
  905. // //util.showErrorToast(errmsg);
  906. // uni.showModal({
  907. // title: '提示',
  908. // content: errmsg,
  909. // showCancel: false,
  910. // confirmColor: '#D77958',
  911. // });
  912. // return;
  913. // }
  914. // 检查是否已经预约
  915. if (that.goodsType != 6 && that.goodsType != 4 && that.isNeedAppoint && !that.isFinishAppoint) {
  916. // util.showErrorToast('请先预约服务时间');
  917. uni.showToast({
  918. title: '请先预约服务时间',
  919. icon: 'none',
  920. duration: 2000
  921. });
  922. return;
  923. }
  924. // uni.showLoading({
  925. // title: '检测中'
  926. // });
  927. that.submitInfo();
  928. },
  929. submitOrdera: function() {
  930. console.log("submitOrder");
  931. let that = this;
  932. if (that.addressId <= 0) {
  933. console.log("无地址");
  934. //所选地址无服务门店,或选择其他地址
  935. let errmsg = that.addressMsg == '' ? '请选择收货地址' : that.addressMsg;
  936. //util.showErrorToast(errmsg);
  937. uni.showModal({
  938. title: '提示',
  939. content: errmsg,
  940. showCancel: false,
  941. confirmColor: '#D77958',
  942. });
  943. return;
  944. }
  945. // 检查是否已经预约
  946. if (that.goodsType != 6 && that.goodsType != 4 && that.isNeedAppoint && !that.isFinishAppoint) {
  947. // util.showErrorToast('请先预约服务时间');
  948. uni.showToast({
  949. title: '请先预约服务时间',
  950. icon: 'none',
  951. duration: 2000
  952. });
  953. return;
  954. }
  955. // uni.showLoading({
  956. // title: '检测中'
  957. // });
  958. that.submitInfo();
  959. },
  960. submitInfo() {
  961. // 如果是多次卡先预估,单次卡不用预估
  962. console.log("submitInfo");
  963. if (!this.isOneAppoint) {
  964. console.log("submitInfo1");
  965. let weeks = [];
  966. this.selectedDateList.forEach((item) => {
  967. let obj = {
  968. dayOfWeek: this.weekArrList[item.week].id,
  969. startTime: item.time.split('-')[0],
  970. endTime: item.time.split('-')[1]
  971. };
  972. weeks.push(obj);
  973. });
  974. let tempStartDate = null;
  975. if (this.firstAppointList.length != 0 && this.firstAppointList.length >= this.firstDateIndex) {
  976. tempStartDate = this.firstAppointList[this.firstDateIndex].date;
  977. }
  978. let params = {
  979. weeks: weeks,
  980. type: this.activeTab,
  981. startDate: tempStartDate,
  982. //this.data.firstAppointList[this.data.firstDateIndex].date,
  983. lng: this.checkedAddress.lng,
  984. lat: this.checkedAddress.lat,
  985. shopId: this.checkedAddress.shopId,
  986. goodId: this.checkedGoodsList[0].goodsId,
  987. isPreOrder:this.isPreOrder
  988. };
  989. console.log(params);
  990. this.orderPay(params);
  991. } else {
  992. console.log("submitInfo2");
  993. let weeks = [];
  994. if (this.isNeedAppoint && this.goodsType != 6 && this.goodsType != 4) {
  995. weeks = [{
  996. dayOfWeek: new Date(this.dateList[this.dateIndex].bookdate).getDay(),
  997. startTime: this.timeList[this.timeIndex].begin,
  998. endTime: this.timeList[this.timeIndex].end
  999. }];
  1000. }
  1001. let params = {
  1002. weeks: weeks,
  1003. type: 0,
  1004. //startDate: this.isNeedAppoint ? this.dateList[this.dateIndex].bookdate : null,
  1005. startDate: this.dateList != '' && this.dateList.length > 0 ? this.dateList[this.dateIndex]
  1006. .bookdate : null,
  1007. lng: this.checkedAddress.lng,
  1008. lat: this.checkedAddress.lat,
  1009. shopId: this.checkedAddress.shopId,
  1010. goodId: this.checkedGoodsList[0].goodsId,
  1011. isPreOrder:this.isPreOrder
  1012. };
  1013. console.log(params);
  1014. this.orderPay(params);
  1015. }
  1016. },
  1017. orderPay(orderData) {
  1018. let that = this;
  1019. var orderInfo = {
  1020. cartId: this.cartId,
  1021. addressId: this.addressId,
  1022. couponId: this.couponId,
  1023. userCouponId: this.userCouponId,
  1024. message: this.message,
  1025. orderDate: this.orderData,
  1026. grouponRulesId: this.grouponRulesId,
  1027. grouponLinkId: this.grouponLinkId,
  1028. nurseId: this.nurseId,
  1029. petinfo: this.petinfo,
  1030. shareId: this.shareId,
  1031. recCode: this.recCode ? this.recCode : this.rId,
  1032. //服务者推荐id(如果填写推荐码 以填写为准)
  1033. fraId: this.fraId,
  1034. //加盟商id
  1035. channelId: this.channelId,
  1036. //渠道码
  1037. //预约参数信息
  1038. orderDate: orderData,
  1039. requireOrder: this.requireOrder,
  1040. traceId: this.traceId, //视频号
  1041. createOrderType: this.appType,
  1042. };
  1043. if (this.codeShow && !this.isNoMatch) {
  1044. orderInfo.recCode = this.recCode;
  1045. }
  1046. console.log(orderInfo);
  1047. util.request(api.OrderSubmit, orderInfo, 'POST').then((res) => {
  1048. //视频号,校验 wx.checkBeforeAddOrder
  1049. uni.checkBeforeAddOrder({
  1050. success(res) {
  1051. console.log('checkBeforeAddOrder-success:', res);
  1052. if (res.data.errcode == 0) {
  1053. that.setData({
  1054. traceId: res.data.traceId,
  1055. requireOrder: res.data.requireOrder
  1056. });
  1057. }
  1058. },
  1059. fail(res) {
  1060. console.log('checkBeforeAddOrder-fail:', res);
  1061. }
  1062. });
  1063. if (res.errno === 0) {
  1064. console.log(res.data.isNeedPay);
  1065. if (res.data.isNeedPay == false) {
  1066. console.log('跳过支付');
  1067. util.redirect('/pages/ucenter/order/order');
  1068. return;
  1069. }
  1070. // 下单成功,重置couponId
  1071. uni.setStorageSync('couponId', 0);
  1072. const orderId = res.data.orderId;
  1073. this.setData({
  1074. orderId: orderId
  1075. });
  1076. const grouponLinkId = res.data.grouponLinkId;
  1077. util.request(
  1078. api.OrderPrepay, {
  1079. orderId: orderId
  1080. },
  1081. 'POST'
  1082. ).then((res) => {
  1083. if (res.errno === 0) {
  1084. const payParam = res.data;
  1085. console.log('支付过程开始');
  1086. if (this.requireOrder == 1) {
  1087. //视频号支付
  1088. uni.requestOrderPayment({
  1089. timeStamp: payParam.timeStamp,
  1090. nonceStr: payParam.nonceStr,
  1091. package: payParam.packageValue,
  1092. signType: payParam.signType,
  1093. paySign: payParam.paySign,
  1094. success: (res) => {
  1095. console.log('支付过程成功');
  1096. if (grouponLinkId) {
  1097. setTimeout(() => {
  1098. uni.redirectTo({
  1099. url: '/pages/groupon/grouponDetail/grouponDetail?id=' +
  1100. grouponLinkId
  1101. });
  1102. }, 1000);
  1103. } else {
  1104. uni.redirectTo({
  1105. url: '/pages/checkout/payResult/payResult?status=1&orderId=' +
  1106. orderId + '&actualPrice=' +
  1107. this.actualPrice
  1108. });
  1109. }
  1110. },
  1111. fail: (res) => {
  1112. console.log('支付过程失败');
  1113. // wx.redirectTo({
  1114. // url: '/pages/checkout/payResult/payResult?status=0&orderId=' + orderId
  1115. // });
  1116. // 弹出支付失败
  1117. this.setData({
  1118. payFailShow: true,
  1119. remarkDisable: true
  1120. });
  1121. },
  1122. complete: function(res) {
  1123. console.log('支付过程结束');
  1124. }
  1125. });
  1126. } else {
  1127. uni.requestPayment({
  1128. timeStamp: payParam.timeStamp,
  1129. nonceStr: payParam.nonceStr,
  1130. package: payParam.packageValue,
  1131. signType: payParam.signType,
  1132. paySign: payParam.paySign,
  1133. success: (res) => {
  1134. console.log('支付过程成功');
  1135. if (grouponLinkId) {
  1136. setTimeout(() => {
  1137. uni.redirectTo({
  1138. url: '/pages/groupon/grouponDetail/grouponDetail?id=' +
  1139. grouponLinkId
  1140. });
  1141. }, 1000);
  1142. } else {
  1143. uni.redirectTo({
  1144. url: '/pages/checkout/payResult/payResult?status=1&orderId=' +
  1145. orderId + '&actualPrice=' +
  1146. this.actualPrice
  1147. });
  1148. }
  1149. },
  1150. fail: (res) => {
  1151. console.log('支付过程失败');
  1152. // 弹出支付失败
  1153. this.setData({
  1154. payFailShow: true,
  1155. remarkDisable: true
  1156. });
  1157. },
  1158. complete: function(res) {
  1159. console.log('支付过程结束');
  1160. }
  1161. });
  1162. }
  1163. } else {
  1164. // 弹出支付失败
  1165. this.setData({
  1166. payFailShow: true,
  1167. remarkDisable: true
  1168. });
  1169. // wx.redirectTo({
  1170. // url: '/pages/checkout/payResult/payResult?status=0&orderId=' + orderId
  1171. // });
  1172. }
  1173. });
  1174. } else {
  1175. uni.showToast({
  1176. title: res.errmsg,
  1177. icon: 'none'
  1178. });
  1179. // util.showErrorToast(res.errmsg);
  1180. }
  1181. });
  1182. },
  1183. surplusMonth: function(year) {
  1184. var date = new Date();
  1185. var year2 = date.getFullYear();
  1186. var month = date.getMonth() + 1;
  1187. var day = date.getDate();
  1188. var hour = date.getHours();
  1189. var minute = date.getMinutes();
  1190. var second = date.getSeconds();
  1191. var monthDatas = [];
  1192. if (year == year2) {
  1193. var surplusMonth = 12 - month;
  1194. monthDatas.push(month + '月');
  1195. for (var i = month; i < 12; i++) {
  1196. monthDatas.push(i + 1 + '月');
  1197. }
  1198. } else {
  1199. for (var i = 0; i < 12; i++) {
  1200. monthDatas.push(i + 1 + '月');
  1201. }
  1202. }
  1203. return monthDatas;
  1204. },
  1205. //天数计算
  1206. surplusDay: function(year, month, day) {
  1207. var days = 31;
  1208. var dayDatas = [];
  1209. var date = new Date();
  1210. var year2 = date.getFullYear();
  1211. var month2 = date.getMonth() + 1;
  1212. switch (parseInt(month)) {
  1213. case 1:
  1214. case 3:
  1215. case 5:
  1216. case 7:
  1217. case 8:
  1218. case 10:
  1219. case 12:
  1220. days = 31;
  1221. break;
  1222. //对于2月份需要判断是否为闰年
  1223. case 2:
  1224. if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
  1225. days = 29;
  1226. break;
  1227. } else {
  1228. days = 28;
  1229. break;
  1230. }
  1231. case 4:
  1232. case 6:
  1233. case 9:
  1234. case 11:
  1235. days = 30;
  1236. break;
  1237. }
  1238. if (year == year2 && month == month2) {
  1239. // dayDatas.push(day + "日")
  1240. for (var i = day; i < days; i++) {
  1241. dayDatas.push(i + 1 + '日');
  1242. }
  1243. } else {
  1244. console.log(month + '月' + days + '天');
  1245. for (var i = 0; i < days; i++) {
  1246. dayDatas.push(i + 1 + '日');
  1247. }
  1248. }
  1249. return dayDatas;
  1250. },
  1251. //时间计算
  1252. surplusHour: function(year, month, day, hour) {
  1253. var date = new Date();
  1254. var year2 = date.getFullYear();
  1255. var month2 = date.getMonth() + 1;
  1256. var day2 = date.getDate();
  1257. var hourEnd = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21];
  1258. var hours = [
  1259. ['09时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时'],
  1260. ['10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时']
  1261. ];
  1262. return hours;
  1263. },
  1264. varietiesChange: function(e) {
  1265. var Varieties = this.array[parseInt(e.detail.value)];
  1266. console.log(Varieties);
  1267. this.setData({
  1268. Varieties: Varieties
  1269. });
  1270. },
  1271. warehouseChange: function(e) {
  1272. var Warehouse = this.array[parseInt(e.detail.value)];
  1273. console.log(Warehouse);
  1274. this.setData({
  1275. Warehouse: Warehouse
  1276. });
  1277. },
  1278. //某一列的值改变时触发
  1279. bindMultiPickerColumnChange: function(e) {
  1280. var date = new Date();
  1281. var year1 = date.getFullYear();
  1282. var month1 = date.getMonth() + 1;
  1283. var day1 = date.getDate();
  1284. var hour1 = date.getHours();
  1285. console.log('当前月份' + this.month + '修改的列为', e.detail.column, ',值为', e.detail.value);
  1286. var data = {
  1287. multiArray: this.multiArray,
  1288. multiIndex: this.multiIndex,
  1289. year: this.year,
  1290. month: this.month,
  1291. day: this.day,
  1292. startHour: this.startHour,
  1293. endHour: this.startHour
  1294. };
  1295. data.multiIndex[e.detail.column] = e.detail.value;
  1296. switch (e.detail.column) {
  1297. case 0:
  1298. var yearStr = data.multiArray[e.detail.column][e.detail.value];
  1299. var year = yearStr.substring(0, yearStr.length - 1);
  1300. data.year = parseInt(year);
  1301. var surplusMonth = this.surplusMonth(year);
  1302. data.multiArray[1] = surplusMonth;
  1303. if (data.year == year1) {
  1304. data.month = month1;
  1305. } else {
  1306. data.month = 1;
  1307. }
  1308. if (data.year == year1 && month1 == data.month) {
  1309. data.day = day1;
  1310. } else {
  1311. data.day = 1;
  1312. }
  1313. var surplusDay = this.surplusDay(data.year, data.month, data.day);
  1314. data.multiArray[2] = surplusDay;
  1315. var surplusHour;
  1316. if (data.year == year1 && month1 == data.month && data.day == day1) {
  1317. surplusHour = this.surplusHour(data.year, data.month, data.day, hour1);
  1318. } else {
  1319. surplusHour = this.surplusHour(data.year, data.month, data.day, 1);
  1320. }
  1321. console.log(surplusHour);
  1322. data.multiArray[3] = surplusHour[0];
  1323. data.multiArray[5] = surplusHour[1];
  1324. data.startHour = surplusHour[0];
  1325. data.endHour = surplusHour[1];
  1326. data.multiIndex[1] = 0;
  1327. data.multiIndex[2] = 0;
  1328. data.multiIndex[3] = 0;
  1329. data.multiIndex[5] = 0;
  1330. break;
  1331. case 1:
  1332. console.log('选择月份' + data.multiArray[e.detail.column][e.detail.value]);
  1333. var monthStr = data.multiArray[e.detail.column][e.detail.value];
  1334. var month = monthStr.substring(0, monthStr.length - 1);
  1335. data.month = month;
  1336. data.day = 1;
  1337. if (data.year == year1 && month1 == data.month) {
  1338. data.day = day1;
  1339. } else {
  1340. data.day = 1;
  1341. }
  1342. var surplusDay = this.surplusDay(data.year, data.month, data.day);
  1343. data.multiArray[2] = surplusDay;
  1344. var surplusHour;
  1345. if (data.year == year1 && month1 == data.month && data.day == day1) {
  1346. surplusHour = this.surplusHour(data.year, data.month, data.day, hour1);
  1347. } else {
  1348. surplusHour = this.surplusHour(data.year, data.month, data.day, 1);
  1349. }
  1350. data.multiArray[3] = surplusHour[0];
  1351. data.multiArray[5] = surplusHour[1];
  1352. data.startHour = surplusHour[0];
  1353. data.endHour = surplusHour[1];
  1354. data.multiIndex[2] = 0;
  1355. data.multiIndex[3] = 0;
  1356. data.multiIndex[5] = 0;
  1357. break;
  1358. case 2:
  1359. console.log('选择日' + data.multiArray[e.detail.column][e.detail.value]);
  1360. var dayStr = data.multiArray[e.detail.column][e.detail.value];
  1361. var day = dayStr.substring(0, dayStr.length - 1);
  1362. data.day = day;
  1363. var surplusHour;
  1364. if (data.year == year1 && month1 == data.month && data.day == day1) {
  1365. surplusHour = this.surplusHour(data.year, data.month, data.day, hour1);
  1366. } else {
  1367. surplusHour = this.surplusHour(data.year, data.month, data.day, 1);
  1368. }
  1369. data.multiArray[3] = surplusHour[0];
  1370. data.multiArray[5] = surplusHour[1];
  1371. data.startHour = surplusHour[0];
  1372. data.endHour = surplusHour[1];
  1373. data.multiIndex[3] = 0;
  1374. data.multiIndex[5] = 0;
  1375. break;
  1376. case 3:
  1377. console.log('起始时间' + data.multiArray[e.detail.column][e.detail.value]);
  1378. var hourStr = data.multiArray[e.detail.column][e.detail.value];
  1379. var hour = hourStr.substring(0, hourStr.length - 1);
  1380. data.startHour = hour;
  1381. console.log('起始时间' + hour + ' day1:' + day1);
  1382. /*var endhours2 = [];
  1383. var end = ['09时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '20时'];
  1384. for (var i = e.detail.value; i < end.length; i++) {
  1385. endhours2.push(end[i]);
  1386. }
  1387. data.multiArray[5] = endhours2; */
  1388. if (e.detail.value > data.multiIndex[5]) {
  1389. data.multiIndex[5] = e.detail.value;
  1390. }
  1391. break;
  1392. case 5:
  1393. var hourStr = data.multiArray[e.detail.column][e.detail.value];
  1394. var hour = hourStr.substring(0, hourStr.length - 1);
  1395. data.endHour = hour;
  1396. if (e.detail.value < data.multiIndex[3]) {
  1397. data.multiIndex[3] = e.detail.value;
  1398. }
  1399. //console.log('index:'+data.multiIndex[3]+'value:'+e.detail.value+'结束时间' + data.multiArray[e.detail.column][e.detail.value]);
  1400. break;
  1401. }
  1402. this.setData(data);
  1403. },
  1404. //value 改变时触发 change 事件
  1405. bindMultiPickerChange: function(e) {
  1406. console.info(e);
  1407. console.info(this.multiArray);
  1408. console.info(this);
  1409. console.info(this.multiIndex);
  1410. var dateStr =
  1411. this.multiArray[0][this.multiIndex[0]] +
  1412. this.multiArray[1][this.multiIndex[1]] +
  1413. this.multiArray[2][this.multiIndex[2]] +
  1414. this.multiArray[3][this.multiIndex[3]] +
  1415. this.multiArray[4][this.multiIndex[4]] +
  1416. this.multiArray[5][this.multiIndex[5]];
  1417. console.log('picker发送选择改变,携带值为', dateStr);
  1418. this.setData({
  1419. orderData: dateStr
  1420. });
  1421. },
  1422. onClose() {
  1423. this.setData({
  1424. choosePopup: false,
  1425. remarkDisable: false
  1426. });
  1427. },
  1428. dateCheck(e) {
  1429. let index = e.currentTarget.dataset.index;
  1430. let date = e.currentTarget.dataset.date;
  1431. let week = e.currentTarget.dataset.week;
  1432. let isbook = e.currentTarget.dataset.isbook;
  1433. this.setData({
  1434. dateIndex: index,
  1435. });
  1436. let period = this.dateList[this.dateIndex].period;
  1437. let current = this.noonType == 1 ? '上午' : '下午';
  1438. let list = period.filter((item) => {
  1439. return item.ofTime == current;
  1440. });
  1441. let bookdate = this.dateList[this.dateIndex].bookdate
  1442. let weekOfDay = this.dateList[this.dateIndex].weekOfDay
  1443. console.info('dateCheck:' + weekOfDay);
  1444. this.setData({
  1445. timeList: list,
  1446. date: bookdate,
  1447. week: weekOfDay
  1448. });
  1449. let isNoTime = list.every((item) => {
  1450. return item.timeMsg && item.timeMsg != null;
  1451. });
  1452. if (isNoTime) {
  1453. this.setData({
  1454. timeIndex: -1,
  1455. selectTimeValue: ''
  1456. });
  1457. }
  1458. },
  1459. noonTab(e) {
  1460. let noon = e.currentTarget.dataset.noon;
  1461. this.setData({
  1462. timeIndex: -1,
  1463. noonType: noon,
  1464. selectTimeValue: ''
  1465. });
  1466. let period = this.dateList[this.dateIndex].period;
  1467. let current = this.noonType == 1 ? '上午' : '下午';
  1468. let list = period.filter((item) => {
  1469. return item.ofTime == current;
  1470. });
  1471. this.setData({
  1472. timeList: list
  1473. });
  1474. },
  1475. timeCheck(e) {
  1476. let index = e.currentTarget.dataset.index;
  1477. // let stock = e.currentTarget.dataset.stock;
  1478. let msg = e.currentTarget.dataset.msg;
  1479. let toastMsg = e.currentTarget.dataset.toastmsg;
  1480. if (msg == null || msg == '') {
  1481. let time = this.timeList[index].begin.split(':')[0];
  1482. let bookTime = this.timeList[index].begin + '-' + this.timeList[index].end
  1483. this.setData({
  1484. timeIndex: index,
  1485. selectTimeValue: Number(time),
  1486. time: bookTime
  1487. });
  1488. } else {
  1489. uni.showToast({
  1490. title: toastMsg,
  1491. icon: 'none'
  1492. })
  1493. }
  1494. },
  1495. weekCheck(e) {
  1496. let index = e.currentTarget.dataset.index;
  1497. let weekday = e.currentTarget.dataset.weekday;
  1498. console.log("weekday", weekday);
  1499. this.setData({
  1500. weekIndex: index,
  1501. weekday: weekday
  1502. // selectTimeIndex:'null'
  1503. });
  1504. },
  1505. timeSelect(e) {
  1506. let index = e.currentTarget.dataset.index;
  1507. let time = e.currentTarget.dataset.time;
  1508. console.log("this.selecttime", time);
  1509. if (this.activeTab) {
  1510. let weekList = this.weekArrList;
  1511. weekList.forEach((item) => {
  1512. item.num = 0;
  1513. });
  1514. this.setData({
  1515. weekArrList: weekList,
  1516. selectTimeIndex: index,
  1517. selecttime: time
  1518. });
  1519. console.log("this.selectTimeIndex", this.selectTimeIndex);
  1520. let itemData = 'weekArrList[' + this.weekIndex + '].num';
  1521. let selectedDateList = [];
  1522. let dateItem = {
  1523. week: this.weekIndex,
  1524. time: time,
  1525. weekStr: this.weekArrList[this.weekIndex].week
  1526. };
  1527. selectedDateList.push(dateItem);
  1528. this.setData({
  1529. // selectTimeIndex: index,
  1530. [itemData]: 1,
  1531. selectedWeekList: [this.weekIndex],
  1532. selectedDateList: selectedDateList
  1533. });
  1534. // console.log(this);
  1535. }
  1536. },
  1537. firstDateCheck(e) {
  1538. let index = e.currentTarget.dataset.index;
  1539. let firstdate = e.currentTarget.dataset.firstdate;
  1540. let firstweek = e.currentTarget.dataset.firstweek;
  1541. console.log("firstweek",firstweek+firstdate);
  1542. this.setData({
  1543. firstDateIndex: index,
  1544. firstdate:firstdate,
  1545. firstweek:firstweek
  1546. });
  1547. },
  1548. onTabChange(e) {
  1549. let weekList = this.weekArrList;
  1550. weekList.forEach((item) => {
  1551. item.num = 0;
  1552. });
  1553. console.log("e.detail.name", e.detail.name);
  1554. if (e.detail.name == '3') {
  1555. this.setData({
  1556. selectweek: '两周1次'
  1557. })
  1558. } else if (e.detail.name == '5') {
  1559. this.setData({
  1560. selectweek: '一月1次'
  1561. })
  1562. } else {
  1563. this.setData({
  1564. selectweek: '两月1次'
  1565. })
  1566. }
  1567. console.log("selectweek", this.selectweek);
  1568. this.setData({
  1569. weekArrList: weekList,
  1570. activeTab: e.detail.name,
  1571. selectTimeIndex: 'null',
  1572. selectedWeekList: [],
  1573. selectedDateList: []
  1574. });
  1575. },
  1576. showAppoint() {
  1577. if (this.addressId == 0) {
  1578. util.showErrorToast('请选择服务地址');
  1579. return;
  1580. }
  1581. this.setData({
  1582. activeTab: "3",
  1583. choosePopup: true,
  1584. remarkDisable: true,
  1585. popupType: this.popupType == 3 ? 2 : this.popupType,
  1586. isFinishAppoint: false
  1587. });
  1588. if (this.popupType == '1') {
  1589. this.getDayTime();
  1590. }
  1591. let that = this
  1592. },
  1593. confirmTime() {
  1594. console.log(this);
  1595. if (this.popupType == 1) {
  1596. if (this.timeIndex === '' || this.timeIndex < 0) {
  1597. uni.showToast({
  1598. title: '请选择服务时间',
  1599. icon: 'none',
  1600. duration: 2000
  1601. });
  1602. return false;
  1603. }
  1604. let date = this.dateList[this.dateIndex].bookdate;
  1605. let week = this.dateList[this.dateIndex].weekOfDay;
  1606. let time = this.timeList[this.timeIndex].begin + '-' + this.timeList[this.timeIndex].end;
  1607. console.log(week, time);
  1608. const date1 = new Date();
  1609. // 获取今天日期的毫秒数
  1610. const date2 = new Date(date);
  1611. // 计算两个日期的毫秒数差
  1612. const timeDifference = date2.getTime() - date1.getTime();
  1613. // 将毫秒数转换为天数(1天 = 24小时 * 60分钟 * 60秒 * 1000毫秒)
  1614. const daysDifference = Math.ceil(timeDifference / (1000 * 60 * 60 * 24));
  1615. // console.log(`两个日期相差 ${daysDifference} 天`);
  1616. this.setData({
  1617. oneTimeAppoint: date + ' ' + week + ' ' + time,
  1618. choosePopup: false,
  1619. remarkDisable: false,
  1620. isFinishAppoint: true,
  1621. daysDifference: daysDifference
  1622. });
  1623. } else if (this.popupType == 2) {
  1624. //这个0是瞎填的,只是为了不走这个if判断,后期可以删除
  1625. if (this.activeTab === 0) {
  1626. if (this.selectedDateList.length < 1) {
  1627. uni.showToast({
  1628. title: '请选择服务时间',
  1629. icon: 'none',
  1630. duration: 2000
  1631. });
  1632. } else if (this.selectedDateList.length == 1) {
  1633. uni.showToast({
  1634. title: '请选择第二次服务时间',
  1635. icon: 'none',
  1636. duration: 2000
  1637. });
  1638. } else {
  1639. // 选择频次
  1640. let futureDateList = util.getDateList(new Date(new Date().getTime() + 3600000 * 24), 1);
  1641. let minIndex = Math.min.apply(null, this.selectedWeekList);
  1642. console.log(minIndex);
  1643. console.log(this.weekArrList[minIndex].id);
  1644. let beginDate = futureDateList.filter((item) => {
  1645. return new Date(item.date).getDay() == this.weekArrList[minIndex].id;
  1646. });
  1647. console.log(beginDate);
  1648. let inter = 7;
  1649. let firstAppointList = util.getDateList(new Date(new Date(beginDate[0].date).getTime()),
  1650. inter);
  1651. this.setData({
  1652. popupType: 3,
  1653. firstAppointList: firstAppointList
  1654. });
  1655. }
  1656. } else {
  1657. if (this.selectedDateList.length == 0) {
  1658. uni.showToast({
  1659. title: '请选择服务时间',
  1660. icon: 'none',
  1661. duration: 2000
  1662. });
  1663. } else {
  1664. // 选择频次
  1665. let futureDateList = util.getDateList(new Date(new Date().getTime() + 3600000 * 24), 1);
  1666. let minIndex = Math.min.apply(null, this.selectedWeekList);
  1667. console.log(minIndex);
  1668. let beginDate = futureDateList.filter((item) => {
  1669. return new Date(item.date).getDay() == this.weekArrList[minIndex].id;
  1670. });
  1671. let inter = (this.activeTab == 3 ? 14 : this.activeTab == 5 ? util.getNextMonthDays(1) : util
  1672. .getNextMonthDays(1) + util.getNextMonthDays(2));
  1673. let firstAppointList = util.getDateList(new Date(new Date(beginDate[0].date).getTime()),
  1674. inter);
  1675. this.setData({
  1676. popupType: 3,
  1677. firstAppointList: firstAppointList
  1678. });
  1679. }
  1680. }
  1681. } else if (this.popupType == 3) {
  1682. let firstTime = this.firstAppointList[this.firstDateIndex].date;
  1683. console.log(firstTime);
  1684. console.log(this.selectedDateList);
  1685. this.setData({
  1686. choosePopup: false,
  1687. remarkDisable: false,
  1688. isFinishAppoint: true,
  1689. popupType: 2
  1690. });
  1691. }
  1692. },
  1693. orderAppoint() {
  1694. // 如果是多次卡先预估,单次卡不用预估
  1695. let weeks = [];
  1696. this.selectedDateList.forEach((item) => {
  1697. let obj = {
  1698. dayOfWeek: this.weekArrList[item.week].id,
  1699. startTime: item.time.split('-')[0],
  1700. endTime: item.time.split('-')[1]
  1701. };
  1702. weeks.push(obj);
  1703. });
  1704. let params = {
  1705. weeks: weeks,
  1706. type: this.activeTab,
  1707. startDate: this.firstAppointList[this.firstDateIndex].date,
  1708. lng: this.checkedAddress.lng,
  1709. lat: this.checkedAddress.lat,
  1710. shopId: this.checkedAddress.shopId,
  1711. goodId: this.checkedGoodsList[0].goodsId
  1712. };
  1713. uni.showLoading({
  1714. title: '加载中'
  1715. });
  1716. util.request(api.OrderAppoint, params, 'POST')
  1717. .then((res) => {
  1718. uni.hideLoading();
  1719. if (res.errno == 0) {
  1720. // this.orderPay(params);
  1721. this.setData({
  1722. choosePopup: false,
  1723. remarkDisable: false,
  1724. isFinishAppoint: true,
  1725. popupType: 2
  1726. });
  1727. } else {
  1728. uni.showToast({
  1729. title: res.errmsg,
  1730. icon: 'none',
  1731. duration: 2000
  1732. });
  1733. }
  1734. })
  1735. .catch(function(err) {
  1736. console.log(err);
  1737. uni.hideLoading();
  1738. uni.showToast({
  1739. title: err.errMsg,
  1740. icon: 'none'
  1741. });
  1742. });
  1743. },
  1744. cancelPay() {
  1745. this.setData({
  1746. payFailShow: false,
  1747. remarkDisable: false
  1748. });
  1749. uni.navigateBack({
  1750. delta: 1
  1751. });
  1752. },
  1753. rePay() {
  1754. uni.showLoading({
  1755. title: '支付中'
  1756. });
  1757. this.setData({
  1758. payFailShow: false,
  1759. remarkDisable: false
  1760. });
  1761. util.request(
  1762. api.OrderPrepay, {
  1763. orderId: this.orderId
  1764. },
  1765. 'POST'
  1766. )
  1767. .then((res) => {
  1768. if (res.errno === 0) {
  1769. const payParam = res.data;
  1770. console.log('支付过程开始');
  1771. uni.requestPayment({
  1772. timeStamp: payParam.timeStamp,
  1773. nonceStr: payParam.nonceStr,
  1774. package: payParam.packageValue,
  1775. signType: payParam.signType,
  1776. paySign: payParam.paySign,
  1777. success: (res) => {
  1778. console.log('支付过程成功');
  1779. uni.redirectTo({
  1780. url: '/pages/checkout/payResult/payResult?status=1&orderId=' +
  1781. this.orderId + '&actualPrice=' + this.actualPrice
  1782. });
  1783. },
  1784. fail: (res) => {
  1785. console.log('支付过程失败');
  1786. util.showErrorToast('支付失败');
  1787. },
  1788. complete: (res) => {
  1789. uni.hideLoading();
  1790. console.log('支付过程结束');
  1791. }
  1792. });
  1793. } else {
  1794. uni.hideLoading();
  1795. }
  1796. })
  1797. .catch((res) => {
  1798. uni.hideLoading();
  1799. });
  1800. },
  1801. goBuyMember() {
  1802. uni.navigateTo({
  1803. url: '/pages/member/buyMember/buyMember'
  1804. });
  1805. },
  1806. getDayStock() {
  1807. if (this.dateIndex < 0) {
  1808. return false;
  1809. }
  1810. let params = {
  1811. day: this.dateList[this.dateIndex].date,
  1812. goodsId: this.checkedGoodsList[0].goodsId,
  1813. lng: this.checkedAddress.lng,
  1814. lat: this.checkedAddress.lat,
  1815. productId: this.checkedGoodsList[0].product.id,
  1816. serviceDuration: this.serviceDuration
  1817. };
  1818. uni.showLoading({
  1819. title: '加载中'
  1820. });
  1821. util.request(api.EveryDayStock, params, 'GET')
  1822. .then((res) => {
  1823. uni.hideLoading();
  1824. if (res.errno == 0) {
  1825. this.setData({
  1826. timeList: res.data,
  1827. timeIndex: 0
  1828. });
  1829. } else {
  1830. uni.showToast({
  1831. title: res.errmsg,
  1832. icon: 'none',
  1833. duration: 2000
  1834. });
  1835. this.setData({
  1836. timeList: [],
  1837. timeIndex: ''
  1838. });
  1839. }
  1840. })
  1841. .catch(function(err) {
  1842. console.log(err);
  1843. uni.hideLoading();
  1844. uni.showToast({
  1845. title: err.errMsg,
  1846. icon: 'none',
  1847. duration: 2000
  1848. });
  1849. this.setData({
  1850. timeList: [],
  1851. timeIndex: ''
  1852. });
  1853. });
  1854. },
  1855. getDayTime() {
  1856. let params = {
  1857. days: 30,
  1858. productId: this.checkedGoodsList[0].productId,
  1859. serviceDuration: this.serviceDuration,
  1860. isPreOrder:this.isPreOrder,
  1861. addressId:this.checkedAddress.id
  1862. };
  1863. uni.showLoading({
  1864. title: '加载中'
  1865. });
  1866. util.request(api.everyDayTime, params, 'GET')
  1867. .then((res) => {
  1868. uni.hideLoading();
  1869. if (res.errno == 0) {
  1870. this.setData({
  1871. dateList: res.data,
  1872. dateIndex: 0,
  1873. timeIndex: -1,
  1874. noonType: 1
  1875. });
  1876. let period = res.data[0].period;
  1877. let list = period.filter((item) => {
  1878. return item.ofTime == '上午';
  1879. });
  1880. this.setData({
  1881. timeList: list
  1882. });
  1883. } else {
  1884. uni.showToast({
  1885. title: res.errmsg,
  1886. icon: 'none',
  1887. duration: 2000
  1888. });
  1889. this.setData({
  1890. timeList: [],
  1891. timeIndex: ''
  1892. });
  1893. }
  1894. })
  1895. .catch(function(err) {
  1896. console.log(err);
  1897. uni.hideLoading();
  1898. uni.showToast({
  1899. title: err.errMsg,
  1900. icon: 'none',
  1901. duration: 1000
  1902. });
  1903. this.setData({
  1904. timeList: [],
  1905. timeIndex: ''
  1906. });
  1907. });
  1908. },
  1909. //优先选择上一单服务者
  1910. chooseLastOrder(){
  1911. this.setData({
  1912. isPreOrder:!this.isPreOrder
  1913. })
  1914. console.log("isProOrder",this.isPreOrder);
  1915. }
  1916. }
  1917. };
  1918. </script>
  1919. <style>
  1920. page {
  1921. height: 100%;
  1922. background: #f4f4f4;
  1923. }
  1924. .container {
  1925. padding: 50rpx 28rpx 180rpx;
  1926. }
  1927. .address-box {
  1928. width: 100%;
  1929. border-radius: 20rpx;
  1930. }
  1931. .address-item {
  1932. display: flex;
  1933. background: #fff;
  1934. padding: 36rpx 16rpx 32rpx;
  1935. border-radius: 20rpx;
  1936. }
  1937. .address-item.address-empty {
  1938. line-height: 75rpx;
  1939. text-align: center;
  1940. }
  1941. .address-item .map-icon {
  1942. width: 28rpx;
  1943. height: 28rpx;
  1944. margin: 0 18rpx 0 0;
  1945. }
  1946. .address-box .l {
  1947. width: 125rpx;
  1948. height: 100%;
  1949. }
  1950. .address-box .l .name {
  1951. margin-left: 6.25rpx;
  1952. margin-top: -7.25rpx;
  1953. display: block;
  1954. width: 125rpx;
  1955. height: 43rpx;
  1956. line-height: 43rpx;
  1957. font-size: 30rpx;
  1958. color: #333;
  1959. margin-bottom: 5rpx;
  1960. }
  1961. .address-box .l .default {
  1962. margin-left: 6.25rpx;
  1963. display: block;
  1964. width: 62rpx;
  1965. height: 33rpx;
  1966. border-radius: 5rpx;
  1967. border: 1px solid #b4282d;
  1968. font-size: 20.5rpx;
  1969. text-align: center;
  1970. line-height: 29rpx;
  1971. color: #b4282d;
  1972. }
  1973. .address-box .m {
  1974. flex: 1;
  1975. }
  1976. .address-box .mobile {
  1977. display: block;
  1978. height: 29rpx;
  1979. line-height: 29rpx;
  1980. margin-bottom: 6.25rpx;
  1981. font-size: 26rpx;
  1982. }
  1983. .address-box .address {
  1984. display: block;
  1985. /* height: 30rpx; */
  1986. line-height: 30rpx;
  1987. font-size: 26rpx;
  1988. margin: 0 0 18rpx 0;
  1989. }
  1990. .address-bottom {
  1991. color: #85868a;
  1992. line-height: 24rpx;
  1993. height: 24rpx;
  1994. font-size: 22rpx;
  1995. }
  1996. .address-bottom .user-name {
  1997. margin: 0 32rpx 0 0;
  1998. }
  1999. .address-box .r {
  2000. width: 77rpx;
  2001. height: 77rpx;
  2002. display: flex;
  2003. justify-content: center;
  2004. align-items: center;
  2005. }
  2006. .address-box .r image {
  2007. width: 52.078rpx;
  2008. height: 52.078rpx;
  2009. }
  2010. .coupon-box {
  2011. width: 100%;
  2012. height: 210rpx;
  2013. background: #fff;
  2014. border-radius: 20rpx;
  2015. margin-top: 20rpx;
  2016. }
  2017. .coupon-box .coupon-item {
  2018. margin: 0 10rpx;
  2019. height: 70rpx;
  2020. overflow: hidden;
  2021. background: #fff;
  2022. display: flex;
  2023. padding: 0 20rpx 0 10rpx;
  2024. align-items: center;
  2025. justify-content: space-between;
  2026. border-bottom: 2rpx solid #e4e4e4;
  2027. color: #999;
  2028. }
  2029. .coupon-box .l {
  2030. flex: 1;
  2031. height: 70rpx;
  2032. display: flex;
  2033. align-items: center;
  2034. justify-content: space-between;
  2035. color: #999;
  2036. }
  2037. .coupon-box .l .name {
  2038. font-size: 24rpx;
  2039. }
  2040. .coupon-box .l .txt {
  2041. font-size: 24rpx;
  2042. }
  2043. .coupon-box .r {
  2044. width: 30rpx;
  2045. height: 40rpx;
  2046. display: flex;
  2047. justify-content: center;
  2048. align-items: center;
  2049. }
  2050. .coupon-box .r image {
  2051. width: 52.078rpx;
  2052. height: 52.078rpx;
  2053. }
  2054. .message-box {
  2055. margin-top: 20rpx;
  2056. width: 100%;
  2057. height: auto;
  2058. overflow: hidden;
  2059. background: #fff;
  2060. }
  2061. .message-box .message-item {
  2062. height: 86.078rpx;
  2063. overflow: hidden;
  2064. background: #fff;
  2065. display: flex;
  2066. margin-left: 31.25rpx;
  2067. padding-right: 31.25rpx;
  2068. }
  2069. .message-box .message-app {
  2070. height: 74.078rpx;
  2071. overflow: hidden;
  2072. background: #fff;
  2073. display: flex;
  2074. margin-left: 31.25rpx;
  2075. padding-right: 31.25rpx;
  2076. padding-top: 18rpx;
  2077. border-radius: 20rpx;
  2078. }
  2079. .order-box {
  2080. margin-top: 20rpx;
  2081. width: 100%;
  2082. height: auto;
  2083. overflow: hidden;
  2084. background: #fff;
  2085. border-radius: 20rpx !important;
  2086. }
  2087. .order-box .order-item {
  2088. height: 94rpx !important;
  2089. color: #999;
  2090. overflow: hidden;
  2091. background: #fff;
  2092. display: flex;
  2093. align-items: center;
  2094. justify-content: space-between;
  2095. padding: 0 20rpx;
  2096. border-bottom: 1px solid #d9d9d9;
  2097. }
  2098. .order-box .order-item.tip-item {
  2099. padding-bottom: 26rpx;
  2100. height: auto;
  2101. display: flex;
  2102. flex-direction: column;
  2103. }
  2104. .order-box .order-item .l {
  2105. width: 100rpx;
  2106. height: 70rpx;
  2107. line-height: 70rpx;
  2108. align-items: center;
  2109. }
  2110. .order-box .order-item .l .name {
  2111. font-size: 24rpx;
  2112. }
  2113. .order-box .order-item .r {
  2114. line-height: 70rpx;
  2115. flex: 1;
  2116. height: 70rpx;
  2117. line-height: 70rpx;
  2118. align-items: center;
  2119. text-align: right;
  2120. }
  2121. .order-box .order-item.no-border {
  2122. border-bottom: none;
  2123. }
  2124. .goods-items {
  2125. background: #fff;
  2126. border-radius: 20rpx;
  2127. padding: 20rpx 12rpx;
  2128. }
  2129. .goods-items .item {
  2130. height: 210rpx;
  2131. align-items: center;
  2132. }
  2133. .goods-items .item .name {
  2134. font-size: 28rpx;
  2135. line-height: 32rpx;
  2136. color: #2a2a2a;
  2137. }
  2138. .goods-items .item.no-border {
  2139. border-bottom: none;
  2140. }
  2141. .goods-items .item:last-child {
  2142. border-bottom: none;
  2143. }
  2144. .goods-items .img {
  2145. height: 178rpx;
  2146. width: 178rpx;
  2147. margin-right: 26rpx;
  2148. border-radius: 10rpx;
  2149. }
  2150. .goods-items .img image {
  2151. height: 178rpx;
  2152. width: 178rpx;
  2153. border-radius: 10rpx;
  2154. }
  2155. .goods-items .info {
  2156. flex: 1;
  2157. height: 210rpx;
  2158. padding: 14rpx 0 0;
  2159. }
  2160. .goods-items .t {
  2161. height: 33rpx;
  2162. line-height: 33rpx;
  2163. margin-bottom: 10rpx;
  2164. overflow: hidden;
  2165. font-size: 30rpx;
  2166. color: #333;
  2167. }
  2168. .goods-items .t .name {
  2169. display: block;
  2170. float: left;
  2171. }
  2172. .goods-items .t .number {
  2173. display: block;
  2174. float: right;
  2175. text-align: right;
  2176. }
  2177. .goods-items .m {
  2178. height: 28rpx;
  2179. overflow: hidden;
  2180. line-height: 28rpx;
  2181. margin-bottom: 16rpx;
  2182. font-size: 24rpx;
  2183. color: #85868a;
  2184. margin-top: 5rpx;
  2185. }
  2186. .goods-items .b {
  2187. height: 28rpx;
  2188. line-height: 28rpx;
  2189. font-size: 24rpx;
  2190. color: #85868a;
  2191. }
  2192. .order-total {
  2193. position: fixed;
  2194. left: 0;
  2195. bottom: 0;
  2196. height: 100rpx;
  2197. width: 100%;
  2198. display: flex;
  2199. }
  2200. .order-total .l {
  2201. flex: 1;
  2202. height: 100rpx;
  2203. line-height: 100rpx;
  2204. color: #b4282d;
  2205. background: #fff;
  2206. font-size: 33rpx;
  2207. padding-left: 31.25rpx;
  2208. border-top: 1rpx solid rgba(0, 0, 0, 0.2);
  2209. border-bottom: 1rpx solid rgba(0, 0, 0, 0.2);
  2210. }
  2211. .order-total .r {
  2212. width: 233rpx;
  2213. height: 100rpx;
  2214. background: #b4282d;
  2215. border: 1px solid #b4282d;
  2216. line-height: 100rpx;
  2217. text-align: center;
  2218. color: #fff;
  2219. font-size: 30rpx;
  2220. }
  2221. .actual-price {
  2222. color: #2a2a2a;
  2223. font-size: 32rpx;
  2224. text-align: right;
  2225. margin: 14rpx 0 0;
  2226. }
  2227. .actual-price text {
  2228. color: #df1717;
  2229. }
  2230. .coupon-price {
  2231. color: #FF4545;
  2232. font-size: 25rpx;
  2233. text-align: right;
  2234. margin: 52rpx 0 20rpx 0;
  2235. }
  2236. .go-pay-wrapper {
  2237. position: fixed;
  2238. bottom: 0;
  2239. left: 0;
  2240. right: 0;
  2241. height: 130rpx;
  2242. padding: 20rpx 24rpx;
  2243. /* background:#fff; */
  2244. }
  2245. view.go-pay-wrapper button>view {
  2246. color: #fff;
  2247. }
  2248. .appoint-time-block {
  2249. margin-top: 20rpx;
  2250. background: #fff;
  2251. border-radius: 20rpx;
  2252. }
  2253. .appoint-time-block view.appoint-time-operate {
  2254. background: #FFFFFF;
  2255. border-radius: 20rpx;
  2256. border: 2rpx solid #D77958;
  2257. padding: 20rpx 34rpx;
  2258. display: flex;
  2259. align-items: center;
  2260. justify-content: space-between;
  2261. font-size: 24rpx;
  2262. }
  2263. view.operate-left {
  2264. color: #999999;
  2265. }
  2266. view.operate-right {
  2267. display: flex;
  2268. align-items: center;
  2269. }
  2270. view.operate-right {
  2271. color: #d77958;
  2272. }
  2273. view.operate-right .not-select {
  2274. color: #333;
  2275. }
  2276. .appoint-time-show {
  2277. border-top: 2rpx solid #e4e4e4;
  2278. padding: 0 24rpx;
  2279. font-size: 24rpx;
  2280. }
  2281. view.one-time {
  2282. height: 70rpx;
  2283. display: flex;
  2284. align-items: center;
  2285. justify-content: space-between;
  2286. }
  2287. view.one-time text {
  2288. color: #999;
  2289. font-size: 26rpx;
  2290. }
  2291. .multi-times {
  2292. padding: 30rpx 0;
  2293. }
  2294. .multi-times-item {
  2295. height: 54rpx;
  2296. display: flex;
  2297. align-items: center;
  2298. justify-content: space-between;
  2299. }
  2300. .multi-times-item text {
  2301. font-weight: bold;
  2302. font-size: 24rpx;
  2303. }
  2304. view.appoint-result {
  2305. margin-top: 18rpx;
  2306. border: 2rpx solid #d77958;
  2307. border-radius: 20rpx;
  2308. line-height: 46rpx;
  2309. font-size: 26rpx;
  2310. padding: 10rpx;
  2311. }
  2312. .orange-font {
  2313. color: #fa6400;
  2314. font-weight: bold;
  2315. font-size: 26rpx;
  2316. }
  2317. .order-item .message-item {
  2318. color: #2a2a2a;
  2319. font-size: 24rpx;
  2320. font-weight: normal;
  2321. height: 70rpx;
  2322. }
  2323. /* 支付失败弹框 */
  2324. .overlay-wrapper {
  2325. display: flex;
  2326. align-items: center;
  2327. justify-content: center;
  2328. height: 100%;
  2329. }
  2330. .fail-wrapper {
  2331. width: 652rpx;
  2332. height: 580rpx;
  2333. border-radius: 22rpx;
  2334. background-color: #fff;
  2335. background-size: 100% 40%;
  2336. position: relative;
  2337. font-size: 24rpx;
  2338. display: flex;
  2339. flex-direction: column;
  2340. justify-content: space-between;
  2341. }
  2342. .fail-top {
  2343. display: flex;
  2344. flex-direction: column;
  2345. align-items: center;
  2346. }
  2347. .fail-text {
  2348. font-size: 34rpx;
  2349. font-weight: bold;
  2350. margin: 4rpx 0 40rpx;
  2351. height: 34rpx;
  2352. }
  2353. .fail-bottom {
  2354. height: 132rpx;
  2355. display: flex;
  2356. justify-content: space-around;
  2357. align-items: center;
  2358. }
  2359. .cancel-btn {
  2360. width: 250rpx;
  2361. height: 72rpx;
  2362. line-height: 72rpx;
  2363. border: 2rpx solid #85868a;
  2364. color: #282728;
  2365. border-radius: 72rpx;
  2366. text-align: center;
  2367. }
  2368. .repay-btn {
  2369. width: 250rpx;
  2370. height: 72rpx;
  2371. line-height: 72rpx;
  2372. /* background: #d77958; */
  2373. color: #d77958;
  2374. border-radius: 72rpx;
  2375. text-align: center;
  2376. border: 1rpx solid #d77958;
  2377. }
  2378. .discount-title {
  2379. height: 70rpx;
  2380. background: #feebd7;
  2381. padding: 0 10rpx;
  2382. display: flex;
  2383. align-items: center;
  2384. border-radius: 20rpx 20rpx 0rpx 0rpx;
  2385. }
  2386. .discount-title image {
  2387. width: 24rpx;
  2388. height: 26rpx;
  2389. margin: 0 8rpx 0 0;
  2390. }
  2391. .discount-title text {
  2392. font-size: 28rpx;
  2393. font-weight: bold;
  2394. color: #323232;
  2395. }
  2396. .discount-line {
  2397. padding: 0 50rpx 0 20rpx;
  2398. }
  2399. .discount-line .txt {
  2400. color: #df1717;
  2401. font-size: 24rpx;
  2402. }
  2403. .member-benefit,
  2404. .buy-member {
  2405. margin: 20rpx 0 0;
  2406. height: 70rpx;
  2407. background: #fff;
  2408. border-radius: 10rpx;
  2409. padding: 0 20rpx;
  2410. display: flex;
  2411. align-items: center;
  2412. justify-content: space-between;
  2413. }
  2414. .member-benefit .member-tip {
  2415. text-align: right;
  2416. }
  2417. .member-tag {
  2418. width: 142rpx;
  2419. padding: 0 10rpx;
  2420. height: 44rpx;
  2421. line-height: 44rpx;
  2422. text-align: center;
  2423. background: #2e3235;
  2424. border-radius: 5rpx;
  2425. }
  2426. .member-tag text {
  2427. font-size: 24rpx;
  2428. color: #2a2a2a;
  2429. background: linear-gradient(177deg, #f1e3c8 0%, #e6c162 100%);
  2430. -webkit-background-clip: text;
  2431. -webkit-text-fill-color: transparent;
  2432. }
  2433. .member-tip {
  2434. flex: 1;
  2435. margin: 0 0 0 26rpx;
  2436. color: #df1717;
  2437. font-size: 24rpx;
  2438. }
  2439. .stock-text {
  2440. font-size: 20rpx;
  2441. font-weight: normal;
  2442. color: #888;
  2443. }
  2444. .zero-stock {
  2445. color: #ccc;
  2446. }
  2447. .order-box.code-module {
  2448. border-radius: 10rpx;
  2449. padding: 8rpx 0;
  2450. }
  2451. .codeTips {
  2452. height: 52rpx;
  2453. line-height: 40rpx;
  2454. padding-bottom: 20rpx;
  2455. color: #d77958;
  2456. font-size: 26rpx;
  2457. text-align: right;
  2458. padding: 0 20rpx;
  2459. }
  2460. .codeTips.no-match {
  2461. color: #fa6400;
  2462. }
  2463. .plus-order {
  2464. margin-top: 20rpx;
  2465. width: 694rpx;
  2466. border-radius: 10rpx;
  2467. height: 100rpx;
  2468. display: flex;
  2469. padding: 0 20rpx;
  2470. background: #fff;
  2471. align-items: center;
  2472. }
  2473. .plus-order .plus-title {
  2474. color: #999;
  2475. }
  2476. .plus-order .plus-name {
  2477. flex: 1;
  2478. margin: 0 20rpx;
  2479. font-size: 30rpx;
  2480. color: #333;
  2481. }
  2482. .plus-name .plus-num {
  2483. color: #d77958;
  2484. font-size: 30rpx;
  2485. font-weight: bold;
  2486. }
  2487. .plus-amount {
  2488. color: #d77958;
  2489. font-size: 32rpx;
  2490. font-weight: bold;
  2491. }
  2492. .popup-title-new view {
  2493. color: #333;
  2494. font-size: 32rpx;
  2495. }
  2496. .popup-title-new view.fee-tips {
  2497. color: #ff5735;
  2498. font-size: 22rpx;
  2499. }
  2500. .time-select-right-item text {
  2501. color: #888;
  2502. }
  2503. .time-select-right .time-item-wrapper {
  2504. height: 836rpx;
  2505. overflow-y: scroll;
  2506. }
  2507. .time-line {
  2508. display: flex;
  2509. align-items: center;
  2510. justify-content: space-between;
  2511. width: 100%;
  2512. }
  2513. .time-select-right-item text.extra-tips {
  2514. color: #ff5735;
  2515. font-size: 22rpx;
  2516. }
  2517. .van-tab--active.van-tab>view.van-ellipsis {
  2518. color: #d77958;
  2519. }
  2520. .van-tab>view.van-ellipsis {
  2521. font-size: 36rpx;
  2522. color: #ABABAB;
  2523. font-family: AlibabaPuHuiTi_2_85_Bold;
  2524. }
  2525. .appoint-server{
  2526. border-radius: 18rpx;
  2527. background-color: #fff;
  2528. height: 80rpx;
  2529. line-height: 80rpx;
  2530. padding: 0 24rpx;
  2531. color: #999;
  2532. display: flex;
  2533. margin-top: 28rpx;
  2534. justify-content: space-between;
  2535. align-items: center;
  2536. }
  2537. .appoint-server .server-tip{
  2538. color: #999;
  2539. font-size: 26rpx;
  2540. flex: 1;
  2541. text-align: left;
  2542. }
  2543. .appoint-server .radio-img{
  2544. width: 26rpx;
  2545. height: 26rpx;
  2546. }
  2547. /* 时间弹窗相关 */
  2548. .week-select-left {
  2549. display: flex;
  2550. justify-content: space-around;
  2551. text-align: center;
  2552. }
  2553. .popup-wrapper view {
  2554. color: #888;
  2555. font-size: 30rpx;
  2556. }
  2557. .popup-content {
  2558. flex: 1;
  2559. }
  2560. .appointment-tips {
  2561. display: flex;
  2562. justify-content: space-between;
  2563. width: 178px;
  2564. /* margin: 170px auto 10px; */
  2565. position: absolute;
  2566. bottom: 54rpx;
  2567. left: calc(50% - 89px);
  2568. }
  2569. .appointment-tips1 {
  2570. position: absolute;
  2571. bottom: 120rpx;
  2572. }
  2573. .appointment-tips view span {
  2574. width: 20rpx;
  2575. height: 20rpx;
  2576. border-radius: 20rpx;
  2577. background-color: #feebd7;
  2578. display: inline-block;
  2579. margin-right: 10rpx;
  2580. }
  2581. .appointment-tips view .selected {
  2582. background-color: #d77958;
  2583. }
  2584. .appointment-tips view .no-appointment {
  2585. background-color: #ccc;
  2586. }
  2587. .appointment-tips view text {
  2588. color: #d77958;
  2589. font-size: 24rpx;
  2590. }
  2591. .time-select-bottom {
  2592. width: 100vw;
  2593. background-color: #feebd7;
  2594. height: 54rpx;
  2595. font-size: 22rpx !important;
  2596. color: #d77958 !important;
  2597. line-height: 54rpx;
  2598. padding-left: 30rpx;
  2599. position: absolute;
  2600. bottom: 0;
  2601. letter-spacing: 2rpx;
  2602. }
  2603. .time-select-bottom1 {
  2604. width: 100vw;
  2605. background-color: #feebd7;
  2606. height: 54rpx;
  2607. font-size: 22rpx !important;
  2608. color: #d77958 !important;
  2609. line-height: 54rpx;
  2610. padding-left: 30rpx;
  2611. position: absolute;
  2612. bottom: 55rpx;
  2613. }
  2614. .time-select-bottom2 {
  2615. width: 100vw;
  2616. background-color: #feebd7;
  2617. height: 54rpx;
  2618. font-size: 22rpx !important;
  2619. color: #d77958 !important;
  2620. line-height: 54rpx;
  2621. padding-left: 30rpx;
  2622. letter-spacing: 2rpx;
  2623. }
  2624. .time-select-left {
  2625. padding: 0 8rpx 0 20rpx;
  2626. width: 370rpx;
  2627. }
  2628. .time-select-right {
  2629. flex: 1;
  2630. display: flex;
  2631. justify-content: space-between;
  2632. }
  2633. .scroll-view_H {
  2634. white-space: nowrap;
  2635. /* 确保子元素在同一行内显示 */
  2636. overflow-x: scroll;
  2637. /* 允许横向滚动 */
  2638. }
  2639. .time-select-left-item {
  2640. height: 84rpx;
  2641. display: flex;
  2642. flex-direction: column;
  2643. padding: 4rpx 0;
  2644. width: 20vw;
  2645. justify-content: center;
  2646. align-items: center;
  2647. }
  2648. .date-line-wrapper {
  2649. display: flex;
  2650. flex-direction: column;
  2651. align-items: center;
  2652. }
  2653. .time-select-left-item .date-msg {
  2654. height: 36rpx;
  2655. line-height: 36rpx;
  2656. color: #292929;
  2657. font-size: 36rpx;
  2658. font-weight: bold;
  2659. }
  2660. .time-select-left-item .date-msg1 {
  2661. height: 36rpx;
  2662. line-height: 36rpx;
  2663. color: #292929;
  2664. font-size: 22rpx;
  2665. margin-top: 10rpx;
  2666. }
  2667. .time-select-left-item .date-msg.avail-date {
  2668. color: #999 !important;
  2669. font-weight: bold;
  2670. }
  2671. .time-select-left-item .date-msg1.avail-date {
  2672. color: #999 !important;
  2673. font-weight: bold;
  2674. }
  2675. .popup-wrapper .popup-content .current-date {
  2676. color: #d77958 !important;
  2677. /* font-weight: bold; */
  2678. }
  2679. view.popup-btn-wrapper {
  2680. margin: 10rpx auto;
  2681. /* padding: 24rpx; */
  2682. background-color: #d77958;
  2683. text-align: center;
  2684. width: 682rpx;
  2685. border-radius: 16rpx;
  2686. }
  2687. view.popup-btn-wrapper view {
  2688. color: #fff;
  2689. }
  2690. .time-select-middle {
  2691. background-color: #FCFCFC;
  2692. padding: 10rpx 0rpx;
  2693. height: 800rpx;
  2694. position: relative;
  2695. }
  2696. .noon-select {
  2697. width: 100%;
  2698. display: flex;
  2699. justify-content: center;
  2700. margin: 30rpx auto;
  2701. }
  2702. .noon-select .divider {
  2703. height: 40rpx;
  2704. width: 2rpx;
  2705. background-color: #e5e5e5;
  2706. }
  2707. .noon-select .noon-item {
  2708. text-align: center;
  2709. color: #979797;
  2710. font-size: 36rpx;
  2711. width: 49%;
  2712. }
  2713. .noon-itemactive-noon {
  2714. text-align: center;
  2715. color: #d77958 !important;
  2716. font-size: 36rpx !important;
  2717. width: 49%;
  2718. }
  2719. .popup-title-new.popup-title {
  2720. display: flex;
  2721. flex-direction: column;
  2722. font-size: 20px;
  2723. font-weight: bold;
  2724. text-align: left;
  2725. padding: 30rpx;
  2726. }
  2727. .popup-title-new view {
  2728. color: #000;
  2729. font-size: 40rpx;
  2730. font-weight: bold;
  2731. }
  2732. .popup-title-new view.fee-tips {
  2733. color: #d77958;
  2734. font-size: 22rpx;
  2735. }
  2736. .current-line {
  2737. width: 38rpx;
  2738. height: 6rpx;
  2739. background: #d77958;
  2740. border-radius: 3rpx;
  2741. margin: auto;
  2742. opacity: 1;
  2743. }
  2744. .current-line0 {
  2745. opacity: 0;
  2746. }
  2747. .current-time {
  2748. color: #fff !important;
  2749. font-family: AlibabaPuHuiTi_2_65_Medium;
  2750. line-height: 70rpx;
  2751. height: 70rpx;
  2752. background-color: #d77958;
  2753. border-radius: 8px;
  2754. font-size: 36rpx;
  2755. }
  2756. .time-item-wrapper {
  2757. display: flex;
  2758. width: 90vw;
  2759. justify-content: flex-start;
  2760. flex-wrap: wrap;
  2761. text-align: center;
  2762. gap: 20px;
  2763. margin: 10px auto;
  2764. }
  2765. .time-item-wrapper .time-msg {
  2766. width: 20%;
  2767. line-height: 70rpx;
  2768. height: 70rpx;
  2769. background-color: #feebd7;
  2770. border-radius: 8px;
  2771. font-size: 36rpx;
  2772. font-weight: bold;
  2773. }
  2774. .time-item-wrapper .avail-time {
  2775. width: 20%;
  2776. line-height: 70rpx;
  2777. height: 70rpx;
  2778. background-color: #CCCCCC;
  2779. border-radius: 8px;
  2780. font-size: 36rpx;
  2781. font-weight: bold;
  2782. }
  2783. .first-appoint-date-item {
  2784. height: 108rpx;
  2785. display: flex;
  2786. align-items: center;
  2787. padding: 0 0 0 240rpx;
  2788. font-family: AlibabaPuHuiTi_2_85_Bold;
  2789. }
  2790. .first-appoint-date-item view{
  2791. font-family: AlibabaPuHuiTi_2_85_Bold;
  2792. }
  2793. .first-time-selected {
  2794. margin: 0 0 0 60rpx;
  2795. }
  2796. .week-str {
  2797. font-family: AlibabaPuHuiTi_2_85_Bold;
  2798. font-size: 36rpx !important;
  2799. color: #C2C2C2 !important;
  2800. }
  2801. .time-select-right-item {
  2802. width: 45vw;
  2803. background-color: #feebd7;
  2804. text-align: center;
  2805. margin-bottom: 28rpx;
  2806. font-family: AlibabaPuHuiTi_2_65_Medium;
  2807. line-height: 70rpx;
  2808. height: 70rpx;
  2809. border-radius: 8px;
  2810. }
  2811. .time-select-right-a {
  2812. padding: 10rpx 24rpx;
  2813. display: flex;
  2814. flex-wrap: wrap;
  2815. justify-content: space-between;
  2816. align-content: flex-start;
  2817. }
  2818. .first-appoint-date-list{
  2819. background-color: #fafafa;
  2820. }
  2821. </style>