Commit acf8914b6a9b1d8f8f8dcc3b539b04c9c906cbf8

Authored by taiyuan
1 parent 5bfa8ba8

新增组件catch

components/catch/catch.js 0 → 100644
  1 +// pages/user/yhq/qr_code/qr_code.js
  2 +const {
  3 + barcode,
  4 + qrcode
  5 +} = require('../../utils/index.js')
  6 +
  7 +Component({
  8 + data: {
  9 + q_show:0,
  10 + object:null,
  11 + index:0,
  12 + is_fw:0,
  13 +
  14 + barcode_canvas:null,
  15 + qrcode_canvas:null,
  16 + },
  17 + properties: {
  18 + // 这里定义了innerText属性,属性值可以在组件使用时指定
  19 + },
  20 + ready: function () {
  21 + },
  22 +
  23 + methods: {
  24 + //关闭
  25 + close: function (e) {
  26 + this.setData({q_show: 0,barcode_canvas:null,qrcode_canvas:null });
  27 + this.triggerEvent('close',{},{bubbles: true});
  28 + },
  29 +
  30 + //打开
  31 + open:function (e) {
  32 + this.data.index++;
  33 + var list=[{index:this.data.index }];
  34 +
  35 + this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw });
  36 + var val=e.val;
  37 +
  38 + // barcode('barcode'+this.data.index,val, 620, 160,this);
  39 + qrcode('qrcode'+this.data.index, val, 520, 520,this);
  40 + }
  41 + },
  42 +
  43 +
  44 +
  45 +
  46 +})
0 47 \ No newline at end of file
... ...
components/catch/catch.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
components/catch/catch.wxml 0 → 100644
  1 +<view class="container">
  2 + <view class="container-wrapper">
  3 + <view>
  4 + <text class="t-icon t-icon-gowudai mgb20"></text>
  5 + <view class="fs28"><slot></slot></view>
  6 + </view>
  7 + <view class="mgt60">
  8 + <text class="btn">进店逛逛</text>
  9 + </view>
  10 + </view>
  11 +</view>
  12 +
... ...
components/catch/catch.wxss 0 → 100644
  1 +@import '../../app.wxss';
  2 +
  3 +
  4 +.container {
  5 + background-color: #f5f5f5;
  6 + position: fixed;
  7 + top: 0;
  8 + bottom: 0;
  9 + left: 0;
  10 + right: 0;
  11 +}
  12 +
  13 +.container-wrapper {
  14 + position: absolute;
  15 + top: 50%;
  16 + left: 50%;
  17 + transform: translate(-50%, -50%);
  18 + text-align: center;
  19 + color: rgb(173,173,173);
  20 +}
  21 +
  22 +.t-icon {
  23 + width: 200rpx;
  24 + height: 200rpx;
  25 +}
  26 +
  27 +.btn {
  28 + display: inline-block;
  29 + padding: 10rpx 50rpx;
  30 + border: 2rpx solid red;
  31 + color: red;
  32 + font-size: 30rpx;
  33 + border-radius: 30rpx;
  34 + box-sizing: border-box;
  35 +}
  36 +
  37 +.mgt60 {
  38 + margin-top: 60rpx;
  39 +}
0 40 \ No newline at end of file
... ...