游客登陆 权限拦截

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

@@ -93,7 +93,7 @@
.guide_pages_bg2 { .guide_pages_bg2 {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background: url("@/static/icon/e_0ban_2.jpg") no-repeat; background: url("@/static/icon/e_0ban_2.jpg") no-repeat bottom center;
background-size: cover; background-size: cover;
// background-color: #007AFF; // background-color: #007AFF;
display: flex; display: flex;
@@ -107,7 +107,7 @@
.guide_pages_bg3 { .guide_pages_bg3 {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background: url("@/static/icon/e_0ban_3.jpg") no-repeat; background: url("@/static/icon/e_0ban_3.jpg") no-repeat bottom center;
background-size: cover; background-size: cover;
// background-color: #EA552D; // background-color: #EA552D;
display: flex; display: flex;
@@ -127,7 +127,7 @@
.close_btj { .close_btj {
position: absolute; position: absolute;
top: 60%; top: 50%;
left: 50%; left: 50%;
width: 290rpx; width: 290rpx;
height: 68rpx; height: 68rpx;

View File

@@ -12,8 +12,8 @@
"src" : "图片路径" "src" : "图片路径"
} }
], ],
"versionName" : "1.0.02", "versionName" : "1.0.03",
"versionCode" : 1002, "versionCode" : 1003,
"app-plus" : { "app-plus" : {
"compatible" : { "compatible" : {
"ignoreVersion" : true "ignoreVersion" : true
@@ -120,8 +120,9 @@
"urltypes" : "medicine", "urltypes" : "medicine",
"urlschemewhitelist" : "nuttyreading,zmzm", "urlschemewhitelist" : "nuttyreading,zmzm",
"privacyDescription" : { "privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "为了给您提供修改头像的功能", "NSPhotoLibraryUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
"NSCameraUsageDescription" : "为了给您提供修改头像的功能" "NSCameraUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
"NSPhotoLibraryAddUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用"
} }
}, },
"icons" : { "icons" : {

View File

@@ -579,7 +579,7 @@
"pagePath": "pages/bookShop/orderList", "pagePath": "pages/bookShop/orderList",
"iconPath": "static/tab/order.png", "iconPath": "static/tab/order.png",
"selectedIconPath": "static/tab/order_active.png", "selectedIconPath": "static/tab/order_active.png",
"text": "订单" "text": "我的订单"
}, },
{ {
"pagePath": "pages/taihu/index", "pagePath": "pages/taihu/index",

View File

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

View File

@@ -373,8 +373,9 @@
</view> </view>
</u-radio-group> </u-radio-group>
</template> </template>
<template v-if="currentEditType == 'avatar'"> <template v-if="currentEditType == 'avatar'" >
<u-upload <view class="" @click="checkPermision">
<u-upload
:fileList="fileAvatar" :fileList="fileAvatar"
@afterRead="afterRead" @afterRead="afterRead"
@delete="deletePic" @delete="deletePic"
@@ -385,6 +386,7 @@
:previewFullImage="true" :previewFullImage="true"
> >
</u-upload> </u-upload>
</view>
</template> </template>
<u-button <u-button
@@ -397,11 +399,12 @@
</view> </view>
</u-popup> </u-popup>
<music-play :playData="playData"></music-play> <!-- <music-play :playData="playData"></music-play> -->
</view> </view>
</template> </template>
<script> <script>
import permission from "@/js_sdk/wa-permission/permission.js"
import musicPlay from "@/components/music.vue"; import musicPlay from "@/components/music.vue";
import $http from "@/config/requestConfig.js"; import $http from "@/config/requestConfig.js";
var clear; var clear;
@@ -1146,9 +1149,14 @@ export default {
console.log(error); console.log(error);
}); });
}, },
async checkPermision(){
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
},
// 头像上传 // 头像上传
afterRead(e) { async afterRead(e) {
let that = this; let that = this;
uni.uploadFile({ uni.uploadFile({
url: this.$baseUrl + "oss/fileoss", url: this.$baseUrl + "oss/fileoss",

View File

@@ -199,6 +199,7 @@
<view> <view>
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top> <u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
</view> </view>
<!-- 应对华为审核去掉app跳转 -->
<view class="appJump "> <view class="appJump ">
<view class="everhealth item flexbox" @click="appjumpfun('nuttyreading')"> <view class="everhealth item flexbox" @click="appjumpfun('nuttyreading')">
<view class="img"> <view class="img">

View File

@@ -447,6 +447,7 @@
} }
if (this.quCode == null || this.quCode == 86) { // 如果没选择国家code默认是中国大陆 if (this.quCode == null || this.quCode == 86) { // 如果没选择国家code默认是中国大陆
if (!this.$base.phoneRegular.test(this.phone)) { if (!this.$base.phoneRegular.test(this.phone)) {
this.submitClickNum += 1
uni.showToast({ uni.showToast({
title: '手机格式不正确', title: '手机格式不正确',
icon: 'none' icon: 'none'

View File

@@ -172,6 +172,7 @@
</template> </template>
<script> <script>
import permission from "@/js_sdk/wa-permission/permission.js"
import musicPlay from '@/components/music.vue' import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
var clear; var clear;
@@ -530,7 +531,11 @@
}, },
// 头像 // 头像
choseAvatar(e) { async choseAvatar(e) {
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
let that = this let that = this
if (that.fileAvatar.length == 0) { if (that.fileAvatar.length == 0) {
uni.showToast({ uni.showToast({

File diff suppressed because it is too large Load Diff

View File

@@ -64,7 +64,7 @@
<view class="input_box"> <view class="input_box">
<text class="input_tit">问题截图:</text> <text class="input_tit">问题截图:</text>
<view class="in" style="border: none;"> <view class="in" style="border: none;" @click="checkPermision">
<u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4" <u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4"
width="40" height="40" :previewFullImage="true"> width="40" height="40" :previewFullImage="true">
</u-upload> </u-upload>
@@ -78,6 +78,7 @@
</template> </template>
<script> <script>
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import { import {
mapState, mapState,
mapMutations mapMutations
@@ -207,8 +208,14 @@
// console.log('键盘输入',e); // console.log('键盘输入',e);
this.telError = false this.telError = false
}, },
addPic(e) { async checkPermision(){
// console.log("添加图片"); var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
},
async addPic(e) {
console.log("添加图片");
let that = this; let that = this;
for (var i = 0; i < e.file.length; i++) { for (var i = 0; i < e.file.length; i++) {
//console.log(i,e.file[i].url) //console.log(i,e.file[i].url)

Binary file not shown.