Merge remote-tracking branch 'origin/master'

# Conflicts:
#	pages/detailNursing/detailNursing.vue
master
xy 3 years ago
commit d9676f077e

@ -0,0 +1,253 @@
<template>
<view @click="back" @longpress="isPop = true">
<swiper class="swiper-img" :current="currentImg" :duration="300" @change="changeSwiper">
<swiper-item class="swiper-item" v-for="(item, index) in imgs" :key="index">
<view class="img-page">
<movable-area scale-area>
<movable-view direction="all" scale="true" scale-min="1" scale-max="4">
<image :src="item" mode="widthFix" :lazy-load="true" />
</movable-view>
</movable-area>
</view>
</swiper-item>
</swiper>
<view class="item-bottom">
<view class="small-list-page">
<view class="small-list" v-if="imgs.length > 1">
<view class="img-page" :class="currentImg == index ? 'img-page-checked' : ''" v-for="(item, index) in imgs"
:key="index" @click.stop="toImg(index)">
<image class="img" border-radius="10rpx" :src="item" mode="aspectFill" />
</view>
</view>
</view>
</view>
<view class="pop" v-if="isPop">
<view class="item" @click.stop="share()">分享图片</view>
<!-- #ifndef H5 -->
<view class="item" @click.stop="saveImg(false)">保存图片</view>
<view class="item" @click.stop="saveImg(true)">保存全部图片</view>
<!-- #endif -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
imgs: [],
currentImg: 0,
isPop: false
};
},
onLoad(options) {
let {
imgs,
current
} = options;
this.imgs = JSON.parse(imgs);
this.currentImg = current;
},
methods: {
changeSwiper(e) {
this.currentImg = e.detail.current;
},
toImg(index) {
this.currentImg = index;
},
back() {
if (this.isPop) {
this.isPop = false
return
}
try {
this.$Router.back(1);
} catch (e) {
//TODO handle the exception
uni.navigateBack();
}
},
share() {
uni.downloadFile({
// PDF
url: this.imgs[this.currentImg],
success: function(res) {
var filePath = res.tempFilePath;
if (!filePath) return
uni.openDocument({
filePath: filePath,
success: function(res) {
console.log(res);
console.log('打开文档成功');
}
});
}
});
},
saveImg(isAll = false) {
const that = this;
if (!isAll) {
uni.downloadFile({
url: this.imgs[this.currentImg],
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function() {
uni.showToast({
icon: "none",
title: "保存成功"
})
that.isPop =false
},
fail: function() {}
});
} else {}
}
});
return;
}
this.imgs.forEach(item => {
uni.downloadFile({
url: item,
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function() {
uni.showToast({
icon: "none",
title: "保存全部成功"
})
that.isPop =false
},
fail: function() {}
});
} else {}
}
});
})
}
},
};
</script>
<style lang="scss" scoped>
movable-view {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
movable-area {
height: 100%;
width: 100%;
position: fixed;
overflow: hidden;
}
movable-view image {
width: 100%;
}
uni-image>img {
z-index: -1 !important;
}
.content {
height: 60vh;
}
.swiper-img {
width: 100vw;
height: 100vh;
background-color: #000000;
&>.swiper-item {
width: 100vw;
height: 100vh;
.img-page {
height: 100vh;
display: flex;
align-items: center;
}
}
}
.item-bottom {
width: 100vw;
position: fixed;
z-index: 9999;
bottom: 0;
left: 0rpx;
padding: 30rpx;
transition: ease-in-out 0.3s;
height: 200rpx;
display: flex;
justify-content: space-between;
flex-direction: column;
}
.small-list-page {
min-height: 60rpx;
}
.small-list {
display: flex;
justify-content: center;
align-items: center;
.img-page {
display: inline-block;
margin-right: 20rpx;
border: 2rpx solid #c2c2c2;
transition: ease-in 0.1s;
border-radius: 11rpx;
background: #c2c2c2;
overflow: hidden;
&:last-child {
margin-right: 0;
}
.img {
width: 46rpx;
height: 46rpx;
display: block;
}
}
.img-page-checked {
transform: scale(1.2);
border: 4rpx solid #c2c2c2;
}
}
.pop {
width: 500rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
overflow: hidden;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 999999;
.item {
line-height: 100rpx;
height: 100rpx;
padding: 0 50rpx;
transition: all .2s;
border-radius: 20rpx;
&:active {
background-color: #eeeeee;
}
}
}
</style>

@ -26,3 +26,11 @@ import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app)
app.$mount()
//main.js
Vue.prototype.$showimg = function (data) {
uni.navigateTo({
url: '/pages/showimg/showimg?imgs=' + JSON.stringify(data.imgs) + '&current=' + data.current,
animationType: "fade-in",
})
}

@ -0,0 +1,19 @@
{
"id": "alger-simg",
"name": "图片预览(使用简单 长按可保存分享 插件)",
"version": "1.1.0",
"description": "图片预览(使用简单) 可以双指缩放 可以保存分享",
"keywords": [
"图片",
"image",
"img",
"图片预览",
"大图"
],
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
}
}

