Commit 9a2d8da5 by songbingqi

完成部分开发

parent fd48b2da
......@@ -4,6 +4,7 @@
@cancel="show = false"
:show="show"
:immediateChange="true"
mode="region"
ref="uPicker"
:columns="columns"
@confirm="confirm"
......@@ -36,7 +37,6 @@ export default {
showArea() {
uni.getSetting({
success: (res) => {
// 已经授权位置不获取默认店铺
if(res.authSetting['scope.userLocation']) {
User.getLocation((state, params) => {
console.log("showArea, state:"+state+", params:" + JSON.stringify(params));
......
......@@ -32,13 +32,44 @@
<div class="close_icon" @click="close">
<u-icon name="close-circle" color="#666666" size="28" :top="-3"></u-icon>
</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">
<image mode="scaleToFill" :src="orderInfo.pickCode" class="qr"></image>
</div>
<div class="ercodeTip">制作完成后,扫描此二维码取杯。</div>
<!-- <view class="status_text" v-if="showMask">——制作完成后才能扫哦——</view> -->
<div class="flow_describe">
<view class="titleBox">
<!-- <view class="titleBox">
<view class="qrcodeTitle">
<view class="title">扫码流程</view>
<view class="icon">
......@@ -51,11 +82,21 @@
<image class="arrow" :style="{'height':'18rpx','width':'10rpx'}" :src="'../../static/imgs/jiantouhui.png'" />
</view>
</view>
</view>
</view> -->
<image :mode="'aspectFit'" class="flow_img" :src="'/static/imgs/saomaliucheng.png'"></image>
</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 class="flow_describe_tips">
<view class="title">注意事项</view>
......@@ -97,7 +138,6 @@ export default {
watch:{
'show':{
handler(val) {
console.log(val,'wywy')
if(!val) {
this.cleanTimeout()
}
......@@ -171,7 +211,7 @@ export default {
this.timer = setTimeout(() => {
this.getOrderInfo()
clearTimeout(this.timer)
}, 2000);
}, 5000);
}
this.orderInfo ={...data.data};
} else {
......@@ -228,6 +268,108 @@ export default {
</script>
<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 {
padding-top: 1rpx;
padding-bottom: 30rpx;
......@@ -288,7 +430,7 @@ export default {
margin: 32rpx;
position: relative;
padding-top: 54rpx;
padding-bottom: 62rpx;
padding-bottom: 32rpx;
.status_text {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
......@@ -305,10 +447,10 @@ export default {
}
.qr_code_readly{
margin: 20rpx auto;
margin-top: 38rpx;
margin-bottom: 66rpx;
width: 474.6rpx;
height: 476rpx;
margin-top: 50rpx;
margin-bottom: 30rpx;
width: 450rpx;
height: 450rpx;
.qr {
width: 100%;
height: 100%;
......@@ -344,6 +486,7 @@ export default {
width: 100%;
height: 300rpx;
padding-left: 31rpx;
margin-top: 20rpx;
.titleBox {
display: flex;
......
......@@ -71,8 +71,8 @@
</view>
<view @click="cart(item, category)" class="info">
<view class="goods-name">{{ item.name }}</view>
<view class="tags" v-if="item.tags">
<view class="tag-item" v-for="tag in item.tags" :key="tag">{{
<view class="tags" v-if="item.tags||item.recommendTag">
<view v-for="(tag,index) in getTags(item)" :key="tag" :class="index===0&&item.recommendTag?'tag-item-recommend':'tag-item'">{{
tag
}}</view>
</view>
......@@ -93,7 +93,7 @@
}}</text></view
>
</view>
<view class="addbox" v-if="shopState && isInRange">
<view class="addbox" v-if="orderState">
<image
v-if="getSku(item).state == 1"
@click.stop="cart(item, category)"
......@@ -123,7 +123,7 @@ import Utils from "@/utils/utils";
import Order from "@/request/order";
export default {
name: "menuAssembly",
props: ["buied", "shopState", "isInRange"],
props: ["buied", "orderState"],
data() {
return {
scrollBottom: {
......@@ -150,14 +150,7 @@ export default {
};
},
watch: {
isInRange(val) {
if (!val) {
this.scrollBottom["--scroll-marginbottom"] = 131 + "rpx";
} else {
this.scrollBottom["--scroll-marginbottom"] = 0 + "rpx";
}
},
shopState(val) {
orderState(val) {
if (!val) {
this.scrollBottom["--scroll-marginbottom"] = 131 + "rpx";
} else {
......@@ -227,6 +220,17 @@ export default {
});
},
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() {
this.scrollLeftTop = 0;
this.scrollTop = 0;
......@@ -342,12 +346,6 @@ export default {
const el = categoryPostion.filter((item) => {
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;
},
categoryClickMain(id) {
......@@ -371,7 +369,7 @@ export default {
icon: "none",
});
} else {
if (this.shopState && this.isInRange) {
if (this.orderState) {
const { data } = await Order.checkSku({ skuId: skuStatus[0].skuId });
const { goods } = data.data;
uni.setStorageSync(
......@@ -534,6 +532,8 @@ export default {
.tags {
height: 28rpx;
margin-top: 8rpx;
display: flex;
align-items: center;
.tag-item {
font-family: PingFangSC-Regular, PingFang SC;
background-color: #f0f0f0;
......@@ -544,6 +544,16 @@ export default {
display: inline-block;
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 {
......
......@@ -143,11 +143,11 @@
</view>
<view
class="shopClose"
v-if="!shopState || !isInRange"
v-if="!orderState"
:style="{ bottom: shopCar + 'rpx' }"
>
<view class="content">{{
!shopState ? "门店已休息" : "距离较远,门店暂停接单"
orderStateDesc
}}</view>
</view>
<show-toast ref="toast" />
......@@ -160,7 +160,7 @@ import Menu from "@/request/menu";
import User from "@/request/user";
import Utils from "@/utils/utils";
export default {
props: ["shopState", "isInRange"],
props: [ "orderState", "orderStateDesc"],
data() {
return {
showShopCar: false, //是否弹出购物车列表
......
......@@ -14,7 +14,12 @@
<image :style="{'height':'100%','width':'100%'}" :src="'../../../static/imgs/jiantouhei2.png'" />
</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 class="header">
<view class="name">{{ item.name }}</view>
......@@ -60,7 +65,7 @@ export default {
if(uni.getStorageSync('shopData')) {
this.shopId = uni.getStorageSync('shopData').id;
}
this.list = uni.getStorageSync('shops');
this.list = uni.getStorageSync('shops')||[];
this.areaName = uni.getStorageSync('areaName')
},
computed: {
......@@ -102,6 +107,18 @@ export default {
</script>
<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{
background: #F2F2F2;
height:100vh ;
......
......@@ -125,7 +125,7 @@
<view v-if="size > 0" class="good-select-cont">
<span
:class="
!shopState || !isInRange
!orderState
? 'good-select-btn1-close'
: 'good-select-btn1'
"
......@@ -137,7 +137,7 @@
<view>
<a
:class="
!shopState || !isInRange
!orderState
? 'good-select-btn2-close'
: 'good-select-btn2'
"
......@@ -149,7 +149,7 @@
<button
v-if="!userms"
:class="
!shopState || !isInRange
!orderState
? 'good-select-btn2-close'
: 'good-select-btn2'
"
......@@ -192,18 +192,21 @@ export default {
Utils,
shopState: true,
showSku: [],
isInRange: true,
// isInRange: true,
orderState: true,
};
},
onShow() {
uni.setStorageSync("selectFlag", false);
uni.removeStorageSync("goodsList");
this.BottomSafeHeight = uni.getStorageSync("BottomSafeHeight");
this.shopState = JSON.parse(uni.getStorageSync("shopState"));
this.isInRange =
uni.getStorageSync("isInRange") === ""
? true
: uni.getStorageSync("isInRange");
this.orderState = JSON.parse(uni.getStorageSync("shopInfo")).orderState
console.log(this.orderState,'orderState')
// this.shopState = JSON.parse(uni.getStorageSync("shopState"));
// this.isInRange =
// uni.getStorageSync("isInRange") === ""
// ? true
// : uni.getStorageSync("isInRange");
},
mounted() {
// 获取胶囊坐标位置
......@@ -401,7 +404,7 @@ export default {
}
},
async shoppingCart() {
if (!this.shopState || !this.isInRange) {
if (!this.orderState) {
return;
}
if (this.checkNum("addShop")) {
......@@ -426,7 +429,7 @@ export default {
}
},
async getallNum(e) {
if (!this.shopState || !this.isInRange) {
if (!this.orderState) {
return;
}
const gosettleFun = async () => {
......@@ -499,7 +502,7 @@ export default {
} else {
checkLocak();
}
if (!this.shopState || !this.isInRange) {
if (!this.orderState) {
return;
}
......@@ -531,7 +534,7 @@ export default {
},
UseIt(ruleId) {
return (
this.available.indexOf(ruleId) == -1 && this.shopState && this.isInRange
this.available.indexOf(ruleId) == -1 && this.orderState
);
},
ShowIt(ruleId) {
......
......@@ -25,10 +25,11 @@
'margin-top': statusBarHeight + navigationBarHeight + getPx(32) + 'px',
}"
>
<view class="code">
<view class="code" v-if="isBulid">
<view class="code_label">取单号:</view>
<view class="code_content">{{orderInfo.orderNum}}</view>
</view>
<view v-else class="status_text">订单状态:{{ orderStatusText }}</view>
<view class="tips">
<view v-if="orderInfo.state == 7">制作完成请取杯,享用愉快!</view>
<view v-if="orderInfo.state == 4">制作完成请取杯,享用愉快!</view>
......@@ -65,7 +66,7 @@
</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
type="primary"
@click="cancelOrder"
......@@ -82,15 +83,8 @@
>
<a
type="primary"
@click="toRefund"
v-if="orderInfo.state == 2"
class="btn_cancel"
>申请退款</a
>
<a
type="primary"
@click="oneMoreOrder(orderInfo)"
v-if="orderInfo.state != 1"
v-if="orderInfo.state != 1&&orderInfo.state != 2"
class="btn"
>再来一单</a
>
......@@ -101,7 +95,7 @@
class="btn_cancel"
>退款详情</a
>
</div> -->
</div>
<!-- </div>
<div class="order_flow" v-if="qrShow"> -->
<!-- <div v-if="qrShow" class="code">取单码 {{ orderInfo.orderNum }}</div> -->
......
......@@ -158,5 +158,20 @@ export default {
// uni.showToast({ title: '哎哟!刚刚走神了,请退出后重进', icon: 'none' })
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 {
// 获取店铺信息
getShopInfo(params) {
return uni.$u.http
.get("/weixin/getShop", { params })
.get("/weixin/v2/getShop", { params })
.then((res) => {
// console.log("get shop:"+JSON.stringify(res.data.data));
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