yuminge-app/yun-min-program-plugin-master/packageE/others/skin_result/skin_result.js

260 lines
5.7 KiB
JavaScript

// packageE/others/skin_result/skin_result.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
images: [],
isshow: false,
is_label: false,
panelIndex: 0,
kFootshow: true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let language = wx.getStorageSync('langIndex');
this.setData({
'language': language.en
});
let price = wx.getStorageSync("yz_basic_info").lang.goods ? wx.getStorageSync("yz_basic_info").lang.goods.price : '现价';
let market_price = wx.getStorageSync("yz_basic_info").lang.goods ? wx.getStorageSync("yz_basic_info").lang.goods.market_price : '原价';
this.setData({
price: price,
market_price: market_price
});
if (options.id) {
this.setData({
id: options.id
});
}
this.getData();
},
tabrshowbtn(e) {
let bol = e.detail;
if (bol) {
this.setData({
kFootshow: false
});
}
},
myshow(e) {
console.log(e);
this.setData({
isshow: e.detail
});
},
callPhone(e) {
let item = e.currentTarget.dataset.item.mobile;
console.log(e);
wx.makePhoneCall({
phoneNumber: item,
});
},
copy(e) {
console.log(e);
let item = e.currentTarget.dataset.item.yz_member.wechat;
let name = e.currentTarget.dataset.item.nickname;
wx.setClipboardData({
data: item,
success(res) {
wx.getClipboardData({
success(res) {
wx.showToast({
icon: 'none',
title: '已成功将' + name + "的微信号添加到剪贴板,通过微信添加朋友可加客户好友!",
duration: 1500
});
}
});
}
});
},
showImga() {
console.log(this.data.resultData.report.check_img_src);
let img = this.data.resultData.report.check_img_src;
wx.previewImage({
urls: [img],
});
},
baclOut() {
wx.redirectTo({
url: '/packageE/others/skin/skin'
});
},
tapMore(e) {
let id = e.currentTarget.dataset.item.id;
wx.navigateTo({
url: '/packageA/member/article/articleContent/articleContent?article_id=' + id,
});
},
gotoUrl(e) {
let item = e.currentTarget.dataset.item;
console.log(item); //card_id=17&mark_id=17&mark=card
if (this.data.resultData.business_card == 1) {
wx.navigateTo({
url: '/packageB/member/business_card/BusinessCard/BusinessCard?card_id=' + item.business_card.id + '&mark_id=' + item.business_card.id + '&mark=card',
});
}
},
tapAll() {
wx.navigateTo({
url: '/packageE/others/all_result/all_result?id=' + this.data.id + '&num=' + this.data.resultData.report.id
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
path: "/packageE/others/share/share?id=" + this.data.id
};
},
tapGood(e) {
let id = e.currentTarget.dataset.kid;
wx.navigateTo({
url: '/packageA/detail_v2/detail_v2?id=' + id,
});
},
chooseTabData(e) {
console.log(e);
let ind = e.detail.index;
let id = this.data.label[ind].id;
this.getTab(id);
},
goShare() {
this.setData({
isshow: true
});
},
getTab(id) {
wx.showLoading({
title: '加载中',
});
let that = this;
let urlStr = app.getNetAddresss("plugin.skin-check.api.skin-check.label-goods");
app._getNetWork({
url: urlStr,
data: {
label_id: id
},
success: function (resdata) {
wx.hideLoading({
complete: (res) => {},
});
var res = resdata.data;
console.log(res);
if (res.result == 1) {
that.setData({
goodsLis: res.data
});
} else {
wx.showToast({
icon: 'none',
title: res.msg,
duration: 1500
});
}
},
fail: function (res) {
console.log(res);
wx.hideLoading({
complete: (res) => {},
});
}
});
},
getData() {
wx.showLoading({
title: '加载中',
});
let that = this;
let urlStr = app.getNetAddresss("plugin.skin-check.api.skin-check.check-report");
app._getNetWork({
url: urlStr,
data: {
report_id: that.data.id
},
success: function (resdata) {
wx.hideLoading({
complete: (res) => {},
});
var res = resdata.data;
console.log(res);
if (res.result == 1) {
that.setData({
resultData: res.data,
images: that.data.images.push(res.data.report.check_img_src),
goodsLis: res.data.goods
});
if (res.data.label) {
that.setData({
is_label: true,
label: res.data.label
});
}
} else {
wx.showToast({
icon: 'none',
title: res.msg,
duration: 1500
});
}
},
fail: function (res) {
console.log(res);
wx.hideLoading({
complete: (res) => {},
});
}
});
}
});