From 5fea21303e6d72a01906e2750b88f9ff99cb07a4 Mon Sep 17 00:00:00 2001
From: tx <2622874537@qq.com>
Date: Tue, 3 Sep 2024 18:02:16 +0800
Subject: [PATCH] =?UTF-8?q?vip=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/http.interceptor.js | 4 +-
page_vip/buyCard.vue | 51 +++++++++++---
page_vip/vip_index.vue | 50 ++++++++++++--
pages/my.vue | 134 ++++++++++++++++++++++++++++++++++++-
4 files changed, 217 insertions(+), 22 deletions(-)
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index 74d0787..d55f0f7 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -5,11 +5,11 @@ const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://61.174.243.28:15861',
// baseUrl: 'http://192.168.2.46:8080',
- // baseUrl: 'https://che.chuangtewl.com/prod-api',
+ baseUrl: 'https://che.chuangtewl.com/prod-api',
// 测试环境
// baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
// 俞山岛
- baseUrl: 'https://dche.ccttiot.com/prod-api',
+ // baseUrl: 'https://dche.ccttiot.com/prod-api',
// 创特
loadingText: '努力加载中~',
loadingTime: 10000,
diff --git a/page_vip/buyCard.vue b/page_vip/buyCard.vue
index cf60c34..4dc2d21 100644
--- a/page_vip/buyCard.vue
+++ b/page_vip/buyCard.vue
@@ -12,8 +12,8 @@
我的骑行卡
-
-
+
+
电单车15天5次卡
@@ -39,10 +39,13 @@
已优惠 9.75元
+
+ 购买
+
-
+
电单车15天5次卡
@@ -68,7 +71,7 @@
已优惠 9.75元
-
+
购买
@@ -76,7 +79,7 @@
-
+
@@ -113,7 +116,7 @@
不包括景区等特殊区域
-
+
取消
@@ -133,12 +136,37 @@
},
sn: '',
istrue: false,
- show:false
+ show:false,
+ CouponList:[],
+ buyinfo:[]
}
},
-
+ onShow() {
+ this.getCouponList()
+ },
methods: {
-
+ buycard(item){
+ this.buyinfo=item
+ this.show=true
+ },
+ getCouponList(){
+ let data={
+ type:'3,4'
+ }
+ this.$u.get("/app/couponList",data ).then((res) => {
+
+ if (res.code == 200) {
+ this.CouponList = res.data
+
+ } else {
+ // uni.showToast({
+ // title: res.msg,
+ // icon: 'none',
+ // duration: 2000
+ // });
+ }
+ });
+ },
}
}
@@ -153,13 +181,14 @@
.buy_box {
padding: 0 46rpx;
position: fixed;
- bottom: 0;
+ bottom: 0rpx;
+ left: 0rpx;
width: 750rpx;
height: 780rpx !important;
background: #FDFDFD;
border-radius: 0rpx 0rpx 0rpx 0rpx;
z-index: 101;
- position: relative;
+ // position: relative;
.tit_txt {
padding-top: 114rpx; /* 使用 padding-top 或者增加 overflow: hidden 来防止 margin 合并 */
diff --git a/page_vip/vip_index.vue b/page_vip/vip_index.vue
index a38a995..53e09ae 100644
--- a/page_vip/vip_index.vue
+++ b/page_vip/vip_index.vue
@@ -28,12 +28,12 @@
-
+
- 月卡
+ {{item.name}}
- ¥39.9
+ ¥ {{item.retailPrice}}
¥59.9
@@ -64,12 +64,50 @@
backgroundColor: '#fff'
},
sn: '',
- istrue: false
+ istrue: false,
+ CouponList:[],
+ userinfo:{}
}
},
-
+ onShow() {
+ this.getCouponList()
+ this.getinfo()
+ },
methods: {
-
+ getinfo() {
+ // uni.showLoading({
+ // title:'加载中'
+ // })
+ this.$u.get("/getAppInfo").then((res) => {
+
+ if (res.code == 200) {
+
+ this.$store.commit('SET_USERID', res.user.userId);
+ this.userinfo = res.user
+
+ } else {
+
+ }
+ });
+ },
+ getCouponList(){
+ let data={
+ type:'1'
+ }
+ this.$u.get("/app/couponList",data ).then((res) => {
+
+ if (res.code == 200) {
+ this.CouponList = res.data
+
+ } else {
+ // uni.showToast({
+ // title: res.msg,
+ // icon: 'none',
+ // duration: 2000
+ // });
+ }
+ });
+ },
}
}
diff --git a/pages/my.vue b/pages/my.vue
index f223f34..cfbec8b 100644
--- a/pages/my.vue
+++ b/pages/my.vue
@@ -221,7 +221,27 @@
-
+ 月卡会员
+ {{CarkTypeList[0].desc}}
+
+
+
+
+
+ {{item.name}}
+
+
+ {{item.retailPrice}}元
+
+
+ {{item.desc}}
+
+
+
+ 购买
+
+
+
@@ -283,7 +303,9 @@
deptId: 0,
statusBarHeight: 0,
navBarHeight: 0,
- areaInfo:{}
+ areaInfo:{},
+ CouponList:[],
+ CarkTypeList:[]
@@ -322,6 +344,11 @@
}
},
methods: {
+ tobuy(){
+ uni.navigateTo({
+ url:'/page_vip/buyCard'
+ })
+ },
getarea() {
let id = uni.getStorageSync('areaId');
this.$u.get("/app/area/" + id).then((res) => {
@@ -338,6 +365,42 @@
}
});
},
+ getCouponList(){
+ let data={
+ type:'3,4'
+ }
+ this.$u.get("/app/couponList",data ).then((res) => {
+
+ if (res.code == 200) {
+ this.CouponList = res.data
+
+ } else {
+ // uni.showToast({
+ // title: res.msg,
+ // icon: 'none',
+ // duration: 2000
+ // });
+ }
+ });
+ },
+ getCarkType(){
+ let data={
+ type:'3,4'
+ }
+ this.$u.get("/app/couponList",data ).then((res) => {
+
+ if (res.code == 200) {
+ this.CarkTypeList = res.data
+
+ } else {
+ // uni.showToast({
+ // title: res.msg,
+ // icon: 'none',
+ // duration: 2000
+ // });
+ }
+ });
+ },
layout(){
this.$u.post('/logout').then((res) => {
if (res.code == 200) {
@@ -474,6 +537,8 @@
if (res.code == 200) {
uni.hideLoading()
+ this.getCouponList()
+ this.getCarkType()
this.$store.commit('SET_USERID', res.user.userId);
this.info = res.user
if (info.role != 1) {
@@ -550,13 +615,75 @@
.page {
width: 750rpx;
+ .fee_box {
+ margin-top: 18rpx;
+ position: relative;
+ margin-left: 38rpx;
+ width: 680rpx;
+ height: 288rpx;
+ background-image: url('https://lxnapi.ccttiot.com/bike/img/static/ugciMYClSGgJxP8HYoRU');
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+ .auto_box::-webkit-scrollbar {
+ display: none;
+ }
+ .auto_box {
+ padding-left: 24rpx;
+ display: flex;
+ overflow-x: auto; /* 允许横向滚动 */
+ flex-wrap: nowrap; /* 禁止换行,保持所有元素在一行 */
+ position: absolute;
+ top: 90rpx;
+ width: 100%; /* 根据需要调整宽度 */
+ height: auto; /* 根据内容自动调整高度 */
+
+ .auto_li {
+ position: relative;
+ padding: 24rpx 28rpx;
+ margin-right: 22rpx;
+ width: 408rpx;
+ height: 176rpx;
+ flex-shrink: 0; /* 防止子元素被压缩 */
+ background-image: url('https://lxnapi.ccttiot.com/bike/img/static/ui88NWy9R1j2zFGojdHU');
+ background-size: cover;
+ background-position: center;
+ .txt1{
+ width: 100%;
+ font-weight: 600;
+ font-size: 32rpx;
+ color: #495E74;
+ }
+ .txt2{
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #495E74;
+ }
+ .buy_btn{
+ position: absolute;
+ right: 26rpx;
+ bottom: 38rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 132rpx;
+ height: 50rpx;
+ background: #495E74;
+ border-radius: 25rpx 25rpx 25rpx 25rpx;
+ font-weight: 500;
+ font-size: 28rpx;
+ color: #FFF3DB;
+ }
+ }
+ }
+ }
.vip_box{
position: relative;
margin-left: 38rpx;
width: 680rpx;
height: 158rpx;
background-image: url('https://lxnapi.ccttiot.com/bike/img/static/uw6bYgjn1bS1ayNm6VI9');
- background-size: cover;
+ background-size: cover;
/* 背景图片等比缩放以覆盖整个容器 */
background-position: center;
/* 背景图片居中显示 */
@@ -570,6 +697,7 @@
color: #FFE09E;
}
.txt2{
+ position: absolute;
right: 74rpx;
bottom: 10rpx;
font-weight: 400;