|
|
- export default {
- data() {
- return {}
- },
- methods: {
- // 确认接单
- confirmVipOrder(order, callback, ...args) {
- this.$comfirm('确认接单?确认后不可取消哦~', () => {
- this.$api('confirmVipOrder', {
- orderId: order.id
- }, res => {
- if (res.code == 200) {
- uni.showToast({
- mask: true,
- duration: 1000,
- title: res.message,
- });
- callback && callback(...args)
- }
- })
- })
- },
- // 技师出发
- startVipOrder(order, callback, ...args) {
- this.$comfirm('确认出发?出发后需按指定时间到达', () => {
- this.$api('startVipOrder', {
- orderId: order.id
- }, res => {
- if (res.code == 200) {
- uni.showToast({
- mask: true,
- duration: 1000,
- title: res.message,
- });
- callback && callback(...args)
- }
- }, true)
- })
- },
- // 技师到达
- arriveVipOrder(order, callback, ...args) {
- let self = this
-
- this.$comfirm('确认到达指定服务地址?', () => {
- uni.chooseImage({
- count: 1, // 默认9,设置为1表示单选
- sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
- sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
- success: (res) => {
- // tempFilePath可以作为img标签的src属性显示图片
- // 假设这里只选择了一个文件
-
- uni.showLoading({
- title: '正在提交...'
- });
-
- this.uploadFileToOSS(res.tempFiles[0]).then(imgPath => {
-
- this.$utils.getLocation(loca => {
- self.$api('arriveVipOrder', {
- orderId: order.id,
- ...loca,
- arrivalPicture: imgPath
- }, res => {
- if (res.code == 200) {
- uni.hideLoading();
- uni.showToast({
- mask: true,
- duration: 1000,
- title: res.message,
- });
- callback && callback(...args)
- }
- })
- })
- })
- }
- });
- })
- },
- // 开始服务
- startVipService(order, callback, ...args) {
- this.$comfirm('开始服务?', () => {
- this.$api('startVipService', {
- orderId: order.id
- }, res => {
- if (res.code == 200) {
-
- uni.showToast({
- mask: true,
- duration: 1000,
- title: res.message,
- });
- callback && callback(...args)
- }
- }, true)
- })
- },
- // 结束服务
- endVipService(order, callback, ...args) {
- let self = this
-
- this.$comfirm('确认结束服务?', () => {
- uni.chooseImage({
- count: 1, // 默认9,设置为1表示单选
- sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
- sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
- success: (res) => {
- // tempFilePath可以作为img标签的src属性显示图片
- // 假设这里只选择了一个文件
-
- uni.showLoading({
- title: '正在提交...'
- });
-
- this.uploadFileToOSS(res.tempFiles[0]).then(imgPath => {
- this.$api('endVipService', {
- orderId: order.id,
- endPicture: imgPath
- }, res => {
- if (res.code == 200) {
- uni.hideLoading();
- uni.showToast({
- mask: true,
- duration: 1000,
- title: res.message
- });
- callback && callback(...args)
- }
- })
- })
- }
- });
- })
- }
- }
- }
|