myShare.vue 1.32 KB
<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>