myShare.vue
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
<view>
<view class="item" v-for="(n,index) in list" :key="index">
<view>来源:{{n.courseName||n.goodsName||n.activityName}}</view>
<view>
<!-- <text class="text-warning">{{n.userName}}</text> -->
分享给
<text class="text-warning">{{n.shareName}}</text>
</view>
<view class="flex-r">
积分:<text class="text-warning">+{{n.shareScore}}</text>
金币:<text class="text-warning">+{{n.shareGold}}</text>
</view>
</view>
<view class="nodata" v-if="list.length==0">
<image mode="aspectFit" src="/static/nodata.png"/>
</view>
</view>
</template>
<script setup>
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import config from '@/config.js';
import {
ref,
getCurrentInstance
} from 'vue';
import * as api from '@/common/api.js';
const list = ref([])
onShow(() => {
init()
})
function init() {
getList()
}
function getList(){
api.getShareList().then(res=>{
list.value = res.rows
})
}
</script>
<style scoped lang="scss">
.item{width: 700rpx;margin:30rpx auto 0;float: none;
background: #FFFFFF;box-sizing: border-box;
border-radius: 20rpx;padding: 30rpx;
view{font-size: 25rpx;color: #999;
text{color: #333;}
}
.flex-r{ display: flex;justify-content: flex-end;align-items: baseline;
text{margin-right: 20rpx;font-size: 34rpx;}
}
}
</style>