作者 刘朕

分享流程优化

... ... @@ -4,13 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="2d3a3fc4-85bb-406e-8d25-d72c4c5e830f" name="更改" comment="">
<change beforePath="$PROJECT_DIR$/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/app.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/account/account.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/account/account.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/accountcashout/accountcashout.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/accountcashout/accountcashout.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/accountcashout/accountcashout.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/accountcashout/accountcashout.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/request/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/request/index.js" afterDir="false" />
</list>
<list default="true" id="2d3a3fc4-85bb-406e-8d25-d72c4c5e830f" name="更改" comment="更改" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
... ... @@ -25,7 +19,10 @@
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="D:\phpstudy_pro\Extensions\php\php7.3.4nts\php.exe" />
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="/opt/homebrew/Cellar/php/8.1.9/bin/php" />
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 0
}]]></component>
<component name="ProjectId" id="2fnWfxMEHTTPjI4t5ggQLv7bGC3" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
... ... @@ -36,14 +33,23 @@
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"last_opened_file_path": "D:/phpstudy_pro/WWW/lps/code/chemai",
"last_opened_file_path": "/Users/coolz/Desktop/web/chemai2",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-js-predefined-1d06a55b98c1-74d2a5396914-JavaScript-PS-241.14494.237" />
<option value="bundled-php-predefined-ba97393d7c68-8f0632a2a215-com.jetbrains.php.sharedIndexes-PS-241.14494.237" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
... ... @@ -53,6 +59,7 @@
<option name="presentableId" value="Default" />
<updated>1714437431533</updated>
<workItem from="1714437452414" duration="969000" />
<workItem from="1718948713994" duration="22000" />
</task>
<servers />
</component>
... ...
... ... @@ -47,9 +47,23 @@ Page({
let that = this
console.log(that.data.private, 'options分享传递的参数', '页面首次加载');
if (options.scene) {
let str = decodeURIComponent(options.scene)
console.log('str',str)
let scene = str.split(',');
let codeid = scene[0].split(':')[1]
let code = scene[1].split(':')[1]
let is_share = scene[2].split(':')[1]
console.log(codeid,code)
that.setData({
id: options.scene,
id: code,
inviter_id: codeid
})
if (is_share) {
wx.setStorageSync('is_share',is_share)
that.setData({
share_inviter_id: codeid
})
}
} else {
if (options.is_share == 1) {
that.setData({
... ... @@ -59,6 +73,9 @@ Page({
wx.setStorageSync('is_share', options.is_share)
wx.setStorageSync('s4_id', options.s4_id)
wx.setStorageSync('s4_name', options.s4_name)
that.setData({
share_inviter_id: options.inviter_id
})
} else {
that.setData({
id: options.id,
... ... @@ -105,20 +122,24 @@ Page({
},
// 分享朋友圈
onShareAppMessage: function (res) {
let that = this
let inviter_id = wx.getStorageSync('user_id')
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline'],
})
return {
title: '汽车互联网4S店全面的汽车电商服务体验,邀您一起参与',
path: '/pages/details/details'
path: '/pages/details/details?id=' + that.data.id + '&type=' + that.data.type + '&inviter_id='+ inviter_id
}
},
onShareTimeline() {
let that = this
let inviter_id = wx.getStorageSync('user_id')
return {
title: '汽车互联网4S店全面的汽车电商服务体验,邀您一起参与',
path: '/pages/details/details'
path: '/pages/details/details' + that.data.id + '&type=' + that.data.type + '&inviter_id='+ inviter_id
}
},
goback() {
... ... @@ -564,14 +585,16 @@ Page({
var that = this;
let s4_id = wx.getStorageSync('s4_id')
let s4_name = wx.getStorageSync('s4_name')
let inviter_id = wx.getStorageSync('user_id')
that.record();
var shareObj = {
title: that.data.tuanDetail.goods_name, // 默认是小程序的名称(可以写slogan等)
path: '/pages/VtuanDetail/VtuanDetail?id=' + that.data.id + '&is_share=1' + '&s4_id=' + s4_id + '&s4_name=' + s4_name, // 默认是当前页面,必须是以‘/’开头的完整路径
path: '/pages/VtuanDetail/VtuanDetail?id=' + that.data.id + '&is_share=1' + '&s4_id=' + s4_id + '&s4_name=' + s4_name + '&inviter_id='+ inviter_id, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
};
// 返回shareObj
return shareObj;
d
},
//记录流量
record() {
... ... @@ -599,13 +622,21 @@ Page({
},
// 发送浏览时间
sendCountTime() {
let that = this
console.log(that.data.id,intPageATime, 'assdsdsdsdsdsdsdsd')
request({
url: '/api/new2/userOperateTime',
data: {
type: 1,
goods_id: this.data.id,
time: intPageATime
}
goods_id: that.data.id,
time: intPageATime,
lat: that.data.latitude,
lng: that.data.longitude,
inviter_id:that.data.share_inviter_id
},
success(res){
console.log('res', res)
}
})
},
GOcanvas() {
... ... @@ -618,7 +649,6 @@ Page({
} else {
this.goLogin()
}
},
async getPingList() { // 获取评价
let that = this
... ... @@ -652,18 +682,6 @@ Page({
})
},
async public() {
let that = this
try {
... ...
... ... @@ -29,7 +29,7 @@
</view>
<view class="down_ben">
<view class="left_cd">已拼{{tuanDetail.sales_initial}}件</view>
<view class="left_cm" bindtap="record">
<view class="left_cm">
<image src="{{imagesUrl}}assets/static/img/x_5.png" catchtap="GOcanvas" />
<button open-type="share" class="buttonShare"></button>
<image src="{{imagesUrl}}assets/static/img/x_6.png" />
... ...
... ... @@ -198,6 +198,7 @@ Page({
success: function (res) {
if (res.confirm) {
// console.log('用户点击确定');
that.record();
/* 该隐藏的隐藏 */
that.setData({
maskHidden: false
... ... @@ -231,13 +232,36 @@ Page({
complete: function (res) {},
})
},
// 记录分享信息
record() {
console.log('fenff')
if(this.data.type == 7) {
request({
url: '/api/new2/userOperateShare',
data: {
type: 2,
active_id: this.data.id
}
})
}
if(this.data.type == 6) {
request({
url: '/api/new2/userOperateShare',
data: {
type: 1,
active_id: this.data.id
}
})
}
},
onShareAppMessage: function () {
let that = this;
that.record();
return {
title: '我发现了一件好货,快来看看!', // 转发后 所显示的title
path: '/pages/canvasA/canvasA?id=' + that.data.id + '&type=' + that.data.type, //分娩笔记分享2
success: (res) => { // 成功后要做的事情
// console.log(res)
console.log(res)
that.popMaskTest()
},
fail: function (res) {
... ...
... ... @@ -76,26 +76,24 @@ Page({
if (options.scene) {
let str = decodeURIComponent(options.scene)
console.log('str',str)
let sss = str.indexOf (':')
let sssh = str.indexOf (',')
let codeid = str.substring(sss + 1, sssh)
let index = str.lastIndexOf(':');
let code = str.substring(index + 1, str.length)
let scene = str.split(',');
let codeid = scene[0].split(':')[1]
let code = scene[1].split(':')[1]
let is_share = scene[2].split(':')[1]
console.log(codeid,code)
that.setData({
id: code,
type: 2,
inviter_id: codeid
})
if (str.is_share) {
wx.setStorageSync('is_share', str.is_share)
that.setData({
share_inviter_id: str.inviter_id
id: code,
type: 2,
inviter_id: codeid
})
}
// wx.setStorageSync('s4_id', options.s4_id)
// wx.setStorageSync('s4_name', options.s4_name)
if (is_share) {
wx.setStorageSync('is_share',is_share)
that.setData({
share_inviter_id: codeid
})
}
// wx.setStorageSync('s4_id', options.s4_id)
// wx.setStorageSync('s4_name', options.s4_name)
} else {
that.setData({
id: options.id,
... ... @@ -451,6 +449,7 @@ Page({
let s4_name = wx.getStorageSync('s4_name')
let inviter_id = wx.getStorageSync('user_id')
console.log(s4_id, s4_name, '本地存储数据')
that.record();
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: "分享", // 默认是小程序的名称(可以写slogan等)
... ...
... ... @@ -132,7 +132,7 @@
<view class="details3">
<view class="smalltitle" bindtap="record">
<view class="smalltitle">
<view class="title">活动详情</view>
<view class="s_btn" catchtap="GOcanvas">
<image class="bents" src="{{imagesUrl}}assets/static/img/2_icon@2x.png"></image>
... ...
... ... @@ -7,6 +7,13 @@
"miniprogram": {
"list": [
{
"name": "活动分享记录调试",
"pathName": "pages/details/details",
"query": "id=614&type=2&s4_id=23044&s4_name=领克常州领创4S店&is_share=1&inviter_id=48721",
"launchMode": "default",
"scene": null
},
{
"name": "pages/accountcashout/accountcashout",
"pathName": "pages/accountcashout/accountcashout",
"query": "",
... ...