接口带哦有

main
123456 1 month ago
parent 76db167e91
commit e6ec15f44b
  1. 40
      api/index.js
  2. 2
      api/request.js
  3. 8
      main.js
  4. 25
      manifest.json
  5. 2
      pages/dongtai/index.vue
  6. 6
      pages/index/city.vue
  7. 21
      pages/index/citySearch.vue
  8. 28
      pages/index/index.vue
  9. 2
      pages/index/search.vue
  10. 8
      pages/peiwan/apply.vue
  11. 2
      pages/peiwan/confirm.vue
  12. 28
      pages/peiwan/detail.vue
  13. 7
      pages/peiwan/index.vue
  14. 111
      pages/pipei/tongcheng/index.vue
  15. 11
      pages/pipei/yuyin/index.vue
  16. 28
      pages/user/index.vue
  17. 4
      pages/users/center/index.vue
  18. 551
      pages/users/chat/index.vue
  19. 4
      pages/users/edit/index.vue
  20. 2
      pages/users/notice/index.vue
  21. 6
      pages/users/personal/index.vue
  22. 2
      pages/users/qingshaonian/detail.vue
  23. 2
      pages/users/qingshaonian/index.vue
  24. 2
      pages/users/recharge/index.vue
  25. 2
      pages/users/renzheng/index.vue
  26. 2
      pages/users/site/index.vue
  27. 2
      pages/users/yinsi/index.vue
  28. 8548
      unpackage/dist/dev/app-plus/app-service.js
  29. 11057
      unpackage/dist/dev/app-plus/app-view.js
  30. BIN
      unpackage/dist/dev/app-plus/static/chat-05.png
  31. 2
      新建文本文档.txt

