index.vue 46 KB

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