李双庆 10 months ago
parent
commit
a3841652ca
  1. 36
      api/apiRoute.js
  2. 2
      pages.json
  3. 563
      pages/common/contract_list.vue
  4. 27
      pages/market/clue/clue_info.vue
  5. 502
      pages/market/clue/order_list.vue
  6. 17
      pages/student/my/my.vue

36
api/apiRoute.js

@ -66,6 +66,20 @@ export default {
return res; return res;
}) })
}, },
//公共端-获取全部课程列表
common_getCourseAll(data = {}) {
let url = '/common/getCourseAll'
return http.get(url, data).then(res => {
return res;
})
},
//公共端-获取全部班级列表
common_getClassAll(data = {}) {
let url = '/common/getClassAll'
return http.get(url, data).then(res => {
return res;
})
},
//公共端-教师/销售端验证旧密码是否正确 //公共端-教师/销售端验证旧密码是否正确
common_personnelCheckOldPwd(data = {}) { common_personnelCheckOldPwd(data = {}) {
let url = '/personnel/checkOldPwd' let url = '/personnel/checkOldPwd'
@ -643,6 +657,28 @@ export default {
}) })
}, },
//学生端-订单管理-列表
xy_orderTableList(data = {}) {
let url = '/xy/orderTable'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-订单管理-详情
xy_orderTableInfo(data = {}) {
let url = '/xy/orderTable/info'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-订单管理-添加
xy_orderTableAdd(data = {}) {
let url = '/xy/orderTable/add'
return http.post(url, data).then(res => {
return res;
})
},

2
pages.json

@ -207,7 +207,7 @@
{ {
"path" : "pages/common/contract_list", "path" : "pages/common/contract_list",
"style": { "style": {
"navigationBarTitleText": "合同列表", "navigationBarTitleText": "订单列表",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#292929", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"

563
pages/common/contract_list.vue

@ -1,4 +1,4 @@
<!--合同列表-列表--> <!--订单列表-列表-->
<template> <template>
<view class="main_box"> <view class="main_box">
@ -8,7 +8,7 @@
scroll-y="true" scroll-y="true"
:lower-threshold="lowerThreshold" :lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData" @scrolltolower="loadMoreData"
style="height: 90vh;" style="height: 83vh;"
> >
<view <view
class="item" class="item"
@ -16,33 +16,210 @@
:key="k" :key="k"
> >
<view class="top"> <view class="top">
<view class="">企业合同</view> <view class="title">订单状态{{v.order_status == 'pending' ? '待支付':'已支付' }}</view>
<view class="btn" @click="downloadFile($util.img(v.file_data))">下载合同 <fui-icon name="arrowright" color="#A4ADB3" size="35"></fui-icon></view> <!-- <view class="btn" @click="downloadFile($util.img(v.file_data))">下载合同 <fui-icon name="arrowright" color="#A4ADB3" size="35"></fui-icon></view>-->
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="box"> <view class="box">
<view class="title">合同名称</view> <view class="title">客户姓名</view>
<view class="content">{{v.title}}</view> <view class="content">{{ v.resource_id_name || ''}}</view>
</view> </view>
<view class="box">
<view class="title">付款类型</view>
<view class="content">
{{ v.payment_type === 'cash' ? '现金支付' : v.payment_type === 'scan_code' ? '扫码支付' : '订阅支付' }}
</view>
</view>
<view class="box"> <view class="box">
<view class="title">签署方</view> <view class="title">订单金额</view>
<view class="content">{{v.signatory_a}}</view> <view class="content">{{ v.order_amount || ''}}</view>
</view> </view>
<view class="box"> <view class="box">
<view class="title">签署方</view> <view class="title">课程</view>
<view class="content">{{v.signatory_b}}</view> <view class="content">{{ v.course_id_name || ''}}</view>
</view> </view>
<view class="box">
<view class="title">班级</view>
<view class="content">{{ v.class_id_name }}</view>
</view>
<view class="box">
<view class="title">人员</view>
<view class="content">{{ v.staff_id_name || ''}}</view>
</view>
<view class="box">
<view class="title">支付时间</view>
<view class="content">{{ v.payment_time || '' }}</view>
</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<!-- <view class="btn_section">-->
<!-- <view class="btn" style="background-color:#29d3b4;" @click="openOrderShow()">创建订单</view>-->
<!-- </view>-->
</view>
<!--创建订单弹出层-->
<fui-modal class="order_modal" :buttons="[]" width="600" :show="order_show">
<text class="fui-title">创建订单</text>
<text class="fui-descr"></text>
<fui-form class="form-section" ref="form" top="0" :model="formData" :show="false">
<view class="input-style">
<!--客户名称-->
<fui-form-item
label="客户名称"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<fui-input
:disabled="true"
:borderBottom="false"
:padding="[0]"
placeholder="请输入客户名称"
v-model="formData.resource_id_name"
backgroundColor="#fff"
size="26"
color="#000"
></fui-input>
</view>
</fui-form-item>
<!--付款类型-->
<fui-form-item
label="选择付款类型"
asterisk
asteriskPosition="right"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<view
class="input-title"
style="margin-right:14rpx;"
@click="openPaymentType()">
{{ (formData.payment_type) ? formData.payment_type_name : '点击选择' }}
</view> </view>
</view> </view>
<fui-picker
:linkage='true'
:options="payment_type_options"
:layer="1"
:show="payment_type_show"
@change="changePaymentType"
@cancel="cancelPaymentType">
</fui-picker>
</fui-form-item>
<!--课程-->
<fui-form-item
label="选择课程"
asterisk
asteriskPosition="right"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<view
class="input-title"
style="margin-right:14rpx;"
@click="openCourseId()">
{{ (formData.course_id) ? formData.course_id_name : '点击选择' }}
</view>
</view>
<fui-picker
:linkage='true'
:options="course_id_options"
:layer="1"
:show="course_id_show"
@change="changeCourseId"
@cancel="cancelCourseId">
</fui-picker>
</fui-form-item>
<!--班级-->
<fui-form-item
label="选择班级"
asterisk
asteriskPosition="right"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<view
class="input-title"
style="margin-right:14rpx;"
@click="openClassId()">
{{ (formData.class_id) ? formData.class_id_name : '点击选择' }}
</view>
</view>
<fui-picker
:linkage='true'
:options="class_id_options"
:layer="1"
:show="class_id_show"
@change="changeClassId"
@cancel="cancelClassId">
</fui-picker>
</fui-form-item>
<!--订单金额-->
<fui-form-item
label="订单金额"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<fui-input
:disabled="true"
:borderBottom="false"
:padding="[0]"
placeholder="订单金额"
v-model="formData.money"
backgroundColor="#fff"
size="26"
color="#000"
></fui-input>
</view>
</fui-form-item>
</view>
<view class="button_box">
<fui-button background="#fff" color="#414141" borderColor="#465CFF" btnSize="small" @click="closeOrderShow">取消</fui-button>
<fui-button background="#fff" color="#465CFF" borderColor="#465CFF" btnSize="small" @click="clickOrder({index:1})">确定</fui-button>
</view>
</fui-form>
<view class="fui-icon__close" @tap="closeOrderShow">
<fui-icon name="close" color="#B2B2B2" :size="48"></fui-icon>
</view>
</fui-modal>
</view>
</template> </template>
<script> <script>
import marketApi from '@/api/market.js'; import apiRoute from '@/api/apiRoute.js';
import commonApi from '@/api/common.js';
export default { export default {
components: { components: {
@ -58,11 +235,71 @@ export default {
page:1,// page:1,//
limit:10,// limit:10,//
total:10,// total:10,//
resource_id:'',//id
}, },
tableList:[],// tableList:[],//
//
formData:{
payment_type:'',//
payment_type_name:'',//
course_id:'',//ID
course_id_name:'',//ID
class_id:'',//ID
class_id_name:'',//ID
staff_id:'',//ID
staff_id_name:'',//ID
resource_id:'',//ID
resource_id_name:'',//ID
money:'',//|
},
order_show:false,//|true=,false=
//-
payment_type_options:[
// {
// text:'',
// value:'1'
// },
],//
payment_type_show:false,//
//-
course_id_options:[
// {
// text:'',
// value:'1',
// price:'1'//
// },
],//
course_id_show:false,//
//-
class_id_options:[
// {
// text:'',
// value:'1'
// },
],//
class_id_show:false,//
} }
}, },
onLoad(options) {}, onLoad(options) {
this.filteredData.resource_id = options.resource_id//id
this.formData.resource_id = options.resource_id//id
this.formData.resource_id_name = options.resource_name//id
this.formData.staff_id = options.staff_id//id
this.formData.staff_id_name = options.staff_id_name//id
},
onShow(){ onShow(){
this.init() this.init()
}, },
@ -75,8 +312,17 @@ export default {
methods: { methods: {
// //
async init(){ async init(){
//
await this.getPaymentTypeList()
//
await this.getCourseList()
//
await this.getClassList()
//
await this.getList(); await this.getList();
}, },
//() //()
loadMoreData() { loadMoreData() {
// //
@ -98,7 +344,7 @@ export default {
async getList(){ async getList(){
this.loading = true this.loading = true
let data = {...this.filteredData} let params = {...this.filteredData}
// //
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) { if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) {
@ -110,11 +356,11 @@ export default {
return return
} }
if(data.page == 1){ if(params.page == 1){
this.tableList = [] this.tableList = []
} }
let res = await marketApi.contractsList(data)// let res = await apiRoute.xy_orderTableList(params)//
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1){ if (res.code != 1){
@ -133,13 +379,216 @@ export default {
this.filteredData.page++ this.filteredData.page++
}, },
// //
openViewArticleInfo(item) { async getPaymentTypeList(){
let id = item.id let res = await apiRoute.common_Dictionary({key:'payment_type'})
let redirect = item.redirect// if(res.code != 1){
uni.navigateTo({ uni.showToast({
url: `/pages/common/article_info?id=${id}` title: res.msg,
icon: 'none'
})
return
}
let dictionary = res.data.dictionary
let arr = []
dictionary.forEach((v,k)=>{
arr.push({
text: v.name,
value: v.value,
})
})
this.payment_type_options = arr
console.log('付款类型',this.payment_type_options)
},
//
async getCourseList(){
let params = {}
let res = await apiRoute.common_getCourseAll(params)
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
let arr = []
res.data.forEach((v,k)=>{
arr.push({
text: `${v.course_name}`,
value: v.id,
price: v.price,
})
})
this.course_id_options = arr
console.log('课程列表',this.course_id_options)
},
//
async getClassList(){
let params = {
status:1,//(1 2)
}
let res = await apiRoute.common_getClassAll(params)
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
console.log('班级列表',res.data)
let arr = []
res.data.forEach((v,k)=>{
arr.push({
text: `${v.campus_name}-${v.class_name}`,
value: v.id,
})
}) })
this.class_id_options = arr
},
//
//
openOrderShow(){
//
this.formData.payment_type = ''//
this.formData.payment_type_name = ''//
this.formData.course_id = ''//ID
this.formData.course_id_name = ''//ID
this.formData.class_id = ''//ID
this.formData.class_id_name = ''//ID
this.formData.money = ''//|
this.order_show = true//
},
//
closeOrderShow(){
this.order_show = false
},
//-
async clickOrder(e){
if(e.index == 0){
//
this.closeOrderShow()
}else{
console.log('提交',this.formData)
await this.submitFormData()
}
},
//
async submitFormData() {
let param = {...this.formData}
//
//...
if(!param.class_id){
uni.showToast({
title: '请选择班级',
icon: 'none'
})
return
}
if(!param.course_id){
uni.showToast({
title: '请选择课程',
icon: 'none'
})
return
}
if(!param.payment_type){
uni.showToast({
title: '请选择付款类型',
icon: 'none'
})
return
}
console.log('提交xxx',param)
this.closeOrderShow()
let res = await apiRoute.xy_orderTableAdd(param)
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
uni.showToast({
title: '操作成功',
icon: 'success'
})
//1s
setTimeout(() => {
this.resetFilteredData()//
this.getList();//
}, 1500)
},
//-
//-
changePaymentType(e){
this.formData.payment_type = e.value
this.formData.payment_type_name = e.text
this.cancelPaymentType()
},
//-
openPaymentType(){
this.payment_type_show = true
},
//-
cancelPaymentType(){
this.payment_type_show = false
},
//-
//-
changeCourseId(e){
console.log('课程',e)
this.formData.course_id = e.value
this.formData.course_id_name = e.text
this.formData.money = this.course_id_options.find(v=>v.value == e.value).price
// console.log('formData',this.formData)
this.cancelCourseId()
},
//-
openCourseId(){
this.course_id_show = true
},
//-
cancelCourseId(){
this.course_id_show = false
},
//-
//-
changeClassId(e){
this.formData.class_id = e.value
this.formData.class_id_name = e.text
this.cancelClassId()
},
//-
openClassId(){
this.class_id_show = true
},
//-
cancelClassId(){
this.class_id_show = false
}, },
// //
@ -172,12 +621,12 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main_box { .main_box {
background: #292929; background: #292929;
} }
// //
.navbar_section { .navbar_section {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -188,9 +637,9 @@ export default {
font-size: 30rpx; font-size: 30rpx;
color: #315d55; color: #315d55;
} }
} }
.main_section { .main_section {
min-height: 100vh; min-height: 100vh;
background: #292929 100%; background: #292929 100%;
padding: 0 0rpx; padding: 0 0rpx;
@ -223,6 +672,9 @@ export default {
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.title{
font-size: 30rpx;
}
.btn{ .btn{
display: flex; display: flex;
align-items: center; align-items: center;
@ -250,13 +702,64 @@ export default {
} }
} }
.btn_section{
display: flex;
justify-content: center;
align-items: center;
.btn{
border-radius: 10rpx;
padding: 15rpx 0;
width: 70%;
color: #fff;
font-size: 30rpx;
text-align: center;
}
}
} }
.describe { .describe {
color: #999999; color: #999999;
padding-left: 30rpx; padding-left: 30rpx;
}
//
.order_modal{
.fui-title {
font-size: 32rpx;
padding-top: 24rpx;
}
.fui-descr {
font-size: 24rpx;
color: #B2B2B2;
padding-top: 12rpx;
padding-bottom: 48rpx;
}
.fui-icon__close {
position: absolute;
right: 24rpx;
top: 20rpx;
}
.form-section{
.input-style {
text-align: right !important;
.input-title{}
} }
.button_box{
margin-top: 30rpx;
padding: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
}
}
}
</style> </style>

27
pages/market/clue/clue_info.vue

@ -290,6 +290,9 @@
followList:[], followList:[],
// //
listCallUp:[], listCallUp:[],
//
userInfo:{},
} }
}, },
onLoad(options) { onLoad(options) {
@ -301,10 +304,25 @@
methods: { methods: {
async init(){ async init(){
await this.getInfo()// await this.getInfo()//
// this.getFollowList()// this.getUserInfo()//
// this.getListCallUp()// // this.getListCallUp()//
}, },
//
async getUserInfo(){
let res = await apiRoute.getPersonnelInfo({})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.userInfo = res.data
// console.log('',this.userInfo)
},
// //
async getInfo(){ async getInfo(){
let data = { let data = {
@ -379,8 +397,13 @@
//- //-
openViewOrder() { openViewOrder() {
let resource_id = this.clientInfo.resource_id//id let resource_id = this.clientInfo.resource_id//id
let resource_name = this.clientInfo.customerResource.name || ''//id
let staff_id = this.userInfo.id//id
let staff_id_name = this.userInfo.name || ''//
this.$navigateTo({ this.$navigateTo({
url: `/pages/market/clue/order_list?resource_id=${resource_id}` url: `/pages/market/clue/order_list?resource_id=${resource_id}&resource_name=${resource_name}&staff_id=${staff_id}&staff_id_name=${staff_id_name}`
}) })
}, },

502
pages/market/clue/order_list.vue

@ -8,7 +8,7 @@
scroll-y="true" scroll-y="true"
:lower-threshold="lowerThreshold" :lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData" @scrolltolower="loadMoreData"
style="height: 90vh;" style="height: 83vh;"
> >
<view <view
class="item" class="item"
@ -16,13 +16,13 @@
:key="k" :key="k"
> >
<view class="top"> <view class="top">
<view class="title">订单状态</view> <view class="title">订单状态{{v.order_status == 'pending' ? '待支付':'已支付' }}</view>
<!-- <view class="btn" @click="downloadFile($util.img(v.file_data))">下载合同 <fui-icon name="arrowright" color="#A4ADB3" size="35"></fui-icon></view>--> <!-- <view class="btn" @click="downloadFile($util.img(v.file_data))">下载合同 <fui-icon name="arrowright" color="#A4ADB3" size="35"></fui-icon></view>-->
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="box"> <view class="box">
<view class="title">客户姓名</view> <view class="title">客户姓名</view>
<view class="content">{{ v.resource_id_name }}</view> <view class="content">{{ v.resource_id_name || ''}}</view>
</view> </view>
<view class="box"> <view class="box">
@ -34,12 +34,12 @@
<view class="box"> <view class="box">
<view class="title">订单金额</view> <view class="title">订单金额</view>
<view class="content">{{ v.order_amount }}</view> <view class="content">{{ v.order_amount || ''}}</view>
</view> </view>
<view class="box"> <view class="box">
<view class="title">课程</view> <view class="title">课程</view>
<view class="content">{{ v.course_id_name }}</view> <view class="content">{{ v.course_id_name || ''}}</view>
</view> </view>
<view class="box"> <view class="box">
@ -49,25 +49,177 @@
<view class="box"> <view class="box">
<view class="title">人员</view> <view class="title">人员</view>
<view class="content">{{ v.staff_id_name }}</view> <view class="content">{{ v.staff_id_name || ''}}</view>
</view> </view>
<view class="box"> <view class="box">
<view class="title">支付时间</view> <view class="title">支付时间</view>
<view class="content">{{ v.payment_time }}</view> <view class="content">{{ v.payment_time || '' }}</view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="btn_section">
<view class="btn" style="background-color:#29d3b4;" @click="openOrderShow()">创建订单</view>
</view> </view>
</view> </view>
<!--创建订单弹出层-->
<fui-modal class="order_modal" :buttons="[]" width="600" :show="order_show">
<text class="fui-title">创建订单</text>
<text class="fui-descr"></text>
<fui-form class="form-section" ref="form" top="0" :model="formData" :show="false">
<view class="input-style">
<!--客户名称-->
<fui-form-item
label="客户名称"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<fui-input
:disabled="true"
:borderBottom="false"
:padding="[0]"
placeholder="请输入客户名称"
v-model="formData.resource_id_name"
backgroundColor="#fff"
size="26"
color="#000"
></fui-input>
</view>
</fui-form-item>
<!--付款类型-->
<fui-form-item
label="选择付款类型"
asterisk
asteriskPosition="right"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<view
class="input-title"
style="margin-right:14rpx;"
@click="openPaymentType()">
{{ (formData.payment_type) ? formData.payment_type_name : '点击选择' }}
</view>
</view>
<fui-picker
:linkage='true'
:options="payment_type_options"
:layer="1"
:show="payment_type_show"
@change="changePaymentType"
@cancel="cancelPaymentType">
</fui-picker>
</fui-form-item>
<!--课程-->
<fui-form-item
label="选择课程"
asterisk
asteriskPosition="right"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<view
class="input-title"
style="margin-right:14rpx;"
@click="openCourseId()">
{{ (formData.course_id) ? formData.course_id_name : '点击选择' }}
</view>
</view>
<fui-picker
:linkage='true'
:options="course_id_options"
:layer="1"
:show="course_id_show"
@change="changeCourseId"
@cancel="cancelCourseId">
</fui-picker>
</fui-form-item>
<!--班级-->
<fui-form-item
label="选择班级"
asterisk
asteriskPosition="right"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<view
class="input-title"
style="margin-right:14rpx;"
@click="openClassId()">
{{ (formData.class_id) ? formData.class_id_name : '点击选择' }}
</view>
</view>
<fui-picker
:linkage='true'
:options="class_id_options"
:layer="1"
:show="class_id_show"
@change="changeClassId"
@cancel="cancelClassId">
</fui-picker>
</fui-form-item>
<!--订单金额-->
<fui-form-item
label="订单金额"
labelSize='26'
prop=""
background='#fff'
labelColor='#000'
:bottomBorder='true'
>
<view class="input-title" style="margin-right:14rpx;">
<fui-input
:disabled="true"
:borderBottom="false"
:padding="[0]"
placeholder="订单金额"
v-model="formData.money"
backgroundColor="#fff"
size="26"
color="#000"
></fui-input>
</view>
</fui-form-item>
</view>
<view class="button_box">
<fui-button background="#fff" color="#414141" borderColor="#465CFF" btnSize="small" @click="closeOrderShow">取消</fui-button>
<fui-button background="#fff" color="#465CFF" borderColor="#465CFF" btnSize="small" @click="clickOrder({index:1})">确定</fui-button>
</view>
</fui-form>
<view class="fui-icon__close" @tap="closeOrderShow">
<fui-icon name="close" color="#B2B2B2" :size="48"></fui-icon>
</view>
</fui-modal>
</view>
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js'; import apiRoute from '@/api/apiRoute.js';
import marketApi from '@/api/market.js';
export default { export default {
components: { components: {
@ -86,10 +238,67 @@ export default {
resource_id:'',//id resource_id:'',//id
}, },
tableList:[],// tableList:[],//
//
formData:{
payment_type:'',//
payment_type_name:'',//
course_id:'',//ID
course_id_name:'',//ID
class_id:'',//ID
class_id_name:'',//ID
staff_id:'',//ID
staff_id_name:'',//ID
resource_id:'',//ID
resource_id_name:'',//ID
money:'',//|
},
order_show:false,//|true=,false=
//-
payment_type_options:[
// {
// text:'',
// value:'1'
// },
],//
payment_type_show:false,//
//-
course_id_options:[
// {
// text:'',
// value:'1',
// price:'1'//
// },
],//
course_id_show:false,//
//-
class_id_options:[
// {
// text:'',
// value:'1'
// },
],//
class_id_show:false,//
} }
}, },
onLoad(options) { onLoad(options) {
this.filteredData.resource_id = options.resource_id//id this.filteredData.resource_id = options.resource_id//id
this.formData.resource_id = options.resource_id//id
this.formData.resource_id_name = options.resource_name//id
this.formData.staff_id = options.staff_id//id
this.formData.staff_id_name = options.staff_id_name//id
}, },
onShow(){ onShow(){
this.init() this.init()
@ -103,8 +312,17 @@ export default {
methods: { methods: {
// //
async init(){ async init(){
//
await this.getPaymentTypeList()
//
await this.getCourseList()
//
await this.getClassList()
//
await this.getList(); await this.getList();
}, },
//() //()
loadMoreData() { loadMoreData() {
// //
@ -161,13 +379,218 @@ export default {
this.filteredData.page++ this.filteredData.page++
}, },
// //
openViewArticleInfo(item) { async getPaymentTypeList(){
let id = item.id let res = await apiRoute.common_Dictionary({key:'payment_type'})
let redirect = item.redirect// if(res.code != 1){
uni.navigateTo({ uni.showToast({
url: `/pages/common/article_info?id=${id}` title: res.msg,
icon: 'none'
})
return
}
let dictionary = res.data.dictionary
let arr = []
dictionary.forEach((v,k)=>{
arr.push({
text: v.name,
value: v.value,
})
})
this.payment_type_options = arr
console.log('付款类型',this.payment_type_options)
},
//
async getCourseList(){
let params = {}
let res = await apiRoute.common_getCourseAll(params)
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
let arr = []
res.data.forEach((v,k)=>{
arr.push({
text: `${v.course_name}`,
value: v.id,
price: v.price,
})
})
this.course_id_options = arr
console.log('课程列表',this.course_id_options)
},
//
async getClassList(){
let params = {
status:1,//(1 2)
}
let res = await apiRoute.common_getClassAll(params)
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
console.log('班级列表',res.data)
let arr = []
res.data.forEach((v,k)=>{
arr.push({
text: `${v.campus_name}-${v.class_name}`,
value: v.id,
})
})
this.class_id_options = arr
},
//
//
openOrderShow(){
//
this.formData.payment_type = ''//
this.formData.payment_type_name = ''//
this.formData.course_id = ''//ID
this.formData.course_id_name = ''//ID
this.formData.class_id = ''//ID
this.formData.class_id_name = ''//ID
this.formData.money = ''//|
this.order_show = true//
},
//
closeOrderShow(){
this.order_show = false
},
//-
async clickOrder(e){
if(e.index == 0){
//
this.closeOrderShow()
}else{
console.log('提交',this.formData)
await this.submitFormData()
}
},
//
async submitFormData() {
let param = {...this.formData}
//
//...
if(!param.class_id){
uni.showToast({
title: '请选择班级',
icon: 'none'
})
return
}
if(!param.course_id){
uni.showToast({
title: '请选择课程',
icon: 'none'
})
return
}
if(!param.payment_type){
uni.showToast({
title: '请选择付款类型',
icon: 'none'
})
return
}
console.log('提交xxx',param)
this.closeOrderShow()
let res = await apiRoute.xs_orderTableAdd(param)
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
uni.showToast({
title: '操作成功',
icon: 'success'
}) })
//1s
setTimeout(() => {
this.resetFilteredData()//
this.getList();//
}, 1500)
},
//-
//-
changePaymentType(e){
this.formData.payment_type = e.value
this.formData.payment_type_name = e.text
this.cancelPaymentType()
},
//-
openPaymentType(){
this.payment_type_show = true
},
//-
cancelPaymentType(){
this.payment_type_show = false
},
//-
//-
changeCourseId(e){
console.log('课程',e)
this.formData.course_id = e.value
this.formData.course_id_name = e.text
this.formData.money = this.course_id_options.find(v=>v.value == e.value).price
// console.log('formData',this.formData)
this.cancelCourseId()
},
//-
openCourseId(){
this.course_id_show = true
},
//-
cancelCourseId(){
this.course_id_show = false
},
//-
//-
changeClassId(e){
this.formData.class_id = e.value
this.formData.class_id_name = e.text
this.cancelClassId()
},
//-
openClassId(){
this.class_id_show = true
},
//-
cancelClassId(){
this.class_id_show = false
}, },
// //
@ -281,6 +704,19 @@ export default {
} }
} }
.btn_section{
display: flex;
justify-content: center;
align-items: center;
.btn{
border-radius: 10rpx;
padding: 15rpx 0;
width: 70%;
color: #fff;
font-size: 30rpx;
text-align: center;
}
}
@ -290,4 +726,42 @@ export default {
color: #999999; color: #999999;
padding-left: 30rpx; padding-left: 30rpx;
} }
//
.order_modal{
.fui-title {
font-size: 32rpx;
padding-top: 24rpx;
}
.fui-descr {
font-size: 24rpx;
color: #B2B2B2;
padding-top: 12rpx;
padding-bottom: 48rpx;
}
.fui-icon__close {
position: absolute;
right: 24rpx;
top: 20rpx;
}
.form-section{
.input-style {
text-align: right !important;
.input-title{}
}
.button_box{
margin-top: 30rpx;
padding: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
}
}
}
</style> </style>

17
pages/student/my/my.vue

@ -56,7 +56,7 @@
<!-- <view></view>--> <!-- <view></view>-->
<!-- </view>--> <!-- </view>-->
<view class="item" @click="openViewContractList()"> <view class="item" @click="openViewOrder()">
<view>我的订单</view> <view>我的订单</view>
<view></view> <view></view>
</view> </view>
@ -147,10 +147,19 @@
}) })
}, },
//- //-
openViewContractList(item) { openViewOrder() {
let resource_id = this.member_info.id//id
let resource_name = this.member_info.name || ''//id
// let staff_id = this.userInfo.id//id
// let staff_id_name = this.userInfo.name || ''//
let staff_id = ''//id
let staff_id_name = ''//
this.$navigateTo({ this.$navigateTo({
url: `/pages/common/contract_list` url: `/pages/common/contract_list?resource_id=${resource_id}&resource_name=${resource_name}&staff_id=${staff_id}&staff_id_name=${staff_id_name}`
}) })
}, },

Loading…
Cancel
Save