123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922 |
- <template>
- <view class="details">
- <view class="content_top">
-
-
- <view class="detail-content">
- <view class="show_img">
- <image :src="$globalData.publicUrl+ detail.cCover" />
- </view>
- <view class="content">
- <view class="name">
- <view class="names"> <text></text> {{detail.cTitle}}</view>
- <view class="price">
- <!-- <image src="../../static/identify/time.png" />{{detail.nMinute}}分钟 -->
- ¥<text>{{price}}</text>
- </view>
- </view>
- <view class="time">{{detail.nMinute}}分钟/超{{detail.nSaleNumber}}人选择</view>
- <view class="state">
- <!-- <view class="state1">适用说明</view> -->
- <view class="state2">性别限制:不限</view>
- <view class="state2">
- 适用人群:{{detail.cSyrq}}
- </view>
- <view class="state2">
- 功能作用:{{detail.cLdList}}
- </view>
- </view>
- <view class="service">
- 服务履约保障
- </view>
- <view class="three">
- <view>
- <image src="../../static/identify/approve.png" mode=""></image>实名认证
- </view>
- <view>
- <image src="../../static/identify/approve.png" mode="">爽约包赔
- </view>
- <view @click="goApprove(details.id)">
- <image src="../../static/identify/approve.png" mode="">商户认证
- <!-- <image src="../../static/identify/more.png" mode=""></image> -->
- </view>
- </view>
- </view>
- <!-- <view class="bottom">
- <view class="recommend">
- <view class="option" :class="current == 0?'cleck_recommend':''" @click="current =0">
- 项目介绍
- </view>
- <view class="option" :class="current == 1?'cleck_recommend':''" @click="current =1">
- 推荐商户
- </view>
- </view>
- <view class="cDetail" style="width: 100%;" v-if="current == 0">
- <image :src="$globalData.publicUrl + detail.cDetail" style="" />
- </view>
- <view class="recommend_js" v-else>
- <view class="item" v-for="(item,index) in jsList" :key="index" @click.stop="godetails(item.id)">
- <view class="itemL">
- <view class="hot" v-if="item.nB3 == 1">
- <image src="https://moxiaoxiang.com/h5/static/xg.gif" mode="" />
- </view>
- <view class="img">
- <image :src="$globalData.publicUrl + item.cPortrait" />
- </view>
- <view class="new" v-if="item.nB2 == 1">
- new
- </view>
- <view class="status">{{item.nStatus ===1?'服务中' :'可服务'}}</view>
- </view>
- <view class="itemR">
- <view class="title">
- <view class="name">{{item.cName}}</view>
- <view class="address">
- <image src="../../static/identify/address.png" mode="" />{{item.distance}}km
- </view>
- </view>
- <view class="mark">
- <view class="center">
- <image src="../../static/identify/star.png" mode="" />{{item.nStar}}
- </view>
- <view class="right">
- 已服务 <text>{{item.nNum}}</text> 单
- </view>
- <view class="right">
- <text>{{item.number}}</text> 收藏
- </view>
- </view>
- <view class="num">
- <view class="free_box">
- </view>
- <view class="btn" @click.stop="bookNow(item)">
- <text>立即预约</text>
- </view>
- </view>
- </view>
- </view>
- <view class="more" @click="more">
- 更多
- </view>
- </view>
- </view> -->
- </view>
- </view>
- <!-- <view class="reserved">
- <view @click="choose">选择商户</view>
- </view> -->
- <view class="dialog" v-if="dialogShow">
- <view class="back" @click="dialogShow = false">
- </view>
- <!-- <view class="closebox" @click="closeDialog"></view> -->
- <view class="dialog_content">
- <view class="box">
- <view class="lists" v-for="(item,index) in projects" :index="index">
- <view class="imgs">
- <image :src="$globalData.publicUrl + item.cCover" mode="" />
- </view>
- <view class="right">
- <view class="list_title">
- <view class="title">{{item.cTitle}}</view>
- <view class="time">{{item.nMinute}}分钟</view>
- </view>
- <view class="price">
- <view class="money">¥{{item.dPrice}}</view>
- <view class="counter">
- <view @click="decrease(item,index)">-</view>
- <text>{{item.number}}</text>
- <view @click="increase(index)">+</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="now" @click="nowYuyue"><text>立即预约</text></view>
- </view>
- </view>
- <view class="cDetail">
-
- <image :src="$globalData.publicUrl+ detail.cDetail" ></image>
- </view>
- <view class="reserved">
- <view @click="nowYuyue()">立即预约</view>
- </view>
- </view>
- </template>
- <script>
- import {
- projectDetails,
- engineerDetails,
- addList,
- addOrder,
- engineer
- } from '../../api/index'
- export default {
- data() {
- return {
- detail: [],
- price: 0,
- cDetail: '',
- current: 0,
- jsList: [],
- deptName: '',
- distance: '',
- projects: [],
- details: '',
- dialogShow: false,
- isAddress:false,
- longitude: '',
- latitude:'',
- cid:'',
- recommendTechnicianList:[]
- }
- },
- methods: {
- //选择商户
- bookNow(item) {
- this.distance = item.distance
- if (!uni.getStorageSync('access-token')) {
- uni.showModal({
- title: '请先登录!',
- success: (res) => {
- if (res.confirm) {
- uni.switchTab({
- url: '/pages/my/my'
- })
- } else if (res.cancel) {
- return
- }
- }
- })
- return
- } else if (item.nStatus === 1) {
- uni.showToast({
- title: '该商户不可预约!',
- icon: 'none'
- })
- return
- }
- this.projects = []
- var id = {
- id: item.id
- }
- engineerDetails(id).then(res => {
- res.data.data.projects.forEach(element => {
- element.number = 0
- });
- this.details = res.data.data,
- this.projects = res.data.data.projects,
- this.dialogShow = true
- })
- },
- // 选择项目加一
- decrease(item, index) {
- if (item.number == 0) {
- return
- }
- let list = this.projects
- this.projects[index].number--
- // this.projects = list
- },
- //选择项目减一
- increase(index) {
- this.projects[index].number++
- // let list = this.projects
- // console.log(list[index])
- // // list[index].number++;
- // this.projects=list
- },
- // 预约
- nowYuyue() {
- uni.setStorageSync('projectId',this.cid)
- uni.switchTab({
- url: '/pages/identify/identify',
- })
-
-
-
-
- // const allCountsZero = this.projects.every(item => item.number === 0);
- // if (!uni.getStorageSync('access-token')) {
- // uni.showModal({
- // title: '请先登录!',
- // })
- // return
- // } else if (allCountsZero) {
- // uni.showToast({
- // title: '请先选择项目!',
- // duration: 1000,
- // icon: 'none',
- // })
- // return
- // } else if (!this.isAddress) {
- // uni.showModal({
- // title: '提示',
- // content: '你还没有添加地址哦!是否去添加?',
- // confirmText: '确定', // 确定按钮的文字
- // cancelText: '取消', // 取消按钮的文字
- // success(res) {
- // if (res.confirm) {
- // setTimeout(() => {
- // uni.navigateTo({
- // url: '../my/add_address'
- // })
- // }, 100)
- // // 用户点击确定按钮后的操作
- // } else if (res.cancel) {}
- // }
- // })
- // return
- // } else {
- // // console.log(this.data.projects,"project")
- // var list = []
- // this.projects.forEach(element => {
- // if (element.number > 0) {
- // element.sum = element.number * element.dPrice
- // list.push(element)
- // }
- // });
- // var total = 0
- // for (let i = 0; i < list.length; i++) {
- // total += list[i].sum;
- // }
- // var data = {
- // cJsId: this.details.id,
- // cGoods: list,
- // cOpenId: uni.getStorageSync('wx_copenid'),
- // dTotalMoney: total,
- // distance: this.distance
- // }
- // addOrder(data).then(res => {
- // if (res.data.code == 200) {
- // uni.navigateTo({
- // url: '/pages/identify/pay_order?orderNo=' + res.data.data.orderNo
- // // url:'/pages/identify/pay_order'
- // })
- // this.dialogShow = true
- // } else {
- // uni.showModal({
- // title: res.data.msg,
- // })
- // }
- // })
- // }
-
- },
- more(){
- uni.setStorageSync('projectId', this.cid)
- uni.switchTab({
- url:'/pages/identify/identify'
- })
- },
- //商户详情
- godetails(id) {
- if (!uni.getStorageSync('access-token')) {
- uni.showModal({
- title: '请先登录!',
- success: (res) => {
- if (res.confirm) {
- this.list = []
- uni.switchTab({
- url: '/pages/my/my'
- })
- } else if (res.cancel) {
- return
- }
- }
- })
- return
- } else {
- uni.navigateTo({
- url: '../../pages/identify/details?id=' + id
- })
- }
- },
- choose() {
- uni.switchTab({
- url: '../identify/identify',
- })
- },
- getAddress() {
- var that = this
- var data = {
- openId: uni.getStorageSync('wx_copenid'),
- }
- addList(data).then(res => {
- if (res.data.data[0]) {
- this.isAddress = true
- } else {
- this.isAddress = false
- }
- }).catch(err => {})
- },
- getDetails(cid, deptName) {
- const cId = {
- cId: cid,
- deptName: deptName,
- nStatus:0,
- longitude: uni.getStorageSync('longitude'),
- latitude: uni.getStorageSync('latitude'),
- }
- projectDetails(cId).then(res => {
- if (res.data.code == 200) {
- this.detail = res.data.data,
- this.recommendTechnicianList = res.data.data.recommendTechnicianList
-
- // res.data.data.jsList.length>3? this.jsList = res.data.data.jsList.slice(0,3):this.jsList = res.data.data.jsList
- this.price = res.data.data.dPrice.toFixed(2)
- this.getJsList()
- }
- })
- },
- getJsList(){
- let data = {
- recommendTechnicianList: this.recommendTechnicianList,
- longitude: uni.getStorageSync('longitude'),
- latitude: uni.getStorageSync('latitude'),
- projectId:this.cid
-
- }
- engineer(data).then(res=>{
- res.data.data.records.length>3? this.jsList = res.data.data.records.slice(0,3):this.jsList = res.data.data.records
- })
- },
- getlocaltion() {
- uni.getLocation({
- type: 'wgs84', // 默认为 wgs84 返回 gps 坐标,可以设置为 gcj02 返回可用于 `uni.openLocation` 的坐标
- success: function(res) {
- this.latitude = res.latitude
- this.longitude = res.longitude
- // this.current = 0
- // this.city = res.address.city
- },
- });
- },
- },
- onLoad: function(options) {
- this.cid = options.cid
- this.getDetails(options.cid, options.deptName)
- // this.getDetails(09493ab2baf94e03b4c014a76b801cc4)
- },
- onShow() {
- this.getAddress()
- this.getlocaltion()
- }
- }
- </script>
- <style lang="scss" scoped>
- .details {
- width: 100vw;
- height: 100vh;
- overflow-y: auto;
- .content_top{
- width: 100%;
- height: auto;
- background: #F7FFFF;
- padding: 30rpx 32rpx;
- box-sizing: border-box;
- }
- }
- .detail-content {
- width: 100%;
- height: 100%;
- padding: 24rpx;
- box-sizing: border-box;
- background-color: #E5FDFB;
- // display: flex;
- // flex-direction: column;
- .show_img {
- width: 638rpx;
- height: 638rpx;
- border-radius: 24rpx;
- overflow: hidden;
- margin-bottom: 20rpx;
- image {
- width: 638rpx;
- height: 638rpx;
- }
- }
- .recommend_js {
- flex: 1;
- background: linear-gradient(to bottom right, rgb(246, 249, 242), rgb(210, 241, 243));
- padding: 10rpx;
- box-sizing: border-box;
- .more{
- width: 100px;
- height: 30px;
- background: #35c99d;
- border-radius: 10rpx;
- text-align: center;
- line-height: 30px;
- margin: 0 auto;
- color:#fff;
- }
- .item {
- display: flex;
- align-items: center;
- justify-content: center;
- // border: 1px solid rgb(212, 211, 211);
- margin-bottom: 20rpx;
- border-radius: 30rpx;
- padding: 30rpx;
- background-color: #fff;
- box-sizing: border-box;
- .itemL {
- position: relative;
- width: 150rpx;
- height: 220rpx;
- margin-right: 30rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-between;
- .hot {
- position: absolute;
- width: 150px;
- height: 150px;
- top: -36px;
- left: -36px;
- // display: flex;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .img {
- width: 150rpx;
- height: 150rpx;
- border-radius: 50%;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .status {
- font-size: 24rpx;
- position: absolute;
- bottom: 0px;
- background-color: #59b7b6;
- color: #fff;
- padding: 3px 10px;
- border-radius: 20px;
- // margin: 10px 0px;
- }
- .new {
- position: absolute;
- top: -20rpx;
- left: -16rpx;
- padding: 0rpx 5rpx;
- background-color: #f9792d;
- opacity: .8;
- border-radius: 10rpx;
- color: #f3f3f3;
- }
- }
- .itemR {
- flex: 1;
- height: 220rpx;
- .title {
- display: flex;
- justify-content: space-between;
- .name {
- width: 30%;
- font-size: 30rpx;
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .address {
- // width: 40%;
- font-size: 26rpx;
- color: #585858;
- image {
- width: 30rpx;
- height: 30rpx;
- vertical-align: text-bottom;
- }
- }
- .status {
- color: #fff;
- background-color: #0ec891;
- font-size: 18rpx;
- padding: 5rpx 15rpx;
- border-radius: 30px;
- height: 30rpx;
- line-height: 30rpx;
- }
- }
- .mark {
- display: flex;
- justify-content: space-between;
- margin: 20px 0;
- .right {
- text {
- color: #f9792d;
- margin-right: 5px;
- }
- }
- .center {
- display: flex;
- align-items: center;
- image {
- width: 30rpx;
- height: 30rpx;
- margin-right: 5px;
- }
- }
- }
- .num {
- display: flex;
- align-items: center;
- justify-content: space-between;
- // padding-left: 30rpx;
- color: #9e9e9e;
- .free_box {
- font-size: 24rpx;
- color: #59b7b6;
- }
- image {
- width: 30rpx;
- height: 30rpx;
- }
- .btn {
- background-color: #59b7b6;
- padding: 10px;
- border-radius: 3px 10px 10px 10px;
- }
- }
- .items {
- display: flex;
- justify-content: space-between;
- padding: 10rpx 0;
- image {
- width: 30rpx;
- height: 30rpx;
- margin-right: 10rpx;
- vertical-align: text-top;
- }
- view {
- display: flex;
- align-items: center;
- }
- }
- .btn {
- font-size: 26rpx;
- background-color: #2cb8d4;
- border-radius: 30px;
- color: #fff;
- text-align: center;
- padding: 10rpx 0;
- }
- }
- }
- }
- .slogan {
- display: flex;
- justify-content: space-around;
- align-items: center;
- font-size: 22rpx;
- padding: 20rpx 0;
- view {
- &:before {
- content: '';
- display: inline-block;
- width: 20rpx;
- height: 20rpx;
- background-color: #2cb8d4;
- border-radius: 10px;
- margin-right: 5px;
- }
- }
- }
- .content {
- // padding: 0 30rpx;
- .name {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8rpx;
- .names {
- font-size: 36rpx;
- font-weight: bold;
- display: flex;
- align-items: center;
- text{
- display: inline-block;
- width: 6rpx;
- height: 34rpx;
- background: #20CBC2;
- margin-right: 24rpx;
- }
- }
- .price {
- font-size: 24rpx;
- color: #F53E54;
- font-weight: bold;
- display: flex;
- align-items: center;
- text{
- font-weight: 600;
- font-size: 44rpx;
- color: #F53E54;
- line-height: 24rpx;
- }
- }
- }
- .time {
- font-size: 24rpx;
- color: #45BBB5;
- margin-top: 8rpx;
- padding-left: 30rpx;
- margin-bottom: 20rpx;
- }
- .state {
- width: 100%;
- background: #FFFFFF;
- box-shadow: 0px 4rpx 12rpx 0px rgba(88,209,187,0.1);
- border-radius: 16rpx ;
- padding: 20rpx;
- box-sizing: border-box;
- .state1 {
- font-size: 32rpx;
- // font-weight: bold;
- }
- .state2 {
- font-size: 28rpx;
- color: #2F3437;
- line-height: 33rpx;
- }
- .state2:nth-child(2){
- margin: 16rpx 0px;
- }
- }
- .service {
- font-size: 28rpx;
- color: #2F3437;
- line-height: 33rpx;
- margin: 20rpx 0;
- }
-
- .three {
- width: 100%;
- height: 80rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
- font-size: 28rpx;
- color: #2F3437;
- padding: 20rpx 0;
- background-color: #ffffff;
- box-sizing: border-box;
- border-radius: 16rpx;
-
- view {
- display: flex;
- align-items: center;
-
- image {
- width: 40rpx;
- height: 40rpx;
- margin-right: 8rpx;
- }
- }
- }
- }
- .bottom {
- flex: 1;
- width: 100vw;
- display: flex;
- flex-direction: column;
- margin-top: 32rpx;
- .recommend {
- width: 100%;
- height: 50px;
- display: flex;
- align-items: center;
- justify-content: space-around;
- .option {
- font-size: 26rpx;
- color: #333;
- }
- .cleck_recommend {
- color: #2cb8d4;
- }
- }
- }
- }
-
- .cDetail {
- width: 100vw;
- margin-bottom: 130rpx;
- image {
- width: 100%;
- height: 2600rpx;
- // object-fit: cover;
- }
- }
- .reserved {
- width: 100%;
- height: 116rpx;
- background: #FFFFFF;
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- padding: 20rpx 40rpx;
- text-align: center;
- box-shadow: 0 0 30rpx #ece9e9;
- background-color: #fff;
- box-sizing: border-box;
-
- view {
- background: linear-gradient( 90deg, #1AD7CE 0%, #21C9C1 100%);
- color: #fff;
- width: 100%;
- height: 76rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 106rpx;
- font-weight: bold;
- font-size: 32rpx;
- }
- }
- .dialog {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, .5);
- z-index: 10;
- transition: transform 0.3s ease-out;
- display: flex;
- flex-direction: column;
- .back {
- flex: 1;
- }
- .closebox {
- height: calc(50vh - 60rpx);
- width: 100%;
- }
- .dialog_content {
- background-color: #fff;
- position: absolute;
- bottom: 0;
- width: calc(100% - 60rpx);
- height: 50vh;
- border-top-left-radius: 20rpx;
- border-top-right-radius: 20rpx;
- padding: 30rpx;
- background-color: #f3f3f3;
- // padding-bottom: 100rpx;
- display: flex;
- flex-direction: column;
- .box {
- height: 90%;
- overflow-y: auto;
- .lists {
- // height: 90%;
- background-color: #fff;
- margin-bottom: 20rpx;
- display: flex;
- justify-content: space-between;
- padding: 20rpx 10rpx;
- border-radius: 10rpx;
- // overflow-y: auto;
- .imgs {
- width: 240rpx;
- height: 160rpx;
- border-radius: 20rpx;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .right {
- flex: 1;
- padding-left: 30rpx;
- .list_title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .title {
- width: 280rpx;
- font-size: 34rpx;
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .time {
- font-size: 24rpx;
- color: #45BBB5;
- }
- }
- .price {
- padding-top: 50rpx;
- display: flex;
- justify-content: space-between;
- .money {
- font-size: 42rpx;
- color: #e61b1b;
- font-weight: bold;
- }
- .counter {
- display: flex;
- view {
- width: 60rpx;
- height: 60rpx;
- line-height: 60rpx;
- background-color: #f7f8fa;
- text-align: center;
- border-radius: 60rpx;
- font-size: 50rpx;
- }
- text {
- display: block;
- width: 100rpx;
- text-align: center;
- line-height: 60rpx;
- font-size: 30rpx
- }
- }
- }
- }
- }
- }
- .now {
- height: 10%;
- left: 0;
- width: 100%;
- text-align: center;
- height: 100rpx;
- padding-top: 10rpx;
- text {
- display: inline-block;
- height: 80rpx;
- line-height: 80rpx;
- width: 90%;
- background-color: #2cb8d4;
- color: #fff;
- border-radius: 50rpx;
- }
- }
- }
- }
- </style>
|