Commit 332e0430 authored by leiqingsong's avatar leiqingsong

Merge branch 'dev_lqs' into 'master'

修改公共路径

See merge request !12
parents aae0124a b868df71
......@@ -4,7 +4,7 @@ import { Toast } from "vant";
let loading = null;
const service = axios.create({
baseURL: "http://8.131.244.76:8997",
baseURL: "http://8.131.244.76:81/shop-mall",
timeout: 5000
});
......
......@@ -7,8 +7,8 @@
<div class="record-list">
<base-refresh-scroll @downLoad="onDownLoad" @upRefresh="onUpRefresh">
<div slot="content">
<div v-for="(item, index) in 20" :key="'record' + index">
<record-item />
<div v-for="(item, index) in recordList" :key="'record' + index">
<record-item :record-item="item" />
</div>
</div>
</base-refresh-scroll>
......@@ -27,6 +27,7 @@
</template>
<script>
import { getWithdrawalRecord } from "@/api/wallet";
import RecordItem from "./components/recordItem.vue";
import BaseRefreshScroll from "../../components/BaseRefreshScroll.vue";
export default {
......@@ -40,12 +41,15 @@ export default {
show: false,
options: [{ text: "2021年3月", value: 0 }],
selected: "",
currentDate: new Date()
currentDate: new Date(),
recordList: []
};
},
mounted() {
this.selected = `${this.currentDate.getFullYear()}${this.currentDate.getMonth() +
1}月`;
const time = this.currentDate.toLocaleDateString().replaceAll("/", "-");
this.getRecordList(time);
},
methods: {
onUpRefresh() {
......@@ -53,6 +57,8 @@ export default {
},
onDownLoad() {
console.log("下拉加载");
const time = this.currentDate.toLocaleDateString().replaceAll("/", "-");
this.getRecordList(time);
},
onPickerCancle() {
this.show = false;
......@@ -60,6 +66,19 @@ export default {
onPickerConfirm(val) {
this.selected = `${val.getFullYear()}${val.getMonth() + 1}月`;
this.show = false;
const time = val.toLocaleDateString().replaceAll("/", "-");
this.getRecordList(time);
},
getRecordList(yearMonth) {
const params = {
userId: "13100911369",
yearMonth: yearMonth
};
getWithdrawalRecord(params).then(res => {
if (res.code === 0) {
this.recordList = res.data;
}
});
}
}
};
......
......@@ -3,15 +3,50 @@
<img src="@/assets/images/消费.png" />
<div class="item" style="flex:2;margin-left:10px">
<span style="font-size:14px;color:#333333">提现</span>
<span style="font-size:12px;color:#999999">2021.1.14 10:02</span>
<span style="font-size:12px;color:#999999">{{
recordItem.moneyTime
}}</span>
</div>
<div class="item" style="flex:1">
<span style="font-size:16px;font-weight:bold;#333333;">¥55</span>
<span :class="`status-process`" style="font-size:12px">银行处理中</span>
<span style="font-size:16px;font-weight:bold;#333333;"
>{{ recordItem.money }}</span
>
<span :class="`status-process`" style="font-size:12px">{{
recordItem.status | cashOutStatus
}}</span>
</div>
</div>
</template>
<script>
export default {
name: "RecordItem",
props: {
recordItem: {
type: Object,
default: () => {}
}
},
filters: {
cashOutStatus(val) {
let statusStr = "";
switch (val) {
case 2:
statusStr = "银行处理中";
break;
case 3:
statusStr = "提现成功";
break;
default:
statusStr = "";
break;
}
return statusStr;
}
}
};
</script>
<style lang="scss" scoped>
.record-item {
display: flex;
......
......@@ -8,7 +8,7 @@
当月收益
</p>
<div style="position:absolute;top:178px;width:100%">
<span class="month-income">1,285.35</span>
<span class="month-income">{{ walletInfo.moneyIncome }}</span>
<img
src="@/assets/images/右箭头.png"
alt
......@@ -20,7 +20,7 @@
<img src="@/assets/images/待结算.png" alt />
<p>累计收益</p>
<div>
<span class="money">3525.35</span>
<span class="money">{{ walletInfo.totalIncome }}</span>
<img
src="@/assets/images/右箭头.png"
alt
......@@ -32,7 +32,7 @@
<img src="@/assets/images/累计收入.png" alt />
<p>未提余额</p>
<div>
<span class="money">325.36</span>
<span class="money">{{ walletInfo.currentMoneyCan }}</span>
<img
src="@/assets/images/右箭头.png"
alt
......@@ -52,14 +52,42 @@
</template>
<script>
import { getMoneyPackage } from "@/api/wallet";
export default {
name: "Wallet",
data() {
return {
walletInfo: {
currentMoneyCan: null, // 本月可提现
moneyIncome: null, // 本月收益
totalIncome: null // 累计收益
}
};
},
mounted() {
this.getWalletInfo();
},
methods: {
onToCashOut() {
this.$router.push("/cash-out");
},
onToRecord() {
this.$router.push("/cash-out-record");
},
// 获取用户钱包展示信息
getWalletInfo() {
const params = {
userId: "13100911369"
};
getMoneyPackage(params).then(res => {
if (res.code === 0) {
console.log("res", res);
this.walletInfo = res.data;
} else {
this.$toast.fail(res.message);
}
});
}
}
};
......
const name = "西田森App";
module.exports = {
publicPath: "/font",
publicPath: "/front",
css: {
loaderOptions: {
postcss: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment