提交 cd40620b authored 作者: 刘旭's avatar 刘旭

恢复删除文件

上级 f033fcb3
......@@ -39,6 +39,13 @@
}
},
{
"path": "pages/productLine/productLineDetails",
"style": {
"navigationBarTitleText": "产品线详情",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path": "pages/cart/index",
"style": {
"navigationBarTitleText": "购物车",
......
......@@ -4,7 +4,7 @@
<template #default>
<view style="display: flex; flex-direction: row; margin-left: 30rpx;">
<!-- <view style="margin-right: 30rpx" @tap="selectLineBody">{{ body ? '双线体' : '单线体' }}</view> -->
<view style="margin-right: 30rpx" @tap="selectFlowDirection">向({{ flow ? '右到左' : '左到右' }})</view>
<view style="margin-right: 30rpx" @tap="selectFlowDirection">拼接方向({{ flow ? '右到左' : '左到右' }})</view>
</view>
</template>
<template #right>
......@@ -161,7 +161,7 @@ onLoad((options: any) => {
let addTabs = () => {
if (lineList.value.length === 0) {
model.value.show = true
model.value.content = flow.value ? '确定流向为从右到左?' : '确定流向为从左到右?'
model.value.content = flow.value ? '确定产品线拼接方向为从右到左?' : '确定产品线拼接方向为从左到右?'
return
}
goodsSkuRef.value.goodsInfoCopy = null // 防止sku直接赋值
......
<template>
<view class="container">
<block v-for="res in detailData">
<view style="margin-bottom: 20rpx; background-color: #fff;">
<view style="width: 100%; text-align: end; padding: 20rpx 20rpx 0 0;">{{
res.name
}}</view>
<block v-for="(item, index) in res.values">
<view class="details">
<u-image width="140rpx" height="200rpx" :src="
item.picUrl.split('http').length > 1
? item.picUrl
: baseUrl + item.picUrl
" class="img"></u-image>
<view class="right">
<view class="name">{{ item.goodsName }}</view>
<view class="tag">
<block v-for="(item1, index1) in item.specifications?.length" :key="index1">
<u-tag :text="item.specifications[index1]" type="info" size="mini"
style="margin: 8rpx 8rpx 8rpx 0;" />
</block>
</view>
<text style="display: flex; justify-content: flex-end; color: #969799; font-size: 12px;">
x{{ item.number }}
</text>
</view>
</view>
<u-line v-if="res.values.length >= 1" color="#e8e8e8" />
</block>
</view>
</block>
<view class="content-footer">
<u-button shape="circle" type="error" size="mini" style="margin-right: 30;" @tap="toIndex">
返回首页
</u-button>
<view>
<u-button shape="circle" size="mini" @tap="generateQuote">生成报价</u-button>
<u-button shape="circle" size="mini" style="margin-left: 20rpx;" @tap="download">
下载技术规格书
</u-button>
</view>
</view>
</view>
<view style="height: 100rpx;"></view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { onLoad, onBackPress } from '@dcloudio/uni-app';
import { orderDetail } from '@/api/index';
import { getProductLineMultipleDetail } from '@/api/productLine';
import { useLineStore } from '@/store/useStore';
import config from '@/utils/config';
let store = useLineStore();
let baseUrl = config.baseUrl;
let enclosure = ref(''); // pdf key值
let detailData = ref([] as any);
let type = ref();
let orderId = ref();
onLoad((options: any) => {
type.value = options.type;
orderId.value = options.orderId;
// console.log(type.value, 'type.value');
initOrderData(options.orderId);
});
// 返回首页
let toIndex = () => {
uni.reLaunch({
url: '../index/index',
success() {
if (type.value === 'productline') {
store.$reset(); // 重置pinia数据
}
},
});
};
// 生成报价
let generateQuote = () => {
uni.navigateTo({
url: `../order/quotation?orderId=${orderId.value}&lineId=${0}`,
});
};
// 下载技术规格书pdf
let download = () => {
open(baseUrl + '/wx/storage/downloadFile/' + enclosure.value)
};
let lineNames = ref([] as any)
// 获取goodsId
let initOrderData = (orderId: number) => {
orderDetail({ orderId }).then((res: any) => {
if (res.data.code === 200) {
enclosure.value = res.data.data.orderInfo.enclosure;
let lineArr = [] as any
res.data.data.orderGoods.map((item: any, i: number) => {
if (item.goodsId) {
lineArr.push(item.goodsId)
lineNames.value.push({
id: item.goodsId,
name: item.goodsName
})
}
});
initProductLineMultipleDetail(lineArr)
}
});
};
let initProductLineMultipleDetail = (lineArr: []) => {
getProductLineMultipleDetail(lineArr).then((res: any) => {
if (res.data.code === 200) {
for (const key in res.data.data) {
lineNames.value.map((item: any) => {
if (key == item.id) {
detailData.value.push({
name: item.name,
values: res.data.data[key]
})
}
})
}
// console.log(detailData.value, 'getProductLineMultipleDetail', lineNames.value);
}
})
}
// 通过type判断返回页面
onBackPress((options: any) => {
if (type.value === 'productline') {
if (options.from === 'navigateBack') {
return false;
}
uni.switchTab({
url: '../productLine1/index',
success() {
store.$reset(); // 重置pinia数据
let pages = getCurrentPages(); //获取所有页面的数组对象
let currPage: any = pages[pages.length - 1]; //当前页面
uni.reLaunch({
url: '/' + currPage.route,
});
},
});
return true;
} else if (type.value === 'productLineCart') {
if (options.from === 'navigateBack') {
return false;
}
uni.switchTab({
url: '../cart/index',
success() {
let pages = getCurrentPages(); //获取所有页面的数组对象
let currPage: any = pages[pages.length - 1]; //当前页面
uni.reLaunch({
url: '/' + currPage.route,
});
},
});
return true;
}
});
</script>
<style lang="scss" scoped>
.container {
box-sizing: border-box;
margin: 16rpx;
// background-color: #fff;
.details {
width: 100%;
padding: 16rpx 32rpx;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
background-color: #fff;
.img {
margin-right: 20rpx;
}
.tag {
margin-top: 1%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-bottom: 5%;
}
.right {
width: 80%;
.sum-price {
display: flex;
justify-content: space-between;
}
}
}
.content-footer {
// margin-top: 50rpx;
padding: 50rpx;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
}
}
.footer {
position: fixed;
bottom: 0;
z-index: 99;
width: 100%;
height: 100rpx;
background-color: #fff;
padding: 0 32rpx;
line-height: 100rpx;
font-size: 30rpx;
font-weight: 600;
display: flex;
justify-content: space-between;
}
</style>
......@@ -2,8 +2,8 @@ const CONFIG: any = {
// 开发环境配置
development: {
assetsPath: 'http://192.168.60:81', // 静态资源路径
// baseUrl: 'http://192.168.0.9:8089', // 后台接口请求地址
baseUrl: 'http://192.168.0.60:81', // 后台接口请求地址
baseUrl: 'http://192.168.0.10:8089', // 后台接口请求地址
// baseUrl: 'http://192.168.0.60:81', // 后台接口请求地址
hostUrl: 'http://192.168.0.60:81', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论