diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index dec621d..9c734f5 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -19,8 +19,8 @@ const install = (Vue, vm) => {
// },
// });
Vue.prototype.$u.http.setConfig({
- baseUrl: 'http://192.168.2.81:10002',
- // baseUrl: 'https://kg.chuangtewl.com/prod-api',
+ // baseUrl: 'http://192.168.2.81:10002',
+ baseUrl: 'https://kg.chuangtewl.com/prod-api',
// loadingText: '努力加载中~',
// loadingTime: 1000,
// 设置自定义头部content-type
diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue
index 32c89d8..6c40651 100644
--- a/components/tab-bar/tab-bar.vue
+++ b/components/tab-bar/tab-bar.vue
@@ -15,7 +15,10 @@
商户
-
+
diff --git a/page_components/bindszthr.vue b/page_components/bindszthr.vue
index 86a2e14..276e6c4 100644
--- a/page_components/bindszthr.vue
+++ b/page_components/bindszthr.vue
@@ -19,27 +19,43 @@
套餐模版配置
-
+
能更方便,快速的配置设备套餐
-
+
选择套餐列表
- 套餐名称 {{item.name}}
+ {{item.name}}
+
+ 计时收费
+ 按量收费
+ 分时段按量收费
+ 分时段按时收费
+ (单次收费
+ 智能收费)
+
+ 押金{{item.price}}
+ {{item.value}}时 {{item.price}}元
+ {{item.value}}分 {{item.price}}元
+ {{item.value}}秒 {{item.price}}元
+
+
+ 备注:{{item.description == null ? '--' : item.description}}
+
@@ -48,13 +64,43 @@
-
- 完成设置(3/3)
+
+
+
+
+ 新建套餐
+
+
+
+ 完成设置(3/3)
+
+
+
+
+
+
+ 商户反洗钱协议
+
+
+ 欢迎来到创想物联
+
+
+
+
+
+ 同意
+
+
+ 已阅 {{countdown}}秒
+
+
+
+
@@ -63,6 +109,7 @@
export default {
data() {
return {
+ xintsflag:false,
btnmsk:false,
qrResult:'',
bluetoothflag: false,
@@ -103,7 +150,10 @@
url: '',
tclist:[],
list:[],
- isActive: []
+ isActive: [],
+ countdown: 10, // 初始倒计时时间
+ intervalId: null,
+ contwz:''
}
},
onLoad(option) {
@@ -118,12 +168,14 @@
// this.getgroup()
// this.gettanc()
this.getlistobj(this.id)
- // this.getuserinfo()
this.getao()
this.getlist()
+ this.getxieyi()
},
onUnload: function() {
- console.log("unload ");
+ if (this.intervalId) {
+ clearInterval(this.intervalId);
+ }
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
wx.closeBLEConnection({
deviceId: this.deviceId,
@@ -146,6 +198,54 @@
}
},
methods: {
+ // 滚动到底部
+ onScrollToLower() {
+ this.startCountdown()
+ },
+ startCountdown() {
+ if(this.intervalId){
+
+ }else{
+ this.intervalId = setInterval(() => {
+ if (this.countdown > 0) {
+ this.countdown--;
+ } else {
+ clearInterval(this.intervalId); // 清除定时器
+ }
+ }, 1000); // 每秒执行一次
+ }
+ },
+ getxieyi(){
+ this.$u.get(`/app/article/licence/mch`).then(res => {
+ if(res.code == 200){
+ this.contwz = res.data.content
+ }
+ })
+ },
+ getuser(){
+ this.$u.get("/app/user/userInfo").then((res) => {
+ if (res.code == 200) {
+ if(res.data.readMchLicence == false){
+ this.xintsflag = true
+ }else{
+ this.xintsflag = false
+ }
+ }
+ })
+ },
+ btnzx(){
+ this.$u.put(`/app/user/readMchLicence`).then((res) => {
+ if (res.code == 200) {
+ uni.reLaunch({
+ url:'/pages/index/index'
+ })
+ // this.getuser()
+ // this.xintsflag = false
+ }
+ })
+ },
+
+
toindex(suitId){
const index = this.isActive.indexOf(suitId);
if (index !== -1) {
@@ -210,48 +310,63 @@
// 点击进行下一步
btnxia(){
if(this.isActive.length == 0){
- uni.showModal({
- title: '提示',
- content: '还未绑定套餐,设备将无法扫码使用,是否继续完成设置?',
- success: function(res) {
- if (res.confirm) {
- this.btnmsk = false
- uni.switchTab({
- url:'/pages/index/index'
- })
- }
- }
+ // uni.showModal({
+ // title: '提示',
+ // content: '还未绑定套餐,请先绑定或创建套餐',
+ // success: function(res) {
+ // if (res.confirm) {
+ // this.btnmsk = false
+ // // uni.switchTab({
+ // // url:'/pages/index/index'
+ // // })
+ // }
+ // }
+ // })
+ uni.showToast({
+ title: '还未绑定套餐,请先绑定或新建套餐',
+ icon: 'none',
+ duration: 3000,
})
}else{
- this.$u.delete(`/app/suit/delByDevice/${this.deviceId}`).then(res => {})
- let numArr = this.isActive.map(item => parseInt(item, 10))
- let data = {
- deviceId: this.id,
- suitIds: numArr
- }
- this.$u.put(`/app/device`, data).then((res) => {
- if (res.code == 200) {
- uni.showToast({
- title: res.msg,
- icon: 'success',
- duration: 1000,
- })
- this.getao()
- setTimeout(() => {
- this.btnmsk = false
- uni.reLaunch({
- url:'/pages/index/index'
- })
- }, 1000)
- }else{
- uni.showToast({
- title: res.msg,
- icon: 'none',
- duration: 1000,
- })
- this.btnmsk = false
- }
- })
+ this.$u.get("/app/user/userInfo").then((res) => {
+ if (res.code == 200) {
+ if(res.data.readMchLicence == false){
+ this.xintsflag = true
+ // this.startCountdown()
+ }else{
+ this.xintsflag = false
+ this.$u.delete(`/app/suit/delByDevice/${this.deviceId}`).then(res => {})
+ let numArr = this.isActive.map(item => parseInt(item, 10))
+ let data = {
+ deviceId: this.id,
+ suitIds: numArr
+ }
+ this.$u.put(`/app/device`, data).then((res) => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: res.msg,
+ icon: 'success',
+ duration: 1000,
+ })
+ this.getao()
+ setTimeout(() => {
+ this.btnmsk = false
+ uni.reLaunch({
+ url:'/pages/index/index'
+ })
+ }, 1000)
+ }else{
+ uni.showToast({
+ title: res.msg,
+ icon: 'none',
+ duration: 1000,
+ })
+ this.btnmsk = false
+ }
+ })
+ }
+ }
+ })
}
},
// 点击wifi进行配网
@@ -528,6 +643,91 @@