游客登陆 权限拦截

This commit is contained in:
@fawn-nine
2024-07-10 14:46:20 +08:00
parent d1953091a9
commit f73e521179
11 changed files with 1531 additions and 1033 deletions

View File

@@ -717,6 +717,7 @@ export default {
curriculumInfo: "app/phone.do?getCourseInfo",
detailInfo: "sociology/product/getProductDetail",
goodsList: "book/shopproduct/getGlProductList",
visitorDetailInfo: "visitor/getProductDetail", // 游客状态下的商品详情
},
customButtonGroup1: [
{
@@ -726,6 +727,7 @@ export default {
color: "#fff",
},
],
requestType:'', // 数据请求类型是否为游客登陆状态
};
},
filters: {
@@ -780,7 +782,7 @@ export default {
},
onLoad(options) {
this.options = options;
console.log('options',options)
console.log('options',options)
// this.handleClickGetGoodsList();
// this.getUserInfo()
// this.getCateList()
@@ -799,6 +801,7 @@ export default {
// this.searchList = []
},
onShow() {
this.requestType = this.options.type
this.selectGoodsData = {};
this.getCourseDescriptionData();
this.show = false;
@@ -823,6 +826,21 @@ export default {
this.show = false;
},
selectGoods(data) {
if(this.requestType == 'visitor'){
uni.showModal({
content:"登陆后可购买本商品",
confirmText:'去登录',
cancelText:'再逛逛',
success(res) {
if (res.confirm) {
uni.navigateTo({
url:'/pages/user/login'
})
}
},
})
return
}
this.selectGoodsData = data;
this.$refs.commonSelectGoods.open()
// this.show = true;
@@ -830,10 +848,25 @@ export default {
},
onHandleClickBuy1() {
if(this.requestType == 'visitor'){
uni.showModal({
content:"登陆后可购买本商品",
confirmText:'去登录',
cancelText:'再逛逛',
success(res) {
if (res.confirm) {
uni.navigateTo({
url:'/pages/user/login'
})
}
},
})
return
}
this.$refs.commonSelectGoods.open();
// this.show = true;
},
onHandleClickBuy() {
onHandleClickBuy() {
console.log(
this.selectGoodsData,
"this.selectGoodsDatathis.selectGoodsDatathis.selectGoodsData"
@@ -957,10 +990,11 @@ export default {
async getCourseDescriptionData() {
var data = {};
var that = this;
let url = ''
this.requestType == 'visitor' ? url = this.urlList.visitorDetailInfo : url = this.urlList.detailInfo
this.$http
.request({
url: this.urlList.detailInfo,
url,
method: "POST",
data: {
productId: this.options.id,