lhl пре 2 година
родитељ
комит
442d137cd2
52 измењених фајлова са 2646 додато и 291 уклоњено
  1. 91 10
      package-lock.json
  2. 1 0
      package.json
  3. 21 1
      src/App.vue
  4. BIN
      src/assets/img/basebg.png
  5. BIN
      src/assets/img/download.png
  6. BIN
      src/assets/img/i1.png
  7. BIN
      src/assets/img/i2.png
  8. BIN
      src/assets/img/i3.png
  9. BIN
      src/assets/img/i4.png
  10. BIN
      src/assets/img/i5.png
  11. BIN
      src/assets/img/i6.png
  12. BIN
      src/assets/img/i7.png
  13. BIN
      src/assets/img/i8.png
  14. BIN
      src/assets/img/logo.png
  15. BIN
      src/assets/img/logo1.png
  16. BIN
      src/assets/img/logo2.png
  17. BIN
      src/assets/img/m1.png
  18. BIN
      src/assets/img/m2.png
  19. BIN
      src/assets/img/m3.png
  20. BIN
      src/assets/img/n1.png
  21. BIN
      src/assets/img/n2.png
  22. BIN
      src/assets/img/n3.png
  23. BIN
      src/assets/img/n4.png
  24. BIN
      src/assets/img/n5.png
  25. BIN
      src/assets/img/n6.png
  26. BIN
      src/assets/img/search.png
  27. BIN
      src/assets/img/z1.png
  28. BIN
      src/assets/img/z2.png
  29. BIN
      src/assets/img/z3.png
  30. BIN
      src/assets/img/z4.png
  31. 116 0
      src/assets/js/admun.js
  32. 18 0
      src/assets/js/tools.js
  33. BIN
      src/assets/logo.png
  34. 52 0
      src/components/vueQrCode.vue
  35. 2 2
      src/main.js
  36. 78 0
      src/request/agent.js
  37. 4 4
      src/request/request.js
  38. 92 0
      src/request/user.js
  39. 26 2
      src/router.js
  40. 14 1
      src/store.js
  41. 112 88
      src/views/Home.vue
  42. 82 78
      src/views/Login.vue
  43. 140 3
      src/views/home/abonementList.vue
  44. 160 3
      src/views/home/addressList.vue
  45. 196 0
      src/views/home/money.vue
  46. 166 3
      src/views/home/orderList.vue
  47. 243 3
      src/views/home/rechangeList.vue
  48. 191 91
      src/views/home/regList.vue
  49. 99 0
      src/views/home/setPas.vue
  50. 191 0
      src/views/home/setUserinfo.vue
  51. 329 1
      src/views/home/takingList.vue
  52. 222 1
      src/views/home/transferList.vue

+ 91 - 10
package-lock.json

@@ -1929,8 +1929,7 @@
     "balanced-match": {
       "version": "1.0.2",
       "resolved": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.2.tgz?cache=0&sync_timestamp=1617714233441&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbalanced-match%2Fdownload%2Fbalanced-match-1.0.2.tgz",
-      "integrity": "sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4=",
-      "dev": true
+      "integrity": "sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4="
     },
     "base": {
       "version": "0.11.2",
@@ -3603,6 +3602,14 @@
       "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
       "dev": true
     },
+    "decompress-response": {
+      "version": "6.0.0",
+      "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
+      "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
+      "requires": {
+        "mimic-response": "^3.1.0"
+      }
+    },
     "deep-equal": {
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/deep-equal/download/deep-equal-1.1.1.tgz?cache=0&sync_timestamp=1606860754950&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdeep-equal%2Fdownload%2Fdeep-equal-1.1.1.tgz",
@@ -4844,8 +4851,7 @@
     "fs.realpath": {
       "version": "1.0.0",
       "resolved": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz",
-      "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
-      "dev": true
+      "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
     },
     "fsevents": {
       "version": "2.3.2",
@@ -5692,7 +5698,6 @@
       "version": "1.0.6",
       "resolved": "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz",
       "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
-      "dev": true,
       "requires": {
         "once": "^1.3.0",
         "wrappy": "1"
@@ -5701,8 +5706,7 @@
     "inherits": {
       "version": "2.0.4",
       "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz",
-      "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=",
-      "dev": true
+      "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w="
     },
     "internal-ip": {
       "version": "4.3.0",
@@ -6118,6 +6122,11 @@
       "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
       "dev": true
     },
+    "js-binary-schema-parser": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/js-binary-schema-parser/-/js-binary-schema-parser-2.0.3.tgz",
+      "integrity": "sha512-xezGJmOb4lk/M1ZZLTR/jaBHQ4gG/lqQnJqdIv4721DMggsa1bDVlHXNeHYogaIEHD9vCRv0fcL4hMA+Coarkg=="
+    },
     "js-levenshtein": {
       "version": "1.1.6",
       "resolved": "https://registry.npm.taobao.org/js-levenshtein/download/js-levenshtein-1.1.6.tgz",
@@ -6623,6 +6632,11 @@
       "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=",
       "dev": true
     },
+    "mimic-response": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
+      "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
+    },
     "mini-css-extract-plugin": {
       "version": "0.8.2",
       "resolved": "https://registry.nlark.com/mini-css-extract-plugin/download/mini-css-extract-plugin-0.8.2.tgz",
@@ -7253,7 +7267,6 @@
       "version": "1.4.0",
       "resolved": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz",
       "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
-      "dev": true,
       "requires": {
         "wrappy": "1"
       }
@@ -7413,6 +7426,11 @@
         "no-case": "^2.2.0"
       }
     },
+    "parenthesis": {
+      "version": "3.1.8",
+      "resolved": "https://registry.npmjs.org/parenthesis/-/parenthesis-3.1.8.tgz",
+      "integrity": "sha512-KF/U8tk54BgQewkJPvB4s/US3VQY68BRDpH638+7O/n58TpnwiwnOtGIOsT2/i+M78s61BBpeC83STB88d8sqw=="
+    },
     "parse-asn1": {
       "version": "5.1.6",
       "resolved": "https://registry.npm.taobao.org/parse-asn1/download/parse-asn1-5.1.6.tgz?cache=0&sync_timestamp=1597165710136&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fparse-asn1%2Fdownload%2Fparse-asn1-5.1.6.tgz",
@@ -9450,6 +9468,21 @@
       "integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=",
       "dev": true
     },
+    "simple-concat": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
+      "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="
+    },
+    "simple-get": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
+      "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
+      "requires": {
+        "decompress-response": "^6.0.0",
+        "once": "^1.3.1",
+        "simple-concat": "^1.0.0"
+      }
+    },
     "simple-swizzle": {
       "version": "0.2.2",
       "resolved": "https://registry.npm.taobao.org/simple-swizzle/download/simple-swizzle-0.2.2.tgz",
@@ -9901,6 +9934,14 @@
       "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
       "dev": true
     },
+    "string-split-by": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/string-split-by/-/string-split-by-1.0.0.tgz",
+      "integrity": "sha512-KaJKY+hfpzNyet/emP81PJA9hTVSfxNLS9SFTWxdCnnW1/zOOwiV248+EfoX7IQFcBaOp4G5YE6xTJMF+pLg6A==",
+      "requires": {
+        "parenthesis": "^3.1.5"
+      }
+    },
     "string-width": {
       "version": "2.1.1",
       "resolved": "https://registry.nlark.com/string-width/download/string-width-2.1.1.tgz",
@@ -10799,6 +10840,47 @@
         "vue-style-loader": "^4.1.0"
       }
     },
