|
@@ -296,7 +296,7 @@
|
|
|
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
|
|
|
scrollTop: 0,
|
|
|
height: '0px',
|
|
|
- isLogin: true,
|
|
|
+ isLogin: false,
|
|
|
videoUrl: "",
|
|
|
videoId: "",
|
|
|
//现在的时长
|
|
@@ -552,7 +552,7 @@
|
|
|
// 当开始/继续播放时触发play事件
|
|
|
getPlay() {
|
|
|
this.errorCount = 0
|
|
|
- this.judgeDuration()
|
|
|
+ // this.judgeDuration()
|
|
|
},
|
|
|
getPause() {
|
|
|
this.clearIntegral()
|
|
@@ -866,7 +866,8 @@
|
|
|
// 答题成功
|
|
|
this.errTitle = "恭喜你,回答正确"
|
|
|
this.errDesc = `请选择奖励`
|
|
|
- this.$refs.answerPopup.open("center")
|
|
|
+ // this.$refs.answerPopup.open("center")
|
|
|
+ this.closeAnswerPopup(1)
|
|
|
}
|
|
|
} else {
|
|
|
if (res.msg == "该课题到达答错次数限制") {
|
|
@@ -888,28 +889,38 @@
|
|
|
rewardChange(e) {
|
|
|
this.currentReward = e.detail.value
|
|
|
},
|
|
|
- closeAnswerPopup() {
|
|
|
+ closeAnswerPopup(type) {
|
|
|
this.$refs.answerPopup.close()
|
|
|
if (this.errTitle == '恭喜你,回答正确') {
|
|
|
- const param = {
|
|
|
+ let param = {
|
|
|
...this.urlOption,
|
|
|
rewardType: Number(this.currentReward),
|
|
|
- source: 2
|
|
|
+ source: 2,
|
|
|
+ appId: getApp().globalData.appId
|
|
|
+ }
|
|
|
+ if(type == 1) {
|
|
|
+ param = {
|
|
|
+ ...this.urlOption,
|
|
|
+ source: 2,
|
|
|
+ appId: getApp().globalData.appId
|
|
|
+ }
|
|
|
}
|
|
|
sendReward(param).then(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- // if(res.code == 200) {
|
|
|
- // //重构 发红包,后台通过OPENID发零钱到 账
|
|
|
- // //this.initWXConfig(res.package)
|
|
|
- // }else {
|
|
|
- // uni.showToast({
|
|
|
- // title: res.msg,
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if(res.isNew&&res.isNew==1) {
|
|
|
+ const packageInfo = res.data.packageInfo || ''
|
|
|
+ if(packageInfo) {
|
|
|
+ uni.setStorageSync('receive_package',packageInfo);
|
|
|
+ if(res.mchId) uni.setStorageSync('mchId',res.mchId);
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages_course/reward'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -1049,48 +1060,43 @@
|
|
|
})
|
|
|
},
|
|
|
goLogin() {
|
|
|
- this.$getProvider().then(provider=>{
|
|
|
- console.log('当前的环境商',provider)
|
|
|
- if (!provider) {
|
|
|
- reject()
|
|
|
- }
|
|
|
- uni.login({
|
|
|
- provider: provider,
|
|
|
- success: async loginRes => {
|
|
|
- console.log(loginRes)
|
|
|
- uni.getUserInfo({
|
|
|
- provider: provider,
|
|
|
- success: (infoRes)=> {
|
|
|
- uni.showToast({
|
|
|
- title: '处理中...',
|
|
|
- icon: 'loading'
|
|
|
- });
|
|
|
- loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv}).then(res=>{
|
|
|
- uni.hideLoading();
|
|
|
- if (res.code == 200) {
|
|
|
- uni.setStorageSync(TOKEN_KEY, res.token);
|
|
|
- uni.setStorageSync('userInfo', JSON.stringify(res.user));
|
|
|
- this.user = res.user
|
|
|
- this.isLogin = true
|
|
|
- this.getIsAddKf()
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
- }).catch(err=>{
|
|
|
- uni.hideLoading();
|
|
|
+ let provider = 'weixin'
|
|
|
+ uni.login({
|
|
|
+ provider: provider,
|
|
|
+ success: async loginRes => {
|
|
|
+ console.log(loginRes)
|
|
|
+ uni.getUserInfo({
|
|
|
+ provider: provider,
|
|
|
+ success: (infoRes)=> {
|
|
|
+ uni.showToast({
|
|
|
+ title: '处理中...',
|
|
|
+ icon: 'loading'
|
|
|
+ });
|
|
|
+ loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv}).then(res=>{
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.setStorageSync(TOKEN_KEY, res.token);
|
|
|
+ uni.setStorageSync('userInfo', JSON.stringify(res.user));
|
|
|
+ this.user = res.user
|
|
|
+ this.isLogin = true
|
|
|
+ this.getIsAddKf()
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
- icon:'none',
|
|
|
- title: "登录失败,请重新登录",
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
});
|
|
|
+ }
|
|
|
+ }).catch(err=>{
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title: "登录失败,请重新登录",
|
|
|
});
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(err => {})
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
getLink() {
|
|
|
let that = this;
|
|
@@ -1705,6 +1711,7 @@
|
|
|
}
|
|
|
}
|
|
|
.warning {
|
|
|
+ flex-shrink: 0;
|
|
|
color: #888;
|
|
|
font-size: 24rpx;
|
|
|
@include u-flex(column, center, center);
|
|
@@ -1907,6 +1914,7 @@
|
|
|
@include u-flex(row, center, flex-start);
|
|
|
background-color: #fff;
|
|
|
.warning {
|
|
|
+ flex-shrink: 0;
|
|
|
padding-right: 20rpx;
|
|
|
}
|
|
|
}
|