锶源昆仑会员+体验官
This commit is contained in:
95
pages/bond/activation/index.js
Normal file
95
pages/bond/activation/index.js
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
invitesArr : [], //记录列表
|
||||
page : {}, //分页信息
|
||||
lodingStats : false, //加载状态
|
||||
status : 2 //状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取激活码数据
|
||||
this.invitesInfo();
|
||||
},
|
||||
|
||||
// 激活码数据
|
||||
invitesInfo(page) {
|
||||
wx.$api.user.invites({
|
||||
status: this.data.status,
|
||||
page : page || 1
|
||||
}).then(res => {
|
||||
let listArr = this.data.invitesArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data.data)
|
||||
this.setData({
|
||||
invitesArr : newData,
|
||||
page : res.data.page,
|
||||
lodingStats: false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
// 状态筛选
|
||||
onTabs(val){
|
||||
if(this.data.status === val.currentTarget.dataset.type) return
|
||||
this.setData({
|
||||
status: val.currentTarget.dataset.type,
|
||||
page : {}
|
||||
})
|
||||
|
||||
// 获取激活码数据
|
||||
this.invitesInfo();
|
||||
},
|
||||
|
||||
// 复制激活码
|
||||
copyClick(val) {
|
||||
wx.setClipboardData({
|
||||
data: val.currentTarget.dataset.code,
|
||||
success: () => {
|
||||
wx.showToast({
|
||||
title: "复制成功",
|
||||
icon : "none"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 页面相关事件处理函数--监听用户下拉动作
|
||||
onPullDownRefresh() {
|
||||
// 获取激活码数据
|
||||
this.invitesInfo();
|
||||
},
|
||||
|
||||
// 上拉加载
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
// 商品列表数据
|
||||
this.lastInfo(pageNumber);
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/bond/activation/index.json
Normal file
4
pages/bond/activation/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "激活码管理"
|
||||
}
|
||||
42
pages/bond/activation/index.wxml
Normal file
42
pages/bond/activation/index.wxml
Normal file
@@ -0,0 +1,42 @@
|
||||
<view class="tabs">
|
||||
<view class="tabs-item {{status == 2 ? 'show' : ''}}" bindtap="onTabs" data-type="2">未使用</view>
|
||||
<view class="tabs-item {{status == 3 ? 'show' : ''}}" bindtap="onTabs" data-type="3">已使用</view>
|
||||
</view>
|
||||
<view class="list" wx:if="{{invitesArr.length > 0}}">
|
||||
<view class="item" wx:for="{{invitesArr}}" wx:key="invitesArr">
|
||||
<view class="top">
|
||||
<view class="code">{{item.code}}</view>
|
||||
<view class="copy" bindtap="copyClick" data-code="{{item.code}}">复制激活码</view>
|
||||
</view>
|
||||
<view class="label" wx:if="{{item.activeUser}}">
|
||||
<view class="label-item">
|
||||
<view class="label-name">
|
||||
用户手机号
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.user.username}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label-item">
|
||||
<view class="label-name">
|
||||
使用时间
|
||||
</view>
|
||||
<view class="label-text">
|
||||
{{item.actived_at}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLodingIcon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/imgs/coupon_null.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
110
pages/bond/activation/index.wxss
Normal file
110
pages/bond/activation/index.wxss
Normal file
@@ -0,0 +1,110 @@
|
||||
page {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.tabs-item {
|
||||
flex: 2;
|
||||
text-align: center;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tabs-item::after {
|
||||
position: absolute;
|
||||
width: 12%;
|
||||
background-color: #1d37e2;
|
||||
height: 6rpx;
|
||||
border-radius: 60rpx;
|
||||
content: '';
|
||||
left: 44%;
|
||||
bottom: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tabs-item.show::after {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tabs-item.show {
|
||||
color: #1d37e2;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
.list {
|
||||
margin-top: 100rpx;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.item {
|
||||
background-color: #ffffff;
|
||||
border-radius: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 0 5rpx rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
.top {
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
line-height: 110rpx;
|
||||
border-bottom: 2rpx solid #eeeef0;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.code {
|
||||
flex: 1;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
|
||||
.code::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 0;
|
||||
top: calc(50% - 7rpx);
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #53c41a;
|
||||
}
|
||||
|
||||
.copy {
|
||||
border: 2rpx solid #1d37e2;
|
||||
color: #1d37e2;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
height: 64rpx;
|
||||
line-height: 62rpx;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
.label {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.label-item {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.label-name {
|
||||
font-size: 30rpx;
|
||||
color: #9d9d9d;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
157
pages/bond/index.js
Normal file
157
pages/bond/index.js
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
orderId : '',
|
||||
identityid : '',
|
||||
items : [{
|
||||
value : 'wechat',
|
||||
name : '微信支付',
|
||||
cover : '/static/icons/payIcon_00.png',
|
||||
checked: 'true'
|
||||
},
|
||||
{
|
||||
value : 'code',
|
||||
name : '激活码支付',
|
||||
cover : '/static/icons/payIcon_01.png'
|
||||
}
|
||||
],
|
||||
current : 0,
|
||||
payState : false, //支付选择弹出
|
||||
writeState : false, //激活码弹出
|
||||
disabled : false, //按钮状态
|
||||
payType : 'wechat' //支付类型 wechat微信 code激活码
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
identityid: options.identityid
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取身份信息
|
||||
this.identityInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 身份信息
|
||||
*/
|
||||
identityInfo() {
|
||||
wx.$api.member.identityOpen(this.data.identityid).then(res => {
|
||||
this.setData({
|
||||
// orderId: res.data.order
|
||||
orderId: res.data.order_id
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择支付
|
||||
*/
|
||||
payChange(e) {
|
||||
this.setData({
|
||||
payType: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 显示支付选择弹出
|
||||
*/
|
||||
payShow() {
|
||||
this.setData({
|
||||
payState: !this.data.payState
|
||||
})
|
||||
},
|
||||
|
||||
// 微信支付
|
||||
payment() {
|
||||
// 隐藏支付选择弹出
|
||||
this.setData({
|
||||
payState: false
|
||||
})
|
||||
if(this.data.payType == 'code') {
|
||||
// 弹出激活码填写表单
|
||||
this.setData({
|
||||
writeState: !this.data.writeState
|
||||
})
|
||||
return
|
||||
}
|
||||
// 微信支付
|
||||
wx.login({
|
||||
success: res => {
|
||||
wx.$api.member.openid(res).then(openidRes => {
|
||||
wx.$api.member.identityPay(this.data.orderId, {
|
||||
channel: 'miniapp',
|
||||
openid : openidRes.data
|
||||
}).then(PayRes => {
|
||||
let payInfo = JSON.parse(PayRes.data.wechat)
|
||||
wx.requestPayment({
|
||||
timeStamp: payInfo.timeStamp,
|
||||
nonceStr : payInfo.nonceStr,
|
||||
package : payInfo.package,
|
||||
paySign : payInfo.paySign,
|
||||
signType : payInfo.signType,
|
||||
success : payInfoRes=>{
|
||||
if(payInfoRes.errMsg == "requestPayment:ok"){
|
||||
wx.showToast({
|
||||
title: '支付成功',
|
||||
icon : 'success'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
url: './tips/index'
|
||||
})
|
||||
},3000)
|
||||
}
|
||||
},
|
||||
fail : res=>{
|
||||
wx.showToast({
|
||||
title: '取消支付',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(err => {})
|
||||
}).catch(err => {})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 激活码支付
|
||||
writePayment(e) {
|
||||
let newCode = e.detail.value.code
|
||||
wx.$api.member.codePay(this.data.orderId, {
|
||||
code: newCode
|
||||
}).then(res => {
|
||||
this.setData({
|
||||
disabled: true
|
||||
})
|
||||
|
||||
// 返回上一页
|
||||
wx.navigateBack();
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭激活码填写
|
||||
*/
|
||||
writeHide(){
|
||||
this.setData({
|
||||
writeState: false
|
||||
})
|
||||
},
|
||||
})
|
||||
4
pages/bond/index.json
Normal file
4
pages/bond/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "保证金"
|
||||
}
|
||||
43
pages/bond/index.wxml
Normal file
43
pages/bond/index.wxml
Normal file
@@ -0,0 +1,43 @@
|
||||
<image class="temporary" src="http://api.siyuankunlun.com/storage/materials/2022/09/21/bzj.jpg" mode="widthFix"></image>
|
||||
<view class="member-btn">
|
||||
<view class="btnGo" bindtap="payShow" disabled="{{disabled}}">
|
||||
保证金支付
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付弹出 -->
|
||||
<view class="payPop {{payState ? 'active' : ''}}"></view>
|
||||
<view class="payCont {{payState ? 'active' : ''}}">
|
||||
<view class="payCont-close">
|
||||
<image src="/static/icons/uricacidClose.png" mode="" bindtap="payShow"></image>
|
||||
</view>
|
||||
<radio-group bindchange="payChange">
|
||||
<label class="uni-list-cell uni-list-cell-pd payCont-radio" wx:for="{{items}}" wx:key="items">
|
||||
<view class="payCont-name">
|
||||
<image src="{{item.cover}}" mode=""></image>{{item.name}}
|
||||
</view>
|
||||
<view>
|
||||
<radio value="{{item.value}}" checked="current" color="#e8c198" checked="{{index === current}}" />
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
<view class="payCont-btn" bindtap="payment">
|
||||
立即支付
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 填写表单 -->
|
||||
<view class="writePop {{writeState ? 'active' : ''}}"></view>
|
||||
<view class="writeCont {{writeState ? 'active' : ''}}">
|
||||
<form bindsubmit="writePayment">
|
||||
<view class="writeCont-close">
|
||||
<image src="/static/icons/uricacidClose.png" mode="" bindtap="writeHide"></image>
|
||||
</view>
|
||||
<view class="writePop-input">
|
||||
<input type="text" name="code" placeholder="请输入激活码" />
|
||||
</view>
|
||||
<button class="writeCont-btn" form-type="submit" disabled="{{disabled}}">
|
||||
立即激活
|
||||
</button>
|
||||
</form>
|
||||
</view>
|
||||
187
pages/bond/index.wxss
Normal file
187
pages/bond/index.wxss
Normal file
@@ -0,0 +1,187 @@
|
||||
.temporary {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.member-btn {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.btnGo {
|
||||
padding: 0 30rpx;
|
||||
line-height: 90rpx;
|
||||
font-size: 36rpx;
|
||||
box-sizing: border-box;
|
||||
background-image: linear-gradient(to right, #fce9cf, #dfac80);
|
||||
box-shadow: 0 4rpx 4rpx 3rpx rgba(175, 136, 88, 1);
|
||||
border-radius: 50rpx;
|
||||
color: #633a25;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btnGo.active {
|
||||
background-image: linear-gradient(to right, #d4d4d4, #e0e0e0);
|
||||
box-shadow: 0 2px 2px 1px #b7b7b7;
|
||||
color: #656565
|
||||
}
|
||||
|
||||
/* 支付弹出 */
|
||||
.payPop {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .4);
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.payPop.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.payCont {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #ffffff;
|
||||
z-index: 1000;
|
||||
border-radius: 90rpx 90rpx 0 0;
|
||||
padding: 30rpx 40rpx;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.payCont.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.payCont-close {
|
||||
text-align: right;
|
||||
margin-bottom: 40rpx;
|
||||
padding-right: 10rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.payCont-close image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.payCont-radio {
|
||||
display: flex;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
|
||||
.payCont-name {
|
||||
flex: 1;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.payCont-name image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
.payCont-radio radio {
|
||||
transform: scale(.9);
|
||||
}
|
||||
|
||||
.payCont-btn {
|
||||
margin: 60rpx 0 20rpx;
|
||||
width: 100%;
|
||||
background-color: #e8c198;
|
||||
line-height: 90rpx;
|
||||
color: #442b11;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
/* 填写激活码弹出 */
|
||||
.writePop {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .4);
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.writePop.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.writeCont {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #ffffff;
|
||||
z-index: 1000;
|
||||
border-radius: 90rpx 90rpx 0 0;
|
||||
padding: 30rpx 40rpx;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.writeCont.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.writeCont-close {
|
||||
text-align: right;
|
||||
margin-bottom: 40rpx;
|
||||
padding-right: 10rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.writeCont-close image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.writePop-input {
|
||||
background-color: #f5f5f5;
|
||||
height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.writePop-input input {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
height: 100%;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
|
||||
.writeCont-btn {
|
||||
margin: 60rpx 0 20rpx;
|
||||
width: 100% !important;
|
||||
padding: 0;
|
||||
background-color: #e8c198 !important;
|
||||
line-height: 90rpx;
|
||||
color: #442b11 !important;
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.writeCont-btn::after {
|
||||
display: none;
|
||||
}
|
||||
28
pages/bond/tips/index.js
Normal file
28
pages/bond/tips/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
})
|
||||
3
pages/bond/tips/index.json
Normal file
3
pages/bond/tips/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
7
pages/bond/tips/index.wxml
Normal file
7
pages/bond/tips/index.wxml
Normal file
@@ -0,0 +1,7 @@
|
||||
<view class="examine">
|
||||
<image src="/static/imgs/payImg.jpg" mode="widthFix"></image>
|
||||
<view class="text">
|
||||
<view class="title">支付成功</view>
|
||||
</view>
|
||||
<navigator hover-class="none" open-type="navigateBack" class="return">知道了</navigator>
|
||||
</view>
|
||||
34
pages/bond/tips/index.wxss
Normal file
34
pages/bond/tips/index.wxss
Normal file
@@ -0,0 +1,34 @@
|
||||
.examine {
|
||||
padding: 240rpx 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.examine image {
|
||||
width: 45%;
|
||||
margin: 0 auto 30rpx;
|
||||
}
|
||||
|
||||
.text .title {
|
||||
font-weight: 600;
|
||||
font-size: 42rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.text .time {
|
||||
color: #999999;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.return {
|
||||
display: inline-block;
|
||||
margin-top: 80rpx;
|
||||
background-color: #1d37e2;
|
||||
padding: 0 180rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6);
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user