index.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931
  1. <template>
  2. <view>
  3. <view class='order-submission'>
  4. <view class="allAddress" @click="onAddress">
  5. <view class='address acea-row row-between-wrapper' v-if='shippingType == 0 '>
  6. <view class='addressCon' v-if="addressInfo.real_name">
  7. <view class='name'>{{addressInfo.real_name}}
  8. <text class='phone'>{{addressInfo.phone}}</text>
  9. </view>
  10. <view>
  11. <text class='default font-color' v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.detail}}</view>
  12. <!-- <view class='setaddress'>设置收货地址</view> -->
  13. </view>
  14. <view class='addressCon' v-else>
  15. <view class='setaddress'>设置收货地址</view>
  16. </view>
  17. <view class='iconfont icon-jiantou'></view>
  18. </view>
  19. <view class='line'>
  20. <image src='/static/images/line.jpg'></image>
  21. </view>
  22. </view>
  23. <!-- 商品信息 -->
  24. <view class="storeinfo-wrapper">
  25. <view class="store-item" v-for="(item,index) in cartInfo" :key="index">
  26. <view class="store-title">
  27. <text class="iconfont icon-shangjiadingdan"></text>
  28. <view class="txt" @click="goStore(item.mer_id)">{{item.mer_name}}</view>
  29. <text class="iconfont icon-xiangyou"></text>
  30. </view>
  31. <view v-for="(goods,j) in item.list" :key="j">
  32. <view v-if="goods.product_type == 2">
  33. <view class="product-item">
  34. <view class="img-box">
  35. <image :src="goods.productPresellAttr.image || goods.product.image"></image>
  36. </view>
  37. <view class="content event_content">
  38. <view class="name line1"><text class="event_name event_bg">预售</text>{{goods.productPresell.store_name}}</view>
  39. <view class="label" style="width: 70%;">{{goods.productAttr.sku}}</view>
  40. <view class="price">
  41. ¥{{goods.productPresellAttr.presell_price}}
  42. <text>X{{goods.cart_num}}</text>
  43. </view>
  44. <view class="event_ship event_color">发货时间:
  45. <!--全款预售-->
  46. <text v-if="goods.productPresell.presell_type === 1">{{goods.productPresell.delivery_type === 1 ? '支付后' : '预售结束后'}}{{ goods.productPresell.delivery_day }}天内</text>
  47. <!--定金预售-->
  48. <text v-if="goods.productPresell.presell_type === 2">{{ goods.productPresell.delivery_type === 1 ? '付尾款后' : '预售结束后' }}{{ goods.productPresell.delivery_day }}天内</text>
  49. </view>
  50. <view class="err-txt" v-if="goods.undelivered && addressInfo.real_name">
  51. <text class="iconfont icon-zhuyi-copy"></text>
  52. <view class="txt">此商品不支持该区域配送</view>
  53. </view>
  54. </view>
  55. </view>
  56. <view v-if="goods.productPresell.presell_type === 2" class="event_payTime">
  57. <view class="event_progress">
  58. <view class="progress_step">
  59. <text class="name color_red">定金</text>
  60. <text class="price color_red">¥{{ (goods.productPresellAttr.down_price * goods.cart_num).toFixed(2) }}</text>
  61. </view>
  62. <view class="progress_step">
  63. <text class="name">尾款</text>
  64. <text class="price">¥{{ (goods.productPresellAttr.final_price * goods.cart_num).toFixed(2) }}</text>
  65. </view>
  66. <view class="progress_pay">{{ goods.productPresell.final_start_time | filterDay}}开始支付尾款</view>
  67. </view>
  68. </view>
  69. </view>
  70. <view v-else>
  71. <view class="product-item">
  72. <view class="img-box">
  73. <image :src="goods.productAttr.image || goods.product.image"></image>
  74. </view>
  75. <view class="content">
  76. <view class="name line1">{{goods.product.store_name}}</view>
  77. <view class="label">{{goods.productAttr.sku}}</view>
  78. <view class="price">
  79. <block v-if="order_type == 3">
  80. ¥{{goods.productAssistAttr.assist_price}}
  81. </block>
  82. <block v-else-if="order_type == 4">
  83. ¥{{goods.activeSku.active_price}}
  84. </block>
  85. <block v-else>
  86. ¥{{goods.productAttr.price}}
  87. </block>
  88. <text>X{{goods.cart_num}}</text>
  89. </view>
  90. <view class="err-txt" v-if="goods.undelivered && addressInfo.real_name">
  91. <text class="iconfont icon-zhuyi-copy"></text>
  92. <view class="txt">此商品不支持该区域配送</view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="wrapper">
  99. <view class="boxs" v-if="item.take.mer_take_status != 0">
  100. <view class='item acea-row row-between-wrapper' @tap='openShowBox(item,index)'>
  101. <view>配送方式</view>
  102. <view class='discount'>
  103. {{item.isTake==0?'快递配送':'到店自提'}}
  104. <text class='iconfont icon-jiantou'></text>
  105. </view>
  106. </view>
  107. <view class="store-address" v-if="item.isTake">
  108. <view class="name">{{item.take.mer_take_name}}</view>
  109. <view class="info">{{item.take.mer_take_address}}</view>
  110. <view class="map" @click="goMap(item)">
  111. <text class="iconfont icon-chakanditu"></text>
  112. <view class="map_text">查看地图</view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class='item acea-row row-between-wrapper' v-if='shippingType==0 && item.isTake == 0'>
  117. <view>快递费用 <text v-if="item.list[0].productPresell && item.list[0].productPresell.presell_type == 2">(尾款阶段)</text>
  118. </view>
  119. <view class='discount' v-if='item.order.postage_price > 0'>+¥{{item.order.postage_price}}</view>
  120. <view class='discount' v-else>免运费</view>
  121. </view>
  122. <view class='item acea-row row-between-wrapper' v-if="!pinkId && !BargainId && !combinationId && !seckillId && order_type != 3 && order_type != 4">
  123. <view>优惠券</view>
  124. <block v-if="item.coupon.length>0">
  125. <view class='discount' @tap='couponTap(item,index)'>
  126. <text v-if="item.order.coupon_price>0">优惠¥{{item.order.coupon_price}}</text>
  127. <text v-else>暂未选择优惠券</text>
  128. <text class='iconfont icon-jiantou'></text>
  129. </view>
  130. </block>
  131. <block v-else>
  132. <view class='discount'>暂无优惠券</view>
  133. </block>
  134. </view>
  135. <view v-if="item.openReceipt == 1" class='item acea-row row-between-wrapper' @tap="goInvoice(item.mer_id)">
  136. <!-- <view v-if="item.openReceipt == 1" class='item acea-row row-between-wrapper' @tap="goInvoice(item.mer_id)"> -->
  137. <view>开具发票</view>
  138. <view class='discount discount_voice'>
  139. {{(item.invoiceData && item.invoiceData.receipt_title) ? item.invoiceData.receipt_title : '不开发票'}}
  140. <text class='iconfont icon-jiantou'></text>
  141. </view>
  142. </view>
  143. <view v-if="order_type === 2 && item.list[0].productPresell.presell_type ==2" class="item acea-row row-between-wrapper"
  144. style="border-top: 1px solid #f5f5f5; border-bottom: 1px solid #f5f5f5;">
  145. <checkbox-group class="checkgroup" @change='changeIsAgree'>
  146. <text class="iconfont icon-wenhao1"></text>
  147. <text @click="showProtocol = true">我已同意定金不退等预售协议</text>
  148. <checkbox class="checkbox" :checked="isAgree ? true : false" />
  149. </checkbox-group>
  150. </view>
  151. <view class='item acea-row row-between-wrapper' v-if="textareaStatus">
  152. <view>备注信息</view>
  153. <input v-if="coupon.status===false" placeholder-class='placeholder' @input='bindHideKeyboard' value="" name="mark"
  154. placeholder='选填备注信息' v-model="msgObj[item.mer_id]"></input>
  155. </view>
  156. <view class="total">
  157. 共{{item.order.total_num}}件 小计
  158. <view class="price" v-if="item.isTake == 0"><text>¥</text>{{ item.order.pay_price }}</view>
  159. <view class="price" v-if="item.isTake == 1"><text>¥</text>{{ item.order.org_price}}</view>
  160. </view>
  161. </view>
  162. </view>
  163. </view>
  164. <view class="settlementAgreement" v-if="showProtocol">
  165. <view class="setAgCount">
  166. <i class="icon iconfont icon-cha" @click="showProtocol = false"></i>
  167. <div class="title">预售协议</div>
  168. <view class="content">
  169. <jyf-parser :html="protocol" ref="article" :tag-style="tagStyle"></jyf-parser>
  170. <!-- <view v-html="protocol"></view> -->
  171. </view>
  172. </view>
  173. </view>
  174. <view class='wrapper'>
  175. <view class='item'>
  176. <view>支付方式</view>
  177. <view class='list'>
  178. <!-- #ifdef H5 -->
  179. <view class='payItem acea-row row-middle' :class='active==index ?"on":""' @tap='payItem(index)' v-for="(item,index) in cartArr"
  180. :key='index' v-if="item.payStatus==1">
  181. <view class='name acea-row row-center-wrapper'>
  182. <view class='iconfont animated' :class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'></view>{{item.name}}
  183. </view>
  184. <view class='tip'>
  185. {{item.title}}
  186. <block v-if="item.value == 'balance'">
  187. {{userInfo.now_money}}
  188. </block>
  189. </view>
  190. </view>
  191. <!-- #endif -->
  192. <!-- #ifdef MP || APP-PLUS -->
  193. <view class='payItem acea-row row-middle' :class='active==index ?"on":""' @tap='payItem(index)' v-for="(item,index) in cartArr"
  194. :key='index' v-if="item.payStatus==1">
  195. <view class='name acea-row row-center-wrapper'>
  196. <view class='iconfont animated' :class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'></view>{{item.name}}
  197. </view>
  198. <view class='tip'>
  199. {{item.title}}
  200. <block v-if="item.value == 'balance'">
  201. {{userInfo.now_money}}
  202. </block>
  203. </view>
  204. </view>
  205. <!-- #endif -->
  206. </view>
  207. </view>
  208. </view>
  209. <view class='moneyList'>
  210. <view class='item acea-row row-between-wrapper'>
  211. <view>商品总价:</view>
  212. <view class='money'>¥{{proPrice}}</view>
  213. </view>
  214. <view class='item acea-row row-between-wrapper' v-if="coupon_price > 0">
  215. <view>优惠券抵扣:</view>
  216. <view class='money'>-¥{{coupon_price}}</view>
  217. </view>
  218. <view class='item acea-row row-between-wrapper' v-if="integral_price > 0">
  219. <view>积分抵扣:</view>
  220. <view class='money'>-¥{{integral_price}}</view>
  221. </view>
  222. <view class='item acea-row row-between-wrapper' v-if="priceGroup.storePostage > 0">
  223. <view>运费:</view>
  224. <view class='money'>+¥{{priceGroup.storePostage}}</view>
  225. </view>
  226. </view>
  227. <view style='height:120rpx;'></view>
  228. <view class='footer acea-row row-between-wrapper'>
  229. <view>合计:
  230. <text class='font-color'>¥{{totalPrice || 0}}</text>
  231. </view>
  232. <view class='settlement' :class='addressInfo.real_name ? "" : "disabled"' style='z-index:100' @tap="SubOrder">{{addressInfo.real_name ? '立即结算':'选择地址'}}</view>
  233. </view>
  234. </view>
  235. <block v-if="coupon.status">
  236. <couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" :openType='openType' :cartId='cartId'
  237. @ChangCoupons="ChangCoupons" :subCoupon='subCoupon'></couponListWindow>
  238. </block>
  239. <addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address' :pagesUrl="pagesUrl"
  240. @OnChangeAddress="OnChangeAddress" @changeClose="changeClose"></addressWindow>
  241. <addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing>
  242. <!-- #ifdef MP -->
  243. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
  244. <!-- #endif -->
  245. <block v-if="isShowBox">
  246. <checkDelivery :isShowBox="isShowBox" :activeObj="activeObj" @close="boxClose" @confirmBtn="getData"></checkDelivery>
  247. </block>
  248. </view>
  249. </template>
  250. <script>
  251. let app = getApp();
  252. import {
  253. orderConfirm,
  254. getCouponsOrderPrice,
  255. orderCreate
  256. } from '@/api/order.js';
  257. import {
  258. getAddressDefault,
  259. getAddressDetail,
  260. getAddressList,
  261. getUserInfo
  262. } from '@/api/user.js';
  263. import {
  264. openPaySubscribe
  265. } from '@/utils/SubscribeMessage.js';
  266. import {
  267. presellAgreement
  268. } from '@/api/activity.js';
  269. import {
  270. storeListApi
  271. } from '@/api/store.js';
  272. import {
  273. CACHE_LONGITUDE,
  274. CACHE_LATITUDE
  275. } from '@/config/cache.js';
  276. import couponListWindow from '@/components/checkCoupon';
  277. import addressWindow from '@/components/addressWindow';
  278. import orderGoods from '@/components/orderGoods';
  279. import checkDelivery from '@/components/checkDelivery/index.vue'
  280. import addInvoicing from '@/components/addInvoicing';
  281. import parser from "@/components/jyf-parser/jyf-parser";
  282. import {
  283. toLogin
  284. } from '@/libs/login.js';
  285. import {
  286. mapGetters
  287. } from "vuex";
  288. // #ifdef MP
  289. import authorize from '@/components/Authorize';
  290. // #endif
  291. export default {
  292. components: {
  293. couponListWindow,
  294. addressWindow,
  295. orderGoods,
  296. checkDelivery,
  297. addInvoicing,
  298. "jyf-parser": parser,
  299. // #ifdef MP
  300. authorize
  301. // #endif
  302. },
  303. filters:{
  304. filterDay(val){
  305. if(val){
  306. var reg =/(\d{4})\-(\d{2})\-(\d{2})/;
  307. var date = val.replace(reg,"$2月$3日");
  308. return date
  309. }
  310. }
  311. },
  312. data() {
  313. return {
  314. // 备注
  315. msgObj: {
  316. },
  317. textareaStatus: true,
  318. //支付方式
  319. cartArr: [{
  320. "name": "微信支付",
  321. "icon": "icon-weixin2",
  322. value: 'weixin',
  323. title: '微信快捷支付',
  324. payStatus: 1,
  325. },
  326. {
  327. name: "支付宝支付",
  328. icon: "icon-zhifubao",
  329. // #ifdef H5
  330. value: 'alipay',
  331. // #endif
  332. // #ifdef MP
  333. value: 'alipayQr',
  334. // #endif
  335. title: '支付宝支付',
  336. payStatus: app.globalData.alipay_open
  337. },
  338. {
  339. "name": "余额支付",
  340. "icon": "icon-icon-test",
  341. value: 'balance',
  342. title: '可用余额:',
  343. payStatus: app.globalData.yue_pay_status,
  344. },
  345. {
  346. "name": "线下支付",
  347. "icon": "icon-yinhangqia",
  348. value: 'offline',
  349. title: '线下支付',
  350. payStatus: 2,
  351. },
  352. ],
  353. payType: 'weixin', //支付方式
  354. openType: 1, //优惠券打开方式 1=使用
  355. active: 0, //支付方式切换
  356. coupon: {
  357. status: false,
  358. list: [],
  359. statusTile: '立即使用'
  360. }, //优惠券组件
  361. address: {
  362. address: false
  363. }, //地址组件
  364. addressInfo: {}, //地址信息
  365. invoice: {
  366. invoice: false,
  367. mer_id: 0
  368. }, //发票组件
  369. invoiceData: {}, // 发票数据
  370. pinkId: 0, //拼团id
  371. addressId: 0, //地址id
  372. couponId: 0, //优惠券id
  373. cartId: '', //购物车id
  374. BargainId: 0,
  375. combinationId: 0,
  376. seckillId: 0,
  377. userInfo: {}, //用户信息
  378. mark: '', //备注信息
  379. couponTitle: '请选择', //优惠券
  380. coupon_price: 0, //优惠券抵扣金额
  381. useIntegral: false, //是否使用积分
  382. integral_price: 0, //积分抵扣金额
  383. integral: 0,
  384. ChangePrice: 0, //使用积分抵扣变动后的金额
  385. formIds: [], //收集formid
  386. status: 0,
  387. is_address: false,
  388. toPay: false, //修复进入支付时页面隐藏从新刷新页面
  389. shippingType: 0,
  390. system_store: {},
  391. storePostage: 0,
  392. contacts: '',
  393. contactsTel: '',
  394. mydata: {},
  395. storeList: [],
  396. store_self_mention: 0,
  397. cartInfo: [],
  398. priceGroup: {},
  399. animated: false,
  400. totalPrice: 0,
  401. integralRatio: "0",
  402. pagesUrl: "",
  403. orderKey: "",
  404. // usableCoupon: {},
  405. offlinePostage: "",
  406. isAuto: false, //没有授权的不会自动授权
  407. isShowAuth: false, //是否隐藏授权
  408. from: '',
  409. orderStatus: '', //是否有地址
  410. couponIndex: 0, //选择商铺优惠券索引
  411. subCoupon: {}, //提交订单使用的优惠券
  412. proPrice: 0, //商品总价
  413. isShowBox: false,
  414. activeObj: {}, //选中店铺信息
  415. activeIndex: '', // 选中店铺索引
  416. invoiceName: '不开发票',
  417. invoice_func: false,
  418. special_invoice: false,
  419. // order_type: 1, // 是否为预售
  420. isAgree: false,
  421. showProtocol: false,
  422. protocol: '',
  423. order_type: 0,
  424. hide_mer_status: 1,
  425. addInvoice: {},
  426. go_map: false,
  427. orderPay: false,
  428. };
  429. },
  430. computed: mapGetters(['isLogin']),
  431. onReady() {
  432. uni.$on('update',(data)=>{
  433. this.cartArr[1]['payStatus'] = data.alipay_open
  434. this.cartArr[2]['payStatus'] = data.alipay_open
  435. this.hide_mer_status = data.hide_mer_status
  436. })
  437. },
  438. mounted: function() {
  439. this.$nextTick(() => {
  440. const app = getApp();
  441. this.cartArr[1]['payStatus'] = app.globalData.alipay_open
  442. this.cartArr[2]['payStatus'] = app.globalData.yue_pay_status
  443. this.hide_mer_status = app.globalData.hide_mer_status
  444. });
  445. },
  446. onLoad: function(options) {
  447. this.seckillId = options.seckillId
  448. // #ifdef H5
  449. this.from = this.$wechat.isWeixin() ? 'weixin' : 'h5'
  450. // #endif
  451. // #ifdef MP
  452. this.from = 'routine'
  453. // #endif
  454. if (!options.cartId) return this.$util.Tips({
  455. title: '请选择要购买的商品'
  456. }, {
  457. tab: 3,
  458. url: 1
  459. });
  460. this.couponId = options.couponId || 0;
  461. this.pinkId = options.pinkid ? parseInt(options.pinkid) : 0;
  462. this.addressId = options.addressId || 0;
  463. this.cartId = options.cartId;
  464. this.is_address = options.is_address ? true : false;
  465. this.news = options.new ? 1 : 0;
  466. this.invoice_id = options.invoice_id || '';
  467. if (options.invoice_type == 1) {
  468. this.invoiceName = '增值税电子普通发票';
  469. } else if (options.invoice_type == 2) {
  470. this.invoiceName = '增值税专用发票';
  471. }
  472. if (this.isLogin) {
  473. // this.getaddressInfo();
  474. // //调用子页面方法授权后执行获取地址列表
  475. // this.$nextTick(function() {
  476. // this.$refs.addressWindow.getAddressList();
  477. // })
  478. } else {
  479. // #ifdef H5 || APP-PLUS
  480. toLogin();
  481. // #endif
  482. // #ifdef MP
  483. this.isAuto = true;
  484. this.$set(this, 'isShowAuth', true);
  485. // #endif
  486. }
  487. if (this.payType == 'weixin') {
  488. this.payType = this.from
  489. }
  490. let _this = this
  491. this.textareaStatus = true;
  492. if (this.isLogin && this.toPay == false && !this.orderPay) {
  493. this.getaddressInfo();
  494. this.$nextTick(function() {
  495. console.log('1')
  496. // this.$refs.addressWindow.getAddressList();
  497. console.log('2')
  498. this.getUserInfo()
  499. })
  500. }
  501. },
  502. /**
  503. * 生命周期函数--监听页面显示
  504. */
  505. onShow: function() {
  506. let that = this;
  507. uni.$on("handClick", res => {
  508. if (res) {
  509. _this.system_store = res.address
  510. }
  511. // 清除监听
  512. uni.$off('handClick');
  513. })
  514. uni.$on("updataAddress", () => {
  515. if(!that.go_map && !that.orderPay){
  516. that.getaddressInfo();
  517. }
  518. that.$nextTick(function() {
  519. // that.$refs.addressWindow.getAddressList();
  520. that.getUserInfo()
  521. })
  522. })
  523. that.invoice.invoice = false
  524. if(!that.go_map && !that.orderPay){
  525. that.getaddressInfo();
  526. }
  527. // this.getaddressInfo();
  528. // let pages = getCurrentPages();
  529. // let currPage = pages[pages.length - 1]; //当前页面
  530. // if (currPage.data.storeItem) {
  531. // let json = currPage.data.storeItem;
  532. // this.$set(this, 'system_store', json);
  533. // }
  534. },
  535. /**
  536. * 生命周期函数--监听页面隐藏
  537. */
  538. // onHide: function() {
  539. // console.log(999);
  540. // this.isClose = true
  541. // },
  542. methods: {
  543. /*预售协议*/
  544. getPresellAgree: function() {
  545. presellAgreement().then(res => {
  546. this.protocol = res.data.sys_product_presell_agree;
  547. })
  548. },
  549. changeIsAgree: function(e) {
  550. this.isAgree = !this.isAgree;
  551. },
  552. // 获取个人信息
  553. getUserInfo() {
  554. getUserInfo().then(res => {
  555. console.log(res,"+++++++++++++++userInfo")
  556. this.userInfo = res.data
  557. })
  558. },
  559. /**
  560. * 授权回调事件
  561. *
  562. */
  563. onLoadFun: function() {
  564. this.isShowAuth = false;
  565. this.getaddressInfo();
  566. this.getUserInfo();
  567. //调用子页面方法授权后执行获取地址列表
  568. // this.$scope.selectComponent('#address-window').getAddressList();
  569. },
  570. /**
  571. * 获取门店列表数据
  572. */
  573. getList: function() {
  574. let longitude = uni.getStorageSync("CACHE_LONGITUDE"); //经度
  575. let latitude = uni.getStorageSync("CACHE_LATITUDE"); //纬度
  576. let data = {
  577. latitude: latitude, //纬度
  578. longitude: longitude, //经度
  579. page: 1,
  580. limit: 10
  581. }
  582. storeListApi(data).then(res => {
  583. console.log(res)
  584. let list = res.data.list.list || [];
  585. this.$set(this, 'storeList', list);
  586. this.$set(this, 'system_store', list[0]);
  587. }).catch(err => {})
  588. },
  589. // 关闭地址弹窗;
  590. changeClose: function() {
  591. this.$set(this.address, 'address', false);
  592. },
  593. // 关闭发票弹窗
  594. changeInvoiceClose: function(data) {
  595. this.getInvoiceData(data);
  596. this.$set(this.invoice, 'invoice', false);
  597. },
  598. getInvoiceData(selectedData) {
  599. this.invoiceData = {}
  600. if (selectedData) {
  601. this.cartInfo.forEach((item, i) => {
  602. if (item.mer_id == selectedData.mer_id) {
  603. if (this.cartInfo[i]['invoiceData']) {
  604. this.cartInfo[i]['invoiceData'] = selectedData
  605. } else {
  606. this.$set(this.cartInfo[i], 'invoiceData', selectedData)
  607. }
  608. }
  609. let mer_id = selectedData.mer_id
  610. this.invoiceData[mer_id] = selectedData;
  611. });
  612. } else {
  613. this.cartInfo.forEach((item, i) => {
  614. this.$set(this.cartInfo[i], 'invoiceData', {})
  615. });
  616. }
  617. console.log(this.invoiceData)
  618. },
  619. getInvoiceDatas(selectedData) {
  620. this.invoiceData = {}
  621. if (selectedData.length) {
  622. this.cartInfo.forEach((item, i) => {
  623. selectedData.forEach((val, j) => {
  624. if (item.mer_id == val.mer_id) {
  625. if (this.cartInfo[i]['invoiceData']) {
  626. this.cartInfo[i]['invoiceData'] = val
  627. } else {
  628. this.$set(this.cartInfo[i], 'invoiceData', val)
  629. }
  630. }
  631. let mer_id = val.mer_id
  632. this.invoiceData[mer_id] = val;
  633. })
  634. });
  635. } else {
  636. this.cartInfo.forEach((item, i) => {
  637. this.$set(this.cartInfo[i], 'invoiceData', {})
  638. });
  639. }
  640. console.log(this.invoiceData)
  641. },
  642. /*
  643. * 跳转门店列表
  644. */
  645. showStoreList: function() {
  646. let _this = this
  647. if (this.storeList.length > 0) {
  648. uni.navigateTo({
  649. url: '/pages/users/goods_details_store/index'
  650. })
  651. }
  652. },
  653. // 进店
  654. goStore: function(id) {
  655. if (this.hide_mer_status != 1) {
  656. uni.navigateTo({
  657. url: `/pages/store/home/index?id=${id}`
  658. })
  659. }
  660. },
  661. computedPrice: function() {
  662. let shippingType = this.shippingType;
  663. /*postOrderComputed(this.orderKey, {
  664. addressId: this.addressId,
  665. useIntegral: this.useIntegral ? 1 : 0,
  666. couponId: this.couponId,
  667. shipping_type: parseInt(shippingType) + 1,
  668. payType: this.payType
  669. }).then(res => {
  670. let result = res.data.result;
  671. if (result) {
  672. this.totalPrice = result.pay_price;
  673. this.integral_price = result.deduction_price;
  674. this.coupon_price = result.coupon_price;
  675. this.integral = this.useIntegral ? result.SurplusIntegral : this.userInfo.integral;
  676. this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
  677. }
  678. })*/
  679. },
  680. addressType: function(e) {
  681. let index = e;
  682. this.shippingType = parseInt(index);
  683. this.computedPrice();
  684. if (index == 1) this.getList();
  685. },
  686. bindPickerChange: function(e) {
  687. let value = e.detail.value;
  688. this.shippingType = value;
  689. this.computedPrice();
  690. },
  691. ChangCouponsClone: function() {
  692. this.$set(this.coupon, 'status', false);
  693. },
  694. changeTextareaStatus: function() {
  695. for (let i = 0, len = this.coupon.list.length; i < len; i++) {
  696. this.coupon.list[i].use_title = '';
  697. this.coupon.list[i].is_use = 0;
  698. }
  699. this.textareaStatus = true;
  700. this.status = 0;
  701. this.$set(this.coupon, 'list', this.coupon.list);
  702. },
  703. /**
  704. * 处理点击优惠券后的事件
  705. *
  706. */
  707. ChangCoupons: function(data) {
  708. // this.coupon_price = data.order.coupon_price;
  709. // this.$set(this,'coupon_price',data.order.coupon_price);
  710. // let tempTotal = 0
  711. this.cartInfo.forEach((item, index) => {
  712. if (item.mer_id == data.mer_id) {
  713. this.$set(this.cartInfo, index, data)
  714. }
  715. console.log(item.order.pay_price, 'item.order.pay_price')
  716. })
  717. // this.subCoupon = data
  718. this.$set(this.coupon, 'status', false);
  719. this.couponNum()
  720. },
  721. // 计算优惠券抵扣
  722. couponNum() {
  723. let tempTotal = 0,
  724. tempCouponNum = 0
  725. this.cartInfo.forEach((item, index) => {
  726. tempCouponNum = this.$util.$h.Add(tempCouponNum, item.order.coupon_price)
  727. tempTotal = this.$util.$h.Add(tempTotal, item.order.pay_price)
  728. })
  729. this.coupon_price = tempCouponNum
  730. if (this.order_type == 2 && this.coupon.list[0].productPresell.presell_type == 2) {
  731. return
  732. }
  733. this.totalPrice = tempTotal
  734. },
  735. /**
  736. * 使用积分抵扣
  737. */
  738. ChangeIntegral: function() {
  739. this.useIntegral = !this.useIntegral;
  740. this.computedPrice();
  741. },
  742. /**
  743. * 选择地址后改变事件
  744. * @param object e
  745. */
  746. OnChangeAddress: function(e) {
  747. console.log(e, 'zouni')
  748. this.textareaStatus = true;
  749. this.addressId = e;
  750. this.address.address = false;
  751. this.getaddressInfo();
  752. this.computedPrice();
  753. },
  754. bindHideKeyboard: function(e) {
  755. this.mark = e.detail.value;
  756. },
  757. /**
  758. * 获取当前订单详细信息
  759. *
  760. */
  761. getConfirm: function(address_id) {
  762. console.log(address_id, 'address_id')
  763. let that = this;
  764. let tempObj = {}
  765. orderConfirm({
  766. cart_id: that.cartId.split(","),
  767. address_id: address_id
  768. }).then(res => {
  769. let conponNum = 0
  770. // 默认选中
  771. res.data.order.forEach(el => {
  772. el.isTake = 0
  773. tempObj = that.subCoupon[el.mer_id] = {}
  774. tempObj.product = []
  775. tempObj.store = ''
  776. tempObj.product = el.order.use_coupon_product
  777. conponNum = that.$util.$h.Add(conponNum, el.order.coupon_price);
  778. el.coupon.forEach(coupon => {
  779. if (coupon.coupon.type == 0 && coupon.checked) {
  780. tempObj.store = coupon.coupon_user_id
  781. }
  782. })
  783. })
  784. that.$set(that, 'cartInfo', res.data.order);
  785. that.$set(that, 'order_type', res.data.order_type);
  786. that.totalPrice = res.data.order_price
  787. that.orderStatus = res.data.status
  788. that.proPrice = res.data.total_price
  789. that.coupon_price = conponNum
  790. if (res.data.order_type === 2) {
  791. this.getPresellAgree()
  792. }
  793. that.coupon_price = conponNum
  794. that.order_type = res.data.order_type
  795. uni.getStorage({
  796. key:"invoice_Data",
  797. success: function (res) {
  798. that.addInvoice = res.data;
  799. if(res.data){
  800. that.getInvoiceDatas(res.data)
  801. }
  802. }
  803. })
  804. }).catch(err => {
  805. return this.$util.Tips({
  806. title: err
  807. }, {
  808. tab: 3,
  809. url: 1
  810. });
  811. });
  812. },
  813. /*
  814. * 提取砍价和拼团id
  815. */
  816. getBargainId: function() {
  817. let that = this;
  818. let cartINfo = that.cartInfo;
  819. let BargainId = 0;
  820. let combinationId = 0;
  821. cartINfo.forEach(function(value, index, cartINfo) {
  822. BargainId = cartINfo[index].bargain_id,
  823. combinationId = cartINfo[index].combination_id
  824. })
  825. that.$set(that, 'BargainId', parseInt(BargainId));
  826. that.$set(that, 'combinationId', parseInt(combinationId));
  827. if (that.cartArr.length == 3 && (BargainId || combinationId || that.seckillId)) {
  828. that.cartArr[2].payStatus = 0;
  829. that.$set(that, 'cartArr', that.cartArr);
  830. }
  831. },
  832. /**
  833. * 获取当前金额可用优惠券
  834. *
  835. */
  836. getCouponList: function() {
  837. let that = this;
  838. let data = {
  839. cartId: this.cartId
  840. }
  841. getCouponsOrderPrice(this.totalPrice, data).then(res => {
  842. that.$set(that.coupon, 'list', res.data);
  843. that.openType = 1;
  844. });
  845. },
  846. /*
  847. * 获取默认收货地址或者获取某条地址信息
  848. */
  849. getaddressInfo: function() {
  850. let that = this;
  851. if (that.addressId) {
  852. getAddressDetail(that.addressId).then(res => {
  853. res.data.is_default = parseInt(res.data.is_default);
  854. that.addressInfo = res.data || {};
  855. that.addressId = res.data.address_id || 0;
  856. that.address.addressId = res.data.address_id || 0;
  857. this.getConfirm(that.addressId);
  858. })
  859. } else {
  860. getAddressList().then(res => {
  861. that.addressInfo = res.data.list.length > 0 ? res.data.list[0] : {};
  862. that.addressId = res.data.list.length > 0 ? res.data.list[0].address_id : 0;
  863. that.address.addressId = res.data.list.length > 0 ? res.data.list[0].address_id : 0;
  864. this.getConfirm(that.addressId);
  865. })
  866. }
  867. },
  868. payItem: function(e) {
  869. let that = this;
  870. let active = e;
  871. that.active = active;
  872. that.animated = true;
  873. that.payType = that.cartArr[active].value;
  874. if (that.payType == 'weixin') {
  875. that.payType = that.from
  876. }
  877. // that.computedPrice();
  878. // setTimeout(function() {
  879. // that.car();
  880. // }, 500);
  881. },
  882. couponTap: function(item, index) {
  883. this.coupon = item
  884. this.$set(this.coupon, 'status', true)
  885. this.couponIndex = index
  886. // this.coupon.status = true;
  887. },
  888. car: function() {
  889. let that = this;
  890. that.animated = false;
  891. },
  892. onAddress: function() {
  893. console.log("555555555555")
  894. let that = this;
  895. that.textareaStatus = false;
  896. that.address.address = true;
  897. that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId +
  898. '&couponId=' + this.couponId;
  899. },
  900. /**
  901. * 开发票
  902. */
  903. goInvoice: function(id) {
  904. let that = this;
  905. that.invoice.invoice = true;
  906. that.invoice.mer_id = id;
  907. this.$refs.addInvoicing.getInvoiceDefault();
  908. this.$refs.addInvoicing.getInvoiceList();
  909. },
  910. realName: function(e) {
  911. this.contacts = e.detail.value;
  912. },
  913. phone: function(e) {
  914. this.contactsTel = e.detail.value;
  915. },
  916. payment: function(data) {
  917. console.log(data, 'data')
  918. let that = this;
  919. orderCreate(data).then(res => {
  920. let status = res.data.status,
  921. orderId = res.data.result.order_id,
  922. callback_key = res.data.result.pay_key,
  923. jsConfig = res.data.result.config,
  924. goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message;
  925. console.log(jsConfig,'jsConfig+++++++++')
  926. that.orderPay = true;
  927. switch (status) {
  928. case 'ORDER_EXIST':
  929. case 'EXTEND_ORDER':
  930. case 'PAY_ERROR':
  931. case 'error':
  932. uni.hideLoading();
  933. return that.$util.Tips({
  934. title: res.msg
  935. }, {
  936. tab: 5,
  937. url: goPages
  938. });
  939. break;
  940. case 'success':
  941. uni.hideLoading();
  942. if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
  943. return that.$util.Tips({
  944. title: res.msg,
  945. icon: 'success'
  946. }, {
  947. tab: 4,
  948. url: goPages
  949. });
  950. return that.$util.Tips({
  951. title: res.msg,
  952. icon: 'success'
  953. }, {
  954. tab: 5,
  955. url: goPages
  956. });
  957. break;
  958. case 'alipay':
  959. case "alipayQr":
  960. uni.hideLoading();
  961. this.$emit('onChangeFun', {
  962. action: 'payClose'
  963. });
  964. uni.navigateTo({
  965. url: '/pages/order_pay_back/index?keyCode='+callback_key+'&url='+jsConfig
  966. })
  967. return;
  968. break;
  969. // #ifndef MP
  970. case "wechat":
  971. case "weixin":
  972. jsConfig.timeStamp = jsConfig.timestamp;
  973. this.$wechat.pay(jsConfig).then(res => {
  974. console.log('测试支付数据无效的success:' + res.data)
  975. return that.$util.Tips({
  976. title: res.message,
  977. icon: 'success'
  978. }, {
  979. tab: 4,
  980. url: goPages
  981. });
  982. }).catch(res => {
  983. console.log('测试支付数据无效的catch:' + res.data)
  984. if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
  985. title: '取消支付'
  986. }, {
  987. tab: 5,
  988. url: goPages + '&status=0'
  989. });
  990. })
  991. break;
  992. // #endif
  993. // #ifdef MP
  994. case "routine":
  995. jsConfig.timeStamp = jsConfig.timestamp;
  996. that.toPay = true;
  997. uni.requestPayment({
  998. ...jsConfig,
  999. success: function(res) {
  1000. uni.hideLoading();
  1001. if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
  1002. return that.$util.Tips({
  1003. title: '支付成功',
  1004. icon: 'success'
  1005. }, {
  1006. tab: 4,
  1007. url: goPages
  1008. });
  1009. return that.$util.Tips({
  1010. title: '支付成功',
  1011. icon: 'success'
  1012. }, {
  1013. tab: 5,
  1014. url: goPages
  1015. });
  1016. },
  1017. fail: function(e) {
  1018. uni.hideLoading();
  1019. let pages = '/pages/order_pay_status/index?order_id=' + orderId+'&msg=取消支付'
  1020. return that.$util.Tips({
  1021. title: '取消支付'
  1022. }, {
  1023. tab: 5,
  1024. url: pages + '&status=0'
  1025. });
  1026. },
  1027. })
  1028. break;
  1029. // #endif
  1030. case "balance":
  1031. uni.hideLoading();
  1032. //余额不足
  1033. return that.$util.Tips({
  1034. title: res.msg
  1035. }, {
  1036. tab: 5,
  1037. url: goPages + '&status=1'
  1038. });
  1039. break;
  1040. // #ifdef H5
  1041. case 'h5':
  1042. let host = window.location.protocol + "//" + window.location.host;
  1043. let url = `${host}/pages/order_pay_status/index?order_id=${orderId}`
  1044. let eUrl = encodeURIComponent(url)
  1045. let locations = `${jsConfig.mweb_url}&redirect_url=${eUrl}`
  1046. setTimeout(() => {
  1047. location.href = locations;
  1048. }, 100);
  1049. break;
  1050. // #endif
  1051. }
  1052. }).catch(err => {
  1053. uni.hideLoading();
  1054. return that.$util.Tips({
  1055. title: err
  1056. });
  1057. });
  1058. },
  1059. isEmojiCharacter: function(substring) {
  1060. if (substring) {
  1061. // var reg = new RegExp("[~#^$@%&!?%*]", 'g');
  1062. // if (substring.match(reg)) {
  1063. // return true;
  1064. // }
  1065. for (var i = 0; i < substring.length; i++) {
  1066. var hs = substring.charCodeAt(i);
  1067. if (0xd800 <= hs && hs <= 0xdbff) {
  1068. if (substring.length > 1) {
  1069. var ls = substring.charCodeAt(i + 1);
  1070. var uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
  1071. if (0x1d000 <= uc && uc <= 0x1f77f) {
  1072. return true;
  1073. }
  1074. }
  1075. } else if (substring.length > 1) {
  1076. var ls = substring.charCodeAt(i + 1);
  1077. if (ls == 0x20e3) {
  1078. return true;
  1079. }
  1080. } else {
  1081. if (0x2100 <= hs && hs <= 0x27ff) {
  1082. return true;
  1083. } else if (0x2B05 <= hs && hs <= 0x2b07) {
  1084. return true;
  1085. } else if (0x2934 <= hs && hs <= 0x2935) {
  1086. return true;
  1087. } else if (0x3297 <= hs && hs <= 0x3299) {
  1088. return true;
  1089. } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 ||
  1090. hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b ||
  1091. hs == 0x2b50) {
  1092. return true;
  1093. }
  1094. }
  1095. }
  1096. }
  1097. },
  1098. SubOrder: function(e) {
  1099. this.payType="h5"
  1100. let that = this,
  1101. data = {};
  1102. if (!that.payType) return that.$util.Tips({
  1103. title: '请选择支付方式'
  1104. });
  1105. if (!that.addressId && !that.shippingType) return that.$util.Tips({
  1106. title: '请选择收货地址'
  1107. });
  1108. if (that.orderStatus != 'finish') {
  1109. return that.$util.Tips({
  1110. title: '收货地址不在配送区域'
  1111. });
  1112. }
  1113. if (that.orderStatus == 'noDeliver') {
  1114. return that.$util.Tips({
  1115. title: '暂不发货'
  1116. });
  1117. }
  1118. if (that.order_type == 2 && !that.isAgree && that.cartInfo[0].list[0].productPresell.presell_type == 2) {
  1119. return that.$util.Tips({
  1120. title: '请阅读并勾选协议,否则无法进行操作'
  1121. });
  1122. }
  1123. let tempObj = {}
  1124. let conponNum = 0
  1125. // 默认选中
  1126. that.cartInfo.forEach(el => {
  1127. // el.isTake = 0
  1128. tempObj = that.subCoupon[el.mer_id] = {}
  1129. tempObj.product = []
  1130. tempObj.store = ''
  1131. tempObj.product = el.order.use_coupon_product
  1132. conponNum = that.$util.$h.Add(conponNum, el.order.coupon_price);
  1133. el.coupon.forEach(coupon => {
  1134. if (coupon.coupon.type == 0 && coupon.checked) {
  1135. tempObj.store = coupon.coupon_user_id
  1136. }
  1137. })
  1138. })
  1139. data = {
  1140. cart_id: this.cartId.split(","),
  1141. address_id: this.addressId,
  1142. coupon: this.subCoupon,
  1143. pay_type: this.payType,
  1144. mark: this.msgObj,
  1145. order_type: this.order_type,
  1146. take: [],
  1147. receipt_data: this.invoiceData,
  1148. // #ifdef H5
  1149. return_url: 'http://' + window.location.host + '/pages/users/order_list/index',
  1150. // #endif
  1151. };
  1152. if (data.mark && this.isEmojiCharacter(data.mark[Object.keys(data.mark)[0]])) {
  1153. that.$util.Tips({
  1154. title: '备注不允许输入表情!'
  1155. });
  1156. return;
  1157. }
  1158. this.cartInfo.map(el => {
  1159. if (el.isTake == 1) {
  1160. data.take.push(el.mer_id)
  1161. }
  1162. })
  1163. console.log(data, 'data')
  1164. if (data.payType == 'balance' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice)) return that.$util
  1165. .Tips({
  1166. title: '余额不足!'
  1167. });
  1168. uni.showLoading({
  1169. title: '订单支付中',
  1170. mask: true
  1171. });
  1172. // #ifdef MP
  1173. openPaySubscribe().then(() => {
  1174. that.payment(data);
  1175. });
  1176. // #endif
  1177. // #ifndef MP
  1178. that.payment(data);
  1179. // #endif
  1180. },
  1181. // 打开配送方式弹窗
  1182. openShowBox(item, index) {
  1183. this.activeObj = item
  1184. this.activeIndex = index
  1185. this.isShowBox = true
  1186. },
  1187. boxClose() {
  1188. this.isShowBox = false
  1189. },
  1190. getData(data) {
  1191. let self = this
  1192. let freePostage = 0 //没有邮费总价
  1193. let Postage = 0 //有邮费总价
  1194. this.cartInfo[this.activeIndex] = data
  1195. this.cartInfo.map(el => {
  1196. if (el.isTake == 1) {
  1197. freePostage = self.$util.$h.Add(freePostage, el.order.org_price)
  1198. } else {
  1199. Postage = self.$util.$h.Add(Postage, el.order.pay_price)
  1200. }
  1201. })
  1202. this.totalPrice = self.$util.$h.Add(freePostage, Postage)
  1203. this.isShowBox = false
  1204. },
  1205. //查看内置地图
  1206. goMap(item) {
  1207. let that = this;
  1208. uni.openLocation({
  1209. latitude: Number(item.take.mer_take_location[0]),
  1210. longitude: Number(item.take.mer_take_location[1]),
  1211. success: function() {
  1212. that.go_map = true
  1213. }
  1214. });
  1215. }
  1216. }
  1217. }
  1218. </script>
  1219. <style lang="scss" scoped>
  1220. .order-submission .line {
  1221. position: absolute;
  1222. left: 0;
  1223. top: 0;
  1224. width: 100%;
  1225. height: 3rpx;
  1226. }
  1227. .order-submission .line image {
  1228. width: 100%;
  1229. height: 100%;
  1230. display: block;
  1231. }
  1232. .order-submission .address {
  1233. padding: 28rpx 30rpx;
  1234. background-color: #fff;
  1235. box-sizing: border-box;
  1236. }
  1237. .order-submission .address .addressCon {
  1238. width: 610rpx;
  1239. font-size: 26rpx;
  1240. color: #666;
  1241. }
  1242. .order-submission .address .addressCon .name {
  1243. font-size: 30rpx;
  1244. color: #282828;
  1245. font-weight: bold;
  1246. margin-bottom: 10rpx;
  1247. }
  1248. .order-submission .address .addressCon .name .phone {
  1249. margin-left: 50rpx;
  1250. }
  1251. .order-submission .address .addressCon .default {
  1252. margin-right: 12rpx;
  1253. }
  1254. .order-submission .address .addressCon .setaddress {
  1255. color: #333;
  1256. font-size: 28rpx;
  1257. }
  1258. .order-submission .address .iconfont {
  1259. font-size: 35rpx;
  1260. color: #707070;
  1261. }
  1262. .order-submission .allAddress {
  1263. width: 100%;
  1264. }
  1265. .order-submission .allAddress .nav {
  1266. width: 710rpx;
  1267. margin: 0 auto;
  1268. }
  1269. .order-submission .allAddress .nav .item {
  1270. width: 355rpx;
  1271. }
  1272. .order-submission .allAddress .nav .item.on {
  1273. position: relative;
  1274. width: 250rpx;
  1275. }
  1276. .order-submission .allAddress .nav .item.on::before {
  1277. position: absolute;
  1278. bottom: 0;
  1279. content: "快递配送";
  1280. font-size: 28rpx;
  1281. display: block;
  1282. height: 0;
  1283. width: 336rpx;
  1284. border-width: 0 20rpx 80rpx 0;
  1285. border-style: none solid solid;
  1286. border-color: transparent transparent #fff;
  1287. z-index: 2;
  1288. border-radius: 7rpx 30rpx 0 0;
  1289. text-align: center;
  1290. line-height: 80rpx;
  1291. }
  1292. .order-submission .allAddress .nav .item:nth-of-type(2).on::before {
  1293. content: "到店自提";
  1294. border-width: 0 0 80rpx 20rpx;
  1295. border-radius: 30rpx 7rpx 0 0;
  1296. }
  1297. .order-submission .allAddress .nav .item.on2 {
  1298. position: relative;
  1299. }
  1300. .order-submission .allAddress .nav .item.on2::before {
  1301. position: absolute;
  1302. bottom: 0;
  1303. content: "到店自提";
  1304. font-size: 28rpx;
  1305. display: block;
  1306. height: 0;
  1307. width: 400rpx;
  1308. border-width: 0 0 60rpx 60rpx;
  1309. border-style: none solid solid;
  1310. border-color: transparent transparent #f7c1bd;
  1311. border-radius: 40rpx 6rpx 0 0;
  1312. text-align: center;
  1313. line-height: 60rpx;
  1314. }
  1315. .order-submission .allAddress .nav .item:nth-of-type(1).on2::before {
  1316. content: "快递配送";
  1317. border-width: 0 60rpx 60rpx 0;
  1318. border-radius: 6rpx 40rpx 0 0;
  1319. }
  1320. .order-submission .allAddress .address {
  1321. height: 150rpx;
  1322. margin: 0 auto;
  1323. }
  1324. .order-submission .allAddress .line {
  1325. margin: 0 auto;
  1326. }
  1327. .order-submission .wrapper .item .discount .placeholder {
  1328. color: #ccc;
  1329. }
  1330. .order-submission .wrapper {
  1331. margin-bottom: 12rpx;
  1332. background-color: #fff;
  1333. }
  1334. .order-submission .wrapper .item {
  1335. padding: 27rpx 30rpx;
  1336. font-size: 30rpx;
  1337. color: #282828;
  1338. }
  1339. .order-submission .wrapper .item .discount {
  1340. font-size: 30rpx;
  1341. color: #999;
  1342. &.discount_voice {
  1343. overflow: hidden;
  1344. text-overflow: ellipsis;
  1345. white-space: nowrap;
  1346. width: 500rpx;
  1347. text-align: right;
  1348. }
  1349. }
  1350. .order-submission .wrapper .item .discount .iconfont {
  1351. color: #515151;
  1352. font-size: 30rpx;
  1353. margin-left: 15rpx;
  1354. }
  1355. .order-submission .wrapper .item .discount .num {
  1356. font-size: 32rpx;
  1357. margin-right: 20rpx;
  1358. }
  1359. .order-submission .wrapper .item .shipping {
  1360. font-size: 30rpx;
  1361. color: #999;
  1362. position: relative;
  1363. padding-right: 58rpx;
  1364. }
  1365. .order-submission .wrapper .item .shipping .iconfont {
  1366. font-size: 35rpx;
  1367. color: #707070;
  1368. position: absolute;
  1369. right: 0;
  1370. top: 50%;
  1371. transform: translateY(-50%);
  1372. margin-left: 30rpx;
  1373. }
  1374. .order-submission .wrapper .item input {
  1375. display: flex;
  1376. flex: 1;
  1377. height: 100%;
  1378. margin-left: 20rpx;
  1379. }
  1380. .order-submission .wrapper .item .placeholder {
  1381. color: #ccc;
  1382. }
  1383. .order-submission .wrapper .item .list {
  1384. margin-top: 35rpx;
  1385. }
  1386. .order-submission .wrapper .item .list .payItem {
  1387. border: 1px solid #eee;
  1388. border-radius: 6rpx;
  1389. height: 86rpx;
  1390. width: 100%;
  1391. box-sizing: border-box;
  1392. margin-top: 20rpx;
  1393. font-size: 28rpx;
  1394. color: #282828;
  1395. }
  1396. .order-submission .wrapper .item .list .payItem.on {
  1397. border-color: #fc5445;
  1398. color: #e93323;
  1399. }
  1400. .order-submission .wrapper .item .list .payItem .name {
  1401. width: 50%;
  1402. text-align: center;
  1403. border-right: 1px solid #eee;
  1404. justify-content: left;
  1405. padding-left: 80rpx;
  1406. }
  1407. .order-submission .wrapper .item .list .payItem .name .iconfont {
  1408. width: 44rpx;
  1409. height: 44rpx;
  1410. border-radius: 50%;
  1411. text-align: center;
  1412. line-height: 44rpx;
  1413. background-color: #fe960f;
  1414. color: #fff;
  1415. font-size: 30rpx;
  1416. margin-right: 15rpx;
  1417. }
  1418. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
  1419. background-color: #41b035;
  1420. }
  1421. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
  1422. background-color: #4295D5;
  1423. }
  1424. .order-submission .wrapper .item .list .payItem .tip {
  1425. width: 49%;
  1426. text-align: center;
  1427. font-size: 26rpx;
  1428. color: #aaa;
  1429. }
  1430. .order-submission .moneyList {
  1431. margin-top: 12rpx;
  1432. background-color: #fff;
  1433. padding: 30rpx;
  1434. }
  1435. .order-submission .moneyList .item {
  1436. font-size: 28rpx;
  1437. color: #282828;
  1438. }
  1439. .order-submission .moneyList .item~.item {
  1440. margin-top: 20rpx;
  1441. }
  1442. .order-submission .moneyList .item .money {
  1443. color: #868686;
  1444. }
  1445. .order-submission .footer {
  1446. width: 100%;
  1447. height: 100rpx;
  1448. background-color: #fff;
  1449. padding: 0 30rpx;
  1450. font-size: 28rpx;
  1451. color: #333;
  1452. box-sizing: border-box;
  1453. position: fixed;
  1454. bottom: 0;
  1455. left: 0;
  1456. }
  1457. .order-submission .footer .settlement {
  1458. font-size: 30rpx;
  1459. color: #fff;
  1460. width: 240rpx;
  1461. height: 70rpx;
  1462. background-color: #e93323;
  1463. border-radius: 50rpx;
  1464. text-align: center;
  1465. line-height: 70rpx;
  1466. &.disabled {
  1467. background-color: #cccccc;
  1468. }
  1469. }
  1470. .footer .transparent {
  1471. opacity: 0
  1472. }
  1473. .event_bg {
  1474. background: #FF7F00;
  1475. }
  1476. .event_color {
  1477. color: #FF7F00;
  1478. }
  1479. .color_red {
  1480. color: #E93323;
  1481. }
  1482. .storeinfo-wrapper {
  1483. .store-item {
  1484. margin-top: 12rpx;
  1485. background-color: #fff;
  1486. .store-title {
  1487. display: flex;
  1488. align-items: center;
  1489. padding: 28rpx 30rpx;
  1490. .icon-shangjiadingdan {
  1491. font-size: 32rpx;
  1492. }
  1493. .icon-xiangyou {
  1494. font-size: 26rpx;
  1495. color: #999;
  1496. }
  1497. .txt {
  1498. margin: 0 8rpx;
  1499. }
  1500. }
  1501. .product-item {
  1502. display: flex;
  1503. padding: 25rpx 30rpx;
  1504. border-top: 1px solid #F0F0F0;
  1505. .img-box {
  1506. width: 130rpx;
  1507. height: 130rpx;
  1508. image {
  1509. width: 130rpx;
  1510. height: 130rpx;
  1511. border-radius: 16rpx;
  1512. }
  1513. }
  1514. .content {
  1515. position: relative;
  1516. width: 550rpx;
  1517. margin-left: 30rpx;
  1518. font-size: 28rpx;
  1519. color: #282828;
  1520. &.event_content {
  1521. .line1 {
  1522. width: 360rpx;
  1523. }
  1524. .price {
  1525. position: absolute;
  1526. top: 0;
  1527. right: 0;
  1528. margin-top: 0;
  1529. text {
  1530. display: block;
  1531. text-align: right;
  1532. }
  1533. }
  1534. }
  1535. .event_name {
  1536. display: inline-block;
  1537. margin-right: 9rpx;
  1538. color: #fff;
  1539. font-size: 20rpx;
  1540. padding: 0 8rpx;
  1541. line-height: 30rpx;
  1542. text-align: center;
  1543. border-radius: 6rpx;
  1544. }
  1545. .event_ship {
  1546. font-size: 20rpx;
  1547. margin-top: 10rpx;
  1548. }
  1549. .label {
  1550. margin-top: 10rpx;
  1551. color: #868686;
  1552. font-size: 20rpx;
  1553. }
  1554. .price {
  1555. margin-top: 20rpx;
  1556. color: $theme-color;
  1557. text {
  1558. margin-left: 10rpx;
  1559. color: #999;
  1560. }
  1561. }
  1562. .err-txt {
  1563. display: flex;
  1564. align-items: center;
  1565. margin-top: 18rpx;
  1566. color: $theme-color;
  1567. .iconfont {
  1568. margin-right: 10rpx;
  1569. }
  1570. }
  1571. .step {
  1572. position: absolute;
  1573. right: 0;
  1574. top: 100rpx;
  1575. display: flex;
  1576. align-items: center;
  1577. .min {
  1578. width: 50rpx;
  1579. height: 40rpx;
  1580. background-image: url('~@/static/images/min.png');
  1581. background-size: 17rpx 17rpx;
  1582. background-position: center;
  1583. background-repeat: no-repeat;
  1584. }
  1585. .num-box {
  1586. width: 68rpx;
  1587. height: 40rpx;
  1588. line-height: 40rpx;
  1589. text-align: center;
  1590. background: #F2F2F2;
  1591. font-size: 23rpx;
  1592. }
  1593. .add {
  1594. width: 50rpx;
  1595. height: 40rpx;
  1596. background-image: url('~@/static/images/add.png');
  1597. background-size: 17rpx 17rpx;
  1598. background-position: center;
  1599. background-repeat: no-repeat;
  1600. }
  1601. }
  1602. }
  1603. }
  1604. }
  1605. .event_payTime {
  1606. padding: 0 30rpx 24rpx;
  1607. .event_progress {
  1608. margin-top: 50rpx;
  1609. position: relative;
  1610. }
  1611. .progress_step {
  1612. height: 80rpx;
  1613. position: relative;
  1614. padding-left: 60rpx;
  1615. &::before {
  1616. content: '';
  1617. display: block;
  1618. width: 2rpx;
  1619. height: 40rpx;
  1620. background: #E93323;
  1621. position: absolute;
  1622. left: 35rpx;
  1623. top: 18rpx;
  1624. }
  1625. &:nth-child(2) {
  1626. &::before {
  1627. bottom: 64rpx;
  1628. top: auto;
  1629. background: #EFEFEF;
  1630. }
  1631. &::after {
  1632. background: #EFEFEF;
  1633. }
  1634. }
  1635. &::after {
  1636. content: '';
  1637. display: block;
  1638. width: 14rpx;
  1639. height: 14rpx;
  1640. background: #E93323;
  1641. border-radius: 50%;
  1642. position: absolute;
  1643. top: 10rpx;
  1644. left: 29rpx;
  1645. }
  1646. .name {
  1647. float: left;
  1648. color: #282828;
  1649. &.color_red {
  1650. color: #E93323;
  1651. }
  1652. }
  1653. .price {
  1654. float: right;
  1655. color: #282828;
  1656. &.color_red {
  1657. color: #E93323;
  1658. }
  1659. }
  1660. }
  1661. .progress_pay {
  1662. padding-left: 60rpx;
  1663. font-size: 24rpx;
  1664. color: #868686;
  1665. margin-top: -34rpx;
  1666. }
  1667. }
  1668. }
  1669. uni-checkbox-group,
  1670. .checkgroup {
  1671. width: 100%;
  1672. .checkbox {
  1673. float: right;
  1674. }
  1675. }
  1676. .icon-wenhao1 {
  1677. color: #868686;
  1678. margin-right: 6rpx;
  1679. }
  1680. .total {
  1681. display: flex;
  1682. justify-content: flex-end;
  1683. padding-right: 30rpx;
  1684. padding-bottom: 30rpx;
  1685. font-size: 26rpx;
  1686. color: #282828;
  1687. .price {
  1688. margin-left: 10rpx;
  1689. color: $theme-color;
  1690. font-size: 28rpx;
  1691. font-weight: bold;
  1692. text {
  1693. font-size: 20rpx;
  1694. }
  1695. }
  1696. }
  1697. .store-address {
  1698. padding: 30rpx 23rpx;
  1699. margin: 0 30rpx;
  1700. background: #F6F6F6;
  1701. border-radius: 8rpx;
  1702. font-size: 24rpx;
  1703. display: -webkit-box;
  1704. display: -moz-box;
  1705. display: -ms-flexbox;
  1706. display: -webkit-flex;
  1707. display: flex;
  1708. /*垂直居中*/
  1709. -webkit-box-align: center;/*旧版本*/
  1710. -moz-box-align: center;/*旧版本*/
  1711. -ms-flex-align: center;/*混合版本*/
  1712. -webkit-align-items: center;/*新版本*/
  1713. align-items: center;/*新版本*/
  1714. .name {
  1715. width: 148rpx;
  1716. margin-right: 20rpx;
  1717. }
  1718. .info {
  1719. flex: 1;
  1720. }
  1721. .map{
  1722. text-align: center;
  1723. padding-left: 40rpx;
  1724. position: relative;
  1725. &::before{
  1726. content: '';
  1727. display: inline-block;
  1728. width: 2rpx;
  1729. height: 42rpx;
  1730. background-color: #DDDDDD;
  1731. position: absolute;
  1732. left: 0;
  1733. top: 18rpx;
  1734. }
  1735. .iconfont{
  1736. color: #E93323;
  1737. }
  1738. .map_text{
  1739. color: #E93323;
  1740. }
  1741. }
  1742. }
  1743. .settlementAgreement {
  1744. width: 100%;
  1745. height: 100%;
  1746. position: fixed;
  1747. top: 0;
  1748. left: 0;
  1749. background: rgba(0, 0, 0, .5);
  1750. z-index: 10;
  1751. }
  1752. .settlementAgreement .setAgCount {
  1753. background: #fff;
  1754. width: 656rpx;
  1755. height: 458px;
  1756. position: absolute;
  1757. top: 50%;
  1758. left: 50%;
  1759. border-radius: 12rpx;
  1760. -webkit-border-radius: 12rpx;
  1761. padding: 52rpx;
  1762. -webkit-transform: translate(-50%, -50%);
  1763. -moz-transform: translate(-50%, -50%);
  1764. transform: translate(-50%, -50%);
  1765. overflow: hidden;
  1766. .content {
  1767. height: 900rpx;
  1768. overflow-y: scroll;
  1769. /deep/ p {
  1770. font-size: 13px;
  1771. line-height: 22px;
  1772. }
  1773. /deep/ img {
  1774. max-width: 100%;
  1775. }
  1776. }
  1777. }
  1778. .settlementAgreement .setAgCount .icon {
  1779. font-size: 42rpx;
  1780. color: #b4b1b4;
  1781. position: absolute;
  1782. top: 15rpx;
  1783. right: 15rpx;
  1784. }
  1785. .settlementAgreement .setAgCount .title {
  1786. color: #333;
  1787. font-size: 32rpx;
  1788. text-align: center;
  1789. font-weight: bold;
  1790. }
  1791. .settlementAgreement .setAgCount .content {
  1792. margin-top: 32rpx;
  1793. color: #333;
  1794. font-size: 26rpx;
  1795. line-height: 22px;
  1796. text-align: justify;
  1797. text-justify: distribute-all-lines;
  1798. height: 756rpx;
  1799. overflow-y: scroll;
  1800. }
  1801. </style>