Commit 4f2a2f73 by liuliufashi
parents a8b7d2d0 28a8ac21
<script>
export default {
onLaunch() {
if (window.location.href.slice(window.location.href.indexOf('/', 10) + 1, 9999).length > 5 && window.location
if (window.location.href.slice(window.location.href.indexOf('/', 10) + 1, 9999).length > 35 && window.location
.href.slice(window.location.href.indexOf('/', 10) + 1, 9999).length < 55) {
var room_id = window.location.href.slice(window.location.href.indexOf('/', 10) + 1, 9999)
var reg1 = new RegExp("/", "g")
......@@ -10,7 +10,6 @@
room_id = room_id.replace(reg2, "")
uni.setStorageSync('room_id', room_id)
window.location.replace(window.location.href.slice(0, window.location.href.indexOf('/',10)))
}
},
onShow() {
......
......@@ -9,7 +9,18 @@
<span class="ml-1">{{item.sendName}}</span>
</view>
<view class="content">
<span class="text">{{item.text}}</span>
<span class="text" v-html="getdata(item.text)"></span>
</view>
<view class="gift_view" v-if="item.type==3">
<view v-if="item.text.notifyType == 5">
{{gsnickname(item.text.nickName)}}给主播送出了{{item.text.giftName}}
</view>
<view v-if="item.text.notifyType == 2">
{{gsnickname(item.text.nickName)}}给主播打赏了{{item.text.amount}}
</view>
<view v-if="item.text == 'enter'">
欢迎 {{gsnickname(item.sendName)}} 进入直播间
</view>
</view>
</view>
</view>
......@@ -56,6 +67,13 @@
})
}
},
//昵称格式化
gsnickname(val) {
var msgname = val
msgname = msgname.replace(/\d{8,}/g, "*")
msgname = msgname.length > 8 ? msgname.substring(0, 8) + "..." : msgname
return msgname
},
//返回底部
go_bottom() {
var scr_msg = document.querySelector('.chat')
......@@ -64,6 +82,10 @@
})
this.auto_bottom = true
},
getdata(text) {
text = text.replace(/&lt;/g, '<').replace(/&gt;/g, '/>')
return text
},
//监听上滑
handleScroll(e) {
var scr_msg = document.querySelector('.chat')
......@@ -82,9 +104,15 @@
.ml-1 {
margin-left: 10rpx;
}
.gift_view{
color: red;
font-size: 28rpx;
text-align: left;
width: 80%;
margin: 20rpx auto;
}
.font-14 {
font-size: 14rpx;
font-size: 28rpx;
}
.my-2 {
......@@ -111,13 +139,15 @@
}
.content {
line-height: 80rpx;
line-height: 60rpx;
margin-left: 80rpx;
.text {
display: inline-block;
border-radius: 10rpx;
padding: 0 24rpx;
max-width: 80%;
word-wrap: break-word;
padding: 10rpx 24rpx;
box-shadow: 5rpx 5rpx 10rpx #dedede;
}
}
......@@ -135,7 +165,8 @@
border-radius: 30rpx 0 0 30rpx;
padding: 10rpx;
font-size: 28rpx;
img{
img {
width: 28rpx;
vertical-align: middle;
height: 28rpx;
......
......@@ -2,20 +2,30 @@
<view class="footer">
<view class="content">
<!-- 表情 -->
<image v-show="!inputFalg" src="../../static/images/biaoqing.png" mode="widthFix"
style="width: 68rpx;margin: 0 20rpx 0 0;" @click="faceFalg = true">
<image v-show="!inputFalg && !faceFalg" src="../../static/images/biaoqing.png" mode="widthFix"
style="width: 68rpx;margin: 0 20rpx 0 0;" @touchend.prevent="jp_click(0)">
</image>
<image v-show="!inputFalg && faceFalg" src="../../static/images/jianpan.png" mode="widthFix"
style="width: 68rpx;margin: 0 20rpx 0 0;" @touchend.prevent="jp_click(1)">
</image>
<!-- 输入框 -->
<view class="input">
<u--input style="background-color: #d9d9d9;height: 64rpx;padding-left:20rpx;" type="text" border="none"
shape="circle" placeholder="说点什么吧..." v-model="value" @focus="inputFocus" @blur=""
confirm-type="send" @confirm="send" @keyup.enter="send">
</u--input>
<!-- <input style="background-color: #d9d9d9;height: 64rpx;padding-left:20rpx;border-radius: 40rpx;max-height: 192rpx;word-wrap: break-word;
width: 69%;"
type="text" placeholder="说点什么吧..." v-model="value" @focus="inputFocus"
@blur="" confirm-type="send" @confirm="send" @keyup.enter="send" id="inputdata" :focus="false">
</input> -->
<u--textarea autoHeight
style="background-color: #d9d9d9;padding-left:20rpx;border-radius: 40rpx;width: 90%;max-height: 150rpx;overflow-y: scroll;"
type="text" placeholder="说点什么吧..." v-model="value" @focus="inputFocus" @blur="inputblur"
confirm-type="send" @confirm="send" @keyup.enter="send" id="inputdata" :focus="false">
</u--textarea>
</view>
<!-- <u-button style="margin: 0 0 0 20rpx;width: 20%;height: 70%;" text="发送" type="success" v-show="!inputFalg" touchend.prevent="send">
</u-button> -->
<!-- 发送 -->
<button class="btn_send" text="发送" v-show="!inputFalg" @touchend.prevent="send" >
<button class="btn_send" text="发送" v-show="!inputFalg" @touchend.prevent="send">
发送</button>
<!-- icon按钮 -->
<view class="icon" v-show="inputFalg">
......@@ -32,7 +42,13 @@
@specialShow="specialShow"></component>
</view>
<!-- 表情框 -->
<view v-show="faceFalg" style="border: 1px solid red; height: 250rpx;"></view>
<view v-show="faceFalg" class="face_view" :style="exc_style" @touchend.prevent>
<view v-for="(item, index) in 29">
<img :src="facelist['smiley_' + (index + 1)]"
style="width: 24px;height: 24px; float: left;margin-left: 20px;margin-top: 20px;"
@touchend.prevent="sendFace(index + 1)" />
</view>
</view>
</view>
</template>
......@@ -45,7 +61,7 @@
import reward from "./reward/reward.vue";
import shoplist from "./shopList/shoplist.vue"
import msg from "@/components/chat/chat.vue"
import face from "@/until/face.js"
export default {
......@@ -63,11 +79,14 @@
},
data() {
return {
faceFalg:false,
faceFalg: false,
inputFalg: true,
currentTabComponent: '',
show: false,
foucsinput: false,
value: '',
facelist: face.face,
exc_style: {},
imageList: [{
title: "商城",
url: "../../static/images/shopCart.png"
......@@ -105,13 +124,20 @@
title: "签到",
url: "../../static/images/签到@2x.png"
},
]
],
bqheight: 0,
};
},
methods: {
// 选择表情
changeFace(){
this.faceFalg = true;
jp_click(e) {
if (e == 0) {
this.faceFalg = true
uni.hideKeyboard()
} else {
this.faceFalg = false
this.foucsinput = true
}
},
//提交输入
send() {
......@@ -126,11 +152,15 @@
inputFocus() {
this.inputFalg = false
uni.onKeyboardHeightChange(res => {
this.exc_style = {
"height": res.height*2 + "rpx"
}
console.log(res.height)
})
},
inputblur() {
this.inputFalg = true
this.faceFalg = false
},
// 图标按钮点击事件
iconbtn(title) {
......@@ -167,7 +197,11 @@
// 点击发送特效
specialShow(url) {
this.$emit("specialShow", url)
}
},
sendFace(e) {
var sendText = this.value + "[s" + e + "]"
this.value = sendText
},
}
}
</script>
......@@ -176,16 +210,19 @@
.absolute {
position: absolute;
}
.footer {
padding: 10rpx 0;
}
.content {
box-sizing: border-box;
width: 100%;
display: flex;
align-items: center;
padding: 0 40rpx;
.input {
flex: 1;
}
......@@ -221,4 +258,9 @@
}
}
}
.face_view {
height: 400rpx;
overflow-y: scroll;
}
</style>
......@@ -79,8 +79,11 @@
},
send(index, i) {
if (this.currentIndex != index + i.toString()) return;
this.onClose()
this.$emit("specialShow", this.datalist[index][i].giftPicUrl)
console.log(this.datalist[index][i]);
if(this.datalist[index][i].giftPrice == 0){
this.onClose()
this.$emit("specialShow", this.datalist[index][i].giftPicUrl)
}
},
}
}
......
<template>
<u-overlay :show="show" class="flex">
<u-notify ref="uNotify" message=""></u-notify>
<view class="box flex flex-col">
<u-icon name="close" @click="close" class="icon" color="white" size="50"></u-icon>
<view class="content">
<view class="x-between flex">
<text class="money" v-for="item in moneyList" :key="item">{{item}}</text>
</view>
<u--input class="mt-2" inputAlign="center" style="background-color: white;" placeholder="请输入其他金额" border="surround" v-model="value" @change="change"></u--input>
<u--input class="mt-2" inputAlign="center" style="background-color: white;" placeholder="请输入其他金额"
border="surround" v-model="value"></u--input>
</view>
<text class="font-pay">支付</text>
<text class="font-pay" @click="pay_reward">支付</text>
</view>
</u-overlay>
</template>
......@@ -20,24 +22,81 @@
data() {
return {
moneyList: ["1元", "2元", "3元"],
value:""
value: ""
};
},
methods: {
close() {
this.$emit("onClose")
}
},
pay_reward() {
this.$api.createwxorder(this.value,'').then(res => {
console.log(res);
if (res.data.data) {
var num = res.data.data.orderNum
var parms = res.data.data.url
var jWeixin = require('jweixin-module')
jWeixin.config({
debug: false,
appId: parms.jsapiAppid,
timestamp: parms
.timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符
nonceStr: parms.nonceStr, // 支付签名随机串,不长于 32 位
package: parms.jsapipackage, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType: parms.signType, // 微信支付V3的传入 RSA ,微信支付V2的传入格式与V2统一下单的签名格式保持一致
paySign: parms.paySign, // 支付签名
});
jWeixin.chooseWXPay({
appId: parms.jsapiAppid,
timestamp: parms
.timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符
nonceStr: parms.nonceStr, // 支付签名随机串,不长于 32 位
package: parms.jsapipackage, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType: parms.signType, // 微信支付V3的传入 RSA ,微信支付V2的传入格式与V2统一下单的签名格式保持一致
paySign: parms.paySign, // 支付签名
success: function(e) {
that.$refs.uNotify.show({
top: 30,
type: 'success',
message: '支付成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true
})
that.$api.roomwatchytypeverifyPay(num).then(res => {
console.log(res);
})
setTimeout(() => {
location.reload()
}, 1500);
},
fail: function() {
that.$refs.uNotify.show({
top: 30,
type: 'error',
message: '支付失败',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true
})
},
});
}
})
},
}
}
</script>
<style lang="scss" scoped>
.mt-2{
.mt-2 {
margin-top: 24rpx;
}
.mt-5{
.mt-5 {
margin-top: 50rpx;
}
.flex {
display: flex;
justify-content: center;
......@@ -51,11 +110,13 @@
.x-between {
justify-content: space-between;
}
.icon{
.icon {
position: absolute;
top: 380rpx;
right: 150rpx;
}
.money {
display: inline-block;
width: 112rpx;
......@@ -66,12 +127,14 @@
border-radius: 10rpx;
text-align: center;
}
.font-pay{
.font-pay {
color: white;
font-size: 26rpx;
font-weight: bold;
transform: translate(0,50rpx);
transform: translate(0, 50rpx);
}
.box {
width: 560rpx;
height: 678rpx;
......
......@@ -128,9 +128,9 @@
let timer = setTimeout(() => {
let num = Math.floor(Math.random()*400)
that.animation.marginTop = `${num}rpx`
clearTimeout(timer);
getRandom()
},5000);
that.getRandom()
clearTimeout(timer);
},4500);
}
},
}
......@@ -148,7 +148,7 @@
color: white;
}
.animation{
animation: identifier 5s infinite linear;
animation: identifier 5s linear;
}
/* 跑马灯 */
@keyframes identifier {
......
......@@ -145,8 +145,8 @@
title: "登录成功"
})
setTimeout(() => {
location.reload();
}, 1800);
window.location.reload();
}, 2000);
uni.setStorageSync("user_name", res.data.data.account);
uni.setStorageSync("user_headimg", res.data.data.avatar);
uni.setStorageSync("user_token", res.data.data.token);
......@@ -213,10 +213,6 @@
})
},
start() {},
//判断是否微信登录成功
wx_loginok() {
},
//发起登录
go_login() {
var local = window.location.href;
......
......@@ -3,7 +3,8 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "欧畅直播"
"navigationBarTitleText": "欧畅直播",
"app-plus":{"bounce":"none"}
}
}
],
......
diff a/pages/index/index.vue b/pages/index/index.vue (rejected hunks)
@@ -40,24 +40,16 @@
value: '',
currentTabComponent: 'chat',
special: "",
- msgList: [],
- scrollTop: 0,
- type: ""
+ type:""
}
},
created() {
- this.getusertoken()
},
onshow() {
},
methods: {
- //触发消息
- sendmsg(val) {
- this.send(val)
- },
skip(value) {
- console.log(value, 3)
this.currentTabComponent = value.id
this.type = value.type
},
static/images/biaoqing.png

4.53 KB | W: | H:

static/images/biaoqing.png

2.39 KB | W: | H:

static/images/biaoqing.png
static/images/biaoqing.png
static/images/biaoqing.png
static/images/biaoqing.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -2,4 +2,4 @@
.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.2772579d.css><script src="http://pv.sohu.com/cityjson?ie=utf-8"></script><script src=https://static.oclive.cn/live.player_commons_5.2.js></script><link rel=stylesheet href=https://g.alicdn.com/de/prismplayer/2.9.19/skins/default/aliplayer-min.css><link href=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/tcplayer.min.css rel=stylesheet><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/libs/TXLivePlayer-1.2.3.min.js></script><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/libs/hls.min.1.1.5.js></script><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/libs/flv.min.1.6.3.js></script><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/tcplayer.v4.5.4.min.js></script><script src=//unpkg.byted-static.com/xgplayer/2.31.6/browser/index.js charset=utf-8></script><script src=//unpkg.byted-static.com/xgplayer-hls/2.5.2/dist/index.min.js charset=utf-8></script></head><body><div id=app></div><script src=/static/js/chunk-vendors.eceae362.js></script><script src=/static/js/index.0be919bd.js></script></body></html>
\ No newline at end of file
(coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.2772579d.css><script src="http://pv.sohu.com/cityjson?ie=utf-8"></script><script src=https://static.oclive.cn/live.player_commons_5.2.js></script><link rel=stylesheet href=https://g.alicdn.com/de/prismplayer/2.9.19/skins/default/aliplayer-min.css><link href=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/tcplayer.min.css rel=stylesheet><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/libs/TXLivePlayer-1.2.3.min.js></script><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/libs/hls.min.1.1.5.js></script><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/libs/flv.min.1.6.3.js></script><script src=https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.4/tcplayer.v4.5.4.min.js></script><script src=//unpkg.byted-static.com/xgplayer/2.31.6/browser/index.js charset=utf-8></script><script src=//unpkg.byted-static.com/xgplayer-hls/2.5.2/dist/index.min.js charset=utf-8></script></head><body><div id=app></div><script src=/static/js/chunk-vendors.eceae362.js></script><script src=/static/js/index.cccbe1d9.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -35,7 +35,7 @@ var replace_em = function(str) {
str = str.replace(/\>/g, '&gt;');
str = str.replace(/\n/g, '');
str = str.replace(/\[s([0-9]*)\]/g, function(word) {
var hm = '<img src="'+expr_lib_obj['smiley_'+word.replace(/[^0-9]/ig,"")]+'" style="width:30px;height:30px;"/>';
var hm = '<img src="'+expr_lib_obj['smiley_'+word.replace(/[^0-9]/ig,"")]+'" style="width:28px;height:28px;vertical-align: middle;"/>';
return hm;
});
return str;
......
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