|
|
@@ -1,7 +1,10 @@
|
|
|
<template>
|
|
|
- <view class="content">
|
|
|
+ <view class="page">
|
|
|
<!-- 钱包 -->
|
|
|
<view class="recharge-me">
|
|
|
+ <view class="bg-img">
|
|
|
+ <!-- <image src="../../static/recharge/u1709.jpg" mode=""></image> -->
|
|
|
+ </view>
|
|
|
<view class="wallet-content">
|
|
|
<view class="h-balance-wrap">
|
|
|
<view class="h-balance">
|
|
|
@@ -11,7 +14,7 @@
|
|
|
</view>
|
|
|
<view class="name">储值余额</view>
|
|
|
<view class="balance-value">¥
|
|
|
- <text v-if="userInfo.rechargeBalance">{{ userInfo.rechargeBalance }}</text>
|
|
|
+ <text v-if="userInfo.rechargeBalance">{{userInfo.rechargeBalance}}</text>
|
|
|
<text v-else>0</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -21,7 +24,7 @@
|
|
|
</view>
|
|
|
<view class="name">赠送余额</view>
|
|
|
<view class="balance-value">¥
|
|
|
- <text v-if="userInfo.rewardBalance" class="">{{ userInfo.rewardBalance }}</text>
|
|
|
+ <text v-if="userInfo.rewardBalance" class="">{{userInfo.rewardBalance}}</text>
|
|
|
<text v-else>0</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -31,7 +34,7 @@
|
|
|
</view>
|
|
|
<view class="name">赠送优惠券</view>
|
|
|
<view class="balance-value">
|
|
|
- <text v-if="userInfo.coupon">{{ userInfo.coupon }}</text>
|
|
|
+ <text v-if="userInfo.coupon" >{{userInfo.coupon}}</text>
|
|
|
<text v-else>0</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -41,7 +44,7 @@
|
|
|
<view @click="gotoTransactionRecords()" class="item-btn">
|
|
|
<text>交易记录</text>>
|
|
|
</view>
|
|
|
- <view class="dashed-line"></view>
|
|
|
+ <view class="dashed-line" ></view>
|
|
|
<view @click="gotoTransactionOrderRecords()" class="item-btn">
|
|
|
<text>储值订单</text>>
|
|
|
</view>
|
|
|
@@ -54,8 +57,7 @@
|
|
|
<!--右边虚化-->
|
|
|
<!-- <view class="hide-content-box hide-content-box-right"></view> -->
|
|
|
<scroll-view scroll-x="true" class="kite-classify-scroll">
|
|
|
- <view @click="selectActiveRecharge(item, index)" class="kite-classify-cell shadow"
|
|
|
- v-for="(item, index) in rechargeList" :key="index">
|
|
|
+ <view @click="selectActiveRecharge(item,index)" class="kite-classify-cell shadow" v-for="(item, index) in rechargeList" :key="index">
|
|
|
<view v-if="currentTab === index" class="h-bg-img">
|
|
|
<image src="../../static/transaction/u2.png" mode=""></image>
|
|
|
</view>
|
|
|
@@ -64,10 +66,10 @@
|
|
|
</view>
|
|
|
<view class="content">
|
|
|
<view class="money">
|
|
|
- ¥<text class="v">{{ item.reachPrice }}</text>
|
|
|
+ ¥<text class="v">{{item.reachPrice}}</text>
|
|
|
</view>
|
|
|
<view class="desc">
|
|
|
- <text>{{ item.name }} </text>
|
|
|
+ <text>{{item.name}} </text>
|
|
|
<!-- <text>充¥{{item.reachPrice}}赚送¥{{item.discountsPrice}}</text> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -75,6 +77,40 @@
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- 选择充值金额 -->
|
|
|
+ <!-- <view class="recharge-content-wrap">
|
|
|
+ <view v-for="(item,index) in rechargeList"
|
|
|
+ @click="selectActiveRecharge(item,index)" class="recharge-content">
|
|
|
+ <view v-if="currentTab === index" class="h-bg-img">
|
|
|
+ <image src="../../static/transaction/u2.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ <view v-else class="h-bg-img">
|
|
|
+ <image src="../../static/recharge/dianka.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ <view class="content">
|
|
|
+ <view class="money">
|
|
|
+ ¥<text class="v">{{item.reachPrice}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="desc">
|
|
|
+ <text>{{item.name}} </text>
|
|
|
+ <text>充¥{{item.reachPrice}}赚送¥{{item.discountsPrice}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 自定义充值金额 -->
|
|
|
+ <!-- <view class="h-custom">
|
|
|
+ <view class="h-icon">
|
|
|
+ <u-icon name="rmb" color="#333" size="22"></u-icon>
|
|
|
+ </view>
|
|
|
+ <view class="h-money">
|
|
|
+ <input v-model="reqOrderParm.rechargeAmount" @click="cancelChooseMoney" placeholder="请输入金额" type="number">
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+
|
|
|
<!-- 充值按钮 -->
|
|
|
<view v-if="rechargeList.length > 0" @click="submitOrder()" class="h-submit-btn">
|
|
|
<text>立即充值</text>
|
|
|
@@ -82,8 +118,8 @@
|
|
|
|
|
|
<!-- 用户充值协议 -->
|
|
|
<view class="recharge-agreement">
|
|
|
- <view class="radio-group">
|
|
|
- <radio @click="toggleSelection" class="v-text" :checked="isSelected">我已阅读并同意</radio>
|
|
|
+ <view class="radio-group">
|
|
|
+ <radio @click="toggleSelection" class="v-text" :checked="isSelected" >我已阅读并同意</radio>
|
|
|
<text @click="gotoTermOfService(8)" class="h-btn">《储值协议》</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -94,7 +130,21 @@
|
|
|
<text>使用说明</text>
|
|
|
</view>
|
|
|
<view class="h-content">
|
|
|
-
|
|
|
+ <view class="h-v-text">
|
|
|
+ <text>1、 这上面的夜的天空,奇怪而高,我生平。</text>
|
|
|
+ </view>
|
|
|
+ <view class="h-v-text">
|
|
|
+ <text>2、 这上面的夜的天空,奇怪而高,我生平。</text>
|
|
|
+ </view>
|
|
|
+ <view class="h-v-text">
|
|
|
+ <text>3、 这上面的夜的天空,奇怪而高,我生平。</text>
|
|
|
+ </view>
|
|
|
+ <view class="h-v-text">
|
|
|
+ <text>4、 这上面的夜的天空,奇怪而高,我生平。</text>
|
|
|
+ </view>
|
|
|
+ <view class="h-v-text">
|
|
|
+ <text>5、 这上面的夜的天空,奇怪而高,我生平。</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -104,21 +154,424 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-export default {
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ show: false,
|
|
|
+ currentTab: '', // 当前选中的 Tab
|
|
|
+ isSelected: true,
|
|
|
+ userInfo: {},
|
|
|
+ reqOrderParm: {
|
|
|
+ auth: true,
|
|
|
+ orderType: 3, // 订单类型;1-服务订单 2-产品订单 3-充值订单
|
|
|
+ rechargeAmount: null, // 充值金额
|
|
|
+ strategyId: null, // 优惠策略的ID 测试id 1694514233806888962
|
|
|
+ remark: null
|
|
|
+ },
|
|
|
+ reqPayParm: {
|
|
|
+ auth: true,
|
|
|
+ orderNo: null,
|
|
|
+ openid: null,
|
|
|
+ requstForm: true
|
|
|
+ },
|
|
|
+ rechargeList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ // 获取充值面额
|
|
|
+ this.getRechargeList();
|
|
|
+ // 用户信息
|
|
|
+ this.userInfo = uni.getStorageSync('userInfo');
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
|
|
|
- data() {
|
|
|
- return {
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
+ // 获取充值面额
|
|
|
+ getRechargeList(){
|
|
|
+ console.log('+++++++++666666666666666666+++++++++++++++++++')
|
|
|
+ this.$api.getRechargeList(this.reqOrderParm).then((res)=>{
|
|
|
+ console.log('++++++++++++++getRechargeList+++++++++++++++++',res)
|
|
|
+ this.rechargeList = res.data.data;
|
|
|
+ }).catch(() =>{
|
|
|
+ uni.showToast({
|
|
|
+ title: "操作失败"
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 提交订单
|
|
|
+ submitOrder(){
|
|
|
+ const that = this;
|
|
|
|
|
|
- },
|
|
|
- methods: {
|
|
|
- }
|
|
|
-}
|
|
|
+ if(!this.isSelected){ // 是否确定协议
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择充值协议!'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.reqOrderParm.strategyId == null){
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择充值项目!'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 提交订单
|
|
|
+ this.$api.commonGeneralOrder(this.reqOrderParm).then((res)=>{
|
|
|
+ console.log('+++++++++++commonGeneralOrder++++++++++',res)
|
|
|
+ that.reqPayParm.orderNo = res.data.data.orderNo;
|
|
|
+ // 调用微信支付
|
|
|
+ that.wechatPay();
|
|
|
+ }).catch(() =>{
|
|
|
+ uni.showToast({
|
|
|
+ title: "操作失败"
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 微信支付
|
|
|
+ wechatPay(){
|
|
|
+ const that = this;
|
|
|
+ // 用户信息
|
|
|
+ that.reqPayParm.requstForm = true;
|
|
|
+ this.$api.wechatPay(that.reqPayParm).then((res)=>{
|
|
|
+ var param = res.data.data;
|
|
|
+ uni.requestPayment({
|
|
|
+ appId: param.appid,
|
|
|
+ timeStamp: param.timestamp+"",
|
|
|
+ nonceStr: param.noncestr,
|
|
|
+ package: "prepay_id="+param.prepayid,
|
|
|
+ signType: "RSA",
|
|
|
+ paySign: param.sign,
|
|
|
+ success: res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付成功!'
|
|
|
+ });
|
|
|
+ // 刷新用户信息
|
|
|
+ that.getUserInfo()
|
|
|
+ },
|
|
|
+ fail: res => {
|
|
|
+ uni.showModal({
|
|
|
+ content: '支付失败',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(() =>{
|
|
|
+ uni.showToast({
|
|
|
+ title: "操作失败"
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ getUserInfo(){
|
|
|
+ this.$api.getUserInfo().then(res=>{
|
|
|
+ console.log('++++++++++++获取用户信息++++++++++++++++++',res)
|
|
|
+ uni.setStorageSync('userInfo',res.data.data)
|
|
|
+ this.userInfo = res.data.data
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ // 取消上面选择的面值
|
|
|
+ cancelChooseMoney(){
|
|
|
+ this.reqOrderParm.strategyId = null;
|
|
|
+ this.reqOrderParm.rechargeAmount = null;
|
|
|
+ this.currentTab = '';
|
|
|
+ },
|
|
|
+ // 选择充值金额
|
|
|
+ selectActiveRecharge(item,index){
|
|
|
+ // 设置充值的金额和策略ID
|
|
|
+ this.reqOrderParm.strategyId = item.id;
|
|
|
+ this.reqOrderParm.rechargeAmount = item.reachPrice;
|
|
|
+ this.currentTab = index;
|
|
|
+ },
|
|
|
+ toggleSelection() {
|
|
|
+ this.isSelected = !this.isSelected;
|
|
|
+ },
|
|
|
+ // 交易记录
|
|
|
+ gotoTransactionRecords(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/myPages/transactionRecord/index',
|
|
|
+ params: {}
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 充值记录
|
|
|
+ gotoTransactionOrderRecords(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/myPages/rechargeRecord/index',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看储值协议
|
|
|
+ gotoTermOfService(type){
|
|
|
+ uni.$u.route({
|
|
|
+ url: '/pages/me/term-of-service-detatil',
|
|
|
+ params: {
|
|
|
+ data: type
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
-@import '/common/css/common.css';
|
|
|
-@import './index.rpx.scss';
|
|
|
+ .page{
|
|
|
+ background: red;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*scroll-view外层*/
|
|
|
+ .skill-sequence-panel-content-wrapper {
|
|
|
+ position: relative;
|
|
|
+ white-space: nowrap;
|
|
|
+ // padding: 10rpx 0 10rpx 10rpx;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*左右渐变遮罩*/
|
|
|
+ .hide-content-box {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ height: 100%;
|
|
|
+ width: 10px;
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hide-content-box-left {
|
|
|
+ left: 0;
|
|
|
+ background-image: linear-gradient(to left, rgba(255, 255, 255, 0), #f3f3f3 60%);
|
|
|
+ }
|
|
|
+
|
|
|
+ .hide-content-box-right {
|
|
|
+ right: 0;
|
|
|
+ background-image: linear-gradient(to right, rgba(255, 255, 255, 0), #f3f3f3 60%);
|
|
|
+ }
|
|
|
+
|
|
|
+ .kite-classify-scroll {
|
|
|
+ width: 100%;
|
|
|
+ // height: 380rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .kite-classify-cell {
|
|
|
+ display: inline-block;
|
|
|
+ width: 266rpx;
|
|
|
+ // height: 370rpx;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ background-color: #ffffff;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ box-shadow: 2px 2px 3px rgba(26, 26, 26, 0.2);
|
|
|
+ position: relative;
|
|
|
+ .h-bg-img{
|
|
|
+ image{
|
|
|
+ height: 80px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 20%;
|
|
|
+ left:12px;
|
|
|
+ .money{
|
|
|
+ color: #333333;
|
|
|
+ .v{
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .desc{
|
|
|
+ margin-top: 6px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 22px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 余额
|
|
|
+ .recharge-me{
|
|
|
+
|
|
|
+
|
|
|
+ position: relative;
|
|
|
+ .bg-img{
|
|
|
+ height: 160px;
|
|
|
+ background: #FFE05C;
|
|
|
+ }
|
|
|
+ .wallet-content{
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ padding: 12px;
|
|
|
+ .h-balance-wrap{
|
|
|
+ background: #FFFCF1 ;
|
|
|
+ border-radius: 6px;
|
|
|
+ text-align: center;
|
|
|
+ padding-left: 20px;
|
|
|
+ padding-right: 20px;
|
|
|
+ .h-balance{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ height: 118px;
|
|
|
+ .recharge-balance{
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
+ .h-nav-img {
|
|
|
+ image{
|
|
|
+ height: 18px;
|
|
|
+ width: 18px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .name{
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #666666;
|
|
|
+ line-height: 22px;
|
|
|
+ }
|
|
|
+ .balance-value{
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 26px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn{
|
|
|
+ display: flex;
|
|
|
+ font-size: 14px;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 60px;
|
|
|
+ align-items: center;
|
|
|
+ color: #999999;
|
|
|
+ .item-btn{
|
|
|
+ width: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 充值金额选择
|
|
|
+ .recharge-content-wrap{
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 12px;
|
|
|
+ position: relative;
|
|
|
+ .recharge-content{
|
|
|
+ width: calc(50% - 6px);
|
|
|
+ margin-bottom: 12px;
|
|
|
+ position: relative;
|
|
|
+ .h-bg-img{
|
|
|
+ image{
|
|
|
+ height: 80px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 25%;
|
|
|
+ left:12px;
|
|
|
+ .money{
|
|
|
+ color: #333333;
|
|
|
+ .v{
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .desc{
|
|
|
+ font-size: 12px;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 22px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .choose-status{
|
|
|
+ display: none;
|
|
|
+ position: absolute;
|
|
|
+ left: 0px;
|
|
|
+ top: 0px;
|
|
|
+ .active{
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ border-left: 0px solid transparent;
|
|
|
+ border-right: 30px solid transparent;
|
|
|
+ border-top: 30px solid green;
|
|
|
+ }
|
|
|
+ image{
|
|
|
+ height: 40px;
|
|
|
+ width: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .h-custom{
|
|
|
+ background: #FFFCF1;
|
|
|
+ display: flex;
|
|
|
+ padding: 12px;
|
|
|
+ border-radius: 10px;
|
|
|
+ margin-top: 8px;
|
|
|
+ .h-money{
|
|
|
+ margin-left: 6px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 协议
|
|
|
+ .recharge-agreement{
|
|
|
+ margin-top: 12px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ margin-left: 12px;
|
|
|
+ text-align: center;
|
|
|
+ .radio-group{
|
|
|
+ .v-text{
|
|
|
+ // color:green;
|
|
|
+ }
|
|
|
+ .h-btn{
|
|
|
+ color:green;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 提交按钮
|
|
|
+ .h-submit-btn{
|
|
|
+ margin-top: 12px;
|
|
|
+ width: 343px;
|
|
|
+ height: 42px;
|
|
|
+ background: #FFE05C;
|
|
|
+ border-radius: 27px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 42px;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用说明
|
|
|
+ .h-desc{
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
+ .title{
|
|
|
+ height: 24px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ .h-content{
|
|
|
+ height: 40px;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #999999;
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|