achao пре 2 година
родитељ
комит
3e87b60a24

+ 52 - 0
unimall-admin/src/router/index.js

@@ -69,6 +69,58 @@ export const constantRouterMap = [
         meta: { title: 'dashboard', icon: 'dashboard', noCache: true }
       }
     ]
+  },
+  {
+    path: '/info',
+    component: Layout,
+    redirect: 'info',
+    children: [
+      {
+        path: 'info',
+        component: () => import('@/views/gubi/info'),
+        name: 'Dashboard',
+        meta: { title: '分类管理', icon: 'dashboard', noCache: true }
+      }
+    ]
+  },
+  {
+    path: '/three',
+    component: Layout,
+    redirect: 'three',
+    children: [
+      {
+        path: 'three',
+        component: () => import('@/views/gubi/three/index1'),
+        name: 'three',
+        meta: { title: '币种信息', icon: 'dashboard', noCache: true }
+      }
+    ]
+  },
+  {
+    path: '/priceHis',
+    component: Layout,
+    redirect: 'priceHis',
+    children: [
+      {
+        path: 'priceHis',
+        component: () => import('@/views/gubi/priceHis'),
+        name: 'priceHis',
+        meta: { title: '历史价格', icon: 'dashboard', noCache: true }
+      }
+    ]
+  },
+  {
+    path: '/transaction',
+    component: Layout,
+    redirect: 'transaction',
+    children: [
+      {
+        path: 'transaction',
+        component: () => import('@/views/gubi/transaction'),
+        name: 'transaction',
+        meta: { title: '交易记录', icon: 'dashboard', noCache: true }
+      }
+    ]
   }
 ]
 

+ 0 - 52
unimall-admin/src/router/route.json

@@ -73,58 +73,6 @@
 			}
 		]
 	},
