payOrder.vue 58 KB

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