Commit 30eed3cb authored by wildfirecode's avatar wildfirecode

1

parent f2072756
import getSkinPath from "../libs/new_wx/utils/getSkinPath"; import getSkinPath from "../libs/new_wx/utils/getSkinPath";
import getDefaultPic from "./getDefaultPic";
export default class AdminItemRenderer extends eui.ItemRenderer { export default class AdminItemRenderer extends eui.ItemRenderer {
...@@ -27,7 +28,8 @@ export default class AdminItemRenderer extends eui.ItemRenderer { ...@@ -27,7 +28,8 @@ export default class AdminItemRenderer extends eui.ItemRenderer {
} }
loadImg() { loadImg() {
const url = this.data.dreamPic; this.data.dreamPic = this.data.dreamPic || getDefaultPic();
let url = this.data.dreamPic;
const maskRatio = this['imgMask'].width / this['imgMask'].height; const maskRatio = this['imgMask'].width / this['imgMask'].height;
RES.getResByUrl(url, (img: egret.Texture) => { RES.getResByUrl(url, (img: egret.Texture) => {
if (url != this.data.dreamPic) return; if (url != this.data.dreamPic) return;
......
...@@ -2,6 +2,7 @@ import Scene from "../libs/new_wx/components/Scene"; ...@@ -2,6 +2,7 @@ import Scene from "../libs/new_wx/components/Scene";
import PanelCtrl from "../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../libs/new_wx/ctrls/panelCtrl";
import { DataManager } from "../libs/tw/manager/DataManager"; import { DataManager } from "../libs/tw/manager/DataManager";
import setBackBtn from "./setBackBtn"; import setBackBtn from "./setBackBtn";
import getDefaultPic from "./getDefaultPic";
export default class DreamAdminScene extends Scene { export default class DreamAdminScene extends Scene {
list: eui.List; list: eui.List;
...@@ -24,7 +25,7 @@ export default class DreamAdminScene extends Scene { ...@@ -24,7 +25,7 @@ export default class DreamAdminScene extends Scene {
this['addresstxt'].text = yyh_join1_dreamDetail.address.split(',').join('-'); this['addresstxt'].text = yyh_join1_dreamDetail.address.split(',').join('-');
this['title'].text = yyh_join1_dreamDetail.dreamTitle; this['title'].text = yyh_join1_dreamDetail.dreamTitle;
this['content'].text = yyh_join1_dreamDetail.dreamContent; this['content'].text = yyh_join1_dreamDetail.dreamContent;
this.loadImg(yyh_join1_dreamDetail.dreamPic); this.loadImg(yyh_join1_dreamDetail.dreamPic || getDefaultPic());
} }
ontap_btn1() { ontap_btn1() {
......
...@@ -6,6 +6,7 @@ import getsubmitUrl from "./getsubmitUrl"; ...@@ -6,6 +6,7 @@ import getsubmitUrl from "./getsubmitUrl";
import join_1_index from "./interfaces/join_1_index"; import join_1_index from "./interfaces/join_1_index";
import { NetManager } from "../libs/tw/manager/NetManager"; import { NetManager } from "../libs/tw/manager/NetManager";
import setBackBtn from "./setBackBtn"; import setBackBtn from "./setBackBtn";
import getDefaultPic from "./getDefaultPic";
export enum DreamSceneType { export enum DreamSceneType {
IN_PROGRESS=0, IN_PROGRESS=0,
RESUBMIT=1, RESUBMIT=1,
...@@ -37,7 +38,7 @@ export default class DreamScene extends Scene { ...@@ -37,7 +38,7 @@ export default class DreamScene extends Scene {
this['addresstxt'].text = yyh_join1_dreamDetail.address.split(',').join('-'); this['addresstxt'].text = yyh_join1_dreamDetail.address.split(',').join('-');
this['title'].text =yyh_join1_dreamDetail.dreamTitle; this['title'].text =yyh_join1_dreamDetail.dreamTitle;
this['content'].text =yyh_join1_dreamDetail.dreamContent; this['content'].text =yyh_join1_dreamDetail.dreamContent;
this.loadImg(yyh_join1_dreamDetail.dreamPic); this.loadImg(yyh_join1_dreamDetail.dreamPic|| getDefaultPic());
} }
ontap_lab1(){ ontap_lab1(){
......
...@@ -7,6 +7,8 @@ import join_1_index from "./interfaces/join_1_index"; ...@@ -7,6 +7,8 @@ import join_1_index from "./interfaces/join_1_index";
import { getProvince } from "./MyDreamScene"; import { getProvince } from "./MyDreamScene";
import { NetManager } from "../libs/tw/manager/NetManager"; import { NetManager } from "../libs/tw/manager/NetManager";
import setBackBtn from "./setBackBtn"; import setBackBtn from "./setBackBtn";
import getDefaultAvatar from "./getDefaultAvatar";
import getDefaultPic from "./getDefaultPic";
export default class HisDreamScene extends Scene { export default class HisDreamScene extends Scene {
type; type;
...@@ -20,7 +22,7 @@ export default class HisDreamScene extends Scene { ...@@ -20,7 +22,7 @@ export default class HisDreamScene extends Scene {
this['img'].mask = this['imgMask']; this['img'].mask = this['imgMask'];
this['avatarGroup'].visible = 1; this['avatarGroup'].visible = 1;
this['avatar'].source =yyh_join1_dreamDetail.avatar; this['avatar'].source =yyh_join1_dreamDetail.avatar || getDefaultAvatar();
this['from'].text = `来自${getProvince(yyh_join1_dreamDetail.address)}的梦想 编号:${yyh_join1_dreamDetail.id}`; this['from'].text = `来自${getProvince(yyh_join1_dreamDetail.address)}的梦想 编号:${yyh_join1_dreamDetail.id}`;
this['rank'].text = `能量值:${yyh_join1_dreamDetail.energy} 梦想排名:${yyh_join1_dreamDetail.rank}`; this['rank'].text = `能量值:${yyh_join1_dreamDetail.energy} 梦想排名:${yyh_join1_dreamDetail.rank}`;
...@@ -28,7 +30,7 @@ export default class HisDreamScene extends Scene { ...@@ -28,7 +30,7 @@ export default class HisDreamScene extends Scene {
this['content'].text =yyh_join1_dreamDetail.dreamContent; this['content'].text =yyh_join1_dreamDetail.dreamContent;
this.loadImg(yyh_join1_dreamDetail.dreamPic); this.loadImg(yyh_join1_dreamDetail.dreamPic|| getDefaultPic());
this['scroll'].height = this.stage.stageHeight - this['scroll'].y-10; this['scroll'].height = this.stage.stageHeight - this['scroll'].y-10;
......
import getSkinPath from "../libs/new_wx/utils/getSkinPath"; import getSkinPath from "../libs/new_wx/utils/getSkinPath";
import getDefaultPic from "./getDefaultPic";
export default class ListItemRenderer extends eui.ItemRenderer { export default class ListItemRenderer extends eui.ItemRenderer {
...@@ -32,6 +33,7 @@ export default class ListItemRenderer extends eui.ItemRenderer { ...@@ -32,6 +33,7 @@ export default class ListItemRenderer extends eui.ItemRenderer {
} }
loadImg() { loadImg() {
this.data.dreamPic = this.data.dreamPic || getDefaultPic()
const maskRatio = this['imgMask'].width / this['imgMask'].height; const maskRatio = this['imgMask'].width / this['imgMask'].height;
const url = this.data.dreamPic; const url = this.data.dreamPic;
RES.getResByUrl(url, (img: egret.Texture) => { RES.getResByUrl(url, (img: egret.Texture) => {
......
...@@ -3,6 +3,8 @@ import { DataManager } from "../libs/tw/manager/DataManager"; ...@@ -3,6 +3,8 @@ import { DataManager } from "../libs/tw/manager/DataManager";
import gotoShare from "./gotoShare"; import gotoShare from "./gotoShare";
import { getEnergyLimit } from "./datas"; import { getEnergyLimit } from "./datas";
import setBackBtn from "./setBackBtn"; import setBackBtn from "./setBackBtn";
import getDefaultAvatar from "./getDefaultAvatar";
import getDefaultPic from "./getDefaultPic";
export const getProvince = (address:string)=>{ export const getProvince = (address:string)=>{
return address.split(',')[0]; return address.split(',')[0];
}; };
...@@ -16,7 +18,7 @@ export default class MyDreamScene extends Scene { ...@@ -16,7 +18,7 @@ export default class MyDreamScene extends Scene {
this['img'].mask = this['imgMask']; this['img'].mask = this['imgMask'];
this['avatar'].mask = this['avatarMask']; this['avatar'].mask = this['avatarMask'];
this['avatar'].source =yyh_join1_dreamDetail.avatar; this['avatar'].source =yyh_join1_dreamDetail.avatar|| getDefaultAvatar();
this['from'].text = `来自${getProvince(yyh_join1_dreamDetail.address)}的梦想 编号:${yyh_join1_dreamDetail.id}`; this['from'].text = `来自${getProvince(yyh_join1_dreamDetail.address)}的梦想 编号:${yyh_join1_dreamDetail.id}`;
this['rank'].text = `能量值:${yyh_join1_dreamDetail.energy} 梦想排名:${yyh_join1_dreamDetail.rank}`; this['rank'].text = `能量值:${yyh_join1_dreamDetail.energy} 梦想排名:${yyh_join1_dreamDetail.rank}`;
...@@ -26,7 +28,7 @@ export default class MyDreamScene extends Scene { ...@@ -26,7 +28,7 @@ export default class MyDreamScene extends Scene {
this['progress'].mask = this['progressmask']; this['progress'].mask = this['progressmask'];
if(this.stage.stageHeight < 1252) if(this.stage.stageHeight < 1252)
this['scroll'].height = this.stage.stageHeight - this['scroll'].y; this['scroll'].height = this.stage.stageHeight - this['scroll'].y;
this.loadImg(yyh_join1_dreamDetail.dreamPic); this.loadImg(yyh_join1_dreamDetail.dreamPic|| getDefaultPic());
this.setProgress(yyh_join1_dreamDetail); this.setProgress(yyh_join1_dreamDetail);
......
export default ()=>{
return 'https://yun.duiba.com.cn/db_games/yyh_default_avatar.jpg'
}
\ No newline at end of file
export default ()=>{
return 'https://yun.duiba.com.cn/db_games/yyj_default_pic2.jpg'
}
\ No newline at end of file
import { DataManager } from "../libs/tw/manager/DataManager"; import { DataManager } from "../libs/tw/manager/DataManager";
import getDefaultAvatar from "./getDefaultAvatar";
import getDefaultPic from "./getDefaultPic";
export default () => { export default () => {
const { avatar, dreamPic: url, address, id, dreamTitle: title, dreamContent: content } = DataManager.ins.getData('yyh_join1_dreamDetail').data; let { avatar, dreamPic: url, address, id, dreamTitle: title, dreamContent: content } = DataManager.ins.getData('yyh_join1_dreamDetail').data;
// let shareUrl = 'http://yazuwei.activity-1.m.duiba.com.cn/projectx/pa1462f11/fea2bff6f.html'; // let shareUrl = 'http://yazuwei.activity-1.m.duiba.com.cn/projectx/pa1462f11/fea2bff6f.html';
// const prefix = `?avatar=${encodeURIComponent(avatar)}&url=${encodeURIComponent(url)}&address=${address}&id2=${id}&title=${title}&content=${content}`; // const prefix = `?avatar=${encodeURIComponent(avatar)}&url=${encodeURIComponent(url)}&address=${address}&id2=${id}&title=${title}&content=${content}`;
...@@ -10,6 +12,11 @@ export default () => { ...@@ -10,6 +12,11 @@ export default () => {
// shareUrl = 'http://aghzact.zjkczn.com/h5/defaultActive.html?activeUrl=' + encodeURIComponent(shareUrl) // shareUrl = 'http://aghzact.zjkczn.com/h5/defaultActive.html?activeUrl=' + encodeURIComponent(shareUrl)
if (!avatar)
avatar = getDefaultAvatar();
if (!url)
url = getDefaultPic();
let shareUrl = 'http://yazuwei.activity-1.m.duiba.com.cn/projectx/pa1462f11/fea2bff6f.html'; let shareUrl = 'http://yazuwei.activity-1.m.duiba.com.cn/projectx/pa1462f11/fea2bff6f.html';
const prefix = `?avatar=${encodeURIComponent(avatar)}&url=${encodeURIComponent(url)}&address=${encodeURIComponent(address)}&id2=${id}&title=${encodeURIComponent(title)}&content=${encodeURIComponent(content)}`; const prefix = `?avatar=${encodeURIComponent(avatar)}&url=${encodeURIComponent(url)}&address=${encodeURIComponent(address)}&id2=${id}&title=${encodeURIComponent(title)}&content=${encodeURIComponent(content)}`;
......
...@@ -2,6 +2,102 @@ ...@@ -2,6 +2,102 @@
"success": true, "success": true,
"message": "", "message": "",
"code": "", "code": "",
"data": [ "data": [
{
"id":1,
"dreamTitle":"梦想标题",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容",
"dreamPic":"",
"rank":1,
"energy":1000
},
{
"id":2,
"dreamTitle":"梦想标题2",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img1.png",
"rank":2,
"energy":1000
},
{
"id":1,
"dreamTitle":"梦想标题",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img2.jpg",
"rank":1,
"energy":1000
},
{
"id":2,
"dreamTitle":"梦想标题2",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img1.png",
"rank":2,
"energy":1000
},
{
"id":1,
"dreamTitle":"梦想标题",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img2.jpg",
"rank":1,
"energy":1000
},
{
"id":2,
"dreamTitle":"梦想标题2",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img1.png",
"rank":2,
"energy":1000
},
{
"id":1,
"dreamTitle":"梦想标题",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img2.jpg",
"rank":1,
"energy":1000
},
{
"id":2,
"dreamTitle":"梦想标题2",
"name":"姓名",
"tel":"13711111111",
"idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img1.png",
"rank":2,
"energy":1000
}
] ]
} }
\ No newline at end of file
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"address": "天津,河东区,大直沽街道", "address": "天津,河东区,大直沽街道",
"assist": 0, "assist": 0,
"assistItemId": 208, "assistItemId": 208,
"avatar": null, "avatar": "",
"consumerId": "500208012", "consumerId": "500208012",
"dreamContent": "test content2", "dreamContent": "test content2",
"dreamPic": "http://yun.duiba.com.cn/duibaimage/1574660334863500208012.png", "dreamPic": "",
"dreamStatus": "1", "dreamStatus": "1",
"dreamTitle": "testtitle2", "dreamTitle": "testtitle2",
"energy": 2, "energy": 2,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"idNumber":"333333333333333333", "idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区", "address":"浙江省,杭州市,上城区",
"dreamContent":"梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容", "dreamContent":"梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img2.jpg", "dreamPic":"",
"rank":1, "rank":1,
"energy":1000 "energy":1000
}, },
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"idNumber":"333333333333333333", "idNumber":"333333333333333333",
"address":"浙江省,杭州市,上城区44", "address":"浙江省,杭州市,上城区44",
"dreamContent":"梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容", "dreamContent":"梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容梦想内容",
"dreamPic":"http://yun.duiba.com.cn/db_games/img2.jpg", "dreamPic":"",
"rank":1, "rank":1,
"energy":1000 "energy":1000
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment