checkout.vue 76 KB

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