paymentOrder.vue 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  1. <<<<<<< HEAD
  2. <template>
  3. <view class="content">
  4. <view class="inner">
  5. <!-- 时间、价格 -->
  6. <view class="time-price">
  7. <text class="time">待支付</text>
  8. <view class="price-box">
  9. <text class="unit">¥</text>
  10. <text class="num">{{order ? (Number(order.payMoney) || 0).toFixed(2) : "0.00"}}</text>
  11. </view>
  12. </view>
  13. <!-- 支付方式 -->
  14. <view class="pay-type">
  15. <view class="title">支付方式</view>
  16. <radio-group @change="handlePayTypeChange">
  17. <view class="item">
  18. <view class="left">
  19. <image src="/static/images/wecha_pay.png" mode=""></image>
  20. <text class="text">微信支付</text>
  21. </view>
  22. <label>
  23. <radio :value="1" :checked="payType === 1" />
  24. </label>
  25. </view>
  26. <!-- #ifdef APP-PLUS||H5 -->
  27. <view class="item">
  28. <view class="left">
  29. <image src="/static/images/zfb.png" mode=""></image>
  30. <text class="text">支付宝</text>
  31. </view>
  32. <label>
  33. <radio :value="2" :checked="payType === 2" />
  34. </label>
  35. </view>
  36. <!-- #endif -->
  37. </radio-group>
  38. </view>
  39. <!-- 订单详情查看 -->
  40. <view class="order-info">
  41. <view class="title">订单信息</view>
  42. <view class="item">
  43. <text class="label">订单编号</text>
  44. <view class="sn-box">
  45. <view>
  46. <view class="text">{{order.orderCode}}</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="item">
  51. <text class="label">下单时间</text>
  52. <text class="text">{{ formattedDate}} </text>
  53. </view>
  54. <view class="item">
  55. <text class="label">订单金额</text>
  56. <text class="text"
  57. v-if="order!=null">{{order ? (Number(order.totalPrice) || 0).toFixed(2) : "0.00"}}</text>
  58. </view>
  59. <view class="item">
  60. <text class="label">优惠券</text>
  61. <text class="text">-¥{{order ? (Number(order.discountMoney) || 0).toFixed(2) : "0.00"}} </text>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="btn-box">
  66. <view class="btn" @click="payOrder()">去支付</view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import dayjs from 'dayjs';
  72. import {
  73. weChatPayment
  74. } from '@/api/pay_new'
  75. import {
  76. zfbPayment,
  77. // weChatPayment
  78. } from '@/api/pay'
  79. import {
  80. payConfirmReward,
  81. } from '@/api/order'
  82. export default {
  83. data() {
  84. return {
  85. type:'',
  86. payPrice: null,
  87. newOrder: {},
  88. payType: 2,
  89. order: null,
  90. orderId: null,
  91. payDelivery: 0,
  92. payMoney: 0,
  93. config: null,
  94. payType: 1,
  95. user: null,
  96. couponUserId: null
  97. }
  98. },
  99. computed: {
  100. formattedDate() {
  101. return this.order?.createTime ? dayjs(this.order.createTime).format('YYYY-MM-DD HH:mm:ss') : '';
  102. },
  103. payLimitTime() {
  104. return this.order?.updateTime ?
  105. dayjs(this.order.updateTime).add(2, 'day').format('YYYY-MM-DD HH:mm:ss') :
  106. '';
  107. }
  108. },
  109. onLoad(options) {
  110. // if (options.payPrice) {
  111. // this.payPrice = options.payPrice;
  112. // }
  113. if (options.couponUserId) {
  114. this.couponUserId = options.couponUserId;
  115. }
  116. console.log("支付订单是>>", options)
  117. this.type = options.type;
  118. // this.liveId = options.liveId
  119. // this.productId=options.productId
  120. // console.log("支付订单",options)
  121. if (options.orderList) {
  122. try {
  123. const decoded = decodeURIComponent(options.orderList);
  124. this.order = JSON.parse(decoded) || {}; // 默认空对象
  125. } catch (e) {
  126. console.error('参数解析失败:', e);
  127. this.order = {}; // 显式赋默认值
  128. }
  129. }
  130. },
  131. // //发送给朋友
  132. // onShareAppMessage(res) {
  133. // const combinationOrderId = this.combinationOrderId ?
  134. // `&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
  135. // return {
  136. // title: "帮TA支付",
  137. // path: '/pages_user/user/otherPaymentOrder?orderId=' + this.orderId + combinationOrderId,
  138. // imageUrl: '/static/images/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  139. // }
  140. // },
  141. methods: {
  142. weixinPayOrder() {
  143. var data = {
  144. orderId: this.order.orderId,
  145. payType: 1
  146. // payType: this.order.payType
  147. };
  148. var that = this;
  149. uni.showLoading();
  150. weChatPayment(data).then(
  151. res => {
  152. if (res.code == 200) {
  153. console.log(res);
  154. if (res.payType == 1 || res.payType == 2) {
  155. var result = JSON.parse(res.result);
  156. uni.requestPayment({
  157. provider: 'wxpay',
  158. timeStamp: result.timeStamp,
  159. nonceStr: result.nonceStr,
  160. package: result.package,
  161. signType: result.signType,
  162. paySign: result.paySign,
  163. success: function(res) {
  164. uni.hideLoading();
  165. uni.redirectTo({
  166. url: "./success?order=" + JSON.stringify(that.newOrder)
  167. })
  168. },
  169. fail: function(err) {
  170. uni.showToast({
  171. icon: 'none',
  172. title: 'fail:' + JSON.stringify(err),
  173. });
  174. uni.hideLoading();
  175. }
  176. });
  177. }
  178. } else {
  179. uni.showToast({
  180. icon: 'none',
  181. title: res.msg,
  182. });
  183. }
  184. },
  185. rej => {}
  186. );
  187. },
  188. payOrder() {
  189. if (this.type == 'win') {
  190. this.toPayConfirmReward()
  191. } else {
  192. if (this.payType == 1) {
  193. console.log("这个order", this.order)
  194. const {
  195. itemJson,
  196. ...newOrder
  197. } = this.order;
  198. this.newOrder = newOrder;
  199. console.log("这个newOrder", this.newOrder)
  200. this.weixinPayOrder()
  201. } else {
  202. uni.showToast({
  203. title: "暂时无可用支付",
  204. icon: 'none'
  205. })
  206. }
  207. }
  208. },
  209. // 选微信支付或者支付宝支付
  210. handlePayTypeChange(e) {
  211. this.payType = e.detail.value; // 获取选中的 value
  212. console.log('当前选中:', this.payType);
  213. },
  214. toPayConfirmReward() {
  215. let data={
  216. orderId:this.order.orderId
  217. }
  218. payConfirmReward(data).then(
  219. res => {
  220. if (res.code == 200) {
  221. const {
  222. itemJson,
  223. ...newOrder
  224. } = this.order;
  225. uni.showToast({
  226. icon: 'none',
  227. title: res.msg,
  228. });
  229. uni.redirectTo({
  230. url: "./success?order=" + JSON.stringify(newOrder)
  231. })
  232. } else {
  233. uni.showToast({
  234. icon: 'none',
  235. title: "请求失败",
  236. });
  237. }
  238. },
  239. rej => {}
  240. );
  241. },
  242. getUserInfo() {
  243. getUserInfo().then(
  244. res => {
  245. if (res.code == 200) {
  246. if (res.user != null) {
  247. this.user = res.user;
  248. }
  249. } else {
  250. uni.showToast({
  251. icon: 'none',
  252. title: "请求失败",
  253. });
  254. }
  255. },
  256. rej => {}
  257. );
  258. },
  259. getStoreConfig() {
  260. getStoreConfig().then(
  261. res => {
  262. if (res.code == 200) {
  263. this.config = res.data
  264. console.log(this.config);
  265. }
  266. },
  267. rej => {}
  268. );
  269. },
  270. payTypeChange(e) {
  271. if (this.combinationOrderId) {
  272. this.editPayTypeByCombinationId(e.detail.value)
  273. } else {
  274. this.editPayType(e.detail.value)
  275. }
  276. },
  277. editPayType(payType) {
  278. var data = {
  279. orderId: this.orderId,
  280. payType: payType
  281. };
  282. var that = this;
  283. uni.showLoading();
  284. editPayType(data).then(
  285. res => {
  286. if (res.code == 200) {
  287. console.log(res);
  288. uni.hideLoading();
  289. that.order = res.order;
  290. that.order.orderCodes = that.order.orderCode ? [that.order.orderCode] : []
  291. that.orderCode = that.order.orderCode
  292. // this.payType=this.order.payType
  293. this.payMoney = this.order.payMoney;
  294. this.payDelivery = this.order.payDelivery;
  295. } else {
  296. uni.showToast({
  297. icon: 'none',
  298. title: res.msg,
  299. });
  300. }
  301. },
  302. rej => {}
  303. );
  304. },
  305. }
  306. }
  307. </script>
  308. <style lang="scss">
  309. page {
  310. height: 100%;
  311. }
  312. .content {
  313. height: 100%;
  314. display: flex;
  315. flex-direction: column;
  316. justify-content: space-between;
  317. .inner {
  318. padding: 20upx;
  319. .time-price {
  320. box-sizing: border-box;
  321. padding: 50upx 0upx;
  322. background: #FFFFFF;
  323. border-radius: 16upx;
  324. display: flex;
  325. flex-direction: column;
  326. align-items: center;
  327. .time {
  328. font-size: 32upx;
  329. font-family: PingFang SC;
  330. font-weight: 500;
  331. color: #222222;
  332. line-height: 1;
  333. text-align: center;
  334. }
  335. .desc {
  336. margin: 30upx 0upx 15upx;
  337. font-size: 26upx;
  338. font-family: PingFang SC;
  339. color: #999999;
  340. line-height: 1;
  341. text-align: center;
  342. }
  343. .price-box {
  344. display: flex;
  345. align-items: flex-end;
  346. margin-top: 28upx;
  347. .unit {
  348. font-size: 32upx;
  349. font-family: PingFang SC;
  350. font-weight: bold;
  351. color: #FF6633;
  352. line-height: 1.3;
  353. margin-right: 10upx;
  354. }
  355. .num {
  356. font-size: 56upx;
  357. font-family: PingFang SC;
  358. font-weight: bold;
  359. color: #FF6633;
  360. line-height: 1;
  361. }
  362. }
  363. }
  364. .pay-type {
  365. box-sizing: border-box;
  366. background: #FFFFFF;
  367. border-radius: 16upx;
  368. margin-top: 20upx;
  369. padding: 40upx 30upx;
  370. display: flex;
  371. flex-direction: column;
  372. justify-content: space-between;
  373. .title {
  374. font-size: 28upx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #999999;
  378. line-height: 1;
  379. margin-bottom: 10upx;
  380. }
  381. .item {
  382. padding: 15upx 0upx;
  383. display: flex;
  384. align-items: center;
  385. justify-content: space-between;
  386. .left {
  387. display: flex;
  388. align-items: center;
  389. image {
  390. width: 44upx;
  391. height: 44upx;
  392. margin-right: 20upx;
  393. }
  394. .text {
  395. font-size: 30upx;
  396. font-family: PingFang SC;
  397. font-weight: bold;
  398. color: #222222;
  399. line-height: 1;
  400. }
  401. }
  402. }
  403. }
  404. .order-info {
  405. margin-top: 20upx;
  406. background: #FFFFFF;
  407. border-radius: 16upx;
  408. padding: 40upx 30upx;
  409. .title {
  410. font-size: 30upx;
  411. font-family: PingFang SC;
  412. font-weight: bold;
  413. color: #222222;
  414. line-height: 1;
  415. }
  416. .item {
  417. margin-top: 40upx;
  418. display: flex;
  419. align-items: center;
  420. justify-content: space-between;
  421. .label {
  422. font-size: 26upx;
  423. font-family: PingFang SC;
  424. font-weight: 500;
  425. color: #666666;
  426. line-height: 1;
  427. }
  428. .text {
  429. font-size: 26upx;
  430. font-family: PingFang SC;
  431. font-weight: 500;
  432. color: #222222;
  433. line-height: 32upx;
  434. }
  435. .cont-text {
  436. font-size: 26upx;
  437. font-family: PingFang SC;
  438. font-weight: 500;
  439. color: #666666;
  440. .bold {
  441. color: #111111;
  442. }
  443. }
  444. .sn-box {
  445. display: flex;
  446. align-items: center;
  447. .copy-btn {
  448. width: 58upx;
  449. height: 32upx;
  450. line-height: 32upx;
  451. text-align: center;
  452. font-size: 22upx;
  453. font-weight: 500;
  454. color: #222222;
  455. background: #F5F5F5;
  456. border-radius: 4upx;
  457. margin-left: 24upx;
  458. }
  459. }
  460. }
  461. .line {
  462. width: 100%;
  463. height: 1px;
  464. background: #F0F0F0;
  465. margin-top: 30upx;
  466. }
  467. }
  468. }
  469. .btn-box {
  470. height: 242upx;
  471. background: #FFFFFF;
  472. display: flex;
  473. align-items: center;
  474. justify-content: center;
  475. flex-direction: column;
  476. .btn {
  477. width: 91.73%;
  478. height: 88upx;
  479. line-height: 88upx;
  480. font-size: 30upx;
  481. font-family: PingFang SC;
  482. font-weight: bold;
  483. color: #FFFFFF;
  484. text-align: center;
  485. background: #2BC7B9;
  486. border-radius: 44upx;
  487. margin-bottom: 10rpx;
  488. }
  489. .other-btn {
  490. width: 91.73%;
  491. height: 88upx;
  492. line-height: 88upx;
  493. font-size: 30upx;
  494. font-family: PingFang SC;
  495. font-weight: bold;
  496. color: #2BC7B9;
  497. border: 1rpx solid #2BC7B9;
  498. text-align: center;
  499. background: #FFFFFF;
  500. border-radius: 44upx;
  501. margin-bottom: 10rpx;
  502. position: relative;
  503. .share {
  504. display: inline-block;
  505. position: absolute;
  506. top: 0;
  507. left: 0;
  508. width: 100%;
  509. height: 100%;
  510. opacity: 0;
  511. }
  512. }
  513. }
  514. }
  515. =======
  516. <template>
  517. <view class="content">
  518. <view class="inner">
  519. <!-- 时间、价格 -->
  520. <view class="time-price">
  521. <text class="time">待支付</text>
  522. <view class="price-box">
  523. <text class="unit">¥</text>
  524. <text class="num">{{order ? (Number(order.payMoney) || 0).toFixed(2) : "0.00"}}</text>
  525. </view>
  526. </view>
  527. <!-- 支付方式 -->
  528. <view class="pay-type">
  529. <view class="title">支付方式</view>
  530. <radio-group @change="handlePayTypeChange">
  531. <view class="item">
  532. <view class="left">
  533. <image src="/static/images/wecha_pay.png" mode=""></image>
  534. <text class="text">微信支付</text>
  535. </view>
  536. <label>
  537. <radio :value="1" :checked="payType === 1" />
  538. </label>
  539. </view>
  540. <!-- #ifdef APP-PLUS||H5 -->
  541. <view class="item">
  542. <view class="left">
  543. <image src="/static/images/zfb.png" mode=""></image>
  544. <text class="text">支付宝</text>
  545. </view>
  546. <label>
  547. <radio :value="2" :checked="payType === 2" />
  548. </label>
  549. </view>
  550. <!-- #endif -->
  551. </radio-group>
  552. </view>
  553. <!-- 订单详情查看 -->
  554. <view class="order-info">
  555. <view class="title">订单信息</view>
  556. <view class="item">
  557. <text class="label">订单编号</text>
  558. <view class="sn-box">
  559. <view>
  560. <view class="text">{{order.orderCode}}</view>
  561. </view>
  562. </view>
  563. </view>
  564. <view class="item">
  565. <text class="label">下单时间</text>
  566. <text class="text">{{ formattedDate}} </text>
  567. </view>
  568. <view class="item">
  569. <text class="label">订单金额</text>
  570. <text class="text"
  571. v-if="order!=null">{{order ? (Number(order.totalPrice) || 0).toFixed(2) : "0.00"}}</text>
  572. </view>
  573. <view class="item">
  574. <text class="label">优惠券</text>
  575. <text class="text">-¥{{order ? (Number(order.discountMoney) || 0).toFixed(2) : "0.00"}} </text>
  576. </view>
  577. </view>
  578. </view>
  579. <view class="btn-box">
  580. <view class="btn" @click="payOrder()">去支付</view>
  581. </view>
  582. </view>
  583. </template>
  584. <script>
  585. import dayjs from 'dayjs';
  586. import {
  587. weChatPayment
  588. } from '@/api/pay_new'
  589. import {
  590. zfbPayment,
  591. // weChatPayment
  592. } from '@/api/pay'
  593. import {
  594. payConfirmReward,
  595. } from '@/api/order'
  596. export default {
  597. data() {
  598. return {
  599. type:'',
  600. payPrice: null,
  601. newOrder: {},
  602. payType: 2,
  603. order: null,
  604. orderId: null,
  605. payDelivery: 0,
  606. payMoney: 0,
  607. config: null,
  608. payType: 1,
  609. user: null,
  610. couponUserId: null
  611. }
  612. },
  613. computed: {
  614. formattedDate() {
  615. return this.order?.createTime ? dayjs(this.order.createTime).format('YYYY-MM-DD HH:mm:ss') : '';
  616. },
  617. payLimitTime() {
  618. return this.order?.updateTime ?
  619. dayjs(this.order.updateTime).add(2, 'day').format('YYYY-MM-DD HH:mm:ss') :
  620. '';
  621. }
  622. },
  623. onLoad(options) {
  624. // if (options.payPrice) {
  625. // this.payPrice = options.payPrice;
  626. // }
  627. if (options.couponUserId) {
  628. this.couponUserId = options.couponUserId;
  629. }
  630. console.log("支付订单是>>", options)
  631. this.type = options.type;
  632. // this.liveId = options.liveId
  633. // this.productId=options.productId
  634. // console.log("支付订单",options)
  635. if (options.orderList) {
  636. try {
  637. const decoded = decodeURIComponent(options.orderList);
  638. this.order = JSON.parse(decoded) || {}; // 默认空对象
  639. } catch (e) {
  640. console.error('参数解析失败:', e);
  641. this.order = {}; // 显式赋默认值
  642. }
  643. }
  644. },
  645. // //发送给朋友
  646. // onShareAppMessage(res) {
  647. // const combinationOrderId = this.combinationOrderId ?
  648. // `&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
  649. // return {
  650. // title: "帮TA支付",
  651. // path: '/pages_user/user/otherPaymentOrder?orderId=' + this.orderId + combinationOrderId,
  652. // imageUrl: '/static/images/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  653. // }
  654. // },
  655. methods: {
  656. weixinPayOrder() {
  657. var data = {
  658. orderId: this.order.orderId,
  659. payType: 1
  660. // payType: this.order.payType
  661. };
  662. var that = this;
  663. uni.showLoading();
  664. weChatPayment(data).then(
  665. res => {
  666. if (res.code == 200) {
  667. console.log(res);
  668. if (res.payType == 1 || res.payType == 2) {
  669. var result = JSON.parse(res.result);
  670. uni.requestPayment({
  671. provider: 'wxpay',
  672. timeStamp: result.timeStamp,
  673. nonceStr: result.nonceStr,
  674. package: result.package,
  675. signType: result.signType,
  676. paySign: result.paySign,
  677. success: function(res) {
  678. uni.hideLoading();
  679. uni.redirectTo({
  680. url: "./success?order=" + JSON.stringify(that.newOrder)
  681. })
  682. },
  683. fail: function(err) {
  684. uni.showToast({
  685. icon: 'none',
  686. title: 'fail:' + JSON.stringify(err),
  687. });
  688. uni.hideLoading();
  689. }
  690. });
  691. }
  692. } else {
  693. uni.showToast({
  694. icon: 'none',
  695. title: res.msg,
  696. });
  697. }
  698. },
  699. rej => {}
  700. );
  701. },
  702. payOrder() {
  703. if (this.type == 'win') {
  704. this.toPayConfirmReward()
  705. } else {
  706. if (this.payType == 1) {
  707. console.log("这个order", this.order)
  708. const {
  709. itemJson,
  710. ...newOrder
  711. } = this.order;
  712. this.newOrder = newOrder;
  713. console.log("这个newOrder", this.newOrder)
  714. this.weixinPayOrder()
  715. } else {
  716. uni.showToast({
  717. title: "暂时无可用支付",
  718. icon: 'none'
  719. })
  720. }
  721. }
  722. },
  723. // 选微信支付或者支付宝支付
  724. handlePayTypeChange(e) {
  725. this.payType = e.detail.value; // 获取选中的 value
  726. console.log('当前选中:', this.payType);
  727. },
  728. toPayConfirmReward() {
  729. let data={
  730. orderId:this.order.orderId
  731. }
  732. payConfirmReward(data).then(
  733. res => {
  734. if (res.code == 200) {
  735. uni.showToast({
  736. icon: 'none',
  737. title: res.msg,
  738. });
  739. } else {
  740. uni.showToast({
  741. icon: 'none',
  742. title: "请求失败",
  743. });
  744. }
  745. },
  746. rej => {}
  747. );
  748. },
  749. getUserInfo() {
  750. getUserInfo().then(
  751. res => {
  752. if (res.code == 200) {
  753. if (res.user != null) {
  754. this.user = res.user;
  755. }
  756. } else {
  757. uni.showToast({
  758. icon: 'none',
  759. title: "请求失败",
  760. });
  761. }
  762. },
  763. rej => {}
  764. );
  765. },
  766. getStoreConfig() {
  767. getStoreConfig().then(
  768. res => {
  769. if (res.code == 200) {
  770. this.config = res.data
  771. console.log(this.config);
  772. }
  773. },
  774. rej => {}
  775. );
  776. },
  777. payTypeChange(e) {
  778. if (this.combinationOrderId) {
  779. this.editPayTypeByCombinationId(e.detail.value)
  780. } else {
  781. this.editPayType(e.detail.value)
  782. }
  783. },
  784. editPayType(payType) {
  785. var data = {
  786. orderId: this.orderId,
  787. payType: payType
  788. };
  789. var that = this;
  790. uni.showLoading();
  791. editPayType(data).then(
  792. res => {
  793. if (res.code == 200) {
  794. console.log(res);
  795. uni.hideLoading();
  796. that.order = res.order;
  797. that.order.orderCodes = that.order.orderCode ? [that.order.orderCode] : []
  798. that.orderCode = that.order.orderCode
  799. // this.payType=this.order.payType
  800. this.payMoney = this.order.payMoney;
  801. this.payDelivery = this.order.payDelivery;
  802. } else {
  803. uni.showToast({
  804. icon: 'none',
  805. title: res.msg,
  806. });
  807. }
  808. },
  809. rej => {}
  810. );
  811. },
  812. }
  813. }
  814. </script>
  815. <style lang="scss">
  816. page {
  817. height: 100%;
  818. }
  819. .content {
  820. height: 100%;
  821. display: flex;
  822. flex-direction: column;
  823. justify-content: space-between;
  824. .inner {
  825. padding: 20upx;
  826. .time-price {
  827. box-sizing: border-box;
  828. padding: 50upx 0upx;
  829. background: #FFFFFF;
  830. border-radius: 16upx;
  831. display: flex;
  832. flex-direction: column;
  833. align-items: center;
  834. .time {
  835. font-size: 32upx;
  836. font-family: PingFang SC;
  837. font-weight: 500;
  838. color: #222222;
  839. line-height: 1;
  840. text-align: center;
  841. }
  842. .desc {
  843. margin: 30upx 0upx 15upx;
  844. font-size: 26upx;
  845. font-family: PingFang SC;
  846. color: #999999;
  847. line-height: 1;
  848. text-align: center;
  849. }
  850. .price-box {
  851. display: flex;
  852. align-items: flex-end;
  853. margin-top: 28upx;
  854. .unit {
  855. font-size: 32upx;
  856. font-family: PingFang SC;
  857. font-weight: bold;
  858. color: #FF6633;
  859. line-height: 1.3;
  860. margin-right: 10upx;
  861. }
  862. .num {
  863. font-size: 56upx;
  864. font-family: PingFang SC;
  865. font-weight: bold;
  866. color: #FF6633;
  867. line-height: 1;
  868. }
  869. }
  870. }
  871. .pay-type {
  872. box-sizing: border-box;
  873. background: #FFFFFF;
  874. border-radius: 16upx;
  875. margin-top: 20upx;
  876. padding: 40upx 30upx;
  877. display: flex;
  878. flex-direction: column;
  879. justify-content: space-between;
  880. .title {
  881. font-size: 28upx;
  882. font-family: PingFang SC;
  883. font-weight: 500;
  884. color: #999999;
  885. line-height: 1;
  886. margin-bottom: 10upx;
  887. }
  888. .item {
  889. padding: 15upx 0upx;
  890. display: flex;
  891. align-items: center;
  892. justify-content: space-between;
  893. .left {
  894. display: flex;
  895. align-items: center;
  896. image {
  897. width: 44upx;
  898. height: 44upx;
  899. margin-right: 20upx;
  900. }
  901. .text {
  902. font-size: 30upx;
  903. font-family: PingFang SC;
  904. font-weight: bold;
  905. color: #222222;
  906. line-height: 1;
  907. }
  908. }
  909. }
  910. }
  911. .order-info {
  912. margin-top: 20upx;
  913. background: #FFFFFF;
  914. border-radius: 16upx;
  915. padding: 40upx 30upx;
  916. .title {
  917. font-size: 30upx;
  918. font-family: PingFang SC;
  919. font-weight: bold;
  920. color: #222222;
  921. line-height: 1;
  922. }
  923. .item {
  924. margin-top: 40upx;
  925. display: flex;
  926. align-items: center;
  927. justify-content: space-between;
  928. .label {
  929. font-size: 26upx;
  930. font-family: PingFang SC;
  931. font-weight: 500;
  932. color: #666666;
  933. line-height: 1;
  934. }
  935. .text {
  936. font-size: 26upx;
  937. font-family: PingFang SC;
  938. font-weight: 500;
  939. color: #222222;
  940. line-height: 32upx;
  941. }
  942. .cont-text {
  943. font-size: 26upx;
  944. font-family: PingFang SC;
  945. font-weight: 500;
  946. color: #666666;
  947. .bold {
  948. color: #111111;
  949. }
  950. }
  951. .sn-box {
  952. display: flex;
  953. align-items: center;
  954. .copy-btn {
  955. width: 58upx;
  956. height: 32upx;
  957. line-height: 32upx;
  958. text-align: center;
  959. font-size: 22upx;
  960. font-weight: 500;
  961. color: #222222;
  962. background: #F5F5F5;
  963. border-radius: 4upx;
  964. margin-left: 24upx;
  965. }
  966. }
  967. }
  968. .line {
  969. width: 100%;
  970. height: 1px;
  971. background: #F0F0F0;
  972. margin-top: 30upx;
  973. }
  974. }
  975. }
  976. .btn-box {
  977. height: 242upx;
  978. background: #FFFFFF;
  979. display: flex;
  980. align-items: center;
  981. justify-content: center;
  982. flex-direction: column;
  983. .btn {
  984. width: 91.73%;
  985. height: 88upx;
  986. line-height: 88upx;
  987. font-size: 30upx;
  988. font-family: PingFang SC;
  989. font-weight: bold;
  990. color: #FFFFFF;
  991. text-align: center;
  992. background: #2BC7B9;
  993. border-radius: 44upx;
  994. margin-bottom: 10rpx;
  995. }
  996. .other-btn {
  997. width: 91.73%;
  998. height: 88upx;
  999. line-height: 88upx;
  1000. font-size: 30upx;
  1001. font-family: PingFang SC;
  1002. font-weight: bold;
  1003. color: #2BC7B9;
  1004. border: 1rpx solid #2BC7B9;
  1005. text-align: center;
  1006. background: #FFFFFF;
  1007. border-radius: 44upx;
  1008. margin-bottom: 10rpx;
  1009. position: relative;
  1010. .share {
  1011. display: inline-block;
  1012. position: absolute;
  1013. top: 0;
  1014. left: 0;
  1015. width: 100%;
  1016. height: 100%;
  1017. opacity: 0;
  1018. }
  1019. }
  1020. }
  1021. }
  1022. >>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
  1023. </style>