问题修复
This commit is contained in:
parent
a0006801c3
commit
e2801f18f6
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue