index.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749
  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. _this.$set(_this, '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(this.orderInfoVo.type) != 2;
  670. orderInfoVo.merchantInfoList.map(item => {
  671. if (item.shippingType == 2 && this.orderType !== 'secondHand') this.isAddress = false;
  672. this.orderMerchantRequestList.push({
  673. shippingType: item.shippingType,
  674. merId: item.merId,
  675. remark: '',
  676. userCouponId: item.userCouponId
  677. })
  678. if (item.shippingType === 2) this.getTakeTheir(item.orderInfoList[0].productId)
  679. item.addressDetail = this.merchangtInfo.addressDetail;
  680. item.phone = this.merchangtInfo.phone;
  681. item.latitude = this.merchangtInfo.latitude;
  682. item.longitude = this.merchangtInfo.longitude;
  683. });
  684. this.merchantOrderVoList = orderInfoVo.merchantInfoList; //商户端数据
  685. this.type = orderInfoVo.type; //订单类型
  686. this.secondType = orderInfoVo.secondType; //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  687. this.orderProNum = orderInfoVo.orderProNum;
  688. // if (orderInfoVo.addressId && this.addressChangeId === 0) {
  689. // this.addressId = orderInfoVo.addressId;
  690. // } else {
  691. // this.addressId = this.addressChangeId;
  692. // if (orderInfoVo.addressId != this.addressChangeId && this.addressChangeId > 0)
  693. // this.computedPrice();
  694. // }
  695. this.getaddressInfo();
  696. }).catch(err => {
  697. // console.log(err)
  698. uni.navigateTo({
  699. url: '/pages/goods/order_list/index'
  700. });
  701. })
  702. },
  703. // 订单详情
  704. getloadPreOrder: function() {
  705. loadPreOrderApi(this.orderNo).then(res => {
  706. let orderInfoVo = res.data;
  707. if (orderInfoVo.merchantInfoList[0].orderInfoList[0].groupBuyActivityId) {
  708. this.groupActivityId = orderInfoVo.merchantInfoList[0].orderInfoList[0].groupBuyActivityId
  709. this.productId = orderInfoVo.merchantInfoList[0].orderInfoList[0].productId
  710. }
  711. if (orderInfoVo.merchantInfoList[0].deliveryMethodMer.split(',').length == 1) {
  712. this.shippingType = orderInfoVo.merchantInfoList[0].deliveryMethodMer
  713. }
  714. this.orderInfoVo = {
  715. ...orderInfoVo,
  716. systemFormValue: orderInfoVo.systemFormValue ? this.$util.objToArr(JSON.parse(
  717. orderInfoVo.systemFormValue)) : []
  718. };
  719. console.log(this.orderInfoVo, '0000000000000000000000000000000')
  720. this.isAddress = Number(this.orderInfoVo.secondType) < 5 && Number(this.orderInfoVo.secondType) !== 2 && Number(
  721. this.orderInfoVo.type) != 2;
  722. this.merchantOrderVoList = orderInfoVo.merchantInfoList; //商户端数据
  723. this.platCouponFee = orderInfoVo.platCouponFee; //平台优惠券总金额
  724. this.platUserCouponId = orderInfoVo.platUserCouponId;
  725. this.merCouponFee = orderInfoVo.merCouponFee; //店铺优惠券总金额
  726. orderInfoVo.merchantInfoList.map(item => {
  727. if (item.shippingType == 2) this.isAddress = false;
  728. this.orderMerchantRequestList.push({
  729. shippingType: item.shippingType,
  730. merId: item.merId,
  731. remark: '',
  732. userCouponId: item.userCouponId
  733. })
  734. if (item.shippingType === 2) this.getTakeTheir(item.merId)
  735. item.addressDetail = this.merchangtInfo.addressDetail;
  736. item.phone = this.merchangtInfo.phone;
  737. item.latitude = this.merchangtInfo.latitude;
  738. item.longitude = this.merchangtInfo.longitude;
  739. });
  740. this.type = orderInfoVo.type; //订单类型
  741. this.secondType = orderInfoVo
  742. .secondType; //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  743. this.orderProNum = orderInfoVo.orderProNum;
  744. if (orderInfoVo.addressId && this.addressChangeId === 0) {
  745. this.addressId = orderInfoVo.addressId;
  746. } else {
  747. this.addressId = this.addressChangeId;
  748. if (orderInfoVo.addressId != this.addressChangeId && this.addressChangeId > 0)
  749. this.computedPrice();
  750. }
  751. this.getaddressInfo();
  752. }).catch(err => {
  753. // console.log(err)
  754. uni.navigateTo({
  755. url: '/pages/goods/order_list/index'
  756. });
  757. })
  758. },
  759. // 计算订单价格
  760. computedPrice: function() {
  761. uni.showLoading({
  762. title: '加载中...'
  763. });
  764. let shippingType = this.shippingType;
  765. postOrderComputed({
  766. addressId: this.addressId,
  767. isUseIntegral: this.isUseIntegral,
  768. orderMerchantRequestList: this.orderMerchantRequestList,
  769. preOrderNo: this.orderNo,
  770. platUserCouponId: this.platUserCouponId
  771. }).then(res => {
  772. let data = res.data;
  773. //usedIntegral 使用的积分,surplusIntegral 剩余积分
  774. data.merOrderResponseList.map((item, i) => {
  775. this.merchantOrderVoList[i].freightFee = item.freightFee
  776. this.merchantOrderVoList[i].couponFee = item.couponFee
  777. });
  778. this.orderInfoVo.platCouponUserList = data.platCouponUserList; //平台优惠券数据
  779. this.merCouponFee = data.merCouponFee; //店铺优惠券总金额
  780. this.orderInfoVo.couponFee = data.couponFee; //优惠券优惠金额
  781. this.orderInfoVo.userIntegral = data.surplusIntegral; //使用的积分
  782. this.orderInfoVo.deductionPrice = data.deductionPrice;
  783. this.orderInfoVo.freightFee = data.freightFee;
  784. this.orderInfoVo.payFee = data.payFee;
  785. this.orderInfoVo.proTotalFee = data.proTotalFee;
  786. this.orderInfoVo.surplusIntegral = data.usedIntegral; //剩余积分
  787. this.platCouponFee = data.platCouponFee; //平台优惠金额
  788. this.orderInfoVo.integralDeductionSwitch = data.integralDeductionSwitch //积分抵扣开关
  789. //选中商户优惠券的值
  790. this.merchantOrderVoList[this.activeIndex].merCouponUserList = data.merOrderResponseList[
  791. this.activeIndex].merCouponUserList; //商户数据
  792. this.merUserCouponId = data.merOrderResponseList[this.activeIndex]
  793. .userCouponId //店铺使用优惠券的id
  794. console.log(this.orderInfoVo, '222222222222222222222222222222222')
  795. uni.hideLoading();
  796. }).catch(err => {
  797. uni.hideLoading();
  798. return this.$util.Tips({
  799. title: err
  800. });
  801. });
  802. },
  803. bindPickerChange: function(e) {
  804. let value = e.detail.value;
  805. this.shippingType = value;
  806. this.computedPrice();
  807. },
  808. /**
  809. * 使用积分抵扣
  810. */
  811. ChangeIntegral: function() {
  812. this.isUseIntegral = !this.isUseIntegral;
  813. this.computedPrice();
  814. },
  815. bindHideKeyboard: function(e, i) {
  816. this.orderMerchantRequestList[i].remark = e;
  817. },
  818. /*
  819. * 获取默认收货地址或者获取某条地址信息
  820. */
  821. getaddressInfo: function() {
  822. if (this.orderType == 'secondHand') {
  823. getAddressDefault().then(res => {
  824. console.log('地址', res)
  825. this.addressInfo = res.data || {};
  826. })
  827. } else {
  828. if (this.addressId) {
  829. getAddressDetail(this.addressId).then(res => {
  830. if (res.data) {
  831. res.data.isDefault = res.data.isDefault;
  832. this.addressInfo = res.data || {};
  833. }
  834. })
  835. }
  836. }
  837. },
  838. //关闭优惠券弹窗
  839. ChangCouponsClone: function(coupon) {
  840. this.coupon.list = [];
  841. this.coupon.coupon = false;
  842. },
  843. //点击优惠券弹窗确定后
  844. ChangCoupons: function(item) {
  845. this.coupon.list = [];
  846. if (item.merId === 0) {
  847. this.platUserCouponId = item.isChecked ? item.id : 0;
  848. } else {
  849. this.$set(this.orderMerchantRequestList[this.activeIndex], 'userCouponId', item.isChecked ? item
  850. .id : 0);
  851. }
  852. this.coupon.coupon = false;
  853. this.computedPrice();
  854. },
  855. /**
  856. * 选择优惠券
  857. * @param {Object} item优惠券对象
  858. * @param {Number} merId商户id
  859. * @param {Number} index索引
  860. */
  861. couponTap: function(item, merId, index) {
  862. this.$set(this.coupon, 'list', item);
  863. this.$set(this.coupon, 'couponMoney', item);
  864. this.coupon.coupon = true;
  865. this.merId = merId; //商户id
  866. if (merId !== 0) this.activeIndex = index;
  867. this.coupon.loading = false;
  868. },
  869. /**
  870. * 获取当前金额可用优惠券
  871. *
  872. */
  873. getCouponList: function(item, merId) {
  874. this.$set(this.coupon, 'list', item);
  875. this.openType = 1;
  876. uni.hideLoading();
  877. },
  878. onAddress: function() {
  879. if (this.orderType !== 'secondHand') {
  880. uni.navigateTo({
  881. url: '/pages/address/user_address_list/index' + this.orderNo
  882. });
  883. } else {
  884. uni.navigateTo({
  885. url: '/pages/address/user_address_list/index'
  886. });
  887. }
  888. },
  889. realName: function(e) {
  890. this.contacts = e.detail.value;
  891. },
  892. phone: function(e) {
  893. this.contactsTel = e.detail.value;
  894. },
  895. payment: function(data) {
  896. let that = this;
  897. // #ifdef MP
  898. uni.checkBeforeAddOrder({
  899. success(res) {
  900. console.log("下单前置检查 成功:", JSON.stringify(res));
  901. const traceId = res.data.traceId;
  902. data.traceId = traceId;
  903. that.onCreate(data);
  904. },
  905. fail(res) {
  906. console.log("下单前置检查 失败:", JSON.stringify(res));
  907. }
  908. });
  909. // #endif
  910. // #ifndef MP
  911. that.onCreate(data);
  912. // #endif
  913. },
  914. onCreate(data) {
  915. const api = this.orderType == 'secondHand' ? secondHandOrderCreate : orderCreate;
  916. api(data).then(res => {
  917. if (res.data.groupBuyIsFull == 1) {
  918. uni.hideLoading();
  919. return this.$refs.sh_popup.open('center')
  920. }
  921. if (this.secondType === this.ProductTypeEnum.Integral && this.orderInfoVo.payFee == 0) {
  922. // 积分商品并且支付金额为0时,直接默认走余额支付的逻辑,订单支付成功跳转到支付结果页
  923. this.changeOrderPay(res.data.orderNo, 'yue', 'yue', 'integral', 'integral', '0')
  924. } else {
  925. // 其他商品走正常流程,去支付收银台页面
  926. this.getToPayment(this.secondType, res.data, this.orderType)
  927. }
  928. uni.hideLoading();
  929. }).catch(err => {
  930. uni.hideLoading();
  931. return this.$util.Tips({
  932. title: err
  933. });
  934. });
  935. },
  936. //立即下单
  937. SubOrder: Debounce(function(e) {
  938. let that = this,
  939. data = {};
  940. let flag = false;
  941. if (this.orderType == 'secondHand') {
  942. console.log(this.addressInfo)
  943. that.orderMerchantRequestList.map(function(v) {
  944. if (!that.addressInfo.id) {
  945. flag = true;
  946. }
  947. });
  948. if (flag) {
  949. that.$util.Tips({
  950. title: '请选择收货地址'
  951. });
  952. return;
  953. }
  954. data = {
  955. addressId: this.addressInfo.id,
  956. orderMerchantRequestList: [
  957. {
  958. remark: this.merchantOrderVoList[this.activeIndex].remark || '',
  959. sellerId: this.merchantOrderVoList[this.activeIndex].sellerId,
  960. shippingType: this.merchantOrderVoList[this.activeIndex].shippingType
  961. }
  962. ],
  963. preOrderNo: this.orderNo
  964. }
  965. uni.showLoading({
  966. title: '订单提交中'
  967. });
  968. that.payment(data);
  969. } else {
  970. that.orderMerchantRequestList.map(function(v) {
  971. if (v.shippingType === 1 && !that.addressId && that.orderInfoVo.secondType !== 2) {
  972. flag = true;
  973. }
  974. });
  975. if (flag) {
  976. that.$util.Tips({
  977. title: '请选择收货地址'
  978. });
  979. return;
  980. }
  981. let systemFormValue = Array.from(this.orderInfoVo.systemFormValue)
  982. let systemFormData = []
  983. for (var i = 0; i < systemFormValue.length; i++) {
  984. let curdata = systemFormValue[i]
  985. if (['radios'].indexOf(curdata.name) == -1 && (curdata.titleShow.val || (['uploadPicture',
  986. 'dateranges'
  987. ].indexOf(curdata.name) == -1 && curdata.value && curdata.value.trim()))) {
  988. if ((curdata.name === 'texts' && curdata.valConfig.tabVal == 0) || ['dates', 'times',
  989. 'selects', 'citys', 'checkboxs'
  990. ].indexOf(curdata.name) != -1) {
  991. if (!curdata.value || (curdata.value && !curdata.value.trim())) {
  992. return that.$util.Tips({
  993. title: `请填写${curdata.titleConfig.val}`
  994. });
  995. }
  996. }
  997. if (curdata.name === 'timeranges') {
  998. if (!curdata.value) {
  999. return that.$util.Tips({
  1000. title: `请选择${curdata.titleConfig.val}`
  1001. });
  1002. }
  1003. }
  1004. if (curdata.name === 'dateranges') {
  1005. if (!curdata.value.length) {
  1006. return that.$util.Tips({
  1007. title: `请选择${curdata.titleConfig.val}`
  1008. });
  1009. }
  1010. }
  1011. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 4) {
  1012. if (curdata.value <= 0) {
  1013. return that.$util.Tips({
  1014. title: `请填写大于0的${curdata.titleConfig.val}`
  1015. });
  1016. }
  1017. }
  1018. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 3) {
  1019. if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(curdata.value)) {
  1020. return that.$util.Tips({
  1021. title: `请填写正确的${curdata.titleConfig.val}`
  1022. });
  1023. }
  1024. }
  1025. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 1) {
  1026. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(curdata.value)) {
  1027. return that.$util.Tips({
  1028. title: `请填写正确的${curdata.titleConfig.val}`
  1029. });
  1030. }
  1031. }
  1032. if (curdata.name === 'texts' && curdata.valConfig.tabVal == 2) {
  1033. if (!
  1034. /^[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
  1035. .test(curdata.value)) {
  1036. return that.$util.Tips({
  1037. title: `请填写正确的${curdata.titleConfig.val}`
  1038. });
  1039. }
  1040. }
  1041. if (curdata.name === 'uploadPicture') {
  1042. if (!curdata.value.length) {
  1043. return that.$util.Tips({
  1044. title: `请上传${curdata.titleConfig.val}`
  1045. });
  1046. }
  1047. }
  1048. }
  1049. this.orderExtend[curdata.key] = curdata.value
  1050. systemFormData.push({
  1051. title: curdata.titleConfig.val,
  1052. value: curdata.value,
  1053. })
  1054. }
  1055. data = {
  1056. addressId: that.addressId,
  1057. orderMerchantRequestList: that.orderMerchantRequestList,
  1058. isUseIntegral: that.isUseIntegral,
  1059. preOrderNo: that.orderNo,
  1060. platUserCouponId: this.platUserCouponId,
  1061. systemFormId: this.orderInfoVo.systemFormId,
  1062. orderExtend: JSON.stringify(systemFormData)
  1063. };
  1064. uni.showLoading({
  1065. title: '订单提交中'
  1066. });
  1067. that.payment(data);
  1068. //// #ifdef MP
  1069. // openPaySubscribe().then(() => {
  1070. // that.payment(data);
  1071. // });
  1072. // // #endif
  1073. // // #ifndef MP
  1074. // that.payment(data);
  1075. // // #endif
  1076. }
  1077. })
  1078. }
  1079. }
  1080. </script>
  1081. <style lang="scss" scoped>
  1082. .time-box {
  1083. width: 100%;
  1084. height: 100%;
  1085. box-sizing: border-box;
  1086. position: fixed;
  1087. bottom: 0;
  1088. left: 0;
  1089. z-index: 99999;
  1090. background: rgba(33, 33, 33, 0.8);
  1091. .box-time {
  1092. width: 100%;
  1093. height: 500rpx;
  1094. background-color: #fff;
  1095. padding: 0 30rpx;
  1096. padding-bottom: 100rpx;
  1097. font-size: 28rpx;
  1098. color: #333;
  1099. box-sizing: border-box;
  1100. position: fixed;
  1101. bottom: 0;
  1102. left: 0;
  1103. z-index: 99999;
  1104. display: flex;
  1105. flex-direction: column;
  1106. .close {
  1107. position: relative;
  1108. display: flex;
  1109. align-items: center;
  1110. justify-content: center;
  1111. }
  1112. .scr-box {
  1113. flex: 1;
  1114. display: flex;
  1115. align-items: center;
  1116. overflow: hidden;
  1117. .menus {
  1118. width: 140rpx;
  1119. height: 100%;
  1120. background: #F7F8F9;
  1121. .current {
  1122. color: #141414;
  1123. background: #fff;
  1124. }
  1125. .left-name {
  1126. display: flex;
  1127. align-items: center;
  1128. justify-content: center;
  1129. padding: 25rpx 0;
  1130. font-weight: 500;
  1131. font-size: 27rpx;
  1132. color: #999999;
  1133. }
  1134. }
  1135. .times {
  1136. flex: 1;
  1137. height: 100%;
  1138. padding: 0 20rpx;
  1139. .right-times {
  1140. display: flex;
  1141. align-items: center;
  1142. padding: 25rpx 0;
  1143. font-weight: 500;
  1144. font-size: 27rpx;
  1145. color: #141414;
  1146. border-bottom: 2rpx solid #D6D7DC;
  1147. }
  1148. }
  1149. }
  1150. }
  1151. }
  1152. .w-480px {
  1153. width: 480rpx;
  1154. }
  1155. .noCoupon {
  1156. color: #999999;
  1157. }
  1158. .icon-jiantou {
  1159. font-size: 26rpx;
  1160. color: #515151;
  1161. margin-left: 14rpx;
  1162. }
  1163. .mr14 {
  1164. margin-right: 14rpx;
  1165. }
  1166. .couponTitle {
  1167. width: 430rpx;
  1168. display: inline-block;
  1169. text-align: right;
  1170. @include main_color(theme);
  1171. }
  1172. .store-address {
  1173. padding: 20rpx;
  1174. margin: 0 24rpx;
  1175. background: #F6F6F6;
  1176. border-radius: 8rpx;
  1177. font-size: 24rpx;
  1178. /*垂直居中*/
  1179. -webkit-box-align: center;
  1180. /*旧版本*/
  1181. -moz-box-align: center;
  1182. /*旧版本*/
  1183. -ms-flex-align: center;
  1184. /*混合版本*/
  1185. -webkit-align-items: center;
  1186. /*新版本*/
  1187. align-items: center;
  1188. /*新版本*/
  1189. .phone {
  1190. margin-bottom: 10rpx;
  1191. color: #282828;
  1192. font-weight: bold;
  1193. }
  1194. .name {
  1195. padding-right: 20rpx;
  1196. }
  1197. .info {
  1198. flex: 1;
  1199. }
  1200. .line2 {
  1201. width: 456rpx !important;
  1202. }
  1203. .map {
  1204. text-align: center;
  1205. padding-left: 36rpx;
  1206. position: relative;
  1207. @include main_color(theme);
  1208. &::before {
  1209. content: '';
  1210. display: inline-block;
  1211. width: 2rpx;
  1212. height: 42rpx;
  1213. background-color: #DDDDDD;
  1214. position: absolute;
  1215. left: 0;
  1216. top: 18rpx;
  1217. }
  1218. .iconfont {
  1219. color: var(--view-theme);
  1220. }
  1221. .map_text {
  1222. color: var(--view-theme);
  1223. }
  1224. }
  1225. }
  1226. .font_color {
  1227. @include main_color(theme);
  1228. }
  1229. .price_color {
  1230. @include price_color(theme);
  1231. }
  1232. .line2 {
  1233. width: 624rpx;
  1234. }
  1235. .textR {
  1236. text-align: right;
  1237. }
  1238. .order-submission .line {
  1239. width: 100%;
  1240. height: 3rpx;
  1241. }
  1242. .order-submission .line image {
  1243. width: 100%;
  1244. height: 100%;
  1245. display: block;
  1246. }
  1247. .order-submission .address {
  1248. padding: 40rpx 24rpx;
  1249. background-color: #fff;
  1250. box-sizing: border-box;
  1251. }
  1252. .order-submission .address .addressCon {
  1253. width: 596rpx;
  1254. font-size: 26rpx;
  1255. color: #666;
  1256. }
  1257. .order-submission .address .addressCon .name {
  1258. font-size: 30rpx;
  1259. color: #282828;
  1260. font-weight: bold;
  1261. // margin-bottom: 10rpx;
  1262. }
  1263. .order-submission .address .addressCon .name .phone {
  1264. margin-left: 50rpx;
  1265. }
  1266. .order-submission .address .addressCon .default {
  1267. margin-right: 12rpx;
  1268. }
  1269. .order-submission .address .addressCon .setaddress {
  1270. color: #333;
  1271. font-size: 28rpx;
  1272. }
  1273. .order-submission .address .iconfont {
  1274. color: #707070;
  1275. }
  1276. .order-submission .allAddress {
  1277. width: 100%;
  1278. @include index-gradient(theme);
  1279. padding: 30rpx 24rpx 0 24rpx;
  1280. }
  1281. .order-submission .allAddress .address.group {
  1282. border-radius: 0;
  1283. }
  1284. .order-submission .allAddress .address {
  1285. max-height: 180rpx;
  1286. margin: -2rpx auto 0 auto;
  1287. border-radius: 14rpx 14rpx 0 0;
  1288. }
  1289. .order-submission .allAddress .line {
  1290. width: 100%;
  1291. margin: 0 auto;
  1292. }
  1293. .order-submission .wrapper .item .discount .placeholder {
  1294. color: #ccc;
  1295. }
  1296. .order-submission .wrapper {
  1297. background-color: #fff;
  1298. margin-top: 24rpx;
  1299. }
  1300. .order-submission .wrapper .item {
  1301. padding: 28rpx 24rpx;
  1302. font-size: 30rpx;
  1303. color: #333333;
  1304. }
  1305. .order-submission .wrapper .item .discount {
  1306. font-size: 30rpx;
  1307. color: #333;
  1308. }
  1309. .order-submission .wrapper .item .discount .iconfont {
  1310. color: #515151;
  1311. }
  1312. .order-submission .wrapper .item .discount .num {
  1313. font-size: 32rpx;
  1314. margin-right: 20rpx;
  1315. }
  1316. .order-submission .wrapper .item .shipping {
  1317. font-size: 30rpx;
  1318. color: #999;
  1319. position: relative;
  1320. padding-right: 58rpx;
  1321. }
  1322. .order-submission .wrapper .item .shipping .iconfont {
  1323. font-size: 35rpx;
  1324. color: #707070;
  1325. position: absolute;
  1326. right: 0;
  1327. top: 50%;
  1328. transform: translateY(-50%);
  1329. margin-left: 30rpx;
  1330. }
  1331. .order-submission .wrapper .item textarea {
  1332. background-color: #f9f9f9;
  1333. width: auto !important;
  1334. height: 140rpx;
  1335. border-radius: 14rpx;
  1336. margin-top: 30rpx;
  1337. padding: 15rpx;
  1338. box-sizing: border-box;
  1339. font-weight: 400;
  1340. }
  1341. .order-submission .wrapper .item .placeholder {
  1342. color: #ccc;
  1343. }
  1344. .order-submission .wrapper .item .list {
  1345. margin-top: 35rpx;
  1346. }
  1347. .order-submission .wrapper .item .list .payItem {
  1348. border: 1px solid #eee;
  1349. border-radius: 14rpx;
  1350. height: 86rpx;
  1351. width: 100%;
  1352. box-sizing: border-box;
  1353. margin-top: 20rpx;
  1354. font-size: 28rpx;
  1355. color: #282828;
  1356. }
  1357. .order-submission .wrapper .item .list .payItem.on {
  1358. // border-color: #fc5445;
  1359. @include coupons_border_color(theme);
  1360. color: $theme-color;
  1361. }
  1362. .order-submission .wrapper .item .list .payItem .name {
  1363. width: 50%;
  1364. text-align: center;
  1365. border-right: 1px solid #eee;
  1366. }
  1367. .order-submission .wrapper .item .list .payItem .name .iconfont {
  1368. width: 44rpx;
  1369. height: 44rpx;
  1370. border-radius: 50%;
  1371. text-align: center;
  1372. line-height: 44rpx;
  1373. background-color: #fe960f;
  1374. color: #fff;
  1375. font-size: 30rpx;
  1376. margin-right: 15rpx;
  1377. }
  1378. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
  1379. background-color: #41b035;
  1380. }
  1381. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
  1382. background-color: #00AAEA;
  1383. }
  1384. .order-submission .wrapper .item .list .payItem .tip {
  1385. width: 49%;
  1386. text-align: center;
  1387. font-size: 26rpx;
  1388. color: #aaa;
  1389. }
  1390. .order-submission .moneyList {
  1391. margin-top: 15rpx;
  1392. background-color: #fff;
  1393. padding: 0 30rpx;
  1394. margin-bottom: calc(constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1395. margin-bottom: calc(env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1396. }
  1397. .order-submission .moneyList .item {
  1398. font-size: 30rpx;
  1399. color: #282828;
  1400. height: 96rpx;
  1401. }
  1402. .order-submission .moneyList .item~.item {
  1403. // margin-top: 20rpx;
  1404. }
  1405. .order-submission .moneyList .item .money {
  1406. color: #666666;
  1407. }
  1408. .order-submission .footer {
  1409. width: 100%;
  1410. height: 100rpx;
  1411. background-color: #fff;
  1412. padding: 0 30rpx;
  1413. font-size: 28rpx;
  1414. color: #333;
  1415. box-sizing: border-box;
  1416. position: fixed;
  1417. bottom: 0;
  1418. left: 0;
  1419. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1420. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1421. z-index: 999;
  1422. }
  1423. .order-submission .footer .settlement {
  1424. background-color: #fff;
  1425. font-size: 30rpx;
  1426. color: #fff;
  1427. width: 240rpx;
  1428. height: 70rpx;
  1429. @include main_bg_color(theme);
  1430. border-radius: 50rpx;
  1431. text-align: center;
  1432. line-height: 70rpx;
  1433. }
  1434. .footer .transparent {
  1435. opacity: 0
  1436. }
  1437. /deep/ checkbox .uni-checkbox-input.uni-checkbox-input-checked {
  1438. @include main_bg_color(theme);
  1439. border: none !important;
  1440. color: #fff !important
  1441. }
  1442. /deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  1443. @include main_bg_color(theme);
  1444. border: none !important;
  1445. color: #fff !important;
  1446. margin-right: 0 !important;
  1447. }
  1448. // 切换
  1449. /deep/.uni-date-x--border {
  1450. border: 0;
  1451. }
  1452. /deep/.uni-icons {
  1453. font-size: 0 !important;
  1454. }
  1455. /deep/.uni-date-x {
  1456. color: #999;
  1457. font-size: 15px;
  1458. }
  1459. /deep/.uni-date__x-input {
  1460. font-size: 15px;
  1461. }
  1462. /deep/uni-checkbox[disabled] .uni-checkbox-input {
  1463. background-color: #eee;
  1464. }
  1465. .abs-lt .active-card {
  1466. &:after {
  1467. right: -67rpx;
  1468. }
  1469. }
  1470. .abs-rt .active-card {
  1471. &:after {
  1472. left: -67rpx;
  1473. -moz-transform: scaleX(-1);
  1474. -webkit-transform: scaleX(-1);
  1475. -o-transform: scaleX(-1);
  1476. transform: scaleX(-1);
  1477. }
  1478. }
  1479. .active-card {
  1480. &:after {
  1481. content: "";
  1482. width: 67rpx;
  1483. height: 76rpx;
  1484. background-image: url('../static/images/nav_circle_left.png');
  1485. background-size: contain;
  1486. background-repeat: no-repeat;
  1487. position: absolute;
  1488. bottom: 0;
  1489. z-index: 4;
  1490. }
  1491. }
  1492. .line {
  1493. width: 680rpx;
  1494. margin: auto;
  1495. height: 3rpx;
  1496. }
  1497. .line image {
  1498. width: 100%;
  1499. height: 100%;
  1500. display: block;
  1501. }
  1502. .address {
  1503. background-color: #fff;
  1504. box-sizing: border-box;
  1505. }
  1506. .footer .transparent {
  1507. opacity: 0
  1508. }
  1509. .w-322 {
  1510. width: 322rpx;
  1511. }
  1512. .w-450 {
  1513. width: 450rpx;
  1514. }
  1515. .w-50p {
  1516. width: 50%;
  1517. }
  1518. .h-auto {
  1519. height: auto;
  1520. }
  1521. .bd-r-14 {
  1522. border-radius: 14rpx 14rpx 0 0 !important;
  1523. }
  1524. .mt30 {
  1525. margin-top: 30rpx;
  1526. }
  1527. .bg-primary-light {
  1528. @include main_rgba_color(theme);
  1529. }
  1530. .rd-lt-24rpx {
  1531. border-radius: 24rpx 0 0 0;
  1532. }
  1533. .rd-rt-24rpx {
  1534. border-radius: 0 24rpx 0 0;
  1535. }
  1536. .z-2 {
  1537. z-index: 2;
  1538. }
  1539. .gold {
  1540. color: #DCA658;
  1541. }
  1542. .select-name {
  1543. max-width: 300rpx;
  1544. }
  1545. .font-color {
  1546. font-weight: 500 !important;
  1547. }
  1548. /deep/ .uni-popup__wrapper {
  1549. background: #FFFFFF;
  1550. border-radius: 32rpx;
  1551. }
  1552. .sh_popup-content {
  1553. padding: 40rpx;
  1554. .sh_popup_title {
  1555. font-weight: 500;
  1556. font-size: 32rpx;
  1557. color: #333333;
  1558. text-align: center;
  1559. }
  1560. .sh_popup_text {
  1561. font-weight: 400;
  1562. font-size: 30rpx;
  1563. color: #666666;
  1564. text-align: center;
  1565. margin-top: 36rpx;
  1566. }
  1567. .sh_popup_btn {
  1568. display: flex;
  1569. margin-top: 60rpx;
  1570. justify-content: space-between;
  1571. .btn {
  1572. width: 244rpx;
  1573. height: 72rpx;
  1574. border-radius: 50rpx;
  1575. text-align: center;
  1576. line-height: 72rpx;
  1577. }
  1578. .no_btn {
  1579. @include coupons_border_color(theme);
  1580. color: $theme-color;
  1581. margin-right: 32rpx;
  1582. }
  1583. .yes_btn {
  1584. @include main_bg_color(theme);
  1585. color: #FFFFFF;
  1586. }
  1587. }
  1588. }
  1589. .item-go {
  1590. display: flex;
  1591. position: relative;
  1592. width: 100%;
  1593. padding: 20rpx 0;
  1594. padding-left: 39rpx;
  1595. background: #FFFFFF;
  1596. border-radius: 15rpx;
  1597. border: 2rpx solid #D6D7DC;
  1598. .sjx {
  1599. position: absolute;
  1600. width: 0;
  1601. height: 0;
  1602. top: 0;
  1603. right: 0;
  1604. border-top: 60rpx solid $bg-color-primary;
  1605. border-left: 60rpx solid transparent;
  1606. }
  1607. .dg-icon {
  1608. position: absolute;
  1609. top: -5rpx;
  1610. right: 5rpx;
  1611. transform: rotate(14deg);
  1612. ::before {
  1613. content: '\2713';
  1614. color: #fff;
  1615. }
  1616. }
  1617. }
  1618. .item-go-avt {
  1619. position: relative;
  1620. color: #FF6702;
  1621. background: #FFECE0;
  1622. border-radius: 15rpx;
  1623. border: 2rpx solid #FF6702;
  1624. }
  1625. </style>