作者 王智

页面修改

// pages/Online_regulations/Online_regulations.js
const app = getApp()
Page({
/**
... ... @@ -7,35 +7,63 @@ Page({
data: {
},
onLoad: function (options) {
},
getStudycontent() {
onReady: function () {
wx.navigateTo({
url: '/pages/getStudycontent/getStudycontent',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onShow: function () {
let that = this;
that.getList()
},
// 列表
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
getList() {
let that = this;
let url = '/index/second/tranOnlineList';
let head = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, '', head).then((res) => {
// console.log(res)
that.setData({
list: res
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// 前往答题
getStudycontent(e) {
let that = this;
let url = '/index/second/checkTranStatus';
let head = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, '', head).then((res) => {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/getStudycontent/getStudycontent?id=' + id,
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面隐藏
*/
... ...
<!--在线培训-->
<view class="myanswer" bindtap="getStudycontent">
<view class="myanswer" bindtap="getStudycontent" wx:for="{{list.data}}" data-id="{{item.id}}">
<image src="/imgs/active1.png"></image>
<view class="myanswer_right" >
<view class="myanswer_name" >
如何做一个志愿者,如何做一个负责人心的志愿者
<image src="{{item.pic}}"></image>
<view class="myanswer_right">
<view class="myanswer_name">
{{item.title}}
</view>
<view class="myanswer_num">
<view>
10道题
{{item.num}}道题
</view>
<view class="myanswer_end">
<view class="myanswer_end" wx:if="{{item.user_status==0}}">
前往答题
<image src="/imgs/more_gray1.png"></image>
<image src="/imgs/more_blue1.png"></image>
</view>
<view class="myanswer_end green" wx:if="{{item.user_status==1}}">
完成答题
<image src="/imgs/more1.png"></image>
</view>
</view>
</view>
... ...
... ... @@ -20,6 +20,7 @@ page{
}
.myanswer_right {
width: 434rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
... ... @@ -44,6 +45,12 @@ page{
color: #54A7FB;
}
.green{
color:#21AE58
;
}
.myanswer_end image{
margin-left: 5rpx;
... ...
... ... @@ -13,7 +13,7 @@ Page({
'XX-Token': wx.getStorageSync('token')
}
let params = {
city: '北京'
city: '天津'
}
app.post(url,params, head).then((res) => {
... ...
// pages/getStudycontent/answer/answer.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
data: {
id: '',
list: '',
answers:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(options)
this.setData({
id: options.id
})
},
onReady: function () {
},
onShow: function () {
let that = this;
that.getlist();
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
// 题
getlist() {
let that = this;
let url = '/index/second/getClassQuestion';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
class_id: that.data.id
}
app.post(url, params, head).then((res) => {
console.log(res)
that.setData({
list: res
})
}).catch((err) => {
})
},
radioChange(e){
let tempAnswer = e.detail.value.split(',');
this.data.answers[tempAnswer[1]] = tempAnswer[0];
this.setData({
answers: this.data.answers
})
},
// 确认
getcomfirm() {
let that = this;
let url = '/index/second/commitAnswer';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
class_id: that.data.id,
}
app.post(url, params, head).then((res) => {
if (res.code == 40000) {
wx.showModal({
title: '提示',
content: '很遗憾你没有获得学时',
confirmText: '重新答题',
cancelText: '查看答案',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/getStudycontent/answer/answer',
})
console.log('用户点击确定')
} else if (res.cancel) {
wx.navigateTo({
url: '/pages/getStudycontent/answer/answer',
})
console.log('用户点击取消')
}
}
})
} else {
wx.showModal({
title: '提示',
content: '恭喜',
showCancel: false,
success: function (res) {
}
})
}
}).catch((err) => {
})
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
... ...
<view class="answer">
<view class="answer_left {{index<10?0+index:index}}" >01</view>
<view class="answer" wx:for="{{list}}" wx:for-index="index">
<view class="answer_left" wx:if="{{item.id<9}}" >0{{item.id}}</view>
<view class="answer_left" wx:else >{{item.id}}</view>
<view class="answer_right">
<view class="answer_question">成为一个合格的志愿者最重要的品质是什么?</view>
<radio-group>
<view class="flexs">
<view class="answer_question">{{item.title}}</view>
<radio-group bindchange="radioChange">
<view class="flexs" wx:for="{{item.options_array}}" wx:for-index="idx" wx:for-item="second">
<view class="answer_answer">
<radio>有一颗高尚的心</radio>
<radio value="{{second+','+index}}" checked='' >{{second}}</radio>
</view>
<view class="answer_answer">
<!-- <view class="answer_answer">
<radio>有一颗高尚的心</radio>
</view>
<view class="answer_answer">
... ... @@ -15,12 +16,12 @@
</view>
<view class="answer_answer">
<radio>有一颗高尚的心</radio>
</view>
</view> -->
</view>
</radio-group>
</view>
</view>
<view class="shengqin">
<button bindtap="getshengqin" >确认</button>
<button bindtap="getcomfirm" >确认</button>
</view>
\ No newline at end of file
... ...
... ... @@ -81,11 +81,6 @@ radio .wx-radio-input.wx-radio-input-checked::before {
}
/* */
.shengqin {
height: 122rpx;
... ...
// pages/getStudycontent/getStudycontent.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id: '',
list: ''
},
onLoad: function (options) {
// console.log(options)
this.setData({
id: options.id
})
},
onReady: function () {
},
onShow: function () {
let that = this;
that.getlist();
},
// 答题
getanswer() {
let that = this
var id = that.data.id
console.log(id)
wx.navigateTo({
url: '/pages/getStudycontent/answer/answer',
url: '/pages/getStudycontent/answer/answer?id='+id,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// 内容
getlist() {
},
let that = this;
let url = '/index/second/getClassInfo';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
id: that.data.id
}
app.post(url, params, head).then((res) => {
console.log(res)
that.setData({
list: res
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
... ...
<!--pages/getStudycontent/getStudycontent.wxml-->
<view class="answer_text">
<text-rich>
很快适应了当地生活,但对于一个国际中文教学的“新手”来说,走上真正的讲台才是我接下来面临的挑战,不过惊喜也在悄然发生。 造访的第一个学校是Maštolend儿园,第一眼就爱上了这群可爱的孩子们。大班的孩子集体唱《你好歌》
</text-rich>
<view class="answer_title">
{{list.title}}
</view>
<view class="answer_author">
<image src="/imgs/zhiyuan3.png"></image> {{list.author}}
<image style="margin-left:64rpx" src="/imgs/zhiyuan4.png"></image> {{list.work_time}}
</view>
<rich-text nodes="{{list.content}}"></rich-text>
</view>
<view class="answer" bindtap="getanswer">
<button hover-class="none">去答题</button>
... ...
.answer_title {
font-size: 36rpx;
color: black;
}
.answer_author {
display: flex;
align-items: center;
margin: 24rpx 0;
}
.answer_author image {
width: 30rpx;
height: 30rpx;
background: #666666;
margin-right: 8rpx;
}
.answer_text {
padding: 24rpx 32rpx;
font-size: 28rpx;
... ...
<view class="guanlitiaoli">
<rich-text nodes="{{list.content}}">
</rich-text>
</view>
... ...
const app = getApp()
var util = require('../../../utils/util.js');
Page({
/**
... ... @@ -12,14 +12,11 @@ Page({
longitude: ''
},
onLoad: function (options) {
// console.log(options)
this.setData({
id: options.id
})
},
onReady: function () {
... ... @@ -28,7 +25,7 @@ Page({
onShow: function () {
let that = this;
that.getList();
// 获取经纬度
wx.getLocation({
success: function (res) {
console.log(res);
... ... @@ -38,6 +35,9 @@ Page({
})
},
})
},
... ... @@ -68,7 +68,6 @@ Page({
// 打卡
getpunch() {
// var t=this
let that = this;
let url = '/index/second/startClock';
... ... @@ -95,6 +94,13 @@ Page({
},
// 提示
click: function (e) {
this.setData({
... ...
... ... @@ -9,19 +9,27 @@
<view class="myactivity_wrap">
<view class="myactivity_starttime">
<view>上岗打卡09:00</view>
<view>未打卡</view>
<view>上岗打卡{{list.start_clock_time}}</view>
<view class="state" wx:if="{{list.status==0}}">未打卡</view>
<view class="state" wx:if="{{list.status==1}}">已开始</view>
<view class="state" wx:if="{{list.status==2}}">完成打开</view>
<view class="state" wx:if="{{list.status==3}}">未完成</view>
</view>
<view class="myactivity_starttime">
<view>下岗打卡09:00</view>
<view>未打卡</view>
<view>下岗打卡{{list.end_clock_time}}</view>
<view class="state" wx:if="{{list.status==0}}">未打卡</view>
<view class="state" wx:if="{{list.status==1}}">已开始</view>
<view class="state" wx:if="{{list.status==2}}">完成打开</view>
<view class="state" wx:if="{{list.status==3}}">未完成</view>
</view>
</view>
<view class="myactivity_start" bindtap="getpunch">
<view >上岗打卡</view>
<view>上岗打卡</view>
<view>12:00</view>
</view>
<view></view>
</view>
<!-- 提示 -->
<view class="tishi_wrap" hidden="{{hiddenName}}">
... ... @@ -32,5 +40,5 @@
</view>
<image bindtap="click" style="width:20rpx;height:20rpx;" src="/imgs/tishiclear.png"></image>
</view>
<view class="tishi_text">活动地址:和平区位置,请在距地址500米内打卡</view>
<view class="tishi_text">活动地址:{{list.address}},请在距地址500米内打卡</view>
</view>
\ No newline at end of file
... ...
... ... @@ -31,6 +31,12 @@ page {
box-sizing: border-box;
}
.myactivity_starttime .state {
font-size: 24rpx;
color: #7B828B;
}
.myactivity_start {
margin: 168rpx 202rpx;
width: 282rpx;
... ...
... ... @@ -26,14 +26,14 @@ Page({
// })
// },
// //加入理由
// textareaIn: function (e) {
// this.setData({
// textareaNum: e.detail.cursor,
// join_reason: e.detail.value
//汇报
textareaIn: function (e) {
this.setData({
textareaNum: e.detail.cursor,
join_reason: e.detail.value
// })
// },
})
},
// submit(e) {
// let that = this;
... ...
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "工作汇报"
}
\ No newline at end of file
... ...
<!--微信号 -->
<view class='apply_item'>
<view>微信号</view>
<view>姓名</view>
<view class='apply_item_input'>
<input placeholder='请输入微信号码' placeholder-class='input_p' bindinput='setwechat' value='{{wechat}}'
<input placeholder='请输入姓名' placeholder-class='input_p' bindinput='setwechat' value='{{wechat}}'
disabled="{{page_type}}"></input>
</view>
</view>
... ... @@ -11,19 +11,19 @@
</view>
<!--手机号码 -->
<view class='apply_item'>
<view>手机号码</view>
<view>工作内容</view>
<view class='apply_item_input'>
<input placeholder='请输入手机号码' type='number' placeholder-class='input_p' bindinput='setmove_phone'
value='{{move_phone}}' disabled="{{page_type}}" maxlength="11"></input>
<input placeholder='请输入工作内容' placeholder-class='input_p' bindinput='setmove_phone'
value='{{move_phone}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class="line">
<view></view>
</view>
<view class='apply_item'>
<view>手机号码</view>
<view>参加日期</view>
<view class='apply_item_input'>
<input placeholder='请输入手机号码' type='number' placeholder-class='input_p' bindinput='setmove_phone'
<input placeholder='请输入参加日期' placeholder-class='input_p' bindinput='setmove_phone'
value='{{move_phone}}' disabled="{{page_type}}" maxlength="11"></input>
</view>
</view>
... ... @@ -31,22 +31,19 @@
<view></view>
</view>
<view class='apply_item'>
<view>手机号码</view>
<view>参加时间</view>
<view class='apply_item_input'>
<input placeholder='请输入手机号码' type='number' placeholder-class='input_p' bindinput='setmove_phone'
<input placeholder='请输入参加时间' placeholder-class='input_p' bindinput='setmove_phone'
value='{{move_phone}}' disabled="{{page_type}}" maxlength="11"></input>
</view>
</view>
<view class="listforms"></view>
<!-- 感想汇报 -->
<view class="doc-listform">
<view> 感想汇报</view>
<textarea show-confirm-bar="" placeholder="请输入内容,内容最多为500字" maxlength="500" bindinput="textareaIn" value='{{join_reason}}'>
<view style="position:absolute;bottom:20rpx;right:0rpx;color:gray;"><text style="color:#000;">{{textareaNum}}</text> / 100</view>
<view style="position:absolute;bottom:20rpx;right:0rpx;color:gray;"><text style="color:#000;">{{textareaNum}}</text> / 500</view>
</textarea>
</view>
... ...
/* @import "../../apply//apply.wxss"; */
page {
/* page {
background-color: rgb(240, 240, 240);
}
} */
.apply_item {
color: #333;
... ... @@ -57,18 +57,21 @@ page {
/* */
.doc-listform {
margin-top: 30rpx;
padding: 0 32rpx;
padding-top: 16rpx;
background-color: #ffffff;
position: relative;
}
.listforms{
height: 15rpx;
background-color: #eeeeee;
}
textarea {
font-size: 28rpx;
margin-top: 20rpx;
width: auto;
border: 2rpx solid #eeeeee;
}
/* 提示 */
.tishi_wrap {
... ...
... ... @@ -228,6 +228,27 @@
"pathName": "pages/getStudycontent/answer/answer",
"query": "",
"scene": null
},
{
"id": 23,
"name": "在线培训",
"pathName": "pages/Online_regulations/Online_regulations",
"query": "",
"scene": null
},
{
"id": 24,
"name": "学习内容",
"pathName": "pages/getStudycontent/getStudycontent",
"query": "",
"scene": null
},
{
"id": -1,
"name": "dati ",
"pathName": "pages/getStudycontent/answer/answer",
"query": "id=1",
"scene": null
}
]
}
... ...