receipt-popup.vue 8.1 KB

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