广告功能开发完成

This commit is contained in:
wuxw 2020-02-23 17:42:47 +08:00
parent a81d3caabe
commit 4df3c49d63
3 changed files with 17 additions and 14 deletions

View File

@ -4,8 +4,8 @@
* add by wuxw 2019-12-28 * add by wuxw 2019-12-28
*/ */
// 服务器域名 // 服务器域名
//const baseUrl = 'https://app.demo.winqi.cn/'; const baseUrl = 'https://app.demo.winqi.cn/';
const baseUrl = '/'; //const baseUrl = '/';
const hcBaseUrl = 'https://hc.demo.winqi.cn'; // 登录接口 const hcBaseUrl = 'https://hc.demo.winqi.cn'; // 登录接口
const loginUrl = baseUrl + 'app/loginProperty'; const loginUrl = baseUrl + 'app/loginProperty';
@ -50,13 +50,13 @@ const queryFeeByParkingSpace = baseUrl + "app/fee.queryFeeByParkingSpace"; //查
const queryFeeByOwner = baseUrl + "app/fee.queryFee"; //预下单 const queryFeeByOwner = baseUrl + "app/fee.queryFee"; //预下单
const preOrder = baseUrl + "/app/payment/toPay"; //查询小区 const preOrder = baseUrl + "app/payment/toPay"; //查询小区
const listCommunitys = baseUrl + "/app/community.listCommunitys"; //查询小区文化 const listCommunitys = baseUrl + "app/community.listCommunitys"; //查询小区文化
const listActivitiess = baseUrl + "/app/activities.listActivitiess"; //查询小区广告 const listActivitiess = baseUrl + "app/activities.listActivitiess"; //查询小区广告
const listAdvertPhoto = baseUrl + "/app/advert.listAdvertPhoto"; const listAdvertPhoto = baseUrl + "app/advert.listAdvertPhoto";
module.exports = { module.exports = {
baseUrl: baseUrl, baseUrl: baseUrl,
hcBaseUrl: hcBaseUrl, hcBaseUrl: hcBaseUrl,

View File

@ -127,7 +127,7 @@
uni.setStorageSync(_that.java110Constant.mapping.CURRENT_COMMUNITY_INFO, JSON.stringify(_tmpCommunityInfo)); uni.setStorageSync(_that.java110Constant.mapping.CURRENT_COMMUNITY_INFO, JSON.stringify(_tmpCommunityInfo));
_that.currentCommunityId = _tmpCommunityInfo.communityId; _that.currentCommunityId = _tmpCommunityInfo.communityId;
_that.currentCommunityName = _tmpCommunityInfo.name; _that.currentCommunityName = _tmpCommunityInfo.name;
_that._loadAd();
return; return;
} }
let communityId = ''; let communityId = '';
@ -141,6 +141,7 @@
uni.setStorageSync(_that.java110Constant.mapping.CURRENT_COMMUNITY_INFO, JSON.stringify(_tmpCommunityInfo)); uni.setStorageSync(_that.java110Constant.mapping.CURRENT_COMMUNITY_INFO, JSON.stringify(_tmpCommunityInfo));
_that.currentCommunityId = _tmpCommunityInfo.communityId; _that.currentCommunityId = _tmpCommunityInfo.communityId;
_that.currentCommunityName = _tmpCommunityInfo.name; _that.currentCommunityName = _tmpCommunityInfo.name;
_that._loadAd();
return; return;
} }
@ -154,11 +155,11 @@
let _objData = { let _objData = {
page: 1, page: 1,
row: 5, row: 5,
communityId: this.data.communityId communityId: this.currentCommunityId
}; };
context.request({ this.java110Context.request({
url: _that.java110Constant.url.listAdvertPhoto, url: _that.java110Constant.url.listAdvertPhoto,
header: context.getHeaders(), header: _that.java110Context.getHeaders(),
method: "GET", method: "GET",
data: _objData, // data: _objData, //
success: function (res) { success: function (res) {
@ -168,13 +169,15 @@
let _advertPhotos = res.data; let _advertPhotos = res.data;
let _aPhotos = []; let _aPhotos = [];
_advertPhotos.forEach(function (_item) { _advertPhotos.forEach(function (_item) {
_item.type= "type"; _item.type= "image";
_item.url = constant.url.hcBaseUrl + _item.url + "&time=" + new Date(); _item.url = _that.java110Constant.url.hcBaseUrl + _item.url + "&time=" + new Date();
_aPhotos.push(_item); _aPhotos.push(_item);
}); });
_that.swiperList = _aPhotos; _that.swiperList = _aPhotos;
console.log(_that.swiperList);
return; return;
} }
wx.showToast({ wx.showToast({

File diff suppressed because one or more lines are too long