Browse Source

科一签到

master
unknown 3 weeks ago
parent
commit
6b0803fefa
  1. 3
      App.vue
  2. 7
      common/css/app.scss
  3. 2
      components/searchRow/searchRow.vue
  4. 58
      config/api.js
  5. 4
      config/request.js
  6. 4
      config/site.config.js
  7. 7
      config/utils.js
  8. 4
      manifest.json
  9. 23
      pages.json
  10. 2
      pages/indexEntry/enroll/registInfo/registInfo.vue
  11. 2
      pages/indexEntry/findCoach/comp/coachItem.vue
  12. 24
      pages/indexEntry/findShcool/findShcool.vue
  13. 2
      pages/indexEntry/findShcool/searchShcool/searchShcool.vue
  14. 2
      pages/indexEntry/findShcool/shcoolDetail/shcoolDetail.vue
  15. 373
      pages/indexEntry/signIn/signAndOut/signAndOutSubjiect1.vue
  16. 14
      pages/indexEntry/signIn/signIn.vue
  17. 2
      pages/indexEntry/webView/webView.vue
  18. 6
      pages/mineEntry/personaInfo/personaInfo.vue
  19. 4
      pages/tabbar/index/comp/coachItem.vue
  20. 18
      pages/tabbar/index/comp/schoolItem.vue
  21. 52
      pages/tabbar/index/index.vue
  22. 8
      pages/tabbar/mine/index.vue
  23. 12
      pages/userCenter/login/login.vue
  24. 204
      pages/userCenter/login/new_file.html
  25. 7
      store/modules/user.js

3
App.vue

@ -23,6 +23,9 @@
@import '@/uni_modules/uview-ui/index.scss'; @import '@/uni_modules/uview-ui/index.scss';
@import 'common/css/app.scss'; @import 'common/css/app.scss';
.pageBgImg { .pageBgImg {
font-size: 28rpx;;
color: #333;
min-height: 100vh;
background: url('./static/images/bigImg/topBg.png') #F6F7FA no-repeat; background: url('./static/images/bigImg/topBg.png') #F6F7FA no-repeat;
background-size: 100% 278rpx; background-size: 100% 278rpx;
} }

7
common/css/app.scss

