Merge pull request 'xbx' (#156) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/156
This commit is contained in:
luyuan 2020-08-11 18:28:08 +08:00
commit 91ca2fdd19
8 changed files with 53 additions and 12 deletions

View File

@ -304,8 +304,8 @@ export default {
return vm.$u.post('Message/informationList', { }); return vm.$u.post('Message/informationList', { });
}, },
// 关注列表 // 关注列表
snsfriendList({ }) { snsfriendList({page}) {
return vm.$u.post('message/snsfriendList', { }); return vm.$u.post('message/snsfriendList', {page});
}, },
// 关注达人 // 关注达人
attentionMember({ member_id }) { attentionMember({ member_id }) {

View File

@ -46,7 +46,10 @@
} }
</script> </script>
<style scoped lang="scss"> <style lang="scss">
page{
background-color: rgba(0,0,0,0);
}
.u-coupon-popup { .u-coupon-popup {
/deep/ .u-mode-center-box { /deep/ .u-mode-center-box {
background-color: transparent; background-color: transparent;

View File

@ -76,7 +76,7 @@ export default {
}, },
searchValue() { searchValue() {
uni.navigateTo({ uni.navigateTo({
url: '/pageB/search/index?type=2' url: '/pageB/search/index?type=2&curent=1'
}) })
}, },
}, },

View File

@ -21,6 +21,7 @@ export default {
// type: 1 2: // type: 1 2:
onLoad(option) { onLoad(option) {
this.type = option.type; this.type = option.type;
this.curent = option.curent || 0
this.getWordList(); this.getWordList();
if(option.type == 1) this.setNavSearchInput('搜索您需要的商品'); if(option.type == 1) this.setNavSearchInput('搜索您需要的商品');
else if(option.type == 2) this.setNavSearchInput('请输入搜索内容'); else if(option.type == 2) this.setNavSearchInput('请输入搜索内容');
@ -65,7 +66,8 @@ export default {
} }
let params = { let params = {
value: value, value: value,
type: this.type, type: this.type,
curent:this.curent
} }
if(this.type == 2) { if(this.type == 2) {
this.$u.route({ this.$u.route({

View File

@ -78,9 +78,11 @@ export default {
}, },
onLoad(option) { onLoad(option) {
this.value = option.value; this.value = option.value;
this.current = option.curent
this.setViewHeight(); this.setViewHeight();
this.ShopSearch() this.ShopSearch()
this.setNavSearchInput(this.value); this.setNavSearchInput(this.value);
}, },
onNavigationBarSearchInputConfirmed(value) { onNavigationBarSearchInputConfirmed(value) {
this.value = value.text this.value = value.text

View File

@ -54,6 +54,8 @@ export default {
this.value = option.value this.value = option.value
this.setViewHeight(); this.setViewHeight();
this.ShopSearch() this.ShopSearch()
this.setNavSearchInput(this.value);
}, },
onNavigationBarSearchInputConfirmed(value) { onNavigationBarSearchInputConfirmed(value) {
this.value = value.text this.value = value.text
@ -95,7 +97,6 @@ export default {
// goods_salenum evaluation_count goods_price_asc goods_price_desc // goods_salenum evaluation_count goods_price_asc goods_price_desc
async ShopSearch({ load = 'reload' } = {}) { async ShopSearch({ load = 'reload' } = {}) {
console.log(this.value); console.log(this.value);
this.setNavSearchInput(this.value);
const sort = this.setOrderSort(); const sort = this.setOrderSort();
const res = await this.$u.api.ShopSearch({ const res = await this.$u.api.ShopSearch({
keyword: this.value, keyword: this.value,

View File

@ -1,15 +1,18 @@
<template> <template>
<view class="attention"> <view class="attention">
<view class="attention_box" v-for="(item,index) in attention" :key="index" @click="navto(item.friend_tomid)"> <view class="attention_box" v-for="(item,index) in attention" :key="index" @click="navto(item.friend_tomid)">
<view> <view style="position:relative">
<image :src="item.friend_tomavatar" mode="aspectFill"></image> <image :src="item.friend_tomavatar" mode="aspectFill"></image>
<view class="tishi" v-if="item.unread_message"></view>
</view> </view>
<view>{{item.friend_tomname}}</view> <view>{{item.friend_tomname}}</view>
<view>{{item.live_status ? '正在直播' : '未直播'}}</view> <view>{{item.live_status ? '正在直播' : '未直播'}}</view>
<view class="cur_two" @click="tapClick(index)" v-if = "item.about == 1">已关注</view> <view class="cur_two" @click="tapClick(index)">已关注</view>
<view class="cur" @click="tapClick(index)" v-else = "item.about == 2">未关注</view> <!-- <view class="cur" @click="tapClick(index)" v-else = "item.about == 2">未关注</view> -->
</view> </view>
<u-loadmore :status="status" icon-type="iconType" :load-text="loadText" />
</view> </view>
</template> </template>
<script> <script>
@ -19,9 +22,20 @@
return { return {
rSelect:[], rSelect:[],
type : '未关注', type : '未关注',
attention: [] attention: [],
page:1,
status:'loadmore'
}; };
}, },
onReachBottom(){
if(this.status == 'loading' || this.status == 'nomore'){
return ;
}else{
this.status = "loading"
this.page++
this.snsfriendList()
}
},
onLoad(){ onLoad(){
this.snsfriendList() this.snsfriendList()
}, },
@ -37,8 +51,17 @@
} }
}, },
snsfriendList(){ snsfriendList(){
this.$u.api.snsfriendList({}).then((res)=>{ this.$u.api.snsfriendList({page:this.page}).then((res)=>{
this.attention = res.data; console.log(res)
if(this.page > 1){
this.attention.push(...res.data.data)
}else{
this.attention = res.data.data;
}
this.status = "loadmore"
if(res.data.data.length < 15){
this.status = "nomore"
}
}) })
}, },
navto(id){ navto(id){
@ -58,6 +81,15 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tishi{
position: absolute;
top: 5rpx;
left: 80rpx;
background-color: #ff5d00;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
}
.attention { .attention {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

View File

@ -463,6 +463,7 @@
goSearch() { goSearch() {
this.$u.route("/pageB/search/index", { this.$u.route("/pageB/search/index", {
type: 2, type: 2,
curent:2
}); });
}, },
// //