index.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661
  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="Debounce(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. import Debounce from "@/mixins/debounce";
  292. export default {
  293. components: {
  294. payment,
  295. invoicePicker,
  296. couponListWindow,
  297. addressWindow,
  298. orderGoods,
  299. home,
  300. // #ifdef MP
  301. authorize
  302. // #endif
  303. },
  304. mixins: [colors,Debounce],
  305. data() {
  306. const currentDate = this.getDate({
  307. format: true
  308. })
  309. return {
  310. confirm: '', //自定义留言
  311. date: this.$t(`请选择`),
  312. time: this.$t(`请选择`),
  313. canvasWidth: "",
  314. canvasHeight: "",
  315. canvasStatus: false,
  316. newImg: [],
  317. textareaStatus: true,
  318. //支付方式
  319. cartArr: [{
  320. "name": this.$t(`微信支付`),
  321. "icon": "icon-weixin2",
  322. value: 'weixin',
  323. title: this.$t(`使用微信快捷支付`),
  324. payStatus: 1,
  325. },
  326. {
  327. "name": this.$t(`支付宝支付`),
  328. "icon": "icon-zhifubao",
  329. value: 'alipay',
  330. title: this.$t(`使用支付宝支付`),
  331. payStatus: 1,
  332. },
  333. {
  334. "name": this.$t(`余额支付`),
  335. "icon": "icon-yuezhifu",
  336. value: 'yue',
  337. title: this.$t(`可用余额`),
  338. payStatus: 1,
  339. },
  340. {
  341. "name": this.$t(`线下支付`),
  342. "icon": "icon-yuezhifu1",
  343. value: 'offline',
  344. title: this.$t(`使用线下付款`),
  345. payStatus: 2,
  346. }, {
  347. "name": this.$t(`好友代付`),
  348. "icon": "icon-haoyoudaizhifu",
  349. value: 'friend',
  350. title: this.$t(`找微信好友支付`),
  351. payStatus: 1,
  352. }
  353. ],
  354. virtual_type: 0,
  355. allPrice: 0,
  356. formContent: '',
  357. payType: '', //支付方式
  358. openType: 1, //优惠券打开方式 1=使用
  359. active: 0, //支付方式切换
  360. coupon: {
  361. coupon: false,
  362. list: [],
  363. statusTile: this.$t(`立即使用`)
  364. }, //优惠券组件
  365. address: {
  366. address: false
  367. }, //地址组件
  368. addressInfo: {}, //地址信息
  369. pinkId: 0, //拼团id
  370. addressId: 0, //地址id
  371. couponId: 0, //优惠券id
  372. cartId: '', //购物车id
  373. BargainId: 0,
  374. combinationId: 0,
  375. seckillId: 0,
  376. discountId: 0,
  377. userInfo: {}, //用户信息
  378. mark: '', //备注信息
  379. couponTitle: this.$t(`请选择`), //优惠券
  380. coupon_price: 0, //优惠券抵扣金额
  381. useIntegral: false, //是否使用积分
  382. integral_price: 0, //积分抵扣金额
  383. integral: 0,
  384. usable_integral: 0,
  385. ChangePrice: 0, //使用积分抵扣变动后的金额
  386. formIds: [], //收集formid
  387. status: 0,
  388. is_address: false,
  389. toPay: false, //修复进入支付时页面隐藏从新刷新页面
  390. shippingType: 0,
  391. system_store: {},
  392. storePostage: 0,
  393. advanceId: 0,
  394. contacts: '',
  395. contactsTel: '',
  396. mydata: {},
  397. storeList: [],
  398. store_self_mention: 0,
  399. cartInfo: [],
  400. priceGroup: {},
  401. animated: false,
  402. totalPrice: 0,
  403. integralRatio: "0",
  404. pagesUrl: "",
  405. orderKey: "",
  406. // usableCoupon: {},
  407. offlinePostage: "",
  408. isAuto: false, //没有授权的不会自动授权
  409. isShowAuth: false, //是否隐藏授权
  410. from: '',
  411. news: 1,
  412. // invTitle: '不开发票',
  413. invTitle: this.$t(`不开发票`),
  414. special_invoice: false,
  415. invoice_func: false,
  416. header_type: '',
  417. invShow: false,
  418. invList: [],
  419. invChecked: '',
  420. urlQuery: '',
  421. pay_close: false,
  422. noCoupon: 0,
  423. valid_count: 0,
  424. discount_id: 0,
  425. is_shipping: true,
  426. inputTrip: false,
  427. focus: true,
  428. integral_open: false,
  429. jumpData: {}
  430. };
  431. },
  432. computed: mapGetters(['isLogin']),
  433. // watch: {
  434. // startDate() {
  435. // return this.getDate('start');
  436. // },
  437. // endDate() {
  438. // return this.getDate('end');
  439. // }
  440. // },
  441. onLoad(options) {
  442. // #ifdef H5
  443. this.from = this.$wechat.isWeixin() ? 'weixin' : 'weixinh5'
  444. // #endif
  445. // #ifdef MP
  446. this.from = 'routine'
  447. // #endif
  448. // #ifdef APP-PLUS
  449. this.from = 'app'
  450. // #endif
  451. if (!options.cartId) return this.$util.Tips({
  452. title: this.$t(`请选择要购买的商品`)
  453. }, {
  454. tab: 3,
  455. url: 1
  456. });
  457. this.couponId = options.couponId || 0;
  458. this.noCoupon = Number(options.noCoupon) || 0;
  459. this.pinkId = options.pinkId ? parseInt(options.pinkId) : 0;
  460. this.addressId = options.addressId || 0;
  461. this.cartId = options.cartId;
  462. this.is_address = options.is_address ? true : false;
  463. this.news = !options.new || options.new === '0' ? 0 : 1;
  464. this.invChecked = options.invoice_id || '';
  465. this.header_type = options.header_type || '1';
  466. this.couponTitle = options.couponTitle || this.$t(`请选择`)
  467. if (options.invoice_id) {
  468. let name = ''
  469. name += options.header_type == 1 ? this.$t(`个人`) : this.$t(`企业`);
  470. name += options.invoice_type == 1 ? this.$t(`普通`) : this.$t(`专用`);
  471. name += this.$t(`发票`);
  472. this.invTitle = name;
  473. }
  474. // #ifndef APP-PLUS
  475. this.textareaStatus = true;
  476. // #endif
  477. if (this.isLogin && this.toPay == false) {
  478. this.checkShipping();
  479. // this.getaddressInfo();
  480. // this.getConfirm();
  481. // this.$nextTick(function() {
  482. // this.$refs.addressWindow.getAddressList();
  483. // })
  484. } else {
  485. toLogin();
  486. }
  487. },
  488. /**
  489. * 生命周期函数--监听页面显示
  490. */
  491. onShow: function() {
  492. let _this = this
  493. uni.$on("handClick", res => {
  494. if (res) {
  495. _this.system_store = res.address
  496. }
  497. // 清除监听
  498. uni.$off('handClick');
  499. })
  500. },
  501. methods: {
  502. checkShipping() {
  503. let that = this;
  504. checkShipping(that.cartId, that.news).then(res => {
  505. if (res.data.type == 0) {
  506. that.is_shipping = true;
  507. that.shippingType = 0;
  508. this.getaddressInfo();
  509. this.getConfirm();
  510. this.$nextTick(function() {
  511. this.$refs.addressWindow.getAddressList();
  512. })
  513. } else {
  514. if (res.data.type == 1) {
  515. that.is_shipping = false;
  516. that.shippingType = 0;
  517. this.getaddressInfo();
  518. this.getConfirm();
  519. this.$nextTick(function() {
  520. this.$refs.addressWindow.getAddressList();
  521. })
  522. } else if (res.data.type == 2) {
  523. that.is_shipping = false;
  524. that.shippingType = 1;
  525. this.addressType(1)
  526. this.getConfirm();
  527. this.getList();
  528. }
  529. }
  530. }).catch(err => {
  531. uni.showToast({
  532. title: err,
  533. icon: 'none'
  534. });
  535. });
  536. },
  537. // 不开发票
  538. invCancel() {
  539. this.invChecked = '';
  540. this.invTitle = this.$t(`不开发票`)
  541. this.invShow = false;
  542. },
  543. // 选择发票
  544. invChange(id) {
  545. let name = '';
  546. this.invChecked = id;
  547. this.invShow = false;
  548. const result = this.invList.find(item => item.id === id);
  549. name += result.header_type === 1 ? this.$t(`个人`) : this.$t(`企业`);
  550. name += result.type === 1 ? this.$t(`普通`) : this.$t(`专用`);
  551. name += this.$t(`发票`);
  552. this.invTitle = name;
  553. },
  554. openList() {
  555. if (this.shippingType == 0) {
  556. this.onAddress()
  557. } else {
  558. this.showStoreList()
  559. }
  560. },
  561. // 关闭发票
  562. invClose() {
  563. this.invShow = false;
  564. this.getInvoiceList()
  565. },
  566. getInvoiceList() {
  567. uni.showLoading({
  568. title: this.$t(`正在加载中`)
  569. })
  570. invoiceList().then(res => {
  571. uni.hideLoading();
  572. this.invList = res.data.map(item => {
  573. item.id = item.id.toString();
  574. return item;
  575. });
  576. const result = this.invList.find(item => item.id == this.invChecked);
  577. if (result) {
  578. let name = '';
  579. name += result.header_type === 1 ? this.$t(`个人`) : this.$t(`企业`);
  580. name += result.type === 1 ? this.$t(`普通`) : this.$t(`专用`);
  581. name += this.$t(`发票`);
  582. this.invTitle = name;
  583. }
  584. }).catch(err => {
  585. uni.showToast({
  586. title: err,
  587. icon: 'none'
  588. });
  589. });
  590. },
  591. /**
  592. * 开发票
  593. */
  594. goInvoice: function() {
  595. this.getInvoiceList()
  596. this.invShow = true;
  597. this.urlQuery =
  598. `new=${this.news}&cartId=${this.cartId}&pinkId=${this.pinkId}&couponId=${this.couponId}&addressId=${this.addressId}&specialInvoice=${this.special_invoice}&couponTitle=${this.couponTitle}`;
  599. },
  600. /**
  601. * 授权回调事件
  602. *
  603. */
  604. onLoadFun: function() {
  605. this.getaddressInfo();
  606. this.getConfirm();
  607. //调用子页面方法授权后执行获取地址列表
  608. // this.$scope.selectComponent('#address-window').getAddressList();
  609. },
  610. /**
  611. * 事件回调
  612. *
  613. */
  614. onChangeFun: function(e) {
  615. let opt = e;
  616. let action = opt.action || null;
  617. let value = opt.value != undefined ? opt.value : null;
  618. action && this[action] && this[action](value);
  619. },
  620. payClose: function() {
  621. this.pay_close = false;
  622. },
  623. goPay() {
  624. this.pay_close = true;
  625. },
  626. payCheck(type) {
  627. this.payType = type;
  628. this.SubOrder();
  629. },
  630. /**
  631. * 获取门店列表数据
  632. */
  633. getList: function() {
  634. let longitude = uni.getStorageSync("user_longitude") || ''; //经度
  635. let latitude = uni.getStorageSync("user_latitude") || ''; //纬度
  636. let data = {
  637. latitude: latitude, //纬度
  638. longitude: longitude, //经度
  639. page: 1,
  640. limit: 10
  641. }
  642. storeListApi(data).then(res => {
  643. let list = res.data.list.list || [];
  644. this.$set(this, 'storeList', list);
  645. this.$set(this, 'system_store', list[0]);
  646. }).catch(err => {})
  647. },
  648. // 关闭地址弹窗;
  649. changeClose: function() {
  650. this.$set(this.address, 'address', false);
  651. },
  652. /*
  653. * 跳转门店列表
  654. */
  655. showStoreList: function() {
  656. let _this = this
  657. if (this.storeList.length > 0) {
  658. uni.navigateTo({
  659. url: '/pages/goods/goods_details_store/index'
  660. })
  661. }
  662. },
  663. changePayType(type) {
  664. this.payType = type
  665. this.computedPrice()
  666. },
  667. computedPrice: function() {
  668. let shippingType = this.shippingType;
  669. postOrderComputed(this.orderKey, {
  670. addressId: this.addressId,
  671. useIntegral: this.useIntegral ? 1 : 0,
  672. couponId: this.couponId,
  673. shipping_type: parseInt(shippingType) + 1,
  674. payType: this.payType
  675. }).then(res => {
  676. let result = res.data.result;
  677. if (result) {
  678. this.totalPrice = result.pay_price;
  679. this.integral_price = result.deduction_price;
  680. this.coupon_price = result.coupon_price;
  681. this.integral = this.useIntegral ? result.SurplusIntegral : this.usable_integral;
  682. this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
  683. this.$set(this.priceGroup, 'storePostageDiscount', result.storePostageDiscount);
  684. }
  685. })
  686. },
  687. addressType(e) {
  688. let index = e;
  689. let that = this;
  690. if (this.shippingType == parseInt(index)) return
  691. this.shippingType = parseInt(index);
  692. if (index == 1) {
  693. // #ifdef H5
  694. if (that.$wechat.isWeixin()) {
  695. that.$wechat.location().then(res => {
  696. uni.setStorageSync('user_latitude', res.latitude);
  697. uni.setStorageSync('user_longitude', res.longitude);
  698. this.getList()
  699. }).catch(err => {
  700. this.getList()
  701. })
  702. } else {
  703. // #endif
  704. uni.getLocation({
  705. type: 'wgs84',
  706. success: (res) => {
  707. uni.setStorageSync('user_latitude', res.latitude);
  708. uni.setStorageSync('user_longitude', res.longitude);
  709. },
  710. complete: () => {
  711. this.getList()
  712. }
  713. })
  714. // #ifdef H5
  715. }
  716. // #endif
  717. };
  718. this.$nextTick(e => {
  719. this.getConfirm();
  720. this.computedPrice();
  721. })
  722. },
  723. bindPickerChange: function(e) {
  724. let value = e.detail.value;
  725. this.shippingType = value;
  726. this.computedPrice();
  727. },
  728. ChangCouponsClone: function() {
  729. this.$set(this.coupon, 'coupon', false);
  730. },
  731. changeTextareaStatus: function() {
  732. for (let i = 0, len = this.coupon.list.length; i < len; i++) {
  733. this.coupon.list[i].use_title = '';
  734. this.coupon.list[i].is_use = 0;
  735. }
  736. this.textareaStatus = true;
  737. this.status = 0;
  738. this.$set(this.coupon, 'list', this.coupon.list);
  739. },
  740. /**
  741. * 处理点击优惠券后的事件
  742. *
  743. */
  744. ChangCoupons: function(e) {
  745. // this.usableCoupon = e
  746. // this.coupon.coupon = false
  747. let index = e,
  748. list = this.coupon.list,
  749. couponTitle = this.$t(`请选择`),
  750. couponId = 0;
  751. for (let i = 0, len = list.length; i < len; i++) {
  752. if (i != index) {
  753. list[i].use_title = '';
  754. list[i].is_use = 0;
  755. }
  756. }
  757. if (list[index].is_use) {
  758. //不使用优惠券
  759. list[index].use_title = '';
  760. list[index].is_use = 0;
  761. } else {
  762. //使用优惠券
  763. list[index].use_title = this.$t(`不使用`);
  764. list[index].is_use = 1;
  765. couponTitle = list[index].coupon_title;
  766. couponId = list[index].id;
  767. }
  768. this.couponTitle = couponTitle;
  769. this.couponId = couponId;
  770. this.$set(this.coupon, 'coupon', false);
  771. this.$set(this.coupon, 'list', list);
  772. this.computedPrice();
  773. },
  774. /**
  775. * 使用积分抵扣
  776. */
  777. ChangeIntegral: function() {
  778. this.useIntegral = !this.useIntegral;
  779. this.computedPrice();
  780. },
  781. /**
  782. * 选择地址后改变事件
  783. * @param object e
  784. */
  785. OnChangeAddress: function(e) {
  786. this.textareaStatus = true;
  787. this.addressId = e;
  788. this.address.address = false;
  789. this.getConfirm()
  790. this.getaddressInfo();
  791. this.computedPrice();
  792. },
  793. bindHideKeyboard: function(e) {
  794. this.mark = e.detail.value;
  795. },
  796. /**
  797. * 获取当前订单详细信息
  798. *
  799. */
  800. getConfirm: function() {
  801. let that = this;
  802. // return;
  803. uni.showLoading({
  804. title: that.$t(`正在加载中`),
  805. mask: true
  806. });
  807. orderConfirm(that.cartId, that.news, that.addressId, that.shippingType + 1).then(res => {
  808. that.$set(that, 'userInfo', res.data.userInfo);
  809. that.$set(that, 'confirm', res.data.custom_form || []);
  810. this.confirm.map(e => {
  811. if (e.label === 'img') e.value = []
  812. })
  813. that.$set(that, 'integral', res.data.usable_integral);
  814. that.$set(that, 'usable_integral', res.data.usable_integral);
  815. that.$set(that, 'contacts', res.data.userInfo.real_name);
  816. that.$set(that, 'contactsTel', res.data.userInfo.record_phone === '0' ? res.data.userInfo.phone : res.data
  817. .userInfo.record_phone);
  818. that.$set(that, 'cartInfo', res.data.cartInfo);
  819. that.$set(that, 'integralRatio', res.data.integralRatio);
  820. that.$set(that, 'offlinePostage', res.data.offlinePostage);
  821. that.$set(that, 'orderKey', res.data.orderKey);
  822. that.$set(that, 'valid_count', res.data.valid_count);
  823. that.$set(that, 'discount_id', res.data.discount_id)
  824. that.$set(that, 'priceGroup', res.data.priceGroup);
  825. that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice),
  826. parseFloat(res.data
  827. .priceGroup.storePostage)));
  828. that.$set(that, 'allPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice),
  829. parseFloat(res.data
  830. .priceGroup.vipPrice)).toFixed(2));
  831. that.$set(that, 'seckillId', parseInt(res.data.seckill_id));
  832. that.$set(that, 'invoice_func', res.data.invoice_func);
  833. that.$set(that, 'special_invoice', res.data.special_invoice);
  834. that.$set(that, 'store_self_mention', res.data.store_self_mention);
  835. that.$set(that, 'virtual_type', res.data.virtual_type || 0);
  836. that.$set(that, 'integral_open', res.data.integral_open);
  837. uni.hideLoading()
  838. //微信支付是否开启
  839. that.cartArr[0].payStatus = res.data.pay_weixin_open || 0
  840. //支付宝是否开启
  841. that.cartArr[1].payStatus = res.data.ali_pay_status || 0;
  842. //#ifdef MP
  843. that.cartArr[1].payStatus = 0;
  844. //#endif
  845. //余额支付是否开启
  846. // that.cartArr[2].title = '可用余额:' + res.data.userInfo.now_money;
  847. that.cartArr[2].number = res.data.userInfo.now_money;
  848. that.cartArr[2].payStatus = res.data.yue_pay_status == 1 ? res.data.yue_pay_status : 0
  849. if (res.data.offline_pay_status == 2 || res.data.deduction) {
  850. that.cartArr[3].payStatus = 0
  851. } else {
  852. that.cartArr[3].payStatus = 1
  853. }
  854. //好友代付是否开启
  855. that.cartArr[4].payStatus = res.data.friend_pay_status || 0;
  856. // that.$set(that, 'cartArr', that.cartArr);
  857. that.$set(that, 'ChangePrice', that.totalPrice);
  858. that.getBargainId();
  859. that.getCouponList();
  860. if (this.addressId) {
  861. this.computedPrice();
  862. }
  863. }).catch(err => {
  864. uni.hideLoading()
  865. return this.$util.Tips({
  866. title: err
  867. });
  868. });
  869. },
  870. /*
  871. * 提取砍价和拼团id
  872. */
  873. getBargainId: function() {
  874. let that = this;
  875. let cartINfo = that.cartInfo;
  876. let BargainId = 0;
  877. let combinationId = 0;
  878. let discountId = 0;
  879. let advanceId = 0;
  880. cartINfo.forEach(function(value, index, cartINfo) {
  881. BargainId = cartINfo[index].bargain_id,
  882. combinationId = cartINfo[index].combination_id,
  883. discountId = cartINfo[index].discount_id,
  884. advanceId = cartINfo[index].advance_id
  885. })
  886. that.$set(that, 'BargainId', parseInt(BargainId));
  887. that.$set(that, 'combinationId', parseInt(combinationId));
  888. that.$set(that, 'discountId', parseInt(discountId));
  889. that.$set(that, 'advanceId', parseInt(advanceId));
  890. if (that.cartArr.length == 3 && (BargainId || combinationId || that.seckillId || discountId)) {
  891. that.cartArr[2].payStatus = 0;
  892. that.$set(that, 'cartArr', that.cartArr);
  893. }
  894. },
  895. /**
  896. * 获取当前金额可用优惠券
  897. *
  898. */
  899. getCouponList: function() {
  900. let shippingType = this.shippingType;
  901. let that = this;
  902. let data = {
  903. cartId: this.cartId,
  904. 'new': this.news,
  905. 'shippingType': parseInt(shippingType) + 1
  906. }
  907. getCouponsOrderPrice(this.totalPrice, data).then(res => {
  908. that.$set(that.coupon, 'list', res.data);
  909. that.openType = 1;
  910. });
  911. },
  912. /*
  913. * 获取默认收货地址或者获取某条地址信息
  914. */
  915. getaddressInfo: function() {
  916. let that = this;
  917. let fnc = that.addressId ? getAddressDetail : getAddressDefault
  918. fnc(that.addressId).then(res => {
  919. if (!Array.isArray(res.data)) {
  920. res.data.is_default = parseInt(res.data.is_default);
  921. that.addressInfo = res.data || {};
  922. that.addressId = res.data.id || 0;
  923. that.address.addressId = res.data.id || 0;
  924. }
  925. })
  926. },
  927. onHaveAddressList() {
  928. this.haveAddressList = true
  929. },
  930. payItem: function(e) {
  931. let that = this;
  932. let active = e;
  933. that.active = active;
  934. that.animated = true;
  935. that.payType = that.cartArr[active].value;
  936. that.computedPrice();
  937. setTimeout(function() {
  938. that.car();
  939. }, 500);
  940. },
  941. couponTap: function() {
  942. this.coupon.coupon = true;
  943. this.coupon.list.forEach((item, index) => {
  944. if (item.id == this.couponId) {
  945. item.is_use = 1
  946. } else {
  947. item.is_use = 0
  948. }
  949. })
  950. this.$set(this.coupon, 'list', this.coupon.list);
  951. },
  952. car: function() {
  953. let that = this;
  954. that.animated = false;
  955. },
  956. onAddress: function() {
  957. let that = this;
  958. if (this.addressInfo.real_name || this.haveAddressList) {
  959. this.$refs.addressWindow.getAddressList();
  960. that.textareaStatus = false;
  961. that.address.address = true;
  962. that.pagesUrl = '/pages/users/user_address_list/index?news=' + this.news + '&cartId=' + this
  963. .cartId +
  964. '&pinkId=' +
  965. this.pinkId +
  966. '&couponId=' +
  967. this.couponId;
  968. } else {
  969. uni.navigateTo({
  970. url: '/pages/users/user_address/index?cartId=' + this.cartId + '&pinkId=' + this
  971. .pinkId +
  972. '&couponId=' + this.couponId + '&new=' + this.news
  973. })
  974. }
  975. },
  976. formpost(url, postData) {
  977. let tempform = document.createElement("form");
  978. tempform.action = url;
  979. tempform.method = "post";
  980. tempform.target = "_self";
  981. tempform.style.display = "none";
  982. for (let x in postData) {
  983. let opt = document.createElement("input");
  984. opt.name = x;
  985. opt.value = postData[x];
  986. tempform.appendChild(opt);
  987. }
  988. document.body.appendChild(tempform);
  989. this.$nextTick(e => {
  990. tempform.submit();
  991. })
  992. },
  993. payment(data) {
  994. let that = this;
  995. orderCreate(that.orderKey, data).then(res => {
  996. uni.reLaunch({
  997. url: `/pages/goods/cashier/index?order_id=${res.data.result.orderId}&from_type=order`
  998. })
  999. }).catch(err => {
  1000. uni.hideLoading();
  1001. return that.$util.Tips({
  1002. title: err
  1003. });
  1004. });
  1005. },
  1006. clickTextArea() {
  1007. this.$refs.textarea.focus()
  1008. },
  1009. SubOrder(e) {
  1010. console.log('11111')
  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. /* #ifndef H5 */
  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>