123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <view class="cardList">
- <uni-menubar title="名片夹" />
- <view>
- <tm-search v-model="params.keyword" placeholder="请输入名称或手机号" insert-color="blue" @confirm="searchCardList"
- color="white" :show-right="false" :round="20">
- </tm-search>
- </view>
- <view>
- <tm-translate animation-name="fadeUp">
- <view v-for="(item,index) in cardList" :key="index">
- <tm-sheet color="bg-gradient-blue-accent">
- <view class="cardRow">
- <view class="flexLeft">
- <tm-avatar size="120" titl :round="5" :src="item.picture">
- </tm-avatar>
- </view>
- <view class="flexRight">
- <view class="nameRow">
- <view class="name">{{item.name}}</view>
- <view @click="goCardDetail(item.id)">进入名片主页 <tm-icons color="gray"
- name="icon-angle-right" :size="20"></tm-icons>
- </view>
- </view>
- <view class="post">{{item.title}}</view>
- </view>
- </view>
- <view style="margin-top: 15px;">
- <view class="span">
- 公司:{{item.company}}
- </view>
- <view class="span">
- 微信号:{{item.wx}}
- </view>
- <view class="span">
- 手机号:{{item.mobile}}
- </view>
- </view>
- </tm-sheet>
- </view>
- </tm-translate>
- </view>
- <uni-tabBar />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- params: {
- page: 1,
- keyword: ""
- },
- cardList: []
- }
- },
- onLoad() {
- this.getCardList()
- },
- onReachBottom(e) {
- this.params.page++
- this.$tm.request.post('card/addressbook', this.params).then(res => {
- if (res.data.length > 0) {
- res.data.forEach(val => {
- this.cardList.push(val)
- })
- }
- })
- },
- methods: {
- searchCardList() {
- this.params.page = 1
- this.getCardList()
- },
- getCardList() {
- this.$tm.request.post('card/addressbook', this.params).then(res => {
- this.cardList = res.data
- })
- },
- goCardDetail(card_id) {
- uni.navigateTo({
- url: '/pages/cardList/cardDetail?card_id=' + card_id
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .cardRow {
- display: flex;
- flex-direction: row;
- // justify-content: center;
- // align-items: center;
- .flexLeft {
- margin-right: 15px;
- }
- .flexRight {
- flex: 1;
- .nameRow {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- font-size: 22rpx;
- // color: #9E9E9E;
- .name {
- // color: #000;
- font-size: 34rpx;
- // font-weight: bold;
- }
- }
- .post {
- font-size: 32rpx;
- // color: #9E9E9E;
- margin-top: 20rpx;
- }
- }
- }
- .span {
- // color: #2196F3;
- font-size: 28rpx;
- margin-top: 10rpx;
- }
- </style>
|