index.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. {include file="public/head"}
  5. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  6. <title>{$title|default=''}</title>
  7. <style>
  8. .flex {
  9. display: flex;
  10. justify-content: flex-start;
  11. align-items: center;
  12. }
  13. .no-shink {
  14. flex-shrink: 0;
  15. }
  16. .mar-l-10 {
  17. margin-left: 10px;
  18. }
  19. .mar-b-10 {
  20. margin-bottom: 10px;
  21. }
  22. .padd-15 {
  23. padding: 0 15px !important;
  24. }
  25. .shopBOx {
  26. margin: 15px 10px !important;
  27. }
  28. .alertBottom {
  29. position: fixed !important;
  30. bottom: 0;
  31. left: 0;
  32. padding-left: 30px !important;
  33. width: 100%;
  34. background-color: #ffffff;
  35. }
  36. .shopImg {
  37. width: 100px;
  38. height: 100px;
  39. }
  40. .clamp2 {
  41. overflow: hidden;
  42. text-overflow: ellipsis;
  43. display: -webkit-box;
  44. -webkit-line-clamp: 2;
  45. -webkit-box-orient: vertical;
  46. }
  47. .itemStart {
  48. align-items: flex-start;
  49. }
  50. .flexcontent {
  51. justify-content: center;
  52. }
  53. .text-cente {
  54. text-align: center
  55. }
  56. .demo-spin-icon-load {
  57. animation: ani-demo-spin 1s linear infinite;
  58. }
  59. @keyframes ani-demo-spin {
  60. from {
  61. transform: rotate(0deg);
  62. }
  63. 50% {
  64. transform: rotate(180deg);
  65. }
  66. to {
  67. transform: rotate(360deg);
  68. }
  69. }
  70. .demo-spin-col {
  71. height: 100px;
  72. position: relative;
  73. border: 1px solid #eee;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div class="wrapper wrapper-content">
  79. <div class="row">
  80. <div class="col-sm-12">
  81. <div class="ibox float-e-margins ">
  82. <div class="ibox-title">
  83. <h5>在线下单</h5>
  84. </div>
  85. <div id="store-attr" class="mp-form" v-cloak="">
  86. <Row class="searchBox padd-15 mar-b-10 mar-l-10" v-if="UserCard">
  87. <i-Col span="6">
  88. <div class="flex">
  89. <span class="no-shink">当前会员卡号:{{UserCard}} &nbsp; 会员余额:{{userData.now_money}}
  90. &nbsp; 消费券:{{userData.integral}} &nbsp; 手机号:{{userData.phone}}</span>
  91. </div>
  92. </i-Col>
  93. </Row>
  94. <Row class="searchBox padd-15" v-if="UserCard">
  95. <i-Col span="6">
  96. <div class="flex">
  97. <span class="no-shink mar-l-10">是否消费券:</span>
  98. <radio-group v-model="is_consumer" type="button">
  99. <Radio :label="1">是</Radio>
  100. <Radio :label="0">否</Radio>
  101. </radio-group>
  102. </div>
  103. </i-Col>
  104. <i-Col span="12">
  105. <div class="flex">
  106. <span class="no-shink mar-l-10">条形码:</span>
  107. <i-Input ref="code" placeholder="请扫描或输入条形码" @on-enter="getShopNum"
  108. v-model="shopId" type="text"></i-Input>
  109. <i-Button class="mar-l-10" type="primary" @click="getShopNum">添加商品</i-Button>
  110. </div>
  111. </i-Col>
  112. </Row>
  113. <Row class="searchBox padd-15" v-else>
  114. <i-Col span="8">
  115. <div class="flex">
  116. <span class="no-shink">会员卡号:</span>
  117. <i-Input ref="usercard" placeholder="请输入会员卡号" v-model="userCardInput"
  118. type="text" @on-enter="checkedUserCard"></i-Input>
  119. <i-Button class="mar-l-10" type="primary" @click="checkedUserCard">开始下单
  120. </i-Button>
  121. </div>
  122. </i-Col>
  123. </Row>
  124. <Row class="searchBox padd-15 shopBOx" v-if="UserCard">
  125. <i-Col span="24">
  126. <div>
  127. <h4 class="mar-b-10">当前商品信息</h4>
  128. <Row class="searchBox padd-15 mar-b-10 ">
  129. <i-Col span="8">
  130. <h4>商品信息</h4>
  131. </i-Col>
  132. <i-Col span="4">
  133. <h4 class="text-cente"> 商品单价</h4>
  134. </i-Col>
  135. <i-Col span="4">
  136. <h4 class="text-cente"> 商品总价</h4>
  137. </i-Col>
  138. <i-Col span="4">
  139. <h4 class="text-cente"> 商品类型</h4>
  140. </i-Col>
  141. <i-Col span="4">
  142. <h4 class="text-cente">
  143. 操作 </h4>
  144. </i-Col>
  145. </Row>
  146. <Row type="flex" align="middle" class="searchBox padd-15 mar-b-10"
  147. v-for="(ls,ind) in shopList" :key="ls.id">
  148. <i-Col span="8">
  149. <div class="flex itemStart">
  150. <img :src="ls.image" class="shopImg">
  151. <div class="titleBox mar-l-10">
  152. <div class="clamp2" :title="ls.name">{{ls.name}}</div>
  153. <div>
  154. 规格:{{ls.typeName}}
  155. </div>
  156. <div>
  157. 数量:{{+ls.num}}
  158. </div>
  159. </div>
  160. </div>
  161. </i-Col>
  162. <i-Col span="4" class="text-cente">
  163. {{ls.price}}
  164. </i-Col>
  165. <i-Col span="4" class="text-cente">
  166. {{(ls.price*ls.num).toFixed(2)}}
  167. </i-Col>
  168. <i-Col span="4" class="text-cente">
  169. {{+ls.is_consumer==0?'普通商品':'消费券商品'}}
  170. </i-Col>
  171. <i-Col span="4">
  172. <div class="flex flexcontent">
  173. <i-Button type="error" size="small" @click="delShop(ls,ind)">删除
  174. </i-Button>
  175. <i-Button class="mar-l-10" type="success" size="small"
  176. @click="changeNumShop(ls,1)">增加
  177. </i-Button>
  178. <i-Button class="mar-l-10" type="warning" size="small"
  179. @click="changeNumShop(ls,-1)">减少
  180. </i-Button>
  181. </div>
  182. </i-Col>
  183. </Row>
  184. </div>
  185. </i-Col>
  186. </Row>
  187. <Row class="searchBox padd-15 mar-b-10 alertBottom" v-if="UserCard">
  188. {eq name="type" value="0"}
  189. <i-Col span="6">
  190. <div class="flex">
  191. <span class="no-shink">选择商家:</span>
  192. <i-Select name="store_id" v-model="form.store_id" style="width: 80%" filterable>
  193. {volist name="store" id="v" }
  194. <i-Option value="{$v.id}">{$v.name}(id:{$v.id})</i-Option>
  195. {/volist}
  196. </i-Select>
  197. </div>
  198. </i-Col>
  199. {/eq}
  200. <i-Col span="6">
  201. <div class="flex">
  202. <span class="no-shink mar-l-10">支付方式:</span>
  203. <i-Select name="store_id" v-model="form.pay_type" default-label="微信"
  204. style="width: 80%" filterable>
  205. <!-- <i-Option value="alipay">支付宝</i-Option>-->
  206. <!-- <i-Option value="weixin">微信</i-Option>-->
  207. <i-Option value="jialie">嘉联支付</i-Option>
  208. -->
  209. <i-Option value="yue">余额</i-Option>
  210. <i-Option value="integral">消费券</i-Option>
  211. <!-- <i-Option value="consumer">消费券</i-Option>-->
  212. <i-Option value="offline">线下支付</i-Option>
  213. </i-Select>
  214. </div>
  215. </i-Col>
  216. <i-Col span="6">
  217. <div class="flex">
  218. <span class="no-shink mar-l-10">当前金额:¥{{allPayMoney}}</span>
  219. <i-Button class="mar-l-10" type="success" @click="submit">确认下单</i-Button>
  220. </div>
  221. </i-Col>
  222. </Row>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. <script>
  229. mpFrame.start(function(Vue) {
  230. new Vue({
  231. data: function() {
  232. return {
  233. form: {
  234. store_id: '{eq name="type" value="1"}{$store.0.id}{/eq}', //商家id
  235. pay_type: 'weixin' //支付类型
  236. },
  237. shopList: [], //当前选中的商品
  238. userCardInput: '', //用户输入内容
  239. UserCard: '', //当前选中的会员卡号
  240. userId: '', //当前选中的用户id
  241. userData: {}, //保存用户信息
  242. shopId: '', //当前商品条形码
  243. is_consumer: 0, //当前是否消费券
  244. lodingAddCart: false, //判断是否正在加入购物车
  245. }
  246. },
  247. mounted() {
  248. const that = this;
  249. //获取会员卡号焦点
  250. that.$nextTick(function() {
  251. that.$refs.usercard.focus();
  252. })
  253. },
  254. computed: {
  255. allPayMoney() {
  256. let money = 0;
  257. for (let i = 0; i < this.shopList.length; i++) {
  258. const item = this.shopList[i]
  259. money += item.price * item.num
  260. }
  261. return +(money.toFixed(2));
  262. }
  263. },
  264. methods: {
  265. // 修复订单
  266. async orderContrast() {
  267. // 开始处理数据
  268. const ind = layer.load(2)
  269. const that = this;
  270. const userCart = (await $eb.axios.get('{:Url("lst")}' + '?uid=' + that.userId))
  271. .data.data.valid; //线上购物车商品
  272. const shopList = that.shopList; //本地购物车商品
  273. const errorCartList = []; //错误数据保存
  274. for (let i = 0; i < userCart.length; i++) {
  275. const uObj = userCart[i];
  276. for (let s = 0; s < shopList.length; s++) {
  277. const sObj = shopList[s];
  278. // 判断是否同一个商品
  279. if (uObj.cartId == sObj.cartId) {
  280. // 判断是否数据不对
  281. if (+uObj.cart_num < +sObj.num) {
  282. // 处理错误数据
  283. await that.changeCartShop(sObj.cartId, sObj.num)
  284. }
  285. break
  286. }
  287. }
  288. }
  289. layer.alert('修复成功')
  290. layer.close(ind);
  291. },
  292. //选中用户卡号
  293. checkedUserCard(e) {
  294. const that = this;
  295. if (that.userCardInput.length == 12 || that.userCardInput.length == 15 || that
  296. .userCardInput.length == 8 || that.userCardInput.length == 11 || that
  297. .userCardInput == '1') {
  298. //初始化用户数据
  299. that.userId = '';
  300. that.userData = {}
  301. //请求获取用户信息
  302. $eb.axios.post('{:Url("getCardNo")}' + '?card_no=' + that.userCardInput).then(
  303. function(res) {
  304. console.log(res)
  305. const data = res.data;
  306. if (data.status == 200) {
  307. that.UserCard = that.userCardInput;
  308. that.userId = data.data.uid;
  309. that.userData = data.data.user
  310. console.log('获取焦点')
  311. that.$nextTick(function() {
  312. that.$refs.code.focus();
  313. // 清空购物车
  314. that.delCartAll()
  315. })
  316. } else {
  317. layer.msg(data.msg, {
  318. icon: 5
  319. });
  320. }
  321. }).catch(function(err) {
  322. console.log(err);
  323. })
  324. //设置获取焦点
  325. } else {
  326. layer.msg('请输入8位,12位,17位卡号会员卡号,或输入1', {
  327. icon: 5
  328. });
  329. }
  330. },
  331. //删除购物车商品
  332. delShop(ls, ind) {
  333. const that = this;
  334. //询问框
  335. layer.confirm('是否删除当前商品?', {
  336. btn: ['是', '否'] //按钮
  337. }, function(index) {
  338. layer.close(index);
  339. //删除数组数据
  340. that.shopList.splice(ind, 1);
  341. //重新获取焦点
  342. that.$refs.code.focus();
  343. //删除购物车数据
  344. that.delCartShop([ls.cartId])
  345. layer.msg('删除成功!', {
  346. icon: 1
  347. });
  348. }, function(index) {
  349. layer.close(index);
  350. });
  351. },
  352. // 清空购物车
  353. delCartAll() {
  354. const that = this;
  355. console.log('gouwuche ', that.userId);
  356. $eb.axios.post('{:Url("clear_cart")}', {
  357. uid: that.userId
  358. }).then(function(res) {
  359. console.log(res, '购物车清空成功')
  360. }).catch(function(err) {
  361. console.log(err);
  362. })
  363. },
  364. //删除购物车数据
  365. delCartShop(ids) {
  366. const that = this;
  367. $eb.axios.post('{:Url("del")}', {
  368. ids: ids,
  369. uid: that.userId
  370. }).then(function(res) {
  371. console.log(res, '购物车删除成功')
  372. }).catch(function(err) {
  373. console.log(err);
  374. })
  375. },
  376. //增加减少数量
  377. changeNumShop(item, type) {
  378. const that = this;
  379. layer.prompt({
  380. title: '请输入需要' + (type > 0 ? '添加' : '减少') + '的数量',
  381. formType: 0
  382. }, function(pass, index) {
  383. layer.close(index);
  384. const nt = /^[0-9]*$/g; //匹配数字
  385. if (!nt.test(pass)) {
  386. console.log(nt.test(pass), '判断是否正确');
  387. layer.msg('请输入数字')
  388. return false
  389. }
  390. console.log(pass);
  391. if ((item.num * 1) + (pass * type) > 0) {
  392. //修改商品数量
  393. that.changeCartShop(item.cartId, (item.num * 1) + pass * type).then(
  394. function(data) {
  395. console.log(data.data.status);
  396. if (data.data.status == 200) {
  397. item.num = ((item.num * 1) + pass * type).toFixed(3);
  398. layer.msg('成功' + (type > 0 ? '添加' : '减少') + pass +
  399. '件商品')
  400. } else {
  401. layer.msg(data.data.msg);
  402. }
  403. }).catch(function(data) {
  404. console.log(data.data.status);
  405. layer.msg(data.data.msg);
  406. })
  407. } else {
  408. layer.msg('商品数量不可小于0')
  409. }
  410. });
  411. },
  412. //处理扫码加入商品时间
  413. async getShopNum() {
  414. const that = this;
  415. if (that.lodingAddCart) {
  416. that.shopId = '';
  417. iView.Message.warning('扫码速度过快,加入失败')
  418. return
  419. }
  420. that.lodingAddCart = true;
  421. await that.isShopNum().catch(() => {
  422. that.lodingAddCart = false;
  423. })
  424. that.lodingAddCart = false;
  425. // 处理设置允许获得焦点
  426. that.$nextTick(function() {
  427. that.$refs.code.focus();
  428. })
  429. },
  430. //查询商品是否有库存
  431. isShopNum() {
  432. const that = this;
  433. let num = 0;
  434. let orderId = 0;
  435. if (that.shopId.length == 13 && that.shopId.substr(0, 2) == '20') {
  436. orderId = that.shopId.substr(2, 5);
  437. num = (Math.floor(that.shopId.substr(7, 6) / 10) / 1000).toFixed(3);
  438. } else {
  439. orderId = that.shopId;
  440. num = 1
  441. }
  442. that.shopId = '';
  443. return new Promise((resolve, reject) => {
  444. $eb.axios.post('{:Url("getBarCode")}' + (orderId ? '?bar_code=' +
  445. orderId : ''))
  446. .then(function(res) {
  447. // console.log(res);
  448. const data = res.data.data;
  449. // console.log(data, '返回数据')
  450. if (that.is_consumer != data.is_consumer) {
  451. if (that.is_consumer == 1) {
  452. layer.msg('请选择消费券商品', {
  453. icon: 5
  454. })
  455. }
  456. if (that.is_consumer == 0) {
  457. layer.msg('请选择普通商品', {
  458. icon: 5
  459. })
  460. }
  461. resolve()
  462. } else {
  463. //添加到购物车
  464. that.addCart(data, num).then(() => {
  465. console.log('购物车加入成功');
  466. resolve()
  467. }).catch((err) => {
  468. console.log('购物车加入失败');
  469. reject()
  470. })
  471. }
  472. }).catch(function(err) {
  473. reject(err)
  474. console.log(err);
  475. })
  476. })
  477. },
  478. //添加购物车
  479. addCart(product, num = 1) {
  480. const that = this
  481. console.log('开始添加购物车');
  482. let pushData = {
  483. productId: product.product_id, //普通产品编号
  484. uid: this.userId,
  485. uniqueId: product.unique, //属性唯一值
  486. cartNum: num, //购物车数量
  487. new: 0, // 1 加入购物车直接购买 0 加入购物车
  488. }
  489. return new Promise((resolve, reject) => {
  490. $eb.axios.post('{:Url("add_cart")}', pushData).then(function(res) {
  491. console.log(res)
  492. const data = res.data;
  493. if (data.status == 200) {
  494. //保存购物车id
  495. const cartId = data.data.cartId
  496. //判断是否有这个商品
  497. const ind = that.shopList.findIndex(function(a) {
  498. if (a.cartId == cartId) {
  499. return true
  500. } else {
  501. return false
  502. }
  503. })
  504. //判断这个商品是否已经存在数组
  505. if (ind > -1) {
  506. that.shopList[ind].num = (+that.shopList[ind].num + (
  507. +num)).toFixed(3);
  508. } else {
  509. //初始化商品
  510. that.initShopData(product, cartId, (+num).toFixed(3))
  511. }
  512. resolve(true)
  513. } else {
  514. layer.msg(data.msg, {
  515. icon: 5
  516. });
  517. reject(data)
  518. }
  519. }).catch(function(err) {
  520. reject(err)
  521. console.log(err);
  522. })
  523. })
  524. },
  525. //初始化购物车商品
  526. initShopData(product, cartId, num) {
  527. const that = this;
  528. that.shopList = ([{
  529. name: product.store_name, //商品
  530. num: num, //购物车中的数量
  531. id: product.product_id, //当前商品id
  532. cartId: cartId, //保存购物车id
  533. typeName: product.suk, //商品规格名称
  534. unique: product.unique, //商品规格id
  535. image: product.image, //商品主图
  536. price: product.price, //商品价格
  537. is_consumer: product.is_consumer //商品类型
  538. }]).concat(that.shopList);
  539. // console.log(this, '初始化后this对象')
  540. //初始化该商品为1
  541. that.changeCartShop(cartId, num)
  542. },
  543. //修改购物车物品数量
  544. changeCartShop(cartId, num) {
  545. const that = this;
  546. return new Promise(function(ok, erro) {
  547. $eb.axios.post('{:Url("num")}', {
  548. id: cartId,
  549. number: num,
  550. uid: that.userId
  551. }).then(function(res) {
  552. console.log(ok)
  553. ok(res)
  554. }).catch(function(err) {
  555. erro(err)
  556. console.log(err);
  557. })
  558. })
  559. },
  560. submit: async function() {
  561. let that = this;
  562. // console.log(that.form.store_id, '当前门店id')
  563. //当前门店
  564. if (!that.form.store_id) {
  565. return layer.msg('请选择门店', {
  566. icon: 5
  567. });
  568. }
  569. if (!that.shopList.length > 0) {
  570. return layer.msg('请选择商品', {
  571. icon: 5
  572. });
  573. }
  574. //用于保存当前选中的商品cardid
  575. let pusharr = []
  576. for (let i = 0; i < that.shopList.length; i++) {
  577. pusharr.push(that.shopList[i].cartId);
  578. }
  579. //提交订单
  580. try {
  581. //提交数据
  582. let pushData = {
  583. cartId: pusharr.join(','),
  584. uid: that.userId
  585. }
  586. let res = await $eb.axios.post('{:Url("confirm")}', pushData);
  587. const orderKey = res.data.data.orderKey;
  588. let money = await that.computedOrder(orderKey);
  589. layer.confirm('订单总金额:¥' + that.allPayMoney.toFixed(2) + '<br/> vip优惠:¥' + ((
  590. that.allPayMoney - money.pay_price) > 0 ? (
  591. that.allPayMoney - money.pay_price).toFixed(
  592. 2) : 0) + '<br/> 实际支付:¥' + money.pay_price
  593. .toFixed(2), {
  594. btn: ['立即支付', '取消', '修复订单'], //按钮
  595. yes: async function(index) {
  596. layer.close(index);
  597. try {
  598. //微信
  599. // if (that.form.pay_type == 'weixin') {
  600. // let qr = await that.weixinPay();
  601. // that.create(orderKey, qr)
  602. // }
  603. // 余额
  604. if (that.form.pay_type == 'yue') {
  605. that.create(orderKey)
  606. }
  607. //现金
  608. if (that.form.pay_type == 'offline') {
  609. that.create(orderKey)
  610. }
  611. // 积分
  612. if (that.form.pay_type == 'integral') {
  613. that.create(orderKey)
  614. }
  615. //支付宝
  616. // if (that.form.pay_type == 'alipay') {
  617. // that.create(orderKey)
  618. // }
  619. if (that.form.pay_type == 'jialie') {
  620. let qr = await that.jialiePay();
  621. that.create(orderKey, qr)
  622. }
  623. } catch (e) {
  624. console.log(e);
  625. }
  626. },
  627. btn2: function(index) {
  628. layer.close(index);
  629. },
  630. btn3: function(index) {
  631. console.log('对比');
  632. that.orderContrast();
  633. },
  634. });
  635. console.log(money, '金额计算');
  636. } catch (e) {
  637. console.log(e)
  638. }
  639. },
  640. weixinPay() {
  641. return new Promise(function(ok, err) {
  642. layer.prompt({
  643. title: '请输入微信付款码编号',
  644. formType: 0
  645. }, function(pass, index) {
  646. layer.close(index);
  647. ok(pass)
  648. });
  649. })
  650. },
  651. //嘉联支付验证
  652. jialiePay() {
  653. return new Promise(function(ok, err) {
  654. layer.prompt({
  655. title: '请输入付款码编号',
  656. formType: 0
  657. }, function(pass, index) {
  658. layer.close(index);
  659. ok(pass)
  660. });
  661. })
  662. },
  663. //计算订单价格
  664. computedOrder(key) {
  665. const that = this;
  666. return new Promise(function(ok, erro) {
  667. $eb.axios.post('{:Url("computedOrder")}', {
  668. key,
  669. uid: that.userId
  670. }).then(function(res) {
  671. //保存订单key
  672. ok(res.data.data.result)
  673. }).catch(function(err) {
  674. erro(err)
  675. })
  676. })
  677. },
  678. //创建订单
  679. create(key, qr) {
  680. let that = this;
  681. let data = {
  682. key: key,
  683. uid: that.userId,
  684. shipping_type: 2,
  685. store_id: that.form.store_id,
  686. real_name: that.userData.nickname,
  687. phone: that.userData.phone,
  688. payType: that.form.pay_type //支付方式
  689. };
  690. //判断是否需要传入code码
  691. if (qr) {
  692. data.auth_code = qr;
  693. }
  694. //提交订单
  695. $eb.axios.post('{:Url("create")}', data).then(function(res) {
  696. layer.confirm(res.data.msg + '<br/>' + '是否刷新?', {
  697. btn: ['刷新', '取消'] //按钮
  698. }, function(index) {
  699. //清除用户卡号信息
  700. that.UserCard = '';
  701. window.location.reload();
  702. //parent.$(".J_iframe:visible")[0].contentWindow.location.reload();
  703. layer.close(index);
  704. }, function(index) {
  705. layer.close(index);
  706. });
  707. console.log(res)
  708. }).catch(function(err) {
  709. })
  710. }
  711. },
  712. }).$mount(document.getElementById('store-attr'))
  713. })
  714. </script>