index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="ins-report">
  3. <nav-bar title="机构意向订单报备" @click-left="$router.back()">
  4. <template>
  5. <search-head @handlerSelect="handlerSelect" @onSearch="onSearch" />
  6. </template>
  7. </nav-bar>
  8. <div class="report-list" v-for="item in dataList" :key="item.id">
  9. <order-report-card
  10. :style="{
  11. padding: isShowReportMember ? '13.3vw 3.2vw 5.3vw 3.2vw' : '5.3vw 3.2vw',
  12. }"
  13. :odRpCd="item.cmReportingClub"
  14. :isTabImg="true"
  15. >
  16. <template #InsUsername="{ username }" v-if="isShowReportMember">
  17. <div class="name">成员:{{ username.linkMan }}</div>
  18. </template>
  19. <template #card-foot="{ data }">
  20. <div class="examine">
  21. <div>审核状态:<span style="color: #333333">{{ item.auditStatus | isAuditStatus }}</span></div>
  22. <div>锁定状态:<span style="color: #ff9100">{{ data.lockStatus | isLockStatus }}</span></div>
  23. </div>
  24. <div v-if="active === 0">
  25. <div class="change-btn" v-if="isReportAuditStatus(item.auditStatus) && !isReportDeal(data.orderStatus)">
  26. <van-button @click="handlerPlaceOrder(item.cmReportingClub)">下单</van-button>
  27. <van-button @click="handlerDetail(item)">查看详情</van-button>
  28. </div>
  29. <div class="detail-btn" v-else>
  30. <van-button @click="handlerDetail(item)">查看详情</van-button>
  31. </div>
  32. </div>
  33. </template>
  34. </order-report-card>
  35. </div>
  36. <bottom-detector
  37. :loadingMore="hasNextPage"
  38. :noMore="!hasNextPage"
  39. @arriveBottom="getMoreInfo"
  40. />
  41. <div class="to-report" v-if="active === 0">
  42. <van-button color="#FF5B00" @click="$router.push('/ins-intention-add')"
  43. >去报备</van-button
  44. >
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import { insIntentionReportList } from '../../api/userApi/ins-intention-report'
  50. import reportStatus from './mixins/index'
  51. import SearchHead from './components/search-head'
  52. export default {
  53. components: { SearchHead },
  54. mixins: [reportStatus],
  55. data () {
  56. return {
  57. formData: {
  58. pageNo: 1,
  59. pageSize: 10,
  60. clubName: ''
  61. },
  62. active: 0,
  63. showTips: true,
  64. dataList: [],
  65. hasNextPage: false
  66. }
  67. },
  68. computed: {
  69. isShowReportMember () {
  70. return this.$store.getters.isManage && this.active !== 0
  71. }
  72. },
  73. mounted () {
  74. this.getInsIntentionReportList(this.active)
  75. this.initAppMessageShareData()
  76. },
  77. methods: {
  78. tipsHidden (val) {
  79. this.showTips = val
  80. },
  81. getMoreInfo () {
  82. this.formData.pageNo += 1
  83. this.getInsIntentionReportList(this.active)
  84. },
  85. handlerSelect ($event) {
  86. this.active = $event
  87. this.dataList = []
  88. this.formData.pageNo = 1
  89. this.getInsIntentionReportList($event)
  90. },
  91. onSearch ($event) {
  92. this.formData.clubName = $event
  93. this.getInsIntentionReportList(this.active)
  94. },
  95. handlerDetail ($event) {
  96. window.location.href = `/ins-intention-detail?id=${$event.id}&reference=1`
  97. },
  98. handlerPlaceOrder ($event) {
  99. window.location.href = `/goods-detail?productId=${$event.productId}&typeId=0&isLock=1&cId=${$event.id}`
  100. },
  101. async getInsIntentionReportList ($event) {
  102. const j = $event === 0 ? { id: this.$store.getters.userInfo.id } : { parentId: this.$store.getters.userInfo.id }
  103. const form = {
  104. ...this.formData,
  105. ...j
  106. }
  107. const { results: data, hasNextPage } = await insIntentionReportList(form)
  108. this.hasNextPage = hasNextPage
  109. this.dataList = [...data]
  110. },
  111. // 分享当前页面
  112. initAppMessageShareData () {
  113. this.$wxReady((wx) => {
  114. // 需在用户可能点击分享按钮前就先调用
  115. wx.updateAppMessageShareData({
  116. title: '分销商城', // 分享标题
  117. desc: '分销商城', // 分享描述
  118. link: `${process.env.VUE_APP_DATA_API}intention-confirm?id=${this.resultInfo.cmReportingClub.id}&image=${this.$store.getters.userInfo.image}&linkMan=${this.$store.getters.userInfo.linkMan}&distributionId=${this.$store.getters.userInfo.id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
  119. imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`,
  120. success: () => {
  121. },
  122. fail: () => {
  123. if (process.env.NODE_ENV === 'production') {
  124. window.location.reload()
  125. }
  126. }
  127. })
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .ins-report {
  135. padding-bottom: 17.3vw;
  136. min-height: 100vh;
  137. position: relative;
  138. }
  139. .report-list {
  140. padding: 2.4vw;
  141. .name {
  142. position: absolute;
  143. left: 0;
  144. top: 2vw;
  145. padding: 0.5vw 2.6vw 0.5vw 3.5vw;
  146. font-size: 2.8vw;
  147. color: #fff;
  148. line-height: 6.9vw;
  149. text-align: center;
  150. background: #ff5b00;
  151. border-top-right-radius: 1.2vw;
  152. border-bottom-right-radius: 1.2vw;
  153. }
  154. .examine {
  155. @include display-flex-between;
  156. font-size: 3.7vw;
  157. color: #999999;
  158. margin-bottom: 6vw;
  159. }
  160. .detail-btn {
  161. width: 100%;
  162. @include display-flex-center;
  163. ::v-deep .van-button {
  164. width: 86.4vw;
  165. height: 13vw;
  166. border-radius: 1.2vw;
  167. }
  168. }
  169. .change-btn {
  170. width: 100%;
  171. @include display-flex-between;
  172. ::v-deep .van-button {
  173. width: 40vw;
  174. height: 13vw;
  175. border-radius: 1.2vw;
  176. }
  177. }
  178. }
  179. .to-report {
  180. @include display-flex-center;
  181. position: fixed;
  182. left: 0;
  183. bottom: 0;
  184. width: 100%;
  185. padding: 2vw 0 7vw 0;
  186. background: #fff;
  187. ::v-deep .van-button {
  188. width: 86.4vw;
  189. height: 13vw;
  190. border-radius: 1.2vw;
  191. }
  192. }
  193. </style>