|
@@ -1,20 +1,85 @@
|
|
|
<template>
|
|
|
<view class="main">
|
|
|
- 客服电话
|
|
|
+ <view class="one">客服电话</view>
|
|
|
+ <view class="two">
|
|
|
+ <text>{{config.phone||'暂无联系电话'}}</text>
|
|
|
+ <button class="button" type="primary" size="mini" @tap="copy(config.phone)">复制</button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
data() {
|
|
|
- return {}
|
|
|
+ return {
|
|
|
+ user: {},
|
|
|
+ config: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad: async function(e) {
|
|
|
+ const that = this;
|
|
|
+ that.searchToken();
|
|
|
+ that.searchConfig();
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ searchToken() {
|
|
|
+ const that = this;
|
|
|
+ try {
|
|
|
+ const res = uni.getStorageSync('token');
|
|
|
+ if (res) that.$set(that, `user`, res);
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({
|
|
|
+ title: err.errmsg,
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ searchConfig() {
|
|
|
+ const that = this;
|
|
|
+ try {
|
|
|
+ const res = uni.getStorageSync('config');
|
|
|
+ if (res) that.$set(that, `config`, res);
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({
|
|
|
+ title: err.errmsg,
|
|
|
+ icon: 'error',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 复制
|
|
|
+ copy(context) {
|
|
|
+ uni.setClipboardData({
|
|
|
+ data: context, //被复制的内容
|
|
|
+ success: () => { //复制成功的回调函数
|
|
|
+ uni.showToast({
|
|
|
+ title: '复制成功'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
- .main {}
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .main {
|
|
|
+ padding: 2vw;
|
|
|
+ text-align: center;
|
|
|
+ font-size: var(--font18Size);
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ .two {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ .button {
|
|
|
+ margin: 10px;
|
|
|
+ font-size: var(--font12Size);
|
|
|
+ background-color: var(--f3CColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|