cm-report-popup.vue 12 KB

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