checkout.vue 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373
  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.addressId <= 0) {
  697. util.showErrorToast("请选择服务地址");
  698. return false;
  699. }
  700. if (this.timeIndex === '' || this.timeIndex < 0) {
  701. util.showErrorToast("请选择服务时间");
  702. return false;
  703. }
  704. // 检查是否已经预约
  705. // if (that.isNeedAppoint && !that.isFinishAppoint) {
  706. // that.setData({
  707. // tipShow: true,
  708. // tips: '请先预约服务时间'
  709. // });
  710. // return;
  711. // }
  712. // if (!that.isNeedAppoint && (that.mobile == null || that.mobile.length != 11)) {
  713. // that.setData({
  714. // tipShow: true,
  715. // tips: '为了更好地为您服务请填写正确的手机号码'
  716. // });
  717. // return;
  718. // }
  719. // #ifdef MP-TOUTIAO
  720. this.orderPrepay();
  721. // #endif
  722. // #ifdef MP-ALIPAY
  723. this.aliSubmit();
  724. // #endif
  725. },
  726. orderPrepay(){
  727. let that = this;
  728. uni.showLoading({
  729. title: '检测中'
  730. });
  731. util.request(api.OrderPrepay, {
  732. addressId: that.addressId,
  733. shopId: that.checkedAddress.shopId,
  734. cart: that.cartId,
  735. goodsId: that.goodsId,
  736. couponId: that.couponId,
  737. userCouponId: that.userCouponId,
  738. productId: that.productId,
  739. unitIncreaseNumber: that.unitIncreaseNumber,
  740. openId:that.openId
  741. })
  742. .then(function(res) {
  743. uni.hideLoading();
  744. if (res.errno === 0) {
  745. console.log(res);
  746. that.setData({
  747. skuList: res.data.skuList,
  748. payment: res.data.payment,
  749. callbackUrl: res.data.callbackUrl
  750. });
  751. that.submitInfo();
  752. util.addLog(1,2,13);
  753. } else {
  754. uni.showModal({
  755. title: '提醒',
  756. showCancel: false,
  757. content: res.errmsg
  758. });
  759. }
  760. })
  761. .catch((res) => {
  762. uni.hideLoading();
  763. util.showErrorToast(res.errmsg);
  764. });
  765. },
  766. aliSubmit(){
  767. let that = this;
  768. uni.showLoading({
  769. title: '加载中'
  770. });
  771. let date = this.dateList[this.dateIndex].bookdate;
  772. let week = this.dateList[this.dateIndex].weekOfDay;
  773. let time = this.timeList[this.timeIndex].begin + '-' + this.timeList[this.timeIndex].end;
  774. util.request(api.OrderSubmit, {
  775. addressId: that.addressId,
  776. shopId: that.checkedAddress.shopId,
  777. cart: that.cartId,
  778. goodsId: that.goodsId,
  779. couponId: that.couponId,
  780. userCouponId: that.userCouponId,
  781. productId: that.productId,
  782. unitIncreaseNumber: that.unitIncreaseNumber,
  783. openId:that.openId,
  784. orderDate: {
  785. type:0,
  786. weeks:[
  787. {
  788. dayOfWeek: (new Date(this.dateList[this.dateIndex].bookdate)).getDay(),
  789. startTime: time.split('-')[0],
  790. endTime: time.split('-')[1],
  791. }
  792. ],
  793. startDate: date,
  794. lng: this.checkedAddress.lng,
  795. lat: this.checkedAddress.lat,
  796. shopId: this.checkedAddress.shopId,
  797. goodId: this.goodsId,
  798. productId: this.productId,
  799. unitIncreaseNumber: this.unitIncreaseNumber,
  800. },
  801. }, 'POST')
  802. .then(res=> {
  803. if (res.errno === 0) {
  804. util.addLog(1,2,13);
  805. this.aliPrepay(res.data.orderId);
  806. } else {
  807. uni.showModal({
  808. title: '提醒',
  809. showCancel: false,
  810. content: res.errmsg
  811. });
  812. }
  813. })
  814. .catch((res) => {
  815. uni.hideLoading();
  816. util.showErrorToast(res.errmsg);
  817. });
  818. },
  819. aliPrepay(orderId){
  820. uni.showLoading({
  821. title: '加载中'
  822. });
  823. let that=this;
  824. util.request(api.aliPrepay, {
  825. orderId:orderId
  826. }).then(res=> {
  827. if (res.errno === 0) {
  828. //是否跳转新支付结果页面
  829. let goNewPage=res.data.goNewPage;
  830. let tradeNo=res.data.payment.tradeNo;
  831. let outOrderNo=res.data.payment.outTradeNo;
  832. my.tradePay({
  833. tradeNO:tradeNo,
  834. success: (payres) => {
  835. uni.hideLoading();
  836. uni.hideLoading();
  837. console.log('ali调起支付成功');
  838. console.log(payres);
  839. let resultCode=payres.resultCode;
  840. if(resultCode=='9000'){
  841. util.addLog(1,2,15,{
  842. goodsId: this.goodsId,
  843. productId:this.productId
  844. });
  845. //如果是静默状态未登录 开始授权登录
  846. if (!app.globalData.hasLogin) {
  847. user.getLoginInfo(outOrderNo).then((resUser) => {
  848. if (resUser.errno == 0) {
  849. app.globalData.hasLogin = true;
  850. app.globalData.userInfo = resUser.data.userInfo;
  851. uni.setStorageSync('userInfo', resUser.data.userInfo);
  852. uni.setStorageSync('token', resUser.data.token);
  853. }
  854. });
  855. }
  856. if(goNewPage){
  857. uni.redirectTo({
  858. url: '/pages/checkout/payResult/payResultNew?status=1&outOrderNo=' + outOrderNo + '&actualPrice=' + that.actualPrice+'&goodsId='+that.id+'&productId='+that.productId
  859. });
  860. }else{
  861. uni.redirectTo({
  862. url: '/pages/checkout/payResult/payResult?status=1&outOrderNo=' + outOrderNo + '&actualPrice=' + that.actualPrice+'&goodsId='+that.id
  863. });
  864. }
  865. }else{
  866. util.addLog(1,2,14,{
  867. goodsId: this.goodsId,
  868. productId:this.productId
  869. });
  870. // that.setData({
  871. // payFailShow: true
  872. // });
  873. uni.showModal({
  874. title: '提示',
  875. content: "未支付成功,"+payres.memo,
  876. showCancel: false,
  877. success:function(modalres){
  878. if(modalres.confirm){
  879. uni.navigateTo({
  880. url: '/pages/ucenter/orderDetail/orderDetailPay?id=' + outOrderNo
  881. });
  882. }
  883. }
  884. });
  885. }
  886. },
  887. fail: (failres) => {
  888. console.log(failres);
  889. uni.hideLoading();
  890. }
  891. });
  892. } else {
  893. uni.hideLoading();
  894. uni.showModal({
  895. title: '提醒',
  896. showCancel: false,
  897. content: res.errmsg
  898. });
  899. }
  900. })
  901. .catch((res) => {
  902. uni.hideLoading();
  903. util.showErrorToast(res.errmsg);
  904. });
  905. },
  906. submitInfoOld() {
  907. console.info('submitInfo');
  908. // 如果是多次卡先预估,单次卡不用预估
  909. if (!this.isOneAppoint) {
  910. let weeks = [];
  911. this.selectedDateList.forEach((item) => {
  912. let obj = {
  913. dayOfWeek: this.weekArrList[item.week].id,
  914. startTime: item.time.split('-')[0],
  915. endTime: item.time.split('-')[1]
  916. };
  917. weeks.push(obj);
  918. });
  919. let tempStartDate = null;
  920. if (this.firstAppointList.length != 0 && this.firstAppointList.length >= this.firstDateIndex) {
  921. tempStartDate = this.firstAppointList[this.firstDateIndex].date;
  922. }
  923. let params = {
  924. weeks: weeks,
  925. type: this.activeTab,
  926. startDate: tempStartDate,
  927. //this.data.firstAppointList[this.data.firstDateIndex].date,
  928. lng: this.checkedAddress.lng,
  929. lat: this.checkedAddress.lat,
  930. shopId: this.checkedAddress.shopId,
  931. goodId: this.goodsId
  932. };
  933. console.log(params);
  934. this.orderPay(params);
  935. } else {
  936. let weeks = [];
  937. if (this.isNeedAppoint) {
  938. weeks = [{
  939. dayOfWeek: this.dateList[this.dateIndex].id,
  940. startTime: this.timeList[this.timeIndex].time.split('-')[0],
  941. endTime: this.timeList[this.timeIndex].time.split('-')[1]
  942. }];
  943. }
  944. let params = {
  945. weeks: weeks,
  946. type: 0,
  947. startDate: this.dateList[this.dateIndex].date,
  948. lng: this.checkedAddress.lng,
  949. lat: this.checkedAddress.lat,
  950. shopId: this.checkedAddress.shopId,
  951. goodId: this.goodsId
  952. };
  953. console.log(params);
  954. this.orderPay(params);
  955. }
  956. },
  957. submitInfo() {
  958. let date = this.dateList[this.dateIndex].bookdate;
  959. let week = this.dateList[this.dateIndex].weekOfDay;
  960. let time = this.timeList[this.timeIndex].begin + '-' + this.timeList[this.timeIndex].end;
  961. let params = {
  962. weeks: [{
  963. dayOfWeek: (new Date(this.dateList[this.dateIndex].bookdate)).getDay(),
  964. startTime: time.split('-')[0],
  965. endTime: time.split('-')[1],
  966. }],
  967. type: 0,
  968. startDate: date,
  969. lng: this.checkedAddress.lng,
  970. lat: this.checkedAddress.lat,
  971. shopId: this.checkedAddress.shopId,
  972. goodId: this.goodsId,
  973. productId: this.productId,
  974. unitIncreaseNumber: this.unitIncreaseNumber,
  975. };
  976. console.log(params);
  977. this.orderPay(params);
  978. },
  979. orderPay(orderData) {
  980. util.addLog(1,2,13,{
  981. goodsId: this.goodsId,
  982. productId:this.productId
  983. });
  984. var callbackData = {
  985. cartId: this.cartId,
  986. addressId: this.addressId,
  987. couponId: this.couponId,
  988. userCouponId: this.userCouponId,
  989. message: this.message,
  990. shareId: this.shareId,
  991. //预约参数信息
  992. orderDate: orderData,
  993. userId: this.userInfo ? this.userInfo.id : '',
  994. // phone_num: this.mobile,
  995. city: this.city
  996. };
  997. if (this.codeShow && !this.isNoMatch) {
  998. callbackData.recCode = this.recCode;
  999. }
  1000. let params = {
  1001. skuList: this.skuList,
  1002. payment: this.payment,
  1003. callbackData: callbackData,
  1004. callbackUrl: this.callbackUrl
  1005. };
  1006. console.log(params);
  1007. uni.showLoading({
  1008. title: '加载中'
  1009. });
  1010. uni.createOrder({
  1011. skuList: this.skuList,
  1012. payment: this.payment,
  1013. callbackData: callbackData,
  1014. callbackUrl: this.callbackUrl,
  1015. success: (res) => {
  1016. util.addLog(1,2,15,{
  1017. goodsId: this.goodsId,
  1018. productId:this.productId
  1019. });
  1020. uni.hideLoading();
  1021. console.log('预下单成功11');
  1022. console.log(res);
  1023. const {
  1024. orderId,
  1025. outOrderNo
  1026. } = res;
  1027. console.log('success res', res);
  1028. console.log('orderId', orderId, 'outOrderNo', outOrderNo);
  1029. this.setData({
  1030. orderId,
  1031. outOrderNo
  1032. });
  1033. console.log(this);
  1034. //如果是静默状态未登录 开始授权登录
  1035. if (!app.globalData.hasLogin) {
  1036. user.getLoginInfo(outOrderNo).then((resUser) => {
  1037. console.log(resUser);
  1038. if (resUser.errno == 0) {
  1039. console.log("支付成功后1111",resUser);
  1040. app.globalData.hasLogin = true;
  1041. app.globalData.userInfo = resUser.data.userInfo;
  1042. uni.setStorageSync('userInfo', resUser.data.userInfo);
  1043. uni.setStorageSync('token', resUser.data.token);
  1044. }
  1045. });
  1046. }
  1047. uni.redirectTo({
  1048. url: '/pages/checkout/payResult/payResult?status=1&outOrderNo=' +
  1049. outOrderNo + '&actualPrice=' + this.actualPrice
  1050. });
  1051. },
  1052. fail: (res) => {
  1053. util.addLog(1,2,14,{
  1054. goodsId: this.goodsId,
  1055. productId:this.productId
  1056. });
  1057. uni.hideLoading();
  1058. console.log('预下单失败11');
  1059. console.log('params', params);
  1060. console.log(res);
  1061. const {
  1062. orderId,
  1063. outOrderNo,
  1064. errNo,
  1065. errMsg,
  1066. errLogId
  1067. } = res;
  1068. if (errLogId) {
  1069. console.log('预下单失败', errNo, errMsg, errLogId);
  1070. let tomsg = errMsg;
  1071. if (tomsg.indexOf('createOrder') != -1) {
  1072. tomsg = tomsg.replace('createOrder:fail 开发者限购:', '');
  1073. tomsg = tomsg.replace('createOrder:fail 开发者拒绝交易:', '');
  1074. tomsg = tomsg.replace('createOrder:fail', '');
  1075. }
  1076. uni.showModal({
  1077. title: '提示',
  1078. content: tomsg,
  1079. showCancel: false,
  1080. success(res) {}
  1081. });
  1082. }
  1083. if (orderId || outOrderNo) {
  1084. this.setData({
  1085. orderId,
  1086. outOrderNo
  1087. });
  1088. console.log('支付失败', errNo, errMsg, orderId, outOrderNo);
  1089. this.setData({
  1090. payFailShow: true
  1091. });
  1092. // uni.navigateTo({
  1093. // url: '/pages/ucenter/orderDetail/orderDetailPay?id=' + outOrderNo
  1094. // });
  1095. }
  1096. console.log(errNo, errMsg);
  1097. }
  1098. });
  1099. },
  1100. surplusMonth: function(year) {
  1101. var date = new Date();
  1102. var year2 = date.getFullYear();
  1103. var month = date.getMonth() + 1;
  1104. var day = date.getDate();
  1105. var hour = date.getHours();
  1106. var minute = date.getMinutes();
  1107. var second = date.getSeconds();
  1108. var monthDatas = [];
  1109. if (year == year2) {
  1110. var surplusMonth = 12 - month;
  1111. monthDatas.push(month + '月');
  1112. for (var i = month; i < 12; i++) {
  1113. monthDatas.push(i + 1 + '月');
  1114. }
  1115. } else {
  1116. for (var i = 0; i < 12; i++) {
  1117. monthDatas.push(i + 1 + '月');
  1118. }
  1119. }
  1120. return monthDatas;
  1121. },
  1122. //天数计算
  1123. surplusDay: function(year, month, day) {
  1124. var days = 31;
  1125. var dayDatas = [];
  1126. var date = new Date();
  1127. var year2 = date.getFullYear();
  1128. var month2 = date.getMonth() + 1;
  1129. switch (parseInt(month)) {
  1130. case 1:
  1131. case 3:
  1132. case 5:
  1133. case 7:
  1134. case 8:
  1135. case 10:
  1136. case 12:
  1137. days = 31;
  1138. break;
  1139. //对于2月份需要判断是否为闰年
  1140. case 2:
  1141. if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
  1142. days = 29;
  1143. break;
  1144. } else {
  1145. days = 28;
  1146. break;
  1147. }
  1148. case 4:
  1149. case 6:
  1150. case 9:
  1151. case 11:
  1152. days = 30;
  1153. break;
  1154. }
  1155. if (year == year2 && month == month2) {
  1156. // dayDatas.push(day + "日")
  1157. for (var i = day; i < days; i++) {
  1158. dayDatas.push(i + 1 + '日');
  1159. }
  1160. } else {
  1161. console.log(month + '月' + days + '天');
  1162. for (var i = 0; i < days; i++) {
  1163. dayDatas.push(i + 1 + '日');
  1164. }
  1165. }
  1166. return dayDatas;
  1167. },
  1168. //时间计算
  1169. surplusHour: function(year, month, day, hour) {
  1170. var date = new Date();
  1171. var year2 = date.getFullYear();
  1172. var month2 = date.getMonth() + 1;
  1173. var day2 = date.getDate();
  1174. var hourEnd = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21];
  1175. var hours = [
  1176. ['09时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时'],
  1177. ['10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时']
  1178. ];
  1179. return hours;
  1180. },
  1181. varietiesChange: function(e) {
  1182. var Varieties = this.array[parseInt(e.detail.value)];
  1183. console.log(Varieties);
  1184. this.setData({
  1185. Varieties: Varieties
  1186. });
  1187. },
  1188. warehouseChange: function(e) {
  1189. var Warehouse = this.array[parseInt(e.detail.value)];
  1190. console.log(Warehouse);
  1191. this.setData({
  1192. Warehouse: Warehouse
  1193. });
  1194. },
  1195. //某一列的值改变时触发
  1196. bindMultiPickerColumnChange: function(e) {
  1197. var date = new Date();
  1198. var year1 = date.getFullYear();
  1199. var month1 = date.getMonth() + 1;
  1200. var day1 = date.getDate();
  1201. var hour1 = date.getHours();
  1202. console.log('当前月份' + this.month + '修改的列为', e.detail.column, ',值为', e.detail.value);
  1203. var data = {
  1204. multiArray: this.multiArray,
  1205. multiIndex: this.multiIndex,
  1206. year: this.year,
  1207. month: this.month,
  1208. day: this.day,
  1209. startHour: this.startHour,
  1210. endHour: this.startHour
  1211. };
  1212. data.multiIndex[e.detail.column] = e.detail.value;
  1213. switch (e.detail.column) {
  1214. case 0:
  1215. var yearStr = data.multiArray[e.detail.column][e.detail.value];
  1216. var year = yearStr.substring(0, yearStr.length - 1);
  1217. data.year = parseInt(year);
  1218. var surplusMonth = this.surplusMonth(year);
  1219. data.multiArray[1] = surplusMonth;
  1220. if (data.year == year1) {
  1221. data.month = month1;
  1222. } else {
  1223. data.month = 1;
  1224. }
  1225. if (data.year == year1 && month1 == data.month) {
  1226. data.day = day1;
  1227. } else {
  1228. data.day = 1;
  1229. }
  1230. var surplusDay = this.surplusDay(data.year, data.month, data.day);
  1231. data.multiArray[2] = surplusDay;
  1232. var surplusHour;
  1233. if (data.year == year1 && month1 == data.month && data.day == day1) {
  1234. surplusHour = this.surplusHour(data.year, data.month, data.day, hour1);
  1235. } else {
  1236. surplusHour = this.surplusHour(data.year, data.month, data.day, 1);
  1237. }
  1238. console.log(surplusHour);
  1239. data.multiArray[3] = surplusHour[0];
  1240. data.multiArray[5] = surplusHour[1];
  1241. data.startHour = surplusHour[0];
  1242. data.endHour = surplusHour[1];
  1243. data.multiIndex[1] = 0;
  1244. data.multiIndex[2] = 0;
  1245. data.multiIndex[3] = 0;
  1246. data.multiIndex[5] = 0;
  1247. break;
  1248. case 1:
  1249. console.log('选择月份' + data.multiArray[e.detail.column][e.detail.value]);
  1250. var monthStr = data.multiArray[e.detail.column][e.detail.value];
  1251. var month = monthStr.substring(0, monthStr.length - 1);
  1252. data.month = month;
  1253. data.day = 1;
  1254. if (data.year == year1 && month1 == data.month) {
  1255. data.day = day1;
  1256. } else {
  1257. data.day = 1;
  1258. }
  1259. var surplusDay = this.surplusDay(data.year, data.month, data.day);
  1260. data.multiArray[2] = surplusDay;
  1261. var surplusHour;
  1262. if (data.year == year1 && month1 == data.month && data.day == day1) {
  1263. surplusHour = this.surplusHour(data.year, data.month, data.day, hour1);
  1264. } else {
  1265. surplusHour = this.surplusHour(data.year, data.month, data.day, 1);
  1266. }
  1267. data.multiArray[3] = surplusHour[0];
  1268. data.multiArray[5] = surplusHour[1];
  1269. data.startHour = surplusHour[0];
  1270. data.endHour = surplusHour[1];
  1271. data.multiIndex[2] = 0;
  1272. data.multiIndex[3] = 0;
  1273. data.multiIndex[5] = 0;
  1274. break;
  1275. case 2:
  1276. console.log('选择日' + data.multiArray[e.detail.column][e.detail.value]);
  1277. var dayStr = data.multiArray[e.detail.column][e.detail.value];
  1278. var day = dayStr.substring(0, dayStr.length - 1);
  1279. data.day = day;
  1280. var surplusHour;
  1281. if (data.year == year1 && month1 == data.month && data.day == day1) {
  1282. surplusHour = this.surplusHour(data.year, data.month, data.day, hour1);
  1283. } else {
  1284. surplusHour = this.surplusHour(data.year, data.month, data.day, 1);
  1285. }
  1286. data.multiArray[3] = surplusHour[0];
  1287. data.multiArray[5] = surplusHour[1];
  1288. data.startHour = surplusHour[0];
  1289. data.endHour = surplusHour[1];
  1290. data.multiIndex[3] = 0;
  1291. data.multiIndex[5] = 0;
  1292. break;
  1293. case 3:
  1294. console.log('起始时间' + data.multiArray[e.detail.column][e.detail.value]);
  1295. var hourStr = data.multiArray[e.detail.column][e.detail.value];
  1296. var hour = hourStr.substring(0, hourStr.length - 1);
  1297. data.startHour = hour;
  1298. console.log('起始时间' + hour + ' day1:' + day1);
  1299. /*var endhours2 = [];
  1300. var end = ['09时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '20时'];
  1301. for (var i = e.detail.value; i < end.length; i++) {
  1302. endhours2.push(end[i]);
  1303. }
  1304. data.multiArray[5] = endhours2; */
  1305. if (e.detail.value > data.multiIndex[5]) {
  1306. data.multiIndex[5] = e.detail.value;
  1307. }
  1308. break;
  1309. case 5:
  1310. var hourStr = data.multiArray[e.detail.column][e.detail.value];
  1311. var hour = hourStr.substring(0, hourStr.length - 1);
  1312. data.endHour = hour;
  1313. if (e.detail.value < data.multiIndex[3]) {
  1314. data.multiIndex[3] = e.detail.value;
  1315. }
  1316. //console.log('index:'+data.multiIndex[3]+'value:'+e.detail.value+'结束时间' + data.multiArray[e.detail.column][e.detail.value]);
  1317. break;
  1318. }
  1319. this.setData(data);
  1320. },
  1321. //value 改变时触发 change 事件
  1322. bindMultiPickerChange: function(e) {
  1323. console.info(e);
  1324. console.info(this.multiArray);
  1325. console.info(this);
  1326. console.info(this.multiIndex);
  1327. var dateStr =
  1328. this.multiArray[0][this.multiIndex[0]] +
  1329. this.multiArray[1][this.multiIndex[1]] +
  1330. this.multiArray[2][this.multiIndex[2]] +
  1331. this.multiArray[3][this.multiIndex[3]] +
  1332. this.multiArray[4][this.multiIndex[4]] +
  1333. this.multiArray[5][this.multiIndex[5]];
  1334. console.log('picker发送选择改变,携带值为', dateStr);
  1335. this.setData({
  1336. orderData: dateStr
  1337. });
  1338. },
  1339. onClose() {
  1340. this.setData({
  1341. choosePopup: false
  1342. //remarkDisable: false,
  1343. });
  1344. },
  1345. dateCheck(e) {
  1346. let index = e.currentTarget.dataset.index;
  1347. let date = e.currentTarget.dataset.date;
  1348. let week = e.currentTarget.dataset.week;
  1349. let isbook = e.currentTarget.dataset.isbook;
  1350. this.setData({
  1351. dateIndex: index
  1352. });
  1353. let period = this.dateList[this.dateIndex].period;
  1354. let current = (this.noonType == 1 ? '上午' : '下午');
  1355. let list = period.filter(item => {
  1356. return item.ofTime == current;
  1357. });
  1358. this.setData({
  1359. timeList: list
  1360. });
  1361. let isNoTime = list.every(item => {
  1362. return item.timeMsg && item.timeMsg != null;
  1363. });
  1364. if (isNoTime) {
  1365. this.setData({
  1366. timeIndex: -1,
  1367. selectTimeValue: ''
  1368. });
  1369. }
  1370. },
  1371. timeCheck(e) {
  1372. let index = e.currentTarget.dataset.index;
  1373. let msg = e.currentTarget.dataset.msg;
  1374. if (msg == null || msg == '') {
  1375. let time = (this.timeList[index].begin).split(':')[0];
  1376. this.setData({
  1377. timeIndex: index,
  1378. selectTimeValue: Number(time)
  1379. });
  1380. }
  1381. },
  1382. weekCheck(e) {
  1383. let index = e.currentTarget.dataset.index;
  1384. this.setData({
  1385. weekIndex: index
  1386. // selectTimeIndex:'null'
  1387. });
  1388. },
  1389. timeSelect(e) {
  1390. let index = e.currentTarget.dataset.index;
  1391. let time = e.currentTarget.dataset.time;
  1392. if (this.activeTab != 2) {
  1393. let weekList = this.weekArrList;
  1394. weekList.forEach((item) => {
  1395. item.num = 0;
  1396. });
  1397. this.setData({
  1398. weekArrList: weekList
  1399. });
  1400. let itemData = 'weekArrList[' + this.weekIndex + '].num';
  1401. let selectedDateList = [];
  1402. let dateItem = {
  1403. week: this.weekIndex,
  1404. time: time,
  1405. weekStr: this.weekArrList[this.weekIndex].week
  1406. };
  1407. selectedDateList.push(dateItem);
  1408. console.log(this);
  1409. this.setData({
  1410. selectTimeIndex: index,
  1411. [itemData]: 1,
  1412. selectedWeekList: [this.weekIndex],
  1413. selectedDateList: selectedDateList
  1414. });
  1415. console.log(this);
  1416. } else {
  1417. // 如果选中的时间段小于2个
  1418. if (this.selectedDateList.length < 2) {
  1419. let itemData = 'weekArrList[' + this.weekIndex + '].num';
  1420. let num = this.weekArrList[this.weekIndex].num;
  1421. let selectedDateList = this.selectedDateList;
  1422. selectedDateList.push({
  1423. week: this.weekIndex,
  1424. time: time,
  1425. weekStr: this.weekArrList[this.weekIndex].week
  1426. });
  1427. let selectedWeekList = this.selectedWeekList;
  1428. if (selectedWeekList.indexOf(this.weekIndex) == -1) {
  1429. selectedWeekList.push(this.weekIndex);
  1430. }
  1431. this.setData({
  1432. [itemData]: num + 1,
  1433. selectTimeIndex: index,
  1434. // selectedWeekList:selectedWeekList,
  1435. selectedWeekList: [this.weekIndex],
  1436. selectedDateList: selectedDateList
  1437. });
  1438. } else {
  1439. // 删除第一个
  1440. let firstTimeSelected = this.selectedDateList[0];
  1441. let firstWeekSelectedIndex = firstTimeSelected.week;
  1442. // let firstWeekSelected=this.data.weekArrList[firstWeekSelectedIndex];
  1443. let itemDataDel = 'weekArrList[' + firstWeekSelectedIndex + '].num';
  1444. let numDel = this.weekArrList[firstWeekSelectedIndex].num;
  1445. let selectedDateListDel = this.selectedDateList;
  1446. selectedDateListDel.shift();
  1447. this.setData({
  1448. [itemDataDel]: numDel - 1,
  1449. // selectTimeIndex:index,
  1450. selectedDateList: selectedDateListDel
  1451. });
  1452. // 加入新选中的
  1453. let itemData = 'weekArrList[' + this.weekIndex + '].num';
  1454. let num = this.weekArrList[this.weekIndex].num;
  1455. let selectedDateList = this.selectedDateList;
  1456. selectedDateList.push({
  1457. week: this.weekIndex,
  1458. time: time,
  1459. weekStr: this.weekArrList[this.weekIndex].week
  1460. });
  1461. this.setData({
  1462. [itemData]: num + 1,
  1463. // selectTimeIndex:index,
  1464. selectedDateList: selectedDateList
  1465. });
  1466. let weekListNew = [];
  1467. this.selectedDateList.forEach((item) => {
  1468. if (weekListNew.indexOf(item.week) == -1) {
  1469. weekListNew.push(item.week);
  1470. }
  1471. });
  1472. this.setData({
  1473. selectedWeekList: weekListNew
  1474. });
  1475. }
  1476. console.log(this);
  1477. }
  1478. },
  1479. firstDateCheck(e) {
  1480. let index = e.currentTarget.dataset.index;
  1481. this.setData({
  1482. firstDateIndex: index
  1483. });
  1484. },
  1485. onTabChange(e) {
  1486. let weekList = this.weekArrList;
  1487. weekList.forEach((item) => {
  1488. item.num = 0;
  1489. });
  1490. let tab = e.currentTarget.dataset.tab;
  1491. this.setData({
  1492. weekArrList: weekList,
  1493. activeTab: tab,
  1494. selectTimeIndex: 'null',
  1495. selectedWeekList: [],
  1496. selectedDateList: []
  1497. });
  1498. },
  1499. showAppoint() {
  1500. if (this.addressId == 0) {
  1501. util.showErrorToast("请选择服务地址");
  1502. return false;
  1503. }
  1504. // this.setData({
  1505. // choosePopup: true,
  1506. // popupType: this.data.popupType == 3 ? 2 : this.data.popupType,
  1507. // isFinishAppoint: false
  1508. // });
  1509. // if (this.data.popupType == '1') {
  1510. // this.getDayStock();
  1511. // }
  1512. if (this.appointDate != '') {
  1513. this.setData({
  1514. choosePopup: true,
  1515. });
  1516. return false;
  1517. } else {
  1518. this.setData({
  1519. choosePopup: true,
  1520. noonType: 1,
  1521. timeIndex: 0
  1522. });
  1523. this.getDayStock();
  1524. }
  1525. },
  1526. confirmTimeOld() {
  1527. console.log(this.activeTab);
  1528. console.log(this);
  1529. if (this.popupType == 1) {
  1530. if (this.timeIndex === '') {
  1531. uni.showToast({
  1532. title: '请选择服务时间',
  1533. icon: 'none',
  1534. duration: 2000
  1535. });
  1536. return false;
  1537. }
  1538. let date = this.dateList[this.dateIndex].date;
  1539. let week = this.dateList[this.dateIndex].week;
  1540. let time = this.timeList[this.timeIndex].time;
  1541. console.log(week, time);
  1542. this.setData({
  1543. oneTimeAppoint: date + ' ' + week + ' ' + time,
  1544. choosePopup: false,
  1545. isFinishAppoint: true
  1546. });
  1547. } else if (this.popupType == 2) {
  1548. if (this.activeTab == 2) {
  1549. if (this.selectedDateList.length < 1) {
  1550. uni.showToast({
  1551. title: '请选择服务时间',
  1552. icon: 'none',
  1553. duration: 2000
  1554. });
  1555. } else if (this.selectedDateList.length == 1) {
  1556. uni.showToast({
  1557. title: '请选择第二次服务时间',
  1558. icon: 'none',
  1559. duration: 2000
  1560. });
  1561. } else {
  1562. // 选择频次
  1563. let futureDateList = util.getDateList(new Date(new Date().getTime() + 3600000 * 24), 1);
  1564. let minIndex = Math.min.apply(null, this.selectedWeekList);
  1565. console.log(minIndex);
  1566. console.log(this.weekArrList[minIndex].id);
  1567. let beginDate = futureDateList.filter((item) => {
  1568. return new Date(item.date).getDay() == this.weekArrList[minIndex].id;
  1569. });
  1570. console.log(beginDate);
  1571. let inter = 7;
  1572. let firstAppointList = util.getDateList(new Date(new Date(beginDate[0].date).getTime()),
  1573. inter);
  1574. this.setData({
  1575. popupType: 3,
  1576. firstAppointList: firstAppointList
  1577. });
  1578. }
  1579. } else {
  1580. if (this.selectedDateList.length == 0) {
  1581. uni.showToast({
  1582. title: '请选择服务时间',
  1583. icon: 'none',
  1584. duration: 2000
  1585. });
  1586. } else {
  1587. // 选择频次
  1588. let futureDateList = util.getDateList(new Date(new Date().getTime() + 3600000 * 24), 1);
  1589. let minIndex = Math.min.apply(null, this.selectedWeekList);
  1590. console.log(minIndex);
  1591. let beginDate = futureDateList.filter((item) => {
  1592. return new Date(item.date).getDay() == this.weekArrList[minIndex].id;
  1593. });
  1594. console.log(beginDate);
  1595. let inter = this.activeTab == 3 ? 14 : 7;
  1596. let firstAppointList = util.getDateList(new Date(new Date(beginDate[0].date).getTime()),
  1597. inter);
  1598. this.setData({
  1599. popupType: 3,
  1600. firstAppointList: firstAppointList
  1601. });
  1602. }
  1603. }
  1604. } else if (this.popupType == 3) {
  1605. let firstTime = this.firstAppointList[this.firstDateIndex].date;
  1606. console.log(firstTime);
  1607. console.log(this.selectedDateList);
  1608. // this.orderAppoint();
  1609. this.setData({
  1610. choosePopup: false,
  1611. isFinishAppoint: true,
  1612. popupType: 2
  1613. // noSerTimes: res.data,
  1614. // appointFailTip: res.data >= 1 ? true : false
  1615. });
  1616. // this.setData({
  1617. // choosePopup:false,
  1618. // isFinishAppoint:true
  1619. // });
  1620. }
  1621. },
  1622. noonTab(e) {
  1623. let noon = e.currentTarget.dataset.noon;
  1624. this.setData({
  1625. timeIndex: -1,
  1626. noonType: noon,
  1627. selectTimeValue: '',
  1628. });
  1629. let period = this.dateList[this.dateIndex].period;
  1630. let current = (this.noonType == 1 ? '上午' : '下午');
  1631. let list = period.filter(item => {
  1632. return item.ofTime == current;
  1633. });
  1634. this.setData({
  1635. timeList: list
  1636. });
  1637. },
  1638. confirmTime() {
  1639. if (this.timeIndex === '' || this.timeIndex < 0) {
  1640. util.showErrorToast('请选择服务时间');
  1641. return false;
  1642. }
  1643. let date = this.dateList[this.dateIndex].bookdate;
  1644. let week = this.dateList[this.dateIndex].weekOfDay;
  1645. let time = this.timeList[this.timeIndex].begin + '-' + this.timeList[this.timeIndex].end;
  1646. this.setData({
  1647. choosePopup: false,
  1648. appointDate: date + ' ' + week + ' ' + time
  1649. });
  1650. },
  1651. orderAppoint() {
  1652. // 如果是多次卡先预估,单次卡不用预估
  1653. let weeks = [];
  1654. this.selectedDateList.forEach((item) => {
  1655. let obj = {
  1656. dayOfWeek: this.weekArrList[item.week].id,
  1657. startTime: item.time.split('-')[0],
  1658. endTime: item.time.split('-')[1]
  1659. };
  1660. weeks.push(obj);
  1661. });
  1662. let params = {
  1663. weeks: weeks,
  1664. type: this.activeTab,
  1665. startDate: this.firstAppointList[this.firstDateIndex].date,
  1666. lng: this.checkedAddress.lng,
  1667. lat: this.checkedAddress.lat,
  1668. shopId: this.checkedAddress.shopId,
  1669. goodId: this.checkedGoods.id
  1670. };
  1671. uni.showLoading({
  1672. title: '加载中'
  1673. });
  1674. util.request(api.OrderAppoint, params, 'POST')
  1675. .then((res) => {
  1676. uni.hideLoading();
  1677. if (res.errno == 0) {
  1678. // this.orderPay(params);
  1679. this.setData({
  1680. choosePopup: false,
  1681. isFinishAppoint: true,
  1682. popupType: 2
  1683. // noSerTimes: res.data,
  1684. // appointFailTip: res.data >= 1 ? true : false
  1685. });
  1686. } else {
  1687. // util.showErrorToast(res.errmsg);
  1688. uni.showToast({
  1689. title: res.errmsg,
  1690. icon: 'none',
  1691. duration: 2000
  1692. });
  1693. }
  1694. })
  1695. .catch(function(err) {
  1696. console.log(err);
  1697. uni.hideLoading();
  1698. uni.showToast({
  1699. title: err.errMsg,
  1700. icon: 'none'
  1701. });
  1702. });
  1703. },
  1704. cancelPay() {
  1705. this.setData({
  1706. payFailShow: false
  1707. });
  1708. uni.navigateBack({
  1709. delta: 1
  1710. });
  1711. },
  1712. rePay() {
  1713. uni.showLoading({
  1714. title: '支付中'
  1715. });
  1716. // 支付
  1717. uni.continueToPay({
  1718. // orderId: this.data.orderId, // 内部订单号
  1719. outOrderNo: this.outOrderNo,
  1720. // 外部订单号 2个订单号必填一个
  1721. success: (res) => {
  1722. console.log(res);
  1723. const {
  1724. orderId,
  1725. outOrderNo
  1726. } = res;
  1727. console.log('success res', res);
  1728. console.log('orderId', orderId, 'outOrderNo', outOrderNo);
  1729. this.setData({
  1730. payFailShow: false
  1731. });
  1732. uni.redirectTo({
  1733. url: '/pages/checkout/payResult/payResult?status=1&outOrderNo=' +
  1734. outOrderNo + '&orderId=' + orderId + '&actualPrice=' + this.actualPrice
  1735. });
  1736. },
  1737. fail: (res) => {
  1738. console.log(res);
  1739. const {
  1740. orderId,
  1741. outOrderNo,
  1742. errNo,
  1743. errMsg,
  1744. errLogId
  1745. } = res;
  1746. if (errLogId) {
  1747. console.log('查询订单信息失败', errNo, errMsg, errLogId);
  1748. }
  1749. if (orderId || outOrderNo) {
  1750. console.log('支付失败', errNo, errMsg, orderId, outOrderNo);
  1751. }
  1752. util.showErrorToast('支付失败');
  1753. }
  1754. });
  1755. },
  1756. getDayStock() {
  1757. // if (this.dateIndex < 0) {
  1758. // return false;
  1759. // }
  1760. let params = {
  1761. days: 7,
  1762. goodsId: this.checkedGoods.id,
  1763. serviceDuration: this.checkedGoods.serviceDuration,
  1764. addressId: this.addressId,
  1765. productId: this.productId,
  1766. // lng: this.checkedAddress.lng,
  1767. // lat: this.checkedAddress.lat
  1768. };
  1769. uni.showLoading({
  1770. title: '加载中'
  1771. });
  1772. util.request(api.everyDayTime, params, 'GET')
  1773. .then((res) => {
  1774. uni.hideLoading();
  1775. if (res.errno == 0) {
  1776. this.setData({
  1777. dateList: res.data,
  1778. dateIndex: 0,
  1779. timeIndex: -1,
  1780. noonType: 1
  1781. });
  1782. let period = res.data[0].period;
  1783. let list = period.filter(item => {
  1784. return item.ofTime == '上午';
  1785. });
  1786. this.setData({
  1787. timeList: list
  1788. });
  1789. } else {
  1790. uni.showToast({
  1791. title: res.errmsg,
  1792. icon: 'none',
  1793. duration: 2000
  1794. });
  1795. this.setData({
  1796. timeList: [],
  1797. timeIndex: ''
  1798. });
  1799. }
  1800. })
  1801. .catch(function(err) {
  1802. console.log(err);
  1803. uni.hideLoading();
  1804. uni.showToast({
  1805. title: err.errMsg,
  1806. icon: 'none'
  1807. });
  1808. this.setData({
  1809. timeList: [],
  1810. timeIndex: ''
  1811. });
  1812. });
  1813. },
  1814. bindCodeInput: function(e) {
  1815. this.setData({
  1816. recCode: e.detail.value
  1817. });
  1818. if (e.detail.value.length == 5) {
  1819. // 校验服务者真实性
  1820. this.recCodeCheck();
  1821. // this.setData({
  1822. // codeShow:true
  1823. // })
  1824. } else {
  1825. this.setData({
  1826. codeShow: false
  1827. });
  1828. }
  1829. },
  1830. recCodeCheck() {
  1831. uni.showLoading({
  1832. title: '加载中'
  1833. });
  1834. util.request(
  1835. api.checkRecommend, {
  1836. recCode: this.recCode
  1837. },
  1838. 'GET'
  1839. )
  1840. .then((res) => {
  1841. uni.hideLoading();
  1842. if (res.errno == 0) {
  1843. if (res.data) {
  1844. this.setData({
  1845. codeShow: true,
  1846. isNoMatch: false,
  1847. recommendTips: '推荐人:' + res.data
  1848. });
  1849. } else {
  1850. this.setData({
  1851. codeShow: true,
  1852. isNoMatch: true,
  1853. recommendTips: '未匹配到推荐者,请您和推荐人核对'
  1854. });
  1855. }
  1856. } else {
  1857. this.setData({
  1858. codeShow: false
  1859. });
  1860. uni.showToast({
  1861. title: res.errmsg,
  1862. icon: 'none',
  1863. duration: 2000
  1864. });
  1865. }
  1866. })
  1867. .catch(function(err) {
  1868. uni.hideLoading();
  1869. this.setData({
  1870. codeShow: false
  1871. });
  1872. uni.showToast({
  1873. title: err.errMsg,
  1874. icon: 'none'
  1875. });
  1876. });
  1877. }
  1878. }
  1879. };
  1880. </script>
  1881. <style>
  1882. page {
  1883. height: 100%;
  1884. background: #f4f4f4;
  1885. }
  1886. .container {
  1887. padding: 50rpx 28rpx 180rpx;
  1888. }
  1889. .address-box {
  1890. width: 100%;
  1891. /* height: 166.55rpx;
  1892. background-size: 62.5rpx 10.5rpx; */
  1893. /* margin-bottom: 20rpx; */
  1894. /* padding-top: 10.5rpx; */
  1895. }
  1896. .address-item {
  1897. display: flex;
  1898. min-height: 136rpx;
  1899. background: #fff;
  1900. padding: 30rpx 20rpx;
  1901. border-radius: 10rpx;
  1902. }
  1903. .address-item.address-empty {
  1904. line-height: 75rpx;
  1905. text-align: center;
  1906. }
  1907. .address-item .map-icon {
  1908. width: 28rpx;
  1909. height: 30rpx;
  1910. margin: 6rpx 10rpx 0 0;
  1911. }
  1912. .address-box .l {
  1913. width: 125rpx;
  1914. height: 100%;
  1915. }
  1916. .address-box .l .name {
  1917. margin-left: 6.25rpx;
  1918. margin-top: -7.25rpx;
  1919. display: block;
  1920. width: 125rpx;
  1921. height: 43rpx;
  1922. line-height: 43rpx;
  1923. font-size: 30rpx;
  1924. color: #333;
  1925. margin-bottom: 5rpx;
  1926. }
  1927. .address-box .l .default {
  1928. margin-left: 6.25rpx;
  1929. display: block;
  1930. width: 62rpx;
  1931. height: 33rpx;
  1932. border-radius: 5rpx;
  1933. border: 1px solid #b4282d;
  1934. font-size: 20.5rpx;
  1935. text-align: center;
  1936. line-height: 29rpx;
  1937. color: #b4282d;
  1938. }
  1939. .address-box .m {
  1940. flex: 1;
  1941. }
  1942. .address-box .mobile {
  1943. display: block;
  1944. height: 29rpx;
  1945. line-height: 29rpx;
  1946. margin-bottom: 6.25rpx;
  1947. font-size: 26rpx;
  1948. }
  1949. .address-box .address {
  1950. display: block;
  1951. /* height: 30rpx; */
  1952. line-height: 32rpx;
  1953. font-size: 30rpx;
  1954. margin: 0 0 16rpx 0;
  1955. }
  1956. .address-bottom {
  1957. color: #999;
  1958. line-height: 28rpx;
  1959. height: 28rpx;
  1960. font-size: 26rpx;
  1961. }
  1962. .address-bottom .user-name {
  1963. margin: 0 32rpx 0 0;
  1964. }
  1965. .address-box .r {
  1966. width: 30rpx;
  1967. height: 90rpx;
  1968. display: flex;
  1969. justify-content: flex-end;
  1970. align-items: center;
  1971. }
  1972. .address-box .r image {
  1973. width: 14rpx;
  1974. height: 24rpx;
  1975. }
  1976. .coupon-box {
  1977. width: 100%;
  1978. height: 210rpx;
  1979. background: #fff;
  1980. border-radius: 10rpx;
  1981. }
  1982. .coupon-box .coupon-item {
  1983. margin: 0 10rpx;
  1984. height: 70rpx;
  1985. overflow: hidden;
  1986. background: #fff;
  1987. display: flex;
  1988. padding: 0 20rpx 0 10rpx;
  1989. align-items: center;
  1990. justify-content: space-between;
  1991. border-bottom: 2rpx solid #E4E4E4;
  1992. }
  1993. .coupon-box .l {
  1994. flex: 1;
  1995. height: 70rpx;
  1996. display: flex;
  1997. align-items: center;
  1998. justify-content: space-between;
  1999. }
  2000. .coupon-box .l .name {
  2001. font-size: 24rpx;
  2002. }
  2003. .coupon-box .l .txt {
  2004. font-size: 24rpx;
  2005. }
  2006. .coupon-box .r {
  2007. width: 30rpx;
  2008. height: 40rpx;
  2009. display: flex;
  2010. justify-content: center;
  2011. align-items: center;
  2012. }
  2013. .coupon-box .r image {
  2014. width: 52.078rpx;
  2015. height: 52.078rpx;
  2016. }
  2017. .message-box {
  2018. margin-top: 20rpx;
  2019. width: 100%;
  2020. height: auto;
  2021. overflow: hidden;
  2022. background: #fff;
  2023. }
  2024. .message-box .message-item {
  2025. height: 86.078rpx;
  2026. overflow: hidden;
  2027. background: #fff;
  2028. display: flex;
  2029. margin-left: 31.25rpx;
  2030. padding-right: 31.25rpx;
  2031. }
  2032. .message-box .message-app {
  2033. height: 74.078rpx;
  2034. overflow: hidden;
  2035. background: #fff;
  2036. display: flex;
  2037. margin-left: 31.25rpx;
  2038. padding-right: 31.25rpx;
  2039. padding-top: 18rpx;
  2040. border-radius: 20rpx;
  2041. }
  2042. .order-box {
  2043. margin-top: 20rpx;
  2044. width: 100%;
  2045. height: auto;
  2046. overflow: hidden;
  2047. background: #fff;
  2048. border-radius: 10rpx;
  2049. }
  2050. .order-box .order-item {
  2051. height: 90rpx;
  2052. overflow: hidden;
  2053. background: #fff;
  2054. display: flex;
  2055. align-items: center;
  2056. justify-content: space-between;
  2057. padding: 0 20rpx;
  2058. border-bottom: 1px solid #d9d9d9;
  2059. }
  2060. .order-box .order-item.tip-item {
  2061. padding-bottom: 26rpx;
  2062. height: auto;
  2063. display: flex;
  2064. flex-direction: column;
  2065. }
  2066. .order-box .order-item .l {
  2067. /* width:100rpx; */
  2068. height: 82rpx;
  2069. line-height: 82rpx;
  2070. align-items: center;
  2071. }
  2072. .order-box .order-item .l .name {
  2073. font-size: 30rpx;
  2074. color: #333;
  2075. }
  2076. .order-box .order-item .r {
  2077. line-height: 82rpx;
  2078. flex: 1;
  2079. height: 82rpx;
  2080. align-items: center;
  2081. text-align: right;
  2082. /* overflow: hidden; */
  2083. }
  2084. .order-box .order-item.no-border {
  2085. border-bottom: none;
  2086. }
  2087. .goods-items {
  2088. min-height: 190rpx;
  2089. margin-top: 20rpx;
  2090. background: #fff;
  2091. /* margin-bottom: 120rpx; */
  2092. border-radius: 10rpx;
  2093. padding: 20rpx 20rpx 30rpx;
  2094. }
  2095. .goods-items .item {
  2096. /* height:190rpx; */
  2097. align-items: center;
  2098. }
  2099. .goods-items .item .name {
  2100. font-size: 30rpx;
  2101. /* height: 28rpx; */
  2102. line-height: 34rpx;
  2103. color: #333;
  2104. margin-bottom: 20rpx;
  2105. }
  2106. .goods-items .item.no-border {
  2107. border-bottom: none;
  2108. }
  2109. .goods-items .item:last-child {
  2110. border-bottom: none;
  2111. }
  2112. .goods-items .img {
  2113. height: 178rpx;
  2114. width: 178rpx;
  2115. /* background-color: #f4f4f4; */
  2116. margin-right: 26rpx;
  2117. border-radius: 10rpx;
  2118. }
  2119. .goods-items .img image {
  2120. height: 190rpx;
  2121. width: 190rpx;
  2122. border-radius: 10rpx;
  2123. }
  2124. .goods-items .info {
  2125. flex: 1;
  2126. height: 190rpx;
  2127. padding: 10rpx 0 0;
  2128. }
  2129. .goods-items .t {
  2130. height: 33rpx;
  2131. line-height: 33rpx;
  2132. margin-bottom: 10rpx;
  2133. overflow: hidden;
  2134. font-size: 30rpx;
  2135. color: #333;
  2136. }
  2137. .goods-items .t .name {
  2138. display: block;
  2139. float: left;
  2140. }
  2141. .goods-items .t .number {
  2142. display: block;
  2143. float: right;
  2144. text-align: right;
  2145. }
  2146. .address-block {
  2147. width: 690rpx;
  2148. background: #FFFFFF;
  2149. border-radius: 10rpx;
  2150. padding: 30rpx 20rpx 20rpx;
  2151. }
  2152. .address-block .tips {
  2153. display: flex;
  2154. align-items: center;
  2155. height: 30rpx;
  2156. }
  2157. .tips image {
  2158. width: 30rpx;
  2159. height: 30rpx;
  2160. margin-right: 10rpx;
  2161. }
  2162. .tips view {
  2163. line-height: 30rpx;
  2164. font-size: 30rpx;
  2165. }
  2166. .goods-items .m {
  2167. height: 28rpx;
  2168. overflow: hidden;
  2169. line-height: 28rpx;
  2170. margin-bottom: 16rpx;
  2171. font-size: 22rpx;
  2172. color: #666;
  2173. margin-left: 10rpx;
  2174. }
  2175. .buy-tips {
  2176. margin-top: 5rpx;
  2177. font-size: 22rpx;
  2178. color: #666;
  2179. line-height: 34rpx;
  2180. padding: 0 30rpx 0 20rpx;
  2181. }
  2182. .goods-items .b {
  2183. height: 28rpx;
  2184. line-height: 28rpx;
  2185. font-size: 26rpx;
  2186. color: #666;
  2187. }
  2188. .order-total {
  2189. position: fixed;
  2190. left: 0;
  2191. bottom: 0;
  2192. height: 100rpx;
  2193. width: 100%;
  2194. display: flex;
  2195. }
  2196. .order-total .l {
  2197. flex: 1;
  2198. height: 100rpx;
  2199. line-height: 100rpx;
  2200. color: #b4282d;
  2201. background: #fff;
  2202. font-size: 33rpx;
  2203. padding-left: 31.25rpx;
  2204. border-top: 1rpx solid rgba(0, 0, 0, 0.2);
  2205. border-bottom: 1rpx solid rgba(0, 0, 0, 0.2);
  2206. }
  2207. .order-total .r {
  2208. width: 233rpx;
  2209. height: 100rpx;
  2210. background: #b4282d;
  2211. border: 1px solid #b4282d;
  2212. line-height: 100rpx;
  2213. text-align: center;
  2214. color: #fff;
  2215. font-size: 30rpx;
  2216. }
  2217. .actual-price {
  2218. color: #2a2a2a;
  2219. /* font-weight: bold; */
  2220. font-size: 30rpx;
  2221. text-align: right;
  2222. margin: 28rpx 0 0;
  2223. }
  2224. .actual-price text {
  2225. color: #DF1717;
  2226. }
  2227. .go-pay-wrapper {
  2228. position: fixed;
  2229. bottom: 50rpx;
  2230. left: 30rpx;
  2231. right: 30rpx;
  2232. height: 90rpx;
  2233. width: 690rpx;
  2234. border-radius: 90rpx;
  2235. display: flex;
  2236. align-items: center;
  2237. overflow: hidden;
  2238. /* background:#fff; */
  2239. }
  2240. .btn-left {
  2241. width: 486rpx;
  2242. background: #000;
  2243. display: flex;
  2244. height: 90rpx;
  2245. padding: 8rpx 0 0 42rpx;
  2246. align-items: center;
  2247. }
  2248. .btn-left .num {
  2249. font-size: 22rpx;
  2250. color: #fff;
  2251. /* margin-top:10rpx; */
  2252. margin-right: 10rpx;
  2253. }
  2254. .btn-left .total {
  2255. font-size: 22rpx;
  2256. color: #fff;
  2257. /* margin-top:10rpx; */
  2258. }
  2259. .btn-left .rmb {
  2260. font-weight: bold;
  2261. font-size: 24rpx;
  2262. color: #fff;
  2263. margin-top: -6rpx;
  2264. }
  2265. .btn-left .price {
  2266. font-weight: bold;
  2267. font-size: 32rpx;
  2268. color: #fff;
  2269. margin-top: -6rpx;
  2270. }
  2271. view.go-pay-wrapper button>view {
  2272. color: #fff;
  2273. }
  2274. .appoint-time-block {
  2275. margin-top: 20rpx;
  2276. background: #fff;
  2277. border-radius: 10rpx;
  2278. }
  2279. .appoint-time-block view.appoint-time-operate {
  2280. padding: 0 20rpx;
  2281. height: 90rpx;
  2282. display: flex;
  2283. align-items: center;
  2284. justify-content: space-between;
  2285. font-size: 24rpx;
  2286. }
  2287. .appoint-time-block .operate-left {
  2288. color: #333;
  2289. font-size: 30rpx;
  2290. }
  2291. view.operate-right {
  2292. display: flex;
  2293. align-items: center;
  2294. }
  2295. view.operate-right text {
  2296. color: #09AFFF;
  2297. font-size: 26rpx;
  2298. }
  2299. view.operate-right .not-select {
  2300. color: #333;
  2301. }
  2302. .appoint-time-show {
  2303. border-top: 2rpx solid #E4E4E4;
  2304. padding: 0 24rpx;
  2305. font-size: 24rpx;
  2306. }
  2307. view.one-time {
  2308. height: 70rpx;
  2309. display: flex;
  2310. align-items: center;
  2311. justify-content: space-between;
  2312. }
  2313. view.one-time text {
  2314. color: #999;
  2315. font-size: 26rpx;
  2316. }
  2317. .multi-times {
  2318. padding: 30rpx 0
  2319. }
  2320. .multi-times-item {
  2321. height: 54rpx;
  2322. display: flex;
  2323. align-items: center;
  2324. justify-content: space-between;
  2325. }
  2326. .multi-times-item text {
  2327. font-weight: bold;
  2328. font-size: 24rpx;
  2329. }
  2330. view.appoint-result {
  2331. margin-top: 18rpx;
  2332. border: 2rpx solid #09AFFF;
  2333. border-radius: 20rpx;
  2334. line-height: 46rpx;
  2335. font-size: 26rpx;
  2336. padding: 10rpx;
  2337. }
  2338. .orange-font {
  2339. color: #FA6400;
  2340. font-weight: bold;
  2341. font-size: 26rpx;
  2342. }
  2343. .order-item .message-item {
  2344. color: #2a2a2a;
  2345. font-size: 26rpx;
  2346. font-weight: normal;
  2347. height: 82rpx;
  2348. }
  2349. view.popup-wrapper view {
  2350. color: #888;
  2351. font-size: 30rpx;
  2352. }
  2353. .popup-content {
  2354. flex: 1;
  2355. }
  2356. .popup-title {
  2357. height: 96rpx;
  2358. line-height: 96rpx;
  2359. text-align: center;
  2360. border-bottom: 1rpx solid #ddd;
  2361. font-size: 15px !important;
  2362. }
  2363. .popup-content {
  2364. display: flex;
  2365. }
  2366. .time-select-left {
  2367. border-right: 1rpx solid #ddd;
  2368. padding: 0 8rpx 0 20rpx;
  2369. width: 370rpx;
  2370. }
  2371. .time-select-right {
  2372. flex: 1;
  2373. /* padding: 0 8rpx; */
  2374. height: 900rpx;
  2375. overflow-y: hidden;
  2376. }
  2377. .time-select-left-item {
  2378. height: 108rpx;
  2379. display: flex;
  2380. flex-direction: column;
  2381. padding: 4rpx 0;
  2382. }
  2383. .date-line-wrapper {
  2384. flex: 1;
  2385. display: flex;
  2386. /* justify-content: space-between; */
  2387. align-items: center;
  2388. }
  2389. .time-select-left-item .date-msg {
  2390. height: 36rpx;
  2391. line-height: 36rpx;
  2392. color: #888;
  2393. font-size: 24rpx;
  2394. }
  2395. .time-select-left-item .date-msg.avail-date {
  2396. color: #3FA10D;
  2397. font-weight: bold;
  2398. }
  2399. .popup-wrapper .popup-content .current-date {
  2400. color: #09afff;
  2401. font-weight: bold;
  2402. }
  2403. view.popup-wrapper .time-select-right-item {
  2404. line-height: 104rpx;
  2405. height: 104rpx;
  2406. border-bottom: 1rpx solid #ddd;
  2407. display: flex;
  2408. align-items: flex-start;
  2409. /*justify-content: space-between; */
  2410. flex-direction: column;
  2411. padding: 0 24rpx;
  2412. justify-content: center;
  2413. }
  2414. .time-select-right-item view {
  2415. color: #6D7278;
  2416. /* font-weight: bold; */
  2417. }
  2418. view.popup-btn-wrapper {
  2419. margin: 20rpx 0 0;
  2420. padding: 0 24rpx 20rpx;
  2421. }
  2422. view.popup-btn-wrapper button>view {
  2423. color: #fff;
  2424. }
  2425. view.popup-wrapper .date-tag {
  2426. color: #09afff;
  2427. height: 44rpx;
  2428. line-height: 42rpx;
  2429. width: 76rpx;
  2430. border: 2rpx solid #09afff;
  2431. border-radius: 44rpx;
  2432. text-align: center;
  2433. font-weight: normal;
  2434. font-size: 22rpx;
  2435. display: inline-block;
  2436. margin-left: 8rpx;
  2437. }
  2438. view.popup-wrapper .full-time {
  2439. color: #09AFFF;
  2440. font-size: 24rpx;
  2441. margin: 0 0 0 20rpx;
  2442. height: 44rpx;
  2443. line-height: 44rpx;
  2444. float: right;
  2445. padding-right: 40rpx;
  2446. }
  2447. .first-appoint-date-item {
  2448. height: 108rpx;
  2449. display: flex;
  2450. align-items: center;
  2451. padding: 0 0 0 240rpx;
  2452. }
  2453. .first-time-selected {
  2454. margin: 0 0 0 60rpx;
  2455. }
  2456. .select-week-times {
  2457. border-top: 1rpx solid #ddd;
  2458. }
  2459. .week-select-left {
  2460. flex: 1.2;
  2461. }
  2462. .week-select-left>view.time-select-left-item {
  2463. padding: 0 0 0 60rpx;
  2464. display: flex;
  2465. align-items: flex-start;
  2466. justify-content: flex-start;
  2467. flex-direction: row;
  2468. padding: 10rpx 0 0 60rpx;
  2469. }
  2470. .week-select-left>view.time-select-left-item .week-str {
  2471. padding: 12rpx 0 0 0;
  2472. }
  2473. view.popup-wrapper view.select-num-tag {
  2474. width: 32rpx;
  2475. height: 32rpx;
  2476. line-height: 32rpx;
  2477. background: #09AFFF;
  2478. border-radius: 34rpx;
  2479. font-size: 20rpx;
  2480. color: #fff;
  2481. text-align: center;
  2482. margin: 0 0 0 6rpx;
  2483. }
  2484. /* 支付失败弹框 */
  2485. .overlay-wrapper {
  2486. display: flex;
  2487. align-items: center;
  2488. justify-content: center;
  2489. /* height: 100%; */
  2490. position: fixed;
  2491. left: 0;
  2492. bottom: 0;
  2493. right: 0;
  2494. top: 0;
  2495. z-index: 9999;
  2496. }
  2497. .fail-wrapper {
  2498. width: 588rpx;
  2499. height: 502rpx;
  2500. border-radius: 10rpx;
  2501. background: #fff;
  2502. padding-bottom: 40rpx;
  2503. padding: 80rpx 0 0;
  2504. font-size: 24rpx;
  2505. display: flex;
  2506. flex-direction: column;
  2507. justify-content: space-between;
  2508. }
  2509. .fail-top {
  2510. display: flex;
  2511. flex-direction: column;
  2512. align-items: center;
  2513. }
  2514. .fail-top image {
  2515. width: 110rpx;
  2516. height: 110rpx;
  2517. }
  2518. .fail-text {
  2519. font-size: 34rpx;
  2520. font-weight: bold;
  2521. margin: 66rpx 0 24rpx;
  2522. height: 34rpx;
  2523. }
  2524. .fail-bottom {
  2525. height: 132rpx;
  2526. border-top: 2rpx solid #E4E4E4;
  2527. display: flex;
  2528. justify-content: space-around;
  2529. align-items: center;
  2530. }
  2531. .fail-bottom .btn-devide {
  2532. width: 2rpx;
  2533. height: 130rpx;
  2534. background: #E4E4E4;
  2535. }
  2536. .cancel-btn {
  2537. width: 202rpx;
  2538. height: 72rpx;
  2539. line-height: 72rpx;
  2540. border: 2rpx solid #85868A;
  2541. color: #282728;
  2542. border-radius: 72rpx;
  2543. text-align: center;
  2544. }
  2545. .repay-btn {
  2546. width: 202rpx;
  2547. height: 72rpx;
  2548. line-height: 72rpx;
  2549. background: #09AFFF;
  2550. color: #fff;
  2551. border-radius: 72rpx;
  2552. text-align: center;
  2553. }
  2554. .discount-title {
  2555. height: 70rpx;
  2556. background: #E0F5FC;
  2557. padding: 0 10rpx;
  2558. display: flex;
  2559. align-items: center;
  2560. }
  2561. .discount-title image {
  2562. width: 24rpx;
  2563. height: 26rpx;
  2564. margin: 0 8rpx 0 0;
  2565. }
  2566. .discount-title text {
  2567. font-size: 28rpx;
  2568. font-weight: bold;
  2569. color: #323232;
  2570. }
  2571. .discount-line {
  2572. padding: 0 20rpx 0 20rpx;
  2573. border-top: 2rpx solid #E4E4E4;
  2574. }
  2575. .discount-line .txt {
  2576. color: #DF1717;
  2577. font-size: 24rpx;
  2578. }
  2579. .discount-line .l {
  2580. flex: 1;
  2581. height: 70rpx;
  2582. display: flex;
  2583. align-items: center;
  2584. justify-content: space-between;
  2585. }
  2586. .member-benefit,
  2587. .buy-member {
  2588. margin: 20rpx 0 0;
  2589. height: 70rpx;
  2590. background: #fff;
  2591. border-radius: 10rpx;
  2592. padding: 0 20rpx;
  2593. display: flex;
  2594. align-items: center;
  2595. justify-content: space-between;
  2596. }
  2597. .member-benefit .member-tip {
  2598. text-align: right;
  2599. }
  2600. .member-tag {
  2601. width: 142rpx;
  2602. padding: 0 10rpx;
  2603. height: 44rpx;
  2604. line-height: 44rpx;
  2605. text-align: center;
  2606. background: #2E3235;
  2607. border-radius: 5rpx;
  2608. }
  2609. .member-tag text {
  2610. font-size: 24rpx;
  2611. color: #2A2A2A;
  2612. background: linear-gradient(177deg, #F1E3C8 0%, #E6C162 100%);
  2613. -webkit-background-clip: text;
  2614. -webkit-text-fill-color: transparent;
  2615. }
  2616. .member-tip {
  2617. flex: 1;
  2618. margin: 0 0 0 26rpx;
  2619. color: #DF1717;
  2620. font-size: 24rpx;
  2621. }
  2622. .popup-content-special {
  2623. position: relative;
  2624. }
  2625. .popup-title-special {
  2626. position: absolute;
  2627. left: 0;
  2628. top: 0;
  2629. right: 0;
  2630. background: #fff;
  2631. }
  2632. .popup-content-special {
  2633. height: 900rpx;
  2634. margin-top: 96rpx;
  2635. }
  2636. .popup-content-special .time-select-left {
  2637. height: 900rpx;
  2638. overflow-y: scroll;
  2639. }
  2640. .stock-text {
  2641. font-size: 20rpx;
  2642. font-weight: normal;
  2643. color: #888
  2644. }
  2645. .zero-stock {
  2646. color: #ccc;
  2647. }
  2648. .appoint-overlay-wrapper {
  2649. position: fixed;
  2650. top: 0;
  2651. left: 0;
  2652. width: 100%;
  2653. height: 100%;
  2654. background-color: rgba(0, 0, 0, .7);
  2655. z-index: 999;
  2656. }
  2657. /* 选择时间 */
  2658. view.popup-wrapper {
  2659. /* padding: 0 0 20rpx; */
  2660. color: #333;
  2661. display: flex;
  2662. flex-direction: column;
  2663. justify-content: space-between;
  2664. /* height: 80%; */
  2665. position: fixed;
  2666. left: 0;
  2667. right: 0;
  2668. bottom: 0;
  2669. background: #fff;
  2670. padding-bottom: constant(safe-area-inset-bottom);
  2671. padding-bottom: env(safe-area-inset-bottom);
  2672. z-index: 9999;
  2673. }
  2674. view.popup-wrapper view.confirm-btn {
  2675. background: #09AFFF;
  2676. height: 88rpx;
  2677. line-height: 88rpx;
  2678. border-radius: 88rpx;
  2679. text-align: center;
  2680. color: #fff;
  2681. }
  2682. .go-pay-wrapper {
  2683. /* padding-bottom: constant(safe-area-inset-bottom);
  2684. padding-bottom: env(safe-area-inset-bottom); */
  2685. }
  2686. .go-pay-wrapper view.btn-right {
  2687. background: #00B9FF;
  2688. height: 90rpx;
  2689. line-height: 90rpx;
  2690. text-align: center;
  2691. color: #fff;
  2692. width: 204rpx;
  2693. font-size: 30rpx;
  2694. }
  2695. .appoint-tabs-wrapper {
  2696. height: 88rpx;
  2697. display: flex;
  2698. align-items: center;
  2699. line-height: 88rpx;
  2700. justify-content: space-around;
  2701. }
  2702. .appoint-tab-item {
  2703. /* width:80rpx; */
  2704. border-bottom: 4rpx solid #fff;
  2705. }
  2706. .appoint-tab-item.active {
  2707. color: #09AFFF;
  2708. border-bottom: 4rpx solid #09afff;
  2709. }
  2710. .order-box.code-module {
  2711. border-radius: 10rpx;
  2712. padding: 8rpx 0;
  2713. }
  2714. .codeTips {
  2715. height: 52rpx;
  2716. line-height: 40rpx;
  2717. padding-bottom: 20rpx;
  2718. color: #09afff;
  2719. font-size: 26rpx;
  2720. text-align: right;
  2721. padding: 0 20rpx;
  2722. }
  2723. .codeTips.no-match {
  2724. color: #FA6400;
  2725. }
  2726. .goods-total {
  2727. height: 30rpx;
  2728. margin-top: 20rpx;
  2729. display: flex;
  2730. align-items: flex-end;
  2731. justify-content: flex-end;
  2732. }
  2733. .goods-total view {
  2734. font-size: 24rpx;
  2735. color: #666;
  2736. }
  2737. .goods-total .amount {
  2738. color: #333;
  2739. font-size: 48rpx;
  2740. line-height: 50rpx;
  2741. /* margin-bottom:4rpx; */
  2742. }
  2743. .order-box .order-item .r.remark-block {
  2744. display: flex;
  2745. align-items: center;
  2746. justify-content: flex-end;
  2747. }
  2748. .remark-block view {
  2749. color: #999;
  2750. font-size: 26rpx;
  2751. white-space: nowrap;
  2752. overflow: hidden;
  2753. text-overflow: ellipsis;
  2754. width: 460rpx;
  2755. }
  2756. .remark-block image {
  2757. width: 14rpx;
  2758. height: 24rpx;
  2759. margin-left: 6rpx;
  2760. }
  2761. .remark-popup {
  2762. position: fixed;
  2763. left: 0;
  2764. right: 0;
  2765. bottom: 0;
  2766. height: 860rpx;
  2767. background: #fff;
  2768. border-radius: 20rpx 20rpx 0px 0px;
  2769. padding: 40rpx 30rpx 50rpx;
  2770. z-index: 9999;
  2771. }
  2772. .remark-popup .title {
  2773. height: 30rpx;
  2774. line-height: 30rpx;
  2775. font-size: 30rpx;
  2776. color: #333333;
  2777. }
  2778. .remark-textarea {
  2779. width: 690rpx;
  2780. height: 240rpx;
  2781. background: #F8F8F8;
  2782. border-radius: 10rpx;
  2783. padding: 20rpx 36rpx 36rpx 20rpx;
  2784. font-size: 26rpx;
  2785. line-height: 40rpx;
  2786. margin: 30rpx 0 330rpx;
  2787. box-sizing: border-box;
  2788. }
  2789. .remark-popup .btn {
  2790. width: 690rpx;
  2791. height: 100rpx;
  2792. background: #00B9FF;
  2793. border-radius: 50rpx;
  2794. line-height: 100rpx;
  2795. font-size: 30rpx;
  2796. text-align: center;
  2797. color: #fff;
  2798. }
  2799. .login-out-wrapper {
  2800. width: 750rpx;
  2801. height: 100vh;
  2802. background: rgba(0, 0, 0, 0.5);
  2803. display: flex;
  2804. align-items: center;
  2805. justify-content: center;
  2806. position: fixed;
  2807. top: 0;
  2808. bottom: 0;
  2809. }
  2810. .login-out-tip {
  2811. width: 576rpx;
  2812. height: 410rpx;
  2813. background: #FFFFFF;
  2814. border-radius: 20rpx;
  2815. position: relative;
  2816. padding: 142rpx 66rpx 50rpx;
  2817. }
  2818. .tip-img {
  2819. position: absolute;
  2820. width: 168rpx;
  2821. height: 168rpx;
  2822. top: 10px;
  2823. left: 110px;
  2824. }
  2825. .login-out-wrapper .tips {
  2826. font-size: 13px;
  2827. color: #333333;
  2828. line-height: 38rpx;
  2829. height: 38rpx;
  2830. font-size: 36rpx;
  2831. text-align: center;
  2832. margin-bottom: 68rpx;
  2833. margin-top: 30px;
  2834. }
  2835. .select-wrapper {
  2836. height: 70rpx;
  2837. display: flex;
  2838. align-items: center;
  2839. justify-content: center;
  2840. /* justify-content: space-between; */
  2841. }
  2842. .select-wrapper .confirm {
  2843. width: 200rpx;
  2844. height: 70rpx;
  2845. line-height: 70rpx;
  2846. border: 2rpx solid #999999;
  2847. border-radius: 70rpx;
  2848. font-size: 30rpx;
  2849. text-align: center;
  2850. }
  2851. .select-wrapper .cancel {
  2852. width: 200rpx;
  2853. height: 70rpx;
  2854. line-height: 70rpx;
  2855. background: #00C0FF;
  2856. border-radius: 70rpx;
  2857. color: #FFFFFF;
  2858. font-size: 30rpx;
  2859. text-align: center;
  2860. }
  2861. .contact-wrapper {
  2862. position: relative;
  2863. }
  2864. .contact-btn {
  2865. position: absolute;
  2866. top: 0;
  2867. left: 0;
  2868. width: 630rpx;
  2869. height: 90rpx;
  2870. opacity: 0;
  2871. z-index: 99;
  2872. }
  2873. .popup-content-special {
  2874. position: relative;
  2875. }
  2876. .popup-title-special {
  2877. position: absolute;
  2878. left: 0;
  2879. top: 0;
  2880. right: 0;
  2881. background: #fff;
  2882. }
  2883. .popup-content-special {
  2884. height: 900rpx;
  2885. /* margin-top: 96rpx; */
  2886. margin-top: 116rpx;
  2887. }
  2888. .popup-content-special .time-select-left {
  2889. height: 900rpx;
  2890. overflow-y: scroll;
  2891. }
  2892. .stock-text {
  2893. font-size: 20rpx;
  2894. font-weight: normal;
  2895. color: #888
  2896. }
  2897. .zero-stock {
  2898. color: #ccc;
  2899. }
  2900. .noon-select {
  2901. height: 64rpx;
  2902. display: flex;
  2903. border-bottom: 1rpx solid #ddd;
  2904. }
  2905. .time-select-right .noon-item {
  2906. flex: 1;
  2907. text-align: center;
  2908. line-height: 64rpx;
  2909. color: #979797;
  2910. font-size: 26rpx;
  2911. }
  2912. .time-select-right view.noon-item.active-noon {
  2913. color: #fff;
  2914. background: #09afff;
  2915. }
  2916. view.popup-wrapper .time-select-right-item .date-tag {
  2917. width: 80rpx;
  2918. height: 40rpx;
  2919. line-height: 38rpx;
  2920. margin-left: 0;
  2921. /* margin-left:120rpx; */
  2922. }
  2923. .popup-title-new.popup-title {
  2924. display: flex;
  2925. flex-direction: column;
  2926. justify-content: center;
  2927. align-items: center;
  2928. height: 116rpx;
  2929. line-height: normal;
  2930. }
  2931. .popup-title-new view {
  2932. color: #333;
  2933. font-size: 32rpx;
  2934. }
  2935. .popup-title-new view.fee-tips {
  2936. color: #FF5735;
  2937. font-size: 22rpx;
  2938. }
  2939. .time-select-right-item text {
  2940. color: #888;
  2941. }
  2942. .time-select-right .time-item-wrapper {
  2943. height: 836rpx;
  2944. overflow-y: scroll;
  2945. }
  2946. .time-line {
  2947. display: flex;
  2948. align-items: center;
  2949. justify-content: space-between;
  2950. width: 100%;
  2951. }
  2952. view.popup-wrapper .time-select-right-item.invalid-time text {
  2953. color: #999;
  2954. }
  2955. view.popup-wrapper .time-select-right-item.invalid-time {
  2956. /* background: #E1E1E1; */
  2957. background: #eee;
  2958. }
  2959. .time-select-right-item view.time-msg {
  2960. height: 40rpx;
  2961. line-height: 38rpx;
  2962. border-radius: 40rpx;
  2963. padding: 0 8rpx;
  2964. font-size: 22rpx;
  2965. border: 2rpx solid #999;
  2966. color: #999;
  2967. font-weight: normal;
  2968. white-space: nowrap;
  2969. }
  2970. .time-select-right-item text.extra-tips {
  2971. color: #FF5735;
  2972. font-size: 22rpx;
  2973. }
  2974. .notice-block {
  2975. background: #fff;
  2976. border-radius: 24rpx;
  2977. padding: 20rpx 24rpx;
  2978. margin-bottom: 24rpx;
  2979. }
  2980. .notice-title {
  2981. font-weight: bold;
  2982. font-size: 26rpx;
  2983. line-height: 60rpx;
  2984. }
  2985. .notice-item {
  2986. display: flex;
  2987. align-items: flex-start;
  2988. }
  2989. .notice-index {
  2990. width: 36rpx;
  2991. }
  2992. .notice-item view {
  2993. font-size: 26rpx;
  2994. line-height: 40rpx;
  2995. color: #666;
  2996. }
  2997. .notice-item view:last-child {
  2998. flex: 1;
  2999. text-align: justify;
  3000. }
  3001. .appoint-block {
  3002. padding: 0 20rpx;
  3003. height: 88rpx;
  3004. display: flex;
  3005. align-items: center;
  3006. /* border-bottom: 2rpx solid #E0E0E0; */
  3007. }
  3008. .appoint-block .title {
  3009. width: 136rpx;
  3010. border-bottom: 2rpx solid #fff;
  3011. font-size: 26rpx;
  3012. font-weight: bold;
  3013. z-index: 9;
  3014. height: 72rpx;
  3015. line-height: 72rpx;
  3016. }
  3017. .appoint-block .title text {
  3018. color: #f00;
  3019. }
  3020. .appoint-time {
  3021. flex: 1;
  3022. color: #ACADB1;
  3023. padding-left: 4rpx;
  3024. font-size: 24rpx;
  3025. }
  3026. .appoint-timed {
  3027. flex: 1;
  3028. padding-left: 4rpx;
  3029. color: #333;
  3030. font-size: 26rpx;
  3031. }
  3032. .appoint-block .arrow-img {
  3033. width: 24rpx;
  3034. height: 24rpx;
  3035. margin-left: 8rpx;
  3036. }
  3037. </style>