manager.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="page" :style="{height:height}">
  3. <view class="flex-row justify-between outView" :style="{marginTop:'24rpx'}">
  4. <view class="roleName">
  5. <text>角色</text>
  6. </view>
  7. <view class="flex-row" @click="selectRole">
  8. <text class="roleName">简德兴</text>
  9. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  10. </view>
  11. </view>
  12. <view>
  13. <scroll-view scroll-y class="scroll-Y">
  14. <view class="flex-col outView">
  15. <view class="flex-row justify-between">
  16. <text class="title">规则标题</text>
  17. <u-icon name="trash" color="#666" size="24"></u-icon>
  18. </view>
  19. <view class="flex-row justify-between awardView">
  20. <text>注册:</text>
  21. <view class="flex-row award ">
  22. <text class="awardItem">现金:12元</text>
  23. <text class="awardItem">比例:10%</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="flex-col outView">
  28. <view class="flex-row justify-between">
  29. <text class="title">规则标题</text>
  30. <u-icon name="trash" color="#666" size="24"></u-icon>
  31. </view>
  32. <view class="flex-row justify-between awardView">
  33. <text>注册:</text>
  34. <view class="flex-row award ">
  35. <text class="awardItem">现金:12元</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="flex-col outView">
  40. <view class="flex-row justify-between">
  41. <text class="title">规则标题</text>
  42. <u-icon name="trash" color="#666" size="24"></u-icon>
  43. </view>
  44. <view class="flex-row justify-between awardView">
  45. <text>优惠券:</text>
  46. <view class="flex-col award ">
  47. <text>数量:100张</text>
  48. <text>有效期:2024-01-01 至 2024-01-30</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="flex-col outView">
  53. <view class="flex-row justify-between">
  54. <text class="title">规则标题</text>
  55. <u-icon name="trash" color="#666" size="24"></u-icon>
  56. </view>
  57. <view class="flex-row justify-between awardView">
  58. <text>优惠券:</text>
  59. <view class="flex-col award ">
  60. <text>数量:100张</text>
  61. <text>有效期:2024-01-01 至 2024-01-30</text>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="flex-col outView">
  66. <view class="flex-row justify-between">
  67. <text class="title">规则标题</text>
  68. <u-icon name="trash" color="#666" size="24"></u-icon>
  69. </view>
  70. <view class="flex-row justify-between awardView">
  71. <text>优惠券:</text>
  72. <view class="flex-col award ">
  73. <text>数量:100张</text>
  74. <text>有效期:2024-01-01 至 2024-01-30</text>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="flex-col outView">
  79. <view class="flex-row justify-between">
  80. <text class="title">规则标题</text>
  81. <u-icon name="trash" color="#666" size="24"></u-icon>
  82. </view>
  83. <view class="flex-row justify-between awardView">
  84. <text>优惠券:</text>
  85. <view class="flex-col award ">
  86. <text>数量:100张</text>
  87. <text>有效期:2024-01-01 至 2024-01-30</text>
  88. </view>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. </view>
  93. <view class="addButton" @click="addRule">
  94. <text>+添加规则</text>
  95. </view>
  96. <view class="confirmButton" @click="createQrCode">
  97. <text>生成二维码</text>
  98. </view>
  99. <uni-popup ref="createQrCodePopup" type="center">
  100. <view class="createQrCodePopup">
  101. <view class="flex-row justify-center">
  102. <text class="popupTitle">邀请专员二维码</text>
  103. </view>
  104. <view class="xoIcon" @click="closePopup">
  105. <u-icon name="close-circle" color="#666" size="24"></u-icon>
  106. </view>
  107. <view class="flex-row justify-center">
  108. <uv-qrcode ref="qrcode" size="540rpx" :value="qrcodeUrl" :options="options"></uv-qrcode>
  109. </view>
  110. </view>
  111. </uni-popup>
  112. <uni-popup ref="rulePopup" type="bottom">
  113. <view class="rulePopup">
  114. <view class="flex-row justify-between">
  115. <text class="popupTitle">选择规则</text>
  116. <u-icon name="close-circle" color="#666" size="24" @click="closePopup"></u-icon>
  117. </view>
  118. <scroll-view scroll-y class="scroll-Y1">
  119. <checkbox-group @change="checkboxChange">
  120. <view class="flex-row justify-between label" v-for="item in 10" :key="item.value">
  121. <view>规则名称规则名称</view>
  122. <view>
  123. <checkbox :value="item.value" :checked="item.checked" />
  124. </view>
  125. </view>
  126. </checkbox-group>
  127. </scroll-view>
  128. <view class="confirmButton" @click="addRule">
  129. <text>确定</text>
  130. </view>
  131. </view>
  132. </uni-popup>
  133. <uni-popup ref="rolePopup" type="bottom">
  134. <view class="rolePopup">
  135. <view class="flex-row justify-between">
  136. <text class="popupTitle">选择角色</text>
  137. <u-icon name="close-circle" color="#666" size="24" @click="closePopup"></u-icon>
  138. </view>
  139. <scroll-view scroll-y class="scroll-Y2">
  140. <view class="roleName1" :class="{selectRoleName1:i===5}" v-for="i in 10">
  141. <text>拓客专员</text>
  142. </view>
  143. </scroll-view>
  144. <view class="confirmButton">
  145. <text>确定</text>
  146. </view>
  147. </view>
  148. </uni-popup>
  149. </view>
  150. </template>
  151. <script>
  152. export default {
  153. props:{
  154. height: {
  155. type: String,
  156. default () {
  157. return ''
  158. }
  159. },
  160. },
  161. data() {
  162. return {
  163. ruleList:[],
  164. roleList:[],
  165. roleBindRuleParam:{},
  166. value: 1,
  167. qrcodeUrl:'https://jje.admin.xinyuekj.com.cn/recharge/recharge?storeId={promotionStoreId}&techNo={techNo}',
  168. options: {
  169. // 指定二维码前景,一般可在中间放logo
  170. foregroundImagePadding:2,
  171. foregroundImageBorderRadius:5,
  172. foregroundImageSrc: '/static/logo.png'
  173. },
  174. range: [
  175. { value: 0, text: "篮球篮球篮球篮球篮球篮" },
  176. { value: 1, text: "足球" },
  177. { value: 2, text: "游泳" },
  178. ],
  179. }
  180. },
  181. onLoad() {
  182. // this.getRuleList()
  183. // this.getRoleList()
  184. },
  185. methods: {
  186. closePopup(){
  187. this.$refs.rolePopup.close()
  188. this.$refs.createQrCodePopup.close()
  189. this.$refs.rulePopup.close()
  190. },
  191. selectRole(){
  192. this.$refs.rolePopup.open()
  193. },
  194. createQrCode(){
  195. this.$refs.createQrCodePopup.open()
  196. },
  197. addRule(){
  198. this.$refs.rulePopup.open()
  199. },
  200. change(e) {
  201. console.log("e:", e);
  202. },
  203. //查询规则
  204. getRuleList(){
  205. this.$api.service.getRuleList().then(res=>{
  206. console.log(res)
  207. this.ruleList = res.data.data
  208. })
  209. },
  210. //查询角色
  211. getRoleList(){
  212. this.$api.service.getRoleList().then(res=>{
  213. console.log(res)
  214. this.roleList = res.data.data
  215. })
  216. },
  217. //角色绑定规则
  218. roleBindRule(){
  219. this.$api.service.roleBindRule(this.roleBindRuleParam).then(res=>{
  220. this.getRuleList()
  221. this.getRoleList()
  222. })
  223. },
  224. }
  225. }
  226. </script>
  227. <style scoped lang="scss">
  228. @import './index.rpx.css';
  229. </style>