Browse Source

对接接口

master
邓平艺 5 years ago
parent
commit
d21ce56ef3
  1. 12
      common/api.js
  2. 8
      components/lf-image/lf-image.vue
  3. 19
      components/lf-userList/lf-userList.vue
  4. 46
      pages/index/index.vue
  5. 29
      pages/my/exclusiveMatch.vue
  6. 22
      pages/my/index.vue
  7. 103
      pages/my/memberDetails.vue
  8. 30
      pages/my/service.vue
  9. 26
      pages/userList/userList.vue

12
common/api.js

@ -1,9 +1,17 @@
// appId: 正式 null | 测试 null
export const DEV = "dev"; // dev 测试 | prod 正式
export const VERSION = '1.0.0'; // 版本号
export const DEVURL = 'http://192.168.3.181'; // 测试服请求地址
// export const DEVURL = 'http://192.168.3.181'; // 测试服请求地址
export const DEVURL = 'http://192.168.3.186'; // 测试服请求地址
export const PRODURL = ''; // 正式服请求地址
export const CALLBACKURL = 'http://192.168.3.183:8080'; // 重定向地址(H5授权换取code回调地址)
export const APPID = 'wx98e64ab875b2553e'; // 公众号appid
export const API_OFFICIAL_LOGIN = '/api/official_login';
export const API_OFFICIAL_LOGIN = '/api/official_login'; // code 换取用户信息
export const API_KEFU = '/api/kefu'; // 获取客服信息
export const API_HONGNIANG = '/api/hongniang'; // 获取红娘信息
export const API_MEMBERS_WALL = '/api/members/wall'; // 获取首页上墙会员
export const API_MEMBERS_ALL = '/api/members/all'; // 会员列表
export const API_MEMBERS_DETAIL = '/api/members/detail'; // 会员详情
export const API_MEMBERS_PARAMS = '/api/members/params'; // 获得查询参数
export const API_UCENTER = '/api/ucenter'; // 个人中心落地页

8
components/lf-image/lf-image.vue

