peng
2 天以前 f516f492d09c029e750466ff0f11b8e61e0113e1
礼品卡包支持二维码
1个文件已修改
71 ■■■■■ 已修改文件
manager/src/views/order/cardPack/cardPack.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager/src/views/order/cardPack/cardPack.vue
@@ -133,6 +133,25 @@
          ></Page>
        </Row>
      </Modal>
      <Modal
        v-model="showGeneralQrCode"
        title="二维码"
        width="800"
        :mask-closable="false"
        :loading="codeLoading"
      >
        <vue-qr
          :text="QRCodeUrl"
          :margin="0"
          colorDark="#000"
          colorLight="#fff"
          :size="150"
        ></vue-qr>
        <div slot="footer">
          <Button type="text" @click="closeGeneralQrCode">关闭</Button>
          <!--          <Button type="primary" @click="generalQrCode">确认</Button>-->
        </div>
      </Modal>
    </Card>
  </div>
</template>
@@ -140,8 +159,12 @@
<script>
import { getCardPackData } from '@/api/cardPack'
import { getOrderList }  from '@/api/order'
import vueQr from "vue-qr";
export default {
  name: "CarPack",
  components: {
    "vue-qr": vueQr,
  },
  data() {
    return {
      modelShow:false,
@@ -411,15 +434,63 @@
              style: { color }
            }, text);
          }
        }, {
          title: "操作",
          key: "action",
          align: "center",
          width: 150,
          fixed: "right",
          render: (h, params) => {
            const buttons = [];
            // // 根据订单状态为'PAID'时显示额外操作按钮
            console.log('--------------------->',params.row.claimStatus )
            if (params.row.claimStatus === 'NOT_CLAIM') {
              buttons.push(
                h(
                  "Button",
                  {
                    props: {type: "primary", size: "small"},
                    style: {marginRight: "5px"},
                    on: {
                      click: () => {
                        this.handlerEditorQrcode(params.row);
                      },
                    },
                  },
                  "生成卡包二维码"
                )
              );
            }
            return h('div', buttons);
          }
        }
      ],
      QRCodeUrl:'',
      showGeneralQrCode:false,
      codeLoading:false,
    }
  },
  mounted(){
    //初始化
    this.getData();
  },
  methods: {
    closeGeneralQrCode(){
      this.showGeneralQrCode = false;
    },
    handlerEditorQrcode(row){
      this.QRCodeUrl = '';
      this.showGeneralQrCode = true
      this.codeLoading = true;
      //获得商品对应的第一个skuid
      this.codeLoading = false;
      this.QRCodeUrl = this.QRcodeBaseUrl+ '/scanpage/claimCoupon'+'?id='+row.id
      console.log(this.QRCodeUrl);
    },
    // 搜索
    handleSearch() {
      this.searchForm.pageNumber = 1;