| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <template>
- <view class="jxs-page">
- <view class="header-info">
- 进货总金额:{{jxsInfo.total_purchase}}
- </view>
- <view class="stock-list">
- <view class="stock-card" v-for="item in jxsInfo.stock_list" @click="goItem(item)">
- <view class="product-image-wrapper">
- <image class="product-image" :src="item.product_image" mode="aspectFill"></image>
- </view>
- <view class="product-info">
- <view class="product-name">{{item.product_name}}</view>
- <view class="product-stock">
- 库存:{{item.remaining_quantity}}
- </view>
- <view class="product-spec">
- 规格:{{item.suk}}
- </view>
- </view>
- <view class="promo-btn">
- <view class="promo-btn-text" @click.stop="showCode(item)">推广码</view>
- </view>
- </view>
- </view>
- <uni-popup type="center" ref="code">
- <view class="code-popup">
- <view class="code-title">推广码</view>
- <ikun-qrcode width="300" height="300" unit="rpx" :data="code" />
- <view class="code-close" @click="closeCode">关闭</view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- getJxsInfo
- } from '@/api/user.js'
- import {
- mapState
- } from 'vuex'
- export default {
- data() {
- return {
- code: '',
- jxsInfo: {
- dealer_level_grade: 0,
- dealer_level_name: '',
- dealer_name: '',
- stock_list: [],
- total_purchase: ''
- }
- }
- },
- computed: {
- ...mapState(['baseURL']),
- ...mapState('user', ['userInfo'])
- },
- methods: {
- goItem(item) {
- uni.navigateTo({
- url:'/pages/product/product?id=' + item.product_id + '&suk=' + item.suk + '&stock=' + item.remaining_quantity + '&attr=' + item.attr_unique
- })
- },
- getJxsInfo() {
- getJxsInfo().then(res => {
- this.jxsInfo = res.data
- })
- },
- showCode(item) {
- this.code = this.baseURL + '/index/#/pages/product/product?id=' + item.product_id + '&uid=' + this.userInfo
- .uid
- this.$refs.code.open()
- },
- closeCode() {
- this.$refs.code.close()
- }
- },
- onLoad() {
- this.getJxsInfo()
- }
- }
- </script>
- <style scoped>
- .jxs-page {
- background-color: #f5f5f5;
- padding: 20rpx;
- box-sizing: border-box;
- }
- .header-info {
- background-color: #fff;
- padding: 30rpx;
- border-radius: 16rpx;
- font-size: 32rpx;
- color: #333;
- margin-bottom: 20rpx;
- }
- .stock-list {
- display: flex;
- flex-wrap: wrap;
- gap: 20rpx;
- }
- .stock-card {
- width: calc(50% - 10rpx);
- background-color: #fff;
- border-radius: 16rpx;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- }
- .product-image-wrapper {
- position: relative;
- width: 100%;
- padding-bottom: 100%;
- }
- .product-image {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- .product-info {
- padding: 20rpx;
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: 12rpx;
- }
- .product-name {
- font-size: 28rpx;
- color: #333;
- font-weight: 500;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- .product-stock {
- font-size: 24rpx;
- color: #999;
- }
- .product-spec {
- font-size: 24rpx;
- color: #999;
- }
- .promo-btn {
- background-color: #FF6B6B;
- padding: 20rpx;
- text-align: center;
- margin-top: auto;
- }
- .promo-btn-text {
- font-size: 28rpx;
- color: #fff;
- font-weight: 500;
- }
- .code-popup {
- background-color: #ffffff;
- border-radius: 24rpx;
- padding: 50rpx 60rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 40rpx;
- width: 520rpx;
- box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.15);
- }
- .code-title {
- font-size: 36rpx;
- color: #333333;
- font-weight: 600;
- }
- .code-close {
- font-size: 28rpx;
- color: #999999;
- margin-top: 10rpx;
- padding: 20rpx 80rpx;
- border: 1rpx solid #e5e5e5;
- border-radius: 40rpx;
- }
- </style>
|