123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <template>
- <view class="page">
- <view v-if="pageStatus != 'platform'">
- <view class="top-fail" v-if="status != 2">
- <image
- src="../../static/mine/332.png"
- class="fail-icon"
- mode=""
- ></image>
- <text v-if="status == 1">涉及敏感文字,您发布的商品审核未通过</text>
- <text v-if="status == 3">该商品已下架,如有需要请重新上架</text>
- </view>
- <view class="fail" v-else>
- <image
- src="../../static/mine/333.png"
- class="fail-icon"
- mode=""
- ></image>
- <text>商品还在审核中,请耐心等待</text>
- </view>
- </view>
- <image class="goods-img" :src="commodityDetail.image" mode=""></image>
- <view class="price" v-if="commodityDetail.discount_price">
- <text style="font-size: 20rpx">折扣价</text>
- <text style="font-size: 18rpx">¥</text>
- <text style="font-size: 36rpx; font-weight: 600">{{
- commodityDetail.discount_price.split(".")[0]
- }}</text
- >.
- <text style="font-size: 18rpx">{{
- commodityDetail.discount_price.split(".")[1]
- }}</text>
- </view>
- <view class="goods-title">
- {{ commodityDetail.name_cn }}
- </view>
- <view class="goods-detail"> 商品详情 </view>
- <view class="detail">
- <!-- v-for="item in commodityDetail.images.split(',')" -->
- <image class="detail-img" :src="commodityDetail.images" mode=""></image>
- </view>
- <view class="footer">
- <!-- <button class="btn">编辑商品</button> -->
- <button class="btn" @click="groundingCommodity">上架商品</button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- status: 2,
- goodsId: 0,
- pageStatus: "",
- commodityDetail: {},
- };
- },
- onLoad(options) {
- this.goodsId = options.goodsId;
- this.pageStatus = options.pageStatus;
- if (options.pageStatus == "platform") {
- this.getGoodsDetail();
- }
- },
- methods: {
- getGoodsDetail() {
- uni.$u.http
- .get(`/api/goods/platform_goods_details/${this.goodsId}`)
- .then((res) => {
- this.commodityDetail = res;
- });
- },
- //上架商品
- groundingCommodity() {
- uni.$u.http
- .post(`/api/goods/elencazione`, { goods_id: this.commodityDetail.id })
- .then((res) => {
- console.log(res);
- });
- },
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: "商品详情",
- });
- },
- };
- </script>
- <style lang="scss" scoped>
- .page {
- background-color: #fff;
- .top-fail {
- height: 60rpx;
- background-color: #fff1ee;
- padding-left: 24rpx;
- display: flex;
- align-items: center;
- font-size: 24rpx;
- color: #333;
- .fail-icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 10rpx;
- }
- }
- .fail {
- height: 60rpx;
- background-color: #fff1d7;
- padding-left: 24rpx;
- display: flex;
- align-items: center;
- font-size: 24rpx;
- color: #333;
- .fail-icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 10rpx;
- }
- }
- .goods-img {
- width: 100%;
- height: 750rpx;
- }
- .price {
- color: #f83224;
- margin-top: 36rpx;
- padding-left: 40rpx;
- font-weight: 600;
- }
- .goods-title {
- padding: 0 40rpx;
- font-size: 32rpx;
- margin-top: 20rpx;
- }
- .goods-detail {
- font-size: 28rpx;
- margin-top: 84rpx;
- padding-left: 40rpx;
- }
- .detail {
- padding: 24rpx 20rpx;
- .detail-img {
- width: 100%;
- }
- }
- .footer {
- position: fixed;
- bottom: 0;
- width: 100%;
- padding-bottom: 84rpx;
- padding-top: 20rpx;
- background-color: #fff;
- .btn {
- border-radius: 52rpx;
- background-color: #f83224;
- color: #fff;
- border: none;
- padding: 0;
- margin: 0;
- width: 94%;
- font-size: 30rpx;
- margin: 0 auto;
- }
- }
- }
- </style>
|