commit a17124d2755c1c0f95d422f17ac1c9246342cc05 Author: GL <954534408@qq.com> Date: Tue Jun 15 18:49:00 2021 +0800 【TT小程序1.0.2版本上线】 diff --git a/app.js b/app.js new file mode 100644 index 0000000..beebddf --- /dev/null +++ b/app.js @@ -0,0 +1,64 @@ + const Http = require("./utils/HttpBasics.js") + const config = require("./config/config.js"); +App({ + data:{ + + }, + globalData:{ + token: null, + imgHttps: 'https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/', + platform:null,//手机型号 + }, + onLaunch: function () { + let that = this + this.logn(); + try { + var res = tt.getSystemInfoSync(); + that.statusBarHeight = res.statusBarHeight + console.log(`手机型号为 ${res.platform}`); + this.globalData.platform = res.platform + } catch (error) { + console.log(`获取系统信息失败`); + } + }, + statusBarHeight: 0, + logn(){ + tt.login({ + success:(res=>{ + let {code} = res + Http.post({ + url:config.api.login, + data:{ + code:code, + appId:'tt9da4eb19029c2bb301' + } + }).then(res=>{ + Http.setToken(res.data.token); + this.globalData.token = res.data.token + if (this.tokenCallback) { + this.tokenCallback(res.data.token); + } + }).catch(err=>{ + console.log(err); + tt.showModal({ + title: '提示', + showCancel: false, + content: '登录失败,请重新尝试', + success: (res) => { + if (res.cancel) { + //点击取消,默认隐藏弹框 + } else { + //点击确定 + wx.reLaunch({ + url: '/pages/index/index', + }) + } + } + }); + }) + + }), + + }); + } +}) diff --git a/app.json b/app.json new file mode 100644 index 0000000..bdde7c6 --- /dev/null +++ b/app.json @@ -0,0 +1,56 @@ +{ + "pages":[ + "pages/index/index", + "pages/category/category", + "pages/ranking/ranking", + "pages/search/search", + "pages/user/user", + "pages/course/course", + "pages/sponsor/sponsor", + "pages/order/order", + "pages/classDetails/classDetails", + "pages/mianAttention/mianAttention", + "pages/mianCollect/mianCollect", + "pages/UpHome/UpHome", + "pages/publicity/publicity", + "pages/upEnter/upEnter" + ], + "usingComponents": {}, + "window":{ + "backgroundTextStyle":"light", + "navigationBarBackgroundColor": "#000033", + "navigationBarTitleText": "知播堂", + "navigationBarTextStyle":"#fff", + "navigationStyle":"custom" + + }, + "tabBar": { + "custom": true, + "color": "#90A3AC", + "selectedColor": "#07E881", + "backgroundColor": "#171C2A", + "borderStyle": "black", + "list": [ + { + "pagePath": "pages/index/index", + "text": "首页", + "iconPath": "assets/images/home_btn_ic_sy.png", + "selectedIconPath": "assets/images/home_btn_ic_sy1.png" + }, + { + "pagePath": "pages/course/course", + "text": "课程", + "iconPath": "assets/images/home_btn_ic_kc.png", + "selectedIconPath": "assets/images/home_btn_ic_kc1.png" + }, + { + "pagePath": "pages/user/user", + "text": "我的", + "iconPath": "assets/images/home_btn_ic_wd.png", + "selectedIconPath": "assets/images/home_btn_ic_wd1.png" + } + ] + } + + +} diff --git a/app.ttss b/app.ttss new file mode 100644 index 0000000..b861eff --- /dev/null +++ b/app.ttss @@ -0,0 +1,16 @@ +.Box{ + width: 96%; + margin: 0 2%; + background-color: #0E1119; +} +#BoxBg{ + background-color: #0E1119; + overflow: hidden; + font-size: 28rpx; + min-height: 100vh; + + color: #535E75; +} +.oh{ + overflow: hidden; +} \ No newline at end of file diff --git a/assets/images/1.png b/assets/images/1.png new file mode 100644 index 0000000..ad0b87b Binary files /dev/null and b/assets/images/1.png differ diff --git a/assets/images/2.png b/assets/images/2.png new file mode 100644 index 0000000..ffa8663 Binary files /dev/null and b/assets/images/2.png differ diff --git a/assets/images/3.png b/assets/images/3.png new file mode 100644 index 0000000..caa961e Binary files /dev/null and b/assets/images/3.png differ diff --git a/assets/images/4.png b/assets/images/4.png new file mode 100644 index 0000000..3c5c980 Binary files /dev/null and b/assets/images/4.png differ diff --git a/assets/images/arrow-right-bold.png b/assets/images/arrow-right-bold.png new file mode 100644 index 0000000..6816d2e Binary files /dev/null and b/assets/images/arrow-right-bold.png differ diff --git a/assets/images/home_btn_ic_kc.png b/assets/images/home_btn_ic_kc.png new file mode 100644 index 0000000..9e395cc Binary files /dev/null and b/assets/images/home_btn_ic_kc.png differ diff --git a/assets/images/home_btn_ic_kc1.png b/assets/images/home_btn_ic_kc1.png new file mode 100644 index 0000000..ec36e92 Binary files /dev/null and b/assets/images/home_btn_ic_kc1.png differ diff --git a/assets/images/home_btn_ic_sy.png b/assets/images/home_btn_ic_sy.png new file mode 100644 index 0000000..aa448c0 Binary files /dev/null and b/assets/images/home_btn_ic_sy.png differ diff --git a/assets/images/home_btn_ic_sy1.png b/assets/images/home_btn_ic_sy1.png new file mode 100644 index 0000000..a98bb9f Binary files /dev/null and b/assets/images/home_btn_ic_sy1.png differ diff --git a/assets/images/home_btn_ic_wd.png b/assets/images/home_btn_ic_wd.png new file mode 100644 index 0000000..62bd8bd Binary files /dev/null and b/assets/images/home_btn_ic_wd.png differ diff --git a/assets/images/home_btn_ic_wd1.png b/assets/images/home_btn_ic_wd1.png new file mode 100644 index 0000000..6fab367 Binary files /dev/null and b/assets/images/home_btn_ic_wd1.png differ diff --git a/components/custom-tab-bar/index.js b/components/custom-tab-bar/index.js new file mode 100644 index 0000000..57f8368 --- /dev/null +++ b/components/custom-tab-bar/index.js @@ -0,0 +1,62 @@ + +let app = getApp(); +Component({ + data: { + home_a_img:[], + selected: 0, + "color": "#abb1be", + "selectedColor": "#FD782D", + "list": [{ + "pagePath": "/pages/index/index", + "iconPath": "assets/images/home_btn_ic_sy.png", + "selectedIconPath": "assets/images/home_btn_ic_sy1.png", + "text": "首页" + }, + { + "pagePath": "/pages/course/course", + "iconPath": "assets/images/home_btn_ic_kc.png", + "selectedIconPath": "assets/images/home_btn_ic_kc1.png", + "text": "课程" + }, + { + "pagePath": "/pages/user/user", + "iconPath": "assets/images/home_btn_ic_wd.png", + "selectedIconPath": "assets/images/home_btn_ic_wd1.png", + "text": "我的" + }, + ] + }, + + // lifetimes: { + // attached: function () { + // // 在组件实例进入页面节点树时执行 + + // }, + // }, + attached() { + }, + methods: { + switchTab(e) { + + // this.setData({ + // list: this.data.home_a_img + // }) + // console.log(this.data.home_a_img) + + const data = e.currentTarget.dataset; + this.setData({ + selected: data.index + }) + console.log(data.index) + const url = data.path; + if (data.index == 0 || data.index == 3) { + this.getTemplateId() + } + + tt.switchTab({ + url + }); + }, + } + +}) \ No newline at end of file diff --git a/components/custom-tab-bar/index.json b/components/custom-tab-bar/index.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/components/custom-tab-bar/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/components/custom-tab-bar/index.ttml b/components/custom-tab-bar/index.ttml new file mode 100644 index 0000000..5340c7c --- /dev/null +++ b/components/custom-tab-bar/index.ttml @@ -0,0 +1,8 @@ + + + + + + {{item.text}} + + diff --git a/components/custom-tab-bar/index.ttss b/components/custom-tab-bar/index.ttss new file mode 100644 index 0000000..1bb4d4b --- /dev/null +++ b/components/custom-tab-bar/index.ttss @@ -0,0 +1,40 @@ +.tab-bar { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 70rpx; + padding: 10rpx; + background: white; + display: flex; + padding-bottom: env(safe-area-inset-bottom); + overflow: hidden; +} + +.tab-bar-border { + background-color: rgba(0, 0, 0, 0.33); + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 1px; + transform: scaleY(0.5); +} + +.tab-bar-item { + flex: 1; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.tab-bar-item image { + width: 46rpx; + height: 46rpx; +} + +.tab-bar-item view { + font-size: 20rpx; +} diff --git a/components/navbar/img/back.png b/components/navbar/img/back.png new file mode 100644 index 0000000..fd1ad06 Binary files /dev/null and b/components/navbar/img/back.png differ diff --git a/components/navbar/img/home.svg b/components/navbar/img/home.svg new file mode 100644 index 0000000..b8fe7ed --- /dev/null +++ b/components/navbar/img/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/navbar/navbar.js b/components/navbar/navbar.js new file mode 100644 index 0000000..9b7b74b --- /dev/null +++ b/components/navbar/navbar.js @@ -0,0 +1,65 @@ +const app = getApp() + +Component({ + + properties: { + background: { + type: String, + value: '#F4F5F9' + }, + color: { + type: String, + value: '#000' + }, + text: { + type: String, + value: 'Wechat' + }, + showLocationIf: { + type: Boolean, + value: false + }, + back: { + type: Boolean, + value: false + }, + home: { + type: Boolean, + value: false + } + }, + + data: { + array: ['A广场', 'B广场-北京西单'], + index: 1, + statusBarHeight: app.statusBarHeight + 'px', + navigationBarHeight: (app.statusBarHeight + 44) + 'px', + imgHttps: app.globalData.imgHttps, + }, + methods: { + backHome: function () { + wx.switchTab({ + url: '/index/index', + }) + }, + bindPickerChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + index: e.detail.value + }) + }, + back: function () { + wx.navigateBack({ + delta: 1 + }) + } + }, + attached: function(){ + let pages = getCurrentPages(); + if (pages.length <= 1) { + this.setData({ + back: false + }) + } + } +}) diff --git a/components/navbar/navbar.json b/components/navbar/navbar.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/components/navbar/navbar.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/components/navbar/navbar.ttml b/components/navbar/navbar.ttml new file mode 100644 index 0000000..c8caadc --- /dev/null +++ b/components/navbar/navbar.ttml @@ -0,0 +1,21 @@ + + + + + + + + + + + + {{text}} + + + + {{array[index]}} + + + + + \ No newline at end of file diff --git a/components/navbar/navbar.ttss b/components/navbar/navbar.ttss new file mode 100644 index 0000000..9dc93f2 --- /dev/null +++ b/components/navbar/navbar.ttss @@ -0,0 +1,91 @@ +.navbar { + width: 100vw; + background-color: #F4F5F9; + position: fixed; + left: 0; + top: 0; + overflow: hidden; + z-index: 400000000; +} + +.title-container { + height: 44px; + display: flex; + align-items: center; + position: relative; +} + +.capsule { + margin-left: 10px; + height: 32px; + /* border: 1px solid #e1e1e3; */ + border-radius: 60px; + display: flex; + align-items: center; + padding: 0 20rpx; + /* background: #fff!important; */ +} + +.capsule > view { + width: 35px; + height: 60%; + position: relative; +} + +.capsule > view:nth-child(2) { + border-left: 1px solid #777; +} + +.capsule image { + width: 70%; + height: 100%; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%); +} + +.title { + color: #000; + position: absolute; + left: 104px; + right: 104px; + font-weight: 600; + font-size: 32rpx; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +@font-face { + font-family: 'iconfont'; /* project id 1353695 */ + src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot'); + src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff2') format('woff2'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff') format('woff'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.ttf') format('truetype'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.svg#iconfont') format('svg'); +} +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-daohangdizhiweizhi:before { + content: "\e787"; +} +.locations{ + font-size: 28rpx; + display: inline-block; + width: 200rpx; + overflow: hidden; + text-overflow:ellipsis; + white-space: nowrap; +} +.pick-box{ + width: 260rpx; + padding-left: 20rpx; +} \ No newline at end of file diff --git a/components/prompt/prompt.js b/components/prompt/prompt.js new file mode 100644 index 0000000..1ee67b7 --- /dev/null +++ b/components/prompt/prompt.js @@ -0,0 +1,59 @@ +const app = getApp() +//Component Object +Component({ + properties: { + titil:{//弹框标题 + type:String, + value:'提示', + }, + text:{//弹框内容 + type:String, + value:'告知当前状态,信息和解决方法 告知当前状态', + }, + assistant:{//副操作标题 + type:String, + value:'', + }, + advocate:{//主操作标题 + type:String, + value:'', + }, + wayAdvocate:{//主操作方法 + type:Function, + }, + url:{//跳转的路径 + type:String, + }, + hidText:{//关闭提示框文案 + type:String, + value:'确认', + } + }, + data: { + + }, + methods: { + wayAssistant:function(){ + this.triggerEvent('hie',{data:false}); + }, + go:function() { + this.triggerEvent('go',{url:false}); + } + }, + created: function() { + + }, + attached: function() { + + }, + ready: function() { + console.log(this.properties.url,"666"); + }, + moved: function() { + + }, + detached: function() { + + }, +}); + \ No newline at end of file diff --git a/components/prompt/prompt.json b/components/prompt/prompt.json new file mode 100644 index 0000000..fba482a --- /dev/null +++ b/components/prompt/prompt.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/components/prompt/prompt.ttml b/components/prompt/prompt.ttml new file mode 100644 index 0000000..60ea4ad --- /dev/null +++ b/components/prompt/prompt.ttml @@ -0,0 +1,9 @@ + + {{titil}} + {{text}} + + {{assistant}} + {{advocate}} + {{hidText}} + + \ No newline at end of file diff --git a/components/prompt/prompt.ttss b/components/prompt/prompt.ttss new file mode 100644 index 0000000..d0b0806 --- /dev/null +++ b/components/prompt/prompt.ttss @@ -0,0 +1,66 @@ +.prompt{ + position: fixed; + width: 80%; + height: 300rpx; + background-color: #222633; + border-radius: 20rpx; + left: 10%; + top: 30%; + z-index: 1000000; +} +.titil{ + text-align: center; + height: 80rpx; + line-height: 80rpx; + font-size: 36rpx; + font-family: OPPOSans; + font-weight: 500; + color: #FFFFFF; + margin-top: 20rpx; +} +.text{ + width: 90%; + height: 70rpx; + overflow: hidden; + margin: 0 auto; + font-family: OPPOSans; + font-weight: 500; + color: #8790A8; + line-height: 36rpx; + text-align: center; + font-size: 32rpx; + margin-bottom: 30rpx; + margin-top: 10rpx; +} +.btnBox{ + border-top: 1rpx solid #3D4253; +} +.assistant{ + width: 49%; + float: left; + height: 90rpx; + text-align: center; + line-height: 90rpx; + color: #FFFFFF; + font-size: 36rpx; + border-right: 1rpx solid #3D4253; +} +.advocate{ + width: 49%; + float: left; + height: 90rpx; + text-align: center; + line-height: 90rpx; + color: #07E881; + font-size: 36rpx; + /* border-left: 1rpx solid #3D4253; */ +} +.back{ + width: 100%; + float: left; + height: 90rpx; + text-align: center; + line-height: 90rpx; + color: #FFFFFF; + font-size: 36rpx; +} \ No newline at end of file diff --git a/config/config.js b/config/config.js new file mode 100644 index 0000000..4ecc2cd --- /dev/null +++ b/config/config.js @@ -0,0 +1,25 @@ +let config = { + api:{ + login:"/user/login", + getColumn:"/wxBusiness/listAll",//获取分类 + columnLsit:"/ttCoupon/list",//分类列表 + classDetails:"/ttCoupon/findById",//课程详情 + getViodUrl:"/ttCoupon/videoDetial",//获取视频地址 + iscollect:"/ttCoupon/iscollect",//是否收藏 + Tcollect:"/ttCoupon/collectCoupon",//收藏 + Fcollect:"/ttCoupon/cancelCollect",//取消收藏 + order:"/order/save",//订单 + pay:"/order/createPay",//获取支付orderInfo + ifPayOk:"/order/updateOrderStatus",//判读是否支付成功 + getOrderLsit:'/order/list',//获取订单列表 + getAuthor:"/merchant/listV1",//查询作者 + checkUserInfo:"/user/checkWechatStatus",//用户是否授权 + userInfo:"/user/getUserInfo",//用户授权 + mainCollet:"/ttCoupon/collectList",//我的收藏 + getUpUser:"/merchant/findById",//up类容 + getPublicity:"/wxCampaign/list",//轮播图 + getPublicityDetail:"/wxCampaign/findById",//宣传页详情 + apply:"/upSettlein/add",//提交入住申请 + } +} +module.exports = config; \ No newline at end of file diff --git a/pages/UpHome/UpHome.js b/pages/UpHome/UpHome.js new file mode 100644 index 0000000..bd173b6 --- /dev/null +++ b/pages/UpHome/UpHome.js @@ -0,0 +1,86 @@ +const app = getApp() +const config = require("../../config/config") +const Http = require("../../utils/HttpBasics.js") +const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" +Page({ + data:{ + imgHttps:app.globalData.imgHttps, + navigationBarHeight, + id:"",//upid + name:'',//upName + indexFlog:1,//选着类别 + upData:{},//作者信息 + pageNum:1, + classList:[],//课程列表 + dNum:"",//但课程数 + zNum:"",//专栏数 + }, + getClass(){//课程list + Http.get({ + url:config.api.columnLsit, + data:{ + merchantId:this.data.id, + type:this.data.indexFlog, + pageNum:this.data.pageNum, + pageSize: 6 + } + }).then(res=>{ + if(this.data.pageNum>1){ + let temp = this.data.classList + temp.push(...res.data.list) + this.setData({ + classList:temp + }) + }else{ + this.setData({ + classList:res.data.list + }) + } + + }) + }, + setIndex(e){ + let index = e.currentTarget.dataset.index + console.log(index); + this.setData({ + indexFlog:index, + pageNum:1, + classList:[] + }) + this.getClass() + }, + getUpData(){ + Http.get({ + url:config.api.getUpUser, + data:{ + id:this.data.id + } + }).then(res=>{ + console.log(res.data); + this.setData({ + upData:res.data + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon:"none" + }); + }) + }, + onLoad(options){ + this.setData({ + id:options.id, + name:options.name + }) + this.getUpData() + this.getClass() + }, + onReachBottom() { + console.log("到底了"); + this.setData({ + pageNum:this.data.pageNum+1 + }) + this.getClass() + + } +}) \ No newline at end of file diff --git a/pages/UpHome/UpHome.json b/pages/UpHome/UpHome.json new file mode 100644 index 0000000..7d1be74 --- /dev/null +++ b/pages/UpHome/UpHome.json @@ -0,0 +1,6 @@ +{ + + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/UpHome/UpHome.ttml b/pages/UpHome/UpHome.ttml new file mode 100644 index 0000000..11bd993 --- /dev/null +++ b/pages/UpHome/UpHome.ttml @@ -0,0 +1,37 @@ + + + + + + + + {{upData.name}} + + + {{upData.introduction}} + + + 专栏 + + + + 单课程 + + + + + + + + + {{item.title}} + + + + {{item.merchantName}} + + + + + + \ No newline at end of file diff --git a/pages/UpHome/UpHome.ttss b/pages/UpHome/UpHome.ttss new file mode 100644 index 0000000..d3db634 --- /dev/null +++ b/pages/UpHome/UpHome.ttss @@ -0,0 +1,146 @@ +.Box{ + min-height: 100vh; + position: relative; +} +.backImg{ + width: 100%; + height: 400rpx; + +} +.headImg{ + position: absolute; + border: 1rpx solid #07E881; + width: 200rpx; + height: 200rpx; + border-radius: 50%; + top: 480rpx; + left: 50rpx; +} +.nameBox{ + margin-top: 180rpx; +} +.userName{ + height: 50rpx; + font-size: 40rpx; + font-family: PingFang SC; + font-weight: 800; + color: #FFFFFF; + text-align:center; + float: left; + margin-left: 20px; +} +.text{ + width: 90%; + margin: 20rpx auto; + height: 120rpx; + overflow: hidden; + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 500; + color: #666D80; + line-height: 36rpx; +} +.classifyBox{ + height: 120rpx; + background: #121620; + +} +.singleBox{ + float: left; + margin-left: 30rpx; + +} +.multiBox{ + float: left; + text-align: center; +} +.singleXian{ + width: 60rpx; + height: 2rpx; + background-color: #07E881; + margin-left: 30rpx; +} +.singleText{ + font-size: 30rpx; + font-family: OPPOSans; + font-weight: 500; + color: #97A1BD; + line-height: 35rpx; + padding: 10px 0; + margin-left: 20rpx; +} +.singleText_a{ + font-size: 30rpx; + font-family: OPPOSans; + font-weight: bold; + color: #FFFFFF; + line-height: 35rpx; + padding: 10px 0; + margin-left: 20rpx; +} +.classBox{ + margin: 20rpx; +} +.classImg{ + float: left; + width: 300rpx; + height: 200rpx; + border-radius: 12rpx; +} +.textBox{ + float: left; + margin-left: 10px; +} +.titile{ + width: 350rpx; + height: 40rpx; + line-height: 40rpx; + font-size: 36rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FEFEFE; + margin-bottom: 19rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1 +} +.cont{ + width: 360rpx; + height: 30rpx; + line-height: 30rpx; + font-size: 26rpx; + font-family: PingFang SC; + font-weight: 400; + color: #6E768A; + font-weight: 560; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.moreBox{ + margin-top: 30rpx; + position: relative; +} +.user{ + float: left; + width: 60rpx; + height: 60rpx; + border-radius: 50%; + background-color: beige; +} +.userText{ + width: 200rpx; + text-align: center; + height: 60rpx; + line-height: 60rpx; + background: #222735; + border-radius: 50rpx; + font-family: PingFang SC; + font-weight: 500; + font-size: 26rpx; + color: #8790A8; +} \ No newline at end of file diff --git a/pages/category/category.js b/pages/category/category.js new file mode 100644 index 0000000..02bd09b --- /dev/null +++ b/pages/category/category.js @@ -0,0 +1,105 @@ +const app = getApp() +const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" +const navigationBarHeight2 = (getApp().statusBarHeight + 44) +const config = require("../../config/config.js"); +const Http = require("../../utils/HttpBasics") +Page({ + data: { + navigationBarHeight, + navigationBarHeight2, + activityFlag: 0, + column: [], + id:"",//选中分类id + pageNum:1, + dataLsit:[],//数据列表 + inputValue:'',//搜索框值 + }, + setActiviy(e){ + let index = e.currentTarget.dataset.index + let id = e.currentTarget.dataset.id + this.setData({ + activityFlag:index, + id:id, + pageNum:1, + }) + this.getLsit() + + }, + setSearchValue(e){ + let value = e.detail.value + this.setData({ + inputValue:value + }) + }, + + goDetails(e){ + let id = e.currentTarget.dataset.id + let title = e.currentTarget.dataset.title + console.log(id); + tt.navigateTo({ + url: `/pages/classDetails/classDetails?id=${id}&title=${title}` // 指定页面的url + }); + }, + getColumn(){ + Http.get({ + url:config.api.getColumn + }).then(res=>{ + let tempData = res.data + tempData.unshift({ + id:"", + title:"推荐" + }) + this.setData({ + column:tempData + }) + }).catch(err=>{ + tt.showToast({ + title: err.data, // 内容 + + }); + }) + }, + getLsit(){ + console.log(666); + Http.get({ + url:config.api.columnLsit, + data:{ + businessId:this.data.id, + pageNum:this.data.pageNum, + pageSize:10, + title:this.data.inputValue + } + }).then(res=>{ + console.log(res); + let list = this.data.dataLsit + if(this.data.pageNum>1){ + list.push(...res.data.list) + }else{ + list = res.data.list + } + this.setData({ + dataLsit:list + }) + }).catch(err=>{ + tt.showToast({ + title: err.data, // 内容 + }); + }) + }, + onLoad(options){ + console.log(options); + this.setData({ + activityFlag:options.itemId, + id:options.itemId + }) + this.getColumn() + this.getLsit() + }, + onReachBottom: function() { + this.setData({ + pageNum:this.data.pageNum+1 + }) + console.log("我到底了"); + this.getLsit() + } +}) \ No newline at end of file diff --git a/pages/category/category.json b/pages/category/category.json new file mode 100644 index 0000000..f133ee0 --- /dev/null +++ b/pages/category/category.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "分类", + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/category/category.ttml b/pages/category/category.ttml new file mode 100644 index 0000000..d4fbd80 --- /dev/null +++ b/pages/category/category.ttml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + {{item.title}} + + + + + + + + + + + + {{item.title}} + + + + {{item.countClass?item.countClass+'课时':'单课程'}} + + + {{item.salePriceStr}} + + + ¥ + + + {{"免费"}} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/category/category.ttss b/pages/category/category.ttss new file mode 100644 index 0000000..5597338 --- /dev/null +++ b/pages/category/category.ttss @@ -0,0 +1,111 @@ +.BoxBg{ + min-height: 1400rpx; +} +.searchBox{ + height: 80rpx; + +} +.searchF{ + /* width: 80%; */ + height: 80rpx; + background-color: rgba(51, 51, 51, 0.5); + border-radius: 60rpx; + margin: 20rpx; +} +.searchText{ + width: 80%; + margin: 0 auto; + height: 100%; + color: #ffffff; +} +.categoryBox{ + overflow: scroll; + margin-top: 40rpx; +} +.columnBox{ + width: 18%; + /* float: left; */ + position: fixed; + top: 270rpx; + /* height: 600rpx; */ +} +.courseBox{ + float: left; + width: 78%; + /* height: 1066rpx; */ + margin-left: 20%; + overflow: scroll; +} +.itemBox_a{ + height: 120rpx; + background-image: -webkit-linear-gradient(left, #103930, #121620) +} +.itemBox{ + height: 120rpx; +} +.Text{ + height: 60rpx; + text-align:center; + line-height: 60rpx; + color: #ffffff; + margin-top: 30rpx; +} +.Text_a{ + height: 60rpx; + text-align:center; + line-height: 60rpx; + color: #ffffff; + margin-top: 30rpx; + font-size: 30rpx; + border-left: 2rpx solid #00ff99; + color:#00ff99 ; + +} +.courseItemBox { + margin-bottom: 20rpx; +} +.Img{ + width: 200rpx; + height: 120rpx; + border-radius: 10rpx; + /* background-color: chocolate; */ + float: left; + margin-right: 30rpx; +} +.TextBox{ + width: 320rpx; + height: 120rpx; + float: left; +} +.Name{ + height: 50rpx; + line-height: 50rpx; + font-size: 32rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; + color: #ffffff; + +} +.chargeBox{ + margin-top: 30rpx; + +} +.tiem{ + float: left; + color: #999999; +} +.money{ + +float: right; +color: #ff3366; +font-size: 34rpx; +} +.py{ + font-size: 26rpx; + float: right; + color: #ff3366; + line-height: 46rpx; +} \ No newline at end of file diff --git a/pages/classDetails/classDetails.js b/pages/classDetails/classDetails.js new file mode 100644 index 0000000..abe760d --- /dev/null +++ b/pages/classDetails/classDetails.js @@ -0,0 +1,358 @@ +const app = getApp() +const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" +const config = require("../../config/config") +const Http = require("../../utils/HttpBasics.js") +Page({ + data: { + ifPay:app.globalData.platform, + classTitle:"",//课程标题 + showIos:false,//ios字符提示 + showHie: false,//提示框 + anthology: 0,//选集 + classNumber: "",//有多少集 + imgHttps: app.globalData.imgHttps, + extraClasses: 'addBox-transition ', + navigationBarHeight, + videoContext: "", + ifpay: 0,//是否支付 0免费 1付费 + goPayFlag: false,//支付按钮显隐 + btnSuspend: true,//控制播放按钮 + columnIndex: 0, + addFlag: true, + thenIndex: 0,//播放选合集 + popupNum: 0,//弹出选集 + popupIndex: 0,////播放选集 + showPopup: false,//选集弹框 + id: "",//课程id + data: {},//数据源 + iscollect: false,//是否收藏 + mp4Url: "", + tiemLsit: [{//试看时间 + value: 1, + name: 60 + }, { + value: 2, + name: 180, + }, { + value: 3, + name: 300, + }], + }, + // goIndent(e){ + // console.log(e.dataset.url); + // }, + showIos(){ + this.setData({ + showIos:true + }) + }, + cancel(e) { + this.setData({ + showHie: e.detail.data + }) + }, + cancelIos(e) { + this.setData({ + showIos: e.detail.data + }) + }, + hiePopup() { + this.setData({ + showPopup: false + }) + }, + setShowPopup() { + this.setData({ + showPopup: true + }) + }, + setPopupIndex(e) { + let index = e.currentTarget.dataset.index + this.setData({ + popupIndex: index + }) + }, + setPopupNum(e) { + let index = e.currentTarget.dataset.index + this.setData({ + popupNum: index + }) + }, + setThenIndex(e) { + let index = e.currentTarget.dataset.index + let id = e.currentTarget.dataset.id + console.log(id); + this.getVideoUrl(id) + this.setData({ + anthology: index + }) + }, + siteVid(e) {//切换视频 + let index = e.currentTarget.dataset.index + let id = e.currentTarget.dataset.id + this.getVideoUrl(id) + this.setData({ + anthology: index, + goPayFlag: false, + btnSuspend: true, + }) + }, + hieaddCheck() { + this.setData({ + extraClasses: 'addBox-transition', + addFlag: true + }) + }, + addCheck() {//动画 + this.setData({ + addFlag: false + }) + if (this.data.extraClasses == 'addBox-transition addBox-moved') { + this.setData({ + extraClasses: 'addBox-transition', + + }) + } else { + this.setData({ + extraClasses: 'addBox-transition addBox-moved' + }) + } + }, + setColumnIndex(e) { + let index = e.currentTarget.dataset.index + this.setData({ + columnIndex: index + }) + }, + order() {//支付 + Http.post({//下订单 + url: config.api.order, + data: { + couponId: this.data.id + } + }).then(res => { + console.log(res.data, "订单成功"); + let id = res.data.id + console.log(id); + Http.post({//拿orderInfo + url: config.api.pay, + data: { + orderId: res.data.id + } + }).then(item => { + console.log(item, "orderId"); + tt.pay({ + service: 5, + orderInfo: { + order_id: item.data.orderId, + order_token: item.data.token, + }, + success(res) { + if (res.code === 0) { + this.getData() + tt.showToast({ + title: '支付成功!', // 内容 + }); + + // 支付成功处理逻辑,只有res.code=0时,才表示支付成功 + // 但是最终状态要以商户后端结果为准 + } else if (res.code === 1) { + tt.showToast({ + title: '支付超时', // 内容 + icon: "none" + }); + Http.post({ + url: config.api.ifPayOk, + data: { + code: 1, + orderId: res.data.id + } + }) + } else if (res.code === 2) { + tt.showToast({ + title: '支付失败', // 内容 + icon: "none" + }); + } else if (res.code === 3) { + tt.showToast({ + title: '支付关闭', // 内容 + icon: "none" + }); + } else if (res.code === 4) { + tt.showToast({ + title: '支付取消', // 内容 + icon: "none" + }); + } else if (res.code === 9) { + tt.showToast({ + title: '订单状态开发者自行获取', // 内容 + icon: "none" + }); + } + }, + fail(res) { + // handle fail + }, + }) + }).catch(err => { + tt.showToast({ + title: '唤起支付失败', // 内容 + icon: "none" + }); + }) + }).catch(err => { + if (err.code === 3013) { + this.setData({ + showHie: true + }) + } else { + tt.showToast({ + title: err.message, // 内容 + icon: "none" + }); + } + + }) + }, + goPay() { + this.order() + console.log("我支付了"); + this.setData({ + goPayFlag: false, + btnSuspend: true, + }) + }, + time(e) { + let time = e.detail.currentTime.toFixed(0); + if (!this.data.ifpay || this.data.data.view) {//已经支付过或免费 + if(this.data.data.columnCoupons){ + this.setData({ + classNumber: this.data.data.columnCoupons.length + }) + } + return + } else {//需要付费或已支付 + let tempTime = "" //预览时间 + if (this.data.data.columnCoupons) {//是不是集合 + + this.setData({ + classNumber: this.data.data.columnCoupons.length + }) + tempTime = this.data.tiemLsit.filter(item => { + return this.data.data.columnCoupons[this.data.anthology].previewDuration == item.value + })[0].name + } else { + tempTime = this.data.tiemLsit.filter(item => { + return this.data.data.previewDuration == item.value + })[0].name + } + + if (time >= tempTime) { + this.data.videoContext.pause()//暂停 + this.data.videoContext.exitFullScreen()//退出全屏 + this.setData({ + goPayFlag: true, + btnSuspend: false,//禁止播放 + }) + } + } + + }, + setCollect() {//设置收藏 + if (this.data.iscollect) {//已收藏 + Http.get({ + url: config.api.Fcollect, + data: { id: this.data.id } + }).then(res => { + this.ifCollect() + }).catch(err => { + tt.showToast({ + title: err.data, // 内容 + icon: "none" + }); + }) + } else {//未收藏 + Http.get({ + url: config.api.Tcollect, + data: { id: this.data.id } + }).then(res => { + this.ifCollect() + }).catch(err => { + tt.showToast({ + title: err.data, // 内容 + icon: "none" + }); + }) + } + }, + ifCollect() {//是否收藏课程 + Http.get({ + url: config.api.iscollect, + data: { + id: this.data.id + } + }).then(res => { + this.setData({ + iscollect: res.data + }) + }) + }, + getData() {//订单详情 + Http.get({ + url: config.api.classDetails, + data: { id: this.data.id } + }).then(res => { + this.setData({ + data: res.data, + ifpay: res.data.isPayment + }) + if (res.data.columnCoupons) { + this.getVideoUrl(res.data.columnCoupons[0].videoId) + } else { + this.getVideoUrl(res.data.videoId) + } + + }).catch(err => { + tt.showToast({ + title: err.data, // 内容 + icon: "none" + }); + }) + }, + getVideoUrl(id) {//获取视频url + Http.get({ + url: config.api.getViodUrl, + data: { + videoId: id + } + }).then(res => { + console.log(res); + this.setData({ + mp4Url: res.data.videoUrl + }) + }) + }, + onReady() { + this.setData({ + videoContext: wx.createVideoContext('myVideo') + }) + }, + onLoad(options) { + if (options.id) { + this.setData({ + id: options.id, + classTitle:options.title + }) + this.ifCollect() + // this.getData() + + } + }, + onShow(){ + this.getData() + }, + onShareAppMessage: function () { + // return custom share data when user share. + }, + +}) \ No newline at end of file diff --git a/pages/classDetails/classDetails.json b/pages/classDetails/classDetails.json new file mode 100644 index 0000000..ed6b282 --- /dev/null +++ b/pages/classDetails/classDetails.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "navbar": "../../components/navbar/navbar", + "prompt": "../../components/prompt/prompt" + } +} \ No newline at end of file diff --git a/pages/classDetails/classDetails.ttml b/pages/classDetails/classDetails.ttml new file mode 100644 index 0000000..e01f3e2 --- /dev/null +++ b/pages/classDetails/classDetails.ttml @@ -0,0 +1,159 @@ + + + + + + + ¥ {{data.salePriceStr}} 购买 + 暂不支持购买 + + + {{data.title}} + + + + 人气{{data.popularity}} + + + + + + + 收藏 + + + + + + + ¥ + + + {{data.salePriceStr}} + + + + + + + + + {{(index+1)+'.'+item.title}} + + + + + + + + + + + + 介绍 + + + + 目录 + + + + + + + + + + {{data.merchantName}} + + + + {{data.businessName}} + + + + + + + + + {{data.author.introduction}} + + + + + + + + + 课程分集 + + + + + {{(index+1+'.')+item.title}} + + + + + 正在播放 + + + + + + + + + + + + + + 申请入驻 + + + + + + + + + ¥{{data.salePriceStr}} + ¥{{data.salePriceStr}} + + + + + \ No newline at end of file diff --git a/pages/classDetails/classDetails.ttss b/pages/classDetails/classDetails.ttss new file mode 100644 index 0000000..bcc9215 --- /dev/null +++ b/pages/classDetails/classDetails.ttss @@ -0,0 +1,609 @@ +.Box{ + min-height: 100vh; +} +#myVideo{ + width: 100%; + height: 420rpx; + position: relative; +} +.rich_text{ + width: 100%; + height: 100%; +} +.rich_text p{ + width: 100%; +} +.coverPay{ + /* width: 200rpx; */ + padding: 0 20rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + border-radius: 40rpx; + background-color: #07E881; + color: #ffffff; + position: absolute; + left: 40%; top: 293rpx; + z-index: 1000000; + +} +.noCoverPay{ + /* width: 200rpx; */ + padding: 0 20rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + border-radius: 40rpx; + background-color: rgba(255, 255, 255, 0.3); + color: #ffffff; + position: absolute; + left: 40%; top: 293rpx; + z-index: 1000000; + +} +.showContBox { + margin: 20rpx ; +} +.titleBox{ + float: left; + width: 80%; +} +.title{ + color: #ffffff; + font-size: 36rpx; + font-family: PingFang SC; + font-weight: bold; + height: 40rpx; + line-height: 40rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.classBox{ + margin: 20rpx 0; + color: #ffffff; +} +.courseLogo{ + float: left; + width: 40rpx; + height: 40rpx; +} +.classNum{ + margin: 0 20rpx; + float: left; +} +.heatLogo{ + width: 35rpx; + height: 40rpx; + margin-left: 50rpx; + float: left; + +} +.heatNum{ + margin-left: 20rpx; + float: left; +} +.collectBox{ + float: left; + width: 20%; + height: 120rpx; + text-align: center; + +} +.collect{ + width: 50rpx; + height: 50rpx; +} +.payBox{ + width: 95%; + margin: auto; + background-image: -webkit-linear-gradient(left, #103930, #121620); +} +.payNum{ + + font-size: 36rpx; + color: #FC4758; + font-family: OPPOSans; + font-weight: 400; + height: 80rpx; + float: left; + line-height: 80rpx; +} +.payF{ + height: 80rpx; + float: left; + line-height: 80rpx; + margin-left: 20rpx; + color: #FC4758; +} +.columnBox{ + margin: 20rpx 0; +} +.columnB_a{ + font-family: OPPOSans; + font-weight: 800; + color: #FFFFFF; + font-size: 32rpx; + margin-left: 20rpx; + border-bottom: 4rpx solid #07E881; + padding-bottom: 6rpx; +} +.introduce{ + float: left; + font-family: OPPOSans; + margin: 20rpx 40px; +} +.catalogue{ + font-family: OPPOSans; + float: left; + margin: 20rpx 40rpx; +} +.userParticularsBox{ + border-radius: 20rpx; + background-color: #293145; +} +.userBox{ + /* float: left; */ + margin: 40rpx 20rpx 20rpx 20rpx; +} + +.userDescribe{ + float: left; + margin: 20rpx; + color: #9DA8C4; + font-family: OPPOSans; + font-weight: 400; +} +.userLogo{ + height: 120rpx; + width: 120rpx; + float: left; + border-radius: 50%; +} +.userNameBox{ + margin-left: 40rpx; + float: left; +} +.userName{ + float: left; + color: #FFFFFF; + font-family: OPPOSans; + font-weight: 500; + font-size: 30rpx; + padding: 0 20rpx; +} +.attention{ + float: left; + border-radius: 20rpx; + line-height: 40rpx; + height: 40rpx; + border: 1rpx solid #07E881; + background: rgba(7, 232, 129, 0.12); + color: #07E881; + padding: 2rpx 20rpx; +} +.classifyItem{ + text-align: center; + background: #141825; + border: 1rpx solid #666D80; + border-radius: 18rpx; + float: left; + padding: 6rpx 10rpx; + margin: 10rpx; +} +.extend{ + width: 20rpx; + height: 40rpx; + float: right; + margin: 20rpx 40rpx 0 0; +} + +.richtextBox{ + margin-top: 40rpx; + min-height: 120rpx; +} +.add{ + width: 140rpx; + height: 140rpx; + position: fixed; + right: 0; + bottom: 274rpx; +} +.addBox{ + padding: 0 40rpx; + /* width: 90%; */ + height: 100rpx; + background: linear-gradient(0deg, #2A3042, #464D61); + box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.93); + border-radius: 49rpx; + position: fixed; + left: 100%; + bottom: 300rpx; +} +.addBox-transition { + transition: all 0.5s; + } + + .addBox-moved { + left: 50%; + } + + @keyframes addBox-ani { + from { + left: 100%; + } + + to { + left: 5%; + } + } + + .addBox-animation { + animation: addBox-ani 1s alternate infinite; + } + .goruzu{ + float: left; + } + +.video{ + width: 70rpx; + height: 70rpx; + float: left; + margin-left: 40rpx; + margin-top: 15rpx; +} +.checkImg{ + width: 70rpx; + height: 70rpx; + float: left; + /* margin-left: 80rpx; */ + margin-left: 10rpx; + margin-top: 10rpx; +} +.issue{ + float: left; + font-size: 30rpx; + font-family: OPPOSans; + font-weight: bold; + color: #FFFFFF; + line-height: 100rpx; + margin-left: 10rpx; +} +.xian{ + height: 70rpx; + width: 2rpx; + background-color: rgba(255, 255, 255, 0.3); + border-radius: 1px; + float: left; + margin-left: 80rpx; + margin-top: 15rpx; +} +.shareBox{ + width: 100%; + position: fixed; + left: 0; + bottom: 0; + height: 120rpx; + background: #141928; +} +.shareImg{ + margin-top: 5rpx; + float: left; + width: 40rpx; + height: 40rpx; + margin-top: 20rpx; + margin-left: 40rpx; +} +.shareText{ + float: left; + margin-top: 20rpx; + margin-left: 20rpx; + color: #ffffff; + width: 70rpx; + height: 50rpx; + font-size: 28rpx; +} +.xuxian{ + width: 1rpx; + height: 28rpx; + background: #8790A8; + opacity: 0.4; + float: left; + margin-top: 30rpx; + margin-left: 60rpx; +} +.consult{ + float: left; + width: 40rpx; + height: 40rpx; + margin-top: 20rpx; + margin-left: 40rpx; + line-height: 40rpx; +} +.service{ + float: left; + margin-top: 10rpx; + margin-left: 10rpx; + color: #ffffff; + width: 100rpx; + padding: 0; + height: 50rpx; + background-color: #141928; + font-size: 28rpx; + +} +.service span{ + display: block; + width: 100%; + height: 100%; +} +.shopping{ + height: 90rpx; + line-height: 90rpx; + text-align: center; + float: left; + padding: 0 60rpx; + background: linear-gradient(-4deg, #4EE09D, #02C96E); + border-radius: 50rpx; + margin-left: 30rpx; + color: #FFFFFF; + font-size: 36rpx; + font-family: OPPOSans; +} +.nOshopping{ + height: 90rpx; + line-height: 90rpx; + text-align: center; + float: left; + padding: 0 60rpx; + background-color: rgba(255, 255, 255, 0.1); + border-radius: 50rpx; + margin-left: 10rpx; + color: #FFFFFF; + font-size: 32rpx; + font-family: OPPOSans; +} +.h3Img{ + width: 40rpx; + height: 40rpx; + float: left; + margin-left: 20rpx; +} +.h3{ + float: left; + margin-left: 20rpx; + font-family: OPPOSans; + font-weight: 500; + color: #FFFFFF; +} +.playLsitBox{ + margin: 40rpx 20rpx; +} +.transmitImg{ + width: 100rpx; + height: 100rpx; + float: left; +} +.timeBox{ + float: left; + width: 400rpx; + margin-left: 20rpx; + color: #FFFFFF; +} +.curriculumBox{ + margin-top: 20rpx; +} +.time{ + float: left; + width: 30rpx; + height: 30rpx; + margin-top: 20rpx; +} +.timeText{ + + font-family: OPPOSans; + font-weight: 500; + color: #6E768A; + margin-top: 15rpx; + margin-left: 10rpx; + float: left; +} +.yuan{ + float: left; + width: 30rpx; + height: 30rpx; + margin-top: 20rpx; + margin-left: 100rpx; +} +.then{ + font-family: OPPOSans; + font-weight: 500; + color: #07E881; + margin-top: 15rpx; + margin-left: 10rpx; + float: left; +} +.timeBoxTitle_a{ + color: #07E881; +} +.timeBoxTitle{ + color: #ffffff; +} +.try{ + float: left; + width: 60rpx; + height: 40rpx; + margin-left: 80rpx; + margin-top: 20rpx; +} +.shuo{ + float: left; + width: 30rpx; + height: 30rpx; + margin-left: 80rpx; + margin-top: 15rpx; +} +.hit{ + height: 120rpx; +} +.purchaseBox{ + float: left; + width: 90%; + overflow: hidden; + overflow-y: hidden; + overflow-x: auto; + white-space: nowrap; + margin-top: 20rpx; + height: 70rpx; +} +.purchaseBox::-webkit-scrollbar { + display: none; +} +.anthology_a{ + width: 220rpx; + padding: 10rpx 20rpx; + border-radius: 50rpx; + text-align: center; + border: 1rpx solid #ffffff; + color: #FFFFFF; + display: inline-block; + text-align: center; + margin-left: 20rpx; +} +.anthology{ + width: 220rpx; + padding: 10rpx 20rpx; + border-radius: 50rpx; + text-align: center; + display: inline-block; + border: 1rpx solid #7A8399; + color: #7A8399;; + + margin-left: 20rpx; + margin-top: 20rpx 0; +} +.anthology_a{ + width: 220rpx; + padding: 10rpx 20rpx; + border-radius: 50rpx; + text-align: center; + display: inline-block; + border: 1rpx solid #7A8399; + color: #ffffff;; + + margin-left: 20rpx; + margin-top: 20rpx 0; +} +.anthologyItem{ + width: 220rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.more{ + width: 20rpx; + height: 40rpx; + float: left; + margin-top: 30rpx; + margin-left: 40rpx; +} +.compilationsBox{ + width: 100%; + height: 60vh; + position: fixed; + background-color: #0E1119; + z-index: 100000; + bottom: 0; + left: 0; +} +.aaClassBox{ + width: 88%; + float: left; +} +.pack{ + width: 5%; + height: 20rpx; + float: right; + margin-top: 30rpx; + margin-right: 40rpx; +} +.anthologyText{ + float: left; + font-family: OPPOSans; + font-weight: 500; + color: #FFFFFF; + font-size: 32rpx; + margin: 20rpx; +} +.xiao{ + font-size: 28rpx; + float: left; + margin-top: 20rpx; +} +.Num{ + float: 20rpx; + float: left; + font-size: 34rpx; + color: #ffffff; + margin-top: 20rpx; + margin-left: 10rpx; + margin-right: 10rpx; +} +.number_a{ + width: 90rpx; + float: left; + padding: 10rpx 20rpx; + border: 1px solid #07E881;; + margin: 0 30rpx; + border-radius: 50rpx; + text-align: center; + color: #07E881; + +} +.numberBox{ + margin: 30rpx 0; +} +.number{ + width: 90rpx; + float: left; + padding: 10rpx 20rpx; + border: 1px solid #7A8399; + margin: 0 30rpx; + border-radius: 50rpx; + text-align: center; +} +.bfLogo{ + width: 100rpx; + height: 100rpx; + float: left; + margin: 10rpx 20rpx; +} +.classnameBox{ + float: left; +} +.classname{ + width: 560rpx; + font-size: 30rpx; + color: #ffffff; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; + margin-top: 10rpx; +} +.classname_a{ + width: 560rpx; + font-size: 30rpx; + color: #07E881; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; + margin-top: 10rpx; +} \ No newline at end of file diff --git a/pages/course/course.js b/pages/course/course.js new file mode 100644 index 0000000..38bb115 --- /dev/null +++ b/pages/course/course.js @@ -0,0 +1,100 @@ +// const app = getApp() +// const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" +// Page({ +// data:{ +// navigationBarHeight, +// } +// }) + +const app = getApp() +const config = require("../../config/config") +const Http = require("../../utils/HttpBasics.js") +const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" +Page({ + data: { + imgHttps: app.globalData.imgHttps, + navigationBarHeight, + inputValue: '', + pageNum: 1, + list: [], + showFlog:false, + id:"",//选中id + }, + setSearchValue(e) { + let value = e.detail.value + this.setData({ + inputValue: value + }) + }, + searchBtn() { + this.setData({ + list: [], + pageNum: 1 + }) + this.search() + }, + cancel(){ + Http.get({ + url:config.api.Fcollect, + data:{ + id:this.data.id + } + }).then(res=>{{ + tt.showToast({ + title: '已取消收藏', // 内容 + icon: "none" + }); + }}).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon:"none" + }); + }) + }, + hie(){ + this.setData({ + showFlog:false + }) + }, + showHie(e){ + let id = e.currentTarget.dataset.id + this.setData({ + showFlog:true, + id:id + }) + }, + search() { + Http.get({ + url: config.api.getOrderLsit, + data: { + productTitle: this.data.inputValue, + pageNum: this.data.pageNum, + pageSize: 8, + orderStatus: 2 + } + }).then(res => { + console.log(res); + let temp = this.data.list + if (this.data.pageNum > 1) { + temp.push(res.data.list) + this.setData({ + list: temp + }) + } else { + this.setData({ + list: res.data.list + }) + } + }) + }, + onLoad() { + this.search() + }, + onReachBottom: function() { + this.setData({ + pageNum:this.data.pageNum+1 + }) + this.search() + + } +}) \ No newline at end of file diff --git a/pages/course/course.json b/pages/course/course.json new file mode 100644 index 0000000..93331f2 --- /dev/null +++ b/pages/course/course.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "课程", + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/course/course.ttml b/pages/course/course.ttml new file mode 100644 index 0000000..2a586f2 --- /dev/null +++ b/pages/course/course.ttml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + 搜索 + + + + + + + + + + + + {{item.productTitle}} + + + + {{item.author}} + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/course/course.ttss b/pages/course/course.ttss new file mode 100644 index 0000000..aa158c8 --- /dev/null +++ b/pages/course/course.ttss @@ -0,0 +1,273 @@ +/* .headBox{ + width: 100%; + height: 320rpx; + background-image: url("https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/course_bnt.png"); + background-size: 100% 320rpx; +} +.classHourBox{ + width: 80%; + height: 222rpx; + background-image: url("https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/course_bnt_xuexi.png"); + background-size: 100% 222rpx; + margin-top:60rpx ; + margin-left: auto; + margin-right: auto; +} +.classNumBox{ + width: 46%; + height: 100%; + float: left; + margin-left: 2%; + +} +.xian{ + width: 0rpx; + height: 60%; + float: left; + margin-top: 8%; + border: 2rpx #8D95B9 solid; + opacity: 0.3; +} +.deyClassBox{ + width: 46%; + height: 100%; + float: left; +} +.numBox{ + color: #ffffff; + margin-top: 50rpx; +} +.num{ + float: left; + margin-left: 70rpx; + font-size: 64rpx; +} +.text{ + float: left; + margin-top: 26rpx; + margin-left: 10rpx; + color: #8B94AD; +} +.study{ + color: #8B94AD; + text-align: center; + line-height: 40rpx; +} +.learnTitle{ + height: 60rpx; + line-height: 60rpx; + font-family: OPPOSans; + font-weight: 500; + color: #FFFFFF; + font-size: 32rpx; + margin-bottom: 20rpx; + text-indent: 20rpx; +} +.logo{ + float: left; + width: 43%; + height: 180rpx; + background-color: coral; + border-radius: 10rpx; +} +.particularsBox{ + margin-left: 2%; + width: 55%; + float: left; +} +.h3{ + font-family: PingFang SC; + font-weight: 500; + color: #FEFEFE; + font-size: 32rpx; + height: 40rpx; + line-height: 40rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; + +} +.overall{ + font-size: 24rpx; + font-family: PingFang SC; + font-weight: 500; + color: #8790A8; + margin: 10rpx 0; +} +.scheduleHie{ + width: 100%; + height: 10rpx; + background-color: #242A3A; + border-radius: 10rpx; + position: relative; +} +.scheduleA{ + position: absolute; + top: 0; + left: 0; + width: 12%; + height: 10rpx; + border-radius: 10rpx; + background-color: #07E881; +} +.classBox{ + padding: 10rpx 0; + margin: 20rpx 0; +} */ + + + +.Box{ + height: 100vh; + overflow: scroll; + min-height: 100vh; +} +.searchF{ + width: 80%; + height: 80rpx; + background-color: rgba(51, 51, 51, 0.5); + border-radius: 60rpx; + margin: 20rpx; + float: left; +} +.searchText{ + width: 80%; + margin: 0 auto; + height: 100%; + color: #ffffff; +} +.searchBtn{ + width: 10%; + line-height: 100rpx; + color: #00ff99; + float: left; + height: 100rpx; + margin-top: 10rpx; + font-size: 30rpx; +} +.classBoxAll{ + margin: 0 20rpx; +} +.classBox{ + margin: 20rpx 0; +} +.logo{ + float: left; + width: 300rpx; + height: 200rpx; + background-color: aquamarine; + border-radius: 12rpx; +} +.textBox{ + float: left; + margin-left: 10px; +} +.titile{ + width: 350rpx; + height: 40rpx; + line-height: 40rpx; + font-size: 36rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FEFEFE; + margin-bottom: 19rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1 +} +.cont{ + width: 360rpx; + height: 30rpx; + line-height: 30rpx; + font-size: 26rpx; + font-family: PingFang SC; + font-weight: 400; + color: #6E768A; + font-weight: 560; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.moreBox{ + margin-top: 30rpx; + position: relative; +} +.user{ + float: left; + width: 60rpx; + height: 60rpx; + border-radius: 50%; + background-color: beige; +} +.userText{ + width: 200rpx; + text-align: center; + height: 60rpx; + line-height: 60rpx; + background: #222735; + border-radius: 50rpx; + font-family: PingFang SC; + font-weight: 500; + font-size: 26rpx; + color: #8790A8; +} +.show{ + position: absolute; + width: 60rpx; + height: 60rpx; + top:5rpx; + right: 20rpx; + text-align: center; +} +.go{ + width: 40rpx; + height: 10rpx; +} +.noDataBox{ + width: 100%; + height: 600rpx; + top: 300rpx; + left: 0; + background-color: #0E1119; + text-align: center; +} +.noDataImg{ + width: 500rpx; + height: 400rpx; +} +.instrumentBox{ + width: 100%; + background: #1F232E; + border-radius: 30rpx 30rpx 0rpx 0rpx; + height: 200rpx; + position: fixed; + bottom:0; + left: 0; +} +.cancel{ + width: 100%; + line-height: 90rpx; + height: 90rpx; + font-size: 32rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FFFFFF; + border-bottom: 1rpx rgba(255, 255, 255, 0.1) solid; + text-align: center; +} +.hie{ + width: 100%; + line-height: 90rpx; + height: 90rpx; + font-size: 32rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FFFFFF; + text-align: center; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..076cdd4 --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,231 @@ +const app = getApp() +const config = require("../../config/config") +const Http = require("../../utils/HttpBasics.js") +const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" +Page({ + data: { + imgHttps:app.globalData.imgHttps, + column:[], + topFlag:0, + swiperLsit:[], + inputValue:'', + navigationBarHeight, + deyList:[],//今天推荐 + deyPageNum:1, + classLsit:[],//精选类容 + classpageNum:1, + autho:[],//推荐作者 + authoPageNum:1, + rankingList:[],//热门排行 + rankingPageNum:1, + }, + goXq(e){//跳转详情 + let id = e.currentTarget.dataset.id + let title = e.currentTarget.dataset.title + tt.navigateTo({ + url: `/pages/classDetails/classDetails?id=${id}&title=${title}` // 指定页面的url + }); + }, + goPublicity(e){ + let id = e.currentTarget.dataset.id + let type = e.currentTarget.dataset.type + tt.navigateTo({ + url: `/pages/publicity/publicity?id=${id}&type=${type}` // 指定页面的url + }); + }, + getNweDataLsit(){//今天推荐 + Http.get({ + url:config.api.columnLsit, + data:{ + pageNum:this.data.deyPageNum, + pageSize:4, + sortOrder:"desc" + } + }).then(res=>{ + let temp = this.data.list + if(this.data.pageNum>1){ + temp.push(...res.data.list) + + }else{ + temp = res.data.list + } + this.setData({ + deyList:temp + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon: "none" + }); + }) + }, + getSwiperLsit(){//获取轮播图 + Http.get({ + url:config.api.getPublicity, + data:{ + pageSize:7, + pageNum:1 + } + }).then(res=>{ + console.log(res.data,"轮播图"); + this.setData({ + swiperLsit:res.data.list + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon: "none" + }); + }) + }, + getClassLsit(){//精选课程 + Http.get({ + url:config.api.columnLsit, + data:{ + pageNum:this.data.classpageNum, + pageSize:3, + mark:1, + sortColumn: "markTime", + sortOrder: "desc" + } + }).then(res=>{ + let temp = this.data.list + if(this.data.pageNum>1){ + temp.push(...res.data.list) + + }else{ + temp = res.data.list + } + this.setData({ + classLsit:temp + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon: "none" + }); + }) + }, + getRanking(){//排行榜 + Http.get({ + url:config.api.columnLsit, + data:{ + pageNum:this.data.rankingPageNum, + pageSize:6, + sortColumn:"popularity", + sortOrder:"desc" + } + }).then(res=>{ + let temp = this.data.list + if(this.data.pageNum>1){ + temp.push(...res.data.list) + + }else{ + temp = res.data.list + } + this.setData({ + rankingList:temp + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon: "none" + }); + }) +}, + getAuthor(){//推荐作者 + Http.get({ + url:config.api.getAuthor, + data:{ + pageNum:this.data.authoPageNum, + pageSize:4, + mark:1, + sortColumn: "markTime", + sortOrder: "desc" + } + }).then(res=>{ + let text ="" + let arr=res.data.list + + if(res.data.list[0].businessTypes){ + + arr.map(item1=>{ + JSON.parse(item1.businessTypes).map(item2=>{ + text += " "+item2.title + }) + item1.authoRemark = text + }) + + } + console.log(arr); + this.setData({ + autho:arr, + }) + }) + }, + search(){ + console.log(this.data.inputValue); + }, + + setTopFlag(e){ + let index = e.currentTarget.dataset.index + let itemId = e.currentTarget.dataset.itemid + console.log(itemId); + this.setData({ + topFlag:index + }) + tt.navigateTo({ + url: `/pages/category/category?itemId=${itemId}` // 指定页面的url + }); + }, + getColumn(){ + Http.get({ + url:config.api.getColumn + }).then(res=>{ + let tempData = res.data + tempData.unshift({ + id:"", + title:"推荐" + }) + this.setData({ + column:tempData + }) + }).catch(err=>{ + tt.showToast({ + title: err.data, // 内容 + + }); + }) +}, +getWeapNote(){//初始化 + if (app.globalData.token){//登录 + this.getColumn() + this.getNweDataLsit() + this.getClassLsit() + this.getRanking() + this.getAuthor() + this.getSwiperLsit() + }else{//未登录 + app.tokenCallback = token => { + this.getColumn() + this.getNweDataLsit() + this.getClassLsit() + this.getRanking() + this.getAuthor() + this.getSwiperLsit() + } + } +}, + onLoad: function () { + this.getWeapNote() + }, + onPullDownRefresh() { + this.getColumn() + this.getNweDataLsit() + this.getClassLsit() + this.getRanking() + this.getAuthor() + this.getSwiperLsit() + tt.stopPullDownRefresh(); + }, +}) diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..958e731 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "首页", + "usingComponents": { + "navbar": "../../components/navbar/navbar" + }, + "enablePullDownRefresh": true + +} \ No newline at end of file diff --git a/pages/index/index.ttml b/pages/index/index.ttml new file mode 100644 index 0000000..7fdfbe5 --- /dev/null +++ b/pages/index/index.ttml @@ -0,0 +1,353 @@ + + + + + + + + 搜索 + + + + + + + + {{item.title}} + + + + + + + + + + + + + + + + + + + + 最新上架 + + + + + + + 精选课程 + + + + + + + 排行榜 + + + + + + + 全部分类 + + + + + + + + + 今日推荐 + + + + + + + + {{item.businessName}} + + + + + + 投资者-周期 + + + + + + + + + + + + + + + 精选内容 + + + + + + + + + 最近人气 + + + {{item.popularity}} + + + + + + + {{item.title}} + + + + + {{item.merchantName}} + + + + + ¥ + + + {{item.salePriceStr}} + + + 免费 + + + + + + + + + + + + + + + + + 查看更多 + + + + + + + + + + + + + + 推荐作者 + + + + + + + + + + + {{item.name}} + + + {{item.authoRemark}} + + + + + + + + + + + + + + + + 热门排行 + + + + + + + + {{index+1}} + + + + + + {{item.title}} + + + + + + 人 气 + + + {{item.popularity}} + + + + + + + + + + + + + + + + + + + + + 最新内容 + + + + + + + + + + 最近人气 + + + {{item.popularity}} + + + + + + + {{item.title}} + + + + + {{item.merchantName}} + + + + + ¥ + + + {{item.salePriceStr}} + + + 免费 + + + + + + + + + + + + + + + + 查看更多 + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/index/index.ttss b/pages/index/index.ttss new file mode 100644 index 0000000..20fc346 --- /dev/null +++ b/pages/index/index.ttss @@ -0,0 +1,594 @@ +.BoxBg{ + background-color: #000033; + overflow: hidden; + font-size: 28rpx; + min-height: 100vh; +} +.Box{ + width: 96%; + margin: 0 2%; +} +.topBox{ + height: 70rpx; + color: #666666; + margin-top: 10rpx; +} +.TopNavigationBox{ + width: 90%; + height: 100%; + overflow: hidden; + overflow-y: hidden; + overflow-x: auto; + white-space: nowrap; + float: left; +} +.TopNavigationBox::-webkit-scrollbar { + display: none; +} +.logo{ + width: 32rpx; + float: right; + height: 36rpx; + float: left; + margin-top: 10rpx; + margin-left: 12rpx; +} +.item{ + width: 80rpx; + margin: 0 20rpx; + position: relative; + display: inline-block; + text-align: center; +} +.title_a{ + font-size: 34rpx; + color: #00cc99; +} +.title{ + color: #666666; +} +.wire{ + width: 70%; + margin: 10rpx auto; + height: 2rpx; + background-color: #00cc99; +} + +.searchBox{ +overflow: hidden; + +} +.searchText{ + color: #666666; + line-height: 80rpx; +} +.searchF{ + width: 90%; + height: 80rpx; + background-color: rgba(51, 51, 51, 0.5); + border-radius: 60rpx; + margin: 20rpx auto; +} +.searchLogo{ + width: 40rpx; + height: 40rpx; + float: left; + margin: 20rpx 10rpx 15rpx 60rpx; +} +.searchText{ + float: left; + width: 80%; + margin: 0 auto; + height: 100%; + color: #ffffff; +} + +.swiperBox{ + margin: 30rpx 0; + border-radius: 10rpx; + +} +.swiper{ + height: 320rpx; +} +.swiperImg{ + width: 100%; + height: 100%; + background-color: chocolate; + border-radius: 10rpx; +} +.columnBox{ + height: 180rpx; + padding: 40rpx 0 ; + display: flex; + justify-content: center; +} +.columnItem{ + width: 20%; + margin: 0 auto; + + +} +.columnText{ + color: #ffffff; + text-align: center; + line-height: 40rpx; +} +.deyBox{ + overflow: hidden; + +} +.deyTitleBox{ + /* overflow: hidden; */margin: 20rpx 0; +} +.deyTitleImg{ + width: 60rpx; + height: 70rpx; + float: left; + margin: 0 10rpx; +} + .deyTitle{ + font-size: 36rpx; + color:#ffffff; + font-weight: 700; + padding: 10rpx 0 30rpx 0 ; + margin-left: 10rpx; + letter-spacing:4rpx; + +} +.authorBox1{ + margin-top: 20rpx; +} + + +.authorImgTop{ + width: 150rpx; + height: 150rpx; + background-color: #00cc99; + border-radius: 50%; + margin: 40rpx auto; +} +.deyImgBox{ + display: flex; + /* justify-content: space-around; */ + flex-wrap :wrap; + +} + +/* .authorOutsideBox{ + width: 100%; + + height: 400rpx; +} */ +.authorBox{ + height: 380rpx; + overflow: hidden; + display: -webkit-box; + overflow-x: scroll; + -webkit-overflow-scrolling: touch; + +} +.authorBox::-webkit-scrollbar { + display: none; +} +.authorItem{ + width: 32%; + /* height: 400rpx; */ + margin: 0 2%; + border-radius: 10rpx 10rpx 10rpx 40rpx; + text-align: center; + background-image: -webkit-linear-gradient(top, #103930, #121620); + +} +.imgBox{ + width: 46%; + overflow: hidden; + display: inline-block; + text-align: center; + margin: 0 2%; + /* height: 400rpx; */ + +} +.imgitem{ + position: relative; +} +.imgitem .img{ + width: 100%; + /* background-color: chartreuse; */ + height: 200rpx; + border-radius: 10rpx; +} +.posClass{ + position: absolute; + right: 0; + top: 0; + width: 70rpx; + height: 40rpx; + background-image: url('https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/home_bnt_bq.png'); + background-size:70rpx 40rpx; + color: #ffffff; + font-size: 24rpx; + z-index: 100000; +} +.imgBox .itemTitle{ + height: 60rpx; + line-height: 60rpx; + text-align: center; + color: #ffffff; + font-size: 30rpx; + +} +.handpickBox{ + overflow: hidden; +} + +.handpickTop{ + overflow: hidden; + margin: 40rpx 0 ; +} +.handpickImg{ + width: 60rpx; + height: 70rpx; + float: left; + margin: 0 10rpx; +} +.handpickText{ + font-size: 36rpx; + color:#ffffff; + font-weight: 700; + height: 36rpx; + padding: 10rpx 0 30rpx 0 ; + margin-left: 10rpx; + float: left; + letter-spacing:4rpx +} +.handpickadd{ + float: right; + color: #00cc99; + font-size: 30rrpx; + margin: 10rpx 20rpx; +} +.handpickLogo{ + width: 50rpx; + height: 50rpx; + float: right; + background-color: #00cc99; + margin-top: 10rpx; + margin-right: 20rpx; + border-radius: 50%; + color: #ffffff; + text-align: center; + line-height: 50rpx; + font-size: 36rpx; +} +.commodityBox{ + overflow: hidden; + margin-bottom: 30rpx; +} +.extendBox{ + overflow: hidden; + margin: 40rpx 0; +} +.extendMoreBox{ + float: left; + width: 45%; + height: 70rpx; + margin-right: 5%; + background-color: #1A1D26; + border-radius: 30rpx; +} + .changeBox { + margin-left: 5%; + float: left; + background-color: #1A1D26; + border-radius: 30rpx; + width: 45%; + height: 70rpx; +} +.commodityImg{ + position: relative; + width: 320rpx; + background-color: chocolate; + border-radius: 10rpx; + height: 200rpx; + float: left; + margin-left: 10rpx; +} +.commodityImage{ + width: 100%; + height: 100%; + border-radius: 10rpx; +} +.classBoxImg{ + width: 100%; + height: 100%; + border-radius: 10rpx; +} +.describeBox{ + width: 360rpx; + margin-left: 30rpx; + float: left; +} +.describeBame{ + width: 80%; + height: 50rpx; + line-height: 50rpx; + font-size: 34rpx; + color: #ffffff; + font-weight: 560; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.headImgBox{ + float: left; +} +.headImg{ + float: left; + width: 60rpx; + height: 60rpx; + border-radius: 50%; + background-color: #00cc99; +} +.annotation{ + width: 240rpx; + border-radius: 50rpx; + height: 60rpx; + background-color: #333; + text-align: center; + line-height: 60rpx; + color: #9999cc; +} +.introduce{ + width: 96%; + margin-top: 20rpx; + color: #9999cc; + height: 86rpx; + line-height: 40rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:2; +} +.priceBox{ + margin-top: 20rpx; + overflow: hidden; +} +.priceF{ + float: left; + color: #ff3366; + line-height: 60rpx; +} +.price{ + font-size: 34rpx; + color: #ff3366; + float: left; + line-height: 60rpx; +} +.popularity{ + width: 180rpx; + height: 60rpx; + float: right; + margin-right: 60rpx; + margin-top: 10rpx; + background-color: chocolate; +} + +.exchangeText{ + float: left; + color: #8790A8; + line-height: 70rpx; + margin-left: 20rpx; + font-size: 30rpx; +} +.exchangeBox{ + width: 90%; + margin: 20rpx auto; + height: 70rpx; + line-height: 70rpx; + border-radius: 50rpx; + text-align: center; + background: #1A1D26; +} +.exchangeImg{ + width: 40rpx; + height: 40rpx; + margin-top: 15rpx ; + margin-left: 260rpx; + float: left; +} +.exchangeBtn{ + float: left; + width: 50rpx; + height: 50rpx; + margin: 5rpx 0 0 20rpx; + background-color: cornflowerblue; +} +.authorImgBox{ + background-color: rgba(51, 51, 51, 0.5); + height: 360rpx; + border-radius: 40rpx; + overflow: hidden; +} + +.nameBox{ + height: 140rpx; + background-color: rgba(51, 51, 51,0.6); + border-radius: 0rpx 40rpx 0rpx 40rpx; +} +.authorName{ + height: 60rpx; + line-height: 60rpx; + text-align: center; + color: #ffffff; + font-size: 36rpx; + font-weight: 600; +} +.authorText{ + width: 90%; + margin: 0 auto; + color: #9999cc; + height: 60rpx; + line-height: 60rpx; + text-align: center; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.rankingBox{ + margin: 20rpx 0; +} +.sortBox{ + overflow: hidden; + +} +.sortNmu{ + width: 18%; + background-color: aqua; + height: 360rpx; + float: left; +} +.articleBox{ + width: 82%; + height: 360rpx; + float: left; +} +.articleImg{ + width: 40%; + height: 100%; + background-color: blueviolet; + border-radius: 10rpx; + float: left; +} +.articleTextBox{ + float: left; + width: 58%; + margin-left: 2%; + height: 100%; + border-radius: 10rpx; +} +.articleTitle{ + font-size: 34rpx; + color: #ffffff; + font-weight: 560; +} +.articlePopularity{ + width: 180rpx; + height: 60rpx; + float: right; + margin-right: 20rpx; + margin-top: 10rpx; + background-color: chocolate; +} +.sortItemBox{ + width: 31%; + margin: 20rpx 1%; + float: left; +} + +.sortItemImg{ + position: relative; + width: 100%; + height: 160rpx; + border-radius: 10rpx; +} +.sortItemImg image{ + width: 100%; + height: 100%; + border-radius: 10rpx; +} +.sortNumBj_0{ + position: absolute; + width: 52rpx; + height: 65rpx; + background-image: url('https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/home_rmph_ic_1.png'); + background-size:52rpx 65rpx; + color: #ffffff; + text-align: center; + line-height: 46rpx; + top: 0; + left: 0; +} +.sortNumBj_1{ + position: absolute; + width: 52rpx; + height: 65rpx; + background-image: url('https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/home_rmph_ic_2.png'); + background-size:52rpx 65rpx; + color: #ffffff; + text-align: center; + line-height: 46rpx; + top: 0; + left: 0; +} +.sortNumBj_2{ + position: absolute; + width: 52rpx; + height: 65rpx; + background-image: url('https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/home_rmph_ic_3.png'); + background-size:52rpx 65rpx; + color: #ffffff; + text-align: center; + line-height: 46rpx; + top: 0; + left: 0; +} +.sortNumBj_3{ + position: absolute; + width: 52rpx; + height: 65rpx; + background-image: url('https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/home_rmph_ic_4.png'); + background-size:52rpx 65rpx; + color: #ffffff; + text-align: center; + line-height: 46rpx; + top: 0; + left: 0; +} +.sortTitle{ + height: 40rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #FEFEFE; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; + margin: 10rpx 0; +} +.popularityBox { + padding: 10rpx 0; +} +.popularityImg{ + float: left; + width: 23rpx; + height: 26rpx; + margin-top: 8rpx; + margin-left: 5rpx; +} +.popularityText{ + float: left; + font-size: 26rpx; + margin: 0 10rpx; +} +.popularityNum{ + float: left; + color: #07E881; + font-size: 26rpx; +} + +.newPopularity{ + width: 100%; + position: absolute; + bottom: 0; + left: 10; + background-color: #222735; + height: 40rpx; + border-radius: 0 0 10rpx 10rpx ; +} \ No newline at end of file diff --git a/pages/mianAttention/mianAttention.js b/pages/mianAttention/mianAttention.js new file mode 100644 index 0000000..d2121ba --- /dev/null +++ b/pages/mianAttention/mianAttention.js @@ -0,0 +1,10 @@ +const app = getApp() +const config = require("../../config/config") +const Http = require("../../utils/HttpBasics.js") +const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" +Page({ + data:{ + imgHttps:app.globalData.imgHttps, + navigationBarHeight, + } +}) \ No newline at end of file diff --git a/pages/mianAttention/mianAttention.json b/pages/mianAttention/mianAttention.json new file mode 100644 index 0000000..ea1dc18 --- /dev/null +++ b/pages/mianAttention/mianAttention.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "我的关注", + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/mianAttention/mianAttention.ttml b/pages/mianAttention/mianAttention.ttml new file mode 100644 index 0000000..e69de29 diff --git a/pages/mianAttention/mianAttention.ttss b/pages/mianAttention/mianAttention.ttss new file mode 100644 index 0000000..e69de29 diff --git a/pages/mianCollect/mianCollect.js b/pages/mianCollect/mianCollect.js new file mode 100644 index 0000000..151bfe6 --- /dev/null +++ b/pages/mianCollect/mianCollect.js @@ -0,0 +1,91 @@ +const app = getApp() +const config = require("../../config/config") +const Http = require("../../utils/HttpBasics.js") +const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" +Page({ + data: { + imgHttps: app.globalData.imgHttps, + navigationBarHeight, + inputValue: '', + pageNum: 1, + list: [], + showFlog:false, + id:"",//选中id + }, + setSearchValue(e) { + let value = e.detail.value + this.setData({ + inputValue: value + }) + }, + searchBtn() { + this.setData({ + list: [], + pageNum: 1 + }) + this.search() + }, + cancel(){ + Http.get({ + url:config.api.Fcollect, + data:{ + id:this.data.id + } + }).then(res=>{{ + tt.showToast({ + title: '已取消收藏', // 内容 + icon: "none" + }); + }}).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon:"none" + }); + }) + }, + hie(){ + this.setData({ + showFlog:false + }) + }, + showHie(e){ + let id = e.currentTarget.dataset.id + this.setData({ + showFlog:true, + id:id + }) + }, + search() { + Http.get({ + url: config.api.mainCollet, + data: { + title: this.data.inputValue, + pageNum: this.data.pageNum, + pageSize: 8 + } + }).then(res => { + console.log(res); + let temp = this.data.list + if (this.data.pageNum > 1) { + temp.push(res.data.list) + this.setData({ + list: temp + }) + } else { + this.setData({ + list: res.data.list + }) + } + }) + }, + onLoad() { + this.search() + }, + onReachBottom: function() { + this.setData({ + pageNum:this.data.pageNum+1 + }) + this.search() + + } +}) \ No newline at end of file diff --git a/pages/mianCollect/mianCollect.json b/pages/mianCollect/mianCollect.json new file mode 100644 index 0000000..b29a7db --- /dev/null +++ b/pages/mianCollect/mianCollect.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "我的收藏", + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/mianCollect/mianCollect.ttml b/pages/mianCollect/mianCollect.ttml new file mode 100644 index 0000000..aef16c3 --- /dev/null +++ b/pages/mianCollect/mianCollect.ttml @@ -0,0 +1,49 @@ + + + + + + + + + + + + 搜索 + + + + + + + + + + + + {{item.title}} + + + + {{item.merchantName}} + + + + + + + + + + + + + + + + 取消收藏 + 取消 + + + \ No newline at end of file diff --git a/pages/mianCollect/mianCollect.ttss b/pages/mianCollect/mianCollect.ttss new file mode 100644 index 0000000..3527976 --- /dev/null +++ b/pages/mianCollect/mianCollect.ttss @@ -0,0 +1,151 @@ +.Box{ + height: 100vh; + overflow: scroll; + min-height: 100vh; +} +.searchF{ + width: 80%; + height: 80rpx; + background-color: rgba(51, 51, 51, 0.5); + border-radius: 60rpx; + margin: 20rpx; + float: left; +} +.searchText{ + width: 80%; + margin: 0 auto; + height: 100%; + color: #ffffff; +} +.searchBtn{ + width: 10%; + line-height: 100rpx; + color: #00ff99; + float: left; + height: 100rpx; + margin-top: 10rpx; + font-size: 30rpx; +} +.classBoxAll{ + margin: 0 20rpx; +} +.classBox{ + margin: 20rpx 0; +} +.logo{ + float: left; + width: 300rpx; + height: 200rpx; + border-radius: 12rpx; +} +.textBox{ + float: left; + margin-left: 10px; +} +.titile{ + width: 350rpx; + height: 40rpx; + line-height: 40rpx; + font-size: 36rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FEFEFE; + margin-bottom: 19rpx; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1 +} +.cont{ + width: 360rpx; + height: 30rpx; + line-height: 30rpx; + font-size: 26rpx; + font-family: PingFang SC; + font-weight: 400; + color: #6E768A; + font-weight: 560; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.moreBox{ + margin-top: 30rpx; + position: relative; +} +.user{ + float: left; + width: 60rpx; + height: 60rpx; + border-radius: 50%; + background-color: beige; +} +.userText{ + width: 200rpx; + text-align: center; + height: 60rpx; + line-height: 60rpx; + background: #222735; + border-radius: 50rpx; + font-family: PingFang SC; + font-weight: 500; + font-size: 26rpx; + color: #8790A8; +} +.show{ + position: absolute; + width: 60rpx; + height: 60rpx; + top:5rpx; + right: 20rpx; + text-align: center; +} +.go{ + width: 40rpx; + height: 10rpx; +} +.noDataBox{ + width: 100%; + height: 600rpx; + top: 300rpx; + left: 0; + background-color: #0E1119; + text-align: center; +} +.noDataImg{ + width: 500rpx; + height: 400rpx; +} +.instrumentBox{ + width: 100%; + background: #1F232E; + border-radius: 30rpx 30rpx 0rpx 0rpx; + height: 200rpx; + position: fixed; + bottom:0; + left: 0; +} +.cancel{ + width: 100%; + line-height: 90rpx; + height: 90rpx; + font-size: 32rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FFFFFF; + border-bottom: 1rpx rgba(255, 255, 255, 0.1) solid; + text-align: center; +} +.hie{ + width: 100%; + line-height: 90rpx; + height: 90rpx; + font-size: 32rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FFFFFF; + text-align: center; +} \ No newline at end of file diff --git a/pages/order/order.js b/pages/order/order.js new file mode 100644 index 0000000..3c1a21f --- /dev/null +++ b/pages/order/order.js @@ -0,0 +1,168 @@ +const app = getApp() +const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" +const config = require("../../config/config") +const util = require("../../utils/util"); +const Http = require("../../utils/HttpBasics.js") +Page({ + data: { + navigationBarHeight, + imgHttps: app.globalData.imgHttps, + pitch: 0,//选中支付类型 + orderLsit: [],//订单列表 + pageNum: 1, + statusLsit: [ + { + value: 0, + name: "待支付" + }, + { + value: 1, + name: "已支付" + } + ], + }, + goClass(e){ + let id = e.currentTarget.dataset.id + let title = e.currentTarget.dataset.title + tt.navigateTo({ + url: `/pages/classDetails/classDetails?id=${id}&title=${title}` // 指定页面的url + }); + }, + setPitch(e) { + let index = e.currentTarget.dataset.index + this.setData({ + pitch: index, + pageNum:1 + }) + this.getOrder() + }, + goPay(e){ + let id = e.currentTarget.dataset.id + Http.post({//拿orderInfo + url: config.api.pay, + data: { + orderId: id + } + }).then(item => { + console.log(item, "orderId"); + tt.pay({ + service: 5, + orderInfo: { + order_id: item.data.orderId, + order_token: item.data.token, + }, + success(res) { + if (res.code === 0) { + tt.showToast({ + title: '支付成功!', // 内容 + }); + + // 支付成功处理逻辑,只有res.code=0时,才表示支付成功 + // 但是最终状态要以商户后端结果为准 + } else if (res.code === 1) { + tt.showToast({ + title: '支付超时', // 内容 + icon: "none" + }); + Http.post({ + url: config.api.ifPayOk, + data: { + code: 1, + orderId: res.data.id + } + }) + } else if (res.code === 2) { + tt.showToast({ + title: '支付失败', // 内容 + icon: "none" + }); + } else if (res.code === 3) { + tt.showToast({ + title: '支付关闭', // 内容 + icon: "none" + }); + } else if (res.code === 4) { + tt.showToast({ + title: '支付取消', // 内容 + icon: "none" + }); + } else if (res.code === 9) { + tt.showToast({ + title: '订单状态开发者自行获取', // 内容 + icon: "none" + }); + } + }, + fail(res) { + // handle fail + }, + }) + }).catch(err => { + tt.showToast({ + title: '唤起支付失败', // 内容 + icon: "none" + }); + }) + }, + getOrder() {//查询订单 + //ORDER_STATUS_PENDING_PAYMENT(0, "待付款"), + // ORDER_STATUS_PAYMENT_ING(1,"支付中"), + // ORDER_STATUS_PAYMENT_SUCCESS(2, "已支付"), + // ORDER_STATUS_OVERTIME_CANCEL(3, "已取消"), + // ORDER_STATUS_PENDING_REFUND(4, "待退款"), + // ORDER_STATUS_REFUND_SUCCESS(5,"已退款"), + // ORDER_STATUS_REFUND_FAILD(6, "退款失败"), + + let tempArr = [] + if (this.data.pitch == 0) {//待付款 + tempArr.push(...[0, 1, 3]) + } else {//已支付 + tempArr.push(...[2, 4, 5, 6]) + } + console.log(tempArr); + Http.get({ + url: config.api.getOrderLsit, + data: { + pageNum: this.data.pageNum, + pageSize: 3, + statusS: tempArr + } + }).then(res => { + let arr = res.data.list + arr.map(item=>{ + item.createDate = util.formatTime(item.createDate, "yyyy-MM-dd hh:mm:ss") + }) + if(this.data.pageNum>1){ + + let tempLsit = this.data.orderLsit + tempLsit.push(...arr) + this.setData({ + orderLsit:tempLsit + }) + }else{ + this.setData({ + orderLsit:arr + }) + } + + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon: "none" + }); + }) + }, + onLoad() { + this.getOrder() + }, + onSshow(){ + this.getOrder() + }, + onReachBottom(){ + console.log("到底了"); + this.setData({ + pageNum:this.data.pageNum +1 + }) + this.getOrder() + } +}) \ No newline at end of file diff --git a/pages/order/order.json b/pages/order/order.json new file mode 100644 index 0000000..106ce81 --- /dev/null +++ b/pages/order/order.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "我的订单", + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/order/order.ttml b/pages/order/order.ttml new file mode 100644 index 0000000..f7bcbcf --- /dev/null +++ b/pages/order/order.ttml @@ -0,0 +1,73 @@ + + + + + + + + {{item.name}} + + + + + + + + + + + 订单编号:{{item.id}} + + + + + + {{item.productTitle}} + + + + + {{item.author}} + + + + + ¥ + + + {{item.paymentStr}} + + + + + + + + + + + + + 订单时间:{{item.createDate}} + + {{item.paymentTime?item.paymentTime:'请您在30分支之内支付'}} + + + + + + 付款 + + + 已完成 + + + + + + + + + + + \ No newline at end of file diff --git a/pages/order/order.ttss b/pages/order/order.ttss new file mode 100644 index 0000000..2ca5715 --- /dev/null +++ b/pages/order/order.ttss @@ -0,0 +1,149 @@ +.BoxBg{ + min-height: 100vh; +} +.navigation{ + height: 120rpx; + border-bottom: 1rpx #232835 solid; +} +.fPay{ + width: 50%; + float: left; +} +.tPay{ + width: 50%; + float: left; +} +.aText{ +margin-top: 20rpx; +font-size: 36rpx; +font-family: PingFang SC; +font-weight: 800; +color: #07E881; +text-align: center; +} +.Axian{ + width: 70rpx; + height: 4rpx; + background-color: #07E881; + margin: 10rpx auto; +} +.classBox{ + width: 90%; + margin: 20rpx auto; + padding-bottom: 20rpx; + border-bottom: 1rpx #232835 solid; +} +.Text{ +margin-top: 20rpx; +font-size: 32rpx; +font-family: PingFang SC; +font-weight: 500; +color: #FFFFFF; +text-align: center; +} +.orderBox{ + border-radius: 20rpx; + background-color: #181C28; + margin: 40rpx 0 0 0; +} +.orderNum{ + clear: #8790A8; + line-height: 70rpx; + width: 90%; + margin: 20rpx auto; + border-bottom: 1rpx #232835 solid; + +} +.img{ + float: left; + width: 250rpx; + height: 160rpx; + border-radius: 10rpx; + background-color: coral; +} +.courseBox { + margin-left: 30rpx; + float: left; + +} +.h3{ + + width: 300rpx; + line-height: 60rpx; + font-size: 34rpx; + color: #ffffff; + font-weight: 560; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:1; +} +.headImg{ + width: 60rpx; + height: 60rpx; + border-radius: 50%; + background-color: coral; + float: left; + +} +.name{ + width: 220rpx; + line-height: 60rpx; + height: 60rpx; + border-radius: 50rpx; + color: #8790A8; + text-align: center; + background-color: #222735; +} +.priceBox{ + /* margin-top: 20rpx; */ + overflow: hidden; +} +.priceF{ + float: left; + color: #ff3366; + line-height: 60rpx; +} +.price{ + font-size: 34rpx; + color: #ff3366; + float: left; + line-height: 60rpx; +} +.timeBox{ +width: 90%; +margin: 20rpx auto; +} +.timeTitile{ + float: left; +} +.payTiem{ + + line-height: 80rpx; + font-size: 32rpx; + font-family: PingFang SC; + font-weight: 500; + color: #FC4758; +} +.payBtn{ + float: right; + width: 180rpx; + line-height: 80rpx; + text-align: center; + border: 2rpx solid #06D176; + border-radius: 50rpx; + color: #06D176; + +} +.payOk{ + float: right; + width: 180rpx; + line-height: 80rpx; + text-align: center; + border: 2rpx solid #666D80; + border-radius: 50rpx; + color: #666D80; + background-color: rgba(135, 144, 168, 0.1);; + +} diff --git a/pages/publicity/publicity.js b/pages/publicity/publicity.js new file mode 100644 index 0000000..301e24b --- /dev/null +++ b/pages/publicity/publicity.js @@ -0,0 +1,70 @@ +const app = getApp() +const config = require("../../config/config") +const Http = require("../../utils/HttpBasics.js") +const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" +var WxParse = require('../../wxParse/wxParse.js'); +Page({ + data:{ + imgHttps:app.globalData.imgHttps, + navigationBarHeight, + allLsit:"", + id:"", + type:"", + }, + getData(){ + Http.get({ + url:config.api.getPublicityDetail, + data:{id:this.data.id} + }).then(res=>{ + this.setData({ + allLsit:res.data + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon: "none" + }); + }) + }, + getHtml(id ,that){ + tt.request({ + url: 'https://ttctest.malls.iformall.com/tt/api/wxCampaign/printHtmlById', // 目标服务器url + data:{ + token: app.globalData.token, + id:id, + date: new Date() + }, + header: { + 'content-type': 'application/html' + }, + success: (res) => { + var temp = WxParse.wxParse('article', 'html', res.data, that, 5); + } + }); + }, + goXq(e){//跳转详情 + let id = e.currentTarget.dataset.id + let title = e.currentTarget.dataset.title + tt.navigateTo({ + url: `/pages/classDetails/classDetails?id=${id}&title=${title}` // 指定页面的url + + }); + }, + onLoad:function (params) { + const that = this; + console.log(params.id); + if(params.id &¶ms.type==1){//宣传页 + that.setData({ + id:params.id, + type:params.type + }) + that.getData() + }else if(params.id &¶ms.type==2){//图文 + that.setData({ + id:params.id, + type:params.type + }) + that.getHtml(params.id,that) + } + }, +}) \ No newline at end of file diff --git a/pages/publicity/publicity.json b/pages/publicity/publicity.json new file mode 100644 index 0000000..ea1dc18 --- /dev/null +++ b/pages/publicity/publicity.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "我的关注", + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/publicity/publicity.ttml b/pages/publicity/publicity.ttml new file mode 100644 index 0000000..32ad7f3 --- /dev/null +++ b/pages/publicity/publicity.ttml @@ -0,0 +1,50 @@ + + + + + + + {{allLsit.title}} + {{allLsit.subTitle}} + 活动说明 + {{allLsit.detail}} + + + + + + + + {{item.title}} + + + + + {{item.merchantName}} + + + + + + ¥ + + {{item.salePriceStr}} + + {{"免费"}} + + {{item.popularity}} + 人气 + + + + + + + + + + +