问题修复

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

View File

@ -116,7 +116,7 @@
this.multiIndex = [colObj.value, 0, 0]; this.multiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) { } 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; subSubAreaList = subSubAreaList.data;
this.areaList.pop(); this.areaList.pop();
this.areaList.push(subSubAreaList); this.areaList.push(subSubAreaList);

View File

@ -319,7 +319,7 @@
this.areaMultiIndex = [colObj.value, 0, 0]; this.areaMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) { } 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; subAreaList = subAreaList.data;
this.areaList.pop(); this.areaList.pop();
this.areaList.push(subAreaList); this.areaList.push(subAreaList);

View File

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