123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- const app = getApp();
- var utils = require("../../../utils/http")
- const util = require("../../../utils/util")
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- imgUrl: app.globalData.imgUrl,
- eid: '',
- evidencemsg: {},
- lastId: '',
- nextId: '',
- wshareshow: false,
- personMsg: app.globalData.personMsg,
- showDsc: false,
- companyobj: app.globalData.companyobj,
- type: ''
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- var that = this;
- wx.showLoading({
- title: '加载中...',
- })
- that.setData({
- eid: options.eid
- })
- if (options.type) {
- this.setData({
- type: options.type
- })
- }
- that.evidencefun();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- showDscContent: function () {
- if (this.data.evidencemsg.desc.length > 28) {
- this.data.showDsc = !this.data.showDsc;
- this.setData({
- showDsc: this.data.showDsc
- })
- }
- },
- setpostertap: function () {
- wx.navigateTo({
- url: '/index/pages/setposter/setposter?type=CompanyStrength&aid=' + this.data.eid + "&listshare=",
- })
- },
- sharetap: function () {
- this.setData({
- wshareshow: true
- })
- },
- evidencefun: function () {
- var that = this;
- utils.$get({
- url: app.globalData.webUrl + 'api/company_strength/read',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- id: that.data.eid,
- uid: app.globalData.personMsg.id,
- },
- success: function (res) {
- wx.hideLoading()
- if (res.data.code == '0') {
- res.data.data.desc = res.data.data.title + '#' + res.data.data.desc + '#';
- that.setData({
- evidencemsg: res.data.data,
- })
- wx.setNavigationBarTitle({
- title: res.data.data.title
- })
- if (res.data.data.difference == 1) {
- const videoContext = that.selectComponent('#myVideo');
- videoContext.play();
- }
- }
- }
- })
- },
- collectap: function () {
- var that = this;
- var list = that.data.evidencemsg;
- let weburl = '';
- if (that.data.evidencemsg.collect) {
- weburl = 'api/companyStrength/no_collect'
- } else {
- weburl = 'api/companyStrength/collect'
- }
- utils.$post({
- url: app.globalData.webUrl + weburl,
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- id: that.data.eid
- },
- success: function (res) {
- if (res.data.code == '0') {
- wx.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 2000
- })
- list.collect = !list.collect;
- that.setData({
- evidencemsg: list
- })
- }
- }
- })
- },
- shareurltap: function () {
- wx.showLoading({
- title: '加载中...',
- })
- util.schemefun('/share/pages/companystrengthmsg/companystrengthmsg', 'eid=' + this.data.eid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, this.data.eid, 'CompanyStrength', '');
- this.evidencesharetap();
- },
- sendfriendtap() {
- this.evidencesharetap();
- },
- evidencesharetap: function () {
- var that = this;
- utils.$post({
- url: app.globalData.webUrl + 'api/share/addlog',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- id: that.data.eid,
- type: 'CompanyStrength',
- alertshow: '456'
- },
- success: function (r) {
- }
- })
- },
- prelooktap() {
- if (!app.globalData.personMsg.binded.qrcode) {
- wx.showToast({
- title: "您的二维码为空,请上传二维码!",
- icon: 'none',
- duration: 2000
- })
- return false;
- }
- wx.previewImage({
- current: app.globalData.imgUrl + app.globalData.personMsg.binded.qrcode, // 当前显示图片的http链接
- urls: [app.globalData.imgUrl + app.globalData.personMsg.binded.qrcode]// 需要预览的图片http链接列表
- })
- },
- callphonetap: function () {
- wx.makePhoneCall({
- phoneNumber: app.globalData.personMsg.phone
- })
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.setData({
- companyobj: app.globalData.companyobj,
- })
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- this.evidencesharetap();
- var img = this.data.evidencemsg.difference == 1 ? (this.data.evidencemsg.cover ? this.data.evidencemsg.cover : (this.data.evidencemsg.pics + '?x-oss-process=video/snapshot,t_100,f_jpg,w_375,m_fast')) : this.data.evidencemsg.cover;
- img = img.replace('http://o.nczyzs.com/', 'https://o.nczyzs.com/');
- return {
- title: this.data.evidencemsg.title,
- imageUrl: img,
- path: '/share/pages/companystrengthmsg/companystrengthmsg?eid=' + this.data.eid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype
- }
- }
- })
|