@ -1,114 +1,123 @@
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue",
"^cpn-(.*)": "@/components/cpn-$1.vue"
},
"pages": [{
"path": "pages/enter/enter",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/home/home",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/list/list",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/todayNursing/todayNursing",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/nursingCalendar/nursingCalendar",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/map/map",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/detailNursing/detailNursing",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/setting/setting",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "uview-ui/components/u-avatar-cropper/u-avatar-cropper",
"style": {
"navigationBarTitleText": "头像裁剪",
"navigationBarBackgroundColor": "#000000"
}
}
],
"subPackages": [{
"root": "package_sub",
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "分包页面sub_index"
}
}]
}],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#ABAEBE",
"selectedColor": "#1479FF",
"list": [{
"iconPath": "/static/tabbar/home.png",
"selectedIconPath": "/static/tabbar/home-active.png",
"pagePath": "pages/home/home",
"text": "首页"
},
{
"iconPath": "/static/tabbar/notification.png",
"selectedIconPath": "/static/tabbar/notification-active.png",
"pagePath": "pages/todayNursing/todayNursing",
"text": "今日护理"
},
{
"iconPath": "/static/tabbar/canlendar.png",
"selectedIconPath": "/static/tabbar/canlendar-active.png",
"pagePath": "pages/nursingCalendar/nursingCalendar",
"text": "护理日历"
},
{
"iconPath": "/static/tabbar/list.png",
"selectedIconPath": "/static/tabbar/list-active.png",
"pagePath": "pages/list/list",
"text": "护理列表"
}
]
}
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue",
"^cpn-(.*)": "@/components/cpn-$1.vue"
},
"pages": [{
"path": "pages/enter/enter",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/home/home",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/list/list",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/todayNursing/todayNursing",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/nursingCalendar/nursingCalendar",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/map/map",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/detailNursing/detailNursing",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/setting/setting",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "uview-ui/components/u-avatar-cropper/u-avatar-cropper",
"style": {
"navigationBarTitleText": "头像裁剪",
"navigationBarBackgroundColor": "#000000"
}
}, {
"path": "pages/showimg/showimg",
"style": {
"navigationBarTextStyle": "white",
"app-plus": {
"animationType": "fade-in",
"animationDuration": 300
}
}
}
],
"subPackages": [{
"root": "package_sub",
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "分包页面sub_index"
}
}]
}],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#ABAEBE",
"selectedColor": "#1479FF",
"list": [{
"iconPath": "/static/tabbar/home.png",
"selectedIconPath": "/static/tabbar/home-active.png",
"pagePath": "pages/home/home",
"text": "首页"
},
{
"iconPath": "/static/tabbar/notification.png",
"selectedIconPath": "/static/tabbar/notification-active.png",
"pagePath": "pages/todayNursing/todayNursing",
"text": "今日护理"
},
{
"iconPath": "/static/tabbar/canlendar.png",
"selectedIconPath": "/static/tabbar/canlendar-active.png",
"pagePath": "pages/nursingCalendar/nursingCalendar",
"text": "护理日历"
},
{
"iconPath": "/static/tabbar/list.png",
"selectedIconPath": "/static/tabbar/list-active.png",
"pagePath": "pages/list/list",
"text": "护理列表"
}
]
}
}

