优化小程序,修改登录逻辑
This commit is contained in:
parent
36776f2fc9
commit
73018bd564
@ -83,17 +83,17 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getGoodsList() {
|
||||
if (!uni.getStorageSync('userId')) {
|
||||
uni.showToast({
|
||||
title: '请先登录',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (!uni.getStorageSync('userId')) {
|
||||
// uni.showToast({
|
||||
// title: '请先登录',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
const params = {
|
||||
adver_id: this.idVal,
|
||||
}
|
||||
return request(shopApi.adverGoodsList, 'POST', params).then(res => {
|
||||
return request(shopApi.adverGoodsList, 'POST', params, {}, false).then(res => {
|
||||
const list = res.adver_goods_list.map(item => {
|
||||
// 为每个商品初始化quantity
|
||||
return {
|
||||
|
||||
@ -148,7 +148,8 @@
|
||||
<view class="coupon_item_expire">{{ item.end_time }}到期</view>
|
||||
</view>
|
||||
<view class="coupon_item_right">
|
||||
<view class="coupon_item_button" @click="handleCouponClick(item)">{{ item.is_received ? '已领' : '领取' }}</view>
|
||||
<view class="coupon_item_button" @click="handleCouponClick(item)">{{ item.is_received ? '已领' : '领取' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -216,7 +217,7 @@ export default {
|
||||
const params = {
|
||||
mch_id: uni.getStorageSync("merchantInfo").id,
|
||||
}
|
||||
request(apiArr2.redPackageCenter, "POST", params).then(res => {
|
||||
request(apiArr2.redPackageCenter, "POST", params, {}, false).then(res => {
|
||||
this.coupons = res.rows
|
||||
this.couponDetails = res.rows
|
||||
})
|
||||
|
||||
@ -173,7 +173,6 @@ export default {
|
||||
|
||||
changeNav(item) {
|
||||
NavgateTo(`/packages/localLife/classify/index?item=${JSON.stringify(item)}`)
|
||||
|
||||
},
|
||||
|
||||
|
||||
@ -254,7 +253,7 @@ export default {
|
||||
//跳转商家详情
|
||||
Info(e) {
|
||||
uni.setStorageSync("merchantInfo", e);
|
||||
NavgateTo("../detail/index");
|
||||
NavgateTo("../detail/index", { isLogin: false });
|
||||
},
|
||||
//跳转点评
|
||||
toJump(e) {
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
|
||||
</view>
|
||||
<view class="searchBox_ipt" @click="searchPage">
|
||||
<image src="https://static.hshuishang.com/property-img-file/com_communitySearchIcon.png"
|
||||
mode="aspectFill"></image>
|
||||
<image src="https://static.hshuishang.com/property-img-file/com_communitySearchIcon.png" mode="aspectFill">
|
||||
</image>
|
||||
<input disabled type="text" placeholder="输入商品名称" />
|
||||
</view>
|
||||
</view>
|
||||
@ -25,8 +25,7 @@
|
||||
|
||||
<view class="open" @click="topOpen" v-if="!topShow">
|
||||
展 开
|
||||
<image src="https://static.hshuishang.com/property-img-file/shop_openIcon.png"
|
||||
mode="aspectFill"></image>
|
||||
<image src="https://static.hshuishang.com/property-img-file/shop_openIcon.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -199,8 +198,8 @@
|
||||
</view>
|
||||
<view class="Con_right" v-else>
|
||||
<view class="empty">
|
||||
<image src="https://static.hshuishang.com/property-img-file/com_nearbyList_empty.png"
|
||||
mode="aspectFill"></image>
|
||||
<image src="https://static.hshuishang.com/property-img-file/com_nearbyList_empty.png" mode="aspectFill">
|
||||
</image>
|
||||
暂无数据
|
||||
</view>
|
||||
</view>
|
||||
@ -389,7 +388,7 @@ export default {
|
||||
},
|
||||
//分类列表
|
||||
getCateList() {
|
||||
request(apiArr.goodsCateList, "POST", {}).then((res) => {
|
||||
request(apiArr.goodsCateList, "POST", {}, {}, false).then((res) => {
|
||||
console.log(res);
|
||||
this.CateList = res.commodity_category_list;
|
||||
this.firstId = res.commodity_category_list[0].id;
|
||||
@ -423,9 +422,9 @@ export default {
|
||||
// 确保item有commodity_info_list属性
|
||||
if (item.commodity_info_list && Array.isArray(item.commodity_info_list)) {
|
||||
// 过滤掉commodity_goods_info_list为空的infoItem
|
||||
item.commodity_info_list = item.commodity_info_list.filter(infoItem =>
|
||||
infoItem.commodity_goods_info_list &&
|
||||
Array.isArray(infoItem.commodity_goods_info_list) &&
|
||||
item.commodity_info_list = item.commodity_info_list.filter(infoItem =>
|
||||
infoItem.commodity_goods_info_list &&
|
||||
Array.isArray(infoItem.commodity_goods_info_list) &&
|
||||
infoItem.commodity_goods_info_list.length > 0
|
||||
);
|
||||
// 只有当过滤后的infoItem列表不为空时,才保留该item
|
||||
@ -433,7 +432,7 @@ export default {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// 为过滤后的数据中的每个infoItem设置isShow属性
|
||||
filteredList.forEach((item) => {
|
||||
item.commodity_info_list.forEach((infoItem) => {
|
||||
|
||||
@ -666,6 +666,10 @@ export default {
|
||||
},
|
||||
|
||||
async headershopEnterClick() {
|
||||
if(!uni.getStorageSync('userId')){
|
||||
NavgateTo('/packages/shopEnter/index/index', { isLogin: false });
|
||||
return
|
||||
}
|
||||
const res = await request(apiArr2.statusQuery, "POST", {}, { silent: false });
|
||||
if (res.status) {
|
||||
NavgateTo('/packages/shopEnter/auditStatus/index?itemObj=' + JSON.stringify(res));
|
||||
@ -1055,7 +1059,7 @@ export default {
|
||||
//跳转商家详情
|
||||
Info(e) {
|
||||
uni.setStorageSync("merchantInfo", e);
|
||||
NavgateTo("/packages/localLife/detail/index");
|
||||
NavgateTo("/packages/localLife/detail/index", { isLogin: false });
|
||||
},
|
||||
//跳转点评
|
||||
toJump(e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user