Commit 2240c89a authored by lvtz's avatar lvtz

fix

parent ef36a12c
......@@ -30,15 +30,34 @@ Page({
if (code == 200) {
let content = [];
try {
content = JSON.parse(data.content);
content = JSON.parse(data.content)[0].value;
} catch (error) {
content = [];
}
data.content = content;
// data.content = this.replaceDetail(content);
data.content =content;
console.log('datacontent',data.content)
this.setData({
detail: data,
})
}
})
},
replaceDetail (details){
var texts='';//待拼接的内容
while(details.indexOf('<img')!=-1){//寻找img 循环
texts+=details.substring('0',details.indexOf('<img')+4);//截取到<img前面的内容
details = details.substring(details.indexOf('<img')+4);//<img 后面的内容
if(details.indexOf('style=')!=-1 && details.indexOf('style=')<details.indexOf('>')){
texts+=details.substring(0,details.indexOf('style="')+7)+"max-width:100%;width: 100%;margin:0 auto;";//从 <img 后面的内容 截取到style= 加上自己要加的内容
details=details.substring(details.indexOf('style="')+7); //style后面的内容拼接
}else{
texts+=' style="max-width:100%;width: 100%" ';
}
}
texts+=details;//最后拼接的内容
return texts
}
})
\ No newline at end of file
......@@ -6,7 +6,7 @@
<view class="detailbox" wx:if="{{detail.content.length > 0}}">
<rich-text
class="rich-text-box"
nodes="{{detail.content[0].value}}"
nodes="{{detail.content}}"
space="nbsp"
/>
</view>
......
......@@ -376,14 +376,13 @@ Component({
}
},
operateClock () {
console.log( this.data.clock.id,'qweqwe')
const that = this;
wx.showActionSheet({
itemList: ['删除'],
success (res) {
if (res.tapIndex == 0) {
that.delClock({
id: that.data.cid,
tid: that.data.tid,
cid: that.data.clock.id,
type: that.data.clock.subject_type
})
......
......@@ -62,7 +62,7 @@
</view>
</view>
<view class="operate-dot" catchtap="operateClock" wx:if="{{customerId == clock.student_id && !isactivityclock &&type != 1}}">
<image class="delate-img" src="{{imageRoot}}common/icon_del.png?{{imageVersion}}" ></image>
<image class="delate-img" src="{{imageRoot}}common/icon_del.png?{{imageVersion}}"></image>
</view>
<view class="stamp-box" wx:if="{{clock.review&&clock.review[1]&&clock.review[1].flag}}">
<image class="stamp-img" src="{{imageRoot}}2b/commenteditor/stamp-img-{{clock.review[1].flag}}.png?{{imageVersion}}" mode="aspectFit"></image>
......@@ -656,7 +656,4 @@
评论加载中...
</view>
</view>
</view>
<!-- <view class="line-gray-16" hover-class="none" hover-stop-propagation="false" wx:if="{{type!=1 && !noLine}}"></view> -->
\ No newline at end of file
</view>
\ No newline at end of file
......@@ -2,7 +2,6 @@ import {
getPrize,
newLikeIndex,
newCommentIndex,
circleDetail,
fingureUp,
} from '../../../service/customer/circleindex.js';
import {
......@@ -76,7 +75,6 @@ Page({
},
adInfo: {},
adShow: true,
adGetShow: false,
currentVoice: '', // 当前播放的录音
voiceInterval: null,
......@@ -125,7 +123,6 @@ Page({
cutDownDate: new Date(new Date().setHours(new Date().getHours() + 8)).getTime(),
bannerVideoStatus:{},
randomstudents:'',
circleDetail:'',
topBox:true,
barrageChange:true,
barrageTime:null,
......@@ -256,43 +253,14 @@ Page({
student_id: app.globalData.currentSchoolStudentId
}).then((res) => {})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { // Do something when page hide.
// this.innerAudioContext.pause();
// this.resetAudiosPlayStatus()
// clearInterval(this.data.voiceInterval);
onHide: function () {
clearInterval(this.data.barrageTime);
},
onUnload: function () { // Do something when page close.
// this.innerAudioContext.pause();
// this.setData({
// audioStorage: {
// }
// })
// clearInterval(this.data.voiceInterval);
clearInterval(this.data.barrageTime);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
Object.assign(this.data,{
hasmore:true,
......@@ -301,9 +269,6 @@ Page({
this.clockListGet('down');
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.clockListGet('up');
......@@ -340,11 +305,6 @@ Page({
}
})
},
closeAd() {
this.setData({
adShow: false
})
},
debounce(func, wait) {
const that = this;
return function () {
......@@ -505,7 +465,6 @@ Page({
// tid: data.subject_id
}, () => {
this.queryActivtySchoolInfo(this.data.sid);
this.circleDetailGet(data.class_id)
this.schoolInfoGet(data.school_id)
this.randomstudents()
this.oddjobschools()
......@@ -775,22 +734,22 @@ Page({
switch (this.data.clock.subject_type) {
case 1:
wx.redirectTo({
url: `/src/pages/themeindex/index?id=${this.data.id}&tid=${this.data.tid}`
url: `/src/pages/themeindex/index?tid=${this.data.tid}`
})
break;
case 2:
wx.redirectTo({
url: `/src/pages/calendarthemeindex/index?id=${this.data.id}&tid=${this.data.tid}`
url: `/src/pages/calendarthemeindex/index?tid=${this.data.tid}`
})
break;
case 3:
if (this.data.moreTheme.my_with_trashed_clock_count > 0) {
wx.redirectTo({
url: `/src/pages/morethemeindex/index?id=${this.data.id}&tid=${this.data.clock.unlock_mode_id}`
url: `/src/pages/morethemeindex/index?tid=${this.data.clock.unlock_mode_id}`
})
} else {
wx.redirectTo({
url: `/src/pages/sharemoretheme/index?id=${this.data.id}&tid=${this.data.clock.unlock_mode_id}`
url: `/src/pages/sharemoretheme/index?tid=${this.data.clock.unlock_mode_id}`
})
}
break;
......@@ -868,8 +827,7 @@ Page({
})
getPrize({
mobile: adMobile.trim(),
name: '',
clock_circle_id: this.data.id
name: ''
}).then((res) => {
const {
code,
......@@ -1039,24 +997,7 @@ Page({
}
}).catch((err) => {})
},
goActivity() {
if (this.data.activityIsClock) {
wx.navigateTo({
url: `/src/pages/themeindex/index?id=${this.data.activtySchoolInfo.id}&tid=${this.data.activtySchoolInfo.tid}`
});
} else {
wx.navigateTo({
url: `/src/pages/activityindex/index?id=${this.data.activtySchoolInfo.id}&tid=${this.data.activtySchoolInfo.tid}`
});
}
const visitor = LocalStorage.getItem('visitor');
activityLog({
type: 2,
open_id: visitor && visitor.openid,
school_id: this.data.activtySchoolInfo.sid,
remark: ''
})
},
activityIsClock(e) {
this.setData({
activityIsClock: e.detail
......@@ -1127,7 +1068,6 @@ Page({
open_id: visitor && visitor.openid,
school_id: this.data.sid,
remark: '',
class_id: this.data.id
})
wx.reLaunch({
url: `/src/pages/websiteindex/index?sid=${this.data.sid}`,
......@@ -1529,25 +1469,7 @@ Page({
[`clockList[${bigindex}][${index}]`]: clock,
})
},
nextClockList(){
const visitor = LocalStorage.getItem('visitor');
const { page } = this.data;
activityLog({
type: 34,
open_id: visitor && visitor.openid,
school_id: this.data.sid,
remark: '',
class_id: this.data.id
})
clearTimeout(this.settimer);
this.settimer = setTimeout(()=>{
this.setData({
page: page+1
})
this.clockListGet()
},500)
},
clickVideo(e){
const id = e.currentTarget.dataset.id;
var videoContext = wx.createVideoContext(id);
......@@ -1589,34 +1511,6 @@ Page({
bannerVideoStatus:this.data.bannerVideoStatus
})
},
circleDetailGet(id){
circleDetail({
class_id:id
}).then((res)=>{
const {data,code} = res;
if(code==200){
let content = [];
try {
content = JSON.parse(data.content);
} catch (e) {
content = []
}
let teacher = []
try {
teacher = JSON.parse(data.amous_teacher);
} catch (e) {
teacher = []
}
data.amous_teacher = teacher;
data.content = content;
this.setData({
circleDetail:data,
"clock.fteacher":teacher
},()=>{
})
}
})
},
randomstudents(){
randomstudents({
school_id:this.data.sid
......@@ -1661,7 +1555,6 @@ Page({
open_id: visitor && visitor.openid,
school_id: this.data.sid,
remark: '',
class_id: this.data.id
})
},
getPhoneNumber(e) {
......@@ -1672,15 +1565,13 @@ Page({
open_id: visitor && visitor.openid,
school_id: this.data.sid,
remark: '',
class_id: this.data.id
})
}else{
activityLog({
type: 29,
open_id: visitor && visitor.openid,
school_id: this.data.sid,
remark: '',
class_id: this.data.id
remark: ''
})
}
const that = this;
......
......@@ -84,22 +84,6 @@
>
</clock-item>
</view>
<!-- <view class="marketing-box" wx:if="{{isMarketting&&noUserinfo}}">
<image class="wrapper" src="{{imageRoot}}2c/clockdetail/btn-bg.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
<view class="left">
<view class="title">{{circleDetail.experience_class?circleDetail.experience_class:'毛笔软笔课程体验课'}}</view>
<view class="detail">
<view class="avatar-box">
<image class="avatar" src="{{filter.imagify(item.avatar)}}" style="left: {{-12*index}}rpx;" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" wx:for="{{randomstudents}}" wx:key="index" wx:if="{{index<5}}"/>
</view>
<view class="num">目前已有{{randomstudents.length}}人领取!</view>
</view>
</view>
<view class="right-btn">
<button class="" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button>
<image class="animation" src="{{imageRoot}}2c/clockdetail/ling.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
</view>
</view> -->
<!-- 领取体验课 -->
<view wx:if="{{isMarketting&&noUserinfo}}">
......@@ -144,26 +128,6 @@
<image wx:if="{{!themeDetailData.ad_banner || themeDetailData.ad_banner=='null' || themeDetailData.ad_banner=='https://cdn.img.shangjiadao.cn/qingxiao/daka/images/2c/morethemeindex/adbanner.png'}}" class="icon_click" src="{{imageRoot}}2c/clockitemv2/icon_click.gif?{{imageVersion}}" ></image>
</view>
</view>
<view class="introduce" style="border-top: 20rpx solid #EFEFEF;" wx:if="{{circleDetail.content.length > 0 && noUserinfo}}">
<view class="sjd-media-show-box">
<sjd-media-show
content="{{circleDetail.content}}"
noheight="{{false}}"
expandeddefault="{{false}}"
expanded="{{isexpand}}"
bind:playvoice="playvoice"
bind:pausevoice="pausevoice"
bind:voiceslide="voiceslide"
audioStorage="{{audioStorage}}"
bind:slidestart="slidestart"
bind:slideend="slideend"
bind:videoplay="videoplay"
bind:playvideo="playvideo"
widthtext="{{false}}"
>
</sjd-media-show>
</view>
</view>
<!-- 内容推荐 -->
<view class="introduce" wx:if="{{clockList.length>0}}" style="{{clockList.length<clockTotal ? 'padding-bottom: 44rpx' : ''}}" style="display: none;">
......
......@@ -12,7 +12,7 @@
<view class="circlelist-content" wx:if="{{!emptyPage}}">
<block wx:for="{{mixedthemeList}}" wx:for-item="bigitem" wx:key="bigindex" wx:for-index="bigindex">
<view class="circle-item" wx:for="{{bigitem}}" wx:for-item="item" data-theme="{{item}}" bindtap="goClock" wx:key="index">
<view class="class-title">{{item.class.title}}</view>
<!-- <view class="class-title">{{item.class.title}}</view> -->
<view class="content-box {{item.subject_type==2 && statusType==1?'rili':''}}">
<block wx:if="{{item.subject_type == 1}}">
<image class="rilibg" src="{{imageRoot}}2c/circleindex/assignment.png?{{imageVersion}}"></image>
......
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