Browse Source

管理活动

master
eternity 3 years ago
parent
commit
e4498204e9
  1. 29
      pages/release/manageIndex/manageIndex.js
  2. 12
      pages/release/manageIndex/manageIndex.wxml
  3. 56
      pages/release/signIndex/signIndex.js
  4. 8
      pages/release/signIndex/signIndex.wxml

29
pages/release/manageIndex/manageIndex.js

@ -10,18 +10,19 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
id:0,
detail:{views:'1223',share:'2444',join:'344',cancel:'23',all:'22222'}, detail:{views:'1223',share:'2444',join:'344',cancel:'23',all:'22222'},
switchChecked: true, switchChecked: true,
switchCheckedbao:true switchCheckedbao:true
}, },
toedit:function(){ toedit:function(){
wx.navigateTo({ wx.navigateTo({
url: '../addactive/addactive?id=1' url: '../addactive/addactive?id=' + this.data.id
}) })
}, },
tosign:function(){ tosign:function(){
wx.navigateTo({ wx.navigateTo({
url: '../signIndex/signIndex' url: '../signIndex/signIndex?activity_id='+this.data.id
}) })
}, },
switchChange: function(e) { switchChange: function(e) {
@ -81,9 +82,28 @@ Page({
this.setData({ this.setData({
id:options.id id:options.id
}) })
console.log(this.data.id)
this.manageIndex(options.id); this.manageIndex(options.id);
this.lastviews(options.id); this.lastviews(options.id);
}, },
delActivity(e){
var header = {
token:wx.getStorageSync('token'),
"Content-Type": "application/x-www-form-urlencoded"
};
re.request(Api.removeActivity(), {
activityId:e.currentTarget.dataset.id,
}, header).then((res) => {
wx.showToast({
title: '操作成功',
icon: 'none',
duration: 1000
})
wx.navigateBack({
delta: 1
})
})
},
manageIndex:function(id){ manageIndex:function(id){
var that = this; var that = this;
const imgUrl = wx.getStorageSync('imgUrl') const imgUrl = wx.getStorageSync('imgUrl')
@ -107,6 +127,11 @@ Page({
// }) // })
}) })
}, },
toactiveDetail:function(e){
wx.navigateTo({
url: '/pages/index/activeDetail/activeDetail?id='+e.currentTarget.dataset.id+''
})
},
lastviews:function(id){ lastviews:function(id){
var that = this; var that = this;
var postData = { var postData = {

12
pages/release/manageIndex/manageIndex.wxml

@ -7,7 +7,7 @@
</view> </view>
</view> </view>
<view class="circle"> <view class="circle">
<view class="stats"> <!-- <view class="stats"></view>
<view class="title"><text>数据统计</text></view> <view class="title"><text>数据统计</text></view>
<view class="list"> <view class="list">
<view class="listone"> <view class="listone">
@ -31,10 +31,10 @@
<view>累计收入</view> <view>累计收入</view>
</view> </view>
</view> </view>
</view> </view> -->
<view class='echart_wrap'> <!-- <view class='echart_wrap'>
<canvas style="width: 100%; height: 500rpx;" canvas-id="yueEle" binderror="canvasIdErrorCallback"></canvas> <canvas style="width: 100%; height: 500rpx;" canvas-id="yueEle" binderror="canvasIdErrorCallback"></canvas>
</view> </view> -->
<view class="activeset"> <view class="activeset">
<view class="swich"> <view class="swich">
活动是否上架 活动是否上架
@ -46,8 +46,8 @@
</view> </view>
</view> </view>
<view class="activeset"> <view class="activeset">
<view class="threeset">活动页面</view> <view class="threeset" bindtap="toactiveDetail" data-id="{{id}}">活动页面</view>
<view class="threeset">删除活动</view> <view class="threeset" bindtap="delActivity" data-id="{{id}}">删除活动</view>
<view class="threeset">复制再发一个</view> <view class="threeset">复制再发一个</view>
</view> </view>
</view> </view>

56
pages/release/signIndex/signIndex.js

@ -1,10 +1,13 @@
// pages/release/signIndex/signIndex.js // pages/release/signIndex/signIndex.js
var Api = require('../../../utils/common.js');
var re = require('../../../utils/request.js');
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
activityId:'',
joinlist:[ joinlist:[
{img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'}, {img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'},
{img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'} {img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'}
@ -19,6 +22,51 @@ Page({
url: '../manageIndex/manageIndex' url: '../manageIndex/manageIndex'
}) })
}, },
delActivity(){
var that = this;
var postData = {
activityId:that.data.activityId
};
var header = {
token:wx.getStorageSync('token'),
"Content-Type": "application/x-www-form-urlencoded"
};
re.request(Api.removeActivity(), postData, header).then((res) => {
wx.showToast({
title: res.msg,
duration: 0,
})
})
},
getRegisterAll:function(){
var that = this;
var postData = {
activityId:that.data.activityId
};
var header = {
token:wx.getStorageSync('token'),
"Content-Type": "application/x-www-form-urlencoded"
};
re.request(Api.getRegisterAll(), postData, header).then((res) => {
let datas = res.data.data;
let cancellist = [];
let joinlist = [];
//根据状态registerStatus报名状态0-未报名 1-已报名 2-已取消 3-报名中
for(let i=0;i<datas.length;i++){
if(datas[i].registerStatus == 2){
cancellist.push(datas[i])
}
if(datas[i].registerStatus == 1){
joinlist.push(datas[i])
}
}
that.setData({
cancellist: cancellist,
joinlist: joinlist
})
console.log(that.data.cancellist,that.data.joinlist)
})
},
todetail:function(){ todetail:function(){
wx.navigateTo({ wx.navigateTo({
url: '../addjoiner/addjoiner?edit=false' url: '../addjoiner/addjoiner?edit=false'
@ -33,7 +81,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options)
this.setData({
activityId:options.activity_id
})
this.getRegisterAll();
}, },
/** /**
@ -47,7 +99,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getRegisterAll();
}, },
/** /**

8
pages/release/signIndex/signIndex.wxml

@ -18,11 +18,11 @@
<block wx:for="{{joinlist}}" wx:key="joinlist"> <block wx:for="{{joinlist}}" wx:key="joinlist">
<view class="list" bindtap="todetail"> <view class="list" bindtap="todetail">
<view class="list-left"> <view class="list-left">
<image src="{{item.img}}"></image> <image src="{{item.userPhoto}}"></image>
</view> </view>
<view class="list-right"> <view class="list-right">
<view class="right-top"> <view class="right-top">
{{item.name}}<text>¥{{item.price}}</text> {{item.nickname}}<text>¥{{item.realCost}}</text>
</view> </view>
<view class="right-content"> <view class="right-content">
{{item.intro}} <text>微信支付</text> {{item.intro}} <text>微信支付</text>
@ -43,11 +43,11 @@
<block wx:for="{{cancellist}}" wx:key="cancellist"> <block wx:for="{{cancellist}}" wx:key="cancellist">
<view class="list"> <view class="list">
<view class="list-left"> <view class="list-left">
<image src="{{item.img}}"></image> <image src="{{item.userPhoto}}"></image>
</view> </view>
<view class="list-right"> <view class="list-right">
<view class="right-top"> <view class="right-top">
{{item.name}}<text>¥{{item.price}}</text> {{item.nickname}}<text>¥{{item.realCost}}</text>
</view> </view>
<view class="right-content"> <view class="right-content">
{{item.intro}} <text>微信支付</text> {{item.intro}} <text>微信支付</text>

Loading…
Cancel
Save