Browse Source

修改 bug

master
王泽彦 9 months ago
parent
commit
129fcb13f0
  1. 6
      niucloud/app/api/controller/pay/Pay.php
  2. 2
      niucloud/app/api/route/route.php
  3. 3
      niucloud/app/listener/personnel/Student.php
  4. 8
      niucloud/app/model/student_courses/StudentCourses.php
  5. 8
      niucloud/app/service/admin/pay/PayService.php
  6. 7
      uniapp/api/apiRoute.js
  7. 70
      uniapp/components/custom-modal/custom-modal.vue
  8. 234
      uniapp/components/custom-modal/example.vue
  9. 7
      uniapp/pages.json
  10. 116
      uniapp/pages/market/clue/clue_table.vue
  11. 177
      uniapp/pages/market/clue/order_list.vue

6
niucloud/app/api/controller/pay/Pay.php

@ -101,11 +101,9 @@ class Pay extends BaseApiController
*/ */
public function getQrcode(){ public function getQrcode(){
$data = $this->request->params([ $data = $this->request->params([
['trade_type', ''], ['order_id', ''],
['trade_id', ''],
['type', ''],
]); ]);
return success('SUCCESS',(new PayService())->getQrcode($data['type'], $data['trade_type'], $data['trade_id'])); return success('SUCCESS',(new \app\service\admin\pay\PayService())->order_pay($data));
} }
public function qrcodeNotify(int $order_id) public function qrcodeNotify(int $order_id)

2
niucloud/app/api/route/route.php

@ -369,6 +369,8 @@ Route::group(function () {
Route::get('personnel/serviceLogDetail', 'apiController.Personnel/serviceLogDetail'); Route::get('personnel/serviceLogDetail', 'apiController.Personnel/serviceLogDetail');
Route::post('personnel/updateServiceRemark', 'apiController.Personnel/updateServiceRemark'); Route::post('personnel/updateServiceRemark', 'apiController.Personnel/updateServiceRemark');
Route::get('getQrcode', 'pay.Pay/getQrcode');
})->middleware(ApiChannel::class) })->middleware(ApiChannel::class)
->middleware(ApiPersonnelCheckToken::class, true) ->middleware(ApiPersonnelCheckToken::class, true)

3
niucloud/app/listener/personnel/Student.php

@ -91,7 +91,8 @@ class Student
'gift_hours' => $course_info['gift_session_count'], 'gift_hours' => $course_info['gift_session_count'],
'start_date' => date("Y-m-d"), 'start_date' => date("Y-m-d"),
'end_date' => date("Y-m-d", strtotime("+30 days")), 'end_date' => date("Y-m-d", strtotime("+30 days")),
'single_session_count' => $course_info['single_session_count'] 'single_session_count' => $course_info['single_session_count'],
'resource_id'=> $order_info['resource_id']
]); ]);

8
niucloud/app/model/student_courses/StudentCourses.php

@ -71,16 +71,12 @@ class StudentCourses extends BaseModel
} }
public function student(){ public function student(){
return $this->hasOne(Student::class, 'id', 'student_id')->joinType('left')->withField('name,id')->bind(['student_id_name'=>'name']); return $this->hasOne(Student::class, 'id', 'student_id');
} }
public function course(){ public function course(){
return $this->hasOne(Course::class, 'id', 'course_id')->joinType('left')->withField('course_name,id')->bind(['course_id_name'=>'course_name']); return $this->hasOne(Course::class, 'id', 'course_id');
} }
} }

8
niucloud/app/service/admin/pay/PayService.php

