wangxy 1 هفته پیش
والد
کامیت
002ac69caa
2فایلهای تغییر یافته به همراه125 افزوده شده و 0 حذف شده
  1. 48 0
      api/mianshi.js
  2. 77 0
      pages/demo/demo3.vue

+ 48 - 0
api/mianshi.js

@@ -0,0 +1,48 @@
+import request from '@/utils/request'
+export function getMianshiCreate(data = {}) {
+  return request({
+    url: '/app/mianshi/create',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+export function getMianshiClose(data = {}) {
+  return request({
+    url: '/app/mianshi/close',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+export function getMianshiInfo(data = {}) {
+  return request({
+    url: '/app/mianshi/info',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+export function getMianshiList(data = {}) {
+  return request({
+    url: '/app/mianshi/list',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 77 - 0
pages/demo/demo3.vue

@@ -0,0 +1,77 @@
+<template>
+	<view style="height: 50px"></view>
+	<view>
+		<button @click="openUrl">进入房间</button>
+		<button @click="openUrl2">进入房间2</button>
+		
+		<button @click="handleCreate">创建房间</button>
+		<button @click="handleClose">关闭房间</button>
+		
+		<view>
+			房间信息 {{}}
+		</view>
+	</view>
+
+</template>
+
+<script setup>
+	import * as httpApi from '@/api/mianshi.js'
+	import { ref, reactive } from "vue"
+	
+	const data = reactive({
+		room: '',
+	})
+	
+	
+	function handleCreate() {
+		httpApi.getMianshiCreate().then(res =>{
+			this.data = res.data.room;
+			uni.showToast({
+				title:'创建成功'
+			})
+		})
+	}
+	
+	function handleClose() {
+		httpApi.getMianshiClose().then(res =>{
+			if (res.data) {
+				data.room = null
+				uni.showToast({
+					title:'关闭成功'
+				})
+			}
+		})
+	}
+	
+	
+	
+	const url =
+		`https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=900803&appId=dehjl65f&uid=1234&userName=654321&token=000eJxjYGBQsA1url798NJZWaZ%2BjcOiqvN85r2sm1VyiP2c42evb%2F1PlRkYGDhSUjOycsxM0zJjN%2BcveXkvIjOe5StQnM3SwMDCwBjIYjE0MjZhYGQYBUMKAACboBuh`
+
+	function openUrl() {
+		plus.runtime.openURL(url, (err) => {
+			if (err) {
+				console.error('打开浏览器失败: ', err);
+				uni.showToast({
+					title: '打开链接失败',
+					icon: 'none'
+				});
+			}
+		});
+	}
+
+	const url2 =
+		`https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=900803&appId=dehjl65f&uid=1145&userName=123456&token=000eJxjYGBQ%2BNqm4zpNb%2FZc1u5tTh9MFtnfjTM5mMo2%2FZebyk3Rbl%2F19wwMDBwpqRlZOWamaZmxmyfwHU9izYxnFQOKs1kaGFgYGANZLIaGJqYMjAyjYEgBADKGGBo%3D`
+
+	function openUrl2() {
+		plus.runtime.openURL(url2, (err) => {
+			if (err) {
+				console.error('打开浏览器失败: ', err);
+				uni.showToast({
+					title: '打开链接失败',
+					icon: 'none'
+				});
+			}
+		});
+	}
+</script>