Commit b605e0d4 authored by liwei's avatar liwei

查看他们动态,未关注的只能查看5条,已关注的查看一个月的,数据字典控制,修改了接口

parent ca66d3bb
......@@ -10,6 +10,15 @@ export function articleList(query) {
})
}
// 动态列表
export function userArticleList(query) {
return request({
url: '/app/open/opmArticle/queryUserArticleByPagination',
data: query,
method: 'GET',
})
}
// 发表动态
export function publishArticle(data) {
return request({
......
......@@ -27,7 +27,7 @@
import ItemVue from './component/Item.vue';
import empty from '@/components/empty.vue';
import {topicList} from "../api/topic";
import {articleList, like} from "../api/article";
import {articleList, like, userArticleList} from "../api/article";
import {getCity, getValue} from "../common/options";
import {calculateAge, parseDate} from "../common";
export default {
......@@ -50,6 +50,8 @@ export default {
baseUrl: this.$IMG_URL,
// v-model绑定的这个变量不要在分页请求结束中自己赋值!!!
dataList: [],
//是否已关注 1关注 0未关注
isFollowed:'',
menuButtonInfo:'',
navHeight:'',
type:'',
......@@ -65,6 +67,9 @@ export default {
onLoad(options){
this.userId = options.userId
this.type = options.type
if (options.isFollowed !== undefined && options.isFollowed !== ''){
this.isFollowed = options.isFollowed
}
if (this.type === 'else'){
this.title = '他的动态'
} else if(this.type === 'my'){
......@@ -106,13 +111,13 @@ export default {
},
//分页查询方法
queryList(pageNo, pageSize) {
// const userId = uni.getStorageSync('userInfo').businessId
const params = {
page:pageNo,
rows:pageSize,
userId: this.userId
userId: this.userId,
isFollowed: this.isFollowed
}
articleList(params).then( res =>{
userArticleList(params).then( res =>{
const list = res.data.data
list.forEach(item => {
//处理头像
......
......@@ -238,7 +238,7 @@ import {addFollow, deleteFollow, isFollow, likeUser, userDetail} from "../api/us
baseUrl: this.$IMG_URL,
//用户头像
imgList:[],
isFollowed: 0,
isFollowed: '0',
//用户信息
userData: {},
isShow: false,
......@@ -340,7 +340,7 @@ import {addFollow, deleteFollow, isFollow, likeUser, userDetail} from "../api/us
//查看更多动态
gotomore(){
uni.navigateTo({
url: '/pagesUser/userArticleList?userId='+this.userId +'&type=else'
url: '/pagesUser/userArticleList?userId='+this.userId +'&type=else'+'&isFollowed='+this.isFollowed
});
},
//获取用户详情
......
<template>
<view>
<view class="money">
<text>余额:</text>
<text>{{parseFloat(balance).toFixed(2)}}</text>
<view class="firstView">
<text class="firstText" @click="consumeRecord">消费记录</text>
</view>
<view class="secondView">
<text class="secondText">余额:</text>
<text>{{parseFloat(balance).toFixed(2)}}</text>
</view>
</view>
<view class="recharge">
<view>充值</view>
<view class="list">
<view v-for="(item, index) in 6" :key="index" :class="{active: activeIndex===index}"
@click="clickItem(index, item)">
<view>{{index+1}}00</view>
<view>{{index+1}}00</view>
<view v-for="(item, index) in goldCoinList" :key="index" :class="{active: activeIndex===index}"
@click="clickItem(index,item)">
<view>{{ item.coin }}</view>
<view>{{item.price}}</view>
</view>
</view>
</view>
......@@ -33,7 +38,17 @@ let iapChannel = null // 苹果内部支付渠道
export default {
data() {
return {
activeIndex: 0,
//金币价格列表
goldCoinList: [
{ coin: 100, price: 100 },
{ coin: 200, price: 200 },
{ coin: 300, price: 300 },
{ coin: 400, price: 400 },
{ coin: 500, price: 500 },
{ coin: 600, price: 600 }
],
activeIndex: 0,//激活的索引
payMoney:0,//支付金额
loading: false, // 是否充值中
balance: 0, // 余额
moneyList: [], // 充值列表展示金额
......@@ -69,60 +84,63 @@ export default {
// });
},
methods: {
requestOrder() {
uni.showLoading({
title: '检测支付环境...'
})
//必须调用此方法向Appstore请求有效的商品详情,才能进行 iap 支付,
iapChannel.requestOrder(this.moneyList, (orderList) => {
console.log('requestOrder success666: ' + JSON.stringify(orderList));
uni.hideLoading();
}, (e) => {
console.log('requestOrder failed: ' + JSON.stringify(e));
uni.hideLoading();
this.errorMsg()
});
},
iosPayHandler() {
this.loading = true;
uni.requestPayment({
provider: 'appleiap',
orderInfo: {
productid: this.applePrice // 商品id
},
success: (e) => {
console.log("success", e);
uni.showToast({
title: "支付成功!"
})
// 调用接口,立即扣款购买商品
},
fail: (e) => {
console.log("fail", e);
uni.showModal({
content: "支付失败,原因为: " + e.errMsg,
showCancel: false
})
},
complete: () => {
this.loading = false;
}
})
},
errorMsg() {
uni.showModal({
content: "暂不支持苹果 iap 支付",
showCancel: false
})
},
// requestOrder() {
// uni.showLoading({
// title: '检测支付环境...'
// })
// //必须调用此方法向Appstore请求有效的商品详情,才能进行 iap 支付,
// iapChannel.requestOrder(this.moneyList, (orderList) => {
// console.log('requestOrder success666: ' + JSON.stringify(orderList));
// uni.hideLoading();
// }, (e) => {
// console.log('requestOrder failed: ' + JSON.stringify(e));
// uni.hideLoading();
// this.errorMsg()
// });
// },
// iosPayHandler() {
// this.loading = true;
// uni.requestPayment({
// provider: 'appleiap',
// orderInfo: {
// productid: this.applePrice // 商品id
// },
// success: (e) => {
// console.log("success", e);
// uni.showToast({
// title: "支付成功!"
// })
// // 调用接口,立即扣款购买商品
// },
// fail: (e) => {
// console.log("fail", e);
// uni.showModal({
// content: "支付失败,原因为: " + e.errMsg,
// showCancel: false
// })
// },
// complete: () => {
// this.loading = false;
// }
// })
// },
// errorMsg() {
// uni.showModal({
// content: "暂不支持苹果 iap 支付",
// showCancel: false
// })
// },
clickItem(index, item) {
this.activeIndex = index
this.applePrice = item
this.payMoney = item.price
},
async loadData() {
},
//消费记录
consumeRecord(){
}
}
}
</script>
......@@ -133,13 +151,25 @@ export default {
background-color: cornflowerblue;
color: #FFFFFF;
font-size: 88rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text:first-child {
color: #e7e4e9;
font-size: 30rpx;
.firstView{
display: flex;
justify-content: flex-end;
padding-right: 20rpx;
padding-top: 20rpx;
color: #6e6d70;
.firstText {
color: #e7e4e9;
font-size: 30rpx;
}
}
.secondView{
display: flex;
flex-direction: column;
align-items: center;
.secondText {
color: #e7e4e9;
font-size: 30rpx;
}
}
}
......
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