Commit 2e15a091 by 李嘉林

代码合并

parents 4cdee60e 455d0da9
...@@ -5586,6 +5586,11 @@ ...@@ -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": { "md5.js": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
}, },
"dependencies": { "dependencies": {
"mayi-analytics": "^1.1.14", "mayi-analytics": "^1.1.14",
"mayi-front-tools": "^1.0.0",
"mpvue": "^2.0.0", "mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5", "mpvue-wxparse": "^0.6.5",
"vuex": "^3.0.1" "vuex": "^3.0.1"
......
...@@ -304,13 +304,13 @@ export default { ...@@ -304,13 +304,13 @@ export default {
this.pageInfo = pageList.filter((item) => item.pageCode == 1)[0]; this.pageInfo = pageList.filter((item) => item.pageCode == 1)[0];
this.pageData = JSON.parse(this.pageInfo.pageData); 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') console.log(app.globalData.shopInfo,'app')
wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName}) wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName})
wx.stopPullDownRefresh()
if(wx.getStorageSync("sessionid")) { if(wx.getStorageSync("sessionid")) {
//清空门店id
wx.setStorageSync(this.$store.state.mixid+'storeId','')
console.log(111222,app.fenxiaoModel) console.log(111222,app.fenxiaoModel)
app.fenxiaoModel.query_isEntry().then((data)=>{ app.fenxiaoModel.query_isEntry().then((data)=>{
//分销弹框信息 //分销弹框信息
...@@ -443,7 +443,7 @@ export default { ...@@ -443,7 +443,7 @@ export default {
let delta = afterScrollTop - this.beforeScrollTop; let delta = afterScrollTop - this.beforeScrollTop;
let {showFlag} = this.$mp.page.selectComponent(".custom-tab-bar").data; let {showFlag} = this.$mp.page.selectComponent(".custom-tab-bar").data;
if( if(
delta === 0 || Math.abs(delta) < 10 ||
afterScrollTop < 0 || afterScrollTop < 0 ||
this.beforeScrollTop < 0 || this.beforeScrollTop < 0 ||
(delta>0 && showFlag=='down') || (delta>0 && showFlag=='down') ||
...@@ -471,6 +471,7 @@ export default { ...@@ -471,6 +471,7 @@ export default {
let newHref = '/pages/home/main'; let newHref = '/pages/home/main';
let title = app.globalData.shopInfo.shopName; let title = app.globalData.shopInfo.shopName;
let hasInvitationStatus = 0; let hasInvitationStatus = 0;
if(wx.getStorageSync("sessionid")) {
await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{ await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{
hasInvitationStatus = data.hasInvitationStatus; hasInvitationStatus = data.hasInvitationStatus;
}) })
...@@ -490,11 +491,20 @@ export default { ...@@ -490,11 +491,20 @@ export default {
} }
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) console.log(newHref,3333555666,title,res)
return { return {
title: title, // 默认是小程序的名称 title: title, // 默认是小程序的名称
path: newHref, // 默认是当前页面 path: newHref, // 默认是当前页面
// imageUrl: this.shareLogoUrl, imageUrl: imageUrl,
success: function(res) { success: function(res) {
// 转发成功之后的回调 // 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") { if (res.errMsg == "shareAppMessage:ok") {
......
...@@ -77,8 +77,10 @@ export default { ...@@ -77,8 +77,10 @@ export default {
}, },
onLoad(options) { onLoad(options) {
if(wx.getStorageSync("sessionid")) {
//清空门店id
wx.setStorageSync(this.$store.state.mixid+'storeId','')
}
this.options = options; this.options = options;
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
...@@ -191,7 +193,8 @@ export default { ...@@ -191,7 +193,8 @@ export default {
if(res.data.code == '200'){ if(res.data.code == '200'){
this.page = res.data.data.pageUri; this.page = res.data.data.pageUri;
let paramsObj = JSON.parse(res.data.data.scene); 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(res.data.data)
console.log(wx.getStorageSync("openid")) console.log(wx.getStorageSync("openid"))
console.log(333333) console.log(333333)
...@@ -205,7 +208,7 @@ export default { ...@@ -205,7 +208,7 @@ export default {
} }
).then(ele=>{ ).then(ele=>{
//清空引客渠道id //清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId','') wx.setStorageSync('attractingCustomerChannelId','');
}) })
} }
let params = ''; let params = '';
......
...@@ -330,6 +330,7 @@ export default { ...@@ -330,6 +330,7 @@ export default {
province: this.userInfo.province, province: this.userInfo.province,
city: this.userInfo.city, city: this.userInfo.city,
otherPhone: 0, otherPhone: 0,
storeId: wx.getStorageSync(this.$store.state.mixid+'storeId') || '',
articleId: wx.getStorageSync(this.$store.state.mixid+"articleId") || '', articleId: wx.getStorageSync(this.$store.state.mixid+"articleId") || '',
customerSourceType: wx.getStorageSync(this.$store.state.mixid+"articleId")?8:'', customerSourceType: wx.getStorageSync(this.$store.state.mixid+"articleId")?8:'',
customerSourceId: wx.getStorageSync(this.$store.state.mixid+"articleId") || '' customerSourceId: wx.getStorageSync(this.$store.state.mixid+"articleId") || ''
......
...@@ -13,21 +13,99 @@ ...@@ -13,21 +13,99 @@
</template> </template>
<script> <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 { export default {
data(){ data(){
return{ return{
link : '' link : '',
shareShopName: '',//分享名称
shareLogoUrl: '',//分享图片url
newWindowHref: '',//分享页面url
} }
}, },
onLoad(options){ onLoad(options){
console.log(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) 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: { methods: {
//加载成功 //加载成功
handleLoad() { handleLoad() {
console.log("网页加载成功"); 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) { handleError(data) {
wx.showLoading({ wx.showLoading({
title: "网页加载失败 请右上角刷新", title: "网页加载失败 请右上角刷新",
......
{ {
"navigationBarTitleText": "文章"
} }
\ No newline at end of file
...@@ -12,15 +12,18 @@ Component({ ...@@ -12,15 +12,18 @@ Component({
selectedColor: "#3cc51f", selectedColor: "#3cc51f",
list: [ list: [
], ],
mm: false, mid: '',
componentData: {}, componentData: {},
show: true, show: true,
mmm: false,
mainColor: "", mainColor: "",
showFlag: "up", showFlag: "up",
cartNum: 0 cartNum: 0
}, },
ready() { attached() {
this.init()
},
methods: {
init() {
if (app.themeColor["--main-color"] != "#ffffff") { if (app.themeColor["--main-color"] != "#ffffff") {
this.setData({ this.setData({
mainColor: app.themeColor["--main-color"] mainColor: app.themeColor["--main-color"]
...@@ -32,50 +35,31 @@ Component({ ...@@ -32,50 +35,31 @@ Component({
}); });
}; };
} }
// this.setData({ //
// mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
// });
},
attached() {
this.init()
},
methods: {
init() {
let that = this; let that = this;
if (app.globalData.footerVal) { if (app.globalData.footerVal) {
let mm = let mid = Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) ==
that.data.selected &&
app.globalData.footerVal.componentData["styleSelectionNum"] == 1;
that.setData({ that.setData({
componentData: app.globalData.footerVal.componentData, componentData: app.globalData.footerVal.componentData,
list: app.globalData.footerVal.componentData.list, list: app.globalData.footerVal.componentData.list,
mm: mm mid: mid
}); });
} else { } else {
app.footerCallBack = function (params) { app.footerCallBack = function (params) {
params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)' : params.componentData.selectIconColor 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({ that.setData({
componentData: params.componentData, componentData: params.componentData,
list: params.componentData.list list: params.componentData.list,
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1) 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) { switchTab(e) {
const { index } = e.currentTarget.dataset; 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); app.$themeToLink(this.data.list[index]["link"], 1);
} }
} }
......
...@@ -8,15 +8,14 @@ ...@@ -8,15 +8,14 @@
wx:for="{{list}}" wx:for="{{list}}"
wx:if="{{item.show}}" wx:if="{{item.show}}"
wx:key="index" wx:key="index"
class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}" class="tab-bar-item {{(mid==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
data-path="{{item.link}}" data-path="{{item.link}}"
data-index="{{index}}" data-index="{{index}}"
bindtap="switchTab" bindtap="switchTab"
> >
<!-- &&componentData['styleSelectionNum']==1 -->
<!-- 图标 --> <!-- 图标 -->
<view class="item {{index == selected ? 'current' : ''}}"> <view class="item {{index == selected ? 'current' : ''}}">
<view> <view wx:if="{{componentData['contentFormNum']!=2}}" >
<view wx:if="{{item.iconType==0||!item.iconType}}"> <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 class="antt {{item.icon}}" style="font-size:{{componentData.defaultIcon==1 ? '36rpx' : (componentData.defaultIconSize*2 + 'rpx')}};color:{{index==selected?componentData.selectIconColor:componentData.defaultIconColor}}"></view>
</view> </view>
...@@ -29,7 +28,7 @@ ...@@ -29,7 +28,7 @@
</view> </view>
</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> {{item.title}}</view>
<!-- 购物车商品数量 --> <!-- 购物车商品数量 -->
<view class="isCart" wx:if="{{item.link&&item.link.link&&item.link.link=='/shopCart/shoppingCart'&&cartNum>0}}"> <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