main
liudan 2 years ago
parent f1ff608bcb
commit 3f3109e47a
  1. 12
      common/api.js
  2. 3
      common/http.interceptor.js
  3. 2
      pages/detail/detail.vue
  4. 16
      pages/index/index.vue
  5. 3
      pages/index/searchPage.vue
  6. 1
      pages/login/login.vue
  7. 7
      pages/my/my.vue

@ -2,14 +2,14 @@ const http = uni.$u.http
//用户信息
export const UserInfo = (params, config = {}) => http.post('/user/getinfo', params, config);
//上传base64
export const uploadBase64 = (params, config = {}) => http.post('/index/uploads', params, config);
export const uploadBase64 = (params, config = {custom: { auth: true }}) => http.post('/index/uploads', params, config);
//微信登录
export const wxapplogin= (params, config = {}) => http.post('/user/wxapplogin', params, config);
//修改用户信息
export const profileUser= (params, config = {}) => http.post('/user/profile', params, config);
//获取首页轮播图
export const getBanner = (params, config = {}) => http.post('/wx_adv/index', params, config);
export const getBanner = (params, config = {custom: { auth: true }}) => http.post('/wx_adv/index', params, config);
//协议
export const getRichText = (params, config = {}) => http.post('/shopro_richtext/view', params, config);
//获取验证码
@ -17,13 +17,13 @@ export const getsmsCode = (params, config = {}) => http.post('/sms/send', params
//手机验证码登录
export const mobileLogin = (params, config = {}) => http.post('/user/mobilelogin', params, config);
//首页菜单导航
export const indexNav = (params, config = {}) => http.post('/wx_menu/index', params, config);
export const indexNav = (params, config = {custom: { auth: true }}) => http.post('/wx_menu/index', params, config);
// APP下载地址
export const downloadApp = (params, config = {}) => http.post('/app_url/index', params, config);
//上传图片
export const uploadPic = (params, config = {}) => http.post('/index/upload', params, config);
//列表数据
export const listData = (params, config = {}) => http.post('/wx_category/index', params, config);
export const listData = (params, config = {custom: { auth: true }}) => http.post('/wx_category/index', params, config);
//文章详情
export const articleDetails = (params, config = {}) => http.post('/wx_article/view', params, config);
//收藏记录
@ -37,9 +37,9 @@ export const lookRecord = (params, config = {}) => http.post('/wx_article_view/i
//添加分享
export const addShare = (params, config = {}) => http.post('/wx_article_share/add', params, config);
//退出登录
export const logout = (params, config = {}) => http.post('/user/logout', params, config);
export const logout = (params, config = {custom: { auth: true }}) => http.post('/user/logout', params, config);
//文章列表
export const articalList = (params, config = {}) => http.post('/wx_article/index', params, config);
export const articalList = (params, config = {custom: { auth: true }}) => http.post('/wx_article/index', params, config);

@ -51,8 +51,6 @@ module.exports = (vm) => {
// 自定义参数
const custom = response.config?.custom
console.log(11,data)
if (data.code !== 1) {
// 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
// if (custom.toast !== false) {
@ -80,7 +78,6 @@ module.exports = (vm) => {
return data.data === undefined ? {} : data.data
}, (response) => {
console.log(response,"ld")
if(response.data.code==401){
uni.navigateTo({
url:'/pages/login/login'

@ -116,7 +116,7 @@
scene:'WXSceneSession',//provider weixin WXSceneSessionWXSceneTimelineWXSceneFavorite
title:this.titleInfo.title,//
summary:this.titleInfo.title,//
href:`http://lxwx.njrenzhou.cn/#/${routes}?id=${this.titleInfo.wx_category_id}`,//type 0
href:`http://lxwx.h5.njrenzhou.cn/#/${routes}?id=${this.titleInfo.wx_category_id}`,//type 0
imageUrl:`http://lxwx.njrenzhou.cn${this.titleInfo.listimage}`,//type 025
success(res) {
//

@ -5,7 +5,7 @@
<view class="title">
首页
</view>
<u-swiper radius="0" :list="bannerList" :circular="true" height="190"></u-swiper>
<u-swiper radius="0" :list="bannerList" @click="bannerHandle" :circular="true" height="190"></u-swiper>
<view class="gridContent">
<u-grid
:border="false"
@ -65,7 +65,8 @@
list: [
],
msgList:[
]
],
bannerAdvList:[]
}
},
onLoad() {
@ -74,6 +75,10 @@
this.getarticalList()
},
methods: {
bannerHandle(index){
console.log(index)
window.location.href = this.bannerAdvList[index].advurl
},
click(name) {
uni.navigateTo({
url:'/pages/index/searchPage?id='+name.id+'&typedata='+name.typedata
@ -102,13 +107,18 @@
},
getBanner(){
getBanner().then(res => {
this.bannerAdvList = res.rows
this.bannerList = res.rows.map(item=>{
return this.baseUrl+item.advimage
})
})
},
indexNavHandle(){
indexNav().then(res=>{
let params={
sort:'weigh',
order:'desc'
}
indexNav(params).then(res=>{
this.list = res.rows
})
},

@ -126,7 +126,8 @@ export default{
page:this.page,
limit:this.limit,
wx_category_id:this.wx_category_id,
sort:'weigh'
sort:'weigh',
order:'desc'
}
listData(params).then(res=>{
if(res.searchList.length==0){

@ -45,7 +45,6 @@
},
onShow() {
let info = JSON.parse(JSON.stringify(uni.getStorageSync('userInfo')))
console.log(info,"9999")
if(info){
uni.switchTab({
url:'/pages/index/index'

@ -98,10 +98,13 @@
},
layoutHandle(){
logout({ custom: { auth: true }}).then(res=>{
console.log("success")
this.$store.commit('logout')
uni.switchTab({
url:'/pages/index/index'
uni.navigateTo({
url:'/pages/login/login'
})
}).catch((error)=>{
console.log(error)
})
}

Loading…
Cancel
Save