Commit ec3db08c by tangjinlin

0519

parent 43add255
...@@ -37,11 +37,6 @@ App({ ...@@ -37,11 +37,6 @@ App({
unionId: resp.data.result.unionId, unionId: resp.data.result.unionId,
registed: resp.data.result.registed registed: resp.data.result.registed
}; };
// wx.showToast({
// title: "unionId=" + res.data.result.unionId,
// icon: 'success',
// duration: 2000
// });
wx.setStorageSync("config", config); wx.setStorageSync("config", config);
}, },
fail (resp) { fail (resp) {
...@@ -57,20 +52,7 @@ App({ ...@@ -57,20 +52,7 @@ App({
} }
}) })
//获取并保存用户的经纬度信息
wx.getLocation({
type: 'wgs84',
success: function (res) {
let location = {
latitude: res.latitude,
longitude: res.longitude
};
wx.setStorage({
key: 'location',
data: location,
})
}
})
// 获取用户信息 // 获取用户信息
wx.getSetting({ wx.getSetting({
......
...@@ -17,8 +17,9 @@ Page({ ...@@ -17,8 +17,9 @@ Page({
mediaCount: '', mediaCount: '',
mediaList: [], mediaList: [],
videoHeight: '150', videoHeight: '150',
play: 0,
fufeiPage: 0, showPay: 0,
showPlay: 0,
playUrl: '', playUrl: '',
detailComment: '', detailComment: '',
price: 0,//购买价格,合集则为合集价格,单个视频则为单个视频的价格 price: 0,//购买价格,合集则为合集价格,单个视频则为单个视频的价格
...@@ -95,7 +96,7 @@ Page({ ...@@ -95,7 +96,7 @@ Page({
//点击观看处理 //点击观看处理
learn(e) { learn(e) {
var that = this; var that = this;
let id = e.currentTarget.dataset['id']; var id = e.currentTarget.dataset['id'];
wx.getStorage({ wx.getStorage({
key: 'config', key: 'config',
success: function (res) { success: function (res) {
...@@ -110,16 +111,18 @@ Page({ ...@@ -110,16 +111,18 @@ Page({
success: function (resp) { success: function (resp) {
console.log(resp) console.log(resp)
if (resp.data.status == 'OK') { if (resp.data.status == 'OK') {
if (resp.data.result.courseMediaDat.haveBuy && !resp.data.result.courseMediaDat.is_free || resp.data.result.courseMediaDat.is_free) { if (resp.data.result.courseMediaDat.haveBuy) {
//开始播放
that.setData({ that.setData({
play: 1, showPlay: 1,
playUrl: resp.data.result.courseMediaDat.media, playUrl: resp.data.result.courseMediaDat.media,
detailComment: resp.data.result.courseMediaDat.comment detailComment: resp.data.result.courseMediaDat.comment
}) })
} else { } else {
//显示购买对话框
that.setData({ that.setData({
playUrl: resp.data.result.courseMediaDat.media, playUrl: resp.data.result.courseMediaDat.media,
fufeiPage: 1, showPay: 1,
price: resp.data.result.courseMediaDat.price price: resp.data.result.courseMediaDat.price
}) })
} }
...@@ -130,13 +133,6 @@ Page({ ...@@ -130,13 +133,6 @@ Page({
}, },
}) })
// console.log(index)
// var playUrl = this.data.mediaList[index].media;
// playUrl=playUrl.split('?')[0];
// this.setData({
// playUrl:playUrl,
// play:1
// })
}, },
// 查询课程详细 // 查询课程详细
...@@ -168,10 +164,12 @@ Page({ ...@@ -168,10 +164,12 @@ Page({
updateTime: res.data.result.updateTime, updateTime: res.data.result.updateTime,
viewCount: res.data.result.viewCount, viewCount: res.data.result.viewCount,
mediaList: res.data.result.mediaList, mediaList: res.data.result.mediaList,
price: res.data.result.price price: res.data.result.price,
haveBuy:res.data.result.haveBuy
}) })
//判断为单个还是合集 //判断为单个还是合集
if (res.data.result.courseId==0) { if (res.data.result.courseId==0) {
//单个视频的情况下,支付价格重新赋值
that.setData({ that.setData({
price: res.data.result.mediaList[0].price price: res.data.result.mediaList[0].price
}) })
...@@ -187,12 +185,12 @@ Page({ ...@@ -187,12 +185,12 @@ Page({
videoplay() { videoplay() {
if (this.data.show1) { if (this.data.show1) {
this.setData({ this.setData({
fufeiPage: 1 showPay: 1
}) })
this.fufeilook() this.fufeilook()
} else { } else {
this.setData({ this.setData({
play: 1 showPlay: 1
}) })
this.classDerails(); this.classDerails();
var query = wx.createSelectorQuery(); var query = wx.createSelectorQuery();
...@@ -205,9 +203,11 @@ Page({ ...@@ -205,9 +203,11 @@ Page({
}).exec(); }).exec();
} }
}, },
//播放返回
backplay() { backplay() {
this.setData({ this.setData({
play: 0 showPlay: 0
}) })
}, },
...@@ -234,12 +234,16 @@ Page({ ...@@ -234,12 +234,16 @@ Page({
complete: function (res) {}, complete: function (res) {},
}) })
}, },
backfufei() {
//取消支付
cancelPay() {
this.setData({ this.setData({
fufeiPage: 0 showPay: 0
}) })
}, },
surefufei() {
//确认支付
surePay() {
var that = this; var that = this;
wx.getStorage({ wx.getStorage({
key: 'config', key: 'config',
...@@ -250,6 +254,7 @@ Page({ ...@@ -250,6 +254,7 @@ Page({
data: { data: {
unionId: res.data.unionId, unionId: res.data.unionId,
openId: res.data.openId, openId: res.data.openId,
courseId: that.data.courseId,
mediaId: that.data.mediaId mediaId: that.data.mediaId
}, },
success: function (resp) { success: function (resp) {
...@@ -264,8 +269,8 @@ Page({ ...@@ -264,8 +269,8 @@ Page({
paySign: result.paySign, paySign: result.paySign,
success(res) { success(res) {
that.setData({ that.setData({
fufeiPage: 0, showPay: 0,
play: 1 showPlay: 1
}) })
}, },
fail(res) { fail(res) {
...@@ -278,9 +283,5 @@ Page({ ...@@ -278,9 +283,5 @@ Page({
} }
}, },
}) })
// this.setData({
// fufeiPage: 0
// })
} }
}) })
\ No newline at end of file
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
<block wx:for="{{mediaList}}"> <block wx:for="{{mediaList}}">
<view class="catalog"> <view class="catalog">
<text bindtap='videoplay'>{{item.title}}</text> <text bindtap='videoplay'>{{item.title}}</text>
<image src='/img/suo1.png' class='suo' wx:if="{{!haveBuy&&price>0}}" bindtap=""></image> <image src='/img/suo1.png' class='suo' wx:if="{{!haveBuy&&price>0}}" ></image>
<image src='/img/sanjiao.png' class='suo' wx:if="{{haveBuy||price==0}}" bindtap="playCourse"></image> <image src='/img/sanjiao.png' class='suo' wx:if="{{haveBuy||price==0}}" bindtap="learn" data-id="{{item.id}}"></image>
</view> </view>
</block> </block>
</view> </view>
...@@ -66,10 +66,10 @@ ...@@ -66,10 +66,10 @@
<!-- 合集课程 --> <!-- 合集课程 -->
<view class="buyBtn" wx:if="{{courseId>0 && haveBuy==false && price > 0}}" bindtap="learn" data-id="{{mediaId}}">课程金额:{{price}}</view> <view class="buyBtn" wx:if="{{courseId>0 && haveBuy==false && price > 0}}" bindtap="learn" data-id="{{mediaId}}">课程金额:{{price}}</view>
<view class="buyBtn" wx:elif="{{courseId>0}}" bindtap="learn" data-id="{{mediaId}}">学习</view> <view class="buyBtn" wx:elif="{{courseId>0}}">请点击目录学习</view>
</view> </view>
</view> </view>
<view class='play' wx:if="{{play==1}}"> <view class='play' wx:if="{{showPlay==1}}">
<video class='video' src="{{playUrl}}"></video> <video class='video' src="{{playUrl}}"></video>
<view style='font-size:14px;padding-left:5px;margin-top:10px;'> <view style='font-size:14px;padding-left:5px;margin-top:10px;'>
<image src='../../img/sanjiao.png'></image>课程简介 <image src='../../img/sanjiao.png'></image>课程简介
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<van-button type="warning" bind:click="backplay" size='large'>返回</van-button> <van-button type="warning" bind:click="backplay" size='large'>返回</van-button>
</view> </view>
</view> </view>
<view class='fufeilook' wx:if="{{fufeiPage==1}}"> <view class='fufeilook' wx:if="{{showPay==1}}">
<view class='con_fufeilook'> <view class='con_fufeilook'>
<image class="zfbg" src="/img/zhifubg.png" mode="widthFix"></image> <image class="zfbg" src="/img/zhifubg.png" mode="widthFix"></image>
<image bindtap='backfufei' src="/img/close.png"></image> <image bindtap='backfufei' src="/img/close.png"></image>
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
<view style="margin: 10px 0 50px;font-size: 18px;"><text style="color:red;">¥{{price}}</text></view> <view style="margin: 10px 0 50px;font-size: 18px;"><text style="color:red;">¥{{price}}</text></view>
<view style="color: #898989;font-size: 12px">费用用途:所收金额全部用于公益用途</view> <view style="color: #898989;font-size: 12px">费用用途:所收金额全部用于公益用途</view>
<view class='fufeiBtn'> <view class='fufeiBtn'>
<view style="background: linear-gradient(to right, #e85c6d, #fb689b);color:#fff" bindtap='surefufei'>确认</view> <view style="background: linear-gradient(to right, #e85c6d, #fb689b);color:#fff" bindtap='surePay'>确认</view>
<view style="border: 1rpx solid #fd66a1" bindtap='backfufei'>取消</view> <view style="border: 1rpx solid #fd66a1" bindtap='cancelPay'>取消</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<view class='topTitle'> <view class='topTitle'>
<view class='leftTitle'> <view class='leftTitle'>
<view class='leftLine'></view> <view class='leftLine'></view>
<text class="hot_title">热门资讯</text> <text class="hot_title">热门咨询</text>
</view> </view>
<view class='rightTitle' bindtap='myFaq'> <view class='rightTitle' bindtap='myFaq'>
<text>我的咨询</text> <text>我的咨询</text>
......
...@@ -38,6 +38,25 @@ Page({ ...@@ -38,6 +38,25 @@ Page({
var location = wx.getStorageSync('location'); var location = wx.getStorageSync('location');
var latitude = location.latitude; var latitude = location.latitude;
var longitude = location.longitude; var longitude = location.longitude;
//如果为空,再次调起获取位置
//获取并保存用户的经纬度信息
if (!latitude || !longitude) {
wx.getLocation({
type: 'wgs84',
success: function (res) {
let location = {
latitude: res.latitude,
longitude: res.longitude
};
//本地保存地理位置数据
wx.setStorage({
key: 'location',
data: location,
})
latitude = location.latitude
longitude = location.longitude
//获取首页数据
if (config.unionId !== undefined) { if (config.unionId !== undefined) {
that.getUserRole(config.unionId, latitude, longitude); that.getUserRole(config.unionId, latitude, longitude);
} else { } else {
...@@ -46,8 +65,24 @@ Page({ ...@@ -46,8 +65,24 @@ Page({
that.getUserRole(config.unionId, latitude, longitude); that.getUserRole(config.unionId, latitude, longitude);
}, 1000); }, 1000);
} }
}
})
} else {
//获取首页数据
if (config.unionId !== undefined) {
that.getUserRole(config.unionId, latitude, longitude);
} else {
setTimeout(function () {
config = wx.getStorageSync('config');
that.getUserRole(config.unionId, latitude, longitude);
}, 1000);
}
}
}, },
//获取首页数据
getUserRole(unionId, latitude, longitude) { getUserRole(unionId, latitude, longitude) {
var that = this; var that = this;
var location = wx.getStorageSync('location'); var location = wx.getStorageSync('location');
...@@ -68,12 +103,14 @@ Page({ ...@@ -68,12 +103,14 @@ Page({
console.log(res) console.log(res)
if (res.statusCode == 200) { if (res.statusCode == 200) {
var role = res.data.result.role; var role = res.data.result.role;
/**
if ((role == 4 || role == 5 || role == 6) && res.data.result.childAge == 0) { if ((role == 4 || role == 5 || role == 6) && res.data.result.childAge == 0) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/ageChange/ageChange', url: '/pages/ageChange/ageChange',
}) })
return; return;
} }
*/
//保存用户当前的省市区县信息 //保存用户当前的省市区县信息
location.province = res.data.result.province location.province = res.data.result.province
location.city = res.data.result.city location.city = res.data.result.city
......
...@@ -52,7 +52,7 @@ Page({ ...@@ -52,7 +52,7 @@ Page({
this.getList(); this.getList();
} else { } else {
wx.showToast({ wx.showToast({
title: '没有更多消息啦。', title: '没有更多活动啦。',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}); });
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text> <text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text>
<view> <view>
<view>征集范围:{{item.scope}}</view> <view>征集范围:{{item.scope}}</view>
<view>征集人数:{{item.max_member}}</view> <view>征集人数:{{item.max_member}}</view>
<view>发布单位:{{item.author}}</view> <view>发布单位:{{item.author}}</view>
<view>报名截止:{{item.enroll_time}}</view> <view>报名截止:{{item.enroll_time}}</view>
</view> </view>
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text> <text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text>
<view> <view>
<view>征集范围:{{item.scope}}</view> <view>征集范围:{{item.scope}}</view>
<view>征集人数:{{item.max_member}}</view> <view>征集人数:{{item.max_member}}</view>
<view>发布单位:{{item.author}}</view> <view>发布单位:{{item.author}}</view>
<view>报名截止:{{item.enroll_time}}</view> <view>报名截止:{{item.enroll_time}}</view>
</view> </view>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text> <text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text>
<view> <view>
<view>征集范围:{{item.scope}}</view> <view>征集范围:{{item.scope}}</view>
<view>征集人数:{{item.max_member}}</view> <view>征集人数:{{item.max_member}}</view>
<view>发布单位:{{item.author}}</view> <view>发布单位:{{item.author}}</view>
<view>报名截止:{{item.enroll_time}}</view> <view>报名截止:{{item.enroll_time}}</view>
</view> </view>
......
...@@ -19,6 +19,7 @@ Page({ ...@@ -19,6 +19,7 @@ Page({
isCircleOwner: false, isCircleOwner: false,
isMember: false, isMember: false,
isCircleOwner: false, isCircleOwner: false,
maxMemberTitle:'',
ownerCircleList:[],//圈主拥有的圈子列表 ownerCircleList:[],//圈主拥有的圈子列表
checkCircleIndex:[],//临时记录圈子选中状态 checkCircleIndex:[],//临时记录圈子选中状态
...@@ -71,6 +72,15 @@ Page({ ...@@ -71,6 +72,15 @@ Page({
circleMemberList: res.data.result.circleMemberList, circleMemberList: res.data.result.circleMemberList,
showOwnerDialog: false showOwnerDialog: false
}) })
if (res.data.result.volunteerEventDat.max_member > 0) {
that.setData({
maxMemberTitle: res.data.result.volunteerEventDat.max_member + "人"
})
} else {
that.setData({
maxMemberTitle: "不限"
})
}
//设定选择的默认状态 //设定选择的默认状态
if (res.data.result.isCircleOwner) { if (res.data.result.isCircleOwner) {
var tmp = []; var tmp = [];
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<text class="titleText">征集范围:</text><text class="dataText">{{volunteerEventDat.scope}}\n</text> <text class="titleText">征集范围:</text><text class="dataText">{{volunteerEventDat.scope}}\n</text>
</view> </view>
<view class="row"> <view class="row">
<text class="titleText">活动人数:</text><text class="dataText">{{volunteerEventDat.max_member}}人</text> <text class="titleText">活动人数:</text><text class="dataText">{{maxMemberTitle}}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="titleText">联系人:</text><text class="dataText">{{volunteerEventDat.leader_name}}</text> <text class="titleText">联系人:</text><text class="dataText">{{volunteerEventDat.leader_name}}</text>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment