Commit 6f46027c authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/lvtz_home' into wxl-user-optimize

parents ae5bd04b 6a2b5da9
......@@ -129,7 +129,7 @@ Page({
this.getCircleDetail();
},
onReachBottom: function () { // Do something when page reach bottom.
this.memberListGet('up')
},
onShareAppMessage: function (option) { // return custom share data when user share.
......
import {
LocalStorage
} from '../../../utilities/index.js';
import {
unlockmodesdetail,
unlockclassstudent,
unlockmodesubjects
} from '../../../service/customer/morethemeindex.js';
import {
userShow,
} from '../../../service/customer/themeindex.js';
import {
activityLog,
formIdCreate
} from '../../../service/common.js';
import {
studentidentity
} from '../../../service/customer/signup.js'
var app = getApp();
Page({
data: {
localImageRoot: '../../../images/',
imageRoot: app.globalData.imageRoot,
password: '',
dailogShow: false,
moreTheme: '',
student: '',
pageShow: false,
tabIndex: 0,
subjects:''
},
onLoad: function (options) { // Do some initialize when page load.
const {
tid
} = options;
this.setData({
tid: tid || 0
})
app.getCurrentSchoolStudentId({
source_id: this.data.tid,
source_type: 9,
}).then(() => {
this.getModesDetail();
})
},
onReady: function () { // Do something when page ready.
// this.doAnimation()
},
onShow: function (options) { // Do something when page show.
this.getStudent();
this.getSubjects();
},
onHide: function () { // Do something when page hide.
},
onUnload: function () { // Do something when page close.
},
// 解锁模式详情
getModesDetail() {
unlockmodesdetail(this.data.tid).then((res) => {
const {
code,
data
} = res;
if (code == 200) {
this.setData({
moreTheme: data,
})
this.userShow();
const visitor = LocalStorage.getItem('visitor');
activityLog({
type: 22,
open_id: visitor && visitor.openid,
school_id: data.school_id,
remark: ''
})
}
}).catch((err) => {})
},
// 参与学生
getStudent() {
unlockclassstudent({
mode_id: this.data.tid
}).then((res) => {
const {
code,
data
} = res;
if (code == 200) {
this.setData({
student: data ? data.slice(0, 5) : [],
})
}
}).catch((err) => {})
},
goMoretheme(e) {
const {
item
} = e.currentTarget.dataset;
if (this.data.moreTheme.password) {
this.setData({
dailogShow: true
})
return false
}
wx.redirectTo({
url: `/src/pages/morethemeindex/index?id=${this.data.moreTheme.class_id}&tid=${this.data.tid}`
});
},
passwordInput(e) {
const {
value
} = e.detail;
this.setData({
password: value,
})
},
cancle() {
this.setData({
dailogShow: false
})
},
sure() {
if (this.data.password == this.data.moreTheme.password) {
wx.showToast({
title: '密码正确',
icon: 'none',
duration: 2000
})
wx.redirectTo({
url: `/src/pages/morethemeindex/index?id=${this.data.moreTheme.class_id}&tid=${this.data.tid}`
});
} else {
wx.showToast({
title: '密码错误',
icon: 'none',
duration: 2000
})
this.setData({
password: ''
})
}
},
userShow() {
const visitor = LocalStorage.getItem('visitor');
studentidentity({
class_id: this.data.moreTheme.class_id,
consumer_id: visitor && visitor.id
}).then((res) => {
const {
code,
data
} = res;
if (code == 200 && data) {
if (data.audit_status == 3) {
wx.redirectTo({
url: `/src/pages/morethemeindex/index?id=${this.data.moreTheme.class_id}&tid=${this.data.tid}`
});
}else{
this.setData({
pageShow:true
})
}
}else{
this.setData({
pageShow:true
})
}
}).catch(() => {
this.setData({
pageShow:true
})
})
},
handleTap(e){
const index = e.target.dataset.index;
this.setData({
tabIndex: index
})
},
getSubjects() {
unlockmodesubjects({
mode_id: this.data.tid
}).then((res) => {
const {
code,
data
} = res;
if (code == 200) {
this.setData({
subjects:data.list
})
}
}).catch((err) => {
wx.hideLoading()
})
},
formIdCreate(e) {
const {
formId
} = e.detail;
formIdCreate({
formId
})
},
})
\ No newline at end of file
{
"navigationBarTitleText": "分享闯关打卡",
"onReachBottomDistance": 100,
"enablePullDownRefresh": true,
"usingComponents": {
"list-loading": "../../../components/listloading",
"guidecollection": "../../../components/guidecollection"
}
}
\ No newline at end of file
<wxs src="./../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="sharemoretheme-box" wx:if="{{pageShow}}">
<view class="top-img-box"></view>
<view class="content-box">
<view class="title-box">{{moreTheme.title}}</view>
<view class="tab-box">
<view class="tab-item {{tabIndex==0?'act-item':''}}" data-index="{{0}}" bindtap="handleTap">介绍</view>
<view class="tab-item {{tabIndex==1?'act-item':''}}" style="margin-left: 295rpx" data-index="{{1}}" bindtap="handleTap">目录</view>
</view>
<view class="content-box1" wx:if="{{tabIndex==0}}">
<view class="unlock-box">关卡总数:{{moreTheme.subject_count || 0}}关</view>
<view class="rule-box">闯关规则:每日可闯{{moreTheme.unlock_limit || 0}}关;每关最多挑战{{moreTheme.max_clock_count || 0}}次</view>
</view>
<view class="content-box1 content-box2" wx:if="{{tabIndex==1}}">
<view class="list-item" wx:for="{{subjects}}" wx:key="index">{{item.title}}</view>
</view>
</view>
<view class="footer-box" bindtap="goMoretheme">
开始闯关
<form report-submit="true" bindsubmit="formIdCreate" class="createidform">
<button form-type="submit" class="createidbutton">
</button>
</form>
</view>
</view>
<view class="dailog-box" wx:if="{{dailogShow}}">
<view class="content-box" >
<view class="title" >该主题设有密码</view>
<view class="ipt-box" >
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="6" value="{{password}}" bindinput="passwordInput" placeholder="请输入密码"></input>
</view>
<view class="dailog-footer-box">
<view class="btn" bindtap="cancle">取消
<form report-submit="true" bindsubmit="formIdCreate" class="createidform">
<button form-type="submit" class="createidbutton"></button>
</form>
</view>
<view class="btn right" bindtap="sure">确定
<form report-submit="true" bindsubmit="formIdCreate" class="createidform">
<button form-type="submit" class="createidbutton"></button>
</form>
</view>
</view>
</view>
</view>
<guidecollection/>
</view>
\ No newline at end of file
.sharemoretheme-box{
min-height: 100vh;
}
.top-img-box{
width: 100%;
height: 548rpx;
background: url('https://cdn.img.shangjiadao.cn/source/images/dakav4/morethemeindex/unlockindex.png') no-repeat center;
background-size: 100% 100%;
}
.top-img-box image{
width: 100%;
height: 723rpx;
}
.content-box{
width:702rpx;
background:rgba(255,255,255,1);
border:1px solid rgba(205,205,205,1);
box-shadow:0px 5rpx 20prx 1rpx rgba(255,195,38,0.2);
border-radius:20rpx;
margin: 0 auto;
margin-top: -55rpx;
}
.content-box .title-box{
width: 100%;
font-size:40rpx;
font-family:PingFang-SC-Heavy;
font-weight:800;
color:rgba(70,70,70,1);
line-height:1;
padding: 55rpx 162rpx 70rpx 162rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
letter-spacing: 2rpx;
text-align: center;
}
.content-box .tab-box{
border-bottom: 1px solid rgba(0,0,0,.05);
padding: 0 138rpx;
position: relative;
}
.content-box .tab-box .tab-item{
display: inline-block;
padding-bottom: 25rpx;
font-size:28rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(0,0,0,.5);
line-height:1;
}
.content-box .tab-box .act-item{
font-size:30rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(249,187,0,1);
border-bottom: 8rpx solid rgba(255,209,70,1);
}
.content-box .unlock-box{
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(114,114,114,1);
line-height:1;
padding: 50rpx 0 63rpx 40rpx;
letter-spacing: 2rpx;
}
.content-box .rule-box{
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(114,114,114,1);
line-height:1;
padding: 0rpx 0 130rpx 40rpx;
letter-spacing: 2rpx;
}
.content-box .bottom-box{
height:90rpx;
background:rgba(244,244,247,1);
border-radius:0 0 20rpx 20rpx;
display: flex;
justify-content: center;
align-items: center;
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(114,114,114,1);
line-height:1;
letter-spacing: 2rpx;
}
.content-box .bottom-box .text{
padding-left: 14rpx;
letter-spacing: 2rpx;
}
.content-box .bottom-box image{
width:50rpx;
height:50rpx;
border-radius:50%;
margin-left: 14rpx;
}
.content-box2{
max-height: 216rpx;
overflow: scroll;
}
.footer-box{
width:440rpx;
height:100rpx;
border:1px solid rgba(244,244,244,1);
background:linear-gradient(90deg,rgba(255,222,40,1) 0%,rgba(255,175,37,1) 100%);
border-radius:50rpx;
margin: 0 auto;
margin-top: 115rpx;
display: flex;
justify-content: center;
align-items: center;
font-size:40rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(0,0,0,1);
line-height:1;
margin-bottom: 63rpx;
letter-spacing: 2rpx;
position: relative;
}
.dailog-box{
width: 100%;
height: 100%;
background:rgba(0,0,0,.5);
position: fixed;
left: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
letter-spacing: 2rpx;
}
.dailog-box .content-box{
width:599rpx;
background:rgba(255,255,255,1);
border-radius:20rpx;
}
.dailog-box .content-box .title{
font-size:32rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(0,0,0,1);
line-height:1;
text-align: center;
padding: 48rpx 0 90rpx 0;
}
.dailog-box .content-box .ipt-box{
padding: 0 40rpx;
padding-bottom: 80rpx;
}
.dailog-box .content-box .ipt-box .iteminput{
border: none;
}
.placeholderclass{
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(170,170,170,1);
}
.dailog-box .dailog-footer-box{
height: 95rpx;
border-top: 1px solid rgba(0,0,0,.05);
display: flex;
}
.dailog-box .dailog-footer-box .btn{
flex: 1;
display: flex;
justify-content: center;
align-items: center;
font-size:30rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
position: relative;
}
.dailog-box .dailog-footer-box .right{
color:rgba(255,209,70,1);
border-left: 1px solid rgba(0,0,0,.05);
}
.content-box .list-item{
padding: 17rpx 0 28rpx 41rpx;
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(114,114,114,1);
line-height:1;
border-bottom: 1px solid rgba(0,0,0,.05);
}
\ 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