From 10858e0c97917b98a4232dc306495a91e18805ea Mon Sep 17 00:00:00 2001
From: longjieli <1060695654@qq.com>
Date: Sun, 8 Sep 2024 14:32:30 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86appid?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/api.js | 45 ++++----
api/http.js | 12 +--
.../PrivacyAgreementPoup/PrivacyAgreementPoup.vue | 6 +-
config.js | 6 +-
pages.json | 17 +--
pages/center/center.vue | 24 +++--
pages/finish/finish.vue | 4 +-
pages/login/{login.vue => repairLogin.vue} | 65 +++++-------
pages/login/{login1.vue => studentLogin.vue} | 54 +++++-----
pages/login/wxUserInfo.vue | 19 +++-
pages/order/order.vue | 30 +++++-
pages/repair/repair.vue | 115 ++++++++++++++-------
pages/repairList/repairList.vue | 25 ++---
static/center/logo.png | Bin 0 -> 24343 bytes
static/empty/empty.png | Bin 0 -> 17165 bytes
static/login/logo.png | Bin 0 -> 24343 bytes
static/logo.png | Bin 4023 -> 0 bytes
static/studentLogin/logo.png | Bin 0 -> 24343 bytes
store/store.js | 104 +++++++++----------
19 files changed, 298 insertions(+), 228 deletions(-)
rename pages/login/{login.vue => repairLogin.vue} (68%)
rename pages/login/{login1.vue => studentLogin.vue} (75%)
create mode 100644 static/center/logo.png
create mode 100644 static/empty/empty.png
create mode 100644 static/login/logo.png
delete mode 100644 static/logo.png
create mode 100644 static/studentLogin/logo.png
diff --git a/api/api.js b/api/api.js
index 1954bd3..62472a3 100644
--- a/api/api.js
+++ b/api/api.js
@@ -6,25 +6,34 @@ const config = {
// auth : false, showLoading : true, loadingTitle : '加载中...',
// limit : 1000
// },
- getConfig : {url : '/api/getConfig', method : 'GET', limit : 500},
- // 登录接口
- loginLogin: { url: '/school/login/login', method: 'GET' , limit : 500 },
- //修改个人信息接口
- updateInfo: { url: '/api/info/updateInfo', method: 'POST' , limit : 500 },
- //增加报修单
- addSchoolOrder : {url : '/school-api/addSchoolOrder', method : 'GET', limit : 500},
- //驳回
- editSchoolOrderError : {url : '/school-api/editSchoolOrderError', method : 'GET', limit : 500},
- //结单
- editSchoolOrderSuccess : {url : '/school-api/editSchoolOrderSuccess', method : 'GET', limit : 500},
- //报修列表
- getSchoolOrderPage : {url : '/school-api/getSchoolOrderPage', method : 'GET', limit : 500},
+ // 维修员登录接口(手机号)
+ repairLogin: { url: '/school/login/login', method: 'GET' , auth : false , showLoading : true , loadingTitle : '登录中...' , limit : 500 },
+ //学生登录(微信)
+ studentLogin: { url: '/school/login/loginWx', method: 'GET' , auth : false , showLoading : true , loadingTitle : '登录中...' , limit : 500 },
+ //微信登录用户(学生)-修改个人信息
+ updateInfo: { url: '/school-api/updateUserInfo', method: 'GET' , auth : true , limit : 500 },
+ //微信登录用户(学生)-获取个人信息
+ getUserInfo: { url: '/school-api/getUserInfo', method: 'GET' , auth : true , limit : 500 },
+ //微信登录用户(学生)-增加报修单
+ addSchoolOrder : {url : '/school-api/addUserSchoolOrder', method : 'GET', auth : true , limit : 500},
+ //驳回(维修员)
+ editSchoolOrderError : {url : '/school-api/editSchoolOrderError', method : 'GET', auth : true , limit : 500},
+ //结单(维修员)
+ editSchoolOrderSuccess : {url : '/school-api/editSchoolOrderSuccess', method : 'GET', auth : true , limit : 500},
+ //微信登录用户(学生)-报修列表
+ getUserSchoolOrderPage : {url : '/school-api/getUserSchoolOrderPage', method : 'GET', auth : true , limit : 500},
//获取楼栋
- getActorGoList : {url : '/school-api/getActorGoList', method : 'GET', limit : 500},
+ getActorGoList : {url : '/school-api/getActorGoList', method : 'GET', auth : false , limit : 500},
//获取室号
- getFloorList : {url : '/school-api/getFloorList', method : 'GET', limit : 500},
- //分配给维修的维修单
- getSchoolOrderList : {url : '/school-api/getSchoolOrderList', method : 'GET', limit : 500},
+ getFloorList : {url : '/school-api/getFloorList', method : 'GET', auth : false , limit : 500},
+ //小程序(维修员)-列表-分配给维修的订单
+ getSchoolOrderList : {url : '/school-api/getUserSchoolOrderList', method : 'GET', auth : true , limit : 500},
+ //隐私政策
+ getPrivacyPolicy : { url : '/school/login/getPrivacyPolicy', method : 'GET', auth : false , limit : 500},
+ //用户协议
+ getUserAgreement : { url : '/school/login/getUserAgreement', method : 'GET', auth : false , limit : 500},
+ //获取维修项目
+ getRepairList : { url : '/school-api/getRepairList', method : 'GET', auth : false , limit : 500},
}
@@ -60,7 +69,7 @@ export function api(key, data, callback, loadingTitle){
if (req.auth) {
if (!uni.getStorageSync('token')) {
uni.navigateTo({
- url: '/pages/login/mobile'
+ url: '/pages/login/studentLogin'
})
console.error('需要登录')
return
diff --git a/api/http.js b/api/http.js
index 9f44de7..a4b9fd8 100644
--- a/api/http.js
+++ b/api/http.js
@@ -29,17 +29,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
uni.removeStorageSync('userInfo');
console.error('登录过期');
uni.navigateTo({
- url: '/pages/login/login'
- })
- }
-
- //后端接口token出现问题
- if(res.data && res.data.code == 500 && res.data.message == '操作失败,token非法无效!'){
- uni.removeStorageSync('token');
- uni.removeStorageSync('userInfo');
- console.error('登录过期');
- uni.navigateTo({
- url: '/pages/login/login'
+ url: '/pages/login/studentLogin'
})
}
diff --git a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
index b6834c5..6ae9f8f 100644
--- a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
+++ b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
@@ -6,7 +6,7 @@
- 欢迎来到校园报修!我们根据最新的法律法规、监管政策要求,更新了《用户协议》和《隐私政策》,请您认真阅读。
+ 欢迎来到艺易修!我们根据最新的法律法规、监管政策要求,更新了《用户协议》和《隐私政策》,请您认真阅读。
@@ -14,10 +14,10 @@
- 同意《校园报修隐私政策》
+ 同意《艺易修隐私政策》
- 以及《用户协议》
+ 以及《艺易修用户协议》
diff --git a/config.js b/config.js
index 6869ffe..83de8dd 100644
--- a/config.js
+++ b/config.js
@@ -7,14 +7,14 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI)
// 当前环境
-const type = 'prod'
+const type = 'dev'
// 环境配置
const config = {
dev : {
- // baseUrl : 'https://school-admin.xzaiyp.top',
- baseUrl : 'http://h5.xzaiyp.top/school-api',
+ // baseUrl : 'http://h5.xzaiyp.top/school-api',
+ baseUrl : 'https://school-admin.xzaiyp.top/school-api',
},
prod : {
baseUrl : 'https://school-admin.xzaiyp.top/school-api',
diff --git a/pages.json b/pages.json
index d2515ae..4bbaccd 100644
--- a/pages.json
+++ b/pages.json
@@ -5,9 +5,15 @@
"navigationBarTitleText": "申请报修"
}
}, {
- "path": "pages/login/login",
+ "path": "pages/login/repairLogin",
"style": {
- "navigationBarTitleText": "登录",
+ "navigationBarTitleText": "维修员登录",
+ "enablePullDownRefresh": false
+ }
+ }, {
+ "path": "pages/login/studentLogin",
+ "style": {
+ "navigationBarTitleText": "学生登录",
"enablePullDownRefresh": false
}
}, {
@@ -42,10 +48,9 @@
}
},
{
- "path" : "pages/order/order",
- "style" :
- {
- "navigationBarTitleText" : ""
+ "path": "pages/order/order",
+ "style": {
+ "navigationBarTitleText": "我的维修单"
}
}
],
diff --git a/pages/center/center.vue b/pages/center/center.vue
index b938688..30549ca 100644
--- a/pages/center/center.vue
+++ b/pages/center/center.vue
@@ -4,22 +4,22 @@
-
+
- {{ userInfo.name }}
+ {{ userInfo.name || '文韵飞扬' }}
-
+
@@ -27,7 +27,7 @@
-
@@ -61,7 +61,7 @@
extraIcon2: {
color: '#666666',
size: '22',
- type: 'chatbubble-filled'
+ type: 'info'
},
extraIcon3: {
color: '#666666',
@@ -87,7 +87,7 @@
//退出登录
logout() {
uni.reLaunch({
- url: '/pages/login/login'
+ url: '/pages/login/studentLogin'
})
uni.removeStorageSync('token');
uni.removeStorageSync('userInfo');
@@ -200,4 +200,12 @@
box-sizing: border-box;
border-radius: 20rpx;
}
+
+ .lists {
+ width: calc(100% - 40rpx);
+ box-sizing: border-box;
+ margin: 20rpx auto;
+ border-radius: 20rpx;
+ overflow: hidden;
+ }
\ No newline at end of file
diff --git a/pages/finish/finish.vue b/pages/finish/finish.vue
index 123595a..008b9b2 100644
--- a/pages/finish/finish.vue
+++ b/pages/finish/finish.vue
@@ -117,8 +117,8 @@
methods: {
//返回
leftClick() {
- uni.switchTab({
- url: '/pages/center/center'
+ uni.reLaunch({
+ url: '/pages/order/order'
})
},
diff --git a/pages/login/login.vue b/pages/login/repairLogin.vue
similarity index 68%
rename from pages/login/login.vue
rename to pages/login/repairLogin.vue
index 9edfe8e..114d3ba 100644
--- a/pages/login/login.vue
+++ b/pages/login/repairLogin.vue
@@ -1,8 +1,8 @@
- 登录
- 欢迎使用xx报修
+ 维修员登录
+ 欢迎使用艺易修
@@ -13,7 +13,9 @@
密码
-
+
+ 登录
+ 学生登录
@@ -33,31 +35,21 @@
//登录
login() {
if(this.form.account.trim() == ''){
- return uni.showToast({
- icon: 'none',
- title: '请填写手机号'
- })
+ return uni.showToast({ icon: 'none' , title: '请填写手机号' })
}
if(this.form.password.trim() == ''){
- return uni.showToast({
- icon: 'none',
- title: '请填写密码'
- })
+ return uni.showToast({ icon: 'none' , title: '请填写密码' })
}
- this.$api('loginLogin', this.form, res => {
- if (res.code == 200) {
- uni.setStorageSync('token', res.result.token);
- uni.setStorageSync('userInfo', JSON.stringify(res.result.userInfo));
- this.$store.commit('setUserInfo',res.result.userInfo)
-
- uni.switchTab({
- url: '/pages/repair/repair'
- })
- }
+ this.$store.commit('login' , this.form )
+ },
+
+ //跳转到学生登录页面
+ toStudentLogin(){
+ uni.navigateTo({
+ url: '/pages/login/studentLogin'
})
}
-
-
+
}
}
@@ -116,23 +108,20 @@
}
.loginBtn {
- margin-top: 20rpx;
- line-height: 85rpx;
- text-align: center;
- background: #3c9cff;
- border-radius: 40rpx;
+ width: 100%;
+ height: 100rpx;
+ background-color: #00aaff;
color: #fff;
- margin-top: 50rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin: 20rpx 0;
+ border-radius: 20rpx;
}
-
- .registerBtn {
- margin-top: 20rpx;
- line-height: 85rpx;
- text-align: center;
- border-radius: 40rpx;
- color: #ccc;
- margin-top: 50rpx;
- border: none;
+
+ .b2{
+ background-color: #87D0F6;
+ color: #fff;
}
.tipbox {
diff --git a/pages/login/login1.vue b/pages/login/studentLogin.vue
similarity index 75%
rename from pages/login/login1.vue
rename to pages/login/studentLogin.vue
index fb7d1ae..d976f6a 100644
--- a/pages/login/login1.vue
+++ b/pages/login/studentLogin.vue
@@ -1,25 +1,19 @@
-
+
- 欢迎使用xx报修
+ 欢迎使用艺易修
-
-
-
-
-
+
+
微信授权登录
-
-
-
+
+ 维修员登录
+
阅读并同意我们的“服务协议与隐私条款”
@@ -53,7 +48,8 @@
name : 'Login',
data() {
return {
- checkboxValue : []
+ checkboxValue : [],
+ agreement : true
}
},
methods: {
@@ -65,6 +61,13 @@
//打开应用配置
openConfigDetail(key){
this.$refs.popup.open(key)
+ },
+
+ //跳转维修员登录页面
+ toRepairLogin(){
+ uni.navigateTo({
+ url: '/pages/login/repairLogin'
+ })
}
}
@@ -80,14 +83,12 @@
flex-direction: column;
position: relative;
.logo{
- height: 80rpx;
- width: 80rpx;
- padding: 40rpx 30rpx;
- background-color: #ddd;
- border-radius: 70rpx;
+ height: 150rpx;
+ width: 150rpx;
+ border-radius: 50%;
image{
- width: 80rpx;
- height: 80rpx;
+ width: 150rpx;
+ height: 150rpx;
}
margin-bottom: 20rpx;
}
@@ -116,17 +117,10 @@
align-items: center;
margin: 20rpx 0;
border-radius: 20rpx;
- .icon{
- margin-right: 10rpx;
- image{
- width: 40rpx;
- height: 35rpx;
- }
- }
}
.b2{
- background-color: #3c69f122;
- color: #3c69f1;
+ background-color: #87D0F6;
+ color: #fff;
}
.mt{
margin-top: 200rpx;
diff --git a/pages/login/wxUserInfo.vue b/pages/login/wxUserInfo.vue
index 991fa43..14ff672 100644
--- a/pages/login/wxUserInfo.vue
+++ b/pages/login/wxUserInfo.vue
@@ -1,7 +1,7 @@
- 帧视界
+ 艺易修
申请获取你的头像、昵称
@@ -16,7 +16,7 @@
-
+
@@ -40,8 +40,9 @@
data() {
return {
userInfo: {
- headImage: '',
+ headImage: '/static/login/logo.png', //设置了一个本地默认头像
nickName: '',
+ name : ''
}
};
},
@@ -66,6 +67,7 @@
.exec((res) => {
const nickName = res?.[0]?.value
self.userInfo.nickName = nickName
+ self.userInfo.name = nickName
if (self.$utils.verificationAll(self.userInfo, {
headImage: '请选择头像',
@@ -76,14 +78,23 @@
self.$api('updateInfo', self.userInfo, res => {
if (res.code == 200) {
+ this.replushUserInfo()
uni.switchTab({
url: '/pages/repair/repair'
})
}
})
})
-
},
+
+ //刷新存放在vuex的用户信息
+ replushUserInfo(){
+ this.$api('getUserInfo',res => {
+ if (res.code == 200) {
+ this.$store.commit('setUserInfo',res.result)
+ }
+ })
+ }
}
}
diff --git a/pages/order/order.vue b/pages/order/order.vue
index 4f3c49e..a1beb47 100644
--- a/pages/order/order.vue
+++ b/pages/order/order.vue
@@ -1,10 +1,10 @@
-
+
-
+
@@ -27,6 +27,9 @@
+
+
+
驳回
@@ -36,6 +39,9 @@
+
+
+
@@ -59,7 +65,10 @@
pageSize: 3,
state: 0
},
- total: 0
+ total: 0,
+ backPressOptions : {
+ from: 'backbutton'
+ }
}
},
onShow() {
@@ -72,6 +81,15 @@
this.getRepairList()
}
},
+ onBackPress(e) {
+ uni.switchTab({
+ url: "/pages/center/center"
+ })
+ // 此处一定要return为true,否则页面不会返回到指定路径
+ console.log("aaaaaaa");
+ this.backPressOptions = e
+ return true;
+ },
methods: {
//跳转驳回
toReject(id) {
@@ -135,7 +153,9 @@
\ No newline at end of file
diff --git a/pages/repairList/repairList.vue b/pages/repairList/repairList.vue
index 7ab5c2f..1c5f65f 100644
--- a/pages/repairList/repairList.vue
+++ b/pages/repairList/repairList.vue
@@ -1,14 +1,13 @@
-
+
-
+
-
{{ item.building }}
@@ -28,15 +27,15 @@
-
+
+
+
+
+
+
@@ -105,7 +104,7 @@
//获取报修列表
getRepairList() {
- this.$api('getSchoolOrderPage', this.queryParams, res => {
+ this.$api('getUserSchoolOrderPage', this.queryParams, res => {
if (res.code == 200) {
res.result.records.forEach(item => {
item.image ? item.image = item.image.split(',') : item.image = []
@@ -136,7 +135,9 @@