index.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419
  1. <template>
  2. <div>
  3. <indexHeaders/>
  4. </div>
  5. <RightSliderBar/>
  6. <el-dialog class="address" :show-close="true" center v-model="addressFlags" title="上传打款凭证">
  7. <el-form ref="loginFormRefss" :model="addressStates" :rules="ruless">
  8. <div class="address-content">
  9. <!-- <div class="address-view" style="margin-left: 16px">-->
  10. <!-- <div class="star">*</div>-->
  11. <!-- <div >打款银行卡号:</div>-->
  12. <!-- <div>-->
  13. <!-- <el-form-item prop="bankCard">-->
  14. <!-- <el-input-->
  15. <!-- v-model.trim="addressStates.bankCard"-->
  16. <!-- ></el-input>-->
  17. <!-- </el-form-item>-->
  18. <!-- </div>-->
  19. <!-- </div>-->
  20. <!-- <div class="address-view" style="margin-left: 16px">-->
  21. <!-- <div class="star">*</div>-->
  22. <!-- <div >银行卡开户行:</div>-->
  23. <!-- <div>-->
  24. <!-- <el-form-item prop="bankName">-->
  25. <!-- <el-input-->
  26. <!-- v-model.trim="addressStates.bankName"-->
  27. <!-- ></el-input>-->
  28. <!-- </el-form-item>-->
  29. <!-- </div>-->
  30. <!-- </div>-->
  31. <!-- <div class="address-view" style="margin-left: 30px">-->
  32. <!-- <div class="star">*</div>-->
  33. <!-- <div>银行卡户名:</div>-->
  34. <!-- <div>-->
  35. <!-- <el-form-item prop="userName">-->
  36. <!-- <el-input-->
  37. <!-- v-model.trim="addressStates.userName"-->
  38. <!-- ></el-input>-->
  39. <!-- </el-form-item>-->
  40. <!-- </div>-->
  41. <!-- </div>-->
  42. <div class="address-view" style="margin-left: 30px">
  43. <div class="star">*</div>
  44. <div>打款凭证:</div>
  45. <div>
  46. <el-upload
  47. class="avatar-uploader"
  48. :show-file-list="false"
  49. :on-success="handleAvatarSuccess"
  50. :on-change="handleChange"
  51. :file-list="fileList"
  52. >
  53. <img v-if="imageUrl" :src="imageUrl" class="avatar" />
  54. <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
  55. </el-upload>
  56. <div>{{fileSrc}}</div>
  57. <div class="upload-s" @click="uploads" style="margin-top: 40px">立即上传</div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="button-s">
  62. <div class="style" @click="addressFlags=false">取消</div>
  63. <div class="style colors" @click="addressTap()">确认添加</div>
  64. </div>
  65. </el-form>
  66. </el-dialog>
  67. <div>
  68. <div class="login-wrapper">
  69. <div class="order-tops">
  70. <div class="line-s">
  71. </div>
  72. <div class="line-s-right">
  73. </div>
  74. <div class="order-flex">
  75. <div class="order-views">
  76. <div class="img-icon">
  77. <img src="@/assets/img/order-s.png" >
  78. </div>
  79. <div class="name" >第一步:提交订单</div>
  80. </div>
  81. <div class="order-views">
  82. <div class="img-icon">
  83. <img src="@/assets/img/pay-icons1.png" >
  84. </div>
  85. <div class="name">第二步:支付订单</div>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="submit">
  90. <div class="title">订单信息</div>
  91. <div class="submit-content">
  92. <div class="submit-view" v-if="payOrder.arr.address">
  93. <div class="submit-name">收货地址:</div>
  94. <div class="boxs" style="display:flex;">
  95. <span>
  96. {{payOrder.arr.address.name}}
  97. </span>
  98. <span style="margin-left: 10px">
  99. {{payOrder.arr.address.address}}
  100. </span>
  101. <span style="margin-left: 10px">
  102. {{payOrder.arr.address.mobile}}
  103. </span>
  104. </div>
  105. </div>
  106. <div class="submit-view" style="margin-top: 15px">
  107. <div class="submit-name">发票信息:</div>
  108. <div class="" v-if="payOrder.arr.tax==null">未开票</div>
  109. <div v-else>
  110. <div class="boxs" v-if="payOrder.arr.tax.u_type==1" style="display: flex">
  111. <!-- <span></span>-->
  112. <div class="spans">
  113. {{payOrder.arr.tax.name}}/
  114. </div>
  115. <div class="spans">
  116. {{payOrder.arr.tax.id}}
  117. </div>
  118. </div>
  119. <div class="boxs" style="padding-top: 5px;display: flex" v-if="payOrder.arr.tax.u_type==2 && payOrder.arr.tax.self_type==2">
  120. <div class="spans">{{payOrder.arr.tax.com_name}}/</div>
  121. <div class="spans">{{payOrder.arr.tax.tax_no}}/</div>
  122. </div>
  123. <div class="boxs" style="padding-top: 5px;display: flex" v-if="payOrder.arr.tax.u_type==2 && payOrder.arr.tax.self_type==1">
  124. <div class="spans">{{payOrder.arr.paperType==1?'电子发票':'纸质发票'}}/</div>
  125. <div class="spans">{{payOrder.arr.selfType==1?'专票':'普票'}}/</div>
  126. <div class="spans">{{payOrder.arr.tax.com_name}}/</div>
  127. <div class="spans">{{payOrder.arr.tax.bank_no}}</div>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="invoice-contents" v-if="invoiceFlags">
  132. <div class="flex-s">
  133. <div style="color: #333">发票信息</div>
  134. <div style="color: #4171B3" @click="updates">修改</div>
  135. </div>
  136. <div class="flex-content" v-if="typeIndex==0">
  137. <div class="divs">
  138. <div>姓名:</div>
  139. <div>{{FormState.name}}</div>
  140. </div>
  141. </div>
  142. <div class="flex-content" v-else>
  143. <div class="divs">
  144. <div>开户名称:</div>
  145. <div>{{FormState.cardName}}</div>
  146. </div>
  147. <div class="divs">
  148. <div>开户行:</div>
  149. <div>{{FormState.cardBank}}</div>
  150. </div>
  151. <div class="divs">
  152. <div>税号:</div>
  153. <div>{{FormState.cardNumber}}</div>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="invoice-from" v-if="invoiceIndex!=2 && flags">
  158. <div class="invoiceSource">
  159. <div class="source" v-for="(item,index) in invoiceSource" @click="sourceIndex=index;clearIndex()" :class="sourceIndex==index?'colorStyle':''">
  160. {{item}}
  161. </div>
  162. <div class="source-right">
  163. 选择开票信息
  164. </div>
  165. </div>
  166. <div class="invoiceSource">
  167. <div class="name">发票类型:</div>
  168. <div class="source" v-for="(item,index) in invoiceType" @click="typeIndex=index;clearIndex()" :class="typeIndex==index?'colorStyle':''">
  169. {{item}}
  170. </div>
  171. </div>
  172. <el-form ref="loginFormRef" :model="FormState" :rules="rules">
  173. <div class="content" v-if="typeIndex==0">
  174. <div class="invoice-texts">
  175. <div class="invoice-view">
  176. <div class="name">真实姓名:</div>
  177. <el-form-item prop="name">
  178. <el-input
  179. v-model.trim="FormState.name"
  180. ></el-input>
  181. </el-form-item>
  182. </div>
  183. </div>
  184. </div>
  185. <div class="content" v-if="typeIndex==1">
  186. <div class="invoice-texts">
  187. <div class="invoice-view">
  188. <div class="name">开户名称:</div>
  189. <el-form-item prop="cardName">
  190. <el-input
  191. v-model.trim="FormState.cardName"
  192. ></el-input>
  193. </el-form-item>
  194. </div>
  195. </div>
  196. <div class="invoice-texts">
  197. <div class="invoice-view">
  198. <div class="name" style="margin-left: 16px">开户行:</div>
  199. <el-form-item prop="cardBank">
  200. <el-input
  201. v-model.trim="FormState.cardBank"
  202. ></el-input>
  203. </el-form-item>
  204. </div>
  205. </div>
  206. <div class="invoice-texts">
  207. <div class="invoice-view">
  208. <div class="name" style="margin-left: 30px">税号:</div>
  209. <el-form-item prop="cardNumber">
  210. <el-input
  211. v-model.trim="FormState.cardNumber"
  212. ></el-input>
  213. </el-form-item>
  214. </div>
  215. </div>
  216. </div>
  217. <div class="button">
  218. <div class="style">取消</div>
  219. <div class="style colors" @click="submittVolice">保存</div>
  220. </div>
  221. </el-form>
  222. </div>
  223. </div>
  224. <div class="shopping">
  225. <div class="shopping-title">
  226. <div>订单信息</div>
  227. <div>商品单价</div>
  228. <div>安装单价</div>
  229. <div>商品数量</div>
  230. <div>安装数量</div>
  231. <div>小计</div>
  232. </div>
  233. <div class="shopping-contents">
  234. <div class="shopping-lists" v-for="(item,index) in payOrder.arr.info">
  235. <div class="img" style="margin-left: 40px">
  236. <img :src="item.goods.logo[0]" style="margin: 5px 0">
  237. <div class="name overflow1">{{item.goods.name}};
  238. {{item.sku.name}}
  239. </div>
  240. </div>
  241. <div class="price">
  242. ¥{{item.amount}}
  243. </div>
  244. <div class="price">
  245. ¥{{item.amount_install_single}}
  246. </div>
  247. <div class="price">
  248. {{item.num}}
  249. </div>
  250. <div class="price">
  251. {{item.num_install}}
  252. </div>
  253. <div class="price" style="color: rgb(234, 40, 19);width: 200px">
  254. ¥{{item.amount_total}}
  255. </div>
  256. <!-- <div class="oper" @click="delGoods(index,item)">-->
  257. <!-- <img src="@/assets/img/del-goods.png" alt="">-->
  258. <!-- </div>-->
  259. </div>
  260. </div>
  261. </div>
  262. <div class="shopping-total" v-if="payOrder.arr" style="margin-top: 20px">
  263. <div v-if="payOrder.arr.amount_coupon>0">优惠券:-{{payOrder.arr.amount_coupon||0}}</div>
  264. <div>商品件数: {{ payOrder.arr.num||0 }}</div>
  265. <div>安装件数: {{ payOrder.arr.num_install||0 }}</div>
  266. <div style="border-bottom: 1px solid #F1F1F1;padding-bottom: 20px">合计金额: {{ payOrder.arr.amount_total||0 }}</div>
  267. <div style="color: #EA2813">总计:{{ payOrder.arr.amount_pay ||0}}</div>
  268. </div>
  269. <!-- <div class="shopping-total" v-else>-->
  270. <!-- <div>商品件数:0</div>-->
  271. <!-- <div>安装件数:0</div>-->
  272. <!-- <div style="border-bottom: 1px solid #F1F1F1;padding-bottom: 20px">合计金额: 0</div>-->
  273. <!-- <div style="color: #EA2813">总计:0</div>-->
  274. <!-- <div class="buttons">-->
  275. <!-- <div class="button" @click="returnSub" style="background:none;border: 1px solid #4171B3;color:#4171B3 ">-->
  276. <!-- 上一步-->
  277. <!-- </div>-->
  278. <!-- <div class="button">-->
  279. <!-- 去支付-->
  280. <!-- </div>-->
  281. <!-- </div>-->
  282. <!-- </div>-->
  283. <div style="clear: both"></div>
  284. </div>
  285. <div class="submit">
  286. <div class="title">支付订单</div>
  287. <div class="submit-content">
  288. <div class="order-colors">
  289. 支付到期时间<span style="margin-left: 20px">{{detailTime(payOrder.arr.continue_expire_time)}}</span>
  290. </div>
  291. <div class="submit-view">
  292. <div class="submit-name">订单状态:</div>
  293. <div>未支付</div>
  294. </div>
  295. <div class="submit-view" style="margin-top: 0" v-if="payOrder.arr.address">
  296. <div class="submit-name">收货信息:</div>
  297. <div>
  298. {{payOrder.arr.address.name}}
  299. {{payOrder.arr.address.mobile}}
  300. {{payOrder.arr.address.address}}
  301. </div>
  302. </div>
  303. <div class="submit-view">期望发货时间:<span style="margin-left: 10px;color: #333">{{dates(payOrder.arr.customer_send_time)}}</span></div>
  304. <div class="submit-view">
  305. <div class="submit-name">订单编号:</div>
  306. <div>
  307. {{ payOrder.arr.order_no }}
  308. </div>
  309. </div>
  310. <div class="submit-view">
  311. <div class="submit-name">付款金额:</div>
  312. <div style="color: #3172B9;font-size: 22px">
  313. ¥{{ payOrder.arr.amount_pay }}
  314. </div>
  315. </div>
  316. <div class="submit-view">
  317. <div class="submit-name">付款方式:</div>
  318. <div class="pay-list" @click="paySel(index)" v-for="(item,index) in payList" :class="payIndex==index?'payStyle':''">
  319. <div class="img">
  320. <img :src="item.src">
  321. </div>
  322. <div>{{item.name}}</div>
  323. </div>
  324. </div>
  325. <div class="base64" >
  326. <!-- {{qrCode}}-->
  327. <!-- <img v-if="qrCode.qr.qr!='' && payIndex==1 || payIndex==2" :src="qrCode.qr.qr"> -->
  328. <div class="code_right" v-if="qrCode.qr.qr!='' && payIndex==1 || payIndex==2">
  329. <div class="left">
  330. <div class="title">{{payIndex == 1?'微信支付':'支付宝支付'}}</div>
  331. <div class="pay">应付金额<span class="money">{{ payOrder.arr.amount_pay ||0}}</span>元</div>
  332. </div>
  333. <div class="center">
  334. <div class="info">订单提交成功,请尽快付款!</div>
  335. <img :src="qrCode.qr.qr">
  336. <div class="bottom">
  337. <img src="@/assets/img/sys.png" alt="" style="width: 25px;height: 25px;">
  338. <div class="text">扫描二维码支付</div>
  339. </div>
  340. </div>
  341. <div class="right">
  342. <img src="@/assets/img/wx_pay_way.png" alt="" style="width: 150px;height: 200px" v-if="payIndex == 1">
  343. <img src="@/assets/img/zfb_pay_way.png" alt="" style="width: 150px;height: 200px" v-if="payIndex == 2">
  344. </div>
  345. </div>
  346. </div>
  347. <div v-if="payIndex==3 || payIndex==0" class="pay-s" @click="paySubmit()">立即支付</div>
  348. <div v-if="payIndex==4" class="pay-s" @click="copyUrl()">复制链接</div>
  349. <div v-if="payIndex==5">
  350. <div class="box">
  351. <div class="name">收款信息</div>
  352. <div class="view">
  353. 公司名称:{{info.account_name}}
  354. </div>
  355. <div class="view">
  356. 银行名称:{{info.bank_name}}
  357. </div>
  358. <div class="view">
  359. 银行账号:{{splices(info.bank_no)}}
  360. </div>
  361. </div>
  362. <div style="display: flex">
  363. <div class="submits" v-if="!flags" @click="submit_s()">提交</div>
  364. <div class="submits" style="margin-left: 20px" v-if="!flags" @click="addressFlags=true">上传打款凭证</div>
  365. </div>
  366. <div v-if="flags" style="display: flex;margin-left:355px">
  367. <div style="margin-left: 0" class="submits" @click="addressFlags=true">重新上传</div>
  368. <div style="margin-left: 40px!important;" class="submits">审核中...</div>
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. <div>
  376. <RightSliderBar/>
  377. </div>
  378. <Footer/>
  379. </template>
  380. <script setup>
  381. const splices=(value)=>{
  382. let value1=value
  383. if(value){
  384. let values=value.split("");
  385. values.splice(4,0,' ')
  386. values.splice(9,0,' ')
  387. values.splice(14,0,' ')
  388. values.splice(19,0,' ')
  389. let value1=values.join("")
  390. return value1
  391. }
  392. // return value.split('').join(' ')
  393. }
  394. const dates=(value)=>{
  395. var data = new Date(value);
  396. var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  397. var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  398. return data.getFullYear() + "-" + month + "-" + date
  399. }
  400. //记录访问次数
  401. const submit_s=()=>{
  402. let data={
  403. id:payOrder.arr.id,
  404. bank_no:addressStates.bankCard,
  405. bank_name:addressStates.bankName,
  406. bank_username:addressStates.userName,
  407. // image:imageUrl.value
  408. }
  409. po_complete(data).then((res)=>{
  410. if(res.code==1){
  411. ElMessage.success('提交成功')
  412. }else{
  413. ElMessage.error(res.msg)
  414. }
  415. })
  416. }
  417. if(localStorage.getItem('USER__INFO__')){
  418. user_lsp().then((res)=>{
  419. })
  420. }
  421. import { useRouter } from 'vue-router'
  422. import { provide, reactive, ref,onMounted,onUnmounted } from 'vue'
  423. import UserNav from '@/components/User/UserNav.vue'
  424. import indexHeaders from '@/components/Index/indexHeaders.vue'
  425. import ShoppingCart from '@/components/User/ShoppingCart.vue'
  426. import LeftSliderBar from '@/components/Index/LeftSliderBar.vue'
  427. import RightSliderBar from '@/components/Index/RightSliderBar.vue'
  428. import CountDate from '@/components/Index/CountDate.vue'
  429. import Footer from '@/components/Tool/Footer.vue'
  430. import DynamicYzm from '@/components/form/DynamicYzm.vue'
  431. import {router} from "@/router";
  432. const urlTap=ref('')
  433. const imageUrl=ref('')
  434. const flags=ref(false)
  435. const flag_s=ref(false)
  436. import { ElMessage, ElMessageBox } from 'element-plus'
  437. const addressFlags=ref(false)
  438. const loginFormRefss=ref('')
  439. const timer=ref(null)
  440. const m1=mitt();
  441. onUnmounted(()=>{
  442. clears()
  443. })
  444. onMounted(()=>{
  445. orderInfo()
  446. })
  447. const copyUrl=()=>{
  448. let url=window.location.href
  449. //创建input标签
  450. let input = document.createElement('input')
  451. //将input的值设置为需要复制的内容
  452. input.value = '【屏酷】打开链接就可以帮我付款啦,订单号'+payOrder.arr.order_no+' , '+'订单金额'+payOrder.arr.amount_pay+' '+url;
  453. //添加input标签
  454. document.body.appendChild(input)
  455. //选中input标签
  456. input.select()
  457. //执行复制
  458. document.execCommand('copy')
  459. //移除input标签
  460. document.body.removeChild(input)
  461. ElMessage.success('复制成功')
  462. }
  463. m1.on('set_interval',()=>{
  464. if(flag_s.value==false){
  465. flag_s.value=true;
  466. console.error(flag_s.value)
  467. timer.value=setInterval(()=>{
  468. orderDetail({id:payOrder.arr.id}).then((res)=>{
  469. if(res.data.status==5){
  470. router.push({path:'/user/order/success'})
  471. clears();
  472. }
  473. })
  474. },1000)
  475. }
  476. })
  477. const returnSub=()=>{
  478. router.push({ path: '/user/order/submit' })
  479. }
  480. const clears=()=>{
  481. clearInterval(timer.value)
  482. m1.off('setInterVals')
  483. }
  484. const addressTap=()=>{
  485. // loginFormRefss.value.validate(valid => {
  486. // if (!valid) {
  487. // return false
  488. // }
  489. // })
  490. // if(imageUrl.value==''){
  491. // ElMessage({
  492. // message: '请上传打款凭证',
  493. // type: 'warning'
  494. // })
  495. // return;
  496. // }
  497. let data={
  498. id:payOrder.arr.id,
  499. bank_no:addressStates.bankCard,
  500. bank_name:addressStates.bankName,
  501. bank_username:addressStates.userName,
  502. image:imageUrl.value
  503. }
  504. po_complete(data).then((res)=>{
  505. if(res.code==1){
  506. ElMessage.success('上传打款凭证成功')
  507. addressFlags.value=false
  508. flags.value=true
  509. }else{
  510. ElMessage.error(res.msg)
  511. }
  512. })
  513. }
  514. const paySubmit=()=>{
  515. window.location.href=urlTap.value.url
  516. }
  517. const uploads=()=>{
  518. let fd = new FormData();
  519. fd.append("file",files.file.raw);
  520. console.error(fd)
  521. upload_s(fd).then((res)=>{
  522. imageUrl.value=res.data.url
  523. })
  524. }
  525. const qrCode=reactive({
  526. qr:''
  527. })
  528. const addressStates = reactive({
  529. bankCard: '',
  530. bankName:'',
  531. userName:'',
  532. })
  533. const ruless = {
  534. bankCard: formRules('must'),
  535. bankName: formRules('must'),
  536. userName: formRules('must')
  537. }
  538. const { t } = useI18n()
  539. const payOrder=reactive({
  540. arr:[]
  541. })
  542. const orderInfo=()=>{
  543. let url=getUrlParams2(window.location.href);
  544. //如果用户没登录的时候记录地址
  545. if(localStorage.getItem("USER__INFO__")){
  546. }else{
  547. localStorage.setItem("redirectUrl",JSON.stringify(url))
  548. }
  549. orderDetail({"id":url.id}).then((res)=>{
  550. payOrder.arr=res.data
  551. pay_order(res.data.id,1);
  552. })
  553. }
  554. let info=ref('')
  555. const pay_order=(id,indexs)=>{
  556. let data={
  557. id:id||payOrder.arr.id,
  558. pay_type:indexs
  559. }
  560. payOrders(data).then((res)=>{
  561. console.error(res)
  562. if(res.code==1 &&res.data!=null){
  563. qrCode.qr=res.data
  564. urlTap.value=res.data
  565. info.value=res.data
  566. }else if(res.code==1 &&res.data==null){
  567. qrCode.value=null
  568. qrCode.qr.qr=''
  569. }
  570. })
  571. }
  572. const payIndex=ref(0)
  573. const FormState = reactive({
  574. name: '',
  575. cardName:'',
  576. cardBank:'',
  577. cardNumber:'',
  578. })
  579. const paySel=(index)=>{
  580. payIndex.value=index;
  581. pay_order('',index+1)
  582. setTimeout(()=>{
  583. if(payIndex.value==1 || payIndex.value==2){
  584. m1.emit('set_interval')
  585. flag_s.value=true;
  586. }else{
  587. flag_s.value=false
  588. clears();
  589. }
  590. },50)
  591. }
  592. const payList= [
  593. { name: '企业网银', src: 'http://screen-test.zhousi.hdlkeji.com/aksdbn/img/index/pay1.png' },
  594. { name: '微信', src: 'http://screen-test.zhousi.hdlkeji.com/aksdbn/img/index/pay5.png' },
  595. { name: '支付宝', src: 'http://screen-test.zhousi.hdlkeji.com/aksdbn/img/index/pay6.png',},
  596. { name: '银联', src: 'http://screen-test.zhousi.hdlkeji.com/aksdbn/img/index/pay3.png'},
  597. { name: '代付', src: 'http://screen-test.zhousi.hdlkeji.com/aksdbn/img/index/pay4.png' },
  598. { name: '线下支付', src: 'http://screen-test.zhousi.hdlkeji.com/aksdbn/img/index/pay2.png' },
  599. ]
  600. const rules = {
  601. name: [{ required: true, message: t('home.login.form.nameRequired'), trigger: 'blur' }],
  602. cardName: [{ required: true, message: t('home.login.form.cardNameRequired'), trigger: 'blur' }],
  603. cardBank: [{ required: true, message: t('home.login.form.cardBankRequired'), trigger: 'blur' }],
  604. cardNumber: [{ required: true, message: t('home.login.form.cardNumberRequired'), trigger: 'blur' }],
  605. address: [{ required: true, message: t('home.login.form.addressRequired'), trigger: 'blur' }],
  606. addressDetail: [{ required: true, message: t('home.login.form.addressDetailRequired'), trigger: 'blur' }],
  607. userName: [{ required: true, message: t('home.login.form.userNameRequireds'), trigger: 'blur' }],
  608. userPhone: [{ required: true, message: t('home.login.form.phoneRequired'), trigger: 'blur' }],
  609. }
  610. const addressState = reactive({
  611. address: '',
  612. addressDetail:'',
  613. userName:'',
  614. userPhone:'',
  615. })
  616. import {useI18n} from "@/hooks/web/useI18n";
  617. import {detailTime, getUrlParams2, isLogin} from "@/utils";
  618. import {orderDetail, payOrders, po_complete, upload_s, user_lsp} from "@/api/menu1";
  619. import {formRules} from "@/utils/config";
  620. import mitt from "mitt";
  621. const invoice=['电子发票','纸质发票','不需要']
  622. const invoiceType=['个人','企业']
  623. const invoiceSource=['专票','普票']
  624. let addressFlag=ref(false)
  625. let addressSel=ref(false)
  626. let couponFlag=ref(false)
  627. let invoiceFlag=ref(false)
  628. let typeIndex=ref(0)
  629. let sourceIndex=ref(0)
  630. let invoiceIndex=ref(0)
  631. const clearIndex=()=>{
  632. FormState.name=''
  633. FormState.cardName=''
  634. FormState.cardBank=''
  635. FormState.cardNumber=''
  636. }
  637. const handleAvatarSuccess=(res)=>{
  638. console.error(res)
  639. }
  640. const fileSrc=ref('')
  641. const files=ref({
  642. file:{}
  643. })
  644. const handleChange=(file,fileList)=>{
  645. files.file=file
  646. fileSrc.value=file.name
  647. }
  648. isLogin()
  649. </script>
  650. <style lang="less" scoped >
  651. .pay-s{
  652. width: 122px;
  653. height: 40px;
  654. background: #4171B3;
  655. border-radius: 2px;
  656. text-align: center;
  657. line-height: 40px;
  658. color: #fff;
  659. font-size: 16px;
  660. margin:50px 0 0 400px;
  661. cursor: pointer;
  662. }
  663. .upload-s{
  664. cursor: pointer;
  665. width: 100px;
  666. height: 30px;
  667. background: #FFFFFF;
  668. color: #3171B8;
  669. font-size: 16px;
  670. text-align: center;
  671. line-height: 30px;
  672. margin-right: 25px;
  673. margin-bottom: 30px;
  674. border: 1px solid #3171B8;
  675. }
  676. .avatar-uploader .avatar {
  677. width: 100px;
  678. height: 100px;
  679. display: block;
  680. }
  681. .avatar-uploader .el-upload {
  682. border: 1px dashed var(--el-border-color);
  683. border-radius: 6px;
  684. cursor: pointer;
  685. position: relative;
  686. overflow: hidden;
  687. transition: var(--el-transition-duration-fast);
  688. border: 1px solid #f4f4f4;
  689. }
  690. .avatar-uploader .el-upload:hover {
  691. border-color: var(--el-color-primary);
  692. }
  693. .el-icon.avatar-uploader-icon {
  694. font-size: 28px;
  695. color: #8c939d;
  696. //width: 100px;
  697. //height: 100px;
  698. text-align: center;
  699. border: 1px solid #f1f1f1;
  700. padding: 40px;
  701. }
  702. .submits{
  703. width: 122px;
  704. height: 40px;
  705. background: #4171B3;
  706. border-radius: 2px;
  707. text-align: center;
  708. line-height: 40px;
  709. color: #fff;
  710. font-size: 16px;
  711. margin: 20px 0 0 510px;
  712. cursor: pointer;
  713. }
  714. .box{
  715. width: 480px;
  716. border:1px solid #3171B8;
  717. //height: 174px;
  718. //background: #D8D8D8;
  719. padding: 30px;
  720. margin-left: 100px;
  721. //opacity: 0.18;
  722. .name{
  723. color:#333;
  724. font-size: 18px;
  725. text-align: center;
  726. }
  727. .view{
  728. color: #999;
  729. font-size: 16px;
  730. margin-top: 20px;
  731. text-align: center;
  732. }
  733. }
  734. .base64{
  735. display: flex;
  736. img{
  737. width: 200px;
  738. height: 200px;
  739. }
  740. .code_right {
  741. //margin-left: 20px;
  742. margin: 20px 0 20px 20px;
  743. display: flex;
  744. align-content: center;
  745. justify-content: space-between;
  746. box-sizing: border-box;
  747. padding: 10px 40px;
  748. box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  749. .left {
  750. display: flex;
  751. flex-direction: column;
  752. align-items: center;
  753. justify-content: space-between;
  754. .title {
  755. font-size: 25px;
  756. background: #fff;
  757. }
  758. .pay {
  759. font-size: 20px;
  760. }
  761. .money {
  762. color: #EA2813;
  763. }
  764. }
  765. .center {
  766. display: flex;
  767. flex-direction: column;
  768. align-items: center;
  769. justify-content: center;
  770. padding: 30px 0;
  771. .info {
  772. font-size: 12px;
  773. }
  774. .bottom {
  775. margin-top: 10px;
  776. background: #ff7673;
  777. display: flex;
  778. align-items: center;
  779. justify-content: center;
  780. width: 100%;
  781. padding: 5px 0;
  782. .text {
  783. font-size: 14px;
  784. color: #fff;
  785. padding-left: 5px;
  786. }
  787. }
  788. }
  789. .right {
  790. display: flex;
  791. flex-direction: column;
  792. align-items: center;
  793. justify-content: center;
  794. margin: 0 0 0 40px;
  795. }
  796. }
  797. }
  798. .payStyle{
  799. border: 1px solid #3172B9!important;
  800. }
  801. .list {
  802. .list-contents {
  803. width: 314px;
  804. height: 100px;
  805. float: left;
  806. margin-bottom: 30px;
  807. margin-left:20px;
  808. .coupon {
  809. }
  810. .coupon-content {
  811. position: relative;
  812. .coupon-bottom {
  813. padding: 0 20px;
  814. height: 20px;
  815. line-height: 40px;
  816. display: flex;
  817. justify-content: space-between;
  818. margin-top: 0;
  819. .buttons {
  820. color: #E3E3E3 !important;
  821. border: 1px solid #E3E3E3 !important;
  822. }
  823. .coupon-button {
  824. width: 84px;
  825. height: 26px;
  826. background: #F9F9F9;
  827. border-radius: 18px;
  828. border: 1px solid #74D2D4;
  829. text-align: center;
  830. line-height: 26px;
  831. color: #74D2D4;
  832. font-size: 12px;
  833. margin-top: 10px;
  834. }
  835. .coupon-time {
  836. color: #238183;
  837. font-size: 12px;
  838. }
  839. }
  840. .coupon-info {
  841. display: flex;
  842. padding: 25px 20px 0 20px;
  843. .coupon-money {
  844. font-size: 30px;
  845. color: #fff;
  846. .coupon-color {
  847. color: #fff;
  848. }
  849. .color-s {
  850. color: #238183;
  851. }
  852. }
  853. .coupon-condition {
  854. font-size: 12px;
  855. color: #fff;
  856. margin: 15px 0 0 20px;
  857. }
  858. }
  859. .coupon-id {
  860. color: #999999;
  861. font-size: 12px;
  862. margin: 0px 0 0 220px;
  863. padding-top: 10px;
  864. position: absolute;
  865. top: 20px;
  866. }
  867. }
  868. }
  869. }
  870. .coupon{
  871. img{
  872. width: 314px;
  873. height: 100px;
  874. position: absolute;
  875. }
  876. }
  877. .coupon-s{
  878. padding: 60px 0;
  879. }
  880. .address-sels{
  881. padding: 40px 80px;
  882. .address-views{
  883. margin-bottom: 20px;
  884. display: flex;
  885. font-size: 18px;
  886. color: #333;
  887. .checks{
  888. img{
  889. width: 20px;
  890. height:20px;
  891. }
  892. }
  893. .check{
  894. width: 16px;
  895. height: 16px;
  896. border: 1px solid #999999;
  897. border-radius: 10px;
  898. margin-top: 2px;
  899. margin-right: 10px;
  900. }
  901. }
  902. }
  903. .button-s{
  904. display: flex;
  905. justify-content: center;
  906. .colors{
  907. background-color: #3171B8!important;
  908. color: #fff!important;
  909. }
  910. .style{
  911. cursor: pointer;
  912. width: 140px;
  913. height: 30px;
  914. background: #FFFFFF;
  915. color: #3171B8;
  916. font-size: 16px;
  917. text-align: center;
  918. line-height: 30px;
  919. margin-right: 25px;
  920. border: 1px solid #3171B8;
  921. }
  922. }
  923. .address-content{
  924. padding: 0 70px;
  925. .star{
  926. color: #EE341A;
  927. margin: 0 10px 0 0px;
  928. }
  929. .address-view{
  930. display: flex;
  931. line-height: 36px;
  932. }
  933. }
  934. /deep/ .el-textarea__inner{
  935. width: 387px;
  936. }
  937. /deep/ .address-view .el-input{
  938. width: 387px;
  939. height: 36px;
  940. background: #FFFFFF;
  941. font-size: 16px;
  942. }
  943. .el-dialog__header{
  944. text-align: center;
  945. }
  946. /deep/ .message .el-input{
  947. width: 540px;
  948. height: 68px;
  949. background: #FFFFFF;
  950. font-size: 16px;
  951. }
  952. /deep/ .message .el-input .el-input__inner{
  953. height: 68px;
  954. }
  955. /deep/ .el-form-item__error{
  956. margin-left: 10px;
  957. }
  958. /deep/ .invoice-view .el-input{
  959. width: 298px;
  960. height: 33px;
  961. background: #FFFFFF;
  962. margin-left: 10px;
  963. }
  964. /deep/ .sum .el-input{
  965. width: 66px;
  966. height: 30px;
  967. background: #F0F2F5;
  968. //border-radius: 2px;
  969. }
  970. /deep/ .sum .el-input .el-input__inner{
  971. background: #F0F2F5;
  972. border: none;
  973. height: 36px;
  974. }
  975. .login-wrapper{
  976. background-color: #F7F8FA;
  977. padding: 0 260px;
  978. .order-tops{
  979. // height: 193px;
  980. background: #FFFFFF;
  981. border-radius: 2px;
  982. width: 100%;
  983. position: relative;
  984. .line-s{
  985. width: 100%;
  986. position: absolute;
  987. height: 1px;
  988. background-color: #4171B3;
  989. top: 50%;
  990. }
  991. .order-flex{
  992. display: flex;
  993. .order-views{
  994. padding: 23px 0 13px 0;
  995. width: 50%;
  996. text-align: center;
  997. .name{
  998. color: #3171B8;
  999. font-size: 18px;
  1000. margin-top: 10px;
  1001. }
  1002. .img-icon{
  1003. position: relative;
  1004. img{
  1005. width: 50px;
  1006. height: 50px;
  1007. }
  1008. }
  1009. }
  1010. }
  1011. }
  1012. .shopping-total{
  1013. .buttons{
  1014. width: 160px;
  1015. height: 46px;
  1016. background: #4171B3;
  1017. border-radius: 2px;
  1018. text-align: center;
  1019. line-height: 46px;
  1020. color: #fff;
  1021. font-size: 16px;
  1022. margin: 30px auto;
  1023. cursor: pointer;
  1024. }
  1025. width: 339px;
  1026. //height: 1px;
  1027. float: right;
  1028. text-align: center;
  1029. color: #333333;
  1030. font-size: 18px;
  1031. div{
  1032. margin-bottom: 20px;
  1033. }
  1034. }
  1035. .submit{
  1036. .order-colors{
  1037. //width: 334px;
  1038. max-width: 270px;
  1039. margin-bottom: 10px;
  1040. height: 43px;
  1041. font-size: 14px;
  1042. line-height: 43px;
  1043. background: #EE341A;
  1044. border-radius: 12px;
  1045. color: #fff;
  1046. text-align: center;
  1047. }
  1048. .message{
  1049. padding: 0;
  1050. }
  1051. .coupon{
  1052. display: flex;
  1053. padding: 30px 0;
  1054. line-height: 20px;
  1055. .texts{
  1056. margin-left: 10px;
  1057. }
  1058. .checks{
  1059. img{
  1060. width: 20px;
  1061. height:20px;
  1062. }
  1063. }
  1064. .check{
  1065. width: 16px;
  1066. height: 16px;
  1067. border: 1px solid #999999;
  1068. border-radius: 10px;
  1069. margin-top: 2px;
  1070. }
  1071. }
  1072. .shopping{
  1073. .shopping-contents{
  1074. .shopping-lists{
  1075. background-color: #fff;
  1076. display: flex;
  1077. height: 110px;
  1078. width: 100%;
  1079. border-bottom: 1px solid #f4f4f4;
  1080. .price{
  1081. width: 170px;
  1082. text-align: center;
  1083. line-height: 110px;
  1084. border-right: 1px solid #f4f4f4;
  1085. }
  1086. .oper{
  1087. cursor: pointer;
  1088. img{
  1089. width: 30px;
  1090. height: 30px;
  1091. margin: 60px 0 0 100px;
  1092. }
  1093. }
  1094. .sum{
  1095. width: 200px;
  1096. text-align: center;
  1097. border-right: 1px solid #f4f4f4;
  1098. display: flex;
  1099. //line-height: 150px;
  1100. justify-content: center;
  1101. padding: 60px 0;
  1102. .add{
  1103. width: 36px;
  1104. height: 36px;
  1105. background: #F0F2F5;
  1106. //border-radius: 2px;
  1107. line-height: 36px;
  1108. }
  1109. }
  1110. .img{
  1111. width: 500px;
  1112. border-right: 1px solid #f4f4f4;
  1113. display: flex;
  1114. .name{
  1115. color: #333;
  1116. font-size: 15px;
  1117. padding:35px 20px;
  1118. width: 300px;
  1119. height: 40px;
  1120. line-height: 40px;
  1121. }
  1122. .checks{
  1123. margin:45px 20px;
  1124. img{
  1125. width: 20px;
  1126. height: 20px;
  1127. }
  1128. }
  1129. .check{
  1130. width: 16px;
  1131. height: 16px;
  1132. border: 1px solid #999999;
  1133. border-radius: 10px;
  1134. margin: 60px 20px;
  1135. }
  1136. img{
  1137. width: 100px;
  1138. height: 100px;
  1139. margin: 15px 0;
  1140. }
  1141. }
  1142. }
  1143. }
  1144. .shopping-title{
  1145. display: flex;
  1146. height: 50px;
  1147. background: #F0F2F5;
  1148. border-radius: 2px;
  1149. border: 1px solid #D7DBE0;
  1150. line-height: 50px;
  1151. padding: 0 0 0 60px;
  1152. justify-content: space-between;
  1153. div:nth-child(1){
  1154. flex:0 0 420px;
  1155. //flex: 1;
  1156. }
  1157. div:nth-child(2){
  1158. flex: 0 0 130px;
  1159. text-align: center;
  1160. margin-left: 0;
  1161. }
  1162. div:nth-child(3){
  1163. flex: 0 0 100px;
  1164. text-align: center;
  1165. }
  1166. div:nth-child(4){
  1167. flex: 0 0 120px;
  1168. text-align: center;
  1169. margin-right: 20px;
  1170. }
  1171. div:nth-child(5){
  1172. flex: 0 0 130px;
  1173. text-align: left;
  1174. }
  1175. div:nth-child(6){
  1176. flex: 0 0 120px;
  1177. text-align: left;
  1178. }
  1179. div:nth-child(7){
  1180. flex: 0 0 120px;
  1181. text-align: left;
  1182. }
  1183. div:nth-child(8){
  1184. flex: 0 0 150px;
  1185. text-align: left;
  1186. }
  1187. }
  1188. }
  1189. .invoice-from{
  1190. .button{
  1191. display: flex;
  1192. justify-content: center;
  1193. .colors{
  1194. background-color: #3171B8!important;
  1195. color: #fff!important;
  1196. }
  1197. .style{
  1198. width: 140px;
  1199. height: 30px;
  1200. background: #FFFFFF;
  1201. color: #3171B8;
  1202. font-size: 16px;
  1203. text-align: center;
  1204. line-height: 30px;
  1205. margin-right: 25px;
  1206. }
  1207. }
  1208. width: 480px;
  1209. //height: 215px;
  1210. background: #D8D8D8;
  1211. padding: 20px;
  1212. margin-left: 90px;
  1213. .invoice-texts{
  1214. .name{
  1215. color: #999999;
  1216. font-size: 16px;
  1217. }
  1218. .invoice-view{
  1219. display: flex;
  1220. line-height: 33px;
  1221. }
  1222. }
  1223. .invoiceSource{
  1224. display: flex;
  1225. margin-bottom: 20px;
  1226. .name{
  1227. color: #999;
  1228. font-size: 16px;
  1229. margin-top: 8px;
  1230. }
  1231. .colorStyle{
  1232. border: 1px solid #4171B3;
  1233. color: #333!important;
  1234. }
  1235. .source-right{
  1236. color: #4171B3;
  1237. font-size: 14px;
  1238. margin-left: 200px;
  1239. margin-top: 5px;
  1240. }
  1241. .source{
  1242. box-sizing: border-box;
  1243. cursor: pointer;
  1244. width: 58px;
  1245. border-radius: 2px;
  1246. height: 33px;
  1247. text-align: center;
  1248. line-height: 33px;
  1249. color: #999;
  1250. font-size: 16px;
  1251. margin-right: 40px;
  1252. }
  1253. }
  1254. }
  1255. .title{
  1256. height: 50px;
  1257. background: #F0F2F5;
  1258. border-radius: 2px;
  1259. //border: 1px solid #D7DBE0;
  1260. line-height: 50px;
  1261. text-align: center;
  1262. }
  1263. .boxs{
  1264. border: 1px solid #CECECE;
  1265. padding: 0 20px;
  1266. font-size: 14px;
  1267. span{
  1268. color:#999;
  1269. font-size: 14px!important;
  1270. }
  1271. .spans{
  1272. color:#999;
  1273. font-size: 14px;
  1274. height: 30px;
  1275. line-height: 24px;
  1276. }
  1277. }
  1278. .submit-content{
  1279. background: #FFFFFF;
  1280. padding: 30px 40px 10px;
  1281. .submit-view{
  1282. cursor: pointer;
  1283. margin-bottom: 5px;
  1284. font-size: 14px;
  1285. span{
  1286. color: #999;
  1287. font-size: 16px;
  1288. }
  1289. .pay-list{
  1290. text-align: center;
  1291. margin-right: 40px;
  1292. padding: 0 20px;
  1293. img{
  1294. width: 40px;
  1295. height: 40px;
  1296. margin-top:10px;
  1297. }
  1298. }
  1299. .texts{
  1300. box-sizing: border-box;
  1301. }
  1302. .submit-name{
  1303. margin-right: 10px;
  1304. }
  1305. .check{
  1306. color: #999;
  1307. font-size: 14px;
  1308. }
  1309. .submit-button{
  1310. width: 155px;
  1311. height: 30px;
  1312. background: #3171B8;
  1313. text-align: center;
  1314. line-height: 30px;
  1315. color: #fff;
  1316. font-size: 16px;
  1317. margin: 5px 20px 0 0;
  1318. }
  1319. .address-right{
  1320. width: 155px;
  1321. height: 40px;
  1322. background: #3171B8;
  1323. text-align: center;
  1324. line-height: 40px;
  1325. color: #fff;
  1326. font-size: 16px;
  1327. margin: 0 0 0 680px;
  1328. }
  1329. .address-add{
  1330. width: 164px;
  1331. height: 40px;
  1332. border-radius: 2px;
  1333. border: 1px solid #CECECE;
  1334. color: #999;
  1335. font-size: 18px;
  1336. text-align: center;
  1337. line-height: 40px;
  1338. margin: -7px 0 0 0;
  1339. }
  1340. .boxStyle{
  1341. border: 1px solid #4171B3!important;
  1342. padding: 0 8px;
  1343. color: #333!important;
  1344. }
  1345. display: flex;
  1346. line-height: 40px;
  1347. .submit-lable{
  1348. color: #999;
  1349. font-size: 16px;
  1350. margin-right: 30px;
  1351. }
  1352. .name{
  1353. color: #333;
  1354. font-size: 18px;
  1355. }
  1356. .classStyle{
  1357. border: 1px solid #4171B3;
  1358. width: 70px;
  1359. height: 30px;
  1360. border-radius: 2px;
  1361. text-align: center;
  1362. line-height: 30px;
  1363. color: #333;
  1364. }
  1365. }
  1366. }
  1367. }
  1368. }
  1369. </style>