优化页面
This commit is contained in:
209
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.js
vendored
Normal file
209
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.js
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const components_NationalDictionary = require("../../../../components/NationalDictionary.js");
|
||||
const components_request = require("../../../../components/request.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
genders: 0,
|
||||
//性别
|
||||
Gender: [
|
||||
{ label: "男", value: 1 },
|
||||
{ label: "女", value: 2 }
|
||||
],
|
||||
Country: components_NationalDictionary.optionsArray,
|
||||
countrys: "",
|
||||
//国家
|
||||
nameAnchor: "",
|
||||
//主播名称
|
||||
Display: false,
|
||||
Hint: false,
|
||||
id: null,
|
||||
//用户id
|
||||
sendingTime: "",
|
||||
//发送时间
|
||||
filterable: true,
|
||||
//是否可搜索
|
||||
AnchorProfilePicture: ""
|
||||
//主播头像
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.id = res.data.id;
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//性别
|
||||
gender(item) {
|
||||
this.genders = item.value;
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/addStreamer/addStreamer.vue:133", item);
|
||||
},
|
||||
//国家
|
||||
country(item) {
|
||||
this.countrys = item.value;
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/addStreamer/addStreamer.vue:138", item);
|
||||
},
|
||||
handleOverlayClick(event) {
|
||||
if (event.target === this.$el) {
|
||||
this.Display = false;
|
||||
this.Hint = false;
|
||||
}
|
||||
},
|
||||
open() {
|
||||
if (this.Display) {
|
||||
this.Display = false;
|
||||
this.Hint = false;
|
||||
this.nameAnchor = "";
|
||||
this.genders = 0;
|
||||
this.countrys = "";
|
||||
} else {
|
||||
this.Display = true;
|
||||
}
|
||||
},
|
||||
//获取主播名称以及头像地址
|
||||
blur(event) {
|
||||
if (this.nameAnchor !== event.target.value) {
|
||||
this.nameAnchor = event.target.value;
|
||||
common_vendor.index.showLoading({
|
||||
title: "正在验证主播",
|
||||
mask: true
|
||||
});
|
||||
common_vendor.index.request({
|
||||
url: "https://python.yolojt.com/api/" + this.nameAnchor,
|
||||
success: (res) => {
|
||||
if (res.data.code === 200) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "查询成功",
|
||||
icon: "none",
|
||||
duration: 3e3
|
||||
});
|
||||
this.AnchorProfilePicture = res.data.data;
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "未查询到该主播",
|
||||
icon: "none",
|
||||
duration: 3e3
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function(res) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none",
|
||||
duration: 3e3
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
},
|
||||
async Publish() {
|
||||
if (this.nameAnchor === "" || this.genders === 0 || this.countrys === "" || this.AnchorProfilePicture === "") {
|
||||
this.Hint = true;
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showLoading({
|
||||
title: "添加中...",
|
||||
mask: true
|
||||
});
|
||||
await components_request.request({
|
||||
url: "anchor/add",
|
||||
method: "POST",
|
||||
data: {
|
||||
anchorId: this.nameAnchor,
|
||||
headerIcon: this.AnchorProfilePicture,
|
||||
gender: this.genders,
|
||||
country: this.countrys,
|
||||
createUserId: this.id
|
||||
},
|
||||
userInfo: true
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.Display = false;
|
||||
this.Hint = false;
|
||||
this.nameAnchor = "";
|
||||
this.genders = 0;
|
||||
this.AnchorProfilePicture = "";
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "添加成功",
|
||||
icon: "success",
|
||||
duration: 2e3
|
||||
});
|
||||
this.$emit("Refresh");
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "添加失败" + res.msg,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_wht_select2 = common_vendor.resolveComponent("wht-select");
|
||||
_easycom_wht_select2();
|
||||
}
|
||||
const _easycom_wht_select = () => "../../../../uni_modules/wht-select/components/wht-select/wht-select.js";
|
||||
if (!Math) {
|
||||
_easycom_wht_select();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $data.Display
|
||||
}, $data.Display ? common_vendor.e({
|
||||
b: common_vendor.o$1(($event) => $options.open()),
|
||||
c: common_vendor.o$1((...args) => _ctx.NameAnchor && _ctx.NameAnchor(...args)),
|
||||
d: common_vendor.o$1((...args) => $options.blur && $options.blur(...args)),
|
||||
e: $data.nameAnchor === "" && $data.Hint === true
|
||||
}, $data.nameAnchor === "" && $data.Hint === true ? {} : {}, {
|
||||
f: common_vendor.o$1($options.country),
|
||||
g: common_vendor.p({
|
||||
backgroundColor: "#ffffff",
|
||||
placeholderColor: "#666666",
|
||||
textColor: "#666666",
|
||||
borderColor: "#ffffff",
|
||||
options: $data.Country,
|
||||
filterable: $data.filterable,
|
||||
placeholder: "请选择国家"
|
||||
}),
|
||||
h: $data.countrys === "" && $data.Hint === true
|
||||
}, $data.countrys === "" && $data.Hint === true ? {} : {}, {
|
||||
i: common_vendor.o$1($options.gender),
|
||||
j: common_vendor.p({
|
||||
backgroundColor: "#ffffff",
|
||||
placeholderColor: "#666666",
|
||||
textColor: "#666666",
|
||||
borderColor: "#ffffff",
|
||||
options: $data.Gender,
|
||||
placeholder: "性别"
|
||||
}),
|
||||
k: $data.genders === 0
|
||||
}, $data.genders === 0 ? {} : {}, {
|
||||
l: $data.genders === 1
|
||||
}, $data.genders === 1 ? {} : {}, {
|
||||
m: $data.genders === 2
|
||||
}, $data.genders === 2 ? {} : {}, {
|
||||
n: $data.genders === 0 && $data.Hint === true
|
||||
}, $data.genders === 0 && $data.Hint === true ? {} : {}, {
|
||||
o: common_vendor.o$1(($event) => $options.Publish()),
|
||||
p: common_vendor.o$1(() => {
|
||||
}),
|
||||
q: common_vendor.n($data.Display ? "create-module" : "close-animation "),
|
||||
r: common_vendor.o$1(($event) => $options.open())
|
||||
}) : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a0301f10"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wht-select": "../../../../uni_modules/wht-select/components/wht-select/wht-select"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view wx:if="{{a}}" class="{{['data-v-a0301f10', q, 'Mask']}}" bindtap="{{r}}"><view catchtap="{{p}}" class="containers data-v-a0301f10"><view class="container data-v-a0301f10"><image class="Fork data-v-a0301f10" bindtap="{{b}}" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Fork.png" mode="scaleToFill"/><view class="Titlecss data-v-a0301f10"><view class="Star data-v-a0301f10"></view><view class="Title data-v-a0301f10">添加我的主播</view><view class="Star data-v-a0301f10"></view></view><view class="NameAnchor data-v-a0301f10"><input class="NameAnchorcss data-v-a0301f10" cursor-color="#666666" placeholder-style="color:#666666" bindinput="{{c}}" placeholder="主播名称" bindblur="{{d}}"/><view wx:if="{{e}}" class="Hint data-v-a0301f10">请检查主播名称是否正确</view></view><view class="Accountnumber data-v-a0301f10"><view class="Coins country data-v-a0301f10"><wht-select wx:if="{{g}}" class="data-v-a0301f10" style="width:350rpx" bindchange="{{f}}" u-i="a0301f10-0" bind:__l="__l" u-p="{{g}}"/><view wx:if="{{h}}" class="Hint data-v-a0301f10">请选择国家</view></view><view class="Gender data-v-a0301f10"><view class="Gendercs data-v-a0301f10"><view class="Gendercss data-v-a0301f10"><wht-select wx:if="{{j}}" class="data-v-a0301f10" style="width:300rpx" bindchange="{{i}}" u-i="a0301f10-1" bind:__l="__l" u-p="{{j}}"/></view><view class="Gendericoncss data-v-a0301f10"><image wx:if="{{k}}" class="Gendericon data-v-a0301f10" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/ask.png" mode="scaleToFill"/><image wx:if="{{l}}" class="Gendericon data-v-a0301f10" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/man.png" mode="scaleToFill"/><image wx:if="{{m}}" class="Gendericon data-v-a0301f10" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/girl.png" mode="scaleToFill"/></view></view><view wx:if="{{n}}" class="Hintcss data-v-a0301f10">请选择性别</view></view></view><view class="Publish data-v-a0301f10"><button bindtap="{{o}}" class="Publishcss data-v-a0301f10">添加主播</button></view></view></view></view>
|
||||
201
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.wxss
vendored
Normal file
201
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/addStreamer/addStreamer.wxss
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
|
||||
/* 定义动画 */
|
||||
/* 原始进入动画 */
|
||||
@keyframes slide-in-a0301f10 {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 进入动画类 */
|
||||
.create-module.data-v-a0301f10 {
|
||||
animation: slide-in-a0301f10 0.3s ease-in-out;
|
||||
}
|
||||
.Mask.data-v-a0301f10 {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #00000076;
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
.Hint.data-v-a0301f10 {
|
||||
color: rgb(255, 0, 0);
|
||||
font-size: 20rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.Hintcss.data-v-a0301f10 {
|
||||
color: rgb(255, 0, 0);
|
||||
font-size: 20rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.containers.data-v-a0301f10 {
|
||||
background-color: #ffffff;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
.container.data-v-a0301f10 {
|
||||
display: flex;
|
||||
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/bgv.png);
|
||||
background-size: 100% 100%;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 1000rpx;
|
||||
border-radius: 50rpx;
|
||||
box-shadow: 0 0 10rpx #ccc;
|
||||
}
|
||||
.Fork.data-v-a0301f10 {
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
margin-top: 20rpx;
|
||||
/* margin-bottom: 40rpx; */
|
||||
margin-left: 90%;
|
||||
}
|
||||
.Titlecss.data-v-a0301f10 {
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.Star.data-v-a0301f10 {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/star.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.Title.data-v-a0301f10 {
|
||||
width: 430rpx;
|
||||
height: 70rpx;
|
||||
/* background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Publishpk.png); */
|
||||
background-size: 100% 200%;
|
||||
background-position: 0 100%;
|
||||
margin-left: 26rpx;
|
||||
margin-right: 26rpx;
|
||||
font-size:50rpx;
|
||||
line-height: 70rpx;
|
||||
background: linear-gradient(135deg, #019fa1, #9ddbdc);
|
||||
-webkit-background-clip: text; /* 兼容 WebKit 内核 */
|
||||
background-clip: text;
|
||||
color: transparent; /* 隐藏原文字颜色 */
|
||||
-webkit-text-fill-color: transparent; /* Safari 兼容 */
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
font-style: italic;
|
||||
}
|
||||
.Individual.data-v-a0301f10 {
|
||||
display: flex;
|
||||
/* justify-content: center; */
|
||||
}
|
||||
.NameAnchor.data-v-a0301f10 {
|
||||
width: 90%;
|
||||
margin: 40rpx;
|
||||
}
|
||||
.time.data-v-a0301f10 {
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
.NameAnchorcss.data-v-a0301f10 {
|
||||
width: 99%;
|
||||
height: 85rpx;
|
||||
background-color: #ffffff;
|
||||
border: 1rpx solid #bfbfbf;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.Gender.data-v-a0301f10 {
|
||||
width: 310rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.Gendercs.data-v-a0301f10 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
/* align-items: center; */
|
||||
}
|
||||
.Gendercss.data-v-a0301f10 {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
.Gendericoncss.data-v-a0301f10 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
border: 1rpx solid #ff9d0067;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.Gendericon.data-v-a0301f10 {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
/* margin-top: 10rpx;
|
||||
margin-right: 40rpx; */
|
||||
}
|
||||
.Accountnumber.data-v-a0301f10 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 60rpx;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
.Coins.data-v-a0301f10 {
|
||||
width: 330rpx;
|
||||
height: 65rpx;
|
||||
/* display: flex; */
|
||||
margin-right: 50rpx;
|
||||
/* flex-direction: column; */
|
||||
}
|
||||
.country.data-v-a0301f10 {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.goldCoin.data-v-a0301f10 {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.number-box.data-v-a0301f10 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
.number-box-title.data-v-a0301f10 {
|
||||
color: #191919;
|
||||
font-size: 30rpx;
|
||||
margin-right: 22rpx;
|
||||
margin-left: 17rpx;
|
||||
}
|
||||
.number-box-unit.data-v-a0301f10 {
|
||||
color: #03aba8;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border: 1rpx solid #03aba8;
|
||||
border-radius: 50%;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
/* color: #003cff5a; */
|
||||
}
|
||||
.Publish.data-v-a0301f10 {
|
||||
margin-top: 300rpx;
|
||||
margin-bottom: 40rpx;
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
}
|
||||
.Publishcss.data-v-a0301f10 {
|
||||
background-image: linear-gradient(135deg, #4fcacd, #5fdbde);
|
||||
/* color: #33ff00; */
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user