123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789 |
- <template>
- <view class="center">
- <heard></heard>
- <view class="test_title">节水测试</view>
- <view class="form">
- <view class="form-item">
- <view class="form-left">姓名:</view>
- <text class="tip">*</text>
- <view class="form-right"><input type="text" @input="onAction" class="list-input" v-model="name" placeholder="请填写姓名" /></view>
- </view>
- <view class="form-item">
- <view class="form-left">地址:</view>
- <text class="tip"></text>
- <view class="form-right"><input @input="onAction" class="list-input" v-model="address" type="text" placeholder="请填写详细地址" /></view>
- </view>
- <view class="form-item">
- <view class="form-left">联系电话:</view>
- <text class="tip">*</text>
- <view class="form-right"><input @input="onAction" class="list-input" v-model="telephone" type="number" placeholder="请填写联系电话" /></view>
- </view>
- <view class="form-item">
- <view class="form-left">生产线类型:</view>
- <text class="tip">*</text>
- <view class="form-right">
- <picker :value="index" :range="array" @change="bindPickerType" class="list-input1">
- <text style="color: #C7C9D1;">{{ line_type || '请选择生产类型' }}</text>
- </picker>
- </view>
- </view>
- <view class="form-item">
- <view class="form-left">生产线数量:</view>
- <text class="tip">*</text>
- <view class="form-right"><input class="list-input" type="number" @input="onAction" v-model="line_num" placeholder="请填写生产线数量" /></view>
- </view>
- <view class="form-item">
- <view class="form-left">目前用水量(吨/小时):</view>
- <text class="tip">*</text>
- <view class="form-right"><input class="list-input" type="number" @input="onAction" v-model="water_using" placeholder="请填写目前用水量" /></view>
- </view>
- <view class="form-item">
- <view class="form-left">工作时长(小时):</view>
- <text class="tip"></text>
- <view class="form-right"><input @input="onAction" class="list-input" v-model="day_work_times" type="number" placeholder="请填写每日工作时长,默认为12小时" /></view>
- </view>
- <view class="form-item">
- <view class="form-left">年工作日数:</view>
- <text class="tip"></text>
- <view class="form-right"><input @input="onAction" class="list-input" v-model="year_work_day" type="number" placeholder="请填写每年工作日数,默认为330天" /></view>
- </view>
- <view class="form-item">
- <view class="form-left">废水处理成本(元/吨):</view>
- <text class="tip">*</text>
- <view class="form-right"><input @input="onAction" class="list-input" v-model="deal_cost" type="number" placeholder="请填写废水处理成本" /></view>
- </view>
- </view>
- <view class="btn" @click="next" v-if="isShow"><view class="btn-left">提交</view></view>
- <view class="result" v-if="num1">
- <view class="result-title">测试结果</view>
- <view class="border"></view>
- <view class="result-box">
- <view class="swiper-item">
- <view class="effect">
- <view class="information">
- <view class="benefits">
- <view class="unit">
- <view class="unitBox">
- <view class="unitText">{{ num1 }}</view>
- <view class="unitText">~</view>
- <view class="unitText">{{ num2 }}</view>
- </view>
- </view>
- <view class="info">改造后用水量(吨/小时)</view>
- </view>
- <view class="benefits">
- <view class="unit">
- <view class="unitBox">
- <view class="unitText">{{ num3 }}</view>
- <view class="unitText">~</view>
- <view class="unitText">{{ num4 }}</view>
- </view>
- </view>
- <view class="info">年经济效益(万元)</view>
- </view>
- </view>
- <view class="refresh" @click="refresh">重新测试</view>
- </view>
- </view>
- </view>
- </view>
- <aboutUs class="aboutUs"></aboutUs>
- </view>
- </template>
- <script>
- import { loadIndexs, cateList, aboutlist, storylist, caseslist, productlist, articlelist, addForm, companies, machine, machineId } from '@/api/index.js';
- import aboutUs from '@/components/public/introduce.vue';
- import { changeTaber } from '@/utils/tarberChange.js';
- import heard from '@/components/public/heard.vue';
- export default {
- components: {
- aboutUs,
- heard
- },
- data() {
- return {
- isShow: true,
- type: '',
- name: '',
- address: '',
- telephone: '',
- line_type: '',
- line_num: '',
- water_using: '',
- day_work_times: 12,
- year_work_day: 330,
- deal_cost: '',
- array: ['塑料镀铬线', '五金镀铬线'],
- index: '',
- num4: '',
- num3: '',
- num2: '',
- num1: ''
- };
- },
- onLoad() {
- this.loadData();
- },
- onShow() {
- this.$nextTick(function() {
- changeTaber(4);
- });
- },
- methods: {
- alertChange(tab) {
- if (tab.show) {
- this.onAction(false);
- } else {
- this.onAction();
- }
- },
-
- zoomendChange(type) {
- this.zoomActive = type.target.getZoom();
- },
-
- showData(item) {
- this.autoPlay = false;
- console.log('点击小点点------', item.name);
- this.itemData = item;
- this.machineid = item.id;
- this.$refs.popupItem.open();
-
- machine({}, this.machineid)
- .then(e => {
-
- console.log('======>', e);
- this.machineDataModal = e.data;
- this.machineDataModal.machine_name = item.name;
- })
- .catch(e => {
- console.log(e);
- });
- },
- toPre() {
- console.log('this.checkid', this.checkid);
- if (this.checkid > 0) {
- this.checkid--;
- console.log('this.checkid', this.checkid);
- } else {
- this.checkid = 2;
- }
- },
- toNext() {
- console.log('this.checkid', this.checkid);
- if (this.checkid < 2) {
- this.checkid++;
- console.log('this.checkid', this.checkid);
- } else {
- this.checkid = 0;
- }
- },
-
- machine() {
- machine({}, 0)
- .then(e => {
-
- this.machineData = e.data;
-
- })
- .catch(e => {
- console.log(e);
- });
- },
-
- getMapList() {
-
- companies()
- .then(e => {
- this.companyList = e.data.map(e => {
-
- e.show = false;
-
-
-
- e.textType = {
- width: -((e.name.length / 2) * 10),
- height: 30
- };
- e.style = {
- background: 'none',
- color: '#333333',
- fontSize: '10px',
- border: 'none'
- };
- return e;
- });
-
- this.mapLoding = true;
-
-
-
-
-
-
- })
- .catch(e => {
- console.log(e);
- });
- },
-
- init({ BMap, map }) {
- this.map = map;
-
- var point = new BMap.Point(121.434817, 28.653649);
- map.centerAndZoom(point, this.zoomActive);
-
-
-
- },
-
- onAction(start = true) {
- console.log('触发点击');
- this.autoPlay = false;
- clearTimeout(this.outPlay);
- if (start) {
- this.outPlay = setTimeout(e => {
- this.autoPlay = true;
- }, this.setOutTime);
- }
- },
-
- async loadData() {
- loadIndexs({}).then(({ data }) => {
- this.carouselList = data.loopProduct.map(item => 'http://tianli.liuniu946.com/' + item.coverimage);
- this.list3 = data;
- });
- },
-
- next() {
- this.isShow = false
- if (this.name == '') {
- uni.showToast({
- title: '请输入您的姓名',
- icon: 'none',
- duration: 2000
- });
- this.$api.msg('');
- return;
- }
- if (this.address == '') {
- uni.showToast({
- title: '请填写详细地址',
- icon: 'none',
- duration: 2000
- });
-
- return;
- }
- if (this.telephone == '') {
- uni.showToast({
- title: '请填写联系电话',
- icon: 'none',
- duration: 2000
- });
-
- return;
- }
- const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
- if (!reg.test(this.telephone)) {
- uni.showToast({
- title: '请填写正确的手机格式',
- icon: 'none',
- duration: 2000
- });
-
- return;
- }
- if (this.line_type == '') {
- uni.showToast({
- title: '请填写生产线类型',
- icon: 'none',
- duration: 2000
- });
-
- return;
- }
- if (this.line_num == '') {
- uni.showToast({
- title: '请填写生产线数量',
- icon: 'none',
- duration: 2000
- });
-
- return;
- }
- if (this.water_using == '') {
- uni.showToast({
- title: '请填写目前用水量',
- icon: 'none',
- duration: 2000
- });
-
- return;
- }
- if (this.deal_cost == '') {
- uni.showToast({
- title: '请填写废水处理成本',
- icon: 'none',
- duration: 2000
- });
-
- return;
- }
- uni.showLoading({
- title: '计算中',
- mask: true
- });
- addForm({
- name: this.name,
- address: this.address,
- telephone: this.telephone,
- line_type: this.line_type,
- line_num: this.line_num,
- water_using: this.water_using,
- day_work_times: 12,
- year_work_day: 330,
- deal_cost: this.deal_cost
- })
- .then(e => {
- uni.hideLoading();
- console.log('请求成功');
- (this.isShow = false),
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 0
- });
-
-
-
-
- this.num1 = parseFloat(this.water_using * 0.3).toFixed(2);
- this.num2 = parseFloat(this.water_using * 0.7).toFixed(2);
- console.log('this.num1', this.num1);
-
- this.savaWater1 = this.water_using - this.num1;
- this.savaWater2 = this.water_using - this.num2;
- console.log('this.savaWater1', this.savaWater1);
- console.log('this.day_work_times', this.day_work_times);
- console.log('this.deal_cost', this.deal_cost);
-
- this.num3 = parseFloat((this.savaWater1 * 3960 * this.deal_cost) / 10000).toFixed(2);
- this.num4 = parseFloat((this.savaWater2 * 3960 * this.deal_cost) / 10000).toFixed(2);
-
-
-
-
-
-
-
-
- })
- .catch(e => {
- uni.hideLoading();
- });
- },
- change(item) {
-
- let id = item;
- this.checkid = id;
- this.onAction();
- },
-
- refresh() {
- this.isShow = true;
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 0
- });
- },
-
- bindPickerType: function(e) {
- console.log(this.array[e.target.value]);
- this.line_type = this.array[e.target.value];
- this.index = e.target.value + 1;
- this.onAction();
- },
- change1(item) {
- console.log(123, item);
- let id = item;
- this.checkid1 = id;
- },
-
- listChange(e) {
-
- this.onAction();
- this.checkid = e.detail.current;
- if (this.checkid == 1 && !this.showMap) {
- this.showMap = true;
- }
-
-
-
-
- },
- listChange1(id) {
- this.current = id;
- },
-
- toNavList() {
- this.$refs.popup.open();
- },
- goBack(type) {
- this.$refs[type][0].close();
- },
- cancel() {
- this.$refs.popup.close();
- },
- cancelAll(type) {
- this.$refs.popup.close();
- this.$refs[type][0].close();
- },
- handlePop(index, type) {
- this.type = type;
- console.log('this.type', this.type);
- this.$refs[type][0].open();
- cateList({}, this.type).then(({ data }) => {
- this.productList = data;
- });
- },
-
- navInfo(id, name, item) {
- let obj = this;
- obj.category_id = id;
- obj.current = id;
- console.log('进入', obj.type);
- if (obj.type == 'about') {
- aboutlist({
-
- category_id: obj.category_id,
- page: obj.page,
- limit: obj.limit
- }).then(({ data }) => {
- obj.list1 = data.list.map(item => ({
- title: item.title,
- id: item.id
- }));
- });
- }
- if (obj.type == 'story') {
- storylist({
-
- category_id: obj.category_id,
- page: obj.page,
- limit: obj.limit
- }).then(({ data }) => {
- obj.list1 = data.list.map(item => ({
- title: item.title,
- id: item.id
- }));
- });
- }
- if (obj.type == 'cases') {
- caseslist({
-
- category_id: obj.category_id,
- page: obj.page,
- limit: obj.limit
- }).then(({ data }) => {
- obj.list1 = data.list.map(item => ({
- title: item.title,
- id: item.id
- }));
- });
- }
- if (obj.type == 'product') {
- productlist({
-
- category_id: obj.category_id,
- page: obj.page,
- limit: obj.limit
- }).then(({ data }) => {
- obj.list1 = data.list.map(item => ({
- title: item.title,
- id: item.id
- }));
- });
- }
-
- if (obj.type == 'article') {
- articlelist({
-
- category_id: obj.category_id,
- page: obj.page,
- limit: obj.limit
- }).then(({ data }) => {
- obj.list1 = data.list.map(item => ({
- title: item.title,
- id: item.id
- }));
- });
- }
- },
-
- toproList(id) {
- console.log('当前子列表id:', id);
-
- if (this.type == 'about') {
- uni.navigateTo({
- url: '/pages/about/about?id=' + id
- });
- }
- if (this.type == 'story') {
- uni.navigateTo({
- url: '/pages/story/story?id=' + id
- });
- }
- if (this.type == 'cases') {
- uni.navigateTo({
- url: '/pages/cases/cases?id=' + id
- });
- }
- if (this.type == 'product') {
- uni.navigateTo({
- url: '/pages/product/product?id=' + id
- });
- }
- if (this.type == 'article') {
- uni.navigateTo({
- url: '/pages/article/article?id=' + id
- });
- }
- }
- }
- };
- </script>
- <style lang="scss">
- .center {
- height: auto;
- background: #ffffff;
- min-height: 100%;
- }
- .img {
- margin: 17rpx 0 17rpx 41rpx;
- width: 208rpx;
- height: 52rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .test_title {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 60rpx;
- font-size: 22rpx;
- font-family: Adobe Heiti Std;
- font-weight: normal;
- color: #ffffff;
- background-color: #0165b5;
- }
- .test_table {
- font-size: 22rpx;
- font-family: Adobe Heiti Std;
- font-weight: normal;
- color: #000000;
- display: flex;
- justify-content: space-between;
- padding: 10rpx 30rpx;
- input {
- width: 340rpx;
- height: 40rpx;
- background: #ffffff;
- border: 1px solid #b9b7b7;
- border-radius: 2rpx;
- font-size: 16rpx;
- padding-left: 16rpx;
- }
- }
- .form {
- background: #ffffff;
- width: 100%;
- padding: 14rpx;
- // margin-top: 54rpx;
- .form-item {
- width: 98%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 10rpx;
- .form-left {
- color: #212121;
- font-size: 22rpx;
- width: 250rpx;
- flex-shrink: 0;
- }
- .tip {
- margin-left: 0rpx;
- color: #ff0000;
- width: 34rpx;
- height: 34rpx;
- }
- .form-right {
- margin-left: 2rpx;
- line-height: 48rpx;
- height: 48rpx;
- padding-left: 12rpx;
- width: 100%;
- background-color: #ffffff;
- border: 2rpx solid #bdbdbd;
- border-radius: 6rpx;
- .list-input {
- font-size: 18rpx;
- height: 100%;
- .input-placeholder {
- color: #c7c9d1;
- font-size: 18rpx;
- }
- }
- .list-input1 {
- color: #757575;
- font-size: 18rpx;
- }
- }
- }
- }
- .btn {
- margin-top: 34rpx;
- width: 100%;
- height: 70rpx;
- display: flex;
- justify-content: center;
- color: #ffffff;
- font-size: 26rpx;
- margin-bottom: 30rpx;
- .btn-left {
- width: 88%;
- height: 70rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- // margin-left: 44rpx;
- background-color: #3874cb;
- border-radius: 8rpx;
- }
- }
- .result {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .result-title {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 180rpx;
- height: 35rpx;
- font-size: 26rpx;
- font-family: Adobe Heiti Std;
- font-weight: normal;
- color: #000000;
- position: relative;
- top: 15rpx;
- z-index: 99;
- background-color: #ffffff;
- }
- .border {
- width: 100%;
- height: 1rpx;
- border: 1rpx solid #eee9e9;
- }
- .result-box {
- width: 100%;
- background: #0165b5;
- margin-top: 24rpx;
- .effect {
- .title {
- margin-top: 10rpx;
- font-size: 32rpx;
- color: #ffffff;
- text-align: center;
- }
- .information {
- width: 100%;
- // height: 200rpx;
- display: flex;
- justify-content: space-between;
- .benefits {
- padding: 24rpx 0;
- width: 50%;
- display: flex;
- flex-direction: column;
- align-items: center;
- .unit {
- width: 200rpx;
- height: 200rpx;
- background-color: #3874cb;
- border-radius: 50%;
- color: #ffffff;
- font-size: 64rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- .unitText {
- text-align: center;
- font-size: 34rpx;
- }
- }
- .info {
- color: #ffffff;
- font-size: 24rpx;
- margin-top: 32rpx;
- }
- }
- }
- .refresh {
- width: 270rpx;
- height: 60rpx;
- background-color: #3874cb;
- margin: 44rpx auto;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #ffffff;
- font-size: 24rpx;
- }
- }
- }
- }
- .tanchang {
- height: 132rpx;
- }
- </style>
|