Commit 3e53f13e authored by liwei's avatar liwei

修改了留言限制

parent 8f5ba615
......@@ -2,10 +2,10 @@
<view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头 -->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" title="个人留言"></u-navbar>
<view class="fixed-buttons">
<view class="fixed-buttons" :style="{'top':navHeight+'px','position': 'relative'}">
<view class="button-item" @click="addBlack">拉黑</view>
<view class="vertical-line" style="width: 1px; height: 50rpx; background-color: #808080;"></view>
<view class="button-item">关注</view>
<view class="button-item">要微信</view>
</view>
<view style="height: 80rpx;"></view>
<z-paging ref="paging" empty-view-text=" "
......@@ -56,7 +56,7 @@
</template>
<script>
import {addBlack, addMessage, telMessage} from "../../api/user";
import {addBlack, addMessage, deleteFollow, telMessage} from "../../api/user";
import {getOssUrl} from "../../api/article";
export default {
......@@ -68,12 +68,32 @@ export default {
chatList: [],
inputTemp: '',
targetId: '',
menuButtonInfo:'',
navHeight:0,
}
},
onLoad(options) {
this.targetId = options.targetId
//导航栏高度
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
const {
top,
width,
height,
right
} = this.menuButtonInfo
uni.getSystemInfo({
success: (res) => {
const {
statusBarHeight
} = res;
const margin = top - statusBarHeight
this.navHeight = (height + statusBarHeight + (margin * 2)) //导航栏总高
}
})
},
onShow(){
this.userInfo = uni.getStorageSync('userInfo')
// 滚动到页面底部
this.$nextTick(() => {
this.pageScrollToBottom()
......@@ -141,19 +161,45 @@ export default {
return
}
const data = {
targetId: this.targetId,
content: inputValue
targetId: this.targetId,//目标id
content: inputValue,//输入的内容
isPay:'0',//1花费 0不花费,
wxOpenid: this.userInfo.wxOpenid
}
addMessage(data).then(res => {
if (res.data.code == 200){
this.getMessageList()
this.inputTemp = ''
} else {
} else if (res.data.code === 1001){
//留言超出限制 是否采用金币进行留言
uni.showModal({
title: '提示',
content: '已超出留言次数,是否花费1金币再进行留言',
success: (res) => {
if (res.confirm) {
const form = {
targetId: this.targetId,//目标id
content: inputValue,//输入的内容
isPay:'1',//1花费 0不花费
wxOpenid: this.userInfo.wxOpenid
}
addMessage(form).then(res=>{
if (res.data.code == 200){
this.getMessageList()
this.inputTemp = ''
}
})
} else if (res.cancel) {
}
}
});
this.inputTemp = ''
} else if(res.data.code === 1002){
uni.showToast({
title: res.data.message,
icon: 'none'
})
this.inputTemp = ''
}
})
// 滚动到页面底部
......@@ -346,8 +392,6 @@ export default {
.fixed-buttons{
display: flex;
justify-content: space-evenly;
position: fixed;
top: 120rpx;
width: 100%;
z-index: 99;
}
......
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