main
liudan 2 years ago
parent 12636c7490
commit 3200c4e3b5
  1. 13
      components/wyb-drop-down/wyb-drop-down.vue
  2. 4
      pages.json
  3. 26
      pages/detail/detail.vue
  4. 1
      pages/index/index.vue
  5. 80
      pages/index/searchPage.vue
  6. 1
      pages/my/collection.vue
  7. 1
      pages/my/look.vue
  8. 1
      pages/my/share.vue

@ -39,10 +39,11 @@
transformOrigin: '50% 45%',
color: headerActiveIndex === index && dropOver ? activeColor: defaultColor}" />
<view class="wyb-drop-down-vline" v-if="index !== options.length - 1" /></view>
<u-search placeholder="输入搜索内容"
<u-search placeholder="输入"
:focus="false"
@focus="clickHandle"
@blur="blurHandle"
@input="inputHandle"
:showAction="false"
:class="disabled?'withSearch':'withSearch withSearchDisabled'"
bgColor="#F3F5F7"
@ -118,7 +119,8 @@
contentActiveIndexList: [],
disabled:true,
catagoryName:'',
statusBar:0
statusBar:0,
timer:null
}
},
computed: {
@ -251,6 +253,13 @@
}
},
methods: {
inputHandle(val){
clearTimeout(this.timer)
this.timer=setTimeout(()=>{
this.$emit('getContent',val)
},400)
},
searchHandle(){
this.$emit('getContent',this.catagoryName)
this.close()

@ -24,7 +24,9 @@
},{
"path": "pages/index/searchPage",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"onReachBottomDistance":20 // px
}
},{
"path" : "pages/detail/detail",

@ -108,8 +108,8 @@
},
addShare(){
let routes = this.$mp.page.route
console.log(routes)
// #ifdef APP
let that = this;
// ifdef APP
uni.share({
provider:'weixin',//weixin|qq|sinaweibo
type:0,//
@ -120,14 +120,32 @@
imageUrl:`http://lxwx.njrenzhou.cn${this.titleInfo.listimage}`,//type 025
success(res) {
//
console.log(res);
let params={
wx_article_id:that.titleInfo.id,
wx_category_id:that.titleInfo.wx_category_id
}
uni.$u.http.post('http://lxwx.njrenzhou.cn/api/wx_article_share/add',
params,
{
header: {
'Content-Type': 'application/x-www-form-urlencoded',
'token':uni.getStorageSync('userInfo').token
},
}).then((res) => {
that.$refs.uToast.show({
message:"分享成功"
})
that.isCollect = true
}).catch((res) =>{
})
},
fail(err) {
//
console.log(err);
}
})
// #endif
// endif
// let params={
// wx_article_id:this.titleInfo.id,
// wx_category_id:this.titleInfo.wx_category_id

@ -86,6 +86,7 @@
},
godetails(item){
uni.navigateTo({
// url:'/pages/detail/detail?id='+item.id
url:'/pages/detail/detail?id='+item.wx_category_id
})
},

@ -18,7 +18,7 @@
<view class="searchContent">
<u-search :showAction="true"
actionText="搜索"
placeholder="输入搜索内容"
placeholder="输入"
style="padding:16upx 25upx;"
bgColor="#F3F5F7"
v-if="noSearch"
@ -92,14 +92,18 @@ export default{
disabled:true,
noSearch:true,
contentList:[],
typedata:null
typedata:null,
originListRow:[],
page:1,
limit:20,
total:0,
wx_category_id:null
}
},
components: {
wybDropDown
},
onLoad(option) {
console.log(option,"uuu")
this.catagoryId = option.id
this.typedata = option.typedata
this.getListData(option.id)
@ -107,16 +111,22 @@ export default{
methods:{
getContent(val){
this.catagoryName = val;
this.page=1
this.getListData(this.catagoryId)
},
searchHandle(){
this.page=1
this.getListData(this.catagoryId)
},
getListData(id){
let params={
wx_menu_id:id,
typedata:this.typedata,
name:this.catagoryName
name:this.catagoryName,
page:this.page,
limit:this.limit,
wx_category_id:this.wx_category_id,
sort:'weigh'
}
listData(params).then(res=>{
if(res.searchList.length==0){
@ -126,6 +136,35 @@ export default{
this.tagList = res.searchList
this.noSearch = false;
this.contentList = res.rows;
this.originListRow = res.rows;
this.total = res.total;
this.contentList.forEach(item=>{
let subobj = res.searchList.filter(i=>{
return item.wx_category_id==i.id
})
this.$set(item,'subName',subobj[0].name)
})
}
})
},
getListData1(id){
let params={
wx_menu_id:id,
typedata:this.typedata,
name:this.catagoryName,
page:this.page,
limit:this.limit,
wx_category_id:this.wx_category_id
}
listData(params).then(res=>{
if(res.searchList.length==0){
this.noSearch = true;
this.contentList = res.rows
}else{
this.tagList = res.searchList
this.noSearch = false;
this.contentList.push(...res.rows);
this.originListRow = res.rows;
this.contentList.forEach(item=>{
let subobj = res.searchList.filter(i=>{
return item.wx_category_id==i.id
@ -137,12 +176,23 @@ export default{
},
clickSearchItem(item,index){
console.log(item,index,"--==")
this.page = 1
if(this.active==index){
this.options[0].header = '国家地区选择'
this.active=-1;
this.wx_category_id = null,
// this.contentList = this.originListRow
this.getListData(this.catagoryId)
}else{
this.options[0].header = item.name;
this.active=index;
this.contentList.filter(i=>{
return i.wx_category_id == item.id
})
// let afterList = this.originListRow.filter(i=>{
// return i.wx_category_id == item.id
// })
// this.contentList = afterList
this.wx_category_id = item.id
this.getListData(this.catagoryId)
}
this.$refs.dropDown.close()
},
clickHandle(){
@ -159,10 +209,22 @@ export default{
goNextSection(item){
uni.navigateTo({
url:'/pages/detail/detail?id='+item.wx_category_id
url:'/pages/detail/detail?id='+item.id
// url:'/pages/detail/detail?id='+item.wx_category_id
})
}
},
onReachBottom(){
console.log('已触底');
if(this.contentList.length<this.total){
this.page++;
this.getListData1(this.catagoryId)
}else{
return;
}
}
}
</script>

@ -35,6 +35,7 @@ export default{
methods:{
godetails(item){
uni.navigateTo({
// url:'/pages/detail/detail?id='+item.id
url:'/pages/detail/detail?id='+item.wx_category_id
})
},

@ -35,6 +35,7 @@ export default{
methods:{
godetails(item){
uni.navigateTo({
// url:'/pages/detail/detail?id='+item.id
url:'/pages/detail/detail?id='+item.wx_category_id
})
},

@ -35,6 +35,7 @@ export default{
methods:{
godetails(item){
uni.navigateTo({
// url:'/pages/detail/detail?id='+item.id
url:'/pages/detail/detail?id='+item.wx_category_id
})
},

Loading…
Cancel
Save