@ -33,10 +33,16 @@
},
data(){
return {
img_src: this.src,
img_src: '',
loading: true
}
},
watch: {
src(val){
console.log("val", val)
this.img_src = val;
}
},
methods: {
load(event){
this.loading = false;

19
components/lf-userList/lf-userList.vue

@ -1,14 +1,14 @@
<template>
<view class="content" :style="padding ? 'padding: 0rpx 32rpx' : 'padding: 0rpx'">
<view class="list" v-for="(item, index) in list" :key="index" @click="$url('/pages/my/memberDetails')">
<lf-image class="avatar" src="../../static/logo.png"></lf-image>
<view class="list" v-for="(item, index) in list" :key="index" @click="$url('/pages/my/memberDetails?id='+ item.number)">
<lf-image class="avatar" :src="item.user.avatar"></lf-image>
<view class="info">
<view class="lf-flex-1">
<text>编号83927</text>
<text class="lf-iconfont icon-nv lf-m-l-10 lf-color-primary" v-if="index % 2"></text>
<text>{{ item.number_nickname }}</text>
<text class="lf-iconfont icon-nv lf-m-l-10 lf-color-primary" v-if="item.gender == '女'"></text>
<text class="lf-iconfont icon-nan lf-m-l-10 color-nan" v-else></text>
</view>
<view class="lf-flex-1 lf-m-t-16">24··180cm·本科·未婚</view>
<view class="lf-flex-1 lf-m-t-16">{{ item.age }}·{{ item.zodiac }}·{{ item.height }}cm·{{ item.education_id }}·{{ item.marital_status }}</view>
<view class="lf-flex-1 lf-m-t-16">自有公司·金融/证券/保险·50万以上</view>
</view>
</view>
@ -16,8 +16,12 @@
</template>
<script>
import lfImage from '../lf-image/lf-image.vue'
export default {
name: 'lf-userList',
components: {
lfImage
},
props: {
padding: {
type: Boolean, //
@ -25,10 +29,7 @@
},
list: {
type: Array,
default: function(){
return [1,2,3,4,5,6,7,8,9,10]
// return [1]
}
default: []
}
},
data(){

46
pages/index/index.vue

@ -23,9 +23,9 @@
<lf-image class="add-icon" src="../../static/images/add_icon.png"></lf-image>
<view class="lf-m-t-12 lf-color-555 lf-font-24 lf-line-1">我要上墙</view>
</view> -->
<view class="user-item" v-for="item in 6" :key="item">
<image class="avatar" src="https://picsum.photos/200"></image>
<view class="lf-m-t-12 lf-color-555 lf-font-24 lf-line-1">编号 73949</view>
<view class="user-item" v-for="(item, index) in members_wall" :key="item.id" @click="$url('/pages/my/memberDetails?id'+ item.number)">
<image class="avatar" :src="item.user.avatar"></image>
<view class="lf-m-t-12 lf-color-555 lf-font-24 lf-line-1">编号{{ item.number }}</view>
</view>
</view>
</scroll-view>
@ -40,11 +40,11 @@
<text class="lf-iconfont icon-xiangyou"></text>
</view>
</view>
<lf-user-list></lf-user-list>
<lf-user-list :list='members'></lf-user-list>
</view>
<!-- 加载 -->
<view class="loading-more">
<text class="loading-more-text">正在加载中</text>
<text :class="{'loading-more-text': loading_class}">{{ loading_text }}</text>
</view>
<!-- 回到顶部 -->
<u-back-top :scrollTop="pageScrollTop"></u-back-top>
@ -57,7 +57,13 @@
components: { lfUserList },
data() {
return {
members_wall: [],
members: [],
page: 1,
page_size: 10,
isPage: true,
loading_text: '',
loading_class: true
}
},
onLoad(){
@ -67,6 +73,9 @@
console.log("options", options)
if(options.code){
this.login(options.code)
}else if(this.$isRight(uni.getStorageSync('user_info'))){
this.getMembersWall();
this.getMembers();
}
// #endif
},
@ -97,9 +106,34 @@
}).then(res => {
console.log(res)
uni.setStorageSync('user_info', res?.data?.user);
this.getMembersWall();
this.getMembers();
}).catch(err => {
console.log(err)
})
},
getMembers(){
this.$http(this.API.API_MEMBERS_ALL, {
page: this.page,
pagesize: this.page_size
}).then(res => {
let members = res.data.members.data || [];
let isPage = this.$isRight(res.data.members.next_page_url);
this.isPage = isPage;
if(!isPage){
this.loading_class = false;
this.loading_text = '已加载全部数据~';
}
this.members = members;
})
},
getMembersWall(){
this.$http(this.API.API_MEMBERS_WALL, {
page: 1,
pagesize: 12
}).then(res => {
this.members_wall = res.data.members_wall.data || [];
})
}
}
}

29
pages/my/exclusiveMatch.vue

