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

修改弹窗

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