|
@@ -4,11 +4,10 @@
|
|
|
<view class="search_container">
|
|
|
<input
|
|
|
type="text"
|
|
|
- v-model="inputValue"
|
|
|
+ v-model="流量充值"
|
|
|
class="search_public"
|
|
|
confirm-type="done"
|
|
|
disabled="true"
|
|
|
- placeholder="流量充值"
|
|
|
/>
|
|
|
<button class="search_btn" type="submit" @click="getSubmit1">前往</button>
|
|
|
</view>
|
|
@@ -16,10 +15,9 @@
|
|
|
<view class="search_container">
|
|
|
<input
|
|
|
type="text"
|
|
|
- v-model="inputValue"
|
|
|
+ v-model="远程配网"
|
|
|
class="search_public"
|
|
|
disabled="true"
|
|
|
- placeholder="远程配网"
|
|
|
/>
|
|
|
<button class="search_btn" type="submit" @click="getSubmit2">绑定</button>
|
|
|
</view>
|
|
@@ -27,46 +25,43 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// import { detail, submit } from "@/api/activity.js";
|
|
|
+import { deviceUrlInfo } from "@/api/public.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- uuid: "",
|
|
|
- inputValue: "",
|
|
|
+ state: "",
|
|
|
+ openId: "",
|
|
|
+ flowUrl: "",
|
|
|
+ wifiUrl: "",
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
- this.uuid = e.uuid;
|
|
|
+ this.state = e.state;
|
|
|
+ this.openId = e.openId;
|
|
|
},
|
|
|
+
|
|
|
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}`,
|
|
|
+ ///获取用户信息
|
|
|
+ deviceUrlInfo() {
|
|
|
+ deviceUrlInfo({
|
|
|
+ code: this.state,
|
|
|
+ code: this.openId,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.flowUrl = res.data.flowUrl;
|
|
|
+ this.wifiUrl = res.data.wifiUrl;
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ getSubmit1() {
|
|
|
+ window.location.href =
|
|
|
+ `http://ptt.radio1964.com/v1/device/get-wifi?UUId=` + this.flowUrl;
|
|
|
+ },
|
|
|
+
|
|
|
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;
|
|
|
+ `http://ptt.radio1964.com/v1/device/get-wifi?UUId=` + this.wifiUrl;
|
|
|
},
|
|
|
},
|
|
|
};
|