This commit is contained in:
yangzhq68909 2024-10-29 15:34:31 +08:00
parent ba4d6ac0dd
commit f27c6e4ef0
13 changed files with 287 additions and 800 deletions

37
App.vue
View File

@ -3,7 +3,8 @@
useUpdateApp
} from '@/store/update.js';
import {
cxcJurisdictionApi
cxcJurisdictionApi,
taskListApi
} from '@/api/api.js';
import {
onLaunch,
@ -12,17 +13,27 @@
import {
getLocation,
getWeather,
beforeJump
// beforeJump
} from './utils/index.js';
import {
useStore
} from '@/store';
import {
ref
} from 'vue';
onLaunch(() => {
console.log('---', todoNum.value)
//
uni.setTabBarBadge({
index: '1',
text: todoNum.value //
});
uni.onTabBarMidButtonTap(() => {
beforeJump('/pages/task/index', () => {
uni.navigateTo({
url: '/pages/task/index?id=0'
})
uni.navigateTo({
url: '/pages/task/todotask'
})
})
@ -32,6 +43,8 @@
getLocation()
})
onShow(() => {
taskList()
cxcJurisdictionApi({
id: "1827997127165677570"
}).then((res) => {
@ -43,6 +56,18 @@
}
})
})
const todoNum = ref(0)
const taskList = () => {
taskListApi({
pageNo: 1,
pageSize: 4,
_t: new Date().getTime()
}).then((res) => {
if (res.success) {
todoNum.value = res.result.total
}
})
}
</script>
<style lang="scss">

View File

@ -2,9 +2,9 @@
<view :class="['content',{'gray':store.isgray==1}]">
<view class="nav">
<view class="nav_box f-row aic jcb">
<view class="menu" @click="showDrawer()">
<!-- <view class="menu" @click="showDrawer()">
<image src="../../static/index/menu.png" mode=""></image>
</view>
</view> -->
<view class="weather_calender f-row aic">
<view class="position f-row aic">
<image src="../../static/index/position.png" mode=""></image>
@ -114,14 +114,14 @@
</view>
</view>
</view>
<uni-drawer ref="showLeft" mode="left" :width="156">
<!-- <uni-drawer ref="showLeft" mode="left" :width="156">
<view class="menu_list">
<view class="f-row aic jcb" v-for="item,i in menu" :key="i" @click="totask(item.path)">
<text>{{item.text}}</text>
<uni-icons type="right" size="20" color="#333333"></uni-icons>
</view>
</view>
</uni-drawer>
</uni-drawer> -->
</view>
</template>
@ -133,7 +133,7 @@
onLoad,
onShow,
onPullDownRefresh,
onReachBottom
// onReachBottom
} from '@dcloudio/uni-app';
import {
bpmlistApi,
@ -247,15 +247,15 @@
})
}
const menu = ref([{
text: '我的任务',
path: '/pages/task/index?id=0'
},{
text: '历史任务',
path: '/pages/task/index?id=2'
}])
// const menu = ref([{
// text: '',
// path: '/pages/task/index?id=0'
// },{
// text: '',
// path: '/pages/task/index?id=2'
// }])
let pageNo = 1
let pageSize = 15
let pageSize = 5
let loading = false
const list = ref([])
/**公文接口*/
@ -341,7 +341,6 @@
return arr
}
onPullDownRefresh(() => {
pageNo = 1
loading = false
list.value = []
cxcDaping()
@ -361,11 +360,11 @@
fagui()
}
}
onReachBottom(() => {
if (loading) return
pageNo++
getlist()
})
// onReachBottom(() => {
// if (loading) return
// pageNo++
// getlist()
// })
</script>
<style lang="scss" scoped>
@ -381,21 +380,21 @@
.menu_list {
padding: 0 30rpx;
font-size: 28rpx;
color: #333333;
// .menu_list {
// padding: 0 30rpx;
// font-size: 28rpx;
// color: #333333;
view {
height: 110rpx;
border-bottom: 1px solid #EFEFEF;
}
// view {
// height: 110rpx;
// border-bottom: 1px solid #EFEFEF;
// }
image {
width: 13rpx;
height: 23rpx;
}
}
// image {
// width: 13rpx;
// height: 23rpx;
// }
// }
.nav {
width: calc(100% - 60rpx);
@ -419,12 +418,12 @@
width: calc(100% - 60rpx);
}
.menu {
image {
width: 36rpx;
height: 46rpx;
}
}
// .menu {
// image {
// width: 36rpx;
// height: 46rpx;
// }
// }
.weather_calender {
image {

View File

@ -29,21 +29,21 @@
</view>
<view class="f-col aic">
<view class="msg f-row aic jca">
<view class="box f-col aic" @click="jump('/pages/task/todotask')">
<!-- <view class="box f-col aic" @click="jump('/pages/task/todotask')">
<view class="num">
{{todoNum}}
</view>
<text>个人办公</text>
</view>
</view> -->
<view class="box f-col aic">
<view class="num">
{{step}}
{{0}}
</view>
<text>步数</text>
</view>
<view class="box f-col aic" @click="jump('/pages/useredit/addressbook')">
<view class="num">
34
0
</view>
<text>通讯录</text>
</view>
@ -82,10 +82,6 @@
import {
ref
} from 'vue';
import {
userProfileApi,
taskListApi
} from '@/api/api.js';
import {
queryRoleApi
} from '@/api/login.js';
@ -106,14 +102,7 @@
useStore
} from '@/store';
const store = useStore();
import * as StepCounter from '../../uni_modules/wuwx-step-counter';
const step = ref(0)
StepCounter.startStepCountingUpdates({
handler: (numberOfSteps, timestamp, error) => {
step.value = numberOfSteps
}
});
const currentVersion = ref(plus.runtime.version)
const arr = ref([
// {
@ -170,21 +159,21 @@
}
})
}
onShow(() => {
taskList()
})
const todoNum = ref(0)
const taskList = () => {
taskListApi({
pageNo: 1,
pageSize: 4,
_t: new Date().getTime()
}).then((res) => {
if (res.success) {
todoNum.value = res.result.total
}
})
}
// onShow(() => {
// taskList()
// })
// const todoNum = ref(0)
// const taskList = () => {
// taskListApi({
// pageNo: 1,
// pageSize: 4,
// _t: new Date().getTime()
// }).then((res) => {
// if (res.success) {
// todoNum.value = res.result.total
// }
// })
// }
</script>
<style lang="scss" scoped>

