Browse Source

refactor(images): 更新图片资源引用方式

- 将静态图片资源引用方式改为动态引用
- 使用 $util.img() 方法统一处理图片路径
- 更新部分组件和页面的图片资源路径
master
王泽彦 10 months ago
parent
commit
d963c5fc1f
  1. 30
      api/apiRoute.js
  2. 1
      components/AQ/AQUplodeImage.vue
  3. 2
      manifest.json
  4. 40
      pages/coach/class/info.vue
  5. 21
      pages/coach/class/list.vue
  6. 59
      pages/student/index/index.vue
  7. 130
      pages/student/login/login.vue
  8. 21
      pages/student/my/my.vue
  9. 234
      pages/student/my/personal_data.vue
  10. BIN
      static/images/common/black_arrow_right.png
  11. BIN
      static/images/common/closex.png
  12. BIN
      static/images/common/clousex-big.png
  13. BIN
      static/images/common/common_icon_jump_gold.png
  14. BIN
      static/images/common/delete.png
  15. BIN
      static/images/common/edit.png
  16. BIN
      static/images/common/fa_song.png
  17. BIN
      static/images/common/gift_icon_close_new.png
  18. BIN
      static/images/common/gouxuankuang.png
  19. BIN
      static/images/common/gray_arrow_down.png
  20. BIN
      static/images/common/icon-close.png
  21. BIN
      static/images/common/icon-drop-down.png
  22. BIN
      static/images/common/icon_about.png
  23. BIN
      static/images/common/icon_black_back.png
  24. BIN
      static/images/common/icon_jump_black3.png
  25. BIN
      static/images/common/image-delete.png
  26. BIN
      static/images/common/jia_hao.png
  27. BIN
      static/images/common/jump-r-arrow.png
  28. BIN
      static/images/common/menu_icon_empty.png
  29. BIN
      static/images/common/more-arrow-right.png
  30. BIN
      static/images/common/round-black-selected.png
  31. BIN
      static/images/common/round_add_disabled.png
  32. BIN
      static/images/common/round_add_normal.png
  33. BIN
      static/images/common/round_minus.png
  34. BIN
      static/images/common/search-icon.png
  35. BIN
      static/images/common/star_normal.png
  36. BIN
      static/images/common/xi_tong_xiao_xi.png
  37. BIN
      static/images/common/yong_hu.png
  38. BIN
      static/images/home/chaungjian.png
  39. BIN
      static/images/home/tixing.png
  40. BIN
      static/images/home/wang.png
  41. BIN
      static/images/home/yong.png
  42. BIN
      static/images/index/addto.png
  43. BIN
      static/images/index/check_mark.png
  44. BIN
      static/images/index/danlan.png
  45. BIN
      static/images/index/danlv.png
  46. BIN
      static/images/index/dian.png
  47. BIN
      static/images/index/hong.png
  48. BIN
      static/images/index/huang.png
  49. BIN
      static/images/index/icon_shopping_bag.png
  50. BIN
      static/images/index/img.jpg
  51. BIN
      static/images/index/intention1.png
  52. BIN
      static/images/index/intention2.png
  53. BIN
      static/images/index/intention3.png
  54. BIN
      static/images/index/lan.png
  55. BIN
      static/images/index/lv.png
  56. BIN
      static/images/index/lvs.png
  57. BIN
      static/images/index/manjian.png
  58. BIN
      static/images/index/me_icon_notification.png
  59. BIN
      static/images/index/menu_btn_close.png
  60. BIN
      static/images/index/menu_icon_popup_triangle_normal.png
  61. BIN
      static/images/index/menupopup_btn_share_normal.png
  62. BIN
      static/images/index/menupopup_btn_share_quanzi.png
  63. BIN
      static/images/index/menupopup_btn_share_wechat.png
  64. BIN
      static/images/index/message.png
  65. BIN
      static/images/index/myk.png
  66. BIN
      static/images/index/phone.png
  67. BIN
      static/images/index/rexiao.png
  68. BIN
      static/images/index/round-cancel.png
  69. BIN
      static/images/index/round.png
  70. BIN
      static/images/index/round_close_btn.png
  71. BIN
      static/images/index/score.png
  72. BIN
      static/images/index/score1.png
  73. BIN
      static/images/index/setup.png
  74. BIN
      static/images/index/shadow_yellow_star.png
  75. BIN
      static/images/index/shenlan.png
  76. BIN
      static/images/index/star.png
  77. BIN
      static/images/index/task.png
  78. BIN
      static/images/index/tuijian.png
  79. BIN
      static/images/index/work_details.png
  80. BIN
      static/images/index/writing.png
  81. BIN
      static/images/index/xinpin.png
  82. BIN
      static/images/index/yellow_star.png
  83. BIN
      static/images/index/zan_wu.png
  84. BIN
      static/images/login/login1.png
  85. BIN
      static/images/login/login2.png
  86. BIN
      static/images/login/wechat1.png
  87. BIN
      static/images/mall/b3d3a98e3c7f450aaa32fbec6aecdfaf.png
  88. BIN
      static/images/mall/img_pointmall_star.png
  89. BIN
      static/images/mall/me_img_banner_mall.png
  90. BIN
      static/images/mall/me_pointmall_img_nogift.png
  91. BIN
      static/images/mall/store_brh_home_page_normal.png
  92. BIN
      static/images/mall/store_brh_service_normal.png
  93. BIN
      static/images/member/me_club_task_img_done.png
  94. BIN
      static/images/my/b3d3a98e3c7f450aaa32fbec6aecdfaf.png
  95. BIN
      static/images/my/coupons-empty.png
  96. BIN
      static/images/my/icon_arrow.png
  97. BIN
      static/images/my/icon_attention.png
  98. BIN
      static/images/my/icon_giftcard.png
  99. BIN
      static/images/my/icon_rules.png
  100. BIN
      static/images/my/img_giftcard_empty.png

