| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333 |
- <template>
- <view style="padding-bottom: 140rpx;">
- <view class="" style="font-weight: bold;font-size: 36rpx;color: #222222;padding: 24rpx;">
- <view v-if="order.status ==1">待付款...</view>
- <view v-if="order.status ==2">待服务</view>
- <view v-if="order.status ==5">已完成</view>
- <view v-if="order.status ==6">服务中</view>
- <view v-if="order.status ==7">技师出发</view>
- <view v-if="order.status ==8">技师到达</view>
- <view v-if="order.status ==3">待评价</view>
- <view v-if="order.status ==4" style="color: #999999;">已取消</view>
- <view v-if="order.overTimeOrders == 1" style="color: red;font-size:26rpx">(订单已超时)</view>
- </view>
- <view class="padding-lr padding-bottom u-skeleton">
- <view class="u-skeleton-fillet"
- v-if="order.ordersMassageList && order.ordersMassageList.length > 0">
- <view class="content" style="position: relative;">
- <image style="width: 100%;height: 30rpx;position: absolute;left: 0;bottom: -10rpx;" src="../../static/img/line.png" mode=""></image>
- <view class="flex align-center " >
- <image :src="order.artificer.artificerImg" style="width:80rpx;height: 80rpx;border-radius: 50%;">
- </image>
- <view class="margin-left-sm" style="flex: 1;">
- <view class="flex align-center justify-between">
- <view class="text-bold text-df ">{{order.artificer.artificerName}}</view>
- <image
- v-if="order.status !=1 && order.status !=5 && order.status !=3 && order.status !=4 && order.status !=2"
- src="../../static/img/phone.png" style="width: 40rpx;height: 40rpx;margin-left: 11px;"
- @click="bindphone(order.artificer.phone)"></image>
- </view>
- <view class="flex align-center flex-wrap" v-if="order.artificer.ordersCount">
- <view class="margin-right">
- <image src="../../static/images/start.png" style="width: 24rpx;height: 22rpx;"></image>
- <text style="color: #F93731;margin-left: 5rpx;">{{order.artificer.ordersCount}}</text>
- </view>
- <text class="margin-bottom-xs box" style="margin-right: 10upx;">健康理疗师</text>
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 1rpx;background: #F2F2F2;margin-top:24rpx;"></view>
- <view class="flex align-center justify-between margin-top" style="width: 100%;" v-if="order.artificer">
- <view style="width: 100%;">
- <view style="font-weight: bold;font-size: 32rpx;color: #222222;width: 100%;;display: flex;justify-content: space-between;">
- <view class="">
- {{order.userName}}
- </view>
- <view class="">
- {{order.phone ? order.phone.substring(0,3) + '****' + order.phone.substring(7,11) : ''}}
- </view>
- </view>
- <view style="color: #AAAAAA;font-size: 28rpx;margin-top: 20rpx;">{{order.address}}</view>
- </view>
- <!-- <image src="../../static/img/you.png" style="width: 15rpx;height: 28rpx;"></image> -->
- </view>
- </view>
-
- <view class="content">
- <view class="flex justify-around">
- <view class="" style="width: 160upx;height: 160upx;">
- <image :src="order.ordersMassageList[0].massageType.massageImg"
- style="width: 160rpx;height: 160rpx;border-radius: 32rpx;"></image>
- </view>
- <view class="u-flex-1 margin-left-sm">
- <view class="flex">
- <!-- <image src="../../static/images/geren.png" style="width: 35rpx;height: 35rpx;">
- </image> -->
- <view class=" u-skeleton-fillet"
- style="font-weight: bold;font-size: 32rpx;color: #222222;margin-top: -2px;display: inline-block;width: 400rpx; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
- {{order.ordersMassageList[0].massageType.title}}
- </view>
- </view>
- <view class="flex align-center">
- <view style="width: 70%;">
- <view class="flex justify-between margin-tb-sm" style="color: #999999;">
- <view>
- <!-- <image src="../../static/time.png"
- style="width: 26rpx;height: 26rpx;margin-right: 8rpx;"></image> -->
- {{order.ordersMassageList[0].massageType.duration}}分钟
- x{{order.ordersMassageList[0].num}}
- </view>
- </view>
- <view style="color:#FF6E98;font-size: 24upx;">
- ¥<text class="text-bold text-lg" style="font-size: 40rpx;">{{order.price}}</text>
- </view>
- </view>
- <view class="jz_btn"
- v-if="order.addNum < order.ordersMassageList[0].massageType.addNum && order.status == 6"
- @tap="saveJZ(order.ordersMassageList[0].massageType.massageTypeId)">
- 加钟/补价</view>
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 1rpx;background: #F2F2F2;margin-top:15rpx;"></view>
- <view class="flex justify-between margin-top-lg" v-if="order.taxiMoney">
- <view style="width: 180upx;">出行交通费用</view>
- <view class="">¥{{order.taxiMoney}}</view>
- </view>
- <view class="flex justify-between margin-top" v-if="order.couponMoney">
- <view style="width: 120upx;">优惠券</view>
- <view class="">¥{{order.couponMoney}}</view>
- </view>
- <view class="flex justify-between margin-top" v-if="order.addNum">
- <view style="width: 120upx;">加钟次数</view>
- <view class="">{{order.addNum}}</view>
- </view>
- <view class="flex justify-between margin-top" v-if="order.addTime">
- <view style="width: 120upx;">加钟时长</view>
- <view class="">{{order.addTime}}分钟</view>
- </view>
- <view class="flex justify-between margin-top" v-if="order.addMoney">
- <view style="width: 120upx;">加钟费用</view>
- <view class="">¥{{order.addMoney}}</view>
- </view>
-
- </view>
-
-
-
-
- <view class="content">
- <view class="text-lg text-bold">
- 订单信息
- </view>
- <view class="margin-right-xs">
- <view class="flex justify-between margin-top-lg">
- <view style="width: 120upx;" class="label">订单编号</view>
- <view class="flex align-center" @tap="copy(order.ordersNo)">
- <view class="">{{order.ordersNo}}</view>
- <u-icon name="file-text"></u-icon>
- </view>
- </view>
- <view class="flex justify-between margin-top-lg">
- <view style="width: 120upx;" class="label">预约时间</view>
- <view class="">{{order.serveTime}}</view>
- </view>
- <view class="flex justify-between margin-top-lg">
- <view style="width: 120upx;" class="label">下单时间</view>
- <view class="">{{order.createTime}}</view>
- </view>
- <view class="flex justify-between margin-top-lg" v-if="order.startTime">
- <view style="width: 200upx;" class="label">开始服务时间</view>
- <view class="">{{order.startTime}}</view>
- </view>
- <view class="flex justify-between margin-top-lg" v-if="order.endTimes">
- <view style="width: 200upx;" class="label">结束服务时间</view>
- <view class="">{{order.endTimes}}</view>
- </view>
- <view class="flex justify-between margin-top-lg" v-if="order.endTime">
- <view style="width: 200upx;" class="label">预估结束时间</view>
- <view class="">{{order.endTime}}</view>
- </view>
- <view class="flex justify-between margin-top-lg" v-if="order.tripWay">
- <view style="width: 120upx;" class="label">出行方式</view>
- <view v-if="order.tripWay == 1">公交</view>
- <view v-if="order.tripWay == 2">出租</view>
- <view v-if="order.tripWay == 3">免费</view>
- </view>
- <view class="flex justify-between margin-top-lg" v-if="order.km">
- <view style="width: 120upx;" class="label">全程距离</view>
- <view class="">{{order.km}}km</view>
- </view>
- <view class="flex justify-between margin-top-lg" v-if="order.remark">
- <view style="width: 170rpx;" class="label">备注内容</view>
- <view class="flex">
- <view class="">
- {{order.remark}}
- </view>
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 1rpx;background: #F2F2F2;margin-top:30rpx;"></view>
- <view class="flex justify-between margin-top-lg">
- <view style="width: 120upx;font-weight: bold;">合计</view>
- <view class="" style="color: #FF6E98;">¥<text style="font-size: 40rpx;font-weight: bold;">{{order.sumMoney}}</text></view>
- </view>
- </view>
- </view>
- <!-- <view class="bg padding radius margin-top-sm">
- <view class="text-lg text-bold">
- 服务信息
- </view>
- <view class="margin-right-xs">
- <view class="flex justify-between margin-top-lg">
- <view style="width: 170rpx;">服务时间</view>
- <view class="">
- <text>{{order.serveTime}}</text>
- </view>
- </view>
- <view class="flex justify-between margin-top-lg">
- <view style="width: 170rpx;">服务地点</view>
- <view class="flex" @tap="bindGps(order.latitude,order.longitude,order.address)">
- <view class="">
- {{order.address}}
- <image src="../../static/images/address.png" style="width: 13px;height: 15px;"></image>
- </view>
- </view>
- </view>
- <view class="flex justify-between margin-top-lg">
- <view style="width: 170rpx;">联系方式</view>
- <view class="" @click="bindphone(order.phone)">
- {{order.phone}}
- <image src="../../static/images/phone.png" style="width: 15px;height: 15px;"></image>
- </view>
- </view>
- <view class="flex justify-between margin-top-lg" v-if="order.remark">
- <view style="width: 170rpx;">备注内容</view>
- <view class="flex">
- <view class="">
- {{order.remark}}
- </view>
- </view>
- </view>
- </view>
- </view> -->
- <view class="flex tabber padding-top-sm padding-bottom-sm align-center">
- <u-button @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="false"
- v-if="(order.status == 1 || order.status == 2 || order.status == 7 || order.status == 8) && yhqxSel != '否'">取消订单
- </u-button>
- <u-button @click="openpay()" shape="circle" :custom-style="customStyle2" :hair-line="false"
- v-if="order.status == 1">立即支付
- </u-button>
- <!-- <u-button @click="cancel(order)" class="margin-right" shape="circle" :custom-style="customStyle2"
- :hair-line="false" v-if="order.status == 6">订单完成
- </u-button> -->
- <u-button v-if="order.status == 2 || order.status == 5|| order.status == 3" :custom-style="customStyle"
- shape="circle" :plain="true"
- @click="goNav('/my/order/complain?ordersId='+ordersId + '&byUserId=' + order.artificer.userId + '&byuserName=' + order.artificer.artificerName)">
- 去投诉
- </u-button>
- <u-button v-if="order.status == 3" :custom-style="customStyle2" shape="circle" :plain="true"
- @click="goNav('/my/order/feedback?artificerId='+order.artificerId+ '&ordersId='+order.ordersMassageList[0].ordersId)">
- 去评价
- </u-button>
- <u-button :custom-style="customStyle2" shape="circle" :plain="true" @click="goChat">联系客服</u-button>
- </view>
- </view>
- <u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>
- <u-popup v-model="showorder" mode="bottom" :closeable="closeable">
- <scroll-view scroll-y="true" style="width: 750rpx;height: 500rpx;">
- <view class="list_item" v-for="(item,index) in orderList" :key="index">
- <image :src="item.massageImg"></image>
- <view class="listitem_rightview">
- <view class="titleview">
- <view class="item_title">{{item.title}}</view>
- <view class="item_yishou">已售{{item.sales}}</view>
- </view>
- <view class="flex flex-wrap" style="margin-top: 10rpx;" v-if="item.labels.length>0">
- <text class="margin-bottom-xs box" v-for="(items,index) in item.labels"
- :key="index">{{items}}</text>
- </view>
- <view class="btnview">
- <view class="item_money"> <text style="font-size: 24upx;">¥</text> <text
- v-if="isVip">{{item.memberPrice}}</text><text v-if="!isVip">{{item.price}}</text>
- /<text style="font-weight: 500;font-size: 24upx; ">{{item.duration}}分钟</text></view>
- <view class="item_btn" @click="goOrder(item)">确认加钟</view>
- </view>
- </view>
- </view>
- </scroll-view>
- </u-popup>
- <!-- 支付方式 -->
- <u-popup v-model="showpay" mode="bottom" :closeable="closeable">
- <view class="popup_pay">
- <view style="background-color: #fff;">
- <view style="padding: 0 20upx;margin-top: 60rpx;margin-bottom: 20rpx;">
- <view
- style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
- v-for="(item,index) in openLists" :key='index'>
- <image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
- </image>
- <view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
- {{item.text}}
- </view>
- <radio-group name="openWay" style="margin-left: 45upx;" @tap='selectWay(item)'>
- <label class="tui-radio">
- <radio color="#FF6E98" :checked="openWay === item.id ? true : false" />
- </label>
- </radio-group>
- </view>
- </view>
- </view>
- <view class="pay_btn" @click="pay()">确认支付</view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- tordersId: '',
- tpayMoney: '',
- paySel: 0,
- showorder: false,
- orderList: [],
- loading: true,
- customStyle: {
- // backgroundColor: '#e5e5e5',
- // color: '#FFFFFF',
- // #ifdef MP-WEIXIN
- width: "214rpx",
- // #endif
- // #ifndef MP-WEIXIN
- width: '214rpx',
- // #endif
- margin: '0 10upx',
- },
- customStyle2: {
- fontWeight: 'bold',
- fontSize: '32rpx',
- backgroundColor: '#FF6E98',
- color: '#FFFFFF',
- // #ifdef MP-WEIXIN
- width: "214rpx",
- // #endif
- // #ifndef MP-WEIXIN
- width: '214rpx',
- // #endif
- margin: '0 10upx',
- },
- id: '',
- order: {
- user: {},
- game: {}
- },
- isTrue: 0,
- phone: '',
- isVip: false,
- birthDate: '',
- age: '',
- showpay: false,
- openLists: [],
- openWay: 1,
- closeable: true,
- yhqxSel: '否'
- }
- },
- onLoad(e) {
- uni.showLoading({
- title: '加载中......',
- })
- // setTimeout(() => {
- // // this.loading = false;
- // }, 2000)
- this.isTrue = e.isTrue
- if (this.isTrue) {
- uni.setNavigationBarTitle({
- title: '订单详情'
- })
- }
- this.ordersId = e.ordersId
- // this.getOrder()
- },
- onShow() {
- this.yhqxSel = this.$queue.getData("yhqxSel");
- this.getOrder()
- if (uni.getStorageSync('token')) {
- this.getIsVip()
- }
- // #ifndef MP-WEIXIN
- this.openLists = [{
- image: '../../static/images/icon_weixin.png',
- text: '微信支付',
- id: 2
- },
- // {
- // image: '../../static/images/zhifubao.png',
- // text: '支付宝支付',
- // id: 3
- // }, {
- // image: '../../static/images/lingqian.png',
- // text: '零钱支付',
- // id: 1
- // },
- ],
- this.openWay = 2;
- // #endif
- // #ifdef MP-WEIXIN
- this.openLists = [{
- image: '../../static/images/icon_weixin.png',
- text: '微信支付',
- id: 2
- }, {
- image: '../../static/images/lingqian.png',
- text: '零钱支付',
- id: 1
- }],
- this.openWay = 2;
- // #endif
- },
- methods: {
- goChat() {
- let kefu = this.$queue.getData('kefu'); // 用户端联系方式 1 手机号 2企业微信
- let kefuPhone = this.$queue.getData('kefuPhone');
- if (uni.getStorageSync('token')) {
- if (kefu == 1) {
- uni.makePhoneCall({
- phoneNumber: kefuPhone //仅为示例
- });
- } else if (kefu == 3) {
- uni.navigateTo({
- url: '/my/setting/customer'
- });
- } else {
- // #ifdef MP-WEIXIN
- let that = this
- try {
- wx.openCustomerServiceChat({
- extInfo: {
- url: that.$queue.getData('kefuUrl')
- },
- corpId: that.$queue.getData('kefuAppId'),
- success(res) {},
- fail(res) {
- console.error(res)
- }
- })
- } catch (error) {
- console.error("catchcatch" + error)
- uni.showToast({
- title: '请更新至微信最新版本'
- });
- }
- // #endif
- // #ifndef MP-WEIXIN
- let url = this.$queue.getData('kefuUrl');
- if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
- uni.navigateTo({
- url
- });
- } else {
- //#ifndef H5
- uni.navigateTo({
- url: '/pages/index/webView?url=' + url
- });
- //#endif
- //#ifdef H5
- window.location.href = url;
- //#endif
- }
- // #endif
- }
- } else {
- uni.showModal({
- title: '提示',
- content: '您还未登录,请先登录',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.navigateTo({
- url: '/pages/public/login'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- })
- }
- },
- copy(num) {
- uni.setClipboardData({
- data: num,
- success: r => {
- this.$queue.showToast('复制成功');
- }
- });
- },
- goOrder(item) {
- let that = this
- let payMoney = that.isVip ? item.memberPrice : item.price;
- let data = {
- parentId: that.order.ordersId,
- artificerId: that.order.artificerId,
- ordersMassageList: [{
- massageId: item.massageTypeId,
- num: 1,
- }],
- price: payMoney,
- couponId: '',
- payMoney: payMoney,
- userId: uni.getStorageSync('userId'),
- }
- that.$Request.postJson("/app/artificer/insertOrders", data).then(res => {
- that.showorder = false
- if (res.code == 0) {
- that.tordersId = res.data.ordersId;
- that.tpayMoney = payMoney;
- that.showpay = true;
- that.paySel = 1;
- } else {
- that.$queue.showToast(res.msg)
- }
- });
- },
- payJZ() {
- let that = this;
- if (that.openWay == 1) { //零钱支付
- uni.showModal({
- title: '付款提示',
- content: '确认支付' + that.tpayMoney + '元吗?',
- success: function(re) {
- if (re.confirm) {
- that.$queue.showLoading('支付中...')
- // console.log('用户点击确定');
- that.$Request.post("/app/artificer/payOrders", {
- ordersId: that.tordersId,
- }).then(ret => {
- uni.hideLoading();
- if (ret.code == 0) {
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- })
- that.getOrder()
- } else {
- uni.showToast({
- title: ret.msg,
- icon: 'none'
- })
- }
- });
- } else if (re.cancel) {
- that.getOrder()
- }
- }
- })
- } else if (that.openWay == 2) { //微信支付
- // #ifdef MP-WEIXIN
- let data = {
- ordersId: that.tordersId,
- type: 3
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(ret => {
- console.log(ret)
- if (ret.code == 0) {
- uni.hideLoading();
- uni.requestPayment({
- provider: 'wxpay',
- timeStamp: ret.data.timestamp,
- nonceStr: ret.data.noncestr,
- package: ret.data.package,
- signType: ret.data.signType,
- paySign: ret.data.sign,
- success: function(ret) {
- console.log(ret)
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- })
- that.getOrder()
- // this.$queue.showToast('支付成功');
- // uni.switchTab({
- // url: '/pages/my/index'
- // })
- },
- fail: function(err) {
- // this.$queue.showToast('支付失败');
- uni.showToast({
- title: '支付失败',
- icon: 'nones'
- });
- that.getOrder()
- }
- });
- }
- });
- // #endif
- // #ifdef H5
- let ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf('micromessenger') != -1) {
- let data = {
- ordersId: that.tordersId,
- type: 2
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- that.showpay = false
- if (rea.code == 0) {
- that.callPay(rea.data);
- } else {
- uni.showToast({
- title: rea.msg,
- icon: 'none'
- })
- }
- });
- } else {
- let data = {
- ordersId: that.tordersId,
- type: 4
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- that.showpay = false
- if (rea.code == 0) {
- const urlArr = window.location.href;
- const hostUrl = urlArr.split("/");
- const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
- const url = '&redirect_url=' + callBack + 'my/order/pay';
- window.location = rea.data.mweb_url + url
- } else {
- uni.showToast({
- title: rea.msg,
- icon: 'none'
- })
- }
- });
- }
- // #endif
- // #ifdef APP
- let data = {
- ordersId: that.order.ordersId,
- type: 1
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- console.log(rea)
- that.showpay = false
- if (rea.code == 0) {
- that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
- }
- });
- // #endif
- } else if (that.openWay == 3) { //支付宝支付
- // #ifdef H5
- let data = {
- ordersId: that.tordersId,
- type: 2
- }
- that.$Request.post('/app/aliPay/payOrder', data).then(
- rea => {
- that.showpay = false
- const div = document.createElement('div')
- div.innerHTML = rea.data //此处form就是后台返回接收到的数据
- document.body.appendChild(div)
- document.forms[0].submit()
- });
- // #endif
- // #ifdef APP-PLUS
- let data = {
- ordersId: that.tordersId,
- type: 1
- }
- that.$Request.post('/app/aliPay/payOrder', data).then(
- rea => {
- that.showpay = false
- that.setPayment('alipay', rea.data);
- });
- // #endif
- }
- },
- saveJZ(classifyId) {
- let data = {
- parentId: classifyId,
- page: 1,
- limit: 50,
- status: 1
- }
- let that = this;
- this.$queue.showLoading('查询中...')
- that.$Request.get("/app/artificer/selectMassageTypePage", data).then(res => {
- if (res.code == 0) {
- if (res.data.list && res.data.list.length > 0) {
- that.orderList = res.data.list
- for (let i = 0; i < that.orderList.length; i++) {
- if (that.orderList[i].labels) {
- that.orderList[i].labels = that.orderList[i].labels.split(",");
- }
- }
- uni.hideLoading();
- that.showorder = true;
- } else {
- uni.hideLoading();
- that.$queue.showToast('暂无可加钟项目');
- }
- } else {
- uni.hideLoading();
- that.$queue.showToast(res.msg);
- }
- })
- },
- //支付选择
- selectWay: function(item) {
- this.openWay = item.id;
- },
- //换算年龄
- getAge(e) {
- console.log('出生日期:' + e)
- this.birthDate = e
- //创建系统日期
- var today = new Date();
- //把出生日期转换成日期
- this.birthDate = new Date(this.birthDate);
- //分别获取到年份后相减
- this.age = today.getFullYear() - this.birthDate.getFullYear();
- // console.log(this.age+'当前年龄')
- },
- // 修改订单地址
- undateAdd(order) {
- if (order.state == 0) {
- uni.navigateTo({
- url: '../address/address?order=' + order.ordersId + '&id=' + 3
- })
- }
- },
- // 一键导航
- bindGps(latitude, longitude, name, detailsadd) {
- console.log(latitude, longitude, name, detailsadd)
- uni.openLocation({
- latitude: latitude - 0, //要去的纬度-地址
- longitude: longitude - 0, //要去的经度-地址
- name: name, //地址名称
- address: detailsadd, //详细地址名称
- success: function() {
- console.log('导航成功');
- },
- fail: function(error) {
- console.log(error)
- }
- });
- },
- ysPhone(phoneA, phoneB) {
- this.$Request.getT('/app/user/insertVirtualPhone?phoneA=' + phoneA + '&phoneB=' + phoneB).then(res => {
- if (res.code == 0) {
- this.order.artificer.phone = res.data;
- }
- });
- },
- // 拨打电话
- bindphone(phone) {
- let that = this
- uni.showModal({
- title: '提示',
- content: '是否拨打电话',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定', phone);
- uni.makePhoneCall({
- phoneNumber: phone //仅为示例
- });
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- goNav(e) {
- uni.navigateTo({
- url: e
- })
- },
- getOrder() {
- let data = {
- ordersId: this.ordersId
- }
- this.$Request.get('/app/artificer/selectOrdersDetails', data).then(res => {
- if (res.code == 0) {
- this.loading = false
- uni.hideLoading()
- this.order = res.data
- let aliphone = this.$queue.getData('aliphone');
- if (aliphone === '是' && this.order.artificer) {
- this.ysPhone(this.order.phone, this.order.artificer.phone);
- }
- }
- })
- },
- delOrder(e) {
- let that = this
- uni.showModal({
- title: '提示',
- content: '确定删除订单吗?',
- success: function(res) {
- if (res.confirm) {
- let data = {
- ordersId: e.ordersId,
- }
- that.$queue.showLoading('删除中...')
- that.$Request.post('/app/artificer/removeOrders', data).then(res => {
- uni.hideLoading();
- if (res.code == 0) {
- uni.showToast({
- name: "删除成功"
- })
- uni.navigateBack()
- } else {
- that.$queue.showToast(res.msg);
- }
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- getIsVip() {
- this.$Request.get("/app/UserVip/isUserVip").then(res => {
- if (res.code == 0) {
- this.isVip = res.data
- uni.setStorageSync('isVIP', res.data)
- }
- });
- },
- openpay() {
- this.showpay = true
- },
- // 支付订单
- pay() {
- let that = this
- this.showpay = false
- if (this.paySel != 0) {
- this.payJZ();
- return;
- }
- if (that.openWay == 1) { //零钱支付
- uni.showModal({
- title: '付款提示',
- content: '确认支付' + that.order.payMoney + '元吗?',
- success: function(re) {
- if (re.confirm) {
- that.$queue.showLoading('支付中...')
- console.log('用户点击确定');
- that.$Request.post("/app/artificer/payOrders", {
- ordersId: that.order.ordersId,
- }).then(res => {
- uni.hideLoading();
- if (res.code == 0) {
- uni.showToast({
- title: '支付成功'
- })
- that.getOrder()
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- }
- });
- } else if (re.cancel) {
- uni.hideLoading();
- console.log('用户点击取消');
- }
- }
- })
- } else if (that.openWay == 2) { //微信支付
- that.$queue.showLoading('支付中...')
- // #ifdef MP-WEIXIN
- let data = {
- ordersId: that.order.ordersId,
- type: 3
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(ret => {
- console.log(ret)
- if (ret.code == 0) {
- uni.hideLoading();
- uni.requestPayment({
- provider: 'wxpay',
- timeStamp: ret.data.timestamp,
- nonceStr: ret.data.noncestr,
- package: ret.data.package,
- signType: ret.data.signType,
- paySign: ret.data.sign,
- success: function(ret) {
- console.log(ret)
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- })
- that.getOrder()
- // this.$queue.showToast('支付成功');
- // uni.switchTab({
- // url: '/pages/my/index'
- // })
- },
- fail: function(err) {
- // this.$queue.showToast('支付失败');
- uni.showToast({
- title: '支付失败',
- icon: 'nones'
- });
- that.getOrder()
- }
- });
- }
- });
- // #endif
- // #ifdef H5
- let ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf('micromessenger') != -1) {
- let data = {
- ordersId: that.order.ordersId,
- type: 2
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- that.showpay = false
- if (rea.code == 0) {
- that.callPay(rea.data);
- } else {
- uni.showToast({
- title: rea.msg,
- icon: 'none'
- })
- }
- });
- } else {
- let data = {
- ordersId: that.order.ordersId,
- // type: 4
- type: 2
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- // const urlArr = window.location.href;
- // const hostUrl = urlArr.split("/");
- // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
- // const url = '&redirect_url=' + callBack + 'my/order/pay';
- // window.location = rea.mweb_url + url
- that.showpay = false
- if (rea.code == 0) {
- const urlArr = window.location.href;
- const hostUrl = urlArr.split("/");
- const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
- const url = '&redirect_url=' + callBack + 'my/order/pay';
- window.location = rea.data.mweb_url + url
- // window.location = callBack+'my/order/pay'
- } else {
- uni.showToast({
- title: rea.msg,
- icon: 'none'
- })
- }
- });
- }
- // #endif
- // #ifdef APP
- let data = {
- ordersId: that.order.ordersId,
- type: 1
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- console.log(rea)
- that.showpay = false
- if (rea.code == 0) {
- that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
- }
- });
- // #endif
- } else if (that.openWay == 3) { //支付宝支付
- that.$queue.showLoading('支付中...')
- // #ifdef H5
- let data = {
- ordersId: that.order.ordersId,
- type: 2
- }
- that.$Request.post('/app/aliPay/payOrder', data).then(
- rea => {
- const div = document.createElement('div')
- div.innerHTML = rea.data //此处form就是后台返回接收到的数据
- document.body.appendChild(div)
- document.forms[0].submit()
- });
- // #endif
- // #ifdef APP-PLUS
- let data = {
- ordersId: that.order.ordersId,
- type: 1
- }
- that.$Request.post('/app/aliPay/payOrder', data).then(
- rea => {
- that.setPayment('alipay', rea.data);
- });
- // #endif
- }
- },
- callPay: function(response) {
- if (typeof WeixinJSBridge === "undefined") {
- if (document.addEventListener) {
- document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
- } else if (document.attachEvent) {
- document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
- document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
- }
- } else {
- this.onBridgeReady(response);
- }
- },
- onBridgeReady: function(response) {
- let that = this;
- if (!response.package) {
- return;
- }
- WeixinJSBridge.invoke(
- 'getBrandWCPayRequest', {
- "appId": response.appid, //公众号名称,由商户传入
- "timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
- "nonceStr": response.noncestr, //随机串
- "package": response.package,
- "signType": response.signType, //微信签名方式:
- "paySign": response.sign //微信签名
- },
- function(res) {
- if (res.err_msg === "get_brand_wcpay_request:ok") {
- // 使用以上方式判断前端返回,微信团队郑重提示:
- //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
- uni.hideLoading();
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- })
- that.getOrder()
- } else {
- uni.hideLoading();
- }
- WeixinJSBridge.log(response.err_msg);
- }
- );
- },
- isCheckPay(code, name, order) {
- if (code == 0) {
- this.setPayment(name, order);
- } else {
- uni.hideLoading();
- uni.showToast({
- title: '支付信息有误'
- });
- }
- },
- setPayment(name, order) {
- let that = this
- uni.requestPayment({
- provider: name,
- orderInfo: order, //微信、支付宝订单数据
- success: function(res) {
- uni.hideLoading();
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- })
- that.getOrder()
- },
- fail: function(err) {
- uni.hideLoading();
- },
- complete() {
- uni.hideLoading();
- }
- });
- },
- // 取消订单
- cancelOrder(e) {
- let contentName = '';
- let closeKC = this.$queue.getData('closeKC');
- if (e.status == 7 || e.status == 8 && closeKC) {
- let money = parseFloat(parseFloat(e.price) * parseFloat(closeKC)).toFixed(2);
- contentName = '取消订单将扣除' + money + '元的手续费,并且车费将全部扣除!';
- }
- let that = this
- uni.showModal({
- title: '温馨提示',
- content: '是否确认取消订单?' + contentName,
- success: function(res) {
- if (res.confirm) {
- let data = {
- ordersId: e.ordersId
- }
- that.$queue.showLoading('提交中...')
- that.$Request.post('/app/artificer/deleteOrders', data).then(res => {
- uni.hideLoading();
- if (res.code == 0) {
- that.getOrder()
- } else {
- that.$queue.showToast(res.msg);
- }
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- // 完成订单
- cancel(e) {
- let that = this
- uni.showModal({
- title: '提示',
- content: '确认完成订单吗?',
- success: function(res) {
- if (res.confirm) {
- let data = {
- ordersId: e.ordersId,
- }
- that.$queue.showLoading('提交中...')
- that.$Request.post('/app/artificer/accomplishOrders', data).then(res => {
- uni.hideLoading();
- if (res.code == 0) {
- uni.navigateBack()
- } else {
- that.$queue.showToast(res.msg);
- }
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- goMsg() {
- let data = {
- userId: uni.getStorageSync('userId'),
- focusedUserId: this.order.user.userId
- }
- this.$Request.postJson('/app/chat/insertChatConversation ', data).then(res => {
- if (res.code == 0) {
- let id = this.order.user.userId == res.data.userId ? res.data.focusedUserId : this.order
- .user.userId
- uni.navigateTo({
- url: '/pages/msg/im?chatConversationId=' + res.data.chatConversationId +
- '&byUserId=' + id
- })
- }
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background: #f7f7f7;
- }
- .bg {
- background: #FFFFFF;
- }
- .content{
- background: #FFFFFF;
- border-radius: 32rpx 32rpx 32rpx 32rpx;
- padding: 24rpx;
- margin-bottom: 20rpx;
- }
- .label{
- font-size: 28rpx;
- color: #AAAAAA;
- }
- .list_item {
- // width: 650upx;
- // height: 160upx;
- width: 92%;
- // margin: 30rpx 0;
- background: #FFFFFF;
- border-radius: 24upx;
- padding: 20upx;
- display: flex;
- margin-top: 26upx;
- .listitem_rightview {
- margin-left: 20upx;
- width: 80%;
- padding-top: 10rpx;
- .btnview {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 12upx;
- width: 100%;
- }
- .titleview {
- display: flex;
- align-items: flex-end;
- justify-content: space-between
- }
- .moneyview {
- display: flex;
- align-items: flex-end;
- image {
- width: 30upx;
- height: 30upx;
- margin-left: 20upx;
- margin-bottom: 2upx;
- }
- }
- .item_time {
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- margin-left: 10upx;
- }
- .item_money {
- font-size: 32upx;
- font-family: PingFang SC;
- font-weight: 800;
- color: #FF1200;
- }
- .item_oldmoney {
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- text-decoration: line-through;
- color: #999999;
- margin-left: 10upx;
- }
- .item_btn {
- width: 140upx;
- height: 56upx;
- background: #2FB57A;
- border-radius: 16upx;
- text-align: center;
- line-height: 56upx;
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- }
- .item_yishou {
- font-size: 22upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- .item_title {
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #1E1F31;
- }
- }
- image {
- width: 220upx;
- height: 160upx;
- border-radius: 24upx;
- }
- }
- .jz_btn {
- width: 200rpx;
- height: 64rpx;
- background: linear-gradient( 313deg, #FFE6EE 0%, #FFBACA 100%);
- border-radius: 36rpx;
- line-height: 64rpx;
- text-align: center;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #222222;
- }
- .tabber {
- width: 100%;
- background: #ffffff;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- justify-content: flex-end;
- height: 127rpx;
- padding-right: 30rpx;
- }
- .box {
- /* border: 1px solid #005dff; */
- background: #E8FAE1;
- border-radius: 4rpx;
- color: #2FB57A;
- padding: 5upx 10upx;
- font-size: 22rpx;
- margin-top: 10rpx;
- }
- .popup_pay {
- width: 100%;
- position: relative;
- padding-bottom: 45rpx;
- /* height: 160px; */
- /* #ifndef MP-WEIXIN */
- /* height: 130px; */
- /* #endif */
- }
- .pay_btn {
- width: 90%;
- margin: 0 auto;
- text-align: center;
- background: linear-gradient( 313deg, #FFE6EE 0%, #FFBACA 100%);
- height: 80rpx;
- border-radius: 16rpx;
- color: #222222;
- line-height: 80rpx;
- }
- </style>
|