Browse Source

分享海报优化

threedate
Enzo 5 years ago
parent
commit
350e9ef733
  1. 4
      common/api.js
  2. 3
      pages/center/invite.vue
  3. 15
      pages/goodsDetail/index.vue
  4. 6
      pages/index/index.vue

4
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'; // 正式服请求地址
/* 首页相关接口 */

3
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 => {

15
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();
//

6
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('提交审核成功');

Loading…
Cancel
Save