userbook.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. var app = getApp();
  4. var arrInformation = [
  5. {
  6. PageID: 1,
  7. text1: "课外课",
  8. text2: "如何制作合格的题卡——添加题卡 资料格式篇",
  9. text3: "制作题卡的操作步骤,各种常用的题卡格式,利用秒过的+资料功能怎么快速完成文科内容的题卡制作。"
  10. },
  11. {
  12. PageID: 2,
  13. text1: "课外课",
  14. text2: "如何制作合格的题卡——添加题卡 便捷操作篇",
  15. text3: "录入长篇幅内容,比如文字较多没有算式的概念题、英语例句等内容的技巧,重复利用手机的强大能力。"
  16. },
  17. {
  18. PageID: 3,
  19. text1: "课外课",
  20. text2: "如何制作合格的题卡——内容写法 语文篇",
  21. text3: "“大而全”的题卡是极其不适宜的做法,做题卡是有讲究的。怎么做既有效率又能帮助孩子理出头绪更有成效呢?"
  22. },
  23. {
  24. PageID: 4,
  25. text1: "课外课",
  26. text2: "如何制作合格的题卡——内容写法 数学英语篇",
  27. text3: "数学计算题、应用题,英语单词、语法、辩词的具体写法。检验孩子是不是在单纯背诵答案选项?如何避免与应对。"
  28. },
  29. {
  30. PageID: 5,
  31. text1: "课外课",
  32. text2: "怎么开展学习——流程篇",
  33. text3: "题卡的作用是促使孩子通过“回想”记住知识。不能容纳庞大繁复的书本内容,对摘录方法有一定的要求。"
  34. },
  35. {
  36. PageID: 6,
  37. text1: "课外课",
  38. text2: "怎么开展学习——要点篇",
  39. text3: "在学习中怎么打分,记忆评价的使用;用工具栏实现快捷操作控制学习进度;调节任务量灵活控制学习时间。"
  40. },
  41. ]
  42. Page({
  43. data: {
  44. ImagePath: app.globalData.uploadImageUrl,
  45. officialAccounts:app.globalData.officialAccounts,
  46. PanelShow: -2,
  47. },
  48. onPullDownRefresh: function () {
  49. wx.reLaunch({
  50. url: '../../pages/index/index?type=userbook',
  51. })
  52. wx.stopPullDownRefresh();
  53. },
  54. onLoad: function () {
  55. var that = this;
  56. var productServiceTime="";
  57. var endDate="";
  58. if (app.globalData.userInfo.ProductServiceTime){
  59. productServiceTime = common.formatDateCHS(common.formatTime(new Date(app.globalData.userInfo.ProductServiceTime)));
  60. endDate=common.formatTime(common.addDate("y", 1, new Date(app.globalData.userInfo.ProductServiceTime)));
  61. }
  62. // var arr = [];
  63. // for (var i = arrInformation.length - 1; i >= 1; i--) {
  64. // arr.push(arrInformation[i]);
  65. // }
  66. //debugger;
  67. that.setData({
  68. Containnerheight: main.getWindowHeight(),
  69. ProductServiceTime: productServiceTime,
  70. EndDate: endDate,
  71. ArrInformation: arrInformation,
  72. IsShow: app.globalData.userInfo.isShow,
  73. IsMember: app.globalData.userInfo.IsMember,
  74. IsPay: app.globalData.userInfo.IsPay,
  75. IsLoseEfficacy: app.globalData.userInfo.IsLoseEfficacy,
  76. ClassTotalDayNumber: app.globalData.userInfo.ClassTotalDayNumber,
  77. ChildUserID: app.globalData.userInfo.ChildUserID,
  78. CurrentUserID: app.globalData.userInfo.CurrentUserID,
  79. UserID:app.globalData.userInfo.UserID,
  80. ShowUserID:app.globalData.userInfo.ShowUserID,
  81. });
  82. that.init();
  83. wx.setNavigationBarColor({
  84. frontColor: "#ffffff",
  85. backgroundColor: "#FF9F33",
  86. });
  87. },
  88. init: function () {
  89. var that = this;
  90. var panelShow = 0;
  91. if (app.globalData.userInfo.Subscribe == 1 && app.globalData.userInfo.IsProbation == 1) {
  92. panelShow = 1;
  93. var ClassTimeStart = common.formatDateCHS(app.globalData.userInfo.ClassStartDate);
  94. var ClassTimeEnd = common.formatDateCHS(app.globalData.userInfo.ClassEndDate);
  95. var earlyBirdTimeStart = common.formatDateCHS(common.formatTime(common.addDate("d", that.data.ClassTotalDayNumber-4, new Date(app.globalData.userInfo.ClassStartDate))));
  96. var earlyBirdTimeEnd = common.formatDateCHS(common.formatTime(common.addDate("d", that.data.ClassTotalDayNumber-1, new Date(app.globalData.userInfo.ClassStartDate))));
  97. var ClassDayNumber = app.globalData.userInfo.ClassDayNumber;
  98. console.log("ClassTimeEnd:" + ClassTimeEnd);
  99. console.log("ClassDayNumber:" + ClassDayNumber);
  100. that.setData({
  101. ClassTimeStart: ClassTimeStart,
  102. ClassTimeEnd: ClassTimeEnd,
  103. EarlyBirdTimeStart: earlyBirdTimeStart,
  104. EarlyBirdTimeEnd: earlyBirdTimeEnd,
  105. ClassDayNumber: ClassDayNumber,
  106. });
  107. debugger;
  108. //试用
  109. if (app.globalData.userInfo.IsTryOut == 1 && app.globalData.userInfo.IsMember == 0){
  110. panelShow = 2;
  111. }
  112. //开班
  113. else if (app.globalData.userInfo.IsMember == 1 && app.globalData.userInfo.ClassID > 0) {
  114. panelShow = 3;
  115. }
  116. }
  117. else if (app.globalData.userInfo.Subscribe == 0) {
  118. panelShow = -1;
  119. }
  120. if (panelShow==0){
  121. wx.redirectTo({
  122. url: '../other/newuser',
  123. })
  124. }
  125. else{
  126. that.setData({
  127. PanelShow: panelShow,
  128. });
  129. }
  130. if (that.data.IsLoseEfficacy==1 && that.data.CurrentUserID!=that.data.UserID){
  131. wx.showModal({
  132. title: '帐号过期',
  133. content: '该帐号已过期,重启微信可回到您原本的秒过,「家庭用户」已自动解除。如想为该帐号续费,请使用该帐号原本对应的微信打开秒过就能续费了(其它微信不能代付)。',
  134. showCancel: false,
  135. confirmText: "知道了",
  136. success(res) {},
  137. });
  138. }
  139. },
  140. onShow:function(){
  141. var that=this;
  142. that.setData({
  143. NickName: app.globalData.userInfo.NickName,
  144. AvatarUrl: app.globalData.userInfo.AvatarUrl,
  145. });
  146. },
  147. goto: function (e) {
  148. var url = e.currentTarget.dataset.url;
  149. wx.navigateTo({
  150. url: url,
  151. });
  152. },
  153. gotoIndex: function () {
  154. wx.reLaunch({
  155. url: '../index/index?type=userbook',
  156. })
  157. },
  158. gotoReturn:function(){
  159. wx.navigateBack({
  160. delta: 1,
  161. });
  162. },
  163. updateMember: function () {
  164. if (!this.data.ChildUserID && this.data.UserID==this.data.CurrentUserID){
  165. wx.navigateTo({
  166. url: '../index/accredit',
  167. });
  168. }
  169. },
  170. copyManager:function(){
  171. var id="changyibzr";
  172. wx.setClipboardData({
  173. data: id.toString(),
  174. success (res) {
  175. wx.showModal({
  176. title: '已复制',
  177. showCancel: false,
  178. content: "请在微信添加用户中长按粘贴。",
  179. confirmText: '知道了',
  180. success(res) {
  181. }
  182. });
  183. }
  184. });
  185. },
  186. onShareAppMessage: function () {
  187. return {
  188. title: "用户手册",
  189. path: app.globalData.SharePath + '?type=userbook&UserID=' + app.globalData.userInfo.UserID,
  190. imageUrl: app.globalData.uploadImageUrl +"web/program_screenshot_usermanual.png",
  191. }
  192. },
  193. })