Pārlūkot izejas kodu

【代码提交】

master
gou_le pirms 3 gadiem
vecāks
revīzija
c6bf33f086
44 mainītis faili ar 1284 papildinājumiem un 5267 dzēšanām
  1. +1
    -1
      app.js
  2. +2
    -1
      app.json
  3. +1
    -0
      config/config.js
  4. +82
    -7
      pages/UpHome/UpHome.js
  5. +18
    -2
      pages/UpHome/UpHome.ttml
  6. +79
    -0
      pages/UpHome/UpHome.ttss
  7. +19
    -3
      pages/category/category.js
  8. +43
    -60
      pages/category/category.ttml
  9. +1
    -1
      pages/category/category.ttss
  10. +70
    -28
      pages/classDetails/classDetails.js
  11. +8
    -5
      pages/classDetails/classDetails.ttml
  12. +28
    -1
      pages/classDetails/classDetails.ttss
  13. +11
    -1
      pages/course/course.js
  14. +1
    -0
      pages/course/course.ttml
  15. +27
    -14
      pages/course/course.ttss
  16. +12
    -4
      pages/index/index.js
  17. +229
    -300
      pages/index/index.ttml
  18. +16
    -1
      pages/index/index.ttss
  19. +41
    -0
      pages/integral/integral.js
  20. +6
    -0
      pages/integral/integral.json
  21. +29
    -0
      pages/integral/integral.ttml
  22. +61
    -0
      pages/integral/integral.ttss
  23. +10
    -0
      pages/mianCollect/mianCollect.js
  24. +11
    -2
      pages/mianCollect/mianCollect.ttss
  25. +6
    -8
      pages/order/order.js
  26. +5
    -0
      pages/order/order.ttss
  27. +5
    -23
      pages/publicity/publicity.js
  28. +5
    -2
      pages/publicity/publicity.ttml
  29. +20
    -0
      pages/publicity/publicity.ttss
  30. +4
    -0
      pages/ranking/ranking.ttss
  31. +39
    -13
      pages/search/search.js
  32. +95
    -111
      pages/search/search.ttml
  33. +18
    -15
      pages/search/search.ttss
  34. +164
    -76
      pages/user/user.js
  35. +31
    -4
      pages/user/user.ttml
  36. +84
    -5
      pages/user/user.ttss
  37. +2
    -2
      project.config.json
  38. +0
    -318
      wxParse/html2json.js
  39. +0
    -192
      wxParse/htmlparser.js
  40. +0
    -2532
      wxParse/showdown.js
  41. +0
    -207
      wxParse/wxDiscode.js
  42. +0
    -157
      wxParse/wxParse.js
  43. +0
    -963
      wxParse/wxParse.ttml
  44. +0
    -208
      wxParse/wxParse.wxss

+ 1
- 1
app.js Parādīt failu

