cm-report-popup.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <template name="coupon">
  2. <view class="coupon-template">
  3. <!-- 选择商品 -->
  4. <tui-bottom-popup :radius="true" :show="show" @close="hidePopup">
  5. <view class="tui-popup-box clearfix">
  6. <view class="title">选择关联报备</view>
  7. <template v-if="dataList.length > 0">
  8. <view class="title-search">
  9. <view class="search-from name">
  10. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  11. <input
  12. class="input"
  13. type="text"
  14. confirm-type="search"
  15. v-model="listQuery.keyWord"
  16. @input="onShowClose"
  17. @confirm="userClubReportList()"
  18. placeholder="搜索商品名称 / 报备关键词"
  19. maxlength="16"
  20. />
  21. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  22. </view>
  23. </view>
  24. <view class="tui-popup-main coupon">
  25. <scroll-view class="tui-popup-scroll" scroll-y="true">
  26. <view
  27. v-for="(report, index) in dataList"
  28. :key="index"
  29. class="list clearfix"
  30. @click.stop="details(report.reportId)"
  31. >
  32. <view
  33. class="list-cell-icon"
  34. :class="{
  35. reviewed: report.status == 1,
  36. approved: report.status == 2,
  37. failed: report.status == 3
  38. }"
  39. >
  40. </view>
  41. <view class="list-cell-title">
  42. <view class="list-cell-h1" v-if="popupType === 1">{{ report.clubName }}</view>
  43. <view class="list-cell-h1" v-else>{{ report.questionMan }}</view>
  44. <view class="list-cell-p"> {{ report.addTime }} </view>
  45. </view>
  46. <view class="list-cell-content clearfix">
  47. <view class="tui-remarks-text" v-if="!report.productId">
  48. <view class="text">
  49. {{ report.reportText }}
  50. </view>
  51. </view>
  52. <view class="tui-remarks-goods" v-else>
  53. <view class="goods-image">
  54. <image :src="report.mainImage" mode=""></image>
  55. </view>
  56. <view class="goods-main">
  57. <view class="name"> {{ report.productName }} </view>
  58. <view class="shop">{{ report.reportText }}</view>
  59. </view>
  60. </view>
  61. <view class="list-cell-btn" @click.stop="checkedCoupon(index)">
  62. <view
  63. class="checkbox iconfont"
  64. :class="[report.ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  65. >
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </scroll-view>
  71. </view>
  72. </template>
  73. <template v-else>
  74. <view class="tui-remarks-empty">
  75. 暂无任何数据,请新建报备~
  76. </view>
  77. </template>
  78. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  79. <view class="tui-flex-1"> <view class="tui-button" @click="confirmPopup">确定</view> </view>
  80. <view class="tui-flex-1">
  81. <view class="tui-button-text" @click="handleAddReport">新建报备 ></view>
  82. </view>
  83. </view>
  84. </view>
  85. </tui-bottom-popup>
  86. </view>
  87. </template>
  88. <script>
  89. const defaultClubQuery = {
  90. keyWord: '',
  91. pageNum: 1,
  92. pageSize: 200,
  93. clubId: 0,
  94. serviceProviderId: 0
  95. }
  96. const defaultVisitQuery = {
  97. keyWord: '',
  98. pageNum: 1,
  99. pageSize: 200,
  100. questionManId: 0,
  101. }
  102. export default {
  103. name: 'cmreportpopup',
  104. props: {
  105. show: {
  106. type: Boolean,
  107. default: false
  108. },
  109. popupType:{
  110. type:Number,
  111. },
  112. reportInfo:{
  113. type:Object,
  114. default: {}
  115. }
  116. },
  117. data() {
  118. return {
  119. isIphoneX: this.$store.state.isIphoneX,
  120. checkedIndex: 0,
  121. isShowClose: false,
  122. listQuery: {},
  123. dataList: [],
  124. }
  125. },
  126. created() {
  127. if(this.popupType === 1){
  128. this.listQuery = Object.assign({}, defaultClubQuery)
  129. this.listQuery.clubId = this.reportInfo.clubId
  130. this.userClubReportList()
  131. }else{
  132. this.listQuery = Object.assign({}, defaultVisitQuery)
  133. this.listQuery.questionManId = this.reportInfo.questionManId
  134. this.userReportVisitorList()
  135. }
  136. },
  137. methods: {
  138. async userClubReportList() {// 单个机构报备记录
  139. const userInfo = await this.$api.getStorage()
  140. this.listQuery.serviceProviderId = userInfo.serviceProviderId
  141. this.UserService.userClubReportList(this.listQuery)
  142. .then(response => {
  143. let data = response.data
  144. if (data.results && data.results.length > 0) {
  145. this.dataList = data.results.map((el,index)=>{
  146. el.ischecked = false
  147. return el
  148. })
  149. }
  150. })
  151. .catch(error => {
  152. this.$util.msg(error.msg, 2000)
  153. })
  154. },
  155. userReportVisitorList() {// 单个咨询人报备记录
  156. this.UserService.userReportVisitorList(this.listQuery)
  157. .then(response => {
  158. let data = response.data
  159. if (data.results && data.results.length > 0) {
  160. this.dataList = data.results.map((el,index)=>{
  161. el.ischecked = false
  162. return el
  163. })
  164. }
  165. })
  166. .catch(error => {
  167. this.$util.msg(error.msg, 2000)
  168. })
  169. },
  170. details(reportId) {
  171. this.$api.navigateTo(`/pages/seller/remarks/report-details?type=${this.popupType}&reportId=${reportId}`)
  172. },
  173. checkedCoupon(idx) {
  174. // 选择商品
  175. this.checkedIndex = idx
  176. this.dataList.forEach((el, index) => {
  177. if (this.checkedIndex == index) {
  178. el.ischecked = !el.ischecked
  179. } else {
  180. el.ischecked = false
  181. }
  182. })
  183. },
  184. handleAddReport(){
  185. // 跳转新建报备
  186. this.$parent.isReportpopup = false
  187. this.$api.navigateTo(`/pages/seller/remarks/report-add?type=${this.popupType}&reportInfo=${JSON.stringify(this.reportInfo)}`)
  188. },
  189. onShowClose() {
  190. //输入框失去焦点时触发
  191. if (this.listQuery.name != '') {
  192. this.isShowClose = true
  193. } else {
  194. this.isShowClose = false
  195. }
  196. },
  197. delInputText() {
  198. //清除输入框内容
  199. this.listQuery.name = ''
  200. this.isShowClose = false
  201. },
  202. hidePopup(){// 隐藏弹窗
  203. this.$parent.isReportpopup = false
  204. },
  205. confirmPopup() {// 确认选择
  206. let report = null
  207. let checkedData = false
  208. this.dataList.forEach((el, index) => {
  209. if (el.ischecked) {
  210. report = el
  211. checkedData = true
  212. }
  213. })
  214. if(!checkedData){
  215. this.$util.msg('请选择报备~', 2000)
  216. return
  217. }
  218. this.$emit('handleChoiceaReport', report)
  219. this.$parent.isReportpopup = false
  220. }
  221. }
  222. }
  223. </script>
  224. <style lang="scss">
  225. .coupon-template {
  226. width: 100%;
  227. height: auto;
  228. background: #ffffff;
  229. float: left;
  230. margin-top: 24rpx;
  231. .coupon-title {
  232. width: 702rpx;
  233. padding: 0 24rpx;
  234. height: 88rpx;
  235. line-height: 88rpx;
  236. position: relative;
  237. .text {
  238. font-size: $font-size-28;
  239. color: $text-color;
  240. }
  241. .text-coupon {
  242. display: inline-block;
  243. float: right;
  244. padding-right: 30rpx;
  245. line-height: 88rpx;
  246. font-size: 28rpx;
  247. color: #f94b4b;
  248. }
  249. .iconfont {
  250. width: 50rpx;
  251. height: 88rpx;
  252. line-height: 88rpx;
  253. color: #999999;
  254. display: block;
  255. position: absolute;
  256. right: 0;
  257. top: 0;
  258. }
  259. }
  260. }
  261. .tui-popup-box {
  262. position: relative;
  263. box-sizing: border-box;
  264. min-height: 220rpx;
  265. padding: 24rpx 32rpx 0 32rpx;
  266. .title {
  267. font-size: $font-size-32;
  268. color: $text-color;
  269. line-height: 68rpx;
  270. text-align: center;
  271. float: left;
  272. width: 100%;
  273. height: 68rpx;
  274. box-sizing: border-box;
  275. padding: 0 24rpx;
  276. }
  277. .tui-remarks-empty{
  278. width: 100%;
  279. height: 400rpx;
  280. line-height: 400rpx;
  281. font-size: 26rpx;
  282. color: #999999;
  283. text-align: center;
  284. }
  285. .title-search {
  286. width: 100%;
  287. height: 66rpx;
  288. background: #ffffff;
  289. box-sizing: border-box;
  290. float: left;
  291. .search-from {
  292. width: 100%;
  293. height: 100%;
  294. background: #f7f7f7;
  295. border-radius: 32rpx;
  296. float: left;
  297. position: relative;
  298. .input {
  299. width: 500rpx;
  300. height: 64rpx;
  301. float: left;
  302. line-height: 64rpx;
  303. color: $text-color;
  304. font-size: $font-size-24;
  305. }
  306. .icon-iconfonticonfontsousuo1 {
  307. width: 64rpx;
  308. height: 64rpx;
  309. line-height: 64rpx;
  310. text-align: center;
  311. display: block;
  312. font-size: $font-size-38;
  313. float: left;
  314. color: #999999;
  315. }
  316. .icon-shanchu1 {
  317. font-size: $font-size-32;
  318. color: #999999;
  319. position: absolute;
  320. width: 64rpx;
  321. height: 64rpx;
  322. line-height: 64rpx;
  323. text-align: center;
  324. top: 0;
  325. right: 0;
  326. z-index: 10;
  327. }
  328. }
  329. }
  330. .tui-popup-main {
  331. width: 100%;
  332. float: left;
  333. padding-top: 40rpx;
  334. .tui-popup-scroll {
  335. width: 100%;
  336. height: 800rpx;
  337. .list {
  338. width: 100%;
  339. padding-top: 20rpx;
  340. box-sizing: border-box;
  341. background-size: cover;
  342. position: relative;
  343. border-bottom: 1px solid #e1e1e1;
  344. .list-cell-icon {
  345. width: 128rpx;
  346. height: 128rpx;
  347. position: absolute;
  348. top: 30rpx;
  349. right: 32rpx;
  350. &.reviewed {
  351. background: url(https://static.caimei365.com/app/img/icon/icon-verify1@2x.png);
  352. background-size: cover;
  353. }
  354. &.failed {
  355. background: url(https://static.caimei365.com/app/img/icon/icon-verify2@2x.png);
  356. background-size: cover;
  357. }
  358. &.approved {
  359. background: url(https://static.caimei365.com/app/img/icon/icon-verify3@2x.png);
  360. background-size: cover;
  361. }
  362. }
  363. .list-cell-title {
  364. width: 100%;
  365. height: auto;
  366. height: 56rpx;
  367. line-height: 56rpx;
  368. box-sizing: border-box;
  369. .list-cell-h1 {
  370. float: left;
  371. width: 50%;
  372. font-size: $font-size-26;
  373. color: #333333;
  374. text-align: left;
  375. text-overflow: ellipsis;
  376. overflow: hidden;
  377. display: -webkit-box;
  378. -webkit-line-clamp: 1;
  379. line-clamp: 1;
  380. -webkit-box-orient: vertical;
  381. }
  382. .list-cell-p {
  383. float: right;
  384. width: 50%;
  385. font-size: $font-size-26;
  386. color: #999999;
  387. text-align: right;
  388. }
  389. }
  390. .list-cell-content {
  391. width: 100%;
  392. box-sizing: border-box;
  393. .tui-remarks-text {
  394. width: 570rpx;
  395. height: 168rpx;
  396. float: left;
  397. box-sizing: border-box;
  398. padding: 20rpx 20rpx 20rpx 0;
  399. border-radius: 6rpx;
  400. .text{
  401. width: 100%;
  402. height: 100%;
  403. box-sizing: border-box;
  404. line-height: 42rpx;
  405. color: #333333;
  406. text-overflow: ellipsis;
  407. overflow: hidden;
  408. display: -webkit-box;
  409. -webkit-line-clamp: 3;
  410. line-clamp: 3;
  411. -webkit-box-orient: vertical;
  412. font-size: 26rpx;
  413. }
  414. }
  415. .tui-remarks-goods {
  416. width: 606rpx;
  417. height: 168rpx;
  418. float: left;
  419. box-sizing: border-box;
  420. padding: 20rpx 0;
  421. border-radius: 6rpx;
  422. .goods-image {
  423. width: 128rpx;
  424. height: 128rpx;
  425. float: left;
  426. image {
  427. width: 128rpx;
  428. height: 128rpx;
  429. display: block;
  430. border-radius: 4rpx;
  431. }
  432. }
  433. .goods-main {
  434. width: 440rpx;
  435. height: 128rpx;
  436. box-sizing: border-box;
  437. padding-left: 24rpx;
  438. float: left;
  439. .name {
  440. width: 100%;
  441. height: 48rpx;
  442. box-sizing: border-box;
  443. line-height: 48rpx;
  444. color: #333333;
  445. text-overflow: ellipsis;
  446. overflow: hidden;
  447. display: -webkit-box;
  448. -webkit-line-clamp: 1;
  449. line-clamp: 1;
  450. -webkit-box-orient: vertical;
  451. font-size: 26rpx;
  452. }
  453. .shop {
  454. line-height: 36rpx;
  455. color: #999999;
  456. font-size: 26rpx;
  457. text-overflow: ellipsis;
  458. overflow: hidden;
  459. display: -webkit-box;
  460. -webkit-line-clamp: 2;
  461. line-clamp: 2;
  462. -webkit-box-orient: vertical;
  463. font-size: 24rpx;
  464. }
  465. }
  466. }
  467. .list-cell-btn {
  468. width: 80rpx;
  469. height: 168rpx;
  470. float: right;
  471. .checkbox {
  472. width: 40rpx;
  473. line-height: 168rpx;
  474. float: right;
  475. box-sizing: border-box;
  476. text-align: center;
  477. text-decoration: none;
  478. -webkit-tap-highlight-color: transparent;
  479. overflow: hidden;
  480. font-size: $font-size-34;
  481. &.icon-weixuanze {
  482. color: #b2b2b2;
  483. }
  484. &.icon-yixuanze {
  485. color: #FF5B00;
  486. }
  487. }
  488. }
  489. }
  490. }
  491. }
  492. }
  493. .tui-popup-btn {
  494. width: 100%;
  495. height: auto;
  496. float: left;
  497. margin-top: 24rpx;
  498. .tui-button {
  499. width: 100%;
  500. height: 88rpx;
  501. background: $btn-confirm;
  502. line-height: 88rpx;
  503. text-align: center;
  504. color: #ffffff;
  505. font-size: $font-size-28;
  506. border-radius: 44rpx;
  507. }
  508. .tui-button-text{
  509. width: 600rpx;
  510. height: 48rpx;
  511. line-height: 48rpx;
  512. text-align: center;
  513. color: #FF5B00;
  514. font-size: $font-size-26;
  515. margin: 0 auto;
  516. margin-top: 15rpx;
  517. }
  518. }
  519. }
  520. </style>