cyl/job_im
jscyl13849007907 6 days ago
parent 039d12b6a5
commit 2c7c49f26c

@ -168,6 +168,12 @@
"backgroundColorBottom": "#ffffff" "backgroundColorBottom": "#ffffff"
} }
}, },
{
"path": "config",
"style": {
"navigationBarTitleText": "演示配置"
}
},
{ {
"path": "set", "path": "set",
"style": { "style": {

@ -1,5 +1,5 @@
<template> <template>
<!-- :style="{ minHeight: `calc(100vh - ${navbarHeight}px)` }" --> <!-- :style="{ minHeight: `calc(100vh - ${navbarHeight}px)` }" -->
<view class="p-home-inedx g_w_all g_kuaishou" :class="computeCode == -1 ? 'g_flex_column_center' : ''" :style="{ 'background-image': `linear-gradient(to bottom, ${themeColor} 0%, #ededed 15%, #ededed 100%)`, minHeight: `calc(100vh)` }"> <view class="p-home-inedx g_w_all g_kuaishou" :class="computeCode == -1 ? 'g_flex_column_center' : ''" :style="{ 'background-image': `linear-gradient(to bottom, ${themeColor} 0%, #ededed 15%, #ededed 100%)`, minHeight: `calc(100vh)` }">
<div class="navContainer"> <div class="navContainer">
<u-navbar :is-back="false" :is-fixed="true" :borderBottom="false" background="transparent" :title-bold="false"> <u-navbar :is-back="false" :is-fixed="true" :borderBottom="false" background="transparent" :title-bold="false">
@ -356,6 +356,12 @@ export default {
} }
uni.setStorageSync("miniApp-info", obj); uni.setStorageSync("miniApp-info", obj);
this.appInfo = obj; this.appInfo = obj;
let demoEnabled = uni.getStorageSync("DEMO_MODE_ENABLED");
let demoConfig = uni.getStorageSync("DEMO_MODE_CONFIG");
if (demoEnabled && demoConfig) {
this.$set(this.appInfo, 'logo', demoConfig.logo);
this.$set(this.appInfo, 'appName', demoConfig.appName);
}
if (this.appInfo.noticeImg) { if (this.appInfo.noticeImg) {
this.noticeImg = this.appInfo.noticeImg; this.noticeImg = this.appInfo.noticeImg;
} else { } else {
@ -389,6 +395,13 @@ export default {
that.showNotic = "play"; that.showNotic = "play";
} }
}, 100); }, 100);
let demoEnabled = uni.getStorageSync("DEMO_MODE_ENABLED");
let demoConfig = uni.getStorageSync("DEMO_MODE_CONFIG");
if (demoEnabled && demoConfig) {
that.$set(that.appInfo, 'logo', demoConfig.logo);
that.$set(that.appInfo, 'appName', demoConfig.appName);
}
}, },
data() { data() {
return { return {

@ -136,6 +136,24 @@
@clickItem="goPage('/root/person/set')" @clickItem="goPage('/root/person/set')"
/> />
</view> </view>
<view class="g_mt_10">
<g-panel-form-item
:list="[
{
icon: 'laptop',
label: '演示模式',
result: demoModeEnabled ? '已开启' : '',
path: '/root/person/config',
tip: 'set',
pRow: 0,
rpl:0,
fpl:0,
pColumn:16,
},
]"
@clickItem="goPage('/root/person/config')"
/>
</view>
<view class="g_mt_24 g_position_rela u-skeleton" v-if="userInfo.admin || isTeamleader"> <view class="g_mt_24 g_position_rela u-skeleton" v-if="userInfo.admin || isTeamleader">
<view class="g_radius_50 g_text_c" style="position: absolute; right: 16px; top: 5px; color: #fff; background-color: #ff4400; font-size: 12px; min-width: 16px" v-if="applyNum > 0"> <view class="g_radius_50 g_text_c" style="position: absolute; right: 16px; top: 5px; color: #fff; background-color: #ff4400; font-size: 12px; min-width: 16px" v-if="applyNum > 0">
{{ applyNum }} {{ applyNum }}
@ -236,6 +254,7 @@ export default {
agencyCode:'', agencyCode:'',
applystatys:null, applystatys:null,
isJm:uni.getStorageSync("apply-userinfo") && uni.getStorageSync("apply-userinfo").agencyId && uni.getStorageSync("apply-userinfo").agencyId == '114827', isJm:uni.getStorageSync("apply-userinfo") && uni.getStorageSync("apply-userinfo").agencyId && uni.getStorageSync("apply-userinfo").agencyId == '114827',
demoModeEnabled: uni.getStorageSync("DEMO_MODE_ENABLED") || false,
themeColor: getApp().globalData.themeColor, themeColor: getApp().globalData.themeColor,
themeBackgroundColor: getApp().globalData.themeBackgroundColor, themeBackgroundColor: getApp().globalData.themeBackgroundColor,
applyNum: 0, applyNum: 0,
@ -316,6 +335,7 @@ export default {
}, },
onShow() { onShow() {
let that = this; let that = this;
that.demoModeEnabled = uni.getStorageSync("DEMO_MODE_ENABLED") || false;
if (uni.getStorageSync("apply-token")) { if (uni.getStorageSync("apply-token")) {
that.G.checkToken().then(() => { that.G.checkToken().then(() => {
that.agencyInfo = uni.getStorageSync("agencyInfo"); that.agencyInfo = uni.getStorageSync("agencyInfo");

@ -0,0 +1,116 @@
<template>
<view class="p-person-config g_w_all g_kuaishou">
<view class="g_h_10"></view>
<view class="g_bg_f g_ml_12 g_mr_12 g_radius_8" style="overflow: hidden;">
<view class="g_flex_row_between flex_center g_p_16" style="border-bottom: 0.5px solid #eee;">
<view class="g_fs_16 g_c_0">小程序名称</view>
<view class="g_flex_1 g_flex_row_end">
<input class="g_fs_16 g_text_r" type="text" v-model="formData.appName" placeholder="请输入小程序名称" placeholder-class="g_c_9" style="width: 200px;" />
</view>
</view>
<view class="g_flex_row_between flex_center g_p_16" style="border-bottom: 0.5px solid #eee;" @click="chooseAvatar">
<view class="g_fs_16 g_c_0">小程序头像</view>
<view class="g_flex_row_end flex_center">
<image v-if="formData.logo" :src="formData.logo" class="g_w_32 g_h_32 g_radius_50" mode="aspectFill"></image>
<view v-else class="g_w_32 g_h_32 g_radius_50 g_bg_f_5 g_flex_c">
<i class="iconfont icon-add g_c_9 g_fs_16"></i>
</view>
<i class="iconfont icon-gengduo11 g_ml_8 g_c_9 g_fs_14"></i>
</view>
</view>
<view class="g_flex_row_between flex_center g_p_16">
<view class="g_fs_16 g_c_0">开启演示模式</view>
<u-switch v-model="formData.enabled" :activeColor="themeColor" inactiveColor="#e5e5e5" @change="handleSwitchChange"></u-switch>
</view>
</view>
<view class="g_mt_40 g_ml_12 g_mr_12">
<rh-button btnText="保存" @clickBtn="handleSubmit" type="primary" size="full" />
</view>
</view>
</template>
<script>
import { get } from 'mobx';
export default {
data() {
let demoConfig = uni.getStorageSync("DEMO_MODE_CONFIG") || {};
return {
themeColor: getApp().globalData.themeColor,
formData: {
appName: demoConfig.appName || "",
logo: demoConfig.logo || "",
enabled: demoConfig.enabled || false,
},
};
},
methods: {
handleSwitchChange(e) {
this.formData.enabled = e;
},
chooseAvatar() {
let that = this;
uni.showActionSheet({
itemList: ["从相册选择", "使用相机"],
success: function (res) {
if (res.tapIndex == 0) {
that.setAvatar(["album"]);
} else {
that.setAvatar(["camera"]);
}
},
});
},
setAvatar($type) {
let that = this;
that.G.uploadImgToOss(
(res) => {
that.formData.logo = res.image;
uni.hideLoading();
},
"avatar",
"default",
1,
$type
);
},
handleSubmit() {
let that = this;
if (that.formData.enabled && !that.formData.appName) {
uni.showToast({
title: "请输入小程序名称",
icon: "none",
});
return;
}
if (that.formData.enabled && !that.formData.logo) {
uni.showToast({
title: "请上传小程序头像",
icon: "none",
});
return;
}
uni.setStorageSync("DEMO_MODE_CONFIG", {
appName: that.formData.appName,
logo: that.formData.logo,
enabled: that.formData.enabled,
});
uni.setStorageSync("DEMO_MODE_ENABLED", that.formData.enabled);
uni.showToast({
title: "保存成功",
icon: "success",
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
},
},
};
</script>
<style lang="scss">
.p-person-config{
min-height: 100vh;
background-color: #ededed;
}
</style>
Loading…
Cancel
Save