cm-clubpopup.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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. <image
  33. class="logo"
  34. :src="
  35. club.headpic
  36. ? club.headpic
  37. : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png'
  38. "
  39. mode=""
  40. ></image>
  41. </view>
  42. <view class="list-cell-ri">
  43. <view class="list-name">
  44. {{ club.userIdentity === 2 ? club.name : club.name }}
  45. <text class="tags" v-if="club.vipFlag == 0 && club.userIdentity === 2">VIP</text>
  46. <text class="tags sv" v-if="club.vipFlag == 1">SVIP</text>
  47. </view>
  48. <view class="list-ntel">
  49. <text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
  50. <text class="list-texl">{{ club.contractMobile ? club.contractMobile : '' }}</text>
  51. </view>
  52. </view>
  53. <view class="list-cell-btn">
  54. <view
  55. class="checkbox iconfont"
  56. :class="[club.ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  57. >
  58. </view>
  59. </view>
  60. </view>
  61. </scroll-view>
  62. </view>
  63. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  64. <view class="tui-flex-1"> <view class="tui-button" @click="hidePopup">确定</view> </view>
  65. </view>
  66. </view>
  67. </tui-bottom-popup>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. name: 'coupon',
  73. props: {
  74. show: {
  75. type: Boolean,
  76. default: false
  77. }
  78. },
  79. data() {
  80. return {
  81. isIphoneX: this.$store.state.isIphoneX,
  82. checkedIndex: 0,
  83. isShowClose: false,
  84. listQuery: {
  85. userIdentity: '',
  86. name: '',
  87. pageNum: 1,
  88. pageSize: 200,
  89. spId: this.serviceProviderId,
  90. status: 66
  91. },
  92. dataList: []
  93. }
  94. },
  95. created() {
  96. this.initclubList()
  97. },
  98. methods: {
  99. async initclubList() {
  100. const userInfo = await this.$api.getStorage()
  101. this.listQuery.spId = userInfo.serviceProviderId
  102. this.SellerService.GetSellerClubList(this.listQuery)
  103. .then(response => {
  104. let data = response.data
  105. if (data.list && data.list.length > 0) {
  106. this.dataList = data.list.map((el,index)=>{
  107. el.ischecked = false
  108. return el
  109. })
  110. }
  111. })
  112. .catch(error => {
  113. this.$util.msg(error.msg, 2000)
  114. })
  115. },
  116. checkedCoupon(idx) {
  117. // 选择机构
  118. this.checkedIndex = idx
  119. this.dataList.forEach((el, index) => {
  120. if (this.checkedIndex == index) {
  121. el.ischecked = !el.ischecked
  122. } else {
  123. el.ischecked = false
  124. }
  125. })
  126. },
  127. onShowClose() {
  128. //输入框失去焦点时触发
  129. if (this.listQuery.name != '') {
  130. this.isShowClose = true
  131. } else {
  132. this.isShowClose = false
  133. }
  134. },
  135. delInputText() {
  136. //清除输入框内容
  137. this.listQuery.name = ''
  138. this.isShowClose = false
  139. },
  140. hidePopup() {
  141. let clubInfo = null
  142. let checkedData = false
  143. this.dataList.forEach((el, index) => {
  144. if (el.ischecked) {
  145. clubInfo = el
  146. checkedData = true
  147. }
  148. })
  149. if (checkedData) {
  150. this.$emit('handleChoiceaClub', clubInfo)
  151. }
  152. this.$parent.isClubpopupShow = false
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss">
  158. .coupon-template {
  159. width: 100%;
  160. height: auto;
  161. background: #ffffff;
  162. float: left;
  163. margin-top: 24rpx;
  164. .coupon-title {
  165. width: 702rpx;
  166. padding: 0 24rpx;
  167. height: 88rpx;
  168. line-height: 88rpx;
  169. position: relative;
  170. .text {
  171. font-size: $font-size-28;
  172. color: $text-color;
  173. }
  174. .text-coupon {
  175. display: inline-block;
  176. float: right;
  177. padding-right: 30rpx;
  178. line-height: 88rpx;
  179. font-size: 28rpx;
  180. color: #f94b4b;
  181. }
  182. .iconfont {
  183. width: 50rpx;
  184. height: 88rpx;
  185. line-height: 88rpx;
  186. color: #999999;
  187. display: block;
  188. position: absolute;
  189. right: 0;
  190. top: 0;
  191. }
  192. }
  193. }
  194. .tui-popup-box {
  195. position: relative;
  196. box-sizing: border-box;
  197. min-height: 220rpx;
  198. padding: 24rpx 32rpx 0 32rpx;
  199. .title {
  200. font-size: $font-size-32;
  201. color: $text-color;
  202. line-height: 68rpx;
  203. text-align: center;
  204. float: left;
  205. width: 100%;
  206. height: 68rpx;
  207. box-sizing: border-box;
  208. padding: 0 24rpx;
  209. }
  210. .title-search {
  211. width: 100%;
  212. height: 66rpx;
  213. background: #ffffff;
  214. box-sizing: border-box;
  215. float: left;
  216. .search-from {
  217. width: 100%;
  218. height: 100%;
  219. background: #f7f7f7;
  220. border-radius: 32rpx;
  221. float: left;
  222. position: relative;
  223. .input {
  224. width: 500rpx;
  225. height: 64rpx;
  226. float: left;
  227. line-height: 64rpx;
  228. color: $text-color;
  229. font-size: $font-size-24;
  230. }
  231. .icon-iconfonticonfontsousuo1 {
  232. width: 64rpx;
  233. height: 64rpx;
  234. line-height: 64rpx;
  235. text-align: center;
  236. display: block;
  237. font-size: $font-size-38;
  238. float: left;
  239. color: #999999;
  240. }
  241. .icon-shanchu1 {
  242. font-size: $font-size-32;
  243. color: #999999;
  244. position: absolute;
  245. width: 64rpx;
  246. height: 64rpx;
  247. line-height: 64rpx;
  248. text-align: center;
  249. top: 0;
  250. right: 0;
  251. z-index: 10;
  252. }
  253. }
  254. }
  255. .tui-popup-main {
  256. width: 100%;
  257. float: left;
  258. padding-top: 10rpx;
  259. .tui-popup-scroll {
  260. width: 100%;
  261. height: 800rpx;
  262. .list {
  263. width: 100%;
  264. height: 176rpx;
  265. box-sizing: border-box;
  266. padding: 24rpx 0;
  267. background-size: cover;
  268. .list-cell-le {
  269. width: 128rpx;
  270. height: 100%;
  271. box-sizing: border-box;
  272. float: left;
  273. border: 1px dashed #e1e1e1;
  274. .logo {
  275. width: 125rpx;
  276. height: 125rpx;
  277. border-radius: 8rpx;
  278. }
  279. }
  280. .list-cell-ri {
  281. width: 470rpx;
  282. height: 100%;
  283. box-sizing: border-box;
  284. float: left;
  285. margin-left: 24rpx;
  286. .list-name {
  287. width: 100%;
  288. height: 40rpx;
  289. float: left;
  290. line-height: 40rpx;
  291. text-align: left;
  292. font-size: $font-size-26;
  293. color: #333333;
  294. margin-bottom: 24rpx;
  295. .tags {
  296. display: inline-block;
  297. width: 60rpx;
  298. height: 32rpx;
  299. border-radius: 8rpx;
  300. background: #f0cb72;
  301. font-size: $font-size-22;
  302. color: #4e4539;
  303. text-align: center;
  304. line-height: 32rpx;
  305. margin-left: 20rpx;
  306. &.sv {
  307. background: #333333;
  308. color: #f0cb72;
  309. }
  310. }
  311. }
  312. .list-ntel {
  313. width: 100%;
  314. height: 50rpx;
  315. float: left;
  316. line-height: 50rpx;
  317. text-align: left;
  318. font-size: $font-size-24;
  319. color: #666666;
  320. .list-link {
  321. display: inline-block;
  322. float: left;
  323. margin-right: 40rpx;
  324. }
  325. .list-texl {
  326. display: inline-block;
  327. float: left;
  328. }
  329. }
  330. }
  331. .list-cell-btn {
  332. width: 40rpx;
  333. height: 100%;
  334. float: right;
  335. .checkbox {
  336. width: 40rpx;
  337. line-height: 128rpx;
  338. float: right;
  339. box-sizing: border-box;
  340. text-align: center;
  341. text-decoration: none;
  342. -webkit-tap-highlight-color: transparent;
  343. overflow: hidden;
  344. font-size: $font-size-34;
  345. &.icon-weixuanze {
  346. color: #b2b2b2;
  347. }
  348. &.icon-yixuanze {
  349. color: #e15616;
  350. }
  351. }
  352. }
  353. }
  354. }
  355. .tui-popup-coupon {
  356. width: 100%;
  357. height: 500rpx;
  358. box-sizing: border-box;
  359. padding: 30rpx 20rpx;
  360. .tui-popup-h1 {
  361. width: 100%;
  362. height: 66rpx;
  363. display: flex;
  364. align-items: center;
  365. .tui-popup-text {
  366. flex: 1;
  367. height: 66rpx;
  368. line-height: 66rpx;
  369. font-size: $font-size-30;
  370. color: #333333;
  371. &.red {
  372. color: #f94b4b;
  373. }
  374. &.bold {
  375. font-weight: bold;
  376. }
  377. &.left {
  378. text-align: left;
  379. }
  380. &.right {
  381. text-align: right;
  382. }
  383. }
  384. }
  385. }
  386. }
  387. .tui-popup-btn {
  388. width: 100%;
  389. height: auto;
  390. float: left;
  391. margin-top: 24rpx;
  392. .tui-button {
  393. width: 100%;
  394. height: 88rpx;
  395. background: $btn-confirm;
  396. line-height: 88rpx;
  397. text-align: center;
  398. color: #ffffff;
  399. font-size: $font-size-28;
  400. border-radius: 44rpx;
  401. }
  402. }
  403. }
  404. </style>