123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <template>
- <view class="pages">
- <mescroll-body class="wrap" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
- <view class="focusme">
- <view v-for="(item,index) in focusmelist" :key="index" class="focusme-item">
- <view class="focusme-item-photo">
- <image class="focusme-item-photo-img" :src="item.headimgurl" mode=""></image>
- </view>
- <view class="focusme-item-text">
- <view class="focusme-item-name">{{item.memberNickname}} <text class="type">{{item.type}}</text></view>
- <view class="focusme-item-addr">{{item.addr}}</view>
- <view class="focusme-item-care">关心:{{item.productName}}</view>
- {{careitem}}
- </view>
- <view class="focusme-item-call" @click="callnumber(item.phonenumber)">
- <svg class="icon focusme-item-call-icon" aria-hidden="true">
- <use xlink:href="#icondianhua"></use>
- </svg>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
-
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
-
- import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
- export default {
- mixins: [MescrollMixin],
- components: {
- MescrollBody,
- },
- data() {
- return {
- mescroll: null,
-
- downOption: {
-
- },
-
- upOption: {
- page: {
- size: 10
- },
- noMoreSize: 5,
- empty: {
- tip: '暂无相关数据'
- }
- },
- params:{
- tokenhead:'',
- token:'',
- },
- focusmelist:[
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ],
-
- }
- },
- onShow() {
- let serf = this;
-
-
-
-
- },
- onLoad() {
- let self = this;
- uni.getStorage({
- key:'token',
- success: function (res) {
- self.params.token = res.data;
-
- }
- });
- uni.getStorage({
- key:'tokenhead',
- success: function (res) {
- self.params.tokenhead = res.data;
-
- }
- });
- },
- methods: {
-
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
-
- downCallback(){
-
-
- this.mescroll.resetUpScroll();
- },
-
- upCallback(page) {
- let pageNum = page.num;
- let pageSize = page.size;
- this.params = Object.assign(this.params,{pageNum:pageNum,pageSize:pageSize});
- let thetoken = this.params.tokenhead + this.params.token;
- console.log('thetoken',thetoken);
- this.$api.http.get(this.config.apiBaseurl+'/pre/own',{params:this.params,header: {Authorization:thetoken}}).then(data => {
- console.log('1111111111',data);
- if(data.data.code=='1001'){
-
-
-
- };
- console.log(data);
-
- let curPageData = data.data.data.list;
-
-
- let curPageLen = curPageData.length;
-
-
-
- let totalSize = data.data.data.total;
-
-
-
-
-
- if(page.num == 1) this.focusmelist = [];
- this.focusmelist = this.focusmelist.concat(curPageData);
-
- console.log('this.focusmelist',JSON.parse(JSON.stringify(this.focusmelist)));
-
-
- this.mescroll.endBySize(curPageLen, totalSize);
-
-
-
-
-
- }).catch(err => {
- this.mescroll.endErr()
- console.log(err)
-
- });
-
- },
-
- callnumber(number){
- if(!number){
- uni.showToast({
- title: "没有该用户号码!",
- icon:'none'
- })
- return false;
- }
- uni.makePhoneCall({
- phoneNumber: number
- });
- },
-
- }
- }
- </script>
- <style scoped>
- .focusme-item{display: flex;position: relative;align-items: center;background-color: #fff;padding: 24rpx 24rpx 17rpx 24rpx;margin-bottom: 8rpx;}
- .focusme-item::after{content: '';width: calc( 100% - 24rpx );height: 1px;background-color: #eee;position: absolute;right: 0;bottom: 0;}
- .focusme-item-photo{width: 90rpx;height: 90rpx;overflow: hidden;border-radius: 50%;margin-right: 30rpx;}
- .focusme-item-photo-img{width: 100%;height: 100%;}
- .focusme-item-text{flex: 1;}
- .focusme-item-name{margin-bottom: 4rpx;font-size: 34rpx;font-weight: 500;color: #333;line-height: 48rpx;}
- .focusme-item-name .type{margin-left: 24rpx;font-size: 24rpx;font-weight: 400;color: #6BBC6D;line-height: 33rpx;}
- .focusme-item-care,
- .focusme-item-addr{font-size: 28rpx;font-weight: 400;color: #666;line-height: 40rpx;}
- .focusme-item-call-icon{width: 58rpx;height: 58rpx;}
- </style>
|