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

更新订单页面

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