@ -224,7 +224,8 @@ class PayService extends BaseAdminService
return $pay_type_list; return $pay_type_list;
} }
public function order_pay($data){ public function order_pay($data)
{
$out_trade_no = 'sm' . date("YmdHis") . time(); $out_trade_no = 'sm' . date("YmdHis") . time();
$order = new OrderTable(); $order = new OrderTable();
$order_info = $order->where(['id' => $data['order_id']])->find(); $order_info = $order->where(['id' => $data['order_id']])->find();
@ -245,10 +246,11 @@ class PayService extends BaseAdminService
$path = qrcode($url['code_url'], '', [], 'upload/qrcode/pay/'); $path = qrcode($url['code_url'], '', [], 'upload/qrcode/pay/');
$order->where(['id' => $data['order_id']])->update(['payment_id' => $out_trade_no, 'ipv3' => $config['mch_secret_key']]); $order->where(['id' => $data['order_id']])->update(['payment_id' => $out_trade_no, 'ipv3' => $config['mch_secret_key']]);
return ['qrcode_url' => getCurrentDomain().$path,'out_trade_no'=>$out_trade_no]; return ['qrcode_url' => getCurrentDomain() . $path, 'out_trade_no' => $out_trade_no, 'code_url' => $url['code_url']];
} }
public function check_payment_status($data){ public function check_payment_status($data)
{
$order = new OrderTable(); $order = new OrderTable();
$order_status = $order->where(['payment_id' => $data['out_trade_no']])->value("order_status"); $order_status = $order->where(['payment_id' => $data['out_trade_no']])->value("order_status");
return ['order_status' => $order_status]; return ['order_status' => $order_status];

7
uniapp/api/apiRoute.js

@ -387,7 +387,10 @@ export default {
//更新学生课程人员配置 //更新学生课程人员配置
async updateStudentCoursePersonnel(data = {}) { async updateStudentCoursePersonnel(data = {}) {
return await http.post('/updateStudentCoursePersonnel', data); return await http.post('/updateStudentCoursePersonnel', data);
} },
// 获取订单支付二维码
async getOrderPayQrcode(data = {}) {
return await http.get('/getQrcode', data);
},
} }

70
uniapp/components/custom-modal/custom-modal.vue

@ -0,0 +1,70 @@
<template>
<fui-modal :buttons="[]" :width="width" :show="show" :maskClose="maskClose">
<!-- 默认内容插槽 -->
<slot>
<!-- 默认内容 -->
</slot>
<!-- 按钮插槽 -->
<view v-if="$slots.buttons" class="button-section">
<slot name="buttons"></slot>
</view>
<!-- 关闭按钮 -->
<view v-if="showClose" class="fui-icon__close" @tap="handleClose">
<fui-icon name="close" color="#B2B2B2" :size="48"></fui-icon>
</view>
</fui-modal>
</template>
<script>
export default {
name: 'CustomModal',
props: {
//
show: {
type: Boolean,
default: false
},
//
width: {
type: [String, Number],
default: 600
},
//
showClose: {
type: Boolean,
default: true
},
//
maskClose: {
type: Boolean,
default: true
}
},
methods: {
//
handleClose() {
this.$emit('cancel', 'close')
}
}
}
</script>
<style lang="less" scoped>
.button-section {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
gap: 20rpx;
margin-top: 40rpx;
}
.fui-icon__close {
position: absolute;
right: 24rpx;
top: 20rpx;
z-index: 1000;
}
</style>

234
uniapp/components/custom-modal/example.vue

@ -0,0 +1,234 @@
<template>
<view class="container">
<fui-button @click="showSuccessModal = true" text="显示成功弹窗"></fui-button>
<fui-button @click="showConfirmModal = true" text="显示确认弹窗"></fui-button>
<fui-button @click="showCustomModal = true" text="显示自定义弹窗"></fui-button>
<!-- 成功弹窗示例 -->
<custom-modal
:show="showSuccessModal"
width="600"
@cancel="handleModalCancel"
>
<fui-icon name="checkbox-fill" :size="108" color="#09BE4F"></fui-icon>
<text class="fui-title">购买成功</text>
<text class="fui-descr">成功购买一张月卡可免费阅读30天</text>
<template #buttons>
<fui-button
text="我知道了"
width="240rpx"
height="72rpx"
:size="28"
radius="36rpx"
background="#FFB703"
borderWidth="0"
:margin="['0','0','24rpx']"
@click="handleButtonClick('success_confirm')"
/>
</template>
</custom-modal>
<!-- 确认弹窗示例 -->
<custom-modal
:show="showConfirmModal"
width="500"
@cancel="handleModalCancel"
>
<fui-icon name="warning-fill" :size="108" color="#FF6B35"></fui-icon>
<text class="fui-title">确认删除</text>
<text class="fui-descr">删除后无法恢复确定要继续吗</text>
<template #buttons>
<fui-button
text="取消"
width="200rpx"
height="72rpx"
:size="28"
radius="36rpx"
background="#F5F5F5"
color="#333"
borderWidth="0"
:margin="['0','0','12rpx']"
@click="handleButtonClick('confirm_cancel')"
/>
<fui-button
text="确定删除"
width="200rpx"
height="72rpx"
:size="28"
radius="36rpx"
background="#FF6B35"
borderWidth="0"
@click="handleButtonClick('confirm_delete')"
/>
</template>
</custom-modal>
<!-- 自定义内容弹窗示例 -->
<custom-modal
:show="showCustomModal"
width="700"
:showClose="false"
@cancel="handleModalCancel"
>
<view class="custom-content">
<text class="custom-title">支付二维码</text>
<view class="custom-form">
<fui-qrcode :value="qrcode"></fui-qrcode>
</view>
</view>
<template #buttons>
<view class="button-row">
<fui-button
text="发送二维码给用户"
width="200rpx"
height="72rpx"
:size="28"
radius="36rpx"
background="#007AFF"
borderWidth="0"
@click="handleButtonClick('custom_submit')"
/>
</view>
</template>
</custom-modal>
</view>
</template>
<script>
import CustomModal from './custom-modal.vue'
export default {
components: {
CustomModal
},
data() {
return {
showSuccessModal: false,
showConfirmModal: false,
showCustomModal: false,
qrcode: 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=TICKET',
formData: {
name: '',
phone: ''
}
}
},
methods: {
//
handleModalCancel(type) {
console.log('弹窗取消:', type)
this.showSuccessModal = false
this.showConfirmModal = false
this.showCustomModal = false
},
//
handleButtonClick(action) {
console.log('按钮点击:', action)
switch(action) {
case 'success_confirm':
this.showSuccessModal = false
uni.showToast({
title: '确认成功',
icon: 'success'
})
break
case 'confirm_cancel':
this.showConfirmModal = false
break
case 'confirm_delete':
this.showConfirmModal = false
uni.showToast({
title: '删除成功',
icon: 'success'
})
break
case 'custom_cancel':
this.showCustomModal = false
break
case 'custom_submit':
if (!this.formData.name || !this.formData.phone) {
uni.showToast({
title: '请填写完整信息',
icon: 'none'
})
return
}
this.showCustomModal = false
uni.showToast({
title: '提交成功',
icon: 'success'
})
//
this.formData = {
name: '',
phone: ''
}
break
}
}
}
}
</script>
<style lang="less" scoped>
.container {
padding: 40rpx;
display: flex;
flex-direction: column;
gap: 30rpx;
}
.fui-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
text-align: center;
margin: 20rpx 0;
}
.fui-descr {
font-size: 28rpx;
color: #666;
text-align: center;
margin: 0 0 30rpx 0;
line-height: 1.5;
}
.custom-content {
width: 100%;
padding: 20rpx;
}
.custom-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
text-align: center;
display: block;
margin-bottom: 30rpx;
}
.custom-form {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.button-row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 40rpx;
}
</style>

