|
- /**
- * Created by Administrator on 2021/4/5.
- */
- define(['jquery', "template", "Tools", "demandApi", "paging","user"], function ($, template, Tools ) {
- //数据存储
- var module = {
- data: {
- //公告列表
- demandInformationList:'',
- //鉴证列表
- supplyInformationList:'',
- //页码
- pageNum: 1,
- //页码集合
- pageList: [],
- //每页数量
- pageSize: 50,
- //总页数
- pageCount:0,
- //选中卡ID
- clickType:'supply',
- //供求类型 1:供应 2:求购 (不传值获取两种类型混合数据)
- demandType:1
- },
- };
- var tools = new Tools();
-
- module.init = function (page) {
- //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
- tools.getWebConfig();
-
- tools.doGet(userDemandUpdate+'/'+getQueryVariable('id'), {}, module.demandDetail,true);
- };
-
- //获取地址栏参数
- function getQueryVariable(variable){
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i=0;i<vars.length;i++) {
- var pair = vars[i].split("=");
- if(pair[0] == variable){return pair[1];}
- }
- return(false);
- }
- //个人中心用户信息
- module.demandDetail = function(data){
- if (data.code == 200) {
- var content = data.data;
- console.log(content)
- module.data.demandInformationDetail = content;
- tools.doGet(demandImageList+'/'+getQueryVariable('id'), {}, module.demandImageDetail,true);
- }
- }
-
- module.demandImageDetail = function(data){
- console.log(data)
- if (data.code == 200){
- var content = data.data;
- var fileUrlList = [];
- for (var i = 0 ; i < content.length ; i++){
- fileUrlList[i] = serverApi+content[i].fileUrl;
- }
- module.data.demandInformationDetail.fileUrlList = fileUrlList;
- var demandInformationData = template('demandInformationData', module.data);
- $("#demandInformationContent").html(demandInformationData);
- $("#projectContent").html(module.data.demandInformationDetail.projectContent);
- }
- }
- return module;
- });
|