diff --git a/common/js/api.js b/common/js/api.js
index ade21d5..0be8890 100644
--- a/common/js/api.js
+++ b/common/js/api.js
@@ -356,5 +356,36 @@ export default {
calcUsablePoints(param) {
return uni.api.get("/api/points/member-points/calc-usable-points", param);
},
-
+
+ /**
+ * 分享-获取邀请页数据
+ * @param {Object} param
+ */
+ getByShopId(param) {
+ return uni.api.get("/tbShopShare/getByShopId", param);
+ },
+
+ /**
+ * 分享-邀请记录
+ * @param {Object} param
+ */
+ shareRecord(param) {
+ return uni.api.get("/tbShopShare/record", param);
+ },
+
+ /**
+ * 分享-被邀请人进入页面时使用
+ * @param {Object} param
+ */
+ shareHeOpen(param) {
+ return uni.api.post("/tbShopShare/open", param);
+ },
+
+ /**
+ * 分享-被邀请人领取优惠券时使用
+ * @param {Object} param
+ */
+ shareReceive(param) {
+ return uni.api.post("/tbShopShare/receive", param);
+ },
}
\ No newline at end of file
diff --git a/components/popupad.vue b/components/popupad.vue
index 8960d29..277b66f 100644
--- a/components/popupad.vue
+++ b/components/popupad.vue
@@ -76,8 +76,9 @@
swiperClick (e) {
let item = this.popupadList[e];
if ( item.linkPath ) {
- uni.navigateTo({
- url: `${item.linkPath}`
+ uni.pro.navigateTo(item.linkPath, {
+ shopId: uni.cache.get('shopId'),
+ is_type: "me",
})
}
},
diff --git a/pages/index/indexs.vue b/pages/index/indexs.vue
index b6d64ef..7087ae0 100644
--- a/pages/index/indexs.vue
+++ b/pages/index/indexs.vue
@@ -91,10 +91,6 @@
})
},
memberindex(url) {
- // uni.pro.navigateTo("/pagesInviteFriends/index/index", {
- // shopId: uni.cache.get('shopId'),
- // type: 'index',
- // })
uni.pro.navigateTo(url, {
shopId: uni.cache.get('shopId'),
type: 'index',
diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue
index ba04a30..62f9d55 100644
--- a/pages/order_food/order_food.vue
+++ b/pages/order_food/order_food.vue
@@ -238,10 +238,10 @@
-
+
-
+
已下单菜品
@@ -481,6 +481,7 @@
duration: 0
});
if ( this.shopId ) {
+ this.productqueryShop();
this.productqueryProduct() //list 数据
this.getShopUserInfo() //list 数据
this.handlemessage() //监听websocket返回
diff --git a/pages/user/coupon.vue b/pages/user/coupon.vue
index 6ae3f26..8ef77ee 100644
--- a/pages/user/coupon.vue
+++ b/pages/user/coupon.vue
@@ -17,22 +17,22 @@
+ :class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': status != 1,}" >
+ :class="status == 1?'':'containertopboxitemleft_ones'">
{{item.num || 0}}
张
¥
- {{item.couponsAmount || 0}}
+ {{item.discountAmount || 0}}
{{ item.type == 2 ? item.detail : '优惠券(元)'}}
@@ -42,8 +42,9 @@
-
- {{ item.shopName }}
+
+ {{ item.shopName }}
+ {{ item.name }}
无门槛使用
@@ -51,13 +52,13 @@
{{ item.type == 2 ? '会员商品券' : '通用红包券'}}
- {{item.status == 0 ? '去使用':'已使用'}}
+ :class="status == 1?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
+ {{status == 1 ? '去使用':'已使用'}}
-
+
@@ -133,11 +134,10 @@
* 去使用优惠券
*/
navigatorGo ( item ) {
- if ( item.type == 2 ) {
- uni.pro.navigateTo('/pages/order_food/order_food', {
- shopId: item.shopId
- })
- }
+ uni.cache.set('shopId',item.shopId)
+ uni.pro.navigateTo('/pages/order_food/order_food', {
+ shopId: item.shopId
+ })
},
}
};
diff --git a/pagesInviteFriends/index/index.vue b/pagesInviteFriends/index/index.vue
index f6ec0bc..05b65bd 100644
--- a/pagesInviteFriends/index/index.vue
+++ b/pagesInviteFriends/index/index.vue
@@ -1,31 +1,31 @@
-
-
+
+
- 邀请1人可得,双方各得10元优惠券
- 邀请好友
+ {{InviteFriendsData.title}}
+
新用户获得
-
+
- ¥10.00
- 满¥100.00可用
+ ¥{{item.discountAmount}}
+ 满¥{{item.fullAmount}}可用
- 邀新10元优惠券×1张
- 领取后30天内有效
+ {{item.couponName}}
+ {{item.useDetail}}
- 每邀请1个用户可获得
-
+ 每邀请{{InviteFriendsData.invitedNum}}个用户可获得
+
- ¥10.00
- 满¥100.00可用
+ ¥{{item.discountAmount}}
+ 满¥{{item.fullAmount}}可用
- 邀新10元优惠券×1张
- 领取后30天内有效
+ {{item.couponName}}
+ {{item.useDetail}}
@@ -38,34 +38,37 @@
>{{item.label}}{{item.num||0}}人
-
+
- 草莓大福
- 草莓大福
+ {{item.invitedName}}
+ {{
+ isSuccess ? '邀请成功' : '未邀请成功'
+ }}
- 2023-22-33 17:33:99
+ {{item.createTime}}
-
+
- 此用户已死,勿Call
+ {{userInfo.nickName}}
[邀请你领取新人专享优惠券!]
-
+
- ¥10.00
- 满¥100.00可用
+ ¥{{item.discountAmount}}
+ 满¥{{item.fullAmount}}可用
- 邀新10元优惠券×1张
- 领取后30天内有效
+ {{item.couponName}}
+ {{item.useDetail}}
- 领券
+ 领券
+ 领券
@@ -82,39 +85,129 @@
data() {
return {
show: false,
- status: "he",
+ is_type: "",
tabList: [
{label: '已邀请', type: 1, num: 0},
{label: '无效' ,type: 2, num: 0}
],
tabAcitve: 1,
+ userInfo: uni.cache.get('userInfo'),
+ shopId: null,
+ shareId: null,
+ invitedId: null,
+ InviteFriendsData: null,
+ shareRecordData: null,
+ shareOpenData: null,
+ isSuccess: true,
+ share: {
+ title: "",
+ path: "",
+ imageUrl: ""
+ }
};
},
onLoad(options) {
-
+ console.log(options)
+ if ( options.shopId ) { this.shopId = options.shopId; }
+ if ( options.is_type ) { this.is_type = options.is_type; }
+ if ( options.shareId ) { this.shareId = options.shareId; }
+ if ( options.invitedId ) { this.invitedId = options.invitedId; }
+ this.is_type = 'he'
+ this.invitedId = "113"
+ this.shareId = "1"
+ this.shopId = "11"
+ if ( this.is_type == 'he') {
+ this.shareHeOpen()
+ }
+ this.getByShopId();
},
onShow() {
},
methods: {
+ onShareAppMessage(res) {
+ if (res.from === 'button') {// 来自页面内分享按钮
+ console.log(res.target)
+ }
+ return this.share
+ },
+ async getByShopId() {
+ let params = {
+ shopId : this.shopId
+ }
+ let res = await this.api.getByShopId(params)
+ if ( res.code == 0 ) {
+ this.InviteFriendsData = res.data;
+ this.share.title = res.data.title
+ this.share.path = `/pagesInviteFriends/index/index?shopId=${this.shopId}&is_type=he&shareId=${this.InviteFriendsData.id}&invitedId=${uni.cache.get('userInfo').id}`
+ this.share.imageUrl = res.data.shareImg
+ this.shareRecord();
+ }
+ },
+
+ /**
+ * 邀请记录
+ */
+ async shareRecord() {
+ let params = {
+ shareId : this.InviteFriendsData.id,
+ invitedId : uni.cache.get('userInfo').id,
+ shopId : this.shopId,
+ isSuccess : this.isSuccess,
+ }
+ let res = await this.api.shareRecord(params)
+ if ( res.code == 0 ) {
+ this.shareRecordData = res.data;
+ this.tabList[0].num = res.data.isSuccess;
+ this.tabList[1].num = res.data.isFail;
+ }
+ },
+
+ /**
+ * 被邀请人进入页面调用接口
+ */
+ async shareHeOpen() {
+ let params = {
+ shareId : this.shareId,
+ invitedId : this.invitedId,
+ // beInvitedId : uni.cache.get('userInfo').id,
+ beInvitedId : 119,
+ shopId : this.shopId,
+ }
+ let res = await this.api.shareHeOpen(params)
+ if ( res.code == 0 ) {
+ this.shareOpenData = res.data;
+ }
+ },
+
+ /**
+ * 领取优惠券
+ */
+ async shareReceive() {
+ let params = {
+ shareId : this.shareId,
+ invitedId : this.invitedId,
+ beInvitedId : uni.cache.get('userInfo').id,
+ shopId : this.shopId,
+ }
+ let res = await this.api.shareReceive(params)
+ if ( res.code == 0 ) {
+ uni.showToast({
+ title: "领取成功",
+ icon: "none",
+ })
+ setTimeout(()=>{
+ uni.pro.redirectTo('/pages/user/coupon', {
+ type: 1
+ })
+ },1000)
+ }
+ },
tabClick(item) {
this.tabAcitve = item.type;
},
- /**
- * 解码
- * @param {Object} url
- * @param {Object} name
- */
- getQueryString(url, name) {
- var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
- var r = url.substr(1).match(reg)
- if (r != null) {
- return r[2]
- }
- return null;
- },
-
+
}
@@ -174,10 +267,12 @@
background: #FCF9F4;
border-radius: 18rpx 18rpx 18rpx 18rpx;
border: 2rpx solid #333333;
+ margin-bottom: 32rpx;
.left{
border-right: 1rpx dashed #333;
padding-right: 34rpx;
margin-right: 46rpx;
+ flex-shrink: 0;
.num{
font-weight: 500;
font-size: 56rpx;
@@ -216,6 +311,7 @@
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
padding: 32rpx 24rpx 32rpx 24rpx;
+ margin-top: 32rpx;
.tab{
background: #333333;
border-radius: 12rpx 12rpx 12rpx 12rpx;
diff --git a/pagesOrder/confirm_order/index.vue b/pagesOrder/confirm_order/index.vue
index d8c442e..bbeae4e 100644
--- a/pagesOrder/confirm_order/index.vue
+++ b/pagesOrder/confirm_order/index.vue
@@ -22,7 +22,7 @@
桌台
- {{ shopTableInfo.name }}
+ {{ shopTableInfo.name || '' }}
@@ -85,7 +85,7 @@
-
+
{{ item.name }}
@@ -287,9 +287,9 @@
setPayAmount ( cartLists ) {
console.log(cartLists)
if ( this.amountVIP.isVip == 1 && cartLists.memberAmount > 0 ) {
- this.listinfo.payAmount = (cartLists.memberAmount+(this.shopTableInfo.seatNum*this.storeInfo.tableFee)).toFixed(2)
+ this.listinfo.payAmount = (cartLists.memberAmount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2)
} else {
- this.listinfo.payAmount = (cartLists.amount+(this.shopTableInfo.seatNum*this.storeInfo.tableFee)).toFixed(2)
+ this.listinfo.payAmount = (cartLists.amount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2)
}
},
/**
@@ -382,6 +382,14 @@
if (this.tableCode) {params.code = this.tableCode}
if (this.shopId) {params.shopId = this.shopId}
let res = await this.api.productqueryShop(params)
+ if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount&&this.orderAMeal) {
+ this.orderAMeal = false;
+ uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
+ tableCode: this.tableCode,
+ shopId: res.data.storeInfo.id,
+ })
+ return;
+ }
this.freeDingConfig = res.data.freeDingConfig;
this.shopTableInfo = res.data.shopTableInfo;
this.storeInfo = res.data.storeInfo;
@@ -438,22 +446,26 @@
return;
}
this.isSocket = true;
+ this.isPointsChecked = false;
this.listinfoid = msg.data.id
this.listinfo.details = msg.data.detailList;
this.setPayAmount(msg.data)
uni.$off('getMessage')
this.orderorderInfo(1)
+ this.getCalcUsablePoints()
}
break;
case 'addCart':
this.isSocket = true;
if ( this.eatModel == "dine-in" && this.tableCode ) {
+ this.isPointsChecked = false;
if (this.listinfoid) {
this.orderorderInfo()
} else {
this.listinfo.details = msg.data;
this.setPayAmount(msg)
}
+ this.getCalcUsablePoints()
}
break;
@@ -466,12 +478,14 @@
}, 1000)
break;
case 'addcart':
+ this.isPointsChecked = false;
if (this.listinfoid) {
this.orderorderInfo()
} else {
this.listinfo.details = msg.data;
this.setPayAmount(msg)
}
+ this.getCalcUsablePoints()
this.isSocket = true;
break;
}
@@ -618,7 +632,7 @@
"sendType": this.sendType,
"remark": this.remark,
}
- if ( this.calcUsablePointsData.pointsNum && this.calcUsablePointsData.pointsNum > 0) {
+ if ( this.isPointsChecked && this.calcUsablePointsData.pointsNum && this.calcUsablePointsData.pointsNum > 0) {
params.pointsNum = this.calcUsablePointsData.pointsNum;
}
let res = await this.api.creatOrder(params)