| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- // pages/cert/cert.js
- import { postApi, getApi } from "../../apis/api";
- Page({
- data: {
- certs: [],
- contacts: [],
- introduce: {},
- },
- async getCerts() {
- let { data } = await postApi("/ship/cert/list", {
- userId: wx.getStorageSync("userId"),
- });
- if (data.status === 0) {
- this.setData({
- certs: data.result,
- });
- } else {
- this.setData({
- certs: [],
- });
- wx.showToast({
- title: data.msg,
- icon: "none",
- });
- }
- },
- async getContacts() {
- let { data } = await getApi("/ship/cert/operation/contacts");
- if (data.status === 0) {
- this.setData({
- contacts: data.result,
- });
- } else {
- this.setData({
- contacts: [],
- });
- wx.showToast({
- title: data.msg,
- icon: "none",
- });
- }
- },
- async getIntroduce() {
- let { data } = await getApi("/ship/cert/operation/introduce");
- if (data.status === 0) {
- this.setData({
- introduce: data.result,
- });
- } else {
- this.setData({
- introduce: {},
- });
- wx.showToast({
- title: data.msg,
- icon: "none",
- });
- }
- },
- makePhoneCall(e) {
- wx.makePhoneCall({
- phoneNumber: e.currentTarget.dataset.phone,
- });
- },
- preview(e) {
- wx.previewImage({
- urls: [e.currentTarget.dataset.url],
- });
- },
- copy(e) {
- wx.setClipboardData({
- data: e.currentTarget.dataset.phone,
- success(res) {
- wx.showToast({
- title: "复制成功",
- });
- },
- });
- },
- onLoad(options) {
- this.getCerts();
- this.getContacts();
- this.getIntroduce();
- },
- });
|