fix:更新
This commit is contained in:
parent
f231f64c1d
commit
aa26889f03
10
.prettierrc
Normal file
10
.prettierrc
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100,
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "auto"
|
||||
}
|
||||
17
.vscode/settings.json
vendored
Normal file
17
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"prettier.requireConfig": true
|
||||
}
|
||||
@ -9,15 +9,64 @@ const useWeAppAuthStore = common_vendor.defineStore("we_app_auth", () => {
|
||||
user: { id: 0, username: "" }
|
||||
});
|
||||
function login(app) {
|
||||
common_vendor.index.login({
|
||||
provider: "weixin",
|
||||
//使用微信登录
|
||||
success: function(loginRes) {
|
||||
console.log(loginRes.code);
|
||||
var _a, _b, _c;
|
||||
const res = common_vendor.index.getSystemInfoSync();
|
||||
if ((res == null ? void 0 : res.environment) === "wxwork") {
|
||||
(_b = (_a = common_vendor.index) == null ? void 0 : _a.qy) == null ? void 0 : _b.login({
|
||||
success: function(loginRes) {
|
||||
console.log(loginRes);
|
||||
getWorkToken(app, loginRes.code);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
(_c = common_vendor.index) == null ? void 0 : _c.login({
|
||||
provider: "weixin",
|
||||
//使用微信登录
|
||||
success: function(loginRes) {
|
||||
console.log(loginRes);
|
||||
getWXToken(app, loginRes.code);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
const getWorkToken = (app, code) => {
|
||||
gen_Apis.Apis.Login.Auth.WorkLogin({ code, app_id: "ww8e14f3d20774c997" }).then((res) => {
|
||||
var _a, _b, _c, _d;
|
||||
console.log("登录", res == null ? void 0 : res.data);
|
||||
data.value.user = (_a = res.data) == null ? void 0 : _a.user;
|
||||
loading.value = false;
|
||||
common_vendor.index.setStorageSync("ACCESS_TOKEN_CUSTOMER", (_c = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.token) == null ? void 0 : _c.token);
|
||||
app == null ? void 0 : app.appContext.config.globalProperties.$isResolve();
|
||||
if (!((_d = res.data) == null ? void 0 : _d.user)) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: "/pages/login"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
hasError.value = true;
|
||||
});
|
||||
}
|
||||
};
|
||||
const getWXToken = (app, code) => {
|
||||
gen_Apis.Apis.Login.Auth.Login({ code, app_id: "wx09b52ea34b5e8855" }).then((res) => {
|
||||
var _a, _b, _c, _d;
|
||||
console.log("登录", res == null ? void 0 : res.data);
|
||||
data.value.user = (_a = res.data) == null ? void 0 : _a.user;
|
||||
loading.value = false;
|
||||
common_vendor.index.setStorageSync("ACCESS_TOKEN_CUSTOMER", (_c = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.token) == null ? void 0 : _c.token);
|
||||
app == null ? void 0 : app.appContext.config.globalProperties.$isResolve();
|
||||
if (!((_d = res.data) == null ? void 0 : _d.user)) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: "/pages/login"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
hasError.value = true;
|
||||
});
|
||||
};
|
||||
function me() {
|
||||
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Login.Auth.Me, {}).then((res) => {
|
||||
data.value.user = res.data.user;
|
||||
@ -27,7 +76,10 @@ const useWeAppAuthStore = common_vendor.defineStore("we_app_auth", () => {
|
||||
});
|
||||
}
|
||||
const handleUserLogin = async (from_data) => {
|
||||
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Login.Auth.BindPhoneNumber, from_data).then((res) => {
|
||||
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Login.Auth.BindPhoneNumber, {
|
||||
app_id: "wx09b52ea34b5e8855",
|
||||
...from_data
|
||||
}).then((res) => {
|
||||
me();
|
||||
});
|
||||
};
|
||||
|
||||
11
dist/dev/mp-weixin/common/vendor.js
vendored
11
dist/dev/mp-weixin/common/vendor.js
vendored
@ -5140,16 +5140,6 @@ function formatComponentName(instance, Component2, isRoot = false) {
|
||||
const computed = (getterOrOptions, debugOptions) => {
|
||||
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
||||
};
|
||||
function useSlots() {
|
||||
return getContext().slots;
|
||||
}
|
||||
function getContext() {
|
||||
const i = getCurrentInstance();
|
||||
if (!i) {
|
||||
warn(`useContext() called without active instance.`);
|
||||
}
|
||||
return i.setupContext || (i.setupContext = createSetupContext(i));
|
||||
}
|
||||
const version$1 = "3.2.47";
|
||||
function unwrapper(target) {
|
||||
return unref(target);
|
||||
@ -12793,6 +12783,5 @@ exports.t = t;
|
||||
exports.test = test;
|
||||
exports.throttle = throttle;
|
||||
exports.unref = unref;
|
||||
exports.useSlots = useSlots;
|
||||
exports.uviewPlus = uviewPlus;
|
||||
exports.watch = watch;
|
||||
|
||||
30
dist/dev/mp-weixin/components/hs-card/hs-card.js
vendored
30
dist/dev/mp-weixin/components/hs-card/hs-card.js
vendored
@ -1,30 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "hs-card",
|
||||
props: ["title", "backgroundUrl", "styles", "borderHead"],
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const slots = common_vendor.useSlots();
|
||||
const handleGetRelationNodes = () => {
|
||||
let show = slots.default;
|
||||
return show;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: props == null ? void 0 : props.title
|
||||
}, (props == null ? void 0 : props.title) ? {
|
||||
b: common_vendor.t(props == null ? void 0 : props.title),
|
||||
c: (props == null ? void 0 : props.borderHead) ? "1rpx solid #eee" : ""
|
||||
} : {}, {
|
||||
d: handleGetRelationNodes()
|
||||
}, handleGetRelationNodes() ? {} : {}, {
|
||||
e: props.backgroundUrl ? `url(${props.backgroundUrl || ""})` : "#fff",
|
||||
f: common_vendor.s(__props.styles),
|
||||
g: common_vendor.o(($event) => _ctx.$emit("click"))
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-card/hs-card.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@ -1,22 +0,0 @@
|
||||
.card_content {
|
||||
padding: 0 30rpx;
|
||||
margin: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.card_header {
|
||||
padding: 30rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.card_header .title {
|
||||
flex: 1;
|
||||
font-weight: 450;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.card_header .right_value {
|
||||
padding: 2rpx 12rpx;
|
||||
align-content: center;
|
||||
font-size: 27rpx;
|
||||
color: #000;
|
||||
}
|
||||
@ -1,65 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_libraries_day = require("../../common/libraries/day.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "hs-day-picker",
|
||||
props: [
|
||||
"Enums",
|
||||
"title",
|
||||
"pickerIndex",
|
||||
"value",
|
||||
"borderTop",
|
||||
"required",
|
||||
"valueModel",
|
||||
"icon",
|
||||
"iconSize"
|
||||
],
|
||||
emits: ["change", "update:valueModel"],
|
||||
setup(__props, { emit }) {
|
||||
const props = __props;
|
||||
const selectValue = common_vendor.ref("");
|
||||
const onChange = (e) => {
|
||||
var _a, _b, _c;
|
||||
selectValue.value = (_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.value;
|
||||
emit("update:valueModel", (_b = e == null ? void 0 : e.detail) == null ? void 0 : _b.value);
|
||||
emit("change", (_c = e == null ? void 0 : e.detail) == null ? void 0 : _c.value);
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => props == null ? void 0 : props.valueModel,
|
||||
(val) => {
|
||||
selectValue.value = val;
|
||||
}
|
||||
);
|
||||
common_vendor.onMounted(() => {
|
||||
if (props == null ? void 0 : props.valueModel) {
|
||||
selectValue.value = props == null ? void 0 : props.valueModel;
|
||||
} else {
|
||||
selectValue.value = common_libraries_day.getDay();
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(selectValue.value),
|
||||
b: props == null ? void 0 : props.icon
|
||||
}, (props == null ? void 0 : props.icon) ? {
|
||||
c: common_vendor.p({
|
||||
type: props == null ? void 0 : props.icon,
|
||||
size: (props == null ? void 0 : props.iconSize) || 19,
|
||||
color: "#555"
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.o(onChange)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7a35584e"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-day-picker/hs-day-picker.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@ -1,9 +0,0 @@
|
||||
.nchl_day_picker.data-v-7a35584e {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.nchl_day_picker text.data-v-7a35584e {
|
||||
padding-right: 10rpx;
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_hsInput_reducer = require("./reducer.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "hs-input",
|
||||
props: components_hsInput_reducer.wlInputProps,
|
||||
emits: [
|
||||
"update:valueModel",
|
||||
"input",
|
||||
"blur",
|
||||
"bindconfirm",
|
||||
"onClose"
|
||||
],
|
||||
setup(__props, { emit }) {
|
||||
const props = __props;
|
||||
const valueModel = common_vendor.ref("");
|
||||
common_vendor.watch(
|
||||
() => props.valueModel,
|
||||
(val) => {
|
||||
valueModel.value = val;
|
||||
handleChange(val);
|
||||
}
|
||||
);
|
||||
common_vendor.onMounted(() => {
|
||||
valueModel.value = props.valueModel;
|
||||
handleChange(props.valueModel);
|
||||
});
|
||||
const onChange = (e) => {
|
||||
const target = e.target;
|
||||
let value = target.value;
|
||||
handleChange(value);
|
||||
};
|
||||
const handleChange = (value) => {
|
||||
emit("update:valueModel", value);
|
||||
emit("input", value);
|
||||
};
|
||||
const onBlur = () => {
|
||||
emit("blur", props.valueModel);
|
||||
};
|
||||
const onConfirm = (e) => {
|
||||
const target = e.target;
|
||||
let value = target.value;
|
||||
emit("bindconfirm", value);
|
||||
};
|
||||
const emptyInput = () => {
|
||||
valueModel.value = "";
|
||||
onChange({ target: { value: "" } });
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.n(props.classInputName),
|
||||
b: common_vendor.o([($event) => valueModel.value = $event.detail.value, onChange]),
|
||||
c: props.placeholderStyle,
|
||||
d: (props == null ? void 0 : props.width) || "300rpx",
|
||||
e: props == null ? void 0 : props.textAlign,
|
||||
f: common_vendor.o(onChange),
|
||||
g: (props == null ? void 0 : props.placeholder) || "请输入",
|
||||
h: (props == null ? void 0 : props.maxLength) || 255,
|
||||
i: (props == null ? void 0 : props.type) || "text",
|
||||
j: common_vendor.o(onBlur),
|
||||
k: common_vendor.o(onConfirm),
|
||||
l: props == null ? void 0 : props.disabled,
|
||||
m: props == null ? void 0 : props.confirmType,
|
||||
n: (props == null ? void 0 : props.password) || false,
|
||||
o: valueModel.value,
|
||||
p: valueModel.value.length
|
||||
}, valueModel.value.length ? {
|
||||
q: common_vendor.o(emptyInput),
|
||||
r: common_vendor.p({
|
||||
type: "closeempty",
|
||||
color: "#999999",
|
||||
size: "12"
|
||||
})
|
||||
} : {}, {
|
||||
s: _ctx.suffix
|
||||
}, _ctx.suffix ? {
|
||||
t: common_vendor.t(_ctx.suffix)
|
||||
} : {}, {
|
||||
v: common_vendor.n(props.className)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-input/hs-input.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
<view class="{{['input_content', v]}}"><block wx:if="{{r0}}"><input class="{{['uni-input', a]}}" bindinput="{{b}}" placeholder-style="{{c}}" style="{{'width:' + d + ';' + ('text-align:' + e)}}" bindchange="{{f}}" placeholder="{{g}}" maxlength="{{h}}" type="{{i}}" bindblur="{{j}}" bindconfirm="{{k}}" disabled="{{l}}" confirm-type="{{m}}" password="{{n}}" value="{{o}}"/></block><view wx:if="{{p}}" class="close"><uni-icons wx:if="{{r}}" bindclick="{{q}}" u-i="3eb21455-0" bind:__l="__l" u-p="{{r}}"/></view><view wx:if="{{s}}" class="suffix">{{t}}</view></view>
|
||||
@ -1,19 +0,0 @@
|
||||
.input_content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.input_content .uni-input {
|
||||
flex: 1;
|
||||
height: 70rpx;
|
||||
}
|
||||
.suffix {
|
||||
color: #333333;
|
||||
font-size: 28rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.close {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
@ -1,74 +0,0 @@
|
||||
"use strict";
|
||||
const defInputProps = {
|
||||
valueModel: "",
|
||||
placeholder: "请输入内容",
|
||||
width: "100%",
|
||||
suffix: "",
|
||||
maxLength: 255,
|
||||
type: "text",
|
||||
className: "",
|
||||
placeholderStyle: "color: #ccc;font-size:25rpx;",
|
||||
classInputName: "",
|
||||
textAlign: "left",
|
||||
confirmType: "done",
|
||||
hasClose: false
|
||||
};
|
||||
const wlInputProps = {
|
||||
valueModel: {
|
||||
type: String,
|
||||
default: defInputProps.valueModel
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: defInputProps.placeholder
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: defInputProps.width
|
||||
},
|
||||
suffix: {
|
||||
type: String,
|
||||
default: defInputProps.suffix
|
||||
},
|
||||
maxLength: {
|
||||
type: Number,
|
||||
default: defInputProps.maxLength
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: defInputProps.type
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: defInputProps.className
|
||||
},
|
||||
placeholderStyle: {
|
||||
type: String,
|
||||
default: defInputProps.placeholderStyle
|
||||
},
|
||||
classInputName: {
|
||||
type: String,
|
||||
default: defInputProps.classInputName
|
||||
},
|
||||
password: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
textAlign: {
|
||||
type: String,
|
||||
default: defInputProps.textAlign
|
||||
},
|
||||
confirmType: {
|
||||
type: String,
|
||||
default: defInputProps.confirmType
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
hasClose: {
|
||||
type: Boolean,
|
||||
default: defInputProps.hasClose
|
||||
}
|
||||
};
|
||||
exports.wlInputProps = wlInputProps;
|
||||
@ -1,31 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
const _easycom_hs_button2 = common_vendor.resolveComponent("hs-button");
|
||||
(_easycom_uni_icons2 + _easycom_hs_button2)();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
const _easycom_hs_button = () => "../hs-button/hs-button.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_icons + _easycom_hs_button)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
type: "phone",
|
||||
size: "13",
|
||||
color: "#3da605"
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
label: "删除",
|
||||
type: "delete"
|
||||
}),
|
||||
c: common_vendor.p({
|
||||
label: "编辑"
|
||||
})
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-88a741e2"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-order-items/hs-order-items.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
|
||||
"hs-button": "../hs-button/hs-button"
|
||||
}
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
<view class="order_items data-v-88a741e2"><view class="header_no data-v-88a741e2">no.312312312321321</view><view class="user_info data-v-88a741e2"><view class="user_name data-v-88a741e2"> 黄先生 <text class="data-v-88a741e2">一人会有限公司</text></view><view class="prices data-v-88a741e2"> ¥122.32 </view></view><view class="parameters_body data-v-88a741e2"><view class="items data-v-88a741e2"> 塑料类-<text class="data-v-88a741e2">饮料瓶</text></view><view class="items data-v-88a741e2"> 计件:<text class="data-v-88a741e2">32件</text></view></view><view class="item_footer data-v-88a741e2"><view class="phone_btn data-v-88a741e2"><uni-icons wx:if="{{a}}" class="data-v-88a741e2" u-i="88a741e2-0" bind:__l="__l" u-p="{{a}}"></uni-icons> 打电话 </view><view class="group_btn data-v-88a741e2"><hs-button wx:if="{{b}}" class="data-v-88a741e2" u-i="88a741e2-1" bind:__l="__l" u-p="{{b}}"/><hs-button wx:if="{{c}}" class="data-v-88a741e2" u-i="88a741e2-2" bind:__l="__l" u-p="{{c}}"/></view></view></view>
|
||||
@ -1,61 +0,0 @@
|
||||
.order_items.data-v-88a741e2 {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 30rpx;
|
||||
position: relative;
|
||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.order_items .header_no.data-v-88a741e2 {
|
||||
color: #666;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
.order_items .user_info.data-v-88a741e2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 15rpx 0;
|
||||
}
|
||||
.order_items .user_info .user_name.data-v-88a741e2 {
|
||||
font-size: 27rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.order_items .user_info .user_name text.data-v-88a741e2 {
|
||||
padding-left: 30rpx;
|
||||
color: #999;
|
||||
font-weight: 400;
|
||||
}
|
||||
.order_items .user_info .prices.data-v-88a741e2 {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.order_items .parameters_body.data-v-88a741e2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
font-size: 27rpx;
|
||||
color: #333;
|
||||
}
|
||||
.order_items .parameters_body .items.data-v-88a741e2 {
|
||||
width: 50%;
|
||||
}
|
||||
.order_items .item_footer.data-v-88a741e2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 25rpx;
|
||||
border-top: 1rpx solid #f8f8f8;
|
||||
margin-top: 25rpx;
|
||||
}
|
||||
.order_items .item_footer .phone_btn.data-v-88a741e2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #3da605;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
.order_items .item_footer .group_btn.data-v-88a741e2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.order_items .item_footer .group_btn hs-button.data-v-88a741e2:last-child {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
7
dist/dev/mp-weixin/gen/Apis.js
vendored
7
dist/dev/mp-weixin/gen/Apis.js
vendored
@ -31,11 +31,8 @@ const Apis = {
|
||||
PreUpload(data) {
|
||||
return common_libraries_request.request("employee/login/auth/pre_upload", { data });
|
||||
},
|
||||
DoUpload(data) {
|
||||
return common_libraries_request.request("employee/login/auth/do_upload", { data });
|
||||
},
|
||||
ImLogin() {
|
||||
return common_libraries_request.request("employee/login/auth/im_login", {});
|
||||
TemporaryUrl(data) {
|
||||
return common_libraries_request.request("employee/login/auth/temporary_url", { data });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const common_libraries_day = require("../../../common/libraries/day.js");
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "daySelect",
|
||||
props: ["day"],
|
||||
emits: ["update:valueModel"],
|
||||
setup(__props, { emit }) {
|
||||
const props = __props;
|
||||
const handleSelect = (day) => {
|
||||
emit("update:valueModel", day);
|
||||
};
|
||||
const listDay = common_vendor.ref([
|
||||
{
|
||||
label: "今天",
|
||||
value: common_libraries_day.getDay()
|
||||
},
|
||||
{
|
||||
label: "昨天",
|
||||
value: common_libraries_day.getDay(1)
|
||||
},
|
||||
{
|
||||
label: "前天",
|
||||
value: common_libraries_day.getDay(2)
|
||||
}
|
||||
]);
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(listDay.value, (i, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(i == null ? void 0 : i.label),
|
||||
b: index,
|
||||
c: common_vendor.n(`day_items ${(i == null ? void 0 : i.value) === props.day ? "active" : ""}`),
|
||||
d: common_vendor.o(($event) => handleSelect(i == null ? void 0 : i.value), index)
|
||||
};
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b04b217e"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/pages/index/components/daySelect.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@ -1,21 +0,0 @@
|
||||
.day_select.data-v-b04b217e {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 340rpx;
|
||||
height: 55rpx;
|
||||
line-height: 55rpx;
|
||||
border: 1px solid #44ba04;
|
||||
border-radius: 100rpx;
|
||||
font-size: 27rpx;
|
||||
color: #44ba04;
|
||||
overflow: hidden;
|
||||
}
|
||||
.day_select .day_items.data-v-b04b217e {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
.day_select .active.data-v-b04b217e {
|
||||
background-color: #44ba04;
|
||||
color: #fff;
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const pages_index_model = require("../model.js");
|
||||
require("../method.js");
|
||||
require("../../../common/libraries/day.js");
|
||||
require("../../../common/libraries/request.js");
|
||||
require("../../../common/store/useWeAppAuthStore.js");
|
||||
require("../../../gen/Apis.js");
|
||||
require("../../../common/libraries/apiLoading.js");
|
||||
if (!Array) {
|
||||
const _easycom_hs_day_picker2 = common_vendor.resolveComponent("hs-day-picker");
|
||||
const _easycom_hs_card2 = common_vendor.resolveComponent("hs-card");
|
||||
(_easycom_hs_day_picker2 + _easycom_hs_card2)();
|
||||
}
|
||||
const _easycom_hs_day_picker = () => "../../../components/hs-day-picker/hs-day-picker.js";
|
||||
const _easycom_hs_card = () => "../../../components/hs-card/hs-card.js";
|
||||
if (!Math) {
|
||||
(MyDaySelect + _easycom_hs_day_picker + _easycom_hs_card)();
|
||||
}
|
||||
const MyDaySelect = () => "./daySelect.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "showData",
|
||||
setup(__props) {
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => common_vendor.unref(pages_index_model.useModel).formData.day = $event),
|
||||
b: common_vendor.p({
|
||||
day: common_vendor.unref(pages_index_model.useModel).formData.day,
|
||||
valueModel: common_vendor.unref(pages_index_model.useModel).formData.day
|
||||
}),
|
||||
c: common_vendor.o(($event) => common_vendor.unref(pages_index_model.useModel).formData.day = $event),
|
||||
d: common_vendor.p({
|
||||
icon: "calendar",
|
||||
valueModel: common_vendor.unref(pages_index_model.useModel).formData.day
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-a9a28d4d"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/pages/index/components/showData.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@ -1,44 +0,0 @@
|
||||
.data_header.data-v-a9a28d4d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 0 40rpx 0;
|
||||
}
|
||||
.data_total_price.data-v-a9a28d4d {
|
||||
text-align: center;
|
||||
padding: 10rpx 0 30rpx 0;
|
||||
}
|
||||
.data_total_price .data_title.data-v-a9a28d4d {
|
||||
color: #999;
|
||||
font-size: 25rpx;
|
||||
padding-bottom: 8rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.data_total_price .prices.data-v-a9a28d4d {
|
||||
color: #f00;
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.data_total_price .prices text.data-v-a9a28d4d {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
.data_item_list.data-v-a9a28d4d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.data_item_list .data_item.data-v-a9a28d4d {
|
||||
width: 33.333%;
|
||||
padding: 20rpx 0 0 0;
|
||||
text-align: center;
|
||||
}
|
||||
.data_item_list .data_item .data_label.data-v-a9a28d4d {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
padding-bottom: 8rpx;
|
||||
}
|
||||
.data_item_list .data_item .data_value.data-v-a9a28d4d {
|
||||
font-weight: 600;
|
||||
font-size: 35rpx;
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const _sfc_main = {};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
type: "plus",
|
||||
size: "24",
|
||||
color: "#3da605"
|
||||
})
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ac65dc11"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/pages/index/components/useInfo.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
@ -1,32 +0,0 @@
|
||||
.user_info.data-v-ac65dc11 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 30rpx 20rpx 30rpx;
|
||||
}
|
||||
.user_info .avatar_info.data-v-ac65dc11 {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 40rpx;
|
||||
background: rgba(229, 229, 229, 0.34);
|
||||
}
|
||||
.user_info .user_info_content.data-v-ac65dc11 {
|
||||
flex: 1;
|
||||
padding: 0 0 0 30rpx;
|
||||
color: #fff;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
.user_info .user_info_content .user_name.data-v-ac65dc11 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
.user_info .user_info_content text.data-v-ac65dc11 {
|
||||
padding-left: 40rpx;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
.user_info .add_btn.data-v-ac65dc11 {
|
||||
padding: 10rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
23
dist/dev/mp-weixin/pages/index/index.js
vendored
23
dist/dev/mp-weixin/pages/index/index.js
vendored
@ -11,21 +11,13 @@ require("../../common/libraries/day.js");
|
||||
require("../../gen/Apis.js");
|
||||
require("../../common/libraries/apiLoading.js");
|
||||
if (!Array) {
|
||||
const _easycom_hs_custom_title2 = common_vendor.resolveComponent("hs-custom-title");
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
const _easycom_hs_order_items2 = common_vendor.resolveComponent("hs-order-items");
|
||||
const _easycom_cc_root_view2 = common_vendor.resolveComponent("cc-root-view");
|
||||
(_easycom_hs_custom_title2 + _easycom_uni_icons2 + _easycom_hs_order_items2 + _easycom_cc_root_view2)();
|
||||
_easycom_cc_root_view2();
|
||||
}
|
||||
const _easycom_hs_custom_title = () => "../../components/hs-custom-title/hs-custom-title.js";
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
const _easycom_hs_order_items = () => "../../components/hs-order-items/hs-order-items.js";
|
||||
const _easycom_cc_root_view = () => "../../common/components/cc-root-view/cc-root-view.js";
|
||||
if (!Math) {
|
||||
(_easycom_hs_custom_title + MyUserInfo + MyShowData + _easycom_uni_icons + _easycom_hs_order_items + _easycom_cc_root_view)();
|
||||
_easycom_cc_root_view();
|
||||
}
|
||||
const MyShowData = () => "./components/showData.js";
|
||||
const MyUserInfo = () => "./components/useInfo.js";
|
||||
const _sfc_defineComponent = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
@ -49,16 +41,7 @@ const _sfc_defineComponent = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
};
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
title: "废品回收助手"
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
type: "right",
|
||||
size: "13",
|
||||
color: "#3da605"
|
||||
})
|
||||
};
|
||||
return {};
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
7
dist/dev/mp-weixin/pages/index/index.json
vendored
7
dist/dev/mp-weixin/pages/index/index.json
vendored
@ -2,11 +2,6 @@
|
||||
"navigationBarTitleText": "首页",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"hs-custom-title": "../../components/hs-custom-title/hs-custom-title",
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
|
||||
"hs-order-items": "../../components/hs-order-items/hs-order-items",
|
||||
"cc-root-view": "../../common/components/cc-root-view/cc-root-view",
|
||||
"my-show-data": "./components/showData",
|
||||
"my-user-info": "./components/useInfo"
|
||||
"cc-root-view": "../../common/components/cc-root-view/cc-root-view"
|
||||
}
|
||||
}
|
||||
2
dist/dev/mp-weixin/pages/index/index.wxml
vendored
2
dist/dev/mp-weixin/pages/index/index.wxml
vendored
@ -1 +1 @@
|
||||
<cc-root-view u-s="{{['d']}}" u-i="76f3138a-0" bind:__l="__l"><view class="HomePage"><hs-custom-title wx:if="{{a}}" u-i="76f3138a-1,76f3138a-0" bind:__l="__l" u-p="{{a}}"/><my-user-info u-i="76f3138a-2,76f3138a-0" bind:__l="__l"/><my-show-data u-i="76f3138a-3,76f3138a-0" bind:__l="__l"/><view class="OrderTitle"> 最近订单 <view class="more_btn"> 更多<uni-icons wx:if="{{b}}" u-i="76f3138a-4,76f3138a-0" bind:__l="__l" u-p="{{b}}"></uni-icons></view></view><hs-order-items u-i="76f3138a-5,76f3138a-0" bind:__l="__l"/></view></cc-root-view>
|
||||
<cc-root-view u-s="{{['d']}}" u-i="76f3138a-0" bind:__l="__l"><view class="HomePage"> 2 </view></cc-root-view>
|
||||
5
dist/dev/mp-weixin/pages/index/model.js
vendored
5
dist/dev/mp-weixin/pages/index/model.js
vendored
@ -1,8 +1,7 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_libraries_day = require("../../common/libraries/day.js");
|
||||
const useModel = {
|
||||
({
|
||||
formData: common_vendor.reactive({ day: common_libraries_day.getDay() }),
|
||||
data: common_vendor.ref()
|
||||
};
|
||||
exports.useModel = useModel;
|
||||
});
|
||||
|
||||
55
dist/dev/mp-weixin/pages/login.js
vendored
55
dist/dev/mp-weixin/pages/login.js
vendored
@ -5,38 +5,33 @@ const common_store_useWeAppAuthStore = require("../common/store/useWeAppAuthStor
|
||||
require("../gen/Apis.js");
|
||||
require("../common/libraries/apiLoading.js");
|
||||
if (!Array) {
|
||||
const _easycom_hs_input2 = common_vendor.resolveComponent("hs-input");
|
||||
const _easycom_hs_button2 = common_vendor.resolveComponent("hs-button");
|
||||
const _easycom_hs_private_policy2 = common_vendor.resolveComponent("hs-private-policy");
|
||||
(_easycom_hs_input2 + _easycom_hs_button2 + _easycom_hs_private_policy2)();
|
||||
(_easycom_hs_button2 + _easycom_hs_private_policy2)();
|
||||
}
|
||||
const _easycom_hs_input = () => "../components/hs-input/hs-input.js";
|
||||
const _easycom_hs_button = () => "../components/hs-button/hs-button.js";
|
||||
const _easycom_hs_private_policy = () => "../components/hs-private-policy/hs-private-policy.js";
|
||||
if (!Math) {
|
||||
(_easycom_hs_input + _easycom_hs_button + _easycom_hs_private_policy)();
|
||||
(_easycom_hs_button + _easycom_hs_private_policy)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "login",
|
||||
setup(__props) {
|
||||
const from_data = common_vendor.ref({
|
||||
common_vendor.ref({
|
||||
username: "",
|
||||
password: ""
|
||||
});
|
||||
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
|
||||
let CheckedVal = common_vendor.ref(false);
|
||||
const onSubmit = () => {
|
||||
if (!privacyToast()) {
|
||||
const handleGetPhoneNumber = async (data) => {
|
||||
if (!CheckedVal.value) {
|
||||
return false;
|
||||
}
|
||||
if (!from_data.value.username || !from_data.value.password) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入帐号和密码!",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
auth.handleUserLogin(from_data.value);
|
||||
common_vendor.index.showLoading({
|
||||
title: "正在登录...",
|
||||
mask: true
|
||||
});
|
||||
auth == null ? void 0 : auth.handleUserLogin({ code: data.detail.code });
|
||||
};
|
||||
const privacyToast = () => {
|
||||
if (!CheckedVal.value) {
|
||||
@ -54,7 +49,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
mask: true
|
||||
});
|
||||
common_vendor.index.downloadFile({
|
||||
url: "https://nchl-dev.oss-cn-shenzhen.aliyuncs.com/uploads/cs-test/01JTM6CBGHTYPB7E4D4XENA2P7.pdf",
|
||||
url: "",
|
||||
success: function(e) {
|
||||
const filePath = e.tempFilePath;
|
||||
common_vendor.index.hideLoading();
|
||||
@ -67,27 +62,17 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => from_data.value.username = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "请输入帐号",
|
||||
textAlign: "left",
|
||||
valueModel: from_data.value.username
|
||||
a: common_vendor.o(handleGetPhoneNumber),
|
||||
b: common_vendor.o(privacyToast),
|
||||
c: common_vendor.p({
|
||||
type: "primary",
|
||||
size: "md",
|
||||
label: "快捷登录",
|
||||
openType: common_vendor.unref(CheckedVal) ? "getPhoneNumber" : ""
|
||||
}),
|
||||
c: common_vendor.o(($event) => from_data.value.password = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入密码",
|
||||
textAlign: "left",
|
||||
password: true,
|
||||
valueModel: from_data.value.password
|
||||
}),
|
||||
e: common_vendor.o(onSubmit),
|
||||
d: common_vendor.o(previewPdf),
|
||||
e: common_vendor.o(($event) => common_vendor.isRef(CheckedVal) ? CheckedVal.value = $event : CheckedVal = $event),
|
||||
f: common_vendor.p({
|
||||
label: "登录",
|
||||
size: "md"
|
||||
}),
|
||||
g: common_vendor.o(previewPdf),
|
||||
h: common_vendor.o(($event) => common_vendor.isRef(CheckedVal) ? CheckedVal.value = $event : CheckedVal = $event),
|
||||
i: common_vendor.p({
|
||||
policyName: "《用户协议》",
|
||||
isAgree: common_vendor.unref(CheckedVal)
|
||||
})
|
||||
|
||||
1
dist/dev/mp-weixin/pages/login.json
vendored
1
dist/dev/mp-weixin/pages/login.json
vendored
@ -2,7 +2,6 @@
|
||||
"navigationBarTitleText": "登录/注册",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"hs-input": "../components/hs-input/hs-input",
|
||||
"hs-button": "../components/hs-button/hs-button",
|
||||
"hs-private-policy": "../components/hs-private-policy/hs-private-policy"
|
||||
}
|
||||
|
||||
2
dist/dev/mp-weixin/pages/login.wxml
vendored
2
dist/dev/mp-weixin/pages/login.wxml
vendored
@ -1 +1 @@
|
||||
<view class="login_content"><view class="header"><image src="/static/svg/logo.svg" mode="heightFix" lazy-load="false"/></view><view class="group_des"><view class="label"> 废品回收助手 </view><view class="des"><text>还没有账号?</text> 请在公众号联系管理员 </view></view><view class="group_from"><view class="form_input"><hs-input wx:if="{{b}}" u-i="499dbccf-0" bind:__l="__l" bindupdateValueModel="{{a}}" u-p="{{b}}"/></view><view class="form_input"><hs-input wx:if="{{d}}" u-i="499dbccf-1" bind:__l="__l" bindupdateValueModel="{{c}}" u-p="{{d}}"/></view></view><view class="footer_btn"><hs-button wx:if="{{f}}" bindclick="{{e}}" u-i="499dbccf-2" bind:__l="__l" u-p="{{f}}"/><view class="footer_des"> 小程序只供合作企业用户使用,无法登录请联系管理员 </view></view><view class="PrivacyPolicy"><hs-private-policy wx:if="{{i}}" bindclickPolicy="{{g}}" u-i="499dbccf-3" bind:__l="__l" bindupdateIsAgree="{{h}}" u-p="{{i}}"/></view></view>
|
||||
<view class="login_content"><view class="header"></view><view class="group_des"><view class="label"> 助手 </view><view class="des"><text>还没有账号?</text> 请在公众号联系管理员 </view></view><view class="group_from"></view><view class="footer_btn"><hs-button wx:if="{{c}}" bindonGetPhoneNumber="{{a}}" bindclick="{{b}}" u-i="499dbccf-0" bind:__l="__l" u-p="{{c}}"/><view class="footer_des"> 小程序只供合作企业用户使用,无法登录请联系管理员 </view></view><view class="PrivacyPolicy"><hs-private-policy wx:if="{{f}}" bindclickPolicy="{{d}}" u-i="499dbccf-1" bind:__l="__l" bindupdateIsAgree="{{e}}" u-p="{{f}}"/></view></view>
|
||||
3
dist/dev/mp-weixin/project.config.json
vendored
3
dist/dev/mp-weixin/project.config.json
vendored
@ -32,8 +32,5 @@
|
||||
"current": -1,
|
||||
"list": []
|
||||
}
|
||||
},
|
||||
"simulatorPluginLibVersion": {
|
||||
"qywx_simulator_plugin": "2.20.3"
|
||||
}
|
||||
}
|
||||
@ -1,648 +1,648 @@
|
||||
"use strict";
|
||||
const fontData = [
|
||||
{
|
||||
"font_class": "arrow-down",
|
||||
"unicode": ""
|
||||
font_class: "arrow-down",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "arrow-left",
|
||||
"unicode": ""
|
||||
font_class: "arrow-left",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "arrow-right",
|
||||
"unicode": ""
|
||||
font_class: "arrow-right",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "arrow-up",
|
||||
"unicode": ""
|
||||
font_class: "arrow-up",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "auth",
|
||||
"unicode": ""
|
||||
font_class: "auth",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "auth-filled",
|
||||
"unicode": ""
|
||||
font_class: "auth-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "back",
|
||||
"unicode": ""
|
||||
font_class: "back",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "bars",
|
||||
"unicode": ""
|
||||
font_class: "bars",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "calendar",
|
||||
"unicode": ""
|
||||
font_class: "calendar",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "calendar-filled",
|
||||
"unicode": ""
|
||||
font_class: "calendar-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "camera",
|
||||
"unicode": ""
|
||||
font_class: "camera",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "camera-filled",
|
||||
"unicode": ""
|
||||
font_class: "camera-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "cart",
|
||||
"unicode": ""
|
||||
font_class: "cart",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "cart-filled",
|
||||
"unicode": ""
|
||||
font_class: "cart-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "chat",
|
||||
"unicode": ""
|
||||
font_class: "chat",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "chat-filled",
|
||||
"unicode": ""
|
||||
font_class: "chat-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatboxes",
|
||||
"unicode": ""
|
||||
font_class: "chatboxes",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatboxes-filled",
|
||||
"unicode": ""
|
||||
font_class: "chatboxes-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatbubble",
|
||||
"unicode": ""
|
||||
font_class: "chatbubble",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatbubble-filled",
|
||||
"unicode": ""
|
||||
font_class: "chatbubble-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "checkbox",
|
||||
"unicode": ""
|
||||
font_class: "checkbox",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "checkbox-filled",
|
||||
"unicode": ""
|
||||
font_class: "checkbox-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "checkmarkempty",
|
||||
"unicode": ""
|
||||
font_class: "checkmarkempty",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "circle",
|
||||
"unicode": ""
|
||||
font_class: "circle",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "circle-filled",
|
||||
"unicode": ""
|
||||
font_class: "circle-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "clear",
|
||||
"unicode": ""
|
||||
font_class: "clear",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "close",
|
||||
"unicode": ""
|
||||
font_class: "close",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "closeempty",
|
||||
"unicode": ""
|
||||
font_class: "closeempty",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-download",
|
||||
"unicode": ""
|
||||
font_class: "cloud-download",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-download-filled",
|
||||
"unicode": ""
|
||||
font_class: "cloud-download-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-upload",
|
||||
"unicode": ""
|
||||
font_class: "cloud-upload",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-upload-filled",
|
||||
"unicode": ""
|
||||
font_class: "cloud-upload-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "color",
|
||||
"unicode": ""
|
||||
font_class: "color",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "color-filled",
|
||||
"unicode": ""
|
||||
font_class: "color-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "compose",
|
||||
"unicode": ""
|
||||
font_class: "compose",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "contact",
|
||||
"unicode": ""
|
||||
font_class: "contact",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "contact-filled",
|
||||
"unicode": ""
|
||||
font_class: "contact-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "down",
|
||||
"unicode": ""
|
||||
font_class: "down",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "bottom",
|
||||
"unicode": ""
|
||||
font_class: "bottom",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "download",
|
||||
"unicode": ""
|
||||
font_class: "download",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "download-filled",
|
||||
"unicode": ""
|
||||
font_class: "download-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "email",
|
||||
"unicode": ""
|
||||
font_class: "email",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "email-filled",
|
||||
"unicode": ""
|
||||
font_class: "email-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye",
|
||||
"unicode": ""
|
||||
font_class: "eye",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye-filled",
|
||||
"unicode": ""
|
||||
font_class: "eye-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye-slash",
|
||||
"unicode": ""
|
||||
font_class: "eye-slash",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye-slash-filled",
|
||||
"unicode": ""
|
||||
font_class: "eye-slash-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "fire",
|
||||
"unicode": ""
|
||||
font_class: "fire",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "fire-filled",
|
||||
"unicode": ""
|
||||
font_class: "fire-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "flag",
|
||||
"unicode": ""
|
||||
font_class: "flag",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "flag-filled",
|
||||
"unicode": ""
|
||||
font_class: "flag-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "folder-add",
|
||||
"unicode": ""
|
||||
font_class: "folder-add",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "folder-add-filled",
|
||||
"unicode": ""
|
||||
font_class: "folder-add-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "font",
|
||||
"unicode": ""
|
||||
font_class: "font",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "forward",
|
||||
"unicode": ""
|
||||
font_class: "forward",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "gear",
|
||||
"unicode": ""
|
||||
font_class: "gear",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "gear-filled",
|
||||
"unicode": ""
|
||||
font_class: "gear-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "gift",
|
||||
"unicode": ""
|
||||
font_class: "gift",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "gift-filled",
|
||||
"unicode": ""
|
||||
font_class: "gift-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-down",
|
||||
"unicode": ""
|
||||
font_class: "hand-down",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-down-filled",
|
||||
"unicode": ""
|
||||
font_class: "hand-down-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-up",
|
||||
"unicode": ""
|
||||
font_class: "hand-up",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-up-filled",
|
||||
"unicode": ""
|
||||
font_class: "hand-up-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "headphones",
|
||||
"unicode": ""
|
||||
font_class: "headphones",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "heart",
|
||||
"unicode": ""
|
||||
font_class: "heart",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "heart-filled",
|
||||
"unicode": ""
|
||||
font_class: "heart-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "help",
|
||||
"unicode": ""
|
||||
font_class: "help",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "help-filled",
|
||||
"unicode": ""
|
||||
font_class: "help-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "home",
|
||||
"unicode": ""
|
||||
font_class: "home",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "home-filled",
|
||||
"unicode": ""
|
||||
font_class: "home-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "image",
|
||||
"unicode": ""
|
||||
font_class: "image",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "image-filled",
|
||||
"unicode": ""
|
||||
font_class: "image-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "images",
|
||||
"unicode": ""
|
||||
font_class: "images",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "images-filled",
|
||||
"unicode": ""
|
||||
font_class: "images-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "info",
|
||||
"unicode": ""
|
||||
font_class: "info",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "info-filled",
|
||||
"unicode": ""
|
||||
font_class: "info-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "left",
|
||||
"unicode": ""
|
||||
font_class: "left",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "link",
|
||||
"unicode": ""
|
||||
font_class: "link",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "list",
|
||||
"unicode": ""
|
||||
font_class: "list",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "location",
|
||||
"unicode": ""
|
||||
font_class: "location",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "location-filled",
|
||||
"unicode": ""
|
||||
font_class: "location-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "locked",
|
||||
"unicode": ""
|
||||
font_class: "locked",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "locked-filled",
|
||||
"unicode": ""
|
||||
font_class: "locked-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "loop",
|
||||
"unicode": ""
|
||||
font_class: "loop",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "mail-open",
|
||||
"unicode": ""
|
||||
font_class: "mail-open",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "mail-open-filled",
|
||||
"unicode": ""
|
||||
font_class: "mail-open-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "map",
|
||||
"unicode": ""
|
||||
font_class: "map",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "map-filled",
|
||||
"unicode": ""
|
||||
font_class: "map-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "map-pin",
|
||||
"unicode": ""
|
||||
font_class: "map-pin",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "map-pin-ellipse",
|
||||
"unicode": ""
|
||||
font_class: "map-pin-ellipse",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "medal",
|
||||
"unicode": ""
|
||||
font_class: "medal",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "medal-filled",
|
||||
"unicode": ""
|
||||
font_class: "medal-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "mic",
|
||||
"unicode": ""
|
||||
font_class: "mic",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "mic-filled",
|
||||
"unicode": ""
|
||||
font_class: "mic-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "micoff",
|
||||
"unicode": ""
|
||||
font_class: "micoff",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "micoff-filled",
|
||||
"unicode": ""
|
||||
font_class: "micoff-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "minus",
|
||||
"unicode": ""
|
||||
font_class: "minus",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "minus-filled",
|
||||
"unicode": ""
|
||||
font_class: "minus-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "more",
|
||||
"unicode": ""
|
||||
font_class: "more",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "more-filled",
|
||||
"unicode": ""
|
||||
font_class: "more-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "navigate",
|
||||
"unicode": ""
|
||||
font_class: "navigate",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "navigate-filled",
|
||||
"unicode": ""
|
||||
font_class: "navigate-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "notification",
|
||||
"unicode": ""
|
||||
font_class: "notification",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "notification-filled",
|
||||
"unicode": ""
|
||||
font_class: "notification-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "paperclip",
|
||||
"unicode": ""
|
||||
font_class: "paperclip",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "paperplane",
|
||||
"unicode": ""
|
||||
font_class: "paperplane",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "paperplane-filled",
|
||||
"unicode": ""
|
||||
font_class: "paperplane-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "person",
|
||||
"unicode": ""
|
||||
font_class: "person",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "person-filled",
|
||||
"unicode": ""
|
||||
font_class: "person-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "personadd",
|
||||
"unicode": ""
|
||||
font_class: "personadd",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "personadd-filled",
|
||||
"unicode": ""
|
||||
font_class: "personadd-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "personadd-filled-copy",
|
||||
"unicode": ""
|
||||
font_class: "personadd-filled-copy",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "phone",
|
||||
"unicode": ""
|
||||
font_class: "phone",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "phone-filled",
|
||||
"unicode": ""
|
||||
font_class: "phone-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "plus",
|
||||
"unicode": ""
|
||||
font_class: "plus",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "plus-filled",
|
||||
"unicode": ""
|
||||
font_class: "plus-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "plusempty",
|
||||
"unicode": ""
|
||||
font_class: "plusempty",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "pulldown",
|
||||
"unicode": ""
|
||||
font_class: "pulldown",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "pyq",
|
||||
"unicode": ""
|
||||
font_class: "pyq",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "qq",
|
||||
"unicode": ""
|
||||
font_class: "qq",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "redo",
|
||||
"unicode": ""
|
||||
font_class: "redo",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "redo-filled",
|
||||
"unicode": ""
|
||||
font_class: "redo-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "refresh",
|
||||
"unicode": ""
|
||||
font_class: "refresh",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "refresh-filled",
|
||||
"unicode": ""
|
||||
font_class: "refresh-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "refreshempty",
|
||||
"unicode": ""
|
||||
font_class: "refreshempty",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "reload",
|
||||
"unicode": ""
|
||||
font_class: "reload",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "right",
|
||||
"unicode": ""
|
||||
font_class: "right",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "scan",
|
||||
"unicode": ""
|
||||
font_class: "scan",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "search",
|
||||
"unicode": ""
|
||||
font_class: "search",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "settings",
|
||||
"unicode": ""
|
||||
font_class: "settings",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "settings-filled",
|
||||
"unicode": ""
|
||||
font_class: "settings-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "shop",
|
||||
"unicode": ""
|
||||
font_class: "shop",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "shop-filled",
|
||||
"unicode": ""
|
||||
font_class: "shop-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "smallcircle",
|
||||
"unicode": ""
|
||||
font_class: "smallcircle",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "smallcircle-filled",
|
||||
"unicode": ""
|
||||
font_class: "smallcircle-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "sound",
|
||||
"unicode": ""
|
||||
font_class: "sound",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "sound-filled",
|
||||
"unicode": ""
|
||||
font_class: "sound-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "spinner-cycle",
|
||||
"unicode": ""
|
||||
font_class: "spinner-cycle",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "staff",
|
||||
"unicode": ""
|
||||
font_class: "staff",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "staff-filled",
|
||||
"unicode": ""
|
||||
font_class: "staff-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "star",
|
||||
"unicode": ""
|
||||
font_class: "star",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "star-filled",
|
||||
"unicode": ""
|
||||
font_class: "star-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "starhalf",
|
||||
"unicode": ""
|
||||
font_class: "starhalf",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "trash",
|
||||
"unicode": ""
|
||||
font_class: "trash",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "trash-filled",
|
||||
"unicode": ""
|
||||
font_class: "trash-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "tune",
|
||||
"unicode": ""
|
||||
font_class: "tune",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "tune-filled",
|
||||
"unicode": ""
|
||||
font_class: "tune-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "undo",
|
||||
"unicode": ""
|
||||
font_class: "undo",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "undo-filled",
|
||||
"unicode": ""
|
||||
font_class: "undo-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "up",
|
||||
"unicode": ""
|
||||
font_class: "up",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "top",
|
||||
"unicode": ""
|
||||
font_class: "top",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "upload",
|
||||
"unicode": ""
|
||||
font_class: "upload",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "upload-filled",
|
||||
"unicode": ""
|
||||
font_class: "upload-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "videocam",
|
||||
"unicode": ""
|
||||
font_class: "videocam",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "videocam-filled",
|
||||
"unicode": ""
|
||||
font_class: "videocam-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "vip",
|
||||
"unicode": ""
|
||||
font_class: "vip",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "vip-filled",
|
||||
"unicode": ""
|
||||
font_class: "vip-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "wallet",
|
||||
"unicode": ""
|
||||
font_class: "wallet",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "wallet-filled",
|
||||
"unicode": ""
|
||||
font_class: "wallet-filled",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "weibo",
|
||||
"unicode": ""
|
||||
font_class: "weibo",
|
||||
unicode: ""
|
||||
},
|
||||
{
|
||||
"font_class": "weixin",
|
||||
"unicode": ""
|
||||
font_class: "weixin",
|
||||
unicode: ""
|
||||
}
|
||||
];
|
||||
exports.fontData = fontData;
|
||||
|
||||
17
package-lock.json
generated
17
package-lock.json
generated
@ -41,6 +41,7 @@
|
||||
"@nichozuo/gencode-ts-cli": "^1.0.2",
|
||||
"@vue/runtime-core": "^3.2.45",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"prettier": "^3.6.2",
|
||||
"sass": "1.63.2",
|
||||
"sass-loader": "10.4.1",
|
||||
"typescript": "^4.9.4",
|
||||
@ -19335,6 +19336,22 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/prettier/-/prettier-3.6.2.tgz",
|
||||
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/pretty-format": {
|
||||
"version": "27.5.1",
|
||||
"resolved": "https://registry.npmmirror.com/pretty-format/-/pretty-format-27.5.1.tgz",
|
||||
|
||||
@ -8,7 +8,9 @@
|
||||
"prod": "uni -p mp-weixin --mode prod",
|
||||
"build:test": "uni build -p mp-weixin --mode test",
|
||||
"type-check": "vue-tsc --noEmit",
|
||||
"init-dir": "node init-dir.js $(pwd)"
|
||||
"init-dir": "node init-dir.js $(pwd)",
|
||||
"format": "prettier --write \"src/**/*.{js,ts,vue,wxss,json}\"",
|
||||
"format:check": "prettier --check \"src/**/*.{js,ts,vue,wxss,json}\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-app": "3.0.0-3081220230817001",
|
||||
@ -44,6 +46,7 @@
|
||||
"@nichozuo/gencode-ts-cli": "^1.0.2",
|
||||
"@vue/runtime-core": "^3.2.45",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"prettier": "^3.6.2",
|
||||
"sass": "1.63.2",
|
||||
"sass-loader": "10.4.1",
|
||||
"typescript": "^4.9.4",
|
||||
|
||||
34
src/App.vue
34
src/App.vue
@ -1,35 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { onHide, onLaunch, onShow } from "@dcloudio/uni-app";
|
||||
import { getCurrentInstance } from "vue";
|
||||
import { useWeAppAuthStore } from "./common";
|
||||
import { CheckUpdate } from "./common/libraries/updateManager";
|
||||
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
|
||||
import { getCurrentInstance } from 'vue'
|
||||
import { useWeAppAuthStore } from './common'
|
||||
import { CheckUpdate } from './common/libraries/updateManager'
|
||||
|
||||
const auth = useWeAppAuthStore();
|
||||
const auth = useWeAppAuthStore()
|
||||
const globalData = {
|
||||
//全局变量
|
||||
selectProject: {},
|
||||
//当前默认角色
|
||||
selectedOrg: {},
|
||||
};
|
||||
selectedOrg: {}
|
||||
}
|
||||
|
||||
onLaunch(async () => {
|
||||
const app = getCurrentInstance();
|
||||
await auth.login(app);
|
||||
console.log("App Launch");
|
||||
const app = getCurrentInstance()
|
||||
await auth.login(app)
|
||||
console.log('App Launch')
|
||||
// 检查更新
|
||||
// #ifdef MP-WEIXIN
|
||||
CheckUpdate();
|
||||
CheckUpdate()
|
||||
// #endif
|
||||
});
|
||||
})
|
||||
onShow(async () => {
|
||||
console.log("App Show");
|
||||
});
|
||||
console.log('App Show')
|
||||
})
|
||||
onHide(() => {
|
||||
console.log("App Hide");
|
||||
});
|
||||
console.log('App Hide')
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "uview-plus/index.scss";
|
||||
@import 'uview-plus/index.scss';
|
||||
// .tab_page {
|
||||
// padding-bottom: calc(48px + constant(safe-area-inset-bottom));
|
||||
// padding-bottom: calc(48px + env(safe-area-inset-bottom));
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWeAppAuthStore } from "@/common";
|
||||
import NoRight from "./NoRight.vue";
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
import NoRight from './NoRight.vue'
|
||||
|
||||
const auth: any = useWeAppAuthStore();
|
||||
const auth: any = useWeAppAuthStore()
|
||||
</script>
|
||||
|
||||
@ -3,16 +3,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
enums: MyEnumItemProps[];
|
||||
value: any;
|
||||
}>();
|
||||
enums: MyEnumItemProps[]
|
||||
value: any
|
||||
}>()
|
||||
|
||||
const item = computed(() => {
|
||||
return props.enums.find((data: MyEnumItemProps) => {
|
||||
return data.value === String(props.value);
|
||||
});
|
||||
});
|
||||
return data.value === String(props.value)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -7,36 +7,36 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWeAppAuthStore } from "@/common/store/useWeAppAuthStore";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import { useWeAppAuthStore } from '@/common/store/useWeAppAuthStore'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const auth = useWeAppAuthStore();
|
||||
const query = ref();
|
||||
const auth = useWeAppAuthStore()
|
||||
const query = ref()
|
||||
|
||||
onLoad((options) => {
|
||||
query.value = options;
|
||||
});
|
||||
onLoad(options => {
|
||||
query.value = options
|
||||
})
|
||||
|
||||
function refreshPage() {
|
||||
// 获取当前页面的实例
|
||||
const pages = getCurrentPages();
|
||||
const currentPage: any = pages[pages.length - 1];
|
||||
console.log("currentPage", currentPage);
|
||||
const path = currentPage.$page.fullPath;
|
||||
const pages = getCurrentPages()
|
||||
const currentPage: any = pages[pages.length - 1]
|
||||
console.log('currentPage', currentPage)
|
||||
const path = currentPage.$page.fullPath
|
||||
if (currentPage.$page.options) {
|
||||
const options = currentPage.$page.options;
|
||||
const options = currentPage.$page.options
|
||||
const fullPath = `${path}?${Object.keys(options)
|
||||
.map((key) => `${key}=${encodeURIComponent(options[key])}`)
|
||||
.join("&")}`;
|
||||
.map(key => `${key}=${encodeURIComponent(options[key])}`)
|
||||
.join('&')}`
|
||||
uni.reLaunch({
|
||||
url: fullPath,
|
||||
});
|
||||
console.log(fullPath);
|
||||
url: fullPath
|
||||
})
|
||||
console.log(fullPath)
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: path,
|
||||
});
|
||||
url: path
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -9,26 +9,26 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWeAppAuthStore } from "@/common";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { getCurrentInstance } from "vue";
|
||||
import Loading from "./Loading.vue";
|
||||
import NetworkError from "./NetworkError.vue";
|
||||
import useUser from "@/common/libraries/userUserLogin";
|
||||
const auth = useWeAppAuthStore();
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { getCurrentInstance } from 'vue'
|
||||
import Loading from './Loading.vue'
|
||||
import NetworkError from './NetworkError.vue'
|
||||
import useUser from '@/common/libraries/userUserLogin'
|
||||
const auth = useWeAppAuthStore()
|
||||
|
||||
onLoad(async () => {
|
||||
console.log("cc-root-view onLoad 1", auth?.loading, auth?.hasError);
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched;
|
||||
console.log("cc-root-view onLoad 2");
|
||||
});
|
||||
console.log('cc-root-view onLoad 1', auth?.loading, auth?.hasError)
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
|
||||
console.log('cc-root-view onLoad 2')
|
||||
})
|
||||
|
||||
onShow(async () => {
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched;
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
|
||||
if (!useUser.getLoginStatus()) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login",
|
||||
});
|
||||
url: '/pages/login'
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -4,12 +4,7 @@
|
||||
<nchl-empty v-if="!props.meta?.total" />
|
||||
<view v-else class="scrollLoadingContainer">
|
||||
<!-- 加载状态提示 -->
|
||||
<u-loading-icon
|
||||
:text="loadingStatusTest"
|
||||
mode="circle"
|
||||
size="30rpx"
|
||||
:show="loadingStatus"
|
||||
/>
|
||||
<u-loading-icon :text="loadingStatusTest" mode="circle" size="30rpx" :show="loadingStatus" />
|
||||
<view class="showLoadingText" v-if="!loadingStatus">
|
||||
{{ loadingStatusTest }}
|
||||
</view>
|
||||
@ -17,60 +12,60 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onReachBottom } from "@dcloudio/uni-app";
|
||||
import { defineProps, ref, watch } from "vue";
|
||||
import { onReachBottom } from '@dcloudio/uni-app'
|
||||
import { defineProps, ref, watch } from 'vue'
|
||||
|
||||
const loadingStatusTest = ref("");
|
||||
const loadingStatus = ref(false);
|
||||
const loadingStatusTest = ref('')
|
||||
const loadingStatus = ref(false)
|
||||
const params = ref({
|
||||
page: 1,
|
||||
perPage: 20,
|
||||
});
|
||||
perPage: 20
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
meta: {
|
||||
type: Object,
|
||||
default: {}, // 参数
|
||||
default: {} // 参数
|
||||
},
|
||||
showLoad: {
|
||||
type: Boolean,
|
||||
default: true, // 是否显示加载状态
|
||||
},
|
||||
});
|
||||
default: true // 是否显示加载状态
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(["load"]);
|
||||
const emit = defineEmits(['load'])
|
||||
|
||||
watch(
|
||||
() => props?.meta,
|
||||
() => {
|
||||
const { current_page, last_page } = props.meta;
|
||||
const hasNextPage = current_page < last_page;
|
||||
loadingStatus.value = hasNextPage;
|
||||
loadingStatusTest.value = hasNextPage ? "上拉加载更多" : "已经到底啦~";
|
||||
console.log(props?.meta, "meta数据变化");
|
||||
const { current_page, last_page } = props.meta
|
||||
const hasNextPage = current_page < last_page
|
||||
loadingStatus.value = hasNextPage
|
||||
loadingStatusTest.value = hasNextPage ? '上拉加载更多' : '已经到底啦~'
|
||||
console.log(props?.meta, 'meta数据变化')
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
// 处理加载更多
|
||||
const handleLoad = () => {
|
||||
const { current_page, last_page } = props.meta;
|
||||
const { current_page, last_page } = props.meta
|
||||
// 计算是否有下一页
|
||||
const hasNextPage = current_page < last_page;
|
||||
loadingStatus.value = hasNextPage;
|
||||
loadingStatusTest.value = hasNextPage ? "上拉加载更多" : "已经到底啦~";
|
||||
const hasNextPage = current_page < last_page
|
||||
loadingStatus.value = hasNextPage
|
||||
loadingStatusTest.value = hasNextPage ? '上拉加载更多' : '已经到底啦~'
|
||||
|
||||
if (hasNextPage) {
|
||||
params.value.page = current_page + 1;
|
||||
params.value.page = current_page + 1
|
||||
// 触发父组件加载更多事件
|
||||
emit("load", params.value);
|
||||
emit('load', params.value)
|
||||
setTimeout(() => {
|
||||
loadingStatus.value = false;
|
||||
loadingStatusTest.value = "";
|
||||
}, 1000);
|
||||
loadingStatus.value = false
|
||||
loadingStatusTest.value = ''
|
||||
}, 1000)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
onReachBottom(handleLoad);
|
||||
onReachBottom(handleLoad)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// export * from "./libraries/pinia/auth";
|
||||
// export * from "./hooks/useMyWebSocket";
|
||||
export * from "./libraries/request";
|
||||
export * from "./store/useWeAppAuthStore";
|
||||
export * from './libraries/request'
|
||||
export * from './store/useWeAppAuthStore'
|
||||
|
||||
// export * from "./store/auth";
|
||||
// export * from "./store/goods";
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
export async function getApiLoading(Apis: any, data: any) {
|
||||
uni.showLoading({ title: "加载中...", mask: true });
|
||||
let res = await Apis(data);
|
||||
uni.hideLoading();
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
let res = await Apis(data)
|
||||
uni.hideLoading()
|
||||
if (res.success) {
|
||||
return res;
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,56 +1,56 @@
|
||||
import dayjs from "dayjs";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
dayjs.locale("zh-cn"); // 设置为中文
|
||||
import dayjs from 'dayjs'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
dayjs.locale('zh-cn') // 设置为中文
|
||||
// 使用相对时间插件
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(relativeTime)
|
||||
export function RelativeTime(time: number) {
|
||||
return dayjs(time * 1000).fromNow();
|
||||
return dayjs(time * 1000).fromNow()
|
||||
}
|
||||
|
||||
export function showDay(time: number) {
|
||||
return dayjs(time).format("YYYY-MM-DD");
|
||||
return dayjs(time).format('YYYY-MM-DD')
|
||||
}
|
||||
|
||||
export function getDay(num?: number) {
|
||||
if (num) {
|
||||
const yesterday = dayjs().subtract(num, "day");
|
||||
console.log(yesterday.format("YYYY-MM-DD"));
|
||||
return yesterday.format("YYYY-MM-DD");
|
||||
const yesterday = dayjs().subtract(num, 'day')
|
||||
console.log(yesterday.format('YYYY-MM-DD'))
|
||||
return yesterday.format('YYYY-MM-DD')
|
||||
}
|
||||
return dayjs().format("YYYY-MM-DD");
|
||||
return dayjs().format('YYYY-MM-DD')
|
||||
}
|
||||
|
||||
export function getOverDay(num: number, type: string) {
|
||||
const currentDate = dayjs();
|
||||
const formattedCurrentDate = currentDate.format("YYYY-MM-DD");
|
||||
console.log("当前日期:", formattedCurrentDate);
|
||||
if (type === "day") {
|
||||
const currentDate = dayjs()
|
||||
const formattedCurrentDate = currentDate.format('YYYY-MM-DD')
|
||||
console.log('当前日期:', formattedCurrentDate)
|
||||
if (type === 'day') {
|
||||
//获取过去num天的日期
|
||||
const pastFifteenDays = dayjs().subtract(num, "day");
|
||||
const formattedPastFifteenDays = pastFifteenDays.format("YYYY-MM-DD");
|
||||
return [formattedPastFifteenDays, formattedCurrentDate];
|
||||
const pastFifteenDays = dayjs().subtract(num, 'day')
|
||||
const formattedPastFifteenDays = pastFifteenDays.format('YYYY-MM-DD')
|
||||
return [formattedPastFifteenDays, formattedCurrentDate]
|
||||
}
|
||||
if (type === "month") {
|
||||
if (type === 'month') {
|
||||
// 获取过去num个月的日期
|
||||
const pastTwelveMonths = dayjs().subtract(num, "month");
|
||||
const formattedPastTwelveMonths = pastTwelveMonths.format("YYYY-MM-DD");
|
||||
return [formattedPastTwelveMonths, formattedCurrentDate];
|
||||
const pastTwelveMonths = dayjs().subtract(num, 'month')
|
||||
const formattedPastTwelveMonths = pastTwelveMonths.format('YYYY-MM-DD')
|
||||
return [formattedPastTwelveMonths, formattedCurrentDate]
|
||||
}
|
||||
}
|
||||
|
||||
export function getThreeMonthsLater(num = 3, dateString: string) {
|
||||
const date = dayjs(dateString);
|
||||
const threeMonthsLater = date.add(num || 3, "month");
|
||||
return threeMonthsLater.format("YYYY-MM-DD");
|
||||
const date = dayjs(dateString)
|
||||
const threeMonthsLater = date.add(num || 3, 'month')
|
||||
return threeMonthsLater.format('YYYY-MM-DD')
|
||||
}
|
||||
|
||||
export function isSameDay(day: string) {
|
||||
//是否是当天-还款日期
|
||||
const date1 = new Date(day);
|
||||
const date2 = new Date();
|
||||
const date1 = new Date(day)
|
||||
const date2 = new Date()
|
||||
return (
|
||||
date1.getFullYear() === date2.getFullYear() &&
|
||||
date1.getMonth() === date2.getMonth() &&
|
||||
date1.getDate() === date2.getDate()
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
// 如果url是tab的页面,使用switchTab,否则使用navigateTo
|
||||
export function goto(url: string) {
|
||||
uni.navigateTo({ url, fail: () => uni.switchTab({ url }) });
|
||||
uni.navigateTo({ url, fail: () => uni.switchTab({ url }) })
|
||||
}
|
||||
export function showToastBack(label?: string, delta = 1, back = true) {
|
||||
uni.showToast({
|
||||
title: label || "提交成功!",
|
||||
title: label || '提交成功!',
|
||||
duration: 1000,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
success() {
|
||||
if (back) {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({ delta });
|
||||
}, 1000);
|
||||
uni.navigateBack({ delta })
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export const payType = {
|
||||
ALIPAY: { label: "支付宝支付", icon: "alipay" },
|
||||
WXPAY: { label: "微信支付", icon: "wxpay" },
|
||||
WEIXIN: { label: "微信支付", icon: "wxpay" },
|
||||
CCB: { label: "建行", icon: "ccbPay" },
|
||||
};
|
||||
ALIPAY: { label: '支付宝支付', icon: 'alipay' },
|
||||
WXPAY: { label: '微信支付', icon: 'wxpay' },
|
||||
WEIXIN: { label: '微信支付', icon: 'wxpay' },
|
||||
CCB: { label: '建行', icon: 'ccbPay' }
|
||||
}
|
||||
|
||||
@ -1,75 +1,73 @@
|
||||
export const monthsDifferenceEndDay = (str: string, num: number) => {
|
||||
// 获取当前日期
|
||||
const currentDate = new Date(str);
|
||||
const currentDate = new Date(str)
|
||||
// 创建一个新的日期对象,用于存储加3个月后的日期
|
||||
const futureDate = new Date(currentDate);
|
||||
const futureDate = new Date(currentDate)
|
||||
// 加3个月
|
||||
futureDate.setMonth(futureDate.getMonth() + num);
|
||||
futureDate.setMonth(futureDate.getMonth() + num)
|
||||
// 减去1天
|
||||
futureDate.setDate(futureDate.getDate() - 1);
|
||||
futureDate.setDate(futureDate.getDate() - 1)
|
||||
// 格式化为 YYYY-MM-DD
|
||||
const formattedDate = futureDate.toISOString().split("T")[0];
|
||||
return formattedDate;
|
||||
};
|
||||
const formattedDate = futureDate.toISOString().split('T')[0]
|
||||
return formattedDate
|
||||
}
|
||||
export const getNextYearDate = (date: string) => {
|
||||
//获取一年后日期
|
||||
if (date) {
|
||||
// 设置目标日期为2023-07-11
|
||||
const targetDate = new Date(date);
|
||||
targetDate.setDate(targetDate.getDate() - 1); //方法一
|
||||
const targetDate = new Date(date)
|
||||
targetDate.setDate(targetDate.getDate() - 1) //方法一
|
||||
// 获取一年后的日期
|
||||
targetDate.setFullYear(targetDate.getFullYear() + 1);
|
||||
return targetDate.toISOString().split("T")[0];
|
||||
targetDate.setFullYear(targetDate.getFullYear() + 1)
|
||||
return targetDate.toISOString().split('T')[0]
|
||||
} else {
|
||||
return undefined;
|
||||
return undefined
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const compareDates = (date1: string, date2: string): number => {
|
||||
// 创建日期对象
|
||||
const dateObj1 = new Date(date1);
|
||||
const dateObj2 = new Date(date2);
|
||||
const dateObj1 = new Date(date1)
|
||||
const dateObj2 = new Date(date2)
|
||||
// 比较日期
|
||||
if (dateObj1 > dateObj2) {
|
||||
return 1; // date1 大于 date2
|
||||
return 1 // date1 大于 date2
|
||||
} else if (dateObj1 < dateObj2) {
|
||||
return -1; // date1 小于 date2
|
||||
return -1 // date1 小于 date2
|
||||
} else {
|
||||
return 0; // date1 等于 date2
|
||||
return 0 // date1 等于 date2
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const calculateDaysDifference = (selectedDate: string) => {
|
||||
//获取选择的日期与当前的日期相差多少天
|
||||
// 创建当前日期对象
|
||||
const currentDate: any = new Date();
|
||||
const currentDate: any = new Date()
|
||||
// 创建选择的日期对象
|
||||
const selectedDateObj: any = new Date(selectedDate);
|
||||
const selectedDateObj: any = new Date(selectedDate)
|
||||
// 计算两个日期的毫秒差
|
||||
const timeDifference = currentDate - selectedDateObj;
|
||||
const timeDifference = currentDate - selectedDateObj
|
||||
// 将毫秒差转换为天数差
|
||||
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
|
||||
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24))
|
||||
|
||||
return daysDifference;
|
||||
};
|
||||
return daysDifference
|
||||
}
|
||||
|
||||
export const DaysDifference = (selectedDate: string) => {
|
||||
//获取选择的日期与当前的日期相差多少天
|
||||
// 创建当前日期对象
|
||||
const currentDate: any = new Date();
|
||||
const currentDate: any = new Date()
|
||||
// 创建选择的日期对象
|
||||
const selectedDateObj: any = new Date(selectedDate);
|
||||
const selectedDateObj: any = new Date(selectedDate)
|
||||
// 计算两个日期的毫秒差
|
||||
const timeDifference = selectedDateObj - currentDate;
|
||||
const timeDifference = selectedDateObj - currentDate
|
||||
// 将毫秒差转换为天数差
|
||||
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
|
||||
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24))
|
||||
|
||||
return daysDifference;
|
||||
};
|
||||
return daysDifference
|
||||
}
|
||||
|
||||
export const onSplitArray = (val: string, type: string) => {
|
||||
let resultArray = val.split(type);
|
||||
return resultArray;
|
||||
};
|
||||
|
||||
|
||||
let resultArray = val.split(type)
|
||||
return resultArray
|
||||
}
|
||||
|
||||
@ -1,55 +1,54 @@
|
||||
import Request from "luch-request";
|
||||
import { useWeAppAuthStore } from "../store/useWeAppAuthStore";
|
||||
import Request from 'luch-request'
|
||||
import { useWeAppAuthStore } from '../store/useWeAppAuthStore'
|
||||
|
||||
const http = new Request();
|
||||
const http = new Request()
|
||||
|
||||
http.setConfig((config) => {
|
||||
config.baseURL = import.meta.env.VITE_HTTP_BASE_URL;
|
||||
http.setConfig(config => {
|
||||
config.baseURL = import.meta.env.VITE_HTTP_BASE_URL
|
||||
config.header = {
|
||||
...config.header,
|
||||
};
|
||||
return config;
|
||||
});
|
||||
...config.header
|
||||
}
|
||||
return config
|
||||
})
|
||||
|
||||
http.interceptors.request.use(
|
||||
(config) => {
|
||||
config => {
|
||||
config.header = {
|
||||
...config.header,
|
||||
Authorization:
|
||||
"Bearer " + uni.getStorageSync(import.meta.env.VITE_ACCESS_TOKEN_KEY),
|
||||
};
|
||||
return config;
|
||||
Authorization: 'Bearer ' + uni.getStorageSync(import.meta.env.VITE_ACCESS_TOKEN_KEY)
|
||||
}
|
||||
return config
|
||||
},
|
||||
(config) => {
|
||||
return Promise.reject(config);
|
||||
config => {
|
||||
return Promise.reject(config)
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
http.interceptors.response.use(
|
||||
(response) => {
|
||||
response => {
|
||||
// console.log("response", response);
|
||||
const data = response.data;
|
||||
uni.hideLoading();
|
||||
const data = response.data
|
||||
uni.hideLoading()
|
||||
if (data.success !== true) {
|
||||
if (data.errorCode === 10001) {
|
||||
const auth = useWeAppAuthStore();
|
||||
auth.loading = false;
|
||||
uni.showToast({ title: data.errorMessage, icon: "none" });
|
||||
const auth = useWeAppAuthStore()
|
||||
auth.loading = false
|
||||
uni.showToast({ title: data.errorMessage, icon: 'none' })
|
||||
} else {
|
||||
uni.showToast({ title: data.errorMessage, icon: "none" });
|
||||
uni.showToast({ title: data.errorMessage, icon: 'none' })
|
||||
}
|
||||
return Promise.reject(response.data);
|
||||
return Promise.reject(response.data)
|
||||
}
|
||||
return response.data;
|
||||
return response.data
|
||||
},
|
||||
(response) => {
|
||||
console.log("error", response);
|
||||
const auth = useWeAppAuthStore();
|
||||
auth.loading = false;
|
||||
return Promise.reject(response);
|
||||
response => {
|
||||
console.log('error', response)
|
||||
const auth = useWeAppAuthStore()
|
||||
auth.loading = false
|
||||
return Promise.reject(response)
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
export function request(url: string, data: Record<string, any>) {
|
||||
return http.post(url, data.data);
|
||||
return http.post(url, data.data)
|
||||
}
|
||||
|
||||
@ -1,58 +1,58 @@
|
||||
import { Merchant, Investor, Agent } from "./updateMenu";
|
||||
import { Merchant, Investor, Agent } from './updateMenu'
|
||||
export function setTabBar(res: { id?: number; name?: string; type?: string }) {
|
||||
const App: any = getApp();
|
||||
App.globalData.selectedOrg = res;
|
||||
if (res?.type === "boss") {
|
||||
const App: any = getApp()
|
||||
App.globalData.selectedOrg = res
|
||||
if (res?.type === 'boss') {
|
||||
//商户-首页
|
||||
uni.switchTab({ url: "/pages/MERCHANT/index/index" });
|
||||
uni.switchTab({ url: '/pages/MERCHANT/index/index' })
|
||||
}
|
||||
if (res?.type === "investor") {
|
||||
if (res?.type === 'investor') {
|
||||
//投资方-首页
|
||||
uni.switchTab({ url: "/pages/INVESTOR/index/index" });
|
||||
uni.switchTab({ url: '/pages/INVESTOR/index/index' })
|
||||
}
|
||||
if (res?.type === "agent") {
|
||||
if (res?.type === 'agent') {
|
||||
//代理商-首页
|
||||
uni.switchTab({ url: "/pages/AGENT/index/index" });
|
||||
uni.switchTab({ url: '/pages/AGENT/index/index' })
|
||||
}
|
||||
console.log("App.globalData.selectedOrg", App.globalData.selectedOrg);
|
||||
console.log('App.globalData.selectedOrg', App.globalData.selectedOrg)
|
||||
}
|
||||
|
||||
export function setTabBarData(idx: number, type?: string) {
|
||||
const pages = getCurrentPages();
|
||||
const currentPage: any = pages[pages.length - 1];
|
||||
const pages = getCurrentPages()
|
||||
const currentPage: any = pages[pages.length - 1]
|
||||
// 检查是否有TabBar并设置选中的菜单
|
||||
if (currentPage) {
|
||||
const tabBar = currentPage.getTabBar ? currentPage.getTabBar() : null;
|
||||
const tabBar = currentPage.getTabBar ? currentPage.getTabBar() : null
|
||||
if (tabBar) {
|
||||
if (idx === 3) {
|
||||
if (type === "boss") {
|
||||
if (type === 'boss') {
|
||||
//商户菜单
|
||||
tabBar.setData({
|
||||
selected: 3,
|
||||
list: Merchant,
|
||||
});
|
||||
list: Merchant
|
||||
})
|
||||
}
|
||||
if (type === "investor") {
|
||||
if (type === 'investor') {
|
||||
//投资方菜单
|
||||
tabBar.setData({
|
||||
selected: 3,
|
||||
list: Investor,
|
||||
});
|
||||
list: Investor
|
||||
})
|
||||
}
|
||||
if (type === "agent") {
|
||||
if (type === 'agent') {
|
||||
//代理商
|
||||
tabBar.setData({
|
||||
selected: 3,
|
||||
list: Agent,
|
||||
});
|
||||
list: Agent
|
||||
})
|
||||
}
|
||||
return;
|
||||
return
|
||||
}
|
||||
tabBar.setData({
|
||||
selected: idx,
|
||||
});
|
||||
selected: idx
|
||||
})
|
||||
} else {
|
||||
console.error("当前页面没有TabBar");
|
||||
console.error('当前页面没有TabBar')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,19 +8,19 @@ export function debounce<T extends (...args: any[]) => void>(
|
||||
fn: T,
|
||||
delay: number
|
||||
): (...args: Parameters<T>) => void {
|
||||
let timer: ReturnType<typeof setTimeout> | null = null;
|
||||
let timer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
return (...args: Parameters<T>): void => {
|
||||
// 如果上次的定时器还存在,清除它
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
clearTimeout(timer)
|
||||
}
|
||||
|
||||
// 设置新的定时器
|
||||
timer = setTimeout(() => {
|
||||
fn(...args); // 执行传入的函数
|
||||
}, delay);
|
||||
};
|
||||
fn(...args) // 执行传入的函数
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -33,127 +33,126 @@ export function throttle<T extends (...args: any[]) => void>(
|
||||
fn: T,
|
||||
delay: number
|
||||
): (...args: Parameters<T>) => void {
|
||||
let lastTime = 0;
|
||||
let lastTime = 0
|
||||
|
||||
return (...args: Parameters<T>): void => {
|
||||
const now = Date.now();
|
||||
const now = Date.now()
|
||||
|
||||
if (now - lastTime >= delay) {
|
||||
lastTime = now;
|
||||
fn(...args);
|
||||
lastTime = now
|
||||
fn(...args)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export const downloadAndSaveImage = (url: string) => {
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (downloadResult) => {
|
||||
success: downloadResult => {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: downloadResult.tempFilePath,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: "保存成功",
|
||||
icon: "success",
|
||||
});
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
})
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: "保存失败",
|
||||
icon: "error",
|
||||
});
|
||||
},
|
||||
});
|
||||
title: '保存失败',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: "下载失败",
|
||||
icon: "error",
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
title: '下载失败',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const saveBase64Image = (base64Data: any) => {
|
||||
const fileSystemManager = uni.getFileSystemManager();
|
||||
const [, format, bodyData] =
|
||||
/data:image\/(\w+);base64,(.*)/.exec(base64Data) || [];
|
||||
const filePath = `${wx.env.USER_DATA_PATH}/temp_image.${format}`;
|
||||
const fileSystemManager = uni.getFileSystemManager()
|
||||
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64Data) || []
|
||||
const filePath = `${wx.env.USER_DATA_PATH}/temp_image.${format}`
|
||||
|
||||
fileSystemManager.writeFile({
|
||||
filePath,
|
||||
data: bodyData,
|
||||
encoding: "base64",
|
||||
encoding: 'base64',
|
||||
success: () => {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: "保存成功",
|
||||
icon: "success",
|
||||
});
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
})
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: "保存失败",
|
||||
icon: "error",
|
||||
});
|
||||
},
|
||||
});
|
||||
title: '保存失败',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: "文件写入失败",
|
||||
icon: "error",
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
title: '文件写入失败',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const getFormatTime = (t: Date, f?: string) => {
|
||||
const pad = (num: number) => String(num).padStart(2, "0");
|
||||
const pad = (num: number) => String(num).padStart(2, '0')
|
||||
|
||||
const year = t.getFullYear();
|
||||
const month = pad(t.getMonth() + 1);
|
||||
const date = pad(t.getDate());
|
||||
const hours = pad(t.getHours());
|
||||
const minutes = pad(t.getMinutes());
|
||||
const seconds = pad(t.getSeconds());
|
||||
const year = t.getFullYear()
|
||||
const month = pad(t.getMonth() + 1)
|
||||
const date = pad(t.getDate())
|
||||
const hours = pad(t.getHours())
|
||||
const minutes = pad(t.getMinutes())
|
||||
const seconds = pad(t.getSeconds())
|
||||
|
||||
switch (f) {
|
||||
case "YYYY-MM-DD":
|
||||
return `${year}-${month}-${date}`;
|
||||
case "YYYY-MM-DD HH:mm:ss":
|
||||
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
|
||||
case "YYYY/MM/DD":
|
||||
return `${year}/${month}/${date}`;
|
||||
case "HH:mm:ss":
|
||||
return `${hours}:${minutes}:${seconds}`;
|
||||
case "HH:mm":
|
||||
return `${hours}:${minutes}`;
|
||||
case 'YYYY-MM-DD':
|
||||
return `${year}-${month}-${date}`
|
||||
case 'YYYY-MM-DD HH:mm:ss':
|
||||
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`
|
||||
case 'YYYY/MM/DD':
|
||||
return `${year}/${month}/${date}`
|
||||
case 'HH:mm:ss':
|
||||
return `${hours}:${minutes}:${seconds}`
|
||||
case 'HH:mm':
|
||||
return `${hours}:${minutes}`
|
||||
default:
|
||||
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`; // 默认格式YYYY-MM-DD HH:mm:ss
|
||||
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}` // 默认格式YYYY-MM-DD HH:mm:ss
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class TimeRecorder {
|
||||
private startTime: number = 0; // 记录开始时间的时间戳
|
||||
private elapsedTime: number = 0; // 累计的浏览时间(单位:毫秒)
|
||||
private running: boolean = false; // 标记是否正在计时
|
||||
private startTime: number = 0 // 记录开始时间的时间戳
|
||||
private elapsedTime: number = 0 // 累计的浏览时间(单位:毫秒)
|
||||
private running: boolean = false // 标记是否正在计时
|
||||
|
||||
/**
|
||||
* 启动计时器,初始化计时
|
||||
*/
|
||||
start(): void {
|
||||
if (this.running) {
|
||||
console.warn("计时器已经在运行中");
|
||||
return;
|
||||
console.warn('计时器已经在运行中')
|
||||
return
|
||||
}
|
||||
this.startTime = Date.now(); // 记录当前时间作为起始时间
|
||||
this.elapsedTime = 0; // 重置已用时间
|
||||
this.running = true;
|
||||
this.startTime = Date.now() // 记录当前时间作为起始时间
|
||||
this.elapsedTime = 0 // 重置已用时间
|
||||
this.running = true
|
||||
}
|
||||
|
||||
/**
|
||||
@ -161,11 +160,11 @@ export class TimeRecorder {
|
||||
*/
|
||||
pause(): void {
|
||||
if (!this.running) {
|
||||
console.warn("计时器尚未启动");
|
||||
return;
|
||||
console.warn('计时器尚未启动')
|
||||
return
|
||||
}
|
||||
this.elapsedTime += Date.now() - this.startTime; // 累加已用时间
|
||||
this.running = false;
|
||||
this.elapsedTime += Date.now() - this.startTime // 累加已用时间
|
||||
this.running = false
|
||||
}
|
||||
|
||||
/**
|
||||
@ -173,19 +172,19 @@ export class TimeRecorder {
|
||||
*/
|
||||
renew(): void {
|
||||
if (this.running) {
|
||||
console.warn("计时器已经在运行中");
|
||||
return;
|
||||
console.warn('计时器已经在运行中')
|
||||
return
|
||||
}
|
||||
this.startTime = Date.now(); // 重新记录开始时间
|
||||
this.running = true;
|
||||
this.startTime = Date.now() // 重新记录开始时间
|
||||
this.running = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止计时器,放弃当前计时进度
|
||||
*/
|
||||
abort(): void {
|
||||
this.elapsedTime = 0; // 放弃当前累计的时间
|
||||
this.running = false;
|
||||
this.elapsedTime = 0 // 放弃当前累计的时间
|
||||
this.running = false
|
||||
}
|
||||
|
||||
/**
|
||||
@ -194,10 +193,8 @@ export class TimeRecorder {
|
||||
*/
|
||||
getElapsedTime(): string {
|
||||
if (this.running) {
|
||||
return (this.elapsedTime + (Date.now() - this.startTime) / 1000).toFixed(
|
||||
0
|
||||
); // 计算当前时间到起始时间的差值
|
||||
return (this.elapsedTime + (Date.now() - this.startTime) / 1000).toFixed(0) // 计算当前时间到起始时间的差值
|
||||
}
|
||||
return (this.elapsedTime / 1000).toFixed(0); // 如果计时器已停止,返回累计的时间
|
||||
return (this.elapsedTime / 1000).toFixed(0) // 如果计时器已停止,返回累计的时间
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
export function CheckUpdate() {
|
||||
const updateManager = uni.getUpdateManager();
|
||||
const updateManager = uni.getUpdateManager()
|
||||
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
// 请求完新版本信息的回调
|
||||
console.log(res.hasUpdate);
|
||||
});
|
||||
console.log(res.hasUpdate)
|
||||
})
|
||||
|
||||
updateManager.onUpdateReady(function () {
|
||||
uni.showModal({
|
||||
title: "更新提示",
|
||||
content: "新版本已经准备好,是否重启应用?",
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,是否重启应用?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate();
|
||||
updateManager.applyUpdate()
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
updateManager.onUpdateFailed(function () {
|
||||
// 新版本下载失败
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,83 +1,83 @@
|
||||
export const Merchant = [
|
||||
//商户
|
||||
{
|
||||
pagePath: "/pages/MERCHANT/index/index",
|
||||
text: "首页",
|
||||
iconPath: "/static/tabbar/home.png",
|
||||
selectedIconPath: "/static/tabbar/homeAct.png",
|
||||
pagePath: '/pages/MERCHANT/index/index',
|
||||
text: '首页',
|
||||
iconPath: '/static/tabbar/home.png',
|
||||
selectedIconPath: '/static/tabbar/homeAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/MERCHANT/pay/index",
|
||||
text: "支付",
|
||||
iconPath: "/static/tabbar/pay.png",
|
||||
selectedIconPath: "/static/tabbar/payAct.png",
|
||||
pagePath: '/pages/MERCHANT/pay/index',
|
||||
text: '支付',
|
||||
iconPath: '/static/tabbar/pay.png',
|
||||
selectedIconPath: '/static/tabbar/payAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/MERCHANT/loans/index",
|
||||
text: "支出",
|
||||
iconPath: "/static/tabbar/expenses.png",
|
||||
selectedIconPath: "/static/tabbar/expensesAct.png",
|
||||
pagePath: '/pages/MERCHANT/loans/index',
|
||||
text: '支出',
|
||||
iconPath: '/static/tabbar/expenses.png',
|
||||
selectedIconPath: '/static/tabbar/expensesAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/Me/index",
|
||||
text: "我的",
|
||||
iconPath: "/static/tabbar/me.png",
|
||||
selectedIconPath: "/static/tabbar/meAct.png",
|
||||
},
|
||||
];
|
||||
pagePath: '/pages/Me/index',
|
||||
text: '我的',
|
||||
iconPath: '/static/tabbar/me.png',
|
||||
selectedIconPath: '/static/tabbar/meAct.png'
|
||||
}
|
||||
]
|
||||
|
||||
export const Investor = [
|
||||
//投资方
|
||||
{
|
||||
pagePath: "/pages/INVESTOR/index/index",
|
||||
text: "首页",
|
||||
iconPath: "/static/tabbar/home.png",
|
||||
selectedIconPath: "/static/tabbar/homeAct.png",
|
||||
pagePath: '/pages/INVESTOR/index/index',
|
||||
text: '首页',
|
||||
iconPath: '/static/tabbar/home.png',
|
||||
selectedIconPath: '/static/tabbar/homeAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/INVESTOR/loans/index",
|
||||
text: "分期",
|
||||
iconPath: "/static/tabbar/expenses.png",
|
||||
selectedIconPath: "/static/tabbar/expensesAct.png",
|
||||
pagePath: '/pages/INVESTOR/loans/index',
|
||||
text: '分期',
|
||||
iconPath: '/static/tabbar/expenses.png',
|
||||
selectedIconPath: '/static/tabbar/expensesAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/INVESTOR/stages_det/index",
|
||||
text: "明细",
|
||||
iconPath: "/static/tabbar/pay.png",
|
||||
selectedIconPath: "/static/tabbar/payAct.png",
|
||||
pagePath: '/pages/INVESTOR/stages_det/index',
|
||||
text: '明细',
|
||||
iconPath: '/static/tabbar/pay.png',
|
||||
selectedIconPath: '/static/tabbar/payAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/Me/index",
|
||||
text: "我的",
|
||||
iconPath: "/static/tabbar/me.png",
|
||||
selectedIconPath: "/static/tabbar/meAct.png",
|
||||
},
|
||||
];
|
||||
pagePath: '/pages/Me/index',
|
||||
text: '我的',
|
||||
iconPath: '/static/tabbar/me.png',
|
||||
selectedIconPath: '/static/tabbar/meAct.png'
|
||||
}
|
||||
]
|
||||
|
||||
export const Agent = [
|
||||
//代理商
|
||||
{
|
||||
pagePath: "/pages/AGENT/index/index",
|
||||
text: "首页",
|
||||
iconPath: "/static/tabbar/home.png",
|
||||
selectedIconPath: "/static/tabbar/homeAct.png",
|
||||
pagePath: '/pages/AGENT/index/index',
|
||||
text: '首页',
|
||||
iconPath: '/static/tabbar/home.png',
|
||||
selectedIconPath: '/static/tabbar/homeAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/AGENT/pay/index",
|
||||
text: "支付",
|
||||
iconPath: "/static/tabbar/pay.png",
|
||||
selectedIconPath: "/static/tabbar/payAct.png",
|
||||
pagePath: '/pages/AGENT/pay/index',
|
||||
text: '支付',
|
||||
iconPath: '/static/tabbar/pay.png',
|
||||
selectedIconPath: '/static/tabbar/payAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/AGENT/loans/index",
|
||||
text: "支出",
|
||||
iconPath: "/static/tabbar/expenses.png",
|
||||
selectedIconPath: "/static/tabbar/expensesAct.png",
|
||||
pagePath: '/pages/AGENT/loans/index',
|
||||
text: '支出',
|
||||
iconPath: '/static/tabbar/expenses.png',
|
||||
selectedIconPath: '/static/tabbar/expensesAct.png'
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/Me/index",
|
||||
text: "我的",
|
||||
iconPath: "/static/tabbar/me.png",
|
||||
selectedIconPath: "/static/tabbar/meAct.png",
|
||||
},
|
||||
];
|
||||
pagePath: '/pages/Me/index',
|
||||
text: '我的',
|
||||
iconPath: '/static/tabbar/me.png',
|
||||
selectedIconPath: '/static/tabbar/meAct.png'
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,130 +1,125 @@
|
||||
import { Apis } from "@/gen/Apis";
|
||||
import { Apis } from '@/gen/Apis'
|
||||
|
||||
// #region pre_upload
|
||||
export interface IPreUploadResult {
|
||||
success: boolean;
|
||||
success: boolean
|
||||
data: {
|
||||
cosHost: string;
|
||||
cosKey: string;
|
||||
authorization: string;
|
||||
};
|
||||
cosHost: string
|
||||
cosKey: string
|
||||
authorization: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface IPreUploadData {
|
||||
/**
|
||||
* -
|
||||
*/
|
||||
file_ext?: string;
|
||||
file_ext?: string
|
||||
}
|
||||
|
||||
const handlePreUpload = async (val: {
|
||||
file_ext: string;
|
||||
upload_type: string;
|
||||
}) => {
|
||||
const res = await Apis.Common.Auth.PreUpload(val);
|
||||
return res;
|
||||
};
|
||||
const handlePreUpload = async (val: { file_ext: string; upload_type: string }) => {
|
||||
const res = await Apis.Common.Auth.PreUpload(val)
|
||||
return res
|
||||
}
|
||||
|
||||
export const upload = (count = 1, size = 2, mediaType = ["image"]) => {
|
||||
export const upload = (count = 1, size = 2, mediaType = ['image']) => {
|
||||
return new Promise<{ url: string; status: string; type: string | undefined }>(
|
||||
(resolve, reject) => {
|
||||
let currentCount = 0;
|
||||
let ArrImgList: any = [];
|
||||
let currentCount = 0
|
||||
let ArrImgList: any = []
|
||||
uni.chooseMedia({
|
||||
count: count > 9 ? 9 : count, //默认9
|
||||
mediaType: mediaType as ["image"],
|
||||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
|
||||
mediaType: mediaType as ['image'],
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
success: async function (i) {
|
||||
console.log("filePath", i.tempFiles);
|
||||
console.log('filePath', i.tempFiles)
|
||||
i.tempFiles?.map((k: any) => {
|
||||
console.log(k, "??kj");
|
||||
const filePath = k.tempFilePath;
|
||||
const extIndex = filePath.lastIndexOf(".");
|
||||
const filePathName = filePath.substring(
|
||||
filePath.lastIndexOf(".") + 1
|
||||
);
|
||||
const fileExt = extIndex >= -1 ? filePath.substr(extIndex + 1) : "";
|
||||
const img_size = i.tempFiles[0].size;
|
||||
const max_size = 1024 * 1024 * (size || 2); // 默认2M
|
||||
console.log(k, '??kj')
|
||||
const filePath = k.tempFilePath
|
||||
const extIndex = filePath.lastIndexOf('.')
|
||||
const filePathName = filePath.substring(filePath.lastIndexOf('.') + 1)
|
||||
const fileExt = extIndex >= -1 ? filePath.substr(extIndex + 1) : ''
|
||||
const img_size = i.tempFiles[0].size
|
||||
const max_size = 1024 * 1024 * (size || 2) // 默认2M
|
||||
if (img_size > max_size) {
|
||||
uni.showToast({
|
||||
title: `${filePathName}文件大小不能超过${size}M`,
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
handlePreUpload({
|
||||
file_ext: fileExt,
|
||||
upload_type: k?.fileType,
|
||||
}).then((res) => {
|
||||
upload_type: k?.fileType
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
const prefix = res.data.cosHost;
|
||||
const key = res.data.cosKey;
|
||||
const wxfs = uni.getFileSystemManager();
|
||||
const timestamp = Date.now();
|
||||
const prefix = res.data.cosHost
|
||||
const key = res.data.cosKey
|
||||
const wxfs = uni.getFileSystemManager()
|
||||
const timestamp = Date.now()
|
||||
wxfs.readFile({
|
||||
filePath: filePath,
|
||||
complete(e) {
|
||||
if (e?.errMsg === "readFile:ok") {
|
||||
currentCount = currentCount + 1;
|
||||
const url: string = "https://" + prefix + key;
|
||||
if (e?.errMsg === 'readFile:ok') {
|
||||
currentCount = currentCount + 1
|
||||
const url: string = 'https://' + prefix + key
|
||||
let data = {
|
||||
url: url,
|
||||
status: "done",
|
||||
type: `${k?.fileType}/${filePath.split(".")[1]}`,
|
||||
status: 'done',
|
||||
type: `${k?.fileType}/${filePath.split('.')[1]}`,
|
||||
uid: timestamp,
|
||||
size: k?.size,
|
||||
};
|
||||
console.log(data, "url");
|
||||
ArrImgList?.push(data);
|
||||
size: k?.size
|
||||
}
|
||||
console.log(data, 'url')
|
||||
ArrImgList?.push(data)
|
||||
}
|
||||
uni.showLoading({
|
||||
title: `共${i.tempFiles?.length}张/${currentCount}张`,
|
||||
mask: true,
|
||||
});
|
||||
mask: true
|
||||
})
|
||||
if (currentCount === i.tempFiles?.length) {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
uni.hideLoading()
|
||||
}, 500)
|
||||
}
|
||||
console.log("complete", e);
|
||||
console.log('complete', e)
|
||||
},
|
||||
success: function (fileRes) {
|
||||
uni.request({
|
||||
url: "https://" + prefix + key,
|
||||
method: "PUT",
|
||||
url: 'https://' + prefix + key,
|
||||
method: 'PUT',
|
||||
header: {
|
||||
"Content-Type": "image/" + fileExt,
|
||||
Authorization: res.data.authorization,
|
||||
'Content-Type': 'image/' + fileExt,
|
||||
Authorization: res.data.authorization
|
||||
},
|
||||
data: fileRes.data,
|
||||
success: function success(res) {
|
||||
console.log(res, "resUpadte");
|
||||
console.log(res, 'resUpadte')
|
||||
if (res.statusCode !== 200) {
|
||||
uni.showToast({
|
||||
title: "上传失败",
|
||||
icon: "none",
|
||||
});
|
||||
reject();
|
||||
title: '上传失败',
|
||||
icon: 'none'
|
||||
})
|
||||
reject()
|
||||
} else {
|
||||
resolve(ArrImgList);
|
||||
resolve(ArrImgList)
|
||||
}
|
||||
},
|
||||
fail: function fail() {
|
||||
uni.showToast({
|
||||
title: "上传失败",
|
||||
icon: "none",
|
||||
});
|
||||
reject();
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
title: '上传失败',
|
||||
icon: 'none'
|
||||
})
|
||||
reject()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,36 +1,36 @@
|
||||
import { Apis } from "@/gen/Apis";
|
||||
import { useWeAppAuthStore } from "../store/useWeAppAuthStore";
|
||||
const auth = useWeAppAuthStore();
|
||||
import { Apis } from '@/gen/Apis'
|
||||
import { useWeAppAuthStore } from '../store/useWeAppAuthStore'
|
||||
const auth = useWeAppAuthStore()
|
||||
export default {
|
||||
onBindPhone() {
|
||||
console.log("auth?.userInfo:", auth?.data);
|
||||
console.log('auth?.userInfo:', auth?.data)
|
||||
if (!auth?.data?.user) {
|
||||
// 未绑定手机号
|
||||
uni.showModal({
|
||||
title: "登录",
|
||||
content: "请先登录体验更多功能!",
|
||||
title: '登录',
|
||||
content: '请先登录体验更多功能!',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login",
|
||||
});
|
||||
console.log("用户点击确定");
|
||||
url: '/pages/login'
|
||||
})
|
||||
console.log('用户点击确定')
|
||||
} else if (res.cancel) {
|
||||
console.log("用户点击取消");
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
return false
|
||||
} else {
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
},
|
||||
getLoginStatus() {
|
||||
if (!auth?.data?.user) {
|
||||
// 是否登录
|
||||
return false;
|
||||
return false
|
||||
} else {
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,59 +1,59 @@
|
||||
export default {
|
||||
addWatermark(imagePath: string, watermarkTxt: string) {
|
||||
//图片预览带水印
|
||||
const ctx = uni.createCanvasContext("myCanvas");
|
||||
const ctx = uni.createCanvasContext('myCanvas')
|
||||
|
||||
// 获取图片信息
|
||||
uni.getImageInfo({
|
||||
src: imagePath,
|
||||
success: (imageInfo) => {
|
||||
const { width, height } = imageInfo;
|
||||
console.log(imageInfo, "imageInfo");
|
||||
success: imageInfo => {
|
||||
const { width, height } = imageInfo
|
||||
console.log(imageInfo, 'imageInfo')
|
||||
// 计算等比缩放后的尺寸
|
||||
const canvasWidth = 390;
|
||||
const canvasHeight = (height * canvasWidth) / width;
|
||||
const canvasWidth = 390
|
||||
const canvasHeight = (height * canvasWidth) / width
|
||||
// 绘制原图片
|
||||
ctx.drawImage(imagePath, 0, 0, canvasWidth, canvasHeight); // 这里设置绘制的大小
|
||||
ctx.drawImage(imagePath, 0, 0, canvasWidth, canvasHeight) // 这里设置绘制的大小
|
||||
// 设置水印样式
|
||||
ctx.setFontSize(17);
|
||||
ctx.setFillStyle("#FFD415"); // 设置字体颜色
|
||||
ctx.setFontSize(17)
|
||||
ctx.setFillStyle('#FFD415') // 设置字体颜色
|
||||
// 添加水印文字
|
||||
ctx.rotate(-Math.PI / 4); // 逆时针旋转 45 度
|
||||
ctx.fillText(watermarkTxt, -500, 400); // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 200); // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 300); // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 400); // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 600); // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -550, 800); // 设置水印位置
|
||||
ctx.rotate(-Math.PI / 4) // 逆时针旋转 45 度
|
||||
ctx.fillText(watermarkTxt, -500, 400) // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 200) // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 300) // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 400) // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -200, 600) // 设置水印位置
|
||||
ctx.fillText(watermarkTxt, -550, 800) // 设置水印位置
|
||||
// 绘制完成
|
||||
ctx.draw(false, () => {
|
||||
// 转换画布为图片
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: "myCanvas",
|
||||
success: (res) => {
|
||||
console.log("水印图片地址:", res.tempFilePath);
|
||||
uni.hideLoading();
|
||||
canvasId: 'myCanvas',
|
||||
success: res => {
|
||||
console.log('水印图片地址:', res.tempFilePath)
|
||||
uni.hideLoading()
|
||||
uni.previewMedia({
|
||||
sources: [
|
||||
{
|
||||
url: res.tempFilePath,
|
||||
type: "image",
|
||||
},
|
||||
type: 'image'
|
||||
}
|
||||
],
|
||||
current: 0,
|
||||
});
|
||||
current: 0
|
||||
})
|
||||
// 可以将水印图片的路径保存或显示在界面上
|
||||
},
|
||||
fail: (err) => {
|
||||
fail: err => {
|
||||
uni.showToast({
|
||||
title: "获取失败",
|
||||
duration: 1000,
|
||||
});
|
||||
console.error(err);
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
title: '获取失败',
|
||||
duration: 1000
|
||||
})
|
||||
console.error(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,74 +1,109 @@
|
||||
import { Apis } from "@/gen/Apis";
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { getApiLoading } from "../libraries/apiLoading";
|
||||
import { setTabBar } from "../libraries/setTabBar";
|
||||
import { Apis } from '@/gen/Apis'
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { getApiLoading } from '../libraries/apiLoading'
|
||||
import { setTabBar } from '../libraries/setTabBar'
|
||||
|
||||
type DataType = {
|
||||
user?: {
|
||||
id: number;
|
||||
username: string;
|
||||
};
|
||||
orgs?: { id?: number; name?: string }[];
|
||||
selectedOrg?: { id?: number; name?: string; is_show_procedure?: number };
|
||||
};
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
orgs?: { id?: number; name?: string }[]
|
||||
selectedOrg?: { id?: number; name?: string; is_show_procedure?: number }
|
||||
}
|
||||
|
||||
export const useWeAppAuthStore = defineStore("we_app_auth", () => {
|
||||
const loading = ref<boolean>(true);
|
||||
const hasError = ref<boolean>(false);
|
||||
export const useWeAppAuthStore = defineStore('we_app_auth', () => {
|
||||
const loading = ref<boolean>(true)
|
||||
const hasError = ref<boolean>(false)
|
||||
const data = ref<DataType>({
|
||||
user: { id: 0, username: "" },
|
||||
});
|
||||
user: { id: 0, username: '' }
|
||||
})
|
||||
|
||||
function login(app: any) {
|
||||
uni.login({
|
||||
provider: "weixin", //使用微信登录
|
||||
success: function (loginRes) {
|
||||
console.log(loginRes.code)
|
||||
return false
|
||||
Apis.Login.Auth.Login({ code: loginRes.code })
|
||||
.then((res) => {
|
||||
console.log("登录", res?.data);
|
||||
data.value.user = res.data?.user;
|
||||
loading.value = false;
|
||||
uni.setStorageSync(
|
||||
import.meta.env.VITE_ACCESS_TOKEN_KEY,
|
||||
res?.data?.token?.token
|
||||
);
|
||||
app?.appContext.config.globalProperties.$isResolve();
|
||||
if (!res.data?.user) {
|
||||
//未绑定账号
|
||||
uni.redirectTo({
|
||||
url: "/pages/login",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const res = uni.getSystemInfoSync()
|
||||
if (res?.environment === 'wxwork') {
|
||||
uni?.qy?.login({
|
||||
success: function (loginRes) {
|
||||
console.log(loginRes)
|
||||
getWorkToken(app, loginRes.code)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni?.login({
|
||||
provider: 'weixin', //使用微信登录
|
||||
success: function (loginRes) {
|
||||
console.log(loginRes)
|
||||
getWXToken(app, loginRes.code)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const getWorkToken = (app: any, code: string) => {
|
||||
Apis.Login.Auth.WorkLogin({ code: code, app_id: 'ww8e14f3d20774c997' })
|
||||
.then(res => {
|
||||
console.log('登录', res?.data)
|
||||
data.value.user = res.data?.user
|
||||
loading.value = false
|
||||
uni.setStorageSync(import.meta.env.VITE_ACCESS_TOKEN_KEY, res?.data?.token?.token)
|
||||
app?.appContext.config.globalProperties.$isResolve()
|
||||
if (!res.data?.user) {
|
||||
//未绑定账号
|
||||
uni.redirectTo({
|
||||
url: '/pages/login'
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
hasError.value = true;
|
||||
});
|
||||
},
|
||||
});
|
||||
return false
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
hasError.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const getWXToken = (app: any, code: string) => {
|
||||
Apis.Login.Auth.Login({ code: code, app_id: 'wx09b52ea34b5e8855' })
|
||||
.then(res => {
|
||||
console.log('登录', res?.data)
|
||||
data.value.user = res.data?.user
|
||||
loading.value = false
|
||||
uni.setStorageSync(import.meta.env.VITE_ACCESS_TOKEN_KEY, res?.data?.token?.token)
|
||||
app?.appContext.config.globalProperties.$isResolve()
|
||||
if (!res.data?.user) {
|
||||
//未绑定账号
|
||||
uni.redirectTo({
|
||||
url: '/pages/login'
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
hasError.value = true
|
||||
})
|
||||
}
|
||||
|
||||
function me() {
|
||||
getApiLoading(Apis.Login.Auth.Me, {}).then((res) => {
|
||||
data.value.user = res.data.user;
|
||||
console.log("me", res.data);
|
||||
loading.value = false;
|
||||
hasError.value = false;
|
||||
});
|
||||
getApiLoading(Apis.Login.Auth.Me, {}).then(res => {
|
||||
data.value.user = res.data.user
|
||||
console.log('me', res.data)
|
||||
loading.value = false
|
||||
hasError.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const handleUserLogin = async (from_data: {
|
||||
username: string;
|
||||
password: string;
|
||||
code?: string
|
||||
phone?: string
|
||||
phone_validate_code?: string
|
||||
}) => {
|
||||
getApiLoading(Apis.Login.Auth.BindPhoneNumber, from_data).then((res) => {
|
||||
me();
|
||||
});
|
||||
};
|
||||
getApiLoading(Apis.Login.Auth.BindPhoneNumber, {
|
||||
app_id: 'wx09b52ea34b5e8855',
|
||||
...from_data
|
||||
}).then(res => {
|
||||
me()
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
loading,
|
||||
@ -76,6 +111,6 @@ export const useWeAppAuthStore = defineStore("we_app_auth", () => {
|
||||
data,
|
||||
login,
|
||||
me,
|
||||
handleUserLogin,
|
||||
};
|
||||
});
|
||||
handleUserLogin
|
||||
}
|
||||
})
|
||||
|
||||
24
src/common/typings.d.ts
vendored
24
src/common/typings.d.ts
vendored
@ -1,15 +1,15 @@
|
||||
type MyResponseType = {
|
||||
success?: boolean;
|
||||
data?: any;
|
||||
errorCode?: number;
|
||||
errorMessage?: string;
|
||||
showType?: any;
|
||||
meta?: any;
|
||||
};
|
||||
success?: boolean
|
||||
data?: any
|
||||
errorCode?: number
|
||||
errorMessage?: string
|
||||
showType?: any
|
||||
meta?: any
|
||||
}
|
||||
|
||||
type MyEnumItemProps = {
|
||||
label: string;
|
||||
value: string | number;
|
||||
color: string;
|
||||
textColor: string;
|
||||
};
|
||||
label: string
|
||||
value: string | number
|
||||
color: string
|
||||
textColor: string
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
@click="handleShowFile(i)"
|
||||
>
|
||||
<view class="name">
|
||||
{{ i?.name || "-" }}
|
||||
{{ i?.name || '-' }}
|
||||
</view>
|
||||
<view class="btn">查看</view>
|
||||
</view>
|
||||
@ -17,75 +17,71 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getApiLoading } from "@/common/libraries/apiLoading";
|
||||
import { Apis } from "@/gen/Apis";
|
||||
import { getApiLoading } from '@/common/libraries/apiLoading'
|
||||
import { Apis } from '@/gen/Apis'
|
||||
|
||||
const props = defineProps(["list"]);
|
||||
const props = defineProps(['list'])
|
||||
|
||||
const handleShowFile = (e: { url?: string; name?: string }) => {
|
||||
console.log(e, "e");
|
||||
console.log(e, 'e')
|
||||
if (!e?.url) {
|
||||
return uni.showToast({ title: "文件不存在", icon: "none" });
|
||||
return uni.showToast({ title: '文件不存在', icon: 'none' })
|
||||
}
|
||||
let showimg = false;
|
||||
let parts = e?.url.split("/");
|
||||
let fileName = parts[parts.length - 1];
|
||||
if (
|
||||
fileName.endsWith(".jpg") ||
|
||||
fileName.endsWith(".png") ||
|
||||
fileName.endsWith(".jpeg")
|
||||
) {
|
||||
showimg = true;
|
||||
let showimg = false
|
||||
let parts = e?.url.split('/')
|
||||
let fileName = parts[parts.length - 1]
|
||||
if (fileName.endsWith('.jpg') || fileName.endsWith('.png') || fileName.endsWith('.jpeg')) {
|
||||
showimg = true
|
||||
}
|
||||
console.log(fileName, "fileName");
|
||||
console.log(fileName, 'fileName')
|
||||
getApiLoading(Apis.Auth.TemporaryUrl, {
|
||||
filename: fileName,
|
||||
alc: "private",
|
||||
}).then((res) => {
|
||||
alc: 'private'
|
||||
}).then(res => {
|
||||
uni.showLoading({
|
||||
title: "正在打开中..",
|
||||
});
|
||||
console.log(res, "res图片");
|
||||
title: '正在打开中..'
|
||||
})
|
||||
console.log(res, 'res图片')
|
||||
if (showimg) {
|
||||
uni.downloadFile({
|
||||
url: res?.data?.url,
|
||||
success: function (e) {
|
||||
uni.hideLoading();
|
||||
console.log("文件是jpg、png或jpeg格式");
|
||||
uni.hideLoading()
|
||||
console.log('文件是jpg、png或jpeg格式')
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: [e?.tempFilePath || ""],
|
||||
});
|
||||
console.log(e, "e");
|
||||
},
|
||||
});
|
||||
return;
|
||||
urls: [e?.tempFilePath || '']
|
||||
})
|
||||
console.log(e, 'e')
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
uni.downloadFile({
|
||||
url: res?.data?.url,
|
||||
filePath: `${uni.env.USER_DATA_PATH}/${e?.name}`,
|
||||
success: function (e: { filePath?: string }) {
|
||||
const filePath = e.filePath;
|
||||
console.log(e, "filePath");
|
||||
uni.hideLoading();
|
||||
const filePath = e.filePath
|
||||
console.log(e, 'filePath')
|
||||
uni.hideLoading()
|
||||
uni.openDocument({
|
||||
filePath: filePath as string,
|
||||
showMenu: true,
|
||||
});
|
||||
showMenu: true
|
||||
})
|
||||
},
|
||||
fail() {
|
||||
uni.hideLoading();
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: "打开文件失败!",
|
||||
title: '打开文件失败!',
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
},
|
||||
});
|
||||
console.log(res, "res");
|
||||
});
|
||||
};
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(res, 'res')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -6,21 +6,21 @@
|
||||
@click="handleClick"
|
||||
@getphonenumber="handleGetPhoneNumber"
|
||||
>
|
||||
{{ props?.label || "我是按钮" }}
|
||||
{{ props?.label || '我是按钮' }}
|
||||
</button>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { defineProps, defineEmits } from "vue";
|
||||
const props = defineProps(["type", "label", "size", "openType", "buttonStyle"]);
|
||||
const emit = defineEmits(["click", "onGetPhoneNumber"]);
|
||||
import { defineProps, defineEmits } from 'vue'
|
||||
const props = defineProps(['type', 'label', 'size', 'openType', 'buttonStyle'])
|
||||
const emit = defineEmits(['click', 'onGetPhoneNumber'])
|
||||
const handleClick = () => {
|
||||
emit("click");
|
||||
};
|
||||
emit('click')
|
||||
}
|
||||
const handleGetPhoneNumber = (e: any) => {
|
||||
if (e?.detail?.errMsg === "getPhoneNumber:ok") {
|
||||
emit("onGetPhoneNumber", e);
|
||||
if (e?.detail?.errMsg === 'getPhoneNumber:ok') {
|
||||
emit('onGetPhoneNumber', e)
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style leng="scss" scoped>
|
||||
button::after {
|
||||
|
||||
@ -7,14 +7,14 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps(["title", "status", "value", "itemStyle", "url"]);
|
||||
const emit = defineEmits(["click"]);
|
||||
const props = defineProps(['title', 'status', 'value', 'itemStyle', 'url'])
|
||||
const emit = defineEmits(['click'])
|
||||
const toPage = () => {
|
||||
if (props?.url) {
|
||||
uni.navigateTo({ url: props.url });
|
||||
uni.navigateTo({ url: props.url })
|
||||
}
|
||||
emit("click");
|
||||
};
|
||||
emit('click')
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.card_cell_item {
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<view
|
||||
:style="{
|
||||
background: props.backgroundUrl
|
||||
? `url(${props.backgroundUrl || ''})`
|
||||
: '#fff',
|
||||
background: props.backgroundUrl ? `url(${props.backgroundUrl || ''})` : '#fff',
|
||||
backgroundSize: '100% 100%',
|
||||
...styles,
|
||||
...styles
|
||||
}"
|
||||
class="card_content"
|
||||
@click="$emit('click')"
|
||||
@ -28,14 +26,14 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, useSlots } from "vue";
|
||||
const props = defineProps(["title", "backgroundUrl", "styles", "borderHead"]);
|
||||
const slots = useSlots();
|
||||
import { ref, useSlots } from 'vue'
|
||||
const props = defineProps(['title', 'backgroundUrl', 'styles', 'borderHead'])
|
||||
const slots = useSlots()
|
||||
const handleGetRelationNodes = () => {
|
||||
//插槽是否有值
|
||||
let show = slots.default;
|
||||
return show;
|
||||
};
|
||||
let show = slots.default
|
||||
return show
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.card_content {
|
||||
|
||||
@ -6,34 +6,23 @@
|
||||
{{ props?.subTitle }}
|
||||
</text>
|
||||
</view>
|
||||
<view
|
||||
v-if="props?.showBtn"
|
||||
class="customer_create_card_add"
|
||||
@click="handleClick"
|
||||
>
|
||||
{{ props?.btnLabel || "添加" }}
|
||||
<view v-if="props?.showBtn" class="customer_create_card_add" @click="handleClick">
|
||||
{{ props?.btnLabel || '添加' }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { defineProps, defineEmits } from "vue";
|
||||
import { goto } from "@/common/libraries/naviHelper";
|
||||
const props = defineProps([
|
||||
"label",
|
||||
"subTitle",
|
||||
"showBtn",
|
||||
"btnLabel",
|
||||
"url",
|
||||
"styles",
|
||||
]);
|
||||
const emit = defineEmits(["handleClick"]);
|
||||
import { defineProps, defineEmits } from 'vue'
|
||||
import { goto } from '@/common/libraries/naviHelper'
|
||||
const props = defineProps(['label', 'subTitle', 'showBtn', 'btnLabel', 'url', 'styles'])
|
||||
const emit = defineEmits(['handleClick'])
|
||||
const handleClick = () => {
|
||||
if (props?.url) {
|
||||
goto(props?.url);
|
||||
goto(props?.url)
|
||||
} else {
|
||||
emit("handleClick");
|
||||
emit('handleClick')
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.customer_create_card {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<view class="left_label">
|
||||
<view class="border_left"> </view>
|
||||
<view class="label">
|
||||
{{ props?.label || "标题" }}
|
||||
{{ props?.label || '标题' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="right_value">
|
||||
@ -12,7 +12,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps(["label"]);
|
||||
const props = defineProps(['label'])
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.wl_title {
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
class="wl_cell"
|
||||
:style="{
|
||||
borderTop: props.borderTop ? '1rpx solid #eee' : '',
|
||||
padding: props?.padding || '10rpx 0',
|
||||
padding: props?.padding || '10rpx 0'
|
||||
}"
|
||||
@click="handleClick"
|
||||
>
|
||||
<view class="wl_cell_header">
|
||||
<view :style="props.titleStyle" class="title">
|
||||
{{ props?.title || "标题" }}
|
||||
{{ props?.title || '标题' }}
|
||||
<text v-if="required"> * </text>
|
||||
</view>
|
||||
<view v-if="props?.value" class="right_value">
|
||||
@ -19,9 +19,7 @@
|
||||
<slot></slot>
|
||||
</view>
|
||||
<view class="isLabelRight" v-if="props?.isLink">
|
||||
{{
|
||||
!props?.value && props?.isPlaceholder ? props?.tip || "请选择" : ""
|
||||
}}
|
||||
{{ !props?.value && props?.isPlaceholder ? props?.tip || '请选择' : '' }}
|
||||
<uni-icons type="right" size="15" color="#333"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
@ -32,30 +30,30 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { goto } from "@/common/libraries/naviHelper";
|
||||
import { goto } from '@/common/libraries/naviHelper'
|
||||
const props = defineProps([
|
||||
"title",
|
||||
"required",
|
||||
"borderTop",
|
||||
"isLink",
|
||||
"tip",
|
||||
"value",
|
||||
"url",
|
||||
"isPlaceholder",
|
||||
"padding",
|
||||
"des",
|
||||
"rightStyle",
|
||||
"titleStyle",
|
||||
]);
|
||||
const emit = defineEmits(["click"]);
|
||||
'title',
|
||||
'required',
|
||||
'borderTop',
|
||||
'isLink',
|
||||
'tip',
|
||||
'value',
|
||||
'url',
|
||||
'isPlaceholder',
|
||||
'padding',
|
||||
'des',
|
||||
'rightStyle',
|
||||
'titleStyle'
|
||||
])
|
||||
const emit = defineEmits(['click'])
|
||||
|
||||
const handleClick = () => {
|
||||
if (props?.url) {
|
||||
goto(props.url);
|
||||
goto(props.url)
|
||||
} else {
|
||||
emit("click");
|
||||
emit('click')
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.wl_cell {
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<picker
|
||||
mode="multiSelector"
|
||||
:value="pIndex"
|
||||
:range="props.Enums"
|
||||
@change="onChange"
|
||||
>
|
||||
<picker mode="multiSelector" :value="pIndex" :range="props.Enums" @change="onChange">
|
||||
<wl-cell
|
||||
:title="props?.title"
|
||||
isLink
|
||||
@ -17,28 +12,21 @@
|
||||
</picker>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
const props = defineProps([
|
||||
"Enums",
|
||||
"value",
|
||||
"tip",
|
||||
"title",
|
||||
"required",
|
||||
"borderTop",
|
||||
]);
|
||||
const emit = defineEmits(["change"]);
|
||||
const props = defineProps(['Enums', 'value', 'tip', 'title', 'required', 'borderTop'])
|
||||
const emit = defineEmits(['change'])
|
||||
|
||||
const onChange = (e: any) => {
|
||||
emit("change", e?.detail.value);
|
||||
};
|
||||
emit('change', e?.detail.value)
|
||||
}
|
||||
const pIndex = computed(() => {
|
||||
return props.Enums.map((item: any) =>
|
||||
Object.values(item)
|
||||
.filter((item: any) => item.text === props.value)
|
||||
.map((_: any, i: number) => i)
|
||||
);
|
||||
});
|
||||
)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -1,100 +1,103 @@
|
||||
<template>
|
||||
<view :class="`radio_body ${props?.display ? 'displayStyle' : ''}`" :style="props?.radioStyle">
|
||||
<view v-for="(i, index) in getEnums()" :key="`item_${index}`" :class="`item item_${props?.size} ${selectEd(i?.value, props?.valueModel) || selectEd(i?.value, selectValue)
|
||||
? 'active'
|
||||
: ''
|
||||
}`" :style="selectEd(i?.value, props?.valueModel) || selectEd(i?.value, selectValue)
|
||||
<view
|
||||
v-for="(i, index) in getEnums()"
|
||||
:key="`item_${index}`"
|
||||
:class="`item item_${props?.size} ${
|
||||
selectEd(i?.value, props?.valueModel) || selectEd(i?.value, selectValue) ? 'active' : ''
|
||||
}`"
|
||||
:style="
|
||||
selectEd(i?.value, props?.valueModel) || selectEd(i?.value, selectValue)
|
||||
? props?.selectStyle
|
||||
: ''
|
||||
" @click="onClick(i)">
|
||||
"
|
||||
@click="onClick(i)"
|
||||
>
|
||||
{{ i?.text }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
interface EnumItem {
|
||||
text?: string;
|
||||
value?: string;
|
||||
text?: string
|
||||
value?: string
|
||||
}
|
||||
const props = defineProps([
|
||||
"valueModel",
|
||||
"Enums",
|
||||
"size",
|
||||
"display",
|
||||
"radioStyle",
|
||||
"selectStyle",
|
||||
"valueLabel",
|
||||
]);
|
||||
const selectValue = ref<any>([]);
|
||||
const selectValueLabel = ref<any>([]);
|
||||
'valueModel',
|
||||
'Enums',
|
||||
'size',
|
||||
'display',
|
||||
'radioStyle',
|
||||
'selectStyle',
|
||||
'valueLabel'
|
||||
])
|
||||
const selectValue = ref<any>([])
|
||||
const selectValueLabel = ref<any>([])
|
||||
|
||||
const selectEd = (val?: string, list?: any[]) => {
|
||||
if (list?.includes(val)) {
|
||||
return true;
|
||||
return true
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const getEnums = () => {
|
||||
let list: EnumItem[] = Object.entries(
|
||||
props?.Enums as Record<string, EnumItem>
|
||||
).map(([key, value]) => ({
|
||||
text: value.text,
|
||||
value: value.value,
|
||||
}));
|
||||
return list;
|
||||
};
|
||||
const emit = defineEmits(["update:valueModel", "onChange"]);
|
||||
let list: EnumItem[] = Object.entries(props?.Enums as Record<string, EnumItem>).map(
|
||||
([key, value]) => ({
|
||||
text: value.text,
|
||||
value: value.value
|
||||
})
|
||||
)
|
||||
return list
|
||||
}
|
||||
const emit = defineEmits(['update:valueModel', 'onChange'])
|
||||
const onClick = (e: any) => {
|
||||
if (props?.display) {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
if (selectValue.value?.includes(e?.value)) {
|
||||
//删除已经存在的
|
||||
const newList = selectValue.value.filter((i: string) => i !== e?.value);
|
||||
const newList = selectValue.value.filter((i: string) => i !== e?.value)
|
||||
const newValLabelList = selectValueLabel.value.filter(
|
||||
(i: { value?: string }) => i?.value !== e?.value
|
||||
);
|
||||
selectValue.value = newList;
|
||||
selectValueLabel.value = newValLabelList;
|
||||
)
|
||||
selectValue.value = newList
|
||||
selectValueLabel.value = newValLabelList
|
||||
} else {
|
||||
//添加新的
|
||||
selectValue.value = [...selectValue.value, ...[e?.value]];
|
||||
selectValueLabel.value = [...selectValueLabel.value, ...[e]];
|
||||
selectValue.value = [...selectValue.value, ...[e?.value]]
|
||||
selectValueLabel.value = [...selectValueLabel.value, ...[e]]
|
||||
}
|
||||
emit("update:valueModel", selectValue.value);
|
||||
emit(
|
||||
"onChange",
|
||||
props?.valueLabel ? selectValueLabel.value : selectValue.value
|
||||
);
|
||||
};
|
||||
emit('update:valueModel', selectValue.value)
|
||||
emit('onChange', props?.valueLabel ? selectValueLabel.value : selectValue.value)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props?.valueModel,
|
||||
() => {
|
||||
if (props?.valueModel) {
|
||||
selectValue.value = props?.valueModel;
|
||||
handleFilter();
|
||||
selectValue.value = props?.valueModel
|
||||
handleFilter()
|
||||
}
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
const handleFilter = () => {
|
||||
selectValueLabel.value = Object.values(props?.Enums).filter((i) => {
|
||||
let item = i as { value?: string };
|
||||
return props?.valueModel?.includes(item?.value);
|
||||
});
|
||||
console.log("selectValueLabel.value", selectValueLabel.value);
|
||||
};
|
||||
selectValueLabel.value = Object.values(props?.Enums).filter(i => {
|
||||
let item = i as { value?: string }
|
||||
return props?.valueModel?.includes(item?.value)
|
||||
})
|
||||
console.log('selectValueLabel.value', selectValueLabel.value)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props?.valueModel) {
|
||||
selectValue.value = props?.valueModel;
|
||||
handleFilter();
|
||||
selectValue.value = props?.valueModel
|
||||
handleFilter()
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.radio_body {
|
||||
@ -105,7 +108,7 @@ onMounted(() => {
|
||||
|
||||
.item {
|
||||
min-width: 120rpx;
|
||||
padding:0 10rpx;
|
||||
padding: 0 10rpx;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
height: 60rpx;
|
||||
@ -123,11 +126,14 @@ onMounted(() => {
|
||||
// }
|
||||
}
|
||||
|
||||
.item_sm {}
|
||||
.item_sm {
|
||||
}
|
||||
|
||||
.item_md {}
|
||||
.item_md {
|
||||
}
|
||||
|
||||
.item_lg {}
|
||||
.item_lg {
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #333;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps(["value"]);
|
||||
const props = defineProps(['value'])
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.nchl_copy {
|
||||
|
||||
@ -3,26 +3,26 @@
|
||||
class="custom-title"
|
||||
:style="`padding-top:${capsuleRect.top}px;height:${capsuleRect.height}px;line-height:${capsuleRect.height}px;${props?.objStyle}`"
|
||||
>
|
||||
{{ titleValue || "标题" }}
|
||||
{{ titleValue || '标题' }}
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
const titleValue = ref<string>("标题");
|
||||
const capsuleRect = ref<any>({});
|
||||
const props = defineProps(["title", "objStyle"]);
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
const titleValue = ref<string>('标题')
|
||||
const capsuleRect = ref<any>({})
|
||||
const props = defineProps(['title', 'objStyle'])
|
||||
watch(
|
||||
() => props.title,
|
||||
(newVal) => {
|
||||
titleValue.value = newVal;
|
||||
console.log(newVal, "title");
|
||||
newVal => {
|
||||
titleValue.value = newVal
|
||||
console.log(newVal, 'title')
|
||||
}
|
||||
);
|
||||
)
|
||||
onMounted(() => {
|
||||
titleValue.value = props.title;
|
||||
capsuleRect.value = uni.getMenuButtonBoundingClientRect();
|
||||
console.log(capsuleRect.value, "capsuleRect");
|
||||
});
|
||||
titleValue.value = props.title
|
||||
capsuleRect.value = uni.getMenuButtonBoundingClientRect()
|
||||
console.log(capsuleRect.value, 'capsuleRect')
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.custom-title {
|
||||
|
||||
@ -8,35 +8,35 @@
|
||||
>
|
||||
<view style="display: flex">
|
||||
<view :class="`picker_${props?.valueModel ? 'value' : 'tip'}`">
|
||||
{{ props?.valueModel || props?.tip || "请选择" }}
|
||||
{{ props?.valueModel || props?.tip || '请选择' }}
|
||||
<uni-icons type="right" size="15" color="#333"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
// hasFutureDate: 是否是未来日期,即过去日期不可选,只能选择当前日期的未来时
|
||||
const props = defineProps(["valueModel", "tip", "hasFutureDate"]);
|
||||
const emit = defineEmits(["change", "update:valueModel"]);
|
||||
const startDate = ref("");
|
||||
const endDate = ref("");
|
||||
const props = defineProps(['valueModel', 'tip', 'hasFutureDate'])
|
||||
const emit = defineEmits(['change', 'update:valueModel'])
|
||||
const startDate = ref('')
|
||||
const endDate = ref('')
|
||||
const onChange = (e: any) => {
|
||||
emit("update:valueModel", e?.detail.value);
|
||||
emit("change", e?.detail.value);
|
||||
};
|
||||
emit('update:valueModel', e?.detail.value)
|
||||
emit('change', e?.detail.value)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month: string | number = date.getMonth() + 1;
|
||||
let day: string | number = date.getDate();
|
||||
month = month > 9 ? month : "0" + month;
|
||||
day = day > 9 ? day : "0" + day;
|
||||
const date = new Date()
|
||||
let year = date.getFullYear()
|
||||
let month: string | number = date.getMonth() + 1
|
||||
let day: string | number = date.getDate()
|
||||
month = month > 9 ? month : '0' + month
|
||||
day = day > 9 ? day : '0' + day
|
||||
startDate.value = props?.hasFutureDate
|
||||
? `${year}-${month}-${day}`
|
||||
: `${year - 60}-${month}-${day}`;
|
||||
endDate.value = `${year + 60}-${month}-${day}`;
|
||||
});
|
||||
: `${year - 60}-${month}-${day}`
|
||||
endDate.value = `${year + 60}-${month}-${day}`
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -23,45 +23,45 @@
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { getDay } from "@/common/libraries/day";
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { getDay } from '@/common/libraries/day'
|
||||
|
||||
interface EnumItem {
|
||||
text?: string;
|
||||
value?: string;
|
||||
text?: string
|
||||
value?: string
|
||||
}
|
||||
const props = defineProps([
|
||||
"Enums",
|
||||
"title",
|
||||
"pickerIndex",
|
||||
"value",
|
||||
"borderTop",
|
||||
"required",
|
||||
"valueModel",
|
||||
"icon",
|
||||
"iconSize",
|
||||
]);
|
||||
'Enums',
|
||||
'title',
|
||||
'pickerIndex',
|
||||
'value',
|
||||
'borderTop',
|
||||
'required',
|
||||
'valueModel',
|
||||
'icon',
|
||||
'iconSize'
|
||||
])
|
||||
|
||||
const selectValue = ref("");
|
||||
const emit = defineEmits(["change", "update:valueModel"]);
|
||||
const selectValue = ref('')
|
||||
const emit = defineEmits(['change', 'update:valueModel'])
|
||||
const onChange = (e: any) => {
|
||||
selectValue.value = e?.detail?.value;
|
||||
emit("update:valueModel", e?.detail?.value);
|
||||
emit("change", e?.detail?.value);
|
||||
};
|
||||
selectValue.value = e?.detail?.value
|
||||
emit('update:valueModel', e?.detail?.value)
|
||||
emit('change', e?.detail?.value)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props?.valueModel,
|
||||
(val) => {
|
||||
selectValue.value = val;
|
||||
val => {
|
||||
selectValue.value = val
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
if (props?.valueModel) {
|
||||
selectValue.value = props?.valueModel;
|
||||
selectValue.value = props?.valueModel
|
||||
} else {
|
||||
selectValue.value = getDay();
|
||||
selectValue.value = getDay()
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -10,19 +10,19 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps } from "vue";
|
||||
import { defineProps } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
mode?: string;
|
||||
text?: string; // 可选,提示文字
|
||||
height?: string;
|
||||
iconSize?: string | number;
|
||||
textSize?: string | number;
|
||||
}>();
|
||||
mode?: string
|
||||
text?: string // 可选,提示文字
|
||||
height?: string
|
||||
iconSize?: string | number
|
||||
textSize?: string | number
|
||||
}>()
|
||||
|
||||
const baseStyle = {
|
||||
height: props.height || "40vh",
|
||||
};
|
||||
height: props.height || '40vh'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@ -4,12 +4,12 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
const styleObj = ref();
|
||||
const props = defineProps(["Enums", "value", "type", "size"]);
|
||||
import { onMounted, ref } from 'vue'
|
||||
const styleObj = ref()
|
||||
const props = defineProps(['Enums', 'value', 'type', 'size'])
|
||||
onMounted(() => {
|
||||
styleObj.value = { color: props?.Enums?.[props.value]?.color };
|
||||
});
|
||||
styleObj.value = { color: props?.Enums?.[props.value]?.color }
|
||||
})
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.wl_enum_tag {
|
||||
|
||||
@ -10,32 +10,23 @@
|
||||
<wl-button :label="props?.btnOtherName || '返回'" size="md" />
|
||||
</view>
|
||||
<view class="wl_footer_item" @click="handleParmaryClick">
|
||||
<wl-button
|
||||
:label="props?.btnParimaryName || '提交'"
|
||||
type="primary"
|
||||
size="md"
|
||||
/>
|
||||
<wl-button :label="props?.btnParimaryName || '提交'" type="primary" size="md" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps([
|
||||
"btnParimaryName",
|
||||
"btnOtherName",
|
||||
"btnOtherShow",
|
||||
"back",
|
||||
]);
|
||||
const emit = defineEmits(["handleParmaryClick", "handleOtherClick"]);
|
||||
const props = defineProps(['btnParimaryName', 'btnOtherName', 'btnOtherShow', 'back'])
|
||||
const emit = defineEmits(['handleParmaryClick', 'handleOtherClick'])
|
||||
const handleParmaryClick = () => {
|
||||
emit("handleParmaryClick");
|
||||
};
|
||||
emit('handleParmaryClick')
|
||||
}
|
||||
const handleOtherClick = () => {
|
||||
emit("handleOtherClick");
|
||||
emit('handleOtherClick')
|
||||
if (props?.back) {
|
||||
uni.navigateBack({ delta: 1 });
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.wl_footer {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
:placeholder-style="props.placeholderStyle"
|
||||
:style="{
|
||||
width: props?.width || '300rpx',
|
||||
textAlign: props?.textAlign,
|
||||
textAlign: props?.textAlign
|
||||
}"
|
||||
@change="onChange"
|
||||
:placeholder="props?.placeholder || '请输入'"
|
||||
@ -21,69 +21,58 @@
|
||||
:password="props?.password || false"
|
||||
/>
|
||||
<view v-if="valueModel.length" class="close">
|
||||
<uni-icons
|
||||
@click="emptyInput"
|
||||
type="closeempty"
|
||||
color="#999999"
|
||||
size="12"
|
||||
/>
|
||||
<uni-icons @click="emptyInput" type="closeempty" color="#999999" size="12" />
|
||||
</view>
|
||||
<view v-if="suffix" class="suffix">{{ suffix }}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch, ref, onMounted } from "vue";
|
||||
import { wlInputProps } from "./reducer";
|
||||
const valueModel = ref("");
|
||||
import { watch, ref, onMounted } from 'vue'
|
||||
import { wlInputProps } from './reducer'
|
||||
const valueModel = ref('')
|
||||
|
||||
// ======================= props & emit =======================
|
||||
const props = defineProps(wlInputProps);
|
||||
const emit = defineEmits([
|
||||
"update:valueModel",
|
||||
"input",
|
||||
"blur",
|
||||
"bindconfirm",
|
||||
"onClose",
|
||||
]);
|
||||
const props = defineProps(wlInputProps)
|
||||
const emit = defineEmits(['update:valueModel', 'input', 'blur', 'bindconfirm', 'onClose'])
|
||||
|
||||
watch(
|
||||
() => props.valueModel,
|
||||
(val) => {
|
||||
valueModel.value = val;
|
||||
handleChange(val);
|
||||
val => {
|
||||
valueModel.value = val
|
||||
handleChange(val)
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
valueModel.value = props.valueModel;
|
||||
handleChange(props.valueModel);
|
||||
});
|
||||
valueModel.value = props.valueModel
|
||||
handleChange(props.valueModel)
|
||||
})
|
||||
const onChange = (e: Event) => {
|
||||
const target = e.target as HTMLInputElement;
|
||||
let value = target.value;
|
||||
handleChange(value);
|
||||
};
|
||||
const target = e.target as HTMLInputElement
|
||||
let value = target.value
|
||||
handleChange(value)
|
||||
}
|
||||
|
||||
const handleChange = (value: string) => {
|
||||
emit("update:valueModel", value);
|
||||
emit("input", value);
|
||||
};
|
||||
emit('update:valueModel', value)
|
||||
emit('input', value)
|
||||
}
|
||||
|
||||
const onBlur = () => {
|
||||
emit("blur", props.valueModel);
|
||||
};
|
||||
emit('blur', props.valueModel)
|
||||
}
|
||||
|
||||
const onConfirm = (e: any) => {
|
||||
const target = e.target as HTMLInputElement;
|
||||
let value = target.value;
|
||||
emit("bindconfirm", value);
|
||||
};
|
||||
const target = e.target as HTMLInputElement
|
||||
let value = target.value
|
||||
emit('bindconfirm', value)
|
||||
}
|
||||
|
||||
const emptyInput = () => {
|
||||
valueModel.value = "";
|
||||
onChange({ target: { value: "" } });
|
||||
};
|
||||
valueModel.value = ''
|
||||
onChange({ target: { value: '' } })
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.input_content {
|
||||
|
||||
@ -1,81 +1,74 @@
|
||||
// 定义默认值
|
||||
export const defInputProps = {
|
||||
valueModel: "",
|
||||
placeholder: "请输入内容",
|
||||
width: "100%",
|
||||
suffix: "",
|
||||
valueModel: '',
|
||||
placeholder: '请输入内容',
|
||||
width: '100%',
|
||||
suffix: '',
|
||||
maxLength: 255,
|
||||
type: "text",
|
||||
className: "",
|
||||
placeholderStyle: "color: #ccc;font-size:25rpx;",
|
||||
classInputName: "",
|
||||
textAlign: "left",
|
||||
confirmType: "done",
|
||||
hasClose: false,
|
||||
};
|
||||
type: 'text',
|
||||
className: '',
|
||||
placeholderStyle: 'color: #ccc;font-size:25rpx;',
|
||||
classInputName: '',
|
||||
textAlign: 'left',
|
||||
confirmType: 'done',
|
||||
hasClose: false
|
||||
}
|
||||
|
||||
export const wlInputProps = {
|
||||
valueModel: {
|
||||
type: String,
|
||||
default: defInputProps.valueModel,
|
||||
default: defInputProps.valueModel
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: defInputProps.placeholder,
|
||||
default: defInputProps.placeholder
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: defInputProps.width,
|
||||
default: defInputProps.width
|
||||
},
|
||||
suffix: {
|
||||
type: String,
|
||||
default: defInputProps.suffix,
|
||||
default: defInputProps.suffix
|
||||
},
|
||||
maxLength: {
|
||||
type: Number,
|
||||
default: defInputProps.maxLength,
|
||||
default: defInputProps.maxLength
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: defInputProps.type,
|
||||
default: defInputProps.type
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: defInputProps.className,
|
||||
default: defInputProps.className
|
||||
},
|
||||
placeholderStyle: {
|
||||
type: String,
|
||||
default: defInputProps.placeholderStyle,
|
||||
default: defInputProps.placeholderStyle
|
||||
},
|
||||
classInputName: {
|
||||
type: String,
|
||||
default: defInputProps.classInputName,
|
||||
default: defInputProps.classInputName
|
||||
},
|
||||
password: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
textAlign: {
|
||||
type: String as () => any,
|
||||
default: defInputProps.textAlign,
|
||||
default: defInputProps.textAlign
|
||||
},
|
||||
confirmType: {
|
||||
type: String as () =>
|
||||
| "enter"
|
||||
| "done"
|
||||
| "go"
|
||||
| "next"
|
||||
| "previous"
|
||||
| "search"
|
||||
| "send",
|
||||
default: defInputProps.confirmType,
|
||||
type: String as () => 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send',
|
||||
default: defInputProps.confirmType
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
hasClose: {
|
||||
type: Boolean,
|
||||
default: defInputProps.hasClose,
|
||||
},
|
||||
};
|
||||
default: defInputProps.hasClose
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,7 @@
|
||||
<view class="select_day_btn" @click="onPopupShow">
|
||||
<template v-if="custom_date_select?.length > 1">
|
||||
<text>
|
||||
{{ custom_date_select[0] }}至{{
|
||||
custom_date_select[1] ? custom_date_select[1] : ""
|
||||
}}
|
||||
{{ custom_date_select[0] }}至{{ custom_date_select[1] ? custom_date_select[1] : '' }}
|
||||
</text>
|
||||
<uni-icons type="down" color="#333" size="12" />
|
||||
</template>
|
||||
@ -14,13 +12,7 @@
|
||||
<uni-icons type="down" color="#333" size="12" />
|
||||
</template>
|
||||
</view>
|
||||
<nchl-popup
|
||||
:show="popupShow"
|
||||
@close="onPopupShow"
|
||||
mode="bottom"
|
||||
closeable
|
||||
:round="20"
|
||||
>
|
||||
<nchl-popup :show="popupShow" @close="onPopupShow" mode="bottom" closeable :round="20">
|
||||
<view class="popup_day_select_body">
|
||||
<view class="popup_day_select_title"> 日期选择 </view>
|
||||
|
||||
@ -40,12 +32,10 @@
|
||||
<view class="popup_day_select_right">
|
||||
<view class="select_date_group_btn">
|
||||
<view
|
||||
v-for="(i,idx) in dateSelect[dayType?.value as keyof typeof dateSelect]"
|
||||
v-for="(i, idx) in dateSelect[dayType?.value as keyof typeof dateSelect]"
|
||||
:key="`key_${idx}`"
|
||||
:class="`select_date_btn ${
|
||||
i?.value === dateSelectEd?.value
|
||||
? 'select_date_btn_active'
|
||||
: ''
|
||||
i?.value === dateSelectEd?.value ? 'select_date_btn_active' : ''
|
||||
}`"
|
||||
@click="onSelectDateValue(i)"
|
||||
>
|
||||
@ -82,94 +72,85 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_day_footer">
|
||||
<nchl-button
|
||||
style="width: 100%"
|
||||
label="确定"
|
||||
size="md"
|
||||
@click="onSubmit"
|
||||
/>
|
||||
<nchl-button style="width: 100%" label="确定" size="md" @click="onSubmit" />
|
||||
</view>
|
||||
</view>
|
||||
</nchl-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { getOverDay, getThreeMonthsLater } from "@/common/libraries/day";
|
||||
const emit = defineEmits(["close", "change"]);
|
||||
const okShowDayInfo = ref({ label: "按日", value: "近7天" });
|
||||
const dayType = ref({ label: "按日", value: "day" });
|
||||
const dateSelectEd = ref({ label: "近7天", value: 7 });
|
||||
const popupShow = ref(false);
|
||||
const custom_date_select = ref<any>([]);
|
||||
const custom_end_day = ref("");
|
||||
import { ref } from 'vue'
|
||||
import { getOverDay, getThreeMonthsLater } from '@/common/libraries/day'
|
||||
const emit = defineEmits(['close', 'change'])
|
||||
const okShowDayInfo = ref({ label: '按日', value: '近7天' })
|
||||
const dayType = ref({ label: '按日', value: 'day' })
|
||||
const dateSelectEd = ref({ label: '近7天', value: 7 })
|
||||
const popupShow = ref(false)
|
||||
const custom_date_select = ref<any>([])
|
||||
const custom_end_day = ref('')
|
||||
|
||||
const onPopupShow = () => {
|
||||
popupShow.value = !popupShow.value;
|
||||
};
|
||||
popupShow.value = !popupShow.value
|
||||
}
|
||||
|
||||
const onSelectType = (e: { label: string; value: string }) => {
|
||||
dayType.value = e;
|
||||
dateSelectEd.value =
|
||||
dateSelect[dayType?.value?.value as keyof typeof dateSelect][0];
|
||||
};
|
||||
dayType.value = e
|
||||
dateSelectEd.value = dateSelect[dayType?.value?.value as keyof typeof dateSelect][0]
|
||||
}
|
||||
|
||||
const onSelectDateValue = (e: { label: string; value: number }) => {
|
||||
dateSelectEd.value = e;
|
||||
custom_date_select.value = [];
|
||||
};
|
||||
dateSelectEd.value = e
|
||||
custom_date_select.value = []
|
||||
}
|
||||
|
||||
const onChangeStart = (e: any) => {
|
||||
custom_date_select.value[0] = e.detail.value;
|
||||
custom_end_day.value = getThreeMonthsLater(3, e.detail.value);
|
||||
console.log("onChangeEnd", e.detail.value, custom_end_day.value);
|
||||
};
|
||||
custom_date_select.value[0] = e.detail.value
|
||||
custom_end_day.value = getThreeMonthsLater(3, e.detail.value)
|
||||
console.log('onChangeEnd', e.detail.value, custom_end_day.value)
|
||||
}
|
||||
|
||||
const onChangeEnd = (e: any) => {
|
||||
custom_date_select.value[1] = e.detail.value;
|
||||
console.log("onChangeEnd", custom_date_select.value);
|
||||
};
|
||||
custom_date_select.value[1] = e.detail.value
|
||||
console.log('onChangeEnd', custom_date_select.value)
|
||||
}
|
||||
|
||||
const dayTypeList = [
|
||||
{ label: "按日", value: "day" },
|
||||
{ label: "按月", value: "month" },
|
||||
];
|
||||
{ label: '按日', value: 'day' },
|
||||
{ label: '按月', value: 'month' }
|
||||
]
|
||||
const dateSelect = {
|
||||
day: [
|
||||
{ label: "近7天", value: 7 },
|
||||
{ label: "近14天", value: 14 },
|
||||
{ label: "近30天", value: 30 },
|
||||
{ label: '近7天', value: 7 },
|
||||
{ label: '近14天', value: 14 },
|
||||
{ label: '近30天', value: 30 }
|
||||
],
|
||||
month: [
|
||||
{ label: "近6月", value: 6 },
|
||||
{ label: "近12月", value: 12 },
|
||||
],
|
||||
};
|
||||
{ label: '近6月', value: 6 },
|
||||
{ label: '近12月', value: 12 }
|
||||
]
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
if (custom_date_select?.value?.length > 1) {
|
||||
emit("change", custom_date_select.value);
|
||||
onPopupShow();
|
||||
return;
|
||||
emit('change', custom_date_select.value)
|
||||
onPopupShow()
|
||||
return
|
||||
}
|
||||
if (dateSelectEd?.value?.value) {
|
||||
let day = getOverDay(
|
||||
dateSelectEd?.value?.value as number,
|
||||
dayType?.value?.value as string
|
||||
);
|
||||
let day = getOverDay(dateSelectEd?.value?.value as number, dayType?.value?.value as string)
|
||||
okShowDayInfo.value = {
|
||||
label: dayType?.value?.label,
|
||||
value: dateSelectEd?.value?.label,
|
||||
};
|
||||
emit("change", day);
|
||||
onPopupShow();
|
||||
value: dateSelectEd?.value?.label
|
||||
}
|
||||
emit('change', day)
|
||||
onPopupShow()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请选择日期!",
|
||||
icon: "none",
|
||||
});
|
||||
title: '请选择日期!',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -4,13 +4,7 @@
|
||||
<view class="name">{{ selectEd?.name }}</view>
|
||||
<uni-icons type="down" color="#333" size="12" />
|
||||
</view>
|
||||
<nchl-popup
|
||||
:show="popupShow"
|
||||
@close="onPopupShow"
|
||||
mode="bottom"
|
||||
closeable
|
||||
:round="20"
|
||||
>
|
||||
<nchl-popup :show="popupShow" @close="onPopupShow" mode="bottom" closeable :round="20">
|
||||
<view class="popup_merchant_select_body">
|
||||
<view class="popup_merchant_select_title"> 选择商户 </view>
|
||||
|
||||
@ -37,34 +31,34 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { getApiLoading } from "@/common/libraries/apiLoading";
|
||||
import { getOverDay } from "@/common/libraries/day";
|
||||
const props = defineProps(["Apis"]);
|
||||
const emit = defineEmits(["close", "change"]);
|
||||
const selectEd = ref({ name: "全部商户", id: 0 });
|
||||
const pickerList = ref<any>([]);
|
||||
const popupShow = ref(false);
|
||||
import { ref } from 'vue'
|
||||
import { getApiLoading } from '@/common/libraries/apiLoading'
|
||||
import { getOverDay } from '@/common/libraries/day'
|
||||
const props = defineProps(['Apis'])
|
||||
const emit = defineEmits(['close', 'change'])
|
||||
const selectEd = ref({ name: '全部商户', id: 0 })
|
||||
const pickerList = ref<any>([])
|
||||
const popupShow = ref(false)
|
||||
|
||||
const onPopupShow = () => {
|
||||
popupShow.value = !popupShow.value;
|
||||
popupShow.value = !popupShow.value
|
||||
if (popupShow.value) {
|
||||
getPickerList();
|
||||
getPickerList()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const getPickerList = () => {
|
||||
getApiLoading(props?.Apis, {}).then((res) => {
|
||||
pickerList.value = [...[{ name: "全部商户", id: 0 }], ...res?.data];
|
||||
console.log(res);
|
||||
});
|
||||
};
|
||||
getApiLoading(props?.Apis, {}).then(res => {
|
||||
pickerList.value = [...[{ name: '全部商户', id: 0 }], ...res?.data]
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
const onSelectMerchant = (i: { name: string; id: number }) => {
|
||||
selectEd.value = i;
|
||||
emit("change", i);
|
||||
onPopupShow();
|
||||
};
|
||||
selectEd.value = i
|
||||
emit('change', i)
|
||||
onPopupShow()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
<template>
|
||||
<up-popup
|
||||
:customStyle="
|
||||
props?.insetBottom
|
||||
? { bottom: 'calc(env(safe-area-inset-bottom) + 48px)' }
|
||||
: {}
|
||||
"
|
||||
:overlayStyle="
|
||||
props?.insetBottom
|
||||
? { bottom: 'calc(env(safe-area-inset-bottom) + 48px)' }
|
||||
: {}
|
||||
"
|
||||
:customStyle="props?.insetBottom ? { bottom: 'calc(env(safe-area-inset-bottom) + 48px)' } : {}"
|
||||
:overlayStyle="props?.insetBottom ? { bottom: 'calc(env(safe-area-inset-bottom) + 48px)' } : {}"
|
||||
:show="props.show"
|
||||
@close="onClose"
|
||||
:mode="props?.mode || 'top'"
|
||||
@ -21,18 +13,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = defineProps([
|
||||
"show",
|
||||
"mode",
|
||||
"insetBottom",
|
||||
"round",
|
||||
"closeable",
|
||||
]);
|
||||
const emit = defineEmits(["close"]);
|
||||
const props = defineProps(['show', 'mode', 'insetBottom', 'round', 'closeable'])
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
const onClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
emit('close')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -1,16 +1,8 @@
|
||||
<template>
|
||||
<view class="privatePolicy">
|
||||
<view class="scal-box" @click="handleAgreePrivatePolicy">
|
||||
<u-checkbox-group
|
||||
:modelValue="isAgree"
|
||||
@change="handleAgreePrivatePolicy"
|
||||
>
|
||||
<u-checkbox
|
||||
shape="circle"
|
||||
:activeColor="props?.activeColor"
|
||||
name="isAgree"
|
||||
>
|
||||
</u-checkbox>
|
||||
<u-checkbox-group :modelValue="isAgree" @change="handleAgreePrivatePolicy">
|
||||
<u-checkbox shape="circle" :activeColor="props?.activeColor" name="isAgree"> </u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<view class="t-l">我已阅读并同意</view>
|
||||
</view>
|
||||
@ -22,72 +14,72 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// 《居有屋隐私政策》
|
||||
import { defineEmits, defineProps, ref, watch } from "vue";
|
||||
const isAgree = ref<string[]>([]);
|
||||
import { defineEmits, defineProps, ref, watch } from 'vue'
|
||||
const isAgree = ref<string[]>([])
|
||||
const props = defineProps({
|
||||
isAgree: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
isDisabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
policyName: {
|
||||
type: String,
|
||||
default: "隐私政策名称",
|
||||
default: '隐私政策名称'
|
||||
},
|
||||
activeColor: {
|
||||
type: String,
|
||||
default: "#3b65a9",
|
||||
},
|
||||
});
|
||||
default: '#3b65a9'
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(e: "update:isAgree", data: boolean): void;
|
||||
(e: "clickPolicy"): void;
|
||||
(e: "clickCheckbox"): void;
|
||||
}>();
|
||||
(e: 'update:isAgree', data: boolean): void
|
||||
(e: 'clickPolicy'): void
|
||||
(e: 'clickCheckbox'): void
|
||||
}>()
|
||||
|
||||
if (props.isAgree) {
|
||||
isAgree.value = ["isAgree"];
|
||||
isAgree.value = ['isAgree']
|
||||
} else {
|
||||
isAgree.value = [];
|
||||
isAgree.value = []
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props?.isAgree,
|
||||
() => {
|
||||
if (isAgree.value) {
|
||||
isAgree.value = ["isAgree"];
|
||||
isAgree.value = ['isAgree']
|
||||
} else {
|
||||
isAgree.value = [];
|
||||
isAgree.value = []
|
||||
}
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
const onPolicy = () => {
|
||||
emit("clickPolicy");
|
||||
};
|
||||
emit('clickPolicy')
|
||||
}
|
||||
|
||||
const handleAgreePrivatePolicy = () => {
|
||||
if (props.isDisabled) {
|
||||
// 禁用点击
|
||||
emit("clickCheckbox");
|
||||
isAgree.value = [];
|
||||
emit("update:isAgree", false);
|
||||
return;
|
||||
emit('clickCheckbox')
|
||||
isAgree.value = []
|
||||
emit('update:isAgree', false)
|
||||
return
|
||||
}
|
||||
|
||||
let checkbox = false;
|
||||
let checkbox = false
|
||||
if (isAgree.value?.length) {
|
||||
isAgree.value = [];
|
||||
checkbox = false;
|
||||
isAgree.value = []
|
||||
checkbox = false
|
||||
} else {
|
||||
isAgree.value = ["isAgree"];
|
||||
checkbox = true;
|
||||
isAgree.value = ['isAgree']
|
||||
checkbox = true
|
||||
}
|
||||
emit("update:isAgree", checkbox);
|
||||
};
|
||||
emit('update:isAgree', checkbox)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -9,56 +9,56 @@
|
||||
</picker>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
|
||||
interface EnumItem {
|
||||
text?: string;
|
||||
value?: string;
|
||||
type?: string;
|
||||
text?: string
|
||||
value?: string
|
||||
type?: string
|
||||
}
|
||||
const props = defineProps([
|
||||
"Enums",
|
||||
"title",
|
||||
"pickerIndex",
|
||||
"value",
|
||||
"borderTop",
|
||||
"required",
|
||||
"tip",
|
||||
"key",
|
||||
"des",
|
||||
"padding",
|
||||
"valueModel",
|
||||
"disabled",
|
||||
]);
|
||||
const pickerList = ref<any>([]);
|
||||
const emit = defineEmits(["change", "update:valueModel"]);
|
||||
'Enums',
|
||||
'title',
|
||||
'pickerIndex',
|
||||
'value',
|
||||
'borderTop',
|
||||
'required',
|
||||
'tip',
|
||||
'key',
|
||||
'des',
|
||||
'padding',
|
||||
'valueModel',
|
||||
'disabled'
|
||||
])
|
||||
const pickerList = ref<any>([])
|
||||
const emit = defineEmits(['change', 'update:valueModel'])
|
||||
const onChange = (e: any) => {
|
||||
let selectData: any = pickerList.value[e?.detail.value];
|
||||
emit("update:valueModel", selectData?.value);
|
||||
emit("change", selectData);
|
||||
};
|
||||
let selectData: any = pickerList.value[e?.detail.value]
|
||||
emit('update:valueModel', selectData?.value)
|
||||
emit('change', selectData)
|
||||
}
|
||||
|
||||
const getEnums = (): any => {
|
||||
let list: EnumItem[] = Object.entries(
|
||||
props?.Enums as Record<string, EnumItem>
|
||||
).map(([key, value]) => ({
|
||||
text: value.text,
|
||||
value: value.value,
|
||||
type: value?.type || "",
|
||||
}));
|
||||
pickerList.value = list;
|
||||
};
|
||||
let list: EnumItem[] = Object.entries(props?.Enums as Record<string, EnumItem>).map(
|
||||
([key, value]) => ({
|
||||
text: value.text,
|
||||
value: value.value,
|
||||
type: value?.type || ''
|
||||
})
|
||||
)
|
||||
pickerList.value = list
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props?.Enums,
|
||||
() => {
|
||||
getEnums();
|
||||
getEnums()
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
getEnums();
|
||||
});
|
||||
getEnums()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.rent_des {
|
||||
|
||||
@ -12,44 +12,44 @@
|
||||
</picker>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getApiLoading } from "@/common/libraries/apiLoading";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { getApiLoading } from '@/common/libraries/apiLoading'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
const props = defineProps([
|
||||
"Enums",
|
||||
"title",
|
||||
"pickerIndex",
|
||||
"value",
|
||||
"borderTop",
|
||||
"required",
|
||||
"disabled",
|
||||
"tip",
|
||||
"key",
|
||||
"des",
|
||||
"padding",
|
||||
"valueModel",
|
||||
"placeholder",
|
||||
"Apis",
|
||||
]);
|
||||
const pickerList = ref<any>([]);
|
||||
const selectValue = ref("");
|
||||
const emit = defineEmits(["change", "update:valueModel"]);
|
||||
'Enums',
|
||||
'title',
|
||||
'pickerIndex',
|
||||
'value',
|
||||
'borderTop',
|
||||
'required',
|
||||
'disabled',
|
||||
'tip',
|
||||
'key',
|
||||
'des',
|
||||
'padding',
|
||||
'valueModel',
|
||||
'placeholder',
|
||||
'Apis'
|
||||
])
|
||||
const pickerList = ref<any>([])
|
||||
const selectValue = ref('')
|
||||
const emit = defineEmits(['change', 'update:valueModel'])
|
||||
const onChange = (e: any) => {
|
||||
let selectData: any = pickerList.value[e?.detail.value];
|
||||
selectValue.value = selectData?.name;
|
||||
emit("update:valueModel", selectData?.id || "");
|
||||
emit("change", selectData);
|
||||
};
|
||||
let selectData: any = pickerList.value[e?.detail.value]
|
||||
selectValue.value = selectData?.name
|
||||
emit('update:valueModel', selectData?.id || '')
|
||||
emit('change', selectData)
|
||||
}
|
||||
|
||||
const getPickerList = () => {
|
||||
getApiLoading(props?.Apis, {}).then((res) => {
|
||||
pickerList.value = [...[{ name: props?.placeholder, id: 0 }], ...res?.data];
|
||||
console.log(res);
|
||||
});
|
||||
};
|
||||
getApiLoading(props?.Apis, {}).then(res => {
|
||||
pickerList.value = [...[{ name: props?.placeholder, id: 0 }], ...res?.data]
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getPickerList();
|
||||
});
|
||||
getPickerList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -11,21 +11,21 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
const props = defineProps(["Enums"]);
|
||||
const typeEnums = ref<any>([]);
|
||||
const selectEd = ref("BankLoan");
|
||||
const emit = defineEmits(["change"]);
|
||||
import { onMounted, ref } from 'vue'
|
||||
const props = defineProps(['Enums'])
|
||||
const typeEnums = ref<any>([])
|
||||
const selectEd = ref('BankLoan')
|
||||
const emit = defineEmits(['change'])
|
||||
const handleSelect = (e: any) => {
|
||||
selectEd.value = e.value;
|
||||
emit("change", e.value);
|
||||
};
|
||||
selectEd.value = e.value
|
||||
emit('change', e.value)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const LoansBizTypeEnumArray = Object.values(props.Enums);
|
||||
typeEnums.value = LoansBizTypeEnumArray;
|
||||
console.log(props.Enums);
|
||||
});
|
||||
const LoansBizTypeEnumArray = Object.values(props.Enums)
|
||||
typeEnums.value = LoansBizTypeEnumArray
|
||||
console.log(props.Enums)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -4,15 +4,9 @@
|
||||
v-for="(i, index) in getEnums()"
|
||||
:key="`item_${index}`"
|
||||
:class="`item item_${props?.size} ${
|
||||
i?.value === props?.valueModel || i?.value === selectValue
|
||||
? 'active'
|
||||
: ''
|
||||
i?.value === props?.valueModel || i?.value === selectValue ? 'active' : ''
|
||||
} ${props?.disableds?.includes(i?.value) ? 'disabled' : ''}`"
|
||||
:style="
|
||||
i?.value === props?.valueModel || i?.value === selectValue
|
||||
? props?.selectStyle
|
||||
: ''
|
||||
"
|
||||
:style="i?.value === props?.valueModel || i?.value === selectValue ? props?.selectStyle : ''"
|
||||
@click="onClick(i)"
|
||||
>
|
||||
{{ i?.text }}
|
||||
@ -20,54 +14,54 @@
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
interface EnumItem {
|
||||
text?: string;
|
||||
value?: string;
|
||||
text?: string
|
||||
value?: string
|
||||
}
|
||||
const props = defineProps([
|
||||
"valueModel",
|
||||
"Enums",
|
||||
"size",
|
||||
"radioStyle",
|
||||
"selectStyle",
|
||||
"disableds", // 不可选数组 6-7 kfyy ,7.40 cook,
|
||||
]);
|
||||
const selectValue = ref("");
|
||||
'valueModel',
|
||||
'Enums',
|
||||
'size',
|
||||
'radioStyle',
|
||||
'selectStyle',
|
||||
'disableds' // 不可选数组 6-7 kfyy ,7.40 cook,
|
||||
])
|
||||
const selectValue = ref('')
|
||||
const getEnums = (): any => {
|
||||
let list: EnumItem[] = Object.entries(
|
||||
props?.Enums as Record<string, EnumItem>
|
||||
).map(([_key, value]) => ({
|
||||
text: value.text,
|
||||
value: value.value,
|
||||
}));
|
||||
return list;
|
||||
};
|
||||
let list: EnumItem[] = Object.entries(props?.Enums as Record<string, EnumItem>).map(
|
||||
([_key, value]) => ({
|
||||
text: value.text,
|
||||
value: value.value
|
||||
})
|
||||
)
|
||||
return list
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props?.valueModel,
|
||||
() => {
|
||||
console.log("mounted2", props?.valueModel);
|
||||
selectValue.value = props?.valueModel;
|
||||
console.log('mounted2', props?.valueModel)
|
||||
selectValue.value = props?.valueModel
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
const emit = defineEmits(["update:valueModel", "onChange"]);
|
||||
const emit = defineEmits(['update:valueModel', 'onChange'])
|
||||
const onClick = (e: { value: string }) => {
|
||||
if (props?.disableds?.includes(e?.value)) {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
selectValue.value = e?.value;
|
||||
emit("update:valueModel", e?.value);
|
||||
emit("onChange", e);
|
||||
};
|
||||
selectValue.value = e?.value
|
||||
emit('update:valueModel', e?.value)
|
||||
emit('onChange', e)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
console.log("mounted1", props?.valueModel);
|
||||
console.log('mounted1', props?.valueModel)
|
||||
if (props?.valueModel) {
|
||||
selectValue.value = props?.valueModel;
|
||||
selectValue.value = props?.valueModel
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.radio_body {
|
||||
|
||||
@ -12,11 +12,11 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps(["current", "list"]);
|
||||
const emit = defineEmits(["onChange"]);
|
||||
const props = defineProps(['current', 'list'])
|
||||
const emit = defineEmits(['onChange'])
|
||||
const handleClick = (idx: number) => {
|
||||
emit("onChange", idx);
|
||||
};
|
||||
emit('onChange', idx)
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tabs_content {
|
||||
|
||||
@ -1,11 +1,6 @@
|
||||
<template>
|
||||
<view class="upload_body">
|
||||
<view
|
||||
v-for="(i, index) in list"
|
||||
:key="index"
|
||||
class="upload_item"
|
||||
:style="props?.styles"
|
||||
>
|
||||
<view v-for="(i, index) in list" :key="index" class="upload_item" :style="props?.styles">
|
||||
<view v-if="i?.type?.includes('video')">
|
||||
<up-icon name="play-circle-fill" size="30"></up-icon>
|
||||
</view>
|
||||
@ -52,89 +47,83 @@
|
||||
v-else
|
||||
></up-icon>
|
||||
</view>
|
||||
<view class="no_data" v-if="props?.display && !list?.length">
|
||||
无媒体文件
|
||||
</view>
|
||||
<view class="no_data" v-if="props?.display && !list?.length"> 无媒体文件 </view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import watermark from "@/common/libraries/watermark";
|
||||
import { upload } from "@/common/libraries/upload";
|
||||
import { onMounted, ref, watch, defineProps, defineEmits } from "vue";
|
||||
import watermark from '@/common/libraries/watermark'
|
||||
import { upload } from '@/common/libraries/upload'
|
||||
import { onMounted, ref, watch, defineProps, defineEmits } from 'vue'
|
||||
const props = defineProps([
|
||||
"valueModel",
|
||||
"size",
|
||||
"display",
|
||||
"length",
|
||||
"mediaType",
|
||||
"labelTitle",
|
||||
"count",
|
||||
"styles",
|
||||
"hasCover",
|
||||
"iconName",
|
||||
"iconSize",
|
||||
]);
|
||||
const emit = defineEmits(["update:valueModel"]);
|
||||
const list = ref<{ url?: string; type?: string }[]>([]);
|
||||
'valueModel',
|
||||
'size',
|
||||
'display',
|
||||
'length',
|
||||
'mediaType',
|
||||
'labelTitle',
|
||||
'count',
|
||||
'styles',
|
||||
'hasCover',
|
||||
'iconName',
|
||||
'iconSize'
|
||||
])
|
||||
const emit = defineEmits(['update:valueModel'])
|
||||
const list = ref<{ url?: string; type?: string }[]>([])
|
||||
const handleUpload = async () => {
|
||||
const res: any = await upload(
|
||||
props.count || 1,
|
||||
props?.size,
|
||||
props?.mediaType || ["image"]
|
||||
);
|
||||
console.log(res, "res");
|
||||
list.value = [...list.value, ...res];
|
||||
emit("update:valueModel", list.value);
|
||||
};
|
||||
const res: any = await upload(props.count || 1, props?.size, props?.mediaType || ['image'])
|
||||
console.log(res, 'res')
|
||||
list.value = [...list.value, ...res]
|
||||
emit('update:valueModel', list.value)
|
||||
}
|
||||
|
||||
const onDelete = (idx: number) => {
|
||||
if (props?.display) {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
list.value.splice(idx, 1);
|
||||
};
|
||||
list.value.splice(idx, 1)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props?.valueModel,
|
||||
() => {
|
||||
if (props.valueModel) {
|
||||
list.value = props.valueModel || [];
|
||||
list.value = props.valueModel || []
|
||||
}
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
const onPreviewMedia = (url?: string) => {
|
||||
console.log(url, "url1");
|
||||
console.log(url, 'url1')
|
||||
if (url) {
|
||||
uni.showLoading({
|
||||
title: "获取图片中...",
|
||||
mask: true,
|
||||
});
|
||||
console.log(url, "url2");
|
||||
title: '获取图片中...',
|
||||
mask: true
|
||||
})
|
||||
console.log(url, 'url2')
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
const imagePath = res.tempFilePath; // 下载成功的图片路径
|
||||
console.log(imagePath, "imagePath");
|
||||
watermark.addWatermark(imagePath, "仅用于内部查看,请勿外传");
|
||||
success: res => {
|
||||
const imagePath = res.tempFilePath // 下载成功的图片路径
|
||||
console.log(imagePath, 'imagePath')
|
||||
watermark.addWatermark(imagePath, '仅用于内部查看,请勿外传')
|
||||
},
|
||||
fail: (err) => {
|
||||
fail: err => {
|
||||
uni.showToast({
|
||||
title: "获取失败",
|
||||
duration: 1000,
|
||||
});
|
||||
console.error("下载图片失败:", err);
|
||||
},
|
||||
});
|
||||
title: '获取失败',
|
||||
duration: 1000
|
||||
})
|
||||
console.error('下载图片失败:', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.valueModel) {
|
||||
list.value = props.valueModel || [];
|
||||
list.value = props.valueModel || []
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.upload_body {
|
||||
|
||||
22
src/env.d.ts
vendored
22
src/env.d.ts
vendored
@ -1,22 +1,22 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare module "*.vue" {
|
||||
import { DefineComponent } from "vue";
|
||||
declare module '*.vue' {
|
||||
import { DefineComponent } from 'vue'
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
||||
declare namespace wx {
|
||||
interface OpenPrivacyContractOption {
|
||||
success?: (res: any) => void;
|
||||
fail?: (err: any) => void;
|
||||
complete?: (res: any) => void;
|
||||
chooseMessageFile?: (res: any) => void;
|
||||
success?: (res: any) => void
|
||||
fail?: (err: any) => void
|
||||
complete?: (res: any) => void
|
||||
chooseMessageFile?: (res: any) => void
|
||||
}
|
||||
interface Env {
|
||||
USER_DATA_PATH: string;
|
||||
USER_DATA_PATH: string
|
||||
}
|
||||
const env: Env;
|
||||
function openPrivacyContract(options: OpenPrivacyContractOption): void;
|
||||
const env: Env
|
||||
function openPrivacyContract(options: OpenPrivacyContractOption): void
|
||||
}
|
||||
|
||||
12
src/gen/ApiTypes.d.ts
vendored
12
src/gen/ApiTypes.d.ts
vendored
@ -3,11 +3,13 @@ declare namespace ApiTypes {
|
||||
namespace Auth {
|
||||
type Login = {
|
||||
"code": string; // 微信code
|
||||
"app_id": string; // 小程序app_id
|
||||
};
|
||||
type BindPhoneNumber = {
|
||||
"code"?: string; // 微信code
|
||||
"phone"?: string; // 手机号
|
||||
"phone_validate_code"?: string; // 手机验证码
|
||||
"app_id": string; // 小程序app_id
|
||||
};
|
||||
type GetAccessToken = {
|
||||
"user_name": string; // 用户名
|
||||
@ -15,14 +17,15 @@ declare namespace ApiTypes {
|
||||
};
|
||||
type WorkLogin = {
|
||||
"code": string; // 企业微信code
|
||||
"work_marker": string; // 企业标记
|
||||
"phone"?: string; // 手机号
|
||||
"real_name"?: string; // 真实姓名
|
||||
"app_id": string; // 企业微信CorpID
|
||||
};
|
||||
type BindWork = {
|
||||
"session_key": string; // -
|
||||
"iv": string; // -
|
||||
"encrypted_data": string; // -
|
||||
"app_id": string; // 小程序app_id
|
||||
};
|
||||
type GetWorkAccessToken = {
|
||||
"user_name": string; // 用户名
|
||||
@ -30,10 +33,11 @@ declare namespace ApiTypes {
|
||||
"work_marker": string; // 企业标记
|
||||
};
|
||||
type PreUpload = {
|
||||
"file_ext": string; // -
|
||||
"filename": string; // 文件名称
|
||||
"alc": string; // 访问限制 public-read, private
|
||||
};
|
||||
type DoUpload = {
|
||||
"upload_file": File; // 上传文件
|
||||
type TemporaryUrl = {
|
||||
"filename": string; // 文件名称
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ export const Apis = {
|
||||
Me(): Promise<MyResponseType> {
|
||||
return request('employee/login/auth/me', {});
|
||||
},
|
||||
BindPhoneNumber(data?: ApiTypes.Login.Auth.BindPhoneNumber): Promise<MyResponseType> {
|
||||
BindPhoneNumber(data: ApiTypes.Login.Auth.BindPhoneNumber): Promise<MyResponseType> {
|
||||
return request('employee/login/auth/bind_phone_number', { data });
|
||||
},
|
||||
GetAccessToken(data: ApiTypes.Login.Auth.GetAccessToken): Promise<MyResponseType> {
|
||||
@ -30,11 +30,8 @@ export const Apis = {
|
||||
PreUpload(data: ApiTypes.Login.Auth.PreUpload): Promise<MyResponseType> {
|
||||
return request('employee/login/auth/pre_upload', { data });
|
||||
},
|
||||
DoUpload(data: ApiTypes.Login.Auth.DoUpload): Promise<MyResponseType> {
|
||||
return request('employee/login/auth/do_upload', { data });
|
||||
},
|
||||
ImLogin(): Promise<MyResponseType> {
|
||||
return request('employee/login/auth/im_login', {});
|
||||
TemporaryUrl(data: ApiTypes.Login.Auth.TemporaryUrl): Promise<MyResponseType> {
|
||||
return request('employee/login/auth/temporary_url', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -94,6 +94,11 @@ export const AssetUnitsBuildingTypeEnum = {
|
||||
'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"},
|
||||
};
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum = {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#49c289","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
export const CompaniesMerchantTypeEnum = {
|
||||
'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"},
|
||||
@ -107,6 +112,12 @@ export const CompanyAppsAppTypeEnum = {
|
||||
'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"},
|
||||
};
|
||||
|
||||
// CompanyAppsModuleEnum
|
||||
export const CompanyAppsModuleEnum = {
|
||||
'Employee': {"text":"员工","color":"#3b82f6","value":"Employee"},
|
||||
'Customer': {"text":"客户","color":"#10b981","value":"Customer"},
|
||||
};
|
||||
|
||||
// CompanyReceiptAccountsPayChannelEnum
|
||||
export const CompanyReceiptAccountsPayChannelEnum = {
|
||||
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"},
|
||||
|
||||
27
src/libs/amap-wx.d.ts
vendored
27
src/libs/amap-wx.d.ts
vendored
@ -1,24 +1,21 @@
|
||||
// src/types/amap-wx.d.ts
|
||||
declare module "@/libs/amap-wx.js" {
|
||||
declare module '@/libs/amap-wx.js' {
|
||||
export class AMapWX {
|
||||
constructor(options: { key: string });
|
||||
constructor(options: { key: string })
|
||||
|
||||
getRegeo(options: {
|
||||
location: string;
|
||||
success?: (json: any) => void;
|
||||
fail?: (err: any) => void;
|
||||
}): void;
|
||||
location: string
|
||||
success?: (json: any) => void
|
||||
fail?: (err: any) => void
|
||||
}): void
|
||||
|
||||
getWeather(options: {
|
||||
success?: (data: any) => void;
|
||||
fail?: (error: any) => void;
|
||||
}): void;
|
||||
getWeather(options: { success?: (data: any) => void; fail?: (error: any) => void }): void
|
||||
|
||||
getPoiAround(options: {
|
||||
querykeywords?: any;
|
||||
location?: any;
|
||||
success?: (data: any) => void;
|
||||
fail?: (error: any) => void;
|
||||
}): void;
|
||||
querykeywords?: any
|
||||
location?: any
|
||||
success?: (data: any) => void
|
||||
fail?: (error: any) => void
|
||||
}): void
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,261 +1,259 @@
|
||||
/* eslint-disable @typescript-eslint/no-this-alias */
|
||||
/* eslint-disable no-undef */
|
||||
function AMapWX(a) {
|
||||
this.key = a.key;
|
||||
this.key = a.key
|
||||
this.requestConfig = {
|
||||
key: a.key,
|
||||
s: "rsx",
|
||||
platform: "WXJS",
|
||||
s: 'rsx',
|
||||
platform: 'WXJS',
|
||||
appname: a.key,
|
||||
sdkversion: "1.2.0",
|
||||
logversion: "2.0",
|
||||
};
|
||||
sdkversion: '1.2.0',
|
||||
logversion: '2.0'
|
||||
}
|
||||
this.MeRequestConfig = {
|
||||
key: a.key,
|
||||
serviceName: "https://restapi.amap.com/rest/me",
|
||||
};
|
||||
serviceName: 'https://restapi.amap.com/rest/me'
|
||||
}
|
||||
}
|
||||
AMapWX.prototype.getWxLocation = function (a, b) {
|
||||
wx.getLocation({
|
||||
type: "gcj02",
|
||||
type: 'gcj02',
|
||||
success: function (c) {
|
||||
c = c.longitude + "," + c.latitude;
|
||||
wx.setStorage({ key: "userLocation", data: c });
|
||||
b(c);
|
||||
c = c.longitude + ',' + c.latitude
|
||||
wx.setStorage({ key: 'userLocation', data: c })
|
||||
b(c)
|
||||
},
|
||||
fail: function (c) {
|
||||
wx.getStorage({
|
||||
key: "userLocation",
|
||||
key: 'userLocation',
|
||||
success: function (d) {
|
||||
d.data && b(d.data);
|
||||
},
|
||||
});
|
||||
a.fail({ errCode: "0", errMsg: c.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
d.data && b(d.data)
|
||||
}
|
||||
})
|
||||
a.fail({ errCode: '0', errMsg: c.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getMEKeywordsSearch = function (a) {
|
||||
if (!a.options)
|
||||
return a.fail({
|
||||
errCode: "0",
|
||||
errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570",
|
||||
});
|
||||
errCode: '0',
|
||||
errMsg: '\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570'
|
||||
})
|
||||
const b = a.options,
|
||||
c = this.MeRequestConfig,
|
||||
d = {
|
||||
key: c.key,
|
||||
s: "rsx",
|
||||
platform: "WXJS",
|
||||
s: 'rsx',
|
||||
platform: 'WXJS',
|
||||
appname: a.key,
|
||||
sdkversion: "1.2.0",
|
||||
logversion: "2.0",
|
||||
};
|
||||
b.layerId && (d.layerId = b.layerId);
|
||||
b.keywords && (d.keywords = b.keywords);
|
||||
b.city && (d.city = b.city);
|
||||
b.filter && (d.filter = b.filter);
|
||||
b.sortrule && (d.sortrule = b.sortrule);
|
||||
b.pageNum && (d.pageNum = b.pageNum);
|
||||
b.pageSize && (d.pageSize = b.pageSize);
|
||||
b.sig && (d.sig = b.sig);
|
||||
sdkversion: '1.2.0',
|
||||
logversion: '2.0'
|
||||
}
|
||||
b.layerId && (d.layerId = b.layerId)
|
||||
b.keywords && (d.keywords = b.keywords)
|
||||
b.city && (d.city = b.city)
|
||||
b.filter && (d.filter = b.filter)
|
||||
b.sortrule && (d.sortrule = b.sortrule)
|
||||
b.pageNum && (d.pageNum = b.pageNum)
|
||||
b.pageSize && (d.pageSize = b.pageSize)
|
||||
b.sig && (d.sig = b.sig)
|
||||
wx.request({
|
||||
url: c.serviceName + "/cpoint/datasearch/local",
|
||||
url: c.serviceName + '/cpoint/datasearch/local',
|
||||
data: d,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (e) {
|
||||
(e = e.data) && e.status && "1" === e.status && 0 === e.code
|
||||
;(e = e.data) && e.status && '1' === e.status && 0 === e.code
|
||||
? a.success(e.data)
|
||||
: a.fail({ errCode: "0", errMsg: e });
|
||||
: a.fail({ errCode: '0', errMsg: e })
|
||||
},
|
||||
fail: function (e) {
|
||||
a.fail({ errCode: "0", errMsg: e.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: e.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getMEIdSearch = function (a) {
|
||||
if (!a.options)
|
||||
return a.fail({
|
||||
errCode: "0",
|
||||
errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570",
|
||||
});
|
||||
errCode: '0',
|
||||
errMsg: '\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570'
|
||||
})
|
||||
const b = a.options,
|
||||
c = this.MeRequestConfig,
|
||||
d = {
|
||||
key: c.key,
|
||||
s: "rsx",
|
||||
platform: "WXJS",
|
||||
s: 'rsx',
|
||||
platform: 'WXJS',
|
||||
appname: a.key,
|
||||
sdkversion: "1.2.0",
|
||||
logversion: "2.0",
|
||||
};
|
||||
b.layerId && (d.layerId = b.layerId);
|
||||
b.id && (d.id = b.id);
|
||||
b.sig && (d.sig = b.sig);
|
||||
sdkversion: '1.2.0',
|
||||
logversion: '2.0'
|
||||
}
|
||||
b.layerId && (d.layerId = b.layerId)
|
||||
b.id && (d.id = b.id)
|
||||
b.sig && (d.sig = b.sig)
|
||||
wx.request({
|
||||
url: c.serviceName + "/cpoint/datasearch/id",
|
||||
url: c.serviceName + '/cpoint/datasearch/id',
|
||||
data: d,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (e) {
|
||||
(e = e.data) && e.status && "1" === e.status && 0 === e.code
|
||||
;(e = e.data) && e.status && '1' === e.status && 0 === e.code
|
||||
? a.success(e.data)
|
||||
: a.fail({ errCode: "0", errMsg: e });
|
||||
: a.fail({ errCode: '0', errMsg: e })
|
||||
},
|
||||
fail: function (e) {
|
||||
a.fail({ errCode: "0", errMsg: e.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: e.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getMEPolygonSearch = function (a) {
|
||||
if (!a.options)
|
||||
return a.fail({
|
||||
errCode: "0",
|
||||
errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570",
|
||||
});
|
||||
errCode: '0',
|
||||
errMsg: '\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570'
|
||||
})
|
||||
const b = a.options,
|
||||
c = this.MeRequestConfig,
|
||||
d = {
|
||||
key: c.key,
|
||||
s: "rsx",
|
||||
platform: "WXJS",
|
||||
s: 'rsx',
|
||||
platform: 'WXJS',
|
||||
appname: a.key,
|
||||
sdkversion: "1.2.0",
|
||||
logversion: "2.0",
|
||||
};
|
||||
b.layerId && (d.layerId = b.layerId);
|
||||
b.keywords && (d.keywords = b.keywords);
|
||||
b.polygon && (d.polygon = b.polygon);
|
||||
b.filter && (d.filter = b.filter);
|
||||
b.sortrule && (d.sortrule = b.sortrule);
|
||||
b.pageNum && (d.pageNum = b.pageNum);
|
||||
b.pageSize && (d.pageSize = b.pageSize);
|
||||
b.sig && (d.sig = b.sig);
|
||||
sdkversion: '1.2.0',
|
||||
logversion: '2.0'
|
||||
}
|
||||
b.layerId && (d.layerId = b.layerId)
|
||||
b.keywords && (d.keywords = b.keywords)
|
||||
b.polygon && (d.polygon = b.polygon)
|
||||
b.filter && (d.filter = b.filter)
|
||||
b.sortrule && (d.sortrule = b.sortrule)
|
||||
b.pageNum && (d.pageNum = b.pageNum)
|
||||
b.pageSize && (d.pageSize = b.pageSize)
|
||||
b.sig && (d.sig = b.sig)
|
||||
wx.request({
|
||||
url: c.serviceName + "/cpoint/datasearch/polygon",
|
||||
url: c.serviceName + '/cpoint/datasearch/polygon',
|
||||
data: d,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (e) {
|
||||
(e = e.data) && e.status && "1" === e.status && 0 === e.code
|
||||
;(e = e.data) && e.status && '1' === e.status && 0 === e.code
|
||||
? a.success(e.data)
|
||||
: a.fail({ errCode: "0", errMsg: e });
|
||||
: a.fail({ errCode: '0', errMsg: e })
|
||||
},
|
||||
fail: function (e) {
|
||||
a.fail({ errCode: "0", errMsg: e.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: e.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getMEaroundSearch = function (a) {
|
||||
if (!a.options)
|
||||
return a.fail({
|
||||
errCode: "0",
|
||||
errMsg: "\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570",
|
||||
});
|
||||
errCode: '0',
|
||||
errMsg: '\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570'
|
||||
})
|
||||
const b = a.options,
|
||||
c = this.MeRequestConfig,
|
||||
d = {
|
||||
key: c.key,
|
||||
s: "rsx",
|
||||
platform: "WXJS",
|
||||
s: 'rsx',
|
||||
platform: 'WXJS',
|
||||
appname: a.key,
|
||||
sdkversion: "1.2.0",
|
||||
logversion: "2.0",
|
||||
};
|
||||
b.layerId && (d.layerId = b.layerId);
|
||||
b.keywords && (d.keywords = b.keywords);
|
||||
b.center && (d.center = b.center);
|
||||
b.radius && (d.radius = b.radius);
|
||||
b.filter && (d.filter = b.filter);
|
||||
b.sortrule && (d.sortrule = b.sortrule);
|
||||
b.pageNum && (d.pageNum = b.pageNum);
|
||||
b.pageSize && (d.pageSize = b.pageSize);
|
||||
b.sig && (d.sig = b.sig);
|
||||
sdkversion: '1.2.0',
|
||||
logversion: '2.0'
|
||||
}
|
||||
b.layerId && (d.layerId = b.layerId)
|
||||
b.keywords && (d.keywords = b.keywords)
|
||||
b.center && (d.center = b.center)
|
||||
b.radius && (d.radius = b.radius)
|
||||
b.filter && (d.filter = b.filter)
|
||||
b.sortrule && (d.sortrule = b.sortrule)
|
||||
b.pageNum && (d.pageNum = b.pageNum)
|
||||
b.pageSize && (d.pageSize = b.pageSize)
|
||||
b.sig && (d.sig = b.sig)
|
||||
wx.request({
|
||||
url: c.serviceName + "/cpoint/datasearch/around",
|
||||
url: c.serviceName + '/cpoint/datasearch/around',
|
||||
data: d,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (e) {
|
||||
(e = e.data) && e.status && "1" === e.status && 0 === e.code
|
||||
;(e = e.data) && e.status && '1' === e.status && 0 === e.code
|
||||
? a.success(e.data)
|
||||
: a.fail({ errCode: "0", errMsg: e });
|
||||
: a.fail({ errCode: '0', errMsg: e })
|
||||
},
|
||||
fail: function (e) {
|
||||
a.fail({ errCode: "0", errMsg: e.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: e.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getGeo = function (a) {
|
||||
let b = this.requestConfig;
|
||||
const c = a.options;
|
||||
let b = this.requestConfig
|
||||
const c = a.options
|
||||
b = {
|
||||
key: this.key,
|
||||
extensions: "all",
|
||||
extensions: 'all',
|
||||
s: b.s,
|
||||
platform: b.platform,
|
||||
appname: this.key,
|
||||
sdkversion: b.sdkversion,
|
||||
logversion: b.logversion,
|
||||
};
|
||||
c.address && (b.address = c.address);
|
||||
c.city && (b.city = c.city);
|
||||
c.batch && (b.batch = c.batch);
|
||||
c.sig && (b.sig = c.sig);
|
||||
logversion: b.logversion
|
||||
}
|
||||
c.address && (b.address = c.address)
|
||||
c.city && (b.city = c.city)
|
||||
c.batch && (b.batch = c.batch)
|
||||
c.sig && (b.sig = c.sig)
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/geocode/geo",
|
||||
url: 'https://restapi.amap.com/v3/geocode/geo',
|
||||
data: b,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (d) {
|
||||
(d = d.data) && d.status && "1" === d.status
|
||||
;(d = d.data) && d.status && '1' === d.status
|
||||
? a.success(d)
|
||||
: a.fail({ errCode: "0", errMsg: d });
|
||||
: a.fail({ errCode: '0', errMsg: d })
|
||||
},
|
||||
fail: function (d) {
|
||||
a.fail({ errCode: "0", errMsg: d.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: d.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getRegeo = function (a) {
|
||||
function b(d) {
|
||||
const e = c.requestConfig;
|
||||
const e = c.requestConfig
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/geocode/regeo",
|
||||
url: 'https://restapi.amap.com/v3/geocode/regeo',
|
||||
data: {
|
||||
key: c.key,
|
||||
location: d,
|
||||
extensions: "all",
|
||||
extensions: 'all',
|
||||
s: e.s,
|
||||
platform: e.platform,
|
||||
appname: c.key,
|
||||
sdkversion: e.sdkversion,
|
||||
logversion: e.logversion,
|
||||
logversion: e.logversion
|
||||
},
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (g) {
|
||||
if (g.data.status && "1" === g.data.status) {
|
||||
g = g.data.regeocode;
|
||||
const h = g.addressComponent;
|
||||
let f = [];
|
||||
let k = g.roads.length ? g.roads[0].name : "" + "\u9644\u8fd1";
|
||||
let m = d.split(",")[0];
|
||||
let n = d.split(",")[1];
|
||||
if (g.data.status && '1' === g.data.status) {
|
||||
g = g.data.regeocode
|
||||
const h = g.addressComponent
|
||||
let f = []
|
||||
let k = g.roads.length ? g.roads[0].name : '' + '\u9644\u8fd1'
|
||||
let m = d.split(',')[0]
|
||||
let n = d.split(',')[1]
|
||||
if (g.pois && g.pois[0]) {
|
||||
k = g.pois[0].name + "\u9644\u8fd1";
|
||||
const l = g.pois[0].location;
|
||||
l &&
|
||||
((m = parseFloat(l.split(",")[0])),
|
||||
(n = parseFloat(l.split(",")[1])));
|
||||
k = g.pois[0].name + '\u9644\u8fd1'
|
||||
const l = g.pois[0].location
|
||||
l && ((m = parseFloat(l.split(',')[0])), (n = parseFloat(l.split(',')[1])))
|
||||
}
|
||||
h.provice && f.push(h.provice);
|
||||
h.city && f.push(h.city);
|
||||
h.district && f.push(h.district);
|
||||
h.provice && f.push(h.provice)
|
||||
h.city && f.push(h.city)
|
||||
h.district && f.push(h.district)
|
||||
h.streetNumber && h.streetNumber.street && h.streetNumber.number
|
||||
? (f.push(h.streetNumber.street), f.push(h.streetNumber.number))
|
||||
: f.push(g.roads[0].name);
|
||||
f = f.join("");
|
||||
: f.push(g.roads[0].name)
|
||||
f = f.join('')
|
||||
a.success([
|
||||
{
|
||||
iconPath: a.iconPath,
|
||||
@ -266,29 +264,29 @@ AMapWX.prototype.getRegeo = function (a) {
|
||||
longitude: m,
|
||||
latitude: n,
|
||||
id: 0,
|
||||
regeocodeData: g,
|
||||
},
|
||||
]);
|
||||
} else a.fail({ errCode: g.data.infocode, errMsg: g.data.info });
|
||||
regeocodeData: g
|
||||
}
|
||||
])
|
||||
} else a.fail({ errCode: g.data.infocode, errMsg: g.data.info })
|
||||
},
|
||||
fail: function (g) {
|
||||
a.fail({ errCode: "0", errMsg: g.errMsg || "" });
|
||||
},
|
||||
});
|
||||
a.fail({ errCode: '0', errMsg: g.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
const c = this;
|
||||
const c = this
|
||||
a.location
|
||||
? b(a.location)
|
||||
: c.getWxLocation(a, function (d) {
|
||||
b(d);
|
||||
});
|
||||
};
|
||||
b(d)
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getWeather = function (a) {
|
||||
function b(g) {
|
||||
let h = "base";
|
||||
a.type && "forecast" === a.type && (h = "all");
|
||||
let h = 'base'
|
||||
a.type && 'forecast' === a.type && (h = 'all')
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/weather/weatherInfo",
|
||||
url: 'https://restapi.amap.com/v3/weather/weatherInfo',
|
||||
data: {
|
||||
key: d.key,
|
||||
city: g,
|
||||
@ -297,83 +295,81 @@ AMapWX.prototype.getWeather = function (a) {
|
||||
platform: e.platform,
|
||||
appname: d.key,
|
||||
sdkversion: e.sdkversion,
|
||||
logversion: e.logversion,
|
||||
logversion: e.logversion
|
||||
},
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (f) {
|
||||
if (f.data.status && "1" === f.data.status)
|
||||
if (f.data.status && '1' === f.data.status)
|
||||
if (f.data.lives) {
|
||||
if ((f = f.data.lives) && 0 < f.length) {
|
||||
f = f[0];
|
||||
f = f[0]
|
||||
const k = {
|
||||
city: { text: "\u57ce\u5e02", data: f.city },
|
||||
weather: { text: "\u5929\u6c14", data: f.weather },
|
||||
temperature: { text: "\u6e29\u5ea6", data: f.temperature },
|
||||
city: { text: '\u57ce\u5e02', data: f.city },
|
||||
weather: { text: '\u5929\u6c14', data: f.weather },
|
||||
temperature: { text: '\u6e29\u5ea6', data: f.temperature },
|
||||
winddirection: {
|
||||
text: "\u98ce\u5411",
|
||||
data: f.winddirection + "\u98ce",
|
||||
text: '\u98ce\u5411',
|
||||
data: f.winddirection + '\u98ce'
|
||||
},
|
||||
windpower: {
|
||||
text: "\u98ce\u529b",
|
||||
data: f.windpower + "\u7ea7",
|
||||
text: '\u98ce\u529b',
|
||||
data: f.windpower + '\u7ea7'
|
||||
},
|
||||
humidity: { text: "\u6e7f\u5ea6", data: f.humidity + "%" },
|
||||
};
|
||||
k.liveData = f;
|
||||
a.success(k);
|
||||
humidity: { text: '\u6e7f\u5ea6', data: f.humidity + '%' }
|
||||
}
|
||||
k.liveData = f
|
||||
a.success(k)
|
||||
}
|
||||
} else
|
||||
f.data.forecasts &&
|
||||
f.data.forecasts[0] &&
|
||||
a.success({ forecast: f.data.forecasts[0] });
|
||||
else a.fail({ errCode: f.data.infocode, errMsg: f.data.info });
|
||||
f.data.forecasts && f.data.forecasts[0] && a.success({ forecast: f.data.forecasts[0] })
|
||||
else a.fail({ errCode: f.data.infocode, errMsg: f.data.info })
|
||||
},
|
||||
fail: function (f) {
|
||||
a.fail({ errCode: "0", errMsg: f.errMsg || "" });
|
||||
},
|
||||
});
|
||||
a.fail({ errCode: '0', errMsg: f.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
function c(g) {
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/geocode/regeo",
|
||||
url: 'https://restapi.amap.com/v3/geocode/regeo',
|
||||
data: {
|
||||
key: d.key,
|
||||
location: g,
|
||||
extensions: "all",
|
||||
extensions: 'all',
|
||||
s: e.s,
|
||||
platform: e.platform,
|
||||
appname: d.key,
|
||||
sdkversion: e.sdkversion,
|
||||
logversion: e.logversion,
|
||||
logversion: e.logversion
|
||||
},
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (h) {
|
||||
if (h.data.status && "1" === h.data.status) {
|
||||
h = h.data.regeocode;
|
||||
let f = "";
|
||||
if (h.data.status && '1' === h.data.status) {
|
||||
h = h.data.regeocode
|
||||
let f = ''
|
||||
if (h.addressComponent) {
|
||||
f = h.addressComponent.adcode;
|
||||
f = h.addressComponent.adcode
|
||||
} else {
|
||||
h.aois && 0 < h.aois.length && (f = h.aois[0].adcode);
|
||||
h.aois && 0 < h.aois.length && (f = h.aois[0].adcode)
|
||||
}
|
||||
b(f);
|
||||
} else a.fail({ errCode: h.data.infocode, errMsg: h.data.info });
|
||||
b(f)
|
||||
} else a.fail({ errCode: h.data.infocode, errMsg: h.data.info })
|
||||
},
|
||||
fail: function (h) {
|
||||
a.fail({ errCode: "0", errMsg: h.errMsg || "" });
|
||||
},
|
||||
});
|
||||
a.fail({ errCode: '0', errMsg: h.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
const d = this,
|
||||
e = d.requestConfig;
|
||||
e = d.requestConfig
|
||||
a.city
|
||||
? b(a.city)
|
||||
: d.getWxLocation(a, function (g) {
|
||||
c(g);
|
||||
});
|
||||
};
|
||||
c(g)
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getPoiAround = function (a) {
|
||||
function b(e) {
|
||||
e = {
|
||||
@ -383,185 +379,185 @@ AMapWX.prototype.getPoiAround = function (a) {
|
||||
platform: d.platform,
|
||||
appname: c.key,
|
||||
sdkversion: d.sdkversion,
|
||||
logversion: d.logversion,
|
||||
};
|
||||
a.querytypes && (e.types = a.querytypes);
|
||||
a.querykeywords && (e.keywords = a.querykeywords);
|
||||
logversion: d.logversion
|
||||
}
|
||||
a.querytypes && (e.types = a.querytypes)
|
||||
a.querykeywords && (e.keywords = a.querykeywords)
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/place/around",
|
||||
url: 'https://restapi.amap.com/v3/place/around',
|
||||
data: e,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (g) {
|
||||
console.log(g, "g");
|
||||
if (g.data.status && "1" === g.data.status) {
|
||||
console.log(g, 'g')
|
||||
if (g.data.status && '1' === g.data.status) {
|
||||
if ((g = g.data) && g.pois) {
|
||||
const h = [];
|
||||
const h = []
|
||||
for (let f = 0; f < g.pois.length; f++) {
|
||||
const k = 0 === f ? a.iconPathSelected : a.iconPath;
|
||||
const k = 0 === f ? a.iconPathSelected : a.iconPath
|
||||
h.push({
|
||||
latitude: parseFloat(g.pois[f].location.split(",")[1]),
|
||||
longitude: parseFloat(g.pois[f].location.split(",")[0]),
|
||||
latitude: parseFloat(g.pois[f].location.split(',')[1]),
|
||||
longitude: parseFloat(g.pois[f].location.split(',')[0]),
|
||||
iconPath: k,
|
||||
width: 22,
|
||||
height: 32,
|
||||
id: f,
|
||||
name: g.pois[f].name,
|
||||
address: g.pois[f].address,
|
||||
});
|
||||
address: g.pois[f].address
|
||||
})
|
||||
}
|
||||
a.success({ markers: h, poisData: g.pois });
|
||||
a.success({ markers: h, poisData: g.pois })
|
||||
}
|
||||
} else a.fail({ errCode: g.data.infocode, errMsg: g.data.info });
|
||||
} else a.fail({ errCode: g.data.infocode, errMsg: g.data.info })
|
||||
},
|
||||
fail: function (g) {
|
||||
a.fail({ errCode: "0", errMsg: g.errMsg || "" });
|
||||
},
|
||||
});
|
||||
a.fail({ errCode: '0', errMsg: g.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
const c = this,
|
||||
d = c.requestConfig;
|
||||
d = c.requestConfig
|
||||
a.location
|
||||
? b(a.location)
|
||||
: c.getWxLocation(a, function (e) {
|
||||
b(e);
|
||||
});
|
||||
};
|
||||
b(e)
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getStaticmap = function (a) {
|
||||
function b(e) {
|
||||
c.push("location=" + e);
|
||||
a.zoom && c.push("zoom=" + a.zoom);
|
||||
a.size && c.push("size=" + a.size);
|
||||
a.scale && c.push("scale=" + a.scale);
|
||||
a.markers && c.push("markers=" + a.markers);
|
||||
a.labels && c.push("labels=" + a.labels);
|
||||
a.paths && c.push("paths=" + a.paths);
|
||||
a.traffic && c.push("traffic=" + a.traffic);
|
||||
e = "https://restapi.amap.com/v3/staticmap?" + c.join("&");
|
||||
a.success({ url: e });
|
||||
c.push('location=' + e)
|
||||
a.zoom && c.push('zoom=' + a.zoom)
|
||||
a.size && c.push('size=' + a.size)
|
||||
a.scale && c.push('scale=' + a.scale)
|
||||
a.markers && c.push('markers=' + a.markers)
|
||||
a.labels && c.push('labels=' + a.labels)
|
||||
a.paths && c.push('paths=' + a.paths)
|
||||
a.traffic && c.push('traffic=' + a.traffic)
|
||||
e = 'https://restapi.amap.com/v3/staticmap?' + c.join('&')
|
||||
a.success({ url: e })
|
||||
}
|
||||
const c = [];
|
||||
c.push("key=" + this.key);
|
||||
const d = this.requestConfig;
|
||||
c.push("s=" + d.s);
|
||||
c.push("platform=" + d.platform);
|
||||
c.push("appname=" + d.appname);
|
||||
c.push("sdkversion=" + d.sdkversion);
|
||||
c.push("logversion=" + d.logversion);
|
||||
const c = []
|
||||
c.push('key=' + this.key)
|
||||
const d = this.requestConfig
|
||||
c.push('s=' + d.s)
|
||||
c.push('platform=' + d.platform)
|
||||
c.push('appname=' + d.appname)
|
||||
c.push('sdkversion=' + d.sdkversion)
|
||||
c.push('logversion=' + d.logversion)
|
||||
a.location
|
||||
? b(a.location)
|
||||
: this.getWxLocation(a, function (e) {
|
||||
b(e);
|
||||
});
|
||||
};
|
||||
b(e)
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getInputtips = function (a) {
|
||||
const b = Object.assign({}, this.requestConfig);
|
||||
a.location && (b.location = a.location);
|
||||
a.keywords && (b.keywords = a.keywords);
|
||||
a.type && (b.type = a.type);
|
||||
a.city && (b.city = a.city);
|
||||
a.citylimit && (b.citylimit = a.citylimit);
|
||||
const b = Object.assign({}, this.requestConfig)
|
||||
a.location && (b.location = a.location)
|
||||
a.keywords && (b.keywords = a.keywords)
|
||||
a.type && (b.type = a.type)
|
||||
a.city && (b.city = a.city)
|
||||
a.citylimit && (b.citylimit = a.citylimit)
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/assistant/inputtips",
|
||||
url: 'https://restapi.amap.com/v3/assistant/inputtips',
|
||||
data: b,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (c) {
|
||||
c && c.data && c.data.tips && a.success({ tips: c.data.tips });
|
||||
c && c.data && c.data.tips && a.success({ tips: c.data.tips })
|
||||
},
|
||||
fail: function (c) {
|
||||
a.fail({ errCode: "0", errMsg: c.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: c.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getDrivingRoute = function (a) {
|
||||
const b = Object.assign({}, this.requestConfig);
|
||||
a.origin && (b.origin = a.origin);
|
||||
a.destination && (b.destination = a.destination);
|
||||
a.strategy && (b.strategy = a.strategy);
|
||||
a.waypoints && (b.waypoints = a.waypoints);
|
||||
a.avoidpolygons && (b.avoidpolygons = a.avoidpolygons);
|
||||
a.avoidroad && (b.avoidroad = a.avoidroad);
|
||||
const b = Object.assign({}, this.requestConfig)
|
||||
a.origin && (b.origin = a.origin)
|
||||
a.destination && (b.destination = a.destination)
|
||||
a.strategy && (b.strategy = a.strategy)
|
||||
a.waypoints && (b.waypoints = a.waypoints)
|
||||
a.avoidpolygons && (b.avoidpolygons = a.avoidpolygons)
|
||||
a.avoidroad && (b.avoidroad = a.avoidroad)
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/direction/driving",
|
||||
url: 'https://restapi.amap.com/v3/direction/driving',
|
||||
data: b,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (c) {
|
||||
c &&
|
||||
c.data &&
|
||||
c.data.route &&
|
||||
a.success({
|
||||
paths: c.data.route.paths,
|
||||
taxi_cost: c.data.route.taxi_cost || "",
|
||||
});
|
||||
taxi_cost: c.data.route.taxi_cost || ''
|
||||
})
|
||||
},
|
||||
fail: function (c) {
|
||||
a.fail({ errCode: "0", errMsg: c.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: c.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getWalkingRoute = function (a) {
|
||||
const b = Object.assign({}, this.requestConfig);
|
||||
a.origin && (b.origin = a.origin);
|
||||
a.destination && (b.destination = a.destination);
|
||||
const b = Object.assign({}, this.requestConfig)
|
||||
a.origin && (b.origin = a.origin)
|
||||
a.destination && (b.destination = a.destination)
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/direction/walking",
|
||||
url: 'https://restapi.amap.com/v3/direction/walking',
|
||||
data: b,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (c) {
|
||||
c && c.data && c.data.route && a.success({ paths: c.data.route.paths });
|
||||
c && c.data && c.data.route && a.success({ paths: c.data.route.paths })
|
||||
},
|
||||
fail: function (c) {
|
||||
a.fail({ errCode: "0", errMsg: c.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: c.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getTransitRoute = function (a) {
|
||||
const b = Object.assign({}, this.requestConfig);
|
||||
a.origin && (b.origin = a.origin);
|
||||
a.destination && (b.destination = a.destination);
|
||||
a.strategy && (b.strategy = a.strategy);
|
||||
a.city && (b.city = a.city);
|
||||
a.cityd && (b.cityd = a.cityd);
|
||||
const b = Object.assign({}, this.requestConfig)
|
||||
a.origin && (b.origin = a.origin)
|
||||
a.destination && (b.destination = a.destination)
|
||||
a.strategy && (b.strategy = a.strategy)
|
||||
a.city && (b.city = a.city)
|
||||
a.cityd && (b.cityd = a.cityd)
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/direction/transit/integrated",
|
||||
url: 'https://restapi.amap.com/v3/direction/transit/integrated',
|
||||
data: b,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (c) {
|
||||
c &&
|
||||
c.data &&
|
||||
c.data.route &&
|
||||
((c = c.data.route),
|
||||
a.success({
|
||||
distance: c.distance || "",
|
||||
taxi_cost: c.taxi_cost || "",
|
||||
transits: c.transits,
|
||||
}));
|
||||
distance: c.distance || '',
|
||||
taxi_cost: c.taxi_cost || '',
|
||||
transits: c.transits
|
||||
}))
|
||||
},
|
||||
fail: function (c) {
|
||||
a.fail({ errCode: "0", errMsg: c.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: c.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
AMapWX.prototype.getRidingRoute = function (a) {
|
||||
const b = Object.assign({}, this.requestConfig);
|
||||
a.origin && (b.origin = a.origin);
|
||||
a.destination && (b.destination = a.destination);
|
||||
const b = Object.assign({}, this.requestConfig)
|
||||
a.origin && (b.origin = a.origin)
|
||||
a.destination && (b.destination = a.destination)
|
||||
wx.request({
|
||||
url: "https://restapi.amap.com/v3/direction/riding",
|
||||
url: 'https://restapi.amap.com/v3/direction/riding',
|
||||
data: b,
|
||||
method: "GET",
|
||||
header: { "content-type": "application/json" },
|
||||
method: 'GET',
|
||||
header: { 'content-type': 'application/json' },
|
||||
success: function (c) {
|
||||
c && c.data && c.data.route && a.success({ paths: c.data.route.paths });
|
||||
c && c.data && c.data.route && a.success({ paths: c.data.route.paths })
|
||||
},
|
||||
fail: function (c) {
|
||||
a.fail({ errCode: "0", errMsg: c.errMsg || "" });
|
||||
},
|
||||
});
|
||||
};
|
||||
a.fail({ errCode: '0', errMsg: c.errMsg || '' })
|
||||
}
|
||||
})
|
||||
}
|
||||
// module.exports.AMapWX=AMapWX;
|
||||
export default { AMapWX };
|
||||
export default { AMapWX }
|
||||
|
||||
26
src/main.ts
26
src/main.ts
@ -1,25 +1,25 @@
|
||||
import * as Pinia from "pinia";
|
||||
import uviewPlus from "uview-plus";
|
||||
import { createSSRApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import "./colorconfig.scss";
|
||||
import * as Pinia from 'pinia'
|
||||
import uviewPlus from 'uview-plus'
|
||||
import { createSSRApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import './colorconfig.scss'
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App);
|
||||
const app = createSSRApp(App)
|
||||
|
||||
// uview-plus
|
||||
app.use(uviewPlus);
|
||||
app.use(uviewPlus)
|
||||
|
||||
// onLaunch 同步阻塞
|
||||
app.config.globalProperties.$onLaunched = new Promise((resolve) => {
|
||||
app.config.globalProperties.$isResolve = resolve;
|
||||
});
|
||||
app.config.globalProperties.$onLaunched = new Promise(resolve => {
|
||||
app.config.globalProperties.$isResolve = resolve
|
||||
})
|
||||
|
||||
// pinia
|
||||
app.use(Pinia.createPinia());
|
||||
app.use(Pinia.createPinia())
|
||||
|
||||
return {
|
||||
app,
|
||||
Pinia,
|
||||
};
|
||||
Pinia
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,15 +5,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWeAppAuthStore } from "@/common";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { getCurrentInstance } from "vue";
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getCurrentInstance } from 'vue'
|
||||
|
||||
const auth = useWeAppAuthStore();
|
||||
const auth = useWeAppAuthStore()
|
||||
|
||||
onLoad(async () => {
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched;
|
||||
console.log("detail.vue onLoad");
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
|
||||
console.log('detail.vue onLoad')
|
||||
// auth.hasError = true;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -2,46 +2,37 @@
|
||||
<cc-root-view>
|
||||
<image src="/static/logo.png" />
|
||||
<up-button type="primary" text="确定" @click="handleClick" />
|
||||
<up-button
|
||||
type="primary"
|
||||
text="需要权限"
|
||||
@click="handleClickAccess"
|
||||
class="my-7"
|
||||
/>
|
||||
<up-button
|
||||
type="primary"
|
||||
text="不需要权限"
|
||||
@click="handleClickNotNeedAccess"
|
||||
/>
|
||||
<up-button type="primary" text="需要权限" @click="handleClickAccess" class="my-7" />
|
||||
<up-button type="primary" text="不需要权限" @click="handleClickNotNeedAccess" />
|
||||
</cc-root-view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWeAppAuthStore } from "@/common";
|
||||
import { goto } from "@/common/libraries/naviHelper";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { getCurrentInstance } from "vue";
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
import { goto } from '@/common/libraries/naviHelper'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getCurrentInstance } from 'vue'
|
||||
|
||||
const auth: any = useWeAppAuthStore();
|
||||
const auth: any = useWeAppAuthStore()
|
||||
|
||||
function handleClick() {
|
||||
goto("/pages/detail?id=123");
|
||||
goto('/pages/detail?id=123')
|
||||
}
|
||||
|
||||
// 需要权限,进行权限判断,真实逻辑在闭包里
|
||||
function handleClickAccess() {
|
||||
auth.checkRight(() => {
|
||||
goto("/pages/mine");
|
||||
});
|
||||
goto('/pages/mine')
|
||||
})
|
||||
}
|
||||
|
||||
function handleClickNotNeedAccess() {
|
||||
goto("/pages/mine");
|
||||
goto('/pages/mine')
|
||||
}
|
||||
|
||||
onLoad(async () => {
|
||||
console.log("index.vue onLoad 1");
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched;
|
||||
console.log("index.vue onLoad 2");
|
||||
});
|
||||
console.log('index.vue onLoad 1')
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
|
||||
console.log('index.vue onLoad 2')
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -11,27 +11,27 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const props = defineProps(["day"]);
|
||||
import { getDay } from "@/common/libraries/day";
|
||||
const emit = defineEmits(["update:valueModel"]);
|
||||
import { ref } from 'vue'
|
||||
const props = defineProps(['day'])
|
||||
import { getDay } from '@/common/libraries/day'
|
||||
const emit = defineEmits(['update:valueModel'])
|
||||
const handleSelect = (day: string) => {
|
||||
emit("update:valueModel", day);
|
||||
};
|
||||
emit('update:valueModel', day)
|
||||
}
|
||||
const listDay = ref([
|
||||
{
|
||||
label: "今天",
|
||||
value: getDay(),
|
||||
label: '今天',
|
||||
value: getDay()
|
||||
},
|
||||
{
|
||||
label: "昨天",
|
||||
value: getDay(1),
|
||||
label: '昨天',
|
||||
value: getDay(1)
|
||||
},
|
||||
{
|
||||
label: "前天",
|
||||
value: getDay(2),
|
||||
},
|
||||
]);
|
||||
label: '前天',
|
||||
value: getDay(2)
|
||||
}
|
||||
])
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.day_select {
|
||||
|
||||
@ -2,14 +2,8 @@
|
||||
<hs-card>
|
||||
<view>
|
||||
<view class="data_header">
|
||||
<MyDaySelect
|
||||
:day="useModel.formData.day"
|
||||
v-model:valueModel="useModel.formData.day"
|
||||
/>
|
||||
<hs-day-picker
|
||||
v-model:valueModel="useModel.formData.day"
|
||||
icon="calendar"
|
||||
/>
|
||||
<MyDaySelect :day="useModel.formData.day" v-model:valueModel="useModel.formData.day" />
|
||||
<hs-day-picker v-model:valueModel="useModel.formData.day" icon="calendar" />
|
||||
</view>
|
||||
<view class="data_total_price">
|
||||
<view class="data_title">交易金额(元)</view>
|
||||
@ -33,10 +27,10 @@
|
||||
</hs-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { watch } from "vue";
|
||||
import MyDaySelect from "./daySelect.vue";
|
||||
import useModel from "../model";
|
||||
import method from "../method";
|
||||
import { watch } from 'vue'
|
||||
import MyDaySelect from './daySelect.vue'
|
||||
import useModel from '../model'
|
||||
import method from '../method'
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.data_header {
|
||||
|
||||
@ -1,53 +1,39 @@
|
||||
<template>
|
||||
<cc-root-view>
|
||||
<view class="HomePage">
|
||||
<hs-custom-title title="废品回收助手" />
|
||||
<MyUserInfo />
|
||||
<MyShowData />
|
||||
<view class="OrderTitle">
|
||||
最近订单
|
||||
<view class="more_btn">
|
||||
更多<uni-icons type="right" size="13" color="#3da605"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<hs-order-items />
|
||||
<!-- <view class="footer_group_btn">
|
||||
<hs-button label="新增收货单" size="md" />
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="HomePage"> 2 </view>
|
||||
</cc-root-view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const App = getApp();
|
||||
import MyShowData from "./components/showData.vue";
|
||||
import MyUserInfo from "./components/useInfo.vue";
|
||||
import { onShareAppMessage, onShareTimeline, onShow } from "@dcloudio/uni-app";
|
||||
import { setTabBarData } from "@/common/libraries/setTabBar";
|
||||
const auth = useWeAppAuthStore();
|
||||
import useModel from "./model";
|
||||
import method from "./method";
|
||||
import { useWeAppAuthStore } from "@/common";
|
||||
import { getCurrentInstance, ref } from "vue";
|
||||
import useUser from "@/common/libraries/userUserLogin";
|
||||
const App = getApp()
|
||||
import MyShowData from './components/showData.vue'
|
||||
import MyUserInfo from './components/useInfo.vue'
|
||||
import { onShareAppMessage, onShareTimeline, onShow } from '@dcloudio/uni-app'
|
||||
import { setTabBarData } from '@/common/libraries/setTabBar'
|
||||
const auth = useWeAppAuthStore()
|
||||
import useModel from './model'
|
||||
import method from './method'
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
import { getCurrentInstance, ref } from 'vue'
|
||||
import useUser from '@/common/libraries/userUserLogin'
|
||||
onShow(async () => {
|
||||
setTabBarData(0);
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched;
|
||||
});
|
||||
setTabBarData(0)
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
|
||||
})
|
||||
|
||||
onShareAppMessage(() => {
|
||||
return {
|
||||
title: "废品回收助手",
|
||||
path: "/pages/index/index",
|
||||
};
|
||||
});
|
||||
title: '废品回收助手',
|
||||
path: '/pages/index/index'
|
||||
}
|
||||
})
|
||||
onShareTimeline(() => {
|
||||
return {
|
||||
title: "废品回收助手",
|
||||
path: "/pages/index/index",
|
||||
};
|
||||
});
|
||||
title: '废品回收助手',
|
||||
path: '/pages/index/index'
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./style.scss";
|
||||
@import './style.scss';
|
||||
</style>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { getApiLoading } from "@/common/libraries/apiLoading";
|
||||
import { Apis } from "@/gen/Apis";
|
||||
import useModel from "./model";
|
||||
import { useWeAppAuthStore } from "@/common";
|
||||
const auth = useWeAppAuthStore();
|
||||
export default {};
|
||||
import { getApiLoading } from '@/common/libraries/apiLoading'
|
||||
import { Apis } from '@/gen/Apis'
|
||||
import useModel from './model'
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
const auth = useWeAppAuthStore()
|
||||
export default {}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { reactive, ref } from "vue";
|
||||
import { getDay } from "@/common/libraries/day";
|
||||
import { reactive, ref } from 'vue'
|
||||
import { getDay } from '@/common/libraries/day'
|
||||
export default {
|
||||
formData: reactive({ day: getDay() }),
|
||||
data: ref<any>(),
|
||||
};
|
||||
data: ref<any>()
|
||||
}
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
<template></template>
|
||||
<script setup lang="ts">
|
||||
import { useWeAppAuthStore } from "@/common";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { getCurrentInstance } from "vue";
|
||||
import useUser from "@/common/libraries/userUserLogin";
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { getCurrentInstance } from 'vue'
|
||||
import useUser from '@/common/libraries/userUserLogin'
|
||||
onShow(async () => {
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
mask: true,
|
||||
});
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched;
|
||||
uni.hideLoading();
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
|
||||
uni.hideLoading()
|
||||
if (useUser.getLoginStatus()) {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user