|
@@ -27,9 +27,28 @@ Page({
|
|
|
pageNo: 1,
|
|
|
pageSize: 3,
|
|
|
goBackHome: false,
|
|
|
- isIOS: app.globalData.isIOS
|
|
|
+ isIOS: app.globalData.isIOS,
|
|
|
+ alertFlag: false,
|
|
|
+ modalType: "text",
|
|
|
+ modalText: [{
|
|
|
+ text: '您还不是本课程的会员',
|
|
|
+ type: 'bigOrange'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '您可以开团,拼团成功获得使用权',
|
|
|
+ type: 'normal'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ modalBtnText:'去开团',
|
|
|
+ isModalShow: false,
|
|
|
+ modalCloseShow: true
|
|
|
|
|
|
},
|
|
|
+ showAlert: function () {
|
|
|
+ this.setData({
|
|
|
+ alertFlag: !this.data.alertFlag
|
|
|
+ })
|
|
|
+ },
|
|
|
onLoad: function (option) {
|
|
|
let id = option.id ? option.id : option.scene.replace('QR', '')
|
|
|
if (option.scene || option.shareCard) {
|
|
@@ -42,7 +61,6 @@ Page({
|
|
|
})
|
|
|
this.uid = wx.getStorageSync('uid');
|
|
|
let stackSize = 1;
|
|
|
- console.log(option.stackSize)
|
|
|
if (option.stackSize) {
|
|
|
stackSize = option.stackSize;
|
|
|
}
|
|
@@ -65,7 +83,7 @@ Page({
|
|
|
},
|
|
|
onUnload: function () {
|
|
|
if (this.innerAudioContext) {
|
|
|
- this.innerAudioContext.pause();
|
|
|
+ this.innerAudioContext.destroy();
|
|
|
}
|
|
|
let videoCtx = wx.createVideoContext('worksVideo', this);
|
|
|
videoCtx.stop();
|
|
@@ -118,12 +136,12 @@ Page({
|
|
|
},
|
|
|
videoPlayHandler: function () {
|
|
|
this.setData({
|
|
|
- videoLoad: true
|
|
|
+ videoLoad: true
|
|
|
}, () => {
|
|
|
- this.videoCtx = wx.createVideoContext('worksVideo', this);
|
|
|
- this.videoCtx.play();
|
|
|
+ this.videoCtx = wx.createVideoContext('worksVideo', this);
|
|
|
+ this.videoCtx.play();
|
|
|
})
|
|
|
- },
|
|
|
+ },
|
|
|
likeWorks: function (e) {
|
|
|
if (this.data.isLike) {
|
|
|
wx.showToast({
|
|
@@ -161,12 +179,24 @@ Page({
|
|
|
this.shareDialog.share(data);
|
|
|
},
|
|
|
videoPlay: function () {
|
|
|
+
|
|
|
this.innerAudioContext.play();
|
|
|
- httpRequestApi.playWorks(this.uid, this.data.id);
|
|
|
+ this.innerAudioContext.pause();
|
|
|
+ wx.showToast({
|
|
|
+ title: '加载中',
|
|
|
+ icon: 'loading',
|
|
|
+ duration: 600
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.innerAudioContext.play();
|
|
|
+ }, 800)
|
|
|
+ httpRequestApi.playWorks(this.uid, this.data.id).success(() => {
|
|
|
+ console.log('容个错')
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
videoEnd: function () {
|
|
|
- this.innerAudioContext.destroy();
|
|
|
+ this.innerAudioContext.stop();
|
|
|
},
|
|
|
videoPause: function () {
|
|
|
this.innerAudioContext.pause();
|
|
@@ -175,6 +205,9 @@ Page({
|
|
|
const classId = this.data.classId;
|
|
|
httpRequestApi.checkLesson(classId).success(res => {
|
|
|
const productId = res.data.data[0];
|
|
|
+ this.setData({
|
|
|
+ productId
|
|
|
+ })
|
|
|
httpRequestApi.areYouSuper(res.data.data).success(res => {
|
|
|
if (res.data.success) {
|
|
|
wx.navigateTo({
|
|
@@ -196,20 +229,24 @@ Page({
|
|
|
|
|
|
|
|
|
|
|
|
- wx.showModal({
|
|
|
- title: '您未购买过本书,不能朗读',
|
|
|
- content: '超值团购进行中,快去看看',
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- console.log('用户点击确定')
|
|
|
- wx.navigateTo({
|
|
|
- url: `../../groupPage/grade-details/grade-details?productId=${productId}`
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消')
|
|
|
- }
|
|
|
- }
|
|
|
+ console.log('chulaiba')
|
|
|
+ this.setData({
|
|
|
+ isModalShow: true
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
});
|
|
@@ -257,11 +294,13 @@ Page({
|
|
|
|
|
|
let followUid = e.currentTarget.dataset.id;
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
- httpRequestApi.likeCommend(this.uid, followUid).success(res => {
|
|
|
+ httpRequestApi.likeCommend(this.uid, followUid).success(res => {
|
|
|
console.log(res);
|
|
|
const str = `replyList[${index}].likes`;
|
|
|
+ const strImg = `replyList[${index}].isLike`;
|
|
|
this.setData({
|
|
|
- [str]: res.data.data.favors
|
|
|
+ [str]: res.data.data.favors,
|
|
|
+ [strImg]: true
|
|
|
})
|
|
|
});
|
|
|
},
|
|
@@ -277,12 +316,12 @@ Page({
|
|
|
this.data.stackSize++;
|
|
|
console.log(this.data.stackSize)
|
|
|
if (this.data.stackSize >= 3) {
|
|
|
- console.log('跳转',this.data.stackSize)
|
|
|
+ console.log('跳转', this.data.stackSize)
|
|
|
wx.redirectTo({
|
|
|
url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}&stackSize=${this.data.stackSize}`
|
|
|
})
|
|
|
} else {
|
|
|
- console.log('下一个页面',this.data.stackSize)
|
|
|
+ console.log('下一个页面', this.data.stackSize)
|
|
|
wx.navigateTo({
|
|
|
url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}&stackSize=${this.data.stackSize}`
|
|
|
})
|
|
@@ -304,11 +343,12 @@ Page({
|
|
|
temp.avatar = item.user.avatar;
|
|
|
temp.profession = item.user.profession;
|
|
|
temp.uid = item.user.uid;
|
|
|
- temp.text = item.detailDesc;
|
|
|
+ temp.text = decodeURI(item.detailDesc);
|
|
|
temp.id = item.id;
|
|
|
temp.replyCount = item.replyCount;
|
|
|
- temp.time = formatDate(item.gmtModified, 3);
|
|
|
+ temp.time = formatDate(item.gmtCreated, 3);
|
|
|
temp.likes = item.postsAttributeInfo.favors || 0;
|
|
|
+ temp.isLike = item.isLike;
|
|
|
this.data.replyList.push(temp);
|
|
|
});
|
|
|
this.setData({
|
|
@@ -339,7 +379,7 @@ Page({
|
|
|
let data = {
|
|
|
"columnId": this.data.id,
|
|
|
colunmNames: 'what',
|
|
|
- "detailDesc": this.data.inputValue
|
|
|
+ "detailDesc": encodeURI(this.data.inputValue)
|
|
|
}
|
|
|
httpRequestApi.postReply(this.uid, data).success(res => {
|
|
|
this.setData({
|
|
@@ -430,24 +470,24 @@ Page({
|
|
|
httpRequestApi.rewardMoney(this.uid, data).success(res => {
|
|
|
if (res.data.message) {
|
|
|
wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: res.data.message,
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- console.log('用户点击确定')
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消')
|
|
|
+ title: '提示',
|
|
|
+ content: res.data.message,
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ console.log('用户点击确定')
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消')
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
})
|
|
|
return false;
|
|
|
- }
|
|
|
- this.payMoneyt(res.data.data);
|
|
|
+ }
|
|
|
+ this.payMoney(res.data.data);
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
- payMoneyt: function (orderInfo) {
|
|
|
+ payMoney: function (orderInfo) {
|
|
|
wx.requestPayment({
|
|
|
'appId': orderInfo.appId,
|
|
|
'timeStamp': orderInfo.timeStamp,
|
|
@@ -455,22 +495,28 @@ Page({
|
|
|
'package': orderInfo.package,
|
|
|
'signType': orderInfo.signType,
|
|
|
'paySign': orderInfo.sign,
|
|
|
- 'success': function (res) {
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '支付成功',
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- this.setData({
|
|
|
- ifReward: false
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- this.setData({
|
|
|
- ifReward: false
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ 'success': res => {
|
|
|
+ this.setData({
|
|
|
+ modalType: 'image',
|
|
|
+ isModalShow: true,
|
|
|
+ modalCloseShow: false,
|
|
|
+ modalBtnText: '确定'
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
},
|
|
|
'fail': function (res) {
|
|
@@ -486,5 +532,29 @@ Page({
|
|
|
wx.redirectTo({
|
|
|
url: '../../index/index'
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ modalConfirmHandler: function () {
|
|
|
+
|
|
|
+ if (this.data.modalType === 'image') {
|
|
|
+ this.setData({
|
|
|
+ modalType: 'text',
|
|
|
+ isModalShow: false,
|
|
|
+ ifReward: false,
|
|
|
+ modalCloseShow: true,
|
|
|
+ modalBtnText: "去开团"
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ isModalShow: false
|
|
|
+ })
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `../../groupPage/grade-details/grade-details?productId=${this.data.productId}`
|
|
|
+ })
|
|
|
+ },
|
|
|
+ modalCloseHandler: function () {
|
|
|
+ this.setData({
|
|
|
+ isModalShow: false
|
|
|
+ })
|
|
|
+ },
|
|
|
})
|