30
api/apiRoute.js

@ -98,6 +98,14 @@ export default {
//公共端-获取配置项 //公共端-获取配置项
common_getConfig(data = {}) { common_getConfig(data = {}) {
let url = '/common/getConfig' let url = '/common/getConfig'
return http.get(url, data).then(res => {
return res;
})
},
//公共端-获取配置项
common_getMiniWxOpenId(data = {}) {
let url = '/common/getMiniWxOpenId'
return http.post(url, data).then(res => { return http.post(url, data).then(res => {
return res; return res;
}) })
@ -167,6 +175,13 @@ export default {
return http.get(url, data).then(res => { return http.get(url, data).then(res => {
return res; return res;
}) })
},
//获取班级详情
jlClassInfo(data = {}) {
let url = '/class/jlClassInfo'
return http.get(url, data).then(res => {
return res;
})
}, },
//获取课程列表 //获取课程列表
courseList(data = {}) { courseList(data = {}) {
@ -388,7 +403,20 @@ export default {
//↓↓↓↓↓↓↓↓↓↓↓↓-----学生接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓ //↓↓↓↓↓↓↓↓↓↓↓↓-----学生接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//学生登陆接口
xy_login(data = {}) {
let url = '/customerResourcesAuth/login'
return http.post(url, data).then(res => {
return res;
})
},
//学生详情
xy_memberInfo(data = {}) {
let url = '/customerResourcesAuth/info'
return http.get(url, data).then(res => {
return res;
})
},

1
components/AQ/AQUplodeImage.vue

@ -1,3 +1,4 @@
<!--单图自定义按钮上传-->
<template> <template>
<view @click="chooseImage"> <view @click="chooseImage">
<slot></slot> <slot></slot>

2
manifest.json

@ -62,7 +62,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx675f2696abf932c5", "appid" : "wxdaf2fffe7e397c01",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : true, "minified" : true,

40
pages/coach/class/info.vue

@ -8,31 +8,31 @@
<view class="main_section"> <view class="main_section">
<view class="section_1"> <view class="section_1">
<!-- <view class="left">--> <view class="left">
<!-- <image class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image>--> <image class="pic" :src="classInfo.head_coach_head_img"></image>
<!-- <view class="name">包皮子</view>--> <view class="name">{{classInfo.head_coach_name}}</view>
<!-- </view>--> </view>
<view class="right"> <view class="right">
<view class="item"> <view class="item">
班级{{classInfo.name}} 班级{{classInfo.class_name}}
</view> </view>
<view class="item"> <view class="item">
地点{{classInfo.address}} 校区{{classInfo.campus_name}}
</view> </view>
<!-- <view class="item">--> <!-- <view class="item">
<!-- 课程篮球少儿课--> <!-- 课程篮球少儿课
<!-- </view>--> <!-- </view>-->
<view class="item"> <view class="item">
人数{{classInfo.max_students}} 人数{{classInfo.classPersonnelRel.length}}
</view> </view>
<!--
<view class="item"> <view class="item">
时间{{classInfo.start_date}} - {{classInfo.end_date}} 时间{{classInfo.start_date}} - {{classInfo.end_date}}
</view> </view> -->
</view> </view>
</view> </view>
@ -76,29 +76,29 @@
<view class="ul"> <view class="ul">
<view <view
class="li" class="li"
v-for="(v,k) in classMemberList" v-for="(v,k) in classInfo.classPersonnelRel"
:key="k" :key="k"
@click="openViewStudentInfo(v)" @click="openViewStudentInfo(v)"
> >
<view class="left"> <view class="left">
<view class="box_1"> <view class="box_1">
<image class="pic" :src="$util.img(v.header)"></image> <image class="pic" :src="$util.img(v.student.customerResources.member.headimg)"></image>
<view class="tag_box" v-if="v.expire"> <view class="tag_box" v-if="v.expire">
即将到期 即将到期
</view> </view>
</view> </view>
<view class="box_2"> <view class="box_2">
<view class="name">{{ v.name }}</view> <view class="name">{{ v.student.name }}</view>
<view class="date">课程截止时间{{ $util.formatToDateTime(v.expire_time, 'Y-m-d') }}</view> <view class="date">课程截止时间{{ $util.formatToDateTime(v.end_date, 'Y-m-d') }}</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="item"> <view class="item">
<view>{{ v.have_study_time }}</view> <view>{{ v.studentCoursesInfo.use_gift_hours + v.studentCoursesInfo.use_gift_hours }}</view>
<view>已上课时</view> <view>已上课时</view>
</view> </view>
<view class="item"> <view class="item">
<view>{{ v.end_study_time }}</view> <view>{{ (v.studentCoursesInfo.total_hours + v.studentCoursesInfo.gift_hours) - (v.studentCoursesInfo.use_gift_hours + v.studentCoursesInfo.use_gift_hours) }}</view>
<view>剩余课时</view> <view>剩余课时</view>
</view> </view>
</view> </view>
@ -180,7 +180,7 @@
<script> <script>
import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default { export default {
components: { components: {
@ -227,13 +227,13 @@ export default {
// member/course_list// // member/course_list//
// member/class_info//+ // member/class_info//+
this.getClassInfo()// this.getClassInfo()//
await this.getCourseList()// //await this.getCourseList()//
}, },
//- //-
async getClassInfo(){ async getClassInfo(){
let res = await memberApi.jlClassInfo({class_id:this.class_id})// let res = await apiRoute.jlClassInfo({class_id:this.class_id})//
if(res.code != 1){ if(res.code != 1){
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,

21
pages/coach/class/list.vue

@ -17,7 +17,7 @@
scroll-y="true" scroll-y="true"
:lower-threshold="lowerThreshold" :lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData" @scrolltolower="loadMoreData"
style="height: 80vh;" style="height: 65vh;"
> >
<view <view
class="li" class="li"
@ -26,21 +26,21 @@
@click="openViewClassInfo(v)" @click="openViewClassInfo(v)"
> >
<view class="left"> <view class="left">
<!-- <image class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image>--> <image class="pic" :src="v.head_coach_head_img"></image>
</view> </view>
<view class="right"> <view class="right">
<view class="box_1"> <view class="box_1">
<view class="name"> <view class="name">
{{v.name}} {{v.class_name}}
</view> </view>
<view class="btn_box"> <view class="btn_box">
<view v-if="v.end_count">{{v.end_count}}人即将到期</view> <view v-if="v.end_count">{{v.end_count}}人即将到期</view>
</view> </view>
</view> </view>
<view class="box_2"> <view class="box_2">
<view class="user_list" v-for="(v2,k2) in v.students_list" :key="k2"> <view class="user_list" v-for="(v2,k2) in v.classPersonnelRel" :key="k2">
<image <image
:src="$util.img(v2.header)"></image> :src="$util.img(v2.student.customerResources.member.headimg)"></image>
</view> </view>
<view class="num">{{v.students_count}}</view> <view class="num">{{v.students_count}}</view>
</view> </view>
@ -83,7 +83,7 @@ export default {
}, },
onLoad(options) {}, onLoad(options) {},
onShow(){ onShow(){
//this.init()// this.init()//
}, },
methods: { methods: {
// //
@ -148,14 +148,14 @@ export default {
}, },
async search(e){ async search(e){
//await this.resetFilteredData() await this.resetFilteredData()
this.filteredData.name = e this.filteredData.name = e
//await this.getList() await this.getList()
}, },
// //
openViewClassInfo(item){ openViewClassInfo(item){
let class_id = item.class_id let class_id = item.id
uni.navigateTo({ uni.navigateTo({
url: `/pages/coach/class/info?class_id=${class_id}` url: `/pages/coach/class/info?class_id=${class_id}`
}) })
@ -191,7 +191,7 @@ export default {
} }
.main_section{ .main_section{
min-height: 100vh; // min-height: 100vh;
background: #292929 100%; background: #292929 100%;
padding: 0 24rpx; padding: 0 24rpx;
padding-top: 40rpx; padding-top: 40rpx;
@ -236,6 +236,7 @@ export default {
padding: 50rpx 36rpx 46rpx; padding: 50rpx 36rpx 46rpx;
border-radius: 16rpx; border-radius: 16rpx;
display: flex; display: flex;
align-items: center;
gap: 32rpx; gap: 32rpx;
.left{ .left{
.pic{ .pic{

59
pages/student/index/index.vue

@ -6,7 +6,7 @@
<view class="head"> <view class="head">
<view class="head-img"> <view class="head-img">
<!-- <fui-avatar width="136" :src="$util.img(member_info.headimg)"></fui-avatar> --> <!-- <fui-avatar width="136" :src="$util.img(member_info.headimg)"></fui-avatar> -->
<image class="pic" :src="$util.img(member_info.headimg)"></image> <image class="pic" :src="member_info.memberHasOne ? member_info.memberHasOne.headimg : $util.img('/uniapp_src/static/images/common/yong_hu.png')"></image>
<view class="head-text">{{member_info.name}}</view> <view class="head-text">{{member_info.name}}</view>
</view> </view>
</view> </view>
@ -123,6 +123,8 @@
<script> <script>
import {Api_url} from "@/common/config"; import {Api_url} from "@/common/config";
import apiRoute from '@/api/apiRoute.js';
import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
export default { export default {
@ -131,12 +133,15 @@
}, },
data() { data() {
return { return {
inited: false, // init
// //
uploadApiUrl: ``, uploadApiUrl: ``,
uploadImageApiUrl: `${Api_url}/file/image`, uploadImageApiUrl: `${Api_url}/file/image`,
uploadVideoApiUrl: `${Api_url}/file/video`, uploadVideoApiUrl: `${Api_url}/file/video`,
member_info: [], member_info: {},//
assignmentsList: [],// assignmentsList: [],//
jobAssignmentsInfo: [],// jobAssignmentsInfo: [],//
@ -168,23 +173,27 @@
} }
}, },
onLoad() { onLoad() {
this.openViewHome()//-
}, },
onShow(){ onShow(){
this.openViewHome()//- // onShow init
if (!this.inited) {
this.init()
this.inited = true
}
}, },
methods: { methods: {
// //
async init(){ async init(){
this.member_init() await this.member_init()
this.getMemberIndex() this.getMemberIndex()
this.getList() this.getList()
this.getJobAssignmentsInfo() this.getJobAssignmentsInfo()
}, },
//-
async openViewHome(){ async openViewHome_COPY(){
// //
let pages = getCurrentPages(); let pages = getCurrentPages();
// //
@ -194,21 +203,24 @@
this.openPath = this.path_arr[userType] this.openPath = this.path_arr[userType]
console.log(
'跳转',
this.thisPath,
userType,
this.path_arr[userType]
)
if(this.thisPath != this.openPath){ if(this.thisPath != this.openPath){
console.log('打印1')
//tabBar- //tabBar-
uni.setStorageSync('tabBerIndex', 0) uni.setStorageSync('tabBerIndex', 0)
uni.navigateTo({ uni.navigateTo({
url: this.openPath url: this.openPath
}) })
return
}else{ }else{
// //->
this.init() this.init()
} }
console.log(123123123123,this.thisPath,userType,this.path_arr[userType])
}, },
async getMemberIndex(){ async getMemberIndex(){
@ -269,15 +281,20 @@
}, },
// //
member_init() { async member_init() {
memberApi.member().then(res => { let res = await apiRoute.xy_memberInfo({})
if(res.code == 1){ if(res.code != 1){
this.member_info = res.data uni.showToast({
}else{ title: res.msg,
this.member_info = [] icon: 'none'
}
}) })
return
}
this.member_info = res.data
console.log('xxxx',this.member_info)
}, },
//-
details() { details() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/student/index/work_details' url: '/pages/student/index/work_details'

130
pages/student/login/login.vue

@ -25,7 +25,6 @@
</fui-input> </fui-input>
</view> </view>
<view style="width: 95%;height: 30rpx;"></view>
<view style="width: 95%;margin:30rpx auto;"> <view style="width: 95%;margin:30rpx auto;">
<fui-input <fui-input
@click="picker_show_loginType=true" @click="picker_show_loginType=true"
@ -64,6 +63,8 @@ import apiRoute from '@/api/apiRoute.js';
export default { export default {
data() { data() {
return { return {
inited: false, // init
password: true, password: true,
user: '', // user: '', //
password1: '', // password1: '', //
@ -86,6 +87,13 @@ export default {
} }
], ],
picker_show_loginType:false,// picker_show_loginType:false,//
path_arr:{
'1':'/pages/coach/home/index',//
'2':'/pages/market/index/index',//
'3':'/pages/student/index/index',//
},
} }
}, },
onLoad(options) { onLoad(options) {
@ -94,14 +102,21 @@ export default {
this.loginType_str = selectedItem ? selectedItem.text : '未知类型'; this.loginType_str = selectedItem ? selectedItem.text : '未知类型';
// uni.hideHomeButton() // uni.hideHomeButton()
// console.log(uni.getStorageSync('um_id')) // console.log(uni.getStorageSync('um_id'))
this.init() // onShow init
if (!this.inited) {
this.openViewHome()
this.inited = true
}
}, },
methods: { methods: {
async init(){ async init(){
await this.getWxConfig() //
//#ifdef MP-WEIXIN
await this.getMiNiWxOpenId()
//#endif
}, },
input(e) { input(e) {
console.log(e) //console.log(e)
}, },
change() { change() {
this.password = !this.password this.password = !this.password
@ -149,6 +164,7 @@ export default {
'phone': this.user, 'phone': this.user,
'password': this.password1, 'password': this.password1,
'login_type': 1, 'login_type': 1,
'mini_wx_openid':this.mini_wx_openid,//openid
} }
res = await apiRoute.personnelLogin(params) res = await apiRoute.personnelLogin(params)
}else if(this.loginType == 2){ }else if(this.loginType == 2){
@ -158,11 +174,20 @@ export default {
'phone': this.user, 'phone': this.user,
'password': this.password1, 'password': this.password1,
'login_type': 2, 'login_type': 2,
'mini_wx_openid':this.mini_wx_openid,//openid
} }
res = await apiRoute.personnelLogin(params) res = await apiRoute.personnelLogin(params)
console.log(123123,res) console.log(123123,res)
}else if (this.loginType == 3){ }else if (this.loginType == 3){
//
let params = {
'phone': this.user,
'password': this.password1,
'login_type': 2,
'mini_wx_openid':this.mini_wx_openid,//openid
}
res = await apiRoute.xy_login(params)
} }
if(!res.code){ if(!res.code){
@ -202,56 +227,34 @@ export default {
}) })
}, },
async getWxConfig(){ //openid
let params = { // code openid
config_key: 'WECHAT' async getMiNiWxOpenId() {
}
let res = await apiRoute.common_getConfig(params)
if ( res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
let appid = res.data.app_id || ''
let secret = res.data.app_secret || ''
if(!appid || !secret){
uni.showToast({
title: '请配置微信小程序信息',
icon: 'none'
})
}
await this.loginWx(appid, secret)
},
async loginWx(appid,secret) {
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (res) => { success: (res) => {
console.log(res.code); // code const code = res.code;
this.fetchOpenId(code); //
// code openid
uni.request({
url: 'https://api.weixin.qq.com/sns/jscode2session',
data: {
appid: '你的AppID', // AppID
secret: '你的AppSecret', // AppSecret
js_code: res.code,
grant_type: 'authorization_code'
},
success: (wxRes) => {
console.log('获取到的 openid:', wxRes.data.openid); // openid
}, },
fail: () => { fail: () => {
console.error('请求失败'); uni.showToast({ title: '微信登录失败', icon: 'none' });
} }
}); });
}, },
fail: () => { // code openid
console.error('uni.login 失败'); async fetchOpenId(code){
let params = {
code: code,
} }
}); let res = await apiRoute.common_getMiniWxOpenId(params)
if (res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.mini_wx_openid = res.data.openid
}, },
// //
@ -272,10 +275,43 @@ export default {
this.password1= '123123' // this.password1= '123123' //
}else{ }else{
// //
this.user= '' // this.user= '15335526445' //
this.password1= '' // this.password1= '123123' //
}
},
//-
async openViewHome() {
const userType = String(uni.getStorageSync('userType') || '');
const token = uni.getStorageSync('token') || ''
if(!userType || !token){
return
} }
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const thisPath = '/' + currentPage.route;
const openPath = this.path_arr[userType];
console.log('当前路径:', thisPath);
console.log('用户类型:', userType);
console.log('应跳转路径:', openPath);
if (thisPath !== openPath) {
//
uni.setStorageSync('tabBerIndex', 0)
// 使 redirectTo navigateTo
uni.redirectTo({
url: openPath
});
return
}
// onShow
}, },
} }
} }

21
pages/student/my/my.vue

@ -9,7 +9,7 @@
<view class="user_section"> <view class="user_section">
<view class="box"> <view class="box">
<view class="left" @click="personal_data"> <view class="left" @click="personal_data">
<image class="pic" :src="$util.img(member_info.headimg)"></image> <image class="pic" :src="member_info.memberHasOne ? member_info.memberHasOne.headimg : $util.img('/uniapp_src/static/images/common/yong_hu.png')"></image>
<view class="name">{{member_info.name}}</view> <view class="name">{{member_info.name}}</view>
</view> </view>
<view class="right" @click="setup"> <view class="right" @click="setup">
@ -57,7 +57,7 @@
<!-- </view>--> <!-- </view>-->
<view class="item" @click="openViewContractList()"> <view class="item" @click="openViewContractList()">
<view>我的合同</view> <view>我的订单</view>
<view></view> <view></view>
</view> </view>
</view> </view>
@ -89,6 +89,7 @@
<script> <script>
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
import member from '@/api/member.js'; import member from '@/api/member.js';
export default { export default {
components: { components: {
@ -104,14 +105,16 @@
}, },
methods: { methods: {
// //
member_init() { async member_init() {
member.member().then(res => { let res = await apiRoute.xy_memberInfo({})
if(res.code == 1){ if(res.code != 1){
this.member_info = res.data uni.showToast({
}else{ title: res.msg,
this.member_info = [] icon: 'none'
}
}) })
return
}
this.member_info = res.data
}, },
// //
setup(item) { setup(item) {

234
pages/student/my/personal_data.vue

@ -5,11 +5,16 @@
<view class="main_section"> <view class="main_section">
<view class="section"> <view class="section">
<view class="item"> <view class="item">
<image @click="changeAvatar()" class="pic" :src="$util.img(formData.headimg)" <image @click="previewImage(editHeadimg)" class="pic" :src="editHeadimg"></image>
v-if="upload_type == 1"> <view class="btn">
<image @click="changeAvatar()" class="pic" :src="uploadHeadimg" v-else> <AQUplodeImage
</image> :uploadUrl=uploadUrl
<view class="btn" @click="changeAvatar()">修改头像</view> :extraData="{ input_name: 'headimg', formData:{} }"
@uplodeImageRes="uplodeImageRes"
>
修改头像
</AQUplodeImage>
</view>
</view> </view>
</view> </view>
@ -28,18 +33,18 @@
账号 <text class="required"></text> 账号 <text class="required"></text>
</view> </view>
<view class="input"> <view class="input">
<input disabled placeholder="暂无" v-model="formData.username" /> <input disabled placeholder="暂无" v-model="formData.memberHasOne.mobile" />
</view> </view>
</view> </view>
<view class="item"> <!-- <view class="item">-->
<view class="title"> <!-- <view class="title">-->
住址 <text class="required"></text> <!-- 住址 <text class="required"></text>-->
</view> <!-- </view>-->
<view class="input"> <!-- <view class="input">-->
<input placeholder="暂无" v-model="formData.address" /> <!-- <input placeholder="暂无" v-model="formData.address" />-->
</view> <!-- </view>-->
</view> <!-- </view>-->
<view class="item"> <view class="item">
<view class="title"> <view class="title">
@ -57,33 +62,30 @@
性别 <text class="required">*</text> 性别 <text class="required">*</text>
</view> </view>
<view class="input"> <view class="input">
<input placeholder="请选择性别" v-model="sex_name" @click="picker_show_sex=true" /> <input placeholder="请选择性别" v-model="formData.gender_name" @click="picker_show_sex=true" />
<fui-picker layer="1" :linkage="true" :options="options_sex_arr" :show="picker_show_sex" <fui-picker layer="1" :linkage="true" :options="options_sex_arr" :show="picker_show_sex"
@change="changePickerSex" @cancel="picker_sex_show=false"></fui-picker> @change="changePickerSex" @cancel="cancelPickerSex"></fui-picker>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="title"> <view class="title">
生日 <text class="required">*</text> 年龄 <text class="required">*</text>
</view> </view>
<view class="input"> <view class="input">
<input placeholder="请选择生日" @click="picker_show_birthday=true" v-model="formData.birthday" /> <input type="number" v-model.number="formData.age" :min="3" :max="18" placeholder="请输入年龄" @input="handleAgeInput" /> </view>
<fui-date-picker :minDate="minDate" :maxDate="maxDate" :show="picker_show_birthday" type="3"
@change="changePickerBirthday" @cancel="picker_show_birthday=false"></fui-date-picker>
</view>
</view> </view>
</view> </view>
<view class="section"> <view class="section">
<view class="item"> <!-- <view class="item">-->
<view class="title"> <!-- <view class="title">-->
邮箱 <text class="required">*</text> <!-- 邮箱 <text class="required">*</text>-->
</view> <!-- </view>-->
<view class="input"> <!-- <view class="input">-->
<input v-model="formData.email" placeholder="请输入邮箱" /> <!-- <input v-model="formData.email" placeholder="请输入邮箱" />-->
</view> <!-- </view>-->
</view> <!-- </view>-->
<view class="item"> <view class="item">
<view class="title"> <view class="title">
@ -102,44 +104,36 @@
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js';
import member from '@/api/member.js'; import member from '@/api/member.js';
import { import {
Api_url Api_url
} from "@/common/config.js"; } from "@/common/config.js";
import AQTabber from "@/components/AQ/AQTabber" import AQTabber from "@/components/AQ/AQTabber"
import AQUplodeImage from '@/components/AQ/AQUplodeImage';//
export default { export default {
components: { components: {
AQTabber, AQTabber,
AQUplodeImage,
}, },
data() { data() {
return { return {
member_info: [], member_info: {},
formData: {
images_arr: [],
name: '', //
email: '', //
tel: '', //
wx: '', //
sex: '', //
birthday: '', //
},
//APi //APi
uploadUrl: `${Api_url}/file/image`, uploadUrl: `${Api_url}/memberUploadImage`,
// //
picker_show_sex: false, picker_show_sex: false,
sex_name: '请选择', sex_name: '请选择',
options_sex_arr: [{ options_sex_arr: [
value: 1, // {
text: '男' // value: 1,
}, // text: ''
{ // },
value: 2,
text: '女'
},
], ],
// //
@ -149,77 +143,79 @@
upload_type: 1, upload_type: 1,
uploadHeadimg: '', uploadHeadimg: '',
editHeadimg: '', editHeadimg: '',
//
formData: {
headimg:'',//
name:'',//
course_arr:[],//
gender:'',//: male-, female-, other-
gender_name:'',//: male-, female-, other-
age:'',//
phone_number:'',//
},
} }
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
this.init() this.init()
this.member_init()
}, },
methods: { methods: {
async init() { async init() {
await this.memberInfo()
await this.getSexDict()
this.getBirthday() this.getBirthday()
}, },
// //
async member_init() { async memberInfo() {
const member_in = await member.member(); let res = await apiRoute.xy_memberInfo({})
if (member_in.code == 1) { if(res.code != 1){
this.member_info = member_in.data uni.showToast({
this.formData = { title: res.msg,
...this.member_info icon: 'none'
} })
this.sex_name = member_in.data.gender return
} else {
this.member_info = []
} }
}, this.formData = res.data
// this.formData.headimg = res.data.memberHasOne ? res.data.memberHasOne.headimg : $util.img('/uniapp_src/static/images/common/yong_hu.png')
changeAvatar() { this.editHeadimg = this.formData.headimg
uni.chooseImage({
count: 1, console.log('xq',this.formData)
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
const tempFilePath = res.tempFilePaths[0]
//
this.uploadFilePromise(tempFilePath)
}
})
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token') || ''
let a = uni.uploadFile({
url: this.uploadUrl, //
filePath: url,
name: 'file',
header: {
'token': `${token}`, //token
}, },
success: (e) => {
let res = JSON.parse(e.data.replace(/\ufeff/g, "") || "{}") //
console.log('上传成功2', res) async getSexDict() {
if (res.code == 1) { let res = await apiRoute.common_Dictionary({key:'zy_sex'})
this.upload_type = 2 if(res.code != 1){
this.formData.headimg = res.data.path
this.editHeadimg = res.data.path
this.uploadHeadimg = res.data.url
} else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}) })
return
} }
let dictionary = res.data.dictionary
let arr = []
dictionary.forEach((v,k)=>{
arr.push({
text: v.name,
value: v.value,
})
})
this.options_sex_arr = arr
}, },
});
},
// //
changePickerSex(e) { changePickerSex(e) {
console.log('监听选择', e) console.log('监听选择', e)
this.sex_name = e.text this.formData.gender_name = e.text
this.formData.sex = e.value this.formData.gender = e.value
this.cancelPickerSex()
},
cancelPickerSex(){
this.picker_show_sex = false this.picker_show_sex = false
}, },
@ -270,12 +266,52 @@
this.picker_show_birthday = false this.picker_show_birthday = false
}, },
//-
handleAgeInput(e) {
let age = e.detail.value;
if (age < 3) {
uni.showToast({
title: '年龄不能小于3岁',
icon: 'none'
});
this.formData.age = 3;
} else if (age > 18) {
uni.showToast({
title: '年龄不能大于18岁',
icon: 'none'
});
this.formData.age = 18;
} else {
this.formData.age = age;
}
},
//
uplodeImageRes(resData,extraData){
console.log('上传成功回调',resData,extraData)
//
if (extraData.input_name == 'headimg') {
console.log('收到的图片地址:', resData.url);
this.editHeadimg = resData.url;
alert(this.formData.headimg)
}
},
//
previewImage(url){
uni.previewImage({
current: url, //
urls: [url] //
});
},
// //
submit() { submit() {
console.log(this.editHeadimg, '111') console.log(this.editHeadimg, '111')
if(this.editHeadimg == ''){ // if(this.editHeadimg == ''){
this.editHeadimg = this.formData.headimg // this.editHeadimg = this.formData.headimg
} // }
member.member_edit({ member.member_edit({
header: this.editHeadimg, header: this.editHeadimg,
name: this.formData.name, name: this.formData.name,
@ -297,7 +333,9 @@
}) })
} }
}) })
} },
} }
} }

BIN
static/images/common/black_arrow_right.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

BIN
static/images/common/closex.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 801 B

BIN
static/images/common/clousex-big.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

BIN
static/images/common/common_icon_jump_gold.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

BIN
static/images/common/delete.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/images/common/edit.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/images/common/fa_song.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

BIN
static/images/common/gift_icon_close_new.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

BIN
static/images/common/gouxuankuang.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/images/common/gray_arrow_down.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

BIN
static/images/common/icon-close.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

BIN
static/images/common/icon-drop-down.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

BIN
static/images/common/icon_about.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/images/common/icon_black_back.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/images/common/icon_jump_black3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

BIN
static/images/common/image-delete.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

BIN
static/images/common/jia_hao.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

BIN
static/images/common/jump-r-arrow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

BIN
static/images/common/menu_icon_empty.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B

BIN
static/images/common/more-arrow-right.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

BIN
static/images/common/round-black-selected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/images/common/round_add_disabled.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

BIN
static/images/common/round_add_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

BIN
static/images/common/round_minus.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

BIN
static/images/common/search-icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/images/common/star_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/images/common/xi_tong_xiao_xi.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

BIN
static/images/common/yong_hu.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

BIN
static/images/home/chaungjian.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

BIN
static/images/home/tixing.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 B

BIN
static/images/home/wang.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/images/home/yong.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/images/index/addto.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

BIN
static/images/index/check_mark.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

BIN
static/images/index/danlan.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

BIN
static/images/index/danlv.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/images/index/dian.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

BIN
static/images/index/hong.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

BIN
static/images/index/huang.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

BIN
static/images/index/icon_shopping_bag.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 930 B

BIN
static/images/index/img.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

BIN
static/images/index/intention1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

BIN
static/images/index/intention2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

BIN
static/images/index/intention3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/images/index/lan.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/images/index/lv.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
static/images/index/lvs.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

BIN
static/images/index/manjian.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/images/index/me_icon_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/images/index/menu_btn_close.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

BIN
static/images/index/menu_icon_popup_triangle_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

BIN
static/images/index/menupopup_btn_share_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/images/index/menupopup_btn_share_quanzi.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/images/index/menupopup_btn_share_wechat.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/images/index/message.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

BIN
static/images/index/myk.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

BIN
static/images/index/phone.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

BIN
static/images/index/rexiao.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/images/index/round-cancel.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

BIN
static/images/index/round.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

BIN
static/images/index/round_close_btn.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/images/index/score.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

BIN
static/images/index/score1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

BIN
static/images/index/setup.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

BIN
static/images/index/shadow_yellow_star.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

BIN
static/images/index/shenlan.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

BIN
static/images/index/star.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

BIN
static/images/index/task.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

BIN
static/images/index/tuijian.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

BIN
static/images/index/work_details.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/images/index/writing.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/images/index/xinpin.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

BIN
static/images/index/yellow_star.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

BIN
static/images/index/zan_wu.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 B

BIN
static/images/login/login1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

BIN
static/images/login/login2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

BIN
static/images/login/wechat1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

BIN
static/images/mall/b3d3a98e3c7f450aaa32fbec6aecdfaf.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

BIN
static/images/mall/img_pointmall_star.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
static/images/mall/me_img_banner_mall.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

BIN
static/images/mall/me_pointmall_img_nogift.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

BIN
static/images/mall/store_brh_home_page_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

BIN
static/images/mall/store_brh_service_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

BIN
static/images/member/me_club_task_img_done.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/images/my/b3d3a98e3c7f450aaa32fbec6aecdfaf.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

BIN
static/images/my/coupons-empty.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
static/images/my/icon_arrow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

BIN
static/images/my/icon_attention.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

BIN
static/images/my/icon_giftcard.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/images/my/icon_rules.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

BIN
static/images/my/img_giftcard_empty.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save