index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <style>
  2. .table-body {
  3. padding: 20px 20px;
  4. background-color: #fff;
  5. }
  6. .table-body .top-input {
  7. margin-top: 34px;
  8. }
  9. .input-item {
  10. width: 200px;
  11. margin-right: 20px;
  12. }
  13. .input-item .el-input__inner {
  14. border-right: 0;
  15. }
  16. .input-item .el-input__inner:hover {
  17. border: 1px solid #dcdfe6;
  18. border-right: 0;
  19. outline: 0;
  20. }
  21. .input-item .el-input__inner:focus {
  22. border: 1px solid #dcdfe6;
  23. border-right: 0;
  24. outline: 0;
  25. }
  26. .input-item .el-input-group__append {
  27. background-color: #fff;
  28. border-left: 0;
  29. width: 10%;
  30. padding: 0;
  31. }
  32. .input-item .el-input-group__append .el-button {
  33. padding: 0;
  34. }
  35. .input-item .el-input-group__append .el-button {
  36. margin: 0;
  37. }
  38. /* #app .table-body .el-table .el-button {
  39. border-radius: 16px;
  40. } */
  41. .create {
  42. height: 36px;
  43. line-height: 36px;
  44. float: right;
  45. color: #BCBCBC;
  46. margin-left: 20px;
  47. }
  48. .name {
  49. cursor: pointer;
  50. color: #49A9FF;
  51. }
  52. /* 卡片 */
  53. .plugin-list {
  54. margin: 0 0 0 -20px;
  55. /* padding-right: 100px; */
  56. display: flex;
  57. flex-wrap: wrap;
  58. }
  59. .plugin-list .plugin-item {
  60. width: 20%;
  61. min-width: 400px;
  62. }
  63. .plugin-item {
  64. border: 1px solid #ebebeb;
  65. background: #FFFFFF;
  66. box-shadow: 3px 5px 15px rgba(80, 80, 80, 0.16);
  67. opacity: 1;
  68. border-radius: 5px;
  69. padding: 20px;
  70. margin: 0 0 20px 20px;
  71. transition: 250ms;
  72. position: relative;
  73. /* min-width: 300px; */
  74. }
  75. .plugin-item .item-status {
  76. position: absolute;
  77. top: 0;
  78. right: 0;
  79. width: 94px;
  80. height: 30px;
  81. background: #E8EAEC;
  82. opacity: 1;
  83. border-radius: 0px 5px 0px 5px;
  84. font-size: 14px;
  85. font-family: Microsoft YaHei;
  86. font-weight: 400;
  87. line-height: 30px;
  88. color: #9398A4;
  89. text-align: center;
  90. }
  91. .item-status-permanent {
  92. width: 94px;
  93. }
  94. .item-status-effective {
  95. width: 164px;
  96. }
  97. .plugin-item .item-info {
  98. display: flex;
  99. align-items: center;
  100. }
  101. /* .plugin-item .item-info .item-right{
  102. min-width: 500px;
  103. } */
  104. .plugin-item .item-btns {
  105. display: flex;
  106. align-items: center;
  107. justify-content: flex-end;
  108. margin-top: 12px;
  109. }
  110. .plugin-item .mall-logo {
  111. width: 70px;
  112. height: 70px;
  113. margin-right: 12px;
  114. }
  115. .plugin-item .mall-logo img {
  116. width: 100%;
  117. height: 100%;
  118. display: block;
  119. border-radius: 50%;
  120. }
  121. .plugin-item .display-name {
  122. font-size: 18pt;
  123. margin-top: 10px;
  124. margin-bottom: 4px;
  125. font-family: Microsoft YaHei;
  126. font-weight: bold;
  127. line-height: 30px;
  128. color: #3F495D;
  129. opacity: 1;
  130. width: 200px;
  131. white-space: nowrap;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. }
  135. .plugin-item .name {
  136. color: #909399;
  137. }
  138. .plugin-item:hover {
  139. cursor: pointer;
  140. border-color: #bfddff;
  141. }
  142. /* .plugin-item:hover .display-name {
  143. color: #409EFF;
  144. } */
  145. .plugin-item .plugin-option-btn {
  146. height: 25px;
  147. width: 25px;
  148. font-size: 12px;
  149. padding: 0;
  150. }
  151. .plugin-item .detail-option.detail-option {
  152. color: #909399;
  153. background: #F2F6FC;
  154. }
  155. .plugin-item .detail-option:hover {
  156. color: #fff;
  157. background: #909399;
  158. }
  159. </style>
  160. <div id="app" v-cloak>
  161. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  162. <div slot="header">
  163. <div>
  164. <span>会员等级</span>
  165. <div style="float: right; margin: -5px 0">
  166. <el-button type="primary" size="small" @click="handleEdit('')">新增</el-button>
  167. <el-button type="primary" size="small" @click="handleConditionSet">升级条件设置</el-button>
  168. </div>
  169. </div>
  170. </div>
  171. <div class="table-body">
  172. <template>
  173. <div>
  174. <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" stripe>
  175. <el-table-column prop="title" label="会员等级">
  176. <template slot-scope="scope">
  177. <span style="margin-left: 10px">{{ scope.row.level }}
  178. </span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="url" label="等级名称">
  182. <template slot-scope="scope">
  183. <span style="margin-left: 10px">{{ scope.row.name }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="pic_url" label="会员图标">
  187. <template slot-scope="scope">
  188. <el-image style="width: 50px; height: 50px;border-radius: 50%;" :src="scope.row.pic_url">
  189. <div slot="error" class="image-slot">
  190. <el-image style="width: 50px; height: 50px;border-radius: 50%;" src="/resources/img/common/loading-error.png"></el-image>
  191. </div>
  192. </el-image>
  193. </template>
  194. </el-table-column>
  195. <el-table-column prop="title" label="折扣">
  196. <template slot-scope="scope">
  197. <span>{{ scope.row.discount }}</span>
  198. </template>
  199. </el-table-column>
  200. <el-table-column prop="title" label="是否开启条件升级">
  201. <template slot-scope="scope">
  202. <el-tag v-if="scope.row.upgradeCondition.is_auto_upgrade == 0" type="danger">已关闭</el-tag>
  203. <el-tag v-if="scope.row.upgradeCondition.is_auto_upgrade == 1" type="success">已开启</el-tag>
  204. </template>
  205. </el-table-column>
  206. <el-table-column prop="title" label="状态">
  207. <template slot-scope="scope">
  208. <el-tag v-if="scope.row.status == 0" type="danger">已禁用</el-tag>
  209. <el-tag v-if="scope.row.status == 1" type="success">启用中</el-tag>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="操作">
  213. <template slot-scope="scope">
  214. <el-button type="text" size="mini" circle style="margin-left: 10px;margin-top: 10px" @click="handleEdit(scope.row.id)">
  215. 编辑
  216. </el-button>
  217. <el-button style="margin-left: 10px;margin-top: 10px" type="text" class="set-el-button" size="mini" circle @click="handleDelete(scope.$index, scope.row)">
  218. 删除
  219. </el-button>
  220. </template>
  221. </el-table-column>
  222. </el-table>
  223. <div style="text-align: right;margin: 20px 0;">
  224. <el-pagination
  225. @current-change="pagination"
  226. background
  227. layout="prev, pager, next"
  228. :page-count="pageCount">
  229. </el-pagination>
  230. </div>
  231. </div>
  232. </template>
  233. </div>
  234. </el-card>
  235. </div>
  236. <script>
  237. new Vue({
  238. el: '#app',
  239. data() {
  240. return {
  241. activeName: "1",
  242. tableData: [],
  243. list: [],
  244. keyword: '',
  245. listLoading: false,
  246. page: 1,
  247. level:1,
  248. pageCount: 0,
  249. condition_type_list: {
  250. 1: '下线用户数',
  251. 2: '累计佣金',
  252. 3: '已提现佣金'
  253. },
  254. price_type_list: {
  255. 0: '%',
  256. 1: '元'
  257. }
  258. }
  259. },
  260. created() {
  261. this.loadList({});
  262. },
  263. methods: {
  264. pageChange(page) {
  265. this.loadList();
  266. },
  267. pagination(currentPage) {
  268. let self = this;
  269. self.page = currentPage;
  270. self.loadList({});
  271. },
  272. loadList(params) {
  273. let self = this;
  274. params['r'] = 'mall/user-level/index';
  275. params['page'] = self.page,
  276. this.$request({
  277. params: params,
  278. }).then(e => {
  279. if (e.data.code == 0) {
  280. if(e.data.data.list){
  281. self.tableData = e.data.data.list;
  282. self.pageCount = e.data.data.page_count;
  283. self.listLoading = false;
  284. }
  285. }
  286. }).catch(e => {});
  287. },
  288. handleEdit(id) {
  289. navigateTo({
  290. r: 'mall/user-level/edit',
  291. id: id,
  292. });
  293. },
  294. handleAdd() {
  295. navigateTo({
  296. r: 'mall/user-level/add',
  297. });
  298. },
  299. handleConditionSet() {
  300. navigateTo({
  301. r: 'mall/user-level/condition-set',
  302. });
  303. },
  304. handleDelete(index, row) {
  305. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {
  306. this.$request({
  307. params: {
  308. r: 'mall/user-level/del',
  309. id: row.id,
  310. status: -1,
  311. },
  312. }).then(e => {
  313. if (e.data.code == 0) {
  314. this.$message({
  315. message: e.data.msg,
  316. type: 'success'
  317. });
  318. location.reload();
  319. }else{
  320. this.$message({
  321. message: e.data.msg,
  322. type: 'error'
  323. });
  324. }
  325. }).catch(e => {
  326. });
  327. });
  328. },
  329. },
  330. });
  331. </script>