| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- // 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],
- });
- },
- onLoad(options) {
- this.getCerts();
- this.getContacts();
- this.getIntroduce();
- },
- });
|