userbook.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. that.setData({
  67. Containnerheight: main.getWindowHeight(),
  68. ProductServiceTime: productServiceTime,
  69. EndDate: endDate,
  70. ArrInformation: arrInformation,
  71. IsShow: app.globalData.userInfo.isShow,
  72. IsMember: app.globalData.userInfo.IsMember,
  73. IsPay: app.globalData.userInfo.IsPay,
  74. IsLoseEfficacy: app.globalData.userInfo.IsLoseEfficacy,
  75. ClassTotalDayNumber: app.globalData.userInfo.ClassTotalDayNumber,
  76. ChildUserID: app.globalData.userInfo.ChildUserID,
  77. MainUserID: app.globalData.userInfo.MainUserID,
  78. UserID:app.globalData.userInfo.UserID,
  79. ShowUserID:app.globalData.userInfo.ShowUserID,
  80. });
  81. that.init();
  82. wx.setNavigationBarColor({
  83. frontColor: "#ffffff",
  84. backgroundColor: "#FF9F33",
  85. });
  86. },
  87. init: function () {
  88. var that = this;
  89. var panelShow = 0;
  90. if (app.globalData.userInfo.Subscribe == 1 && app.globalData.userInfo.IsProbation == 1) {
  91. panelShow = 1;
  92. var ClassTimeStart = common.formatDateCHS(app.globalData.userInfo.ClassStartDate);
  93. var ClassTimeEnd = common.formatDateCHS(app.globalData.userInfo.ClassEndDate);
  94. var earlyBirdTimeStart = common.formatDateCHS(common.formatTime(common.addDate("d", that.data.ClassTotalDayNumber-4, new Date(app.globalData.userInfo.ClassStartDate))));
  95. var earlyBirdTimeEnd = common.formatDateCHS(common.formatTime(common.addDate("d", that.data.ClassTotalDayNumber-1, new Date(app.globalData.userInfo.ClassStartDate))));
  96. var ClassDayNumber = app.globalData.userInfo.ClassDayNumber;
  97. //console.log("ClassDayNumber:" + ClassDayNumber);
  98. that.setData({
  99. ClassTimeStart: ClassTimeStart,
  100. ClassTimeEnd: ClassTimeEnd,
  101. EarlyBirdTimeStart: earlyBirdTimeStart,
  102. EarlyBirdTimeEnd: earlyBirdTimeEnd,
  103. ClassDayNumber: ClassDayNumber,
  104. });
  105. //试用
  106. if (app.globalData.userInfo.IsTryOut == 1 && app.globalData.userInfo.IsMember == 0){
  107. panelShow = 2;
  108. }
  109. //开班
  110. else if (app.globalData.userInfo.IsMember == 1 && app.globalData.userInfo.ClassID > 0) {
  111. panelShow = 3;
  112. }
  113. }
  114. else if (app.globalData.userInfo.Subscribe == 0) {
  115. panelShow = -1;
  116. }
  117. if (panelShow==0){
  118. wx.redirectTo({
  119. url: '../other/newuser',
  120. })
  121. }
  122. else{
  123. that.setData({
  124. PanelShow: panelShow,
  125. });
  126. }
  127. if (that.data.IsLoseEfficacy==1 && that.data.MainUserID!=that.data.UserID){
  128. wx.showModal({
  129. title: '帐号过期',
  130. content: '该帐号已过期,重启微信可回到您原本的秒过,「家庭用户」已自动解除。如想为该帐号续费,请使用该帐号原本对应的微信打开秒过就能续费了(其它微信不能代付)。',
  131. showCancel: false,
  132. confirmText: "知道了",
  133. success(res) {},
  134. });
  135. }
  136. },
  137. onShow:function(){
  138. var that=this;
  139. that.setData({
  140. NickName: app.globalData.userInfo.NickName,
  141. AvatarUrl: app.globalData.userInfo.AvatarUrl,
  142. });
  143. },
  144. goto: function (e) {
  145. var url = e.currentTarget.dataset.url;
  146. wx.navigateTo({
  147. url: url,
  148. });
  149. },
  150. gotoIndex: function () {
  151. wx.reLaunch({
  152. url: '../index/index?type=userbook',
  153. })
  154. },
  155. gotoReturn:function(){
  156. wx.navigateBack({
  157. delta: 1,
  158. });
  159. },
  160. updateMember: function () {
  161. if (!this.data.ChildUserID && this.data.UserID==this.data.MainUserID){
  162. wx.navigateTo({
  163. url: '../index/accredit',
  164. });
  165. }
  166. },
  167. copyManager:function(){
  168. var id="changyibzr";
  169. wx.setClipboardData({
  170. data: id.toString(),
  171. success (res) {
  172. wx.showModal({
  173. title: '已复制',
  174. showCancel: false,
  175. content: "请在微信添加用户中长按粘贴。",
  176. confirmText: '知道了',
  177. success(res) {
  178. }
  179. });
  180. }
  181. });
  182. },
  183. onShareAppMessage: function () {
  184. return {
  185. title: "用户手册",
  186. path: app.globalData.SharePath + '?type=userbook&UserID=' + app.globalData.userInfo.UserID,
  187. imageUrl: app.globalData.uploadImageUrl +"web/program_screenshot_usermanual.png",
  188. }
  189. },
  190. })