提交 d4fbcb4a 编写于 作者: F fancy

热点图片url使用前端拼接

上级 93a71d4f
......@@ -31,16 +31,30 @@ Page({
onShow: function() {
this.loadArticleList(true);
},
// 滚动图片数据请求
loadHotNews: function() {
api.hotPicList().then(list => {
console.log(list);
// url前端拼接
let newList = [];
for (let i = 0; i < list.length; i++) {
let element = list[i];
console.log(element);
element.newUrl = this.hotPicUrl(element.picId);
newList.push(element);
}
console.log(newList);
this.setData({
bannerList: list
bannerList: newList
})
}).catch(err => {
api.o2Error(err)
})
},
// 滚动图片url拼接
hotPicUrl: function(picId) {
return api.hotPicUrl(picId)
},
loadArticleList: function(isRefresh) {
if (this.data.currentTab == 'news') {
this.loadNews(isRefresh);
......
......@@ -9,7 +9,7 @@
<swiper class="banner" autoplay="true" interval="3000" duration="500" bindchange="swiperChange">
<swiper-item wx:for="{{bannerList}}" wx:key="index">
<view class="banner" bindtap="bindTapHotNews" data-index="{{index}}" data-info="{{item.infoId}}" data-application="{{item.application}}">
<image mode="scaleToFill" src="{{item.url}}"></image>
<image mode="scaleToFill" src="{{item.newUrl}}"></image>
<view class="title">{{item.title}}</view>
</view>
</swiper-item>
......
{
"description": "Project configuration file",
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": []
"ignore": [],
"include": []
},
"setting": {
"urlCheck": false,
......@@ -36,37 +37,22 @@
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
"minifyWXSS": true,
"showES6CompileOption": false,
"minifyWXML": true,
"disableUseStrict": false,
"useStaticServer": true,
"useCompilerPlugins": false
},
"compileType": "miniprogram",
"libVersion": "2.12.2",
"appid": "wx5e498e66e2dd900b",
"projectname": "O2OA-Mini",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}
\ No newline at end of file
......@@ -30,12 +30,14 @@ let logout = () => o2Request.delete(o2Request.o2oaOrganizationAuthenticationBase
//热点图片列表 默认取前5条
let hotPicList = () => o2Request.put(o2Request.o2oaHotPicServiceBaseUrl() + '/jaxrs/user/hotpic/filter/list/page/1/count/5', {}, false);
// 热电图片url地址
let hotPicUrl = (picId) => o2Request.o2oaFileServiceBaseUrl() + '/jaxrs/file/'+picId+'/download/stream';
//cms 分页获取文档列表
let cmsDocumentFilterList = (lastId, pageSize, param) => o2Request.put(o2Request.o2oaCmsServiceBaseUrl() + '/jaxrs/document/filter/list/'+lastId+'/next/'+pageSize, param);
//cms 附件下载地址
let cmsAttachementUrl = (attId) => o2Request.o2oaCmsServiceBaseUrl() + '/jaxrs/fileinfo/download/document/'+attId;
/////////////////////流程 //////////////////////////////
// 流程应用
......@@ -110,6 +112,7 @@ module.exports = {
login,
logout,
hotPicList,
hotPicUrl,
cmsDocumentFilterList,
taskList,
taskCompletedList,
......
......@@ -25,7 +25,7 @@ function request(method, url, param, isShowLoading) {
data: res.header['Set-Cookie'],
})
}
console.log('接口:' + url, ' 参数:', param, '\n返回值:', res.data)
// console.log('接口:' + url, ' 参数:', param, '\n返回值:', res.data)
if (isShowLoading) {
wx.hideLoading();
}
......@@ -61,7 +61,7 @@ function setDistribute(distribute) {
if (t === 'tokenName') {
wx.setStorageSync(t, distribute[t] || 'x-token');
} else {
ws.setStorageSync(t, distribute[t] || {});
wx.setStorageSync(t, distribute[t] || {});
}
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册