View File

@ -1,2 +0,0 @@
## 0.2.02023-08-03
完善 package.json 文件

View File

@ -1,83 +0,0 @@
{
"id": "wuwx-step-counter",
"displayName": "计步器兼容Android和iOS",
"version": "0.2.0",
"description": "基于UTS实现兼容Android和iOS的计步器插件",
"keywords": [
"计步器",
"计步",
"步数"
],
"repository": "https://github.com/wuwx/wuwx-step-counter",
"engines": {
"HBuilderX": "^3.6.8"
},
"dcloudext": {
"type": "uts",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": "11990950"
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "运动与健身"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-android": "y",
"app-ios": "y"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -1,19 +0,0 @@
# wuwx-step-counter
### 使用方法
```
import * as StepCounter from '../../uni_modules/wuwx-step-counter'
StepCounter.startStepCountingUpdates({
handler: (numberOfSteps, timestamp, error) => {
console.log(numberOfSteps)
}
});
```
### 开发文档
[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html)
[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html)
[UTS 组件插件](https://uniapp.dcloud.net.cn/plugin/uts-component.html)
[Hello UTS](https://gitcode.net/dcloud/hello-uts)

View File

@ -1,58 +0,0 @@
import Context from "android.content.Context";
import SensorEventListener from 'android.hardware.SensorEventListener';
import SensorEvent from 'android.hardware.SensorEvent';
import Sensor from 'android.hardware.Sensor';
import UTSAndroid from 'io.dcloud.uts.UTSAndroid';
import SensorManager from 'android.hardware.SensorManager';
type StartStepCountingUpdatesOptions = {
stepCounts: Int | null;
handler: (numberOfSteps : Float, timestamp : Date, error : any) => void;
}
type QueryStepCountStartingOptions = {
start: Date | null,
end: Date | null,
handler: (numberOfSteps : Int, error : any) => void
}
let successHandler = (numberOfSteps : Float, timestamp : Date, error : any) => {
};
class StepCounterSensorEventListener implements SensorEventListener {
override onSensorChanged(event : SensorEvent) : void {
successHandler(event.values[0], new Date(), "")
}
override onAccuracyChanged(sensor : Sensor, param1 : Int) : void {
}
}
export function startStepCountingUpdates(options: StartStepCountingUpdatesOptions) {
let stepCounterSensorEventListener = new StepCounterSensorEventListener();
successHandler = options.handler;
const context = UTSAndroid.getAppContext();
if (context != null) {
const sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager
sensorManager.unregisterListener(stepCounterSensorEventListener, sensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER))
sensorManager.registerListener(stepCounterSensorEventListener, sensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER), SensorManager.SENSOR_DELAY_NORMAL)
}
}
export function stopStepCountingUpdates() {
}
export function queryStepCountStarting(options: QueryStepCountStartingOptions) {
}
export function isStepCountingAvailable() {
}

View File

@ -1,48 +0,0 @@
import { CMStepCounter } from 'CoreMotion';
import { NSError, OperationQueue } from 'Foundation';
type StartStepCountingUpdatesOptions = {
stepCounts: Int | null;
handler: (numberOfSteps : Int, timestamp : Date, error : NSError | null) => void;
}
type QueryStepCountStartingOptions = {
start: Date | null,
end: Date | null,
handler: (numberOfSteps : Int, error : NSError | null) => void
}
let stepCounter = new CMStepCounter()
export function startStepCountingUpdates(options: StartStepCountingUpdatesOptions) {
if (options.stepCounts == null) {
options.stepCounts = 1
}
stepCounter.startStepCountingUpdates(to = OperationQueue.main, updateOn = options.stepCounts!, withHandler = options.handler)
}
export function stopStepCountingUpdates() {
stepCounter.stopStepCountingUpdates()
}
export function queryStepCountStarting(options: QueryStepCountStartingOptions) {
if (options.start == null) {
let start = new Date()
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
options.start = start
}
if (options.end == null) {
options.end = new Date()
}
stepCounter.queryStepCountStarting(from = options.start!, to = options.end!, to = OperationQueue.main, withHandler = options.handler)
}
export function isStepCountingAvailable() {
CMStepCounter.isStepCountingAvailable()
}

View File

@ -448,12 +448,12 @@ if (uni.restoreGlobal) {
}
return blob;
}
function download(url, name2, opts) {
function download(url, name, opts) {
const xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.responseType = "blob";
xhr.onload = function() {
saveAs(xhr.response, name2, opts);
saveAs(xhr.response, name, opts);
};
xhr.onerror = function() {
console.error("could not download file");
@ -491,15 +491,15 @@ if (uni.restoreGlobal) {
)
)
);
function downloadSaveAs(blob, name2 = "download", opts) {
function downloadSaveAs(blob, name = "download", opts) {
const a2 = document.createElement("a");
a2.download = name2;
a2.download = name;
a2.rel = "noopener";
if (typeof blob === "string") {
a2.href = blob;
if (a2.origin !== location.origin) {
if (corsEnabled(a2.href)) {
download(blob, name2, opts);
download(blob, name, opts);
} else {
a2.target = "_blank";
click(a2);
@ -517,10 +517,10 @@ if (uni.restoreGlobal) {
}, 0);
}
}
function msSaveAs(blob, name2 = "download", opts) {
function msSaveAs(blob, name = "download", opts) {
if (typeof blob === "string") {
if (corsEnabled(blob)) {
download(blob, name2, opts);
download(blob, name, opts);
} else {
const a2 = document.createElement("a");
a2.href = blob;
@ -530,16 +530,16 @@ if (uni.restoreGlobal) {
});
}
} else {
navigator.msSaveOrOpenBlob(bom(blob, opts), name2);
navigator.msSaveOrOpenBlob(bom(blob, opts), name);
}
}
function fileSaverSaveAs(blob, name2, opts, popup) {
function fileSaverSaveAs(blob, name, opts, popup) {
popup = popup || open("", "_blank");
if (popup) {
popup.document.title = popup.document.body.innerText = "downloading...";
}
if (typeof blob === "string")
return download(blob, name2, opts);
return download(blob, name, opts);
const force = blob.type === "application/octet-stream";
const isSafari = /constructor/i.test(String(_global.HTMLElement)) || "safari" in _global;
const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
@ -998,17 +998,17 @@ Only state can be modified.`);
}
}, (api) => {
const now2 = typeof api.now === "function" ? api.now.bind(api) : Date.now;
store.$onAction(({ after, onError, name: name2, args }) => {
store.$onAction(({ after, onError, name, args }) => {
const groupId = runningActionId++;
api.addTimelineEvent({
layerId: MUTATIONS_LAYER_ID,
event: {
time: now2(),
title: "🛫 " + name2,
title: "🛫 " + name,
subtitle: "start",
data: {
store: formatDisplay(store.$id),
action: formatDisplay(name2),
action: formatDisplay(name),
args
},
groupId
@ -1020,11 +1020,11 @@ Only state can be modified.`);
layerId: MUTATIONS_LAYER_ID,
event: {
time: now2(),
title: "🛬 " + name2,
title: "🛬 " + name,
subtitle: "end",
data: {
store: formatDisplay(store.$id),
action: formatDisplay(name2),
action: formatDisplay(name),
args,
result
},
@ -1039,11 +1039,11 @@ Only state can be modified.`);
event: {
time: now2(),
logType: "error",
title: "💥 " + name2,
title: "💥 " + name,
subtitle: "end",
data: {
store: formatDisplay(store.$id),
action: formatDisplay(name2),
action: formatDisplay(name),
args,
error
},
@ -1052,8 +1052,8 @@ Only state can be modified.`);
});
});
}, true);
store._customProperties.forEach((name2) => {
vue.watch(() => vue.unref(store[name2]), (newValue, oldValue) => {
store._customProperties.forEach((name) => {
vue.watch(() => vue.unref(store[name]), (newValue, oldValue) => {
api.notifyComponentUpdate();
api.sendInspectorState(INSPECTOR_ID);
if (isTimelineActive) {
@ -1062,7 +1062,7 @@ Only state can be modified.`);
event: {
time: now2(),
title: "Change",
subtitle: name2,
subtitle: name,
data: {
newValue,
oldValue
@ -1304,14 +1304,14 @@ Only state can be modified.`);
// use ref() to unwrap refs inside state TODO: check if this is still necessary
vue.toRefs(vue.ref(state ? state() : {}).value)
) : vue.toRefs(pinia2.state.value[id]);
return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name2) => {
if (name2 in localState) {
console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name2}" in store "${id}".`);
return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
if (name in localState) {
console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
}
computedGetters[name2] = vue.markRaw(vue.computed(() => {
computedGetters[name] = vue.markRaw(vue.computed(() => {
setActivePinia(pinia2);
const store2 = pinia2._s.get(id);
return getters[name2].call(store2, store2);
return getters[name].call(store2, store2);
}));
return computedGetters;
}, {}));
@ -1404,7 +1404,7 @@ Only state can be modified.`);
actionSubscriptions = [];
pinia2._s.delete($id);
}
function wrapAction(name2, action) {
function wrapAction(name, action) {
return function() {
setActivePinia(pinia2);
const args = Array.from(arguments);
@ -1418,7 +1418,7 @@ Only state can be modified.`);
}
triggerSubscriptions(actionSubscriptions, {
args,
name: name2,
name,
store,
after,
onError
@ -1754,7 +1754,7 @@ This will fail in production.`);
}
return target;
};
const _sfc_main$Q = {
const _sfc_main$P = {
__name: "login",
setup(__props) {
const store = useStore();
@ -1926,7 +1926,7 @@ This will fail in production.`);
};
}
};
const PagesLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-e4e4508d"], ["__file", "D:/projects/cxc-szcx-uniapp/pages/login/login.vue"]]);
const PagesLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-e4e4508d"], ["__file", "D:/projects/cxc-szcx-uniapp/pages/login/login.vue"]]);
const fontData = [
{
"font_class": "arrow-down",
@ -2577,7 +2577,7 @@ This will fail in production.`);
const reg = /^[0-9]*$/g;
return typeof val === "number" || reg.test(val) ? val + "px" : val;
};
const _sfc_main$P = {
const _sfc_main$O = {
name: "UniIcons",
emits: ["click"],
props: {
@ -2631,7 +2631,7 @@ This will fail in production.`);
}
}
};
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"text",
{
@ -2646,7 +2646,7 @@ This will fail in production.`);
/* CLASS, STYLE */
);
}
const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$e], ["__scopeId", "data-v-d31e1c47"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$d], ["__scopeId", "data-v-d31e1c47"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
let Calendar$1 = class Calendar {
constructor({
selected,
@ -3002,7 +3002,7 @@ This will fail in production.`);
}
return value;
}
const _sfc_main$O = {
const _sfc_main$N = {
props: {
weeks: {
type: Object,
@ -3036,7 +3036,7 @@ This will fail in production.`);
}
}
};
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"view",
{
@ -3092,7 +3092,7 @@ This will fail in production.`);
/* CLASS, NEED_HYDRATION */
);
}
const calendarItem = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$d], ["__scopeId", "data-v-3c762a01"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue"]]);
const calendarItem = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$c], ["__scopeId", "data-v-3c762a01"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue"]]);
const isObject = (val) => val !== null && typeof val === "object";
const defaultDelimiters = ["{", "}"];
class BaseFormatter {
@ -3451,7 +3451,7 @@ This will fail in production.`);
const {
t: t$3
} = initVueI18n(i18nMessages);
const _sfc_main$N = {
const _sfc_main$M = {
name: "UniDatetimePicker",
data() {
return {
@ -3944,9 +3944,9 @@ This will fail in production.`);
return str.charAt(0).toUpperCase() + str.slice(1);
},
// 检查当前值是否在范围内,不在则当前值重置为可选范围第一项
checkValue(name2, value, values) {
checkValue(name, value, values) {
if (values.indexOf(value) === -1) {
this[name2] = values[0];
this[name] = values[0];
}
},
// 每个月的实际天数
@ -4055,7 +4055,7 @@ This will fail in production.`);
}
}
};
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("view", { class: "uni-datetime-picker" }, [
vue.createElementVNode("view", {
onClick: _cache[0] || (_cache[0] = (...args) => $options.initTimePicker && $options.initTimePicker(...args))
@ -4332,11 +4332,11 @@ This will fail in production.`);
)) : vue.createCommentVNode("v-if", true)
]);
}
const TimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$c], ["__scopeId", "data-v-1d532b70"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue"]]);
const TimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$b], ["__scopeId", "data-v-1d532b70"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue"]]);
const {
t: t$2
} = initVueI18n(i18nMessages);
const _sfc_main$M = {
const _sfc_main$L = {
components: {
calendarItem,
timePicker: TimePicker
@ -4745,7 +4745,7 @@ This will fail in production.`);
* 派发事件
* @param {Object} name
*/
setEmit(name2) {
setEmit(name) {
if (!this.range) {
if (!this.calendar.fullDate) {
this.calendar = this.cale.getInfo(/* @__PURE__ */ new Date());
@ -4762,7 +4762,7 @@ This will fail in production.`);
fullDate,
extraInfo
} = this.calendar;
this.$emit(name2, {
this.$emit(name, {
range: this.cale.multipleStatus,
year,
month,
@ -4817,7 +4817,7 @@ This will fail in production.`);
}
}
};
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
const _component_calendar_item = vue.resolveComponent("calendar-item");
const _component_time_picker = vue.resolveComponent("time-picker");
const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$1);
@ -5101,8 +5101,8 @@ This will fail in production.`);
/* NEED_HYDRATION */
);
}
const Calendar = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$b], ["__scopeId", "data-v-1d379219"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue"]]);
const _sfc_main$L = {
const Calendar = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$a], ["__scopeId", "data-v-1d379219"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue"]]);
const _sfc_main$K = {
name: "UniDatetimePicker",
options: {
virtualHost: true
@ -5758,7 +5758,7 @@ This will fail in production.`);
}
}
};
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$1);
const _component_time_picker = vue.resolveComponent("time-picker");
const _component_Calendar = vue.resolveComponent("Calendar");
@ -6102,116 +6102,7 @@ This will fail in production.`);
}, null, 8, ["date", "defTime", "start-date", "end-date", "selectableTimes", "startPlaceholder", "endPlaceholder", "default-value", "pleStatus", "range", "hasTime", "hideSecond", "onConfirm", "onMaskClose", "onChange"])) : vue.createCommentVNode("v-if", true)
]);
}
const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$a], ["__scopeId", "data-v-9802168a"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue"]]);
const _sfc_main$K = {
name: "UniDrawer",
components: {},
emits: ["change"],
props: {
/**
* 显示模式只在初始化生效
*/
mode: {
type: String,
default: ""
},
/**
* 蒙层显示状态
*/
mask: {
type: Boolean,
default: true
},
/**
* 遮罩是否可点击关闭
*/
maskClick: {
type: Boolean,
default: true
},
/**
* 抽屉宽度
*/
width: {
type: Number,
default: 220
}
},
data() {
return {
visibleSync: false,
showDrawer: false,
rightMode: false,
watchTimer: null,
drawerWidth: 220
};
},
created() {
this.drawerWidth = this.width;
this.rightMode = this.mode === "right";
},
methods: {
clear() {
},
close(type) {
if (type === "mask" && !this.maskClick || !this.visibleSync)
return;
this._change("showDrawer", "visibleSync", false);
},
open() {
if (this.visibleSync)
return;
this._change("visibleSync", "showDrawer", true);
},
_change(param1, param2, status) {
this[param1] = status;
if (this.watchTimer) {
clearTimeout(this.watchTimer);
}
this.watchTimer = setTimeout(() => {
this[param2] = status;
this.$emit("change", status);
}, status ? 50 : 300);
}
}
};
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
return $data.visibleSync ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 0,
class: vue.normalizeClass([{ "uni-drawer--visible": $data.showDrawer }, "uni-drawer"]),
onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop", "prevent"]))
},
[
vue.createElementVNode(
"view",
{
class: vue.normalizeClass(["uni-drawer__mask", { "uni-drawer__mask--visible": $data.showDrawer && $props.mask }]),
onClick: _cache[0] || (_cache[0] = ($event) => $options.close("mask"))
},
null,
2
/* CLASS */
),
vue.createElementVNode(
"view",
{
class: vue.normalizeClass(["uni-drawer__content", { "uni-drawer--right": $data.rightMode, "uni-drawer--left": !$data.rightMode, "uni-drawer__content--visible": $data.showDrawer }]),
style: vue.normalizeStyle({ width: $data.drawerWidth + "px" })
},
[
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
],
6
/* CLASS, STYLE */
)
],
34
/* CLASS, NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true);
}
const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$9], ["__scopeId", "data-v-f7c32d22"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue"]]);
const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$9], ["__scopeId", "data-v-9802168a"], ["__file", "D:/projects/cxc-szcx-uniapp/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue"]]);
function taskListApi(config) {
return https({
url: "/act/task/list",
@ -6591,47 +6482,58 @@ This will fail in production.`);
};
const getLocation = () => {
const store = useStore();
uni.getLocation({
type: "wgs84",
success: function(position) {
uni.request({
url: "http://api.tianditu.gov.cn/geocoder",
method: "GET",
data: {
postStr: JSON.stringify({
lon: position.longitude,
lat: position.latitude,
ver: 1
}),
type: "geocode",
tk: "30fe0f0c1b2320e112bde797f3ddaff4"
},
success: function(res) {
let data = res.data;
if (data.status == 0) {
const obj = data.result.addressComponent;
let info = obj.city ? obj.city : obj.province;
uni.setStorageSync("position", info);
store.setPosition(info);
getWeather(position.latitude, position.longitude);
} else {
formatAppLog("log", "at utils/index.js:224", data.message);
if (!store.positionSwitch) {
uni.setStorageSync("position", "濮阳市");
store.setPosition("濮阳市");
getWeather();
} else {
toast("定位刷新中");
uni.getLocation({
type: "wgs84",
success: function(position) {
uni.request({
url: "http://api.tianditu.gov.cn/geocoder",
method: "GET",
data: {
postStr: JSON.stringify({
lon: position.longitude,
lat: position.latitude,
ver: 1
}),
type: "geocode",
tk: "30fe0f0c1b2320e112bde797f3ddaff4"
},
success: function(res) {
let data = res.data;
if (data.status == 0) {
const obj = data.result.addressComponent;
let info = obj.city ? obj.city : obj.province;
uni.setStorageSync("position", info);
store.setPosition(info);
getWeather(position.latitude, position.longitude);
} else {
formatAppLog("log", "at utils/index.js:223", data.message);
}
},
fail: function(err) {
toast("获取定位失败");
}
},
fail: function(err) {
toast("获取定位失败");
formatAppLog("log", "at utils/index.js:229", "地址解析失败" + err);
}
});
}
});
});
}
});
}
};
const getWeather = (lat, lon) => {
useStore();
const store = useStore();
let params = {};
params.lat = lat;
params.lon = lon;
weatherRequest(params);
if (!store.positionSwitch) {
params.q = "濮阳市";
weatherRequest(params);
} else {
params.lat = lat;
params.lon = lon;
weatherRequest(params);
}
};
const weatherRequest = (params) => {
const store = useStore();
@ -6650,7 +6552,6 @@ This will fail in production.`);
},
fail: function(err) {
toast("天气获取失败");
formatAppLog("log", "at utils/index.js:270", "天气获取失败" + err);
}
});
};
@ -6668,7 +6569,7 @@ This will fail in production.`);
});
},
fail: function(err) {
formatAppLog("error", "at utils/index.js:289", "文件下载失败", err);
formatAppLog("error", "at utils/index.js:282", "文件下载失败", err);
}
});
};
@ -6707,31 +6608,19 @@ This will fail in production.`);
const changeTab = (i2) => {
current.value = i2;
pageNo = 1;
loading2 = false;
list.value = [];
getlist();
};
const changeZhidu = (i2) => {
current_zhidu.value = i2;
pageNo = 1;
loading2 = false;
list.value = [];
zhidu();
};
const res = wx.getSystemInfoSync();
const statusHeight = res.statusBarHeight;
const cusnavbarheight = statusHeight + 44 + "px";
const showLeft = vue.ref(null);
const showDrawer = (e2) => {
showLeft.value.open();
};
const closeDrawer = (e2) => {
showLeft.value.close();
};
const totask = (url) => {
closeDrawer();
jump(url);
};
vue.ref(null);
const jump = (url, type, item, page) => {
if (type && type == 1 && page == "detail")
return;
@ -6747,19 +6636,10 @@ This will fail in production.`);
});
});
};
const menu = vue.ref([{
text: "我的任务",
path: "/pages/task/index?id=0"
}, {
text: "历史任务",
path: "/pages/task/index?id=2"
}]);
let pageNo = 1;
let pageSize = 15;
let loading2 = false;
let pageSize = 5;
const list = vue.ref([]);
const bpmlist = () => {
loading2 = true;
bpmlistApi({
pageNo,
pageSize
@ -6767,13 +6647,11 @@ This will fail in production.`);
if (res2.success) {
list.value = [...list.value, ...formatObj(res2.result.records, "fwbt", "fwtime", null)];
}
loading2 = false;
}).catch((err) => {
formatAppLog("log", "at pages/tab/index.vue:273", "err", err);
});
};
const gonggaolist = () => {
loading2 = true;
gonggaolistApi({
pageNo,
pageSize
@ -6781,7 +6659,6 @@ This will fail in production.`);
if (res2.success) {
list.value = [...list.value, ...formatObj(res2.result.records, "neirong", "fbdw", "createTime")];
}
loading2 = false;
}).catch((err) => {
formatAppLog("log", "at pages/tab/index.vue:288", "err", err);
});
@ -6797,7 +6674,6 @@ This will fail in production.`);
});
};
const fagui = () => {
loading2 = true;
faguiApi({
pageNo,
pageSize
@ -6805,13 +6681,11 @@ This will fail in production.`);
if (res2.success) {
list.value = [...list.value, ...formatObj(res2.result.records, "flfgmc", "ssbm", null)];
}
loading2 = false;
}).catch((err) => {
formatAppLog("log", "at pages/tab/index.vue:315", "err", err);
});
};
const zhidu = () => {
loading2 = true;
let getzhidu = current_zhidu.value == 0 ? zhiduApi : cjzhiduApi;
getzhidu({
pageNo,
@ -6821,7 +6695,6 @@ This will fail in production.`);
let str = current_zhidu.value == 0 ? "zbbm_dictText" : "sbbm";
list.value = [...list.value, ...formatObj(res2.result.records, "zdmc", str, null)];
}
loading2 = false;
}).catch((err) => {
formatAppLog("log", "at pages/tab/index.vue:332", "err", err);
});
@ -6835,8 +6708,6 @@ This will fail in production.`);
return arr;
};
onPullDownRefresh(() => {
pageNo = 1;
loading2 = false;
list.value = [];
cxcDaping();
zhiban();
@ -6854,16 +6725,8 @@ This will fail in production.`);
fagui();
}
};
onReachBottom(() => {
if (loading2)
return;
pageNo++;
getlist();
});
return (_ctx, _cache) => {
const _component_uni_datetime_picker = resolveEasycom(vue.resolveDynamicComponent("uni-datetime-picker"), __easycom_0$4);
const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$1);
const _component_uni_drawer = resolveEasycom(vue.resolveDynamicComponent("uni-drawer"), __easycom_2$1);
return vue.openBlock(), vue.createElementBlock(
"view",
{
@ -6872,15 +6735,7 @@ This will fail in production.`);
[
vue.createElementVNode("view", { class: "nav" }, [
vue.createElementVNode("view", { class: "nav_box f-row aic jcb" }, [
vue.createElementVNode("view", {
class: "menu",
onClick: _cache[0] || (_cache[0] = ($event) => showDrawer())
}, [
vue.createElementVNode("image", {
src: "/static/index/menu.png",
mode: ""
})
]),
vue.createCommentVNode(' <view class="menu" @click="showDrawer()">\r\n <image src="../../static/index/menu.png" mode=""></image>\r\n </view> '),
vue.createElementVNode("view", { class: "weather_calender f-row aic" }, [
vue.createElementVNode("view", { class: "position f-row aic" }, [
vue.createElementVNode("image", {
@ -6961,7 +6816,7 @@ This will fail in production.`);
vue.createTextVNode(" 值班信息 "),
vue.createElementVNode("view", {
class: "more",
onClick: _cache[1] || (_cache[1] = ($event) => jump(`/pages/zhiban/index`))
onClick: _cache[0] || (_cache[0] = ($event) => jump(`/pages/zhiban/index`))
}, [
vue.createTextVNode(" 查看更多 "),
vue.createElementVNode("image", {
@ -7051,7 +6906,7 @@ This will fail in production.`);
"view",
{
class: vue.normalizeClass({ "active": current_zhidu.value == 0 }),
onClick: _cache[2] || (_cache[2] = ($event) => changeZhidu(0))
onClick: _cache[1] || (_cache[1] = ($event) => changeZhidu(0))
},
" 厂级制度 ",
2
@ -7061,7 +6916,7 @@ This will fail in production.`);
"view",
{
class: vue.normalizeClass({ "active": current_zhidu.value == 1 }),
onClick: _cache[3] || (_cache[3] = ($event) => changeZhidu(1))
onClick: _cache[2] || (_cache[2] = ($event) => changeZhidu(1))
},
" 上级制度 ",
2
@ -7072,7 +6927,7 @@ This will fail in production.`);
vue.createElementVNode("view", {
style: { "padding-top": "24rpx" },
class: "more",
onClick: _cache[4] || (_cache[4] = ($event) => jump(`/pages/document/index?id=${current.value}`, current.value))
onClick: _cache[3] || (_cache[3] = ($event) => jump(`/pages/document/index?id=${current.value}`, current.value))
}, [
vue.createTextVNode(" 查看更多 "),
vue.createElementVNode("image", {
@ -7130,51 +6985,7 @@ This will fail in production.`);
])
])
]),
vue.createVNode(
_component_uni_drawer,
{
ref_key: "showLeft",
ref: showLeft,
mode: "left",
width: 156
},
{
default: vue.withCtx(() => [
vue.createElementVNode("view", { class: "menu_list" }, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(menu.value, (item, i2) => {
return vue.openBlock(), vue.createElementBlock("view", {
class: "f-row aic jcb",
key: i2,
onClick: ($event) => totask(item.path)
}, [
vue.createElementVNode(
"text",
null,
vue.toDisplayString(item.text),
1
/* TEXT */
),
vue.createVNode(_component_uni_icons, {
type: "right",
size: "20",
color: "#333333"
})
], 8, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
vue.createCommentVNode(' <uni-drawer ref="showLeft" mode="left" :width="156">\r\n <view class="menu_list">\r\n <view class="f-row aic jcb" v-for="item,i in menu" :key="i" @click="totask(item.path)">\r\n <text>{{item.text}}</text>\r\n <uni-icons type="right" size="20" color="#333333"></uni-icons>\r\n </view>\r\n </view>\r\n </uni-drawer> ')
],
2
/* CLASS */
@ -7582,25 +7393,10 @@ This will fail in production.`);
}
};
const PagesTabProduct = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-6ccf0546"], ["__file", "D:/projects/cxc-szcx-uniapp/pages/tab/product.vue"]]);
const { registerUTSInterface, initUTSProxyClass, initUTSProxyFunction, initUTSPackageName, initUTSIndexClassName, initUTSClassName } = uni;
const name = "wuwxStepCounter";
const moduleName = "计步器兼容Android和iOS";
const moduleType = "";
const errMsg = ``;
const is_uni_modules = true;
const pkg = /* @__PURE__ */ initUTSPackageName(name, is_uni_modules);
const cls = /* @__PURE__ */ initUTSIndexClassName(name, is_uni_modules);
const startStepCountingUpdates = /* @__PURE__ */ initUTSProxyFunction(false, { moduleName, moduleType, errMsg, main: true, package: pkg, class: cls, name: "startStepCountingUpdatesByJs", params: [{ "name": "options", "type": "UTSSDKModulesWuwxStepCounterStartStepCountingUpdatesOptionsJSONObject" }], return: "" });
const _sfc_main$E = {
__name: "my",
setup(__props) {
const store = useStore();
const step = vue.ref(0);
startStepCountingUpdates({
handler: (numberOfSteps, timestamp, error) => {
step.value = numberOfSteps;
}
});
const currentVersion = vue.ref(plus.runtime.version);
const arr = vue.ref([
// {
@ -7655,21 +7451,6 @@ This will fail in production.`);
}
});
};
onShow(() => {
taskList();
});
const todoNum = vue.ref(0);
const taskList = () => {
taskListApi({
pageNo: 1,
pageSize: 4,
_t: (/* @__PURE__ */ new Date()).getTime()
}).then((res) => {
if (res.success) {
todoNum.value = res.result.total;
}
});
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"view",
@ -7721,34 +7502,21 @@ This will fail in production.`);
]),
vue.createElementVNode("view", { class: "f-col aic" }, [
vue.createElementVNode("view", { class: "msg f-row aic jca" }, [
vue.createElementVNode("view", {
class: "box f-col aic",
onClick: _cache[2] || (_cache[2] = ($event) => jump("/pages/task/todotask"))
}, [
vue.createElementVNode(
"view",
{ class: "num" },
vue.toDisplayString(todoNum.value),
1
/* TEXT */
),
vue.createElementVNode("text", null, "个人办公")
]),
vue.createCommentVNode(` <view class="box f-col aic" @click="jump('/pages/task/todotask')">\r
<view class="num">\r
{{todoNum}}\r
</view>\r
<text>个人办公</text>\r
</view> `),
vue.createElementVNode("view", { class: "box f-col aic" }, [
vue.createElementVNode(
"view",
{ class: "num" },
vue.toDisplayString(step.value),
1
/* TEXT */
),
vue.createElementVNode("view", { class: "num" }, vue.toDisplayString(0)),
vue.createElementVNode("text", null, "步数")
]),
vue.createElementVNode("view", {
class: "box f-col aic",
onClick: _cache[3] || (_cache[3] = ($event) => jump("/pages/useredit/addressbook"))
onClick: _cache[2] || (_cache[2] = ($event) => jump("/pages/useredit/addressbook"))
}, [
vue.createElementVNode("view", { class: "num" }, " 34 "),
vue.createElementVNode("view", { class: "num" }, " 0 "),
vue.createElementVNode("text", null, "通讯录")
])
])
@ -7783,7 +7551,7 @@ This will fail in production.`);
"view",
{
class: "switch",
onClick: _cache[4] || (_cache[4] = ($event) => messageSwitch.value = !messageSwitch.value)
onClick: _cache[3] || (_cache[3] = ($event) => messageSwitch.value = !messageSwitch.value)
},
[
vue.withDirectives(vue.createElementVNode(
@ -8535,8 +8303,8 @@ This will fail in production.`);
};
},
// 驼峰转中横线
toLine(name2) {
return name2.replace(/([A-Z])/g, "-$1").toLowerCase();
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
};
@ -13087,12 +12855,12 @@ ${i3}
}
return uploadFiles(chooseAll(opts), opts);
}
const get_file_ext = (name2) => {
const last_len = name2.lastIndexOf(".");
const len = name2.length;
const get_file_ext = (name) => {
const last_len = name.lastIndexOf(".");
const len = name.length;
return {
name: name2.substring(0, last_len),
ext: name2.substring(last_len + 1, len)
name: name.substring(0, last_len),
ext: name.substring(last_len + 1, len)
};
};
const get_extname = (fileExtname) => {
@ -14068,12 +13836,12 @@ ${i3}
* 获取文件名和后缀
* @param {Object} name
*/
getFileExt(name2) {
const last_len = name2.lastIndexOf(".");
const len = name2.length;
getFileExt(name) {
const last_len = name.lastIndexOf(".");
const len = name.length;
return {
name: name2.substring(0, last_len),
ext: name2.substring(last_len + 1, len)
name: name.substring(0, last_len),
ext: name.substring(last_len + 1, len)
};
},
/**
@ -14127,10 +13895,10 @@ ${i3}
/**
* 获取父元素实例
*/
getForm(name2 = "uniForms") {
getForm(name = "uniForms") {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name2) {
while (parentName !== name) {
parent = parent.$parent;
if (!parent)
return false;
@ -19105,17 +18873,22 @@ ${i3}
__name: "App",
setup(__props) {
onLaunch(() => {
formatAppLog("log", "at App.vue:26", "---", todoNum.value);
uni.setTabBarBadge({
index: "1",
text: todoNum.value
// 角标内容
});
uni.onTabBarMidButtonTap(() => {
beforeJump("/pages/task/index", () => {
uni.navigateTo({
url: "/pages/task/index?id=0"
});
uni.navigateTo({
url: "/pages/task/todotask"
});
});
useUpdateApp().checkAppUpdate();
getLocation();
});
onShow(() => {
taskList();
cxcJurisdictionApi({
id: "1827997127165677570"
}).then((res) => {
@ -19126,6 +18899,18 @@ ${i3}
}
});
});
const todoNum = vue.ref(0);
const taskList = () => {
taskListApi({
pageNo: 1,
pageSize: 4,
_t: (/* @__PURE__ */ new Date()).getTime()
}).then((res) => {
if (res.success) {
todoNum.value = res.result.total;
}
});
};
return () => {
};
}
@ -19160,10 +18945,10 @@ ${i3}
if (res.success) {
info.value = res.result.records[0];
imageValue.value = info.value.path.split(",").map((path) => {
const name2 = path.split("/").pop();
const extname = name2.split(".").pop();
const name = path.split("/").pop();
const extname = name.split(".").pop();
return {
name: name2,
name,
extname,
url: imgUrl(path)
};

View File

@ -181,13 +181,6 @@
"selectedIconPath": "/static/tab/user2.png"
}
],
"midButton": {
"width": "65px",
"height": "75px",
"text": "",
"iconPath": "static/tab/todo.png",
"iconWidth": "50px"
},
"selectedIndex": 0,
"shown": true
}

View File

@ -1245,76 +1245,6 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uni-drawer[data-v-f7c32d22] {
display: block;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
z-index: 999;
}
.uni-drawer__content[data-v-f7c32d22] {
display: block;
position: absolute;
top: 0;
width: 220px;
bottom: 0;
background-color: #ffffff;
transition: transform 0.3s ease;
}
.uni-drawer--left[data-v-f7c32d22] {
left: 0;
transform: translateX(-100%);
}
.uni-drawer--right[data-v-f7c32d22] {
right: 0;
transform: translateX(100%);
}
.uni-drawer__content--visible[data-v-f7c32d22] {
transform: translateX(0px);
}
.uni-drawer__mask[data-v-f7c32d22] {
display: block;
opacity: 0;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.4);
transition: opacity 0.3s;
}
.uni-drawer__mask--visible[data-v-f7c32d22] {
display: block;
opacity: 1;
}
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.nav[data-v-420daeb5] {
width: calc(100% - 1.875rem);
padding: 0 0.9375rem;
@ -1361,19 +1291,6 @@
[data-v-ae0729d5] .uni-drawer {
margin-top: var(--ae0729d5-cusnavbarheight);
}
.menu_list[data-v-ae0729d5] {
padding: 0 0.9375rem;
font-size: 0.875rem;
color: #333333;
}
.menu_list uni-view[data-v-ae0729d5] {
height: 3.4375rem;
border-bottom: 1px solid #EFEFEF;
}
.menu_list uni-image[data-v-ae0729d5] {
width: 0.40625rem;
height: 0.71875rem;
}
.nav[data-v-ae0729d5] {
width: calc(100% - 1.875rem);
padding: 0 0.9375rem;
@ -1393,10 +1310,6 @@
bottom: 0.8125rem;
width: calc(100% - 1.875rem);
}
.menu uni-image[data-v-ae0729d5] {
width: 1.125rem;
height: 1.4375rem;
}
.weather_calender uni-image[data-v-ae0729d5] {
width: 1.125rem;
height: 1.125rem;

View File

@ -190,63 +190,58 @@ export const getTime = () => {
*/
export const getLocation = () => {
const store = useStore()
// if (!store.positionSwitch) {
// uni.setStorageSync('position', '濮阳市')
// store.setPosition('濮阳市')
// getWeather()
// } else {
// toast('定位刷新中')
uni.getLocation({
type: 'wgs84',
success: function(position) {
uni.request({
url: 'http://api.tianditu.gov.cn/geocoder',
method: 'GET',
data: {
postStr: JSON.stringify({
lon: position.longitude,
lat: position.latitude,
ver: 1
}),
type: 'geocode',
tk: '30fe0f0c1b2320e112bde797f3ddaff4'
},
success: function(res) {
let data = res.data;
if (data.status == 0) {
const obj = data.result.addressComponent
let info = obj.city ? obj.city : obj.province
uni.setStorageSync('position', info)
store.setPosition(info)
// toast('定位刷新成功');
getWeather(position.latitude, position.longitude)
} else {
console.log(data.message);
if (!store.positionSwitch) {
uni.setStorageSync('position', '濮阳市')
store.setPosition('濮阳市')
getWeather()
} else {
toast('定位刷新中')
uni.getLocation({
type: 'wgs84',
success: function(position) {
uni.request({
url: 'http://api.tianditu.gov.cn/geocoder',
method: 'GET',
data: {
postStr: JSON.stringify({
lon: position.longitude,
lat: position.latitude,
ver: 1
}),
type: 'geocode',
tk: '30fe0f0c1b2320e112bde797f3ddaff4'
},
success: function(res) {
let data = res.data;
if (data.status == 0) {
const obj = data.result.addressComponent
let info = obj.city ? obj.city : obj.province
uni.setStorageSync('position', info)
store.setPosition(info)
getWeather(position.latitude, position.longitude)
} else {
console.log(data.message);
}
},
fail: function(err) {
toast('获取定位失败');
}
},
fail: function(err) {
toast('获取定位失败');
console.log('地址解析失败' + err);
}
});
}
});
// }
});
}
});
}
}
export const getWeather = (lat, lon) => {
const store = useStore()
// toast('天气刷新中')
let params = {}
// if (!store.positionSwitch) {
// params.q = '濮阳市'
// weatherRequest(params)
// console.log('shfjshdkfj @@@@jdfg');
// } else {
params.lat = lat
params.lon = lon
weatherRequest(params)
// }
if (!store.positionSwitch) {
params.q = '濮阳市'
weatherRequest(params)
} else {
params.lat = lat
params.lon = lon
weatherRequest(params)
}
}
const weatherRequest = (params) => {
const store = useStore()
@ -263,11 +258,9 @@ const weatherRequest = (params) => {
uni.setStorageSync('wenduIcon', res.data.weather[0].icon)
store.setWeather(Math.round(res.data.main.temp - 273.15), res.data
.weather[0].icon)
// toast('天气刷新成功');
},
fail: function(err) {
toast('天气获取失败');
console.log('天气获取失败' + err);
}
});
}