@ -40,12 +40,11 @@ view {
min-height: 100vh; min-height: 100vh;
} }
.pageBgImg { .pageBgImg {
font-size: 28rpx;;
color: #333;
// font-size: 28rpx;;
// color: #333;
// min-height: 100vh;
// background: url('https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/complain/2024-03-18/1710759177684-0') #F6F7FA no-repeat; // background: url('https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/complain/2024-03-18/1710759177684-0') #F6F7FA no-repeat;
// background-size: 100% 278rpx; // background-size: 100% 278rpx;
min-height: 100vh;
} }
.starBox { .starBox {

2
components/searchRow/searchRow.vue

@ -7,7 +7,7 @@
<view class="inputBox"> <view class="inputBox">
<view class="isDisable" v-if="disable" @click="searchFn">{{ placeholder }}</view> <view class="isDisable" v-if="disable" @click="searchFn">{{ placeholder }}</view>
<u-search v-else :placeholder="placeholder" v-model="keyword" :color="'#333'" placeholderColor="#CCCCCC" :disabled="disable" @click="searchFn" :bgColor="'transparent'" @change="$u.debounce(searchFn, 1500)" :showAction="false" @search="$u.debounce(searchFn, 500)" @clear="clearSearchFn"></u-search>
<u-search v-else :placeholder="placeholder" v-model="keyword" :color="'#333'" placeholderColor="#CCCCCC" @click="searchFn" :bgColor="'transparent'" @change="$u.debounce(searchFn, 1500)" :showAction="false" @search="$u.debounce(searchFn, 500)" @clear="clearSearchFn"></u-search>
</view> </view>
</view> </view>
</view> </view>

58
config/api.js

@ -14,13 +14,7 @@ export const getUserInfo = (data) => http.post('member/user/get', {header: {'con
export const logOut = (data={}) => http.post('member/auth/logout', data, {custom: {catch: true, toast: false }}) export const logOut = (data={}) => http.post('member/auth/logout', data, {custom: {catch: true, toast: false }})
// 驾校列表分页 // 驾校列表分页
export const schoolPage = (params) => http.get('business/school/page', {params: params}) export const schoolPage = (params) => http.get('business/school/page', {params: params})
// 附近场地
// export const getexamSite = (params) => http.get('business/school/getexamSite', {params: params})
// 考场详情
// export const getExamSiteDatil = (params) => http.get('business/school/getExamSiteDatil', {params: params})
// 考场资讯
// export const getExamSiteInfo = (params) => http.get('business/school/getExamSiteInfo', {params: params})
// 创建驾校评价
export const addSchoolComment = (data={}) => http.post('business/appcomplain/addSchoolComment', data,) export const addSchoolComment = (data={}) => http.post('business/appcomplain/addSchoolComment', data,)
// 创建教练评价 // 创建教练评价
export const addCoachComment = (data={}) => http.post('business/appcomplain/addCoachComment', data,) export const addCoachComment = (data={}) => http.post('business/appcomplain/addCoachComment', data,)
@ -38,24 +32,6 @@ export const getSchoolDetail = (params) => http.get('business/school/getSchool',
export const schoolClass = (params) => http.get('business/school-class/page', {params: params}) export const schoolClass = (params) => http.get('business/school-class/page', {params: params})
// 教练列表分页 // 教练列表分页
export const coachPage = (params) => http.get('business/coach/page', {params: params}) export const coachPage = (params) => http.get('business/coach/page', {params: params})
// 公益视频
// export const publicVideoPage = (params) => http.get('business/video/page', {params: params})
// 公益视频 详情
// export const publicGetvideo = (params) => http.get('business/video/getvideo', {params: params})
// 公益视频点赞
// export const createUpvote = (data) => http.post('business/contentdata/createUpvote', data)
// 公益视频取消点赞 upvoteId
// export const deleteUpvote = (data) => http.delete(`/business/contentdata/deleteUpvote?upvoteId=${data.upvoteId}&mobile=${data.mobile}`)
// 公益视频收藏
// export const createCollect = (data) => http.post('business/contentdata/createCollect', data)
// 公益视频取消收藏 CollectId
// export const deleteRetransmission = (data) => http.delete(`business/contentdata/deleteCollect?collectId=${data.CollectId}&mobile=${data.mobile}`)
// 公益视频分享
// export const createRetransmission = (data) => http.post('business/contentdata/createRetransmission', data)
// 公益视频是否点赞收藏
// export const getlikesCollection = (params) => http.get('business/users/getContent', {params: params})
// 公益视频我的收藏
// export const getcollectVideo = (params) => http.get('business/users/getcollectVideo', {params: params})
// 行业资讯, // 行业资讯,
export const getarticleList = (params) => http.get('business/video/article', {params: params}) export const getarticleList = (params) => http.get('business/video/article', {params: params})
// 行业政策 // 行业政策
@ -88,32 +64,12 @@ export const getpersonface = (params) => http.get('app/student-record/getpersonf
export const GetDetectInfoEnhanced = (params) => http.get('app/student-record/GetDetectInfoEnhanced', {params}) export const GetDetectInfoEnhanced = (params) => http.get('app/student-record/GetDetectInfoEnhanced', {params})
// 证件类型获取 // 证件类型获取
export const getCardType = (params) => http.get('system/dict/cardType', {params}) export const getCardType = (params) => http.get('system/dict/cardType', {params})
// // 获得合同信息
// export const getContract = (params) => http.get('business/contract/get', {params})
// // 创建合同信息
// export const contractCreate = (data) => http.post('business/contract/create', data)
// // 获取驾校的合同
// export const getSchoolContract = (params) => http.get('business/contract/getSchoolContract', {params})
// 我的合同 // 我的合同
export const selectContractPdfBase64 = (params) => http.get('business/contract/selectContractPdfBase64', {params}) export const selectContractPdfBase64 = (params) => http.get('business/contract/selectContractPdfBase64', {params})
// 获取合同链接 // 获取合同链接
export const getSignContract = (data) => http.post('business/contract/signContract', data) export const getSignContract = (data) => http.post('business/contract/signContract', data)
// 查询学员合同签署状态 // 查询学员合同签署状态
export const getContractStatus = (params) => http.get('business/contract/getContractStatus', {params}) export const getContractStatus = (params) => http.get('business/contract/getContractStatus', {params})
// 1获得模拟预约点
// export const simulationPoint = (params) => http.get('business/booking/simulation-point/page', {params})
// 2获得模拟器排课
// export const simulationClass = (params) => http.get('business/booking/simulation-class/get', {params})
// 3获得模拟器
// export const simulationDevices = (params) => http.get('business/booking/simulation-devices/list', {params})
// 4创建模拟预约
// export const simulationCreate = (data) => http.post('business/booking/simulation-record/create', data)
// 5获得模拟预约记录
// export const simulationPage = (params) => http.get('business/booking/simulation-record/page', {params})
// 6获得模拟详情
// export const simulationDetail = (params) => http.get('business/booking/simulation-record/get', {params})
// 7取消模拟预约
// export const cancelSimulationDevice = (params) => http.put('business/booking/simulation-record/cancelSimulation?id='+ params.id,)
// 1获得考场 // 1获得考场
export const examSitePage = (params) => http.get('business/exam-site/list', {params}) export const examSitePage = (params) => http.get('business/exam-site/list', {params})
// 2获得车辆 // 2获得车辆
@ -204,14 +160,26 @@ export const vailStudentInfo = (data) => http.post('business/coach/sign/vailStud
export const signOutAuth = (data) => http.post('business/student/sign/outAuth', data) export const signOutAuth = (data) => http.post('business/student/sign/outAuth', data)
// 签退 // 签退
export const signOut = (data) => http.post('business/student/sign/out', data) export const signOut = (data) => http.post('business/student/sign/out', data)
// 学员扫码签到前置校验——理科
export const vailStudentSignSubject1 = (data) => http.post('business/student/theorySign/before_in', data)
// 学员扫码签退前置校验——理科
export const vailStudentSignOutSubject1 = (data) => http.post('business/student/theorySign/before_out', data)
// 学员扫码签到—理科
export const theorySignSubject1 = (data) => http.post('business/student/theorySign/in', data)
// 学员扫码签退 -- 签退不做人脸—理科
export const theorySignOutSubject1 = (data) => http.post('business/student/theorySign/out', data)
// 支付 // 支付
export const getStudentByPayment = (params={}) => http.get('app/student-record/getStudentByPayment', {params}) export const getStudentByPayment = (params={}) => http.get('app/student-record/getStudentByPayment', {params})
// 补签 // 补签
export const reSignOut = (data) => http.post('business/student/sign/reSignOut', data) export const reSignOut = (data) => http.post('business/student/sign/reSignOut', data)
// 学员扫码签到记录 -- 按月查询 // 学员扫码签到记录 -- 按月查询
export const monthSignRecord = (data) => http.post('business/student/sign/monthSignRecord', data) export const monthSignRecord = (data) => http.post('business/student/sign/monthSignRecord', data)
// 学员扫码签到记录 -- 按月查询-理科
export const monthSignRecordSubjiect1 = (data) => http.post('business/student/theorySign/monthSignRecord', data)
// 学员扫码签到记录 -- 按天查询 // 学员扫码签到记录 -- 按天查询
export const signDetail = (data) => http.post('business/student/sign/signDetail', data) export const signDetail = (data) => http.post('business/student/sign/signDetail', data)
// 学员扫码签到记录 -- 按天查询-理科
export const signDetailSubjiect1 = (data) => http.post('business/student/theorySign/signDetail', data)
// 学时确认 // 学时确认
export const periodConfirm = (data) => http.post('app/student-process/periodConfirm', data) export const periodConfirm = (data) => http.post('app/student-process/periodConfirm', data)
// 获得学员动态 // 获得学员动态

4
config/request.js

@ -51,8 +51,8 @@ module.exports = (vm) => {
// 响应拦截 // 响应拦截
uni.$u.http.interceptors.response.use(async (response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/ uni.$u.http.interceptors.response.use(async (response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/
const data = response.data const data = response.data
// console.log('请求结果')
// console.log(data)
console.log('请求结果')
console.log(data)
if(data.code==406&&response.config.url!='member/auth/refresh-token'&&response.config.url!=='member/auth/logout') { if(data.code==406&&response.config.url!='member/auth/refresh-token'&&response.config.url!=='member/auth/logout') {
await refreshToken() await refreshToken()
let obj = response.config let obj = response.config

4
config/site.config.js

@ -2,14 +2,14 @@ const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM;
// localIp = false // localIp = false
module.exports = { module.exports = {
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理 H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://www.lyjppt.com/',//非代理地址 不要忘记加/
WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://192.168.1.106:8318/',//非代理地址 不要忘记加/
website: 'http://192.168.1.37', website: 'http://192.168.1.37',
httpPrefix: 'app-api/', httpPrefix: 'app-api/',
imgUrl: 'https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/', imgUrl: 'https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/',
// 支付测试地址 // 支付测试地址
// preUrl: 'https://u8wbs.zyebank.cn/cem_ysb_u6/index.html', // preUrl: 'https://u8wbs.zyebank.cn/cem_ysb_u6/index.html',
// preUrl: 'https://u8wbs.zyebank.cn/cem_ysb_u8/index.html', // preUrl: 'https://u8wbs.zyebank.cn/cem_ysb_u8/index.html',
// 生产地址
// 支付生产地址
preUrl: 'https://zmcht.zybank.com.cn/cem_ysb/index.html', preUrl: 'https://zmcht.zybank.com.cn/cem_ysb/index.html',
}; };

7
config/utils.js

@ -201,10 +201,15 @@ export function uploadImgApi(filePath, imgName, imgLink='image') {
_this.$store.commit('updateSchool', item) _this.$store.commit('updateSchool', item)
} }
_this.$u.utils.clickSignUp() _this.$u.utils.clickSignUp()
}else {
}else if(obj.QrType==2||obj.QrType==3){
// 签到的 // 签到的
_this.$store.commit('upDateSchoolCoach', item) _this.$store.commit('upDateSchoolCoach', item)
_this.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut') _this.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut')
}else if(obj.QrType==4||obj.QrType==5){
// 签到的
console.log('没来这里?')
_this.$store.commit('upDateSchoolCoach', item)
_this.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOutSubjiect1')
} }
}else { }else {
_this.$store.commit('updateWebVeiwUrl', res.result) _this.$store.commit('updateWebVeiwUrl', res.result)

4
manifest.json

@ -2,8 +2,8 @@
"name" : "洛阳学车", "name" : "洛阳学车",
"appid" : "__UNI__3347C6E", "appid" : "__UNI__3347C6E",
"description" : "", "description" : "",
"versionName" : "1.4.4",
"versionCode" : 144,
"versionName" : "1.4.5",
"versionCode" : 145,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

23
pages.json

@ -5,8 +5,7 @@
"style": { "style": {
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
"enablePullDownRefresh": true
} }
}, },
{ {
@ -14,8 +13,7 @@
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
"enablePullDownRefresh": true
} }
}, },
{ {
@ -23,8 +21,7 @@
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
"enablePullDownRefresh": true
} }
} }
@ -44,9 +41,18 @@
} }
}, },
{ {
"path": "signIn/signAndOut/signAndOutSubjiect1",
"style": {
"navigationBarTitleText": "理论签到/签退确认",
"enablePullDownRefresh": false,
"backgroundTextStyle": "dark"
}
},
{
"path": "signIn/signAndOut/signAndOut", "path": "signIn/signAndOut/signAndOut",
"style": { "style": {
"navigationBarTitleText": "签到/签退确认",
"navigationBarTitleText": "实操签到/签退确认",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"backgroundTextStyle": "dark" "backgroundTextStyle": "dark"
} }
@ -560,7 +566,8 @@
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#F6F7FA", "navigationBarBackgroundColor": "#F6F7FA",
"backgroundColor": "#F6F7FA"
"backgroundColor": "#F6F7FA",
"lazyload": true
}, },
"uniIdRouter": {}, "uniIdRouter": {},
"tabBar": { "tabBar": {

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

@ -614,7 +614,7 @@
}, },
async comfigClick(val) { async comfigClick(val) {
console.log(val)
console.log(this.form)
this.showPopup = false this.showPopup = false
if(!val) return false if(!val) return false
let obj = Object.assign({},this.form) let obj = Object.assign({},this.form)

2
pages/indexEntry/findCoach/comp/coachItem.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="itemBox" > <view class="itemBox" >
<view class="img"> <view class="img">
<image :src="item.photoPath" mode="" v-if="$u.utils.isImagePath(item.photoPath)"></image>
<image :src="item.photoPath" mode="widthFix" v-if="$u.utils.isImagePath(item.photoPath)"></image>
<image src="@/static/images/index/avatar.png" mode="" v-else></image> <image src="@/static/images/index/avatar.png" mode="" v-else></image>
</view> </view>
<view class="textCon"> <view class="textCon">

24
pages/indexEntry/findShcool/findShcool.vue

@ -4,7 +4,7 @@
<topNavbar title="找驾校"></topNavbar> <topNavbar title="找驾校"></topNavbar>
<view class="searchCon pad"> <view class="searchCon pad">
<searchRow placeholder="搜索驾校名称" @searchFn="$goPage('/pages/indexEntry/findShcool/searchShcool/searchShcool')" :disable="true"></searchRow>
<searchRow placeholder="搜索驾校名称" @searchFn="$goPage('/pages/indexEntry/findShcool/searchShcool/searchShcool')" :disable="true" key="1"></searchRow>
</view> </view>
</view> </view>
<view class="pad"> <view class="pad">
@ -18,7 +18,7 @@
</view> </view>
<view class="ul"> <view class="ul">
<view class="li" v-for="(item,index) in listData" :key="index" >
<view class="li" v-for="(item,index) in listData" :key="index" style="height: 176rpx;">
<schoolItme :item="item" @click.native="goPage(item)"/> <schoolItme :item="item" @click.native="goPage(item)"/>
</view> </view>
</view> </view>
@ -118,6 +118,9 @@
}, },
// //
async schoolPageFn() { async schoolPageFn() {
uni.showLoading({
title: '正在加载...'
})
let obj = {} let obj = {}
for(let key in this.params) { for(let key in this.params) {
if(this.params[key]) { if(this.params[key]) {
@ -126,10 +129,27 @@
} }
const {data: res} = await schoolPage(obj) const {data: res} = await schoolPage(obj)
this.params.pageNo ++ this.params.pageNo ++
// let arr = res.list.map(item=>{
// if(!item.schoolIntroduceDO) item.schoolIntroduceDO = {}
// let obj = {
// iconPath: item.schoolIntroduceDO.iconPath,
// name: item.name,
// stars: item.stars,
// reviewTotal: item.reviewTotal,
// phone: item.phone,
// id: item.id,
// distance: item.distance,
// districtName: item.districtName
// }
// return obj
// })
this.listData.push(...res.list) this.listData.push(...res.list)
this.total = res.total this.total = res.total
if(this.listData.length>=this.total) this.status = 'nomore' if(this.listData.length>=this.total) this.status = 'nomore'
console.log(res) console.log(res)
this.$nextTick(()=>{
uni.hideLoading()
})
} }
} }
} }

