| @@ -15,7 +15,7 @@ App({ | |||||
| try { | try { | ||||
| var res = tt.getSystemInfoSync(); | var res = tt.getSystemInfoSync(); | ||||
| that.statusBarHeight = res.statusBarHeight | that.statusBarHeight = res.statusBarHeight | ||||
| console.log(`手机型号为 ${res.platform}`); | |||||
| console.log(res,"型号"); | |||||
| this.globalData.platform = res.platform | this.globalData.platform = res.platform | ||||
| } catch (error) { | } catch (error) { | ||||
| console.log(`获取系统信息失败`); | console.log(`获取系统信息失败`); | ||||
| @@ -13,7 +13,8 @@ | |||||
| "pages/mianCollect/mianCollect", | "pages/mianCollect/mianCollect", | ||||
| "pages/UpHome/UpHome", | "pages/UpHome/UpHome", | ||||
| "pages/publicity/publicity", | "pages/publicity/publicity", | ||||
| "pages/upEnter/upEnter" | |||||
| "pages/upEnter/upEnter", | |||||
| "pages/integral/integral" | |||||
| ], | ], | ||||
| "usingComponents": {}, | "usingComponents": {}, | ||||
| "window":{ | "window":{ | ||||
| @@ -15,6 +15,7 @@ let config = { | |||||
| getAuthor:"/merchant/listV1",//查询作者 | getAuthor:"/merchant/listV1",//查询作者 | ||||
| checkUserInfo:"/user/checkWechatStatus",//用户是否授权 | checkUserInfo:"/user/checkWechatStatus",//用户是否授权 | ||||
| userInfo:"/user/getUserInfo",//用户授权 | userInfo:"/user/getUserInfo",//用户授权 | ||||
| getUserInfo:"/user/userinfo",//获取用户信息 | |||||
| mainCollet:"/ttCoupon/collectList",//我的收藏 | mainCollet:"/ttCoupon/collectList",//我的收藏 | ||||
| getUpUser:"/merchant/findById",//up类容 | getUpUser:"/merchant/findById",//up类容 | ||||
| getPublicity:"/wxCampaign/list",//轮播图 | getPublicity:"/wxCampaign/list",//轮播图 | ||||
| @@ -14,6 +14,33 @@ Page({ | |||||
| classList:[],//课程列表 | classList:[],//课程列表 | ||||
| dNum:"",//但课程数 | dNum:"",//但课程数 | ||||
| zNum:"",//专栏数 | zNum:"",//专栏数 | ||||
| addFlag: true, | |||||
| }, | |||||
| hieaddCheck() { | |||||
| let animation = tt.createAnimation({ | |||||
| duration: 1000, | |||||
| timingFunction: "ease", | |||||
| }); | |||||
| animation.translateX(400).step() | |||||
| this.setData({ | |||||
| // extraClasses: 'addBox-transition', | |||||
| showAddBox: animation.export(), | |||||
| addFlag: true | |||||
| }) | |||||
| }, | |||||
| showAddCheck: function () { | |||||
| this.setData({ | |||||
| addFlag: false | |||||
| }) | |||||
| let animation = tt.createAnimation({ | |||||
| duration: 1000, | |||||
| timingFunction: "ease", | |||||
| }); | |||||
| animation.translateX(0).step() | |||||
| this.setData({ | |||||
| showAddBox: animation.export(), | |||||
| }) | |||||
| }, | }, | ||||
| getClass(){//课程list | getClass(){//课程list | ||||
| Http.get({ | Http.get({ | ||||
| @@ -75,12 +102,25 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| onLoad(options){ | onLoad(options){ | ||||
| this.setData({ | |||||
| id:options.id, | |||||
| name:options.name | |||||
| }) | |||||
| this.getUpData() | |||||
| this.getClass() | |||||
| if(app.globalData.token){ | |||||
| this.setData({ | |||||
| id:options.id, | |||||
| name:options.name | |||||
| }) | |||||
| this.getUpData() | |||||
| this.getClass() | |||||
| }else{ | |||||
| app.tokenCallback = token =>{ | |||||
| this.setData({ | |||||
| id:options.id, | |||||
| name:options.name | |||||
| }) | |||||
| this.getUpData() | |||||
| this.getClass() | |||||
| } | |||||
| } | |||||
| }, | }, | ||||
| onReachBottom() { | onReachBottom() { | ||||
| console.log("到底了"); | console.log("到底了"); | ||||
| @@ -89,5 +129,40 @@ Page({ | |||||
| }) | }) | ||||
| this.getClass() | this.getClass() | ||||
| } | |||||
| }, | |||||
| onShow() { | |||||
| let animation = tt.createAnimation({ | |||||
| duration: 0, | |||||
| // timingFunction: "ease", | |||||
| }); | |||||
| animation.translateX(400).step() | |||||
| this.setData({ | |||||
| showAddBox: animation.export(), | |||||
| screenFlag:false,//初始化防录屏弹框 | |||||
| }) | |||||
| // this.itiRecording() | |||||
| }, | |||||
| onShareAppMessage: function (shareOption) { | |||||
| let that = this | |||||
| if (shareOption.channel == 'video') { // 判断是是不是分享视频 | |||||
| return { | |||||
| channel: 'video', // 必写 video | |||||
| // templateId: '', // 分享的模版 id (如果未设置就是默认,下面会说如何设置) | |||||
| title: `知播堂-${that.data.upData.name}`, // 分享的标题 | |||||
| // desc: '我是简介', // 分享的内容介绍目前没有用 | |||||
| path: `/pages/UpHome/UpHome?id=${that.data.id}&name=${that.data.name}`, // 分享的路径 | |||||
| extra: { | |||||
| videoTopics: ["知播堂",] // 只有抖音才会有的属性 | |||||
| }, | |||||
| } | |||||
| } else { // 右上角分享 | |||||
| return { | |||||
| templateId: '', //分享的模版 id | |||||
| title: '', //分享的标题 | |||||
| desc: '', // 分享的内容 | |||||
| // path: ``, // 分享的路径 | |||||
| } | |||||
| } | |||||
| }, | |||||
| }) | }) | ||||
| @@ -1,4 +1,4 @@ | |||||
| <view id="BoxBg"> | |||||
| <view id="BoxBg" bindtap="hieaddCheck"> | |||||
| <view class="Box"> | <view class="Box"> | ||||
| <navbar back text="{{name}}" background=" rgba(255, 255, 255, 0);" color="#fff"></navbar> | <navbar back text="{{name}}" background=" rgba(255, 255, 255, 0);" color="#fff"></navbar> | ||||
| <image class="backImg" src="{{imgHttps+'upzy_tab_bnt.png'}}" mode="" /> | <image class="backImg" src="{{imgHttps+'upzy_tab_bnt.png'}}" mode="" /> | ||||
| @@ -21,7 +21,7 @@ | |||||
| </view> | </view> | ||||
| <navigator class="classBox oh" tt:for="{{classList}}" url="/pages/classDetails/classDetails?id={{item.id}}&title={{item.title}}" open-type=""hover-class="className"> | |||||
| <navigator class="classBox oh" tt:for="{{classList}}" url="/pages/classDetails/classDetails?id={{item.id}}&title={{item.title}}" open-type="" hover-class="className"> | |||||
| <image class="classImg" src="{{item.coverImg}}" mode="" /> | <image class="classImg" src="{{item.coverImg}}" mode="" /> | ||||
| <view class="textBox"> | <view class="textBox"> | ||||
| <view class="titile">{{item.title}}</view> | <view class="titile">{{item.title}}</view> | ||||
| @@ -45,6 +45,22 @@ | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </navigator> | </navigator> | ||||
| <image catchtap="showAddCheck" class="add" src="{{imgHttps+'details_bat_xf_zk.png'}}" mode="" tt:if="{{addFlag}}"/> | |||||
| <view class="addBox " animation="{{showAddBox}}"> | |||||
| <view class="goruzu oh"> | |||||
| <button class="mount oh" open-type="share" data-channel="video"> | |||||
| <image src="{{imgHttps+'details_xf_ic_fbsp.png'}}" mode="" class="video"/> | |||||
| <view class="issue">发布视频</view> | |||||
| </button> | |||||
| </view> | |||||
| <view class="xian"></view> | |||||
| <navigator url="/pages/upEnter/upEnter" class="goruzu oh"> | |||||
| <image src="{{imgHttps+'details_xf_ic_sqrz.png'}}" mode="" class="checkImg"/> | |||||
| <view class="issue" url="/pages/upEnter/upEnter">申请入驻</view> | |||||
| </navigator> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -150,6 +150,11 @@ | |||||
| font-weight: 500; | font-weight: 500; | ||||
| font-size: 26rpx; | font-size: 26rpx; | ||||
| color: #8790A8; | color: #8790A8; | ||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .incomeBox{ | .incomeBox{ | ||||
| margin-top: 10rpx; | margin-top: 10rpx; | ||||
| @@ -181,4 +186,78 @@ | |||||
| .moodsNum{ | .moodsNum{ | ||||
| float: right; | float: right; | ||||
| color: #00cc99; | color: #00cc99; | ||||
| } | |||||
| .add{ | |||||
| width: 140rpx; | |||||
| height: 140rpx; | |||||
| position: fixed; | |||||
| right: 0; | |||||
| bottom: 274rpx; | |||||
| z-index: 10000; | |||||
| } | |||||
| .addBox{ | |||||
| padding: 0 40rpx; | |||||
| height: 100rpx; | |||||
| background: linear-gradient(0deg, #2A3042, #464D61); | |||||
| background-color: #2A3042; | |||||
| box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.93); | |||||
| border-radius: 49rpx; | |||||
| position: fixed; | |||||
| left: 5%; | |||||
| bottom: 300rpx; | |||||
| } | |||||
| .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-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; | |||||
| } | |||||
| button::after { | |||||
| border: none; | |||||
| } | |||||
| button { | |||||
| background-color: transparent; | |||||
| padding-left: 0; | |||||
| padding-right: 0; | |||||
| line-height:inherit; | |||||
| } | |||||
| button { | |||||
| border-radius:0; | |||||
| } | } | ||||
| @@ -5,6 +5,7 @@ const config = require("../../config/config.js"); | |||||
| const Http = require("../../utils/HttpBasics") | const Http = require("../../utils/HttpBasics") | ||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| imgHttps:app.globalData.imgHttps, | |||||
| navigationBarHeight, | navigationBarHeight, | ||||
| navigationBarHeight2, | navigationBarHeight2, | ||||
| activityFlag: 0, | activityFlag: 0, | ||||
| @@ -13,6 +14,7 @@ Page({ | |||||
| pageNum:1, | pageNum:1, | ||||
| dataLsit:[],//数据列表 | dataLsit:[],//数据列表 | ||||
| inputValue:'',//搜索框值 | inputValue:'',//搜索框值 | ||||
| noDAtaFlag:false,// | |||||
| }, | }, | ||||
| setActiviy(e){ | setActiviy(e){ | ||||
| let index = e.currentTarget.dataset.index | let index = e.currentTarget.dataset.index | ||||
| @@ -60,7 +62,9 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| getLsit(){ | getLsit(){ | ||||
| console.log(666); | |||||
| tt.showLoading({ | |||||
| title: '加载中...', // 内容 | |||||
| }); | |||||
| Http.get({ | Http.get({ | ||||
| url:config.api.columnLsit, | url:config.api.columnLsit, | ||||
| data:{ | data:{ | ||||
| @@ -77,13 +81,25 @@ Page({ | |||||
| }else{ | }else{ | ||||
| list = res.data.list | list = res.data.list | ||||
| } | } | ||||
| if(list.length==0){ | |||||
| this.setData({ | |||||
| noDAtaFlag:true | |||||
| }) | |||||
| }else{ | |||||
| this.setData({ | |||||
| noDAtaFlag:false | |||||
| }) | |||||
| } | |||||
| this.setData({ | this.setData({ | ||||
| dataLsit:list | dataLsit:list | ||||
| }) | }) | ||||
| tt.hideLoading(); | |||||
| }).catch(err=>{ | }).catch(err=>{ | ||||
| tt.hideLoading(); | |||||
| tt.showToast({ | tt.showToast({ | ||||
| title: err.message, // 内容 | |||||
| }); | |||||
| title: err.message?err.message:err.data, // 内容 | |||||
| icon:"none" | |||||
| }); | |||||
| }) | }) | ||||
| }, | }, | ||||
| onLoad(options){ | onLoad(options){ | ||||
| @@ -1,67 +1,50 @@ | |||||
| <view id="BoxBg"> | <view id="BoxBg"> | ||||
| <view class="Box"> | |||||
| <navbar back text="分类" background="#0E1119" color="#fff"></navbar> | |||||
| <view style="height:{{navigationBarHeight}} "></view> | |||||
| <view class="searchBox"> | |||||
| <view class="searchF"> | |||||
| <input type="text" class="searchText" placeholder-style="color: #666666;" placeholder="搜索" | |||||
| bindconfirm="getLsit" bindinput="setSearchValue" confirm-type="search" /> | |||||
| </view> | |||||
| <view class="Box"> | |||||
| <navbar back text="分类" background="#0E1119" color="#fff"></navbar> | |||||
| <view style="height:{{navigationBarHeight}} "></view> | |||||
| <view class="searchBox"> | |||||
| <view class="searchF"> | |||||
| <input type="text" class="searchText" placeholder-style="color: #666666;" placeholder="搜索" bindconfirm="getLsit" bindinput="setSearchValue" confirm-type="search" /> | |||||
| </view> | |||||
| </view> | |||||
| <view class="categoryBox oh"> | |||||
| <view class="columnBox" style="top:{{navigationBarHeight2+200}}rpx"> | |||||
| <view class=" {{activityFlag==index?'itemBox_a':'itemBox'}} oh" tt:for="{{column}}" bindtap="setActiviy" data-index="{{index}}" data-id="{{item.id}}"> | |||||
| <view class="{{activityFlag==index?'Text_a':'Text'}}"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class="categoryBox oh"> | |||||
| <view class="columnBox" style="top:{{navigationBarHeight2+200}}rpx"> | |||||
| <view class=" {{activityFlag==index?'itemBox_a':'itemBox'}} oh" tt:for="{{column}}" bindtap="setActiviy" | |||||
| data-index="{{index}}" data-id="{{item.id}}"> | |||||
| <view class="{{activityFlag==index?'Text_a':'Text'}}"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="courseBox"> | |||||
| <view class="courseItemBox oh" tt:for="{{dataLsit}}" bindtap="goDetails" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <image class="Img" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="TextBox"> | |||||
| <view class="Name"> | |||||
| {{item.title}} | |||||
| </view> | </view> | ||||
| <view class="courseBox"> | |||||
| <view class="courseItemBox oh" tt:for="{{dataLsit}}" bindtap="goDetails" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <image class="Img" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="TextBox"> | |||||
| <view class="Name"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="chargeBox oh"> | |||||
| <view class="tiem"> | |||||
| {{item.countClass?item.countClass+'课时':'单课程'}} | |||||
| </view> | |||||
| <view class="money" tt:if="{{item.salePriceStr!=0}}"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| <view class="py" tt:if="{{item.salePriceStr!=0}}"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="money" tt:if="{{item.salePriceStr==0}}"> | |||||
| {{"免费"}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="chargeBox oh"> | |||||
| <view class="tiem"> | |||||
| {{item.countClass?item.countClass+'课时':'单课程'}} | |||||
| </view> | |||||
| <view class="money" tt:if="{{item.salePriceStr!=0}}"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| <view class="py" tt:if="{{item.salePriceStr!=0}}"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="money" tt:if="{{item.salePriceStr==0}}"> | |||||
| {{"免费"}} | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | |||||
| </view> | </view> | ||||
| <view class="noDataBox" tt:if="{{noDAtaFlag}}"> | |||||
| <image class="noDataImg" src="{{imgHttps+'no_result.png'}}" mode="" /> | |||||
| </view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -27,7 +27,7 @@ | |||||
| /* float: left; */ | /* float: left; */ | ||||
| position: fixed; | position: fixed; | ||||
| top: 270rpx; | top: 270rpx; | ||||
| height: 1200rpx; | |||||
| height: 1000rpx; | |||||
| overflow: scroll; | overflow: scroll; | ||||
| } | } | ||||
| .columnBox::-webkit-scrollbar { | .columnBox::-webkit-scrollbar { | ||||
| @@ -2,10 +2,13 @@ const app = getApp() | |||||
| const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | ||||
| const config = require("../../config/config") | const config = require("../../config/config") | ||||
| const Http = require("../../utils/HttpBasics.js") | const Http = require("../../utils/HttpBasics.js") | ||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| showAddBox:{}, | |||||
| ifPay: app.globalData.platform, | |||||
| direction:-90, | |||||
| screenFlag: false, | |||||
| showAddBox: {}, | |||||
| signal: app.globalData.platform, | |||||
| classTitle: "",//课程标题 | classTitle: "",//课程标题 | ||||
| showIos: false,//ios字符提示 | showIos: false,//ios字符提示 | ||||
| showHie: false,//提示框 | showHie: false,//提示框 | ||||
| @@ -54,6 +57,42 @@ Page({ | |||||
| // goIndent(e){ | // goIndent(e){ | ||||
| // console.log(e.dataset.url); | // console.log(e.dataset.url); | ||||
| // }, | // }, | ||||
| itiRecording(){//防止录屏初始化函数 | |||||
| if(this.data.signal=='ios'){ | |||||
| this.onRecord() | |||||
| }else{ | |||||
| this.disable() | |||||
| } | |||||
| }, | |||||
| disable: function() {// 防止录屏录制 安卓 | |||||
| tt.disableUserScreenRecord({ | |||||
| success(res) { | |||||
| console.log("disableUserScreenRecord 调用成功", res) | |||||
| }, | |||||
| fail(res) { | |||||
| console.log("disableUserScreenRecord 调用失败", res); | |||||
| }, | |||||
| }) | |||||
| }, | |||||
| onRecord: function () { // 防止录屏录制 ios | |||||
| const callback = (res) => { | |||||
| if (res.state === 'start') { | |||||
| this.data.videoContext.pause()//暂停 | |||||
| this.data.videoContext.exitFullScreen()//退出全屏 | |||||
| this.setData({ | |||||
| screenFlag: true, | |||||
| btnSuspend: false,//禁止播放 | |||||
| }) | |||||
| } else if (res.state === 'stop') { | |||||
| this.data.videoContext.play(); | |||||
| this.setData({ | |||||
| screenFlag: false, | |||||
| btnSuspend: true,//禁止播放 | |||||
| }) | |||||
| } | |||||
| } | |||||
| tt.onUserScreenRecord(callback) | |||||
| }, | |||||
| showIos() { | showIos() { | ||||
| this.setData({ | this.setData({ | ||||
| showIos: true | showIos: true | ||||
| @@ -122,14 +161,14 @@ Page({ | |||||
| duration: 1000, | duration: 1000, | ||||
| timingFunction: "ease", | timingFunction: "ease", | ||||
| }); | }); | ||||
| animation.opacity(0).step() | |||||
| animation.translateX(400).step() | |||||
| this.setData({ | this.setData({ | ||||
| // extraClasses: 'addBox-transition', | // extraClasses: 'addBox-transition', | ||||
| showAddBox:animation.export(), | |||||
| showAddBox: animation.export(), | |||||
| addFlag: true | addFlag: true | ||||
| }) | }) | ||||
| }, | }, | ||||
| showAddCheck:function(){ | |||||
| showAddCheck: function () { | |||||
| this.setData({ | this.setData({ | ||||
| addFlag: false | addFlag: false | ||||
| }) | }) | ||||
| @@ -137,27 +176,12 @@ Page({ | |||||
| duration: 1000, | duration: 1000, | ||||
| timingFunction: "ease", | timingFunction: "ease", | ||||
| }); | }); | ||||
| animation.opacity(1).step() | |||||
| animation.translateX(0).step() | |||||
| this.setData({ | this.setData({ | ||||
| showAddBox:animation.export(), | |||||
| showAddBox: animation.export(), | |||||
| }) | }) | ||||
| }, | }, | ||||
| // 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) { | setColumnIndex(e) { | ||||
| let index = e.currentTarget.dataset.index | let index = e.currentTarget.dataset.index | ||||
| this.setData({ | this.setData({ | ||||
| @@ -259,7 +283,7 @@ Page({ | |||||
| }) | }) | ||||
| }).catch(err => { | }).catch(err => { | ||||
| tt.showToast({ | tt.showToast({ | ||||
| title: '唤起支付失败', // 内容 | |||||
| title: err.message ? err.message : err.data, // 内容 | |||||
| icon: "none" | icon: "none" | ||||
| }); | }); | ||||
| }) | }) | ||||
| @@ -321,6 +345,7 @@ Page({ | |||||
| } | } | ||||
| }, | }, | ||||
| setCollect() {//设置收藏 | setCollect() {//设置收藏 | ||||
| if (this.data.iscollect) {//已收藏 | if (this.data.iscollect) {//已收藏 | ||||
| Http.get({ | Http.get({ | ||||
| @@ -394,7 +419,20 @@ Page({ | |||||
| videoId: id | videoId: id | ||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res.data.width,res.data.height); | |||||
| if((res.data.width)*1>=(res.data.height)*1){ | |||||
| //横屏 | |||||
| console.log("横屏"); | |||||
| this.setData({ | |||||
| direction:-90 | |||||
| }) | |||||
| }else{ | |||||
| //竖屏 | |||||
| console.log("竖屏"); | |||||
| this.setData({ | |||||
| direction:0 | |||||
| }) | |||||
| } | |||||
| this.setData({ | this.setData({ | ||||
| mp4Url: res.data.videoUrl | mp4Url: res.data.videoUrl | ||||
| }) | }) | ||||
| @@ -407,11 +445,12 @@ Page({ | |||||
| }); | }); | ||||
| }) | }) | ||||
| }, | }, | ||||
| onReady() { | onReady() { | ||||
| this.setData({ | this.setData({ | ||||
| videoContext: wx.createVideoContext('myVideo') | videoContext: wx.createVideoContext('myVideo') | ||||
| }) | }) | ||||
| this.itiRecording() | |||||
| }, | }, | ||||
| onLoad(options) { | onLoad(options) { | ||||
| if (app.globalData.token) { | if (app.globalData.token) { | ||||
| @@ -443,10 +482,13 @@ Page({ | |||||
| duration: 0, | duration: 0, | ||||
| // timingFunction: "ease", | // timingFunction: "ease", | ||||
| }); | }); | ||||
| animation.opacity(0).step() | |||||
| animation.translateX(400).step() | |||||
| this.setData({ | this.setData({ | ||||
| showAddBox:animation.export(), | |||||
| showAddBox: animation.export(), | |||||
| screenFlag:false,//初始化防录屏弹框 | |||||
| }) | }) | ||||
| // this.itiRecording() | |||||
| }, | }, | ||||
| onShareAppMessage: function (shareOption) { | onShareAppMessage: function (shareOption) { | ||||
| console.log(this.data.data.dyTitle); | console.log(this.data.data.dyTitle); | ||||
| @@ -3,9 +3,9 @@ | |||||
| <navbar home back text="{{classTitle}}" background="#0E1119" color="#fff"></navbar> | <navbar home back text="{{classTitle}}" background="#0E1119" color="#fff"></navbar> | ||||
| <prompt bind:hie="cancel" url="/pages/order/order" tt:if="{{showHie}}" titil="提示" text="您有已存在的订单" assistant="取消" advocate="去查看"></prompt> | <prompt bind:hie="cancel" url="/pages/order/order" tt:if="{{showHie}}" titil="提示" text="您有已存在的订单" assistant="取消" advocate="去查看"></prompt> | ||||
| <view style="height:{{navigationBarHeight}} "></view> | <view style="height:{{navigationBarHeight}} "></view> | ||||
| <video id="myVideo" bindtimeupdate="time" controls="{{btnSuspend}}" src="{{mp4Url}}"></video> | |||||
| <cover-view class="coverPay" tt:if="{{goPayFlag&&ifPay!='ios'}}" bindtap="goPay">¥ {{data.salePriceStr}} 购买</cover-view> | |||||
| <cover-view class="noCoverPay" tt:if="{{goPayFlag&&ifPay=='ios'}}" >暂不支持购买</cover-view> | |||||
| <video direction="{{direction}}" id="myVideo" bindtimeupdate="time" controls="{{btnSuspend}}" src="{{mp4Url}}"></video> | |||||
| <cover-view class="coverPay" tt:if="{{goPayFlag&&signal!='ios'}}" bindtap="goPay">¥ {{data.salePriceStr}} 购买</cover-view> | |||||
| <cover-view class="noCoverPay" tt:if="{{goPayFlag&&signal=='ios'}}" >暂不支持购买</cover-view> | |||||
| <view class="showContBox oh"> | <view class="showContBox oh"> | ||||
| <view class="titleBox"> | <view class="titleBox"> | ||||
| <view class="title">{{data.title}}</view> | <view class="title">{{data.title}}</view> | ||||
| @@ -178,11 +178,14 @@ | |||||
| <image class="consult" src="{{imgHttps+'details_bat_zx.png'}}" mode=""/> | <image class="consult" src="{{imgHttps+'details_bat_zx.png'}}" mode=""/> | ||||
| <button class="service" open-type="contact" > 咨询 </button> | <button class="service" open-type="contact" > 咨询 </button> | ||||
| <view class="shopping" bindtap="goPay" tt:if="{{ifPay!='ios'&&!data.view}}">¥{{data.salePriceStr}}</view> | |||||
| <view class="nOshopping" bindtap="showIos" tt:if="{{ifPay=='ios'&&!data.view}}">¥{{data.salePriceStr}}</view> | |||||
| <view class="shopping" bindtap="goPay" tt:if="{{signal!='ios'&&!data.view}}">¥{{data.salePriceStr}}</view> | |||||
| <view class="nOshopping" bindtap="showIos" tt:if="{{signal=='ios'&&!data.view}}">¥{{data.salePriceStr}}</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <!-- <view class="temp"></view> --> | <!-- <view class="temp"></view> --> | ||||
| <prompt bind:hie="cancelIos" tt:if="{{showIos}}" titil="提示" text="Ios当前暂不支持购买" hidText="确定" ></prompt> | <prompt bind:hie="cancelIos" tt:if="{{showIos}}" titil="提示" text="Ios当前暂不支持购买" hidText="确定" ></prompt> | ||||
| <view class="screenBox" tt:if="{{screenFlag}}"> | |||||
| <view class="screenText">由于版权原因,此内容不支持iOS录屏</view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| @@ -219,7 +219,7 @@ | |||||
| position: fixed; | position: fixed; | ||||
| right: 0; | right: 0; | ||||
| bottom: 274rpx; | bottom: 274rpx; | ||||
| z-index: 100000000000000000; | |||||
| z-index: 10000; | |||||
| } | } | ||||
| .addBox{ | .addBox{ | ||||
| padding: 0 40rpx; | padding: 0 40rpx; | ||||
| @@ -674,3 +674,30 @@ button { | |||||
| top: 200px; | top: 200px; | ||||
| left: 0; | left: 0; | ||||
| } | } | ||||
| .screenBox{ | |||||
| width: 100%; | |||||
| height: 100vh; | |||||
| background-color: rgba( 0, 0, 0, 0.4); | |||||
| position: fixed; | |||||
| top: 0; | |||||
| left: 0; | |||||
| font-size: 1000000000000; | |||||
| } | |||||
| .screenText{ | |||||
| width: 40%; | |||||
| padding: 30rpx 10px; | |||||
| border-radius: 10rpx; | |||||
| text-align: center; | |||||
| line-height: 40rpx; | |||||
| font-size: 30rpx; | |||||
| background-color: #ffffff; | |||||
| color: #535E75; | |||||
| font-size: 24rpx; | |||||
| margin: 50% auto; | |||||
| } | |||||
| rich-text img{ | |||||
| /* width: 100%; */ | |||||
| max-width: 100%; | |||||
| /* max-height: 400rpx; */ | |||||
| } | |||||
| @@ -46,7 +46,7 @@ Page({ | |||||
| }); | }); | ||||
| }}).catch(err=>{ | }}).catch(err=>{ | ||||
| tt.showToast({ | tt.showToast({ | ||||
| title: err.message, // 内容 | |||||
| title: err.message?err.message:err.data, | |||||
| icon:"none" | icon:"none" | ||||
| }); | }); | ||||
| }) | }) | ||||
| @@ -64,6 +64,9 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| search() { | search() { | ||||
| tt.showLoading({ | |||||
| title: '加载中...', // 内容 | |||||
| }); | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.getOrderLsit, | url: config.api.getOrderLsit, | ||||
| data: { | data: { | ||||
| @@ -85,6 +88,13 @@ Page({ | |||||
| list: res.data.list | list: res.data.list | ||||
| }) | }) | ||||
| } | } | ||||
| tt.hideLoading(); | |||||
| }).catch(err=>{ | |||||
| tt.hideLoading(); | |||||
| tt.showToast({ | |||||
| title: err.message?err.message:err.data, // 内容 | |||||
| icon:"none" | |||||
| }); | |||||
| }) | }) | ||||
| }, | }, | ||||
| onLoad() { | onLoad() { | ||||
| @@ -124,6 +124,7 @@ | |||||
| </navigator> | </navigator> | ||||
| <view class="noDataBox" tt:if="{{list.length==0}}" > | <view class="noDataBox" tt:if="{{list.length==0}}" > | ||||
| <image class="noDataImg" src="{{imgHttps+'no_content.png'}}" mode="" /> | <image class="noDataImg" src="{{imgHttps+'no_content.png'}}" mode="" /> | ||||
| <view class="noDataText">您暂未购买此课程!</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -168,7 +168,7 @@ | |||||
| width: 350rpx; | width: 350rpx; | ||||
| height: 40rpx; | height: 40rpx; | ||||
| line-height: 40rpx; | line-height: 40rpx; | ||||
| font-size: 36rpx; | |||||
| font-size: 32rpx; | |||||
| font-family: PingFang SC; | font-family: PingFang SC; | ||||
| font-weight: 500; | font-weight: 500; | ||||
| color: #FEFEFE; | color: #FEFEFE; | ||||
| @@ -195,27 +195,34 @@ | |||||
| -webkit-line-clamp:1; | -webkit-line-clamp:1; | ||||
| } | } | ||||
| .moreBox{ | .moreBox{ | ||||
| width: 340rpx; | |||||
| margin-top: 30rpx; | margin-top: 30rpx; | ||||
| position: relative; | position: relative; | ||||
| } | } | ||||
| .user{ | .user{ | ||||
| float: left; | |||||
| width: 60rpx; | |||||
| height: 60rpx; | |||||
| position: absolute; | |||||
| width: 50rpx; | |||||
| height: 50rpx; | |||||
| border-radius: 50%; | border-radius: 50%; | ||||
| background-color: beige; | |||||
| top: 0; | |||||
| left: 0; | |||||
| } | } | ||||
| .userText{ | .userText{ | ||||
| width: 200rpx; | |||||
| text-align: center; | |||||
| height: 60rpx; | |||||
| line-height: 60rpx; | |||||
| background: #222735; | |||||
| padding-left:70rpx ; | |||||
| padding-right:50rpx ; | |||||
| float: left; | |||||
| border-radius: 50rpx; | border-radius: 50rpx; | ||||
| font-family: PingFang SC; | |||||
| font-weight: 500; | |||||
| font-size: 26rpx; | |||||
| color: #8790A8; | |||||
| height: 50rpx; | |||||
| background-color: #333; | |||||
| text-align: center; | |||||
| line-height: 50rpx; | |||||
| color: #9999cc; | |||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .show{ | .show{ | ||||
| position: absolute; | position: absolute; | ||||
| @@ -242,6 +249,12 @@ | |||||
| height: 400rpx; | height: 400rpx; | ||||
| margin-top: 200rpx; | margin-top: 200rpx; | ||||
| } | } | ||||
| .noDataText{ | |||||
| position: absolute; | |||||
| color: #9999cc; | |||||
| top: 730rpx; | |||||
| left: 35%; | |||||
| } | |||||
| .instrumentBox{ | .instrumentBox{ | ||||
| width: 100%; | width: 100%; | ||||
| background: #1F232E; | background: #1F232E; | ||||
| @@ -1,5 +1,6 @@ | |||||
| const app = getApp() | const app = getApp() | ||||
| const config = require("../../config/config") | const config = require("../../config/config") | ||||
| const { log } = require("../../utils/HttpBasics.js") | |||||
| const Http = require("../../utils/HttpBasics.js") | const Http = require("../../utils/HttpBasics.js") | ||||
| const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | ||||
| const convert = require("../../utils/util.js") | const convert = require("../../utils/util.js") | ||||
| @@ -29,11 +30,18 @@ Page({ | |||||
| }); | }); | ||||
| }, | }, | ||||
| goPublicity(e) { | goPublicity(e) { | ||||
| let id = e.currentTarget.dataset.id | let id = e.currentTarget.dataset.id | ||||
| let type = e.currentTarget.dataset.type | let type = e.currentTarget.dataset.type | ||||
| tt.navigateTo({ | |||||
| url: `/pages/publicity/publicity?id=${id}&type=${type}` // 指定页面的url | |||||
| }); | |||||
| if(type==4){ | |||||
| tt.navigateTo({ | |||||
| url: `/pages/upEnter/upEnter` // 指定页面的url | |||||
| }); | |||||
| }else{ | |||||
| tt.navigateTo({ | |||||
| url: `/pages/publicity/publicity?id=${id}&type=${type}` // 指定页面的url | |||||
| }); | |||||
| } | |||||
| }, | }, | ||||
| getNweDataLsit() {//今天推荐 | getNweDataLsit() {//今天推荐 | ||||
| Http.get({ | Http.get({ | ||||
| @@ -150,7 +158,7 @@ Page({ | |||||
| url: config.api.getAuthor, | url: config.api.getAuthor, | ||||
| data: { | data: { | ||||
| pageNum: this.data.authoPageNum, | pageNum: this.data.authoPageNum, | ||||
| pageSize: 4, | |||||
| pageSize: 7, | |||||
| mark: 1, | mark: 1, | ||||
| sortColumn: "markTime", | sortColumn: "markTime", | ||||
| sortOrder: "desc" | sortOrder: "desc" | ||||
| @@ -1,95 +1,79 @@ | |||||
| <view id="BoxBg"> | <view id="BoxBg"> | ||||
| <view class="Box"> | |||||
| <navbar text="首页" background="#0E1119" color="#fff"></navbar> | |||||
| <view style="height:{{navigationBarHeight}} "></view> | |||||
| <view class="searchBox"> | |||||
| <navigator class="searchF" url="/pages/search/search" open-type="" hover-class="className"> | |||||
| <image class="searchLogo" src="{{imgHttps+'home_ic_ss.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="searchText" style="color: #666666;">搜索</view> | |||||
| </navigator> | |||||
| </view> | |||||
| <view class="Box"> | |||||
| <navbar text="首页" background="#0E1119" color="#fff"></navbar> | |||||
| <view style="height:{{navigationBarHeight}} "></view> | |||||
| <view class="searchBox"> | |||||
| <navigator class="searchF" url="/pages/search/search" open-type="" hover-class="className"> | |||||
| <image class="searchLogo" src="{{imgHttps+'home_ic_ss.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="searchText" style="color: #666666;">搜索</view> | |||||
| </navigator> | |||||
| </view> | |||||
| <view class="topBox"> | |||||
| <view class="TopNavigationBox"> | |||||
| <view class="item" tt:for="{{column}}" bindtap="setTopFlag" data-index="{{index}}" data-itemid="{{item.id}}"> | |||||
| <view class=" {{index==topFlag?'title_a':'title'}}">{{item.title}}</view> | |||||
| <view class="wire" tt:if="{{index==topFlag}}"></view> | |||||
| </view> | |||||
| </view> | |||||
| <image class="logo" src="{{imgHttps+'home_ic_saixuan.png'}}" bindtap="setTopFlag" data-itemid=" "></image> | |||||
| <view class="topBox"> | |||||
| <view class="TopNavigationBox"> | |||||
| <view class="item" tt:for="{{column}}" bindtap="setTopFlag" data-index="{{index}}" data-itemid="{{item.id}}"> | |||||
| <view class=" {{index==topFlag?'title_a':'title'}}">{{item.title}}</view> | |||||
| <view class="wire" tt:if="{{index==topFlag}}"></view> | |||||
| </view> | </view> | ||||
| </view> | |||||
| <image class="logo" src="{{imgHttps+'home_ic_saixuan.png'}}" bindtap="setTopFlag" data-itemid=" "></image> | |||||
| </view> | |||||
| <view class="swiperBox" tt:if="{{swiperLsit.length!=0}}"> | |||||
| <swiper class="swiper" indicator-dots="ture" indicator-color="rgba(255,255,255,.3)" | |||||
| indicator-active-color="rgba(255,255,255,1)" autoplay="ture" current="0" interval="5000" | |||||
| duration="{{1000}}" circular="false" previous-margin="false" display-multiple-items="1" | |||||
| skip-hidden-item-layout="false" vertical="{{false}}"> | |||||
| <swiper-item class="swiper-item" item-id="" tt:for="{{swiperLsit}}" bindtap="goPublicity" data-type="{{item.type}}" data-id="{{item.id}}"> | |||||
| <image class="swiperImg" src="{{item.coverImg}}" mode="" /> | |||||
| </swiper-item> | |||||
| </swiper> | |||||
| <view class="swiperBox" tt:if="{{swiperLsit.length!=0}}"> | |||||
| <swiper class="swiper" indicator-dots="ture" indicator-color="rgba(255,255,255,.3)" indicator-active-color="rgba(255,255,255,1)" autoplay="ture" current="0" interval="5000" duration="{{1000}}" circular="false" previous-margin="false" display-multiple-items="1" skip-hidden-item-layout="false" vertical="{{false}}"> | |||||
| <swiper-item class="swiper-item" item-id="" tt:for="{{swiperLsit}}" bindtap="goPublicity" data-type="{{item.type}}" data-id="{{item.id}}"> | |||||
| <image class="swiperImg" src="{{item.coverImg}}" mode="" /> | |||||
| </swiper-item> | |||||
| </swiper> | |||||
| </view> | |||||
| <view class="columnBox"> | |||||
| <navigator class="columnItem" target="" url="/pages/ranking/ranking?type=1&titilText=最新上架" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_zxsj.png'}}" class="columnImg"> </image> | |||||
| <view class="columnText"> | |||||
| 最新上架 | |||||
| </view> | </view> | ||||
| <view class="columnBox"> | |||||
| <navigator class="columnItem" target="" url="/pages/ranking/ranking?type=1&titilText=最新上架" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_zxsj.png'}}" class="columnImg"> | |||||
| </image> | |||||
| <view class="columnText"> | |||||
| 最新上架 | |||||
| </view> | |||||
| </navigator> | |||||
| <navigator class="columnItem" target="" url="/pages/ranking/ranking?type=2&titilText=精选课程" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_jxkc.png'}}" class="columnImg" > | |||||
| </image> | |||||
| <view class="columnText"> | |||||
| 精选课程 | |||||
| </view> | |||||
| </navigator> | |||||
| <navigator class="columnItem" target="" url="/pages/ranking/ranking?type=3&titilText=排行榜" hover-class="navigator-hover" | |||||
| open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_phb.png'}}" class="columnImg" > | |||||
| </image> | |||||
| <view class="columnText"> | |||||
| 排行榜 | |||||
| </view> | |||||
| </navigator> | |||||
| <navigator class="columnItem" target="" url="/pages/category/category" hover-class="navigator-hover" | |||||
| open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_qbfl.png'}}" class="columnImg" > | |||||
| </image> | |||||
| <view class="columnText"> | |||||
| 全部分类 | |||||
| </view> | |||||
| </navigator> | |||||
| </navigator> | |||||
| <navigator class="columnItem" target="" url="/pages/ranking/ranking?type=2&titilText=精选课程" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_jxkc.png'}}" class="columnImg"> </image> | |||||
| <view class="columnText"> | |||||
| 精选课程 | |||||
| </view> | </view> | ||||
| <!-- 今日推荐--> | |||||
| <view class="deyBox" tt:if="{{deyList.length!=0}}"> | |||||
| <view class="deyTitleBox"> | |||||
| <image class="deyTitleImg" src="{{imgHttps+'home_tab_ic_jrtj.png'}}" | |||||
| mode="" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="deyTitle"> | |||||
| 今日推荐 | |||||
| </view> | |||||
| </view> | |||||
| <view class="deyImgBox"> | |||||
| <view class="imgBox" tt:for="{{deyList}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="imgitem"> | |||||
| <image class="img" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="posClass"> | |||||
| {{item.businessName}} | |||||
| </view> | |||||
| </view> | |||||
| <view class="itemTitle"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| </view> | |||||
| </navigator> | |||||
| <navigator class="columnItem" target="" url="/pages/ranking/ranking?type=3&titilText=排行榜" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_phb.png'}}" class="columnImg"> </image> | |||||
| <view class="columnText"> | |||||
| 排行榜 | |||||
| </view> | |||||
| </navigator> | |||||
| <navigator class="columnItem" target="" url="/pages/category/category" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image src="{{imgHttps+'home_nav_ic_qbfl.png'}}" class="columnImg"> </image> | |||||
| <view class="columnText"> | |||||
| 全部分类 | |||||
| </view> | |||||
| </navigator> | |||||
| </view> | |||||
| <!-- 今日推荐--> | |||||
| <view class="deyBox" tt:if="{{deyList.length!=0}}"> | |||||
| <view class="deyTitleBox"> | |||||
| <image class="deyTitleImg" src="{{imgHttps+'home_tab_ic_jrtj.png'}}" mode="" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="deyTitle"> | |||||
| 今日推荐 | |||||
| </view> | |||||
| </view> | |||||
| <view class="deyImgBox"> | |||||
| <view class="imgBox" tt:for="{{deyList}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="imgitem"> | |||||
| <image class="img" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="posClass"> | |||||
| {{item.businessName}} | |||||
| </view> | </view> | ||||
| <!-- <view class="exchangeBox"> | |||||
| </view> | |||||
| <view class="itemTitle"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- <view class="exchangeBox"> | |||||
| <image class="exchangeImg" src="{{imgHttps+'home_ic_hyh.png'}}" mode="aspectFit|aspectFill|widthFix" | <image class="exchangeImg" src="{{imgHttps+'home_ic_hyh.png'}}" mode="aspectFit|aspectFill|widthFix" | ||||
| lazy-load="false" binderror="" bindload="" /> | lazy-load="false" binderror="" bindload="" /> | ||||
| <view class="exchangeText"> | <view class="exchangeText"> | ||||
| @@ -97,80 +81,66 @@ | |||||
| </view> | </view> | ||||
| </view> --> | </view> --> | ||||
| </view> | |||||
| <!-- 精选内容--> | |||||
| <view class="handpickBox" tt:if="{{classLsit.length!=0}}"> | |||||
| <view class="handpickTop"> | |||||
| <image class="handpickImg" src="{{imgHttps+'home_tab_ic_jxnr.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="handpickText"> | |||||
| 精选内容 | |||||
| </view> | </view> | ||||
| <!-- 精选内容--> | |||||
| <view class="handpickBox" tt:if="{{classLsit.length!=0}}"> | |||||
| <view class="handpickTop"> | |||||
| <image class="handpickImg" src="{{imgHttps+'home_tab_ic_jxnr.png'}}" | |||||
| mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="handpickText"> | |||||
| 精选内容 | |||||
| </view> | |||||
| </view> | |||||
| <view class="commodityBox" tt:for="{{classLsit}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="commodityImg"> | |||||
| <image class="classBoxImg" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="newPopularity oh"> | |||||
| <image class="popularityImg" style="margin-left: 30rpx;" src="{{imgHttps+'home_ic_renq.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="popularityText"> | |||||
| 最近人气 | |||||
| </view> | </view> | ||||
| <view class="commodityBox" tt:for="{{classLsit}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="commodityImg"> | |||||
| <image class="classBoxImg" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="newPopularity oh"> | |||||
| <image class="popularityImg" style="margin-left: 30rpx;" src="{{imgHttps+'home_ic_renq.png'}}" | |||||
| mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="popularityText"> | |||||
| 最近人气 | |||||
| </view> | |||||
| <view class="popularityNum"> | |||||
| {{item.popularity}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="describeBox"> | |||||
| <view class="describeBame"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="authorBox1"> | |||||
| <view class="oh" style=" position: relative;"> | |||||
| <image class="headImg" src="{{item.merchantPic}}" mode="" /> | |||||
| <view class="annotation"> | |||||
| {{item.merchantName}} | |||||
| </view> | |||||
| </view> | |||||
| <view class="priceBox"> | |||||
| <view class="priceF" tt:if="{{item.salePriceStr!=0}}"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr!=0}}"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr==0}}"> | |||||
| 免费 | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="popularityNum"> | |||||
| {{item.popularity}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="describeBox"> | |||||
| <view class="describeBame"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="authorBox1"> | |||||
| <view class="oh" style="position: relative;"> | |||||
| <image class="headImg" src="{{item.merchantPic}}" mode="" /> | |||||
| <view class="annotation"> | |||||
| {{item.merchantName}} | |||||
| </view> | |||||
| </view> | |||||
| <view class="priceBox"> | |||||
| <view class="priceF" tt:if="{{item.salePriceStr!=0}}"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr!=0}}"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr==0}}"> | |||||
| 免费 | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="extendBox"> | |||||
| <navigator class="extendMoreBox oh" target="" url="/pages/ranking/ranking?type=2&titilText=精选课程" hover-class="navigator-hover" | |||||
| open-type="navigate"> | |||||
| <image | |||||
| style="width: 40rpx;height: 40rpx;margin-top: 15rpx;margin-left: 80rpx;float: left; color: #8790A8;font-size: 30rpx;" | |||||
| src="{{imgHttps+'home_ic_ckgd.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" | |||||
| binderror="" bindload="" /> | |||||
| <view style="line-height: 70rpx;margin-left: 20rpx;float: left;"> | |||||
| 查看更多 | |||||
| </view> | |||||
| </navigator> | |||||
| <!-- <view class="changeBox"> | |||||
| <view class="extendBox"> | |||||
| <navigator class="extendMoreBox oh" target="" url="/pages/ranking/ranking?type=2&titilText=精选课程" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image style="width: 40rpx; height: 40rpx; margin-top: 15rpx; margin-left: 80rpx; float: left; color: #8790a8; font-size: 30rpx;" src="{{imgHttps+'home_ic_ckgd.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view style="line-height: 70rpx; margin-left: 20rpx; float: left;"> | |||||
| 查看更多 | |||||
| </view> | |||||
| </navigator> | |||||
| <!-- <view class="changeBox"> | |||||
| <image | <image | ||||
| style="width: 40rpx;height: 40rpx;margin-top: 15rpx;margin-left: 80rpx;float: left; color: #8790A8;font-size: 30rpx;" | style="width: 40rpx;height: 40rpx;margin-top: 15rpx;margin-left: 80rpx;float: left; color: #8790A8;font-size: 30rpx;" | ||||
| src="{{imgHttps+'home_ic_hyh.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" | src="{{imgHttps+'home_ic_hyh.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" | ||||
| @@ -180,83 +150,63 @@ | |||||
| </view> | </view> | ||||
| </view> --> | </view> --> | ||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!--推荐作者 --> | |||||
| <view class="deyBox author" tt:if="{{autho.length!=0}}"> | |||||
| <view class="deyTitleBox"> | |||||
| <image class="authorImg" src="{{imgHttps+'home_tab_tjzz.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="deyTitle"> | |||||
| 推荐作者 | |||||
| </view> | </view> | ||||
| <!--推荐作者 --> | |||||
| <view class="deyBox author" tt:if="{{autho.length!=0}}"> | |||||
| <view class="deyTitleBox"> | |||||
| <image class="authorImg" src="{{imgHttps+'home_tab_tjzz.png'}}" mode="aspectFit|aspectFill|widthFix" | |||||
| lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="deyTitle"> | |||||
| 推荐作者 | |||||
| </view> | |||||
| </view> | |||||
| <view class="authorBox"> | |||||
| <navigator class="authorItem" tt:for="{{autho}}" url="/pages/UpHome/UpHome?id={{item.id}}&name={{item.name}}" open-type="" hover-class="className"> | |||||
| <image class="authorImgTop" src="{{item.imgUrl}}" mode="" /> | |||||
| <view class="nameBox"> | |||||
| <view class="authorName"> | |||||
| {{item.name}} | |||||
| </view> | </view> | ||||
| <view class="authorText"> | |||||
| {{item.authoRemark}} | |||||
| </view> | |||||
| </view> | |||||
| </navigator> | |||||
| </view> | |||||
| </view> | |||||
| <view class="authorBox"> | |||||
| <navigator class="authorItem" tt:for="{{autho}}" url="/pages/UpHome/UpHome?id={{item.id}}&name={{item.name}}" open-type="" hover-class="className"> | |||||
| <image class="authorImgTop" src="{{item.imgUrl}}" mode="" /> | |||||
| <view class="nameBox"> | |||||
| <view class="authorName"> | |||||
| {{item.name}} | |||||
| </view> | |||||
| <view class="authorText"> | |||||
| {{item.authoRemark}} | |||||
| </view> | |||||
| </view> | |||||
| </navigator> | |||||
| </view> | |||||
| <view class="rankingBox" tt:if="{{rankingList.length!=0}}"> | |||||
| <view class="handpickTop"> | |||||
| <image class="handpickImg" src="{{imgHttps+'home_tab_ic_rmph.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="handpickText"> | |||||
| 热门排行 | |||||
| </view> | </view> | ||||
| <view class="rankingBox" tt:if="{{rankingList.length!=0}}"> | |||||
| <view class="handpickTop"> | |||||
| <image class="handpickImg" src="{{imgHttps+'home_tab_ic_rmph.png'}}" | |||||
| mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="handpickText"> | |||||
| 热门排行 | |||||
| </view> | |||||
| </view> | |||||
| <view class="sortBox"> | |||||
| <view class="sortItemBox" tt:for="{{rankingList}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="sortItemImg"> | |||||
| <image class="" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="{{index <=3?'sortNumBj_'+index:'sortNumBj_3'}}"> | |||||
| {{index+1}} | |||||
| </view> | </view> | ||||
| <view class="sortBox"> | |||||
| <view class="sortItemBox" tt:for="{{rankingList}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="sortItemImg"> | |||||
| <image class="" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="{{index <=3?'sortNumBj_'+index:'sortNumBj_3'}}"> | |||||
| {{index+1}} | |||||
| </view> | |||||
| </view> | |||||
| <view class="sortTitle"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="popularityBox oh"> | |||||
| <image class="popularityImg" src="{{imgHttps+'home_ic_renq.png'}}" | |||||
| mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="popularityText"> | |||||
| 人 气 | |||||
| </view> | |||||
| <view class="popularityNum"> | |||||
| {{item.popularity}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="sortTitle"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="popularityBox oh"> | |||||
| <image class="popularityImg" src="{{imgHttps+'home_ic_renq.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="popularityText"> | |||||
| 人 气 | |||||
| </view> | </view> | ||||
| <!-- <view class="exchangeBox"> | |||||
| <view class="popularityNum"> | |||||
| {{item.popularity}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- <view class="exchangeBox"> | |||||
| <image class="exchangeImg" src="{{imgHttps+'home_ic_ckgd.png'}}" mode="aspectFit|aspectFill|widthFix" | <image class="exchangeImg" src="{{imgHttps+'home_ic_ckgd.png'}}" mode="aspectFit|aspectFill|widthFix" | ||||
| lazy-load="false" binderror="" bindload="" /> | lazy-load="false" binderror="" bindload="" /> | ||||
| <view class="exchangeText"> | <view class="exchangeText"> | ||||
| @@ -264,79 +214,64 @@ | |||||
| </view> | </view> | ||||
| </view> --> | </view> --> | ||||
| </view> | |||||
| </view> | |||||
| <view class="handpickBox" tt:if="{{deyList.length!=0}}"> | |||||
| <view class="handpickTop"> | |||||
| <image class="handpickImg" src="{{imgHttps+'home_tab_ic_new.png'}}" mode="aspectFit|aspectFill|widthFix" | |||||
| lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="handpickText"> | |||||
| 最新内容 | |||||
| </view> | |||||
| <view class="handpickBox" tt:if="{{deyList.length!=0}}"> | |||||
| <view class="handpickTop"> | |||||
| <image class="handpickImg" src="{{imgHttps+'home_tab_ic_new.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="handpickText"> | |||||
| 最新内容 | |||||
| </view> | |||||
| </view> | |||||
| <view class="commodityBox" tt:for="{{deyList}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="newCommodityImg"> | |||||
| <image class="commodityImage" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="newPopularity oh"> | |||||
| <image class="popularityImg" style="margin-left: 25rpx;" src="{{imgHttps+'home_ic_renq.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="popularityText"> | |||||
| 最近人气 | |||||
| </view> | </view> | ||||
| <view class="commodityBox" tt:for="{{deyList}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="newCommodityImg"> | |||||
| <image class="commodityImage" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="newPopularity oh"> | |||||
| <image class="popularityImg" style="margin-left: 25rpx;" src="{{imgHttps+'home_ic_renq.png'}}" | |||||
| mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="popularityText"> | |||||
| 最近人气 | |||||
| </view> | |||||
| <view class="popularityNum"> | |||||
| {{item.popularity}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="describeBox"> | |||||
| <view class="describeBame"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="authorBox1"> | |||||
| <view class="oh" style=" position: relative;"> | |||||
| <image class="headImg" src="{{item.merchantPic}}" mode="" /> | |||||
| <view class="annotation"> | |||||
| {{item.merchantName}} | |||||
| </view> | |||||
| </view> | |||||
| <view class="priceBox"> | |||||
| <view class="priceF" tt:if="{{item.salePriceStr!=0}}"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr!=0}}"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr==0}}"> | |||||
| 免费 | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="popularityNum"> | |||||
| {{item.popularity}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="describeBox"> | |||||
| <view class="describeBame"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="authorBox1"> | |||||
| <view class="oh" style="position: relative;"> | |||||
| <image class="headImg" src="{{item.merchantPic}}" mode="" /> | |||||
| <view class="annotation"> | |||||
| {{item.merchantName}} | |||||
| </view> | |||||
| </view> | |||||
| <view class="priceBox"> | |||||
| <view class="priceF" tt:if="{{item.salePriceStr!=0}}"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr!=0}}"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| <view class="price" tt:if="{{item.salePriceStr==0}}"> | |||||
| 免费 | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class="extendBox"> | |||||
| <navigator class="extendMoreBox oh" target="" url="/pages/ranking/ranking?type=1&titilText=最新上架" hover-class="navigator-hover" | |||||
| open-type="navigate"> | |||||
| <image | |||||
| style="width: 40rpx;height: 40rpx;margin-top: 15rpx;margin-left: 80rpx;float: left; color: #8790A8;font-size: 30rpx;" | |||||
| src="{{imgHttps+'home_ic_ckgd.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" | |||||
| binderror="" bindload="" /> | |||||
| <view style="line-height: 70rpx;margin-left: 20rpx;float: left;"> | |||||
| 查看更多 | |||||
| </view> | |||||
| </navigator> | |||||
| <!-- <view class="changeBox"> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="extendBox"> | |||||
| <navigator class="extendMoreBox oh" target="" url="/pages/ranking/ranking?type=1&titilText=最新上架" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image style="width: 40rpx; height: 40rpx; margin-top: 15rpx; margin-left: 80rpx; float: left; color: #8790a8; font-size: 30rpx;" src="{{imgHttps+'home_ic_ckgd.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> | |||||
| <view style="line-height: 70rpx; margin-left: 20rpx; float: left;"> | |||||
| 查看更多 | |||||
| </view> | |||||
| </navigator> | |||||
| <!-- <view class="changeBox"> | |||||
| <image | <image | ||||
| style="width: 40rpx;height: 40rpx;margin-top: 15rpx;margin-left: 80rpx;float: left; color: #8790A8;font-size: 30rpx;" | style="width: 40rpx;height: 40rpx;margin-top: 15rpx;margin-left: 80rpx;float: left; color: #8790A8;font-size: 30rpx;" | ||||
| src="{{imgHttps+'home_ic_hyh.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" | src="{{imgHttps+'home_ic_hyh.png'}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" | ||||
| @@ -346,13 +281,7 @@ | |||||
| </view> | </view> | ||||
| </view> --> | </view> --> | ||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -10,6 +10,7 @@ | |||||
| } | } | ||||
| .topBox{ | .topBox{ | ||||
| height: 70rpx; | height: 70rpx; | ||||
| line-height: 20rpx; | |||||
| color: #666666; | color: #666666; | ||||
| margin-top: 10rpx; | margin-top: 10rpx; | ||||
| } | } | ||||
| @@ -34,7 +35,9 @@ | |||||
| margin-left: 12rpx; | margin-left: 12rpx; | ||||
| } | } | ||||
| .item{ | .item{ | ||||
| width: 80rpx; | |||||
| /* width: 80rpx; */ | |||||
| height: 60rpx; | |||||
| height: 60rpx; | |||||
| margin: 0 20rpx; | margin: 0 20rpx; | ||||
| position: relative; | position: relative; | ||||
| display: inline-block; | display: inline-block; | ||||
| @@ -43,8 +46,10 @@ | |||||
| .title_a{ | .title_a{ | ||||
| font-size: 34rpx; | font-size: 34rpx; | ||||
| color: #00cc99; | color: #00cc99; | ||||
| padding-bottom: 10rpx; | |||||
| } | } | ||||
| .title{ | .title{ | ||||
| line-height: 60rpx; | |||||
| color: #666666; | color: #666666; | ||||
| } | } | ||||
| .wire{ | .wire{ | ||||
| @@ -367,6 +372,11 @@ overflow: hidden; | |||||
| text-align: center; | text-align: center; | ||||
| line-height: 50rpx; | line-height: 50rpx; | ||||
| color: #9999cc; | color: #9999cc; | ||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .introduce{ | .introduce{ | ||||
| width: 96%; | width: 96%; | ||||
| @@ -455,6 +465,11 @@ overflow: hidden; | |||||
| font-family: OPPOSans; | font-family: OPPOSans; | ||||
| font-weight: 500; | font-weight: 500; | ||||
| color: #FFFFFF; | color: #FFFFFF; | ||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1; | |||||
| } | } | ||||
| .authorText{ | .authorText{ | ||||
| width: 90%; | width: 90%; | ||||
| @@ -0,0 +1,41 @@ | |||||
| 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, | |||||
| list:[ | |||||
| { | |||||
| title:"积分充值", | |||||
| type: 1, | |||||
| id:123102410, | |||||
| tiem:"2020-11-03", | |||||
| num:2354121551, | |||||
| }, | |||||
| { | |||||
| title:"积分消费", | |||||
| type: 2, | |||||
| id:1231023234, | |||||
| tiem:"2020-10-03", | |||||
| num:23545, | |||||
| }, | |||||
| { | |||||
| title:"积分充值", | |||||
| type: 1, | |||||
| id:123104432, | |||||
| tiem:"2020-11-03", | |||||
| num:111, | |||||
| }, | |||||
| { | |||||
| title:"积分充值", | |||||
| type: 1, | |||||
| id:1231422342, | |||||
| tiem:"2020-11-03", | |||||
| num:23, | |||||
| }, | |||||
| ] | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "navigationBarTitleText": "我的积分", | |||||
| "usingComponents": { | |||||
| "navbar": "../../components/navbar/navbar" | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,29 @@ | |||||
| <view id="BoxBg"> | |||||
| <view class="Box"> | |||||
| <navbar back text="我的积分" background="#0E1119" color="#fff"></navbar> | |||||
| <view style="height:{{navigationBarHeight}} "></view> | |||||
| <view class="limit">积分余额</view> | |||||
| <view class="balance">20151111.20</view> | |||||
| <view class="detail"> 积分收支明细</view> | |||||
| <view class="itemBox oh" tt:for="{{list}}"> | |||||
| <view class="oh"> | |||||
| <view class="leftBox"> | |||||
| <view class="tpyeText">{{item.title}}</view> | |||||
| <view class="order">订单编号:{{item.id}}</view> | |||||
| <view class="orderTiem">{{item.tiem}}</view> | |||||
| </view> | |||||
| <view class="rightBox" tt:if="{{item.type==1}}"> | |||||
| +{{item.num}} | |||||
| </view> | |||||
| <view class="addright" tt:if="{{item.type==2}}"> | |||||
| -{{item.num}} | |||||
| </view> | |||||
| </view> | |||||
| <view class="segmentation"></view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -0,0 +1,61 @@ | |||||
| .Box{ | |||||
| /* overflow: hidden; */ | |||||
| } | |||||
| .limit{ | |||||
| font-size: 32rpx; | |||||
| text-align: center; | |||||
| font-weight: 600; | |||||
| color: #ffffff; | |||||
| margin-top: 20rpx; | |||||
| } | |||||
| .balance{ | |||||
| font-size: 38rpx; | |||||
| text-align: center; | |||||
| color: #07E881; | |||||
| font-weight: 600; | |||||
| margin-top: 20rpx; | |||||
| } | |||||
| .detail{ | |||||
| width: 90%; | |||||
| text-align: center; | |||||
| padding: 6rpx 0; | |||||
| color: #ffffff; | |||||
| margin: 10rpx auto; | |||||
| border-bottom: solid 1rpx #ffffff; | |||||
| font-size: 26rpx; | |||||
| } | |||||
| .itemBox{ | |||||
| width: 96%; | |||||
| margin: 20rpx 2%; | |||||
| color: #ffffff; | |||||
| overflow: hidden; | |||||
| } | |||||
| .leftBox{ | |||||
| float: left; | |||||
| height: 120rpx; | |||||
| } | |||||
| .order{ | |||||
| font-size: 26rpx; | |||||
| } | |||||
| .orderTiem{ | |||||
| font-size: 26rpx; | |||||
| } | |||||
| .rightBox{ | |||||
| line-height: 120rpx; | |||||
| float: right; | |||||
| color: #07E881; | |||||
| font-size: 34rpx; | |||||
| } | |||||
| .addright{ | |||||
| line-height: 120rpx; | |||||
| float: right; | |||||
| color: red; | |||||
| font-size: 34rpx; | |||||
| } | |||||
| .segmentation{ | |||||
| width: 80%; | |||||
| background-color: rgba(255,255,255,0.3); | |||||
| height: 1rpx; | |||||
| margin: 10rpx auto; | |||||
| } | |||||
| @@ -58,6 +58,9 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| search() { | search() { | ||||
| tt.showLoading({ | |||||
| title: '加载中...', // 内容 | |||||
| }); | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.mainCollet, | url: config.api.mainCollet, | ||||
| data: { | data: { | ||||
| @@ -78,6 +81,13 @@ Page({ | |||||
| list: res.data.list | list: res.data.list | ||||
| }) | }) | ||||
| } | } | ||||
| tt.hideLoading(); | |||||
| }).catch(err=>{ | |||||
| tt.hideLoading(); | |||||
| tt.showToast({ | |||||
| title: err.message?err.message:err.data, // 内容 | |||||
| icon:"none" | |||||
| }); | |||||
| }) | }) | ||||
| }, | }, | ||||
| onLoad() { | onLoad() { | ||||
| @@ -77,13 +77,17 @@ | |||||
| position: relative; | position: relative; | ||||
| } | } | ||||
| .user{ | .user{ | ||||
| float: left; | |||||
| position: absolute; | |||||
| width: 50rpx; | width: 50rpx; | ||||
| height: 50rpx; | height: 50rpx; | ||||
| border-radius: 50%; | border-radius: 50%; | ||||
| background-color: beige; | |||||
| top: 0; | |||||
| left: 0; | |||||
| } | } | ||||
| .userText{ | .userText{ | ||||
| padding-left:50rpx ; | |||||
| padding-right:20rpx ; | |||||
| width: 200rpx; | width: 200rpx; | ||||
| text-align: center; | text-align: center; | ||||
| height: 50rpx; | height: 50rpx; | ||||
| @@ -94,6 +98,11 @@ | |||||
| font-weight: 500; | font-weight: 500; | ||||
| font-size: 26rpx; | font-size: 26rpx; | ||||
| color: #8790A8; | color: #8790A8; | ||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .show{ | .show{ | ||||
| position: absolute; | position: absolute; | ||||
| @@ -2,7 +2,8 @@ const app = getApp() | |||||
| const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | ||||
| const config = require("../../config/config") | const config = require("../../config/config") | ||||
| const util = require("../../utils/util"); | const util = require("../../utils/util"); | ||||
| const Http = require("../../utils/HttpBasics.js") | |||||
| const Http = require("../../utils/HttpBasics.js"); | |||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| navigationBarHeight, | navigationBarHeight, | ||||
| @@ -115,7 +116,7 @@ Page({ | |||||
| }) | }) | ||||
| }).catch(err => { | }).catch(err => { | ||||
| tt.showToast({ | tt.showToast({ | ||||
| title: '唤起支付失败', // 内容 | |||||
| title: err.message?err.message:err.data, // 内容 | |||||
| icon: "none" | icon: "none" | ||||
| }); | }); | ||||
| }) | }) | ||||
| @@ -135,7 +136,6 @@ Page({ | |||||
| } else {//已支付 | } else {//已支付 | ||||
| tempArr.push(...[2, 4, 5, 6]) | tempArr.push(...[2, 4, 5, 6]) | ||||
| } | } | ||||
| console.log(tempArr); | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.getOrderLsit, | url: config.api.getOrderLsit, | ||||
| data: { | data: { | ||||
| @@ -149,13 +149,11 @@ Page({ | |||||
| item.createDate = util.formatTime(item.createDate, "yyyy-MM-dd hh:mm:ss") | item.createDate = util.formatTime(item.createDate, "yyyy-MM-dd hh:mm:ss") | ||||
| }) | }) | ||||
| if(this.data.pageNum>1){ | if(this.data.pageNum>1){ | ||||
| let tempLsit = this.data.orderLsit | let tempLsit = this.data.orderLsit | ||||
| let tempArr = tempLsit.push(...arr) | |||||
| let tempArrLsit = [...tempLsit,...arr] | |||||
| this.setData({ | this.setData({ | ||||
| orderLsit:tempArr, | |||||
| noDAtaFlag:tempArr.length==0?true: false, | |||||
| orderLsit:tempArrLsit, | |||||
| noDAtaFlag:tempArrLsit.length==0?true: false, | |||||
| }) | }) | ||||
| }else{ | }else{ | ||||
| this.setData({ | this.setData({ | ||||
| @@ -101,6 +101,11 @@ text-align: center; | |||||
| text-align: center; | text-align: center; | ||||
| line-height: 50rpx; | line-height: 50rpx; | ||||
| color: #9999cc; | color: #9999cc; | ||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .name{ | .name{ | ||||
| width: 220rpx; | width: 220rpx; | ||||
| @@ -2,7 +2,7 @@ const app = getApp() | |||||
| const config = require("../../config/config") | const config = require("../../config/config") | ||||
| const Http = require("../../utils/HttpBasics.js") | const Http = require("../../utils/HttpBasics.js") | ||||
| const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" | const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" | ||||
| var WxParse = require('../../wxParse/wxParse.js'); | |||||
| // var WxParse = require('../../wxParse/wxParse.js'); | |||||
| const convert = require("../../utils/util.js") | const convert = require("../../utils/util.js") | ||||
| Page({ | Page({ | ||||
| data:{ | data:{ | ||||
| @@ -33,22 +33,6 @@ Page({ | |||||
| }); | }); | ||||
| }) | }) | ||||
| }, | }, | ||||
| 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){//跳转详情 | goXq(e){//跳转详情 | ||||
| let id = e.currentTarget.dataset.id | let id = e.currentTarget.dataset.id | ||||
| let title = e.currentTarget.dataset.title | let title = e.currentTarget.dataset.title | ||||
| @@ -58,20 +42,18 @@ Page({ | |||||
| }); | }); | ||||
| }, | }, | ||||
| onLoad:function (params) { | onLoad:function (params) { | ||||
| const that = this; | |||||
| console.log(params.id); | |||||
| if(params.id &¶ms.type==1){//宣传页 | if(params.id &¶ms.type==1){//宣传页 | ||||
| that.setData({ | |||||
| this.setData({ | |||||
| id:params.id, | id:params.id, | ||||
| type:params.type | type:params.type | ||||
| }) | }) | ||||
| that.getData() | |||||
| this.getData() | |||||
| }else if(params.id &¶ms.type==2){//图文 | }else if(params.id &¶ms.type==2){//图文 | ||||
| that.setData({ | |||||
| this.setData({ | |||||
| id:params.id, | id:params.id, | ||||
| type:params.type | type:params.type | ||||
| }) | }) | ||||
| that.getHtml(params.id,that) | |||||
| this.getData() | |||||
| } | } | ||||
| }, | }, | ||||
| }) | }) | ||||
| @@ -41,9 +41,12 @@ | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <import src="../../wxParse/wxParse.wxml" tt:if="{{type==2}}"/> | |||||
| <view class="richtextBox" tt:if="{{type==2}}"> | |||||
| <rich-text class="rich_text" nodes="{{allLsit.html}}"></rich-text> | |||||
| </view> | |||||
| <!-- <import src="../../wxParse/wxParse.wxml" tt:if="{{type==2}}"/> | |||||
| <view class="content" tt:if="{{type==2}}"> | <view class="content" tt:if="{{type==2}}"> | ||||
| <template is="wxParse" data="{{wxParseData:article.nodes}}" /> | <template is="wxParse" data="{{wxParseData:article.nodes}}" /> | ||||
| </view> | |||||
| </view> --> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -95,6 +95,11 @@ | |||||
| text-align: center; | text-align: center; | ||||
| line-height: 50rpx; | line-height: 50rpx; | ||||
| color: #9999cc; | color: #9999cc; | ||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .incomeBox{ | .incomeBox{ | ||||
| margin-top: 20rpx; | margin-top: 20rpx; | ||||
| @@ -176,4 +181,19 @@ | |||||
| line-height: 46rpx; | line-height: 46rpx; | ||||
| top: 0rpx; | top: 0rpx; | ||||
| left: 20rpx; | left: 20rpx; | ||||
| } | |||||
| .richtextBox{ | |||||
| margin-top: 40rpx; | |||||
| min-height: 120rpx; | |||||
| } | |||||
| .rich_text{ | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| } | |||||
| .rich_text p{ | |||||
| width: 100%; | |||||
| } | |||||
| rich-text img{ | |||||
| width: 100%; | |||||
| /* max-height: 400rpx; */ | |||||
| } | } | ||||
| @@ -91,6 +91,10 @@ | |||||
| text-align: center; | text-align: center; | ||||
| line-height: 50rpx; | line-height: 50rpx; | ||||
| color: #9999cc; | color: #9999cc; | ||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .incomeBox{ | .incomeBox{ | ||||
| margin-top: 10rpx; | margin-top: 10rpx; | ||||
| @@ -23,7 +23,6 @@ Page({ | |||||
| this.setData({ | this.setData({ | ||||
| activityFlag:index, | activityFlag:index, | ||||
| pageNum:1, | pageNum:1, | ||||
| inputValue:"", | |||||
| noDAtaFlag:false, | noDAtaFlag:false, | ||||
| list:[] | list:[] | ||||
| }) | }) | ||||
| @@ -44,6 +43,9 @@ Page({ | |||||
| this.search() | this.search() | ||||
| }, | }, | ||||
| search(){//查询 | search(){//查询 | ||||
| tt.showLoading({ | |||||
| title: '加载中...', // 内容 | |||||
| }); | |||||
| let url = "" | let url = "" | ||||
| let data="" | let data="" | ||||
| if(this.data.activityFlag==0){//课程 | if(this.data.activityFlag==0){//课程 | ||||
| @@ -66,7 +68,6 @@ Page({ | |||||
| data:data | data:data | ||||
| }).then(res=>{ | }).then(res=>{ | ||||
| let arr = [] | let arr = [] | ||||
| if(res.data.list!=0&&res.data.list[0].businessTypes){ | if(res.data.list!=0&&res.data.list[0].businessTypes){ | ||||
| arr = res.data.list | arr = res.data.list | ||||
| let sting = "" | let sting = "" | ||||
| @@ -82,45 +83,70 @@ Page({ | |||||
| }) | }) | ||||
| let tempArr = this.data.list | let tempArr = this.data.list | ||||
| if(this.data.pageNum>1){ | if(this.data.pageNum>1){ | ||||
| let contArr= tempArr.push(...arr) | |||||
| // let contArr= tempArr.push(...arr) | |||||
| this.setData({ | this.setData({ | ||||
| list:arr, | |||||
| noDAtaFlag:contArr.length==0?true:false | |||||
| list:[...tempArr,...res.data.list], | |||||
| }) | }) | ||||
| if(this.data.list.length==0){ | |||||
| this.setData({ | |||||
| noDAtaFlag:true | |||||
| }) | |||||
| }else{ | |||||
| this.setData({ | |||||
| noDAtaFlag:false | |||||
| }) | |||||
| } | |||||
| }else{ | }else{ | ||||
| this.setData({ | this.setData({ | ||||
| list:arr, | list:arr, | ||||
| noDAtaFlag:arr.length==0?true:false | noDAtaFlag:arr.length==0?true:false | ||||
| }) | }) | ||||
| } | } | ||||
| tt.hideLoading(); | |||||
| }else{ | }else{ | ||||
| if(this.pageNum>1){ | |||||
| if(this.data.pageNum>1){ | |||||
| let tempArr = this.data.list | let tempArr = this.data.list | ||||
| let contArr= tempArr.push(...res.data.list) | |||||
| // let contArr= tempArr.push(...res.data.list) | |||||
| // console.log(contArr,"contArr"); | |||||
| this.setData({ | this.setData({ | ||||
| list:tempArr, | |||||
| noDAtaFlag:contArr.length==0?true:false | |||||
| list:[...tempArr,...res.data.list], | |||||
| }) | }) | ||||
| if(this.data.list.length==0){ | |||||
| this.setData({ | |||||
| noDAtaFlag:true | |||||
| }) | |||||
| }else{ | |||||
| this.setData({ | |||||
| noDAtaFlag:false | |||||
| }) | |||||
| } | |||||
| }else{ | }else{ | ||||
| this.setData({ | this.setData({ | ||||
| list:res.data.list, | list:res.data.list, | ||||
| noDAtaFlag:res.data.list==0?true:false | noDAtaFlag:res.data.list==0?true:false | ||||
| }) | }) | ||||
| } | } | ||||
| tt.hideLoading(); | |||||
| } | } | ||||
| }).catch(err=>{ | |||||
| tt.hideLoading(); | |||||
| tt.showToast({ | |||||
| title: err.message?err.message:err.data, // 内容 | |||||
| icon:"none" | |||||
| }); | |||||
| }) | }) | ||||
| console.log(this.data.list); | |||||
| // console.log(this.data.list); | |||||
| }, | }, | ||||
| onLoad(){ | onLoad(){ | ||||
| this.search() | this.search() | ||||
| }, | }, | ||||
| onReachBottom:function(){ | onReachBottom:function(){ | ||||
| console.log("到底了"); | |||||
| this.setData({ | this.setData({ | ||||
| pageNum:this.data.pageNum+1 | pageNum:this.data.pageNum+1 | ||||
| }) | }) | ||||
| this.search() | |||||
| } | } | ||||
| }) | }) | ||||
| @@ -1,43 +1,43 @@ | |||||
| <view id="BoxBg"> | <view id="BoxBg"> | ||||
| <view class="Box"> | |||||
| <view class="Box"> | |||||
| <navbar back text="搜索" background="#0E1119" color="#fff"></navbar> | <navbar back text="搜索" background="#0E1119" color="#fff"></navbar> | ||||
| <view style="height:{{navigationBarHeight}} "></view> | |||||
| <view class="Hierecommend" > | |||||
| <view class="searchBox oh"> | |||||
| <view class="searchF"> | |||||
| <input type="text" class="searchText" placeholder-style="color: #666666;" placeholder="搜索" | |||||
| bindconfirm="search" bindinput="setSearchValue" confirm-type="search" /> | |||||
| </view> | |||||
| <view class="searchBtn" bindtap="searchBtn"> | |||||
| 搜索 | |||||
| </view> | |||||
| </view> | |||||
| <view class="recommendBox oh" tt:if="{{false}}"> | |||||
| <view class="recommendTitleBox oh"> | |||||
| <view class="recommendLogo"></view> | |||||
| <view class="recommendText">推荐搜索</view> | |||||
| </view> | |||||
| <view class="recommend oh" > | |||||
| <view class="recommendItem" tt:for="{{6}}"> | |||||
| 锻炼的协调,炼的协调炼的协调炼的协调 | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="author oh" tt:if="{{false}}"> | |||||
| <view style="height:{{navigationBarHeight}} "></view> | |||||
| <view class="Hierecommend"> | |||||
| <view class="searchBox oh"> | |||||
| <view class="searchF"> | |||||
| <input type="text" class="searchText" placeholder-style="color: #666666;" placeholder="搜索" bindconfirm="search" bindinput="setSearchValue" confirm-type="search" /> | |||||
| </view> | |||||
| <view class="searchBtn" bindtap="searchBtn"> | |||||
| 搜索 | |||||
| </view> | |||||
| </view> | |||||
| <view class="recommendBox oh" tt:if="{{false}}"> | |||||
| <view class="recommendTitleBox oh"> | |||||
| <view class="recommendLogo"></view> | |||||
| <view class="recommendText">推荐搜索</view> | |||||
| </view> | |||||
| <view class="recommend oh"> | |||||
| <view class="recommendItem" tt:for="{{6}}"> | |||||
| 锻炼的协调,炼的协调炼的协调炼的协调 | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- <view class="author oh" tt:if="{{false}}"> | |||||
| <view class="recommendTitleBox oh"> | <view class="recommendTitleBox oh"> | ||||
| <view class="recommendLogo"></view> | <view class="recommendLogo"></view> | ||||
| <view class="recommendText">推荐搜索</view> | <view class="recommendText">推荐搜索</view> | ||||
| </view> | </view> | ||||
| <view class="authorItemBox"> | <view class="authorItemBox"> | ||||
| <view class="authorItem" tt:for="{{6}}"> | <view class="authorItem" tt:for="{{6}}"> | ||||
| <view class="portrait"> | |||||
| <view class="oh" style="position: relative;"> | |||||
| <view class="portrait"> | |||||
| </view> | |||||
| <view class="name"> | |||||
| 张三 | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class="name"> | |||||
| 张三 | |||||
| </view> | |||||
| <view class="categoryBox oh"> | <view class="categoryBox oh"> | ||||
| <view class="categoryTtem" tt:for="{{2}}"> | <view class="categoryTtem" tt:for="{{2}}"> | ||||
| 金融 | 金融 | ||||
| @@ -46,99 +46,83 @@ | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> --> | |||||
| <view class="contentBox oh"> | |||||
| <view class="navigationBox oh"> | |||||
| <view class="course"> | |||||
| <view class="{{activityFlag==0?'titleA':'title'}} " bindtap="setActiviy" data-index="{{0}}"> | |||||
| 课程 | |||||
| </view> | |||||
| <view class="xian" tt:if="{{activityFlag==0}}"> </view> | |||||
| </view> | |||||
| <view class="cAuthor"> | |||||
| <view class="{{activityFlag==1?'titleA':'title'}} " bindtap="setActiviy" data-index="{{1}}"> | |||||
| 作者 | |||||
| </view> | </view> | ||||
| <view class="xian" tt:if="{{activityFlag==1}}"> </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="contentBox oh"> | |||||
| <view class="navigationBox oh"> | |||||
| <view class=" course"> | |||||
| <view class="{{activityFlag==0?'titleA':'title'}} " bindtap="setActiviy" data-index="{{0}}"> | |||||
| 课程 | |||||
| </view> | |||||
| <view class="xian" tt:if="{{activityFlag==0}}"> | |||||
| </view> | |||||
| </view> | |||||
| <view class="cAuthor"> | |||||
| <view class="{{activityFlag==1?'titleA':'title'}} " bindtap="setActiviy"data-index="{{1}}"> | |||||
| 作者 | |||||
| </view> | |||||
| <view class="xian" tt:if="{{activityFlag==1}}"> | |||||
| </view> | |||||
| </view> | |||||
| <view class="orderBidBox oh"> | |||||
| <view class="orderBox oh" tt:for="{{list}}" tt:if="{{activityFlag==0}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="classBox oh"> | |||||
| <image class="img" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="courseBox oh"> | |||||
| <view class="h3"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <view class="oh" style="position: relative;"> | |||||
| <image src="{{item.merchantPic}}" mode="" class="headImg" /> | |||||
| <view class="name"> | |||||
| {{item.merchantName}} | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class="orderBidBox oh"> | |||||
| <view class="orderBox oh" tt:for="{{list}}" tt:if="{{activityFlag==0}}" bindtap="goXq" data-id="{{item.id}}" data-title="{{item.title}}"> | |||||
| <view class="classBox oh" > | |||||
| <image class="img" src="{{item.coverImg}}" mode="" /> | |||||
| <view class="courseBox oh"> | |||||
| <view class="h3"> | |||||
| {{item.title}} | |||||
| </view> | |||||
| <image src="{{item.merchantPic}}" mode="" class="headImg" /> | |||||
| <view class="name"> | |||||
| {{item.merchantName}} | |||||
| </view> | |||||
| <view class="priceBox"> | |||||
| <view class="priceF"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="price"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <navigator url="/pages/UpHome/UpHome?id={{item.id}}&name={{item.name}}" class="authorBox oh" tt:if="{{activityFlag==1}}" tt:for="{{list}}"> | |||||
| <image class="userHead" src="{{item.imgUrl}}" mode="" /> | |||||
| <view class="userNameBox"> | |||||
| <view class="userName"> | |||||
| {{item.name}} | |||||
| </view> | |||||
| <view class="typeBox oh"> | |||||
| <view class="type"> | |||||
| {{item.authoRemark}} | |||||
| </view> | |||||
| <!-- <view class="shuXian"> | |||||
| <view class="priceBox"> | |||||
| <view class="priceF"> | |||||
| ¥ | |||||
| </view> | |||||
| <view class="price"> | |||||
| {{item.salePriceStr}} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <navigator url="/pages/UpHome/UpHome?id={{item.id}}&name={{item.name}}" class="authorBox oh" tt:if="{{activityFlag==1}}" tt:for="{{list}}"> | |||||
| <image class="userHead" src="{{item.imgUrl}}" mode="" /> | |||||
| <view class="userNameBox"> | |||||
| <view class="userName"> | |||||
| {{item.name}} | |||||
| </view> | |||||
| <view class="typeBox oh"> | |||||
| <view class="type"> | |||||
| {{item.authoRemark}} | |||||
| </view> | |||||
| <!-- <view class="shuXian"> | |||||
| </view> | </view> | ||||
| <view class="bean"> | <view class="bean"> | ||||
| 1058万粉丝 | 1058万粉丝 | ||||
| </view> --> | </view> --> | ||||
| </view> | |||||
| </view> | |||||
| <!-- <view class="attentionBox"> | |||||
| </view> | |||||
| </view> | |||||
| <!-- <view class="attentionBox"> | |||||
| + 关注 | + 关注 | ||||
| </view> --> | </view> --> | ||||
| <!-- <view class="attentionBoxHie"> | |||||
| <!-- <view class="attentionBoxHie"> | |||||
| 已关注 | 已关注 | ||||
| </view> --> | </view> --> | ||||
| </navigator> | |||||
| </navigator> | |||||
| <view class="noDataBox" tt:if="{{noDAtaFlag}}"> | |||||
| <image class="noDataImg" src="{{imgHttps+'no_result.png'}}" mode="" /> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="noDataBox" tt:if="{{noDAtaFlag}}"> | |||||
| <image class="noDataImg" src="{{imgHttps+'no_result.png'}}" mode="" /> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view> </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| @@ -1,5 +1,5 @@ | |||||
| .Box{ | .Box{ | ||||
| height: 100vh; | |||||
| /* height: 100vh; */ | |||||
| overflow: scroll; | overflow: scroll; | ||||
| min-height: 100vh; | min-height: 100vh; | ||||
| } | } | ||||
| @@ -92,13 +92,7 @@ | |||||
| border-radius: 50%; | border-radius: 50%; | ||||
| margin: 20rpx auto; | margin: 20rpx auto; | ||||
| } | } | ||||
| .name{ | |||||
| line-height: 72rpx; | |||||
| text-align: center; | |||||
| color: #ffffff; | |||||
| font-size: 36rpx; | |||||
| text-align: center; | |||||
| } | |||||
| .categoryBox{ | .categoryBox{ | ||||
| display: flex; | display: flex; | ||||
| justify-content: center; | justify-content: center; | ||||
| @@ -183,21 +177,30 @@ | |||||
| -webkit-line-clamp:1; | -webkit-line-clamp:1; | ||||
| } | } | ||||
| .headImg{ | .headImg{ | ||||
| position: absolute; | |||||
| width: 50rpx; | width: 50rpx; | ||||
| height: 50rpx; | height: 50rpx; | ||||
| border-radius: 50%; | border-radius: 50%; | ||||
| float: left; | |||||
| top: 0; | |||||
| left: 0; | |||||
| } | } | ||||
| .name{ | .name{ | ||||
| width: 220rpx; | |||||
| line-height: 50rpx; | |||||
| height: 50rpx; | |||||
| padding-left:70rpx ; | |||||
| padding-right:50rpx ; | |||||
| float: left; | |||||
| border-radius: 50rpx; | border-radius: 50rpx; | ||||
| color: #8790A8; | |||||
| height: 50rpx; | |||||
| background-color: #333; | |||||
| text-align: center; | text-align: center; | ||||
| background-color: #222735; | |||||
| font-size: 28rpx; | |||||
| line-height: 50rpx; | |||||
| color: #9999cc; | |||||
| overflow:hidden; | |||||
| text-overflow:ellipsis; | |||||
| display:-webkit-box; | |||||
| -webkit-box-orient:vertical; | |||||
| -webkit-line-clamp:1 | |||||
| } | } | ||||
| .priceBox{ | .priceBox{ | ||||
| /* margin-top: 20rpx; */ | /* margin-top: 20rpx; */ | ||||
| @@ -4,84 +4,172 @@ const config = require("../../config/config") | |||||
| const Http = require("../../utils/HttpBasics.js") | const Http = require("../../utils/HttpBasics.js") | ||||
| const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | ||||
| Page({ | Page({ | ||||
| data: { | |||||
| navigationBarHeight, | |||||
| imgHttps: app.globalData.imgHttps, | |||||
| userData: "", | |||||
| }, | |||||
| data: { | |||||
| navigationBarHeight, | |||||
| imgHttps: app.globalData.imgHttps, | |||||
| userData: "", | |||||
| userPhone: "", | |||||
| showBindPhone: false,//绑定手机号边框 | |||||
| Num: 60, | |||||
| NumFlag: false, | |||||
| code: ""//验证码 | |||||
| }, | |||||
| showBox() { | |||||
| this.setData({ | |||||
| showBindPhone: true | |||||
| }) | |||||
| }, | |||||
| hideBox() { | |||||
| this.setData({ | |||||
| showBindPhone: false | |||||
| }) | |||||
| }, | |||||
| setUserPhone(e) { | |||||
| let value = e.detail.value | |||||
| this.setData({ | |||||
| userPhone: value | |||||
| }) | |||||
| }, | |||||
| setCodePhone(e) { | |||||
| let value = e.detail.value | |||||
| this.setData({ | |||||
| code: value | |||||
| }) | |||||
| }, | |||||
| getCode() {//获取验证码 | |||||
| console.log(this.data.userPhone); | |||||
| let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/; | |||||
| if (!myreg.test(this.data.userPhone)) { | |||||
| tt.showToast({ | |||||
| title: '请输入正确的手机号', | |||||
| icon: "none" | |||||
| }); | |||||
| return | |||||
| } | |||||
| Http.get({ | |||||
| url: config.api.getCodePhone, | |||||
| data: { | |||||
| phone: this.data.userPhone | |||||
| } | |||||
| }).then(res => { | |||||
| this.setData({ | |||||
| NumFlag: true | |||||
| }) | |||||
| let tiem = setInterval(() => { | |||||
| console.log(this.data.Num) | |||||
| this.setData({ | |||||
| Num: this.data.Num - 1 | |||||
| }) | |||||
| if (this.data.Num <= 1) { | |||||
| clearInterval(tiem) | |||||
| this.setData({ | |||||
| NumFlag: false | |||||
| }) | |||||
| } | |||||
| }, 1000) | |||||
| onLoad: function () { | |||||
| console.log(123); | |||||
| let _this = this | |||||
| tt.login({ | |||||
| success(_res) { | |||||
| let {code} = _res | |||||
| Http.post({ | |||||
| url:config.api.login, | |||||
| data:{ | |||||
| code:code, | |||||
| appId:'tt8183f73e1ebb053701' | |||||
| } | |||||
| }).then(res=>{ | |||||
| Http.setToken(res.data.token); | |||||
| app.globalData.token = res.data.token | |||||
| tt.getUserInfo({// 获取用户信息 | |||||
| withCredentials: true, | |||||
| // withRealNameAuthenticationInfo: true, | |||||
| success(res) { | |||||
| console.log(res); | |||||
| _this.setData({ | |||||
| userData: res.userInfo | |||||
| }) | |||||
| Http.get({ | |||||
| url: config.api.checkUserInfo | |||||
| }).then(res => { | |||||
| }).catch(err=>{ | |||||
| console.log("我没提交授权",err.code); | |||||
| if(err.code == 11004){ | |||||
| Http.post({ | |||||
| url:config.api.userInfo, | |||||
| data:{ | |||||
| iv:res.iv, | |||||
| encryptedData:res.encryptedData | |||||
| } | |||||
| }).then(res=>{ | |||||
| console.log(res); | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | |||||
| fail(res) { | |||||
| tt.navigateTo({ | |||||
| url: 'pages/index/index' // 指定页面的url | |||||
| }); | |||||
| }, | |||||
| }); | |||||
| tt.showToast({ | |||||
| title: '发送成功', | |||||
| icon: "none" | |||||
| }); | |||||
| }).catch(err => { | |||||
| tt.showToast({ | |||||
| title: err.message ? err.message : err.data, | |||||
| icon: "none" | |||||
| }); | |||||
| }) | |||||
| }, | |||||
| getUserData() {//获取用户信息 | |||||
| Http.get({ | |||||
| url:config.api.getUserInfo | |||||
| }).then(res=>{ | |||||
| if(res.data.phone){ | |||||
| this.setData({ | |||||
| userPhone:res.data.phone | |||||
| }) | |||||
| } | |||||
| }).catch(err=>{ | |||||
| tt.showToast({ | |||||
| title: err.message ? err.message : err.data, | |||||
| icon: "none" | |||||
| }); | |||||
| }) | |||||
| }, | |||||
| }).catch(err=>{ | |||||
| console.log(err); | |||||
| tt.showModal({ | |||||
| title: '提示', | |||||
| showCancel: false, | |||||
| content: '登录失败,请重新尝试', | |||||
| success: (res) => { | |||||
| if (res.cancel) { | |||||
| //点击取消,默认隐藏弹框 | |||||
| } else { | |||||
| //点击确定 | |||||
| wx.reLaunch({ | |||||
| url: '/pages/index/index', | |||||
| }) | |||||
| } | |||||
| } | |||||
| }); | |||||
| onLoad: function () { | |||||
| console.log(123); | |||||
| this.getUserData() | |||||
| let _this = this | |||||
| tt.login({ | |||||
| success(_res) { | |||||
| let { code } = _res | |||||
| Http.post({ | |||||
| url: config.api.login, | |||||
| data: { | |||||
| code: code, | |||||
| appId: 'tt8183f73e1ebb053701' | |||||
| } | |||||
| }).then(res => { | |||||
| Http.setToken(res.data.token); | |||||
| app.globalData.token = res.data.token | |||||
| tt.getUserInfo({// 获取用户信息 | |||||
| withCredentials: true, | |||||
| // withRealNameAuthenticationInfo: true, | |||||
| success(res) { | |||||
| console.log(res); | |||||
| _this.setData({ | |||||
| userData: res.userInfo | |||||
| }) | |||||
| Http.get({ | |||||
| url: config.api.checkUserInfo | |||||
| }).then(res => { | |||||
| }).catch(err => { | |||||
| console.log("我没提交授权", err.code); | |||||
| if (err.code == 11004) { | |||||
| Http.post({ | |||||
| url: config.api.userInfo, | |||||
| data: { | |||||
| iv: res.iv, | |||||
| encryptedData: res.encryptedData | |||||
| } | |||||
| }).then(res => { | |||||
| console.log(res); | |||||
| }) | }) | ||||
| } | |||||
| }) | |||||
| }, | }, | ||||
| }); | |||||
| } | |||||
| fail(res) { | |||||
| tt.navigateTo({ | |||||
| url: 'pages/index/index' // 指定页面的url | |||||
| }); | |||||
| }, | |||||
| }); | |||||
| }).catch(err => { | |||||
| console.log(err); | |||||
| tt.showModal({ | |||||
| title: '提示', | |||||
| showCancel: false, | |||||
| content: '登录失败,请重新尝试', | |||||
| success: (res) => { | |||||
| if (res.cancel) { | |||||
| //点击取消,默认隐藏弹框 | |||||
| } else { | |||||
| //点击确定 | |||||
| wx.reLaunch({ | |||||
| url: '/pages/index/index', | |||||
| }) | |||||
| } | |||||
| } | |||||
| }); | |||||
| }) | |||||
| }, | |||||
| }); | |||||
| } | |||||
| }) | }) | ||||
| @@ -16,11 +16,12 @@ | |||||
| </view> | </view> | ||||
| <!-- <image class="go" src="../../assets/images/arrow-right-bold.png" mode="aspectFit|aspectFill|widthFix" | <!-- <image class="go" src="../../assets/images/arrow-right-bold.png" mode="aspectFit|aspectFill|widthFix" | ||||
| lazy-load="false" binderror="" bindload="" /> --> | lazy-load="false" binderror="" bindload="" /> --> | ||||
| </view> | </view> | ||||
| <!-- <view class="phone"> | |||||
| 13028584842 | |||||
| </view> --> | |||||
| <view class="phoneBox oh"> | |||||
| <view class="phone">{{phoneNum}}</view> | |||||
| <view class="phoneBtn" bindtap="showBox">{{phoneNum?'更改绑定手机号':'绑定手机号'}}</view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <!-- <view class="functionBox oh"> | <!-- <view class="functionBox oh"> | ||||
| @@ -67,6 +68,17 @@ | |||||
| </navigator> | </navigator> | ||||
| <navigator class="orderBox oh" target="" url="/pages/integral/integral" hover-class="navigator-hover" open-type="navigate"> | |||||
| <image class="logo" src="{{imgHttps+'money.png'}}" mode="aspectFit|aspectFill|widthFix" | |||||
| lazy-load="false" binderror="" bindload="" /> | |||||
| <view class="orderTitle"> | |||||
| 我的积分 | |||||
| </view> | |||||
| <image class="go" src="../../assets/images/arrow-right-bold.png" mode="aspectFit|aspectFill|widthFix" | |||||
| lazy-load="false" binderror="" bindload="" /> | |||||
| </navigator> | |||||
| <button class="orderBox oh" open-type="contact" > | <button class="orderBox oh" open-type="contact" > | ||||
| <image class="logo" src="{{imgHttps+'me_icon_zxkf.png'}}" mode="aspectFit|aspectFill|widthFix" | <image class="logo" src="{{imgHttps+'me_icon_zxkf.png'}}" mode="aspectFit|aspectFill|widthFix" | ||||
| @@ -106,5 +118,20 @@ | |||||
| </view> | </view> | ||||
| <view class="boundPhoneBox" tt:if="{{showBindPhone}}"> | |||||
| <view class="inputBox"> | |||||
| <input class="boundPhone" type="number" bindinput="setUserPhone" value="" placeholder="请输入手机号"/> | |||||
| </view> | |||||
| <view class="verifyCodeBox oh"> | |||||
| <input class="codeNum" type="number" bindinput="setCodePhone" value="" placeholder="请输入验证码"/> | |||||
| <view class="binCode" bindtap="getCode" tt:if="{{!NumFlag}}">获取验证码</view> | |||||
| <view class="binCode" tt:if="{{NumFlag}}">{{Num}}s</view> | |||||
| </view> | |||||
| <view class="operationBox oh"> | |||||
| <view class="cancel" bindtap="hideBox">取消</view> | |||||
| <view class="xian"></view> | |||||
| <view class="submit">确定</view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| @@ -24,7 +24,7 @@ margin-top: 40rpx; | |||||
| margin-left: 20rpx; | margin-left: 20rpx; | ||||
| } | } | ||||
| .nameGoBox{ | .nameGoBox{ | ||||
| margin-top: 30rpx; | |||||
| margin-top: 20rpx; | |||||
| } | } | ||||
| .name{ | .name{ | ||||
| font-size: 36rpx; | font-size: 36rpx; | ||||
| @@ -40,11 +40,20 @@ margin-top: 40rpx; | |||||
| height: 30rpx; | height: 30rpx; | ||||
| float: right; | float: right; | ||||
| } | } | ||||
| .phoneBox{ | |||||
| margin-top: 10rpx; | |||||
| font-family: OPPOSans; | |||||
| font-weight: 400; | |||||
| color: #8790A8; | |||||
| } | |||||
| .phone{ | .phone{ | ||||
| font-family: OPPOSans; | |||||
| font-weight: 400; | |||||
| color: #8790A8; | |||||
| float: left; | |||||
| margin-left: 20rpx; | |||||
| } | |||||
| .phoneBtn{ | |||||
| float: left; | |||||
| color: #07E881; | |||||
| margin-left: 20rpx; | |||||
| } | } | ||||
| .functionBox{ | .functionBox{ | ||||
| margin-top: 30rpx ; | margin-top: 30rpx ; | ||||
| @@ -119,3 +128,73 @@ margin-top: 30rpx ; | |||||
| .Box{ | .Box{ | ||||
| height: 100vh; | height: 100vh; | ||||
| } | } | ||||
| .boundPhoneBox{ | |||||
| top: 180px; | |||||
| left: 5%; | |||||
| position: absolute; | |||||
| width: 90%; | |||||
| border-radius: 10rpx; | |||||
| z-index: 10000; | |||||
| background-color: #0E1119; | |||||
| } | |||||
| .inputBox{ | |||||
| width: 90%; | |||||
| height: 80rpx; | |||||
| border-radius: 10rpx; | |||||
| background: #1B2130; | |||||
| margin-top: 40rpx; | |||||
| margin-left: auto; | |||||
| margin-right: auto; | |||||
| margin-bottom: 30rpx; | |||||
| } | |||||
| .verifyCodeBox{ | |||||
| width: 90%; | |||||
| height: 80rpx; | |||||
| border-radius: 10rpx; | |||||
| background: #1B2130; | |||||
| margin: 20rpx auto; | |||||
| } | |||||
| .boundPhone{ | |||||
| margin-left: 35px; | |||||
| height: 80rpx; | |||||
| width: 70%; | |||||
| color: #FFFFFF; | |||||
| } | |||||
| .codeNum{ | |||||
| width: 50%; | |||||
| height: 40px; | |||||
| float: left; | |||||
| margin-left: 35px; | |||||
| } | |||||
| .binCode{ | |||||
| height: 40px; | |||||
| line-height: 40px; | |||||
| font-family: PingFang SC; | |||||
| font-weight: 500; | |||||
| color: #07E881; | |||||
| font-size: 15px; | |||||
| float: left; | |||||
| margin-left: 10px; | |||||
| } | |||||
| .cancel{ | |||||
| width: calc(50% - 1rpx); | |||||
| float: left; | |||||
| color: #FFFFFF; | |||||
| height: 80rpx; | |||||
| line-height: 80rpx; | |||||
| text-align: center; | |||||
| border-top: 1rpx solid #222633; | |||||
| border-right: 1rpx solid #222633; | |||||
| } | |||||
| .submit{ | |||||
| border-top: 1rpx solid #222633; | |||||
| color: #07E881; | |||||
| height: 80rpx; | |||||
| line-height: 80rpx; | |||||
| text-align: center; | |||||
| width: 50%; | |||||
| float: left; | |||||
| } | |||||
| @@ -18,8 +18,8 @@ | |||||
| { | { | ||||
| "id": 1625040084950, | "id": 1625040084950, | ||||
| "name": "classDetails", | "name": "classDetails", | ||||
| "pathName": "pages/classDetails/classDetails", | |||||
| "query": "id=568597357595095040", | |||||
| "pathName": "pages/user/user", | |||||
| "query": "", | |||||
| "scene": "990001", | "scene": "990001", | ||||
| "launchFrom": "scan", | "launchFrom": "scan", | ||||
| "location": "qr_code" | "location": "qr_code" | ||||
| @@ -1,318 +0,0 @@ | |||||
| /** | |||||
| * html2Json 改造来自: https://github.com/Jxck/html2json | |||||
| * | |||||
| * | |||||
| * author: Di (微信小程序开发工程师) | |||||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||||
| * 垂直微信小程序开发交流社区 | |||||
| * | |||||
| * github地址: https://github.com/icindy/wxParse | |||||
| * | |||||
| * for: 微信小程序富文本解析 | |||||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||||
| */ | |||||
| var __placeImgeUrlHttps = "https"; | |||||
| var __emojisReg = ''; | |||||
| var __emojisBaseSrc = ''; | |||||
| var __emojis = {}; | |||||
| var wxDiscode = require('./wxDiscode.js'); | |||||
| var HTMLParser = require('./htmlparser.js'); | |||||
| // Empty Elements - HTML 5 | |||||
| var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); | |||||
| // Block Elements - HTML 5 | |||||
| var block = makeMap("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); | |||||
| // Inline Elements - HTML 5 | |||||
| var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); | |||||
| // Elements that you can, intentionally, leave open | |||||
| // (and which close themselves) | |||||
| var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); | |||||
| // Attributes that have their values filled in disabled="disabled" | |||||
| var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); | |||||
| // Special Elements (can contain anything) | |||||
| var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block"); | |||||
| function makeMap(str) { | |||||
| var obj = {}, items = str.split(","); | |||||
| for (var i = 0; i < items.length; i++) | |||||
| obj[items[i]] = true; | |||||
| return obj; | |||||
| } | |||||
| function q(v) { | |||||
| return '"' + v + '"'; | |||||
| } | |||||
| function removeDOCTYPE(html) { | |||||
| return html | |||||
| .replace(/<\?xml.*\?>\n/, '') | |||||
| .replace(/<.*!doctype.*\>\n/, '') | |||||
| .replace(/<.*!DOCTYPE.*\>\n/, ''); | |||||
| } | |||||
| function trimHtml(html) { | |||||
| return html | |||||
| .replace(/\r?\n+/g, '') | |||||
| .replace(/<!--.*?-->/ig, '') | |||||
| .replace(/\/\*.*?\*\//ig, '') | |||||
| .replace(/[ ]+</ig, '<') | |||||
| } | |||||
| function html2json(html, bindName) { | |||||
| //处理字符串 | |||||
| html = removeDOCTYPE(html); | |||||
| html = trimHtml(html); | |||||
| html = wxDiscode.strDiscode(html); | |||||
| //生成node节点 | |||||
| var bufArray = []; | |||||
| var results = { | |||||
| node: bindName, | |||||
| nodes: [], | |||||
| images:[], | |||||
| imageUrls:[] | |||||
| }; | |||||
| var index = 0; | |||||
| HTMLParser(html, { | |||||
| start: function (tag, attrs, unary) { | |||||
| //debug(tag, attrs, unary); | |||||
| // node for this element | |||||
| var node = { | |||||
| node: 'element', | |||||
| tag: tag, | |||||
| attr:{} | |||||
| }; | |||||
| if (node.tag =="embed"){ | |||||
| console.log(node,attrs,unary,666) | |||||
| var embUrl = ''; | |||||
| attrs.map((item,index)=>{ | |||||
| if(item.name == 'src'){ | |||||
| embUrl = item.value | |||||
| } | |||||
| }) | |||||
| // if (node.attr.src.indexOf('http:')==-1){ | |||||
| // embUrl = "http://xxxx.com" + node.attr.src; | |||||
| // } | |||||
| node.attr.src = embUrl; | |||||
| node.tag='video'; | |||||
| } | |||||
| if (bufArray.length === 0) { | |||||
| node.index = index.toString() | |||||
| index += 1 | |||||
| } else { | |||||
| var parent = bufArray[0]; | |||||
| if (parent.nodes === undefined) { | |||||
| parent.nodes = []; | |||||
| } | |||||
| node.index = parent.index + '.' + parent.nodes.length | |||||
| } | |||||
| if (block[tag]) { | |||||
| node.tagType = "block"; | |||||
| } else if (inline[tag]) { | |||||
| node.tagType = "inline"; | |||||
| } else if (closeSelf[tag]) { | |||||
| node.tagType = "closeSelf"; | |||||
| } | |||||
| if (attrs.length !== 0) { | |||||
| node.attr = attrs.reduce(function (pre, attr) { | |||||
| var name = attr.name; | |||||
| var value = attr.value; | |||||
| if (name == 'class') { | |||||
| console.dir(value); | |||||
| // value = value.join("") | |||||
| node.classStr = value; | |||||
| } | |||||
| // has multi attibutes | |||||
| // make it array of attribute | |||||
| if (name == 'style') { | |||||
| console.dir(value); | |||||
| // value = value.join("") | |||||
| node.styleStr = value; | |||||
| } | |||||
| if (value.match(/ /)) { | |||||
| value = value.split(' '); | |||||
| } | |||||
| // if attr already exists | |||||
| // merge it | |||||
| if (pre[name]) { | |||||
| if (Array.isArray(pre[name])) { | |||||
| // already array, push to last | |||||
| pre[name].push(value); | |||||
| } else { | |||||
| // single value, make it array | |||||
| pre[name] = [pre[name], value]; | |||||
| } | |||||
| } else { | |||||
| // not exist, put it | |||||
| pre[name] = value; | |||||
| } | |||||
| return pre; | |||||
| }, {}); | |||||
| } | |||||
| //对img添加额外数据 | |||||
| if (node.tag === 'img') { | |||||
| node.imgIndex = results.images.length; | |||||
| var imgUrl = node.attr.src; | |||||
| if (imgUrl[0] == '') { | |||||
| imgUrl.splice(0, 1); | |||||
| } | |||||
| imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps); | |||||
| node.attr.src = imgUrl; | |||||
| node.from = bindName; | |||||
| results.images.push(node); | |||||
| results.imageUrls.push(imgUrl); | |||||
| } | |||||
| // 处理font标签样式属性 | |||||
| if (node.tag === 'font') { | |||||
| var fontSize = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; | |||||
| var styleAttrs = { | |||||
| 'color': 'color', | |||||
| 'face': 'font-family', | |||||
| 'size': 'font-size' | |||||
| }; | |||||
| if (!node.attr.style) node.attr.style = []; | |||||
| if (!node.styleStr) node.styleStr = ''; | |||||
| for (var key in styleAttrs) { | |||||
| if (node.attr[key]) { | |||||
| var value = key === 'size' ? fontSize[node.attr[key]-1] : node.attr[key]; | |||||
| node.attr.style.push(styleAttrs[key]); | |||||
| node.attr.style.push(value); | |||||
| node.styleStr += styleAttrs[key] + ': ' + value + ';'; | |||||
| } | |||||
| } | |||||
| } | |||||
| //临时记录source资源 | |||||
| if(node.tag === 'source'){ | |||||
| results.source = node.attr.src; | |||||
| } | |||||
| if (unary) { | |||||
| // if this tag doesn't have end tag | |||||
| // like <img src="hoge.png"/> | |||||
| // add to parents | |||||
| var parent = bufArray[0] || results; | |||||
| if (parent.nodes === undefined) { | |||||
| parent.nodes = []; | |||||
| } | |||||
| parent.nodes.push(node); | |||||
| } else { | |||||
| bufArray.unshift(node); | |||||
| } | |||||
| }, | |||||
| end: function (tag) { | |||||
| //debug(tag); | |||||
| // merge into parent tag | |||||
| var node = bufArray.shift(); | |||||
| if (node.tag !== tag) console.error('invalid state: mismatch end tag'); | |||||
| //当有缓存source资源时于于video补上src资源 | |||||
| if(node.tag === 'video' && results.source){ | |||||
| node.attr.src = results.source; | |||||
| delete results.source; | |||||
| } | |||||
| if (bufArray.length === 0) { | |||||
| results.nodes.push(node); | |||||
| } else { | |||||
| var parent = bufArray[0]; | |||||
| if (parent.nodes === undefined) { | |||||
| parent.nodes = []; | |||||
| } | |||||
| parent.nodes.push(node); | |||||
| } | |||||
| }, | |||||
| chars: function (text) { | |||||
| //debug(text); | |||||
| var node = { | |||||
| node: 'text', | |||||
| text: text, | |||||
| textArray:transEmojiStr(text) | |||||
| }; | |||||
| if (bufArray.length === 0) { | |||||
| node.index = index.toString() | |||||
| index += 1 | |||||
| results.nodes.push(node); | |||||
| } else { | |||||
| var parent = bufArray[0]; | |||||
| if (parent.nodes === undefined) { | |||||
| parent.nodes = []; | |||||
| } | |||||
| node.index = parent.index + '.' + parent.nodes.length | |||||
| parent.nodes.push(node); | |||||
| } | |||||
| }, | |||||
| comment: function (text) { | |||||
| //debug(text); | |||||
| // var node = { | |||||
| // node: 'comment', | |||||
| // text: text, | |||||
| // }; | |||||
| // var parent = bufArray[0]; | |||||
| // if (parent.nodes === undefined) { | |||||
| // parent.nodes = []; | |||||
| // } | |||||
| // parent.nodes.push(node); | |||||
| }, | |||||
| }); | |||||
| return results; | |||||
| }; | |||||
| function transEmojiStr(str){ | |||||
| // var eReg = new RegExp("["+__reg+' '+"]"); | |||||
| // str = str.replace(/\[([^\[\]]+)\]/g,':$1:') | |||||
| var emojiObjs = []; | |||||
| //如果正则表达式为空 | |||||
| if(__emojisReg.length == 0 || !__emojis){ | |||||
| var emojiObj = {} | |||||
| emojiObj.node = "text"; | |||||
| emojiObj.text = str; | |||||
| array = [emojiObj]; | |||||
| return array; | |||||
| } | |||||
| //这个地方需要调整 | |||||
| str = str.replace(/\[([^\[\]]+)\]/g,':$1:') | |||||
| var eReg = new RegExp("[:]"); | |||||
| var array = str.split(eReg); | |||||
| for(var i = 0; i < array.length; i++){ | |||||
| var ele = array[i]; | |||||
| var emojiObj = {}; | |||||
| if(__emojis[ele]){ | |||||
| emojiObj.node = "element"; | |||||
| emojiObj.tag = "emoji"; | |||||
| emojiObj.text = __emojis[ele]; | |||||
| emojiObj.baseSrc= __emojisBaseSrc; | |||||
| }else{ | |||||
| emojiObj.node = "text"; | |||||
| emojiObj.text = ele; | |||||
| } | |||||
| emojiObjs.push(emojiObj); | |||||
| } | |||||
| return emojiObjs; | |||||
| } | |||||
| function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){ | |||||
| __emojisReg = reg; | |||||
| __emojisBaseSrc=baseSrc; | |||||
| __emojis=emojis; | |||||
| } | |||||
| module.exports = { | |||||
| html2json: html2json, | |||||
| emojisInit:emojisInit | |||||
| }; | |||||
| @@ -1,192 +0,0 @@ | |||||
| /** | |||||
| * | |||||
| * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser | |||||
| * | |||||
| * author: Di (微信小程序开发工程师) | |||||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||||
| * 垂直微信小程序开发交流社区 | |||||
| * | |||||
| * github地址: https://github.com/icindy/wxParse | |||||
| * | |||||
| * for: 微信小程序富文本解析 | |||||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||||
| */ | |||||
| // Regular Expressions for parsing tags and attributes | |||||
| var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, | |||||
| endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/, | |||||
| attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; | |||||
| // Empty Elements - HTML 5 | |||||
| var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); | |||||
| // Block Elements - HTML 5 | |||||
| var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); | |||||
| // Inline Elements - HTML 5 | |||||
| var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); | |||||
| // Elements that you can, intentionally, leave open | |||||
| // (and which close themselves) | |||||
| var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); | |||||
| // Attributes that have their values filled in disabled="disabled" | |||||
| var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); | |||||
| // Special Elements (can contain anything) | |||||
| var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block"); | |||||
| function HTMLParser(html, handler) { | |||||
| var index, chars, match, stack = [], last = html; | |||||
| stack.last = function () { | |||||
| return this[this.length - 1]; | |||||
| }; | |||||
| while (html) { | |||||
| chars = true; | |||||
| // Make sure we're not in a script or style element | |||||
| if (!stack.last() || !special[stack.last()]) { | |||||
| // Comment | |||||
| if (html.indexOf("<!--") == 0) { | |||||
| index = html.indexOf("-->"); | |||||
| if (index >= 0) { | |||||
| if (handler.comment) | |||||
| handler.comment(html.substring(4, index)); | |||||
| html = html.substring(index + 3); | |||||
| chars = false; | |||||
| } | |||||
| // end tag | |||||
| } else if (html.indexOf("</") == 0) { | |||||
| match = html.match(endTag); | |||||
| if (match) { | |||||
| html = html.substring(match[0].length); | |||||
| match[0].replace(endTag, parseEndTag); | |||||
| chars = false; | |||||
| } | |||||
| // start tag | |||||
| } else if (html.indexOf("<") == 0) { | |||||
| match = html.match(startTag); | |||||
| if (match) { | |||||
| html = html.substring(match[0].length); | |||||
| match[0].replace(startTag, parseStartTag); | |||||
| chars = false; | |||||
| } | |||||
| } | |||||
| if (chars) { | |||||
| index = html.indexOf("<"); | |||||
| var text = '' | |||||
| while (index === 0) { | |||||
| text += "<"; | |||||
| html = html.substring(1); | |||||
| index = html.indexOf("<"); | |||||
| } | |||||
| text += index < 0 ? html : html.substring(0, index); | |||||
| html = index < 0 ? "" : html.substring(index); | |||||
| if (handler.chars) | |||||
| handler.chars(text); | |||||
| } | |||||
| } else { | |||||
| html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) { | |||||
| text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2"); | |||||
| if (handler.chars) | |||||
| handler.chars(text); | |||||
| return ""; | |||||
| }); | |||||
| parseEndTag("", stack.last()); | |||||
| } | |||||
| if (html == last) | |||||
| throw "Parse Error: " + html; | |||||
| last = html; | |||||
| } | |||||
| // Clean up any remaining tags | |||||
| parseEndTag(); | |||||
| function parseStartTag(tag, tagName, rest, unary) { | |||||
| tagName = tagName.toLowerCase(); | |||||
| if (block[tagName]) { | |||||
| while (stack.last() && inline[stack.last()]) { | |||||
| parseEndTag("", stack.last()); | |||||
| } | |||||
| } | |||||
| if (closeSelf[tagName] && stack.last() == tagName) { | |||||
| parseEndTag("", tagName); | |||||
| } | |||||
| unary = empty[tagName] || !!unary; | |||||
| if (!unary) | |||||
| stack.push(tagName); | |||||
| if (handler.start) { | |||||
| var attrs = []; | |||||
| rest.replace(attr, function (match, name) { | |||||
| var value = arguments[2] ? arguments[2] : | |||||
| arguments[3] ? arguments[3] : | |||||
| arguments[4] ? arguments[4] : | |||||
| fillAttrs[name] ? name : ""; | |||||
| attrs.push({ | |||||
| name: name, | |||||
| value: value, | |||||
| escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //" | |||||
| }); | |||||
| }); | |||||
| if (handler.start) { | |||||
| handler.start(tagName, attrs, unary); | |||||
| } | |||||
| } | |||||
| } | |||||
| function parseEndTag(tag, tagName) { | |||||
| // If no tag name is provided, clean shop | |||||
| if (!tagName) | |||||
| var pos = 0; | |||||
| // Find the closest opened tag of the same type | |||||
| else { | |||||
| tagName = tagName.toLowerCase(); | |||||
| for (var pos = stack.length - 1; pos >= 0; pos--) | |||||
| if (stack[pos] == tagName) | |||||
| break; | |||||
| } | |||||
| if (pos >= 0) { | |||||
| // Close all the open elements, up the stack | |||||
| for (var i = stack.length - 1; i >= pos; i--) | |||||
| if (handler.end) | |||||
| handler.end(stack[i]); | |||||
| // Remove the open elements from the stack | |||||
| stack.length = pos; | |||||
| } | |||||
| } | |||||
| }; | |||||
| function makeMap(str) { | |||||
| var obj = {}, items = str.split(","); | |||||
| for (var i = 0; i < items.length; i++) | |||||
| obj[items[i]] = true; | |||||
| return obj; | |||||
| } | |||||
| module.exports = HTMLParser; | |||||
| @@ -1,207 +0,0 @@ | |||||
| // HTML 支持的数学符号 | |||||
| function strNumDiscode(str){ | |||||
| str = str.replace(/∀/g, '∀'); | |||||
| str = str.replace(/∂/g, '∂'); | |||||
| str = str.replace(/&exists;/g, '∃'); | |||||
| str = str.replace(/∅/g, '∅'); | |||||
| str = str.replace(/∇/g, '∇'); | |||||
| str = str.replace(/∈/g, '∈'); | |||||
| str = str.replace(/∉/g, '∉'); | |||||
| str = str.replace(/∋/g, '∋'); | |||||
| str = str.replace(/∏/g, '∏'); | |||||
| str = str.replace(/∑/g, '∑'); | |||||
| str = str.replace(/−/g, '−'); | |||||
| str = str.replace(/∗/g, '∗'); | |||||
| str = str.replace(/√/g, '√'); | |||||
| str = str.replace(/∝/g, '∝'); | |||||
| str = str.replace(/∞/g, '∞'); | |||||
| str = str.replace(/∠/g, '∠'); | |||||
| str = str.replace(/∧/g, '∧'); | |||||
| str = str.replace(/∨/g, '∨'); | |||||
| str = str.replace(/∩/g, '∩'); | |||||
| str = str.replace(/∩/g, '∪'); | |||||
| str = str.replace(/∫/g, '∫'); | |||||
| str = str.replace(/∴/g, '∴'); | |||||
| str = str.replace(/∼/g, '∼'); | |||||
| str = str.replace(/≅/g, '≅'); | |||||
| str = str.replace(/≈/g, '≈'); | |||||
| str = str.replace(/≠/g, '≠'); | |||||
| str = str.replace(/≤/g, '≤'); | |||||
| str = str.replace(/≥/g, '≥'); | |||||
| str = str.replace(/⊂/g, '⊂'); | |||||
| str = str.replace(/⊃/g, '⊃'); | |||||
| str = str.replace(/⊄/g, '⊄'); | |||||
| str = str.replace(/⊆/g, '⊆'); | |||||
| str = str.replace(/⊇/g, '⊇'); | |||||
| str = str.replace(/⊕/g, '⊕'); | |||||
| str = str.replace(/⊗/g, '⊗'); | |||||
| str = str.replace(/⊥/g, '⊥'); | |||||
| str = str.replace(/⋅/g, '⋅'); | |||||
| return str; | |||||
| } | |||||
| //HTML 支持的希腊字母 | |||||
| function strGreeceDiscode(str){ | |||||
| str = str.replace(/Α/g, 'Α'); | |||||
| str = str.replace(/Β/g, 'Β'); | |||||
| str = str.replace(/Γ/g, 'Γ'); | |||||
| str = str.replace(/Δ/g, 'Δ'); | |||||
| str = str.replace(/Ε/g, 'Ε'); | |||||
| str = str.replace(/Ζ/g, 'Ζ'); | |||||
| str = str.replace(/Η/g, 'Η'); | |||||
| str = str.replace(/Θ/g, 'Θ'); | |||||
| str = str.replace(/Ι/g, 'Ι'); | |||||
| str = str.replace(/Κ/g, 'Κ'); | |||||
| str = str.replace(/Λ/g, 'Λ'); | |||||
| str = str.replace(/Μ/g, 'Μ'); | |||||
| str = str.replace(/Ν/g, 'Ν'); | |||||
| str = str.replace(/Ξ/g, 'Ν'); | |||||
| str = str.replace(/Ο/g, 'Ο'); | |||||
| str = str.replace(/Π/g, 'Π'); | |||||
| str = str.replace(/Ρ/g, 'Ρ'); | |||||
| str = str.replace(/Σ/g, 'Σ'); | |||||
| str = str.replace(/Τ/g, 'Τ'); | |||||
| str = str.replace(/Υ/g, 'Υ'); | |||||
| str = str.replace(/Φ/g, 'Φ'); | |||||
| str = str.replace(/Χ/g, 'Χ'); | |||||
| str = str.replace(/Ψ/g, 'Ψ'); | |||||
| str = str.replace(/Ω/g, 'Ω'); | |||||
| str = str.replace(/α/g, 'α'); | |||||
| str = str.replace(/β/g, 'β'); | |||||
| str = str.replace(/γ/g, 'γ'); | |||||
| str = str.replace(/δ/g, 'δ'); | |||||
| str = str.replace(/ε/g, 'ε'); | |||||
| str = str.replace(/ζ/g, 'ζ'); | |||||
| str = str.replace(/η/g, 'η'); | |||||
| str = str.replace(/θ/g, 'θ'); | |||||
| str = str.replace(/ι/g, 'ι'); | |||||
| str = str.replace(/κ/g, 'κ'); | |||||
| str = str.replace(/λ/g, 'λ'); | |||||
| str = str.replace(/μ/g, 'μ'); | |||||
| str = str.replace(/ν/g, 'ν'); | |||||
| str = str.replace(/ξ/g, 'ξ'); | |||||
| str = str.replace(/ο/g, 'ο'); | |||||
| str = str.replace(/π/g, 'π'); | |||||
| str = str.replace(/ρ/g, 'ρ'); | |||||
| str = str.replace(/ς/g, 'ς'); | |||||
| str = str.replace(/σ/g, 'σ'); | |||||
| str = str.replace(/τ/g, 'τ'); | |||||
| str = str.replace(/υ/g, 'υ'); | |||||
| str = str.replace(/φ/g, 'φ'); | |||||
| str = str.replace(/χ/g, 'χ'); | |||||
| str = str.replace(/ψ/g, 'ψ'); | |||||
| str = str.replace(/ω/g, 'ω'); | |||||
| str = str.replace(/ϑ/g, 'ϑ'); | |||||
| str = str.replace(/ϒ/g, 'ϒ'); | |||||
| str = str.replace(/ϖ/g, 'ϖ'); | |||||
| str = str.replace(/·/g, '·'); | |||||
| return str; | |||||
| } | |||||
| // | |||||
| function strcharacterDiscode(str){ | |||||
| // 加入常用解析 | |||||
| str = str.replace(/ /g, ' '); | |||||
| str = str.replace(/"/g, "'"); | |||||
| str = str.replace(/&/g, '&'); | |||||
| // str = str.replace(/</g, '‹'); | |||||
| // str = str.replace(/>/g, '›'); | |||||
| str = str.replace(/</g, '<'); | |||||
| str = str.replace(/>/g, '>'); | |||||
| str = str.replace(/•/g, '•'); | |||||
| return str; | |||||
| } | |||||
| // HTML 支持的其他实体 | |||||
| function strOtherDiscode(str){ | |||||
| str = str.replace(/Œ/g, 'Œ'); | |||||
| str = str.replace(/œ/g, 'œ'); | |||||
| str = str.replace(/Š/g, 'Š'); | |||||
| str = str.replace(/š/g, 'š'); | |||||
| str = str.replace(/Ÿ/g, 'Ÿ'); | |||||
| str = str.replace(/ƒ/g, 'ƒ'); | |||||
| str = str.replace(/ˆ/g, 'ˆ'); | |||||
| str = str.replace(/˜/g, '˜'); | |||||
| str = str.replace(/ /g, ''); | |||||
| str = str.replace(/ /g, ''); | |||||
| str = str.replace(/ /g, ''); | |||||
| str = str.replace(/‌/g, ''); | |||||
| str = str.replace(/‍/g, ''); | |||||
| str = str.replace(/‎/g, ''); | |||||
| str = str.replace(/‏/g, ''); | |||||
| str = str.replace(/–/g, '–'); | |||||
| str = str.replace(/—/g, '—'); | |||||
| str = str.replace(/‘/g, '‘'); | |||||
| str = str.replace(/’/g, '’'); | |||||
| str = str.replace(/‚/g, '‚'); | |||||
| str = str.replace(/“/g, '“'); | |||||
| str = str.replace(/”/g, '”'); | |||||
| str = str.replace(/„/g, '„'); | |||||
| str = str.replace(/†/g, '†'); | |||||
| str = str.replace(/‡/g, '‡'); | |||||
| str = str.replace(/•/g, '•'); | |||||
| str = str.replace(/…/g, '…'); | |||||
| str = str.replace(/‰/g, '‰'); | |||||
| str = str.replace(/′/g, '′'); | |||||
| str = str.replace(/″/g, '″'); | |||||
| str = str.replace(/‹/g, '‹'); | |||||
| str = str.replace(/›/g, '›'); | |||||
| str = str.replace(/‾/g, '‾'); | |||||
| str = str.replace(/€/g, '€'); | |||||
| str = str.replace(/™/g, '™'); | |||||
| str = str.replace(/←/g, '←'); | |||||
| str = str.replace(/↑/g, '↑'); | |||||
| str = str.replace(/→/g, '→'); | |||||
| str = str.replace(/↓/g, '↓'); | |||||
| str = str.replace(/↔/g, '↔'); | |||||
| str = str.replace(/↵/g, '↵'); | |||||
| str = str.replace(/⌈/g, '⌈'); | |||||
| str = str.replace(/⌉/g, '⌉'); | |||||
| str = str.replace(/⌊/g, '⌊'); | |||||
| str = str.replace(/⌋/g, '⌋'); | |||||
| str = str.replace(/◊/g, '◊'); | |||||
| str = str.replace(/♠/g, '♠'); | |||||
| str = str.replace(/♣/g, '♣'); | |||||
| str = str.replace(/♥/g, '♥'); | |||||
| str = str.replace(/♦/g, '♦'); | |||||
| str = str.replace(/'/g, '\''); | |||||
| return str; | |||||
| } | |||||
| function strMoreDiscode(str){ | |||||
| str = str.replace(/\r\n/g,""); | |||||
| str = str.replace(/\n/g,""); | |||||
| str = str.replace(/code/g,"wxxxcode-style"); | |||||
| return str; | |||||
| } | |||||
| function strDiscode(str){ | |||||
| str = strNumDiscode(str); | |||||
| str = strGreeceDiscode(str); | |||||
| str = strcharacterDiscode(str); | |||||
| str = strOtherDiscode(str); | |||||
| str = strMoreDiscode(str); | |||||
| return str; | |||||
| } | |||||
| function urlToHttpUrl(url,rep){ | |||||
| var patt1 = new RegExp("^//"); | |||||
| var result = patt1.test(url); | |||||
| if(result){ | |||||
| url = rep+":"+url; | |||||
| } | |||||
| return url; | |||||
| } | |||||
| module.exports = { | |||||
| strDiscode:strDiscode, | |||||
| urlToHttpUrl:urlToHttpUrl | |||||
| } | |||||
| @@ -1,157 +0,0 @@ | |||||
| /** | |||||
| * author: Di (微信小程序开发工程师) | |||||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||||
| * 垂直微信小程序开发交流社区 | |||||
| * | |||||
| * github地址: https://github.com/icindy/wxParse | |||||
| * | |||||
| * for: 微信小程序富文本解析 | |||||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||||
| */ | |||||
| /** | |||||
| * utils函数引入 | |||||
| **/ | |||||
| import showdown from './showdown.js'; | |||||
| import HtmlToJson from './html2json.js'; | |||||
| /** | |||||
| * 配置及公有属性 | |||||
| **/ | |||||
| var realWindowWidth = 0; | |||||
| var realWindowHeight = 0; | |||||
| tt.getSystemInfo({ | |||||
| success: function (res) { | |||||
| realWindowWidth = res.windowWidth | |||||
| realWindowHeight = res.windowHeight | |||||
| } | |||||
| }) | |||||
| /** | |||||
| * 主函数入口区 | |||||
| **/ | |||||
| function wxParse(bindName = 'wxParseData', type='html', data='<div class="color:red;">数据不能为空</div>', target,imagePadding) { | |||||
| var that = target; | |||||
| var transData = {};//存放转化后的数据 | |||||
| if (type == 'html') { | |||||
| transData = HtmlToJson.html2json(data, bindName); | |||||
| } else if (type == 'md' || type == 'markdown') { | |||||
| var converter = new showdown.Converter(); | |||||
| var html = converter.makeHtml(data); | |||||
| transData = HtmlToJson.html2json(html, bindName); | |||||
| } | |||||
| transData.view = {}; | |||||
| transData.view.imagePadding = 0; | |||||
| if(typeof(imagePadding) != 'undefined'){ | |||||
| transData.view.imagePadding = imagePadding | |||||
| } | |||||
| var bindData = {}; | |||||
| bindData[bindName] = transData; | |||||
| that.setData(bindData) | |||||
| that.wxParseImgLoad = wxParseImgLoad; | |||||
| that.wxParseImgTap = wxParseImgTap; | |||||
| } | |||||
| // 图片点击事件 | |||||
| function wxParseImgTap(e) { | |||||
| var that = this; | |||||
| var nowImgUrl = e.target.dataset.src; | |||||
| var tagFrom = e.target.dataset.from; | |||||
| if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) { | |||||
| tt.previewImage({ | |||||
| current: nowImgUrl, // 当前显示图片的http链接 | |||||
| urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表 | |||||
| }) | |||||
| } | |||||
| } | |||||
| /** | |||||
| * 图片视觉宽高计算函数区 | |||||
| **/ | |||||
| function wxParseImgLoad(e) { | |||||
| var that = this; | |||||
| var tagFrom = e.target.dataset.from; | |||||
| var idx = e.target.dataset.idx; | |||||
| if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) { | |||||
| calMoreImageInfo(e, idx, that, tagFrom) | |||||
| } | |||||
| } | |||||
| // 假循环获取计算图片视觉最佳宽高 | |||||
| function calMoreImageInfo(e, idx, that, bindName) { | |||||
| var temData = that.data[bindName]; | |||||
| if (!temData || temData.images.length == 0) { | |||||
| return; | |||||
| } | |||||
| var temImages = temData.images; | |||||
| //因为无法获取view宽度 需要自定义padding进行计算,稍后处理 | |||||
| var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName); | |||||
| // temImages[idx].width = recal.imageWidth; | |||||
| // temImages[idx].height = recal.imageheight; | |||||
| // temData.images = temImages; | |||||
| // var bindData = {}; | |||||
| // bindData[bindName] = temData; | |||||
| // that.setData(bindData); | |||||
| var index = temImages[idx].index | |||||
| var key = `${bindName}` | |||||
| for (var i of index.split('.')) key+=`.nodes[${i}]` | |||||
| var keyW = key + '.width' | |||||
| var keyH = key + '.height' | |||||
| that.setData({ | |||||
| [keyW]: recal.imageWidth, | |||||
| [keyH]: recal.imageheight, | |||||
| }) | |||||
| } | |||||
| // 计算视觉优先的图片宽高 | |||||
| function wxAutoImageCal(originalWidth, originalHeight,that,bindName) { | |||||
| //获取图片的原始长宽 | |||||
| var windowWidth = 0, windowHeight = 0; | |||||
| var autoWidth = 0, autoHeight = 0; | |||||
| var results = {}; | |||||
| var padding = that.data[bindName].view.imagePadding; | |||||
| windowWidth = realWindowWidth-2*padding; | |||||
| windowHeight = realWindowHeight; | |||||
| //判断按照那种方式进行缩放 | |||||
| // console.log("windowWidth" + windowWidth); | |||||
| if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候 | |||||
| autoWidth = windowWidth; | |||||
| // console.log("autoWidth" + autoWidth); | |||||
| autoHeight = (autoWidth * originalHeight) / originalWidth; | |||||
| // console.log("autoHeight" + autoHeight); | |||||
| results.imageWidth = autoWidth; | |||||
| results.imageheight = autoHeight; | |||||
| } else {//否则展示原来的数据 | |||||
| results.imageWidth = originalWidth; | |||||
| results.imageheight = originalHeight; | |||||
| } | |||||
| return results; | |||||
| } | |||||
| function wxParseTemArray(temArrayName,bindNameReg,total,that){ | |||||
| var array = []; | |||||
| var temData = that.data; | |||||
| var obj = null; | |||||
| for(var i = 0; i < total; i++){ | |||||
| var simArr = temData[bindNameReg+i].nodes; | |||||
| array.push(simArr); | |||||
| } | |||||
| temArrayName = temArrayName || 'wxParseTemArray'; | |||||
| obj = JSON.parse('{"'+ temArrayName +'":""}'); | |||||
| obj[temArrayName] = array; | |||||
| that.setData(obj); | |||||
| } | |||||
| /** | |||||
| * 配置emojis | |||||
| * | |||||
| */ | |||||
| function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){ | |||||
| HtmlToJson.emojisInit(reg,baseSrc,emojis); | |||||
| } | |||||
| module.exports = { | |||||
| wxParse: wxParse, | |||||
| wxParseTemArray:wxParseTemArray, | |||||
| emojisInit:emojisInit | |||||
| } | |||||
| @@ -1,963 +0,0 @@ | |||||
| <!--** | |||||
| * author: Di (微信小程序开发工程师) | |||||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||||
| * 垂直微信小程序开发交流社区 | |||||
| * | |||||
| * github地址: https://github.com/icindy/wxParse | |||||
| * | |||||
| * for: 微信小程序富文本解析 | |||||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||||
| */--> | |||||
| <!--基础元素--> | |||||
| <template name="wxParseVideo"> | |||||
| <!--增加video标签支持,并循环添加--> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <video class="{{item.classStr}} wxParse-{{item.tag}}-video" src="{{item.attr.src}}"></video> | |||||
| </view> | |||||
| </template> | |||||
| <template name="wxParseImg"> | |||||
| <image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" data-idx="{{item.imgIndex}}" src="{{item.attr.src}}" bindload="wxParseImgLoad" bindtap="wxParseImgTap" mode="widthFix" style="width:{{item.width}}px;" | |||||
| /> | |||||
| </template> | |||||
| <template name="WxEmojiView"> | |||||
| <view class="WxEmojiView wxParse-inline" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.textArray}}" tt:key=""> | |||||
| <block class="{{item.text == '\\n' ? 'wxParse-hide':''}}" tt:if="{{item.node == 'text'}}">{{item.text}}</block> | |||||
| <block tt:elif="{{item.node == 'element'}}"> | |||||
| <image class="wxEmoji" src="{{item.baseSrc}}{{item.text}}" /> | |||||
| </block> | |||||
| </block> | |||||
| </view> | |||||
| </template> | |||||
| <template name="WxParseBr"> | |||||
| <text>\n</text> | |||||
| </template> | |||||
| <!--入口模版--> | |||||
| <template name="wxParse"> | |||||
| <block tt:for="{{wxParseData}}" tt:key=""> | |||||
| <template is="wxParse0" tt:if="{{item.tag !='style'}}" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse0"> | |||||
| <!--<template is="wxParse1" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse1" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse1" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse1" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'table'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse1" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse1" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse1" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse1"> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'&&item.tag !='style'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse2" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse2" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse2" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse2" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse2" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse2"> | |||||
| <!--<template is="wxParse3" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse3" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse3" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse3" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse3" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse3" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'&&item.tag !='style'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse3"> | |||||
| <!--<template is="wxParse4" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse4" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse4" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse4" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse4" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse4" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse4"> | |||||
| <!--<template is="wxParse5" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse5" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse5" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse5" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse5" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse5" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse5"> | |||||
| <!--<template is="wxParse6" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse6" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse6" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse6" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse6" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse6" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse6"> | |||||
| <!--<template is="wxParse7" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse7" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse7" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse7" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse7" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse7" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse7"> | |||||
| <!--<template is="wxParse8" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse8" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse8" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse8" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse8" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse8" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse8"> | |||||
| <!--<template is="wxParse9" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse9" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse9" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse9" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse9" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse9" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse9"> | |||||
| <!--<template is="wxParse10" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse10" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse10" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse10" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse10" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse10" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse10"> | |||||
| <!--<template is="wxParse11" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse11" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse11" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse11" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse11" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse11" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| <!--循环模版--> | |||||
| <template name="wxParse11"> | |||||
| <!--<template is="wxParse12" data="{{item}}" />--> | |||||
| <!--判断是否是标签节点--> | |||||
| <block tt:if="{{item.node == 'element'}}"> | |||||
| <block tt:if="{{item.tag == 'button'}}"> | |||||
| <button type="default" size="mini"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse12" data="{{item}}" /> | |||||
| </block> | |||||
| </button> | |||||
| </block> | |||||
| <!--li类型--> | |||||
| <block tt:elif="{{item.tag == 'li'}}"> | |||||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||||
| </view> | |||||
| <view class="{{item.classStr}} wxParse-li-text"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse12" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </block> | |||||
| <!--video类型--> | |||||
| <block tt:elif="{{item.tag == 'video'}}"> | |||||
| <template is="wxParseVideo" data="{{item}}" /> | |||||
| </block> | |||||
| <!--img类型--> | |||||
| <block tt:elif="{{item.tag == 'img'}}"> | |||||
| <template is="wxParseImg" data="{{item}}" /> | |||||
| </block> | |||||
| <!--a类型--> | |||||
| <block tt:elif="{{item.tag == 'a'}}"> | |||||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse12" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <block tt:elif="{{item.tag == 'br'}}"> | |||||
| <template is="WxParseBr"></template> | |||||
| </block> | |||||
| <!--其他块级标签--> | |||||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse12" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--内联标签--> | |||||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||||
| <template is="wxParse12" data="{{item}}" /> | |||||
| </block> | |||||
| </view> | |||||
| </block> | |||||
| <!--判断是否是文本节点--> | |||||
| <block tt:elif="{{item.node == 'text'}}"> | |||||
| <!--如果是,直接进行--> | |||||
| <template is="WxEmojiView" data="{{item}}" /> | |||||
| </block> | |||||
| </template> | |||||
| @@ -1,208 +0,0 @@ | |||||
| /** | |||||
| * author: Di (微信小程序开发工程师) | |||||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||||
| * 垂直微信小程序开发交流社区 | |||||
| * | |||||
| * github地址: https://github.com/icindy/wxParse | |||||
| * | |||||
| * for: 微信小程序富文本解析 | |||||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||||
| */ | |||||
| .wxParse{ | |||||
| margin: 0 5px; | |||||
| font-family: Helvetica,sans-serif; | |||||
| font-size: 28rpx; | |||||
| color: #666; | |||||
| line-height: 1.8; | |||||
| } | |||||
| view{ | |||||
| word-break:break-all; | |||||
| overflow:auto; | |||||
| background: #FFF; | |||||
| } | |||||
| .wxParse-inline{ | |||||
| display: inline; | |||||
| margin: 0; | |||||
| padding: 0; | |||||
| } | |||||
| /*//标题 */ | |||||
| .wxParse-div{margin: 0;padding: 0;} | |||||
| .wxParse-h1{ font-size:2em; margin: .67em 0 } | |||||
| .wxParse-h2{ font-size:1.5em; margin: .75em 0 } | |||||
| .wxParse-h3{ font-size:1.17em; margin: .83em 0 } | |||||
| .wxParse-h4{ margin: 1.12em 0} | |||||
| .wxParse-h5 { font-size:.83em; margin: 1.5em 0 } | |||||
| .wxParse-h6{ font-size:.75em; margin: 1.67em 0 } | |||||
| .wxParse-h1 { | |||||
| font-size: 18px; | |||||
| font-weight: 400; | |||||
| margin-bottom: .9em; | |||||
| } | |||||
| .wxParse-h2 { | |||||
| font-size: 16px; | |||||
| font-weight: 400; | |||||
| margin-bottom: .34em; | |||||
| } | |||||
| .wxParse-h3 { | |||||
| font-weight: 400; | |||||
| font-size: 15px; | |||||
| margin-bottom: .34em; | |||||
| } | |||||
| .wxParse-h4 { | |||||
| font-weight: 400; | |||||
| font-size: 14px; | |||||
| margin-bottom: .24em; | |||||
| } | |||||
| .wxParse-h5 { | |||||
| font-weight: 400; | |||||
| font-size: 13px; | |||||
| margin-bottom: .14em; | |||||
| } | |||||
| .wxParse-h6 { | |||||
| font-weight: 400; | |||||
| font-size: 12px; | |||||
| margin-bottom: .04em; | |||||
| } | |||||
| .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder } | |||||
| .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic} | |||||
| .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace} | |||||
| .wxParse-pre{white-space:pre} | |||||
| .wxParse-big{font-size:1.17em} | |||||
| .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em} | |||||
| .wxParse-sub{vertical-align:sub} | |||||
| .wxParse-sup{vertical-align:super} | |||||
| .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through} | |||||
| /*wxparse-自定义个性化的css样式*/ | |||||
| /*增加video的css样式*/ | |||||
| .wxParse-strong,.wxParse-s{display: inline} | |||||
| .wxParse-a{ | |||||
| color: deepskyblue; | |||||
| word-break:break-all; | |||||
| overflow:auto; | |||||
| } | |||||
| .wxParse-video{ | |||||
| text-align: center; | |||||
| margin: 10px 0; | |||||
| } | |||||
| .wxParse-video-video{ | |||||
| width:100%; | |||||
| } | |||||
| .wxParse-img{ | |||||
| /*background-color: #efefef;*/ | |||||
| overflow: hidden; | |||||
| } | |||||
| .wxParse-blockquote { | |||||
| margin: 0; | |||||
| padding:10px 0 10px 5px; | |||||
| font-family:Courier, Calibri,"宋体"; | |||||
| background:#f5f5f5; | |||||
| border-left: 3px solid #dbdbdb; | |||||
| } | |||||
| .wxParse-code,.wxParse-wxxxcode-style{ | |||||
| display: inline; | |||||
| background:#f5f5f5; | |||||
| } | |||||
| .wxParse-ul{ | |||||
| margin: 20rpx 10rpx; | |||||
| } | |||||
| .wxParse-li,.wxParse-li-inner{ | |||||
| display: flex; | |||||
| align-items: baseline; | |||||
| margin: 10rpx 0; | |||||
| } | |||||
| .wxParse-li-text{ | |||||
| align-items: center; | |||||
| line-height: 20px; | |||||
| } | |||||
| .wxParse-li-circle{ | |||||
| display: inline-flex; | |||||
| width: 5px; | |||||
| height: 5px; | |||||
| background-color: #333; | |||||
| margin-right: 5px; | |||||
| } | |||||
| .wxParse-li-square{ | |||||
| display: inline-flex; | |||||
| width: 10rpx; | |||||
| height: 10rpx; | |||||
| background-color: #333; | |||||
| margin-right: 5px; | |||||
| } | |||||
| .wxParse-li-ring{ | |||||
| display: inline-flex; | |||||
| width: 10rpx; | |||||
| height: 10rpx; | |||||
| border: 2rpx solid #333; | |||||
| border-radius: 50%; | |||||
| background-color: #fff; | |||||
| margin-right: 5px; | |||||
| } | |||||
| /*.wxParse-table{ | |||||
| width: 100%; | |||||
| height: 400px; | |||||
| } | |||||
| .wxParse-thead,.wxParse-tfoot,.wxParse-tr{ | |||||
| display: flex; | |||||
| flex-direction: row; | |||||
| } | |||||
| .wxParse-th,.wxParse-td{ | |||||
| display: flex; | |||||
| width: 580px; | |||||
| overflow: auto; | |||||
| }*/ | |||||
| .wxParse-u { | |||||
| text-decoration: underline; | |||||
| } | |||||
| .wxParse-hide{ | |||||
| display: none; | |||||
| } | |||||
| .WxEmojiView{ | |||||
| align-items: center; | |||||
| } | |||||
| .wxEmoji{ | |||||
| width: 16px; | |||||
| height:16px; | |||||
| } | |||||
| .wxParse-tr{ | |||||
| display: flex; | |||||
| border-right:1px solid #e0e0e0; | |||||
| border-bottom:1px solid #e0e0e0; | |||||
| border-top:1px solid #e0e0e0; | |||||
| } | |||||
| .wxParse-th, | |||||
| .wxParse-td{ | |||||
| flex:1; | |||||
| padding:5px; | |||||
| font-size:28rpx; | |||||
| border-left:1px solid #e0e0e0; | |||||
| word-break: break-all; | |||||
| } | |||||
| .wxParse-td:last{ | |||||
| border-top:1px solid #e0e0e0; | |||||
| } | |||||
| .wxParse-th{ | |||||
| background:#f0f0f0; | |||||
| border-top:1px solid #e0e0e0; | |||||
| } | |||||
| .wxParse-del{ | |||||
| display: inline; | |||||
| } | |||||
| .wxParse-figure { | |||||
| overflow: hidden; | |||||
| } | |||||