苹果上线

This commit is contained in:
2025-02-19 10:05:10 +08:00
parent bb98c4af5d
commit c85477a45b
46 changed files with 12514 additions and 8936 deletions

View File

@@ -0,0 +1,287 @@
<template>
<view>
<view v-for="(item, index) in List" :key="index">
<view :class="`youhuiItem ${itemClass}`">
<view class="centerbg">
<view class="centerView" style="position: relative"
><text
v-if="source == 'mine'"
class="border_radius_10"
style="
position: absolute;
right: 10rpx;
top: 10rpx;
font-size: 25rpx;
/* background-color: #fad4bd; */
color: #ed2a2e;
"
>{{ item.couponEntity.couponRange | couponType }}</text
>
<view style="color: #fd4347; width: 200rpx">
<view
style="position: relative; border-right: 1px dashed #fa8277"
>
<text
style="
font-weight: 700;
font-size: 40rpx;
position: absolute;
top: 20rpx;
left: 0rpx;
"
></text
>
<text
style="
font-size: 64rpx;
letter-spacing: 0.1px;
font-weight: 700;
margin-left: 40rpx;
"
>{{ item.couponEntity.couponAmount }}</text
>
<text
v-if="source == 'mine'"
style="
display: block;
color: #333;
font-size: 25rpx;
margin-left: 0rpx;
margin-top: 0rpx;
"
>{{ item.couponEntity.useLevel }}元可用</text
>
</view>
</view>
<view style="width: calc(100% - 220rpx)">
<view>
<view
style="color: #fd4347; font-size: 44rpx; font-weight: bold;"
>{{
item.couponEntity.couponType == 0 ? "现金" : "折扣"
}}优惠券
<!-- <text v-if="source == 'mine'" style="box-sizing: border-box;padding:4rpx 20rpx;margin-left: 10rpx;font-size: 24rpx;background-color: #fff;border-radius: 24rpx;float: right;">去使用</text> -->
</view
>
<text
v-if="source != 'goodsDetail'"
style="
display: block;
font-size: 24rpx;
color: #333;
margin-top: 10rpx;
"
>有效期至{{
item.effectType == 0 ? "永久有效" : item.endTime
}}</text
>
</view>
</view>
</view>
</view>
<view class="bottombg">
<view
style="
width: 100%;
padding: 16rpx 20rpx;
box-sizing: border-box;
margin-right: 6rpx;
position: absolute;
bottom: 0rpx;
text-align: center;
"
>
<view
class="title"
style="
line-height: 34rpx;
margin-bottom: 10rpx;
color: #fff;
font-size: 34rpx;
font-weight: bold;
"
>
{{ item.couponEntity.couponName }}
</view>
<view
v-if="item.couponEntity.remark"
style="
position: absolute;
right: 10rpx;
bottom: 10rpx;
display: flex;
align-items: center;
font-size: 22rpx;
color: #fafafa;
"
>
<!-- 详细信息
<u-icon
size="20rpx"
color="#fafafa"
style="color: #fafafa; float: right;margin-left: 4rpx;"
name="arrow-down-fill"
></u-icon> -->
</view>
</view>
</view>
</view>
<u-collapse
v-if="source != 'goodsDetail'&&item.couponEntity.remark"
style="
margin-top: 0rpx;
z-index: 10 !important;
background-color: #fafafa;
border-bottom-left-radius: 10rpx;
border-bottom-right-radius: 10rpx;
"
:border="false"
>
<u-collapse-item title="详细信息" name="Docs guide">
<view
style="
font-size: 22rpx;
width: 100%;
margin-right: 20rpx !important;
"
>使用说明{{ item.couponEntity.remark }}</view
>
</u-collapse-item>
</u-collapse>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
props: ["List", "source", "itemClass"],
data() {
return {};
},
filters: {
couponType(type) {
// 0无限制 1课程卷 2课程品类卷
var str = "";
switch (type) {
case 0:
str = "全场通用";
break;
case 1:
str = "指定课程可用";
break;
case 2:
str = "指定课程品类可用";
break;
}
return str;
},
},
computed: {
...mapState(["userInfo"]),
},
methods: {},
};
</script>
<style scoped lang="scss">
.youhuiItem {
min-height: 320rpx;
position: relative;
background: linear-gradient(to top right, #fd4c50, #fe393d);
border: 1px solid #d9d9d9;
border-radius: 10rpx;
width: 100%;
padding: 26rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
font-size: 30rpx;
}
.centerbg {
width: 100%;
background-image: linear-gradient(60deg, #ffefd3 0%, #f8be85 100%);
height: calc(100%);
border-radius: 10rpx;
padding-bottom: 86rpx;
box-sizing: border-box;
}
.centerView {
width: 100%;
height: 100%;
overflow: hidden;
padding: 30rpx 20rpx 0 40rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.bottombg {
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
left: 0;
right: 0;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
background-image: url("@/static/icon/coupon/bottom.png") !important;
}
.youhuiItem > view {
}
.youhuiItem.youItem_style {
border-color: #fd6004;
}
::v-deep .u-cell__body {
padding-top: 0 !important ;
padding-bottom: 0 !important ;
z-index: 10 !important ;
.u-cell__title-text {
color: #333 !important;
font-size: 24rpx !important;
}
}
::v-deep .u-collapse-item__content__text {
padding: 10rpx 20rpx !important;
box-sizing: border-box;
}
::v-deep.itemCouponClass {
min-height: 180rpx !important;
.bottombg {
.title {
font-size: 26rpx !important;
}
}
.centerbg {
padding-bottom: 60rpx !important;
}
}
</style>

View File

@@ -87,7 +87,24 @@
<view class="price_box"> </view>
</view>
</view>
<template v-if="canGetCouponList.length > 0">
<u-divider
text="购买本商品赠送如下优惠券"
:hairline="true"
textColor="#333"
lineColor="#b0b0b0"
></u-divider>
<view class="tanchu">
<view class="listBox">
<common-coupon
:List="canGetCouponList"
:source="'goodsDetail'"
itemClass="itemCouponClass"
>
</common-coupon>
</view>
</view>
</template>
<template>
<common-sticky label="title" :itemStyle="`width:${
cateList.length == 2 ? '50' : '33'
@@ -222,7 +239,7 @@
<!-- isSelectGoods -->
<view class="related_courses_name" :class="`goods_item `">
<view class="image_box" style="margin-right: 10rpx">
<image :src="slotProps.row.images" mode="aspectFit" class="goods_image"></image>
<image :src="slotProps.row.images||slotProps.row.image" mode="aspectFit" class="goods_image"></image>
</view>
<view :class="`goods_info `">
<view class="name">
@@ -479,7 +496,7 @@
// info: 2
// }
],
canGetCouponList: [], // 可获得优惠券列表
swiperList: [],
goodsList: [],
options: {},
@@ -637,6 +654,31 @@
...mapState(["userInfo"]),
},
methods: {
async getCanGetCouponList() {
await this.$http
.request({
url: "common/coupon/couponToProductList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
page: 1,
limit: 100,
productId: this.curriculumData.productId,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if (res.code != 0) return this.$commonJS.showToast(res.errMsg);
console.log("res优惠券", res);
this.canGetCouponList = res.couponToShopproductPage.records;
})
.catch((e) => {
console.log(e);
this.$commonJS.showToast(e.errMsg);
});
},
closeShowInfo() {
this.showInfo = false;
},
@@ -852,6 +894,7 @@
.then(async (res) => {
that.selectGoodsData = res.data.GLProducts[0];
that.curriculumData = res.data.detail;
// await this.getCanGetCouponList();
that.booksList = res.data.books ? res.data.books : [];
that.coursesList = res.data.courses ? res.data.courses : [];
that.goodsList = res.data.GLProducts;

View File

@@ -257,8 +257,27 @@
<view class="text" style="line-height: 40rpx">{{
userMes.jf ? userMes.jf : 0
}}</view>
</view>
<view
class="chong_list_item"
style="
display: flex;
align-items: center;
flex-direction: column;
justify-content: space-between;
"
@click="onPageJump('/pages/mine/wallet/couponList')"
>
<view class="pay_item_img"> 优惠券 </view>
<view class="text" style="line-height: 40rpx">{{
userCouponNum
}}</view>
</view>
</view>
<!-- v-if="iosHide" -->
<!-- <view v-if="iosHide" class="chong_list_item">
@@ -393,6 +412,7 @@
export default {
data() {
return {
userCouponNum: 0,
come: "1",
orderList: [{
title: "全部",
@@ -513,12 +533,12 @@
...mapState(["userInfo"]),
},
//页面显示
onShow() {
async onShow() {
console.log(this.userInfo, "11111111111111");
// 隐藏原生的tabbar
// uni.hideTabBar();
this.getBookList();
this.getData();
this.getData();await this.getUserCouponList();
},
async onTabItemTap() {
this.getBookList();
@@ -530,6 +550,33 @@
//方法
methods: {
...mapMutations(["setUserInfo"]),
async getUserCouponList() {
await this.$http
.request({
url: "common/coupon/getCouponHistoryList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
page: 1,
limit: 10,
getType: "", //获取类型 0 后台赠送 1 主动获取
status: "0", //使用状态 0 未使用 1 已使用 2 已过期
userInfo: "", //用户信息
userId: this.userInfo.id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if (res.code != 0) return this.$commonJS.showToast(res.errMsg);
this.userCouponNum = res.couponList.total;
})
.catch((e) => {
console.log(e);
this.$commonJS.showToast(e.errMsg);
});
},
getBookList(flag, refreshflag) {
this.isLoadingHide = false;
var that = this;

View File

@@ -0,0 +1,290 @@
<template>
<view>
<public-module></public-module>
<z-nav-bar title="我的优惠券"></z-nav-bar>
<view class="">
<view class="">
<u-tabs
v-if="tabList.length > 0"
:class="['tabList']"
@click="tabClick"
:current="curTagIndex"
:activeStyle="activeStyle"
:scrollable="false"
:list="tabList"
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"
></u-tabs>
</view>
<!-- -->
<view class="tanchu" style="position: relative">
<view
v-if="status!=0"
style="
min-height: 80vh;
z-index: 100;
background-color: #f0f0f0;
opacity: 0.55;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
"
></view>
<view class="listBox" v-if="list.length > 0">
<view style="min-height: 40vh; overflow-y: scroll">
<common-coupon :List="list" :source="'mine'"> </common-coupon>
</view>
<!-- <view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view> -->
</view>
<view class="" v-else>
<u-divider v-show="listStatus == 2" text="已加载全部"></u-divider>
<u-divider v-show="listStatus == 3" text="暂无数据"></u-divider>
<u-divider v-show="listStatus == 1" text="加载中..."></u-divider>
</view>
</view>
</view>
<z-navigation></z-navigation>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
data() {
return {
list: [], // 优惠券列表
listStatus: 88,
curTagIndex: 0, // 当前索引
tabList: [
{
name: "未使用",
id: "0",
},
{
name: "已使用",
id: "1",
},
{
name: "已过期",
id: "2",
},
],
activeStyle: {
background: "#fff",
color: "#666",
padding: "10rpx",
borderRadius: "10rpx",
},
page: 0,
limit: 15,
status: 0,
flag: false, // 请求标记
};
},
onLoad() {
this.page = 1;
this.getUserCouponList();
},
async onReachBottom() {
console.log("触底", this.listStatus, this.flag);
if (this.listStatus != 1 && this.listStatus != 2) {
if (!this.flag) {
this.page++;
await this.getUserCouponList();
}
}
},
filters: {
couponType(type) {
// 0无限制 1课程卷 2课程品类卷
var str = "";
switch (type) {
case 0:
str = "全场通用";
break;
case 1:
str = "指定课程可用";
break;
case 2:
str = "指定课程品类可用";
break;
}
return str;
},
},
computed: {
...mapState(["userInfo"]),
},
methods: {
async tabClick(e) {
console.log("e", e);
this.status = e.id;
// this.curTagIndex = e.index
this.page = 0;
this.page += 1;
this.list = [];
await this.getUserCouponList();
},
async getUserCouponList() {
console.log("进入函数了妈");
this.listStatus = 1;
this.flag = true;
uni.showLoading({
title: "加载中",
});
console.log(
{
page: this.page,
limit: this.limit,
getType: "", //获取类型 0 后台赠送 1 主动获取
status: this.status, //使用状态 0 未使用 1 已使用 2 已过期
userInfo: "", //用户信息
userId: this.userInfo.id,
},
111111111111111111111111111
);
await this.$http
.request({
url: "common/coupon/getCouponHistoryList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
page: this.page,
limit: this.limit,
getType: "", //获取类型 0 后台赠送 1 主动获取
status: this.status, //使用状态 0 未使用 1 已使用 2 已过期
userInfo: "", //用户信息
userId: this.userInfo.id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log(res, "1111111111111");
uni.hideLoading();
if (res.code != 0) return this.$commonJS.showToast(res.errMsg);
if (res.couponList.records.length > 0) {
this.list = this.list.concat(res.couponList.records);
if (res.couponList.pages > this.page) {
this.listStatus = 0;
} else {
this.listStatus = 2;
}
} else {
this.listStatus = 3; // 暂无数据
}
this.flag = false;
})
.catch((e) => {
uni.hideLoading();
console.log(e);
this.flag = false;
this.listStatus = 3;
console.log(e, "数据报错");
this.$commonJS.showToast(e.errMsg);
});
},
},
};
</script>
<style lang="scss" scoped>
.btnBox {
margin-top: 20rpx;
}
.tanchu {
padding: 0 30rpx 40rpx 30rpx;
position: relative;
// max-height: 60vh;
// overflow-y: scroll;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
.addressItem {
border: 2px dashed #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
.addrContent {
margin-left: 40rpx;
flex: 1;
.addrContentTop {
display: flex;
align-items: flex-end;
margin: 0 0 15rpx 0;
position: relative;
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
.userMoren {
border: 1px solid #fd6004;
color: #fd6004;
padding: 3rpx 10rpx;
font-size: 22rpx;
border-radius: 10rpx;
margin: 0 0 0 20rpx;
}
.chooseCheck {
position: absolute;
top: 3rpx;
right: 6rpx;
}
}
.addrContentBottom {
font-size: 32rpx;
}
}
}
.addressItem.addItem_style {
border-color: #fd6004;
}
}
</style>

View File

@@ -3,6 +3,7 @@
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view>
{{ iosHide }}
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar

View File

@@ -99,7 +99,7 @@
<text v-if="type == 1000" @click="onPageJump('/pages/user/login/forget')">忘记密码</text>
</view>
</view>
<view class="youKeL" style="margin-bottom: 40rpx" v-if="!isAndorid">
<view class="youKeL" style="margin-bottom: 40rpx" v-if="isAndorid">
<view @click="onPageJump('/pages/user/visitor')">免登陆体验</view>
</view>

View File

@@ -90,13 +90,17 @@
v-if="selected == 4"
class="mine_bg_box"
style="
height: 100%;
height: 100vh;
background-color: #39b4a84d !important;
padding: 20rpx;
font-size: 28rpx;
"
>
<view class="bg_top">
<u-icon @click="goSetting" class="setIcon" labelColor="#fff" labelPos="bottom" label="设置" name="setting"
:style="`top:${(10 + statusBarHeight) * 2}rpx`" color="#fff" size="28"></u-icon>
</view>
<view style="height: 50rpx"></view>
<view class="per_mes" style="display: flex; align-items: center">
<image src="@/static/icon/fengziIcon.png" class="per_mes_img"></image>
@@ -444,6 +448,7 @@ export default {
isBook: 0, //是否是疯子读书
isMedical: 0, //是否是吴门医述
isSociology: 1, //是否是众妙之门
isPsyche:0,
};
this.$http
.request({
@@ -651,7 +656,12 @@ export default {
);
// }
}
},
},goSetting() {
uni.navigateTo({
url: "/pages/mine/set/index",
});
// this.onPageJump("/pages/mine/set/index");
},
goGoodsDetail(v) {
console.log(v);
uni.navigateTo({
@@ -1393,4 +1403,18 @@ function calcTimer(timer) {
// background: #fff;
}
.bg_top {
// background-position: center center;
padding: 0 30rpx;
height: 40rpx;
position: relative;
.setIcon {
position: absolute;
right: 30rpx;
// top: 30rpx;
}
}
</style>