Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wxapp
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
wxapp
Commits
2fe64962
Commit
2fe64962
authored
Dec 12, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关联会员
parent
8e89955d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
15 deletions
+92
-15
pages/me/vip/index.js
+60
-3
pages/me/vip/index.json
+8
-5
pages/me/vip/index.wxml
+14
-4
pages/me/vip/index.wxss
+7
-0
project.config.json
+2
-2
utils/Config.js
+1
-1
No files found.
pages/me/vip/index.js
View file @
2fe64962
// pages/me/vip/index.js
import
api
from
'../../../utils/Api.js'
import
Wx
from
'../../../utils/Wx.js'
const
app
=
getApp
()
const
{
$Toast
}
=
require
(
'../../../iview/base/index'
);
Page
({
/**
* 页面的初始数据
...
...
@@ -13,7 +16,9 @@ Page({
vip_price
:
49.9
,
order
:
{},
user
:
{}
user
:
{},
visible1
:
false
,
},
handleChange1
({
...
...
@@ -44,6 +49,8 @@ Page({
getUserInfo
:
function
()
{
api
.
me
.
info
().
then
(
res
=>
{
if
(
!
res
.
code
)
{
//授权手机号
this
.
dialogPhone
(
res
.
data
)
app
.
globalData
.
userInfo
=
res
.
data
// 渲染数据
this
.
setData
({
...
...
@@ -53,6 +60,56 @@ Page({
})
},
/**
* 手机号授权弹窗
*/
dialogPhone
:
function
(
data
)
{
if
(
!
data
.
phone
)
{
this
.
setData
({
visible1
:
true
});
}
},
handlePhoneAuth
:
function
(
event
)
{
Wx
.
login
().
then
(
res
=>
{
let
encryptedData
=
event
.
detail
.
encryptedData
let
iv
=
event
.
detail
.
iv
this
.
decodePhoneData
(
res
.
code
,
encryptedData
,
iv
)
})
},
/**
* 解密手机号数据
*/
decodePhoneData
:
function
(
code
,
encryptedData
,
iv
)
{
let
that
=
this
api
.
getPhoneNumber
({
code
:
code
,
encryptedData
:
encryptedData
,
iv
:
iv
}).
then
(
res
=>
{
if
(
!
res
.
code
)
{
that
.
setData
({
visible1
:
false
})
$Toast
({
content
:
'手机号授权成功'
,
type
:
'success'
});
//更新下用户数据
that
.
getUserInfo
()
}
else
{
$Toast
({
content
:
'手机号授权失败'
,
type
:
'error'
});
}
})
},
// 获取VIP单价
getVipPrice
:
function
()
{
api
.
me
.
vipPrice
().
then
(
res
=>
{
...
...
@@ -164,7 +221,7 @@ Page({
}
})
},
/**
* 同步支付结果回调:重置订单状态
*/
...
...
pages/me/vip/index.json
View file @
2fe64962
...
...
@@ -2,10 +2,12 @@
"navigationBarTitleText"
:
"会员VIP"
,
"backgroundColor"
:
"#f5f5f5"
,
"usingComponents"
:
{
"i-row"
:
"/iview/row/index"
,
"i-col"
:
"/iview/col/index"
,
"i-input-number"
:
"/iview/input-number/index"
,
"i-button"
:
"/iview/button/index"
,
"i-input"
:
"/iview/input/index"
"i-row"
:
"/iview/row/index"
,
"i-col"
:
"/iview/col/index"
,
"i-input-number"
:
"/iview/input-number/index"
,
"i-button"
:
"/iview/button/index"
,
"i-input"
:
"/iview/input/index"
,
"i-modal"
:
"/iview/modal/index"
,
"i-toast"
:
"/iview/toast/index"
}
}
\ No newline at end of file
pages/me/vip/index.wxml
View file @
2fe64962
...
...
@@ -21,15 +21,25 @@
</view>
<!-- 用户输入的信息 -->
<i-input i-class="right-align" value="" title="姓名" type="text" placeholder="请输入您的姓名" />
<
!-- <
i-input i-class="right-align" value="" title="姓名" type="text" placeholder="请输入您的姓名" />
<view class='phoneGive'>
<text>手机号</text>
<button>授权</button>
</view>
<i-input i-class="right-align right-align-last" type="text" title="地址" placeholder="请输入您的地址" maxlength="50" />
<i-input i-class="right-align right-align-last" type="text" title="地址" placeholder="请输入您的地址" maxlength="50" />
-->
<i-row class='height'>
<i-col span="20" offset='2' i-class="col-class">
<i-button bind:click="handleClick" type="primary" shape="circle" size="small">立即{{user.is_vip==1?'续费':'购买'}} ¥{{common.numFixed(vip_price*value1, 2)}}</i-button>
</i-col>
</i-row>
\ No newline at end of file
</i-row>
<!-- 授权弹窗 -->
<i-modal title="请授权手机号" visible="{{ visible1 }}" show-cancel="{{false}}" show-ok="{{false}}" action-mode="{{ vertical }}">
<view class="auth_phone_container">
<i-button i-class="btn_auth_phone" type="info" shape="circle" size="default" bindgetphonenumber="handlePhoneAuth" open-type="getPhoneNumber">授权</i-button>
</view>
</i-modal>
<!-- toast弹窗 -->
<i-toast id="toast" />
\ No newline at end of file
pages/me/vip/index.wxss
View file @
2fe64962
...
...
@@ -96,3 +96,9 @@ page {
.color-orange {
color: #ff4200;
}
/* 授权窗口 */
.auth_phone_container{
width: 80%;
margin: auto;
}
\ No newline at end of file
project.config.json
View file @
2fe64962
...
...
@@ -15,7 +15,7 @@
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.3.2"
,
"appid"
:
"wx1b834552a7d49bb3"
,
"projectname"
:
"%E7%BE%8E%E8%A1%8C%E8%80%85
%E4%BA%B2%E5%AD%90%E6%B8%B8(git)
"
,
"projectname"
:
"%E7%BE%8E%E8%A1%8C%E8%80%85"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
},
...
...
@@ -38,7 +38,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
14
,
"current"
:
-1
,
"list"
:
[
{
"id"
:
0
,
...
...
utils/Config.js
View file @
2fe64962
...
...
@@ -5,7 +5,7 @@
// }
export
const
Config
=
{
apiPath
:
"https://meixz.utools.club/api/"
,
apiPath
:
"https://meixz
z.usa1
.utools.club/api/"
,
mobPath
:
"https://mavaler.jqhulian.com/mob/"
,
shopJoinPath
:
"https://mavaler.jqhulian.com/mob/Index/shopjoin"
}
...
...
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