7
uniapp/pages.json

@ -177,7 +177,7 @@
{ {
"path": "pages/common/im_chat_info", "path": "pages/common/im_chat_info",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "消息",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#292929", "navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
@ -677,9 +677,8 @@
{ {
"path": "pages/market/clue/clue_table", "path": "pages/market/clue/clue_table",
"style": { "style": {
"navigationBarTitleText": "线索统计表", "navigationBarTitleText": "数据统计",
"navigationStyle": "default", "navigationBarBackgroundColor": "#292929",
"navigationBarBackgroundColor": "#18181c",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
} }

116
uniapp/pages/market/clue/clue_table.vue

@ -1,31 +1,42 @@
<template> <template>
<view class="dark-table-container"> <view class="dark-table-container">
<scroll-view scroll-x="true" class="table-scroll"> <view v-for="(row, rIdx) in data" :key="rIdx" class="card">
<view class="table"> <view class="card-title" @click="toggleExpand(rIdx)">
<!-- 表头 --> {{ row.channel }}
<view class="table-row table-header"> <text class="expand-icon">{{ expanded[rIdx] ? '▲' : '▼' }}</text>
<view class="table-cell" v-for="(col, idx) in columns" :key="idx"> </view>
<view class="card-content">
<view
class="card-row"
v-for="(col, cIdx) in getVisibleColumns(rIdx)"
:key="cIdx"
>
<view class="card-label">
{{ col.label }} {{ col.label }}
<text v-if="col.tip" class="tip" @click="showTip(col.tip)">?</text> <text v-if="col.tip" class="tip" @click.stop="showTip(col.tip)">?</text>
</view> </view>
<view class="card-value">{{ row[col.key] || '-' }}</view>
</view> </view>
<!-- 数据行 -->
<view class="table-row" v-for="(row, rIdx) in data" :key="rIdx">
<view class="table-cell" v-for="(col, cIdx) in columns" :key="cIdx">
{{ row[col.key] || '-' }}
</view> </view>
<view v-if="columns.length > 6" class="expand-btn" @click="toggleExpand(rIdx)">
{{ expanded[rIdx] ? '收起' : '展开全部' }}
</view> </view>
</view> </view>
</scroll-view>
<!-- 说明弹窗 --> <!-- 说明弹窗 -->
<uni-popup ref="popup" type="center"> <uni-popup ref="popup" type="center">
<view class="popup-content">{{ tipContent }}</view> <view class="popup-content">{{ tipContent }}</view>
</uni-popup> </uni-popup>
<AQTabber></AQTabber>
</view> </view>
</template> </template>
<script> <script>
import AQTabber from "@/components/AQ/AQTabber.vue"
export default { export default {
components: {
AQTabber,
},
data() { data() {
return { return {
columns: [ columns: [
@ -48,13 +59,23 @@ export default {
data: [ data: [
{ channel: '体检包(地推)', resource: 10, visit1: 5, visitRate1: '50%', visit2: 2, visitRate2: '40%', close1: 1, closeRate1: '20%', close2: 1, closeRate2: '50%', monthTrans: '10%', lastMonthVisit: 0, monthTotalVisit: 5, lastMonthClose: 0, monthTotalClose: 1 }, { channel: '体检包(地推)', resource: 10, visit1: 5, visitRate1: '50%', visit2: 2, visitRate2: '40%', close1: 1, closeRate1: '20%', close2: 1, closeRate2: '50%', monthTrans: '10%', lastMonthVisit: 0, monthTotalVisit: 5, lastMonthClose: 0, monthTotalClose: 1 },
], ],
tipContent: '' tipContent: '',
expanded: {},
} }
}, },
methods: { methods: {
showTip(content) { showTip(content) {
this.tipContent = content this.tipContent = content
this.$refs.popup.open() this.$refs.popup.open()
},
toggleExpand(idx) {
this.$set(this.expanded, idx, !this.expanded[idx])
},
getVisibleColumns(idx) {
// 5
const cols = this.columns.slice(1)
if (this.expanded[idx]) return cols
return cols.slice(0, 5)
} }
} }
} }
@ -65,29 +86,58 @@ export default {
background: #18181c; background: #18181c;
color: #f1f1f1; color: #f1f1f1;
min-height: 100vh; min-height: 100vh;
padding: 16rpx; padding: 24rpx 12rpx;
}
.card {
background: #23232a;
border-radius: 18rpx;
box-shadow: 0 4rpx 24rpx rgba(0,0,0,0.18);
margin-bottom: 32rpx;
padding: 24rpx 20rpx 8rpx 20rpx;
transition: box-shadow 0.2s;
} }
.table-scroll { .card-title {
width: 100%; font-size: 32rpx;
overflow-x: auto; font-weight: bold;
margin-bottom: 18rpx;
color: #ffb300;
letter-spacing: 2rpx;
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
} }
.table { .expand-icon {
min-width: 1200rpx; font-size: 24rpx;
color: #bdbdbd;
margin-left: 12rpx;
} }
.table-row { .card-content {
display: flex; display: flex;
border-bottom: 1px solid #333; flex-direction: column;
gap: 12rpx;
overflow: hidden;
transition: max-height 0.3s;
} }
.table-header { .card-row {
background: #23232a; display: flex;
font-weight: bold; justify-content: space-between;
align-items: center;
border-bottom: 1px dashed #333;
padding: 8rpx 0;
} }
.table-cell { .card-label {
flex: 0 0 180rpx; color: #bdbdbd;
padding: 16rpx 8rpx; font-size: 26rpx;
text-align: center; display: flex;
border-right: 1px solid #333; align-items: center;
position: relative; }
.card-value {
color: #f1f1f1;
font-size: 26rpx;
text-align: right;
max-width: 60%;
word-break: break-all;
} }
.tip { .tip {
color: #ffb300; color: #ffb300;
@ -95,6 +145,14 @@ export default {
font-size: 24rpx; font-size: 24rpx;
cursor: pointer; cursor: pointer;
} }
.expand-btn {
color: #ffb300;
text-align: center;
font-size: 26rpx;
margin: 10rpx 0 0 0;
padding-bottom: 8rpx;
cursor: pointer;
}
.popup-content { .popup-content {
background: #23232a; background: #23232a;
color: #fff; color: #fff;

177
uniapp/pages/market/clue/order_list.vue

@ -235,8 +235,12 @@
</fui-form-item> </fui-form-item>
</view> </view>
<view class="button_box"> <view class="button_box">
<fui-button background="#fff" color="#414141" borderColor="#465CFF" btnSize="small" @click="closeOrderShow">取消</fui-button> <fui-button background="#fff" color="#414141" borderColor="#465CFF" btnSize="small" @click="closeOrderShow">
<fui-button background="#fff" color="#465CFF" borderColor="#465CFF" btnSize="small" @click="clickOrder({index:1})">确定</fui-button> 取消
</fui-button>
<fui-button background="#fff" color="#465CFF" borderColor="#465CFF" btnSize="small"
@click="clickOrder({index:1})">确定
</fui-button>
</view> </view>
</fui-form> </fui-form>
@ -244,15 +248,47 @@
<fui-icon name="close" color="#B2B2B2" :size="48"></fui-icon> <fui-icon name="close" color="#B2B2B2" :size="48"></fui-icon>
</view> </view>
</fui-modal> </fui-modal>
<!-- 自定义内容弹窗示例 -->
<custom-modal
:show="showCustomModal"
width="700"
:showClose="true"
:maskClose="true"
@cancel="handleModalCancel"
>
<view class="custom-content">
<text class="custom-title">支付二维码</text>
<view class="custom-form">
<fui-qrcode :value="qrcode"></fui-qrcode>
</view>
</view>
<template #buttons>
<view class="button-row">
<fui-button
text="发送二维码给用户"
width="300rpx"
height="72rpx"
:size="28"
radius="36rpx"
background="#007AFF"
borderWidth="0"
@click="handleButtonClick"
/>
</view>
</template>
</custom-modal>
</view> </view>
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js'; import apiRoute from '@/api/apiRoute.js'
import FuiRadioGroup from '../../../components/firstui/fui-radio-group/fui-radio-group.vue' import FuiRadioGroup from '../../../components/firstui/fui-radio-group/fui-radio-group.vue'
import CustomModal from '../../../components/custom-modal/custom-modal.vue'
export default { export default {
components: { components: {
CustomModal,
FuiRadioGroup, FuiRadioGroup,
}, },
data() { data() {
@ -260,7 +296,8 @@ export default {
loading: false,// loading: false,//
lowerThreshold: 100,// lowerThreshold: 100,//
isReachedBottom: false,//|true=|false= isReachedBottom: false,//|true=|false=
showCustomModal: false,
qrcode: 'https://www.baidu.com',
// //
filteredData: { filteredData: {
page: 1,// page: 1,//
@ -288,7 +325,7 @@ export default {
resource_id_name: '',//ID resource_id_name: '',//ID
money: '',//| money: '',//|
order_type:'1' order_type: '1',
}, },
order_show: false,//|true=,false= order_show: false,//|true=,false=
@ -328,7 +365,7 @@ export default {
if (!options || !options.resource_id) { if (!options || !options.resource_id) {
uni.showToast({ uni.showToast({
title: '缺少必要参数', title: '缺少必要参数',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -362,12 +399,12 @@ export default {
await this.getClassList() await this.getClassList()
// //
await this.getList(); await this.getList()
} catch (error) { } catch (error) {
console.error('初始化失败:', error) console.error('初始化失败:', error)
uni.showToast({ uni.showToast({
title: '初始化数据失败', title: '初始化数据失败',
icon: 'none' icon: 'none',
}) })
} }
}, },
@ -376,19 +413,21 @@ export default {
loadMoreData() { loadMoreData() {
// //
if (!this.isReachedBottom) { if (!this.isReachedBottom) {
this.isReachedBottom = true;// this.isReachedBottom = true//
this.getList(); this.getList()
} }
}, },
// //
async resetFilteredData() { async resetFilteredData() {
this.isReachedBottom = false; // 便 this.isReachedBottom = false // 便
this.filteredData.page = 1// this.filteredData.page = 1//
this.filteredData.limit = 10// this.filteredData.limit = 10//
this.filteredData.total = 10// this.filteredData.total = 10//
}, },
handleModalCancel() {
this.showCustomModal = false
},
// //
async getList() { async getList() {
this.loading = true this.loading = true
@ -400,7 +439,7 @@ export default {
this.loading = false this.loading = false
uni.showToast({ uni.showToast({
title: '暂无更多', title: '暂无更多',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -411,16 +450,16 @@ export default {
let res = await apiRoute.xs_orderTableList(params)// let res = await apiRoute.xs_orderTableList(params)//
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none',
}) })
return return
} }
this.tableList = this.tableList.concat(res.data.data); // 使 concat this.tableList = this.tableList.concat(res.data.data) // 使 concat
// this.tableList.unshift(...res.data.data); // // this.tableList.unshift(...res.data.data); //
console.log('列表', this.tableList) console.log('列表', this.tableList)
@ -435,7 +474,7 @@ export default {
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg || '获取付款类型失败', title: res.msg || '获取付款类型失败',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -463,7 +502,7 @@ export default {
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg || '获取课程列表失败', title: res.msg || '获取课程列表失败',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -498,7 +537,7 @@ export default {
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg || '获取班级列表失败', title: res.msg || '获取班级列表失败',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -523,8 +562,6 @@ export default {
}, },
// //
// //
openOrderShow() { openOrderShow() {
@ -564,28 +601,28 @@ export default {
if (!param.resource_id) { if (!param.resource_id) {
uni.showToast({ uni.showToast({
title: '客户信息缺失', title: '客户信息缺失',
icon: 'none' icon: 'none',
}) })
return return
} }
if (!param.class_id) { if (!param.class_id) {
uni.showToast({ uni.showToast({
title: '请选择班级', title: '请选择班级',
icon: 'none' icon: 'none',
}) })
return return
} }
if (!param.course_id) { if (!param.course_id) {
uni.showToast({ uni.showToast({
title: '请选择课程', title: '请选择课程',
icon: 'none' icon: 'none',
}) })
return return
} }
if (!param.payment_type) { if (!param.payment_type) {
uni.showToast({ uni.showToast({
title: '请选择付款类型', title: '请选择付款类型',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -593,7 +630,7 @@ export default {
if (!param.money) { if (!param.money) {
uni.showToast({ uni.showToast({
title: '订单金额为空', title: '订单金额为空',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -602,7 +639,7 @@ export default {
this.closeOrderShow() this.closeOrderShow()
uni.showLoading({ uni.showLoading({
title: '提交中...' title: '提交中...',
}) })
let res = await apiRoute.xs_orderTableAdd(param) let res = await apiRoute.xs_orderTableAdd(param)
@ -611,27 +648,27 @@ export default {
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg || '创建订单失败', title: res.msg || '创建订单失败',
icon: 'none' icon: 'none',
}) })
return return
} }
uni.showToast({ uni.showToast({
title: '创建订单成功', title: '创建订单成功',
icon: 'success' icon: 'success',
}) })
//1s //1s
setTimeout(() => { setTimeout(() => {
this.resetFilteredData()// this.resetFilteredData()//
this.getList();// this.getList()//
}, 1500) }, 1500)
} catch (error) { } catch (error) {
uni.hideLoading() uni.hideLoading()
console.error('提交订单失败:', error) console.error('提交订单失败:', error)
uni.showToast({ uni.showToast({
title: '创建订单失败,请重试', title: '创建订单失败,请重试',
icon: 'none' icon: 'none',
}) })
} }
}, },
@ -644,7 +681,7 @@ export default {
if (!e || !e.value) { if (!e || !e.value) {
uni.showToast({ uni.showToast({
title: '请选择有效的付款类型', title: '请选择有效的付款类型',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -657,7 +694,7 @@ export default {
if (!this.payment_type_options || this.payment_type_options.length === 0) { if (!this.payment_type_options || this.payment_type_options.length === 0) {
uni.showToast({ uni.showToast({
title: '付款类型数据加载中,请稍后再试', title: '付款类型数据加载中,请稍后再试',
icon: 'none' icon: 'none',
}) })
this.getPaymentTypeList() // this.getPaymentTypeList() //
return return
@ -676,7 +713,7 @@ export default {
if (!e || !e.value) { if (!e || !e.value) {
uni.showToast({ uni.showToast({
title: '请选择有效的课程', title: '请选择有效的课程',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -699,7 +736,7 @@ export default {
if (!this.course_id_options || this.course_id_options.length === 0) { if (!this.course_id_options || this.course_id_options.length === 0) {
uni.showToast({ uni.showToast({
title: '课程数据加载中,请稍后再试', title: '课程数据加载中,请稍后再试',
icon: 'none' icon: 'none',
}) })
this.getCourseList() // this.getCourseList() //
return return
@ -718,7 +755,7 @@ export default {
if (!e || !e.value) { if (!e || !e.value) {
uni.showToast({ uni.showToast({
title: '请选择有效的班级', title: '请选择有效的班级',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -731,7 +768,7 @@ export default {
if (!this.class_id_options || this.class_id_options.length === 0) { if (!this.class_id_options || this.class_id_options.length === 0) {
uni.showToast({ uni.showToast({
title: '班级数据加载中,请稍后再试', title: '班级数据加载中,请稍后再试',
icon: 'none' icon: 'none',
}) })
this.getClassList() // this.getClassList() //
return return
@ -755,7 +792,7 @@ export default {
console.log('订单已支付,无需再次支付') console.log('订单已支付,无需再次支付')
uni.showToast({ uni.showToast({
title: '订单已支付', title: '订单已支付',
icon: 'none' icon: 'none',
}) })
} }
}, },
@ -779,7 +816,7 @@ export default {
default: default:
uni.showToast({ uni.showToast({
title: '未知支付类型', title: '未知支付类型',
icon: 'none' icon: 'none',
}) })
break break
} }
@ -792,7 +829,7 @@ export default {
// //
uni.showToast({ uni.showToast({
title: '现金支付处理中...', title: '现金支付处理中...',
icon: 'loading' icon: 'loading',
}) })
// //
@ -803,14 +840,10 @@ export default {
handleScanCodePayment(orderData) { handleScanCodePayment(orderData) {
console.log('处理扫码支付:', orderData) console.log('处理扫码支付:', orderData)
// //
// apiRoute.getOrderPayQrcode({ order_id: orderData.id }).then(res => {
uni.showToast({ this.qrcode = res.data.code_url
title: '扫码支付处理中...', this.showCustomModal = true
icon: 'loading'
}) })
//
// this.initiateScanCodePayment(orderData)
}, },
// //
@ -820,7 +853,7 @@ export default {
// //
uni.showToast({ uni.showToast({
title: '订阅支付处理中...', title: '订阅支付处理中...',
icon: 'loading' icon: 'loading',
}) })
// //
@ -831,15 +864,15 @@ export default {
async downloadFile(fileUrl) { async downloadFile(fileUrl) {
if (!fileUrl) { if (!fileUrl) {
this.$util.showToast({ this.$util.showToast({
title: '暂无电子发票' title: '暂无电子发票',
}); })
return false; return false
} }
uni.downloadFile({ uni.downloadFile({
url: fileUrl, url: fileUrl,
success: function(res) { success: function(res) {
console.log('下载成功'); console.log('下载成功')
// uni.openDocument({ // uni.openDocument({
// filePath: res.tempFilePath, // filePath: res.tempFilePath,
// fileType: 'pdf', // fileType: 'pdf',
@ -847,12 +880,14 @@ export default {
// console.log(''); // console.log('');
// } // }
// }); // });
} },
}); })
} },
handleButtonClick(){
} }
},
} }
</script> </script>
@ -861,17 +896,19 @@ export default {
background: #292929; background: #292929;
} }
// .custom-content {
.navbar_section { width: 100%;
padding: 20rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; flex-wrap: wrap;
background: #29d3b4;
.title { .custom-title {
padding: 20rpx 0; width: 100%;
font-size: 30rpx; text-align: center;
color: #315d55; font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
} }
} }
@ -904,31 +941,38 @@ export default {
border-radius: 14rpx; border-radius: 14rpx;
background-color: #434544; background-color: #434544;
color: #fff; color: #fff;
.top { .top {
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.title { .title {
font-size: 30rpx; font-size: 30rpx;
} }
.btn { .btn {
display: flex; display: flex;
align-items: center; align-items: center;
color: #29D3B4; color: #29D3B4;
} }
} }
.bottom { .bottom {
font-size: 26rpx; font-size: 26rpx;
margin-top: 25rpx; margin-top: 25rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 15rpx; gap: 15rpx;
.box { .box {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.title { .title {
width: 180rpx; width: 180rpx;
} }
.content { .content {
width: 100%; width: 100%;
} }
@ -942,6 +986,7 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.btn { .btn {
border-radius: 10rpx; border-radius: 10rpx;
padding: 15rpx 0; padding: 15rpx 0;
@ -953,7 +998,6 @@ export default {
} }
} }
.describe { .describe {
@ -986,8 +1030,11 @@ export default {
.input-style { .input-style {
text-align: right !important; text-align: right !important;
.input-title{}
.input-title {
} }
}
.button_box { .button_box {
margin-top: 30rpx; margin-top: 30rpx;
padding: 20rpx; padding: 20rpx;

Loading…
Cancel
Save