113 lines
3.7 KiB
JavaScript
113 lines
3.7 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const _sfc_main = {
|
|
data() {
|
|
var typeData = ["爵士", "民谣", "流行", "古风", "车载", "摇滚", "自定义"];
|
|
return {
|
|
systemBarHeight: 0,
|
|
subtractedHeight: 0,
|
|
fontNum: 0,
|
|
inputData: "",
|
|
typeData,
|
|
styleIndex: 0,
|
|
songTitle: ""
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.getStatusBarHeight();
|
|
this.getSubtractedHeight();
|
|
},
|
|
methods: {
|
|
// 获取状态栏高度的方法
|
|
getStatusBarHeight: function() {
|
|
var that = this;
|
|
common_vendor.index.getSystemInfo({
|
|
success: function(res) {
|
|
that.systemBarHeight = res.statusBarHeight;
|
|
}
|
|
});
|
|
},
|
|
getSubtractedHeight() {
|
|
const systemInfo = common_vendor.index.getSystemInfoSync();
|
|
systemInfo.screenWidth;
|
|
const windowHeight = systemInfo.windowHeight;
|
|
console.log("windowHeight", windowHeight);
|
|
this.subtractedHeight = windowHeight;
|
|
console.log("subtractedHeight", this.subtractedHeight);
|
|
},
|
|
sumfontnum(e) {
|
|
this.fontNum = e.detail.cursor;
|
|
},
|
|
clickStyle(index, data) {
|
|
this.styleIndex = index;
|
|
if (data == "自定义") {
|
|
this.$refs.inputDialog.open();
|
|
}
|
|
},
|
|
setStyleBg(index) {
|
|
if (this.styleIndex == index) {
|
|
return {
|
|
backgroundImage: "linear-gradient(to left, #a541ffFF, #3fbbfeFF)"
|
|
};
|
|
} else {
|
|
return {
|
|
backgroundImage: "linear-gradient(to left, #919191FF, #919191FF)"
|
|
};
|
|
}
|
|
},
|
|
dialogInputConfirm(value) {
|
|
this.typeData.unshift(value);
|
|
this.styleIndex = 0;
|
|
},
|
|
toCreateInfo() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/create/CreateInfoPage"
|
|
});
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_uni_popup_dialog2 = common_vendor.resolveComponent("uni-popup-dialog");
|
|
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
|
(_easycom_uni_popup_dialog2 + _easycom_uni_popup2)();
|
|
}
|
|
const _easycom_uni_popup_dialog = () => "../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js";
|
|
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
|
if (!Math) {
|
|
(_easycom_uni_popup_dialog + _easycom_uni_popup)();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {
|
|
a: $data.systemBarHeight + "px",
|
|
b: common_vendor.o([($event) => $data.inputData = $event.detail.value, (...args) => $options.sumfontnum && $options.sumfontnum(...args)]),
|
|
c: $data.inputData,
|
|
d: common_vendor.t($data.fontNum),
|
|
e: common_vendor.f($data.typeData, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item),
|
|
b: common_vendor.o(($event) => $options.clickStyle(index, item)),
|
|
c: common_vendor.s($options.setStyleBg(index))
|
|
};
|
|
}),
|
|
f: $data.songTitle,
|
|
g: common_vendor.o(($event) => $data.songTitle = $event.detail.value),
|
|
h: common_vendor.o(($event) => $options.toCreateInfo()),
|
|
i: common_vendor.sr("inputClose", "5a233947-1,5a233947-0"),
|
|
j: common_vendor.o($options.dialogInputConfirm),
|
|
k: common_vendor.p({
|
|
mode: "input",
|
|
title: "输入内容",
|
|
value: "",
|
|
placeholder: "请输入内容"
|
|
}),
|
|
l: common_vendor.sr("inputDialog", "5a233947-0"),
|
|
m: common_vendor.p({
|
|
type: "center",
|
|
["background-color"]: "#333333"
|
|
}),
|
|
n: common_vendor.s("paddingTop: " + $data.systemBarHeight + "px; height:" + $data.subtractedHeight + "px")
|
|
};
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "F:/gitCode/uniapp/magicsound/pages/create/createpage.vue"]]);
|
|
wx.createPage(MiniProgramPage);
|