Commit 9e44c986 by zhangzhen

新功能开发

parent 830d4cef
......@@ -6,5 +6,15 @@ export const recordsList=(data)=>{
return http.get(url,data)
}
// 充值配置
export const rechargeConf=(data)=>{
let url=`/rechargeConf/list`
return http.get(url,data)
}
export const createRecharge=(data)=>{
let url=`/recharge/createRecharge`
return http.post(url,data)
}
......@@ -102,6 +102,12 @@
iconFill: '/static/tab-bar-img/home_selected.png'
},
{
name: '会员中心',
url: 'pages/vipCreate/vipCreate',
icon: '/static/tab-bar-img/vip.png',
iconFill: '/static/tab-bar-img/vip_selected.png'
},
{
name: '订单',
url: 'pages/orderRecord/orderRecord',
icon: '/static/tab-bar-img/order.png',
......
......@@ -5,10 +5,10 @@ const CONFIG = {
// assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
assetsPath: 'http://10.24.5.167:8211/static', // 静态资源路径
// baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
// baseUrl: 'http://10.24.3.185:8883/front-api',
// hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
// baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
baseUrl: 'http://129.211.46.84:8883/front-api',
hostUrl: 'http://129.211.46.84:8882/prod-api', // H5地址(前端运行地址)
// hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
weixinAppId: '' ,// 微信公众号appid
codeHeadUrl:"",
......
......@@ -8,6 +8,14 @@
}
},
{
"path" : "pages/vipCreate/vipCreate",
"style" :
{
"navigationBarTitleText" : "权益充值",
"navigationStyle": "custom"
}
},
{
"path": "pages/storeList/storeList",
"style": {
"navigationBarTitleText": "选择门店",
......@@ -142,15 +150,7 @@
"style": {
"navigationBarTitleText": "设备控制"
}
},
{
"path" : "pages/vipCreate/vipCreate",
"style" :
{
"navigationBarTitleText" : "权益充值"
}
}
],
"subPackages": [
{
......@@ -206,6 +206,12 @@
"text": "首页"
},
{
"pagePath": "pages/vipCreate/vipCreate",
"iconPath": "static/tab-bar-img/vip.png",
"selectedIconPath": "static/tab-bar-img/vip_selected.png",
"text": "会员中心"
},
{
"pagePath": "pages/orderRecord/orderRecord",
"iconPath": "static/tab-bar-img/order.png",
"selectedIconPath": "static/tab-bar-img/order_selected.png",
......
<template>
<view class="vip-create">
<view class="banner-box">
<image :src="assetsPath+'/vip/bg.png'" mode="widthFix"></image>
<view class="footer-box">
<button class="cu-btn round bg-pink" @tap="onSubmit">立即充值</button>
<view class="bg-header">
<image :src="assetsPath+'/vip/bg_header.png'" mode="widthFix"></image>
</view>
<view class="content">
<view class="bg-box-1">
<view class="bg-box-2">
<view class="flex-row-center title-content">
<view class="xx">
<image :src="assetsPath+'/xx.png'" mode="widthFix"></image>
</view>
<view class="title-text">
<view class="text">
<text>会员超值购</text>
</view>
<view class="line">
</view>
</view>
<view class="xx">
<image :src="assetsPath+'/xx.png'" mode="widthFix"></image>
</view>
</view>
<view class="flex-between">
<view class="part-left">
<text>充值会员</text>
</view>
<view class="part-right">
<text>权益会员</text>
</view>
</view>
<view class="list-box">
<view v-for="(item,k) in rechargeConfList" :key="k" class="flex-col item">
<view v-if="item.giveType.includes('1')" class="">
<text>{{item.giveAmount}}小时</text>
</view>
<view v-else-if="item.giveType.includes('2')" class="">
<text>{{item.giveDuration}}小时</text>
</view>
<view class="line">
</view>
<view class="flex-row">
<text></text><text>{{item.rechargeAmount}}</text>
</view>
<view class="tip-text">
<text>充值送时长,多充多送</text>
</view>
</view>
</view>
</view>
</view>
</view>
<f-tabbar></f-tabbar>
</view>
</template>
<script>
import fTabbar from '@/components/module/f-tabbar/f-tabbar';
import {equityMembersList,createEquityMembers} from "@/api/uerInfo.js";
import {rechargeConf,createRecharge} from "@/api/recharge.js";
import config from "@/config/index.config";
export default {
components: {
fTabbar
},
data() {
return {
assetsPath: config.assetsPath,
list:[],
rechargeConfList:[],
index: 0
};
},
onLoad() {
uni.hideTabBar();
this.onGetRechargeConf();
this.onLoading();
},
methods:{
......@@ -34,6 +95,19 @@
}
})
},
onGetRechargeConf(){
rechargeConf().then(res =>{
if(res.data.code == 200 && res.data.rows){
this.rechargeConfList = res.data.rows.map(item=>{
return {
...item,
giveType: item.giveType?item.giveType.split(","):[]
}
})
console.log(this.rechargeConfList,9999)
}
})
},
onSubmit(){
createEquityMembers({
payType:1,
......@@ -70,6 +144,43 @@
}
})
},
onSubmit2(){
createRecharge({
payType:1,
rechargeConfId:this.rechargeConfList[0].id
}).then(res =>{
console.log(res,9999)
if (res.data.data.jsConfig) {
wx.requestPayment({
"timeStamp": res.data.data.jsConfig.timeStamp,
"nonceStr": res.data.data.jsConfig.nonceStr,
"package": res.data.data.jsConfig.packages,
"signType": res.data.data.jsConfig.signType,
"paySign": res.data.data.jsConfig.paySign,
"success": (resp) => {
// 支付成功
uni.showToast({
icon: "success",
title: "下单成功",
success: () => {
}
})
},
"fail": (resp) => {
// 取消支付或支付失败
uni.showToast({
title: "取消支付"
})
},
"complete": (resp) => {
// 接口调用结束的回调函数(调用成功、失败都会执行)
}
});
}
})
}
}
}
......@@ -80,14 +191,102 @@
display: flex;
flex-direction: column;
width: 100%;
}
.banner-box{
min-height: 100vh;
justify-content: center;
.bg-header{
display: block;
image{
display: block;
width: 100%;
}
}
.content{
display: flex;
width: 100%;
background-color: #FFEABF;
justify-content: center;
padding-bottom: 60upx;
.bg-box-1{
display: flex;
justify-content: center;
align-items: center;
width: 690upx;
min-height: 596upx;
background: #FFCA7E;
border-radius: 32upx;
padding: 10upx 0;
.bg-box-2{
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
width: 668upx;
background: linear-gradient(-42deg, #FFF5CB, #FFFFFF);
border-radius: 32upx;
.title-content{
margin-top: 34upx;
.title-text{
display: flex;
justify-content: center;
position: relative;
margin: 0 20upx;
.text{
position: relative;
font-weight: normal;
font-size: 48rpx;
color: #000000;
background: linear-gradient(-90deg, #FF7800 0%, #FF0000 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
z-index: 2;
}
.line{
position: absolute;
bottom: 0;
width: 110%;
height: 15upx;
background: #FFEABF;
border-radius: 8upx;
}
}
.xx{
width: 30upx;
image{
width: 100%;
}
image{
max-height: 34upx;
}
}
}
}
}
.list-box{
display: flex;
width: 100%;
padding: 0 1%;
justify-content: center;
.item{
display: flex;
align-items: center;
width: 31%;
margin: 0 1%;
background: linear-gradient(-39deg, #FFEABF, #FFFFFF);
border-radius: 10rpx 28rpx 28rpx 28rpx;
border: 1px solid #FF4D05;
.line{
width: 90%;
height: 1rpx;
border: 1px solid #FA541D;
}
.tip-text{
font-size: 16upx;
}
}
}
}
}
.footer-box{
position: absolute;
left: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment