提交 1b84dc09 authored 作者: 刘旭's avatar 刘旭

更新订单页面

上级 cc80daf0
......@@ -100,17 +100,18 @@ let initHavePage = async () => {
title: '加载中...'
});
let res: any = await getHavePage();
if (res.statusCode == 200) {
console.log(res, '模板数据');
uni.hideLoading()
uni.hideLoading();
currencyPage.value = res.data.currencyPage;
uni.$emit('previewData', { previewData: res.data.customPage });
}
};
initHavePage();
</script>
<style lang="scss" scoped>
page {
background-color: #f2f2f2;
}
.status_bar {
height: var(--status-bar-height);
width: 100%;
......
......@@ -2,14 +2,14 @@
<view class="order-container">
<view class="status_bar"><!-- 这里是状态栏 --></view>
<headerVue :color="color" />
<view v-for="(item1, i) in titleImg" :key="i" class="content">
<!-- <view v-for="(item1, i) in titleImg" :key="i" class="content">
<image :src="item1.imgUrl" mode="" class="order-image"></image>
<view v-for="(item, i) in orderData" :key="item.id" class="order-content">
<view class="order-left">
<!-- <checkbox-group @change="selected" style="margin: 0 10rpx;">
<checkbox-group @change="selected" style="margin: 0 10rpx;">
<label><checkbox class="selected" color="#555555" :checked="checked" /></label>
</checkbox-group> -->
<image :src="item.picUrl" mode="widthFix" class="order-left-image"></image>
</checkbox-group>
<image :src="item.picUrl" mode="heightFix" class="order-left-image"></image>
</view>
<view class="order-right">
<text class="details-top">{{ item.goodsName }}</text>
......@@ -18,18 +18,36 @@
<text style="color: #d50000; font-size: 34rpx">{{ item.price }}</text>
<text style="font-size: 24rpx; color: #ccc; margin-left: 20rpx">{{ item.number + '件' }}</text>
<!-- <text style="font-size: 24rpx; color: #ccc; margin-left: 20rpx">瓶 10件起订</text> -->
<!-- <view class="details-sum">
<text style="font-size: 24rpx; color: #ccc; margin-left: 20rpx">瓶 10件起订</text>
<view class="details-sum">
<text class="subtract" @click="reduce">-</text>
<text class="num">{{ num }}</text>
<text class="add" @click="add">+</text>
</view>
</view>
</view>
</view>
</view> -->
<view v-for="(item, index) in orderData" class="or-content">
<view class="or-top">
<text>订单编号:{{ item.orderSn }}</text>
<text>合计:¥{{ item.actualPrice }}</text>
</view>
<view v-for="(item1, i) in item.goodsList" class="or-bottom">
<view class="or-left"><image :src="item1.picUrl" class="or-left-image" /></view>
<view class="order-right">
<text class="details-top">{{ item1.goodsName }}</text>
<text class="details-center">{{ item1.specifications[0] }}</text>
<view class="details-bottom">
<text style="color: #d50000; font-size: 34rpx">{{ item1.price }}</text>
<text style="font-size: 24rpx; color: #ccc; margin-left: 20rpx">{{ item1.number + '件' }}</text>
</view>
</view>
</view>
</view>
<text style="font-size: 24rpx; padding: 0 30rpx; color:#ccc">订购 时间:2022.8.24</text>
<!-- <text style="font-size: 24rpx; padding: 0 30rpx; color:#ccc">订购 时间:2022.8.24</text> -->
<view class="qr-code">
<text style="margin-right: 60rpx;">科 技 赋 能</text>
<image src="../../static/msjf-picture/msjf-13.png" mode="widthFix" style="width: 144rpx;"></image>
......@@ -80,7 +98,7 @@ let titleImg = ref([
// 获取订单数据
let initOrderList = async () => {
let res: any = await getOrderList();
if (res.data.errno === 0) orderData.value = res.data.data.list[0].goodsList;
if (res.data.errno === 0) orderData.value = res.data.data.list;
};
onLoad(() => {
......@@ -89,11 +107,67 @@ onLoad(() => {
</script>
<style lang="scss" scoped>
page {
background-color: #f2f2f2;
}
.status_bar {
height: var(--status-bar-height);
width: 100%;
}
.order-container {
width: 100%;
height: 100vh;
.or-content {
margin-top: 30rpx;
width: 100%;
background-color: #fff;
.or-top {
box-sizing: border-box;
display: flex;
justify-content: space-between;
padding: 0 20rpx;
width: 100%;
height: 60rpx;
line-height: 60rpx;
font-size: 14px;
}
.or-bottom {
padding: 10rpx 30rpx;
box-sizing: border-box;
// display: flex;
// flex-direction: row;
// align-items: center;
// justify-content: space-around;
border-top: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
.or-left {
float: left;
margin-right: 14%;
.or-left-image {
width: 130rpx;
height: 160rpx;
border-radius: 10rpx;
}
}
.order-right {
display: flex;
flex-direction: column;
.details-top {
margin-bottom: 4%;
}
.details-center {
margin-bottom: 3%;
}
.details-bottom {
display: flex;
justify-content: space-between;
}
}
}
}
.content {
padding: 30rpx;
.order-image {
......@@ -105,15 +179,15 @@ onLoad(() => {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
min-height: 180rpx;
max-height: 200rpx;
height: 100px;
padding: 10rpx 20rpx;
border: 1px solid #dfdfdf;
border-radius: 10rpx;
margin-bottom: 10rpx;
background: #fff !important;
.order-left {
width: 260rpx;
height: 100%;
......@@ -121,11 +195,10 @@ onLoad(() => {
align-items: center;
margin-right: 20rpx;
.order-left-image {
width: 120rpx;
// width: 120rpx;
height: 78px;
border-radius: 10rpx;
margin-right: 30rpx;
background-color: #ccc;
}
}
.order-right {
......
......@@ -77,7 +77,7 @@ let confirm = async (data: any) => {
<style lang="scss" scoped>
page {
background-color: #eceff6;
background-color: #f2f2f2;
}
.status_bar {
height: var(--status-bar-height);
......
......@@ -2,13 +2,15 @@
<view class="upload-container">
<uni-section title="定制" type="line">
<view class="choose-img">
<view v-for="(item, index) in imageVideoData" :key="index" class="box-img">
<view v-if="item.type == 'image/jpeg'" style="width: 100%;"><image :src="item.path" mode="widthFix" class="img-list" /></view>
<view v-for="(item, index) in imageVideoData" :key="index" :data="index" class="box-img">
<view style="width: 100%;">
<view v-if="item.type == 'image/jpeg'" style="width: 100%;"><image :src="item.path" mode="widthFix" class="img-list" lazy-load /></view>
<view v-else style="width: 100%;"><video :src="item.path" object-fit="fill" class="img-list" /></view>
<view class="iconfont icon-icons03 replace" @click="replaceImg(index)" style="color: #007aff;"></view>
<view class="iconfont icon-shanchu delele" @click="deleteImg(index)" style="color: #F56C6C;"></view>
</view>
</view>
</view>
<view type="primary" @click="upload" style="margin-top: 40rpx;" class="addImage"><view class="iconfont icon-jia"></view></view>
<button type="primary" @click="save" style="margin-top: 40rpx;">保存</button>
</uni-section>
......@@ -16,9 +18,9 @@
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { saveCustomPage, downLoad } from '@/services/api';
import { saveCustomPage } from '@/services/api';
import { baseURL } from '@/services/request';
let imageVideoData = ref([] as any);
......@@ -45,6 +47,9 @@ onLoad((options: any) => {
}
});
}
setTimeout(() => {
console.log(imageVideoData.value);
}, 50);
} else if (type == 'edit') {
// 编辑模板列表
let pageData = JSON.parse(options.pageData);
......@@ -104,7 +109,7 @@ let uploadVideo = () => {
let save = () => {
if (templateId) {
let idArr = [];
let idArr: any = [];
for (let key in imageVideoData.value) {
uni.uploadFile({
url: baseURL + '/wx/customPage/upload',
......@@ -118,7 +123,7 @@ let save = () => {
idArr.push(res.data);
if (Number(key) == imageVideoData.value.length - 1) {
saveCustomPage({ fileIds: idArr, id: templateId.value }).then((res: any) => {
if (res.statusCode == 200) {
if (res.data.errno == 0) {
uni.hideLoading();
imageVideoData.value = [];
close();
......@@ -133,7 +138,7 @@ let save = () => {
});
}
} else {
let idArr = [];
let idArr: any = [];
for (let key in imageVideoData.value) {
uni.uploadFile({
url: baseURL + '/wx/customPage/upload',
......@@ -223,9 +228,10 @@ let close = () => {
uni.navigateBack({
delta: 1,
success: () => {
var pages: any = getCurrentPages();
var currPage = pages[pages.length - 1]; //当前页面
var prePage = pages[pages.length - 2]; //上一个页面
let pages: any = getCurrentPages();
let currPage = pages[pages.length - 1]; //当前页面
let prePage = pages[pages.length - 2]; //上一个页面
console.log('返回刷新');
prePage.$vm.initHavePage();
}
});
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论