|
|
@@ -71,8 +71,8 @@
|
|
|
<view class="change-show" @tap="navigateToShow">
|
|
|
台账管理
|
|
|
</view>
|
|
|
- <view class="ad">
|
|
|
- <image src="../static/images/ad_dianfei.jpg" mode="aspectFill" class="ad_img" @tap="ad_redirect"></image>
|
|
|
+ <view v-if="img_url !== ''" class="ad">
|
|
|
+ <image :src="img_url" mode="aspectFill" class="ad_img" @tap="ad_redirect"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -91,7 +91,8 @@
|
|
|
stu_number: '',
|
|
|
compus: '', //校区
|
|
|
ceshi: 'code',
|
|
|
- test: this.$store.state.test
|
|
|
+ test: this.$store.state.test,
|
|
|
+ img_url: ''
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -103,13 +104,58 @@
|
|
|
// return
|
|
|
// }
|
|
|
// 获取基本信息
|
|
|
- this.get_base_info(options, 'onLoad')
|
|
|
+ this.get_base_info(options, 'onLoad');
|
|
|
+ this.get_img();
|
|
|
},
|
|
|
onShow() {
|
|
|
// 获取基本信息
|
|
|
this.get_base_info('options', 'onShow')
|
|
|
},
|
|
|
methods: {
|
|
|
+ async get_img() {
|
|
|
+ let res = await this.$myRequest({
|
|
|
+ host: this.ceshi,
|
|
|
+ url: '/HotWaters/advertquery_h.action',
|
|
|
+ method: 'POST',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded'
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ 'url_name': '水电广告'
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // console.log(res.data)
|
|
|
+ if (res.data.data.length == 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ let tf = false;
|
|
|
+ let tmpData = res.data.data;
|
|
|
+ for (var i = 0; i < tmpData.length; i++) {
|
|
|
+ if (tmpData[i].state == 1 && tmpData[i].remark.indexOf('缩略图') != -1) {
|
|
|
+ this.img_url = tmpData[i].url;
|
|
|
+ tf = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (tf == false) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '没有启用的缩略图',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '加载数据异常',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* 电费详情页面
|
|
|
*/
|
|
|
@@ -117,7 +163,7 @@
|
|
|
if (this.haveSelectRoom()) {
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
uni.navigateTo({
|
|
|
url: '../dfxq/dfxq'
|
|
|
})
|
|
|
@@ -129,7 +175,7 @@
|
|
|
if (this.haveSelectRoom()) {
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
uni.navigateTo({
|
|
|
url: '../sfxq/sfxq'
|
|
|
})
|