confirmOrder.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967
  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)
  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)
  1050. console.log(this.paotuiMoney)
  1051. console.log(this.dabaoMoney)
  1052. console.log(this.address.insideDeliveryFee)
  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. // console.log(this.dataList)
  1061. this.getCouponList()
  1062. this.getHuoList()
  1063. this.detCoupon()
  1064. this.getDistance()
  1065. }
  1066. // 加载提示关闭
  1067. uni.hideLoading()
  1068. })
  1069. },
  1070. payContinue() {
  1071. let data = {
  1072. orderId: this.orderId,
  1073. page: 1,
  1074. limit: 1000
  1075. }
  1076. console.log(data)
  1077. this.$Request.get('/app/order/selectOrder', data).then((res) => {
  1078. console.log(res)
  1079. uni.hideLoading()
  1080. if (res.code == 0 && res.data.pageUtils.list.length) {
  1081. this.GoodsorderId = res.data.pageUtils.list[0].orderId
  1082. this.dataList = res.data.pageUtils.list[0]
  1083. if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
  1084. this.dataList.orderGoodsList[0].forEach((res) => {
  1085. res.goodsPicture = res.goodsPicture.split(',')
  1086. this.dabaoMoney += res.goodsPack * res.goodsNum
  1087. this.goodsMoney += res.goodsPrice * res.goodsNum
  1088. this.goodsMoney = parseFloat(this.goodsMoney + this.dabaoMoney)
  1089. })
  1090. this.goodsList = this.dataList.orderGoodsList[0]
  1091. }
  1092. console.log(this.dataList, this.dabaoMoney, 'kkklll')
  1093. if (this.ifPaotui == 1) {
  1094. this.paotuiMoney = this.dataList.errandMoney
  1095. } else if (this.ifPaotui == 0) {
  1096. // 判断商品金额是否大于最低减免配送费金额
  1097. console.log(this.goodsMoney, '商品总金额', res, this.dataList.exemptMinMoney)
  1098. if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
  1099. this.paotuiMoney = 0
  1100. } else {
  1101. this.paotuiMoney = this.dataList.errandMoney
  1102. }
  1103. }
  1104. this.totalPrice = res.data.money
  1105. if (this.orderType == 2) {
  1106. this.totalPrice1 = parseFloat(
  1107. parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
  1108. ).toFixed(2)
  1109. } else {
  1110. this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
  1111. }
  1112. // console.log(this.dataList)
  1113. this.getCouponList()
  1114. this.getHuoList()
  1115. this.detCoupon()
  1116. this.getDistance()
  1117. }
  1118. // 加载提示关闭
  1119. uni.hideLoading()
  1120. })
  1121. },
  1122. selectWay(item) {
  1123. this.openWay = item.id
  1124. },
  1125. takeReark() {
  1126. let datas = {
  1127. orderId: this.GoodsorderId,
  1128. remark: this.remark
  1129. }
  1130. this.$Request.post('/app/order/updateOrdersRemark', datas).then((res) => {
  1131. if (res.code == 0) {
  1132. } else {
  1133. uni.showToast({
  1134. title: res.msg,
  1135. icon: 'none'
  1136. })
  1137. }
  1138. })
  1139. },
  1140. toSettlement_throttle: throttle(function () {
  1141. this.toSettlement()
  1142. }, 1000),
  1143. // 立即结算
  1144. toSettlement() {
  1145. if (this.isThrottle == false) {
  1146. return
  1147. }
  1148. if (this.isTrue && this.orderType == 2) {
  1149. uni.showToast({
  1150. title: '超出配送范围',
  1151. icon: 'none'
  1152. })
  1153. reutrn
  1154. }
  1155. if (this.orderType == 2 && !this.address.addressId) {
  1156. uni.showToast({
  1157. title: '请选择收货地址',
  1158. icon: 'none'
  1159. })
  1160. return
  1161. }
  1162. if (this.remark) {
  1163. this.takeReark()
  1164. }
  1165. uni.showLoading({
  1166. title: '支付中...',
  1167. mask: true // 是否显示透明蒙层,防止触摸穿透
  1168. })
  1169. this.isThrottle = false
  1170. if (this.openWay == 1) {
  1171. //零钱支付
  1172. let data = {
  1173. userId: uni.getStorageSync('userId'),
  1174. type: 1, //支付方式 1表示微信支付、4或5表示支付宝支付
  1175. activityId: this.huodong ? this.huodong.activityId : '',
  1176. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1177. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1178. parentId: this.dataList.parentId,
  1179. couponId: this.coupon ? this.coupon.id : '',
  1180. addressId: this.address.addressId ? this.address.addressId : '',
  1181. orderType: this.orderType
  1182. }
  1183. console.log(data, 'l')
  1184. this.$Request.post('/app/wxPay/balanceOrder', data).then((res) => {
  1185. console.log(res, '结果')
  1186. if (res.code == 0) {
  1187. uni.hideLoading()
  1188. this.$queue.showToast('支付成功')
  1189. this.cancelPinDan()
  1190. setTimeout(() => {
  1191. this.isThrottle = true
  1192. uni.switchTab({
  1193. url: '/pages/order/index'
  1194. })
  1195. }, 1000)
  1196. } else {
  1197. this.$queue.showToast(res.msg)
  1198. this.isThrottle = true
  1199. }
  1200. })
  1201. } else if (this.openWay == 2) {
  1202. //微信支付
  1203. // #ifdef H5
  1204. let data = {
  1205. userId: uni.getStorageSync('userId'),
  1206. type: 1, //支付方式 1表示微信支付、4或5表示支付宝支付
  1207. activityId: this.huodong ? this.huodong.activityId : '',
  1208. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1209. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1210. parentId: this.dataList.parentId,
  1211. couponId: this.coupon ? this.coupon.id : '',
  1212. addressId: this.address.addressId ? this.address.addressId : '',
  1213. orderType: this.orderType,
  1214. type: 2
  1215. }
  1216. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1217. uni.hideLoading()
  1218. if (res.code == 0) {
  1219. this.callPay(res.data)
  1220. } else {
  1221. uni.showToast({
  1222. title: res.msg,
  1223. icon: 'none'
  1224. })
  1225. this.isThrottle = true
  1226. }
  1227. })
  1228. // #endif
  1229. // #ifdef MP-WEIXIN
  1230. this.$Request.get('/app/new-pay/enable-new-pay').then((res) => {
  1231. console.log(res, '987')
  1232. if (res.code == 0) {
  1233. let data = {
  1234. userId: uni.getStorageSync('userId'),
  1235. //支付方式 1表示微信支付、4或5表示支付宝支付
  1236. // type: 4,
  1237. activityId: this.huodong ? this.huodong.activityId : '',
  1238. reservationFlag: this.reservationFlag, //是否预约单 1是、0否
  1239. expectDeliveryTime: this.expectDeliveryTime, //期待送达时间 yyyy-MM-dd HH:mm:ss
  1240. parentId: this.dataList.parentId,
  1241. couponId: this.coupon ? this.coupon.id : '',
  1242. addressId: this.address.addressId ? this.address.addressId : '',
  1243. orderType: this.orderType,
  1244. type: res.enable ? 1 : 3,
  1245. idCard: this.idcard1
  1246. }
  1247. console.log(data)
  1248. if (res.enable) {
  1249. console.log('xin')
  1250. this.newPay(data)
  1251. } else {
  1252. console.log('jiu')
  1253. this.oldPay(data)
  1254. }
  1255. }
  1256. })
  1257. // #endif
  1258. // #ifdef APP
  1259. let data = {
  1260. type: 1,
  1261. parentId: this.dataList.parentId,
  1262. couponId: this.coupon ? this.coupon.id : '',
  1263. addressId: this.address.addressId ? this.address.addressId : '',
  1264. orderType: this.orderType
  1265. }
  1266. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1267. console.log(res)
  1268. this.showpay = false
  1269. if (res.code == 0) {
  1270. this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data))
  1271. } else {
  1272. this.isThrottle = true
  1273. }
  1274. })
  1275. // #endif
  1276. } else if (this.openWay == 3) {
  1277. // #ifdef H5
  1278. let data = {
  1279. type: 5,
  1280. parentId: this.dataList.parentId,
  1281. couponId: this.coupon ? this.coupon.id : '',
  1282. addressId: this.address.addressId ? this.address.addressId : '',
  1283. orderType: this.orderType
  1284. }
  1285. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1286. this.showpay = false
  1287. this.isThrottle = true
  1288. const div = document.createElement('div')
  1289. div.innerHTML = res.data //此处form就是后台返回接收到的数据
  1290. document.body.appendChild(div)
  1291. document.forms[0].submit()
  1292. })
  1293. // #endif
  1294. // #ifdef APP
  1295. let data = {
  1296. type: 4,
  1297. parentId: this.dataList.parentId,
  1298. couponId: this.coupon ? this.coupon.id : '',
  1299. addressId: this.address.addressId ? this.address.addressId : '',
  1300. orderType: this.orderType
  1301. }
  1302. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1303. this.showpay = false
  1304. this.setPayment('alipay', res.data)
  1305. })
  1306. // #endif
  1307. }
  1308. },
  1309. newPay(data) {
  1310. this.$Request.get('/app/order/get-pay-param', data).then((res) => {
  1311. console.log(res, '新支付')
  1312. if (res.code == 0) {
  1313. uni.requestPayment({
  1314. provider: 'wxpay',
  1315. timeStamp: res.timeStamp,
  1316. nonceStr: res.nonceStr,
  1317. package: res.packageStr,
  1318. signType: res.signType,
  1319. paySign: res.paySign,
  1320. success: (suc) => {
  1321. this.cancelPinDan()
  1322. uni.hideLoading()
  1323. this.$queue.showToast('支付成功')
  1324. setTimeout(() => {
  1325. this.isThrottle = true
  1326. uni.switchTab({
  1327. url: '/pages/order/index'
  1328. })
  1329. }, 1000)
  1330. },
  1331. fail: (err) => {
  1332. console.log('fail:' + JSON.stringify(err))
  1333. this.isThrottle = true
  1334. uni.setStorageSync('isClear', true)
  1335. uni.showToast({
  1336. title: '支付失败',
  1337. icon: 'none',
  1338. mask: true
  1339. })
  1340. setTimeout(() => {
  1341. uni.reLaunch({
  1342. url: '/pages/order/index'
  1343. })
  1344. }, 1500)
  1345. }
  1346. })
  1347. } else {
  1348. uni.showToast({
  1349. title: res.msg,
  1350. icon: 'none'
  1351. })
  1352. this.isThrottle = true
  1353. }
  1354. })
  1355. },
  1356. oldPay(data) {
  1357. this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
  1358. console.log(res, '旧支付')
  1359. // uni.hideLoading();
  1360. if (res.code == 0) {
  1361. uni.requestPayment({
  1362. provider: 'wxpay',
  1363. timeStamp: res.data.timestamp,
  1364. nonceStr: res.data.noncestr,
  1365. package: res.data.package,
  1366. signType: res.data.signType,
  1367. paySign: res.data.sign,
  1368. success: (suc) => {
  1369. this.cancelPinDan()
  1370. uni.hideLoading()
  1371. this.$queue.showToast('支付成功')
  1372. setTimeout(() => {
  1373. this.isThrottle = true
  1374. uni.switchTab({
  1375. url: '/pages/order/index'
  1376. })
  1377. }, 1000)
  1378. },
  1379. fail: (err) => {
  1380. console.log('fail:' + JSON.stringify(err))
  1381. this.isThrottle = true
  1382. uni.setStorageSync('isClear', true)
  1383. uni.showToast({
  1384. title: '支付失败',
  1385. icon: 'none',
  1386. mask: true
  1387. })
  1388. setTimeout(() => {
  1389. uni.reLaunch({
  1390. url: '/pages/order/index'
  1391. })
  1392. }, 1500)
  1393. }
  1394. })
  1395. } else {
  1396. uni.showToast({
  1397. title: res.msg,
  1398. icon: 'none'
  1399. })
  1400. this.isThrottle = true
  1401. }
  1402. })
  1403. },
  1404. callPay: function (response) {
  1405. if (typeof WeixinJSBridge === 'undefined') {
  1406. if (document.addEventListener) {
  1407. document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false)
  1408. } else if (document.attachEvent) {
  1409. document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response))
  1410. document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response))
  1411. }
  1412. } else {
  1413. this.onBridgeReady(response)
  1414. }
  1415. },
  1416. onBridgeReady: function (response) {
  1417. let that = this
  1418. if (!response.package) {
  1419. return
  1420. }
  1421. WeixinJSBridge.invoke(
  1422. 'getBrandWCPayRequest',
  1423. {
  1424. appId: response.appid, //公众号名称,由商户传入
  1425. timeStamp: response.timestamp, //时间戳,自1970年以来的秒数
  1426. nonceStr: response.noncestr, //随机串
  1427. package: response.package,
  1428. signType: response.signType, //微信签名方式:
  1429. paySign: response.sign //微信签名
  1430. },
  1431. function (res) {
  1432. if (res.err_msg === 'get_brand_wcpay_request:ok') {
  1433. // 使用以上方式判断前端返回,微信团队郑重提示:
  1434. //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
  1435. that.cancelPinDan()
  1436. that.$queue.showToast('支付成功')
  1437. setTimeout(function () {
  1438. uni.switchTab({
  1439. url: '/pages/order/index'
  1440. })
  1441. that.isThrottle = true
  1442. }, 1000)
  1443. } else {
  1444. uni.hideLoading()
  1445. that.isThrottle = true
  1446. }
  1447. WeixinJSBridge.log(response.err_msg)
  1448. }
  1449. )
  1450. },
  1451. isCheckPay(code, name, order) {
  1452. if (code == 0) {
  1453. console.log('999999999999')
  1454. this.setPayment(name, order)
  1455. } else {
  1456. uni.hideLoading()
  1457. uni.showToast({
  1458. title: '支付信息有误'
  1459. })
  1460. this.isThrottle = true
  1461. }
  1462. },
  1463. setPayment(name, order) {
  1464. console.log(777777777, name, order)
  1465. uni.requestPayment({
  1466. provider: name,
  1467. orderInfo: order, //微信、支付宝订单数据
  1468. success: (res) => {
  1469. uni.hideLoading()
  1470. this.cancelPinDan()
  1471. uni.showLoading({
  1472. title: '支付成功',
  1473. icon: 'none'
  1474. })
  1475. setTimeout(() => {
  1476. this.isThrottle = true
  1477. uni.navigateBack()
  1478. }, 1000)
  1479. },
  1480. fail: (err) => {
  1481. uni.hideLoading()
  1482. this.isThrottle = true
  1483. },
  1484. complete: () => {
  1485. this.isThrottle = true
  1486. uni.hideLoading()
  1487. }
  1488. })
  1489. },
  1490. // 获取选择的地址
  1491. getAddressDet(e) {
  1492. let data = {
  1493. addressId: e
  1494. }
  1495. this.$Request.get('/app/address/selectAddressById', data).then((res) => {
  1496. console.log(res, 77777777)
  1497. if (res.code == 0) {
  1498. this.address = res.data
  1499. if (this.address.insideAddressId) {
  1500. this.getInsideDeliveryFee(this.address.insideAddressId)
  1501. } else {
  1502. this.getInsideDeliveryFee(0)
  1503. }
  1504. if (JSON.stringify(this.address) != '{}') {
  1505. this.getDistance()
  1506. }
  1507. uni.removeStorageSync('addressId')
  1508. }
  1509. })
  1510. },
  1511. // 获取地址列表
  1512. getAddressList() {
  1513. let data = {
  1514. page: 1,
  1515. limit: 100
  1516. }
  1517. this.$Request.get('/app/address/selectAddressList', data).then((res) => {
  1518. console.log(res, 741852)
  1519. if (res.code == 0 && res.data.list.length) {
  1520. this.address = res.data.list[0]
  1521. res.data.list.forEach((ret) => {
  1522. if (ret.addressDefault == 1) {
  1523. this.address = ret
  1524. }
  1525. })
  1526. console.log(this.address, '我的地址列表460777')
  1527. if (this.address.insideAddressId) {
  1528. this.getInsideDeliveryFee(this.address.insideAddressId)
  1529. } else {
  1530. this.getInsideDeliveryFee(0)
  1531. }
  1532. if (JSON.stringify(this.address) != '{}') {
  1533. this.getDistance()
  1534. }
  1535. }
  1536. })
  1537. },
  1538. getInsideDeliveryFee(insideAddressId) {
  1539. this.$Request.get(`/app/inside-address/${insideAddressId}`).then((res) => {
  1540. console.log(res, 987456)
  1541. if (res.code == 0) {
  1542. this.address.insideDeliveryFee = res.data.deliveryFee || 0
  1543. }
  1544. })
  1545. },
  1546. goAddress() {
  1547. uni.navigateTo({
  1548. url: '/my/address/index?add=1'
  1549. })
  1550. },
  1551. // 点击调起地图查看位置
  1552. goMap() {
  1553. // let that = this
  1554. // let plugin = requirePlugin('routePlan');
  1555. // let key = 'A3RBZ-23MHW-PTPR5-RLCER-UJTXQ-JIF2G'; //使用在腾讯位置服务申请的key
  1556. // let referer = that.dataList.shopName; //调用插件的app的名称
  1557. // let endPoint = JSON.stringify({ //终点
  1558. // 'name': that.dataList.shopName,
  1559. // 'latitude': that.dataList.shopLat,
  1560. // 'longitude': that.dataList.shopLng,
  1561. // });
  1562. // wx.navigateTo({
  1563. // url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
  1564. // });
  1565. let lati = parseFloat(this.dataList.shopLat)
  1566. let longi = parseFloat(this.dataList.shopLng)
  1567. uni.authorize({
  1568. scope: 'scope.userLocation',
  1569. success: (res) => {
  1570. uni.openLocation({
  1571. name: this.dataList.shopName,
  1572. latitude: lati,
  1573. longitude: longi,
  1574. success: () => {}
  1575. })
  1576. },
  1577. fail: (err) => {}
  1578. })
  1579. },
  1580. // 打电话
  1581. call() {
  1582. uni.makePhoneCall({
  1583. phoneNumber: this.dataList.shopPhone
  1584. })
  1585. }
  1586. }
  1587. }
  1588. </script>
  1589. <style scoped>
  1590. .hintPopul {
  1591. width: 100%;
  1592. height: 100vh;
  1593. position: fixed;
  1594. top: 0;
  1595. background: rgba(0, 0, 0, 0.4);
  1596. z-index: 999;
  1597. }
  1598. .content_ {
  1599. position: absolute;
  1600. left: 0;
  1601. right: 0;
  1602. top: 0;
  1603. bottom: 0;
  1604. margin: auto;
  1605. text-align: center;
  1606. width: 500rpx;
  1607. height: 400rpx;
  1608. border-radius: 20rpx;
  1609. background-color: #fff;
  1610. padding-top: 120rpx;
  1611. }
  1612. .content_ image {
  1613. position: absolute;
  1614. top: -50rpx;
  1615. left: 0;
  1616. right: 0;
  1617. margin: auto;
  1618. }
  1619. .hintText {
  1620. font-size: 30rpx;
  1621. }
  1622. .Btns {
  1623. width: 460rpx;
  1624. height: 60rpx;
  1625. line-height: 60rpx;
  1626. text-align: center;
  1627. background: #fcd202;
  1628. font-size: 28rpx;
  1629. border: 2rpx solid #fcd202;
  1630. color: #333333;
  1631. border-radius: 50rpx;
  1632. font-weight: 700;
  1633. margin: auto;
  1634. }
  1635. .goods_address {
  1636. width: 94%;
  1637. background: #ffffff;
  1638. height: 120rpx;
  1639. margin: 20rpx auto 0;
  1640. border-radius: 18rpx;
  1641. }
  1642. .address_box {
  1643. width: 90%;
  1644. margin: 0 auto;
  1645. height: 120rpx;
  1646. display: flex;
  1647. line-height: 120rpx;
  1648. }
  1649. .address_name {
  1650. flex: 1;
  1651. font-size: 30rpx;
  1652. }
  1653. .address_image {
  1654. /* flex: 1; */
  1655. display: flex;
  1656. justify-content: flex-end;
  1657. align-items: center;
  1658. }
  1659. .address_image image {
  1660. width: 25rpx;
  1661. height: 40rpx;
  1662. }
  1663. .songda_image image {
  1664. width: 20rpx;
  1665. height: 30rpx;
  1666. margin-left: 20rpx;
  1667. }
  1668. /* 地址 */
  1669. .address {
  1670. width: 88%;
  1671. margin: 3% auto;
  1672. padding: 3%;
  1673. display: flex;
  1674. background-color: #ffffff;
  1675. border-radius: 18rpx;
  1676. }
  1677. .adderss_le {
  1678. width: 90%;
  1679. line-height: 1.5;
  1680. }
  1681. .adderss_le_text {
  1682. font-size: 30rpx;
  1683. font-weight: bold;
  1684. color: #333333;
  1685. }
  1686. .adderss_le_text2 {
  1687. font-size: 24rpx;
  1688. font-weight: 500;
  1689. color: #999999;
  1690. display: flex;
  1691. }
  1692. .adderss_le_text2 view {
  1693. margin-left: 2%;
  1694. }
  1695. .adderss_le_text2 view:first-child {
  1696. margin-left: 0;
  1697. }
  1698. .adderss_ri {
  1699. width: 10%;
  1700. text-align: right;
  1701. line-height: 3;
  1702. }
  1703. .adderss_ri image {
  1704. width: 18rpx;
  1705. height: 30rpx;
  1706. }
  1707. /* 商品 */
  1708. .food {
  1709. width: 94%;
  1710. margin: 3% auto;
  1711. padding: 3%;
  1712. background-color: #ffffff;
  1713. border-radius: 18rpx;
  1714. }
  1715. .food_top {
  1716. display: flex;
  1717. justify-content: space-between;
  1718. align-items: center;
  1719. font-size: 32rpx;
  1720. font-weight: bold;
  1721. }
  1722. .food_bottom {
  1723. margin-top: 20rpx;
  1724. color: #666666;
  1725. font-size: 28rpx;
  1726. line-height: 45rpx;
  1727. }
  1728. .bottom_text {
  1729. color: #ea0018;
  1730. }
  1731. .tosend_header_food {
  1732. width: 100%;
  1733. display: flex;
  1734. margin-top: 3%;
  1735. }
  1736. .tosend_header_food_le {
  1737. width: 15%;
  1738. }
  1739. .tosend_header_food_le image {
  1740. width: 110rpx;
  1741. height: 110rpx;
  1742. border-radius: 10rpx;
  1743. }
  1744. .tosend_header_food_ce {
  1745. margin: 0 0 0 4%;
  1746. width: 57%;
  1747. }
  1748. .tosend_header_food_ri {
  1749. text-align: right;
  1750. width: 25%;
  1751. }
  1752. .tosend_header_food_text {
  1753. font-size: 34rpx;
  1754. font-weight: 500;
  1755. color: #333333;
  1756. line-height: 1.8;
  1757. }
  1758. .tosend_header_food_text text {
  1759. font-size: 25rpx;
  1760. }
  1761. .tosend_header_food_text2 {
  1762. font-size: 28rpx;
  1763. font-weight: 500;
  1764. color: #999999;
  1765. }
  1766. .do_top {
  1767. padding-top: 3%;
  1768. }
  1769. .do_bot {
  1770. padding-bottom: 3%;
  1771. border-bottom: 2rpx solid #e6e6e6;
  1772. }
  1773. .tosend_header_do {
  1774. width: 100%;
  1775. color: #333333;
  1776. font-size: 30rpx;
  1777. display: flex;
  1778. margin-top: 20rpx;
  1779. line-height: 1.5;
  1780. }
  1781. .tosend_header_do view {
  1782. /* flex: 1; */
  1783. }
  1784. .tosend_header_do_ri {
  1785. text-align: right;
  1786. }
  1787. .tosend_header_do_le2 {
  1788. font-family: PingFang SC;
  1789. font-weight: 500;
  1790. color: #999999;
  1791. padding-top: 1.5%;
  1792. }
  1793. .tosend_header_do_ri2 {
  1794. text-align: right;
  1795. color: #ea0000;
  1796. font-size: 40rpx;
  1797. }
  1798. .tosend_header_do_ri2 text {
  1799. font-size: 30rpx;
  1800. }
  1801. /* 支付 */
  1802. /* .payment_all{
  1803. width: 88%;margin: 3% auto;padding: 3%;background-color: #FFFFFF;
  1804. border-radius: 18rpx;
  1805. }
  1806. .payment{
  1807. width: 100%;display: flex;margin-top: 3%;
  1808. }
  1809. .payment_le{
  1810. width: 13%;
  1811. }
  1812. .payment_le image{
  1813. width: 60rpx;height: 60rpx;
  1814. }
  1815. .payment_ce{
  1816. width: 52%;
  1817. font-size: 30rpx;
  1818. font-weight: bold;
  1819. color: #333333;line-height: 60rpx;
  1820. }
  1821. .payment_ri{
  1822. width: 35%;text-align: right;line-height: 60rpx;
  1823. } */
  1824. /* 结算 */
  1825. .goorder {
  1826. width: 100%;
  1827. padding: 2% 3%;
  1828. position: fixed;
  1829. bottom: 0;
  1830. background-color: #ffffff;
  1831. z-index: 999;
  1832. }
  1833. .goorder_but {
  1834. width: 100%;
  1835. line-height: 3.5;
  1836. text-align: center;
  1837. background: #fcd202;
  1838. border-radius: 36rpx;
  1839. font-weight: 700;
  1840. }
  1841. .goorder_but_ {
  1842. opacity: 0.5;
  1843. }
  1844. .bg {
  1845. background-color: #ffffff;
  1846. }
  1847. .tabBtn {
  1848. /* background-color: #f6f6fa; */
  1849. height: 60rpx;
  1850. line-height: 60rpx;
  1851. color: #999999;
  1852. font-size: 38rpx;
  1853. }
  1854. .active {
  1855. /* width: 82rpx; */
  1856. height: 6rpx;
  1857. background: #fcd202;
  1858. /* position: relative;
  1859. top: -20rpx; */
  1860. z-index: 9;
  1861. }
  1862. </style>