积分兑换
This commit is contained in:
		@@ -24,28 +24,53 @@
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="list-content">
 | 
			
		||||
      <div class="list-info" v-for="(item, index) in goodsList" :key="index" v-if="goodsList.length">
 | 
			
		||||
        <div class="item" @click="toProductDetail(item)">
 | 
			
		||||
          <img :src="item.picUrl" alt="">
 | 
			
		||||
          <div class="type" :class="`type`+item.type">{{ $dict.getLabel('integralSGType', item.type) }}</div>
 | 
			
		||||
          <div class="content">
 | 
			
		||||
            <p class="text">{{item.title}}</p>
 | 
			
		||||
            <div class="item-money">
 | 
			
		||||
              <h3>{{item.integralPrice}}积分</h3>
 | 
			
		||||
              <p v-if="item.type == 1">+¥{{item.payMoney}}</p>
 | 
			
		||||
              <span v-if="item.type == 1">兑换后再付</span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-if="item.status == 1">
 | 
			
		||||
              <div class="btn" :class="total >= item.integralPrice ? 'btn1' : 'btn0'" @click.stop="toOrder(item)" v-if="item.stock > 0">{{total >= item.integralPrice ? '去兑换' : '积分不足'}}</div>
 | 
			
		||||
              <div class="btn btn0" :class="`btn`+item.status" v-else>商品缺货</div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div v-else>
 | 
			
		||||
              <div class="btn btn0">店铺停用</div>
 | 
			
		||||
      <div class="left-list">
 | 
			
		||||
        <div class="list-info" v-for="(item, index) in leftList" :key="index" v-if="goodsList.length">
 | 
			
		||||
          <div class="item" @click="toProductDetail(item)">
 | 
			
		||||
            <img :src="item.picUrl" alt="">
 | 
			
		||||
            <div class="type" :class="`type`+item.type">{{ $dict.getLabel('integralSGType', item.type) }}</div>
 | 
			
		||||
            <div class="content">
 | 
			
		||||
              <p class="text">{{item.title}}</p>
 | 
			
		||||
              <div class="item-money">
 | 
			
		||||
                <h3>{{item.integralPrice}}积分</h3>
 | 
			
		||||
                <p v-if="item.type == 1">+¥{{item.payMoney}}</p>
 | 
			
		||||
                <span v-if="item.type == 1">兑换后再付</span>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div v-if="item.shopStatus == 1">
 | 
			
		||||
                <div class="btn" :class="total >= item.integralPrice ? 'btn1' : 'btn0'" @click.stop="toOrder(item)" v-if="item.stock > 0">{{total >= item.integralPrice ? '去兑换' : '积分不足'}}</div>
 | 
			
		||||
                <div class="btn btn0" v-else>商品缺货</div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div v-else>
 | 
			
		||||
                <div class="btn btn0">店铺停用</div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <AiEmpty v-else></AiEmpty>
 | 
			
		||||
      <div class="right-list">
 | 
			
		||||
        <div class="list-info" v-for="(item, index) in rightList" :key="index" v-if="goodsList.length">
 | 
			
		||||
          <div class="item" @click="toProductDetail(item)">
 | 
			
		||||
            <img :src="item.picUrl" alt="">
 | 
			
		||||
            <div class="type" :class="`type`+item.type">{{ $dict.getLabel('integralSGType', item.type) }}</div>
 | 
			
		||||
            <div class="content">
 | 
			
		||||
              <p class="text">{{item.title}}</p>
 | 
			
		||||
              <div class="item-money">
 | 
			
		||||
                <h3>{{item.integralPrice}}积分</h3>
 | 
			
		||||
                <p v-if="item.type == 1">+¥{{item.payMoney}}</p>
 | 
			
		||||
                <span v-if="item.type == 1">兑换后再付</span>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div v-if="item.shopStatus == 1">
 | 
			
		||||
                <div class="btn" :class="total >= item.integralPrice ? 'btn1' : 'btn0'" @click.stop="toOrder(item)" v-if="item.stock > 0">{{total >= item.integralPrice ? '去兑换' : '积分不足'}}</div>
 | 
			
		||||
                <div class="btn btn0" v-else>商品缺货</div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div v-else>
 | 
			
		||||
                <div class="btn btn0">店铺停用</div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <AiEmpty v-if="!goodsList.length"></AiEmpty>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -72,6 +97,8 @@ export default {
 | 
			
		||||
      pointTypeList: [{name: '全部'}, {name: '50分以下'},  {name: '100分以下'},  {name: '200分以下'},  {name: '5000分以下'}],
 | 
			
		||||
      currentPoint: 0,
 | 
			
		||||
      goodsList: [],
 | 
			
		||||
      leftList: [],
 | 
			
		||||
      rightList: [],
 | 
			
		||||
      total: 0,
 | 
			
		||||
      current: 1
 | 
			
		||||
    }
 | 
			
		||||
@@ -98,6 +125,8 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    getListInit() {
 | 
			
		||||
      this.goodsList = []
 | 
			
		||||
      this.leftList = []
 | 
			
		||||
      this.rightList = []
 | 
			
		||||
      this.current = 1
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
@@ -113,6 +142,13 @@ export default {
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        if (res.code === 0) {
 | 
			
		||||
          this.goodsList = this.current == 1 ? res.data.records : [...this.goodsList, ...res.data.records]
 | 
			
		||||
          res.data.records.map((item, index) => {
 | 
			
		||||
            if(index%2 ==0) {
 | 
			
		||||
              this.leftList.push(item)
 | 
			
		||||
            }else {
 | 
			
		||||
              this.rightList.push(item)
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
@@ -224,10 +260,14 @@ export default {
 | 
			
		||||
    padding: 396px 0 24px 24px;
 | 
			
		||||
    background-color: #f3f6f9;
 | 
			
		||||
    overflow: hidden;
 | 
			
		||||
    .list-info {
 | 
			
		||||
    .left-list,
 | 
			
		||||
    .right-list {
 | 
			
		||||
      width: 50%;
 | 
			
		||||
      float: left;
 | 
			
		||||
    }
 | 
			
		||||
    .list-info {
 | 
			
		||||
      width: 100%;
 | 
			
		||||
    }
 | 
			
		||||
    .item {
 | 
			
		||||
      width: calc(100% - 24px);
 | 
			
		||||
      background-color: #fff;
 | 
			
		||||
 
 | 
			
		||||
@@ -13,11 +13,13 @@
 | 
			
		||||
      <p>商品描述:</p>
 | 
			
		||||
      <p v-html="goodsInfo.description"></p>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="btn" @click="toOrder()" v-if="goodsInfo.status == 1">
 | 
			
		||||
    <div class="btn" @click="toOrder()" v-if="goodsInfo.shopStatus == 1">
 | 
			
		||||
      <div :class="total >= goodsInfo.integralPrice ? 'status1' : 'status0'" v-if="goodsInfo.stock > 0">{{total >= goodsInfo.integralPrice ? '立即兑换' : '积分不足'}}</div>
 | 
			
		||||
      <div class="status0" v-else>商品缺货</div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="btn btn0" v-else>店铺停用</div>
 | 
			
		||||
    <div class="btn" v-else>
 | 
			
		||||
      <div class="status0">店铺停用</div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user