2
pages/indexEntry/findShcool/searchShcool/searchShcool.vue

@ -4,7 +4,7 @@
<topNavbar title="找驾校"></topNavbar> <topNavbar title="找驾校"></topNavbar>
<view class="searchCon pad"> <view class="searchCon pad">
<searchRow placeholder="搜索驾校名称" @searchFn="searchFn"></searchRow>
<searchRow placeholder="搜索驾校名称" @searchFn="searchFn" key="2"></searchRow>
</view> </view>
</view> </view>
<view class="pad"> <view class="pad">

2
pages/indexEntry/findShcool/shcoolDetail/shcoolDetail.vue

@ -121,12 +121,12 @@
title: '正在加载……' title: '正在加载……'
}) })
const {data: res} = await getSchoolDetail(Object.assign(this.params,{id: this.schoolId})) const {data: res} = await getSchoolDetail(Object.assign(this.params,{id: this.schoolId}))
uni.hideLoading()
this.schoolDetail = res this.schoolDetail = res
this.swiperList = res.schoolIntroduceDO&&res.schoolIntroduceDO.headImages&&res.schoolIntroduceDO.headImages.split(',') this.swiperList = res.schoolIntroduceDO&&res.schoolIntroduceDO.headImages&&res.schoolIntroduceDO.headImages.split(',')
if(!this.swiperList||!this.swiperList.length) { if(!this.swiperList||!this.swiperList.length) {
this.swiperList = [jlcBg] this.swiperList = [jlcBg]
} }
this.$nextTick(()=>{uni.hideLoading()})
console.log('this.swiperList') console.log('this.swiperList')
console.log(this.swiperList) console.log(this.swiperList)
}, },

