...
 
Commits (2)
    https://gitcode.net/O2OA/o2oa-mini-program/-/commit/d4fbcb4a2b795fbd0f9470b9ed8c53f275cf4e3f 热点图片url使用前端拼接 2022-06-18T13:43:28+08:00 fancy fancylou@outlook.com https://gitcode.net/O2OA/o2oa-mini-program/-/commit/bc2fb7c7c10a3f44bf427689a06c9de57fe8e64c 工具更新 2022-06-23T10:00:09+08:00 fancy fancylou@outlook.com
......@@ -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",
"packOptions": {
"ignore": []
},
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"setting": {
"urlCheck": false,
"es6": true,
"enhance": false,
"urlCheck": true,
"es6": false,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
......@@ -22,8 +19,6 @@
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
......@@ -36,37 +31,28 @@
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
"minifyWXSS": true,
"showES6CompileOption": false,
"minifyWXML": true,
"disableUseStrict": false,
"useStaticServer": true,
"useCompilerPlugins": false,
"lazyloadPlaceholderEnable": false,
"ignoreUploadUnusedFiles": true
},
"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
},
"libVersion": "2.24.5",
"packOptions": {
"ignore": [],
"include": []
}
}
\ No newline at end of file
{
"setting": {
"urlCheck": false
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
}
\ 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] || {});
}
});
}
......