作者 lihongjuan

1

... ... @@ -2589,6 +2589,16 @@
"integrity": "sha1-ACwZkJEtDVlYDJO9NsBW3pnkJZo=",
"dev": true
},
"clipboard": {
"version": "2.0.6",
"resolved": "https://registry.npm.taobao.org/clipboard/download/clipboard-2.0.6.tgz",
"integrity": "sha1-UpISlu7A/fd+rRdJQhshyWhkc3Y=",
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"cliui": {
"version": "4.1.0",
"resolved": "https://registry.npm.taobao.org/cliui/download/cliui-4.1.0.tgz",
... ... @@ -4314,6 +4324,11 @@
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"dev": true
},
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npm.taobao.org/delegate/download/delegate-3.2.0.tgz",
"integrity": "sha1-tmtxwxWFIuirV0T3INjKDCr1kWY="
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz",
... ... @@ -5553,6 +5568,14 @@
"pinkie-promise": "^2.0.0"
}
},
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npm.taobao.org/good-listener/download/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"requires": {
"delegate": "^3.1.2"
}
},
"graceful-fs": {
"version": "4.2.4",
"resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.4.tgz?cache=0&sync_timestamp=1588086905523&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fgraceful-fs%2Fdownload%2Fgraceful-fs-4.2.4.tgz",
... ... @@ -12621,6 +12644,11 @@
}
}
},
"select": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/select/download/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0="
},
"select-hose": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/select-hose/download/select-hose-2.0.0.tgz",
... ... @@ -13645,6 +13673,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/tiny-emitter/download/tiny-emitter-2.1.0.tgz",
"integrity": "sha1-HRpW7fxRxD6GPLtTgqcjMONVVCM="
},
"tmpl": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/tmpl/download/tmpl-1.0.4.tgz",
... ... @@ -14216,6 +14249,14 @@
"resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.11.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.11.tgz",
"integrity": "sha1-dllNh31LEiNEBuhONSdcbVFBJcU="
},
"vue-clipboard2": {
"version": "0.3.1",
"resolved": "https://registry.npm.taobao.org/vue-clipboard2/download/vue-clipboard2-0.3.1.tgz",
"integrity": "sha1-blUft704SImyiw2jsSKJ7WvKSJQ=",
"requires": {
"clipboard": "^2.0.0"
}
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npm.taobao.org/vue-hot-reload-api/download/vue-hot-reload-api-2.3.4.tgz",
... ...
... ... @@ -14,8 +14,10 @@
},
"dependencies": {
"axios": "^0.19.2",
"clipboard": "^2.0.6",
"vant": "^2.9.2",
"vue": "^2.5.2",
"vue-clipboard2": "^0.3.1",
"vue-router": "^3.0.1",
"weixin-js-sdk": "^1.6.0"
},
... ...
... ... @@ -7,7 +7,11 @@
<img src="../../../assets/search.png" alt />
</div>
<input type="text" placeholder="搜索你感兴趣的课程文章" class="searchtext" />
<input
type="text"
placeholder="搜索你感兴趣的课程文章"
class="searchtext"
/>
</div>
</div>
<!-- 课程列表 -->
... ... @@ -57,17 +61,21 @@
:class="selnav == 0 ? 'selactive' : ''"
:data-id="0"
@click="selectnav"
>音频课程</div>
>
音频课程
</div>
<div
class="coursenavleft"
:class="selnav == 1 ? 'selactive' : ''"
:data-id="1"
@click="selectnav"
>营养小知识</div>
>
营养小知识
</div>
</div>
<!-- 课程 -->
<div v-if="selnav == 0">
<div class="nodata" v-if="videolist.length==0">暂无数据</div>
<div class="nodata" v-if="videolist.length == 0">暂无数据</div>
<van-list
class="courseboxk"
v-model="loading"
... ... @@ -81,9 +89,9 @@
<img :src="item.image" alt />
</div>
<div class="coursetext">
<div class="coursetitle">{{item.title}}</div>
<div class="coursename">{{item.description}}</div>
<div class="courseteacher">{{item.user.nickname}}</div>
<div class="coursetitle">{{ item.title }}</div>
<div class="coursename">{{ item.description }}</div>
<div class="courseteacher">{{ item.user.nickname }}</div>
</div>
</div>
</van-list>
... ... @@ -91,7 +99,7 @@
<!-- 营养小知识 -->
<div v-if="selnav == 1">
<div class="nodata" v-if="yinglist.length==0">暂无数据</div>
<div class="nodata" v-if="yinglist.length == 0">暂无数据</div>
<van-list
class="courseboxk"
v-model="loadingying"
... ... @@ -122,9 +130,9 @@
</template>
<script>
import Vue from 'vue';
import Vue from "vue";
import tabBar from "@/components/views/tabBar.vue";
import { List } from 'vant';
import { List } from "vant";
Vue.use(List);
export default {
components: {
... ... @@ -141,13 +149,12 @@ export default {
finishedying: false,
yinglist: [],
videopage: 1,
this_page: '',
total_page: ''
this_page: "",
total_page: ""
};
},
created() {
this.getvideolist()
this.getvideolist();
},
methods: {
// 视频上拉加载
... ... @@ -156,13 +163,13 @@ export default {
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout(() => {
console.log(3434)
console.log(3434);
let newvideopage = that.videopage
let newvideopage = that.videopage;
newvideopage++;
that.videopage = newvideopage;
console.log(that.videopage)
that.getvideolist()
console.log(that.videopage);
that.getvideolist();
// 加载状态结束
this.loading = false;
... ... @@ -179,13 +186,13 @@ export default {
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout(() => {
console.log(3434)
console.log(3434);
let newvideopage = that.videopage
let newvideopage = that.videopage;
newvideopage++;
that.videopage = newvideopage;
console.log(that.videopage)
that.getyingyang()
console.log(that.videopage);
that.getyingyang();
// 加载状态结束
this.loadingying = false;
... ... @@ -204,14 +211,13 @@ export default {
page: that.videopage
};
that.$axios
.post(url, param, Headers)
.then(res => {
console.log(res, "列表");
that.videolist = that.videolist.concat(res.data.lesson)
that.videolist = that.videolist.concat(res.data.lesson);
that.total_page = res.data.total_page;
that.this_page = res.data.this_page
that.this_page = res.data.this_page;
})
.catch(err => {
console.log(err);
... ... @@ -223,7 +229,7 @@ export default {
},
// 获取营养知识
getyingyang() {
console.log(9999)
console.log(9999);
let that = this;
var url = "/api/index/knowledge_list";
let param = {
... ... @@ -233,14 +239,13 @@ export default {
.post(url, param)
.then(res => {
console.log(res, "列表");
that.yinglist = that.yinglist.concat(res.data.knowledge)
that.yinglist = that.yinglist.concat(res.data.knowledge);
that.total_page = res.data.total_page;
that.this_page = res.data.this_page
that.this_page = res.data.this_page;
})
.catch(err => {
console.log(err);
// setTimeout(function () {
// that.$router.go(-1)
// })
... ... @@ -256,19 +261,19 @@ export default {
selectnav(e) {
let that = this;
this.selnav = e.currentTarget.dataset.id;
console.log(this.selnav)
console.log(this.selnav);
if (this.selnav == 0) {
that.total_page = ''
that.this_page = ''
that.videopage = 1
that.videolist = []
this.getvideolist()
that.total_page = "";
that.this_page = "";
that.videopage = 1;
that.videolist = [];
this.getvideolist();
} else if (this.selnav == 1) {
that.total_page = ''
that.this_page = ''
this.yinglist = []
that.videopage = 1
this.getyingyang()
that.total_page = "";
that.this_page = "";
this.yinglist = [];
that.videopage = 1;
this.getyingyang();
}
}
}
... ...
... ... @@ -3,30 +3,43 @@
<div class="topcontainer">
<div class="publishitem flextwo" @click="selectkind">
<div class="publeft flexone">
<div class="kindname">{{kindname}}</div>
<div class="pubpicker" v-if="false">
<van-picker
show-toolbar
:columns="columns"
@confirm="onConfirm"
@cancel="onCancel"
@change="onChange"
/>
<div class="kindname">
<span class="kindleft">分类</span>
{{kindname}}
</div>
</div>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
<div class="enterkind">
<textarea name id cols="30" rows="10" placeholder="请输入您的想法"></textarea>
<textarea name id cols="30" rows="10" placeholder="请输入您的想法" v-model="kindidea"></textarea>
</div>
<div class="pubimg">
<div>
<van-uploader
v-model="fileList"
multiple="true"
:after-read="afterRead"
:max-count="8"
@delete="deleftimg"
/>
<!-- <div class="pubimg">
<img src="../../../assets/addpub.png" alt />
</div>-->
</div>
</div>
<div class="kaishilu">发布</div>
<div class="kaishilu" @click="publish">发布</div>
<div class="pubpicker" v-if="showkind">
<van-picker
show-toolbar
:columns="columns"
@confirm="onConfirm"
@cancel="onCancel"
@setValues="getvalue"
/>
</div>
<!-- 发布成功 -->
<div class="register" v-if="success">
<div class="pubsuccess">
... ... @@ -39,18 +52,30 @@
<script>
import Vue from 'vue';
import { Picker } from 'vant';
import { Picker, Uploader, Toast } from 'vant';
import "vant/lib/index.css";
Vue.use(Picker);
Vue.use(Toast);
Vue.use(Uploader);
export default {
data() {
return {
columns: ['杭州', '宁波', '温州', '嘉兴', '湖州'],
columns: [],
showkind: false,
kindname: '分类一',
success: false
kindname: '请选择分类',
success: false,
kindidea: '',
fileList: [],
images: [],
chuanimage: [],
delimg: [],
sort: [],
sort_id: ''
}
},
created() {
this.getkindlist()
},
methods: {
selectkind() {
this.showkind = true
... ... @@ -63,26 +88,147 @@ export default {
onConfirm(value, index) {
console.log(78343784)
this.showkind = false
console.log(this.showkind)
this.kindname = value
this.sort_id = this.sort[index].id
},
onChange(picker, value, index) {
},
sure() {
this.success = false
},
// 上传图片
afterRead(file) {
let that = this;
console.log(file)
console.log(file.length)
if (file.length == undefined) {
var formdata = new FormData();
formdata.append("file", file.file);
that.delimg.push(file.file.name)
var url = "/api/common/upload";
let param = {
id: 1
}
that
.$uploadFile.post(url, formdata)
.then(function (res) {
console.log(res);
that.cardzheng = false
let url = "http://tangyuanji.t.brotop.cn" + res.data.url;
that.images.push(url);
that.chuanimage.push(res.data.url);
})
.catch(err => {
console.log(err);
});
} else {
for (var i = 0; i < file.length; i++) {
console.log(file[i].file)
var formdata = new FormData();
formdata.append("file", file[i].file);
that.delimg.push(file[i].file.name)
var url = "/api/common/upload";
that
.$uploadFile.post(url, formdata)
.then(function (res) {
console.log(res);
that.cardzheng = false
let url = "http://tangyuanji.t.brotop.cn" + res.data.url;
that.images.push(url);
that.chuanimage.push(res.data.url);
})
.catch(err => {
console.log(err);
});
}
}
},
// 删除文件
deleftimg(e) {
let that = this;
let item = e.file.name
this.delimg.forEach(function (value, index, array) {
if (value == item) {
that.delimg.splice(index, 1);
that.images.splice(index, 1);
that.chuanimage.splice(index, 1);
}
});
this.delimg = this.delimg
this.images = this.images;
this.chuanimage = this.chuanimage;
this.$forceUpdate();
},
// 获取分类列表
getkindlist() {
let that = this;
var url = "/api/social/sort";
let param = {
};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
let data = res.data;
data.forEach(function (value, index) {
that.columns.push(value.sort_name)
})
that.columns = that.columns
that.sort = res.data
})
.catch(function (err) {
console.log(err);
});
},
getvalue(value) {
console.log(value)
},
// 发布
publish() {
let that = this;
var url = "/api/user/authorize";
var url = "/api/social/send";
if (that.sort_id == '') {
Toast("请选择分类")
return false
}
if (that.kindidea == '') {
Toast("请输入您的想法")
return false
}
if (that.chuanimage.length != that.fileList.length) {
Toast("图片上传中")
return false
}
let param = {
redirect_uri: urlk
sort_id: that.sort_id,
description: that.kindidea,
images: that.chuanimage.join(",")
};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
Toast("发布成功")
that.$router.go(-1)
})
.catch(function (err) {
... ... @@ -103,4 +249,9 @@ export default {
padding-bottom: 0.32rem;
box-sizing: border-box;
}
.kindleft {
color: #323233;
font-size: 0.28rem;
margin-right: 0.32rem;
}
</style>
\ No newline at end of file
... ...
... ... @@ -4,56 +4,110 @@
<div
class="coursenavleft"
:class="selnav == index ? 'selactive' : ''"
@click="selectnav(item.id,index)"
@click="selectnav(item.id, index)"
v-for="(item, index) in navarr"
:key="index"
>{{ item.sort_name }}</div>
>
{{ item.sort_name }}
</div>
</div>
<div class="societybox">
<div class="nodata" v-if="sortlist.length==0">暂无数据</div>
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" v-else>
<div class="societyitem" v-for="item in sortlist" :key="item.id">
<div class="nodata" v-if="sortlist.length == 0">暂无数据</div>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
v-else
>
<div class="societyitem" v-for="(item, index) in sortlist" :key="index">
<div class="societytop flextwo">
<div class="societyleft flexone">
<div class="personimg">
<img :src="item.user.avatar" alt />
</div>
<div class="personright">
<div class="personname">{{item.user.nickname}}</div>
<div class="persondate">{{item.createtime}}</div>
<div class="personname">{{ item.user.nickname }}</div>
<div class="persondate">{{ item.createtime }}</div>
</div>
</div>
<div class="dingimg" v-if="item.is_top==1">
<div class="dingimg" v-if="item.is_top == 1">
<img src="../../../assets/ding.png" alt />
</div>
</div>
<div class="societytext">{{item.description}}</div>
<div class="societyimg flexone" v-if="item.images_arr.length!=0">
<div class="societyimgitem" v-for="item in item.images_arr" :key="item">
<img src="../../../assets/societyimg.png" alt />
<div class="societytext">{{ item.description }}</div>
<div class="societyimg flexone" v-if="item.images_arr.length != 0">
<div
class="societyimgitem"
v-for="(item, indexk) in item.images_arr"
:key="indexk"
@click="previewimg(index, indexk)"
>
<img :src="item" alt />
</div>
</div>
<div class="jianzhengtui flexone">
<div
class="jianzheng flexone"
v-for="(item, index) in item.tags"
:key="index"
>
<div class="jianzhengleft" :style="{ background: item.color }">
#
</div>
<div class="jianzhengright" :style="{ color: item.color }">
{{ item.name }}
</div>
</div>
<div class="jianzheng flexone">
<div class="jianzhengleft">#</div>
<div class="jianzhengright">见证蜕变</div>
</div>
<!-- 点赞 -->
<div class="dainzan flexone">
<div class="flexone dianitem">
<img src="../../../assets/zan.png" alt class="dianzanimg" />
<span class="number">960</span>
<div class="flexone dianitem" @click="zanclick(index, item)">
<img
src="../../../assets/diankong.png"
alt
class="dianzanimg"
v-if="item.is_good == 0"
/>
<img
src="../../../assets/zan.png"
alt
class="dianzanimg"
v-else
/>
<span class="number">{{ item.good_count }}</span>
</div>
<div class="flexone dianitem">
<img src="../../../assets/star.png" alt class="dianzanimg" />
<span class="number">960</span>
<div class="flexone dianitem" @click="collect(index, item)">
<img
src="../../../assets/starkong.png"
alt
class="dianzanimg"
v-if="item.is_favorite == 0"
/>
<img
src="../../../assets/star.png"
alt
class="dianzanimg"
v-else
/>
<span class="number">{{ item.favorite_count }}</span>
</div>
<div class="flexone dianitem">
<div class="flexone dianitem" @click="copytext">
<img src="../../../assets/edit.png" alt class="dianzanimg" />
<span class="number">960</span>
<!-- <span class="number">复制文本</span> -->
<span
class="number"
v-clipboard:copy="item.description"
v-clipboard:success="onCopy"
>复制</span
>
<!-- v-clipboard:error="onError" -->
</div>
<div class="flexone dianitem">
<div class="flexone dianitem" @click="save(item)">
<img src="../../../assets/download.png" alt class="dianzanimg" />
<span class="number">960</span>
<span class="number">一键保存</span>
</div>
</div>
</div>
... ... @@ -61,11 +115,19 @@
</div>
<!-- 图片没有上传 -->
<div class="gantanimg" v-if="nophoto">
<div class="gantanimg" v-if="nophoto" @click="nophotoup">
<img src="../../../assets/gantan.png" class="ganimg" alt />
<div class="gantantext">用户未上传图片</div>
</div>
<!-- 预览图片 -->
<van-image-preview
v-model="show"
:images="images"
@change="onChange"
:startPosition="startPosition"
>
<template v-slot:index>第{{ index + 1 }}页</template>
</van-image-preview>
<!-- 添加 -->
<div class="addimg" @click="publish">
<img src="../../../assets/add.png" alt />
... ... @@ -76,10 +138,12 @@
<script>
import tabBar from "@/components/views/tabBar.vue";
import Vue from 'vue';
import { List } from 'vant';
import Vue from "vue";
import { List, Toast, ImagePreview } from "vant";
Vue.use(ImagePreview);
Vue.use(List);
export default {
components: {
tabBar
... ... @@ -88,22 +152,57 @@ export default {
return {
selnav: 0,
navarr: [],
sort_id: '',
sort_id: "",
nophoto: false,
sortlist: [],
loading: false,
finished: false,
page: 1,
this_page: '',
total_page: ''
this_page: "",
total_page: "",
show: false,
index: 0,
images: [],
startPosition: 0
};
},
created() {
this.getsort()
this.getsort();
},
methods: {
save(item) {
this.images = item.images_arr;
if (this.images.length == 0) {
this.nophoto = true;
} else {
this.index = 0;
this.show = true;
}
},
previewimg(index, indexk) {
console.log(index, indexk);
this.index = indexk;
this.images = this.sortlist[index].images_arr;
this.show = true;
this.startPosition = indexk;
},
nophotoup() {
this.nophoto = false;
},
// 图片预览
onChange(index) {
this.index = index;
},
onCopy(e) {
Toast("复制成功");
},
onLoad() {
let that = this;
console.log(888);
// if (that.page = 1) {
// that.loading = false
// that.finished = false
// }
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout(() => {
... ... @@ -113,7 +212,7 @@ export default {
let newpage = that.page;
newpage++;
that.page = newpage;
that.getsocidtylist()
that.getsocidtylist();
// 加载状态结束
that.loading = false;
// 数据全部加载完成
... ... @@ -122,19 +221,89 @@ export default {
}
}, 1000);
},
// 收藏
collect(index, item) {
let that = this;
var url = "/api/user/favorite";
let param = {
type: 3,
favorite_id: item.id
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
if (item.is_favorite == 0) {
item.is_favorite = 1;
that.sortlist[index].is_favorite = 1;
that.sortlist[index].favorite_count =
that.sortlist[index].favorite_count + 1;
Toast("收藏成功");
} else if (item.is_favorite == 1) {
item.is_favorite = 1;
Toast("取消收藏成功");
that.sortlist[index].is_favorite = 0;
that.sortlist[index].favorite_count =
that.sortlist[index].favorite_count - 1;
}
that.sortlist = that.sortlist;
that.$forceUpdate();
})
.catch(function(err) {
console.log(err);
});
},
zanclick(index, item) {
let that = this;
console.log(item.id);
var url = "/api/user/good";
let param = {
type: 1,
good_id: item.id
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
if (item.is_good == 0) {
item.is_good = 1;
that.sortlist[index].is_good = 1;
that.sortlist[index].good_count =
that.sortlist[index].good_count + 1;
Toast("点赞成功");
} else if (item.is_good == 1) {
item.is_good = 1;
Toast("取消点赞成功");
that.sortlist[index].is_good = 0;
that.sortlist[index].good_count =
that.sortlist[index].good_count - 1;
}
that.sortlist = that.sortlist;
that.$forceUpdate();
})
.catch(function(err) {
console.log(err);
});
},
// 复制文本
copytext() {},
selectnav(id, index) {
let that = this;
this.selnav = index;
this.sort_id = id
this.sort_id = id;
that.page = 1;
that.sortlist = [];
that.getsocidtylist()
that.getsocidtylist();
},
publish() {
this.$router.push({
path: "/publish",
path: "/publish"
// query: { testId: item.test_student_id }
});
},
... ... @@ -142,19 +311,17 @@ export default {
getsort() {
let that = this;
var url = "/api/social/sort";
let param = {
};
let param = {};
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.navarr = res.data
that.sort_id = res.data[0].id
that.navarr = res.data;
that.sort_id = res.data[0].id;
that.getsocidtylist();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -169,14 +336,13 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.sortlist = that.sortlist.concat(res.data.social)
that.sortlist = that.sortlist.concat(res.data.social);
that.this_page = res.data.this_page;
that.total_page = res.data.total_page
that.total_page = res.data.total_page;
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
}
... ...
... ... @@ -14,11 +14,17 @@ import axios from "./utils/common.js";
if (sessionStorage.getItem("token")) {
axios.defaults.headers.common["token"] = sessionStorage.getItem("token");
}
import uploadFile from "./utils/common.js";
Vue.prototype.$uploadFile = uploadFile;
Vue.prototype.$axios = axios;
sessionStorage.setItem("token", "89cf0730-59e2-4627-baa3-a4451454794b");
import VueClipboard from "vue-clipboard2";
Vue.use(VueClipboard);
// router.beforeEach((to, from, next) => {
// const token = sessionStorage.getItem("token");
// console.log("我是token", token);
... ...
... ... @@ -55,6 +55,10 @@
border-radius: 50%;
}
.personimg img {
border-radius: 50%;
}
.personname {
color: #02170b;
font-size: 0.28rem;
... ... @@ -105,6 +109,11 @@
font-size: 0.16rem;
line-height: 0.44rem;
margin-top: 0.32rem;
margin-right: 0.2rem;
}
.jianzhengtui {
flex-wrap: wrap;
}
.jianzhengleft {
... ... @@ -139,7 +148,7 @@
}
.dianitem {
margin-right: 0.58rem;
margin-right: 0.38rem;
}
.dainzan {
... ... @@ -184,7 +193,7 @@
/* 发布 */
.publishitem {
padding: 0.26rem;
padding: 0.26rem 0;
box-sizing: border-box;
border-bottom: 1px solid #eee;
}
... ... @@ -205,13 +214,13 @@
.kindname {
color: #999999;
font-size: 0.28rem;
margin-left: 0.32rem;
/* margin-left: 0.32rem; */
}
.enterkind {
width: 100%;
height: 5rem;
padding: 0.18rem 0.32rem;
padding: 0.18rem 0;
color: #999999;
font-size: 0.28rem;
box-sizing: border-box;
... ...
... ... @@ -24,3 +24,22 @@ Axios.interceptors.response.use(
);
export default Axios;
export function uploadFile(Url, data) {
//上传图片的方法
return new Promise((resolve, reject) => {
let instance = axios.create({
baseURL: "http://tangyuanji.t.brotop.cn/api/",
headers: {
"Content-Type": "multipart/form-data"
}
});
instance
.post(Url, data)
.then(res => {
resolve(res.data.data);
})
.catch(error => {
reject(error.data);
});
});
}
\ No newline at end of file
... ...