@ -132,6 +132,10 @@
<view class="u-order-desc">{{typeFormat(item.type)}}</view>
<view class="u-order-time">{{item.created_at}}</view>
<view class="u-order-address">{{item.address}}</view>
<view v-for="(img,tindex) in item.upload_list" :key='tindex' @click="showimg(img)">
<u-image width="100%" v-if='img.upload' height='400rpx' :src="img.upload.url">
</u-image>
</view>
</view>
</template>
</u-time-line-item>
@ -139,8 +143,9 @@
</view>
</view>
</view>
<u-modal v-model="isShowModal" :show-cancel-button="true" content="服务时间超过120分钟,是否确认提交?" @confirm="signOut"></u-modal>
<u-modal v-model="isShowModal" :show-cancel-button="true" content="服务时间超过120分钟,是否确认提交?" @confirm="signOut">
</u-modal>
<imgUpload ref="imgUpload" :isShow.sync="isShowImg" :type="type" @confirm="clock"></imgUpload>
</view>
@ -163,7 +168,7 @@
},
data() {
return {
isShowModal:false,//
isShowModal: false, //
type: 0, //,1 2 3退
isShowImg: false,
id: '',
@ -202,6 +207,13 @@
}
},
methods: {
showimg(img) {
if (img.upload)
this.$showimg({
imgs: [img.upload.url],
current: 0
})
},
load() {
this.qqmapsdk = new QQMapWX({
key: 'D5EBZ-C3BWP-HZIDG-VO6BE-P2MN5-ESFZO'
@ -243,8 +255,8 @@
getLoaction() {
return new Promise((resolve, reject) => {
uni.getLocation({
type:'gcj02',
isHighAccuracy:true
type: 'gcj02',
isHighAccuracy: true
}).then(res => {
if (res[1]) {
this.location.lat = res[1]?.latitude
@ -451,9 +463,9 @@
})
})
},
//退
checkSignOut(){
checkSignOut() {
//
if (this.detail.logs_count < this.detail.product.process_total) {
uni.showToast({
@ -476,7 +488,7 @@
})
return
}
//120
let totalTime = 0
for (let i of this.skuList) {
@ -484,10 +496,10 @@
totalTime += Number(i.form.time)
}
}
console.log(11111,totalTime);
if(totalTime > 120){
console.log(11111, totalTime);
if (totalTime > 120) {
this.isShowModal = true
}else{
} else {
this.signOut()
}
},

@ -0,0 +1,253 @@
<template>
<view @click="back" @longpress="isPop = true">
<swiper class="swiper-img" :current="currentImg" :duration="300" @change="changeSwiper">
<swiper-item class="swiper-item" v-for="(item, index) in imgs" :key="index">
<view class="img-page">
<movable-area scale-area>
<movable-view direction="all" scale="true" scale-min="1" scale-max="4">
<image :src="item" mode="widthFix" :lazy-load="true" />
</movable-view>
</movable-area>
</view>
</swiper-item>
</swiper>
<view class="item-bottom">
<view class="small-list-page">
<view class="small-list" v-if="imgs.length > 1">
<view class="img-page" :class="currentImg == index ? 'img-page-checked' : ''" v-for="(item, index) in imgs"
:key="index" @click.stop="toImg(index)">
<image class="img" border-radius="10rpx" :src="item" mode="aspectFill" />
</view>
</view>
</view>
</view>
<view class="pop" v-if="isPop">
<view class="item" @click.stop="share()">分享图片</view>
<!-- #ifndef H5 -->
<view class="item" @click.stop="saveImg(false)">保存图片</view>
<view class="item" @click.stop="saveImg(true)">保存全部图片</view>
<!-- #endif -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
imgs: [],
currentImg: 0,
isPop: false
};
},
onLoad(options) {
let {
imgs,
current
} = options;
this.imgs = JSON.parse(imgs);
this.currentImg = current;
},
methods: {
changeSwiper(e) {
this.currentImg = e.detail.current;
},
toImg(index) {
this.currentImg = index;
},
back() {
if (this.isPop) {
this.isPop = false
return
}
try {
this.$Router.back(1);
} catch (e) {
//TODO handle the exception
uni.navigateBack();
}
},
share() {
uni.downloadFile({
// PDF
url: this.imgs[this.currentImg],
success: function(res) {
var filePath = res.tempFilePath;
if (!filePath) return
uni.openDocument({
filePath: filePath,
success: function(res) {
console.log(res);
console.log('打开文档成功');
}
});
}
});
},
saveImg(isAll = false) {
const that = this;
if (!isAll) {
uni.downloadFile({
url: this.imgs[this.currentImg],
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function() {
uni.showToast({
icon: "none",
title: "保存成功"
})
that.isPop =false
},
fail: function() {}
});
} else {}
}
});
return;
}
this.imgs.forEach(item => {
uni.downloadFile({
url: item,
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function() {
uni.showToast({
icon: "none",
title: "保存全部成功"
})
that.isPop =false
},
fail: function() {}
});
} else {}
}
});
})
}
},
};
</script>
<style lang="scss" scoped>
movable-view {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
movable-area {
height: 100%;
width: 100%;
position: fixed;
overflow: hidden;
}
movable-view image {
width: 100%;
}
uni-image>img {
z-index: -1 !important;
}
.content {
height: 60vh;
}
.swiper-img {
width: 100vw;
height: 100vh;
background-color: #000000;
&>.swiper-item {
width: 100vw;
height: 100vh;
.img-page {
height: 100vh;
display: flex;
align-items: center;
}
}
}
.item-bottom {
width: 100vw;
position: fixed;
z-index: 9999;
bottom: 0;
left: 0rpx;
padding: 30rpx;
transition: ease-in-out 0.3s;
height: 200rpx;
display: flex;
justify-content: space-between;
flex-direction: column;
}
.small-list-page {
min-height: 60rpx;
}
.small-list {
display: flex;
justify-content: center;
align-items: center;
.img-page {
display: inline-block;
margin-right: 20rpx;
border: 2rpx solid #c2c2c2;
transition: ease-in 0.1s;
border-radius: 11rpx;
background: #c2c2c2;
overflow: hidden;
&:last-child {
margin-right: 0;
}
.img {
width: 46rpx;
height: 46rpx;
display: block;
}
}
.img-page-checked {
transform: scale(1.2);
border: 4rpx solid #c2c2c2;
}
}
.pop {
width: 500rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
overflow: hidden;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 999999;
.item {
line-height: 100rpx;
height: 100rpx;
padding: 0 50rpx;
transition: all .2s;
border-radius: 20rpx;
&:active {
background-color: #eeeeee;
}
}
}
</style>
Loading…
Cancel
Save