cm-refereepopup.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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="(club, index) in dataList"
  27. :key="index"
  28. class="list"
  29. @click.stop="checkedCoupon(index)"
  30. >
  31. <view class="list-cell-le">
  32. {{ club.questionMan }}
  33. </view>
  34. <view class="list-cell-btn">
  35. <view
  36. class="checkbox iconfont"
  37. :class="[club.ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  38. >
  39. </view>
  40. </view>
  41. </view>
  42. </scroll-view>
  43. </view>
  44. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  45. <view class="tui-flex-1"> <view class="tui-button" @click="hidePopup">确定</view> </view>
  46. </view>
  47. </view>
  48. </tui-bottom-popup>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. name: 'cm-goods-popup',
  54. props: {
  55. show: {
  56. type: Boolean,
  57. default: false
  58. }
  59. },
  60. data() {
  61. return {
  62. isIphoneX: this.$store.state.isIphoneX,
  63. checkedIndex: 0,
  64. isShowClose: false,
  65. listQuery: {
  66. serviceProviderId: 0,
  67. pageNum: 1,
  68. pageSize: 100
  69. },
  70. dataList: []
  71. }
  72. },
  73. created() {
  74. this.initclubList()
  75. },
  76. methods: {
  77. async initclubList() {
  78. const userInfo = await this.$api.getStorage()
  79. this.listQuery.serviceProviderId = userInfo.serviceProviderId
  80. this.UserService.getUserClubVisitorList(this.listQuery)
  81. .then(response => {
  82. let data = response.data
  83. if (data.results && data.results.length > 0) {
  84. this.dataList = data.results.map((el,index)=>{
  85. el.ischecked = false
  86. return el
  87. })
  88. }
  89. })
  90. .catch(error => {
  91. this.$util.msg(error.msg, 2000)
  92. })
  93. },
  94. checkedCoupon(idx) {
  95. // 选择优惠券
  96. this.checkedIndex = idx
  97. this.dataList.forEach((el, index) => {
  98. if (this.checkedIndex == index) {
  99. el.ischecked = !el.ischecked
  100. } else {
  101. el.ischecked = false
  102. }
  103. })
  104. },
  105. onShowClose() {
  106. //输入框失去焦点时触发
  107. if (this.listQuery.name != '') {
  108. this.isShowClose = true
  109. } else {
  110. this.isShowClose = false
  111. }
  112. },
  113. delInputText() {
  114. //清除输入框内容
  115. this.listQuery.name = ''
  116. this.isShowClose = false
  117. },
  118. hidePopup() {
  119. let clubInfo = null
  120. let checkedData = false
  121. this.dataList.forEach((el, index) => {
  122. if (el.ischecked) {
  123. clubInfo = el
  124. checkedData = true
  125. }
  126. })
  127. if (checkedData) {
  128. this.$emit('handleChoiceaConsult', clubInfo)
  129. }
  130. this.$parent.isClubConsultShow = false
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. .coupon-template {
  137. width: 100%;
  138. height: auto;
  139. background: #ffffff;
  140. float: left;
  141. margin-top: 24rpx;
  142. .coupon-title {
  143. width: 702rpx;
  144. padding: 0 24rpx;
  145. height: 88rpx;
  146. line-height: 88rpx;
  147. position: relative;
  148. .text {
  149. font-size: $font-size-28;
  150. color: $text-color;
  151. }
  152. .text-coupon {
  153. display: inline-block;
  154. float: right;
  155. padding-right: 30rpx;
  156. line-height: 88rpx;
  157. font-size: 28rpx;
  158. color: #f94b4b;
  159. }
  160. .iconfont {
  161. width: 50rpx;
  162. height: 88rpx;
  163. line-height: 88rpx;
  164. color: #999999;
  165. display: block;
  166. position: absolute;
  167. right: 0;
  168. top: 0;
  169. }
  170. }
  171. }
  172. .tui-popup-box {
  173. position: relative;
  174. box-sizing: border-box;
  175. min-height: 220rpx;
  176. padding: 24rpx 32rpx 0 32rpx;
  177. .title {
  178. font-size: $font-size-32;
  179. color: $text-color;
  180. line-height: 68rpx;
  181. text-align: center;
  182. float: left;
  183. width: 100%;
  184. height: 68rpx;
  185. box-sizing: border-box;
  186. padding: 0 24rpx;
  187. }
  188. .title-search {
  189. width: 100%;
  190. height: 66rpx;
  191. background: #ffffff;
  192. box-sizing: border-box;
  193. float: left;
  194. .search-from {
  195. width: 100%;
  196. height: 100%;
  197. background: #f7f7f7;
  198. border-radius: 32rpx;
  199. float: left;
  200. position: relative;
  201. .input {
  202. width: 500rpx;
  203. height: 64rpx;
  204. float: left;
  205. line-height: 64rpx;
  206. color: $text-color;
  207. font-size: $font-size-24;
  208. }
  209. .icon-iconfonticonfontsousuo1 {
  210. width: 64rpx;
  211. height: 64rpx;
  212. line-height: 64rpx;
  213. text-align: center;
  214. display: block;
  215. font-size: $font-size-38;
  216. float: left;
  217. color: #999999;
  218. }
  219. .icon-shanchu1 {
  220. font-size: $font-size-32;
  221. color: #999999;
  222. position: absolute;
  223. width: 64rpx;
  224. height: 64rpx;
  225. line-height: 64rpx;
  226. text-align: center;
  227. top: 0;
  228. right: 0;
  229. z-index: 10;
  230. }
  231. }
  232. }
  233. .tui-popup-main {
  234. width: 100%;
  235. float: left;
  236. padding-top: 10rpx;
  237. .tui-popup-scroll {
  238. width: 100%;
  239. height: 800rpx;
  240. .list {
  241. width: 100%;
  242. height: 100rpx;
  243. box-sizing: border-box;
  244. background-size: cover;
  245. border-bottom: 1px solid #e1e1e1;
  246. .list-cell-le {
  247. height: 100%;
  248. line-height: 100rpx;
  249. box-sizing: border-box;
  250. float: left;
  251. text-align: left;
  252. font-size: $font-size-26;
  253. color: #333333;
  254. }
  255. .list-cell-btn {
  256. width: 40rpx;
  257. height: 100rpx;
  258. line-height: 100rpx;
  259. float: right;
  260. .checkbox {
  261. width: 40rpx;
  262. line-height: 128rpx;
  263. float: right;
  264. box-sizing: border-box;
  265. text-align: center;
  266. text-decoration: none;
  267. -webkit-tap-highlight-color: transparent;
  268. overflow: hidden;
  269. font-size: $font-size-34;
  270. &.icon-weixuanze {
  271. color: #b2b2b2;
  272. }
  273. &.icon-yixuanze {
  274. color: #FF5B00;
  275. }
  276. }
  277. }
  278. }
  279. }
  280. .tui-popup-coupon {
  281. width: 100%;
  282. height: 500rpx;
  283. box-sizing: border-box;
  284. padding: 30rpx 20rpx;
  285. .tui-popup-h1 {
  286. width: 100%;
  287. height: 66rpx;
  288. display: flex;
  289. align-items: center;
  290. .tui-popup-text {
  291. flex: 1;
  292. height: 66rpx;
  293. line-height: 66rpx;
  294. font-size: $font-size-30;
  295. color: #333333;
  296. &.red {
  297. color: #f94b4b;
  298. }
  299. &.bold {
  300. font-weight: bold;
  301. }
  302. &.left {
  303. text-align: left;
  304. }
  305. &.right {
  306. text-align: right;
  307. }
  308. }
  309. }
  310. }
  311. }
  312. .tui-popup-btn {
  313. width: 100%;
  314. height: auto;
  315. float: left;
  316. margin-top: 24rpx;
  317. .tui-button {
  318. width: 100%;
  319. height: 88rpx;
  320. background: $btn-confirm;
  321. line-height: 88rpx;
  322. text-align: center;
  323. color: #ffffff;
  324. font-size: $font-size-28;
  325. border-radius: 44rpx;
  326. }
  327. }
  328. }
  329. </style>