Commit 53f39874 authored by 罗林杰's avatar 罗林杰

修改弹窗

parent d4db6596
......@@ -22,6 +22,7 @@
</view>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isPayConfirm" @confirm="payConfirm"></ELM>
</view>
</template>
......@@ -41,6 +42,7 @@
fileList: [],
tipMsg: '',
isConfirm: false,
isPayConfirm: false,
h: 0,
focus: false,
isLoginPop: false,
......@@ -94,41 +96,9 @@
},1000)
} else if (res.data.code === 1002){
//留言超出限制 是否采用金币进行留言
uni.showModal({
title: '提示',
content: '已超出免费发动态次数,是否花费'+ this.payCount +'金币再进行发布',
success: (res) => {
if (res.confirm) {
const form = {
content:this.content,
pictureId: JSON.stringify(this.uploadImgJSON),
topicId:this.topicId,
wxOpenid: uni.getStorageSync('userInfo').wxOpenid,
isPay: '1'
}
publishArticle(form).then(res=>{
if (res.data.code == 200){
uni.showToast({
title: '发表成功',
icon: 'success'
})
uni.setStorageSync("isRefresh", true)
setTimeout(() => {
uni.switchTab({
url: '/pages/tab/article',
});
},1000)
} else if (res.data.code === 1003) {
this.isConfirm = true;
this.tipMsg = res.data.message;
this.$refs.elm.showDialog();
}
})
} else if (res.cancel) {
}
}
});
this.isPayConfirm = true;
this.tipMsg = "已超出免费发动态次数,是否花费"+ this.payCount +"金币再进行发布";
this.$refs.elm.showDialog();
} else{
uni.showToast({
title: res.data.message,
......@@ -195,6 +165,33 @@
});
})
},
payConfirm(){
const form = {
content:this.content,
pictureId: JSON.stringify(this.uploadImgJSON),
topicId:this.topicId,
wxOpenid: uni.getStorageSync('userInfo').wxOpenid,
isPay: '1'
}
publishArticle(form).then(res=>{
if (res.data.code == 200){
uni.showToast({
title: '发表成功',
icon: 'success'
})
uni.setStorageSync("isRefresh", true)
setTimeout(() => {
uni.switchTab({
url: '/pages/tab/article',
});
},1000)
} else if (res.data.code === 1003) {
this.isConfirm = true;
this.tipMsg = res.data.message;
this.$refs.elm.showDialog();
}
})
},
confirm() {
this.isConfirm = false;
uni.navigateTo({
......
......@@ -9,6 +9,7 @@
</view>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
<ELM ref="elmMessage" :msg="tipMsg" :isConfirm="isMessageConfirm" @confirm="messageConfirm"></ELM>
<ELM ref="elmMessage" :msg="tipMsg" :isConfirm="isPayConfirm" @confirm="payConfirm"></ELM>
</view>
</template>
<script>
......@@ -25,6 +26,7 @@
tipMsg: '',
isConfirm: false,
isMessageConfirm: false,
isPayConfirm: false,
//金币支付金额
payCount: 0
}
......@@ -66,33 +68,8 @@
this.$refs.elm.showDialog();
} else if (res.data.code === 1001){
//留言超出限制 是否采用金币进行留言
uni.showModal({
title: '提示',
content: '已超出留言次数,是否花费'+ this.payCount +'金币再进行留言',
success: (res) => {
if (res.confirm) {
const form = {
targetId: this.userId,//目标id
content: this.message,//输入的内容
isPay:'1',//1花费 0不花费
wxOpenid: userInfo.wxOpenid
}
addMessage(form).then(res=>{
if (res.data.code == 200){
this.isConfirm = true;
this.tipMsg = "发送成功";
this.$refs.elm.showDialog();
}else {
this.isMessageConfirm = true;
this.tipMsg = res.data.message;
this.$refs.elm.showDialog();
}
})
} else if (res.cancel) {
}
}
});
this.isPayConfirm = true;
this.tipMsg = "已超出留言次数,是否花费"+ this.payCount +"金币再进行留言";
this.inputTemp = ''
} else if(res.data.code === 1002){
uni.showToast({
......@@ -117,6 +94,26 @@
delta: 1
})
},
payConfirm(){
const userInfo = uni.getStorageSync('userInfo')
const form = {
targetId: this.userId,//目标id
content: this.message,//输入的内容
isPay:'1',//1花费 0不花费
wxOpenid: userInfo.wxOpenid
}
addMessage(form).then(res=>{
if (res.data.code == 200){
this.isConfirm = true;
this.tipMsg = "发送成功";
this.$refs.elm.showDialog();
}else {
this.isMessageConfirm = true;
this.tipMsg = res.data.message;
this.$refs.elm.showDialog();
}
})
},
messageConfirm(){
this.isMessageConfirm = false;
uni.navigateTo({
......
......@@ -202,6 +202,7 @@
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
<ELM ref="elmCoin" :msg="tipMsg" :isConfirm="isCoinConfirm" @confirm="coinConfirm"></ELM>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isLikeConfirm" @confirm="likeConfirm"></ELM>
</view>
</template>
......@@ -251,6 +252,7 @@
tipMsg: '',
isConfirm: false,
isCoinConfirm: false,
isLikeConfirm: false,
scrollTop: 0,
data: [],
};
......@@ -448,32 +450,9 @@
}, 500)
} else if(res.data.code == 1001){
//当天对该用户的次数已用完 选择付费点赞
uni.showModal({
title: '提示',
content: '今日已超出对该用户的点赞次数,是否花费'+ this.payCount +'金币再进行点赞',
success: (res) => {
if (res.confirm) {
const form = {
targetId: this.userData.userId,//目标id
wxOpenid: uni.getStorageSync('userInfo').wxOpenid,
isPay:'1',//1花费 0不花费
}
likeUser(form).then(res=>{
if (res.data.code == 200) {
this.animUrl = url;
this.showAnima = true;
setTimeout(() => {
this.showAnima = false;
}, 500)
} else {
this.tipMsg = res.data.message;
this.isCoinConfirm = true;
this.$refs.elm.showDialog();
}
})
}
}
});
this.isLikeConfirm = true;
this.tipMsg = '今日已超出对该用户的点赞次数,是否花费'+ this.payCount +'金币再进行点赞';
this.$refs.elm.showDialog();
} else {
uni.showToast({
title: res.data.message,
......@@ -504,6 +483,26 @@
url: "/pagesme/goldCoin/recharge"
})
},
likeConfirm(){
const form = {
targetId: this.userData.userId,//目标id
wxOpenid: uni.getStorageSync('userInfo').wxOpenid,
isPay:'1',//1花费 0不花费
}
likeUser(form).then(res=>{
if (res.data.code == 200) {
this.animUrl = url;
this.showAnima = true;
setTimeout(() => {
this.showAnima = false;
}, 500)
} else {
this.tipMsg = res.data.message;
this.isCoinConfirm = true;
this.$refs.elm.showDialog();
}
})
},
//返回按钮
backbar() {
uni.navigateBack({
......
......@@ -34,6 +34,7 @@
</view>
</view>
</z-paging>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
</view>
</template>
......@@ -42,8 +43,12 @@ import {deleteFollow, likeList} from "../../api/user";
import {getOssUrl} from "../../api/article";
import {getCity, getValue} from "../../common/options";
import {calculateAge, parseDate} from "../../common";
import ELM from '@/components/elm-toast/index.vue';
export default {
components: {
ELM
},
data() {
return {
//分页插件存储数据的变量
......@@ -62,6 +67,9 @@ export default {
num:'',
//查询类型 1:我喜欢的 2:喜欢我的 3:互相喜欢的
queryType:'',
tipMsg: '',
isConfirm: false,
deleteId:''
};
},
onLoad(options) {
......@@ -140,25 +148,10 @@ export default {
//取消关注
deleteLike(id){
//是否确认
uni.showModal({
title: '提示',
content: '是否取消关注',
success: (res) => {
if (res.confirm) {
const form = {
userId: uni.getStorageSync('userInfo').businessId,
targetId: id,
}
deleteFollow(form).then(res => {
if (res.data.code == 200){
this.$u.toast('取消关注成功')
this.$refs.paging.reload();
}
})
} else if (res.cancel) {
}
}
});
this.isConfirm = true;
this.tipMsg = '是否取消关注';
this.$refs.elm.showDialog();
this.deleteId = id
},
//跳转用户详情
gotoDetail(item){
......@@ -166,6 +159,18 @@ export default {
url: '/pagesUser/userInfo?memberId='+item.businessId
})
},
confirm() {
const form = {
userId: uni.getStorageSync('userInfo').businessId,
targetId: this.deleteId,
}
deleteFollow(form).then(res => {
if (res.data.code == 200){
this.$u.toast('取消关注成功')
this.$refs.paging.reload();
}
})
},
//返回按钮
backbar() {
uni.navigateBack({
......
......@@ -34,12 +34,14 @@
</u-swipe-action>
</view>
</z-paging>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
</view>
</template>
<script>
import {deleteTalk, messageList} from "../../api/user";
import {getOssUrl} from "../../api/article";
import ELM from '@/components/elm-toast/index.vue';
export default {
data() {
......@@ -67,8 +69,14 @@ export default {
navHeight:'',
share: false,
menuButtonInfo: '',
tipMsg: '',
isConfirm: false,
deleteId: ''
};
},
components: {
ELM
},
onShow() {
//获取当前页面的页头高度
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
......@@ -125,23 +133,22 @@ export default {
})
},
handleDelete(id){
uni.showModal({
title: '提示',
content: '确定移除吗?',
success: (res) => {
if (res.confirm) {
deleteTalk(id).then(res => {
if (res.data.code == 200) {
uni.showToast({
title: '移除成功',
icon: 'none'
});
this.$refs.paging.reload();
}
})
}
this.isConfirm = true
this.tipMsg = '确定移除吗?'
this.$refs.elm.showDialog();
this.deleteId = id
},
confirm() {
deleteTalk(this.deleteId).then(res => {
if (res.data.code == 200) {
uni.showToast({
title: '移除成功',
icon: 'none'
});
this.$refs.paging.reload();
}
})
this.isConfirm = false
},
backbar() {
uni.navigateBack({
......
......@@ -27,12 +27,14 @@
</u-swipe-action-item>
</u-swipe-action>
</z-paging>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
</view>
</template>
<script>
import {addBlack, deleteBlack, getBlackList} from "../../api/user";
import {getOssUrl} from "../../api/article";
import ELM from '@/components/elm-toast/index.vue';
export default {
data() {
......@@ -49,8 +51,14 @@ export default {
dataList: [],
//图片路径
baseUrl: this.$IMG_URL,
tipMsg: '',
isConfirm: false,
item: {}
};
},
components: {
ELM
},
onshow() {
},
......@@ -76,29 +84,28 @@ export default {
});
},
handleDelete(item){
uni.showModal({
title: '提示',
content: '确定移除吗?',
success: (res) => {
if (res.confirm) {
const params = {
businessId: item.businessId,
userId: item.userId,
targetId: item.targetId
}
deleteBlack(params).then(res => {
if (res.data.code == 200) {
uni.showToast({
title: '移除成功',
icon: 'none'
});
this.getBlackList(1,10);
}
})
}
this.isConfirm = true;
this.tipMsg = '确定移除吗?';
this.$refs.elm.showDialog();
this.item = item;
},
confirm() {
const params = {
businessId: this.item.businessId,
userId: this.item.userId,
targetId: this.item.targetId
}
deleteBlack(params).then(res => {
if (res.data.code == 200) {
uni.showToast({
title: '移除成功',
icon: 'none'
});
this.getBlackList(1,10);
}
})
}
this.isConfirm = false
},
}
};
</script>
......
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