Commit 5391d957 authored by liwei's avatar liwei

对接了会员详情接口

parent 19b499c3
......@@ -12,3 +12,12 @@ export function userList(data){
});
}
/**
* 获取用户详情
*/
export function userDetail(data){
return request({
method: "get",
url: '/app/open/memInfo/detail/'+ data,
});
}
//将字符串日期转换成数字,并且为年月日
export function parseDate(dateString) {
// 假设 dateString 是有效的并且遵循 "YYYY-MM-DD" 格式
var parts = dateString.split('-'); // 使用split方法分割字符串
return {
year: parseInt(parts[0], 10), // 将第一部分转换为整数作为年份
month: parseInt(parts[1], 10), // 将第二部分转换为整数作为月份
day: parseInt(parts[2], 10) // 将第三部分转换为整数作为日子
};
}
//通过生日计算年龄
export function calculateAge(birth_year,birth_month,birth_day) {
const today_date = new Date();
const today_year = today_date.getFullYear();
const today_month = today_date.getMonth();
const today_day = today_date.getDate();
var age = today_year - birth_year;
if ( today_month < (birth_month - 1))
{
age--;
}
if (((birth_month - 1) == today_month) && (today_day < birth_day))
{
age--;
}
return age;
}
......@@ -31,9 +31,9 @@
<text decode="true" style="color: #434343;">{{info.information}}</text>
</view>
</template>
<view v-else style="height: 100rpx;">
<!-- <view v-else style="height: 100rpx;">-->
</view>
<!-- </view>-->
<view class="content">
<template v-if="info.content">
<u-read-more ref="uReadMore" :shadowStyle="shadowStyle" :toggle="true" color="#415C9E"
......
......@@ -12,7 +12,7 @@
<view class="card" v-for="(item,index) in activityList" :key="index" @click="gotopage(item)">
<view class="contentBody">
<view class="leftlist">
<image :src="item.path" class="leftlistimage"/>
<image :src="item.url" class="leftlistimage"/>
</view>
<view class="rightlist">
<view class="rightlist-title">{{item.title}}</view>
......@@ -124,7 +124,7 @@ export default {
}
bannerList(query).then(res =>{
//将res.data.rows集合里的bannerPicture取出来,放到集合中 将\替换成/
this.bannerList = res.data.data.map(item => item.path.replace(/\\/g, '/'));
this.bannerList = res.data.data.map(item => item.url.replace(/\\/g, '/'));
}).catch(e => {
console.log(e)
})
......@@ -139,7 +139,7 @@ export default {
console.log('res.data.data:',res.data.data)
this.activityList = res.data.data.map(item => ({
...item, // 复制对象中的所有属性
path: item.path != null ? item.path.replace(/\\/g, '/') : ''// 替换 avatarUrl 中的所有 \ 为 /
url: item.url != null ? item.url.replace(/\\/g, '/') : ''// 替换 avatarUrl 中的所有 \ 为 /
}));
}).catch(e => {
console.log(e)
......
......@@ -132,7 +132,7 @@
}
bannerList(query).then(res =>{
//将res.data.rows集合里的bannerPicture取出来,放到集合中 将\替换成/
this.bannerList = res.data.data.map(item => item.path.replace(/\\/g, '/'));
this.bannerList = res.data.data.map(item => item.url.replace(/\\/g, '/'));
}).catch(e => {
console.log(e)
})
......
This diff is collapsed.
......@@ -15,8 +15,8 @@
<view class="bottom-left">
<view class="bottom-info">
{{item.memNickName}}
<image v-if="item.memSex == '0'" class="gender" src="../static/images/like/male.png" mode=""/>
<image v-else class="gender" src="../static/images/like/famale.png" mode=""/>
<image v-if="item.memSex == '0'" class="gender" :src="baseUrl+'/user/male.png'" mode=""/>
<image v-else class="gender" :src="baseUrl+'/user/famale.png'" mode=""/>
</view>
<view class="bottom-info">
{{ 18 }}
......@@ -39,6 +39,8 @@ let util = require('@/util/means.js');
export default {
data() {
return {
//图片路径
baseUrl: this.$store.state.imgUrl,
//分页查询参数
queryParam:{
page:1,
......
......@@ -6,7 +6,7 @@ Vue.use(Vuex)
const store = new Vuex.Store({
state: {
imgUrl: 'http://192.168.1.80/static/images'
imgUrl: 'http://192.168.1.7/static/images'
//公共的变量,这里的变量不能随便修改,只能通过触发mutations的方法才能改变
},
mutations: {
......
This diff is collapsed.
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