提交 bfcec0d0 编写于 作者: zhangzhiwei's avatar zhangzhiwei

排序

上级 e503e063
......@@ -47,6 +47,7 @@
onPageScroll(e => { }) // uniapp的Bug,这句话不要去掉,否则to-top不生效
const state = reactive({
temPP:null,
skuId: '',
spuId: '',
params: {},
......@@ -77,6 +78,7 @@
state.showStyle = uni.getStorageSync('searchCard') === ''? true:uni.getStorageSync('searchCard')
let search = getCurrentInstance().ctx.$page.options || ''
if (search) {
state.temPP=JSON.parse(JSON.stringify(search));
// 价格搜索
if (search['money']) {
let minSalePrice = ''
......@@ -140,6 +142,7 @@
}
}
function changeTab(e) {
state.good.list = []
state.good.page = 0
if (e.name == 0) {
......@@ -150,6 +153,16 @@
if (e.name == 1) {
state.params.sortType=3
state.sortType=3
if (state.temPP) {
if(state.temPP.sortType==25){
state.sortType=25
state.params.sortType=25
}
if(state.temPP.sortType==20){
state.sortType=21
state.params.sortType=21
}
}
state.params['sort'] == 1 ? state.params['sort'] = 0 : state.params['sort'] = 1
}
onGoodLoad()
......@@ -183,6 +196,16 @@
}
function onGoodLoad() {
if (state.temPP&&state.active==0) {
if(state.temPP.sortType==25){
state.sortType=0
state.params.sortType=0
}
if(state.temPP.sortType==20){
state.sortType=20
state.params.sortType=20
}
}
// 获取link参数
// url.indexOf('localhost') == -1 ? link :
// let url = window.location.href
......
......@@ -191,14 +191,13 @@ border: 1rpx solid #EBA926;color: #EBA926;padding: 2rpx 10rpx" @click="goPhoneBt
}, 1000)
});
function goUrl(type) {
console.log(type);
if(type==1){
uni.navigateTo({
url: `/pages/goodList/index?sortType=0`,
url: `/pages/goodList/index?sortType=25`,
});
}else if(type==3){
uni.navigateTo({
url: `/pages/goodList/index?sortType=0`,
url: `/pages/goodList/index?sortType=20`,
});
}else if(type==2){
uni.navigateTo({
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册