mainlist.js 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. import constant1 from '../../utils/constant';
  4. const app = getApp();
  5. var intervalRefresh = 0;
  6. var isCollecting = false;
  7. var canPress = true; //按钮按下有反应
  8. var arrOrder=constant1.arrListOrder;
  9. Page({
  10. data: {
  11. ImagePath: app.globalData.uploadImageUrl,
  12. IsShowCardShowDetail: false, //显示题卡显示细节
  13. IsShowSelectContainer:false,//显示多选其它菜单
  14. SelectContainerStyle:0,//多选按钮的样式模版
  15. IsFolderListContainer:0,//卡单列表选择页面
  16. IsHelp: false,
  17. IsFilter:false,
  18. ShowMultiple:0,//显示多选,0为不显示,2为卡单,3为星标,4为归档,5为日常,6为紧急,8为搜索,-1为全部
  19. HasPage: false, //有没有分页
  20. CardTypeStr: "全部",
  21. IsShowSelectCardType: false, //是否显示选择题卡模式
  22. ArrOrder: arrOrder, //可选择的排序数组
  23. OrderType: 2, //选择的排序类型
  24. CardType: 2, //练习模式类型,缺省为日常+紧急
  25. PrintID: 0, //打印ID
  26. CardShowDetail: 0, //0 创建时间 1 修改时间 2到期时间 3练习时间 4练习次数
  27. FolderListCss:"",//卡单时列表样式
  28. HasNullImage:0,//有没有未上传成功的空图
  29. SelectedCount:0,//多选的题卡数
  30. IsIPhoneX: app.globalData.IsIPhoneX,
  31. CanScroll:true,
  32. },
  33. onLoad: function (options) {
  34. var that = this;
  35. var Search = "",
  36. IsToday = 0,
  37. IsCollect = 0;
  38. var count = 0; //列表数
  39. if (options.Count)
  40. count = options.Count;
  41. if (options.source=="health"){
  42. that.setData({
  43. Source:options.source,
  44. });
  45. wx.setNavigationBarTitle({
  46. title: options.dataType
  47. });
  48. if (options.dataType == "最近练完") {
  49. that.gotoList({currentTarget:{dataset:{type:"today"}}});
  50. IsToday = 2;
  51. }
  52. else if (options.dataType == "已到期") {
  53. that.gotoList({currentTarget:{dataset:{type:"limit0"}}});
  54. IsToday = 4;
  55. that.setData({
  56. CardShowDetail: 2,
  57. });
  58. }
  59. else if (options.dataType == "答题时间极短") {
  60. that.gotoList({currentTarget:{dataset:{type:"TimeShort7"}}});
  61. IsToday = 5;
  62. that.setData({
  63. CardShowDetail: 3,
  64. });
  65. }
  66. else if (options.dataType == "多次点蓝") {
  67. that.gotoList({currentTarget:{dataset:{type:"ClickBlue7"}}});
  68. IsToday = 6;
  69. that.setData({
  70. CardShowDetail: 3,
  71. });
  72. }
  73. else if (options.dataType == "多次搁置") {
  74. that.gotoList({currentTarget:{dataset:{type:"ClickShelve7"}}});
  75. IsToday = 7;
  76. that.setData({
  77. CardShowDetail: 3,
  78. });
  79. }
  80. }
  81. //如果是搜索
  82. else if (options.search) {
  83. Search = options.search;
  84. wx.setNavigationBarTitle({
  85. title: "搜索结果"
  86. });
  87. that.setData({
  88. ShowMultiple:8,
  89. });
  90. } else if (options.type == 1) { //未练完的情况
  91. IsToday = 1;
  92. that.setOrderSelect(5);
  93. that.setData({
  94. CardShowDetail: 2,
  95. });
  96. wx.setNavigationBarTitle({
  97. title: "未练完的题卡"
  98. });
  99. } else if (options.type == 2) { //练完的情况
  100. IsToday = 2;
  101. that.setOrderSelect(1);
  102. that.setData({
  103. CardShowDetail: 3,
  104. });
  105. wx.setNavigationBarTitle({
  106. title: "练完的题卡"
  107. });
  108. } else if (options.IsCollect == 1) { //星标的情况(也就是原来的收藏夹)
  109. wx.setNavigationBarTitle({
  110. title: "星标"
  111. });
  112. IsCollect = 1;
  113. that.setData({
  114. IsCollect: IsCollect, //是否是星标
  115. ShowMultiple:3,
  116. });
  117. } else if (options.PrintID) { //打印题卡情况
  118. wx.setNavigationBarTitle({
  119. title: "打印卷题卡清单"
  120. });
  121. that.setData({
  122. PrintID: options.PrintID,
  123. });
  124. console.log("options.PrintUserID:"+options.PrintUserID);
  125. console.log("app.globalData.userInfo.UserID:"+app.globalData.userInfo.UserID);
  126. if (options.PrintUserID!=app.globalData.userInfo.UserID){
  127. wx.showModal({
  128. title: '提醒',
  129. showCancel: false,
  130. content: '此打印卷非您微信号生成,请扫描您生成的打印卷查看答案!',
  131. confirmText: '知道了',
  132. success(res) {
  133. if (res.confirm) {
  134. wx.navigateBack({
  135. delta: 1,
  136. });
  137. }
  138. }
  139. });
  140. }
  141. else{
  142. that.getPrintList();
  143. }
  144. } else if (options.FolderID) { //卡单题卡情况
  145. wx.setNavigationBarTitle({
  146. title: "卡单"
  147. });
  148. that.setData({
  149. FolderID: options.FolderID,
  150. FolderName:options.Name,
  151. IconName:options.IconName,
  152. ColorName:options.ColorName,
  153. FolderListCss:"CellHide00",
  154. ShowMultiple:options.FolderID,
  155. });
  156. } else if (options.CardType != 2) { //如果不是日常+紧急
  157. var title = "";
  158. if (options.CardType==0){
  159. title = "日常题卡";
  160. that.setData({
  161. ShowMultiple:5,
  162. });
  163. } else if (options.CardType == 1) {
  164. title = "紧急题卡";
  165. that.setData({
  166. ShowMultiple:6,
  167. });
  168. } else if (options.CardType == -1) {
  169. title = "归档";
  170. that.setData({
  171. ShowMultiple:4,
  172. });
  173. that.setOrderSelect(10);
  174. that.setData({
  175. CardShowDetail: 2,
  176. });
  177. } else if (options.CardType == -2) {
  178. title = "回收";
  179. that.setOrderSelect(10);
  180. that.setData({
  181. CardShowDetail: 2,
  182. });
  183. }
  184. wx.setNavigationBarTitle({
  185. title: title,
  186. });
  187. that.setData({
  188. CardType: options.CardType,
  189. });
  190. }
  191. else if (options.CardType == 2){
  192. that.setData({
  193. CardType: options.CardType,
  194. ShowMultiple:-1,
  195. });
  196. }
  197. that.setData({
  198. Search: Search, //搜索关键词
  199. IsToday: IsToday, //是否是今天任务
  200. Count: count, //列表数
  201. Containnerheight: main.getWindowHeight(),
  202. PageType: options.type, //列表类型,1 今天未练完 2 今天已经练完
  203. IsNew: options.IsNew, //
  204. });
  205. canPress = true;
  206. },
  207. onShow: function () {
  208. var that = this;
  209. if (!that.data.PrintID) {
  210. if (that.data.IsNew) //目前用于年度报告
  211. that.onOrder({
  212. currentTarget: {
  213. dataset: {
  214. value: 4
  215. }
  216. }
  217. });
  218. else
  219. that.getList();
  220. }
  221. //题卡主题色
  222. var arrColorIndex = wx.getStorageSync("ColorIndexArr");
  223. if (!arrColorIndex) {
  224. app.globalData.ColorIndex = common.random(1, 4);
  225. } else {
  226. app.globalData.ColorIndex = arrColorIndex[common.random(0, arrColorIndex.length - 1)];
  227. }
  228. that.getFilter();
  229. if (that.data.FolderID && app.globalData.TempStr){
  230. that.setData({
  231. FolderName:app.globalData.TempStr.Name,
  232. IconName:app.globalData.TempStr.IconName,
  233. ColorName:app.globalData.TempStr.ColorName,
  234. FolderListCss:"CellHide00",
  235. });
  236. app.globalData.TempStr="";
  237. }
  238. if (wx.getStorageSync("TempCardNoSaved")) {
  239. wx.navigateTo({
  240. url: '../other/recover',
  241. });
  242. }
  243. },
  244. getList: function () {
  245. var that = this;
  246. var list = app.globalData.CardList;
  247. var len = 16;
  248. for (var i = 0; i < list.length; i++) {
  249. var item = list[i];
  250. item.ScrollLeft = 0;
  251. item.DeleteType = 0;
  252. item.Content[1].ContentStr = main.replaceCardInfoString(item.Content[1].Content);
  253. if (item.Content[1].ContentStr.length > len)
  254. item.Content[1].ContentStr = main.replaceCardInfoString(item.Content[1].ContentStr.substr(0, len)) + "...";
  255. if (item.Content[1].ContentStr){
  256. item.Content[1].ContentStr=item.Content[1].ContentStr.replace("[特]","");
  257. item.Content[1].ContentStr=item.Content[1].ContentStr.replace("[/特]","");
  258. }
  259. item.Content[2].ContentStr = main.replaceCardInfoString(item.Content[2].Content);
  260. if (item.Content[2].ContentStr.length > len)
  261. item.Content[2].ContentStr = main.replaceCardInfoString(item.Content[2].ContentStr.substr(0, len)) + "...";
  262. if (item.Content[2].ContentStr){
  263. item.Content[2].ContentStr=item.Content[2].ContentStr.replace("[特]","");
  264. item.Content[2].ContentStr=item.Content[2].ContentStr.replace("[/特]","");
  265. }
  266. var imageUrl = getImage(item.Content[1].Content);
  267. if (imageUrl.length == 0 && item.Content[2].Content)
  268. imageUrl = getImage(item.Content[2].Content);
  269. if (imageUrl.length == 0 && item.Content[3].Content)
  270. imageUrl = getImage(item.Content[3].Content);
  271. if (imageUrl.length > 0) {
  272. item.ImageUrlTemp = main.getTempImage(imageUrl);
  273. item.ImageUrlServer = imageUrl;
  274. }
  275. if (item.FirstTime < "1900-01-02")
  276. item.CardCategory = "新题卡";
  277. else
  278. item.CardCategory = "旧题卡";
  279. if (that.data.PrintID){
  280. item.CardShowDetailStr2=item.Number;
  281. }
  282. else if (that.data.CardType == "-2") {
  283. item.CardShowDetailStr2 = common.formatDateCHS(item.DeleteTime);
  284. } else {
  285. switch (Number(that.data.CardShowDetail)) {
  286. case 0:
  287. item.CardShowDetailStr2 = common.formatDateCHS(item.CreateTime);
  288. break;
  289. case 1:
  290. item.CardShowDetailStr2 = common.formatDateCHS(item.UpdateTime);
  291. break;
  292. case 2:
  293. if (that.data.CardType==2 && item.CardType == -1){
  294. item.CardShowDetailStr2 = "不适用";
  295. }
  296. else if (item.CardType == -1)
  297. item.CardShowDetailStr2 = common.formatDateCHS(item.PigeonholeTime);
  298. else
  299. item.CardShowDetailStr2 = common.formatDateCHS(item.LimitTime);
  300. break;
  301. case 3:
  302. if (item.LastTime < "1900-01-02")
  303. item.CardShowDetailStr2 = "不适用";
  304. else
  305. item.CardShowDetailStr2 = common.formatDateCHS(item.LastTime);
  306. break;
  307. case 4:
  308. item.CardShowDetailStr2 = item.LearnNumber + "次";
  309. break;
  310. }
  311. }
  312. item.CardTypeStr = constant1.arrStudyPattern[item.CardType];
  313. }
  314. if (!that.data.IsToday && !that.data.PrintID && !that.data.Search && that.data.CardType != "-2" && !that.data.FolderID && !that.data.Source) {
  315. main.getData("GetUserCardCount?UserID=" + app.globalData.userInfo.UserID + "&CardType=" + that.data.CardType + "&IsCollect=" + that.data.IsCollect+"&OrderType="+that.data.OrderType, function (data) {
  316. if (data) {
  317. that.setData({
  318. Count: data.CardNumber,
  319. });
  320. var hasPage = false;
  321. if (list.length < that.data.Count && list.length >= 20 && that.data.IsToday == 0)
  322. hasPage = true;
  323. that.setData({
  324. List: list,
  325. HasPage: hasPage,
  326. });
  327. if (that.data.PageType === "3") {
  328. wx.redirectTo({
  329. url: './preview?type=show&id=' + list[0].MiaoguoCardID,
  330. })
  331. }
  332. }
  333. });
  334. } else if (that.data.Search || that.data.FolderID > 0 || that.data.Source) {
  335. var hasPage = false;
  336. if (list.length < that.data.Count)
  337. hasPage = true;
  338. that.setData({
  339. List: list,
  340. HasPage: hasPage,
  341. });
  342. } else if (that.data.CardType != -2 && !that.data.Source) {
  343. that.setData({
  344. Count: list.length,
  345. });
  346. var hasPage = false;
  347. if (list.length < that.data.Count && that.data.IsToday == 0)
  348. hasPage = true;
  349. that.setData({
  350. List: list,
  351. HasPage: hasPage,
  352. });
  353. } else {
  354. that.setData({
  355. List: list,
  356. HasNullImage:0,
  357. });
  358. }
  359. var strCardShowDetail = constant1.arrCardShowDetail[that.data.CardShowDetail];
  360. if (that.data.CardShowDetail == 2 && that.data.CardType == -1)
  361. strCardShowDetail = "归档";
  362. else if (that.data.CardType == -2)
  363. strCardShowDetail = "删除";
  364. else if (that.data.PrintID)
  365. strCardShowDetail = "打印卷序号";
  366. that.setData({
  367. CardShowDetailStr: strCardShowDetail,
  368. });
  369. wx.hideLoading();
  370. function getImage(str) {
  371. var result = "";
  372. if (str.indexOf("[图") >= 0) {
  373. result = str.substring(str.indexOf("[图") + 3, str.indexOf("[/图]"));
  374. result = result.substring(result.indexOf("]") + 1);
  375. }
  376. //console.log(result);
  377. return result;
  378. }
  379. },
  380. getNullImageList:function(){
  381. var that=this;
  382. var list=that.data.List;
  383. var arr=[];
  384. var count=0;
  385. for(var i=0;i<list.length;i++){
  386. if (list[i].IsNullImage){
  387. arr.push(list[i]);
  388. count++;
  389. }
  390. }
  391. app.globalData.CardList=arr;
  392. that.setData({
  393. List:arr,
  394. Count:count,
  395. HasPage:false,
  396. HasNullImage:2,
  397. });
  398. wx.setNavigationBarTitle({
  399. title: "遗失图片的题卡"
  400. });
  401. },
  402. onPreview: function (e) {
  403. var id = e.currentTarget.dataset.id;
  404. var url='./preview?type=show&id=' + id;
  405. if (this.data.PrintID)
  406. url+="&PrintID="+this.data.PrintID;
  407. wx.navigateTo({
  408. url: url,
  409. })
  410. },
  411. onBindError: function (e) {
  412. var that = this;
  413. var id = e.currentTarget.dataset.id;
  414. var serverUrl = e.currentTarget.dataset.serverurl;
  415. wx.downloadFile({
  416. url: serverUrl,
  417. success(res) {
  418. if (res.statusCode === 200) {
  419. main.saveTempImage(serverUrl, res.tempFilePath);
  420. }
  421. else{
  422. var list=that.data.List;
  423. for(var i=0;i<list.length;i++){
  424. if (list[i].MiaoguoCardID==id)
  425. list[i].IsNullImage=true;
  426. }
  427. that.setData({
  428. HasNullImage:1,
  429. List:list,
  430. });
  431. wx.pageScrollTo({
  432. scrollTop: 0,
  433. });
  434. }
  435. }
  436. });
  437. },
  438. gotoNextPage: function (e) {
  439. wx.showLoading({
  440. title: '请稍候',
  441. });
  442. setTimeout(function () {
  443. wx.hideLoading();
  444. }, 5000);
  445. var that = this;
  446. var url = 'GetMiaoguoCardList2?UserID=' + app.globalData.userInfo.UserID;
  447. var id = e.currentTarget.dataset.id;
  448. if (id && id > 0)
  449. url += "&PageID=" + id;
  450. if (e.currentTarget.dataset.IsToday)
  451. url += "&IsToday="+e.currentTarget.dataset.IsToday;
  452. var cardtype = e.currentTarget.dataset.cardtype;
  453. if (cardtype || cardtype == "0") {
  454. url += "&CardType=" + cardtype;
  455. var str = constant1.arrStudyPattern[cardtype];
  456. if (cardtype == "2")
  457. str = "全部";
  458. that.setData({
  459. CardType: Number(cardtype),
  460. CardTypeStr: str,
  461. })
  462. } else {
  463. if (that.data.CardType || that.data.CardType==0)
  464. url += "&CardType=" + that.data.CardType;
  465. }
  466. if (that.data.Search)
  467. url += "&Key=" + that.data.Search;
  468. var orderType = that.data.OrderType;
  469. if (orderType)
  470. url += "&OrderType=" + arrOrder[orderType].Value;
  471. if (e.currentTarget.dataset.iscollect == 1)
  472. url += "&IsCollect=1";
  473. if (e.currentTarget.dataset.folderid)
  474. url += "&FolderID="+e.currentTarget.dataset.folderid;
  475. if (e.currentTarget.dataset.dayNumber)
  476. url += "&DayNumber="+e.currentTarget.dataset.dayNumber;
  477. main.getData(url, function (data) {
  478. if (data) {
  479. var list = app.globalData.CardList;
  480. if (id == 0) {
  481. list = [];
  482. that.setData({
  483. Count: data.Count,
  484. });
  485. }
  486. for (var i = 0; i < data.List.length; i++) {
  487. data.List[i].LastTimeStr = common.formatDateCHS(data.List[i].LastTime);
  488. list.push(data.List[i]);
  489. }
  490. app.globalData.CardList = list;
  491. that.getList();
  492. if (data.List.length < 20) {
  493. that.setData({
  494. HasPage: false,
  495. });
  496. }
  497. that.getFilter();
  498. if (that.data.Source=="health"){
  499. setTimeout(function(){
  500. that.setBtnInfo(e.currentTarget.dataset.datatype,data.Count);
  501. },500);
  502. }
  503. }
  504. });
  505. that.setData({
  506. IsOrder: false,
  507. IsHelp: false,
  508. IsShowSelectCardType: false,
  509. });
  510. },
  511. getPrintList: function (e) {
  512. wx.showLoading({
  513. title: '请稍候',
  514. });
  515. setTimeout(function () {
  516. wx.hideLoading();
  517. }, 5000);
  518. var that = this;
  519. var url = 'GetMiaoguoCardList2?UserID=' + app.globalData.userInfo.UserID + '&PrintID=' + that.data.PrintID;
  520. main.getData(url, function (data) {
  521. if (data) {
  522. if (data.List.length > 0) {
  523. var list = [];
  524. for (var i = 0; i < data.List.length; i++) {
  525. data.List[i].Number = i + 1;
  526. list.push(data.List[i]);
  527. }
  528. app.globalData.CardList = list;
  529. that.getList();
  530. wx.setNavigationBarColor({
  531. frontColor: "#000000",
  532. backgroundColor: "#ffffff",
  533. });
  534. } else {
  535. that.onSearch();
  536. }
  537. }
  538. });
  539. },
  540. getFilter:function(){
  541. var that = this;
  542. if (app.globalData.TempStr2){
  543. if (that.data.Count<=1)
  544. isFilter=false;
  545. else{
  546. var arr=[["全部",0,"",2,0],["",0,"",0,0]];
  547. var isFilter=false;
  548. var str=app.globalData.TempStr2;
  549. if (str.indexOf("IsCollect=1")>=0){
  550. arr[1][0]="星标";
  551. arr[1][3]=0;
  552. arr[1][4]=1;
  553. isFilter=true;
  554. }
  555. else if (str.indexOf("CardType=0")>=0){
  556. arr[1][0]="日常";
  557. arr[1][3]=0;
  558. arr[1][4]=0;
  559. isFilter=true;
  560. }
  561. else if (str.indexOf("CardType=1")>=0){
  562. arr[1][0]="紧急";
  563. arr[1][3]=1;
  564. arr[1][4]=0;
  565. isFilter=true;
  566. }
  567. else if (str.indexOf("CardType=-1")>=0){
  568. arr[1][0]="归档";
  569. arr[1][3]=-1;
  570. arr[1][4]=0;
  571. isFilter=true;
  572. }
  573. if (that.data.CardType==2){
  574. arr[0][1]=that.data.Count;
  575. arr[0][2]="panelTop40";
  576. }
  577. else{
  578. arr[1][1]=that.data.Count;
  579. arr[1][2]="panelTop40";
  580. arr[0][2]="";
  581. }
  582. //console.log("CardType:"+that.data.CardType);
  583. that.setData({
  584. FilterArr:arr,
  585. });
  586. }
  587. that.setData({
  588. IsFilter:isFilter,
  589. });
  590. }
  591. },
  592. addCard: function () {
  593. //console.log("canPress:"+canPress);
  594. if (canPress) {
  595. var url='./add?type=add&id=0';
  596. if (this.data.FolderID){
  597. url+="&FolderID="+this.data.FolderID+"&FolderName="+this.data.FolderName;
  598. }
  599. else{
  600. var cardtype=this.data.CardType;
  601. if (cardtype==1 || cardtype==-1){
  602. url+="&CardType="+cardtype;
  603. }
  604. }
  605. wx.redirectTo({
  606. url: url,
  607. });
  608. canPress = false;
  609. //console.log("canPress:"+canPress);
  610. setTimeout(function () {
  611. canPress = true;
  612. //console.log("canPress:"+canPress);
  613. }, 2000);
  614. }
  615. },
  616. onSearch: function (e) {
  617. var id=1;
  618. if (e.currentTarget.dataset.id)
  619. id=Number(e.currentTarget.dataset.id);
  620. wx.navigateBack({
  621. delta: id,
  622. });
  623. },
  624. onOrder: function (e) {
  625. var that = this;
  626. var value = e.currentTarget.dataset.value;
  627. switch (Number(value)) {
  628. case 1:
  629. that.data.CardShowDetail = 3;
  630. break;
  631. case 2:
  632. that.data.CardShowDetail = 1;
  633. break;
  634. case 3:
  635. case 4:
  636. that.data.CardShowDetail = 0;
  637. break;
  638. case 5:
  639. case 6:
  640. that.data.CardShowDetail = 2;
  641. break;
  642. case 7:
  643. case 8:
  644. that.data.CardShowDetail = 4;
  645. break;
  646. case 9:
  647. case 10:
  648. that.data.CardShowDetail = 2;
  649. break;
  650. }
  651. for (var i = 0; i < that.data.ArrOrder.length; i++) {
  652. if (i == value) {
  653. that.data.ArrOrder[i].CSS = "PanelBtnSelect2";
  654. } else
  655. that.data.ArrOrder[i].CSS = "";
  656. }
  657. that.setData({
  658. IsOrder: false,
  659. ArrOrder: that.data.ArrOrder,
  660. OrderType: value,
  661. CardShowDetail: that.data.CardShowDetail,
  662. });
  663. if (that.data.IsToday!=1) {
  664. app.globalData.CardList = [];
  665. that.gotoNextPage({
  666. currentTarget: {
  667. dataset: {
  668. id: 0,
  669. IsToday:that.data.IsToday,
  670. OrderType: value,
  671. cardtype: that.data.CardType,
  672. iscollect: that.data.IsCollect,
  673. folderid: that.data.FolderID,
  674. }
  675. }
  676. });
  677. }
  678. },
  679. gotoList:function(e){
  680. var that=this;
  681. var datatype=e.currentTarget.dataset.type;
  682. var isToday=0,cardType=2,isCollect=0,folderID=0,dayNumber=7;
  683. if (datatype=="today"){
  684. isToday=2;
  685. }
  686. else if (datatype=="yesterday"){
  687. isToday=3;
  688. }
  689. else if (datatype=="limit0"){
  690. cardType=0;
  691. isToday=4;
  692. that.setData({
  693. OrderType:5,
  694. });
  695. }
  696. else if (datatype=="limit1"){
  697. cardType=1;
  698. isToday=4;
  699. that.setData({
  700. OrderType:5,
  701. });
  702. }
  703. else{
  704. if (datatype && datatype.indexOf("7")>0)
  705. dayNumber=7;
  706. else if (datatype && datatype.indexOf("30")>0)
  707. dayNumber=30;
  708. if (datatype.indexOf("TimeShort")>=0)
  709. isToday=5;
  710. else if (datatype.indexOf("ClickBlue")>=0)
  711. isToday=6;
  712. else if (datatype.indexOf("ClickShelve")>=0)
  713. isToday=7;
  714. cardType=2;
  715. that.setData({
  716. OrderType:0,
  717. });
  718. }
  719. app.globalData.CardList = [];
  720. that.gotoNextPage({
  721. currentTarget: {
  722. dataset: {
  723. id: 0,
  724. IsToday:isToday,
  725. cardtype: cardType,
  726. iscollect: isCollect,
  727. folderid: folderID,
  728. datatype:datatype,
  729. dayNumber:dayNumber,
  730. }
  731. }
  732. });
  733. },
  734. setBtnInfo:function(datatype,count){
  735. var that=this;
  736. if (datatype=="today"){
  737. that.setData({
  738. Btn1Name:"今日",
  739. Btn1Type:"today",
  740. Btn2Name:"上次",
  741. Btn2Type:"yesterday",
  742. Btn1Count: count,
  743. Btn2Count: "",
  744. Btn1Class: "btn2",
  745. Btn2Class: "",
  746. CardShowDetail: 3,
  747. HasPage: false,
  748. });
  749. }
  750. else if (datatype=="yesterday"){
  751. that.setData({
  752. Btn1Name:"今日",
  753. Btn1Type:"today",
  754. Btn2Name:"上次",
  755. Btn2Type:"yesterday",
  756. Btn1Count: "",
  757. Btn2Count: count,
  758. Btn1Class: "",
  759. Btn2Class: "btn2",
  760. CardShowDetail: 3,
  761. HasPage: false,
  762. });
  763. }
  764. else if (datatype=="limit0"){
  765. that.setData({
  766. Btn1Name:"日常",
  767. Btn1Type:"limit0",
  768. Btn2Name:"紧急",
  769. Btn2Type:"limit1",
  770. Btn1Count: count,
  771. Btn2Count: "",
  772. Btn1Class: "btn2",
  773. Btn2Class: "",
  774. CardShowDetail: 2,
  775. });
  776. }
  777. else if (datatype=="limit1"){
  778. that.setData({
  779. Btn1Name:"日常",
  780. Btn1Type:"limit0",
  781. Btn2Name:"紧急",
  782. Btn2Type:"limit1",
  783. Btn1Count: "",
  784. Btn2Count: count,
  785. Btn1Class: "",
  786. Btn2Class: "btn2",
  787. CardShowDetail: 2,
  788. });
  789. }
  790. else if (datatype=="TimeShort7"){
  791. that.setData({
  792. Btn1Name:"近7天",
  793. Btn1Type:"TimeShort7",
  794. Btn2Name:"近30天",
  795. Btn2Type:"TimeShort30",
  796. Btn1Count: count,
  797. Btn2Count: "",
  798. Btn1Class: "btn2",
  799. Btn2Class: "",
  800. CardShowDetail: 3,
  801. });
  802. }
  803. else if (datatype=="TimeShort30"){
  804. that.setData({
  805. Btn1Name:"近7天",
  806. Btn1Type:"TimeShort7",
  807. Btn2Name:"近30天",
  808. Btn2Type:"TimeShort30",
  809. Btn1Count: "",
  810. Btn2Count: count,
  811. Btn1Class: "",
  812. Btn2Class: "btn2",
  813. CardShowDetail: 3,
  814. });
  815. }
  816. else if (datatype=="ClickBlue7"){
  817. that.setData({
  818. Btn1Name:"近7天",
  819. Btn1Type:"ClickBlue7",
  820. Btn2Name:"近30天",
  821. Btn2Type:"ClickBlue30",
  822. Btn1Count: count,
  823. Btn2Count: "",
  824. Btn1Class: "btn2",
  825. Btn2Class: "",
  826. CardShowDetail: 3,
  827. });
  828. }
  829. else if (datatype=="ClickBlue30"){
  830. that.setData({
  831. Btn1Name:"近7天",
  832. Btn1Type:"ClickBlue7",
  833. Btn2Name:"近30天",
  834. Btn2Type:"ClickBlue30",
  835. Btn1Count: "",
  836. Btn2Count: count,
  837. Btn1Class: "",
  838. Btn2Class: "btn2",
  839. CardShowDetail: 3,
  840. });
  841. }
  842. else if (datatype=="ClickShelve7"){
  843. that.setData({
  844. Btn1Name:"近7天",
  845. Btn1Type:"ClickShelve7",
  846. Btn2Name:"近30天",
  847. Btn2Type:"ClickShelve30",
  848. Btn1Count: count,
  849. Btn2Count: "",
  850. Btn1Class: "btn2",
  851. Btn2Class: "",
  852. CardShowDetail: 3,
  853. });
  854. }
  855. else if (datatype=="ClickShelve30"){
  856. that.setData({
  857. Btn1Name:"近7天",
  858. Btn1Type:"ClickShelve7",
  859. Btn2Name:"近30天",
  860. Btn2Type:"ClickShelve30",
  861. Btn1Count: "",
  862. Btn2Count: count,
  863. Btn1Class: "",
  864. Btn2Class: "btn2",
  865. CardShowDetail: 3,
  866. });
  867. }
  868. },
  869. showOrder: function () {
  870. this.setData({
  871. IsOrder: true,
  872. });
  873. },
  874. closeHelp: function () {
  875. this.setData({
  876. IsOrder: false,
  877. IsHelp: false,
  878. IsShowSelectCardType: false,
  879. });
  880. },
  881. DeleteItem: function (e) {
  882. var that = this;
  883. var id = e.currentTarget.dataset.id;
  884. var list = this.data.List;
  885. var b = true;
  886. for (var i = 0; i < list.length; i++) {
  887. var item = list[i];
  888. if (id == item.MiaoguoCardID) {
  889. if (item.DeleteType == 0) {
  890. item.ScrollLeft = 440;
  891. item.DeleteType = 1;
  892. } else if (item.DeleteType == 1) {
  893. b = false;
  894. item.DeleteType = 0;
  895. item.ScrollLeft = 0;
  896. var url = 'DeleteMiaoguoCard?UserID=' + app.globalData.userInfo.UserID;
  897. url += "&ID=" + id;
  898. main.getData(url, function (data) {
  899. var list = app.globalData.CardList;
  900. for (var i = 0; i < list.length; i++) {
  901. if (id == list[i].MiaoguoCardID) {
  902. list.splice(i, 1);
  903. break;
  904. }
  905. }
  906. app.globalData.CardList = list;
  907. that.setData({
  908. List: list,
  909. Count: --that.data.Count,
  910. });
  911. });
  912. }
  913. } else {
  914. item.DeleteType = 0;
  915. item.ScrollLeft = 0;
  916. }
  917. }
  918. if (b) {
  919. that.setData({
  920. List: list,
  921. });
  922. }
  923. },
  924. showSelectCardShowDetail: function () {
  925. var that = this;
  926. var arr = [];
  927. for (var i = 0; i < 5; i++) {
  928. var obj = {};
  929. obj.Name = constant1.arrCardShowDetail[i];
  930. if (that.data.CardType == -1 && i == 2)
  931. obj.Name = "归档";
  932. if (i < 4)
  933. obj.Name += "时间";
  934. if (i == that.data.CardShowDetail)
  935. obj.IsSelected = "PanelBtnSelect";
  936. else
  937. obj.IsSelected = "";
  938. arr.push(obj);
  939. }
  940. that.setData({
  941. IsShowCardShowDetail: true,
  942. CardShowDetailArr: arr,
  943. });
  944. },
  945. hideSelectCardShowDetail: function () {
  946. var that = this;
  947. that.setData({
  948. IsShowCardShowDetail: false,
  949. });
  950. },
  951. selectCardShowDetail: function (e) {
  952. var that = this;
  953. that.data.CardShowDetail = e.currentTarget.dataset.id;
  954. that.setData({
  955. IsShowCardShowDetail: false,
  956. CardShowDetail: that.data.CardShowDetail,
  957. });
  958. that.getList();
  959. that.hideSelectCardShowDetail();
  960. },
  961. showHelp: function () {
  962. var that = this;
  963. that.setData({
  964. IsHelp: true,
  965. });
  966. },
  967. showSelectCardType: function () {
  968. var that = this;
  969. var arr = [
  970. ["全部", "", 2],
  971. ["日常", "", 0],
  972. ["紧急", "", 1],
  973. ["归档", "", -1]
  974. ];
  975. switch (that.data.CardType) {
  976. case 2:
  977. arr[0][1] = "PanelBtnSelect";
  978. break;
  979. case 0:
  980. arr[1][1] = "PanelBtnSelect";
  981. break;
  982. case 1:
  983. arr[2][1] = "PanelBtnSelect";
  984. break;
  985. case -1:
  986. arr[3][1] = "PanelBtnSelect";
  987. break;
  988. }
  989. that.setData({
  990. IsShowSelectCardType: true,
  991. CardTypeArr: arr,
  992. });
  993. },
  994. recoverItem: function (e) {
  995. var that = this;
  996. var id = e.currentTarget.dataset.id;
  997. var url = "DeleteMiaoguoCardWeb?UserID=" + app.globalData.userInfo.UserID;
  998. var param = {};
  999. param.IsRecover = "true";
  1000. param.VisitType = "vtqOSthN7vSwYmhc1gCjfw==";
  1001. param.ID = common.Encrypt(id);
  1002. main.postData(url, param, function () {
  1003. var list = app.globalData.CardList;
  1004. for (var i = 0; i < list.length; i++) {
  1005. if (id == list[i].MiaoguoCardID) {
  1006. list.splice(i, 1);
  1007. break;
  1008. }
  1009. }
  1010. app.globalData.CardList = list;
  1011. that.setData({
  1012. List: list,
  1013. Count: --that.data.Count,
  1014. });
  1015. });
  1016. },
  1017. setCollect: function (e) {
  1018. var that = this;
  1019. if (!isCollecting) {
  1020. isCollecting = true;
  1021. setTimeout(function () {
  1022. isCollecting = false;
  1023. }, 3000);
  1024. var id=e.currentTarget.dataset.id;
  1025. var collect=e.currentTarget.dataset.collect;
  1026. if (collect==0) {
  1027. collect = 1;
  1028. }
  1029. else {
  1030. collect = 0;
  1031. }
  1032. main.setCollect(id, collect, function () {
  1033. var list = app.globalData.CardList;
  1034. for (var i = 0; i < list.length; i++) {
  1035. if (id == list[i].MiaoguoCardID) {
  1036. if (collect==0)
  1037. list.splice(i, 1);
  1038. else
  1039. list[i].IsCollect = collect;
  1040. break;
  1041. }
  1042. }
  1043. app.globalData.CardList = list;
  1044. that.setData({
  1045. List: list,
  1046. });
  1047. });
  1048. }
  1049. },
  1050. editField: function (e) {
  1051. var id=e.currentTarget.dataset.id;
  1052. var that = this;
  1053. wx.navigateTo({
  1054. url: './add?type=edit&id=' + id,
  1055. });
  1056. },
  1057. removeFolder:function(e){
  1058. var that = this;
  1059. var id=e.currentTarget.dataset.id;
  1060. var url = 'RemoveFolder?UserID=' + app.globalData.userInfo.UserID;
  1061. url += "&ID=" + id;
  1062. url += "&FolderID=" + that.data.FolderID;
  1063. main.getData(url, function (data) {
  1064. var list = app.globalData.CardList;
  1065. for (var i = 0; i < list.length; i++) {
  1066. if (id == list[i].MiaoguoCardID) {
  1067. list.splice(i, 1);
  1068. break;
  1069. }
  1070. }
  1071. app.globalData.CardList = list;
  1072. that.setData({
  1073. List: list,
  1074. Count: --that.data.Count,
  1075. });
  1076. });
  1077. },
  1078. setOrderSelect:function(od){
  1079. var that=this;
  1080. for(var k=0;k<arrOrder.length;k++){
  1081. if (k==od)
  1082. arrOrder[k].CSS = "PanelBtnSelect2";
  1083. else
  1084. arrOrder[k].CSS = "";
  1085. }
  1086. that.setData({
  1087. ArrOrder: arrOrder,
  1088. OrderType:od,
  1089. });
  1090. },
  1091. //设置多选状态
  1092. setMultipleOptions:function(event){
  1093. var that=this;
  1094. //debugger;
  1095. var IsMultipleOptions=event.currentTarget.dataset.index==1?true:false;
  1096. that.setData({
  1097. IsMultipleOptions:IsMultipleOptions,
  1098. });
  1099. if (!IsMultipleOptions){
  1100. var list=that.data.List;
  1101. for(var i=0;i<list.length;i++){
  1102. list[i].Selected=false;
  1103. }
  1104. that.setData({
  1105. List:list,
  1106. SelectedCount:0,
  1107. CanScroll:true,
  1108. });
  1109. }
  1110. else{
  1111. that.setData({
  1112. CanScroll:false,
  1113. });
  1114. }
  1115. },
  1116. //选择或反选项
  1117. selectedItem:function(event){
  1118. var that=this;
  1119. var isAll=event.currentTarget.dataset.isall;
  1120. var id=event.currentTarget.dataset.id;
  1121. var list=that.data.List;
  1122. var selectedCount=0;
  1123. //debugger;
  1124. for(var i=0;i<list.length;i++){
  1125. if (isAll){
  1126. list[i].Selected=true;
  1127. }
  1128. else{
  1129. if (id==list[i].MiaoguoCardID){
  1130. if(!list[i].Selected)
  1131. list[i].Selected=true;
  1132. else
  1133. list[i].Selected=false;
  1134. }
  1135. }
  1136. if (list[i].Selected)
  1137. selectedCount++;
  1138. }
  1139. that.setData({
  1140. List:list,
  1141. SelectedCount:selectedCount,
  1142. });
  1143. },
  1144. showMultipleOther: function (event) {
  1145. var that = this;
  1146. var index=event.currentTarget.dataset.index;
  1147. var b=false;
  1148. if (index==1)
  1149. b=true;
  1150. if (b && that.data.SelectedCount==0){
  1151. wx.showToast({
  1152. title: '请先选择题卡',
  1153. });
  1154. }
  1155. else{
  1156. that.setData({
  1157. IsShowSelectContainer: b,
  1158. SelectContainerStyle:0,
  1159. });
  1160. }
  1161. },
  1162. //显示多选提醒
  1163. showMultipleNotice:function(event){
  1164. var that = this;
  1165. var index=event.currentTarget.dataset.index;
  1166. var mData = constant1.arrMultipleSaveData[index];
  1167. if (index==1 || index>=4){
  1168. var content=mData.Content.replace("[SelectedCount]",that.data.SelectedCount);
  1169. wx.showModal({
  1170. title: '提醒',
  1171. content: content,
  1172. confirmText:mData.ConfirmText,
  1173. complete: (res) => {
  1174. if (res.confirm) {
  1175. that.saveMultipleData(mData,that.data.List);
  1176. }
  1177. }
  1178. });
  1179. }
  1180. else if (index==2 || index==3){
  1181. //debugger;
  1182. var menu=event.currentTarget.dataset.menu;
  1183. if (menu==1){
  1184. that.setData({
  1185. SelectContainerStyle: index,
  1186. });
  1187. } else if (menu==2) {
  1188. var id=event.currentTarget.dataset.id;
  1189. that.showFolderListSelect({currentTarget:{dataset:{index:1,readfolder:id}}});
  1190. } else {
  1191. var id=event.currentTarget.dataset.id;
  1192. if (index==3){
  1193. mData.Param.IsCollect=id;
  1194. mData.FinishedText=mData.FinishedTextArr[id];
  1195. that.saveMultipleData(mData,that.data.List);
  1196. }
  1197. else{
  1198. if (id==0)
  1199. mData.Param.FolderID=0;
  1200. else{
  1201. var list=that.data.FolderList;
  1202. for(var i=0;i<list.length;i++){
  1203. if (list[i].Selected==1){
  1204. mData.Param.FolderID=list[i].ID;
  1205. mData.Param.FolderName=list[i].Name;
  1206. break;
  1207. }
  1208. }
  1209. }
  1210. mData.FinishedText=mData.FinishedTextArr[id];
  1211. that.saveMultipleData(mData,that.data.List);
  1212. }
  1213. }
  1214. }
  1215. },
  1216. //保存多选数据
  1217. saveMultipleData:function(mData,list){
  1218. var that=this;
  1219. var arr=[];
  1220. for(var i=0;i<list.length;i++){
  1221. if (list[i].Selected){
  1222. var id=list[i].MiaoguoCardID;
  1223. id=common.Encrypt(id);
  1224. arr.push(id);
  1225. }
  1226. }
  1227. if (arr.length>0){
  1228. var sql=mData.SaveFun+"?UserID="+app.globalData.userInfo.UserID;
  1229. var param=mData.Param;
  1230. param[param.ListStr]=arr;
  1231. //console.log(JSON.stringify(param));
  1232. main.postData(sql, param, function (data) {
  1233. list=that.updateSavedList(that.data.ShowMultiple,mData,list);
  1234. app.globalData.CardList=list;
  1235. that.setData({
  1236. List:list,
  1237. SelectedCount:0,
  1238. IsShowSelectContainer:false,
  1239. IsMultipleOptions:false,
  1240. IsFolderListContainer:0,
  1241. FolderList:null,
  1242. });
  1243. wx.showToast({
  1244. title: mData.FinishedText,
  1245. duration: 2000,
  1246. });
  1247. });
  1248. }
  1249. },
  1250. //更新保存的列表状态
  1251. updateSavedList:function(source,mData,list){
  1252. var that=this;
  1253. var index=mData.ID;
  1254. //debugger;
  1255. for(var i=list.length-1;i>=0;i--){
  1256. if (list[i].Selected){
  1257. list[i].Selected=0;
  1258. if (index==1){//删除
  1259. list.splice(i,1);
  1260. that.data.Count--;
  1261. }
  1262. else if (index==2){
  1263. list[i].FolderID=mData.Param.FolderID;
  1264. if (list[i].FolderID>0)
  1265. list[i].FolderName=mData.Param.FolderName;
  1266. if (source>0 && index!=source && mData.Param.FolderID!=source){ //不同类型列表删除
  1267. list.splice(i,1);
  1268. that.data.Count--;
  1269. }
  1270. app.globalData.FolderList=[];
  1271. }
  1272. else if (index==3){
  1273. list[i].IsCollect=Number(mData.Param.IsCollect);
  1274. if (source>0 && source<10 && index==source && mData.Param.IsCollect==0) {//不同类型列表删除
  1275. list.splice(i,1);
  1276. that.data.Count--;
  1277. }
  1278. }
  1279. else if (index==4){
  1280. list[i].CardType=-1;
  1281. list[i].CardTypeStr="归档";
  1282. if (source>0 && source<10 && index!=source){ //不同类型列表删除
  1283. list.splice(i,1);
  1284. that.data.Count--;
  1285. }
  1286. }
  1287. else if (index==5){
  1288. list[i].CardType=0;
  1289. list[i].CardTypeStr="日常";
  1290. if (source>0 && source<10 && index!=source){ //不同类型列表删除
  1291. list.splice(i,1);
  1292. that.data.Count--;
  1293. }
  1294. }
  1295. else if (index==6){
  1296. list[i].CardType=1;
  1297. list[i].CardTypeStr="紧急";
  1298. if (source>0 && source<10 && index!=source){ //不同类型列表删除
  1299. list.splice(i,1);
  1300. that.data.Count--;
  1301. }
  1302. }
  1303. else if (index==7){
  1304. list[i].CardType=0;
  1305. list[i].CardTypeStr="日常";
  1306. list[i].FirstTime='1900-01-01 00:00:00';
  1307. list[i].FirstTimeStr='1900-01-01';
  1308. list[i].LastTime='1900-01-01 00:00:00';
  1309. list[i].LastTimeStr='1900-01-01';
  1310. list[i].LimitTime=common.formatTime(new Date(),"-");
  1311. list[i].LimitTimeStr=common.formatTime(new Date(),"-",true);
  1312. list[i].IntervalDay=0;
  1313. list[i].RepetitionCoefficient=2.0;
  1314. list[i].UpdateTime=list[i].LimitTime;
  1315. list[i].UpdateTimeStr="今天";
  1316. list[i].CardCategory="新题卡";
  1317. }
  1318. }
  1319. }
  1320. that.setData({
  1321. Count:that.data.Count,
  1322. });
  1323. return list;
  1324. },
  1325. showFolderListSelect:function(e){
  1326. var that=this;
  1327. var index=Number(e.currentTarget.dataset.index);
  1328. that.setData({
  1329. IsFolderListContainer:index,
  1330. });
  1331. if (index==1){
  1332. var url = 'GetUserFolderList?UserID=' + app.globalData.userInfo.UserID;
  1333. main.getData(url, function (data) {
  1334. that.setData({
  1335. FolderList: data,
  1336. });
  1337. });
  1338. }
  1339. else{
  1340. that.setData({
  1341. FolderList: null,
  1342. });
  1343. }
  1344. },
  1345. selectFolderItem:function(e){
  1346. var that=this;
  1347. var index=Number(e.currentTarget.dataset.index);
  1348. var list=that.data.FolderList;
  1349. for(var i=0;i<list.length;i++){
  1350. list[i].Selected=0;
  1351. if (index==i){
  1352. list[i].Selected=1;
  1353. }
  1354. }
  1355. that.setData({
  1356. FolderList:list,
  1357. });
  1358. },
  1359. goto: function (e) {
  1360. var url = e.currentTarget.dataset.url;
  1361. wx.navigateTo({
  1362. url: './' + url,
  1363. })
  1364. },
  1365. redirect: function (e) {
  1366. var that=this;
  1367. var url = e.currentTarget.dataset.url;
  1368. app.globalData.TempStr2="CardType="+that.data.CardType+"&IsCollect="+that.data.IsCollect;
  1369. wx.redirectTo({
  1370. url: './' + url,
  1371. })
  1372. },
  1373. showHelpImage:function(){
  1374. var url=app.globalData.uploadImageUrl+"web/update_image_mathod.png";
  1375. wx.previewImage({
  1376. current: url, // 当前显示图片的http链接
  1377. urls: [url] // 需要预览的图片http链接列表
  1378. });
  1379. },
  1380. onShareAppMessage: function () {
  1381. return {
  1382. title: app.globalData.ShareTitle,
  1383. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  1384. imageUrl: app.globalData.ShareImage,
  1385. }
  1386. },
  1387. })