Commit 3f19d903 authored by lvtz's avatar lvtz

fix

parent 532376ce
...@@ -211,14 +211,6 @@ function subjectClassStudent (data) {//主题打卡学员 ...@@ -211,14 +211,6 @@ function subjectClassStudent (data) {//主题打卡学员
errorresolve: 1, errorresolve: 1,
}) })
} }
function subjectSignStudents (data) {//主题报名学员
return wxRequest({
url: apis.customer.circleIndex.subjectStudents,
data,
method: 'GET',
errorresolve: 1,
})
}
function scoreTrend (data) { function scoreTrend (data) {
return wxRequest({ return wxRequest({
url: apis.customer.scoreStatic.scoreTrend, url: apis.customer.scoreStatic.scoreTrend,
...@@ -261,7 +253,6 @@ export { ...@@ -261,7 +253,6 @@ export {
mineClassList, mineClassList,
studentTasks, studentTasks,
subjectClassStudent, subjectClassStudent,
subjectSignStudents,
reviewScore, reviewScore,
scoreTrend, scoreTrend,
} }
\ No newline at end of file
...@@ -50,11 +50,37 @@ function getmycalendar (data) { ...@@ -50,11 +50,37 @@ function getmycalendar (data) {
errorresolve: 1, errorresolve: 1,
}) })
} }
function getmycalendar (data) {
return wxRequest({
url: apis.customer.themeIndex.mycalendar,
data,
method: 'GET',
errorresolve: 1,
})
}
function subjectSignStudents (data) {//主题报名学员
return wxRequest({
url: apis.customer.circleIndex.subjectStudents,
data,
method: 'GET',
errorresolve: 1,
})
}
function subjectStudentSign (data) {//主题学员报名
return wxRequest({
url: apis.customer.circleIndex.subjectStudents,
data,
method: 'POST',
errorresolve: 1,
})
}
export { export {
themeDetail, themeDetail,
userShow, userShow,
organizationUserShow, organizationUserShow,
getclockread, getclockread,
putclockread, putclockread,
getmycalendar getmycalendar,
subjectSignStudents,
subjectStudentSign
} }
\ No newline at end of file
...@@ -8,10 +8,14 @@ import { ...@@ -8,10 +8,14 @@ import {
getPrize, getPrize,
newLikeIndex, newLikeIndex,
newCommentIndex, newCommentIndex,
subjectSignStudents
} from "../../../service/customer/circleindex.js"; } from "../../../service/customer/circleindex.js";
import { userShow, themeDetail } from "../../../service/customer/themeindex.js"; import {
userShow,
themeDetail,
subjectSignStudents,
subjectStudentSign
} from "../../../service/customer/themeindex.js";
import { wxPreviewImage } from "../../../utilities/wxApi.js"; import { wxPreviewImage } from "../../../utilities/wxApi.js";
import { import {
posterLog, posterLog,
...@@ -20,10 +24,14 @@ import { ...@@ -20,10 +24,14 @@ import {
getActivities getActivities
} from "../../../service/common.js"; } from "../../../service/common.js";
import { getSchoolDetail } from "../../../service/customer/schoolindex.js"; import { getSchoolDetail } from "../../../service/customer/schoolindex.js";
import { activityprizestatus } from "../../../service/customer/activity.js"; import {
getwechatmobile,
activityprizestatus
} from "../../../service/customer/activity.js";
import { LocalStorage, scenQueryGet, imagify } from "../../../utilities/index.js"; import { LocalStorage, scenQueryGet, imagify } from "../../../utilities/index.js";
import regexp from "../../../constants/regexp.js"; import regexp from "../../../constants/regexp.js";
import { studentidentity } from "../../../service/customer/signup.js"; import { studentidentity } from "../../../service/customer/signup.js";
var app = getApp(); var app = getApp();
Page({ Page({
mixins: [require("../../../mixins/myMins/audioCallback")], mixins: [require("../../../mixins/myMins/audioCallback")],
...@@ -143,6 +151,7 @@ Page({ ...@@ -143,6 +151,7 @@ Page({
onLoad: function(options, b) { onLoad: function(options, b) {
// Do some initialize when page load. // Do some initialize when page load.
const visitor = LocalStorage.getItem("visitor"); const visitor = LocalStorage.getItem("visitor");
let that = this;
if (options.scene) { if (options.scene) {
let sceneQuery = scenQueryGet(options.scene); let sceneQuery = scenQueryGet(options.scene);
const { i, t, c } = sceneQuery; const { i, t, c } = sceneQuery;
...@@ -195,6 +204,15 @@ Page({ ...@@ -195,6 +204,15 @@ Page({
}); });
}); });
this.subjectSignStudents(); this.subjectSignStudents();
wx.login({
success(res) {
console.log(res,'load')
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode
})
}
})
}, },
onShow: function(options) { onShow: function(options) {
if (this.data.needREfresh || this.data.needRefresh) { if (this.data.needREfresh || this.data.needRefresh) {
...@@ -810,6 +828,7 @@ Page({ ...@@ -810,6 +828,7 @@ Page({
}, },
// 去打卡 // 去打卡
goClock(e) { goClock(e) {
// 先授权
const visitor = LocalStorage.getItem("visitor"); const visitor = LocalStorage.getItem("visitor");
if (this.data.circleInfo.had_password) { if (this.data.circleInfo.had_password) {
this.setData({ this.setData({
...@@ -1156,5 +1175,89 @@ Page({ ...@@ -1156,5 +1175,89 @@ Page({
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
},
// 获取手机号 学员报名
getPhoneNumber(e) {
const visitor = LocalStorage.getItem('visitor');
let that = this;
const {
encryptedData,
iv
} = e.detail
if (!encryptedData) {
wx.login({
success(res) {
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode
})
}
})
wx.showToast({
title: '授权失败',
icon: 'none',
duration: 2000
})
return
} else {
}
// wx.showLoading({
// title: '手机号获取中',
// })
getwechatmobile({
code: this.data.sessionCode,
encryptData: encryptedData,
iv
}).then((res) => {
wx.hideLoading();
const { code, data } = res;
if (code == 200 && data && data.mobile) {
this.joinClock(data.mobile)
console.log(res,'res')
} else {
wx.showToast({
title: '手机号获取失败',
icon: 'none',
duration: 2000
})
}
wx.login({
success(res) {
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode
})
}
})
}).catch((err) => {
wx.hideLoading()
wx.login({
success(res) {
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode
})
}
})
})
},
joinClock(mobile) {
subjectStudentSign ({
subject_source_id: this.data.tid,
subject_source_type: 1,
mobile
}).then((res) => {
const {code, data} = res;
if (code == 200) {
this.goClock()
} else {
wx.showToast({
title: '加入失败'
})
}
}).catch((err) => {
console.log(err)
})
} }
}); });
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="shadow-box"></view> <view class="shadow-box"></view>
<view class="title-box"> <view class="title-box">
<view class="title">{{themeSelect.title}}</view> <view class="title">{{themeSelect.title}}</view>
<view class="time">老师 {{themeSelect.created_at}} 发布</view> <view class="time">老师 {{themeSelect.start_time}} 发布</view>
</view> </view>
</view> </view>
<view class="instro-bx" wx:if="{{themeSelect.land_content && themeSelect.land_content.length>0}}"> <view class="instro-bx" wx:if="{{themeSelect.land_content && themeSelect.land_content.length>0}}">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<!-- <view class="text" bindtap="goInviteFriend">邀请好友</view> --> <!-- <view class="text" bindtap="goInviteFriend">邀请好友</view> -->
<view class="section recomend-clockbox"> <view class="section recomend-clockbox">
<view class="title">精选打卡预览(156篇打卡)</view> <view class="title">精选打卡预览({{clockTotal}}篇打卡)</view>
<block wx:if="{{themeSelect.is_cheat == 0 || (themeSelect.is_cheat == 1 && isClock) || (themeSelect.is_cheat == 1 && !isSchoolStudent) || (clockTotal + selfcount) == 0}}"> <block wx:if="{{themeSelect.is_cheat == 0 || (themeSelect.is_cheat == 1 && isClock) || (themeSelect.is_cheat == 1 && !isSchoolStudent) || (clockTotal + selfcount) == 0}}">
<view class="clock-list" wx:if="{{!emptyPage}}"> <view class="clock-list" wx:if="{{!emptyPage}}">
<block wx:for="{{clockList}}" wx:key="bigindex" wx:for-index="bigindex" wx:for-item="bigitem"> <block wx:for="{{clockList}}" wx:key="bigindex" wx:for-index="bigindex" wx:for-item="bigitem">
...@@ -121,7 +121,8 @@ ...@@ -121,7 +121,8 @@
<view class="tip">邀请你加入</view> <view class="tip">邀请你加入</view>
</view> </view>
</view> </view>
<view class="btn btn-clock" bindtap="goClock">加入打卡</view> <!-- <button class="btn btn-clock" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">加入打卡</button> -->
<button class="btn btn-clock" bindtap="goClock">加入打卡</button>
</view> </view>
<view class="footer-innerbox" wx:if="{{!true}}"> <view class="footer-innerbox" wx:if="{{!true}}">
<view class="btn btn-home" bindtap="goWebsiteIndex"> <view class="btn btn-home" bindtap="goWebsiteIndex">
......
...@@ -219,6 +219,7 @@ page { ...@@ -219,6 +219,7 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 0;
} }
.footer-box .footer-innerbox .btn-inviteinfo { .footer-box .footer-innerbox .btn-inviteinfo {
flex: 1; flex: 1;
......
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