confirmOrder.vue 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015
  1. <template>
  2. <view class="pages">
  3. <!-- 地址 -->
  4. <view class="text-center text-red" v-if="isTrue && orderType == 2">超出配送距离</view>
  5. <view class="food">
  6. <view class="flex bg justify-between padding-lr-xl">
  7. <view @click="switchTab(2)" :class="orderType == 2 ? 'select' : ''" class="tabBtn" v-if="XCXIsSelect == '是' && showReach != 1 && shopTypeName != '三大运营商'">
  8. <view class="title">外卖配送</view>
  9. <view :class="orderType == 2 ? 'active' : ''"></view>
  10. </view>
  11. <view @click="switchTab(1)" :class="orderType == 1 ? 'select' : ''" class="tabBtn" v-if="showReach != 2">
  12. <view class="title">到店自取</view>
  13. <view :class="orderType == 1 ? 'active' : ''"></view>
  14. </view>
  15. </view>
  16. <view v-if="orderType == 1">
  17. <!-- <view class="text-black text-lg margin-top">商家地址</view> -->
  18. <view class="flex margin-top" style="">
  19. <u-icon name="map" size="50"></u-icon>
  20. <view class="flex-sub padding-tb-sm margin-left-sm">
  21. <view class="text-lg text-bold text-black">
  22. <text>{{ dataList.shopName }}</text>
  23. <text class="margin-left-sm" @click="call">{{ dataList.shopPhone }}</text>
  24. </view>
  25. <view class="text-df margin-top-xs" style="color: #999999" @click="goMap">
  26. {{ dataList.detailedAddress }}
  27. </view>
  28. </view>
  29. </view>
  30. <view class="flex margin-top" style="align-items: center" v-if="shopTypeName == '三大运营商'">
  31. <view>请填写身份证号:</view>
  32. <input type="idcard" v-model="idcard1" style="border: 1px solid" />
  33. </view>
  34. <!-- 预约送达时间 -->
  35. <!-- <view class="goods_address" v-if="reservationOpenFlag==1">
  36. <view class="address_box">
  37. <view class="address_name">送达时间</view>
  38. <picker class='time-picker' mode="multiSelector" @change="bindStartMultiPickerChange"
  39. @columnchange="bindMultiPickerColumnChange" :range="data.multiArray">
  40. {{data.startDate}}
  41. </picker>
  42. <view class="songda_image">
  43. <image src="../../../static/images/index/right.png"></image>
  44. </view>
  45. </view>
  46. </view> -->
  47. </view>
  48. <view class="" v-if="orderType == 2">
  49. <view class="goods_address" v-if="JSON.stringify(address) == '{}'" @click="goAddress">
  50. <view class="address_box">
  51. <view class="address_name">请选择收货地址</view>
  52. <view class="address_image margin-left">
  53. <image src="../../../static/images/index/right.png"></image>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="flex margin-top" style="" v-else @click="goAddress">
  58. <u-icon name="map" size="50"></u-icon>
  59. <view class="flex-sub padding-tb-sm margin-left-sm">
  60. <view class="text-lg text-bold text-black">
  61. <text>{{ address.userName }}</text>
  62. <text class="margin-left-sm">{{ address.userPhone }}</text>
  63. </view>
  64. <view class="text-df margin-top-xs" style="color: #999999">{{ address.province }}{{ address.city }}{{ address.district }}{{ address.addressDetail }}</view>
  65. </view>
  66. <view class="address_image margin-left">
  67. <image src="../../../static/images/index/right.png"></image>
  68. </view>
  69. </view>
  70. <!-- 预约送达时间 -->
  71. <!-- <view class="goods_address" v-if="reservationOpenFlag==1">
  72. <view class="address_box">
  73. <view class="address_name">送达时间</view>
  74. <picker class='time-picker' mode="multiSelector" @change="bindStartMultiPickerChange"
  75. @columnchange="bindMultiPickerColumnChange" :range="data.multiArray">
  76. {{data.startDate}}
  77. </picker>
  78. <view class="songda_image">
  79. <image src="../../../static/images/index/right.png"></image>
  80. </view>
  81. </view>
  82. </view> -->
  83. </view>
  84. </view>
  85. <!-- 商品 -->
  86. <view class="food">
  87. <view class="tosend_header_food" v-for="(item, index) in goodsList" :key="index">
  88. <view class="tosend_header_food_le">
  89. <image :src="item.goodsPicture[0]" style="border-radius: 10rpx" mode=""></image>
  90. </view>
  91. <view class="flex-sub margin-left-sm">
  92. <view class="flex justify-between align-center">
  93. <view class="text-lg text-bold text-black">{{ item.goodsName }}</view>
  94. <view class="text-lg text-bold text-black">
  95. <text class="text-sm">¥</text>
  96. {{ item.goodsPrice }}
  97. </view>
  98. </view>
  99. <view class="flex justify-between align-center text-gray">
  100. <view v-if="item.skuMessage">{{ item.skuMessage }}</view>
  101. <view>x{{ item.goodsNum }}</view>
  102. </view>
  103. <view class="flex justify-between text-bold align-center margin-tb-sm">
  104. <view>打包费</view>
  105. <view class="">¥{{ item.goodsPack }} / 份</view>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="tosend_header_do justify-between" v-if="paotuiMoney > 0 && orderType == 2">
  110. <view>跑腿费</view>
  111. <view class="tosend_header_do_ri">¥{{ paotuiMoney }}</view>
  112. </view>
  113. <view class="tosend_header_do justify-between" v-if="address.insideDeliveryFee && orderType == 2">
  114. <view>特殊地址跑腿费</view>
  115. <view class="tosend_header_do_ri">¥{{ address.insideDeliveryFee }}</view>
  116. </view>
  117. <view class="tosend_header_do justify-between" v-if="Vipmoney.canReduceFlag=='1'">
  118. <view>会员立减</view>
  119. <view class="tosend_header_do_ri">- ¥{{ Vipmoney.reduceAmount }}</view>
  120. </view>
  121. <view class="tosend_header_do justify-between do_bot" @click="isShow">
  122. <view>优惠券</view>
  123. <view class="tosend_header_do_ri" v-if="coupon">- ¥{{ coupon.money }}</view>
  124. <view v-else>
  125. <image src="../../../static/images/order/right1.png" style="width: 14rpx; height: 24rpx" mode=""></image>
  126. </view>
  127. </view>
  128. <view class="tosend_header_do justify-between do_bot" @click="huodongShow">
  129. <view>优惠活动</view>
  130. <view class="tosend_header_do_ri" v-if="huodong">- ¥{{ huodong.discountAmount }}</view>
  131. <view v-else>
  132. <image src="../../../static/images/order/right1.png" style="width: 14rpx; height: 24rpx" mode=""></image>
  133. </view>
  134. </view>
  135. <view class="tosend_header_do justify-between">
  136. <view class="tosend_header_do_le2">合计</view>
  137. <view class="tosend_header_do_ri2">
  138. <text>¥</text>
  139. {{ totalPrice1 }}
  140. </view>
  141. </view>
  142. </view>
  143. <!-- 积分介绍 -->
  144. <view class="food" v-if="isIntegral">
  145. <view class="food_top">
  146. <view class="">获取积分</view>
  147. <view class="">{{ intergral }}</view>
  148. </view>
  149. <view class="food_bottom">
  150. 实付满{{ ruleAmount1 }}元得
  151. <text class="bottom_text">{{ ruleValue1 }}分</text>
  152. ,超过{{ ruleMaxAmount }}元部分,每满{{ ruleAmount2 }}元得
  153. <text class="bottom_text">{{ ruleValue2 }}分</text>
  154. ;每笔订单上限
  155. <text class="bottom_text">{{ maxIntegral }}分</text>
  156. </view>
  157. </view>
  158. <!-- 订单备注 -->
  159. <view class="food">
  160. <view class="padding-tb-sm text-lg text-bold text-bold text-black">订单备注</view>
  161. <view class="flex align-center justify-between padding-tb-sm padding-lr" style="background: #f5f5f5; width: 100%">
  162. <u-input v-model="remark" type="textarea" placeholder="请输入订单备注" height="180" maxlength="200" style="width: 100%"></u-input>
  163. </view>
  164. </view>
  165. <!-- 支付方式 -->
  166. <view class="food">
  167. <view class="padding-tb-sm text-lg text-bold text-bold text-black">支付方式</view>
  168. <view style="height: 100upx" v-for="(item, index) in openLists" :key="index">
  169. <view class="flex align-center justify-between padding-tb" v-if="item.text != '零钱'">
  170. <image :src="item.image" style="width: 55rpx; height: 55rpx; border-radius: 50upx"></image>
  171. <view class="flex-sub text-xl margin-left">{{ item.text }}</view>
  172. <radio-group name="openWay" style="margin-left: 20upx" @change="selectWay(item)">
  173. <label class="tui-radio">
  174. <radio class="red" :checked="openWay === item.id ? true : false" />
  175. </label>
  176. </radio-group>
  177. </view>
  178. <view class="flex align-center justify-between padding-tb" v-if="item.text === '零钱'">
  179. <image :src="item.image" style="width: 55rpx; height: 55rpx; border-radius: 50upx"></image>
  180. <view class="flex-sub text-xl margin-left">
  181. {{ item.text }}
  182. <text style="font-size: 30rpx; margin-left: 10rpx" v-if="userMoney && userMoney > 0">(余额:{{ userMoney }})</text>
  183. <!-- <text v-else
  184. style="font-size: 30rpx;margin-left: 10rpx;text-decoration:underline;color: #ea0000;"
  185. @tap="goCash()">去充值</text> -->
  186. </view>
  187. <radio-group name="openWay" style="margin-left: 20upx" @change="selectWay(item)">
  188. <label class="tui-radio">
  189. <radio class="red" :checked="openWay === item.id ? true : false" />
  190. </label>
  191. </radio-group>
  192. </view>
  193. </view>
  194. </view>
  195. <view style="height: 120rpx"></view>
  196. <!-- 结算 -->
  197. <view class="goorder">
  198. <view class="goorder_but" :class="isTrue && orderType == 2 ? 'goorder_but_' : ''" @click="toSettlement_throttle">立即结算</view>
  199. </view>
  200. <view class="hintPopul" v-if="shopDet && shopDet.putawayFlag == 1">
  201. <view class="content_">
  202. <image src="../../../static/images/index/shop.png" style="width: 200rpx; height: 180rpx"></image>
  203. <view class="text-xl text-bold">店铺打烊啦</view>
  204. <view class="hintText margin-top-sm text-gray">现在店铺已经打烊了,营业时间</view>
  205. <view class="margin-top-xs text-gray margin-bottom">{{ shopDet.businessHours }}-{{ shopDet.lockHours }}</view>
  206. <view class="Btns" @click="goBack()">知道了</view>
  207. </view>
  208. </view>
  209. <u-popup
  210. v-model="show"
  211. mode="center"
  212. :closeable="true"
  213. close-icon-pos="top-right"
  214. close-icon="close-circle"
  215. close-icon-size="50"
  216. border-radius="20"
  217. width="80%"
  218. @close="close"
  219. >
  220. <view class="padding bg-gray">
  221. <view class="text-center text-lg text-bold margin-bottom-sm">可用优惠券</view>
  222. <scroll-view scroll-y="true" style="height: 600rpx" v-if="couponList.length > 0">
  223. <view
  224. class="flex justify-between align-center radius margin-tb-sm padding-sm bg-white"
  225. v-for="(item, index) in couponList"
  226. :key="index"
  227. @click="selCoupon(item)"
  228. >
  229. <view>
  230. <view>{{ item.couponName }}</view>
  231. <view>
  232. {{ item.shopId == 0 ? '平台优惠券' : '商家优惠券' }}
  233. </view>
  234. <view>有效期至{{ item.expirationTime }}</view>
  235. </view>
  236. <view class="text-sm text-bold">
  237. ¥
  238. <text class="text-lg">{{ item.money }}</text>
  239. </view>
  240. </view>
  241. </scroll-view>
  242. <view v-if="couponList.length == 0" style="height: 100rpx; line-height: 100rpx; text-align: center; font-weight: 700">暂无可用优惠券</view>
  243. </view>
  244. </u-popup>
  245. <!-- 选择优惠活动 -->
  246. <u-popup
  247. v-model="youhui"
  248. mode="center"
  249. :closeable="true"
  250. close-icon-pos="top-right"
  251. close-icon="close-circle"
  252. close-icon-size="50"
  253. border-radius="20"
  254. width="80%"
  255. @close="closeYouhui()"
  256. >
  257. <view class="padding bg-gray">
  258. <view class="text-center text-lg text-bold margin-bottom-sm">可用优惠活动</view>
  259. <scroll-view scroll-y="true" style="height: 600rpx" v-if="huoList.length > 0">
  260. <view class="flex justify-between align-center radius margin-tb-sm padding-sm bg-white" v-for="(item, index) in huoList" :key="index" @click="selctHuo(item)">
  261. <view>
  262. <view>{{ item.activityTitle }}</view>
  263. <view>有效期至{{ item.activityEndTime }}</view>
  264. </view>
  265. <!-- <view class="text-sm text-bold">
  266. ¥
  267. <text class="text-lg" v-if="item.activityType=='2'">{{ item.money }}</text>
  268. <text class="text-lg" v-if="item.activityType=='2'">{{ item.money }}</text>
  269. <text class="text-lg" v-if="item.activityType=='4'">全场打{{ item.discountAmount }}折</text>
  270. </view> -->
  271. </view>
  272. </scroll-view>
  273. <view v-if="huoList.length == 0" style="height: 100rpx; line-height: 100rpx; text-align: center; font-weight: 700">暂无可用优惠活动</view>
  274. </view>
  275. </u-popup>
  276. </view>
  277. </template>
  278. <script>
  279. /**
  280. * 获取任意时间
  281. */
  282. function getDate(date, AddDayCount = 0) {
  283. if (!date) {
  284. date = new Date()
  285. }
  286. if (typeof date !== 'object') {
  287. date = date.replace(/-/g, '/')
  288. }
  289. const dd = new Date(date)
  290. dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
  291. var a = new Array('日', '一', '二', '三', '四', '五', '六')
  292. var week = new Date().getDay()
  293. var week2 = new Date().getDay() + 1
  294. const y = dd.getFullYear()
  295. const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
  296. const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
  297. const h = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
  298. const f = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
  299. const s = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
  300. return {
  301. fullDate: y + '-' + m + '-' + d,
  302. fullDate2: y + '-' + m + '-' + d + ' ' + h + ':' + f + ':' + s,
  303. fullTime: m + '月' + d + '日',
  304. year: y,
  305. month: m,
  306. date: d,
  307. day: dd.getDay(),
  308. sWeek: '周' + a[week],
  309. eWeek: '周' + a[week2]
  310. }
  311. }
  312. import { throttle } from '@/utils/throttle.js'
  313. export default {
  314. data() {
  315. return {
  316. userMoney: 0,
  317. shopDet: '',
  318. isThrottle: true, //防抖,待支付结果返回后继续
  319. storeCommodityId: 0,
  320. openLists: [
  321. {
  322. image: '../../../static/images/my/weixin.png',
  323. text: '微信',
  324. id: 2
  325. }
  326. // {
  327. // image: '../../../static/images/my/zhifubao.png',
  328. // text: '支付宝',
  329. // id: 3
  330. // },
  331. // {
  332. // image: '../../../static/images/my/jinbi.png',
  333. // text: '零钱',
  334. // id: 1
  335. // }
  336. ],
  337. openWay: 2,
  338. orderId: '',
  339. page: 1,
  340. limit: 100,
  341. dataList: [],
  342. packMoney: 0, //打包费
  343. totalPrice: 0,
  344. totalPrice1: 0,
  345. address: {
  346. insideDeliveryFee: 0
  347. }, //地址
  348. addressId: '',
  349. parentId: '',
  350. shopId: '',
  351. show: false,
  352. youhui: false, //优惠活动
  353. coupon: '', //选择的优惠券信息
  354. huodong: '', //选择的活动信息
  355. Vipmoney:{
  356. canReduceFlag:'0',
  357. reduceAmount:0,
  358. vipReduceDesc:''
  359. },//会员立减金额
  360. couponList: [],
  361. huoList: [], //可用活动
  362. orderType: 2,
  363. paotuiMoney: 0,
  364. dabaoMoney: 0,
  365. goodsMoney: null,
  366. distance: 0,
  367. isTrue: false,
  368. goodsList: [],
  369. XCXIsSelect: '是',
  370. remark: '',
  371. GoodsorderId: '',
  372. ifPaotui: 0, //是否满减
  373. lng: '',
  374. lat: '',
  375. data: {
  376. multiArray: [],
  377. warning: '',
  378. startDate: '请选择'
  379. },
  380. workStart: '', //骑手上班时间
  381. workStartMin: '', //上班分钟
  382. workEnd: '', //骑手下班时间
  383. yusongTime: '', //骑手预计送达时长
  384. reservationFlag: 0, //是否预约单 1是、0否
  385. expectDeliveryTime: '', //预约送达时间
  386. timer: '', //定时器
  387. autoSendOrder: 0, //autoSendOrder为1商家自配,0平台配送
  388. reservationOpenFlag: 0, //1预约,0不预约
  389. status: null,
  390. showReach: null,
  391. // 基础实付满多少
  392. ruleAmount1: 0,
  393. // 基础实付满多少送的积分
  394. ruleValue1: 0,
  395. // 超过多少
  396. ruleMaxAmount: 0,
  397. // 第二阶段实付满多少
  398. ruleAmount2: 0,
  399. // 第二阶段实付满多少送的积分
  400. ruleValue2: 0,
  401. // 每笔订单获取的积分上限
  402. maxIntegral: 0,
  403. // 可获得积分
  404. intergral: 0,
  405. // 是否显示积分模块
  406. isIntegral: false,
  407. shopTypeName: '', //店铺类型
  408. idcard1: '' //身份证号
  409. }
  410. },
  411. onLoad(option) {
  412. console.log(option, '256')
  413. this.shopTypeName = option.shopTypeName
  414. if (option.showReach) {
  415. this.showReach = option.showReach
  416. }
  417. // #ifdef MP-WEIXIN
  418. this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
  419. // #endif
  420. this.shopId = option.shopId
  421. if (option.shopTypeName == '三大运营商') {
  422. this.orderType = 1
  423. } else {
  424. this.orderType = option.orderType
  425. }
  426. if (option.orderId) {
  427. this.orderId = option.orderId
  428. }
  429. if (option.status) {
  430. this.status = option.status
  431. }
  432. uni.showLoading({
  433. title: '加载中...',
  434. mask: true // 是否显示透明蒙层,防止触摸穿透
  435. })
  436. uni.getLocation({
  437. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  438. success: (res) => {
  439. this.lat = res.latitude
  440. this.lng = res.longitude
  441. }
  442. })
  443. this.getAddressList()
  444. },
  445. onUnload() {
  446. // 页面销毁时清除定时器
  447. if (this.timer) {
  448. clearInterval(this.timer)
  449. }
  450. },
  451. onShow() {
  452. this.getMsgData()
  453. this.getvipMoney()
  454. this.addressId = this.addressId ? this.addressId : uni.getStorageSync('addressId')
  455. if (this.addressId) {
  456. console.log(this.addressId, '地址id')
  457. this.address = {}
  458. this.getAddressDet(this.addressId)
  459. }
  460. // console.log(this.shopId, 'this.shopId')
  461. this.getShopDet(this.shopId)
  462. // 设置定时器
  463. this.timer = setInterval(() => {
  464. // 定时器执行的操作
  465. // this.getQishou()
  466. console.log('每分钟执行一次')
  467. // 这里可以放置你需要每分钟执行的代码
  468. this.getCouponList()
  469. this.getHuoList()
  470. }, 60 * 1000) // 60 * 1000 毫秒代表一分钟
  471. },
  472. watch: {
  473. totalPrice1() {
  474. this.getIntegralRules()
  475. }
  476. },
  477. methods: {
  478. //获取会员立减金额
  479. getvipMoney() {
  480. var shopId =this.shopId
  481. this.$Request.get(`/app/vip/get-can-reduce/${shopId}`).then((res) => {
  482. console.log(res, '会员立减')
  483. if (res.code == 0 && res.data) {
  484. this.Vipmoney=res.data
  485. }
  486. })
  487. },
  488. getIntegralRules() {
  489. let data = {
  490. money: this.totalPrice1
  491. }
  492. this.$Request.get('/app/userintegral/getIntegralByMoney', data).then((res) => {
  493. console.log(res, '999')
  494. if (res.code == 0) {
  495. this.intergral = res.data.intergral
  496. this.maxIntegral = res.data.maxIntegral
  497. this.ruleAmount1 = res.data.ruleAmount1
  498. this.ruleAmount2 = res.data.ruleAmount2
  499. this.ruleMaxAmount = res.data.ruleMaxAmount
  500. this.ruleValue1 = res.data.ruleValue1
  501. this.ruleValue2 = res.data.ruleValue2
  502. if (res.data.flag == 1) {
  503. this.isIntegral = true
  504. } else {
  505. this.isIntegral = false
  506. }
  507. }
  508. })
  509. },
  510. //获取骑手上下班时间
  511. getQishou() {
  512. this.$Request.get('/app/tbindent/work-time').then((res) => {
  513. console.log(res, 'p')
  514. if (res.code == 0 && res.data) {
  515. if (this.orderType == 2) {
  516. if (this.autoSendOrder == 0) {
  517. //0是平台配
  518. this.workStart = parseInt(res.data.workingHoursOfRider.substring(0, 2))
  519. this.workStartMin = parseInt(res.data.workingHoursOfRider.substring(3, 5))
  520. this.workEnd = parseInt(res.data.workingHoursOfRider.substring(6, 8))
  521. } else if (this.autoSendOrder == 1) {
  522. this.workStart = parseInt(this.shopDet.businessHours.substring(0, 2))
  523. this.workStartMin = parseInt(this.shopDet.businessHours.substring(3, 5))
  524. this.workEnd = parseInt(this.shopDet.lockHours.substring(0, 2))
  525. }
  526. } else if (this.orderType == 1) {
  527. this.workStart = parseInt(this.shopDet.businessHours.substring(0, 2))
  528. this.workStartMin = parseInt(this.shopDet.businessHours.substring(3, 5))
  529. this.workEnd = parseInt(this.shopDet.lockHours.substring(0, 2))
  530. }
  531. this.yusongTime = res.data.timeOfRider
  532. var date = new Date()
  533. var currentHours = date.getHours()
  534. var currentMinute = date.getMinutes()
  535. var temp = []
  536. // currentHours = 12;
  537. var temp_time = []
  538. //如果当前时间大于20点
  539. var minite = parseInt(this.yusongTime - parseInt(this.yusongTime / 60) * 60)
  540. if (parseInt(this.yusongTime / 60) == 0) {
  541. var h1 = 0
  542. var h2 = parseInt(this.yusongTime - parseInt(this.yusongTime / 60) * 60)
  543. } else {
  544. var h1 = parseInt(this.yusongTime / 60)
  545. var h2 = parseInt(this.yusongTime - parseInt(this.yusongTime / 60) * 60)
  546. }
  547. var acc = currentHours + h1
  548. var bcc = currentMinute + h2
  549. var teshu = this.workStart + h1
  550. if (bcc >= 60) {
  551. var b = bcc - 60
  552. var a = acc + 1
  553. } else {
  554. var b = bcc
  555. var a = acc
  556. }
  557. var a1 = a + 1
  558. var s1 = a.toString()
  559. var s2 = a1.toString()
  560. var e1 = b.toString()
  561. console.log(this.workEnd, h1, currentHours, 'o')
  562. var cc = (this.workStartMin + h2).toString()
  563. if (currentHours >= this.workEnd - h1) {
  564. var time2 = teshu + 1
  565. // this.data.warning = '当前时间段无骑手配送,现在下单,最早将于明日'+teshu + ':00'+'送达'
  566. uni.showModal({
  567. title: '提示',
  568. content: '当前时间段无骑手配送,现在下单,最早将于明日' + teshu + ':00' + '送达',
  569. success: (res) => {
  570. if (res.confirm) {
  571. } else if (res.cancel) {
  572. }
  573. }
  574. })
  575. // this.data.startDate = '明日 | '+teshu + ':00' + '-' + time2 + ':00'
  576. // this.data.startDate = '明早 | '+a + ':'+b + '-' + a1 + ':'+b
  577. temp[0] = ['明天']
  578. temp[1] = []
  579. // console.log(teshu,'明1',this.workEnd-h1)
  580. for (let i = teshu; i < this.workEnd - h1; ) {
  581. var i1 = i + 1
  582. var ss1 = i.toString()
  583. var ss2 = i1.toString()
  584. // console.log(ss1,'明')
  585. temp[1].push(ss1.padStart(2, 0) + ':' + cc.padStart(2, 0) + '-' + ss2.padStart(2, 0) + ':' + cc.padStart(2, 0))
  586. i += 1
  587. }
  588. } else if (currentHours < this.workStart) {
  589. var time2 = teshu + 1
  590. uni.showModal({
  591. title: '提示',
  592. content: '当前时间段无骑手配送,现在下单,最早将于今日' + teshu + ':00' + '送达',
  593. success: (res) => {
  594. if (res.confirm) {
  595. } else if (res.cancel) {
  596. }
  597. }
  598. })
  599. temp[0] = ['今天', '明天']
  600. temp[1] = []
  601. for (let i = teshu; i < this.workEnd - h1; ) {
  602. var i1 = i + 1
  603. var ss1 = i.toString()
  604. var ss2 = i1.toString()
  605. temp[1].push(ss1.padStart(2, 0) + ':' + cc.padStart(2, 0) + '-' + ss2.padStart(2, 0) + ':' + cc.padStart(2, 0))
  606. i += 1
  607. }
  608. } else {
  609. temp[0] = ['今天', '明天']
  610. temp[1] = []
  611. for (let i = a; i < this.workEnd - h1; ) {
  612. var i1 = i + 1
  613. var ss1 = i.toString()
  614. var ss2 = i1.toString()
  615. temp[1].push(ss1.padStart(2, 0) + ':' + e1.padStart(2, 0) + '-' + ss2.padStart(2, 0) + ':' + e1.padStart(2, 0))
  616. i += 1
  617. }
  618. }
  619. // this.$queue.setData({
  620. // multiArray:temp,
  621. // })
  622. this.data.multiArray = temp
  623. if (this.data.warning != '') {
  624. wx.showToast({
  625. title: this.data.warning,
  626. icon: 'none',
  627. duration: 3000
  628. })
  629. }
  630. }
  631. })
  632. },
  633. bindMultiPickerColumnChange: function (e) {
  634. console.log(e,'e')
  635. console.log('第几列发生变化', e.detail.column)
  636. console.log('选择第几个', e.detail.value)
  637. let c = e.detail.column
  638. let v = e.detail.value
  639. var time = []
  640. var date = new Date()
  641. var currentHours = date.getHours()
  642. var currentMinute = date.getMinutes()
  643. var minite = parseInt(this.yusongTime - parseInt(this.yusongTime / 60) * 60)
  644. if (parseInt(this.yusongTime / 60) == 0) {
  645. var h1 = 0
  646. var h2 = parseInt(this.yusongTime - parseInt(this.yusongTime / 60) * 60)
  647. } else {
  648. var h1 = parseInt(this.yusongTime / 60)
  649. var h2 = parseInt(this.yusongTime - parseInt(this.yusongTime / 60) * 60)
  650. }
  651. var acc = currentHours + h1
  652. var bcc = currentMinute + h2
  653. var teshu = this.workStart + h1
  654. if (bcc >= 60) {
  655. var b = bcc - 60
  656. var a = acc + 1
  657. } else {
  658. var b = bcc
  659. var a = acc
  660. }
  661. var a1 = a + 1
  662. var s1 = a.toString()
  663. var s2 = a1.toString()
  664. var e1 = b.toString()
  665. var cc = (this.workStartMin + h2).toString()
  666. // console.log(this.workStartMin,h2,'kkk')
  667. var temp = this.data.multiArray
  668. // currentHours = 12;
  669. if (c == 0) {
  670. if (temp[c][v] == '今天') {
  671. temp[1] = []
  672. for (let i = a; i < this.workEnd - h1; ) {
  673. var i1 = i + 1
  674. var ss1 = i.toString()
  675. var ss2 = i1.toString()
  676. temp[1].push(ss1.padStart(2, 0) + ':' + e1.padStart(2, 0) + '-' + ss2.padStart(2, 0) + ':' + e1.padStart(2, 0))
  677. i += 1
  678. }
  679. } else {
  680. temp[1] = []
  681. for (let i = teshu; i < this.workEnd - h1; ) {
  682. var i1 = i + 1
  683. var ss1 = i.toString()
  684. var ss2 = i1.toString()
  685. temp[1].push(ss1.padStart(2, 0) + ':' + cc.padStart(2, 0) + '-' + ss2.padStart(2, 0) + ':' + cc.padStart(2, 0))
  686. i += 1
  687. }
  688. }
  689. // this.$queue.setData({
  690. // multiArray:temp
  691. // })
  692. this.data.multiArray = temp
  693. this.$forceUpdate()
  694. }
  695. },
  696. bindStartMultiPickerChange: function (e) {
  697. let temp = this.data.multiArray
  698. // this.$queue.setData({
  699. // startDate:temp[0][e.detail.value[0]]+' | '+temp[1][e.detail.value[1]]
  700. // })
  701. this.data.startDate = temp[0][e.detail.value[0]] + ' | ' + temp[1][e.detail.value[1]]
  702. console.log(temp[0][e.detail.value[0]], temp[1][e.detail.value[1]].substring(0, 5), getDate(new Date(), 2).fullDate)
  703. if (this.data.startDate) {
  704. this.reservationFlag = 1
  705. if (temp[0][e.detail.value[0]] == '今天') {
  706. var date = getDate(new Date()).fullDate
  707. this.expectDeliveryTime = date + ' ' + temp[1][e.detail.value[1]].substring(0, 5) + ':00'
  708. } else if (temp[0][e.detail.value[0]] == '明天') {
  709. var date = getDate(new Date(), 1).fullDate
  710. this.expectDeliveryTime = date + ' ' + temp[1][e.detail.value[1]].substring(0, 5) + ':00'
  711. } else if (temp[0][e.detail.value[0]] == '后天') {
  712. var date = getDate(new Date(), 2).fullDate
  713. this.expectDeliveryTime = date + ' ' + temp[1][e.detail.value[1]].substring(0, 5) + ':00'
  714. }
  715. }
  716. },
  717. goCash() {
  718. uni.navigateTo({
  719. url: '/my/wallet/index'
  720. })
  721. },
  722. getMsgData() {
  723. this.$Request.get('/app/userintegral/findUserMessage').then((res) => {
  724. if (res.code == 0 && res.data) {
  725. this.userMoney = res.data.userMoney ? res.data.userMoney : 0
  726. }
  727. })
  728. },
  729. //获取店铺详情
  730. getShopDet(shopId) {
  731. let data = {
  732. shopId,
  733. lng: this.lng,
  734. lat: this.lat
  735. }
  736. this.$Request.get('/app/goods/selectGoodsList', data).then((res) => {
  737. console.log(res, 'data')
  738. if (res.code == 0 && res.data) {
  739. this.reservationOpenFlag = res.data.goodsShop.reservationOpenFlag
  740. this.autoSendOrder = res.data.goodsShop.autoSendOrder
  741. this.shopDet = res.data.goodsShop
  742. this.ifPaotui = res.data.goodsShop.enableFullReductionFlag
  743. this.getOrderList()
  744. // this.getQishou()
  745. }
  746. })
  747. },
  748. goBack() {
  749. uni.navigateBack({})
  750. },
  751. isShow() {
  752. this.show = true
  753. },
  754. //选择优惠活动弹框
  755. huodongShow() {
  756. this.youhui = true
  757. },
  758. getDistance() {
  759. if (this.address.lng && this.dataList.shopLng) {
  760. let data = {
  761. ol: this.address.lng,
  762. od: this.address.lat,
  763. dl: this.dataList.shopLng,
  764. dd: this.dataList.shopLat
  765. }
  766. this.$Request.post('/app/tbindent/distance', data).then((res) => {
  767. if (res.code == 0) {
  768. this.distance = res.data
  769. if (this.distance > Number(this.dataList.distributionDistance)) {
  770. this.isTrue = true
  771. } else {
  772. this.isTrue = false
  773. }
  774. }
  775. })
  776. }
  777. },
  778. close() {
  779. this.show = false
  780. },
  781. closeYouhui() {
  782. this.youhui = false
  783. },
  784. switchTab(e) {
  785. this.orderType = e
  786. this.coupon = ''
  787. // this.huodong = ''
  788. if (JSON.stringify(this.address) != '{}') {
  789. this.getDistance()
  790. }
  791. if (this.orderType == 2) {
  792. this.totalPrice1 = parseFloat(
  793. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  794. ).toFixed(2)
  795. } else {
  796. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  797. }
  798. console.log(this.totalPrice1,'切换')
  799. if (this.coupon) {
  800. if (this.orderType == 2) {
  801. this.totalPrice1 = parseFloat(
  802. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  803. ).toFixed(2)
  804. } else {
  805. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  806. }
  807. let totalMoney = parseFloat(
  808. this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
  809. )
  810. if (totalMoney <= 0) {
  811. this.totalPrice1 = 0.01
  812. } else {
  813. this.totalPrice1 = totalMoney
  814. }
  815. }
  816. if (this.huodong) {
  817. if (this.orderType == 2) {
  818. this.totalPrice1 = parseFloat(
  819. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  820. ).toFixed(2)
  821. } else {
  822. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  823. }
  824. let totalMoney = parseFloat(
  825. this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
  826. )
  827. if (totalMoney <= 0) {
  828. this.totalPrice1 = 0.01
  829. } else {
  830. this.totalPrice1 = totalMoney
  831. }
  832. }if (this.Vipmoney.canReduceFlag=='1') {
  833. if (this.orderType == 2) {
  834. this.totalPrice1 = parseFloat(
  835. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  836. ).toFixed(2)
  837. } else {
  838. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  839. }
  840. let totalMoney = parseFloat(
  841. this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
  842. )
  843. console.log(this.totalPrice1,this.coupon.money,this.Vipmoney.reduceAmount,totalMoney,'totalMoney')
  844. if (totalMoney <= 0) {
  845. this.totalPrice1 = 0.01
  846. } else {
  847. this.totalPrice1 = totalMoney
  848. }
  849. }
  850. },
  851. // 删除优惠券
  852. detCoupon() {
  853. let data = {
  854. orderId: this.dataList.orderId
  855. }
  856. this.$Request.post('/app/order/deleteCouponByOrderId', data).then((res) => {
  857. if (res.code == 0) {
  858. }
  859. })
  860. },
  861. // 选择优惠券
  862. selCoupon(item) {
  863. this.coupon = item
  864. if (this.orderType == 2) {
  865. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  866. } else {
  867. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  868. }
  869. let totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
  870. if (totalMoney <= 0) {
  871. this.totalPrice1 = 0.01
  872. } else {
  873. this.totalPrice1 = totalMoney
  874. }
  875. let data = {
  876. parentId: this.dataList.parentId,
  877. couponId: this.coupon ? this.coupon.id : ''
  878. }
  879. this.$Request.post('/app/order/employCoupon', data).then((res) => {
  880. if (res.code == 0) {
  881. this.show = false
  882. }
  883. })
  884. },
  885. //选择活动activityId
  886. selctHuo(item) {
  887. this.huodong = item
  888. if (this.orderType == 2) {
  889. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  890. } else {
  891. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  892. }
  893. let totalMoney = parseFloat(this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
  894. if (totalMoney <= 0) {
  895. this.totalPrice1 = 0.01
  896. } else {
  897. this.totalPrice1 = totalMoney
  898. }
  899. this.youhui = false
  900. },
  901. // 优惠卷列表
  902. getCouponList() {
  903. // console.log(this.paotuiMoney)
  904. // console.log(this.dabaoMoney, '123123')
  905. let minMoney =
  906. this.orderType == 2
  907. ? parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney)).toFixed(2)
  908. : parseFloat(this.totalPrice).toFixed(2)
  909. let data = {
  910. shopId: this.dataList.shopId,
  911. page: 1,
  912. limit: 10,
  913. minMoney: minMoney
  914. }
  915. this.$Request.get('/app/coupon/selectUserCouponList', data).then((res) => {
  916. if (res.code == 0) {
  917. this.couponList = res.data.list
  918. console.log(this.couponList, 'this.couponList', this.coupon)
  919. if (this.coupon) {
  920. let activityExists = this.couponList.some((item) => item.couponId === this.coupon.couponId)
  921. if (!activityExists) {
  922. this.coupon = ''
  923. if (this.orderType == 2) {
  924. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  925. } else {
  926. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  927. }
  928. let totalMoney = parseFloat(
  929. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  930. ).toFixed(2)
  931. if (totalMoney <= 0) {
  932. this.totalPrice1 = 0.01
  933. } else {
  934. this.totalPrice1 = totalMoney
  935. }
  936. uni.showModal({
  937. title: '提示',
  938. content: '当前选择的优惠券已过期,请重新选择',
  939. success: (res) => {
  940. if (res.confirm) {
  941. this.coupon = ''
  942. } else if (res.cancel) {
  943. this.coupon = ''
  944. }
  945. }
  946. })
  947. }
  948. }
  949. }
  950. })
  951. },
  952. // 优惠活动列表
  953. getHuoList() {
  954. let data = {
  955. orderId: this.dataList.orderId
  956. }
  957. this.$Request.get(`/app/activity/suit-activity/${this.dataList.orderId}`, data).then((res) => {
  958. if (res.code == 0) {
  959. this.huoList = res.data
  960. // console.log(this.huodong)
  961. if (this.huodong) {
  962. // console.log(this.huodong,'有呢')
  963. let activityExists = this.huoList.some((item) => item.activityId === this.huodong.activityId)
  964. if (!activityExists) {
  965. this.huodong = ''
  966. if (this.orderType == 2) {
  967. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  968. } else {
  969. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  970. }
  971. let totalMoney = parseFloat(
  972. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  973. ).toFixed(2)
  974. if (totalMoney <= 0) {
  975. this.totalPrice1 = 0.01
  976. } else {
  977. this.totalPrice1 = totalMoney
  978. }
  979. uni.showModal({
  980. title: '提示',
  981. content: '当前选择的优惠活动已过期,请重新选择',
  982. success: (res) => {
  983. if (res.confirm) {
  984. this.huodong = ''
  985. } else if (res.cancel) {
  986. this.huodong = ''
  987. }
  988. }
  989. })
  990. }
  991. }
  992. // 匹配出最优惠的活动
  993. if (this.huoList.length) {
  994. this.huodong = this.huoList.reduce((prev, current) => (prev.discountAmount > current.discountAmount ? prev : current))
  995. this.selctHuo(this.huodong)
  996. }
  997. // for(var i=0;i<this.huoList.length;i++){
  998. // if(this.huodong!=''&&this.huodong.activityId!=this.huoList[i].activityId){
  999. // console.log('优惠活动过期')
  1000. // }
  1001. // }
  1002. // if(this.huoList.length==0){
  1003. // this.huodong=''
  1004. // }
  1005. }
  1006. })
  1007. },
  1008. //拼单支付成功取消订单
  1009. cancelPinDan() {
  1010. // if (this.orderId) {
  1011. // let data = {
  1012. // orderId: this.orderId
  1013. // };
  1014. // this.$Request.post('/app/order/deleteOrder', data).then(res => {
  1015. // if (res.code == 0) {
  1016. // uni.removeStorageSync('orderId');
  1017. // }
  1018. // });
  1019. // }
  1020. },
  1021. // 商品列表
  1022. getOrderList() {
  1023. // 显示加载提示
  1024. uni.showLoading({
  1025. title: '加载中', // 加载提示文本
  1026. mask: true // 是否显示透明蒙层,防止触摸穿透
  1027. })
  1028. this.paotuiMoney = 0
  1029. this.totalPrice1 = 0
  1030. if (this.status == 0) {
  1031. console.log(6666)
  1032. this.payContinue()
  1033. return
  1034. }
  1035. let data = {
  1036. shopId: this.shopId,
  1037. status: 1,
  1038. page: 1,
  1039. limit: 1000
  1040. // orderType: this.orderType
  1041. }
  1042. // console.log(data)
  1043. this.$Request.get('/app/order/selectAllOrderList', data).then((res) => {
  1044. // console.log(res)
  1045. uni.hideLoading()
  1046. if (res.code == 0 && res.data.pageUtils.list.length) {
  1047. this.GoodsorderId = res.data.pageUtils.list[0].orderId
  1048. this.dataList = res.data.pageUtils.list[0]
  1049. if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
  1050. this.dabaoMoney = 0
  1051. this.dataList.orderGoodsList[0].forEach((res) => {
  1052. res.goodsPicture = res.goodsPicture.split(',')
  1053. this.dabaoMoney += res.goodsPack * res.goodsNum
  1054. this.goodsMoney += res.goodsPrice * res.goodsNum
  1055. this.goodsMoney = parseFloat(this.goodsMoney + this.dabaoMoney)
  1056. })
  1057. this.goodsList = this.dataList.orderGoodsList[0]
  1058. }
  1059. console.log(this.dataList, this.dabaoMoney, 'kkklll')
  1060. if (this.ifPaotui == 1) {
  1061. this.paotuiMoney = this.dataList.errandMoney
  1062. } else if (this.ifPaotui == 0) {
  1063. // 判断商品金额是否大于最低减免配送费金额
  1064. console.log(this.goodsMoney, '商品总金额', res, this.dataList.exemptMinMoney)
  1065. if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
  1066. this.paotuiMoney = 0
  1067. } else {
  1068. this.paotuiMoney = this.dataList.errandMoney
  1069. }
  1070. }
  1071. this.totalPrice = res.data.money
  1072. console.log(this.totalPrice,'total')
  1073. console.log(this.paotuiMoney,'paotui')
  1074. console.log(this.dabaoMoney,'dabao')
  1075. console.log(this.address.insideDeliveryFee,'free')
  1076. if (this.orderType == 2) {
  1077. this.totalPrice1 = parseFloat(
  1078. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  1079. ).toFixed(2)
  1080. } else {
  1081. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  1082. }
  1083. let totalMoney = parseFloat(
  1084. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  1085. ).toFixed(2)
  1086. if (totalMoney <= 0) {
  1087. this.totalPrice1 = 0.01
  1088. } else {
  1089. this.totalPrice1 = totalMoney
  1090. }
  1091. // console.log(this.dataList)
  1092. this.getCouponList()
  1093. this.getHuoList()
  1094. this.detCoupon()
  1095. this.getDistance()
  1096. }
  1097. // 加载提示关闭
  1098. uni.hideLoading()
  1099. })
  1100. },
  1101. payContinue() {
  1102. let data = {
  1103. orderId: this.orderId,
  1104. page: 1,
  1105. limit: 1000
  1106. }
  1107. console.log(data,'select11')
  1108. this.$Request.get('/app/order/selectOrder', data).then((res) => {
  1109. console.log(res,'select')
  1110. uni.hideLoading()
  1111. if (res.code == 0 && res.data.pageUtils.list.length) {
  1112. this.GoodsorderId = res.data.pageUtils.list[0].orderId
  1113. this.dataList = res.data.pageUtils.list[0]
  1114. if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
  1115. this.dataList.orderGoodsList[0].forEach((res) => {
  1116. res.goodsPicture = res.goodsPicture.split(',')
  1117. this.dabaoMoney += res.goodsPack * res.goodsNum
  1118. this.goodsMoney += res.goodsPrice * res.goodsNum
  1119. this.goodsMoney = parseFloat(this.goodsMoney + this.dabaoMoney)
  1120. })
  1121. this.goodsList = this.dataList.orderGoodsList[0]
  1122. }
  1123. console.log(this.dataList, this.dabaoMoney, 'kkklll')
  1124. if (this.ifPaotui == 1) {
  1125. this.paotuiMoney = this.dataList.errandMoney
  1126. } else if (this.ifPaotui == 0) {
  1127. // 判断商品金额是否大于最低减免配送费金额
  1128. console.log(this.goodsMoney, '商品总金额', res, this.dataList.exemptMinMoney)
  1129. if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
  1130. this.paotuiMoney = 0
  1131. } else {
  1132. this.paotuiMoney = this.dataList.errandMoney
  1133. }
  1134. }
  1135. this.totalPrice = res.data.money
  1136. if (this.orderType == 2) {
  1137. this.totalPrice1 = parseFloat(
  1138. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  1139. ).toFixed(2)
  1140. } else {
  1141. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  1142. }
  1143. let totalMoney = parseFloat(
  1144. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  1145. ).toFixed(2)
  1146. if (totalMoney <= 0) {
  1147. this.totalPrice1 = 0.01
  1148. } else {
  1149. this.totalPrice1 = totalMoney
  1150. }
  1151. // console.log(this.dataList)
  1152. this.getCouponList()
  1153. this.getHuoList()
  1154. this.detCoupon()
  1155. this.getDistance()
  1156. }
  1157. // 加载提示关闭
  1158. uni.hideLoading()
  1159. })
  1160. },
  1161. selectWay(item) {
  1162. this.openWay = item.id
  1163. },
  1164. takeReark() {
  1165. let datas = {
  1166. orderId: this.GoodsorderId,
  1167. remark: this.remark
  1168. }
  1169. this.$Request.post('/app/order/updateOrdersRemark', datas).then((res) => {
  1170. if (res.code == 0) {
  1171. } else {
  1172. uni.showToast({
  1173. title: res.msg,
  1174. icon: 'none'
  1175. })
  1176. }
  1177. })
  1178. },
  1179. toSettlement_throttle: throttle(function () {
  1180. this.toSettlement()
  1181. }, 1000),
  1182. // 立即结算
  1183. toSettlement() {
  1184. if (this.isThrottle == false) {
  1185. return
  1186. }
  1187. if (this.isTrue && this.orderType == 2) {
  1188. uni.showToast({
  1189. title: '超出配送范围',
  1190. icon: 'none'
  1191. })
  1192. reutrn
  1193. }
  1194. if (this.orderType == 2 && !this.address.addressId) {
  1195. uni.showToast({
  1196. title: '请选择收货地址',
  1197. icon: 'none'
  1198. })
  1199. return
  1200. }
  1201. if (this.remark) {
  1202. this.takeReark()
  1203. }
  1204. // if(this.orderType == 1){
  1205. // uni.showToast({
  1206. // title: '是否店内就餐?',
  1207. // icon: 'none'
  1208. // })
  1209. // return
  1210. // }
  1211. uni.showLoading({
  1212. title: '支付中...',
  1213. mask: true // 是否显示透明蒙层,防止触摸穿透
  1214. })
  1215. this.isThrottle = false
  1216. if (this.openWay == 1) {
  1217. //零钱支付
  1218. let data = {
  1219. userId: uni.getStorageSync('userId'),
  1220. type: 1, //支付方式 1表示微信支付、4或5表示支付宝支付
  1221. activityId: this.huodong ? this.huodong.activityId : '',
  1222. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1223. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1224. parentId: this.dataList.parentId,
  1225. couponId: this.coupon ? this.coupon.id : '',
  1226. addressId: this.address.addressId ? this.address.addressId : '',
  1227. orderType: this.orderType
  1228. }
  1229. console.log(data, 'l')
  1230. this.$Request.post('/app/wxPay/balanceOrder', data).then((res) => {
  1231. console.log(res, '结果')
  1232. if (res.code == 0) {
  1233. uni.hideLoading()
  1234. this.$queue.showToast('支付成功')
  1235. this.cancelPinDan()
  1236. setTimeout(() => {
  1237. this.isThrottle = true
  1238. uni.switchTab({
  1239. url: '/pages/order/index'
  1240. })
  1241. }, 1000)
  1242. } else {
  1243. this.$queue.showToast(res.msg)
  1244. this.isThrottle = true
  1245. }
  1246. })
  1247. } else if (this.openWay == 2) {
  1248. //微信支付
  1249. // #ifdef H5
  1250. let data = {
  1251. userId: uni.getStorageSync('userId'),
  1252. type: 1, //支付方式 1表示微信支付、4或5表示支付宝支付
  1253. activityId: this.huodong ? this.huodong.activityId : '',
  1254. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1255. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1256. parentId: this.dataList.parentId,
  1257. couponId: this.coupon ? this.coupon.id : '',
  1258. addressId: this.address.addressId ? this.address.addressId : '',
  1259. orderType: this.orderType,
  1260. type: 2
  1261. }
  1262. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1263. uni.hideLoading()
  1264. if (res.code == 0) {
  1265. this.callPay(res.data)
  1266. } else {
  1267. uni.showToast({
  1268. title: res.msg,
  1269. icon: 'none'
  1270. })
  1271. this.isThrottle = true
  1272. }
  1273. })
  1274. // #endif
  1275. // #ifdef MP-WEIXIN
  1276. this.$Request.get('/app/new-pay/enable-new-pay').then((res) => {
  1277. console.log(res, '987')
  1278. if (res.code == 0) {
  1279. let data = {
  1280. userId: uni.getStorageSync('userId'),
  1281. //支付方式 1表示微信支付、4或5表示支付宝支付
  1282. // type: 4,
  1283. activityId: this.huodong ? this.huodong.activityId : '',
  1284. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1285. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1286. parentId: this.dataList.parentId,
  1287. couponId: this.coupon ? this.coupon.id : '',
  1288. addressId: this.address.addressId ? this.address.addressId : '',
  1289. orderType: this.orderType,
  1290. type: res.enable ? 1 : 3,
  1291. idCard: this.idcard1
  1292. }
  1293. console.log(data,'xinjiu')
  1294. if (res.enable) {
  1295. console.log('xin')
  1296. this.newPay(data)
  1297. } else {
  1298. console.log('jiu')
  1299. this.oldPay(data)
  1300. }
  1301. }
  1302. })
  1303. // #endif
  1304. // #ifdef APP
  1305. let data = {
  1306. type: 1,
  1307. parentId: this.dataList.parentId,
  1308. couponId: this.coupon ? this.coupon.id : '',
  1309. addressId: this.address.addressId ? this.address.addressId : '',
  1310. orderType: this.orderType
  1311. }
  1312. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1313. console.log(res,'wxaa')
  1314. this.showpay = false
  1315. if (res.code == 0) {
  1316. this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data))
  1317. } else {
  1318. this.isThrottle = true
  1319. }
  1320. })
  1321. // #endif
  1322. } else if (this.openWay == 3) {
  1323. // #ifdef H5
  1324. let data = {
  1325. type: 5,
  1326. parentId: this.dataList.parentId,
  1327. couponId: this.coupon ? this.coupon.id : '',
  1328. addressId: this.address.addressId ? this.address.addressId : '',
  1329. orderType: this.orderType
  1330. }
  1331. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1332. this.showpay = false
  1333. this.isThrottle = true
  1334. const div = document.createElement('div')
  1335. div.innerHTML = res.data //此处form就是后台返回接收到的数据
  1336. document.body.appendChild(div)
  1337. document.forms[0].submit()
  1338. })
  1339. // #endif
  1340. // #ifdef APP
  1341. let data = {
  1342. type: 4,
  1343. parentId: this.dataList.parentId,
  1344. couponId: this.coupon ? this.coupon.id : '',
  1345. addressId: this.address.addressId ? this.address.addressId : '',
  1346. orderType: this.orderType
  1347. }
  1348. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1349. this.showpay = false
  1350. this.setPayment('alipay', res.data)
  1351. })
  1352. // #endif
  1353. }
  1354. },
  1355. newPay(data) {
  1356. this.$Request.get('/app/order/get-pay-param', data).then((res) => {
  1357. console.log(res, '新支付')
  1358. if (res.code == 0) {
  1359. uni.requestPayment({
  1360. provider: 'wxpay',
  1361. timeStamp: res.timeStamp,
  1362. nonceStr: res.nonceStr,
  1363. package: res.packageStr,
  1364. signType: res.signType,
  1365. paySign: res.paySign,
  1366. success: (suc) => {
  1367. this.cancelPinDan()
  1368. uni.hideLoading()
  1369. this.$queue.showToast('支付成功')
  1370. setTimeout(() => {
  1371. this.isThrottle = true
  1372. uni.switchTab({
  1373. url: '/pages/order/index'
  1374. })
  1375. }, 1000)
  1376. },
  1377. fail: (err) => {
  1378. console.log('fail:' + JSON.stringify(err))
  1379. this.isThrottle = true
  1380. uni.setStorageSync('isClear', true)
  1381. uni.showToast({
  1382. title: '支付失败',
  1383. icon: 'none',
  1384. mask: true
  1385. })
  1386. setTimeout(() => {
  1387. uni.reLaunch({
  1388. url: '/pages/order/index'
  1389. })
  1390. }, 1500)
  1391. }
  1392. })
  1393. } else {
  1394. uni.showToast({
  1395. title: res.msg,
  1396. icon: 'none'
  1397. })
  1398. this.isThrottle = true
  1399. }
  1400. })
  1401. },
  1402. oldPay(data) {
  1403. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1404. console.log(res, '旧支付')
  1405. // uni.hideLoading();
  1406. if (res.code == 0) {
  1407. uni.requestPayment({
  1408. provider: 'wxpay',
  1409. timeStamp: res.data.timestamp,
  1410. nonceStr: res.data.noncestr,
  1411. package: res.data.package,
  1412. signType: res.data.signType,
  1413. paySign: res.data.sign,
  1414. success: (suc) => {
  1415. this.cancelPinDan()
  1416. uni.hideLoading()
  1417. this.$queue.showToast('支付成功')
  1418. setTimeout(() => {
  1419. this.isThrottle = true
  1420. uni.switchTab({
  1421. url: '/pages/order/index'
  1422. })
  1423. }, 1000)
  1424. },
  1425. fail: (err) => {
  1426. console.log('fail:' + JSON.stringify(err))
  1427. this.isThrottle = true
  1428. uni.setStorageSync('isClear', true)
  1429. uni.showToast({
  1430. title: '支付失败',
  1431. icon: 'none',
  1432. mask: true
  1433. })
  1434. setTimeout(() => {
  1435. uni.reLaunch({
  1436. url: '/pages/order/index'
  1437. })
  1438. }, 1500)
  1439. }
  1440. })
  1441. } else {
  1442. uni.showToast({
  1443. title: res.msg,
  1444. icon: 'none'
  1445. })
  1446. this.isThrottle = true
  1447. }
  1448. })
  1449. },
  1450. callPay: function (response) {
  1451. if (typeof WeixinJSBridge === 'undefined') {
  1452. if (document.addEventListener) {
  1453. document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false)
  1454. } else if (document.attachEvent) {
  1455. document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response))
  1456. document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response))
  1457. }
  1458. } else {
  1459. this.onBridgeReady(response)
  1460. }
  1461. },
  1462. onBridgeReady: function (response) {
  1463. let that = this
  1464. if (!response.package) {
  1465. return
  1466. }
  1467. WeixinJSBridge.invoke(
  1468. 'getBrandWCPayRequest',
  1469. {
  1470. appId: response.appid, //公众号名称,由商户传入
  1471. timeStamp: response.timestamp, //时间戳,自1970年以来的秒数
  1472. nonceStr: response.noncestr, //随机串
  1473. package: response.package,
  1474. signType: response.signType, //微信签名方式:
  1475. paySign: response.sign //微信签名
  1476. },
  1477. function (res) {
  1478. if (res.err_msg === 'get_brand_wcpay_request:ok') {
  1479. // 使用以上方式判断前端返回,微信团队郑重提示:
  1480. //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
  1481. that.cancelPinDan()
  1482. that.$queue.showToast('支付成功')
  1483. setTimeout(function () {
  1484. uni.switchTab({
  1485. url: '/pages/order/index'
  1486. })
  1487. that.isThrottle = true
  1488. }, 1000)
  1489. } else {
  1490. uni.hideLoading()
  1491. that.isThrottle = true
  1492. }
  1493. WeixinJSBridge.log(response.err_msg)
  1494. }
  1495. )
  1496. },
  1497. isCheckPay(code, name, order) {
  1498. if (code == 0) {
  1499. console.log('999999999999')
  1500. this.setPayment(name, order)
  1501. } else {
  1502. uni.hideLoading()
  1503. uni.showToast({
  1504. title: '支付信息有误'
  1505. })
  1506. this.isThrottle = true
  1507. }
  1508. },
  1509. setPayment(name, order) {
  1510. console.log(777777777, name, order)
  1511. uni.requestPayment({
  1512. provider: name,
  1513. orderInfo: order, //微信、支付宝订单数据
  1514. success: (res) => {
  1515. uni.hideLoading()
  1516. this.cancelPinDan()
  1517. uni.showLoading({
  1518. title: '支付成功',
  1519. icon: 'none'
  1520. })
  1521. setTimeout(() => {
  1522. this.isThrottle = true
  1523. uni.navigateBack()
  1524. }, 1000)
  1525. },
  1526. fail: (err) => {
  1527. uni.hideLoading()
  1528. this.isThrottle = true
  1529. },
  1530. complete: () => {
  1531. this.isThrottle = true
  1532. uni.hideLoading()
  1533. }
  1534. })
  1535. },
  1536. // 获取选择的地址
  1537. getAddressDet(e) {
  1538. let data = {
  1539. addressId: e
  1540. }
  1541. this.$Request.get('/app/address/selectAddressById', data).then((res) => {
  1542. console.log(res, 77777777)
  1543. if (res.code == 0) {
  1544. this.address = res.data
  1545. if (this.address.insideAddressId) {
  1546. this.getInsideDeliveryFee(this.address.insideAddressId)
  1547. } else {
  1548. this.getInsideDeliveryFee(0)
  1549. }
  1550. if (JSON.stringify(this.address) != '{}') {
  1551. this.getDistance()
  1552. }
  1553. uni.removeStorageSync('addressId')
  1554. }
  1555. })
  1556. },
  1557. // 获取地址列表
  1558. getAddressList() {
  1559. let data = {
  1560. page: 1,
  1561. limit: 100
  1562. }
  1563. this.$Request.get('/app/address/selectAddressList', data).then((res) => {
  1564. console.log(res, 741852)
  1565. if (res.code == 0 && res.data.list.length) {
  1566. this.address = res.data.list[0]
  1567. res.data.list.forEach((ret) => {
  1568. if (ret.addressDefault == 1) {
  1569. this.address = ret
  1570. }
  1571. })
  1572. console.log(this.address, '我的地址列表460777')
  1573. if (this.address.insideAddressId) {
  1574. this.getInsideDeliveryFee(this.address.insideAddressId)
  1575. } else {
  1576. this.getInsideDeliveryFee(0)
  1577. }
  1578. if (JSON.stringify(this.address) != '{}') {
  1579. this.getDistance()
  1580. }
  1581. }
  1582. })
  1583. },
  1584. getInsideDeliveryFee(insideAddressId) {
  1585. this.$Request.get(`/app/inside-address/${insideAddressId}`).then((res) => {
  1586. console.log(res, 987456)
  1587. if (res.code == 0) {
  1588. this.address.insideDeliveryFee = res.data.deliveryFee || 0
  1589. }
  1590. })
  1591. },
  1592. goAddress() {
  1593. uni.navigateTo({
  1594. url: '/my/address/index?add=1'
  1595. })
  1596. },
  1597. // 点击调起地图查看位置
  1598. goMap() {
  1599. // let that = this
  1600. // let plugin = requirePlugin('routePlan');
  1601. // let key = 'A3RBZ-23MHW-PTPR5-RLCER-UJTXQ-JIF2G'; //使用在腾讯位置服务申请的key
  1602. // let referer = that.dataList.shopName; //调用插件的app的名称
  1603. // let endPoint = JSON.stringify({ //终点
  1604. // 'name': that.dataList.shopName,
  1605. // 'latitude': that.dataList.shopLat,
  1606. // 'longitude': that.dataList.shopLng,
  1607. // });
  1608. // wx.navigateTo({
  1609. // url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
  1610. // });
  1611. let lati = parseFloat(this.dataList.shopLat)
  1612. let longi = parseFloat(this.dataList.shopLng)
  1613. uni.authorize({
  1614. scope: 'scope.userLocation',
  1615. success: (res) => {
  1616. uni.openLocation({
  1617. name: this.dataList.shopName,
  1618. latitude: lati,
  1619. longitude: longi,
  1620. success: () => {}
  1621. })
  1622. },
  1623. fail: (err) => {}
  1624. })
  1625. },
  1626. // 打电话
  1627. call() {
  1628. uni.makePhoneCall({
  1629. phoneNumber: this.dataList.shopPhone
  1630. })
  1631. }
  1632. }
  1633. }
  1634. </script>
  1635. <style scoped>
  1636. .hintPopul {
  1637. width: 100%;
  1638. height: 100vh;
  1639. position: fixed;
  1640. top: 0;
  1641. background: rgba(0, 0, 0, 0.4);
  1642. z-index: 999;
  1643. }
  1644. .content_ {
  1645. position: absolute;
  1646. left: 0;
  1647. right: 0;
  1648. top: 0;
  1649. bottom: 0;
  1650. margin: auto;
  1651. text-align: center;
  1652. width: 500rpx;
  1653. height: 400rpx;
  1654. border-radius: 20rpx;
  1655. background-color: #fff;
  1656. padding-top: 120rpx;
  1657. }
  1658. .content_ image {
  1659. position: absolute;
  1660. top: -50rpx;
  1661. left: 0;
  1662. right: 0;
  1663. margin: auto;
  1664. }
  1665. .hintText {
  1666. font-size: 30rpx;
  1667. }
  1668. .Btns {
  1669. width: 460rpx;
  1670. height: 60rpx;
  1671. line-height: 60rpx;
  1672. text-align: center;
  1673. background: #fcd202;
  1674. font-size: 28rpx;
  1675. border: 2rpx solid #fcd202;
  1676. color: #333333;
  1677. border-radius: 50rpx;
  1678. font-weight: 700;
  1679. margin: auto;
  1680. }
  1681. .goods_address {
  1682. width: 94%;
  1683. background: #ffffff;
  1684. height: 120rpx;
  1685. margin: 20rpx auto 0;
  1686. border-radius: 18rpx;
  1687. }
  1688. .address_box {
  1689. width: 90%;
  1690. margin: 0 auto;
  1691. height: 120rpx;
  1692. display: flex;
  1693. line-height: 120rpx;
  1694. }
  1695. .address_name {
  1696. flex: 1;
  1697. font-size: 30rpx;
  1698. }
  1699. .address_image {
  1700. /* flex: 1; */
  1701. display: flex;
  1702. justify-content: flex-end;
  1703. align-items: center;
  1704. }
  1705. .address_image image {
  1706. width: 25rpx;
  1707. height: 40rpx;
  1708. }
  1709. .songda_image image {
  1710. width: 20rpx;
  1711. height: 30rpx;
  1712. margin-left: 20rpx;
  1713. }
  1714. /* 地址 */
  1715. .address {
  1716. width: 88%;
  1717. margin: 3% auto;
  1718. padding: 3%;
  1719. display: flex;
  1720. background-color: #ffffff;
  1721. border-radius: 18rpx;
  1722. }
  1723. .adderss_le {
  1724. width: 90%;
  1725. line-height: 1.5;
  1726. }
  1727. .adderss_le_text {
  1728. font-size: 30rpx;
  1729. font-weight: bold;
  1730. color: #333333;
  1731. }
  1732. .adderss_le_text2 {
  1733. font-size: 24rpx;
  1734. font-weight: 500;
  1735. color: #999999;
  1736. display: flex;
  1737. }
  1738. .adderss_le_text2 view {
  1739. margin-left: 2%;
  1740. }
  1741. .adderss_le_text2 view:first-child {
  1742. margin-left: 0;
  1743. }
  1744. .adderss_ri {
  1745. width: 10%;
  1746. text-align: right;
  1747. line-height: 3;
  1748. }
  1749. .adderss_ri image {
  1750. width: 18rpx;
  1751. height: 30rpx;
  1752. }
  1753. /* 商品 */
  1754. .food {
  1755. width: 94%;
  1756. margin: 3% auto;
  1757. padding: 3%;
  1758. background-color: #ffffff;
  1759. border-radius: 18rpx;
  1760. }
  1761. .food_top {
  1762. display: flex;
  1763. justify-content: space-between;
  1764. align-items: center;
  1765. font-size: 32rpx;
  1766. font-weight: bold;
  1767. }
  1768. .food_bottom {
  1769. margin-top: 20rpx;
  1770. color: #666666;
  1771. font-size: 28rpx;
  1772. line-height: 45rpx;
  1773. }
  1774. .bottom_text {
  1775. color: #ea0018;
  1776. }
  1777. .tosend_header_food {
  1778. width: 100%;
  1779. display: flex;
  1780. margin-top: 3%;
  1781. }
  1782. .tosend_header_food_le {
  1783. width: 15%;
  1784. }
  1785. .tosend_header_food_le image {
  1786. width: 110rpx;
  1787. height: 110rpx;
  1788. border-radius: 10rpx;
  1789. }
  1790. .tosend_header_food_ce {
  1791. margin: 0 0 0 4%;
  1792. width: 57%;
  1793. }
  1794. .tosend_header_food_ri {
  1795. text-align: right;
  1796. width: 25%;
  1797. }
  1798. .tosend_header_food_text {
  1799. font-size: 34rpx;
  1800. font-weight: 500;
  1801. color: #333333;
  1802. line-height: 1.8;
  1803. }
  1804. .tosend_header_food_text text {
  1805. font-size: 25rpx;
  1806. }
  1807. .tosend_header_food_text2 {
  1808. font-size: 28rpx;
  1809. font-weight: 500;
  1810. color: #999999;
  1811. }
  1812. .do_top {
  1813. padding-top: 3%;
  1814. }
  1815. .do_bot {
  1816. padding-bottom: 3%;
  1817. border-bottom: 2rpx solid #e6e6e6;
  1818. }
  1819. .tosend_header_do {
  1820. width: 100%;
  1821. color: #333333;
  1822. font-size: 30rpx;
  1823. display: flex;
  1824. margin-top: 20rpx;
  1825. line-height: 1.5;
  1826. }
  1827. .tosend_header_do view {
  1828. /* flex: 1; */
  1829. }
  1830. .tosend_header_do_ri {
  1831. text-align: right;
  1832. }
  1833. .tosend_header_do_le2 {
  1834. font-family: PingFang SC;
  1835. font-weight: 500;
  1836. color: #999999;
  1837. padding-top: 1.5%;
  1838. }
  1839. .tosend_header_do_ri2 {
  1840. text-align: right;
  1841. color: #ea0000;
  1842. font-size: 40rpx;
  1843. }
  1844. .tosend_header_do_ri2 text {
  1845. font-size: 30rpx;
  1846. }
  1847. /* 支付 */
  1848. /* .payment_all{
  1849. width: 88%;margin: 3% auto;padding: 3%;background-color: #FFFFFF;
  1850. border-radius: 18rpx;
  1851. }
  1852. .payment{
  1853. width: 100%;display: flex;margin-top: 3%;
  1854. }
  1855. .payment_le{
  1856. width: 13%;
  1857. }
  1858. .payment_le image{
  1859. width: 60rpx;height: 60rpx;
  1860. }
  1861. .payment_ce{
  1862. width: 52%;
  1863. font-size: 30rpx;
  1864. font-weight: bold;
  1865. color: #333333;line-height: 60rpx;
  1866. }
  1867. .payment_ri{
  1868. width: 35%;text-align: right;line-height: 60rpx;
  1869. } */
  1870. /* 结算 */
  1871. .goorder {
  1872. width: 100%;
  1873. padding: 2% 3%;
  1874. position: fixed;
  1875. bottom: 0;
  1876. background-color: #ffffff;
  1877. z-index: 999;
  1878. }
  1879. .goorder_but {
  1880. width: 100%;
  1881. line-height: 3.5;
  1882. text-align: center;
  1883. background: #fcd202;
  1884. border-radius: 36rpx;
  1885. font-weight: 700;
  1886. }
  1887. .goorder_but_ {
  1888. opacity: 0.5;
  1889. }
  1890. .bg {
  1891. background-color: #ffffff;
  1892. }
  1893. .tabBtn {
  1894. /* background-color: #f6f6fa; */
  1895. height: 60rpx;
  1896. line-height: 60rpx;
  1897. color: #999999;
  1898. font-size: 38rpx;
  1899. }
  1900. .active {
  1901. /* width: 82rpx; */
  1902. height: 6rpx;
  1903. background: #fcd202;
  1904. /* position: relative;
  1905. top: -20rpx; */
  1906. z-index: 9;
  1907. }
  1908. </style>