@@ -15,7 +15,7 @@ App({
try {
var res = tt.getSystemInfoSync();
that.statusBarHeight = res.statusBarHeight
console.log(`手机型号为 ${res.platform}`);
console.log(res,"型号");
this.globalData.platform = res.platform
} catch (error) {
console.log(`获取系统信息失败`);


+ 2
- 1
app.json Parādīt failu

@@ -13,7 +13,8 @@
"pages/mianCollect/mianCollect",
"pages/UpHome/UpHome",
"pages/publicity/publicity",
"pages/upEnter/upEnter"
"pages/upEnter/upEnter",
"pages/integral/integral"
],
"usingComponents": {},
"window":{


+ 1
- 0
config/config.js Parādīt failu

@@ -15,6 +15,7 @@ let config = {
getAuthor:"/merchant/listV1",//查询作者
checkUserInfo:"/user/checkWechatStatus",//用户是否授权
userInfo:"/user/getUserInfo",//用户授权
getUserInfo:"/user/userinfo",//获取用户信息
mainCollet:"/ttCoupon/collectList",//我的收藏
getUpUser:"/merchant/findById",//up类容
getPublicity:"/wxCampaign/list",//轮播图


+ 82
- 7
pages/UpHome/UpHome.js Parādīt failu

@@ -14,6 +14,33 @@ Page({
classList:[],//课程列表
dNum:"",//但课程数
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
Http.get({
@@ -75,12 +102,25 @@ Page({
})
},
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() {
console.log("到底了");
@@ -89,5 +129,40 @@ Page({
})
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: ``, // 分享的路径
}
}
},
})

+ 18
- 2
pages/UpHome/UpHome.ttml Parādīt failu

@@ -1,4 +1,4 @@
<view id="BoxBg">
<view id="BoxBg" bindtap="hieaddCheck">
<view class="Box">
<navbar back text="{{name}}" background=" rgba(255, 255, 255, 0);" color="#fff"></navbar>
<image class="backImg" src="{{imgHttps+'upzy_tab_bnt.png'}}" mode="" />
@@ -21,7 +21,7 @@
</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="" />
<view class="textBox">
<view class="titile">{{item.title}}</view>
@@ -45,6 +45,22 @@
</view>
</view>
</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>

+ 79
- 0
pages/UpHome/UpHome.ttss Parādīt failu

@@ -150,6 +150,11 @@
font-weight: 500;
font-size: 26rpx;
color: #8790A8;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:1
}
.incomeBox{
margin-top: 10rpx;
@@ -181,4 +186,78 @@
.moodsNum{
float: right;
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;
}

+ 19
- 3
pages/category/category.js Parādīt failu

@@ -5,6 +5,7 @@ const config = require("../../config/config.js");
const Http = require("../../utils/HttpBasics")
Page({
data: {
imgHttps:app.globalData.imgHttps,
navigationBarHeight,
navigationBarHeight2,
activityFlag: 0,
@@ -13,6 +14,7 @@ Page({
pageNum:1,
dataLsit:[],//数据列表
inputValue:'',//搜索框值
noDAtaFlag:false,//
},
setActiviy(e){
let index = e.currentTarget.dataset.index
@@ -60,7 +62,9 @@ Page({
})
},
getLsit(){
console.log(666);
tt.showLoading({
title: '加载中...', // 内容
});
Http.get({
url:config.api.columnLsit,
data:{
@@ -77,13 +81,25 @@ Page({
}else{
list = res.data.list
}
if(list.length==0){
this.setData({
noDAtaFlag:true
})
}else{
this.setData({
noDAtaFlag:false
})
}
this.setData({
dataLsit:list
})
tt.hideLoading();
}).catch(err=>{
tt.hideLoading();
tt.showToast({
title: err.message, // 内容
});
title: err.message?err.message:err.data, // 内容
icon:"none"
});
})
},
onLoad(options){


+ 43
- 60
pages/category/category.ttml Parādīt failu

@@ -1,67 +1,50 @@

<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 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 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 class="noDataBox" tt:if="{{noDAtaFlag}}">
<image class="noDataImg" src="{{imgHttps+'no_result.png'}}" mode="" />
</view>
</view>
</view>

</view>
</view>
</view>

+ 1
- 1
pages/category/category.ttss Parādīt failu

@@ -27,7 +27,7 @@
/* float: left; */
position: fixed;
top: 270rpx;
height: 1200rpx;
height: 1000rpx;
overflow: scroll;
}
.columnBox::-webkit-scrollbar {


+ 70
- 28
pages/classDetails/classDetails.js Parādīt failu

@@ -2,10 +2,13 @@ const app = getApp()
const navigationBarHeight = (getApp().statusBarHeight + 44) + "px"
const config = require("../../config/config")
const Http = require("../../utils/HttpBasics.js")

Page({
data: {
showAddBox:{},
ifPay: app.globalData.platform,
direction:-90,
screenFlag: false,
showAddBox: {},
signal: app.globalData.platform,
classTitle: "",//课程标题
showIos: false,//ios字符提示
showHie: false,//提示框
@@ -54,6 +57,42 @@ Page({
// goIndent(e){
// 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() {
this.setData({
showIos: true
@@ -122,14 +161,14 @@ Page({
duration: 1000,
timingFunction: "ease",
});
animation.opacity(0).step()
animation.translateX(400).step()
this.setData({
// extraClasses: 'addBox-transition',
showAddBox:animation.export(),
showAddBox: animation.export(),
addFlag: true
})
},
showAddCheck:function(){
showAddCheck: function () {
this.setData({
addFlag: false
})
@@ -137,27 +176,12 @@ Page({
duration: 1000,
timingFunction: "ease",
});
animation.opacity(1).step()
animation.translateX(0).step()
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) {
let index = e.currentTarget.dataset.index
this.setData({
@@ -259,7 +283,7 @@ Page({
})
}).catch(err => {
tt.showToast({
title: '唤起支付失败', // 内容
title: err.message ? err.message : err.data, // 内容
icon: "none"
});
})
@@ -321,6 +345,7 @@ Page({
}

},

setCollect() {//设置收藏
if (this.data.iscollect) {//已收藏
Http.get({
@@ -394,7 +419,20 @@ Page({
videoId: id
}
}).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({
mp4Url: res.data.videoUrl
})
@@ -407,11 +445,12 @@ Page({
});
})
},
onReady() {
this.setData({
videoContext: wx.createVideoContext('myVideo')
})
this.itiRecording()
},
onLoad(options) {
if (app.globalData.token) {
@@ -443,10 +482,13 @@ Page({
duration: 0,
// timingFunction: "ease",
});
animation.opacity(0).step()
animation.translateX(400).step()
this.setData({
showAddBox:animation.export(),
showAddBox: animation.export(),
screenFlag:false,//初始化防录屏弹框
})
// this.itiRecording()
},
onShareAppMessage: function (shareOption) {
console.log(this.data.data.dyTitle);


+ 8
- 5
pages/classDetails/classDetails.ttml Parādīt failu

@@ -3,9 +3,9 @@
<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>
<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="titleBox">
<view class="title">{{data.title}}</view>
@@ -178,11 +178,14 @@
<image class="consult" src="{{imgHttps+'details_bat_zx.png'}}" mode=""/>
<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 class="temp"></view> -->

<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>

+ 28
- 1
pages/classDetails/classDetails.ttss Parādīt failu

@@ -219,7 +219,7 @@
position: fixed;
right: 0;
bottom: 274rpx;
z-index: 100000000000000000;
z-index: 10000;
}
.addBox{
padding: 0 40rpx;
@@ -674,3 +674,30 @@ button {
top: 200px;
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; */
}

+ 11
- 1
pages/course/course.js Parādīt failu

@@ -46,7 +46,7 @@ Page({
});
}}).catch(err=>{
tt.showToast({
title: err.message, // 内容
title: err.message?err.message:err.data,
icon:"none"
});
})
@@ -64,6 +64,9 @@ Page({
})
},
search() {
tt.showLoading({
title: '加载中...', // 内容
});
Http.get({
url: config.api.getOrderLsit,
data: {
@@ -85,6 +88,13 @@ Page({
list: res.data.list
})
}
tt.hideLoading();
}).catch(err=>{
tt.hideLoading();
tt.showToast({
title: err.message?err.message:err.data, // 内容
icon:"none"
});
})
},
onLoad() {


+ 1
- 0
pages/course/course.ttml Parādīt failu

@@ -124,6 +124,7 @@
</navigator>
<view class="noDataBox" tt:if="{{list.length==0}}" >
<image class="noDataImg" src="{{imgHttps+'no_content.png'}}" mode="" />
<view class="noDataText">您暂未购买此课程!</view>
</view>

</view>


+ 27
- 14
pages/course/course.ttss Parādīt failu

@@ -168,7 +168,7 @@
width: 350rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 36rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FEFEFE;
@@ -195,27 +195,34 @@
-webkit-line-clamp:1;
}
.moreBox{
width: 340rpx;
margin-top: 30rpx;
position: relative;
}
.user{
float: left;
width: 60rpx;
height: 60rpx;
position: absolute;
width: 50rpx;
height: 50rpx;
border-radius: 50%;
background-color: beige;
top: 0;
left: 0;
}
.userText{
width: 200rpx;
text-align: center;
height: 60rpx;
line-height: 60rpx;
background: #222735;
padding-left:70rpx ;
padding-right:50rpx ;
float: left;
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{
position: absolute;
@@ -242,6 +249,12 @@
height: 400rpx;
margin-top: 200rpx;
}
.noDataText{
position: absolute;
color: #9999cc;
top: 730rpx;
left: 35%;
}
.instrumentBox{
width: 100%;
background: #1F232E;


+ 12
- 4
pages/index/index.js Parādīt failu

@@ -1,5 +1,6 @@
const app = getApp()
const config = require("../../config/config")
const { log } = require("../../utils/HttpBasics.js")
const Http = require("../../utils/HttpBasics.js")
const navigationBarHeight = (getApp().statusBarHeight + 44) + "px"
const convert = require("../../utils/util.js")
@@ -29,11 +30,18 @@ Page({
});
},
goPublicity(e) {
let id = e.currentTarget.dataset.id
let type = e.currentTarget.dataset.type
tt.navigateTo({
url: `/pages/publicity/publicity?id=${id}&type=${type}` // 指定页面的url
});
if(type==4){
tt.navigateTo({
url: `/pages/upEnter/upEnter` // 指定页面的url
});
}else{
tt.navigateTo({
url: `/pages/publicity/publicity?id=${id}&type=${type}` // 指定页面的url
});
}
},
getNweDataLsit() {//今天推荐
Http.get({
@@ -150,7 +158,7 @@ Page({
url: config.api.getAuthor,
data: {
pageNum: this.data.authoPageNum,
pageSize: 4,
pageSize: 7,
mark: 1,
sortColumn: "markTime",
sortOrder: "desc"


+ 229
- 300
pages/index/index.ttml Parādīt failu

@@ -1,95 +1,79 @@
<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>
<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 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 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 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"
lazy-load="false" binderror="" bindload="" />
<view class="exchangeText">
@@ -97,80 +81,66 @@
</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 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 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 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
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"
@@ -180,83 +150,63 @@
</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 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 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 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 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 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"
lazy-load="false" binderror="" bindload="" />
<view class="exchangeText">
@@ -264,79 +214,64 @@
</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 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 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
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"
@@ -346,13 +281,7 @@
</view>

</view> -->

</view>

</view>

</view>
</view>



</view>
</view>
</view>

+ 16
- 1
pages/index/index.ttss Parādīt failu

@@ -10,6 +10,7 @@
}
.topBox{
height: 70rpx;
line-height: 20rpx;
color: #666666;
margin-top: 10rpx;
}
@@ -34,7 +35,9 @@
margin-left: 12rpx;
}
.item{
width: 80rpx;
/* width: 80rpx; */
height: 60rpx;
height: 60rpx;
margin: 0 20rpx;
position: relative;
display: inline-block;
@@ -43,8 +46,10 @@
.title_a{
font-size: 34rpx;
color: #00cc99;
padding-bottom: 10rpx;
}
.title{
line-height: 60rpx;
color: #666666;
}
.wire{
@@ -367,6 +372,11 @@ overflow: hidden;
text-align: center;
line-height: 50rpx;
color: #9999cc;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:1
}
.introduce{
width: 96%;
@@ -455,6 +465,11 @@ overflow: hidden;
font-family: OPPOSans;
font-weight: 500;
color: #FFFFFF;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:1;
}
.authorText{
width: 90%;


+ 41
- 0
pages/integral/integral.js Parādīt failu

@@ -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,
},
]
}
})

+ 6
- 0
pages/integral/integral.json Parādīt failu

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "我的积分",
"usingComponents": {
"navbar": "../../components/navbar/navbar"
}
}

+ 29
- 0
pages/integral/integral.ttml Parādīt failu

@@ -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>

+ 61
- 0
pages/integral/integral.ttss Parādīt failu

@@ -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;
}

+ 10
- 0
pages/mianCollect/mianCollect.js Parādīt failu

@@ -58,6 +58,9 @@ Page({
})
},
search() {
tt.showLoading({
title: '加载中...', // 内容
});
Http.get({
url: config.api.mainCollet,
data: {
@@ -78,6 +81,13 @@ Page({
list: res.data.list
})
}
tt.hideLoading();
}).catch(err=>{
tt.hideLoading();
tt.showToast({
title: err.message?err.message:err.data, // 内容
icon:"none"
});
})
},
onLoad() {


+ 11
- 2
pages/mianCollect/mianCollect.ttss Parādīt failu

@@ -77,13 +77,17 @@
position: relative;
}
.user{
float: left;
position: absolute;
width: 50rpx;
height: 50rpx;
border-radius: 50%;
background-color: beige;
top: 0;
left: 0;
}
.userText{
padding-left:50rpx ;
padding-right:20rpx ;
width: 200rpx;
text-align: center;
height: 50rpx;
@@ -94,6 +98,11 @@
font-weight: 500;
font-size: 26rpx;
color: #8790A8;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:1
}
.show{
position: absolute;


+ 6
- 8
pages/order/order.js Parādīt failu

@@ -2,7 +2,8 @@ const app = getApp()
const navigationBarHeight = (getApp().statusBarHeight + 44) + "px"
const config = require("../../config/config")
const util = require("../../utils/util");
const Http = require("../../utils/HttpBasics.js")
const Http = require("../../utils/HttpBasics.js");

Page({
data: {
navigationBarHeight,
@@ -115,7 +116,7 @@ Page({
})
}).catch(err => {
tt.showToast({
title: '唤起支付失败', // 内容
title: err.message?err.message:err.data, // 内容
icon: "none"
});
})
@@ -135,7 +136,6 @@ Page({
} else {//已支付
tempArr.push(...[2, 4, 5, 6])
}
console.log(tempArr);
Http.get({
url: config.api.getOrderLsit,
data: {
@@ -149,13 +149,11 @@ Page({
item.createDate = util.formatTime(item.createDate, "yyyy-MM-dd hh:mm:ss")
})
if(this.data.pageNum>1){
let tempLsit = this.data.orderLsit
let tempArr = tempLsit.push(...arr)
let tempArrLsit = [...tempLsit,...arr]
this.setData({
orderLsit:tempArr,
noDAtaFlag:tempArr.length==0?true: false,
orderLsit:tempArrLsit,
noDAtaFlag:tempArrLsit.length==0?true: false,
})
}else{
this.setData({


+ 5
- 0
pages/order/order.ttss Parādīt failu

@@ -101,6 +101,11 @@ text-align: center;
text-align: center;
line-height: 50rpx;
color: #9999cc;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:1
}
.name{
width: 220rpx;


+ 5
- 23
pages/publicity/publicity.js Parādīt failu

@@ -2,7 +2,7 @@ const app = getApp()
const config = require("../../config/config")
const Http = require("../../utils/HttpBasics.js")
const navigationBarHeight = (getApp().statusBarHeight + 44)+"px"
var WxParse = require('../../wxParse/wxParse.js');
// var WxParse = require('../../wxParse/wxParse.js');
const convert = require("../../utils/util.js")
Page({
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){//跳转详情
let id = e.currentTarget.dataset.id
let title = e.currentTarget.dataset.title
@@ -58,20 +42,18 @@ Page({
});
},
onLoad:function (params) {
const that = this;
console.log(params.id);
if(params.id &&params.type==1){//宣传页
that.setData({
this.setData({
id:params.id,
type:params.type
})
that.getData()
this.getData()
}else if(params.id &&params.type==2){//图文
that.setData({
this.setData({
id:params.id,
type:params.type
})
that.getHtml(params.id,that)
this.getData()
}
},
})

+ 5
- 2
pages/publicity/publicity.ttml Parādīt failu

@@ -41,9 +41,12 @@
</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}}">
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
</view> -->
</view>
</view>

+ 20
- 0
pages/publicity/publicity.ttss Parādīt failu

@@ -95,6 +95,11 @@
text-align: center;
line-height: 50rpx;
color: #9999cc;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:1
}
.incomeBox{
margin-top: 20rpx;
@@ -176,4 +181,19 @@
line-height: 46rpx;
top: 0rpx;
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; */
}

+ 4
- 0
pages/ranking/ranking.ttss Parādīt failu

@@ -91,6 +91,10 @@
text-align: center;
line-height: 50rpx;
color: #9999cc;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:1
}
.incomeBox{
margin-top: 10rpx;


+ 39
- 13
pages/search/search.js Parādīt failu

@@ -23,7 +23,6 @@ Page({
this.setData({
activityFlag:index,
pageNum:1,
inputValue:"",
noDAtaFlag:false,
list:[]
})
@@ -44,6 +43,9 @@ Page({
this.search()
},
search(){//查询
tt.showLoading({
title: '加载中...', // 内容
});
let url = ""
let data=""
if(this.data.activityFlag==0){//课程
@@ -66,7 +68,6 @@ Page({
data:data
}).then(res=>{
let arr = []

if(res.data.list!=0&&res.data.list[0].businessTypes){
arr = res.data.list
let sting = ""
@@ -82,45 +83,70 @@ Page({
})
let tempArr = this.data.list
if(this.data.pageNum>1){
let contArr= tempArr.push(...arr)
// let contArr= tempArr.push(...arr)
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{
this.setData({
list:arr,
noDAtaFlag:arr.length==0?true:false
})
}
tt.hideLoading();
}else{
if(this.pageNum>1){
if(this.data.pageNum>1){
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({
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{
this.setData({
list:res.data.list,
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(){
this.search()
},
onReachBottom:function(){
console.log("到底了");
this.setData({
pageNum:this.data.pageNum+1
})
this.search()
}
})

+ 95
- 111
pages/search/search.ttml Parādīt failu

@@ -1,43 +1,43 @@
<view id="BoxBg">
<view class="Box">
<view class="Box">
<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="recommendLogo"></view>
<view class="recommendText">推荐搜索</view>
</view>
<view class="authorItemBox">
<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 class="name">
张三
</view>
<view class="categoryBox oh">
<view class="categoryTtem" tt:for="{{2}}">
金融
@@ -46,99 +46,83 @@
</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>

<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 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 class="bean">
1058万粉丝
</view> -->
</view>
</view>
<!-- <view class="attentionBox">
</view>
</view>
<!-- <view class="attentionBox">
+ 关注
</view> -->
<!-- <view class="attentionBoxHie">
<!-- <view class="attentionBoxHie">
已关注
</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>

+ 18
- 15
pages/search/search.ttss Parādīt failu

@@ -1,5 +1,5 @@
.Box{
height: 100vh;
/* height: 100vh; */
overflow: scroll;
min-height: 100vh;
}
@@ -92,13 +92,7 @@
border-radius: 50%;
margin: 20rpx auto;
}
.name{
line-height: 72rpx;
text-align: center;
color: #ffffff;
font-size: 36rpx;
text-align: center;
}

.categoryBox{
display: flex;
justify-content: center;
@@ -183,21 +177,30 @@
-webkit-line-clamp:1;
}
.headImg{
position: absolute;
width: 50rpx;
height: 50rpx;
border-radius: 50%;
float: left;
top: 0;
left: 0;
}
.name{
width: 220rpx;
line-height: 50rpx;
height: 50rpx;
padding-left:70rpx ;
padding-right:50rpx ;
float: left;
border-radius: 50rpx;
color: #8790A8;
height: 50rpx;
background-color: #333;
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{
/* margin-top: 20rpx; */


+ 164
- 76
pages/user/user.js Parādīt failu

@@ -4,84 +4,172 @@ const config = require("../../config/config")
const Http = require("../../utils/HttpBasics.js")
const navigationBarHeight = (getApp().statusBarHeight + 44) + "px"
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',
})
}
}
});
})



},
});
}
})

+ 31
- 4
pages/user/user.ttml Parādīt failu

@@ -16,11 +16,12 @@
</view>
<!-- <image class="go" src="../../assets/images/arrow-right-bold.png" mode="aspectFit|aspectFill|widthFix"
lazy-load="false" binderror="" bindload="" /> -->

</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 class="functionBox oh">
@@ -67,6 +68,17 @@

</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" >
<image class="logo" src="{{imgHttps+'me_icon_zxkf.png'}}" mode="aspectFit|aspectFill|widthFix"
@@ -106,5 +118,20 @@


</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>

+ 84
- 5
pages/user/user.ttss Parādīt failu

@@ -24,7 +24,7 @@ margin-top: 40rpx;
margin-left: 20rpx;
}
.nameGoBox{
margin-top: 30rpx;
margin-top: 20rpx;
}
.name{
font-size: 36rpx;
@@ -40,11 +40,20 @@ margin-top: 40rpx;
height: 30rpx;
float: right;
}
.phoneBox{
margin-top: 10rpx;
font-family: OPPOSans;
font-weight: 400;
color: #8790A8;
}
.phone{

font-family: OPPOSans;
font-weight: 400;
color: #8790A8;
float: left;
margin-left: 20rpx;
}
.phoneBtn{
float: left;
color: #07E881;
margin-left: 20rpx;
}
.functionBox{
margin-top: 30rpx ;
@@ -119,3 +128,73 @@ margin-top: 30rpx ;
.Box{
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;
}

+ 2
- 2
project.config.json Parādīt failu

@@ -18,8 +18,8 @@
{
"id": 1625040084950,
"name": "classDetails",
"pathName": "pages/classDetails/classDetails",
"query": "id=568597357595095040",
"pathName": "pages/user/user",
"query": "",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"


+ 0
- 318
wxParse/html2json.js Parādīt failu

@@ -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
};


+ 0
- 192
wxParse/htmlparser.js Parādīt failu

@@ -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;

+ 0
- 2532
wxParse/showdown.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 0
- 207
wxParse/wxDiscode.js Parādīt failu

@@ -1,207 +0,0 @@
// HTML 支持的数学符号
function strNumDiscode(str){
str = str.replace(/&forall;/g, '∀');
str = str.replace(/&part;/g, '∂');
str = str.replace(/&exists;/g, '∃');
str = str.replace(/&empty;/g, '∅');
str = str.replace(/&nabla;/g, '∇');
str = str.replace(/&isin;/g, '∈');
str = str.replace(/&notin;/g, '∉');
str = str.replace(/&ni;/g, '∋');
str = str.replace(/&prod;/g, '∏');
str = str.replace(/&sum;/g, '∑');
str = str.replace(/&minus;/g, '−');
str = str.replace(/&lowast;/g, '∗');
str = str.replace(/&radic;/g, '√');
str = str.replace(/&prop;/g, '∝');
str = str.replace(/&infin;/g, '∞');
str = str.replace(/&ang;/g, '∠');
str = str.replace(/&and;/g, '∧');
str = str.replace(/&or;/g, '∨');
str = str.replace(/&cap;/g, '∩');
str = str.replace(/&cap;/g, '∪');
str = str.replace(/&int;/g, '∫');
str = str.replace(/&there4;/g, '∴');
str = str.replace(/&sim;/g, '∼');
str = str.replace(/&cong;/g, '≅');
str = str.replace(/&asymp;/g, '≈');
str = str.replace(/&ne;/g, '≠');
str = str.replace(/&le;/g, '≤');
str = str.replace(/&ge;/g, '≥');
str = str.replace(/&sub;/g, '⊂');
str = str.replace(/&sup;/g, '⊃');
str = str.replace(/&nsub;/g, '⊄');
str = str.replace(/&sube;/g, '⊆');
str = str.replace(/&supe;/g, '⊇');
str = str.replace(/&oplus;/g, '⊕');
str = str.replace(/&otimes;/g, '⊗');
str = str.replace(/&perp;/g, '⊥');
str = str.replace(/&sdot;/g, '⋅');
return str;
}

//HTML 支持的希腊字母
function strGreeceDiscode(str){
str = str.replace(/&Alpha;/g, 'Α');
str = str.replace(/&Beta;/g, 'Β');
str = str.replace(/&Gamma;/g, 'Γ');
str = str.replace(/&Delta;/g, 'Δ');
str = str.replace(/&Epsilon;/g, 'Ε');
str = str.replace(/&Zeta;/g, 'Ζ');
str = str.replace(/&Eta;/g, 'Η');
str = str.replace(/&Theta;/g, 'Θ');
str = str.replace(/&Iota;/g, 'Ι');
str = str.replace(/&Kappa;/g, 'Κ');
str = str.replace(/&Lambda;/g, 'Λ');
str = str.replace(/&Mu;/g, 'Μ');
str = str.replace(/&Nu;/g, 'Ν');
str = str.replace(/&Xi;/g, 'Ν');
str = str.replace(/&Omicron;/g, 'Ο');
str = str.replace(/&Pi;/g, 'Π');
str = str.replace(/&Rho;/g, 'Ρ');
str = str.replace(/&Sigma;/g, 'Σ');
str = str.replace(/&Tau;/g, 'Τ');
str = str.replace(/&Upsilon;/g, 'Υ');
str = str.replace(/&Phi;/g, 'Φ');
str = str.replace(/&Chi;/g, 'Χ');
str = str.replace(/&Psi;/g, 'Ψ');
str = str.replace(/&Omega;/g, 'Ω');

str = str.replace(/&alpha;/g, 'α');
str = str.replace(/&beta;/g, 'β');
str = str.replace(/&gamma;/g, 'γ');
str = str.replace(/&delta;/g, 'δ');
str = str.replace(/&epsilon;/g, 'ε');
str = str.replace(/&zeta;/g, 'ζ');
str = str.replace(/&eta;/g, 'η');
str = str.replace(/&theta;/g, 'θ');
str = str.replace(/&iota;/g, 'ι');
str = str.replace(/&kappa;/g, 'κ');
str = str.replace(/&lambda;/g, 'λ');
str = str.replace(/&mu;/g, 'μ');
str = str.replace(/&nu;/g, 'ν');
str = str.replace(/&xi;/g, 'ξ');
str = str.replace(/&omicron;/g, 'ο');
str = str.replace(/&pi;/g, 'π');
str = str.replace(/&rho;/g, 'ρ');
str = str.replace(/&sigmaf;/g, 'ς');
str = str.replace(/&sigma;/g, 'σ');
str = str.replace(/&tau;/g, 'τ');
str = str.replace(/&upsilon;/g, 'υ');
str = str.replace(/&phi;/g, 'φ');
str = str.replace(/&chi;/g, 'χ');
str = str.replace(/&psi;/g, 'ψ');
str = str.replace(/&omega;/g, 'ω');
str = str.replace(/&thetasym;/g, 'ϑ');
str = str.replace(/&upsih;/g, 'ϒ');
str = str.replace(/&piv;/g, 'ϖ');
str = str.replace(/&middot;/g, '·');
return str;
}

//

function strcharacterDiscode(str){
// 加入常用解析
str = str.replace(/&nbsp;/g, ' ');
str = str.replace(/&quot;/g, "'");
str = str.replace(/&amp;/g, '&');
// str = str.replace(/&lt;/g, '‹');
// str = str.replace(/&gt;/g, '›');

str = str.replace(/&lt;/g, '<');
str = str.replace(/&gt;/g, '>');
str = str.replace(/&#8226;/g, '•');

return str;
}

// HTML 支持的其他实体
function strOtherDiscode(str){
str = str.replace(/&OElig;/g, 'Œ');
str = str.replace(/&oelig;/g, 'œ');
str = str.replace(/&Scaron;/g, 'Š');
str = str.replace(/&scaron;/g, 'š');
str = str.replace(/&Yuml;/g, 'Ÿ');
str = str.replace(/&fnof;/g, 'ƒ');
str = str.replace(/&circ;/g, 'ˆ');
str = str.replace(/&tilde;/g, '˜');
str = str.replace(/&ensp;/g, '');
str = str.replace(/&emsp;/g, '');
str = str.replace(/&thinsp;/g, '');
str = str.replace(/&zwnj;/g, '');
str = str.replace(/&zwj;/g, '');
str = str.replace(/&lrm;/g, '');
str = str.replace(/&rlm;/g, '');
str = str.replace(/&ndash;/g, '–');
str = str.replace(/&mdash;/g, '—');
str = str.replace(/&lsquo;/g, '‘');
str = str.replace(/&rsquo;/g, '’');
str = str.replace(/&sbquo;/g, '‚');
str = str.replace(/&ldquo;/g, '“');
str = str.replace(/&rdquo;/g, '”');
str = str.replace(/&bdquo;/g, '„');
str = str.replace(/&dagger;/g, '†');
str = str.replace(/&Dagger;/g, '‡');
str = str.replace(/&bull;/g, '•');
str = str.replace(/&hellip;/g, '…');
str = str.replace(/&permil;/g, '‰');
str = str.replace(/&prime;/g, '′');
str = str.replace(/&Prime;/g, '″');
str = str.replace(/&lsaquo;/g, '‹');
str = str.replace(/&rsaquo;/g, '›');
str = str.replace(/&oline;/g, '‾');
str = str.replace(/&euro;/g, '€');
str = str.replace(/&trade;/g, '™');

str = str.replace(/&larr;/g, '←');
str = str.replace(/&uarr;/g, '↑');
str = str.replace(/&rarr;/g, '→');
str = str.replace(/&darr;/g, '↓');
str = str.replace(/&harr;/g, '↔');
str = str.replace(/&crarr;/g, '↵');
str = str.replace(/&lceil;/g, '⌈');
str = str.replace(/&rceil;/g, '⌉');

str = str.replace(/&lfloor;/g, '⌊');
str = str.replace(/&rfloor;/g, '⌋');
str = str.replace(/&loz;/g, '◊');
str = str.replace(/&spades;/g, '♠');
str = str.replace(/&clubs;/g, '♣');
str = str.replace(/&hearts;/g, '♥');

str = str.replace(/&diams;/g, '♦');
str = str.replace(/&#39;/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
}

+ 0
- 157
wxParse/wxParse.js Parādīt failu

@@ -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
}



+ 0
- 963
wxParse/wxParse.ttml Parādīt failu

@@ -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>

+ 0
- 208
wxParse/wxParse.wxss Parādīt failu

@@ -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;
}

Notiek ielāde…
Atcelt
Saglabāt