1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- import {
- ApiModel
- } from '../../utils/api';
- const _Http = new ApiModel();
- import queryLogin from '../../utils/isLogin';
- Component({
- options: {
- addGlobalClass: true,
- },
- /**
- * 组件的属性列表
- */
- properties: {
- list: Array
- },
- /**
- * 组件的初始数据
- */
- data: {
- isLogin: false,
- },
- pageLifetimes: {
- show: function () {
- this.setData({
- isLogin: wx.getStorageSync('userData') ? true : false
- })
- },
- },
- /**
- * 组件的方法列表
- */
- methods: {
- /* 跳转详情页 */
- toDetailPage(e) {
- const {
- item
- } = e.currentTarget.dataset;
- wx.navigateTo({
- url: '/pages/tabbar-pages/home/sdDetalis?item=' + JSON.stringify(item),
- });
- },
- /* 马上拨打 */
- callUp(e) {
- if (!queryLogin()) return;
- const {
- phone,
- id
- } = e.currentTarget.dataset;
- wx.makePhoneCall({
- phoneNumber: phone
- })
- this.record(2, id)
- },
- shareCall(e) {
- if (!queryLogin()) return;
- let {
- item
- } = e.currentTarget.dataset
- console.log(item)
- this.triggerEvent('shareCallBack', item);
- this.record(3, item.tsupplyanddemandid)
- },
- /* 处理记录 */
- record(type, id) {
- _Http.basic({
- "accesstoken": wx.getStorageSync('userData').token,
- "classname": "customer.supplyanddemand.supplyanddemand",
- "method": "addsupplyanddemandLog",
- "content": {
- "ftype": type,
- "tsupplyanddemandid": id,
- "tenterprise_userid": wx.getStorageSync('userData').userid ? wx.getStorageSync('userData').userid : 0
- }
- }).then(res => {
- console.log(res)
- })
- }
- },
- })
|