webview.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // pages/webview/webview.js
  2. var app = getApp() ;
  3. Page({
  4. data: {
  5. hiddenmodal : true,
  6. webUrl : '',
  7. order_aff_num :'',//订单号
  8. order_aff_id : '',//商品id
  9. order_aff_gg_id :'',//规格id
  10. order_gy_id : '',//工艺id
  11. unionid: ''//unionid
  12. },
  13. onLoad: function (options) {
  14. var that = this;
  15. wx.getSystemInfo({
  16. success: function (res) {
  17. var version = res.SDKVersion;
  18. version = version.replace(/\./g, "")
  19. console.log(version)
  20. if (parseInt(version) < 164) {// 小于1.6.4的版本
  21. that.setData({
  22. hiddenmodal: false
  23. })
  24. setTimeout(function () {
  25. that.setData({
  26. hiddenmodal: true
  27. })
  28. wx.navigateBack({//返回订单页
  29. delta: 1
  30. })
  31. }, 4000)
  32. }
  33. }
  34. })
  35. var host = getApp().globalData.servsers;
  36. var img2 = options.img2;
  37. var order_sta = options.order_sta;
  38. var order_aff_num = options.order_aff_num;
  39. var order_aff_id = options.order_aff_id;
  40. var order_aff_gg_id = options.order_aff_gg_id;
  41. var order_gy_id = options.order_gy_id;
  42. var order_aff_dz_id = options.order_aff_dz_id;
  43. console.log(order_aff_dz_id);
  44. if (order_aff_dz_id == undefined){
  45. order_aff_dz_id = 'null';
  46. }
  47. var unionid = options.unionid;
  48. var webUrl = '';
  49. if (order_sta > 2) {//定制完成后的预览
  50. webUrl = 'customization/index_jpg?order_aff_dz_id=' + order_aff_dz_id;
  51. }else{
  52. webUrl = 'customization/index?order_aff_num=' + order_aff_num + '&order_aff_id=' + order_aff_id + '&order_aff_gg_id=' + order_aff_gg_id + '&order_gy_id=' + order_gy_id + '&order_aff_dz_id=' + order_aff_dz_id + '&unionid=' + unionid;
  53. }
  54. that.setData({
  55. webUrl: host + webUrl
  56. })
  57. }
  58. })
  59. var that;
  60. var Util = require('../../utils/util.js');