|
@@ -1,5 +1,9 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
+ <u-mask :show="show" @click="show = false">
|
|
|
+ <u-image width="100%" height="500px" :mode="'widthFix'" src="/static/img/guide_point.png"></u-image>
|
|
|
+
|
|
|
+ </u-mask>
|
|
|
<u-navbar title="邀请好友"></u-navbar>
|
|
|
<view class="InviteFriends">
|
|
|
<view class="InviteFriends-head">
|
|
@@ -46,21 +50,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="reward-main">
|
|
|
- <view class="reward-info">
|
|
|
- <view class="reward-info-item">
|
|
|
- <p>待兑换</p>
|
|
|
- <view class="reward-info-price">
|
|
|
- <h2>5</h2><span>元</span>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="reward-info-item reward-info-item2">
|
|
|
- <p>已兑换</p>
|
|
|
- <view class="reward-info-price">
|
|
|
- <h2>5</h2><span>元</span>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="reward-btn">兑换奖励</view>
|
|
|
+
|
|
|
<view class="reward-list">
|
|
|
<view class="reward-list-title">
|
|
|
成功邀请记录
|
|
@@ -102,65 +92,70 @@
|
|
|
<script>
|
|
|
import wx from 'weixin-js-sdk'
|
|
|
import * as API_WeiXin from '@/apis/weixin'
|
|
|
+ import * as API from '@/apis/friends.js'
|
|
|
+ import * as WxJsApi from '@/utils/wxJsApi.js'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ id:"",
|
|
|
+ code:"",
|
|
|
+ show:false,
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onLoad(op) {
|
|
|
+ this.id=op.id
|
|
|
+ this.code=op.code
|
|
|
this.get_wx_config();
|
|
|
+
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ //this.inviteCouponList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ inviteCouponList(){
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ API.inviteCouponList().then((res) => {
|
|
|
+ this.list = res.data.helpList
|
|
|
+
|
|
|
+
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
inviteFriendsBtn(){
|
|
|
- WeixinJSBridge.invoke('sendAppMessage',{
|
|
|
- "appid": process.car.VUE_APP_WXAPPID,
|
|
|
- "img_url": "",
|
|
|
- "img_width": "200",
|
|
|
- "img_height": "200",
|
|
|
- "link": window.location.href,
|
|
|
- "desc": "descContent",
|
|
|
- "title": "shareTitle"
|
|
|
- }, function(res) {
|
|
|
- //_report('send_msg', res.err_msg);
|
|
|
- })
|
|
|
+ this.show=true;
|
|
|
},
|
|
|
//获取微信jssdk配置信息
|
|
|
get_wx_config() {
|
|
|
- this.isLoading = true;
|
|
|
- API_WeiXin.getConfig(window.location.href.split("#")[0]).then(response => {
|
|
|
- this.isLoading = false;
|
|
|
-
|
|
|
- var wxconfig = response.wxConfig;
|
|
|
- console.log(wxconfig.nonceStr)
|
|
|
- this.wxConfig = wxconfig;
|
|
|
- wx.config({
|
|
|
- debug: false, // 开启调试模式,
|
|
|
- appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
|
|
|
- timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
|
|
|
- nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
|
|
|
- signature: wxconfig.signature, // 必填,签名,见附录1
|
|
|
- jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
|
|
- });
|
|
|
- //this.wxShare()
|
|
|
+ WxJsApi.getWxConfig( ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareQZone']).then((res) => {
|
|
|
+ // console.log(res)
|
|
|
+ this.wxShare()
|
|
|
}).catch(error => {
|
|
|
- // this.isLoading = false;
|
|
|
- // this.mui.toast(error);
|
|
|
+ console.log(error)
|
|
|
})
|
|
|
},
|
|
|
//微信分享自定义
|
|
|
wxShare() {
|
|
|
- var img="";//window.location.href.split("#")[0]+"/"+require("@/assets/img/logo_qilian.jpg")
|
|
|
+ var info=this.carhelp.getPersonInfo()
|
|
|
+ var img=""//require("@/static/img/aboutus.png")
|
|
|
console.log(this.nowItem);
|
|
|
- var title="[荆州市企业联合会]"+this.title
|
|
|
- // var desc=
|
|
|
- let joinUrl = this.url;
|
|
|
+ var ProjectName=process.car.ProjectName;
|
|
|
+ var title="["+ProjectName+"]"+'和好友一起领5元红包'
|
|
|
+ var desc="来自"+info.name+"的邀请"
|
|
|
+ let joinUrl = window.location.href.split("#")[0]+"#/?friends=friends&id="+this.id+"&icode="+this.code+"&uid="+info.id;
|
|
|
var _this = this;
|
|
|
wx.ready(function() {
|
|
|
wx.onMenuShareAppMessage({
|
|
|
title: title,
|
|
|
- // desc:desc ,
|
|
|
+ desc:desc ,
|
|
|
link: joinUrl,
|
|
|
imgUrl: img,
|
|
|
success: function() {
|
|
@@ -170,7 +165,7 @@
|
|
|
})
|
|
|
wx.onMenuShareTimeline({
|
|
|
title: title,
|
|
|
- //desc:desc ,
|
|
|
+ desc:desc ,
|
|
|
link: joinUrl,
|
|
|
imgUrl: img,
|
|
|
success: function() {
|
|
@@ -378,7 +373,7 @@
|
|
|
}
|
|
|
}
|
|
|
.reward-list{
|
|
|
- border-top: 1px dashed #cacaca;
|
|
|
+ //border-top: 1px dashed #cacaca;
|
|
|
padding-top: 20px;
|
|
|
.reward-list-title{
|
|
|
font-size: 18px;
|