Commit 9a2d8da5 by songbingqi

完成部分开发

parent fd48b2da
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
@cancel="show = false" @cancel="show = false"
:show="show" :show="show"
:immediateChange="true" :immediateChange="true"
mode="region"
ref="uPicker" ref="uPicker"
:columns="columns" :columns="columns"
@confirm="confirm" @confirm="confirm"
...@@ -36,7 +37,6 @@ export default { ...@@ -36,7 +37,6 @@ export default {
showArea() { showArea() {
uni.getSetting({ uni.getSetting({
success: (res) => { success: (res) => {
// 已经授权位置不获取默认店铺
if(res.authSetting['scope.userLocation']) { if(res.authSetting['scope.userLocation']) {
User.getLocation((state, params) => { User.getLocation((state, params) => {
console.log("showArea, state:"+state+", params:" + JSON.stringify(params)); console.log("showArea, state:"+state+", params:" + JSON.stringify(params));
......
...@@ -32,13 +32,44 @@ ...@@ -32,13 +32,44 @@
<div class="close_icon" @click="close"> <div class="close_icon" @click="close">
<u-icon name="close-circle" color="#666666" size="28" :top="-3"></u-icon> <u-icon name="close-circle" color="#666666" size="28" :top="-3"></u-icon>
</div> </div>
<div class="code">取单码 {{ orderInfo.orderNum }}</div> <view class="code">
<view class="code_label">取单号:</view>
<view class="code_content">{{orderInfo.orderNum}}</view>
</view>
<view class="statusTip">
<view class="tip_box">
<view class="tip">
<view class="icon">
<image v-if="[1].indexOf(Number(orderInfo.state))!=-1" mode="aspectFit" :src="'/static/imgs/daizhizuo_action.png'"/>
<image v-else mode="aspectFit" :src="'/static/imgs/daizhizuo.png'"/>
</view>
<view :class="[1].indexOf(Number(orderInfo.state))!=-1?'tip_titile_action':'tip_tittle'">1待制作</view>
</view>
<view class="tip">
<view class="icon">
<image v-if="[2, 3].indexOf(Number(orderInfo.state))!=-1" mode="aspectFit" :src="'/static/imgs/zhizuozhong_action.png'"/>
<image v-else mode="aspectFit" :src="'/static/imgs/zhizuozhong.png'"/>
</view>
<view :class="[2, 3].indexOf(Number(orderInfo.state))!=-1?'tip_titile_action':'tip_tittle'">2制作中</view>
</view>
<view class="tip">
<view class="icon">
<image v-if="[4, 5].indexOf(Number(orderInfo.state))!=-1" mode="aspectFit" :src="'/static/imgs/wancheng_action.png'"/>
<image v-else mode="aspectFit" :src="'/static/imgs/wancheng.png'"/>
</view>
<view :class="[4, 5].indexOf(Number(orderInfo.state))!=-1?'tip_titile_action':'tip_tittle'">3完成</view>
</view>
</view>
</view>
<!-- <div class="code">取单码 {{ orderInfo.orderNum }}</div> -->
<div class="qr_code_readly"> <div class="qr_code_readly">
<image mode="scaleToFill" :src="orderInfo.pickCode" class="qr"></image> <image mode="scaleToFill" :src="orderInfo.pickCode" class="qr"></image>
</div> </div>
<div class="ercodeTip">制作完成后,扫描此二维码取杯。</div>
<!-- <view class="status_text" v-if="showMask">——制作完成后才能扫哦——</view> --> <!-- <view class="status_text" v-if="showMask">——制作完成后才能扫哦——</view> -->
<div class="flow_describe"> <div class="flow_describe">
<view class="titleBox"> <!-- <view class="titleBox">
<view class="qrcodeTitle"> <view class="qrcodeTitle">
<view class="title">扫码流程</view> <view class="title">扫码流程</view>
<view class="icon"> <view class="icon">
...@@ -51,11 +82,21 @@ ...@@ -51,11 +82,21 @@
<image class="arrow" :style="{'height':'18rpx','width':'10rpx'}" :src="'../../static/imgs/jiantouhui.png'" /> <image class="arrow" :style="{'height':'18rpx','width':'10rpx'}" :src="'../../static/imgs/jiantouhui.png'" />
</view> </view>
</view> </view>
</view> </view> -->
<image :mode="'aspectFit'" class="flow_img" :src="'/static/imgs/saomaliucheng.png'"></image> <image :mode="'aspectFit'" class="flow_img" :src="'/static/imgs/saomaliucheng.png'"></image>
</div> </div>
<div class="takeCupTip">
<div class="text" @click="goShow()">
<view>查看实景取杯演示</view>
<image
class="arrow"
:style="{ height: '18rpx', width: '10rpx' }"
:src="'/static/imgs/jiantouhui.png'"
/>
</div>
<!-- <div class="btn" @click="refundInfo" v-if="checkStatus(orderInfo.state, [12, 13, 14, 15])">退款</div> -->
</div>
</div> </div>
<div class="flow_describe_tips"> <div class="flow_describe_tips">
<view class="title">注意事项</view> <view class="title">注意事项</view>
...@@ -97,7 +138,6 @@ export default { ...@@ -97,7 +138,6 @@ export default {
watch:{ watch:{
'show':{ 'show':{
handler(val) { handler(val) {
console.log(val,'wywy')
if(!val) { if(!val) {
this.cleanTimeout() this.cleanTimeout()
} }
...@@ -171,7 +211,7 @@ export default { ...@@ -171,7 +211,7 @@ export default {
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.getOrderInfo() this.getOrderInfo()
clearTimeout(this.timer) clearTimeout(this.timer)
}, 2000); }, 5000);
} }
this.orderInfo ={...data.data}; this.orderInfo ={...data.data};
} else { } else {
...@@ -228,6 +268,108 @@ export default { ...@@ -228,6 +268,108 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.takeCupTip {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0rpx 32rpx;
.text {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
display: flex;
align-items: center;
image {
margin-left: 10rpx;
}
}
.btn {
border: 1rpx solid gray;
border-radius: 5rpx;
text-align: center;
background: rgb(255, 255, 255);
color: black;
font-size: 27rpx;
letter-spacing: 5rpx;
line-height: 64rpx;
width: 180rpx;
}
}
.ercodeTip {
margin: 0rpx 0rpx;
text-align: center;
font-weight: bolder;
font-size: 30rpx;
}
.code {
display: flex;
justify-content: center;
align-items: center;
font-family: Futura Medium, Arial, sans-serif;
.code_label {
margin-right: 10rpx;
font-weight: 900;
font-size: 45rpx;
color: #343434;
}
.code_content {
font-size: 45rpx;
font-weight: 800;
letter-spacing: 2rpx;
color: #0012ff;
}
}
.statusTip {
margin: 30rpx 0px;
// text-align: center;
height: 100rpx;
.tip_box {
width: 450rpx;
margin: 0 auto;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.tip {
height: 100%;
width: 100rpx;
.icon {
width: 60rpx;
height: 60rpx;
margin: 5rpx auto;
image {
width: 100%;
height: 100%;
transform: scale(1.4) rotate(0deg)
}
}
.tip_tittle {
margin-top: 10rpx;
text-align: center;
font-size: 25rpx;
color: rgb(151, 151, 151);
}
.tip_titile_action {
margin-top: 10rpx;
text-align: center;
font-weight: bolder;
font-size: 25rpx;
}
}
}
}
.pages { .pages {
padding-top: 1rpx; padding-top: 1rpx;
padding-bottom: 30rpx; padding-bottom: 30rpx;
...@@ -288,7 +430,7 @@ export default { ...@@ -288,7 +430,7 @@ export default {
margin: 32rpx; margin: 32rpx;
position: relative; position: relative;
padding-top: 54rpx; padding-top: 54rpx;
padding-bottom: 62rpx; padding-bottom: 32rpx;
.status_text { .status_text {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
...@@ -305,10 +447,10 @@ export default { ...@@ -305,10 +447,10 @@ export default {
} }
.qr_code_readly{ .qr_code_readly{
margin: 20rpx auto; margin: 20rpx auto;
margin-top: 38rpx; margin-top: 50rpx;
margin-bottom: 66rpx; margin-bottom: 30rpx;
width: 474.6rpx; width: 450rpx;
height: 476rpx; height: 450rpx;
.qr { .qr {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -344,6 +486,7 @@ export default { ...@@ -344,6 +486,7 @@ export default {
width: 100%; width: 100%;
height: 300rpx; height: 300rpx;
padding-left: 31rpx; padding-left: 31rpx;
margin-top: 20rpx;
.titleBox { .titleBox {
display: flex; display: flex;
......
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
</view> </view>
<view @click="cart(item, category)" class="info"> <view @click="cart(item, category)" class="info">
<view class="goods-name">{{ item.name }}</view> <view class="goods-name">{{ item.name }}</view>
<view class="tags" v-if="item.tags"> <view class="tags" v-if="item.tags||item.recommendTag">
<view class="tag-item" v-for="tag in item.tags" :key="tag">{{ <view v-for="(tag,index) in getTags(item)" :key="tag" :class="index===0&&item.recommendTag?'tag-item-recommend':'tag-item'">{{
tag tag
}}</view> }}</view>
</view> </view>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
}}</text></view }}</text></view
> >
</view> </view>
<view class="addbox" v-if="shopState && isInRange"> <view class="addbox" v-if="orderState">
<image <image
v-if="getSku(item).state == 1" v-if="getSku(item).state == 1"
@click.stop="cart(item, category)" @click.stop="cart(item, category)"
...@@ -123,7 +123,7 @@ import Utils from "@/utils/utils"; ...@@ -123,7 +123,7 @@ import Utils from "@/utils/utils";
import Order from "@/request/order"; import Order from "@/request/order";
export default { export default {
name: "menuAssembly", name: "menuAssembly",
props: ["buied", "shopState", "isInRange"], props: ["buied", "orderState"],
data() { data() {
return { return {
scrollBottom: { scrollBottom: {
...@@ -150,14 +150,7 @@ export default { ...@@ -150,14 +150,7 @@ export default {
}; };
}, },
watch: { watch: {
isInRange(val) { orderState(val) {
if (!val) {
this.scrollBottom["--scroll-marginbottom"] = 131 + "rpx";
} else {
this.scrollBottom["--scroll-marginbottom"] = 0 + "rpx";
}
},
shopState(val) {
if (!val) { if (!val) {
this.scrollBottom["--scroll-marginbottom"] = 131 + "rpx"; this.scrollBottom["--scroll-marginbottom"] = 131 + "rpx";
} else { } else {
...@@ -227,6 +220,17 @@ export default { ...@@ -227,6 +220,17 @@ export default {
}); });
}, },
methods: { methods: {
getTags(item) {
if(item.recommendTag) {
if(item.tags.length!=0){
return item.tags.unshift(item.recommendTag).splice(0,3)
}else{
return [item.recommendTag]
}
} else {
return item.tags
}
},
initScroll() { initScroll() {
this.scrollLeftTop = 0; this.scrollLeftTop = 0;
this.scrollTop = 0; this.scrollTop = 0;
...@@ -342,12 +346,6 @@ export default { ...@@ -342,12 +346,6 @@ export default {
const el = categoryPostion.filter((item) => { const el = categoryPostion.filter((item) => {
return item.top <= e.target.scrollTop + otherHeight; return item.top <= e.target.scrollTop + otherHeight;
}); });
console.log(
el[el.length - 1],
"-------------------",
e.target.scrollTop + otherHeight,
otherHeight
);
if (el[el.length - 1]) this.categoryId = el[el.length - 1].id; if (el[el.length - 1]) this.categoryId = el[el.length - 1].id;
}, },
categoryClickMain(id) { categoryClickMain(id) {
...@@ -371,7 +369,7 @@ export default { ...@@ -371,7 +369,7 @@ export default {
icon: "none", icon: "none",
}); });
} else { } else {
if (this.shopState && this.isInRange) { if (this.orderState) {
const { data } = await Order.checkSku({ skuId: skuStatus[0].skuId }); const { data } = await Order.checkSku({ skuId: skuStatus[0].skuId });
const { goods } = data.data; const { goods } = data.data;
uni.setStorageSync( uni.setStorageSync(
...@@ -534,6 +532,8 @@ export default { ...@@ -534,6 +532,8 @@ export default {
.tags { .tags {
height: 28rpx; height: 28rpx;
margin-top: 8rpx; margin-top: 8rpx;
display: flex;
align-items: center;
.tag-item { .tag-item {
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
background-color: #f0f0f0; background-color: #f0f0f0;
...@@ -544,6 +544,16 @@ export default { ...@@ -544,6 +544,16 @@ export default {
display: inline-block; display: inline-block;
margin-right: 16rpx; margin-right: 16rpx;
} }
.tag-item-recommend {
font-family: PingFangSC-Regular, PingFang SC;
border: 1rpx solid #EA58DD;
padding: 0rpx 8rpx;
font-size: 20rpx;
color: #EA58DD;
vertical-align: top;
display: inline-block;
margin-right: 16rpx;
}
} }
.desc-box { .desc-box {
......
...@@ -143,11 +143,11 @@ ...@@ -143,11 +143,11 @@
</view> </view>
<view <view
class="shopClose" class="shopClose"
v-if="!shopState || !isInRange" v-if="!orderState"
:style="{ bottom: shopCar + 'rpx' }" :style="{ bottom: shopCar + 'rpx' }"
> >
<view class="content">{{ <view class="content">{{
!shopState ? "门店已休息" : "距离较远,门店暂停接单" orderStateDesc
}}</view> }}</view>
</view> </view>
<show-toast ref="toast" /> <show-toast ref="toast" />
...@@ -160,7 +160,7 @@ import Menu from "@/request/menu"; ...@@ -160,7 +160,7 @@ import Menu from "@/request/menu";
import User from "@/request/user"; import User from "@/request/user";
import Utils from "@/utils/utils"; import Utils from "@/utils/utils";
export default { export default {
props: ["shopState", "isInRange"], props: [ "orderState", "orderStateDesc"],
data() { data() {
return { return {
showShopCar: false, //是否弹出购物车列表 showShopCar: false, //是否弹出购物车列表
......
...@@ -14,7 +14,12 @@ ...@@ -14,7 +14,12 @@
<image :style="{'height':'100%','width':'100%'}" :src="'../../../static/imgs/jiantouhei2.png'" /> <image :style="{'height':'100%','width':'100%'}" :src="'../../../static/imgs/jiantouhei2.png'" />
</view> </view>
</view> </view>
<view > <view v-if="finalList.length==0" >
<view class="emty">
<view class="text">抱歉,暂无门店,敬请期待</view>
</view>
</view>
<view v-else>
<div v-for="item in finalList" :key="item.id" @click="selectedShop(item)" class="shop_item" :class="shopId==item.id?'active':''" > <div v-for="item in finalList" :key="item.id" @click="selectedShop(item)" class="shop_item" :class="shopId==item.id?'active':''" >
<div class="header"> <div class="header">
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
...@@ -60,7 +65,7 @@ export default { ...@@ -60,7 +65,7 @@ export default {
if(uni.getStorageSync('shopData')) { if(uni.getStorageSync('shopData')) {
this.shopId = uni.getStorageSync('shopData').id; this.shopId = uni.getStorageSync('shopData').id;
} }
this.list = uni.getStorageSync('shops'); this.list = uni.getStorageSync('shops')||[];
this.areaName = uni.getStorageSync('areaName') this.areaName = uni.getStorageSync('areaName')
}, },
computed: { computed: {
...@@ -102,6 +107,18 @@ export default { ...@@ -102,6 +107,18 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.emty{
.text{
text-align: center;
margin-top: 322rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 40rpx;
letter-spacing: 1rpx;
}
}
.product-list{ .product-list{
background: #F2F2F2; background: #F2F2F2;
height:100vh ; height:100vh ;
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<view v-if="size > 0" class="good-select-cont"> <view v-if="size > 0" class="good-select-cont">
<span <span
:class=" :class="
!shopState || !isInRange !orderState
? 'good-select-btn1-close' ? 'good-select-btn1-close'
: 'good-select-btn1' : 'good-select-btn1'
" "
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
<view> <view>
<a <a
:class=" :class="
!shopState || !isInRange !orderState
? 'good-select-btn2-close' ? 'good-select-btn2-close'
: 'good-select-btn2' : 'good-select-btn2'
" "
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<button <button
v-if="!userms" v-if="!userms"
:class=" :class="
!shopState || !isInRange !orderState
? 'good-select-btn2-close' ? 'good-select-btn2-close'
: 'good-select-btn2' : 'good-select-btn2'
" "
...@@ -192,18 +192,21 @@ export default { ...@@ -192,18 +192,21 @@ export default {
Utils, Utils,
shopState: true, shopState: true,
showSku: [], showSku: [],
isInRange: true, // isInRange: true,
orderState: true,
}; };
}, },
onShow() { onShow() {
uni.setStorageSync("selectFlag", false); uni.setStorageSync("selectFlag", false);
uni.removeStorageSync("goodsList"); uni.removeStorageSync("goodsList");
this.BottomSafeHeight = uni.getStorageSync("BottomSafeHeight"); this.BottomSafeHeight = uni.getStorageSync("BottomSafeHeight");
this.shopState = JSON.parse(uni.getStorageSync("shopState")); this.orderState = JSON.parse(uni.getStorageSync("shopInfo")).orderState
this.isInRange = console.log(this.orderState,'orderState')
uni.getStorageSync("isInRange") === "" // this.shopState = JSON.parse(uni.getStorageSync("shopState"));
? true // this.isInRange =
: uni.getStorageSync("isInRange"); // uni.getStorageSync("isInRange") === ""
// ? true
// : uni.getStorageSync("isInRange");
}, },
mounted() { mounted() {
// 获取胶囊坐标位置 // 获取胶囊坐标位置
...@@ -401,7 +404,7 @@ export default { ...@@ -401,7 +404,7 @@ export default {
} }
}, },
async shoppingCart() { async shoppingCart() {
if (!this.shopState || !this.isInRange) { if (!this.orderState) {
return; return;
} }
if (this.checkNum("addShop")) { if (this.checkNum("addShop")) {
...@@ -426,7 +429,7 @@ export default { ...@@ -426,7 +429,7 @@ export default {
} }
}, },
async getallNum(e) { async getallNum(e) {
if (!this.shopState || !this.isInRange) { if (!this.orderState) {
return; return;
} }
const gosettleFun = async () => { const gosettleFun = async () => {
...@@ -499,7 +502,7 @@ export default { ...@@ -499,7 +502,7 @@ export default {
} else { } else {
checkLocak(); checkLocak();
} }
if (!this.shopState || !this.isInRange) { if (!this.orderState) {
return; return;
} }
...@@ -531,7 +534,7 @@ export default { ...@@ -531,7 +534,7 @@ export default {
}, },
UseIt(ruleId) { UseIt(ruleId) {
return ( return (
this.available.indexOf(ruleId) == -1 && this.shopState && this.isInRange this.available.indexOf(ruleId) == -1 && this.orderState
); );
}, },
ShowIt(ruleId) { ShowIt(ruleId) {
......
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
'margin-top': statusBarHeight + navigationBarHeight + getPx(32) + 'px', 'margin-top': statusBarHeight + navigationBarHeight + getPx(32) + 'px',
}" }"
> >
<view class="code"> <view class="code" v-if="isBulid">
<view class="code_label">取单号:</view> <view class="code_label">取单号:</view>
<view class="code_content">{{orderInfo.orderNum}}</view> <view class="code_content">{{orderInfo.orderNum}}</view>
</view> </view>
<view v-else class="status_text">订单状态:{{ orderStatusText }}</view>
<view class="tips"> <view class="tips">
<view v-if="orderInfo.state == 7">制作完成请取杯,享用愉快!</view> <view v-if="orderInfo.state == 7">制作完成请取杯,享用愉快!</view>
<view v-if="orderInfo.state == 4">制作完成请取杯,享用愉快!</view> <view v-if="orderInfo.state == 4">制作完成请取杯,享用愉快!</view>
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <div class="btns"> <div class="btns" v-if="orderInfo.state == 1||(orderInfo.state != 1&&orderInfo.state != 2)||(checkStatus(orderInfo.state, [12, 13, 14, 15]))">
<a <a
type="primary" type="primary"
@click="cancelOrder" @click="cancelOrder"
...@@ -82,15 +83,8 @@ ...@@ -82,15 +83,8 @@
> >
<a <a
type="primary" type="primary"
@click="toRefund"
v-if="orderInfo.state == 2"
class="btn_cancel"
>申请退款</a
>
<a
type="primary"
@click="oneMoreOrder(orderInfo)" @click="oneMoreOrder(orderInfo)"
v-if="orderInfo.state != 1" v-if="orderInfo.state != 1&&orderInfo.state != 2"
class="btn" class="btn"
>再来一单</a >再来一单</a
> >
...@@ -101,7 +95,7 @@ ...@@ -101,7 +95,7 @@
class="btn_cancel" class="btn_cancel"
>退款详情</a >退款详情</a
> >
</div> --> </div>
<!-- </div> <!-- </div>
<div class="order_flow" v-if="qrShow"> --> <div class="order_flow" v-if="qrShow"> -->
<!-- <div v-if="qrShow" class="code">取单码 {{ orderInfo.orderNum }}</div> --> <!-- <div v-if="qrShow" class="code">取单码 {{ orderInfo.orderNum }}</div> -->
......
...@@ -158,5 +158,20 @@ export default { ...@@ -158,5 +158,20 @@ export default {
// uni.showToast({ title: '哎哟!刚刚走神了,请退出后重进', icon: 'none' }) // uni.showToast({ title: '哎哟!刚刚走神了,请退出后重进', icon: 'none' })
console.log("哎哟!刚刚走神了,请退出后重进"); console.log("哎哟!刚刚走神了,请退出后重进");
}); });
},
// 根据经纬度获取店铺
getLocationShops(data) {
return uni.$u.http
.post("/weixin/v2/getLocationShops", data)
.then((res) => {
return res;
})
.catch((err) => {
context.showToast({
title: "哎哟!刚刚走神了,请退出后重进",
icon: "none",
});
return err;
});
} }
}; };
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
// 获取店铺信息 // 获取店铺信息
getShopInfo(params) { getShopInfo(params) {
return uni.$u.http return uni.$u.http
.get("/weixin/getShop", { params }) .get("/weixin/v2/getShop", { params })
.then((res) => { .then((res) => {
// console.log("get shop:"+JSON.stringify(res.data.data)); // console.log("get shop:"+JSON.stringify(res.data.data));
if (res.data.code == 200) { if (res.data.code == 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment