|
@@ -1,15 +1,14 @@
|
|
|
<template>
|
|
|
-<div>
|
|
|
- <header class="mui-bar mui-bar-nav">
|
|
|
- <h1 class="mui-title">发起活动</h1>
|
|
|
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
|
|
- </header>
|
|
|
+ <div>
|
|
|
+ <common ref="common" @asynCallBack="asynCallBack"></common>
|
|
|
+ <top-header :pageTitle="pageTitle" :rightLink="rightLink" :doRightLink="doRightLink"></top-header>
|
|
|
+
|
|
|
<div class="mui-content vongi-fqhd">
|
|
|
<div class="margin10">
|
|
|
<form class="mui-input-group">
|
|
|
<div class="mui-input-row">
|
|
|
<label style="width:50%">查看活动模板</label>
|
|
|
- <button class="mui-btn mui-btn-block mui-navigate-right" type='button' style="width:50%">
|
|
|
+ <button @click="goToTemplate" class="mui-btn mui-btn-block mui-navigate-right" type='button' style="width:50%">
|
|
|
查看
|
|
|
</button>
|
|
|
</div>
|
|
@@ -19,47 +18,29 @@
|
|
|
<form class="mui-input-group">
|
|
|
<div class="mui-input-row">
|
|
|
<label><i class="colorfe616c">*</i>活动标题</label>
|
|
|
- <input type="text" class="mui-input-clear" placeholder="请输入">
|
|
|
+ <input v-model="subForm.title" type="text" class="mui-input-clear" placeholder="请输入">
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
- <div class="vongi-fqhd-add margin10">
|
|
|
- <a href="#addPopover"><span class="mui-icon mui-icon-plus"></span></a>
|
|
|
- </div>
|
|
|
- <div class="vongi-cashier margin10">
|
|
|
- <div class="vongi-fqhd-addimg">
|
|
|
- <img src="~$project/assets/img/02.jpg" alt="">
|
|
|
- <!--<span>添加图片</span>
|
|
|
- <i class="iconfont icon-23"></i>-->
|
|
|
- </div>
|
|
|
- <div class="vongi-cashier-text">
|
|
|
- <a class="vongi-text-tit color333" href="">
|
|
|
- 名都喜欢羽毛球的业主朋友们,快快投入组织的怀抱吧——名都业主“羽你同行”俱乐部欢迎你!
|
|
|
- </a>
|
|
|
- <a><span class="mui-icon iconfont icon-guanbi1"></span></a>
|
|
|
- <a><span class="mui-icon iconfont icon-jiantou1"></span></a>
|
|
|
+
|
|
|
+ <div v-for="(item,index) in subForm.contentList" class="vongi-cashier margin10">
|
|
|
+ <div @click="chooseImage(index)" class="vongi-fqhd-addimg">
|
|
|
+ <img v-if="item.picture" :src="item.picture">
|
|
|
+ <div v-else>
|
|
|
+ <span>添加图片</span>
|
|
|
+ <i class="iconfont icon-23"></i>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="vongi-fqhd-add margin10">
|
|
|
- <a href="#addPopover"><span class="mui-icon mui-icon-plus"></span></a>
|
|
|
- </div>
|
|
|
- <div class="vongi-cashier margin10">
|
|
|
- <a class="vongi-fqhd-addimg" href="">
|
|
|
- <!--<img src="~$project/assets/img/02.jpg" alt="">-->
|
|
|
- <span>添加图片</span>
|
|
|
- <i class="iconfont icon-23"></i>
|
|
|
- </a>
|
|
|
<div class="vongi-cashier-text">
|
|
|
- <a class="vongi-text-tit color333" href="">
|
|
|
- 名都喜欢羽毛球的业主朋友们,快快投入组织的怀抱吧——名都业主“羽你同行”俱乐部欢迎你!
|
|
|
- </a>
|
|
|
- <a><span class="mui-icon iconfont icon-guanbi1"></span></a>
|
|
|
+ <router-link :to="{name:'MasterActivityAddText',query:{index:index}}" class="vongi-text-tit color333" v-text="item.detail"></router-link>
|
|
|
+ <a @click="delItem(index)"><span class="mui-icon iconfont icon-guanbi1"></span></a>
|
|
|
<a><span class="mui-icon iconfont icon-jiantou1"></span></a>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="vongi-fqhd-add margin10">
|
|
|
- <a href="#addPopover"><span class="mui-icon mui-icon-plus"></span></a>
|
|
|
- <div id="#addPopover" class="vongi-popover">
|
|
|
+ <a @click="addShow=true"><span class="mui-icon mui-icon-plus"></span></a>
|
|
|
+ <div v-show="addShow" class="vongi-popover">
|
|
|
<div class="mui-popover-arrow mui-bottom" style="left:43.5px"></div>
|
|
|
<ul class="mui-table-view mui-grid-view mui-grid-9">
|
|
|
<li class="mui-table-view-cell mui-media mui-col-xs-6">
|
|
@@ -69,7 +50,7 @@
|
|
|
</a>
|
|
|
</li>
|
|
|
<li class="mui-table-view-cell mui-media mui-col-xs-6">
|
|
|
- <a href="#">
|
|
|
+ <a @click="addWord">
|
|
|
<span class="iconfont icon-wenzi color4fc5f7"></span>
|
|
|
<div class="mui-media-body">文字</div>
|
|
|
</a>
|
|
@@ -79,13 +60,186 @@
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
-</div>
|
|
|
+
|
|
|
+ <loading :visible="isLoading"></loading>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as API_Activity from '@/apis/Master/activity'
|
|
|
+ import Common from '$project/components/Common.vue'
|
|
|
+ import Loading from '$project/components/Loading.vue'
|
|
|
+ import TopHeader from '$project/components/TopHeader.vue'
|
|
|
+ import {
|
|
|
+ mapGetters,
|
|
|
+ mapMutations
|
|
|
+ } from 'vuex'
|
|
|
+ import * as types from '$project/store/mutation-types'
|
|
|
+ import * as WxJsApi from '$project/utils/wxJsApi'
|
|
|
+ export default {
|
|
|
+ name: 'MasterActivityMyInfo',
|
|
|
+ components: {
|
|
|
+ Common,
|
|
|
+ Loading,
|
|
|
+ TopHeader,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isLoading: false,
|
|
|
+
|
|
|
+ pageTitle: '发起活动',
|
|
|
+
|
|
|
+ subForm: {
|
|
|
+ title: '',
|
|
|
+ content: '',
|
|
|
+ contentList: [],
|
|
|
+ },
|
|
|
+ addShow: false,
|
|
|
+
|
|
|
+ rightLink: {
|
|
|
+ show: true,
|
|
|
+ icon: 'mui-btn mui-btn-primary',
|
|
|
+ style: 'width: 55px;height: 25px;margin-top:5px;margin-right: 0px;line-height: 5px;color: #fff;font-size:16px;border-radius:20px;',
|
|
|
+ title: '预览'
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ if (this.activity_form_data) {
|
|
|
+ this.subForm = this.activity_form_data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //获取详情
|
|
|
+ getInfo() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Activity.getActivityInfo(this.id).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+ this.detail = response;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //查看模板
|
|
|
+ goToTemplate() {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'MasterActivityTemplate'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //向某个位置追加数据
|
|
|
+ pushList() {
|
|
|
+ var item = {
|
|
|
+ picture: '',
|
|
|
+ detail: ''
|
|
|
+ }
|
|
|
+ this.subForm.contentList.push(item);
|
|
|
+ this.set_activity_form_data(this.subForm)
|
|
|
+ },
|
|
|
+ //删除某个元素
|
|
|
+ delItem(index) {
|
|
|
+ this.subForm.contentList.splice(index, 1);
|
|
|
+ this.set_activity_form_data(this.subForm)
|
|
|
+ },
|
|
|
+ //增加文字
|
|
|
+ addWord() {
|
|
|
+ this.pushList();
|
|
|
+ console.log(this.subForm.contentList.length)
|
|
|
+ this.$router.push({
|
|
|
+ name: 'MasterActivityAddText',
|
|
|
+ query: {
|
|
|
+ index: this.subForm.contentList.length - 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //微信选择图片
|
|
|
+ chooseImage(index) {
|
|
|
+ WxJsApi.chooseImage().then(res => {
|
|
|
+ var localData = res.localData;
|
|
|
+
|
|
|
+ if (localData.indexOf('data:image') != 0) {
|
|
|
+ //判断是否有这样的头部
|
|
|
+ localData = 'data:image/jpeg;base64,' + localData
|
|
|
+ }
|
|
|
+ localData = localData.replace(/\r|\n/g, '').replace('data:image/jgp', 'data:image/jpeg')
|
|
|
+ this.imgBase64 = localData;
|
|
|
+ //显示裁剪图片
|
|
|
+ //this.showCropper('faceImageUrl');
|
|
|
+ this.uploadpic(index);
|
|
|
+ }).catch(error => {
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //上传图片
|
|
|
+ uploadpic(index) {
|
|
|
+ this.isLoading = true;
|
|
|
+ WxJsApi.uploadPic(this.imgBase64).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+
|
|
|
+ this.subForm.contentList[index]['picture'] = response;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //预览
|
|
|
+ doRightLink() {
|
|
|
+ if (!this.subForm.title) {
|
|
|
+ mui.toast('请输入活动标题');
|
|
|
+ } else {
|
|
|
+ this.set_activity_form_data(this.subForm)
|
|
|
+ //this.save();
|
|
|
+ this.$router.push({
|
|
|
+ name: 'MasterActivityAddPreview',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //提交保存
|
|
|
+ /* save() {
|
|
|
+ this.isLoading = true;
|
|
|
+ this.subForm.content = JSON.stringify(this.subForm.contentList);
|
|
|
+ API_Activity.addActivity(this.subForm).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+
|
|
|
+ this.$router.push({
|
|
|
+ name: 'MasterActivityAddPreview',
|
|
|
+ query: {
|
|
|
+ id: response.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ }, */
|
|
|
+ asynCallBack() {
|
|
|
+
|
|
|
+ },
|
|
|
+ ...mapMutations({
|
|
|
+ set_activity_form_data: types.SET_ACTIVITY_FORM_DATA,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ //获取微信配置
|
|
|
+ WxJsApi.getWxConfig();
|
|
|
+ },
|
|
|
+ destroyed() {},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ openId: 'wx_openid',
|
|
|
+ token: 'token',
|
|
|
+ person_data: 'person_data',
|
|
|
+ person_popedom: 'person_popedom',
|
|
|
+ activity_form_data: 'activity_form_data',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|
|
|
<style src="$project/assets/css/iconfont.css"></style>
|
|
|
-<style>
|
|
|
+<style scoped>
|
|
|
+ .vongi-text-tit {
|
|
|
+ min-height: 63px;
|
|
|
+ }
|
|
|
</style>
|