@ -10,15 +10,16 @@
<view class="qrcode-content">
<view class="lf-row-between lf-p-l-30 lf-p-r-30 content-title">
<view class="lf-flex">
<u-icon name="weixin-fill lf-m-r-15 lf-font-38"></u-icon><text class="lf-font-28 lf-color-222">gyw38283</text>
<u-icon name="weixin-fill lf-m-r-15 lf-font-38"></u-icon><text class="lf-font-28 lf-color-222">{{ hongniang.weixin }}</text>
</view>
<view class="content-btn" @click="copy('gyw38283')">
<view class="content-btn" @click="copy(hongniang.weixin)">
复制
</view>
</view>
<view class="qr-code">
<tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="270" unit="px" background="#fff"
foreground="#000" pdground="#000" :onval="true" :loadMake="true" />
<image :src="hongniang.qrcode_url"></image>
<!-- <tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="270" unit="px" background="#fff"
foreground="#000" pdground="#000" :onval="true" :loadMake="true" /> -->
</view>
</view>
</view>
@ -26,24 +27,34 @@
<script>
import tkiQrcode from "tki-qrcode" //
// import tkiQrcode from "tki-qrcode" //
export default {
components: {
tkiQrcode
},
// components: {
// tkiQrcode
// },
data() {
return {
base64Img: '',
checkArea: 'USI782936437829'
checkArea: 'USI782936437829',
hongniang: {}
}
},
onLoad(){
this.getData();
},
methods: {
getData(){
this.$http(this.API.API_HONGNIANG).then(res => {
this.hongniang = res.data.hongniang;
})
},
//
qrR(data) {
this.base64Img = data;
},
//
copy(text) {
if(!text) return;
uni.setClipboardData({
data: text
});

22
pages/my/index.vue

@ -5,11 +5,14 @@
<view class="lf-row-round">
<view>
<!-- <lf-image style="width: 160rpx;height: 160rpx;" src="../../static/logo.png"></lf-image> -->
<image src="../../static/logo.png" mode="widthFix" class="head-pic"></image>
<lf-image :src="user.avatar" mode="widthFix" class="head-pic"></lf-image>
</view>
<view class="head-left">
<view class="head-name" @click="$url('/pages/my/editInfo')">编号73894 <u-icon name="arrow-right lf-m-l-20"></u-icon></view>
<view class="head-text">资料审核中</view>
<view class="head-name" @click="$url('/pages/my/editInfo')">
<text>{{ user.number_nickname }}</text>
<u-icon name="arrow-right lf-m-l-20"></u-icon>
</view>
<view class="head-text">{{ user.overall_state_text }}</view>
</view>
</view>
<!-- <view class="lf-bg-white span-btn1" @click="$url('/pages/my/bindPhone')">
@ -32,7 +35,7 @@
</view>
</view>
<view class="lf-color-primary lf-font-32">
3
{{ user.red_rope }}
</view>
</view>
<!-- <view class="lf-row-between" style="height: 98rpx;padding: 0 32rpx;">
@ -99,9 +102,13 @@
{name: '公众号',icon:'google-circle-fill',path:'/pages/my/officialAccount',pic: '../../static/my/public.png'},
{name: '联系客服',icon:'kefu-ermai',path: '/pages/my/service',pic: '../../static/my/service.png'},
// {name: '',icon:'setting',path: '/pages/my/setting',pic: '../../static/my/setting.png'}
]
],
user: {}
}
},
onLoad(){
this.getData();
},
methods: {
showRedthread() {
uni.showModal({
@ -131,6 +138,11 @@
}
}
});
},
getData(){
this.$http(this.API.API_UCENTER).then(res => {
this.user = res.data.user;
})
}
}
}

103
pages/my/memberDetails.vue

