Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
李伟
cust-app
Commits
6f616850
Commit
6f616850
authored
Dec 28, 2024
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了登录、我的、报名页面
parent
62068d95
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
181 additions
and
388 deletions
+181
-388
index.js
api/activity/index.js
+10
-0
index.js
api/login/index.js
+14
-36
config.js
config.js
+1
-1
article.vue
pages/tab/article.vue
+1
-2
my.vue
pages/tab/my.vue
+119
-54
activityDetail.vue
pagesActivity/components/activityDetail.vue
+31
-285
index.vue
pageslogin/index/index.vue
+2
-6
home-pop-bg.png
static/images/me/home-pop-bg.png
+0
-0
api.js
util/api.js
+3
-4
No files found.
api/activity/index.js
View file @
6f616850
...
...
@@ -16,3 +16,13 @@ export function activityDetail(id) {
method
:
'GET'
,
})
}
//报名
export
function
addApplication
(
data
)
{
return
request
({
url
:
'/cmsApplication/add'
,
method
:
'POST'
,
data
})
}
api/login/index.js
View file @
6f616850
import
{
request
}
from
'../../util/api'
//请求接口路径
const
apis
=
{
getUserInfo
:
"/suituser/getInfo"
,
login
:
"/wxMiniApp/validLogin"
,
phoneLogin
:
"/wxMiniApp/phoneLogin"
,
};
export
function
getUserInfo
(
data
){
/**
* 设置授权信息
*/
export
function
setUserProfile
(
data
){
return
request
({
url
:
apis
.
getUserInfo
,
method
:
"
ge
t"
,
url
:
"/app/wxMiniApp/saveUserProfile?nickName="
+
data
.
nickName
+
"&avatarUrl="
+
data
.
avatarUrl
+
"&gender="
+
data
.
gender
+
"&address="
+
data
.
address
,
method
:
"
pos
t"
,
});
};
// 第一次登录接口
/**
* 登录
*/
export
function
login
(
data
){
return
request
({
url
:
apis
.
login
,
url
:
"/app/wxMiniApp/validLogin"
,
method
:
"get"
,
needToken
:
false
,
data
,
});
};
// 手机号登录接口
/**
* 手机号登录
*/
export
function
phoneLogin
(
data
){
return
request
({
method
:
"get"
,
url
:
'/wxMiniApp/phoneLogin?encryptedData='
+
data
.
encryptedData
+
'&iv='
+
data
.
iv
+
'&openId='
+
data
.
openId
,
url
:
'/
app/
wxMiniApp/phoneLogin?encryptedData='
+
data
.
encryptedData
+
'&iv='
+
data
.
iv
+
'&openId='
+
data
.
openId
,
needToken
:
false
,
});
}
// 根据字典类型查询字典数据信息
export
function
getDicts
(
params
)
{
return
request
({
url
:
'/system/dict/data/list'
,
params
:
params
,
method
:
'get'
})
}
//获取公共文化
export
function
getPublicActivity
(
query
){
return
request
({
url
:
'/system/activity/getPublicActivity'
,
method
:
'get'
})
}
// 获取个人信息
export
function
getInfo
(
id
)
{
return
request
({
url
:
'/sysUserManage/memberDetail/'
+
id
,
method
:
'get'
})
}
config.js
View file @
6f616850
// 应用全局配置
module
.
exports
=
{
baseUrl
:
'http://localhost:80
8
2'
baseUrl
:
'http://localhost:80
9
2'
}
// module.exports = {
// devServer: {
...
...
pages/tab/article.vue
View file @
6f616850
...
...
@@ -2,8 +2,7 @@
<!-- 使用z-paging-swiper为根节点可以免计算高度 -->
<z-paging-swiper>
<view
:class=
"['add',isOpen?'add2':'']"
>
<image
@
click=
'goPage("/pagescommunity/newsRelease/newsRelease")'
src=
"../../static/images/102.png"
mode=
""
>
</image>
<image
@
click=
'goPage("/pagescommunity/newsRelease/newsRelease")'
src=
"../../static/images/102.png"
mode=
""
/>
</view>
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中 -->
<!-- 注意!此处的z-tabs为独立的组件,可替换为第三方的tabs,若需要使用z-tabs,请在插件市场搜索z-tabs并引入,否则会报插件找不到的错误 -->
...
...
pages/tab/my.vue
View file @
6f616850
...
...
@@ -165,10 +165,10 @@
</view>
</view>
<!-- 授权弹窗-->
<u-popup
u-popup
:show=
"tipsShow"
mode=
"center"
round=
"12"
:safeAreaInsetBottom=
"false"
>
<view
class=
"popup-container"
>
<image
class=
"pop-bgc"
:src=
"img + '/img/home-pop-bg.png'
"
></image>
<image
class=
"pop-bgc"
src=
"../../static/images/me/home-pop-bg.png
"
></image>
<view
class=
"div-popo"
>
<view
class=
"pop-title"
>
温馨提示
</view>
<view
class=
"tips-content"
>
...
...
@@ -185,14 +185,16 @@
</view>
</u-popup>
</view>
</
template
>
<
script
>
import
{
setUserProfile
}
from
'../../api/login/index'
export
default
{
data
()
{
return
{
tipsShow
:
false
,
nologin
:
''
,
tipsShow
:
false
,
//授权弹窗
nologin
:
''
,
//登录标志
userInfo
:{},
//用户信息
token
:
''
,
//token
img
:
this
.
$BASE_URL
,
bgColor
:
"rgba(255, 255, 255, 0)"
,
button
:
[
...
...
@@ -226,25 +228,28 @@
}
},
numtwo
:
0
,
ownerId
:
null
,
timeoutObj
:
null
,
socketTask
:
null
,
tipMsg
:
""
};
},
onShow
()
{
if
(
uni
.
getStorageSync
(
'token'
))
{
this
.
ownerId
=
uni
.
getStorageSync
(
'info'
)
!=
null
?
uni
.
getStorageSync
(
'info'
).
id
:
null
;
}
if
(
uni
.
getStorageSync
(
'userInfo'
))
{
this
.
nologin
=
false
}
else
{
this
.
nologin
=
true
}
},
onHide
()
{
},
onShow
(){
this
.
nologin
=
false
this
.
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
this
.
token
=
uni
.
getStorageSync
(
'token'
)
if
(
this
.
token
&&
this
.
token
!=
null
&&
this
.
token
!==
''
){
//token存在,证明已登录
//判断授权
if
(
this
.
userInfo
&&
this
.
userInfo
.
wxNickName
!==
''
&&
this
.
userInfo
.
wxNickName
!=
null
)
{
//已授权过
this
.
tipsShow
=
false
}
else
{
//没授权过,需要授权
this
.
tipsShow
=
true
}
}
else
{
//token不存在,未登录,跳转到登录页面进行登录
this
.
nologin
=
true
}
},
methods
:
{
//获取用户信息
getUserInfo
()
{
...
...
@@ -252,19 +257,39 @@
wx
.
getUserProfile
({
desc
:
'用于完善会员资料'
,
success
:
res
=>
{
console
.
log
(
'userInfo========:'
,
res
)
const
params
=
{
nickName
:
res
.
userInfo
.
nickName
,
avatarUrl
:
res
.
userInfo
.
avatarUrl
,
gender
:
res
.
userInfo
.
gender
,
address
:
res
.
userInfo
.
country
+
res
.
userInfo
.
province
+
res
.
userInfo
.
city
,
//国家+省份+城市
}
setUserProfile
(
params
).
then
(
res
=>
{
uni
.
setStorageSync
(
'userInfo'
,
res
.
data
.
data
)
}).
catch
(
err
=>
{
console
.
log
(
'err:'
,
err
)
})
},
fail
:
errinfo
=>
{
console
.
log
(
'
errinfo1==========
'
,
errinfo
)
console
.
log
(
'
授权失败,请稍后再试
'
,
errinfo
)
}
});
}
catch
{
wx
.
getUserInfo
({
success
:
resinfo
=>
{
success
:
res
=>
{
const
params
=
{
nickName
:
res
.
userInfo
.
nickName
,
avatarUrl
:
res
.
userInfo
.
avatarUrl
,
gender
:
res
.
userInfo
.
gender
,
address
:
res
.
userInfo
.
country
+
res
.
userInfo
.
province
+
res
.
userInfo
.
city
,
//国家+省份+城市
}
setUserProfile
(
params
).
then
(
res
=>
{
uni
.
setStorageSync
(
'userInfo'
,
res
.
data
.
data
)
}).
catch
(
err
=>
{
console
.
log
(
'err:'
,
err
)
})
},
fail
:
errinfo
=>
{
console
.
log
(
'
errinfo2==========
'
,
errinfo
)
console
.
log
(
'
授权失败,请稍后再试
'
,
errinfo
)
}
});
}
...
...
@@ -272,6 +297,9 @@
//不同意授权
handleNoAgree
()
{
this
.
tipsShow
=
false
;
uni
.
switchTab
({
url
:
'/pages/tab/index'
});
},
//同意授权
handAgree
()
{
...
...
@@ -284,13 +312,11 @@
})
},
gotolike
(
type
)
{
//喜欢三个列表页面
this
.
tipMsg
=
"开源版暂未开放,敬请期待!如需旗舰版,可联系作者微信(MMRWXM)咨询"
;
this
.
$refs
.
elm
.
showDialog
();
},
whether
(
i
)
{
if
(
i
==
0
)
{
this
.
tipMsg
=
"开源版暂未开放,敬请期待!如需旗舰版,可联系作者微信(MMRWXM)咨询"
;
this
.
$refs
.
elm
.
showDialog
();
}
else
if
(
i
==
1
)
{
this
.
updateInformation
();
}
else
if
(
i
==
3
)
{
...
...
@@ -314,8 +340,7 @@
})
},
goCommunity
(){
this
.
tipMsg
=
"开源版暂未开放,敬请期待!如需旗舰版,可联系作者微信(MMRWXM)咨询"
;
this
.
$refs
.
elm
.
showDialog
();
},
}
...
...
@@ -346,16 +371,7 @@
image
{
width
:
calc
(
33%
-
10rpx
);
height
:
198rpx
;
// border: 1rpx solid #707070;
border-radius
:
12rpx
;
// &:first-child{
// border-bottom-left-radius: 12rpx;
// border-top-left-radius:12rpx;
// }
// &:last-child{
// border-bottom-right-radius: 12rpx;
// border-top-right-radius:12rpx;
// }
}
}
.strs
{
...
...
@@ -396,8 +412,6 @@
.box-bottom-text
{
font-size
:
28rpx
;
// font-family: 'PingFang SC-Heavy, PingFang SC';
// font-weight: 400;
font-family
:
'PingFang SC-Heavy'
;
font-weight
:
bolder
;
color
:
rgba
(
45
,
49
,
50
,
0
.9
);
...
...
@@ -471,16 +485,6 @@
margin-left
:
14rpx
;
}
// .boxsname {
// height: 42rpx;
// font-size: 28rpx;
// font-family: 'PingFang SC-Heavy, PingFang SC';
// color: rgba(45, 49, 50, 0.9);
// font-weight: 400;
// line-height: 42rpx;
// margin-left: 14rpx;
// }
.boxsing
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -555,7 +559,6 @@
justify-content
:
center
;
align-items
:
center
;
margin-top
:
50rpx
;
}
.sss
{
...
...
@@ -669,7 +672,6 @@
background
:
linear-gradient
(
180deg
,
#F4F5F9
0%
,
#F4F5F9
100%
);
}
.bgc-img
{
position
:
absolute
;
top
:
-80rpx
;
...
...
@@ -695,4 +697,67 @@
width
:
100%
;
height
:
100%
;
}
.popup-container
{
height
:
562rpx
;
width
:
544rpx
;
overflow
:
hidden
;
.div-popo
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
.pop-title
{
color
:
rgba
(
45
,
49
,
50
,
0
.8
);
font-size
:
40rpx
;
font-family
:
'PingFang SC-Heavy, PingFang SC'
;
display
:
flex
;
justify-content
:
center
;
margin-top
:
50rpx
;
}
.tips-content
{
width
:
448rpx
;
margin
:
auto
;
text-align
:
left
;
margin-top
:
50rpx
;
line-height
:
56rpx
;
color
:
#666
;
font-size
:
28rpx
;
font-family
:
'PingFang SC-Regular, PingFang SC'
;
.agreement-btn
{
display
:
inline-block
;
color
:
#5b83e8
;
font-family
:
'PingFang SC-Bold, PingFang SC'
;
text-decoration
:
underline
;
}
}
.btn-c
{
display
:
flex
;
margin
:
auto
;
margin-top
:
64rpx
;
justify-content
:
space-between
;
width
:
428rpx
;
}
}
.pop-btn
{
width
:
204rpx
;
height
:
76rpx
;
border-radius
:
38rpx
;
text-align
:
center
;
line-height
:
76rpx
;
border
:
2rpx
solid
#446cd2
;
color
:
#5b83e8
;
font-family
:
'PingFang SC-Regular, PingFang SC'
;
&
.agree
{
border
:
none
;
background
:
linear-gradient
(
86deg
,
#c2d2f9
0%
,
#c5c2f3
100%
);
}
}
}
</
style
>
pagesActivity/components/activityDetail.vue
View file @
6f616850
...
...
@@ -9,8 +9,8 @@
<view
class=
"act-detail"
v-html=
"activityDetail.details"
>
</view>
</view>
<view
class=
"act-bottom"
v-if=
"type!=='1'"
>
<view
class=
"act-button"
@
click=
"open
(activityDetail)
"
>
报名
</view>
<view
class=
"act-bottom"
>
<view
class=
"act-button"
@
click=
"open"
>
报名
</view>
</view>
</view>
<!-- 报名弹窗 -->
...
...
@@ -25,34 +25,19 @@
<view
class=
"popbod-title"
>
{{
activityDetail
.
title
}}
</view>
<view
class=
"pop-time"
>
<image
class=
"poptime-img"
src=
"../../static/images/activity/date.png"
/>
<view
class=
"poptime-text"
>
{{
activityDetail
.
createDat
e
}}
</view>
<view
class=
"poptime-text"
>
{{
activityDetail
.
startTim
e
}}
</view>
</view>
<view
class=
"pop-price"
>
<image
class=
"popprice-img"
src=
"../../static/images/activity/unitPrice.png"
/>
<view
class=
"popprice-text"
>
单价:
<text>
¥
{{
activityDetail
.
registr
ationFee
}}
次/人
</text></view>
<view
class=
"popprice-text"
>
单价:
<text>
¥
{{
activityDetail
.
applic
ationFee
}}
次/人
</text></view>
</view>
</view>
</view>
<view
class=
"buy-num"
>
<view
class=
"buynum-title"
>
购买数量
</view>
<view
class=
"buynum-math"
>
<image
class=
"reduce"
:src=
"baseURL+'static/images/减.png'"
@
click=
"reduce"
/>
<view
class=
"num"
>
{{
buynum
}}
</view>
<image
class=
"add"
:src=
"baseURL+'static/images/加.png'"
@
click=
"add"
/>
</view>
</view>
<view
class=
"usecoupon"
>
<view
class=
"usecoupon-title"
>
优惠券
</view>
<view
class=
"usecoupon-click"
v-if=
"availablenum != 0 && discountamount==0"
@
click=
"openavailablecoupon"
>
<text>
{{
availablenum
}}
</text>
张可用
</view>
<view
class=
"usecoupon-click"
v-else-if=
"discountamount!==0"
@
click=
"openavailablecoupon"
>
-¥
{{
discountamount
}}
</view>
<view
class=
"usecoupon-click"
v-else
>
暂无可用优惠券
</view>
</view>
<view
class=
"all-price"
>
...
...
@@ -61,85 +46,19 @@
</view>
</view>
</u-popup>
<!-- 优惠券详情 -->
<u-popup
:show=
"show1"
@
close=
"close1"
round=
"40"
>
<view
class=
"couponpopup"
>
<view
class=
"couponpopup-title"
>
优惠券
</view>
<view
style=
"max-height: 50vh;overflow-y: scroll;"
>
<view
class=
"coupon"
v-for=
"item in couponList"
>
<view
class=
"coupon-price"
v-if=
"item.type === 0"
>
<text
style=
"margin-top: 30rpx;"
>
¥
</text><text
style=
"font-size: 64rpx;"
>
{{
item
.
amount
}}
</text>
</view>
<view
class=
"coupon-price"
v-if=
"item.type === 1"
>
<text
style=
"font-size: 64rpx;"
>
{{
item
.
discount
}}
</text><text
style=
"margin-top: 30rpx;"
>
折
</text>
</view>
<view
class=
"coupon-message"
>
<view
class=
"message-left"
>
<view
class=
"preferential"
>
{{
item
.
name
}}
</view>
<view
class=
"preferential-time"
v-if=
"item.useType === 1"
>
{{
dateFormat
(
item
.
useEndTime
)
}}
前可用
</view>
<view
class=
"preferential-time"
v-else
>
领取后
{{
item
.
limitTime
}}
天内有效
</view>
</view>
<view
class=
"message-right"
>
<view
class=
"right-button"
@
click=
"receive(item)"
>
领取
</view>
</view>
</view>
</view>
</view>
</view>
</u-popup>
<!-- 可用优惠券弹窗 -->
<u-popup
:show=
"show2"
@
close=
"close2"
round=
"40"
>
<view
class=
"couponpopup"
>
<view
class=
"couponpopup-title"
>
可使用优惠券
</view>
<u-radio-group
v-model=
"radiovalue1"
placement=
"column"
iconPlacement=
"right"
size=
"36"
>
<u-radio
:customStyle=
"
{marginBottom: '8px'}" v-for="(item, index) in availablecouponList"
:key="index" :label="item.name" :name="item.businessId" label-size="36" size="36"
activeColor="#D84848" @change="changecoupon(item)">
</u-radio>
</u-radio-group>
<view
class=
"couponpopup-button"
>
<view
class=
"all-button"
@
click=
"cancel"
>
取消
</view>
<view
class=
"all-button"
@
click=
"submit(item)"
>
确定
</view>
</view>
</view>
</u-popup>
<!-- 是否使用折扣券弹出框 -->
<u-modal
:show=
"show3"
@
confirm=
"confirm"
ref=
"uModal"
:content=
"content"
:showCancelButton=
"true"
@
cancel=
"usecancel"
></u-modal>
</view>
</
template
>
<
script
>
import
{
activityDetail
}
from
"../../api/activity/index.js"
import
{
activityDetail
,
addApplication
}
from
"../../api/activity/index.js"
export
default
{
data
()
{
return
{
baseURL
:
'http://localhost:8088/idea/file/'
,
show
:
false
,
//报名弹窗
show1
:
false
,
// 是否显示优惠券弹窗
show2
:
false
,
// 是否显示可用优惠券弹窗
show3
:
false
,
//是否使用折扣券弹出框
activityDetail
:
{},
//活动详情
type
:
''
,
businessActivityDetail
:
{},
//活动详情
couponList
:
[],
//优惠券列表
coupon
:
{},
// 商家活动显示的优惠券数据
activityId
:
''
,
// 活动id
buynum
:
1
,
// 购买数量
totalprice
:
0
,
//总价
availablenum
:
0
,
// 可用优惠券的数量
availablecouponList
:
[],
// 可用优惠券列表
radiovalue1
:
''
,
couponname
:
''
,
// 优惠券名称
couponid
:
''
,
// 优惠券id
discountamount
:
0
,
// 优惠金额
content
:
''
,
//优惠券折扣
memberdiscount
:
1
,
//会员折扣
couponvalue
:
{}
}
},
onLoad
(
options
)
{
...
...
@@ -157,163 +76,44 @@
'<img style="max-width:100%;height:auto;border-radius: 12px 12px 12px 12px;" '
)
})
},
// 领取优惠券
receive
(
row
)
{
claimcoupons
(
row
.
businessId
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
uni
.
showToast
({
title
:
'领取成功'
,
icon
:
'success'
})
this
.
show1
=
false
this
.
getCouponList
()
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
// 查询已领取优惠券
getReceivedcoupon
()
{
const
params
=
{
activityId
:
this
.
activityId
,
num
:
this
.
buynum
}
receivedcoupon
(
params
).
then
(
res
=>
{
console
.
log
(
"已领取优惠券"
,
res
)
this
.
availablenum
=
res
.
total
this
.
availablecouponList
=
res
.
rows
})
},
// 查询优惠券列表
getCouponList
()
{
const
query
=
{
storeId
:
this
.
id
}
couponList
(
query
).
then
(
res
=>
{
console
.
log
(
"优惠券列表"
,
res
)
this
.
couponList
=
res
.
rows
this
.
coupon
=
res
.
rows
[
0
]
})
},
// 打开优惠券弹窗
opencoupon
()
{
this
.
show1
=
true
},
// 打开报名弹窗
open
(
data
)
{
this
.
show
=
true
this
.
businessActivityDetail
=
data
this
.
activityId
=
data
.
businessId
this
.
getReceivedcoupon
()
this
.
getMemberdiscount
()
this
.
countprice
()
},
// 查询会员折扣
getMemberdiscount
()
{
memberdiscount
().
then
(
res
=>
{
console
.
log
(
"会员折扣"
,
res
)
if
(
res
.
data
!==
100
)
{
const
num1
=
'0.'
+
res
.
data
// 会员折扣
this
.
memberdiscount
=
parseFloat
(
num1
)
this
.
memberdiscount
=
this
.
memberdiscount
.
toFixed
(
2
)
}
else
{
this
.
memberdiscount
=
1
}
console
.
log
(
"会员折扣的值"
,
this
.
memberdiscount
)
})
},
// 打开可使用优惠券的弹窗
openavailablecoupon
()
{
this
.
show
=
false
this
.
show2
=
true
this
.
discountamount
=
0
open
()
{
const
token
=
uni
.
getStorageSync
(
'token'
)
//校验token 如果没有token,跳到登录页进行登录
if
(
token
&&
token
!==
''
&&
token
!=
null
){
this
.
show
=
true
this
.
countprice
()
}
else
{
uni
.
navigateTo
({
url
:
'/pageslogin/index/index'
})
}
},
// 可使用优惠券弹窗取消按钮
cancel
()
{
this
.
show
=
true
this
.
show2
=
false
this
.
discountamount
=
0
this
.
radiovalue1
=
''
},
// 可使用优惠券弹窗提交按钮
submit
(
preson
)
{
this
.
show
=
true
this
.
show2
=
false
this
.
countprice
()
},
// 提交订单
submitorder
()
{
const
ordermessage
=
{
goodsId
:
this
.
activityId
,
num
:
this
.
buynum
,
couponId
:
this
.
couponid
,
type
:
this
.
businessActivityDetail
.
activityType
const
applyParams
=
{
activityId
:
this
.
activityDetail
.
businessId
,
status
:
'1'
,
applicationFee
:
this
.
totalprice
,
}
// 添加订单
addorder
(
ordermessage
).
then
(
res
=>
{
console
.
log
(
'添加订单'
,
res
)
const
activityId
=
this
.
activityId
if
(
res
.
code
===
200
)
{
const
orderid
=
res
.
data
.
businessId
// 支付
const
payquery
=
{
orderId
:
orderid
,
activityId
:
this
.
activityId
}
pay
(
payquery
).
then
(
res
=>
{
console
.
log
(
"测试支付"
,
res
)
if
(
res
.
errMsg
===
'OK'
)
{
if
(
!
res
.
data
.
nonceStr
)
{
uni
.
showToast
({
title
:
'下单失败,请稍后重试'
,
icon
:
'none'
})
}
else
{
uni
.
requestPayment
({
provider
:
"wxpay"
,
appId
:
res
.
data
.
appid
,
// 微信小程序appid
timeStamp
:
res
.
data
.
timeStamp
,
// 时间戳
nonceStr
:
res
.
data
.
nonceStr
,
// 随机字符串
package
:
res
.
data
.
package
,
signType
:
"MD5"
,
// 签名算法
paySign
:
res
.
data
.
paySign
,
// 签名
success
(
res
)
{
uni
.
showToast
({
title
:
'支付成功'
,
icon
:
'success'
})
uni
.
navigateTo
({
url
:
'/pages/mine/myorder/index'
})
},
fail
(
e
)
{
uni
.
showToast
({
title
:
'支付已取消'
,
icon
:
'none'
})
// const activityId = this.activityId
const
orderStatus
=
{
orderId
:
orderid
,
activityId
:
activityId
}
// 修改订单状态为待支付
updateorderstatus
(
orderStatus
).
then
(
res
=>
{
console
.
log
(
'修改订单状态'
,
res
)
})
}
});
}
}
else
{
uni
.
showToast
({
title
:
'下单失败'
,
icon
:
'none'
})
}
})
}
else
if
(
res
.
code
!==
200
){
// 添加订单(报名)
addApplication
(
applyParams
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
)
{
this
.
show
=
false
uni
.
showToast
({
title
:
'报名成功'
,
icon
:
'success'
})
}
else
if
(
res
.
data
.
code
!==
200
){
console
.
log
(
"到这"
)
uni
.
showToast
({
title
:
res
.
message
,
...
...
@@ -322,69 +122,15 @@
}
})
},
// 选择优惠券
changecoupon
(
value
)
{
console
.
log
(
"数据==="
,
value
)
this
.
couponvalue
=
value
this
.
couponname
=
value
.
name
this
.
couponid
=
value
.
businessId
if
(
value
.
type
===
0
)
{
this
.
discountamount
=
value
.
amount
}
else
if
(
value
.
type
===
1
)
{
this
.
show2
=
false
this
.
show3
=
true
this
.
content
=
'会员折扣和优惠券折扣不能同时享用,是否确认使用该折扣券?'
}
},
// 确认按钮,若用户点击确认,则使用优惠券折扣
confirm
()
{
this
.
show2
=
true
this
.
show3
=
false
const
num
=
'0.'
+
this
.
couponvalue
.
discount
const
num1
=
parseFloat
(
num
)
// const num2 = num1.toFixed(2)
const
num2
=
(
1
-
num1
)
*
this
.
totalprice
this
.
discountamount
=
num2
.
toFixed
(
2
)
},
// 取消按钮,若用户点击取消,则使用会员折扣
usecancel
()
{
this
.
show3
=
false
this
.
cancel
()
},
// 计算总价
countprice
()
{
const
price1
=
this
.
businessActivityDetail
.
price
*
this
.
buynum
-
this
.
discountamount
// 满减券优惠后的总金额
this
.
totalprice
=
price1
*
this
.
memberdiscount
console
.
log
(
"总价钱"
,
this
.
totalprice
)
const
price1
=
this
.
activityDetail
.
applicationFee
*
this
.
buynum
this
.
totalprice
=
price1
},
// 关闭报名弹窗
close
()
{
this
.
show
=
false
},
// 关闭优惠券弹窗
close1
()
{
this
.
show1
=
false
},
// 关闭可使用优惠券弹窗
close2
()
{
this
.
show2
=
false
},
// 加购买数量
add
()
{
this
.
buynum
=
this
.
buynum
+
1
this
.
getReceivedcoupon
()
this
.
countprice
()
},
// 减购买数量
reduce
()
{
this
.
buynum
=
this
.
buynum
-
1
if
(
this
.
buynum
<
1
)
{
this
.
buynum
=
1
}
this
.
getReceivedcoupon
()
this
.
countprice
()
}
}
}
</
script
>
...
...
pageslogin/index/index.vue
View file @
6f616850
...
...
@@ -26,7 +26,7 @@
openId
:
''
,
};
},
async
created
()
{
created
()
{
// 获取openId
this
.
usersLogin
().
catch
(
res
=>
{
console
.
log
(
"登录错误信息"
,
res
)
...
...
@@ -36,9 +36,6 @@
uni
.
hideLoading
()
})
},
onShow
()
{
},
methods
:
{
/**
* 用户登录
...
...
@@ -63,7 +60,7 @@
this
.
openId
=
res
.
data
.
data
.
wxOpenid
this
.
userInfo
=
res
.
data
.
data
uni
.
setStorageSync
(
'token'
,
this
.
token
)
uni
.
setStorageSync
(
'userInfo'
,
JSON
.
stringify
(
this
.
userInfo
)
)
uni
.
setStorageSync
(
'userInfo'
,
this
.
userInfo
)
//停止加载
uni
.
hideLoading
()
uni
.
switchTab
({
...
...
@@ -144,7 +141,6 @@
// 判断是否获取到token
if
(
this
.
token
)
{
console
.
log
(
'3333'
)
uni
.
hideLoading
();
uni
.
switchTab
({
url
:
'/pages/tab/index'
...
...
static/images/me/home-pop-bg.png
0 → 100644
View file @
6f616850
133 KB
util/api.js
View file @
6f616850
...
...
@@ -4,7 +4,6 @@ import config from '@/config'
// #endif
// #ifndef H5
// 请求接口
//export const BASE_URL = 'https://www.wxmblog.com/wxmapi'; //正式接口
export
const
BASE_URL
=
config
.
baseUrl
;
// #endif
...
...
@@ -28,9 +27,9 @@ export const request = (options) => {
method
:
options
.
method
||
"GET"
,
data
:
options
.
data
||
{},
dataType
:
'json'
,
//
header: {
// Authorization:options.withToken? uni.getStorageSync("token"):''
,
//
},
header
:
{
Authorization
:
'Bearer '
+
uni
.
getStorageSync
(
"token"
)
,
},
success
:
(
res
)
=>
{
// if (res.data.code == 2) {
// uni.showToast({
...
...
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