checkout.vue 75 KB

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