receipt-popup.vue 8.0 KB

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