@@ -1,6 +1,7 @@ | |||
<script> | |||
import payAPI from "@/api/pay.js"; | |||
import memberAPI from "@/api/member.js"; | |||
import goodsApi from "@/api/goods.js"; | |||
import store from "@/store/index.js"; | |||
export default { | |||
globalData: { | |||
@@ -14,7 +15,8 @@ | |||
latitude: null, //纬度 | |||
longitude: null //经度 | |||
}, | |||
appId: '' | |||
appId: '', | |||
companyId: '', | |||
}, | |||
onLaunch() { | |||
this.onCheckUpdate(); | |||
@@ -129,9 +131,7 @@ | |||
//检查内存是否存在登录信息 | |||
//不存在。登录 | |||
//存在不做操作 | |||
if (user == null) { | |||
this.onUserLogin(); | |||
} | |||
this.onUserLogin(); | |||
}, | |||
//如果过期:重新登录,调登录接口,无论失败 | |||
fail: () => { | |||
@@ -277,6 +277,48 @@ | |||
}); | |||
} | |||
}, | |||
//根据门店ID获取店铺素材 | |||
async onFetchStoreList() { | |||
if (store.state.currentStore.id) { | |||
const storeRes = await goodsApi.queryStoreMaterialById(store.state.currentStore.id); | |||
if (storeRes.statusCode === 200) { | |||
store.commit('onSetStoreStyles', storeRes.data); | |||
} else { | |||
uni.showToast({ | |||
title: storeRes.errors || '获取店铺素材出错', | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} else { | |||
let response = await goodsApi.getStoreList(); | |||
if (response.isSuccess == true) { | |||
const firstStore = response.data[0]; | |||
if (firstStore) { | |||
store.commit('onInitChooseStore', firstStore); | |||
const storeRes = await goodsApi.queryStoreMaterialById(firstStore.id); | |||
if (storeRes.statusCode === 200) { | |||
store.commit('onSetStoreStyles', storeRes.data); | |||
} else { | |||
uni.showToast({ | |||
title: storeRes.errors || '获取店铺素材出错', | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} | |||
} else { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
@@ -293,7 +335,7 @@ | |||
/* 公用颜色 */ | |||
.green-color { | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
icon { | |||
@@ -24,5 +24,30 @@ export default { | |||
method: 'GET', | |||
interfaceType: 0 | |||
}); | |||
} | |||
}, | |||
//根据门店ID查询 门店素材 | |||
queryStoreMaterialById(id) { | |||
return request({ | |||
url: '/api/minimaterial/store', | |||
method: 'POST', | |||
data: { | |||
storeId: id, | |||
current: 1, | |||
pageSize: 999 | |||
}, | |||
interfaceType: 0 | |||
}); | |||
}, | |||
/**获取OOS服务器地址 | |||
* @param {Object} data | |||
*/ | |||
GetCosRequestURL(data) { | |||
return request({ | |||
url: '/api/systemconfig/GetCosRequestSignURL', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 0 | |||
}); | |||
}, | |||
} |
@@ -4,7 +4,7 @@ export default { | |||
//订单分页查询 | |||
orderPageQuery(data) { | |||
return request({ | |||
url: 'api/order/fullorderbyuserid', | |||
url: '/order/fullorderbyuserid', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 1 | |||
@@ -13,7 +13,7 @@ export default { | |||
//用户主动下单:新增订单 | |||
newOrder(data) { | |||
return request({ | |||
url: 'api/order/v2/neworder', | |||
url: '/order/v2/neworder', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 1 | |||
@@ -22,7 +22,7 @@ export default { | |||
//代客下单:新增订单 | |||
adminNewOrder(data) { | |||
return request({ | |||
url: 'api/order/admin/neworder', | |||
url: '/order/admin/neworder', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 1 | |||
@@ -31,7 +31,7 @@ export default { | |||
//订单付款 | |||
orderPay(orderNumber, reason = '用户主动点击付款') { | |||
return request({ | |||
url: 'api/order/v2/orderpay', | |||
url: '/order/v2/orderpay', | |||
data: { | |||
orderNumber, | |||
reason | |||
@@ -43,7 +43,7 @@ export default { | |||
//根据订单编号获取完整订单 | |||
fullorderByNumber(orderNumber) { | |||
return request({ | |||
url: `api/order/fullorderbynumber/${orderNumber}`, | |||
url: `/order/fullorderbynumber/${orderNumber}`, | |||
interfaceType: 1, | |||
method: 'GET' | |||
}); | |||
@@ -51,7 +51,7 @@ export default { | |||
//申请售后 | |||
applySaleAfter(data) { | |||
return request({ | |||
url: 'api/order/applysaleafter', | |||
url: '/order/applysaleafter', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 1 | |||
@@ -60,7 +60,25 @@ export default { | |||
//取消售后 | |||
cancelSaleAfter(data) { | |||
return request({ | |||
url: 'api/order/cancelsaleafter', | |||
url: '/order/cancelsaleafter', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 1 | |||
}); | |||
}, | |||
//查询退款订单 | |||
queryRefundOrderByuserId(data) { | |||
return request({ | |||
url: '/order/refundorderbyuserid', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 1 | |||
}); | |||
}, | |||
//退单回调(在申请微信退款之后) | |||
refundrefuc(data) { | |||
return request({ | |||
url: '/order/refundrefuc', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 1 | |||
@@ -18,6 +18,7 @@ export default { | |||
interfaceType: 2 | |||
}); | |||
}, | |||
//解密 | |||
decryptUserInfo(data) { | |||
return request({ | |||
url : 'api/wechat/decryptuserinfo', | |||
@@ -25,5 +26,14 @@ export default { | |||
data: data, | |||
interfaceType: 2 | |||
}); | |||
}, | |||
//退款 | |||
wechatrefund(data) { | |||
return request({ | |||
url : 'api/wechat/wechatrefund', | |||
method: 'POST', | |||
data: data, | |||
interfaceType: 2 | |||
}); | |||
} | |||
} |
@@ -14,7 +14,7 @@ | |||
<view> | |||
满¥{{item.condition}}元,减¥{{item.couponValue}}元。 | |||
</view> | |||
<checkbox class="checkbox-item" :value="item.id" :checked="item.isSelect" color="#51A97D"/> | |||
<checkbox class="checkbox-item" :value="item.id" :checked="item.isSelect" color="$theme-color"/> | |||
</view> | |||
<view class="coupon-term-validity"> | |||
有效期:{{item.validStartTime}}-{{item.validEndTime}} | |||
@@ -112,9 +112,10 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.coupon-navbar-content { | |||
flex-grow: 1; | |||
height: 100%; | |||
width: 100%; | |||
display: flex; | |||
flex-direction: column; | |||
overflow: hidden; | |||
@@ -142,7 +143,7 @@ | |||
content: ''; | |||
top: -25rpx; | |||
left: 225rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
@@ -182,7 +183,7 @@ | |||
content: ''; | |||
bottom: -25rpx; | |||
left: 225rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
@@ -239,7 +240,7 @@ | |||
} | |||
.coupon-use-box .coupon-use-btn { | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
padding: 5rpx 20rpx; | |||
border-radius: 30rpx; | |||
@@ -34,9 +34,20 @@ | |||
<button open-type="share" type="primary" class="share-food-btn"> | |||
<icon class="iconfont icon-fenxiang"></icon> | |||
</button> | |||
<!-- 做法 --> | |||
<view class="goods-makes-card" v-if="currentGoods.goodsMakes.length > 0"> | |||
<view class="goods-makes-title"> | |||
做法 | |||
</view> | |||
<view class="goods-makes-list"> | |||
<view v-for="goodsMake in currentGoods.goodsMakes" :key="goodsMake.makeId" :class="{'goods-makes-item': true, 'goods-makes-selected': goodsMake.isSelect}" @click="onChooseMakes(goodsMake)"> | |||
{{goodsMake.makeName}} | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 加料列表 --> | |||
<view class="feed-list"> | |||
<view class="feed-item" v-for="(feed, index) in currentGoods.addtoFoodList" :key="index"> | |||
<view class="feed-item" v-for="(feed, index) in currentGoods.addtoFoodList" :key="feed.id"> | |||
<view class="feed-title"> | |||
加份{{feed.name}} | |||
</view> | |||
@@ -62,14 +73,33 @@ | |||
<view :class="{'feed-count-now': true, 'hidden-blank-data': addFood.count === 0}" > | |||
{{addFood.count}} | |||
</view> | |||
<icon class="iconfont icon-zengjia" @click="onFeedCountPlus(addFood)" ></icon> | |||
<icon :class="{'iconfont': true, 'icon-zengjia': true, 'more-one-icon': addFood.count >= 1}" @click="onFeedCountPlus(addFood)" ></icon> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 加料列表做法 --> | |||
<u-popup :show="showFeedMakes" @close="closeFeedMakes" @open="openFeedMakes" mode="center" round="30rpx"> | |||
<view class="feed-makes-card"> | |||
<view class="specifi-head"> | |||
{{currentFeed.name}} | |||
</view> | |||
<view class="goods-makes-title"> | |||
做法 | |||
</view> | |||
<view class="goods-makes-list"> | |||
<view v-for="goodsMake in currentFeed.goodsMakes" :key="goodsMake.makeId" :class="{'goods-makes-item': true, 'goods-makes-selected': goodsMake.isSelect}" @click="onChooseFeedMakes(goodsMake)"> | |||
{{goodsMake.makeName}} | |||
</view> | |||
</view> | |||
<view class="specifi-total-right" @click="onAddFeed"> | |||
选好了 | |||
</view> | |||
</view> | |||
</u-popup> | |||
<!-- 套餐列表 --> | |||
<view class="set-meal-list"> | |||
<view class="feed-item" v-for="(feed, index) in currentGoods.setMealList" :key="index"> | |||
<view class="set-meal-list" v-if="false"> | |||
<view class="feed-item" v-for="(feed, index) in currentGoods.setMealList" :key="feed.id"> | |||
<view class="feed-title"> | |||
{{feed.name}} | |||
</view> | |||
@@ -101,11 +131,11 @@ | |||
</view> | |||
</view> | |||
<view class="choose-success-btn" @click="onSure"> | |||
选好了 | |||
加入购物车 | |||
</view> | |||
</view> | |||
<!-- 选规格 --> | |||
<u-popup :show="showSpecification" mode="center" @close="closeChooseSpeci" @open="openChooseSpeci" round="30rpx"> | |||
<u-popup v-if="false" :show="showSpecification" mode="center" @close="closeChooseSpeci" @open="openChooseSpeci" round="30rpx"> | |||
<view class="specifi-box"> | |||
<view class="specifi-head"> | |||
{{currentChoose.name}} | |||
@@ -151,11 +181,20 @@ | |||
import store from '@/store/index.js'; | |||
export default { | |||
name:"FeedListPopup", | |||
props: { | |||
isSpecialOffer: { //是否为特价页 | |||
type: Boolean, | |||
default: false, | |||
required: false | |||
} | |||
}, | |||
data() { | |||
return { | |||
imageServer: getApp().globalData.imageServer, | |||
currentChoose: {}, //当前已选商品 | |||
showSpecification: false | |||
showSpecification: false, | |||
showFeedMakes: false, //是否展示加购做法 | |||
currentFeed: {}, //当前加购商品 | |||
}; | |||
}, | |||
computed: { | |||
@@ -215,11 +254,38 @@ | |||
}, | |||
//配料加一 | |||
onFeedCountPlus(feed) { | |||
store.commit('onFeedCountPlus', feed); | |||
if (feed.count >= 1) return; | |||
if (feed.goodsMakes.length > 0) { | |||
feed.goodsMakes.forEach((item, index) => { | |||
if (index === 0) { | |||
item.isSelect = true; | |||
} else { | |||
item.isSelect = false; | |||
} | |||
}); | |||
this.currentFeed = feed; | |||
this.openFeedMakes(); | |||
} else { | |||
store.commit('onFeedCountPlus', feed); | |||
} | |||
}, | |||
//配料加一 | |||
onAddFeed() { | |||
store.commit('onFeedCountPlus', this.currentFeed); | |||
this.closeFeedMakes(); | |||
}, | |||
//从配料列表添加主食 | |||
onSure() { | |||
store.commit('onStapleFoodPlusFromList'); | |||
if (this.isSpecialOffer) { | |||
store.commit('onStapleFoodPlusFromList'); | |||
getApp().onCheckUserSession('specialOffer').then(() => { | |||
uni.navigateTo({ | |||
url: '/pages/confirmOrder/confirmOrder' | |||
}); | |||
}); | |||
} else { | |||
store.commit('onStapleFoodPlusFromList'); | |||
} | |||
this.$emit('onFeedPopuoClose'); | |||
}, | |||
//套餐减1 | |||
@@ -258,12 +324,45 @@ | |||
onJoinCar() { | |||
store.commit('onSetMealCountPlus', this.currentChoose); | |||
this.closeChooseSpeci(); | |||
}, | |||
onChooseMakes(goodsMake) { | |||
this.currentGoods.goodsMakes.forEach(item => { | |||
if (item.makeId === goodsMake.makeId) { | |||
item.isSelect = !item.isSelect; | |||
} else { | |||
item.isSelect = false; | |||
} | |||
}); | |||
const trueMakes = this.currentGoods.goodsMakes.filter(item => item.isSelect); | |||
if (trueMakes.length < 1) { | |||
goodsMake.isSelect = true; | |||
} | |||
}, | |||
onChooseFeedMakes(goodsMake) { | |||
this.currentFeed.goodsMakes.forEach((item, index) => { | |||
if (item.makeId === goodsMake.makeId) { | |||
item.isSelect = !item.isSelect; | |||
} else { | |||
item.isSelect = false; | |||
} | |||
}); | |||
const trueMakes = this.currentFeed.goodsMakes.filter(item => item.isSelect); | |||
if (trueMakes.length < 1) { | |||
goodsMake.isSelect = true; | |||
} | |||
this.currentFeed.goodsMakes = JSON.parse(JSON.stringify(this.currentFeed.goodsMakes)); | |||
}, | |||
closeFeedMakes() { | |||
this.showFeedMakes = false; | |||
}, | |||
openFeedMakes() { | |||
this.showFeedMakes = true; | |||
} | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.feed-list-popup { | |||
position: fixed; | |||
left: 0; | |||
@@ -399,7 +498,7 @@ | |||
height: 90rpx; | |||
line-height: 90rpx; | |||
text-align: center; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
border-radius: 50rpx; | |||
} | |||
@@ -416,7 +515,7 @@ | |||
} | |||
.icon-zengjia, .icon-jianshaojianqujianhao { | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.share-food-btn { | |||
@@ -426,9 +525,9 @@ | |||
margin-left: auto; | |||
width: 40px; | |||
background-color: transparent; | |||
border-color: #51A97D; | |||
border-color: $theme-color; | |||
border: none !important; | |||
color: #51A97D; | |||
color: $theme-color; | |||
box-shadow: none; | |||
position: absolute; | |||
right: 30rpx; | |||
@@ -480,8 +579,8 @@ | |||
} | |||
.specifi-detail-select { | |||
border-color: #51A97D; | |||
color: #51A97D; | |||
border-color: $theme-color; | |||
color: $theme-color; | |||
} | |||
.specifi-choosed-card { | |||
@@ -506,11 +605,6 @@ | |||
height: 100rpx; | |||
font-size: 30rpx; | |||
} | |||
.specifi-total-right { | |||
display: flex; | |||
align-items: center; | |||
} | |||
.specifi-total-price { | |||
font-size: 36rpx; | |||
@@ -519,15 +613,59 @@ | |||
.specifi-total-right { | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
padding: 10rpx 40rpx; | |||
padding: 20rpx 40rpx; | |||
border-radius: 10rpx; | |||
font-size: 30rpx; | |||
} | |||
.specifi-total-right .iconfont { | |||
color: #FFF; | |||
margin-right: 20rpx; | |||
} | |||
/* 做法 */ | |||
.goods-makes-card { | |||
margin: 20rpx 0; | |||
} | |||
.goods-makes-title { | |||
font-size: 36rpx; | |||
font-weight: 900; | |||
margin-bottom: 10rpx; | |||
} | |||
.goods-makes-list { | |||
display: flex; | |||
flex-wrap: wrap; | |||
margin-bottom: 20rpx; | |||
} | |||
.goods-makes-item { | |||
border-radius: 10rpx; | |||
font-size: 28rpx; | |||
margin-right: 20rpx; | |||
padding: 20rpx 80rpx; | |||
color: #666; | |||
background-color: rgb(244, 244, 244); | |||
margin-bottom: 10rpx; | |||
} | |||
.goods-makes-selected { | |||
background-color: $theme-color; | |||
color: #FFF; | |||
} | |||
.feed-makes-card { | |||
width: 680rpx; | |||
padding: 30rpx; | |||
box-sizing: border-box; | |||
} | |||
.more-one-icon { | |||
color: #666; | |||
} | |||
</style> |
@@ -4,7 +4,7 @@ | |||
<scroll-view v-if="isShowLeftType" class="food-left-scroll" scroll-y="true" :scroll-into-view="foodLeftIntoView" scroll-with-animation> | |||
<view :class="{'food-left-item': true, 'food-left-active': index == foodLeftIndex}" v-for="(item, index) in foodArray" :key="index" :id="'foodLeftIntoView'.concat(index)" @click="setLeftView(index)"> | |||
<view class="food-left-cover"> | |||
<image @error="onImageErrorType(item)" :lazy-load="true" class="image-common-cover" :src="item.coverUrl" ></image> | |||
<image @error="onImageErrorType(item)" :lazy-load="true" class="image-common-cover" :src="imageServer.concat('785ffa97-f2ee-4e08-ae39-86b90b45d33c.png')" ></image> | |||
</view> | |||
<view class="food-left-name"> | |||
{{item.name}} | |||
@@ -12,11 +12,8 @@ | |||
</view> | |||
</scroll-view> | |||
<scroll-view class="food-right-scroll" scroll-y="true" :scroll-into-view="foodRightIntoView" @scroll="onScroll" @scrolltoupper="onScrollTop" @scrolltolower="onScrollBottom" scroll-with-animation> | |||
<view class="advertisement-card" v-show="isShowLeftType"> | |||
<image src="http://res.hualala.com/basicdoc/5aa399b2-22f1-4738-ab2e-e5085b9bc0ff.png" class="image-common-cover"></image> | |||
</view> | |||
<view class="advertisement-card" v-show="isShowLeftType"> | |||
<image src="http://res.hualala.com/basicdoc/5f562596-1cdd-470f-a1f3-4efd3deeb84d.png" class="image-common-cover"></image> | |||
<view class="advertisement-card" v-show="isShowLeftType" v-for="(adver, index) in adverList" :key="index"> | |||
<image :src="adver" class="image-common-cover"></image> | |||
</view> | |||
<view class="food-right-item" v-for="(item, index) in foodArray" :key="item.id" :id="'foodRightIntoView'.concat(index)"> | |||
<view class="foodt-right-title" v-if="isShowLeftType"> | |||
@@ -66,6 +63,7 @@ | |||
v-if="isShowFeedPopup" | |||
@onFeedPopuoClose="onFeedPopuoClose" | |||
class="feed-list-popup" | |||
:isSpecialOffer="isSpecialOffer" | |||
> | |||
</FeedListPopup> | |||
<SettlementPopup ref="settlementRef" v-if="!isSpecialOffer"></SettlementPopup> | |||
@@ -93,6 +91,11 @@ | |||
type: Boolean, | |||
default: false, | |||
required: false | |||
}, | |||
adverList: { | |||
type: Array, | |||
default: [], | |||
require: true | |||
} | |||
}, | |||
data() { | |||
@@ -156,7 +159,6 @@ | |||
onChooseFood(food) { | |||
food.count = 0; | |||
food.sencondId = food.id; | |||
let currentGoods; | |||
if (food.addtoFoodList && food.addtoFoodList.length > 0) { | |||
food.addtoFoodList.forEach(item => { | |||
item.foods.forEach(additional => { | |||
@@ -164,7 +166,8 @@ | |||
additional.sourceCount = 0; | |||
}); | |||
}); | |||
} else if (food.setMealList && food.setMealList.length > 0) { | |||
} | |||
if (food.setMealList && food.setMealList.length > 0) { | |||
food.setMealList.forEach(item => { | |||
item.foods.forEach(additional => { | |||
additional.count = 0; | |||
@@ -183,7 +186,16 @@ | |||
}); | |||
}); | |||
} | |||
currentGoods = JSON.parse(JSON.stringify(food)); | |||
if (food.goodsMakes && food.goodsMakes.length > 0) { | |||
food.goodsMakes.forEach((item, inedx) => { | |||
if (inedx === 0) { | |||
item.isSelect = true; | |||
} else { | |||
item.isSelect = false; | |||
} | |||
}); | |||
} | |||
let currentGoods = JSON.parse(JSON.stringify(food)); | |||
store.commit('initCurrentGoods', currentGoods); | |||
this.isShowFeedPopup = true; | |||
}, | |||
@@ -220,11 +232,6 @@ | |||
}, | |||
onChooseSpecial: debounce(function(food) { | |||
this.onChooseFood(food); | |||
getApp().onCheckUserSession('specialOffer').then(() => { | |||
uni.navigateTo({ | |||
url: '/pages/confirmOrder/confirmOrder' | |||
}); | |||
}); | |||
}, 2000, true), | |||
onImageError(item) { | |||
item.cover = this.imageServer.concat('empty-image.png'); | |||
@@ -236,7 +243,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.goods-list-container { | |||
flex-grow: 1; | |||
display: flex; | |||
@@ -414,11 +421,11 @@ | |||
content: ''; | |||
width: 6rpx; | |||
height: 200rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
} | |||
.icon-zengjia, .icon-jianshaojianqujianhao { | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.hidden-blank-data { | |||
@@ -431,7 +438,7 @@ | |||
.special-offer-btn { | |||
justify-content: space-evenly; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
font-size: 28rpx; | |||
border-radius: 10rpx; | |||
@@ -41,7 +41,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.location-auth-container { | |||
position: fixed; | |||
top: 0; | |||
@@ -90,7 +90,7 @@ | |||
} | |||
.location-auth-open { | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
font-size: 33rpx; | |||
padding: 5rpx 0; | |||
@@ -13,7 +13,7 @@ | |||
<icon class="iconfont icon-you"></icon> | |||
</view> | |||
<view class="store-state-text product-show-state" :class="'product-show-' + orderStatusFilter(order.orderDetail).statusCode"> | |||
{{orderStatusFilter(order.orderDetail).result}} | |||
{{isRefund ? '已退款' : orderStatusFilter(order.orderDetail).result}} | |||
</view> | |||
</view> | |||
<view class="order-create-time"> | |||
@@ -73,6 +73,11 @@ | |||
type: Number, | |||
required: true, | |||
default: 0 | |||
}, | |||
isRefund: { //是否为退款 | |||
type: Boolean, | |||
required: true, | |||
default: false | |||
} | |||
}, | |||
created() { | |||
@@ -145,7 +150,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.order-list-compoents { | |||
display: flex; | |||
height: calc(100vh - 100rpx); | |||
@@ -242,8 +247,8 @@ | |||
/* 空白时 */ | |||
.start-btn { | |||
color: #51A97D; | |||
border: 2rpx solid #51A97D; | |||
color: $theme-color; | |||
border: 2rpx solid $theme-color; | |||
padding: 10rpx 30rpx; | |||
border-radius: 15rpx; | |||
margin-top: 30rpx; | |||
@@ -300,7 +305,7 @@ | |||
} | |||
.product-show-0 { | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.product-show-1 { | |||
@@ -191,7 +191,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
/* 结算 */ | |||
.settlement-box { | |||
position: relative; | |||
@@ -261,7 +261,7 @@ | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
text-align: center; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
border-radius: 50rpx; | |||
margin: auto 0 auto 200rpx; | |||
@@ -379,7 +379,7 @@ | |||
.cart-goods-vip-price { | |||
margin-right: 30rpx; | |||
font-size: 32rpx; | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.cart-goods-common-price { | |||
@@ -406,7 +406,7 @@ | |||
} | |||
.icon-zengjia, .icon-jianshaojianqujianhao { | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.hidden-blank-data { | |||
@@ -1,6 +1,6 @@ | |||
{ | |||
"name" : "", | |||
"appid" : "", | |||
"name" : "矮香牛牛肉工坊", | |||
"appid" : "__UNI__DBF567E", | |||
"description" : "", | |||
"versionName" : "1.0.0", | |||
"versionCode" : "100", | |||
@@ -54,8 +54,7 @@ | |||
"quickapp" : {}, | |||
/* 快应用特有相关 */ | |||
"mp-weixin" : { | |||
/* 微信小程序特有相关 */ | |||
"appid" : "wx7145999049c7eaa0", | |||
"appid" : "wx7b22d4c9ca5b68d6", | |||
"setting" : { | |||
"urlCheck" : false | |||
}, | |||
@@ -14,7 +14,7 @@ | |||
"style" : | |||
{ | |||
"enablePullDownRefresh": false, | |||
"navigationBarTitleText": "且时且多" | |||
"navigationBarTitleText": "点餐小程序" | |||
} | |||
} | |||
,{ | |||
@@ -310,6 +310,15 @@ | |||
} | |||
} | |||
,{ | |||
"path" : "pages/giveDrink/giveDrink", | |||
"style" : | |||
{ | |||
"navigationBarTitleText": "", | |||
"enablePullDownRefresh": false | |||
} | |||
} | |||
], | |||
"tabBar": { | |||
"color": "#999999", | |||
@@ -69,6 +69,8 @@ | |||
} | |||
store.commit('onInitScanInfo', codeScanInfo); | |||
store.commit('onInitChooseStore', currentStore); | |||
getApp().onFetchStoreList(); | |||
getApp().globalData.companyId = currentStore.companyId; | |||
uni.showLoading({ | |||
title: '店铺切换中', | |||
}); | |||
@@ -18,7 +18,7 @@ | |||
{{currentStore.store_Addr ? currentStore.store_Addr : '该店铺地址为空'}} | |||
</view> | |||
</view> | |||
<view class="dining-info-style"> | |||
<view class="dining-info-style" v-if="false"> | |||
<view :class="{'dining-style-item': true, 'selected': diningPlace === 2}" @click="changeDiningPlace(2)"> | |||
店内用餐 | |||
</view> | |||
@@ -40,7 +40,7 @@ | |||
</view> | |||
</view> | |||
<view class="order-list"> | |||
<view class="order-item" v-for="(food, index) in shoppingCart" :key="index"> | |||
<view class="order-item" v-for="(food, index) in shoppingCart" :key="food.id"> | |||
<view class="staple-food"> | |||
<view class="staple-food-cover"> | |||
<image :src="food.cover" class="image-common-cover"></image> | |||
@@ -52,7 +52,7 @@ | |||
x{{food.count}} | |||
</view> | |||
<view class="staple-food-price"> | |||
¥{{food.vipPrice}} | |||
¥{{(food.count * food.price).toFixed(2)}} | |||
</view> | |||
</view> | |||
<view class="side-dish-list" v-if="food.addtoFoodList.length > 0"> | |||
@@ -130,12 +130,12 @@ | |||
</view> | |||
</view> | |||
<view class="discount-item-right"> | |||
<text class="discount-money" v-if="isCheckedCoupon">-¥{{currentCouponMoney}}</text> | |||
<text class="discount-money" v-if="isCheckedCoupon">-¥{{choosedCoupon}}</text> | |||
<text class="discount-money discount-money-count" v-else>{{currentUseCouponList.length}}张可用</text> | |||
<icon class="iconfont icon-you"></icon> | |||
</view> | |||
</view> | |||
<view class="discount-type-item vip-type" v-if="discount.discountType == 1"> | |||
<view class="discount-type-item vip-type" v-if="discount.discountType == 1 && user.memberInfo_Id"> | |||
<view class="discount-item-left"> | |||
<view class="discount-prev-vip"> | |||
VIP | |||
@@ -145,7 +145,7 @@ | |||
</view> | |||
</view> | |||
<view class="discount-item-right"> | |||
<text class="discount-money">-¥{{memberDiscountAmount}}</text> | |||
<text class="discount-money">-¥{{memberDiscountAmount.toFixed(2)}}</text> | |||
</view> | |||
</view> | |||
</view> | |||
@@ -157,41 +157,41 @@ | |||
</view> | |||
<view class="order-info-original"> | |||
菜单价: | |||
<text class="order-info-suffix">¥{{shopCartTotalPrice.toFixed(2)}}</text> | |||
<text class="order-info-suffix">¥{{menuFoodPrice.toFixed(2)}}</text> | |||
</view> | |||
<view class="order-info-discount"> | |||
优惠金额: | |||
<text class="order-info-suffix">¥{{currentCouponMoney}}</text> | |||
优惠抵扣: | |||
<text class="order-info-suffix">¥{{currentCouponMoney.toFixed(2)}}</text> | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 超值换购 --> | |||
<view class="value-exchange-card order-common-box-shadow" v-if="true"> | |||
<view class="value-exchange-card order-common-box-shadow" v-if="exchangeList.length > 0"> | |||
<view class="value-exchange-title"> | |||
超值换购 | |||
</view> | |||
<view class="value-exchange-item" v-for="(exchangeGoods, index) in exchangeList" :key="index"> | |||
<view class="value-exchange-cover"> | |||
<image :src="imageServer.concat(exchangeGoods.cover)" class="image-common-cover"></image> | |||
<image :src="exchangeGoods.cover" class="image-common-cover"></image> | |||
</view> | |||
<view class="value-exchange-goods"> | |||
<view class="value-exchange-name text-overflow-one"> | |||
{{exchangeGoods.name}} | |||
<text class="exchange-goos-compant">{{exchangeGoods.company}}</text> | |||
<text class="exchange-goos-compant">{{exchangeGoods.company || '份'}}</text> | |||
</view> | |||
<view class="value-exchange-price"> | |||
¥{{exchangeGoods.discountPrice}} | |||
<text class="exchange-original-price"> | |||
¥{{exchangeGoods.originalPrice}} | |||
¥{{exchangeGoods.price}} | |||
</text> | |||
</view> | |||
</view> | |||
<view class="value-exchange-count"> | |||
<icon class="iconfont icon-jianshaojianqujianhao" :class="{'hidden-blank-data': exchangeGoods.count < 1}" @click="onExchangeReduce(index)"></icon> | |||
<icon class="iconfont icon-jianshaojianqujianhao" :class="{'hidden-blank-data': exchangeGoods.count < 1}" @click="onExchangeReduce(exchangeGoods)"></icon> | |||
<text class="buy-count" :class="{'hidden-blank-data': exchangeGoods.count < 1}"> | |||
{{exchangeGoods.count}} | |||
</text> | |||
<icon class="iconfont icon-zengjia" @click="onExchangePlus(index)"></icon> | |||
<icon :class="{'iconfont': true, 'icon-zengjia': true, 'add-disable-btn': exchangeGoods.count >= 1}" @click="onExchangePlus(exchangeGoods)"></icon> | |||
</view> | |||
</view> | |||
</view> | |||
@@ -224,7 +224,7 @@ | |||
<view class="still-need-text"> | |||
还需支付 | |||
<text class="still-need-price"> | |||
¥{{needToPay.toFixed(2)}} | |||
¥{{needToPay >= 0 ? needToPay.toFixed(2) : 0}} | |||
</text> | |||
</view> | |||
<view class="still-need-btn" @click="onNewOrder"> | |||
@@ -257,30 +257,25 @@ | |||
userLocation: '', //用户坐标 | |||
autoActivityList: [], //自动参与活动列表 | |||
userAutoActivityJson: {},//参与活动JSON数据 | |||
exchangeList: [ | |||
{ | |||
id: '1001100', | |||
name: '丝滑香草冰淇淋', | |||
cover: '97fba14a-6908-48b2-8f4b-fcf6556030cd.png', | |||
originalPrice: 9, //原价 | |||
discountPrice: 1, //折后价 | |||
count: 0, | |||
company: '杯' //单位 | |||
} | |||
], | |||
exchangeList: [], | |||
exchangeRes: {} //超值换购活动 | |||
} | |||
}, | |||
created() { | |||
this.onDeleteZeroFeed(); | |||
this.onGetLoginUser(); | |||
this.onFetchMemberInfo().then(() => { | |||
this.onFetchCouponList(); | |||
this.onAutoPartActivity(); | |||
if(this.memberInfo.memberInfo_Id) { | |||
this.onAutoPartActivity().then(() => { | |||
this.onFetchCouponList(); | |||
}); | |||
this.onPriceForPurchase(); | |||
} | |||
}); | |||
}, | |||
computed: { | |||
...mapState([ | |||
'shoppingCart', 'currentStore', 'currentUseCouponList', 'codeScanInfo' | |||
'shoppingCart', 'currentStore', 'currentUseCouponList', 'codeScanInfo', 'foodArray' | |||
]), | |||
...mapGetters([ | |||
'shopCartCount', 'shopCartTotalPrice' | |||
@@ -288,6 +283,9 @@ | |||
//还需支付 | |||
needToPay() { | |||
let price = store.getters.shopCartTotalPrice; | |||
this.exchangeList.forEach(item => { | |||
price += item.discountPrice * item.count; | |||
}); | |||
return price - this.currentCouponMoney; | |||
}, | |||
//当前优惠金额 | |||
@@ -302,7 +300,7 @@ | |||
if (item.type == 2) { | |||
money += item.value; | |||
} | |||
}) | |||
}); | |||
return money; | |||
}, | |||
//是否选中优惠券 | |||
@@ -320,10 +318,27 @@ | |||
let price = 0; | |||
let vipPrice = 0; | |||
this.shoppingCart.forEach(item => { | |||
price += item.price; | |||
vipPrice += item.vipPrice; | |||
price += (item.price * item.count * 100); | |||
vipPrice += (item.vipPrice * item.count * 100); | |||
}); | |||
return (price - vipPrice) / 100; | |||
}, | |||
menuFoodPrice() { | |||
let price = 0; | |||
this.shoppingCart.forEach(item => { | |||
price += (item.price * item.count); | |||
}); | |||
return price; | |||
}, | |||
//已选优惠券 | |||
choosedCoupon() { | |||
let money = 0; | |||
this.currentUseCouponList.forEach(item => { | |||
if (item.isSelect == true) { | |||
money += item.couponValue; | |||
} | |||
}); | |||
return price - vipPrice; | |||
return money; | |||
} | |||
}, | |||
methods: { | |||
@@ -346,62 +361,103 @@ | |||
}); | |||
}, | |||
async onNewOrder() { | |||
let foodMenuId = []; | |||
let AddFoodMenuId = []; | |||
const subOrderInfo = []; | |||
const addFoodInfo = []; | |||
this.shoppingCart.forEach(food => { | |||
if (food.count > 1) { | |||
for(let i = 0; i < food.count; i++) { | |||
foodMenuId.push(food.id); | |||
const findGoodsMake = food.goodsMakes.find(goodsMake => goodsMake.isSelect); | |||
subOrderInfo.push({ | |||
foodMenuId: food.id, | |||
isGift: false, | |||
...findGoodsMake | |||
}); | |||
} | |||
} else { | |||
foodMenuId.push(food.id); | |||
const findGoodsMake = food.goodsMakes.find(goodsMake => goodsMake.isSelect); | |||
subOrderInfo.push({ | |||
foodMenuId: food.id, | |||
isGift: false, | |||
...findGoodsMake | |||
}); | |||
} | |||
food.addtoFoodList.forEach(addFood => { | |||
addFood.foods.forEach(feedFood => { | |||
if (feedFood.count > 1) { | |||
for(let i = 0; i < feedFood.count; i++) { | |||
AddFoodMenuId.push(feedFood.id); | |||
const findGoodsMake = feedFood.goodsMakes.find(goodsMake => goodsMake.isSelect); | |||
addFoodInfo.push({ | |||
foodMenuId: feedFood.id, | |||
isGift: false, | |||
...findGoodsMake | |||
}); | |||
} | |||
} else { | |||
AddFoodMenuId.push(feedFood.id); | |||
const findGoodsMake = feedFood.goodsMakes.find(goodsMake => goodsMake.isSelect); | |||
addFoodInfo.push({ | |||
foodMenuId: feedFood.id, | |||
isGift: false, | |||
...findGoodsMake | |||
}); | |||
} | |||
}); | |||
}); | |||
}); | |||
this.autoActivityList.forEach(item => { | |||
if (item.type == 3) { | |||
foodMenuId.push(item.value); | |||
const findAutoActivityFood = this.autoActivityList.find(item => item.type == 3); | |||
if (findAutoActivityFood) { | |||
this.foodArray.forEach(foodType => { | |||
let tempFood = foodType.foods.find(foodItem => findAutoActivityFood.value === foodItem.id); | |||
if (tempFood) { | |||
let findGoodsMake = tempFood.goodsMakes.find(goodsMake => goodsMake.isSelect); | |||
subOrderInfo.push({ | |||
foodMenuId: tempFood.id, | |||
isGift: true, | |||
...findGoodsMake | |||
}); | |||
} | |||
}); | |||
} | |||
this.exchangeList.forEach(item => { | |||
if (item.count > 0) { | |||
let findGoodsMake = item.goodsMakes.find(goodsMake => goodsMake.isSelect); | |||
subOrderInfo.push({ | |||
foodMenuId: item.id, | |||
isGift: false, | |||
...findGoodsMake | |||
}); | |||
} | |||
}); | |||
let orderNumber = getApp().getOrderNumber(); | |||
let deskCode = uni.getStorageSync('deskCode'); | |||
let currCounponIndex = this.currentUseCouponList.findIndex(item => { | |||
let currentCounpon = this.currentUseCouponList.find(item => { | |||
return item.isSelect == true; | |||
}); | |||
let currentCounpon = null; | |||
let realMoney = this.needToPay; | |||
// let realMoney = this.needToPay; | |||
let jsonData = { | |||
"orderNumber": orderNumber, | |||
"userId": this.user.openId, | |||
"foodMenuId": foodMenuId, | |||
"AddFoodMenuId": AddFoodMenuId, | |||
"subOrderInfo": subOrderInfo, | |||
"addFoodInfo": addFoodInfo, | |||
"realMoney": realMoney, | |||
"couponPrice": currentCounpon == null ? 0 : currentCounpon.couponValue, | |||
"couponCustomerId": currentCounpon == null ? '' :currentCounpon.id, | |||
"couponPrice": currentCounpon ? currentCounpon.couponValue : 0, | |||
"couponCustomerId": currentCounpon ? currentCounpon.id : '', | |||
"payMode": 0, | |||
"subOrderType": 0, | |||
"notifyUrl": 'https://www.black-pa.com:5500/Pay/api/order/notity', | |||
"notifyUrl": 'https://www.black-pa.com:21527/wechat/api/order/notity', | |||
"deskCode": this.codeScanInfo.deskCode, | |||
"eatType": this.diningPlace, | |||
"printRemark": this.remark, | |||
"storeId": this.currentStore.id | |||
"storeId": this.currentStore.id, | |||
"vipCountPrice": this.user.memberInfo_Id ? this.memberDiscountAmount : 0 | |||
} | |||
if(realMoney > 0) { | |||
let response = await orderAPI.newOrder(jsonData); | |||
if (response.isSuccess == true) { | |||
store.commit('onInitAdvancePrice', realMoney); | |||
store.commit('onInitOrderNumber', orderNumber); | |||
store.commit('onInitUserAutoActivityJson', this.userAutoActivityJson); | |||
this.userAutoActivityJson.ActivitySceneValue = orderNumber; | |||
store.commit('onInitUserAutoActivityJson', JSON.parse(JSON.stringify(this.userAutoActivityJson))); | |||
uni.redirectTo({ | |||
url: '/pages/payment/payment' | |||
}); | |||
@@ -415,6 +471,7 @@ | |||
} | |||
} else { | |||
//代客下单 | |||
jsonData.realMoney = 0; | |||
let adminOrderRes = await orderAPI.adminNewOrder(jsonData); | |||
if (adminOrderRes.isSuccess == true) { | |||
uni.showToast({ | |||
@@ -470,9 +527,10 @@ | |||
//初始化优惠券列表 | |||
async onFetchCouponList() { | |||
this.onInitGoodId(); | |||
if (!this.memberInfo.memberInfo_Id) return; | |||
let jsonData = { | |||
"goodsId": this.goodsId, | |||
"totalPrice": this.shopCartTotalPrice, | |||
"totalPrice": this.needToPay, | |||
"customerId": this.memberInfo.memberInfo_Id, | |||
"storeId": [store.state.currentStore.id] | |||
} | |||
@@ -528,10 +586,11 @@ | |||
}, | |||
//检查用户是否满足条件,自动参与活动 | |||
async onAutoPartActivity() { | |||
if (!this.memberInfo.memberInfo_Id) return; | |||
let jsonData = { | |||
"memberInfoId": this.memberInfo.memberInfo_Id, | |||
"parameter": { | |||
"goodsId": this.goodsId, | |||
"goodsId": this.goodsId, | |||
"storeId": store.state.currentStore.id, | |||
"stage": 0, | |||
"totalPrice": this.shopCartTotalPrice | |||
@@ -540,16 +599,81 @@ | |||
"isParticipate": false | |||
} | |||
let response = await activityAPI.memberJoinActivity(jsonData); | |||
this.userAutoActivityJson = jsonData; | |||
if (response.isSuccess == true) { | |||
this.userAutoActivityJson = JSON.parse(JSON.stringify(jsonData)); | |||
this.autoActivityList = response.data; | |||
} | |||
}, | |||
//加价换购 | |||
async onPriceForPurchase() { | |||
const jsonData = { | |||
"current": 1, | |||
"pageSize": 1, | |||
"activityType": 8, | |||
} | |||
const response = await activityAPI.queryShowActivityInfo(jsonData); | |||
if (response.isSuccess == true) { | |||
this.exchangeRes = response.data[0]; | |||
const stageArray = response.data[0].stage; | |||
this.foodArray.forEach(foodType => { | |||
stageArray.forEach(stageItem => { | |||
let tempFood = foodType.foods?.find(foodItem => stageItem.rewardValue === foodItem.id); | |||
if (tempFood) { | |||
const resultFood = JSON.parse(JSON.stringify(tempFood)); | |||
resultFood.count = 0; | |||
resultFood.discountPrice = Number.parseFloat(stageItem.stageValue); | |||
this.exchangeList.push(resultFood); | |||
} | |||
}); | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
}, | |||
//超值选购-1 | |||
onExchangeReduce(goods) { | |||
goods.count -= 1; | |||
store.commit('deleteUserExchangePriceJson', goods); | |||
}, | |||
//超值选购+1 | |||
async onExchangePlus(goods) { | |||
if (goods.count >= 1) return; | |||
const changeJson = { | |||
"goodsId": goods.id, | |||
"activitieId": this.exchangeRes.id, | |||
"memberInfoId": this.memberInfo.memberInfo_Id, | |||
"parameter": { | |||
"goodsId": [], | |||
"storeId": store.state.currentStore.id, | |||
"stage": goods.discountPrice, | |||
"totalPrice": this.shopCartTotalPrice | |||
}, | |||
"type": 8, | |||
"isParticipate": false | |||
} | |||
const response = await activityAPI.memberJoinActivity(changeJson); | |||
if (response.isSuccess == true) { | |||
goods.count += 1; | |||
store.commit('inserUserExchangePriceJson', JSON.parse(JSON.stringify(changeJson))); | |||
} else { | |||
uni.showToast({ | |||
title: response.msg || '换购失败,请稍后重试', | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.confirm-order-container { | |||
padding: 20rpx 20rpx 150rpx 20rpx; | |||
font-size: 28rpx; | |||
@@ -594,7 +718,7 @@ | |||
.dining-info-item .iconfont { | |||
font-size: 30rpx; | |||
margin-right: 20rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
padding: 15rpx; | |||
border-radius: 50%; | |||
color: #FFF; | |||
@@ -602,8 +726,8 @@ | |||
.dining-info-style { | |||
display: flex; | |||
border: 2rpx solid #51A97D; | |||
color: #51A97D; | |||
border: 2rpx solid $theme-color; | |||
color: $theme-color; | |||
border-radius: 10rpx; | |||
margin: 20rpx 0; | |||
} | |||
@@ -616,11 +740,11 @@ | |||
} | |||
.dining-style-item:first-child { | |||
border-right: 2rpx solid #51A97D; | |||
border-right: 2rpx solid $theme-color; | |||
} | |||
.dining-info-style .selected { | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
} | |||
@@ -643,8 +767,8 @@ | |||
} | |||
.order-green-btn { | |||
color: #51A97D; | |||
border: 2rpx solid #51A97D; | |||
color: $theme-color; | |||
border: 2rpx solid $theme-color; | |||
padding: 5rpx 20rpx; | |||
border-radius: 30rpx; | |||
} | |||
@@ -769,12 +893,13 @@ | |||
align-items: center; | |||
justify-content: space-between; | |||
flex-shrink: 0; | |||
width: 130rpx; | |||
width: 150rpx; | |||
font-size: 32rpx; | |||
} | |||
.value-exchange-count .iconfont { | |||
font-size: 40rpx; | |||
font-size: 50rpx; | |||
color: $theme-color; | |||
} | |||
.exchange-goos-compant { | |||
@@ -810,7 +935,7 @@ | |||
} | |||
.order-info-discount .order-info-suffix { | |||
color: #51A97D; | |||
color: $theme-color; | |||
font-size: 38rpx; | |||
} | |||
@@ -855,11 +980,11 @@ | |||
font-size: 36rpx; | |||
font-weight: 700; | |||
font-family: fangsong; | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.still-need-btn { | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
padding: 25rpx 80rpx; | |||
border-radius: 50rpx; | |||
@@ -888,7 +1013,7 @@ | |||
} | |||
.remark-sure-btn { | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
@@ -920,8 +1045,8 @@ | |||
} | |||
.discount-type-switch .selected { | |||
color: #51A97D; | |||
border-color: #51A97D; | |||
color: $theme-color; | |||
border-color: $theme-color; | |||
} | |||
.discount-type-item { | |||
@@ -975,4 +1100,8 @@ | |||
color: #999; | |||
margin-top: 5rpx; | |||
} | |||
.add-disable-btn { | |||
color: #999 !important; | |||
} | |||
</style> |
@@ -1,7 +1,7 @@ | |||
<template> | |||
<view class="coupon-container"> | |||
<view class="coupon-navbar-list"> | |||
<view v-for="(item, index) in couponNavbar.list" :class="{'coupon-navbar-item': true, 'selected': couponNavbar.navbarIndex === index}" @click="onCouponNavbarChange(index)"> | |||
<view v-for="(item, index) in couponNavbar.list" :key="index" :class="{'coupon-navbar-item': true, 'selected': couponNavbar.navbarIndex === index}" @click="onCouponNavbarChange(index)"> | |||
{{item}} | |||
</view> | |||
</view> | |||
@@ -36,7 +36,7 @@ | |||
imageServer: getApp().globalData.imageServer, | |||
couponNavbar: { | |||
navbarIndex: 0, | |||
list: ['未使用', '已使用', '已过期', '已赠送'] | |||
list: ['未使用', '已使用', '已过期'] | |||
}, | |||
couponScanCode: '', //扫码获取的优惠券ID | |||
memberInfo: {}, //会员信息 | |||
@@ -209,7 +209,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.coupon-container { | |||
display: flex; | |||
flex-direction: column; | |||
@@ -219,7 +219,7 @@ | |||
.coupon-navbar-content { | |||
flex-grow: 1; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
padding: 20rpx 0; | |||
display: flex; | |||
overflow: hidden; | |||
@@ -241,7 +241,7 @@ | |||
} | |||
.coupon-navbar-list .selected { | |||
color: #51a97d; | |||
color: $theme-color; | |||
} | |||
.coupon-navbar-list .selected::before { | |||
@@ -253,7 +253,7 @@ | |||
width: 10rpx; | |||
height: 10rpx; | |||
border-radius: 50%; | |||
background-color: #51a97d; | |||
background-color: $theme-color; | |||
} | |||
.coupon-navbar-item { | |||
@@ -267,7 +267,7 @@ | |||
left: 50%; | |||
transform: translateX(-50%); | |||
width: 0; | |||
border-bottom: 20rpx solid #51a97d; | |||
border-bottom: 20rpx solid $theme-color; | |||
border-left: 20rpx solid transparent; | |||
border-right: 20rpx solid transparent; | |||
} | |||
@@ -287,8 +287,8 @@ | |||
display: flex; | |||
align-items: center; | |||
justify-content: space-around; | |||
border: 2rpx solid #51A97D; | |||
color: #51A97D; | |||
border: 2rpx solid $theme-color; | |||
color: $theme-color; | |||
width: 650rpx; | |||
height: 80rpx; | |||
border-radius: 10rpx; | |||
@@ -29,16 +29,16 @@ | |||
<view class="usage-rules-item"> | |||
本券可在00:00-23:59时段使用 | |||
</view> | |||
<view class="usage-rules-item"> | |||
<view class="usage-rules-item" v-if="false"> | |||
仅限周一、周二、周三、周四、周五、周六、周日可用 | |||
</view> | |||
<view class="usage-rules-item"> | |||
本券适用于堂食、自提的订单,本券支持线上、线下使用 | |||
</view> | |||
<view class="usage-rules-item"> | |||
<view class="usage-rules-item" v-if="false"> | |||
本券适用于XXXXXXXXXXXXXXXXXXXXXXXXXXXX | |||
</view> | |||
<view class="usage-rules-item"> | |||
<view class="usage-rules-item" v-if="false"> | |||
本券可与其他优惠券同享 | |||
</view> | |||
</view> | |||
@@ -46,7 +46,7 @@ | |||
<view class="usage-rules-title"> | |||
活动详情 | |||
</view> | |||
<view class="usage-rules-item"> | |||
<view class="usage-rules-item usage-rules-item-red"> | |||
{{couponInfo.conditionStr}} | |||
</view> | |||
<view class="usage-rules-item"> | |||
@@ -78,7 +78,7 @@ | |||
{{store.store_Addr ? store.store_Addr : '暂无地址'}} | |||
</view> | |||
<view class="address-distance"> | |||
{{onShowDistance(store.store_Loc)}}km | |||
{{JSON.stringify(onShowDistance(store.store_Loc))}}km | |||
</view> | |||
</view> | |||
</view> | |||
@@ -162,39 +162,15 @@ | |||
} | |||
}, | |||
onShowDistance(location) { | |||
let userToStoreDistance = 9999; | |||
if (location != null) { | |||
let locArray = location.split(','); | |||
if (getApp().globalData.userLocation.latitude == null || | |||
getApp().globalData.userLocation.longitude == null | |||
) { | |||
uni.getLocation({ | |||
type: 'wgs84', | |||
success: (res) => { | |||
getApp().globalData.userLocation.latitude = res.latitude; | |||
getApp().globalData.userLocation.longitude = res.longitude; | |||
}, | |||
complete: () => { | |||
userToStoreDistance = getApp().distance(getApp().globalData.userLocation.latitude, getApp().globalData.userLocation.longitude , Number.parseFloat(locArray[1]) , Number.parseFloat(locArray[0])); | |||
} | |||
}); | |||
} else { | |||
userToStoreDistance = getApp().distance(getApp().globalData.userLocation.latitude, getApp().globalData.userLocation.longitude , Number.parseFloat(locArray[1]) , Number.parseFloat(locArray[0])); | |||
} | |||
} | |||
userToStoreDistance = Number.parseFloat(userToStoreDistance); | |||
if (Number.isNaN(userToStoreDistance)) { | |||
userToStoreDistance = 9999; | |||
} | |||
return userToStoreDistance; | |||
return getApp().onShowDistance(location); | |||
} | |||
}, | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.coupon-detail-container { | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
min-height: 100vh; | |||
padding: 30rpx; | |||
} | |||
@@ -235,7 +211,7 @@ | |||
content: ''; | |||
top: -50rpx; | |||
left: -170rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
@@ -247,7 +223,7 @@ | |||
content: ''; | |||
top: -50rpx; | |||
right: -170rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
@@ -283,7 +259,7 @@ | |||
content: ''; | |||
top: -75rpx; | |||
left: -55rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
@@ -295,7 +271,7 @@ | |||
content: ''; | |||
top: -75rpx; | |||
right: -55rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
@@ -314,6 +290,10 @@ | |||
margin-left: 25rpx; | |||
} | |||
.usage-rules-item-red { | |||
color: #F84352; | |||
} | |||
.usage-rules-item::before { | |||
position: absolute; | |||
top: 50%; | |||
@@ -10,7 +10,7 @@ | |||
</view> | |||
<view class="coupon-use-all-choose" v-if="false"> | |||
<u-checkbox-group @change="onCheckboxAll"> | |||
<u-checkbox name="selectAll" shape="circle" activeColor="#51A97D"></u-checkbox> | |||
<u-checkbox name="selectAll" shape="circle" activeColor="$theme-color"></u-checkbox> | |||
</u-checkbox-group> | |||
</view> | |||
</view> | |||
@@ -90,21 +90,23 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.coupon-navbar-content { | |||
flex-grow: 1; | |||
background-color: #51A97D; | |||
height: 1px; | |||
background-color: $theme-color; | |||
overflow: hidden; | |||
} | |||
.coupon-use-container { | |||
display: flex; | |||
flex-direction: column; | |||
min-height: 100vh; | |||
background-color: #51A97D; | |||
height: 100vh; | |||
background-color: $theme-color; | |||
overflow: hidden; | |||
} | |||
.coupon-use-head { | |||
flex-shrink: 0; | |||
display: flex; | |||
align-items: center; | |||
height: 100rpx; | |||
@@ -148,6 +150,7 @@ | |||
} | |||
.coupon-choosed-info { | |||
flex-shrink: 0; | |||
position: sticky; | |||
bottom: 0; | |||
background-color: #FFF; | |||
@@ -162,7 +165,7 @@ | |||
} | |||
.coupon-choosed-btn { | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
padding: 20rpx 75rpx; | |||
border-radius: 100rpx; | |||
@@ -209,9 +209,9 @@ | |||
} | |||
.good-bad-iconitem { | |||
color: #51A97D; | |||
color: #305936; | |||
padding: 5rpx 15rpx; | |||
border: 2rpx solid #51a97d; | |||
border: 2rpx solid #305936; | |||
border-radius: 20rpx; | |||
margin-left: 10rpx; | |||
} | |||
@@ -224,7 +224,7 @@ | |||
color: #FFF; | |||
margin: 0 auto 20rpx auto; | |||
border-radius: 10rpx; | |||
background-color: #51A97D; | |||
background-color: #305936; | |||
font-size: 32rpx; | |||
} | |||
@@ -24,7 +24,7 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<GoodsList ref="goodsListRef" class="goods-list-box" v-if="foodArray.length > 0"></GoodsList> | |||
<GoodsList ref="goodsListRef" class="goods-list-box" :adverList="adverList" v-if="foodArray.length > 0"></GoodsList> | |||
<view class="food-list-box food-list-box-empty" v-else> | |||
<view class="food-empty-image"> | |||
<image :src="imageServer.concat('5d404162-0cae-41df-9a91-51eda578d60b.png')" class="image-common-cover"></image> | |||
@@ -52,7 +52,11 @@ | |||
isScanShow: false, | |||
isInnerDistance: false, | |||
isShowLoactionAuth: false, | |||
friendShare: {} | |||
friendShare: {}, | |||
adverList: [ | |||
'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/applet/133059528564315622.png', | |||
'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/applet/133059528580064561.png' | |||
] | |||
} | |||
}, | |||
onLoad(options) { | |||
@@ -68,6 +72,7 @@ | |||
if (!this.isScanShow) { | |||
this.onGetUserLocation(); | |||
} | |||
this.onFetchStoreStyles(); | |||
}, | |||
onHide() { | |||
if(this.$refs.goodsListRef) { | |||
@@ -76,7 +81,7 @@ | |||
}, | |||
computed: { | |||
...mapState([ | |||
'foodArray', 'currentStore', 'lastCurrentStore', 'codeScanInfo', 'currentGoods' | |||
'foodArray', 'currentStore', 'lastCurrentStore', 'codeScanInfo', 'currentGoods', 'storeStyles' | |||
]) | |||
}, | |||
onShareAppMessage() { | |||
@@ -138,326 +143,6 @@ | |||
food.shopCartNumber = 0; | |||
}); | |||
}); | |||
//套餐 模拟JSON数据 | |||
const foodTypeItem = { | |||
id: 'f697317d-e715-430d-8703-65b805520220428', | |||
name: '爆款!单人套餐', | |||
sort: 0, | |||
coverUrl: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png', | |||
foods: [ | |||
{ | |||
addtoFoodList: [], | |||
company: '套', | |||
cover: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png', | |||
id: '920b6b5b-b612-4f70-903e-a6627920220428', | |||
name: '立减套餐!咖啡鸡排面,咖啡+奶茶(饮品二选一)', | |||
price: 44, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 32, | |||
shopCartNumber: 0, | |||
setMealList: [ | |||
{ | |||
id: 'f697317d-e715-430d-8703-65b805520220428', | |||
name: '立减套餐!咖啡鸡排面,咖啡+奶茶(饮品二选一)', | |||
sort: 0, | |||
coverUrl: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png', | |||
foods: [ | |||
{ | |||
company: '份', | |||
cover: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png', | |||
id: '920b6b5b-b612-abcd-903e-a6627920220428', | |||
name: '泰式咖啡鸡排面(咖喱与鸡的完美搭配)', | |||
price: 32, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 24, | |||
mandatory: true, //是否必选 | |||
singleChoice: true, //是否单选 | |||
} | |||
] | |||
}, | |||
{ | |||
id: 'f697317d-1111-430d-8703-65b805520220428', | |||
name: '奶茶二选一', | |||
sort: 0, | |||
coverUrl: null, | |||
foods: [ | |||
{ | |||
company: '杯', | |||
cover: 'http://res.hualala.com/basicdoc/c2bdda52-99d0-4c3e-9b91-7e9cfce7ca9e.png?x-oss-process=image/resize,limit_0,m_fill,h_300,w_300', | |||
id: '920b6b5b-1234-abcd-903e-a6627920220428', | |||
name: '金瓜波波奶茶(香糯南瓜泥+芋圆珍珠、醇香茶汤,杯杯有料超满足)', | |||
price: 20, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
mandatory: false, //是否必选 | |||
singleChoice: true, //是否单选 | |||
specification: [ //选规格 | |||
{ | |||
id: 'f697317d-fn15-430d-8703-65b805520220428', | |||
name: '分量', | |||
sort: 0, | |||
coverUrl: '', | |||
mandatory: true, //是否必选 | |||
singleChoice: true, //是否单选 | |||
foods: [ | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-gg34-abcd-903e-a6627920220428', | |||
name: '+冰淇淋(限冷饮)', | |||
price: 20, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-gg35-abcd-903e-a6627920220428', | |||
name: '+芋圆', | |||
price: 21, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-gg36-abcd-903e-a6627920220428', | |||
name: '+椰奶冻', | |||
price: 22, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
} | |||
] | |||
}, | |||
{ | |||
id: 'f697317d-td15-430d-8703-65b805520220428', | |||
name: '糖度', | |||
sort: 0, | |||
coverUrl: '', | |||
mandatory: true, //是否必选 | |||
singleChoice: false, //是否单选 | |||
foods: [ | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-td34-abcd-903e-a6627920220428', | |||
name: '三分糖', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-td35-abcd-903e-a6627920220428', | |||
name: '五分糖', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-td36-abcd-903e-a6627920220428', | |||
name: '全糖', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
} | |||
] | |||
}, | |||
{ | |||
id: 'f697317d-jd15-430d-8703-65b805520220428', | |||
name: '可选基底', | |||
sort: 0, | |||
coverUrl: '', | |||
mandatory: true, //是否必选 | |||
singleChoice: true, //是否单选 | |||
foods: [ | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-jd34-abcd-903e-a6627920220428', | |||
name: '阿萨姆红茶', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-jd35-abcd-903e-a6627920220428', | |||
name: '茉莉绿茶', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-jd36-abcd-903e-a6627920220428', | |||
name: '清香乌龙茶', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
} | |||
] | |||
} | |||
] | |||
}, | |||
{ | |||
company: '杯', | |||
cover: 'http://res.hualala.com/basicdoc/3b2a9516-3a24-4400-ab3c-9540b42f97ed.png?x-oss-process=image/resize,limit_0,m_fill,h_300,w_300', | |||
id: '920b6b5b-1222-abcd-903e-a6627920220428', | |||
name: '栗栗波波奶茶(香糯板栗配珍珠芋圆,口感醇厚茶汤,杯杯有料超满足)', | |||
price: 20, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
mandatory: false, //是否必选 | |||
singleChoice: true, //是否单选 | |||
specification: [ //选规格 | |||
{ | |||
id: 'f697317d-fb15-430d-8703-65b805520220428', | |||
name: '分量', | |||
sort: 0, | |||
coverUrl: '', | |||
mandatory: true, //是否必选 | |||
singleChoice: true, //是否单选 | |||
foods: [ | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-gg34-abcd-903e-a6627920220428', | |||
name: '+冰淇淋(限冷饮)', | |||
price: 20, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-gg35-abcd-903e-a6627920220428', | |||
name: '+芋圆', | |||
price: 21, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-gg36-abcd-903e-a6627920220428', | |||
name: '+椰奶冻', | |||
price: 22, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 14, | |||
} | |||
] | |||
}, | |||
{ | |||
id: 'f697317d-gg15-430d-8703-65b805520220428', | |||
name: '糖度', | |||
sort: 0, | |||
coverUrl: '', | |||
mandatory: true, //是否必选 | |||
singleChoice: true, //是否单选 | |||
foods: [ | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-td34-abcd-903e-a6627920220428', | |||
name: '三分糖', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-td35-abcd-903e-a6627920220428', | |||
name: '五分糖', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-td36-abcd-903e-a6627920220428', | |||
name: '全糖', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
} | |||
] | |||
}, | |||
{ | |||
id: 'f697317d-jd15-430d-8703-65b805520220428', | |||
name: '可选基底', | |||
sort: 0, | |||
coverUrl: '', | |||
mandatory: true, //是否必选 | |||
singleChoice: true, //是否单选 | |||
foods: [ | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-jd34-abcd-903e-a6627920220428', | |||
name: '阿萨姆红茶', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-jd35-abcd-903e-a6627920220428', | |||
name: '茉莉绿茶', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
}, | |||
{ | |||
company: '份', | |||
cover: '', | |||
id: '920b6b5b-jd36-abcd-903e-a6627920220428', | |||
name: '清香乌龙茶', | |||
price: 0, | |||
sort: 0, | |||
state: 1, | |||
vipPrice: 0, | |||
} | |||
] | |||
} | |||
] | |||
}, | |||
] | |||
}, | |||
] | |||
} | |||
] | |||
} | |||
foodTypes.unshift(foodTypeItem); | |||
store.commit('initFoodArray', foodTypes); | |||
setTimeout(() => { | |||
this.$refs.goodsListRef.getNodeInfo(); | |||
@@ -588,12 +273,19 @@ | |||
this.$refs.goodsListRef.onChooseFood(shareFood); | |||
} | |||
} | |||
}, | |||
//获取页面风格 | |||
onFetchStoreStyles() { | |||
const findStyles = this.storeStyles.find(item => item.pageRoute === '/food'); | |||
if (findStyles) { | |||
this.adverList = JSON.parse(findStyles.list[0].materialPath); | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.food-container { | |||
display: flex; | |||
height: 100vh; | |||
@@ -680,7 +372,7 @@ | |||
font-size: 32rpx; | |||
border-radius: 10rpx; | |||
color: #FFF; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
} | |||
.food-empty-image { | |||
@@ -9,7 +9,7 @@ | |||
radius="0" | |||
></u-swiper> | |||
<view class="gift-card-text"> | |||
您可以通过礼品卡的形式将您的优惠券,附上且时且多给您定制的精美卡片,送给好友。 | |||
您可以通过礼品卡的形式将您的优惠券,附上给您定制的精美卡片,送给好友。 | |||
</view> | |||
<view class="gift-send-btn"> | |||
给好友送礼品卡 | |||
@@ -34,7 +34,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.gift-card-text { | |||
margin: 40rpx 60rpx; | |||
font-size: 26rpx; | |||
@@ -47,7 +47,7 @@ | |||
height: 70rpx; | |||
text-align: center; | |||
line-height: 70rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
margin: 50rpx auto; | |||
border-radius: 50rpx; | |||
@@ -50,13 +50,13 @@ | |||
</view> | |||
<icon class="iconfont icon-guanbi activity-popuo-close" @click="onSwitchActivityPopup(false)"></icon> | |||
</u-popup> | |||
<button @click="onNowChange" v-if="consumptionQuantity >= 10" class="now-change-btn" type="default">立即兑换</button> | |||
<button @click="onNowChange" v-if="consumptionQuantity >= activityInfo.stage[0].stageValue" class="now-change-btn" type="default">立即兑换</button> | |||
<view class="encourage-card"> | |||
<view class="encourage-text-item" v-if="consumptionQuantity >= 10"> | |||
您还可以兑换<text class="encourage-number">{{Math.floor(consumptionQuantity / 10)}}</text>碗面 | |||
<view class="encourage-text-item" v-if="consumptionQuantity >= activityInfo.stage[0].stageValue"> | |||
您还可以兑换<text class="encourage-number">{{Math.floor(consumptionQuantity / activityInfo.stage[0].stageValue) || 0}}</text>碗面 | |||
</view> | |||
<view class="encourage-text-item" v-else> | |||
还差<text class="encourage-number">{{10 - consumptionQuantity}}</text>碗就能兑换优惠券啦~ | |||
还差<text class="encourage-number">{{activityInfo.stage[0].stageValue - consumptionQuantity || 0}}</text>碗就能兑换优惠券啦~ | |||
</view> | |||
</view> | |||
</view> | |||
@@ -69,13 +69,20 @@ | |||
return { | |||
imageServer: getApp().globalData.imageServer, | |||
consumptionQuantity: 0, | |||
proprotionNumber: 0, //满n次可以换一个优惠券 | |||
isShowActivity: false, | |||
activityInfo: { | |||
activityName: '', | |||
activityStartTime: '', | |||
activityEndTime: '', | |||
activityRule: '', | |||
remark: '' | |||
remark: '', | |||
stage: [ | |||
{ | |||
rewardValue: '', | |||
stageValue: 0 | |||
} | |||
] | |||
} | |||
} | |||
}, | |||
@@ -86,16 +93,21 @@ | |||
//获取循环消费数据 | |||
async onGetCircularConsumptionData() { | |||
const user = getApp().onGetUserStorage(); | |||
const jsonData = { | |||
"current": 1, | |||
"pageSize": 100, | |||
"activityType": 7, | |||
"memberId": user.memberInfo_Id | |||
}; | |||
const response = await activityAPI.queryShowActivityInfo(jsonData); | |||
if (response.isSuccess == true) { | |||
this.consumptionQuantity = response.data[0].progress; | |||
this.activityInfo = response.data[0]; | |||
if (user.memberInfo_Id) { | |||
const jsonData = { | |||
"current": 1, | |||
"pageSize": 100, | |||
"activityType": 7, | |||
"memberId": user.memberInfo_Id | |||
}; | |||
const response = await activityAPI.queryShowActivityInfo(jsonData); | |||
if (response.isSuccess == true) { | |||
const findActive = response.data.find(item => item.consumptionType == 1); | |||
if (findActive) { | |||
this.activityInfo = findActive; | |||
this.consumptionQuantity = findActive.progress; | |||
} | |||
} | |||
} | |||
}, | |||
onSwitchActivityPopup(isShow) { | |||
@@ -110,7 +122,7 @@ | |||
"goodsId": [], | |||
"storeId": "", | |||
"stage": this.activityInfo.stage[0].stageValue, | |||
"totalPrice": 0 | |||
"totalPrice": 1000000 | |||
}, | |||
"type": this.activityInfo.activityType, | |||
"isParticipate": true | |||
@@ -130,7 +142,7 @@ | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: response.data.msg || '兑换失败', | |||
title: response.msg || '兑换失败', | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
@@ -141,7 +153,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.give-noodle-container { | |||
position: relative; | |||
width: 100vw; | |||
@@ -201,7 +213,7 @@ | |||
bottom: 300rpx; | |||
right: 150rpx; | |||
border: none; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
padding: 0 40rpx; | |||
font-size: 32rpx; | |||
@@ -464,7 +464,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.home-container { | |||
display: flex; | |||
flex-direction: column; | |||
@@ -3,11 +3,8 @@ | |||
<!-- 顶部轮播图 --> | |||
<view class="home-head-swiper"> | |||
<swiper class="swiper" :indicator-dots="true" :autoplay="true"> | |||
<swiper-item class="swiper-item"> | |||
<image :lazy-load="true" class="image-common-cover" :src="imageServer.concat('2c8a9a8b-a055-4876-b6b6-6ca455481523.jpg')"></image> | |||
</swiper-item> | |||
<swiper-item class="swiper-item"> | |||
<image :lazy-load="true" class="image-common-cover" :src="imageServer.concat('2e853e12-4b5d-4360-8e7d-343a038ec6bc.jpg')"></image> | |||
<swiper-item class="swiper-item" v-for="(item, index) in carouselList" :key="index"> | |||
<image :lazy-load="true" class="image-common-cover" :src="item"></image> | |||
</swiper-item> | |||
</swiper> | |||
</view> | |||
@@ -19,20 +16,20 @@ | |||
<!-- 加入会员 --> | |||
<view class="click-member" @click="onJumpRegisterMember"></view> | |||
<!-- 签到 --> | |||
<view class="click-sign-in" @click="onJumpSign"></view> | |||
<view class="click-sign-in"></view> | |||
<!-- 新品体验 --> | |||
<view class="click-new-product" @click="onJumpNewProduct"></view> | |||
<view class="click-new-product"></view> | |||
<!-- 好友分享 --> | |||
<view class="click-share-friend" @click="onJumpFriendShare"></view> | |||
<view class="click-share-friend"></view> | |||
<!-- 积碗换面 --> | |||
<view class="click-noodles" @click="onJumpNoodle"></view> | |||
<view class="noodles-icon-list" @click="onJumpNoodle"> | |||
<view :class="{'noodles-icon-item': true, 'noodles-icon-food': item <= circularInfo.progress}" v-for="item in 12" :key="item"></view> | |||
<view :class="{'noodles-icon-item': true, 'noodles-icon-food': item < circularInfo.progress}" v-for="item in 12" :key="item"></view> | |||
</view> | |||
<!-- 积杯换饮 --> | |||
<view class="click-drinks" @click="onJumpDrink"></view> | |||
<view class="drinks-icon-list" @click="onJumpDrink"> | |||
<view class="drinks-icon-item" v-for="item in 12" :key="item"></view> | |||
<view :class="{'drinks-icon-item': true, 'drinks-icon-full': item < drinkInfo.progress}" v-for="item in 12" :key="item"></view> | |||
</view> | |||
</view> | |||
<!-- 活动列表弹窗 --> | |||
@@ -66,6 +63,7 @@ | |||
</template> | |||
<script> | |||
import { mapState } from 'vuex'; | |||
import activityAPI from "@/api/activity.js"; | |||
import memberAPI from "@/api/member.js"; | |||
import store from "@/store/index.js"; | |||
@@ -74,27 +72,39 @@ | |||
data() { | |||
return { | |||
imageServer: getApp().globalData.imageServer, | |||
memberInfo: {}, //会员信息 | |||
circularInfo: {}, //循环消费信息 | |||
isShowActivity: false, //是否显示活动列表弹窗 | |||
activityList: [] | |||
memberInfo: {}, //会员信息 | |||
circularInfo: {}, //循环消费信息 | |||
isShowActivity: false, //是否显示活动列表弹窗 | |||
activityList: [], | |||
drinkInfo: {}, //积杯换饮 | |||
carouselList: [ | |||
'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/goods/133058072111585205.jpg', | |||
'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/goods/133058072178578510.jpg' | |||
] | |||
} | |||
}, | |||
computed: { | |||
...mapState([ | |||
'storeStyles', | |||
'currentStore' | |||
]) | |||
}, | |||
onShow() { | |||
this.onFetchUserInfo(); | |||
this.onFetchStoreStyles(); | |||
}, | |||
created() { | |||
this.onFetchActivityData(); | |||
}, | |||
onShareAppMessage() { | |||
return { | |||
title: '且时且多', | |||
title: this.currentStore.store_Name || '黑菠萝科技点餐小程序', | |||
path: '/pages/welcome/welcome', | |||
} | |||
}, | |||
onShareTimeline() { | |||
return { | |||
title: '且时且多', | |||
title: this.currentStore.store_Name || '黑菠萝科技点餐小程序', | |||
path: '/pages/welcome/welcome', | |||
} | |||
}, | |||
@@ -106,19 +116,42 @@ | |||
}, | |||
onJumpTakeOut() { | |||
uni.navigateTo({ | |||
url: '/pages/underDevelopment/underDevelopment' | |||
url: '/pages/position/position' | |||
}); | |||
}, | |||
//跳转注册会员 | |||
onJumpRegisterMember: debounce(function() { | |||
getApp().onCheckUserSession().then( async (response) => { | |||
const userStorage = getApp().onGetUserStorage(); | |||
let memberRes = await memberAPI.selectMemberByOpenId(userStorage.openId); | |||
if (memberRes.data.memberInfo_Id != null && memberRes.data.phone != null) { | |||
this.memberInfo = memberRes.data; | |||
uni.navigateTo({ | |||
url: '/pages/memberCardDetail/memberCardDetail' | |||
}); | |||
if (userStorage) { | |||
if (!userStorage.memberInfo_Id) { | |||
let memberRes = await memberAPI.selectMemberByOpenId(userStorage.openId); | |||
if (memberRes.isSuccess) { | |||
if (memberRes.data.memberInfo_Id != null && memberRes.data.phone != null) { | |||
this.memberInfo = memberRes.data; | |||
uni.navigateTo({ | |||
url: '/pages/memberCardDetail/memberCardDetail' | |||
}); | |||
} else { | |||
uni.navigateTo({ | |||
url: '/pages/memberRegister/memberRegister' | |||
}); | |||
} | |||
} else { | |||
uni.showToast({ | |||
title: memberRes.msg || '服务端出错!', | |||
duration: 2000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} else { | |||
this.memberInfo = userStorage; | |||
uni.navigateTo({ | |||
url: '/pages/memberCardDetail/memberCardDetail' | |||
}); | |||
} | |||
} else { | |||
uni.navigateTo({ | |||
url: '/pages/memberRegister/memberRegister' | |||
@@ -144,16 +177,32 @@ | |||
//跳转积碗换面 | |||
onJumpNoodle: debounce (function() { | |||
getApp().onCheckUserSession('giveNoodle').then(() => { | |||
uni.navigateTo({ | |||
url:'/pages/giveNoodle/giveNoodle' | |||
}); | |||
}) | |||
const userStorage = getApp().onGetUserStorage(); | |||
if (userStorage && userStorage.phone) { | |||
uni.navigateTo({ | |||
url:'/pages/giveNoodle/giveNoodle' | |||
}); | |||
} else { | |||
uni.navigateTo({ | |||
url: '/pages/memberRegister/memberRegister' | |||
}); | |||
} | |||
}); | |||
}, 2000, true), | |||
onJumpDrink() { | |||
uni.navigateTo({ | |||
url: '/pages/underDevelopment/underDevelopment' | |||
onJumpDrink: debounce(function() { | |||
getApp().onCheckUserSession('giveDrink').then(() => { | |||
const userStorage = getApp().onGetUserStorage(); | |||
if (userStorage && userStorage.phone) { | |||
uni.navigateTo({ | |||
url:'/pages/giveDrink/giveDrink' | |||
}); | |||
} else { | |||
uni.navigateTo({ | |||
url: '/pages/memberRegister/memberRegister' | |||
}); | |||
} | |||
}); | |||
}, | |||
}), | |||
//获取循环消费数据 | |||
async onGetCircularConsumptionData(memberInfo_Id) { | |||
let jsonData = { | |||
@@ -164,21 +213,28 @@ | |||
}; | |||
const response = await activityAPI.queryShowActivityInfo(jsonData); | |||
if (response.isSuccess == true) { | |||
this.circularInfo = response.data[0]; | |||
response.data.forEach(item => { | |||
//consumptionType:1 积碗换面 2:积杯换饮 | |||
if (item.consumptionType == 1) { | |||
this.circularInfo = item; | |||
} else if (item.consumptionType == 2) { | |||
this.drinkInfo = item; | |||
} | |||
}); | |||
} | |||
}, | |||
//获取会员信息 | |||
onFetchUserInfo() { | |||
const user = getApp().onGetUserStorage(); | |||
this.memberInfo = user; | |||
if (user && user.memberInfo_Id != null) { | |||
if (user && user.memberInfo_Id) { | |||
this.onGetCircularConsumptionData(user.memberInfo_Id ); | |||
} | |||
}, | |||
//获取活动数据 | |||
async onFetchActivityData() { | |||
const user = getApp().onGetUserStorage(); | |||
if (user && user.memberInfo_Id != null) { | |||
if (user && user.memberInfo_Id) { | |||
let jsonData = { | |||
"current": 1, | |||
"pageSize": 2, | |||
@@ -239,11 +295,18 @@ | |||
} | |||
}); | |||
}, | |||
//获取页面风格 | |||
onFetchStoreStyles() { | |||
const findStyles = this.storeStyles.find(item => item.pageRoute === '/homeNew'); | |||
if (findStyles) { | |||
this.carouselList = JSON.parse(findStyles.list[0].materialPath); | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style> | |||
<style scoped lang="scss"> | |||
.home-new-container { | |||
display: flex; | |||
flex-direction: column; | |||
@@ -253,7 +316,7 @@ | |||
.home-body-main { | |||
position: relative; | |||
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/309de33f-f4cb-4bc3-a0be-830aa50f1d9e.jpg'); | |||
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/309de33f-f4cb-4bc3-a0be-830aa50f1d9e.jpg?11'); | |||
background-position: center; | |||
background-repeat: no-repeat; | |||
background-size: contain; | |||
@@ -356,7 +419,7 @@ | |||
} | |||
.noodles-icon-food { | |||
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD//food-bowl.png'); | |||
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/food-bowl.png'); | |||
} | |||
.drinks-icon-list { | |||
@@ -378,6 +441,10 @@ | |||
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/glass-empty.png'); | |||
} | |||
.drinks-icon-full { | |||
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/5d5994dc-2125-4296-be73-b4dde9ef2d63.png'); | |||
} | |||
/* 活动列表弹窗 */ | |||
.activity-card-head { | |||
width: 680rpx; | |||
@@ -119,7 +119,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.login-container { | |||
width: 100vw; | |||
height: 100vh; | |||
@@ -133,7 +133,7 @@ | |||
top: 750rpx; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
border: none; | |||
border-radius: 50rpx; | |||
@@ -149,8 +149,8 @@ | |||
border-radius: 50rpx; | |||
width: 500rpx; | |||
font-size: 36rpx; | |||
border: 2rpx solid #51A97D; | |||
color: #51A97D; | |||
border: 2rpx solid $theme-color; | |||
color: $theme-color; | |||
background-color: #FFF; | |||
} | |||
</style> |
@@ -1,13 +1,13 @@ | |||
<template> | |||
<view class="member-card-detail"> | |||
<view class="member-card-box"> | |||
<view class="member-card-box" :style="{'background-image': 'url(' + backgroundIMG + ')'}"> | |||
<view class="member-card-head"> | |||
<view class="member-card-cover"> | |||
<image :src="memberCard.headImgUrl" class="image-common-cover"></image> | |||
</view> | |||
<view class="member-card-info"> | |||
<view class="member-card-name"> | |||
且时且多会员卡 | |||
会员卡 | |||
</view> | |||
<view class="member-card-time"> | |||
有效期:{{onSubstring(memberCard.createAt)}} ~ 无限期 | |||
@@ -79,15 +79,25 @@ | |||
</template> | |||
<script> | |||
import { mapState } from 'vuex'; | |||
import memberAPI from "@/api/member.js"; | |||
export default { | |||
data() { | |||
return { | |||
imageServer: getApp().globalData.imageServer, | |||
memberCard: {}, | |||
memberIntegral: 0 //会员积分 | |||
memberIntegral: 0 ,//会员积分 | |||
backgroundIMG: 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/applet/133059595622064462.png' | |||
} | |||
}, | |||
computed: { | |||
...mapState([ | |||
'storeStyles' | |||
]) | |||
}, | |||
onShow() { | |||
this.onFetchStoreStyles(); | |||
}, | |||
onLoad() { | |||
this.onFetchMemberInfo(); | |||
}, | |||
@@ -150,18 +160,32 @@ | |||
}); | |||
}, | |||
onSubstring(str) { | |||
return str.substring(0, 10); | |||
if (str) { | |||
return str.substring(0, 10); | |||
} else { | |||
return '' | |||
} | |||
}, | |||
onJumpMemberCardQr() { | |||
uni.navigateTo({ | |||
url: '/pages/memberCardQr/memberCardQr' | |||
}); | |||
}, | |||
//获取页面风格 | |||
onFetchStoreStyles() { | |||
const findStyles = this.storeStyles.find(item => item.pageRoute === '/memberCardDetail'); | |||
if (findStyles) { | |||
const findBack = findStyles.list.find(item => item.materialCode === "member_detail_top_img"); | |||
if (findBack) { | |||
this.backgroundIMG = JSON.parse(findBack.materialPath)[0]; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.member-card-box { | |||
display: flex; | |||
flex-direction: column; | |||
@@ -175,7 +199,7 @@ | |||
box-sizing: border-box; | |||
border-radius: 20rpx; | |||
font-size: 28rpx; | |||
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/b41cb888-3821-4111-9977-e7281761b282.png'); | |||
/* background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/b41cb888-3821-4111-9977-e7281761b282.png'); */ | |||
background-position: center; | |||
background-repeat: no-repeat; | |||
background-size: cover; | |||
@@ -280,8 +304,8 @@ | |||
line-height: 80rpx; | |||
margin: 0 auto; | |||
text-align: center; | |||
border: 2rpx solid #51A97D; | |||
color: #51A97D; | |||
border: 2rpx solid $theme-color; | |||
color: $theme-color; | |||
border-radius: 60rpx; | |||
} | |||
</style> |
@@ -82,7 +82,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.member-cover { | |||
width: 120rpx; | |||
height: 120rpx; | |||
@@ -98,7 +98,7 @@ | |||
.member-card-qr { | |||
min-height: 100vh; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
padding-top: 100rpx; | |||
box-sizing: border-box; | |||
} | |||
@@ -162,7 +162,7 @@ | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
} | |||
.split-line::after { | |||
@@ -174,7 +174,7 @@ | |||
width: 40rpx; | |||
height: 40rpx; | |||
border-radius: 50%; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
} | |||
.member-card-box .iconfont { | |||
@@ -2,7 +2,7 @@ | |||
<view class="register-member-container"> | |||
<view class="regitser-head-background"></view> | |||
<view class="member-card"> | |||
<image :src="imageServer.concat('b5b35fb6-8593-4072-a69e-3c77b64b0c32.png')" class="image-common-cover"></image> | |||
<image :src="backgroundIMG" class="image-common-cover"></image> | |||
</view> | |||
<!-- 尊享权益 --> | |||
<view class="enjoy-card"> | |||
@@ -42,6 +42,17 @@ | |||
</view> | |||
</view> | |||
<view class="member-regis-info"> | |||
<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> | |||
<image class="avatar" :src="userInfo.avatarUrl"></image> | |||
</button> | |||
<view class="member-regis-item"> | |||
<view class="member-regis-prev"> | |||
昵称 | |||
</view> | |||
<view class="member-regis-content member-regis-input"> | |||
<input type="nickname" class="weui-input" placeholder="请输入昵称" v-model="userInfo.nickName"/> | |||
</view> | |||
</view> | |||
<view class="member-regis-item"> | |||
<view class="member-regis-prev"> | |||
电话 | |||
@@ -55,7 +66,7 @@ | |||
<!-- 会员协议 --> | |||
<view class="membership-agreement"> | |||
<u-checkbox-group @change="onCheckboxChange"> | |||
<u-checkbox activeColor="#51a97d" shape="circle" inactiveColor="#999999"></u-checkbox> | |||
<u-checkbox activeColor="#305936" shape="circle" inactiveColor="#999999"></u-checkbox> | |||
</u-checkbox-group> | |||
<text class="agreement-common-text">注册表示同意</text> | |||
<text class="agreement-green-text">会员协议说明</text>, | |||
@@ -69,23 +80,36 @@ | |||
</template> | |||
<script> | |||
import { mapState } from 'vuex'; | |||
import memberAPI from "@/api/member.js"; | |||
import payAPI from "@/api/pay.js"; | |||
import goodsAPI from "@/api/goods"; | |||
import store from '@/store/index.js'; | |||
import COS from "@/utils/cos-wx-sdk-v5"; | |||
export default { | |||
data() { | |||
return { | |||
isAgree: false, | |||
imageServer: getApp().globalData.imageServer, | |||
userInfo: { | |||
avatarUrl: '', | |||
avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', | |||
nickName: '', | |||
openId: '', | |||
session_key: '', | |||
gender: '', | |||
phone: '' | |||
} | |||
}, | |||
backgroundIMG: 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/applet/133059578415645499.png' | |||
} | |||
}, | |||
computed: { | |||
...mapState([ | |||
'storeStyles' | |||
]) | |||
}, | |||
onShow() { | |||
this.onFetchStoreStyles(); | |||
}, | |||
methods: { | |||
onCheckboxChange() { | |||
this.isAgree = !this.isAgree; | |||
@@ -121,47 +145,41 @@ | |||
} else { | |||
const user = getApp().onGetUserStorage(); | |||
if (this.isAgree) { | |||
uni.getUserProfile({ | |||
desc: '用于会员信息展示', | |||
success: (res) => { | |||
this.userInfo.avatarUrl = res.userInfo.avatarUrl; | |||
this.userInfo.nickName = res.userInfo.nickName; | |||
this.userInfo.openId = res.userInfo.openId; | |||
this.userInfo.session_key = res.userInfo.session_key; | |||
}, | |||
complete: async () => { | |||
let registerJson = { | |||
"nickName": this.userInfo.nickName || '默认用户名', | |||
"sex": this.userInfo.gender || 0, | |||
"headImgUrl": this.userInfo.avatarUrl || this.imageServer.concat('1160f23a-d924-4739-9806-156a26494674.png'), | |||
"platformMemberId": this.userInfo.openId || user.openId, | |||
"phone": this.userInfo.phone | |||
} | |||
let registerRes = await memberAPI.insertOrUpdateMember(registerJson); | |||
if (registerRes.isSuccess == true) { | |||
uni.showToast({ | |||
title: '注册成功!', | |||
icon: 'none', | |||
duration: 1500, | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
uni.redirectTo({ | |||
url: '/pages/memberCardDetail/memberCardDetail' | |||
}); | |||
}, 1500); | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: registerRes.msg, | |||
icon: 'none', | |||
duration: 1000, | |||
mask: true | |||
}); | |||
} | |||
let registerJson = { | |||
"nickName": this.userInfo.nickName || '默认用户名', | |||
"sex": user.gender || 0, | |||
"headImgUrl": this.userInfo.avatarUrl || this.imageServer.concat('1160f23a-d924-4739-9806-156a26494674.png'), | |||
"platformMemberId": user.openId, | |||
"phone": this.userInfo.phone | |||
} | |||
let registerRes = await memberAPI.insertOrUpdateMember(registerJson); | |||
if (registerRes.isSuccess == true) { | |||
const findMember = await memberAPI.selectMemberByOpenId(user.openId); | |||
if (findMember.isSuccess == true) { | |||
getApp().onSetUserStorage(findMember.data); | |||
} | |||
}); | |||
store.commit('onChangeUserIsVip', true); | |||
uni.showToast({ | |||
title: '注册成功!', | |||
icon: 'none', | |||
duration: 1500, | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
uni.redirectTo({ | |||
url: '/pages/memberCardDetail/memberCardDetail' | |||
}); | |||
}, 1500); | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: registerRes.msg, | |||
icon: 'none', | |||
duration: 1000, | |||
mask: true | |||
}); | |||
} | |||
} else { | |||
uni.showToast({ | |||
title: '请勾选同意协议', | |||
@@ -171,12 +189,54 @@ | |||
}); | |||
} | |||
} | |||
}, | |||
async onChooseAvatar(userFace) { | |||
this.userInfo.avatarUrl = userFace.detail.avatarUrl; | |||
const ext = userFace.detail.avatarUrl.split('.')[1]; | |||
const response = await goodsAPI.GetCosRequestURL({ directory: "applet", fileExtension: ext, method: "PUT" }); | |||
// 初始化实例 | |||
const cos = new COS({ | |||
SecretId: 'AKIDa4KQIvKUP6bw4ye6JI3a8lCPN7cswnV3', | |||
SecretKey: 'ObaLtCH9nCNPFrFQO7ex2sTqyxlLgnfJ' | |||
}); | |||
cos.postObject({ | |||
Bucket: 'hbl-test-1305371387', | |||
Region: 'ap-chengdu', | |||
Key: '/Franchisee/applet/' + response.seeUrl.split('/applet/')[1], | |||
FilePath: userFace.detail.avatarUrl, | |||
}, (err, data) => { | |||
if (data) { | |||
this.userInfo.avatarUrl = data.headers.location; | |||
} | |||
}); | |||
}, | |||
//获取页面风格 | |||
onFetchStoreStyles() { | |||
const findStyles = this.storeStyles.find(item => item.pageRoute === '/memberRegister'); | |||
if (findStyles) { | |||
const findBack = findStyles.list.find(item => item.materialCode === "register_top_img"); | |||
if (findBack) { | |||
this.backgroundIMG = JSON.parse(findBack.materialPath)[0]; | |||
} | |||
} | |||
}, | |||
getkcard(url, name) { | |||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i') | |||
var r = url.substr(1).match(reg) | |||
if (r != null) { | |||
return r[2] | |||
} | |||
return null; | |||
} | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.register-member-container { | |||
padding-bottom: 40rpx; | |||
} | |||
.regitser-head-background { | |||
background-color: #204432; | |||
height: 320rpx; | |||
@@ -254,14 +314,14 @@ | |||
} | |||
.membership-agreement .agreement-green-text { | |||
color: #51a97d; | |||
color: $theme-color; | |||
} | |||
.member-register-btn { | |||
color: #51a97d; | |||
color: $theme-color; | |||
background-color: transparent; | |||
font-size: 28rpx; | |||
border: 2rpx solid #51a97d; | |||
border: 2rpx solid $theme-color; | |||
border-radius: 20rpx !important; | |||
padding: 0 30rpx; | |||
margin: 0; | |||
@@ -273,11 +333,12 @@ | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
text-align: center; | |||
background-color: #51a97d; | |||
background-color: $theme-color; | |||
margin: 0 auto; | |||
color: #FFF; | |||
border-radius: 50rpx; | |||
margin-top: 40rpx; | |||
margin-bottom: 40rpx; | |||
} | |||
.member-gift-title { | |||
@@ -324,11 +385,30 @@ | |||
justify-content: space-between; | |||
align-items: center; | |||
font-size: 28rpx; | |||
height: 110rpx; | |||
} | |||
.member-regis-info .avatar, .member-regis-info .avatar-wrapper { | |||
width: 120rpx; | |||
height: 120rpx; | |||
object-fit: cover; | |||
padding: 0; | |||
border: none; | |||
margin-bottom: 10rpx; | |||
} | |||
.member-regis-item:last-child { | |||
margin-bottom: 0; | |||
} | |||
.member-regis-content { | |||
flex-grow: 1; | |||
margin-left: 10px; | |||
} | |||
.member-regis-phone { | |||
color: #51a97d; | |||
border: 2rpx solid #51a97d; | |||
color: $theme-color; | |||
border: 2rpx solid $theme-color; | |||
padding: 5rpx 30rpx; | |||
border-radius: 10rpx; | |||
font-size: 28rpx; | |||
@@ -1,7 +1,7 @@ | |||
<template> | |||
<view class="my-container"> | |||
<view class="my-header-cover"> | |||
<image class="image-common-cover" :src="imageServer.concat('74c4db52-ca79-436f-814b-29043a605f60.png')"></image> | |||
<image class="image-common-cover" :src="backgroundIMG"></image> | |||
</view> | |||
<view class="my-face" v-if="user != null"> | |||
<image v-if="user.memberInfo_Id != null" class="image-common-cover" :src="user.headImgUrl"></image> | |||
@@ -34,7 +34,7 @@ | |||
</view> | |||
<view class="member-info-item" @click="onPersonalData"> | |||
<view class="member-info-name gold-color text-overflow-one"> | |||
{{user.nickName ? user.nickName : '且时且多用户'}} | |||
{{user.nickName ? user.nickName : '微信用户'}} | |||
</view> | |||
<view class="member-info-text"> | |||
个人信息 | |||
@@ -63,7 +63,7 @@ | |||
<view class="season-list"> | |||
<view class="season-item" @click="onJumpWebView('https://mp.weixin.qq.com/s/Rk-ucQHnrbdpbp5Q-hN6ig')"> | |||
<view class="season-item-title"> | |||
且时且多,会面早春的一抹黄和绿 | |||
会面早春的一抹黄和绿 | |||
</view> | |||
<view class="season-item-cover"> | |||
<image :src="imageServer.concat('76f19053-6860-40fe-8288-30a44bfd8c53.png')"></image> | |||
@@ -71,7 +71,7 @@ | |||
</view> | |||
<view class="season-item" @click="onJumpWebView('https://mp.weixin.qq.com/s/T8nq5saM_Qm8LCmI7Caq1w')"> | |||
<view class="season-item-title"> | |||
且时且多新品,随春已至~ | |||
新品,随春已至~ | |||
</view> | |||
<view class="season-item-cover"> | |||
<image :src="imageServer.concat('07eef3d9-7422-44e3-b611-24b745064740.png')"></image> | |||
@@ -107,6 +107,7 @@ | |||
</template> | |||
<script> | |||
import { mapState } from 'vuex'; | |||
import memberAPI from "@/api/member.js"; | |||
import { debounce } from "@/utils/DebounceAndThrottle.js"; | |||
export default { | |||
@@ -114,8 +115,14 @@ | |||
return { | |||
imageServer: getApp().globalData.imageServer, | |||
user: null, | |||
backgroundIMG: 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/applet/133059560839997004.png' | |||
} | |||
}, | |||
computed: { | |||
...mapState([ | |||
'storeStyles' | |||
]) | |||
}, | |||
onShow() { | |||
const userStorage = getApp().onGetUserStorage(); | |||
//判断是否有本地缓存 | |||
@@ -135,6 +142,7 @@ | |||
} else { | |||
this.user = null; | |||
} | |||
this.onFetchStoreStyles(); | |||
}, | |||
methods: { | |||
onPersonalData: debounce(function() { | |||
@@ -195,6 +203,16 @@ | |||
uni.navigateTo({ | |||
url: `/pages/myWebView/myWebView?webViewSrc=${src}` | |||
}); | |||
}, | |||
//获取页面风格 | |||
onFetchStoreStyles() { | |||
const findStyles = this.storeStyles.find(item => item.pageRoute === '/my'); | |||
if (findStyles) { | |||
const findBack = findStyles.list.find(item => item.materialCode === "my_background"); | |||
if (findBack) { | |||
this.backgroundIMG = JSON.parse(findBack.materialPath)[0]; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
@@ -58,9 +58,9 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.current-balance { | |||
background-color: #51a97d; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
height: 300rpx; | |||
padding: 20rpx 0 0 50rpx; | |||
@@ -5,7 +5,7 @@ | |||
{{item}} | |||
</view> | |||
</view> | |||
<OrderList class="order-list-compoent" :isMoreData="isMoreData" :orderList="orderInfo" :scrollInfoView="scrollInfoViewAll" v-if="!isLoading" @onCurrentPageAdd="onCurrentPageAdd"></OrderList> | |||
<OrderList class="order-list-compoent" :isRefund="isRefund" :isMoreData="isMoreData" :orderList="orderInfo" :scrollInfoView="scrollInfoViewAll" v-if="!isLoading" @onCurrentPageAdd="onCurrentPageAdd"></OrderList> | |||
</view> | |||
</template> | |||
@@ -27,6 +27,7 @@ | |||
scrollInfoViewAll: '', //scroll-view 锚点 | |||
isLogin: false, //是否登录 | |||
subOrder: -1, //订单类型: -1:全部订单,0:等待制作,1:制作中,2:等待取餐,3:已取餐 | |||
isRefund: false, //是否为退款列表 | |||
} | |||
}, | |||
onShow() { | |||
@@ -38,16 +39,20 @@ | |||
this.onResetData(); | |||
switch(index) { | |||
case 0: | |||
this.subOrder = -1; | |||
this.subOrder = -1; //全部订单 | |||
this.isRefund = false; | |||
break; | |||
case 1: | |||
this.subOrder = 1; | |||
this.subOrder = 1; //制作中 | |||
this.isRefund = false; | |||
break; | |||
case 2: | |||
this.subOrder = 3; | |||
this.subOrder = 3; //已完成 | |||
this.isRefund = false; | |||
break; | |||
case 3: | |||
this.subOrder = -1; | |||
this.isRefund = true; | |||
break; | |||
} | |||
this.onCurrentPageAdd(); | |||
@@ -103,21 +108,23 @@ | |||
"pageSize": this.pageSize, | |||
"pageIndex": this.pageIndex, | |||
"userId": this.user.openId, | |||
"subOrder": this.subOrder | |||
"subOrder": this.subOrder, | |||
"show": false | |||
} | |||
let response; | |||
if (this.currentIndex === 3) { | |||
jsonData.hasSaleAfter = 3; | |||
jsonData.hasSaleAfter = 3 | |||
response = await orderAPI.orderPageQuery(jsonData); | |||
} else { | |||
delete jsonData.hasSaleAfter; | |||
response = await orderAPI.orderPageQuery(jsonData); | |||
} | |||
let response = await orderAPI.orderPageQuery(jsonData); | |||
return response; | |||
}, | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.order-container { | |||
display: flex; | |||
flex-direction: column; | |||
@@ -146,7 +153,7 @@ | |||
position: relative; | |||
font-size: 34rpx; | |||
font-weight: 700; | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.custom-tabs-title-list .selected::after { | |||
@@ -156,7 +163,7 @@ | |||
content: ''; | |||
height: 4rpx; | |||
width: 50rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
transform: translateX(-50%); | |||
} | |||
</style> |
@@ -14,19 +14,23 @@ | |||
{{order.sortId}} | |||
</view> | |||
<view class="meal-code-type-qr" v-else> | |||
<uqrcode ref="uQRCode" :text="orderNumber" :size="125" backgroundColor="#FFFFFF" foregroundColor="#51A97D" /> | |||
<uqrcode ref="uQRCode" :text="orderNumber" :size="125" backgroundColor="#FFFFFF" foregroundColor="#305936" /> | |||
</view> | |||
</view> | |||
<view class="meal-code-remark"> | |||
请留意叫号,到号取餐祝您用餐愉快! | |||
</view> | |||
<view class="after-sale-detail" v-if="order.saleAfterInfo != null"> | |||
<view class="after-sale-detail" v-if="order.saleAfterInfo != null || order.refundStutasStr != '暂无退款信息'"> | |||
<view class="prev-text"> | |||
售后详情 | |||
</view> | |||
<view class="suffix-text"> | |||
<view class="suffix-text" v-if="order.saleAfterInfo.stutasStr"> | |||
<text>{{order.saleAfterInfo.stutasStr}}</text> | |||
<icon class="iconfont icon-you"></icon> | |||
<icon class="iconfont icon-you" v-if="false"></icon> | |||
</view> | |||
<view class="suffix-text" v-if="order.refundStutasStr != '暂无退款信息'"> | |||
<text>{{order.refundStutasStr}}</text> | |||
<icon class="iconfont icon-you" v-if="false"></icon> | |||
</view> | |||
</view> | |||
</view> | |||
@@ -53,9 +57,9 @@ | |||
<image :src="storeInfo.logo" class="image-common-cover"></image> | |||
</view> | |||
<view class="store-name"> | |||
且时且多({{storeInfo.store_Name}}) | |||
({{storeInfo.store_Name}}) | |||
</view> | |||
<icon class="iconfont icon-you"></icon> | |||
<icon class="iconfont icon-you" v-if="false"></icon> | |||
</view> | |||
<view class="product-list"> | |||
<view class="product-item" v-for="(prod, index) in order.orderDetail" :key="prod.id"> | |||
@@ -162,6 +166,7 @@ | |||
</template> | |||
<script> | |||
import payAPI from "@/api/pay.js"; | |||
import orderAPI from "@/api/order.js"; | |||
import goodsAPI from "@/api/goods.js"; | |||
export default { | |||
@@ -181,14 +186,14 @@ | |||
order: {}, | |||
isShowOrderCode: true, | |||
storeInfo: {}, | |||
timer: null | |||
timer: null, | |||
} | |||
}, | |||
computed: { | |||
//整单状态 | |||
onFilterOrderState() { | |||
let statusCode = 100000; | |||
if (this.order.orderDetail != undefined) { | |||
if (this.order.orderDetail) { | |||
this.order.orderDetail.forEach(item => { | |||
if (statusCode > item.order_Status) { | |||
statusCode = item.order_Status; | |||
@@ -213,7 +218,7 @@ | |||
} else { | |||
clearInterval(this.timer); | |||
} | |||
}, 5000); | |||
}, 15000); | |||
}, | |||
//获取完整订单数据 | |||
async onFetchOrderInfo() { | |||
@@ -279,38 +284,83 @@ | |||
}, | |||
//售后/退单 | |||
async onApplyAfterSale() { | |||
let jsonData = { | |||
"reason": "用户主动点击售后", | |||
"isFullApplay": true, | |||
"orderId": this.order.id, | |||
} | |||
let response = await orderAPI.applySaleAfter(jsonData); | |||
if (response.isSuccess == true) { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
this.onFetchOrderInfo(); | |||
}, 1000); | |||
if (this.onFilterOrderState > 0 && this.onFilterOrderState != 99999) { | |||
let jsonData = { | |||
"reason": "用户主动点击售后", | |||
"isFullApplay": true, | |||
"orderId": this.order.id, | |||
} | |||
let response = await orderAPI.applySaleAfter(jsonData); | |||
if (response.isSuccess == true) { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
this.onFetchOrderInfo(); | |||
}, 1000); | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} else if (this.onFilterOrderState == 0 || this.onFilterOrderState == 99999) { | |||
let jsonData = { | |||
"appId": getApp().globalData.appId, | |||
"orderNumberId": this.order.orderNumber | |||
} | |||
const response = await payAPI.wechatrefund(jsonData); | |||
if (response.statusCode == 200 && response.data.res == true) { | |||
let wechatRes = response.data.response; | |||
let jsonData = { | |||
"transactionId": wechatRes.transactionId, | |||
"refundTradeNo": wechatRes.outRefundNo, | |||
"isSuccess": 1, | |||
"refundMomey": wechatRes.refundFee / 100, | |||
"remark": "未制作直接退款" | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: response.msg, | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
const refundRes = await orderAPI.refundrefuc(jsonData); | |||
if (refundRes.isSuccess == true) { | |||
uni.showToast({ | |||
title: '退款成功', | |||
duration: 1000, | |||
icon: 'none', | |||
mask: true, | |||
complete: () => { | |||
setTimeout(() => { | |||
this.onFetchOrderInfo(); | |||
}, 1000); | |||
} | |||
}); | |||
} else { | |||
uni.showToast({ | |||
title: refundRes.msg || '退款出现未知错误', | |||
duration: 2000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} else { | |||
uni.showToast({ | |||
title: response.data.response.errCodeDes || '退款出现未知错误', | |||
duration: 2000, | |||
icon: 'none', | |||
mask: true | |||
}); | |||
} | |||
} | |||
}, | |||
//联系商家 | |||
onContactMerchant() { | |||
return; | |||
uni.makePhoneCall({ | |||
phoneNumber: '1008611' | |||
phoneNumber: this.storeInfo.tel || '028-83222560' | |||
}); | |||
}, | |||
//取消退单 | |||
@@ -339,12 +389,14 @@ | |||
mask: true | |||
}); | |||
} | |||
} | |||
}, | |||
//websocket | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.order-detail-container { | |||
background-color: #f4f4f4; | |||
min-height: 100vh; | |||
@@ -363,7 +415,7 @@ | |||
align-items: center; | |||
justify-content: flex-end; | |||
font-size: 28rpx; | |||
color: #51A97D; | |||
color: $theme-color; | |||
} | |||
.meal-code-switch .iconfont { | |||
@@ -391,7 +443,7 @@ | |||
} | |||
.meal-code-remark { | |||
color: #51A97D; | |||
color: $theme-color; | |||
font-size: 28rpx; | |||
background-color: #c5e1d3; | |||
border-radius: 30rpx; | |||
@@ -421,7 +473,7 @@ | |||
} | |||
.order-status-type { | |||
color: #51A97D; | |||
color: $theme-color; | |||
font-size: 28rpx; | |||
font-weight: 700; | |||
} | |||
@@ -432,8 +484,8 @@ | |||
} | |||
.order-status-evaluate { | |||
color: #51A97D; | |||
border: 2rpx solid #51A97D; | |||
color: $theme-color; | |||
border: 2rpx solid $theme-color; | |||
width: 150rpx; | |||
text-align: center; | |||
height: 50rpx; | |||
@@ -516,7 +568,7 @@ | |||
} | |||
.product-info-price { | |||
color: #51A97D; | |||
color: $theme-color; | |||
font-size: 28rpx; | |||
} | |||
@@ -603,8 +655,8 @@ | |||
} | |||
.order-number-copy { | |||
border: 2rpx solid #51A97D; | |||
color: #51A97D; | |||
border: 2rpx solid $theme-color; | |||
color: $theme-color; | |||
padding: 0 5rpx; | |||
margin-left: 10rpx; | |||
} | |||
@@ -622,8 +674,8 @@ | |||
} | |||
.product-show-0 { | |||
border-color: #51A97D; | |||
color: #51A97D; | |||
border-color: $theme-color; | |||
color: $theme-color; | |||
} | |||
.product-show-1 { | |||
@@ -653,7 +705,7 @@ | |||
height: 80rpx; | |||
color: #FFF; | |||
font-size: 32rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
} | |||
.contact-merchant .iconfont { | |||
@@ -19,13 +19,13 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view class="payment-member-card common-card"> | |||
<view class="payment-member-card common-card" v-if="false"> | |||
<view class="payment-member-head"> | |||
<view class="payment-member-left"> | |||
会员卡支付 | |||
</view> | |||
<view class="payment-member-right"> | |||
<text>且时且多会员卡</text> | |||
<text>门店会员卡</text> | |||
<icon class="iconfont icon-you"></icon> | |||
</view> | |||
</view> | |||
@@ -38,7 +38,7 @@ | |||
共0.00积分,使用0.00,抵扣0.00 | |||
</view> | |||
</view> | |||
<u-switch v-model="paymentType.integralSwitch" activeColor="#51A97D"></u-switch> | |||
<u-switch v-model="paymentType.integralSwitch" activeColor="#305936"></u-switch> | |||
</view> | |||
<view class="member-card-info"> | |||
<view class="member-card-text"> | |||
@@ -49,7 +49,7 @@ | |||
共¥0.00元,使用余额支付¥0.00 | |||
</view> | |||
</view> | |||
<u-switch v-model="paymentType.memberCard" activeColor="#51A97D"></u-switch> | |||
<u-switch v-model="paymentType.memberCard" activeColor="#305936"></u-switch> | |||
</view> | |||
</view> | |||
<button type="default" class="confirm-payment" @click="onConfirmPayment">确定支付¥{{totalPrice.toFixed(2)}}</button> | |||
@@ -85,6 +85,9 @@ | |||
}, | |||
currentStore() { | |||
return store.state.currentStore; | |||
}, | |||
userExchangePriceJson() { | |||
return store.state.userExchangePriceJson; | |||
} | |||
}, | |||
methods: { | |||
@@ -121,12 +124,22 @@ | |||
icon: 'none', | |||
mask: true, | |||
duration: 2000, | |||
complete: () => { | |||
complete: async () => { | |||
store.commit('onClearShopCart'); | |||
let autoActivityJson = store.state.userAutoActivityJson; | |||
if (autoActivityJson != null) { | |||
if (autoActivityJson.memberInfoId) { | |||
autoActivityJson.isParticipate = true; | |||
activityAPI.memberJoinActivity(autoActivityJson); | |||
await activityAPI.memberJoinActivity(autoActivityJson); | |||
store.commit('onClearUserAutoActivityJson'); | |||
} | |||
let userExchangePriceJson = store.state.userExchangePriceJson; | |||
if (userExchangePriceJson.length > 0) { | |||
userExchangePriceJson.forEach(async changeItem => { | |||
delete changeItem.goodsId; | |||
changeItem.isParticipate = true; | |||
await activityAPI.memberJoinActivity(changeItem); | |||
}); | |||
store.commit('clearUserExchangePriceJson'); | |||
} | |||
uni.redirectTo({ | |||
url: `/pages/orderDetail/orderDetail?orderNumber=${this.orderNumber}` | |||
@@ -174,13 +187,12 @@ | |||
}); | |||
} | |||
} | |||
store.commit('onInitUserAutoActivityJson', null); | |||
}, 5000, true), | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.payment-container { | |||
font-size: 32rpx; | |||
width: 100vw; | |||
@@ -272,7 +284,7 @@ | |||
bottom: 50rpx; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
border: none; | |||
border-radius: 50rpx; | |||
@@ -42,7 +42,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.status-bar { | |||
height: var(--status-bar-height); | |||
width: 100%; | |||
@@ -61,7 +61,7 @@ | |||
top: 850rpx; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
border: none; | |||
width: 400rpx; | |||
@@ -10,16 +10,16 @@ | |||
<image :src="memberCard.headImgUrl" class="image-common-cover"></image> | |||
</view> | |||
</view> | |||
<view class="personal-update" @click="onUpdateInfo"> | |||
更新信息 | |||
</view> | |||
<button class="avatar-wrapper personal-update" open-type="chooseAvatar" @chooseavatar="onUpdateInfo"> | |||
更换头像 | |||
</button> | |||
</view> | |||
<view class="personal-card-item"> | |||
<view class="personal-card-prev"> | |||
用户名 | |||
</view> | |||
<view class="personal-card-content"> | |||
<input type="text" v-model="memberCard.nickName" /> | |||
<input type="nickname" class="weui-input" placeholder="请输入昵称" v-model="memberCard.nickName"/> | |||
</view> | |||
<icon class="iconfont icon-you"></icon> | |||
</view> | |||
@@ -77,7 +77,7 @@ | |||
会员编号 | |||
</view> | |||
<view class="personal-card-content text-overflow-one"> | |||
{{memberCard.memberInfo_Id}} | |||
{{memberCard.phone}} | |||
</view> | |||
</view> | |||
</view> | |||
@@ -93,6 +93,8 @@ | |||
<script> | |||
import memberAPI from "@/api/member.js"; | |||
import payAPI from "@/api/pay.js"; | |||
import goodsAPI from "@/api/goods"; | |||
import COS from "@/utils/cos-wx-sdk-v5"; | |||
export default { | |||
data() { | |||
return { | |||
@@ -108,7 +110,9 @@ | |||
name: '女' | |||
} | |||
], | |||
memberCard: {} | |||
memberCard: { | |||
headImgUrl: '' | |||
} | |||
} | |||
}, | |||
onShow() { | |||
@@ -255,13 +259,23 @@ | |||
} | |||
}); | |||
}, | |||
onUpdateInfo() { | |||
uni.getUserProfile({ | |||
desc: '用于会员信息展示', | |||
success: (res) => { | |||
this.memberCard.headimgurl = res.userInfo.avatarUrl; | |||
this.memberCard.nickName = res.userInfo.nickName; | |||
this.memberCard.sex = res.userInfo.gender; | |||
async onUpdateInfo(userFace) { | |||
this.memberCard.headImgUrl = userFace.detail.avatarUrl; | |||
const ext = userFace.detail.avatarUrl.split('.')[1]; | |||
const response = await goodsAPI.GetCosRequestURL({ directory: "applet", fileExtension: ext, method: "PUT" }); | |||
// 初始化实例 | |||
const cos = new COS({ | |||
SecretId: 'AKIDa4KQIvKUP6bw4ye6JI3a8lCPN7cswnV3', | |||
SecretKey: 'ObaLtCH9nCNPFrFQO7ex2sTqyxlLgnfJ' | |||
}); | |||
cos.postObject({ | |||
Bucket: 'hbl-test-1305371387', | |||
Region: 'ap-chengdu', | |||
Key: '/Franchisee/applet/' + response.seeUrl.split('/applet/')[1], | |||
FilePath: userFace.detail.avatarUrl, | |||
}, (err, data) => { | |||
if (data) { | |||
this.memberCard.headImgUrl = data.headers.location; | |||
} | |||
}); | |||
} | |||
@@ -270,7 +284,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.personal-card { | |||
margin: 20rpx auto; | |||
width: 700rpx; | |||
@@ -318,7 +332,7 @@ | |||
.personal-btn { | |||
margin: 50rpx auto; | |||
width: 700rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
@@ -327,12 +341,14 @@ | |||
} | |||
.personal-update { | |||
border: 2rpx solid #51A97D; | |||
color: #51A97D; | |||
width: 130rpx; | |||
border: 2rpx solid $theme-color; | |||
color: $theme-color; | |||
width: 150rpx; | |||
text-align: center; | |||
margin-left: auto; | |||
padding: 5rpx 0; | |||
margin-right: 0; | |||
padding: 0; | |||
font-size: 28rpx; | |||
background-color: #FFF; | |||
} | |||
</style> |
@@ -91,7 +91,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.share-friend-text { | |||
width: 710rpx; | |||
margin: 20rpx auto; | |||
@@ -139,7 +139,7 @@ | |||
height: 0; | |||
border-top: 15rpx solid transparent; | |||
border-bottom: 15rpx solid transparent; | |||
border-left: 15rpx solid #51A97D; | |||
border-left: 15rpx solid $theme-color; | |||
top: 50%; | |||
transform: translateY(-50%); | |||
right: -35rpx; | |||
@@ -178,7 +178,7 @@ | |||
margin: 40rpx auto; | |||
height: 70rpx; | |||
line-height: 70rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
border-radius: 50rpx; | |||
} | |||
@@ -76,19 +76,13 @@ | |||
this.onGetSpecilaGoods(); | |||
}, | |||
onGetUserLocation() { | |||
uni.getLocation({ | |||
type: 'wgs84', | |||
success: (res) => { | |||
getApp().globalData.userLocation.latitude = res.latitude; | |||
getApp().globalData.userLocation.longitude = res.longitude; | |||
} | |||
}); | |||
getApp().onGetUserLocation(); | |||
}, | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.special-offer-container { | |||
display: flex; | |||
flex-direction: column; | |||
@@ -116,7 +110,7 @@ | |||
font-size: 32rpx; | |||
border-radius: 10rpx; | |||
color: #FFF; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
} | |||
.food-empty-image { | |||
@@ -2,7 +2,7 @@ | |||
<view class="under-delevelopment-box"> | |||
<view class="delevelopment-logo"></view> | |||
<view class="delevelopment-desc"> | |||
该功能正在开发中 | |||
店铺暂未开通该功能 | |||
</view> | |||
<view class="delevelopment-back" @click="onClickBack"> | |||
首页 | |||
@@ -27,7 +27,7 @@ | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.under-delevelopment-box { | |||
display: flex; | |||
flex-direction: column; | |||
@@ -54,7 +54,7 @@ | |||
.delevelopment-back { | |||
margin-top: 100rpx; | |||
background-color: #51A97D; | |||
background-color: $theme-color; | |||
color: #FFF; | |||
padding: 10rpx 100rpx; | |||
font-size: 32rpx; | |||
@@ -10,21 +10,32 @@ | |||
</template> | |||
<script> | |||
import goodsApi from "@/api/goods.js"; | |||
import store from "@/store/index.js"; | |||
import { mapState } from 'vuex'; | |||
export default { | |||
data() { | |||
return { | |||
imageServer: getApp().globalData.imageServer, | |||
} | |||
}, | |||
computed: { | |||
...mapState([ | |||
'currentStore' | |||
]) | |||
}, | |||
created() { | |||
getApp().onFetchStoreList(); | |||
}, | |||
onShareAppMessage(res) { | |||
return { | |||
title: '且时且多', | |||
title: this.currentStore.store_Name || '黑菠萝科技点餐小程序', | |||
path: '/pages/welcome/welcome', | |||
} | |||
}, | |||
onShareTimeline() { | |||
return { | |||
title: '且时且多', | |||
title: this.currentStore.store_Name || '黑菠萝科技点餐小程序', | |||
path: '/pages/welcome/welcome', | |||
} | |||
}, | |||
@@ -33,12 +44,12 @@ | |||
uni.switchTab({ | |||
url: '/pages/homeNew/homeNew' | |||
}); | |||
} | |||
}, | |||
} | |||
} | |||
</script> | |||
<style scoped> | |||
<style scoped lang="scss"> | |||
.welcome-container { | |||
min-height: 100vh; | |||
width: 100vw; | |||
@@ -59,7 +70,7 @@ | |||
top: 60%; | |||
left: 50%; | |||
transform: translate(-50%, 0%); | |||
color: #51A97D; | |||
color: $theme-color; | |||
border-radius: 10rpx; | |||
font-size: 32rpx; | |||
width: 300rpx; | |||
@@ -19,6 +19,7 @@ const store = new Vuex.Store({ | |||
}, | |||
//当前门店 | |||
currentStore: { | |||
id: '', | |||
store_Name: '默认门店', | |||
toUserDistance: 9999 | |||
}, | |||
@@ -38,7 +39,11 @@ const store = new Vuex.Store({ | |||
activityId: '' //活动ID | |||
}, | |||
//用户自动参与活动JSON数据 | |||
userAutoActivityJson: null | |||
userAutoActivityJson: null, | |||
//用户加钱换购JSON数据 | |||
userExchangePriceJson: [], | |||
//门店风格 | |||
storeStyles: [] | |||
} | |||
}, | |||
getters: { | |||
@@ -54,16 +59,16 @@ const store = new Vuex.Store({ | |||
shopCartTotalPrice(state, getters) { | |||
let price = 0; | |||
state.shoppingCart.forEach(food => { | |||
state.isVipMember ? price += (food.vipPrice * food.count) : price += (food.price * food.count); | |||
state.isVipMember ? price += (food.vipPrice * 100 * food.count) : price += (food.price * 100 * food.count); | |||
food.addtoFoodList.forEach(feed => { | |||
feed.foods.forEach(addFood => { | |||
if (addFood.count > 0) { | |||
price += (addFood.count * addFood.price); | |||
price += (addFood.count * addFood.price * 100); | |||
} | |||
}); | |||
}); | |||
}); | |||
return price; | |||
return price / 100; | |||
} | |||
}, | |||
mutations: { | |||
@@ -262,7 +267,30 @@ const store = new Vuex.Store({ | |||
}, | |||
//修改用户自动参与活动JSON数据 | |||
onInitUserAutoActivityJson(state, payload) { | |||
this.state.userAutoActivityJson = payload; | |||
state.userAutoActivityJson = payload; | |||
}, | |||
//清空用户自动参与活动JSON数据 | |||
onClearUserAutoActivityJson(state) { | |||
state.userAutoActivityJson = null; | |||
}, | |||
//新增用户换购商品JSON | |||
inserUserExchangePriceJson(state, payload) { | |||
state.userExchangePriceJson.push(payload); | |||
}, | |||
//删除用户换购商品JSON | |||
deleteUserExchangePriceJson(state, payload) { | |||
let delIndex = state.userExchangePriceJson.findIndex(item => item.goodsId === payload.id); | |||
if (delIndex > -1) { | |||
state.userExchangePriceJson.splice(delIndex, 1); | |||
} | |||
}, | |||
//清空用户换购商品JSON | |||
clearUserExchangePriceJson(state) { | |||
state.userExchangePriceJson = []; | |||
}, | |||
//设置门店风格 | |||
onSetStoreStyles(state, payload) { | |||
state.storeStyles = payload; | |||
} | |||
} | |||
}); | |||
@@ -13,6 +13,7 @@ | |||
*/ | |||
@import 'uview-ui/theme.scss'; | |||
/* 颜色变量 */ | |||
$theme-color: #305936; | |||
/* 行为相关颜色 */ | |||
$uni-color-primary: #007aff; | |||
@@ -1,11 +1,22 @@ | |||
import Encrypt from "./crypto.js"; | |||
let BASE_URL = ''; | |||
// BASE_URL = 'https://www.black-pa.com:5500/pro'; //线上正式 | |||
// BASE_URL = 'https://www.black-pa.com:5500/dev'; //线上开发 | |||
BASE_URL = 'https://www.black-pa.com:5500/test'; //线上测试 | |||
const BASE_URL = 'https://www.black-pa.com:5500'; //正式 | |||
// const BASE_URL = 'https://www.black-pa.com:5502'; //测试 | |||
const Franchisee = '/Franchisee'; //加盟商:0 | |||
const Order = '/Order/'; //订单: 1 | |||
const Pay = '/Pay/'; //支付: 2 | |||
// BASE_URL = 'https://bpa.black-pa.com:21527'; //本地开发 | |||
// BASE_URL = 'https://bpa.black-pa.com:21528'; //本地测试 | |||
const Franchisee = '/kitchen'; //加盟商:0 | |||
const Order = '/order'; //订单: 1 | |||
const Pay = '/wechat/'; //支付: 2 | |||
const accountInfo = uni.getAccountInfoSync(); | |||
if (accountInfo.miniProgram.envVersion === 'trial') { | |||
BASE_URL = 'https://www.black-pa.com:5500/test'; | |||
} else if (accountInfo.miniProgram.envVersion === 'release') { | |||
BASE_URL = 'https://www.black-pa.com:5500/pro'; | |||
} | |||
const request = (options) => { | |||
let BlackApp = Encrypt(`[${options.url}]_[${new Date().getTime()}]`); | |||
@@ -36,7 +47,8 @@ const request = (options) => { | |||
data: options.data || {}, | |||
header: options.header || { | |||
'BlackApp': BlackApp, | |||
'AppId': getApp().globalData.appId | |||
'AppId': getApp().globalData.appId, | |||
'TenantId': getApp().globalData.companyId | |||
}, | |||
timeout: 20000, | |||
success: response => { | |||
@@ -64,8 +76,9 @@ const request = (options) => { | |||
let response = { | |||
data: null, | |||
isSuccess: false, | |||
msg: '服务器连接失败!' | |||
msg: '服务端问题' + JSON.stringify(error.errMsg) | |||
} | |||
console.log('服务端问题', error); | |||
resolve(response); | |||
}, | |||
complete: () => { | |||