confirmOrder.vue 57 KB

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