|
@@ -322,15 +322,13 @@ wepy.page({
|
|
|
})
|
|
|
.then((res) => {
|
|
|
console.log('querySpaceFunctionCard', res);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.reSpaceId = 'xxxx';
|
|
|
- this.showCard = {
|
|
|
- openLight: 1,
|
|
|
- raiseTemperature: 2,
|
|
|
- lowerTemperature: 3,
|
|
|
- // oneClickFullClose: 4,
|
|
|
- };
|
|
|
+ if (res.message == '该用户没有常驻空间') {
|
|
|
+ this.reSpaceId = '';
|
|
|
+ this.showCard = {};
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.reSpaceId = res.spaceId || '';
|
|
|
+ this.showCard = res || {};
|
|
|
console.log('showCardshowCard', this.showCard);
|
|
|
|
|
|
//常驻空间参数属性
|
|
@@ -341,8 +339,6 @@ wepy.page({
|
|
|
})
|
|
|
.then((res) => {
|
|
|
console.log('getSpaceProperty', res);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
this.spaceParam = {
|
|
|
hcho: 0,
|
|
|
pm25: 0,
|
|
@@ -350,8 +346,12 @@ wepy.page({
|
|
|
temperature: 0,
|
|
|
humidity: 0,
|
|
|
};
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+
|
|
|
});
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
},
|
|
|
projectClick: function(item) {
|
|
|
//console.log('projectClickprojectClick', item);
|
|
@@ -421,10 +421,9 @@ wepy.page({
|
|
|
{ name: '上格云3' },
|
|
|
];
|
|
|
});
|
|
|
- getWeather()
|
|
|
- .then((res) => {})
|
|
|
- .catch((err) => {
|
|
|
- this.weather = { temperature: 30, text: '云' };
|
|
|
+ getWeather(this.userInfo.projectId)
|
|
|
+ .then((res) => {
|
|
|
+ this.weather = res.content || {}; //{ temperature: 30, text: '云' };
|
|
|
var text = '云';
|
|
|
var imgname = 'sunny.png';
|
|
|
if (text.indexOf('晴') > -1) {
|
|
@@ -442,9 +441,9 @@ wepy.page({
|
|
|
} else if (text.indexOf('雪') > -1) {
|
|
|
imgname = 'snow.png';
|
|
|
}
|
|
|
-
|
|
|
this.weather.imgname = imgname;
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
this.loadData();
|
|
|
},
|
|
|
onShow() {},
|