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); export const UserInfo = (params, config = {}) => http.post('/user/getinfo', params, config);
//上传base64 //上传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 wxapplogin= (params, config = {}) => http.post('/user/wxapplogin', params, config);
//修改用户信息 //修改用户信息
export const profileUser= (params, config = {}) => http.post('/user/profile', 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); 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 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下载地址 // APP下载地址
export const downloadApp = (params, config = {}) => http.post('/app_url/index', params, config); 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 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); 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 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 const custom = response.config?.custom
console.log(11,data)
if (data.code !== 1) { if (data.code !== 1) {
// 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示 // 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
// if (custom.toast !== false) { // if (custom.toast !== false) {
@ -80,7 +78,6 @@ module.exports = (vm) => {
return data.data === undefined ? {} : data.data return data.data === undefined ? {} : data.data
}, (response) => { }, (response) => {
console.log(response,"ld")
if(response.data.code==401){ if(response.data.code==401){
uni.navigateTo({ uni.navigateTo({
url:'/pages/login/login' url:'/pages/login/login'

@ -116,7 +116,7 @@
scene:'WXSceneSession',//provider weixin WXSceneSessionWXSceneTimelineWXSceneFavorite scene:'WXSceneSession',//provider weixin WXSceneSessionWXSceneTimelineWXSceneFavorite
title:this.titleInfo.title,// title:this.titleInfo.title,//
summary: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 imageUrl:`http://lxwx.njrenzhou.cn${this.titleInfo.listimage}`,//type 025
success(res) { success(res) {
// //

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

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

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

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

Loading…
Cancel
Save