Commit 2e15a091 by 李嘉林

代码合并

parents 4cdee60e 455d0da9
......@@ -5586,6 +5586,11 @@
}
}
},
"mayi-front-tools": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/mayi-front-tools/-/mayi-front-tools-1.0.0.tgz",
"integrity": "sha512-Rva5tM2lSmbX6pb+fmu7FA60kJ/tKtDdTp5Tpj9B/+4Rtk9psuZ7zZk20Nk19mF6u/lZYJHrvdHr2yhKQWWFqQ=="
},
"md5.js": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
......
......@@ -26,6 +26,7 @@
},
"dependencies": {
"mayi-analytics": "^1.1.14",
"mayi-front-tools": "^1.0.0",
"mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5",
"vuex": "^3.0.1"
......
......@@ -304,13 +304,13 @@ export default {
this.pageInfo = pageList.filter((item) => item.pageCode == 1)[0];
this.pageData = JSON.parse(this.pageInfo.pageData);
console.log("36", this.pageData);
console.log("36", this.pageData,this.pageInfo.pageSettingData);
console.log(app.globalData.shopInfo,'app')
wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName})
wx.stopPullDownRefresh()
if(wx.getStorageSync("sessionid")) {
//清空门店id
wx.setStorageSync(this.$store.state.mixid+'storeId','')
console.log(111222,app.fenxiaoModel)
app.fenxiaoModel.query_isEntry().then((data)=>{
//分销弹框信息
......@@ -443,7 +443,7 @@ export default {
let delta = afterScrollTop - this.beforeScrollTop;
let {showFlag} = this.$mp.page.selectComponent(".custom-tab-bar").data;
if(
delta === 0 ||
Math.abs(delta) < 10 ||
afterScrollTop < 0 ||
this.beforeScrollTop < 0 ||
(delta>0 && showFlag=='down') ||
......@@ -471,30 +471,40 @@ export default {
let newHref = '/pages/home/main';
let title = app.globalData.shopInfo.shopName;
let hasInvitationStatus = 0;
await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{
hasInvitationStatus = data.hasInvitationStatus;
})
await app.fenxiaoModel.getSpokesmanInfo().then(data=>{
let newData = {}
if (hasInvitationStatus == 1) {
newData = {
spokesmanGroupId: data.groupId,
spokesmanShopId: data.shopId,
spokesmanRelId: data.id,
userId: data.userId
}
}else {
newData = {
userId: data.userId
if(wx.getStorageSync("sessionid")) {
await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{
hasInvitationStatus = data.hasInvitationStatus;
})
await app.fenxiaoModel.getSpokesmanInfo().then(data=>{
let newData = {}
if (hasInvitationStatus == 1) {
newData = {
spokesmanGroupId: data.groupId,
spokesmanShopId: data.shopId,
spokesmanRelId: data.id,
userId: data.userId
}
}else {
newData = {
userId: data.userId
}
}
}
newHref = concatUrl(newHref,newData)
})
newHref = concatUrl(newHref,newData)
})
}
let imageUrl = '';
//多主题自定义分享标题和图片
if(this.pageInfo.pageSettingData&&JSON.parse(this.pageInfo.pageSettingData).shareTitle) {
title = JSON.parse(this.pageInfo.pageSettingData).shareTitle
}
if(this.pageInfo.pageSettingData&&JSON.parse(this.pageInfo.pageSettingData).shareImg) {
imageUrl = JSON.parse(this.pageInfo.pageSettingData).shareImg
}
console.log(newHref,3333555666,title,res)
return {
title: title, // 默认是小程序的名称
path: newHref, // 默认是当前页面
// imageUrl: this.shareLogoUrl,
imageUrl: imageUrl,
success: function(res) {
// 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") {
......
......@@ -77,8 +77,10 @@ export default {
},
onLoad(options) {
if(wx.getStorageSync("sessionid")) {
//清空门店id
wx.setStorageSync(this.$store.state.mixid+'storeId','')
}
this.options = options;
Object.assign(this.$data, this.$options.data());
......@@ -191,7 +193,8 @@ export default {
if(res.data.code == '200'){
this.page = res.data.data.pageUri;
let paramsObj = JSON.parse(res.data.data.scene);
wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId)
wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId);
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
console.log(res.data.data)
console.log(wx.getStorageSync("openid"))
console.log(333333)
......@@ -205,7 +208,7 @@ export default {
}
).then(ele=>{
//清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId','')
wx.setStorageSync('attractingCustomerChannelId','');
})
}
let params = '';
......
......@@ -330,6 +330,7 @@ export default {
province: this.userInfo.province,
city: this.userInfo.city,
otherPhone: 0,
storeId: wx.getStorageSync(this.$store.state.mixid+'storeId') || '',
articleId: wx.getStorageSync(this.$store.state.mixid+"articleId") || '',
customerSourceType: wx.getStorageSync(this.$store.state.mixid+"articleId")?8:'',
customerSourceId: wx.getStorageSync(this.$store.state.mixid+"articleId") || ''
......
......@@ -13,21 +13,99 @@
</template>
<script>
let forUrlAddKey;
let getUrlKey;
if(process.browser) {
forUrlAddKey = require("mayi-front-tools/forUrlAddKey").default
getUrlKey = require("mayi-front-tools/getUrlKey").default
}
import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
export default {
data(){
return{
link : ''
link : '',
shareShopName: '',//分享名称
shareLogoUrl: '',//分享图片url
newWindowHref: '',//分享页面url
}
},
onLoad(options){
console.log(decodeURIComponent(options.link),'地址')
this.link = decodeURIComponent(options.link)
console.log(decodeURIComponent(options.link),'地址',wx.getStorageSync("sessionid"),forUrlAddKey(decodeURIComponent(options.link),{token: wx.getStorageSync("sessionid"),jwt: 1}))
if(getUrlKey(decodeURIComponent(options.link),'login') != '1') {
this.link = decodeURIComponent(options.link)
}else {
if(wx.getStorageSync("sessionid")) {
this.link = forUrlAddKey(
decodeURIComponent(options.link),
{
token: wx.getStorageSync("sessionid"),
jwt: 1
}
)
}else {
let url = `/pages/login/main?scene=sso&back=${options.link}`;
wx.navigateTo({
url
})
}
}
},
async onShareAppMessage(res) {
let url = ''
console.log(this.newWindowHref + 'this.newWindowHref')
//分享路径
if(this.newWindowHref){
url = this.newWindowHref;
}else{
url = res.webViewUrl;
}
//分享页面去掉登录态
if (url.indexOf("sessionid") > -1) {
url = url.split("?")[0] + "?mixid=" + this.shopId;
}
this.shareUrl = url ;
console.log(this.shareUrl, "index12");
console.log(`/pages/index/main?link=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
return {
title: this.shareShopName, // 默认是小程序的名称
path: `/pages/wxArticle/main?link=${encodeURIComponent(this.shareUrl)}`, // 默认是当前页面
imageUrl: this.shareLogoUrl,
success: function(res) {
// 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") {
console.log(res, "分享成功");
}
},
fail: function() {
// 转发失败之后的回调
if (res.errMsg == "shareAppMessage:fail cancel") {
// 用户取消转发
console.log(res, "分享失败");
} else if (res.errMsg == "shareAppMessage:fail") {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function() {
// 转发结束之后的回调(转发成不成功都会执行)
}
};
},
methods: {
//加载成功
handleLoad() {
console.log("网页加载成功");
},
//右上角分享时触发
getMessage(res) {
let len = res.target.data.length - 1;
console.log(res, "h5消息", res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || "";
if(res.target.data[len].shareLogoUrl) {
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
}
this.newWindowHref = res.target.data[len].shareImgUrl;// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
console.log("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,res);
},
handleError(data) {
wx.showLoading({
title: "网页加载失败 请右上角刷新",
......
{
"navigationBarTitleText": "文章"
}
\ No newline at end of file
......@@ -12,70 +12,54 @@ Component({
selectedColor: "#3cc51f",
list: [
],
mm: false,
mid: '',
componentData: {},
show: true,
mmm: false,
mainColor: "",
showFlag: "up",
cartNum: 0
},
ready() {
if (app.themeColor["--main-color"] != "#ffffff") {
this.setData({
mainColor: app.themeColor["--main-color"]
});
} else {
app.themeColorCallBack = res => {
this.setData({
mainColor: res["--main-color"]
});
};
}
// this.setData({
// mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
// });
},
attached() {
this.init()
},
methods: {
init() {
if (app.themeColor["--main-color"] != "#ffffff") {
this.setData({
mainColor: app.themeColor["--main-color"]
});
} else {
app.themeColorCallBack = res => {
this.setData({
mainColor: res["--main-color"]
});
};
}
//
let that = this;
if (app.globalData.footerVal) {
let mm =
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) ==
that.data.selected &&
app.globalData.footerVal.componentData["styleSelectionNum"] == 1;
let mid = Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
that.setData({
componentData: app.globalData.footerVal.componentData,
list: app.globalData.footerVal.componentData.list,
mm: mm
mid: mid
});
} else {
app.footerCallBack = function (params) {
params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)' : params.componentData.selectIconColor
let mid = Math.ceil(params.componentData.list.length / 2 - 1)
that.setData({
componentData: params.componentData,
list: params.componentData.list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1)
list: params.componentData.list,
mid: mid
});
let mm =
Math.ceil(params.componentData.list.length / 2 - 1) ==
that.data.selected &&
params.componentData["styleSelectionNum"] == 1;
};
}
this.setData({
mm:
Math.ceil(this.data.list.length / 2 - 1) == this.data.selected &&
this.data.componentData["styleSelectionNum"] == 1
});
},
switchTab(e) {
const { index } = e.currentTarget.dataset;
if (index==this.data.selected) return
if (index == this.data.selected) return
app.$themeToLink(this.data.list[index]["link"], 1);
}
}
......
......@@ -7,16 +7,15 @@
<view
wx:for="{{list}}"
wx:if="{{item.show}}"
wx:key="index"
class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
wx:key="index"
class="tab-bar-item {{(mid==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
data-path="{{item.link}}"
data-index="{{index}}"
bindtap="switchTab"
>
<!-- &&componentData['styleSelectionNum']==1 -->
<!-- 图标 -->
<view class="item {{index == selected ? 'current' : ''}}">
<view>
<view wx:if="{{componentData['contentFormNum']!=2}}" >
<view wx:if="{{item.iconType==0||!item.iconType}}">
<view class="antt {{item.icon}}" style="font-size:{{componentData.defaultIcon==1 ? '36rpx' : (componentData.defaultIconSize*2 + 'rpx')}};color:{{index==selected?componentData.selectIconColor:componentData.defaultIconColor}}"></view>
</view>
......@@ -29,7 +28,7 @@
</view>
</view>
<!-- 名称 -->
<view class="text" style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? (componentData.selectText==1?10:componentData.selectionTextNum)*2 : (componentData.defaultText==1?10:componentData.defaultTextNum)*2}}rpx">
<view wx:if="{{componentData['contentFormNum']!=3}}" class="text" style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? (componentData.selectText==1?10:componentData.selectionTextNum)*2 : (componentData.defaultText==1?10:componentData.defaultTextNum)*2}}rpx">
{{item.title}}</view>
<!-- 购物车商品数量 -->
<view class="isCart" wx:if="{{item.link&&item.link.link&&item.link.link=='/shopCart/shoppingCart'&&cartNum>0}}">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment