Commit 575fc74a by shijiuyan

1

parent f19d96a4
// pages/memberChange/memberChange.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
entity:{}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
var config = wx.getStorage({
key: 'config',
success: function(res) {
console.log(res);
if(res){
that.getInfo(res.data.unionId);
}
},
})
// wx.request({
// url: '',
// })
},
getInfo(unionId){
var that = this;
wx.request({
url: app.url +'ajax_get_member_content.php',
data:{
unionId:unionId
},
success:function(resp){
console.log(resp)
that.setData({
entity:resp.data.result
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......@@ -62,5 +89,29 @@ Page({
*/
onShareAppMessage: function () {
},
buy(){
var config = wx.getStorage({
key: 'config',
success: function (res) {
console.log(res);
if (res) {
wx.request({
url: app.url +'ajax_buy_user_member.php',
data:{
unionId: res.data.unionId,
openId: res.data.openId
},
success:function(resp){
console.log(resp)
}
})
}
},
})
},
cancel(){
console.log(1111)
wx.navigateBack({});
}
})
\ No newline at end of file
......@@ -2,15 +2,15 @@
<view class='memberChange'>
<view class='con_memberChange'>
<view class='top_memberChange'>
购买中国志愿者会员,公益视频免费得看!
{{entity.title}}
</view>
<view class='money_memberChange'>
金额:<text>200.00元</text>
金额:<text>{{entity.money}}元</text>
</view>
<view class='huiyuan'>您的会员费用会直接xxxx</view>
<view class='huiyuan'>{{entity.comment}}</view>
<view class='btn'>
<view>购买</view>
<view>放弃</view>
<view bindtap="buy">购买</view>
<view bindtap="cancel">放弃</view>
</view>
</view>
</view>
// pages/myNewsDetail/myNewsDetail.js
import Toast from '../../dist/toast/toast';
var app = getApp();
Page({
......@@ -8,10 +9,13 @@ Page({
data: {
// attach_dat_type: "ORGNAZATION",
// attach_dat_type: "CIRCLE",
attach_dat_type: "VOLUNTEER",
attach_dat_type: "",
circle:false,
volunteer:false,
orgnazation:false
orgnazation:false,
attachDat:{},
messageDat:{},
msgId:0
},
/**
......@@ -31,42 +35,42 @@ Page({
volunteer: true
})
}
var config = wx.getStorageSync('config');
wx: wx.request({
url: app.url + 'ajax_get_user_message_detail.php',
header: { 'content-type': 'application/json' },
data: {
unionId: config.unionId,
page: 0
},
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
},
fail: function (res) { },
complete: function (res) { },
var that=this;
var messageId=options.messageId;
this.setData({
msgId:messageId
})
wx: wx.request({
url: app.url + 'ajax_check_user_join_circle.php',
data: {
unionId: config.unionId,
circleId: 7,
msgId: 1
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
this.getInfo(messageId);
},
getInfo(messageId){
var that=this;
wx.getStorage({
key: 'config',
success: function (res) {
console.log(res)
// if (res.statusCode == 200) {
// that.setData({
// userCircleList: res.data.result.userCircleList
// })
// }
if (res.data.unionId) {
wx.request({
url: app.url + 'ajax_get_user_message_detail.php',
header: { 'content-type': 'application/json' },
data: {
unionId: res.data.unionId,
messageId: messageId
},
success: function (res) {
console.log(res)
if (res.data.status == 'OK') {
console.log(res.data.result.userMessageDat.attach_dat_type)
that.setData({
attach_dat_type: res.data.result.userMessageDat.attach_dat_type,
messageDat: res.data.result.userMessageDat,
attachDat: res.data.result.attachDat
})
}
},
fail: function (res) { },
complete: function (res) { },
})
}
},
fail: function (res) { },
complete: function (res) { },
})
},
......@@ -81,7 +85,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
......@@ -118,59 +121,54 @@ Page({
onShareAppMessage: function () {
},
//拒绝加入圈子
jujue() {
var that = this;
var config = wx.getStorageSync('config');
// var location = wx.getStorageSync('location');
wx: wx.request({
url: app.url + 'ajax_refuse_user_join_circle.php',
data: {
unionId: config.unionId,
circleId: 7,
msgId: 1
userId: that.data.messageDat.user_id,
circleId: that.data.attachDat.id,
msgId: that.data.msgId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
// if (res.statusCode == 200) {
// that.setData({
// userCircleList: res.data.result.userCircleList
// })
// }
if (res.data.status == 'OK') {
Toast.success(res.data.result.message);
} else {
Toast.fail(res.data.result.message);
}
that.getInfo(that.data.msgId);
},
fail: function (res) { },
complete: function (res) { },
})
},
//同意加入圈子
tongyi() {
var that = this;
var config = wx.getStorageSync('config');
// var location = wx.getStorageSync('location');
wx: wx.request({
wx.request({
url: app.url + 'ajax_accept_user_join_circle.php',
data: {
unionId: config.unionId,
circleId: 7,
msgId: 1
userId: that.data.messageDat.user_id,
circleId: that.data.attachDat.id,
msgId: that.data.msgId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
// if (res.statusCode == 200) {
// that.setData({
// userCircleList: res.data.result.userCircleList
// })
// }
wx.navigateTo({
url: '../circleMembers/circleMembers',
})
if(res.data.status=='OK'){
Toast.success(res.data.result.message);
}else{
Toast.fail(res.data.result.message);
}
that.getInfo(that.data.msgId);
},
fail: function (res) { },
complete: function (res) { },
})
},
into(){
var that=this;
wx.navigateTo({
url: '/'+this.data.messageDat.attach_dat_path
})
}
})
\ No newline at end of file
<!--pages/myNewsDetail/myNewsDetail.wxml-->
<view class='myNewsDetail'>
<view class='firstpage' wx:if="{{orgnazation==true}}">
<view class='title_firstpage'>标题</view>
<view class='content_firstpage'>sfdf</view>
<view class='firstpage' wx:if="{{attach_dat_type=='ORGNAZATION'}}">
<view class='title_firstpage'>{{messageDat.title}}</view>
<view class='content_firstpage'>{{messageDat.comment}}</view>
<!-- <view class='btn_firstpage'>
<view>取消</view>
<view style='background:#698FBB'>确认</view>
</view> -->
</view>
<view class='con_checkJoinCircle' wx:if="{{circle==true}}">
<view class='btn'>
<view bindtap='jujue'>拒绝</view>
<view class='agreen' bindtap='tongyi'>同意</view>
<view class='con_checkJoinCircle' wx:if="{{attach_dat_type=='CIRCLE'}}">
<view style="text-align:center;">
<view style="font-size:20px;font-weight:600;margin-bottom:10px;">{{messageDat.title}}</view>
<view style="margin-bottom:10px;">{{attachDat.title}}</view>
<view style="margin-bottom:10px;">{{messageDat.comment}}</view>
</view>
<view class='btn' wx:if="{{messageDat.is_operated==false}}" >
<van-button type="primary" bind:click="tongyi" size="large" custom-style="margin-bottom:10px;height:35px;">同意</van-button>
<van-button type="default" bind:click="jujue" size="large" custom-style="height:35px;">拒绝</van-button>
<!-- <view bindtap='jujue'>拒绝</view>
<view class='agreen' bindtap='tongyi'>同意</view> -->
</view>
</view>
<view class='listVolunteers' wx:if="{{volunteer==true}}">
<view class='listVolunteers' bindtap="into" wx:if="{{attach_dat_type=='VOLUNTEER'}}">
<view>
<view class='left_listVolunteers'>
<image src='../../img/3.jpg'></image>
<text>征集中</text>
<view>(市)</view>
<image src='{{attachDat.front_image}}'></image>
<text>{{attachDat.status_title}}</text>
<view></view>
</view>
<view class='right_listVolunteers'>
<text>周末图书馆清洁活动</text>
<text>{{attachDat.title}}</text>
<view>
<text>征集范围:校内\n</text>
<text>征集人数:10人\n</text>
<text>发布单位:南京市教育局\n</text>
<text>报名截止:2019.10.10</text>
<text>征集范围:{{attachDat.scope}}\n</text>
<text>征集人数:{{attachDat.max_member}}人\n</text>
<text>发布单位:{{attachDat.author}}\n</text>
<text>报名截止:{{attachDat.enroll_time}}</text>
</view>
</view>
</view>
</view>
</view>
<van-toast id="van-toast" />
......@@ -6,13 +6,14 @@
bottom: 0;
right: 0;
margin: auto;
width: 260px;
height: 260px;
width: 250px;
height: 400px;
}
.title_firstpage{
width: 100%;
text-align: center;
font-size: 14px;
font-size: 18px;
font-weight: 600;
}
.content_firstpage{
width: 100%;
......@@ -41,18 +42,16 @@
bottom: 0;
right: 0;
margin: auto;
width: 200px;
height: 200px;
background: red;
width: 300px;
height: 400px;
}
.btn{
position: absolute;
bottom: 0;
top: 30;
left: 0;
width: 100%;
height: 30px;
background: #fff;
display: flex;
text-align: center;
}
.btn>view{
flex: 1;
......
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