condition-setting.php 7.2 KB

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