winningRecordDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. <template>
  2. <view>
  3. <view class="inner-box">
  4. <!-- 收货人 -->
  5. <view class="address-box" v-if="address==null" @click="openAddress()">
  6. <view class="left">
  7. <view class="name-box">
  8. <text class="text name">添加收货地址</text>
  9. </view>
  10. </view>
  11. <view class="arrow-box">
  12. <image src="/static/images/arrow_gray.png" mode=""></image>
  13. </view>
  14. </view>
  15. <view class="address-box" v-if="address!=null" @click="openAddress()">
  16. <view class="left">
  17. <view class="name-box">
  18. <text class="text name">{{address.realName}}</text>
  19. <text class="text" v-if="address.phone!=null">{{address.phone}}</text>
  20. </view>
  21. <view class="address">
  22. {{address.address}}
  23. </view>
  24. </view>
  25. <view class="arrow-box">
  26. <image src="/static/images/arrow_gray.png" mode=""></image>
  27. </view>
  28. </view>
  29. <!-- 药品列表 -->
  30. <view class="goods-list">
  31. <view class="item">
  32. <view class="img-box">
  33. <image :src="item.goodsImg==''?'/static/images/drug.svg':item.goodsImg" mode="aspectFill"></image>
  34. </view>
  35. <view class="info-box">
  36. <view>
  37. <view class="name-box ellipsis2">
  38. {{item.goodsName}}
  39. </view>
  40. </view>
  41. <view class="price-num">
  42. <view class="price">
  43. <text class="num">¥{{item.opPrice}}</text>
  44. </view>
  45. <view class="num">x1</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="other-info">
  51. <view class="item">
  52. <view class="left">
  53. <text class="label">原价:</text>
  54. </view>
  55. <view class="right">
  56. <text class="text">¥{{item.opPrice}}</text>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="other-info">
  61. <view class="item">
  62. <view class="left">
  63. <text class="label">支付:</text>
  64. </view>
  65. <view class="right">
  66. <text class="text">¥{{item.price}}</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 底部按钮 -->
  72. <view class="btn-box">
  73. <view class="btn" v-if="item!=null" @click="payOrder()">立即领取</view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import { goodsDetail,createOrder} from "@/api/courseAnswer.js"
  79. import {getUserInfo} from '@/api/user'
  80. export default {
  81. data() {
  82. return {
  83. addressId:null,
  84. address:null,
  85. orderId:null,
  86. order:null,
  87. item:null,
  88. integral: 0,
  89. roundId:null,
  90. orderType: ''
  91. }
  92. },
  93. onLoad(option) {
  94. this.goodsId=option.goodsId;
  95. this.roundId=option.roundId;
  96. this.orderType = option.orderType;
  97. var that=this;
  98. uni.$on('updateAddress', (e) => {
  99. that.addressId=e.addressId;
  100. that.address=e;
  101. that.address.address=e.province+e.city+e.district+e.detail
  102. })
  103. this.getGoodsDetail();
  104. this.getUserInfo();
  105. },
  106. methods: {
  107. getUserInfo(){
  108. getUserInfo().then(
  109. res => {
  110. if(res.code==200){
  111. if(res.user!=null){
  112. this.integral=res.user.integral;
  113. }
  114. }
  115. },
  116. rej => {}
  117. );
  118. },
  119. getGoodsDetail(){
  120. var data={goodsId:this.goodsId,roundId:this.roundId};
  121. const mode = this.orderType == 2 ? 1 : ''
  122. goodsDetail(data,mode).then(
  123. res => {
  124. if(res.code==200){
  125. this.item=res.data;
  126. }else{
  127. }
  128. },
  129. rej => {}
  130. );
  131. },
  132. openAddress(){
  133. uni.navigateTo({
  134. url: '/pages/user/address'
  135. })
  136. },
  137. payOrder(){
  138. if(this.addressId==null){
  139. uni.showToast({
  140. icon:'none',
  141. title: "请选择收货地址",
  142. });
  143. return;
  144. }
  145. var data = {
  146. goodsId:this.goodsId,
  147. roundId: this.roundId,
  148. addressId:this.addressId,
  149. };
  150. var that=this;
  151. uni.showLoading();
  152. const mode = this.orderType == 2 ? 1 : ''
  153. createOrder(data,mode).then(
  154. res => {
  155. if(res.code==200){
  156. uni.redirectTo({
  157. url:"/pages/courseAnswer/orderDetail?orderId="+res.data.orderId
  158. })
  159. }else{
  160. uni.showToast({
  161. icon:'none',
  162. title: res.msg,
  163. });
  164. }
  165. },
  166. rej => {}
  167. );
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. .inner-box{
  174. padding: 20upx 20upx 140upx;
  175. .address-box{
  176. box-sizing: border-box;
  177. min-height: 171upx;
  178. background: #FFFFFF;
  179. border-radius: 16upx;
  180. background-image: url(/static/images/address_bg.png);
  181. background-repeat: no-repeat;
  182. background-size: 100% 30upx;
  183. background-position: left bottom;
  184. padding: 38upx 30upx 36upx;
  185. display: flex;
  186. align-items: center;
  187. justify-content: space-between;
  188. .left{
  189. width: 92%;
  190. .name-box{
  191. display: flex;
  192. align-items: center;
  193. .text{
  194. font-size: 32upx;
  195. font-family: PingFang SC;
  196. font-weight: bold;
  197. color: #111111;
  198. line-height: 1;
  199. &.name{
  200. margin-right: 30upx;
  201. }
  202. }
  203. }
  204. .address{
  205. font-size: 28upx;
  206. font-family: PingFang SC;
  207. font-weight: 500;
  208. color: #666666;
  209. line-height: 42upx;
  210. text-align:left;
  211. margin-top: 23upx;
  212. }
  213. }
  214. .arrow-box{
  215. width: 12upx;
  216. height: 23upx;
  217. display: flex;
  218. align-items: cenetr;
  219. justify-content: cenetr;
  220. image{
  221. width: 100%;
  222. height: 100%;
  223. }
  224. }
  225. }
  226. .goods-list{
  227. margin-top: 20upx;
  228. padding: 0 30upx;
  229. background-color: #FFFFFF;
  230. border-radius: 16upx;
  231. .item{
  232. padding: 30upx 0;
  233. border-bottom: 1px solid #EDEEEF;
  234. display: flex;
  235. align-items: center;
  236. .img-box{
  237. width: 160upx;
  238. height: 160upx;
  239. margin-right: 30upx;
  240. image{
  241. width: 100%;
  242. height: 100%;
  243. }
  244. }
  245. .info-box{
  246. width: calc(100% - 190upx);
  247. height: 160upx;
  248. display: flex;
  249. flex-direction: column;
  250. justify-content: space-between;
  251. .name-box{
  252. font-size: 28upx;
  253. font-family: PingFang SC;
  254. font-weight: 500;
  255. color: #111111;
  256. line-height: 40upx;
  257. .tag{
  258. display: inline-block;
  259. padding: 0 6upx;
  260. height: 30upx;
  261. background: linear-gradient(90deg, #C39A58 0%, #E2C99E 100%);
  262. border-radius: 4upx;
  263. margin-right: 10upx;
  264. font-size: 22upx;
  265. font-family: PingFang SC;
  266. font-weight: bold;
  267. color: #FFFFFF;
  268. line-height: 30upx;
  269. float: left;
  270. margin-top: 7upx;
  271. }
  272. }
  273. .spec{
  274. margin-top: 10upx;
  275. font-size: 24upx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #999999;
  279. line-height: 1;
  280. }
  281. .price-num{
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-between;
  285. .price{
  286. display: flex;
  287. align-items: flex-end;
  288. .unit{
  289. font-size: 24upx;
  290. font-family: PingFang SC;
  291. font-weight: 500;
  292. color: #111111;
  293. line-height: 1.2;
  294. margin-right: 4upx;
  295. }
  296. .num{
  297. font-size: 32upx;
  298. font-family: PingFang SC;
  299. font-weight: 500;
  300. color: #111111;
  301. line-height: 1;
  302. }
  303. }
  304. .num{
  305. font-size: 24upx;
  306. font-family: PingFang SC;
  307. font-weight: 500;
  308. color: #999999;
  309. line-height: 1;
  310. }
  311. }
  312. }
  313. }
  314. .sub-total{
  315. height: 88upx;
  316. display: flex;
  317. align-items: center;
  318. justify-content: flex-end;
  319. .label{
  320. font-size: 24upx;
  321. font-family: PingFang SC;
  322. font-weight: 500;
  323. color: #999999;
  324. }
  325. .price{
  326. display: flex;
  327. align-items: flex-end;
  328. .unit{
  329. font-size: 24upx;
  330. font-family: PingFang SC;
  331. font-weight: 500;
  332. color: #FF6633;
  333. line-height: 1.2;
  334. margin-right: 4upx;
  335. }
  336. .num{
  337. font-size: 32upx;
  338. font-family: PingFang SC;
  339. font-weight: bold;
  340. color: #FF6633;
  341. line-height: 1;
  342. }
  343. }
  344. }
  345. }
  346. .other-info{
  347. margin-top: 20upx;
  348. background-color: #fff;
  349. border-radius: 20upx;
  350. overflow: hidden;
  351. padding: 0 30upx;
  352. .title{
  353. height: 80upx;
  354. line-height: 80upx;
  355. font-size: 30upx;
  356. color: #000;
  357. font-weight: bold;
  358. border-bottom: 2upx solid #eeeeee;
  359. }
  360. .item{
  361. height: 80upx;
  362. display: flex;
  363. align-items: center;
  364. justify-content: space-between;
  365. &:last-child{
  366. border-bottom: none;
  367. }
  368. .left{
  369. flex: 1;
  370. display: flex;
  371. align-items: center;
  372. .label{
  373. min-width: 140rpx;
  374. font-size: 28upx;
  375. color: #000;
  376. }
  377. .text{
  378. font-size: 28upx;
  379. color: #1b1b1b;
  380. }
  381. }
  382. .right{
  383. display: flex;
  384. align-items: center;
  385. justify-content: flex-end;
  386. .text{
  387. font-size: 28upx;
  388. color: #1b1b1b;
  389. }
  390. .ic-close{
  391. margin-left: 10rpx;
  392. width: 30rpx;
  393. height:30rpx;
  394. }
  395. .ic-back{
  396. margin-left: 10rpx;
  397. width: 15rpx;
  398. height:30rpx;
  399. }
  400. }
  401. .item-btn{
  402. max-width: 200rpx;
  403. padding: 0rpx 15rpx;
  404. height: 48upx;
  405. border-radius: 24upx;
  406. line-height: 48upx;
  407. font-size: 24upx;
  408. color: #000;
  409. border: 1upx solid #d8d8d8;
  410. display: flex;
  411. align-items: center;
  412. justify-content: center;
  413. }
  414. }
  415. }
  416. .remarks{
  417. height: 88upx;
  418. padding: 0 30upx;
  419. background: #FFFFFF;
  420. border-radius: 16upx;
  421. margin-top: 20upx;
  422. display: flex;
  423. align-items: center;
  424. input{
  425. width: 100%;
  426. font-size: 28upx;
  427. font-family: PingFang SC;
  428. font-weight: 500;
  429. color: #000000;
  430. }
  431. .input{
  432. font-size: 28upx;
  433. font-family: PingFang SC;
  434. font-weight: 500;
  435. color: #999999;
  436. }
  437. }
  438. }
  439. .btn-box{
  440. height: 140upx;
  441. z-index: 9999;
  442. width: 100%;
  443. padding: 0rpx 30upx;
  444. position: fixed;
  445. bottom: 0;
  446. left: 0;
  447. box-sizing: border-box;
  448. background-color: #ffffff;
  449. display: flex;
  450. align-items: center;
  451. justify-content: center;
  452. .btn{
  453. width: 100%;
  454. height: 88upx;
  455. line-height: 88upx;
  456. text-align: center;
  457. font-size: 34upx;
  458. font-family: PingFang SC;
  459. font-weight: 400;
  460. color: #FFFFFF;
  461. background: #FF5C03;
  462. border-radius: 10upx;
  463. }
  464. }
  465. .pay-type{
  466. box-sizing: border-box;
  467. height: 192upx;
  468. background: #FFFFFF;
  469. border-radius: 16upx;
  470. margin-top: 20upx;
  471. padding: 40upx 30upx;
  472. display: flex;
  473. flex-direction: column;
  474. justify-content: space-between;
  475. .title{
  476. font-size: 28upx;
  477. font-family: PingFang SC;
  478. font-weight: 500;
  479. color: #999999;
  480. line-height: 1;
  481. }
  482. .item{
  483. display: flex;
  484. align-items: center;
  485. justify-content: space-between;
  486. .left{
  487. display: flex;
  488. align-items: center;
  489. image{
  490. width: 44upx;
  491. height: 44upx;
  492. margin-right: 20upx;
  493. }
  494. .text{
  495. font-size: 30upx;
  496. font-family: PingFang SC;
  497. font-weight: bold;
  498. color: #222222;
  499. line-height: 1;
  500. }
  501. }
  502. }
  503. }
  504. .coupon{
  505. height: 100%;
  506. .empty{
  507. display: flex;
  508. align-items: center;
  509. justify-content: center;
  510. height: 650rpx;
  511. width: 100%;
  512. image{
  513. width: 280rpx;
  514. height: 200rpx;
  515. }
  516. }
  517. }
  518. .coupon-box{
  519. overflow-y: auto;
  520. padding: 80rpx 20rpx 80rpx;
  521. height: 650rpx;
  522. width: 100%;
  523. display: flex;
  524. flex-direction: column;
  525. align-items: flex-start;
  526. justify-content: flex-start;
  527. box-sizing: border-box;
  528. .coupon-item{
  529. width: 100%;
  530. display: flex;
  531. align-items: center;
  532. justify-content: flex-start;
  533. margin-bottom: 16rpx;
  534. height:170rpx;
  535. &:last-child{
  536. margin-bottom: 0rpx;
  537. }
  538. .left{
  539. color: #fff;
  540. font-size: 36rpx;
  541. font-weight: bold;
  542. text-align: center;
  543. display: flex;
  544. flex-direction: column;
  545. align-items: center;
  546. justify-content: center;
  547. position: relative;
  548. width: 230rpx;
  549. image{
  550. position: absolute;
  551. width: 230rpx;
  552. height:170rpx;
  553. color: #fff;
  554. }
  555. .num{
  556. font-size: 40rpx;
  557. }
  558. .pic-num{
  559. font-size: 20rpx;
  560. z-index: 99;
  561. }
  562. }
  563. .right{
  564. display: flex;
  565. flex-direction: column;
  566. align-items: flex-start;
  567. justify-content: flex-start;
  568. height:170rpx;
  569. width: calc(100% - 230rpx);
  570. padding: 0 17rpx 0 24rpx;
  571. background-color: #fff;
  572. box-sizing: border-box;
  573. .title{
  574. width: 100%;
  575. font-size: 0.3 * 100rpx;
  576. color: #282828;
  577. height: 0.93 * 100rpx;
  578. line-height: 0.93 * 100rpx;
  579. border-bottom: 1px solid #f0f0f0;
  580. }
  581. .btns{
  582. display: flex;
  583. align-items: center;
  584. justify-content: space-between;
  585. width: 100%;
  586. font-size: 0.2 * 100rpx;
  587. color: #999;
  588. height: 0.76 * 100rpx;
  589. .btn{
  590. width: 1.36 * 100rpx;
  591. height: 0.44 * 100rpx;
  592. border-radius: 0.22 * 100rpx;
  593. font-size: 0.22 * 100rpx;
  594. color: #fff;
  595. text-align: center;
  596. line-height: 0.44 * 100rpx;
  597. background-color: #FF5C03;
  598. .gray{
  599. background-color: #ccc;
  600. }
  601. }
  602. }
  603. }
  604. }
  605. }
  606. </style>