Browse Source

小程序适配

master
unknown 1 year ago
parent
commit
83f806f973
  1. 4
      config/request.js
  2. 4
      config/site.config.js
  3. 11
      pages.json
  4. 15
      pages/carEntry/evaluate/evaluate.vue
  5. 168
      pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo.vue
  6. 27
      pages/indexEntry/enroll/enroll.vue
  7. 7
      pages/indexEntry/enroll/realName/realName.vue
  8. 2
      pages/indexEntry/enroll/registInfo/registInfo.vue
  9. 2
      pages/indexEntry/enroll/uploadAvatar/uploadAvatar.vue
  10. 27
      pages/indexEntry/examines/detail/detail.vue
  11. 10
      pages/tabbar/index/index.vue
  12. 2
      pages/tabbar/learnCar/comp/subject0.vue
  13. 2
      pages/tabbar/learnCar/comp/subject3.vue
  14. 2
      pages/userCenter/login/login.vue
  15. 2
      pages/userCenter/login/loginByPhone.vue
  16. 8
      site.config.js
  17. 7
      store/modules/user.js

4
config/request.js

@ -1,5 +1,5 @@
import { H5_API, WX_API,httpPrefix } from './site.config.js'
import { H5_API, WX_API,httpPrefix } from '@/config/site.config.js';
import { checkToken } from './utils'
@ -16,7 +16,7 @@ module.exports = (vm) => {
config.baseURL = H5_API+ WX_API + prefix; /* 根域名 */
console.log(config.baseURL)
// config.header['content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
config.header['tenant-id'] = '1'
config.header['tenant-id'] = vm.$store.state.user.vuex_userInfo.tenantId || 1
return config
})

4
config/site.config.js

@ -2,8 +2,8 @@ const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM;
// localIp = false
module.exports = {
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.36:48080/',//非代理地址
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.39:48080/',//非代理地址
website: 'http://192.168.1.44:8001/h5/#',
httpPrefix: 'app-api/',
imgUrl: 'https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/'
};

11
pages.json

