完成公众号
This commit is contained in:
parent
859d40a127
commit
fb920b2ff8
5
app.js
5
app.js
@ -20,6 +20,7 @@ App({
|
|||||||
areaCode: '540200000000',
|
areaCode: '540200000000',
|
||||||
areaName: '日喀则市',
|
areaName: '日喀则市',
|
||||||
areaId: '640675',
|
areaId: '640675',
|
||||||
|
appId: 'wxa5c5246b283713de',
|
||||||
shopUrl: restAjax.url + "xzshop",
|
shopUrl: restAjax.url + "xzshop",
|
||||||
bigDataUrl: restAjax.url + "module",
|
bigDataUrl: restAjax.url + "module",
|
||||||
restAjax: restAjax,
|
restAjax: restAjax,
|
||||||
@ -28,6 +29,7 @@ App({
|
|||||||
liveImgUrl: restAjax.url + "live/route/file/download/true/",
|
liveImgUrl: restAjax.url + "live/route/file/download/true/",
|
||||||
dialog: dialog,
|
dialog: dialog,
|
||||||
utils: utils,
|
utils: utils,
|
||||||
|
wssUrl: restAjax.wssUrl,
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
// 展示本地存储能力
|
// 展示本地存储能力
|
||||||
var logs = wx.getStorageSync('logs') || []
|
var logs = wx.getStorageSync('logs') || []
|
||||||
@ -65,6 +67,7 @@ App({
|
|||||||
userInfo: null,
|
userInfo: null,
|
||||||
curLat: -1,
|
curLat: -1,
|
||||||
curLng: -1,
|
curLng: -1,
|
||||||
carList: []
|
carList: [],
|
||||||
|
isPublic: false,//是否关注了公众号
|
||||||
}
|
}
|
||||||
})
|
})
|
3
app.json
3
app.json
@ -38,7 +38,8 @@
|
|||||||
"pages/myVolunteerTeam/myVolunteerTeam",
|
"pages/myVolunteerTeam/myVolunteerTeam",
|
||||||
"pages/myVolunteerActivity/myVolunteerActivity",
|
"pages/myVolunteerActivity/myVolunteerActivity",
|
||||||
"pages/serviceActivityDetail/serviceActivityDetail",
|
"pages/serviceActivityDetail/serviceActivityDetail",
|
||||||
"pages/shop/shopcategory"
|
"pages/shop/shopcategory",
|
||||||
|
"pages/commonQrCode/commonQrCode"
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
{
|
{
|
||||||
|
BIN
images/app_logo.png
Normal file
BIN
images/app_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
@ -64,7 +64,7 @@ Page({
|
|||||||
// 上传
|
// 上传
|
||||||
uploadAvatar: function (avatarId) {
|
uploadAvatar: function (avatarId) {
|
||||||
var self = this
|
var self = this
|
||||||
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateuseravatar', [app.usercenterUrl]), {
|
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/update-avatar', [app.usercenterUrl]), {
|
||||||
avatar: avatarId
|
avatar: avatarId
|
||||||
}, {
|
}, {
|
||||||
headers: {
|
headers: {
|
||||||
@ -246,6 +246,11 @@ Page({
|
|||||||
})
|
})
|
||||||
self.getUserInfo()
|
self.getUserInfo()
|
||||||
app.dialog.msg('绑定成功');
|
app.dialog.msg('绑定成功');
|
||||||
|
},function(code,error){
|
||||||
|
self.setData({
|
||||||
|
isLoading: false
|
||||||
|
})
|
||||||
|
app.dialog.msg(error.msg)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
self.setData({
|
self.setData({
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="page-container">
|
<view class="page-container">
|
||||||
<view class="person">
|
<view class="person">
|
||||||
<view class="user-avatar" bindtap="changeAvatar" wx:if="{{userInfo.avatar}}">
|
<view class="user-avatar" bindtap="changeAvatar" >
|
||||||
<image src="{{usercenterUrl}}{{sourcePath}}{{userInfo.avatar}}"></image>
|
<image src="{{usercenterUrl}}{{sourcePath}}{{userInfo.avatar}}"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-name">{{userInfo.name}}</view>
|
<view class="user-name">{{userInfo.name}}</view>
|
||||||
|
98
pages/commonQrCode/commonQrCode.js
Normal file
98
pages/commonQrCode/commonQrCode.js
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
// subpages/commonQrCode.js
|
||||||
|
const app = getApp();
|
||||||
|
var socket = null;
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
title: '日喀则市公共数字文化云',
|
||||||
|
desc: '开展新闻资讯、场馆导航、场馆预定、活动预约、艺术普及、在线培训、电子图书、文化点单、直播活动等。',
|
||||||
|
hint: '扫描或长按识别上面二维码进行关注公众号',
|
||||||
|
imgSrc: '',
|
||||||
|
userId: '',
|
||||||
|
urls: app.wssUrl,
|
||||||
|
userName: '码',
|
||||||
|
hideloading: false,
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
console.log(options)
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '公众号关注',
|
||||||
|
});
|
||||||
|
wx.setNavigationBarColor({
|
||||||
|
backgroundColor: '#ededed',
|
||||||
|
frontColor: '#000000',
|
||||||
|
})
|
||||||
|
var userId = "";
|
||||||
|
if (options && JSON.stringify(options) !== '{}') {
|
||||||
|
var keys = Object.keys(options)
|
||||||
|
var values = keys[0].split("=");
|
||||||
|
userId = values[1];
|
||||||
|
this.setData({
|
||||||
|
userId: userId
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
userId = app.globalData.userInfo.userId;
|
||||||
|
this.setData({
|
||||||
|
userId: userId
|
||||||
|
})
|
||||||
|
this.startWebSocket();
|
||||||
|
}
|
||||||
|
this.getCodeImg(userId);
|
||||||
|
},
|
||||||
|
startWebSocket() {
|
||||||
|
var _self = this;
|
||||||
|
socket = wx.connectSocket({
|
||||||
|
url: _self.data.urls + '/app/wxeventrelease/' + _self.data.userId,
|
||||||
|
success(res) {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
socket.onMessage(function (e) {
|
||||||
|
console.log(e)
|
||||||
|
if (e.data) {
|
||||||
|
var data = JSON.parse(e.data);
|
||||||
|
_self.prePage(data.attention)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
prePage(e) {
|
||||||
|
console.log(e)
|
||||||
|
app.globalData.isPublic = e
|
||||||
|
var pages = getCurrentPages();
|
||||||
|
var prePage = pages[pages.length - 2]
|
||||||
|
prePage.setData({
|
||||||
|
isPublic: e
|
||||||
|
});
|
||||||
|
wx.navigateBack()
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
if (socket != null) {
|
||||||
|
socket.close({
|
||||||
|
code: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCodeImg(id) {
|
||||||
|
var _self = this;
|
||||||
|
app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/wxopen/qrcoderelease/{userId}', [app.usercenterUrl, id]), {}, {
|
||||||
|
|
||||||
|
}, function (code, data) {
|
||||||
|
_self.setData({
|
||||||
|
imgSrc: data,
|
||||||
|
hideloading: true
|
||||||
|
})
|
||||||
|
|
||||||
|
}, function (code, data) {
|
||||||
|
_self.setData({
|
||||||
|
hideloading: true
|
||||||
|
})
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
})
|
3
pages/commonQrCode/commonQrCode.json
Normal file
3
pages/commonQrCode/commonQrCode.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
15
pages/commonQrCode/commonQrCode.wxml
Normal file
15
pages/commonQrCode/commonQrCode.wxml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<view class="page" wx:if="{{hideloading}}">
|
||||||
|
<view class="box">
|
||||||
|
<view class="title-box">
|
||||||
|
<image class="title-icon" src="/images/app_logo.png" mode="scaleToFill"></image>
|
||||||
|
<view class="title-content">
|
||||||
|
<view class="title-txt">{{title}}</view>
|
||||||
|
<view class="title-des">{{desc}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="img" src="{{imgSrc}}" mode="scaleToFill" show-menu-by-longpress="{{true}}"></image>
|
||||||
|
<view class="hint">{{hint}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<page-loading wx:else></page-loading>
|
80
pages/commonQrCode/commonQrCode.wxss
Normal file
80
pages/commonQrCode/commonQrCode.wxss
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
/* subpages/commonQrCode.wxss */
|
||||||
|
page {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ededed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
/* justify-content: center; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 200rpx;
|
||||||
|
width: 80%;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
height: auto;
|
||||||
|
padding: 20rpx;
|
||||||
|
box-shadow: 3rpx 3rpx 30rpx #e7e7e7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-box {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-icon {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 75%;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-txt {
|
||||||
|
font-size: 35rpx;
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-des {
|
||||||
|
font-size: 20rpx;
|
||||||
|
color: #6b6b6b;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
width: 500rpx;
|
||||||
|
height: 500rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #858585;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
@ -41,9 +41,9 @@ Page({
|
|||||||
wx.login({
|
wx.login({
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.code) {
|
if (res.code) {
|
||||||
wx.setStorageSync('token', 'REQ5NW5IZTZjS2ZyQU9QQmFKZ1FIRmVhbjNFZmV4dEx3emdob2g5UjVXaForWGdpOHFIRWgyTWRIelJFWkhNS28wN1hUV2Uwb0FKSUEra2wzYVhXdnI4aG9odkxLd3ZFUGkrTTQwQTkzdyt3cnN3NkY4OE9aaGw0aUJPTUNSaENKbGxTdm8xR3Z5WTJBV0NDcWRpbEd3OW0zUzA3US8xMmUyaTU2a0N4YmN5d1FjTXd6aTZIZkhhdmpsSDlqYSt0OUJVUHRSbTJqSVd6eHlYc1M5WTlkK015MVR2R083T3crU2wrdVFmVGk4N3NHWmZNY1A3SGNNbm8xMDFMTy9tcTN2K0NuQTZJbk9YZGJqK3drQkxlMXNUVjZZNkZyRE9LMGdYdUQzSE9lbDQ9');
|
app.restAjax.post(app.restAjax.path('{url}/wechat-miniapp/sign/default-multi', [app.loginUrl]), {
|
||||||
app.restAjax.post(app.restAjax.path('{url}/wechat-miniapp/sign/default', [app.loginUrl]), {
|
jsCode: res.code,
|
||||||
jsCode: res.code
|
appKey: app.appId
|
||||||
}, null, function (code, data) {
|
}, null, function (code, data) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
var tokenArray = data.data.split('_');
|
var tokenArray = data.data.split('_');
|
||||||
@ -54,6 +54,8 @@ Page({
|
|||||||
})
|
})
|
||||||
wx.setStorageSync('token', token);
|
wx.setStorageSync('token', token);
|
||||||
wx.setStorageSync('isRandomUsername', isRandomUsername)
|
wx.setStorageSync('isRandomUsername', isRandomUsername)
|
||||||
|
//获取UserID
|
||||||
|
self.getUserInfo();
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
app.dialog.msg(data.msg);
|
app.dialog.msg(data.msg);
|
||||||
});
|
});
|
||||||
@ -64,6 +66,19 @@ Page({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// getUserInfo(){
|
||||||
|
// var _self= this;
|
||||||
|
// // app/wxopen/qrcoderelease/{userId}
|
||||||
|
// app.restAjax.get(app.restAjax.path('{newsUrl}/app/user/get-app-user'),[_self.data.news.newsUrl]),
|
||||||
|
// null,
|
||||||
|
// null,
|
||||||
|
// function(code,data){
|
||||||
|
// console.log(data)
|
||||||
|
// },
|
||||||
|
// function(code,error){
|
||||||
|
// app.dialog.msg(error.msg);
|
||||||
|
// }
|
||||||
|
// },
|
||||||
//获取首页功能
|
//获取首页功能
|
||||||
getMainFunc() {
|
getMainFunc() {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
@ -296,19 +311,32 @@ Page({
|
|||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
getUserInfo: function () {
|
getUserInfo: function () {
|
||||||
var self = this
|
var self = this
|
||||||
app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/getappuser', [app.usercenterUrl]), {}, {
|
app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/get-app-user', [app.usercenterUrl]), {}, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
}
|
}
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
|
console.log(data);
|
||||||
|
app.globalData.userInfo = data;
|
||||||
self.setData({
|
self.setData({
|
||||||
userInfo: data
|
userInfo: data
|
||||||
})
|
});
|
||||||
self.doSaveLoginInfo(data.userId)
|
self.doSaveLoginInfo(data.userId);
|
||||||
|
self.getIsPublic();
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
app.dialog.msg(data.msg);
|
app.dialog.msg(data.msg);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//是否关注公众号
|
||||||
|
getIsPublic() {
|
||||||
|
var _self = this;
|
||||||
|
app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/wxopen/attentionrelease/{userId}', [app.usercenterUrl, _self.data.userInfo.userId]), {}, {
|
||||||
|
}, function (code, data) {
|
||||||
|
app.globalData.isPublic = data
|
||||||
|
}, function (code, data) {
|
||||||
|
app.dialog.msg(data.msg)
|
||||||
|
})
|
||||||
|
},
|
||||||
doSaveLoginInfo(id) {
|
doSaveLoginInfo(id) {
|
||||||
var params = "小程序USER" + id;
|
var params = "小程序USER" + id;
|
||||||
var info = {
|
var info = {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
|
<scroll-view scroll-x="true">
|
||||||
<view class="tab">
|
<view class="tab">
|
||||||
<block wx:for="{{mainFuncList}}" wx:key="index">
|
<block wx:for="{{mainFuncList}}" wx:key="index">
|
||||||
<view class="tab-box" bindtap="openNewsDetail" data-item="{{item}}">
|
<view class="tab-box" bindtap="openNewsDetail" data-item="{{item}}">
|
||||||
@ -34,6 +34,8 @@
|
|||||||
<view class="tab-title">直播点播</view>
|
<view class="tab-title">直播点播</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="line-thick"></view>
|
||||||
<view class="recommend">
|
<view class="recommend">
|
||||||
<view class="public-title">
|
<view class="public-title">
|
||||||
<view class="title-text">
|
<view class="title-text">
|
||||||
@ -42,7 +44,7 @@
|
|||||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<scroll-view scroll-x="true" style="margin-top: 10rpx;">
|
||||||
<view class="recommend-container">
|
<view class="recommend-container">
|
||||||
<view class="recommend-box" wx:for="{{venue.venueList}}" bindtap="goVenueDetail" data-venues-info-Id="{{item.venuesInfoId}}" wx:for-index="index" wx:for-item="item" wx:key="venueList">
|
<view class="recommend-box" wx:for="{{venue.venueList}}" bindtap="goVenueDetail" data-venues-info-Id="{{item.venuesInfoId}}" wx:for-index="index" wx:for-item="item" wx:key="venueList">
|
||||||
<view class="recommend-status">场馆导航</view>
|
<view class="recommend-status">场馆导航</view>
|
||||||
@ -55,7 +57,9 @@
|
|||||||
<image src="{{activity.activityUrl}}/route/file/download/true/{{item.activityImageArray[0]}}" data-index="{{index}}" binderror="loadImgErr"></image>
|
<image src="{{activity.activityUrl}}/route/file/download/true/{{item.activityImageArray[0]}}" data-index="{{index}}" binderror="loadImgErr"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="line-thick"></view>
|
||||||
<view class="news" wx:if="{{mainNewTab.length>0}}">
|
<view class="news" wx:if="{{mainNewTab.length>0}}">
|
||||||
<block wx:for="{{mainNewTab}}" wx:key="i" wx:for-item="it" wx:for-index="i">
|
<block wx:for="{{mainNewTab}}" wx:key="i" wx:for-item="it" wx:for-index="i">
|
||||||
<view class="public-title">
|
<view class="public-title">
|
||||||
|
@ -34,9 +34,18 @@ swiper {
|
|||||||
.tab {
|
.tab {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
border-bottom: 5px solid #FBFBFB;
|
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
overflow-x: scroll;
|
}
|
||||||
|
|
||||||
|
.tab-arrow {
|
||||||
|
font-size: 28rpx;
|
||||||
|
background: #242424;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 0rpx;
|
||||||
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-box {
|
.tab-box {
|
||||||
@ -56,14 +65,11 @@ swiper {
|
|||||||
|
|
||||||
.recommend {
|
.recommend {
|
||||||
padding: 0rpx 30rpx 30rpx 30rpx;
|
padding: 0rpx 30rpx 30rpx 30rpx;
|
||||||
border-bottom: 5px solid #FBFBFB;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-container {
|
.recommend-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow-x: auto;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.line {
|
.line {
|
||||||
@ -72,6 +78,12 @@ swiper {
|
|||||||
background: #f2f2f2;
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.line-thick {
|
||||||
|
width: 100%;
|
||||||
|
height: 10rpx;
|
||||||
|
background: #f2f2f2;
|
||||||
|
}
|
||||||
|
|
||||||
.recommend-box {
|
.recommend-box {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 220rpx;
|
width: 220rpx;
|
||||||
|
@ -22,6 +22,8 @@ Page({
|
|||||||
canPlay: false,
|
canPlay: false,
|
||||||
isPlaying: false,
|
isPlaying: false,
|
||||||
totalValue: 0,
|
totalValue: 0,
|
||||||
|
isPublicCode: false,
|
||||||
|
isPublic: false
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,10 +32,22 @@ Page({
|
|||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
this.setData({
|
this.setData({
|
||||||
newsId: options.id,
|
newsId: options.id,
|
||||||
pageHeight: wx.getSystemInfoSync().windowHeight
|
pageHeight: wx.getSystemInfoSync().windowHeight,
|
||||||
|
isPublic: app.globalData.isPublic
|
||||||
|
})
|
||||||
|
|
||||||
|
this.saveBigdata(options.id);
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if (this.data.isPublic) {
|
||||||
|
this.setData({
|
||||||
|
isPublicCode: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
newsBean: null
|
||||||
})
|
})
|
||||||
this.getNewsDetail();
|
this.getNewsDetail();
|
||||||
this.saveBigdata(options.id);
|
|
||||||
},
|
},
|
||||||
saveBigdata(id) {
|
saveBigdata(id) {
|
||||||
var params = "小程序" + id + "新闻";
|
var params = "小程序" + id + "新闻";
|
||||||
@ -70,6 +84,21 @@ Page({
|
|||||||
})
|
})
|
||||||
_self.initAudio()
|
_self.initAudio()
|
||||||
}
|
}
|
||||||
|
//判断是否需要关注公众号
|
||||||
|
if (data.newsViewAuth && data.newsViewAuth.indexOf('2')) {
|
||||||
|
//需要关注
|
||||||
|
//判断是否已经关注
|
||||||
|
if (!_self.data.isPublic) {
|
||||||
|
_self.setData({
|
||||||
|
isPublicCode: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//无需关注
|
||||||
|
_self.setData({
|
||||||
|
isPublicCode: false
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
function (code, data) {
|
function (code, data) {
|
||||||
app.dialog.msg(data.msg);
|
app.dialog.msg(data.msg);
|
||||||
@ -79,6 +108,7 @@ Page({
|
|||||||
// wx.hideLoading();
|
// wx.hideLoading();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setVideoUrl(e) {
|
setVideoUrl(e) {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
var item = e.currentTarget.dataset.item
|
var item = e.currentTarget.dataset.item
|
||||||
@ -137,6 +167,15 @@ Page({
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
move() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
goAttention() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/commonQrCode/commonQrCode',
|
||||||
|
})
|
||||||
|
},
|
||||||
playAudio() {
|
playAudio() {
|
||||||
if (audioContentx && audioContentx.paused) {
|
if (audioContentx && audioContentx.paused) {
|
||||||
audioContentx.stop();
|
audioContentx.stop();
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
<wxs src="/utils/utils.wxs" module="format"></wxs>
|
<wxs src="/utils/utils.wxs" module="format"></wxs>
|
||||||
|
<!-- 是否需要关注公众号 -->
|
||||||
|
<view wx:if="{{isPublicCode}}" class="page-mask" catch:touchmove="move">
|
||||||
|
<view class="mask-hint">关注公众号即可阅读</view>
|
||||||
|
<view class="mask-btn" bind:tap="goAttention">去关注</view>
|
||||||
|
</view>
|
||||||
<view wx:if="{{newsBean}}">
|
<view wx:if="{{newsBean}}">
|
||||||
<!-- newsContentType 1 文章 2图片 3音频 4视频 5PDF 6链接 -->
|
<!-- newsContentType 1 文章 2图片 3音频 4视频 5PDF 6链接 -->
|
||||||
<!-- 文章 -->
|
<!-- 文章 -->
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/* page{
|
page {
|
||||||
background: #d2e0f6;
|
width: 100%;
|
||||||
} */
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.news-title {
|
.news-title {
|
||||||
padding: 20rpx 30rpx;
|
padding: 20rpx 30rpx;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
@ -199,3 +201,38 @@
|
|||||||
width: 64rpx;
|
width: 64rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-mask {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 99999999;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
backdrop-filter: blur(10rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mask-btn {
|
||||||
|
background-color: #4CAF50;
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10rpx 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mask-hint {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -73,7 +73,6 @@ Page({
|
|||||||
currentPage: page,
|
currentPage: page,
|
||||||
'news.newsList': newsArray
|
'news.newsList': newsArray
|
||||||
})
|
})
|
||||||
console.log(self.data.news.newsList)
|
|
||||||
if (data.rows.length == 0) {
|
if (data.rows.length == 0) {
|
||||||
app.dialog.msg('暂无数据');
|
app.dialog.msg('暂无数据');
|
||||||
return;
|
return;
|
||||||
@ -137,5 +136,11 @@ Page({
|
|||||||
self.doGetNewsDictionariesList();
|
self.doGetNewsDictionariesList();
|
||||||
self.getAreaList();
|
self.getAreaList();
|
||||||
},
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
this.setData({
|
||||||
|
currentPage: this.data.currentPage + 1
|
||||||
|
})
|
||||||
|
this.doGetNewsList(this.data.currentPage)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
@ -229,6 +229,7 @@ module.exports.file = postFile;
|
|||||||
// module.exports.url="http://v3.xzszwhy.cn/";
|
// module.exports.url="http://v3.xzszwhy.cn/";
|
||||||
module.exports.baseUrl = 'https://www.xzszwhy.cn/xzszwhy';
|
module.exports.baseUrl = 'https://www.xzszwhy.cn/xzszwhy';
|
||||||
module.exports.url = "https://www.xzszwhy.cn/";
|
module.exports.url = "https://www.xzszwhy.cn/";
|
||||||
|
module.exports.wssUrl="wss://www.xzszwhy.cn/xzszwhy";
|
||||||
|
|
||||||
// module.exports.baseUrl = 'http://192.168.0.120:8081/xzszwhy';
|
// module.exports.baseUrl = 'http://192.168.0.120:8081/xzszwhy';
|
||||||
// module.exports.url = "http://192.168.0.120:8081/";
|
// module.exports.url = "http://192.168.0.120:8081/";
|
Loading…
Reference in New Issue
Block a user