微信小程序发布试用版本
This commit is contained in:
93
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/dc-push/push.js
vendored
Normal file
93
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/dc-push/push.js
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
function isTurnedOnPush() {
|
||||
var isOn = void 0;
|
||||
try {
|
||||
if ("iOS" == plus.os.name) {
|
||||
var types = 0;
|
||||
var app = plus.ios.invoke("UIApplication", "sharedApplication");
|
||||
var settings = plus.ios.invoke(app, "currentUserNotificationSettings");
|
||||
if (settings) {
|
||||
types = settings.plusGetAttribute("types");
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
types = plus.ios.invoke(app, "enabledRemoteNotificationTypes");
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
isOn = 0 != types;
|
||||
} else {
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var manager = plus.android.invoke("com.igexin.sdk.PushManager", "getInstance");
|
||||
isOn = plus.android.invoke(manager, "isPushTurnedOn", main);
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages-subpackage/ucenter/settings/dc-push/push.js:25", "exception in isTurnedOnPush@dc-push!!");
|
||||
}
|
||||
return isOn;
|
||||
}
|
||||
function turnOnPush() {
|
||||
try {
|
||||
if ("iOS" == plus.os.name) {
|
||||
if (!isTurnedOnPush()) {
|
||||
settingInIos();
|
||||
}
|
||||
} else {
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var manager = plus.android.invoke("com.igexin.sdk.PushManager", "getInstance");
|
||||
plus.android.invoke(manager, "turnOnPush", main);
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages-subpackage/ucenter/settings/dc-push/push.js:48", "exception in turnOnPush@dc-push!!");
|
||||
}
|
||||
}
|
||||
function trunOffPush() {
|
||||
try {
|
||||
if ("iOS" == plus.os.name) {
|
||||
} else {
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var manager = plus.android.invoke("com.igexin.sdk.PushManager", "getInstance");
|
||||
plus.android.invoke(manager, "turnOffPush", main);
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages-subpackage/ucenter/settings/dc-push/push.js:67", "exception in trunOffPush@dc-push!!");
|
||||
}
|
||||
}
|
||||
function settingInIos() {
|
||||
try {
|
||||
if ("iOS" == plus.os.name) {
|
||||
var app = plus.ios.invoke("UIApplication", "sharedApplication");
|
||||
var setting2 = plus.ios.invoke("NSURL", "URLWithString:", "app-settings:");
|
||||
plus.ios.invoke(app, "openURL:", setting2);
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(app);
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages-subpackage/ucenter/settings/dc-push/push.js:84", "exception in settingInIos@dc-push!!");
|
||||
}
|
||||
}
|
||||
function settingInAndroid() {
|
||||
if (common_vendor.index.getSystemInfoSync().platform == "android") {
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var Settings = plus.android.importClass("android.provider.Settings");
|
||||
var intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
main.startActivity(intent);
|
||||
}
|
||||
}
|
||||
function setting() {
|
||||
if (common_vendor.index.getSystemInfoSync().platform == "ios") {
|
||||
settingInIos();
|
||||
}
|
||||
if (common_vendor.index.getSystemInfoSync().platform == "android") {
|
||||
settingInAndroid();
|
||||
}
|
||||
}
|
||||
const pushServer = {
|
||||
isOn: isTurnedOnPush,
|
||||
iosSetting: settingInIos,
|
||||
on: turnOnPush,
|
||||
off: trunOffPush,
|
||||
setting
|
||||
};
|
||||
exports.pushServer = pushServer;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages-subpackage/ucenter/settings/dc-push/push.js.map
|
||||
255
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.js
vendored
Normal file
255
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.js
vendored
Normal file
@@ -0,0 +1,255 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const pagesSubpackage_ucenter_settings_dcPush_push = require("./dc-push/push.js");
|
||||
const common_store = require("../../../common/store.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
pushServer: pagesSubpackage_ucenter_settings_dcPush_push.pushServer,
|
||||
supportMode: [],
|
||||
pushIsOn: "wait",
|
||||
currentLanguage: "",
|
||||
userInfo: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasLogin() {
|
||||
return common_store.store.hasLogin;
|
||||
},
|
||||
i18nEnable() {
|
||||
return getApp().globalData.config.i18n.enable;
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.currentLanguage = common_vendor.index.getStorageSync("CURRENT_LANG") == "en" ? "English" : "简体中文";
|
||||
common_vendor.index.setNavigationBarTitle({
|
||||
title: this.$t("settings.navigationBarTitle")
|
||||
});
|
||||
common_vendor.index.checkIsSupportSoterAuthentication({
|
||||
success: (res) => {
|
||||
this.supportMode = res.supportMode;
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:65", err);
|
||||
}
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
async changeLoginState() {
|
||||
if (this.hasLogin) {
|
||||
await common_store.mutations.logout();
|
||||
} else {
|
||||
common_vendor.index.redirectTo({
|
||||
// 默认使用账号密码登录页
|
||||
url: "/uni_modules/uni-id-pages/pages/login/login-withpwd"
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 开始生物认证
|
||||
*/
|
||||
startSoterAuthentication(checkAuthMode) {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:93", checkAuthMode);
|
||||
let title = { "fingerPrint": this.$t("settings.fingerPrint"), "facial": this.$t("settings.facial") }[checkAuthMode];
|
||||
this.checkIsSoterEnrolledInDevice({ checkAuthMode, title }).then(() => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:98", checkAuthMode, title);
|
||||
common_vendor.index.startSoterAuthentication({
|
||||
requestAuthModes: [checkAuthMode],
|
||||
challenge: "123456",
|
||||
// 微信端挑战因子
|
||||
authContent: this.$t("settings.please") + ` ${title}`,
|
||||
complete: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:105", res);
|
||||
},
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:108", res);
|
||||
if (res.errCode == 0) {
|
||||
return common_vendor.index.showToast({
|
||||
title: `${title}` + this.$t("settings.successText"),
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
common_vendor.index.showToast({
|
||||
title: this.$t("settings.failTip"),
|
||||
icon: "none"
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:128", err);
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:129", `认证失败:${err.errCode}`);
|
||||
common_vendor.index.showToast({
|
||||
title: this.$t("settings.authFailed"),
|
||||
// title: `认证失败`,
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
checkIsSoterEnrolledInDevice({ checkAuthMode, title }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.checkIsSoterEnrolledInDevice({
|
||||
checkAuthMode,
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:144", res);
|
||||
if (res.isEnrolled) {
|
||||
return resolve(res);
|
||||
}
|
||||
common_vendor.index.showToast({
|
||||
title: this.$t("settings.deviceNoOpen") + `${title}`,
|
||||
icon: "none"
|
||||
});
|
||||
reject(res);
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:155", err);
|
||||
common_vendor.index.showToast({
|
||||
title: `${title}` + this.$t("settings.fail"),
|
||||
icon: "none"
|
||||
});
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
clearTmp() {
|
||||
common_vendor.index.showLoading({
|
||||
title: this.$t("settings.clearing"),
|
||||
mask: true
|
||||
});
|
||||
common_vendor.index.getSavedFileList({
|
||||
success: (res) => {
|
||||
if (res.fileList.length > 0) {
|
||||
common_vendor.index.removeSavedFile({
|
||||
filePath: res.fileList[0].filePath,
|
||||
complete: (res2) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:187", res2);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: this.$t("settings.clearedSuccessed"),
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: this.$t("settings.clearedSuccessed"),
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
complete: (e) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:204", e);
|
||||
}
|
||||
});
|
||||
},
|
||||
changeLanguage() {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:209", "语言切换");
|
||||
common_vendor.index.showActionSheet({
|
||||
itemList: ["English", "简体中文"],
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages-subpackage/ucenter/settings/settings.vue:213", res.tapIndex);
|
||||
let language = common_vendor.index.getStorageSync("CURRENT_LANG");
|
||||
if (!res.tapIndex && language == "zh-Hans" || res.tapIndex && language == "en") {
|
||||
const globalData = getApp().globalData;
|
||||
if (language === "en") {
|
||||
language = globalData.locale = "zh-Hans";
|
||||
} else {
|
||||
language = globalData.locale = "en";
|
||||
}
|
||||
common_vendor.index.setStorageSync("CURRENT_LANG", language);
|
||||
const app = getApp();
|
||||
if (app && app.globalData && app.globalData.$i18n) {
|
||||
app.globalData.$i18n.locale = language;
|
||||
}
|
||||
this.currentLanguage = res.tapIndex ? "简体中文" : "English";
|
||||
if (common_vendor.index.setLocale) {
|
||||
common_vendor.index.setLocale(language);
|
||||
}
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/list/list",
|
||||
complete: () => {
|
||||
common_vendor.index.$emit("changeLanguage", language);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
},
|
||||
complete: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_list_item2 = common_vendor.resolveComponent("uni-list-item");
|
||||
const _easycom_uni_list2 = common_vendor.resolveComponent("uni-list");
|
||||
(_easycom_uni_list_item2 + _easycom_uni_list2)();
|
||||
}
|
||||
const _easycom_uni_list_item = () => "../../../uni_modules/uni-list/components/uni-list-item/uni-list-item.js";
|
||||
const _easycom_uni_list = () => "../../../uni_modules/uni-list/components/uni-list/uni-list.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_list_item + _easycom_uni_list)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
title: _ctx.$t("settings.userInfo"),
|
||||
to: "/uni_modules/uni-id-pages/pages/userinfo/userinfo",
|
||||
link: "navigateTo"
|
||||
}),
|
||||
b: $data.userInfo.mobile
|
||||
}, $data.userInfo.mobile ? {
|
||||
c: common_vendor.p({
|
||||
title: _ctx.$t("settings.changePassword"),
|
||||
to: "/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve?phoneNumber=" + $data.userInfo.mobile,
|
||||
link: "navigateTo"
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.p({
|
||||
border: false
|
||||
}),
|
||||
e: $data.supportMode.includes("fingerPrint")
|
||||
}, $data.supportMode.includes("fingerPrint") ? {
|
||||
f: common_vendor.o(($event) => $options.startSoterAuthentication("fingerPrint")),
|
||||
g: common_vendor.p({
|
||||
title: _ctx.$t("settings.fingerPrint"),
|
||||
link: true
|
||||
})
|
||||
} : {}, {
|
||||
h: $data.supportMode.includes("facial")
|
||||
}, $data.supportMode.includes("facial") ? {
|
||||
i: common_vendor.o(($event) => $options.startSoterAuthentication("facial")),
|
||||
j: common_vendor.p({
|
||||
title: _ctx.$t("settings.facial"),
|
||||
link: true
|
||||
})
|
||||
} : {}, {
|
||||
k: $options.i18nEnable
|
||||
}, $options.i18nEnable ? {
|
||||
l: common_vendor.o($options.changeLanguage),
|
||||
m: common_vendor.p({
|
||||
title: _ctx.$t("settings.changeLanguage"),
|
||||
rightText: $data.currentLanguage,
|
||||
link: true
|
||||
})
|
||||
} : {}, {
|
||||
n: common_vendor.p({
|
||||
border: false
|
||||
}),
|
||||
o: $options.hasLogin
|
||||
}, $options.hasLogin ? {
|
||||
p: common_vendor.t(_ctx.$t("settings.logOut"))
|
||||
} : {
|
||||
q: common_vendor.t(_ctx.$t("settings.login"))
|
||||
}, {
|
||||
r: common_vendor.o((...args) => $options.changeLoginState && $options.changeLoginState(...args))
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages-subpackage/ucenter/settings/settings.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "设置",
|
||||
"usingComponents": {
|
||||
"uni-list-item": "../../../uni_modules/uni-list/components/uni-list-item/uni-list-item",
|
||||
"uni-list": "../../../uni_modules/uni-list/components/uni-list/uni-list"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="content"><uni-list wx:if="{{d}}" u-s="{{['d']}}" class="mt10" u-i="0d3757e4-0" bind:__l="__l" u-p="{{d}}"><uni-list-item wx:if="{{a}}" u-i="0d3757e4-1,0d3757e4-0" bind:__l="__l" u-p="{{a}}"></uni-list-item><uni-list-item wx:if="{{b}}" u-i="0d3757e4-2,0d3757e4-0" bind:__l="__l" u-p="{{c}}"></uni-list-item></uni-list><uni-list wx:if="{{n}}" u-s="{{['d']}}" class="mt10" u-i="0d3757e4-3" bind:__l="__l" u-p="{{n}}"><uni-list-item wx:if="{{e}}" bindclick="{{f}}" u-i="0d3757e4-4,0d3757e4-3" bind:__l="__l" u-p="{{g}}"></uni-list-item><uni-list-item wx:if="{{h}}" bindclick="{{i}}" u-i="0d3757e4-5,0d3757e4-3" bind:__l="__l" u-p="{{j}}"></uni-list-item><uni-list-item wx:if="{{k}}" bindclick="{{l}}" u-i="0d3757e4-6,0d3757e4-3" bind:__l="__l" u-p="{{m}}"></uni-list-item></uni-list><view class="bottom-back" bindtap="{{r}}"><text wx:if="{{o}}" class="bottom-back-text">{{p}}</text><text wx:else class="bottom-back-text">{{q}}</text></view></view>
|
||||
52
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.wxss
vendored
Normal file
52
unpackage/dist/dev/mp-weixin/pages-subpackage/ucenter/settings/settings.wxss
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
page {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
uni-button:after {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
.content {
|
||||
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
.bottom-back {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
width: 750rpx;
|
||||
height: 44px;
|
||||
|
||||
display: flex;
|
||||
width: 100%;
|
||||
border: none;
|
||||
|
||||
border-width: 0;
|
||||
border-radius: 0;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.bottom-back-text {
|
||||
font-size: 33rpx;
|
||||
}
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user