review-book.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="book-audit" @click="playGlobalSound">
  3. <view class="bg-white flex flex-a-c" style="padding: 20rpx; border-radius: 10rpx">
  4. <image :src="detail.cover" mode="aspectFill" style="width: 80px; height: 100px"></image>
  5. <view class="flex flex-d flex-1 ml-20">
  6. <text class="common-title mb-20">{{ detail.bookName }}</text>
  7. <text class="text-sm">ISBN: <text class="color-primary">{{ detail.isbn }}</text>
  8. </text>
  9. <text class="text-sm mt-6">作者: <text>{{ detail.author }}</text>
  10. </text>
  11. <text class="text-sm mt-6">出版社: <text>{{ detail.publish }}</text>
  12. </text>
  13. </view>
  14. </view>
  15. <view class="mt-20 bg-white price-info" style="border-radius: 10rpx">
  16. <view class="flex">
  17. <view class="flex flex-a-c flex-1">
  18. <text class="label">定价</text>
  19. <text class="content">¥{{ detail.price }}</text>
  20. </view>
  21. <view class="flex flex-a-c flex-1">
  22. <text class="label">回收折扣</text>
  23. <text class="content">{{ detail.recycleDiscount }}折</text>
  24. </view>
  25. </view>
  26. <view class="flex flex-a-c">
  27. <view class="flex flex-a-c flex-1">
  28. <text class="label">预估金额</text>
  29. <text class="content">¥{{ detail.expectPrice }}</text>
  30. </view>
  31. <view class="flex flex-a-c flex-1">
  32. <text class="label">审核金额</text>
  33. <text class="content">¥0.00</text>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="mt-20">
  38. <ReviewInfo :detail="reviewInfo" ref="reviewInfoRef" />
  39. </view>
  40. <view class="fixed-bottom">
  41. <u-button type="primary" size="large" @click="handleAudit">确定</u-button>
  42. </view>
  43. </view>
  44. </template>
  45. <script setup>
  46. import { ref, nextTick, onUnmounted } from "vue";
  47. import { onLoad, onShow } from "@dcloudio/uni-app";
  48. import ReviewInfo from "./components/ReviewInfo.vue";
  49. const detail = ref({});
  50. function playGlobalSound() {
  51. uni.$u.playClickSound()
  52. }
  53. // 获取图书详情 /app/book/getSimpleBookInfoByIsbn/{isbn}
  54. const getBookInfo = (isbn) => {
  55. uni.$u.http.get(`/app/book/getBookByIsbn/${isbn}`).then((res) => {
  56. if (res.code == 200) {
  57. detail.value = res.data;
  58. }
  59. });
  60. };
  61. //获取图书信息和审核信息
  62. const reviewInfo = ref({});
  63. const getBookInfoAndAuditInfo = (opts) => {
  64. uni.$u.http.get(`/app/orderreview/getBookReviewInfo?isbn=${opts.isbn}&&orderId=${opts.orderId}&index=${opts.index}`).then((res) => {
  65. if (res.code == 200) {
  66. reviewInfo.value = res.data;
  67. }
  68. });
  69. };
  70. //复审
  71. const reviewInfoRef = ref(null)
  72. const handleAudit = () => {
  73. let form = reviewInfoRef.value.form
  74. uni.$u.http
  75. .post("/app/orderreview/reviewBook", {
  76. auditReviewId: auditReviewId.value,
  77. ...form
  78. })
  79. .then((res) => {
  80. if (res.code == 200) {
  81. uni.showToast({ title: "复审成功", icon: "none" });
  82. uni.$u.ttsModule.speak("复审成功");
  83. uni.navigateBack();
  84. } else {
  85. uni.$u.toast(res.msg);
  86. }
  87. });
  88. };
  89. const auditReviewId = ref();
  90. const index = ref();
  91. let isbnScan = ref("");
  92. onLoad((options) => {
  93. options.isbn && getBookInfo(options.isbn);
  94. isbnScan.value = options.isbn;
  95. auditReviewId.value = options.auditReviewId;
  96. index.value = options.index;
  97. getBookInfoAndAuditInfo(options);
  98. });
  99. </script>
  100. <style lang="scss" scoped>
  101. .book-audit {
  102. padding: 20rpx;
  103. box-sizing: border-box;
  104. padding-bottom: 140rpx;
  105. .price-info {
  106. border-radius: 10rpx;
  107. .label {
  108. width: 150rpx;
  109. background-color: #cecece;
  110. padding: 16rpx 10rpx;
  111. text-align: center;
  112. border: 1rpx solid #e6e6e6;
  113. }
  114. .content {
  115. flex: 1;
  116. text-align: center;
  117. padding: 16rpx 10rpx;
  118. border: 1rpx solid #e6e6e6;
  119. }
  120. }
  121. }
  122. </style>