index.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936
  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. // #ifdef MP-TOUTIAO
  1100. if(this.payType !== 'balance'){
  1101. this.payType="h5"
  1102. }
  1103. // #endif
  1104. let that = this,
  1105. data = {};
  1106. if (!that.payType) return that.$util.Tips({
  1107. title: '请选择支付方式'
  1108. });
  1109. if (!that.addressId && !that.shippingType) return that.$util.Tips({
  1110. title: '请选择收货地址'
  1111. });
  1112. if (that.orderStatus != 'finish') {
  1113. return that.$util.Tips({
  1114. title: '收货地址不在配送区域'
  1115. });
  1116. }
  1117. if (that.orderStatus == 'noDeliver') {
  1118. return that.$util.Tips({
  1119. title: '暂不发货'
  1120. });
  1121. }
  1122. if (that.order_type == 2 && !that.isAgree && that.cartInfo[0].list[0].productPresell.presell_type == 2) {
  1123. return that.$util.Tips({
  1124. title: '请阅读并勾选协议,否则无法进行操作'
  1125. });
  1126. }
  1127. let tempObj = {}
  1128. let conponNum = 0
  1129. // 默认选中
  1130. that.cartInfo.forEach(el => {
  1131. // el.isTake = 0
  1132. tempObj = that.subCoupon[el.mer_id] = {}
  1133. tempObj.product = []
  1134. tempObj.store = ''
  1135. tempObj.product = el.order.use_coupon_product
  1136. conponNum = that.$util.$h.Add(conponNum, el.order.coupon_price);
  1137. el.coupon.forEach(coupon => {
  1138. if (coupon.coupon.type == 0 && coupon.checked) {
  1139. tempObj.store = coupon.coupon_user_id
  1140. }
  1141. })
  1142. })
  1143. data = {
  1144. cart_id: this.cartId.split(","),
  1145. address_id: this.addressId,
  1146. coupon: this.subCoupon,
  1147. pay_type: this.payType,
  1148. mark: this.msgObj,
  1149. order_type: this.order_type,
  1150. take: [],
  1151. receipt_data: this.invoiceData,
  1152. // #ifdef H5
  1153. return_url: 'http://' + window.location.host + '/pages/users/order_list/index',
  1154. // #endif
  1155. };
  1156. if (data.mark && this.isEmojiCharacter(data.mark[Object.keys(data.mark)[0]])) {
  1157. that.$util.Tips({
  1158. title: '备注不允许输入表情!'
  1159. });
  1160. return;
  1161. }
  1162. this.cartInfo.map(el => {
  1163. if (el.isTake == 1) {
  1164. data.take.push(el.mer_id)
  1165. }
  1166. })
  1167. console.log(data, 'data')
  1168. if (data.payType == 'balance' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice)) return that.$util
  1169. .Tips({
  1170. title: '余额不足!'
  1171. });
  1172. uni.showLoading({
  1173. title: '订单支付中',
  1174. mask: true
  1175. });
  1176. // #ifdef MP
  1177. openPaySubscribe().then(() => {
  1178. that.payment(data);
  1179. });
  1180. // #endif
  1181. // #ifndef MP
  1182. that.payment(data);
  1183. // #endif
  1184. },
  1185. // 打开配送方式弹窗
  1186. openShowBox(item, index) {
  1187. this.activeObj = item
  1188. this.activeIndex = index
  1189. this.isShowBox = true
  1190. },
  1191. boxClose() {
  1192. this.isShowBox = false
  1193. },
  1194. getData(data) {
  1195. let self = this
  1196. let freePostage = 0 //没有邮费总价
  1197. let Postage = 0 //有邮费总价
  1198. this.cartInfo[this.activeIndex] = data
  1199. this.cartInfo.map(el => {
  1200. if (el.isTake == 1) {
  1201. freePostage = self.$util.$h.Add(freePostage, el.order.org_price)
  1202. } else {
  1203. Postage = self.$util.$h.Add(Postage, el.order.pay_price)
  1204. }
  1205. })
  1206. this.totalPrice = self.$util.$h.Add(freePostage, Postage)
  1207. this.isShowBox = false
  1208. },
  1209. //查看内置地图
  1210. goMap(item) {
  1211. let that = this;
  1212. uni.openLocation({
  1213. latitude: Number(item.take.mer_take_location[0]),
  1214. longitude: Number(item.take.mer_take_location[1]),
  1215. success: function() {
  1216. that.go_map = true
  1217. }
  1218. });
  1219. }
  1220. }
  1221. }
  1222. </script>
  1223. <style lang="scss" scoped>
  1224. .order-submission .line {
  1225. position: absolute;
  1226. left: 0;
  1227. top: 0;
  1228. width: 100%;
  1229. height: 3rpx;
  1230. }
  1231. .order-submission .line image {
  1232. width: 100%;
  1233. height: 100%;
  1234. display: block;
  1235. }
  1236. .order-submission .address {
  1237. padding: 28rpx 30rpx;
  1238. background-color: #fff;
  1239. box-sizing: border-box;
  1240. }
  1241. .order-submission .address .addressCon {
  1242. width: 610rpx;
  1243. font-size: 26rpx;
  1244. color: #666;
  1245. }
  1246. .order-submission .address .addressCon .name {
  1247. font-size: 30rpx;
  1248. color: #282828;
  1249. font-weight: bold;
  1250. margin-bottom: 10rpx;
  1251. }
  1252. .order-submission .address .addressCon .name .phone {
  1253. margin-left: 50rpx;
  1254. }
  1255. .order-submission .address .addressCon .default {
  1256. margin-right: 12rpx;
  1257. }
  1258. .order-submission .address .addressCon .setaddress {
  1259. color: #333;
  1260. font-size: 28rpx;
  1261. }
  1262. .order-submission .address .iconfont {
  1263. font-size: 35rpx;
  1264. color: #707070;
  1265. }
  1266. .order-submission .allAddress {
  1267. width: 100%;
  1268. }
  1269. .order-submission .allAddress .nav {
  1270. width: 710rpx;
  1271. margin: 0 auto;
  1272. }
  1273. .order-submission .allAddress .nav .item {
  1274. width: 355rpx;
  1275. }
  1276. .order-submission .allAddress .nav .item.on {
  1277. position: relative;
  1278. width: 250rpx;
  1279. }
  1280. .order-submission .allAddress .nav .item.on::before {
  1281. position: absolute;
  1282. bottom: 0;
  1283. content: "快递配送";
  1284. font-size: 28rpx;
  1285. display: block;
  1286. height: 0;
  1287. width: 336rpx;
  1288. border-width: 0 20rpx 80rpx 0;
  1289. border-style: none solid solid;
  1290. border-color: transparent transparent #fff;
  1291. z-index: 2;
  1292. border-radius: 7rpx 30rpx 0 0;
  1293. text-align: center;
  1294. line-height: 80rpx;
  1295. }
  1296. .order-submission .allAddress .nav .item:nth-of-type(2).on::before {
  1297. content: "到店自提";
  1298. border-width: 0 0 80rpx 20rpx;
  1299. border-radius: 30rpx 7rpx 0 0;
  1300. }
  1301. .order-submission .allAddress .nav .item.on2 {
  1302. position: relative;
  1303. }
  1304. .order-submission .allAddress .nav .item.on2::before {
  1305. position: absolute;
  1306. bottom: 0;
  1307. content: "到店自提";
  1308. font-size: 28rpx;
  1309. display: block;
  1310. height: 0;
  1311. width: 400rpx;
  1312. border-width: 0 0 60rpx 60rpx;
  1313. border-style: none solid solid;
  1314. border-color: transparent transparent #f7c1bd;
  1315. border-radius: 40rpx 6rpx 0 0;
  1316. text-align: center;
  1317. line-height: 60rpx;
  1318. }
  1319. .order-submission .allAddress .nav .item:nth-of-type(1).on2::before {
  1320. content: "快递配送";
  1321. border-width: 0 60rpx 60rpx 0;
  1322. border-radius: 6rpx 40rpx 0 0;
  1323. }
  1324. .order-submission .allAddress .address {
  1325. height: 150rpx;
  1326. margin: 0 auto;
  1327. }
  1328. .order-submission .allAddress .line {
  1329. margin: 0 auto;
  1330. }
  1331. .order-submission .wrapper .item .discount .placeholder {
  1332. color: #ccc;
  1333. }
  1334. .order-submission .wrapper {
  1335. margin-bottom: 12rpx;
  1336. background-color: #fff;
  1337. }
  1338. .order-submission .wrapper .item {
  1339. padding: 27rpx 30rpx;
  1340. font-size: 30rpx;
  1341. color: #282828;
  1342. }
  1343. .order-submission .wrapper .item .discount {
  1344. font-size: 30rpx;
  1345. color: #999;
  1346. &.discount_voice {
  1347. overflow: hidden;
  1348. text-overflow: ellipsis;
  1349. white-space: nowrap;
  1350. width: 500rpx;
  1351. text-align: right;
  1352. }
  1353. }
  1354. .order-submission .wrapper .item .discount .iconfont {
  1355. color: #515151;
  1356. font-size: 30rpx;
  1357. margin-left: 15rpx;
  1358. }
  1359. .order-submission .wrapper .item .discount .num {
  1360. font-size: 32rpx;
  1361. margin-right: 20rpx;
  1362. }
  1363. .order-submission .wrapper .item .shipping {
  1364. font-size: 30rpx;
  1365. color: #999;
  1366. position: relative;
  1367. padding-right: 58rpx;
  1368. }
  1369. .order-submission .wrapper .item .shipping .iconfont {
  1370. font-size: 35rpx;
  1371. color: #707070;
  1372. position: absolute;
  1373. right: 0;
  1374. top: 50%;
  1375. transform: translateY(-50%);
  1376. margin-left: 30rpx;
  1377. }
  1378. .order-submission .wrapper .item input {
  1379. display: flex;
  1380. flex: 1;
  1381. height: 100%;
  1382. margin-left: 20rpx;
  1383. }
  1384. .order-submission .wrapper .item .placeholder {
  1385. color: #ccc;
  1386. }
  1387. .order-submission .wrapper .item .list {
  1388. margin-top: 35rpx;
  1389. }
  1390. .order-submission .wrapper .item .list .payItem {
  1391. border: 1px solid #eee;
  1392. border-radius: 6rpx;
  1393. height: 86rpx;
  1394. width: 100%;
  1395. box-sizing: border-box;
  1396. margin-top: 20rpx;
  1397. font-size: 28rpx;
  1398. color: #282828;
  1399. }
  1400. .order-submission .wrapper .item .list .payItem.on {
  1401. border-color: #fc5445;
  1402. color: #e93323;
  1403. }
  1404. .order-submission .wrapper .item .list .payItem .name {
  1405. width: 50%;
  1406. text-align: center;
  1407. border-right: 1px solid #eee;
  1408. justify-content: left;
  1409. padding-left: 80rpx;
  1410. }
  1411. .order-submission .wrapper .item .list .payItem .name .iconfont {
  1412. width: 44rpx;
  1413. height: 44rpx;
  1414. border-radius: 50%;
  1415. text-align: center;
  1416. line-height: 44rpx;
  1417. background-color: #fe960f;
  1418. color: #fff;
  1419. font-size: 30rpx;
  1420. margin-right: 15rpx;
  1421. }
  1422. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
  1423. background-color: #41b035;
  1424. }
  1425. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
  1426. background-color: #4295D5;
  1427. }
  1428. .order-submission .wrapper .item .list .payItem .tip {
  1429. width: 49%;
  1430. text-align: center;
  1431. font-size: 26rpx;
  1432. color: #aaa;
  1433. }
  1434. .order-submission .moneyList {
  1435. margin-top: 12rpx;
  1436. background-color: #fff;
  1437. padding: 30rpx;
  1438. }
  1439. .order-submission .moneyList .item {
  1440. font-size: 28rpx;
  1441. color: #282828;
  1442. }
  1443. .order-submission .moneyList .item~.item {
  1444. margin-top: 20rpx;
  1445. }
  1446. .order-submission .moneyList .item .money {
  1447. color: #868686;
  1448. }
  1449. .order-submission .footer {
  1450. width: 100%;
  1451. height: 100rpx;
  1452. background-color: #fff;
  1453. padding: 0 30rpx;
  1454. font-size: 28rpx;
  1455. color: #333;
  1456. box-sizing: border-box;
  1457. position: fixed;
  1458. bottom: 0;
  1459. left: 0;
  1460. }
  1461. .order-submission .footer .settlement {
  1462. font-size: 30rpx;
  1463. color: #fff;
  1464. width: 240rpx;
  1465. height: 70rpx;
  1466. background-color: #e93323;
  1467. border-radius: 50rpx;
  1468. text-align: center;
  1469. line-height: 70rpx;
  1470. &.disabled {
  1471. background-color: #cccccc;
  1472. }
  1473. }
  1474. .footer .transparent {
  1475. opacity: 0
  1476. }
  1477. .event_bg {
  1478. background: #FF7F00;
  1479. }
  1480. .event_color {
  1481. color: #FF7F00;
  1482. }
  1483. .color_red {
  1484. color: #E93323;
  1485. }
  1486. .storeinfo-wrapper {
  1487. .store-item {
  1488. margin-top: 12rpx;
  1489. background-color: #fff;
  1490. .store-title {
  1491. display: flex;
  1492. align-items: center;
  1493. padding: 28rpx 30rpx;
  1494. .icon-shangjiadingdan {
  1495. font-size: 32rpx;
  1496. }
  1497. .icon-xiangyou {
  1498. font-size: 26rpx;
  1499. color: #999;
  1500. }
  1501. .txt {
  1502. margin: 0 8rpx;
  1503. }
  1504. }
  1505. .product-item {
  1506. display: flex;
  1507. padding: 25rpx 30rpx;
  1508. border-top: 1px solid #F0F0F0;
  1509. .img-box {
  1510. width: 130rpx;
  1511. height: 130rpx;
  1512. image {
  1513. width: 130rpx;
  1514. height: 130rpx;
  1515. border-radius: 16rpx;
  1516. }
  1517. }
  1518. .content {
  1519. position: relative;
  1520. width: 550rpx;
  1521. margin-left: 30rpx;
  1522. font-size: 28rpx;
  1523. color: #282828;
  1524. &.event_content {
  1525. .line1 {
  1526. width: 360rpx;
  1527. }
  1528. .price {
  1529. position: absolute;
  1530. top: 0;
  1531. right: 0;
  1532. margin-top: 0;
  1533. text {
  1534. display: block;
  1535. text-align: right;
  1536. }
  1537. }
  1538. }
  1539. .event_name {
  1540. display: inline-block;
  1541. margin-right: 9rpx;
  1542. color: #fff;
  1543. font-size: 20rpx;
  1544. padding: 0 8rpx;
  1545. line-height: 30rpx;
  1546. text-align: center;
  1547. border-radius: 6rpx;
  1548. }
  1549. .event_ship {
  1550. font-size: 20rpx;
  1551. margin-top: 10rpx;
  1552. }
  1553. .label {
  1554. margin-top: 10rpx;
  1555. color: #868686;
  1556. font-size: 20rpx;
  1557. }
  1558. .price {
  1559. margin-top: 20rpx;
  1560. color: $theme-color;
  1561. text {
  1562. margin-left: 10rpx;
  1563. color: #999;
  1564. }
  1565. }
  1566. .err-txt {
  1567. display: flex;
  1568. align-items: center;
  1569. margin-top: 18rpx;
  1570. color: $theme-color;
  1571. .iconfont {
  1572. margin-right: 10rpx;
  1573. }
  1574. }
  1575. .step {
  1576. position: absolute;
  1577. right: 0;
  1578. top: 100rpx;
  1579. display: flex;
  1580. align-items: center;
  1581. .min {
  1582. width: 50rpx;
  1583. height: 40rpx;
  1584. background-image: url('~@/static/images/min.png');
  1585. background-size: 17rpx 17rpx;
  1586. background-position: center;
  1587. background-repeat: no-repeat;
  1588. }
  1589. .num-box {
  1590. width: 68rpx;
  1591. height: 40rpx;
  1592. line-height: 40rpx;
  1593. text-align: center;
  1594. background: #F2F2F2;
  1595. font-size: 23rpx;
  1596. }
  1597. .add {
  1598. width: 50rpx;
  1599. height: 40rpx;
  1600. background-image: url('~@/static/images/add.png');
  1601. background-size: 17rpx 17rpx;
  1602. background-position: center;
  1603. background-repeat: no-repeat;
  1604. }
  1605. }
  1606. }
  1607. }
  1608. }
  1609. .event_payTime {
  1610. padding: 0 30rpx 24rpx;
  1611. .event_progress {
  1612. margin-top: 50rpx;
  1613. position: relative;
  1614. }
  1615. .progress_step {
  1616. height: 80rpx;
  1617. position: relative;
  1618. padding-left: 60rpx;
  1619. &::before {
  1620. content: '';
  1621. display: block;
  1622. width: 2rpx;
  1623. height: 40rpx;
  1624. background: #E93323;
  1625. position: absolute;
  1626. left: 35rpx;
  1627. top: 18rpx;
  1628. }
  1629. &:nth-child(2) {
  1630. &::before {
  1631. bottom: 64rpx;
  1632. top: auto;
  1633. background: #EFEFEF;
  1634. }
  1635. &::after {
  1636. background: #EFEFEF;
  1637. }
  1638. }
  1639. &::after {
  1640. content: '';
  1641. display: block;
  1642. width: 14rpx;
  1643. height: 14rpx;
  1644. background: #E93323;
  1645. border-radius: 50%;
  1646. position: absolute;
  1647. top: 10rpx;
  1648. left: 29rpx;
  1649. }
  1650. .name {
  1651. float: left;
  1652. color: #282828;
  1653. &.color_red {
  1654. color: #E93323;
  1655. }
  1656. }
  1657. .price {
  1658. float: right;
  1659. color: #282828;
  1660. &.color_red {
  1661. color: #E93323;
  1662. }
  1663. }
  1664. }
  1665. .progress_pay {
  1666. padding-left: 60rpx;
  1667. font-size: 24rpx;
  1668. color: #868686;
  1669. margin-top: -34rpx;
  1670. }
  1671. }
  1672. }
  1673. uni-checkbox-group,
  1674. .checkgroup {
  1675. width: 100%;
  1676. .checkbox {
  1677. float: right;
  1678. }
  1679. }
  1680. .icon-wenhao1 {
  1681. color: #868686;
  1682. margin-right: 6rpx;
  1683. }
  1684. .total {
  1685. display: flex;
  1686. justify-content: flex-end;
  1687. padding-right: 30rpx;
  1688. padding-bottom: 30rpx;
  1689. font-size: 26rpx;
  1690. color: #282828;
  1691. .price {
  1692. margin-left: 10rpx;
  1693. color: $theme-color;
  1694. font-size: 28rpx;
  1695. font-weight: bold;
  1696. text {
  1697. font-size: 20rpx;
  1698. }
  1699. }
  1700. }
  1701. .store-address {
  1702. padding: 30rpx 23rpx;
  1703. margin: 0 30rpx;
  1704. background: #F6F6F6;
  1705. border-radius: 8rpx;
  1706. font-size: 24rpx;
  1707. display: -webkit-box;
  1708. display: -moz-box;
  1709. display: -ms-flexbox;
  1710. display: -webkit-flex;
  1711. display: flex;
  1712. /*垂直居中*/
  1713. -webkit-box-align: center;/*旧版本*/
  1714. -moz-box-align: center;/*旧版本*/
  1715. -ms-flex-align: center;/*混合版本*/
  1716. -webkit-align-items: center;/*新版本*/
  1717. align-items: center;/*新版本*/
  1718. .name {
  1719. width: 148rpx;
  1720. margin-right: 20rpx;
  1721. }
  1722. .info {
  1723. flex: 1;
  1724. }
  1725. .map{
  1726. text-align: center;
  1727. padding-left: 40rpx;
  1728. position: relative;
  1729. &::before{
  1730. content: '';
  1731. display: inline-block;
  1732. width: 2rpx;
  1733. height: 42rpx;
  1734. background-color: #DDDDDD;
  1735. position: absolute;
  1736. left: 0;
  1737. top: 18rpx;
  1738. }
  1739. .iconfont{
  1740. color: #E93323;
  1741. }
  1742. .map_text{
  1743. color: #E93323;
  1744. }
  1745. }
  1746. }
  1747. .settlementAgreement {
  1748. width: 100%;
  1749. height: 100%;
  1750. position: fixed;
  1751. top: 0;
  1752. left: 0;
  1753. background: rgba(0, 0, 0, .5);
  1754. z-index: 10;
  1755. }
  1756. .settlementAgreement .setAgCount {
  1757. background: #fff;
  1758. width: 656rpx;
  1759. height: 458px;
  1760. position: absolute;
  1761. top: 50%;
  1762. left: 50%;
  1763. border-radius: 12rpx;
  1764. -webkit-border-radius: 12rpx;
  1765. padding: 52rpx;
  1766. -webkit-transform: translate(-50%, -50%);
  1767. -moz-transform: translate(-50%, -50%);
  1768. transform: translate(-50%, -50%);
  1769. overflow: hidden;
  1770. .content {
  1771. height: 900rpx;
  1772. overflow-y: scroll;
  1773. /deep/ p {
  1774. font-size: 13px;
  1775. line-height: 22px;
  1776. }
  1777. /deep/ img {
  1778. max-width: 100%;
  1779. }
  1780. }
  1781. }
  1782. .settlementAgreement .setAgCount .icon {
  1783. font-size: 42rpx;
  1784. color: #b4b1b4;
  1785. position: absolute;
  1786. top: 15rpx;
  1787. right: 15rpx;
  1788. }
  1789. .settlementAgreement .setAgCount .title {
  1790. color: #333;
  1791. font-size: 32rpx;
  1792. text-align: center;
  1793. font-weight: bold;
  1794. }
  1795. .settlementAgreement .setAgCount .content {
  1796. margin-top: 32rpx;
  1797. color: #333;
  1798. font-size: 26rpx;
  1799. line-height: 22px;
  1800. text-align: justify;
  1801. text-justify: distribute-all-lines;
  1802. height: 756rpx;
  1803. overflow-y: scroll;
  1804. }
  1805. </style>