Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
zhiliang-light-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
662f9a7c
authored
2019-08-13 18:07:34 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
版本提交
1 parent
82c6c9ca
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
540 additions
and
178 deletions
src/app.js
src/app.json
src/component/empty-tips/empty-tips.wxml
src/component/gift-sign-tips-comp/gift-sign-tips-comp.js
src/component/gift-sign-tips-comp/gift-sign-tips-comp.wxml
src/component/order-submit-success-tips-comp/order-submit-success-tips-comp.js
src/component/order-submit-success-tips-comp/order-submit-success-tips-comp.scss
src/component/order-submit-success-tips-comp/order-submit-success-tips-comp.wxml
src/http/api.js
src/pages/contact-table/contact-table.js
src/pages/contact/contact.js
src/pages/contact/contact.wxml
src/pages/gift-detail/gift-detail.js
src/pages/gift-detail/gift-detail.wxml
src/pages/gift-shop/gift-shop.js
src/pages/gift-shop/gift-shop.wxml
src/pages/my-message/my-message.js
src/pages/my-message/my-message.wxml
src/pages/my-order/my-order.js
src/pages/my-order/my-order.wxml
src/pages/user-center/user-center.js
src/pages/user-center/user-center.wxml
src/pages/vip-login/vip-login.js
src/pages/vip-login/vip-login.wxml
src/pages/vip-verify/vip-verify.js
src/pages/vip-verify/vip-verify.scss
src/pages/vip-verify/vip-verify.wxml
src/app.js
View file @
662f9a7
...
...
@@ -26,6 +26,7 @@ App({
wxcode
:
store
.
getItem
(
"wxcode"
),
tlMemberCode
:
""
,
giftInfo
:
null
,
// 来自 gift-shop
addressEditInfo
:
null
,
// 编辑时的临时对象
},
//重写分享方法
share
:
function
()
{
...
...
src/app.json
View file @
662f9a7
{
"pages"
:
[
"pages/user-center/user-center"
,
"pages/gift-shop/gift-shop"
,
"pages/index/index"
,
"pages/user-center/user-center"
,
"pages/gift-detail/gift-detail"
,
"pages/scan-result/scan-result"
,
"pages/contact/contact"
,
...
...
@@ -61,6 +61,7 @@
"gift-rank-tips-comp"
:
"../../component/gift-rank-tips-comp/gift-rank-tips-comp"
,
"gift-sign-tips-comp"
:
"../../component/gift-sign-tips-comp/gift-sign-tips-comp"
,
"order-submit-success-tips-comp"
:
"../../component/order-submit-success-tips-comp/order-submit-success-tips-comp"
,
"empty-tips"
:
"../../component/empty-tips/empty-tips"
,
"van-popup"
:
"../../ui/vant-weapp/popup/index"
}
}
...
...
src/component/empty-tips/empty-tips.wxml
View file @
662f9a7
<view class="empty-tips"
wx:if="{{emptyVisible}}"
>
<view class="empty-tips" >
<view class="tips">
<span class="iconfont iconempty"></span>
<view class="tips">这里空空如也~</view>
...
...
src/component/gift-sign-tips-comp/gift-sign-tips-comp.js
View file @
662f9a7
...
...
@@ -18,6 +18,10 @@ Component({
innerButton
:
{
type
:
String
,
value
:
'确定'
,
},
prizeInfo
:
{
type
:
Object
,
value
:
{}
}
},
data
:
{
...
...
@@ -33,12 +37,14 @@ Component({
},
// 隐藏蒙层
hideMask
()
{
console
.
log
(
"hideMask:"
,
this
.
properties
.
prizeInfo
);
this
.
triggerEvent
(
'evtcomp'
,
{
name
:
"_evt_hide_mask"
});
},
// 点击自定义按钮
onInnerButtonHandler
()
{
console
.
log
(
"onInnerButtonHandler:"
,
this
.
properties
.
prizeInfo
);
this
.
triggerEvent
(
'evtcomp'
,
{
name
:
"_evt_common_comp_button"
,
data
:
{
...
...
@@ -49,5 +55,5 @@ Component({
}
});
}
}
}
,
})
...
...
src/component/gift-sign-tips-comp/gift-sign-tips-comp.wxml
View file @
662f9a7
<view class="comp-item">
<view class="cspace"></view>
<view class="cont">
<view class="tit tit3">恭喜获得
88元现金红包
</view>
<view class="tit tit3">恭喜获得
{{prizeInfo.signPrizeName}}
</view>
<!-- 红包 -->
<block>
<block
wx:if="{{prizeInfo.signPrizeType == 'packet'}}"
>
<image class="prize" mode="aspectFit" src="../../image/prize/prize-red-package.png" />
<view></view>
<text class="tips">现金红包已经快马加鞭给您派送\n请注意通知消息,并在24小时内领取哦~</text>
</block>
<!-- 积分 -->
<
!-- <block
>
<
block wx:else
>
<image class="prize" mode="aspectFit" src="../../image/prize/prize-integral.png" />
<view
></view>
<view></view>
<text class="tips">积分已派送到您的账户\n可在“积分明细”里查看</text>
</block>
-->
</block>
</view>
<button class="btn" bindtap="hideMask">我知道了</button>
</view>
...
...
src/component/order-submit-success-tips-comp/order-submit-success-tips-comp.js
View file @
662f9a7
...
...
@@ -17,7 +17,7 @@ Component({
},
innerButton
:
{
type
:
String
,
value
:
'
确定
'
,
value
:
'
我知道了
'
,
},
// 兑换对象 通过item区分红包和实物奖显示不同文案
item
:
{
...
...
src/component/order-submit-success-tips-comp/order-submit-success-tips-comp.scss
View file @
662f9a7
...
...
@@ -36,7 +36,6 @@
.image
{
width
:
172px
;
height
:
172px
;
background-color
:
wheat
;
}
}
...
...
@@ -45,7 +44,7 @@
}
.tips
{
margin-top
:
2
0
px
;
margin-top
:
2
4
px
;
color
:
#999999
;
font-size
:
24px
;
}
...
...
src/component/order-submit-success-tips-comp/order-submit-success-tips-comp.wxml
View file @
662f9a7
...
...
@@ -3,10 +3,11 @@
<view class="cont">
<view class="tit">订单提交成功!</view>
<view class="prize">
<image class="image" mode="aspectFit" />
<image class="image" mode="aspectFit"
src="{{item.commodityThumbnail}}"
/>
</view>
<view class="name">
某东购物卡200元
</view>
<view class="name">
{{item.commodityTitle}}
</view>
<button class="btn" bindtap="onInnerButtonHandler">{{innerButton}}</button>
<view class="tips">您可以在“个人中心→我的订单”中查看物流进度</view>
<view wx:if="{{item.commodityType == 'packet'}}" class="tips">您可以在“个人中心→我的订单”中查看物流进度</view>
<view wx:else class="tips">后台审核通过后,红包将会通过公众号消息或微信服务消息发送,届时请及时领取!</view>
</view>
</view>
...
...
src/http/api.js
View file @
662f9a7
...
...
@@ -19,7 +19,8 @@ module.exports = {
announcementList
:
'/announcement/list'
,
// post 我的消息 我的消息列表
announcementUpdate
:
'/announcement/update'
,
// post 我的消息标已读 用户注册接口
announcementDelete
:
'/announcement/delete'
,
// post 我的消息删除 删除已读消息
announcementDeleteOne
:
'announcement/delete/one'
,
// post 我的消息删除---单个 删除单条消息 单个的英文是single
announcementUpdateOne
:
'/announcement/update/one'
,
// post 我的消息标已读 用户注册接口
announcementDeleteOne
:
'/announcement/delete/one'
,
// post 我的消息删除---单个 删除单条消息 单个的英文是single
messageSave
:
'/message/save'
,
// post 用户留言
contact
:
'/contact'
,
// post 联系方式
order
:
'/order'
,
// post 订单状态 订单列表
...
...
src/pages/contact-table/contact-table.js
View file @
662f9a7
...
...
@@ -148,7 +148,7 @@ Page({
'content-type'
:
'multipart/form-data'
},
formData
:
{
path
:
'/weapp/zhiliang-light/'
path
:
'/weapp/zhiliang-light
-upload
/'
},
// HTTP 请求中其他额外的 form data
success
(
res
)
{
...
...
src/pages/contact/contact.js
View file @
662f9a7
...
...
@@ -6,7 +6,9 @@ let app = getApp();
Page
({
data
:
{
authorizeVisible
:
false
,
contactInfo
:
{}
contactInfo
:
{},
// qrcodeUrl:"https://kd.cdn.xyiyang.com/weapp/zhiliang-light/qrcode/qrcode-focus.png",
qrcodeUrl
:
"https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/zhiliang-light/qrcode/qrcode-focus.png"
,
},
onShareAppMessage
()
{},
showAuth
()
{
...
...
@@ -33,6 +35,19 @@ Page({
phoneNumber
:
phoneNumber
})
},
/**
* 图片查看
*/
onPreviewImageHandler
(
evt
)
{
let
current
=
this
.
data
.
qrcodeUrl
;
let
urls
=
[
current
];
wx
.
previewImage
({
current
:
current
,
urls
:
urls
})
},
// 联系我们
queryContact
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/pages/contact/contact.wxml
View file @
662f9a7
...
...
@@ -41,9 +41,9 @@
</view>
<!-- 关注 -->
<view class="border focus">
<image
class="qrcode" mode="widthFix" src="../../image/qrcode/qrcode-focus.png
" />
<image
bindtap="onPreviewImageHandler" class="qrcode" mode="widthFix" src="{{qrcodeUrl}}
" />
<view class="tips">更多讯息,欢迎关注我们的公众号</view>
<view class="btn">一键关注</view>
<view
bindtap="onPreviewImageHandler"
class="btn">一键关注</view>
</view>
</view>
</view>
...
...
src/pages/gift-detail/gift-detail.js
View file @
662f9a7
...
...
@@ -8,7 +8,7 @@ Page({
data
:
{
authorizeVisible
:
false
,
commonTipsCompVisible
:
false
,
orderSubmitSuccessCompVisible
:
tru
e
,
orderSubmitSuccessCompVisible
:
fals
e
,
cid
:
"1"
,
// 1积分不足 2.账号未审核
innerTitle
:
""
,
innerText
:
""
,
...
...
@@ -32,6 +32,7 @@ Page({
this
.
initData
();
},
initData
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
app
.
queryIndex
().
then
((
result
)
=>
{
app
.
post
({
url
:
app
.
api
.
receiver
,
...
...
@@ -44,8 +45,11 @@ Page({
defaultReceiver
:
defaultReceiver
,
item
:
app
.
globalData
.
giftInfo
,
})
resolve
();
})
})
});
},
showTips
(
tips
)
{
...
...
@@ -125,6 +129,12 @@ Page({
remark
:
this
.
data
.
remark
}
}).
then
((
result
)
=>
{
_this
.
initData
().
then
((
result
)
=>
{
_this
.
setData
({
orderSubmitSuccessCompVisible
:
true
})
})
})
}
...
...
src/pages/gift-detail/gift-detail.wxml
View file @
662f9a7
...
...
@@ -7,7 +7,7 @@
<view class="product">
<view class="product-item">
<view class="image-wrap">
<image class="image" mode="aspectFit" src="{{item.commodity
Images[0]
}}" />
<image class="image" mode="aspectFit" src="{{item.commodity
Thumbnail
}}" />
</view>
<view class="cont">
<view class="name">{{item.commodityTitle || '-'}}</view>
...
...
src/pages/gift-shop/gift-shop.js
View file @
662f9a7
...
...
@@ -6,7 +6,6 @@ let app = getApp();
Page
({
data
:
{
authorizeVisible
:
false
,
orderSubmitSuccessTipsCompVisible
:
false
,
total
:
0
,
page
:
1
,
size
:
10
,
...
...
@@ -114,7 +113,6 @@ Page({
hideMask
()
{
this
.
setData
({
authorizeVisible
:
false
,
orderSubmitSuccessTipsCompVisible
:
false
,
})
},
// 子组件事件
...
...
src/pages/gift-shop/gift-shop.wxml
View file @
662f9a7
...
...
@@ -26,7 +26,7 @@
<view class="product">
<view class="product-item" wx:for="{{productList}}" wx:key="{{index}}">
<view class="image-wrap">
<image class="image" mode="aspectFit" src="{{item.commodity
Images[0]
}}" />
<image class="image" mode="aspectFit" src="{{item.commodity
Thumbnail
}}" />
</view>
<view class="cont">
<view class="name">{{item.commodityTitle}}</view>
...
...
@@ -42,6 +42,3 @@
<van-popup show="{{ authorizeVisible }}">
<authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
</van-popup>
<van-popup show="{{ orderSubmitSuccessTipsCompVisible }}">
<order-submit-success-tips-comp bind:evtcomp="evtcomp" inner-title="积分不足" inner-text="使用推广、签到功能\n可获取更多积分!" inner-button="我知道了"></order-submit-success-tips-comp>
</van-popup>
...
...
src/pages/my-message/my-message.js
View file @
662f9a7
import
{
getBindtapData
}
from
'../../utils/util'
;
let
app
=
getApp
();
Page
({
data
:
{
authorizeVisible
:
false
,
total
:
0
,
page
:
1
,
size
:
10
,
dataList
:
[],
},
onShareAppMessage
()
{},
showAuth
()
{
...
...
@@ -9,5 +17,136 @@ Page({
authorizeVisible
:
true
})
},
onLoad
(
options
)
{}
onLoad
(
options
)
{
this
.
initData
();
},
initData
()
{
this
.
queryAnnouncementList
();
},
// 到达底部
onReachBottom
()
{
if
(
this
.
data
.
dataList
.
length
<
this
.
data
.
total
)
{
this
.
setData
({
page
:
this
.
data
.
page
+
1
});
this
.
queryAnnouncementList
();
}
},
// 重置页面列表 点击搜索条件时需要
resetPage
()
{
this
.
setData
({
page
:
1
,
dataList
:
[]
})
},
// 请求列表
queryAnnouncementList
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
app
.
post
({
url
:
app
.
api
.
announcementList
,
data
:
{
page
:
this
.
data
.
page
,
size
:
this
.
data
.
size
,
}
}).
then
((
result
)
=>
{
let
dataList
=
result
.
announcementItems
;
dataList
=
this
.
data
.
dataList
.
concat
(
dataList
);
this
.
setData
({
dataList
:
dataList
,
total
:
result
.
total
})
resolve
();
})
});
},
/**
* 标记已读
* @param {*} evt
*/
tagReadItem
(
evt
)
{
let
curData
=
getBindtapData
(
evt
);
let
curIndex
=
getBindtapData
(
evt
,
"index"
);
let
announcementCode
=
curData
.
announcementCode
||
""
;
let
dataList
=
this
.
data
.
dataList
;
app
.
post
({
url
:
app
.
api
.
announcementUpdateOne
,
data
:
{
announcementCode
:
announcementCode
}
}).
then
((
result
)
=>
{
dataList
[
curIndex
].
read
=
1
;
this
.
setData
({
dataList
:
dataList
})
wx
.
showToast
({
title
:
"操作成功"
})
});
},
/**
* 删除已读
* @param {*} evt
*/
deleteItem
(
evt
)
{
let
curData
=
getBindtapData
(
evt
);
let
curIndex
=
getBindtapData
(
evt
,
"index"
);
let
announcementCode
=
curData
.
announcementCode
||
""
;
let
dataList
=
this
.
data
.
dataList
;
console
.
log
(
"data"
);
app
.
post
({
url
:
app
.
api
.
announcementDeleteOne
,
data
:
{
announcementCode
:
announcementCode
}
}).
then
((
result
)
=>
{
dataList
.
splice
(
curIndex
,
1
);
this
.
setData
({
dataList
:
dataList
})
wx
.
showToast
({
title
:
"操作成功"
})
});
},
/**
* 标记所有已读
* @param {*} evt
*/
tagReadAll
(
evt
)
{
let
dataList
=
this
.
data
.
dataList
;
app
.
post
({
url
:
app
.
api
.
announcementUpdate
,
data
:
{}
}).
then
((
result
)
=>
{
dataList
.
forEach
(
element
=>
{
element
.
read
=
1
;
});
this
.
setData
({
dataList
:
dataList
})
wx
.
showToast
({
title
:
"操作成功"
})
});
},
/**
* 删除所有已读
*/
deleteAll
()
{
app
.
post
({
url
:
app
.
api
.
announcementDelete
,
data
:
{}
}).
then
((
result
)
=>
{
this
.
queryAnnouncementList
().
then
((
result
)
=>
{
this
.
resetPage
();
wx
.
showToast
({
title
:
"操作成功"
})
})
});
}
})
...
...
src/pages/my-message/my-message.wxml
View file @
662f9a7
...
...
@@ -5,21 +5,28 @@
<view class="top-space"></view>
<view class="content">
<view class="func">
<view
class="func-item
">全部标为已读</view>
<view class="func-item func-item2">删除已读消息</view>
<view
bindtap="tagReadAll" class="func-item
">全部标为已读</view>
<view
bindtap="deleteAll"
class="func-item func-item2">删除已读消息</view>
</view>
<view class="news">
<view class="border news-item">
<view
wx:for="{{dataList}}" wx:key="{{index}}"
class="border news-item">
<view class="tit">
<view class="tit-item">
订单消息
</view>
<view class="tit-item">
{{item.announcementTitle}}
</view>
<view class="tit-item">
<span class="t1">标记已读</span>
<span bindtap="tagReadItem" data-data="{{item}}" data-index="{{index}}" wx:if="{{item.read == 0}}" class="t1">
标记已读
</span>
<span bindtap="deleteItem" data-data="{{item}}" data-index="{{index}}" wx:if="{{item.read == 1}}" class="t2">
删除
</span>
</view>
</view>
<view class="desc">
您的订单 2357123413491 已通过审核!
</view>
<view class="desc">
{{item.announcementContent}}
</view>
</view>
<!-- 11wx:if="{{dataList.length <= 0}}" -->
</view>
</view>
<empty-tips wx:if="{{dataList.length <= 0}}"></empty-tips>
</view>
</view>
<van-popup show="{{ authorizeVisible }}">
...
...
src/pages/my-order/my-order.js
View file @
662f9a7
...
...
@@ -6,7 +6,11 @@ let app = getApp();
Page
({
data
:
{
authorizeVisible
:
false
,
navIndex
:
0
navIndex
:
0
,
total
:
0
,
page
:
1
,
size
:
10
,
dataList
:
[],
},
onShareAppMessage
()
{},
showAuth
()
{
...
...
@@ -18,13 +22,52 @@ Page({
let
{
navIndex
}
=
options
;
console
.
log
(
"navIndex:"
,
navIndex
);
if
(
navIndex
)
{
this
.
setData
({
navIndex
:
navIndex
})
}
this
.
initData
();
},
initData
()
{
this
.
queryOrder
();
},
// 到达底部
onReachBottom
()
{
if
(
this
.
data
.
dataList
.
length
<
this
.
data
.
total
)
{
this
.
setData
({
page
:
this
.
data
.
page
+
1
});
this
.
queryOrder
();
}
},
/**
* 订单状态
*/
queryOrder
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
app
.
post
({
url
:
app
.
api
.
order
,
data
:
{
page
:
this
.
data
.
page
,
size
:
this
.
data
.
size
,
orderStatus
:
""
}
}).
then
((
result
)
=>
{
let
dataList
=
result
.
list
;
dataList
=
this
.
data
.
dataList
.
concat
(
dataList
);
this
.
setData
({
dataList
:
dataList
,
total
:
result
.
total
})
resolve
();
})
});
},
/**
* 选择导航
* @param {*} evt
...
...
src/pages/my-order/my-order.wxml
View file @
662f9a7
...
...
@@ -28,68 +28,9 @@
</view>
</view>
<!-- 卡片 -->
<view class="card">
<view class="border card-item">
<view class="no">订单编号:2357123413491</view>
<view class="line"></view>
<view class="cont">
<view class="prize">
<image class="image" mode="aspectFit" />
</view>
<view class="detail">
<view class="t1">某东购物卡200元</view>
<view class="t1 t2">消耗积分:1000分</view>
<view class="t1 t3">处理中</view>
</view>
</view>
<view class="line"></view>
<view class="logistics">
<view class="logistics-item">
<view class="label">收货地址</view>
<view class="val">深圳市龙岗区XXX路</view>
</view>
<view class="logistics-item">
<view class="label">物流公司</view>
<view class="val">待定</view>
</view>
<view class="logistics-item">
<view class="label">物流单号</view>
<view class="val">暂定</view>
</view>
</view>
</view>
<view class="border card-item">
<view class="no">订单编号:2357123413491</view>
<view class="line"></view>
<view class="cont">
<view class="prize">
<image class="image" mode="aspectFit" />
</view>
<view class="detail">
<view class="t1">某东购物卡200元</view>
<view class="t1 t2">消耗积分:1000分</view>
<view class="t1 t3">处理中</view>
</view>
</view>
<view class="line"></view>
<view class="logistics">
<view class="logistics-item">
<view class="label">收货地址</view>
<view class="val">深圳市龙岗区XXX路</view>
</view>
<view class="logistics-item">
<view class="label">物流公司</view>
<view class="val">待定</view>
</view>
<view class="logistics-item">
<view class="label">物流单号</view>
<view class="val">暂定</view>
</view>
</view>
</view>
</view>
</view>
<empty-tips wx:if="{{dataList.length <= 0}}"></empty-tips>
</view>
</view>
<van-popup show="{{ authorizeVisible }}">
...
...
src/pages/user-center/user-center.js
View file @
662f9a7
...
...
@@ -15,6 +15,7 @@ Page({
userInfo
:
{},
// 用户数据
signInfo
:
[],
// 签到数据
signNum
:
0
,
// 签到天数
signPrize
:
{},
//签到奖励
},
onShareAppMessage
()
{},
showAuth
()
{
...
...
@@ -23,10 +24,10 @@ Page({
})
},
onShow
()
{
this
.
initData
();
},
onLoad
(
options
)
{
this
.
initData
();
},
initData
()
{
this
.
queryMember
().
then
((
result
)
=>
{
...
...
@@ -43,13 +44,12 @@ Page({
app
.
post
({
toast
:
false
,
url
:
app
.
api
.
sign
,
}).
then
((
result
)
=>
{
this
.
querySignInfo
().
then
((
result2
)
=>
{
wx
.
showModal
({
content
:
'签到成功'
,
s
howCancel
:
false
,
success
(
res
)
{}
// 签到成功
this
.
setData
({
s
ignPrize
:
result2
,
giftSignTipsCompVisible
:
true
})
})
}).
catch
((
err
)
=>
{
...
...
@@ -189,12 +189,21 @@ Page({
/**
* 去验证
*/
toVipLogin
()
{
toVipLogin
Handler
()
{
app
.
router
.
push
({
path
:
"vipLogin"
})
},
/**
* 查看审核
*/
toVipVerifyHandler
()
{
app
.
router
.
push
({
path
:
"vipVerify"
})
},
// 隐藏蒙层
hideMask
()
{
this
.
setData
({
...
...
src/pages/user-center/user-center.wxml
View file @
662f9a7
...
...
@@ -14,7 +14,10 @@
<view wx:if="{{userInfo.auditStatus == 'authorization'}}" class="vip vip-check">
积分会员
</view>
<view wx:else class="vip" bindtap="toVipLogin">未验证 ></view>
<view wx:elif="{{userInfo.auditStatus == 'unauthorized'}}" class="vip" bindtap="toVipVerifyHandler">
审核中 >
</view>
<view wx:else class="vip" bindtap="toVipLoginHandler">未验证 ></view>
</view>
</view>
<!-- 右边栏 -->
...
...
@@ -46,11 +49,11 @@
</view>
<!-- 7天签到 -->
<view class="check">
<view wx:for="{{signInfo}}" wx:key="{{index}}" class="check-item">
<view wx:for="{{signInfo}}" wx:key="{{index}}" class="check-item
{{item ? 'check-item-act' :''}}
">
<view class="no">{{index+1}}</view>
<view class="icon">
<image wx:if="{{item}}" mode="aspectFit" src="../../image/icon/icon-check.png" />
<image wx:elif="{{index == signInfo.length
-1}}" mode="aspectFit" src="../../image/icon/icon-red-package.png" />
<image wx:elif="{{index == signInfo.length-1}}" mode="aspectFit" src="../../image/icon/icon-red-package.png" />
<image wx:else mode="aspectFit" src="../../image/icon/icon-integral.png" />
</view>
</view>
...
...
@@ -140,5 +143,5 @@
<sign-tips-comp bind:evtcomp="evtcomp"></sign-tips-comp>
</van-popup>
<van-popup show="{{ giftSignTipsCompVisible }}">
<gift-sign-tips-comp bind:evtcomp="evtcomp"></gift-sign-tips-comp>
<gift-sign-tips-comp bind:evtcomp="evtcomp"
prize-info="{{signPrize}}"
></gift-sign-tips-comp>
</van-popup>
...
...
src/pages/vip-login/vip-login.js
View file @
662f9a7
let
Date
=
require
(
'../../utils/date.js'
);
let
Utils
=
require
(
'../../utils/util.js'
);
// import {getObjByListKeyValue} from '..';
let
app
=
getApp
();
Page
({
data
:
{
...
...
@@ -13,33 +15,17 @@ Page({
auth_time
:
0
,
sendAuthCode
:
true
,
membersShipIndex
:
0
,
membersShipList
:
[{
value
:
""
,
label
:
"请选择"
,
},
{
value
:
"总代理"
,
label
:
"总代理"
,
},
{
value
:
"经销商"
,
label
:
"经销商"
,
},
{
value
:
"专业电工"
,
label
:
"专业电工"
,
},
{
value
:
"其他用户"
,
label
:
"其他用户"
,
}
],
membersShipList
:
[],
maxImg
:
1
,
// 上传数量
files
:
[],
// 上传文件列表
provinceId
:
""
,
cityId
:
""
,
provinceList
:
[],
cityList
:
[],
province
:
""
,
city
:
""
,
memberTypeName
:
""
,
// label
memberTypeCode
:
""
,
// 码
// form end
},
onShareAppMessage
()
{},
...
...
@@ -53,13 +39,50 @@ Page({
},
initData
()
{
this
.
getProvince
();
this
.
getMemberType
().
then
((
result
)
=>
{
app
.
post
({
url
:
app
.
api
.
memberIdQuery
,
data
:
{},
}).
then
((
result
)
=>
{
let
verifyInfo
=
result
;
this
.
setData
({
name
:
verifyInfo
.
realName
,
mobile
:
verifyInfo
.
phone
,
province
:
verifyInfo
.
province
,
city
:
verifyInfo
.
city
,
memberTypeCode
:
verifyInfo
.
memberTypeCode
,
memberTypeName
:
verifyInfo
.
memberTypeName
,
files
:
[{
path
:
verifyInfo
.
images
}]
})
})
})
},
/**
*
会员身份
*
获取用户类型
*/
onSelectMembersShipHandler
()
{
getMemberType
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
app
.
post
({
url
:
app
.
api
.
memberType
,
data
:
{}
}).
then
((
result
)
=>
{
let
membersShipList
=
result
;
// membersShipList.forEach(element => {
// element.label = element.memberTypeName
// });
membersShipList
.
unshift
({
memberTypeName
:
"请选择"
})
this
.
setData
({
membersShipList
})
resolve
();
})
});
},
getProvince
()
{
...
...
@@ -96,23 +119,72 @@ Page({
});
},
bindPickerChangeProvince
(
e
)
{
let
index
=
e
.
detail
.
value
;
this
.
setData
({
provinceIndex
:
index
,
provinceId
:
this
.
data
.
provinceList
[
index
].
areaId
,
cityList
:
[]
,
cityIndex
:
-
1
,
// 显示提示
showTips
(
tips
)
{
wx
.
showToast
({
title
:
tips
,
icon
:
"none"
})
this
.
getCity
();
},
bindPickerChangeCity
(
e
)
{
let
index
=
e
.
detail
.
value
;
this
.
setData
({
cityIndex
:
index
,
cityId
:
this
.
data
.
cityList
[
index
].
areaId
,
})
/**
* 表单提交验证
*/
checkSubmit
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
{
name
,
// membersShipIndex,
// membersShipList,
// provinceList,
// provinceIndex,
// cityList,
// cityIndex,
memberTypeCode
,
province
,
city
,
mobile
,
verifyCode
,
files
}
=
this
.
data
;
// let memberTypeCode = membersShipList[membersShipIndex].memberTypeCode;
// let province = provinceList[provinceIndex] && provinceList[provinceIndex].areaName || "";
// let city = cityList[cityIndex] && cityList[cityIndex].areaName || "";
let
pics
=
[];
files
.
forEach
(
element
=>
{
pics
.
push
(
element
.
path
)
});
if
(
!
name
)
{
this
.
showTips
(
"请输入真实姓名"
);
reject
();
}
else
if
(
!
memberTypeCode
)
{
this
.
showTips
(
"请选择会员身份"
);
reject
();
}
else
if
(
!
province
)
{
this
.
showTips
(
"请选择省"
);
reject
();
}
else
if
(
!
city
)
{
this
.
showTips
(
"请选择市"
);
reject
();
}
else
if
(
!
mobile
)
{
this
.
showTips
(
"请输入手机号码"
);
reject
();
}
else
if
(
!
Utils
.
checkMobile
(
mobile
))
{
this
.
showTips
(
"请输入正确手机号码"
);
reject
();
}
else
if
(
!
verifyCode
)
{
this
.
showTips
(
"请输入验证码"
);
reject
();
}
else
if
(
pics
.
length
<=
0
)
{
this
.
showTips
(
"请上传身份证或电工证"
);
reject
();
}
else
{
resolve
();
}
});
},
/**
...
...
@@ -123,15 +195,52 @@ Page({
onSubmitHandler
()
{
let
{
name
,
phone
,
// membersShipIndex,
// membersShipList,
// provinceList,
// provinceIndex,
// cityList,
// cityIndex,
memberTypeCode
,
province
,
city
,
mobile
,
verifyCode
,
files
}
=
this
.
data
;
// let memberTypeCode = membersShipList[membersShipIndex].memberTypeCode;
// let province = provinceList[provinceIndex] && provinceList[provinceIndex].areaName || "";
// let city = cityList[cityIndex] && cityList[cityIndex].areaName || "";
let
pics
=
[];
files
.
forEach
(
element
=>
{
pics
.
push
(
element
.
path
)
});
this
.
checkSubmit
().
then
((
result
)
=>
{
// 先上传图片到服务器
this
.
uploadToCustomService
(
pics
).
then
((
result
)
=>
{
let
verifyInfo
=
{
realName
:
name
,
province
:
province
,
city
:
city
,
phone
:
mobile
,
verifyCode
:
verifyCode
,
memberTypeCode
:
memberTypeCode
,
images
:
result
[
0
]
}
// app.globalData.verifyInfo = verifyInfo;
app
.
post
({
url
:
app
.
api
.
memberIdCommit
,
data
:
verifyInfo
}).
then
((
result2
)
=>
{
app
.
router
.
push
({
// openType:"redirect",
path
:
"vipVerify"
})
});
})
})
},
/**
...
...
@@ -206,7 +315,7 @@ Page({
'content-type'
:
'multipart/form-data'
},
formData
:
{
path
:
'/weapp/zhiliang-light/'
path
:
'/weapp/zhiliang-light
-upload
/'
},
// HTTP 请求中其他额外的 form data
success
(
res
)
{
...
...
@@ -233,9 +342,7 @@ Page({
app
.
post
({
url
:
app
.
api
.
memberPhone
,
data
:
{
picVerifyCode
:
""
,
mobile
:
mobile
,
forRegister
:
1
phone
:
mobile
,
}
}).
then
((
result
)
=>
{
wx
.
showToast
({
...
...
@@ -263,6 +370,36 @@ Page({
}
},
1000
)
},
bindPickerChangeProvince
(
e
)
{
let
index
=
e
.
detail
.
value
;
this
.
setData
({
provinceIndex
:
index
,
provinceId
:
this
.
data
.
provinceList
[
index
].
areaId
,
province
:
this
.
data
.
provinceList
[
index
].
areaName
,
cityList
:
[],
cityIndex
:
-
1
,
})
this
.
getCity
();
},
bindPickerChangeCity
(
e
)
{
let
index
=
e
.
detail
.
value
;
this
.
setData
({
cityIndex
:
index
,
cityId
:
this
.
data
.
cityList
[
index
].
areaId
,
city
:
this
.
data
.
cityList
[
index
].
areaName
,
})
},
bindMembersShipChange
(
e
)
{
let
index
=
e
.
detail
.
value
;
this
.
setData
({
membersShipIndex
:
index
,
memberTypeName
:
this
.
data
.
membersShipList
[
index
].
memberTypeName
,
})
},
bindMobileInput
(
e
)
{
this
.
setData
({
"mobile"
:
e
.
detail
.
value
...
...
@@ -278,12 +415,7 @@ Page({
verifyCode
:
e
.
detail
.
value
})
},
bindMembersShipChange
(
e
)
{
let
index
=
e
.
detail
.
value
;
this
.
setData
({
membersShipIndex
:
index
})
},
hideMask
()
{
// this.setData({
...
...
src/pages/vip-login/vip-login.wxml
View file @
662f9a7
...
...
@@ -11,14 +11,11 @@
<view class="label">真实姓名</view>
<input class="cont" value="{{name}}" bindinput="bindNameInput" placeholder="请输入" />
</view>
<picker value="{{membersShipIndex}}" range="{{membersShipList}}" range-key="
label
" bindchange="bindMembersShipChange">
<picker value="{{membersShipIndex}}" range="{{membersShipList}}" range-key="
memberTypeName
" bindchange="bindMembersShipChange">
<view class="form-item">
<view class="label">会员身份</view>
<!-- <input class="cont" placeholder="请输入" /> -->
<span class="cont">
{{membersShipList[membersShipIndex].label ? membersShipList[membersShipIndex].label : '请选择'}}
</span>
<view class="exts" bindtap="onSelectMembersShipHandler" data-data="{{contactInfo.contactTel}}">
<span class="cont">{{memberTypeName || '请选择'}}</span>
<view class="exts" data-data="{{contactInfo.contactTel}}">
<image class="icon" mode="aspectFit" src="../../image/icon/icon-arrow-right.png" />
</view>
</view>
...
...
@@ -27,11 +24,11 @@
<view class="label">区域</view>
<view class="cont address">
<picker class="area" bindchange="bindPickerChangeProvince" value="{{provinceIndex}}" range="{{provinceList}}" range-key="areaName">
{{province
List[provinceIndex].areaName ? provinceList[provinceIndex].areaName :
'省'}}
{{province
||
'省'}}
</picker>
<view class="line"></view>
<picker class="area" bindchange="bindPickerChangeCity" value="{{cityIndex}}" range="{{cityList}}" range-key="areaName">
{{city
List[cityIndex].areaName ? cityList[cityIndex].areaName :
'市'}}
{{city
||
'市'}}
</picker>
</view>
</view>
...
...
src/pages/vip-verify/vip-verify.js
View file @
662f9a7
...
...
@@ -2,6 +2,7 @@ let app = getApp();
Page
({
data
:
{
authorizeVisible
:
false
,
verifyInfo
:
{}
},
onShareAppMessage
()
{},
showAuth
()
{
...
...
@@ -9,5 +10,52 @@ Page({
authorizeVisible
:
true
})
},
onLoad
(
options
)
{}
onLoad
(
options
)
{},
onShow
()
{
this
.
initData
();
},
initData
()
{
app
.
post
({
url
:
app
.
api
.
memberIdQuery
,
data
:
{},
}).
then
((
result
)
=>
{
this
.
setData
({
verifyInfo
:
result
})
})
},
/**
* 图片查看
*/
onPreviewImageHandler
(
evt
)
{
let
verifyInfo
=
this
.
data
.
verifyInfo
;
let
current
=
verifyInfo
.
images
;
let
urls
=
[
current
];
wx
.
previewImage
({
current
:
current
,
urls
:
urls
})
},
/**
* 重新提交
*/
onReSubmitHandler
()
{
app
.
router
.
push
({
openType
:
"redirect"
,
path
:
"vipLogin"
});
},
/**
* 修改信息
*/
onModifyHandler
()
{
app
.
router
.
push
({
openType
:
"redirect"
,
path
:
"vipLogin"
});
},
})
...
...
src/pages/vip-verify/vip-verify.scss
View file @
662f9a7
...
...
@@ -23,6 +23,9 @@
text-align
:
center
;
font-size
:
44px
;
color
:
#333333
;
width
:
600px
;
padding
:
0
75px
;
display
:
inline-block
;
}
.form
{
...
...
@@ -48,12 +51,15 @@
.id-card
{
margin
:
44px
0
0
;
// width: 338px;
// height: 226px;
width
:
338px
;
height
:
226px
;
border-radius
:
8px
;
background-color
:
#fafafa
;
&
-image
{
width
:
338px
;
height
:
226px
;
border-radius
:
8px
;
}
}
...
...
src/pages/vip-verify/vip-verify.wxml
View file @
662f9a7
...
...
@@ -4,32 +4,40 @@
<view class="app__content main">
<view class="top-space"></view>
<view class="content">
<view class="tit">信息审核中,请耐心等待</view>
<text wx:if="{{verifyInfo.auditStatus == 'authorization'}}" class="tit">
信息审核通过\n可正常使用本程序
</text>
<text wx:elif="{{verifyInfo.auditStatus == 'audit_faild'}}" class="tit">
抱歉,您提交的信息有误,请重新上传或联系我们
</text>
<text wx:else="{{verifyInfo.auditStatus == 'unauthorized'}}" class="tit">信息审核中,请耐心等待</text>
<view class="border form">
<view class="form-item">
<view class="label">真实姓名</view>
<view class="val">
xxx
</view>
<view class="val">
{{verifyInfo.realName}}
</view>
</view>
<view class="form-item">
<view class="label">会员身份</view>
<view class="val">
专业电工
</view>
<view class="val">
{{verifyInfo.memberTypeName}}
</view>
</view>
<view class="form-item">
<view class="label">地区</view>
<view class="val">
广东省深圳市
</view>
<view class="val">
{{verifyInfo.province}}{{verifyInfo.city}}
</view>
</view>
<view class="form-item">
<view class="label">手机号码</view>
<view class="val">
15012341234
</view>
<view class="val">
{{verifyInfo.phone}}
</view>
</view>
<view class="id-card">
<image class="id-card-image" mode="aspectFit" src="../../image/icon/icon-id-card-default.png" />
<image bindtap="onPreviewImageHandler" class="id-card-image" mode="aspectFill" src="{{verifyInfo.images}}" />
</view>
<view wx:if="{{verifyInfo.auditStatus == 'audit_faild'}}" class="error-tips">
失败原因:证件不符
</view>
<view class="error-tips">失败原因:证件不符</view>
</view>
<view class="btn-wrap">
<view
wx:if="{{1>0}}" class="btn">修改信息
</view>
<view
wx:else class="btn">重新提交
</view>
<view
bindtap="onReSubmitHandler" wx:if="{{verifyInfo.auditStatus == 'audit_faild'}}" class="btn">重新提交
</view>
<view
bindtap="onModifyHandler" wx:else class="btn">修改信息
</view>
</view>
</view>
</view>
...
...
Please
register
or
sign in
to post a comment