Commit 527409e8 by tangjiale

更新代码

parent 9634c1e9
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-01-13 17:47:44 * @Date: 2022-01-13 17:47:44
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-14 11:38:14 * @LastEditTime: 2022-06-15 10:33:27
*/ */
// wx.setStorageSync('host', 'https://sdb.youchengzhang.cn/'); //正式环境 // wx.setStorageSync('host', 'https://sdb.youchengzhang.cn/'); //正式环境
// wx.setStorageSync('host', 'https://test.xiaobentiyu.cn'); //测试环境 // wx.setStorageSync('host', 'https://test.xiaobentiyu.cn'); //测试环境
...@@ -20,6 +20,12 @@ const plugins = requirePlugin('tfjsPlugin') ...@@ -20,6 +20,12 @@ const plugins = requirePlugin('tfjsPlugin')
wx.setStorageSync('index', 0); wx.setStorageSync('index', 0);
App({ App({
onLaunch: function () { onLaunch: function () {
let token = wx.getStorageSync("token")
if(!token){
wx.reLaunch({
url:'/subPages/login/login/index'
})
}
this.autoUpdate(); this.autoUpdate();
wx.setStorageSync('appId', 'wx7d7fbc0e6746baf5'); wx.setStorageSync('appId', 'wx7d7fbc0e6746baf5');
......
...@@ -3,11 +3,7 @@ ...@@ -3,11 +3,7 @@
"pages/index/index", "pages/index/index",
"pages/organ-my/organ-my", "pages/organ-my/organ-my",
"pages/my/my", "pages/my/my",
"pages/sport/sport", "pages/sport/sport"
"subPages/course/list/list",
"subPages/course/detail/detail",
"subPages/course/pay/pay",
"subPages/course/order/order"
], ],
"subpackages": [ "subpackages": [
{ {
...@@ -16,6 +12,19 @@ ...@@ -16,6 +12,19 @@
"pages": [] "pages": []
}, },
{ {
"root": "subPages/course",
"name": "course",
"pages": [
"pay-order/pay-order",
"list/list",
"detail/detail",
"attempt-list/attempt-list",
"join-list/join-list",
"sales-list/sales-list",
"collect-list/collect-list"
]
},
{
"root": "subPages/sport", "root": "subPages/sport",
"name": "sport", "name": "sport",
"pages": [ "pages": [
...@@ -78,20 +87,7 @@ ...@@ -78,20 +87,7 @@
] ]
}, },
"usingComponents": { "usingComponents": {
"van-cell": "@vant/weapp/cell/index", "van-swipe-cell": "@vant/weapp/swipe-cell/index"
"van-button": "@vant/weapp/button/index",
"van-popup": "@vant/weapp/popup/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-swipe-cell": "@vant/weapp/swipe-cell/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-search": "@vant/weapp/search/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-sticky": "@vant/weapp/sticky/index",
"van-rate": "@vant/weapp/rate/index",
"van-picker": "@vant/weapp/picker/index",
"van-dialog": "@vant/weapp/dialog/index"
}, },
"requiredBackgroundModes": [ "requiredBackgroundModes": [
"audio" "audio"
......
var API = require("../../../utils/request.js");
Component({
/**
* 页面的初始数据
*/
data: {
stuinfo:{
name:'',
gender:'',
height:'',
weight:'',
relationShip:''
},
randeList:[{name:'男',value:1},{name:'女',value:2}],
randerIdx:'',
gxList:[
{name:'爸爸',value:1},{name:'妈妈',value:2},{name:'其他',value:3}
],
gxIndex:'',
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
methods:{
checkUserChild(){
let userInfo = wx.getStorageSync("userInfo")
if(userInfo.stuId && !userInfo.height){
this.data.stuinfo.stuId = userInfo.stuId
this.data.stuinfo.name = userInfo.stuName
this.data.stuinfo.gender = userInfo.stuGender
this.data.stuinfo.relationShip = userInfo.relation
let idx = this.data.gxList.findIndex(v => v.value == userInfo.relation)
this.setData({stuinfo:this.data.stuinfo,gxIndex:idx,randerIdx:userInfo.stuGender==1?0:1})
}
},
inputText(e){
let {type} = e.currentTarget.dataset
let {value} = e.detail
this.data.stuinfo[type] = value
this.setData({stuinfo:this.data.stuinfo})
},
bindPickerChange(e){
let {value} = e.detail
this.data.stuinfo.gender = this.data.randeList[value].value
this.setData({stuinfo:this.data.stuinfo,randerIdx:value})
},
changeGx(e){
let {value} = e.detail
this.data.stuinfo.relationShip = this.data.gxList[value].value
this.setData({stuinfo:this.data.stuinfo,gxIndex:value})
},
subForm(){
let param = this.data.stuinfo
let that = this
if(!param.name){
wx.showToast({title: '请输入孩子姓名',icon: 'none',});
return
}
if(!param.gender){
wx.showToast({title: '请选择孩子性别',icon: 'none',});
return
}
if(!param.height){
wx.showToast({title: '请输入孩子身高',icon: 'none',});
return
}
if(!param.weight){
wx.showToast({title: '请输入孩子体重',icon: 'none',});
return
}
if(!param.relationShip){
wx.showToast({title: '请选择与孩子关系',icon: 'none',});
return
}
API.requestAll("/px/user/bindStu",param,(res) => {
if(res.code == 200){
wx.showToast({title: '保持成功',icon: 'none',});
that.wxGetUserInfo()
that.triggerEvent('closePopup')
}
})
// /px/user/bindStu
},
wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
wx.setStorageSync('userInfo',res.data)
}
});
},
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"xb-icon":"../../t-icon/t-icon"
}
}
\ No newline at end of file
<view class="popup-bg">
<image class="stu-info-bg" src="/images/course/stu-info-bg.png" />
<view class="flex-c">
<image class="stu-info-input" src="/images/course/stu-info-input.png" />
<view style="margin-left:20rpx">
<view class="tip">请填写孩子信息</view>
<view class="tip2">以方便为孩子保存运动打卡记录</view>
</view>
</view>
<view class="input-item" style="margin-top:32rpx">
<view class="input-t">孩子姓名</view>
<view class="input-bg">
<input type="text" disabled="{{stuinfo.stuId}}" value="{{stuinfo.name}}" maxlength="10" data-type="name" bindinput="inputText" placeholder="请输入孩子姓名" placeholder-class="placeholder-c"></input>
</view>
</view>
<view class="input-item">
<view class="input-t">孩子性别</view>
<view class="input-bg">
<picker class="name" disabled="{{stuinfo.stuId}}" bindchange="bindPickerChange" value="{{randerIdx}}" range="{{randeList}}" range-key="name">
<view class="flex-s">
<view class="sex {{!stuinfo.gender ? 'placeholder-c':''}}">{{randeList[randerIdx].name || '请选择性别'}}</view>
<xb-icon type="icon-icon_pull-down" class="change-icon" size="32" color="#000000"></xb-icon>
</view>
</picker>
</view>
</view>
<view class="input-item">
<view class="input-t">孩子身高</view>
<view class="input-bg">
<view class="flex-s">
<input type="digit" value="{{stuinfo.height}}" data-type="height" bindinput="inputText" placeholder="请输入孩子身高" placeholder-class="placeholder-c"></input>
<view class="unit">CM</view>
</view>
</view>
</view>
<view class="input-item">
<view class="input-t">孩子体重</view>
<view class="input-bg">
<view class="flex-s">
<input type="digit" value="{{stuinfo.weight}}" data-type="weight" bindinput="inputText" placeholder="请输入孩子体重" placeholder-class="placeholder-c"></input>
<view class="unit">KG</view>
</view>
</view>
</view>
<view class="input-item">
<view class="input-t">与孩子关系</view>
<view class="input-bg">
<picker class="name" disabled="{{stuinfo.stuId}}" bindchange="changeGx" value="{{gxIndex}}" range="{{gxList}}" range-key="name">
<view class="flex-s">
<view class="sex {{!stuinfo.relationShip ? 'placeholder-c':''}}">{{gxList[gxIndex].name || '请选择您与孩子的关系'}}</view>
<xb-icon type="icon-icon_pull-down" class="change-icon" size="32" color="#000000"></xb-icon>
</view>
</picker>
</view>
</view>
<view class="btm-btn" bindtap="subForm">提交信息</view>
</view>
\ No newline at end of file
.flex-c{display: flex;align-items: center;}
.popup-bg{
position: relative;
padding: 44rpx 40rpx 112rpx 40rpx;
width: calc(100% - 80rpx);
height: 974rpx;
background: linear-gradient(180deg, #FFF2E8 0%, #FFFFFF 100%);
border-radius: 24rpx 24rpx 0px 0px;
}
.stu-info-bg{
position: absolute;
right: 40rpx;
top: 20rpx;
height: 176rpx;
width: 176rpx;
}
.stu-info-input{
height: 80rpx;width: 80rpx;
}
.tip{
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #353535;
}
.tip2{
font-size: 24rpx;margin-top: 10rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
}
.input-item{
height: 112rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.input-t{
width: 184rpx;
font-size: 30rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
}
.input-bg{
padding: 24rpx 30rpx;
background: #F8F9FA;
border-radius: 16rpx;
width: calc(100% - 184rpx);
}
.placeholder-c{
font-size: 30rpx !important;
font-family: PingFang SC-Regular, PingFang SC !important;
font-weight: 400 !important;
color: #C3CAD3 !important;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.unit{
font-size: 30rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.placeholder-c{
font-size: 30rpx !important;
font-family: PingFang SC-Regular, PingFang SC !important;
font-weight: 400 !important;
color: #C3CAD3 !important;
}
.btm-btn{
margin-top: 60rpx;
background: #FF811E;
border-radius: 50rpx;
padding: 22rpx 0rpx;
width: 100%;
text-align: center;
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
}
\ No newline at end of file
...@@ -10,4 +10,19 @@ ...@@ -10,4 +10,19 @@
<view class="{{ customStyle ? '' : 'popper-dialog_body--' + type }}"> <view class="{{ customStyle ? '' : 'popper-dialog_body--' + type }}">
<slot></slot> <slot></slot>
</view> </view>
</pop-manager> </pop-manager>
\ No newline at end of file
<!-- "van-cell": "@vant/weapp/cell/index",
"van-button": "@vant/weapp/button/index",
"van-popup": "@vant/weapp/popup/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-swipe-cell": "@vant/weapp/swipe-cell/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-search": "@vant/weapp/search/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-sticky": "@vant/weapp/sticky/index",
"van-rate": "@vant/weapp/rate/index",
"van-picker": "@vant/weapp/picker/index",
"van-dialog": "@vant/weapp/dialog/index" -->
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "小奔体育" "navigationBarTitleText": "小奔运动"
} }
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
min-height: 100vh; min-height: 100vh;
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
padding-bottom: 100rpx; padding-bottom: 112rpx;
} }
.content{ .content{
...@@ -74,12 +74,12 @@ ...@@ -74,12 +74,12 @@
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
display: -webkit-box; display: -webkit-box;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
word-wrap: break-word; word-wrap: break-word;
white-space: normal !important; white-space: normal !important;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.course-info-h{ .course-info-h{
height: 155rpx; height: 155rpx;
...@@ -137,7 +137,7 @@ white-space: normal !important; ...@@ -137,7 +137,7 @@ white-space: normal !important;
.w-course{ .w-course{
position: relative; position: relative;
width: 100%; width: 100%;
margin: 22rpx 0rpx 18rpx 0rpx; margin: 40rpx 0rpx 18rpx 0rpx;
/* margin: 22rpx 0rx 18rpx 0rpx; */ /* margin: 22rpx 0rx 18rpx 0rpx; */
} }
.w-course-img{ .w-course-img{
...@@ -169,6 +169,13 @@ white-space: normal !important; ...@@ -169,6 +169,13 @@ white-space: normal !important;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
} }
.pay-num{ .pay-num{
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:44:43 * @Date: 2022-06-06 16:44:43
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-13 14:10:54 * @LastEditTime: 2022-06-16 10:07:35
*/ */
var app = getApp(); var app = getApp();
var API = require("../../utils/request.js"); var API = require("../../utils/request.js");
...@@ -12,6 +12,7 @@ var falg = ''; ...@@ -12,6 +12,7 @@ var falg = '';
Page({ Page({
data: { data: {
userInfo: {}, userInfo: {},
childList:[],
tabs:[], tabs:[],
...@@ -20,6 +21,40 @@ Page({ ...@@ -20,6 +21,40 @@ Page({
sportTime: '', //总时长 sportTime: '', //总时长
todayInfo:[],//今日运动信息 todayInfo:[],//今日运动信息
todaySportTime:0, todaySportTime:0,
//我的菜单配置
optionTab:{
'employ':[
{
title:'个人资料',event:'info',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
},{
title:'客服电话',event:'call',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
},{
title:'切换身份',event:'change',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
}
],
'parent':[
{
title:'体验课订购',event:'order',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
},{
title:'班课报名',event:'enroll',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
},{
title:'销课记录',event:'sales',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
},{
title:'我的收藏',event:'collect',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
},{
title:'切换身份',event:'change',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png'
}
]
}
}, },
onLoad: function (options) { onLoad: function (options) {
...@@ -32,9 +67,125 @@ Page({ ...@@ -32,9 +67,125 @@ Page({
selected: 2 selected: 2
}) })
} }
let userInfo = wx.getStorageSync("userInfo")
this.setData({userInfo:userInfo || {}})
//是否绑定孩子
if(userInfo.stuId){
this.getDataList()
this.sportStatTotal();
}
//获取角色列表
this.queryPeopleList()
},
//切换小孩身份
checkStu:tool.throttle(function(e){
var that = this;
var data = {
peopleId: e[0].currentTarget.dataset.item.peopleId,
roleId: e[0].currentTarget.dataset.item.roleId,
}
if (!data.peopleId) {
wx.showLoading({
icon: 'none',
title: '切换身份失败',
})
return false;
}
API.getData('/px/user/switchRole', data, function (res) {
if (res.code == 200) {
that.onShow();
wx.showToast({
title: '切换成功',
icon: 'none'
})
} else {
wx.showToast({
icon: "none",
title: res.message,
})
}
}, function () {
wx.hideLoading()
});
},2000),
handleTab(e){
let {type} = e.currentTarget.dataset
let that = this
switch(type){
case 'info': //个人资料
this.getDataList() break
this.sportStatTotal(); case 'call': //客服电话
break
case 'order': //体验课订购
wx.navigateTo({
url: '/subPages/course/attempt-list/attempt-list'
})
break
case 'enroll': //班课报名
wx.navigateTo({
url: '/subPages/course/join-list/join-list'
})
break
case 'sales': //销课记录
wx.navigateTo({
url: '/subPages/course/sales-list/sales-list'
})
break
case 'collect': //我的收藏
wx.navigateTo({
url: '/subPages/course/collect-list/collect-list'
})
break
case 'change': //切换身份
wx.navigateTo({
url: '/subPages/login/role-list/role-list'
})
break
case 'layout': //退出登录
wx.showModal({
title: '提示',
content: '你确定要退出登陆吗',
success(res) {
if (res.confirm) {
API.getData('/px/user/loginOut', {}, (res) => {
if(res.code == 200){
wx.getStorageSync("token","")
wx.getStorageSync("peopleType","")
wx.getStorageSync("userInfo",{})
wx.reLaunch({
url:'/subPages/login/login/index'
})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
break
}
},
queryPeopleList(){
API.getData('/px/user/getUserPeopleList', {}, (res) => {
let list = []
//1 root 超级管理员 2 marketer 运营人员 3 admin 机构管理员 4 employ 机构职员 5 parent 家长 6 child 小孩 7 visitor 游客
if(res.data && res.data.length){
list = res.data.filter(v => v.roleId == 5)
let obj = {}
list.forEach((v,index) =>{
if(v.isCurrent){
obj = v
list.splice(index,1)
}
})
list.unshift(obj)
}
this.setData({childList:list || []})
})
}, },
//跳转到运动记录页面 //跳转到运动记录页面
......
<view class="mine"> <view class="mine" wx:if="{{userInfo}}">
<view class="mine-top" catchtap="setAvartar"> <view class="mine-top" catchtap="setAvartar">
<image class="mine-bg" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/mine_bg.png"></image> <image class="mine-bg" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/mine_bg.png"></image>
<view class="mine-top-content"> <view class="mine-top-content">
<view class="user-info"> <view class="user-info">
<image class="user-avatar" src="{{userInfo.headImgUrl}}"></image> <image class="user-avatar" wx:if="{{userInfo.gender == 1}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png"></image>
<image class="user-avatar" wx:elif="{{userInfo.gender == 2}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/girl_default.png"></image>
<image class="user-avatar" wx:else src="https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132"></image>
<view class="info-content"> <view class="info-content">
<view class="info-name-msg"> <view class="info-name-msg">
<view class="info-name">{{userInfo.name}} <image class="vip" wx:if="{{hasSkipDev}}" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_vip.png"></image> <view class="info-name">{{userInfo.name || '游客'}}
</view> </view>
<view class="update-info" catchtap="setAvartar" id="edit" wx:if="{{!isManagement}}">编辑资料</view> <!-- <view class="update-info" catchtap="setAvartar" id="edit" wx:if="{{!isManagement}}">编辑资料</view> -->
</view>
<view wx:if="{{userInfo.peopleType!='OrganMember'}}" class="{{userInfo.peopleType=='Student'?'user-type':userInfo.peopleType=='Teacher'?'teacher-type':userInfo.peopleType=='Visitor'?'yk-type':'jg-type'}}">{{userInfo.peopleType=='Student'?'孩子':userInfo.peopleType=='Teacher'?'教师':userInfo.peopleType=='Visitor'?'游客':userInfo.peopleType=='School'?'管理员':'教育局'}}</view>
<view class="sch-msg" wx:if="{{userInfo.peopleType=='OrganArea' || userInfo.peopleType=='OrganProvince' || userInfo.peopleType=='OrganCity'}}">
{{userInfo.schName}}教育局
</view>
<view class="sch-msg" wx:elif="{{userInfo.peopleType=='School'}}">
{{userInfo.schName}}管理员
</view>
<view class="sch-msg" wx:else>
{{userInfo.schName}} <block wx:if="{{userInfo.className}}">| {{userInfo.className}}</block>
</view> </view>
<view class="user-type" wx:if="{{userInfo.peopleType == 'parent'}}">家长</view>
<view class="teacher-type" wx:if="{{userInfo.peopleType == 'visitor'}}">游客</view>
<view class="jg-type" wx:if="{{userInfo.peopleType == 'employ'}}">管理员</view>
</view> </view>
</view> </view>
<block wx:if="{{userInfo.peopleType=='Student'&&threeStuList.length>1}}"> <block wx:if="{{userInfo.stuId && childList && childList.length}}">
<view class="user-list"> <view class="user-list">
<view class="stu-list"> <view class="stu-list">
<block wx:for="{{threeStuList}}"> <block wx:for="{{childList}}" wx:if="{{index < 3}}">
<view class="user-list-item {{item.isCur?'user-list-item-a':''}}" data-item="{{item}}" catchtap="checkStu"> <view class="user-list-item {{item.isCurrent?'user-list-item-a':''}}" data-item="{{item}}" catchtap="checkStu">
<view class="avatar-msg"> <view class="avatar-msg">
<image class="check" src="{{item.imgSrc}}"></image> <image class="check" src="{{item.gender == 1 ?'https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png':'https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/girl_default.png'}}"></image>
<image class="checked" wx:if="{{item.isCur}}" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/sf_icon_xz.png"></image> <image class="checked" wx:if="{{item.isCurrent}}" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/sf_icon_xz.png"></image>
</view> </view>
<view class="child-name">{{item.name}}</view> <view class="child-name">{{item.name}}</view>
</view> </view>
</block> </block>
</view> </view>
<view class="all-child" catchtap="cutIden"> <view class="all-child" data-type="change" catchtap="handleTab">
共有{{allStuList.length}}个孩子<image src="/images/home/next.png"></image> 共有{{childList.length}}个孩子<image src="/images/home/next.png"></image>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<view class="sport-main" wx:if="{{!isManagement}}"> <view class="sport-main" wx:if="{{userInfo.stuId}}">
<view class="mine-main"> <view class="mine-main">
<view class="sport-info" bindtap="sportRecord"> <view class="sport-info" bindtap="sportRecord">
<view class="sport-info-title">总运动</view> <view class="sport-info-title">总运动</view>
...@@ -63,57 +58,21 @@ ...@@ -63,57 +58,21 @@
<!-- 功能菜单 --> <!-- 功能菜单 -->
<view class="menu"> <view class="menu">
<view class="menu-list"> <view class="menu-list">
<view class="menu-item" bindtap="problem"> <view wx:for="{{userInfo.peopleType=='employ'?optionTab['employ']:optionTab['parent']}}"
<view class="menu-msg"> class="menu-item" data-type="{{item.event}}" bindtap="handleTab">
<image class="menu-icon" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png"></image> <view class="menu-msg">
<view class="menu-name">问题咨询</view> <image class="menu-icon" src="{{item.icon}}"></image>
</view> <view class="menu-name">{{item.title}}</view>
<image class="jump" src="/images/home/next.png"></image> </view>
</view> <image class="jump" src="/images/home/next.png"></image>
</view> </view>
</view>
</view> </view>
<!-- 切换身份 --> <!-- 退出 -->
<view class="check-identity {{isManagement ? 'management' : ''}}"> <view class="layout-btn" data-type="layout" bindtap="handleTab">
<view class="check-user-btn" catchtap="cutIden"> 退出登录
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_qhsf.png"></image>
<view class="btn-text">添加/切换身份</view>
</view>
</view> </view>
<view class="block"></view> <view class="block"></view>
<view class="tips" wx:if="{{isTips}}">
<view class="mask" bindtap="closeTips"></view>
<view class="content">
<view class="title">
提示
<image class="close" src="../../images/mine/icon-close.png" bindtap="closeTips"></image>
</view>
<view class="text" wx:if="{{type == 'Parent'}}">为了给您提供更完善的体质健康数据分析请完善您孩子的基本信息</view>
<view class="text" wx:if="{{type == 'Visitor'}}">为了给您提供更完善的体质健康数据分析请完善您的基本信息</view>
<view class="item">
<view class="type">姓名</view>
<view class="name">{{userInfo.name}}</view>
</view>
<view class="item" wx:if="{{type != 'Visitor'}}">
<view class="type">学校</view>
<view class="name">{{userInfo.schName}}</view>
</view>
<view class="item" wx:if="{{type != 'Visitor'}}">
<view class="type">班级</view>
<view class="name">{{userInfo.className}}</view>
</view>
<view class="item">
<view class="type">性别</view>
<picker class="name" bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<image src="../../images/mine/icon-next.png"></image>
<view class="sex">
{{array[index]}}
</view>
</picker>
</view>
<view class="save" bindtap="save">保存</view>
</view>
</view>
</view> </view>
\ No newline at end of file
...@@ -29,7 +29,6 @@ page { ...@@ -29,7 +29,6 @@ page {
.user-info { .user-info {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center;
} }
.user-avatar { .user-avatar {
...@@ -52,6 +51,7 @@ page { ...@@ -52,6 +51,7 @@ page {
.info-name-msg { .info-name-msg {
margin-top: 14rpx; margin-top: 14rpx;
margin-bottom: 10rpx;
} }
.info-name { .info-name {
...@@ -76,7 +76,6 @@ page { ...@@ -76,7 +76,6 @@ page {
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
} }
.update-info:active { .update-info:active {
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
} }
...@@ -867,4 +866,16 @@ text-align: center; ...@@ -867,4 +866,16 @@ text-align: center;
/* .management{ /* .management{
position: fixed; position: fixed;
bottom: 160rpx; bottom: 160rpx;
} */ } */
\ No newline at end of file
.layout-btn{
margin:60rpx 50rpx 0rpx 50rpx;
font-size: 34rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FF4E4E;
text-align: center;
padding: 24rpx 0rpx;
background: rgba(255, 78, 78, 0.12);
border-radius: 56rpx;
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:45:35 * @Date: 2022-06-06 16:45:35
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 17:22:18 * @LastEditTime: 2022-06-16 11:25:35
*/ */
var API = require("../../utils/request"); var API = require("../../utils/request");
Page({ Page({
...@@ -29,8 +29,9 @@ Page({ ...@@ -29,8 +29,9 @@ Page({
6: '1000次' 6: '1000次'
}, //定时跳map }, //定时跳map
selectContent: '', //当前模式 selectContent: '', //当前模式
dataList:[] dataList:[],
popupShow:false
}, },
/** /**
...@@ -40,11 +41,8 @@ Page({ ...@@ -40,11 +41,8 @@ Page({
}, },
/** onClose(){
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
}, },
//切换模式 //切换模式
checkSkipType(e) { checkSkipType(e) {
...@@ -154,6 +152,13 @@ nextType() { ...@@ -154,6 +152,13 @@ nextType() {
selected: 1 selected: 1
}) })
} }
let userInfo = wx.getStorageSync("userInfo")
//如果没有绑定小孩 或者 绑定了小孩没有填写身高体重
if(!userInfo.stuId || !userInfo.height){
this.setData({popupShow:true},() =>{
this.selectComponent("#userInput").checkUserChild()
})
}
this.setData({ this.setData({
skipType: 1, //1、定时跳,2、定数跳,3、自由跳 skipType: 1, //1、定时跳,2、定数跳,3、自由跳
selectType: 2, selectType: 2,
...@@ -196,7 +201,10 @@ nextType() { ...@@ -196,7 +201,10 @@ nextType() {
wx.navigateTo({ wx.navigateTo({
url: '../../subPages/sport/checkSkip/checkSkip?type=' + type + '&select=' + select, url: '../../subPages/sport/checkSkip/checkSkip?type=' + type + '&select=' + select,
}) })
}, },
closePopup(){
this.setData({popupShow:false})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
{ {
"usingComponents": {}, "usingComponents": {
"t-popup":"../../components/t-popup/index",
"stu-info":"../../components/sport/stu-info-popup/stu-info-popup"
},
"navigationBarTitleText": "运动" "navigationBarTitleText": "运动"
} }
\ No newline at end of file
...@@ -32,4 +32,9 @@ ...@@ -32,4 +32,9 @@
<!-- 1分钟 --> <!-- 1分钟 -->
<view class="sport-text">计时·{{item.difficulty == 'easy' ? '简单' : item.difficulty == 'normal' ? '中等' : '困难'}}</view> <view class="sport-text">计时·{{item.difficulty == 'easy' ? '简单' : item.difficulty == 'normal' ? '中等' : '困难'}}</view>
</view> </view>
<!-- 若登录者未绑定小孩 -->
<t-popup show="{{popupShow}}" closeOnClickOverlay="{{false}}" type="bottom" bindclose="onClose">
<stu-info id="userInput" bindclosePopup="closePopup"></stu-info>
</t-popup>
</view> </view>
\ No newline at end of file
...@@ -215,4 +215,4 @@ ...@@ -215,4 +215,4 @@
.start-skip:active { .start-skip:active {
background-color: rgba(255, 255, 255, 0.8); background-color: rgba(255, 255, 255, 0.8);
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"include": [] "include": []
}, },
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": false, "es6": false,
"enhance": true, "enhance": true,
"postcss": true, "postcss": true,
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.17.0", "libVersion": "2.17.0",
"appid": "wx7d7fbc0e6746baf5", "appid": "wx7d7fbc0e6746baf5",
"projectname": "小奔体育", "projectname": "小奔运动",
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"editorSetting": { "editorSetting": {
......
...@@ -13,135 +13,30 @@ ...@@ -13,135 +13,30 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "", "name": "体验课订单列表",
"pathName": "pages/sport/sport", "pathName": "subPages/course/attempt-list/attempt-list",
"query": "AI运动",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/sport/detail/detail",
"query": "运动详情页",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/sport/ai-ywqz-sport/ai-ywqz-sport",
"query": "sportTime=60",
"launchMode": "default",
"scene": null
},
{
"name": "ai运动分享",
"pathName": "subPages/sport/share/share",
"query": "id=10774553&share=0&showMedal=1&user=1&sportTime=00:02:00",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/sport/ywqz-sport/ywqz-sport",
"query": "sportType=1",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/sport/sportTime/sportTime",
"query": "type=1",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/bluetooth/skip/skip",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "蓝牙跳绳",
"pathName": "subPages/bluetooth/skip/skip",
"query": "mode=2",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/bluetooth/share/share",
"query": "share=0&id=10774740&showMedal=1&sportTime=40",
"launchMode": "default",
"scene": null
},
{
"name": "登录",
"pathName": "subPages/login/login/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "手机号登录",
"pathName": "subPages/login/mobile-login/mobile-login",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "我的", "name": "班课报名",
"pathName": "pages/my/my", "pathName": "subPages/course/join-list/join-list",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "课程列表", "name": "销课记录",
"pathName": "subPages/course/list/list", "pathName": "subPages/course/sales-list/sales-list",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "我的收藏",
"pathName": "subPages/sport/sportTime/sportTime", "pathName": "subPages/course/collect-list/collect-list",
"query": "type=2",
"launchMode": "default",
"scene": null
},
{
"name": "订单支付",
"pathName": "subPages/course/pay/pay",
"query": "", "query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/login/role-list/role-list",
"query": "角色",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/course/detail/detail",
"query": "id=17098",
"launchMode": "default",
"scene": null
},
{
"name": "课程详情",
"pathName": "subPages/course/detail/detail",
"query": "id=17098",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/course/order/order",
"query": "id=17099",
"scene": null, "scene": null,
"launchMode": "default" "launchMode": "default"
} }
......
...@@ -2514,12 +2514,13 @@ Page({ ...@@ -2514,12 +2514,13 @@ Page({
}, },
// 获取学生信息 // 获取学生信息
getStuInfo(){ getStuInfo(){
let userInfo = wx.getStorageSync("userInfo")
var that = this; var that = this;
//TODU 不调接口,身高体重从缓存取 //TODU 不调接口,身高体重从缓存取
grade = 3; grade = 3;
ppb_weight_val =120; ppb_weight_val = userInfo.height || 110;
ppb_height_val = 160; ppb_height_val = userInfo.weight || 40;
ppb_age_val = 13; ppb_age_val = 10;
// API.getData('/sch/member/getinfo', {}, (res)=> { // API.getData('/sch/member/getinfo', {}, (res)=> {
// console.log(res); // console.log(res);
// if(res.code ==200){ // if(res.code ==200){
......
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 11:10:27
*/
var API = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
page:0,
list:[],
loading:false,
finish:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
})
},
onReachBottom:function (){
if(this.data.loading && this.data.finish) return
this.queryCourseList()
},
queryCourseList(){
let that = this
this.data.page ++
this.data.loading = true
API.getData('/px/course/getUserCourseOrderList', {
page:that.data.page,
size:10
}, (res) => {
if(res && res.data && res.data.length){
res.data.forEach(item => {
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
})
}
that.data.loading = true
that.data.finish = res.data.length < 10
that.data.list = that.data.list.concat(res.data || [])
that.setData({
page:that.data.page,
finish:that.data.finish,
loading:that.data.loading,
list:that.data.list
})
});
},
payCourse(e){
let {data} = e.currentTarget.dataset
let that = this
API.requestAll('/px/order/pay', {orderNo:data.orderNo}, (res) => {
if(res.code ==200){
wx.requestPayment({
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.packageValue,
signType: res.data.signType,
paySign: res.data.paySign,
success(res) {
wx.showToast({
title: '支付成功',
icon: 'success',
duration: 2000
});
setTimeout(() =>{
that.onShow()
},1500)
},
fail(res) {
}
})
}else{
wx.showToast({
title: res.message,
duration: 2000,
icon: 'none'
});
}
}, function (res) {
// canOrder = true;
wx.showToast({
title: res.message,
duration: 2000,
icon: 'none'
});
});
},
cannalCourse(e){
let {data} = e.currentTarget.dataset
let that = this
wx.showModal({
title: '提示',
content: '你确定要取消此订单吗',
success(res) {
if (res.confirm) {
API.getData('/px/course/orderRefundApply', {orderId:data.orderId}, (res) => {
if(res.code == 200){
wx.showToast({
title: '取消成功',
icon: 'success',
duration: 2000
});
setTimeout(() =>{
that.onShow()
},1500)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
gotoDetail(e){
let {id} = e.currentTarget.dataset
wx.navigateTo({
url: '/subPages/course/detail/detail?id=' + id,
})
},
})
\ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "体验课订购"
} }
\ No newline at end of file
<!-- 体验课订单列表 -->
<view class="page-bg">
<view class="course" wx:for="{{list}}">
<view class="flex-s">
<view class="course-time"><text class="blod-c">订购时间</text>:{{item.orderTime}}</view>
<!-- 0:待支付,1:已订购,2:待退款,3:已退款,4:已关闭) -->
<view class="course-state {{['red-c','gree-c','yell-c','grey-c','grey-c'][item.orderStatus]}}">{{['待支付','已订购','待退款','已退款','已关闭'][item.orderStatus]}}</view>
</view>
<view class="course-ctn flex-c">
<view class="course-img">
<image class="course-img" mode="aspectFill" src="{{item.poster}}" />
</view>
<view class="course-info">
<view class="course-title">{{item.courseName}}</view>
<view class="flex-c">
<view class="tag-item {{item.courseStep==1?'xx-color':item.courseStep==2?'cz-color':'gz-color'}}">{{item.courseStep==1?'小学':item.courseStep==2?'初中':'高中'}}组</view>
<view class="tag-item">{{item.classHour}}课时</view>
<view class="tag-item">{{['','基础班','提高班','精英班','赛事班'][item.leveId]}}</view>
</view>
<view class="course-teachers">授课教练 {{item._empNames}}</view>
</view>
</view>
<view class="btm-line flex-s">
<view class="flex-c">
<text class="t1">支付金额:</text><text class="unit">¥</text><text class="course-price">{{item.orderAmt ? item.orderAmt / 100 : 0}}</text>
</view>
<view class="flex-c">
<!-- orderStatus (0:待支付,1:已订购,2:待退款,3:已退款,4:已关闭) -->
<view class="cannal-btn" data-data="{{item}}" bindtap="cannalCourse" wx:if="{{item.canCancelOrder == 1 && item.orderStatus == 1}}">取消订单</view>
<view class="pay-btn" wx:if="{{item.orderStatus==0}}" data-data="{{item}}" bindtap="payCourse">立即支付</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
.page-bg{
min-height: 100vh;
width: 100%;
background-color: #f5f5f5;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-c{
display: flex;align-items: center;
}
.course{
margin-bottom: 20rpx;
padding: 30rpx;
background-color: #fff;
}
.course-time{
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
}
.course-state{
padding: 4rpx 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
border-radius: 8rpx;
}
.red-c{background: #FF4E4E;color: #fff;}
.gree-c{background: #00BB68;color: #fff;}
.yell-c{background: #DDC200;color: #fff;}
.grey-c{background: rgba(0, 0, 0, 0.08);color: rgba(0, 0, 0, 0.3);}
.course-ctn{
margin-top: 20rpx;
}
.blod-c{font-weight: bold;}
.course-img{
position: relative;
height: 186rpx;
width: 300rpx;
border-radius: 24rpx;
}
.course-info{
height: 186rpx;
margin-left: 20rpx;
width: calc(100% - 320rpx);
}
.course-title{
position: relative;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.tag-item{
margin-top: 12rpx;
margin-right: 10rpx;
padding: 4rpx 10rpx;
background: #F8F8F8;
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.xx-color{
background: rgba(45, 137,255, 0.12) !important;
color: #2D89FF !important;
}
.cz-color{
background: rgba(0, 187,104, 0.12) !important;
color: #00BB68 !important;
}
.gz-color{
background: rgba(38, 122,202, 0.12) !important;
color: #267ACA !important;
}
.course-teachers{
margin-top: 62rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.btm-line{
margin-top: 30rpx;
}
.t1{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.t2{
font-size: 30rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.course-price{
margin-left: 10rpx;
font-size: 44rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.cannal-btn{
padding: 10rpx 30rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
border-radius: 32rpx;
opacity: 1;
border: 2rpx solid rgba(0, 0, 0, 0.1);
}
.pay-btn{
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
background: #FF811E;
border-radius: 32rpx;
padding: 10rpx 30rpx;
margin-left: 20rpx;
}
\ No newline at end of file
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 11:02:56
*/
var API = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
page:0,
list:[],
loading:false,
finish:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
})
},
onReachBottom:function (){
if(this.data.loading && this.data.finish) return
this.queryCourseList()
},
queryCourseList(){
let that = this
this.data.page ++
this.data.loading = true
API.getData('/px/course/getUserCollectList', {
page:that.data.page,
size:10
}, (res) => {
if(res && res.data && res.data.length){
res.data.forEach(item => {
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
})
}
that.data.loading = true
that.data.finish = res.data.length < 10
that.data.list = that.data.list.concat(res.data || [])
that.setData({
page:that.data.page,
finish:that.data.finish,
loading:that.data.loading,
list:that.data.list
})
});
},
gotoDetail(e){
let {id} = e.currentTarget.dataset
wx.navigateTo({
url: '/subPages/course/detail/detail?id=' + id,
})
},
cannalCollect(e){
let {id} = e.currentTarget.dataset
let that = this
API.getData('/px/course/collectCancelCourse', {
id:id,
opType:2, //1:收藏,2:取消收藏
}, (res) => {
wx.showToast({
icon:'none',
title: `取消收藏成功`,
}).then(() =>{
that.onShow()
})
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "我的收藏"
}
\ No newline at end of file
<!-- 体验课订单列表 -->
<view class="page-bg">
<view class="course" wx:for="{{list}}" bindtap="gotoDetail" data-id="{{item.id}}">
<van-swipe-cell right-width="{{ 80 }}">
<view class="course-ctn flex-c">
<view class="course-img">
<view class="course-type {{item.type==1?'gree-c':'yell-c'}}">{{item.type==1?'正式班课':'体验课'}}</view>
<image class="course-img" mode="aspectFill" src="{{item.poster}}" />
<view class="course-nums">{{item.type==1?'已购' + (item.peopleNum || 0) + '人': item.peopleNum || 0 + '已体验'}}</view>
</view>
<view class="course-info">
<view class="course-h">
<view class="course-title">{{item.name}}</view>
<view class="flex-c">
<view class="tag-item {{item.courseStep==1?'xx-color':item.courseStep==2?'cz-color':'gz-color'}}">{{item.courseStep==1?'小学':item.courseStep==2?'初中':'高中'}}组</view>
<view class="tag-item">{{item.classHour}}课时</view>
<view class="tag-item">{{['','基础班','提高班','精英班','赛事班'][item.leveId]}}</view>
</view>
</view>
<view class="flex-s">
<view class="course-teachers">授课教练 {{item._empNames}}</view>
<view class="course-btm">
<view class="unit">¥</view>
<view class="course-price">{{item.cost?item.cost/100:0}}</view>
</view>
</view>
</view>
</view>
<view slot="right" class="del-btn" data-id="{{item.id}}" bindtap="cannalCollect">删除</view>
</van-swipe-cell>
</view>
</view>
\ No newline at end of file
.page-bg{
min-height: 100vh;
width: 100%;
background-color: #fff;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-c{
display: flex;align-items: center;
}
.course{
padding: 20rpx 30rpx 0rpx 30rpx;
background-color: #fff;
}
.course-time{
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
}
.course-state{
padding: 4rpx 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
border-radius: 8rpx;
}
.gree-c{background: linear-gradient(132deg, #2D89FF 0%, #72B0FF 100%);color: #fff;}
.yell-c{background: linear-gradient(136deg, #FF811E 0%, #F3C100 100%);color: #fff;}
.course-ctn{
margin-top: 20rpx;
}
.course-type{
}
.blod-c{font-weight: bold;}
.course-img{
position: relative;
height: 186rpx;
width: 300rpx;
border-radius: 24rpx;
}
.course-type{
position: absolute;
left: 10rpx;
top: 10rpx;
border-radius: 8rpx;
padding: 2rpx 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
z-index: 11;
}
.course-nums{
position: absolute;
left: 10rpx;
bottom:10rpx;
padding: 6rpx 16rpx;
background:rgba(0, 0, 0, 0.24);
border-radius: 22rpx;
color: #fff;
z-index: 11;
font-size: 22rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.course-info{
height: 186rpx;
margin-left: 20rpx;
width: calc(100% - 320rpx);
}
.course-title{
position: relative;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.course-h{
height: 135rpx;
}
.tag-item{
margin-top: 12rpx;
margin-right: 10rpx;
padding: 4rpx 10rpx;
background: #F8F8F8;
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.xx-color{
background: rgba(45, 137,255, 0.12) !important;
color: #2D89FF !important;
}
.cz-color{
background: rgba(0, 187,104, 0.12) !important;
color: #00BB68 !important;
}
.gz-color{
background: rgba(38, 122,202, 0.12) !important;
color: #267ACA !important;
}
.course-teachers{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.course-btm{
display: flex;
}
.unit{
line-height: 61rpx;
font-size: 30rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.course-price{
display: flex;
margin-left: 10rpx;
font-size: 44rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.del-btn{
height: 100%;
width: 160rpx;
background-color: #fff;
font-size: 30rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
background: #FF4E4E;
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-13 08:57:51 * @Date: 2022-06-13 08:57:51
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-15 09:22:54 * @LastEditTime: 2022-06-15 11:52:08
*/ */
var API = require("../../../utils/request.js"); var API = require("../../../utils/request.js");
Page({ Page({
...@@ -72,6 +72,11 @@ Page({ ...@@ -72,6 +72,11 @@ Page({
phoneNumber: this.data.detail.schoolList[schoolActive].tel phoneNumber: this.data.detail.schoolList[schoolActive].tel
}) })
}, },
gotoPay(){
wx.navigateTo({
url: '/subPages/course/pay-order/pay-order?id=' + this.data.detail.id,
})
},
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
let that = this let that = this
......
...@@ -10,12 +10,14 @@ ...@@ -10,12 +10,14 @@
<view class="info-ctn flex-s"> <view class="info-ctn flex-s">
<view> <view>
<!-- <view class="detail-num">{{detail.peopleNum || 0}}人已体验</view> --> <!-- <view class="detail-num">{{detail.peopleNum || 0}}人已体验</view> -->
<view class="course-tag"> <view class="course-tag">
<view class="tag-item {{detail.courseStep==1?'xx-color':detail.courseStep==2?'cz-color':'gz-color'}}">{{detail.courseStep==1?'小学':item.courseStep==2?'初中':'高中'}}组</view> <view class="tag-item {{detail.courseStep==1?'xx-color':detail.courseStep==2?'cz-color':'gz-color'}}">{{detail.courseStep==1?'小学':item.courseStep==2?'初中':'高中'}}组</view>
<view class="tag-item">{{detail.classHour}}课时</view> <view class="tag-item">{{detail.classHour}}课时</view>
<view class="tag-item">{{['','基础班','提高班','精英班','赛事班'][detail.leveId]}}</view> <view class="tag-item">{{['','基础班','提高班','精英班','赛事班'][detail.leveId]}}</view>
</view> </view>
<view class="fixed-price" wx:if="{{detail.type == 1}}">
<text class="unit">¥</text>{{detail.cost / 100}}</view>
<view class="detail-text"> <view class="detail-text">
<view class="teach-list">授课教练 {{detail._empNames}}</view> <view class="teach-list">授课教练 {{detail._empNames}}</view>
</view> </view>
...@@ -63,7 +65,7 @@ ...@@ -63,7 +65,7 @@
</view> </view>
<view class="fixed-btm flex-s"> <view class="fixed-btm flex-s">
<view class="fixed-price">¥{{detail.cost / 100}}</view> <view class="fixed-price red-c" wx:if="{{detail.type == 2}}"><text class="unit red-c">¥</text>{{detail.cost / 100}}</view>
<view class="fixed-btn">立即抢购</view> <view class="fixed-btn {{detail.type == 1?'max-w':''}}" bindtap="gotoPay">{{detail.type==2?'立即抢购':'立即报名'}}</view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -174,12 +174,27 @@ ...@@ -174,12 +174,27 @@
color: #FFFFFF; color: #FFFFFF;
padding: 21rpx 132rpx; padding: 21rpx 132rpx;
background: #FF811E; background: #FF811E;
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.08); box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.08);
border-radius: 50rpx; border-radius: 50rpx;
} }
.max-w{
width: 100%;
padding: 21rpx 0rpx !important;
text-align: center;
}
.red-c{
color: #FF4E4E !important;
}
.fixed-price{ .fixed-price{
font-size: 60rpx; font-size: 60rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN; font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold; font-weight: bold;
color: #FF4E4E; color: rgba(0, 0, 0, 0.9);
}
.unit{
margin-right: 6rpx;
font-size: 40rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
} }
\ No newline at end of file
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 09:38:29
*/
var API = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
page:0,
list:[],
loading:false,
finish:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
})
},
onReachBottom:function (){
if(this.data.loading && this.data.finish) return
this.queryCourseList()
},
queryCourseList(){
let that = this
this.data.page ++
this.data.loading = true
API.getData('/px/course/getUserCourseBmList', {
page:that.data.page,
size:10
}, (res) => {
if(res && res.data && res.data.length){
res.data.forEach(item => {
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
})
}
that.data.loading = true
that.data.finish = res.data.length < 10
that.data.list = that.data.list.concat(res.data || [])
that.setData({
page:that.data.page,
finish:that.data.finish,
loading:that.data.loading,
list:that.data.list
})
});
},
cannalJoin(e){
let {data} = e.currentTarget.dataset
let that = this
wx.showModal({
title: '提示',
content: '你确定要取消报名吗',
success(res) {
if (res.confirm) {
API.getData('/px/course/cancelCourseBm', {bmId:data.bmId}, (res) => {
if(res.code == 200){
wx.showToast({
title: '取消成功',
icon: 'success',
duration: 2000
});
setTimeout(() =>{
that.onShow()
},1500)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "班课报名"
}
\ No newline at end of file
<!-- 体验课订单列表 -->
<view class="page-bg">
<view class="course" wx:for="{{list}}">
<view class="flex-s">
<view class="course-time"><text class="blod-c">报名时间</text>:{{item.bmTime}}</view>
<!-- bmStatus 报名状态(0:待确认报名,1:已确认报名,2:待取消报名,3:已取消报名) -->
<view class="course-state {{['yell-c','gree-c','red-c','grey-c'][item.bmStatus]}}">{{['待确认','已报名','待取消','已取消'][item.bmStatus]}}</view>
</view>
<view class="course-ctn flex-c">
<view class="course-img">
<image class="course-img" mode="aspectFill" src="{{item.poster}}" />
</view>
<view class="course-info">
<view class="course-title">{{item.courseName}}</view>
<view class="flex-c">
<view class="tag-item {{item.courseStep==1?'xx-color':item.courseStep==2?'cz-color':'gz-color'}}">{{item.courseStep==1?'小学':item.courseStep==2?'初中':'高中'}}组</view>
<view class="tag-item">{{item.classHour}}课时</view>
<view class="tag-item">{{['','基础班','提高班','精英班','赛事班'][item.leveId]}}</view>
</view>
<view class="course-teachers">授课教练 {{item._empNames}}</view>
</view>
</view>
<view class="btm-line flex-s">
<view class="flex-c">
<text class="t1">支付金额:</text><text class="unit">¥</text><text class="course-price">{{item.cost ? item.cost / 100 : 0}}</text>
</view>
<view class="flex-c">
<!-- bmStatus 报名状态(0:待确认报名,1:已确认报名,2:待取消报名,3:已取消报名) -->
<view class="cannal-btn" data-data="{{item}}" bindtap="cannalJoin" wx:if="{{item.canCancel == 1 && item.bmStatus == 1}}">取消报名</view>
<!-- <view class="pay-btn" wx:if="{{item.orderStatus==0}}" data-data="{{item}}" bindtap="payCourse">立即支付</view> -->
</view>
</view>
</view>
</view>
\ No newline at end of file
.page-bg{
min-height: 100vh;
width: 100%;
background-color: #f5f5f5;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-c{
display: flex;align-items: center;
}
.course{
margin-bottom: 20rpx;
padding: 30rpx;
background-color: #fff;
}
.course-time{
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
}
.course-state{
padding: 4rpx 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
border-radius: 8rpx;
}
.red-c{background: #FF4E4E;color: #fff;}
.gree-c{background: #00BB68;color: #fff;}
.yell-c{background: #DDC200;color: #fff;}
.grey-c{background: rgba(0, 0, 0, 0.08);color: rgba(0, 0, 0, 0.3);}
.course-ctn{
margin-top: 20rpx;
}
.blod-c{font-weight: bold;}
.course-img{
position: relative;
height: 186rpx;
width: 300rpx;
border-radius: 24rpx;
}
.course-info{
height: 186rpx;
margin-left: 20rpx;
width: calc(100% - 320rpx);
}
.course-title{
position: relative;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.tag-item{
margin-top: 12rpx;
margin-right: 10rpx;
padding: 4rpx 10rpx;
background: #F8F8F8;
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.xx-color{
background: rgba(45, 137,255, 0.12) !important;
color: #2D89FF !important;
}
.cz-color{
background: rgba(0, 187,104, 0.12) !important;
color: #00BB68 !important;
}
.gz-color{
background: rgba(38, 122,202, 0.12) !important;
color: #267ACA !important;
}
.course-teachers{
margin-top: 62rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.btm-line{
margin-top: 30rpx;
}
.t1{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.t2{
font-size: 30rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.course-price{
margin-left: 10rpx;
font-size: 44rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.cannal-btn{
padding: 10rpx 30rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
border-radius: 32rpx;
opacity: 1;
border: 2rpx solid rgba(0, 0, 0, 0.1);
}
.pay-btn{
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
background: #FF811E;
border-radius: 32rpx;
padding: 10rpx 30rpx;
margin-left: 20rpx;
}
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "小奔体育" "navigationBarTitleText": "小奔运动"
} }
\ No newline at end of file
...@@ -161,6 +161,13 @@ white-space: normal !important; ...@@ -161,6 +161,13 @@ white-space: normal !important;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
} }
.pay-num{ .pay-num{
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-14 17:37:06 * @Date: 2022-06-14 17:37:06
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-14 19:57:35 * @LastEditTime: 2022-06-16 11:31:50
*/ */
var API = require("../../../utils/request.js"); var API = require("../../../utils/request.js");
Page({ Page({
...@@ -15,6 +15,7 @@ Page({ ...@@ -15,6 +15,7 @@ Page({
detail:{}, detail:{},
params:{ params:{
stuName:'',
gender:'', //性别 gender:'', //性别
releationShip:'', //关系 releationShip:'', //关系
schId:'', //所在校区 schId:'', //所在校区
...@@ -25,28 +26,37 @@ Page({ ...@@ -25,28 +26,37 @@ Page({
{name:'爸爸',value:1},{name:'妈妈',value:2},{name:'其他',value:3} {name:'爸爸',value:1},{name:'妈妈',value:2},{name:'其他',value:3}
], ],
gxIndex:'', gxIndex:'',
slIndex:'' slIndex:'',
popupShow:false //报名成功弹窗
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
//如果有绑定的学生,需要写入输入框中,信息可改
let userInfo = wx.getStorageSync("userInfo")
if(userInfo.stuId){
this.data.params.stuName = userInfo.stuName
this.data.params.gender = userInfo.stuGender
this.data.params.releationShip = userInfo.relation
let idx = this.data.gxList.findIndex(v => v.value == userInfo.relation)
this.setData({params:this.data.params,gxIndex:idx,randerIdx:userInfo.stuGender==1?0:1})
}
this.queryCourseDetail(this.options.id) this.queryCourseDetail(this.options.id)
}, },
queryCourseDetail(id){ queryCourseDetail(id){
let that = this let that = this
API.getData('/px/course/getMobileCourseInfo', { API.getData('/px/course/getMobileCourseInfo', {id:id}, (res) => {
id:id,
}, (res) => {
if(res.data && res.data.detail){ if(res.data && res.data.detail){
res.data.detail = res.data.detail.replace(/<img/g, '<img class="rich-img" '); res.data.detail = res.data.detail.replace(/<img/g, '<img class="rich-img" ');
res.data['_empNames'] = (res.data.pxEmployeeList.map(v => v.empName)).join('、') res.data['_empNames'] = (res.data.pxEmployeeList.map(v => v.empName)).join('、')
...@@ -80,6 +90,8 @@ Page({ ...@@ -80,6 +90,8 @@ Page({
this.setData({params:this.data.params}) this.setData({params:this.data.params})
}, },
createOrder(){ createOrder(){
// this.toPay({orderNo:'74d053a18af14a76a549956d48f539dc'})
// return
let param = this.data.params let param = this.data.params
if(!param.stuName){ if(!param.stuName){
wx.showToast({title: '请输入孩子姓名',icon: 'none',}); wx.showToast({title: '请输入孩子姓名',icon: 'none',});
...@@ -97,14 +109,38 @@ Page({ ...@@ -97,14 +109,38 @@ Page({
wx.showToast({title: '请选择所在校区',icon: 'none',}); wx.showToast({title: '请选择所在校区',icon: 'none',});
return return
} }
this.payOrder({
...param,...{courserId:this.data.detail.id,phone:13975487978} //体验课付款下单
}) if(this.data.detail.type == 1){
this.joinCourse({...param,...{courserId:this.data.detail.id}})
}else{
this.payOrder({
...param,...{courserId:this.data.detail.id}
})
}
},
joinCourse(data){
let that = this
API.requestAll('/px/order/addNormalBm', data,function (res) {
if(res.code == 200){
that.wxGetUserInfo()
that.setData({
popupShow:true
})
}else{
wx.showToast({
title: res.message,
duration: 2000,
icon: 'none'
});
}
})
}, },
payOrder(data){ payOrder(data){
let that = this let that = this
API.requestAll('/px/order/addTyOrder', data,function (res) { API.requestAll('/px/order/addTyOrder', data,function (res) {
if(res.code == 200){ if(res.code == 200){
that.wxGetUserInfo()
that.toPay(res.data) that.toPay(res.data)
}else{ }else{
wx.showToast({ wx.showToast({
...@@ -131,8 +167,8 @@ Page({ ...@@ -131,8 +167,8 @@ Page({
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}); });
wx.navigateTo({ wx.redirectTo({
url: '/pages/goods/order/order' url: '/subPages/course/attempt-list/attempt-list'
}) })
}, },
fail(res) { fail(res) {
...@@ -155,6 +191,11 @@ Page({ ...@@ -155,6 +191,11 @@ Page({
}); });
}, },
gotoJoinList(){
wx.redirectTo({
url:'/subPages/course/join-list/join-list'
})
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
...@@ -162,6 +203,22 @@ Page({ ...@@ -162,6 +203,22 @@ Page({
}, },
wxGetUserInfo(){
let userInfo = wx.getStorageSync("userInfo")
if(userInfo.peopleType != 'visitor'){
//如果当前身份为游客,报名课程或者订购体验课会自动给用户绑定小孩,身份转为家长,需查最新接口赋值
return
}
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
wx.setStorageSync('peopleType',res.data.peopleType)
wx.setStorageSync('userInfo',res.data)
}
}, function () {
// wx.hideLoading()
});
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
......
{ {
"usingComponents": { "usingComponents": {
"xb-icon": "../../../components/t-icon/t-icon" "xb-icon": "/components/t-icon/t-icon",
"t-popup":"/components/t-popup/index"
}, },
"navigationBarTitleText": "订单提交" "navigationBarTitleText": "订单提交"
} }
\ No newline at end of file
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
</view> </view>
<view class="btm-text"> <view class="btm-text">
<view class="empNames-w">授课教练 {{detail._empNames}}</view> <view class="empNames-w">授课教练 {{detail._empNames}}</view>
<view class="price-t"> <view class="price-t {{detail.type == 2 ? 'red-c' :''}}">
<text class="unit">¥</text> <text class="unit {{detail.type == 2 ? 'red-c' :''}}">¥</text>
<text class="price">{{detail.cost / 100}}</text> <text class="price">{{detail.cost / 100}}</text>
</view> </view>
</view> </view>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<view class="input-item"> <view class="input-item">
<view class="input-t">孩子姓名</view> <view class="input-t">孩子姓名</view>
<view class="input-bg"> <view class="input-bg">
<input type="text" value="{{params.stuName}}" bindinput="inputName" placeholder="请输入孩子姓名" placeholder-class="placeholder-c"></input> <input type="text" value="{{params.stuName}}" bindinput="inputName" maxlength="10" placeholder="请输入孩子姓名" placeholder-class="placeholder-c"></input>
</view> </view>
</view> </view>
<view class="input-item"> <view class="input-item">
...@@ -64,10 +64,29 @@ ...@@ -64,10 +64,29 @@
</picker> </picker>
</view> </view>
</view> </view>
<!-- <view class="input-item">
<view class="input-t">就读学校</view>
<view class="input-bg">
<input type="text" value="{{params.stuName}}" bindinput="inputName" placeholder="请输入孩子姓名" placeholder-class="placeholder-c"></input>
</view>
</view> -->
</view> </view>
<view class="fixed-btm flex-s"> <view class="fixed-btm flex-s">
<view class="fixed-price">¥{{detail.cost / 100}}</view> <view class="fixed-price" wx:if="{{detail.type == 2}}">¥{{detail.cost / 100}}</view>
<view class="fixed-btn" bindtap="createOrder">立即抢购</view> <view class="fixed-btn {{detail.type == 1?'max-w':''}}" bindtap="createOrder">{{detail.type==2?'立即抢购':'提交报名'}}</view>
</view> </view>
<t-popup show="{{popupShow}}" closeOnClickOverlay="{{false}}" type="center" bindclose="onClose">
<view>
<view class="popup-bg">
<image class="joion-success" src="../../../images/course/joion-success.png" />
<view class="popup-title">报名成功</view>
<view class="popup-desc">请前往校区办理入班手续!</view>
<view class="popup-btn" bindtap="gotoJoinList">我知道了</view>
</view>
<image class="close-icon" bindtap="gotoJoinList" src="../../../images/course/close-icon.png" />
</view>
</t-popup>
</view> </view>
\ No newline at end of file
...@@ -58,14 +58,17 @@ white-space: normal !important; ...@@ -58,14 +58,17 @@ white-space: normal !important;
font-size: 36rpx; font-size: 36rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN; font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold; font-weight: bold;
color: #FF4E4E; color: rgba(0, 0, 0, 0.9);
} }
.price-t{ .price-t{
flex: none; flex: none;
font-size: 48rpx; font-size: 48rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN; font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold; font-weight: bold;
color: #FF4E4E; color: rgba(0, 0, 0, 0.9);
}
.red-c{
color: #FF4E4E !important;
} }
.course-text{ .course-text{
margin-top: 10rpx; margin-top: 10rpx;
...@@ -147,8 +150,13 @@ white-space: normal !important; ...@@ -147,8 +150,13 @@ white-space: normal !important;
color: #FFFFFF; color: #FFFFFF;
padding: 21rpx 132rpx; padding: 21rpx 132rpx;
background: #FF811E; background: #FF811E;
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.08); box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.08);
border-radius: 50rpx; border-radius: 50rpx;
}
.max-w{
width: 100%;
padding: 21rpx 0rpx !important;
text-align: center;
} }
.fixed-price{ .fixed-price{
font-size: 60rpx; font-size: 60rpx;
...@@ -182,4 +190,50 @@ border-radius: 50rpx; ...@@ -182,4 +190,50 @@ border-radius: 50rpx;
.gz-color{ .gz-color{
background: rgba(38, 122,202, 0.12) !important; background: rgba(38, 122,202, 0.12) !important;
color: #267ACA !important; color: #267ACA !important;
}
.popup-bg{
width: 630rpx;
background: #FFFFFF;
border-radius: 24rpx;
padding: 40rpx;
}
.joion-success{
height: 160rpx;
width: 210rpx;
display: block;
margin: 0px auto;
}
.popup-title{
text-align: center;
font-size: 36rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #353535;
}
.popup-desc{
margin-top: 20rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #353535;
text-align: center;
}
.popup-btn{
margin-top: 40rpx;
text-align: center;
padding: 20rpx 0rpx;
margin:40rpx 40rpx 0rpx 40rpx;
width: calc(100% - 80rpx);
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FF811E;
background: rgba(255, 129, 30, 0.12);
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.08);
border-radius: 50rpx;
}
.close-icon{
height: 68rpx;width: 68rpx;display: block;
margin: 40rpx auto 0rpx auto;
} }
\ No newline at end of file
<view class="page-bg">
<!-- 支付订单 -->
支付订单
<view class="" bindtap="payOrder">支付</view>
<view class="" bindtap="callMan">打电话</view>
</view>
\ No newline at end of file
/* subPages/course/pay/pay.wxss */
\ No newline at end of file
/* /*
* @Author: tangjiale * @Author: tangjiale
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-13 08:59:17 * @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-13 19:52:21 * @LastEditTime: 2022-06-16 10:40:51
*/ */
var API = require("../../../utils/request.js"); var API = require("../../../utils/request.js");
Page({ Page({
...@@ -12,14 +12,10 @@ Page({ ...@@ -12,14 +12,10 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
param:{ page:0,
stuName:'超人霍华德', //姓名 list:[],
gender:1, //性别 loading:false,
phone:13975487978, finish:false
schId:2, //所在校区
courserId:17095, //课程id
releationShip:1, //关系
}
}, },
/** /**
...@@ -28,31 +24,48 @@ Page({ ...@@ -28,31 +24,48 @@ Page({
onLoad: function (options) { onLoad: function (options) {
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
}, this.queryCourseList()
callMan(){
wx.makePhoneCall({
phoneNumber: '13975487978' //仅为示例,并非真实的电话号码
}) })
}, },
payOrder(){
let that = this
API.requestAll('/px/order/addTyOrder', that.data.param,function (res) {
onReachBottom:function (){
if(this.data.loading && this.data.finish) return
this.queryCourseList()
},
queryCourseList(){
let that = this
this.data.page ++
this.data.loading = true
API.getData('/px/course/getUserUseCourseList', {
page:that.data.page,
size:10
}, (res) => {
if(res && res.data && res.data.length){
res.data.forEach(item => {
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
})
}
that.data.loading = true
that.data.finish = res.data.length < 10
that.data.list = that.data.list.concat(res.data || [])
that.setData({
page:that.data.page,
finish:that.data.finish,
loading:that.data.loading,
list:that.data.list
})
});
},
gotoDetail(e){
let {id} = e.currentTarget.dataset
wx.navigateTo({
url: '/subPages/course/detail/detail?id=' + id,
}) })
} }
}) })
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "消课记录"
}
\ No newline at end of file
<!-- 体验课订单列表 -->
<view class="page-bg">
<view class="course" wx:for="{{list}}" bindtap="gotoDetail" data-id="{{item.courseId}}">
<view class="flex-s">
<view class="course-time"><text class="blod-c">{{item.type==1?'报名时间':'订购时间'}}</text>:{{item.courseTime}}</view>
<!-- 0:待支付,1:已订购,2:待退款,3:已退款,4:已关闭) -->
<view class="course-state {{['','gree-c','yell-c'][item.type]}}">{{['','正式班课','体验课'][item.type]}}</view>
</view>
<view class="course-ctn flex-c">
<view class="course-img">
<image class="course-img" mode="aspectFill" src="{{item.poster}}" />
</view>
<view class="course-info">
<view class="course-title">{{item.courseName}}</view>
<view class="flex-c">
<view class="tag-item {{item.courseStep==1?'xx-color':item.courseStep==2?'cz-color':'gz-color'}}">{{item.courseStep==1?'小学':item.courseStep==2?'初中':'高中'}}组</view>
<view class="tag-item">{{item.classHour}}课时</view>
<view class="tag-item">{{['','基础班','提高班','精英班','赛事班'][item.leveId]}}</view>
</view>
<view class="course-teachers">授课教练 {{item._empNames}}</view>
</view>
</view>
<view class="btm-line flex-s">
<view class="flex-c">
<text class="t1">已上:</text><text class="course-time">{{item.useClassHour}}课时</text>
<text class="fenge-icon">/</text>
<text class="t1">总课时:</text><text class="course-time">{{item.classHour}}课时</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
.page-bg{
min-height: 100vh;
width: 100%;
background-color: #f5f5f5;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-c{
display: flex;align-items: center;
}
.course{
margin-bottom: 20rpx;
padding: 30rpx;
background-color: #fff;
}
.course-time{
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
}
.course-state{
padding: 4rpx 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
border-radius: 8rpx;
}
.red-c{background: #FF4E4E;color: #fff;}
.gree-c{background: linear-gradient(132deg, #2D89FF 0%, #72B0FF 100%);color: #fff;}
.yell-c{background: linear-gradient(136deg, #FF811E 0%, #F3C100 100%);color: #fff;}
.grey-c{background: rgba(0, 0, 0, 0.08);color: rgba(0, 0, 0, 0.3);}
.course-ctn{
margin-top: 20rpx;
}
.blod-c{font-weight: bold;}
.course-img{
position: relative;
height: 186rpx;
width: 300rpx;
border-radius: 24rpx;
}
.course-info{
height: 186rpx;
margin-left: 20rpx;
width: calc(100% - 320rpx);
}
.course-title{
position: relative;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.tag-item{
margin-top: 12rpx;
margin-right: 10rpx;
padding: 4rpx 10rpx;
background: #F8F8F8;
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.xx-color{
background: rgba(45, 137,255, 0.12) !important;
color: #2D89FF !important;
}
.cz-color{
background: rgba(0, 187,104, 0.12) !important;
color: #00BB68 !important;
}
.gz-color{
background: rgba(38, 122,202, 0.12) !important;
color: #267ACA !important;
}
.course-teachers{
margin-top: 62rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.btm-line{
margin-top: 30rpx;
}
.t1{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.course-time{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
}
.fenge-icon{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
margin-left: 20rpx;
margin-right: 20rpx;
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-06 15:52:31 * @Date: 2022-06-06 15:52:31
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-13 19:32:55 * @LastEditTime: 2022-06-15 18:40:48
*/ */
var API = require("../../../utils/request.js"); var API = require("../../../utils/request.js");
var postData = {}; var postData = {};
...@@ -15,8 +15,6 @@ Page({ ...@@ -15,8 +15,6 @@ Page({
onLoad: function (options) { onLoad: function (options) {
//获取用户的openId //获取用户的openId
this.wxLogin(); this.wxLogin();
//获取用户微信相关的详细信息
// this.wxGetUserInfo()
//用户微信认证,可直接免登陆 //用户微信认证,可直接免登陆
this.auth(); this.auth();
}, },
...@@ -27,6 +25,7 @@ Page({ ...@@ -27,6 +25,7 @@ Page({
}, },
auth(){ auth(){
let that = this
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
}) })
...@@ -45,6 +44,8 @@ Page({ ...@@ -45,6 +44,8 @@ Page({
} }
wx.setStorageSync('token',res.data.token) wx.setStorageSync('token',res.data.token)
wx.setStorageSync('peopleType',res.data.peopleType) wx.setStorageSync('peopleType',res.data.peopleType)
//获取用户微信相关的详细信息
that.wxGetUserInfo()
if(res.data.peopleType == 'parent'){ if(res.data.peopleType == 'parent'){
wx.reLaunch({ wx.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
...@@ -69,9 +70,10 @@ Page({ ...@@ -69,9 +70,10 @@ Page({
}) })
}, },
wxGetUserInfo(){ wxGetUserInfo(){
API.getData('/wx/user/wx7d7fbc0e6746baf5/info', { }, function (res) { API.getData('/px/user/getUserInfo', { }, function (res) {
}, function () { if(res.code == 200){
// wx.hideLoading() wx.setStorageSync('userInfo',res.data)
}
}); });
}, },
agreement() { agreement() {
...@@ -145,6 +147,8 @@ Page({ ...@@ -145,6 +147,8 @@ Page({
wx.setStorageSync('token',res.data.token) wx.setStorageSync('token',res.data.token)
wx.setStorageSync('peopleType',res.data.peopleType) wx.setStorageSync('peopleType',res.data.peopleType)
//获取用户微信相关的详细信息
_this.wxGetUserInfo()
if(res.data.peopleType == 'parent'){ if(res.data.peopleType == 'parent'){
wx.reLaunch({ wx.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
......
...@@ -15,6 +15,8 @@ Page({ ...@@ -15,6 +15,8 @@ Page({
inputActiveB: false, inputActiveB: false,
inputActiveC: false, inputActiveC: false,
btnStyle: false btnStyle: false
//万能验证码 258369
}, },
onLoad: function(options) { onLoad: function(options) {
this.getCaptcha(); this.getCaptcha();
...@@ -110,6 +112,7 @@ Page({ ...@@ -110,6 +112,7 @@ Page({
wx.setStorageSync('peopleType',res.data.peopleType) wx.setStorageSync('peopleType',res.data.peopleType)
//根据用户类型来判断跳转页面 //根据用户类型来判断跳转页面
//employ机构职员 parent家长 visitor游客 Unknown未知 //employ机构职员 parent家长 visitor游客 Unknown未知
_this.wxGetUserInfo()
if(res.data.peopleType == 'Unknown'){ if(res.data.peopleType == 'Unknown'){
}else if(res.data.peopleType == 'parent'){ }else if(res.data.peopleType == 'parent'){
...@@ -138,6 +141,15 @@ Page({ ...@@ -138,6 +141,15 @@ Page({
}); });
}, },
wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
wx.setStorageSync('userInfo',res.data)
}
}, function () {
// wx.hideLoading()
});
},
// 用户名 // 用户名
accountBind: function(e) { accountBind: function(e) {
// console.log(e.detail.value) // console.log(e.detail.value)
......
var API = require("../../../utils/request.js"); /*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-14 08:36:57
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-15 19:02:26
*/
var API = require("../../../utils/request.js");
var tool = require("../../../utils/util.js")
Page({ Page({
data:{
data: {
editIndex:0,
delBtnWidth:150,//删除按钮宽度单位(rpx)
roleList:[], roleList:[],
parentList:[],
teacharList:[],
schMembersList:[],
visitorsList:[],
img: 'http://yhoaimage.daydayup.com.cn/upload/images/8d1bf0ccec5e4f86be5a3d73f0b6e64b.jpg',
startX: 0, //开始坐标
startY: 0,
type:'',//当前的身份
organManager:[],//教育局
schoolManager:[],//学校管理员
},
//手指触摸动作开始 记录起点X坐标
touchstart: function (e) {
//开始触摸时 重置所有删除
this.data.parentList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.teacharList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.schMembersList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.visitorsList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.setData({
teacharList:this.data.teacharList,
schMembersList:this.data.schMembersList,
visitorsList:this.data.visitorsList,
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
})
},
//滑动事件处理 //1 root 超级管理员 2 marketer 运营人员 3 admin 机构管理员 4 employ 机构职员 5 parent 家长 6 child 小孩 7 visitor 游客
touchmove: function (e) { roleOption:{
var that = this, 4:{
index = e.currentTarget.dataset.index,//当前索引 name:'机构职员',color:'#626174',
startX = that.data.startX,//开始X坐标 },
startY = that.data.startY,//开始Y坐标 5:{
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标 name:'孩子',color:'#29CC84',
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标 },
//获取滑动角度 7:{
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY }); name:'游客',color:'#EECA3A',
that.data.parentList.forEach(function (v, i) {
v.isTouchMove = false
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (i == index) {
if (touchMoveX > startX){
//右滑
v.isTouchMove = false;
}
else{
//左滑
v.isTouchMove = true;
}
} }
}) }
//更新数据
that.setData({
parentList: that.data.parentList
})
},
//手指触摸动作开始 记录起点X坐标
touchstart2: function (e) {
//开始触摸时 重置所有删除
this.data.parentList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.teacharList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.schMembersList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.visitorsList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.setData({
parentList:this.data.parentList,
schMembersList:this.data.schMembersList,
visitorsList:this.data.visitorsList,
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
})
},
//滑动事件处理
touchmove2: function (e) {
var that = this,
index = e.currentTarget.dataset.index,//当前索引
startX = that.data.startX,//开始X坐标
startY = that.data.startY,//开始Y坐标
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标
//获取滑动角度
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY });
that.data.teacharList.forEach(function (v, i) {
v.isTouchMove = false
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (i == index) {
if (touchMoveX > startX){
//右滑
v.isTouchMove = false;
}
else{
//左滑
v.isTouchMove = true;
}
}
})
//更新数据
that.setData({
teacharList: that.data.teacharList
})
},
//手指触摸动作开始 记录起点X坐标
touchstart3: function (e) {
//开始触摸时 重置所有删除
this.data.parentList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.teacharList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.schMembersList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.visitorsList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.setData({
parentList:this.data.parentList,
teacharList:this.data.teacharList,
visitorsList:this.data.visitorsList,
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
})
},
//滑动事件处理
touchmove3: function (e) {
var that = this,
index = e.currentTarget.dataset.index,//当前索引
startX = that.data.startX,//开始X坐标
startY = that.data.startY,//开始Y坐标
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标
//获取滑动角度
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY });
that.data.schMembersList.forEach(function (v, i) {
v.isTouchMove = false
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (i == index) {
if (touchMoveX > startX){
//右滑
v.isTouchMove = false;
}
else{
//左滑
v.isTouchMove = true;
}
}
})
//更新数据
that.setData({
schMembersList: that.data.schMembersList
})
},
//手指触摸动作开始 记录起点X坐标
touchstart4: function (e) {
//开始触摸时 重置所有删除
this.data.parentList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.teacharList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.schMembersList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.data.visitorsList.forEach(function (v, i) {
if (v.isTouchMove)//只操作为true的
v.isTouchMove = false;
})
this.setData({
parentList:this.data.parentList,
teacharList:this.data.teacharList,
schMembersList:this.data.schMembersList,
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
})
},
//滑动事件处理
touchmove4: function (e) {
var that = this,
index = e.currentTarget.dataset.index,//当前索引
startX = that.data.startX,//开始X坐标
startY = that.data.startY,//开始Y坐标
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标
//获取滑动角度
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY });
that.data.visitorsList.forEach(function (v, i) {
v.isTouchMove = false
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (i == index) {
if (touchMoveX > startX){
//右滑
v.isTouchMove = false;
}
else{
//左滑
v.isTouchMove = true;
}
}
})
//更新数据
that.setData({
visitorsList: that.data.visitorsList
})
},
/**
* 计算滑动角度
* @param {Object} start 起点坐标
* @param {Object} end 终点坐标
*/
angle: function (start, end) {
var dX = end.X - start.X,
dY = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return 360 * Math.atan(dY / dX) / (2 * Math.PI);
}, },
onLoad(){ onLoad(){
}, },
onShow(){
onShow: function (options) { this.getRoleList()
this.getRoleList();
//console.log('当前的身份信息',global.peopleType.type);
this.setData({
// type:global.peopleType.type
type:''
})
}, },
getRoleList() {
var _this = this;
API.getData('/user/list', {}, function (res) {
console.log(res);
_this.setData({
parentList: res.data.parents.concat(res.data.students),
teacharList:res.data.teachers,
schMembersList:res.data.schMembers,
visitorsList:res.data.visitors,
organManager:res.data.organManager,
schoolManager:res.data.schoolManager
})
}, function () {
wx.hideLoading()
});
},
//切换身份
changeRole(e){ changeRole(e){
console.log(e); let {data} = e.currentTarget.dataset
//global.peopleType.type = e.currentTarget.dataset.item.peopleType; if(data.isCurrent) return
//console.log(global.peopleType.type);
var data = { this.checkStu(data)
peopleId: e.currentTarget.dataset.item.peopleId,
peopleType: e.currentTarget.dataset.item.peopleType,
}
console.log('切换身份上传的数据',data);
if(!data.peopleId){
wx.showLoading({
icon:'none',
title: '切换身份失败',
})
return false;
}
API.getData('/user/switchuser', data, function (res) {
console.log('==================',res);
if(res.code == 200){
wx.reLaunch({
url: '/pages/index/index'
})
}else{
wx.showToast({
icon:"none",
title: res.message,
})
}
}, function () {
wx.hideLoading()
});
},
//重新登录
auth(){
var _this = this;
wx.login({
success: res => {
API.getData('/wx/user/wxd56eb1b3b99e5cf0/auth', {
code: res.code
}, function(res) {
console.log('/wx/user/auth', res);
wx.setStorageSync('openId', res.data.openId);
if (res.data.jump == 100) {
} else if (res.data.jump == 204) {
} else if (res.data.jump == 205) {
wx.setStorageSync('token', res.data.token);
wx.reLaunch({
url:'../../../packageB/login/selectIden/selectIden'
});
} else if (res.data.jump == 300) {
wx.setStorageSync('token', res.data.token);
wx.reLaunch({
url: '/pages/index/index'
})
} else if (res.data.jump == 400) {
wx.setStorageSync('token', res.data.token);
wx.reLaunch({
url: '/pages/index/index'
})
}
}, function(res) {
console.log('/wx/user/auth', res);
});
},
fail: res => {
console.log('wx.login 错误');
}
})
}, },
//删除身份 checkStu:tool.throttle(function(data){
delRole(e){
var that = this; var that = this;
console.log(e.currentTarget.dataset.item);
var data = { var data = {
peopleId: e.currentTarget.dataset.item.peopleId, peopleId: data[0].peopleId,
peopleType: e.currentTarget.dataset.item.peopleType, roleId: data[0].roleId,
} }
wx.showModal({ if (!data.peopleId) {
title: '',
content: '你确定要解除绑定吗?',
success(res) {
if (res.confirm) {
wx.showLoading({ wx.showLoading({
title: '删除中...', icon: 'none',
title: '切换身份失败',
}) })
return false;
console.log(e.currentTarget.dataset.item.isCur); }
if(e.currentTarget.dataset.item.isCur == false){ API.getData('/px/user/switchRole', data, function (res) {
console.log('不是当前身份'); if (res.code == 200) {
console.log('当前上传的参数:',data); that.onShow();
API.getData('/user/unbind', data, function (res) { that.wxGetUserInfo()
//that.onShow();
if(res.code == 200){
console.log('==================',res);
setTimeout(function(){
wx.hideLoading()
that.auth();
},2000)
}
}, function (res) {
wx.showToast({ wx.showToast({
  title: res.message, title: '切换成功',
  icon: 'none', icon: 'none'
  duration: 1500 })
} else {
wx.showToast({
icon: "none",
title: res.message,
}) })
});
}else if(e.currentTarget.dataset.item.peopleType == 'Parent' || e.currentTarget.dataset.item.peopleType == 'Student'){
API.getData('/user/unbind', data, function (res) {
if(res.code == 200){
console.log('=================11111111=',res);
setTimeout(function(){
wx.hideLoading()
that.auth();
},2000)
}
}, function (res) {
console.log(res);
wx.hideLoading()
});
}else{
console.log('当前身份');
console.log(data);
API.getData('/user/unbind', data, function (res) {
if(res.code == 200){
console.log('==================',res);
setTimeout(function(){
wx.hideLoading()
that.auth();
},2000)
}
}, function (res) {
console.log(res);
wx.hideLoading()
});
} }
} else if (res.cancel) { }, function () {
console.log('用户点击取消') wx.hideLoading()
} });
},2000),
wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
wx.setStorageSync('peopleType',res.data.peopleType)
wx.setStorageSync('userInfo',res.data)
} }
}) }, function () {
// wx.hideLoading()
});
}, },
getRoleList(){
let that = this
//1 root 超级管理员 2 marketer 运营人员 3 admin 机构管理员 4 employ 机构职员 5 parent 家长 6 child 小孩 7 visitor 游客
API.getData('/px/user/getUserPeopleList', {}, function(res) {
let list = []
res && res.data && res.data.length && res.data.forEach(item => {
let index = list.findIndex(v => v.roleId == item.roleId)
if(index == -1){
list.push({
roleId:item.roleId,
list:[item]
})
}else{
list[index].list.push(item)
}
})
that.setData({roleList:list})
})
}
}) })
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {
"xb-icon":"/components/t-icon/t-icon"
},
"navigationBarTitleText": "身份列表" "navigationBarTitleText": "身份列表"
} }
\ No newline at end of file
<view>
<view class="main">
<view class="title">我的身份</view>
<view class="roleList" wx:if="{{organManager.length > 0}}"> <!-- roleList -->
<view class="li touch-item {{item.isTouchMove ? 'touch-move-active' : ''}}" hover-class="after-click-content" data-item="{{item}}" data-key="{{index}}" data-peopleType="{{item.peopleType}}" wx:for="{{organManager}}" bindtap="changeRole">
<image class="photo" src="{{item.imgSrc}}"></image>
<view class="content">
<view class="name">
{{item.name}}
<text class="student">教育局</text>
<text class="parent" wx:if="{{item.peopleType == 'Parent'}}">家长</text>
</view>
<view class="class">{{item.schName}}教育局</view>
</view>
<view wx:if="{{item.isCur == true}}">
<image class="user" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/login/sel-sf.png"></image>
</view>
<view wx:else></view>
</view>
</view>
<view class="roleList" wx:if="{{schoolManager.length > 0}}">
<view class="li touch-item {{item.isTouchMove ? 'touch-move-active' : ''}}" hover-class="after-click-content" data-item="{{item}}" data-key="{{index}}" data-peopleType="{{item.peopleType}}" wx:for="{{schoolManager}}" bindtap="changeRole">
<image class="photo" src="{{item.imgSrc}}"></image>
<view class="content">
<view class="name">
{{item.name}}
<text class="student">学校管理员</text>
</view>
<view class="class">{{item.schName}}管理员</view>
</view>
<view wx:if="{{item.isCur == true}}">
<image class="user" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/login/sel-sf.png"></image>
</view>
<view wx:else></view>
</view>
</view>
<view class="roleList" wx:if="{{parentList.length > 0}}"> <view class="page-bg">
<view class="li touch-item {{item.isTouchMove ? 'touch-move-active' : ''}}" hover-class="after-click-content" wx:for="{{parentList}}" data-item="{{item}}" data-key="{{index}}" data-peopleType="{{item.peopleType}}" bindtap="changeRole" bindtouchstart="touchstart" bindtouchmove="touchmove" data-index="{{index}}"> <view class="title">我的身份</view>
<image class="photo" src="{{item.imgSrc}}"></image>
<view class="content">
<view class="name">
{{item.name}}
<text class="parent" wx:if="{{item.peopleType == 'Parent'}}">家长</text>
<text class="student" wx:if="{{item.peopleType == 'Student'}}">孩子</text>
</view>
<view class="class" wx:if="{{item.peopleType == 'Student'}}">{{item.schName}} {{item.className}}</view>
</view>
<view wx:if="{{item.isCur == true}}">
<image class="user" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/login/sel-sf.png"></image>
</view>
<view wx:else></view>
<view class="del" data-index="{{index}}" data-item="{{item}}" catchtap="delRole">删除</view>
</view>
</view>
<view class="roleList" wx:if="{{teacharList.length > 0}}"> <view class="type-item" wx:for="{{roleList}}">
<view class="li touch-item {{item.isTouchMove ? 'touch-move-active' : ''}}" hover-class="after-click-content" wx:for="{{teacharList}}" data-item="{{item}}" data-key="{{index}}" data-peopleType="{{item.peopleType}}" bindtap="changeRole" bindtouchstart="touchstart2" bindtouchmove="touchmove2" data-index="{{index}}"> <view class="user-card flex-c" wx:for="{{item.list}}" wx:for-item="data" wx:for-index="idx">
<image class="photo" src="{{item.imgSrc}}"></image> <image class="header" wx:if="{{data.gender == 1}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png"></image>
<view class="content"> <image class="header" wx:elif="{{data.gender == 2}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/girl_default.png"></image>
<view class="name">{{item.name}} <text class="teacher">教师</text></view> <image class="header" wx:else src="https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132"></image>
<view class="class">{{item.schName}}</view>
</view>
<view wx:if="{{item.isCur == true}}">
<image class="user" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/login/sel-sf.png"></image>
</view>
<view wx:else></view>
<view class="del" data-index="{{index}}" data-item="{{item}}" catchtap="delRole">删除</view>
</view>
</view>
<view class="roleList" wx:if="{{schMembersList.length > 0}}"> <view class="user-info" data-data="{{data}}" bindtap="changeRole">
<view class="li touch-item {{item.isTouchMove ? 'touch-move-active' : ''}}" hover-class="after-click-content" wx:for="{{schMembersList}}" data-item="{{item}}" data-key="{{index}}" data-peopleType="{{item.peopleType}}" bindtap="changeRole" bindtouchstart="touchstart3" bindtouchmove="touchmove3" data-index="{{index}}"> <view class="flex-c">
<image class="photo" src="{{item.imgSrc}}"></image> <view class="user-name">{{data.name}}</view>
<view class="content"> <view class="user-tag" wx:if="{{roleOption[data.roleId]}}"
<view class="name">{{item.name}} <text class="org">机构</text></view> style="background:{{roleOption[data.roleId].color}}">{{roleOption[data.roleId].name || ''}}</view>
<view class="class">{{item.schName || ''}}</view>
</view>
<view wx:if="{{item.isCur == true}}">
<image class="user" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/login/sel-sf.png"></image>
</view>
<view wx:else></view>
<view class="del" data-index="{{index}}" data-item="{{item}}" catchtap="delRole">删除</view>
</view> </view>
</view>
<view class="roleList" wx:if="{{visitorsList.length > 0}}"> <xb-icon class="radio-icon" wx:if="{{data.isCurrent}}" type="icon-icon_radio-group" size="40" color="#ff9b4d"></xb-icon>
<view class="li touch-item {{item.isTouchMove ? 'touch-move-active' : ''}}" hover-class="after-click-content" wx:for="{{visitorsList}}" data-item="{{item}}" data-key="{{index}}" data-peopleType="{{item.peopleType}}" bindtap="changeRole" bindtouchstart="touchstart4" bindtouchmove="touchmove4" data-index="{{index}}">
<image class="photo" src="{{item.imgSrc}}"></image>
<view class="content">
<view class="name">{{item.name}} <text class="personal">游客</text></view>
<view class="class" wx:if="{{item.peopleType != 'Visitor'}}">{{item.schName || ''}}</view>
</view>
<view wx:if="{{item.isCur == true}}">
<image class="user" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/login/sel-sf.png"></image>
</view>
<view wx:else></view>
<view class="del" data-index="{{index}}" data-item="{{item}}" catchtap="delRole">解除</view>
</view>
</view> </view>
</view>
<!-- <view class="addRole" bindtap="navigateTo"> </view>
<view class="addRoleContent"> </view>
<image src="../../../images/login/add.png"></image> \ No newline at end of file
<view class="text">添加身份</view>
</view>
</view> -->
</view>
</view>
\ No newline at end of file
/* .change-role{position: fixed;width: 100%;bottom: 0;top: 0;background: #f6f6f6;} .page-bg{
*/ min-height: 100vh;
.change-role{background: #f6f6f6;} padding: 0rpx 30rpx;
.cell-wrap{z-index: 200;position: relative;padding-left:30rpx;background:#fff;} width: calc(100% - 60rpx);
.cell-wrap :last-child{border-bottom: none !important} background-color: #f5f5f5;
.cell-wrap .noBorder{border-bottom: none !important}
.cell-wrap .li{height: 130rpx;border-bottom: 1rpx solid #e1e1e1;background:#fff;}
.cell-wrap .li .avatar-img{width: 90rpx;height: 90rpx;border-radius: 50%;float: left;margin:20rpx 30rpx 0 0 ;}
.cell-wrap .li .info{float: left;margin-top: 20rpx;}
.cell-wrap .li .name{font-size: 30rpx;}
.cell-wrap .li .info{font-size: 24rpx;color: #999;}
.cell-wrap .li .school{width: 300rpx;display: inline-block;overflow: hidden;height: 30rpx;}
.cell-wrap .line{
height: 70rpx !important;background: #f6f6f6 !important;margin-left: -30rpx;border-bottom: none !important;
line-height: 70rpx;font-size: 30rpx;font-weight: bold;color: #53608b;padding-left: 30rpx;
} }
.change-role .btn{
height: 100rpx;line-height: 100rpx;text-align: center;font-size: 34rpx;background: #fff;color: 000;margin-top: 20rpx;
}
page{
background: #F5F5F5;
}
.main{
width: 94%;
margin: 0 auto;
}
.title{ .title{
width: 100%; padding: 30rpx 0rpx;
color: #888888;
font-size: 28rpx; font-size: 28rpx;
margin-top: 30rpx; color: #888888;
margin-bottom: 30rpx;
} }
.type-item{
.roleList{
background: #FFFFFF;
border-radius:20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
border-radius: 20rpx;
background-color: #fff;
}
.type-item .user-card:last-child{
border: none !important;
}
.flex-c{
display: flex;
align-items: center;
} }
.user-card{
.roleList .li{
position: relative; position: relative;
width: 95%; margin-left: 40rpx;
height: 120rpx; width: calc(100% - 40rpx);
margin-left: 5%; padding: 24rpx 0rpx;
border-bottom: 2rpx solid #EEEEEE; border-bottom: 1rpx solid #EEEEEE;
} }
.radio-icon{
.roleList .li:last-child{ position: absolute;
border-bottom: 0rpx; right: 40rpx;
top: 15rpx;
} }
.header{
.roleList .li .photo{ height: 72rpx;width: 72rpx;
width: 72rpx;
height: 72rpx;
border-radius: 50%; border-radius: 50%;
float: left;
margin-top: 24rpx;
} }
.user-info{
.roleList .li .content{ position: relative;
float: left; height: 72rpx;
margin-left: 20rpx; width: calc(100% - 102rpx);
margin-left: 30rpx;
} }
.user-name{
.content .name{
overflow: hidden; overflow: hidden;
color: #353535; color: #353535;
font-size: 28rpx; font-size: 28rpx;
font-weight:bold; font-weight: bold;
margin-top: 26rpx;
}
.content .class{
color: #B2B2B2;
font-size: 22rpx;
}
.roleList .li .user{
position: absolute;
right: 40rpx;
top: 40rpx;
width: 42rpx;
height: 42rpx;
}
.parent{
font-size: 20rpx;
background: #EECA3A;
color: #FFFFFF;
border-radius: 8rpx;
margin-left: 20rpx;
margin-top: 8rpx;
padding-bottom: 6rpx;
height: 32rpx;
line-height: 32rpx;
padding: 0rpx 10rpx;
}
.teacher{
font-size: 20rpx;
background: #69C3FF;
color: #FFFFFF;
border-radius: 8rpx;
margin-left: 20rpx;
margin-top: 8rpx;
padding-bottom: 6rpx;
height: 32rpx;
line-height: 32rpx;
padding: 0rpx 10rpx;
} }
.user-tag{
.org{
font-size: 20rpx;
background: #626174;
color: #FFFFFF;
border-radius: 8rpx;
margin-left: 20rpx;
margin-top: 8rpx;
padding-bottom: 6rpx;
height: 32rpx; height: 32rpx;
line-height: 32rpx;
padding: 0rpx 10rpx; padding: 0rpx 10rpx;
}
.personal{
font-size: 20rpx; font-size: 20rpx;
background: #DDCE07;
color: #FFFFFF;
border-radius: 8rpx;
margin-left: 20rpx;
margin-top: 8rpx;
padding-bottom: 6rpx;
height: 32rpx;
line-height: 32rpx; line-height: 32rpx;
padding: 0rpx 10rpx;
}
.addRole{
overflow: hidden;
width: 100%;
height: 100rpx;
margin: 0 auto;
margin-top: 20rpx;
background: #FFFFFF;
border-radius:20rpx;
margin-bottom: 40rpx;
}
.addRoleContent{
width: 200rpx;
height: 48rpx;
margin: 0 auto;
margin-top: 26rpx;
}
.addRoleContent image{
width: 42rpx;
height: 42rpx;
float: left;
margin-top: 6rpx;
}
.addRoleContent .text{
color: #FF9B4D;
font-size: 36rpx;
font-weight:bold;
margin-left: 12rpx;
float: left;
}
.container{
width:100%;
overflow: hidden;
box-sizing: border-box;
padding-bottom:10rpx;
}
.touch-item {
display: flex;
/* //均匀排布每个元素 */
justify-content: space-between;
overflow: hidden;
}
.content {
float: left;
line-height: 22px;
margin-right:0;
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transform: translateX(90rpx);
transform: translateX(90rpx);
position: absolute;
left: 0;
}
.del {
background-color: #FF4E4E;
width: 90px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
-webkit-transform: translateX(90px);
transform: translateX(90px);
-webkit-transition: all 0.4s;
transition: all 0.4s;
}
/* .touch-move-active .content, */
.touch-move-active .del {
-webkit-transform: translateX(0);
transform: translateX(0);
}
/* .touch-move-active .content{
background: rgba(180, 218, 12, 0.3);
} */
.student{
font-size: 20rpx;
background: #29CC84;
color: #FFFFFF;
border-radius: 8rpx; border-radius: 8rpx;
margin-left: 20rpx; margin-left: 20rpx;
margin-top: 8rpx; color: #fff;
padding-bottom: 6rpx;
height: 32rpx;
line-height: 32rpx;
padding: 0rpx 10rpx;
} }
\ No newline at end of file
...@@ -12,8 +12,8 @@ function requestAll(url, postData, doSuccess, doFail) { ...@@ -12,8 +12,8 @@ function requestAll(url, postData, doSuccess, doFail) {
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
token:'be3531e49c70444189d7511c7bb9602d', // token:'be3531e49c70444189d7511c7bb9602d',
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
version: wx.getStorageSync('version'), version: wx.getStorageSync('version'),
pvmodel:wx.getStorageSync('model'), pvmodel:wx.getStorageSync('model'),
pvversion: wx.getStorageSync('pvversion'), pvversion: wx.getStorageSync('pvversion'),
...@@ -27,7 +27,7 @@ function requestAll(url, postData, doSuccess, doFail) { ...@@ -27,7 +27,7 @@ function requestAll(url, postData, doSuccess, doFail) {
doSuccess(res.data); doSuccess(res.data);
}else if(res.data.code == 401){ }else if(res.data.code == 401){
wx.reLaunch({ wx.reLaunch({
url:'/packageB/login/index/index' url:'/subPages/login/login/index'
}) })
}else{ }else{
doSuccess(res.data); doSuccess(res.data);
...@@ -49,8 +49,8 @@ function request(url, postData, doSuccess,doFail) { ...@@ -49,8 +49,8 @@ function request(url, postData, doSuccess,doFail) {
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
token:'be3531e49c70444189d7511c7bb9602d', // token:'be3531e49c70444189d7511c7bb9602d',
// version: wx.getStorageSync('version'), // version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'), // pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'), // pvversion: wx.getStorageSync('pvversion'),
...@@ -63,7 +63,7 @@ function request(url, postData, doSuccess,doFail) { ...@@ -63,7 +63,7 @@ function request(url, postData, doSuccess,doFail) {
doSuccess(res.data); doSuccess(res.data);
} else if (res.data.code == 401) { } else if (res.data.code == 401) {
wx.reLaunch({ wx.reLaunch({
url:'/packageB/login/index/index' url:'/subPages/login/login/index'
}); });
}else { }else {
doSuccess(res.data); doSuccess(res.data);
...@@ -81,8 +81,8 @@ function getData(url, data, doSuccess, doFail) { ...@@ -81,8 +81,8 @@ function getData(url, data, doSuccess, doFail) {
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
token:'be3531e49c70444189d7511c7bb9602d', // token:'be3531e49c70444189d7511c7bb9602d',
// version: wx.getStorageSync('version'), // version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'), // pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'), // pvversion: wx.getStorageSync('pvversion'),
...@@ -95,7 +95,7 @@ function getData(url, data, doSuccess, doFail) { ...@@ -95,7 +95,7 @@ function getData(url, data, doSuccess, doFail) {
doSuccess(res.data); doSuccess(res.data);
} else if (res.data.code == 401){ } else if (res.data.code == 401){
wx.reLaunch({ wx.reLaunch({
url:'/packageB/login/index/index' url:'/subPages/login/login/index'
}); });
}else { }else {
doSuccess(res.data); doSuccess(res.data);
...@@ -112,8 +112,8 @@ function getDataAll(url, data, doSuccess, doFail) { ...@@ -112,8 +112,8 @@ function getDataAll(url, data, doSuccess, doFail) {
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
token:'be3531e49c70444189d7511c7bb9602d', // token:'be3531e49c70444189d7511c7bb9602d',
// version: wx.getStorageSync('version'), // version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'), // pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'), // pvversion: wx.getStorageSync('pvversion'),
...@@ -126,7 +126,7 @@ function getDataAll(url, data, doSuccess, doFail) { ...@@ -126,7 +126,7 @@ function getDataAll(url, data, doSuccess, doFail) {
doSuccess(res.data); doSuccess(res.data);
}else if(res.data.code == 401){ }else if(res.data.code == 401){
wx.reLaunch({ wx.reLaunch({
url:'/packageB/login/index/index' url:'/subPages/login/login/index'
}) })
}else{ }else{
doSuccess(res.data); doSuccess(res.data);
...@@ -142,8 +142,8 @@ function del(url, data, doSuccess, doFail) { ...@@ -142,8 +142,8 @@ function del(url, data, doSuccess, doFail) {
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
token:'be3531e49c70444189d7511c7bb9602d', // token:'be3531e49c70444189d7511c7bb9602d',
// version: wx.getStorageSync('version'), // version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'), // pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'), // pvversion: wx.getStorageSync('pvversion'),
...@@ -165,8 +165,8 @@ function put(url, data, doSuccess, doFail) { ...@@ -165,8 +165,8 @@ function put(url, data, doSuccess, doFail) {
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
token:'be3531e49c70444189d7511c7bb9602d', // token:'be3531e49c70444189d7511c7bb9602d',
// version: wx.getStorageSync('version'), // version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'), // pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'), // pvversion: wx.getStorageSync('pvversion'),
......
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