Sfoglia il codice sorgente

解决无法触发登陆的问题

JXDS18FUJT 2 anni fa
parent
commit
718b4179a1

+ 14 - 1
src/api/modules/wx.ts

@@ -34,13 +34,26 @@ const wx = {
         bankCode:number,
         encBankNo:string,
         encTrueName:string
-    }){
+    }):AxiosPromise<wx.response>{
         return request({
             url:"student/wx/extract/wxwithbankdrawal",
             method:'post',
             data
         })
 
+    },
+    //银行卡列表
+    studentWxBankList(params:{
+        pageNum:number,
+        pageSize:number
+    }):AxiosPromise<wx.wxBankList>{
+        return request({
+            url:"student/wx/bank/list",
+            method:'GET',
+            params
+
+        })
+
     }
 
     

+ 2 - 1
src/api/request.ts

@@ -7,9 +7,10 @@ const request = axios.create({
 });
 request.interceptors.request.use(config => {
 	const token = window.localStorage.getItem("token") || ""
-	if (config.headers.isToken === "0") {
+	if (config.headers.isToken === "0"||!token) {
 		config.headers["Authorization"] = ""
 	}
+
 	else {
 		config.headers["Authorization"] = "Bearer " + token;
 

+ 16 - 2
src/api/types/wx.d.ts

@@ -4,7 +4,7 @@ declare namespace wx {
         code: number
     }
     interface wxExtractList extends response {
-        total:number
+        total: number
         rows: {
             "createTime": string,
             "updateTime": string,
@@ -13,7 +13,21 @@ declare namespace wx {
             "partnerTradeNo": string,
             "remark": null,
             "extractPrice": number,
-            "status": "1"|"2"
+            "status": "1" | "2"
+
+        }[]
+    }
+
+    interface wxBankList extends response {
+        total: number
+        rows: {
+            "createTime": string,
+            "updateTime": string,
+            "id": number,
+            "openid": string,
+            "encTrueName": string,
+            "bankCode": number,
+            "encBankNo": string
 
         }[]
     }

+ 10 - 0
src/store/index.ts

@@ -1,6 +1,7 @@
 import { state,State } from './state';
 import { createStore } from 'vuex';
 import createPersistedState from "vuex-persistedstate";
+import api from '@/api'
 export default createStore({
   plugins:[createPersistedState()],
   state,
@@ -13,6 +14,15 @@ export default createStore({
 
   },
   actions: {
+    getUserInfo(){
+      api.user.studentUserInfo().then(res=>{
+        this.commit('SET_USERINFO',res.data.data)
+      })
+     
+
+
+
+    }
 
   },
   modules: {},

+ 1 - 0
src/views/cashout/index.vue

@@ -40,6 +40,7 @@
 
 					</van-field>
 					<van-field type="digit" v-model="encBankNo" label="银行卡号" placeholder="请输入银行卡号" />
+					<van-field is-link url="/cashoutBankList" readonly v-model="encBankNo" label="银行卡列表"  />
 				</van-cell-group>
 			</van-dialog>
 

+ 56 - 0
src/views/cashoutBankList/index.vue

@@ -0,0 +1,56 @@
+<template>
+    <div class="bg">
+        <m-nav-bar mode="black" background="white" title="已提现的银行卡"></m-nav-bar>
+        <div class="card">
+            <div class="item" v-for="(item, index) in bankCardList" :key="index">
+                <div>
+
+                </div>
+
+            </div>
+
+
+        </div>
+    </div>
+</template>
+
+<script lang="ts">
+import api from '@/api'
+import { ref } from 'vue'
+
+export default {
+    setup() {
+        const bankCardList = ref<any>([])
+        api.wx.studentWxBankList({
+            pageNum: 1,
+            pageSize: 1000
+        }).then(res => {
+            bankCardList.value = res.data.rows
+
+
+
+        })
+
+        return {
+            bankCardList
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.bg{
+    background: #fff;
+    min-height:100vh ;
+}
+.card {
+    display: flex;
+    padding: 0 30px;
+
+    .item {
+        width: 100%;
+        height: 67px;
+        border-bottom: 1px solid #E8E8E8;
+    }
+}
+</style>

+ 28 - 24
src/views/home/index.vue

@@ -8,10 +8,10 @@
                 <img class="head" :src="userInfo.headImage" />
                 <div class="name">
                     <div>
-                        {{userInfo.nickName}}
+                        {{ userInfo.nickName }}
                     </div>
                     <div class="userId">
-                        ID:{{userInfo.id}}
+                        ID:{{ userInfo.id }}
                     </div>
                 </div>
                 <div>
@@ -28,23 +28,23 @@
         <div class="money">
             <div class="data">
                 <div class="today">
-                    <div class="number">¥{{todayIncome}}</div>
+                    <div class="number">¥{{ todayIncome }}</div>
                     <div class="desc">今日收益</div>
                 </div>
                 <div class="border"> </div>
                 <div class="today">
-                    <div class="number">¥{{yesterdayIncome}}</div>
+                    <div class="number">¥{{ yesterdayIncome }}</div>
                     <div class="desc">昨日收益</div>
                 </div>
                 <div class="border"> </div>
                 <div class="today">
-                    <div class="number">¥{{totalIncome}}</div>
+                    <div class="number">¥{{ totalIncome }}</div>
                     <div class="desc">累计收益</div>
                 </div>
 
             </div>
             <div class="button">
-                <span>可提现金额:¥{{userInfo.profitPrice}}</span>
+                <span>可提现金额:¥{{ userInfo.profitPrice }}</span>
                 <router-link to="/cashout">
                     <div class="now">
                         立即提现
@@ -72,7 +72,7 @@
 </template>
 
 <script lang="ts">
-import { computed, defineComponent, ref } from 'vue'
+import { computed, defineComponent, ref, onMounted } from 'vue'
 import people1Icon from '@/assets/img/people1.png'
 import configIcon from '@/assets/img/config.png'
 import messageIcon from '@/assets/img/message.png'
@@ -111,27 +111,31 @@ export default defineComponent({
             })
 
         }
-        api.user.studentUserInfo().then(res=>{
-            store.commit('SET_USERINFO',res.data.data)
-            window.localStorage.setItem("userInfo",JSON.stringify(res.data.data))
+        api.user.studentUserInfo().then(res => {
+            store.commit('SET_USERINFO', res.data.data)
+            window.localStorage.setItem("userInfo", JSON.stringify(res.data.data))
 
         })
-        //昨日收益
-        api.order.studentOrderInfoYesterdayTotal({
-        }).then(res => {
-            yesterdayIncome.value = res.data.data
-        })
-        //今日收益
-        api.order.studentOrderInfoTodayTotal({
-        }).then(res => {
-            todayIncome.value = res.data.data
-        })
-        //总收益
-        api.order.studentOrderInfoTotal({
-        }).then(res => {
-            todayIncome.value = res.data.data
+        onMounted(() => {
+            //昨日收益
+            api.order.studentOrderInfoYesterdayTotal({
+            }).then(res => {
+                yesterdayIncome.value = res.data.data
+            })
+            //今日收益
+            api.order.studentOrderInfoTodayTotal({
+            }).then(res => {
+                todayIncome.value = res.data.data
+            })
+            //总收益
+            api.order.studentOrderInfoTotal({
+            }).then(res => {
+                todayIncome.value = res.data.data
+            })
+
         })
 
+
         return {
             todayIncome,
             yesterdayIncome,