细节优化-0714
parent
f984d76d37
commit
514308d783
|
@ -105,7 +105,9 @@
|
|||
methods: {
|
||||
// 获取用户信息
|
||||
getUserInfo(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/user/info').then(res=>{
|
||||
if(res.code==0) {
|
||||
this.businessId = res.data.business_id;
|
||||
|
|
|
@ -197,7 +197,9 @@
|
|||
},
|
||||
// 获取文章列表
|
||||
getArticleList(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
let params = {
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
|
@ -211,7 +213,7 @@
|
|||
let obj = {
|
||||
id:item.id,
|
||||
title:item.title,
|
||||
time:this.dateFormat(item.published_at),
|
||||
time:this.dateFormat(item.published_at.replace(/-/g,'/')),
|
||||
src:item.cover
|
||||
}
|
||||
newArr.push(obj)
|
||||
|
|
|
@ -125,7 +125,9 @@
|
|||
methods: {
|
||||
//查询套件详情
|
||||
getKitDetail(id){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/spu/detail',{id:id}).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.kitDetail = res.data.detail; //套件详情
|
||||
|
|
|
@ -101,7 +101,9 @@
|
|||
methods: {
|
||||
// 查询套件列表
|
||||
getKitEv(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
let params = {
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
|
|
|
@ -205,7 +205,9 @@
|
|||
methods: {
|
||||
// 获取用户信息
|
||||
getUserInfo(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/user/info').then(res=>{
|
||||
console.log(res,'用户信息')
|
||||
if(res.code==0) {
|
||||
|
|
|
@ -113,7 +113,9 @@
|
|||
size:this.size
|
||||
}
|
||||
if(this.currentIndex == 0){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/spu/collection',params).then(res=>{
|
||||
if(res.code == 0){
|
||||
this.total = res.data.total;
|
||||
|
@ -145,7 +147,7 @@
|
|||
id:item.id,
|
||||
src:item.cover,
|
||||
title:item.title,
|
||||
time:this.dateFormat(item.published_at)
|
||||
time:this.dateFormat(item.published_at.replace(/-/g,'/'))
|
||||
}
|
||||
newArr.push(obj)
|
||||
})
|
||||
|
|
|
@ -124,12 +124,14 @@
|
|||
},
|
||||
// 查询文章详情
|
||||
getDetail(id){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.post('/api/archives/detail',{id:id}).then(res=>{
|
||||
if(res.code==0) {
|
||||
console.log(res,'文章详情')
|
||||
// console.log(res,'文章详情')
|
||||
this.articleDetail = res.data;
|
||||
this.time = this.dateFormat(res.data.published_at)
|
||||
this.time = this.dateFormat(res.data.published_at.replace(/-/g,'/'))
|
||||
this.content = this.$toolAll.tools.escape2Html(res.data.content)
|
||||
}
|
||||
uni.hideLoading();
|
||||
|
|
|
@ -116,7 +116,9 @@
|
|||
},
|
||||
// 获取疑难解答、行业资讯列表
|
||||
getArticleList(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
let params = {
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
|
@ -130,7 +132,7 @@
|
|||
let obj = {
|
||||
id:item.id,
|
||||
title:item.title,
|
||||
time:this.dateFormat(item.published_at),
|
||||
time:this.dateFormat(item.published_at.replace(/-/g,'/')),
|
||||
src:item.cover
|
||||
}
|
||||
newArr.push(obj)
|
||||
|
|
|
@ -113,7 +113,9 @@
|
|||
methods: {
|
||||
// 查询订单详情
|
||||
getOrderDetail(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/user/order-detail',{id:this.id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.orderDetail = res.data;
|
||||
|
|
|
@ -119,7 +119,9 @@
|
|||
},
|
||||
// 获取订单列表
|
||||
getOrderList(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
let params = {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
|
|
|
@ -179,7 +179,9 @@
|
|||
},
|
||||
//查询商品详情
|
||||
getDetail(id){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/spu/detail',{id:id}).then(res=>{
|
||||
if(res.code==0) {
|
||||
console.log(res,'详情')
|
||||
|
|
|
@ -167,7 +167,9 @@
|
|||
|
||||
// 查询商品列表
|
||||
getShopList(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.ifLoading = true;
|
||||
let params = {
|
||||
page:this.page,
|
||||
|
|
|
@ -73,7 +73,9 @@
|
|||
methods: {
|
||||
// 查询关于我们
|
||||
getAboutData(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/index/about').then(res=>{
|
||||
if(res.code==0){
|
||||
this.aboutData = this.$toolAll.tools.escape2Html(res.data.content);
|
||||
|
|
|
@ -41,7 +41,9 @@
|
|||
methods: {
|
||||
// 查询免责声明
|
||||
getDisclaimers(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.$requst.get('/api/index/statement').then(res=>{
|
||||
if(res.code==0){
|
||||
this.disclaimers = this.$toolAll.tools.escape2Html(res.data.content);
|
||||
|
|
|
@ -137,12 +137,8 @@
|
|||
// 选择历史搜索
|
||||
changeKeyword(keyword){
|
||||
this.keywords =keyword;
|
||||
|
||||
let isRequest = uni.getStorageSync('isRequest');
|
||||
if(isRequest){
|
||||
this.getSearchList();
|
||||
this.getHistory();
|
||||
}
|
||||
},
|
||||
// 清空历史搜索
|
||||
clearHistory(){
|
||||
|
@ -167,6 +163,9 @@
|
|||
let params = {
|
||||
keyword:this.keywords
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
if(this.currentIndex == 0){
|
||||
this.$requst.get('/api/spu/list',params).then(res=>{
|
||||
if(res.code == 0){
|
||||
|
@ -211,6 +210,7 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
// 时间格式转换
|
||||
dateFormat (dateData) {
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
getUserData(){
|
||||
uni.showLoading();
|
||||
this.$requst.get('/api/user/info').then(res=>{
|
||||
console.log(res,'用户信息')
|
||||
// console.log(res,'用户信息')
|
||||
if(res.code==0) {
|
||||
this.headImgUrl = res.data.headimgurl;
|
||||
this.nickName = res.data.nickname;
|
||||
|
@ -230,7 +230,9 @@
|
|||
},
|
||||
// 上传图片
|
||||
uploadImg(){
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '上传中'
|
||||
});
|
||||
this.$requst.upload('/api/file/upload/image',{path:this.headImg}).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.headImgUrl = this.$hostHttp+res.data.src;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -263,7 +263,9 @@ var _default = {
|
|||
methods: {
|
||||
// 获取用户信息
|
||||
getUserInfo: function getUserInfo() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/user/info').then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this2.businessId = res.data.business_id;
|
||||
|
|
|
@ -364,7 +364,9 @@ var _default = {
|
|||
},
|
||||
// 获取文章列表
|
||||
getArticleList: function getArticleList() {var _this5 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
var params = {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
|
@ -378,7 +380,7 @@ var _default = {
|
|||
var obj = {
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
time: _this5.dateFormat(item.published_at),
|
||||
time: _this5.dateFormat(item.published_at.replace(/-/g, '/')),
|
||||
src: item.cover };
|
||||
|
||||
newArr.push(obj);
|
||||
|
|
|
@ -296,7 +296,9 @@ var _default = {
|
|||
methods: {
|
||||
//查询套件详情
|
||||
getKitDetail: function getKitDetail(id) {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/spu/detail', { id: id }).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this2.kitDetail = res.data.detail; //套件详情
|
||||
|
|
|
@ -259,7 +259,9 @@ var _default = {
|
|||
methods: {
|
||||
// 查询套件列表
|
||||
getKitEv: function getKitEv() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
var params = {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
|
|
|
@ -363,7 +363,9 @@ var _default = {
|
|||
methods: {
|
||||
// 获取用户信息
|
||||
getUserInfo: function getUserInfo() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/user/info').then(function (res) {
|
||||
console.log(res, '用户信息');
|
||||
if (res.code == 0) {
|
||||
|
|
|
@ -271,7 +271,9 @@ var _default = {
|
|||
size: this.size };
|
||||
|
||||
if (this.currentIndex == 0) {
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/spu/collection', params).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this2.total = res.data.total;
|
||||
|
@ -303,7 +305,7 @@ var _default = {
|
|||
id: item.id,
|
||||
src: item.cover,
|
||||
title: item.title,
|
||||
time: _this2.dateFormat(item.published_at) };
|
||||
time: _this2.dateFormat(item.published_at.replace(/-/g, '/')) };
|
||||
|
||||
newArr.push(obj);
|
||||
});
|
||||
|
|
|
@ -256,12 +256,14 @@ var _default = {
|
|||
},
|
||||
// 查询文章详情
|
||||
getDetail: function getDetail(id) {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.post('/api/archives/detail', { id: id }).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
console.log(res, '文章详情');
|
||||
// console.log(res,'文章详情')
|
||||
_this2.articleDetail = res.data;
|
||||
_this2.time = _this2.dateFormat(res.data.published_at);
|
||||
_this2.time = _this2.dateFormat(res.data.published_at.replace(/-/g, '/'));
|
||||
_this2.content = _this2.$toolAll.tools.escape2Html(res.data.content);
|
||||
}
|
||||
uni.hideLoading();
|
||||
|
|
|
@ -280,7 +280,9 @@ var _default = {
|
|||
},
|
||||
// 获取疑难解答、行业资讯列表
|
||||
getArticleList: function getArticleList() {var _this3 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
var params = {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
|
@ -294,7 +296,7 @@ var _default = {
|
|||
var obj = {
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
time: _this3.dateFormat(item.published_at),
|
||||
time: _this3.dateFormat(item.published_at.replace(/-/g, '/')),
|
||||
src: item.cover };
|
||||
|
||||
newArr.push(obj);
|
||||
|
|
|
@ -290,7 +290,9 @@ var _default = {
|
|||
methods: {
|
||||
// 查询订单详情
|
||||
getOrderDetail: function getOrderDetail() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/user/order-detail', { id: this.id }).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this2.orderDetail = res.data;
|
||||
|
|
|
@ -280,7 +280,9 @@ var _default = {
|
|||
},
|
||||
// 获取订单列表
|
||||
getOrderList: function getOrderList() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
var params = {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
|
|
|
@ -359,7 +359,9 @@ var _default = {
|
|||
},
|
||||
//查询商品详情
|
||||
getDetail: function getDetail(id) {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/spu/detail', { id: id }).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
console.log(res, '详情');
|
||||
|
|
|
@ -220,7 +220,9 @@ var _default = {
|
|||
|
||||
// 查询商品列表
|
||||
getShopList: function getShopList() {var _this3 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.ifLoading = true;
|
||||
var params = {
|
||||
page: this.page,
|
||||
|
|
|
@ -205,7 +205,9 @@ var _default = {
|
|||
methods: {
|
||||
// 查询关于我们
|
||||
getAboutData: function getAboutData() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/index/about').then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this2.aboutData = _this2.$toolAll.tools.escape2Html(res.data.content);
|
||||
|
|
|
@ -173,7 +173,9 @@ var _default = {
|
|||
methods: {
|
||||
// 查询免责声明
|
||||
getDisclaimers: function getDisclaimers() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
this.$requst.get('/api/index/statement').then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this2.disclaimers = _this2.$toolAll.tools.escape2Html(res.data.content);
|
||||
|
|
|
@ -295,12 +295,8 @@ var _default = {
|
|||
// 选择历史搜索
|
||||
changeKeyword: function changeKeyword(keyword) {
|
||||
this.keywords = keyword;
|
||||
|
||||
var isRequest = uni.getStorageSync('isRequest');
|
||||
if (isRequest) {
|
||||
this.getSearchList();
|
||||
this.getHistory();
|
||||
}
|
||||
},
|
||||
// 清空历史搜索
|
||||
clearHistory: function clearHistory() {var _this2 = this;
|
||||
|
@ -325,6 +321,9 @@ var _default = {
|
|||
var params = {
|
||||
keyword: this.keywords };
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中' });
|
||||
|
||||
if (this.currentIndex == 0) {
|
||||
this.$requst.get('/api/spu/list', params).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
|
@ -369,6 +368,7 @@ var _default = {
|
|||
}
|
||||
});
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
// 时间格式转换
|
||||
dateFormat: function dateFormat(dateData) {
|
||||
|
|
|
@ -245,7 +245,7 @@ var _default = {
|
|||
getUserData: function getUserData() {var _this2 = this;
|
||||
uni.showLoading();
|
||||
this.$requst.get('/api/user/info').then(function (res) {
|
||||
console.log(res, '用户信息');
|
||||
// console.log(res,'用户信息')
|
||||
if (res.code == 0) {
|
||||
_this2.headImgUrl = res.data.headimgurl;
|
||||
_this2.nickName = res.data.nickname;
|
||||
|
@ -362,7 +362,9 @@ var _default = {
|
|||
},
|
||||
// 上传图片
|
||||
uploadImg: function uploadImg() {var _this6 = this;
|
||||
uni.showLoading();
|
||||
uni.showLoading({
|
||||
title: '上传中' });
|
||||
|
||||
this.$requst.upload('/api/file/upload/image', { path: this.headImg }).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this6.headImgUrl = _this6.$hostHttp + res.data.src;
|
||||
|
|
Loading…
Reference in New Issue