美化了样式3.0
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { baseUrl, globalImgUrl } from "../../../request";
|
||||
const { notLogin } = require('../../../utils/util')
|
||||
import { decodeBase64 } from "../../../utils/decodebase64";
|
||||
|
||||
// pages/course/createCourseOrder/createCourseOrder.js
|
||||
Page({
|
||||
@ -13,21 +14,7 @@ Page({
|
||||
globalImgUrl, // 全局图片
|
||||
isMaskVisible: false,
|
||||
isNoticeVisible: true,
|
||||
noticeHtml: `
|
||||
<h3>一、购买与使用</h3>
|
||||
<p>1)购买后请在 <strong>「我的订单」</strong> 中查看并进入课程学习;</p>
|
||||
<p>2)课程为虚拟内容服务,一经购买概不支持无理由退款;</p>
|
||||
|
||||
<h3>二、账号与权益</h3>
|
||||
<p>1)课程仅限购买账号本人使用,不可转借、分享或用于商业用途;</p>
|
||||
<p>2)如发现恶意盗链、传播等行为,我们有权封禁账号并追究法律责任。</p>
|
||||
|
||||
<h3>三、发票与售后</h3>
|
||||
<p>如需发票或遇到问题,请在课程详情页联系客服。</p>
|
||||
|
||||
<h3>四、其他</h3>
|
||||
<p>购买即视为同意本须知及平台服务协议。</p>
|
||||
`,
|
||||
noticeHtml: '',
|
||||
},
|
||||
|
||||
// 打开/关闭弹窗
|
||||
@ -164,6 +151,27 @@ noop() {},
|
||||
} else {
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.showToast({ title: '网络错误', icon: 'none' });
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getCourseDesc() {
|
||||
wx.request({
|
||||
url: baseUrl + '/userInfo/query/courseDesc',
|
||||
method: 'POST',
|
||||
success: res => {
|
||||
console.log('====>购买须知', res.data)
|
||||
if (res.data.code === 1) {
|
||||
this.setData({noticeHtml: decodeBase64(res.data.data)})
|
||||
} else {
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.showToast({ title: '网络错误', icon: 'none' });
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -177,6 +185,7 @@ noop() {},
|
||||
courseId: options.id,
|
||||
})
|
||||
this.getCourseDetail()
|
||||
this.getCourseDesc()
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -250,6 +250,9 @@
|
||||
max-height: 48vh;
|
||||
padding: 8rpx 32rpx 24rpx;
|
||||
}
|
||||
rich-text {
|
||||
padding-bottom: 32rpx;
|
||||
}
|
||||
|
||||
/* 富文本默认样式优化 */
|
||||
.modal-body rich-text {
|
||||
@ -308,3 +311,10 @@
|
||||
.notice-icon:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
@ -6,14 +6,8 @@ const { notLogin } = require('../../../utils/util')
|
||||
Page({
|
||||
|
||||
data: {
|
||||
// 初始时置空,待接口返回后再渲染
|
||||
banners: [
|
||||
'./image/banner.png',
|
||||
'./image/banner.png',
|
||||
'./image/banner.png',
|
||||
'./image/banner.png'
|
||||
],
|
||||
courseList: [],
|
||||
bannerList: [],
|
||||
globalImgUrl
|
||||
},
|
||||
|
||||
@ -70,10 +64,37 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
getBannerList() {
|
||||
const token = wx.getStorageSync('token')
|
||||
wx.request({
|
||||
url: baseUrl + '/banner/mini/list',
|
||||
method: 'GET',
|
||||
header: {
|
||||
'Authorization': token
|
||||
},
|
||||
success: res => {
|
||||
if (res.data.code === 1) {
|
||||
this.setData({
|
||||
bannerList: res.data.data
|
||||
});
|
||||
} else {
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.showToast({
|
||||
title: '网络异常,请稍后重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
onLoad() {
|
||||
this.getBannerList()
|
||||
this.getCourseList()
|
||||
},
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
</view>
|
||||
|
||||
<swiper class="swiper" autoplay="true" interval="3000" circular="true" indicator-dots="true" indicator-active-color="#ff6a00">
|
||||
<block wx:for="{{banners}}" wx:for-item="img" wx:key="index">
|
||||
<block wx:for="{{bannerList}}" wx:for-item="img" wx:key="index">
|
||||
<swiper-item>
|
||||
<image src="{{img}}" class="swiper-image" mode="aspectFill" lazy-load="true"/>
|
||||
<image src="{{globalImgUrl + img}}" class="swiper-image" mode="aspectFill" lazy-load="true"/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
|
Reference in New Issue
Block a user