condition.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <div>
  5. <span>设置升级条件</span>
  6. </div>
  7. </div>
  8. <div class="table-body">
  9. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" @close="handleClose('ruleForm')">
  10. <el-form-item label="升级条件" :label-width="formLabelWidth" prop="level">
  11. <template>
  12. <el-checkbox-group v-model="ruleForm.checked_condition_keys" class="check-group">
  13. <div style="margin-top: 20px" v-for="item in upgrade_condition">
  14. <el-checkbox :label="item.id" v-model="item.id" border size="medium">{{item.content}}</el-checkbox>
  15. </div>
  16. </el-checkbox-group>
  17. </template>
  18. </el-form-item>
  19. </el-form>
  20. <div slot="footer" class="dialog-footer">
  21. <el-button :loading="btnLoading" type="primary" @click="postAdd('ruleForm')">确 定</el-button>
  22. </div>
  23. </div>
  24. </el-card>
  25. </div>
  26. <script>
  27. new Vue({
  28. el: '#app',
  29. data() {
  30. return {
  31. activeName: "1",
  32. btnLoading: false,
  33. tableData: [],
  34. rules: {
  35. },
  36. upgrade_condition:[],
  37. ruleForm: {
  38. checked_condition_keys:[1,2]
  39. },
  40. formLabelWidth: '150px',
  41. }
  42. },
  43. created() {
  44. this.getList();
  45. },
  46. methods: {
  47. postAdd(formName) {
  48. this.btnLoading = true;
  49. this.$refs[formName].validate((valid) => {
  50. if (valid) {
  51. this.$request({
  52. method: "post",
  53. params: {
  54. r: 'lucky-group/group-level/condition',
  55. },
  56. data: this.ruleForm
  57. }).then(e => {
  58. if (e.data.code == 0) {
  59. this.btnLoading = false;
  60. this.$message({
  61. message: e.data.msg,
  62. type: 'success'
  63. });
  64. navigateTo({
  65. r: 'lucky-group/group-level/index',
  66. })
  67. }else{
  68. this.$message.error(e.data.msg);
  69. }
  70. }).catch(e => {});
  71. }
  72. });
  73. },
  74. getList(){
  75. this.$request({
  76. params: {
  77. r: 'lucky-group/group-level/condition',
  78. },
  79. }).then(e => {
  80. if(e.data.code==0){
  81. this.upgrade_condition = e.data.data.upgrade_condition;
  82. this.ruleForm.checked_condition_keys = e.data.data.checked_condition_keys
  83. }else{
  84. this.$message.error(e.data.msg);
  85. }
  86. console.log(e.data.data);
  87. }).catch(e => {});
  88. },
  89. goodsSelect(){
  90. },
  91. picUrl(e) {
  92. if (e.length) {
  93. this.ruleForm.pic_url = e[0].url;
  94. this.$refs.ruleForm.validateField('pic_url');
  95. }
  96. },
  97. },
  98. });
  99. </script>
  100. <style>
  101. .table-body {
  102. padding: 20px 20px;
  103. background-color: #fff;
  104. }
  105. .table-body .top-input {
  106. margin-top: 34px;
  107. }
  108. .input-item {
  109. width: 200px;
  110. margin-right: 20px;
  111. }
  112. .input-item .el-input__inner {
  113. border-right: 0;
  114. }
  115. .input-item .el-input__inner:hover {
  116. border: 1px solid #dcdfe6;
  117. border-right: 0;
  118. outline: 0;
  119. }
  120. .input-item .el-input__inner:focus {
  121. border: 1px solid #dcdfe6;
  122. border-right: 0;
  123. outline: 0;
  124. }
  125. .input-item .el-input-group__append {
  126. background-color: #fff;
  127. border-left: 0;
  128. width: 10%;
  129. padding: 0;
  130. }
  131. .input-item .el-input-group__append .el-button {
  132. padding: 0;
  133. }
  134. .input-item .el-input-group__append .el-button {
  135. margin: 0;
  136. }
  137. /* #app .table-body .el-table .el-button {
  138. border-radius: 16px;
  139. } */
  140. .create {
  141. height: 36px;
  142. line-height: 36px;
  143. float: right;
  144. color: #BCBCBC;
  145. margin-left: 20px;
  146. }
  147. .name {
  148. cursor: pointer;
  149. color: #49A9FF;
  150. }
  151. /* 卡片 */
  152. .plugin-list {
  153. margin: 0 0 0 -20px;
  154. /* padding-right: 100px; */
  155. display: flex;
  156. flex-wrap: wrap;
  157. }
  158. .plugin-list .plugin-item {
  159. width: 20%;
  160. min-width: 400px;
  161. }
  162. .plugin-item {
  163. border: 1px solid #ebebeb;
  164. background: #FFFFFF;
  165. box-shadow: 3px 5px 15px rgba(80, 80, 80, 0.16);
  166. opacity: 1;
  167. border-radius: 5px;
  168. padding: 20px;
  169. margin: 0 0 20px 20px;
  170. transition: 250ms;
  171. position: relative;
  172. /* min-width: 300px; */
  173. }
  174. .plugin-item .item-status {
  175. position: absolute;
  176. top: 0;
  177. right: 0;
  178. width: 94px;
  179. height: 30px;
  180. background: #E8EAEC;
  181. opacity: 1;
  182. border-radius: 0px 5px 0px 5px;
  183. font-size: 14px;
  184. font-family: Microsoft YaHei;
  185. font-weight: 400;
  186. line-height: 30px;
  187. color: #9398A4;
  188. text-align: center;
  189. }
  190. .item-status-permanent {
  191. width: 94px;
  192. }
  193. .item-status-effective {
  194. width: 164px;
  195. }
  196. .plugin-item .item-info {
  197. display: flex;
  198. align-items: center;
  199. }
  200. /* .plugin-item .item-info .item-right{
  201. min-width: 500px;
  202. } */
  203. .plugin-item .item-btns {
  204. display: flex;
  205. align-items: center;
  206. justify-content: flex-end;
  207. margin-top: 12px;
  208. }
  209. .plugin-item .mall-logo {
  210. width: 70px;
  211. height: 70px;
  212. margin-right: 12px;
  213. }
  214. .plugin-item .mall-logo img {
  215. width: 100%;
  216. height: 100%;
  217. display: block;
  218. border-radius: 50%;
  219. }
  220. .plugin-item .display-name {
  221. font-size: 18pt;
  222. margin-top: 10px;
  223. margin-bottom: 4px;
  224. font-family: Microsoft YaHei;
  225. font-weight: bold;
  226. line-height: 30px;
  227. color: #3F495D;
  228. opacity: 1;
  229. width: 200px;
  230. white-space: nowrap;
  231. overflow: hidden;
  232. text-overflow: ellipsis;
  233. }
  234. .plugin-item .name {
  235. color: #909399;
  236. }
  237. .plugin-item:hover {
  238. cursor: pointer;
  239. border-color: #bfddff;
  240. }
  241. /* .plugin-item:hover .display-name {
  242. color: #409EFF;
  243. } */
  244. .plugin-item .plugin-option-btn {
  245. height: 25px;
  246. width: 25px;
  247. font-size: 12px;
  248. padding: 0;
  249. }
  250. .plugin-item .detail-option.detail-option {
  251. color: #909399;
  252. background: #F2F6FC;
  253. }
  254. .plugin-item .detail-option:hover {
  255. color: #fff;
  256. background: #909399;
  257. }
  258. </style>