@ -1,19 +1,20 @@
<template>
<view class="lf-w-100 lf-h-100">
<view class="content lf-bg-white lf-m-b-30">
<view class="content lf-bg-white lf-m-b-30" v-if="$isRight(member)">
<swiper class="swiper">
<swiper-item>
<lf-image src="https://picsum.photos/200"></lf-image>
<lf-image :src="member.avatar"></lf-image>
</swiper-item>
</swiper>
<view class="list lf-p-l-32 lf-p-r-32">
<!-- <lf-image class="avatar" src="@/static/logo.png"></lf-image> -->
<view class="info">
<view class="lf-flex-1">
<text>编号83927</text>
<text class="lf-iconfont icon-nan lf-m-l-10" style="color: #1E77F4;"></text>
<text>{{ member.member.number_nickname }}</text>
<text class="lf-iconfont icon-nv lf-m-l-10 lf-color-primary" v-if="member.member.gender == '女'"></text>
<text class="lf-iconfont icon-nan lf-m-l-10 color-nan" v-else></text>
</view>
<view class="lf-flex-1 lf-m-t-16">24··180cm·本科·未婚</view>
<view class="lf-flex-1 lf-m-t-16">{{ member.member.age }}·{{ member.member.zodiac }}·{{ member.member.height }}cm·{{ member.member.education_id }}·{{ member.member.marital_status }}</view>
<view class="lf-flex-1 lf-m-t-16">自有公司·金融/证券/保险·50万以上</view>
</view>
<!-- <view class="star">
@ -22,9 +23,9 @@
</view>
<!-- <view class="sketch">大家好我是私人订制红娘-笑笑如果你不想在平台上面曝光需要我为你全程服务精准高效速配脱单的加我微信18399999999</view> -->
</view>
<view class="info-content">
<view class="info-content" v-if="$isRight(member)">
<view class="lf-color-222 lf-font-32 authen-title lf-p-l-20">信息资料</view>
<view class="lf-row-between lf-m-t-30" v-for="(item,index) of list" :key="index">
<view class="lf-row-between lf-m-t-30" v-for="(item, index) of list" :key="index">
<view class="lf-color-333 lf-font-28">{{item.title}}</view>
<view class="lf-color-333 lf-font-28">{{item.content}}</view>
</view>
@ -49,7 +50,7 @@
</view>
<view class="tabbar-bottom">
<view class="lf-row-between">
<view class="lf-flex-column" style="align-items: center;">
<view class="lf-flex-column" style="align-items: center;" @click="$url('/pages/my/service')">
<view>
<u-icon name="kefu-ermai lf-font-32 lf-color-555"></u-icon>
</view>
@ -57,7 +58,7 @@
客服
</view>
</view>
<view class="lf-flex-column" style="align-items: center;margin-left: 50rpx;">
<view class="lf-flex-column" style="align-items: center;margin-left: 50rpx;" @click="share">
<view>
<u-icon name="share lf-font-32 lf-color-555"></u-icon>
</view>
@ -91,22 +92,74 @@
export default {
data() {
return {
list: [
{title: '编号',content: '839748'},
{title: '性别',content: '男'},
{title: '婚史',content: '未婚'},
{title: '年龄',content: '24岁(1996-10)'},
{title: '身高',content: '180'},
{title: '体重',content: '70'},
{title: '属相',content: '鼠'},
{title: '星座',content: '天秤座'},
{title: '户籍',content: '其他省市'},
{title: '学历',content: '本科'},
{title: '单位性质',content: '私企'},
{title: '所属行业',content: '广告/设计/传媒'},
{title: '年薪',content: '6万-8万'},
{title: '居住地区',content: '其他省市'},
]
list: [],
number_id: 0,
member: {}
}
},
onLoad(options){
this.number_id = options.id || 0;
this.getMemberDetail();
},
methods: {
getMemberDetail(){
this.$http(this.API.API_MEMBERS_DETAIL, {
number: this.number_id
}).then(res => {
let list = [];
let member = res.data.member;
this.member = member;
for(let i in member){
if(member[i].number_nickname){
list.push({title: '编号', content: member[i].number_nickname});
}
if(member[i].gender){
list.push({title: '性别', content: member[i].gender});
}
if(member[i].marital_status){
list.push({title: '婚史', content: member[i].marital_status});
}
if(member[i].age){
list.push({title: '年龄', content: member[i].age +'岁'});
}
if(member[i].height){
list.push({title: '身高', content: member[i].height});
}
if(member[i].weight){
list.push({title: '体重', content: member[i].weight});
}
if(member[i].zodiac){
list.push({title: '属相', content: member[i].zodiac});
}
if(member[i].constellation){
list.push({title: '星座', content: member[i].constellation});
}
if(this.$isRight(member[i].education)){
list.push({title: '学历', content: member[i].education.name});
}
if(this.$isRight(member[i].enterprise)){
list.push({title: '单位性质', content: member[i].enterprise.name});
}
if(this.$isRight(member[i].salary)){
list.push({title: '年薪', content: member[i].salary.name});
}
if(this.$isRight(member[i].area)){
list.push({title: '居住地区', content: member[i].area.name});
}
// TODO
}
this.list = list;
})
},
share(){
this.$msg('复制链接成功!')
uni.setClipboardData({
data: 'a',
complete: () => {
console.log("aaa")
}
});
}
}
}

