Commit e44af9bb authored by 不吃草的咩's avatar 不吃草的咩

对接接口

parent 22ab5288
......@@ -12,7 +12,8 @@ export const colorUISdk = new ColorUISdk({
},
//开发环境
dev: {
url: 'http://jbzhang.censoft.com.cn/'
url: 'http://192.168.15.249:8050/'
// url:'http://jbzhang.censoft.com.cn/'
},
//本地环境
host: {
......
......@@ -15,6 +15,14 @@
display: inline-block;
padding-bottom: 20rpx;
font-size: 34rpx;
height: 60rpx;
line-height: 60rpx;
display:-webkit-box;
-webkit-line-clamp:1;
overflow:hidden;
text-overflow:ellipsis;
-webkit-box-orient:vertical;
word-break:break-all;
&::after {
content: '';
position: absolute;
......@@ -28,7 +36,15 @@
.doc-name {
position: relative;
display: block;
padding-top: 20rpx;
padding-top: 10rpx;
height: 60rpx;
line-height: 60rpx;
display:-webkit-box;
-webkit-line-clamp:1;
overflow:hidden;
text-overflow:ellipsis;
-webkit-box-orient:vertical;
word-break:break-all;
&::after {
content: '';
position: absolute;
......
<view class="doc-card">
<navigator url="{{navurl}}" class="flex radius doc-card-navigator {{'bg-'+colorName+'-gradient'}}">
<view class="flex-sub p-4 doc-text">
<view class="doc-title">{{ data.title }}</view>
<view class="text-lg text-Abc text-lighter doc-name">{{ data.name }}</view>
<view class="doc-title">{{ data.courseName }}</view>
<view class="text-lg text-Abc text-lighter doc-name">{{ data.remark }}</view>
</view>
<view class="mt-2 mr-1 pt-4 pr-4 pl-2 doc-icon">
<text class="icon-xl text-xl {{data.icon}}"/>
......
......@@ -8,6 +8,7 @@ Page({
*/
data: {
course:{
id:'',
name:'',
note:'',
price:''
......@@ -29,7 +30,7 @@ Page({
},2000)
}else{
wx.navigateTo({
url: `/pages/document/subsign/subsign?price=${this.data.course.price}&name=${this.data.course.name}`,
url: `/pages/document/subsign/subsign?price=${this.data.course.price}&name=${this.data.course.name}&id=${this.data.course.id}`,
})
}
......@@ -38,11 +39,13 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const {name,note,price} = options;
console.log(options);
const {name,note,price,id} = options;
this.setData({
["course.name"]:name == 'null' ? '' : name,
["course.note"]:note == 'null' ? '暂无介绍' : note,
["course.price"]:price == 'null' ? '' : price
["course.price"]:price == 'null' ? '' : price,
["course.id"]:id
})
},
......
......@@ -57,7 +57,7 @@ Page({
'专科',
'本科','研究生及以上'
],
columnsHomework:['电工作业','焊接与热切割作业','高处作业','制冷与空调作业','金属与非金属矿山作业','危险化学品作业'],
columnsHomework:[],
// columnsHomework:[
// {text:'电工作业',index:1},
// {text:'焊接与热切割作业',index:2},
......@@ -66,7 +66,7 @@ Page({
// {text:'金属与非金属矿山作业',index:5},
// {text:'危险化学品作业',index:6},
// ],
columnsZige:['职业资格'],
columnsZige:[],
columnsPeixun:['新办','复审','换证']
// columnsPeixun:[
// {text:'新办',index:1},
......@@ -116,22 +116,30 @@ Page({
onConfirmHomework(event){
const { picker, value, index } = event.detail;
console.log(event.detail);
//根据选中状态,请求下面列表,动态生成列表项
app.colorUISdk.request({
url:'wxcourse/list',
url:'dictionary/listByPar3',
method: 'GET',
data: {
a:'xx'
parentKey:value.constantKey
}
}).then(res=> {
this.setData({courseData: res.data.records})
console.log(res);
if(res.code == 0){
let col = res.dictionary.map((a)=>{
return a.fieldKey;
});
this.setData({
columnsZige:col
})
}
}).catch(err=>{
console.log(err)
})
this.setData({
["fromDate.homework"]:value,["popup.homeworkText"]:value,
["fromDate.homework"]:value.text,["popup.homeworkText"]:value.text,
isShowHomework:false,
}
)
},
......@@ -216,28 +224,39 @@ Page({
this.setData({
["fromDate.price"]:options.price,
phone:app.phone,
["fromDate.phone"]:app.phone
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
//获取作业类别列表
["fromDate.phone"]:app.phone,
});
//获取课程类型,动态生成列表
app.colorUISdk.request({
url:'wxcourse/list',
url:'dictionary/listByPar2',
method: 'GET',
data: {
a:'xx'
courseId:options.id
}
}).then(res=> {
this.setData({courseData: res.data.records})
console.log(res);
if(res.code == 0){
let col = res.dictionary.map((a)=>{
return {text:a.fieldKey,constantKey:a.constantKey}
});
this.setData({
columnsHomework:col
});
console.log(this.data.columnsHomework)
}
// this.setData({courseData: res.data.records})
}).catch(err=>{
console.log(err)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
......
......@@ -3,8 +3,8 @@ Page({
data: {
diyige:{icon: 'cicon-avatar', name: '通信企业协会', title: '机构介绍' },
jgDetail:[
{icon: 'cicon-avatar', name: 'qyDetail', title: '机构介绍',params:{type:'1',name:'23'}},
{icon: 'cicon-avatar', name: 'qyDetail', title: '报名指南',params:{type:'0',name:'23'}}
{icon: 'cicon-avatar', remark: '机构的介绍', courseName: '机构介绍',params:{type:'1',name:'23'}},
{icon: 'cicon-avatar', remark: '你不知道的报名指南', courseName: '报名指南',params:{type:'0',name:'23'}}
],
scrollTop: 0,
swiperList: [
......@@ -23,7 +23,7 @@ Page({
navData: [{
title: '课程报名',
sub: [
{ icon: 'cicon-set', name: 'signup', title: '在线报名',isTab:true},
{ icon: 'cicon-set', remark: 'signup', courseName: '在线报名',isTab:true},
// { icon: 'cicon-set', name: 'system', title: '系统' },
// { icon: 'cicon-paint', name: 'theme', title: '主题' },
// { icon: 'cicon-topbar', name: 'navbar', title: '导航栏' },
......@@ -95,15 +95,25 @@ Page({
},
onReady: function () {
app.colorUISdk.request({
url:'wxcourse/list',
url:'infocourse/list',
method: 'GET',
data: {
a:'xx'
data: {}
}).then(({data})=> {
if(data.records.length == 0){
wx.showToast({
title: '课程列表为空',
icon:'none'
})
}else{
this.setData({courseData: data.records})
}
}).then(res=> {
this.setData({courseData: res.data.records})
}).catch(err=>{
console.log(err)
console.log(err);
wx.showToast({
title: '网络故障,请稍后再试',
icon:'none'
})
})
}
})
......@@ -51,7 +51,7 @@
<block wx:for="{{courseData}}" wx:for-index="id" wx:key="course_index">
<view class="ui-item p-3" >
<app-nav-li data="{{item}}" navurl="/pages/document/coursedetails/coursedetails?price={{item.price}}&name={{item.name}}&note={{item.note}}"/>
<app-nav-li data="{{item}}" navurl="/pages/document/coursedetails/coursedetails?price={{item.cost}}&name={{item.courseName}}&note={{item.remark}}&id={{item.id}}"/>
</view>
</block>
</view>
......
......@@ -10,9 +10,13 @@ Page({
// wx.navigateTo({
// url: e.currentTarget.dataset.url
// })
let token = wx.getStorageSync('token');
if(token == ''){
this.setData({
show:true
})
};
},
randomWord(randomFlag, min, max){
let str = "",
......@@ -32,14 +36,22 @@ Page({
//如果返回成功手机号,就随机生成一串字符串存进去
if(e.detail.code !== undefined){
console.log(e.detail);
// let random = Math.random().toString(36).substr(2);
app.colorUISdk.request({
url:`wx/gt?code=${e.detail.code}`,
method: 'POST'
}).then(({data})=> {
console.log(data);
if(data.errcode == 0){
let random = this.randomWord(false, 43);
// let random = Math.random().toString(36).substr(2);
try {
wx.setStorageSync('token', random);
wx.setStorageSync('token', random+data.phone_info.phoneNumber);
app.phone = data.phone_info.phoneNumber;
Toast.success('登录成功');
this.setData({
show:false,
title:13520051245
title:data.phone_info.phoneNumber,
})
} catch (e) {
wx.showToast({
......@@ -47,6 +59,11 @@ Page({
icon: 'none'
})
}
}
this.setData({courseData: res.data.records})
}).catch(err=>{
console.log(err)
})
}else{
wx.showToast({
title: '授权失败,请您重新登录!',
......
......@@ -64,17 +64,26 @@ Page({
*/
onShow: function () {
app.colorUISdk.request({
url:'wxcourse/list',
url:'infocourse/list',
method: 'GET',
data: {
a:'xx'
data: {}
}).then(({data})=> {
if(data.records.length == 0){
wx.showToast({
title: '课程列表为空',
icon:'none'
})
}else{
this.setData({courseData: data.records})
}
}).then(res=> {
this.setData({courseData: res.data.records});
console.log(res.data.records)
}).catch(err=>{
console.log(err)
});
console.log(err);
wx.showToast({
title: '网络故障,请稍后再试',
icon:'none'
})
})
app.information = {};
},
......
......@@ -9,7 +9,7 @@
<view class="ui-grid ui-cols-2">
<block wx:for="{{courseData}}" wx:for-index="id" wx:key="course_index">
<view class="ui-item p-3">
<app-nav-li data="{{item}}" navurl="/pages/document/subsign/subsign?price={{item.price}}&name={{item.name}}"/>
<app-nav-li data="{{item}}" navurl="/pages/document/subsign/subsign?price={{item.cost}}&name={{item.courseName}}&id={{item.id}}"/>
</view>
</block>
</view>
......
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