This commit is contained in:
2024-09-09 11:19:59 +08:00
parent 9d87cc70a9
commit be841069ef
456 changed files with 5731 additions and 238053 deletions

View File

@@ -235,7 +235,7 @@ export default {
},
gotoDetail(data) {
uni.navigateTo({
url: `/pages/homePage/index/noticeDetail?id=${data.id}`,
url: `/pages/homePage/index/noticeDetail?id=${data.id}&type=taihu`,
});
},
requestAll() {

File diff suppressed because it is too large Load Diff

View File

@@ -1,30 +1,34 @@
<template>
<view style="width: 100%; height: 100%;">
<scroll-view @scrolltolower="lower" scroll-y="true" class="scroll-Y" v-if="dataList&&dataList.length > 0"
style="height: 100%">
<view @click="gotoDetail(item, index)" class="scroll-view-item list_item" v-for="(item, index) in dataList"
:key="indexKey ? item[indexKey] : item.id" :index="indexKey ? item[indexKey] : index"
style="align-items: flex-start">
<view :class="['titleItem', '']" :style="`width:${isNoIcon ? '100%' : 'calc(100% - 30rpx)'}`">
<slot name="leftSlot" :row="item" :item="item" :index="index"> </slot>
<template v-if="isCondition">
<view v-if="axiosStatus!=''">
<scroll-view @scrolltolower="lower" scroll-y="true" class="scroll-Y" v-if="dataList&&dataList.length > 0"
style="height: 100%">
<view @click="gotoDetail(item, index)" class="scroll-view-item list_item"
v-for="(item, index) in dataList" :key="indexKey ? item[indexKey] : item.id"
:index="indexKey ? item[indexKey] : index" style="align-items: flex-start">
<view :class="['titleItem', '']" :style="`width:${isNoIcon ? '100%' : 'calc(100% - 30rpx)'}`">
<slot name="leftSlot" :row="item" :item="item" :index="index"> </slot>
<slot name="labelSlot" :row="item" :rowIndex="index"></slot>
</template>
<template v-else>
{{ item[label] }}
</template>
<template v-if="isCondition">
<slot name="rightSlot" :row="item" :rowIndex="index"></slot>
<slot name="labelSlot" :row="item" :rowIndex="index"></slot>
</template>
<template v-else>
{{ item[label] }}
</template>
<slot name="rightSlot" :row="item" :rowIndex="index"></slot>
</view>
<image v-if="!isNoIcon" src="@/static/icon/icon_right.png" class="rightArrow" style=""></image>
</view>
<image v-if="!isNoIcon" src="@/static/icon/icon_right.png" class="rightArrow" style=""></image>
</view>
</scroll-view>
<u-empty v-else-if="noDataIcon && isLoadingHide" :mode="noDataIcon"
:icon="`http://cdn.uviewui.com/uview/empty/${noDataIcon}.png`">
</u-empty>
<u-divider style="width: 100%;" v-else text="暂无数据哦~"></u-divider>
</scroll-view>
<u-empty v-else-if="noDataIcon && isLoadingHide" :mode="noDataIcon"
:icon="`http://cdn.uviewui.com/uview/empty/${noDataIcon}.png`">
</u-empty>
<u-divider style="width: 100%;" v-else text="暂无数据哦~"></u-divider>
</view>
</view>
</template>
@@ -42,11 +46,20 @@
"pagination",
"noDataIcon",
"isLoadingHide",
"axiosStatus",
],
data() {
return {};
return {
status: '',
};
},
onLoad() {},
onShow() {
this.status = '';
},
onHide() {
// this.showSearchList = false
// this.searchList = []

File diff suppressed because it is too large Load Diff

View File

@@ -57,7 +57,17 @@
<text class="flexbox" style="color: #5f8f7f" v-if="goBuyType == 1">
立即续费
</text>
<text class="saveBtn vipBtn flexbox" v-if="goBuyType == 2">
<text
class="saveBtn vipBtn flexbox"
style="
font-weight: bold;
padding-top: 6rpx;
padding-bottom: 6rpx;
background: #00d8df !important;
color: #fff;
"
v-if="goBuyType == 2 || goBuyType == 3"
>
立即升级
</text>
@@ -143,10 +153,10 @@
<view
class="not_purchased"
v-if="
(slotProps.data.isBuy != 1 &&
(vip.type == 0 || vip.type == 3)) ||
(slotProps.data.isBuy == 0 &&
(vip.type == 0 || vip.type == 2)) ||
(slotProps.data.isBuy == 1 &&
(vip.type == 0 || vip.type == 3) &&
(vip.type == 0 || vip.type == 2) &&
slotProps.data.endTime)
"
>
@@ -154,8 +164,8 @@
<text
v-if="
slotProps.data.isBuy != 1 &&
(vip.type == 0 || vip.type == 3)
slotProps.data.isBuy == 0 &&
(vip.type == 0 || vip.type == 2)
"
>未购买
</text>
@@ -163,7 +173,7 @@
<text
v-if="
slotProps.data.isBuy == 1 &&
(vip.type == 0 || vip.type == 3) &&
(vip.type == 0 || vip.type == 2) &&
slotProps.data.endTime
"
>有效期至{{ slotProps.data.endTime }}
@@ -171,8 +181,12 @@
</view>
<view class="right">
<!-- slotProps.data.type---------- 0 是免费 1 普通 2 svip -->
<u-icon
v-if="goBuyType != 1 && slotProps.data.type != 0"
v-if="
(goBuyType == 0 || goBuyType == 2) &&
slotProps.data.type != 0
"
@click="handleClickGetGoodsList(slotProps.data)"
class="editIcon"
name="shopping-cart-fill"
@@ -183,7 +197,7 @@
<text
v-if="
goBuyType != 1 &&
(goBuyType == 0 || goBuyType == 2) &&
slotProps.data.type == 0 &&
!slotProps.data.endTime
"
@@ -529,7 +543,9 @@ export default {
});
},
getUserInfo() {
console.log("111111111111111111111111111");
this.$http.post("common/user/getUserInfo").then((res) => {
console.log(res, "111111111111111111111111111");
if (res.result.userVip) {
this.vip = res.result.userVip;
} else {
@@ -540,14 +556,24 @@ export default {
switch (this.vip.type) {
case 0:
this.goBuyTitle = "购买VIP,即可免费观看吴门医述所有课程";
this.goBuyTitle = "购买VIP,即可免费观看众妙之门所有课程";
this.goBuyType = 0;
break;
case 1 || 2:
case 1:
var vipName = "";
if (this.vip.type == 1) {
vipName = "超级VIP";
}
//超级VIP
this.goBuyTitle = `尊贵的${vipName},您的有效期到 ${
this.vip.endTime && this.vip.endTime.split(" ")[0]
}`;
this.goBuyType = 1;
break;
case 2:
var vipName = "";
if (this.vip.type == 2) {
vipName = "吴门医述VIP";
}
@@ -555,7 +581,7 @@ export default {
this.goBuyTitle = `尊贵的${vipName},您的有效期到 ${
this.vip.endTime && this.vip.endTime.split(" ")[0]
}`;
this.goBuyType = 1;
this.goBuyType = 2;
break;
case 3:
@@ -563,7 +589,7 @@ export default {
this.goBuyTitle =
"尊贵的众妙之门VIP,升级至超级VIP,即可免费观看吴门医述所有课程";
this.goBuyType = 2;
this.goBuyType = 3;
break;
}
});
@@ -753,7 +779,8 @@ export default {
if (
this.cateList[this.currentCateIndex].isBuy == 1 ||
v.isAudition == 1 ||
this.vip.type != "0"
this.vip.type == "1" ||
this.vip.type == "3"
) {
uni.navigateTo({
// url: '../bookShop/commodityDetail?id=' + item.id

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,13 @@
</view>
<!-- </uni-section> -->
<!-- <uni-section class="mb-10" titleFontSize="18px" title="内容" type="line"> -->
<view class="item" v-html="prescriptDetail.content"> </view>
<rich-text
v-if="prescriptDetail.content"
class="item"
:nodes="formatRichText(prescriptDetail.content)"
></rich-text>
<!-- </uni-section> -->
<!-- <view class="item" v-html="prescriptDetail.content">
</view> -->
@@ -35,6 +41,7 @@ import $http from "@/config/requestConfig.js";
export default {
data() {
return {
options: {},
playData: {},
prescriptDetail: {
images: [],
@@ -46,13 +53,49 @@ export default {
duration: 500,
};
},
onLoad(e) {
this.id = e.id;
onLoad(options) {
this.id = options.id;
this.options = options;
},
onShow() {
this.getDetail();
},
methods: {
formatRichText(html) {
//控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
match = match
.replace(/style="[^"]+"/gi, "")
.replace(/style='[^']+'/gi, "");
match = match
.replace(/width="[^"]+"/gi, "")
.replace(/width='[^']+'/gi, "");
match = match
.replace(/height="[^"]+"/gi, "")
.replace(/height='[^']+'/gi, "");
return match;
});
newContent = newContent.replace(
/style="[^"]+"/gi,
function (match, capture) {
match = match
.replace(/width:[^;]+;/gi, "max-width:100%;")
.replace(/width:[^;]+;/gi, "max-width:100%;");
return match;
}
);
// newContent = newContent.replace(/<img[^>]*>/gi, function(match, capture) {
// match = match.replace(/<img[^>]*>/gi, "@click='1111'").replace(/<img[^>]*>/gi, "@click='1111'");
// return match;
// });
newContent = newContent.replace(/<br[^>]*\/>/gi, "");
newContent = newContent.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"'
);
return newContent;
},
// 放大图片
previewImage(url) {
console.log(url);
@@ -70,12 +113,20 @@ export default {
getDetail() {
$http
.request({
url: "common/message/getMessageById?id=" + this.id,
url:
this.options.type == "taihu"
? "common/taihuWelfare/getTaihuWelfareArticleDetail"
: "common/message/getMessageById?id=" + this.id,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
// loadAnimate: 'none', // 请求加载动画
// 'prescriptId': this.prescriptId
},
data:
this.options.type == "taihu"
? {
id: this.options.id,
}
: {
// loadAnimate: 'none', // 请求加载动画
// 'prescriptId': this.prescriptId
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
@@ -89,10 +140,12 @@ export default {
this.prescriptDetail.content &&
this.prescriptDetail.contentType == 1
) {
this.prescriptDetail.content = res.result.content.replace(
/<img/g,
'<img style="max-width: 100%;"'
);
this.prescriptDetail.content = res.result.content;
//.replace(
// /<img/g,
// '<img style="max-width: 100%;"'
// );
}
// if (this.prescriptDetail.image) {
// this.prescriptDetail.images = this.prescriptDetail.image.split(';');

File diff suppressed because it is too large Load Diff

View File

@@ -180,6 +180,7 @@
</template>
<script>
import debounce from "@/common/debounce.js";
import courseDescription from "@/pages/component/commonComponents/list";
import { setPay, setPayAssign, setWXPay } from "@/config/utils";
import $http from "@/config/requestConfig.js";
@@ -529,180 +530,179 @@ export default {
}
},
async goBuyJie() {
var that = this;
// if (this.addressList.length == 0) {
// this.dizhiShow = true // 如果没有地址信息
// }
// if (!this.nowClick) {
// return
// }
this.nowClick = false;
setTimeout(() => {
this.nowClick = true;
}, 5000);
// let youPre = {
// id: "",
// coupons: {
// amount: 0,
// name: "",
// },
// };
// if (this.youhuiContent.id != undefined) {
// youPre = this.youhuiContent;
// }
let xiaBiao = [];
// for (let i = 0; i < this.cartList.length; i++) {
// xiaBiao.push({
// productId: this.cartList[i].productId,
// quantity: this.cartList[i].productAmount,
// });
// }
debounce(async () => {
var that = this;
// if (this.addressList.length == 0) {
// this.dizhiShow = true // 如果没有地址信息
// }
// if (!this.nowClick) {
// return
// }
this.nowClick = false;
setTimeout(() => {
this.nowClick = true;
}, 5000);
// let youPre = {
// id: "",
// coupons: {
// amount: 0,
// name: "",
// },
// };
// if (this.youhuiContent.id != undefined) {
// youPre = this.youhuiContent;
// }
let xiaBiao = [];
// for (let i = 0; i < this.cartList.length; i++) {
// xiaBiao.push({
// productId: this.cartList[i].productId,
// quantity: this.cartList[i].productAmount,
// });
// }
let data = {
paymentMethod: this.payType, //1微信2支付宝3苹果支付4虚拟币
orderMoney: this.dataInfo.lastFee, //订单金额
realMoney: this.dataInfo.lastFee, //实际金额
shippingMoney: 0, //运费
jfDeduction: 0, //积分抵扣
vipBuyConfigId: this.dataInfo.id,
come: 1, //订单来源0疯子读书1国学众妙之门2医学吴门医述
let data = {
paymentMethod: this.payType, //1微信2支付宝3苹果支付4虚拟币
orderMoney: this.dataInfo.lastFee, //订单金额
realMoney: this.dataInfo.lastFee, //实际金额
shippingMoney: 0, //运费
jfDeduction: 0, //积分抵扣
vipBuyConfigId: this.dataInfo.id,
come: 1, //订单来源0疯子读书1国学众妙之门2医学吴门医述
// appName: "zmzm",
};
// appName: "zmzm",
};
console.log("data at line 477:", data);
console.log("data at line 477:", data);
await $http
.request({
// url: "book/buyOrder/buySave",
url: that.urlList.buyOrder,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log("res at line 598111111111111:", res);
if (res.code == 0) {
if (res.orderSn == null) {
uni.showToast({
title: "失败,请重新下单",
icon: "none",
image: "../../../static/icon/ic_close.png",
});
} else {
console.log("that.payType at line 607:", that.payType);
if (that.payType == 2) {
// 常规支付
await $http
.request({
// url: "book/buyOrder/buySave",
url: that.urlList.buyOrder,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log("res at line 598111111111111:", res);
if (res.code == 0) {
if (res.orderSn == null) {
uni.showToast({
title: "正在支付",
icon: "loading",
title: "失败,请重新下单",
icon: "none",
image: "../../../static/icon/ic_close.png",
});
await setPay(
{
typePay: "alipay",
subject: "order",
} else {
console.log("that.payType at line 607:", that.payType);
if (that.payType == 2) {
// 常规支付
uni.showToast({
title: "正在支付",
icon: "loading",
});
await setPay(
{
typePay: "alipay",
subject: "vip",
totalAmount: res.money,
type: 2,
relevanceoid: res.orderSn,
customerId: that.userInfo.id,
},
(res) => {
uni.showLoading({
title: "加载中",
});
console.log(res, "支付支付");
if (res.success) {
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.setStorageSync("orderStatus", 0);
uni.switchTab({
url: "/pages/bookShop/orderList?type=order",
success: function (res) {},
});
}, 1000);
} else {
console.log("失败失败失败");
// that.$commonJS.showToast('支付是失败')
setTimeout(() => {
console.log("延迟调用 失败提示");
uni.showToast({
title: "支付失败",
image: "../../../static/icon/ic_close.png",
});
}, 0);
// setTimeout(() => {
// uni.navigateTo({
// url: './orderList'
// });
// }, 1000)
}
}
);
} else if (this.payType == 1) {
// 微信支付
let data1 = {
orderSn: res.orderSn,
buyOrderId: null,
totalAmount: res.money,
type: 2,
relevanceoid: res.orderSn,
customerId: that.userInfo.id,
},
(res) => {
uni.showLoading({
title: "加载中",
});
console.log(res, "支付支付");
};
setWXPay(data1, (res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
setTimeout(() => {uni.setStorageSync("orderStatus", 0);
setTimeout(() => {
uni.setStorageSync("orderStatus", 0);
uni.switchTab({
url: "/pages/bookShop/orderList?type=order",
success: function (res) {
},
success: function (res) {},
});
}, 1000);
} else {
console.log("失败失败失败");
// that.$commonJS.showToast('支付是失败')
setTimeout(() => {
console.log("延迟调用 失败提示");
console.log(res, "微信支付111111111111111");
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "支付失败",
title: "用户取消支付",
icon: "none",
image: "../../../static/icon/ic_close.png",
});
}, 0);
// setTimeout(() => {
// uni.navigateTo({
// url: './orderList'
// });
// }, 1000)
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: "../../../static/icon/ic_close.png",
});
}
}
}
);
} else if (this.payType == 1) {
// 微信支付
let data1 = {
orderSn: res.orderSn,
buyOrderId: null,
totalAmount: res.money,
};
setWXPay(data1, (res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
setTimeout(() => { uni.setStorageSync("orderStatus", 0);
uni.switchTab({
url: "/pages/bookShop/orderList?type=order",
success: function (res) {
},
});
}, 1000);
} else {
console.log(res, "微信支付111111111111111");
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "用户取消支付",
icon: "none",
image: "../../../static/icon/ic_close.png",
});
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: "../../../static/icon/ic_close.png",
});
}
}
});
} else if (this.payType == 4) {
// 天医币支付
uni.showToast({
title: "购买成功",
icon: "success",
});
setTimeout(() => { uni.setStorageSync("orderStatus", 0);
uni.switchTab({
url: "/pages/bookShop/orderList?type=order",
success: function (res) {
},
});
}, 1000);
} else if (this.payType == 4) {
// 天医币支付
uni.showToast({
title: "购买成功",
icon: "success",
});
setTimeout(() => {
uni.setStorageSync("orderStatus", 0);
uni.switchTab({
url: "/pages/bookShop/orderList?type=order",
success: function (res) {},
});
}, 1000);
}
}
}
}
});
});
}, 200);
},
radioChange(index) {
@@ -1288,11 +1288,13 @@ export default {
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.pay_title {
text-align: center;
font-size: 32rpx;
margin-bottom: 40rpx;
}
.order_box {
padding: 20rpx;
@@ -1822,6 +1824,7 @@ export default {
.bgGrey {
// background-color: #f5f5f5;
}
.pay_info {
margin-bottom: 60rpx;
display: flex;