Commit acdfbb75 by tangjinlin

Merge branch 'znz_dev' into 'master'

0519

See merge request !13
parents 54ace75f ec3db08c
......@@ -37,11 +37,6 @@ App({
unionId: resp.data.result.unionId,
registed: resp.data.result.registed
};
// wx.showToast({
// title: "unionId=" + res.data.result.unionId,
// icon: 'success',
// duration: 2000
// });
wx.setStorageSync("config", config);
},
fail (resp) {
......@@ -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({
......
......@@ -17,8 +17,9 @@ Page({
mediaCount: '',
mediaList: [],
videoHeight: '150',
play: 0,
fufeiPage: 0,
showPay: 0,
showPlay: 0,
playUrl: '',
detailComment: '',
price: 0,//购买价格,合集则为合集价格,单个视频则为单个视频的价格
......@@ -95,7 +96,7 @@ Page({
//点击观看处理
learn(e) {
var that = this;
let id = e.currentTarget.dataset['id'];
var id = e.currentTarget.dataset['id'];
wx.getStorage({
key: 'config',
success: function (res) {
......@@ -110,16 +111,18 @@ Page({
success: function (resp) {
console.log(resp)
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({
play: 1,
showPlay: 1,
playUrl: resp.data.result.courseMediaDat.media,
detailComment: resp.data.result.courseMediaDat.comment
})
} else {
//显示购买对话框
that.setData({
playUrl: resp.data.result.courseMediaDat.media,
fufeiPage: 1,
showPay: 1,
price: resp.data.result.courseMediaDat.price
})
}
......@@ -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({
updateTime: res.data.result.updateTime,
viewCount: res.data.result.viewCount,
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) {
//单个视频的情况下,支付价格重新赋值
that.setData({
price: res.data.result.mediaList[0].price
})
......@@ -187,12 +185,12 @@ Page({
videoplay() {
if (this.data.show1) {
this.setData({
fufeiPage: 1
showPay: 1
})
this.fufeilook()
} else {
this.setData({
play: 1
showPlay: 1
})
this.classDerails();
var query = wx.createSelectorQuery();
......@@ -205,9 +203,11 @@ Page({
}).exec();
}
},
//播放返回
backplay() {
this.setData({
play: 0
showPlay: 0
})
},
......@@ -234,12 +234,16 @@ Page({
complete: function (res) {},
})
},
backfufei() {
//取消支付
cancelPay() {
this.setData({
fufeiPage: 0
showPay: 0
})
},
surefufei() {
//确认支付
surePay() {
var that = this;
wx.getStorage({
key: 'config',
......@@ -250,6 +254,7 @@ Page({
data: {
unionId: res.data.unionId,
openId: res.data.openId,
courseId: that.data.courseId,
mediaId: that.data.mediaId
},
success: function (resp) {
......@@ -264,8 +269,8 @@ Page({
paySign: result.paySign,
success(res) {
that.setData({
fufeiPage: 0,
play: 1
showPay: 0,
showPlay: 1
})
},
fail(res) {
......@@ -278,9 +283,5 @@ Page({
}
},
})
// this.setData({
// fufeiPage: 0
// })
}
})
\ No newline at end of file
......@@ -47,8 +47,8 @@
<block wx:for="{{mediaList}}">
<view class="catalog">
<text bindtap='videoplay'>{{item.title}}</text>
<image src='/img/suo1.png' class='suo' wx:if="{{!haveBuy&&price>0}}" bindtap=""></image>
<image src='/img/sanjiao.png' class='suo' wx:if="{{haveBuy||price==0}}" bindtap="playCourse"></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="learn" data-id="{{item.id}}"></image>
</view>
</block>
</view>
......@@ -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:elif="{{courseId>0}}" bindtap="learn" data-id="{{mediaId}}">学习</view>
<view class="buyBtn" wx:elif="{{courseId>0}}">请点击目录学习</view>
</view>
</view>
<view class='play' wx:if="{{play==1}}">
<view class='play' wx:if="{{showPlay==1}}">
<video class='video' src="{{playUrl}}"></video>
<view style='font-size:14px;padding-left:5px;margin-top:10px;'>
<image src='../../img/sanjiao.png'></image>课程简介
......@@ -83,7 +83,7 @@
<van-button type="warning" bind:click="backplay" size='large'>返回</van-button>
</view>
</view>
<view class='fufeilook' wx:if="{{fufeiPage==1}}">
<view class='fufeilook' wx:if="{{showPay==1}}">
<view class='con_fufeilook'>
<image class="zfbg" src="/img/zhifubg.png" mode="widthFix"></image>
<image bindtap='backfufei' src="/img/close.png"></image>
......@@ -93,8 +93,8 @@
<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 class='fufeiBtn'>
<view style="background: linear-gradient(to right, #e85c6d, #fb689b);color:#fff" bindtap='surefufei'>确认</view>
<view style="border: 1rpx solid #fd66a1" bindtap='backfufei'>取消</view>
<view style="background: linear-gradient(to right, #e85c6d, #fb689b);color:#fff" bindtap='surePay'>确认</view>
<view style="border: 1rpx solid #fd66a1" bindtap='cancelPay'>取消</view>
</view>
</view>
</view>
......
......@@ -14,7 +14,7 @@
<view class='topTitle'>
<view class='leftTitle'>
<view class='leftLine'></view>
<text class="hot_title">热门资讯</text>
<text class="hot_title">热门咨询</text>
</view>
<view class='rightTitle' bindtap='myFaq'>
<text>我的咨询</text>
......
......@@ -38,16 +38,51 @@ Page({
var location = wx.getStorageSync('location');
var latitude = location.latitude;
var longitude = location.longitude;
if (config.unionId !== undefined) {
that.getUserRole(config.unionId, latitude, 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) {
that.getUserRole(config.unionId, latitude, longitude);
} else {
setTimeout(function () {
config = wx.getStorageSync('config');
that.getUserRole(config.unionId, latitude, longitude);
}, 1000);
}
}
})
} else {
setTimeout(function () {
config = wx.getStorageSync('config');
//获取首页数据
if (config.unionId !== undefined) {
that.getUserRole(config.unionId, latitude, longitude);
}, 1000);
} else {
setTimeout(function () {
config = wx.getStorageSync('config');
that.getUserRole(config.unionId, latitude, longitude);
}, 1000);
}
}
},
//获取首页数据
getUserRole(unionId, latitude, longitude) {
var that = this;
var location = wx.getStorageSync('location');
......@@ -68,12 +103,14 @@ Page({
console.log(res)
if (res.statusCode == 200) {
var role = res.data.result.role;
/**
if ((role == 4 || role == 5 || role == 6) && res.data.result.childAge == 0) {
wx.navigateTo({
url: '/pages/ageChange/ageChange',
})
return;
}
*/
//保存用户当前的省市区县信息
location.province = res.data.result.province
location.city = res.data.result.city
......
......@@ -52,7 +52,7 @@ Page({
this.getList();
} else {
wx.showToast({
title: '没有更多消息啦。',
title: '没有更多活动啦。',
icon: 'success',
duration: 2000
});
......
......@@ -7,7 +7,7 @@
<text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text>
<view>
<view>征集范围:{{item.scope}}</view>
<view>征集人数:{{item.max_member}}</view>
<view>征集人数:{{item.max_member}}</view>
<view>发布单位:{{item.author}}</view>
<view>报名截止:{{item.enroll_time}}</view>
</view>
......
......@@ -46,7 +46,7 @@
<text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text>
<view>
<view>征集范围:{{item.scope}}</view>
<view>征集人数:{{item.max_member}}</view>
<view>征集人数:{{item.max_member}}</view>
<view>发布单位:{{item.author}}</view>
<view>报名截止:{{item.enroll_time}}</view>
</view>
......@@ -70,7 +70,7 @@
<text style="background:#{{item.status_title=='征集中'?'c1527e':'0a9a7b'}}">{{item.status_title}}</text>
<view>
<view>征集范围:{{item.scope}}</view>
<view>征集人数:{{item.max_member}}</view>
<view>征集人数:{{item.max_member}}</view>
<view>发布单位:{{item.author}}</view>
<view>报名截止:{{item.enroll_time}}</view>
</view>
......
......@@ -19,6 +19,7 @@ Page({
isCircleOwner: false,
isMember: false,
isCircleOwner: false,
maxMemberTitle:'',
ownerCircleList:[],//圈主拥有的圈子列表
checkCircleIndex:[],//临时记录圈子选中状态
......@@ -71,6 +72,15 @@ Page({
circleMemberList: res.data.result.circleMemberList,
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) {
var tmp = [];
......
......@@ -23,7 +23,7 @@
<text class="titleText">征集范围:</text><text class="dataText">{{volunteerEventDat.scope}}\n</text>
</view>
<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 class="row">
<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