MrShi
8 天以前 1a0d015ebde58481bc9bba4bc7a2b5154fcabfe5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<template>
  <div class="tiktok-config">
    <!-- 第一步 -->
    <div class="step-section">
      <div class="step-desc">
        第一步:请在<el-link type="primary" href="https://developer.open-douyin.com" target="_blank">《抖音开放平台》</el-link>创建应用,并在<el-link type="primary" href="https://open-douyin.com" target="_blank">《抖音来客》</el-link>创建门店、完成服务应用授权,授权成功后在抖音开放平台自建应用的应用管理中获取对应的Appkey和Secret,在抖音来客个人中心获取门店ID(AccountId)
      </div>
      <el-form ref="form" :model="form" label-width="100px" class="config-form">
        <el-form-item label="Appkey" required>
          <el-input v-model="form.appkey" placeholder="请输入" style="width: 400px;"></el-input>
          <span class="form-tip">抖音开放平台自建应用的应用管理-应用设置中查看</span>
        </el-form-item>
        <el-form-item label="Secret" required>
          <el-input v-model="form.secret" placeholder="请输入" style="width: 400px;"></el-input>
          <span class="form-tip">抖音开放平台自建应用的应用管理-应用设置中查看</span>
        </el-form-item>
        <el-form-item label="AccountId" required>
          <el-input v-model="form.accountId" placeholder="请输入" style="width: 400px;"></el-input>
          <span class="form-tip">抖音开放平台自建应用的应用管理-应用设置中查看</span>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="saveStep1">保存</el-button>
        </el-form-item>
      </el-form>
    </div>
 
    <!-- 第二步 -->
    <div class="step-section">
      <div class="step-desc">
        第二步:完成参数配置后,点击查询门店获取门店信息,并完成门店绑定
      </div>
      <el-form ref="storeForm" :model="storeForm" label-width="100px" class="config-form">
        <el-form-item label="门店名称">
          <el-input v-model="storeForm.storeName" placeholder="请点击右侧查询按钮获取查询门店信息" style="width: 400px;" readonly></el-input>
          <el-button @click="queryStore" style="margin-left: 10px;">查询门店</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="saveStep2">保存</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
 
<script>
export default {
  name: 'TiktokConfiguration',
  data () {
    return {
      form: {
        appkey: '',
        secret: '',
        accountId: ''
      },
      storeForm: {
        storeName: ''
      }
    }
  },
  methods: {
    saveStep1 () {
      if (!this.form.appkey || !this.form.secret || !this.form.accountId) {
        this.$message.warning('请填写完整信息')
        return
      }
      this.$message.success('保存成功')
    },
    queryStore () {
      if (!this.form.appkey || !this.form.secret || !this.form.accountId) {
        this.$message.warning('请先完成第一步参数配置')
        return
      }
      this.$message.info('查询门店中...')
    },
    saveStep2 () {
      if (!this.storeForm.storeName) {
        this.$message.warning('请先查询门店')
        return
      }
      this.$message.success('保存成功')
    }
  }
}
</script>
 
<style lang="scss" scoped>
.tiktok-config {
  padding: 20px;
  background: #fff;
}
 
.step-section {
  margin-bottom: 30px;
}
 
.step-desc {
  font-size: 14px;
  color: #606266;
  margin-bottom: 20px;
  line-height: 1.8;
}
 
.config-form {
  ::v-deep .el-form-item__label {
    font-weight: 500;
  }
}
 
.form-tip {
  font-size: 12px;
  color: #999;
  margin-left: 10px;
}
</style>