cm-report-popup.vue 13 KB

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