nurseWeChatAppletUI/pages/ProjectDetails/ProjectDetails.vue

223 lines
6.6 KiB
Vue
Raw Normal View History

2022-12-01 16:59:32 +08:00
<template>
<view class="app">
2023-03-09 09:42:28 +08:00
<!-- 轮播图 -->
<swiper :indicator-dots="true" indicator-color='#fff' indicator-active-color='#0086d6' :autoplay="autoplay"
:interval="3000" :duration="1500" class="swiper-box" :circular='true' @change="swiperChange">
<swiper-item v-for="(item ,index) in lbinfo" :key="index">
<view class="swiper-item" v-show="!splits(item)" wx-if="{item}">
<image v-if="item" :src="item" mode="widthFix"></image>
</view>
<view class="swiper-item" v-show="splits(item)" v-if="item">
<video :id="'myVideo'+index" :autoplay="false" :src="item" controls show-fullscreen-btn
object-fit="fill" @play="play" @pause="pause" @ended="ended" auto-pause-if-navigate
show-play-btn :enable-progress-gesture='true' :show-center-play-btn='true' enable-play-gesture
auto-pause-if-open-native show-mute-btn></video>
</view>
</swiper-item>
</swiper>
2023-02-22 13:36:25 +08:00
<!-- <u-swiper v-if="lbinfo" :list="lbinfo" height="350" style='background-size: 100%;' mode='none'></u-swiper> -->
2022-12-01 16:59:32 +08:00
<view class="item">
<view class="text" v-if='list.nurseItemName'>{{list.nurseItemName}}
2022-12-27 09:22:42 +08:00
</view>
<view class="text" v-else>暂无
</view>
<view class="classtype">
2022-12-01 16:59:32 +08:00
</view>
<!-- <view class="pingfen">
<u-rate :count="5" value="2"></u-rate>
</view> -->
</view>
<!-- <view class="Consumablespackage" v-if='list.itemConsumableList'>耗材包详情:
2022-12-01 16:59:32 +08:00
<span>{{list.consumableTotalPrice==null?'0':list.consumableTotalPrice}}</span>
<view class="detail" v-for='(item,index) in list.itemConsumableList' :key="index">
·{{item.consumableDetail}}
2022-12-02 16:02:53 +08:00
<span>{{item.consumableCount}}{{item.consumableUnit}}/{{item.consumablePrice}}</span>
2022-12-01 16:59:32 +08:00
</view>
</view> -->
2022-12-02 16:02:53 +08:00
<view class="detailtitle">
2022-12-01 16:59:32 +08:00
<view class="Introduction">服务详情:</view>
2023-03-10 11:36:05 +08:00
<!-- <u-parse :html="list.nurseItemContent"></u-parse> -->
<view class="textInfo" v-if="list.nurseItemContent" v-html="list.nurseItemContent">
2022-12-01 16:59:32 +08:00
</view>
</view>
<view class="bottomcontent">
<view class="appoinprice" v-if="list.totalPrice">
{{list.totalPrice}}
</view>
<view class="appointment" @tap.stop='goappointments(item)'>立即预约</view>
</view>
2022-12-01 16:59:32 +08:00
<u-toast ref="uToast" />
<u-mask :show="usershow" class='mask'>
<view class="information">
<image src="../../static/information.png" mode=""></image>
<view class="title">
请完善个人信息
</view>
<view class="cancel" @tap='usershow=false'>
取消
</view>
<view class="determine" @tap='goinformation'>
去完善
</view>
</view>
</u-mask>
</view>
</template>
<script>
import {
AppIdentification
} from '@/api/AppIdentification/index.js'
import baseurl from '@/api/baseurl.js'
import {
getAppStationItemInfo
} from '@/api/ProjectDetails/index.js'
export default {
data() {
return {
lbinfo: [], //轮播
2023-02-22 13:36:25 +08:00
autoplay: true, //自动切换轮播图
videoContext: '',
2022-12-01 16:59:32 +08:00
baseurl: '',
orderNo: '',
usershow: false, //完善信息开关
list: {}, //护理站list
2022-12-01 16:59:32 +08:00
timer: null,
2022-12-27 09:22:42 +08:00
stationId: null,
stationItemId: null,
stationItemPriceId: null,
2022-12-01 16:59:32 +08:00
}
},
onLoad(options) {
2022-12-27 09:22:42 +08:00
this.stationId = options.stationId
this.stationItemId = options.stationItemId
this.stationItemPriceId = options.stationItemPriceId
2022-12-01 16:59:32 +08:00
},
onShow() {
2023-02-17 09:36:17 +08:00
this.baseurl = baseurl
2022-12-01 16:59:32 +08:00
this.usershow = false
2022-12-27 09:22:42 +08:00
// 耗材包详情方法调用
this.getlist(this.stationId, this.stationItemId, this.stationItemPriceId)
2022-12-01 16:59:32 +08:00
},
methods: {
2023-02-22 13:36:25 +08:00
swiperChange(e) {
let {
current,
source
} = e.detail
this.videoContext = uni.createVideoContext('myVideo' + (current - 1));
//只有手动切换时开始轮播,并且上一页视频暂停
if (source === 'touch') {
this.videoContext.pause(); //暂停
this.autoplay = true
}
},
// 获取数据
GetBanner() {},
// 处理banner返回的是是视频还是图片
splits(url) {
if (url.indexOf('.') != -1) {
var ext = url.substring(url.lastIndexOf('.') + 1);
return ['mp4', 'webm', 'mpeg4', 'ogg'].indexOf(ext) != -1
}
},
// 点击开始/继续播放
play() {
this.autoplay = false
// this.videoContext.requestFullScreen()
},
// 视频暂停
pause() {
this.autoplay = true
},
// 视频结束
ended() {
this.autoplay = true
},
2022-12-01 16:59:32 +08:00
//预约
goappointments() {
let that = this
2023-03-09 16:07:29 +08:00
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
AppIdentification(value2).then(res => {
if (res.code == 200) {
if (res.data.loginFlag) {
that.usershow = false
uni.navigateTo({
url: `/pages/appointmenttime/appointmenttime?stationId=${this.stationId}&stationItemId=${this.stationItemId}&stationItemPriceId=${this.stationItemPriceId}`,
2022-12-01 16:59:32 +08:00
})
2023-03-09 16:07:29 +08:00
} else {
that.usershow = true
2022-12-27 09:22:42 +08:00
}
2023-03-09 16:07:29 +08:00
} else if (res.code == 9999) {} else {
that.$refs.uToast.show({
title: res.msg,
type: 'error',
2022-12-01 16:59:32 +08:00
url: '/pages/login/login'
})
2023-03-09 16:07:29 +08:00
}
})
} else {
that.$refs.uToast.show({
title: '未登录,请先登录',
type: 'error',
2022-12-01 16:59:32 +08:00
url: '/pages/login/login'
})
}
},
//跳转完善页面
goinformation() {
this.usershow = false
uni.navigateTo({
url: '/pages/information/information'
})
},
// 信息
getlist(stationId, stationItemId, stationItemPriceId) {
2023-02-20 16:22:42 +08:00
this.lbinfo = []
2022-12-01 16:59:32 +08:00
getAppStationItemInfo(stationId, stationItemId, stationItemPriceId).then(res => {
2022-12-27 09:22:42 +08:00
if (res.data.nurseItemContent) {
res.data.nurseItemContent = res.data.nurseItemContent.replace(/\<img/gi,
"<br/> <img class='richPic'")
}
2023-02-17 09:36:17 +08:00
if (res.data.poserInfoList.length >= 1) {
res.data.poserInfoList.forEach(e => {
2023-02-20 16:22:42 +08:00
e.image = baseurl + e.posterPictureUrl
2023-02-22 13:36:25 +08:00
this.lbinfo.push(e.image)
})
2023-02-22 17:09:55 +08:00
if (res.data.poserInfoList[0].video) {
res.data.poserInfoList[0].video = baseurl + res.data.poserInfoList[0].posterVideoUrl
this.lbinfo.push(res.data.poserInfoList[0].video)
}
2023-02-17 09:36:17 +08:00
} else {
2023-02-22 13:36:25 +08:00
this.lbinfo.push(this.baseurl + res.data.itemPictureUrl)
}
2022-12-01 16:59:32 +08:00
this.list = res.data
})
},
2022-12-28 12:08:50 +08:00
},
//1.分享给朋友
onShareAppMessage(res) {
2023-01-03 09:02:23 +08:00
let pages = getCurrentPages();
let url = pages[pages.length - 1].$page.fullPath
2022-12-28 12:08:50 +08:00
return {
title: '泉医到家',
2023-01-03 09:02:23 +08:00
path: url,
2022-12-28 12:08:50 +08:00
}
},
//2.分享到朋友圈
onShareTimeline(res) {
2023-01-03 09:02:23 +08:00
let pages = getCurrentPages();
let url = pages[pages.length - 1].$page.fullPath
2022-12-28 12:08:50 +08:00
return {
title: '泉医到家',
2023-01-03 09:02:23 +08:00
path: url,
2022-12-28 12:08:50 +08:00
}
},
2022-12-01 16:59:32 +08:00
}
</script>
<style lang="scss">
@import './ProjectDetails.scss';
</style>