cm-clubpopup.vue 8.6 KB

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