cm-report-popup.vue 12 KB

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