detail.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="detail">
  3. <nav-bar :title="`${auditStatus}/${lockStatus}详情`" @click-left="$router.back()" />
  4. <order-report-card :odRpCd="resultInfo.cmReportingClub" :isTabImg="true" />
  5. <div class="label">上传凭证:</div>
  6. <div class="upload-img">
  7. <van-image
  8. v-for="(i, index) in resultInfo.cmRelatedImageList"
  9. :key="index"
  10. :src="i.image"
  11. />
  12. </div>
  13. <div class="label">
  14. 备注:<span>{{ resultInfo.remarks || "无" }}</span>
  15. </div>
  16. <div class="label">
  17. 审核状态:<span>{{ auditStatus }}</span>
  18. </div>
  19. <div class="label">
  20. 锁定状态:<span style="color: #ff9100">{{ lockStatus }}</span>
  21. </div>
  22. <div class="label">
  23. 报备时间:<span>{{ resultInfo.createTime }}</span>
  24. </div>
  25. <div class="label">
  26. 已报备人数:<span v-if="resultInfo.cmReportingClub"
  27. >{{ resultInfo.cmReportingClub.distributionCount || 0 }}人</span
  28. >
  29. </div>
  30. <div
  31. class="detail-btn"
  32. v-if="
  33. resultInfo.cmReportingClub &&
  34. isReportAuditStatus(resultInfo.auditStatus) && !isReportDeal(resultInfo.cmReportingClub.orderStatus)
  35. "
  36. >
  37. <van-button color="#FF5B00" @click="handlerPlaceOrder(resultInfo.cmReportingClub)">下单</van-button>
  38. <van-button style="color: #ff9100" @click="shareOrderConfirm" v-if="!isReportLock(resultInfo.cmReportingClub.lockStatus)"
  39. >分享采购意向确认</van-button
  40. >
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import { insIntentionReportDetail } from '@/api/userApi/ins-intention-report'
  46. import reportStatus from './mixins/index'
  47. import { Toast } from 'vant'
  48. export default {
  49. mixins: [reportStatus],
  50. data () {
  51. return {
  52. resultInfo: {}
  53. }
  54. },
  55. computed: {
  56. lockStatus () {
  57. return this.isLock * 1 === 1 ? '已锁定' : '未锁定'
  58. },
  59. isLock () {
  60. if (this.resultInfo.cmReportingClub) { return this.resultInfo.cmReportingClub.lockStatus }
  61. return 0
  62. },
  63. isAudit () {
  64. if (this.resultInfo.cmReportingClub) return this.resultInfo.auditStatus
  65. return 0
  66. },
  67. id () {
  68. return this.$route.query.id
  69. },
  70. auditStatus () {
  71. return this.isAudit * 1 === 1
  72. ? '待审核'
  73. : this.isAudit * 1 === 2
  74. ? '审核通过'
  75. : '审核失败'
  76. }
  77. },
  78. mounted () {
  79. this.insIntentionReportDetail()
  80. },
  81. methods: {
  82. async insIntentionReportDetail () {
  83. const data = await insIntentionReportDetail({ id: this.id })
  84. this.resultInfo = data
  85. },
  86. shareOrderConfirm () {
  87. this.initAppMessageShareData()
  88. Toast.success('请点击右上角...分享微信好友')
  89. },
  90. handlerPlaceOrder ($event) {
  91. this.$router.push(`/goods-detail?productId=${$event.productId}&typeId=0&isLock=1&cId=${$event.id}`)
  92. },
  93. // 分享当前页面
  94. initAppMessageShareData () {
  95. this.$wxReady((wx) => {
  96. // 需在用户可能点击分享按钮前就先调用
  97. wx.updateAppMessageShareData({
  98. title: '商品详情', // 分享标题
  99. desc: '商品详情', // 分享描述
  100. link: `https://sell-b.caimei365.com/#/intention-confirm?id=${this.resultInfo.cmReportingClub.id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
  101. imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
  102. fail: () => {
  103. this.initAppMessageShareData()
  104. }
  105. })
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .detail {
  113. background: #fff;
  114. padding-bottom: 34vw;
  115. }
  116. .reportCard {
  117. padding: 5.3vw 3.2vw 0 3.2vw;
  118. ::v-deep .line {
  119. display: none;
  120. }
  121. }
  122. .label {
  123. margin: 4.6vw 0 0 3.5vw;
  124. font-size: 4vw;
  125. color: #333333;
  126. span {
  127. color: #333333;
  128. font-weight: 600;
  129. }
  130. }
  131. .upload-img {
  132. display: flex;
  133. flex-wrap: wrap;
  134. margin: 2.3vw 0 0 3.5vw;
  135. ::v-deep .van-image {
  136. width: 23vw;
  137. height: 23vw;
  138. margin-right: 3vw;
  139. border-radius: 1.2vw;
  140. }
  141. }
  142. .detail-btn {
  143. position: fixed;
  144. bottom: 0;
  145. left: 0;
  146. width: 100%;
  147. display: flex;
  148. align-items: center;
  149. flex-direction: column;
  150. background: #fff;
  151. ::v-deep .van-button {
  152. width: 86.4vw;
  153. height: 13vw;
  154. margin-bottom: 3.6vw;
  155. border: 1px solid #ff5b00;
  156. }
  157. }
  158. </style>