index.vue 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="w-full relative z-99 gradient-box" :style="{'padding-top': sysHeight + 'px'}">
  4. <view class="w-full px-20 pl-20 h-80 flex-between-center">
  5. <text class="iconfont icon-ic_leftarrow fs-40 text--w111-fff" @click="goPage(3)"></text>
  6. <text class="fs-34 fw-500 text--w111-fff">提交订单</text>
  7. <text></text>
  8. </view>
  9. <view class="header" v-if="tableId">
  10. <view class="top acea-row row-middle">
  11. <view class="name">{{ codeData.storeName.storeName }}</view>
  12. <view class="number"><text class="light">{{ codeData.category.name }}{{ codeData.table_number }}</text>号桌</view>
  13. </view>
  14. <view>{{ codeData.serial_number }}</view>
  15. </view>
  16. <view class="px-20 mt-30" v-if="!tableId">
  17. <view class="allAddress">
  18. <!-- isDisplay 支持的配送方式数组 -->
  19. <!-- store_self_mention 自提开关 -->
  20. <view class="h-96 relative" v-if="isDisplay.length>1">
  21. <view class="w-full abs-lb rd-t-24rpx flex bg--w111-fff fs-26 text--w111-666 fw-400">
  22. <view class="flex-center w-50p h-76 rd-lt-24rpx z-2"
  23. :class="deliveryType == 1 ? 'bg--w111-fff font-num fs-28 fw-500' : 'bg-primary-light bg-horn'"
  24. v-if="isDisplay.includes('1')"
  25. @tap="addressType(0,1)">商城配送</view>
  26. <view class="flex-center w-50p h-76 z-2"
  27. :class="[deliveryType == 2 ? 'bg--w111-fff font-num fs-28 fw-500' : 'bg-primary-light',styleType]"
  28. v-if="isDisplay.includes('2')"
  29. @tap="addressType(1,2)"
  30. >门店自提</view>
  31. <view class="flex-center w-50p h-76 rd-rt-24rpx z-2"
  32. :class="deliveryType == 3 ? 'bg--w111-fff font-num fs-28 fw-500' : 'bg-primary-light bg-horn-r'"
  33. v-if="isDisplay.includes('3')"
  34. @tap="addressType(0,3)"
  35. >门店配送</view>
  36. </view>
  37. <!-- 选中放大样式 2项的-->
  38. <view v-if="isDisplay.length==2" class="w-50p rd-t-24rpx bg--w111-fff h-96"
  39. :class="(deliveryType == 1 || (deliveryType == 2 && !isDisplay.includes('1'))) ? 'abs-lt' : 'abs-rt'">
  40. <view class="w-full h-full relative active-card"></view>
  41. </view>
  42. <!-- 选中放大样式 3项的-->
  43. <view v-if="isDisplay.length==3" class="w-33-33p rd-t-24rpx bg--w111-fff h-96"
  44. :class="deliveryType == 1 ? 'abs-lt' : deliveryType == 2?'abs-ct':'abs-rt'">
  45. <view class="w-full h-full relative active-card"></view>
  46. </view>
  47. </view>
  48. <view v-else class="bg--w111-fff rd-t-24rpx text--w111-999 fs-24">
  49. <view v-if="Array.isArray(isDisplay) && isDisplay.includes('1')" class="acea-row row-middle h-88 lh-88rpx ml-34 mr-34 border-b b--w111-f5f5f5 border-b-s">
  50. <text class="iconfont icon-icon_truck font-num fs-36 mr-12"></text>
  51. <text class="font-num fs-28 mr-12">商城配送</text>
  52. 线上下单,商城为您配送
  53. </view>
  54. <view v-else-if="Array.isArray(isDisplay) && isDisplay.includes('2')" class="acea-row row-middle h-88 lh-88rpx ml-34 mr-34 border-b b--w111-f5f5f5 border-b-s">
  55. <text class="iconfont icon-a-icon_trailcar font-num fs-36 mr-12"></text>
  56. <text class="font-num fs-28 mr-12">门店自提</text>
  57. 线上下单,到店自提
  58. </view>
  59. <view v-else class="acea-row row-middle h-88 lh-88rpx ml-34 mr-34 border-b b--w111-f5f5f5 border-b-s">
  60. <text class="iconfont icon-icon_truck font-num fs-36 mr-12"></text>
  61. <text class="font-num fs-28 mr-12">门店配送</text>
  62. 线上下单,门店为您配送
  63. </view>
  64. </view>
  65. <view class='address add1 flex-between-center'
  66. :class="[1,2].includes(isDisplay) ? 'rd-24rpx' : 'rd-b-24rpx'"
  67. @tap='onAddress(addressInfo.real_name)' v-if='deliveryType == 1'>
  68. <view v-if="addressInfo.real_name">
  69. <view class="fs-30 text--w111-333 fw-500 acea-row row-middle">
  70. <text>{{addressInfo.real_name}}</text> <text class='pl-20'>{{addressInfo.phone}}</text>
  71. <text class='default font-num acea-row row-center-wrapper ml-8' v-if="addressInfo.is_default">默认</text>
  72. </view>
  73. <view class="fs-24 text--w111-666 mt-12">{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street}}{{addressInfo.detail}}</view>
  74. </view>
  75. <view class='fs-30 text--w111-333 fw-500 lh-42rpx flex-y-center' v-else>
  76. <image src="../static/location_order_icon.png" class="w-32 h-32"></image>
  77. <text class="pl-8">设置收货地址</text>
  78. </view>
  79. <text class="iconfont icon-ic_rightarrow fs-32 text--w111-666 ml-20"></text>
  80. </view>
  81. <view class='address add1 acea-row row-between-wrapper'
  82. :class="[1,2].includes(isDisplay) ? 'rd-24rpx' : 'rd-b-24rpx'" v-else>
  83. <block v-if="storeList.length>0">
  84. <view class="w-full">
  85. <view class="w-full flex-between-center">
  86. <view @click="goStore">
  87. <view class="fs-30 line1 fw-500 lh-42rpx acea-row row-middle">
  88. <text class="line1 max-w-368">{{system_store.name}}</text>
  89. <text class="iconfont icon-ic_rightarrow ml-12" v-if="!collage_id && !isStore"></text>
  90. </view>
  91. <view class="fs-24 w-410 line2 text--w111-666 lh-30rpx mt-12">{{system_store.address}}{{system_store.detailed_address}}</view>
  92. </view>
  93. <view class="_map relative"
  94. :style="{backgroundImage:'url('+imgHost+'/statics/images/order/order_map_bg.png'+')'}"
  95. @tap="showMaoLocation(system_store)">
  96. <view class="store_distance flex-center bg--w111-fff rd-8rpx fs-20 fw-500 line1">距您{{range}}km</view>
  97. <view class="store-horn"></view>
  98. <view class="store_logo bg--w111-fff rd-8rpx">
  99. <image class="w-full h-full rd-8rpx relative z-2" :src="site_logo"></image>
  100. </view>
  101. <view class="store-spot"></view>
  102. </view>
  103. </view>
  104. </view>
  105. </block>
  106. <block v-else>
  107. <view>暂无门店信息</view>
  108. </block>
  109. </view>
  110. <view class='line'>
  111. <image src='/static/images/line.jpg'></image>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="address flex-1 ml-20 mr-20 rd-16rpx mt-20 p-32 border-top" v-if="deliveryType == 2 && !tableId">
  117. <view class="flex">
  118. <view class="flex-1">
  119. <view class="fs-24 text--w111-999 lh-34rpx">我的姓名</view>
  120. <view class="flex-y-center mt-6">
  121. <input type="text" v-model="contacts" :focus="contactsFocus" class="w-78 h-36 fs-26 fw-500 lh-36rpx" />
  122. <text class="iconfont icon-ic_edit fs-28 text--w111-999 pl-16" @tap="clearInput(0)"></text>
  123. </view>
  124. </view>
  125. <view class="pl-46 flex-1">
  126. <view class="fs-24 text--w111-999 lh-34rpx">我的电话</view>
  127. <view class="flex-y-center mt-6">
  128. <input type="number" v-model="contactsTel" :focus="telFocus" class="w-222 h-36 fs-30 fw-500 lh-30rpx SemiBold" />
  129. <text class="iconfont icon-ic_edit fs-28 text--w111-999 pl-16" @tap="clearInput(1)"></text>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. <view class='address add1 flex-between-center ml-20 mr-20 rd-16rpx mt-20'
  135. @tap='onAddress(addressInfo.real_name)' v-if='deliveryType == 3 && !tableId'>
  136. <view v-if="addressInfo.real_name">
  137. <view class="fs-30 text--w111-333 fw-500 acea-row row-middle">
  138. <text>{{addressInfo.real_name}}</text> <text class='pl-20'>{{addressInfo.phone}}</text>
  139. <text class='default font-num acea-row row-center-wrapper ml-8' v-if="addressInfo.is_default">默认</text>
  140. </view>
  141. <view class="fs-24 text--w111-666 mt-12">{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street}}{{addressInfo.detail}}</view>
  142. </view>
  143. <view class='fs-30 text--w111-333 fw-500 lh-42rpx flex-y-center' v-else>
  144. <image src="../static/location_order_icon.png" class="w-32 h-32"></image>
  145. <text class="pl-8">设置收货地址</text>
  146. </view>
  147. <text class="iconfont icon-ic_rightarrow fs-32 text--w111-666 ml-20"></text>
  148. </view>
  149. <view class='order-submission'>
  150. <view class="px-20 mt-20">
  151. <groupGoodsList :goodsList="goodsList" v-if="collage_id"></groupGoodsList>
  152. <view class="bg--w111-fff rd-16rpx pt-32 pr-24 pl-24 pb-32" v-else>
  153. <view class="flex order_goods" v-for="(item,index) in cartInfo" :key="index">
  154. <view class="w-176 h-176 relative">
  155. <image class="w-176 h-176 rd-16rpx" :src='item.productInfo.attrInfo.image' v-if="item.productInfo.attrInfo"></image>
  156. <image class="w-176 h-176 rd-16rpx" :src='item.productInfo.image' v-else></image>
  157. <view class="over flex-center fs-24 text--w111-fff" v-if="!item.is_valid">{{shippingType == 1 ? '非自提' : '不送达'}}</view>
  158. </view>
  159. <view class="flex-1 flex-col justify-between pl-20">
  160. <view @click="goDetail(item.product_id)">
  161. <view class="w-464 line1 fs-28 lh-40rpx"
  162. :class="item.is_valid ? 'text--w111-333' : 'text--w111-ccc'"
  163. >{{item.productInfo.store_name}}</view>
  164. <view class='w-322 fs-22 lh-30rpx line1 mt-12'
  165. :class="item.is_valid ? 'text--w111-999' : 'text--w111-ccc'"
  166. v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>
  167. <view class="flex items-end flex-wrap mt-12 w-full">
  168. <BaseTag
  169. :text="label.label_name"
  170. :color="label.color"
  171. :background="label.bg_color"
  172. :borderColor="label.border_color"
  173. :circle="label.border_color ? true : false"
  174. :imgSrc="label.icon"
  175. v-for="(label, idx) in item.productInfo.store_label" :key="idx"></BaseTag>
  176. </view>
  177. </view>
  178. <view class="flex-between-center">
  179. <baseMoney :money="item.productInfo.attrInfo ? item.productInfo.attrInfo.price : item.productInfo.price" symbolSize="20" integerSize="36" decimalSize="20" :color="item.is_valid ? '#333' : '#cccccc' " weight></baseMoney>
  180. <view class="flex-y-center" v-if="[0,6].includes(goodsType) && item.is_valid">
  181. <text class="iconfont icon-ic_Reduce fs-24" :class="item.cart_num > 1 ? 'text--w111-333' : 'text--w111-999'" @click.stop="addCart(0,item)"></text>
  182. <input type="number" maxlength="3" class="w-72 h-36 rd-4rpx bg--w111-f5f5f5 flex-center text-center fs-24 text--w111-333 mx-6" @input="setValue($event,item)" v-model="item.cart_num" />
  183. <text class="iconfont icon-ic_increase fs-24 text--w111-333" @click.stop="addCart(1,item)"></text>
  184. </view>
  185. <view v-if="![0,6].includes(goodsType)">
  186. <text class="fs-28 text--w111-666">️x{{item.cart_num}}</text>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. <view class="cell flex justify-between mt-32" v-if="giftCount > 0">
  192. <text class="text--w111-333 fs-28">赠品</text>
  193. <view class="w-460 flex-y-center justify-end" @tap="showGiftDrawer = true">
  194. <view class="flex">
  195. <view class="w-64 h-64 mr-8" v-for="(item, index) in giveCartInfo" :key="index">
  196. <image class="h-full w-full rd-8rpx" :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo"></image>
  197. <image class="h-full w-full rd-8rpx" :src="item.productInfo.image" v-else></image>
  198. </view>
  199. <view class="w-64 h-64 rd-8rpx bg--w111-f5f5f5 flex-center mr-8" v-if="giveData.give_coupon.length">
  200. <text class="gold iconfont icon-a-ic_discount1"></text>
  201. </view>
  202. <view class="w-64 h-64 rd-8rpx bg--w111-f5f5f5 flex-center mr-8" v-if="giveData.give_integral>0">
  203. <text class="gold iconfont icon-ic_badge11"></text>
  204. </view>
  205. </view>
  206. <view class="fs-26 text--w111-666">共{{giftCount}}件 <text class="iconfont icon-ic_rightarrow"></text> </view>
  207. </view>
  208. </view>
  209. <view class="cell flex justify-between flex-y-center mt-32" v-if="textareaStatus">
  210. <text class="text--w111-333 fs-28">留言</text>
  211. <textarea class="w-450 fs-28 text-right h-auto" :auto-height="true" wrap-style="wrap" max-height="100px" placeholder-class='placeholder' placeholder="请先与商家沟通一致再留言哦~" :always-embed="true" :adjust-position="true" cursor-spacing="30" v-if="!coupon.coupon"
  212. @input='bindHideKeyboard' :value="mark" :maxlength="150" name="mark">
  213. </textarea>
  214. </view>
  215. </view>
  216. <view class="mt-20 bg--w111-fff rd-16rpx pt-32 pr-24 pl-24 pb-32">
  217. <view class="cell flex-between-center"
  218. v-if="[0, 6, 10].includes(type) && !noCoupon && goodsType != 7 && priceGroup.firstOrderPrice==0"
  219. @tap='couponTap'>
  220. <text class="text--w111-333 fs-28">优惠券</text>
  221. <view>
  222. <text class="text--w111-333 fs-28">{{couponTitle}}</text>
  223. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-999 pl-8"></text>
  224. </view>
  225. </view>
  226. <view class="cell flex-between-center"
  227. v-if="[0, 6, 10].includes(type) && integral_ratio_status == 1">
  228. <text class="text--w111-333 fs-28">积分抵扣</text>
  229. <view class="flex-y-center">
  230. <view> {{useIntegral ? "剩余积分":"当前积分"}}
  231. <text class='Regular font-num fs-36 pl-8 pr-12'>{{integral || 0}}</text>
  232. </view>
  233. <checkbox-group @change="ChangeIntegral">
  234. <checkbox :disabled="integral<=0 && !useIntegral" :checked='useIntegral ? true : false' />
  235. </checkbox-group>
  236. </view>
  237. </view>
  238. <view class="cell flex-between-center"
  239. v-if="(invoice_func || special_invoice) && !tableId" @tap='goInvoice'>
  240. <text class="text--w111-333 fs-28">开具发票</text>
  241. <view>
  242. <text class="text--w111-333 fs-28">{{invTitle}}</text>
  243. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-999 pl-8"></text>
  244. </view>
  245. </view>
  246. </view>
  247. <view class="mt-20 bg--w111-fff rd-16rpx pt-32 pr-24 pl-24 pb-32" v-if="type == 4">
  248. <view class="cell flex-between-center">
  249. <text class="text--w111-333 fs-28">可用积分</text>
  250. <text>{{userInfo.integral}}</text>
  251. </view>
  252. <view class="cell flex-between-center">
  253. <text class="text--w111-333 fs-28">抵扣积分</text>
  254. <text>{{totalIntegral}}</text>
  255. </view>
  256. </view>
  257. <view class="mt-20 bg--w111-fff rd-16rpx pt-32 pr-24 pl-24 pb-32" v-if="confirm.length">
  258. <view class="cell flex justify-between" v-for="(item,index) in confirm" :key="index">
  259. <text class="relative text--w111-333 fs-28" :class="item.titleShow.val ? 'pl-16' : ''">
  260. <text class="asterisk" v-if="item.titleShow.val">*</text>
  261. {{ item.titleConfig.value }}
  262. </text>
  263. <!-- radio -->
  264. <view v-if="item.name=='radios'" class="discount">
  265. <radio-group @change="radioChange(e, index, item)" class="acea-row row-middle row-right">
  266. <label class="radio" v-for="(j,jindex) in item.wordsConfig.list" :key="jindex">
  267. <view class="acea-row row-middle">
  268. <!-- #ifndef MP -->
  269. <radio :value="jindex.toString()" :checked='j.show'/>
  270. <!-- #endif -->
  271. <!-- #ifdef MP -->
  272. <radio :value="jindex" :checked='j.show'/>
  273. <!-- #endif -->
  274. <view>{{j.val}}</view>
  275. </view>
  276. </label>
  277. </radio-group>
  278. </view>
  279. <!-- checkbox -->
  280. <view v-if="item.name=='checkboxs'" class="discount">
  281. <checkbox-group @change="checkboxChange($event, index, item)" class="acea-row row-middle row-right">
  282. <label class="radio" v-for="(j,jindex) in item.wordsConfig.list" :key="jindex">
  283. <view class="acea-row row-middle">
  284. <!-- #ifndef MP -->
  285. <checkbox :value="jindex.toString()" :checked="j.show" style="transform:scale(0.9)" />
  286. <!-- #endif -->
  287. <!-- #ifdef MP -->
  288. <checkbox :value="jindex" :checked="j.show" style="transform:scale(0.9)" />
  289. <!-- #endif -->
  290. <view>{{j.val}}</view>
  291. </view>
  292. </label>
  293. </checkbox-group>
  294. </view>
  295. <!-- text -->
  296. <view v-if="item.name=='texts' && item.valConfig.tabVal == 0" class="discount">
  297. <input type="text" :placeholder="item.tipConfig.value" placeholder-class="placeholder" v-model="item.value" />
  298. </view>
  299. <!-- number -->
  300. <view v-if="item.name=='texts' && item.valConfig.tabVal == 4" class="discount">
  301. <input type="number" :placeholder="item.tipConfig.value" placeholder-class="placeholder" v-model="item.value" />
  302. </view>
  303. <!-- email -->
  304. <view v-if="item.name=='texts' && item.valConfig.tabVal == 3" class="discount">
  305. <input type="text" :placeholder="item.tipConfig.value" placeholder-class="placeholder" v-model="item.value" />
  306. </view>
  307. <!-- data -->
  308. <view v-if="item.name=='dates'" class="discount">
  309. <picker mode="date" :value="item.value" @change="bindDateChange($event,index)">
  310. <view class="acea-row row-between-wrapper">
  311. <view v-if="item.value == ''">{{item.tipConfig.value}}</view>
  312. <view v-else>{{item.value}}</view>
  313. <text class='iconfont icon-jiantou'></text>
  314. </view>
  315. </picker>
  316. </view>
  317. <!-- dateranges -->
  318. <view v-if="item.name=='dateranges'" class="discount">
  319. <uni-datetime-picker v-model="item.value" type="daterange" @maskClick="maskClick">
  320. {{item.value.length?item.value[0]+' - '+item.value[1]:item.tipConfig.value}}
  321. <text class='iconfont icon-jiantou'></text>
  322. </uni-datetime-picker>
  323. </view>
  324. <!-- time -->
  325. <view v-if="item.name=='times'" class="discount">
  326. <picker mode="time" :value="item.value" @change="bindTimeChange($event,index)"
  327. :placeholder="item.tipConfig.value">
  328. <view class="acea-row row-between-wrapper">
  329. <view v-if="item.value == ''">{{item.tipConfig.value}}</view>
  330. <view v-else>{{item.value}}</view>
  331. <text class='iconfont icon-jiantou'></text>
  332. </view>
  333. </picker>
  334. </view>
  335. <!-- timeranges -->
  336. <view v-if="item.name=='timeranges'" class="discount acea-row row-between-wrapper" @click="getTimeranges(index)">
  337. <view v-if="item.value">{{item.value}}</view>
  338. <view v-else>{{item.tipConfig.value}}</view>
  339. <text class='iconfont icon-jiantou'></text>
  340. </view>
  341. <!-- select -->
  342. <view v-if="item.name=='selects'" class="discount">
  343. <picker :value="item.value" :range="item.wordsConfig.list" @change="bindSelectChange($event,index,item)" range-key="val">
  344. <view class="acea-row row-between-wrapper">
  345. <view v-if="item.value == ''">请选择</view>
  346. <view v-else>{{item.value}}</view>
  347. <text class='iconfont icon-jiantou'></text>
  348. </view>
  349. </picker>
  350. </view>
  351. <!-- city -->
  352. <view v-if="item.name=='citys'" class="discount" @click="changeRegion(index)">
  353. <view class="acea-row row-middle row-right">
  354. <view class="city" v-if="item.value == ''">{{item.tipConfig.value}}</view>
  355. <view class="city" v-else>{{item.value}}</view>
  356. <text class='iconfont icon-jiantou'></text>
  357. </view>
  358. </view>
  359. <!-- id -->
  360. <view v-if="item.name=='texts' && item.valConfig.tabVal == 2" class="discount">
  361. <input type="idcard" :placeholder="item.tipConfig.value" placeholder-class="placeholder" v-model="item.value" />
  362. </view>
  363. <!-- phone -->
  364. <view v-if="item.name=='texts' && item.valConfig.tabVal == 1" class="discount">
  365. <input type="number" :placeholder="item.tipConfig.value" placeholder-class="placeholder" v-model="item.value" />
  366. </view>
  367. <!-- img -->
  368. <view v-if="item.name=='uploadPicture'" class="flex-1">
  369. <view class="flex justify-end" v-if="item.value.length < 3">
  370. <view class="relative" v-for="(items,indexs) in item.value" :key="indexs">
  371. <image class="w-128 h-128 rd-12rpx ml-16" :src="items"></image>
  372. <view class="abs-rt w-32 h-32 bg--w111-bbb clear-btn flex-center fs-24 text--w111-fff" @click="DelPic(index,indexs)">
  373. <text class="iconfont icon-ic_close"></text>
  374. </view>
  375. </view>
  376. <view class="w-128 h-128 rd-12rpx bg--w111-f5f5f5 flex-col flex-center ml-16"
  377. v-if="item.value.length < item.numConfig.val" @tap="uploadpic(index)">
  378. <text class='iconfont icon-ic_camera fs-40'></text>
  379. <view class="fs-20 text--w111-333">上传图片</view>
  380. </view>
  381. </view>
  382. <view class="flex justify-end" v-else>
  383. <scroll-view scroll-x="true" scroll-with-animation
  384. class="white-nowrap vertical-middle w-508" show-scrollbar="false">
  385. <view class="w-full h-full flex">
  386. <view class="inline-block h-128 mr-12">
  387. <view class="w-128 h-128 rd-12rpx bg--w111-f5f5f5 ml-16 flex-col flex-center"
  388. v-if="item.value.length < item.numConfig.val" @tap="uploadpic(index)">
  389. <text class='iconfont icon-ic_camera fs-40'></text>
  390. <view class="fs-20 text--w111-333">上传图片</view>
  391. </view>
  392. </view>
  393. <view class="inline-block mr-12 relative" v-for="(items,indexs) in item.value" :key="index">
  394. <image class="w-128 h-128 rd-12rpx" :src="items"></image>
  395. <view class="abs-rt w-32 h-32 bg--w111-bbb rd-rt-12rpx flex-center fs-24 text--w111-fff" @click="DelPic(index,indexs)">
  396. <text class="iconfont icon-ic_close"></text>
  397. </view>
  398. </view>
  399. </view>
  400. </scroll-view>
  401. </view>
  402. </view>
  403. </view>
  404. </view>
  405. <view class="mt-20 bg--w111-fff rd-16rpx pt-32 pr-24 pl-24 pb-32">
  406. <view class="cell flex-between-center">
  407. <text class="text--w111-333 fs-28">商品总价</text>
  408. <text class="text--w111-333 fs-36 Regular">¥{{priceGroup.sumPrice}}</text>
  409. </view>
  410. <view class="cell flex-between-center" v-if="priceGroup.firstOrderPrice>0">
  411. <text class="text--w111-333 fs-28">新人首单优惠</text>
  412. <text class="text--w111-333 fs-36 Regular font-num"> -¥{{priceGroup.firstOrderPrice}}</text>
  413. </view>
  414. <view class="cell flex-between-center" v-if="priceGroup.storePostage > 0">
  415. <text class="text--w111-333 fs-28">配送运费</text>
  416. <text class="text--w111-333 fs-36 Regular font-num">¥{{(parseFloat(priceGroup.storePostage)+parseFloat(priceGroup.storePostageDiscount)).toFixed(2)}}</text>
  417. </view>
  418. <view class="cell flex-between-center"
  419. v-if="priceGroup.vipPrice > 0 && userInfo.vip && [0, 6, 9].includes(type)">
  420. <text class="text--w111-333 fs-28">用户等级优惠</text>
  421. <text class="text--w111-333 fs-36 Regular font-num">-¥{{parseFloat(priceGroup.vipPrice).toFixed(2)}}</text>
  422. </view>
  423. <view class="cell flex-between-center" v-if="priceGroup.storePostageDiscount > 0">
  424. <text class="text--w111-333 fs-28">会员运费优惠</text>
  425. <text class="text--w111-333 fs-36 Regular font-num">-¥{{parseFloat(priceGroup.storePostageDiscount).toFixed(2)}}</text>
  426. </view>
  427. <view class="cell flex-between-center" v-if="coupon_price > 0">
  428. <text class="text--w111-333 fs-28">优惠券抵扣</text>
  429. <text class="text--w111-333 fs-36 Regular font-num">-¥{{parseFloat(coupon_price).toFixed(2)}}</text>
  430. </view>
  431. <view class="cell flex-between-center" v-if="integral_price > 0">
  432. <text class="text--w111-333 fs-28">积分抵扣</text>
  433. <text class="text--w111-333 fs-36 Regular font-num">-¥{{parseFloat(integral_price).toFixed(2)}}</text>
  434. </view>
  435. <view class="cell flex-between-center" v-for="(item,index) in promotions_detail" :key="index" v-show="parseFloat(item.promotions_price)">
  436. <text class="text--w111-333 fs-28">{{item.title}}</text>
  437. <text class="text--w111-333 fs-36 Regular font-num">-¥{{parseFloat(item.promotions_price).toFixed(2)}}</text>
  438. </view>
  439. </view>
  440. </view>
  441. <view class="height-add"></view>
  442. <view class='fixed-lb w-full bg--w111-fff pb-safe'>
  443. <view class="h-80 bg--w111-FFF0D1 flex-between-center px-20" v-if="!svip_status && svip_price > 0">
  444. <view class="flex-y-center">
  445. <image src="@/static/img/vip_leval.png" class="w-36 h-36"></image>
  446. <view class="pl-8">
  447. <text class="fs-24 text--w111-7E4B06">开通 SVIP会员 预计省</text>
  448. <text class="font-color fs-28">¥{{svip_price}}</text>
  449. <text class="fs-24 text--w111-7E4B06">元</text>
  450. </view>
  451. </view>
  452. <view class="fs-24 text--w111-7E4B06" @click="goPage(1,'/pages/annex/vip_paid/index')">
  453. <text>立即开通</text>
  454. <text class="iconfont icon-ic_rightarrow fs-24"></text>
  455. </view>
  456. </view>
  457. <view class="pl-32 pr-20 h-96 flex-between-center">
  458. <view class="flex items-baseline">
  459. <text class="fs-24 fw-500 text--w111-333">合计</text>
  460. <baseMoney :money="totalPrice || 0" symbolSize="26" integerSize="44" decimalSize="26" weight></baseMoney>
  461. <text class="pl-12" v-if="type == 4 && totalIntegral > 0">+{{totalIntegral}}积分</text>
  462. </view>
  463. <view class="w-168 h-72 rd-36rpx flex-center text--w111-fff fs-26 bg-gradient z-10"
  464. @tap.stop="goPay" v-if="(((valid_count>0&&!discount_id) || (valid_count==cartInfo.length&&discount_id)) && shippingType) || (!shippingType && addressId) || product_type != 0">提交订单</view>
  465. <view class="w-168 h-72 rd-36rpx flex-center text--w111-fff fs-26 bg-color-hui" v-else>提交订单</view>
  466. </view>
  467. </view>
  468. </view>
  469. <view class="alipaysubmit" v-html="formContent"></view>
  470. <tuiModal
  471. :show="isAddress"
  472. title="更新地址"
  473. content="当前地址功能已更新,请重新修改"
  474. @click="handleClick"
  475. @cancel="hideModal"></tuiModal>
  476. <!-- 赠品抽屉 -->
  477. <giftDrawer :visible="showGiftDrawer" :giveCartInfo="giveCartInfo" :giveData="giveData" @closeDrawer="closeDrawer"></giftDrawer>
  478. <couponListWindow
  479. :coupon='coupon'
  480. @ChangCouponsClone="ChangCouponsClone"
  481. :openType='openType'
  482. :cartId='cartId'
  483. @ChangCoupons="ChangCoupons"
  484. @ruleToggle="ruleToggle"></couponListWindow>
  485. <addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :news='news' :address='address'
  486. :pagesUrl="pagesUrl" @OnChangeAddress="OnChangeAddress" @changeClose="changeClose"></addressWindow>
  487. <invoice-picker :inv-show="invShow" :inv-list="invList" :inv-checked="invChecked" :is-special="special_invoice"
  488. :url-query="urlQuery" @inv-close="invClose" @inv-change="invChange" @inv-cancel="invCancel">
  489. </invoice-picker>
  490. <timeranges :isShow='isShow' :time='timeranges' @confrim="confrim" @cancel="cancels"></timeranges>
  491. <areaWindow ref="areaWindow" :display="display" :address='addressInfoArea' :cityShow='cityShow' @submit="OnAreaAddress" @changeClose="changeAddressClose"></areaWindow>
  492. </view>
  493. </template>
  494. <script>
  495. const CACHE_CITY = {};
  496. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  497. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  498. import {
  499. orderConfirm,
  500. getCouponsOrderPrice,
  501. orderCreate,
  502. postOrderComputed,
  503. checkShipping
  504. } from '@/api/order.js';
  505. import {
  506. getAddressDefault,
  507. getAddressDetail,
  508. invoiceList,
  509. invoiceOrder
  510. } from '@/api/user.js';
  511. import { openPaySubscribe } from '@/utils/SubscribeMessage.js';
  512. import {
  513. storeListApi,
  514. postCartAdd,
  515. getCodeData,
  516. getCollagePartake,
  517. } from '@/api/store.js';
  518. import {
  519. CACHE_LONGITUDE,
  520. CACHE_LATITUDE
  521. } from '@/config/cache.js';
  522. import couponListWindow from '@/components/couponListWindow';
  523. import addressWindow from '@/components/addressWindow';
  524. import invoicePicker from '../components/invoicePicker';
  525. import timeranges from '@/components/timeranges';
  526. import areaWindow from '@/components/areaWindow';
  527. import giftDrawer from '../components/giftDrawer/index.vue'
  528. import tuiModal from "@/components/tui-modal/index.vue"
  529. import groupGoodsList from "@/components/groupGoodsList/index.vue"
  530. import { toLogin } from '@/libs/login.js';
  531. import { mapGetters } from "vuex";
  532. import colors from "@/mixins/color";
  533. import { HTTP_REQUEST_URL } from '@/config/app';
  534. import { Debounce } from '@/utils/validate.js'
  535. export default {
  536. components: {
  537. invoicePicker,
  538. couponListWindow,
  539. addressWindow,
  540. timeranges,
  541. areaWindow,
  542. giftDrawer,
  543. tuiModal,
  544. groupGoodsList
  545. },
  546. mixins: [colors],
  547. data() {
  548. return {
  549. imgHost: HTTP_REQUEST_URL,
  550. sysHeight:sysHeight,
  551. addressInfoArea: [],
  552. cityShow: 2,
  553. display: false,
  554. timeranges:[],
  555. isShow:false,
  556. giveData:{
  557. give_integral:0,
  558. give_coupon:[]
  559. },
  560. giveCartInfo: [],
  561. confirm: [], //自定义留言
  562. id: 0,
  563. isAddress: false,
  564. textareaStatus: true,
  565. formContent: '',
  566. payType: 'weixin', //支付方式
  567. openType: 1, //优惠券打开方式 1=使用
  568. active: 0, //支付方式切换
  569. coupon: {
  570. coupon: false,
  571. list: [],
  572. statusTile: '立即使用'
  573. }, //优惠券组件
  574. address: {
  575. address: false
  576. }, //地址组件
  577. addressInfo: {}, //地址信息
  578. pinkId: 0, //拼团id
  579. addressId: 0, //地址id
  580. couponId: 0, //优惠券id
  581. cartId: '', //购物车id
  582. type: 0,//活动类型
  583. activityId: 0,//活动ID
  584. BargainId: 0,
  585. combinationId: 0,
  586. seckillId: 0,
  587. discountId: 0,
  588. userInfo: {}, //用户信息
  589. mark: '', //备注信息
  590. couponTitle: '请选择', //优惠券
  591. coupon_price: 0, //优惠券抵扣金额
  592. promotions_detail:[], //优惠活动金额明细
  593. useIntegral: false, //是否使用积分
  594. integral_price: 0, //积分抵扣金额
  595. integral: 0,
  596. ChangePrice: 0, //使用积分抵扣变动后的金额
  597. formIds: [], //收集formid
  598. status: 0,
  599. is_address: false,
  600. shippingType: 0,
  601. system_store: {},
  602. storePostage: 0,
  603. contacts: '',
  604. contactsTel: '',
  605. mydata: {},
  606. storeList: [],
  607. store_self_mention: 0,
  608. cartInfo: [],
  609. priceGroup: {},
  610. animated: false,
  611. totalPrice: 0,
  612. totalIntegral:0,
  613. integralRatio: "0",
  614. pagesUrl: "",
  615. orderKey: "",
  616. // usableCoupon: {},
  617. offlinePostage: "",
  618. isAuto: false, //没有授权的不会自动授权
  619. isShowAuth: false, //是否隐藏授权
  620. from: '',
  621. news: 1,
  622. invTitle: '不开发票',
  623. special_invoice: false,
  624. invoice_func: false,
  625. integral_ratio_status : 1,
  626. header_type: '',
  627. invShow: false,
  628. invList: [],
  629. invChecked: '',
  630. urlQuery: '',
  631. pay_close: false,
  632. noCoupon: 0,
  633. valid_count: 0,
  634. discount_id: 0,
  635. storeId: 0,
  636. product_type:1,
  637. newImg: [],
  638. isDisplay: 0,
  639. goodsType:0,
  640. timerangesIndex:0,
  641. isFocus:false,
  642. latitude:'',
  643. longitude:'',
  644. site_logo:'',
  645. range:'',
  646. showGiftDrawer:false,
  647. svip_status: false,
  648. svip_price: 0,
  649. contactsFocus: false,
  650. telFocus: false,
  651. deliveryType:1,
  652. product_id:0,
  653. collage_id:0,
  654. tableId:0,
  655. codeData:{},
  656. goodsList:[],
  657. isStore: 0
  658. };
  659. },
  660. computed: {
  661. ...mapGetters(['isLogin']),
  662. giftCount(){
  663. let count = 0;
  664. if(this.giveCartInfo.length){
  665. count = this.giveCartInfo.length
  666. }
  667. if(this.giveData.give_coupon.length){
  668. count = count + this.giveData.give_coupon.length
  669. }
  670. if(this.giveData.give_integral > 0){
  671. count = count + 1
  672. }
  673. return count
  674. },
  675. styleType(){
  676. let obj = this.isDisplay.includes('2') && this.isDisplay.length == 2 && this.deliveryType != 2?(this.isDisplay.includes('1')?'bg-horn-r':'bg-horn'):'';
  677. return obj
  678. }
  679. },
  680. onLoad: function(options) {
  681. // this.getLocation();
  682. // #ifdef H5
  683. this.from = this.$wechat.isWeixin() ? 'weixin' : 'weixinh5'
  684. // #endif
  685. // #ifdef MP
  686. this.from = 'routine'
  687. // 桌码
  688. this.tableId = options.tableId || 0;
  689. if (this.tableId) {
  690. this.getCodeData();
  691. }
  692. // #endif
  693. if (!options.cartId) return this.$util.Tips({
  694. title: '请选择要购买的商品'
  695. }, {
  696. tab: 3,
  697. url: 1
  698. });
  699. this.deliveryType = options.delivery_type || 1;
  700. this.isStore = options.is_store ? parseInt(options.is_store) : 0;
  701. this.storeId = parseInt(options.store_id) || 0;
  702. if(this.deliveryType == 1 || this.deliveryType == 3){
  703. this.addressId = options.addressId || 0;
  704. this.system_store.name = options.store_name;
  705. }
  706. if(this.deliveryType == 2 || this.deliveryType == 3){
  707. this.storeId = parseInt(options.store_id) || 0;
  708. this.system_store.id = parseInt(options.store_id) || 0;
  709. }
  710. this.couponId = options.couponId || 0;
  711. this.noCoupon = parseInt(options.noCoupon) || 0;
  712. this.product_id = options.product_id || 0;
  713. this.pinkId = options.pinkId ? parseInt(options.pinkId) : 0;
  714. this.addressId = options.addressId || 0;
  715. this.cartId = options.cartId;
  716. this.is_address = options.is_address ? true : false;
  717. this.news = !options.new || options.new === '0' ? 0 : 1;
  718. uni.setStorageSync('news', this.news);
  719. this.invChecked = options.invoice_id || '';
  720. this.header_type = options.header_type || '1';
  721. this.couponTitle = options.couponTitle || '请选择'
  722. this.luckRecordId = options.luckRecordId || ''
  723. switch (options.invoice_type) {
  724. case '1':
  725. this.invTitle = '增值税电子普通发票';
  726. break;
  727. case '2':
  728. this.invTitle = '增值税电子专用发票';
  729. break;
  730. }
  731. if(options.invoice_name){
  732. this.invTitle = options.invoice_name;
  733. }
  734. // #ifndef APP-PLUS
  735. this.textareaStatus = true;
  736. // #endif
  737. if (this.isLogin) {
  738. this.getCheckShipping();
  739. } else {
  740. toLogin();
  741. }
  742. // #ifdef H5 || MP
  743. // 拼单
  744. this.collage_id = options.collage_id || 0;
  745. if (this.collage_id) {
  746. this.getCollagePartake();
  747. }
  748. // #endif
  749. },
  750. /**
  751. * 生命周期函数--监听页面显示
  752. */
  753. onShow: function() {
  754. let _this = this
  755. uni.$on("activeFn", res => {
  756. if (res) {
  757. _this.system_store = res
  758. _this.storeId = _this.system_store.id
  759. _this.range = _this.system_store.range
  760. _this.site_logo = _this.system_store.image
  761. // _this.cartId = res.cartId
  762. // _this.news = res.new
  763. // _this.pinkId = Number(res.pinkId)
  764. // _this.couponId = res.couponId
  765. _this.getConfirm()
  766. }
  767. // 清除监听
  768. uni.$off('activeFn');
  769. })
  770. let current = (dayjs(new Date(Number(new Date().getTime()))).format('HH:mm')).split(':');
  771. let currentArray = current;
  772. currentArray.push(0);
  773. let arrayNew = [];
  774. [...currentArray,...current].forEach(item=>{
  775. arrayNew.push(Number(item))
  776. })
  777. this.timeranges = arrayNew;
  778. },
  779. methods: {
  780. goStore(){
  781. if (!this.collage_id && !this.isStore) {
  782. uni.navigateTo({
  783. url:'/pages/store/list/index?type=1&isCollage=1&storeId='+this.system_store.id
  784. })
  785. }
  786. },
  787. // 是否显示快递配送
  788. getCheckShipping(){
  789. let data = {
  790. cartId: this.cartId,
  791. new: this.news
  792. }
  793. checkShipping(data).then(res=>{
  794. // 1:快递配送,2:到店自提,3:门店配送
  795. res.data.type.sort((x,y)=>x - y)//正序
  796. let isDisplay = res.data.type;
  797. if(this.luckRecordId>0){
  798. this.deliveryType = isDisplay[0];
  799. }
  800. if (this.collage_id) {
  801. isDisplay = [this.deliveryType];
  802. }
  803. this.isDisplay = isDisplay;
  804. if (!this.isDisplay.includes(this.deliveryType)) {
  805. this.deliveryType = this.isDisplay[0] || '1';
  806. }
  807. if (this.deliveryType == '2') {
  808. this.shippingType = 1;
  809. } else{
  810. this.shippingType = 0;
  811. }
  812. if(isDisplay.indexOf('2') != -1 || isDisplay.indexOf('3') != -1){
  813. this.getConfirm('',1);
  814. }
  815. if(isDisplay.indexOf('1') !=-1 || isDisplay.indexOf('3') !=-1){
  816. this.getaddressInfo();
  817. if(isDisplay.indexOf('1') !=-1 && isDisplay.length == 1){
  818. this.getConfirm();
  819. }
  820. this.$nextTick(function() {
  821. this.$refs.addressWindow.getAddressList();
  822. })
  823. }
  824. }).catch(err=>{
  825. uni.showToast({
  826. title: err,
  827. icon: 'none'
  828. });
  829. })
  830. },
  831. OnAreaAddress(address){
  832. let addr = '';
  833. if (address.length==4){
  834. addr = address[0].label+'/'+address[1].label+'/'+address[2].label+'/'+address[3].label;
  835. }else if (address.length==3){
  836. addr = address[0].label+'/'+address[1].label+'/'+address[2].label;
  837. }else if(address.length==2){
  838. addr = address[0].label+'/'+address[1].label;
  839. }else{
  840. addr = address[0].label;
  841. }
  842. this.confirm[this.timerangesIndex].value = addr;
  843. CACHE_CITY[this.timerangesIndex] = address;
  844. },
  845. changeRegion(index){
  846. if(!this.confirm[index].value){
  847. this.addressInfoArea = [];
  848. }
  849. this.timerangesIndex = index;
  850. this.cityShow = Number(this.confirm[index].valConfig.tabVal) + 1;
  851. this.display = true;
  852. if(CACHE_CITY[index]){
  853. this.addressInfoArea = CACHE_CITY[index];
  854. }
  855. },
  856. // 关闭地址弹窗;
  857. changeAddressClose: function() {
  858. this.display = false;
  859. },
  860. maskClick(e) {
  861. console.log(e);
  862. },
  863. // 授权关闭
  864. authColse: function(e) {
  865. this.isShowAuth = e
  866. },
  867. /**
  868. * 删除图片
  869. *
  870. */
  871. DelPic: function(index, indexs) {
  872. let that = this,
  873. pic = this.confirm[index].value;
  874. that.confirm[index].value.splice(indexs, 1);
  875. that.$set(that.confirm[index], 'value', that.confirm[index].value);
  876. },
  877. /**
  878. * 上传文件
  879. *
  880. */
  881. uploadpic: function(index) {
  882. let that = this;
  883. this.$util.uploadImageOne('upload/image', function(res) {
  884. that.newImg.push(res.data.url);
  885. that.$set(that.confirm[index], 'value', that.newImg);
  886. });
  887. },
  888. // 不开发票
  889. invCancel() {
  890. this.invChecked = '';
  891. this.invTitle = '不开发票';
  892. this.invShow = false;
  893. },
  894. // 选择发票
  895. invChange(id) {
  896. this.invChecked = id;
  897. this.invShow = false;
  898. const result = this.invList.find(item => item.id === id);
  899. let name = '';
  900. name += result.header_type === 1 ? '个人' : '企业';
  901. name += result.type === 1 ? '普通' : '专用';
  902. name += '发票';
  903. this.invTitle = name;
  904. },
  905. // 关闭发票
  906. invClose() {
  907. this.invShow = false;
  908. this.getInvoiceList()
  909. },
  910. getInvoiceList() {
  911. uni.showLoading({
  912. title: '正在加载…'
  913. })
  914. invoiceList().then(res => {
  915. uni.hideLoading();
  916. this.invList = res.data.map(item => {
  917. item.id = item.id.toString();
  918. return item;
  919. });
  920. const result = this.invList.find(item => item.id == this.invChecked);
  921. if (result) {
  922. let name = '';
  923. name += result.header_type === 1 ? '个人' : '企业';
  924. name += result.type === 1 ? '普通' : '专用';
  925. name += '发票';
  926. this.invTitle = name;
  927. }
  928. }).catch(err => {
  929. uni.showToast({
  930. title: err,
  931. icon: 'none'
  932. });
  933. });
  934. },
  935. /**
  936. * 开发票
  937. */
  938. goInvoice: function() {
  939. this.getInvoiceList()
  940. this.invShow = true;
  941. this.urlQuery =
  942. `new=${this.news}&cartId=${this.cartId}&pinkId=${this.pinkId}&couponId=${this.couponId}&addressId=${this.addressId}&specialInvoice=${this.special_invoice}&couponTitle=${this.couponTitle}`;
  943. },
  944. goPay() {
  945. this.formVerify();
  946. },
  947. /**
  948. * 获取门店列表数据
  949. */
  950. getList: function() {
  951. let longitude = uni.getStorageSync("user_longitude"); //经度
  952. let latitude = uni.getStorageSync("user_latitude"); //纬度
  953. let data = {
  954. page: 1,
  955. limit: 100,
  956. latitude:latitude,
  957. longitude:longitude,
  958. is_store: this.deliveryType, //判断是否为到店自提
  959. product_id:this.product_id, //判断商品是否适用这个门店
  960. type: this.seckillId>0?1:0, //商品类型:1是秒杀(有自己单独的适用门店)0是普通
  961. }
  962. storeListApi(data).then(res => {
  963. let list = res.data.list.list || [];
  964. this.$set(this, 'storeList', list);
  965. this.$set(this, 'storeId', this.storeId !=0?this.storeId:list[0].id);
  966. list.forEach(item=>{
  967. if(this.storeId == item.id){
  968. this.$set(this, 'system_store', item);
  969. this.range = item.range;
  970. this.site_logo = item.image;
  971. }
  972. })
  973. }).catch(err => {})
  974. },
  975. // 关闭地址弹窗;
  976. changeClose: function() {
  977. this.$set(this.address, 'address', false);
  978. },
  979. computedPrice: function() {
  980. let shippingType = this.shippingType;
  981. postOrderComputed(this.orderKey, {
  982. addressId: this.addressId,
  983. useIntegral: this.useIntegral ? 1 : 0,
  984. couponId: this.priceGroup.couponPrice==0?0:this.couponId,
  985. shipping_type: parseInt(shippingType) + 1,
  986. payType: this.payType
  987. }).then(res => {
  988. let result = res.data.result;
  989. if (result) {
  990. this.totalPrice = result.pay_price;
  991. this.totalIntegral = result.pay_integral;
  992. this.integral_price = result.deduction_price;
  993. this.coupon_price = result.coupon_price;
  994. this.promotions_detail = result.promotions_detail;
  995. this.integral = this.useIntegral ? result.SurplusIntegral : this.userInfo.integral;
  996. this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
  997. this.$set(this.priceGroup, 'storePostageDiscount', result.storePostageDiscount);
  998. }
  999. }).catch(err=>{
  1000. return this.$util.Tips({
  1001. title: err
  1002. });
  1003. })
  1004. },
  1005. addressType: function(e,num) {
  1006. //e:0:商城和门店配送 1:门店自提
  1007. //num:配送方式
  1008. this.shippingType = parseInt(e);
  1009. this.deliveryType = num;
  1010. this.getConfirm();
  1011. },
  1012. bindPickerChange: function(e) {
  1013. let value = e.detail.value;
  1014. this.shippingType = value;
  1015. this.computedPrice();
  1016. },
  1017. ChangCouponsClone: function() {
  1018. this.$set(this.coupon, 'coupon', false);
  1019. },
  1020. changeTextareaStatus: function() {
  1021. for (let i = 0, len = this.coupon.list.length; i < len; i++) {
  1022. this.coupon.list[i].use_title = '';
  1023. this.coupon.list[i].is_use = 0;
  1024. }
  1025. this.textareaStatus = true;
  1026. this.status = 0;
  1027. this.$set(this.coupon, 'list', this.coupon.list);
  1028. },
  1029. /**
  1030. * 处理点击优惠券后的事件
  1031. *
  1032. */
  1033. ChangCoupons: function(index) {
  1034. let list = this.coupon.list;
  1035. if(list[index].is_use){
  1036. list[index].use_title = '';
  1037. list[index].is_use = 0;
  1038. this.couponTitle = '请选择';
  1039. this.couponId = 0;
  1040. }else{
  1041. list[index].use_title = '不使用';
  1042. list[index].is_use = 1;
  1043. this.couponTitle = list[index].title;
  1044. this.couponId = list[index].id;
  1045. }
  1046. this.$set(this.coupon, 'coupon', false);
  1047. this.$set(this.coupon, 'list', list);
  1048. this.getConfirm(1);
  1049. },
  1050. ruleToggle(index){
  1051. this.coupon.list[index].ruleshow = !this.coupon.list[index].ruleshow;
  1052. },
  1053. /**
  1054. * 使用积分抵扣
  1055. */
  1056. ChangeIntegral: function() {
  1057. this.useIntegral = !this.useIntegral;
  1058. this.computedPrice();
  1059. },
  1060. /**
  1061. * 选择地址后改变事件
  1062. * @param object e
  1063. */
  1064. OnChangeAddress: function(e) {
  1065. this.textareaStatus = true;
  1066. this.addressId = e;
  1067. this.address.address = false;
  1068. this.getConfirm();
  1069. this.getaddressInfo();
  1070. this.computedPrice();
  1071. },
  1072. bindHideKeyboard: function(e) {
  1073. this.mark = e.detail.value;
  1074. },
  1075. // 对象转数组
  1076. objToArr(data) {
  1077. let obj = Object.keys(data);
  1078. let m = obj.map(key => data[key]);
  1079. return m;
  1080. },
  1081. /**
  1082. * 获取当前订单详细信息
  1083. *
  1084. */
  1085. getConfirm: function(numType,num) {
  1086. let that = this;
  1087. let shippingType = parseInt(this.shippingType) + 1;
  1088. let addressId = 0,storeid;
  1089. if(this.deliveryType == 1){
  1090. addressId = that.addressId
  1091. storeid = 0
  1092. }else if(this.deliveryType == 2){
  1093. storeid = that.storeId
  1094. addressId = ''
  1095. }else{
  1096. storeid = that.storeId
  1097. addressId = that.addressId
  1098. }
  1099. orderConfirm(that.cartId, that.news, addressId, shippingType,storeid,that.couponId,that.luckRecordId).then(res => {
  1100. if(res.data.upgrade_addr == 1){
  1101. that.id = res.data.addressInfo.id
  1102. this.isAddress = true
  1103. }
  1104. if (numType != 1) {
  1105. let confirm = this.objToArr(res.data.custom_form);
  1106. confirm.forEach((item, index, arr)=>{
  1107. CACHE_CITY[index] = ''; //清空省市区
  1108. if(item.name == 'texts'){
  1109. if(item.defaultValConfig.value){
  1110. item.value = item.defaultValConfig.value
  1111. }else{
  1112. item.value = ''
  1113. }
  1114. }else if(item.name == 'radios'){
  1115. item.value = item.wordsConfig.list[0].val
  1116. }else if(item.name == 'uploadPicture'){
  1117. item.value = [];
  1118. }else if(item.name == 'dateranges'){
  1119. if(item.valConfig.tabVal==0){
  1120. if(item.valConfig.tabData==0){
  1121. let obj = dayjs(new Date(Number(new Date().getTime()))).format('YYYY-MM-DD');
  1122. item.value = [obj,obj]
  1123. }else{
  1124. let data1 = dayjs(new Date(Number(new Date(item.valConfig.specifyDate[0]).getTime()))).format('YYYY-MM-DD');
  1125. let data2 = dayjs(new Date(Number(new Date(item.valConfig.specifyDate[1]).getTime()))).format('YYYY-MM-DD');
  1126. item.value = [data1,data2];
  1127. }
  1128. }else{
  1129. item.value = [];
  1130. }
  1131. }else{
  1132. if(['times','dates','timeranges'].indexOf(item.name) != -1){
  1133. if(item.valConfig.tabVal==0){
  1134. if(item.valConfig.tabData==0){
  1135. if(item.name == 'times'){
  1136. item.value = dayjs(new Date(Number(new Date().getTime()))).format('HH:mm');
  1137. }else if(item.name == 'dates'){
  1138. item.value = dayjs(new Date(Number(new Date().getTime()))).format('YYYY-MM-DD');
  1139. }else{
  1140. let current = dayjs(new Date(Number(new Date().getTime()))).format('HH:mm');
  1141. item.value = current+' - '+current;
  1142. }
  1143. }else{
  1144. if(item.name == 'times' || item.name == 'dates'){
  1145. item.value = item.valConfig.specifyDate;
  1146. }else{
  1147. item.value = item.valConfig.specifyDate[0]+' - '+item.valConfig.specifyDate[1];
  1148. }
  1149. }
  1150. }else{
  1151. item.value = '';
  1152. }
  1153. }else{
  1154. item.value = '';
  1155. }
  1156. }
  1157. })
  1158. function sortNumber(a, b) {
  1159. return a.timestamp - b.timestamp;
  1160. }
  1161. confirm.sort(sortNumber);
  1162. that.$set(that, 'confirm', confirm);
  1163. }
  1164. that.$set(that, 'goodsType', res.data.type);
  1165. that.$set(that, 'userInfo', res.data.userInfo);
  1166. that.$set(that, 'integral', res.data.userInfo.integral);
  1167. that.$set(that, 'integralRatio', res.data.integralRatio);
  1168. that.$set(that, 'offlinePostage', res.data.offlinePostage);
  1169. that.$set(that, 'orderKey', res.data.orderKey);
  1170. that.$set(that, 'valid_count', res.data.valid_count);
  1171. that.$set(that, 'discount_id', res.data.discount_id)
  1172. that.$set(that, 'priceGroup', res.data.priceGroup);
  1173. that.$set(that, 'type', parseInt(res.data.type));
  1174. that.$set(that, 'activityId', parseInt(res.data.activityId));
  1175. that.$set(that, 'seckillId', parseInt(res.data.seckill_id));
  1176. that.$set(that, 'BargainId', parseInt(res.data.bargain_id));
  1177. that.$set(that, 'combinationId', parseInt(res.data.combination_id));
  1178. that.$set(that, 'discountId', parseInt(res.data.discount_id));
  1179. that.$set(that, 'invoice_func', res.data.invoice_func);
  1180. that.$set(that, 'integral_ratio_status', res.data.integral_ratio_status);
  1181. that.$set(that, 'special_invoice', res.data.special_invoice);
  1182. that.$set(that, 'store_self_mention', res.data.store_self_mention);
  1183. that.$set(that, 'svip_status', res.data.svip_status);
  1184. that.$set(that, 'svip_price', res.data.svip_price);
  1185. that.$set(that,'contacts',res.data.userInfo.real_name);
  1186. that.$set(that,'contactsTel',res.data.userInfo.record_pone);
  1187. that.giveData.give_integral = res.data.give_integral;
  1188. that.giveData.give_coupon = res.data.give_coupon;
  1189. let cartInfo = res.data.cartInfo;
  1190. let cartObj = [],giftObj = [];
  1191. cartInfo.forEach(item=>{
  1192. if(item.is_gift == 1){
  1193. giftObj.push(item)
  1194. }else{
  1195. cartObj.push(item)
  1196. }
  1197. })
  1198. that.$set(that, 'cartInfo', cartObj);
  1199. that.$set(that, 'giveCartInfo', giftObj);
  1200. let giveType = -1;
  1201. giftObj.forEach(item=>{
  1202. if(item.product_type==0){
  1203. return giveType = 0
  1204. }
  1205. })
  1206. that.$set(that, 'product_type', (res.data.product_type==0 || giveType == 0 || res.data.product_type == 4)?0:1);
  1207. that.$set(that, 'ChangePrice', that.totalPrice);
  1208. that.getCouponList();
  1209. that.computedPrice();
  1210. if (this.addressId || this.couponId) {
  1211. // this.computedPrice();
  1212. }else{
  1213. that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice),
  1214. parseFloat(res.data
  1215. .priceGroup.storePostage)));
  1216. }
  1217. if(num){
  1218. this.getList();
  1219. }
  1220. }).catch(err => {
  1221. return this.$util.Tips({
  1222. title: err
  1223. });
  1224. });
  1225. },
  1226. /**
  1227. * 获取当前金额可用优惠券
  1228. *
  1229. */
  1230. getCouponList: function() {
  1231. let that = this;
  1232. let data = {
  1233. cartId: this.cartId,
  1234. 'new': this.news,
  1235. shipping_type: that.$util.$h.Add(that.shippingType, 1),
  1236. store_id: (that.system_store && this.deliveryType !=1) ? that.system_store.id : 0
  1237. };
  1238. getCouponsOrderPrice(this.totalPrice, data).then(res => {
  1239. res.data.map(item=>{
  1240. this.$set(item,'ruleshow',false);
  1241. })
  1242. that.$set(that.coupon, 'list', res.data);
  1243. that.openType = 1;
  1244. });
  1245. },
  1246. /*
  1247. * 获取默认收货地址或者获取某条地址信息
  1248. */
  1249. getaddressInfo: function() {
  1250. let that = this;
  1251. if (that.addressId) {
  1252. getAddressDetail(that.addressId).then(res => {
  1253. res.data.is_default = parseInt(res.data.is_default);
  1254. that.addressInfo = res.data || {};
  1255. that.addressId = res.data.id || 0;
  1256. that.address.addressId = res.data.id || 0;
  1257. })
  1258. } else {
  1259. getAddressDefault().then(res => {
  1260. res.data.is_default = parseInt(res.data.is_default);
  1261. that.addressInfo = res.data || {};
  1262. that.addressId = res.data.id || 0;
  1263. that.address.addressId = res.data.id || 0;
  1264. })
  1265. }
  1266. },
  1267. showMaoLocation(e) {
  1268. let self = this;
  1269. // #ifdef H5
  1270. if (self.$wechat.isWeixin()) {
  1271. self.$wechat.seeLocation({
  1272. latitude: Number(e.latitude),
  1273. longitude: Number(e.longitude),
  1274. name: e.name,
  1275. scale: 13,
  1276. address: `${e.address}-${e.detailed_address}`,
  1277. }).then(res => {})
  1278. } else {
  1279. // #endif
  1280. uni.openLocation({
  1281. latitude: Number(e.latitude),
  1282. longitude: Number(e.longitude),
  1283. name: e.name,
  1284. address: `${e.address}-${e.detailed_address}`,
  1285. success: function() {
  1286. Number
  1287. }
  1288. });
  1289. // #ifdef H5
  1290. }
  1291. // #endif
  1292. },
  1293. couponTap: function() {
  1294. this.coupon.coupon = true;
  1295. this.coupon.list.forEach((item, index) => {
  1296. if (item.id == this.couponId) {
  1297. item.is_use = 1
  1298. } else {
  1299. item.is_use = 0
  1300. }
  1301. })
  1302. this.$set(this.coupon, 'list', this.coupon.list);
  1303. },
  1304. car: function() {
  1305. let that = this;
  1306. that.animated = false;
  1307. },
  1308. onAddress: function(name) {
  1309. let that = this;
  1310. if(name){
  1311. that.textareaStatus = false;
  1312. that.address.address = true;
  1313. that.pagesUrl = '/pages/users/user_address_list/index?news=' + this.news + '&cartId=' + this.cartId +
  1314. '&pinkId=' +
  1315. this.pinkId +
  1316. '&couponId=' +
  1317. this.couponId +
  1318. '&store_id=' +
  1319. this.storeId;
  1320. }else{
  1321. uni.navigateTo({
  1322. url:'/pages/users/user_address/index?new='+this.news + '&cartId=' + this.cartId + '&pinkId=' +
  1323. this.pinkId + '&couponId=' + this.couponId + '&store_id=' + this.storeId
  1324. })
  1325. }
  1326. },
  1327. payment: function(data) {
  1328. let that = this;
  1329. orderCreate(that.orderKey, data).then(res => {
  1330. uni.hideLoading();
  1331. uni.redirectTo({
  1332. url: `/pages/goods/cashier/index?order_id=${res.data.result.order_id}&from_type=order`
  1333. })
  1334. }).catch(err => {
  1335. uni.hideLoading();
  1336. return that.$util.Tips({
  1337. title: err
  1338. });
  1339. });
  1340. },
  1341. clickTextArea() {
  1342. this.$refs.textarea.focus()
  1343. },
  1344. bindDateChange: function(e, index) {
  1345. this.confirm[index].value = e.target.value
  1346. },
  1347. bindTimeChange: function(e, index) {
  1348. this.confirm[index].value = e.target.value
  1349. },
  1350. bindSelectChange: function(e, index, item) {
  1351. this.confirm[index].value = item.wordsConfig.list[e.detail.value].val
  1352. },
  1353. getTimeranges(index){
  1354. this.isShow = true
  1355. this.timerangesIndex = index
  1356. },
  1357. confrim(e){
  1358. this.isShow = false;
  1359. this.confirm[this.timerangesIndex].value = e.time;
  1360. let arrayNew = [];
  1361. e.val.forEach(item=>{
  1362. arrayNew.push(Number(item))
  1363. })
  1364. this.timeranges = arrayNew;
  1365. },
  1366. cancels(){
  1367. this.isShow = false;
  1368. },
  1369. // 单选
  1370. radioChange(e, index, item){
  1371. this.confirm[index].value = item.wordsConfig.list[e.detail.value].val
  1372. },
  1373. // 多选
  1374. checkboxChange(e, index, item){
  1375. let obj = e.detail.value;
  1376. let val = '';
  1377. item.wordsConfig.list.forEach((j,jindex)=>{
  1378. obj.forEach(x=>{
  1379. if(jindex == x){
  1380. val = val +(val?',':'') + j.val;
  1381. }
  1382. })
  1383. })
  1384. this.confirm[index].value = val
  1385. },
  1386. formVerify(){
  1387. let that = this;
  1388. if (that.tableId) {
  1389. return this.SubOrder();
  1390. }
  1391. if (!that.addressId && !that.shippingType && !that.product_type) return that.$util.Tips({
  1392. title: '请选择收货地址'
  1393. });
  1394. if (that.shippingType == 1) {
  1395. if (that.contacts == "" || that.contactsTel == "") {
  1396. return that.$util.Tips({
  1397. title: '请填写联系人或联系人电话'
  1398. });
  1399. }
  1400. if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(that.contactsTel)) {
  1401. return that.$util.Tips({
  1402. title: '请填写正确的手机号'
  1403. });
  1404. }
  1405. if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(that.contacts)) {
  1406. return that.$util.Tips({
  1407. title: '请填写您的真实姓名'
  1408. });
  1409. }
  1410. if (that.storeList.length == 0) return that.$util.Tips({
  1411. title: '暂无门店,请选择其他方式'
  1412. });
  1413. }
  1414. for (var i = 0; i < that.confirm.length; i++) {
  1415. let data = that.confirm[i]
  1416. if (['radios'].indexOf(data.name) == -1 && (data.titleShow.val || (['uploadPicture','dateranges'].indexOf(data.name) == -1 && data.value && data.value.trim()))) {
  1417. if ((data.name === 'texts' && data.valConfig.tabVal == 0) || ['dates','times','selects','citys','checkboxs'].indexOf(data.name) != -1) {
  1418. if (!data.value || (data.value && !data.value.trim())) {
  1419. return that.$util.Tips({
  1420. title: `请填写${data.titleConfig.value}`
  1421. });
  1422. }
  1423. }
  1424. if(data.name === 'timeranges'){
  1425. if(!data.value){
  1426. return that.$util.Tips({
  1427. title: `请选择${data.titleConfig.value}`
  1428. });
  1429. }
  1430. }
  1431. if (data.name === 'dateranges') {
  1432. if (!data.value.length) {
  1433. return that.$util.Tips({
  1434. title: `请选择${data.titleConfig.value}`
  1435. });
  1436. }
  1437. }
  1438. if (data.name === 'texts' && data.valConfig.tabVal == 4) {
  1439. if (data.value <= 0) {
  1440. return that.$util.Tips({
  1441. title: `请填写大于0的${data.titleConfig.value}`
  1442. });
  1443. }
  1444. }
  1445. if (data.name === 'texts' && data.valConfig.tabVal == 3) {
  1446. if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(data.value)) {
  1447. return that.$util.Tips({
  1448. title: `请填写正确的${data.titleConfig.value}`
  1449. });
  1450. }
  1451. }
  1452. if (data.name === 'texts' && data.valConfig.tabVal == 1) {
  1453. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(data.value)) {
  1454. return that.$util.Tips({
  1455. title: `请填写正确的${data.titleConfig.value}`
  1456. });
  1457. }
  1458. }
  1459. if (data.name === 'texts' && data.valConfig.tabVal == 2) {
  1460. if (!
  1461. /^[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
  1462. .test(data.value)) {
  1463. return that.$util.Tips({
  1464. title: `请填写正确的${data.titleConfig.value}`
  1465. });
  1466. }
  1467. }
  1468. if (data.name === 'uploadPicture') {
  1469. if (!data.value.length) {
  1470. return that.$util.Tips({
  1471. title: `请上传${data.titleConfig.value}`
  1472. });
  1473. }
  1474. }
  1475. }
  1476. }
  1477. if(this.type == 4 && this.totalIntegral > this.userInfo.integral){
  1478. return that.$util.Tips({
  1479. title: '您的积分不足以抵扣本单积分金额'
  1480. });
  1481. }
  1482. this.SubOrder();
  1483. },
  1484. SubOrder: function(e) {
  1485. let that = this,data = {};
  1486. data = {
  1487. collate_code_id: that.collage_id || that.tableId,
  1488. custom_form: that.confirm,
  1489. real_name: that.contacts,
  1490. phone: that.contactsTel,
  1491. addressId: that.addressId,
  1492. formId: '',
  1493. couponId: that.priceGroup.couponPrice==0?0:that.couponId,
  1494. payType: that.payType,
  1495. useIntegral: that.useIntegral,
  1496. bargainId: that.BargainId,
  1497. combinationId: that.combinationId,
  1498. discountId: that.discountId,
  1499. pinkId: that.pinkId,
  1500. seckill_id: that.seckillId,
  1501. mark: that.mark,
  1502. store_id: that.deliveryType == 1 ? 0 :that.system_store.id||0,
  1503. 'from': that.from,
  1504. shipping_type: that.tableId ? 4 : that.$util.$h.Add(that.shippingType, 1), // 桌码订单为:4
  1505. 'new': that.news,
  1506. 'invoice_id': that.invChecked,
  1507. // #ifdef H5
  1508. quitUrl: location.protocol + '//' + location.hostname +
  1509. '/pages/goods/order_pay_status/index?' +
  1510. '&type=3' + '&totalPrice=' + this.totalPrice
  1511. // #endif
  1512. // #ifdef APP-PLUS
  1513. quitUrl: '/pages/goods/order_details/index'
  1514. // #endif
  1515. };
  1516. uni.showLoading({
  1517. title: '订单支付中'
  1518. });
  1519. // #ifdef MP
  1520. openPaySubscribe().then(() => {
  1521. that.payment(data);
  1522. });
  1523. // #endif
  1524. // #ifndef MP
  1525. that.payment(data);
  1526. // #endif
  1527. },
  1528. // 去详情页
  1529. goDetail(id) {
  1530. uni.navigateTo({
  1531. url: `/pages/goods_details/index?id=${id}&fromType=1`
  1532. });
  1533. },
  1534. addCart(type,item){
  1535. if(type == 1){
  1536. if(item.productInfo.stock == item.cart_num) return this.$util.Tips({
  1537. title: '该产品没有更多库存了!'
  1538. });
  1539. item.cart_num ++
  1540. }else{
  1541. if(item.cart_num == 1) return
  1542. item.cart_num --
  1543. }
  1544. let data = {
  1545. cartNum: item.cart_num,
  1546. new:this.news,
  1547. uniqueId:item.product_attr_unique,
  1548. productId:item.productInfo.id,
  1549. key: this.news ? item.id : '',
  1550. is_set:1
  1551. };
  1552. postCartAdd(data).then(res => {
  1553. this.getConfirm();
  1554. setTimeout(()=>{
  1555. this.computedPrice();
  1556. },500)
  1557. }).catch(err => {
  1558. return this.$util.Tips({
  1559. title: err
  1560. });
  1561. });
  1562. },
  1563. setValue: Debounce(function(e,item){
  1564. let num = e.detail.value;
  1565. if (item.productInfo.limit_num > 0 && num > item.productInfo.limit_num) {
  1566. item.cart_num = item.productInfo.limit_num;
  1567. return this.$util.Tips({
  1568. title: '购物车数量不能大于限购数量'
  1569. });
  1570. }
  1571. let data = {
  1572. cartNum: num,
  1573. new:this.news,
  1574. uniqueId:item.product_attr_unique,
  1575. productId:item.productInfo.id,
  1576. key: this.news ? this.cartId : '',
  1577. is_set:1
  1578. };
  1579. postCartAdd(data).then(res => {
  1580. this.getConfirm();
  1581. setTimeout(()=>{
  1582. this.computedPrice();
  1583. },500)
  1584. }).catch(err => {
  1585. return this.$util.Tips({
  1586. title: err
  1587. });
  1588. });
  1589. }),
  1590. goPage(type, url){
  1591. if(type == 1){
  1592. uni.navigateTo({
  1593. url
  1594. })
  1595. }else if(type == 2){
  1596. uni.switchTab({
  1597. url
  1598. })
  1599. }else if(type == 3){
  1600. uni.navigateBack();
  1601. }
  1602. },
  1603. closeDrawer(){
  1604. this.showGiftDrawer = false;
  1605. },
  1606. hideModal(){
  1607. this.isAddress = false;
  1608. },
  1609. handleClick(e){
  1610. let index = e.index;
  1611. if(index == 1){
  1612. uni.navigateTo({
  1613. url: '/pages/users/user_address/index?id='+this.id +'&new=' + this.news + '&cartId=' + this.cartId +'&pinkId=' +this.pinkId +'&couponId=' +this.couponId
  1614. })
  1615. }
  1616. this.isAddress = false;
  1617. },
  1618. clearInput(type){
  1619. if(type == 0){
  1620. this.contacts = '';
  1621. this.contactsFocus = true;
  1622. }else{
  1623. this.contactsTel = '';
  1624. this.telFocus = true;
  1625. }
  1626. },
  1627. getCodeData() {
  1628. getCodeData({
  1629. tableId: this.tableId
  1630. }).then(res => {
  1631. this.codeData = res.data;
  1632. });
  1633. },
  1634. getCollagePartake() {
  1635. getCollagePartake({
  1636. collage_id: this.collage_id
  1637. }).then(res => {
  1638. this.goodsList = res.data;
  1639. });
  1640. }
  1641. }
  1642. }
  1643. </script>
  1644. <style lang="scss" scoped>
  1645. /deep/.uni-date-x--border{
  1646. border: 0;
  1647. }
  1648. /deep/.uni-icons{
  1649. font-size: 0 !important;
  1650. }
  1651. /deep/.uni-date-x{
  1652. color: #999;
  1653. font-size: 15px;
  1654. }
  1655. /deep/.uni-date__x-input{
  1656. font-size: 15px;
  1657. }
  1658. .footer-box{
  1659. position: fixed;
  1660. bottom: 12rpx;
  1661. bottom: calc(12rpx + constant(safe-area-inset-bottom));
  1662. bottom: calc(12rpx + env(safe-area-inset-bottom));
  1663. z-index: 5;
  1664. right: 20rpx;
  1665. width: 168rpx;
  1666. height: 72rpx;
  1667. text-align: center;
  1668. line-height: 72rpx;
  1669. font-size: 26rpx;
  1670. color: #fff;
  1671. border-radius: 36rpx;
  1672. background-color: var(--view-theme);
  1673. }
  1674. .height-add {
  1675. height: calc(176rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1676. height: calc(176rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1677. }
  1678. /deep/uni-checkbox[disabled] .uni-checkbox-input {
  1679. background-color: #eee;
  1680. }
  1681. .alipaysubmit {
  1682. display: none;
  1683. }
  1684. .abs-lt .active-card{
  1685. &:after{
  1686. right: -67rpx;
  1687. }
  1688. }
  1689. .abs-ct .active-card{
  1690. &:after{
  1691. right: -67rpx;
  1692. }
  1693. &:before{
  1694. left:-67rpx;
  1695. transform:scaleX(-1);
  1696. }
  1697. }
  1698. .abs-rt .active-card{
  1699. &:after{
  1700. left: -67rpx;
  1701. -moz-transform:scaleX(-1);
  1702. -webkit-transform:scaleX(-1);
  1703. -o-transform:scaleX(-1);
  1704. transform:scaleX(-1);
  1705. }
  1706. }
  1707. .active-card{
  1708. &:after,&:before{
  1709. content:"";
  1710. width: 67rpx;
  1711. height: 76rpx;
  1712. background-image: url('../static/nav_circle_left.png');
  1713. background-size: contain;
  1714. background-repeat: no-repeat;
  1715. position: absolute;
  1716. bottom: 0;
  1717. z-index: 4;
  1718. }
  1719. }
  1720. .line {
  1721. width: 680rpx;
  1722. margin: auto;
  1723. height: 3rpx;
  1724. }
  1725. .line image {
  1726. width: 100%;
  1727. height: 100%;
  1728. display: block;
  1729. }
  1730. .address {
  1731. background-color: #fff;
  1732. box-sizing: border-box;
  1733. .default{
  1734. width: 60rpx;
  1735. height: 34rpx;
  1736. background: var(--view-minorColorT);
  1737. border-radius: 8rpx;
  1738. color: var(--view-theme);
  1739. font-size: 22rpx;
  1740. }
  1741. }
  1742. .add1{
  1743. padding: 24rpx 20rpx 32rpx 32rpx;
  1744. }
  1745. .add2{
  1746. padding: 36rpx 20rpx 0 32rpx;
  1747. }
  1748. .footer .transparent {
  1749. opacity: 0
  1750. }
  1751. ._map{
  1752. width:188rpx;
  1753. height:104rpx;
  1754. background-size:100%;
  1755. background-repeat: no-repeat;
  1756. }
  1757. .store_distance{
  1758. position: absolute;
  1759. top: -4rpx;
  1760. left:30rpx;
  1761. width: 130rpx;
  1762. height: 36rpx;
  1763. box-shadow: 0px 0px 16rpx 0px rgba(0,0,0,0.0784);
  1764. }
  1765. .store-horn{
  1766. position: absolute;
  1767. top:32rpx;
  1768. left: 50%;
  1769. transform: translateX(-50%);
  1770. width: 0;
  1771. height: 0;
  1772. border-top: 6rpx solid #fff;
  1773. border-right: 6rpx solid transparent;
  1774. border-left: 6rpx solid transparent;
  1775. }
  1776. .store_logo{
  1777. position: absolute;
  1778. top: 40rpx;
  1779. left:68rpx;
  1780. width: 52rpx;
  1781. height:52rpx;
  1782. box-shadow: 0px 0px 16rpx 0px rgba(0,0,0,0.0784);
  1783. padding: 6rpx;
  1784. &:after{
  1785. content:'';
  1786. position: absolute;
  1787. bottom:-8rpx;
  1788. left:50%;
  1789. transform: translateX(-50%);
  1790. width: 0;
  1791. height: 0;
  1792. border-top: 8rpx solid #fff;
  1793. border-right: 6rpx solid transparent;
  1794. border-left: 6rpx solid transparent;
  1795. }
  1796. &:before{
  1797. content:'';
  1798. position: absolute;
  1799. bottom:-12rpx;
  1800. left:50%;
  1801. transform: translateX(-50%);
  1802. width: 6rpx;
  1803. height: 6rpx;
  1804. border-radius: 50%;
  1805. background-color: var(--view-theme);
  1806. }
  1807. }
  1808. .dashed-b{
  1809. border-bottom: 1px dashed #eee;
  1810. }
  1811. .w-322{
  1812. width:322rpx;
  1813. }
  1814. .w-450{
  1815. width: 450rpx;
  1816. }
  1817. .order_goods ~ .order_goods{
  1818. margin-top: 32rpx;
  1819. }
  1820. .cell input{
  1821. width: 450rpx;
  1822. text-align:right;
  1823. }
  1824. .cell .radio {
  1825. margin: 0 22rpx;
  1826. padding: 10rpx 0;
  1827. }
  1828. .cell ~ .cell{
  1829. margin-top: 40rpx;
  1830. }
  1831. .SemiBold {
  1832. font-family: SemiBold;
  1833. }
  1834. .Regular{
  1835. font-family: 'Regular';
  1836. }
  1837. .placeholder {
  1838. color: #ccc;
  1839. }
  1840. .asterisk{
  1841. position: absolute;
  1842. color:red;
  1843. left:0;
  1844. }
  1845. .gradient-box{
  1846. background: linear-gradient(180deg, var(--view-theme) 0%, var(--view-theme) 52%, rgba(233,51,35,0) 100%);
  1847. }
  1848. .h-auto{
  1849. height:auto;
  1850. }
  1851. .bg-primary-light{
  1852. background: var(--view-minorColorT);
  1853. }
  1854. .bg-horn{
  1855. position: relative;
  1856. &:before{
  1857. position: absolute;
  1858. content: '';
  1859. width: 20rpx;
  1860. height: 20rpx;
  1861. background-color: var(--view-minorColorT);
  1862. left:0;
  1863. bottom: -20rpx;
  1864. }
  1865. &::after{
  1866. position: absolute;
  1867. content: '';
  1868. width: 20rpx;
  1869. height: 20rpx;
  1870. background-color: #fff;
  1871. left:0;
  1872. bottom: -20rpx;
  1873. border-radius: 20rpx 0 0 0;
  1874. }
  1875. }
  1876. .bg-horn-r{
  1877. position: relative;
  1878. &:before{
  1879. position: absolute;
  1880. content: '';
  1881. width: 20rpx;
  1882. height: 20rpx;
  1883. background-color: var(--view-minorColorT);
  1884. right:0;
  1885. bottom: -20rpx;
  1886. }
  1887. &::after{
  1888. position: absolute;
  1889. content: '';
  1890. width: 20rpx;
  1891. height: 20rpx;
  1892. background-color: #fff;
  1893. right:0;
  1894. bottom: -20rpx;
  1895. border-radius: 0 20rpx 0 0;
  1896. }
  1897. }
  1898. .rd-lt-24rpx{
  1899. border-radius: 24rpx 0 0 0;
  1900. }
  1901. .rd-rt-24rpx{
  1902. border-radius: 0 24rpx 0 0;
  1903. }
  1904. .z-2{
  1905. z-index: 2;
  1906. }
  1907. .gold{
  1908. color: #DCA658;
  1909. }
  1910. .over{
  1911. width:104rpx;
  1912. height:104rpx;
  1913. border-radius: 50%;
  1914. background-color: rgba(51, 51, 51, 0.6);
  1915. position: absolute;
  1916. top:50%;
  1917. left:50%;
  1918. transform: translate(-50%,-50%);
  1919. }
  1920. .con-border{
  1921. border: 1px solid var(--view-theme);
  1922. }
  1923. .clear-btn{
  1924. border-radius: 0 12rpx 0 12rpx;
  1925. }
  1926. .header {
  1927. padding: 32rpx;
  1928. border-radius: 24rpx;
  1929. margin: 20rpx;
  1930. background: #FFFFFF;
  1931. font-size: 24rpx;
  1932. line-height: 34rpx;
  1933. color: #999999;
  1934. .top {
  1935. margin-bottom: 12rpx;
  1936. }
  1937. .name {
  1938. flex: 1;
  1939. min-width: 0;
  1940. font-weight: 500;
  1941. font-size: 30rpx;
  1942. line-height: 42rpx;
  1943. color: #333333;
  1944. }
  1945. .number {
  1946. font-size: 22rpx;
  1947. line-height: 42rpx;
  1948. color: #333333;
  1949. }
  1950. .light {
  1951. font-weight: 500;
  1952. font-size: 30rpx;
  1953. color: var(--view-theme);
  1954. }
  1955. }
  1956. .dining {
  1957. height: 100rpx;
  1958. padding: 0 24rpx 0 32rpx;
  1959. border-radius: 24rpx;
  1960. margin: 20rpx;
  1961. background: #FFFFFF;
  1962. font-size: 24rpx;
  1963. color: #333333;
  1964. .total {
  1965. font-weight: 500;
  1966. font-size: 30rpx;
  1967. color: #3D3D3D;
  1968. }
  1969. }
  1970. .dinner {
  1971. border-radius: 24rpx;
  1972. margin: 20rpx;
  1973. background: #FFFFFF;
  1974. .head {
  1975. padding: 35rpx 24rpx;
  1976. font-size: 28rpx;
  1977. color: #333333;
  1978. .image {
  1979. display: block;
  1980. width: 36rpx;
  1981. height: 36rpx;
  1982. border-radius: 50%;
  1983. }
  1984. .name {
  1985. flex: 1;
  1986. min-width: 0;
  1987. padding: 0 10rpx;
  1988. }
  1989. }
  1990. .body {
  1991. padding: 0 24rpx 32rpx;
  1992. }
  1993. .item {
  1994. position: relative;
  1995. margin-top: 32rpx;
  1996. &:first-child {
  1997. margin-top: 0;
  1998. }
  1999. &.gray {
  2000. background-color: #EEEEEE;
  2001. }
  2002. .image {
  2003. display: block;
  2004. width: 136rpx;
  2005. height: 136rpx;
  2006. border-radius: 16rpx;
  2007. }
  2008. .text {
  2009. flex: 1;
  2010. min-width: 0;
  2011. padding: 0 20rpx;
  2012. }
  2013. .name {
  2014. font-size: 28rpx;
  2015. line-height: 40rpx;
  2016. color: #333333;
  2017. }
  2018. .attr {
  2019. margin-top: 12rpx;
  2020. font-size: 24rpx;
  2021. line-height: 34rpx;
  2022. color: #999999;
  2023. }
  2024. .number {
  2025. margin-top: 10rpx;
  2026. text-align: right;
  2027. font-size: 24rpx;
  2028. line-height: 34rpx;
  2029. color: #999999;
  2030. }
  2031. }
  2032. }
  2033. .border-top {
  2034. .flex-1{
  2035. position: relative;
  2036. min-width: 0;
  2037. &::before{
  2038. content: "";
  2039. position: absolute;
  2040. top: 0;
  2041. left: 0;
  2042. bottom: 0;
  2043. border-left: 1rpx solid #EEEEEE;
  2044. transform: rotateZ(360deg);
  2045. }
  2046. &:first-child{
  2047. padding-right: 28rpx;
  2048. &::before{
  2049. display: none;
  2050. }
  2051. }
  2052. }
  2053. }
  2054. </style>