index.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750
  1. <template>
  2. <view :data-theme="theme">
  3. <!-- #ifndef APP-PLUS -->
  4. <view class='cart_nav'>
  5. <nav-bar :navTitle='navTitle' iconColor='#fff' :isBackgroundColor="true" ref="navBarRef"></nav-bar>
  6. </view>
  7. <!-- #endif -->
  8. <view class='order-submission' @touchstart="touchStart">
  9. <!-- 拼团切换样式 -->
  10. <view class="allAddress" v-if="Number(orderInfoVo.secondType)<5 && Number(orderInfoVo.secondType)!==2&&Number(orderInfoVo.type)==2">
  11. <view class="h-96 relative" v-if="orderInfoVo.merchantInfoList[0].deliveryMethodMer.split(',').length==2">
  12. <view class="w-full abs-lb rd-t-24rpx flex bg--w111-fff">
  13. <view class="flex-center w-50p h-76 fs-28 rd-lt-24rpx z-2" :class="shippingType == 1 ? 'bg--w111-fff font_color' : 'bg-primary-light'"
  14. @tap="addressType(1)">商家配送</view>
  15. <view class="flex-center w-50p h-76 fs-28 rd-rt-24rpx z-2" :class="shippingType == 2 ? 'bg--w111-fff font_color' : 'bg-primary-light'"
  16. @tap="addressType(2)">到店自提</view>
  17. </view>
  18. <view class="w-50p rd-t-24rpx bg--w111-fff h-96" :class="shippingType == 1 ? 'abs-lt' : 'abs-rt'">
  19. <view class="w-full h-full relative active-card"></view>
  20. </view>
  21. </view>
  22. <view class='address group acea-row row-between-wrapper' :class="orderInfoVo.merchantInfoList[0].deliveryMethodMer.split(',').length == 1?'bd-r-14':'' "
  23. @tap='onAddress' v-if='shippingType == 1'>
  24. <view class='addressCon' v-if="addressInfo.realName">
  25. <view class='name acea-row'>
  26. <view class="line1 select-name">{{addressInfo.realName}}</view>
  27. <view class='phone'>{{addressInfo.phone}}</view>
  28. </view>
  29. <view class="acea-row">
  30. <view class="line1"><text class='default font_color' v-if="addressInfo.isDefault">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{ addressInfo.street}}{{addressInfo.detail}}</view>
  31. </view>
  32. </view>
  33. <view class='addressCon' v-else>
  34. <view class='setaddress'>设置收货地址</view>
  35. </view>
  36. <view class='iconfont icon-jiantou mt30'></view>
  37. </view>
  38. <view class='address group acea-row row-between-wrapper' v-if='shippingType == 2' :class="orderInfoVo.merchantInfoList[0].deliveryMethodMer.split(',').length == 1?'bd-r-14':'' ">
  39. <view class='addressCon' v-for="(item, index) in merchantOrderVoList" :key="index" @click="goMap(item)">
  40. <view class='name acea-row'>
  41. <view class="line1 select-name">{{item.merName}}</view>
  42. <view class='phone'>{{item.phone}}</view>
  43. </view>
  44. <view class="acea-row">
  45. <view class="line1">{{item.addressDetail}}</view>
  46. </view>
  47. </view>
  48. <view class='iconfont icon-jiantou mt30'></view>
  49. </view>
  50. <view class='line'>
  51. <image src='../static/images/line.png'></image>
  52. </view>
  53. </view>
  54. <view v-if="isAddress" class="allAddress">
  55. <view class='address acea-row row-between-wrapper' @tap='onAddress'>
  56. <view class='addressCon' v-if="addressInfo.realName">
  57. <view class='name'>{{addressInfo.realName}}
  58. <text class='phone'>{{addressInfo.phone}}</text>
  59. </view>
  60. <view class="acea-row line2">
  61. <text class='default font_color' v-if="addressInfo.isDefault">[默认]</text>
  62. <text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{ addressInfo.street}}{{addressInfo.detail}}</text>
  63. </view>
  64. </view>
  65. <view class='addressCon' v-else>
  66. <view class='setaddress'>设置收货地址</view>
  67. </view>
  68. <view class='iconfont icon-jiantou'></view>
  69. </view>
  70. <view class='line'>
  71. <image src='../static/images/line.png'></image>
  72. </view>
  73. </view>
  74. <!-- <view class="item-go" @tap="goIndex = true" :class="goIndex ? 'item-go-avt' : ''">
  75. <view v-if="goIndex">
  76. <view class="sjx"></view>
  77. <text class="dg-icon"></text>
  78. </view>
  79. <text style="font-weight: 600;font-size: 27rpx;">立即配送</text>
  80. <text style="font-weight: 500;font-size: 23rpx;margin-left: 76rpx">预计10:12送达</text>
  81. </view>
  82. <view style="margin-top: 10rpx;" class="item-go" :class="!goIndex ? 'item-go-avt' : ''" @tap="onTime">
  83. <view v-if="!goIndex">
  84. <view class="sjx"></view>
  85. <text class="dg-icon"></text>
  86. </view>
  87. <text style="font-weight: 600;font-size: 27rpx;">预约配送</text>
  88. <text style="font-weight: 500;font-size: 23rpx;margin-left: 76rpx">{{timeStr || '选择时间 》'}}</text>
  89. </view>
  90. -->
  91. <view class="borderPad">
  92. <view v-for="(item, index) in merchantOrderVoList" :key="index" class='wrapper borRadius14'>
  93. <orderGoods :cartInfo="item.orderInfoList" :orderInfo="item" :secondType="secondType" :orderProNum="orderProNum"
  94. :isShowBtn="false">
  95. </orderGoods>
  96. <view v-show="Number(orderInfoVo.secondType)===0&&orderInfoVo.type!=2" class="boxs">
  97. <view class='item acea-row row-between-wrapper'>
  98. <view>配送方式</view>
  99. <view v-if="item.deliveryMethodMer && item.deliveryMethodMer.length===3 && item.takeTheirSwitch" class='discount acea-row row-middle'>
  100. <text @tap="openShowBox(item,index)">{{item.shippingType === 1 ? '配送' : item.shippingType === 2 ? '自提' : '骑手配送'}}</text>
  101. <text @tap="openShowBox(item,index)" class='iconfont icon-jiantou'></text>
  102. </view>
  103. <view v-else class='discount'>
  104. {{item.shippingType === 1 ? '配送' : item.shippingType === 2 ? '自提' : '骑手配送'}}
  105. </view>
  106. </view>
  107. <view v-if="item.shippingType == 2 && item.takeTheirSwitch" class="store-address acea-row">
  108. <view>
  109. <view class="name phone">{{orderType == 'secondHand' ? item.sellerName : ''}}{{item.phone}}</view>
  110. <view class="name w-480px">{{item.addressDetail}}</view>
  111. </view>
  112. <view class="map" @click="goMap(item)">
  113. <text class="iconfont icon-chakanditu"></text>
  114. <view class="map_text">查看地图</view>
  115. </view>
  116. </view>
  117. </view>
  118. <view v-show="(item.shippingType === 1 || item.shippingType === 3) && !orderType" class='item acea-row row-between-wrapper'>
  119. <view>打包费</view>
  120. <view v-if='!item.freightFee || item.freightFee == 0' class="noCoupon">免打包费</view>
  121. <view v-else class='money'>¥{{item.packingFee}}</view>
  122. </view>
  123. <view v-show="item.shippingType === 3" class='item acea-row row-between-wrapper'>
  124. <view>配送费</view>
  125. <view v-if='!item.freightFee || item.freightFee == 0' class="noCoupon">免运费</view>
  126. <view v-else class='money'>¥{{item.freightFee}}</view>
  127. </view>
  128. <view v-show="item.shippingType === 1 && Number(orderInfoVo.secondType)===0" class='item acea-row row-between-wrapper'>
  129. <view>快递费用</view>
  130. <view v-if='!item.freightFee || item.freightFee == 0' class="noCoupon">免运费</view>
  131. <view v-else class='money'>¥{{item.freightFee}}</view>
  132. </view>
  133. <view v-show="item.svipDiscountPrice != 0&&orderInfoVo.type!=2 && !orderType" class='item acea-row row-between-wrapper'>
  134. <view>会员优惠</view>
  135. <view class='money'>-¥{{item.svipDiscountPrice}}</view>
  136. </view>
  137. <view v-if="isProductType" class='item acea-row row-between-wrapper'>
  138. <view>店铺优惠</view>
  139. <view v-if="item.merCouponUserList && item.merCouponUserList.length" @tap='couponTap(item.merCouponUserList,item.merId, index)'>
  140. <view class='discount acea-row row-between-wrapper'>
  141. <text class="couponTitle line1">{{item.couponFee==0?`有${item.merCouponUserList.length}张优惠券可选`:`-¥${item.couponFee}`}}</text>
  142. <text class='iconfont icon-jiantou'></text>
  143. </view>
  144. </view>
  145. <view v-else class="noCoupon">暂无优惠券</view>
  146. </view>
  147. <view class='item acea-row row-between-wrapper' v-if="textareaStatus" style="height: auto;">
  148. <view>买家留言</view>
  149. <input placeholder-class='placeholder' value="" name="mark" placeholder='选填买家留言' v-model="item.remark" @input='bindHideKeyboard(item.remark,index)'
  150. style="width: 484rpx;text-align: right;"></input>
  151. </view>
  152. </view>
  153. <!--商品关联系统表单-->
  154. <view v-if="orderInfoVo.systemFormValue && orderInfoVo.systemFormValue.length" class='wrapper borRadius14'>
  155. <systemFrom v-model="orderInfoVo.systemFormValue"></systemFrom>
  156. <!-- <systemFrom :orderForm="orderInfoVo.systemFormValue" ></systemFrom>-->
  157. </view>
  158. <view class='moneyList borRadius14'>
  159. <view v-show="secondType !== ProductTypeEnum.Integral" class='item acea-row row-between-wrapper'>
  160. <view>商品总价</view>
  161. <view class='money'>¥{{orderInfoVo.proTotalFee || 0}}</view>
  162. </view>
  163. <view class='item acea-row row-between-wrapper' v-if="parseInt(orderInfoVo.freightFee) > 0">
  164. <view>运费:</view>
  165. <view class='money'>+¥{{orderInfoVo.freightFee}}</view>
  166. </view>
  167. <view v-show="orderInfoVo.svipDiscountPrice != 0 &&orderInfoVo.type!=2 && !orderType" class='item acea-row row-between-wrapper'>
  168. <view>会员优惠</view>
  169. <view class='money'>-¥{{orderInfoVo.svipDiscountPrice}}</view>
  170. </view>
  171. <view class='item acea-row row-between-wrapper' v-if="parseInt(merCouponFee) > 0 && isProductType">
  172. <view>店铺优惠</view>
  173. <view class='money'>-¥{{merCouponFee}}</view>
  174. </view>
  175. <view v-if="isProductType" class='item acea-row row-between-wrapper'>
  176. <view>平台优惠</view>
  177. <view v-if="orderInfoVo.platCouponUserList && orderInfoVo.platCouponUserList.length" class='discount acea-row row-between-wrapper'
  178. @tap='couponTap(orderInfoVo.platCouponUserList,0)'>
  179. <text class="couponTitle line1">{{platCouponFee==0?`有${orderInfoVo.platCouponUserList.length}张优惠券可选`:`-¥${platCouponFee}`}}</text>
  180. <text class='iconfont icon-jiantou'></text>
  181. </view>
  182. <view v-else class="noCoupon">暂无优惠券</view>
  183. </view>
  184. <view class='item acea-row row-between-wrapper' v-if="orderInfoVo.integralDeductionSwitch && isProductType">
  185. <view>积分抵扣</view>
  186. <view class='discount acea-row row-middle'>
  187. <view class="mr14"> {{isUseIntegral ? "使用积分":"当前积分"}}
  188. <text class='num font_color'>{{ isUseIntegral ? orderInfoVo.surplusIntegral : orderInfoVo.userIntegral}}</text>
  189. </view>
  190. <checkbox-group @change="ChangeIntegral">
  191. <checkbox :checked='isUseIntegral ? true : false' :disabled="orderInfoVo.userIntegral==0 && !isUseIntegral" />
  192. </checkbox-group>
  193. </view>
  194. </view>
  195. <view class='item acea-row row-between-wrapper' v-if="Number(orderInfoVo.deductionPrice) > 0">
  196. <view>抵扣金额</view>
  197. <view class='money'>-¥{{orderInfoVo.deductionPrice}}</view>
  198. </view>
  199. </view>
  200. <view style='height:120rpx;'></view>
  201. </view>
  202. <view class='footer acea-row row-between-wrapper'>
  203. <view class="acea-row row-middle">合计:
  204. <!-- 积分价格 -->
  205. <PointsPrice v-if="orderInfoVo.secondType === ProductTypeEnum.Integral" :pointsPrice="orderInfoVo"
  206. :pointsGoodsStyle="hotPointsStyle"></PointsPrice>
  207. <!-- 其他价格 -->
  208. <text v-else class='price_color'>¥{{orderInfoVo.payFee || orderInfoVo.proTotalFee || 0}}</text>
  209. </view>
  210. <view class='settlement' style='z-index:100' @tap="SubOrder">
  211. {{secondType === ProductTypeEnum.Integral?"确认兑换":"立即下单"}}
  212. </view>
  213. </view>
  214. </view>
  215. <couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" :openType='openType' @ChangCoupons="ChangCoupons"
  216. :orderShow="orderShow" :surplusFee="surplusFee"></couponListWindow>
  217. <view v-if="isShowBox">
  218. <checkDelivery :isShowBox="isShowBox" :activeObj="activeObj" @close="boxClose" @confirmBtn="getShippingType">
  219. </checkDelivery>
  220. </view>
  221. <!-- 满员提示 -->
  222. <uni-popup ref="sh_popup" background-color="#fff" borderRadius="10px">
  223. <view class="sh_popup-content">
  224. <view class="sh_popup_title">
  225. 提示
  226. </view>
  227. <view class="sh_popup_text">
  228. 该团已拼成,是否自行开团?
  229. </view>
  230. <view class="sh_popup_btn">
  231. <view class="no_btn btn font_color" @click="popupClose">返回首页</view>
  232. <view class="yes_btn btn" @click="toAudit">去开团</view>
  233. </view>
  234. </view>
  235. </uni-popup>
  236. <!-- 选择时间 -->
  237. <view class="time-box" v-if="isTime">
  238. <view class="box-time">
  239. <view class="close" @click="isTime = false">
  240. <text style="font-size: 27rpx;font-weight: 600;padding: 20rpx 0;">选择配送时间</text>
  241. <text style="position: absolute;right: 0; padding: 10rpx 20rpx;font-size: 30rpx;">x</text>
  242. </view>
  243. <view class="scr-box">
  244. <scroll-view class="menus" scroll-with-animation scroll-y>
  245. <view class="wrapper">
  246. <view class="left-name" :id="`menu-${item.id}`" :class="{'current': item.id === timeIndex}" v-for="(item, index) in timeData"
  247. :key="index" @tap="handleMenuTap(item.id)">
  248. <text>{{ item.name }}</text>
  249. </view>
  250. </view>
  251. </scroll-view>
  252. <!-- goods list begin -->
  253. <scroll-view class="times" scroll-with-animation scroll-y :scroll-top="cateScrollTop" @scroll="handleGoodsScroll"
  254. :scroll-into-view="menuScrollIntoView">
  255. <view class="wrapper" style="padding-bottom: 200rpx;">
  256. <view class="category" v-for="(item, index) in timeData" :key="index" :id="`cate-${item.id}`">
  257. <view class="items">
  258. <view class="right-times" v-for="(good, key) in item.list" :key="key">
  259. {{good.name}}
  260. </view>
  261. </view>
  262. </view>
  263. </view>
  264. </scroll-view>
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </template>
  270. <script>
  271. // +----------------------------------------------------------------------
  272. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  273. // +----------------------------------------------------------------------
  274. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  275. // +----------------------------------------------------------------------
  276. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  277. // +----------------------------------------------------------------------
  278. // | Author: CRMEB Team <admin@crmeb.com>
  279. // +----------------------------------------------------------------------
  280. import {
  281. getCouponsOrderPrice,
  282. orderCreate,
  283. postOrderComputed,
  284. loadPreOrderApi
  285. } from '@/api/order.js';
  286. import {
  287. loadPreSecondHandOrderApi,
  288. secondHandTakeTheirApi,
  289. secondHandOrderCreate
  290. } from '@/api/secondHand.js';
  291. import {
  292. getAddressDetail,
  293. getAddressDefault
  294. } from '@/api/user.js';
  295. // import {
  296. // openPaySubscribe
  297. // } from '@/utils/SubscribeMessage.js';
  298. import {
  299. takeTheirApi
  300. } from '@/api/merchant.js';
  301. import {
  302. CACHE_LONGITUDE,
  303. CACHE_LATITUDE
  304. } from '@/config/cache.js';
  305. import dayjs from "@/plugin/dayjs/dayjs.min.js";
  306. import couponListWindow from '../components/couponListWindow';
  307. import orderGoods from '../components/orderGoods'
  308. import navBar from '@/components/navBar';
  309. import checkDelivery from '../components/checkDelivery/index.vue';
  310. import systemFrom from '../components/systemFrom/index.vue';
  311. import PointsPrice from '@/components/PointsPrice.vue';
  312. import {
  313. toLogin
  314. } from '@/libs/login.js';
  315. import {
  316. mapGetters
  317. } from "vuex";
  318. import {
  319. Debounce
  320. } from '@/utils/validate.js'
  321. import {
  322. ProductTypeEnum,
  323. ProductMarketingTypeEnum
  324. } from "../../../enums/productEnums";
  325. import orderPay from "@/mixins/OrderPay.js";
  326. let app = getApp();
  327. /**
  328. * 积分商品推荐样式
  329. */
  330. const hotPointsStyle = {
  331. iconStyle: {
  332. width: '28rpx',
  333. height: '28rpx'
  334. },
  335. priceStyle: {
  336. fontSize: '28rpx',
  337. },
  338. unitStyle: {
  339. fontSize: '26rpx',
  340. },
  341. }
  342. export default {
  343. mixins: [orderPay],
  344. components: {
  345. navBar,
  346. couponListWindow,
  347. orderGoods,
  348. checkDelivery,
  349. systemFrom,
  350. PointsPrice
  351. },
  352. computed: {
  353. // 是否可以使用优惠券、积分抵扣。 基础订单/云盘订单,卡密,虚拟,可以使用优惠券、积分抵扣
  354. isProductType() {
  355. return this.type === ProductMarketingTypeEnum.Normal && this.secondType !== this.ProductTypeEnum
  356. .Integral && this.secondType !== this.ProductTypeEnum.Video && this.orderType !== 'secondHand'
  357. },
  358. ...mapGetters(['productType', 'isLogin'])
  359. },
  360. data() {
  361. return {
  362. timeData: [{
  363. id: 1,
  364. name: 1,
  365. list: [{
  366. id: 11,
  367. name: 11
  368. }, {
  369. id: 111,
  370. name: 111
  371. }, {
  372. id: 1111,
  373. name: 1111
  374. }]
  375. }, {
  376. id: 2,
  377. name: 2,
  378. list: [{
  379. id: 22,
  380. name: 22
  381. }, {
  382. id: 222,
  383. name: 222
  384. }, {
  385. id: 2222,
  386. name: 2222
  387. }]
  388. }, {
  389. id: 3,
  390. name: 3,
  391. list: [{
  392. id: 33,
  393. name: 33
  394. }, {
  395. id: 333,
  396. name: 333
  397. }, {
  398. id: 3333,
  399. name: 3333
  400. }]
  401. }],
  402. menuScrollIntoView: '',
  403. sizeCalcState: false,
  404. cateScrollTop: 0,
  405. timeIndex: 1,
  406. timeStr: '',
  407. isTime: false,
  408. time: '12:01',
  409. goIndex: true,
  410. hotPointsStyle: hotPointsStyle,
  411. ProductMarketingTypeEnum: ProductMarketingTypeEnum,
  412. ProductTypeEnum: ProductTypeEnum,
  413. navTitle: '提交订单',
  414. homeTop: 20,
  415. orderShow: 'orderShow', //下单页面使用优惠券组件不展示tab切换页
  416. textareaStatus: true,
  417. openType: 1, //优惠券打开方式 1=使用
  418. couponShow: false,
  419. coupon: {
  420. coupon: false,
  421. list: [], //商户优惠券
  422. statusTile: '立即使用',
  423. couponMoney: 0
  424. }, //优惠券组件
  425. addressInfo: {}, //地址信息
  426. addressId: 0, //地址id
  427. orderMerchantRequestList: [], //商户属性集合
  428. cartId: '', //购物车id
  429. userInfo: {}, //用户信息
  430. mark: '', //买家留言
  431. couponFee: '请选择', //优惠券
  432. coupon_price: 0, //优惠券抵扣金额
  433. isUseIntegral: false, //是否使用积分
  434. integral_price: 0, //积分抵扣金额
  435. integral: 0,
  436. ChangePrice: 0, //使用积分抵扣变动后的金额
  437. formIds: [], //收集formid
  438. status: 0,
  439. is_address: false,
  440. toPay: false, //修复进入支付时页面隐藏从新刷新页面
  441. shippingType: 1,
  442. storePostage: 0,
  443. contacts: '',
  444. contactsTel: '',
  445. mydata: {},
  446. merchantOrderVoList: [],
  447. priceGroup: {},
  448. animated: false,
  449. totalPrice: 0,
  450. integralRatio: "0",
  451. orderKey: "",
  452. // usableCoupon: {},
  453. offlinePostage: "",
  454. news: true,
  455. again: false,
  456. addAgain: false,
  457. bargain: false, //是否是砍价
  458. combination: false, //是否是拼团
  459. secKill: false, //是否是秒杀
  460. orderInfoVo: {},
  461. addressList: [], //地址列表数据
  462. orderProNum: 0,
  463. orderNo: '', //预下单订单号
  464. orderType: '',
  465. theme: app.globalData.theme,
  466. addressChangeId: 0,
  467. isShowBox: false,
  468. activeObj: {},
  469. activeIndex: 0, // 选中店铺索引
  470. type: 0, // 0-基础订单,1-秒杀订单,2-拼团订单
  471. secondType: 0, //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  472. merId: 0, //商户id,用于判断商户优惠券还是平台优惠券,平台优惠券商户id为0
  473. platUserCouponObj: {}, //平台优惠券对象,用于缓存数据使用
  474. platUserCouponId: 0, //平台优惠券id
  475. platCouponFee: '', //平台优惠券金额
  476. merCouponFee: '', //店铺优惠券总金额
  477. surplusFee: 0, //商品总金额-商户优惠券金额=平台端可使用优惠券的门槛
  478. merUserCouponId: 0, //店铺使用优惠券的id
  479. tempCouponObj: {}, //临时优惠券数据
  480. merchangtInfo: {}, //商户信息
  481. orderForm: [], //系统表单配置的数据
  482. orderExtend: {}, //提交接口表单的数据
  483. productId: '',
  484. groupActivityId: '',
  485. isAddress: false
  486. };
  487. },
  488. watch: {
  489. isLogin: {
  490. handler: function(newV, oldV) {
  491. if (newV) {
  492. this.getloadPreOrder();
  493. }
  494. },
  495. deep: true
  496. },
  497. },
  498. onLoad(options) {
  499. this.orderNo = options.orderNo || 0;
  500. this.orderType = options.orderType || '';
  501. console.log(options)
  502. this.addressChangeId = parseInt(options.addressId) || 0;
  503. this.is_address = options.is_address ? true : false;
  504. if (this.isLogin) {
  505. this.orderType == 'secondHand' ? this.getSecondHandPreOrder() : this.getloadPreOrder()
  506. } else {
  507. toLogin();
  508. }
  509. },
  510. /**
  511. * 生命周期函数--监听页面显示
  512. */
  513. onShow: function() {
  514. let _this = this
  515. this.textareaStatus = true;
  516. uni.$on('addressItem', function(res) {
  517. that.$set(that, 'addressInfo', res);
  518. })
  519. },
  520. methods: {
  521. onTime() {
  522. this.isTime = true
  523. this.goIndex = false
  524. },
  525. handleMenuTap(id) { //点击菜单项事件
  526. // this.menuScrollIntoView = `cate-${id}`
  527. if (!this.sizeCalcState) {
  528. this.calcSize()
  529. }
  530. this.timeIndex = id
  531. this.$nextTick(() => this.cateScrollTop = this.timeData.find(item => item.id == id).top)
  532. },
  533. handleGoodsScroll({
  534. detail
  535. }) { //商品列表滚动事件
  536. if (!this.sizeCalcState) {
  537. this.calcSize()
  538. }
  539. const {
  540. scrollTop
  541. } = detail
  542. let tabs = this.timeData.filter(item => item.top <= scrollTop).reverse()
  543. if (tabs.length > 0) {
  544. this.timeIndex = tabs[0].id
  545. }
  546. },
  547. calcSize() {
  548. let h = 10
  549. this.timeData.forEach(item => {
  550. let view = uni.createSelectorQuery().select(`#cate-${item.id}`)
  551. view.fields({
  552. size: true
  553. }, data => {
  554. // if (data.goodsList) {
  555. item.top = h
  556. h += data.height
  557. item.bottom = h
  558. // }
  559. }).exec()
  560. })
  561. this.sizeCalcState = true
  562. },
  563. bindTimeChange: function(e) {
  564. console.log(e)
  565. this.time = e.detail.value
  566. this.goIndex = false
  567. },
  568. //滚动
  569. touchStart() {
  570. this.$refs.navBarRef.currentPage = false;
  571. },
  572. popupClose() {
  573. this.$refs.sh_popup.close()
  574. uni.switchTab({
  575. url: '/pages/index/index'
  576. });
  577. },
  578. //去开团
  579. toAudit() {
  580. this.$refs.sh_popup.close()
  581. uni.navigateTo({
  582. url: `/pages/goods/goods_details/index?id=${this.productId}&mt=2&gd=${this.groupActivityId}`
  583. })
  584. },
  585. addressType(type) {
  586. this.merchantOrderVoList[0].shippingType = type
  587. this.getShippingType(this.merchantOrderVoList[0])
  588. if (type == 2) {
  589. setTimeout(() => {
  590. this.shippingType = type
  591. }, 300)
  592. } else {
  593. this.shippingType = type
  594. }
  595. },
  596. //选择配送方式回调
  597. getShippingType(item) {
  598. this.orderMerchantRequestList[this.activeIndex].shippingType = item.shippingType;
  599. this.$set(this.merchantOrderVoList[this.activeIndex], 'shippingType', item.shippingType);
  600. if (item.shippingType === 2) this.getTakeTheir(item.merId);
  601. this.computedPrice();
  602. this.isShowBox = false;
  603. },
  604. getTakeTheir(id) {
  605. let api = this.orderType == 'secondHand' ? secondHandTakeTheirApi : takeTheirApi
  606. api(id).then(res => {
  607. this.merchangtInfo = res.data; //商户信息
  608. this.$set(this.merchantOrderVoList[this.activeIndex], 'addressDetail', res.data.addressDetail);
  609. this.$set(this.merchantOrderVoList[this.activeIndex], 'phone', res.data.phone);
  610. this.$set(this.merchantOrderVoList[this.activeIndex], 'latitude', res.data.latitude);
  611. this.$set(this.merchantOrderVoList[this.activeIndex], 'longitude', res.data.longitude);
  612. console.log(this.merchantOrderVoList[this.activeIndex])
  613. }).catch(err => {
  614. return this.$util.Tips({
  615. title: err
  616. });
  617. })
  618. },
  619. //查看内置地图
  620. goMap(item) {
  621. let that = this;
  622. //#ifdef H5
  623. if (that.$wechat.isWeixin() === true) {
  624. that.$wechat.seeLocation({
  625. latitude: parseFloat(this.merchantOrderVoList[this.activeIndex].latitude),
  626. longitude: parseFloat(this.merchantOrderVoList[this.activeIndex].longitude),
  627. name: item.merName,
  628. address: item.addressDetail ? item.addressDetail : '',
  629. }).then(res => {
  630. console.log('success');
  631. })
  632. } else {
  633. //#endif
  634. uni.openLocation({
  635. latitude: parseFloat(this.merchantOrderVoList[this.activeIndex].latitude),
  636. longitude: parseFloat(this.merchantOrderVoList[this.activeIndex].longitude),
  637. scale: 8,
  638. name: item.merName,
  639. address: item.addressDetail ? item.addressDetail : '',
  640. success: function(res) {
  641. that.go_map = true
  642. },
  643. });
  644. // #ifdef H5
  645. }
  646. //#endif
  647. },
  648. // 打开配送方式弹窗
  649. openShowBox(item, index) {
  650. this.activeObj = item
  651. this.activeIndex = index
  652. this.isShowBox = true
  653. },
  654. boxClose() {
  655. this.isShowBox = false
  656. },
  657. // 二手交易订单详情
  658. getSecondHandPreOrder() {
  659. loadPreSecondHandOrderApi(this.orderNo).then(res => {
  660. let orderInfoVo = res.data;
  661. orderInfoVo.secondType = 0;
  662. orderInfoVo.type = 0;
  663. this.orderInfoVo = {
  664. ...orderInfoVo,
  665. systemFormValue: orderInfoVo.systemFormValue ? this.$util.objToArr(JSON.parse(
  666. orderInfoVo.systemFormValue)) : []
  667. };
  668. console.log(this.orderInfoVo, '11111111111111111111111')
  669. this.isAddress = Number(this.orderInfoVo.secondType) < 5 && Number(this.orderInfoVo.secondType) !== 2 && Number(
  670. this.orderInfoVo.type) != 2;
  671. orderInfoVo.merchantInfoList.map(item => {
  672. if (item.shippingType == 2) this.isAddress = false;
  673. this.orderMerchantRequestList.push({
  674. shippingType: item.shippingType,
  675. merId: item.merId,
  676. remark: '',
  677. userCouponId: item.userCouponId
  678. })
  679. if (item.shippingType === 2) this.getTakeTheir(item.orderInfoList[0].productId)
  680. item.addressDetail = this.merchangtInfo.addressDetail;
  681. item.phone = this.merchangtInfo.phone;
  682. item.latitude = this.merchangtInfo.latitude;
  683. item.longitude = this.merchangtInfo.longitude;
  684. });
  685. this.merchantOrderVoList = orderInfoVo.merchantInfoList; //商户端数据
  686. this.type = orderInfoVo.type; //订单类型
  687. this.secondType = orderInfoVo.secondType; //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  688. this.orderProNum = orderInfoVo.orderProNum;
  689. // if (orderInfoVo.addressId && this.addressChangeId === 0) {
  690. // this.addressId = orderInfoVo.addressId;
  691. // } else {
  692. // this.addressId = this.addressChangeId;
  693. // if (orderInfoVo.addressId != this.addressChangeId && this.addressChangeId > 0)
  694. // this.computedPrice();
  695. // }
  696. this.getaddressInfo();
  697. }).catch(err => {
  698. // console.log(err)
  699. uni.navigateTo({
  700. url: '/pages/goods/order_list/index'
  701. });
  702. })
  703. },
  704. // 订单详情
  705. getloadPreOrder: function() {
  706. loadPreOrderApi(this.orderNo).then(res => {
  707. let orderInfoVo = res.data;
  708. if (orderInfoVo.merchantInfoList[0].orderInfoList[0].groupBuyActivityId) {
  709. this.groupActivityId = orderInfoVo.merchantInfoList[0].orderInfoList[0].groupBuyActivityId
  710. this.productId = orderInfoVo.merchantInfoList[0].orderInfoList[0].productId
  711. }
  712. if (orderInfoVo.merchantInfoList[0].deliveryMethodMer.split(',').length == 1) {
  713. this.shippingType = orderInfoVo.merchantInfoList[0].deliveryMethodMer
  714. }
  715. this.orderInfoVo = {
  716. ...orderInfoVo,
  717. systemFormValue: orderInfoVo.systemFormValue ? this.$util.objToArr(JSON.parse(
  718. orderInfoVo.systemFormValue)) : []
  719. };
  720. console.log(this.orderInfoVo, '0000000000000000000000000000000')
  721. this.isAddress = Number(this.orderInfoVo.secondType) < 5 && Number(this.orderInfoVo.secondType) !== 2 && Number(
  722. this.orderInfoVo.type) != 2;
  723. this.merchantOrderVoList = orderInfoVo.merchantInfoList; //商户端数据
  724. this.platCouponFee = orderInfoVo.platCouponFee; //平台优惠券总金额
  725. this.platUserCouponId = orderInfoVo.platUserCouponId;
  726. this.merCouponFee = orderInfoVo.merCouponFee; //店铺优惠券总金额
  727. orderInfoVo.merchantInfoList.map(item => {
  728. if (item.shippingType == 2) this.isAddress = false;
  729. this.orderMerchantRequestList.push({
  730. shippingType: item.shippingType,
  731. merId: item.merId,
  732. remark: '',
  733. userCouponId: item.userCouponId
  734. })
  735. if (item.shippingType === 2) this.getTakeTheir(item.merId)
  736. item.addressDetail = this.merchangtInfo.addressDetail;
  737. item.phone = this.merchangtInfo.phone;
  738. item.latitude = this.merchangtInfo.latitude;
  739. item.longitude = this.merchangtInfo.longitude;
  740. });
  741. this.type = orderInfoVo.type; //订单类型
  742. this.secondType = orderInfoVo
  743. .secondType; //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  744. this.orderProNum = orderInfoVo.orderProNum;
  745. if (orderInfoVo.addressId && this.addressChangeId === 0) {
  746. this.addressId = orderInfoVo.addressId;
  747. } else {
  748. this.addressId = this.addressChangeId;
  749. if (orderInfoVo.addressId != this.addressChangeId && this.addressChangeId > 0)
  750. this.computedPrice();
  751. }
  752. this.getaddressInfo();
  753. }).catch(err => {
  754. // console.log(err)
  755. uni.navigateTo({
  756. url: '/pages/goods/order_list/index'
  757. });
  758. })
  759. },
  760. // 计算订单价格
  761. computedPrice: function() {
  762. uni.showLoading({
  763. title: '加载中...'
  764. });
  765. let shippingType = this.shippingType;
  766. postOrderComputed({
  767. addressId: this.addressId,
  768. isUseIntegral: this.isUseIntegral,
  769. orderMerchantRequestList: this.orderMerchantRequestList,
  770. preOrderNo: this.orderNo,
  771. platUserCouponId: this.platUserCouponId
  772. }).then(res => {
  773. let data = res.data;
  774. //usedIntegral 使用的积分,surplusIntegral 剩余积分
  775. data.merOrderResponseList.map((item, i) => {
  776. this.merchantOrderVoList[i].freightFee = item.freightFee
  777. this.merchantOrderVoList[i].couponFee = item.couponFee
  778. });
  779. this.orderInfoVo.platCouponUserList = data.platCouponUserList; //平台优惠券数据
  780. this.merCouponFee = data.merCouponFee; //店铺优惠券总金额
  781. this.orderInfoVo.couponFee = data.couponFee; //优惠券优惠金额
  782. this.orderInfoVo.userIntegral = data.surplusIntegral; //使用的积分
  783. this.orderInfoVo.deductionPrice = data.deductionPrice;
  784. this.orderInfoVo.freightFee = data.freightFee;
  785. this.orderInfoVo.payFee = data.payFee;
  786. this.orderInfoVo.proTotalFee = data.proTotalFee;
  787. this.orderInfoVo.surplusIntegral = data.usedIntegral; //剩余积分
  788. this.platCouponFee = data.platCouponFee; //平台优惠金额
  789. this.orderInfoVo.integralDeductionSwitch = data.integralDeductionSwitch //积分抵扣开关
  790. //选中商户优惠券的值
  791. this.merchantOrderVoList[this.activeIndex].merCouponUserList = data.merOrderResponseList[
  792. this.activeIndex].merCouponUserList; //商户数据
  793. this.merUserCouponId = data.merOrderResponseList[this.activeIndex]
  794. .userCouponId //店铺使用优惠券的id
  795. console.log(this.orderInfoVo, '222222222222222222222222222222222')
  796. uni.hideLoading();
  797. }).catch(err => {
  798. uni.hideLoading();
  799. return this.$util.Tips({
  800. title: err
  801. });
  802. });
  803. },
  804. bindPickerChange: function(e) {
  805. let value = e.detail.value;
  806. this.shippingType = value;
  807. this.computedPrice();
  808. },
  809. /**
  810. * 使用积分抵扣
  811. */
  812. ChangeIntegral: function() {
  813. this.isUseIntegral = !this.isUseIntegral;
  814. this.computedPrice();
  815. },
  816. bindHideKeyboard: function(e, i) {
  817. this.orderMerchantRequestList[i].remark = e;
  818. },
  819. /*
  820. * 获取默认收货地址或者获取某条地址信息
  821. */
  822. getaddressInfo: function() {
  823. if (this.orderType == 'secondHand') {
  824. getAddressDefault().then(res => {
  825. console.log('地址', res)
  826. this.addressInfo = res.data || {};
  827. })
  828. } else {
  829. if (this.addressId) {
  830. getAddressDetail(this.addressId).then(res => {
  831. if (res.data) {
  832. res.data.isDefault = res.data.isDefault;
  833. this.addressInfo = res.data || {};
  834. }
  835. })
  836. }
  837. }
  838. },
  839. //关闭优惠券弹窗
  840. ChangCouponsClone: function(coupon) {
  841. this.coupon.list = [];
  842. this.coupon.coupon = false;
  843. },
  844. //点击优惠券弹窗确定后
  845. ChangCoupons: function(item) {
  846. this.coupon.list = [];
  847. if (item.merId === 0) {
  848. this.platUserCouponId = item.isChecked ? item.id : 0;
  849. } else {
  850. this.$set(this.orderMerchantRequestList[this.activeIndex], 'userCouponId', item.isChecked ? item
  851. .id : 0);
  852. }
  853. this.coupon.coupon = false;
  854. this.computedPrice();
  855. },
  856. /**
  857. * 选择优惠券
  858. * @param {Object} item优惠券对象
  859. * @param {Number} merId商户id
  860. * @param {Number} index索引
  861. */
  862. couponTap: function(item, merId, index) {
  863. this.$set(this.coupon, 'list', item);
  864. this.$set(this.coupon, 'couponMoney', item);
  865. this.coupon.coupon = true;
  866. this.merId = merId; //商户id
  867. if (merId !== 0) this.activeIndex = index;
  868. this.coupon.loading = false;
  869. },
  870. /**
  871. * 获取当前金额可用优惠券
  872. *
  873. */
  874. getCouponList: function(item, merId) {
  875. this.$set(this.coupon, 'list', item);
  876. this.openType = 1;
  877. uni.hideLoading();
  878. },
  879. onAddress: function() {
  880. if (this.orderType !== 'secondHand') {
  881. uni.navigateTo({
  882. url: '/pages/address/user_address_list/index' + this.orderNo
  883. });
  884. } else {
  885. uni.navigateTo({
  886. url: '/pages/address/user_address_list/index'
  887. });
  888. }
  889. },
  890. realName: function(e) {
  891. this.contacts = e.detail.value;
  892. },
  893. phone: function(e) {
  894. this.contactsTel = e.detail.value;
  895. },
  896. payment: function(data) {
  897. let that = this;
  898. // #ifdef MP
  899. uni.checkBeforeAddOrder({
  900. success(res) {
  901. console.log("下单前置检查 成功:", JSON.stringify(res));
  902. const traceId = res.data.traceId;
  903. data.traceId = traceId;
  904. that.onCreate(data);
  905. },
  906. fail(res) {
  907. console.log("下单前置检查 失败:", JSON.stringify(res));
  908. }
  909. });
  910. // #endif
  911. // #ifndef MP
  912. that.onCreate(data);
  913. // #endif
  914. },
  915. onCreate(data) {
  916. const api = this.orderType == 'secondHand' ? secondHandOrderCreate : orderCreate;
  917. api(data).then(res => {
  918. if (res.data.groupBuyIsFull == 1) {
  919. uni.hideLoading();
  920. return this.$refs.sh_popup.open('center')
  921. }
  922. if (this.secondType === this.ProductTypeEnum.Integral && this.orderInfoVo.payFee == 0) {
  923. // 积分商品并且支付金额为0时,直接默认走余额支付的逻辑,订单支付成功跳转到支付结果页
  924. this.changeOrderPay(res.data.orderNo, 'yue', 'yue', 'integral', 'integral', '0')
  925. } else {
  926. // 其他商品走正常流程,去支付收银台页面
  927. this.getToPayment(this.secondType, res.data, this.orderType)
  928. }
  929. uni.hideLoading();
  930. }).catch(err => {
  931. uni.hideLoading();
  932. return this.$util.Tips({
  933. title: err
  934. });
  935. });
  936. },
  937. //立即下单
  938. SubOrder: Debounce(function(e) {
  939. let that = this,
  940. data = {};
  941. let flag = false;
  942. if (this.orderType == 'secondHand') {
  943. console.log(this.addressInfo)
  944. that.orderMerchantRequestList.map(function(v) {
  945. if (v.shippingType === 1 && !that.addressInfo.id) {
  946. flag = true;
  947. }
  948. });
  949. if (flag) {
  950. that.$util.Tips({
  951. title: '请选择收货地址'
  952. });
  953. return;
  954. }
  955. data = {
  956. addressId: this.merchantOrderVoList[this.activeIndex].shippingType == 1 ? this.addressInfo.id : null,
  957. orderMerchantRequestList: [
  958. {
  959. remark: this.merchantOrderVoList[this.activeIndex].remark || '',
  960. sellerId: this.merchantOrderVoList[this.activeIndex].sellerId,
  961. shippingType: this.merchantOrderVoList[this.activeIndex].shippingType
  962. }
  963. ],
  964. preOrderNo: this.orderNo
  965. }
  966. uni.showLoading({
  967. title: '订单提交中'
  968. });
  969. that.payment(data);
  970. } else {
  971. that.orderMerchantRequestList.map(function(v) {
  972. if (v.shippingType === 1 && !that.addressId && that.orderInfoVo.secondType !== 2) {
  973. flag = true;
  974. }
  975. });
  976. if (flag) {
  977. that.$util.Tips({
  978. title: '请选择收货地址'
  979. });
  980. return;
  981. }
  982. let systemFormValue = Array.from(this.orderInfoVo.systemFormValue)
  983. let systemFormData = []
  984. for (var i = 0; i < systemFormValue.length; i++) {
  985. let curdata = systemFormValue[i]
  986. if (['radios'].indexOf(curdata.name) == -1 && (curdata.titleShow.val || (['uploadPicture',
  987. 'dateranges'
  988. ].indexOf(curdata.name) == -1 && curdata.value && curdata.value.trim()))) {
  989. if ((curdata.name === 'texts' && curdata.valConfig.tabVal == 0) || ['dates', 'times',
  990. 'selects', 'citys', 'checkboxs'
  991. ].indexOf(curdata.name) != -1) {
  992. if (!curdata.value || (curdata.value && !curdata.value.trim())) {
  993. return that.$util.Tips({
  994. title: `请填写${curdata.titleConfig.val}`
  995. });
  996. }
  997. }
  998. if (curdata.name === 'timeranges') {
  999. if (!curdata.value) {
  1000. return that.$util.Tips({
  1001. title: `请选择${curdata.titleConfig.val}`
  1002. });
  1003. }
  1004. }
  1005. if (curdata.name === 'dateranges') {
  1006. if (!curdata.value.length) {
  1007. return that.$util.Tips({
  1008. title: `请选择${curdata.titleConfig.val}`
  1009. });
  1010. }
  1011. }
  1012. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 4) {
  1013. if (curdata.value <= 0) {
  1014. return that.$util.Tips({
  1015. title: `请填写大于0的${curdata.titleConfig.val}`
  1016. });
  1017. }
  1018. }
  1019. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 3) {
  1020. if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(curdata.value)) {
  1021. return that.$util.Tips({
  1022. title: `请填写正确的${curdata.titleConfig.val}`
  1023. });
  1024. }
  1025. }
  1026. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 1) {
  1027. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(curdata.value)) {
  1028. return that.$util.Tips({
  1029. title: `请填写正确的${curdata.titleConfig.val}`
  1030. });
  1031. }
  1032. }
  1033. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 2) {
  1034. if (!
  1035. /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/i
  1036. .test(curdata.value)) {
  1037. return that.$util.Tips({
  1038. title: `请填写正确的${curdata.titleConfig.val}`
  1039. });
  1040. }
  1041. }
  1042. if (curdata.name === 'uploadPicture') {
  1043. if (!curdata.value.length) {
  1044. return that.$util.Tips({
  1045. title: `请上传${curdata.titleConfig.val}`
  1046. });
  1047. }
  1048. }
  1049. }
  1050. this.orderExtend[curdata.key] = curdata.value
  1051. systemFormData.push({
  1052. title: curdata.titleConfig.val,
  1053. value: curdata.value,
  1054. })
  1055. }
  1056. data = {
  1057. addressId: that.addressId,
  1058. orderMerchantRequestList: that.orderMerchantRequestList,
  1059. isUseIntegral: that.isUseIntegral,
  1060. preOrderNo: that.orderNo,
  1061. platUserCouponId: this.platUserCouponId,
  1062. systemFormId: this.orderInfoVo.systemFormId,
  1063. orderExtend: JSON.stringify(systemFormData)
  1064. };
  1065. uni.showLoading({
  1066. title: '订单提交中'
  1067. });
  1068. that.payment(data);
  1069. //// #ifdef MP
  1070. // openPaySubscribe().then(() => {
  1071. // that.payment(data);
  1072. // });
  1073. // // #endif
  1074. // // #ifndef MP
  1075. // that.payment(data);
  1076. // // #endif
  1077. }
  1078. })
  1079. }
  1080. }
  1081. </script>
  1082. <style lang="scss" scoped>
  1083. .time-box {
  1084. width: 100%;
  1085. height: 100%;
  1086. box-sizing: border-box;
  1087. position: fixed;
  1088. bottom: 0;
  1089. left: 0;
  1090. z-index: 99999;
  1091. background: rgba(33, 33, 33, 0.8);
  1092. .box-time {
  1093. width: 100%;
  1094. height: 500rpx;
  1095. background-color: #fff;
  1096. padding: 0 30rpx;
  1097. padding-bottom: 100rpx;
  1098. font-size: 28rpx;
  1099. color: #333;
  1100. box-sizing: border-box;
  1101. position: fixed;
  1102. bottom: 0;
  1103. left: 0;
  1104. z-index: 99999;
  1105. display: flex;
  1106. flex-direction: column;
  1107. .close {
  1108. position: relative;
  1109. display: flex;
  1110. align-items: center;
  1111. justify-content: center;
  1112. }
  1113. .scr-box {
  1114. flex: 1;
  1115. display: flex;
  1116. align-items: center;
  1117. overflow: hidden;
  1118. .menus {
  1119. width: 140rpx;
  1120. height: 100%;
  1121. background: #F7F8F9;
  1122. .current {
  1123. color: #141414;
  1124. background: #fff;
  1125. }
  1126. .left-name {
  1127. display: flex;
  1128. align-items: center;
  1129. justify-content: center;
  1130. padding: 25rpx 0;
  1131. font-weight: 500;
  1132. font-size: 27rpx;
  1133. color: #999999;
  1134. }
  1135. }
  1136. .times {
  1137. flex: 1;
  1138. height: 100%;
  1139. padding: 0 20rpx;
  1140. .right-times {
  1141. display: flex;
  1142. align-items: center;
  1143. padding: 25rpx 0;
  1144. font-weight: 500;
  1145. font-size: 27rpx;
  1146. color: #141414;
  1147. border-bottom: 2rpx solid #D6D7DC;
  1148. }
  1149. }
  1150. }
  1151. }
  1152. }
  1153. .w-480px {
  1154. width: 480rpx;
  1155. }
  1156. .noCoupon {
  1157. color: #999999;
  1158. }
  1159. .icon-jiantou {
  1160. font-size: 26rpx;
  1161. color: #515151;
  1162. margin-left: 14rpx;
  1163. }
  1164. .mr14 {
  1165. margin-right: 14rpx;
  1166. }
  1167. .couponTitle {
  1168. width: 430rpx;
  1169. display: inline-block;
  1170. text-align: right;
  1171. @include main_color(theme);
  1172. }
  1173. .store-address {
  1174. padding: 20rpx;
  1175. margin: 0 24rpx;
  1176. background: #F6F6F6;
  1177. border-radius: 8rpx;
  1178. font-size: 24rpx;
  1179. /*垂直居中*/
  1180. -webkit-box-align: center;
  1181. /*旧版本*/
  1182. -moz-box-align: center;
  1183. /*旧版本*/
  1184. -ms-flex-align: center;
  1185. /*混合版本*/
  1186. -webkit-align-items: center;
  1187. /*新版本*/
  1188. align-items: center;
  1189. /*新版本*/
  1190. .phone {
  1191. margin-bottom: 10rpx;
  1192. color: #282828;
  1193. font-weight: bold;
  1194. }
  1195. .name {
  1196. padding-right: 20rpx;
  1197. }
  1198. .info {
  1199. flex: 1;
  1200. }
  1201. .line2 {
  1202. width: 456rpx !important;
  1203. }
  1204. .map {
  1205. text-align: center;
  1206. padding-left: 36rpx;
  1207. position: relative;
  1208. @include main_color(theme);
  1209. &::before {
  1210. content: '';
  1211. display: inline-block;
  1212. width: 2rpx;
  1213. height: 42rpx;
  1214. background-color: #DDDDDD;
  1215. position: absolute;
  1216. left: 0;
  1217. top: 18rpx;
  1218. }
  1219. .iconfont {
  1220. color: var(--view-theme);
  1221. }
  1222. .map_text {
  1223. color: var(--view-theme);
  1224. }
  1225. }
  1226. }
  1227. .font_color {
  1228. @include main_color(theme);
  1229. }
  1230. .price_color {
  1231. @include price_color(theme);
  1232. }
  1233. .line2 {
  1234. width: 624rpx;
  1235. }
  1236. .textR {
  1237. text-align: right;
  1238. }
  1239. .order-submission .line {
  1240. width: 100%;
  1241. height: 3rpx;
  1242. }
  1243. .order-submission .line image {
  1244. width: 100%;
  1245. height: 100%;
  1246. display: block;
  1247. }
  1248. .order-submission .address {
  1249. padding: 40rpx 24rpx;
  1250. background-color: #fff;
  1251. box-sizing: border-box;
  1252. }
  1253. .order-submission .address .addressCon {
  1254. width: 596rpx;
  1255. font-size: 26rpx;
  1256. color: #666;
  1257. }
  1258. .order-submission .address .addressCon .name {
  1259. font-size: 30rpx;
  1260. color: #282828;
  1261. font-weight: bold;
  1262. // margin-bottom: 10rpx;
  1263. }
  1264. .order-submission .address .addressCon .name .phone {
  1265. margin-left: 50rpx;
  1266. }
  1267. .order-submission .address .addressCon .default {
  1268. margin-right: 12rpx;
  1269. }
  1270. .order-submission .address .addressCon .setaddress {
  1271. color: #333;
  1272. font-size: 28rpx;
  1273. }
  1274. .order-submission .address .iconfont {
  1275. color: #707070;
  1276. }
  1277. .order-submission .allAddress {
  1278. width: 100%;
  1279. @include index-gradient(theme);
  1280. padding: 30rpx 24rpx 0 24rpx;
  1281. }
  1282. .order-submission .allAddress .address.group {
  1283. border-radius: 0;
  1284. }
  1285. .order-submission .allAddress .address {
  1286. max-height: 180rpx;
  1287. margin: -2rpx auto 0 auto;
  1288. border-radius: 14rpx 14rpx 0 0;
  1289. }
  1290. .order-submission .allAddress .line {
  1291. width: 100%;
  1292. margin: 0 auto;
  1293. }
  1294. .order-submission .wrapper .item .discount .placeholder {
  1295. color: #ccc;
  1296. }
  1297. .order-submission .wrapper {
  1298. background-color: #fff;
  1299. margin-top: 24rpx;
  1300. }
  1301. .order-submission .wrapper .item {
  1302. padding: 28rpx 24rpx;
  1303. font-size: 30rpx;
  1304. color: #333333;
  1305. }
  1306. .order-submission .wrapper .item .discount {
  1307. font-size: 30rpx;
  1308. color: #333;
  1309. }
  1310. .order-submission .wrapper .item .discount .iconfont {
  1311. color: #515151;
  1312. }
  1313. .order-submission .wrapper .item .discount .num {
  1314. font-size: 32rpx;
  1315. margin-right: 20rpx;
  1316. }
  1317. .order-submission .wrapper .item .shipping {
  1318. font-size: 30rpx;
  1319. color: #999;
  1320. position: relative;
  1321. padding-right: 58rpx;
  1322. }
  1323. .order-submission .wrapper .item .shipping .iconfont {
  1324. font-size: 35rpx;
  1325. color: #707070;
  1326. position: absolute;
  1327. right: 0;
  1328. top: 50%;
  1329. transform: translateY(-50%);
  1330. margin-left: 30rpx;
  1331. }
  1332. .order-submission .wrapper .item textarea {
  1333. background-color: #f9f9f9;
  1334. width: auto !important;
  1335. height: 140rpx;
  1336. border-radius: 14rpx;
  1337. margin-top: 30rpx;
  1338. padding: 15rpx;
  1339. box-sizing: border-box;
  1340. font-weight: 400;
  1341. }
  1342. .order-submission .wrapper .item .placeholder {
  1343. color: #ccc;
  1344. }
  1345. .order-submission .wrapper .item .list {
  1346. margin-top: 35rpx;
  1347. }
  1348. .order-submission .wrapper .item .list .payItem {
  1349. border: 1px solid #eee;
  1350. border-radius: 14rpx;
  1351. height: 86rpx;
  1352. width: 100%;
  1353. box-sizing: border-box;
  1354. margin-top: 20rpx;
  1355. font-size: 28rpx;
  1356. color: #282828;
  1357. }
  1358. .order-submission .wrapper .item .list .payItem.on {
  1359. // border-color: #fc5445;
  1360. @include coupons_border_color(theme);
  1361. color: $theme-color;
  1362. }
  1363. .order-submission .wrapper .item .list .payItem .name {
  1364. width: 50%;
  1365. text-align: center;
  1366. border-right: 1px solid #eee;
  1367. }
  1368. .order-submission .wrapper .item .list .payItem .name .iconfont {
  1369. width: 44rpx;
  1370. height: 44rpx;
  1371. border-radius: 50%;
  1372. text-align: center;
  1373. line-height: 44rpx;
  1374. background-color: #fe960f;
  1375. color: #fff;
  1376. font-size: 30rpx;
  1377. margin-right: 15rpx;
  1378. }
  1379. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
  1380. background-color: #41b035;
  1381. }
  1382. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
  1383. background-color: #00AAEA;
  1384. }
  1385. .order-submission .wrapper .item .list .payItem .tip {
  1386. width: 49%;
  1387. text-align: center;
  1388. font-size: 26rpx;
  1389. color: #aaa;
  1390. }
  1391. .order-submission .moneyList {
  1392. margin-top: 15rpx;
  1393. background-color: #fff;
  1394. padding: 0 30rpx;
  1395. margin-bottom: calc(constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1396. margin-bottom: calc(env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1397. }
  1398. .order-submission .moneyList .item {
  1399. font-size: 30rpx;
  1400. color: #282828;
  1401. height: 96rpx;
  1402. }
  1403. .order-submission .moneyList .item~.item {
  1404. // margin-top: 20rpx;
  1405. }
  1406. .order-submission .moneyList .item .money {
  1407. color: #666666;
  1408. }
  1409. .order-submission .footer {
  1410. width: 100%;
  1411. height: 100rpx;
  1412. background-color: #fff;
  1413. padding: 0 30rpx;
  1414. font-size: 28rpx;
  1415. color: #333;
  1416. box-sizing: border-box;
  1417. position: fixed;
  1418. bottom: 0;
  1419. left: 0;
  1420. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1421. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1422. z-index: 999;
  1423. }
  1424. .order-submission .footer .settlement {
  1425. background-color: #fff;
  1426. font-size: 30rpx;
  1427. color: #fff;
  1428. width: 240rpx;
  1429. height: 70rpx;
  1430. @include main_bg_color(theme);
  1431. border-radius: 50rpx;
  1432. text-align: center;
  1433. line-height: 70rpx;
  1434. }
  1435. .footer .transparent {
  1436. opacity: 0
  1437. }
  1438. /deep/ checkbox .uni-checkbox-input.uni-checkbox-input-checked {
  1439. @include main_bg_color(theme);
  1440. border: none !important;
  1441. color: #fff !important
  1442. }
  1443. /deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  1444. @include main_bg_color(theme);
  1445. border: none !important;
  1446. color: #fff !important;
  1447. margin-right: 0 !important;
  1448. }
  1449. // 切换
  1450. /deep/.uni-date-x--border {
  1451. border: 0;
  1452. }
  1453. /deep/.uni-icons {
  1454. font-size: 0 !important;
  1455. }
  1456. /deep/.uni-date-x {
  1457. color: #999;
  1458. font-size: 15px;
  1459. }
  1460. /deep/.uni-date__x-input {
  1461. font-size: 15px;
  1462. }
  1463. /deep/uni-checkbox[disabled] .uni-checkbox-input {
  1464. background-color: #eee;
  1465. }
  1466. .abs-lt .active-card {
  1467. &:after {
  1468. right: -67rpx;
  1469. }
  1470. }
  1471. .abs-rt .active-card {
  1472. &:after {
  1473. left: -67rpx;
  1474. -moz-transform: scaleX(-1);
  1475. -webkit-transform: scaleX(-1);
  1476. -o-transform: scaleX(-1);
  1477. transform: scaleX(-1);
  1478. }
  1479. }
  1480. .active-card {
  1481. &:after {
  1482. content: "";
  1483. width: 67rpx;
  1484. height: 76rpx;
  1485. background-image: url('../static/images/nav_circle_left.png');
  1486. background-size: contain;
  1487. background-repeat: no-repeat;
  1488. position: absolute;
  1489. bottom: 0;
  1490. z-index: 4;
  1491. }
  1492. }
  1493. .line {
  1494. width: 680rpx;
  1495. margin: auto;
  1496. height: 3rpx;
  1497. }
  1498. .line image {
  1499. width: 100%;
  1500. height: 100%;
  1501. display: block;
  1502. }
  1503. .address {
  1504. background-color: #fff;
  1505. box-sizing: border-box;
  1506. }
  1507. .footer .transparent {
  1508. opacity: 0
  1509. }
  1510. .w-322 {
  1511. width: 322rpx;
  1512. }
  1513. .w-450 {
  1514. width: 450rpx;
  1515. }
  1516. .w-50p {
  1517. width: 50%;
  1518. }
  1519. .h-auto {
  1520. height: auto;
  1521. }
  1522. .bd-r-14 {
  1523. border-radius: 14rpx 14rpx 0 0 !important;
  1524. }
  1525. .mt30 {
  1526. margin-top: 30rpx;
  1527. }
  1528. .bg-primary-light {
  1529. @include main_rgba_color(theme);
  1530. }
  1531. .rd-lt-24rpx {
  1532. border-radius: 24rpx 0 0 0;
  1533. }
  1534. .rd-rt-24rpx {
  1535. border-radius: 0 24rpx 0 0;
  1536. }
  1537. .z-2 {
  1538. z-index: 2;
  1539. }
  1540. .gold {
  1541. color: #DCA658;
  1542. }
  1543. .select-name {
  1544. max-width: 300rpx;
  1545. }
  1546. .font-color {
  1547. font-weight: 500 !important;
  1548. }
  1549. /deep/ .uni-popup__wrapper {
  1550. background: #FFFFFF;
  1551. border-radius: 32rpx;
  1552. }
  1553. .sh_popup-content {
  1554. padding: 40rpx;
  1555. .sh_popup_title {
  1556. font-weight: 500;
  1557. font-size: 32rpx;
  1558. color: #333333;
  1559. text-align: center;
  1560. }
  1561. .sh_popup_text {
  1562. font-weight: 400;
  1563. font-size: 30rpx;
  1564. color: #666666;
  1565. text-align: center;
  1566. margin-top: 36rpx;
  1567. }
  1568. .sh_popup_btn {
  1569. display: flex;
  1570. margin-top: 60rpx;
  1571. justify-content: space-between;
  1572. .btn {
  1573. width: 244rpx;
  1574. height: 72rpx;
  1575. border-radius: 50rpx;
  1576. text-align: center;
  1577. line-height: 72rpx;
  1578. }
  1579. .no_btn {
  1580. @include coupons_border_color(theme);
  1581. color: $theme-color;
  1582. margin-right: 32rpx;
  1583. }
  1584. .yes_btn {
  1585. @include main_bg_color(theme);
  1586. color: #FFFFFF;
  1587. }
  1588. }
  1589. }
  1590. .item-go {
  1591. display: flex;
  1592. position: relative;
  1593. width: 100%;
  1594. padding: 20rpx 0;
  1595. padding-left: 39rpx;
  1596. background: #FFFFFF;
  1597. border-radius: 15rpx;
  1598. border: 2rpx solid #D6D7DC;
  1599. .sjx {
  1600. position: absolute;
  1601. width: 0;
  1602. height: 0;
  1603. top: 0;
  1604. right: 0;
  1605. border-top: 60rpx solid $bg-color-primary;
  1606. border-left: 60rpx solid transparent;
  1607. }
  1608. .dg-icon {
  1609. position: absolute;
  1610. top: -5rpx;
  1611. right: 5rpx;
  1612. transform: rotate(14deg);
  1613. ::before {
  1614. content: '\2713';
  1615. color: #fff;
  1616. }
  1617. }
  1618. }
  1619. .item-go-avt {
  1620. position: relative;
  1621. color: #FF6702;
  1622. background: #FFECE0;
  1623. border-radius: 15rpx;
  1624. border: 2rpx solid #FF6702;
  1625. }
  1626. </style>