@@ -72,8 +72,8 @@ | |||
"js-base64": "^3.7.2", | |||
"regenerator-runtime": "^0.12.1", | |||
"uview-ui": "^2.0.29", | |||
"vue": "^2.6.11", | |||
"vuex": "^4.0.2" | |||
"vue": "^2.7.14", | |||
"vuex": "^3.6.2" | |||
}, | |||
"devDependencies": { | |||
"@babel/runtime": "~7.12.0", | |||
@@ -43,5 +43,14 @@ export default { | |||
method: 'POST', | |||
interfaceType: 0 | |||
}); | |||
} | |||
}, | |||
//退单退券 | |||
onRebackcoupon(data) { | |||
return request({ | |||
url: '/api/coupon/rebackcoupon', | |||
data: data, | |||
method: 'POST', | |||
interfaceType: 0 | |||
}); | |||
}, | |||
} |
@@ -1,5 +1,5 @@ | |||
{ | |||
"name" : "海科智慧餐厨", | |||
"name" : "矮香牛牛肉工坊", | |||
"appid" : "__UNI__DBF567E", | |||
"description" : "", | |||
"versionName" : "1.0.0", | |||
@@ -54,7 +54,7 @@ | |||
"quickapp" : {}, | |||
/* 快应用特有相关 */ | |||
"mp-weixin" : { | |||
"appid" : "wx67f7399628986bfb", | |||
"appid" : "wx7b22d4c9ca5b68d6", | |||
"setting" : { | |||
"urlCheck" : false | |||
}, | |||
@@ -1,22 +1,30 @@ | |||
{ | |||
"pages": [ | |||
{ | |||
"path" : "pages/homeNew/homeNew", | |||
"path" : "pages/welcome/welcome", | |||
"style" : | |||
{ | |||
"navigationBarTitleText": "首页", | |||
"enablePullDownRefresh": false | |||
"navigationBarTitleText": "", | |||
"enablePullDownRefresh": false, | |||
"navigationStyle": "custom" | |||
} | |||
}, | |||
{ | |||
"path" : "pages/welcome/welcome", | |||
"path" : "pages/homeNew/homeNew", | |||
"style" : | |||
{ | |||
"navigationBarTitleText": "", | |||
"enablePullDownRefresh": false, | |||
"navigationStyle": "custom" | |||
"navigationBarTitleText": "首页", | |||
"enablePullDownRefresh": false | |||
} | |||
}, | |||
// { | |||
// "path" : "pages/homeBeefWorkShop/homeBeefWorkShop", | |||
// "style" : | |||
// { | |||
// "navigationBarTitleText": "首页", | |||
// "enablePullDownRefresh": false | |||
// } | |||
// }, | |||
{ | |||
"path" : "pages/home/home", | |||
"style" : | |||
@@ -318,16 +326,7 @@ | |||
"enablePullDownRefresh": false | |||
} | |||
}, | |||
{ | |||
"path" : "pages/homeBeefWorkShop/homeBeefWorkShop", | |||
"style" : | |||
{ | |||
"navigationBarTitleText": "首页", | |||
"enablePullDownRefresh": false | |||
} | |||
} | |||
} | |||
,{ | |||
"path" : "pages/foodReservation/foodReservation", | |||
"style" : | |||
@@ -453,10 +453,11 @@ | |||
} | |||
if(realMoney > 0) { | |||
let response = await orderAPI.newOrder(jsonData); | |||
if (response.isSuccess == true) { | |||
if (response.isSuccess) { | |||
store.commit('onInitAdvancePrice', realMoney); | |||
store.commit('onInitOrderNumber', orderNumber); | |||
this.userAutoActivityJson.ActivitySceneValue = orderNumber; | |||
store.commit('onInitOrderNumber', response.data[0]); | |||
store.commit('onSetCurrentNewOrder', jsonData); | |||
this.userAutoActivityJson.ActivitySceneValue = response.data[0]; | |||
store.commit('onInitUserAutoActivityJson', JSON.parse(JSON.stringify(this.userAutoActivityJson))); | |||
uni.redirectTo({ | |||
url: '/pages/payment/payment' | |||
@@ -145,7 +145,7 @@ | |||
}); | |||
store.commit('initFoodArray', foodTypes); | |||
setTimeout(() => { | |||
this.$refs.goodsListRef.getNodeInfo(); | |||
this.$refs.goodsListRef?.getNodeInfo(); | |||
}, 100); | |||
} else { | |||
store.commit('initFoodArray', []); | |||
@@ -284,78 +284,108 @@ | |||
}, | |||
//售后/退单 | |||
async onApplyAfterSale() { | |||
if (this.onFilterOrderState > 0 && this.onFilterOrderState != 99999) { | |||
let jsonData = { | |||
"reason": "用户主动点击售后", | |||
"isFullApplay": true, | |||
"orderId": this.order.id, | |||
} | |||
let response = await orderAPI.applySaleAfter(jsonData); | |||
if (response.isSuccess == true) { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
this.onFetchOrderInfo(); | |||
}, 1000); | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} else if (this.onFilterOrderState == 0 || this.onFilterOrderState == 99999) { | |||
let jsonData = { | |||
"appId": getApp().globalData.appId, | |||
"orderNumberId": this.order.orderNumber | |||
} | |||
const response = await payAPI.wechatrefund(jsonData); | |||
if (response.statusCode == 200 && response.data.res == true) { | |||
let wechatRes = response.data.response; | |||
let jsonData = { | |||
"transactionId": wechatRes.transactionId, | |||
"refundTradeNo": wechatRes.outRefundNo, | |||
"isSuccess": 1, | |||
"refundMomey": wechatRes.refundFee / 100, | |||
"remark": "未制作直接退款" | |||
} | |||
const refundRes = await orderAPI.refundrefuc(jsonData); | |||
if (refundRes.isSuccess == true) { | |||
uni.showToast({ | |||
title: '退款成功', | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
this.onFetchOrderInfo(); | |||
}, 1000); | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: refundRes.msg || '退款出现未知错误', | |||
duration: 2000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
let jsonData = { | |||
"reason": "用户主动点击售后", | |||
"isFullApplay": true, | |||
"orderId": this.order.id, | |||
} | |||
let response = await orderAPI.applySaleAfter(jsonData); | |||
if (response.isSuccess == true) { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
this.onFetchOrderInfo(); | |||
}, 1000); | |||
} | |||
} else { | |||
uni.showToast({ | |||
title: response.data.response.errCodeDes || '退款出现未知错误', | |||
duration: 2000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
// 根据商品制作状态退款改为 无论商品是哪种状态都直接走后台退款 | |||
// 因为 贵州矮香牛 上了不属于机器制作的菜品 产品经理王刚提出此项修改需求 | |||
// 修改时间:2023-3-17 09:48:52 | |||
// if (this.onFilterOrderState > 0 && this.onFilterOrderState != 99999) { | |||
// let jsonData = { | |||
// "reason": "用户主动点击售后", | |||
// "isFullApplay": true, | |||
// "orderId": this.order.id, | |||
// } | |||
// let response = await orderAPI.applySaleAfter(jsonData); | |||
// if (response.isSuccess == true) { | |||
// uni.showToast({ | |||
// title: response.msg, | |||
// duration: 1000, | |||
// icon: 'none', | |||
// mask: true, | |||
// complete: () => { | |||
// setTimeout(() => { | |||
// this.onFetchOrderInfo(); | |||
// }, 1000); | |||
// } | |||
// }); | |||
// } else { | |||
// uni.showToast({ | |||
// title: response.msg, | |||
// duration: 1000, | |||
// icon: 'none', | |||
// mask: true | |||
// }); | |||
// } | |||
// } | |||
// else if (this.onFilterOrderState == 0 || this.onFilterOrderState == 99999) { | |||
// let jsonData = { | |||
// "appId": getApp().globalData.appId, | |||
// "orderNumberId": this.order.orderNumber | |||
// } | |||
// const response = await payAPI.wechatrefund(jsonData); | |||
// if (response.statusCode == 200 && response.data.res == true) { | |||
// let wechatRes = response.data.response; | |||
// let jsonData = { | |||
// "transactionId": wechatRes.transactionId, | |||
// "refundTradeNo": wechatRes.outRefundNo, | |||
// "isSuccess": 1, | |||
// "refundMomey": wechatRes.refundFee / 100, | |||
// "remark": "未制作直接退款" | |||
// } | |||
// const refundRes = await orderAPI.refundrefuc(jsonData); | |||
// if (refundRes.isSuccess == true) { | |||
// uni.showToast({ | |||
// title: '退款成功', | |||
// duration: 1000, | |||
// icon: 'none', | |||
// mask: true, | |||
// complete: () => { | |||
// setTimeout(() => { | |||
// this.onFetchOrderInfo(); | |||
// }, 1000); | |||
// } | |||
// }); | |||
// } else { | |||
// uni.showToast({ | |||
// title: refundRes.msg || '退款出现未知错误', | |||
// duration: 2000, | |||
// icon: 'none', | |||
// mask: true | |||
// }); | |||
// } | |||
// } else { | |||
// uni.showToast({ | |||
// title: response.data.response.errCodeDes || '退款出现未知错误', | |||
// duration: 2000, | |||
// icon: 'none', | |||
// mask: true | |||
// }); | |||
// } | |||
// } | |||
}, | |||
//联系商家 | |||
onContactMerchant() { | |||
@@ -60,6 +60,7 @@ | |||
import payAPI from "@/api/pay.js"; | |||
import orderAPI from "@/api/order.js"; | |||
import activityAPI from "@/api/activity.js"; | |||
import couponAPI from "@/api/coupon.js"; | |||
import { debounce } from "@/utils/DebounceAndThrottle.js"; | |||
import { throttle } from "@/utils/DebounceAndThrottle.js"; | |||
import store from "@/store/index.js"; | |||
@@ -88,12 +89,41 @@ | |||
}, | |||
userExchangePriceJson() { | |||
return store.state.userExchangePriceJson; | |||
}, | |||
currentNewOrder() { | |||
return store.state.currentNewOrder; | |||
} | |||
}, | |||
onHide() { | |||
this.onReturnCoupon(); | |||
}, | |||
onUnload() { | |||
this.onReturnCoupon(); | |||
}, | |||
methods: { | |||
onCountDownFinish() { | |||
this.isFinished = true; | |||
}, | |||
//如果支付失败或者取消支付 自动退还用户的优惠券 | |||
async onReturnCoupon() { | |||
console.log('this.currentNewOrder', this.currentNewOrder); | |||
if (this.currentNewOrder && this.currentNewOrder.couponCustomerId) { | |||
const response = await couponAPI.onRebackcoupon({id: this.currentNewOrder.orderNumber}); | |||
if (response.isSuccess) { | |||
uni.showToast({ | |||
title: '优惠券已自动退还', | |||
duration: 2000, | |||
icon: 'none' | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: response.msg || '优惠券退还失败!', | |||
duration: 2000, | |||
icon: 'none' | |||
}); | |||
} | |||
} | |||
}, | |||
onConfirmPayment: debounce(async function() { | |||
if(this.isFinished == true) { | |||
uni.showToast({ | |||
@@ -119,6 +149,7 @@ | |||
success: async () => { | |||
let orderPayResponse = await orderAPI.orderPay(this.orderNumber); | |||
if (orderPayResponse.isSuccess == true) { | |||
store.commit('onSetCurrentNewOrder', null); | |||
uni.showToast({ | |||
title: orderPayResponse.msg || '支付成功', | |||
icon: 'none', | |||
@@ -17,8 +17,8 @@ | |||
data() { | |||
return { | |||
imageServer: getApp().globalData.imageServer, | |||
// welcomeLogo: 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/gz/applet/133064130026925378.png' | |||
welcomeLogo: 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/applet/133094239921335904.png' | |||
welcomeLogo: 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/gz/applet/133064130026925378.png' | |||
// welcomeLogo: 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/applet/133094239921335904.png' | |||
} | |||
}, | |||
computed: { | |||
@@ -34,18 +34,21 @@ | |||
}, | |||
onShareAppMessage(res) { | |||
return { | |||
title: this.currentStore.store_Name || '黑菠萝科技点餐小程序', | |||
title: this.currentStore.store_Name || '黑菠萝科技', | |||
path: '/pages/welcome/welcome', | |||
} | |||
}, | |||
onShareTimeline() { | |||
return { | |||
title: this.currentStore.store_Name || '黑菠萝科技点餐小程序', | |||
title: this.currentStore.store_Name || '黑菠萝科技', | |||
path: '/pages/welcome/welcome', | |||
} | |||
}, | |||
methods: { | |||
onToHome() { | |||
// uni.switchTab({ | |||
// url: '/pages/homeBeefWorkShop/homeBeefWorkShop' | |||
// }); | |||
uni.switchTab({ | |||
url: '/pages/homeNew/homeNew' | |||
}); | |||
@@ -43,7 +43,9 @@ const store = new Vuex.Store({ | |||
//用户加钱换购JSON数据 | |||
userExchangePriceJson: [], | |||
//门店风格 | |||
storeStyles: [] | |||
storeStyles: [], | |||
//当前创建的订单信息 | |||
currentNewOrder: null | |||
} | |||
}, | |||
getters: { | |||
@@ -291,6 +293,10 @@ const store = new Vuex.Store({ | |||
//设置门店风格 | |||
onSetStoreStyles(state, payload) { | |||
state.storeStyles = payload; | |||
}, | |||
//设置当前使用的优惠券 | |||
onSetCurrentNewOrder(state, payload) { | |||
state.currentNewOrder = payload; | |||
} | |||
} | |||
}); | |||
@@ -14,7 +14,7 @@ | |||
@import 'uview-ui/theme.scss'; | |||
/* 颜色变量 */ | |||
// #51A97D #135C31 | |||
$theme-color: #51A97D; | |||
$theme-color: #135C31; | |||
/* 行为相关颜色 */ | |||
$uni-color-primary: #007aff; | |||
@@ -1,19 +1,19 @@ | |||
import Encrypt from "./crypto.js"; | |||
let BASE_URL = ''; | |||
// BASE_URL = 'https://witt.black-pa.com'; //线上正式 | |||
BASE_URL = 'https://bpa.black-pa.com:21527'; //线上开发 | |||
// BASE_URL = 'https://bpa.black-pa.com:21528'; //线上测试 | |||
// BASE_URL = 'https://bpa.black-pa.com:21527'; //线上开发 | |||
BASE_URL = 'https://bpa.black-pa.com:21528'; //线上测试 | |||
const Franchisee = '/kitchen'; //加盟商:0 | |||
const Order = '/order'; //订单: 1 | |||
const Pay = '/wechat/'; //支付: 2 | |||
const accountInfo = uni.getAccountInfoSync(); | |||
if (accountInfo.miniProgram.envVersion === 'trial') { | |||
BASE_URL = 'https://bpa.black-pa.com:21528'; | |||
} else if (accountInfo.miniProgram.envVersion === 'release') { | |||
BASE_URL = 'https://witt.black-pa.com'; | |||
} | |||
// if (accountInfo.miniProgram.envVersion === 'trial') { | |||
// BASE_URL = 'https://bpa.black-pa.com:21528'; | |||
// } else if (accountInfo.miniProgram.envVersion === 'release') { | |||
// BASE_URL = 'https://witt.black-pa.com'; | |||
// } | |||
const request = (options) => { | |||
let BlackApp = Encrypt(`[${options.url}]_[${new Date().getTime()}]`); | |||
@@ -42,16 +42,17 @@ const request = (options) => { | |||
if (options.url !== '/api/StoreHelper/GetAllStore') { | |||
TenantId = getApp().globalData.companyId; | |||
} | |||
if (accountInfo.miniProgram.envVersion === 'trial') { | |||
// 体验版:测试环境:贵州 78d635f7-8ee4-4be4-b26a-462016196826 | |||
TenantId = '78d635f7-8ee4-4be4-b26a-462016196826'; | |||
} else if (accountInfo.miniProgram.envVersion === 'release') { | |||
// 正式版:正式环境:海科 01911b43-8844-4d93-b916-34208e31ba66 | |||
TenantId = '01911b43-8844-4d93-b916-34208e31ba66'; | |||
} else { | |||
// 开发版:开发环境:银泰 68d4de9c-a277-4d7a-a192-e9fa91327d41 | |||
TenantId = '68d4de9c-a277-4d7a-a192-e9fa91327d41'; | |||
} | |||
// if (accountInfo.miniProgram.envVersion === 'trial') { | |||
// // 体验版:测试环境:贵州 78d635f7-8ee4-4be4-b26a-462016196826 | |||
// // 正式环境贵州: a7c18ca4-04eb-4bfe-a272-3104f2d84ff1 | |||
// TenantId = '78d635f7-8ee4-4be4-b26a-462016196826'; | |||
// } else if (accountInfo.miniProgram.envVersion === 'release') { | |||
// // 正式版:正式环境:海科 01911b43-8844-4d93-b916-34208e31ba66 | |||
// TenantId = 'a7c18ca4-04eb-4bfe-a272-3104f2d84ff1'; | |||
// } else { | |||
// // 开发版:开发环境:银泰 68d4de9c-a277-4d7a-a192-e9fa91327d41 | |||
// TenantId = '68d4de9c-a277-4d7a-a192-e9fa91327d41'; | |||
// } | |||
uni.request({ | |||
url: BASE_URL + interfaceType + options.url, | |||
method: options.method || 'GET', | |||
@@ -59,7 +60,7 @@ const request = (options) => { | |||
header: Object.assign({}, options.header, { | |||
'BlackApp': BlackApp, | |||
'AppId': getApp().globalData.appId, | |||
'TenantId': TenantId , | |||
'TenantId': '68d4de9c-a277-4d7a-a192-e9fa91327d41' || TenantId , | |||
}), | |||
timeout: 20000, | |||
success: response => { | |||