cm-report-popup.vue 14 KB

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