123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- // pages/salesOrderMan/info.js
- const app = getApp()
- var QRCode = require('../../utils/weapp-qrcode.js');
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- info: {},
- orderStatusArray:[], //订单状态
- orderTypeArray:[],//订单类型
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- //字典数据
- let treeData = app.globalData.treeArr
- for (const element of treeData) {
- let arrStr;
- switch (element.dictValue) {
- case 'order_status':
- arrStr = "orderStatusArray";
- break;
- case 'order_type':
- arrStr = "orderTypeArray";
- break;
- }
- this.setData({
- [arrStr]: element.children
- })
- }
- //获取详情
- var pages = getCurrentPages();
- var prevPage = pages[pages.length - 2];
- let getInfo = prevPage.data.resData[options.index]
- this.setData({
- info:getInfo
- })
- if(getInfo.orderStatus == '3'){
- this.makeCode(JSON.stringify({
- "id": getInfo.id,
- "orderName":getInfo.orderName,
- "orderNumber":getInfo.orderNumber,
- "type":'1'
- }))
- }
- },
- // 二维码
- makeCode(data) {
- var qrcode;
- qrcode = new QRCode('canvas', {
- text: data,
- width: 220,
- height: 220,
- colorDark: "#000000",
- colorLight: "#ffffff",
- correctLevel: QRCode.CorrectLevel.H,
- });
- qrcode.makeCode(data);
- },
- //查询详情
- getInfo: function (id) {
- //详情
- app.request.GET({
- url: app.API.appointDetail,
- page: this,
- params: {
- 'id': id
- },
- successFun: true
- }).then(res => {
- let getInfo = res.data.data;
- this.setData({
- info: getInfo,
- accessControlAuth:JSON.parse(getInfo.accessControlAuth)
- })
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|