Commit b868df71 authored by leiqingsong's avatar leiqingsong

修改公共路径

parent b122638b
...@@ -4,7 +4,7 @@ import { Toast } from "vant"; ...@@ -4,7 +4,7 @@ import { Toast } from "vant";
let loading = null; let loading = null;
const service = axios.create({ const service = axios.create({
baseURL: "http://8.131.244.76:8997", baseURL: "http://8.131.244.76:81/shop-mall",
timeout: 5000 timeout: 5000
}); });
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<div class="record-list"> <div class="record-list">
<base-refresh-scroll @downLoad="onDownLoad" @upRefresh="onUpRefresh"> <base-refresh-scroll @downLoad="onDownLoad" @upRefresh="onUpRefresh">
<div slot="content"> <div slot="content">
<div v-for="(item, index) in 20" :key="'record' + index"> <div v-for="(item, index) in recordList" :key="'record' + index">
<record-item /> <record-item :record-item="item" />
</div> </div>
</div> </div>
</base-refresh-scroll> </base-refresh-scroll>
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
</template> </template>
<script> <script>
import { getWithdrawalRecord } from "@/api/wallet";
import RecordItem from "./components/recordItem.vue"; import RecordItem from "./components/recordItem.vue";
import BaseRefreshScroll from "../../components/BaseRefreshScroll.vue"; import BaseRefreshScroll from "../../components/BaseRefreshScroll.vue";
export default { export default {
...@@ -40,12 +41,15 @@ export default { ...@@ -40,12 +41,15 @@ export default {
show: false, show: false,
options: [{ text: "2021年3月", value: 0 }], options: [{ text: "2021年3月", value: 0 }],
selected: "", selected: "",
currentDate: new Date() currentDate: new Date(),
recordList: []
}; };
}, },
mounted() { mounted() {
this.selected = `${this.currentDate.getFullYear()}${this.currentDate.getMonth() + this.selected = `${this.currentDate.getFullYear()}${this.currentDate.getMonth() +
1}月`; 1}月`;
const time = this.currentDate.toLocaleDateString().replaceAll("/", "-");
this.getRecordList(time);
}, },
methods: { methods: {
onUpRefresh() { onUpRefresh() {
...@@ -53,6 +57,8 @@ export default { ...@@ -53,6 +57,8 @@ export default {
}, },
onDownLoad() { onDownLoad() {
console.log("下拉加载"); console.log("下拉加载");
const time = this.currentDate.toLocaleDateString().replaceAll("/", "-");
this.getRecordList(time);
}, },
onPickerCancle() { onPickerCancle() {
this.show = false; this.show = false;
...@@ -60,6 +66,19 @@ export default { ...@@ -60,6 +66,19 @@ export default {
onPickerConfirm(val) { onPickerConfirm(val) {
this.selected = `${val.getFullYear()}${val.getMonth() + 1}月`; this.selected = `${val.getFullYear()}${val.getMonth() + 1}月`;
this.show = false; 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 @@ ...@@ -3,15 +3,50 @@
<img src="@/assets/images/消费.png" /> <img src="@/assets/images/消费.png" />
<div class="item" style="flex:2;margin-left:10px"> <div class="item" style="flex:2;margin-left:10px">
<span style="font-size:14px;color:#333333">提现</span> <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>
<div class="item" style="flex:1"> <div class="item" style="flex:1">
<span style="font-size:16px;font-weight:bold;#333333;">¥55</span> <span style="font-size:16px;font-weight:bold;#333333;"
<span :class="`status-process`" style="font-size:12px">银行处理中</span> >{{ recordItem.money }}</span
>
<span :class="`status-process`" style="font-size:12px">{{
recordItem.status | cashOutStatus
}}</span>
</div> </div>
</div> </div>
</template> </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> <style lang="scss" scoped>
.record-item { .record-item {
display: flex; display: flex;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
当月收益 当月收益
</p> </p>
<div style="position:absolute;top:178px;width:100%"> <div style="position:absolute;top:178px;width:100%">
<span class="month-income">1,285.35</span> <span class="month-income">{{ walletInfo.moneyIncome }}</span>
<img <img
src="@/assets/images/右箭头.png" src="@/assets/images/右箭头.png"
alt alt
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<img src="@/assets/images/待结算.png" alt /> <img src="@/assets/images/待结算.png" alt />
<p>累计收益</p> <p>累计收益</p>
<div> <div>
<span class="money">3525.35</span> <span class="money">{{ walletInfo.totalIncome }}</span>
<img <img
src="@/assets/images/右箭头.png" src="@/assets/images/右箭头.png"
alt alt
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<img src="@/assets/images/累计收入.png" alt /> <img src="@/assets/images/累计收入.png" alt />
<p>未提余额</p> <p>未提余额</p>
<div> <div>
<span class="money">325.36</span> <span class="money">{{ walletInfo.currentMoneyCan }}</span>
<img <img
src="@/assets/images/右箭头.png" src="@/assets/images/右箭头.png"
alt alt
...@@ -52,14 +52,42 @@ ...@@ -52,14 +52,42 @@
</template> </template>
<script> <script>
import { getMoneyPackage } from "@/api/wallet";
export default { export default {
name: "Wallet", name: "Wallet",
data() {
return {
walletInfo: {
currentMoneyCan: null, // 本月可提现
moneyIncome: null, // 本月收益
totalIncome: null // 累计收益
}
};
},
mounted() {
this.getWalletInfo();
},
methods: { methods: {
onToCashOut() { onToCashOut() {
this.$router.push("/cash-out"); this.$router.push("/cash-out");
}, },
onToRecord() { onToRecord() {
this.$router.push("/cash-out-record"); 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"; const name = "西田森App";
module.exports = { module.exports = {
publicPath: "/font", publicPath: "/front",
css: { css: {
loaderOptions: { loaderOptions: {
postcss: { 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