diff --git a/common/api.js b/common/api.js index e1a416a..8f90698 100644 --- a/common/api.js +++ b/common/api.js @@ -1,8 +1,8 @@ // appId: 正式 null | 测试 wxb35ef055a4dd8ad4 -export const DEV = "prod"; // dev 测试 | prod 正式 +export const DEV = "dev"; // dev 测试 | prod 正式 export const VERSION = '1.0.0'; // 版本号 export const DEVURL = 'https://gxsky.lanzulive.com'; // 测试服请求地址 -// export const DEVURL = 'http://192.168.3.8'; // 测试服请求地址, 韦港电脑 +// export const DEVURL = 'http://192.168.3.23'; // 测试服请求地址, 韦港电脑 export const PRODURL = 'https://mall.gxsky.com'; // 正式服请求地址 /* 首页相关接口 */ diff --git a/pages/center/invite.vue b/pages/center/invite.vue index d56892f..10db0b7 100644 --- a/pages/center/invite.vue +++ b/pages/center/invite.vue @@ -76,8 +76,9 @@ }) }, getWxCode() { + let userInfo = uni.getStorageSync('userinfo') || {}; this.$http(this.API.API_WXBILL, { - scene: 'route=home&id=2&pt=2', + scene: 'route=home&id=2&pt=2'+'&share_id='+userInfo.id, page: 'pages/route/index', width: '2800' }).then(res => { diff --git a/pages/goodsDetail/index.vue b/pages/goodsDetail/index.vue index dde9d75..697822c 100644 --- a/pages/goodsDetail/index.vue +++ b/pages/goodsDetail/index.vue @@ -139,7 +139,9 @@ onceCode: '', pt: 1, afterDone: '', - backgroundImg: '' + backgroundImg: '', + goodShare: '', + s_id: '' } }, computed: { @@ -152,6 +154,7 @@ onLoad(options) { this.goods_id = options.id; this.pt = options.pt || 1; + this.s_id = options.share_id || '' this.getGoodsDetail(); this.getWxCode() this.getBackground() @@ -190,7 +193,7 @@ let nowTime = new Date().toLocaleString(); _this.$http(_this.API.API_BINDGOODS, { deed: md5TimeDate, - sid: userInfo.id, + sid: _this.s_id, gid: _this.goods_id, gn: _this.goods_detail.name, t: gettime @@ -235,8 +238,13 @@ createNewImg() { var that = this; var context = wx.createCanvasContext('mycanvas'); + let goods = that.goods_detail; + let title = goods.name; + let imageUrl = goods.share_cover || goods.cover; var path = that.backgroundImg; + context.drawImage(path, 0, 0, 375, 667); + //绘制二维码 let wxcode = that.onceCode context.drawImage(wxcode, 18, 530, 120, 120); @@ -244,7 +252,8 @@ // context.setFontSize(24); // context.setFillStyle('#fff'); // context.setTextAlign('center'); - // context.fillText(name, 34, 620); + // context.fillText(title, 34, 620); + context.stroke(); context.draw(); //将生成好的图片保存到本地,需要延迟一会,绘制期间耗时 diff --git a/pages/index/index.vue b/pages/index/index.vue index 7cc1d10..51986d2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -62,7 +62,8 @@ shareInfo: {}, windowHeight: 0, // 屏幕可用高度 isRefresher: false ,// scroll-view下拉刷新状态,当前默认没有触发 - pt: 1 + pt: 1, + s_id: '' } }, onLoad(options) { @@ -70,6 +71,7 @@ this.windowHeight = getApp().globalData.windowHeight; this.getCategoryList(); this.getShareInfo(); + this.s_id = options.share_id if(this.pt == 2) { this.bindUsders() } @@ -91,7 +93,7 @@ let nowTime = new Date().toLocaleString(); _this.$http(_this.API.API_BINDSALES, { deed: md5TimeDate, - sid: userInfo.id, + sid: _this.s_id, t: gettime }).then(res => { _this.$msg('提交审核成功');