@ -1,5 +1,45 @@
import { request } from './request'
const api = {
//视频语音匹配
userSpeedDating(data) {
return request({
url: 'api/user/userSpeedDating',
method: 'post',
data
})
},
//同城速配
sameCitySpeedDating(data) {
return request({
url: 'api/user/sameCitySpeedDating',
method: 'post',
data
})
},
//送礼物
giftGiving(data) {
return request({
url: 'api/user/giftGiving',
method: 'post',
data
})
},
//送礼物
giftGiving(data) {
return request({
url: 'api/user/giftGiving',
method: 'post',
data
})
},
//礼物列表
giftList(data) {
return request({
url: 'api/giftList',
method: 'post',
data
})
},
//海报
createPoster(data) {
return request({

@ -15,7 +15,7 @@ export function request(prams) {
"deviceSn": uni.getStorageSync("deviceSn"),
},
success: (res) => {
if (res.data.code == 200){
if (res.data.code == 200 || res.data.code == -1){
console.log(prams)
console.log("返回结果:"+JSON.stringify(res.data))
resolve(res.data);

@ -48,9 +48,7 @@ uni.$on("openSocket",function(res){
});
uni.onSocketOpen(function (res) {
console.log('WebSocket连接已打开!');
uni.sendSocketMessage({
data: {"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"}
});
uni.sendSocketMessage({data:JSON.stringify({"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"})});
xintiao()
});
uni.onSocketMessage(function (res) {
@ -89,9 +87,7 @@ function xintiao() {
clearInterval(timer)
timer = setInterval(()=>{
console.log("xintiao")
uni.sendSocketMessage({
data: {"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"}
});
uni.sendSocketMessage({data:JSON.stringify({"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"})});
}, 10000)
}

@ -26,7 +26,8 @@
"Record" : {},
"Share" : {},
"Barcode" : {},
"VideoPlayer" : {}
"VideoPlayer" : {},
"Push" : {}
},
/* */
"distribute" : {
@ -99,6 +100,28 @@
"alipay" : {
"__platform__" : [ "ios", "android" ]
}
},
"push" : {
"unipush" : {
"version" : "2",
"offline" : true,
"icons" : {
"small" : {
"ldpi" : "static/logo.png",
"xxhdpi" : "static/logo.png",
"xhdpi" : "static/logo.png",
"hdpi" : "static/logo.png",
"mdpi" : "static/logo.png"
}
},
"hms" : {},
"oppo" : {},
"vivo" : {},
"mi" : {},
"meizu" : {},
"honor" : {},
"fcm" : {}
}
}
},
"splashscreen" : {

@ -159,7 +159,7 @@
uni.setStorageSync("userInfo",data)
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -26,18 +26,16 @@
onReady() {
const that = this;
that.jingweiInfo = uni.getStorageSync("jingweiInfo");
that.city = this.jingweiInfo.city;
that.city = this.jingweiInfo.new_city?this.jingweiInfo.new_city:this.jingweiInfo.city;
console.log(uni.getStorageSync("jingweiInfo"))
uni.$on("clickTap", res=>{
console.log(res)
that.jingweiInfo.formatted = res.name
that.jingweiInfo.latitude = res.latitude
that.jingweiInfo.longitude = res.longitude
uni.setStorageSync("jingweiInfo",that.jingweiInfo)
});
uni.$on("watchCity", res=>{
that.city = res.name
uni.setStorageSync("jingweiInfo",that.jingweiInfo)
that.city = res.name
});
},
methods: {

@ -24,20 +24,27 @@
isShow: false,
city: "",
keyword: "",
list: []
list: [],
jingweiInfo: {}
};
},
onLoad(o) {
this.city = decodeURIComponent(o.city);
console.log(this.city)
this.city = decodeURIComponent(o.city);
this.jingweiInfo = uni.getStorageSync("jingweiInfo")
},
methods: {
clickTap(a){
uni.$emit("clickTap", a);
clickTap(a){
console.log(a)
this.jingweiInfo.new_city = this.city
this.jingweiInfo.formatted = a.name
this.jingweiInfo.latitude = a.location.split(",")[1]
this.jingweiInfo.longitude = a.location.split(",")[0]
uni.setStorageSync("jingweiInfo",this.jingweiInfo)
this.city = "";
this.keyword= "";
this.list = [];
this.isShow = false;
uni.$emit("clickTap", a);
uni.navigateBack({
delta:1
})
@ -45,9 +52,9 @@
changeInput(e) {
const that = this;
that.keyword = e.detail.value
console.log('https://restapi.amap.com/v3/assistant/inputtips?datatype=all&type=分类代码&city='+that.city+'&key=4a6e2ba8eac3864f0d88f9b5abd026e6&keywords='+that.keyword)
console.log('https://restapi.amap.com/v3/assistant/inputtips?datatype=poi&citylimit=true&city='+that.city+'&key=4a6e2ba8eac3864f0d88f9b5abd026e6&keywords='+that.keyword)
uni.request({
url: 'https://restapi.amap.com/v3/assistant/inputtips?datatype=all&type=分类代码&city='+that.city+'&key=4a6e2ba8eac3864f0d88f9b5abd026e6&keywords='+that.keyword,
url: 'https://restapi.amap.com/v3/assistant/inputtips?datatype=poi&citylimit=true&city='+that.city+'&key=4a6e2ba8eac3864f0d88f9b5abd026e6&keywords='+that.keyword,
success(res) {
console.log(res.data.tips)
if(res.data.tips && res.data.tips.length > 0){

@ -154,7 +154,8 @@
},
onReady() {
const that = this;
uni.$on("clickTap", res=>{
uni.$on("clickTap", res=>{
console.log(res)
that.city = res.name;
if(that.current == 0){
that.page1 = 1;
@ -215,7 +216,8 @@
userId: uni.getStorageSync("userInfo").id,
lat: res.latitude,
lon: res.longitude,
});
});
},
recorderAuthModal: function () {
const that = this;
@ -244,13 +246,14 @@
}
},
//
async nearbyCustomerList(type){
async nearbyCustomerList(type){
console.log(uni.getStorageSync("jingweiInfo").new_city)
const { code, data , msg } = await this.$api.nearbyCustomerList({
userId: uni.getStorageSync("userInfo").id,
nickname: "",
startAge: "",
endAge: "",
city: this.city,
city: uni.getStorageSync("jingweiInfo").new_city?uni.getStorageSync("jingweiInfo").new_city:uni.getStorageSync("jingweiInfo").city,
lat: uni.getStorageSync("jingweiInfo").latitude,
lon: uni.getStorageSync("jingweiInfo").longitude,
page: this.page2,
@ -264,7 +267,7 @@
this.commentList2 = this.arrayUnique([...this.commentList2,...data.list],'id')
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -277,7 +280,9 @@
nickname: "",
startAge: "",
endAge: "",
city: this.city,
lat: uni.getStorageSync("jingweiInfo").latitude,
lon: uni.getStorageSync("jingweiInfo").longitude,
city: uni.getStorageSync("jingweiInfo").new_city?uni.getStorageSync("jingweiInfo").new_city:uni.getStorageSync("jingweiInfo").city,
page: this.page1,
limit: 20
});
@ -289,7 +294,7 @@
this.commentList1 = this.arrayUnique([...this.commentList1,...data.list],'id')
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -313,7 +318,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -461,7 +466,12 @@
}
},
changeTabs(index){
this.current = index;
this.current = index;
this.commentList1 = []
this.page1 = 1
this.page2 = 1
this.commentList1 = []
this.commentList2 = []
if(index == 0){
this.customerRecommendList();
}else{

@ -130,7 +130,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -61,7 +61,7 @@
})
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -101,7 +101,7 @@
},2000)
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -134,7 +134,7 @@
})
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -158,7 +158,7 @@
this.list = data.list;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -249,7 +249,7 @@
}
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -241,7 +241,7 @@
},2000)
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -260,14 +260,14 @@
this.distance = data.distance;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
}
},
async userArticleList() {
const { code, data , msg } = await this.$api.userArticleList({userId: uni.getStorageSync("userInfo").id,limit:100,page:1});
const { code, data , msg } = await this.$api.userArticleList({userId: this.id,limit:100,page:1});
if(code == 200){
let arr = [];
if(data.list && data.list.length > 0){
@ -282,7 +282,7 @@
this.isShow = data.totalCount == 0?true:false;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -294,7 +294,7 @@
this.userMeInfo = data;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -317,7 +317,7 @@
this.getDictDataByType();
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -408,6 +408,14 @@
this.isPopup = true
return ;
}
if(this.userInfo.isBlack == 1){
uni.showToast({
title: "该用户是黑名单",
icon: "none",
position: "bottom"
})
return ;
}
this.info.userid = this.id;
this.isDashan = true
}else if(index == 4){
@ -415,6 +423,14 @@
this.isPopup = true
return ;
}
if(this.userInfo.isBlack == 1){
uni.showToast({
title: "该用户是黑名单",
icon: "none",
position: "bottom"
})
return ;
}
uni.navigateTo({
url: "/pages/peiwan/confirm?id="+id
})

@ -28,7 +28,7 @@
</view>
<view class="info">
<view class="name">{{a.nickname}}<view class="vip" v-if="a.memberflag >=1">VIP{{a.memberflag}}</view></view>
<view class="desc">{{a.age}}/{{a.height}}cm</view>
<view class="desc">{{a.age}}/{{a.distance}}m</view>
</view>
<view class="chat">
<image src="@/static/xin.png"></image>
@ -204,7 +204,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -236,7 +236,8 @@
userId: uni.getStorageSync("userInfo").id,
configid: this.current==0?-1:this.list[this.current].id,
page: this.page,
limit: 20,
limit: 20,
city: uni.getStorageSync("jingweiInfo").new_city?uni.getStorageSync("jingweiInfo").new_city:uni.getStorageSync("jingweiInfo").city,
lat: uni.getStorageSync("jingweiInfo").latitude,
lon: uni.getStorageSync("jingweiInfo").longitude,
})

@ -5,60 +5,130 @@
</view>
<view class="tongcheng-content">
<view class="title">开始心电感应吧</view>
<view class="desc">马上配发一个小可爱</view>
<view class="desc">马上配发一个{{userInfo.sex==1?'小可爱':'小帅哥'}}</view>
<view class="dian">
<view class="info" v-if="isSucess == false">
<image src="@/static/nv.png"></image>
<view class="txt">空白</view>
<view class="info" v-if="isSucess <= 2">
<image :src="userInfo.faceImage?userInfo.faceImage:userInfo.img"></image>
<view class="txt">{{userInfo.nickname}}</view>
</view>
<view class="user" v-else>
<view class="user" v-if="isSucess == 3">
<view class="item">
<image class="avatar" src="@/static/nv.png"></image>
<view class="txt">空白空白1</view>
<view class="sex nv">
<image class="icon" src="/static/icon-nv.png"></image>28
<image class="avatar" :src="userInfo.faceImage?userInfo.faceImage:userInfo.img"></image>
<view class="txt">{{userInfo.nickname}}</view>
<view class="sex" :class="userInfo.sex == 1?'nan':'nv'">
<image class="icon" v-if="userInfo.sex == 2" src="/static/icon-nv.png"></image>
<image class="icon" v-if="userInfo.sex == 1" src="/static/icon-nan.png"></image>
{{userInfo.age}}
</view>
</view>
<view class="items">
<image src="@/static/xin2.png"></image>
</view>
<view class="item">
<image class="avatar" src="@/static/nan.png"></image>
<view class="txt">空白空白2</view>
<view class="sex nan">
<image class="icon" src="/static/icon-nan.png"></image>29
<image class="avatar" :src="info.faceImage?info.faceImage:info.img"></image>
<view class="txt">{{info.nickname}}</view>
<view class="sex" :class="info.sex == 1?'nan':'nv'">
<image class="icon" v-if="info.sex == 2" src="/static/icon-nv.png"></image>
<image class="icon" v-if="info.sex == 1" src="/static/icon-nan.png"></image>
{{info.age}}
</view>
</view>
</view>
</view>
</view>
<view class="tongcheng-start" v-if="isSucess == false">开始匹配</view>
<view class="tongcheng-end" v-else>
<view class="send">发送消息</view>
<view class="todo">继续探索</view>
<view class="tongcheng-start" v-if="isSucess == 1" @click="toPage(1)">开始匹配</view>
<view class="tongcheng-start" v-if="isSucess == 2">匹配中</view>
<view class="tongcheng-end" v-if="isSucess == 3">
<view class="send" @click="toPage(2)">发送消息</view>
<view class="todo" @click="toPage(3)">继续探索</view>
</view>
</view>
</template>
<script>
let timer = null;
export default {
data() {
return {
isSucess: true,
isSucess: 1,
info: {},
count: 5,
userInfo: {},
background: {
//
background: 'url(@/static/tongcheng-bg.png) center top no-repeat',
background: 'url(https://api.lyiyuan.cn/profile/upload/static/tongcheng-bg.png) center top no-repeat',
// size
backgroundSize: '100 auto',
},
};
},
onLoad() {
this.userInfo = uni.getStorageSync("userInfo");
this.count = Math.floor(Math.random() * (20 - 1 + 1)) + 1;
},
methods: {
toPage(index){
const that = this;
if(index == 1){
that.isSucess = 2;
timer = setInterval(()=>{
if(that.count == 0){
clearInterval(timer);
that.count = Math.floor(Math.random() * (20 - 1 + 1)) + 1;
that.sameCitySpeedDating();
}else{
that.count --
}
},1000)
}else if(index == 2){
this.toChat();
}else if(index == 3){
that.isSucess = 1;
that.count = Math.floor(Math.random() * (20 - 1 + 1)) + 1;
}
},
//
async toChat() {
const { code, data } = await this.$api.findZegoToken({
userId: uni.getStorageSync("userInfo").id,
sellerId: this.id
})
if(code == 200){
uni.setStorageSync("chatToken",data.token);
uni.navigateTo({
url: "/pages/users/chat/index?id="+this.id+"&roomId="+data.roomId
})
}
},
async sameCitySpeedDating() {
const { code, data, msg } = await this.$api.sameCitySpeedDating({
userId: uni.getStorageSync("userInfo").id,
lat: uni.getStorageSync("jingweiInfo").latitude,
lon: uni.getStorageSync("jingweiInfo").longitude,
city: uni.getStorageSync("jingweiInfo").new_city?uni.getStorageSync("jingweiInfo").new_city:uni.getStorageSync("jingweiInfo").city,
})
if(code == 200){
this.isSucess = 3;
this.info = data
}else{
this.isSucess = 1;
uni.showToast({
title: msg,
position: "bottom",
icon: "none",
})
}
},
},
onUnload() {
clearInterval(timer);
}
}
</script>
<style scoped lang="scss">
.tongcheng{
background: #0d0b15 url(@/static/tongcheng-bg.png) center top no-repeat;
background: #0d0b15 url(https://api.lyiyuan.cn/profile/upload/static/tongcheng-bg.png) center top no-repeat;
background-size: 100% auto;
overflow: hidden;
min-height: 100vh;
@ -203,7 +273,6 @@
font-size: 30rpx;
color: #FFFFFF;
margin: 0 auto;
margin-top: 10rpx;
}
}
}

@ -73,11 +73,11 @@
export default {
data() {
return {
isJieshou: false,
isJieshou: true,
title: "语音速配",
isMakefeng: true,
isYangshengqi: true,
isSucess: true,
isMakefeng: false,
isYangshengqi: false,
isSucess: false,
background: {
//
background: 'url(@/static/yuyin-bg.png) center top no-repeat',
@ -85,6 +85,9 @@
backgroundSize: '100 auto',
},
};
},
onLoad() {
},
methods: {
toggleMenu(index){

@ -152,8 +152,11 @@
</view>
</view>
<view class="invite" v-if="show">
<view class="body">
<view class="content">
<view class="body">
<view class="poster">
<image mode="widthFix" :src="poster"></image>
</view>
<!-- <view class="content">
<image class="avatar" :src="userInfo.faceImage?userInfo.faceImage:userInfo.img"></image>
<view class="name">{{userInfo.nickname}}</view>
<image class="txt" src="@/static/txt.png"></image>
@ -161,7 +164,7 @@
<view class="txt1">-长按识别图中二维码-</view>
<view class="id">邀请码{{userInfo.invitationCode}}</view>
<image class="zw" src="@/static/zw.png"></image>
</view>
</view> -->
<view class="btns">
<view class="cancle" @click="toCancle()">取消</view>
<view class="sure" @click="toSave()">保存</view>
@ -191,7 +194,8 @@
userInfo: {},
baseUrl: "",
info: {},
qrcode: ""
qrcode: "",
poster: ""
}
},
onLoad() {
@ -223,11 +227,14 @@
}
},
toSave() {
if(!this.poster){
return ;
}
uni.showLoading({
title: "正在保存"
})
uni.downloadFile({
url:"https://shejiao.njlvguo.com/uploads/erweima.jpg",
url: this.poster,
complete:(res)=>{
uni.hideLoading();
uni.saveImageToPhotosAlbum({
@ -412,7 +419,7 @@
this.getUserInfo();
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -427,7 +434,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -487,6 +494,13 @@
color: #FFFFFF;
line-height: 90rpx;
}
}
.poster{
width: 100%;
height: 980rpx;
background: #FFFFFF;
border-radius: 20rpx;
text-align: center;
}
.content{
width: 100%;

@ -181,7 +181,7 @@
this.huiyuanInfo = data;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -197,7 +197,7 @@
}
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -10,31 +10,48 @@
<view class="chat-hd" v-if="list.length>0">
<u-notice-bar style="width: 100%;" :volume-icon="false" mode="horizontal" :list="list"></u-notice-bar>
</view>
<scroll-view class="chat-bd" scroll-y :class="list.length==0?(isOpen?'chat-bd-active1':'chat-bd-active'):(isOpen?'chat-bd-on':'')">
<view class="item" :class="userId != a.rightUserId?'item-on':''" v-for="(a,index) in chatList" :key="index">
<template v-if="userId != a.rightUserId">
<view class="fr">
<view class="desc">{{a.message}}</view>
</view>
<view class="fl"><image :src="a.leftFaceImage"></image></view>
</template>
<template v-else>
<view class="fl"><image :src="a.rightFaceImage"></image></view>
<view class="fr">
<view class="name">李大花<text>陪玩师</text></view>
<view class="desc" v-if="a.type == 6 || a.type==3">{{a.message}}</view>
<view class="gift" v-if="a.type == 5">送出礼物<image mode="widthFix" src="/static/logo.png"></image>棒棒糖<text>X3</text></view>
<view class="yinping" v-if="a.type == 1">
<image src="@/static/chat-03.png"></image> 8
</view>
<view class="video" v-if="a.type == 2">
<video src=""></video>
<scroll-view id="wrapper" class="chat-bd"
:class="list.length==0?(isOpen?'chat-bd-active1':'chat-bd-active'):(isOpen?'chat-bd-on':'')"
:scroll-y="true"
:scroll-with-animation="true"
:scroll-top="wrapperScrollHeight"
>
<view id="wrapper">
<view class="item" :class="userId != a.rightUserId?'item-on':''" v-for="(a,index) in chatList" :key="index">
<template v-if="userId != a.rightUserId">
<view class="fr">
<view class="desc" v-if="a.type == 6 || a.type==3">{{a.message}}</view>
<view class="gift" v-if="a.type == 5">送出礼物<image mode="widthFix" :src="a.message"></image>棒棒糖<text>X{{a.num}}</text></view>
<view class="yinping" v-if="a.type == 1">
<image :src="a.message"></image> {{a.num}}
</view>
<view class="video" v-if="a.type == 2">
<video :src="a.message"></video>
</view>
<view class="img" v-if="a.type == 4">
<image :src="a.message"></image>
</view>
</view>
<view class="img" v-if="a.type == 4">
<image src="/static/pic.jpg"></image>
<view class="fl"><image :src="a.leftFaceImage"></image></view>
</template>
<template v-else>
<view class="fl"><image :src="a.rightFaceImage"></image></view>
<view class="fr">
<view class="name">{{a.rightNickname}}<text v-if="a.rightRole == 2">陪玩师</text></view>
<view class="desc" v-if="a.type == 6 || a.type==3">{{a.message}}</view>
<view class="gift" v-if="a.type == 5">送出礼物<image mode="widthFix" :src="a.message"></image>棒棒糖<text>X{{a.num}}</text></view>
<view class="yinping" v-if="a.type == 1">
<image :src="a.message"></image> {{a.num}}
</view>
<view class="video" v-if="a.type == 2">
<video :src="a.message"></video>
</view>
<view class="img" v-if="a.type == 4">
<image :src="a.message"></image>
</view>
</view>
</view>
</template>
</template>
</view>
</view>
</scroll-view>
<view class="chat-fd">
@ -50,10 +67,10 @@
</view>
</view>
<view class="input" v-else>
<view class="star" v-if="isPlay">开始录音</view>
<view class="star" v-else>停止录音</view>
<view class="star" @click="toOpen()" v-if="isPlay">开始录音</view>
<view class="star" @click="toEnd()" v-else>停止录音</view>
</view>
<view class="btn" @click="toSend()">
<view class="btn" @click="toSend(3)">
发送
</view>
</view>
@ -64,12 +81,41 @@
<image @click="openGift()" src="@/static/chat-liwu.png"></image>
</view>
</view>
<u-popup v-model="show" mode="top" :mask-close-able='false' :zIndex="5">
<view class="permissions_box">
当您使用APP时为了使用录音的功能我们需要申请麦克风权限
</view>
</u-popup>
<u-popup v-model="show1" mode="bottom" :mask-close-able='false'>
<view class="giftPopup">
<view class="title">礼物<image @click="closeGift()" src="/static/cha.png"></image></view>
<view class="content">
<swiper class="swiper" @change="changeswiper">
<swiper-item v-for="i in giftListNum" :key="i">
<template v-for="(a,idx) in giftList">
<view class="item" v-if="(8*(i-1))<idx < 8*i" :key="idx" @click="tabItem(idx)" :class="idx == tabIndex?'item-on':''">
<image mode="heightFix" :src="a.imgurl"></image>
<view class="txt">{{a.name}}</view>
<view class="num">{{a.price}}金币</view>
</view>
</template>
</swiper-item>
</swiper>
<view class="indicator-dots" v-if="giftListNum >= 2">
<view class="indicator-dots-item" v-for="i in giftListNum" :key="i" :class="[current == i ? 'indicator-dots-active' : '']"></view>
</view>
</view>
<view class="fd">
<view class="a">金币{{balanceInfo.userBalance}}</view>
<view class="b">充值<image src="@/static/icon-arrow.png"></image></view>
<view class="c">
<input v-model="num" />
</view>
<view class="btn" @click="toZengsong()">赠送</view>
</view>
</view>
</u-popup>
<insufficient :isCoins="isCoins" />
</view>
</template>
@ -85,7 +131,12 @@
export default {
data() {
return {
wrapperScrollHeight: 0,
tabIndex: 0,
id: "",
current: 1,
show1: false,
isCoins: false,
isToggle: true,
isOpen: false,
title: "",
@ -98,7 +149,11 @@
img: "",
show: false,
isPlay: true,
count: 0,
balanceInfo: {},
num: 1,
giftList: [],
giftListNum: 1
};
},
onLoad(o) {
@ -106,27 +161,126 @@
this.id = o.id;
this.getUserInfo();
this.getChatList();
this.userBalance();
},
onReady() {
const that = this;
this.toImLogin()
recorderManager.onStop(function (res) {
that.uploadVideo(res.tempFilePath);
that.uploadAudio(res.tempFilePath);
clearInterval(timer);
that.count = 0
that.isPlay = true
});
innerAudioContext.onEnded(res=>{
that.isPlay = false
})
//
// //
// zim.on('receivePeerMessage', function (zim, { messageList, fromConversationID }) {
// console.log('receivePeerMessage', messageList, fromConversationID);
// });
},
methods: {
//type:1. 2. 3. 4 56
async giftGiving() {
await this.$api.giftGiving({
"userId": uni.getStorageSync("userInfo").id, //ID
"acceptUserId": this.id, //ID
"giftId": this.giftList[this.tabIndex].id, //ID
"num": this.num //
})
},
toZengsong() {
const that = this;
if(this.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
if(this.balanceInfo.isBlack >= this.giftList[this.tabIndex].price*that.num){
that.isCoins = true;
return ;
}
that.img = this.giftList[this.tabIndex].id
that.count = that.num
that.toSend(5)
},
tabItem(index){
this.tabIndex = index;
},
async getGift() {
const { code, data } = await this.$api.giftList({
userId: uni.getStorageSync("userInfo").id,
limit: 999,
page: 1
})
if(code == 200){
this.giftList = data.list;
this.giftListNum = Math.ceil(data.total/8)
}
},
closeGift(){
this.show1 = false;
this.isOpen = false;
},
openGift(){
if(this.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
this.show1 = true;
this.getGift();
this.isOpen = false;
},
changeswiper(e){
this.current = e.detail.current
},
toEnd() {
recorderManager.stop();
},
toToggle() {
this.isToggle = !this.isToggle
this.isOpen = false;
},
//
async userBalance() {
const { code, data } = await this.$api.userBalance({
userId: uni.getStorageSync("userInfo").id
})
if(code == 200){
this.balanceInfo = data
/***
"videoCoins": 0, //
"wordVoiceDiscount": 0, //0
"voiceCoins": 0, //
"wordCoins": 0, //
"userBalance": 1 //
*/
}
},
//
async socialConsumption(type) {
await this.$api.socialConsumption({
userId: uni.getStorageSync("userInfo").id,
sellerId: this.info.userid,
type,
duration: type==1?this.count: ""
})
},
toOpen(){
const that = this;
// {"userId":"123","sellerId":"4575676878","type":3} type:1. 2. 3. 4 56
// console.log(111)
// console.log(JSON.stringify({"userId": uni.getStorageSync("userInfo").id,sellerId:this.id, type:3,"topic":"message"}))
// uni.sendSocketMessage({data:JSON.stringify({"userId": uni.getStorageSync("userInfo").id,sellerId:this.id, type:3,"topic":"message"})});
// return ;
// APP
if(uni.getSystemInfoSync().platform == 'android') {
plus.android.checkPermission(
@ -136,10 +290,7 @@
that.show=true
}else{
that.show=false
if(that.isPlay){
innerAudioContext.pause();
that.isPlay = false
}
that.toLuyin();
}
},
error => {
@ -149,6 +300,18 @@
that.requestAndroidPermission('android.permission.RECORD_AUDIO')
return ;
}
that.toLuyin();
},
toLuyin() {
const that = this;
clearInterval(timer)
that.isPlay = false;
timer = setInterval(()=>{
that.count++
},1000)
recorderManager.start({
format: "mp3"
})
},
recorderAuthModal: function () {
const that = this;
@ -175,8 +338,22 @@
}
},
//
uploadVideo(filePath) {
const that = this
uploadAudio(filePath) {
const that = this;
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
if(uni.getStorageSync("userInfo").sex == 1){
if(that.balanceInfo.wordCoins <= 0){
that.isCoins=true;
return ;
}
}
uni.uploadFile({
name: 'file',
url: that.$baseUrl+'/prod-api/common/upload',
@ -185,6 +362,7 @@
const {code, fileName, url, msg} = JSON.parse(res.data);
if(code == 200){
that.img = url
this.toSend(1)
}
},
fail: (err) => {
@ -194,12 +372,36 @@
},
//
uploadVideo() {
const that = this
const that = this;
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
uni.chooseVideo({
count: 1,
sourceType: ["album", "camera"],
success: (res1) => {
console.log(res1)
that.count = res1.duration;
return ;
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
if(uni.getStorageSync("userInfo").sex == 1){
if(that.balanceInfo.wordCoins <= 0){
that.isCoins=true;
return ;
}
}
uni.uploadFile({
name: 'file',
url: that.$baseUrl+'/prod-api/common/upload',
@ -208,6 +410,7 @@
const {code, fileName, url, msg} = JSON.parse(res.data);
if(code == 200){
that.img = url
this.toSend(2)
}
},
fail: (err) => {
@ -223,20 +426,44 @@
//
uploadImg() {
const that = this
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
uni.chooseImage({
count: 1,
sizeType: ["original"], //
sourceType: ["album", "camera"],
success: (res1) => {
console.log(res1)
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
if(uni.getStorageSync("userInfo").sex == 1){
if(that.balanceInfo.wordCoins <= 0){
that.isCoins=true;
return ;
}
}
uni.uploadFile({
name: 'file',
url: that.$baseUrl+'/prod-api/common/upload',
filePath: res1.tempFilePath,
filePath: res1.tempFilePaths[0],
success: (res) => {
//1. 2. 3. 4 5
const {code, fileName, url, msg} = JSON.parse(res.data);
if(code == 200){
that.img = url
that.toSend(4)
}
},
fail: (err) => {
@ -249,7 +476,49 @@
}
});
},
toSend() {},
// type:1. 2. 3. 4 56
async toSend(type) {
const that = this;
if(type == 3){
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
position: "bottom",
icon: "none",
})
return ;
}
if(uni.getStorageSync("userInfo").sex == 1){
if(that.balanceInfo.wordCoins >= 1){
that.isCoins=true;
return ;
}
}
}
const { code, data } = await this.$api.chat({
userId: uni.getStorageSync("userInfo").id,
sellerId: that.id,
type,
num: (that.count+1),
message: type == 3?that.content: that.img
})
if(code == 200){
if(type==5){
this.giftGiving();
}
that.isOpen = false;
that.isToggle = true;
that.show1 = false;
this.socialConsumption();
this.getChatList();
this.userBalance();
this.content=""
this.count = 0;
this.num = 1;
}
},
//
toImLogin() {
// zim.login(uni.getStorageSync("userInfo").id, {
@ -266,9 +535,20 @@
// });
},
async getChatList(){
const that = this;
const { code, data , msg } = await this.$api.findChatList({formUserId: uni.getStorageSync("userInfo").id,toUserId: this.id});
if(code == 200){
this.chatList= data;
setTimeout(()=>{
let wrapper = uni.createSelectorQuery().in(this).select('#wrapper');
wrapper.fields({
size: true,
scrollOffset: true
}, data => {
console.log("得到节点信息" + JSON.stringify(data));
that.wrapperScrollHeight = data.scrollHeight
}).exec()
},100)
}
},
async getUserInfo() {
@ -280,7 +560,7 @@
this.getConfigData();
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -292,16 +572,38 @@
let res1 = await that.$api.getConfigData({dictType: 'CONFIG_MESSAGE_NOTICE'});
that.list = [res1.data.content]
},
//
async toYichu(type) {
//
async toCareOrCancel() {
const { code, data , msg } = await this.$api.careOrCancel({
userId: uni.getStorageSync("userInfo").id,
sellerId: this.id,
type: this.userInfo.isCare == 0?1:2
});
if(code == 200){
uni.showToast({
title: this.userInfo.isCare == 0?"关注成功":"取消关注"
})
setTimeout(()=>{
this.getUserInfo(1)
},2000)
}else{
uni.showToast({
title: msg,
position: "bottom",
icon: "none",
})
}
},
//
async toYichu() {
const { code, data } = await this.$api.addOrRemoveBlacklist({
userId: uni.getStorageSync("userInfo").id,
sellerId: this.id,
type
type: this.userInfo.isBlack == 0?1:2
})
if(code == 200){
uni.showToast({
title: type == 2?"移除成功":"加入成功"
title:this.userInfo.isBlack == 1?"移除成功":"加入成功"
})
setTimeout(()=>{
this.getInfo();
@ -309,10 +611,23 @@
}
},
toSheet() {
const that = this;
uni.showActionSheet({
itemList: this.itemList,
success(res){
console.log(res.tapIndex)
if(res.tapIndex == 0){
uni.navigateTo({
url: "/pages/peiwan/detail?id="+that.id
})
}else if(res.tapIndex == 1){
that.toCareOrCancel()
}else if(res.tapIndex == 2){
uni.navigateTo({
url: "/pages/users/feedback/index?type=2&id="+that.id
})
}else if(res.tapIndex == 3){
that.toYichu()
}
}
})
},
@ -328,6 +643,139 @@
<style scoped lang="scss">
.chat{
.giftPopup{
padding: 40rpx 25rpx;
overflow: hidden;
position: relative;
.title{
text-align: center;
font-weight: 500;
font-size: 36rpx;
color: #333333;
image{
width: 50rpx;
height: 50rpx;
right: 20rpx;
top: 40rpx;
z-index: 2;
position: absolute;
}
}
.content{
width: 110%;
overflow: hidden;
margin-bottom: 40rpx;
swiper{
height: 450rpx;
}
.indicator-dots{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.indicator-dots-item{
width: 12rpx;
height: 12rpx;
background: #000000;
border-radius: 50%;
opacity: 0.4;
margin: 0 6rpx;
&.indicator-dots-active{
width: 30rpx;
height: 12rpx;
background: #000000;
border-radius: 6rpx;
}
}
}
.item{
width: 166rpx;
height: 180rpx;
background: #F5F5F5;
border-radius: 20rpx;
border: 1px solid #F5F5F5;
text-align: center;
padding: 5rpx;
box-sizing: border-box;
float: left;
margin-right: 13rpx;
margin-top: 30rpx;
image{
height: 90rpx;
}
.txt{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-weight: 500;
font-size: 24rpx;
color: #333333;
margin-top: 5rpx;
}
.num{
overflow: hidden;
font-weight: 500;
font-size: 22rpx;
color: #999;
margin-top: 5rpx;
}
&-on{
border: 1px solid #000;
}
}
}
.fd{
display: flex;
align-items: center;
border-top: 1px solid #EAEAEA;
padding-top: 40rpx;
justify-content: space-between;
.a{
font-weight: 500;
font-size: 30rpx;
color: #333333;
}
.b{
font-weight: 500;
font-size: 24rpx;
color: #333333;
display: flex;
align-items: center;
image{
width: 40rpx;
height: 40rpx;
margin-top: -1px;
}
}
.c{
input{
width: 166rpx;
background: #FFFFFF;
border-radius: 80rpx;
text-align: center;
border: 1px solid #CCCCCC;
font-weight: 500;
height: 80rpx;
font-size: 30rpx;
color: #333333;
display: block;
}
}
.btn{
width: 166rpx;
line-height: 80rpx;
background: linear-gradient(0deg, #000000, #3D3B38);
box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
border-radius: 80rpx;
text-align: center;
height: 80rpx;
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
}
}
}
&-navbar{
width: 100%;
.slot-wrap{
@ -477,6 +925,19 @@
float: right;
background: #EAEBEB;
border-radius: 0px 30rpx 30rpx 30rpx;
margin: 0;
}
.video{
float: right;
}
.img{
float: right;
}
.video{
float: right;
}
.gift{
float: right;
}
}
}

@ -11,7 +11,7 @@
<view class="user">
<view class="pic" @click="toNext(userInfo.faceImage?1:3)">
<image class="avatar" v-if="userInfo.faceImage" :src="userInfo.faceImage"></image>
<image class="avatar" v-else :src="baseUrl+userInfo.img"></image>
<image class="avatar" v-else :src="userInfo.img"></image>
<image class="xiangji" src="@/static/xiangji.png"></image>
</view>
</view>
@ -344,7 +344,7 @@
this.getDictDataByType();
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -34,7 +34,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -200,7 +200,7 @@
this.distance = data.distance;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -222,7 +222,7 @@
this.isShow = data.totalCount == 0?true:false;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})
@ -242,7 +242,7 @@
this.getDictDataByType();
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -56,7 +56,7 @@
},2000)
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -70,7 +70,7 @@
},2000)
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -168,7 +168,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -26,7 +26,7 @@
this.userInfo = data;
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -93,7 +93,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

@ -28,7 +28,7 @@
uni.setStorageSync("userInfo",data);
}else{
uni.showToast({
title: mgs,
title: msg,
position: "bottom",
icon: "none",
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@ -1 +1 @@
https://console-docs.apipost.cn/preview/fcdafa982d33921a/a79bbc0bf3e503dc
https://doc.apipost.net/docs/detail/35f67e647c03000?target_id=570a8c3
Loading…
Cancel
Save