|
@@ -21,7 +21,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import jhlive from "@/jhlive/jhlive";
|
|
|
+ import jhlive from "@/jhlive/jhlive";
|
|
|
+ import permision from "@/utils/permission.js";
|
|
|
const NET = require('@/utils/request')
|
|
|
const API = require('@/config/api')
|
|
|
|
|
@@ -70,37 +71,18 @@
|
|
|
this.avatar = res.data.headImg;
|
|
|
this.liveId = res.data.liveId;
|
|
|
this.roomId = res.data.roomId;
|
|
|
+ this.userId = this.userData.userId;
|
|
|
this.goodsList = res.data.liveProducResVO;
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
- if(this.isAuthor) {
|
|
|
- permision.checkAndRequestPermission('scope.camera').then(()=>{
|
|
|
- permision.checkAndRequestPermission('scope.record').then(()=>{
|
|
|
- this.enterRoom();
|
|
|
- },()=>{
|
|
|
- uni.showToast({
|
|
|
- title: '获取权限失败',
|
|
|
- duration: 2000,
|
|
|
- })
|
|
|
- });
|
|
|
- },()=>{
|
|
|
- uni.showToast({
|
|
|
- title: '获取权限失败',
|
|
|
- duration: 2000,
|
|
|
- })
|
|
|
- })
|
|
|
- }else if(this.linkMic) {
|
|
|
- permision.checkAndRequestPermission('scope.record').then(()=>{
|
|
|
- this.enterRoom();
|
|
|
- },()=>{
|
|
|
- uni.showToast({
|
|
|
- title: '获取权限失败',
|
|
|
- duration: 2000,
|
|
|
- })
|
|
|
- });
|
|
|
- }else {
|
|
|
- this.enterRoom();
|
|
|
- }
|
|
|
+ permision.checkAndRequestPermissions(['scope.record']).then(()=>{
|
|
|
+ this.enterRoom();
|
|
|
+ }, ()=>{
|
|
|
+ uni.showToast({
|
|
|
+ title: '获取权限失败',
|
|
|
+ duration: 2000,
|
|
|
+ })
|
|
|
+ })
|
|
|
});
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|