You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.0 KiB
Vue

1 year ago
<template>
1 year ago
<view class="main">
3 months ago
<title-block style="flex-shrink: 0; width: 100%" title="寄存"></title-block>
<view class="order">
<view
:class="['order-item', isPass !== 2 ? 'disabled-div' : '']"
@click.stop="goConsignmen"
>
<image
src="@/static/image/write.png"
mode="scaleToFill"
style="width: 63rpx; height: 62rpx"
/>
<view style="color: #fff; margin-top: 10rpx">填写下单</view>
1 year ago
</view>
3 months ago
<view
:class="['order-item', isPass !== 2 ? 'disabled-div' : '']"
style="background: #76c458"
@click.stop="scanOrder"
>
<image
src="@/static/image/scan.png"
mode="scaleToFill"
style="width: 57rpx; height: 57rpx"
/>
<view style="color: #fff; margin-top: 10rpx">扫码下单</view>
1 year ago
</view>
</view>
<view class="list">
3 months ago
<view style="color: #76c458">目前可用寄存仓库地址</view>
1 year ago
<u-divider :dashed="true" lineColor="#4E964D"></u-divider>
3 months ago
<view v-for="(item, index) in addressList" :key="item.ID">
1 year ago
<view class="list-item">
3 months ago
<view>{{ item.address }}</view>
<view>剩余{{ item.leftNum }}位置</view>
1 year ago
</view>
3 months ago
<u-divider
:dashed="true"
lineColor="#4E964D"
v-if="index !== addressList.length - 1"
></u-divider>
1 year ago
</view>
</view>
<tabbar :current="0"></tabbar>
</view>
1 year ago
</template>
<script>
1 year ago
import tabbar from "../../components/uiq-tabbar/uiq-tabbar.vue";
1 year ago
export default {
name: "index",
onLoad() {
1 year ago
uni.hideTabBar();
1 year ago
},
1 year ago
onShow() {
this.getAddress();
3 months ago
this.pddIsPass();
1 year ago
},
1 year ago
components: {
3 months ago
tabbar,
1 year ago
},
1 year ago
data() {
return {
3 months ago
addressList: [],
isPass: 0,
1 year ago
};
},
1 year ago
methods: {
scanOrder() {
3 months ago
if (this.isPass !== 2) return this.$common.msgToast("护照资料还在审核中");
3 months ago
uni.removeStorageSync("scanlist");
1 year ago
uni.scanCode({
onlyFromCamera: false,
3 months ago
success: (res) => {
1 year ago
console.log("条码类型:" + res.scanType);
console.log("条码内容:" + res.result);
1 year ago
uni.navigateTo({
3 months ago
url: "/pages/scanFeedback/index?url=" + res.result,
1 year ago
});
3 months ago
},
1 year ago
});
1 year ago
},
async getAddress() {
const res = await this.$api.deposit.address();
console.log(res);
if (res.status === 0) {
this.addressList = res.data.data;
} else {
this.$common.msgToast(res.msg);
}
},
goConsignmen() {
3 months ago
if (this.isPass !== 2) return this.$common.msgToast("护照资料还在审核中");
1 year ago
uni.navigateTo({
3 months ago
url: "/pages/consignment-painting/index",
1 year ago
});
3 months ago
},
async pddIsPass() {
const res = await this.$api.deposit.fddIsPass();
if (res.status === 0) {
this.isPass = res.data.fdd.status;
} else {
this.$common.msgToast(res.msg);
}
},
},
1 year ago
};
1 year ago
</script>
<style scoped lang="scss">
1 year ago
.main {
box-sizing: border-box;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
1 year ago
padding: 0 30rpx;
1 year ago
background-image: url("https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/4fdc9a0f-d72a-46b6-a04d-ed56d5465213.png");
1 year ago
1 year ago
.order {
width: 100%;
margin-top: 40rpx;
display: flex;
justify-content: space-between;
.order-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 330rpx;
height: 208rpx;
border-radius: 20rpx;
background: #4e964d;
}
3 months ago
.disabled-div {
opacity: 0.5; /* 降低透明度 */
}
1 year ago
}
.list {
margin-top: 40rpx;
width: 100%;
border-radius: 20rpx;
box-sizing: border-box;
padding: 12rpx 20rpx;
display: flex;
flex-direction: column;
background: #fff;
font-size: 24rpx;
.list-item {
width: 100%;
display: flex;
justify-content: space-between;
color: #939393;
}
}
}
1 year ago
</style>