condition.php 7.3 KB

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