Commit b0a290a9 by dazhou

assistance活动标题修改

parent 942aa7c1
{"version":3,"sources":["components/activity/give-courses/index.js"],"names":["showToast","text","info","GiveCourses","state","banner","courses","rule","awardstext","rankList","isShow","animate","marqueeList","getRankList","http","get","API","then","res","data","errno","msg","setState","list","first","second","third","other","slice","isMyList","myList","getMarqueeList","showMarquee","setTimeout","isRouter","param","decodeURIComponent","getParam","props","history","push","document","title","course_info","split","query","this","setInterval","_czc","window","id","className","src","alt","map","course","key","to","course_id","image_name","href","course_title","onClick","console","log","dangerouslySetInnerHTML","__html","length","item","index","head_img","border","cellPadding","cellSpacing","name","num","Component"],"mappings":"0PAOA,SAASA,EAAUC,GACjB,IAAMC,KAAKD,EAAM,EAAG,MAAM,G,IAGtBE,E,4MACJC,MAAQ,CACNC,OAAQ,GACRC,QAAS,GACTC,KAAM,GACNC,WAAY,GACZC,SAAU,GACVC,QAAQ,EACRC,SAAS,EACTC,YAAa,I,EA8BfC,YAAc,WACZC,IAAKC,IAAL,UAAYC,IAAI,YAAhB,gCAA0DC,MAAK,SAACC,GAAS,IAAD,EACzCA,EAAIC,KAAzBA,EAD8D,EAC9DA,KAAMC,EADwD,EACxDA,MAAOC,EADiD,EACjDA,IACP,MAAVD,EACF,EAAKE,SAAS,CACZb,SAAU,CACRc,KAAMJ,EAAKI,KACXC,MAAOL,EAAKI,KAAK,GACjBE,OAAQN,EAAKI,KAAK,GAClBG,MAAOP,EAAKI,KAAK,GACjBI,MAAOR,EAAKI,KAAKK,MAAM,EAAG,IAC1BC,SAAUV,EAAI,SACdW,OAAQX,EAAI,UAAgBA,KAIhCnB,EAAUqB,O,EAKhBU,eAAiB,WACfjB,IAAKC,IAAL,UAAYC,IAAI,YAAhB,yBAAmDC,MAAK,SAACC,GAAS,IAAD,EAClCA,EAAIC,KAAzBC,EADuD,EACvDA,MAAOC,EADgD,EAChDA,IAAKF,EAD2C,EAC3CA,KACN,MAAVC,EACF,EAAKE,SAAS,CACZV,YAAaO,IAGfnB,EAAUq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kE,aA4TXzE","file":"mrstaticjs/67.0753bd4b.chunk.js","sourcesContent":["/* eslint-disable jsx-a11y/anchor-is-valid, no-script-url */\nimport React, { Component } from \"react\"\nimport \"./give-courses.scss\"\nimport { getParam, http } from \"src/utils\"\nimport { Toast } from \"antd-mobile\"\nimport { Link } from \"react-router-dom\"\n\nfunction showToast(text) {\n Toast.info(text, 2, null, false)\n}\n\nclass GiveCourses extends Component {\n state = {\n banner: \"\",\n courses: [],\n rule: \"\",\n awardstext: \"\",\n rankList: {},\n isShow: false,\n animate: false,\n marqueeList: [],\n }\n\n componentDidMount() {\n document.title =\n \"AI攻城狮超车季,呼朋唤友免费学爆款AI好课!VIP会员、机械键盘、AI经典纸质书等免费送!--七月在线\"\n\n http.get(`${API[\"base-api\"]}/assistance/detail`).then((res) => {\n const { data, errno, msg } = res.data\n if (errno === 200) {\n this.setState({\n banner: data[\"active_info\"][\"m_banner\"],\n courses: data.course_info,\n rule: data[\"active_info\"][\"rule\"],\n awardstext: data[\"active_info\"][\"awards_text\"].split(\"\\n\\n\"),\n query: data[\"active_info\"][\"activity_name\"],\n })\n\n this.isRouter(data[\"active_info\"][\"activity_name\"])\n } else {\n showToast(msg)\n }\n })\n\n this.getRankList()\n this.getMarqueeList()\n setInterval(this.showMarquee, 5000)\n setInterval(this.getMarqueeList, 60000)\n }\n\n getRankList = () => {\n http.get(`${API[\"base-api\"]}/assistance/ranking_list/50`).then((res) => {\n const { data, errno, msg } = res.data\n if (errno === 200) {\n this.setState({\n rankList: {\n list: data.list,\n first: data.list[0],\n second: data.list[1],\n third: data.list[2],\n other: data.list.slice(3, 50),\n isMyList: data[\"nickname\"],\n myList: data[\"nickname\"] && data,\n },\n })\n } else {\n showToast(msg)\n }\n })\n }\n\n getMarqueeList = () => {\n http.get(`${API[\"base-api\"]}/assistance/roll_tip`).then((res) => {\n const { errno, msg, data } = res.data\n if (errno === 200) {\n this.setState({\n marqueeList: data,\n })\n } else {\n showToast(msg)\n }\n })\n }\n\n showMarquee = () => {\n this.setState(\n {\n animate: true,\n },\n () => {\n setTimeout(() => {\n const [first, second] = this.state.marqueeList\n this.setState({\n animate: false,\n marqueeList: [second, first],\n })\n }, 500)\n }\n )\n }\n\n isRouter = (param) => {\n if (decodeURIComponent(getParam(\"activename\")) !== param) {\n this.props.history.push(\"/\")\n }\n }\n\n render() {\n const {\n banner,\n courses,\n rule,\n awardstext,\n rankList,\n isShow,\n animate,\n marqueeList,\n } = this.state\n var _czc = window._czc || []\n return (\n <div id={\"give-courses\"}>\n <div className=\"banner\">\n <img src={banner} alt=\"\" />\n </div>\n <div className=\"give-box\">\n {courses.map((course) => {\n return (\n <div className=\"give-course\" key={course.id}>\n <Link\n className=\"give-course-img\"\n to={`/detail?id=${course.course_id}`}\n >\n <img src={course.image_name} alt=\"\" />\n </Link>\n <ul className=\"give-course-mess\">\n <li className=\"course-title\">\n <a href=\"javascript:\">{course.course_title}</a>\n </li>\n <li className=\"course-teacher\">\n <span className=\"tag\">讲师</span>\n {course[\"teachers\"]}\n </li>\n <li className=\"course-time\">\n <span className=\"tag\">开课时间</span>\n {course[\"start_time\"]}\n </li>\n <li\n className=\"toreceive\"\n onClick={() => {\n _czc &&\n _czc.push([\n \"_trackEvent\",\n `课程id=${course.course_id}`,\n \"免费领取课程\",\n ])\n console.log(course.course_id)\n this.setState({ isShow: true })\n }}\n >\n 免费领取课程\n </li>\n </ul>\n </div>\n )\n })}\n <p className=\"rule-title\">活动规则</p>\n <div\n className=\"rule-list\"\n dangerouslySetInnerHTML={{ __html: rule }}\n />\n\n <div className=\"marquee_box\">\n <ul className={`marquee_list ${animate ? \"marquee_top\" : \"\"}`}>\n {marqueeList.length\n ? marqueeList.map((item, index) => {\n return (\n <li key={index}>\n <img src={item.head_img} alt=\"\" />\n <span>{item[\"nickname\"]}</span>\n {item[\"word\"]}\n </li>\n )\n })\n : null}\n </ul>\n </div>\n </div>\n\n <div className=\"set-prize\">\n <p className=\"set-prize-title\">\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jpsz_icon.png\"\n alt=\"\"\n />\n 奖品设置\n </p>\n <div className=\"set-prize-content\">\n {awardstext &&\n awardstext.length &&\n awardstext.map((item, index) => <p key={index}>{item}</p>)}\n </div>\n </div>\n\n <div className=\"ranking-list\">\n <div className=\"ranking_title\">\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jbei_icon.png\"\n alt=\"\"\n />\n <span>排行榜</span>\n <p>数据实时更新 只显示Top50</p>\n </div>\n <table border=\"0\" cellPadding=\"0\" cellSpacing=\"0\">\n <thead>\n <tr>\n <td>排名</td>\n <td>用户</td>\n <td>邀请人数</td>\n </tr>\n </thead>\n <tbody>\n {rankList.list && rankList.list.length > 0 ? (\n <tr>\n <td>\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jin1_icon.png\"\n alt=\"\"\n />\n </td>\n <td>\n <img src={rankList.first.head_img} alt=\"\" />\n <span>{rankList.first.name}</span>\n </td>\n <td>{rankList.first.num}</td>\n </tr>\n ) : null}\n\n {rankList.list && rankList.list.length > 1 ? (\n <tr>\n <td>\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/yin2_icon.png\"\n alt=\"\"\n />\n </td>\n <td>\n <img src={rankList.second.head_img} alt=\"\" />\n <span>{rankList.second.name}</span>\n </td>\n <td>{rankList.second.num}</td>\n </tr>\n ) : null}\n\n {rankList.list && rankList.list.length > 2 ? (\n <tr>\n <td>\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/tong_icon.png\"\n alt=\"\"\n />\n </td>\n <td>\n <img src={rankList.third.head_img} alt=\"\" />\n <span>{rankList.third.name}</span>\n </td>\n <td>{rankList.third.num}</td>\n </tr>\n ) : null}\n\n {rankList.list && rankList.list.length && rankList.list.length > 3\n ? rankList.other.map((item, index) => {\n return (\n <tr key={index}>\n <td>{index + 4}</td>\n <td>\n <img src={item.head_img} alt=\"\" />\n <span>{item.name}</span>\n </td>\n <td>{item.num}</td>\n </tr>\n )\n })\n : null}\n\n {rankList.isMyList && (\n <tr className=\"ismylist\">\n <td>{rankList.myList[\"ranking\"]}</td>\n <td>\n <img src={rankList.myList.head_img} alt=\"\" />\n <span>{rankList.myList[\"nickname\"]}</span>\n </td>\n <td>{rankList.myList[\"inviter_num\"]}</td>\n </tr>\n )}\n </tbody>\n </table>\n <p className=\"btm\" />\n </div>\n\n <p className=\"julynotice\">*本活动最终解释权归七月在线所有*</p>\n\n {isShow && (\n <div className=\"code-mbc\">\n <div className=\"code-box\">\n <p className=\"code-title\">\n 进入服务号回复<i>77</i>免费领取课程\n </p>\n <img\n id=\"qrCodeWpay\"\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018christyear/h5/qrcode.jpg\"\n alt=\"\"\n />\n <p className=\"btmmess\">长按扫码进入服务号</p>\n </div>\n <i\n className=\"close iconfont iconiconfront-2\"\n onClick={() => {\n this.setState({ isShow: false })\n }}\n />\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default GiveCourses\n"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["components/activity/give-courses/index.js"],"names":["showToast","text","info","GiveCourses","state","banner","courses","rule","awardstext","rankList","isShow","animate","marqueeList","getRankList","http","get","API","then","res","data","errno","msg","setState","list","first","second","third","other","slice","isMyList","myList","getMarqueeList","showMarquee","setTimeout","isRouter","param","decodeURIComponent","getParam","props","history","push","document","title","course_info","split","query","this","setInterval","_czc","window","id","className","src","alt","map","course","key","to","course_id","image_name","href","course_title","onClick","console","log","dangerouslySetInnerHTML","__html","length","item","index","head_img","border","cellPadding","cellSpacing","name","num","Component"],"mappings":"0PAOA,SAASA,EAAUC,GACjB,IAAMC,KAAKD,EAAM,EAAG,MAAM,G,IAGtBE,E,4MACJC,MAAQ,CACNC,OAAQ,GACRC,QAAS,GACTC,KAAM,GACNC,WAAY,GACZC,SAAU,GACVC,QAAQ,EACRC,SAA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K4C,OAAS,EAC7D1D,EAASkB,MAAM2B,KAAI,SAACc,EAAMC,GACxB,OACE,wBAAIb,IAAKa,GACP,4BAAKA,EAAQ,GACb,4BACE,yBAAKjB,IAAKgB,EAAKE,SAAUjB,IAAI,KAC7B,8BAAOe,EAAKM,OAEd,4BAAKN,EAAKO,SAIhB,KAEHlE,EAASoB,UACR,wBAAIsB,UAAU,YACZ,4BAAK1C,EAASqB,OAAT,SACL,4BACE,yBAAKsB,IAAK3C,EAASqB,OAAOwC,SAAUjB,IAAI,KACxC,8BAAO5C,EAASqB,OAAT,WAET,4BAAKrB,EAASqB,OAAT,gBAKb,uBAAGqB,UAAU,SAGf,uBAAGA,UAAU,cAAb,gGAECzC,GACC,yBAAKyC,UAAU,YACb,yBAAKA,UAAU,YACb,uBAAGA,UAAU,cAAb,6CACS,iCADT,wCAGA,yBACED,GAAG,aACHE,IAAI,yEACJC,IAAI,KAEN,uBAAGF,UAAU,WAAb,2DAEF,uBACEA,UAAU,iCACVW,QAAS,WACP,EAAKxC,SAAS,CAAEZ,QAAQ,a,GAlTdkE,aA4TXzE","file":"mrstaticjs/67.0753bd4b.chunk.js","sourcesContent":["/* eslint-disable jsx-a11y/anchor-is-valid, no-script-url */\nimport React, { Component } from \"react\"\nimport \"./give-courses.scss\"\nimport { getParam, http } from \"src/utils\"\nimport { Toast } from \"antd-mobile\"\nimport { Link } from \"react-router-dom\"\n\nfunction showToast(text) {\n Toast.info(text, 2, null, false)\n}\n\nclass GiveCourses extends Component {\n state = {\n banner: \"\",\n courses: [],\n rule: \"\",\n awardstext: \"\",\n rankList: {},\n isShow: false,\n animate: false,\n marqueeList: [],\n }\n\n componentDidMount() {\n document.title =\n \"充电季,AI好课免费学!折叠键盘、蓝牙耳机、纸质书等包邮送!\"\n\n http.get(`${API[\"base-api\"]}/assistance/detail`).then((res) => {\n const { data, errno, msg } = res.data\n if (errno === 200) {\n this.setState({\n banner: data[\"active_info\"][\"m_banner\"],\n courses: data.course_info,\n rule: data[\"active_info\"][\"rule\"],\n awardstext: data[\"active_info\"][\"awards_text\"].split(\"\\n\\n\"),\n query: data[\"active_info\"][\"activity_name\"],\n })\n\n this.isRouter(data[\"active_info\"][\"activity_name\"])\n } else {\n showToast(msg)\n }\n })\n\n this.getRankList()\n this.getMarqueeList()\n setInterval(this.showMarquee, 5000)\n setInterval(this.getMarqueeList, 60000)\n }\n\n getRankList = () => {\n http.get(`${API[\"base-api\"]}/assistance/ranking_list/50`).then((res) => {\n const { data, errno, msg } = res.data\n if (errno === 200) {\n this.setState({\n rankList: {\n list: data.list,\n first: data.list[0],\n second: data.list[1],\n third: data.list[2],\n other: data.list.slice(3, 50),\n isMyList: data[\"nickname\"],\n myList: data[\"nickname\"] && data,\n },\n })\n } else {\n showToast(msg)\n }\n })\n }\n\n getMarqueeList = () => {\n http.get(`${API[\"base-api\"]}/assistance/roll_tip`).then((res) => {\n const { errno, msg, data } = res.data\n if (errno === 200) {\n this.setState({\n marqueeList: data,\n })\n } else {\n showToast(msg)\n }\n })\n }\n\n showMarquee = () => {\n this.setState(\n {\n animate: true,\n },\n () => {\n setTimeout(() => {\n const [first, second] = this.state.marqueeList\n this.setState({\n animate: false,\n marqueeList: [second, first],\n })\n }, 500)\n }\n )\n }\n\n isRouter = (param) => {\n if (decodeURIComponent(getParam(\"activename\")) !== param) {\n this.props.history.push(\"/\")\n }\n }\n\n render() {\n const {\n banner,\n courses,\n rule,\n awardstext,\n rankList,\n isShow,\n animate,\n marqueeList,\n } = this.state\n var _czc = window._czc || []\n return (\n <div id={\"give-courses\"}>\n <div className=\"banner\">\n <img src={banner} alt=\"\" />\n </div>\n <div className=\"give-box\">\n {courses.map((course) => {\n return (\n <div className=\"give-course\" key={course.id}>\n <Link\n className=\"give-course-img\"\n to={`/detail?id=${course.course_id}`}\n >\n <img src={course.image_name} alt=\"\" />\n </Link>\n <ul className=\"give-course-mess\">\n <li className=\"course-title\">\n <a href=\"javascript:\">{course.course_title}</a>\n </li>\n <li className=\"course-teacher\">\n <span className=\"tag\">讲师</span>\n {course[\"teachers\"]}\n </li>\n <li className=\"course-time\">\n <span className=\"tag\">开课时间</span>\n {course[\"start_time\"]}\n </li>\n <li\n className=\"toreceive\"\n onClick={() => {\n _czc &&\n _czc.push([\n \"_trackEvent\",\n `课程id=${course.course_id}`,\n \"免费领取课程\",\n ])\n console.log(course.course_id)\n this.setState({ isShow: true })\n }}\n >\n 免费领取课程\n </li>\n </ul>\n </div>\n )\n })}\n <p className=\"rule-title\">活动规则</p>\n <div\n className=\"rule-list\"\n dangerouslySetInnerHTML={{ __html: rule }}\n />\n\n <div className=\"marquee_box\">\n <ul className={`marquee_list ${animate ? \"marquee_top\" : \"\"}`}>\n {marqueeList.length\n ? marqueeList.map((item, index) => {\n return (\n <li key={index}>\n <img src={item.head_img} alt=\"\" />\n <span>{item[\"nickname\"]}</span>\n {item[\"word\"]}\n </li>\n )\n })\n : null}\n </ul>\n </div>\n </div>\n\n <div className=\"set-prize\">\n <p className=\"set-prize-title\">\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jpsz_icon.png\"\n alt=\"\"\n />\n 奖品设置\n </p>\n <div className=\"set-prize-content\">\n {awardstext &&\n awardstext.length &&\n awardstext.map((item, index) => <p key={index}>{item}</p>)}\n </div>\n </div>\n\n <div className=\"ranking-list\">\n <div className=\"ranking_title\">\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jbei_icon.png\"\n alt=\"\"\n />\n <span>排行榜</span>\n <p>数据实时更新 只显示Top50</p>\n </div>\n <table border=\"0\" cellPadding=\"0\" cellSpacing=\"0\">\n <thead>\n <tr>\n <td>排名</td>\n <td>用户</td>\n <td>邀请人数</td>\n </tr>\n </thead>\n <tbody>\n {rankList.list && rankList.list.length > 0 ? (\n <tr>\n <td>\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jin1_icon.png\"\n alt=\"\"\n />\n </td>\n <td>\n <img src={rankList.first.head_img} alt=\"\" />\n <span>{rankList.first.name}</span>\n </td>\n <td>{rankList.first.num}</td>\n </tr>\n ) : null}\n\n {rankList.list && rankList.list.length > 1 ? (\n <tr>\n <td>\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/yin2_icon.png\"\n alt=\"\"\n />\n </td>\n <td>\n <img src={rankList.second.head_img} alt=\"\" />\n <span>{rankList.second.name}</span>\n </td>\n <td>{rankList.second.num}</td>\n </tr>\n ) : null}\n\n {rankList.list && rankList.list.length > 2 ? (\n <tr>\n <td>\n <img\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/tong_icon.png\"\n alt=\"\"\n />\n </td>\n <td>\n <img src={rankList.third.head_img} alt=\"\" />\n <span>{rankList.third.name}</span>\n </td>\n <td>{rankList.third.num}</td>\n </tr>\n ) : null}\n\n {rankList.list && rankList.list.length && rankList.list.length > 3\n ? rankList.other.map((item, index) => {\n return (\n <tr key={index}>\n <td>{index + 4}</td>\n <td>\n <img src={item.head_img} alt=\"\" />\n <span>{item.name}</span>\n </td>\n <td>{item.num}</td>\n </tr>\n )\n })\n : null}\n\n {rankList.isMyList && (\n <tr className=\"ismylist\">\n <td>{rankList.myList[\"ranking\"]}</td>\n <td>\n <img src={rankList.myList.head_img} alt=\"\" />\n <span>{rankList.myList[\"nickname\"]}</span>\n </td>\n <td>{rankList.myList[\"inviter_num\"]}</td>\n </tr>\n )}\n </tbody>\n </table>\n <p className=\"btm\" />\n </div>\n\n <p className=\"julynotice\">*本活动最终解释权归七月在线所有*</p>\n\n {isShow && (\n <div className=\"code-mbc\">\n <div className=\"code-box\">\n <p className=\"code-title\">\n 进入服务号回复<i>77</i>免费领取课程\n </p>\n <img\n id=\"qrCodeWpay\"\n src=\"//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018christyear/h5/qrcode.jpg\"\n alt=\"\"\n />\n <p className=\"btmmess\">长按扫码进入服务号</p>\n </div>\n <i\n className=\"close iconfont iconiconfront-2\"\n onClick={() => {\n this.setState({ isShow: false })\n }}\n />\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default GiveCourses\n"],"sourceRoot":""}
\ No newline at end of file
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