订单相关修改提测
This commit is contained in:
parent
c2ff506543
commit
2dbcdf4300
26
App.vue
26
App.vue
|
|
@ -3,15 +3,30 @@
|
|||
<script>
|
||||
import Api from '@/common/js/api.js'
|
||||
export default {
|
||||
globalData: {
|
||||
systemInfo: null
|
||||
},
|
||||
onLaunch: function() {
|
||||
if ( uni.getStorageSync("NAME") && !uni.getStorageSync("NAME").data) {
|
||||
uni.cache.clear();
|
||||
}
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
||||
// #endif
|
||||
uni.cache.set('NAME', '零点八零');
|
||||
// this.$store.dispatch("loginEvent")
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
onShow: function() {
|
||||
// 获取导航栏信息
|
||||
|
||||
wx.getSystemInfo({
|
||||
success: res => {
|
||||
this.globalData.systemInfo = res;
|
||||
}
|
||||
})
|
||||
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
||||
// #ifdef MP-WEIXIN
|
||||
// 当向小程序后台请求完新版本信息,会进行回调。res: {hasUpdate: true, version: 1.0.0}
|
||||
|
|
@ -55,11 +70,22 @@
|
|||
if (!uni.cache.get('token')) {
|
||||
// this.$store.dispatch("loginEvent"); //获取shapid
|
||||
uni.login({
|
||||
// #ifndef MP-WEIXIN
|
||||
provider: 'weixin',
|
||||
// #endif
|
||||
// #ifndef MP-ALIPAY
|
||||
provider: 'alipay',
|
||||
// #endif
|
||||
success: (data) => {
|
||||
uni.getUserInfo({
|
||||
// #ifndef MP-WEIXIN
|
||||
provider: 'weixin',
|
||||
// #endif
|
||||
// #ifndef MP-ALIPAY
|
||||
provider: 'alipay',
|
||||
// #endif
|
||||
success: async (infoRes) => {
|
||||
console.log(infoRes)
|
||||
uni.cache.set('weixincode', data.code);
|
||||
let res = await Api.userwxlogin({
|
||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||
|
|
|
|||
113
common/js/api.js
113
common/js/api.js
|
|
@ -2,15 +2,20 @@ export default {
|
|||
userwxlogin(data) { //登录
|
||||
return uni.api.post("/login/wx/custom/login", data);
|
||||
},
|
||||
loginwxuserInfo(data) { //获取用户详情
|
||||
return uni.api.get("/login/userInfo", data);
|
||||
},
|
||||
userwxlogins(data) { // 获取手机号
|
||||
return uni.api.post("/login/getPhoneNumber", data);
|
||||
},
|
||||
loginapplogin(data) { //APP登录(登录即注册)
|
||||
return uni.api.post("/login/app/login", data);
|
||||
},
|
||||
getShopExtend(data) { //获取图片 通过shopId和autokey
|
||||
return uni.api.post("/common/shopExtend", data,false);
|
||||
},
|
||||
// 获取弹窗广告列表
|
||||
getPopUpAd(data) {
|
||||
return uni.api.get("/tbShopAd/list", data);
|
||||
},
|
||||
|
||||
productqueryShop(data) { //通过桌码获取店铺信息
|
||||
return uni.api.get("/product/queryShop", data);
|
||||
},
|
||||
|
|
@ -26,66 +31,61 @@ export default {
|
|||
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) {
|
||||
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) {
|
||||
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) { //查询订单支付状态
|
||||
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) {
|
||||
return uni.api.get("/user/shopUserInfo", data);
|
||||
},
|
||||
|
|
@ -97,10 +97,7 @@ export default {
|
|||
upVipPhont(data) {
|
||||
return uni.api.post("/user/upVipPhont", data);
|
||||
},
|
||||
// 获取弹窗广告列表
|
||||
getPopUpAd(data) {
|
||||
return uni.api.get("/tbShopAd/list", data);
|
||||
},
|
||||
|
||||
|
||||
// 优惠券数量
|
||||
userCoupon(data) {
|
||||
|
|
@ -144,6 +141,10 @@ export default {
|
|||
ordermineCoupons(data) { //我的优惠券
|
||||
return uni.api.get("/order/mineCoupons", data, false);
|
||||
},
|
||||
getUserConpons(data) { //我的优惠券
|
||||
return uni.api.post("/userConpons/find", data);
|
||||
},
|
||||
|
||||
ordergetYhqPara(data) { //获取优惠券参数列表
|
||||
return uni.api.get("/order/getYhqPara", data);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class webSocketUtils {
|
||||
constructor(url, time, params) {
|
||||
this.socketTask = null;
|
||||
this.socketTask = false;
|
||||
this.is_open_socket = false; //避免重复连接
|
||||
this.url = url;
|
||||
this.params = params ? params : null; ////是否初始化请求
|
||||
|
|
@ -13,31 +13,41 @@ class webSocketUtils {
|
|||
this.heartbeatInterval = null; //检测服务器端是否还活着
|
||||
this.reconnectTimeOut = null; //重连之后多久再次重连
|
||||
try {
|
||||
|
||||
return this.connectSocketInit({
|
||||
data: this.params,
|
||||
type: 'connectSocketInit',
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('catch');
|
||||
// console.log('catch');
|
||||
this.reconnect();
|
||||
}
|
||||
}
|
||||
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||
connectSocketInit(data) {
|
||||
let _this = this;
|
||||
this.data = data;
|
||||
this.socketTask = uni.connectSocket({
|
||||
|
||||
uni.connectSocket({
|
||||
url: this.url,
|
||||
success: () => {
|
||||
// console.log('正准备建立websocket中...');
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('建立websocketc成功...');
|
||||
// uni.hideLoading();
|
||||
// 返回实例
|
||||
return this.socketTask;
|
||||
this.socketTask = true;
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
this.socketTask.onOpen((res) => {
|
||||
|
||||
uni.onSocketOpen((res) => {
|
||||
uni.hideLoading()
|
||||
this.connectNum = 1;
|
||||
// console.log('WebSocket连接正常!');
|
||||
console.log('WebSocket连接正常!==',res);
|
||||
if (this.params) { //是否初始化请求
|
||||
this.send(this.params);
|
||||
}
|
||||
|
|
@ -47,17 +57,21 @@ class webSocketUtils {
|
|||
this.canReconnect = true;
|
||||
this.start();
|
||||
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||
this.socketTask.onMessage((e) => {
|
||||
|
||||
uni.onSocketMessage((e)=>{
|
||||
// 字符串转json
|
||||
let res = JSON.parse(e.data);
|
||||
uni.$emit('message', res)
|
||||
// 普通socket信息处理 TODO
|
||||
});
|
||||
},(res)=>{
|
||||
|
||||
console.log(res)
|
||||
});
|
||||
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
||||
uni.onSocketError((res) => {
|
||||
console.log('网络断开,请检查!');
|
||||
this.socketTask = null;
|
||||
this.socketTask = false;
|
||||
this.is_open_socket = false;
|
||||
// this.Close()
|
||||
this.canReconnect = true;
|
||||
|
|
@ -97,11 +111,18 @@ class webSocketUtils {
|
|||
}
|
||||
});
|
||||
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||
this.socketTask.onClose(() => {
|
||||
this.socketTask = null;
|
||||
uni.onSocketClose((res) => {
|
||||
console.log("socket关闭了")
|
||||
this.socketTask = false;
|
||||
clearInterval(this.heartbeatInterval);
|
||||
clearInterval(this.reconnectTimeOut);
|
||||
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序的ws连接问题,关闭连接时需关闭对于接受,防止关闭失败
|
||||
uni.offSocketMessage();
|
||||
uni.offSocketError();
|
||||
uni.offSocketOpen();
|
||||
uni.offSocketClose();
|
||||
// #endif
|
||||
this.is_open_socket = false;
|
||||
if (this.canReconnect) {
|
||||
this.reconnect();
|
||||
|
|
@ -113,26 +134,41 @@ class webSocketUtils {
|
|||
Close() {
|
||||
this.is_open_socket = true;
|
||||
this.canReconnect = false;
|
||||
if (this.socketTask) {
|
||||
this.socketTask.close({
|
||||
// if (this.socketTask) {
|
||||
uni.closeSocket({
|
||||
success(res) {
|
||||
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) {
|
||||
// console.log("发送消息---------->", data);
|
||||
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
||||
if (this.socketTask) {
|
||||
this.socketTask.send({
|
||||
// if (this.socketTask) {
|
||||
uni.sendSocketMessage({
|
||||
data: JSON.stringify(data),
|
||||
async success() {
|
||||
success(res) {
|
||||
// console.log("消息发送成功");
|
||||
},
|
||||
});
|
||||
}
|
||||
// }
|
||||
}
|
||||
//开启心跳检测
|
||||
start(data) {
|
||||
|
|
@ -149,6 +185,7 @@ class webSocketUtils {
|
|||
//停止发送心跳
|
||||
clearInterval(this.heartbeatInterval);
|
||||
//如果不是人为关闭的话,进行重连
|
||||
console.log(!this.is_open_socket)
|
||||
if (!this.is_open_socket) {
|
||||
console.log('进行重连');
|
||||
this.canReconnect = true;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@
|
|||
methods: {
|
||||
touchstart() {
|
||||
this.Time = setInterval(() => {
|
||||
console.log(this.money);
|
||||
if (this.money == '') {
|
||||
clearInterval();
|
||||
}
|
||||
|
|
@ -82,7 +81,7 @@
|
|||
},
|
||||
//处理按键
|
||||
_handleKeyPress(e) {
|
||||
console.log('点击传e', e.target.dataset.num);
|
||||
// console.log('点击传e', e.target.dataset.num);
|
||||
let num = e.target.dataset.num;
|
||||
//不同按键处理逻辑
|
||||
// -1 代表无效按键,直接返回
|
||||
|
|
@ -141,8 +140,6 @@
|
|||
|
||||
//处理数字
|
||||
_handleNumberKey(num) {
|
||||
|
||||
|
||||
let S = this.money;
|
||||
//如果有小数点且小数点位数不小于2
|
||||
// if (S.indexOf('.') > -1 && S.substring(S.indexOf('.') + 1).length < 2)
|
||||
|
|
@ -157,8 +154,6 @@
|
|||
// this.money = S + num;
|
||||
// }
|
||||
// }
|
||||
console.log(this.money)
|
||||
console.log(this.money,this.money.length)
|
||||
if (this.money.length == 6) {
|
||||
this.$emit('confirmEvent', this.money); //提交参数
|
||||
return
|
||||
|
|
|
|||
|
|
@ -2,36 +2,42 @@
|
|||
<view class="content">
|
||||
<!-- 导航栏 -->
|
||||
<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="navbar_tow flex-between"
|
||||
<view class="navbar_tow 1 flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow flex-between">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- 标题搜索框 -->
|
||||
<view class="flex-between">
|
||||
<view class="navbar_tow_one flex-start">
|
||||
<u-icon style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
||||
size="16"></u-icon>
|
||||
</view>
|
||||
<view class="navbar_tow_tow flex-start">
|
||||
<input type="text" class="navbar_tow_towinput" v-model="keyword" placeholder="请输入关键字" />
|
||||
<view class="navbar_tow_towview">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow 2 flex-between">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow 3 flex-between"
|
||||
: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 -->
|
||||
<!-- 标题搜索框 -->
|
||||
<view class="flex-between">
|
||||
<view class="navbar_tow_one flex-start">
|
||||
<u-icon style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
||||
size="16"></u-icon>
|
||||
</view>
|
||||
<view class="navbar_tow_tow flex-start">
|
||||
<input type="text" class="navbar_tow_towinput" v-model="keyword" placeholder="请输入关键字" />
|
||||
<view class="navbar_tow_towview">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
console.log("menuButtonInfo==",menuButtonInfo)
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -48,9 +54,14 @@
|
|||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
console.log("navHeighT==",this.$store.getters.is_BarHeight)
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(1)
|
||||
console.log(uni.getMenuButtonBoundingClientRect())
|
||||
},
|
||||
methods: {}
|
||||
|
||||
};
|
||||
|
|
@ -153,9 +164,9 @@
|
|||
}
|
||||
|
||||
.navbar_tow_towinput {
|
||||
height: 64rpx;
|
||||
padding-left: 32rpx;
|
||||
padding-right: 116rpx;
|
||||
height: 100%;
|
||||
flex: auto;
|
||||
background: #FFFFFF;
|
||||
border-radius: 34rpx;
|
||||
|
|
|
|||
|
|
@ -2,24 +2,35 @@
|
|||
<view class="navbarcontent">
|
||||
<!-- 导航栏 -->
|
||||
<view class="navbar" :class="{active:opacity}">
|
||||
<!-- #ifndef APP-PLUS || MP-WEIXIN -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #ifndef APP-PLUS || MP-WEIXIN || MP-ALIPAY -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="navbar_tow flex-between" :style="{'marginTop':HeighT.heightBar /2+'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<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'}">
|
||||
<!-- #endif -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<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'}">
|
||||
<!-- #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 -->
|
||||
<!-- 标题搜索框 -->
|
||||
<view class="flex-between" v-if="opacity&&inputshow">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<view class="navbar_tow_one flex-start" v-if="iconshow" @click="clicknavigateBack">
|
||||
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
||||
</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
|
||||
placeholder="请输入内容"
|
||||
class="custom-input"
|
||||
|
|
@ -40,15 +51,21 @@
|
|||
</view>
|
||||
<!-- 正常导航栏 -->
|
||||
<view class="flex-between" @click="clicknavigateBack" v-else>
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<view class="navbar_tow_one flex-start" v-if="iconshow">
|
||||
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
||||
</view>
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
|
||||
<view class="navbar_tow_tow" v-if="opacity || titleshow" :style="{color: namecolor}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow_tow" v-if="opacity || titleshow"
|
||||
: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 -->
|
||||
{{title}}
|
||||
</view>
|
||||
|
|
@ -129,6 +146,9 @@
|
|||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
menuButtonInfo() { //手机类型的尺寸
|
||||
return uni.getMenuButtonBoundingClientRect()
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@
|
|||
},
|
||||
watch: {
|
||||
forceUpdate(val,oldval) {
|
||||
console.log(val,oldval)
|
||||
// 在 forceUpdate 改变时执行更新操作
|
||||
let time = uni.cache.get('popUpTime') ? new Date().getTime() - uni.cache.get('popUpTime') : 1000;
|
||||
if ( time >= 1000 ) {
|
||||
|
|
@ -62,9 +61,9 @@
|
|||
}
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
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 () {
|
||||
let res = await this.api.getPopUpAd({
|
||||
shopId: uni.cache.get('shopUser')
|
||||
shopId: uni.cache.get('shopId')
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.popupadList = [];
|
||||
|
|
@ -141,6 +140,7 @@
|
|||
// updateTime
|
||||
|
||||
}
|
||||
this.viewswiperShow = false;
|
||||
if ( this.popupadList.length > 0 ) {
|
||||
this.viewswiperShow = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<template xlang="wxml" minapp="mpvue">
|
||||
<view class="tki-barcode">
|
||||
<!-- #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'}" />
|
||||
<!-- #endif -->
|
||||
<!-- #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 -->
|
||||
<image v-show="show" :src="result" :style="{width:canvasWidth+'px',height:canvasHeight+'px'}" />
|
||||
</view>
|
||||
|
|
@ -83,6 +83,7 @@
|
|||
onUnload: function() {},
|
||||
methods: {
|
||||
setval(n) {
|
||||
console.log(n)
|
||||
this.val = n
|
||||
if (!this._empty(n)) {
|
||||
setTimeout(() => {
|
||||
|
|
@ -166,7 +167,10 @@
|
|||
},
|
||||
watch: {
|
||||
val(n, o) {
|
||||
console.log(n,0)
|
||||
console.log(this.onval)
|
||||
if (this.onval) {
|
||||
console.log(!this._empty(n))
|
||||
if (n != o && !this._empty(n)) {
|
||||
setTimeout(() => {
|
||||
this._makeCode()
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ const debug = process.env.NODE_ENV == 'development' ? true : false;
|
|||
// #ifdef H5
|
||||
const proxyApi = "/api"
|
||||
// #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.74:9888/cashierService' // 帆哥
|
||||
// const proxyApiwws = 'ws://192.168.2.74:9888/cashierService' // 测试
|
||||
// const proxyApi = 'http://192.168.1.27:9888/cashierService' // 帆哥
|
||||
// const proxyApiwws = 'ws://192.168.1.15:9999/netty' // 测试
|
||||
const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||
const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||
// #endif
|
||||
|
|
@ -15,12 +15,12 @@ const baseUrl = debug ? proxyApi + '/cashierService' : "https://cashier.sxczgkj.
|
|||
const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
|
||||
// #endif
|
||||
|
||||
// #ifdef APP || MP-WEIXIN
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
||||
const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上
|
||||
|
||||
// const baseUrl = 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
||||
// const baseUrlwws = 'wss://cashier.sxczgkj.cn/netty' // 线上/
|
||||
// const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||
// const baseUrlwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||
// #endif
|
||||
|
||||
// import VConsole from "./vConsole.js"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import md5 from './md5'
|
||||
import Api from "@/common/js/api.js"
|
||||
|
||||
/**
|
||||
* 转换对象为x-www-form-urlencoded
|
||||
|
|
@ -232,11 +233,84 @@ const pluschooseImage = function() {
|
|||
return true
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
return true
|
||||
// #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 = {
|
||||
md5,
|
||||
transformRequest,
|
||||
|
|
@ -253,5 +327,6 @@ uni.utils = {
|
|||
debounce,
|
||||
getCurrentPage,
|
||||
getCurrentRoute,
|
||||
pluschooseImage
|
||||
pluschooseImage,
|
||||
getUserInfo
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ async function request(options) {
|
|||
}
|
||||
try {
|
||||
if (options.toast) {
|
||||
// #ifdef MP-WEIXIN || APP-PLUS
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || APP-PLUS
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
|
|
@ -85,6 +85,10 @@ async function request(options) {
|
|||
// #ifdef MP-WEIXIN
|
||||
environment: 'wx',
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
environment: 'wx',
|
||||
// environment: 'alipay',
|
||||
// #endif
|
||||
token: uni.cache.get('token'),
|
||||
openId: uni.cache.get('miniAppOpenId'),
|
||||
id: uni.cache.get('userInfo').id,
|
||||
|
|
@ -94,7 +98,7 @@ async function request(options) {
|
|||
} else {
|
||||
|
||||
}
|
||||
// #ifdef MP-WEIXIN || APP-PLUS
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || APP-PLUS
|
||||
options.url = uni.conf.baseUrl + options.url
|
||||
let res = await requestrequest(options);
|
||||
// #endif
|
||||
|
|
@ -102,7 +106,6 @@ async function request(options) {
|
|||
let res = await uni.pro.request(options);
|
||||
// #endif
|
||||
if (res.code != 0) {
|
||||
console.log(options)
|
||||
if (res.code == -4) {
|
||||
// uni.showToast({
|
||||
// title: res.message || res.msg,
|
||||
|
|
@ -113,6 +116,7 @@ async function request(options) {
|
|||
// // }, 1000)
|
||||
// }
|
||||
// })
|
||||
|
||||
uni.$u.throttle(store.dispatch("loginEvent"), 1000); //获取shapid
|
||||
|
||||
} else if (res.code == 482) {
|
||||
|
|
@ -128,9 +132,7 @@ async function request(options) {
|
|||
success: () => {
|
||||
setTimeout(res => {
|
||||
if (options.toast) {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||
uni.pro.hideLoading()
|
||||
// #endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,12 @@ uni.pro.uploadFile = (obj) => {
|
|||
|
||||
uni.pro.navigateTo = (pageName, extras = {}) => {
|
||||
let url = uni.url.getUrl(pageName, extras)
|
||||
return uni.navigateTo({
|
||||
url
|
||||
})
|
||||
console.log(url)
|
||||
return uni.navigateTo({
|
||||
url
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
uni.pro.redirectTo = (pageName, extras = {}) => {
|
||||
let url = uni.url.getUrl(pageName, extras)
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@ function get(key) {
|
|||
if (!res) {
|
||||
return ''
|
||||
}
|
||||
|
||||
// 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)
|
||||
return ''
|
||||
} else {
|
||||
return res
|
||||
return res.data
|
||||
}
|
||||
} catch (e) {
|
||||
return ''
|
||||
|
|
@ -56,15 +56,13 @@ function getStorageData(key) {
|
|||
* @param {Number} expire 指定秒数后过期
|
||||
* @return void
|
||||
*/
|
||||
function set(key, value, expire = uni.conf.default_expire) {
|
||||
let cacheItem = {}
|
||||
cacheItem = value
|
||||
// console.log(cacheItem)
|
||||
if (expire > 0) {
|
||||
cacheItem.__expiretime = uni.utils.timestamp() + expire
|
||||
function set(key, value, expire = 0) {
|
||||
let obj = {
|
||||
data: value, //存储的数据
|
||||
time: Date.now() / 1000, //记录存储的时间戳
|
||||
expire: expire //记录过期时间,单位秒
|
||||
}
|
||||
// uni.setStorageSync(key,JSON.stringify(cacheItem))
|
||||
uni.setStorageSync(key,cacheItem)
|
||||
uni.setStorageSync(key, obj)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -96,7 +96,14 @@
|
|||
}
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
"usingComponents" : true,
|
||||
"appid" : "2021004145625815",
|
||||
"devServer" : {
|
||||
"autoOpen" : true // 设置为true自动打开支付宝小程序
|
||||
},
|
||||
"unipush" : {
|
||||
"enable" : false
|
||||
}
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"format": 2
|
||||
}
|
||||
125
pages.json
125
pages.json
|
|
@ -4,28 +4,64 @@
|
|||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
// #ifdef MP-ALIPAY
|
||||
"navigationBarTitleText": "",
|
||||
// #endif
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
},
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/jtoday",
|
||||
"style": {
|
||||
"navigationBarTitleText": "每日上新",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "",
|
||||
"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",
|
||||
"style": {
|
||||
"navigationBarTitleText": "每日免单",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/tothestore",
|
||||
"style": {
|
||||
"navigationBarTitleText": "预约到店",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -34,18 +70,17 @@
|
|||
"navigationBarTitleText": "红包中心"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/drinks",
|
||||
"style": {
|
||||
"navigationBarTitleText": "咖啡饮品",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/index/hotlist",
|
||||
"style": {
|
||||
"navigationBarTitleText": "热榜推荐",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -57,8 +92,13 @@
|
|||
{
|
||||
"path": "pages/product/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品详情",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -84,8 +124,7 @@
|
|||
{
|
||||
"path": "pages/order/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单列表",
|
||||
"navigationBarBackgroundColor": "#FFD158"
|
||||
"navigationBarTitleText": "订单列表"
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -95,12 +134,7 @@
|
|||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order_detail/indexs",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/order/successful",
|
||||
"style": {
|
||||
|
|
@ -144,9 +178,14 @@
|
|||
{
|
||||
"path": "pages/user/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#FFD158",
|
||||
"navigationStyle": "custom"
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"path": "pages/user/repairpassword",
|
||||
|
|
@ -162,24 +201,30 @@
|
|||
"navigationBarTitleText": "会员支付码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order_detail/order_detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order_food/order_food",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarTextStyle": "black",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order_food/order_food_search",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarTextStyle": "black",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
},
|
||||
methods: {
|
||||
clickdistrict(item) {
|
||||
console.log(item,'调试')
|
||||
// console.log(item,'调试')
|
||||
switch (item.jumpType) {
|
||||
case 'absolute':
|
||||
uni.pro.navigateTo('webview/webview', {
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
if (!uni.utils.pluschooseImage()) {
|
||||
return false
|
||||
}
|
||||
// #ifdef APP || MP-WEIXIN
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
||||
|
|
@ -60,9 +60,13 @@
|
|||
if (tableCode) {
|
||||
uni.pro.navigateTo('order_food/order_food')
|
||||
}
|
||||
},
|
||||
fail:( res) =>{
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<navseat class="navbar" :opacity='opacitys' :title='toplist.name' :titleshow='false'></navseat>
|
||||
|
||||
<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="onecontentabsolute">
|
||||
|
|
|
|||
|
|
@ -1,24 +1,34 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view v-if="showindex">
|
||||
<view v-if="showindex == 'index'">
|
||||
<!-- 导航栏 -->
|
||||
<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="navbar_tow flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="navbar_tow flex-between" :style="{'marginTop':HeighT.heightBar /2+'px'}">
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #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="navbar_tow_one flex-start" @click="uindexlist">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<text class="textnth-childone">{{NAME}}</text>
|
||||
<!-- #endif -->
|
||||
<text class="textnth-childtow">{{form.address}}</text>
|
||||
<u-icon style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
||||
size="16"></u-icon>
|
||||
|
|
@ -226,7 +236,7 @@
|
|||
|
||||
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -239,7 +249,6 @@
|
|||
import todaylist from './components/todaylist.vue'
|
||||
import productlist from './components/productlist.vue'
|
||||
import advertisement from './components/advertisement.vue'
|
||||
import customSwiper from '@/components/blackmonth-swiper/index'
|
||||
import category from '@/components/qiyue-category/qiyue-category.vue';
|
||||
import indexs from './indexs.vue';
|
||||
export default {
|
||||
|
|
@ -250,14 +259,13 @@
|
|||
productlist,
|
||||
advertisement,
|
||||
category,
|
||||
customSwiper,
|
||||
indexs,
|
||||
popupad
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showindex: false,
|
||||
userInfo:'',//个人信息
|
||||
showindex: "",
|
||||
userInfo: {},//个人信息
|
||||
NAME: uni.cache.get('NAME'),
|
||||
timersetInterval: '0', //定时器
|
||||
isFixedTop: false, //吸顶是否显示
|
||||
|
|
@ -270,7 +278,8 @@
|
|||
hometoplist: { //上面数据
|
||||
carousel: [],
|
||||
district: [],
|
||||
|
||||
salesList: {},
|
||||
todayList: {},
|
||||
},
|
||||
itemStyle: [ //样式
|
||||
],
|
||||
|
|
@ -323,6 +332,9 @@
|
|||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
menuButtonInfo() { //手机类型的尺寸
|
||||
return uni.getMenuButtonBoundingClientRect()
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
|
|
@ -338,11 +350,21 @@
|
|||
},
|
||||
async onShow() {
|
||||
// 判断显示那个页面
|
||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
||||
this.showindex = false
|
||||
// #ifdef MP-ALIPAY
|
||||
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');
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
|
|
@ -359,10 +381,12 @@
|
|||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: async (res) => {
|
||||
// console.log(res)
|
||||
let successres = await this.api.geocodelocation({
|
||||
lng: res.longitude,
|
||||
lat: res.latitude,
|
||||
})
|
||||
// console.log("successres==",successres)
|
||||
if (successres.code == 0) {
|
||||
let datastorage = {
|
||||
country: successres.data.addressComponent.country, // "中国"
|
||||
|
|
@ -385,7 +409,6 @@
|
|||
lat: '',
|
||||
})
|
||||
if (successres.code == 0) {
|
||||
console.log(successres.data.addressComponent.streetNumber.location.split(','))
|
||||
let res = successres.data.addressComponent.streetNumber.location.split(',')
|
||||
let datastorage = {
|
||||
country: successres.data.addressComponent.country, // "中国"
|
||||
|
|
@ -402,7 +425,7 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
this.showindex = true
|
||||
this.showindex = 'index'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -412,7 +435,7 @@
|
|||
*/
|
||||
async 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
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
|
|
@ -455,7 +478,6 @@
|
|||
success: (data) => {
|
||||
this.seighT = data.windowHeight;
|
||||
this.$u.getRect('.fourcontent').then(res => {
|
||||
console.log(res.top)
|
||||
this.Topdistance = res.top - res.height //滚动距离
|
||||
})
|
||||
}
|
||||
|
|
@ -594,7 +616,6 @@
|
|||
},
|
||||
// 选择元素的指定选项
|
||||
clickdetail(item, index) {
|
||||
console.log(category);
|
||||
this.clickdetailindex = index
|
||||
this.showproductlist = false
|
||||
this.hometoplist.menu[this.viewHistoryindex].name = item.name
|
||||
|
|
@ -616,7 +637,6 @@
|
|||
},
|
||||
//城市二级菜单
|
||||
categoryMainClick(category) {
|
||||
console.log(category.category.name);
|
||||
if (category.category.name == '全城') {
|
||||
this.showproductlist = false
|
||||
this.form.lng = uni.cache.get('getLocationstorage').lng,
|
||||
|
|
@ -635,11 +655,9 @@
|
|||
},
|
||||
//确定街道菜单赋值
|
||||
categorySubClick(category) {
|
||||
console.log(category);
|
||||
this.hometoplist.menu[this.viewHistoryindex].name = category.name
|
||||
this.form.address = category.name //地址
|
||||
this.showproductlist = false
|
||||
console.log(category.center.split(','))
|
||||
let res = category.center.split(',')
|
||||
this.form.lng = res[0]
|
||||
this.form.lat = res[1]
|
||||
|
|
@ -702,6 +720,9 @@
|
|||
// #ifdef MP-WEIXIN
|
||||
margin-left: 28rpx;
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
margin-left: 50rpx;
|
||||
// #endif
|
||||
width: 100%;
|
||||
flex-wrap: nowrap;
|
||||
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: {
|
||||
scanCodehandle(i) {
|
||||
console.log(1)
|
||||
setTimeout(()=>{
|
||||
uni.cache.set('forceUpdate',2)
|
||||
},200)
|
||||
|
|
@ -72,7 +71,7 @@
|
|||
uni.cache.set('tableCode', tableCode)
|
||||
if (tableCode) {
|
||||
uni.pro.navigateTo('order_food/order_food', {
|
||||
// shopId_id: uni.cache.get('shopUser'),
|
||||
// shopId_id: uni.cache.get('shopId'),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +81,7 @@
|
|||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('member/memberdetails', {
|
||||
shopId_id: uni.cache.get('shopUser'),
|
||||
shopId_id: uni.cache.get('shopId'),
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
@ -90,14 +89,14 @@
|
|||
console.log(2)
|
||||
if (i == 0) {
|
||||
uni.pro.navigateTo('member/index', {
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index',
|
||||
})
|
||||
} else {
|
||||
let data = {
|
||||
shopName: this.usershopUserinfo.shopName,
|
||||
amount: this.usershopUserinfo.amount,
|
||||
shopId: uni.cache.get('shopUser')
|
||||
shopId: uni.cache.get('shopId')
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(data)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='opacity' :title='toplist.name' :titleshow='false'></navseat>
|
||||
<view class="onecontent">
|
||||
<image class="onecontentimage" :src="toplist.coverImg" mode=""></image>
|
||||
<image class="onecontentimage" :src="toplist.coverImg" mode="aspectFill"></image>
|
||||
<view class="onecontentabsolute">
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -74,7 +74,6 @@
|
|||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.onLoadhome()
|
||||
},
|
||||
onShow() {
|
||||
this.init_fn()
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
})
|
||||
if (resdata.code == 0) {
|
||||
this.switchdata = false
|
||||
uni.cache.set('userInfo', resdata .data);
|
||||
uni.cache.set('userInfo', resdata.data);
|
||||
uni.pro.redirectTo('/pages/member/index', {
|
||||
shopId: this.shopId,
|
||||
type: 'index'
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</view>
|
||||
<view class="rechargeList">
|
||||
<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="flex-colum-start">
|
||||
<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>
|
||||
|
||||
</viwe>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -486,14 +486,15 @@
|
|||
padding-right: 20rpx;
|
||||
padding-left: 0;
|
||||
.rechargeList_item{
|
||||
height: 130rpx;
|
||||
border-radius: 0rpx 48rpx 0rpx 0rpx;
|
||||
border: 4rpx solid #E5E5E5;
|
||||
align-items: initial;
|
||||
padding: 26rpx 22rpx;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
|
||||
.rechargeList_item_title{
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.rechargeList_item_title,.rechargeList_item_handsel{
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
|
|
@ -549,6 +550,7 @@
|
|||
background: linear-gradient( 133deg, #F9F6ED 0%, #FFFFFF 100%);
|
||||
.rechargeList_item_title{
|
||||
color: #F7664E;
|
||||
margin-bottom: 47rpx;
|
||||
}
|
||||
.rechargeList_item_amount{
|
||||
font-weight: bold;
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
<view class="list-cell">
|
||||
<view class="list-cell-item" v-for="(item1,index1) in item.list" :key="index1">
|
||||
<view class="list-cell-item-title"> {{ item1.title }}</view>
|
||||
<viwe class="list-cell-item-content">
|
||||
<viwe class="list-cell-item-content-text" v-for="(item2,index2) in item1.list" :key="index2">{{item2}}</viwe>
|
||||
</viwe>
|
||||
<view class="list-cell-item-content">
|
||||
<view class="list-cell-item-content-text" v-for="(item2,index2) in item1.list" :key="index2">{{item2}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -19,9 +19,8 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length== 0 && is_end == true" class="flex-colum">
|
||||
<image :src="bgnothave" mode="aspectFill">
|
||||
</image>
|
||||
<view v-if="list.length <= 0" class="flex-colum">
|
||||
<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>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="navtab flex-center">
|
||||
<!-- <view class="navtab flex-center">
|
||||
<view class="navtabpost flex-center">
|
||||
<view :class="navtabindex == 0 ? 'navtabone':'navtabtow'" @click="navtabclick(0)">
|
||||
到店订单
|
||||
|
|
@ -9,46 +9,33 @@
|
|||
团购订单
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-sticky bgColor="#fff">
|
||||
</view> -->
|
||||
<u-sticky >
|
||||
<view class="tab-wrap">
|
||||
<block v-if="navtabindex==1">
|
||||
<view class="item" v-for="(item, index) in tabs2" :key="index" @click="orderswitch(item,index)">
|
||||
<text>{{ item.name }}</text>
|
||||
</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 class="item" :class="{'active':active == index}" v-for="(item, index) in tabs" :key="index" @click="orderswitch(item,index)">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</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="header-wrap">
|
||||
<text v-if="item.sendType == 'post'">快递</text>
|
||||
<text v-if="item.sendType == 'takeaway'">外卖</text>
|
||||
<text v-if="item.sendType == 'takeself'">自提</text>
|
||||
<text v-if="item.sendType == 'table'">堂食</text>
|
||||
<view class="header-wrap-left">
|
||||
<text class="sendType" v-if="item.sendType == 'post'">快递</text>
|
||||
<text class="sendType" v-if="item.sendType == 'takeaway'">外卖</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>待支付</text>
|
||||
<text style="color: #333;">待付款</text>
|
||||
</text>
|
||||
<text class="status" v-if="item.status == 'unsend'">
|
||||
<text>待发货</text>
|
||||
</text>
|
||||
<text class="status" v-if="item.status == 'closed'">
|
||||
<text>订单完成</text>
|
||||
<text>已完成</text>
|
||||
</text>
|
||||
<text class="status" v-if="item.status == 'send'">
|
||||
<text> 已发</text>
|
||||
|
|
@ -67,32 +54,27 @@
|
|||
</text>
|
||||
</view>
|
||||
<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-item">
|
||||
<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> -->
|
||||
<c-image width="200" height="200" radius="20" :src="item1.productImg"></c-image>
|
||||
<view class="cover" v-for="(item1,index1) in item.detailList" :key="index1">
|
||||
<u-image width="112" height="112" radius="20" :src="item1.productImg"></u-image>
|
||||
<text class="productName"> {{ item1.productName }} </text>
|
||||
</view>
|
||||
<!-- <view class="info">
|
||||
<text class="name">美味大宅蟹</text>
|
||||
<text class="num">数量:1</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="shop-amount">
|
||||
<text class="orderAmount">¥{{item.orderAmount}}</text>
|
||||
<text class="totalNumber">共{{item.totalNumber}}件</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total" v-if="item.status != 'cancelled'">
|
||||
<text class="t">{{item.description}}</text>
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{item.orderAmount}}</text>
|
||||
</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 class="footer-wrap">
|
||||
<view class="btn">
|
||||
<text>查看详情</text>
|
||||
</view>
|
||||
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)" v-if="item.status != 'unpaid' && item.status != 'paying'"> 删除订单 </view>
|
||||
<view class="btn s" @click.stop="$u.debounce(showpopupclick(item),1000)" v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -120,8 +102,9 @@
|
|||
<button v-if="item.status=='unpaid'" type="primary" class="buttonStyle">去付款</button>
|
||||
</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-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" />
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -155,7 +138,7 @@
|
|||
status: 'closed'
|
||||
},
|
||||
{
|
||||
name: '退款',
|
||||
name: '退款/售后',
|
||||
type: 5,
|
||||
status: 'refund'
|
||||
},
|
||||
|
|
@ -196,6 +179,9 @@
|
|||
size: 10,
|
||||
status: 'loadmore',
|
||||
},
|
||||
removeOrderShow: false,
|
||||
orderItem: null,
|
||||
orderIndex: 0,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
|
|
@ -295,24 +281,103 @@
|
|||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
console.log(111)
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
console.log(222)
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
this.form.page = ++this.form.page;
|
||||
if (this.form.page > res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
if (this.form.page == 1) {
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
this.form.page = ++this.form.page;
|
||||
if (this.form.page > res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
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() {
|
||||
let res = await this.api.groupOrderInfo({
|
||||
page: this.form.page,
|
||||
|
|
@ -339,17 +404,17 @@
|
|||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
$tabH: 80upx;
|
||||
$color: #ff411d;
|
||||
|
||||
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
// background: #f6f6f6;
|
||||
}
|
||||
|
||||
.navtab {
|
||||
|
|
@ -393,51 +458,43 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tab-wrap {
|
||||
display: flex;
|
||||
position: relative;
|
||||
background: #ffd158;
|
||||
padding: 48rpx 0 72rpx 0;
|
||||
|
||||
background: #fff;
|
||||
padding: 40rpx 46rpx;
|
||||
border-radius: 0rpx 0rpx 34rpx 34rpx;
|
||||
.item {
|
||||
flex: 1;
|
||||
flex: auto;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
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 {
|
||||
padding: $paddingSize;
|
||||
padding: 0 28rpx 48rpx 28rpx;
|
||||
position: relative;
|
||||
margin-top: -24rpx;
|
||||
z-index: 99999;
|
||||
background: #f6f6f6;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
||||
|
||||
.item {
|
||||
|
|
@ -445,98 +502,122 @@
|
|||
background-color: #fff;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: $paddingSize;
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
|
||||
.header-wrap {
|
||||
padding: $paddingSize;
|
||||
border-bottom: 1upx solid #ececec;
|
||||
padding: 16rpx 18rpx;
|
||||
display: flex;
|
||||
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 {
|
||||
color: $color;
|
||||
text{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: $paddingSize;
|
||||
padding: 0 18rpx 18rpx 18rpx;
|
||||
|
||||
.shop-info {
|
||||
display: flex;
|
||||
.shop-item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
overflow-x: scroll;
|
||||
|
||||
.cover:nth-child(1) {
|
||||
margin-left: 0rpx;
|
||||
}
|
||||
|
||||
.cover {
|
||||
|
||||
// white-space: nowrap;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
padding-left: 20upx;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
.productName{
|
||||
flex-shrink: 0;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.total {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
|
||||
.t {
|
||||
font-weight: bold;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.i {
|
||||
font-size: 24upx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 38upx;
|
||||
position: relative;
|
||||
top: 8upx;
|
||||
.shop-amount{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
flex-shrink: 0;
|
||||
padding-left: 20rpx;
|
||||
.orderAmount{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 22rpx;
|
||||
}
|
||||
.totalNumber{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.intro-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: $paddingSize;
|
||||
|
||||
.time {
|
||||
color: #999;
|
||||
font-size: 24upx;
|
||||
}
|
||||
|
||||
.intro {
|
||||
font-size: 24upx;
|
||||
}
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
font-size: 24upx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-wrap {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
border-top: 1upx solid #ececec;
|
||||
padding: $paddingSize;
|
||||
|
||||
padding: 0 18rpx 32rpx 18rpx;
|
||||
|
||||
.btn {
|
||||
padding: 8upx 24upx;
|
||||
border-radius: 100upx;
|
||||
border: 1px solid #333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 128rpx;
|
||||
height: 48rpx;
|
||||
line-height: 43rpx;
|
||||
text-align: 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,119 +1,124 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<view class="head">
|
||||
<text class="title">
|
||||
<text>{{listinfo.name}}</text>
|
||||
</text>
|
||||
<text class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||
<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 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="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 v-if="listinfo.tableName">
|
||||
桌号:{{listinfo.tableName}}
|
||||
</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;"
|
||||
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||
<!-- <text style="font-size:24rpx;">支付时间:</text> -->
|
||||
<uni-countdown :show-day="false" color="#ff0000" border-color="#00B26A" splitorColor="#000"
|
||||
:font-size="14" :hour="0" :minute="listinfo.expiredMinutes" :second="listinfo.expiredSeconds" />
|
||||
<view class="card">
|
||||
<!-- 订单头部 -->
|
||||
<view class="head">
|
||||
<view class="head_left">
|
||||
<text class="shopName">{{listinfo.name}}</text>
|
||||
<text class="tableName" v-if="listinfo.tableName">「桌号:{{listinfo.tableName}}」</text>
|
||||
</view>
|
||||
<text class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||
<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>
|
||||
<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 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">
|
||||
<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>
|
||||
<text class="title">订单详情</text>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;align-items: center;"
|
||||
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"
|
||||
>
|
||||
<!-- <text style="font-size:24rpx;">支付时间:</text> -->
|
||||
<uni-countdown :show-day="false" color="#E3AD7F" border-color="#E3AD7F" splitorColor="#E3AD7F"
|
||||
:font-size="16" :hour="0" :minute="listinfo.expiredMinutes" :second="listinfo.expiredSeconds" />
|
||||
</view>
|
||||
</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 class="shop-info">
|
||||
<view class="item" v-for="(item,index) in listinfo.details" :key="index">
|
||||
<view class="cover">
|
||||
<u-image width="152" height="152" radius="16" :src='item.productImg'></u-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="productName">{{item.productName}}</text>
|
||||
<text class="productSkuName" v-if="item.productSkuName">{{item.productSkuName}}</text>
|
||||
</view>
|
||||
|
||||
<view class="price">
|
||||
<view class="priceAmount">¥{{item.priceAmount}}</view>
|
||||
<view class="num">x{{item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{item.priceAmount}}</text>
|
||||
|
||||
<view class="total-wrap">
|
||||
<view>合计:</view>
|
||||
<view class="price"> ¥{{listinfo.payAmount}} </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 class="title">订单信息</view>
|
||||
<view class="order-info">
|
||||
<view class="row" @click="copyHandle(listinfo.orderNo)">
|
||||
<text class="t">订单信息:</text>
|
||||
<text class="info">{{listinfo.orderNo}}(点击复制)</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="t">创建时间:</text>
|
||||
<text class="info">{{$u.timeFormat(listinfo.time, 'yyyy-mm-dd hh:MM:ss')}}</text>
|
||||
</view>
|
||||
</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">
|
||||
<view class="head border">
|
||||
<text class="title">订单信息</text>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<view class="row" @click="copyHandle(listinfo.orderNo)">
|
||||
<text class="t">订单信息:</text>
|
||||
<text class="info">{{listinfo.orderNo}}(点击复制)</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="t">创建时间:</text>
|
||||
<text class="info">{{$u.timeFormat(listinfo.time, 'yyyy-mm-dd hh:MM:ss')}}</text>
|
||||
</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 :style="{height:height}">
|
||||
|
||||
</view>
|
||||
<view class="fixedview">
|
||||
<view class="flex-between" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||
<view class="fixedview_one flex-start">
|
||||
<view class="fixedview_oneone">
|
||||
实付金额:
|
||||
</view>
|
||||
<view class="fixedview_oneone"> 实付金额: </view>
|
||||
<view class="fixedview_onetow">
|
||||
<text>¥</text>{{listinfo.payAmount}}
|
||||
</view>
|
||||
|
|
@ -131,7 +136,6 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
height: '',
|
||||
pay_type: 1,
|
||||
orderId: '',
|
||||
listinfo: {},
|
||||
|
|
@ -151,35 +155,30 @@
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
mountedcreateSelectorQuery() {
|
||||
//#ifdef MP-WEIXIN || H5
|
||||
var query = uni.createSelectorQuery().in(this).select('.fixedview')
|
||||
query.boundingClientRect(ele => {
|
||||
var that = this;
|
||||
console.log(ele, 111)
|
||||
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;
|
||||
/**
|
||||
* 获取订单信息
|
||||
*/
|
||||
async orderorderInfo() {
|
||||
let res = await this.api.orderorderInfo({
|
||||
orderId: this.orderId
|
||||
})
|
||||
//#endif
|
||||
if (res.code == 0) {
|
||||
this.listinfo = res.data;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 支付完成后请求
|
||||
*/
|
||||
async paymodfiyOrderInfo() {
|
||||
let res = await this.api.paymodfiyOrderInfo({
|
||||
orderId: this.listinfo.orderId,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 立即付款
|
||||
*/
|
||||
async showpopupclick() {
|
||||
let res = await this.api.payorderPay({
|
||||
orderId: this.orderId,
|
||||
|
|
@ -227,15 +226,11 @@
|
|||
// #endif
|
||||
}
|
||||
},
|
||||
async orderorderInfo() {
|
||||
let res = await this.api.orderorderInfo({
|
||||
orderId: this.orderId
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.listinfo = res.data
|
||||
this.mountedcreateSelectorQuery()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 复制订单号
|
||||
* @param {Object} e
|
||||
*/
|
||||
copyHandle(e) {
|
||||
uni.setClipboardData({
|
||||
data: e,
|
||||
|
|
@ -247,66 +242,95 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
clickselect(b) {
|
||||
this.pay_type = b
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
padding: 28upx;
|
||||
page{
|
||||
background-color: #F7F7F7;
|
||||
}
|
||||
|
||||
.card {
|
||||
|
||||
.container {
|
||||
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 {
|
||||
// background-color: #fff;
|
||||
border-radius: 20upx;
|
||||
padding: 28upx;
|
||||
margin-bottom: 28upx;
|
||||
|
||||
position: relative;
|
||||
.head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
&.border {
|
||||
padding-bottom: 28upx;
|
||||
border-bottom: 1upx solid #fafafa;
|
||||
padding: 50rpx 34rpx 32rpx 34rpx;
|
||||
border-bottom: 2rpx dashed #E3E3E3;
|
||||
.head_left{
|
||||
.shopName{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.tableName{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.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 {
|
||||
background-color: #fafafa;
|
||||
border-radius: 16upx;
|
||||
padding: 28upx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
margin-top: 32rpx;
|
||||
.t{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.number {
|
||||
font-size: 42upx;
|
||||
font-weight: bold;
|
||||
font-size: 56rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.price {
|
||||
.i {
|
||||
|
|
@ -317,139 +341,217 @@
|
|||
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 {
|
||||
|
||||
.shop-box{
|
||||
padding: 36rpx 34rpx 30rpx 34rpx;
|
||||
border-bottom: 2rpx dashed #E3E3E3;
|
||||
.shop-head{
|
||||
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;
|
||||
|
||||
.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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
.sixcontenttowitemonetext {
|
||||
margin-left: 14rpx;
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.shop-info {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-bottom: 32rpx;
|
||||
display: flex;
|
||||
.cover{
|
||||
|
||||
}
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 16upx;
|
||||
.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 {
|
||||
font-size: 24upx;
|
||||
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 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-weight: 500;
|
||||
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 {
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: 32upx;
|
||||
|
||||
.t {
|
||||
font-weight: normal;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.info {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.fixedview {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
|
||||
|
||||
.flex-between {
|
||||
width: 100%;
|
||||
padding: 48rpx 28rpx;
|
||||
padding: 36rpx 54rpx 102rpx 54rpx;
|
||||
background: #FFFFFF;
|
||||
|
||||
.fixedview_one {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
.fixedview_oneone {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.fixedview_onetow {
|
||||
font-size: 44rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #F45C4C;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fixedview_tow {
|
||||
background: red;
|
||||
border-radius: 34rpx;
|
||||
padding: 10rpx 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
width: 140rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: #E3AD7F;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<view class="shop-item">
|
||||
<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> -->
|
||||
<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 class="info">
|
||||
<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_bg">
|
||||
<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>
|
||||
|
||||
|
|
@ -170,7 +170,7 @@
|
|||
{ name: "团购优惠", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||
],
|
||||
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"},
|
||||
],
|
||||
order: {
|
||||
|
|
@ -191,7 +191,8 @@
|
|||
payPasswordShow: false,
|
||||
amountVIP: null, // 会员信息
|
||||
listinfoid: null,
|
||||
paymentBtnText: "会员卡支付",
|
||||
paymentBtnText: "余额支付",
|
||||
isSocket: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -210,9 +211,13 @@
|
|||
uni.$off('message')
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(JSON.parse(e.cartList))
|
||||
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() {
|
||||
console.log(this.listinfoid)
|
||||
if (this.listinfoid) {
|
||||
uni.$on('message', this.getMessage)
|
||||
this.orderorderInfo()
|
||||
|
|
@ -244,6 +249,7 @@
|
|||
} else {
|
||||
switch (msg.type) {
|
||||
case 'createOrder':
|
||||
this.isSocket = true;
|
||||
this.listinfoid = msg.data.id
|
||||
console.log(msg)
|
||||
this.listinfo.details = msg.data.detailList;
|
||||
|
|
@ -253,7 +259,7 @@
|
|||
break;
|
||||
case 'addCart':
|
||||
console.log("商品列表===",msg)
|
||||
|
||||
this.isSocket = true;
|
||||
if (this.listinfoid) {
|
||||
this.orderorderInfo()
|
||||
} else {
|
||||
|
|
@ -276,6 +282,7 @@
|
|||
this.listinfo.details = msg.data;
|
||||
this.listinfo.payAmount = msg.amount;
|
||||
}
|
||||
this.isSocket = true;
|
||||
break;
|
||||
}
|
||||
this.$set(this, 'cartLists', msg)
|
||||
|
|
@ -298,7 +305,7 @@
|
|||
*/
|
||||
groupChange(n) {
|
||||
this.radiovalue = n;
|
||||
this.paymentBtnText = n==1?'会员卡支付':'微信支付'
|
||||
this.paymentBtnText = n==1?'余额支付':'微信支付'
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -309,7 +316,7 @@
|
|||
this.socketTicket ? this.socketTicket.Close() : null
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
|
|
@ -331,7 +338,7 @@
|
|||
*/
|
||||
async getAount() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
|
|
@ -365,7 +372,7 @@
|
|||
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
|
||||
// console.log(this.amountVIP.isVip, '调试1')
|
||||
uni.pro.navigateTo('/pages/member/index', {
|
||||
shopId: uni.cache.get('shopUser')
|
||||
shopId: uni.cache.get('shopId')
|
||||
})
|
||||
},
|
||||
|
||||
|
|
@ -374,6 +381,13 @@
|
|||
*/
|
||||
orderdetail() {
|
||||
console.log(this.listinfo.details)
|
||||
if (!this.isSocket) {
|
||||
uni.showToast({
|
||||
title: "当前网络异常,请稍后再试",
|
||||
icon: "none",
|
||||
})
|
||||
return;
|
||||
}
|
||||
if ( this.listinfo.details.length == 0) {
|
||||
uni.showToast({
|
||||
title: "购物车为空,请添加商品",
|
||||
|
|
@ -390,7 +404,7 @@
|
|||
"isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
||||
"isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
||||
"productId": '', //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
}
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
||||
<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;">
|
||||
<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> -->
|
||||
<!-- 顶部面板 -->
|
||||
<view class="top--panel">
|
||||
<navseat :opacity='opacity' :inputshow="true" :readonly="true" @searchStatus="searchStatus" :titleshow='true' @navigateBacknav='navigateBacknav'
|
||||
|
|
@ -243,7 +243,7 @@
|
|||
<view class="list-wrap">
|
||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||
<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 class="info">
|
||||
<view class="name"> {{ item.name }} </view>
|
||||
|
|
@ -427,6 +427,7 @@
|
|||
orderdetailFlag: true,
|
||||
forceUpdate: false,
|
||||
shopExtend: null,
|
||||
shopId: null,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
|
@ -468,8 +469,11 @@
|
|||
}
|
||||
},
|
||||
onHide() {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
if (this.socketTicket) {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
}
|
||||
|
||||
this.fixedtrue = true
|
||||
},
|
||||
async onShow() {
|
||||
|
|
@ -489,7 +493,7 @@
|
|||
*/
|
||||
async 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
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
|
|
@ -514,7 +518,7 @@
|
|||
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'),
|
||||
shopId: this.shopId,
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
|
|
@ -573,7 +577,9 @@
|
|||
'',
|
||||
})
|
||||
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.productqueryProduct() //list 数据
|
||||
this.handlemessage() //监听websocket返回
|
||||
|
|
@ -691,7 +697,7 @@
|
|||
"type": a == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.id, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
|
|
@ -715,7 +721,7 @@
|
|||
"type": c == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.productId, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
|
|
@ -743,7 +749,7 @@
|
|||
*/
|
||||
async cartclear() {
|
||||
let res = await this.api.cleanCart({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
})
|
||||
},
|
||||
|
|
@ -964,7 +970,7 @@
|
|||
// console.log(this.skuidname.join(","))
|
||||
let res = await this.api.productqueryProductSku({
|
||||
code: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: this.shopId,
|
||||
productId: item.id, //商品id
|
||||
isVip: item.isVip, //商品id
|
||||
spec_tag: this.skuidname.join(","),
|
||||
|
|
@ -978,7 +984,7 @@
|
|||
"type": c == '+' ? 1 : 0,
|
||||
"productId": item.id, //商品id
|
||||
"isVip": item.isVip,
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
|
|
@ -1018,7 +1024,7 @@
|
|||
return false
|
||||
}
|
||||
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() {
|
||||
let res = await this.api.productqueryProduct({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"productGroupId": ''
|
||||
})
|
||||
if (res.code == 0) {
|
||||
|
|
@ -1203,7 +1209,9 @@
|
|||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
|
||||
::v-deep .u-input input{
|
||||
background-color: transparent;
|
||||
}
|
||||
.navbarcontent .active {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<template>
|
||||
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
||||
<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">
|
||||
<navseat :opacity='true' :inputshow="true" :readonly="false" :focus="true" @searchVal="searchVal" :titleshow='true' @navigateBacknav='navigateBacknav'
|
||||
:navigateBacknavtitle='false'></navseat>
|
||||
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如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 class="scroll-panel" id="scroll-panel">
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
<view class="list-wrap">
|
||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||
<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 class="info">
|
||||
<view class="name"> {{ item.name }} </view>
|
||||
|
|
@ -238,7 +238,6 @@
|
|||
data() {
|
||||
return {
|
||||
pagemetashow: false,
|
||||
fixedtrue: true,
|
||||
userInfo: uni.cache.get('userInfo'), //个人信息
|
||||
opacity: false, //是否显示
|
||||
fillHeight: 0, // 填充高度,用于最后一项低于滚动区域时使用
|
||||
|
|
@ -269,6 +268,7 @@
|
|||
orderdetailFlag: true,
|
||||
|
||||
searchList: [],
|
||||
systemInfo: getApp().globalData.systemInfo,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
|
@ -293,9 +293,9 @@
|
|||
onHide() {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
this.fixedtrue = true
|
||||
},
|
||||
async onShow() {
|
||||
this.shopId = uni.cache.get('shopId');
|
||||
let _this = this;
|
||||
this.orderdetailFlag = true;
|
||||
uni.pageScrollTo({
|
||||
|
|
@ -314,7 +314,7 @@
|
|||
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'),
|
||||
shopId: this.shopId,
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
|
|
@ -333,7 +333,6 @@
|
|||
'',
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('shopUser', res.data.storeInfo.id)
|
||||
this.shopInfo = res.data;
|
||||
this.productqueryProduct() //list 数据
|
||||
this.handlemessage() //监听websocket返回
|
||||
|
|
@ -350,7 +349,7 @@
|
|||
*/
|
||||
async productqueryProduct() {
|
||||
let res = await this.api.productqueryProduct({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"productGroupId": ''
|
||||
})
|
||||
if (res.code == 0) {
|
||||
|
|
@ -468,7 +467,7 @@
|
|||
"type": a == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.id, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
|
|
@ -492,7 +491,7 @@
|
|||
"type": c == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.productId, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
|
|
@ -520,7 +519,7 @@
|
|||
*/
|
||||
async cartclear() {
|
||||
let res = await this.api.cleanCart({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
})
|
||||
},
|
||||
|
|
@ -580,7 +579,6 @@
|
|||
* @param {Object} index1
|
||||
*/
|
||||
async clickspecifications(item1, index1, type) {
|
||||
console.log(item1)
|
||||
if ( item1.isPauseSale != 0 || item1.isSale == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -595,15 +593,12 @@
|
|||
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
||||
this.skuBtnText = `添加到购物车`
|
||||
} else {
|
||||
console.log(3)
|
||||
// 多规格数据处理
|
||||
this.isSpec = false;
|
||||
let obj = await this.api.productquerySpec({
|
||||
productId: item1.id, //商品id
|
||||
})
|
||||
console.log(2)
|
||||
this.querySpecList = obj.data;
|
||||
console.log(1)
|
||||
this.specifications.tagSnap = JSON.parse(item1.productSkuResult.tagSnap).map((item,index) => {
|
||||
let res = {
|
||||
id: item1.id, //商品id
|
||||
|
|
@ -645,9 +640,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
console.log(1)
|
||||
this.skuBtnText = `您还没选择${this.specifications.tagSnap[0].name}哦`
|
||||
console.log(this.specifications)
|
||||
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
||||
}
|
||||
|
||||
|
|
@ -743,15 +736,13 @@
|
|||
*/
|
||||
async hodgepodge(item, a, c, num) { //此接口去获取商品id !!!赋值库存 数量 价格等
|
||||
try {
|
||||
console.log(this.skuidname.join(","))
|
||||
let res = await this.api.productqueryProductSku({
|
||||
code: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: this.shopId,
|
||||
productId: item.id, //商品id
|
||||
isVip: item.isVip, //商品id
|
||||
spec_tag: this.skuidname.join(","),
|
||||
})
|
||||
console.log(res)
|
||||
this.salePrice = res.data.salePrice // 价格
|
||||
let data = null;
|
||||
if (a == 1) { //1添加购物车 2是websocket返回这个商品的价格(应为不同的多规格商品返回不同的价格)
|
||||
|
|
@ -761,7 +752,7 @@
|
|||
"type": c == '+' ? 1 : 0,
|
||||
"productId": item.id, //商品id
|
||||
"isVip": item.isVip,
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
|
|
@ -801,7 +792,7 @@
|
|||
return false
|
||||
}
|
||||
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 回显数据
|
||||
if (msg == 1) { // 网络在连接
|
||||
this.fixedtrue = true
|
||||
return false
|
||||
}
|
||||
this.fixedtrue = false
|
||||
if (msg.type == 'heartbeat') { //后台心跳 处理返回 不然控制台一直报错
|
||||
return false
|
||||
}
|
||||
|
|
@ -885,7 +874,11 @@
|
|||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
|
||||
|
||||
::v-deep .u-input input{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&>view {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png" mode="">
|
||||
</image>
|
||||
<text style="font-size: 28rpx;margin-left: 16rpx;">
|
||||
会员卡支付</text>
|
||||
余额支付</text>
|
||||
</view>
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
|
|
@ -207,7 +207,7 @@
|
|||
let isVip = uni.cache.get('userInfo').isPwd
|
||||
if (isVip == 0) {
|
||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
||||
shopId_id: uni.cache.get('shopUser')
|
||||
shopId_id: uni.cache.get('shopId')
|
||||
})
|
||||
} else {
|
||||
this.ispws = true
|
||||
|
|
|
|||
|
|
@ -17,36 +17,53 @@
|
|||
<view class="containertopbox">
|
||||
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
|
||||
<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"
|
||||
:class="item.status == 0?'':'containertopboxitemleft_ones'">
|
||||
<text style="font-size: 28rpx;">¥</text>
|
||||
<text>{{item.couponsAmount || 0}}</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>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
<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 class="containertopboxitemright">
|
||||
<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 class="containertopboxitemright_tow">
|
||||
<view>通用红包券</view>
|
||||
<view> {{ item.type == 2 ? '会员商品券' : '通用红包券'}}</view>
|
||||
<view
|
||||
@click="navigatorGo(item)"
|
||||
:class="item.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
||||
{{item.status == 0 ? '去使用':'已过期'}}
|
||||
{{item.status == 0 ? '去使用':'已使用'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="containertopboxitemright_there">
|
||||
<!-- <view class="containertopboxitemright_there">
|
||||
有效期至:{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
|
||||
</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' />
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -66,82 +83,59 @@
|
|||
type: '0'
|
||||
},
|
||||
{
|
||||
name: '已过期',
|
||||
name: '已使用',
|
||||
type: '1'
|
||||
}
|
||||
],
|
||||
towcontentclickindex: 0,
|
||||
list: [],
|
||||
is_end:false,
|
||||
form: {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
statuses: ''
|
||||
},
|
||||
status: "",
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.ordermineCouponsthis()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.ordermineCouponsthis()
|
||||
},
|
||||
|
||||
methods: {
|
||||
init_fn(e) {
|
||||
this.list = []
|
||||
this.form = {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
statuses: ''
|
||||
}
|
||||
try {
|
||||
if (e) {
|
||||
this.form.statuses = e
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换类型
|
||||
* @param {Object} index
|
||||
* @param {Object} item
|
||||
*/
|
||||
towcontentclick(index, item) {
|
||||
this.towcontentclickindex = index;
|
||||
this.status = item.type;
|
||||
this.ordermineCouponsthis()
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取优惠券数据
|
||||
*/
|
||||
async ordermineCouponsthis() {
|
||||
try {
|
||||
let res = await this.api.ordermineCoupons({
|
||||
let res = await this.api.getUserConpons({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
status: this.form.statuses,
|
||||
page: this.form.page,
|
||||
size: this.form.size,
|
||||
orderId:""
|
||||
shopId: uni.cache.get('shopId'),
|
||||
status: this.status
|
||||
})
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
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)
|
||||
if (res.code == 0) {
|
||||
this.list = res.data;
|
||||
}
|
||||
} catch (e) {
|
||||
//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>
|
||||
|
|
@ -210,44 +204,33 @@
|
|||
margin-bottom: 32rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
border-radius: 18rpx;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
.containertopboxitemleft {
|
||||
position: relative;
|
||||
width: 182rpx;
|
||||
height: 192rpx;
|
||||
background: #E3AD7F;
|
||||
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 {
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
|
|
@ -269,12 +252,44 @@
|
|||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.containertopboxitemleft_nameVip{
|
||||
color: #967152;
|
||||
}
|
||||
|
||||
.containertopboxitemleft_tows {
|
||||
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 {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
|
@ -285,26 +300,39 @@
|
|||
flex: auto;
|
||||
height: 192rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
border-radius: 0rpx 18rpx 18rpx 0rpx;
|
||||
|
||||
.containertopboxitemright_one {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
padding: 16rpx 0 16rpx 0;
|
||||
border-bottom: 1rpx dotted #707070;
|
||||
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-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.title{
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.containertopboxitemright_tow {
|
||||
margin-top: 18rpx;
|
||||
margin-top: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.containertopboxitemright_there {
|
||||
|
|
@ -318,13 +346,13 @@
|
|||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.containertopboxitemright_four {
|
||||
color: #FFFFFF;
|
||||
background: #333;
|
||||
background: #967152;
|
||||
}
|
||||
|
||||
.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_left">头像</view>
|
||||
<view class="list_item_right flex-center">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<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>
|
||||
</button>
|
||||
<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_right flex-center">
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -51,7 +56,7 @@
|
|||
<!-- <picker :show="calendarShow" mode="date"></picker> -->
|
||||
<u-datetime-picker
|
||||
mode="date"
|
||||
itemHeight="66"
|
||||
itemHeight="90"
|
||||
visibleItemCount="5"
|
||||
@cancel="calendarShow = false"
|
||||
:show="calendarShow"
|
||||
|
|
@ -171,10 +176,30 @@
|
|||
* 获取手机号
|
||||
* @param {Object} d
|
||||
*/
|
||||
async getPhone(d) {
|
||||
getPhone(d) {
|
||||
console.log(d)
|
||||
if (d.detail.iv) {
|
||||
// #ifdef MP-WEIXIN
|
||||
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.substr(0, 3) + "****" + res.data.substr(7)
|
||||
this.mobile = res.data;
|
||||
}
|
||||
});
|
||||
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序环境
|
||||
my.getAuthCode({
|
||||
scopes: 'auth_user',
|
||||
success: async (data) => {
|
||||
console.log(data)
|
||||
let res = await this.api.userwxlogins({
|
||||
|
|
@ -185,7 +210,10 @@
|
|||
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
||||
this.mobile = res.data;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// #endif
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -217,6 +245,7 @@
|
|||
* @param {Object} e
|
||||
*/
|
||||
uploadImg(e) {
|
||||
console.log(e)
|
||||
const { avatarUrl } = e.detail
|
||||
// this.userHeadImg = avatarUrl
|
||||
uni.uploadFile({
|
||||
|
|
@ -233,11 +262,15 @@
|
|||
file: avatarUrl,
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
console.log(uploadFileRes)
|
||||
let {
|
||||
data
|
||||
} = JSON.parse(uploadFileRes.data)
|
||||
this.userHeadImg = data
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -270,6 +303,10 @@
|
|||
background: #fff;
|
||||
}
|
||||
.container{
|
||||
|
||||
::v-deep .u-input input{
|
||||
background-color: transparent;
|
||||
}
|
||||
.info_list{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@
|
|||
<script>
|
||||
import _ from 'lodash';
|
||||
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
||||
import webSocketUtils from '@/common/js/websocket.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@
|
|||
<script>
|
||||
import _ from 'lodash';
|
||||
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
||||
import webSocketUtils from '@/common/js/websocket.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
onShow() {
|
||||
this.init_fn()
|
||||
this.loginwxuserInfo()
|
||||
if (uni.cache.get('shopUser') ) {
|
||||
if (uni.cache.get('shopId') ) {
|
||||
this.getShopInfo();
|
||||
this.getShopExtend();
|
||||
} else{
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
*/
|
||||
async 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
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
|
|
@ -120,11 +120,13 @@
|
|||
*/
|
||||
async loginwxuserInfo() {
|
||||
let res = await this.api.loginwxuserInfo({
|
||||
// userId: 109
|
||||
userId: uni.cache.get('userInfo').id
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('userInfo', res.data);
|
||||
this.userInfo = uni.cache.get('userInfo')
|
||||
this.userInfo = res.data;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -157,7 +159,7 @@
|
|||
*/
|
||||
async getShopInfo() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
|
|
@ -173,10 +175,10 @@
|
|||
* 查看二维码
|
||||
*/
|
||||
clickEvent() {
|
||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
if ( this.shopInfo.isVip == 0 ) {
|
||||
uni.pro.navigateTo('member/memberdetails', {
|
||||
shopId_id: uni.cache.get('shopUser')
|
||||
shopId_id: uni.cache.get('shopId')
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
|
|
@ -194,8 +196,8 @@
|
|||
|
||||
clickTo(item, index) {
|
||||
let shopId = null;
|
||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
||||
shopId = uni.cache.get('shopUser');
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
shopId = uni.cache.get('shopId');
|
||||
} else{
|
||||
|
||||
}
|
||||
|
|
@ -209,9 +211,9 @@
|
|||
uni.pro.navigateTo('member/list')
|
||||
break
|
||||
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', {
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index',
|
||||
})
|
||||
} else{
|
||||
|
|
|
|||
|
|
@ -61,35 +61,19 @@ const store = new Vuex.Store({
|
|||
},
|
||||
},
|
||||
actions: {
|
||||
loginEvent: () => {
|
||||
uni.login({
|
||||
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('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) => {}
|
||||
});
|
||||
}
|
||||
});
|
||||
loginEvent: async () => {
|
||||
let res = await uni.utils.getUserInfo();
|
||||
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()
|
||||
|
||||
|
||||
},
|
||||
set_shopid: async ({
|
||||
|
|
@ -134,12 +118,15 @@ const store = new Vuex.Store({
|
|||
bottomPadding = (e.screenHeight - e.safeArea.bottom)
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
||||
statusBar = e.statusBarHeight
|
||||
customBar = e.statusBarHeight + e.titleBarHeight
|
||||
customBar = e.titleBarHeight
|
||||
custwidth = menuButtonInfo.width + 50,
|
||||
bottomPadding = (e.screenHeight - e.safeArea.bottom)
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
console.log('app-plus', e)
|
||||
|
||||
statusBar = e.statusBarHeight
|
||||
heightBar = e.statusBarHeight
|
||||
customBar = e.statusBarHeight
|
||||
|
|
|
|||
|
|
@ -156,10 +156,10 @@
|
|||
type: {
|
||||
type: String,
|
||||
default: () => {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
return '2d';
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||
return 'normal';
|
||||
// #endif
|
||||
}
|
||||
|
|
@ -294,6 +294,7 @@
|
|||
},
|
||||
value: {
|
||||
handler() {
|
||||
console.log(this.auto)
|
||||
if (this.auto) {
|
||||
this.remake();
|
||||
}
|
||||
|
|
@ -331,7 +332,7 @@
|
|||
this.templateOptions.canvasWidth = this.templateOptions.size;
|
||||
this.templateOptions.canvasHeight = this.templateOptions.size;
|
||||
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.canvasHeight})`;
|
||||
// #endif
|
||||
|
|
@ -462,7 +463,7 @@
|
|||
let canvasContext = null;
|
||||
// #ifndef APP-NVUE
|
||||
if (this.canvasType === '2d') {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
/* 微信小程序获取canvas2d上下文方式 */
|
||||
const canvas = (this.canvas = await new Promise(resolve => {
|
||||
uni
|
||||
|
|
@ -502,7 +503,7 @@
|
|||
});
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||
/* 非微信小程序不支持2d,切换回uniapp获取canvas上下文方式 */
|
||||
canvasContext = this.canvasContext = uni.createCanvasContext(this.canvasId, this);
|
||||
/* 使用dynamicSize,可以解决小块间出现白线问题,再通过scale缩放至size,使其达到所设尺寸 */
|
||||
|
|
@ -752,7 +753,7 @@
|
|||
|
||||
// #ifndef APP-NVUE
|
||||
if (this.canvasType === '2d') {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
try {
|
||||
let dataURL = null;
|
||||
// #ifdef VUE3
|
||||
|
|
@ -831,7 +832,7 @@
|
|||
success: res => {
|
||||
// #ifndef H5
|
||||
if (this.canvasType === '2d') {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
/* 需要将 data:image/png;base64, 这段去除 writeFile 才能正常打开文件,否则是损坏文件,无法打开 */
|
||||
const reg = new RegExp('^data:image/png;base64,', 'g');
|
||||
const dataURL = res.tempFilePath.replace(reg, '');
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
:key="index"
|
||||
class="u-picker__view__column"
|
||||
>
|
||||
<text
|
||||
<view
|
||||
v-if="$u.test.array(item)"
|
||||
class="u-picker__view__column__item u-line-1"
|
||||
v-for="(item1, index1) in item"
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
lineHeight: $u.addUnit(itemHeight),
|
||||
fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
|
||||
}"
|
||||
>{{ getItemText(item1) }}</text>
|
||||
>{{ getItemText(item1) }}</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
<view
|
||||
|
|
@ -242,12 +242,13 @@ export default {
|
|||
&__view {
|
||||
|
||||
&__column {
|
||||
@include flex;
|
||||
@include flex(column);
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
|
||||
// flex-direction: column;
|
||||
&__item {
|
||||
@include flex;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
|
|
|
|||
Loading…
Reference in New Issue