Browse Source

[完善] 首页分享绑定

new
邓平艺 5 years ago
parent
commit
c93613717a
  1. 1
      common/api.js
  2. 2
      pages/center/fans.vue
  3. 22
      pages/index/index.vue

1
common/api.js

@ -9,6 +9,7 @@ export const PRODURL = 'https://mall.gxsky.com'; // 正式服请求地址
export const API_CATEGORY_LIST = '/api/category/list'; // 首页-分类
export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表
export const API_SHARE_HOME = '/api/share/home'; // 首页分享信息
export const API_SALESMAN_BINDALL = '/api/salesman/bindAll'; // 点击链接就可以被绑定
// 用户订单
export const API_USERORDER = '/api/order/list';

2
pages/center/fans.vue

@ -21,7 +21,7 @@
</view>
<view class="flex flex-direction justify-around lf-p-l-20">
<view class="lf-font-32 text-black1">{{item.username}} <text class="bg-red lf-font-24 lf-m-l-10" style="border-radius: 30rpx;padding: 5rpx 16rpx;">{{item.state}}</text></view>
<view class="lf-font-24 lf-color-gray">{{item.share_time}}</view>
<view class="lf-font-24 lf-color-gray">{{item.share_time || 0}}</view>
</view>
</view>

22
pages/index/index.vue

@ -78,6 +78,8 @@
uni.removeStorageSync('homePageOptions');
if(this.pt == 2) {
this.bindUsders()
}else if(this.pt == 3){
this.bindAllUsders();
}
}
},
@ -96,7 +98,6 @@
let timeDate = Math.round(new Date().getTime() / 1000).toString();
let md5TimeDate = SparkMD5.hash(timeDate)
let nowTime = new Date().toLocaleString();
console.log("进来啦~~~~~")
_this.$http(_this.API.API_BINDSALES, {
deed: md5TimeDate,
sid: _this.s_id,
@ -107,6 +108,14 @@
console.log(err)
})
},
//
bindAllUsders(){
this.$http(this.API.API_SALESMAN_BINDALL, {
pid: this.s_id
}).then(res => {
this.$msg('提交审核成功');
})
},
//
getShareInfo(){
this.$http(this.API.API_SHARE_HOME).then(res => {
@ -219,16 +228,21 @@
// this.getGoodsList();
},
onShareAppMessage(){
const token = this.$shared.createToken();
const userInfo = uni.getStorageSync('userinfo') || {};
const token = this.$shared.createToken({user_id: userInfo.id});
const scene_code = this.$scene.V2_HOME_SHAREBUTTON;
let options = {route: 'home', scene_code};
let options = {
route: 'home',
scene_code,
share_id: userInfo.id,
pt: 3
};
this.generateKooken(token, options); // token
let shareInfo = {
title: this.shareInfo.title || '欢迎使用时空网小程序',
path: '/pages/route/index?token='+ token
}
if(this.shareInfo.cover){
shareInfo.imageUrl = this.shareInfo.cover;
}

Loading…
Cancel
Save