|
@@ -0,0 +1,146 @@
|
|
|
+<template>
|
|
|
+ <mobile-frame>
|
|
|
+ <view class="main">
|
|
|
+ <view class="info">
|
|
|
+ <view class="one">
|
|
|
+ <view class="left">返现金额</view>
|
|
|
+ <view class="right">{{info.money}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="two">
|
|
|
+ <view class="left">状态</view>
|
|
|
+ <view class="right">{{info.zhStatus}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="two">
|
|
|
+ <view class="left">返现时间</view>
|
|
|
+ <view class="right">{{info.time}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="two">
|
|
|
+ <view class="left">推荐人</view>
|
|
|
+ <view class="right">{{info.inviter_name}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="two">
|
|
|
+ <view class="left">来源</view>
|
|
|
+ <view class="right">{{info.zhSource}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </mobile-frame>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ id: '',
|
|
|
+ user: {},
|
|
|
+ info: {},
|
|
|
+ // 状态
|
|
|
+ statusList: [],
|
|
|
+ // 来源
|
|
|
+ sourceList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad: async function(e) {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `id`, e.id || '');
|
|
|
+ await that.searchOther();
|
|
|
+ await that.watchLogin();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 查询其他信息
|
|
|
+ async searchOther() {
|
|
|
+ const that = this;
|
|
|
+ let res;
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
+ code: "cashBack_status"
|
|
|
+ });
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, `statusList`, res.data)
|
|
|
+ }
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
+ code: "cashBack_source"
|
|
|
+ });
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, `sourceList`, res.data)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 监听用户是否登录
|
|
|
+ watchLogin() {
|
|
|
+ const that = this;
|
|
|
+ uni.getStorage({
|
|
|
+ key: 'token',
|
|
|
+ success: async function(res) {
|
|
|
+ let user = that.$jwt(res.data);
|
|
|
+ if (user) {
|
|
|
+ that.$set(that, `user`, user);
|
|
|
+ if (that.id) {
|
|
|
+ let arr = await that.$api(`/cashBack/${that.id}`, 'GET')
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ let status = that.statusList.find(i => i.value == arr.data.status)
|
|
|
+ if (status) arr.data.zhStatus = status.label;
|
|
|
+ let source = that.sourceList.find(i => i.value == arr.data.source)
|
|
|
+ if (source) arr.data.zhSource = source.label;
|
|
|
+ // 查询推荐人信息
|
|
|
+ let res = await that.$api(`/user/${arr.data.inviter}`, 'GET');
|
|
|
+ if (res.errcode == '0') arr.data.inviter_name = res.data.name
|
|
|
+ that.$set(that, `info`, arr.data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/login/index`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .main {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+
|
|
|
+ .info {
|
|
|
+ padding: 2vw;
|
|
|
+
|
|
|
+ .one {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 10vw 2vw;
|
|
|
+ border-bottom: 0.5vw solid var(--f1Color);
|
|
|
+
|
|
|
+ .left {
|
|
|
+ color: #696969;
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ font-size: var(--font16Size);
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .two {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 2vw;
|
|
|
+
|
|
|
+ .left {
|
|
|
+ color: #696969;
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ color: #A9A9A9;
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|