Commit 4f2a2f73 by liuliufashi
parents a8b7d2d0 28a8ac21
<script> <script>
export default { export default {
onLaunch() { 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) { .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 room_id = window.location.href.slice(window.location.href.indexOf('/', 10) + 1, 9999)
var reg1 = new RegExp("/", "g") var reg1 = new RegExp("/", "g")
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
room_id = room_id.replace(reg2, "") room_id = room_id.replace(reg2, "")
uni.setStorageSync('room_id', room_id) uni.setStorageSync('room_id', room_id)
window.location.replace(window.location.href.slice(0, window.location.href.indexOf('/',10))) window.location.replace(window.location.href.slice(0, window.location.href.indexOf('/',10)))
} }
}, },
onShow() { onShow() {
......
...@@ -9,7 +9,18 @@ ...@@ -9,7 +9,18 @@
<span class="ml-1">{{item.sendName}}</span> <span class="ml-1">{{item.sendName}}</span>
</view> </view>
<view class="content"> <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> </view>
</view> </view>
...@@ -56,6 +67,13 @@ ...@@ -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() { go_bottom() {
var scr_msg = document.querySelector('.chat') var scr_msg = document.querySelector('.chat')
...@@ -64,6 +82,10 @@ ...@@ -64,6 +82,10 @@
}) })
this.auto_bottom = true this.auto_bottom = true
}, },
getdata(text) {
text = text.replace(/&lt;/g, '<').replace(/&gt;/g, '/>')
return text
},
//监听上滑 //监听上滑
handleScroll(e) { handleScroll(e) {
var scr_msg = document.querySelector('.chat') var scr_msg = document.querySelector('.chat')
...@@ -82,9 +104,15 @@ ...@@ -82,9 +104,15 @@
.ml-1 { .ml-1 {
margin-left: 10rpx; margin-left: 10rpx;
} }
.gift_view{
color: red;
font-size: 28rpx;
text-align: left;
width: 80%;
margin: 20rpx auto;
}
.font-14 { .font-14 {
font-size: 14rpx; font-size: 28rpx;
} }
.my-2 { .my-2 {
...@@ -111,13 +139,15 @@ ...@@ -111,13 +139,15 @@
} }
.content { .content {
line-height: 80rpx; line-height: 60rpx;
margin-left: 80rpx; margin-left: 80rpx;
.text { .text {
display: inline-block; display: inline-block;
border-radius: 10rpx; border-radius: 10rpx;
padding: 0 24rpx; max-width: 80%;
word-wrap: break-word;
padding: 10rpx 24rpx;
box-shadow: 5rpx 5rpx 10rpx #dedede; box-shadow: 5rpx 5rpx 10rpx #dedede;
} }
} }
...@@ -135,7 +165,8 @@ ...@@ -135,7 +165,8 @@
border-radius: 30rpx 0 0 30rpx; border-radius: 30rpx 0 0 30rpx;
padding: 10rpx; padding: 10rpx;
font-size: 28rpx; font-size: 28rpx;
img{
img {
width: 28rpx; width: 28rpx;
vertical-align: middle; vertical-align: middle;
height: 28rpx; height: 28rpx;
......
...@@ -2,20 +2,30 @@ ...@@ -2,20 +2,30 @@
<view class="footer"> <view class="footer">
<view class="content"> <view class="content">
<!-- 表情 --> <!-- 表情 -->
<image v-show="!inputFalg" src="../../static/images/biaoqing.png" mode="widthFix" <image v-show="!inputFalg && !faceFalg" src="../../static/images/biaoqing.png" mode="widthFix"
style="width: 68rpx;margin: 0 20rpx 0 0;" @click="faceFalg = true"> 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> </image>
<!-- 输入框 --> <!-- 输入框 -->
<view class="input"> <view class="input">
<u--input style="background-color: #d9d9d9;height: 64rpx;padding-left:20rpx;" type="text" border="none" <!-- <input style="background-color: #d9d9d9;height: 64rpx;padding-left:20rpx;border-radius: 40rpx;max-height: 192rpx;word-wrap: break-word;
shape="circle" placeholder="说点什么吧..." v-model="value" @focus="inputFocus" @blur="" width: 69%;"
confirm-type="send" @confirm="send" @keyup.enter="send"> type="text" placeholder="说点什么吧..." v-model="value" @focus="inputFocus"
</u--input> @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> </view>
<!-- <u-button style="margin: 0 0 0 20rpx;width: 20%;height: 70%;" text="发送" type="success" v-show="!inputFalg" touchend.prevent="send"> <!-- <u-button style="margin: 0 0 0 20rpx;width: 20%;height: 70%;" text="发送" type="success" v-show="!inputFalg" touchend.prevent="send">
</u-button> --> </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> 发送</button>
<!-- icon按钮 --> <!-- icon按钮 -->
<view class="icon" v-show="inputFalg"> <view class="icon" v-show="inputFalg">
...@@ -32,7 +42,13 @@ ...@@ -32,7 +42,13 @@
@specialShow="specialShow"></component> @specialShow="specialShow"></component>
</view> </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> </view>
</template> </template>
...@@ -45,7 +61,7 @@ ...@@ -45,7 +61,7 @@
import reward from "./reward/reward.vue"; import reward from "./reward/reward.vue";
import shoplist from "./shopList/shoplist.vue" import shoplist from "./shopList/shoplist.vue"
import msg from "@/components/chat/chat.vue" import msg from "@/components/chat/chat.vue"
import face from "@/until/face.js"
export default { export default {
...@@ -63,11 +79,14 @@ ...@@ -63,11 +79,14 @@
}, },
data() { data() {
return { return {
faceFalg:false, faceFalg: false,
inputFalg: true, inputFalg: true,
currentTabComponent: '', currentTabComponent: '',
show: false, show: false,
foucsinput: false,
value: '', value: '',
facelist: face.face,
exc_style: {},
imageList: [{ imageList: [{
title: "商城", title: "商城",
url: "../../static/images/shopCart.png" url: "../../static/images/shopCart.png"
...@@ -105,13 +124,20 @@ ...@@ -105,13 +124,20 @@
title: "签到", title: "签到",
url: "../../static/images/签到@2x.png" url: "../../static/images/签到@2x.png"
}, },
] ],
bqheight: 0,
}; };
}, },
methods: { methods: {
// 选择表情
changeFace(){ jp_click(e) {
this.faceFalg = true; if (e == 0) {
this.faceFalg = true
uni.hideKeyboard()
} else {
this.faceFalg = false
this.foucsinput = true
}
}, },
//提交输入 //提交输入
send() { send() {
...@@ -126,11 +152,15 @@ ...@@ -126,11 +152,15 @@
inputFocus() { inputFocus() {
this.inputFalg = false this.inputFalg = false
uni.onKeyboardHeightChange(res => { uni.onKeyboardHeightChange(res => {
this.exc_style = {
"height": res.height*2 + "rpx"
}
console.log(res.height) console.log(res.height)
}) })
}, },
inputblur() { inputblur() {
this.inputFalg = true this.inputFalg = true
this.faceFalg = false
}, },
// 图标按钮点击事件 // 图标按钮点击事件
iconbtn(title) { iconbtn(title) {
...@@ -167,7 +197,11 @@ ...@@ -167,7 +197,11 @@
// 点击发送特效 // 点击发送特效
specialShow(url) { specialShow(url) {
this.$emit("specialShow", url) this.$emit("specialShow", url)
} },
sendFace(e) {
var sendText = this.value + "[s" + e + "]"
this.value = sendText
},
} }
} }
</script> </script>
...@@ -176,16 +210,19 @@ ...@@ -176,16 +210,19 @@
.absolute { .absolute {
position: absolute; position: absolute;
} }
.footer { .footer {
padding: 10rpx 0; padding: 10rpx 0;
} }
.content { .content {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 40rpx; padding: 0 40rpx;
.input { .input {
flex: 1; flex: 1;
} }
...@@ -221,4 +258,9 @@ ...@@ -221,4 +258,9 @@
} }
} }
} }
.face_view {
height: 400rpx;
overflow-y: scroll;
}
</style> </style>
...@@ -79,8 +79,11 @@ ...@@ -79,8 +79,11 @@
}, },
send(index, i) { send(index, i) {
if (this.currentIndex != index + i.toString()) return; if (this.currentIndex != index + i.toString()) return;
this.onClose() console.log(this.datalist[index][i]);
this.$emit("specialShow", this.datalist[index][i].giftPicUrl) if(this.datalist[index][i].giftPrice == 0){
this.onClose()
this.$emit("specialShow", this.datalist[index][i].giftPicUrl)
}
}, },
} }
} }
......
<template> <template>
<u-overlay :show="show" class="flex"> <u-overlay :show="show" class="flex">
<u-notify ref="uNotify" message=""></u-notify>
<view class="box flex flex-col"> <view class="box flex flex-col">
<u-icon name="close" @click="close" class="icon" color="white" size="50"></u-icon> <u-icon name="close" @click="close" class="icon" color="white" size="50"></u-icon>
<view class="content"> <view class="content">
<view class="x-between flex"> <view class="x-between flex">
<text class="money" v-for="item in moneyList" :key="item">{{item}}</text> <text class="money" v-for="item in moneyList" :key="item">{{item}}</text>
</view> </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> </view>
<text class="font-pay">支付</text> <text class="font-pay" @click="pay_reward">支付</text>
</view> </view>
</u-overlay> </u-overlay>
</template> </template>
...@@ -20,24 +22,81 @@ ...@@ -20,24 +22,81 @@
data() { data() {
return { return {
moneyList: ["1元", "2元", "3元"], moneyList: ["1元", "2元", "3元"],
value:"" value: ""
}; };
}, },
methods: { methods: {
close() { close() {
this.$emit("onClose") 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mt-2{ .mt-2 {
margin-top: 24rpx; margin-top: 24rpx;
} }
.mt-5{
.mt-5 {
margin-top: 50rpx; margin-top: 50rpx;
} }
.flex { .flex {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -51,11 +110,13 @@ ...@@ -51,11 +110,13 @@
.x-between { .x-between {
justify-content: space-between; justify-content: space-between;
} }
.icon{
.icon {
position: absolute; position: absolute;
top: 380rpx; top: 380rpx;
right: 150rpx; right: 150rpx;
} }
.money { .money {
display: inline-block; display: inline-block;
width: 112rpx; width: 112rpx;
...@@ -66,12 +127,14 @@ ...@@ -66,12 +127,14 @@
border-radius: 10rpx; border-radius: 10rpx;
text-align: center; text-align: center;
} }
.font-pay{
.font-pay {
color: white; color: white;
font-size: 26rpx; font-size: 26rpx;
font-weight: bold; font-weight: bold;
transform: translate(0,50rpx); transform: translate(0, 50rpx);
} }
.box { .box {
width: 560rpx; width: 560rpx;
height: 678rpx; height: 678rpx;
......
...@@ -128,9 +128,9 @@ ...@@ -128,9 +128,9 @@
let timer = setTimeout(() => { let timer = setTimeout(() => {
let num = Math.floor(Math.random()*400) let num = Math.floor(Math.random()*400)
that.animation.marginTop = `${num}rpx` that.animation.marginTop = `${num}rpx`
clearTimeout(timer); that.getRandom()
getRandom() clearTimeout(timer);
},5000); },4500);
} }
}, },
} }
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
color: white; color: white;
} }
.animation{ .animation{
animation: identifier 5s infinite linear; animation: identifier 5s linear;
} }
/* 跑马灯 */ /* 跑马灯 */
@keyframes identifier { @keyframes identifier {
......
...@@ -145,8 +145,8 @@ ...@@ -145,8 +145,8 @@
title: "登录成功" title: "登录成功"
}) })
setTimeout(() => { setTimeout(() => {
location.reload(); window.location.reload();
}, 1800); }, 2000);
uni.setStorageSync("user_name", res.data.data.account); uni.setStorageSync("user_name", res.data.data.account);
uni.setStorageSync("user_headimg", res.data.data.avatar); uni.setStorageSync("user_headimg", res.data.data.avatar);
uni.setStorageSync("user_token", res.data.data.token); uni.setStorageSync("user_token", res.data.data.token);
...@@ -213,10 +213,6 @@ ...@@ -213,10 +213,6 @@
}) })
}, },
start() {}, start() {},
//判断是否微信登录成功
wx_loginok() {
},
//发起登录 //发起登录
go_login() { go_login() {
var local = window.location.href; var local = window.location.href;
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "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 @@ ...@@ -2,4 +2,4 @@
.supports('top: constant(a)')) .supports('top: constant(a)'))
document.write( document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + '<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> (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 \ 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) { ...@@ -35,7 +35,7 @@ var replace_em = function(str) {
str = str.replace(/\>/g, '&gt;'); str = str.replace(/\>/g, '&gt;');
str = str.replace(/\n/g, ''); str = str.replace(/\n/g, '');
str = str.replace(/\[s([0-9]*)\]/g, function(word) { 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 hm;
}); });
return str; 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