373
pages/indexEntry/signIn/signAndOut/signAndOutSubjiect1.vue

@ -0,0 +1,373 @@
<template>
<view class="main">
<view class="signAndOut">
<view class="top_row">
<view class="flex-box">
<view class="icon">
<image src="@/static/images/carIcon/home_icon_buzhou@2x.png" mode=""></image>
</view>
<view class="txt">步骤</view>
</view>
<view class="flex-box">
<view class="icon">
<image src="@/static/images/carIcon/home_icon_zhuangtai@2x.png" mode=""></image>
</view>
<view class="txt">状态</view>
</view>
</view>
<view class="step">
<view class="li" :class="{active: step1}">
<view class="leftIcon" >
<view class="icon">1</view>
<view class="line" ></view>
</view>
<view class="textCon">
<view class="text">信息认证</view>
<view class="redTps" v-if="!step1">失败原因{{stepFailureReason}}</view>
</view>
<view class="btn" :class="{red: !step1}">{{step1?'通过': '不通过'}}</view>
</view>
<view class="li" :class="{active: step2}">
<view class="leftIcon">
<view class="icon">2</view>
<view class="line" ></view>
</view>
<view class="textCon">
<view class="text">人脸识别</view>
<view class="redTps"></view>
</view>
<view class="btn" v-if="step2">通过</view>
</view>
<view class="li" :class="{active: step3}">
<view class="leftIcon">
<view class="icon">3</view>
</view>
<view class="textCon">
<view class="text">信息同步</view>
<view class="redTps"></view>
</view>
<view class="btn" v-if="step3">通过</view>
</view>
</view>
<view class="footBtn">
<view class="oneBtn" :class="{active: btnActive}" v-if="!step3" @click="Recertification">重新认证</view>
<view class="oneBtn" :class="{active: step3}" v-else @click="goBack">我知道了</view>
</view>
</view>
</view>
</template>
<script>
import { getInitBodyFaceVerify, getDescribeBodyFaceVerify, theorySignSubject1, vailStudentSignSubject1, vailStudentSignOutSubject1, theorySignOutSubject1, } from '@/config/api.js'
export default {
data() {
return {
deviceCode: 0,
stepFailureReason: '未通过',
step1: false,
step2: false,
step3: false,
params: {},
count: 0
}
},
onLoad(options) {
this.vailStudentInfoFn()
},
computed: {
btnActive() {
if(this.step1&&(!this.step2||!this.step3)) {
return true
}else {
return false
}
}
},
methods: {
//
async vailStudentInfoFn() {
await this.$store.dispatch('getCity')
if(!this.vuex_cityInfo.lat) return
let schoolCoach = this.$store.state.school.schoolCoach
this.params = {
coachId: schoolCoach.id ,
stduentId: this.studentId,
lng: this.vuex_cityInfo.lng,
lat: this.vuex_cityInfo.lat,
key: schoolCoach.key,
type: schoolCoach.QrType,
}
let fn = vailStudentSignSubject1
if(this.params.type==5) {
fn = vailStudentSignOutSubject1
}
console.log('扫码传的参数')
console.log(this.params)
const res = await fn(this.params)
console.log('第一步校验信息')
console.log(res)
console.log(res.msg)
if(res.code=='200240213') {
this.stepFailureReason = res.msg
// if(res.msg=='退,退') {
// if(!this.count) {
// this.count ++
// console.log('')
// const res2 = await reSignOut({coachId: this.params.coachId})
// console.log('')
// this.vailStudentInfoFn()
// console.log('')
// console.log(res2)
// this.getInitFaceVerifyFn('退')
// }
// }
}
if(res.code==0) {
this.step1 = true
this.params.key = res.data
// this.siginFn()
this.getInitFaceVerifyFn()
}
console.log(res)
},
//
async getInitFaceVerifyFn() {
const verifyPlugin = uni.requireNativePlugin('Ocr-FaceDetectModule');
var metaInfo = verifyPlugin.getMetaInfo()
if(typeof metaInfo =='object' ) {
metaInfo = JSON.stringify(metaInfo)
}
console.log(metaInfo)
const res = await getInitBodyFaceVerify({metaInfo, userId : this.userId})
console.log(res)
let certifyId = res.data.body.resultObject.certifyId
let _this = this
verifyPlugin.verify({
certifyId,
// extParams: {
// kIdentityParamKeyIdCardFaceOnly: 'YES'
// }
}, function(response){
console.log(response)
if(response.code==1000) {
getDescribeBodyFaceVerify({certifyId,}).then((useRes)=>{
_this.step2 = true
_this.params.certifyId = certifyId
_this.siginFn()
})
}else if(response.code==2006) {
_this.$u.toast('认证失败!请确定是本人后再重试')
}else {
_this.$u.toast(response.msg)
}
});
},
// 退
async siginFn() {
let fn = theorySignSubject1
let obj = this.params
if(this.params.type==5) {
fn = theorySignOutSubject1
obj = {
"certifyId": this.params.certifyId,
"signKey": this.params.key,
"coachId": this.params.coachId,
"type": 5,
"key": this.$store.state.school.schoolCoach.key,
"lat": this.vuex_cityInfo.lat,
"lng": this.vuex_cityInfo.lng
}
}
console.log('来到这里没?11')
console.log(obj)
const res = await fn(obj)
if(res.code=='200240213') {
this.$u.toast(res.msg)
}
console.log('签到结果')
console.log(res)
if(res.code==0) {
this.step3 = true
let msg = '签到成功'
if(this.params.type==5) {
msg = '签退成功'
}
this.$u.toast(msg)
setTimeout(()=>{
uni.navigateBack()
},1000)
}
},
//
Recertification() {
if(!this.step1) return
if(!this.step2) {
// this.siginFn()
this.getInitFaceVerifyFn()
}
if(!this.step3) {
this.siginFn()
}
},
goBack() {
uni.navigateBack()
}
}
}
</script>
<style lang="scss" scoped>
.main {
padding: 10rpx 32rpx;
}
.signAndOut {
width: 100%;
height: calc(100vh - 150rpx);
background-color: #fff;
padding: 48rpx;
border-radius: 16rpx;
position: relative;
.footBtn {
padding: 48rpx 100rpx;
position: absolute;
left: 0;
width: 100%;
bottom: 60rpx;
}
.top_row {
display: flex;
justify-content: space-between;
padding: 0 0 0 52rpx;
.flex-box {
display: flex;
align-items: center;
.icon {
width: 28rpx;
height: 28rpx;
image {
display: block;
width: 100%;
height: 100%;
}
}
.txt {
font-size: 28rpx;
color: #FD6401;
margin-left: 14rpx;
}
}
}
.step {
padding: 50rpx 0 0 0;
.li {
width: 100%;
display: flex;
height: 256rpx;
// padding: 0 0 8rpx 0;
.leftIcon {
width: 56rpx;
height: 100%;
position: relative;
.icon {
width: 56rpx;
height: 56rpx;
border-radius: 50%;
font-size: 24rpx;
color: #333;
text-align: center;
line-height: 56rpx;
background: url('../../../../static/images/carIcon/home_icon_weidao@2x.png');
background-size: 100% 100%;
}
.line {
position: absolute;
left: 26rpx;
top: 50rpx;
width: 5rpx;
height: 200rpx;
border: 2rpx solid;
border-image: linear-gradient(180deg, rgba(238, 238, 238, 1), rgba(216, 216, 216, 1)) 2 2;
}
}
.textCon {
flex: 1;
padding: 0 0 0 8rpx;
font-weight: 550;
.text {
font-size: 36rpx;
color: #363A44;
}
.redTps {
font-size: 28rpx;
color: #E63633;
}
}
.btn {
width: 108rpx;
height: 52rpx;
text-align: center;
line-height: 52rpx;
color: #ffffff;
background: linear-gradient(180deg, #53D3E5 0%, #3593FB 100%);
border-radius: 8rpx;
&.red {
background: linear-gradient(180deg, #ea7c48 0%, #f54e40 100%);
}
}
&.active {
.leftIcon {
.icon {
// background: url('../../../static/images/icon/home_icon_yiguo@2x.png');
background-size: 100% 100%;
}
.line {
border-image: linear-gradient(180deg, rgba(83, 211, 229, 1), rgba(53, 147, 251, 1)) 2 2;
}
}
}
}
}
}
.oneBtn {
width: 100%;
height: 96rpx;
border-radius: 48rpx;
font-size: 36rpx;
color: #fff;
background: linear-gradient(180deg, #EEEEEE 0%, #D8D8D8 100%);
text-align: center;
line-height: 96rpx;
&.active {
background: linear-gradient(180deg, #3593FB 0%, #53D3E5 100%);
}
}
</style>

14
pages/indexEntry/signIn/signIn.vue

@ -17,7 +17,7 @@
<script> <script>
import zengCalen from '@/uni_modules/zeng-calen/components/zeng-calen/zeng-calen' import zengCalen from '@/uni_modules/zeng-calen/components/zeng-calen/zeng-calen'
import { scanCodeFn } from '@/config/utils.js' import { scanCodeFn } from '@/config/utils.js'
import { monthSignRecord, signDetail } from '@/config/api.js'
import { monthSignRecord, signDetail, monthSignRecordSubjiect1 } from '@/config/api.js'
export default { export default {
components: {zengCalen}, components: {zengCalen},
data() { data() {
@ -34,7 +34,7 @@
this.monthSignRecordFn() this.monthSignRecordFn()
}, },
methods: { methods: {
//
// -
async monthSignRecordFn() { async monthSignRecordFn() {
const {data: res} = await monthSignRecord({signMonth: this.signMonth}) const {data: res} = await monthSignRecord({signMonth: this.signMonth})
this.chooseDay = res this.chooseDay = res
@ -43,6 +43,16 @@
this.actDay = [day] this.actDay = [day]
this.onDayClick(day) this.onDayClick(day)
} }
this.monthSignRecordSubjiect1Fn()
},
async monthSignRecordSubjiect1Fn() {
const {data: res} = await monthSignRecordSubjiect1({signMonth: this.signMonth})
this.chooseDay = res
if(res&&res.length&&!this.actDay.length) {
let day = res[res.length-1]
this.actDay = [day]
this.onDayClick(day)
}
}, },
changeMonth(ym) { changeMonth(ym) {
console.log(ym) console.log(ym)

2
pages/indexEntry/webView/webView.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="pageBg"> <view class="pageBg">
<web-view :src="link" :webview-styles="webviewStyles" :update-title="false"></web-view>
<web-view :src="usecarStore.webLink" :webview-styles="webviewStyles" :update-title="false"></web-view>
</view> </view>
</template> </template>

6
pages/mineEntry/personaInfo/personaInfo.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="pageBg"> <view class="pageBg">
<view class="pad"> <view class="pad">
<view class="avatarBox" @click="editAvatar">
<view class="avatarBox" @click="editAvatar" v-if="vuex_userInfo.applyStep>1">
<view class="avatar"> <view class="avatar">
<image :src="vuex_userInfo.newPhotoPath?vuex_userInfo.newPhotoPath:vuex_userInfo.photoPath" mode="aspectFill"></image> <image :src="vuex_userInfo.newPhotoPath?vuex_userInfo.newPhotoPath:vuex_userInfo.photoPath" mode="aspectFill"></image>
<view class="imgMask" v-if="vuex_userInfo.avatarCheckStatus==0&&vuex_userInfo.newPhotoPath">审核中</view> <view class="imgMask" v-if="vuex_userInfo.avatarCheckStatus==0&&vuex_userInfo.newPhotoPath">审核中</view>
@ -90,9 +90,7 @@
this.avatarApplyFn() this.avatarApplyFn()
}) })
}, },
onShow() {
if(uni.getStorageSync('avatarBase64')) this.avatarBase64 = uni.getStorageSync('avatarBase64')
},
methods: { methods: {
// //
async avatarApplyFn() { async avatarApplyFn() {

4
pages/tabbar/index/comp/coachItem.vue

@ -3,7 +3,7 @@
<view class="starBoxBg">{{ item.stars || '无'}}</view> <view class="starBoxBg">{{ item.stars || '无'}}</view>
<view class="info"> <view class="info">
<view class="avatar"> <view class="avatar">
<image :src="item.photoPath" mode="" v-if="$u.utils.isImagePath(item.photoPath)"></image>
<image :src="item.photoPath" mode="" v-if="$u.utils.isImagePath(item.photoPath)" lazy-load></image>
<image src="@/static/images/index/avatar.png" mode="" v-else></image> <image src="@/static/images/index/avatar.png" mode="" v-else></image>
</view> </view>
<view class="name">{{ item.name}}</view> <view class="name">{{ item.name}}</view>
@ -32,8 +32,8 @@
width: 280rpx; width: 280rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 20rpx; border-radius: 20rpx;
position: relative;
padding: 0 20rpx; padding: 0 20rpx;
position: relative;
margin-right: 20rpx; margin-right: 20rpx;
.starBoxBg { .starBoxBg {
width: 72rpx; width: 72rpx;

18
pages/tabbar/index/comp/schoolItem.vue

@ -1,7 +1,10 @@
<template> <template>
<view class="itemBox" > <view class="itemBox" >
<view class="img">
<image :src="item.schoolIntroduceDO.iconPath" mode="" v-if="item.schoolIntroduceDO"></image>
<view class="img" v-if="item.schoolIntroduceDO&&item.schoolIntroduceDO.iconPath&&$u.utils.isImagePath(item.schoolIntroduceDO.iconPath)">
<image :src="item.schoolIntroduceDO.iconPath" mode="" @error="imgError" lazy-load style="width: 200rpx;height: 135rpx;display: block;"></image>
</view>
<view class="img" v-else>
<image src="@/static/images/bigImg/jlcbg.png" mode="aspectFill"></image>
</view> </view>
<view class="textCon"> <view class="textCon">
<view class="name oneRowText">{{item.name}}</view> <view class="name oneRowText">{{item.name}}</view>
@ -43,7 +46,11 @@
} }
}, },
methods: { methods: {
imgError() {
delete this.item.schoolIntroduceDO.iconPath
console.log('这图片有问题')
// this.$forceUpdate()
}
} }
} }
</script> </script>
@ -53,7 +60,6 @@
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
padding: 20rpx 0rpx; padding: 20rpx 0rpx;
position: relative;
display: flex; display: flex;
border-bottom: 1px solid #F4F4F4; border-bottom: 1px solid #F4F4F4;
} }
@ -64,8 +70,8 @@
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
flex-shrink: 0; flex-shrink: 0;
background: url('../../../../static/images/bigImg/jlcbg.png') no-repeat;
background-size: cover;
// background: url('../../../../static/images/bigImg/jlcbg.png') no-repeat;
// background-size: cover;
} }
.textCon { .textCon {

52
pages/tabbar/index/index.vue

@ -4,13 +4,14 @@
<view class="TopCon pad" > <view class="TopCon pad" >
<!-- 地址 --> <!-- 地址 -->
<view class="adrsCon"> <view class="adrsCon">
<view class="adr" v-if="vuex_cityInfo.city">{{ vuex_cityInfo.city }} </view>
<!-- <view class="adr" v-else @click="getLatLngFn" style="display: flex;align-items: center;">
<text>获取定位信息</text> <image src="@/static/images/icon/down.png" mode="" style="width: 18rpx;height: 18rpx;margin-left: 6rpx;"></image>
</view> -->
<!-- <view class="adrsIcon">
<view class="adr" v-if="vuex_cityInfo.city" @click="getLatLngFn">{{ vuex_cityInfo.city }} </view>
<view class="adr" v-else @click="getLatLngFn" style="display: flex;align-items: center;">
<text>获取定位信息</text>
<!-- <image src="@/static/images/icon/down.png" mode="" style="width: 18rpx;height: 18rpx;margin-left: 6rpx;"></image> -->
</view>
<view class="adrsIcon">
<image src="@/static/images/icon/down.png" mode=""></image> <image src="@/static/images/icon/down.png" mode=""></image>
</view> -->
</view>
</view> </view>
<view class="flex-b"> <view class="flex-b">
<!-- 搜索 --> <!-- 搜索 -->
@ -55,12 +56,12 @@
</view> </view>
<!-- 优质驾校 --> <!-- 优质驾校 -->
<view class="schoolCon card" v-if="recommendSchool.length">
<view class="schoolCon card" v-show="recommendSchool.length">
<view class="h1_row"> <view class="h1_row">
<view class="h1" ><text class="active">风采驾校</text></view> <view class="h1" ><text class="active">风采驾校</text></view>
<moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findShcool/findShcool')"/> <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findShcool/findShcool')"/>
</view> </view>
<view class="li" v-for="(item,index) in recommendSchool" :key="index" @click="$goPage('/pages/indexEntry/findShcool/shcoolDetail/shcoolDetail?schoolId='+ item.id)">
<view class="li" v-for="(item,index) in recommendSchool" :key="index" @click="$goPage('/pages/indexEntry/findShcool/shcoolDetail/shcoolDetail?schoolId='+ item.id)" style="height: 176rpx;">
<schoolItem :item="item"/> <schoolItem :item="item"/>
</view> </view>
</view> </view>
@ -192,7 +193,7 @@
} }
}, },
async onLoad() { async onLoad() {
this.initApi()
}, },
onPullDownRefresh() { onPullDownRefresh() {
@ -225,7 +226,9 @@
this.getBannerListFn() this.getBannerListFn()
// this.getarticleListFn() // this.getarticleListFn()
} }
this.initApi()
if(this.vuex_cityInfo.lat != this.lat) {
this.recommendSchoolList()
}
}, },
computed: { computed: {
@ -233,6 +236,9 @@
methods: { methods: {
async getLatLngFn() { async getLatLngFn() {
uni.showLoading({
title: '正在更新位置...'
})
await this.$store.dispatch('getCity') await this.$store.dispatch('getCity')
this.recommendSchoolList() this.recommendSchoolList()
}, },
@ -244,10 +250,14 @@
this.$store.commit('updateWebVeiwUrl', link) this.$store.commit('updateWebVeiwUrl', link)
this.$goPage('/pages/indexEntry/webView/webView') this.$goPage('/pages/indexEntry/webView/webView')
}, },
initApi() {
this.getarticleListFn()
this.getRecommendList()
this.recommendSchoolList()
async initApi() {
uni.showLoading({
title: '正在加载...'
})
await this.getarticleListFn()
await this.getRecommendList()
await this.recommendSchoolList()
this.$nextTick(()=>{uni.hideLoading()})
}, },
goCoachDetail(item) { goCoachDetail(item) {
let objStr = encodeURIComponent(JSON.stringify(item)) let objStr = encodeURIComponent(JSON.stringify(item))
@ -257,22 +267,26 @@
async getRecommendList() { async getRecommendList() {
const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, }) const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, })
this.coachList = res this.coachList = res
console.log(res)
// console.log(res)
}, },
// //
async recommendSchoolList() { async recommendSchoolList() {
// if(!this.vuex_cityInfo.lat) { // if(!this.vuex_cityInfo.lat) {
// await this.$store.dispatch('getCity') // await this.$store.dispatch('getCity')
// } // }
const {data: res} = await recommendSchoolList({pageNo:1,pageSize: 3, lat: this.vuex_cityInfo.lat||'34.682945', lng: this.vuex_cityInfo.lng||'112.477298'})
this.recommendSchool = res
console.log(res)
this.lat = this.vuex_cityInfo.lat
const {data: res} = await recommendSchoolList({pageNo:1,pageSize: 20, lat: this.vuex_cityInfo.lat||'34.682945', lng: this.vuex_cityInfo.lng||'112.477298'})
res[8].schoolIntroduceDO.iconPath = ''
res[9].schoolIntroduceDO.iconPath = ''
this.recommendSchool = Object.freeze(res)
// this.recommendSchool = res
// console.log(res)
}, },
async getBannerListFn() { async getBannerListFn() {
const {data: res} = await getBannerList() const {data: res} = await getBannerList()
this.swiperInfo = res.list this.swiperInfo = res.list
console.log(this.swiperInfo)
// console.log(this.swiperInfo)
}, },
async entrySectionClick(item) { async entrySectionClick(item) {
if(item.text=='学车报名') { if(item.text=='学车报名') {

8
pages/tabbar/mine/index.vue

@ -45,7 +45,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="logout" @click="deleteTestClick" style="margin-top: 40rpx;">删除测试账号开发用的</view> -->
<!-- <view @click="gotk" text="去题库">去题库</view> --> <!-- <view @click="gotk" text="去题库">去题库</view> -->
<u-popup :show="show" mode="center" @close="show=false" :closeable="true"> <u-popup :show="show" mode="center" @close="show=false" :closeable="true">
@ -58,6 +58,7 @@
<script> <script>
import { scanCodeFn } from '@/config/utils.js' import { scanCodeFn } from '@/config/utils.js'
import { deleteTest } from '@/config/api.js'
export default { export default {
data() { data() {
return { return {
@ -84,6 +85,11 @@
if(this.show) this.show = false if(this.show) this.show = false
}, },
methods: { methods: {
async deleteTestClick() {
const res = await deleteTest({phone: 18267103167})
this.$store.commit('goLogin')
console.log(res)
},
gotk() { gotk() {
this.$store.commit('updateWebVeiwUrl', 'http://192.168.1.94:1314/h5#/pages/exercises/brushQuestions/brushQuestions') this.$store.commit('updateWebVeiwUrl', 'http://192.168.1.94:1314/h5#/pages/exercises/brushQuestions/brushQuestions')
uni.navigateTo({ uni.navigateTo({

12
pages/userCenter/login/login.vue

@ -9,7 +9,7 @@
<view class="title">短信验证码登录</view> <view class="title">短信验证码登录</view>
<view class="form"> <view class="form">
<view class="form-item"> <view class="form-item">
<view class="prefix">
<view class="prefix" id="head_wrapper">
<view class="jia">+</view> <view class="jia">+</view>
<view class="num">86</view> <view class="num">86</view>
<view class="" style="margin: 0 32rpx 0 12rpx;"> <view class="" style="margin: 0 32rpx 0 12rpx;">
@ -63,7 +63,15 @@
if(options.autoBack) this.autoBack = '' if(options.autoBack) this.autoBack = ''
console.log(this.autoBack) console.log(this.autoBack)
}, },
computed: {
onShow() {
// console.log(Object.prototype.toString.call([]).slice(8, -1))
// console.log({}.__proto__===Array.prototype)
// console.log(Array.isArray([]))
// console.log({} instanceof Array)
// console.log(Array.prototype.isPrototypeOf([]))
},
computed: {
isPhone() { isPhone() {
return uni.$u.test.mobile(this.FormData.phone) return uni.$u.test.mobile(this.FormData.phone)
}, },

204
pages/userCenter/login/new_file.html

@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
<script>
// 1,dom转json
const dom = document.getElementById('s-news-rank-content');
function dom2json(dom) {
let obj = {};
obj.name = dom.tagName;
obj.children = [];
dom.childNodes.forEach(child => obj.children.push(dom2json(child)))
return obj;
}
console.log(dom2json(dom))
// 2,json转dom
const json = {
tag: 'div',
attrs: {
id: 'app', class: 'app',
},
children: [{
tag: 'ul',
children: [
{tag: 'li', children: ['list1']},
{tag: 'li', children: ['list2']},
{tag: 'li', children: ['list3']},
{tag: 'li', children: ['list4']},
{tag: 'li', children: ['list5']},
]
},
{tag: 'div',
children: ['我是个球']}
]
}
function json2dom(vnode) {
if(typeof vnode=='string'||typeof vnode=='number') {
return document.createTextNode(String(vnode))
}else {
const _dom = document.createElement(vnode.tag)
if(vnode.attrs) {
Object.entries(vnode.attrs).forEach(([key, value])=>{
console.log(key, value)
_dom.setAttribute(key, value)
})
}
vnode.children.forEach((item)=>_dom.appendChild(json2dom(item)))
return _dom
}
}
let dom2 = json2dom(json)
let root = document.getElementById('root')
root.appendChild(dom2)
// 3,树转list
let tree = [{
id: 1,
text: '根节点',
children: [
{
id: 2,
text: '一级节点1'
},
{
id: 3,
text: '一级节点2',
children: [
{
id: 4,
text: '二级节点2-1'
},
{
id: 5,
text: '二级节点2-2'
}
]
}
]
}]
function treeToList(root) {
let res = []
const dfs = function (data, parentId) {
data.forEach((item)=>{
if(item.children) {
dfs(item.children, item.id)
delete (item.children)
}
item.parentId = parentId
res.push(item)
})
}
dfs(root, 0)
return res
}
// 4,list转树
const list = [
{
"id": 2,
"text": "一级节点1",
"parentId": 1
},
{
"id": 4,
"text": "二级节点2-1",
"parentId": 3
},
{
"id": 6,
"text": "二级节点2-2",
"parentId": 3
},
{
"id": 3,
"text": "一级节点2",
"parentId": 1
},
{
"id": 1,
"text": "根节点",
"parentId": 0
}
]
function listToTree(data) {
let deps = {}
let result = []
data.forEach(item=>{deps[item.id] = item})
for(let i in deps) {
if(deps[i].parentId!=0) {
console.log(deps[deps[i].parentId], '不会了')
if(!deps[deps[i].parentId].children) {
deps[deps[i].parentId].children = []
}
deps[deps[i].parentId].children.push(deps[i])
}else {
result.push(deps[i])
}
}
return result
}
console.log(listToTree(list))
// 5,数组打平
let arr = [1,2,[3,4,[5,6]]]
function flatten(arr) {
if(!arr.length) return
return arr.reduce((pre,cur)=> Array.isArray(cur)?[...pre, ...flatten(cur)]:[...pre,cur], [])
}
console.log(flatten(arr))
//6, 对象打平
let obj = {
a: {
b: {
e: 2,
c: {
d: 1
}
}
}
}
function flatten(obj) {
if(typeof obj !== 'object' || obj===null) return
let res = {}
const dfs = function(cur, prefix) {
if(typeof cur == 'object' && cur!==null) {
for(let k in cur) {
dfs(cur[k], `${prefix}${prefix?'.':''}${k}`)
}
}else {
res[prefix] = cur
}
}
dfs(obj, '')
console.log(res)
// return res
}
flatten(obj)
</script>
<style>
.app {
background-color: aquamarine;
}
</style>

7
store/modules/user.js

@ -135,6 +135,7 @@ export default user
// h5高德地图 // h5高德地图
function gaoDeFn(longitude,latitude,commit,resolve, reject,) { function gaoDeFn(longitude,latitude,commit,resolve, reject,) {
uni.request({ uni.request({
method: 'GET', method: 'GET',
url: 'https://restapi.amap.com/v3/geocode/regeo?parameters', url: 'https://restapi.amap.com/v3/geocode/regeo?parameters',
@ -172,6 +173,7 @@ function getCityInfo(resolve, reject, commit) {
// import { requestSingleFreshLocation } from '@/common/js/qqLatLng.js' // import { requestSingleFreshLocation } from '@/common/js/qqLatLng.js'
let qqLatLng = require('@/common/js/qqLatLng.js') let qqLatLng = require('@/common/js/qqLatLng.js')
try{ try{
qqLatLng.requestSingleFreshLocation().then(res=>{ qqLatLng.requestSingleFreshLocation().then(res=>{
let result = res.location let result = res.location
if(result.latitude===0) { if(result.latitude===0) {
@ -184,13 +186,14 @@ function getCityInfo(resolve, reject, commit) {
console.log('只为弹出权限当前位置的经度:' + res.longitude); console.log('只为弹出权限当前位置的经度:' + res.longitude);
// console.log('当前位置的纬度:' + res); // console.log('当前位置的纬度:' + res);
getCityInfo(resolve, reject, commit) getCityInfo(resolve, reject, commit)
uni.hideLoading()
}, },
fail() { fail() {
uni.showToast({ uni.showToast({
title: '您的定位权限已关闭,请手动开启定位权限', title: '您的定位权限已关闭,请手动开启定位权限',
icon: 'none' icon: 'none'
}) })
uni.hideLoading()
} }
}) })
}else { }else {
@ -206,11 +209,13 @@ function getCityInfo(resolve, reject, commit) {
} }
commit('update_vuex_cityInfo', obj) commit('update_vuex_cityInfo', obj)
resolve(obj) resolve(obj)
uni.hideLoading()
} }
}) })
}catch(e){ }catch(e){
console.log('来到这是里了吗?腾讯云经纬度了') console.log('来到这是里了吗?腾讯云经纬度了')
uni.hideLoading()
uni.getLocation({ uni.getLocation({
// type: 'wgs84', // type: 'wgs84',
type: 'gcj02', type: 'gcj02',

Loading…
Cancel
Save