123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726 |
- <template>
- <view class="content">
- <view class="box">
- <view class="hflex acenter">
- <image :src="pageData.user.headimg" class="avatar"></image>
- <view class="vflex" style="padding-left: 12rpx;">
- <view class="text_style1 text_hide" style="max-width: 500rpx;">{{pageData.user.nickname}}</view>
- <view class="hflex acenter">
- <view class="text_style2">{{pageData.city}}</view>
- <view class="text_style2" style="padding: 0 10rpx;">|</view>
- <view class="text_style2">{{pageData.create_at}}发布</view>
- </view>
- </view>
- </view>
- <view class="text_style3 cell">{{pageData.describe}}</view>
- <view class="cell">
- <block v-for="(item,index) in pageData.imgs" :key="index">
- <image :src="item" mode="aspectFill" class="img" @tap="preview"></image>
- </block>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="label">联系方式</view>
- <view class="text_style3">{{pageData.user.phone}}</view>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="label">维修时间</view>
- <view class="text_style3">{{pageData.start_time}}至{{pageData.end_time}}</view>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="label">维修地点</view>
- <view class="text_style3">{{pageData.city}} {{pageData.area}} {{pageData.address}}</view>
- </view>
- </view>
- <view class="box hflex acenter jbetween" style="margin-bottom: 186rpx;">
- <view class="title">订单类型</view>
- <view class="right">{{pageData.quick == 1 ? '普修' : '快修'}}</view>
- </view>
- <view class="bottom hflex acenter jbetween">
- <view class="vflex acenter jcenter" @click="share('Poster1')">
- <image src="https://ship.shipcc.cn/common/share.png" mode="" class="bottom_img"></image>
- <view class="" style="font-size: 20rpx;margin-right: 30rpx;">分享</view>
- </view>
- <view class="bottom_btn" @click="openOffer" v-if="pageData.status == 1 ">立即接单</view>
- <view class="bottom_btn bottom_btn2" @click="openSee" v-else>已报价,立即查看</view>
- </view>
- <view class="share_content" :class="share_show?'':'share_content1'">
- <!-- <view style="width: 100%;height: 168rpx;"></view> -->
- <view class="share_box vflex">
- <view class="vflex share1" id="share1" ref="share1">
- <view class="hflex acenter jbetween user">
- <view class="hflex acenter">
- <image data-etype="image" :data-enode="pageData.user.headimg" :src="pageData.user.headimg" style="width:48rpx;height: 48rpx;border-radius: 50%;: 16rpx 10rpx 0 0" class="img Poster1" mode="aspectFill" shape="10"></image>
- <view class="Poster1 user_name" :data-enode="pageData.user.nickname">{{pageData.user.nickname}}</view>
- <view class="Poster1 user_text" :data-enode="'|' + pageData.city">| {{pageData.city}}</view>
- </view>
- <!-- <view class="Poster1 user_text" :data-enode="pageData.create_at + '发布'">{{pageData.create_at}}发布</view> -->
- </view>
- <!-- <text class="share_name Poster1" style="margin: 20rpx 0 28rpx;" :data-enode="pageData.merchant.company">{{pageData.merchant.company}}</text> -->
- <view class="Poster1 share_cell" style="width: 600rpx;" data-etype="textarea" :data-enode="pageData.describe">{{pageData.describe}}</view>
- <view class="hflex acenter jbetween">
- <view class="share_label Poster1" style="margin: 20rpx 0;" data-enode="维修时间">维修时间</view>
- <view class="share_label Poster1" style="margin: 20rpx 0;" :data-enode="pageData.start_time + '至' + pageData.end_time">{{pageData.start_time}}至{{pageData.end_time}}</view>
- </view>
- <view class="hflex acenter jbetween">
- <view class="share_label Poster1" style="margin: 20rpx 0;" data-enode="维修地点">维修地点</view>
- <view class="share_label Poster1" data-etype="textarea" style="margin: 20rpx 0;width: 480rpx;" :data-enode="pageData.address">{{pageData.address}}</view>
- </view>
- <view class="hflex acenter jbetween">
- <view class="share_label Poster1" style="margin: 20rpx 0;" data-enode="联系方式">联系方式</view>
- <view class="share_label Poster1" style="margin: 20rpx 0;" :data-enode="pageData.user.phone">{{pageData.user.phone}}</view>
- </view>
- <!-- <view class="share_label Poster1" style="margin: 20rpx 0;" :data-enode="'维修地点' + pageData.address">维修地点:{{pageData.address}}</view>
- <view class="share_label Poster1" :data-enode="'联系方式' + pageData.user.phone">联系方式:{{pageData.user.phone}}</view> -->
- <view class="Poster1">
- <block v-for="(item,index) in pageData.imgs" :key="index">
- <image data-etype="image" :data-enode="item" :src="item" style="width:180rpx;height: 180rpx;margin: 16rpx 10rpx 0 0" class="img Poster1" mode="aspectFill" shape="10"></image>
- <!-- <video class="img Poster1" v-else data-etype="image" :data-enode="style.code" :src="item.src"></video> -->
- </block>
- </view>
-
- <view class="hflex acenter share_text jcenter Poster1" style=" margin: 0 190rpx 12rpx;" data-enode="长按或扫码查看">长按或扫码查看</view>
- <view style="width: 100%;" class="vflex acenter jcenter">
- <image class="Poster1" style="width: 25rpx;height: 20rpx;" :data-enode="style.img1" data-etype="image" :src="style.img1"></image>
- <image class="Poster1" style="width: 100%;height: 2rpx;margin: 30rpx 0;" :data-enode="style.img2" data-etype="image" :src="style.img2"></image>
- </view>
- <view class="hflex acenter jbetween">
- <view class="vflex">
- <view class="share_name Poster1" style="margin: 54rpx 0 20rpx;" data-enode="船百知">船百知</view>
- <view class="share_text Poster1" style="margin: 0 0 36rpx;" data-enode="船百知伴你一起杨帆启航,驶向成功彼岸">船百知伴你一起杨帆启航,驶向成功彼岸</view>
- </view>
- <image class="Poster1" data-etype="image" :data-enode="style.code" :src="style.code" style="width: 136rpx;height: 136rpx;"></image>
- <!-- <image class="Poster1" data-etype="image" :data-enode="share_img" :src="share_img" style="width: 136rpx;height: 136rpx;"></image> -->
- </view>
- </view>
- </view>
- <evils-el-poster width="325" :height="height" @on-error="onError" :list="list2" backgroundColor="rgb(255, 255, 255)" @on-success="onSuccess" ref="Eposter"></evils-el-poster>
- <view class="share_bottom">
- <view class="hflex acenter jcenter">
- <button class="vflex acenter jcenter bottom_item" open-type="share">
- <image src="https://ship.shipcc.cn/common/wx.png" class="item_icon"></image>
- <view class="item_text">微信好友</view>
- </button>
- <!-- <button class="vflex acenter jcenter bottom_item" open-type="share">
- <image src="https://ship.shipcc.cn/common/moments.png" class="item_icon"></image>
- <view class="item_text">朋友圈</view>
- </button> -->
- <view class="vflex acenter jcenter bottom_item" @click="saveImg">
- <image src="https://ship.shipcc.cn/common/download.png" class="item_icon"></image>
- <view class="item_text">保存图片</view>
- </view>
- </view>
- <view class="share_cancel" @click="close">取消</view>
- </view>
- </view>
- <u-popup :show="quotation_show" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
- <view class="popup">
- <view class="popup_title">立即报价</view>
- <view class="input_bg hflex acenter">
- <view class="price">¥</view>
- <u-input v-model="offer" placeholder="填写你的报价" border="none"></u-input>
- </view>
- <view class="hflex acenter">
- <image src="https://ship.shipcc.cn/common/icon_tips.png" style="width: 24rpx;height: 24rpx;padding-right: 6rpx"></image>
- <view class="popup_info">报价可先不填,可等评估后再填写</view>
- </view>
- <view class="hflex acenter" style="padding:30rpx 0 20rpx;">
- <view class="price">上传图片及资质证明图</view>
- </view>
- <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="9"></u-upload>
- <view class="popup_btn" @click="submit">提交</view>
- </view>
- </u-popup>
- <u-popup :show="detail_show" mode="center" :round="10" :closeable="true" :safeAreaInsetBottom="false" @close="close">
- <view class="popup">
- <view class="popup_title">报价信息</view>
- <view class="popup_name">当前报价</view>
- <view class="">
- <block v-for="(item,index) in list" :key="index">
- <view class="hflex acenter input_bg">
- <view class="popup_text">第{{list.length - index}}次报价</view>
- <view class="red">{{item.price == 0 ? '未报价' : item.price}}</view>
- </view>
- </block>
- </view>
- <!-- <view class="hflex acenter input_bg" v-if="offer_info.list.length >= 1">
- <view class="popup_text">第一次报价</view>
- <view class="red">{{offer_info.list[0].price}}</view>
- </view>
- <view class="hflex acenter input_bg" v-if="offer_info.list.length >= 2">
- <view class="popup_text">第二次报价</view>
- <view class="red">{{offer_info.list[1].price}}</view>
- </view>
- <view class="hflex acenter input_bg" v-if="offer_info.list.length >= 3">
- <view class="popup_text">第三次报价</view>
- <view class="red">{{offer_info.list[2].price}}</view>
- </view> -->
- <view class="popup_name">图片及资质证明图片</view>
- <view>
- <block v-for="(item,index) in offer_info.imgs" :key="index">
- <image :src="item" mode="aspectFill" style="width: 188rpx;height: 188rpx;margin: 0 14rpx 20rpx 0;border-radius: 16rpx;"></image>
- </block>
- </view>
- <view class="popup_btn" @click="toDetail">查看详情</view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import $api from '@/static/js/api.js'
- var that = ''
- export default {
- data() {
- return {
- pageData: {
- },
- quotation_show: false,
- offer: '',
- fileList1: [],
- imgs: '',
- detail_show: false,
- offer_info: {
- },
- id: '',
- list: [],
- list2: [],
- share_show: false,
- style: {
- img1: 'https://ship.shipcc.cn/common/down2.png',
- img2: 'https://ship.shipcc.cn/common/line.png',
- code: 'https://ship.shipcc.cn/common/code.jpg'
- },
- tempImage:'',
- share_img: '',
- height: 0
- }
- },
- onLoad(options) {
- that = this
- that.id = options.id
- that.getData()
- that.getOffer()
- },
- methods: {
- getData() {
- $api.req({
- url: '/data/api.auth.ShipEngineMaintenance/repairdetail',
- method: 'POST',
- data: {
- id: that.id
- }
- }, function(res) {
- if(res.code == 1) {
- console.log(res);
- that.pageData = res.data
- }
- })
- },
- getOffer() {
- $api.req({
- url: '/data/api.auth.ShipEngineMaintenance/offerinfo',
- method: 'POST',
- data: {
- id: that.id
- }
- }, function(res) {
- if(res.code == 1) {
- that.offer_info = res.data
- let length = res.data.list.length
- let index = 0
- that.list = []
- for(var i=length-1;i>=0;i--) {
- that.list.push(that.info.list[i])
- }
- console.log(that.list);
- }
- })
- },
- preview() {
- uni.previewImage({
- urls: that.pageData.imgs
- })
- },
- // 立即接单
- openOffer() {
- var maintenance = uni.getStorageSync('maintenance')
- if(maintenance) {
- that.quotation_show = true
- } else {
- $api.info("请先成为维修工")
- }
- },
- submit() {
- console.log(that.pageData.status);
- that.pageData.status = 2
- console.log(that.pageData.status);
- $api.req({
- url: '/data/api.auth.ShipEngineMaintenance/repairoffer',
- method: 'POST',
- data: {
- id: that.id,
- price: that.offer,
- imgs: that.imgs
- }
- }, function(res) {
- if(res.code == 1) {
- $api.info(res.info)
- that.close()
- // that.pageData = {}
- // that.getData()
- }
- })
- },
- // 查看报价
- openSee() {
- that.detail_show = true
- },
- // 关闭
- close() {
- that.quotation_show = false
- that.detail_show = false
- that.share_show = false
- },
- // 删除图片
- deletePic(event) {
- this[`fileList${event.name}`].splice(event.index, 1)
- },
- // 新增图片
- async afterRead(event) {
- uni.showLoading({
- title: '上传中',
- mask: true
- })
- let lists = [].concat(event.file)
- let fileListLen = this[`fileList${event.name}`].length
- lists.map((item) => {
- this[`fileList${event.name}`].push({
- ...item,
- status: 'uploading',
- message: '上传中'
- })
- })
- for (let i = 0; i < lists.length; i++) {
- const result = await this.uploadFilePromise(lists[i].url)
- let item = this[`fileList${event.name}`][fileListLen]
- this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
- status: 'success',
- message: '',
- url: result.url
- }))
- fileListLen++
- if(lists.length - 1 == i) {
- uni.hideLoading()
- }
- }
- if(that[`fileList${event.name}`].length > 0) {
- for(var i=0;i<that[`fileList${event.name}`].length;i++) {
- if(i == that[`fileList${event.name}`].length -1) {
- that.imgs += that[`fileList${event.name}`][i].url
- } else {
- that.imgs += that[`fileList${event.name}`][i].url + ','
- }
- }
- }
- },
- // 上传图片
- uploadFilePromise(url) {
- return new Promise((resolve, reject) => {
- let a = uni.uploadFile({
- url: $api.config.baseUrl + '/data/api.auth.Center/upload',
- filePath: url,
- name: 'file',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
- 'api-name': 'wxapp'
- },
- formData: {
- user: 'test'
- },
- success: (res) => {
- setTimeout(() => {
- var data = JSON.parse(res.data)
- resolve(data.data)
- }, 1000)
- }
- });
- })
- },
- toDetail() {
- $api.jump('/page_shop/pages/order/offer2?id=' + that.id + '&status=' + that.pageData.status)
- },
- share(elClass) {
- uni.createSelectorQuery().in(this).select('#share1').boundingClientRect((res) => {
- that.height = res.height
- console.log(res);
- }).exec()
- let view = uni.createSelectorQuery().in(this).select(".Poster1");
-
- view.fields({
- size: true,
- rect: true,
- scrollOffset: true
- }, data => {
- console.log('data=',data);
- }).exec();
- that.share_show = true
-
- that.$refs.Eposter.createForElRect(elClass,false)
- },
-
- onSuccess(e) {
- console.log(e);
- that.tempImage = e
- },
- onError(err) {
- console.log('发生错误');
- console.log(err);
- },
- saveImg() {
- console.log(that.tempImage);
- uni.authorize({
- scope: 'scope.writePhotosAlbum',
- success() {
- uni.saveImageToPhotosAlbum({
- filePath: that.tempImage,
- success: function () {
- console.log('save success');
- $api.info('保存成功')
- that.close()
- }
- });
- }
- })
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .content {
- background: #F4F4F4;
- .box {
- width: 690rpx;
- margin: 20rpx 30rpx 0;
- background: #FFFFFF;
- border-radius: 10px;
- box-sizing: border-box;
- padding: 20rpx;
- .avatar {
- width: 72rpx;
- height: 72rpx;
- border-radius: 50%;
- }
- .text_style1 {
- font-size: 28rpx;
- font-weight: 500;
- color: #222222;
- line-height: 40rpx;
- }
- .text_style2 {
- font-size: 22rpx;
- font-weight: 400;
- color: #B7B7B7;
- line-height: 32rpx;
- }
- .text_style3 {
- font-size: 28rpx;
- font-weight: 400;
- color: #444444;
- line-height: 44rpx;
- }
- .img {
- width: 200rpx;
- height: 200rpx;
- border-radius: 12rpx;
- margin: 0 14rpx 20rpx 0;
- }
- .img:nth-child(3n+3) {
- margin: 0 0 20rpx 0;
- }
- .label {
- width: 200rpx;
- font-size: 26rpx;
- font-weight: 400;
- color: #777777;
- line-height: 36rpx;
- }
- .title {
- font-size: 30rpx;
- font-weight: 400;
- color: #222222;
- line-height: 42rpx;
- }
- .right {
- font-size: 30rpx;
- font-weight: 500;
- color: #506DFF;
- line-height: 42rpx;
- }
- .cell {
- padding: 14rpx 0;
- }
- }
- .bottom {
- width: 100%;
- z-index: 9;
- position: fixed;
- bottom: 0;
- height: 166rpx;
- background: #FFFFFF;
- box-sizing: border-box;
- padding: 8rpx 40rpx 74rpx;
- .bottom_img {
- width: 40rpx;
- height: 40rpx;
- margin-right: 30rpx;
- }
- .text_style1 {
- white-space: nowrap;
- padding-right: 30rpx;
- }
- .bottom_btn {
- width: 100%;
- height: 84rpx;
- background: #506DFF;
- border-radius: 42rpx;
- font-size: 36rpx;
- font-weight: 500;
- color: #FFFFFF;
- text-align: center;
- line-height: 84rpx;
- }
- .bottom_btn2 {
- background: rgba(80,109,255,0.5);
- }
- }
- .popup {
- width: 670rpx;
- background: #FFFFFF;
- border-radius: 10px;
- box-sizing: border-box;
- padding: 36rpx 30rpx 24rpx;
- .popup_title {
- width: 100%;
- text-align: center;
- font-size: 32rpx;
- font-weight: 500;
- color: #222222;
- margin-bottom: 24rpx;
- }
- .popup_name {
- font-size: 26rpx;
- font-weight: 400;
- color: #222222;
- padding: 28rpx 0 20rpx;
- }
- .popup_text {
- font-size: 22rpx;
- font-weight: 500;
- color: #777777;
- padding-right: 60rpx;
- }
- .input_bg {
- background: #F4F4F4;
- border-radius: 8px;
- box-sizing: border-box;
- padding: 16rpx 20rpx;
- margin: 20rpx 0;
- .price {
- font-size: 32rpx;
- font-weight: 500;
- color: #222222;
- padding-right: 20rpx;
- }
- .u-textarea {
- background-color: #F4F4F4 !important;
- }
- .red {
- font-size: 28rpx;
- font-weight: bold;
- color: #FF3636;
- }
- }
- .popup_info {
- font-size: 20rpx;
- font-weight: 400;
- color: #C0C0C0;
- line-height: 28rpx;
- }
- .popup_btn {
- width: 610rpx;
- height: 80rpx;
- background: #506DFF;
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 500;
- color: #FFFFFF;
- text-align: center;
- line-height: 80rpx;
- margin: 20rpx 0;
- }
- }
- .share_content {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 99;
- width: 100vw;
- height: 100vh;
- background: rgba(0,0,0,0.5);
- backdrop-filter: blur(5px);
- padding: 0 0 0;
- .share_box {
- margin: 100rpx auto 0;
- width: 650rpx;
- height: 800rpx;
- overflow: auto;
- background: #FFFFFF;
- border-radius: 20rpx;
- box-sizing: border-box;
- padding: 32rpx 35rpx;
- .user {
- padding-bottom: 24rpx;
- .user_text {
- font-size: 24rpx;
- font-family: SFPro-Regular, SFPro;
- font-weight: 400;
- color: #888888;
- line-height: 28rpx;
- }
- .user_name {
- font-size: 24rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #222222;
- line-height: 34rpx;
- }
- }
- .share_name {
- width: 100%;
- font-size: 32rpx;
- font-weight: 500;
- color: #222222;
- line-height: 44rpx;
- }
- .share_boxbg {
- background: #F4F4F4;
- border-radius: 8px;
- box-sizing: border-box;
- padding: 0 20rpx;
- .share_cell {
- font-size: 32rpx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 600;
- color: #222222;
- line-height: 44rpx;
- margin: 0 0 36rpx;
- }
- .item_title {
- font-size: 28rpx;
- font-weight: 400;
- color: #222222;
- line-height: 40rpx;
- padding: 20rpx 0 16rpx;
- }
- .text_style2 {
- font-size: 24rpx;
- font-weight: 400;
- color: #888888;
- line-height: 34rpx;
- }
- .padR-20 {
- padding-right: 20rpx;
- }
- }
- .share_label {
- font-size: 26rpx;
- font-weight: 400;
- color: #444444;
- line-height: 36rpx;
- margin: 20rpx 0 54rpx;
- }
- .share_text {
- font-size: 20rpx;
- font-weight: 400;
- color: #BEBEBE;
- line-height: 28rpx;
- margin: 20rpx 136rpx 18rpx;
- }
- .box_bottom {
- width: 100%;
- padding: 34rpx 0 16rpx;
- border-top: 1rpx dashed #C3C3C3;
-
- .bottom_left1 {
- font-size: 32rpx;
- font-weight: 500;
- color: #222222;
- line-height: 44rpx;
- padding-bottom: 20rpx;
-
- }
- .bottom_left2 {
- font-size: 22rpx;
- font-weight: 400;
- color: #999999;
- line-height: 32rpx;
- }
- .bottom_right {
- width: 136rpx;
- height: 136rpx;
- }
- }
- }
- /* .canvas {
- position: absolute;
- top: 128rpx;
- left: 50rpx;
- width: 650rpx;
- min-height: 494rpx;
- background: #FFFFFF;
- border-radius: 20rpx;
- } */
- .share_bottom {
- position: fixed;
- bottom: 0;
- width: 100%;
- height: 388rpx;
- background: #F5F7FF;
- border-radius: 40rpx 40rpx 0px 0px;
- .bottom_item {
- width: 33%;
- margin: 50rpx 0 90rpx;
- border: none !important;
- background-color: #F5F7FF !important;
- .item_icon {
- width: 76rpx;
- height: 76rpx;
- }
- .item_text {
- font-size: 26rpx;
- font-weight: 400;
- color: #333333;
- line-height: 36rpx;
- margin-top: 12rpx;
- }
- }
- button::after {
- border: none !important;
- }
- .share_cancel {
- width: 100%;
- text-align: center;
- font-size: 32rpx;
- font-weight: 400;
- color: #333333;
- line-height: 44rpx;
- }
- }
- }
- .share_content1 {
- z-index: -99 !important;
- }
- }
- </style>
|