lianxi process

This commit is contained in:
caoqianming 2020-08-14 14:49:35 +08:00
parent 46c40ce3a4
commit 982573f9d0
9 changed files with 60 additions and 12 deletions

View File

@ -352,7 +352,7 @@ export default {
rule1: { rule1: {
name: [{ required: true, message: "请输入姓名", trigger: "blur" }], name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
username: [ username: [
{ required: true, message: "请输入手机号", trigger: "change", pattern: /^1[34578]\d{9}$/, } { required: true, message: "请输入手机号", trigger: "change", pattern: /^1[345789]\d{9}$/, }
], ],
role: [ role: [
{ required: true, message: "请选择", trigger: "change" } { required: true, message: "请选择", trigger: "change" }

View File

@ -68,9 +68,9 @@ App({
globalData: { globalData: {
userInfo: {}, userInfo: {},
userinfo: {}, // 服务器传回的消费者信息 userinfo: {}, // 服务器传回的消费者信息
//host: 'https://apitest.ahctc.cn', host: 'https://apitest.ahctc.cn',
mediahost: 'https://apitest.ahctc.cn', mediahost: 'https://apitest.ahctc.cn',
host: 'http://127.0.0.1:8000', //host: 'http://127.0.0.1:8000',
//mediahost: 'http://127.0.0.1:8000', //mediahost: 'http://127.0.0.1:8000',
token : '', token : '',
} }

View File

@ -84,7 +84,7 @@
}, },
"plugins": { "plugins": {
"tencentvideo": { "tencentvideo": {
"version": "1.3.3", "version": "1.3.15",
"provider": "wxa75efa648b60994b" "provider": "wxa75efa648b60994b"
} }
}, },

View File

@ -33,6 +33,10 @@ Page({
that.data.ydtms.push(that.data.tm_current.id) that.data.ydtms.push(that.data.tm_current.id)
} }
}, },
changeProcess: function(e){
let data = {'questioncat':this.questioncat, 'ydtms':this.ydtms}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -66,7 +70,8 @@ Page({
var that = this var that = this
var query = { var query = {
questioncat: that.data.questioncat, questioncat: that.data.questioncat,
ydtms: wx.getStorageSync('cat' + that.data.questioncat.toString()) ydtms: wx.getStorageSync('cat' + that.data.questioncat.toString()),
ydtms_:that.data.ydtms
} }
api.request('/question/question/exercise/?limit=10&page='+that.data.page, 'POST', query).then(res => { api.request('/question/question/exercise/?limit=10&page='+that.data.page, 'POST', query).then(res => {
if(res.code>=200){ if(res.code>=200){

View File

@ -37,6 +37,9 @@ Page({
getList: function () { getList: function () {
var that = this var that = this
api.request('/cms/material/', 'GET', that.data.query).then(res => { api.request('/cms/material/', 'GET', that.data.query).then(res => {
for(var i=0;i<res.data.results.length;i++){
res.data.results[i].showTitle=true
}
if (that.data.query.page == 1) { if (that.data.query.page == 1) {
that.data.results = res.data.results that.data.results = res.data.results
} else { } else {
@ -97,5 +100,18 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
play:function(e){
let index = e.currentTarget.dataset.index
this.data.results[index].showTitle=false
this.setData({
results:this.data.results
})
},
pause:function(e){
let index = e.currentTarget.dataset.index
this.data.results[index].showTitle=true
this.setData({
results:this.data.results
})
},
}) })

View File

@ -3,9 +3,18 @@
<view class="weui-panel"> <view class="weui-panel">
<txv-video <txv-video
vid="{{item.vid}}" vid="{{item.vid}}"
playerid="txv1"> playerid="txv1"
<view class='txv-video-slot'>{{item.name}}</view> bindplay="play"
bindpause="pause"
bindended="pause"
data-index = "{{index}}"
>
<view class='txv-video-slot' wx:if="{{item.showTitle}}">
<span style="margin-left:6px">{{item.name}}</span>
</view>
</txv-video> </txv-video>
<view style="color:darkblue;text-align:center" >{{item.name}}</view> <view style="color:darkblue;">
<span style="margin-left:6px">{{item.name}}</span>
</view>
</view> </view>
</block> </block>

View File

@ -4,10 +4,11 @@
text-align: center; text-align: center;
} }
.txv-video-slot{ .txv-video-slot{
width: 80px; width: 100%;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
font-size: 16px; font-size: 16px;
color: #fff; color:white;
margin: 10px; background-color: black;
opacity:0.3;
} }

View File

@ -230,6 +230,17 @@ class ConsumerViewSet(ModelViewSet):
request.user.save() request.user.save()
return Response(status=status.HTTP_200_OK) return Response(status=status.HTTP_200_OK)
# @action(methods=['put'], detail=False,
# url_path='process', url_name='exercise_processcat', perms_map=[{'*':'*'}])
# def processcat(self, request):
# '''
# 练习进度单类别修改
# '''
# if hasattr(request.user, 'process'):
# request.user.process = request.data['process']
# request.user.save()
# return Response(status=status.HTTP_200_OK)
@action(methods=['post'], detail=False, @action(methods=['post'], detail=False,
url_path='realinfo', url_name='get_realinfo', perms_map=[{'*':'*'}]) url_path='realinfo', url_name='get_realinfo', perms_map=[{'*':'*'}])
def realinfo(self, request): def realinfo(self, request):

View File

@ -241,6 +241,12 @@ class ExerciseView(APIView):
queryset = Question.objects.filter(is_delete=0,questioncat=questioncat).order_by('type','name') queryset = Question.objects.filter(is_delete=0,questioncat=questioncat).order_by('type','name')
if 'ydtms' in request.data and request.data['ydtms']: if 'ydtms' in request.data and request.data['ydtms']:
queryset = queryset.exclude(id__in = request.data['ydtms']) queryset = queryset.exclude(id__in = request.data['ydtms'])
if 'ydtms_' in request.data and request.data['ydtms_']:
consumer = request.user
process = consumer.process
process['cat'+str(questioncat)] = request.data['ydtms_']
consumer.process = process
consumer.save()
count = queryset.count() count = queryset.count()
pg = CommonPagination() pg = CommonPagination()
p = pg.paginate_queryset(queryset=queryset,request=request,view=self) p = pg.paginate_queryset(queryset=queryset,request=request,view=self)