From 1fb1e9e3321102d23997551be7a5ad7d91b74015 Mon Sep 17 00:00:00 2001 From: MrShi <1878285526@qq.com> Date: 星期四, 17 七月 2025 15:28:25 +0800 Subject: [PATCH] 对接口,新建富文本页面 --- small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js | 103 +++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 86 insertions(+), 17 deletions(-) diff --git a/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js b/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js index 354c461..59313f9 100644 --- a/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js +++ b/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js @@ -108,6 +108,9 @@ uIcon: function () { return Promise.all(/*! import() | node-modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-icon/u-icon.vue */ 379)) }, + uCalendar: function () { + return Promise.all(/*! import() | node-modules/uview-ui/components/u-calendar/u-calendar */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-calendar/u-calendar")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-calendar/u-calendar.vue */ 542)) + }, } } catch (e) { if ( @@ -130,6 +133,14 @@ var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h + if (!_vm._isMounted) { + _vm.e0 = function ($event) { + _vm.show = true + } + _vm.e1 = function ($event) { + _vm.show = false + } + } } var recyclableRender = false var staticRenderFns = [] @@ -185,39 +196,39 @@ }, computed: _objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight', 'userInfo', 'token', 'openid'])), onShow: function onShow(options) { - this.type = 0; + this.typeViewId = 0; if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') { this.isLogin = true; } if (this.userInfo && this.userInfo.useIdentity == 1) { - this.type = 1; + this.typeViewId = 1; } }, data: function data() { - return (0, _defineProperty2.default)({ + return { + show: false, isLogin: false, - typeId: 1, - typeWorkId: 1, + typeId: 0, carId: 1, type: [{ name: '鐢ㄥ伐', - id: 1 + id: 0 }, { name: '杩愯揣', - id: 2 + id: 1 }, { name: '璁㈤', - id: 3 + id: 2 }], typeWork: [{ name: '閲囨憳宸�', - id: 1 + id: 0 }, { name: '鍒嗘嫞宸�', - id: 2 + id: 1 }, { name: '鍖呰宸�', - id: 3 + id: 2 }], car: [{ name: '涓夎疆杞�', @@ -226,29 +237,87 @@ name: '灏忚揣杞�', id: 2 }], - btn: __webpack_require__(/*! @/static/image/btn.png */ 169) - }, "type", 0); + btn: __webpack_require__(/*! @/static/image/btn.png */ 169), + typeViewId: 0, + form: { + startDate: '', + endDate: '', + latitude: '', + longitude: '', + address: '', + workType: 0, + days: '' + } + }; }, methods: { + confirmDate: function confirmDate(e) { + this.form.startDate = e[0]; + this.form.endDate = e[e.length - 1]; + this.form.days = e.length; + this.show = false; + }, + selectAddress: function selectAddress(type) { + var _this = this; + uni.chooseLocation({ + success: function success(res) { + if (type === 1) { + _this.form.latitude = res.latitude; + _this.form.longitude = res.longitude; + _this.form.address = res.address; + } + } + }); + // uni.getLocation({ + // type: 'gcj02', + // success: function (res) { + // console.log(res) + // } + // }); + }, clickType: function clickType(e) { this.typeId = e; }, clickTypeWork: function clickTypeWork(e) { - this.typeWorkId = e; + this.form.workType = e; }, clickCar: function clickCar(e) { this.carId = e; }, jump: function jump() { - console.log(this.userInfo, this.token, this.openid); if (!this.userInfo || !this.token) { uni.navigateTo({ url: '/pages/login/login' }); + return; } - if (this.typeId === 1) { + var form = this.form; + if (!form.startDate || !form.endDate) { + return uni.showToast({ + title: '璇烽�夋嫨鐢ㄥ伐鏃堕棿', + icon: 'none' + }); + } else if (!form.latitude || !form.longitude) { + return uni.showToast({ + title: '璇烽�夋嫨鐢ㄥ伐鍦扮偣', + icon: 'none' + }); + } + + // 閲囨憳宸� + if (this.form.workType === 0) { uni.navigateTo({ - url: '/pages/using-workers/using-workers' + url: "/pages/using-workers/using-workers?days=".concat(form.days, "&startDate=").concat(form.startDate, "&endDate=").concat(form.endDate, "&latitude=").concat(form.latitude, "&longitude=").concat(form.longitude, "&address=").concat(form.address, "&workType=").concat(form.workType) + }); + // 鍒嗘嫞宸� + } else if (this.form.workType === 1) { + uni.navigateTo({ + url: "/pages/sorting/sorting?days=".concat(form.days, "&startDate=").concat(form.startDate, "&endDate=").concat(form.endDate, "&latitude=").concat(form.latitude, "&longitude=").concat(form.longitude, "&address=").concat(form.address, "&workType=").concat(form.workType) + }); + // 鍖呰宸� + } else if (this.form.workType === 2) { + uni.navigateTo({ + url: "/pages/packaging-worker/packaging-worker?days=".concat(form.days, "&startDate=").concat(form.startDate, "&endDate=").concat(form.endDate, "&latitude=").concat(form.latitude, "&longitude=").concat(form.longitude, "&address=").concat(form.address, "&workType=").concat(form.workType) }); } }, -- Gitblit v1.9.3