提交 804183c6 authored 作者: 王鹏飞's avatar 王鹏飞

updates

上级 f8b93a87
......@@ -17,7 +17,8 @@
"pages/learnSystem/myDiscuss/myDiscuss",
"pages/learnSystem/discussDetail/discussDetail",
"pages/course/player",
"pages/share/index"
"pages/share/index",
"pages/web/index"
],
"window": {
"navigationBarBackgroundColor": "#fff",
......@@ -65,4 +66,4 @@
"provider": "wxa75efa648b60994b"
}
}
}
}
\ No newline at end of file
......@@ -84,11 +84,11 @@ Component({
}
return getShare(params).then(res => {
const data = res.data
const [lecturer = {}] = data.lecturers
lecturer.lecturer_name = lecturer.lecturer_name.replace(/(\(|()(.+)(\)|))/, '')
data.course_name = data.course_name.replace(/(\(|()(.+)(\)|))/, '')
const [lecturer = { lecturer_name: '' }] = data.lecturers
lecturer.lecturer_name = lecturer.lecturer_name ? lecturer.lecturer_name.replace(/(\(|()(.+)(\)|))/, '') : ''
data.course_name = data.course_name ? data.course_name.replace(/(\(|()(.+)(\)|))/, '') : ''
data.course_name = `《${data.course_name}》课程`
data.chapter_name = data.chapter_name.replace(/(\(|()(.+)(\)|))/, '')
data.chapter_name = data.chapter_name ? data.chapter_name.replace(/(\(|()(.+)(\)|))/, '') : ''
// 两门课单独判断
if (data.course_name.includes('整合心理学与批判性思考')) {
......@@ -114,7 +114,7 @@ Component({
getQrcode() {
const user = this.data.user
const params = {
url: `http://pages.ezijing.com/ciis/mobile-204001490929.html?channel_num=96091&user_id=${user.id}&user_name=${user.realname}`
url: `https://pages.ezijing.com/ciis/mobile-204001490929.html?channel_num=96091&user_id=${user.id}&user_name=${user.realname}`
}
getQrcode(params).then(res => {
this.setData({ qrcode: res.url })
......
......@@ -29,7 +29,7 @@ Page({
handleRequest(params) {
api.login(params).then(response => {
const { code, msg, data } = response
code === 0 ? this.handleSuccess(data) : wx.showToast({ title: msg, icon: 'none' })
code === 0 ? this.handleSuccess(data) : this.handleError(response)
})
},
// 登录成功
......@@ -37,6 +37,18 @@ Page({
wx.setStorage({ key: 'token', data: data.TGC })
wx.switchTab({ url: '/pages/learnSystem/home/home' })
},
handleError(response) {
if (response.msg === '账号不存在') {
wx.showModal({ title: '提示', content: '是否要成为学员', showCancel: true }).then(res => {
res.confirm &&
wx.navigateTo({
url: '/pages/web/index?url=https://webapp-pub.ezijing.com/pages/ciis/ciis.html'
})
})
} else {
wx.showToast({ title: response.msg, icon: 'none' })
}
},
handlePassword() {
wx.navigateTo({ url: '/pages/login/password' })
}
......
......@@ -65,7 +65,16 @@ Page({
// 绑定手机号
this.setData({ show: true, unionid: response.data.unionid })
} else {
wx.showToast({ title: response.msg, icon: 'none' })
if (response.msg === '账号不存在') {
wx.showModal({ title: '提示', content: '是否要成为学员', showCancel: true }).then(res => {
res.confirm &&
wx.navigateTo({
url: '/pages/web/index?url=https://webapp-pub.ezijing.com/pages/ciis/ciis.html'
})
})
} else {
wx.showToast({ title: response.msg, icon: 'none' })
}
}
})
})
......
......@@ -30,7 +30,7 @@ Page({
handleRequest(params) {
api.login(params).then(response => {
const { code, msg, data } = response
code === 0 ? this.handleSuccess(data) : wx.showToast({ title: msg, icon: 'none' })
code === 0 ? this.handleSuccess(data) : this.handleError(response)
})
},
// 登录成功
......@@ -38,6 +38,18 @@ Page({
wx.setStorage({ key: 'token', data: data.TGC })
wx.switchTab({ url: '/pages/learnSystem/home/home' })
},
handleError(response) {
if (response.msg === '账号不存在') {
wx.showModal({ title: '提示', content: '是否要成为学员', showCancel: true }).then(res => {
res.confirm &&
wx.navigateTo({
url: '/pages/web/index?url=https://webapp-pub.ezijing.com/pages/ciis/ciis.html'
})
})
} else {
wx.showToast({ title: response.msg, icon: 'none' })
}
},
// 发送验证码
handleSendCode() {
if (this.data.disabled) {
......
// pages/index.js
Page({
/**
* 页面的初始数据
*/
data: {
url: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const { url } = options
url && this.setData({ url: `${url}?t=${Date.now()}` })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {}
})
{
"usingComponents": {}
}
\ No newline at end of file
<web-view src="{{ url }}"></web-view>
/* pages/web/index.wxss */
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论