Commit f9650118 authored by 张杰's avatar 张杰

增加课表和食谱

parent a6ad07dc
...@@ -33,11 +33,11 @@ module.exports = { ...@@ -33,11 +33,11 @@ module.exports = {
getRecipe() { getRecipe() {
return request.get("/wxsite/parents/getCurrentRecipe.do") return request.get("/wxsite/parents/getCurrentRecipe.do?orgCode=" + app.globalData.login.user.currentDepart.orgCode)
}, },
getSchedule(classId) { getSchedule(classId) {
var url = "/wxsite/parents/getCurrentSchedule.do?classId=" + classId var url = "/wxsite/parents/getCurrentSchedule.do?orgCode=" + app.globalData.login.user.currentDepart.orgCode
return request.get(url) return request.get(url)
} }
} }
...@@ -11,14 +11,14 @@ const ERR_NOT_ACCESS_TOKEN = 21; ...@@ -11,14 +11,14 @@ const ERR_NOT_ACCESS_TOKEN = 21;
var DEF_APP_CONFIG = { var DEF_APP_CONFIG = {
appId: "wxe19b38d5dbc061c6", // 勾芒小程序测试号 appId: "wxe19b38d5dbc061c6", // 勾芒小程序测试号
// 开发环境 // 开发环境
domain: 'https://dev.gomoretech.com/preschool', // domain: 'https://dev.gomoretech.com/preschool',
baseUrl: "https://dev.gomoretech.com/preschool" // baseUrl: "https://dev.gomoretech.com/preschool"
// 川哥本地环境 // 川哥本地环境
// domain: 'http://192.168.199.230:8080/preschool', // domain: 'http://192.168.199.230:8080/preschool',
// baseUrl: "http://192.168.199.230:8080/preschool", // baseUrl: "http://192.168.199.230:8080/preschool",
// 正式环境 // 正式环境
// domain: 'https://preschool.gomoretech.com/preschool', domain: 'https://preschool.gomoretech.com/preschool',
// baseUrl: "https://preschool.gomoretech.com/preschool" baseUrl: "https://preschool.gomoretech.com/preschool"
} }
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : DEF_APP_CONFIG; const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : DEF_APP_CONFIG;
const APP_ID = extConfig.appId || DEF_APP_CONFIG.appId; const APP_ID = extConfig.appId || DEF_APP_CONFIG.appId;
......
...@@ -51,6 +51,8 @@ Page({ ...@@ -51,6 +51,8 @@ Page({
this.data.page = 0 this.data.page = 0
this.httpRequest() this.httpRequest()
this.getSchedule()
this.getRecipe()
}, },
...@@ -110,9 +112,6 @@ Page({ ...@@ -110,9 +112,6 @@ Page({
musicUrl: res.musicUrl musicUrl: res.musicUrl
}) })
var url = utils.handleImgShow(res.attachment) var url = utils.handleImgShow(res.attachment)
console.log(url) console.log(url)
...@@ -151,6 +150,42 @@ Page({ ...@@ -151,6 +150,42 @@ Page({
}, },
tapPlayButton: function () {
this.data.isPlaying = !this.data.isPlaying
let btnImage = '/src/img/play.png'
if (this.data.isPlaying) {
this.data.innerAudioContext.play()
btnImage = '/src/img/stop.png'
wx.showToast({
title: '开始播放',
icon: 'none'
})
} else {
this.data.innerAudioContext.pause()
wx.showToast({
title: '已暂停',
icon: 'none'
})
}
this.setData({
btnImage: btnImage
})
},
tapRecipe: function(e) {
wx.previewImage({
urls: [this.data.recipeImage],
})
},
tapSchedule: function(e) {
wx.previewImage({
urls: [this.data.scheduleImage],
})
},
tapUserInfoImg: function(e) { tapUserInfoImg: function(e) {
var that = this; var that = this;
// 选择图片 // 选择图片
......
...@@ -88,16 +88,17 @@ ...@@ -88,16 +88,17 @@
<!-- 食谱 --> <!-- 食谱 -->
<view hidden="{{selectedIndex != '1'}}"> <view hidden="{{selectedIndex != '1'}}">
<image hidden="{{isRecipeNull == true}}" src='{{recipeImage}}'></image> <image class='recipe-image' hidden="{{isRecipeNull == true}}" src='{{recipeImage}}' mode='widthFix' bindtap='tapRecipe'></image>
<image hidden="{{isRecipeNull != true}}" src='/src/img/empty_data.png' class='empty-data'></image> <image hidden="{{isRecipeNull != true}}" src='/src/img/empty_data.png' class='empty-data'></image>
<view style='height:100rpx;width:auto;'></view>
</view> </view>
<!-- 课表 --> <!-- 课表 -->
<view hidden="{{selectedIndex != '2'}}"> <view hidden="{{selectedIndex != '2'}}">
<image hidden='{{attachment == null}}' class='scheduleImage' src='{{scheduleImage}}' mode='widthFix'></image> <image hidden='{{attachment == null}}' class='scheduleImage' src='{{scheduleImage}}' mode='widthFix' bindtap='tapSchedule'></image>
<view hidden='{{musicUrl == null}}' class='kg-home-header kg-flex-row music-board' style='width:100vw;height:120rpx;'> <view hidden='{{musicUrl == null}}' class='kg-home-header kg-flex-row music-board' style='width:100vw;height:120rpx;'>
<view class='kg-flex-row'> <view class='kg-flex-row'>
<image src='{{btnImage}}' style='width:120rpx;height:120rpx;' bindtap='tapPlayButton'></image> <image src='{{btnImage}}' style='width:120rpx;height:120rpx;' bindtap='tapPlayButton'></image>
...@@ -106,6 +107,7 @@ ...@@ -106,6 +107,7 @@
</view> </view>
<image hidden="{{attachment != null && musicUrl != null}}" src='/src/img/empty_data.png' class='empty-data'></image> <image hidden="{{attachment != null && musicUrl != null}}" src='/src/img/empty_data.png' class='empty-data'></image>
<view style='height:100rpx;width:auto;'></view>
</view> </view>
<view style='position:fixed;bottom: 0rpx;height:100rpx;background-color:white;width:100vw;'> <view style='position:fixed;bottom: 0rpx;height:100rpx;background-color:white;width:100vw;'>
......
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