20240517
This commit is contained in:
@@ -45,6 +45,8 @@
|
||||
class="miaoShaContent"
|
||||
icon=""
|
||||
direction="column"
|
||||
label="title"
|
||||
@click="goNotice"
|
||||
>
|
||||
</u-notice-bar>
|
||||
<!-- <view class="miaoShaContent" style="width: 100%;">
|
||||
@@ -76,14 +78,14 @@
|
||||
></image>
|
||||
</view>
|
||||
|
||||
<view class="flash_sale_content">
|
||||
<view class="flash_sale_content" v-if="">
|
||||
<scroll-view scroll-x="true" class="scroll-X" style="">
|
||||
<view
|
||||
class="scroll-view-item flash_sale_content_item"
|
||||
@click="goGoodsDetail(v)"
|
||||
v-for="(v, i) in seckillLst"
|
||||
>
|
||||
<image class="book_image" :src="v.imgUrl" mode="aspectFit">
|
||||
<image class="book_image" :src="v.productImages" mode="aspectFit">
|
||||
</image>
|
||||
<view class="book_name">{{ v.productName }}</view>
|
||||
</view>
|
||||
@@ -107,7 +109,7 @@
|
||||
<scroll-view scroll-x="true" class="scroll-X" style="">
|
||||
<!-- studyList -->
|
||||
<common-curriculum-list
|
||||
imgUrl="url"
|
||||
imgUrl="image"
|
||||
:isScroll="true"
|
||||
:isCondition="true"
|
||||
:dataList="studyList"
|
||||
@@ -146,7 +148,7 @@
|
||||
<view class="flash_sale_content greenCardBoxContent">
|
||||
<scroll-view scroll-x="true" class="scroll-X" style="">
|
||||
<common-curriculum-list
|
||||
imgUrl="url"
|
||||
imgUrl="image"
|
||||
:isCondition="true"
|
||||
:dataList="flashSaleList"
|
||||
@hancleClick="goCourseDescription"
|
||||
@@ -163,6 +165,14 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="learning_box listening_box bottomBox">
|
||||
<view class="item_img" @click="handleGoApp">
|
||||
<image src="@/static/tab/bottom1.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="item_img">
|
||||
<image src="@/static/tab/bg.png" mode="aspectFill"></image
|
||||
></view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -174,7 +184,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
noticeList: [], //秒杀列表
|
||||
seckillList: [], //秒杀列表
|
||||
seckillLst: [], //秒杀列表
|
||||
|
||||
studyList: [], //正在学习
|
||||
dataInfo: {},
|
||||
flashSaleList: [], //试听
|
||||
@@ -242,13 +253,15 @@ export default {
|
||||
],
|
||||
curriculumList: [
|
||||
{
|
||||
name: "课程价格",
|
||||
url: "/pages/courseInformation/index/index",
|
||||
name: "课程设置",
|
||||
// url: "/pages/courseInformation/index/index",
|
||||
url: "",
|
||||
imgUrl: require("@/static/icon/homePage/kcjg.png"),
|
||||
},
|
||||
{
|
||||
name: "我的课程",
|
||||
url: "/pages/curriculum/order/index/index",
|
||||
// url: "",
|
||||
imgUrl: require("@/static/icon/homePage/wdkc.png"),
|
||||
},
|
||||
{
|
||||
@@ -264,38 +277,97 @@ export default {
|
||||
getUserLateCourseList: "sociology/course/getUserLateCourseList",
|
||||
getMarketProductList: "sociology/product/getMarketProductList", //秒杀商品
|
||||
getMarketCourseList: "sociology/course/getMarketCourseList", //精彩试听
|
||||
getNotice: "common/message/listByPage", //消息
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
this.getData();
|
||||
this.getSociologyLabels();
|
||||
this.getMarketProductList();
|
||||
this.getMarketCourseList();
|
||||
onReady() {},
|
||||
onLoad() { },
|
||||
async onShow() {
|
||||
|
||||
console.log('at line 287:', this.userInfo )
|
||||
this.requestAll();
|
||||
},
|
||||
async onTabItemTap() {
|
||||
this.requestAll();
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
|
||||
methods: {
|
||||
...mapMutations(["setUserInfo"]),
|
||||
requestAll() {
|
||||
// 获取当前页面的栈
|
||||
this.$nextTick(async () => {
|
||||
await this.getData();
|
||||
await this.getSociologyLabels();
|
||||
await this.getMarketProductList();
|
||||
await this.getMarketCourseList();
|
||||
await this.getNotice();
|
||||
});
|
||||
},
|
||||
goNotice(index) {
|
||||
console.log("at line 297:", this.noticeList[index]);
|
||||
// var mynavData = JSON.stringify({
|
||||
// ...this.noticeList[index],
|
||||
// navTitle: this.noticeList[index].title,
|
||||
// title: this.noticeList[index].title,
|
||||
// }); // 这里转换成 字符串
|
||||
uni.navigateTo({
|
||||
url: `/pages/homePage/index/noticeDetail?id=${this.noticeList[index].id}`,
|
||||
});
|
||||
},
|
||||
handleGoApp() {
|
||||
if (plus.os.name == "Android") {
|
||||
plus.runtime.launchApplication(
|
||||
{
|
||||
pname: "com.taobao.taobao",
|
||||
},
|
||||
function (e) {
|
||||
console.log("Open system default browser failed: " + e.message);
|
||||
}
|
||||
);
|
||||
} else if (plus.os.name == "iOS") {
|
||||
plus.runtime.launchApplication({ action: "taobao://" }, function (e) {
|
||||
console.log("Open system default browser failed: " + e.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
async getData() {
|
||||
var that = this;
|
||||
|
||||
this.$http.post(this.urlList.getUserLateCourseList).then(async (res) => {
|
||||
console.log(res, "7777777777777777777");
|
||||
|
||||
// that.seckillLst = res.obj.seckillLst ? res.obj.seckillLst : [];
|
||||
that.studyList = res.page ? res.page : [];
|
||||
// that.flashSaleList = res.obj.testList ? res.obj.testList : [];
|
||||
// that.miaoShaContent = res.obj.seckillTime ? res.obj.seckillTime : "";
|
||||
// that.noticeList = res.obj.adLst ? res.obj.adLst : [];
|
||||
|
||||
// await that.handleselectCate({ ...this.cateList[0], index: 0 })
|
||||
|
||||
// socket.init();
|
||||
if (res.code == 0) {
|
||||
that.studyList = res.page ? res.page : [];
|
||||
}
|
||||
});
|
||||
},
|
||||
async getNotice() {
|
||||
var that = this;
|
||||
var data = {
|
||||
isBook: 0, //是否是疯子读书
|
||||
isMedical: 0, //是否是吴门医述
|
||||
isSociology: 1, //是否是众妙之门
|
||||
};
|
||||
this.$http
|
||||
.request({
|
||||
url: this.urlList.getNotice,
|
||||
method: "POST",
|
||||
data: data,
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
console.log(res, "7777777777777777777");
|
||||
|
||||
var result = res.messages;
|
||||
|
||||
console.log("result at line 332:", result);
|
||||
that.noticeList = res.messages ? result : [];
|
||||
});
|
||||
},
|
||||
async getMarketProductList() {
|
||||
var that = this;
|
||||
this.$http
|
||||
@@ -304,29 +376,20 @@ export default {
|
||||
method: "POST",
|
||||
data: {
|
||||
id: 1, //这个需要后台提供数值,比如秒杀商品
|
||||
limit: 10,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
page: 1,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
.then(async (res) => {
|
||||
console.log(res, "999");
|
||||
|
||||
// that.seckillLst = res.obj.seckillLst ? res.obj.seckillLst : [];
|
||||
// that.studyList = res.page ? res.page : [];
|
||||
that.seckillLst = res.products.records ? res.products.records : [];
|
||||
that.$forceUpdate()
|
||||
// that.flashSaleList = res.products.records ? res.products.records : [];
|
||||
// that.miaoShaContent = res.products.seckillTime ? res.obj.seckillTime : "";
|
||||
// that.noticeList = res.obj.adLst ? res.obj.adLst : [];
|
||||
|
||||
// await that.handleselectCate({ ...this.cateList[0], index: 0 })
|
||||
|
||||
// socket.init();
|
||||
that.seckillLst = res.products.records ? res.products.records : [];
|
||||
that.$forceUpdate();
|
||||
});
|
||||
},
|
||||
async getMarketCourseList() {
|
||||
@@ -337,28 +400,22 @@ export default {
|
||||
url: this.urlList.getMarketCourseList,
|
||||
method: "POST",
|
||||
data: {
|
||||
id: 1, //这个需要后台提供数值,比如秒杀商品
|
||||
limit: 10,
|
||||
page: 1,
|
||||
id: 14, //这个需要后台提供数值,比如秒杀商品
|
||||
limit: 10,
|
||||
page: 1,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
.then(async (res) => {
|
||||
console.log(res, "7777777777777777777");
|
||||
|
||||
// that.seckillLst = res.obj.seckillLst ? res.obj.seckillLst : [];
|
||||
// that.studyList = res.page ? res.page : [];
|
||||
that.flashSaleList = res.courseList.records ? res.courseList.records : [];
|
||||
// that.miaoShaContent = res.obj.seckillTime ? res.obj.seckillTime : "";
|
||||
// that.noticeList = res.obj.adLst ? res.obj.adLst : [];
|
||||
|
||||
// await that.handleselectCate({ ...this.cateList[0], index: 0 })
|
||||
|
||||
// socket.init();
|
||||
that.flashSaleList = res.courseList.records
|
||||
? res.courseList.records
|
||||
: [];
|
||||
});
|
||||
},
|
||||
async getSociologyLabels() {
|
||||
@@ -386,16 +443,6 @@ export default {
|
||||
});
|
||||
that.$forceUpdate();
|
||||
console.log("this.cateList at line 314:", this.cateList);
|
||||
|
||||
// that.seckillLst = res.obj.seckillLst ? res.obj.seckillLst : [];
|
||||
// that.studyList = res.obj.studyList ? res.obj.studyList : [];
|
||||
// that.flashSaleList = res.obj.testList ? res.obj.testList : [];
|
||||
// that.miaoShaContent = res.obj.seckillTime ? res.obj.seckillTime : "";
|
||||
// that.noticeList = res.obj.adLst ? res.obj.adLst : [];
|
||||
|
||||
// await that.handleselectCate({ ...this.cateList[0], index: 0 })
|
||||
|
||||
// socket.init();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -403,22 +450,26 @@ export default {
|
||||
console.log(v);
|
||||
uni.navigateTo({
|
||||
// url: '../bookShop/commodityDetail?id=' + item.id
|
||||
url: `/pages/curriculum/order/curriculum/index?navTitle=${v.title}&title=${v.title}&oid=${v.oid}`,
|
||||
url: `/pages/curriculum/order/curriculum/index?navTitle=${v.title}&title=${v.title}&id=${v.id}`,
|
||||
});
|
||||
},
|
||||
goGoodsDetail(v) {
|
||||
console.log(v);
|
||||
uni.navigateTo({
|
||||
// url: '../bookShop/commodityDetail?id=' + item.id
|
||||
url: `/pages/goods/index/index?navTitle=${v.title}&isMiaosha=1&title=${v.title}&oid=89d8c57b804b4c71b344344f7c635ced`,
|
||||
url: `/pages/goods/index/index?navTitle=${v.title}&isMiaosha=1&title=${v.title}&id=${v.productId}`,
|
||||
});
|
||||
},
|
||||
|
||||
handleClickCurriculum(v) {
|
||||
console.log(v);
|
||||
uni.navigateTo({
|
||||
url: v.url,
|
||||
});
|
||||
if (v.url) {
|
||||
uni.navigateTo({
|
||||
url: v.url,
|
||||
});
|
||||
} else {
|
||||
this.$commonJS.showToast("此功能暂未开放");
|
||||
}
|
||||
},
|
||||
handleClickCate(v) {
|
||||
console.log(v);
|
||||
@@ -515,7 +566,7 @@ function calcTimer(timer) {
|
||||
margin-top: -10rpx;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-weight: bold;
|
||||
font-size: 25rpx;
|
||||
font-size: 30rpx;
|
||||
color: #001b73;
|
||||
margin-left: 21rpx;
|
||||
// line-height: 46rpx;
|
||||
@@ -603,7 +654,7 @@ function calcTimer(timer) {
|
||||
width: calc(100% - 172rpx);
|
||||
margin-top: 1rpx;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-weight: 600;
|
||||
font-size: 21rpx;
|
||||
color: #018f89;
|
||||
// line-height: 45rpx;
|
||||
@@ -629,17 +680,20 @@ function calcTimer(timer) {
|
||||
width: 165rpx;
|
||||
height: 192rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #f0f0f0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.book_name {
|
||||
font-family: MicrosoftYaHei;
|
||||
font-weight: 400;
|
||||
font-size: 23rpx;
|
||||
line-height: 23rpx;
|
||||
font-weight: 600;
|
||||
font-size: 30rpx;
|
||||
line-height: 30rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
margin-top: 18rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -670,7 +724,7 @@ function calcTimer(timer) {
|
||||
|
||||
.name {
|
||||
font-family: MicrosoftYaHei;
|
||||
font-weight: 400;
|
||||
font-weight: 600;
|
||||
font-size: 21rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
@@ -702,7 +756,7 @@ function calcTimer(timer) {
|
||||
|
||||
.book_name {
|
||||
font-family: MicrosoftYaHei;
|
||||
font-weight: 400;
|
||||
font-weight: 600;
|
||||
font-size: 23rpx;
|
||||
color: #000000;
|
||||
line-height: 23rpx;
|
||||
@@ -718,8 +772,8 @@ function calcTimer(timer) {
|
||||
border-radius: 7rpx;
|
||||
|
||||
font-family: MicrosoftYaHei;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx;
|
||||
font-weight: 600;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
line-height: 37rpx;
|
||||
text-align: center;
|
||||
@@ -748,7 +802,7 @@ function calcTimer(timer) {
|
||||
|
||||
.name {
|
||||
font-family: MicrosoftYaHei;
|
||||
font-weight: 400;
|
||||
font-weight: 600;
|
||||
font-size: 21rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
@@ -777,4 +831,19 @@ function calcTimer(timer) {
|
||||
.u-notice-bar {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.bottomBox {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.item_img {
|
||||
width: 48% !important;
|
||||
height: 100%;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
177
pages/homePage/index/noticeDetail.vue
Normal file
177
pages/homePage/index/noticeDetail.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<z-nav-bar :title="prescriptDetail.title" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar>
|
||||
<view
|
||||
class="contentBox"
|
||||
v-if="prescriptDetail.content && prescriptDetail.type == 0"
|
||||
>
|
||||
<view class="content">
|
||||
<!-- <uni-section class="mb-10" titleFontSize="18px" title="标题" type="line"> -->
|
||||
<view class="item title-center">
|
||||
{{ prescriptDetail.title }}
|
||||
</view>
|
||||
<!-- </uni-section> -->
|
||||
<!-- <uni-section class="mb-10" titleFontSize="18px" title="内容" type="line"> -->
|
||||
<view class="item" v-html="prescriptDetail.content"> </view>
|
||||
<!-- </uni-section> -->
|
||||
<!-- <view class="item" v-html="prescriptDetail.content">
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="fullscreen-webview" v-else>
|
||||
<web-view :src="prescriptDetail.url"> </web-view>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from "@/components/music.vue";
|
||||
import $http from "@/config/requestConfig.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData: {},
|
||||
prescriptDetail: {
|
||||
images: [],
|
||||
},
|
||||
id: null,
|
||||
indicatorDots: true,
|
||||
autoplay: true,
|
||||
interval: 5000,
|
||||
duration: 500,
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.id = e.id;
|
||||
},
|
||||
onShow() {
|
||||
this.getDetail();
|
||||
},
|
||||
methods: {
|
||||
// 放大图片
|
||||
previewImage(url) {
|
||||
console.log(url);
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
longPressActions: {
|
||||
itemList: ["很抱歉,暂不支持保存图片到本地"],
|
||||
success: function (res) {
|
||||
// console.log(res,'+++++')
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
// 方剂详情
|
||||
getDetail() {
|
||||
$http
|
||||
.request({
|
||||
url: "common/message/getMessageById?id=" + this.id,
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
// loadAnimate: 'none', // 请求加载动画
|
||||
// 'prescriptId': this.prescriptId
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, "内容获取成功");
|
||||
if (res.code == 0) {
|
||||
this.prescriptDetail = res.result;
|
||||
if (
|
||||
this.prescriptDetail.content &&
|
||||
this.prescriptDetail.contentType == 1
|
||||
) {
|
||||
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(';');
|
||||
// }
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
// this.titleList = []
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
},
|
||||
components: {
|
||||
musicPlay,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contentBox {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.contentBoxwebwiew {
|
||||
height: 100%;
|
||||
// .webwiew{
|
||||
// height: 100%;
|
||||
// }
|
||||
}
|
||||
.fullscreen-webview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.mb-10 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
image {
|
||||
margin: 0 auto;
|
||||
height: 250rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.uni-margin-wrap {
|
||||
margin-bottom: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 10rpx;
|
||||
|
||||
// background-color: #fff;
|
||||
.item {
|
||||
// color: #666;
|
||||
padding: 10rpx 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
.title-center {
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/deep/ .uni-section-header__decoration.line {
|
||||
background-color: #18bc37;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user