31 changed files with 27 additions and 401 deletions
@ -1,31 +0,0 @@ |
|||||
import http from '../common/axios.js' |
|
||||
|
|
||||
//获取搜索记录
|
|
||||
function search_record(data) { |
|
||||
let url = '/dnseyeapi/Search/record' |
|
||||
return http.get(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//获取搜索记录
|
|
||||
function delete_record(data) { |
|
||||
let url = '/dnseyeapi/Search/deleterecord' |
|
||||
return http.get(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//搜索
|
|
||||
function ferret_about(data) { |
|
||||
let url = '/dnseyeapi/Search/ferretabout' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
export default { |
|
||||
search_record, |
|
||||
delete_record, |
|
||||
ferret_about |
|
||||
} |
|
||||
@ -1,79 +0,0 @@ |
|||||
import httpB from '../common/axiosB.js' |
|
||||
|
|
||||
//微信支付相关接口
|
|
||||
|
|
||||
export default { |
|
||||
test, |
|
||||
getSiteInfo, |
|
||||
getOpenid, |
|
||||
getMiniOpenid, |
|
||||
getUser, |
|
||||
getUserCoupons, |
|
||||
addOrder, |
|
||||
wxMpPay, |
|
||||
wxMiniPay, |
|
||||
getAdvertising, |
|
||||
} |
|
||||
|
|
||||
// 账号密码登录
|
|
||||
function test() { |
|
||||
let url = '/test' |
|
||||
return httpB.get(url) |
|
||||
} |
|
||||
|
|
||||
//获取站点信息
|
|
||||
function getSiteInfo(data) { |
|
||||
let url = '/getSiteInfo' |
|
||||
return httpB.get(url,data) |
|
||||
} |
|
||||
|
|
||||
//获取微信公众号openid
|
|
||||
function getOpenid(data) { |
|
||||
let url = '/getOpenid' |
|
||||
return httpB.post(url,data) |
|
||||
} |
|
||||
|
|
||||
//获取微信小程序openid
|
|
||||
function getMiniOpenid(data) { |
|
||||
let url = '/getMiniOpenid' |
|
||||
return httpB.post(url,data) |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
//获取用户信息
|
|
||||
function getUser(data){ |
|
||||
let url = '/getUser' |
|
||||
return httpB.get(url,data) |
|
||||
} |
|
||||
|
|
||||
//获取用户拥有的优惠券
|
|
||||
function getUserCoupons(data){ |
|
||||
let url = '/getUserCoupons' |
|
||||
return httpB.get(url,data) |
|
||||
} |
|
||||
|
|
||||
//创建订单接口
|
|
||||
function addOrder(data){ |
|
||||
let url = '/addOrder' |
|
||||
return httpB.get(url,data) |
|
||||
} |
|
||||
|
|
||||
//微信公众号支付
|
|
||||
function wxMpPay(data){ |
|
||||
let url = '/wxMpPay' |
|
||||
return httpB.post(url,data) |
|
||||
} |
|
||||
|
|
||||
//微信公众号支付
|
|
||||
function wxMiniPay(data){ |
|
||||
let url = '/wxMiniPay' |
|
||||
return httpB.post(url,data) |
|
||||
} |
|
||||
|
|
||||
//获取广告列表
|
|
||||
function getAdvertising(data){ |
|
||||
let url = '/getAdvertising' |
|
||||
return httpB.get(url,data) |
|
||||
} |
|
||||
@ -1,175 +0,0 @@ |
|||||
import http from '../common/axios.js' |
|
||||
|
|
||||
// 发布内容
|
|
||||
function activity_add(data) { |
|
||||
let url = '/dnseyeapi/Activity/add' |
|
||||
return http.post(url, data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 查看内容
|
|
||||
function activity_index(data) { |
|
||||
let url = '/dnseyeapi/Activity/index' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 查看详情内容
|
|
||||
function coninfo(data) { |
|
||||
let url = '/dnseyeapi/Activity/coninfo' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 查看内容
|
|
||||
function activity_like(data) { |
|
||||
let url = '/dnseyeapi/Activity/like' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 我的页面计数
|
|
||||
function mycount(data) { |
|
||||
let url = '/dnseyeapi/Activity/mycount' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 收藏页面
|
|
||||
function mycollect(data) { |
|
||||
let url = '/dnseyeapi/Activity/mycollect' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 获取用户信息
|
|
||||
function getuserinfo(data) { |
|
||||
let url = '/dnseyeapi/Myinfo/getuserinfo' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 修改用户信息
|
|
||||
function updateinfo(data) { |
|
||||
let url = '/dnseyeapi/Myinfo/updateinfo' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 修改用户通知状态
|
|
||||
function updatestatus(data) { |
|
||||
let url = '/dnseyeapi/Myinfo/updatestatus' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 帮助中心
|
|
||||
function helplist() { |
|
||||
let url = '/dnseyeapi/Activity/helplist' |
|
||||
return http.post(url).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//图片验证码
|
|
||||
function verify() { |
|
||||
let url = '/dnseyeapi/Login/verify' |
|
||||
return http.post(url).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//图片验证码
|
|
||||
function forgot(data) { |
|
||||
let url = '/dnseyeapi/Login/forgot' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//评论
|
|
||||
function comment(data) { |
|
||||
let url = '/dnseyeapi/Activity/comment' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//评论详情
|
|
||||
function comment_list(data) { |
|
||||
let url = '/dnseyeapi/Activity/comment_list' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//子评论
|
|
||||
function comments(data) { |
|
||||
let url = '/dnseyeapi/Activity/comments' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//子评论
|
|
||||
function comments_list(data) { |
|
||||
let url = '/dnseyeapi/Activity/comments_list' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//获取城市信息
|
|
||||
function locate_information(data) { |
|
||||
let url = '/dnseyeapi/Activity/locate_information' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//查看用户是否关注公众号
|
|
||||
function is_interest(data) { |
|
||||
let url = '/dnseyeapi/Myinfo/is_interest' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//获取公众号二维码及文字
|
|
||||
function gzhconfig(data) { |
|
||||
let url = '/dnseyeapi/Myinfo/gzhconfig' |
|
||||
return http.post(url,data).then(res => { |
|
||||
return res; |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
export default { |
|
||||
activity_add, |
|
||||
activity_index, |
|
||||
activity_like, |
|
||||
mycount, |
|
||||
mycollect, |
|
||||
getuserinfo, |
|
||||
helplist, |
|
||||
verify, |
|
||||
forgot, |
|
||||
updateinfo, |
|
||||
updatestatus, |
|
||||
coninfo, |
|
||||
comments, |
|
||||
comment_list, |
|
||||
comment, |
|
||||
comments_list, |
|
||||
locate_information, |
|
||||
is_interest, |
|
||||
gzhconfig |
|
||||
} |
|
||||
@ -1,89 +0,0 @@ |
|||||
import { |
|
||||
Api_url_B |
|
||||
} from './config' |
|
||||
// import {Token} from './token.js'
|
|
||||
// var token = new Token();
|
|
||||
|
|
||||
export default { |
|
||||
async post(url, param, yanci = false) { |
|
||||
// wx.showLoading();
|
|
||||
|
|
||||
// setTimeout(() => {
|
|
||||
// wx.hideLoading();
|
|
||||
// }, 3000)
|
|
||||
const res = await this.uni_request(url, param, 'post') |
|
||||
|
|
||||
return res; |
|
||||
}, |
|
||||
async get(url, param, yanci = false) { |
|
||||
// wx.showLoading();
|
|
||||
// setTimeout(() => {
|
|
||||
// wx.hideLoading();
|
|
||||
// }, 3000)
|
|
||||
const res = await this.uni_request(url, param, 'get') |
|
||||
return res; |
|
||||
}, |
|
||||
async put(url, param) { |
|
||||
// wx.showLoading();
|
|
||||
// setTimeout(() => {
|
|
||||
// wx.hideLoading();
|
|
||||
// }, 3000)
|
|
||||
const res = await this.uni_request(url, param, 'put') |
|
||||
return res; |
|
||||
}, |
|
||||
uni_request(url, param, method, again_quest = false) { |
|
||||
const that = this |
|
||||
uni.showLoading({ |
|
||||
title:'加载中...' |
|
||||
}) |
|
||||
return new Promise((cback, reject) => { |
|
||||
console.log(Api_url_B + url) |
|
||||
uni.request({ |
|
||||
url: Api_url_B + url, |
|
||||
data: param, |
|
||||
method: method, |
|
||||
header: { |
|
||||
'token': uni.getStorageSync("token") |
|
||||
}, |
|
||||
}).then(data => { //data为一个数组,数组第一项为错误信息,第二项为返回数据
|
|
||||
var [error, res] = data; |
|
||||
uni.hideLoading() |
|
||||
var res_code = res.statusCode.toString(); |
|
||||
if (res_code.charAt(0) == 2) { |
|
||||
if (res_code == 200) { |
|
||||
cback(res.data); |
|
||||
} else { |
|
||||
console.log('201', url) |
|
||||
uni.showToast({ |
|
||||
title: res.data.msg, |
|
||||
icon: 'none' |
|
||||
}) |
|
||||
} |
|
||||
} else { |
|
||||
if (res_code == 401) { |
|
||||
//登录失效
|
|
||||
console.log('401', url) |
|
||||
if (again_quest) { |
|
||||
// token.getTokenFromServer(()=>{
|
|
||||
// const again_res=that.uni_request(url,param,method,false)
|
|
||||
// //注意这里需要cback,因为是上一个promis的cback
|
|
||||
// cback(again_res);
|
|
||||
// });
|
|
||||
} else { |
|
||||
console.log('再次登陆仍然失败', url) |
|
||||
} |
|
||||
} else { |
|
||||
console.log('400/500', url, error, res) |
|
||||
uni.showToast({ |
|
||||
title: res.data.msg ? res.data.msg : '请求异常', |
|
||||
icon: 'none' |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}).catch(err => { |
|
||||
console.log('catch:', err); |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
} |
|
||||
Loading…
Reference in new issue