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

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

@ -108,8 +108,8 @@
}, },
addShare(){ addShare(){
let routes = this.$mp.page.route let routes = this.$mp.page.route
console.log(routes) let that = this;
// #ifdef APP // ifdef APP
uni.share({ uni.share({
provider:'weixin',//weixin|qq|sinaweibo provider:'weixin',//weixin|qq|sinaweibo
type:0,// type:0,//
@ -120,14 +120,32 @@
imageUrl:`http://lxwx.njrenzhou.cn${this.titleInfo.listimage}`,//type 025 imageUrl:`http://lxwx.njrenzhou.cn${this.titleInfo.listimage}`,//type 025
success(res) { 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) { fail(err) {
// //
console.log(err); console.log(err);
} }
}) })
// #endif // endif
// let params={ // let params={
// wx_article_id:this.titleInfo.id, // wx_article_id:this.titleInfo.id,
// wx_category_id:this.titleInfo.wx_category_id // wx_category_id:this.titleInfo.wx_category_id

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

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

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

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

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

Loading…
Cancel
Save