Commit 7db0d8c6 authored by liwei's avatar liwei

修改了bug

parent 3918d90d
......@@ -20,7 +20,7 @@ export function activityDetail(id) {
//报名
export function addApplication(data) {
return request({
url:'/cmsApplication/add',
url:'/app/order/add',
method: 'POST',
data
})
......
......@@ -33,9 +33,6 @@
</text>
</view>
</template>
<!-- <view v-else style="height: 100rpx;">-->
<!-- </view>-->
<view class="content">
<template v-if="info.content">
<u-read-more ref="uReadMore" :toggle="true" color="#415C9E"
......
......@@ -79,6 +79,7 @@
import {bannerList} from '../../api/banner/index'
import {userList} from '../../api/user/index'
import {getCity} from "../../common/options";
import {getOssUrl} from "../../api/article";
export default {
components: {
LsSwiper
......@@ -117,11 +118,20 @@
}
userList(query).then(res =>{
// 假设 res.data.data 是从服务器接收到的数据
this.userList = res.data.data.map(item => ({
...item, // 复制对象中的所有属性
avatarUrl: item.avatarUrl != null ? item.avatarUrl.replace(/\\/g, '/') : '', // 替换 avatarUrl 中的所有 \ 为 /
city: getCity(item.memResidenceProvince,item.memResidenceCity)
}));
res.data.data.forEach(item => {
//处理头像
if (item.avatar != null){
getOssUrl(item.avatar).then(res=>{
item.avatarUrl = res.data.data
})
}
//处理城市
if (item.memResidenceProvince != null && item.memResidenceProvince != '' && item.memResidenceCity != null && item.memResidenceCity != ''){
item.city = getCity(item.memResidenceProvince,item.memResidenceCity)
console.log(item.city)
}
});
this.userList = res.data.data
}).catch(e => {
console.log(e)
})
......
......@@ -102,13 +102,12 @@
},
// 提交订单
submitorder() {
const applyParams = {
activityId: this.activityDetail.businessId,
status:'1',
applicationFee:this.totalprice,
const params = {
goodsId: this.activityDetail.businessId,
num:'1',
}
// 添加订单(报名)
addApplication(applyParams).then(res => {
addApplication(params).then(res => {
if (res.data.code === 200) {
this.show = false
uni.showToast({
......@@ -116,9 +115,8 @@
icon: 'success'
})
} else if(res.data.code !== 200){
console.log("到这")
uni.showToast({
title: res.message,
title: res.data.message,
icon: 'none'
})
}
......@@ -126,8 +124,8 @@
},
// 计算总价
countprice() {
const price1 = this.activityDetail.applicationFee * this.buynum
this.totalprice = price1
const price = this.activityDetail.applicationFee * this.buynum
this.totalprice = price
},
// 关闭报名弹窗
close() {
......
......@@ -154,37 +154,37 @@
</view>
<view class="bottom">
<u--input
placeholder="走心,说点好听的"
placeholder="走心,说点好听的....."
border="surround"
v-model="commentValue"
@confirm="handleEnter"
customStyle="border-radius:36rpx;height:45rpx;background-color:rgb(249, 250, 251);width:60%"
customStyle="border-radius:36rpx;height:45rpx;background-color:rgb(249, 250, 251);width:100%"
></u--input>
<view class="bottom-button-area">
<view class="bottom-button">
<image
@click=""
:src="baseUrl+'/article/103.png'"
/>
<text class="imageText">分享</text>
</view>
<view class="bottom-button">
<image
@click=""
:src="baseUrl+'/article/104.png'"
></image>
<text class="imageText">{{ articleInfo.commentCount }}</text>
</view>
<view class="bottom-button">
<image
@click=""
:src="articleInfo.isLike == '0'
? baseUrl+'/article/105.png'
: baseUrl+'/article/105-no.png'"
></image>
<text class="imageText">{{ articleInfo.likeCount }}</text>
</view>
</view>
<!-- <view class="bottom-button-area">-->
<!-- <view class="bottom-button">-->
<!-- <image-->
<!-- @click=""-->
<!-- :src="baseUrl+'/article/103.png'"-->
<!-- />-->
<!-- <text class="imageText">分享</text>-->
<!-- </view>-->
<!-- <view class="bottom-button">-->
<!-- <image-->
<!-- @click=""-->
<!-- :src="baseUrl+'/article/104.png'"-->
<!-- ></image>-->
<!-- <text class="imageText">{{ articleInfo.commentCount }}</text>-->
<!-- </view>-->
<!-- <view class="bottom-button">-->
<!-- <image-->
<!-- @click=""-->
<!-- :src="articleInfo.isLike == '0'-->
<!-- ? baseUrl+'/article/105.png'-->
<!-- : baseUrl+'/article/105-no.png'"-->
<!-- ></image>-->
<!-- <text class="imageText">{{ articleInfo.likeCount }}</text>-->
<!-- </view>-->
<!-- </view>-->
</view>
</view>
</template>
......@@ -217,6 +217,14 @@ export default{
methods: {
//评论回车事件
handleEnter(value){
const token = uni.getStorageSync("token")
if (token == null || token == ''){
uni.showToast({
title: '请先登录',
icon: 'none'
})
return;
}
if (this.commentValue === ''){
uni.showToast({
title: '评论内容不能为空',
......@@ -231,6 +239,8 @@ export default{
}
comment(params).then(res=>{
if (res.data.code == 200){
//方便回到动态页的时候刷新数据
uni.setStorageSync("isRefresh", true)
this.getArticleDetail()
}
}).catch(err=>{
......@@ -386,10 +396,10 @@ export default{
height: 24rpx
}
.bottom-button-area{
width: 40%;
width: 30%;
padding: 0rpx 20rpx;
display: flex;
justify-content: space-between;
justify-content: space-around;
align-items: center;
.bottom-button{
display: flex;
......
......@@ -19,18 +19,13 @@
</view>
</view>
</view>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
</view>
</view>
</template>
<script>
import ELM from '@/components/elm-toast/index.vue';
import {getOssUrl, publishArticle, uploadPublic} from '../api/article/index'
import {publishArticle} from '../api/article/index'
export default {
components: {
ELM
},
data() {
return {
uploadImgJSON:{
......@@ -55,8 +50,10 @@
//发布
submit() {
if (!this.content && !this.fileList.length) {
this.tipMsg = '请输入内容或上传图片后再点击发布'
this.$refs.elm.showDialog();
uni.showToast({
title: '请输入内容或上传图片后再点击发布',
icon: 'none'
})
return;
}
const params = {
......@@ -93,12 +90,6 @@
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//获取oss图片url
getOssUrl() {
// getOssUrl(id).then(res => {
// this.img = res.data.data.url
// })
},
// 新增图片
afterRead(event) {
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
......
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