mkm
/
yanzhiAPP
Template
2
0
Fork 0

溯源详情等界面优化

This commit is contained in:
jia 2023-11-30 17:51:39 +08:00
parent 4e2d0696ed
commit 64e71a2f25
24 changed files with 1664 additions and 646 deletions

View File

@ -1,6 +1,4 @@
<script>
export default {
onLaunch: function() {
@ -20,6 +18,7 @@
<style lang="scss">
@import "uview-plus/index.scss";
.card {
position: relative;
width: 693.93rpx;
@ -49,6 +48,7 @@
display: flex;
align-items: center;
}
.u-action-sheet__item-wrap {
overflow: auto;
max-height: 30vh !important;

View File

@ -1,16 +1,19 @@
// import base from "@/config/baseUrl";
// let baseUrl = 'https://ceshi.excellentkk.cn/api';
// import store from '../store';
import { config } from '@/config/app';
import {
config
} from '@/config/app';
import store from "@/store/index.js"
let header = {};
function uploads(src, type) {
if (store.state.userInfo) {
header.token = store.state.userInfo.token;
header.TOKEN = store.state.userInfo.token
}
function uploads(src, type) {
return new Promise((resolve, reject) => {
// //console.log('上传', type === 'img' ? '图片' : '视频', '', src)
let a = uni.uploadFile({
@ -36,11 +39,16 @@ function uploads(src, type) {
}
function Uploads(src, type) {
if (store.state.userInfo) {
header.TOKEN = store.state.userInfo.token
}
return new Promise((resolve, reject) => {
// //console.log('上传', type === 'img' ? '图片' : '视频', '', src)
let a = uni.uploadFile({
url:config.HTTP_REQUEST_URL + '/api/upload/image',
url: config.HTTP_REQUEST_URL + 'api/upload/image',
filePath: src,
name: 'file',
header: header,

View File

@ -0,0 +1,167 @@
<template>
<uni-popup ref="showshare" type="bottom" @change="change">
<view class="uni-share">
<!-- <text class="uni-share-title">分享到</text> -->
<view class="uni-share-content">
<view v-for="(item, index) in bottomData" :key="index" @tap="shareItems(item.name)"
class="uni-share-content-box">
<view class="uni-share-content-image">
<image :src="item.icon" class="content-image" mode="widthFix" />
</view>
<text class="uni-share-content-text">{{ item.text }}</text>
</view>
</view>
<text class="uni-share-btn" @click="cancel('share')">取消</text>
</view>
</uni-popup>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
props: {
shareurl: {
type: String,
default: ''
},
},
components: {
uniPopup
},
data() {
return {
bottomData: [{
text: '刷新',
icon: '/static/img/miniProgram.png',
name: 'miniProgram'
}
],
}
},
mounted() {
// console.log(this.shareurl)
},
methods: {
open() {
this.$nextTick(() => {
this.$refs['showshare'].open()
})
},
change(e) {
// console.log(':' + e.show)
},
shareItems(provider) {
switch (provider) {
case 'miniProgram':
uni.reLaunch({
url: this.shareurl,
success: (res) => {
this.$nextTick(() => {
this.$refs['showshare'].close
})
},
fail: (res) => {
console.log(res)
}
})
break;
case 'more':
plus.share.sendWithSystem({
type: "web",
title: shareOPtions.shareTitle,
thumbs: [shareOPtions.shareImage],
href: shareOPtions.shareHref,
content: shareOPtions.summary,
})
default:
break;
}
},
cancel() {
this.$refs['showshare'].close()
}
}
}
</script>
<style>
/* 底部分享 */
.uni-share {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
background-color: #fff;
}
.uni-share-title {
line-height: 60rpx;
font-size: 24rpx;
padding: 15rpx 0;
text-align: center;
}
.uni-share-content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
padding: 15px;
}
.uni-share-content-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
align-items: center;
width: 200rpx;
}
.uni-share-content-image {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
align-items: center;
width: 60rpx;
height: 60rpx;
overflow: hidden;
border-radius: 10rpx;
}
.content-image {
width: 60rpx;
height: 60rpx;
}
.uni-share-content-text {
font-size: 26rpx;
color: #333;
padding-top: 5px;
padding-bottom: 10px;
}
.uni-share-btn {
height: 90rpx;
line-height: 90rpx;
font-size: 14px;
border-top-color: #f5f5f5;
border-top-width: 1px;
border-top-style: solid;
text-align: center;
color: #666;
}
</style>

View File

@ -0,0 +1,59 @@
### 使用方法
本组件依赖于 uni-popup 组件 跟 uni-transtion 组件
``` js
<own-share ref="share" :shareSummary="shareSummary" :shareImage="image"
:shareTitle="title" :shareHref="href"
:miniProgram="miniProgram" :webUrl="webUrl"
@shareSuccess="shareSuccess" @shareFail="shareFail"></own-share>
//先引入组件
import ownShare from '@/components/own-share/own-share.vue'
//然后使用
components:{
ownShare
}
//打开分享
this.$nextTick(()=>{
this.$refs.share.open()
})
//关闭分享
this.$nextTick(()=>{
this.$refs.share.close()
})
//当然也可以用 easycom 直接使用
```
参数 <sub>分享只用于app</sub>
| 参数 | 类型 | 是否必填 |
| ---- | ---- | ---- |
| shareSummary | String | 只分享内容时必填 |
| shareImage | String | 只分享图片时必填 |
| shareTitle | String | 否 |
| shareHref | String | 分享图文时必填 |
| miniProgram | Object | 分享小程序必填 |
miniProgram参数 [详情](https://uniapp.dcloud.io/api/plugins/share?id=share)
| 参数 | 类型 | 是否必填 |
| ---- | ---- | ---- |
| id | String | 微信小程序原始id |
| path | String | 点击链接进入的页面 |
| type | Number | 微信小程序版本类型 |
| webUrl | String | 兼容低版本的网页链接 |
| 事件 | 说明 |
| ---- | ---- |
| shareSuccess | 成功回调 |
| shareFail | 失败回调 |
----
**图标链接写在组件里面请自行修改(请看示例项目)**
[了解更多uniapp分享,请参考官网](https://uniapp.dcloud.io/api/plugins/share)

View File

@ -19,12 +19,13 @@
<!-- <view class="">
种植品牌: {{info.kind}}
</view> -->
</view><view class="card-li">
</view>
<!-- <view class="card-li">
<view class="">
种植品种: {{info.kind}}
</view>
</view>
</view> -->
<view class="card-li">
<view class="">
土地面积: {{info.total_area}}
@ -33,22 +34,20 @@
种子品牌: {{}}
</view> -->
</view>
<view class="card-li">
<view class="">
<!-- 预计产量: {{}} -->
</view>
<!-- <view class="">
已出售: ???
</view> -->
</view>
<view class="card-li">
<view class="">
播种时间: {{info.create_time}}
土地负责人: {{info.master_name}}
</view>
</view>
<view class="card-li">
<view class="">
土地负责人: {{info.master_phone}}
</view>
</view>
</view>
</template>

134
components/return/index.vue Normal file
View File

@ -0,0 +1,134 @@
<template>
<view class="">
<view class="contentgb">
<view class="iconfont icon-xiangzuo" v-if="isshow" style="margin-top: 10rpx;color: #fff;margin-left: 30rpx;"
@click="close">
</view>
<view class="name" v-if="isshow">
{{name}}
</view>
<view class="return_top">
<view class="z-bootm-img1" @click="close()">
<image src="@/static/img/fb1.png" mode="aspectFit"></image>
</view>
<view class="z-bootm-l"></view>
<view class="z-bootm-img2" @click="returnbom()">
<image src="@/static/img/fb2.png" mode="aspectFit"></image>
</view>
</view>
</view>
<own-share ref="share" :shareurl="url"></own-share><strong></strong>
</view>
</template>
<script>
import ownShare from '@/components/own-share/own-share.vue'
export default {
name: 'retuntop',
comments: {
ownShare
},
props: {
isshow: {
type: Boolean
},
name: {
type: String
},
url: {
type: String
}
},
data() {
return {
}
},
mounted() {
},
methods: {
close() {
this.$nextTick(() => {
this.$refs.share.open()
})
},
returnbom() {
uni.sendHostEvent('closeApp', (ret) => {
//
//console.log('' + JSON.stringify(ret));
});
}
}
}
</script>
<style lang="scss" scoped>
.contentgb {
display: flex;
justify-content: space-between;
.name {
font-size: 35rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #FFFFFF;
margin-top: 5rpx;
}
.return_top {
width: 166rpx;
height: 56rpx;
background: rgba(255, 255, 255, 0.6);
border-radius: 44rpx 44rpx;
margin-right: 30rpx;
position: relative;
.z-bootm-img1 {
width: 41rpx;
height: 13rpx;
position: absolute;
top: 5rpx;
left: 25rpx;
image {
width: 100%;
height: 100%;
}
}
.z-bootm-l {
width: 1px;
height: 32rpx;
background: rgba(0, 0, 0, 0.2);
margin: auto 0;
position: absolute;
top: 10rpx;
left: 85rpx;
}
.z-bootm-img2 {
width: 38rpx;
height: 34rpx;
margin-top: -15rpx;
margin-left: -15rpx;
position: absolute;
right: 25rpx;
top: 25rpx;
image {
width: 100%;
height: 100%;
}
}
}
}
</style>

View File

@ -0,0 +1,264 @@
<template>
<view v-if="showPopup" class="uni-popup" @touchmove.stop.prevent="clear">
<uni-transition :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans" @click="onTap" />
<uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
<view class="uni-popup__wrapper-box" @click.stop="clear">
<slot />
</view>
</uni-transition>
</view>
</template>
<script>
import uniTransition from '../uni-transition/uni-transition.vue'
/**
* PopUp 弹出层
* @description 弹出层组件为了解决遮罩弹层的问题
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} type = [top|center|bottom] 弹出方式
* @value top 顶部弹出
* @value center 中间弹出
* @value bottom 底部弹出
* @property {Boolean} animation = [ture|false] 是否开启动画
* @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
* @event {Function} change 打开关闭弹窗触发e={show: false}
*/
export default {
name: 'UniPopup',
components: {
uniTransition
},
props: {
//
animation: {
type: Boolean,
default: true
},
// top: bottomcenter
type: {
type: String,
default: 'center'
},
// maskClick
maskClick: {
type: Boolean,
default: true
}
},
data() {
return {
duration: 300,
ani: [],
showPopup: false,
showTrans: false,
maskClass: {
'position': 'fixed',
'bottom': 0,
'top': 0,
'left': 0,
'right': 0,
'backgroundColor': 'rgba(0, 0, 0, 0.4)'
},
transClass: {
'position': 'fixed',
'left': 0,
'right': 0,
}
}
},
watch: {
type: {
handler: function(newVal) {
switch (this.type) {
case 'top':
this.ani = ['slide-top']
this.transClass = {
'position': 'fixed',
'left': 0,
'right': 0,
}
break
case 'bottom':
this.ani = ['slide-bottom']
this.transClass = {
'position': 'fixed',
'left': 0,
'right': 0,
'bottom': 0
}
break
case 'center':
this.ani = ['zoom-out', 'fade']
this.transClass = {
'position': 'fixed',
/* #ifndef APP-NVUE */
'display': 'flex',
'flexDirection': 'column',
/* #endif */
'bottom': 0,
'left': 0,
'right': 0,
'top': 0,
'justifyContent': 'center',
'alignItems': 'center'
}
break
}
},
immediate: true
}
},
created() {
if (this.animation) {
this.duration = 300
} else {
this.duration = 0
}
},
methods: {
clear(e) {
// TODO nvue
e.stopPropagation()
},
open() {
this.showPopup = true
this.$nextTick(() => {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.showTrans = true
}, 50);
})
this.$emit('change', {
show: true
})
},
close(type) {
this.showTrans = false
this.$nextTick(() => {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.$emit('change', {
show: false
})
this.showPopup = false
}, 300)
})
},
onTap() {
if (!this.maskClick) return
this.close()
}
}
}
</script>
<style scoped>
.uni-popup {
position: fixed;
/* #ifdef H5 */
top: var(--window-top);
/* #endif */
/* #ifndef H5 */
top: 0;
/* #endif */
bottom: 0;
left: 0;
right: 0;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.uni-popup__mask {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.4);
opacity: 0;
}
.mask-ani {
transition-property: opacity;
transition-duration: 0.2s;
}
.uni-top-mask {
opacity: 1;
}
.uni-bottom-mask {
opacity: 1;
}
.uni-center-mask {
opacity: 1;
}
.uni-popup__wrapper {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: absolute;
}
.top {
top: 0;
left: 0;
right: 0;
transform: translateY(-500px);
}
.bottom {
bottom: 0;
left: 0;
right: 0;
transform: translateY(500px);
}
.center {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
bottom: 0;
left: 0;
right: 0;
top: 0;
justify-content: center;
align-items: center;
transform: scale(1.2);
opacity: 0;
}
.uni-popup__wrapper-box {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: relative;
}
.content-ani {
/* transition: transform 0.3s;
*/
transition-property: transform, opacity;
transition-duration: 0.2s;
}
.uni-top-content {
transform: translateY(0);
}
.uni-bottom-content {
transform: translateY(0);
}
.uni-center-content {
transform: scale(1);
opacity: 1;
}
</style>

View File

@ -0,0 +1,278 @@
<template>
<view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject" @click="change">
<slot></slot>
</view>
</template>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation');
// #endif
/**
* Transition 过渡动画
* @description 简单过渡动画组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
* @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
* @value fade 渐隐渐出过渡
* @value slide-top 由上至下过渡
* @value slide-right 由右至左过渡
* @value slide-bottom 由下至上过渡
* @value slide-left 由左至右过渡
* @value zoom-in 由小到大过渡
* @value zoom-out 由大到小过渡
* @property {Number} duration 过渡动画持续时间
* @property {Object} styles 组件样式 css 样式注意带-连接符的属性需要使用小驼峰写法如`backgroundColor:red`
*/
export default {
name: 'uniTransition',
props: {
show: {
type: Boolean,
default: false
},
modeClass: {
type: Array,
default () {
return []
}
},
duration: {
type: Number,
default: 300
},
styles: {
type: Object,
default () {
return {}
}
}
},
data() {
return {
isShow: false,
transform: '',
ani: {
in: '',
active: ''
}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open()
} else {
this.close()
}
},
immediate: true
}
},
computed: {
stylesObject() {
let styles = {
...this.styles,
'transition-duration': this.duration / 1000 + 's'
}
let transfrom = ''
for (let i in styles) {
let line = this.toLine(i)
transfrom += line + ':' + styles[i] + ';'
}
return transfrom
}
},
created() {
// this.timer = null
// this.nextTick = (time = 50) => new Promise(resolve => {
// clearTimeout(this.timer)
// this.timer = setTimeout(resolve, time)
// return this.timer
// });
},
methods: {
change() {
this.$emit('click', {
detail: this.isShow
})
},
open() {
this.isShow = true
this.transform = ''
this.ani.in = ''
for (let i in this.getTranfrom(false)) {
if (i === 'opacity') {
this.ani.in = 'fade-in'
} else {
this.transform += `${this.getTranfrom(false)[i]} `
}
}
this.$nextTick(() => {
setTimeout(() => {
this._animation(true)
}, 50)
})
},
close(type) {
this._animation(false)
},
_animation(type) {
let styles = this.getTranfrom(type)
// #ifdef APP-NVUE
if (!this.$refs['ani']) return
animation.transition(this.$refs['ani'].ref, {
styles,
duration: this.duration, //ms
timingFunction: 'ease',
needLayout: false,
delay: 0 //ms
}, () => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
})
// #endif
// #ifndef APP-NVUE
this.transform = ''
for (let i in styles) {
if (i === 'opacity') {
this.ani.in = `fade-${type?'out':'in'}`
} else {
this.transform += `${styles[i]} `
}
}
clearTimeout(this.timer)
this.timer = setTimeout(() => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
}, this.duration)
// #endif
},
getTranfrom(type) {
let styles = {
transform: ''
}
this.modeClass.forEach((mode) => {
switch (mode) {
case 'fade':
styles.opacity = type ? 1 : 0
break;
case 'slide-top':
styles.transform += `translateY(${type?'0':'-100%'}) `
break;
case 'slide-right':
styles.transform += `translateX(${type?'0':'100%'}) `
break;
case 'slide-bottom':
styles.transform += `translateY(${type?'0':'100%'}) `
break;
case 'slide-left':
styles.transform += `translateX(${type?'0':'-100%'}) `
break;
case 'zoom-in':
styles.transform += `scale(${type?1:0.8}) `
break;
case 'zoom-out':
styles.transform += `scale(${type?1:1.2}) `
break;
}
})
return styles
},
_modeClassArr(type) {
let mode = this.modeClass
if (typeof(mode) !== "string") {
let modestr = ''
mode.forEach((item) => {
modestr += (item + '-' + type + ',')
})
return modestr.substr(0, modestr.length - 1)
} else {
return mode + '-' + type
}
},
// getEl(el) {
// console.log(el || el.ref || null);
// return el || el.ref || null
// },
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
}
</script>
<style scoped>
.uni-transition {
transition-timing-function: ease;
transition-duration: 0.3s;
transition-property: transform, opacity;
}
.fade-in {
opacity: 0;
}
.fade-active {
opacity: 1;
}
.slide-top-in {
/* transition-property: transform, opacity; */
transform: translateY(-100%);
}
.slide-top-active {
transform: translateY(0);
/* opacity: 1; */
}
.slide-right-in {
transform: translateX(100%);
}
.slide-right-active {
transform: translateX(0);
}
.slide-bottom-in {
transform: translateY(100%);
}
.slide-bottom-active {
transform: translateY(0);
}
.slide-left-in {
transform: translateX(-100%);
}
.slide-left-active {
transform: translateX(0);
opacity: 1;
}
.zoom-in-in {
transform: scale(0.8);
}
.zoom-out-active {
transform: scale(1);
}
.zoom-out-in {
transform: scale(1.2);
}
</style>

View File

@ -10,7 +10,12 @@
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"screenOrientation":["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"],
"screenOrientation": [
"portrait-primary",
"portrait-secondary",
"landscape-primary",
"landscape-secondary"
],
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
@ -24,7 +29,10 @@
"LivePusher": {},
"VideoPlayer": {},
"Barcode": {},
"Camera" : {}
"Camera": {},
"UniMP": {
"description": "uni小程序"
}
},
/* */
"distribute": {
@ -59,17 +67,20 @@
"ad": {},
"geolocation": {
"amap": {
"name" : "amapC2GgorTaY",
"name": "amap_18982406440DFVLElaO",
"__platform__": ["android"],
"appkey_ios" : "b0c21bc6b220aa882bad8ffb6bce8829",
"appkey_android" : "b0c21bc6b220aa882bad8ffb6bce8829"
"appkey_ios": "4e6789b864fe1a2d76b98e38158f20f2",
"appkey_android": "a230d943475443eb29fc3871fbef8605"
},
"system": {
"__platform__": ["ios", "android"]
}
},
"maps": {
"amap": {
"name" : "amapC2GgorTaY",
"appkey_ios" : "b0c21bc6b220aa882bad8ffb6bce8829",
"appkey_android" : "b0c21bc6b220aa882bad8ffb6bce8829"
"name": "4e6789b864fe1a2d76b98e38158f20f2",
"appkey_ios": "a230d943475443eb29fc3871fbef8605",
"appkey_android": "a230d943475443eb29fc3871fbef8605"
}
}
}

View File

@ -1,6 +1,4 @@
<template>
<view class="box">
<view class="content">
<view class="tit">
@ -18,7 +16,7 @@
</view>
<view class="yanzm" v-if="num==0">
<u-input type="password" shape='circle'
<u-input type="number" shape='circle'
customStyle="background:#F5F5F5;height:80rpx;padding-left:40rpx;border:none;width:120rpx;"
placeholder="请输入验证码" border="surround" v-model="formData.code"></u-input>
@ -27,9 +25,14 @@
</view>
<view class="" v-if="num==1">
<u-input type="password" shape='circle'
<u-input :password="!pwdShow" shape='circle'
customStyle="background:#F5F5F5;height:80rpx;;padding-left:40rpx;border:none"
placeholder="请输入密码" border="surround" v-model="formData.password"></u-input>
placeholder="请输入密码" border="surround" v-model="formData.password" >
<template #suffix>
<u-icon :name="pwdShow?'eye-off':'eye-fill'"
@click="pwdShow=!pwdShow" size="25"></u-icon>
</template>
</u-input>
</view>
<view class="resgiter" @click="resgiter">
用户注册
@ -49,7 +52,6 @@
<script setup>
import {
login,
xinregister
} from '@/api/api.js';
import {
@ -65,6 +67,7 @@
const num = ref(0)
const isshow = ref(false)
const pwdShow = ref(false)
const tips = ref('获取验证码')
const countDown = ref(60); //
const formData = reactive({
@ -89,26 +92,37 @@
// ios
const checkUserAgent = () => {
uni.getSystemInfo({
success: function(res) {
success: (res) => {
const platform = res.platform.toLowerCase();
if (platform === 'android') {
formData.terminal = 6
} else if (platform === 'ios') {
formData.terminal = 5
} else {
formData.terminal = 6
console.log('当前设备不是 Android 也不是 iOS');
if (platform === 'ios') {
formData.terminal = 5;
} else if (platform === 'android') {
formData.terminal = 6;
} else if (platform === 'windows') {
formData.terminal = 4;
} else if (platform === 'mac') {
formData.terminal = 4;
}
}
});
})
// #ifdef H5
formData.terminal = 3;
// #endif
// #ifdef MP-WEIXIN
formData.terminal = 1;
// #endif
};
//
const startCountDown = () => {
const timer = setInterval(() => {
countDown.value -= 1; //
isshow.value = true
if (countDown.value === 0) {
clearInterval(timer); //
isshow.value = false
@ -119,13 +133,15 @@
};
const getCode = () => {
let data = {
phone: formData.account,
scene: 101
}
xinregister(data).then((res) => {
console.log(res)
if (res.code == 1) {
isshow.value = true
uni.$u.toast('验证码已发送');
//
startCountDown()
@ -152,11 +168,13 @@
// console.log(formData)
if (!formData.code && formData.scene == 2) return uni.$u.toast('验证码不能为空');
login(formData).then((res) => {
if (res.code == 1) {
uni.showLoading({
title: '登陆中'
})
store.commit('saveUserInfo', res.data)
setTimeout(() => {
uni.hideLoading()
uni.reLaunch({
url: '/pages/index/massif'
})
@ -187,8 +205,6 @@
onMounted(() => {
checkUserAgent()
formData.scene = 2
})

View File

@ -19,14 +19,26 @@
<view class="" style="margin: 30rpx 0;">
<u-input type="password" shape='circle'
<u-input :password="!pwdShow" shape='circle'
customStyle="background:#F5F5F5;height:80rpx;;padding-left:40rpx;border:none"
placeholder="请输入密码" border="surround" v-model="formData.password"></u-input>
placeholder="请输入密码" border="surround" v-model="formData.password">
<template #suffix>
<u-icon :name="pwdShow?'eye-off':'eye-fill'" size="25"
@click="pwdShow=!pwdShow"></u-icon>
</template>
</u-input>
</view>
<view class="">
<u-input type="password" shape='circle'
<u-input :password="!pwdShow1" shape='circle'
customStyle="background:#F5F5F5;height:80rpx;;padding-left:40rpx;border:none"
placeholder="请确认密码" border="surround" v-model="formData.password_confirm"></u-input>
placeholder="请确认密码" border="surround" v-model="formData.password_confirm">
<template #suffix>
<u-icon :name="pwdShow1?'eye-off':'eye-fill'" size="25"
@click="pwdShow1=!pwdShow1"></u-icon>
</template>
</u-input>
</view>
<view class="sub-btn">
@ -49,7 +61,8 @@
reactive,
ref
} from 'vue';
const pwdShow = ref(false)
const pwdShow1 = ref(false)
const formData = reactive({
mobile: "",
password: "",
@ -64,8 +77,6 @@
const submitFn = () => {
if (!formData.mobile) return uni.$u.toast('账号不能为空');
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(formData.mobile)) return uni.$u.toast(
'请输入正确的手机号码'
@ -75,14 +86,14 @@
if (formData.password !== formData.password_confirm) return uni.$u.toast('密码与确认密码不一致');
logregister(formData).then((res) => {
if (res.code == 1) {
uni.$u.toast('注册成功');
uni.navigateBack({
delta: 1
})
uni.$u.toast('注册成功');
}
})

View File

@ -17,25 +17,22 @@
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="所在城市" prop="city_code" borderBottom required @click="isshow2">
<up-input placeholder="请选择所在城市" border="surround" v-model="city_name"
readonly style="pointer-events: none;"></up-input>
<up-input placeholder="请选择所在城市" border="surround" v-model="city_name" readonly
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="所在区县" prop="county_code" borderBottom required @click="isshow3">
<up-input placeholder="请选择所在区县" border="surround" v-model="county_name"
readonly style="pointer-events: none;"></up-input>
<up-input placeholder="请选择所在区县" border="surround" v-model="county_name" readonly
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="所在镇街" prop="town_code" borderBottom required @click="isshow4">
<up-input placeholder="请选择所在镇街" border="surround" v-model="town_name"
readonly style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="所在乡村" prop="village_code" borderBottom required @click="isshow5">
<up-input placeholder="请选择所在乡村" border="surround" v-model="village_name"
readonly style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="所在小队" prop="group_code" borderBottom required @click="isshow6">
<up-input placeholder="请选择所在小队" border="surround" v-model="group_name"
readonly style="pointer-events: none;"></up-input>
<u-form-item label="土地详细地址" prop="town_code" borderBottom required>
<u-input placeholder="请输入土地详细地址" border="surround" v-model="data.formData.address">
<template #suffix>
<u-icon name="map-fill" size="28" @click="location"></u-icon>
</template>
</u-input>
</u-form-item>
<u-form-item label="土地负责人" prop="master_name" borderBottom required>
<up-input placeholder="请输入土地负责人名称" border="surround" v-model="data.formData.master_name"></up-input>
</u-form-item>
@ -132,9 +129,8 @@
province_code: '',
city_code: '',
county_code: '',
town_code: '',
village_code: '',
group_code: '',
address: '',
master_name: '',
master_phone: '',
pic: ['https://img0.baidu.com/it/u=1717510975,3258230326&fm=253&fmt=auto?w=120&h=80',
@ -183,23 +179,11 @@
message: '请选择所在区县',
trigger: 'change'
}],
town_code: [{
address: [{
type: 'string',
required: true,
message: '请选择所在镇街',
trigger: 'change'
}],
village_code: [{
type: 'string',
required: true,
message: '请选择所在乡村',
trigger: 'change'
}],
group_code: [{
type: 'string',
required: true,
message: '请选择小队',
trigger: 'change'
message: '请输入土地详细地址',
trigger: ['blur', 'change']
}],
master_name: [{
type: 'string',
@ -230,21 +214,15 @@
const province_name = ref(null)
const city_name = ref(null)
const county_name = ref(null)
const town_name = ref(null)
const village_name = ref(null)
const group_name = ref(null)
const show = ref(false)
const show1 = ref(false)
const show2 = ref(false)
const show3 = ref(false)
const show4 = ref(false)
const show5 = ref(false)
const columns = reactive([])
const columns1 = reactive([])
const columns2 = reactive([])
const columns3 = reactive([])
const columns4 = reactive([])
const columns5 = reactive([])
const provincen = () => {
province().then((res) => {
columns.splice(0, columns.length, ...res.data.map((step, index) => {
@ -292,20 +270,6 @@
pic.splice(i, 1);
}
const townsn = (id) => {
towns({
county_code: id
}).then((res) => {
columns3.splice(0, columns.length, ...res.data.map((step, index) => {
return {
name: step.town_name,
id: step.town_code,
};
}));
});
}
//
const updateImgFn = async () => {
@ -315,7 +279,7 @@
sourceType: ['album', 'camera'],
success: (res) => {
Uploads(res.tempFilePaths[0], 'img').then(res => {
console.log(res)
// console.log(res)
if (res.code == 1) {
pic.push(res.data.url)
console.log(data.formData)
@ -340,32 +304,9 @@
// let res = await Uploads()
// data.formData.pic = res.data.image
}
const villagesn = (id) => {
villages({
town_code: id
}).then((res) => {
columns4.splice(0, columns.length, ...res.data.map((step, index) => {
return {
name: step.village_name,
id: step.village_code,
};
}));
});
}
const groupsn = () => {
groups().then((res) => {
columns5.splice(0, columns.length, ...res.data.map((step, index) => {
return {
name: step.group_name,
id: step.group_code,
};
}));
});
}
//
const isshow1 = () => {
@ -405,23 +346,36 @@
const leavaType3 = (e) => {
county_name.value = e.name
data.formData.county_code = e.id
townsn(e.id)
}
const leavaType4 = (e) => {
town_name.value = e.name
data.formData.town_code = e.id
villagesn(e.id)
}
const leavaType5 = (e) => {
village_name.value = e.name
data.formData.village_code = e.id
}
const leavaType6 = (e) => {
const location = () => {
group_name.value = e.name
data.formData.group_code = e.id.toString()
//#ifdef APP
uni.showLoading({
title: '获取位置中'
})
uni.getLocation({
type: 'gcj02',
geocode: true,
isHighAccuracy: true,
success: async (res) => {
// console.log(res)
data.formData.address = res.address.city + res.address.district + res.address.street + res
.address.streetNum + res.address.poiName
uni.hideLoading();
},
fail: (err) => {
uni.hideLoading();
console.log(err)
}
});
//#endif
//#ifdef H5
uni.$u.toast('暂不支持')
//#endif
}
@ -438,14 +392,14 @@
try {
const valid = await form1.value.validate();
if (valid) {
console.log('表单通过');
data.formData.pic = JSON.stringify(pic)
if (data.formData.pic.length == 0) {
console.log('表单通过', data.formData);
if (pic.length == 0) {
uni.$u.toast('请上传图片')
return
}
data.formData.pic = JSON.stringify(pic)
//
addland(data.formData).then((res) => {
@ -471,7 +425,7 @@
onLoad((options) => {
provincen()
groupsn()
})
</script>

View File

@ -6,28 +6,28 @@
<u-form-item label="灌溉方式" prop="type" borderBottom required @click="showggai">
<!-- <uni-data-select v-model="formData.type" :disabled="mode=='detail'"
:localdata="range"></uni-data-select> -->
<up-input placeholder="请选择灌溉方式" readonly border="surround"
v-model="formDatatype" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择灌溉方式" readonly border="surround" v-model="formDatatype"
style="pointer-events: none;"></up-input>
</u-form-item>
<view class="" v-if="mode=='add'">
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<view class="" v-else>
<u-form-item label="开始日期" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="end_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<u-form-item label="灌溉面积" prop="area" borderBottom required>
@ -49,7 +49,8 @@
<view class="">
<u-icon name="close" size="15" style="margin-left:120.85rpx;" @click="delimg(i)"
v-show="mode=='add'"></u-icon>
<u-image :src="item" width="150.85rpx" height="150.85rpx" @click="perviewFn(item)" ></u-image>
<u-image :src="item" width="150.85rpx" height="150.85rpx"
@click="perviewFn(item)"></u-image>
</view>
</view>
</view>

View File

@ -54,7 +54,7 @@
</view>
</view>
<u-form-item label="备注" prop="remark" borderBottom required>
<u-form-item label="备注" borderBottom >
<u--textarea v-model="data.formData.remark" :disabled="mode=='detail'"
placeholder="请输入内容"></u--textarea>
</u-form-item>
@ -142,13 +142,8 @@
required: true,
message: '请填写开始日期',
trigger: ['blur', 'change']
}],
remark: [{
type: 'string',
required: true,
message: '请填写备注信息',
trigger: ['blur', 'change']
}]
}
})
@ -198,12 +193,12 @@
if (valid) {
data.formData.land_id = task_id.value
console.log('表单通过');
data.formData.pic = JSON.stringify(pic)
if (data.formData.pic.length == 0) {
if (pic.length == 0) {
uni.$u.toast('请上传图片')
return
}
data.formData.pic = JSON.stringify(pic)
//
addplant(data.formData).then((res) => {

View File

@ -1,14 +1,24 @@
<template>
<view class="">
<view class="content">
<view class="serch">
<!-- #ifdef APP-PLUS -->
<view class="head-img" style="top: var(--status-bar-height);">
<Myindex url='/pages/index/index'/>
</view>
<!-- #endif -->
<u-search bgColor="white" :show-action="false" margin='0 30rpx' placeholder="搜索你的土地信息"
v-model="fomData.keyword" shape="round"></u-search>
<u-button class="custom-style" @click="search">搜索</u-button>
</view>
<view class="card" v-for="(item,index) in datalist" :key="index" @click="navgo(item)">
<view class="card" v-for="(item,index) in datalist" :key="index" @click="navgo(item)"
style="margin-top: calc(var(--status-bar-height) + 40rpx);">
<view class="tit card-li">
<view class="">
{{item.title}}
@ -35,7 +45,7 @@
</view>
<view class="card-li tit">
<view class="" style="font-weight: normal;">
地址: {{item.town_name}}{{item.village_name}}{{item.group_name}}
地址: {{item.address}}
</view>
</view>
@ -71,10 +81,20 @@
reactive,
onMounted
} from "vue"
import Myindex from '@/components/return/index.vue';
import store from "@/store/index.js"
import {
landlist
} from '@/api/api.js'
onLoad(()=>{
// console.log(store.state.userInfo)
if (!store.state.userInfo) {
uni.redirectTo({
url:'/pages/Login/login'
})
}
})
onShow(() => {
list()
})
@ -111,14 +131,16 @@
});
}
const list = () => {
datalist.splice(0)
fomData.page_no = 1
getlist()
}
const getlist = () => {
landlist(fomData).then((res) => {
if (res.code == 1) {
datalist.splice(0, datalist.length, ...res.data);
fomData.page_no += fomData.page_no
datalist.push(...res.data)
fomData.page_no = fomData.page_no + 1
}
@ -145,6 +167,7 @@
<style lang="scss">
page {
background-color: #EAF2EF;
}
.content {
@ -154,6 +177,17 @@
padding-top: 180rpx;
.head-img {
position: absolute;
display: flex;
top: 0;
right: 10rpx;
margin-top: 20rpx;
}
.land {
width: 100rpx;
height: 100rpx;
@ -176,9 +210,10 @@
position: fixed;
display: flex;
top: 0;
padding-top: 70rpx;
padding-top: calc(70rpx + var(--status-bar-height) + 20rpx);
padding-right: 20rpx;
.custom-style {
color: #606266;
width: 140rpx;

View File

@ -1,9 +1,20 @@
<template>
<view class="" style="position: relative;">
<view class="top">
<view class="" style="height:var(--status-bar-height) ;">
</view>
<!-- #ifdef APP-PLUS -->
<view class="nav-con" style="justify-content: space-between;">
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="nav-con" style="justify-content: flex-end;">
<!-- #endif -->
<view class="nav">
<view class="">
<u-icon name="scan" @click="scanFn" color="white" :size="30"></u-icon>
</view>
@ -14,13 +25,19 @@
<u-icon name="plus-circle" color="white" @click="navto('/pages/addLand/addLand')"
:size="28"></u-icon>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<view class="" style="margin-top: -5rpx;">
<Myindex url='/pages/index/massif' />
</view>
<!-- #endif -->
</view>
</view>
<view class="">
<view class="" style="height:var(--status-bar-height) ;">
</view>
<view class="nav">
<view class="nav-con" style="margin-bottom: 80rpx;">
</view>
</view>
@ -48,6 +65,7 @@
</view>
<view class="card" v-else>
<view class="">
<view class="">
暂无信息
@ -57,8 +75,10 @@
</view>
</view>
<view class="add-thing" @click="showPicker1=true" v-if="columns2.length>0">
<view class="add-thing" @click="showPicker1=true" v-if="columns2[0]&&columns2[0].length>0">
记农事
</view>
<!-- 苗情监测 -->
@ -114,7 +134,6 @@
</view>
</view>
<view class="coneng-detail" v-else>
<view class="">
<image src="@/static/img/zw.png" mode="aspectFit"></image>
<view class="">
@ -227,6 +246,7 @@
onLoad,
onShow
} from "@dcloudio/uni-app"
import Myindex from '@/components/return/index.vue';
import {
bindproduct,
lindexist,
@ -234,7 +254,7 @@
plantlist,
landproduct
} from '@/api/api.js'
import store from "@/store/index.js"
const showPicker = ref(false)
const showPicker1 = ref(false)
const showModal = ref(false)
@ -306,6 +326,15 @@
},
])
onLoad(() => {
// console.log(store.state.userInfo)
if (!store.state.userInfo) {
uni.redirectTo({
url: '/pages/Login/login'
})
}
})
const dataobj = reactive({})
const tdId = ref('')
const palntId = ref('')
@ -397,7 +426,9 @@
}).then((res) => {
if (res.code == 1) {
if (Object.keys(res.data).length > 0) {
getlist3(res.data.id)
Object.assign(dataobj, res.data);
if (res.data && res.data.monitor && res.data.monitor.soil_monitor_data) {
@ -420,7 +451,7 @@
environmentList[7].num = res.data.monitor.air_monitor_data.light_intensity
}
}
}
})
@ -433,7 +464,6 @@
page_size: 99995,
keyword: ''
}).then((res) => {
if (res.code == 1) {
if (res.data.length > 0) {
columns.splice(0, columns.length, ...res.data.map((step, index) => {
@ -443,8 +473,6 @@
};
}));
}
}
})
@ -482,6 +510,8 @@
}));
columns2.push(arr1)
}
})
@ -498,6 +528,7 @@
//
const biproduct = () => {
if (equipmentId.value) {
bindproduct({
land_id: dataobj.id,
product_id: equipmentId.value
@ -509,6 +540,10 @@
}
console.log(res)
})
} else {
uni.$u.toast('请选择产品编号');
}
}
const confirm2 = (e) => {
showPicker.value = false
@ -568,7 +603,6 @@
z-index: 999999;
width: 750rpx;
}
.coneng-detail {
@ -649,13 +683,18 @@
z-index: 9999 !important;
}
.nav {
height: 70rpx;
.nav-con {
display: flex;
justify-content: flex-end;
box-sizing: border-box;
align-items: center;
padding-right: 40rpx;
padding-top: 20rpx;
padding-bottom: 10rpx;
}
.nav {
display: flex;
padding-right: 20rpx;
padding-left: 10rpx;
}
.card {

View File

@ -1,5 +1,11 @@
<template>
<view class="head">
<!-- #ifdef APP-PLUS -->
<view class="head-return">
<Myindex url='/pages/index/personal' />
</view>
<!-- #endif -->
<view class="head-con">
<view class="avater">
<u--image @click="previewImageFn" :src="userinfo.avatar" width="130.28rpx" height="130.28rpx"
shape="circle"></u--image>
@ -20,6 +26,7 @@
请登录
</view>
</view>
</view>
<view class="content">
<view class="card" style="border-radius: 20rpx;">
<view class="card-li" v-for="(item,index) in cardLiList" :key="index" @click="navto(item.nav)">
@ -47,6 +54,7 @@
</template>
<script setup lang="ts">
import Myindex from '@/components/return/index.vue';
import {
reactive,
ref
@ -118,12 +126,19 @@
page {
background-color: $theme-bg-color;
}
.head {
height: 25vh;
background-color: $theme-main-color;
color: white;
padding-top: 30rpx;
position: relative;
.head-con {
display: flex;
align-items: center;
margin-top: 30rpx;
}
.head-li {
margin: 10rpx 0;
@ -132,6 +147,13 @@
.avater {
margin: 0 40rpx;
}
.head-return {
margin-top: 30rpx;
margin-left: calc(100% - 200rpx);
}
}
.content {

View File

@ -3,37 +3,52 @@
<view class="reset-password">
<u--form ref="formRef" :rules="rules" :model="formData">
<u-form-item label="原密码" labelWidth="140rpx" borderBottom prop="old_password">
<u--input v-model="formData.old_password" :password="!pwdShow.old_password" placeholder="请输入原密码"
maxlength="18">
<!-- #ifdef APP-PLUS -->
<template slot="suffix">
<uni-icons :type="pwdShow.old_password?'eye-filled':'eye-slash-filled'"
@click="pwdShow.old_password=!pwdShow.old_password" color="#999"></uni-icons>
<u-input placeholder="请输入原密码" border="surround" v-model="formData.old_password"
:password="!pwdShow.old_password">
<template #suffix>
<u-icon :name="pwdShow.old_password?'eye-off':'eye-fill'" size="25"
@click="pwdShow.old_password=!pwdShow.old_password"></u-icon>
</template>
<!-- #endif -->
</u--input>
</u-input>
</u-form-item>
<u-form-item label="新密码" labelWidth="140rpx" borderBottom prop="password">
<u--input v-model="formData.password" :password="!pwdShow.password" placeholder="请输入新密码"
maxlength="18">
<!-- #ifdef APP-PLUS -->
<template slot="suffix">
<u--icon :name="pwdShow.password?'eye-off':'eye-fill'"
@click="pwdShow.old_password=!pwdShow.old_password" color="#999"></u--icon>
<u-input border="surround" v-model="formData.password" :password="!pwdShow.password"
placeholder="请输入新密码">
<template #suffix>
<u-icon :name="pwdShow.password?'eye-off':'eye-fill'" size="25"
@click="pwdShow.password=!pwdShow.password"></u-icon>
</template>
<!-- #endif -->
</u--input>
</u-input>
</u-form-item>
<u-form-item label="确认密码" labelWidth="140rpx" borderBottom prop="password_confirm">
<u--input v-model="formData.password_confirm" :password="!pwdShow.password_confirm"
placeholder="请确认新密码" maxlength="18">
<!-- #ifdef APP-PLUS -->
<template slot="suffix">
<u--icon :name="pwdShow.password_confirm?'eye-off':'eye-fill'"
@click="pwdShow.old_password=!pwdShow.old_password" color="#999"></u--icon>
<u-input border="surround" v-model="formData.password_confirm" :password="!pwdShow.password_confirm"
placeholder="请确认新密码">
<template #suffix>
<u-icon :name="pwdShow.password_confirm?'eye-off':'eye-fill'" size="25"
@click="pwdShow.password_confirm=!pwdShow.password_confirm"></u-icon>
</template>
<!-- #endif -->
</u--input>
</u-input>
</u-form-item>
<u-button style="margin-top: 28rpx;background-color:#34D190;color: #fff;" @click="submit">提交</u-button>
</u--form>

BIN
static/img/fb1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

BIN
static/img/fb2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/img/miniProgram.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -25,6 +25,9 @@
"VideoPlayer": {},
"Barcode": {},
"Camera": {},
"UniMP": {
"description": "uni小程序"
},
"UniNView": {
"description": "UniNView原生渲染"
}
@ -77,19 +80,25 @@
"ad": {},
"geolocation": {
"amap": {
"name": "amapC2GgorTaY",
"name": "amap_18982406440DFVLElaO",
"__platform__": [
"android"
],
"appkey_ios": "b0c21bc6b220aa882bad8ffb6bce8829",
"appkey_android": "b0c21bc6b220aa882bad8ffb6bce8829"
"appkey_ios": "4e6789b864fe1a2d76b98e38158f20f2",
"appkey_android": "a230d943475443eb29fc3871fbef8605"
},
"system": {
"__platform__": [
"ios",
"android"
]
}
},
"maps": {
"amap": {
"name": "amapC2GgorTaY",
"appkey_ios": "b0c21bc6b220aa882bad8ffb6bce8829",
"appkey_android": "b0c21bc6b220aa882bad8ffb6bce8829"
"name": "4e6789b864fe1a2d76b98e38158f20f2",
"appkey_ios": "a230d943475443eb29fc3871fbef8605",
"appkey_android": "a230d943475443eb29fc3871fbef8605"
}
},
"audio": {
@ -167,5 +176,11 @@
"selected": 0
}
},
"screenOrientation": [
"portrait-primary",
"portrait-secondary",
"landscape-primary",
"landscape-secondary"
],
"launch_path": "__uniappview.html"
}

File diff suppressed because one or more lines are too long

View File

@ -10,14 +10,9 @@ function baseRequest(url, method, data, {
onReLogin = false
}) {
let Url = config.HTTP_REQUEST_URL,
header = config.HEADER;
if (store.state.userInfo) {
header.TOKEN = store.state.userInfo.token
}else{
uni.redirectTo({
url:'/pages/Login/login'
})
}
return new Promise((reslove, reject) => {