cm-seller-popup.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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="confirmSeller">确定</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({ spId : userInfo.serviceProviderId })
  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. this.$parent.isSellerpopup = false
  86. },
  87. confirmSeller() {
  88. let sellerData = null
  89. let checkedData = false
  90. this.dataList.forEach((el, index) => {
  91. if (el.ischecked) {
  92. sellerData = el
  93. checkedData = true
  94. }
  95. })
  96. if(!checkedData){
  97. this.$util.msg('请选择一个协销进行分配~', 2000)
  98. return
  99. }
  100. this.$emit('handleChoiceaSeller', sellerData)
  101. this.$parent.isSellerpopup = false
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss">
  107. .coupon-template {
  108. width: 100%;
  109. height: auto;
  110. background: #ffffff;
  111. float: left;
  112. margin-top: 24rpx;
  113. .coupon-title {
  114. width: 702rpx;
  115. padding: 0 24rpx;
  116. height: 88rpx;
  117. line-height: 88rpx;
  118. position: relative;
  119. .text {
  120. font-size: $font-size-28;
  121. color: $text-color;
  122. }
  123. .text-coupon {
  124. display: inline-block;
  125. float: right;
  126. padding-right: 30rpx;
  127. line-height: 88rpx;
  128. font-size: 28rpx;
  129. color: #f94b4b;
  130. }
  131. .iconfont {
  132. width: 50rpx;
  133. height: 88rpx;
  134. line-height: 88rpx;
  135. color: #999999;
  136. display: block;
  137. position: absolute;
  138. right: 0;
  139. top: 0;
  140. }
  141. }
  142. }
  143. .tui-popup-box {
  144. position: relative;
  145. box-sizing: border-box;
  146. min-height: 220rpx;
  147. padding: 24rpx 32rpx 0 32rpx;
  148. .title {
  149. font-size: $font-size-32;
  150. color: $text-color;
  151. line-height: 68rpx;
  152. text-align: center;
  153. float: left;
  154. width: 100%;
  155. height: 68rpx;
  156. box-sizing: border-box;
  157. padding: 0 24rpx;
  158. }
  159. .title-text {
  160. width: 100%;
  161. height: 66rpx;
  162. line-height: 66rpx;
  163. padding: 0 15rpx;
  164. background: #FEF6F1;
  165. box-sizing: border-box;
  166. float: left;
  167. font-size: 26rpx;
  168. color: #FF5B00;
  169. }
  170. .tui-popup-main {
  171. width: 100%;
  172. float: left;
  173. padding-top: 10rpx;
  174. .tui-popup-scroll {
  175. width: 100%;
  176. height: 660rpx;
  177. .list {
  178. width: 100%;
  179. height: 100rpx;
  180. box-sizing: border-box;
  181. background-size: cover;
  182. border-bottom: 1px solid #e1e1e1;
  183. .list-cell-le {
  184. height: 100%;
  185. line-height: 100rpx;
  186. box-sizing: border-box;
  187. float: left;
  188. text-align: left;
  189. font-size: $font-size-26;
  190. color: #333333;
  191. }
  192. .list-cell-btn {
  193. width: 40rpx;
  194. height: 100rpx;
  195. line-height: 100rpx;
  196. float: right;
  197. .checkbox {
  198. width: 40rpx;
  199. line-height: 128rpx;
  200. float: right;
  201. box-sizing: border-box;
  202. text-align: center;
  203. text-decoration: none;
  204. -webkit-tap-highlight-color: transparent;
  205. overflow: hidden;
  206. font-size: $font-size-34;
  207. &.icon-weixuanze {
  208. color: #b2b2b2;
  209. }
  210. &.icon-yixuanze {
  211. color: #FF5B00;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. .tui-popup-coupon {
  218. width: 100%;
  219. height: 500rpx;
  220. box-sizing: border-box;
  221. padding: 30rpx 20rpx;
  222. .tui-popup-h1 {
  223. width: 100%;
  224. height: 66rpx;
  225. display: flex;
  226. align-items: center;
  227. .tui-popup-text {
  228. flex: 1;
  229. height: 66rpx;
  230. line-height: 66rpx;
  231. font-size: $font-size-30;
  232. color: #333333;
  233. &.red {
  234. color: #f94b4b;
  235. }
  236. &.bold {
  237. font-weight: bold;
  238. }
  239. &.left {
  240. text-align: left;
  241. }
  242. &.right {
  243. text-align: right;
  244. }
  245. }
  246. }
  247. }
  248. }
  249. .tui-popup-btn {
  250. width: 100%;
  251. height: auto;
  252. float: left;
  253. margin-top: 24rpx;
  254. .tui-button {
  255. width: 100%;
  256. height: 88rpx;
  257. background: $btn-confirm;
  258. line-height: 88rpx;
  259. text-align: center;
  260. color: #ffffff;
  261. font-size: $font-size-28;
  262. border-radius: 44rpx;
  263. }
  264. }
  265. }
  266. </style>