30
pages/my/service.vue

@ -14,15 +14,16 @@
<view class="qrcode-content">
<view class="lf-row-between lf-p-l-30 lf-p-r-30 content-title">
<view class="lf-flex">
<u-icon name="weixin-fill lf-m-r-15 lf-font-38"></u-icon><text class="lf-font-28 lf-color-222">gyw38283</text>
<u-icon name="weixin-fill lf-m-r-15 lf-font-38"></u-icon><text class="lf-font-28 lf-color-222">{{ kefu.weixin }}</text>
</view>
<view class="content-btn" @click="copy(gyw38283)">
<view class="content-btn" @click="copy(kefu.weixin)">
复制
</view>
</view>
<view class="qr-code">
<tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="270" unit="px" background="#fff"
foreground="#000" pdground="#000" :onval="true" :loadMake="true" />
<image :src="kefu.qrcode_url"></image>
<!-- <tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="270" unit="px" background="#fff"
foreground="#000" pdground="#000" :onval="true" :loadMake="true" /> -->
</view>
</view>
</view>
@ -30,24 +31,35 @@
<script>
import tkiQrcode from "tki-qrcode" //
// import tkiQrcode from "tki-qrcode" //
export default {
components: {
tkiQrcode
},
// components: {
// tkiQrcode
// },
data() {
return {
base64Img: '',
checkArea: 'USI782936437829'
checkArea: 'USI782936437829',
kefu: {}
}
},
onLoad(){
this.getData();
},
methods: {
getData(){
this.$http(this.API.API_KEFU).then(res => {
this.kefu = res.data.kefu;
})
},
//
qrR(data) {
this.base64Img = data;
},
//
copy(text) {
// TODO H5
if(!text) return;
uni.setClipboardData({
data: text
});

26
pages/userList/userList.vue

@ -10,7 +10,7 @@
<!-- 普通列表文字选择 -->
<view class="filter-modal" v-if="show_filter && filter_key != 'search'" @click="show_filter = false">
<view class="filter-content">
<view v-for="(item, index) in filter[filter_key].data" :key="index" @click="activeItem(item.value)">{{ item.value }}</view>
<view v-for="(item, index) in filter[filter_key].data" :key="index" @click="activeItem(item.text)">{{ item.text }}</view>
</view>
</view>
<!-- 多条件搜索 -->
@ -26,10 +26,10 @@
<view class="filter-title">{{ value.name }}</view>
<view class="lf-flex-wrap">
<view class="filter-capsule"
:class="{'filter-active': item.value == value.selected}"
:class="{'filter-active': item.text == value.selected}"
v-for="(item, index) in value.data" :key="index"
@click="switchCondition(key, item.value)"
>{{ item.value }}</view>
@click="switchCondition(key, item.text)"
>{{ item.text }}</view>
</view>
</block>
</view>
@ -55,17 +55,18 @@
<script>
import lfUserList from '@/components/lf-userList/lf-userList.vue'
var filterObj = require('./filter.json');
// var filterObj = require('./filter.json');
export default {
components: { lfUserList },
data(){
return {
show_filter: false,
filter: this.productionObj(),
filter: {},
filter_key: '',
name: '最新',
on_focus: false
on_focus: false,
filterObj: {}
}
},
onLoad(options){
@ -76,11 +77,20 @@
this.filter_key = 'search';
this.on_focus = true;
}
this.getMemberParams();
},
methods: {
//
getMemberParams(){
this.$http(this.API.API_MEMBERS_PARAMS).then(res => {
console.log(res, "---------");
this.filterObj = res.data;
this.filter = this.productionObj();
})
},
//
productionObj(){
return JSON.parse( JSON.stringify(filterObj) );
return JSON.parse( JSON.stringify(this.filterObj) );
},
//
switchFilter(key){

Loading…
Cancel
Save