修改商品列表切换无数据,修改商品列表请求数据重复的问题
This commit is contained in:
@ -2,10 +2,15 @@
|
|||||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
"version": "0.0",
|
"version": "0.0",
|
||||||
"configurations": [{
|
"configurations": [{
|
||||||
"type": "uniCloud",
|
"default" :
|
||||||
"default": {
|
{
|
||||||
"launchtype" : "remote"
|
"launchtype" : "remote"
|
||||||
}
|
},
|
||||||
|
"h5" :
|
||||||
|
{
|
||||||
|
"launchtype" : "remote"
|
||||||
|
},
|
||||||
|
"type" : "uniCloud"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,17 @@
|
|||||||
"h5": {
|
"h5": {
|
||||||
"title": "yshop",
|
"title": "yshop",
|
||||||
"devServer": {
|
"devServer": {
|
||||||
"disableHostCheck" : true
|
"disableHostCheck": true,
|
||||||
|
"proxy": {
|
||||||
|
"/api": {
|
||||||
|
"target": "https://wxapi.yixiang.co",
|
||||||
|
"changeOrigin": true,
|
||||||
|
"secure": true,
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/api": "/api"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"router": {
|
"router": {
|
||||||
"mode": "history"
|
"mode": "history"
|
||||||
|
@ -86,7 +86,6 @@ export default {
|
|||||||
const s = '',
|
const s = '',
|
||||||
id = 0,
|
id = 0,
|
||||||
title = ''
|
title = ''
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hostProduct: [],
|
hostProduct: [],
|
||||||
productList: [],
|
productList: [],
|
||||||
@ -127,8 +126,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
$yroute(to) {
|
$yroute(to) {},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query
|
const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query
|
||||||
@ -143,8 +141,7 @@ export default {
|
|||||||
this.recommendLoading = true
|
this.recommendLoading = true
|
||||||
!this.loading && this.getProductList()
|
!this.loading && this.getProductList()
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {},
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
changeRecommendLoading(recommendLoading) {
|
changeRecommendLoading(recommendLoading) {
|
||||||
this.recommendLoading = recommendLoading
|
this.recommendLoading = recommendLoading
|
||||||
@ -173,6 +170,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getProductList() {
|
getProductList() {
|
||||||
|
if (this.loading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.loading = true
|
||||||
var that = this
|
var that = this
|
||||||
this.setWhere()
|
this.setWhere()
|
||||||
const { s = '', id = 0, title = '' } = this.$yroute.query
|
const { s = '', id = 0, title = '' } = this.$yroute.query
|
||||||
@ -211,26 +212,30 @@ export default {
|
|||||||
},
|
},
|
||||||
//点击事件处理
|
//点击事件处理
|
||||||
set_where: function(index) {
|
set_where: function(index) {
|
||||||
|
const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query
|
||||||
|
|
||||||
let that = this
|
let that = this
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
return that.$yrouter.push({
|
this.where.keyword = ''
|
||||||
path: '/pages/shop/GoodsClass/index',
|
break
|
||||||
})
|
|
||||||
case 1:
|
case 1:
|
||||||
if (that.price === 0) that.price = 1
|
if (that.price === 0) that.price = 1
|
||||||
else if (that.price === 1) that.price = 2
|
else if (that.price === 1) that.price = 2
|
||||||
else if (that.price === 2) that.price = 0
|
else if (that.price === 2) that.price = 0
|
||||||
that.stock = 0
|
that.stock = 0
|
||||||
|
this.where.keyword = s
|
||||||
break
|
break
|
||||||
case 2:
|
case 2:
|
||||||
if (that.stock === 0) that.stock = 1
|
if (that.stock === 0) that.stock = 1
|
||||||
else if (that.stock === 1) that.stock = 2
|
else if (that.stock === 1) that.stock = 2
|
||||||
else if (that.stock === 2) that.stock = 0
|
else if (that.stock === 2) that.stock = 0
|
||||||
that.price = 0
|
that.price = 0
|
||||||
|
this.where.keyword = s
|
||||||
break
|
break
|
||||||
case 3:
|
case 3:
|
||||||
that.nows = !that.nows
|
that.nows = !that.nows
|
||||||
|
this.where.keyword = s
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
@ -60,9 +60,14 @@ function baseRequest(options) {
|
|||||||
|
|
||||||
// 合并传参过来的 headers
|
// 合并传参过来的 headers
|
||||||
// 如果接口需要登录,携带 token 去请求
|
// 如果接口需要登录,携带 token 去请求
|
||||||
|
console.log(options)
|
||||||
|
|
||||||
options.headers = {
|
options.headers = {
|
||||||
...options.headers,
|
...options.headers,
|
||||||
|
// hahah: 'Bearer2 ',
|
||||||
|
}
|
||||||
|
if(options.method=='post'){
|
||||||
|
options.headers.hahah='Bearer2 '
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.login === true) {
|
if (options.login === true) {
|
||||||
|
Reference in New Issue
Block a user