index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='order-submission'>
  4. <view class="allAddress" :style="store_self_mention && is_shipping ? '':'padding-top:10rpx'"
  5. v-if="!virtual_type">
  6. <view class="nav acea-row">
  7. <view class="item font-num" :class="shippingType == 0 ? 'on' : 'on2'" @tap="addressType(0)"
  8. v-if='store_self_mention && is_shipping'></view>
  9. <view class="item font-num" :class="shippingType == 1 ? 'on' : 'on2'" @tap="addressType(1)"
  10. v-if='store_self_mention && is_shipping'></view>
  11. </view>
  12. <view class="add-title acea-row row-between-wrapper" v-if="!store_self_mention || !is_shipping"
  13. @click.prevent="openList">
  14. <view class="acea-row row-middle">
  15. <view class="icon" :class="shippingType==1?'orange':'red'">
  16. {{shippingType==0?'商城配送':'门店自提'}}
  17. </view>
  18. <view class="text add-text line1" v-if="shippingType==0">{{$t(`由平台为您提供配送服务`)}}</view>
  19. <view class="text add-text line1" v-if="shippingType==1">{{$t(`线上下单,到店自提`)}}</view>
  20. </view>
  21. <view class="text">{{shippingType == 0 ? $t('切换地址') : $t('切换门店')}} <text
  22. class='iconfont icon-jiantou'></text></view>
  23. </view>
  24. <view class='address acea-row row-between-wrapper' @tap='onAddress' v-if='shippingType == 0'>
  25. <view class='addressCon' v-if="addressInfo.real_name || ''">
  26. <view class='name'>{{addressInfo.real_name || ''}}
  27. <text class='phone'>{{addressInfo.phone || ''}}</text>
  28. </view>
  29. <view class="line1">
  30. <text class='default font-num'
  31. v-if="addressInfo.is_default">[{{$t(`默认`)}}]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.detail}}
  32. </view>
  33. <!-- <view class='setaddress'>设置收货地址</view> -->
  34. </view>
  35. <view class='addressCon' v-else>
  36. <view class='setaddress'>{{$t(`设置收货地址`)}}</view>
  37. </view>
  38. <view v-if="store_self_mention && is_shipping" class='iconfont icon-jiantou'></view>
  39. </view>
  40. <view class='address acea-row row-between-wrapper' v-else @tap="showStoreList">
  41. <block v-if="storeList.length>0">
  42. <view class='addressCon'>
  43. <view class='name'>{{system_store.name || ''}}
  44. <text class='phone'>{{system_store.phone || ''}}</text>
  45. </view>
  46. <view class="line1"> {{system_store.address}}{{", " + system_store.detailed_address}}</view>
  47. </view>
  48. <!-- <view class='iconfont icon-jiantou'></view> -->
  49. </block>
  50. <block v-else>
  51. <view>{{$t(`暂无门店信息`)}}</view>
  52. </block>
  53. <view class="icon acea-row row-middle" v-if="storeList.length>0">
  54. <view class="iconfont icon-dianhua" @click.stop="call(system_store.phone)"></view>
  55. <view class="iconfont icon-dingwei2" @click.stop="showMaoLocation(system_store)"></view>
  56. </view>
  57. </view>
  58. <view class='line'>
  59. <image src='/static/images/line.jpg'></image>
  60. </view>
  61. </view>
  62. <orderGoods :cartInfo="cartInfo" :is_confirm='true' :shipping_type="shippingType"></orderGoods>
  63. <view class='wrapper'>
  64. <view class='item acea-row row-between-wrapper' @tap='couponTap'
  65. v-if="!pinkId && !BargainId && !combinationId && !seckillId&& !noCoupon && !discountId && !advanceId">
  66. <view>{{$t(`优惠券`)}}</view>
  67. <view class='discount'>
  68. {{couponTitle}}
  69. <text class='iconfont icon-jiantou'></text>
  70. </view>
  71. </view>
  72. <view class='item acea-row row-between-wrapper'
  73. v-if="!pinkId && !BargainId && !combinationId && !seckillId && !advanceId && integral_open">
  74. <view>{{$t(`积分抵扣`)}}</view>
  75. <view class='discount acea-row row-middle'>
  76. <view> {{useIntegral ? $t(`剩余积分`):$t(`当前积分`)}}
  77. <text class='num font-color'>{{integral || 0}}</text>
  78. </view>
  79. <checkbox-group @change="ChangeIntegral">
  80. <checkbox :disabled="integral<=0 && !useIntegral" :checked='useIntegral ? true : false' />
  81. </checkbox-group>
  82. </view>
  83. </view>
  84. <view v-if="invoice_func || special_invoice" class='item acea-row row-between-wrapper' @tap="goInvoice">
  85. <view>{{$t(`开具发票`)}}</view>
  86. <view class='discount'>
  87. {{invTitle}}
  88. <text class='iconfont icon-jiantou'></text>
  89. </view>
  90. </view>
  91. <view v-if="shippingType == 1">
  92. <view class="item acea-row row-between-wrapper">
  93. <view>{{$t(`用户姓名`)}}</view>
  94. <view class="discount">
  95. <input style="text-align: right;" v-model="contacts" type="text" :placeholder="$t(`请输入姓名`)"
  96. placeholder-class="placeholder"></input>
  97. </view>
  98. </view>
  99. <view class="item acea-row row-between-wrapper">
  100. <view>{{$t(`联系电话`)}}</view>
  101. <view class="discount">
  102. <input style="text-align: right;" v-model="contactsTel" type="text"
  103. :placeholder="$t(`请输入手机号`)" placeholder-class="placeholder"></input>
  104. </view>
  105. </view>
  106. </view>
  107. <view class='item' v-if="textareaStatus">
  108. <view>{{$t(`备注说明`)}}</view>
  109. <view class="mark" v-if="!coupon.coupon && !inputTrip" @click="inputTripClick">
  110. <view :class="{'mark-msg': mark}" v-text="mark || $t(`填写备注信息,100字以内`)"></view>
  111. </view>
  112. <textarea placeholder-class='placeholder' :placeholder="$t(`填写备注信息,100字以内`)"
  113. v-if="!coupon.coupon && inputTrip" @input='bindHideKeyboard' :focus="focus"
  114. @blur="inputTrip = false" :value="mark" :maxlength="150" name="mark">
  115. </textarea>
  116. </view>
  117. </view>
  118. <view class='wrapper' v-if="confirm.length">
  119. <view class='item acea-row row-between-wrapper' v-for="(item,index) in confirm" :key="index">
  120. <view>
  121. <span v-if="item.status" style="color: red;">*</span>
  122. <span v-else style="marginLeft: 8px;"></span>
  123. {{ item.title }}
  124. </view>
  125. <!-- text -->
  126. <view v-if="item.label=='text'" class="confirm">
  127. <input type="text" :placeholder="$t(`请填写${item.title}`)" v-model="item.value" />
  128. </view>
  129. <!-- number -->
  130. <view v-if="item.label=='number'" class="confirm">
  131. <input type="number" :placeholder="$t(`请填写${item.title}`)" v-model="item.value" />
  132. </view>
  133. <!-- email -->
  134. <view v-if="item.label=='email'" class="confirm">
  135. <input type="text" :placeholder="$t(`请填写${item.title}`)" v-model="item.value" />
  136. </view>
  137. <!-- data -->
  138. <view v-if="item.label=='data'" class="uni-list">
  139. <view class="uni-list-cell">
  140. <view class="uni-list-cell-db">
  141. <picker mode="date" :value="item.value" @change="bindDateChange($event,index)">
  142. <view v-if="item.value == ''" class="fontC">{{date+item.title}}<text
  143. class='iconfont icon-jiantou'></text></view>
  144. <view v-else class="uni-input">{{item.value}}</view>
  145. </picker>
  146. </view>
  147. </view>
  148. </view>
  149. <!-- time -->
  150. <view v-if="item.label=='time'">
  151. <view>
  152. <view>
  153. <picker mode="time" :value="item.value" start="00:00" end="23:59"
  154. @change="bindTimeChange($event,index)">
  155. <view v-if="item.value == ''" class="fontC">{{time+item.title}}<text
  156. class='iconfont icon-jiantou'></text></view>
  157. <view>{{item.value}}</view>
  158. </picker>
  159. </view>
  160. </view>
  161. </view>
  162. <!-- id -->
  163. <view v-if="item.label=='id'" class="confirm">
  164. <input type="idcard" :placeholder="$t(`请填写`)+item.title" v-model="item.value" />
  165. </view>
  166. <!-- phone -->
  167. <view v-if="item.label=='phone'" class="confirm">
  168. <input type="tel" :placeholder="$t(`请填写`)+item.title" v-model="item.value" />
  169. </view>
  170. <!-- img -->
  171. <view v-if="item.label=='img'" class="confirmImg">
  172. <view class='list acea-row row-middle'>
  173. <view class='pictrue' v-for="(items,indexs) in item.value" :key="indexs">
  174. <image :src='items' class="img"></image>
  175. <text class='iconfont icon-guanbi1 font-num del' @click='DelPic(index,indexs)'></text>
  176. </view>
  177. <view class='pictrue acea-row row-center-wrapper row-column bor'
  178. @click='uploadpic(index,item)' v-if="item.value.length < 8">
  179. <text class='iconfont icon-icon25201'></text>
  180. <view>{{$t(`上传图片`)}}</view>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. </view>
  186. <view class='moneyList'>
  187. <view class='item acea-row row-between-wrapper'>
  188. <view>{{$t(`商品总价`)}}:</view>
  189. <view class='money'>
  190. {{$t(`¥`)}}{{allPrice || 0}}
  191. </view>
  192. </view>
  193. <view class='item acea-row row-between-wrapper'
  194. v-if="priceGroup.storePostage > 0 || priceGroup.storePostageDiscount > 0">
  195. <view>{{$t(`配送运费`)}}:</view>
  196. <view class='money'>
  197. {{$t(`¥`)}}{{(parseFloat(priceGroup.storePostage)+parseFloat(priceGroup.storePostageDiscount)).toFixed(2)}}
  198. </view>
  199. </view>
  200. <view class='item acea-row row-between-wrapper'
  201. v-if="priceGroup.levelPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId && !discountId">
  202. <view>{{$t(`用户等级优惠`)}}:</view>
  203. <view class='money'>-{{$t(`¥`)}}{{parseFloat(priceGroup.levelPrice).toFixed(2)}}</view>
  204. </view>
  205. <view class='item acea-row row-between-wrapper'
  206. v-if="priceGroup.memberPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId && !discountId">
  207. <view>{{$t(`付费会员优惠`)}}:</view>
  208. <view class='money'>-{{$t(`¥`)}}{{parseFloat(priceGroup.memberPrice).toFixed(2)}}</view>
  209. </view>
  210. <view class='item acea-row row-between-wrapper' v-if="priceGroup.storePostageDiscount > 0">
  211. <view>{{$t(`会员运费优惠`)}}:</view>
  212. <view class='money'>-{{$t(`¥`)}}{{parseFloat(priceGroup.storePostageDiscount).toFixed(2)}}</view>
  213. </view>
  214. <view class='item acea-row row-between-wrapper' v-if="coupon_price > 0">
  215. <view>{{$t(`优惠券抵扣`)}}:</view>
  216. <view class='money'>-{{$t(`¥`)}}{{parseFloat(coupon_price).toFixed(2)}}</view>
  217. </view>
  218. <view class='item acea-row row-between-wrapper' v-if="integral_price > 0">
  219. <view>{{$t(`积分抵扣`)}}:</view>
  220. <view class='money'>-{{$t(`¥`)}}{{parseFloat(integral_price).toFixed(2)}}</view>
  221. </view>
  222. </view>
  223. <view style='height:120rpx;'></view>
  224. <view class='footer acea-row row-between-wrapper'>
  225. <view>{{$t(`合计`)}}:
  226. <text class='font-color'>{{$t(`¥`)}}{{totalPrice || 0}}</text>
  227. </view>
  228. <view class='settlement' style='z-index:100' @tap.stop="SubOrder"
  229. v-if="(valid_count>0&&!discount_id) || (valid_count==cartInfo.length&&discount_id)">{{$t(`提交订单`)}}
  230. </view>
  231. <view class='settlement bg-color-hui' style='z-index:100' v-else>{{$t(`提交订单`)}}</view>
  232. </view>
  233. </view>
  234. <view class="alipaysubmit" v-html="formContent"></view>
  235. <couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" :openType='openType' :cartId='cartId'
  236. @ChangCoupons="ChangCoupons"></couponListWindow>
  237. <addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :news='news' :address='address'
  238. :pagesUrl="pagesUrl" @OnChangeAddress="OnChangeAddress" @changeClose="changeClose"
  239. @onHaveAddressList="onHaveAddressList"></addressWindow>
  240. <!-- #ifdef MP -->
  241. <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
  242. <!-- #endif -->
  243. <home v-show="!invShow"></home>
  244. <invoice-picker :inv-show="invShow" :inv-list="invList" :inv-checked="invChecked" :is-special="special_invoice"
  245. :url-query="urlQuery" @inv-close="invClose" @inv-change="invChange" @inv-cancel="invCancel">
  246. </invoice-picker>
  247. <canvas canvas-id="canvas" v-if="canvasStatus"
  248. :style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
  249. </view>
  250. </template>
  251. <script>
  252. import {
  253. orderConfirm,
  254. getCouponsOrderPrice,
  255. orderCreate,
  256. postOrderComputed,
  257. checkShipping
  258. } from '@/api/order.js';
  259. import {
  260. getAddressDefault,
  261. getAddressDetail,
  262. invoiceList,
  263. invoiceOrder
  264. } from '@/api/user.js';
  265. import {
  266. openPaySubscribe
  267. } from '@/utils/SubscribeMessage.js';
  268. import {
  269. storeListApi
  270. } from '@/api/store.js';
  271. import {
  272. CACHE_LONGITUDE,
  273. CACHE_LATITUDE
  274. } from '@/config/cache.js';
  275. import couponListWindow from '@/components/couponListWindow';
  276. import addressWindow from '@/components/addressWindow';
  277. import orderGoods from '@/components/orderGoods';
  278. import home from '@/components/home';
  279. import invoicePicker from '../components/invoicePicker/index.vue';
  280. import {
  281. toLogin
  282. } from '@/libs/login.js';
  283. import {
  284. mapGetters
  285. } from "vuex";
  286. // #ifdef MP
  287. import authorize from '@/components/Authorize';
  288. // #endif
  289. import payment from '@/components/payment';
  290. import colors from "@/mixins/color";
  291. export default {
  292. components: {
  293. payment,
  294. invoicePicker,
  295. couponListWindow,
  296. addressWindow,
  297. orderGoods,
  298. home,
  299. // #ifdef MP
  300. authorize
  301. // #endif
  302. },
  303. mixins: [colors],
  304. data() {
  305. const currentDate = this.getDate({
  306. format: true
  307. })
  308. return {
  309. confirm: '', //自定义留言
  310. date: this.$t(`请选择`),
  311. time: this.$t(`请选择`),
  312. canvasWidth: "",
  313. canvasHeight: "",
  314. canvasStatus: false,
  315. newImg: [],
  316. textareaStatus: true,
  317. //支付方式
  318. cartArr: [{
  319. "name": this.$t(`微信支付`),
  320. "icon": "icon-weixin2",
  321. value: 'weixin',
  322. title: this.$t(`使用微信快捷支付`),
  323. payStatus: 1,
  324. },
  325. {
  326. "name": this.$t(`支付宝支付`),
  327. "icon": "icon-zhifubao",
  328. value: 'alipay',
  329. title: this.$t(`使用支付宝支付`),
  330. payStatus: 1,
  331. },
  332. {
  333. "name": this.$t(`余额支付`),
  334. "icon": "icon-yuezhifu",
  335. value: 'yue',
  336. title: this.$t(`可用余额`),
  337. payStatus: 1,
  338. },
  339. {
  340. "name": this.$t(`线下支付`),
  341. "icon": "icon-yuezhifu1",
  342. value: 'offline',
  343. title: this.$t(`使用线下付款`),
  344. payStatus: 2,
  345. }, {
  346. "name": this.$t(`好友代付`),
  347. "icon": "icon-haoyoudaizhifu",
  348. value: 'friend',
  349. title: this.$t(`找微信好友支付`),
  350. payStatus: 1,
  351. }
  352. ],
  353. virtual_type: 0,
  354. allPrice: 0,
  355. formContent: '',
  356. payType: '', //支付方式
  357. openType: 1, //优惠券打开方式 1=使用
  358. active: 0, //支付方式切换
  359. coupon: {
  360. coupon: false,
  361. list: [],
  362. statusTile: this.$t(`立即使用`)
  363. }, //优惠券组件
  364. address: {
  365. address: false
  366. }, //地址组件
  367. addressInfo: {}, //地址信息
  368. pinkId: 0, //拼团id
  369. addressId: 0, //地址id
  370. couponId: 0, //优惠券id
  371. cartId: '', //购物车id
  372. BargainId: 0,
  373. combinationId: 0,
  374. seckillId: 0,
  375. discountId: 0,
  376. userInfo: {}, //用户信息
  377. mark: '', //备注信息
  378. couponTitle: this.$t(`请选择`), //优惠券
  379. coupon_price: 0, //优惠券抵扣金额
  380. useIntegral: false, //是否使用积分
  381. integral_price: 0, //积分抵扣金额
  382. integral: 0,
  383. usable_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. advanceId: 0,
  393. contacts: '',
  394. contactsTel: '',
  395. mydata: {},
  396. storeList: [],
  397. store_self_mention: 0,
  398. cartInfo: [],
  399. priceGroup: {},
  400. animated: false,
  401. totalPrice: 0,
  402. integralRatio: "0",
  403. pagesUrl: "",
  404. orderKey: "",
  405. // usableCoupon: {},
  406. offlinePostage: "",
  407. isAuto: false, //没有授权的不会自动授权
  408. isShowAuth: false, //是否隐藏授权
  409. from: '',
  410. news: 1,
  411. // invTitle: '不开发票',
  412. invTitle: this.$t(`不开发票`),
  413. special_invoice: false,
  414. invoice_func: false,
  415. header_type: '',
  416. invShow: false,
  417. invList: [],
  418. invChecked: '',
  419. urlQuery: '',
  420. pay_close: false,
  421. noCoupon: 0,
  422. valid_count: 0,
  423. discount_id: 0,
  424. is_shipping: true,
  425. inputTrip: false,
  426. focus: true,
  427. integral_open: false,
  428. jumpData: {}
  429. };
  430. },
  431. computed: mapGetters(['isLogin']),
  432. // watch: {
  433. // startDate() {
  434. // return this.getDate('start');
  435. // },
  436. // endDate() {
  437. // return this.getDate('end');
  438. // }
  439. // },
  440. onLoad(options) {
  441. // #ifdef H5
  442. this.from = this.$wechat.isWeixin() ? 'weixin' : 'weixinh5'
  443. // #endif
  444. // #ifdef MP
  445. this.from = 'routine'
  446. // #endif
  447. // #ifdef APP-PLUS
  448. this.from = 'app'
  449. // #endif
  450. if (!options.cartId) return this.$util.Tips({
  451. title: this.$t(`请选择要购买的商品`)
  452. }, {
  453. tab: 3,
  454. url: 1
  455. });
  456. this.couponId = options.couponId || 0;
  457. this.noCoupon = Number(options.noCoupon) || 0;
  458. this.pinkId = options.pinkId ? parseInt(options.pinkId) : 0;
  459. this.addressId = options.addressId || 0;
  460. this.cartId = options.cartId;
  461. this.is_address = options.is_address ? true : false;
  462. this.news = !options.new || options.new === '0' ? 0 : 1;
  463. this.invChecked = options.invoice_id || '';
  464. this.header_type = options.header_type || '1';
  465. this.couponTitle = options.couponTitle || this.$t(`请选择`)
  466. if (options.invoice_id) {
  467. let name = ''
  468. name += options.header_type == 1 ? this.$t(`个人`) : this.$t(`企业`);
  469. name += options.invoice_type == 1 ? this.$t(`普通`) : this.$t(`专用`);
  470. name += this.$t(`发票`);
  471. this.invTitle = name;
  472. }
  473. // #ifndef APP-PLUS
  474. this.textareaStatus = true;
  475. // #endif
  476. if (this.isLogin && this.toPay == false) {
  477. this.checkShipping();
  478. // this.getaddressInfo();
  479. // this.getConfirm();
  480. // this.$nextTick(function() {
  481. // this.$refs.addressWindow.getAddressList();
  482. // })
  483. } else {
  484. toLogin();
  485. }
  486. },
  487. /**
  488. * 生命周期函数--监听页面显示
  489. */
  490. onShow: function() {
  491. let _this = this
  492. uni.$on("handClick", res => {
  493. if (res) {
  494. _this.system_store = res.address
  495. }
  496. // 清除监听
  497. uni.$off('handClick');
  498. })
  499. },
  500. methods: {
  501. checkShipping() {
  502. let that = this;
  503. checkShipping(that.cartId, that.news).then(res => {
  504. if (res.data.type == 0) {
  505. that.is_shipping = true;
  506. that.shippingType = 0;
  507. this.getaddressInfo();
  508. this.getConfirm();
  509. this.$nextTick(function() {
  510. this.$refs.addressWindow.getAddressList();
  511. })
  512. } else {
  513. if (res.data.type == 1) {
  514. that.is_shipping = false;
  515. that.shippingType = 0;
  516. this.getaddressInfo();
  517. this.getConfirm();
  518. this.$nextTick(function() {
  519. this.$refs.addressWindow.getAddressList();
  520. })
  521. } else if (res.data.type == 2) {
  522. that.is_shipping = false;
  523. that.shippingType = 1;
  524. this.addressType(1)
  525. this.getConfirm();
  526. this.getList();
  527. }
  528. }
  529. }).catch(err => {
  530. uni.showToast({
  531. title: err,
  532. icon: 'none'
  533. });
  534. });
  535. },
  536. // 不开发票
  537. invCancel() {
  538. this.invChecked = '';
  539. this.invTitle = this.$t(`不开发票`)
  540. this.invShow = false;
  541. },
  542. // 选择发票
  543. invChange(id) {
  544. let name = '';
  545. this.invChecked = id;
  546. this.invShow = false;
  547. const result = this.invList.find(item => item.id === id);
  548. name += result.header_type === 1 ? this.$t(`个人`) : this.$t(`企业`);
  549. name += result.type === 1 ? this.$t(`普通`) : this.$t(`专用`);
  550. name += this.$t(`发票`);
  551. this.invTitle = name;
  552. },
  553. openList() {
  554. if (this.shippingType == 0) {
  555. this.onAddress()
  556. } else {
  557. this.showStoreList()
  558. }
  559. },
  560. // 关闭发票
  561. invClose() {
  562. this.invShow = false;
  563. this.getInvoiceList()
  564. },
  565. getInvoiceList() {
  566. uni.showLoading({
  567. title: this.$t(`正在加载中`)
  568. })
  569. invoiceList().then(res => {
  570. uni.hideLoading();
  571. this.invList = res.data.map(item => {
  572. item.id = item.id.toString();
  573. return item;
  574. });
  575. const result = this.invList.find(item => item.id == this.invChecked);
  576. if (result) {
  577. let name = '';
  578. name += result.header_type === 1 ? this.$t(`个人`) : this.$t(`企业`);
  579. name += result.type === 1 ? this.$t(`普通`) : this.$t(`专用`);
  580. name += this.$t(`发票`);
  581. this.invTitle = name;
  582. }
  583. }).catch(err => {
  584. uni.showToast({
  585. title: err,
  586. icon: 'none'
  587. });
  588. });
  589. },
  590. /**
  591. * 开发票
  592. */
  593. goInvoice: function() {
  594. this.getInvoiceList()
  595. this.invShow = true;
  596. this.urlQuery =
  597. `new=${this.news}&cartId=${this.cartId}&pinkId=${this.pinkId}&couponId=${this.couponId}&addressId=${this.addressId}&specialInvoice=${this.special_invoice}&couponTitle=${this.couponTitle}`;
  598. },
  599. /**
  600. * 授权回调事件
  601. *
  602. */
  603. onLoadFun: function() {
  604. this.getaddressInfo();
  605. this.getConfirm();
  606. //调用子页面方法授权后执行获取地址列表
  607. // this.$scope.selectComponent('#address-window').getAddressList();
  608. },
  609. /**
  610. * 事件回调
  611. *
  612. */
  613. onChangeFun: function(e) {
  614. let opt = e;
  615. let action = opt.action || null;
  616. let value = opt.value != undefined ? opt.value : null;
  617. action && this[action] && this[action](value);
  618. },
  619. payClose: function() {
  620. this.pay_close = false;
  621. },
  622. goPay() {
  623. this.pay_close = true;
  624. },
  625. payCheck(type) {
  626. this.payType = type;
  627. this.SubOrder();
  628. },
  629. /**
  630. * 获取门店列表数据
  631. */
  632. getList: function() {
  633. let longitude = uni.getStorageSync("user_longitude") || ''; //经度
  634. let latitude = uni.getStorageSync("user_latitude") || ''; //纬度
  635. let data = {
  636. latitude: latitude, //纬度
  637. longitude: longitude, //经度
  638. page: 1,
  639. limit: 10
  640. }
  641. storeListApi(data).then(res => {
  642. let list = res.data.list.list || [];
  643. this.$set(this, 'storeList', list);
  644. this.$set(this, 'system_store', list[0]);
  645. }).catch(err => {})
  646. },
  647. // 关闭地址弹窗;
  648. changeClose: function() {
  649. this.$set(this.address, 'address', false);
  650. },
  651. /*
  652. * 跳转门店列表
  653. */
  654. showStoreList: function() {
  655. let _this = this
  656. if (this.storeList.length > 0) {
  657. uni.navigateTo({
  658. url: '/pages/goods/goods_details_store/index'
  659. })
  660. }
  661. },
  662. changePayType(type) {
  663. this.payType = type
  664. this.computedPrice()
  665. },
  666. computedPrice: function() {
  667. let shippingType = this.shippingType;
  668. postOrderComputed(this.orderKey, {
  669. addressId: this.addressId,
  670. useIntegral: this.useIntegral ? 1 : 0,
  671. couponId: this.couponId,
  672. shipping_type: parseInt(shippingType) + 1,
  673. payType: this.payType
  674. }).then(res => {
  675. let result = res.data.result;
  676. if (result) {
  677. this.totalPrice = result.pay_price;
  678. this.integral_price = result.deduction_price;
  679. this.coupon_price = result.coupon_price;
  680. this.integral = this.useIntegral ? result.SurplusIntegral : this.usable_integral;
  681. this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
  682. this.$set(this.priceGroup, 'storePostageDiscount', result.storePostageDiscount);
  683. }
  684. })
  685. },
  686. addressType(e) {
  687. let index = e;
  688. let that = this;
  689. if (this.shippingType == parseInt(index)) return
  690. this.shippingType = parseInt(index);
  691. if (index == 1) {
  692. // #ifdef H5
  693. if (that.$wechat.isWeixin()) {
  694. that.$wechat.location().then(res => {
  695. uni.setStorageSync('user_latitude', res.latitude);
  696. uni.setStorageSync('user_longitude', res.longitude);
  697. this.getList()
  698. }).catch(err => {
  699. this.getList()
  700. })
  701. } else {
  702. // #endif
  703. uni.getLocation({
  704. type: 'wgs84',
  705. success: (res) => {
  706. uni.setStorageSync('user_latitude', res.latitude);
  707. uni.setStorageSync('user_longitude', res.longitude);
  708. },
  709. complete: () => {
  710. this.getList()
  711. }
  712. })
  713. // #ifdef H5
  714. }
  715. // #endif
  716. };
  717. this.$nextTick(e => {
  718. this.getConfirm();
  719. this.computedPrice();
  720. })
  721. },
  722. bindPickerChange: function(e) {
  723. let value = e.detail.value;
  724. this.shippingType = value;
  725. this.computedPrice();
  726. },
  727. ChangCouponsClone: function() {
  728. this.$set(this.coupon, 'coupon', false);
  729. },
  730. changeTextareaStatus: function() {
  731. for (let i = 0, len = this.coupon.list.length; i < len; i++) {
  732. this.coupon.list[i].use_title = '';
  733. this.coupon.list[i].is_use = 0;
  734. }
  735. this.textareaStatus = true;
  736. this.status = 0;
  737. this.$set(this.coupon, 'list', this.coupon.list);
  738. },
  739. /**
  740. * 处理点击优惠券后的事件
  741. *
  742. */
  743. ChangCoupons: function(e) {
  744. // this.usableCoupon = e
  745. // this.coupon.coupon = false
  746. let index = e,
  747. list = this.coupon.list,
  748. couponTitle = this.$t(`请选择`),
  749. couponId = 0;
  750. for (let i = 0, len = list.length; i < len; i++) {
  751. if (i != index) {
  752. list[i].use_title = '';
  753. list[i].is_use = 0;
  754. }
  755. }
  756. if (list[index].is_use) {
  757. //不使用优惠券
  758. list[index].use_title = '';
  759. list[index].is_use = 0;
  760. } else {
  761. //使用优惠券
  762. list[index].use_title = this.$t(`不使用`);
  763. list[index].is_use = 1;
  764. couponTitle = list[index].coupon_title;
  765. couponId = list[index].id;
  766. }
  767. this.couponTitle = couponTitle;
  768. this.couponId = couponId;
  769. this.$set(this.coupon, 'coupon', false);
  770. this.$set(this.coupon, 'list', list);
  771. this.computedPrice();
  772. },
  773. /**
  774. * 使用积分抵扣
  775. */
  776. ChangeIntegral: function() {
  777. this.useIntegral = !this.useIntegral;
  778. this.computedPrice();
  779. },
  780. /**
  781. * 选择地址后改变事件
  782. * @param object e
  783. */
  784. OnChangeAddress: function(e) {
  785. this.textareaStatus = true;
  786. this.addressId = e;
  787. this.address.address = false;
  788. this.getConfirm()
  789. this.getaddressInfo();
  790. this.computedPrice();
  791. },
  792. bindHideKeyboard: function(e) {
  793. this.mark = e.detail.value;
  794. },
  795. /**
  796. * 获取当前订单详细信息
  797. *
  798. */
  799. getConfirm: function() {
  800. let that = this;
  801. // return;
  802. uni.showLoading({
  803. title: that.$t(`正在加载中`),
  804. mask: true
  805. });
  806. orderConfirm(that.cartId, that.news, that.addressId, that.shippingType + 1).then(res => {
  807. that.$set(that, 'userInfo', res.data.userInfo);
  808. that.$set(that, 'confirm', res.data.custom_form || []);
  809. this.confirm.map(e => {
  810. if (e.label === 'img') e.value = []
  811. })
  812. that.$set(that, 'integral', res.data.usable_integral);
  813. that.$set(that, 'usable_integral', res.data.usable_integral);
  814. that.$set(that, 'contacts', res.data.userInfo.real_name);
  815. that.$set(that, 'contactsTel', res.data.userInfo.record_phone === '0' ? '' : res.data
  816. .userInfo.record_phone);
  817. that.$set(that, 'cartInfo', res.data.cartInfo);
  818. that.$set(that, 'integralRatio', res.data.integralRatio);
  819. that.$set(that, 'offlinePostage', res.data.offlinePostage);
  820. that.$set(that, 'orderKey', res.data.orderKey);
  821. that.$set(that, 'valid_count', res.data.valid_count);
  822. that.$set(that, 'discount_id', res.data.discount_id)
  823. that.$set(that, 'priceGroup', res.data.priceGroup);
  824. that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice),
  825. parseFloat(res.data
  826. .priceGroup.storePostage)));
  827. that.$set(that, 'allPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice),
  828. parseFloat(res.data
  829. .priceGroup.vipPrice)).toFixed(2));
  830. that.$set(that, 'seckillId', parseInt(res.data.seckill_id));
  831. that.$set(that, 'invoice_func', res.data.invoice_func);
  832. that.$set(that, 'special_invoice', res.data.special_invoice);
  833. that.$set(that, 'store_self_mention', res.data.store_self_mention);
  834. that.$set(that, 'virtual_type', res.data.virtual_type || 0);
  835. that.$set(that, 'integral_open', res.data.integral_open);
  836. uni.hideLoading()
  837. //微信支付是否开启
  838. that.cartArr[0].payStatus = res.data.pay_weixin_open || 0
  839. //支付宝是否开启
  840. that.cartArr[1].payStatus = res.data.ali_pay_status || 0;
  841. //#ifdef MP
  842. that.cartArr[1].payStatus = 0;
  843. //#endif
  844. //余额支付是否开启
  845. // that.cartArr[2].title = '可用余额:' + res.data.userInfo.now_money;
  846. that.cartArr[2].number = res.data.userInfo.now_money;
  847. that.cartArr[2].payStatus = res.data.yue_pay_status == 1 ? res.data.yue_pay_status : 0
  848. if (res.data.offline_pay_status == 2 || res.data.deduction) {
  849. that.cartArr[3].payStatus = 0
  850. } else {
  851. that.cartArr[3].payStatus = 1
  852. }
  853. //好友代付是否开启
  854. that.cartArr[4].payStatus = res.data.friend_pay_status || 0;
  855. // that.$set(that, 'cartArr', that.cartArr);
  856. that.$set(that, 'ChangePrice', that.totalPrice);
  857. that.getBargainId();
  858. that.getCouponList();
  859. if (this.addressId) {
  860. this.computedPrice();
  861. }
  862. }).catch(err => {
  863. uni.hideLoading()
  864. return this.$util.Tips({
  865. title: err
  866. });
  867. });
  868. },
  869. /*
  870. * 提取砍价和拼团id
  871. */
  872. getBargainId: function() {
  873. let that = this;
  874. let cartINfo = that.cartInfo;
  875. let BargainId = 0;
  876. let combinationId = 0;
  877. let discountId = 0;
  878. let advanceId = 0;
  879. cartINfo.forEach(function(value, index, cartINfo) {
  880. BargainId = cartINfo[index].bargain_id,
  881. combinationId = cartINfo[index].combination_id,
  882. discountId = cartINfo[index].discount_id,
  883. advanceId = cartINfo[index].advance_id
  884. })
  885. that.$set(that, 'BargainId', parseInt(BargainId));
  886. that.$set(that, 'combinationId', parseInt(combinationId));
  887. that.$set(that, 'discountId', parseInt(discountId));
  888. that.$set(that, 'advanceId', parseInt(advanceId));
  889. if (that.cartArr.length == 3 && (BargainId || combinationId || that.seckillId || discountId)) {
  890. that.cartArr[2].payStatus = 0;
  891. that.$set(that, 'cartArr', that.cartArr);
  892. }
  893. },
  894. /**
  895. * 获取当前金额可用优惠券
  896. *
  897. */
  898. getCouponList: function() {
  899. let shippingType = this.shippingType;
  900. let that = this;
  901. let data = {
  902. cartId: this.cartId,
  903. 'new': this.news,
  904. 'shippingType': parseInt(shippingType) + 1
  905. }
  906. getCouponsOrderPrice(this.totalPrice, data).then(res => {
  907. that.$set(that.coupon, 'list', res.data);
  908. that.openType = 1;
  909. });
  910. },
  911. /*
  912. * 获取默认收货地址或者获取某条地址信息
  913. */
  914. getaddressInfo: function() {
  915. let that = this;
  916. let fnc = that.addressId ? getAddressDetail : getAddressDefault
  917. fnc(that.addressId).then(res => {
  918. if (!Array.isArray(res.data)) {
  919. res.data.is_default = parseInt(res.data.is_default);
  920. that.addressInfo = res.data || {};
  921. that.addressId = res.data.id || 0;
  922. that.address.addressId = res.data.id || 0;
  923. }
  924. })
  925. },
  926. onHaveAddressList() {
  927. this.haveAddressList = true
  928. },
  929. payItem: function(e) {
  930. let that = this;
  931. let active = e;
  932. that.active = active;
  933. that.animated = true;
  934. that.payType = that.cartArr[active].value;
  935. that.computedPrice();
  936. setTimeout(function() {
  937. that.car();
  938. }, 500);
  939. },
  940. couponTap: function() {
  941. this.coupon.coupon = true;
  942. this.coupon.list.forEach((item, index) => {
  943. if (item.id == this.couponId) {
  944. item.is_use = 1
  945. } else {
  946. item.is_use = 0
  947. }
  948. })
  949. this.$set(this.coupon, 'list', this.coupon.list);
  950. },
  951. car: function() {
  952. let that = this;
  953. that.animated = false;
  954. },
  955. onAddress: function() {
  956. let that = this;
  957. if (this.addressInfo.real_name || this.haveAddressList) {
  958. this.$refs.addressWindow.getAddressList();
  959. that.textareaStatus = false;
  960. that.address.address = true;
  961. that.pagesUrl = '/pages/users/user_address_list/index?news=' + this.news + '&cartId=' + this
  962. .cartId +
  963. '&pinkId=' +
  964. this.pinkId +
  965. '&couponId=' +
  966. this.couponId;
  967. } else {
  968. uni.navigateTo({
  969. url: '/pages/users/user_address/index?cartId=' + this.cartId + '&pinkId=' + this
  970. .pinkId +
  971. '&couponId=' + this.couponId + '&new=' + this.news
  972. })
  973. }
  974. },
  975. formpost(url, postData) {
  976. let tempform = document.createElement("form");
  977. tempform.action = url;
  978. tempform.method = "post";
  979. tempform.target = "_self";
  980. tempform.style.display = "none";
  981. for (let x in postData) {
  982. let opt = document.createElement("input");
  983. opt.name = x;
  984. opt.value = postData[x];
  985. tempform.appendChild(opt);
  986. }
  987. document.body.appendChild(tempform);
  988. this.$nextTick(e => {
  989. tempform.submit();
  990. })
  991. },
  992. payment(data) {
  993. let that = this;
  994. orderCreate(that.orderKey, data).then(res => {
  995. uni.reLaunch({
  996. url: `/pages/goods/cashier/index?order_id=${res.data.result.orderId}&from_type=order`
  997. })
  998. }).catch(err => {
  999. uni.hideLoading();
  1000. return that.$util.Tips({
  1001. title: err
  1002. });
  1003. });
  1004. },
  1005. clickTextArea() {
  1006. this.$refs.textarea.focus()
  1007. },
  1008. SubOrder(e) {
  1009. let that = this,
  1010. data = {};
  1011. if (!that.addressId && !that.shippingType && !that.virtual_type) return that.$util.Tips({
  1012. title: that.$t(`请选择收货地址`)
  1013. });
  1014. if (that.shippingType == 1) {
  1015. if (that.contacts == "" || that.contactsTel == "") {
  1016. return that.$util.Tips({
  1017. title: that.$t(`请填写联系人或联系人电话`)
  1018. });
  1019. }
  1020. if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(that.contactsTel)) {
  1021. return that.$util.Tips({
  1022. title: that.$t(`请输入正确的手机号码`)
  1023. });
  1024. }
  1025. if (!that.contacts) {
  1026. return that.$util.Tips({
  1027. title: that.$t(`请输入姓名`)
  1028. });
  1029. }
  1030. if (that.storeList.length == 0) return that.$util.Tips({
  1031. title: that.$t(`暂无门店,请选择其他方式`)
  1032. });
  1033. }
  1034. for (var i = 0; i < that.confirm.length; i++) {
  1035. let data = that.confirm[i]
  1036. if (data.status) {
  1037. if (data.label === 'text' || data.label === 'data' || data.label === 'time' || data.label ===
  1038. 'id') {
  1039. if (!data.value.trim()) {
  1040. return uni.showToast({
  1041. title: that.$t(`请输入`) + `${data.title}`,
  1042. icon: 'none'
  1043. });
  1044. }
  1045. }
  1046. if (data.label === 'number') {
  1047. if (data.value <= 0) {
  1048. return uni.showToast({
  1049. title: that.$t(`请输入`) + `${data.title}`,
  1050. icon: 'none'
  1051. });
  1052. }
  1053. }
  1054. if (data.label === 'email') {
  1055. if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(data.value)) {
  1056. return uni.showToast({
  1057. title: that.$t(`请输入正确的`) + `${data.title}`,
  1058. icon: 'none'
  1059. });
  1060. }
  1061. }
  1062. if (data.label === 'phone') {
  1063. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(data.value)) {
  1064. return uni.showToast({
  1065. title: that.$t(`请输入正确的`) + `${data.title}`,
  1066. icon: 'none'
  1067. });
  1068. }
  1069. }
  1070. if (data.label === 'img') {
  1071. if (!data.value.length) {
  1072. return uni.showToast({
  1073. title: that.$t(`请上传`) + `${data.title}`,
  1074. icon: 'none'
  1075. });
  1076. }
  1077. }
  1078. }
  1079. }
  1080. data = {
  1081. custom_form: that.confirm,
  1082. real_name: that.contacts,
  1083. phone: that.contactsTel,
  1084. addressId: that.addressId,
  1085. formId: '',
  1086. couponId: that.couponId,
  1087. useIntegral: that.useIntegral,
  1088. bargainId: that.BargainId,
  1089. combinationId: that.combinationId,
  1090. discountId: that.discountId,
  1091. pinkId: that.pinkId,
  1092. advanceId: that.advanceId,
  1093. seckill_id: that.seckillId,
  1094. mark: that.mark,
  1095. store_id: that.system_store ? that.system_store.id : 0,
  1096. 'from': that.from,
  1097. shipping_type: that.$util.$h.Add(that.shippingType, 1),
  1098. 'new': that.news,
  1099. 'invoice_id': that.invChecked,
  1100. // #ifdef H5
  1101. quitUrl: location.protocol + '//' + location.hostname +
  1102. '/pages/goods/order_pay_status/index?' +
  1103. '&type=3' + '&totalPrice=' + this.totalPrice
  1104. // #endif
  1105. // #ifdef APP-PLUS
  1106. quitUrl: '/pages/goods/order_details/index?order_id=' + this.order_id
  1107. // #endif
  1108. };
  1109. if (data.payType == 'yue' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice))
  1110. return that.$util.Tips({
  1111. title: that.$t(`余额不足`)
  1112. });
  1113. // uni.showLoading({
  1114. // title: that.$t(`订单支付中`)
  1115. // });
  1116. // #ifdef MP
  1117. openPaySubscribe().then(() => {
  1118. that.payment(data);
  1119. });
  1120. // #endif
  1121. // #ifndef MP
  1122. that.payment(data);
  1123. // #endif
  1124. },
  1125. bindDateChange: function(e, index) {
  1126. this.confirm[index].value = e.target.value
  1127. },
  1128. bindTimeChange: function(e, index) {
  1129. this.confirm[index].value = e.target.value
  1130. },
  1131. getDate(type) {
  1132. const date = new Date();
  1133. let year = date.getFullYear();
  1134. let month = date.getMonth() + 1;
  1135. let day = date.getDate();
  1136. if (type === 'start') {
  1137. year = year - 60;
  1138. } else if (type === 'end') {
  1139. year = year + 2;
  1140. }
  1141. month = month > 9 ? month : '0' + month;
  1142. day = day > 9 ? day : '0' + day;
  1143. return `${year}-${month}-${day}`;
  1144. },
  1145. uploadpic: function(index, item) {
  1146. let that = this;
  1147. this.canvasStatus = true
  1148. that.$util.uploadImageChange('upload/image', function(res) {
  1149. item.value.push(res.data.url);
  1150. }, (res) => {
  1151. this.canvasStatus = false
  1152. }, (res) => {
  1153. this.canvasWidth = res.w
  1154. this.canvasHeight = res.h
  1155. });
  1156. },
  1157. DelPic: function(index, indexs) {
  1158. let that = this,
  1159. pic = this.confirm[index].value;
  1160. that.confirm[index].value.splice(indexs, 1);
  1161. // that.$set(that, 'pics', that.pics);
  1162. },
  1163. inputTripClick() {
  1164. this.inputTrip = true
  1165. // this.$refs.trip.foucs()
  1166. },
  1167. showMaoLocation(e) {
  1168. let self = this;
  1169. // #ifdef H5
  1170. if (self.$wechat.isWeixin()) {
  1171. self.$wechat.seeLocation({
  1172. latitude: Number(e.latitude),
  1173. longitude: Number(e.longitude),
  1174. name: e.name,
  1175. scale: 13,
  1176. address: `${e.address}-${e.detailed_address}`,
  1177. }).then(res => {})
  1178. } else {
  1179. // #endif
  1180. uni.openLocation({
  1181. latitude: Number(e.latitude),
  1182. longitude: Number(e.longitude),
  1183. name: e.name,
  1184. address: `${e.address}-${e.detailed_address}`,
  1185. success: function() {
  1186. Number
  1187. }
  1188. });
  1189. // #ifdef H5
  1190. }
  1191. // #endif
  1192. },
  1193. call(phone) {
  1194. uni.makePhoneCall({
  1195. phoneNumber: phone,
  1196. });
  1197. },
  1198. }
  1199. }
  1200. </script>
  1201. <style lang="scss" scoped>
  1202. /deep/uni-checkbox[disabled] .uni-checkbox-input {
  1203. background-color: #eee;
  1204. }
  1205. .alipaysubmit {
  1206. display: none;
  1207. }
  1208. .order-submission {
  1209. /* #ifdef APP-PLUS */
  1210. padding-bottom: 70rpx;
  1211. /* #endif */
  1212. }
  1213. .order-submission .line {
  1214. width: 100%;
  1215. height: 3rpx;
  1216. }
  1217. .order-submission .line image {
  1218. width: 100%;
  1219. height: 100%;
  1220. display: block;
  1221. }
  1222. .order-submission .address {
  1223. padding: 28rpx 30rpx;
  1224. background-color: #fff;
  1225. box-sizing: border-box;
  1226. flex-wrap: nowrap;
  1227. .icon {
  1228. .iconfont {
  1229. width: 44rpx;
  1230. height: 44rpx;
  1231. background: var(--view-minorColorT);
  1232. font-size: 20rpx;
  1233. border-radius: 50%;
  1234. text-align: center;
  1235. line-height: 44rpx;
  1236. color: var(--view-theme);
  1237. margin-left: 26rpx;
  1238. }
  1239. }
  1240. }
  1241. .order-submission .address .addressCon {
  1242. max-width: 510rpx;
  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. background: linear-gradient(to bottom, var(--view-theme) 0%, #f5f5f5 100%);
  1269. padding-top: 100rpx;
  1270. margin-bottom: 12rpx;
  1271. .add-title {
  1272. height: 72rpx;
  1273. margin: 0 26rpx;
  1274. border-bottom: 1px solid #eee;
  1275. background-color: #fff;
  1276. width: 710rpx;
  1277. margin: 0 auto;
  1278. padding: 0 26rpx;
  1279. border-radius: 12rpx 12rpx 0 0;
  1280. .icon {
  1281. height: 32rpx;
  1282. background: #1890FF;
  1283. border-radius: 4rpx;
  1284. font-size: 20rpx;
  1285. font-weight: 400;
  1286. color: #FFFFFF;
  1287. text-align: center;
  1288. line-height: 32rpx;
  1289. padding: 0 6rpx;
  1290. &.orange {
  1291. background: #FE960F;
  1292. }
  1293. &.red {
  1294. background: #E93323;
  1295. }
  1296. }
  1297. .add-text {
  1298. margin-left: 14rpx;
  1299. width: 360rpx;
  1300. }
  1301. .text {
  1302. font-size: 24rpx;
  1303. font-weight: 400;
  1304. color: #999999;
  1305. .icon-jiantou {
  1306. display: inline-block;
  1307. font-size: 20rpx;
  1308. }
  1309. }
  1310. }
  1311. }
  1312. .order-submission .allAddress .nav {
  1313. width: 710rpx;
  1314. margin: 0 auto;
  1315. }
  1316. .order-submission .allAddress .nav .item {
  1317. width: 355rpx;
  1318. }
  1319. .order-submission .allAddress .nav .item.on {
  1320. position: relative;
  1321. width: 250rpx;
  1322. }
  1323. .order-submission .allAddress .nav .item.on::before {
  1324. position: absolute;
  1325. bottom: 0;
  1326. content: "快递配送";
  1327. font-size: 28rpx;
  1328. display: block;
  1329. height: 0;
  1330. width: 336rpx;
  1331. border-width: 0 20rpx 80rpx 0;
  1332. border-style: none solid solid;
  1333. border-color: transparent transparent #fff;
  1334. z-index: 2;
  1335. border-radius: 7rpx 30rpx 0 0;
  1336. text-align: center;
  1337. line-height: 80rpx;
  1338. }
  1339. .order-submission .allAddress .nav .item:nth-of-type(2).on::before {
  1340. content: "到店自提";
  1341. border-width: 0 0 80rpx 20rpx;
  1342. border-radius: 30rpx 7rpx 0 0;
  1343. }
  1344. .order-submission .allAddress .nav .item.on2 {
  1345. position: relative;
  1346. }
  1347. .order-submission .allAddress .nav .item.on2::before {
  1348. position: absolute;
  1349. bottom: 0;
  1350. content: "到店自提";
  1351. font-size: 28rpx;
  1352. display: block;
  1353. height: 0;
  1354. width: 400rpx;
  1355. border-width: 0 0 60rpx 60rpx;
  1356. border-style: none solid solid;
  1357. border-color: transparent transparent rgba(255, 255, 255, 0.6);
  1358. border-radius: 40rpx 6rpx 0 0;
  1359. text-align: center;
  1360. line-height: 60rpx;
  1361. }
  1362. .order-submission .allAddress .nav .item:nth-of-type(1).on2::before {
  1363. content: "快递配送";
  1364. border-width: 0 60rpx 60rpx 0;
  1365. border-radius: 6rpx 40rpx 0 0;
  1366. }
  1367. .order-submission .allAddress .address {
  1368. width: 710rpx;
  1369. height: 150rpx;
  1370. margin: 0 auto;
  1371. }
  1372. .order-submission .allAddress .line {
  1373. width: 710rpx;
  1374. margin: 0 auto;
  1375. }
  1376. .order-submission .wrapper .item .discount .placeholder {
  1377. color: #ccc;
  1378. }
  1379. .placeholder-textarea {
  1380. position: relative;
  1381. .placeholder {
  1382. position: absolute;
  1383. color: #ccc;
  1384. top: 26rpx;
  1385. left: 30rpx;
  1386. }
  1387. }
  1388. .order-submission .wrapper {
  1389. background-color: #fff;
  1390. margin-top: 13rpx;
  1391. }
  1392. .order-submission .wrapper .item {
  1393. padding: 27rpx 30rpx;
  1394. font-size: 30rpx;
  1395. color: #282828;
  1396. border-bottom: 1px solid #f0f0f0;
  1397. .mark {
  1398. background-color: #f9f9f9;
  1399. // width: 345px;
  1400. min-height: 70px;
  1401. border-radius: 1px;
  1402. margin-top: 15px;
  1403. padding: 12px 14px;
  1404. color: #ccc;
  1405. font-size: 28rpx;
  1406. box-sizing: border-box;
  1407. }
  1408. .mark-msg {
  1409. color: #333;
  1410. font-size: 28rpx;
  1411. }
  1412. }
  1413. .order-submission .wrapper .item .discount {
  1414. font-size: 30rpx;
  1415. color: #999;
  1416. }
  1417. .order-submission .wrapper .item .discount input {
  1418. text-align: end;
  1419. }
  1420. .order-submission .wrapper .item .discount .iconfont {
  1421. color: #515151;
  1422. font-size: 30rpx;
  1423. margin-left: 15rpx;
  1424. }
  1425. .order-submission .wrapper .item .discount .num {
  1426. font-size: 32rpx;
  1427. margin-right: 20rpx;
  1428. }
  1429. .order-submission .wrapper .item .shipping {
  1430. font-size: 30rpx;
  1431. color: #999;
  1432. position: relative;
  1433. padding-right: 58rpx;
  1434. }
  1435. .order-submission .wrapper .item .shipping .iconfont {
  1436. font-size: 35rpx;
  1437. color: #707070;
  1438. position: absolute;
  1439. right: 0;
  1440. top: 50%;
  1441. transform: translateY(-50%);
  1442. margin-left: 30rpx;
  1443. }
  1444. .order-submission .wrapper .item textarea {
  1445. background-color: #f9f9f9;
  1446. width: 100%;
  1447. height: 135rpx;
  1448. border-radius: 3rpx;
  1449. margin-top: 30rpx;
  1450. padding: 25rpx 28rpx;
  1451. font-size: 28rpx;
  1452. box-sizing: border-box;
  1453. }
  1454. .order-submission .wrapper .item .placeholder {
  1455. color: #ccc;
  1456. font-size: 28rpx;
  1457. }
  1458. .order-submission .wrapper .item .list {
  1459. margin-top: 35rpx;
  1460. }
  1461. .order-submission .wrapper .item .list .payItem {
  1462. border: 1px solid #eee;
  1463. border-radius: 6rpx;
  1464. height: 86rpx;
  1465. width: 100%;
  1466. box-sizing: border-box;
  1467. margin-top: 20rpx;
  1468. font-size: 28rpx;
  1469. color: #282828;
  1470. }
  1471. .order-submission .wrapper .item .list .payItem.on {
  1472. border-color: #fc5445;
  1473. color: #e93323;
  1474. }
  1475. .order-submission .wrapper .item .list .payItem .name {
  1476. width: 50%;
  1477. text-align: center;
  1478. border-right: 1px solid #eee;
  1479. padding-left: 80rpx;
  1480. }
  1481. .order-submission .wrapper .item .list .payItem .name .iconfont {
  1482. width: 44rpx;
  1483. height: 44rpx;
  1484. border-radius: 50%;
  1485. text-align: center;
  1486. line-height: 44rpx;
  1487. background-color: #fe960f;
  1488. color: #fff;
  1489. font-size: 30rpx;
  1490. margin-right: 15rpx;
  1491. }
  1492. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
  1493. background-color: #41b035;
  1494. }
  1495. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
  1496. background-color: #1677FF;
  1497. }
  1498. .order-submission .wrapper .item .list .payItem .tip {
  1499. width: 49%;
  1500. text-align: center;
  1501. font-size: 26rpx;
  1502. color: #aaa;
  1503. }
  1504. .order-submission .moneyList {
  1505. margin-top: 12rpx;
  1506. background-color: #fff;
  1507. padding: 30rpx;
  1508. }
  1509. .order-submission .moneyList .item {
  1510. font-size: 28rpx;
  1511. color: #282828;
  1512. }
  1513. .order-submission .moneyList .item~.item {
  1514. margin-top: 20rpx;
  1515. }
  1516. .order-submission .moneyList .item .money {
  1517. color: #868686;
  1518. }
  1519. .order-submission .footer {
  1520. width: 100%;
  1521. background-color: #fff;
  1522. font-size: 28rpx;
  1523. color: #333;
  1524. box-sizing: border-box;
  1525. position: fixed;
  1526. left: 0;
  1527. bottom: 0;
  1528. padding: 15rpx 30rpx;
  1529. padding-bottom: calc(15rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1530. padding-bottom: calc(15rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1531. z-index: 9;
  1532. }
  1533. .order-submission .footer .settlement {
  1534. font-size: 30rpx;
  1535. color: #fff;
  1536. width: 240rpx;
  1537. height: 70rpx;
  1538. background-color: var(--view-theme);
  1539. border-radius: 50rpx;
  1540. text-align: center;
  1541. line-height: 70rpx;
  1542. }
  1543. .footer .transparent {
  1544. opacity: 0
  1545. }
  1546. .confirm {
  1547. text-align: right;
  1548. font-size: 22rpx;
  1549. }
  1550. .confirmImg {
  1551. width: 100%;
  1552. .img {
  1553. width: 136rpx;
  1554. height: 136rpx;
  1555. }
  1556. .pictrue {
  1557. width: 136rpx;
  1558. height: 136rpx;
  1559. box-sizing: border-box;
  1560. margin: 18rpx;
  1561. margin-bottom: 35rpx;
  1562. position: relative;
  1563. font-size: 22rpx;
  1564. color: #bbb;
  1565. .del {
  1566. position: absolute;
  1567. top: 0;
  1568. right: 0;
  1569. }
  1570. }
  1571. .bor {
  1572. border: 1rpx solid #ddd;
  1573. }
  1574. }
  1575. .fontC {
  1576. color: grey;
  1577. }
  1578. </style>