Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李智书
xzf_uniapp-wechat-web
Commits
f43e7d92
Commit
f43e7d92
authored
Mar 09, 2022
by
李智书
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.收费项目;
parent
7cd5b6b1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
548 additions
and
251 deletions
+548
-251
src/common/js/http.js
src/common/js/http.js
+10
-52
src/main.js
src/main.js
+46
-0
src/manifest.json
src/manifest.json
+116
-119
src/pages.json
src/pages.json
+2
-1
src/pages/StudentPayment/PayOrderDetails/PayOrderDetails.vue
src/pages/StudentPayment/PayOrderDetails/PayOrderDetails.vue
+305
-67
src/pages/StudentPayment/PayProject/PayProject.vue
src/pages/StudentPayment/PayProject/PayProject.vue
+69
-12
No files found.
src/common/js/http.js
View file @
f43e7d92
...
...
@@ -99,12 +99,12 @@ function postRequest(params, data = {}) {
}
//token
let
token
=
uni
.
getStorageSync
(
"
token
"
)
//用户id
// let userId = uni.getStorageSync("userId")
// data.userId = data.userId || userId;
let
personalInfo
=
uni
.
getStorageSync
(
"
personalInfo
"
);
params
.
header
=
{
"
token
"
:
token
||
""
seesionID
:
personalInfo
.
seesionID
||
''
,
sessionid
:
personalInfo
.
seesionID
||
''
,
token
:
personalInfo
.
seesionID
||
''
,
wechattype
:
1
};
params
.
method
=
"
POST
"
;
params
.
dataType
=
"
JSON
"
...
...
@@ -124,24 +124,6 @@ function postRequest(params, data = {}) {
reslt
.
data
=
reslt
.
data
//TODO handle the exception
}
if
(
reslt
.
data
.
code
!=
200
)
{
//token失效或者错误
if
(
reslt
.
data
.
code
==
401
)
{
uni
.
showToast
({
icon
:
"
none
"
,
title
:
reslt
.
data
.
message
,
duration
:
3000
})
setTimeout
(
function
()
{
//401跳转登录
uni
.
redirectTo
({
url
:
"
/pages/index/index
"
})
uni
.
clearStorage
()
},
1000
);
reject
(
reslt
.
data
.
message
)
}
}
uni
.
hideLoading
();
resolve
(
reslt
.
data
)
}).
catch
(
e
=>
{
...
...
@@ -171,12 +153,12 @@ function getRequest(params, data) {
});
try
{
//token
let
token
=
uni
.
getStorageSync
(
"
token
"
)
//用户id
let
userId
=
uni
.
getStorageSync
(
"
userId
"
)
data
.
userId
=
data
.
userId
||
userId
;
let
personalInfo
=
uni
.
getStorageSync
(
"
personalInfo
"
);
params
.
header
=
{
"
token
"
:
token
||
""
seesionID
:
personalInfo
.
seesionID
||
''
,
sessionid
:
personalInfo
.
seesionID
||
''
,
token
:
personalInfo
.
seesionID
||
''
,
wechattype
:
1
};
params
.
method
=
"
GET
"
;
params
.
dataType
=
"
JSON
"
...
...
@@ -196,30 +178,6 @@ function getRequest(params, data) {
reslt
.
data
=
reslt
.
data
//TODO handle the exception
}
if
(
reslt
.
data
.
code
!=
200
)
{
//token失效或者错误
if
(
reslt
.
data
.
code
==
401
)
{
uni
.
showToast
({
icon
:
"
none
"
,
title
:
reslt
.
data
.
message
,
duration
:
3000
})
uni
.
hideLoading
();
//401跳转登录
uni
.
redirectTo
({
url
:
"
/pages/index/index
"
})
reject
(
reslt
.
data
.
message
)
}
uni
.
showToast
({
icon
:
"
none
"
,
title
:
reslt
.
data
.
message
,
duration
:
3000
})
uni
.
hideLoading
();
reject
(
reslt
.
data
.
message
)
}
console
.
log
(
reslt
);
uni
.
hideLoading
();
resolve
(
reslt
.
data
)
}).
catch
(
e
=>
{
...
...
src/main.js
View file @
f43e7d92
...
...
@@ -24,6 +24,52 @@ Vue.prototype.$ImgUrl = 'https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static
import
Vant
from
'
vant
'
;
Vue
.
use
(
Vant
);
let
ua
=
navigator
.
userAgent
.
toLocaleString
();
if
(
ua
.
match
(
"
/MicroMessenger/i
"
)
==
"
micromessenger
"
)
{
console
.
log
(
"
微信浏览器环境
"
);
Vue
.
prototype
.
env
=
"
wx
"
}
else
{
console
.
log
(
"
普通览器环境
"
);
Vue
.
prototype
.
env
=
"
h5
"
}
// JSSDK授权
async
function
JssdkAuth
()
{
try
{
let
[
err
,
res
]
=
await
uni
.
request
({
url
:
"
https://pay.xiaopay.net/mp_wechat/svmpwechat/GetWechatJSSDKConfig
"
,
method
:
"
POST
"
,
data
:
{
"
mp_session_id
"
:
uni
.
getStorageSync
(
"
personalInfo
"
).
seesionID
,
"
url
"
:
encodeURIComponent
(
window
.
location
.
href
.
split
(
"
#
"
)[
0
]),
}
})
console
.
log
(
err
,
res
);
}
catch
(
e
)
{
//TODO handle the exception
//TODO handle the exception
console
.
log
(
e
);
uni
.
showToast
({
icon
:
"
none
"
,
mask
:
true
,
title
:
e
.
message
})
}
}
// WeixinJSBridge内置对象在其他浏览器中无效。
setTimeout
(
function
()
{
if
(
typeof
WeixinJSBridge
==
"
undefined
"
)
{
if
(
document
.
addEventListener
)
{
Vue
.
prototype
.
JSBridge
=
false
}
else
if
(
document
.
attachEvent
)
{
Vue
.
prototype
.
JSBridge
=
false
}
}
else
{
Vue
.
prototype
.
JSBridge
=
true
}
},
1000
)
// echarts图标
var
echarts
=
require
(
'
echarts
'
)
...
...
src/manifest.json
View file @
f43e7d92
{
"name"
:
"xzf_uniapp-wechat-web"
,
"appid"
:
"__UNI__6500A3F"
,
"description"
:
""
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
"app-plus"
:
{
"usingComponents"
:
true
,
"nvueStyleCompiler"
:
"uni-app"
,
"compilerVersion"
:
3
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
true
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
/*
模块配置
*/
"modules"
:
{},
/*
应用发布信息
*/
"distribute"
:
{
/*
android打包配置
*/
"android"
:
{
"permissions"
:
[
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.GET_ACCOUNTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
]
},
/*
ios打包配置
*/
"ios"
:
{},
/*
SDK配置
*/
"sdkConfigs"
:
{}
},
"uniStatistics"
:
{
"enable"
:
true
}
},
/*
快应用特有相关
*/
"quickapp"
:
{},
/*
小程序特有相关
*/
"mp-weixin"
:
{
"appid"
:
""
,
"setting"
:
{
"urlCheck"
:
false
},
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"mp-alipay"
:
{
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"mp-baidu"
:
{
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"mp-toutiao"
:
{
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"uniStatistics"
:
{
"enable"
:
true
},
"h5"
:
{
"devServer"
:
{
"port"
:
80
,
"disableHostCheck"
:
true
,
"proxy"
:
{
"/api"
:
{
"target"
:
"https://uat.xiaopay.net"
,
"changeOrigin"
:
true
,
"secure"
:
false
,
"pathRewrite"
:
{
"^/api"
:
"/"
}
}
}
},
"router"
:
{
"mode"
:
"hash"
,
"base"
:
"./"
},
"title"
:
"电子校园卡"
,
"optimization"
:
{
"treeShaking"
:
{
"enable"
:
false
}
},
"uniStatistics"
:
{
"enable"
:
true
},
"template"
:
"template.h5.html"
},
"mp-qq"
:
{
"uniStatistics"
:
{
"enable"
:
true
}
}
"name"
:
"xzf_uniapp-wechat-web"
,
"appid"
:
"__UNI__6500A3F"
,
"description"
:
""
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
"app-plus"
:
{
"usingComponents"
:
true
,
"nvueStyleCompiler"
:
"uni-app"
,
"compilerVersion"
:
3
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
true
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
/*
模块配置
*/
"modules"
:
{},
/*
应用发布信息
*/
"distribute"
:
{
/*
android打包配置
*/
"android"
:
{
"permissions"
:
[
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.GET_ACCOUNTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
]
},
/*
ios打包配置
*/
"ios"
:
{},
/*
SDK配置
*/
"sdkConfigs"
:
{}
},
"uniStatistics"
:
{
"enable"
:
true
}
},
/*
快应用特有相关
*/
"quickapp"
:
{},
/*
小程序特有相关
*/
"mp-weixin"
:
{
"appid"
:
""
,
"setting"
:
{
"urlCheck"
:
false
},
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"mp-alipay"
:
{
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"mp-baidu"
:
{
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"mp-toutiao"
:
{
"usingComponents"
:
true
,
"uniStatistics"
:
{
"enable"
:
true
}
},
"uniStatistics"
:
{
"enable"
:
true
},
"h5"
:
{
"devServer"
:
{
"port"
:
80
,
"disableHostCheck"
:
true
,
"proxy"
:
{
"/"
:
{
"target"
:
"https://dev-az-order-api.xiaopay.net"
,
"changeOrigin"
:
true
,
"secure"
:
false
}
}
},
"router"
:
{
"mode"
:
"hash"
,
"base"
:
"./"
},
"title"
:
"电子校园卡"
,
"optimization"
:
{
"treeShaking"
:
{
"enable"
:
false
}
},
"uniStatistics"
:
{
"enable"
:
true
},
"template"
:
"template.h5.html"
},
"mp-qq"
:
{
"uniStatistics"
:
{
"enable"
:
true
}
}
}
src/pages.json
View file @
f43e7d92
...
...
@@ -335,8 +335,9 @@
},
{
"path"
:
"pages/StudentPayment/PayOrderDetails/PayOrderDetails"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"交费订单明细"
,
"navigationBarTextStyle"
:
"white"
,
"navigationBarBackgroundColor"
:
"#01CB88"
,
"enablePullDownRefresh"
:
false
}
...
...
src/pages/StudentPayment/PayOrderDetails/PayOrderDetails.vue
View file @
f43e7d92
This diff is collapsed.
Click to expand it.
src/pages/StudentPayment/PayProject/PayProject.vue
View file @
f43e7d92
...
...
@@ -11,20 +11,19 @@
@
tap=
"PayOrderDetails(item)"
>
<view
class=
"listitem top"
>
<view
class=
"title"
>
2022高一春季收费
{{
item
.
chargeName
}}
</view>
<view
class=
"money"
>
100.00
{{
item
.
amountMust
}}
</view>
</view>
<view
class=
"listitem center"
>
<text
class=
"describe"
>
本次收费需要收取高一春季开学相关费用,并根据
备注输入相关信息。
{{
item
.
descInfo
}}
</text>
</view>
<view
class=
"listitem botto"
style=
"align-items: baseline;"
>
<van-icon
name=
"clock-o"
/>
<text
class=
"Tips"
>
5
天后收费结束
</text>
<van-icon
name=
"clock-o"
/>
<text
class=
"Tips"
>
{{
item
.
diffTime
}}
天后收费结束
</text>
</view>
</view>
<view
class=
"bottomtxt"
>
已经到底啦~
</view>
...
...
@@ -77,6 +76,8 @@
</
template
>
<
script
>
// 时间处理模块
import
dayjs
from
'
dayjs
'
export
default
{
name
:
"
PayProject
"
,
data
()
{
...
...
@@ -84,12 +85,29 @@
ImgUrl
:
this
.
$ImgUrl
,
active
:
0
,
vanTab
:
[
'
收费项目
'
,
'
交费历史
'
],
PayProjectList
:
[
1
,
2
,
3
],
PayProjectHistory
:
[
1
,
2
,
3
]
PayProjectList
:
[
1
,
2
,
3
,
4
,
5
],
PayProjectHistory
:
[],
pageCurrent
:
1
,
pageSize
:
10
,
total
:
0
,
allData
:
{}
}
},
onLoad
:
function
(
options
)
{
console
.
log
(
"
PayProject
"
);
console
.
log
(
"
PayProject
"
,
options
);
if
(
options
.
seesionID
&&
options
.
userID
&&
options
.
schoolId
)
{
uni
.
setStorageSync
(
"
personalInfo
"
,
{
userId
:
options
.
userID
||
''
,
seesionID
:
options
.
seesionID
||
''
,
schoolId
:
options
.
schoolId
||
''
,
openId
:
options
.
openId
})
this
.
allData
=
options
}
else
{
let
personalInfo
=
uni
.
getStorageSync
(
"
personalInfo
"
)
this
.
allData
=
Object
.
assign
(
options
,
personalInfo
)
}
this
.
getPayProject
()
},
onPullDownRefresh
:
function
(
e
)
{
console
.
log
(
"
onPullDownRefresh
"
,
e
);
...
...
@@ -102,19 +120,57 @@
// 切换tab
async
PayProjectTab
(
index
)
{
try
{
console
.
log
(
index
);
if
(
index
>
0
)
{
return
}
this
.
getPayProject
(
index
)
}
catch
(
e
)
{
//TODO handle the exception
console
.
log
(
e
);
}
},
//
获取收费项目
//
交费项目信息分页查询
async
getPayProject
(
index
)
{
try
{
console
.
log
(
index
);
let
data
=
await
this
.
$http
.
post
({
url
:
'
/order-charge/app/charge/project/queryChargeProjectPage
'
},
{
"
pageCurrent
"
:
this
.
pageCurrent
,
"
pageSize
"
:
this
.
pageSize
,
"
schoolId
"
:
this
.
allData
.
schoolId
,
"
userId
"
:
this
.
allData
.
userId
||
this
.
allData
.
userID
})
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
icon
:
"
none
"
,
mask
:
true
,
title
:
data
.
msg
})
this
.
PayProjectList
=
[]
return
}
if
(
data
.
data
.
records
&&
Array
.
isArray
(
data
.
data
.
records
))
{
let
tmp
=
data
.
data
.
records
;
let
newArr
=
[]
for
(
let
s
of
tmp
)
{
let
diffTime
=
dayjs
().
diff
(
s
.
endTime
,
'
day
'
);
s
.
diffTime
=
Math
.
abs
(
diffTime
)
s
.
amountMust
=
s
.
amountMust
.
toFixed
(
2
)
newArr
.
push
(
s
)
}
this
.
PayProjectList
=
newArr
}
else
{
this
.
PayProjectList
=
[]
}
}
catch
(
e
)
{
//TODO handle the exception
console
.
log
(
e
);
uni
.
showToast
({
icon
:
"
none
"
,
mask
:
true
,
title
:
e
.
message
})
}
},
// 收费项目详情
...
...
@@ -123,7 +179,7 @@
console
.
log
(
data
);
uni
.
setStorageSync
(
"
PayOrderDetails
"
,
data
)
uni
.
navigateTo
({
url
:
"
../PayOrderDetails/PayOrderDetails
"
url
:
"
../PayOrderDetails/PayOrderDetails
?chargeId=
"
+
data
.
id
||
''
})
}
catch
(
e
)
{
//TODO handle the exception
...
...
@@ -172,6 +228,7 @@
.top
{
.title
{
width
:
266rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment