浏览代码

feat: 构建UUID界面布局和流量充值以及远程控制布局处理

Damon 9 月之前
父节点
当前提交
17a3162260
共有 2 个文件被更改,包括 218 次插入0 次删除
  1. 116 0
      src/pages/public/remote.vue
  2. 102 0
      src/pages/public/uuid.vue

+ 116 - 0
src/pages/public/remote.vue

@@ -0,0 +1,116 @@
+<template>
+  <view>
+    <view class="tips"></view>
+    <view class="search_container">
+      <input
+        type="text"
+        v-model="inputValue"
+        class="search_public"
+        confirm-type="done"
+        disabled="true"
+        placeholder="流量充值"
+      />
+      <button class="search_btn" type="submit" @click="getSubmit1">前往</button>
+    </view>
+
+    <view class="search_container">
+      <input
+        type="text"
+        v-model="inputValue"
+        class="search_public"
+        disabled="true"
+        placeholder="远程配网"
+      />
+      <button class="search_btn" type="submit" @click="getSubmit2">绑定</button>
+    </view>
+  </view>
+</template>
+  
+  <script>
+// import { detail, submit } from "@/api/activity.js";
+export default {
+  data() {
+    return {
+      uuid: "",
+      inputValue: "",
+    };
+  },
+  onLoad(e) {
+    this.uuid = e.uuid;
+  },
+  methods: {
+    // http://ptt.radio1964.com/v1/device/get-wifi?UUId=AIrSMArT_210052355545
+    getSubmit1() {
+      if (this.inputValue.trim().length === 0) {
+        uni.showToast({
+          title: "UUID不能为空",
+          icon: "none",
+          mask: true,
+          duration: 2000,
+        });
+        return;
+      }
+      uni.navigateTo({
+        url: `/pages/pay/index?uuid=${this.uuid}`,
+      });
+    },
+
+    getSubmit2() {
+      if (this.inputValue.trim().length === 0) {
+        uni.showToast({
+          title: "UUID不能为空",
+          icon: "none",
+          mask: true,
+          duration: 2000,
+        });
+        return;
+      }
+      window.location.href =
+        `http://ptt.radio1964.com/v1/device/get-wifi?UUId=` + this.uuid;
+    },
+  },
+};
+</script>
+  
+  <style lang="scss" scoped>
+.tips {
+  margin-top: 40%;
+  margin-left: 20rpx;
+  margin-right: 20rpx;
+  font-size: 30rpx;
+}
+
+.search_container {
+  display: flex;
+  flex-direction: row;
+  margin-top: 20rpx;
+}
+
+.search_public {
+  background: #ededed;
+  margin-left: 20rpx;
+  margin-right: 20rpx;
+  border-radius: 50rpx;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  color: black;
+}
+
+.search_btn {
+  width: 200rpx;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  font-size: 28rpx;
+  border-radius: 50rpx;
+  margin-right: 20rpx;
+}
+
+.explain {
+  font-size: 25rpx;
+  margin-top: 40rpx;
+  margin-left: 20rpx;
+  margin-right: 20rpx;
+}
+</style>

+ 102 - 0
src/pages/public/uuid.vue

@@ -0,0 +1,102 @@
+<template>
+  <view>
+    <view class="tips">请输入您的设备UUID:</view>
+    <!-- 搜索框 -->
+    <view class="search_container">
+      <input
+        type="text"
+        v-model="inputValue"
+        class="search_public"
+        focus="true"
+        confirm-type="done"
+        placeholder=""
+      />
+      <button class="search_btn" type="submit" @click="getSubmit">绑定</button>
+    </view>
+    <view class="explain">
+      UUID获取途径:设备页-当前连接设备-右上角箭头标展开详情-点击关于本机-单机UUID复制
+      <br />(绑定验证成功文字提示:“绑定成功”并跳转下个页面,绑定验证UUID不正确提示文字“UUID不正确,请确认后重新输入,绑定成功后该页面不再展示”)
+      <br />每个UUID限一个远程操作账号绑定,即只存在一个当前绑定远程操作账号,最新绑定的为当前绑定账号,其他账号自动失效,以此类推。</view
+    >
+  </view>
+</template>
+
+<script>
+// import { detail, submit } from "@/api/activity.js";
+export default {
+  data() {
+    return {
+      uuid: "",
+      inputValue: "",
+    };
+  },
+  onLoad(e) {
+    this.uuid = e.uuid;
+  },
+  methods: {
+    // http://ptt.radio1964.com/v1/device/get-wifi?UUId=AIrSMArT_210052355545
+    getSubmit() {
+      if (this.inputValue.trim().length === 0) {
+        uni.showToast({
+          title: "UUID不能为空",
+          icon: "none",
+          mask: true,
+          duration: 2000,
+        });
+        return;
+      }
+      uni.navigateTo({
+        url: `/pages/public/remote?uuid=${this.uuid}`,
+      });
+
+      // window.location.href =
+      //   `http://ptt.radio1964.com/v1/device/get-wifi?UUId=` + this.uuid;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.tips {
+  margin-top: 40%;
+  margin-left: 20rpx;
+  margin-right: 20rpx;
+  font-size: 30rpx;
+}
+
+.search_container {
+  display: flex;
+  flex-direction: row;
+  margin-top: 20rpx;
+}
+
+.search_public {
+  background: #ededed;
+  // height: 80rpx;
+  margin-left: 20rpx;
+  margin-right: 20rpx;
+  border-radius: 50rpx;
+  align-items: center;
+  justify-content: center;
+  text-align: start;
+  color: black;
+}
+
+.search_btn {
+  // height: 80rpx;
+  width: 200rpx;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  font-size: 28rpx;
+  border-radius: 50rpx;
+  margin-right: 20rpx;
+}
+
+.explain {
+  font-size: 25rpx;
+  margin-top: 40rpx;
+  margin-left: 20rpx;
+  margin-right: 20rpx;
+}
+</style>