Commit ef36a12c authored by lvtz's avatar lvtz

Merge branch 'wxl-user-optimize' of git.server:wangxuelai/wechatapp.shangjiadao.com into lvtz_clock

parents ed83cd7d c0e14121
...@@ -1546,5 +1546,10 @@ Page({ ...@@ -1546,5 +1546,10 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/themeeditor/index?tid=${this.data.tid}&sid=${this.data.sid}&editType=2` url: `/business/pages/themeeditor/index?tid=${this.data.tid}&sid=${this.data.sid}&editType=2`
}); });
},
goEditLandcontent () {
wx.navigateTo({
url: `/business/pages/themead/index?id=${this.data.params.content_id}&sid=${this.data.sid}&editType=2`
})
} }
}); });
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
<image class="icon-arr" src="{{imageRoot}}2b/themeindex/setting_right.png"></image> <image class="icon-arr" src="{{imageRoot}}2b/themeindex/setting_right.png"></image>
</view> </view>
</view> </view>
<view class="setting-item"> <view class="setting-item" bindtap="goEditLandcontent">
<view class="left"> <view class="left">
<view class="item-label">打卡营销页设置</view> <view class="item-label">打卡营销页设置</view>
<view class="item-desc">配置此页面后可在学生加入打卡前展示,此功能可收集有意向学生的联系方式。 <text class="more-tip">了解更多</text></view> <view class="item-desc">配置此页面后可在学生加入打卡前展示,此功能可收集有意向学生的联系方式。 <text class="more-tip">了解更多</text></view>
......
...@@ -486,13 +486,13 @@ Page({ ...@@ -486,13 +486,13 @@ Page({
!needIosWarn !needIosWarn
) { ) {
if (mockStatus == 2) { if (mockStatus == 2) {
itemList = [text, "删除"]; itemList = ['复制', text, "删除"];
} else { } else {
itemList = ["发布", text, "删除"]; itemList = ["发布", text, "删除"];
} }
} else { } else {
if (mockStatus == 2) { if (mockStatus == 2) {
itemList = [text, "删除", "取消"]; itemList = ['复制', text, "删除", "取消"];
} else { } else {
itemList = ["发布", text, "删除", "取消"]; itemList = ["发布", text, "删除", "取消"];
} }
...@@ -503,12 +503,12 @@ Page({ ...@@ -503,12 +503,12 @@ Page({
itemList: itemList, itemList: itemList,
success(res) { success(res) {
const { tapIndex } = res; const { tapIndex } = res;
// if (tapIndex == 0) { if (tapIndex == 0 && mockStatus == 2) {
// that.setData({ const url = `/business/pages/themeeditor/index?tid=${theme.id}&sid=${that.data.sid}&classes=${encodeURIComponent('[]')}&editType=${theme.subject_type}&clone=1`;
// showcopybox: true, wx.navigateTo({
// selectedtheme: theme url,
// }) })
// } else }
if (tapIndex == 0 && mockStatus != 2) { if (tapIndex == 0 && mockStatus != 2) {
if (that.data.unlockHadEditTatol > 0) { if (that.data.unlockHadEditTatol > 0) {
unlockSubjectRelease({ unlockSubjectRelease({
...@@ -537,13 +537,10 @@ Page({ ...@@ -537,13 +537,10 @@ Page({
}); });
} }
} }
if ( if ( tapIndex == 1 ) {
(tapIndex == 0 && mockStatus == 2) ||
(tapIndex == 1 && mockStatus != 2)
) {
that.unlocksubjectplacetop(theme); that.unlocksubjectplacetop(theme);
} }
if ((tapIndex == 1 && mockStatus == 2) || tapIndex == 2) { if (tapIndex == 2) {
that.setData({ that.setData({
deleteBox: true, // 确认删除主题 deleteBox: true, // 确认删除主题
deleteTheme: theme, deleteTheme: theme,
...@@ -569,10 +566,14 @@ Page({ ...@@ -569,10 +566,14 @@ Page({
success(res) { success(res) {
const { tapIndex } = res; const { tapIndex } = res;
if (tapIndex == 0) { if (tapIndex == 0) {
that.setData({ // that.setData({
showcopybox: true, // showcopybox: true,
selectedtheme: theme // selectedtheme: theme
}); // });
const url = `/business/pages/themeeditor/index?tid=${theme.id}&sid=${that.data.sid}&classes=${encodeURIComponent('[]')}&editType=${theme.subject_type}&clone=1`;
wx.navigateTo({
url,
})
} }
if (tapIndex == 1) { if (tapIndex == 1) {
that.subjectsplacetop(theme, listindex, index); that.subjectsplacetop(theme, listindex, index);
...@@ -687,15 +688,10 @@ Page({ ...@@ -687,15 +688,10 @@ Page({
this.setData({ this.setData({
showcopybox: false showcopybox: false
}); });
if (this.data.selectedtheme.subject_type == 1) { const url = `/business/pages/themeeditor/index?tid=${this.data.selectedtheme.id}&sid=${this.data.sid}&classes=${encodeURIComponent('[]')}&editType=${this.data.selectedtheme.subject_type}&clone=1`;
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/themeeditor/index?tid=${this.data.selectedtheme.id}&id=${this.data.selectedCopyClass}&clone=1&sid=${this.data.sid}` url,
}); })
} else if (this.data.selectedtheme.subject_type == 2) {
wx.navigateTo({
url: `/business/pages/calendarthemeeditor/index?tid=${this.data.selectedtheme.id}&id=${this.data.selectedCopyClass}&clone=1&sid=${this.data.sid}`
});
}
}, },
// 删除打卡主题 // 删除打卡主题
......
...@@ -169,21 +169,54 @@ Page({ ...@@ -169,21 +169,54 @@ Page({
}) })
return; return;
} }
if (this.data.has_subject) {
wx.showModal({
title: '修改后的模板将覆盖之前的内容',
confirmText: '确定',
// showCancel: false,
success(res) {
if (res.confirm) {
that.saveLockPost();
}
}
})
return;
}
this.saveLockPost();
},
saveLockPost() {
const that = this;
const { params } = this.data
// if (params.title.trim() == '') {
// wx.showToast({
// title: '请输入模板名称',
// duration: 1500,
// icon: 'none',
// })
// return;
// }
// if (params.name.trim() == '') {
// wx.showToast({
// title: '请输入老师姓名',
// duration: 1500,
// icon: 'none',
// })
// return;
// }
// if (params.mobile == '' && params.img=='') {
// wx.showToast({
// title: '请添加手机号码或者上传微信二维码',
// duration: 1500,
// icon: 'none',
// })
// return;
// }
if (this.data.publishing) { if (this.data.publishing) {
return return
} }
this.data.publishing = true; this.data.publishing = true;
const sjdMediaEditor = this.selectComponent('#sjd-media-editor');
let content = JSON.parse(JSON.stringify(sjdMediaEditor.data.content));
let _content = content.filter((ele) => ele.value.trim() != '');
_content.forEach((ele) => {
if (ele.type == 'video' && ele.poster) {
delete ele.poster;
}
})
params.content = JSON.stringify(_content);
const { introduceContent } = this.data; const { introduceContent } = this.data;
const sjdMediaEditorList = [] const sjdMediaEditorList = [];
for(let i = 0; i<introduceContent.length; i++){ for(let i = 0; i<introduceContent.length; i++){
const sjdMediaEditor = this.selectComponent(`#sjd-media-editor${i}`); const sjdMediaEditor = this.selectComponent(`#sjd-media-editor${i}`);
let content = JSON.parse(JSON.stringify(sjdMediaEditor.data.content)); let content = JSON.parse(JSON.stringify(sjdMediaEditor.data.content));
...@@ -200,7 +233,6 @@ Page({ ...@@ -200,7 +233,6 @@ Page({
} catch (error) { } catch (error) {
} }
wx.showLoading({ wx.showLoading({
title: '保存中...' title: '保存中...'
}); });
......
{ {
"navigationBarTitleText": "打卡营销页设置", "navigationBarTitleText": "营销页设置",
"usingComponents": { "usingComponents": {
"sjd-media-editor": "../../../components/sjdmediaeditor", "sjd-media-editor": "../../../components/sjdmediaeditor",
"w-switch": "/dist/w-switch/index", "w-switch": "/dist/w-switch/index",
......
...@@ -30,8 +30,10 @@ ...@@ -30,8 +30,10 @@
<view class="tips">点击修改标题,最多15个字</view> <view class="tips">点击修改标题,最多15个字</view>
</view> --> </view> -->
<view> <view>
<sjd-media-editor content="{{item.content}}" <sjd-media-editor
id="sjd-media-editor{{index}}" sid="{{sid}}" content="{{item.content}}"
id="sjd-media-editor{{index}}"
sid="{{sid}}"
haveAddVoice="{{true}}" haveAddVoice="{{true}}"
haveAddWxfile="{{true}}" haveAddWxfile="{{true}}"
bind:addVoice="addVoice" bind:addVoice="addVoice"
......
...@@ -69,6 +69,7 @@ Page({ ...@@ -69,6 +69,7 @@ Page({
page: this.data.page, page: this.data.page,
perPage: this.data.perPage, perPage: this.data.perPage,
school_id:this.data.sid, school_id:this.data.sid,
first_id: this.data.id
}).then((res) => { }).then((res) => {
const { code, data } = res; const { code, data } = res;
this.setData({ this.setData({
...@@ -80,6 +81,7 @@ Page({ ...@@ -80,6 +81,7 @@ Page({
if (data.total) { if (data.total) {
this.data.total = data.total; this.data.total = data.total;
} }
// data.list = data.list.splice(1,2);
data.list.forEach((ele) => { data.list.forEach((ele) => {
let content = []; let content = [];
try { try {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
min-height: 100vh; min-height: 100vh;
background-color: #fff; background-color: #fff;
padding: 0 20rpx 28rpx; padding: 0 20rpx 28rpx;
position: relative;
} }
.helpenterbox { .helpenterbox {
text-align: right; text-align: right;
...@@ -11,6 +12,9 @@ ...@@ -11,6 +12,9 @@
color: #16b0fd; color: #16b0fd;
font-size: 22rpx; font-size: 22rpx;
} }
.listbox {
position: relative;
}
.listitem { .listitem {
border: 1px solid #ebedf0; border: 1px solid #ebedf0;
border-radius: 4rpx; border-radius: 4rpx;
...@@ -80,7 +84,7 @@ ...@@ -80,7 +84,7 @@
border-radius: 4rpx; border-radius: 4rpx;
} }
.btn-add { .btn-add {
position: fixed; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
height: 148rpx; height: 148rpx;
......
...@@ -293,7 +293,7 @@ Page({ ...@@ -293,7 +293,7 @@ Page({
}); });
} else if (editType == 2) { } else if (editType == 2) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '编辑作业打卡' title: '编辑日历打卡'
}) })
this.loadCalendarThemeData({ this.loadCalendarThemeData({
tid, tid,
...@@ -301,7 +301,7 @@ Page({ ...@@ -301,7 +301,7 @@ Page({
}); });
} else if (editType == 3) { } else if (editType == 3) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '编辑作业打卡' title: '编辑闯关打卡'
}) })
this.unlockSubjectShow(); this.unlockSubjectShow();
} }
...@@ -878,7 +878,8 @@ Page({ ...@@ -878,7 +878,8 @@ Page({
prevPage = pages[pages.length - 2]; //上一个页面 prevPage = pages[pages.length - 2]; //上一个页面
} }
prevPage.setData({ prevPage.setData({
showRefresh: true showRefresh: true,
needRefresh: true,
}); });
wx.navigateBack({ wx.navigateBack({
delta: 1, // 回退前 delta(默认为1) 页面 delta: 1, // 回退前 delta(默认为1) 页面
...@@ -1742,7 +1743,14 @@ Page({ ...@@ -1742,7 +1743,14 @@ Page({
// 视频播放相关代码 // 视频播放相关代码
// 跳转到营销列表页面 // 跳转到营销列表页面
goyinxiaoPage () { goyinxiaoPage () {
let id = this.data.themeAdInfo.id || 0; let id = 0;
if (this.data.editType == 1) {
id = this.data.themeAdInfo.id || 0;
} else if (this.data.editType == 2) {
id = this.data.calendarThemeAdInfo.id || 0;
} else if (this.data.editType == 3) {
id = this.data.lockThemeAdInfo.id || 0;
}
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/themead/list?sid=${this.data.sid}&id=${id}&editType=${this.data.editType}`, url: `/business/pages/themead/list?sid=${this.data.sid}&id=${id}&editType=${this.data.editType}`,
}) })
...@@ -2036,7 +2044,7 @@ Page({ ...@@ -2036,7 +2044,7 @@ Page({
addSort = 1; addSort = 1;
} }
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/themeeditor/subjecteditor?tid=${this.data.tid}&sid=${this.data.sid}&addSort=${addSort}&sort=${sort}&id=${item.id}&index=${index}&currentSortIndex=${this.data.currentSortIndex}&from=edit`, url: `/business/pages/themeeditor/subjecteditor?tid=${this.data.tid}&sid=${this.data.sid}&addSort=${addSort}&sort=${sort}&id=${item.id}&index=${index}&currentSortIndex=${this.data.currentSortIndex}&from=edit&clone=${this.data.clone || 0}`,
}) })
}, },
checknameIpt(e) { checknameIpt(e) {
...@@ -2246,6 +2254,14 @@ Page({ ...@@ -2246,6 +2254,14 @@ Page({
} }
} }
} }
if (this.data.lockThemeAdInfo.id == 0) {
wx.showToast({
title: '请选择打卡营销页',
duration: 1500,
icon: 'none',
})
return;
}
if (this.data.publishing) { if (this.data.publishing) {
return return
} }
...@@ -2262,16 +2278,18 @@ Page({ ...@@ -2262,16 +2278,18 @@ Page({
} }
this.data.lockparams.content_id = this.data.lockThemeAdInfo.id; this.data.lockparams.content_id = this.data.lockThemeAdInfo.id;
wx.showLoading('保存中...'); wx.showLoading({
title: '保存中...',
mask: true
});
const subject_ids = this.data.lockSubjects.map(ele => ele.id).join(','); const subject_ids = this.data.lockSubjects.map(ele => ele.id).join(',');
this.data.lockparams.subject_ids = subject_ids; this.data.lockparams.subject_ids = subject_ids;
unlockSubjectEditor({ unlockSubjectEditor({
tid: this.data.clone == 'clone' ? 0 : this.data.tid, tid: this.data.clone == 1 ? 0 : this.data.tid,
data: this.data.lockparams, data: this.data.lockparams,
school_id: this.data.sid, school_id: this.data.sid,
}).then((res) => { }).then((res) => {
const { code, data } = res; const { code, data } = res;
if (res.code == 200) { if (res.code == 200) {
this.setData({ this.setData({
confirmId: data.id, confirmId: data.id,
......
...@@ -150,7 +150,7 @@ Page({ ...@@ -150,7 +150,7 @@ Page({
toEdit () { toEdit () {
const that = this; const that = this;
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/themeeditor/index?id=0&tid=${this.data.tid}&sid=tid=${this.data.sid}&classes=[]&editType=3`, url: `/business/pages/themeeditor/index?id=0&tid=${this.data.tid}&sid=${this.data.sid}&classes=[]&editType=3`,
success() { success() {
that.closeSettingModal() that.closeSettingModal()
} }
......
...@@ -404,6 +404,14 @@ Page({ ...@@ -404,6 +404,14 @@ Page({
}) })
}, },
sureChangePsd () { sureChangePsd () {
const reg = /^[\d]{6,12}$/;
if (!reg.test(this.data.copy_join_secret)) {
wx.showToast({
title: '请输入6-12位的数字密码',
icon: 'none'
})
return;
}
this.setData({ this.setData({
psdshow: false, psdshow: false,
join_secret: this.data.copy_join_secret, join_secret: this.data.copy_join_secret,
......
...@@ -201,8 +201,8 @@ ...@@ -201,8 +201,8 @@
<view class="modal-dialog" wx:if="{{psdshow}}"> <view class="modal-dialog" wx:if="{{psdshow}}">
<view class="modal-mask"></view> <view class="modal-mask"></view>
<view class="modal-box"> <view class="modal-box">
<input type="number" placeholder="请输入密码" value="{{join_secret}}" bindinput="inputPsd" /> <input type="number" placeholder="请输入密码" class="inputPsd" value="{{join_secret}}" bindinput="inputPsd" />
<view> <view class="modal-btn-box">
<view class="modal-btn" bindtap="hideChangePsd">关闭</view> <view class="modal-btn" bindtap="hideChangePsd">关闭</view>
<view class="modal-btn" bindtap="sureChangePsd">确定</view> <view class="modal-btn" bindtap="sureChangePsd">确定</view>
</view> </view>
......
...@@ -177,10 +177,15 @@ picker .icon-arr{ ...@@ -177,10 +177,15 @@ picker .icon-arr{
font-size: 28rpx; font-size: 28rpx;
color: #000; color: #000;
} }
.modal-btn-box {
display: flex;
align-items: center;
}
.modal-dialog .modal-box .modal-btn{ .modal-dialog .modal-box .modal-btn{
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
display: flex; display: flex;
flex: 1;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-top: 1px solid rgba(0,0,0,.05); border-top: 1px solid rgba(0,0,0,.05);
...@@ -188,6 +193,22 @@ picker .icon-arr{ ...@@ -188,6 +193,22 @@ picker .icon-arr{
color: #434343; color: #434343;
font-weight: bold; font-weight: bold;
} }
.modal-dialog .modal-box .inputPsd {
width: 420rpx;
height: 78rpx;
border-radius: 38rpx;
background:rgba(238,238,237,1);
display: block;
margin: 80rpx auto;
text-align: center;
padding: 0 30rpx;
}
.modal-dialog .modal-box .modal-btn:first-child {
border-right: 1px solid rgba(0,0,0,.05);
}
.modal-dialog .modal-box .modal-btn:last-child {
color: #65B8F4;
}
.borderbottom1px { .borderbottom1px {
border-bottom: 1px solid #F1F2F3; border-bottom: 1px solid #F1F2F3;
} }
\ No newline at end of file
...@@ -72,9 +72,11 @@ Page({ ...@@ -72,9 +72,11 @@ Page({
videoId: '', videoId: '',
src: '' src: ''
}, },
clone: 0,
}, },
onLoad: function (options) { // Do some initialize when page load. onLoad: function (options) { // Do some initialize when page load.
const { const {
clone,
id, id,
index, index,
currentSortIndex, currentSortIndex,
...@@ -94,6 +96,7 @@ Page({ ...@@ -94,6 +96,7 @@ Page({
index, index,
currentSortIndex, currentSortIndex,
from, from,
clone,
// params: JSON.parse(decodeURIComponent(detail)), // params: JSON.parse(decodeURIComponent(detail)),
}) })
if (this.data.id > 0) { if (this.data.id > 0) {
...@@ -236,12 +239,12 @@ Page({ ...@@ -236,12 +239,12 @@ Page({
_params.content = JSON.stringify(_content); _params.content = JSON.stringify(_content);
const paramsData = Object.assign(_params, { const paramsData = Object.assign(_params, {
school_id: this.data.sid, school_id: this.data.sid,
id: this.data.id, id: this.data.clone == 1 ? 0 : this.data.id,
sort: this.data.sort, sort: this.data.sort,
is_cheat: 0, is_cheat: 0,
is_encrypt: 0, is_encrypt: 0,
subject_type: 3, subject_type: 3,
unlock_mode_id: this.data.tid unlock_mode_id: this.data.clone == 1 ? 0 : this.data.tid
}) })
if (this.data.addSort == 1) { if (this.data.addSort == 1) {
const that = this; const that = this;
......
...@@ -241,6 +241,7 @@ Page({ ...@@ -241,6 +241,7 @@ Page({
themeDetail({ themeDetail({
id: this.data.tid, id: this.data.tid,
school_id:this.data.sid, school_id:this.data.sid,
extra: 'land_content'
}).then((res) => { }).then((res) => {
const {code, data} = res; const {code, data} = res;
if (code == 200) { if (code == 200) {
...@@ -289,7 +290,6 @@ Page({ ...@@ -289,7 +290,6 @@ Page({
path: `/src/pages/themeindex/index?tid=${this.data.tid}&id=${data.class_id}` path: `/src/pages/themeindex/index?tid=${this.data.tid}&id=${data.class_id}`
} }
}) })
this.setData({ this.setData({
id: data.class_id, id: data.class_id,
params: Object.assign(data, { params: Object.assign(data, {
...@@ -1292,5 +1292,10 @@ Page({ ...@@ -1292,5 +1292,10 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/themeeditor/index?tid=${this.data.tid}&sid=${this.data.sid}&editType=1` url: `/business/pages/themeeditor/index?tid=${this.data.tid}&sid=${this.data.sid}&editType=1`
}) })
},
goEditLandcontent () {
wx.navigateTo({
url: `/business/pages/themead/index?id=${this.data.params.content_id}&sid=${this.data.sid}&editType=1`
})
} }
}) })
\ No newline at end of file
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
<image class="icon-arr" src="{{imageRoot}}2b/themeindex/setting_right.png"></image> <image class="icon-arr" src="{{imageRoot}}2b/themeindex/setting_right.png"></image>
</view> </view>
</view> </view>
<view class="setting-item"> <view class="setting-item" bindtap="goEditLandcontent">
<view class="left"> <view class="left">
<view class="item-label">打卡营销页设置</view> <view class="item-label">打卡营销页设置</view>
<view class="item-desc">配置此页面后可在学生加入打卡前展示,此功能可收集有意向学生的联系方式。 <text class="more-tip">了解更多</text></view> <view class="item-desc">配置此页面后可在学生加入打卡前展示,此功能可收集有意向学生的联系方式。 <text class="more-tip">了解更多</text></view>
......
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