| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- var app = getApp();
- var backgroundAudioManager;
- Page({
- data: {
- PanelShow: 0,
- IsShowPay:false,
- IsShowBtn:false,
- IsShowMore:false,
- IsPlay:false,
- ImagePath: app.globalData.uploadImageUrl,
- },
- onLoad: function (options) {
- var that = this;
- backgroundAudioManager = wx.getBackgroundAudioManager();
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
-
- that.init(options.index);
- },
- init: function (index) {
- var that = this;
- if (!index)
- index=0;
- main.getData("GetMiaoguoNewUserImageList", function (data) {
- that.setData({
- List: data[index].Images,
- PageIndex:index,
- });
- wx.setNavigationBarTitle({
- title: data[index].Name
- });
- wx.setNavigationBarColor({
- frontColor: "#000000",
- backgroundColor: data[index].BarColor,
- backgroundColorTop: data[index].BarColor,
- });
- if (app.globalData.IsIPhoneX) {
- that.setData({
- IsIPad: "_IPhoneX",
- });
- }
-
- });
- },
- goto: function (e) {
- var url = e.currentTarget.dataset.url;
-
- wx.navigateTo({
- url: url,
- });
- },
- showMore:function(){
- this.setData({
- IsShowMore:true,
- })
- },
- scroll:function(e){
- var that=this;
- if (that.data.PanelShow==0 && that.data.PageIndex==0){
- var query = wx.createSelectorQuery().in(that)
- query.select('#Image4').boundingClientRect(function(res){
- console.log(res.top);
- if (res && res.top && res.top<0 && !that.data.IsShowBtn){
- that.setData({
- IsShowBtn:true,
- });
- }
- else if (res && res.top && res.top>0 && that.data.IsShowBtn){
- that.setData({
- IsShowBtn:false,
- });
- }
- }).exec();
- }
- },
- showPay:function(){
- var that = this;
- main.getData("GetClassList?Flag=0", function (data) {
- if (data && data.length>0) {
- that.setData({
- IsShowPay:true,
- StartDate: common.formatDateCHS(data[0].StartDate),
- })
- }
- });
- },
- hidePay:function(){
- this.setData({
- IsShowPay:false,
- });
- },
- payMoney: function () {
- var that = this;
- var money = 1;
- var detail = {};
- detail.UserID = app.globalData.userInfo.UserID;
- detail.Introducer = app.globalData.userInfo.Introducer;
- detail.PayType=9;
- detail = JSON.stringify(detail);
- //console.log(detail);
- //console.log(money);
- var remark = null;
- main.payMoney(9, remark, money, detail, function () {
- that.setData({
- PanelShow:1,
- });
- wx.setNavigationBarColor({
- frontColor: "#000000",
- backgroundColorTop: "#ffffff",
- backgroundColor: "#ffffff",
- });
- if (app.globalData.userInfo.NickName=="陌生用户" && app.globalData.userInfo.IsShow == 1){
- wx.navigateTo({
- url: '../index/accredit',
- });
- }
- });
- },
- copyManager: function () {
- wx.setClipboardData({
- data: "秒过学习法",
- success(res) {
- wx.showModal({
- title: '已复制',
- showCancel: false,
- content: "请在微信添加公众号中长按粘贴。",
- confirmText: "知道了",
- });
- }
- });
- },
- gotoIndex: function () {
- wx.reLaunch({
- url: '../index/index',
- })
- },
- play:function(){
- var that=this;
- var isPlay=!that.data.IsPlay;
- if (isPlay){
- that.data.List[11].Image="bm_sy_12b";
- backgroundAudioManager.title = "暖暖爸致辞";
- backgroundAudioManager.src = app.globalData.uploadImageUrl+"web/_lesson/nuannuanbazhici.m4a";
- }
- else{
- that.data.List[11].Image="bm_sy_12a";
- backgroundAudioManager.pause();
- }
- that.setData({
- List:that.data.List,
- IsPlay:isPlay,
- });
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|