confirmOrder.vue 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985
  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. if (this.coupon) {
  799. let totalMoney = parseFloat(
  800. 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)
  801. )
  802. if (totalMoney <= 0) {
  803. this.totalPrice1 = 0.01
  804. } else {
  805. this.totalPrice1 = totalMoney
  806. }
  807. }
  808. if (this.huodong) {
  809. let totalMoney = parseFloat(
  810. 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)
  811. )
  812. if (totalMoney <= 0) {
  813. this.totalPrice1 = 0.01
  814. } else {
  815. this.totalPrice1 = totalMoney
  816. }
  817. }if (this.Vipmoney.canReduceFlag=='1') {
  818. let totalMoney = parseFloat(
  819. 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)
  820. )
  821. if (totalMoney <= 0) {
  822. this.totalPrice1 = 0.01
  823. } else {
  824. this.totalPrice1 = totalMoney
  825. }
  826. }
  827. },
  828. // 删除优惠券
  829. detCoupon() {
  830. let data = {
  831. orderId: this.dataList.orderId
  832. }
  833. this.$Request.post('/app/order/deleteCouponByOrderId', data).then((res) => {
  834. if (res.code == 0) {
  835. }
  836. })
  837. },
  838. // 选择优惠券
  839. selCoupon(item) {
  840. this.coupon = item
  841. if (this.orderType == 2) {
  842. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  843. } else {
  844. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  845. }
  846. 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)
  847. if (totalMoney <= 0) {
  848. this.totalPrice1 = 0.01
  849. } else {
  850. this.totalPrice1 = totalMoney
  851. }
  852. let data = {
  853. parentId: this.dataList.parentId,
  854. couponId: this.coupon ? this.coupon.id : ''
  855. }
  856. this.$Request.post('/app/order/employCoupon', data).then((res) => {
  857. if (res.code == 0) {
  858. this.show = false
  859. }
  860. })
  861. },
  862. //选择活动activityId
  863. selctHuo(item) {
  864. this.huodong = item
  865. if (this.orderType == 2) {
  866. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  867. } else {
  868. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  869. }
  870. 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)
  871. if (totalMoney <= 0) {
  872. this.totalPrice1 = 0.01
  873. } else {
  874. this.totalPrice1 = totalMoney
  875. }
  876. this.youhui = false
  877. },
  878. // 优惠卷列表
  879. getCouponList() {
  880. // console.log(this.paotuiMoney)
  881. // console.log(this.dabaoMoney, '123123')
  882. let minMoney =
  883. this.orderType == 2
  884. ? parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney)).toFixed(2)
  885. : parseFloat(this.totalPrice).toFixed(2)
  886. let data = {
  887. shopId: this.dataList.shopId,
  888. page: 1,
  889. limit: 10,
  890. minMoney: minMoney
  891. }
  892. this.$Request.get('/app/coupon/selectUserCouponList', data).then((res) => {
  893. if (res.code == 0) {
  894. this.couponList = res.data.list
  895. console.log(this.couponList, 'this.couponList', this.coupon)
  896. if (this.coupon) {
  897. let activityExists = this.couponList.some((item) => item.couponId === this.coupon.couponId)
  898. if (!activityExists) {
  899. this.coupon = ''
  900. if (this.orderType == 2) {
  901. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  902. } else {
  903. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  904. }
  905. let totalMoney = parseFloat(
  906. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  907. ).toFixed(2)
  908. if (totalMoney <= 0) {
  909. this.totalPrice1 = 0.01
  910. } else {
  911. this.totalPrice1 = totalMoney
  912. }
  913. uni.showModal({
  914. title: '提示',
  915. content: '当前选择的优惠券已过期,请重新选择',
  916. success: (res) => {
  917. if (res.confirm) {
  918. this.coupon = ''
  919. } else if (res.cancel) {
  920. this.coupon = ''
  921. }
  922. }
  923. })
  924. }
  925. }
  926. }
  927. })
  928. },
  929. // 优惠活动列表
  930. getHuoList() {
  931. let data = {
  932. orderId: this.dataList.orderId
  933. }
  934. this.$Request.get(`/app/activity/suit-activity/${this.dataList.orderId}`, data).then((res) => {
  935. if (res.code == 0) {
  936. this.huoList = res.data
  937. // console.log(this.huodong)
  938. if (this.huodong) {
  939. // console.log(this.huodong,'有呢')
  940. let activityExists = this.huoList.some((item) => item.activityId === this.huodong.activityId)
  941. if (!activityExists) {
  942. this.huodong = ''
  943. if (this.orderType == 2) {
  944. this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
  945. } else {
  946. this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
  947. }
  948. let totalMoney = parseFloat(
  949. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  950. ).toFixed(2)
  951. if (totalMoney <= 0) {
  952. this.totalPrice1 = 0.01
  953. } else {
  954. this.totalPrice1 = totalMoney
  955. }
  956. uni.showModal({
  957. title: '提示',
  958. content: '当前选择的优惠活动已过期,请重新选择',
  959. success: (res) => {
  960. if (res.confirm) {
  961. this.huodong = ''
  962. } else if (res.cancel) {
  963. this.huodong = ''
  964. }
  965. }
  966. })
  967. }
  968. }
  969. // 匹配出最优惠的活动
  970. if (this.huoList.length) {
  971. this.huodong = this.huoList.reduce((prev, current) => (prev.discountAmount > current.discountAmount ? prev : current))
  972. this.selctHuo(this.huodong)
  973. }
  974. // for(var i=0;i<this.huoList.length;i++){
  975. // if(this.huodong!=''&&this.huodong.activityId!=this.huoList[i].activityId){
  976. // console.log('优惠活动过期')
  977. // }
  978. // }
  979. // if(this.huoList.length==0){
  980. // this.huodong=''
  981. // }
  982. }
  983. })
  984. },
  985. //拼单支付成功取消订单
  986. cancelPinDan() {
  987. // if (this.orderId) {
  988. // let data = {
  989. // orderId: this.orderId
  990. // };
  991. // this.$Request.post('/app/order/deleteOrder', data).then(res => {
  992. // if (res.code == 0) {
  993. // uni.removeStorageSync('orderId');
  994. // }
  995. // });
  996. // }
  997. },
  998. // 商品列表
  999. getOrderList() {
  1000. // 显示加载提示
  1001. uni.showLoading({
  1002. title: '加载中', // 加载提示文本
  1003. mask: true // 是否显示透明蒙层,防止触摸穿透
  1004. })
  1005. this.paotuiMoney = 0
  1006. this.totalPrice1 = 0
  1007. if (this.status == 0) {
  1008. console.log(6666)
  1009. this.payContinue()
  1010. return
  1011. }
  1012. let data = {
  1013. shopId: this.shopId,
  1014. status: 1,
  1015. page: 1,
  1016. limit: 1000
  1017. // orderType: this.orderType
  1018. }
  1019. // console.log(data)
  1020. this.$Request.get('/app/order/selectAllOrderList', data).then((res) => {
  1021. // console.log(res)
  1022. uni.hideLoading()
  1023. if (res.code == 0 && res.data.pageUtils.list.length) {
  1024. this.GoodsorderId = res.data.pageUtils.list[0].orderId
  1025. this.dataList = res.data.pageUtils.list[0]
  1026. if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
  1027. this.dabaoMoney = 0
  1028. this.dataList.orderGoodsList[0].forEach((res) => {
  1029. res.goodsPicture = res.goodsPicture.split(',')
  1030. this.dabaoMoney += res.goodsPack * res.goodsNum
  1031. this.goodsMoney += res.goodsPrice * res.goodsNum
  1032. this.goodsMoney = parseFloat(this.goodsMoney + this.dabaoMoney)
  1033. })
  1034. this.goodsList = this.dataList.orderGoodsList[0]
  1035. }
  1036. console.log(this.dataList, this.dabaoMoney, 'kkklll')
  1037. if (this.ifPaotui == 1) {
  1038. this.paotuiMoney = this.dataList.errandMoney
  1039. } else if (this.ifPaotui == 0) {
  1040. // 判断商品金额是否大于最低减免配送费金额
  1041. console.log(this.goodsMoney, '商品总金额', res, this.dataList.exemptMinMoney)
  1042. if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
  1043. this.paotuiMoney = 0
  1044. } else {
  1045. this.paotuiMoney = this.dataList.errandMoney
  1046. }
  1047. }
  1048. this.totalPrice = res.data.money
  1049. console.log(this.totalPrice,'total')
  1050. console.log(this.paotuiMoney,'paotui')
  1051. console.log(this.dabaoMoney,'dabao')
  1052. console.log(this.address.insideDeliveryFee,'free')
  1053. if (this.orderType == 2) {
  1054. this.totalPrice1 = parseFloat(
  1055. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  1056. ).toFixed(2)
  1057. } else {
  1058. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  1059. }
  1060. let totalMoney = parseFloat(
  1061. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  1062. ).toFixed(2)
  1063. if (totalMoney <= 0) {
  1064. this.totalPrice1 = 0.01
  1065. } else {
  1066. this.totalPrice1 = totalMoney
  1067. }
  1068. // console.log(this.dataList)
  1069. this.getCouponList()
  1070. this.getHuoList()
  1071. this.detCoupon()
  1072. this.getDistance()
  1073. }
  1074. // 加载提示关闭
  1075. uni.hideLoading()
  1076. })
  1077. },
  1078. payContinue() {
  1079. let data = {
  1080. orderId: this.orderId,
  1081. page: 1,
  1082. limit: 1000
  1083. }
  1084. console.log(data,'select11')
  1085. this.$Request.get('/app/order/selectOrder', data).then((res) => {
  1086. console.log(res,'select')
  1087. uni.hideLoading()
  1088. if (res.code == 0 && res.data.pageUtils.list.length) {
  1089. this.GoodsorderId = res.data.pageUtils.list[0].orderId
  1090. this.dataList = res.data.pageUtils.list[0]
  1091. if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
  1092. this.dataList.orderGoodsList[0].forEach((res) => {
  1093. res.goodsPicture = res.goodsPicture.split(',')
  1094. this.dabaoMoney += res.goodsPack * res.goodsNum
  1095. this.goodsMoney += res.goodsPrice * res.goodsNum
  1096. this.goodsMoney = parseFloat(this.goodsMoney + this.dabaoMoney)
  1097. })
  1098. this.goodsList = this.dataList.orderGoodsList[0]
  1099. }
  1100. console.log(this.dataList, this.dabaoMoney, 'kkklll')
  1101. if (this.ifPaotui == 1) {
  1102. this.paotuiMoney = this.dataList.errandMoney
  1103. } else if (this.ifPaotui == 0) {
  1104. // 判断商品金额是否大于最低减免配送费金额
  1105. console.log(this.goodsMoney, '商品总金额', res, this.dataList.exemptMinMoney)
  1106. if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
  1107. this.paotuiMoney = 0
  1108. } else {
  1109. this.paotuiMoney = this.dataList.errandMoney
  1110. }
  1111. }
  1112. this.totalPrice = res.data.money
  1113. if (this.orderType == 2) {
  1114. this.totalPrice1 = parseFloat(
  1115. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  1116. ).toFixed(2)
  1117. } else {
  1118. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  1119. }
  1120. let totalMoney = parseFloat(
  1121. this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
  1122. ).toFixed(2)
  1123. if (totalMoney <= 0) {
  1124. this.totalPrice1 = 0.01
  1125. } else {
  1126. this.totalPrice1 = totalMoney
  1127. }
  1128. // console.log(this.dataList)
  1129. this.getCouponList()
  1130. this.getHuoList()
  1131. this.detCoupon()
  1132. this.getDistance()
  1133. }
  1134. // 加载提示关闭
  1135. uni.hideLoading()
  1136. })
  1137. },
  1138. selectWay(item) {
  1139. this.openWay = item.id
  1140. },
  1141. takeReark() {
  1142. let datas = {
  1143. orderId: this.GoodsorderId,
  1144. remark: this.remark
  1145. }
  1146. this.$Request.post('/app/order/updateOrdersRemark', datas).then((res) => {
  1147. if (res.code == 0) {
  1148. } else {
  1149. uni.showToast({
  1150. title: res.msg,
  1151. icon: 'none'
  1152. })
  1153. }
  1154. })
  1155. },
  1156. toSettlement_throttle: throttle(function () {
  1157. this.toSettlement()
  1158. }, 1000),
  1159. // 立即结算
  1160. toSettlement() {
  1161. if (this.isThrottle == false) {
  1162. return
  1163. }
  1164. if (this.isTrue && this.orderType == 2) {
  1165. uni.showToast({
  1166. title: '超出配送范围',
  1167. icon: 'none'
  1168. })
  1169. reutrn
  1170. }
  1171. if (this.orderType == 2 && !this.address.addressId) {
  1172. uni.showToast({
  1173. title: '请选择收货地址',
  1174. icon: 'none'
  1175. })
  1176. return
  1177. }
  1178. if (this.remark) {
  1179. this.takeReark()
  1180. }
  1181. uni.showLoading({
  1182. title: '支付中...',
  1183. mask: true // 是否显示透明蒙层,防止触摸穿透
  1184. })
  1185. this.isThrottle = false
  1186. if (this.openWay == 1) {
  1187. //零钱支付
  1188. let data = {
  1189. userId: uni.getStorageSync('userId'),
  1190. type: 1, //支付方式 1表示微信支付、4或5表示支付宝支付
  1191. activityId: this.huodong ? this.huodong.activityId : '',
  1192. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1193. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1194. parentId: this.dataList.parentId,
  1195. couponId: this.coupon ? this.coupon.id : '',
  1196. addressId: this.address.addressId ? this.address.addressId : '',
  1197. orderType: this.orderType
  1198. }
  1199. console.log(data, 'l')
  1200. this.$Request.post('/app/wxPay/balanceOrder', data).then((res) => {
  1201. console.log(res, '结果')
  1202. if (res.code == 0) {
  1203. uni.hideLoading()
  1204. this.$queue.showToast('支付成功')
  1205. this.cancelPinDan()
  1206. setTimeout(() => {
  1207. this.isThrottle = true
  1208. uni.switchTab({
  1209. url: '/pages/order/index'
  1210. })
  1211. }, 1000)
  1212. } else {
  1213. this.$queue.showToast(res.msg)
  1214. this.isThrottle = true
  1215. }
  1216. })
  1217. } else if (this.openWay == 2) {
  1218. //微信支付
  1219. // #ifdef H5
  1220. let data = {
  1221. userId: uni.getStorageSync('userId'),
  1222. type: 1, //支付方式 1表示微信支付、4或5表示支付宝支付
  1223. activityId: this.huodong ? this.huodong.activityId : '',
  1224. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1225. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1226. parentId: this.dataList.parentId,
  1227. couponId: this.coupon ? this.coupon.id : '',
  1228. addressId: this.address.addressId ? this.address.addressId : '',
  1229. orderType: this.orderType,
  1230. type: 2
  1231. }
  1232. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1233. uni.hideLoading()
  1234. if (res.code == 0) {
  1235. this.callPay(res.data)
  1236. } else {
  1237. uni.showToast({
  1238. title: res.msg,
  1239. icon: 'none'
  1240. })
  1241. this.isThrottle = true
  1242. }
  1243. })
  1244. // #endif
  1245. // #ifdef MP-WEIXIN
  1246. this.$Request.get('/app/new-pay/enable-new-pay').then((res) => {
  1247. console.log(res, '987')
  1248. if (res.code == 0) {
  1249. let data = {
  1250. userId: uni.getStorageSync('userId'),
  1251. //支付方式 1表示微信支付、4或5表示支付宝支付
  1252. // type: 4,
  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: res.enable ? 1 : 3,
  1261. idCard: this.idcard1
  1262. }
  1263. console.log(data,'xinjiu')
  1264. if (res.enable) {
  1265. console.log('xin')
  1266. this.newPay(data)
  1267. } else {
  1268. console.log('jiu')
  1269. this.oldPay(data)
  1270. }
  1271. }
  1272. })
  1273. // #endif
  1274. // #ifdef APP
  1275. let data = {
  1276. type: 1,
  1277. parentId: this.dataList.parentId,
  1278. couponId: this.coupon ? this.coupon.id : '',
  1279. addressId: this.address.addressId ? this.address.addressId : '',
  1280. orderType: this.orderType
  1281. }
  1282. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1283. console.log(res,'wxaa')
  1284. this.showpay = false
  1285. if (res.code == 0) {
  1286. this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data))
  1287. } else {
  1288. this.isThrottle = true
  1289. }
  1290. })
  1291. // #endif
  1292. } else if (this.openWay == 3) {
  1293. // #ifdef H5
  1294. let data = {
  1295. type: 5,
  1296. parentId: this.dataList.parentId,
  1297. couponId: this.coupon ? this.coupon.id : '',
  1298. addressId: this.address.addressId ? this.address.addressId : '',
  1299. orderType: this.orderType
  1300. }
  1301. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1302. this.showpay = false
  1303. this.isThrottle = true
  1304. const div = document.createElement('div')
  1305. div.innerHTML = res.data //此处form就是后台返回接收到的数据
  1306. document.body.appendChild(div)
  1307. document.forms[0].submit()
  1308. })
  1309. // #endif
  1310. // #ifdef APP
  1311. let data = {
  1312. type: 4,
  1313. parentId: this.dataList.parentId,
  1314. couponId: this.coupon ? this.coupon.id : '',
  1315. addressId: this.address.addressId ? this.address.addressId : '',
  1316. orderType: this.orderType
  1317. }
  1318. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1319. this.showpay = false
  1320. this.setPayment('alipay', res.data)
  1321. })
  1322. // #endif
  1323. }
  1324. },
  1325. newPay(data) {
  1326. this.$Request.get('/app/order/get-pay-param', data).then((res) => {
  1327. console.log(res, '新支付')
  1328. if (res.code == 0) {
  1329. uni.requestPayment({
  1330. provider: 'wxpay',
  1331. timeStamp: res.timeStamp,
  1332. nonceStr: res.nonceStr,
  1333. package: res.packageStr,
  1334. signType: res.signType,
  1335. paySign: res.paySign,
  1336. success: (suc) => {
  1337. this.cancelPinDan()
  1338. uni.hideLoading()
  1339. this.$queue.showToast('支付成功')
  1340. setTimeout(() => {
  1341. this.isThrottle = true
  1342. uni.switchTab({
  1343. url: '/pages/order/index'
  1344. })
  1345. }, 1000)
  1346. },
  1347. fail: (err) => {
  1348. console.log('fail:' + JSON.stringify(err))
  1349. this.isThrottle = true
  1350. uni.setStorageSync('isClear', true)
  1351. uni.showToast({
  1352. title: '支付失败',
  1353. icon: 'none',
  1354. mask: true
  1355. })
  1356. setTimeout(() => {
  1357. uni.reLaunch({
  1358. url: '/pages/order/index'
  1359. })
  1360. }, 1500)
  1361. }
  1362. })
  1363. } else {
  1364. uni.showToast({
  1365. title: res.msg,
  1366. icon: 'none'
  1367. })
  1368. this.isThrottle = true
  1369. }
  1370. })
  1371. },
  1372. oldPay(data) {
  1373. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1374. console.log(res, '旧支付')
  1375. // uni.hideLoading();
  1376. if (res.code == 0) {
  1377. uni.requestPayment({
  1378. provider: 'wxpay',
  1379. timeStamp: res.data.timestamp,
  1380. nonceStr: res.data.noncestr,
  1381. package: res.data.package,
  1382. signType: res.data.signType,
  1383. paySign: res.data.sign,
  1384. success: (suc) => {
  1385. this.cancelPinDan()
  1386. uni.hideLoading()
  1387. this.$queue.showToast('支付成功')
  1388. setTimeout(() => {
  1389. this.isThrottle = true
  1390. uni.switchTab({
  1391. url: '/pages/order/index'
  1392. })
  1393. }, 1000)
  1394. },
  1395. fail: (err) => {
  1396. console.log('fail:' + JSON.stringify(err))
  1397. this.isThrottle = true
  1398. uni.setStorageSync('isClear', true)
  1399. uni.showToast({
  1400. title: '支付失败',
  1401. icon: 'none',
  1402. mask: true
  1403. })
  1404. setTimeout(() => {
  1405. uni.reLaunch({
  1406. url: '/pages/order/index'
  1407. })
  1408. }, 1500)
  1409. }
  1410. })
  1411. } else {
  1412. uni.showToast({
  1413. title: res.msg,
  1414. icon: 'none'
  1415. })
  1416. this.isThrottle = true
  1417. }
  1418. })
  1419. },
  1420. callPay: function (response) {
  1421. if (typeof WeixinJSBridge === 'undefined') {
  1422. if (document.addEventListener) {
  1423. document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false)
  1424. } else if (document.attachEvent) {
  1425. document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response))
  1426. document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response))
  1427. }
  1428. } else {
  1429. this.onBridgeReady(response)
  1430. }
  1431. },
  1432. onBridgeReady: function (response) {
  1433. let that = this
  1434. if (!response.package) {
  1435. return
  1436. }
  1437. WeixinJSBridge.invoke(
  1438. 'getBrandWCPayRequest',
  1439. {
  1440. appId: response.appid, //公众号名称,由商户传入
  1441. timeStamp: response.timestamp, //时间戳,自1970年以来的秒数
  1442. nonceStr: response.noncestr, //随机串
  1443. package: response.package,
  1444. signType: response.signType, //微信签名方式:
  1445. paySign: response.sign //微信签名
  1446. },
  1447. function (res) {
  1448. if (res.err_msg === 'get_brand_wcpay_request:ok') {
  1449. // 使用以上方式判断前端返回,微信团队郑重提示:
  1450. //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
  1451. that.cancelPinDan()
  1452. that.$queue.showToast('支付成功')
  1453. setTimeout(function () {
  1454. uni.switchTab({
  1455. url: '/pages/order/index'
  1456. })
  1457. that.isThrottle = true
  1458. }, 1000)
  1459. } else {
  1460. uni.hideLoading()
  1461. that.isThrottle = true
  1462. }
  1463. WeixinJSBridge.log(response.err_msg)
  1464. }
  1465. )
  1466. },
  1467. isCheckPay(code, name, order) {
  1468. if (code == 0) {
  1469. console.log('999999999999')
  1470. this.setPayment(name, order)
  1471. } else {
  1472. uni.hideLoading()
  1473. uni.showToast({
  1474. title: '支付信息有误'
  1475. })
  1476. this.isThrottle = true
  1477. }
  1478. },
  1479. setPayment(name, order) {
  1480. console.log(777777777, name, order)
  1481. uni.requestPayment({
  1482. provider: name,
  1483. orderInfo: order, //微信、支付宝订单数据
  1484. success: (res) => {
  1485. uni.hideLoading()
  1486. this.cancelPinDan()
  1487. uni.showLoading({
  1488. title: '支付成功',
  1489. icon: 'none'
  1490. })
  1491. setTimeout(() => {
  1492. this.isThrottle = true
  1493. uni.navigateBack()
  1494. }, 1000)
  1495. },
  1496. fail: (err) => {
  1497. uni.hideLoading()
  1498. this.isThrottle = true
  1499. },
  1500. complete: () => {
  1501. this.isThrottle = true
  1502. uni.hideLoading()
  1503. }
  1504. })
  1505. },
  1506. // 获取选择的地址
  1507. getAddressDet(e) {
  1508. let data = {
  1509. addressId: e
  1510. }
  1511. this.$Request.get('/app/address/selectAddressById', data).then((res) => {
  1512. console.log(res, 77777777)
  1513. if (res.code == 0) {
  1514. this.address = res.data
  1515. if (this.address.insideAddressId) {
  1516. this.getInsideDeliveryFee(this.address.insideAddressId)
  1517. } else {
  1518. this.getInsideDeliveryFee(0)
  1519. }
  1520. if (JSON.stringify(this.address) != '{}') {
  1521. this.getDistance()
  1522. }
  1523. uni.removeStorageSync('addressId')
  1524. }
  1525. })
  1526. },
  1527. // 获取地址列表
  1528. getAddressList() {
  1529. let data = {
  1530. page: 1,
  1531. limit: 100
  1532. }
  1533. this.$Request.get('/app/address/selectAddressList', data).then((res) => {
  1534. console.log(res, 741852)
  1535. if (res.code == 0 && res.data.list.length) {
  1536. this.address = res.data.list[0]
  1537. res.data.list.forEach((ret) => {
  1538. if (ret.addressDefault == 1) {
  1539. this.address = ret
  1540. }
  1541. })
  1542. console.log(this.address, '我的地址列表460777')
  1543. if (this.address.insideAddressId) {
  1544. this.getInsideDeliveryFee(this.address.insideAddressId)
  1545. } else {
  1546. this.getInsideDeliveryFee(0)
  1547. }
  1548. if (JSON.stringify(this.address) != '{}') {
  1549. this.getDistance()
  1550. }
  1551. }
  1552. })
  1553. },
  1554. getInsideDeliveryFee(insideAddressId) {
  1555. this.$Request.get(`/app/inside-address/${insideAddressId}`).then((res) => {
  1556. console.log(res, 987456)
  1557. if (res.code == 0) {
  1558. this.address.insideDeliveryFee = res.data.deliveryFee || 0
  1559. }
  1560. })
  1561. },
  1562. goAddress() {
  1563. uni.navigateTo({
  1564. url: '/my/address/index?add=1'
  1565. })
  1566. },
  1567. // 点击调起地图查看位置
  1568. goMap() {
  1569. // let that = this
  1570. // let plugin = requirePlugin('routePlan');
  1571. // let key = 'A3RBZ-23MHW-PTPR5-RLCER-UJTXQ-JIF2G'; //使用在腾讯位置服务申请的key
  1572. // let referer = that.dataList.shopName; //调用插件的app的名称
  1573. // let endPoint = JSON.stringify({ //终点
  1574. // 'name': that.dataList.shopName,
  1575. // 'latitude': that.dataList.shopLat,
  1576. // 'longitude': that.dataList.shopLng,
  1577. // });
  1578. // wx.navigateTo({
  1579. // url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
  1580. // });
  1581. let lati = parseFloat(this.dataList.shopLat)
  1582. let longi = parseFloat(this.dataList.shopLng)
  1583. uni.authorize({
  1584. scope: 'scope.userLocation',
  1585. success: (res) => {
  1586. uni.openLocation({
  1587. name: this.dataList.shopName,
  1588. latitude: lati,
  1589. longitude: longi,
  1590. success: () => {}
  1591. })
  1592. },
  1593. fail: (err) => {}
  1594. })
  1595. },
  1596. // 打电话
  1597. call() {
  1598. uni.makePhoneCall({
  1599. phoneNumber: this.dataList.shopPhone
  1600. })
  1601. }
  1602. }
  1603. }
  1604. </script>
  1605. <style scoped>
  1606. .hintPopul {
  1607. width: 100%;
  1608. height: 100vh;
  1609. position: fixed;
  1610. top: 0;
  1611. background: rgba(0, 0, 0, 0.4);
  1612. z-index: 999;
  1613. }
  1614. .content_ {
  1615. position: absolute;
  1616. left: 0;
  1617. right: 0;
  1618. top: 0;
  1619. bottom: 0;
  1620. margin: auto;
  1621. text-align: center;
  1622. width: 500rpx;
  1623. height: 400rpx;
  1624. border-radius: 20rpx;
  1625. background-color: #fff;
  1626. padding-top: 120rpx;
  1627. }
  1628. .content_ image {
  1629. position: absolute;
  1630. top: -50rpx;
  1631. left: 0;
  1632. right: 0;
  1633. margin: auto;
  1634. }
  1635. .hintText {
  1636. font-size: 30rpx;
  1637. }
  1638. .Btns {
  1639. width: 460rpx;
  1640. height: 60rpx;
  1641. line-height: 60rpx;
  1642. text-align: center;
  1643. background: #fcd202;
  1644. font-size: 28rpx;
  1645. border: 2rpx solid #fcd202;
  1646. color: #333333;
  1647. border-radius: 50rpx;
  1648. font-weight: 700;
  1649. margin: auto;
  1650. }
  1651. .goods_address {
  1652. width: 94%;
  1653. background: #ffffff;
  1654. height: 120rpx;
  1655. margin: 20rpx auto 0;
  1656. border-radius: 18rpx;
  1657. }
  1658. .address_box {
  1659. width: 90%;
  1660. margin: 0 auto;
  1661. height: 120rpx;
  1662. display: flex;
  1663. line-height: 120rpx;
  1664. }
  1665. .address_name {
  1666. flex: 1;
  1667. font-size: 30rpx;
  1668. }
  1669. .address_image {
  1670. /* flex: 1; */
  1671. display: flex;
  1672. justify-content: flex-end;
  1673. align-items: center;
  1674. }
  1675. .address_image image {
  1676. width: 25rpx;
  1677. height: 40rpx;
  1678. }
  1679. .songda_image image {
  1680. width: 20rpx;
  1681. height: 30rpx;
  1682. margin-left: 20rpx;
  1683. }
  1684. /* 地址 */
  1685. .address {
  1686. width: 88%;
  1687. margin: 3% auto;
  1688. padding: 3%;
  1689. display: flex;
  1690. background-color: #ffffff;
  1691. border-radius: 18rpx;
  1692. }
  1693. .adderss_le {
  1694. width: 90%;
  1695. line-height: 1.5;
  1696. }
  1697. .adderss_le_text {
  1698. font-size: 30rpx;
  1699. font-weight: bold;
  1700. color: #333333;
  1701. }
  1702. .adderss_le_text2 {
  1703. font-size: 24rpx;
  1704. font-weight: 500;
  1705. color: #999999;
  1706. display: flex;
  1707. }
  1708. .adderss_le_text2 view {
  1709. margin-left: 2%;
  1710. }
  1711. .adderss_le_text2 view:first-child {
  1712. margin-left: 0;
  1713. }
  1714. .adderss_ri {
  1715. width: 10%;
  1716. text-align: right;
  1717. line-height: 3;
  1718. }
  1719. .adderss_ri image {
  1720. width: 18rpx;
  1721. height: 30rpx;
  1722. }
  1723. /* 商品 */
  1724. .food {
  1725. width: 94%;
  1726. margin: 3% auto;
  1727. padding: 3%;
  1728. background-color: #ffffff;
  1729. border-radius: 18rpx;
  1730. }
  1731. .food_top {
  1732. display: flex;
  1733. justify-content: space-between;
  1734. align-items: center;
  1735. font-size: 32rpx;
  1736. font-weight: bold;
  1737. }
  1738. .food_bottom {
  1739. margin-top: 20rpx;
  1740. color: #666666;
  1741. font-size: 28rpx;
  1742. line-height: 45rpx;
  1743. }
  1744. .bottom_text {
  1745. color: #ea0018;
  1746. }
  1747. .tosend_header_food {
  1748. width: 100%;
  1749. display: flex;
  1750. margin-top: 3%;
  1751. }
  1752. .tosend_header_food_le {
  1753. width: 15%;
  1754. }
  1755. .tosend_header_food_le image {
  1756. width: 110rpx;
  1757. height: 110rpx;
  1758. border-radius: 10rpx;
  1759. }
  1760. .tosend_header_food_ce {
  1761. margin: 0 0 0 4%;
  1762. width: 57%;
  1763. }
  1764. .tosend_header_food_ri {
  1765. text-align: right;
  1766. width: 25%;
  1767. }
  1768. .tosend_header_food_text {
  1769. font-size: 34rpx;
  1770. font-weight: 500;
  1771. color: #333333;
  1772. line-height: 1.8;
  1773. }
  1774. .tosend_header_food_text text {
  1775. font-size: 25rpx;
  1776. }
  1777. .tosend_header_food_text2 {
  1778. font-size: 28rpx;
  1779. font-weight: 500;
  1780. color: #999999;
  1781. }
  1782. .do_top {
  1783. padding-top: 3%;
  1784. }
  1785. .do_bot {
  1786. padding-bottom: 3%;
  1787. border-bottom: 2rpx solid #e6e6e6;
  1788. }
  1789. .tosend_header_do {
  1790. width: 100%;
  1791. color: #333333;
  1792. font-size: 30rpx;
  1793. display: flex;
  1794. margin-top: 20rpx;
  1795. line-height: 1.5;
  1796. }
  1797. .tosend_header_do view {
  1798. /* flex: 1; */
  1799. }
  1800. .tosend_header_do_ri {
  1801. text-align: right;
  1802. }
  1803. .tosend_header_do_le2 {
  1804. font-family: PingFang SC;
  1805. font-weight: 500;
  1806. color: #999999;
  1807. padding-top: 1.5%;
  1808. }
  1809. .tosend_header_do_ri2 {
  1810. text-align: right;
  1811. color: #ea0000;
  1812. font-size: 40rpx;
  1813. }
  1814. .tosend_header_do_ri2 text {
  1815. font-size: 30rpx;
  1816. }
  1817. /* 支付 */
  1818. /* .payment_all{
  1819. width: 88%;margin: 3% auto;padding: 3%;background-color: #FFFFFF;
  1820. border-radius: 18rpx;
  1821. }
  1822. .payment{
  1823. width: 100%;display: flex;margin-top: 3%;
  1824. }
  1825. .payment_le{
  1826. width: 13%;
  1827. }
  1828. .payment_le image{
  1829. width: 60rpx;height: 60rpx;
  1830. }
  1831. .payment_ce{
  1832. width: 52%;
  1833. font-size: 30rpx;
  1834. font-weight: bold;
  1835. color: #333333;line-height: 60rpx;
  1836. }
  1837. .payment_ri{
  1838. width: 35%;text-align: right;line-height: 60rpx;
  1839. } */
  1840. /* 结算 */
  1841. .goorder {
  1842. width: 100%;
  1843. padding: 2% 3%;
  1844. position: fixed;
  1845. bottom: 0;
  1846. background-color: #ffffff;
  1847. z-index: 999;
  1848. }
  1849. .goorder_but {
  1850. width: 100%;
  1851. line-height: 3.5;
  1852. text-align: center;
  1853. background: #fcd202;
  1854. border-radius: 36rpx;
  1855. font-weight: 700;
  1856. }
  1857. .goorder_but_ {
  1858. opacity: 0.5;
  1859. }
  1860. .bg {
  1861. background-color: #ffffff;
  1862. }
  1863. .tabBtn {
  1864. /* background-color: #f6f6fa; */
  1865. height: 60rpx;
  1866. line-height: 60rpx;
  1867. color: #999999;
  1868. font-size: 38rpx;
  1869. }
  1870. .active {
  1871. /* width: 82rpx; */
  1872. height: 6rpx;
  1873. background: #fcd202;
  1874. /* position: relative;
  1875. top: -20rpx; */
  1876. z-index: 9;
  1877. }
  1878. </style>