订单相关修改提测
This commit is contained in:
26
App.vue
26
App.vue
@@ -3,15 +3,30 @@
|
|||||||
<script>
|
<script>
|
||||||
import Api from '@/common/js/api.js'
|
import Api from '@/common/js/api.js'
|
||||||
export default {
|
export default {
|
||||||
|
globalData: {
|
||||||
|
systemInfo: null
|
||||||
|
},
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
|
if ( uni.getStorageSync("NAME") && !uni.getStorageSync("NAME").data) {
|
||||||
|
uni.cache.clear();
|
||||||
|
}
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
||||||
// #endif
|
// #endif
|
||||||
uni.cache.set('NAME', '零点八零');
|
uni.cache.set('NAME', '零点八零');
|
||||||
|
// this.$store.dispatch("loginEvent")
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
// 获取导航栏信息
|
||||||
|
|
||||||
|
wx.getSystemInfo({
|
||||||
|
success: res => {
|
||||||
|
this.globalData.systemInfo = res;
|
||||||
|
}
|
||||||
|
})
|
||||||
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 当向小程序后台请求完新版本信息,会进行回调。res: {hasUpdate: true, version: 1.0.0}
|
// 当向小程序后台请求完新版本信息,会进行回调。res: {hasUpdate: true, version: 1.0.0}
|
||||||
@@ -55,11 +70,22 @@
|
|||||||
if (!uni.cache.get('token')) {
|
if (!uni.cache.get('token')) {
|
||||||
// this.$store.dispatch("loginEvent"); //获取shapid
|
// this.$store.dispatch("loginEvent"); //获取shapid
|
||||||
uni.login({
|
uni.login({
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
|
// #endif
|
||||||
|
// #ifndef MP-ALIPAY
|
||||||
|
provider: 'alipay',
|
||||||
|
// #endif
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
uni.getUserInfo({
|
uni.getUserInfo({
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
|
// #endif
|
||||||
|
// #ifndef MP-ALIPAY
|
||||||
|
provider: 'alipay',
|
||||||
|
// #endif
|
||||||
success: async (infoRes) => {
|
success: async (infoRes) => {
|
||||||
|
console.log(infoRes)
|
||||||
uni.cache.set('weixincode', data.code);
|
uni.cache.set('weixincode', data.code);
|
||||||
let res = await Api.userwxlogin({
|
let res = await Api.userwxlogin({
|
||||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||||
|
|||||||
113
common/js/api.js
113
common/js/api.js
@@ -2,15 +2,20 @@ export default {
|
|||||||
userwxlogin(data) { //登录
|
userwxlogin(data) { //登录
|
||||||
return uni.api.post("/login/wx/custom/login", data);
|
return uni.api.post("/login/wx/custom/login", data);
|
||||||
},
|
},
|
||||||
|
loginwxuserInfo(data) { //获取用户详情
|
||||||
|
return uni.api.get("/login/userInfo", data);
|
||||||
|
},
|
||||||
userwxlogins(data) { // 获取手机号
|
userwxlogins(data) { // 获取手机号
|
||||||
return uni.api.post("/login/getPhoneNumber", data);
|
return uni.api.post("/login/getPhoneNumber", data);
|
||||||
},
|
},
|
||||||
loginapplogin(data) { //APP登录(登录即注册)
|
|
||||||
return uni.api.post("/login/app/login", data);
|
|
||||||
},
|
|
||||||
getShopExtend(data) { //获取图片 通过shopId和autokey
|
getShopExtend(data) { //获取图片 通过shopId和autokey
|
||||||
return uni.api.post("/common/shopExtend", data,false);
|
return uni.api.post("/common/shopExtend", data,false);
|
||||||
},
|
},
|
||||||
|
// 获取弹窗广告列表
|
||||||
|
getPopUpAd(data) {
|
||||||
|
return uni.api.get("/tbShopAd/list", data);
|
||||||
|
},
|
||||||
|
|
||||||
productqueryShop(data) { //通过桌码获取店铺信息
|
productqueryShop(data) { //通过桌码获取店铺信息
|
||||||
return uni.api.get("/product/queryShop", data);
|
return uni.api.get("/product/queryShop", data);
|
||||||
},
|
},
|
||||||
@@ -26,66 +31,61 @@ export default {
|
|||||||
cleanCart(data) { //清空购物车
|
cleanCart(data) { //清空购物车
|
||||||
return uni.api.post("/product/cleanCart", data);
|
return uni.api.post("/product/cleanCart", data);
|
||||||
},
|
},
|
||||||
// 下单详情
|
|
||||||
getproductorderConfirm(data) {
|
|
||||||
return uni.api.get("/product/orderConfirm", data);
|
|
||||||
},
|
|
||||||
// 会员支付
|
|
||||||
accountPay(data) {
|
|
||||||
return uni.api.get("/pay/accountPay", data);
|
|
||||||
},
|
|
||||||
// 下单
|
// 下单
|
||||||
creatGroupOrder(data) {
|
creatGroupOrder(data) {
|
||||||
return uni.api.post("/groupOrderInfo/creatGroupOrder", data);
|
return uni.api.post("/groupOrderInfo/creatGroupOrder", data);
|
||||||
},
|
},
|
||||||
cartadd(data) { //添加到购物车
|
|
||||||
return uni.api.post("/cart/add", data);
|
|
||||||
},
|
|
||||||
cartcartList(data) { //购物车
|
|
||||||
return uni.api.get("/cart/cartList", data);
|
|
||||||
},
|
|
||||||
logincreateCardNo(data) { //获取会员码
|
|
||||||
return uni.api.get("/login/createCardNo", data);
|
|
||||||
},
|
|
||||||
cartupdateNumber(data) { //购物车更改数量
|
|
||||||
return uni.api.get("/cart/updateNumber", data);
|
|
||||||
},
|
|
||||||
ordercreatOrder(data) { //下单
|
|
||||||
return uni.api.post("/order/creatOrder", data);
|
|
||||||
},
|
|
||||||
cartclear(data) { //清空购物车
|
|
||||||
return uni.api.get("/cart/clear", data);
|
|
||||||
},
|
|
||||||
payorderPay(data) { //订单支付
|
|
||||||
return uni.api.post("/pay/orderPay", data);
|
|
||||||
},
|
|
||||||
orderorderList(data) { //订单列表
|
|
||||||
return uni.api.get("/order/orderList", data);
|
|
||||||
},
|
|
||||||
// 团购订单列表
|
|
||||||
groupOrderInfo(data) { //订单列表
|
|
||||||
return uni.api.get("/groupOrderInfo/list", data);
|
|
||||||
},
|
|
||||||
orderorderInfo(data) { //订单回显
|
|
||||||
return uni.api.get("/order/orderInfo", data ,false);
|
|
||||||
},
|
|
||||||
groupOrderInfoDetail(data) { //订单回显
|
|
||||||
return uni.api.get("/groupOrderInfo/get", data);
|
|
||||||
},
|
|
||||||
loginwxuserInfo(data) { //用户详情
|
|
||||||
return uni.api.get("/login/userInfo", data);
|
|
||||||
},
|
|
||||||
paymemeberIn(data) { //充值
|
|
||||||
return uni.api.post("/pay/memeberIn", data);
|
|
||||||
},
|
|
||||||
// 支付
|
// 支付
|
||||||
payOrderPay(data) {
|
payOrderPay(data) {
|
||||||
return uni.api.post("/pay/groupOrderPay", data);
|
return uni.api.post("/pay/groupOrderPay", data);
|
||||||
},
|
},
|
||||||
|
// 下单详情
|
||||||
|
getproductorderConfirm(data) {
|
||||||
|
return uni.api.get("/product/orderConfirm", data);
|
||||||
|
},
|
||||||
|
|
||||||
|
logincreateCardNo(data) { //获取会员码
|
||||||
|
return uni.api.get("/login/createCardNo", data);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 会员支付
|
||||||
|
accountPay(data) {
|
||||||
|
return uni.api.get("/pay/accountPay", data);
|
||||||
|
},
|
||||||
|
payorderPay(data) { //订单支付
|
||||||
|
return uni.api.post("/pay/orderPay", data);
|
||||||
|
},
|
||||||
paymodfiyOrderInfo(data) { //查询订单支付状态
|
paymodfiyOrderInfo(data) { //查询订单支付状态
|
||||||
return uni.api.post("/pay/modfiyOrderInfo", data);
|
return uni.api.post("/pay/modfiyOrderInfo", data);
|
||||||
},
|
},
|
||||||
// 获取余额
|
|
||||||
|
orderorderList(data) { //订单列表
|
||||||
|
return uni.api.get("/order/orderList", data);
|
||||||
|
},
|
||||||
|
orderorderInfo(data) { //订单回显
|
||||||
|
return uni.api.get("/order/orderInfo", data ,false);
|
||||||
|
},
|
||||||
|
removeOrder(data) { //删除订单
|
||||||
|
return uni.api.post("/order/rmOrder", data);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 团购订单列表
|
||||||
|
groupOrderInfo(data) { //订单列表
|
||||||
|
return uni.api.get("/groupOrderInfo/list", data);
|
||||||
|
},
|
||||||
|
|
||||||
|
groupOrderInfoDetail(data) { //订单回显
|
||||||
|
return uni.api.get("/groupOrderInfo/get", data);
|
||||||
|
},
|
||||||
|
|
||||||
|
paymemeberIn(data) { //充值
|
||||||
|
return uni.api.post("/pay/memeberIn", data);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 获取店铺会员信息
|
||||||
shopUserInfo(data) {
|
shopUserInfo(data) {
|
||||||
return uni.api.get("/user/shopUserInfo", data);
|
return uni.api.get("/user/shopUserInfo", data);
|
||||||
},
|
},
|
||||||
@@ -97,10 +97,7 @@ export default {
|
|||||||
upVipPhont(data) {
|
upVipPhont(data) {
|
||||||
return uni.api.post("/user/upVipPhont", data);
|
return uni.api.post("/user/upVipPhont", data);
|
||||||
},
|
},
|
||||||
// 获取弹窗广告列表
|
|
||||||
getPopUpAd(data) {
|
|
||||||
return uni.api.get("/tbShopAd/list", data);
|
|
||||||
},
|
|
||||||
|
|
||||||
// 优惠券数量
|
// 优惠券数量
|
||||||
userCoupon(data) {
|
userCoupon(data) {
|
||||||
@@ -144,6 +141,10 @@ export default {
|
|||||||
ordermineCoupons(data) { //我的优惠券
|
ordermineCoupons(data) { //我的优惠券
|
||||||
return uni.api.get("/order/mineCoupons", data, false);
|
return uni.api.get("/order/mineCoupons", data, false);
|
||||||
},
|
},
|
||||||
|
getUserConpons(data) { //我的优惠券
|
||||||
|
return uni.api.post("/userConpons/find", data);
|
||||||
|
},
|
||||||
|
|
||||||
ordergetYhqPara(data) { //获取优惠券参数列表
|
ordergetYhqPara(data) { //获取优惠券参数列表
|
||||||
return uni.api.get("/order/getYhqPara", data);
|
return uni.api.get("/order/getYhqPara", data);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class webSocketUtils {
|
class webSocketUtils {
|
||||||
constructor(url, time, params) {
|
constructor(url, time, params) {
|
||||||
this.socketTask = null;
|
this.socketTask = false;
|
||||||
this.is_open_socket = false; //避免重复连接
|
this.is_open_socket = false; //避免重复连接
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.params = params ? params : null; ////是否初始化请求
|
this.params = params ? params : null; ////是否初始化请求
|
||||||
@@ -13,31 +13,41 @@ class webSocketUtils {
|
|||||||
this.heartbeatInterval = null; //检测服务器端是否还活着
|
this.heartbeatInterval = null; //检测服务器端是否还活着
|
||||||
this.reconnectTimeOut = null; //重连之后多久再次重连
|
this.reconnectTimeOut = null; //重连之后多久再次重连
|
||||||
try {
|
try {
|
||||||
|
|
||||||
return this.connectSocketInit({
|
return this.connectSocketInit({
|
||||||
data: this.params,
|
data: this.params,
|
||||||
type: 'connectSocketInit',
|
type: 'connectSocketInit',
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('catch');
|
// console.log('catch');
|
||||||
this.reconnect();
|
this.reconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||||
connectSocketInit(data) {
|
connectSocketInit(data) {
|
||||||
|
let _this = this;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.socketTask = uni.connectSocket({
|
|
||||||
|
uni.connectSocket({
|
||||||
url: this.url,
|
url: this.url,
|
||||||
success: () => {
|
header: {
|
||||||
// console.log('正准备建立websocket中...');
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
console.log('建立websocketc成功...');
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
// 返回实例
|
// 返回实例
|
||||||
return this.socketTask;
|
this.socketTask = true;
|
||||||
},
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.socketTask.onOpen((res) => {
|
|
||||||
|
uni.onSocketOpen((res) => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
this.connectNum = 1;
|
this.connectNum = 1;
|
||||||
// console.log('WebSocket连接正常!');
|
console.log('WebSocket连接正常!==',res);
|
||||||
if (this.params) { //是否初始化请求
|
if (this.params) { //是否初始化请求
|
||||||
this.send(this.params);
|
this.send(this.params);
|
||||||
}
|
}
|
||||||
@@ -47,17 +57,21 @@ class webSocketUtils {
|
|||||||
this.canReconnect = true;
|
this.canReconnect = true;
|
||||||
this.start();
|
this.start();
|
||||||
// 注:只有连接正常打开中 ,才能正常收到消息
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||||
this.socketTask.onMessage((e) => {
|
|
||||||
|
uni.onSocketMessage((e)=>{
|
||||||
// 字符串转json
|
// 字符串转json
|
||||||
let res = JSON.parse(e.data);
|
let res = JSON.parse(e.data);
|
||||||
uni.$emit('message', res)
|
uni.$emit('message', res)
|
||||||
// 普通socket信息处理 TODO
|
// 普通socket信息处理 TODO
|
||||||
});
|
});
|
||||||
|
},(res)=>{
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
});
|
});
|
||||||
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
||||||
uni.onSocketError((res) => {
|
uni.onSocketError((res) => {
|
||||||
console.log('网络断开,请检查!');
|
console.log('网络断开,请检查!');
|
||||||
this.socketTask = null;
|
this.socketTask = false;
|
||||||
this.is_open_socket = false;
|
this.is_open_socket = false;
|
||||||
// this.Close()
|
// this.Close()
|
||||||
this.canReconnect = true;
|
this.canReconnect = true;
|
||||||
@@ -97,11 +111,18 @@ class webSocketUtils {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 这里仅是事件监听【如果socket关闭了会执行】
|
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||||
this.socketTask.onClose(() => {
|
uni.onSocketClose((res) => {
|
||||||
this.socketTask = null;
|
console.log("socket关闭了")
|
||||||
|
this.socketTask = false;
|
||||||
clearInterval(this.heartbeatInterval);
|
clearInterval(this.heartbeatInterval);
|
||||||
clearInterval(this.reconnectTimeOut);
|
clearInterval(this.reconnectTimeOut);
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
// 支付宝小程序的ws连接问题,关闭连接时需关闭对于接受,防止关闭失败
|
||||||
|
uni.offSocketMessage();
|
||||||
|
uni.offSocketError();
|
||||||
|
uni.offSocketOpen();
|
||||||
|
uni.offSocketClose();
|
||||||
|
// #endif
|
||||||
this.is_open_socket = false;
|
this.is_open_socket = false;
|
||||||
if (this.canReconnect) {
|
if (this.canReconnect) {
|
||||||
this.reconnect();
|
this.reconnect();
|
||||||
@@ -113,26 +134,41 @@ class webSocketUtils {
|
|||||||
Close() {
|
Close() {
|
||||||
this.is_open_socket = true;
|
this.is_open_socket = true;
|
||||||
this.canReconnect = false;
|
this.canReconnect = false;
|
||||||
if (this.socketTask) {
|
// if (this.socketTask) {
|
||||||
this.socketTask.close({
|
uni.closeSocket({
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('手动关闭成功');
|
console.log('手动关闭成功');
|
||||||
|
this.socketTask = false;
|
||||||
|
clearInterval(this.heartbeatInterval);
|
||||||
|
clearInterval(this.reconnectTimeOut);
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
// 支付宝小程序的ws连接问题,关闭连接时需关闭对于接受,防止关闭失败
|
||||||
|
uni.offSocketMessage();
|
||||||
|
uni.offSocketError();
|
||||||
|
uni.offSocketOpen();
|
||||||
|
uni.offSocketClose();
|
||||||
|
// #endif
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
fail: (res) => {
|
||||||
|
console.log('手动关闭失败==',res);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
//发送消息
|
//发送消息
|
||||||
send(data) {
|
send(data) {
|
||||||
// console.log("发送消息---------->", data);
|
// console.log("发送消息---------->", data);
|
||||||
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
||||||
if (this.socketTask) {
|
// if (this.socketTask) {
|
||||||
this.socketTask.send({
|
uni.sendSocketMessage({
|
||||||
data: JSON.stringify(data),
|
data: JSON.stringify(data),
|
||||||
async success() {
|
success(res) {
|
||||||
// console.log("消息发送成功");
|
// console.log("消息发送成功");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
//开启心跳检测
|
//开启心跳检测
|
||||||
start(data) {
|
start(data) {
|
||||||
@@ -149,6 +185,7 @@ class webSocketUtils {
|
|||||||
//停止发送心跳
|
//停止发送心跳
|
||||||
clearInterval(this.heartbeatInterval);
|
clearInterval(this.heartbeatInterval);
|
||||||
//如果不是人为关闭的话,进行重连
|
//如果不是人为关闭的话,进行重连
|
||||||
|
console.log(!this.is_open_socket)
|
||||||
if (!this.is_open_socket) {
|
if (!this.is_open_socket) {
|
||||||
console.log('进行重连');
|
console.log('进行重连');
|
||||||
this.canReconnect = true;
|
this.canReconnect = true;
|
||||||
|
|||||||
@@ -70,7 +70,6 @@
|
|||||||
methods: {
|
methods: {
|
||||||
touchstart() {
|
touchstart() {
|
||||||
this.Time = setInterval(() => {
|
this.Time = setInterval(() => {
|
||||||
console.log(this.money);
|
|
||||||
if (this.money == '') {
|
if (this.money == '') {
|
||||||
clearInterval();
|
clearInterval();
|
||||||
}
|
}
|
||||||
@@ -82,7 +81,7 @@
|
|||||||
},
|
},
|
||||||
//处理按键
|
//处理按键
|
||||||
_handleKeyPress(e) {
|
_handleKeyPress(e) {
|
||||||
console.log('点击传e', e.target.dataset.num);
|
// console.log('点击传e', e.target.dataset.num);
|
||||||
let num = e.target.dataset.num;
|
let num = e.target.dataset.num;
|
||||||
//不同按键处理逻辑
|
//不同按键处理逻辑
|
||||||
// -1 代表无效按键,直接返回
|
// -1 代表无效按键,直接返回
|
||||||
@@ -141,8 +140,6 @@
|
|||||||
|
|
||||||
//处理数字
|
//处理数字
|
||||||
_handleNumberKey(num) {
|
_handleNumberKey(num) {
|
||||||
|
|
||||||
|
|
||||||
let S = this.money;
|
let S = this.money;
|
||||||
//如果有小数点且小数点位数不小于2
|
//如果有小数点且小数点位数不小于2
|
||||||
// if (S.indexOf('.') > -1 && S.substring(S.indexOf('.') + 1).length < 2)
|
// if (S.indexOf('.') > -1 && S.substring(S.indexOf('.') + 1).length < 2)
|
||||||
@@ -157,8 +154,6 @@
|
|||||||
// this.money = S + num;
|
// this.money = S + num;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
console.log(this.money)
|
|
||||||
console.log(this.money,this.money.length)
|
|
||||||
if (this.money.length == 6) {
|
if (this.money.length == 6) {
|
||||||
this.$emit('confirmEvent', this.money); //提交参数
|
this.$emit('confirmEvent', this.money); //提交参数
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -2,18 +2,22 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 导航栏 -->
|
<!-- 导航栏 -->
|
||||||
<view class="navbar" :class="{active:opacity}">
|
<view class="navbar" :class="{active:opacity}">
|
||||||
<!-- #ifndef APP-PLUS || MP-WEIXIN -->
|
<!-- #ifndef APP-PLUS || MP-WEIXIN || MP-ALIPAY -->
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<view class="navbar_tow flex-between"
|
<view class="navbar_tow 1 flex-between"
|
||||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<view class="navbar_tow flex-between">
|
<view class="navbar_tow 2 flex-between">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="navbar_tow flex-between"
|
<view class="navbar_tow 3 flex-between"
|
||||||
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<view class="navbar_tow 4 flex-between"
|
||||||
|
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.statusBar+'px','padding-right':menuButtonInfo.width+50 + 'px'}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- 标题搜索框 -->
|
<!-- 标题搜索框 -->
|
||||||
<view class="flex-between">
|
<view class="flex-between">
|
||||||
@@ -32,6 +36,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||||
|
console.log("menuButtonInfo==",menuButtonInfo)
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -48,9 +54,14 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
HeighT() { //手机类型的尺寸
|
HeighT() { //手机类型的尺寸
|
||||||
|
console.log("navHeighT==",this.$store.getters.is_BarHeight)
|
||||||
return this.$store.getters.is_BarHeight
|
return this.$store.getters.is_BarHeight
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
console.log(1)
|
||||||
|
console.log(uni.getMenuButtonBoundingClientRect())
|
||||||
|
},
|
||||||
methods: {}
|
methods: {}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -153,9 +164,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.navbar_tow_towinput {
|
.navbar_tow_towinput {
|
||||||
|
height: 64rpx;
|
||||||
padding-left: 32rpx;
|
padding-left: 32rpx;
|
||||||
padding-right: 116rpx;
|
padding-right: 116rpx;
|
||||||
height: 100%;
|
|
||||||
flex: auto;
|
flex: auto;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 34rpx;
|
border-radius: 34rpx;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="navbarcontent">
|
<view class="navbarcontent">
|
||||||
<!-- 导航栏 -->
|
<!-- 导航栏 -->
|
||||||
<view class="navbar" :class="{active:opacity}">
|
<view class="navbar" :class="{active:opacity}">
|
||||||
<!-- #ifndef APP-PLUS || MP-WEIXIN -->
|
<!-- #ifndef APP-PLUS || MP-WEIXIN || MP-ALIPAY -->
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<view class="navbar_tow flex-between"
|
<view class="navbar_tow flex-between"
|
||||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||||
@@ -13,13 +13,24 @@
|
|||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="navbar_tow flex-between"
|
<view class="navbar_tow flex-between"
|
||||||
:style="{'height':HeighT.customBar + ( (HeighT.heightBar - systemInfo.statusBarHeight)*2 )+'px','marginTop': ( HeighT.heightBar - (HeighT.heightBar - systemInfo.statusBarHeight))+'px','padding-right':HeighT.custwidth + 'px'}">
|
:style="{'height':HeighT.customBar + ( (HeighT.heightBar - systemInfo.statusBarHeight)*2 )+'px','marginTop': ( HeighT.heightBar - (HeighT.heightBar - systemInfo.statusBarHeight))+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<view class="navbar_tow flex-between"
|
||||||
|
:style="{'height':systemInfo.titleBarHeight+'px','marginTop':systemInfo.statusBarHeight+'px','padding-right':menuButtonInfo.width+50 + 'px'}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- 标题搜索框 -->
|
<!-- 标题搜索框 -->
|
||||||
<view class="flex-between" v-if="opacity&&inputshow">
|
<view class="flex-between" v-if="opacity&&inputshow">
|
||||||
|
<!-- #ifndef MP-ALIPAY -->
|
||||||
<view class="navbar_tow_one flex-start" v-if="iconshow" @click="clicknavigateBack">
|
<view class="navbar_tow_one flex-start" v-if="iconshow" @click="clicknavigateBack">
|
||||||
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="navbar_tow_tow " @click="inputFocus" style="position: relative;">
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<view class="navbar_tow_tow " @click="inputFocus" style="position: relative">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<view class="navbar_tow_tow " @click="inputFocus" style="position: relative;padding-left: 60rpx;">
|
||||||
|
<!-- #endif -->
|
||||||
<u--input
|
<u--input
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
class="custom-input"
|
class="custom-input"
|
||||||
@@ -40,15 +51,21 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 正常导航栏 -->
|
<!-- 正常导航栏 -->
|
||||||
<view class="flex-between" @click="clicknavigateBack" v-else>
|
<view class="flex-between" @click="clicknavigateBack" v-else>
|
||||||
|
<!-- #ifndef MP-ALIPAY -->
|
||||||
<view class="navbar_tow_one flex-start" v-if="iconshow">
|
<view class="navbar_tow_one flex-start" v-if="iconshow">
|
||||||
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
|
||||||
<view class="navbar_tow_tow" v-if="opacity || titleshow" :style="{color: namecolor}">
|
<view class="navbar_tow_tow" v-if="opacity || titleshow" :style="{color: namecolor}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="navbar_tow_tow" v-if="opacity || titleshow"
|
<view class="navbar_tow_tow" v-if="opacity || titleshow"
|
||||||
:style="{'padding-left':HeighT.custwidth-14 + 'px',color: namecolor}">
|
:style="{'padding-left':HeighT.custwidth-14 + 'px',color: namecolor}">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<view class="navbar_tow_tow" v-if="opacity || titleshow"
|
||||||
|
:style="{'padding-left': 60 + 'rpx','textAlign': 'left',color: namecolor}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
{{title}}
|
{{title}}
|
||||||
</view>
|
</view>
|
||||||
@@ -129,6 +146,9 @@
|
|||||||
HeighT() { //手机类型的尺寸
|
HeighT() { //手机类型的尺寸
|
||||||
return this.$store.getters.is_BarHeight
|
return this.$store.getters.is_BarHeight
|
||||||
},
|
},
|
||||||
|
menuButtonInfo() { //手机类型的尺寸
|
||||||
|
return uni.getMenuButtonBoundingClientRect()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
forceUpdate(val,oldval) {
|
forceUpdate(val,oldval) {
|
||||||
console.log(val,oldval)
|
|
||||||
// 在 forceUpdate 改变时执行更新操作
|
// 在 forceUpdate 改变时执行更新操作
|
||||||
let time = uni.cache.get('popUpTime') ? new Date().getTime() - uni.cache.get('popUpTime') : 1000;
|
let time = uni.cache.get('popUpTime') ? new Date().getTime() - uni.cache.get('popUpTime') : 1000;
|
||||||
if ( time >= 1000 ) {
|
if ( time >= 1000 ) {
|
||||||
@@ -64,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
// if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
// if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -94,7 +93,7 @@
|
|||||||
*/
|
*/
|
||||||
async getPopUpAd () {
|
async getPopUpAd () {
|
||||||
let res = await this.api.getPopUpAd({
|
let res = await this.api.getPopUpAd({
|
||||||
shopId: uni.cache.get('shopUser')
|
shopId: uni.cache.get('shopId')
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.popupadList = [];
|
this.popupadList = [];
|
||||||
@@ -141,6 +140,7 @@
|
|||||||
// updateTime
|
// updateTime
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.viewswiperShow = false;
|
||||||
if ( this.popupadList.length > 0 ) {
|
if ( this.popupadList.length > 0 ) {
|
||||||
this.viewswiperShow = true;
|
this.viewswiperShow = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<template xlang="wxml" minapp="mpvue">
|
<template xlang="wxml" minapp="mpvue">
|
||||||
<view class="tki-barcode">
|
<view class="tki-barcode">
|
||||||
<!-- #ifndef MP-ALIPAY -->
|
<!-- #ifndef MP-ALIPAY -->
|
||||||
<canvas class="tki-barcode-canvas" :canvas-id="cid"
|
<canvas class="tki-barcode-canvas 1" :canvas-id="cid"
|
||||||
:style="{width:canvasWidth+'px',height:canvasHeight+'px'}" />
|
:style="{width:canvasWidth+'px',height:canvasHeight+'px'}" />
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-ALIPAY -->
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
<canvas :id="cid" :width="canvasWidth" :height="canvasHeight" class="tki-barcode-canvas" />
|
<canvas :id="cid" :width="canvasWidth" :height="canvasHeight" class="tki-barcode-canvas 2" />
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<image v-show="show" :src="result" :style="{width:canvasWidth+'px',height:canvasHeight+'px'}" />
|
<image v-show="show" :src="result" :style="{width:canvasWidth+'px',height:canvasHeight+'px'}" />
|
||||||
</view>
|
</view>
|
||||||
@@ -83,6 +83,7 @@
|
|||||||
onUnload: function() {},
|
onUnload: function() {},
|
||||||
methods: {
|
methods: {
|
||||||
setval(n) {
|
setval(n) {
|
||||||
|
console.log(n)
|
||||||
this.val = n
|
this.val = n
|
||||||
if (!this._empty(n)) {
|
if (!this._empty(n)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -166,7 +167,10 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
val(n, o) {
|
val(n, o) {
|
||||||
|
console.log(n,0)
|
||||||
|
console.log(this.onval)
|
||||||
if (this.onval) {
|
if (this.onval) {
|
||||||
|
console.log(!this._empty(n))
|
||||||
if (n != o && !this._empty(n)) {
|
if (n != o && !this._empty(n)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this._makeCode()
|
this._makeCode()
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ const debug = process.env.NODE_ENV == 'development' ? true : false;
|
|||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
const proxyApi = "/api"
|
const proxyApi = "/api"
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN || APP
|
// #ifdef MP-WEIXIN || APP || MP-ALIPAY
|
||||||
// const proxyApi = 'http://192.168.2.42:9889/cashierService' // 王伟
|
// const proxyApi = 'http://192.168.2.42:9889/cashierService' // 王伟
|
||||||
// const proxyApi = 'http://192.168.2.74:9888/cashierService' // 帆哥
|
// const proxyApi = 'http://192.168.1.27:9888/cashierService' // 帆哥
|
||||||
// const proxyApiwws = 'ws://192.168.2.74:9888/cashierService' // 测试
|
// const proxyApiwws = 'ws://192.168.1.15:9999/netty' // 测试
|
||||||
const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||||
// #endif
|
// #endif
|
||||||
@@ -15,12 +15,12 @@ const baseUrl = debug ? proxyApi + '/cashierService' : "https://cashier.sxczgkj.
|
|||||||
const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
|
const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef APP || MP-WEIXIN
|
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||||
const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
||||||
const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上
|
const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上
|
||||||
|
|
||||||
// const baseUrl = 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
// const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
// const baseUrlwws = 'wss://cashier.sxczgkj.cn/netty' // 线上/
|
// const baseUrlwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// import VConsole from "./vConsole.js"
|
// import VConsole from "./vConsole.js"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import md5 from './md5'
|
import md5 from './md5'
|
||||||
|
import Api from "@/common/js/api.js"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转换对象为x-www-form-urlencoded
|
* 转换对象为x-www-form-urlencoded
|
||||||
@@ -232,11 +233,84 @@ const pluschooseImage = function() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||||
return true
|
return true
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getUserInfo = function (successCallback, failCallback) {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.login({
|
||||||
|
provider: 'weixin',
|
||||||
|
success: (data) => {
|
||||||
|
// 微信小程序环境
|
||||||
|
uni.getUserInfo({
|
||||||
|
provider: 'weixin',
|
||||||
|
success: async (infoRes) => {
|
||||||
|
let res = await Api.userwxlogin({
|
||||||
|
code: data.code, //临时登录凭证
|
||||||
|
rawData: infoRes.rawData,
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
resolve(res)
|
||||||
|
// uni.cache.set('token', res.data.token);
|
||||||
|
// uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||||
|
// .miniAppOpenId)
|
||||||
|
// uni.cache.set('userInfo', res.data.userInfo);
|
||||||
|
// let pages = getCurrentPages()
|
||||||
|
// let curPage = pages[pages.length -1 ]
|
||||||
|
// curPage.onLoad(curPage.options)
|
||||||
|
// curPage.onShow()
|
||||||
|
// // curPage.mounted()
|
||||||
|
// curPage.onReady()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
my.getAuthCode({
|
||||||
|
scopes: 'auth_user',
|
||||||
|
success: (data) => {
|
||||||
|
// 支付宝小程序环境
|
||||||
|
my.getAuthUserInfo({
|
||||||
|
success: async (infoRes) => {
|
||||||
|
uni.cache.set('weixincode', data.authCode);
|
||||||
|
let res = await Api.userwxlogin({
|
||||||
|
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||||
|
rawData: JSON.stringify(infoRes),
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
resolve(res)
|
||||||
|
// uni.cache.set('token', res.data.token);
|
||||||
|
// uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||||
|
// .miniAppOpenId)
|
||||||
|
// uni.cache.set('userInfo', res.data.userInfo);
|
||||||
|
// let pages = getCurrentPages()
|
||||||
|
// let curPage = pages[pages.length -1 ]
|
||||||
|
// curPage.onLoad(curPage.options)
|
||||||
|
// curPage.onShow()
|
||||||
|
// // curPage.mounted()
|
||||||
|
// curPage.onReady()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uni.utils = {
|
uni.utils = {
|
||||||
md5,
|
md5,
|
||||||
transformRequest,
|
transformRequest,
|
||||||
@@ -253,5 +327,6 @@ uni.utils = {
|
|||||||
debounce,
|
debounce,
|
||||||
getCurrentPage,
|
getCurrentPage,
|
||||||
getCurrentRoute,
|
getCurrentRoute,
|
||||||
pluschooseImage
|
pluschooseImage,
|
||||||
|
getUserInfo
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ async function request(options) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (options.toast) {
|
if (options.toast) {
|
||||||
// #ifdef MP-WEIXIN || APP-PLUS
|
// #ifdef MP-WEIXIN || MP-ALIPAY || APP-PLUS
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中',
|
title: '加载中',
|
||||||
mask: true
|
mask: true
|
||||||
@@ -85,6 +85,10 @@ async function request(options) {
|
|||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
environment: 'wx',
|
environment: 'wx',
|
||||||
// #endif
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
environment: 'wx',
|
||||||
|
// environment: 'alipay',
|
||||||
|
// #endif
|
||||||
token: uni.cache.get('token'),
|
token: uni.cache.get('token'),
|
||||||
openId: uni.cache.get('miniAppOpenId'),
|
openId: uni.cache.get('miniAppOpenId'),
|
||||||
id: uni.cache.get('userInfo').id,
|
id: uni.cache.get('userInfo').id,
|
||||||
@@ -94,7 +98,7 @@ async function request(options) {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
// #ifdef MP-WEIXIN || APP-PLUS
|
// #ifdef MP-WEIXIN || MP-ALIPAY || APP-PLUS
|
||||||
options.url = uni.conf.baseUrl + options.url
|
options.url = uni.conf.baseUrl + options.url
|
||||||
let res = await requestrequest(options);
|
let res = await requestrequest(options);
|
||||||
// #endif
|
// #endif
|
||||||
@@ -102,7 +106,6 @@ async function request(options) {
|
|||||||
let res = await uni.pro.request(options);
|
let res = await uni.pro.request(options);
|
||||||
// #endif
|
// #endif
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
console.log(options)
|
|
||||||
if (res.code == -4) {
|
if (res.code == -4) {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: res.message || res.msg,
|
// title: res.message || res.msg,
|
||||||
@@ -113,6 +116,7 @@ async function request(options) {
|
|||||||
// // }, 1000)
|
// // }, 1000)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
|
|
||||||
uni.$u.throttle(store.dispatch("loginEvent"), 1000); //获取shapid
|
uni.$u.throttle(store.dispatch("loginEvent"), 1000); //获取shapid
|
||||||
|
|
||||||
} else if (res.code == 482) {
|
} else if (res.code == 482) {
|
||||||
@@ -128,9 +132,7 @@ async function request(options) {
|
|||||||
success: () => {
|
success: () => {
|
||||||
setTimeout(res => {
|
setTimeout(res => {
|
||||||
if (options.toast) {
|
if (options.toast) {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||||
// #endif
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
uni.pro.hideLoading()
|
uni.pro.hideLoading()
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,12 @@ uni.pro.uploadFile = (obj) => {
|
|||||||
|
|
||||||
uni.pro.navigateTo = (pageName, extras = {}) => {
|
uni.pro.navigateTo = (pageName, extras = {}) => {
|
||||||
let url = uni.url.getUrl(pageName, extras)
|
let url = uni.url.getUrl(pageName, extras)
|
||||||
|
console.log(url)
|
||||||
return uni.navigateTo({
|
return uni.navigateTo({
|
||||||
url
|
url
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
uni.pro.redirectTo = (pageName, extras = {}) => {
|
uni.pro.redirectTo = (pageName, extras = {}) => {
|
||||||
let url = uni.url.getUrl(pageName, extras)
|
let url = uni.url.getUrl(pageName, extras)
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ function get(key) {
|
|||||||
if (!res) {
|
if (!res) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// res = JSON.parse(res)
|
// res = JSON.parse(res)
|
||||||
|
|
||||||
if (res.__expiretime && res.__expiretime < uni.utils.timestamp()) {
|
if (res.expire > 0 && res.expire < uni.utils.timestamp()) {
|
||||||
|
console.log(res)
|
||||||
remove(key)
|
remove(key)
|
||||||
return ''
|
return ''
|
||||||
} else {
|
} else {
|
||||||
return res
|
return res.data
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return ''
|
return ''
|
||||||
@@ -56,15 +56,13 @@ function getStorageData(key) {
|
|||||||
* @param {Number} expire 指定秒数后过期
|
* @param {Number} expire 指定秒数后过期
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function set(key, value, expire = uni.conf.default_expire) {
|
function set(key, value, expire = 0) {
|
||||||
let cacheItem = {}
|
let obj = {
|
||||||
cacheItem = value
|
data: value, //存储的数据
|
||||||
// console.log(cacheItem)
|
time: Date.now() / 1000, //记录存储的时间戳
|
||||||
if (expire > 0) {
|
expire: expire //记录过期时间,单位秒
|
||||||
cacheItem.__expiretime = uni.utils.timestamp() + expire
|
|
||||||
}
|
}
|
||||||
// uni.setStorageSync(key,JSON.stringify(cacheItem))
|
uni.setStorageSync(key, obj)
|
||||||
uni.setStorageSync(key,cacheItem)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -96,7 +96,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-alipay" : {
|
"mp-alipay" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true,
|
||||||
|
"appid" : "2021004145625815",
|
||||||
|
"devServer" : {
|
||||||
|
"autoOpen" : true // 设置为true自动打开支付宝小程序
|
||||||
|
},
|
||||||
|
"unipush" : {
|
||||||
|
"enable" : false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"mp-baidu" : {
|
"mp-baidu" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true
|
||||||
|
|||||||
3
mini.project.json
Normal file
3
mini.project.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"format": 2
|
||||||
|
}
|
||||||
123
pages.json
123
pages.json
@@ -4,28 +4,64 @@
|
|||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
// #endif
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
},
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/jtoday",
|
"path": "pages/index/jtoday",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "每日上新",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "pages/index/tothestore",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/index/drinks",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/freedaily",
|
"path": "pages/index/freedaily",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "每日免单",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/index/tothestore",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "预约到店",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -34,18 +70,17 @@
|
|||||||
"navigationBarTitleText": "红包中心"
|
"navigationBarTitleText": "红包中心"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/index/drinks",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "咖啡饮品",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/index/hotlist",
|
"path": "pages/index/hotlist",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "热榜推荐",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -57,8 +92,13 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/product/index",
|
"path": "pages/product/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "商品详情",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -84,8 +124,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/order/order",
|
"path": "pages/order/order",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "订单列表",
|
"navigationBarTitleText": "订单列表"
|
||||||
"navigationBarBackgroundColor": "#FFD158"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -95,12 +134,7 @@
|
|||||||
"navigationBarTitleText": "订单详情"
|
"navigationBarTitleText": "订单详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/order_detail/indexs",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "订单详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/order/successful",
|
"path": "pages/order/successful",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -144,9 +178,14 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/user/user",
|
"path": "pages/user/user",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "个人中心",
|
"navigationBarTitleText": "",
|
||||||
"navigationBarBackgroundColor": "#FFD158",
|
"navigationBarBackgroundColor": "#FFD158",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/user/repairpassword",
|
"path": "pages/user/repairpassword",
|
||||||
@@ -162,24 +201,30 @@
|
|||||||
"navigationBarTitleText": "会员支付码"
|
"navigationBarTitleText": "会员支付码"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/order_detail/order_detail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "订单详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/order_food/order_food",
|
"path": "pages/order_food/order_food",
|
||||||
"style": {
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/order_food/order_food_search",
|
"path": "pages/order_food/order_food_search",
|
||||||
"style": {
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black",
|
||||||
|
"mp-alipay": {
|
||||||
|
"transparentTitle": "always",
|
||||||
|
"titlePenetrate": "YES",
|
||||||
|
"allowsBounceVertical": "NO"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickdistrict(item) {
|
clickdistrict(item) {
|
||||||
console.log(item,'调试')
|
// console.log(item,'调试')
|
||||||
switch (item.jumpType) {
|
switch (item.jumpType) {
|
||||||
case 'absolute':
|
case 'absolute':
|
||||||
uni.pro.navigateTo('webview/webview', {
|
uni.pro.navigateTo('webview/webview', {
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
if (!uni.utils.pluschooseImage()) {
|
if (!uni.utils.pluschooseImage()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// #ifdef APP || MP-WEIXIN
|
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
||||||
@@ -60,9 +60,13 @@
|
|||||||
if (tableCode) {
|
if (tableCode) {
|
||||||
uni.pro.navigateTo('order_food/order_food')
|
uni.pro.navigateTo('order_food/order_food')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
fail:( res) =>{
|
||||||
|
console.log(res)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<navseat class="navbar" :opacity='opacitys' :title='toplist.name' :titleshow='false'></navseat>
|
<navseat class="navbar" :opacity='opacitys' :title='toplist.name' :titleshow='false'></navseat>
|
||||||
|
|
||||||
<view class="onecontent">
|
<view class="onecontent">
|
||||||
<image class="onecontentimage" :src="toplist.coverImg" mode=""></image>
|
<image class="onecontentimage" :src="toplist.coverImg" mode="aspectFill"></image>
|
||||||
<!-- 小内切圆 -->
|
<!-- 小内切圆 -->
|
||||||
<view class="after"></view>
|
<view class="after"></view>
|
||||||
<view class="onecontentabsolute">
|
<view class="onecontentabsolute">
|
||||||
|
|||||||
@@ -1,24 +1,34 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view v-if="showindex">
|
<view v-if="showindex == 'index'">
|
||||||
<!-- 导航栏 -->
|
<!-- 导航栏 -->
|
||||||
<view class="navbar" :class="{active:opacity}">
|
<view class="navbar" :class="{active:opacity}">
|
||||||
<!-- #ifndef APP-PLUS || MP-WEIXIN -->
|
<!-- #ifndef APP-PLUS || MP-WEIXIN || MP-ALIPAY -->
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<view class="navbar_tow flex-between"
|
<view class="navbar_tow flex-between"
|
||||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="navbar_tow flex-between" :style="{'marginTop':HeighT.heightBar /2+'px'}">
|
<view class="navbar_tow flex-between" :style="{'marginTop':HeighT.heightBar /2+'px'}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="navbar_tow flex-between"
|
<view class="navbar_tow flex-between"
|
||||||
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<view class="navbar_tow flex-between"
|
||||||
|
:style="{'height':menuButtonInfo.height+10+'px','marginTop':menuButtonInfo.top+'px','padding-bottom':10 + 'px','padding-right':menuButtonInfo.width+50 + 'px'}">
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- 标题搜索框 -->
|
<!-- 标题搜索框 -->
|
||||||
<view class="flex-between">
|
<view class="flex-between">
|
||||||
<view class="navbar_tow_one flex-start" @click="uindexlist">
|
<view class="navbar_tow_one flex-start" @click="uindexlist">
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<text class="textnth-childone">{{NAME}}</text>
|
<text class="textnth-childone">{{NAME}}</text>
|
||||||
|
<!-- #endif -->
|
||||||
<text class="textnth-childtow">{{form.address}}</text>
|
<text class="textnth-childtow">{{form.address}}</text>
|
||||||
<u-icon style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
<u-icon style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
||||||
size="16"></u-icon>
|
size="16"></u-icon>
|
||||||
@@ -226,7 +236,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<indexs v-if="!showindex" :shopExtend="shopExtend" :usershopUserinfo='usershopUserinfo' :userInfo='userInfo'></indexs>
|
<indexs v-if="showindex == 'shopIndex'" :shopExtend="shopExtend" :usershopUserinfo='usershopUserinfo' :userInfo='userInfo'></indexs>
|
||||||
<popupad id="popupad" :forceUpdate='forceUpdate' :showPosition="'home'"></popupad>
|
<popupad id="popupad" :forceUpdate='forceUpdate' :showPosition="'home'"></popupad>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -239,7 +249,6 @@
|
|||||||
import todaylist from './components/todaylist.vue'
|
import todaylist from './components/todaylist.vue'
|
||||||
import productlist from './components/productlist.vue'
|
import productlist from './components/productlist.vue'
|
||||||
import advertisement from './components/advertisement.vue'
|
import advertisement from './components/advertisement.vue'
|
||||||
import customSwiper from '@/components/blackmonth-swiper/index'
|
|
||||||
import category from '@/components/qiyue-category/qiyue-category.vue';
|
import category from '@/components/qiyue-category/qiyue-category.vue';
|
||||||
import indexs from './indexs.vue';
|
import indexs from './indexs.vue';
|
||||||
export default {
|
export default {
|
||||||
@@ -250,14 +259,13 @@
|
|||||||
productlist,
|
productlist,
|
||||||
advertisement,
|
advertisement,
|
||||||
category,
|
category,
|
||||||
customSwiper,
|
|
||||||
indexs,
|
indexs,
|
||||||
popupad
|
popupad
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showindex: false,
|
showindex: "",
|
||||||
userInfo:'',//个人信息
|
userInfo: {},//个人信息
|
||||||
NAME: uni.cache.get('NAME'),
|
NAME: uni.cache.get('NAME'),
|
||||||
timersetInterval: '0', //定时器
|
timersetInterval: '0', //定时器
|
||||||
isFixedTop: false, //吸顶是否显示
|
isFixedTop: false, //吸顶是否显示
|
||||||
@@ -270,7 +278,8 @@
|
|||||||
hometoplist: { //上面数据
|
hometoplist: { //上面数据
|
||||||
carousel: [],
|
carousel: [],
|
||||||
district: [],
|
district: [],
|
||||||
|
salesList: {},
|
||||||
|
todayList: {},
|
||||||
},
|
},
|
||||||
itemStyle: [ //样式
|
itemStyle: [ //样式
|
||||||
],
|
],
|
||||||
@@ -323,6 +332,9 @@
|
|||||||
HeighT() { //手机类型的尺寸
|
HeighT() { //手机类型的尺寸
|
||||||
return this.$store.getters.is_BarHeight
|
return this.$store.getters.is_BarHeight
|
||||||
},
|
},
|
||||||
|
menuButtonInfo() { //手机类型的尺寸
|
||||||
|
return uni.getMenuButtonBoundingClientRect()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -338,11 +350,21 @@
|
|||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
// 判断显示那个页面
|
// 判断显示那个页面
|
||||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
// #ifdef MP-ALIPAY
|
||||||
this.showindex = false
|
my.hideAllFavoriteMenu({
|
||||||
|
success: (res) => {
|
||||||
|
console.log('收藏按钮已隐藏', res);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('隐藏收藏按钮失败', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||||
|
this.showindex = 'shopIndex'
|
||||||
uni.cache.set('types', 'index');
|
uni.cache.set('types', 'index');
|
||||||
let res = await this.api.shopUserInfo({
|
let res = await this.api.shopUserInfo({
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopId'),
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -359,10 +381,12 @@
|
|||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
|
// console.log(res)
|
||||||
let successres = await this.api.geocodelocation({
|
let successres = await this.api.geocodelocation({
|
||||||
lng: res.longitude,
|
lng: res.longitude,
|
||||||
lat: res.latitude,
|
lat: res.latitude,
|
||||||
})
|
})
|
||||||
|
// console.log("successres==",successres)
|
||||||
if (successres.code == 0) {
|
if (successres.code == 0) {
|
||||||
let datastorage = {
|
let datastorage = {
|
||||||
country: successres.data.addressComponent.country, // "中国"
|
country: successres.data.addressComponent.country, // "中国"
|
||||||
@@ -385,7 +409,6 @@
|
|||||||
lat: '',
|
lat: '',
|
||||||
})
|
})
|
||||||
if (successres.code == 0) {
|
if (successres.code == 0) {
|
||||||
console.log(successres.data.addressComponent.streetNumber.location.split(','))
|
|
||||||
let res = successres.data.addressComponent.streetNumber.location.split(',')
|
let res = successres.data.addressComponent.streetNumber.location.split(',')
|
||||||
let datastorage = {
|
let datastorage = {
|
||||||
country: successres.data.addressComponent.country, // "中国"
|
country: successres.data.addressComponent.country, // "中国"
|
||||||
@@ -402,7 +425,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.showindex = true
|
this.showindex = 'index'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -412,7 +435,7 @@
|
|||||||
*/
|
*/
|
||||||
async getShopExtend () {
|
async getShopExtend () {
|
||||||
let res = await this.api.getShopExtend({
|
let res = await this.api.getShopExtend({
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: uni.cache.get('shopId'),
|
||||||
autokey: "index_bg" //index_bg my_bg member_bg shopInfo_bg
|
autokey: "index_bg" //index_bg my_bg member_bg shopInfo_bg
|
||||||
})
|
})
|
||||||
if ( res.code == 0) {
|
if ( res.code == 0) {
|
||||||
@@ -455,7 +478,6 @@
|
|||||||
success: (data) => {
|
success: (data) => {
|
||||||
this.seighT = data.windowHeight;
|
this.seighT = data.windowHeight;
|
||||||
this.$u.getRect('.fourcontent').then(res => {
|
this.$u.getRect('.fourcontent').then(res => {
|
||||||
console.log(res.top)
|
|
||||||
this.Topdistance = res.top - res.height //滚动距离
|
this.Topdistance = res.top - res.height //滚动距离
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -594,7 +616,6 @@
|
|||||||
},
|
},
|
||||||
// 选择元素的指定选项
|
// 选择元素的指定选项
|
||||||
clickdetail(item, index) {
|
clickdetail(item, index) {
|
||||||
console.log(category);
|
|
||||||
this.clickdetailindex = index
|
this.clickdetailindex = index
|
||||||
this.showproductlist = false
|
this.showproductlist = false
|
||||||
this.hometoplist.menu[this.viewHistoryindex].name = item.name
|
this.hometoplist.menu[this.viewHistoryindex].name = item.name
|
||||||
@@ -616,7 +637,6 @@
|
|||||||
},
|
},
|
||||||
//城市二级菜单
|
//城市二级菜单
|
||||||
categoryMainClick(category) {
|
categoryMainClick(category) {
|
||||||
console.log(category.category.name);
|
|
||||||
if (category.category.name == '全城') {
|
if (category.category.name == '全城') {
|
||||||
this.showproductlist = false
|
this.showproductlist = false
|
||||||
this.form.lng = uni.cache.get('getLocationstorage').lng,
|
this.form.lng = uni.cache.get('getLocationstorage').lng,
|
||||||
@@ -635,11 +655,9 @@
|
|||||||
},
|
},
|
||||||
//确定街道菜单赋值
|
//确定街道菜单赋值
|
||||||
categorySubClick(category) {
|
categorySubClick(category) {
|
||||||
console.log(category);
|
|
||||||
this.hometoplist.menu[this.viewHistoryindex].name = category.name
|
this.hometoplist.menu[this.viewHistoryindex].name = category.name
|
||||||
this.form.address = category.name //地址
|
this.form.address = category.name //地址
|
||||||
this.showproductlist = false
|
this.showproductlist = false
|
||||||
console.log(category.center.split(','))
|
|
||||||
let res = category.center.split(',')
|
let res = category.center.split(',')
|
||||||
this.form.lng = res[0]
|
this.form.lng = res[0]
|
||||||
this.form.lat = res[1]
|
this.form.lat = res[1]
|
||||||
@@ -702,6 +720,9 @@
|
|||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
margin-left: 28rpx;
|
margin-left: 28rpx;
|
||||||
// #endif
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
margin-left: 50rpx;
|
||||||
|
// #endif
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -1,283 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- <u-swiper :list="banners" height="460" radius="0" :indicator="banners.length > 1" imgMode="widthFix"></u-swiper> -->
|
|
||||||
|
|
||||||
<view class="container">
|
|
||||||
<view class="after"></view>
|
|
||||||
<view class="onecontent flex-between">
|
|
||||||
<view class="onecontentone flex-start">
|
|
||||||
<image :src="userInfo.headImg" mode="aspectFill">
|
|
||||||
<text>{{userInfo.nickName || '无'}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="onecontenttow flex-start">
|
|
||||||
<view class="onecontenttowring flex-colum" @click="memberindex(0)">
|
|
||||||
<text class="onecontenttowringone">{{usershopUserinfo.amount || '0.00'}}</text>
|
|
||||||
<text class="onecontenttowringtow">余额</text>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="onecontenttowring flex-colum">
|
|
||||||
<text class="onecontenttowringone">282</text>
|
|
||||||
<text class="onecontenttowringtow">积分</text>
|
|
||||||
</view> -->
|
|
||||||
<view class="onecontenttowring flex-colum" @click="memberindex(1)">
|
|
||||||
<image class="onecontenttowringone image"
|
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/rwm.png" mode="aspectFill">
|
|
||||||
</image>
|
|
||||||
<text class="onecontenttowringtow">会员码</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="towcontent flex-between">
|
|
||||||
<view class="towcontentitem flex-colum" @click="scanCodehandle(0)">
|
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/Instore.png" mode="widthFix"
|
|
||||||
style="width: 86.88rpx; height: 140.94rpx;"></image>
|
|
||||||
<text class="towcontentitemtext">店内就餐</text>
|
|
||||||
</view>
|
|
||||||
<view class="towcontentitem flex-colum" @click="scanCodehandle(1)">
|
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/takeaway.png" mode="widthFix"
|
|
||||||
style="width: 164rpx; height: 164rpx"></image>
|
|
||||||
<text class="towcontentitemtext">会员充值</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="footer-banner">
|
|
||||||
<!-- <u-swiper :list="footerBanners" radius="20" height="274" :indicator="banners.length > 1"
|
|
||||||
imgMode="widthFix"></u-swiper> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
banners: ['https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/banner1.png'],
|
|
||||||
footerBanners: ['https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/footer_banner1.png'],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
usershopUserinfo: {
|
|
||||||
type: Object,
|
|
||||||
default () {
|
|
||||||
return {
|
|
||||||
amount: '',
|
|
||||||
shopName: ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
userInfo: {
|
|
||||||
type: Object,
|
|
||||||
default () {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
scanCodehandle(i) {
|
|
||||||
if (i == 0) {
|
|
||||||
uni.scanCode({
|
|
||||||
success: (res) => {
|
|
||||||
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
|
||||||
uni.cache.set('tableCode', tableCode)
|
|
||||||
if (tableCode) {
|
|
||||||
uni.pro.navigateTo('order_food/order_food')
|
|
||||||
}
|
|
||||||
// let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
|
||||||
// if (tableCode) {
|
|
||||||
// uni.pro.navigateTo('order_food/order_food', {
|
|
||||||
// tableCode: tableCode,
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:'/pages/order_food/order_food'
|
|
||||||
// })
|
|
||||||
} else {
|
|
||||||
// uni.pro.navigateTo('pay_code/pay_code?shopInfo=', {
|
|
||||||
// shopName: this.usershopUserinfo.shopName,
|
|
||||||
// amount: this.usershopUserinfo.amount,
|
|
||||||
// shopId: uni.cache.get('shopUser')
|
|
||||||
// })
|
|
||||||
uni.pro.navigateTo('member/memberdetails', {
|
|
||||||
shopId_id: uni.cache.get('shopUser'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
memberindex(i) {
|
|
||||||
if (i == 0) {
|
|
||||||
uni.pro.navigateTo('member/memberdetails', {
|
|
||||||
shopId_id: uni.cache.get('shopUser'),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// uni.pro.navigateTo('pay_code/pay_code?shopInfo=', {
|
|
||||||
// shopName: this.usershopUserinfo.shopName,
|
|
||||||
// amount: this.usershopUserinfo.amount,
|
|
||||||
// shopId: uni.cache.get('shopUser')
|
|
||||||
// })
|
|
||||||
let data = {
|
|
||||||
shopName: this.usershopUserinfo.shopName,
|
|
||||||
amount: this.usershopUserinfo.amount,
|
|
||||||
shopId: uni.cache.get('shopUser')
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(data)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
getQueryString(url, name) { //解码
|
|
||||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
|
||||||
var r = url.substr(1).match(reg)
|
|
||||||
if (r != null) {
|
|
||||||
return r[2]
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
// / 更换头像
|
|
||||||
onChooseAvatar(e) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '上传中',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
console.log(e.detail.avatarUrl)
|
|
||||||
let file = e.detail.avatarUrl;
|
|
||||||
uploadImage(file, 'avatar',
|
|
||||||
result => {
|
|
||||||
//将上传后的图片以对象(官方要求的格式)的形式存入uni-file-picker的value值imageValue(imageValue值的结构为数组包对象)用于图片回显
|
|
||||||
// let objAge = {
|
|
||||||
// 'url': result,
|
|
||||||
// 'extname': 'png',
|
|
||||||
// 'name': 'imgss.png'
|
|
||||||
// };
|
|
||||||
// this.userlist.avatar.push(objAge)
|
|
||||||
this.userInfo.avatar = result
|
|
||||||
console.log(this.userInfo.avatar)
|
|
||||||
uni.hideLoading()
|
|
||||||
}, result => {
|
|
||||||
uni.hideLoading()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
page {
|
|
||||||
background: #F6F8FA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
border-radius: 0 0 0 40rpx;
|
|
||||||
position: relative;
|
|
||||||
padding: 0 28rpx;
|
|
||||||
|
|
||||||
.after {
|
|
||||||
position: absolute;
|
|
||||||
top: 46rpx;
|
|
||||||
right: 0;
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
line-height: 40rpx;
|
|
||||||
text-align: center;
|
|
||||||
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #f9f9f9 40rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.onecontent {
|
|
||||||
width: 100%;
|
|
||||||
margin-top: -86rpx;
|
|
||||||
position: relative;
|
|
||||||
height: 172rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
||||||
border-radius: 14rpx;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
|
|
||||||
.onecontentone {
|
|
||||||
image {
|
|
||||||
width: 108rpx;
|
|
||||||
height: 108rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border: 2rpx solid #707070;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
margin-left: 12rpx;
|
|
||||||
width: 146rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.onecontenttow {
|
|
||||||
.onecontenttowring {
|
|
||||||
margin-left: 32rpx;
|
|
||||||
height: 110rpx;
|
|
||||||
justify-content: flex-end;
|
|
||||||
|
|
||||||
.onecontenttowringone {
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: 42rpx;
|
|
||||||
height: 42rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.onecontenttowringtow {
|
|
||||||
margin-top: 20rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #666666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.towcontent {
|
|
||||||
margin-top: 48rpx;
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
||||||
border-radius: 14rpx 14rpx 14rpx 14rpx;
|
|
||||||
height: 314rpx;
|
|
||||||
padding: 0 90rpx 0 120rpx;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
position: absolute;
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
height: 188rpx;
|
|
||||||
width: 2rpx;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: -1rpx;
|
|
||||||
background: #D8D8D8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.towcontentitem {
|
|
||||||
.towcontentitemtext {
|
|
||||||
margin-top: 26rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-banner {
|
|
||||||
margin-top: 48upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -61,7 +61,6 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
scanCodehandle(i) {
|
scanCodehandle(i) {
|
||||||
console.log(1)
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.cache.set('forceUpdate',2)
|
uni.cache.set('forceUpdate',2)
|
||||||
},200)
|
},200)
|
||||||
@@ -72,7 +71,7 @@
|
|||||||
uni.cache.set('tableCode', tableCode)
|
uni.cache.set('tableCode', tableCode)
|
||||||
if (tableCode) {
|
if (tableCode) {
|
||||||
uni.pro.navigateTo('order_food/order_food', {
|
uni.pro.navigateTo('order_food/order_food', {
|
||||||
// shopId_id: uni.cache.get('shopUser'),
|
// shopId_id: uni.cache.get('shopId'),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +81,7 @@
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.pro.navigateTo('member/memberdetails', {
|
uni.pro.navigateTo('member/memberdetails', {
|
||||||
shopId_id: uni.cache.get('shopUser'),
|
shopId_id: uni.cache.get('shopId'),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -90,14 +89,14 @@
|
|||||||
console.log(2)
|
console.log(2)
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
uni.pro.navigateTo('member/index', {
|
uni.pro.navigateTo('member/index', {
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: uni.cache.get('shopId'),
|
||||||
type: 'index',
|
type: 'index',
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let data = {
|
let data = {
|
||||||
shopName: this.usershopUserinfo.shopName,
|
shopName: this.usershopUserinfo.shopName,
|
||||||
amount: this.usershopUserinfo.amount,
|
amount: this.usershopUserinfo.amount,
|
||||||
shopId: uni.cache.get('shopUser')
|
shopId: uni.cache.get('shopId')
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(data)
|
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(data)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- 占位符导航栏 -->
|
<!-- 占位符导航栏 -->
|
||||||
<navseat :opacity='opacity' :title='toplist.name' :titleshow='false'></navseat>
|
<navseat :opacity='opacity' :title='toplist.name' :titleshow='false'></navseat>
|
||||||
<view class="onecontent">
|
<view class="onecontent">
|
||||||
<image class="onecontentimage" :src="toplist.coverImg" mode=""></image>
|
<image class="onecontentimage" :src="toplist.coverImg" mode="aspectFill"></image>
|
||||||
<view class="onecontentabsolute">
|
<view class="onecontentabsolute">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -74,7 +74,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.onLoadhome()
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.init_fn()
|
this.init_fn()
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
})
|
})
|
||||||
if (resdata.code == 0) {
|
if (resdata.code == 0) {
|
||||||
this.switchdata = false
|
this.switchdata = false
|
||||||
uni.cache.set('userInfo', resdata .data);
|
uni.cache.set('userInfo', resdata.data);
|
||||||
uni.pro.redirectTo('/pages/member/index', {
|
uni.pro.redirectTo('/pages/member/index', {
|
||||||
shopId: this.shopId,
|
shopId: this.shopId,
|
||||||
type: 'index'
|
type: 'index'
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="rechargeList">
|
<view class="rechargeList">
|
||||||
<view class="rechargeList_f" @click="clickinput(item,index)" v-for="(item,index) in listdata" :key="index">
|
<view class="rechargeList_f" @click="clickinput(item,index)" v-for="(item,index) in listdata" :key="index">
|
||||||
<viwe class="rechargeList_item flex-colum " :class="index == inputshow?'active':''">
|
<view class="rechargeList_item flex-colum " :class="index == inputshow?'active':''">
|
||||||
<view class="rechargeList_item_title">充值</view>
|
<view class="rechargeList_item_title">充值</view>
|
||||||
<view class="flex-colum-start">
|
<view class="flex-colum-start">
|
||||||
<view class="rechargeList_item_amount">¥<text>{{item.minNum}}</text></view>
|
<view class="rechargeList_item_amount">¥<text>{{item.minNum}}</text></view>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<view class="rechargeList_item_handsel" v-show="index != inputshow">赠送{{item.handselNum}}元</view>
|
<view class="rechargeList_item_handsel" v-show="index != inputshow">赠送{{item.handselNum}}元</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</viwe>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -486,14 +486,15 @@
|
|||||||
padding-right: 20rpx;
|
padding-right: 20rpx;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
.rechargeList_item{
|
.rechargeList_item{
|
||||||
height: 130rpx;
|
|
||||||
border-radius: 0rpx 48rpx 0rpx 0rpx;
|
border-radius: 0rpx 48rpx 0rpx 0rpx;
|
||||||
border: 4rpx solid #E5E5E5;
|
border: 4rpx solid #E5E5E5;
|
||||||
align-items: initial;
|
align-items: initial;
|
||||||
padding: 26rpx 22rpx;
|
padding: 26rpx 22rpx;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.rechargeList_item_title{
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
.rechargeList_item_title,.rechargeList_item_handsel{
|
.rechargeList_item_title,.rechargeList_item_handsel{
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
@@ -549,6 +550,7 @@
|
|||||||
background: linear-gradient( 133deg, #F9F6ED 0%, #FFFFFF 100%);
|
background: linear-gradient( 133deg, #F9F6ED 0%, #FFFFFF 100%);
|
||||||
.rechargeList_item_title{
|
.rechargeList_item_title{
|
||||||
color: #F7664E;
|
color: #F7664E;
|
||||||
|
margin-bottom: 47rpx;
|
||||||
}
|
}
|
||||||
.rechargeList_item_amount{
|
.rechargeList_item_amount{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
<view class="list-cell">
|
<view class="list-cell">
|
||||||
<view class="list-cell-item" v-for="(item1,index1) in item.list" :key="index1">
|
<view class="list-cell-item" v-for="(item1,index1) in item.list" :key="index1">
|
||||||
<view class="list-cell-item-title"> {{ item1.title }}</view>
|
<view class="list-cell-item-title"> {{ item1.title }}</view>
|
||||||
<viwe class="list-cell-item-content">
|
<view class="list-cell-item-content">
|
||||||
<viwe class="list-cell-item-content-text" v-for="(item2,index2) in item1.list" :key="index2">{{item2}}</viwe>
|
<view class="list-cell-item-content-text" v-for="(item2,index2) in item1.list" :key="index2">{{item2}}</view>
|
||||||
</viwe>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -19,9 +19,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="list.length== 0 && is_end == true" class="flex-colum">
|
<view v-if="list.length <= 0" class="flex-colum">
|
||||||
<image :src="bgnothave" mode="aspectFill">
|
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
||||||
</image>
|
|
||||||
</view>
|
</view>
|
||||||
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="navtab flex-center">
|
<!-- <view class="navtab flex-center">
|
||||||
<view class="navtabpost flex-center">
|
<view class="navtabpost flex-center">
|
||||||
<view :class="navtabindex == 0 ? 'navtabone':'navtabtow'" @click="navtabclick(0)">
|
<view :class="navtabindex == 0 ? 'navtabone':'navtabtow'" @click="navtabclick(0)">
|
||||||
到店订单
|
到店订单
|
||||||
@@ -9,46 +9,33 @@
|
|||||||
团购订单
|
团购订单
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<u-sticky bgColor="#fff">
|
<u-sticky >
|
||||||
<view class="tab-wrap">
|
<view class="tab-wrap">
|
||||||
<block v-if="navtabindex==1">
|
<view class="item" :class="{'active':active == index}" v-for="(item, index) in tabs" :key="index" @click="orderswitch(item,index)">
|
||||||
<view class="item" v-for="(item, index) in tabs2" :key="index" @click="orderswitch(item,index)">
|
|
||||||
<text>{{ item.name }}</text>
|
<text>{{ item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
|
||||||
|
|
||||||
<block v-if="navtabindex==0">
|
|
||||||
<view class="item" v-for="(item, index) in tabs" :key="index" @click="orderswitch(item,index)">
|
|
||||||
<text>{{ item.name }}</text>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
<view class="line-wrap"
|
|
||||||
:style="{ left: `${(100 / tabs.length) * active}%`, width: `${100 / tabs.length}%` }">
|
|
||||||
<view class="line">
|
|
||||||
<image style="width:40rpx; height: 10rpx;"
|
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dgs.png"
|
|
||||||
mode="aspectFill">
|
|
||||||
</image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</u-sticky>
|
</u-sticky>
|
||||||
<view class="list-wrap" v-if="navtabindex == 0">
|
<view class="list-wrap" v-if="!is_end">
|
||||||
<view class="item" v-for="(item,index) in list" :key="index" @click="orderinfo(item)">
|
<view class="item" v-for="(item,index) in list" :key="index" @click="orderinfo(item)">
|
||||||
<view class="header-wrap">
|
<view class="header-wrap">
|
||||||
<text v-if="item.sendType == 'post'">快递</text>
|
<view class="header-wrap-left">
|
||||||
<text v-if="item.sendType == 'takeaway'">外卖</text>
|
<text class="sendType" v-if="item.sendType == 'post'">快递</text>
|
||||||
<text v-if="item.sendType == 'takeself'">自提</text>
|
<text class="sendType" v-if="item.sendType == 'takeaway'">外卖</text>
|
||||||
<text v-if="item.sendType == 'table'">堂食</text>
|
<text class="sendType" v-if="item.sendType == 'takeself'">自提</text>
|
||||||
|
<text class="sendType" v-if="item.sendType == 'table'">堂食</text>
|
||||||
|
<text class="shopName"> {{ item.shopName || ''}} </text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<text class="status" v-if="item.status == 'unpaid' || item.status == 'paying'">
|
<text class="status" v-if="item.status == 'unpaid' || item.status == 'paying'">
|
||||||
<text>待支付</text>
|
<text style="color: #333;">待付款</text>
|
||||||
</text>
|
</text>
|
||||||
<text class="status" v-if="item.status == 'unsend'">
|
<text class="status" v-if="item.status == 'unsend'">
|
||||||
<text>待发货</text>
|
<text>待发货</text>
|
||||||
</text>
|
</text>
|
||||||
<text class="status" v-if="item.status == 'closed'">
|
<text class="status" v-if="item.status == 'closed'">
|
||||||
<text>订单完成</text>
|
<text>已完成</text>
|
||||||
</text>
|
</text>
|
||||||
<text class="status" v-if="item.status == 'send'">
|
<text class="status" v-if="item.status == 'send'">
|
||||||
<text> 已发</text>
|
<text> 已发</text>
|
||||||
@@ -67,32 +54,27 @@
|
|||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
|
<view></view>
|
||||||
|
<view class="intro-wrap">
|
||||||
|
下单日期:{{$u.timeFormat(item.createdAt, 'yyyy-mm-dd hh:MM')}}
|
||||||
|
</view>
|
||||||
<view class="shop-info">
|
<view class="shop-info">
|
||||||
<view class="shop-item">
|
<view class="shop-item">
|
||||||
<view class="cover flex-start" v-for="(item1,index1) in item.detailList" :key="index1">
|
<view class="cover" v-for="(item1,index1) in item.detailList" :key="index1">
|
||||||
<!-- <image :src="item1.productImg" style="width: 200rpx;height: 200rpx; border-radius: 20rpx;" mode="widthFix"></image> -->
|
<u-image width="112" height="112" radius="20" :src="item1.productImg"></u-image>
|
||||||
<c-image width="200" height="200" radius="20" :src="item1.productImg"></c-image>
|
<text class="productName"> {{ item1.productName }} </text>
|
||||||
</view>
|
|
||||||
<!-- <view class="info">
|
|
||||||
<text class="name">美味大宅蟹</text>
|
|
||||||
<text class="num">数量:1</text>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="total" v-if="item.status != 'cancelled'">
|
<view class="shop-amount">
|
||||||
<text class="t">{{item.description}}</text>
|
<text class="orderAmount">¥{{item.orderAmount}}</text>
|
||||||
<text class="i">¥</text>
|
<text class="totalNumber">共{{item.totalNumber}}件</text>
|
||||||
<text class="num">{{item.orderAmount}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="intro-wrap">
|
|
||||||
<text class="time">下单日期:{{$u.timeFormat(item.createdAt, 'yyyy-mm-dd hh:MM')}}</text>
|
|
||||||
<text class="intro num">共{{item.totalNumber}}件商品 合计:¥{{item.orderAmount}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="footer-wrap">
|
<view class="footer-wrap">
|
||||||
<view class="btn">
|
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)" v-if="item.status != 'unpaid' && item.status != 'paying'"> 删除订单 </view>
|
||||||
<text>查看详情</text>
|
<view class="btn s" @click.stop="$u.debounce(showpopupclick(item),1000)" v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -120,8 +102,9 @@
|
|||||||
<button v-if="item.status=='unpaid'" type="primary" class="buttonStyle">去付款</button>
|
<button v-if="item.status=='unpaid'" type="primary" class="buttonStyle">去付款</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||||
v-if="is_end" mode="aspectFill"></image>
|
v-if="list.length <= 0 " mode="aspectFill"></image>
|
||||||
|
<u-modal width="450rpx" :show="removeOrderShow" @confirm="$u.debounce(removeOrder(),1000)" @cancel="removeOrderShow = false" @close="removeOrderShow = false" :showCancelButton="true" :closeOnClickOverlay="true" :title="'是否删除当前订单'" ></u-modal>
|
||||||
<u-loadmore :status="form.status" fontSize="28" color="#999" iconSize="28" />
|
<u-loadmore :status="form.status" fontSize="28" color="#999" iconSize="28" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -155,7 +138,7 @@
|
|||||||
status: 'closed'
|
status: 'closed'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '退款',
|
name: '退款/售后',
|
||||||
type: 5,
|
type: 5,
|
||||||
status: 'refund'
|
status: 'refund'
|
||||||
},
|
},
|
||||||
@@ -196,6 +179,9 @@
|
|||||||
size: 10,
|
size: 10,
|
||||||
status: 'loadmore',
|
status: 'loadmore',
|
||||||
},
|
},
|
||||||
|
removeOrderShow: false,
|
||||||
|
orderItem: null,
|
||||||
|
orderIndex: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -295,12 +281,9 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.form.status = 'loading';
|
this.form.status = 'loading';
|
||||||
setTimeout(() => {
|
|
||||||
if (this.form.page == 1) {
|
if (this.form.page == 1) {
|
||||||
console.log(111)
|
|
||||||
this.list = res.data.list
|
this.list = res.data.list
|
||||||
} else {
|
} else {
|
||||||
console.log(222)
|
|
||||||
this.list = [...this.list, ...res.data.list];
|
this.list = [...this.list, ...res.data.list];
|
||||||
}
|
}
|
||||||
this.form.page = ++this.form.page;
|
this.form.page = ++this.form.page;
|
||||||
@@ -309,10 +292,92 @@
|
|||||||
} else {
|
} else {
|
||||||
this.form.status = 'loading';
|
this.form.status = 'loading';
|
||||||
}
|
}
|
||||||
}, 500)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isRemoveOrder ( item , index ) {
|
||||||
|
this.removeOrderShow = true;
|
||||||
|
this.orderItem = item;
|
||||||
|
this.orderIndex = index;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单
|
||||||
|
*/
|
||||||
|
async removeOrder () {
|
||||||
|
let res = await this.api.removeOrder({
|
||||||
|
orderId: this.orderItem.id,
|
||||||
|
})
|
||||||
|
if ( res.code == 0 ) {
|
||||||
|
this.removeOrderShow = false;
|
||||||
|
this.list.splice(this.orderIndex , 1 )
|
||||||
|
uni.showToast({
|
||||||
|
title: "删除成功",
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 立即付款
|
||||||
|
*/
|
||||||
|
async showpopupclick(item) {
|
||||||
|
let res = await this.api.payorderPay({
|
||||||
|
orderId: item.id,
|
||||||
|
}) //判断是否支付成功
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'wxpay', //支付类型-固定值
|
||||||
|
partnerid: res.data.appId, // 微信支付商户号
|
||||||
|
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||||
|
nonceStr: res.data.nonceStr, // 随机字符串
|
||||||
|
package: res.data.package, // 固定值
|
||||||
|
signType: res.data.signType, //固定值
|
||||||
|
paySign: res.data.paySign, //签名
|
||||||
|
success: (res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付成功"
|
||||||
|
})
|
||||||
|
setTimeout(res => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/order/order'
|
||||||
|
});
|
||||||
|
}, 500)
|
||||||
|
this.paymodfiyOrderInfo()
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '支付失败'
|
||||||
|
})
|
||||||
|
setTimeout(res => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/order/order'
|
||||||
|
});
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 支付完成后请求
|
||||||
|
*/
|
||||||
|
async paymodfiyOrderInfo() {
|
||||||
|
let res = await this.api.paymodfiyOrderInfo({
|
||||||
|
orderId: this.listinfo.orderId,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
async getorderList() {
|
async getorderList() {
|
||||||
let res = await this.api.groupOrderInfo({
|
let res = await this.api.groupOrderInfo({
|
||||||
page: this.form.page,
|
page: this.form.page,
|
||||||
@@ -339,17 +404,17 @@
|
|||||||
}
|
}
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
$tabH: 80upx;
|
|
||||||
$color: #ff411d;
|
|
||||||
|
|
||||||
page {
|
page {
|
||||||
background: #f6f6f6;
|
// background: #f6f6f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navtab {
|
.navtab {
|
||||||
@@ -397,47 +462,39 @@
|
|||||||
.tab-wrap {
|
.tab-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #ffd158;
|
background: #fff;
|
||||||
padding: 48rpx 0 72rpx 0;
|
padding: 40rpx 46rpx;
|
||||||
|
border-radius: 0rpx 0rpx 34rpx 34rpx;
|
||||||
.item {
|
.item {
|
||||||
flex: 1;
|
flex: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #fff;
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item.active{
|
||||||
|
text{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #000000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.line-wrap {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 48rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
padding-bottom: 8upx;
|
|
||||||
transition: all 0.3s ease-in-out;
|
|
||||||
|
|
||||||
.line {
|
|
||||||
$h: 6upx;
|
|
||||||
margin-top: 6rpx;
|
|
||||||
// width: 30%;
|
|
||||||
// height: $h;
|
|
||||||
border-radius: $h;
|
|
||||||
// background-color: $color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-wrap {
|
.list-wrap {
|
||||||
padding: $paddingSize;
|
padding: 0 28rpx 48rpx 28rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: -24rpx;
|
margin-top: 48rpx;
|
||||||
z-index: 99999;
|
|
||||||
background: #f6f6f6;
|
|
||||||
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
@@ -445,98 +502,122 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
&:not(:first-child) {
|
&:not(:first-child) {
|
||||||
margin-top: $paddingSize;
|
margin-top: 48rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-wrap {
|
.header-wrap {
|
||||||
padding: $paddingSize;
|
padding: 16rpx 18rpx;
|
||||||
border-bottom: 1upx solid #ececec;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.header-wrap-left{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.sendType{
|
||||||
|
height: 48rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #E3AD7F;
|
||||||
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
|
border: 2rpx solid #E3AD7F;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
.shopName{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
.status {
|
.status {
|
||||||
color: $color;
|
text{
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: $paddingSize;
|
padding: 0 18rpx 18rpx 18rpx;
|
||||||
|
|
||||||
.shop-info {
|
.shop-info {
|
||||||
|
display: flex;
|
||||||
.shop-item {
|
.shop-item {
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
|
|
||||||
.cover:nth-child(1) {
|
.cover:nth-child(1) {
|
||||||
margin-left: 0rpx;
|
margin-left: 0rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cover {
|
.cover {
|
||||||
|
margin-left: 20rpx;
|
||||||
// white-space: nowrap;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-around;
|
align-items: center;
|
||||||
padding-left: 20upx;
|
flex-shrink: 0;
|
||||||
}
|
.productName{
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-top: 16rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.total {
|
}
|
||||||
|
.shop-amount{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
justify-content: flex-end;
|
flex-shrink: 0;
|
||||||
|
padding-left: 20rpx;
|
||||||
.t {
|
.orderAmount{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32upx;
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-bottom: 22rpx;
|
||||||
}
|
}
|
||||||
|
.totalNumber{
|
||||||
.i {
|
font-weight: 400;
|
||||||
font-size: 24upx;
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.num {
|
|
||||||
font-size: 38upx;
|
|
||||||
position: relative;
|
|
||||||
top: 8upx;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.intro-wrap {
|
.intro-wrap {
|
||||||
display: flex;
|
font-weight: 400;
|
||||||
justify-content: space-between;
|
color: #666;
|
||||||
padding-top: $paddingSize;
|
|
||||||
|
|
||||||
.time {
|
|
||||||
color: #999;
|
|
||||||
font-size: 24upx;
|
font-size: 24upx;
|
||||||
}
|
margin-bottom: 16rpx;
|
||||||
|
|
||||||
.intro {
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-wrap {
|
.footer-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
border-top: 1upx solid #ececec;
|
padding: 0 18rpx 32rpx 18rpx;
|
||||||
padding: $paddingSize;
|
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
padding: 8upx 24upx;
|
width: 128rpx;
|
||||||
border-radius: 100upx;
|
height: 48rpx;
|
||||||
border: 1px solid #333;
|
line-height: 43rpx;
|
||||||
display: flex;
|
text-align: center;
|
||||||
align-items: center;
|
background: #FFFFFF;
|
||||||
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
|
border: 2rpx solid #EDEDED;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-left: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.s{
|
||||||
|
background: #343030;
|
||||||
|
border: 2rpx solid #EDEDED;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
|
<view class="card_box">
|
||||||
|
<view class="card_head_box">
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
<view class="card_head_item"></view>
|
||||||
|
</view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
|
<!-- 订单头部 -->
|
||||||
<view class="head">
|
<view class="head">
|
||||||
<text class="title">
|
<view class="head_left">
|
||||||
<text>{{listinfo.name}}</text>
|
<text class="shopName">{{listinfo.name}}</text>
|
||||||
</text>
|
<text class="tableName" v-if="listinfo.tableName">「桌号:{{listinfo.tableName}}」</text>
|
||||||
|
</view>
|
||||||
<text class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<text class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||||
<text> 待支付 </text>
|
<text> 待支付 </text>
|
||||||
</text>
|
</text>
|
||||||
@@ -29,65 +42,66 @@
|
|||||||
<text class="status" v-if="listinfo.status == 'merge'">
|
<text class="status" v-if="listinfo.status == 'merge'">
|
||||||
<text>合台</text>
|
<text>合台</text>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 取餐号 -->
|
||||||
|
<view class="number-wrap"
|
||||||
|
v-if="listinfo.status != 'unpaid' && listinfo.status != 'paying'&& listinfo.status != 'cancelled'">
|
||||||
|
<text class="t">取餐号</text>
|
||||||
|
<text class="number">{{listinfo.outNumber}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 订单详情 -->
|
||||||
|
<view class="shop-box">
|
||||||
|
<view class="shop-head">
|
||||||
|
<view class="shop-head-left">
|
||||||
<view class="tag-wrap">
|
<view class="tag-wrap">
|
||||||
<text class="tag" v-if="listinfo.sendType == 'post'">快递</text>
|
<text class="tag" v-if="listinfo.sendType == 'post'">快递</text>
|
||||||
<text class="tag" v-if="listinfo.sendType == 'takeaway'">外卖</text>
|
<text class="tag" v-if="listinfo.sendType == 'takeaway'">外卖</text>
|
||||||
<text class="tag" v-if="listinfo.sendType == 'takeself'">自提</text>
|
<text class="tag" v-if="listinfo.sendType == 'takeself'">自提</text>
|
||||||
<text class="tag" v-if="listinfo.sendType == 'table'">堂食</text>
|
<text class="tag" v-if="listinfo.sendType == 'table'">堂食</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="listinfo.tableName">
|
<text class="title">订单详情</text>
|
||||||
桌号:{{listinfo.tableName}}
|
|
||||||
</view>
|
</view>
|
||||||
<view class="number-wrap" style="margin-top: 20rpx;"
|
|
||||||
v-if="listinfo.status != 'unpaid' && listinfo.status != 'paying'&& listinfo.status != 'cancelled'">
|
|
||||||
<text class="t">取餐号</text>
|
|
||||||
<text class="number">{{listinfo.outNumber}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="card">
|
|
||||||
<view class="head border" style="position: relative;">
|
|
||||||
<text class="title">
|
|
||||||
<text>点单详情</text>
|
|
||||||
</text>
|
|
||||||
|
|
||||||
<view style="display: flex;align-items: center;"
|
<view style="display: flex;align-items: center;"
|
||||||
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"
|
||||||
|
>
|
||||||
<!-- <text style="font-size:24rpx;">支付时间:</text> -->
|
<!-- <text style="font-size:24rpx;">支付时间:</text> -->
|
||||||
<uni-countdown :show-day="false" color="#ff0000" border-color="#00B26A" splitorColor="#000"
|
<uni-countdown :show-day="false" color="#E3AD7F" border-color="#E3AD7F" splitorColor="#E3AD7F"
|
||||||
:font-size="14" :hour="0" :minute="listinfo.expiredMinutes" :second="listinfo.expiredSeconds" />
|
:font-size="16" :hour="0" :minute="listinfo.expiredMinutes" :second="listinfo.expiredSeconds" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="shop-info">
|
<view class="shop-info">
|
||||||
<view class="item" v-for="(item,index) in listinfo.details" :key="index">
|
<view class="item" v-for="(item,index) in listinfo.details" :key="index">
|
||||||
<view class="cover">
|
<view class="cover">
|
||||||
<c-image width="120" height="120" radius="16" :src='item.productImg'></c-image>
|
<u-image width="152" height="152" radius="16" :src='item.productImg'></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text>{{item.productName}}</text>
|
<text class="productName">{{item.productName}}</text>
|
||||||
<text class="n" v-if="item.productSkuName">{{item.productSkuName}}</text>
|
<text class="productSkuName" v-if="item.productSkuName">{{item.productSkuName}}</text>
|
||||||
<text class="n">x{{item.num}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<text class="i">¥</text>
|
<view class="priceAmount">¥{{item.priceAmount}}</view>
|
||||||
<text class="num">{{item.priceAmount}}</text>
|
<view class="num">x{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="total-wrap">
|
<view class="total-wrap">
|
||||||
<view class="price">
|
<view>合计:</view>
|
||||||
<text>合计:</text>
|
<view class="price"> ¥{{listinfo.payAmount}} </view>
|
||||||
<text class="i">¥</text>
|
|
||||||
<text class="num">{{listinfo.payAmount}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 订单信息 -->
|
||||||
|
<view class="order_footer">
|
||||||
|
<view class="order_footer_icon">
|
||||||
|
<view class="order_footer_left_icon"></view>
|
||||||
|
<view class="order_footer_right_icon"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card">
|
<view class="title">订单信息</view>
|
||||||
<view class="head border">
|
|
||||||
<text class="title">订单信息</text>
|
|
||||||
</view>
|
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
<view class="row" @click="copyHandle(listinfo.orderNo)">
|
<view class="row" @click="copyHandle(listinfo.orderNo)">
|
||||||
<text class="t">订单信息:</text>
|
<text class="t">订单信息:</text>
|
||||||
@@ -99,21 +113,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="card" style="padding-bottom: 20rpx;" v-if="listinfo.shopQrcode">
|
|
||||||
<image :src="listinfo.shopQrcode" show-menu-by-longpress="true" style="width: 100%;" mode="widthFix">
|
|
||||||
</image>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view :style="{height:height}">
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="fixedview">
|
<view class="fixedview">
|
||||||
<view class="flex-between" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<view class="flex-between" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||||
<view class="fixedview_one flex-start">
|
<view class="fixedview_one flex-start">
|
||||||
<view class="fixedview_oneone">
|
<view class="fixedview_oneone"> 实付金额: </view>
|
||||||
实付金额:
|
|
||||||
</view>
|
|
||||||
<view class="fixedview_onetow">
|
<view class="fixedview_onetow">
|
||||||
<text>¥</text>{{listinfo.payAmount}}
|
<text>¥</text>{{listinfo.payAmount}}
|
||||||
</view>
|
</view>
|
||||||
@@ -131,7 +136,6 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
height: '',
|
|
||||||
pay_type: 1,
|
pay_type: 1,
|
||||||
orderId: '',
|
orderId: '',
|
||||||
listinfo: {},
|
listinfo: {},
|
||||||
@@ -151,35 +155,30 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
mountedcreateSelectorQuery() {
|
/**
|
||||||
//#ifdef MP-WEIXIN || H5
|
* 获取订单信息
|
||||||
var query = uni.createSelectorQuery().in(this).select('.fixedview')
|
*/
|
||||||
query.boundingClientRect(ele => {
|
async orderorderInfo() {
|
||||||
var that = this;
|
let res = await this.api.orderorderInfo({
|
||||||
console.log(ele, 111)
|
orderId: this.orderId
|
||||||
that.height = (ele.height) + "px"
|
|
||||||
that = null;
|
|
||||||
// uni.getSystemInfo({
|
|
||||||
// success(res) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}).exec();
|
|
||||||
//#endif
|
|
||||||
//#ifdef MP-ALIPAY
|
|
||||||
my.createSelectorQuery().selectAll('.fixedview').boundingClientRect().exec(ele => {
|
|
||||||
var nodeData = ele[0]
|
|
||||||
var that = this;
|
|
||||||
that.height = (nodeData.height) + "px";
|
|
||||||
that = null;
|
|
||||||
})
|
})
|
||||||
//#endif
|
if (res.code == 0) {
|
||||||
|
this.listinfo = res.data;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付完成后请求
|
||||||
|
*/
|
||||||
async paymodfiyOrderInfo() {
|
async paymodfiyOrderInfo() {
|
||||||
let res = await this.api.paymodfiyOrderInfo({
|
let res = await this.api.paymodfiyOrderInfo({
|
||||||
orderId: this.listinfo.orderId,
|
orderId: this.listinfo.orderId,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 立即付款
|
||||||
|
*/
|
||||||
async showpopupclick() {
|
async showpopupclick() {
|
||||||
let res = await this.api.payorderPay({
|
let res = await this.api.payorderPay({
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
@@ -227,15 +226,11 @@
|
|||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async orderorderInfo() {
|
|
||||||
let res = await this.api.orderorderInfo({
|
/**
|
||||||
orderId: this.orderId
|
* 复制订单号
|
||||||
})
|
* @param {Object} e
|
||||||
if (res.code == 0) {
|
*/
|
||||||
this.listinfo = res.data
|
|
||||||
this.mountedcreateSelectorQuery()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
copyHandle(e) {
|
copyHandle(e) {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: e,
|
data: e,
|
||||||
@@ -247,67 +242,96 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clickselect(b) {
|
|
||||||
this.pay_type = b
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
page{
|
||||||
|
background-color: #F7F7F7;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
padding: 28upx;
|
padding: 32rpx 28rpx 194rpx 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card_box{
|
||||||
|
background-color: #fff;
|
||||||
|
// box-shadow: 0rpx 8rpx 12rpx 2rpx rgba(87,86,86,0.35);
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-shadow: 0rpx 4rpx 12rpx 2rpx rgba(87,86,86,0.35);
|
||||||
|
border-radius: 18rpx;
|
||||||
|
.card_head_box{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
position: absolute;
|
||||||
|
top: -22.5rpx;
|
||||||
|
padding: 0 44rpx;
|
||||||
|
.card_head_item{
|
||||||
|
width: 45rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: inset 0rpx -13rpx 18rpx -16rpx rgba(87, 86, 86, 0.35);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
background-color: #fff;
|
// background-color: #fff;
|
||||||
border-radius: 20upx;
|
border-radius: 20upx;
|
||||||
padding: 28upx;
|
|
||||||
margin-bottom: 28upx;
|
margin-bottom: 28upx;
|
||||||
|
position: relative;
|
||||||
.head {
|
.head {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
padding: 50rpx 34rpx 32rpx 34rpx;
|
||||||
&.border {
|
border-bottom: 2rpx dashed #E3E3E3;
|
||||||
padding-bottom: 28upx;
|
.head_left{
|
||||||
border-bottom: 1upx solid #fafafa;
|
.shopName{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
.tableName{
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
color: #ff0000;
|
text{
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag-wrap {
|
|
||||||
padding: 20upx 0;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 0 10upx;
|
|
||||||
color: $color-priamry;
|
|
||||||
border: 1px solid $color-priamry;
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.number-wrap {
|
.number-wrap {
|
||||||
background-color: #fafafa;
|
|
||||||
border-radius: 16upx;
|
|
||||||
padding: 28upx 0;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
margin-top: 32rpx;
|
||||||
|
.t{
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
.number {
|
.number {
|
||||||
font-size: 42upx;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
font-size: 56rpx;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
.i {
|
.i {
|
||||||
font-size: 20upx;
|
font-size: 20upx;
|
||||||
@@ -318,98 +342,175 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shop-box{
|
||||||
|
padding: 36rpx 34rpx 30rpx 34rpx;
|
||||||
|
border-bottom: 2rpx dashed #E3E3E3;
|
||||||
|
.shop-head{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.shop-head-left{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.tag-wrap{
|
||||||
|
width: 80rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
|
border: 2rpx solid #E3AD7F;
|
||||||
|
margin-right: 18rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.tag{
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #E3AD7F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
.shop-info {
|
.shop-info {
|
||||||
padding: 28upx 0;
|
margin-top: 32rpx;
|
||||||
|
|
||||||
.item:nth-child(1) {
|
.item:nth-child(1) {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
margin-top: 16rpx;
|
margin-bottom: 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
.cover{
|
||||||
|
|
||||||
|
}
|
||||||
.info {
|
.info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
padding-left: 16upx;
|
||||||
padding-left: 28upx;
|
.productName{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
.productSkuName{
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
.n {
|
.n {
|
||||||
font-size: 24upx;
|
font-size: 24upx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.price{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
padding-left: 68rpx;
|
||||||
|
.priceAmount{
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 26rpx;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 22rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.total-wrap {
|
.total-wrap {
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: space-between;
|
||||||
padding-top: 28upx;
|
font-weight: 500;
|
||||||
border-top: 1upx solid #fafafa;
|
font-size: 28rpx;
|
||||||
|
.price{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.order_footer{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 34rpx;
|
||||||
|
position: relative;
|
||||||
|
.order_footer_icon{
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: -22.5rpx;
|
||||||
|
left: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
.order_footer_left_icon{
|
||||||
|
width: 45rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
margin-left: -22.5rpx;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: inset -20rpx 0rpx 22rpx -20rpx rgba(87, 86, 86, 0.35);
|
||||||
|
|
||||||
|
}
|
||||||
|
.order_footer_right_icon{
|
||||||
|
width: 45rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
margin-right: -22.5rpx;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: inset 13rpx 0rpx 16rpx -9rpx rgba(87, 86, 86, 0.35);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
.order-info {
|
.order-info {
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-top: 28upx;
|
padding-top: 32upx;
|
||||||
|
|
||||||
.t {
|
.t {
|
||||||
font-size: 24upx;
|
font-weight: normal;
|
||||||
color: #999;
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
font-size: 24upx;
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666666;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sixcontent {
|
|
||||||
width: 100%;
|
|
||||||
background: #FFFFFF;
|
|
||||||
padding: 32rpx;
|
|
||||||
margin-top: 32rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
|
|
||||||
.sixcontentone {
|
|
||||||
padding-bottom: 28rpx;
|
|
||||||
border-bottom: 1px solid #F7F7F7;
|
|
||||||
|
|
||||||
.sixcontent_one {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sixcontenttow {
|
|
||||||
.sixcontenttowitem {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
|
|
||||||
.sixcontenttowitemone {
|
|
||||||
image {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
width: 31.37rpx;
|
|
||||||
height: 27.34rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontenttowitemonetext {
|
|
||||||
margin-left: 14rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview {
|
.fixedview {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -419,37 +520,38 @@
|
|||||||
|
|
||||||
.flex-between {
|
.flex-between {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 48rpx 28rpx;
|
padding: 36rpx 54rpx 102rpx 54rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
|
|
||||||
.fixedview_one {
|
.fixedview_one {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
.fixedview_oneone {
|
.fixedview_oneone {
|
||||||
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
color: #666666;
|
||||||
font-weight: normal;
|
|
||||||
color: #333333;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixedview_onetow {
|
.fixedview_onetow {
|
||||||
font-size: 44rpx;
|
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #F45C4C;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixedview_tow {
|
.fixedview_tow {
|
||||||
background: red;
|
width: 140rpx;
|
||||||
border-radius: 34rpx;
|
height: 56rpx;
|
||||||
padding: 10rpx 44rpx;
|
line-height: 56rpx;
|
||||||
font-size: 32rpx;
|
text-align: center;
|
||||||
font-family: PingFang SC-Bold, PingFang SC;
|
background: #E3AD7F;
|
||||||
font-weight: bold;
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
<view class="shop-item">
|
<view class="shop-item">
|
||||||
<view class="cover flex-start" v-for="(item1,index1) in item.detailList" :key="index1">
|
<view class="cover flex-start" v-for="(item1,index1) in item.detailList" :key="index1">
|
||||||
<!-- <image :src="item1.productImg" style="width: 200rpx;height: 200rpx; border-radius: 20rpx;" mode="widthFix"></image> -->
|
<!-- <image :src="item1.productImg" style="width: 200rpx;height: 200rpx; border-radius: 20rpx;" mode="widthFix"></image> -->
|
||||||
<c-image width="200" height="200" radius="20" :src="item1.productImg"></c-image>
|
<u-image width="200" height="200" radius="20" :src="item1.productImg"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="info">
|
<!-- <view class="info">
|
||||||
<text class="name">美味大宅蟹</text>
|
<text class="name">美味大宅蟹</text>
|
||||||
|
|||||||
@@ -1,543 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="container">
|
|
||||||
<view class="card">
|
|
||||||
<view class="shop-info">
|
|
||||||
<view class="item" v-for="(item,index) in cartLists.data" :key="index">
|
|
||||||
<view class="cover">
|
|
||||||
<c-image width="120" height="120" radius="16" :src='item.coverImg'></c-image>
|
|
||||||
</view>
|
|
||||||
<view class="info">
|
|
||||||
<text>{{item.name}}</text>
|
|
||||||
<text class="n">{{item.skuName}}</text>
|
|
||||||
<text class="n">x{{item.number}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="price">
|
|
||||||
<text class="i">¥</text>
|
|
||||||
<text class="num">{{item.salePrice}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 支付密码 -->
|
|
||||||
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-if="ispws"></payPassword>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// import {object} from 'prop-types';
|
|
||||||
import webSocketUtils from '@/common/js/websocket.js'
|
|
||||||
import payPassword from '@/components/payPassword.vue'
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
payPassword
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
height: '',
|
|
||||||
pay_type: 1,
|
|
||||||
remark: '',
|
|
||||||
listinfo: {
|
|
||||||
detailList: [],
|
|
||||||
amount: '',
|
|
||||||
amounts: ''
|
|
||||||
},
|
|
||||||
emitorderfoodform: {
|
|
||||||
clickiconone: ''
|
|
||||||
},
|
|
||||||
orderInfo: '',
|
|
||||||
// 可用优惠券数据
|
|
||||||
couponAmount: 0,
|
|
||||||
// 输入支付密码 123
|
|
||||||
ispws: false,
|
|
||||||
listinfoid: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
cartLists: {
|
|
||||||
type: Object,
|
|
||||||
default () {
|
|
||||||
return {
|
|
||||||
amount: '0.00',
|
|
||||||
data: []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
radiovalue: {
|
|
||||||
type: String,
|
|
||||||
default: '1'
|
|
||||||
},
|
|
||||||
amountVIP: {
|
|
||||||
type: Object,
|
|
||||||
default () {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onUnload() {
|
|
||||||
this.ispws = false
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
groupChange(n) {
|
|
||||||
this.radiovalue = n
|
|
||||||
},
|
|
||||||
async getAount() {
|
|
||||||
let res = await this.api.shopUserInfo({
|
|
||||||
"shopId": uni.cache.get('shopUser'),
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.amountVIP = res.data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
orderfoodindex() { //优惠劵
|
|
||||||
uni.pro.navigateTo('index/coupons/index', {
|
|
||||||
orderfood: 0,
|
|
||||||
orderId: this.listinfoid,
|
|
||||||
amount: this.listinfo.amounts
|
|
||||||
})
|
|
||||||
},
|
|
||||||
copyHandle(e) {
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: e,
|
|
||||||
success() {
|
|
||||||
uni.showToast({
|
|
||||||
title: '复制成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async paymodfiyOrderInfo() { //支付完成后请求
|
|
||||||
let res = await this.api.paymodfiyOrderInfo({
|
|
||||||
orderId: this.listinfoid,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goRecharge() { // 去充值
|
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
|
||||||
shopId: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showpopupclickddes(ID) {
|
|
||||||
// radiovalue为1是微信支付
|
|
||||||
this.listinfoid = ID
|
|
||||||
if (this.radiovalue == 1) {
|
|
||||||
this.showpopupclickdds() //微信支付
|
|
||||||
} else {
|
|
||||||
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
|
|
||||||
// console.log(isPwd,'是否设置了支付密码')
|
|
||||||
if (uni.cache.get('userInfo').isPwd == 0) {
|
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
|
||||||
shopId_id: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.ispws = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.payPwd.onPayUp();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 微信支付
|
|
||||||
async showpopupclickdds() {
|
|
||||||
let res = await this.api.payorderPay({
|
|
||||||
orderId: this.listinfoid
|
|
||||||
}) //判断是否支付成功
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
// 微信支付还是余额支付
|
|
||||||
uni.requestPayment({
|
|
||||||
provider: 'wxpay', //支付类型-固定值
|
|
||||||
partnerid: res.data.appId, // 微信支付商户号
|
|
||||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
|
||||||
nonceStr: res.data.nonceStr, // 随机字符串
|
|
||||||
package: res.data.package, // 固定值
|
|
||||||
signType: res.data.signType, //固定值
|
|
||||||
paySign: res.data.paySign, //签名
|
|
||||||
success: (res) => {
|
|
||||||
let _this = this
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
|
||||||
complete() {
|
|
||||||
uni.showToast({
|
|
||||||
title: "支付成功"
|
|
||||||
})
|
|
||||||
// uni.cache.set('shopUser', '') //删除shopUser
|
|
||||||
_this.paymodfiyOrderInfo()
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/order/order_detail?orderId=' + _this
|
|
||||||
.listinfoid
|
|
||||||
});
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 余额支付
|
|
||||||
async accountPayevent(pwd) {
|
|
||||||
this.ispws = false
|
|
||||||
let res = await this.api.accountPay({
|
|
||||||
orderId: this.listinfoid,
|
|
||||||
memberId: this.amountVIP.id,
|
|
||||||
// remark: this.remark,
|
|
||||||
pwd
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
// data ->1 支付成功
|
|
||||||
// ->2 余额不足
|
|
||||||
// ->3 未设置支付密码,
|
|
||||||
// ->4 不是会员,
|
|
||||||
if (res.data == 1) {
|
|
||||||
this.showToastUppop('支付成功')
|
|
||||||
let _this = this
|
|
||||||
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
|
||||||
complete() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/order/order_detail?orderId=' + _this
|
|
||||||
.listinfoid
|
|
||||||
});
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
} else if (res.data == 2) {
|
|
||||||
this.showToastUppop('余额不足')
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
} else if (res.data == 3) {
|
|
||||||
this.showToastUppop('未设置支付密码')
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
|
||||||
shopId_id: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
}, 1500)
|
|
||||||
|
|
||||||
} else if (res.data == 4) {
|
|
||||||
this.showToastUppop('非会员请充值')
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
showToastUppop(title) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title,
|
|
||||||
success: () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
async mounted() {
|
|
||||||
uni.getSystemInfo({
|
|
||||||
success: (data) => {
|
|
||||||
this.height = (data.windowHeight / 2) + "px";
|
|
||||||
console.log(this.height, 1111);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// //#ifdef MP-WEIXIN || H5
|
|
||||||
// var query = uni.createSelectorQuery().in(this).select('.fixedview')
|
|
||||||
// query.boundingClientRect(ele => {
|
|
||||||
// var that = this;
|
|
||||||
// that.height = (ele.height) + "px";
|
|
||||||
// that = null;
|
|
||||||
// }).exec();
|
|
||||||
// //#endif
|
|
||||||
// //#ifdef MP-ALIPAY
|
|
||||||
// my.createSelectorQuery().selectAll('.fixedview').boundingClientRect().exec(ele => {
|
|
||||||
// var nodeData = ele[0]
|
|
||||||
// var that = this;
|
|
||||||
// that.height = (nodeData.height) + "px";
|
|
||||||
// that = null;
|
|
||||||
// })
|
|
||||||
// //#endif
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.container {
|
|
||||||
padding: 0 28upx 28upx 28upx 28upx;
|
|
||||||
max-height: 600px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 20upx;
|
|
||||||
padding: 28upx;
|
|
||||||
margin-bottom: 48rpx;
|
|
||||||
|
|
||||||
.head {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
&.border {
|
|
||||||
padding-bottom: 28upx;
|
|
||||||
border-bottom: 1upx solid #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
color: #ff0000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-wrap {
|
|
||||||
padding: 28upx 0;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 0 10upx;
|
|
||||||
color: $color-priamry;
|
|
||||||
border: 1px solid $color-priamry;
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.number-wrap {
|
|
||||||
background-color: #fafafa;
|
|
||||||
border-radius: 16upx;
|
|
||||||
padding: 28upx 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.number {
|
|
||||||
font-size: 42upx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.price {
|
|
||||||
.i {
|
|
||||||
font-size: 20upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.num {
|
|
||||||
font-size: 38upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop-info {
|
|
||||||
padding: 28upx 0;
|
|
||||||
|
|
||||||
.item:nth-child(1) {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-left: 28upx;
|
|
||||||
|
|
||||||
.n {
|
|
||||||
font-size: 24upx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.total-wrap {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding-top: 28upx;
|
|
||||||
border-top: 1upx solid #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-info {
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-top: 28upx;
|
|
||||||
|
|
||||||
.t {
|
|
||||||
font-size: 24upx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontent {
|
|
||||||
width: 100%;
|
|
||||||
background: #FFFFFF;
|
|
||||||
padding: 32rpx;
|
|
||||||
margin-top: 32rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
|
|
||||||
.sixcontentone {
|
|
||||||
padding-bottom: 28rpx;
|
|
||||||
border-bottom: 1px solid #F7F7F7;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
|
|
||||||
.sixcontent_one {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontenttow {
|
|
||||||
.sixcontenttowitem {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
|
|
||||||
.sixcontenttowitemone {
|
|
||||||
image {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
width: 31.37rpx;
|
|
||||||
height: 27.34rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontenttowitemonetext {
|
|
||||||
margin-left: 14rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.redMoney {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 18rpx 14rpx;
|
|
||||||
|
|
||||||
>view:first-child {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
>view:last-child {
|
|
||||||
background: #FFE9E9;
|
|
||||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #FF3333;
|
|
||||||
text-align: center;
|
|
||||||
padding: 9rpx 13rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.payType {
|
|
||||||
padding: 32rpx 34rpx;
|
|
||||||
margin-top: 48rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
>view:first-child {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
>view:last-child {
|
|
||||||
margin-top: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dfs {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 180rpx;
|
|
||||||
padding: 16rpx 34rpx;
|
|
||||||
|
|
||||||
.flex-between {
|
|
||||||
width: 100%;
|
|
||||||
padding: 24rpx 28rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
|
|
||||||
.fixedview_one {
|
|
||||||
.fixedview_oneone {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_onetow {
|
|
||||||
font-size: 44rpx;
|
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #F45C4C;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_onethere {
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_tow {
|
|
||||||
background: red;
|
|
||||||
border-radius: 34rpx;
|
|
||||||
padding: 10rpx 44rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-family: PingFang SC-Bold, PingFang SC;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,813 +0,0 @@
|
|||||||
<template>
|
|
||||||
|
|
||||||
<view class="container">
|
|
||||||
<view class="card" v-if="listinfo.tableName">
|
|
||||||
<view class="head">
|
|
||||||
<text class="title">
|
|
||||||
<text>{{listinfo.tableName || '空'}}</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'unpaid'">
|
|
||||||
<text>待支付</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'unsend'">
|
|
||||||
<text>待发货</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'closed'">
|
|
||||||
<text>订单完成</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'send'">
|
|
||||||
<text>已发</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'refunding'">
|
|
||||||
<text>申请退单</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'refund'">
|
|
||||||
<text>退单</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'cancelled'">
|
|
||||||
<text>取消订单</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'merge'">
|
|
||||||
<text>合台</text>
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view class="tag-wrap">
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'post'">快递</text>
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'takeaway'">外卖</text>
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'takeself'">自提</text>
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'table'">堂食</text>
|
|
||||||
</view>
|
|
||||||
<view class="number-wrap"
|
|
||||||
v-if="listinfo.status != 'unpaid' && listinfo.status != 'paying'&& listinfo.status != 'cancelled'">
|
|
||||||
<text class="t">取餐号</text>
|
|
||||||
<text class="number">{{listinfo.outNumber || '空'}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="card" v-if="listinfoid && listinfo">
|
|
||||||
<view class="head border">
|
|
||||||
<text class="title">
|
|
||||||
<text>点单详情</text>
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view class="shop-info">
|
|
||||||
<view class="item" v-for="(item,index) in listinfo.details" :key="index">
|
|
||||||
<view class="cover">
|
|
||||||
<c-image width="120" height="120" radius="16" :src='item.productImg'></c-image>
|
|
||||||
</view>
|
|
||||||
<view class="info">
|
|
||||||
<text>{{item.productName}}</text>
|
|
||||||
<text class="n" v-if="item.productSkuName">{{item.productSkuName}}</text>
|
|
||||||
<text class="n">x{{item.num}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="price">
|
|
||||||
<text class="i">¥</text>
|
|
||||||
<text class="num">{{item.price}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="total-wrap">
|
|
||||||
<view class="price">
|
|
||||||
<text>合计:</text>
|
|
||||||
<text class="i">¥</text>
|
|
||||||
<text class="num">{{listinfo.payAmount}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="card" v-else>
|
|
||||||
<view class="shop-info">
|
|
||||||
<view class="item" v-for="(item,index) in cartLists.data" :key="index">
|
|
||||||
<view class="cover">
|
|
||||||
<c-image width="120" height="120" radius="16" :src='item.coverImg'></c-image>
|
|
||||||
</view>
|
|
||||||
<view class="info">
|
|
||||||
<text>{{item.name}}</text>
|
|
||||||
<text class="n">{{item.skuName}}</text>
|
|
||||||
<text class="n">x{{item.number}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="price">
|
|
||||||
<text class="i">¥</text>
|
|
||||||
<text class="num">{{item.salePrice}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="sixcontent">
|
|
||||||
<view class="sixcontentone flex-between" style="padding: 0 0;" @click="orderfoodindex">
|
|
||||||
<view class="sixcontent_one" style="padding: 0 0;">
|
|
||||||
优惠券
|
|
||||||
</view>
|
|
||||||
<text style="color: red;">{{emitorderfoodform.couponsPrice}}</text>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- <view class="redMoney">
|
|
||||||
<view>
|
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/hongbao.png"
|
|
||||||
style="width: 30rpx;height: 30.24rpx;;" mode=""></image>
|
|
||||||
红包/抵用券
|
|
||||||
</view>
|
|
||||||
<view @click="orderfoodindex">
|
|
||||||
可用优惠券{{couponAmount}}张
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<view style="padding: 0 20rpx;">
|
|
||||||
<u--textarea v-model="remark" placeholder="备注"></u--textarea>
|
|
||||||
</view>
|
|
||||||
<!-- 支付方式 -->
|
|
||||||
<view class="payType">
|
|
||||||
<view class="">
|
|
||||||
支付方式
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
<u-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChange" :size="28"
|
|
||||||
placement="column">
|
|
||||||
<u-radio activeColor="#ffd158" name="1">
|
|
||||||
<view class="dfs">
|
|
||||||
<image style="width:44rpx;height:44rpx"
|
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/balance.png" mode="">
|
|
||||||
</image>
|
|
||||||
<text style="font-size: 28rpx;margin-left: 16rpx;">
|
|
||||||
微信支付
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
</u-radio>
|
|
||||||
<view style="margin: 22rpx 0;width: 100%;height: 2rpx;background-color: #E5E5E5;">
|
|
||||||
</view>
|
|
||||||
<u-radio activeColor="#ffd158" name="2">
|
|
||||||
<view class="dfs">
|
|
||||||
<image style="width:44rpx;height:44rpx"
|
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png" mode="">
|
|
||||||
</image>
|
|
||||||
<text style="font-size: 28rpx;margin-left: 16rpx;">
|
|
||||||
会员卡支付</text>
|
|
||||||
</view>
|
|
||||||
</u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
<view style="font-weight: 400;font-size: 24rpx;color: #333333;margin-left: 60rpx;">
|
|
||||||
会员卡余额{{ amountVIP?amountVIP.amount:0}} <text
|
|
||||||
style="font-weight: 500;font-size: 28rpx;margin-left: 16rpx;color: #FF4C11;"
|
|
||||||
@click="goRecharge">去充值</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="sixcontent" >
|
|
||||||
<view class="sixcontentone flex-between">
|
|
||||||
<view class="sixcontent_one">
|
|
||||||
支付方式
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="sixcontenttow">
|
|
||||||
<view class="sixcontenttowitem flex-between" @click="clickselect(1)">
|
|
||||||
<view class="sixcontenttowitemone flex-start">
|
|
||||||
<u-icon name="weixin-fill" color="#999999" size="32"></u-icon>
|
|
||||||
<text class="sixcontenttowitemonetext">微信支付</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-start">
|
|
||||||
<u-icon v-if="pay_type == 1" name="checkmark-circle-fill" color="#333333" size="26"></u-icon>
|
|
||||||
<u-icon v-else name="checkmark-circle-fill" color="#999999" size="26"></u-icon>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="sixcontenttowitem flex-between" @click="clickselect(2)">
|
|
||||||
<view class="sixcontenttowitemone flex-start">
|
|
||||||
<u-icon name="zhifubao" color="#999999" size="26"></u-icon>
|
|
||||||
<text class="sixcontenttowitemonetext">余额支付</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-start">
|
|
||||||
<u-icon v-if="pay_type == 2" name="checkmark-circle-fill" color="#333333" size="26"></u-icon>
|
|
||||||
<u-icon v-else name="checkmark-circle-fill" color="#999999" size="26"></u-icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<view :style="{height:height}">
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="fixedview">
|
|
||||||
<view class="flex-between">
|
|
||||||
<view class="fixedview_one flex-start">
|
|
||||||
<view class="fixedview_oneone">
|
|
||||||
实付金额:
|
|
||||||
</view>
|
|
||||||
<view class="fixedview_onetow" v-if="listinfoid && listinfo">
|
|
||||||
<text>¥</text>{{listinfo.payAmount}}
|
|
||||||
</view>
|
|
||||||
<view class="fixedview_onetow" v-else>
|
|
||||||
<text>¥</text>{{cartLists.amount}}
|
|
||||||
</view>
|
|
||||||
<!-- <view class="fixedview_onethere" v-if="emitorderfoodform.couponsPrice">
|
|
||||||
以优惠¥{{emitorderfoodform.couponsPrice}}
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="fixedview_tow" @tap="$u.debounce(showpopupclickdd, 500)" v-if="listinfoid && listinfo">
|
|
||||||
立即付款
|
|
||||||
</view>
|
|
||||||
<view class="fixedview_tow" @tap="$u.debounce(orderdetail, 500)" v-else>
|
|
||||||
立即付款
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 支付密码 -->
|
|
||||||
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-if="ispws"></payPassword>
|
|
||||||
<!-- 弹幕 -->
|
|
||||||
<l-barrage ref="lBarrage" @end="onEnd" :minTop='0' :maxTop='16'></l-barrage>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// import {object} from 'prop-types';
|
|
||||||
import webSocketUtils from '@/common/js/websocket.js'
|
|
||||||
import payPassword from '@/components/payPassword.vue'
|
|
||||||
import lBarrage from '@/components/l-barrage/l-barrage.vue'
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
payPassword,
|
|
||||||
lBarrage
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
userInfo: uni.cache.get('userInfo'), //个人信息
|
|
||||||
cartLists: {},
|
|
||||||
height: '',
|
|
||||||
pay_type: 1,
|
|
||||||
remark: '',
|
|
||||||
listinfo: {
|
|
||||||
detailList: [],
|
|
||||||
amount: '',
|
|
||||||
amounts: ''
|
|
||||||
},
|
|
||||||
emitorderfoodform: {
|
|
||||||
clickiconone: ''
|
|
||||||
},
|
|
||||||
orderInfo: '',
|
|
||||||
// 可用优惠券数据
|
|
||||||
couponAmount: 0,
|
|
||||||
// 输入支付密码 123
|
|
||||||
ispws: false,
|
|
||||||
listinfoid: null,
|
|
||||||
radiovalue: '1',
|
|
||||||
amountVIP: null
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onUnload() {
|
|
||||||
this.socketTicket.Close()
|
|
||||||
uni.$off('getMessage')
|
|
||||||
this.ispws = false
|
|
||||||
},
|
|
||||||
onHide() {
|
|
||||||
this.socketTicket.Close()
|
|
||||||
uni.$off('getMessage')
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
uni.$on('message', this.getMessage)
|
|
||||||
if (this.listinfoid) {
|
|
||||||
this.orderorderInfo()
|
|
||||||
} else {
|
|
||||||
this.handlemessage()
|
|
||||||
}
|
|
||||||
// 获取余额
|
|
||||||
this.getAount()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMessage(msg) {
|
|
||||||
if (msg == 1) { // 网络在连接
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (msg.type == 'heartbeat') { //后台心跳 处理返回 不然控制台一直报错
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (msg.status != 'success') {
|
|
||||||
uni.showToast({
|
|
||||||
title: msg.msg,
|
|
||||||
icon: "none",
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
switch (msg.type) {
|
|
||||||
case 'createOrder':
|
|
||||||
console.log(msg.data)
|
|
||||||
this.listinfoid = msg.data.id
|
|
||||||
uni.$off('getMessage')
|
|
||||||
this.orderorderInfo(1)
|
|
||||||
break;
|
|
||||||
case 'addCart':
|
|
||||||
this.cartLists = msg
|
|
||||||
break;
|
|
||||||
case 'order':
|
|
||||||
uni.navigateBack()
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.showToast({
|
|
||||||
title: '您的小伙伴已下单了哦~~'
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
break;
|
|
||||||
case 'addcart':
|
|
||||||
/*插入一条弹幕*/
|
|
||||||
this.$refs.lBarrage.add(
|
|
||||||
`${msg.reqData.nickName?msg.reqData.nickName:'微信用户'}${msg.reqData.num==-1?'取消了':'添加了'}${msg.reqData.name}(${msg.reqData.num})`
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.$set(this, 'cartLists', msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
handlemessage() {
|
|
||||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
|
||||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
|
||||||
tableId: uni.cache.get('tableCode'),
|
|
||||||
shopId: uni.cache.get('shopUser'),
|
|
||||||
userId: uni.cache.get('userInfo').id,
|
|
||||||
"type": "connect",
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 数据处理
|
|
||||||
socketSendMsg(data) {
|
|
||||||
if (this.socketTicket) {
|
|
||||||
this.socketTicket.send(data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onEnd() { //回调弹幕
|
|
||||||
console.log('一波结束')
|
|
||||||
},
|
|
||||||
// 查询订单信息
|
|
||||||
async orderorderInfo(i) {
|
|
||||||
let res = await this.api.orderorderInfo({
|
|
||||||
orderId: this.listinfoid
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.listinfo = res.data
|
|
||||||
if (i == 1) { //请求完了详情在去调支付
|
|
||||||
this.showpopupclickdd()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
groupChange(n) {
|
|
||||||
this.radiovalue = n
|
|
||||||
},
|
|
||||||
async getAount() {
|
|
||||||
let res = await this.api.shopUserInfo({
|
|
||||||
"shopId": uni.cache.get('shopUser'),
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.amountVIP = res.data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
orderfoodindex() { //优惠劵
|
|
||||||
uni.pro.navigateTo('index/coupons/index', {
|
|
||||||
orderfood: 0,
|
|
||||||
orderId: this.listinfoid,
|
|
||||||
amount: this.listinfo.amounts
|
|
||||||
})
|
|
||||||
},
|
|
||||||
copyHandle(e) {
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: e,
|
|
||||||
success() {
|
|
||||||
uni.showToast({
|
|
||||||
title: '复制成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async paymodfiyOrderInfo() { //支付完成后请求
|
|
||||||
let res = await this.api.paymodfiyOrderInfo({
|
|
||||||
orderId: this.listinfoid,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goRecharge() { // 去充值
|
|
||||||
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
|
|
||||||
// console.log(this.amountVIP.isVip, '调试1')
|
|
||||||
if (this.amountVIP.isVip == 0) {
|
|
||||||
// 跳转到开通页面
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/member/activatedmemberone?shopId=' + uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
|
||||||
shopId: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
orderdetail() { // 直接生成订单
|
|
||||||
let data = {
|
|
||||||
"skuId": '',
|
|
||||||
"num": '', //数量
|
|
||||||
"type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
|
||||||
"remark": this.remark,
|
|
||||||
"couponsId": '', //优惠券ID,
|
|
||||||
"isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
|
||||||
"isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
|
||||||
"productId": '', //商品id
|
|
||||||
"shopId": uni.cache.get('shopUser'),
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
|
||||||
}
|
|
||||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
|
||||||
},
|
|
||||||
showpopupclickdd() {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
// radiovalue为1是微信支付
|
|
||||||
if (this.radiovalue == 1) {
|
|
||||||
this.showpopupclickdds() //微信支付
|
|
||||||
} else {
|
|
||||||
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
|
|
||||||
// console.log(isPwd,'是否设置了支付密码')
|
|
||||||
if (uni.cache.get('userInfo').isPwd == 0) {
|
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
|
||||||
shopId_id: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.hideLoading()
|
|
||||||
this.ispws = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.payPwd.onPayUp();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 微信支付
|
|
||||||
async showpopupclickdds() {
|
|
||||||
let res = await this.api.payorderPay({
|
|
||||||
orderId: this.listinfoid
|
|
||||||
}) //判断是否支付成功
|
|
||||||
if (res.code == 0) {
|
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
// 微信支付还是余额支付
|
|
||||||
uni.requestPayment({
|
|
||||||
provider: 'wxpay', //支付类型-固定值
|
|
||||||
partnerid: res.data.appId, // 微信支付商户号
|
|
||||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
|
||||||
nonceStr: res.data.nonceStr, // 随机字符串
|
|
||||||
package: res.data.package, // 固定值
|
|
||||||
signType: res.data.signType, //固定值
|
|
||||||
paySign: res.data.paySign, //签名
|
|
||||||
success: (res) => {
|
|
||||||
let _this = this
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
|
||||||
complete() {
|
|
||||||
uni.showToast({
|
|
||||||
title: "支付成功"
|
|
||||||
})
|
|
||||||
// uni.cache.set('shopUser', '') //删除shopUser
|
|
||||||
_this.paymodfiyOrderInfo()
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/order/order_detail?orderId=' + _this
|
|
||||||
.listinfoid
|
|
||||||
});
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 余额支付
|
|
||||||
async accountPayevent(pwd) {
|
|
||||||
this.ispws = false
|
|
||||||
let res = await this.api.accountPay({
|
|
||||||
orderId: this.listinfoid,
|
|
||||||
memberId: this.amountVIP.id,
|
|
||||||
pwd: pwd
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
// data ->1 支付成功
|
|
||||||
// ->2 余额不足
|
|
||||||
// ->3 未设置支付密码,
|
|
||||||
// ->4 不是会员,
|
|
||||||
if (res.data == 1) {
|
|
||||||
this.showToastUppop('支付成功')
|
|
||||||
let _this = this
|
|
||||||
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
|
||||||
complete() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/order/order_detail?orderId=' + _this
|
|
||||||
.listinfoid
|
|
||||||
});
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
} else if (res.data == 2) {
|
|
||||||
this.showToastUppop('余额不足')
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
} else if (res.data == 3) {
|
|
||||||
this.showToastUppop('未设置支付密码')
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
|
||||||
shopId_id: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
}, 1500)
|
|
||||||
|
|
||||||
} else if (res.data == 4) {
|
|
||||||
this.showToastUppop('非会员请充值')
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
showToastUppop(title) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title,
|
|
||||||
success: () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
async mounted() {
|
|
||||||
let rectInfo = await this.$u.getRect('.fixedview');
|
|
||||||
console.log(rectInfo);
|
|
||||||
this.height = rectInfo.height + "px"
|
|
||||||
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.container {
|
|
||||||
padding: 0 28upx 28upx 28upx 28upx;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 20upx;
|
|
||||||
padding: 28upx;
|
|
||||||
margin-bottom: 48rpx;
|
|
||||||
|
|
||||||
.head {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
&.border {
|
|
||||||
padding-bottom: 28upx;
|
|
||||||
border-bottom: 1upx solid #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
color: #ff0000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-wrap {
|
|
||||||
padding: 28upx 0;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 0 10upx;
|
|
||||||
color: $color-priamry;
|
|
||||||
border: 1px solid $color-priamry;
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.number-wrap {
|
|
||||||
background-color: #fafafa;
|
|
||||||
border-radius: 16upx;
|
|
||||||
padding: 28upx 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.number {
|
|
||||||
font-size: 42upx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.price {
|
|
||||||
.i {
|
|
||||||
font-size: 20upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.num {
|
|
||||||
font-size: 38upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop-info {
|
|
||||||
padding: 28upx 0;
|
|
||||||
|
|
||||||
.item:nth-child(1) {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-left: 28upx;
|
|
||||||
|
|
||||||
.n {
|
|
||||||
font-size: 24upx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.total-wrap {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding-top: 28upx;
|
|
||||||
border-top: 1upx solid #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-info {
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-top: 28upx;
|
|
||||||
|
|
||||||
.t {
|
|
||||||
font-size: 24upx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontent {
|
|
||||||
width: 100%;
|
|
||||||
background: #FFFFFF;
|
|
||||||
padding: 32rpx;
|
|
||||||
margin-top: 32rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
|
|
||||||
.sixcontentone {
|
|
||||||
padding-bottom: 28rpx;
|
|
||||||
border-bottom: 1px solid #F7F7F7;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
|
|
||||||
.sixcontent_one {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontenttow {
|
|
||||||
.sixcontenttowitem {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
|
|
||||||
.sixcontenttowitemone {
|
|
||||||
image {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
width: 31.37rpx;
|
|
||||||
height: 27.34rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontenttowitemonetext {
|
|
||||||
margin-left: 14rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.redMoney {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 18rpx 14rpx;
|
|
||||||
|
|
||||||
>view:first-child {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
>view:last-child {
|
|
||||||
background: #FFE9E9;
|
|
||||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #FF3333;
|
|
||||||
text-align: center;
|
|
||||||
padding: 9rpx 13rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.payType {
|
|
||||||
padding: 32rpx 34rpx;
|
|
||||||
margin-top: 48rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
>view:first-child {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
>view:last-child {
|
|
||||||
margin-top: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dfs {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 180rpx;
|
|
||||||
padding: 16rpx 34rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
|
|
||||||
.flex-between {
|
|
||||||
width: 100%;
|
|
||||||
padding: 24rpx 28rpx;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
|
|
||||||
.fixedview_one {
|
|
||||||
.fixedview_oneone {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_onetow {
|
|
||||||
font-size: 44rpx;
|
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #F45C4C;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_onethere {
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_tow {
|
|
||||||
background: red;
|
|
||||||
border-radius: 34rpx;
|
|
||||||
padding: 10rpx 44rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-family: PingFang SC-Bold, PingFang SC;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,717 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="container">
|
|
||||||
<view class="card" v-if="listinfo.tableName">
|
|
||||||
<view class="head">
|
|
||||||
<text class="title">
|
|
||||||
桌号:<text>{{listinfo.tableName || '空'}}</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'unpaid'">
|
|
||||||
<text>待支付</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'unsend'">
|
|
||||||
<text>待发货</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'closed'">
|
|
||||||
<text>订单完成</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'send'">
|
|
||||||
<text>已发</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'refunding'">
|
|
||||||
<text>申请退单</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'refund'">
|
|
||||||
<text>退单</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'cancelled'">
|
|
||||||
<text>取消订单</text>
|
|
||||||
</text>
|
|
||||||
<text class="status" v-if="listinfo.status == 'merge'">
|
|
||||||
<text>合台</text>
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view class="tag-wrap">
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'post'">快递</text>
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'takeaway'">外卖</text>
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'takeself'">自提</text>
|
|
||||||
<text class="tag" v-if="listinfo.sendType == 'table'">堂食</text>
|
|
||||||
</view>
|
|
||||||
<view class="number-wrap"
|
|
||||||
v-if="listinfo.status != 'unpaid' && listinfo.status != 'paying'&& listinfo.status != 'cancelled'">
|
|
||||||
<text class="t">取餐号</text>
|
|
||||||
<text class="number">{{listinfo.outNumber || '空'}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="card">
|
|
||||||
<view class="head border">
|
|
||||||
<text class="title">
|
|
||||||
<text>点单详情</text>
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view class="shop-info">
|
|
||||||
<view class="item" v-for="(item,index) in listinfo.detailList" :key="index">
|
|
||||||
<view class="cover">
|
|
||||||
<c-image width="120" height="120" radius="16" :src='item.productImg'></c-image>
|
|
||||||
</view>
|
|
||||||
<view class="info">
|
|
||||||
<text>{{item.productName}}</text>
|
|
||||||
<text class="n" v-if="item.productSkuName">{{item.productSkuName}}</text>
|
|
||||||
<text class="n">x{{item.num}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="price">
|
|
||||||
<text class="i">¥</text>
|
|
||||||
<text class="num">{{item.price}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="total-wrap">
|
|
||||||
<view class="price">
|
|
||||||
<text>合计:</text>
|
|
||||||
<text class="i">¥</text>
|
|
||||||
<text class="num">{{listinfo.amount}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="sixcontent">
|
|
||||||
<view class="sixcontentone flex-between" style="padding: 0 0;" @click="orderfoodindex">
|
|
||||||
<view class="sixcontent_one" style="padding: 0 0;">
|
|
||||||
优惠券
|
|
||||||
</view>
|
|
||||||
<text style="color: red;">{{emitorderfoodform.couponsPrice}}</text>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- <view class="redMoney">
|
|
||||||
<view>
|
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/hongbao.png"
|
|
||||||
style="width: 30rpx;height: 30.24rpx;;" mode=""></image>
|
|
||||||
红包/抵用券
|
|
||||||
</view>
|
|
||||||
<view @click="orderfoodindex">
|
|
||||||
可用优惠券{{couponAmount}}张
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- <u--textarea v-model="remark" placeholder="订单备注" ></u--textarea> -->
|
|
||||||
<!-- 支付方式 -->
|
|
||||||
<view class="payType">
|
|
||||||
<view class="">
|
|
||||||
支付方式
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
<u-radio-group v-model="radiovalue1" iconPlacement="right" @change="groupChange" :size="28"
|
|
||||||
placement="column">
|
|
||||||
<u-radio activeColor="#ffd158" name="1">
|
|
||||||
<view class="dfs">
|
|
||||||
<image style="width:44rpx;height:44rpx"
|
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/balance.png" mode="">
|
|
||||||
</image>
|
|
||||||
<text style="font-size: 28rpx;margin-left: 16rpx;">
|
|
||||||
微信支付
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
</u-radio>
|
|
||||||
<view style="margin: 22rpx 0;width: 100%;height: 2rpx;background-color: #E5E5E5;">
|
|
||||||
</view>
|
|
||||||
<u-radio activeColor="#ffd158" name="2">
|
|
||||||
<view class="dfs">
|
|
||||||
<image style="width:44rpx;height:44rpx"
|
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png" mode="">
|
|
||||||
</image>
|
|
||||||
<text style="font-size: 28rpx;margin-left: 16rpx;">
|
|
||||||
会员卡支付</text>
|
|
||||||
</view>
|
|
||||||
</u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
<view style="font-weight: 400;font-size: 24rpx;color: #333333;margin-left: 60rpx;">
|
|
||||||
会员卡余额{{ amountVIP?amountVIP.amount:0}} <text
|
|
||||||
style="font-weight: 500;font-size: 28rpx;margin-left: 16rpx;color: #FF4C11;"
|
|
||||||
@click="goRecharge">去充值</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="sixcontent" >
|
|
||||||
<view class="sixcontentone flex-between">
|
|
||||||
<view class="sixcontent_one">
|
|
||||||
支付方式
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="sixcontenttow">
|
|
||||||
<view class="sixcontenttowitem flex-between" @click="clickselect(1)">
|
|
||||||
<view class="sixcontenttowitemone flex-start">
|
|
||||||
<u-icon name="weixin-fill" color="#999999" size="32"></u-icon>
|
|
||||||
<text class="sixcontenttowitemonetext">微信支付</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-start">
|
|
||||||
<u-icon v-if="pay_type == 1" name="checkmark-circle-fill" color="#333333" size="26"></u-icon>
|
|
||||||
<u-icon v-else name="checkmark-circle-fill" color="#999999" size="26"></u-icon>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="sixcontenttowitem flex-between" @click="clickselect(2)">
|
|
||||||
<view class="sixcontenttowitemone flex-start">
|
|
||||||
<u-icon name="zhifubao" color="#999999" size="26"></u-icon>
|
|
||||||
<text class="sixcontenttowitemonetext">余额支付</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-start">
|
|
||||||
<u-icon v-if="pay_type == 2" name="checkmark-circle-fill" color="#333333" size="26"></u-icon>
|
|
||||||
<u-icon v-else name="checkmark-circle-fill" color="#999999" size="26"></u-icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<view :style="{height:height}">
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="fixedview">
|
|
||||||
<view class="flex-between">
|
|
||||||
<view class="fixedview_one flex-start">
|
|
||||||
<view class="fixedview_oneone">
|
|
||||||
实付金额:
|
|
||||||
</view>
|
|
||||||
<view class="fixedview_onetow">
|
|
||||||
<text>¥</text>{{listinfo.amount}}
|
|
||||||
</view>
|
|
||||||
<view class="fixedview_onethere" v-if="emitorderfoodform.couponsPrice">
|
|
||||||
以优惠¥{{emitorderfoodform.couponsPrice}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="fixedview_tow" @tap="showpopupclickdd"> -->
|
|
||||||
<view class="fixedview_tow" @tap="$u.debounce(showpopupclickdd, 500)">
|
|
||||||
立即付款
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 支付密码 -->
|
|
||||||
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-if="ispws"></payPassword>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import webSocketUtils from '@/common/js/websocket.js'
|
|
||||||
import payPassword from '@/components/payPassword.vue'
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
payPassword
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
height: '',
|
|
||||||
pay_type: 1,
|
|
||||||
remark: '',
|
|
||||||
listinfoid: '',
|
|
||||||
listinfo: {
|
|
||||||
detailList: [],
|
|
||||||
amount: '',
|
|
||||||
amounts: ''
|
|
||||||
},
|
|
||||||
emitorderfoodform: {
|
|
||||||
clickiconone: ''
|
|
||||||
},
|
|
||||||
amountVIP: null,
|
|
||||||
radiovalue1: '1',
|
|
||||||
orderInfo: '',
|
|
||||||
// 可用优惠券数据
|
|
||||||
couponAmount: 0,
|
|
||||||
// 输入支付密码 123
|
|
||||||
ispws: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onUnload() {
|
|
||||||
uni.$off('getMessage')
|
|
||||||
this.ispws = false
|
|
||||||
},
|
|
||||||
onLoad(e) {
|
|
||||||
this.listinfo = JSON.parse(e.tablelist)
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
// 获取余额
|
|
||||||
this.getAount()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
groupChange(n) {
|
|
||||||
this.radiovalue1 = n
|
|
||||||
},
|
|
||||||
async getcoupon() {
|
|
||||||
let res = await this.api.userCoupon({
|
|
||||||
"orderNum": this.listinfo.amount,
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.couponAmount = res.data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async getAount() {
|
|
||||||
let res = await this.api.shopUserInfo({
|
|
||||||
"shopId": uni.cache.get('shopUser'),
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.amountVIP = res.data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getMessage(msg) {
|
|
||||||
if (msg.status != 'success') {
|
|
||||||
uni.showToast({
|
|
||||||
title: msg.msg,
|
|
||||||
icon: "none",
|
|
||||||
})
|
|
||||||
this.socketTicket.Close()
|
|
||||||
uni.$off('getMessage')
|
|
||||||
|
|
||||||
} else if (msg.type == 'createOrder') {
|
|
||||||
this.listinfoid = msg.data.id //下单需要的id
|
|
||||||
this.orderInfo = msg.data
|
|
||||||
if (this.radiovalue1 == 1) {
|
|
||||||
// this.showpopupclickdds() //微信支付
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
orderfoodindex() { //优惠劵
|
|
||||||
uni.pro.navigateTo('index/coupons/index', {
|
|
||||||
orderfood: 0,
|
|
||||||
orderId: this.listinfo.id,
|
|
||||||
amount: this.listinfo.amounts
|
|
||||||
})
|
|
||||||
},
|
|
||||||
copyHandle(e) {
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: e,
|
|
||||||
success() {
|
|
||||||
uni.showToast({
|
|
||||||
title: '复制成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async paymodfiyOrderInfo() { //支付完成后请求
|
|
||||||
let res = await this.api.paymodfiyOrderInfo({
|
|
||||||
orderId: this.listinfo.id,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goRecharge() { // 去充值
|
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
|
||||||
shopId: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showpopupclickdd() {
|
|
||||||
// radiovalue1为1是微信支付
|
|
||||||
if (this.radiovalue1 == 1) {
|
|
||||||
this.showpopupclickdds() //微信支付
|
|
||||||
} else {
|
|
||||||
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
|
|
||||||
let {
|
|
||||||
isPwd
|
|
||||||
} = uni.cache.get('userInfo')
|
|
||||||
// console.log(isPwd,'是否设置了支付密码')
|
|
||||||
if (isPwd == 0) {
|
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
|
||||||
shopId_id: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.ispws = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.payPwd.onPayUp();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 微信支付
|
|
||||||
async showpopupclickdds() {
|
|
||||||
let res = await this.api.payorderPay({
|
|
||||||
orderId: this.listinfo.id
|
|
||||||
}) //判断是否支付成功
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
// 微信支付还是余额支付
|
|
||||||
uni.requestPayment({
|
|
||||||
provider: 'wxpay', //支付类型-固定值
|
|
||||||
partnerid: res.data.appId, // 微信支付商户号
|
|
||||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
|
||||||
nonceStr: res.data.nonceStr, // 随机字符串
|
|
||||||
package: res.data.package, // 固定值
|
|
||||||
signType: res.data.signType, //固定值
|
|
||||||
paySign: res.data.paySign, //签名
|
|
||||||
success: (res) => {
|
|
||||||
let _this = this
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
|
||||||
complete() {
|
|
||||||
uni.showToast({
|
|
||||||
title: "支付成功"
|
|
||||||
})
|
|
||||||
// uni.cache.set('shopUser', '') //删除shopUser
|
|
||||||
_this.paymodfiyOrderInfo()
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/order/order_detail?orderId=' +
|
|
||||||
_this
|
|
||||||
.listinfo.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 余额支付
|
|
||||||
async accountPayevent(pwd) {
|
|
||||||
this.ispws = false
|
|
||||||
let res = await this.api.accountPay({
|
|
||||||
orderId: this.listinfo.id,
|
|
||||||
memberId: this.amountVIP.id,
|
|
||||||
// remark: this.remark,
|
|
||||||
pwd
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
// data ->1 支付成功
|
|
||||||
// ->2 余额不足
|
|
||||||
// ->3 未设置支付密码,
|
|
||||||
// ->4 不是会员,
|
|
||||||
if (res.data == 1) {
|
|
||||||
this.showToastUppop('支付成功')
|
|
||||||
let _this = this
|
|
||||||
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
|
||||||
complete() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/order/order_detail?orderId=' + _this
|
|
||||||
.listinfo.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
} else if (res.data == 2) {
|
|
||||||
this.showToastUppop('余额不足')
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
} else if (res.data == 3) {
|
|
||||||
this.showToastUppop('未设置支付密码')
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
|
||||||
shopId_id: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
}, 1500)
|
|
||||||
|
|
||||||
} else if (res.data == 4) {
|
|
||||||
this.showToastUppop('非会员请充值')
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
showToastUppop(title) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title,
|
|
||||||
success: () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
clickselect(b) {
|
|
||||||
this.pay_type = b
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
//#ifdef MP-WEIXIN || H5
|
|
||||||
var query = uni.createSelectorQuery().in(this).select('.fixedview')
|
|
||||||
query.boundingClientRect(ele => {
|
|
||||||
var that = this;
|
|
||||||
that.height = (ele.height) + "px";
|
|
||||||
that = null;
|
|
||||||
}).exec();
|
|
||||||
//#endif
|
|
||||||
//#ifdef MP-ALIPAY
|
|
||||||
my.createSelectorQuery().selectAll('.fixedview').boundingClientRect().exec(ele => {
|
|
||||||
var nodeData = ele[0]
|
|
||||||
var that = this;
|
|
||||||
that.height = (nodeData.height) + "px";
|
|
||||||
that = null;
|
|
||||||
})
|
|
||||||
//#endif
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.container {
|
|
||||||
padding: 28upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 20upx;
|
|
||||||
padding: 28upx;
|
|
||||||
margin-bottom: 48rpx;
|
|
||||||
|
|
||||||
.head {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
&.border {
|
|
||||||
padding-bottom: 28upx;
|
|
||||||
border-bottom: 1upx solid #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
color: #ff0000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-wrap {
|
|
||||||
padding: 28upx 0;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 0 10upx;
|
|
||||||
color: $color-priamry;
|
|
||||||
border: 1px solid $color-priamry;
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.number-wrap {
|
|
||||||
background-color: #fafafa;
|
|
||||||
border-radius: 16upx;
|
|
||||||
padding: 28upx 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.number {
|
|
||||||
font-size: 42upx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.price {
|
|
||||||
.i {
|
|
||||||
font-size: 20upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.num {
|
|
||||||
font-size: 38upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop-info {
|
|
||||||
padding: 28upx 0;
|
|
||||||
|
|
||||||
.item:nth-child(1) {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-left: 28upx;
|
|
||||||
|
|
||||||
.n {
|
|
||||||
font-size: 24upx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.total-wrap {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding-top: 28upx;
|
|
||||||
border-top: 1upx solid #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-info {
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-top: 28upx;
|
|
||||||
|
|
||||||
.t {
|
|
||||||
font-size: 24upx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
font-size: 24upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontent {
|
|
||||||
width: 100%;
|
|
||||||
background: #FFFFFF;
|
|
||||||
padding: 32rpx;
|
|
||||||
margin-top: 32rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
|
|
||||||
.sixcontentone {
|
|
||||||
padding-bottom: 28rpx;
|
|
||||||
border-bottom: 1px solid #F7F7F7;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
|
|
||||||
.sixcontent_one {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontenttow {
|
|
||||||
.sixcontenttowitem {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
|
|
||||||
.sixcontenttowitemone {
|
|
||||||
image {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
width: 31.37rpx;
|
|
||||||
height: 27.34rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sixcontenttowitemonetext {
|
|
||||||
margin-left: 14rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.redMoney {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 18rpx 14rpx;
|
|
||||||
|
|
||||||
>view:first-child {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
>view:last-child {
|
|
||||||
background: #FFE9E9;
|
|
||||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #FF3333;
|
|
||||||
text-align: center;
|
|
||||||
padding: 9rpx 13rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.payType {
|
|
||||||
padding: 32rpx 34rpx;
|
|
||||||
margin-top: 48rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
>view:first-child {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
>view:last-child {
|
|
||||||
margin-top: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dfs {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 180rpx;
|
|
||||||
padding: 16rpx 34rpx;
|
|
||||||
|
|
||||||
.flex-between {
|
|
||||||
width: 100%;
|
|
||||||
padding: 24rpx 28rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
|
|
||||||
.fixedview_one {
|
|
||||||
.fixedview_oneone {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_onetow {
|
|
||||||
font-size: 44rpx;
|
|
||||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #F45C4C;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_onethere {
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fixedview_tow {
|
|
||||||
background: red;
|
|
||||||
border-radius: 34rpx;
|
|
||||||
padding: 10rpx 44rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-family: PingFang SC-Bold, PingFang SC;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
<view class="remark">
|
<view class="remark">
|
||||||
<view class="remark_bg">
|
<view class="remark_bg">
|
||||||
<view class="remark_title">订单备注</view>
|
<view class="remark_title">订单备注</view>
|
||||||
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark" :border="false" :clearable="true"/>
|
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark" :border="textareaBorder" :clearable="true"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@
|
|||||||
{ name: "团购优惠", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
{ name: "团购优惠", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||||
],
|
],
|
||||||
paymentMethodList:[
|
paymentMethodList:[
|
||||||
{ name: "会员卡支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
{ name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
||||||
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
||||||
],
|
],
|
||||||
order: {
|
order: {
|
||||||
@@ -191,7 +191,8 @@
|
|||||||
payPasswordShow: false,
|
payPasswordShow: false,
|
||||||
amountVIP: null, // 会员信息
|
amountVIP: null, // 会员信息
|
||||||
listinfoid: null,
|
listinfoid: null,
|
||||||
paymentBtnText: "会员卡支付",
|
paymentBtnText: "余额支付",
|
||||||
|
isSocket: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -210,9 +211,13 @@
|
|||||||
uni.$off('message')
|
uni.$off('message')
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
console.log(JSON.parse(e.cartList))
|
||||||
this.listinfo.name = JSON.parse(e.storeInfo).shopName;
|
this.listinfo.name = JSON.parse(e.storeInfo).shopName;
|
||||||
|
this.listinfo.details = JSON.parse(e.cartList).data;
|
||||||
|
this.listinfo.payAmount = JSON.parse(e.cartList).amount;
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
console.log(this.listinfoid)
|
||||||
if (this.listinfoid) {
|
if (this.listinfoid) {
|
||||||
uni.$on('message', this.getMessage)
|
uni.$on('message', this.getMessage)
|
||||||
this.orderorderInfo()
|
this.orderorderInfo()
|
||||||
@@ -244,6 +249,7 @@
|
|||||||
} else {
|
} else {
|
||||||
switch (msg.type) {
|
switch (msg.type) {
|
||||||
case 'createOrder':
|
case 'createOrder':
|
||||||
|
this.isSocket = true;
|
||||||
this.listinfoid = msg.data.id
|
this.listinfoid = msg.data.id
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
this.listinfo.details = msg.data.detailList;
|
this.listinfo.details = msg.data.detailList;
|
||||||
@@ -253,7 +259,7 @@
|
|||||||
break;
|
break;
|
||||||
case 'addCart':
|
case 'addCart':
|
||||||
console.log("商品列表===",msg)
|
console.log("商品列表===",msg)
|
||||||
|
this.isSocket = true;
|
||||||
if (this.listinfoid) {
|
if (this.listinfoid) {
|
||||||
this.orderorderInfo()
|
this.orderorderInfo()
|
||||||
} else {
|
} else {
|
||||||
@@ -276,6 +282,7 @@
|
|||||||
this.listinfo.details = msg.data;
|
this.listinfo.details = msg.data;
|
||||||
this.listinfo.payAmount = msg.amount;
|
this.listinfo.payAmount = msg.amount;
|
||||||
}
|
}
|
||||||
|
this.isSocket = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.$set(this, 'cartLists', msg)
|
this.$set(this, 'cartLists', msg)
|
||||||
@@ -298,7 +305,7 @@
|
|||||||
*/
|
*/
|
||||||
groupChange(n) {
|
groupChange(n) {
|
||||||
this.radiovalue = n;
|
this.radiovalue = n;
|
||||||
this.paymentBtnText = n==1?'会员卡支付':'微信支付'
|
this.paymentBtnText = n==1?'余额支付':'微信支付'
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -309,7 +316,7 @@
|
|||||||
this.socketTicket ? this.socketTicket.Close() : null
|
this.socketTicket ? this.socketTicket.Close() : null
|
||||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||||
tableId: uni.cache.get('tableCode'),
|
tableId: uni.cache.get('tableCode'),
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: uni.cache.get('shopId'),
|
||||||
userId: uni.cache.get('userInfo').id,
|
userId: uni.cache.get('userInfo').id,
|
||||||
"type": "connect",
|
"type": "connect",
|
||||||
})
|
})
|
||||||
@@ -331,7 +338,7 @@
|
|||||||
*/
|
*/
|
||||||
async getAount() {
|
async getAount() {
|
||||||
let res = await this.api.shopUserInfo({
|
let res = await this.api.shopUserInfo({
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopId'),
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -365,7 +372,7 @@
|
|||||||
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
|
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
|
||||||
// console.log(this.amountVIP.isVip, '调试1')
|
// console.log(this.amountVIP.isVip, '调试1')
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
uni.pro.navigateTo('/pages/member/index', {
|
||||||
shopId: uni.cache.get('shopUser')
|
shopId: uni.cache.get('shopId')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -374,6 +381,13 @@
|
|||||||
*/
|
*/
|
||||||
orderdetail() {
|
orderdetail() {
|
||||||
console.log(this.listinfo.details)
|
console.log(this.listinfo.details)
|
||||||
|
if (!this.isSocket) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "当前网络异常,请稍后再试",
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ( this.listinfo.details.length == 0) {
|
if ( this.listinfo.details.length == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "购物车为空,请添加商品",
|
title: "购物车为空,请添加商品",
|
||||||
@@ -390,7 +404,7 @@
|
|||||||
"isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
"isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
||||||
"isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
"isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
||||||
"productId": '', //商品id
|
"productId": '', //商品id
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopId'),
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
}
|
}
|
||||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 占位符 接口请求完毕才显示 -->
|
<!-- 占位符 接口请求完毕才显示 -->
|
||||||
<view v-if="fixedtrue"
|
<!-- <view v-if="fixedtrue"
|
||||||
style="height: 100vh; width: 100%; position: fixed; z-index: 999; top: 0; left: 0; background-color: #fff; display: flex; justify-content: center; align-items: center;">
|
style="height: 100vh; width: 100%; position: fixed; z-index: 999; top: 0; left: 0; background-color: #fff; display: flex; justify-content: center; align-items: center;">
|
||||||
<image style="width: 140rpx; height: 140rpx;" src="@/static/1.gif" mode="aspectFill"></image>
|
<image style="width: 140rpx; height: 140rpx;" src="@/static/1.gif" mode="aspectFill"></image>
|
||||||
<text style="margin-left:10rpx;font-size: 40rpx;color: #7d7d76;">加载中</text>
|
<text style="margin-left:10rpx;font-size: 40rpx;color: #7d7d76;">加载中</text>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 顶部面板 -->
|
<!-- 顶部面板 -->
|
||||||
<view class="top--panel">
|
<view class="top--panel">
|
||||||
<navseat :opacity='opacity' :inputshow="true" :readonly="true" @searchStatus="searchStatus" :titleshow='true' @navigateBacknav='navigateBacknav'
|
<navseat :opacity='opacity' :inputshow="true" :readonly="true" @searchStatus="searchStatus" :titleshow='true' @navigateBacknav='navigateBacknav'
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
<view class="list-wrap">
|
<view class="list-wrap">
|
||||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||||
<view class="cover">
|
<view class="cover">
|
||||||
<c-image :src="item.coverImg" width="120" height="120"></c-image>
|
<u-image :src="item.coverImg" width="120" height="120"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name"> {{ item.name }} </view>
|
<view class="name"> {{ item.name }} </view>
|
||||||
@@ -427,6 +427,7 @@
|
|||||||
orderdetailFlag: true,
|
orderdetailFlag: true,
|
||||||
forceUpdate: false,
|
forceUpdate: false,
|
||||||
shopExtend: null,
|
shopExtend: null,
|
||||||
|
shopId: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@@ -468,8 +469,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
|
if (this.socketTicket) {
|
||||||
this.socketTicket.Close()
|
this.socketTicket.Close()
|
||||||
uni.$off('message')
|
uni.$off('message')
|
||||||
|
}
|
||||||
|
|
||||||
this.fixedtrue = true
|
this.fixedtrue = true
|
||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
@@ -489,7 +493,7 @@
|
|||||||
*/
|
*/
|
||||||
async getShopExtend () {
|
async getShopExtend () {
|
||||||
let res = await this.api.getShopExtend({
|
let res = await this.api.getShopExtend({
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: this.shopId,
|
||||||
autokey: "shopInfo_bg" //index_bg my_bg member_bg shopInfo_bg
|
autokey: "shopInfo_bg" //index_bg my_bg member_bg shopInfo_bg
|
||||||
})
|
})
|
||||||
if ( res.code == 0) {
|
if ( res.code == 0) {
|
||||||
@@ -514,7 +518,7 @@
|
|||||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||||
tableId: uni.cache.get('tableCode'),
|
tableId: uni.cache.get('tableCode'),
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: this.shopId,
|
||||||
userId: uni.cache.get('userInfo').id,
|
userId: uni.cache.get('userInfo').id,
|
||||||
"type": "connect",
|
"type": "connect",
|
||||||
})
|
})
|
||||||
@@ -573,7 +577,9 @@
|
|||||||
'',
|
'',
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.cache.set('shopUser', res.data.storeInfo.id)
|
let expireTime = uni.utils.timestamp() + 30 * 60; // 有效期
|
||||||
|
uni.cache.set('shopId', res.data.storeInfo.id, expireTime)
|
||||||
|
this.shopId = res.data.storeInfo.id;
|
||||||
this.shopInfo = res.data;
|
this.shopInfo = res.data;
|
||||||
this.productqueryProduct() //list 数据
|
this.productqueryProduct() //list 数据
|
||||||
this.handlemessage() //监听websocket返回
|
this.handlemessage() //监听websocket返回
|
||||||
@@ -691,7 +697,7 @@
|
|||||||
"type": a == '+' ? 1 : 0,
|
"type": a == '+' ? 1 : 0,
|
||||||
"isVip": item.isVip,
|
"isVip": item.isVip,
|
||||||
"productId": item.id, //商品id
|
"productId": item.id, //商品id
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
}
|
}
|
||||||
@@ -715,7 +721,7 @@
|
|||||||
"type": c == '+' ? 1 : 0,
|
"type": c == '+' ? 1 : 0,
|
||||||
"isVip": item.isVip,
|
"isVip": item.isVip,
|
||||||
"productId": item.productId, //商品id
|
"productId": item.productId, //商品id
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
}
|
}
|
||||||
@@ -743,7 +749,7 @@
|
|||||||
*/
|
*/
|
||||||
async cartclear() {
|
async cartclear() {
|
||||||
let res = await this.api.cleanCart({
|
let res = await this.api.cleanCart({
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -964,7 +970,7 @@
|
|||||||
// console.log(this.skuidname.join(","))
|
// console.log(this.skuidname.join(","))
|
||||||
let res = await this.api.productqueryProductSku({
|
let res = await this.api.productqueryProductSku({
|
||||||
code: uni.cache.get('tableCode'),
|
code: uni.cache.get('tableCode'),
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: this.shopId,
|
||||||
productId: item.id, //商品id
|
productId: item.id, //商品id
|
||||||
isVip: item.isVip, //商品id
|
isVip: item.isVip, //商品id
|
||||||
spec_tag: this.skuidname.join(","),
|
spec_tag: this.skuidname.join(","),
|
||||||
@@ -978,7 +984,7 @@
|
|||||||
"type": c == '+' ? 1 : 0,
|
"type": c == '+' ? 1 : 0,
|
||||||
"productId": item.id, //商品id
|
"productId": item.id, //商品id
|
||||||
"isVip": item.isVip,
|
"isVip": item.isVip,
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
}
|
}
|
||||||
@@ -1018,7 +1024,7 @@
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/order_food/confirm_order?storeInfo=' + JSON.stringify(this.shopInfo.storeInfo)
|
url: `/pages/order_food/confirm_order?storeInfo=${JSON.stringify(this.shopInfo.storeInfo)}&cartList=${JSON.stringify(this.cartLists)}`
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -1102,7 +1108,7 @@
|
|||||||
*/
|
*/
|
||||||
async productqueryProduct() {
|
async productqueryProduct() {
|
||||||
let res = await this.api.productqueryProduct({
|
let res = await this.api.productqueryProduct({
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"productGroupId": ''
|
"productGroupId": ''
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -1203,7 +1209,9 @@
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
align-content: flex-start;
|
align-content: flex-start;
|
||||||
|
::v-deep .u-input input{
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
.navbarcontent .active {
|
.navbarcontent .active {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 占位符 接口请求完毕才显示 -->
|
|
||||||
<view v-if="fixedtrue"
|
|
||||||
style="height: 100vh; width: 100%; position: fixed; z-index: 999; top: 0; left: 0; background-color: #fff; display: flex; justify-content: center; align-items: center;">
|
|
||||||
<image style="width: 140rpx; height: 140rpx;" src="@/static/1.gif" mode="aspectFill"></image>
|
|
||||||
<text style="margin-left:10rpx;font-size: 40rpx;color: #7d7d76;">加载中</text>
|
|
||||||
</view>
|
|
||||||
<!-- 顶部面板 -->
|
<!-- 顶部面板 -->
|
||||||
<view class="top--panel">
|
<view class="top--panel">
|
||||||
<navseat :opacity='true' :inputshow="true" :readonly="false" :focus="true" @searchVal="searchVal" :titleshow='true' @navigateBacknav='navigateBacknav'
|
<navseat :opacity='true' :inputshow="true" :readonly="false" :focus="true" @searchVal="searchVal" :titleshow='true' @navigateBacknav='navigateBacknav'
|
||||||
:navigateBacknavtitle='false'></navseat>
|
:navigateBacknavtitle='false'></navseat>
|
||||||
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 -->
|
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 -->
|
||||||
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;width:100%;background-color: #E8AD7B;'}"></view>
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;width:100%;'}"></view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<view :style="{'height':systemInfo.titleBarHeight+systemInfo.statusBarHeight+'px;width:100%;'}"></view>
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 滚动区域 -->
|
<!-- 滚动区域 -->
|
||||||
<view class="scroll-panel" id="scroll-panel">
|
<view class="scroll-panel" id="scroll-panel">
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
<view class="list-wrap">
|
<view class="list-wrap">
|
||||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||||
<view class="cover">
|
<view class="cover">
|
||||||
<c-image :src="item.coverImg" width="120" height="120"></c-image>
|
<u-image :src="item.coverImg" width="120" height="120"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name"> {{ item.name }} </view>
|
<view class="name"> {{ item.name }} </view>
|
||||||
@@ -238,7 +238,6 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pagemetashow: false,
|
pagemetashow: false,
|
||||||
fixedtrue: true,
|
|
||||||
userInfo: uni.cache.get('userInfo'), //个人信息
|
userInfo: uni.cache.get('userInfo'), //个人信息
|
||||||
opacity: false, //是否显示
|
opacity: false, //是否显示
|
||||||
fillHeight: 0, // 填充高度,用于最后一项低于滚动区域时使用
|
fillHeight: 0, // 填充高度,用于最后一项低于滚动区域时使用
|
||||||
@@ -269,6 +268,7 @@
|
|||||||
orderdetailFlag: true,
|
orderdetailFlag: true,
|
||||||
|
|
||||||
searchList: [],
|
searchList: [],
|
||||||
|
systemInfo: getApp().globalData.systemInfo,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@@ -293,9 +293,9 @@
|
|||||||
onHide() {
|
onHide() {
|
||||||
this.socketTicket.Close()
|
this.socketTicket.Close()
|
||||||
uni.$off('message')
|
uni.$off('message')
|
||||||
this.fixedtrue = true
|
|
||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
|
this.shopId = uni.cache.get('shopId');
|
||||||
let _this = this;
|
let _this = this;
|
||||||
this.orderdetailFlag = true;
|
this.orderdetailFlag = true;
|
||||||
uni.pageScrollTo({
|
uni.pageScrollTo({
|
||||||
@@ -314,7 +314,7 @@
|
|||||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||||
tableId: uni.cache.get('tableCode'),
|
tableId: uni.cache.get('tableCode'),
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: this.shopId,
|
||||||
userId: uni.cache.get('userInfo').id,
|
userId: uni.cache.get('userInfo').id,
|
||||||
"type": "connect",
|
"type": "connect",
|
||||||
})
|
})
|
||||||
@@ -333,7 +333,6 @@
|
|||||||
'',
|
'',
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.cache.set('shopUser', res.data.storeInfo.id)
|
|
||||||
this.shopInfo = res.data;
|
this.shopInfo = res.data;
|
||||||
this.productqueryProduct() //list 数据
|
this.productqueryProduct() //list 数据
|
||||||
this.handlemessage() //监听websocket返回
|
this.handlemessage() //监听websocket返回
|
||||||
@@ -350,7 +349,7 @@
|
|||||||
*/
|
*/
|
||||||
async productqueryProduct() {
|
async productqueryProduct() {
|
||||||
let res = await this.api.productqueryProduct({
|
let res = await this.api.productqueryProduct({
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"productGroupId": ''
|
"productGroupId": ''
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -468,7 +467,7 @@
|
|||||||
"type": a == '+' ? 1 : 0,
|
"type": a == '+' ? 1 : 0,
|
||||||
"isVip": item.isVip,
|
"isVip": item.isVip,
|
||||||
"productId": item.id, //商品id
|
"productId": item.id, //商品id
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
}
|
}
|
||||||
@@ -492,7 +491,7 @@
|
|||||||
"type": c == '+' ? 1 : 0,
|
"type": c == '+' ? 1 : 0,
|
||||||
"isVip": item.isVip,
|
"isVip": item.isVip,
|
||||||
"productId": item.productId, //商品id
|
"productId": item.productId, //商品id
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
}
|
}
|
||||||
@@ -520,7 +519,7 @@
|
|||||||
*/
|
*/
|
||||||
async cartclear() {
|
async cartclear() {
|
||||||
let res = await this.api.cleanCart({
|
let res = await this.api.cleanCart({
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -580,7 +579,6 @@
|
|||||||
* @param {Object} index1
|
* @param {Object} index1
|
||||||
*/
|
*/
|
||||||
async clickspecifications(item1, index1, type) {
|
async clickspecifications(item1, index1, type) {
|
||||||
console.log(item1)
|
|
||||||
if ( item1.isPauseSale != 0 || item1.isSale == 0) {
|
if ( item1.isPauseSale != 0 || item1.isSale == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -595,15 +593,12 @@
|
|||||||
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
||||||
this.skuBtnText = `添加到购物车`
|
this.skuBtnText = `添加到购物车`
|
||||||
} else {
|
} else {
|
||||||
console.log(3)
|
|
||||||
// 多规格数据处理
|
// 多规格数据处理
|
||||||
this.isSpec = false;
|
this.isSpec = false;
|
||||||
let obj = await this.api.productquerySpec({
|
let obj = await this.api.productquerySpec({
|
||||||
productId: item1.id, //商品id
|
productId: item1.id, //商品id
|
||||||
})
|
})
|
||||||
console.log(2)
|
|
||||||
this.querySpecList = obj.data;
|
this.querySpecList = obj.data;
|
||||||
console.log(1)
|
|
||||||
this.specifications.tagSnap = JSON.parse(item1.productSkuResult.tagSnap).map((item,index) => {
|
this.specifications.tagSnap = JSON.parse(item1.productSkuResult.tagSnap).map((item,index) => {
|
||||||
let res = {
|
let res = {
|
||||||
id: item1.id, //商品id
|
id: item1.id, //商品id
|
||||||
@@ -645,9 +640,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log(1)
|
|
||||||
this.skuBtnText = `您还没选择${this.specifications.tagSnap[0].name}哦`
|
this.skuBtnText = `您还没选择${this.specifications.tagSnap[0].name}哦`
|
||||||
console.log(this.specifications)
|
|
||||||
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -743,15 +736,13 @@
|
|||||||
*/
|
*/
|
||||||
async hodgepodge(item, a, c, num) { //此接口去获取商品id !!!赋值库存 数量 价格等
|
async hodgepodge(item, a, c, num) { //此接口去获取商品id !!!赋值库存 数量 价格等
|
||||||
try {
|
try {
|
||||||
console.log(this.skuidname.join(","))
|
|
||||||
let res = await this.api.productqueryProductSku({
|
let res = await this.api.productqueryProductSku({
|
||||||
code: uni.cache.get('tableCode'),
|
code: uni.cache.get('tableCode'),
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: this.shopId,
|
||||||
productId: item.id, //商品id
|
productId: item.id, //商品id
|
||||||
isVip: item.isVip, //商品id
|
isVip: item.isVip, //商品id
|
||||||
spec_tag: this.skuidname.join(","),
|
spec_tag: this.skuidname.join(","),
|
||||||
})
|
})
|
||||||
console.log(res)
|
|
||||||
this.salePrice = res.data.salePrice // 价格
|
this.salePrice = res.data.salePrice // 价格
|
||||||
let data = null;
|
let data = null;
|
||||||
if (a == 1) { //1添加购物车 2是websocket返回这个商品的价格(应为不同的多规格商品返回不同的价格)
|
if (a == 1) { //1添加购物车 2是websocket返回这个商品的价格(应为不同的多规格商品返回不同的价格)
|
||||||
@@ -761,7 +752,7 @@
|
|||||||
"type": c == '+' ? 1 : 0,
|
"type": c == '+' ? 1 : 0,
|
||||||
"productId": item.id, //商品id
|
"productId": item.id, //商品id
|
||||||
"isVip": item.isVip,
|
"isVip": item.isVip,
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": this.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": uni.cache.get('tableCode'),
|
"tableId": uni.cache.get('tableCode'),
|
||||||
}
|
}
|
||||||
@@ -801,7 +792,7 @@
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/order_food/confirm_order?storeInfo=' + JSON.stringify(this.shopInfo.storeInfo)
|
url: `/pages/order_food/confirm_order?storeInfo=${JSON.stringify(this.shopInfo.storeInfo)}&cartList=${JSON.stringify(this.cartLists)}`
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -812,10 +803,8 @@
|
|||||||
*/
|
*/
|
||||||
getMessage(msg) { //wss 回显数据
|
getMessage(msg) { //wss 回显数据
|
||||||
if (msg == 1) { // 网络在连接
|
if (msg == 1) { // 网络在连接
|
||||||
this.fixedtrue = true
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.fixedtrue = false
|
|
||||||
if (msg.type == 'heartbeat') { //后台心跳 处理返回 不然控制台一直报错
|
if (msg.type == 'heartbeat') { //后台心跳 处理返回 不然控制台一直报错
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -886,6 +875,10 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
align-content: flex-start;
|
align-content: flex-start;
|
||||||
|
|
||||||
|
::v-deep .u-input input{
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
&>view {
|
&>view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png" mode="">
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png" mode="">
|
||||||
</image>
|
</image>
|
||||||
<text style="font-size: 28rpx;margin-left: 16rpx;">
|
<text style="font-size: 28rpx;margin-left: 16rpx;">
|
||||||
会员卡支付</text>
|
余额支付</text>
|
||||||
</view>
|
</view>
|
||||||
</u-radio>
|
</u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
@@ -207,7 +207,7 @@
|
|||||||
let isVip = uni.cache.get('userInfo').isPwd
|
let isVip = uni.cache.get('userInfo').isPwd
|
||||||
if (isVip == 0) {
|
if (isVip == 0) {
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
uni.pro.navigateTo('/pages/user/repairpassword', {
|
||||||
shopId_id: uni.cache.get('shopUser')
|
shopId_id: uni.cache.get('shopId')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.ispws = true
|
this.ispws = true
|
||||||
|
|||||||
@@ -17,36 +17,53 @@
|
|||||||
<view class="containertopbox">
|
<view class="containertopbox">
|
||||||
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
|
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
|
||||||
<view class="containertopboxitemleft flex-colum"
|
<view class="containertopboxitemleft flex-colum"
|
||||||
:class="item.status == 0?'':'containertopboxitemlefts'">
|
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': item.status != 0,}" v-if="item.type == 2">
|
||||||
<view class="containertopboxitemleft_one"
|
<view class="containertopboxitemleft_one"
|
||||||
:class="item.status == 0?'':'containertopboxitemleft_ones'">
|
:class="item.status == 0?'':'containertopboxitemleft_ones'">
|
||||||
<text style="font-size: 28rpx;">¥</text>
|
<block v-if="item.type == 2">
|
||||||
|
<text>{{item.num || 0}}</text>
|
||||||
|
<text style="font-size: 28rpx;margin-left: 6rpx;">张</text>
|
||||||
|
</block>
|
||||||
|
<block v-else >
|
||||||
|
<text style="font-size: 28rpx;margin-right: 6rpx;">¥</text>
|
||||||
<text>{{item.couponsAmount || 0}}</text>
|
<text>{{item.couponsAmount || 0}}</text>
|
||||||
|
</block>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="containertopboxitemleft_tow"
|
<view class="containertopboxitemleft_tow"
|
||||||
:class="item.status == 0?'':'containertopboxitemleft_tows'">
|
:class="{
|
||||||
优惠券(元)
|
'containertopboxitemleft_tows': item.status != 0,
|
||||||
|
'containertopboxitemleft_nameVip': item.type == 2,
|
||||||
|
}">
|
||||||
|
{{ item.type == 2 ? item.detail : '优惠券(元)'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="containertopboxitemright">
|
<view class="containertopboxitemright">
|
||||||
<view class="containertopboxitemright_one">
|
<view class="containertopboxitemright_one">
|
||||||
无门槛使用
|
<view class="flex-start">
|
||||||
|
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png" mode="aspectFill">
|
||||||
|
<text class="title">{{ item.shopName }}</text>
|
||||||
|
</view>
|
||||||
|
<text>无门槛使用</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="containertopboxitemright_tow">
|
<view class="containertopboxitemright_tow">
|
||||||
<view>通用红包券</view>
|
<view> {{ item.type == 2 ? '会员商品券' : '通用红包券'}}</view>
|
||||||
<view
|
<view
|
||||||
|
@click="navigatorGo(item)"
|
||||||
:class="item.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
:class="item.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
||||||
{{item.status == 0 ? '去使用':'已过期'}}
|
{{item.status == 0 ? '去使用':'已使用'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="containertopboxitemright_there">
|
<!-- <view class="containertopboxitemright_there">
|
||||||
有效期至:{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
|
有效期至:{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
|
||||||
v-if="is_end" mode="aspectFill"></image>
|
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||||
|
v-if="list.length <= 0" mode="aspectFill"></image>
|
||||||
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -66,82 +83,59 @@
|
|||||||
type: '0'
|
type: '0'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '已过期',
|
name: '已使用',
|
||||||
type: '1'
|
type: '1'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
towcontentclickindex: 0,
|
towcontentclickindex: 0,
|
||||||
list: [],
|
list: [],
|
||||||
is_end:false,
|
status: "",
|
||||||
form: {
|
|
||||||
page: 1, //页数
|
|
||||||
size: 10, //页容量
|
|
||||||
status: 'loadmore',
|
|
||||||
statuses: ''
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.ordermineCouponsthis()
|
this.ordermineCouponsthis()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
|
||||||
this.ordermineCouponsthis()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
init_fn(e) {
|
|
||||||
this.list = []
|
/**
|
||||||
this.form = {
|
* 切换类型
|
||||||
page: 1, //页数
|
* @param {Object} index
|
||||||
size: 10, //页容量
|
* @param {Object} item
|
||||||
status: 'loadmore',
|
*/
|
||||||
statuses: ''
|
towcontentclick(index, item) {
|
||||||
}
|
this.towcontentclickindex = index;
|
||||||
try {
|
this.status = item.type;
|
||||||
if (e) {
|
|
||||||
this.form.statuses = e
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
//TODO handle the exception
|
|
||||||
}
|
|
||||||
this.ordermineCouponsthis()
|
this.ordermineCouponsthis()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取优惠券数据
|
||||||
|
*/
|
||||||
async ordermineCouponsthis() {
|
async ordermineCouponsthis() {
|
||||||
try {
|
try {
|
||||||
let res = await this.api.ordermineCoupons({
|
let res = await this.api.getUserConpons({
|
||||||
userId: uni.cache.get('userInfo').id,
|
userId: uni.cache.get('userInfo').id,
|
||||||
status: this.form.statuses,
|
shopId: uni.cache.get('shopId'),
|
||||||
page: this.form.page,
|
status: this.status
|
||||||
size: this.form.size,
|
|
||||||
orderId:""
|
|
||||||
})
|
})
|
||||||
if (res.data.pages < this.form.page) {
|
if (res.code == 0) {
|
||||||
this.form.status = 'nomore'
|
this.list = res.data;
|
||||||
if (this.form.page == 1 && res.data.list == 0) {
|
|
||||||
this.is_end = true
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
this.form.status = 'loading';
|
|
||||||
this.form.page = ++this.form.page;
|
|
||||||
setTimeout(() => {
|
|
||||||
this.list = [...this.list, ...res.data.list];
|
|
||||||
this.form.status = 'loading';
|
|
||||||
if (res.data.pageNum == res.data.pages) {
|
|
||||||
this.form.status = 'nomore';
|
|
||||||
} else {
|
|
||||||
this.form.status = 'loading';
|
|
||||||
}
|
|
||||||
}, 500)
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
towcontentclick(index, item) {
|
|
||||||
this.towcontentclickindex = index
|
/**
|
||||||
this.form.statuses = item.type
|
* 去使用优惠券
|
||||||
this.init_fn(item.type)
|
*/
|
||||||
|
navigatorGo ( item ) {
|
||||||
|
if ( item.type == 2 ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -210,43 +204,32 @@
|
|||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||||
.containertopboxitemleft {
|
.containertopboxitemleft {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 182rpx;
|
width: 182rpx;
|
||||||
height: 192rpx;
|
height: 192rpx;
|
||||||
background: #E3AD7F;
|
background: #E3AD7F;
|
||||||
border-radius: 18rpx 0rpx 0rpx 18rpx;
|
border-radius: 18rpx 0rpx 0rpx 18rpx;
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
||||||
|
|
||||||
::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0rpx;
|
|
||||||
left: 166rpx;
|
|
||||||
background: #f9f9f9;
|
|
||||||
display: inline-block;
|
|
||||||
width: 32rpx;
|
|
||||||
height: 16rpx;
|
|
||||||
border-radius: 0 0 32rpx 32rpx;
|
|
||||||
z-index: 999;
|
|
||||||
}
|
|
||||||
|
|
||||||
::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0rpx;
|
|
||||||
left: 166rpx;
|
|
||||||
background: #f9f9f9;
|
|
||||||
display: inline-block;
|
|
||||||
width: 32rpx;
|
|
||||||
height: 16rpx;
|
|
||||||
line-height: 32rpx;
|
|
||||||
border-radius: 32rpx 32rpx 0 0;
|
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
|
|
||||||
z-index: 999;
|
|
||||||
|
|
||||||
}
|
// ::before {
|
||||||
|
// content: '';
|
||||||
|
// position: absolute;
|
||||||
|
// bottom: 0rpx;
|
||||||
|
// left: 166rpx;
|
||||||
|
// background: #fff;
|
||||||
|
// display: inline-block;
|
||||||
|
// width: 32rpx;
|
||||||
|
// height: 16rpx;
|
||||||
|
// line-height: 32rpx;
|
||||||
|
// border-radius: 32rpx 32rpx 0 0;
|
||||||
|
// box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
|
||||||
|
// z-index: 999;
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
.containertopboxitemleft_one {
|
.containertopboxitemleft_one {
|
||||||
text {
|
text {
|
||||||
@@ -269,12 +252,44 @@
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
.containertopboxitemleft_nameVip{
|
||||||
|
color: #967152;
|
||||||
|
}
|
||||||
|
|
||||||
.containertopboxitemleft_tows {
|
.containertopboxitemleft_tows {
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.containertopboxitemleft::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -20rpx;
|
||||||
|
left: 166rpx;
|
||||||
|
background: #fff;
|
||||||
|
display: inline-block;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: inset 0rpx -13rpx 7rpx -6rpx rgba(0, 0, 0, 0.1);
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
.containertopboxitemleft::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -20rpx;
|
||||||
|
left: 166rpx;
|
||||||
|
background: #fff;
|
||||||
|
display: inline-block;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: inset 0rpx 25rpx 15rpx -4rpx rgba(0, 0, 0, 0.1);
|
||||||
|
z-index: 999;
|
||||||
|
|
||||||
|
}
|
||||||
|
.containertopboxitemleft_vip{
|
||||||
|
background-color: #E1D4B2;
|
||||||
|
}
|
||||||
.containertopboxitemlefts {
|
.containertopboxitemlefts {
|
||||||
background: #F7F7F7;
|
background: #F7F7F7;
|
||||||
}
|
}
|
||||||
@@ -285,26 +300,39 @@
|
|||||||
flex: auto;
|
flex: auto;
|
||||||
height: 192rpx;
|
height: 192rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
||||||
border-radius: 0rpx 18rpx 18rpx 0rpx;
|
border-radius: 0rpx 18rpx 18rpx 0rpx;
|
||||||
|
|
||||||
.containertopboxitemright_one {
|
.containertopboxitemright_one {
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
padding: 16rpx 0 20rpx 0;
|
||||||
|
border-bottom: 1rpx dashed #707070;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.icon{
|
||||||
|
width: 26rpx;
|
||||||
|
height: 26rpx;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
}
|
||||||
|
text{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
padding: 16rpx 0 16rpx 0;
|
}
|
||||||
border-bottom: 1rpx dotted #707070;
|
.title{
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.containertopboxitemright_tow {
|
.containertopboxitemright_tow {
|
||||||
margin-top: 18rpx;
|
margin-top: 24rpx;
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.containertopboxitemright_there {
|
.containertopboxitemright_there {
|
||||||
@@ -318,13 +346,13 @@
|
|||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
padding: 8rpx 22rpx;
|
padding: 8rpx 24rpx;
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.containertopboxitemright_four {
|
.containertopboxitemright_four {
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
background: #333;
|
background: #967152;
|
||||||
}
|
}
|
||||||
|
|
||||||
.containertopboxitemright_fours {
|
.containertopboxitemright_fours {
|
||||||
|
|||||||
@@ -1,276 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<!-- 占位符导航栏 -->
|
|
||||||
<navseat :opacity='opacity' :title='titlename' :titleshow='true'></navseat>
|
|
||||||
<view class="onecontent">
|
|
||||||
<view :style="[{'padding-top':HeighT.customBar +44+'px'}]"></view>
|
|
||||||
<view class="onecontentbox">
|
|
||||||
<!-- <button open-type="chooseAvatar" @chooseavatar="uploadImg">
|
|
||||||
<image class="onecontentboximage" :src="userHeadImg" mode=""></image>
|
|
||||||
</button> -->
|
|
||||||
<!-- <image class="onecontentboximage" :src="userHeadImg" mode="" @click="uploadImg"></image> -->
|
|
||||||
<button type="default" class="btn" open-type="chooseAvatar" @chooseavatar="uploadImg">
|
|
||||||
<view class="" :style="'background-image:url('+userHeadImg+');'"
|
|
||||||
style="width: 180rxp;height: 180rpx; background-position: center;"></view>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="onecontentboxitem flex-between">
|
|
||||||
<view class="onecontentboxitemtext">
|
|
||||||
昵称
|
|
||||||
</view>
|
|
||||||
<input class="onecontentboxiteminput" v-model="nickName" type="nickname" @blur="bindblur"
|
|
||||||
placeholder="请输入昵称" @input="bindinput" />
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="onecontentboxitem flex-between" style="border-top: 1rpx dotted #333333;">
|
|
||||||
<view class="onecontentboxitemtext">
|
|
||||||
手机号
|
|
||||||
</view>
|
|
||||||
<button class="onecontentboxiteminput buttonstyle"
|
|
||||||
style="background-color: #fff;border: none;!important" open-type="getPhoneNumber"
|
|
||||||
@getphonenumber="getPhone">{{phonetitle}} </button>
|
|
||||||
<!-- <input class="onecontentboxiteminput" disabled v-model="phonetitle" type="text"
|
|
||||||
placeholder="请输入手机号"> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="onecontentboxitemnamber" @click="sumbit">
|
|
||||||
保存
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import navseat from '@/components/navseat.vue'
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
navseat
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
titlename: '完善信息',
|
|
||||||
opacity: false,
|
|
||||||
form: {
|
|
||||||
address: '', //地址
|
|
||||||
type: '', //品类
|
|
||||||
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
|
|
||||||
other: '', //附近1KM 1选中 0不选中
|
|
||||||
page: 1, //页数
|
|
||||||
size: 10, //页容量
|
|
||||||
status: 'loadmore',
|
|
||||||
},
|
|
||||||
userInfo: uni.cache.get('userInfo'),
|
|
||||||
userHeadImg: "",
|
|
||||||
nickName: '',
|
|
||||||
phonetitle: ""
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.userInfo = uni.cache.get('userInfo')
|
|
||||||
this.nickName = this.userInfo.nickName
|
|
||||||
this.userHeadImg = this.userInfo.headImg
|
|
||||||
this.phonetitle = this.userInfo.telephone ? this.userInfo.telephone : '请授权手机号'
|
|
||||||
},
|
|
||||||
onPageScroll(e) {
|
|
||||||
if (e.scrollTop <= 44) { //搜索导航栏
|
|
||||||
this.opacitys = false
|
|
||||||
} else {
|
|
||||||
this.opacitys = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async getPhone(d) {
|
|
||||||
if (d.detail.iv) {
|
|
||||||
uni.login({
|
|
||||||
provider: 'weixin',
|
|
||||||
success: async (data) => {
|
|
||||||
console.log(data)
|
|
||||||
let res = await this.api.userwxlogins({
|
|
||||||
code: data.code,
|
|
||||||
encryptedData: d.detail.encryptedData,
|
|
||||||
iv: d.detail.iv,
|
|
||||||
})
|
|
||||||
this.phonetitle = res.data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
bindblur(e) {
|
|
||||||
console.log(e, 11)
|
|
||||||
this.nickName = e.detail.value; // 获取微信昵称
|
|
||||||
},
|
|
||||||
bindinput(e) {
|
|
||||||
console.log(e, 22)
|
|
||||||
this.nickName = e.detail.value; // 获取微信昵称
|
|
||||||
},
|
|
||||||
// uploadImg() {
|
|
||||||
// let _this = this
|
|
||||||
// uni.chooseImage({
|
|
||||||
// crop: {
|
|
||||||
// width: 200,
|
|
||||||
// height: 200
|
|
||||||
// },
|
|
||||||
// success: (chooseImageRes) => {
|
|
||||||
// const tempFilePaths = chooseImageRes.tempFilePaths;
|
|
||||||
// uni.uploadFile({
|
|
||||||
// url: uni.conf.baseUrl + '/common/upload',
|
|
||||||
// filePath: tempFilePaths[0],
|
|
||||||
// header: {
|
|
||||||
// environment: 'app',
|
|
||||||
// type: 'android',
|
|
||||||
// version: '1.7.3',
|
|
||||||
// },
|
|
||||||
// name: "file",
|
|
||||||
// formData: {
|
|
||||||
// file: chooseImageRes.tempFiles[0],
|
|
||||||
// },
|
|
||||||
// success: (uploadFileRes) => {
|
|
||||||
// let {
|
|
||||||
// data
|
|
||||||
// } = JSON.parse(uploadFileRes.data)
|
|
||||||
// this.userHeadImg = data
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
uploadImg(e) {
|
|
||||||
const {
|
|
||||||
avatarUrl
|
|
||||||
} = e.detail
|
|
||||||
console.log(e)
|
|
||||||
console.log(e.detail)
|
|
||||||
// this.userHeadImg = avatarUrl
|
|
||||||
uni.uploadFile({
|
|
||||||
url: 'https://wxcashiertest.sxczgkj.cn/cashierService/common/upload',
|
|
||||||
// url: uni.conf.baseUrl + '/common/upload',
|
|
||||||
|
|
||||||
filePath: avatarUrl,
|
|
||||||
header: {
|
|
||||||
environment: 'app',
|
|
||||||
type: 'android',
|
|
||||||
version: '1.7.3',
|
|
||||||
},
|
|
||||||
name: "file",
|
|
||||||
formData: {
|
|
||||||
file: avatarUrl,
|
|
||||||
},
|
|
||||||
success: (uploadFileRes) => {
|
|
||||||
let {
|
|
||||||
data
|
|
||||||
} = JSON.parse(uploadFileRes.data)
|
|
||||||
this.userHeadImg = data
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async sumbit() {
|
|
||||||
let res = await this.api.upUserInfo({
|
|
||||||
headImg: this.userHeadImg,
|
|
||||||
nickName: this.nickName,
|
|
||||||
telephone: this.phonetitle == '请授权手机号' ? '' : this.phonetitle
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
HeighT() { //手机类型的尺寸
|
|
||||||
return this.$store.getters.is_BarHeight
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
page {
|
|
||||||
background: #F9F9F9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
.onecontent {
|
|
||||||
padding: 0 28rpx;
|
|
||||||
width: 100%;
|
|
||||||
height: 446rpx;
|
|
||||||
background: linear-gradient(180deg, #FFD158 0%, #F9F9F9 100%);
|
|
||||||
|
|
||||||
.onecontentbox {
|
|
||||||
position: relative;
|
|
||||||
margin-top: 116rpx;
|
|
||||||
width: 100%;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
|
||||||
padding: 75rpx 32rpx 0rpx 32rpx;
|
|
||||||
|
|
||||||
.onecontentboximage {
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
top: -60rpx;
|
|
||||||
width: 120rpx;
|
|
||||||
height: 120rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.onecontentboxitem {
|
|
||||||
padding: 24rpx 0;
|
|
||||||
|
|
||||||
.onecontentboxitemtext {
|
|
||||||
font-family: PingFang SC, PingFang SC;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.onecontentboxiteminput {
|
|
||||||
text-align: right;
|
|
||||||
flex: auto;
|
|
||||||
font-family: PingFang SC, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonstyle {
|
|
||||||
.buttonstyle:after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.onecontentboxitemnamber {
|
|
||||||
margin-top: 84rpx;
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
background: #FFD158;
|
|
||||||
border-radius: 46rpx 46rpx 46rpx 46rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 36rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 180rpx;
|
|
||||||
height: 180rpx;
|
|
||||||
border-radius: 100%;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
>view {
|
|
||||||
border-radius: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style>
|
|
||||||
.buttonstyle:after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -6,7 +6,12 @@
|
|||||||
<view class="list_item">
|
<view class="list_item">
|
||||||
<view class="list_item_left">头像</view>
|
<view class="list_item_left">头像</view>
|
||||||
<view class="list_item_right flex-center">
|
<view class="list_item_right flex-center">
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<button class="list_item_right_head" type="default" open-type="chooseAvatar" @chooseavatar="uploadImg">
|
<button class="list_item_right_head" type="default" open-type="chooseAvatar" @chooseavatar="uploadImg">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
|
<button class="list_item_right_head" type="default" open-type="chooseAvatar" onChooseAvatar="uploadImg">
|
||||||
|
<!-- #endif -->
|
||||||
<image class="list_item_right_head" :src="userHeadImg" mode="aspectFill"></image>
|
<image class="list_item_right_head" :src="userHeadImg" mode="aspectFill"></image>
|
||||||
</button>
|
</button>
|
||||||
<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
|
<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
|
||||||
@@ -38,7 +43,7 @@
|
|||||||
<view class="list_item_left">性别</view>
|
<view class="list_item_left">性别</view>
|
||||||
<view class="list_item_right flex-center">
|
<view class="list_item_right flex-center">
|
||||||
<view class="place r" @click="sexShow = true">{{sexText}}</view>
|
<view class="place r" @click="sexShow = true">{{sexText}}</view>
|
||||||
<u-picker @cancel="sexShow = false" :show="sexShow" :columns="sexList" keyName="label" @confirm="confirmSex"></u-picker>
|
<u-picker @cancel="sexShow = false" itemHeight="66" :show="sexShow" :columns="sexList" keyName="label" @confirm="confirmSex"></u-picker>
|
||||||
<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
|
<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -51,7 +56,7 @@
|
|||||||
<!-- <picker :show="calendarShow" mode="date"></picker> -->
|
<!-- <picker :show="calendarShow" mode="date"></picker> -->
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
mode="date"
|
mode="date"
|
||||||
itemHeight="66"
|
itemHeight="90"
|
||||||
visibleItemCount="5"
|
visibleItemCount="5"
|
||||||
@cancel="calendarShow = false"
|
@cancel="calendarShow = false"
|
||||||
:show="calendarShow"
|
:show="calendarShow"
|
||||||
@@ -171,10 +176,30 @@
|
|||||||
* 获取手机号
|
* 获取手机号
|
||||||
* @param {Object} d
|
* @param {Object} d
|
||||||
*/
|
*/
|
||||||
async getPhone(d) {
|
getPhone(d) {
|
||||||
|
console.log(d)
|
||||||
if (d.detail.iv) {
|
if (d.detail.iv) {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
|
success: async (data) => {
|
||||||
|
// 微信小程序环境
|
||||||
|
console.log(data)
|
||||||
|
let res = await this.api.userwxlogins({
|
||||||
|
code: data.code,
|
||||||
|
encryptedData: d.detail.encryptedData,
|
||||||
|
iv: d.detail.iv,
|
||||||
|
})
|
||||||
|
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
||||||
|
this.mobile = res.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
// 支付宝小程序环境
|
||||||
|
my.getAuthCode({
|
||||||
|
scopes: 'auth_user',
|
||||||
success: async (data) => {
|
success: async (data) => {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
let res = await this.api.userwxlogins({
|
let res = await this.api.userwxlogins({
|
||||||
@@ -185,7 +210,10 @@
|
|||||||
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
||||||
this.mobile = res.data;
|
this.mobile = res.data;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -217,6 +245,7 @@
|
|||||||
* @param {Object} e
|
* @param {Object} e
|
||||||
*/
|
*/
|
||||||
uploadImg(e) {
|
uploadImg(e) {
|
||||||
|
console.log(e)
|
||||||
const { avatarUrl } = e.detail
|
const { avatarUrl } = e.detail
|
||||||
// this.userHeadImg = avatarUrl
|
// this.userHeadImg = avatarUrl
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
@@ -233,11 +262,15 @@
|
|||||||
file: avatarUrl,
|
file: avatarUrl,
|
||||||
},
|
},
|
||||||
success: (uploadFileRes) => {
|
success: (uploadFileRes) => {
|
||||||
|
console.log(uploadFileRes)
|
||||||
let {
|
let {
|
||||||
data
|
data
|
||||||
} = JSON.parse(uploadFileRes.data)
|
} = JSON.parse(uploadFileRes.data)
|
||||||
this.userHeadImg = data
|
this.userHeadImg = data
|
||||||
},
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -270,6 +303,10 @@
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
.container{
|
.container{
|
||||||
|
|
||||||
|
::v-deep .u-input input{
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
.info_list{
|
.info_list{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -63,7 +63,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
||||||
import webSocketUtils from '@/common/js/websocket.js'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -82,7 +82,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
||||||
import webSocketUtils from '@/common/js/websocket.js'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.init_fn()
|
this.init_fn()
|
||||||
this.loginwxuserInfo()
|
this.loginwxuserInfo()
|
||||||
if (uni.cache.get('shopUser') ) {
|
if (uni.cache.get('shopId') ) {
|
||||||
this.getShopInfo();
|
this.getShopInfo();
|
||||||
this.getShopExtend();
|
this.getShopExtend();
|
||||||
} else{
|
} else{
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
*/
|
*/
|
||||||
async getShopExtend () {
|
async getShopExtend () {
|
||||||
let res = await this.api.getShopExtend({
|
let res = await this.api.getShopExtend({
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: uni.cache.get('shopId'),
|
||||||
autokey: "my_bg" //index_bg my_bg member_bg shopInfo_bg
|
autokey: "my_bg" //index_bg my_bg member_bg shopInfo_bg
|
||||||
})
|
})
|
||||||
if ( res.code == 0) {
|
if ( res.code == 0) {
|
||||||
@@ -120,11 +120,13 @@
|
|||||||
*/
|
*/
|
||||||
async loginwxuserInfo() {
|
async loginwxuserInfo() {
|
||||||
let res = await this.api.loginwxuserInfo({
|
let res = await this.api.loginwxuserInfo({
|
||||||
|
// userId: 109
|
||||||
userId: uni.cache.get('userInfo').id
|
userId: uni.cache.get('userInfo').id
|
||||||
})
|
})
|
||||||
|
console.log(res)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.cache.set('userInfo', res.data);
|
uni.cache.set('userInfo', res.data);
|
||||||
this.userInfo = uni.cache.get('userInfo')
|
this.userInfo = res.data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -157,7 +159,7 @@
|
|||||||
*/
|
*/
|
||||||
async getShopInfo() {
|
async getShopInfo() {
|
||||||
let res = await this.api.shopUserInfo({
|
let res = await this.api.shopUserInfo({
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopId'),
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -173,10 +175,10 @@
|
|||||||
* 查看二维码
|
* 查看二维码
|
||||||
*/
|
*/
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||||
if ( this.shopInfo.isVip == 0 ) {
|
if ( this.shopInfo.isVip == 0 ) {
|
||||||
uni.pro.navigateTo('member/memberdetails', {
|
uni.pro.navigateTo('member/memberdetails', {
|
||||||
shopId_id: uni.cache.get('shopUser')
|
shopId_id: uni.cache.get('shopId')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -194,8 +196,8 @@
|
|||||||
|
|
||||||
clickTo(item, index) {
|
clickTo(item, index) {
|
||||||
let shopId = null;
|
let shopId = null;
|
||||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||||
shopId = uni.cache.get('shopUser');
|
shopId = uni.cache.get('shopId');
|
||||||
} else{
|
} else{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -209,9 +211,9 @@
|
|||||||
uni.pro.navigateTo('member/list')
|
uni.pro.navigateTo('member/list')
|
||||||
break
|
break
|
||||||
case 'recharge':
|
case 'recharge':
|
||||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||||
uni.pro.navigateTo('member/index', {
|
uni.pro.navigateTo('member/index', {
|
||||||
shopId: uni.cache.get('shopUser'),
|
shopId: uni.cache.get('shopId'),
|
||||||
type: 'index',
|
type: 'index',
|
||||||
})
|
})
|
||||||
} else{
|
} else{
|
||||||
|
|||||||
@@ -61,19 +61,8 @@ const store = new Vuex.Store({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
loginEvent: () => {
|
loginEvent: async () => {
|
||||||
uni.login({
|
let res = await uni.utils.getUserInfo();
|
||||||
provider: 'weixin',
|
|
||||||
success: (data) => {
|
|
||||||
uni.getUserInfo({
|
|
||||||
provider: 'weixin',
|
|
||||||
success: async (infoRes) => {
|
|
||||||
uni.cache.set('weixincode', data.code);
|
|
||||||
let res = await Api.userwxlogin({
|
|
||||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
|
||||||
rawData: infoRes.rawData,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.cache.set('token', res.data.token);
|
uni.cache.set('token', res.data.token);
|
||||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||||
.miniAppOpenId)
|
.miniAppOpenId)
|
||||||
@@ -84,12 +73,7 @@ const store = new Vuex.Store({
|
|||||||
curPage.onShow()
|
curPage.onShow()
|
||||||
// curPage.mounted()
|
// curPage.mounted()
|
||||||
curPage.onReady()
|
curPage.onReady()
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
set_shopid: async ({
|
set_shopid: async ({
|
||||||
@@ -134,12 +118,15 @@ const store = new Vuex.Store({
|
|||||||
bottomPadding = (e.screenHeight - e.safeArea.bottom)
|
bottomPadding = (e.screenHeight - e.safeArea.bottom)
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
|
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
||||||
statusBar = e.statusBarHeight
|
statusBar = e.statusBarHeight
|
||||||
customBar = e.statusBarHeight + e.titleBarHeight
|
customBar = e.titleBarHeight
|
||||||
|
custwidth = menuButtonInfo.width + 50,
|
||||||
bottomPadding = (e.screenHeight - e.safeArea.bottom)
|
bottomPadding = (e.screenHeight - e.safeArea.bottom)
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
console.log('app-plus', e)
|
console.log('app-plus', e)
|
||||||
|
|
||||||
statusBar = e.statusBarHeight
|
statusBar = e.statusBarHeight
|
||||||
heightBar = e.statusBarHeight
|
heightBar = e.statusBarHeight
|
||||||
customBar = e.statusBarHeight
|
customBar = e.statusBarHeight
|
||||||
|
|||||||
@@ -156,10 +156,10 @@
|
|||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => {
|
default: () => {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||||
return '2d';
|
return '2d';
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||||
return 'normal';
|
return 'normal';
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
@@ -294,6 +294,7 @@
|
|||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
handler() {
|
handler() {
|
||||||
|
console.log(this.auto)
|
||||||
if (this.auto) {
|
if (this.auto) {
|
||||||
this.remake();
|
this.remake();
|
||||||
}
|
}
|
||||||
@@ -331,7 +332,7 @@
|
|||||||
this.templateOptions.canvasWidth = this.templateOptions.size;
|
this.templateOptions.canvasWidth = this.templateOptions.size;
|
||||||
this.templateOptions.canvasHeight = this.templateOptions.size;
|
this.templateOptions.canvasHeight = this.templateOptions.size;
|
||||||
if (this.canvasType == '2d') {
|
if (this.canvasType == '2d') {
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||||
this.templateOptions.canvasTransform = `scale(${this.templateOptions.size / this.templateOptions.canvasWidth}, ${this.templateOptions.size /
|
this.templateOptions.canvasTransform = `scale(${this.templateOptions.size / this.templateOptions.canvasWidth}, ${this.templateOptions.size /
|
||||||
this.templateOptions.canvasHeight})`;
|
this.templateOptions.canvasHeight})`;
|
||||||
// #endif
|
// #endif
|
||||||
@@ -462,7 +463,7 @@
|
|||||||
let canvasContext = null;
|
let canvasContext = null;
|
||||||
// #ifndef APP-NVUE
|
// #ifndef APP-NVUE
|
||||||
if (this.canvasType === '2d') {
|
if (this.canvasType === '2d') {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||||
/* 微信小程序获取canvas2d上下文方式 */
|
/* 微信小程序获取canvas2d上下文方式 */
|
||||||
const canvas = (this.canvas = await new Promise(resolve => {
|
const canvas = (this.canvas = await new Promise(resolve => {
|
||||||
uni
|
uni
|
||||||
@@ -502,7 +503,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||||
/* 非微信小程序不支持2d,切换回uniapp获取canvas上下文方式 */
|
/* 非微信小程序不支持2d,切换回uniapp获取canvas上下文方式 */
|
||||||
canvasContext = this.canvasContext = uni.createCanvasContext(this.canvasId, this);
|
canvasContext = this.canvasContext = uni.createCanvasContext(this.canvasId, this);
|
||||||
/* 使用dynamicSize,可以解决小块间出现白线问题,再通过scale缩放至size,使其达到所设尺寸 */
|
/* 使用dynamicSize,可以解决小块间出现白线问题,再通过scale缩放至size,使其达到所设尺寸 */
|
||||||
@@ -752,7 +753,7 @@
|
|||||||
|
|
||||||
// #ifndef APP-NVUE
|
// #ifndef APP-NVUE
|
||||||
if (this.canvasType === '2d') {
|
if (this.canvasType === '2d') {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||||
try {
|
try {
|
||||||
let dataURL = null;
|
let dataURL = null;
|
||||||
// #ifdef VUE3
|
// #ifdef VUE3
|
||||||
@@ -831,7 +832,7 @@
|
|||||||
success: res => {
|
success: res => {
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
if (this.canvasType === '2d') {
|
if (this.canvasType === '2d') {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||||
/* 需要将 data:image/png;base64, 这段去除 writeFile 才能正常打开文件,否则是损坏文件,无法打开 */
|
/* 需要将 data:image/png;base64, 这段去除 writeFile 才能正常打开文件,否则是损坏文件,无法打开 */
|
||||||
const reg = new RegExp('^data:image/png;base64,', 'g');
|
const reg = new RegExp('^data:image/png;base64,', 'g');
|
||||||
const dataURL = res.tempFilePath.replace(reg, '');
|
const dataURL = res.tempFilePath.replace(reg, '');
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
class="u-picker__view__column"
|
class="u-picker__view__column"
|
||||||
>
|
>
|
||||||
<text
|
<view
|
||||||
v-if="$u.test.array(item)"
|
v-if="$u.test.array(item)"
|
||||||
class="u-picker__view__column__item u-line-1"
|
class="u-picker__view__column__item u-line-1"
|
||||||
v-for="(item1, index1) in item"
|
v-for="(item1, index1) in item"
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
lineHeight: $u.addUnit(itemHeight),
|
lineHeight: $u.addUnit(itemHeight),
|
||||||
fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
|
fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
|
||||||
}"
|
}"
|
||||||
>{{ getItemText(item1) }}</text>
|
>{{ getItemText(item1) }}</view>
|
||||||
</picker-view-column>
|
</picker-view-column>
|
||||||
</picker-view>
|
</picker-view>
|
||||||
<view
|
<view
|
||||||
@@ -242,12 +242,13 @@ export default {
|
|||||||
&__view {
|
&__view {
|
||||||
|
|
||||||
&__column {
|
&__column {
|
||||||
@include flex;
|
@include flex(column);
|
||||||
flex: 1;
|
flex: 1;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
// flex-direction: column;
|
||||||
&__item {
|
&__item {
|
||||||
@include flex;
|
@include flex;
|
||||||
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|||||||
Reference in New Issue
Block a user