shenzx před 4 měsíci
rodič
revize
d27bf0d187
3 změnil soubory, kde provedl 71 přidání a 46 odebrání
  1. 40 33
      src/api/svc/user/index.js
  2. 13 0
      src/store/modules/pay.js
  3. 18 13
      src/views/hd/wd/index.vue

+ 40 - 33
src/api/svc/user/index.js

@@ -1,44 +1,51 @@
 import request from '@/utils/request'
 
-// 查询用户信息列表
-export function listInfo(query) {
-    return request({
-        url: '/user/info/list',
-        method: 'get',
-        params: query
-    })
+// 查询用户信息-账单列表
+export function listZd(query) {
+  return request({
+    url: '/user/zd/list',
+    method: 'get',
+    params: query
+  })
 }
 
-// 查询用户信息详细
-export function getInfo(userId) {
-    return request({
-        url: '/user/info/' + userId,
-        method: 'get'
-    })
+// 查询用户信息-账单详细
+export function getZd(id) {
+  return request({
+    url: '/user/zd/' + id,
+    method: 'get'
+  })
 }
 
-// 新增用户信息
-export function addInfo(data) {
-    return request({
-        url: '/user/info',
-        method: 'post',
-        data: data
-    })
+// 新增用户信息-账单
+export function addZd(data) {
+  return request({
+    url: '/user/zd',
+    method: 'post',
+    data: data
+  })
 }
 
-// 修改用户信息
-export function updateInfo(data) {
-    return request({
-        url: '/user/info',
-        method: 'put',
-        data: data
-    })
+// 修改用户信息-账单
+export function updateZd(data) {
+  return request({
+    url: '/user/zd',
+    method: 'put',
+    data: data
+  })
 }
 
-// 删除用户信息
-export function delInfo(userId) {
-    return request({
-        url: '/user/info/' + userId,
-        method: 'delete'
-    })
+// 删除用户信息-账单
+export function delZd(id) {
+  return request({
+    url: '/user/zd/' + id,
+    method: 'delete'
+  })
+}
+
+export function getBalance() {
+  return request({
+    url: '/user/zd/balance',
+    method: 'get'
+  })
 }

+ 13 - 0
src/store/modules/pay.js

@@ -0,0 +1,13 @@
+const payStore = defineStore(
+    "pay",
+    {
+        state: () => ({
+            isShow: false
+        }),
+        actions: {
+            getShow(){
+                return this.isShow;
+            }
+        }
+    }
+)

+ 18 - 13
src/views/hd/wd/index.vue

@@ -7,34 +7,30 @@
                 </div>
                 <div>
                     <div>{{ user.nickName }}</div>
-                    <div>余额:¥{{ form.money }}</div>
+                    <div>余额:¥{{ balance }}</div>
                 </div>
             </div>
+            <div class="info_1"><span>充值</span><span>></span></div>
         </div>
     </div>
 </template>
 
 <script setup>
 import { getUserProfile } from '@/api/system/user.js'
-import { getInfo } from '@/api/svc/user'
+import { getBalance } from '@/api/svc/user'
 import { onMounted } from 'vue';
 
 const user = ref({})
-const form = ref({})
 
-async function init() {
-    await getUserProfile().then(res => {
-        console.log(res);
+const balance = ref(0)
+
+onMounted(() => {
+    getUserProfile().then(res=>{
         user.value = res.data
     })
-    await getInfo(user.value.userId).then(res => {
-        console.log(res);
-        form.value = res.data
+    getBalance().then(res=>{
+        balance.value = res.data
     })
-}
-
-onMounted(() => {
-    init()
 })
 </script>
 
@@ -65,4 +61,13 @@ onMounted(() => {
     justify-content: center;
     align-items: center;
 }
+
+.info_1{
+    background-color: #FFF;
+    margin-top: 10px;
+    padding: 5px;
+    border-radius: 5px;
+    display: flex;
+    justify-content: space-between;
+}
 </style>