first commit
This commit is contained in:
1
芳林公司项目/zyhelp/pages/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
017ab9ee-092c-405c-8d98-c7218acd4e38
|
||||
1
芳林公司项目/zyhelp/pages/WorkOrder/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/WorkOrder/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
c538d608-402f-4061-93d6-6ecb6451ea1f
|
||||
139
芳林公司项目/zyhelp/pages/WorkOrder/WorkOrder.vue
Executable file
139
芳林公司项目/zyhelp/pages/WorkOrder/WorkOrder.vue
Executable file
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<view class="work_order">
|
||||
|
||||
<Header title="我的工单"></Header>
|
||||
|
||||
<div class="work_order_content">
|
||||
|
||||
<TipsTitle title="我的工单记录"></TipsTitle>
|
||||
|
||||
<div class="order_content">
|
||||
|
||||
<div v-if="MessageList.length != 0">
|
||||
<div class="order_l"
|
||||
@click="showOrderContent(index)"
|
||||
v-for="(item,index) in MessageList">
|
||||
|
||||
<div class="order_item">
|
||||
|
||||
<span class="iconfont">{{item.type == 1 ? '' : '' }}</span>
|
||||
|
||||
<div class="item_center">
|
||||
<div class="top">
|
||||
<text class="title">工单号:{{index + 1}}</text>
|
||||
<div class="time">{{item.add_time}}</div>
|
||||
</div>
|
||||
<div class="mess">{{item.info[0].desc}}</div>
|
||||
</div>
|
||||
|
||||
<div :class="item.type == 1 ? 'status error' : 'status success' ">
|
||||
{{item.type == 1 ? item.status : item.status }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="show_content" v-show="index == currentIndex">
|
||||
<uni-steps :options="item.info"
|
||||
@itemClick="ImageShow"
|
||||
direction="column"
|
||||
active-color="#bbb9b9"
|
||||
:active="1">
|
||||
</uni-steps>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<NoData v-else></NoData>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Header from '@/components/tpl/Header.vue'
|
||||
import TipsTitle from '@/components/tpl/TipsTitle.vue'
|
||||
import uniSteps from '@/components/uni-steps/uni-steps.vue'
|
||||
import NoData from '@/components/tpl/NoData.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Header,
|
||||
TipsTitle,
|
||||
uniSteps,
|
||||
NoData
|
||||
},
|
||||
created() {
|
||||
this.getUserMes()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentImageIndex: 0, // 预览图片显示第几个
|
||||
currentIndex: 0, // 默认打开的第一个留言
|
||||
MessageList: [],
|
||||
list: [ // 1 未回复 2 已回复
|
||||
{
|
||||
title: '工单1',
|
||||
time: '2020-04-24',
|
||||
status: 1,
|
||||
content: [
|
||||
{ // 第一个对象是用户反馈
|
||||
title: '用户',
|
||||
desc: '软件不能正常访问',
|
||||
imgArr: [ // 用户上传的两张图片地址
|
||||
{ imgUrl: 'https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/gh_33446d7f7a26_430.jpg' },
|
||||
{ imgUrl: 'https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/gh_33446d7f7a26_430.jpg' },
|
||||
]
|
||||
},
|
||||
{ // 这个是管理员的回复
|
||||
title: '管理员',
|
||||
desc: '软件正在更新',
|
||||
imgArr: "" // 管理员这边 imgArr 直接为空就行
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
async onShow(){
|
||||
await this.$utils.isLogin();
|
||||
},
|
||||
methods: {
|
||||
|
||||
ImageShow(item,index) {
|
||||
this.currentImageIndex = index;
|
||||
uni.previewImage({
|
||||
current: this.currentImageIndex,
|
||||
urls: item,
|
||||
indicator: 'default'
|
||||
});
|
||||
|
||||
console.log(item,index)
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取用户留言
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async getUserMes() {
|
||||
let res = await this.$http.userService.getUserMes({
|
||||
token: this.$utils.getLocalStorage("user_message").token
|
||||
});
|
||||
|
||||
this.MessageList = res.data;
|
||||
console.log(res.data)
|
||||
},
|
||||
showOrderContent(index) {
|
||||
this.currentIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import "../../common/less/page/WorkOrder.less";
|
||||
|
||||
</style>
|
||||
1
芳林公司项目/zyhelp/pages/feedback/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/feedback/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
abb82071-f857-45f3-9cdc-712b06def9d2
|
||||
286
芳林公司项目/zyhelp/pages/feedback/feedback.vue
Executable file
286
芳林公司项目/zyhelp/pages/feedback/feedback.vue
Executable file
@@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<view class="feedback">
|
||||
<Header :title="PageTitle"></Header>
|
||||
<div class="feedback_content">
|
||||
<TipsTitle v-if="isShowList" title="选择问题类型"></TipsTitle>
|
||||
|
||||
<div class="problem" v-if="isShowList">
|
||||
<uniBadge
|
||||
v-for="(item,index) in MesType"
|
||||
:key="index"
|
||||
:text="item.name"
|
||||
@click="MesClick(index)"
|
||||
:type="index == currentProblemIndex ? 'primary' : 'default' ">
|
||||
|
||||
</uniBadge>
|
||||
</div>
|
||||
|
||||
<TipsTitle title="具体问题描述"></TipsTitle>
|
||||
|
||||
<textarea placeholder="请认真描述你的问题,客服会在第一时间与你取得联系!"
|
||||
class="user_mess"
|
||||
maxlength="200"
|
||||
@blur="bindTextAreaBlur"/>
|
||||
|
||||
<TipsTitle title="上传相关图片"></TipsTitle>
|
||||
|
||||
<div class="uploadImage">
|
||||
|
||||
<view class="uni-padding-wrap uni-common-mt"
|
||||
v-for="(item, index) in FileImage"
|
||||
:key="index">
|
||||
<view class="demo">
|
||||
<block v-if="item.imgUrl">
|
||||
<image :src="item.imgUrl" class="image" mode="aspectFit"></image>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="uni-hello-addfile" @click="chooseImage(index)">
|
||||
<view>+</view>
|
||||
<view>上传照片</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <TipsTitle title="您的联系方式"></TipsTitle>-->
|
||||
|
||||
<!-- <div class="user_phone">-->
|
||||
<!-- <span class="iconfont"></span>-->
|
||||
<!-- <input class="phone"-->
|
||||
<!-- @input="PhoneChange"-->
|
||||
<!-- maxlength="11"-->
|
||||
<!-- type="text"-->
|
||||
<!-- placeholder="请输入联系方式,方便我们联系您">-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="button_submit" @click="submitRequest">
|
||||
提交
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Header from '@/components/tpl/Header.vue'
|
||||
import TipsTitle from '@/components/tpl/TipsTitle.vue'
|
||||
import uniBadge from "@/components/uni-badge/uni-badge.vue"
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Header,
|
||||
TipsTitle,
|
||||
uniBadge
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShowList: true, //
|
||||
PageTitle: '', // 网页的标题
|
||||
type: 1, // 类型:1,意见反馈 2,联系客服
|
||||
MesType: [], // 问题类型的数组
|
||||
currentProblemIndex: 0, // 当前默认选中第一个问题
|
||||
detailedProblem: "", //详细问题
|
||||
userPhone: '', // 用户手机号
|
||||
FileImageList: {}, // 保存需要上传给后端的两张图片的地址,以对象格式
|
||||
FileImage: [
|
||||
{ imgUrl: '' }
|
||||
]
|
||||
};
|
||||
},
|
||||
async onShow(){
|
||||
await this.$utils.isLogin();
|
||||
},
|
||||
async created() {
|
||||
await this.$utils.isLogin();
|
||||
this.getMesType();
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.hasOwnProperty("title")
|
||||
&& option.hasOwnProperty("type")) {
|
||||
this.PageTitle = option.title
|
||||
this.type = option.type
|
||||
this.type == 1 ? this.isShowList = false : this.isShowList = true
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
this.imageSrc = '';
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 提交建议
|
||||
*/
|
||||
async submitRequest() {
|
||||
if (this.detailedProblem.length == 0) {
|
||||
uni.showToast({
|
||||
title: '具体描述不能为空!',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
|
||||
// 请求需要的参数
|
||||
let params = {
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
type: '',
|
||||
img1: '',
|
||||
img2: '',
|
||||
telnum: this.$utils.getLocalStorage("__DC_STAT_PID"),
|
||||
content: this.detailedProblem
|
||||
}
|
||||
|
||||
// type == 1 从 意见反馈 反馈进来,所以不需要type,为 0
|
||||
if (this.type == 1) {
|
||||
params.type = 0
|
||||
} else {
|
||||
params.type = this.MesType[this.currentProblemIndex].id
|
||||
}
|
||||
|
||||
// 如果上传了第一张图,那么添加图片地址
|
||||
if (this.FileImageList.hasOwnProperty("img1")) {
|
||||
params.img1 = this.FileImageList.img1
|
||||
}
|
||||
|
||||
// 如果上传了第二张图,那么添加图片地址
|
||||
if (this.FileImageList.hasOwnProperty("img2")) {
|
||||
params.img2 = this.FileImageList.img2
|
||||
}
|
||||
|
||||
let res = await this.$http.userService.addMessage(params)
|
||||
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon: 'none',
|
||||
complete: () => {
|
||||
setTimeout( ()=> {
|
||||
this.$utils.backPage()
|
||||
}, 2100)
|
||||
}
|
||||
});
|
||||
|
||||
// // 置空默认选中的问题
|
||||
// this.currentProblemIndex = 0
|
||||
// // 置空具体问题描述
|
||||
// this.detailedProblem
|
||||
// // 置空上传图片
|
||||
// this.FileImage = [ { imgUrl: '' }, { imgUrl: '' } ]
|
||||
// // 置空联系方式
|
||||
// this.userPhone = ""
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取所有的问题类型
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async getMesType() {
|
||||
let res = await this.$http.userService.getMesType();
|
||||
this.MesType = res.data
|
||||
},
|
||||
|
||||
/**
|
||||
* 为问题绑定点击事件
|
||||
* @constructor
|
||||
*/
|
||||
MesClick(index) {
|
||||
this.currentProblemIndex = index
|
||||
},
|
||||
|
||||
PhoneChange(event) {
|
||||
this.userPhone = event.detail.value
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取输入框的内容
|
||||
*/
|
||||
bindTextAreaBlur(event) {
|
||||
this.detailedProblem = event.detail.value
|
||||
},
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
*/
|
||||
uploadImage(imageSrc,index) {
|
||||
uni.uploadFile({
|
||||
url: this.$config.baseUrl + '/uploads',
|
||||
filePath: imageSrc,
|
||||
fileType: 'image',
|
||||
name: 'imageName',
|
||||
header: {
|
||||
token: this.$utils.getLocalStorage("user_message").token
|
||||
},
|
||||
success: (res) => {
|
||||
// 保存数据
|
||||
if (index == 0) {
|
||||
this.FileImageList.img1 = JSON.parse(res.data).data
|
||||
} else if(index == 1){
|
||||
this.FileImageList.img2 = JSON.parse(res.data).data
|
||||
}
|
||||
|
||||
// 显示预览地址
|
||||
this.FileImage[index].imgUrl = imageSrc
|
||||
|
||||
this.FileImage.push({ imgUrl: '' })
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showModal({
|
||||
content: err.errMsg,
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择图片
|
||||
* @param index
|
||||
*/
|
||||
chooseImage(index) {
|
||||
if (this.FileImage.length > 2) {
|
||||
uni.showToast({
|
||||
title: '只能上传两张',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
return new Promise((resolve, reject)=> {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: ['album'],
|
||||
success: (res) => {
|
||||
this.uploadImage(res.tempFilePaths[0],index)
|
||||
},
|
||||
fail: (err) => {
|
||||
// #ifdef MP
|
||||
uni.getSetting({
|
||||
success: (res) => {
|
||||
let authStatus = res.authSetting['scope.album'];
|
||||
if (!authStatus) {
|
||||
uni.showModal({
|
||||
title: '授权失败',
|
||||
content: '需要从您的相册获取图片,请在设置界面打开相关权限',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.openSetting()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import "../../common/less/page/feedback.less";
|
||||
</style>
|
||||
1
芳林公司项目/zyhelp/pages/index/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/index/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
e34ffb6f-9898-492a-a8e9-da52ab25eb06
|
||||
2264
芳林公司项目/zyhelp/pages/index/index.vue
Executable file
2264
芳林公司项目/zyhelp/pages/index/index.vue
Executable file
File diff suppressed because it is too large
Load Diff
1
芳林公司项目/zyhelp/pages/login/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/login/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
6a874d63-5084-4d35-a1b9-4c0557b493c7
|
||||
205
芳林公司项目/zyhelp/pages/login/login.vue
Executable file
205
芳林公司项目/zyhelp/pages/login/login.vue
Executable file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<navigation title="返回"></navigation>
|
||||
<div class="login_page">
|
||||
<h2>您好,欢迎登录聚志愿</h2>
|
||||
<div class="user_phone">
|
||||
<input type="number" maxlength="11" v-model="UserMessage.telnum" placeholder="请输入手机号">
|
||||
</div>
|
||||
<div class="user_code">
|
||||
<input v-model="UserMessage.code" maxlength="4" type="number" placeholder="请输入验证码"/>
|
||||
<div :class="ProhibitCode ? 'getcode disable' : 'getcode' " @click="getSmsCode">{{ codeText }}</div>
|
||||
</div>
|
||||
|
||||
<button type="primary" @click="SubmitLogin" class="login_submit">登 录</button>
|
||||
|
||||
<div class="Agreement_consent">
|
||||
<div
|
||||
@click="saveChiooseAgreement = !saveChiooseAgreement"
|
||||
:class="saveChiooseAgreement ? 'yes check' : 'check' ">
|
||||
|
||||
</div>
|
||||
<text>
|
||||
登录即表示同意《<text class="xy">聚志愿用户协议</text>》
|
||||
</text>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navigation from '@/components/tpl/navigation.vue'
|
||||
export default {
|
||||
components: {
|
||||
navigation
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
vipType: false,
|
||||
PreviousPage: null,
|
||||
cache: null,
|
||||
countdown: 60, // 倒计时时间
|
||||
timer: '', // 保存计时器
|
||||
codeText: '获取验证码', // 提示文字
|
||||
ProhibitCode: false, // true 发送过,false 没法送
|
||||
saveChiooseAgreement: true, // 保存当前是否同意的状态
|
||||
UserMessage: { // 保存用户登录信息
|
||||
telnum: '',
|
||||
code: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
async onLoad(option) {
|
||||
if (this.$utils.checkLogin()) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
if (option.hasOwnProperty("type")) {
|
||||
this.vipType = option.type
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
async SubmitLogin() {
|
||||
|
||||
if (this.UserMessage.telnum.length == 0
|
||||
|| this.UserMessage.code.length == 0
|
||||
|| this.saveChiooseAgreement == false) {
|
||||
|
||||
uni.showToast({
|
||||
title: '手机号,验证码不能为空',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
// 登录需要的参数
|
||||
let UserParams = this.$utils.getLocalStorage("user_input") || {
|
||||
subType: 0, // 1文科,2理科默认0
|
||||
score: 0, // 分数
|
||||
mySub: 0, // 新高考考生的科目和特殊高考科目默认0
|
||||
province: 0, // 省份real_code
|
||||
chooseLevel: 0, // 特殊高考的成绩对应mySub 默认0
|
||||
userPro: 0, // 考生所在省
|
||||
};
|
||||
|
||||
// 加密手机号
|
||||
UserParams.telnum = this.$utils.JSEncrypts(this.UserMessage.telnum);
|
||||
|
||||
// 保存用户手机号
|
||||
this.$utils.setLocalStorage("__DC_STAT_PID", UserParams.telnum)
|
||||
|
||||
// 验证码
|
||||
UserParams.code = this.UserMessage.code;
|
||||
|
||||
let res = await this.$http.loginService.appLogin(UserParams);
|
||||
let updateScore = "";
|
||||
|
||||
// 等于 0,新用户没有分数数据,跳转回智能填报页面
|
||||
if (res.data.score == 0) {
|
||||
console.log("++++++++++++++++++++++++ 新用户登录数据2 ++++++++++++++++++: ", res)
|
||||
this.$utils.setLocalStorage("user_message", res.data)
|
||||
|
||||
getApp().globalData.status.identity = 'new'
|
||||
getApp().globalData.status.action = 'needInput'
|
||||
|
||||
this.$utils.closedEnterPage("../startUp/startUp")
|
||||
|
||||
} else {
|
||||
|
||||
// 如果用户没有登录
|
||||
if( !(this.$utils.getLocalStorage("user_message")) ) {
|
||||
// 并且填过智能填报
|
||||
if(this.$utils.getLocalStorage("user_input")) {
|
||||
|
||||
console.log("++++++++++++++++++++++++ 用户没有登录 并且填过智能填报 ++++++++++++++++++++")
|
||||
|
||||
|
||||
let UserInput = this.$utils.getLocalStorage("user_input");
|
||||
let params = {
|
||||
token: res.data.token,
|
||||
subType: UserInput.subType,
|
||||
score: UserInput.score,
|
||||
mySub: UserInput.mySub,
|
||||
province: UserInput.province,
|
||||
chooseLevel: UserInput.chooseLevel
|
||||
};
|
||||
|
||||
updateScore = await this.$http.startUpService.modifyUser(params)
|
||||
|
||||
this.$utils.setLocalStorage("user_message", updateScore.data)
|
||||
|
||||
this.vipType ?
|
||||
this.$utils.closedEnterPage(`../payment/payment?type=${this.vipType}`)
|
||||
: this.$utils.closedEnterPage("../index/index")
|
||||
|
||||
|
||||
} else {
|
||||
console.log("跳转1")
|
||||
this.$utils.setLocalStorage("user_message", res.data)
|
||||
this.vipType ?
|
||||
this.$utils.closedEnterPage(`../payment/payment?type=${this.vipType}`)
|
||||
: this.$utils.closedEnterPage("../index/index")
|
||||
}
|
||||
} else {
|
||||
console.log("跳转2")
|
||||
this.$utils.setLocalStorage("user_message", res.data)
|
||||
this.vipType ?
|
||||
this.$utils.closedEnterPage(`../payment/payment?type=${this.vipType}`)
|
||||
: this.$utils.closedEnterPage("../index/index")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async getSmsCode() {
|
||||
// 如果没有发送过验证码
|
||||
if (!this.ProhibitCode) {
|
||||
// 如果没输入手机号
|
||||
if (this.UserMessage.telnum.length == 0) {
|
||||
uni.showToast({
|
||||
title: '手机号不能为空',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
// 输入过手机号
|
||||
} else {
|
||||
|
||||
let data = await this.$http.loginService.sendCode({
|
||||
telnum: this.$utils.JSEncrypts(this.UserMessage.telnum)
|
||||
});
|
||||
|
||||
if(data.status == 1) {
|
||||
this.ProhibitCode = true
|
||||
this.countDown()
|
||||
uni.showToast({
|
||||
title: data.msg,
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
console.log("data: ", data)
|
||||
}
|
||||
}
|
||||
},
|
||||
countDown() {
|
||||
this.timer = setInterval(() =>{
|
||||
this.countdown--
|
||||
this.codeText = this.countdown + 's'
|
||||
if(this.countdown === 0){
|
||||
clearInterval(this.timer)
|
||||
this.codeText = '获取验证码'
|
||||
this.countdown = 60
|
||||
this.ProhibitCode = false
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import "../../common/less/page/login.less";
|
||||
</style>
|
||||
1
芳林公司项目/zyhelp/pages/me/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/me/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
05a9ae6a-67bc-4d83-afe9-0326ea9985f0
|
||||
114
芳林公司项目/zyhelp/pages/me/me.vue
Executable file
114
芳林公司项目/zyhelp/pages/me/me.vue
Executable file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view class="me">
|
||||
<Header title="个人中心"></Header>
|
||||
<ul class="setting_list">
|
||||
<li @click="$utils.enterPage('../orderStatus/orderStatus')">
|
||||
<div class="list_left">
|
||||
<image src="http://static.geekhelp.cn/01.png" alt=""></image>
|
||||
<view class="setting_text">我的成绩</view>
|
||||
</div>
|
||||
<div class="list_right">
|
||||
<text>管理分数</text>
|
||||
<uni-icons type="forward" size="24"></uni-icons>
|
||||
</div>
|
||||
</li>
|
||||
<li @click="$utils.enterPage('../mySchool/mySchool?type=1&title=我的院校')">
|
||||
<div class="list_left">
|
||||
<image src="http://static.geekhelp.cn/02.png" alt=""></image>
|
||||
<view class="setting_text">我的院校</view>
|
||||
</div>
|
||||
<div class="list_right">
|
||||
<uni-icons type="forward" size="24"></uni-icons>
|
||||
</div>
|
||||
</li>
|
||||
<li @click="$utils.enterPage('../mySchool/mySchool?type=2&title=我的专业')">
|
||||
<div class="list_left">
|
||||
<image src="http://static.geekhelp.cn/03.png" alt=""></image>
|
||||
<view class="setting_text">我的专业</view>
|
||||
</div>
|
||||
<div class="list_right">
|
||||
<uni-icons type="forward" size="24"></uni-icons>
|
||||
</div>
|
||||
</li>
|
||||
<li @click="$utils.enterPage('../feedback/feedback?type=1&title=考生建议')">
|
||||
<div class="list_left">
|
||||
<image src="http://static.geekhelp.cn/004.png" alt=""></image>
|
||||
<view class="setting_text">考生建议</view>
|
||||
</div>
|
||||
<div class="list_right">
|
||||
<uni-icons type="forward" size="24"></uni-icons>
|
||||
</div>
|
||||
</li>
|
||||
<li @click="$utils.enterPage('../feedback/feedback?type=2&title=提交工单')">
|
||||
<div class="list_left">
|
||||
<image src="http://static.geekhelp.cn/005.png" alt=""></image>
|
||||
<view class="setting_text">提交工单</view>
|
||||
</div>
|
||||
<div class="list_right">
|
||||
<uni-icons type="forward" size="24"></uni-icons>
|
||||
</div>
|
||||
</li>
|
||||
<li @click="$utils.enterPage('../WorkOrder/WorkOrder')">
|
||||
<div class="list_left">
|
||||
<image src="http://static.geekhelp.cn/workorder.jpg" alt=""></image>
|
||||
<view class="setting_text">我的工单</view>
|
||||
</div>
|
||||
<div class="list_right">
|
||||
<uni-icons type="forward" size="24"></uni-icons>
|
||||
</div>
|
||||
</li>
|
||||
<li @click="logOutUser">
|
||||
<div class="list_left">
|
||||
<image src="http://static.geekhelp.cn/006.png" alt=""></image>
|
||||
<view class="setting_text">退出账户</view>
|
||||
</div>
|
||||
<div class="list_right">
|
||||
<uni-icons type="forward" ></uni-icons>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<CustomerService></CustomerService>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomerService from '@/components/tpl/CustomerService.vue'
|
||||
import Header from '@/components/tpl/Header.vue'
|
||||
export default {
|
||||
components: {
|
||||
CustomerService,
|
||||
Header
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
UserMessage: this.$utils.getLocalStorage("user_message")
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.$utils.isLogin();
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
logOutUser() {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '您确定退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.removeStorageSync('user_message');
|
||||
// uni.removeStorageSync('user_input');
|
||||
getApp().globalData.status = {}
|
||||
this.$utils.closedEnterPage("../startUp/startUp")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import url("../../common/less/page/me.less");
|
||||
</style>
|
||||
1
芳林公司项目/zyhelp/pages/mySchool/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/mySchool/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
8cf93cdf-000f-417e-9b87-bdf12279ffe9
|
||||
320
芳林公司项目/zyhelp/pages/mySchool/mySchool.vue
Executable file
320
芳林公司项目/zyhelp/pages/mySchool/mySchool.vue
Executable file
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<view class="MySchool">
|
||||
<Header :title="NavTitle">
|
||||
<view v-if="ScoreList.length != 0" class="select_score" slot="action">
|
||||
<picker @change="bindPickerChange" :value="currentSelectScore" :range="ScoreList">
|
||||
<view class="uni-input">{{ScoreList[currentSelectScore]}}</view>
|
||||
</picker>
|
||||
<span class="iconfont"></span>
|
||||
</view>
|
||||
</Header>
|
||||
<div class="MySchool_content">
|
||||
|
||||
<!--院校: 普通高考院校 & 新高考院校-->
|
||||
<div class="school" v-if="type == 1">
|
||||
<!--新高考院校-->
|
||||
<ListItem v-if="$utils.checkNewTest()"
|
||||
:list="myNewSchList"
|
||||
@RemoveLike="removeMyNewSch"
|
||||
:showDown="false">
|
||||
|
||||
</ListItem>
|
||||
|
||||
<!--普通高考院校-->
|
||||
<ListItem v-else
|
||||
:list="SchoolList"
|
||||
:showDown="false"
|
||||
@RemoveLike="RemoveLike">
|
||||
|
||||
</ListItem>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--我的专业-->
|
||||
<div v-else-if="type == 2">
|
||||
|
||||
<!--新高考专业-->
|
||||
<ListItem v-if="$utils.checkNewTest()"
|
||||
@RemoveLike="removeNewMajor"
|
||||
:list="myNewMajorList">
|
||||
</ListItem>
|
||||
|
||||
<!--普通高考专业-->
|
||||
<div v-else>
|
||||
<div v-if="MajorList.length != 0">
|
||||
<MajorItem v-for="(item,index) in MajorList" :item="item" :key="index">
|
||||
|
||||
<template v-slot:action>
|
||||
<view :class="item.is_collect == 1 ? 'yj_like like' : 'like' "
|
||||
@tap="removeMajorLike(item)">
|
||||
<span v-if="item.is_collect == 0" class="iconfont"></span>
|
||||
<text> {{ item.is_collect == 1 ? '已收藏' : item.is_collect == 2 ? '移除' : '收藏' }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-slot:shctitle>
|
||||
<div class="m_school_title">{{item.sch_name}}</div>
|
||||
</template>
|
||||
|
||||
</MajorItem>
|
||||
</div>
|
||||
|
||||
<NoData v-else>
|
||||
<Loading></Loading>
|
||||
</NoData>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Header from '@/components/tpl/Header.vue'
|
||||
import ListItem from '@/components/tpl/ListItem.vue'
|
||||
import MajorItem from '@/components/tpl/Major.vue'
|
||||
import NoData from '@/components/tpl/NoData.vue'
|
||||
import Loading from "@/components/tpl/Loading.vue"
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Header,
|
||||
ListItem,
|
||||
MajorItem,
|
||||
NoData,
|
||||
Loading
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentSelectScore: 0,
|
||||
ScoreList: [],
|
||||
NavTitle: '', //网页标题
|
||||
myNewSchList: [],
|
||||
myNewMajorList: [],
|
||||
SchoolListPage: 1,
|
||||
MajorListPage: 1,
|
||||
SchoolList: [], // 保存院校数据
|
||||
MajorList: [], // 保存专业数据
|
||||
type: 1, // 1 查看我的院校 2 查看我的专业
|
||||
};
|
||||
},
|
||||
async onLoad(option) {
|
||||
await this.$utils.isLogin();
|
||||
// 顶部的标题
|
||||
this.NavTitle = option.title
|
||||
this.type = option.type
|
||||
this.getScoreGradeList()
|
||||
// 院校
|
||||
if (this.type == 1) {
|
||||
// 新高考的院校
|
||||
if (this.$utils.checkNewTest()) {
|
||||
this.myNewSch()
|
||||
|
||||
// 普通高考的院校
|
||||
} else {
|
||||
this.myCollectSch()
|
||||
}
|
||||
|
||||
// 专业
|
||||
} else {
|
||||
// 新高考的专业
|
||||
if (this.$utils.checkNewTest()) {
|
||||
this.myNewMajor()
|
||||
|
||||
// 普通高考的专业
|
||||
} else {
|
||||
this.myCollectMajor()
|
||||
}
|
||||
}
|
||||
},
|
||||
async onShow(){
|
||||
await this.$utils.isLogin();
|
||||
},
|
||||
methods: {
|
||||
|
||||
async getScoreGradeList() {
|
||||
let res = await this.$http.userService.getScoreGrade({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
is_sch: this.type == 1 ? 1 : 0,
|
||||
provinceType: this.$utils.getLocalStorage("user_message").provinceType,
|
||||
userPro: this.$utils.getLocalStorage("user_message").userPro
|
||||
});
|
||||
// 将对象转换为数组保存
|
||||
res.data.forEach(val => this.ScoreList.push(val.score))
|
||||
res.data.length != 0 ? this.ScoreList.unshift("全部分数") : 0
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 下拉选择分数,查询对应分数段的成绩
|
||||
*/
|
||||
bindPickerChange(e) {
|
||||
this.currentSelectScore = e.target.value
|
||||
let currentScore = this.ScoreList[this.currentSelectScore];
|
||||
// 表示查询全部数据
|
||||
if (this.currentSelectScore == 0) {
|
||||
this.type == 1
|
||||
? this.$utils.checkNewTest() ? this.myNewSch(0) : this.myCollectSch(0)
|
||||
: this.$utils.checkNewTest() ? this.myNewMajor(0) : this.myCollectMajor(0)
|
||||
} else {
|
||||
this.type == 1
|
||||
? this.$utils.checkNewTest() ? this.myNewSch(currentScore) : this.myCollectSch(currentScore)
|
||||
: this.$utils.checkNewTest() ? this.myNewMajor(currentScore) : this.myCollectMajor(currentScore)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取 新高考收藏的院校
|
||||
*/
|
||||
async myNewSch(score = 0) {
|
||||
let res = await this.$http.userService.myNewSch({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
userPro: this.$utils.getLocalStorage("user_message").userPro,
|
||||
score: score,
|
||||
page: 1
|
||||
});
|
||||
res.data.res.forEach(val => val.is_collect = 2)
|
||||
res.data.res.forEach(val => val.tags = val.tags.split(","))
|
||||
this.myNewSchList = res.data.res
|
||||
},
|
||||
/**
|
||||
* 移除 新高考收藏的院校
|
||||
*/
|
||||
async removeMyNewSch(item,index) {
|
||||
let res = await this.$http.userService.delNewSch({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
id: item.id
|
||||
});
|
||||
|
||||
console.log("移除 新高考收藏的院校: ", res);
|
||||
this.myNewSchList.splice(index,1)
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// TODO ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* 获取 新高考收藏的专业
|
||||
*/
|
||||
async myNewMajor(score = 0) {
|
||||
let res = await this.$http.userService.myNewMajor({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
userPro: this.$utils.getLocalStorage("user_message").userPro,
|
||||
score: score,
|
||||
page: 1
|
||||
});
|
||||
res.data.res.forEach(val => val.is_collect = 2)
|
||||
res.data.res.forEach(val => val.tags = val.tags.split(","))
|
||||
this.myNewMajorList = res.data.res
|
||||
},
|
||||
/**
|
||||
* 移除 新高考收藏的专业
|
||||
*/
|
||||
async removeNewMajor(item,index) {
|
||||
let res = await this.$http.userService.delNewMajor({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
id: item.id
|
||||
});
|
||||
|
||||
console.log("移除 新高考收藏的院校: ", res);
|
||||
this.myNewMajorList.splice(index,1)
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
|
||||
// TODO ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* 获取 普通高考收藏的院校
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async myCollectSch(score = 0) {
|
||||
let res = await this.$http.userService.myCollectSch({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
userPro: this.$utils.getLocalStorage("user_message").userPro,
|
||||
score: score,
|
||||
page: this.SchoolListPage
|
||||
});
|
||||
|
||||
this.SchoolList = res.data.data
|
||||
this.SchoolList.forEach(val => val.is_collect = 2)
|
||||
this.SchoolList.forEach(val => val.tags = val.tags.split(" "))
|
||||
},
|
||||
/**
|
||||
* 移除 普通高考收藏的院校
|
||||
* @param item
|
||||
* @constructor
|
||||
*/
|
||||
async RemoveLike(item,index) {
|
||||
let res = await this.$http.userService.delUserCollect({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
id: item.id
|
||||
});
|
||||
|
||||
this.SchoolList.splice(index,1)
|
||||
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// TODO ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* 获取 普通高考收藏的专业
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async myCollectMajor(score = 0) {
|
||||
let res = await this.$http.userService.myCollectMajor({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
userPro: this.$utils.getLocalStorage("user_message").userPro,
|
||||
score: score,
|
||||
page: this.MajorListPage
|
||||
});
|
||||
|
||||
this.MajorList = res.data.res
|
||||
console.log("this.MajorList: ", this.MajorList)
|
||||
this.MajorList.forEach(val => val.is_collect = 2)
|
||||
},
|
||||
/**
|
||||
* 移除 普通高考收藏的专业
|
||||
*/
|
||||
async removeMajorLike(item,index) {
|
||||
let res = await this.$http.userService.delUserMajor({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
id: item.id
|
||||
});
|
||||
|
||||
this.MajorList.splice(index,1)
|
||||
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import "../../common/less/page/mySchool.less";
|
||||
</style>
|
||||
1
芳林公司项目/zyhelp/pages/orderStatus/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/orderStatus/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
def7a9aa-63df-4869-99c3-3e04a0a7cc84
|
||||
161
芳林公司项目/zyhelp/pages/orderStatus/orderStatus.vue
Executable file
161
芳林公司项目/zyhelp/pages/orderStatus/orderStatus.vue
Executable file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div class="order_status">
|
||||
<Header title="我的成绩">
|
||||
<view class="add_score" slot="action" @click="editScore">
|
||||
<span class="iconfont"></span>
|
||||
<text>测算新分数</text>
|
||||
</view>
|
||||
</Header>
|
||||
<div class="order_status_content">
|
||||
|
||||
<!--当前使用分数-->
|
||||
<TipsTitle title="当前使用分数"></TipsTitle>
|
||||
|
||||
<div class="score_item">
|
||||
<text class="score">{{UserInfo.proName}} {{UserInfo.subTypeName || UserInfo.subName}} {{UserInfo.score}}分</text>
|
||||
<text class="tips">当前分数</text>
|
||||
</div>
|
||||
|
||||
<!--未支付分数-->
|
||||
<TipsTitle title="未支付分数"></TipsTitle>
|
||||
|
||||
<div class="NoPayOrder" v-if="NoPayOrder.length != 0">
|
||||
<div class="score_item" @click="useOrder(item)" v-for="(item,index) in NoPayOrder">
|
||||
<text class="score">{{item.province_title}} {{item.subTypeName || item.subName}} {{item.score}}分</text>
|
||||
<text class="tips" @click.stop="againPlay(item)">点击支付</text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="error" v-else>
|
||||
暂无数据
|
||||
</div>
|
||||
|
||||
|
||||
<!--已支付分数-->
|
||||
<TipsTitle title="已支付分数"></TipsTitle>
|
||||
|
||||
<div class="PayOrder" v-if="PayOrder.length != 0">
|
||||
<div @click="useOrder(item)" class="score_item" v-for="(item,index) in PayOrder">
|
||||
<text class="score">{{ item.province_title }} {{ item.subTypeName || item.subName }} {{ item.score }}</text>
|
||||
<ul class="status">
|
||||
<li :class=" item.vip.toString().includes(1) ? '' : 'no' ">算</li>
|
||||
<li :class=" item.vip.toString().includes(2) ? '' : 'no' ">筛</li>
|
||||
<li :class=" item.vip.toString().includes(3) ? '' : 'no' ">专</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="error" v-else>
|
||||
暂无数据
|
||||
</div>
|
||||
|
||||
|
||||
<CustomerService></CustomerService>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Header from '@/components/tpl/Header.vue'
|
||||
import TipsTitle from '@/components/tpl/TipsTitle.vue'
|
||||
import CustomerService from '@/components/tpl/CustomerService.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Header,
|
||||
TipsTitle,
|
||||
CustomerService
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
UserInfo: { proName: '' },
|
||||
createdOrder: { // 下单的参数
|
||||
is_login: 0, // 是否登录用户
|
||||
token: '', // 用户token,登录是必须要
|
||||
telnum: '', // rsa加密后的手机号(用户未登录情况下必填)
|
||||
subType: 0, // 1文科,2理科默认0
|
||||
score: 0, // 分数
|
||||
mySub: 0, // 新高考考生的科目和特殊高考科目默认0
|
||||
userPro: 0, // 考生所在省
|
||||
province: "", // 省份real_code 当用户未登录的时候必填
|
||||
chooseLevel: 0, // 特殊高考的成绩对应mySub 默认0
|
||||
vip_type: 1 // 购买会员类型
|
||||
},
|
||||
NoPayOrder: [], // 未付款订单
|
||||
PayOrder: [] // 付款的订单
|
||||
}
|
||||
},
|
||||
async onShow() {
|
||||
await this.$utils.isLogin();
|
||||
this.UserInfo = this.$utils.getLocalStorage("user_message");
|
||||
this.getMyOrder()
|
||||
},
|
||||
methods: {
|
||||
|
||||
editScore() {
|
||||
getApp().globalData.status.identity = 'new'
|
||||
getApp().globalData.status.action = 'needInput'
|
||||
uni.navigateTo({
|
||||
url: '../startUp/startUp?action=add'
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击已支付分数的使用,使用已支付分数
|
||||
*/
|
||||
async useOrder(item) {
|
||||
console.log(item)
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '点击【确定】使用该分数作为默认查询的条件!',
|
||||
success: async res => {
|
||||
if (res.confirm) {
|
||||
|
||||
// 保存数据到userinput 中
|
||||
let userInput = this.$utils.getUserInput() || this.$utils.getLocalStorage("user_message");
|
||||
userInput.mySub = item.mykemu;
|
||||
this.$utils.setLocalStorage("user_input", userInput)
|
||||
|
||||
let UpdateInfo = {}
|
||||
UpdateInfo.token = this.UserInfo.token
|
||||
UpdateInfo.subType = item.wenli
|
||||
UpdateInfo.score = item.score
|
||||
UpdateInfo.mySub = item.mykemu
|
||||
UpdateInfo.province = item.stu_province / 10000
|
||||
UpdateInfo.chooseLevel = this.UserInfo.chooseLevel
|
||||
|
||||
let res = await this.$http.startUpService.modifyUser(UpdateInfo);
|
||||
res.data.subTypeName = item.subTypeName
|
||||
|
||||
this.$utils.setLocalStorage("user_message", res.data)
|
||||
this.$utils.enterPage("../index/index")
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 点击支付 按钮的点击事件
|
||||
*/
|
||||
againPlay(item) {
|
||||
this.$utils.enterPage(`../payment/payment?type=${item.vip}&item=${JSON.stringify(item)}`)
|
||||
},
|
||||
/**
|
||||
* 获取订单
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async getMyOrder() {
|
||||
let res = await this.$http.userService.myOrders({
|
||||
token: this.$utils.getLocalStorage("user_message").token
|
||||
});
|
||||
this.NoPayOrder = res.data.NoPayOrder
|
||||
this.PayOrder = res.data.payOrder
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import "../../common/less/page/orderStatus.less";
|
||||
|
||||
</style>
|
||||
1
芳林公司项目/zyhelp/pages/payment/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/payment/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
8e64f6cd-bada-4d88-8f0d-9ad09a6043fe
|
||||
482
芳林公司项目/zyhelp/pages/payment/payment.vue
Executable file
482
芳林公司项目/zyhelp/pages/payment/payment.vue
Executable file
@@ -0,0 +1,482 @@
|
||||
<template>
|
||||
<view class="payment">
|
||||
<Header title="支付页面"></Header>
|
||||
<div class="payment_content">
|
||||
|
||||
<TipsTitle title="温馨提示"></TipsTitle>
|
||||
|
||||
<ul class="tips_content">
|
||||
<li>支付前请确认省份、文理科、成绩,购买后不可更改</li>
|
||||
<li>本系统不支持艺术与体育生使用</li>
|
||||
<li>购买的服务有效期至2019年9月31日</li>
|
||||
</ul>
|
||||
|
||||
<TipsTitle title="购买分数"></TipsTitle>
|
||||
|
||||
<!--购买权限为1的时候才允许编辑-->
|
||||
<div v-if="payType == 1" class="buy_score">
|
||||
|
||||
<div class="location score_item" @click="openAddress">
|
||||
<span class="iconfont"></span>
|
||||
<text>{{currentCity.title}}</text>
|
||||
</div>
|
||||
|
||||
<div class="score score_item"
|
||||
@click="showEdit = !showEdit"
|
||||
v-if="showEdit">
|
||||
{{ currentCity.score || UserMessage.score }} 分
|
||||
</div>
|
||||
|
||||
<input class="new_num"
|
||||
focus="true"
|
||||
@blur="ChangeEdit"
|
||||
type="number" v-else placeholder="新分数">
|
||||
|
||||
|
||||
<div class="city_project" v-if="isShowNewsTets">
|
||||
<radio-group @change="radioChange" class="radioF">
|
||||
<label class="uni-list-cell uni-list-cell-pd radio_item"
|
||||
v-for="(item, index) in LiberalArts" :key="index">
|
||||
<radio color="#1b78fa" :value="item.code" :checked="index === currentRadioChioose" />
|
||||
<view>{{item.title}}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</div>
|
||||
|
||||
<div class="city_project" v-else>{{ currentCity.subName }}</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-else class="buy_score">
|
||||
<div class="location score_item">
|
||||
<span class="iconfont"></span>
|
||||
<text>{{currentCity.title}}</text>
|
||||
</div>
|
||||
|
||||
<div class="score score_item">
|
||||
{{ currentCity.score || UserMessage.score }} 分
|
||||
</div>
|
||||
|
||||
<div class="score_item">
|
||||
{{LiberalArts[currentRadioChioose].title}}
|
||||
</div>
|
||||
|
||||
<div class="score_item tips">
|
||||
{{ payType == 2 ? '筛选权限' : '专业权限' }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="buy_score_tips">
|
||||
{{ payType == 1 ? '当前购买仅为院校概率测算,不包含院校筛选和专业分数线' : payType == 2 ? '当前购买权限为院校筛选' : '当前购买权限为专业分数线查询' }}
|
||||
</div>
|
||||
|
||||
<div class="pay_monkey">
|
||||
<text class="message">付款金额</text>
|
||||
<text class="monkey">¥ {{ payType == 1 ? 29.9 : payType == 2 ? 9.9 : payType == 3 ? 19.9 : '' }}</text>
|
||||
</div>
|
||||
|
||||
<div class="pay_type">
|
||||
<div class="pay_button_weixin" @click="checkUserLoginStatus('weixin')">
|
||||
<span class="iconfont"></span>
|
||||
<text>微信支付</text>
|
||||
</div>
|
||||
<div class="pay_button_alipay" @click="checkUserLoginStatus('alipay')">
|
||||
<span class="iconfont"></span>
|
||||
<text>支付宝支付</text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<AddressPopup :address="address" @itemChange="addressChoice" ref="AddressPopup"></AddressPopup>
|
||||
|
||||
<div v-html="formPay"></div>
|
||||
|
||||
<uni-popup class="weixin_pay" ref="showimage" type="center" :mask-click="false">
|
||||
<view class="uni-image">
|
||||
<image class="image" :src="payWeixQrCode" mode="scaleToFill" />
|
||||
<view class="uni-image-close" @click="cancelPlay()">
|
||||
<uni-icons type="clear" color="#fff" size="30" />
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Header from '@/components/tpl/Header.vue'
|
||||
import CustomerService from '@/components/tpl/CustomerService.vue'
|
||||
import TipsTitle from '@/components/tpl/TipsTitle.vue'
|
||||
import AddressPopup from "@/components/tpl/AddressPopup.vue"
|
||||
import QR from "../../static/js/wxqrcode.js"
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Header,
|
||||
CustomerService,
|
||||
TipsTitle,
|
||||
AddressPopup,
|
||||
uniPopup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkTimePay: '', // 保存轮询的定时器
|
||||
payWeixQrCode: '', // 微信pc支付二维码数据
|
||||
isShowNewsTets: true,
|
||||
formPay: "", // 保存支付宝支付的form表单代码
|
||||
currentRadioChioose: 0, // 默认文科选中
|
||||
LiberalArts: [ // 文理科单选
|
||||
{code: "1", title: '文科'},
|
||||
{code: "2", title: '理科'}
|
||||
],
|
||||
currentCity: {
|
||||
title: ''
|
||||
}, // 当前城市
|
||||
UserMessage: {}, // 本地的用户信息
|
||||
showEdit: true, // 是否显示编辑新分数的文本框
|
||||
userInputPhone: "", // 用户手机号
|
||||
payType: "", // 保存地址栏支付类型
|
||||
orderStatus: {}, // 保存下单后的订单数据
|
||||
OrderParams: {
|
||||
is_login: 0, // 是否登录用户
|
||||
token: '', // 用户token,登录是必须要
|
||||
telnum: '', // rsa加密后的手机号(用户未登录情况下必填)
|
||||
subType: 0, // 1文科,2理科默认0
|
||||
score: 0, // 分数
|
||||
mySub: 0, // 新高考考生的科目和特殊高考科目默认0
|
||||
userPro: 0, // 考生所在省
|
||||
province: "", // 省份real_code 当用户未登录的时候必填
|
||||
chooseLevel: 0, // 特殊高考的成绩对应mySub 默认0
|
||||
vip_type: 1 // 购买会员类型
|
||||
},
|
||||
address: [] // 从本地读出来的地址
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.UserMessage = this.$utils.getLocalStorage("user_message");
|
||||
this.address = this.$utils.getLocalStorage("address");
|
||||
this.address.forEach((val,index) => {
|
||||
if (val.title == '西藏') {
|
||||
this.address.splice(index,1)
|
||||
}
|
||||
})
|
||||
|
||||
this.currentCity = this.UserMessage
|
||||
this.currentCity.title = this.currentCity.proName
|
||||
|
||||
this.payType = option.type
|
||||
// 判断是否有item,如果有表示从 我的成绩 购买未支付成绩进来的
|
||||
if (option.hasOwnProperty("item")) {
|
||||
let againParams = JSON.parse(option.item)
|
||||
againParams.title = againParams.province_title
|
||||
this.currentCity = againParams;
|
||||
|
||||
this.OrderParams.is_login = 1;
|
||||
this.OrderParams.userPro = againParams.stu_yzy_province
|
||||
this.OrderParams.subType = againParams.wenli
|
||||
this.OrderParams.score = againParams.score
|
||||
this.OrderParams.province = againParams.stu_province / 10000
|
||||
this.OrderParams.vip_type = this.payType
|
||||
this.OrderParams.telnum = this.$utils.getLocalStorage("__DC_STAT_PID")
|
||||
|
||||
} else {
|
||||
this.OrderParams.is_login = 1;
|
||||
this.OrderParams.userPro = this.UserMessage.userPro
|
||||
this.OrderParams.subType = this.UserMessage.wenli
|
||||
this.OrderParams.score = this.UserMessage.score
|
||||
this.OrderParams.province = this.UserMessage.province / 10000
|
||||
this.OrderParams.vip_type = this.payType
|
||||
this.OrderParams.telnum = this.$utils.getLocalStorage("__DC_STAT_PID")
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 如果有江苏等特殊高考,那么带上 chooseLevel
|
||||
if (this.UserMessage.chooseLevel.length != 0) {
|
||||
this.OrderParams.chooseLevel = this.UserMessage.chooseLevel
|
||||
}
|
||||
|
||||
// 如果有江苏等特殊高考,那么带上 chooseLevel
|
||||
if (this.$utils.getLocalStorage("user_input").chooseLevel.length != 0) {
|
||||
this.OrderParams.chooseLevel = this.$utils.getLocalStorage("user_input").chooseLevel
|
||||
}
|
||||
|
||||
if (`${this.currentCity.mykemu}`.length == 3) {
|
||||
this.isShowNewsTets = false
|
||||
}
|
||||
|
||||
// 如果是文科,那么选中文科 0,否则选中理科 1
|
||||
if (this.currentCity.subTypeName == '文科') {
|
||||
this.currentRadioChioose = 0
|
||||
} else {
|
||||
this.currentRadioChioose = 1
|
||||
}
|
||||
|
||||
},
|
||||
async onShow(){
|
||||
await this.$utils.isLogin();
|
||||
},
|
||||
created() {
|
||||
this.checkPayOrder()
|
||||
},
|
||||
methods: {
|
||||
checkPayOrder() {
|
||||
// 支付,不管是取消还是完成支付都会重新进入这个页面,所以判断
|
||||
// 是否是微信进入,如果是弹窗问用户你支付成功了吗?
|
||||
if (this.$utils.getLocalStorage("order_message")) {
|
||||
uni.showModal({
|
||||
title: '支付确认',
|
||||
cancelText: '未支付',
|
||||
cancelColor: '#999',
|
||||
confirmText: '已支付',
|
||||
content: '您是否已经支付成功?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.checkUserOrderStatus(1);
|
||||
} else if (res.cancel) {
|
||||
this.checkUserOrderStatus(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
return false
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 关闭支付的弹窗
|
||||
*/
|
||||
cancelPlay() {
|
||||
this.$refs.showimage.close()
|
||||
clearInterval(this.checkTimePay)
|
||||
this.checkPayOrder()
|
||||
},
|
||||
/**
|
||||
* 文理科单选框
|
||||
*/
|
||||
radioChange(event) {
|
||||
console.log(event.detail.value)
|
||||
},
|
||||
|
||||
openAddress() {
|
||||
this.$refs.AddressPopup.open()
|
||||
},
|
||||
|
||||
/**
|
||||
* 地址的点击事件
|
||||
*/
|
||||
addressChoice(item) {
|
||||
// 显示到页面上
|
||||
this.currentCity = item
|
||||
// 保存到接口请求参数中
|
||||
this.OrderParams.userPro = item.code
|
||||
// 保存选择的 real_code
|
||||
this.OrderParams.province = item.real_code
|
||||
|
||||
if (this.$utils.getLocalStorage("user_message")) {
|
||||
// 重新保存token
|
||||
this.OrderParams.token = this.$utils.getLocalStorage("user_message").token
|
||||
}
|
||||
|
||||
this.$refs.AddressPopup.close()
|
||||
|
||||
// this.updateUserInfo();
|
||||
this.provinceSubject();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 新分数失去焦点后输入框保存数值
|
||||
*/
|
||||
ChangeEdit(event) {
|
||||
if (event.detail.value.length !== 3) {
|
||||
uni.showToast({
|
||||
title: '分数不能为空必须三位数',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
// 保存到接口请求参数中
|
||||
this.OrderParams.score = event.detail.value;
|
||||
this.UserMessage.score = event.detail.value
|
||||
this.$utils.setLocalStorage("user_input", this.UserMessage)
|
||||
this.OrderParams.token = this.$utils.getLocalStorage("user_message").token;
|
||||
// 隐藏元素
|
||||
this.showEdit = !this.showEdit;
|
||||
this.updateUserInfo();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 当用户编辑分数,地址,文理科的时候重新更新用户的信息
|
||||
*/
|
||||
async updateUserInfo() {
|
||||
let res = await this.$http.startUpService.modifyUser(this.OrderParams)
|
||||
this.currentCity.score = res.data.score
|
||||
this.currentCity.title = res.data.proName
|
||||
this.$utils.setLocalStorage("user_message", res.data)
|
||||
// 关闭弹窗
|
||||
this.$refs.AddressPopup.close()
|
||||
},
|
||||
|
||||
/**
|
||||
* 根据省份获取高考科目
|
||||
*/
|
||||
async provinceSubject() {
|
||||
let res = await this.$http.startUpService.provinceSubject({
|
||||
id: this.OrderParams.userPro
|
||||
});
|
||||
|
||||
console.log("根据省份获取高考科目: ", res)
|
||||
},
|
||||
|
||||
/**
|
||||
* 发送请求获取订单状态
|
||||
*/
|
||||
async checkOrderPay() {
|
||||
return await this.$http.userService.checkPay({
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
order_id: this.$utils.getLocalStorage("order_message").order_id
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询用户订单的状态
|
||||
* 1 已支付 用户点按钮传过来的
|
||||
* 0 未支付 用户点按钮传过来的
|
||||
*/
|
||||
async checkUserOrderStatus(status) {
|
||||
|
||||
let res = await this.checkOrderPay();
|
||||
|
||||
switch (res.data.status) {
|
||||
case 0:
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '检测到您未支付,是否重新发起支付?',
|
||||
confirmText: '继续支付',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showToast({
|
||||
title: '请重选支付方式',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.removeStorage({ key: 'order_message' });
|
||||
this.$utils.enterPage("../index/index")
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 1:
|
||||
uni.removeStorage({ key: 'order_message' });
|
||||
uni.removeStorage({
|
||||
key: 'order_message',
|
||||
success: (res) => {
|
||||
this.$utils.enterPage("../index/index")
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 检查用户的登录状态,构造参数,调用下单
|
||||
*/
|
||||
async checkUserLoginStatus(payType) {
|
||||
// 组装配置 createOrder 需要的下单参数
|
||||
this.OrderParams.token = this.UserMessage.token
|
||||
this.OrderParams.mySub = this.UserMessage.mykemu
|
||||
|
||||
// 下单 获取订单id 和 订单号
|
||||
this.orderStatus = (await this.$http.userService.createOrder(this.OrderParams)).data.status;
|
||||
this.$utils.setLocalStorage("order_message", this.orderStatus);
|
||||
this.ParOrder(payType)
|
||||
},
|
||||
/**
|
||||
* 使用订单id去得到支付地址
|
||||
* @constructor
|
||||
*/
|
||||
async ParOrder(payType) {
|
||||
// 构造参数
|
||||
let params = {
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
order_id: this.$utils.getLocalStorage("order_message").order_id,
|
||||
pay_type: this.$utils.isPcClient() ? 2 : 1,
|
||||
rebackUrl: payType == 'weixin' ? encodeURIComponent(location.href) : location.href
|
||||
}
|
||||
|
||||
// 配置什么支付方式 1 微信支付,2支付宝支付
|
||||
payType == 'weixin' ? params.pay_way = 1 : params.pay_way = 2;
|
||||
|
||||
|
||||
console.log("支付参数:", params)
|
||||
|
||||
// 支付下单
|
||||
let payResult = await this.$http.userService.payOrder(params);
|
||||
|
||||
// 如果PC访问
|
||||
if (this.$utils.isPcClient()) {
|
||||
// PC 微信
|
||||
if (payResult.data.pay_way == 1) {
|
||||
this.payWeixQrCode = QR.createQrCodeImg(payResult.data.url, {
|
||||
size: parseInt(280)
|
||||
})
|
||||
this.$refs.showimage.open();
|
||||
this.TimeCheckPay()
|
||||
// PC 支付宝
|
||||
} else {
|
||||
this.formPay = payResult.data.url
|
||||
this.$nextTick(()=> document.getElementById('alipaysubmit').submit())
|
||||
}
|
||||
// 如果H5访问
|
||||
} else {
|
||||
// H5 微信
|
||||
if (payResult.data.pay_way == 1) {
|
||||
// 跳转支付
|
||||
location.href = payResult.data.url
|
||||
// H5 支付宝
|
||||
} else {
|
||||
this.formPay = payResult.data.url
|
||||
this.$nextTick(()=> document.getElementById('alipaysubmit').submit())
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* ajax轮询检查订单是否支付
|
||||
* @constructor
|
||||
*/
|
||||
TimeCheckPay() {
|
||||
this.checkTimePay = setInterval(async ()=> {
|
||||
let res = await this.checkOrderPay();
|
||||
if (res.data.status == 1) {
|
||||
console.log("支付成功")
|
||||
this.$refs.showimage.close()
|
||||
clearInterval(this.checkTimePay)
|
||||
uni.showToast({
|
||||
title: '支付成功,即将跳转回首页',
|
||||
duration: 2000,
|
||||
icon: 'none',
|
||||
complete: ()=> {
|
||||
setTimeout(()=> {
|
||||
uni.removeStorage({ key: 'order_message' });
|
||||
this.$utils.enterPage("../index/index")
|
||||
},2100)
|
||||
}
|
||||
});
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import url("../../common/less/page/payment.less");
|
||||
</style>
|
||||
1
芳林公司项目/zyhelp/pages/startUp/.pydio
Normal file
1
芳林公司项目/zyhelp/pages/startUp/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
d2ed9dab-1d9c-40f8-99ff-d435d34aad39
|
||||
615
芳林公司项目/zyhelp/pages/startUp/startUp.vue
Executable file
615
芳林公司项目/zyhelp/pages/startUp/startUp.vue
Executable file
@@ -0,0 +1,615 @@
|
||||
<template>
|
||||
<view class="startUp">
|
||||
<div class="header">
|
||||
|
||||
<div @click="$utils.closedEnterPage('../me/me')" class="navigation" v-if="user_message">
|
||||
<div class="user_info">
|
||||
<span class="iconfont"></span>
|
||||
<text>个人中心</text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="navigation" v-else>
|
||||
<div class="user_info" @click="DirectLogin">
|
||||
<span class="iconfont"></span>
|
||||
<text >登录</text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="startUp_page">
|
||||
<h2>聚志愿2020知分选大学系统</h2>
|
||||
<div class="choice">
|
||||
|
||||
<!--选择城市-->
|
||||
<div class="choice_item city">
|
||||
<div class="city_title">高考省份</div>
|
||||
<div class="city_address" @click="openAddress">
|
||||
<span class="iconfont"></span>
|
||||
<text>{{ currentChoiceCity }}</text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--选择科目-->
|
||||
<div class="choice_item project_radio">
|
||||
<div class="city_title">选择科目</div>
|
||||
|
||||
<!--普通高考的文理科选择-->
|
||||
<div class="city_project" v-if="isShowExam == 1 || isShowExam == 3">
|
||||
<radio-group @change="radioChange">
|
||||
<label class="uni-list-cell uni-list-cell-pd radio_item"
|
||||
v-for="(item, index) in LiberalArts" :key="index">
|
||||
<radio color="#1b78fa" :value="item.code" :checked="index === current" />
|
||||
<view>{{item.title}}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</div>
|
||||
|
||||
<!--新高考选择科目-->
|
||||
<div class="new_test" v-else-if="isShowExam == 2">
|
||||
<uni-badge :text="item" v-for="(item,index) in NewExamination"
|
||||
:type=" newTestItemIndex.includes(index) ? 'primary' : 'default' "
|
||||
@click="newTestClick(index)"
|
||||
:key="index"></uni-badge>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!--输入分数-->
|
||||
<div class="choice_item city">
|
||||
<div class="city_title">输入分数</div>
|
||||
<div class="city_fraction">
|
||||
<input @input="inputFraction" v-model="UserFraction" type="number" placeholder="请输入高考分数" maxlength="3">
|
||||
<text>分</text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--位次排名-->
|
||||
<div class="choice_item city">
|
||||
<div class="city_title">位次排名</div>
|
||||
<div class="city_ranking city_fraction">
|
||||
<input type="number" v-model="UserRanking" placeholder="请输入本省排名">
|
||||
<text>名</text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--普通高考中的特殊情况 江苏-->
|
||||
<div class="choice_item special" v-if="isShowExam == 3">
|
||||
|
||||
|
||||
<!--文科下拉-->
|
||||
<div class="left">
|
||||
|
||||
<div class="left_city">
|
||||
<picker @change="bindPickerChange"
|
||||
:value="0"
|
||||
disabled
|
||||
range-key="text">
|
||||
<view class="uni-input">{{currentProject.needNum[0].name}}</view>
|
||||
</picker>
|
||||
<span class="iconfont"></span>
|
||||
</div>
|
||||
|
||||
<div class="left_leve left_city">
|
||||
<picker @change="leftRadioFraction"
|
||||
:value="leftRadioFractionIndex"
|
||||
range-key="text"
|
||||
:range="achievementGrade">
|
||||
<view class="uni-input">{{achievementGrade[leftRadioFractionIndex].text}}</view>
|
||||
</picker>
|
||||
<span class="iconfont"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!--理科下拉-->
|
||||
<div class="right left">
|
||||
|
||||
<div class="left_city">
|
||||
<picker @change="rightRadioSubject"
|
||||
:value="rightRadioSubjectIndex"
|
||||
:range="currentProject.optionNum"
|
||||
range-key="name">
|
||||
<view class="uni-input">{{currentProject.optionNum[rightRadioSubjectIndex].name}}</view>
|
||||
</picker>
|
||||
<span class="iconfont"></span>
|
||||
</div>
|
||||
|
||||
<div class="left_leve left_city">
|
||||
<picker @change="rightRadioFraction"
|
||||
:value="rightRadioFractionIndex"
|
||||
range-key="text"
|
||||
:range="achievementGrade">
|
||||
<view class="uni-input">{{achievementGrade[rightRadioFractionIndex].text}}</view>
|
||||
</picker>
|
||||
<span class="iconfont"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<button @click="submitForm" type="primary" class="submitForm">智能填报</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AddressPopup :address="address" :currentIndex="addressCurrentIndex" @itemChange="addressChoice" ref="AddressPopup">
|
||||
</AddressPopup>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear" style="clear: both"></div>
|
||||
|
||||
<div class="action_list" :style="{ 'margin-top': isShowExam == 2 ? '690.362rpx' : '650.362rpx' }">
|
||||
<h2>本系统功能</h2>
|
||||
<ul>
|
||||
<li v-for="(item,index) in ActionList">
|
||||
<div class="list_header">
|
||||
<span class="iconfont" v-html="item.icon"></span>
|
||||
<text>{{item.title}}</text>
|
||||
</div>
|
||||
<div class="list_mes">{{item.mes}}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<CustomerService></CustomerService>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import amap from '../../common/lib/amap-wx.js'
|
||||
import uniPopup from "@/components/uni-popup/uni-popup.vue"
|
||||
import AddressPopup from "@/components/tpl/AddressPopup.vue"
|
||||
import CustomerService from '@/components/tpl/CustomerService.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CustomerService,
|
||||
uniPopup,
|
||||
AddressPopup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
action: false, // 如果为true 点击智能填报则为更新数据,否则false
|
||||
user_message: '',
|
||||
leftRadioFractionIndex: 0, // 左边分数点击的下标
|
||||
rightRadioSubjectIndex: 0, // 右边科目点击的下标
|
||||
rightRadioFractionIndex: 0, // 右边分数点击的下标
|
||||
// 系统提供的功能列表
|
||||
ActionList: [
|
||||
{ title: '测大学录取率', icon: '', mes: '根据您的分数计算你所报考大学的概率' },
|
||||
{ title: '查院校最低分', icon: '', mes: '根据您的分数计算你所报考大学的概率' },
|
||||
{ title: '查专业分数线', icon: '', mes: '根据您的分数计算你所报考大学的概率' },
|
||||
{ title: '根据专业选大学', icon: '', mes: '根据您的分数计算你所报考大学的概率' }
|
||||
],
|
||||
// 江苏省文理科成绩
|
||||
achievementGrade: [
|
||||
{ id: '1', text: 'A+'},
|
||||
{ id: '2', text: 'A'},
|
||||
{ id: '3', text: 'B+'},
|
||||
{ id: '4', text: 'B'},
|
||||
{ id: '5', text: 'C'},
|
||||
{ id: '6', text: 'D'}
|
||||
],
|
||||
// 江苏省文科,理科成绩
|
||||
SubjectAchievement: {
|
||||
wenkeAchievementTitle: '', // 文科标题
|
||||
wenkeAchievementId: '', // 文科id
|
||||
liAchievementTitle: '', // 理科标题
|
||||
liAchievementId: '', // 理科id
|
||||
},
|
||||
newTestItemIndex: [], // 保存新高考 选择科目后的下标
|
||||
isShowExam: 1, // 决定考试科目的展示或者隐藏
|
||||
NewExamination:[], // 新高考科目
|
||||
specialTestSub: [], // 普通高考 保存江苏数据
|
||||
current: 0,
|
||||
LiberalArts: [ // 文理科单选
|
||||
{code: "1", title: '文科'},
|
||||
{code: "2", title: '理科'}
|
||||
],
|
||||
currentChoiceCity: "安徽", // 默认省份
|
||||
// 保存用户选择的地理位置
|
||||
saveUserChiooseCity: {
|
||||
code: 843, title: '浙江', real_code: 34
|
||||
},
|
||||
UserFraction: '', // 用户高考分数
|
||||
UserRanking: '', // 用户的位次排名
|
||||
currentProject: {}, // 存储当前文理科数据
|
||||
SpecialFraction: {}, // 存储特殊高考 用户的开始科目
|
||||
// 从本地读取省份
|
||||
address: [],
|
||||
addressCurrentIndex: 0,
|
||||
UserInformation: {
|
||||
subType: 0, // 1文科,2理科默认0
|
||||
score: 0, // 分数
|
||||
mySub: 0, // 新高考考生的科目和特殊高考科目默认0
|
||||
province: 0, // 省份real_code
|
||||
chooseLevel: 0, // 特殊高考的成绩对应mySub 默认0
|
||||
userPro: 0, // 考生所在省
|
||||
},
|
||||
RecordAction: {} // 保存用户的操作状态
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
},
|
||||
async onShow() {
|
||||
|
||||
if ( !(getApp().globalData.status.hasOwnProperty("identity")) && this.$utils.checkLogin()) {
|
||||
this.$utils.closedEnterPage("../index/index")
|
||||
}
|
||||
|
||||
// 获取用户登录信息
|
||||
this.user_message = this.$utils.getLocalStorage('user_message')
|
||||
|
||||
// 获取所有省的数据
|
||||
this.address = (await this.$http.indexService.getCityList({ type: 2 })).data;
|
||||
// 如果用户已经登录 或者 输入过智能填报,那么使用用户的默认信息填充智能填报
|
||||
if (this.$utils.getLocalStorage('user_message') || this.$utils.getLocalStorage('user_input')) {
|
||||
// 构造默认城市数据
|
||||
this.saveUserChiooseCity = {
|
||||
code: this.user_message.userPro || this.$utils.getLocalStorage("user_input").userPro,
|
||||
title: this.user_message.proName || this.$utils.getLocalStorage("user_input").title,
|
||||
real_code: this.user_message.province / 10000 || this.$utils.getLocalStorage("user_input").province,
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* 获取匹配符合记录的城市
|
||||
*/
|
||||
// #ifdef H5
|
||||
this.saveUserChiooseCity = (this.address.filter((val) => val.title == lo.replace("省", "")))[0];
|
||||
// #endif
|
||||
}
|
||||
|
||||
// 清除默认科目的选中,分数,排名
|
||||
this.newTestItemIndex = []
|
||||
this.UserFraction = ''
|
||||
this.UserRanking = ''
|
||||
|
||||
|
||||
// 获取当前用户城市在address的下标,然后修改address弹窗的激活
|
||||
this.addressCurrentIndex = this.$utils.getCurrentCity(this.saveUserChiooseCity.title)
|
||||
this.addressChoice(this.saveUserChiooseCity)
|
||||
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 用户直接点登录功能
|
||||
*/
|
||||
DirectLogin() {
|
||||
this.$utils.enterPage('../login/login')
|
||||
},
|
||||
|
||||
/**
|
||||
* 新高考 选择科目 被点击
|
||||
*/
|
||||
newTestClick(index) {
|
||||
if (this.newTestItemIndex.length < 3) {
|
||||
if (this.newTestItemIndex.includes(index)) {
|
||||
this.newTestItemIndex = this.newTestItemIndex.filter(ele => ele != index);
|
||||
} else {
|
||||
this.newTestItemIndex.push(index)
|
||||
}
|
||||
} else {
|
||||
this.newTestItemIndex = this.newTestItemIndex.filter(ele => ele != index);
|
||||
}
|
||||
|
||||
console.log("------新高考选择科目-----:", this.newTestItemIndex)
|
||||
|
||||
},
|
||||
|
||||
// 特殊高考,左边分数选择
|
||||
leftRadioFraction(e) {
|
||||
this.leftRadioFractionIndex = e.target.value
|
||||
|
||||
// 获取左侧物理或者历史
|
||||
this.SpecialFraction.leftSub = this.currentProject.needNum[0].id
|
||||
this.SpecialFraction.leftScore = this.achievementGrade[e.target.value].id;
|
||||
|
||||
console.log("左边分数选择: ", this.SpecialFraction)
|
||||
},
|
||||
|
||||
|
||||
// 特殊高考,右边科目选择
|
||||
rightRadioSubject(e) {
|
||||
this.rightRadioSubjectIndex = e.target.value
|
||||
this.SpecialFraction.rightSub = this.currentProject.optionNum[this.rightRadioSubjectIndex].id
|
||||
|
||||
console.log("右边科目选择: ", this.SpecialFraction)
|
||||
},
|
||||
|
||||
|
||||
// 特殊高考,右边分数选择
|
||||
rightRadioFraction(e) {
|
||||
this.rightRadioFractionIndex = e.target.value
|
||||
this.SpecialFraction.rightScore = this.achievementGrade[this.rightRadioFractionIndex].id
|
||||
|
||||
console.log("右边分数选择: ", this.SpecialFraction)
|
||||
},
|
||||
/**
|
||||
* 普通高考文理科选择
|
||||
*/
|
||||
radioChange(e) {
|
||||
// 选择科目 的时候 如果为江苏
|
||||
if (this.isShowExam == 3) {
|
||||
// 表示文科
|
||||
if (e.detail.value == "1") {
|
||||
this.currentProject = this.specialTestSub[0]
|
||||
// 表示理科
|
||||
} else {
|
||||
this.currentProject = this.specialTestSub[1]
|
||||
}
|
||||
this.SaveSubOrScore()
|
||||
}
|
||||
|
||||
// 遍历更新下标
|
||||
for (let i = 0; i < this.LiberalArts.length; i++) {
|
||||
if (this.LiberalArts[i].code === e.target.value) {
|
||||
this.current = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 高考省份弹窗地址点击选择发生改变
|
||||
* @param item
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async addressChoice(item) {
|
||||
// 保存用户点击选择的地址
|
||||
this.saveUserChiooseCity = item;
|
||||
|
||||
// 清除省份和排名
|
||||
this.UserFraction = ""
|
||||
this.UserRanking = ""
|
||||
|
||||
let res = await this.$http.startUpService.provinceSubject({ id: item.code});
|
||||
// type 1 普通高考, 2 新高考 北京, 3 普通特殊高考 江苏
|
||||
switch (res.data.type) {
|
||||
case 1:
|
||||
this.isShowExam = 1
|
||||
this.UserInformation.mySub = 0
|
||||
break;
|
||||
case 2:
|
||||
console.log("新高考:",res)
|
||||
this.NewExamination = res.data.newTestSub
|
||||
this.UserInformation.subType = 0
|
||||
this.isShowExam = 2;
|
||||
break;
|
||||
case 3:
|
||||
|
||||
this.specialTestSub = res.data.specialTestSub;
|
||||
this.currentProject = this.specialTestSub[0];
|
||||
this.SaveSubOrScore()
|
||||
this.isShowExam = 3
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// 显示用户点击的省份
|
||||
this.currentChoiceCity = item.title
|
||||
// 关闭弹窗
|
||||
this.$refs.AddressPopup.close()
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户输入分数,查询名次
|
||||
*/
|
||||
async inputFraction(event) {
|
||||
if (event.detail.value.length >= 3) {
|
||||
if(parseInt(event.detail.value) >= 150 && parseInt(event.detail.value) <= 750) {
|
||||
this.UserFraction = event.detail.value;
|
||||
let res = await this.$http.startUpService.proScoreRank({
|
||||
province: this.saveUserChiooseCity.code,
|
||||
subType: this.LiberalArts[this.current].code,
|
||||
score: event.detail.value
|
||||
});
|
||||
if (res.data == null) {
|
||||
uni.showToast({
|
||||
title: '分数不正确',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.UserRanking = res.data.lowestRank
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '分数应该位于150-750间',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 科目 必须3个
|
||||
/**
|
||||
* 职能填报,提交用户信息的表单
|
||||
*/
|
||||
async submitForm() {
|
||||
|
||||
if (parseInt(this.UserFraction) >= 150 && parseInt(this.UserFraction) <= 750) {
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '分数应该位于150-750间',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
// 判断公共参数是否填写
|
||||
if (this.UserFraction.length === 0 || this.UserRanking == 0) {
|
||||
uni.showToast({
|
||||
title: '分数和位次排名不能为空',
|
||||
duration: 2000,
|
||||
icon: "none"
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
// type 1 普通高考, 2 新高考, 3 普通特殊高考 江苏
|
||||
switch (this.isShowExam) {
|
||||
case 1:
|
||||
// 用户省份
|
||||
this.UserInformation.province = this.saveUserChiooseCity.real_code
|
||||
// 用户分数
|
||||
this.UserInformation.score = this.UserFraction
|
||||
// 用户位次
|
||||
// UserInformation.rank = this.UserRanking
|
||||
// 保存科目
|
||||
this.UserInformation.subType = this.LiberalArts[this.current].code
|
||||
// 考生所在省
|
||||
this.UserInformation.userPro = this.saveUserChiooseCity.code
|
||||
|
||||
console.log("普通高考", this.UserInformation)
|
||||
|
||||
break;
|
||||
case 2:
|
||||
|
||||
if (this.newTestItemIndex.length != 3) {
|
||||
uni.showToast({
|
||||
title: '新高考科目必须三个',
|
||||
duration: 2000,
|
||||
icon: "none"
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
// 用户省份
|
||||
this.UserInformation.province = this.saveUserChiooseCity.real_code
|
||||
// 用户分数
|
||||
this.UserInformation.score = this.UserFraction
|
||||
// 用户位次
|
||||
// this.UserInformation.rank = this.UserRanking
|
||||
// 新高考的科目
|
||||
let newArr = []
|
||||
this.newTestItemIndex.forEach(val => newArr.push(val+1));
|
||||
|
||||
// 排序特殊高考的科目防止bug
|
||||
newArr.sort((a,b)=> a-b)
|
||||
|
||||
// 新高考科目
|
||||
this.UserInformation.mySub = newArr.join("")
|
||||
|
||||
// 考生所在省
|
||||
this.UserInformation.userPro = this.saveUserChiooseCity.code
|
||||
|
||||
break;
|
||||
case 3:
|
||||
|
||||
// 用户省份
|
||||
this.UserInformation.province = this.saveUserChiooseCity.real_code
|
||||
// 用户分数
|
||||
this.UserInformation.score = this.UserFraction
|
||||
// 普通文理科
|
||||
this.UserInformation.subType = this.LiberalArts[this.current].code
|
||||
// 特殊高考科目
|
||||
this.UserInformation.mySub = `${this.SpecialFraction.leftSub}${this.SpecialFraction.rightSub}`
|
||||
// 特殊高考成绩
|
||||
this.UserInformation.chooseLevel = `${this.SpecialFraction.leftScore}${this.SpecialFraction.rightScore}`
|
||||
// 考生所在省
|
||||
this.UserInformation.userPro = this.saveUserChiooseCity.code
|
||||
|
||||
console.log("普通特殊高考", this.UserInformation)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (getApp().globalData.status.hasOwnProperty("identity")) {
|
||||
console.log("更新用户数据")
|
||||
|
||||
// 如果用户登录了
|
||||
if (this.$utils.getLocalStorage("user_message")) {
|
||||
|
||||
let params = {
|
||||
token: this.$utils.getLocalStorage("user_message").token,
|
||||
subType: this.UserInformation.subType,
|
||||
score: this.UserInformation.score,
|
||||
mySub: this.UserInformation.mySub,
|
||||
province: this.UserInformation.province,
|
||||
chooseLevel: this.UserInformation.chooseLevel
|
||||
}
|
||||
|
||||
|
||||
let res = await this.$http.startUpService.modifyUser(params);
|
||||
|
||||
if(res.status == 1) {
|
||||
|
||||
console.log("++++++++++++++++++++++++ this.UserInformation: ++++++++++++++++++: ", this.UserInformation)
|
||||
|
||||
this.$utils.setLocalStorage("user_input", this.UserInformation)
|
||||
this.$utils.setLocalStorage("user_message", res.data)
|
||||
this.$utils.closedEnterPage("../index/index")
|
||||
}
|
||||
|
||||
// 如果用户未登录
|
||||
} else {
|
||||
console.log("用户未登录:---------,更新本地user_input: ")
|
||||
let input = this.$utils.getLocalStorage('user_input')
|
||||
input.chooseLevel = this.UserInformation.chooseLevel
|
||||
input.mySub = this.UserInformation.mySub
|
||||
input.province = this.UserInformation.province
|
||||
input.score = this.UserInformation.score
|
||||
input.subType = this.UserInformation.subType
|
||||
input.userPro = this.UserInformation.userPro
|
||||
input.title = this.saveUserChiooseCity.title
|
||||
|
||||
let [a,b,c] = this.newTestItemIndex
|
||||
input.wenli = `${this.NewExamination[a]}/${this.NewExamination[b]}/${this.NewExamination[c]}`
|
||||
|
||||
this.$utils.setLocalStorage("user_input", input)
|
||||
this.$utils.enterPage("../index/index")
|
||||
}
|
||||
|
||||
} else {
|
||||
// 本地保存数据
|
||||
if (this.isShowExam == 2) {
|
||||
this.UserInformation.title = this.saveUserChiooseCity.title
|
||||
let [a,b,c] = this.newTestItemIndex
|
||||
this.UserInformation.wenli = `${this.NewExamination[a]}/${this.NewExamination[b]}/${this.NewExamination[c]}`
|
||||
}
|
||||
|
||||
this.$utils.setLocalStorage("user_input", this.UserInformation)
|
||||
if(this.$utils.getLocalStorage("user_input")) {
|
||||
this.$utils.closedEnterPage("../index/index")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 程序运行后自动保存新高考文理科的默认选中数据
|
||||
* @constructor
|
||||
*/
|
||||
SaveSubOrScore() {
|
||||
this.SpecialFraction.leftSub = this.currentProject.needNum[0].id
|
||||
this.SpecialFraction.leftScore = this.achievementGrade[this.leftRadioFractionIndex].id
|
||||
|
||||
this.SpecialFraction.rightSub = this.currentProject.optionNum[this.rightRadioSubjectIndex].id
|
||||
this.SpecialFraction.rightScore = this.achievementGrade[this.rightRadioFractionIndex].id
|
||||
|
||||
console.log("新高考分数为:", this.SpecialFraction)
|
||||
},
|
||||
openAddress() {
|
||||
this.$refs.AddressPopup.open()
|
||||
},
|
||||
bindPickerChange(e) {
|
||||
this.index = e.target.value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import url("../../common/less/page/startUp.less");
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user