-	{
-		"redirect": "noredirect",
-		"name": "info",
-		"path": "/info",
-		"meta": {
-			"icon": "log",
-			"title": "管理"
-		},
-		"alwaysShow": true,
-		"children": [
-			{
-				"path": "info",
-				"name": "info",
-				"page": "/gubi/info",
-				"meta": {
-					"title": "分类管理",
-					"icon": "logininfor",
-					"noCache": true
-				}
-			},
-			{
-				"path": "three",
-				"name": "three",
-				"page": "/gubi/three/index1",
-				"meta": {
-					"title": "分类信息",
-					"icon": "logininfor",
-					"noCache": true
-				}
-			},
-			{
-				"path": "priceHis",
-				"name": "priceHis",
-				"page": "/gubi/priceHis",
-				"meta": {
-					"title": "历史价格",
-					"icon": "logininfor",
-					"noCache": true
-				}
-			},
-			{
-				"path": "transaction",
-				"name": "transaction",
-				"page": "/gubi/transaction",
-				"meta": {
-					"title": "交易记录",
-					"icon": "logininfor",
-					"noCache": true
-				}
-			}
-		]
-	},
 	{
 		"redirect": "noredirect",
 		"path": "/profile",

+ 3 - 1
unimall-admin/src/views/gubi/info/index.vue

@@ -29,6 +29,7 @@
                       :src="item.picture"
                       alt=""
                     /> -->
+                    <span class="item_name_title">{{item.postion}}</span>
                     <span class="item_name_title">{{item.typeName}}</span>
                   </div>
                   <div class="item_sort">
@@ -84,6 +85,7 @@
               </div>
               <el-scrollbar style="height: 572px">
                 <div v-loading="loading" class="item_attr" :class="{avtive:sum === index}" @click="tabClass('2',index)" v-for="(item,index) in second" :key="index">
+                  <span class="item_name_title">{{item.postion}}</span>
                   <div class="item_name_box">
                     <img
                       class="img"
@@ -141,7 +143,7 @@
               <el-scrollbar style="height: 572px">
                 <div v-loading="loading" class="item_attr" v-for="(item,index) in tertiary" :key="index">
                   <div class="item_name_box">
-                   
+                    <span class="item_name_title" style="margin-right:20px">{{item.postion}}</span>
                     <span class="item_name_title">{{item.typeName}}</span>
                   </div>
                   <div class="item_sort">

+ 71 - 7
unimall-admin/src/views/gubi/transaction/index.vue

@@ -176,9 +176,25 @@
           </el-select> -->
           <!-- <el-input v-model="form.orderId" placeholder="请输入分值id" /> -->
         </el-form-item>
-        <el-form-item label="分值图片" prop="number">
+        <!-- <el-form-item label="分值图片" prop="number">
           <img v-for="item in urlPath" :src="item" width="40">
-        </el-form-item>
+        </el-form-item> -->
+        <el-form-item label="类目图片" prop="urlPath">
+          <el-upload
+            :action="uploadPath"
+            :headers="headers"
+            :limit="1"
+            :file-list="imgsFileList"
+            :on-exceed="uploadOverrun"
+            :on-success="handleimgsUrl"
+            :on-remove="handleRemove"
+            multiple
+            accept=".jpg, .jpeg, .png, .gif"
+            list-type="picture-card"
+          >
+            <i class="el-icon-plus" />
+          </el-upload>
+        </el-form-item> 
         <el-form-item label="编号" prop="number">
           <el-input v-model="form.number" placeholder="请输入编号" />
         </el-form-item>
@@ -243,11 +259,15 @@
 </template>
 
 <script>
+import { uploadPath } from '@/api/storage'
+import { getToken } from '@/utils/auth'
 import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from "@/api/gubi/transaction";
 import { listThree, getThree, delThree, addThree, updateThree, exportThree } from "@/api/gubi/three";
 export default {
   data() {
     return {
+      imgsFileList: [],
+      uploadPath,
       data: [],
       newList: [],
       defaultProps: {
@@ -294,7 +314,6 @@ export default {
       // 表单参数
       form: {},
       orderName: "",
-      urlPath: [],
       // 表单校验
       rules: {
         deleteFlag: [
@@ -303,10 +322,49 @@ export default {
       }
     };
   },
+  computed: {
+    headers() {
+      return {
+        accessToken: getToken()
+      }
+    }
+  },
   created() {
     this.getList();
   },
   methods: {
+    uploadOverrun: function() {
+      this.$message({
+        type: 'error',
+        message: '上传文件个数超出限制!最多上传2张图片!'
+      })
+    },
+    handleimgsUrl(response, file, fileList) {
+      if (response.errno === 200) {
+        this.form.urlPath.push(response.url)
+      }
+    },
+    handleRemove: function(file, fileList) {
+      for (var i = 0; i < this.form.urlPath.length; i++) {
+        // 这里存在两种情况
+        // 1. 如果所删除图片是刚刚上传的图片,那么图片地址是file.response.url
+        //    此时的file.url虽然存在,但是是本机地址,而不是远程地址。
+        // 2. 如果所删除图片是后台返回的已有图片,那么图片地址是file.url
+        var url
+        if (file.response === undefined) {
+          url = file.url
+        } else {
+          url = file.response.url
+        }
+
+        if (this.form.urlPath[i] === url) {
+          this.form.urlPath.splice(i, 1)
+        }
+      }
+      if (this.form.urlPath.length > 0) {
+        this.form.pictureUrl = this.form.urlPath[0]
+      }
+    },
     handleNodeClick(data) {
       console.log(data);
       this.form.orderId = data.id
@@ -322,7 +380,7 @@ export default {
     /** 查询交易记录列表 */
     getList() {
       this.loading = true;
-      listTransaction(this.queryParams).then(response => {
+      listTransaction(this.queryParams).then(response => {debugger
         this.transactionList = response.data.data.items
         for (let i = 0; i < this.transactionList.length; i++) {
           if (this.transactionList[i].urlPath) {
@@ -385,8 +443,8 @@ export default {
         grade: undefined,
         collection: undefined,
         price: undefined,
-        status: "0",
-        urlPath: undefined,
+        status: "",
+        urlPath: [],
         deleteFlag: undefined,
         gmtCreate: undefined,
         gmtUpdate: undefined,
@@ -424,6 +482,11 @@ export default {
       const id = row.id || this.ids.join(',')
       getTransaction(id).then(response => {
         this.form = response.data.data
+        if (this.form.urlPath) {
+            this.form.urlPath = this.form.urlPath.split(',')
+          } else {
+            this.form.urlPath = []
+          }
         this.form.collection = new Date(response.data.data.collection)
         this.open = true;
         this.title = "修改交易记录";
@@ -433,7 +496,8 @@ export default {
     submitForm: function () {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          this.form.urlPath = this.urlPath.toString()
+          console.log()
+          this.form.urlPath = this.form.urlPath.toString()
           if (this.form.id != undefined) {
             updateTransaction(this.form).then(response => {
               if (response.data) {

+ 1 - 1
unimall-admin/src/views/layout/components/Sidebar/index.vue

@@ -24,7 +24,7 @@ export default {
   components: { SidebarItem },
   data () {
     return {
-      openeds: ['1'],
+      openeds: ['4'],
     }
 },
   computed: {