checkout.vue 76 KB

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