问题修复

This commit is contained in:
donqi 2022-06-23 17:32:57 +08:00
parent a0006801c3
commit e2801f18f6
4 changed files with 96 additions and 78 deletions

View File

@ -13,8 +13,8 @@
<view class="cu-bar search bg-white">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input @confirm="searchGoods" v-model="searchInfo.inputGoodsName" :adjust-position="true" type="text" placeholder="输入搜索内容"
confirm-type="search"></input>
<input @confirm="searchGoods" v-model="searchInfo.inputGoodsName" :adjust-position="true" type="text"
placeholder="输入搜索内容" confirm-type="search"></input>
</view>
<!-- 区域筛选picker -->
<view class="action">
@ -84,21 +84,27 @@
<view>2.微信头像</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-main-color" @tap="authWxLogin">确认授权</view>
<navigator class="modal-bottom-oper margin-0 flex-sub text-black" open-type="exit" target="miniProgram">拒绝授权
</navigator>
<view class="modal-bottom-oper margin-0 flex-sub text-main-color solid-left" @tap="authWxLogin">确认授权</view>
</view>
</view>
</view>
<!-- 手机号授予 -->
<view class="cu-modal" :class="isAuthWxPhoneModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view>授予小程序绑定微信手机号码的权限</view>
</view>
<view class="cu-bar bg-white">
<navigator class="modal-bottom-oper margin-0 flex-sub text-black solid-right" open-type="exit" target="miniProgram">拒绝授权
</navigator>
<view class="margin-0 flex-sub">
<button class="margin-0 flex-sub cu-btn bg-white text-main-color"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">确认授权</button>
</view>
</view>
</view>
</view>
<!-- 手机号授予 -->
<view class="cu-modal" :class="isAuthWxPhoneModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view>授予小程序绑定微信手机号码的权限</view>
</view>
<view class="cu-bar bg-white">
<button class="action margin-0 flex-sub cu-btn bg-white text-main-color" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber">确认授权</button>
</view>
</view>
</view>
</view>
</template>
@ -121,7 +127,7 @@
hotGoods: [],
discountGoods: {},
InputBottom: 0,
isAuthWxLoginModal: false,
isAuthWxLoginModal: false,
isAuthWxPhoneModal: false,
searchInfo: {},
areaList: [],
@ -138,34 +144,34 @@
this.loadData();
},
methods: {
async loadData() {
uni.showLoading({
mask: true,
title: '加载中'
})
// userInfo
let res = await this.$request.storageExistUser();
// userInfo
let curUserInfo = this.$request.getCurUserInfo();
this.isAuthWxLoginModal = curUserInfo && curUserInfo.openId ? false : true;
if (this.isAuthWxLoginModal) {
return;
}
this.isAuthWxPhoneModal = !curUserInfo.phone ? true : false;
if (this.isAuthWxPhoneModal) {
return;
}
uni.hideLoading();
async loadData() {
uni.showLoading({
mask: true,
title: '加载中'
})
// userInfo
let res = await this.$request.storageExistUser();
// userInfo
let curUserInfo = this.$request.getCurUserInfo();
this.isAuthWxLoginModal = curUserInfo && curUserInfo.openId ? false : true;
if (this.isAuthWxLoginModal) {
return;
}
this.isAuthWxPhoneModal = !curUserInfo.phone ? true : false;
if (this.isAuthWxPhoneModal) {
return;
}
uni.hideLoading();
//
this.loadRegionList();
//
let hotGoodsRes = await this.$request.getHotGoods({
pageNum: 0,
pageSize: 50
});
this.hotGoods = hotGoodsRes.rows;
this.loadRegionList();
//
let hotGoodsRes = await this.$request.getHotGoods({
pageNum: 0,
pageSize: 50
});
this.hotGoods = hotGoodsRes.rows;
this.swiperList = await this.$api.data('swiperList');
this.categories = await this.$api.data('categories');
this.subCategories = await this.$api.data('subCategories');
@ -198,8 +204,8 @@
}
this.areaList.push(regionList);
this.areaList.push(subRegionList);
this.areaList.push(subSubRegionList);
//
this.areaList.push(subSubRegionList);
//
this.searchInfo.area = [regionList[0], subRegionList[0], subSubRegionList[0]];
},
regionChange(e) {
@ -233,7 +239,7 @@
} else if (colObj.column == 1) {
//
let subAreaList = await this.$request.areaListByStep({
parentCode: this.regionList[0][colObj.value].areaCode
parentCode: this.areaList[1][colObj.value].areaCode
});
subAreaList = subAreaList.data;
this.areaList.pop();
@ -248,27 +254,27 @@
console.log("切换细类, 大类id=" + categoryId);
let allSubCategories = await this.$api.data('subCategories');
this.subCategories = allSubCategories.slice(0, (4 - categoryId) * 5);
},
chooseCategory(item) {
this.searchInfo.category = item;
this.searchGoods();
},
chooseCategory(item) {
this.searchInfo.category = item;
this.searchGoods();
},
searchGoods() {
let params = {
category: this.searchInfo.category,
area: this.searchInfo.area,
inputGoodsName: this.searchInfo.inputGoodsName
};
uni.navigateTo({
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
let params = {
category: this.searchInfo.category,
area: this.searchInfo.area,
inputGoodsName: this.searchInfo.inputGoodsName
};
uni.navigateTo({
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
})
},
showDetails(productItem) {
let params = {
goodsId: productItem.goodsId
}
uni.navigateTo({
url: '/pages/product/product-detail?params=' + encodeURIComponent(JSON.stringify(params))
let params = {
goodsId: productItem.goodsId
}
uni.navigateTo({
url: '/pages/product/product-detail?params=' + encodeURIComponent(JSON.stringify(params))
});
},
showProductCategories() {
@ -283,11 +289,11 @@
}
})
},
getPhoneNumber(e) {
this.$request.storagePhoneIntoUserInfo(e.detail.code).then(res => {
if (res) {
this.loadData();
}
getPhoneNumber(e) {
this.$request.storagePhoneIntoUserInfo(e.detail.code).then(res => {
if (res) {
this.loadData();
}
})
}
}
@ -305,5 +311,12 @@
.hot-sub-category .cu-item .hot-sub-category-icon {
font-size: 80rpx;
}
.modal-bottom-oper {
height: 70rpx;
display: inline-flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -116,7 +116,7 @@
this.multiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) {
//
let subSubAreaList = await this.$request.areaListByStep({parentCode: subAreaList[0].areaCode});
let subSubAreaList = await this.$request.areaListByStep({parentCode: this.areaList[1][colObj.value].areaCode});
subSubAreaList = subSubAreaList.data;
this.areaList.pop();
this.areaList.push(subSubAreaList);

View File

@ -319,7 +319,7 @@
this.areaMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) {
//
let subAreaList = await this.$request.areaListByStep({parentCode: this.regionList[0][colObj.value].areaCode});
let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[1][colObj.value].areaCode});
subAreaList = subAreaList.data;
this.areaList.pop();
this.areaList.push(subAreaList);

View File

@ -1,7 +1,7 @@
.bg-back {
background-color: #f5f5f5;
}
.bg-back {
background-color: #f5f5f5;
}
.line-default {
color: #aaaaaa;
}
@ -43,11 +43,16 @@ radio.main-color.checked .uni-radio-input {
}
.cu-list.menu>.cu-item.bg-main-color.light {
color: #0081ff;
color: #0081ff;
background-color: #cce6ff;
}
.cu-modal .cu-bar>.cu-btn.text-main-color {
}
.cu-modal .cu-bar>.cu-btn.text-main-color {
color: #0081ff;
height: 100rpx;
}
.bg-white.text-main-color {
color: #0081ff;
height: 100rpx;
background-color: #ffffff;
}