zxl
1 天以前 18f2f183b1b50f36e810dad2c8c7aebd69366bcb
manager/src/views/seller/shop/shopList.vue
@@ -42,6 +42,27 @@
        <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
          size="small" show-total show-elevator show-sizer></Page>
      </Row>
      <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>
@@ -53,10 +74,20 @@
  enableBrand,
  shopAudit,
} from "@/api/shops";
import vueQr from "vue-qr";
export default {
  components:{
    "vue-qr": vueQr,
  },
  name: "shop",
  data() {
    return {
      QRCodeUrl:"",
      showGeneralQrCode:false,
      codeLoading:false,
      codeUrl: this.QRcodeBaseUrl+ '/scanpage/my',
      loading: true, // 表单加载状态
      searchForm: {
        // 搜索框初始化对象
@@ -148,6 +179,7 @@
          fixed: "right",
          render: (h, params) => {
            let enableOrDisable = "";
            let qrCodeButton = "";
            if (params.row.storeDisable == "OPEN") {
              enableOrDisable = h(
                "Button",
@@ -165,8 +197,28 @@
                    },
                  },
                },
                "关闭"
                "关闭",
              );
              qrCodeButton = h(
                "Button",
                {
                  props: {
                    type: "warning",
                    size: "small",
                    ghost: true
                  },
                  style: {
                    marginRight: "5px",
                  },
                  on: {
                    click: () => {
                      this.generalQrCode(params.row);
                    },
                  },
                },
                "二维码"
              );
            } else if (params.row.storeDisable == "CLOSED") {
              enableOrDisable = h(
                "Button",
@@ -224,6 +276,7 @@
                  },
                  "修改"
                ),
              ]);
            }
@@ -284,7 +337,9 @@
                },
                "修改"
              ),
              enableOrDisable,
              qrCodeButton,
            ]);
          },
        },
@@ -296,6 +351,18 @@
  },
  methods: {
    closeGeneralQrCode(){
      this.showGeneralQrCode = false;
      this.QRCodeUrl = '';
    },
    generalQrCode(row){
      this.QRCodeUrl = '';
      this.showGeneralQrCode = true
      this.codeLoading = true;
      this.QRCodeUrl = this.codeUrl + "?shareStoreId="+ row.id;
    },
    // 回调给父级
    callback(val) {
      this.$emit("callback", val);