cm-seller-popup.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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-text">请选择一个销售人员进行分配</view>
  8. <view class="tui-popup-main coupon">
  9. <scroll-view class="tui-popup-scroll" scroll-y="true">
  10. <view
  11. v-for="(seller, index) in dataList"
  12. :key="index"
  13. class="list"
  14. @click.stop="checkedSeller(index)"
  15. >
  16. <view class="list-cell-le">
  17. {{ seller.name }}
  18. </view>
  19. <view class="list-cell-btn">
  20. <view
  21. class="checkbox iconfont"
  22. :class="[seller.ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  23. >
  24. </view>
  25. </view>
  26. </view>
  27. </scroll-view>
  28. </view>
  29. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  30. <view class="tui-flex-1"> <view class="tui-button" @click="hidePopup">确定</view> </view>
  31. </view>
  32. </view>
  33. </tui-bottom-popup>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. name: 'cm-goods-popup',
  39. props: {
  40. show: {
  41. type: Boolean,
  42. default: false
  43. }
  44. },
  45. data() {
  46. return {
  47. isIphoneX: this.$store.state.isIphoneX,
  48. checkedIndex: 0,
  49. isShowClose: false,
  50. dataList: []
  51. }
  52. },
  53. created() {
  54. this.userClubChoseList()
  55. },
  56. methods: {
  57. async userClubChoseList() {
  58. const userInfo = await this.$api.getStorage()
  59. this.SellerService.userClubChoseList()
  60. .then(response => {
  61. let data = response.data
  62. if (data && data.length > 0) {
  63. this.dataList = data.map((el,index)=>{
  64. el.ischecked = false
  65. return el
  66. })
  67. }
  68. })
  69. .catch(error => {
  70. console.log('获取可分配协销列表异常')
  71. })
  72. },
  73. checkedSeller(idx) {
  74. // 选择协销
  75. this.checkedIndex = idx
  76. this.dataList.forEach((el, index) => {
  77. if (this.checkedIndex == index) {
  78. el.ischecked = !el.ischecked
  79. } else {
  80. el.ischecked = false
  81. }
  82. })
  83. },
  84. hidePopup() {
  85. let sellerData = null
  86. let checkedData = false
  87. this.dataList.forEach((el, index) => {
  88. if (el.ischecked) {
  89. sellerData = el
  90. checkedData = true
  91. }
  92. })
  93. if (checkedData) {
  94. this.$emit('handleChoiceaSeller', sellerData)
  95. }
  96. this.$parent.isSellerpopup = false
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. .coupon-template {
  103. width: 100%;
  104. height: auto;
  105. background: #ffffff;
  106. float: left;
  107. margin-top: 24rpx;
  108. .coupon-title {
  109. width: 702rpx;
  110. padding: 0 24rpx;
  111. height: 88rpx;
  112. line-height: 88rpx;
  113. position: relative;
  114. .text {
  115. font-size: $font-size-28;
  116. color: $text-color;
  117. }
  118. .text-coupon {
  119. display: inline-block;
  120. float: right;
  121. padding-right: 30rpx;
  122. line-height: 88rpx;
  123. font-size: 28rpx;
  124. color: #f94b4b;
  125. }
  126. .iconfont {
  127. width: 50rpx;
  128. height: 88rpx;
  129. line-height: 88rpx;
  130. color: #999999;
  131. display: block;
  132. position: absolute;
  133. right: 0;
  134. top: 0;
  135. }
  136. }
  137. }
  138. .tui-popup-box {
  139. position: relative;
  140. box-sizing: border-box;
  141. min-height: 220rpx;
  142. padding: 24rpx 32rpx 0 32rpx;
  143. .title {
  144. font-size: $font-size-32;
  145. color: $text-color;
  146. line-height: 68rpx;
  147. text-align: center;
  148. float: left;
  149. width: 100%;
  150. height: 68rpx;
  151. box-sizing: border-box;
  152. padding: 0 24rpx;
  153. }
  154. .title-text {
  155. width: 100%;
  156. height: 66rpx;
  157. line-height: 66rpx;
  158. padding: 0 15rpx;
  159. background: #FEF6F1;
  160. box-sizing: border-box;
  161. float: left;
  162. font-size: 26rpx;
  163. color: #e15616;
  164. }
  165. .tui-popup-main {
  166. width: 100%;
  167. float: left;
  168. padding-top: 10rpx;
  169. .tui-popup-scroll {
  170. width: 100%;
  171. height: 660rpx;
  172. .list {
  173. width: 100%;
  174. height: 100rpx;
  175. box-sizing: border-box;
  176. background-size: cover;
  177. border-bottom: 1px solid #e1e1e1;
  178. .list-cell-le {
  179. height: 100%;
  180. line-height: 100rpx;
  181. box-sizing: border-box;
  182. float: left;
  183. text-align: left;
  184. font-size: $font-size-26;
  185. color: #333333;
  186. }
  187. .list-cell-btn {
  188. width: 40rpx;
  189. height: 100rpx;
  190. line-height: 100rpx;
  191. float: right;
  192. .checkbox {
  193. width: 40rpx;
  194. line-height: 128rpx;
  195. float: right;
  196. box-sizing: border-box;
  197. text-align: center;
  198. text-decoration: none;
  199. -webkit-tap-highlight-color: transparent;
  200. overflow: hidden;
  201. font-size: $font-size-34;
  202. &.icon-weixuanze {
  203. color: #b2b2b2;
  204. }
  205. &.icon-yixuanze {
  206. color: #e15616;
  207. }
  208. }
  209. }
  210. }
  211. }
  212. .tui-popup-coupon {
  213. width: 100%;
  214. height: 500rpx;
  215. box-sizing: border-box;
  216. padding: 30rpx 20rpx;
  217. .tui-popup-h1 {
  218. width: 100%;
  219. height: 66rpx;
  220. display: flex;
  221. align-items: center;
  222. .tui-popup-text {
  223. flex: 1;
  224. height: 66rpx;
  225. line-height: 66rpx;
  226. font-size: $font-size-30;
  227. color: #333333;
  228. &.red {
  229. color: #f94b4b;
  230. }
  231. &.bold {
  232. font-weight: bold;
  233. }
  234. &.left {
  235. text-align: left;
  236. }
  237. &.right {
  238. text-align: right;
  239. }
  240. }
  241. }
  242. }
  243. }
  244. .tui-popup-btn {
  245. width: 100%;
  246. height: auto;
  247. float: left;
  248. margin-top: 24rpx;
  249. .tui-button {
  250. width: 100%;
  251. height: 88rpx;
  252. background: $btn-confirm;
  253. line-height: 88rpx;
  254. text-align: center;
  255. color: #ffffff;
  256. font-size: $font-size-28;
  257. border-radius: 44rpx;
  258. }
  259. }
  260. }
  261. </style>