优化页面
This commit is contained in:
282
unpackage/dist/dev/mp-weixin/NewAddedPk.js
vendored
282
unpackage/dist/dev/mp-weixin/NewAddedPk.js
vendored
@@ -1,282 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("./common/vendor.js");
|
||||
const components_NationalDictionary = require("./components/NationalDictionary.js");
|
||||
const components_request = require("./components/request.js");
|
||||
const common_assets = require("./common/assets.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
genders: 0,
|
||||
//性别
|
||||
Gender: [
|
||||
{ label: "男", value: 1 },
|
||||
{ label: "女", value: 2 }
|
||||
],
|
||||
Country: components_NationalDictionary.optionsArray,
|
||||
countrys: "",
|
||||
//国家
|
||||
nameAnchor: "",
|
||||
//主播名称
|
||||
numberCoins: "",
|
||||
//金币数量
|
||||
session: "",
|
||||
//场数
|
||||
remarks: "",
|
||||
//备注
|
||||
Display: false,
|
||||
Hint: false,
|
||||
datetimesingle: "",
|
||||
//日期
|
||||
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/NewAddedPk/NewAddedPk.vue:177", item);
|
||||
},
|
||||
country(item) {
|
||||
this.countrys = item.value;
|
||||
common_vendor.index.__f__("log", "at pages/NewAddedPk/NewAddedPk.vue:182", 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.numberCoins = "";
|
||||
this.remarks = "";
|
||||
this.datetimesingle = "";
|
||||
this.countrys = "";
|
||||
this.session = "";
|
||||
} 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: "http://47.79.98.113:6600/" + 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.numberCoins === "" || this.countrys === "" || this.datetimesingle === "" || this.session === "" || this.AnchorProfilePicture === "") {
|
||||
this.Hint = true;
|
||||
return;
|
||||
}
|
||||
const isoString = this.datetimesingle.replace(" ", "T");
|
||||
const timestamp = Date.parse(isoString);
|
||||
if (isNaN(timestamp)) {
|
||||
throw new Error(`Invalid date format: ${this.datetimesingle}`);
|
||||
}
|
||||
this.sendingTime = Math.floor(timestamp / 1e3);
|
||||
const secondsTimestamp = Math.floor(Date.now() / 1e3);
|
||||
if (this.sendingTime < secondsTimestamp) {
|
||||
common_vendor.index.showToast({
|
||||
title: "日期不能早于当前时间",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showLoading({
|
||||
title: "发布中...",
|
||||
mask: true
|
||||
});
|
||||
const res = await components_request.request({
|
||||
url: "pk/addPkData",
|
||||
method: "POST",
|
||||
data: {
|
||||
anchorId: this.nameAnchor,
|
||||
pkTime: this.sendingTime,
|
||||
sex: this.genders,
|
||||
country: this.countrys,
|
||||
coin: this.numberCoins,
|
||||
remark: this.remarks,
|
||||
senderId: this.id,
|
||||
anchorIcon: this.AnchorProfilePicture,
|
||||
pkNumber: this.session
|
||||
},
|
||||
userInfo: true
|
||||
});
|
||||
if (res.code === 200) {
|
||||
this.Display = false;
|
||||
this.Hint = false;
|
||||
this.nameAnchor = "";
|
||||
this.genders = 0;
|
||||
this.numberCoins = "";
|
||||
this.remarks = "";
|
||||
this.datetimesingle = "";
|
||||
this.session = "";
|
||||
this.AnchorProfilePicture = "";
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "发布成功",
|
||||
icon: "success",
|
||||
duration: 2e3
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "发布失败",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_wht_select2 = common_vendor.resolveComponent("wht-select");
|
||||
const _easycom_uni_number_box2 = common_vendor.resolveComponent("uni-number-box");
|
||||
const _easycom_uni_datetime_picker2 = common_vendor.resolveComponent("uni-datetime-picker");
|
||||
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
||||
(_easycom_wht_select2 + _easycom_uni_number_box2 + _easycom_uni_datetime_picker2 + _easycom_uni_easyinput2)();
|
||||
}
|
||||
const _easycom_wht_select = () => "./uni_modules/wht-select/components/wht-select/wht-select.js";
|
||||
const _easycom_uni_number_box = () => "./uni_modules/uni-number-box/components/uni-number-box/uni-number-box.js";
|
||||
const _easycom_uni_datetime_picker = () => "./uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js";
|
||||
const _easycom_uni_easyinput = () => "./uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
|
||||
if (!Math) {
|
||||
(_easycom_wht_select + _easycom_uni_number_box + _easycom_uni_datetime_picker + _easycom_uni_easyinput)();
|
||||
}
|
||||
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_assets._imports_0$2,
|
||||
d: common_vendor.o$1((...args) => _ctx.NameAnchor && _ctx.NameAnchor(...args)),
|
||||
e: common_vendor.o$1((...args) => $options.blur && $options.blur(...args)),
|
||||
f: $data.nameAnchor === "" && $data.Hint === true
|
||||
}, $data.nameAnchor === "" && $data.Hint === true ? {} : {}, {
|
||||
g: common_vendor.o$1($options.country),
|
||||
h: common_vendor.p({
|
||||
backgroundColor: "#ffffff",
|
||||
placeholderColor: "#666666",
|
||||
textColor: "#666666",
|
||||
borderColor: "#ffffff",
|
||||
options: $data.Country,
|
||||
filterable: $data.filterable,
|
||||
placeholder: "请选择国家"
|
||||
}),
|
||||
i: $data.countrys === "" && $data.Hint === true
|
||||
}, $data.countrys === "" && $data.Hint === true ? {} : {}, {
|
||||
j: common_vendor.o$1($options.gender),
|
||||
k: common_vendor.p({
|
||||
backgroundColor: "#ffffff",
|
||||
placeholderColor: "#666666",
|
||||
textColor: "#666666",
|
||||
borderColor: "#ffffff",
|
||||
options: $data.Gender,
|
||||
placeholder: "性别"
|
||||
}),
|
||||
l: $data.genders === 0
|
||||
}, $data.genders === 0 ? {
|
||||
m: common_assets._imports_1$2
|
||||
} : {}, {
|
||||
n: $data.genders === 1
|
||||
}, $data.genders === 1 ? {
|
||||
o: common_assets._imports_2$3
|
||||
} : {}, {
|
||||
p: $data.genders === 2
|
||||
}, $data.genders === 2 ? {
|
||||
q: common_assets._imports_3$2
|
||||
} : {}, {
|
||||
r: $data.genders === 0 && $data.Hint === true
|
||||
}, $data.genders === 0 && $data.Hint === true ? {} : {}, {
|
||||
s: common_vendor.o$1(($event) => $data.numberCoins = $event),
|
||||
t: common_vendor.p({
|
||||
background: "#03ABA8",
|
||||
modelValue: $data.numberCoins
|
||||
}),
|
||||
v: $data.numberCoins === "" && $data.Hint === true
|
||||
}, $data.numberCoins === "" && $data.Hint === true ? {} : {}, {
|
||||
w: common_vendor.o$1(($event) => $data.datetimesingle = $event),
|
||||
x: common_vendor.p({
|
||||
type: "datetime",
|
||||
["hide-second"]: "true",
|
||||
modelValue: $data.datetimesingle
|
||||
}),
|
||||
y: $data.datetimesingle === "" && $data.Hint === true
|
||||
}, $data.datetimesingle === "" && $data.Hint === true ? {} : {}, {
|
||||
z: common_vendor.o$1(($event) => $data.session = $event),
|
||||
A: common_vendor.p({
|
||||
background: "#03ABA8",
|
||||
modelValue: $data.session
|
||||
}),
|
||||
B: $data.session === "" && $data.Hint === true
|
||||
}, $data.session === "" && $data.Hint === true ? {} : {}, {
|
||||
C: common_vendor.o$1(($event) => $data.remarks = $event),
|
||||
D: common_vendor.p({
|
||||
type: "textarea",
|
||||
placeholder: "备注",
|
||||
modelValue: $data.remarks
|
||||
}),
|
||||
E: common_vendor.o$1(($event) => $options.Publish()),
|
||||
F: common_vendor.o$1(() => {
|
||||
}),
|
||||
G: common_vendor.n($data.Display ? "create-module" : "close-animation "),
|
||||
H: common_vendor.o$1(($event) => $options.open())
|
||||
}) : {});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-96d38e2b"]]);
|
||||
exports.MiniProgramPage = MiniProgramPage;
|
||||
//# sourceMappingURL=../.sourcemap/mp-weixin/NewAddedPk.js.map
|
||||
Reference in New Issue
Block a user