schema2code.vue 2.4 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1
<template>
Anne_LXM's avatar
Anne_LXM 已提交
2 3 4 5 6 7 8 9 10 11 12 13
  <view class="root">
    <view class="uni-title dashed-box">
      <text class="tip">
        schema2code是一个根据数据库schema自动生成代码的工具。它可以直接生成云端一体的列表、详情、新建、修改页面,云端一体直接可用。大幅提升开发效率。
      </text>
      <text>\n schema路径:uniCloud/database/user-info.schema.json \n</text>
      <button class="showSchemaCode" size="mini" @click="showSchemaCode" type="primary" plain>查看schema代码</button>
    </view>
    <j-video v-if="showVideo" :src="videoUrl" title="schema2code步骤演示" height="421rpx" width="750rpx"></j-video>
    <alertCode ref="alertCode"></alertCode>
    <button class="toForm" @click="toForm" type="primary" size="mini" plain>前往生成的云端一体页面</button>
  </view>
DCloud-WZF's avatar
DCloud-WZF 已提交
14 15 16
</template>

<script>
Anne_LXM's avatar
Anne_LXM 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
  import schemaCode from './schemaCode';
  export default {
    data() {
      return {
        schemaCode: schemaCode,
        videoUrl: "https://web-assets.dcloud.net.cn/unidoc/zh/schema2code%E7%9A%84%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F.mp4",
        // https://web-assets.dcloud.net.cn/unidoc/zh/create-schema2code-video.mp4,
        showVideo: false,
      }
    },
    onReady() {
      this.showVideo = true;
    },
    methods: {
      async showSchemaCode() {
        return this.$refs.alertCode.open(schemaCode)
      },
      toForm() {
        uni.navigateTo({
          url: '../user-info/list'
        })
      }
    }
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
41 42 43
</script>

<style scoped>
Anne_LXM's avatar
Anne_LXM 已提交
44 45 46 47 48 49 50
  .code-view {
    height: 750rpx;
    width: 750rpx;
    padding: 5px 8px;
    overflow: scroll;
    background-color: #fffae7;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
51

Anne_LXM's avatar
Anne_LXM 已提交
52 53 54 55 56
  .code-box {
    white-space: nowrap;
    color: #447315;
    font-size: 12px;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
57

Anne_LXM's avatar
Anne_LXM 已提交
58 59 60
  .root {
    flex-direction: column;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
61

Anne_LXM's avatar
Anne_LXM 已提交
62 63 64 65 66 67
  .dashed-box {
    border: dashed 1px #EEEEEE;
    border-radius: 5px;
    width: 750rpx;
    position: relative;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
68

Anne_LXM's avatar
Anne_LXM 已提交
69 70 71 72 73 74 75 76
  .uni-title {
    width: 680rpx;
    margin: 15rpx;
    font-size: 26rpx;
    padding: 20rpx;
    line-height: 1.5;
    background-color: #FFFFFF;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
77

Anne_LXM's avatar
Anne_LXM 已提交
78 79 80 81
  .uni-title text {
    font-size: 24rpx;
    color: #888;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
82

Anne_LXM's avatar
Anne_LXM 已提交
83 84 85 86
  .toForm {
    width: 500rpx;
    margin: 30px 125rpx;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
87

Anne_LXM's avatar
Anne_LXM 已提交
88 89 90
  .uni-title text.link {
    color: #586b95;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
91

Anne_LXM's avatar
Anne_LXM 已提交
92 93 94 95 96 97
  text.tip {
    background-color: #FFFFFF;
    color: #333;
    height: 80px;
    width: 750rpx;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
98

Anne_LXM's avatar
Anne_LXM 已提交
99 100 101
  .showSchemaCode {
    margin-top: 10px;
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
102
</style>