+    "vue-qr": {
+      "version": "4.0.9",
+      "resolved": "https://registry.npmjs.org/vue-qr/-/vue-qr-4.0.9.tgz",
+      "integrity": "sha512-pAISV94T0MNEYA3NGjykUpsXRE2QfaNxlu9ZhEL6CERgqNc21hJYuP3hRVzAWfBQlgO18DPmZTbrFerJC3+Ikw==",
+      "requires": {
+        "glob": "^8.0.1",
+        "js-binary-schema-parser": "^2.0.2",
+        "simple-get": "^4.0.1",
+        "string-split-by": "^1.0.0"
+      },
+      "dependencies": {
+        "brace-expansion": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+          "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+          "requires": {
+            "balanced-match": "^1.0.0"
+          }
+        },
+        "glob": {
+          "version": "8.1.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
+          "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
+          "requires": {
+            "fs.realpath": "^1.0.0",
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "^5.0.1",
+            "once": "^1.3.0"
+          }
+        },
+        "minimatch": {
+          "version": "5.1.6",
+          "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
+          "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
+          "requires": {
+            "brace-expansion": "^2.0.1"
+          }
+        }
+      }
+    },
     "vue-router": {
       "version": "3.5.1",
       "resolved": "https://registry.nlark.com/vue-router/download/vue-router-3.5.1.tgz?cache=0&sync_timestamp=1620899536020&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-router%2Fdownload%2Fvue-router-3.5.1.tgz",
@@ -11546,8 +11628,7 @@
     "wrappy": {
       "version": "1.0.2",
       "resolved": "https://registry.nlark.com/wrappy/download/wrappy-1.0.2.tgz?cache=0&sync_timestamp=1619133505879&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrappy%2Fdownload%2Fwrappy-1.0.2.tgz",
-      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
-      "dev": true
+      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
     },
     "ws": {
       "version": "6.2.2",

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
     "core-js": "^2.6.5",
     "element-ui": "^2.15.2",
     "vue": "^2.6.10",
+    "vue-qr": "^4.0.9",
     "vue-router": "^3.0.3",
     "vuex": "^3.0.1"
   },

+ 21 - 1
src/App.vue

@@ -4,14 +4,34 @@
   </div>
 </template>
 <script>
-
+import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import { getIndex } from '@/request/agent.js'
 export default {
   created() {
   	// if(this.isMobile()) {
   	// 	window.location.href = 'https://www.ezsredcross.org.cn/index/#/'
   	// }
+	this.getIndex()
+	let userInfo = JSON.parse(window.sessionStorage.getItem('user'))
+	console.log(userInfo, 'userInfo');
+	if (userInfo && userInfo.id) {
+		this.setUserInfo(userInfo)
+		this.login()
+	} else {
+		this.$router.push('/login')
+	}
   },
   methods: {
+	  ...mapMutations(['setUserInfo','login','setBaseInfo']),
+	  getIndex() {
+	  	getIndex().then(res => {
+	  		// console.log(res);
+	  		this.setBaseInfo(res.data)
+	  	})
+	  }
   	  // isMobile() {
   	  // 	if(/android/i.test(navigator.userAgent)) {
   	  // 		//document.write("This is Android'browser.");//这是Android平台下浏览器

BIN
src/assets/img/basebg.png


BIN
src/assets/img/download.png


BIN
src/assets/img/i1.png


BIN
src/assets/img/i2.png


BIN
src/assets/img/i3.png


BIN
src/assets/img/i4.png


BIN
src/assets/img/i5.png


BIN
src/assets/img/i6.png


BIN
src/assets/img/i7.png


BIN
src/assets/img/i8.png


BIN
src/assets/img/logo.png


BIN
src/assets/img/logo1.png


BIN
src/assets/img/logo2.png


BIN
src/assets/img/m1.png


BIN
src/assets/img/m2.png


BIN
src/assets/img/m3.png


BIN
src/assets/img/n1.png


BIN
src/assets/img/n2.png


BIN
src/assets/img/n3.png


BIN
src/assets/img/n4.png


BIN
src/assets/img/n5.png


BIN
src/assets/img/n6.png


BIN
src/assets/img/search.png


BIN
src/assets/img/z1.png


BIN
src/assets/img/z2.png


BIN
src/assets/img/z3.png


BIN
src/assets/img/z4.png


+ 116 - 0
src/assets/js/admun.js

@@ -0,0 +1,116 @@
+let munList = [{
+		id: 1,
+		authName: '注册码管理',
+		icon: 'el-icon-s-order',
+		children: [{
+				id: 2,
+				authName: '注册码列表',
+				path: 'home/regList'
+			},
+			// {
+			// 	id: 3,
+			// 	authName: '注册码购买',
+			// 	path: 'home/buyReg'
+			// }
+		]
+	},
+	{
+		id: 4,
+		authName: '用户管理',
+		icon: 'el-icon-s-custom',
+		children: [{
+			id: 5,
+			authName: '用户列表',
+			path: 'home/abonementList'
+		}, ]
+	},
+	{
+		id: 6,
+		authName: '订单管理',
+		icon: 'el-icon-s-goods',
+		children: [{
+			id: 7,
+			authName: '订单',
+			path: 'home/orderList'
+		}, ]
+	},
+	{
+		id: 8,
+		authName: '地址管理',
+		icon: 'el-icon-location',
+		children: [{
+			authName: '地址列表',
+			path: 'home/addressList'
+		}, ]
+	},
+	{
+		id: 9,
+		authName: '充值管理',
+		icon:"el-icon-s-finance",
+		children: [{
+			authName: '充值记录',
+			path: 'home/rechangeList'
+		},
+		// {
+		// 	authName: '充值',
+		// 	path: 'home/rechange'
+		// }
+		]
+	},
+	{
+		id: 10,
+		authName: '提现管理',
+		icon: 'el-icon-s-check',
+		children: [{
+			id: 11,
+			authName: '提现记录',
+			path: 'home/takingList'
+		},
+		// {
+		// 	id: 12,
+		// 	authName: '提现',
+		// 	path: 'home/taking'
+		// },
+		]
+	},
+	{
+		id: 13,
+		authName: '转账管理',
+		icon: 'el-icon-s-claim',
+		children: [{
+			id: 14,
+			authName: '转账记录',
+			path: 'home/transferList'
+		},
+		// {
+		// 	id: 15,
+		// 	authName: '转账',
+		// 	path: 'home/transfer'
+		// },
+		]
+	},
+	{
+		id: 16,
+		authName: '个人中心',
+		icon: 'el-icon-s-tools',
+		children: [{
+			id: 17,
+			authName: '交易密码',
+			path: 'home/setPas'
+		},
+		{
+			id: 18,
+			authName: '修改信息',
+			path: 'home/setUserinfo'
+		},
+		{
+			id: 30,
+			authName: '资金流水',
+			path: 'home/money'
+		}]
+	},
+]
+
+module.exports = {
+	munList
+}

+ 18 - 0
src/assets/js/tools.js

@@ -0,0 +1,18 @@
+export function validateEmail(email) {
+	var re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
+	return re.test(email);
+}
+
+export function showTime(timestamp) {
+	// 时间戳 
+	// 此处时间戳以毫秒为单位
+	let date = new Date(parseInt(timestamp) * 1000);
+	let Year = date.getFullYear();
+	let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
+	let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
+	let Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
+	let Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+	let Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+	let GMT = Year + '-' + Moth + '-' + Day + '   ' + Hour + ':' + Minute + ':' + Sechond;
+	return GMT
+}

BIN
src/assets/logo.png


+ 52 - 0
src/components/vueQrCode.vue

@@ -0,0 +1,52 @@
+<template>
+  <div>
+    <vue-qr :text="textParam" :size="sizeParam"></vue-qr>
+  </div>
+</template>
+
+<script>
+import VueQr from 'vue-qr'
+export default {
+  name: "vueQrCode",
+  //对外暴露的传入参数 text:生成的文本 size:边框大小
+  props:{text:{type:String,default:()=>""},size:{type:Number,default:()=>200}},
+  components:{
+    VueQr,
+  },
+  data(){
+    return {
+
+    }
+  },
+  created() {
+  },
+  methods:{
+    refreshQrCode(text){
+      console.log("刷新二维码:"+text);
+      let _this =this;
+      _this.$nextTick(()=>{
+        _this.text = text;
+      })
+    },
+    getText(){
+      let _this =this;
+      _this.$nextTick(()=>{
+        return _this.text;
+      })
+
+    },
+  },
+  computed:{
+    textParam:function (){
+      return this.text;
+    },
+    sizeParam:function (){
+      return this.size;
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 2
src/main.js

@@ -10,13 +10,13 @@ import 'element-ui/lib/theme-chalk/index.css';
 
 Vue.config.productionTip = false
 Vue.use(ElementUI);
-
+Vue.prototype.$msg = ElementUI.Message
 
  router.afterEach((to,from,next) => {
 	 //页面跳转时,页面位置重置为顶部
       window.scrollTo(0,0);
 	  //修改页面title
-	  window.document.title = to.meta.title == undefined?'荆州红十字会-官网':to.meta.title
+	  window.document.title = to.meta.title == undefined?'':to.meta.title
  })
 
 new Vue({

+ 78 - 0
src/request/agent.js

@@ -1,5 +1,14 @@
 import request from "./request.js"
 
+//获取基础信息
+export function getIndex(data) {
+	return request({
+		url: '/api/index/index',
+		method: 'get',
+		data
+	});
+}
+
 // 获取验证码列表
 export function getRegList(data) {
 	return request({
@@ -8,3 +17,72 @@ export function getRegList(data) {
 		data
 	});
 }
+
+//登录
+export function login(data = {}) {
+	return request({
+		url: '/api/user/login',
+		method: 'post',
+		data
+	});
+}
+
+//购买注册码
+export function createCode(data = {}) {
+	return request({
+		url: '/api/Agent/create_code',
+		method: 'post',
+		data
+	});
+}
+
+//设置交易密码
+export function setTransaction(data={}) {
+	return request({
+		url: '/api/user/transaction',
+		method: 'post',
+		data
+	});
+}
+
+//注册码列表
+export function getCodeList(data={}) {
+	return request({
+		url: '/api/Agent/code',
+		method: 'get',
+		params:data
+	});
+}
+
+//用户列表
+export function getUserList(data={}) {
+	return request({
+		url: '/api/Agent/user',
+		method: 'get',
+		params:data
+	});
+}
+
+
+
+
+
+//获取地址信息
+export function getAddressList(data) {
+	return request({
+		url: '/api/agent/address',
+		method: 'get',
+		params:data
+	});
+}
+
+export function getOrderList(data) {
+	return request({
+		url: '/api/agent/order',
+		method: 'get',
+		params:data
+	});
+}
+
+
+

+ 4 - 4
src/request/request.js

@@ -22,7 +22,7 @@ service.interceptors.request.use(
 		// let each request carry token
 		// ['X-Token'] is a custom headers key
 		// please modify it according to the actual situation
-		// config.headers['X-Token'] = getToken()
+		config.headers['token'] = window.sessionStorage.getItem('token') || ''
 		// if(config.method=='get'){
 		// 	if(!config.params){
 		// 		config.params={};
@@ -45,10 +45,10 @@ service.interceptors.response.use(
 	response => {
 		const res = response.data
 		// 解析字符串为数字
-		res.errcode = parseInt(res.status);
+		res.errcode = parseInt(res.code);
 		res.message = res.msg;
 		// console.log(typeof res.errcode);
-		if (res.errcode !== 200) {
+		if (res.errcode !== 1) {
 			if (res.errcode === 1001) {
 				if (res.message.includes('您已经登录') || res.message.includes('您已经注册')) {
 					router.push('/');
@@ -57,7 +57,7 @@ service.interceptors.response.use(
 			if (res.errcode === 2000) {
 					let url = res.data.wxurl + '?url=' + encodeURIComponent(window.location.href);
 					window.location.href = url;
-			} else if (res.errcode === 2002) {
+			} else if (res.errcode === 401) {
 					router.push("/login");
 			} else {
 				// Toast({

+ 92 - 0
src/request/user.js

@@ -0,0 +1,92 @@
+import request from "./request.js"
+
+//充值记录
+export function getRechangeList(data) {
+	return request({
+		url: '/api/user/recharge_lst',
+		method: 'get',
+		params:data
+	});
+}
+
+//充值
+export function rechange(data) {
+	return request({
+		url: '/api/user/recharge',
+		method: 'post',
+		data
+	});
+}
+
+//获取用户信息
+export function getUserInfo(data) {
+	return request({
+		url: '/api/user/userinfo',
+		method: 'get',
+		params:data
+	});
+}
+
+//设置用户信息
+export function setUserInfo(data) {
+	return request({
+		url: '/api/user/profile',
+		method: 'post',
+		data
+	});
+}
+
+//转账记录
+export function getTransferList(data) {
+	return request({
+		url: '/api/user/transfer_lst',
+		method: 'get',
+		params:data
+	});
+}
+
+//转账
+export function transfer(data) {
+	return request({
+		url: '/api/user/transfer',
+		method: 'post',
+		data
+	});
+}
+
+//提现
+export function withdrawalList(data) {
+	return request({
+		url: '/api/user/withdrawal_lst',
+		method: 'get',
+		params:data
+	});
+}
+
+//提现
+export function withdrawal(data) {
+	return request({
+		url: '/api/user/withdrawal',
+		method: 'post',
+		data
+	});
+}
+
+//获取token列表
+export function getTokenList(data) {
+	return request({
+		url: '/api/user/get_token_list',
+		method: 'get',
+		params:data
+	});
+}
+
+//资金流水
+export function getMoneyList(data) {
+	return request({
+		url: '/api/user/money_log',
+		method: 'get',
+		params:data
+	});
+}
+

+ 26 - 2
src/router.js

@@ -68,7 +68,7 @@ let router = new Router({
 					name: 'orderList',
 					component: () => import('./views/home/orderList.vue'),
 					meta: {
-						title: '订单列表'
+						title: '订单'
 					}
 				},
 				{
@@ -143,6 +143,30 @@ let router = new Router({
 						title: '统计'
 					}
 				},
+				{
+					path: 'setPas',
+					name: 'setPas',
+					component: () => import('./views/home/setPas.vue'),
+					meta: {
+						title: '统计'
+					}
+				},
+				{
+					path: 'setUserinfo',
+					name: 'setUserinfo',
+					component: () => import('./views/home/setUserinfo.vue'),
+					meta: {
+						title: '修改个人信息'
+					}
+				},
+				{
+					path: 'money',
+					name: 'money',
+					component: () => import('./views/home/money.vue'),
+					meta: {
+						title: '资金流水'
+					}
+				}
 			]
 		},
 		{
@@ -156,7 +180,7 @@ let router = new Router({
 router.beforeEach((to, from, next) => {
   if (to.path === '/login') return next()
   const tokenStr = window.sessionStorage.getItem('token')
-  // if (!tokenStr) return next('/login')
+  if (!tokenStr) return next('/login')
   next()
 })
 

+ 14 - 1
src/store.js

@@ -5,17 +5,30 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: {
-	www: "https://www.ezsredcross.org.cn",
+	www: "http://fh.frp.liuniu946.com",
 	hasLogin:false,
+	userInfo: {},
+	baseInfo: {}
   },
   mutations: {
 	login(state) {
 		state.hasLogin = true
+		
 	},
 	loginOut(state) {
 		state.hasLogin = false
 		window.localStorage.removeItem('token');
+		window.localStorage.removeItem('user');
+	},
+	setUserInfo(state,payload) {
+		state.userInfo = payload
+		window.sessionStorage.setItem('user', JSON.stringify(payload))
+		
+	},
+	setBaseInfo(state,payload) {
+		state.baseInfo = payload
 	}
+	
   },
   actions: {
 

+ 112 - 88
src/views/Home.vue

@@ -4,11 +4,44 @@
 			<!-- 头部 -->
 			<el-header class="home-header">
 				<div class="home-loge">
-					<!-- <img src="~assets/img/logo.jpg" alt="logo.jpg" /> -->
-					<!-- <span>电商后台管理系统</span> -->
+					<!-- <el-image
+					      style="width: 50px; height: 50px;border-radius: 50%;"
+					      :src="userInfo.avatar"></el-image>
+					<div class="flex user-ifno">
+						<span class="name">{{userInfo.username}}</span>
+					</div> -->
 				</div>
 				<div class="out-wrapper">
-					<el-button type="info" @click="logout">退出</el-button>
+					<!-- <el-button type="info" @click="logout">退出</el-button> -->
+					<div class="hand u-name" @click="kf">
+						客服
+					</div>
+					<div class="hand u-name" >
+						余额:{{userInfo.money}}
+					</div>
+					<div class="hand u-name">
+						{{userInfo.username}}
+						<div class="u-ban ">
+							<div class="u-wrap">
+								<el-image style="width: 40px; height: 40px;border-radius: 50%;"
+									:src="userInfo.avatar"></el-image>
+								<div class="info">
+									用户ID: {{userInfo.id}}
+								</div>
+								<div class="info">
+									用户名: {{userInfo.username}}
+								</div>
+								<div class="info">
+									昵称: {{userInfo.nickname}}
+								</div>
+								<div class="info">
+									余额: {{userInfo.money}}
+								</div>
+								<el-button @click="logout">退出登录</el-button>
+							</div>
+							
+						</div>
+					</div>
 				</div>
 			</el-header>
 			<div class="boddy-wrap">
@@ -17,7 +50,7 @@
 						router :default-active="currenIndex">
 						<el-submenu v-for="item in menulist" :key="item.id" :index="item.id + ''">
 							<template slot="title">
-								<i :class="menulogonj[item.id]"></i>
+								<i :class="item.icon"></i>
 								<span>{{ item.authName }}</span>
 							</template>
 							<el-menu-item :index="'/' + subItem.path + ''" v-for="subItem in item.children"
@@ -41,91 +74,21 @@
 </template>
 
 <script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		munList
+	} from '@/assets/js/admun.js'
 	export default {
 		name: 'Home',
 		data() {
+
 			return {
-				menulist: [{
-						id: 1,
-						authName: '注册码管理',
-						children: [{
-								id: 2,
-								authName: '注册码列表',
-								path: 'home/regList'
-							},
-							{
-								id: 3,
-								authName: '注册码购买',
-								path: 'home/buyReg'
-							}
-						]
-					},
-					{
-						id: 4,
-						authName: '用户管理',
-						children: [{
-							id: 5,
-							authName: '用户列表',
-							path: 'home/abonementList'
-						}, ]
-					},
-					{
-						id: 6,
-						authName: '订单管理',
-						children: [{
-							id: 7,
-							authName: '订单列表',
-							path: 'home/orderList'
-						}, ]
-					},
-					{
-						id: 8,
-						authName: '地址管理',
-						children: [{
-							authName: '地址列表',
-							path: 'home/addressList'
-						}, ]
-					},
-					{
-						id: 9,
-						authName: '充值管理',
-						children: [{
-							authName: '充值记录',
-							path: 'home/rechangeList'
-						}, {
-							authName: '充值',
-							path: 'home/rechange'
-						}]
-					},
-					{
-						id: 10,
-						authName: '提现管理',
-						children: [{
-							id: 11,
-							authName: '提现记录',
-							path: 'home/takingList'
-						}, {
-							id: 12,
-							authName: '提现',
-							path: 'home/taking'
-						}]
-					},
-					{
-						id: 13,
-						authName: '转账管理',
-						children: [{
-							id: 14,
-							authName: '转账记录',
-							path: 'home/transferList'
-						}, {
-							id: 15,
-							authName: '转账',
-							path: 'home/transfer'
-						}]
-					},
-				],
+				menulist: munList,
 				menulogonj: {
-					1:'el-icon-s-order',
+					1: 'el-icon-s-order',
 					4: 'el-icon-s-custom',
 					103: 'el-icon-s-cooperation',
 					101: 'el-icon-s-goods',
@@ -137,11 +100,15 @@
 			}
 		},
 		computed: {
+			...mapState(['userInfo','baseInfo']),
 			currenIndex() {
 				return this.$route.path
 			},
 		},
 		methods: {
+			kf() {
+				window.open(this.baseInfo.service_kf)
+			},
 			logout() {
 				window.sessionStorage.clear()
 				this.$router.push('/login')
@@ -157,13 +124,11 @@
 				this.isopen = !this.isopen
 			},
 		},
-		created() {
-			// this.getMenList()
-		},
+		created() {},
 	}
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 	.home {
 		height: 100%;
 		background-color: #eaedf2;
@@ -200,6 +165,47 @@
 	.out-wrapper {
 		display: flex;
 		align-items: center;
+		padding-right: 50px;
+
+		.u-name {
+			text-decoration: underline;
+			padding: 0 20px;
+			height: 100%;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			position: relative;
+			&:hover {
+				.u-ban {
+					display: block;
+				}
+			}
+			.u-ban {
+				position: absolute;
+				width: 200px;
+				height: 300px;
+				display: none;
+				bottom: -300px;
+				left:-50px;
+				margin: auto;
+				z-index: 99;
+				.u-wrap {
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					background-color: #fff;
+					box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
+					padding: 10px;
+					
+					.info {
+						color: #333;
+						font-size: 14px;
+						padding: 10px 0;
+					}
+				}
+				
+			}
+		}
 	}
 
 	.home-nav {
@@ -245,4 +251,22 @@
 		display: flex;
 		justify-content: center;
 	}
+
+	.user-ifno {
+
+		flex-direction: column;
+
+		.name {
+			color: black;
+			font-weight: bold;
+		}
+
+		.user-id {
+			color: black;
+			font-size: 14px;
+			padding-top: 10px;
+
+			/* font-weight: bold; */
+		}
+	}
 </style>

+ 82 - 78
src/views/Login.vue

@@ -2,10 +2,10 @@
 	<div class="login-wrapper">
 		<div class="login-box">
 			<!-- 头像容器 -->
-			
+
 			<!-- 表单容器 -->
 			<div class="login-form-box">
-				<el-form label-width="0px" ref="loginFormRef" class="login-form" :model="loginForm" :rules="loginRules">
+				<el-form label-width="0px" ref="loginFormRef" class="login-form" :model="loginForm">
 					<!--用户名-->
 					<el-form-item prop="username">
 						<el-input placeholder="请输入用户名" prefix-icon="el-icon-s-custom"
@@ -18,8 +18,8 @@
 					</el-form-item>
 					<!--按钮-->
 					<el-form-item class="btns">
-						<el-button type="primary" @click="login">登录</el-button>
-						<el-button type="info" @click="resetLoginForm">重置</el-button>
+						<el-button type="primary" @click="logins">登录</el-button>
+						<!-- <el-button type="info" @click="resetLoginForm">重置</el-button> -->
 					</el-form-item>
 				</el-form>
 			</div>
@@ -27,6 +27,16 @@
 	</div>
 </template>
 <script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		login
+	} from '@/request/agent.js'
+	import {
+		splist
+	} from '@/request/api.js'
 	export default {
 		name: "Login",
 		data() {
@@ -34,42 +44,32 @@
 				loginForm: {
 					username: 'admin',
 					password: '123456'
-				},
-				loginRules: {
-					username: [{
-							required: true,
-							message: "请输入用户名",
-							trigger: 'blur'
-						},
-						{
-							min: 5,
-							max: 10,
-							message: "请输入正确的用户名",
-							trigger: 'blur'
-						}
-					],
-					password: [{
-							required: true,
-							message: "请输入密码",
-							trigger: 'blur'
-						},
-						{
-							min: 5,
-							max: 16,
-							message: "请输入正确的密码",
-							trigger: 'blur'
-						}
-					]
 				}
 			}
 		},
 		methods: {
+			...mapMutations(['setUserInfo','login']),
 			resetLoginForm() {
 				this.$refs.loginFormRef.resetFields()
 			},
-			login() {
-				this.$router.push("/home")
-
+			logins() {
+				let that = this
+				if (that.username == '') {
+					return that.$msg.error('请输入用户名')
+				}
+				if (that.password == '') {
+					return that.$msg.error('请输入密码')
+				}
+				login({
+					account: that.loginForm.username,
+					password: that.loginForm.password
+				}).then(res => {
+					console.log(res);
+					that.login()
+					that.setUserInfo(res.data.userinfo)
+					window.sessionStorage.setItem('token', res.data.userinfo.token)
+					that.$router.push("/home")
+				})
 			}
 		}
 	};
@@ -77,51 +77,55 @@
 
 <style Lang='scss' scoped>
 	.login-wrapper {
- position : absolute;
- 	width : 100%;
- 	height : 100%;
-}
+		position: absolute;
+		width: 100%;
+		height: 100%;
+		background-image: url(../assets/img/basebg.png);
+	}
+
+	.login-box {
+		width: 450px;
+		height: 250px;
+		background-color: #fff;
+		padding-top: 50px;
+		border-radius: 3px;
+		display: flex;
+		flex-direction: column;
+		position: absolute;
+		left: 50%;
+		top: 0;
+		bottom: 0;
+		margin: auto;
+	}
+
+	.avatar-box {
+		width: 130px;
+		height: 130px;
+		border: 1px solid #eee;
+		border-radius: 50%;
+		/* position: absolute; */
+		box-shadow: 0 0 10px #ddd;
+		align-self: center;
+		transform: translate(0, -50%);
+		background-color: #fff;
+	}
+
+	.avatar-box img {
+		width: 100%;
+		height: 100%;
+		border-radius: 50%;
+	}
 
-.login-box {
-  width: 450px;
-  height: 250px;
-  background-color: #fff;
-  padding-top: 50px;
-  border-radius: 3px;
-  display: flex;
-  flex-direction: column;
-  position: absolute;
-  left: 50%;
-  top: 0;
-  bottom: 0;
-  margin: auto;
-}
-.avatar-box {
-  width: 130px;
-  height: 130px;
-  border: 1px solid #eee;
-  border-radius: 50%;
-  /* position: absolute; */
-  box-shadow: 0 0 10px #ddd;
-  align-self: center;
-  transform: translate(0, -50%);
-  background-color: #fff;
-}
-.avatar-box img {
-  width: 100%;
-  height: 100%;
-  border-radius: 50%;
-}
+	.login-form-box {
+		width: 410px;
+		height: 200px;
+		padding: 60px 20px 0;
+		justify-self: end;
+		transform: translate(0, -10%);
+	}
 
-.login-form-box {
-  width: 410px;
-  height: 200px;
-  padding: 60px 20px 0;
-  justify-self:end;
-  transform: translate(0,-10%);
-}
-.btns {
-  display: flex;
-  justify-content: flex-end;
-}
+	.btns {
+		display: flex;
+		justify-content: flex-end;
+	}
 </style>

+ 140 - 3
src/views/home/abonementList.vue

@@ -1,11 +1,148 @@
 <template>
-	<div>
-		userlist
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-col>
+				<div class="flex" style="justify-content: flex-end;padding-bottom: 20px;">
+					<!-- <el-button type="primary" @click="openBuy">购买Token</el-button> -->
+					<el-button type="primary" icon="el-icon-refresh-right" @click="getList('reload')" >刷新</el-button>
+				</div>
+			
+			</el-col>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%">
+				<el-table-column prop="id" label="id" width="180">
+				</el-table-column>
+				<el-table-column prop="avatar" label="头像" width="80">
+					<template slot-scope="scope">
+						<el-image
+						      style="width: 50px; height: 50px"
+						      :src="scope.row.avatar"></el-image>
+					</template>
+				</el-table-column>
+				<el-table-column prop="username" label="用户名称" width="250">
+				</el-table-column>
+				<el-table-column prop="email" label="邮箱">
+					<template slot-scope="scope">
+						{{scope.row.email?scope.row.email: ''}}
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="height: 20px;"></div>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="购买注册码" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<el-form-item label="购买数量" :label-width="formLabelWidth">
+					<el-input v-model="form.num" type="number"></el-input>
+				</el-form-item>
+				<el-form-item label="交易密码" :label-width="formLabelWidth">
+					<el-input v-model="form.transaction" type="password"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
 	</div>
 </template>
 
 <script>
+	import {
+		createCode,
+		getCodeList,
+		getUserList
+	} from '@/request/agent.js'
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				loading: false,
+				formLabelWidth: '80px',
+				form: {
+					num: '',
+					transaction: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+			}
+		},
+		created() {
+			this.getList()
+		},
+		methods: {
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				if (!that.form.num) {
+					return that.$msg.error('请输入购买数量')
+				}
+				if (!that.form.transaction) {
+					return that.$msg.error('请输入交易密码')
+				}
+				that.loading = true
+				createCode(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('购买成功')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (that.dataloading) {
+					return
+				}
+				if (type == 'reload') {
+					that.queryInfo = {
+						keyword: '',
+						page: 1,
+						limit: 10
+					}
+				}
+				that.dataloading = true
+				getUserList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
 </script>
 
-<style>
+<style scoped>
 </style>

+ 160 - 3
src/views/home/addressList.vue

@@ -1,11 +1,168 @@
 <template>
-	<div>
-		address
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-row>
+				<el-col>
+					<div class="flex" style="justify-content: flex-end;padding-bottom: 20px;">
+						<!-- <el-button type="primary" @click="openBuy">购买Token</el-button> -->
+						<el-button type="primary" icon="el-icon-refresh-right" @click="getList('reload')">刷新</el-button>
+					</div>
+
+				</el-col>
+
+
+				<!-- <el-col :span="8">
+					<el-input placeholder="请输入内容" v-model="queryInfo.query" class="input-with-select">
+						<el-button slot="append" icon="el-icon-search" @click="getList()"></el-button>
+					</el-input>
+				</el-col> -->
+			</el-row>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%" max-height="620">
+				<el-table-column prop="id" label="id" width="80">
+				</el-table-column>
+				<el-table-column prop="consignee_address" label="地址" width="350">
+				</el-table-column>
+				<el-table-column prop="consignee_phone" label="手机号" width="200">
+				</el-table-column>
+				<!-- <el-table-column prop="token" label="Token" width="350">
+				</el-table-column> -->
+				<!-- <el-table-column prop="status" label="是否已使用">
+					<template slot-scope="scope">
+						<el-tag type="success" v-if="scope.row.status == 0">待使用</el-tag>
+						<el-tag type="info" v-if="scope.row.status == 1">已使用</el-tag>
+					</template>
+				</el-table-column> -->
+				<el-table-column prop="createtime" label="创建时间" width="300">
+					<template slot-scope="scope">
+						{{showTime(scope.row.createtime)}}
+					</template>
+				</el-table-column>
+				<el-table-column prop="sys_address" label="是否系统默认" width="170">
+					<template slot-scope="scope">
+						<span :style="{'color': (scope.row.sys_address == 1 || scope.row.sys_phone == 1 )? '': '#67c23a'}">{{(scope.row.sys_address == 1 || scope.row.sys_phone == 1 )? '是': '否'}}</span>
+					</template>
+				</el-table-column>
+			</el-table>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, sizes, prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="购买Token" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<el-form-item label="购买数量" :label-width="formLabelWidth">
+					<el-input v-model="form.num" type="number"></el-input>
+				</el-form-item>
+				<el-form-item label="交易密码" :label-width="formLabelWidth">
+					<el-input v-model="form.transaction" type="password"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
 	</div>
 </template>
 
 <script>
+	import {
+		createCode,
+		getCodeList,
+		createToken,
+		getTokenList,
+		getAddressList
+	} from '@/request/agent.js'
+	import { showTime } from '@/assets/js/tools.js'
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				loading: false,
+				formLabelWidth: '80px',
+				form: {
+					num: '',
+					transaction: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+			}
+		},
+		created() {
+			this.getList()
+		},
+		methods: {
+			showTime,
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				if (!that.form.num) {
+					return that.$msg.error('请输入购买数量')
+				}
+				if (!that.form.transaction) {
+					return that.$msg.error('请输入交易密码')
+				}
+				that.loading = true
+				createToken(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('购买成功')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (that.dataloading) {
+					return
+				}
+				if (type == 'reload') {
+					that.queryInfo = {
+						keyword: '',
+						page: 1,
+						limit: 10
+					}
+				}
+				that.dataloading = true
+				getAddressList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
 </script>
 
-<style>
+<style scoped>
 </style>

+ 196 - 0
src/views/home/money.vue

@@ -0,0 +1,196 @@
+<template>
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-col>
+				<div class="flex" style="justify-content: flex-end;padding-bottom: 20px;">
+					<!-- <el-button type="primary" @click="openBuy">充值</el-button> -->
+					<el-button type="primary" icon="el-icon-refresh-right" @click="getList('reload')" >刷新</el-button>
+				</div>
+			
+			</el-col>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%">
+				<el-table-column prop="id" label="id" width="180">
+				</el-table-column>
+				<el-table-column prop="money" label="金额(元)" width="250"></el-table-column>
+				<el-table-column prop="after" label="变更后金额(元)" width="250"></el-table-column>
+				<el-table-column prop="memo" label="备注" width="250"></el-table-column>
+				<el-table-column prop="status" label="创建时间" width="250">
+					<template slot-scope="scope">
+						{{showTime(scope.row.createtime) }}
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="height: 20px;"></div>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="充值" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<el-form-item label="充值金额" :label-width="formLabelWidth">
+					<el-input v-model="form.recharge_num" type="number"></el-input>
+				</el-form-item>
+				<el-form-item label="充值凭证" :label-width="formLabelWidth">
+					<el-upload
+					  class="avatar-uploader"
+					  action="http://fh.frp.liuniu946.com/api/common/upload"
+					  :show-file-list="false"
+					  :headers="headers"
+					  :on-success="handleAvatarSuccess"
+					  :before-upload="beforeAvatarUpload">
+					  <img v-if="form.image" :src="form.image" class="avatar">
+					  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+					</el-upload>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import {
+		createCode,
+		getCodeList,
+		getUserList
+	} from '@/request/agent.js'
+	import { getMoneyList,rechange } from '@/request/user.js'
+	import { showTime } from '@/assets/js/tools.js'
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				loading: false,
+				formLabelWidth: '80px',
+				form: {
+					recharge_num: '',
+					image: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+				headers: {}
+			}
+		},
+		created() {
+			this.getList()
+			this.headers['token'] = window.sessionStorage.getItem('token')
+		},
+		methods: {
+			showTime,
+			handleAvatarSuccess(res, file) {
+				this.form.image = res.data.fullurl;
+				console.log(this.form.image,'this.form.avatar');
+			},
+			beforeAvatarUpload(file) {
+				// const isJPG = file.type === 'image/jpeg/png';
+				// const isLt2M = file.size / 1024 / 1024 < 2;
+			
+				// if (!isJPG) {
+				// 	this.$message.error('上传头像图片只能是 JPG 格式!');
+				// }
+				// if (!isLt2M) {
+				// 	this.$message.error('上传头像图片大小不能超过 2MB!');
+				// }
+				// return isJPG && isLt2M;
+				return true
+			},
+			handleAvatarError() {
+				
+			},
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				if (!that.form.recharge_num) {
+					return that.$msg.error('请输入充值金额')
+				}
+				if (!that.form.image) {
+					return that.$msg.error('请上传充值凭证')
+				}
+				that.loading = true
+				rechange(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('提交成功,请等待审核')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (type == 'reload') {
+					that.queryInfo.page = 1
+					that.dataloading = false
+				}
+				if (that.dataloading) {
+					return
+				}
+				
+				that.dataloading = true
+				getMoneyList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
+</script>
+
+<style scoped lang="scss">
+	.avatar-uploader .el-upload {
+		border: 1px dashed #d9d9d9;
+		border-radius: 6px;
+		cursor: pointer;
+		position: relative;
+		overflow: hidden;
+	}
+	
+	.avatar-uploader .el-upload:hover {
+		border-color: #409EFF;
+	}
+	
+	.avatar-uploader-icon {
+		font-size: 28px;
+		color: #8c939d;
+		width: 178px;
+		height: 178px;
+		line-height: 178px;
+		text-align: center;
+		border: 1px dashed #d9d9d9;
+		border-radius: 10px;
+	}
+</style>

+ 166 - 3
src/views/home/orderList.vue

@@ -1,11 +1,174 @@
 <template>
-	<div>
-		orderList
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-row>
+				<el-col>
+					<div class="flex" style="justify-content: flex-end;padding-bottom: 20px;">
+						<!-- <el-button type="primary" @click="openBuy">购买Token</el-button> -->
+						<el-button type="primary" icon="el-icon-refresh-right" @click="getList('reload')">刷新</el-button>
+					</div>
+
+				</el-col>
+
+
+				<!-- <el-col :span="8">
+					<el-input placeholder="请输入内容" v-model="queryInfo.query" class="input-with-select">
+						<el-button slot="append" icon="el-icon-search" @click="getList()"></el-button>
+					</el-input>
+				</el-col> -->
+			</el-row>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%" max-height="620">
+				<el-table-column prop="id" label="id" width="80">
+				</el-table-column>
+				<el-table-column prop="order_id" label="订单编号" width="200">
+				</el-table-column>
+				<el-table-column prop="sys_address" label="是否系统默认" width="170">
+					<template slot-scope="scope">
+						<span :style="{'color': (scope.row.sys_address == 1 || scope.row.sys_phone == 1 )? '': '#67c23a'}">{{(scope.row.sys_address == 1 || scope.row.sys_phone == 1 )? '是': '否'}}</span>
+					</template>
+				</el-table-column>
+				<el-table-column prop="consignee_phone" label="收货手机号" width="200">
+				</el-table-column>
+				<el-table-column prop="consignee_address" label="收货地址" width="350">
+				</el-table-column>
+				<el-table-column prop="pay_price" label="支付金额(元)" width="150">
+				</el-table-column>
+				
+				<!-- <el-table-column prop="token" label="Token" width="350">
+				</el-table-column> -->
+				<!-- <el-table-column prop="status" label="是否已使用">
+					<template slot-scope="scope">
+						<el-tag type="success" v-if="scope.row.status == 0">待使用</el-tag>
+						<el-tag type="info" v-if="scope.row.status == 1">已使用</el-tag>
+					</template>
+				</el-table-column> -->
+				<el-table-column prop="createtime" label="创建时间" width="300">
+					<template slot-scope="scope">
+						{{showTime(scope.row.createtime)}}
+					</template>
+				</el-table-column>
+				
+			</el-table>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, sizes, prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="购买Token" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<el-form-item label="购买数量" :label-width="formLabelWidth">
+					<el-input v-model="form.num" type="number"></el-input>
+				</el-form-item>
+				<el-form-item label="交易密码" :label-width="formLabelWidth">
+					<el-input v-model="form.transaction" type="password"></el-input>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
 	</div>
 </template>
 
 <script>
+	import {
+		createCode,
+		getCodeList,
+		createToken,
+		getTokenList,
+		getOrderList
+	} from '@/request/agent.js'
+	import { showTime } from '@/assets/js/tools.js'
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				loading: false,
+				formLabelWidth: '80px',
+				form: {
+					num: '',
+					transaction: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+			}
+		},
+		created() {
+			this.getList()
+		},
+		methods: {
+			showTime,
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				if (!that.form.num) {
+					return that.$msg.error('请输入购买数量')
+				}
+				if (!that.form.transaction) {
+					return that.$msg.error('请输入交易密码')
+				}
+				that.loading = true
+				createToken(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('购买成功')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (that.dataloading) {
+					return
+				}
+				if (type == 'reload') {
+					that.queryInfo = {
+						keyword: '',
+						page: 1,
+						limit: 10
+					}
+				}
+				that.dataloading = true
+				getOrderList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
 </script>
 
-<style>
+<style scoped>
 </style>

+ 243 - 3
src/views/home/rechangeList.vue

@@ -1,11 +1,251 @@
 <template>
-	<div>
-		rechangeList
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-col>
+				<div class="flex" style="justify-content: space-between;padding-bottom: 20px;">
+					<el-button type="primary" @click="openBuy">充值</el-button>
+					<el-button type="primary" icon="el-icon-refresh-right" @click="getList('reload')">刷新</el-button>
+				</div>
+
+			</el-col>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%">
+				<el-table-column prop="id" label="id" width="180">
+				</el-table-column>
+				<el-table-column prop="recharge_num" label="充值金额(U)" width="250"></el-table-column>
+				<el-table-column prop="image" label="充值凭证" width="150">
+					<template slot-scope="scope">
+						<el-image style="width: 100px; height:100px" :src="scope.row.image"></el-image>
+					</template>
+				</el-table-column>
+				<el-table-column prop="status" label="审核结果" width="150">
+					<template slot-scope="scope">
+						<el-tag type="success" v-if="scope.row.status == 1">已通过</el-tag>
+						<el-tag type="info" v-if="scope.row.status == 0">待审核</el-tag>
+					</template>
+				</el-table-column>
+				<el-table-column prop="status" label="创建时间">
+					<template slot-scope="scope">
+						{{showTime(scope.row.createtime) }}
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="height: 20px;"></div>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="充值" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<!-- payimg -->
+				<el-form-item label="充值二维码" :label-width="formLabelWidth">
+					<vueQrCode :size=qrCodeSize :text="qrCodeText"> </vueQrCode>
+				</el-form-item>
+				<el-form-item label="充值金额" :label-width="formLabelWidth">
+					<el-input v-model="form.recharge_num" type="number"></el-input>
+				</el-form-item>
+				<el-form-item label="充值凭证" :label-width="formLabelWidth">
+					<el-upload class="avatar-uploader" action="http://fh.frp.liuniu946.com/api/common/upload"
+						:show-file-list="false" :headers="headers" :on-success="handleAvatarSuccess"
+						:before-upload="beforeAvatarUpload">
+						<img v-if="form.image" :src="form.image" class="avatar">
+						<i v-else class="el-icon-plus avatar-uploader-icon"></i>
+					</el-upload>
+				</el-form-item>
+				
+			</el-form>
+			<div class="t-r">
+				到账: {{((form.recharge_num*1 || 0)*(baseInfo.to_rmb*1)).toFixed(2)}}元s
+			</div>
+			<div class="t-r">
+				当前余额: {{userInfo.money*1}}元
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
 	</div>
 </template>
 
 <script>
+	import vueQrCode from "@/components/vueQrCode.vue";
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		createCode,
+		getCodeList,
+		getUserList,
+		getIndex
+	} from '@/request/agent.js'
+	import {
+		getRechangeList,
+		rechange,
+		getUserInfo
+	} from '@/request/user.js'
+	import {
+		showTime
+	} from '@/assets/js/tools.js'
+	export default {
+		components: {
+			vueQrCode,
+		},
+		name: 'Order',
+		data() {
+			return {
+				qrCodeSize: 150,
+				qrCodeText: '',
+				loading: false,
+				formLabelWidth: '100px',
+				form: {
+					recharge_num: '',
+					image: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+				headers: {}
+			}
+		},
+		created() {
+			this.getList()
+			this.getUserInfo()
+			this.getIndex()
+			this.headers['token'] = window.sessionStorage.getItem('token')
+		},
+		computed: {
+			...mapState(['baseInfo', 'www','userInfo']),
+
+		},
+		methods: {
+			...mapMutations(['setBaseInfo', 'setUserInfo']),
+			showTime,
+			getIndex() {
+				getIndex().then(res => {
+					this.setBaseInfo(res.data)
+					this.qrCodeText = res.data.trc20
+				})
+			},
+			getUserInfo() {
+				getUserInfo().then(res => {
+					this.setUserInfo(res.data)
+				})
+			},
+			handleAvatarSuccess(res, file) {
+				this.form.image = res.data.fullurl;
+				console.log(this.form.image, 'this.form.avatar');
+			},
+			beforeAvatarUpload(file) {
+				// const isJPG = file.type === 'image/jpeg/png';
+				// const isLt2M = file.size / 1024 / 1024 < 2;
+
+				// if (!isJPG) {
+				// 	this.$message.error('上传头像图片只能是 JPG 格式!');
+				// }
+				// if (!isLt2M) {
+				// 	this.$message.error('上传头像图片大小不能超过 2MB!');
+				// }
+				// return isJPG && isLt2M;
+				return true
+			},
+			handleAvatarError() {
+
+			},
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				if (!that.form.recharge_num) {
+					return that.$msg.error('请输入充值金额')
+				}
+				if (!that.form.image) {
+					return that.$msg.error('请上传充值凭证')
+				}
+				that.loading = true
+				rechange(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('提交成功,请等待审核')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (type == 'reload') {
+					that.queryInfo.page = 1
+					that.dataloading = false
+				}
+				if (that.dataloading) {
+					return
+				}
+
+				that.dataloading = true
+				getRechangeList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
 </script>
 
-<style>
+<style scoped lang="scss">
+	.avatar-uploader .el-upload {
+		border: 1px dashed #d9d9d9;
+		border-radius: 6px;
+		cursor: pointer;
+		position: relative;
+		overflow: hidden;
+	}
+
+	.avatar-uploader .el-upload:hover {
+		border-color: #409EFF;
+	}
+
+	.avatar-uploader-icon {
+		font-size: 28px;
+		color: #8c939d;
+		width: 178px;
+		height: 178px;
+		line-height: 178px;
+		text-align: center;
+		border: 1px dashed #d9d9d9;
+		border-radius: 10px;
+	}
+	.t-r {
+		text-align: right;
+		padding-top: 10px;
+	}
 </style>

+ 191 - 91
src/views/home/regList.vue

@@ -1,98 +1,198 @@
 <template>
-  <div class="order-wrapper">
-    <!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
-    <el-card>
-      <!-- 搜索区域 -->
-      <el-row>
-        <el-col :span="8">
-          <el-input
-            placeholder="请输入内容"
-            v-model="queryInfo.query"
-            class="input-with-select"
-          >
-            <el-button
-              slot="append"
-              icon="el-icon-search"
-              @click="getList()"
-            ></el-button>
-          </el-input>
-        </el-col>
-      </el-row>
-      <!-- 订单表格区域 -->
-      <el-table
-          :data="list"
-          border
-          style="width: 100%">
-          <el-table-column
-            prop="date"
-            label="日期"
-            width="180">
-          </el-table-column>
-          <el-table-column
-            prop="name"
-            label="姓名"
-            width="180">
-          </el-table-column>
-          <el-table-column
-            prop="address"
-            label="地址">
-          </el-table-column>
-        </el-table>
-      <!-- 分页区域 -->
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="queryInfo.page"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="queryInfo.pagesize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total"
-      >
-      </el-pagination>
-    </el-card>
-    <!-- 修改地址对话框 -->
-  </div>
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-col>
+				<div class="flex" style="justify-content: space-between;padding-bottom: 20px;">
+					<el-button type="primary" @click="openBuy">购买注册码</el-button>
+					<el-button type="primary" icon="el-icon-refresh-right" @click="reload">刷新</el-button>
+				</div>
+			</el-col>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%" max-height="620">
+				<el-table-column prop="id" label="id" width="180">
+				</el-table-column>
+				<el-table-column prop="code" label="注册码" width="180">
+				</el-table-column>
+				<el-table-column prop="status" label="是否已使用">
+
+					<template slot-scope="scope">
+						<el-tag type="success" v-if="scope.row.status == 0">待使用</el-tag>
+						<el-tag type="info" v-if="scope.row.status == 1">已使用</el-tag>
+					</template>
+
+				</el-table-column>
+				<el-table-column prop="reg_user_id" label="注册用户ID">
+					<template slot-scope="scope">
+						{{scope.row.reg_user_id ? scope.row.reg_user_id: ''}}
+					</template>
+				</el-table-column>
+				<el-table-column prop="createtime" label="创建时间">
+					<template slot-scope="scope">
+						{{showTime(scope.row.createtime)}}
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="height: 20px;"></div>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, sizes,prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="购买注册码" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<el-form-item label="购买数量" :label-width="formLabelWidth">
+					<el-input v-model="form.num" type="number"></el-input>
+				</el-form-item>
+				<el-form-item label="交易密码" :label-width="formLabelWidth">
+					<el-input v-model="form.transaction" type="password"></el-input>
+				</el-form-item>
+			</el-form>
+			<div class="t-r">
+				合计: {{hj}}元
+			</div >
+			<div class="t-r">
+				当前余额: {{userInfo.money*1}}元
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
+	</div>
 </template>
 
 <script>
-export default {
-  name: 'Order',
-  data() {
-    return {
-      queryInfo: {
-      keyword: '',
-	  page: 1,
-	  limit: 10
-      },
-      list: [],
-      total: 0,
-	  loading: false,
-    }
-  },
-  created() {
-   
-  },
-  methods: {
-   getList() {
-	   let that = this
-	   if(that.loading) {
-		   return
-	   }
-	   that.loading = true
-	   
-   },
-  handleSizeChange(newPageSize) {
-    this.queryInfo.limit = newPageSize
-    this.getList()
-  },
-  handleCurrentChange(newPageNum) {
-    this.queryInfo.page = newPageNum
-    this.getList()
-  },
-  },
-  
-}
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		showTime
+	} from '@/assets/js/tools.js'
+	import {
+		createCode,
+		getCodeList,
+		getIndex,
+		
+	} from '@/request/agent.js'
+	import { getUserInfo } from '@/request/user.js'
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				loading: false,
+				formLabelWidth: '80px',
+				form: {
+					num: '',
+					transaction: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+			}
+		},
+		created() {
+			this.getList()
+			this.getIndex()
+			this.getUserInfo()
+		},
+		computed: {
+			...mapState(['userInfo', 'baseInfo']),
+			hj() {
+				return this.baseInfo.code_price * 1 * this.form.num
+			}
+		},
+		methods: {
+			...mapMutations(['setUserInfo', 'setBaseInfo']),
+			showTime,
+			reload() {
+				this.getList('reload')
+				this.getUserInfo()
+			},
+			getIndex() {
+				getIndex().then(res => {
+					this.setBaseInfo(res.data)
+				})
+			},
+			getUserInfo() {
+				getUserInfo().then(res => {
+					this.setUserInfo(res.data)
+				})
+			},
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				if (!that.form.num) {
+					return that.$msg.error('请输入购买数量')
+				}
+				if (!that.form.transaction) {
+					return that.$msg.error('请输入交易密码')
+				}
+				if(that.hj *1 > that.userInfo.money *1 ) {
+					return that.$msg.error('您当前的账号余额不足')
+				}
+				that.loading = true
+				createCode(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('购买成功')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (type == 'reload') {
+					that.queryInfo.page = 1
+					that.dataloading = false
+					
+				}
+				if (that.dataloading) {
+					return
+				}
+				
+				that.dataloading = true
+				getCodeList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+	.t-r {
+		text-align: right;
+		padding-top: 10px;
+	}
 </style>

+ 99 - 0
src/views/home/setPas.vue

@@ -0,0 +1,99 @@
+<template>
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card >
+			<div class="wrap">
+				<el-form :model="form" style="width: 500px;">
+					<el-form-item label="新交易密码" :label-width="formLabelWidth">
+						<el-input v-model="form.newpassword" type="password"  maxlength="30" minlength="6" placeholder="请输入新交易密码(6~30位任意字符)" width="300px"></el-input>
+					</el-form-item>
+					<el-form-item label="旧交易密码" :label-width="formLabelWidth">
+						<el-input v-model="form.oldpassword" type="password" maxlength="30" minlength="6" placeholder="请输入旧交易密码(如无则不需要填写)"></el-input>
+					</el-form-item>
+				</el-form>
+				<div class="dialog-footer">
+				    <el-button @click="dialogTableVisible = false">取 消</el-button>
+				    <el-button type="primary" @click="goBuy">确 定</el-button>
+				  </div>
+			</div>
+			
+			
+		</el-card>
+	</div>
+</template>
+
+<script>
+	import { setTransaction } from '@/request/agent.js'
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				formLabelWidth: '120px',
+				form: {
+					newpassword: '',
+					oldpassword: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				loading: false,
+			}
+		},
+		created() {
+
+		},
+		methods: {
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if(!that.form.newpassword) {
+					return that.$msg.error('请输入新交易密码')
+				}
+				// if(!that.transaction) {
+				// 	return that.$msg.error('请输入交易密码')
+				// }
+				setTransaction(that.form).then(res => {
+					console.log(res);
+					return that.$msg.success('交易密码设置成功')
+				})
+			},
+			getList() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				that.loading = true
+
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
+</script>
+
+<style scoped>
+	.dialog-footer {
+		display: flex;
+		justify-content: flex-end;
+		width: 500px;
+	}
+	/deep/ .el-card__body {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+</style>

+ 191 - 0
src/views/home/setUserinfo.vue

@@ -0,0 +1,191 @@
+<template>
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<div class="wrap">
+				<el-form :model="form" style="width: 500px;">
+					
+					<el-form-item label="头像" :label-width="formLabelWidth">
+						<el-upload
+						  class="avatar-uploader"
+						  action="http://fh.frp.liuniu946.com/api/common/upload"
+						  :show-file-list="false"
+						  :headers="token"
+						  :on-success="handleAvatarSuccess"
+						  :before-upload="beforeAvatarUpload">
+						  <img v-if="form.avatar" :src="form.avatar" class="avatar">
+						  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+						</el-upload>
+					</el-form-item>
+					<el-form-item label="ID" :label-width="formLabelWidth">
+						<el-input v-model="form.id" type="text" disabled
+							 width="300px"></el-input>
+					</el-form-item>
+					<el-form-item label="账号" :label-width="formLabelWidth">
+						<el-input v-model="form.username" type="text" disabled
+							 width="300px"></el-input>
+					</el-form-item>
+					<el-form-item label="昵称" :label-width="formLabelWidth">
+						<el-input v-model="form.nickname" type="text" 
+							placeholder="请输入昵称" width="300px"></el-input>
+					</el-form-item>
+				</el-form>
+				<div class="dialog-footer">
+					<!-- <el-button @click="dialogTableVisible = false">取 消</el-button> -->
+					<el-button type="primary" @click="setInfo">确 定</el-button>
+				</div>
+			</div>
+
+
+		</el-card>
+	</div>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		setTransaction,
+	} from '@/request/agent.js'
+	
+	import {
+		setUserInfo,
+		getUserInfo
+	} from '@/request/user.js'
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				token: {},
+				formLabelWidth: '120px',
+				form: {
+					avatar: '',
+					id: '',
+					nickname: '',
+					username: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					keyword: '',
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				loading: false,
+			}
+		},
+		computed: {
+			...mapState(['userInfo'])
+		},
+		created() {
+			this.token['token'] = window.sessionStorage.getItem('token')
+			this.form = {
+				avatar: this.userInfo.avatar,
+				id: this.userInfo.id,
+				nickname: this.userInfo.nickname,
+				username: this.userInfo.username
+			}
+			console.log(this.form,'this.form');
+			console.log(window.sessionStorage.getItem('token'));
+		},
+		methods: {
+			...mapMutations(['setUserInfo']),
+			handleAvatarSuccess(res, file) {
+				this.form.avatar = res.data.fullurl;
+				console.log(this.form.avatar,'this.form.avatar');
+			},
+			beforeAvatarUpload(file) {
+				// const isJPG = file.type === 'image/jpeg/png';
+				// const isLt2M = file.size / 1024 / 1024 < 2;
+
+				// if (!isJPG) {
+				// 	this.$message.error('上传头像图片只能是 JPG 格式!');
+				// }
+				// if (!isLt2M) {
+				// 	this.$message.error('上传头像图片大小不能超过 2MB!');
+				// }
+				// return isJPG && isLt2M;
+				return true
+			},
+			handleAvatarError() {
+				
+			},
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			setInfo() {
+				let that = this
+				if(that.form.avatar == '') {
+					return that.$msg.error('请选择头像')
+				}
+				if(that.form.nickname == '') {
+					return that.$msg.error('请选择输入昵称')
+				}
+				setUserInfo({
+					avatar: that.form.avatar,
+					nickname: that.form.nickname
+				}).then(res => {
+					that.$msg.success('修改成功')
+					getUserInfo().then(res => {
+						that.setUserInfo(res.data)
+					})
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
+</script>
+
+<style scoped>
+	.dialog-footer {
+		display: flex;
+		justify-content: flex-end;
+		width: 500px;
+	}
+
+	/deep/ .el-card__body {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.avatar-uploader .el-upload {
+		border: 1px dashed #d9d9d9;
+		border-radius: 6px;
+		cursor: pointer;
+		position: relative;
+		overflow: hidden;
+	}
+
+	.avatar-uploader .el-upload:hover {
+		border-color: #409EFF;
+	}
+
+	.avatar-uploader-icon {
+		font-size: 28px;
+		color: #8c939d;
+		width: 178px;
+		height: 178px;
+		line-height: 178px;
+		text-align: center;
+		border: 1px dashed #d9d9d9;
+		border-radius: 10px;
+	}
+
+	.avatar {
+		width: 178px;
+		height: 178px;
+		display: block;
+	}
+</style>

+ 329 - 1
src/views/home/takingList.vue

@@ -1,8 +1,336 @@
 <template>
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-col>
+				<div class="flex" style="justify-content: space-between;padding-bottom: 20px;">
+					<el-button type="primary" @click="openBuy">提现</el-button>
+					<el-button type="primary" icon="el-icon-refresh-right" @click="reload">刷新</el-button>
+				</div>
+				<div style="margin-bottom: 20px;">
+					<el-select v-model="value" placeholder="请选择支付方式" @change="optChange">
+						<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" >
+						</el-option>
+					</el-select>
+				</div>
+			</el-col>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%">
+				<el-table-column prop="id" label="id" width="180">
+				</el-table-column>
+				<el-table-column prop="type" label="提现方式" width="150">
+					<template slot-scope="scope">
+						<el-tag v-if="scope.row.type == 0" type="warning">银行卡</el-tag>
+						<el-tag v-if="scope.row.type == 1" type="success">微信</el-tag>
+						<el-tag v-if="scope.row.type == 2" >支付宝</el-tag>
+					</template>
+				</el-table-column>
+				<el-table-column prop="withdraw_num" label="提现金额(元)" width="150"></el-table-column>
+				<el-table-column prop="card_no" label="银行卡" width="250"></el-table-column>
+				<el-table-column prop="card_name" label="开户行" width="250"></el-table-column>
+				<el-table-column prop="image" label="收款码" width="150">
+					<template slot-scope="scope">
+						<el-image style="width: 100px; height:100px" :src="scope.row.qrimage" v-if="scope.row.qrimage"></el-image>
+					</template>
+				</el-table-column>
+				<el-table-column prop="status" label="审核结果" width="150">
+					<template slot-scope="scope">
+						<el-tag type="success" v-if="scope.row.status == 1">已通过</el-tag>
+						<el-tag type="info" v-if="scope.row.status == 0">待审核</el-tag>
+						<el-tag type="danger" v-if="scope.row.status == 2">未通过</el-tag>
+					</template>
+				</el-table-column>
+				<el-table-column prop="status" label="创建时间" width="200">
+					<template slot-scope="scope">
+						{{showTime(scope.row.createtime)}}
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="height: 20px;"></div>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="提现" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<!-- <el-form-item label="提现方式" :label-width="formLabelWidth">
+					<el-select v-model="form.type" placeholder="请选择支付方式" @change="optChanget">
+						<el-option v-for="item in takType" :key="item.value" :label="item.label" :value="item.value" >
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="姓名" :label-width="formLabelWidth">
+					<el-input v-model="form.name" type="text"></el-input>
+				</el-form-item>
+				<el-form-item label="提现金额" :label-width="formLabelWidth">
+					<el-input v-model="form.withdraw_num" type="number"></el-input>
+				</el-form-item>
+				<template v-if="form.type == 0">
+					<el-form-item label="银行卡号" :label-width="formLabelWidth">
+						<el-input v-model="form.card_no" type="text"></el-input>
+					</el-form-item>
+					<el-form-item label="开户行" :label-width="formLabelWidth">
+						<el-input v-model="form.card_name" type="text"></el-input>
+					</el-form-item>
+				</template>
+				<el-form-item label="收款码" :label-width="formLabelWidth" v-else>
+					<el-upload class="avatar-uploader" action="http://fh.frp.liuniu946.com/api/common/upload"
+						:show-file-list="false" :headers="headers" :on-success="handleAvatarSuccess"
+						:before-upload="beforeAvatarUpload">
+						<img v-if="form.qrimage" :src="form.qrimage" class="avatar">
+						<i v-else class="el-icon-plus avatar-uploader-icon"></i>
+					</el-upload>
+				</el-form-item> -->
+				<el-form-item label="提现地址" :label-width="formLabelWidth">
+					<el-input v-model="form.address" type="text"></el-input>
+				</el-form-item>
+				<el-form-item label="提现金额" :label-width="formLabelWidth">
+					<el-input v-model="form.withdraw_num" type="number"></el-input>
+				</el-form-item>
+			</el-form>
+			<div class="t-r">
+				到账: {{((form.withdraw_num*1 || 0)/(baseInfo.to_rmb*1)).toFixed(2)}}U
+			</div>
+			<div class="t-r">
+				当前余额: {{userInfo.money*1}}元
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
+	</div>
 </template>
 
 <script>
+	import {
+			mapState,
+			mapMutations
+		} from 'vuex';
+	import {
+		createCode,
+		getCodeList,
+		getUserList,
+		getIndex
+	} from '@/request/agent.js'
+	import {
+		getRechangeList,
+		rechange,
+		getTransferList,
+		transfer,
+		withdrawalList,
+		getUserInfo,
+		withdrawal
+	} from '@/request/user.js'
+	import {
+		showTime
+	} from '@/assets/js/tools.js'
+
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				loading: false,
+				formLabelWidth: '80px',
+				form: {
+					withdraw_num: '',
+					address: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					type: -1, //-1->全部 0->银行卡 1->微信 2->支付宝 
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+				headers: {},
+				takType: [{
+					value: 0,
+					label: '银行卡'
+				}, {
+					value: 1,
+					label: '微信'
+				}, {
+					value: 2,
+					label: '支付宝'
+				}],
+				takValue: 0,
+				options: [{
+					value: -1,
+					label: '全部'
+				}, {
+					value: 0,
+					label: '银行卡'
+				}, {
+					value: 1,
+					label: '微信'
+				}, {
+					value: 2,
+					label: '支付宝'
+				}],
+				value: -1,
+			}
+		},
+		computed: {
+			...mapState(['userInfo','baseInfo'])
+		},
+		created() {
+			this.getIndex()
+			this.getList()
+			this.getUserInfo()
+			this.headers['token'] = window.sessionStorage.getItem('token')
+		},
+		methods: {
+			...mapMutations(['setUserInfo','setBaseInfo']),
+			showTime,
+			getIndex() {
+				getIndex().then(res => {
+					this.setBaseInfo(res.data)
+				})
+			},
+			reload() {
+				this.getList('reload')
+				this.getUserInfo()
+			},
+			getUserInfo() {
+				getUserInfo().then(res => {
+					this.setUserInfo(res.data)
+				})
+			},
+			optChange(data) {
+				console.log(data);
+				this.getList('reload')
+			},
+			optChanget(data) {
+				that.form.type = data
+			},
+			handleAvatarSuccess(res, file) {
+				this.form.qrimage = res.data.fullurl;
+				console.log(this.form.image, 'this.form.avatar');
+			},
+			beforeAvatarUpload(file) {
+				// const isJPG = file.type === 'image/jpeg/png';
+				// const isLt2M = file.size / 1024 / 1024 < 2;
+
+				// if (!isJPG) {
+				// 	this.$message.error('上传头像图片只能是 JPG 格式!');
+				// }
+				// if (!isLt2M) {
+				// 	this.$message.error('上传头像图片大小不能超过 2MB!');
+				// }
+				// return isJPG && isLt2M;
+				return true
+			},
+			handleAvatarError() {
+
+			},
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				// if(that.form.name == '') {
+				// 	return that.$msg.error('请输入姓名')
+				// }
+				if(!that.form.withdraw_num) {
+					return that.$msg.error('请输入提现金额')
+				}
+				if(that.form.address == '') {
+					return that.$msg.error('请输入提现地址')
+				}
+				if(that.userInfo.money*1 < that.form.withdraw_num*1) {
+					return that.$msg.error('您当前账号的余额不足')
+				}
+				// if(that.form.type == 0) {
+				// 	if(that.form.card_name == '') {
+				// 		return that.$msg.error('请输入开户行')
+				// 	}
+				// 	if(that.form.card_no == '') {
+				// 		return that.$msg.error('请输入银行卡号')
+				// 	}
+				// }else {
+				// 	if(that.form.qrimage == '') {
+				// 		return that.$msg.error('请上传收款码')
+				// 	}
+				// }
+				that.loading = true
+				withdrawal(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('提交成功,请等待审核')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+					this.getUserInfo()
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (type == 'reload') {
+					that.queryInfo.page = 1
+					that.queryInfo.type = that.value
+					that.dataloading = false
+				}
+				if (that.dataloading) {
+					return
+				}
+				that.dataloading = true
+				withdrawalList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
 </script>
 
-<style>
+<style scoped lang="scss">
+	.avatar-uploader .el-upload {
+		border: 1px dashed #d9d9d9;
+		border-radius: 6px;
+		cursor: pointer;
+		position: relative;
+		overflow: hidden;
+	}
+
+	.avatar-uploader .el-upload:hover {
+		border-color: #409EFF;
+	}
+
+	.avatar-uploader-icon {
+		font-size: 28px;
+		color: #8c939d;
+		width: 178px;
+		height: 178px;
+		line-height: 178px;
+		text-align: center;
+		border: 1px dashed #d9d9d9;
+		border-radius: 10px;
+	}
+	.t-r {
+		text-align: right;
+		padding-top: 10px;
+	}
 </style>

+ 222 - 1
src/views/home/transferList.vue

@@ -1,8 +1,229 @@
 <template>
+	<div class="order-wrapper">
+		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
+		<el-card>
+			<!-- 搜索区域 -->
+			<el-col>
+				<div class="flex" style="justify-content: space-between;padding-bottom: 20px;">
+					<el-button type="primary" @click="openBuy">转账</el-button>
+					<el-button type="primary" icon="el-icon-refresh-right" @click="reload">刷新</el-button>
+				</div>
+			</el-col>
+			<!-- 订单表格区域 -->
+			<el-table :data="list" border style="width: 100%">
+				<el-table-column prop="id" label="id" width="180">
+				</el-table-column>
+				<el-table-column prop="transfer_num" label="转账金额(元)" width="250"></el-table-column>
+				<el-table-column prop="to_user_id" label="收款人ID" width="150">
+				</el-table-column>
+				<el-table-column prop="status" label="创建时间">
+					<template slot-scope="scope">
+						{{showTime(scope.row.createtime)}}
+					</template>
+				</el-table-column>
+				<el-table-column prop="balance" label="转账后用户余额">
+					<template slot-scope="scope">
+						{{userInfo.id == scope.row.to_user_id ? scope.row.balance: ''}}
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="height: 20px;"></div>
+			<!-- 分页区域 -->
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				layout="total, prev, pager, next, jumper" :total="total">
+			</el-pagination>
+		</el-card>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="转账" :visible.sync="dialogTableVisible">
+			<el-form :model="form">
+				<el-form-item label="收款用户ID" :label-width="formLabelWidth">
+					<el-input v-model="form.to_user_id" type="number"></el-input>
+				</el-form-item>
+				<el-form-item label="转账金额" :label-width="formLabelWidth">
+					<el-input v-model="form.transfer_num" type="number"></el-input>
+				</el-form-item>
+			</el-form>
+			<div class="t-r">
+				当前余额: {{userInfo.money*1}}元
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogTableVisible = false">取 消</el-button>
+				<el-button type="primary" @click="goBuy">确 定</el-button>
+			</div>
+		</el-dialog>
+	</div>
 </template>
 
 <script>
+	import {
+			mapState,
+			mapMutations
+		} from 'vuex';
+	import {
+		createCode,
+		getCodeList,
+		getUserList
+	} from '@/request/agent.js'
+	import {
+		getRechangeList,
+		rechange,
+		getTransferList,
+		transfer,
+		getUserInfo
+	} from '@/request/user.js'
+	import {
+		showTime
+	} from '@/assets/js/tools.js'
+
+	export default {
+		name: 'Order',
+		data() {
+			return {
+				loading: false,
+				formLabelWidth: '100px',
+				form: {
+					to_user_id: '',
+					transfer_num: ''
+				},
+				dialogTableVisible: false,
+				queryInfo: {
+					type: -1, //-1->全部 0->银行卡 1->微信 2->支付宝 
+					page: 1,
+					limit: 10
+				},
+				list: [],
+				total: 0,
+				dataloading: false,
+				headers: {},
+			}
+		},
+		computed: {
+			...mapState(['userInfo'])
+		},
+		created() {
+			this.getList()
+			this.headers['token'] = window.sessionStorage.getItem('token')
+		},
+		methods: {
+			...mapMutations(['setUserInfo']),
+			showTime,
+			reload() {
+				this.getList('reload')
+				this.getUserInfo()
+			},
+			getUserInfo() {
+				getUserInfo().then(res => {
+					this.setUserInfo(res.data)
+				})
+			},
+			handleAvatarSuccess(res, file) {
+				this.form.image = res.data.fullurl;
+				console.log(this.form.image, 'this.form.avatar');
+			},
+			beforeAvatarUpload(file) {
+				// const isJPG = file.type === 'image/jpeg/png';
+				// const isLt2M = file.size / 1024 / 1024 < 2;
+
+				// if (!isJPG) {
+				// 	this.$message.error('上传头像图片只能是 JPG 格式!');
+				// }
+				// if (!isLt2M) {
+				// 	this.$message.error('上传头像图片大小不能超过 2MB!');
+				// }
+				// return isJPG && isLt2M;
+				return true
+			},
+			handleAvatarError() {
+
+			},
+			openBuy() {
+				this.dialogTableVisible = true
+			},
+			goBuy() {
+				let that = this
+				if (that.loading) {
+					return
+				}
+				if (!that.form.to_user_id) {
+					return that.$msg.error('请输入收款人ID')
+				}
+				if (!that.form.transfer_num) {
+					return that.$msg.error('请输入转账金额')
+				}
+				if(that.userInfo.money < that.form.transfer_num*1) {
+					return that.$msg.error('您的余额不足本次转账')
+				}
+				that.loading = true
+				transfer(that.form).then(res => {
+					console.log(res);
+					that.$msg.success('转账成功')
+					that.dialogTableVisible = false
+					that.loading = false
+					that.getList('reload')
+					that.getUserInfo()
+				}).catch(err => {
+					that.loading = false
+				})
+			},
+			getList(type) {
+				let that = this
+				if (type == 'reload') {
+					that.dataloading = false
+					that.queryInfo.page = 1
+					that.dataloading = false
+				}
+				if (that.dataloading) {
+					return
+				}
+				
+				that.dataloading = true
+				getTransferList(that.queryInfo).then(res => {
+					that.total = res.data.count
+					that.list = res.data.data
+					that.dataloading = false
+				}).catch(err => {
+					that.dataloading = false
+				})
+			},
+			handleSizeChange(newPageSize) {
+				this.queryInfo.limit = newPageSize
+				this.getList()
+			},
+			handleCurrentChange(newPageNum) {
+				this.queryInfo.page = newPageNum
+				this.getList()
+			},
+		},
+
+	}
 </script>
 
-<style>
+<style scoped lang="scss">
+	.avatar-uploader .el-upload {
+		border: 1px dashed #d9d9d9;
+		border-radius: 6px;
+		cursor: pointer;
+		position: relative;
+		overflow: hidden;
+	}
+
+	.avatar-uploader .el-upload:hover {
+		border-color: #409EFF;
+	}
+
+	.avatar-uploader-icon {
+		font-size: 28px;
+		color: #8c939d;
+		width: 178px;
+		height: 178px;
+		line-height: 178px;
+		text-align: center;
+		border: 1px dashed #d9d9d9;
+		border-radius: 10px;
+	}
+	.t-r {
+		text-align: right;
+		padding-top: 10px;
+	}
 </style>