游客登陆 权限拦截

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 {
width: 100vw;
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-color: #007AFF;
display: flex;
@@ -107,7 +107,7 @@
.guide_pages_bg3 {
width: 100vw;
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-color: #EA552D;
display: flex;
@@ -127,7 +127,7 @@
.close_btj {
position: absolute;
top: 60%;
top: 50%;
left: 50%;
width: 290rpx;
height: 68rpx;

View File

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

View File

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

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: {
@@ -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,6 +848,21 @@ 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;
},
@@ -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,

View File

@@ -374,6 +374,7 @@
</u-radio-group>
</template>
<template v-if="currentEditType == 'avatar'" >
<view class="" @click="checkPermision">
<u-upload
:fileList="fileAvatar"
@afterRead="afterRead"
@@ -385,6 +386,7 @@
:previewFullImage="true"
>
</u-upload>
</view>
</template>
<u-button
@@ -397,11 +399,12 @@
</view>
</u-popup>
<music-play :playData="playData"></music-play>
<!-- <music-play :playData="playData"></music-play> -->
</view>
</template>
<script>
import permission from "@/js_sdk/wa-permission/permission.js"
import musicPlay from "@/components/music.vue";
import $http from "@/config/requestConfig.js";
var clear;
@@ -1146,9 +1149,14 @@ export default {
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;
uni.uploadFile({
url: this.$baseUrl + "oss/fileoss",

View File

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

View File

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

View File

@@ -172,6 +172,7 @@
</template>
<script>
import permission from "@/js_sdk/wa-permission/permission.js"
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
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
if (that.fileAvatar.length == 0) {
uni.showToast({

File diff suppressed because it is too large Load Diff

View File

@@ -64,7 +64,7 @@
<view class="input_box">
<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"
width="40" height="40" :previewFullImage="true">
</u-upload>
@@ -78,6 +78,7 @@
</template>
<script>
import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import {
mapState,
mapMutations
@@ -207,8 +208,14 @@
// console.log('键盘输入',e);
this.telError = false
},
addPic(e) {
// console.log("添加图片");
async checkPermision(){
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
},
async addPic(e) {
console.log("添加图片");
let that = this;
for (var i = 0; i < e.file.length; i++) {
//console.log(i,e.file[i].url)

Binary file not shown.