123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <template>
- <view>
- <view class="product_detail">
- <!-- <image src="../../../static/news.jpg" mode="widthFix" class="pic"></image> -->
- <view class="box">
- <view class="title">{{ item.goodsName }}</view>
- <view class="clear"></view>
- <u-divider text="详情"></u-divider>
- <view class="item">
- <text class="desc">车牌号:</text>
- <text>{{ item.veNo }}</text>
- <view class="clear"></view>
- </view>
- <view class="item">
- <text class="desc">商品重量:</text>
- <text v-if="type==1">{{ item.goodsNames }} </text>
- <text v-if="type==2">{{ item.goodsName }} </text>
- </view>
- <view class="item">
- <text class="desc">商品名称:</text>
- <text v-if="type==1">{{ item.sumNetWt }} kg</text>
- <text v-if="type==2">{{ item.netWet }} kg</text>
- </view>
- <view class="item">
- <text class="desc">货主:</text>
- <text v-if="type==1">{{ item.shopName }}</text>
- <text v-if="type==2">{{ item.leaderName }}</text>
- </view>
- <view class="item">
- <text class="desc">互市区:</text>
- <text v-if="type==2">{{ item.tradeAreaName }}</text>
- <text v-if="type==1">{{ item.fieldName }}</text>
- <view class="clear"></view>
- </view>
- <view class="item">
- <text class="desc">发布时间:</text>
- <text>{{ item.createTime }}</text>
- <view class="clear"></view>
- </view>
- <view class="item">
- <text class="desc">总金额:</text>
- <text v-if="type==2" class="price">¥ {{ item.resalePrice }}</text>
- <text v-if="type==1" class="price">¥ {{ item.sumUpPrice }}</text>
- <view class="clear"></view>
- </view>
- </view>
- </view>
- <view class="mfooter">
- <view class="flex">
- <view class="f">
- <button class="btn" v-if="user.userType == 3" @click="pay()">立即购买</button>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- user: this.getUser(),
- item: {},
- id: '',
- type: 1
- };
- },
- onLoad(e) {
- if (e.id) {
- this.id = e.id;
- this.type = e.type
- this.getDetail()
- }
- },
- methods: {
- getDetail() {
- if (this.type == 1) {
- this.getWholeDetails();
- } else {
- this.getOrdersDetails()
- }
- },
- getOrdersDetails() {
- this.http.request({
- url: '/level-two-server/app/TbOrders/getDetailById',
- method: 'POST',
- data: {
- ids: this.id
- },
- success: res => {
- let data = res.data.data;
- this.item = data[0];
- }
- });
- },
- getWholeDetails() {
- this.http.request({
- url: '/level-one-server/app/HtTradeSettlement/getByIds',
- method: 'POST',
- data: {
- ids: this.id
- },
- success: res => {
- this.item = res.data.data[0];
- }
- });
- },
- buyOrder() {
- this.http.request({
- url: '/level-two-server/app/TbOrders/purchaserBuy',
- method: 'POST',
- data: {
- ids: this.id
- },
- success: res => {
- uni.navigateTo({
- url: '/pages/market/two/leader/success'
- });
- }
- });
- },
- buyWhole() {
- this.http.request({
- url: '/level-two-server/app/TbOrders/purchaserBuyWhole',
- method: 'POST',
- data: {
- ids: this.id
- },
- success: res => {
- uni.navigateTo({
- url: '/pages/market/two/leader/success'
- });
- }
- });
- },
- pay() {
- uni.showModal({
- title: '提示',
- content: '确定下单购买?',
- success: res => {
- if (res.confirm) {
- if (this.type == 1) {
- this.buyWhole()
- } else {
- this.buyOrder()
- }
- }
- }
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- .price {
- color: red;
- font-weight: bold;
- }
- background-color: $pg;
- }
- </style>
|