Commit b605e0d4 authored by liwei's avatar liwei

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

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