|
|
|
@ -1,21 +1,19 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="wrap"> |
|
|
|
|
<view class="banner-wrap bg-wh"> |
|
|
|
|
<view class="pic-wrap"> |
|
|
|
|
<image class="pic" :src="form.mall.coverDrawing" mode="widthFix"></image> |
|
|
|
|
<view class="pro-title">{{ form.mall.productName }}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="top"> |
|
|
|
|
<view class="name">{{ form.classificationName }}</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="detail"> |
|
|
|
|
<ul class="tabs"> |
|
|
|
|
<li :class="{active: curTab === 0}" @click="tabChange(0)">主页</li> |
|
|
|
|
<li :class="{active: curTab === 1, disabled: !form.interfaceDiagram}" @click="tabChange(1)">商品</li> |
|
|
|
|
<li :class="{active: curTab === 1}" @click="tabChange(1)">商品</li> |
|
|
|
|
</ul> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view v-if="!curTab" class="detail"> |
|
|
|
|
<view class="title">公司简介</view> |
|
|
|
|
<view v-html="form.briefIntroduction"></view> |
|
|
|
|
</view> |
|
|
|
|
<view v-else class="list"> |
|
|
|
|
<!-- <view class="item"> |
|
|
|
@ -51,10 +49,11 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { queryTeamInfo } from '@/apis/modules/user.js' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
id: '', |
|
|
|
|
teamId: '', |
|
|
|
|
curTab: 0, |
|
|
|
|
tabs: [ |
|
|
|
|
{ |
|
|
|
@ -71,13 +70,8 @@ |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
form: { |
|
|
|
|
classificationIds: [], |
|
|
|
|
interfaceDiagram: [], |
|
|
|
|
mall: { |
|
|
|
|
coverDrawing: '' |
|
|
|
|
}, |
|
|
|
|
goodsRes: {}, |
|
|
|
|
mallAnnex: [] |
|
|
|
|
classificationName: '', |
|
|
|
|
briefIntroduction: '' |
|
|
|
|
}, |
|
|
|
|
shopCartTotal: 0, |
|
|
|
|
types: [], |
|
|
|
@ -97,129 +91,25 @@ |
|
|
|
|
onShow() { |
|
|
|
|
const pages = getCurrentPages() |
|
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
|
this.id = options.id |
|
|
|
|
this.teamId = options.teamId |
|
|
|
|
this.getInfo() |
|
|
|
|
this.getShopCart() |
|
|
|
|
this.getTypes() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取详情 |
|
|
|
|
getInfo() { |
|
|
|
|
async getInfo() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
detailsOfGoods(this.id).then(res => { |
|
|
|
|
const e = res.orderDetails |
|
|
|
|
e.mall.productIntroduction = this.$util.removeTag(e.mall.productIntroduction) |
|
|
|
|
// e.mall.detailedIntroduction = this.$util.removeTag(e.mall.detailedIntroduction) |
|
|
|
|
this.form = e |
|
|
|
|
const pics = this.form.mall.interfaceDiagram |
|
|
|
|
if (pics) { |
|
|
|
|
this.form.interfaceDiagram = pics.split(',') |
|
|
|
|
// this.tabs.push({ |
|
|
|
|
// name: '界面图', |
|
|
|
|
// id: 1 |
|
|
|
|
// }) |
|
|
|
|
} |
|
|
|
|
// this.form.mallAnnex && this.form.mallAnnex.length && this.tabs.push({ |
|
|
|
|
// name: '参数', |
|
|
|
|
// id: 2 |
|
|
|
|
// }) |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
const res = await queryTeamInfo({ |
|
|
|
|
teamId: this.teamId |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 获取购物车数量 |
|
|
|
|
getShopCart() { |
|
|
|
|
shoppingCartList({ |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
this.shopCartTotal = data.total |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}, |
|
|
|
|
// 产品分类 |
|
|
|
|
getTypes() { |
|
|
|
|
productCategoryList().then(res => { |
|
|
|
|
this.types = res.classificationList |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
this.form = res.teamInfo |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}, |
|
|
|
|
// tab切换 |
|
|
|
|
tabChange(id) { |
|
|
|
|
this.curTab = id |
|
|
|
|
}, |
|
|
|
|
// 下载全部 |
|
|
|
|
downloadAll() { |
|
|
|
|
const fileName = [] |
|
|
|
|
const urls = [] |
|
|
|
|
this.form.mallAnnex.forEach(e => { |
|
|
|
|
fileName.push(e.fileName) |
|
|
|
|
urls.push(e.filePath) |
|
|
|
|
}) |
|
|
|
|
uni.setStorageSync('files', { |
|
|
|
|
copyWriting: this.form.mall.productName, |
|
|
|
|
fileName, |
|
|
|
|
urls |
|
|
|
|
}) |
|
|
|
|
this.$util.to(`/team/send/send`) |
|
|
|
|
}, |
|
|
|
|
// 下载附件 |
|
|
|
|
download(item) { |
|
|
|
|
uni.setStorageSync('files', { |
|
|
|
|
copyWriting: this.form.mall.productName, |
|
|
|
|
fileName: [item.fileName], |
|
|
|
|
urls: [item.filePath] |
|
|
|
|
}) |
|
|
|
|
this.$util.to(`/team/send/send`) |
|
|
|
|
}, |
|
|
|
|
// 加入购物车 |
|
|
|
|
addShop() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
addToShoppingCart({ |
|
|
|
|
mallId: this.id |
|
|
|
|
}).then(res => { |
|
|
|
|
this.$util.sucMsg('加购成功') |
|
|
|
|
uni.hideLoading() |
|
|
|
|
this.getShopCart() |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 下单 |
|
|
|
|
order() { |
|
|
|
|
const { mall } = this.form |
|
|
|
|
const classificationId = this.form.classificationIds[0] |
|
|
|
|
const authority = this.$util.getOrderType(classificationId) |
|
|
|
|
// 把该产品添加至缓存 |
|
|
|
|
uni.setStorageSync('courses', [{ |
|
|
|
|
dataOrCourseId: mall.associatedProduct, // id |
|
|
|
|
mallId: mall.mallId, |
|
|
|
|
productName: mall.productName, // 名称 |
|
|
|
|
periodOfUse: '', // 使用期限 |
|
|
|
|
startTime: this.$util.formatDate(new Date(), 'yyyy-MM-dd'), // 开始 |
|
|
|
|
endTime: '', // 终止 |
|
|
|
|
remainingPeriod: '', // 剩余期限 |
|
|
|
|
marketValue: '', // 市场价 |
|
|
|
|
marketPrice: mall.marketUnitPrice, // 市场单价 |
|
|
|
|
finalPrice: 0, // 成交价 |
|
|
|
|
finalValue: 0, // 成交单价(数据产品特有) |
|
|
|
|
discountRate: '0%', // 折扣率 |
|
|
|
|
accountNum: 1, // 账号数 |
|
|
|
|
totalAmount: '', // 总价 |
|
|
|
|
isEnable: 0, // 启用否:1启用,0禁用 |
|
|
|
|
ship: 0, // 发货否(0未发货,1已发货,默认不发货) |
|
|
|
|
authority, // 区分权限 |
|
|
|
|
options: 2, |
|
|
|
|
miniProgramPictureAddress: mall.appletIcon || '', // 图标 |
|
|
|
|
settlementPrice: 0, // 结算价 |
|
|
|
|
settlementPriceUnit: 0, // 结算单价 |
|
|
|
|
serviceFee: 0 // 平台服务费(前端计算后展示,不入库) |
|
|
|
|
}]) |
|
|
|
|
this.$util.to(`../orderDetail/orderDetail?shopCart=1`) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
@ -228,38 +118,10 @@ |
|
|
|
|
.wrap { |
|
|
|
|
padding-bottom: 140rpx; |
|
|
|
|
} |
|
|
|
|
.banner-wrap { |
|
|
|
|
width: 100%; |
|
|
|
|
border-radius: 0px 0px 20px 20px; |
|
|
|
|
.pic-wrap { |
|
|
|
|
padding: 20rpx 32rpx; |
|
|
|
|
border-bottom: 1px solid #E2E2E2; |
|
|
|
|
} |
|
|
|
|
.pic { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
.pro-title { |
|
|
|
|
margin-top: 22rpx; |
|
|
|
|
.top { |
|
|
|
|
padding: 20rpx; |
|
|
|
|
.name { |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
font-weight: 600; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
.fields { |
|
|
|
|
padding: 26rpx 32rpx; |
|
|
|
|
} |
|
|
|
|
.field { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
color: #333; |
|
|
|
|
&:first-child { |
|
|
|
|
margin-bottom: 22rpx; |
|
|
|
|
} |
|
|
|
|
.icon { |
|
|
|
|
width: 36rpx; |
|
|
|
|
height: 36rpx; |
|
|
|
|
margin-right: 12rpx ; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.tabs { |
|
|
|
|