@ -32,6 +32,17 @@
{
"root": "pages/indexEntry",
"pages": [
{
"path": "NonPlatformStudentInfo/NonPlatformStudentInfo",
"style": {
"navigationBarTitleText": "非平台学员",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"backgroundTextStyle": "dark" ,
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "credit/credit",
"style": {

15
pages/carEntry/evaluate/evaluate.vue

@ -1,7 +1,7 @@
<template>
<view class="pageBgImg">
<topNavbar title="评价"></topNavbar>
<evaluateItem :info="schoolInfo" key="1"/>
<evaluateItem :info="schoolInfo" key="1" v-show="showSchool"/>
<evaluateItem :info="coachInfo" key="2"/>
<view class="btnBox">
@ -23,10 +23,15 @@
info: {},
schoolInfo: {},
coachInfo: {},
subject: ''
subject: '',
showSchool: true
}
},
onLoad(options) {
if(options.tit) {
this.tit = options.tit
this.showSchool = false
}
this.subject = options.subject
this.getStudentinfoFn()
@ -88,6 +93,12 @@
coachName: '',
imgArr: []
}
if(this.tit=='模拟器老师') {
this.coachInfo.tit = '您对模拟器老师满意吗?'
}
if(this.tit=='考场模拟老师') {
this.coachInfo.tit = '您对考场模拟老师满意吗?'
}
this.coachInfo.subject = this.schoolInfo.subject = this.subject
this.coachInfo.userId = this.schoolInfo.userId = this.$store.state.user.vuex_loginInfo.userId
this.coachInfo.studentPhone = this.vuex_userInfo.studentPhone

168
pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo.vue

@ -0,0 +1,168 @@
<template>
<view class="pageBgImg">
<topNavbar title="学员信息"></topNavbar>
<view class="pad">
<view class="card">
<view class="row">
<view class="lab">姓名</view>
<view class="value">李轻云</view>
</view>
<view class="row">
<view class="lab">证件号</view>
<view class="value">4310271992365685</view>
</view>
<view class="row">
<view class="lab">证件类型</view>
<view class="value">身份证</view>
</view>
</view>
<view class="card">
<view class="row">
<view class="lab">手机号</view>
<view class="rightCon">
<view class="val">
<input v-model="form.classModel" placeholder="请输入手机号" /></input>
</view>
</view>
</view>
<view class="row">
<view class="lab">驾校名称</view>
<view class="rightCon">
<view class="val">
<input v-model="form.classModel" placeholder="请输入手机号" /></input>
</view>
</view>
</view>
<view class="row">
<view class="lab">学驾车型</view>
<view class="rightCon">
<view class="val" @click="showType=true">
<input v-model="form.classModel" placeholder="请选择" disabled=""/></input>
</view>
<view class="icon" @click="showType=true">
<u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;"></u-icon>
</view>
</view>
</view>
</view>
<view class="btnBg" @click="goNext">确认</view>
</view>
<u-picker :show="showType" :columns="typeArr" @confirm="confirmType"
@cancel="showType=false"></u-picker>
</view>
</template>
<script>
import {
getpersonface,
GetDetectInfoEnhanced,
getCardType
} from '@/config/api.js'
export default {
data() {
return {
form: {
value: 1,
typeName: '身份证'
},
showType: false,
typeArr: [
['C1','C2','C3','A2','B2','A1','A3','B1','D','E','F','C4','C5','C6']
],
}
// 0123456
},
onLoad(options) {
},
methods: {
confirmType(val) {
let item = val.value[0]
// this.form.value = item.value
// this.form.typeName = item.label
this.showType = false
},
goNext() {
// return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
if (!this.form.value) return this.$u.toast('请选择证件类型')
//
if (this.vuex_userInfo.applyStep == 3) {
return this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
}
//
if (this.vuex_userInfo.applyStep == 2) {
if (this.title == '学员信息') {
//
return his.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
//
if (this.vuex_userInfo.applyStep == 4 || this.vuex_userInfo.applyStep == 5) {
return this.$goPage('/pages/indexEntry/enroll/payment/payment')
}
if (!this.vuex_userInfo.applyStep || this.vuex_userInfo.applyStep < 2) {
// return this.$goPage('/pages/indexEntry/enroll/realName/realName')
this.getpersonfaceFn()
}
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
// this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
}
}
}
</script>
<style>
.input1::placeholder {
color: red !important;
}
</style>
<style lang="scss" scoped>
.card {
padding: 10rpx 46rpx 10rpx 32rpx;
margin-bottom: 20rpx;
.row {
height: 100rpx;
display: flex;
align-items: center;
.lab {
width: 152rpx;
}
.rightCon {
flex: 1;
width: 0;
display: flex;
.val {
flex: 1;
width: 0;
input {
font-size: 28rpx;
}
}
.icon {
width: 30rpx;
height: 30rpx;
u-icon {}
}
}
}
}
.btnBg {
width: 396rpx;
margin: 100rpx auto 0 auto;
}
</style>

27
pages/indexEntry/enroll/enroll.vue

@ -1,6 +1,6 @@
<template>
<view class="pageBgImg">
<topNavbar title="学员报名"></topNavbar>
<topNavbar :title="title"></topNavbar>
<view class="pad">
<view class="card">
<view class="row">
@ -49,11 +49,13 @@
</view>
<u-picker :show="showType" :columns="typeArr" keyName="label" @confirm="confirmType" @cancel="showType=false"></u-picker>
</view>
</template>
<script>
import { getpersonface, GetDetectInfoEnhanced, getCardType } from '@/config/api.js'
import { website } from '@/config/site.config.js'
export default {
data() {
return {
@ -63,10 +65,14 @@
},
showType: false,
typeArr: [],
title: '学员报名'
}
// 0123456
},
onLoad() {
onLoad(options) {
if(options.tit) {
this.title = options.tit
}
// this.GetDetectInfoEnhancedFn()
this.getCardTypeFn()
},
@ -94,7 +100,7 @@
this.showType = false
},
async getpersonfaceFn() {
const {data: res} = await getpersonface({ ruleId: 1, RedirectUrl: 'http://192.168.1.44:8001/h5/#/pages/indexEntry/enroll/realName/realName'})
const {data: res} = await getpersonface({ ruleId: 1, RedirectUrl: website + '/pages/indexEntry/enroll/realName/realName'})
let obj = JSON.parse(res)
this.link = obj.Url
this.$store.commit('updateBizToken', obj.BizToken)
@ -104,12 +110,19 @@
// var regex = /\[.*?\]/;
// alert(obj.BizToken)
// this.GetDetectInfoEnhancedFn(obj.BizToken)
// #ifdef MP-WEIXIN
this.$store.commit('updateWebVeiwUrl', this.link)
uni.navigateTo({
url: '/pages/indexEntry/webView/webView'
})
// #endif
console.log(obj)
},
async GetDetectInfoEnhancedFn(bizToken) {
let obj = {
ruleId: 1,
redirectUrl: 'http://192.168.1.44:8001/h5/#/pages/indexEntry/enroll/registInfo/registInfo',
redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo',
bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA',
userId: this.userId
}
@ -121,7 +134,7 @@
// uni.setStorageSync(obj2)
},
goNext() {
// return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
if(!this.form.value) return this.$u.toast('请选择证件类型')
//
if(this.vuex_userInfo.applyStep==3) {
@ -129,6 +142,10 @@
}
//
if(this.vuex_userInfo.applyStep==2) {
if(this.title=='学员信息') {
//
return this.$goPage('/pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo')
}
return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
//

7
pages/indexEntry/enroll/realName/realName.vue

@ -6,6 +6,7 @@
<script>
import { GetDetectInfoEnhanced } from '@/config/api.js'
import { website } from '@/config/site.config.js'
export default {
onShow() {
this.GetDetectInfoEnhancedFn()
@ -19,9 +20,13 @@
uni.showLoading({
title: '正在检测中...'
})
let redirectUrl = website + '/pages/indexEntry/enroll/registInfo/registInfo'
if(this.$store.state.user.NonPlatformStudent) {
redirectUrl = website + '/pages/indexEntry/NonPlatformStudent/NonPlatformStudent'
}
let obj = {
ruleId: 1,
redirectUrl: 'http://192.168.1.44:8001/h5/#/pages/indexEntry/enroll/registInfo/registInfo',
redirectUrl,
bizToken: this.$store.state.school.BizToken,
userId: this.userId
}

2
pages/indexEntry/enroll/registInfo/registInfo.vue

@ -333,9 +333,9 @@
},
onLoad() {
// this.GetDetectInfoEnhancedFn()
this.form.userId = this.userId
this.form.accountId = this.vuex_userInfo.accountId
this.form.address = this.vuex_userInfo.address
this.form.userId = this.userId
this.form.name = this.vuex_userInfo.name
this.form.idcard = this.vuex_userInfo.idcard
uni.$on('upDateCoachItem',(item)=>{

2
pages/indexEntry/enroll/uploadAvatar/uploadAvatar.vue

@ -23,7 +23,7 @@
</template>
<script>
import { APP_API, APP_HOST } from '@/site.config.js';
import { APP_API, APP_HOST } from '@/config/site.config.js';;
const _url = APP_HOST + APP_API + '/util/manage/uploadFile.do';
export default {
data() {

27
pages/indexEntry/examines/detail/detail.vue

@ -42,7 +42,7 @@
<newItem :item="item"></newItem>
</view>
</view>
<view class="btn">我要模拟</view>
<view class="btn" @click="goExamine">我要模拟</view>
</view>
</view>
</template>
@ -89,8 +89,31 @@
async getExamSiteInfoFn() {
const {data: res} = await getExamSiteInfo({id: this.id,pageNo: 1,pageSize: 2, })
this.infoList = res.list
},
async goExamine() {
// uni.navigateTo({
// url: '/pages/indexEntry/enroll/enroll?tit='
// })
// return
if(this.vuex_userInfo.schoolId) {
uni.navigateTo({
url: '/pages/carEntry/simulateAppointment/simulateAppointment'
})
}
await this.$store.dispatch('getUserInfo')
if(this.vuex_userInfo.schoolId) {
uni.navigateTo({
url: '/pages/carEntry/simulateAppointment/simulateAppointment'
})
}else {
//
this.$store.commit('updateNonPlatformStudent', 'NonPlatformStudent')
uni.navigateTo({
url: '/pages/indexEntry/enroll/enroll?tit=学员信息'
})
}
}
}
}
</script>

10
pages/tabbar/index/index.vue

@ -26,7 +26,7 @@
<view class="adrsIcon">
<image src="@/static/images/index/dingwei.png" mode=""></image>
</view>
<view class="adr">{{ vuex_cityInfo.city }} </view>
<view class="adr">{{ vuex_cityInfo.city || '杭州' }} </view>
</view>
<view class="scan" @click="scanCodeFn">
<image src="@/static/images/index/scan.png" mode=""></image>
@ -41,7 +41,7 @@
<!-- 精钢区 -->
<view class="card traTop">
<view class="ul">
<view class="li" v-for="(item,index) in entrySection" :key="index" @tap="$goPage(item.url)">
<view class="li" v-for="(item,index) in entrySection" :key="index" @tap="entrySectionClick(item)">
<view class="icon">
<image :src="item.icon" mode=""></image>
</view>
@ -295,6 +295,12 @@
// }
},
methods: {
entrySectionClick(item) {
if(item.text=='我要报名') {
this.$store.commit('updateNonPlatformStudent', false)
}
this.$goPage(item.url)
},
async getarticleListFn() {
const {data: res} = await getarticleList(this.params)
this.swiperInfo = res.list[0].articleManagementDO

2
pages/tabbar/learnCar/comp/subject0.vue

@ -29,7 +29,7 @@
<view class="flex-b bg">
<view class="row">
<view class="text">评价模拟器教学老师</view>
<view class="btn" @click="$goPage('/pages/carEntry/evaluate/evaluate')">去评价</view>
<view class="btn" @click="$goPage('/pages/carEntry/evaluate/evaluate?tit=模拟器老师')">去评价</view>
</view>
</view>
</view>

2
pages/tabbar/learnCar/comp/subject3.vue

@ -60,7 +60,7 @@
</view>
<view class="flex-b bg">
<view class="row oneBtn">
<view class="btn" @click.stop="$goPage('/pages/carEntry/evaluate/evaluate')">去评价</view>
<view class="btn" @click.stop="$goPage('/pages/carEntry/evaluate/evaluate?tit=考场模拟老师')">去评价</view>
</view>
</view>
</view>

2
pages/userCenter/login/login.vue

@ -28,7 +28,9 @@
<script>
import { imgUrl } from '@/config/site.config'
import privacyRadion from '@/components/privacyRadion/privacyRadion'
export default {
components: {privacyRadion},
data() {
return {
isCheck: false,

2
pages/userCenter/login/loginByPhone.vue

@ -37,8 +37,10 @@
<script>
import { getLoginCode, loginSMS } from '@/config/api.js'
import privacyRadion from '@/components/privacyRadion/privacyRadion'
import { imgUrl } from '@/config/site.config'
export default {
components: {privacyRadion},
data() {
return {
imgUrl: imgUrl+'loginTopBg.png',

8
site.config.js

@ -1,8 +0,0 @@
const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM;
// localIp = false
module.exports = {
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
WX_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',//非代理地址
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',
};

7
store/modules/user.js

@ -7,7 +7,8 @@ const user = {
vuex_cityInfo: uni.getStorageSync('vuex_cityInfo') ? uni.getStorageSync('vuex_cityInfo') : {city: '杭州市'},
vuex_userInfo: uni.getStorageSync('vuex_userInfo') ? uni.getStorageSync('vuex_userInfo') : {},
vuex_loginInfo: uni.getStorageSync('vuex_loginInfo') ? uni.getStorageSync('vuex_loginInfo') : {},
apiOk: true
apiOk: true,
NonPlatformStudent: false,
},
mutations: {
update_vuex_cityInfo(state, payload) {
@ -32,6 +33,10 @@ const user = {
uni.navigateTo({
url: '/pages/userCenter/login/loginByPhone'
})
},
// 为非平台学员开一条路
updateNonPlatformStudent(state, val) {
state.NonPlatformStudent = val
}
},
actions: {

Loading…
Cancel
Save