0512
This commit is contained in:
parent
f734852127
commit
31c291dedf
@ -346,7 +346,7 @@
|
||||
case '学车报名':
|
||||
uni.navigateTo({
|
||||
url: '/newPages/schoolList/index'
|
||||
// url: '/pagesA/guideContent/index'
|
||||
// url: `/pagesA/guideContent/index?tenantId=${180}`
|
||||
});
|
||||
break;
|
||||
case '预约训练':
|
||||
|
@ -112,6 +112,7 @@
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
uni.setStorageSync('c1', res.code);
|
||||
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
@ -333,6 +334,8 @@
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
66
pagesA/components/header/guideHeaders.vue
Normal file
66
pagesA/components/header/guideHeaders.vue
Normal file
@ -0,0 +1,66 @@
|
||||
<template>
|
||||
|
||||
<view class="my-header">
|
||||
<view class="my-icons" @click="goback">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<view class="my-text">{{titles}}</view>
|
||||
<view class="my-icons"></view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
props: {
|
||||
titles: String
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
goback() {
|
||||
uni.switchTab({
|
||||
url: '/newPages/newIndex/index'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.my-header {
|
||||
width: 100%;
|
||||
height: 88px;
|
||||
// background: linear-gradient(180deg, #B2D2FC 0%, rgba(255, 255, 255, 0.84) 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #000;
|
||||
box-sizing: border-box;
|
||||
padding: 0px 15px;
|
||||
padding-top: 40px;
|
||||
z-index: 99999;
|
||||
background: white;
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
|
||||
.my-icons {
|
||||
width: 20px;
|
||||
|
||||
}
|
||||
|
||||
.my-text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
@ -152,11 +152,29 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.requestPushPermission()
|
||||
uni.navigateTo({
|
||||
url: `/pagesA/register/index?courseId=${this.courseDetails.id}&userId=${this.userDetails.id}&tenantId=${this.tenantId}`,
|
||||
// url: '/pages/index/bmPage'
|
||||
});
|
||||
},
|
||||
requestPushPermission() {
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ['CQpqLkmS2xk9Uz5J6tLoNuoaoHu_C7i6t7aCxtg_btc'],
|
||||
success: (res) => {
|
||||
if (res['CQpqLkmS2xk9Uz5J6tLoNuoaoHu_C7i6t7aCxtg_btc'] === 'accept') {
|
||||
console.log('用户同意接收推送');
|
||||
uni.setStorageSync('agreePush', true)
|
||||
} else {
|
||||
console.log('用户拒绝接收推送');
|
||||
uni.setStorageSync('agreePush', false)
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('请求授权失败', err);
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,16 +1,34 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar titleColor="rgba(0,0,0,0.9)" backgroundColor="#fff" title="业务办理指南"></VNavigationBar>
|
||||
<view style="width: 100%;background: #f4f5f6;box-sizing: border-box;padding-top: 88px;">
|
||||
<headers titles="驾校业务办理指南">
|
||||
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
|
||||
</headers>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="header">
|
||||
<u-empty v-if="!guideDetails || !guideDetails.guide" mode="data" icon="/static/imgs/noData.png"
|
||||
text="暂无指南内容">
|
||||
</u-empty>
|
||||
<template v-else>
|
||||
<view class="header">
|
||||
<view class="title line-clamp-3">{{ guideDetails.title }}</view>
|
||||
<view class="time" v-if="guideDetails.updateTime">
|
||||
{{ getCurrentDateTime(guideDetails.updateTime) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<u-parse :content="guideDetails.guide"></u-parse>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <view class="header">
|
||||
<view class="title line-clamp-3">{{ guideDetails.title }}</view>
|
||||
<view class="time" v-if="guideDetails.updateTime">{{ getCurrentDateTime(guideDetails.updateTime) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<u-parse :content="guideDetails.guide"></u-parse>
|
||||
<!-- <u-parse :content="test"></u-parse> -->
|
||||
</view>
|
||||
<!-- <u-parse :content="test"></u-parse>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -21,11 +39,13 @@
|
||||
} from "@/utils/auth";
|
||||
import VNavigationBar from '@/components/tabbar/VNavigationBar.vue'
|
||||
import request from '@/utils/request.js'
|
||||
import headers from "@/pagesA/components/header/guideHeaders.vue";
|
||||
|
||||
export default {
|
||||
name: "content",
|
||||
components: {
|
||||
VNavigationBar
|
||||
VNavigationBar,
|
||||
headers
|
||||
},
|
||||
filters: {
|
||||
formatRichText(html) {
|
||||
@ -39,11 +59,14 @@
|
||||
toUrl: null,
|
||||
tenantId: null,
|
||||
guideDetails: [],
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
console.log('data', data.tenantId)
|
||||
this.tenantId = data.tenantId
|
||||
console.log('tenantId', this.tenantId)
|
||||
this.getGuideByTenantId()
|
||||
},
|
||||
methods: {
|
||||
@ -52,8 +75,7 @@
|
||||
url: '/app-api/jx/driveSchool/smallProgram/guide/list',
|
||||
method: 'GET',
|
||||
params: {
|
||||
// tenantId: this.tenantId
|
||||
tenantId: '181'
|
||||
tenantId: this.tenantId
|
||||
}
|
||||
}).then(res => {
|
||||
const list = res.data || []
|
||||
@ -62,12 +84,18 @@
|
||||
this.guideDetails = list.length > 0 ? list[0] : null
|
||||
console.log('最新指南 guideDetails', this.guideDetails)
|
||||
console.log('更新时间 guideDetails', this.guideDetails.updateTime)
|
||||
}).catch(() => {
|
||||
this.guideDetails = null
|
||||
})
|
||||
},
|
||||
handleBack() {
|
||||
uni.switchTab({
|
||||
url: '/newPages/newIndex/index'
|
||||
});
|
||||
},
|
||||
// 格式化时间
|
||||
getCurrentDateTime() {
|
||||
const now = new Date();
|
||||
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
@ -76,7 +104,6 @@
|
||||
const seconds = String(now.getSeconds()).padStart(2, '0');
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
// return now;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -174,6 +174,9 @@
|
||||
getStaffType,
|
||||
getToken
|
||||
} from '../../utils/auth'
|
||||
import {
|
||||
sendSubscriptionMessage
|
||||
} from '@/pagesA/register/pushService.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -230,6 +233,7 @@
|
||||
localStaffType: null,
|
||||
localCoachId: null,
|
||||
userDetails: [],
|
||||
orderTime: null,
|
||||
columns: [
|
||||
[{
|
||||
label: '全款',
|
||||
@ -303,6 +307,7 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
sendSubscriptionMessage,
|
||||
// 定金价格 or 全款价格
|
||||
updateDisplayPrice() {
|
||||
this.currentPrice = this.selectedPayType === 1 ?
|
||||
@ -599,6 +604,8 @@
|
||||
time: this.getCurrentDateTime(),
|
||||
endTime: this.getEndTime(),
|
||||
};
|
||||
this.orderTime = contractData.time,
|
||||
this.orderId = res.data
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData)) +
|
||||
'&callback=' + encodeURIComponent('handleContractSigned')
|
||||
@ -619,6 +626,7 @@
|
||||
})
|
||||
this.rightInfoList = res.data,
|
||||
this.currentPrice = this.rightInfoList.price;
|
||||
console.log('rightInfoList', this.rightInfoList)
|
||||
},
|
||||
|
||||
// 线下支付合同签署完成后调用的方法
|
||||
@ -910,19 +918,26 @@
|
||||
};
|
||||
|
||||
// 如果选择了教练,添加source和sourceUserId
|
||||
if (this.localCoachId && this.localStaffType == '01') {
|
||||
if (getCoachId() && this.localStaffType == '01') {
|
||||
studentData.source = '01';
|
||||
studentData.sourceUserId = getCoachId(); // 设置来源用户ID为员工ID
|
||||
this.sendMessages(this.name, this.rightInfoList.name, this.jlId)
|
||||
} else if (this.localCoachId && this.localStaffType == '02') {
|
||||
console.log('this.jlId01', this.jlId)
|
||||
} else if (getCoachId() && this.localStaffType == '02') {
|
||||
studentData.source = '02';
|
||||
studentData.sourceUserId = getCoachId(); // 设置来源用户ID为教练ID
|
||||
this.sendMessages(this.name, this.rightInfoList.name, getCoachId())
|
||||
console.log('this.jlId02', this.jlId)
|
||||
if (this.jlId === String(getCoachId())) {
|
||||
console.log('this.jlId03', this.jlId)
|
||||
this.autoAssignCoach()
|
||||
}
|
||||
|
||||
} else {
|
||||
studentData.source = '03'; // 自来客户
|
||||
this.sendMessages(this.name, this.rightInfoList.name, this.jlId)
|
||||
}
|
||||
|
||||
console.log('studentData', studentData)
|
||||
request({
|
||||
url: '/app-api/small/dl-drive-school-student/create',
|
||||
method: 'post',
|
||||
@ -930,6 +945,15 @@
|
||||
});
|
||||
|
||||
this.updateSysUsersNickName();
|
||||
const dynamicData = {
|
||||
tenantId: this.tenantId,
|
||||
name: this.name,
|
||||
courseName: this.rightInfoList.name,
|
||||
licenseType: this.rightInfoList.type,
|
||||
price: this.rightInfoList.price,
|
||||
orderTime: this.orderTime
|
||||
}
|
||||
this.sendSubscriptionMessage(dynamicData)
|
||||
},
|
||||
|
||||
// 修改users信息
|
||||
@ -1003,9 +1027,10 @@
|
||||
time: this.getCurrentDateTime(),
|
||||
endTime: this.getEndTime(),
|
||||
};
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
|
||||
})
|
||||
this.orderTime = contractData.time,
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
|
||||
})
|
||||
},
|
||||
|
||||
// 获取三年后的时间
|
||||
@ -1047,6 +1072,22 @@
|
||||
})
|
||||
},
|
||||
|
||||
// 教练自招,自动分配教练
|
||||
autoAssignCoach() {
|
||||
const process = {
|
||||
orderId: this.orderId,
|
||||
courseId: this.courseId,
|
||||
coachId: this.jlId,
|
||||
coachName: this.jlName,
|
||||
userName: this.name
|
||||
}
|
||||
request({
|
||||
url: '/app-api/process/autoAssignCoach',
|
||||
method: 'POST',
|
||||
data: process,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
57
pagesA/register/pushService.js
Normal file
57
pagesA/register/pushService.js
Normal file
@ -0,0 +1,57 @@
|
||||
// utils/sendSubscriptionMessage.js
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 发送订阅消息
|
||||
* @param {Object} dynamicData
|
||||
*/
|
||||
export async function sendSubscriptionMessage(dynamicData) {
|
||||
try {
|
||||
// 检查用户是否同意接收推送
|
||||
const agreePush = uni.getStorageSync('agreePush');
|
||||
if (!agreePush) {
|
||||
console.log('用户未同意推送消息');
|
||||
return;
|
||||
}
|
||||
|
||||
// 准备要推送的数据
|
||||
const messageData = {
|
||||
openid: uni.getStorageSync('userInfo').driverOpenId,
|
||||
templateId: 'CQpqLkmS2xk9Uz5J6tLoNuoaoHu_C7i6t7aCxtg_btc',
|
||||
page: `pagesA/guideContent/index?tenantId=${dynamicData.tenantId || ''}`,
|
||||
data: {
|
||||
// 学员姓名
|
||||
name4: {
|
||||
value: dynamicData.name || ''
|
||||
},
|
||||
// 报名班型
|
||||
thing6: {
|
||||
value: dynamicData.courseName || ''
|
||||
},
|
||||
// 驾照类型
|
||||
character_string12: {
|
||||
value: dynamicData.licenseType || ''
|
||||
},
|
||||
// 班型价格
|
||||
amount7: {
|
||||
value: dynamicData.price || ''
|
||||
},
|
||||
// 下单时间
|
||||
date1: {
|
||||
value: dynamicData.orderTime || ''
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 发送订阅消息
|
||||
await request({
|
||||
url: '/app-api/wxPush/message/sendOnce',
|
||||
method: 'post',
|
||||
data: messageData
|
||||
});
|
||||
|
||||
console.log('订阅消息发送成功');
|
||||
} catch (error) {
|
||||
console.error('发送订阅消息失败:', error);
|
||||
}
|
||||
}
|
BIN
static/imgs/noData.png
Normal file
BIN
static/imgs/noData.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Loading…
Reference in New Issue
Block a user