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