index.vue 50 KB

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