银花优选微信小程序修改后的最新版本代码
This commit is contained in:
203
pages/xsxt/index.js
Normal file
203
pages/xsxt/index.js
Normal file
@@ -0,0 +1,203 @@
|
||||
var WxParse = null;
|
||||
var app = getApp()
|
||||
var that=null
|
||||
var that0=null
|
||||
var t=1
|
||||
Page( {
|
||||
data: {
|
||||
loadingHidden:false,
|
||||
nodataHidden:true,
|
||||
bodyHidden:true,
|
||||
Start: 0,
|
||||
helps:[],
|
||||
title:"",
|
||||
body:"",
|
||||
video:"",
|
||||
videoCtx:null
|
||||
},onShow: function () {
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
that0=this;
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var userInfodata = wx.getStorageSync("userInfo")
|
||||
var sel=1;
|
||||
var ifsel=0;
|
||||
if(userId&&userInfodata){
|
||||
var userInfo = JSON.parse(userInfodata)
|
||||
|
||||
ifsel=userInfo.bdshEnable;
|
||||
}
|
||||
|
||||
if(ifsel==1){
|
||||
that0.getTabBar().setData({
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "/pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/images/footer-icon-01.png",
|
||||
"selectedIconPath": "/images/footer-icon-01-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/news/index",
|
||||
"iconPath": "/images/footer-icon-05.png",
|
||||
"selectedIconPath": "/images/footer-icon-05-active.png",
|
||||
"text": "资讯"
|
||||
},
|
||||
|
||||
{
|
||||
"pagePath": "/pages/my/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/images/footer-icon-04.png",
|
||||
"selectedIconPath": "/images/footer-icon-04-active.png"
|
||||
}
|
||||
]
|
||||
})
|
||||
}else{
|
||||
that0.getTabBar().setData({
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "/pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/images/footer-icon-01.png",
|
||||
"selectedIconPath": "/images/footer-icon-01-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/news/index",
|
||||
"iconPath": "/images/footer-icon-05.png",
|
||||
"selectedIconPath": "/images/footer-icon-05-active.png",
|
||||
"text": "资讯"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/business/index",
|
||||
"iconPath": "/images/footer-icon-02.png",
|
||||
"selectedIconPath": "/images/footer-icon-02-active.png",
|
||||
"text": "门店"
|
||||
},
|
||||
|
||||
{
|
||||
"pagePath": "/pages/my/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/images/footer-icon-04.png",
|
||||
"selectedIconPath": "/images/footer-icon-04-active.png"
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
that0.getTabBar().setData({
|
||||
selected: sel
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
that = this
|
||||
WxParse = require('../../wxParse/wxParse.js')
|
||||
that.setData({
|
||||
videoCtx:wx.createVideoContext('myVideo', this)
|
||||
})
|
||||
that.getlist();//第一次加载数据
|
||||
}, getlist: function () {
|
||||
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"getxsxtlist",
|
||||
userId:(!userId?"":userId),
|
||||
LoginId:(!LoginId?"":LoginId),
|
||||
Start:that.data.Start
|
||||
},
|
||||
method:"GET",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/json" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
that.setData({
|
||||
helps: res.data.xsxtlb,
|
||||
loadingHidden:true
|
||||
})
|
||||
|
||||
if(res.data.xsxtlb.length==0){
|
||||
that.setData({
|
||||
nodataHidden:false
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
nodataHidden:true
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh: function () {
|
||||
that.clearCache();
|
||||
that.getlist();//第一次加载数据
|
||||
},
|
||||
// 清缓存
|
||||
clearCache:function(){
|
||||
that.setData({
|
||||
helps: [],
|
||||
Start: 0,
|
||||
loadingHidden:false
|
||||
});
|
||||
},ondetail:function(e) {
|
||||
var id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: "../articledetail/index?id="+id
|
||||
})
|
||||
/*that.setData({
|
||||
loadingHidden:false
|
||||
})
|
||||
var id = e.currentTarget.dataset.id
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"getnewdetail",
|
||||
userId:(!userId?"":userId),
|
||||
LoginId:(!LoginId?"":LoginId),
|
||||
id:id
|
||||
},
|
||||
method:"POST",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
|
||||
if(res.data.status==1){
|
||||
WxParse.wxParse('body', 'html', res.data.content, that);
|
||||
that.setData({
|
||||
title:res.data.title,
|
||||
video:res.data.video,
|
||||
bodyHidden:false
|
||||
})
|
||||
|
||||
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
loadingHidden:true
|
||||
})
|
||||
}
|
||||
})*/
|
||||
|
||||
},closeserver:function(e) {
|
||||
that.data.videoCtx.stop()
|
||||
that.setData({
|
||||
bodyHidden:true
|
||||
})
|
||||
},inserver :function(e) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
3
pages/xsxt/index.json
Normal file
3
pages/xsxt/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "操作教程"
|
||||
}
|
||||
39
pages/xsxt/index.wxml
Normal file
39
pages/xsxt/index.wxml
Normal file
@@ -0,0 +1,39 @@
|
||||
<import src="../../wxParse/wxParse.wxml"/>
|
||||
<view class="container">
|
||||
<block wx:for="{{helps}}">
|
||||
<view class="text">
|
||||
<view class="line_flag"></view>
|
||||
<text>{{item.LBName}}</text>
|
||||
</view>
|
||||
<view class="news-box" >
|
||||
<view class="news-item" wx:for="{{item.data}}" wx:for-item="cell">
|
||||
<view class="news-item-to" bindtap="ondetail" data-id="{{cell.id}}">
|
||||
<view class="pic"><image src="{{cell.pic}}"></image></view>
|
||||
<view class="title">{{cell.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
<view class="nodata" hidden="{{nodataHidden}}">
|
||||
<image src="../../images/order-null.png"/>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="Hidden_box" hidden="{{bodyHidden}}" bindtap="closeserver">
|
||||
<view class="Hidden_box_to" catchtap="inserver">
|
||||
<view class="close" bindtap="closeserver"><image src="../../images/close.png" /></view>
|
||||
|
||||
<view class="title">视频详情</view>
|
||||
<view class="body">
|
||||
<view class="title">{{title}}</view>
|
||||
<video id="myVideo" wx:if='{{video!=""}}' src="{{video}}" autoplay enable-danmu danmu-btn controls></video>
|
||||
<template is="wxParse" data="{{wxParseData:body.nodes}}"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<loading hidden="{{loadingHidden}}">
|
||||
加载中...
|
||||
</loading>
|
||||
57
pages/xsxt/index.wxss
Normal file
57
pages/xsxt/index.wxss
Normal file
@@ -0,0 +1,57 @@
|
||||
page{
|
||||
background: #ccc;
|
||||
}
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
}
|
||||
.text{
|
||||
margin-top: 0;
|
||||
line-height: 2.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
border-bottom:1px solid #f1f1f1;
|
||||
}
|
||||
.text .line_flag{
|
||||
margin-top: 0em;
|
||||
margin-left: 5px;
|
||||
margin-right: 0.5em;
|
||||
width:0.5em;
|
||||
height: 1.5em;
|
||||
line-height: 1.5em;
|
||||
background-color: #f0514d;
|
||||
border-radius:0.2em;
|
||||
}
|
||||
|
||||
.news-box{width:100%; padding:0;padding-top: 0.4em;padding-left:0.8em;box-sizing: border-box;}
|
||||
.news-item{position: relative; float:left; width:50%; margin:0; padding:0.8em; padding-top: 0; padding-left:0; box-sizing: border-box; text-align: left;}
|
||||
.news-item-to{position: relative; float:none; width:100%; margin:0; padding:0; box-sizing: border-box; text-align: left; background-color: #fff; border-radius:0.5em;overflow: hidden;}
|
||||
.news-item .title{width: 100%;background-color:#fff; line-height:2.5em;padding:0 1em; box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;}
|
||||
.news-item .pic{width: 100%;}
|
||||
.news-item .pic image{width:100%;height:12.5em;}
|
||||
|
||||
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);}
|
||||
.Hidden_box_to{position: relative; padding: 8px; width:95%;height:auto; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
|
||||
.Hidden_box_to.addcart_box{ position: absolute; bottom:0; width:100%;border-radius:0.5em 0.5em 0 0;}
|
||||
.Hidden_box_to .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
|
||||
.Hidden_box_to .close image{width:100%;height:100%;}
|
||||
.Hidden_box_to .title{ width:100%;height:2.5em;line-height: 2.5em; font-weight: 800; border-bottom:1px solid #f1f1f1;}
|
||||
.Hidden_box_to .body{line-height:1.5em; color:#939393;max-height:80vh; overflow-y: auto;}
|
||||
.Hidden_box_to .body .title{ width:100%;height:2.5em; line-height: 2.5em; text-align: center;}
|
||||
.Hidden_box_to .body img{max-width:100%;}
|
||||
.Hidden_box_to .body video{width:100%;height:15em;}
|
||||
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
|
||||
.nodata image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user