Commit 3fe47975 by 张卓

Merge branch 'nativehome_tst' of http://code.mayi888.com/chengmo/mayi-mp-shop into nativehome_tst

parents b6cb2eb0 d7ae7837
......@@ -22,7 +22,7 @@
"build:my": "node build/build.js my"
},
"dependencies": {
"mayi-analytics": "^1.1.14",
"mayi-analytics": "^1.1.24",
"mayi-front-tools": "^1.0.0",
"mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5",
......
......@@ -147,6 +147,12 @@ export default {
getShopInfo({ mixid }) {
shop.getShopInfo({ shopMixId: mixid }).then((res) => {
if (res.data.code == 200) {
// 收集用户数据
this.$mpBehavior.init("mayi-moblie-shop-mp", res.data.data.id, {
mode: process.env.NODE_ENV,
gid: res.data.data.groupId
})
let mpApp = getApp();
// 商城基本数据
mpApp.shopCallBack && mpApp.shopCallBack(res.data.data);
......
......@@ -28,6 +28,11 @@ Vue.config.productionTip = false
App.mpType = 'app'
Vue.prototype.$store = Store
// 用户行为收集
console.log(Store.state,'---35')
let mpBehavior = require("../node_modules/mayi-analytics/dist/mayi.mpBehavior")
Vue.prototype.$mpBehavior = mpBehavior;
// 异常监控(行为收集)
let mpAnalytics = require("../node_modules/mayi-analytics/dist/mayi.mpAnalytics.js")
.default;
......
<template>
<div class="contact">
<div class="contact-img">
<img src="https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/product/HCe2iRXHsP.png" alt="">
</div>
<div class="btn-wrap">
<button open-type="contact">
<div class="btn-main">
<div class="main-img">
<img src="../../../static/images/wx.png" alt="">
</div>
<div class="main-text">官方微信客服</div>
</div>
<img class="btn-next" src="../../../static/images/next.png" alt="">
</button>
<div class="contact">
<div class="contact-img">
<img src="https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/product/HCe2iRXHsP.png" alt="" />
</div>
<div class="btn-wrap">
<button open-type="contact" show-message-card :session-from="sessionFrom">
<div class="btn-main">
<div class="main-img">
<img src="../../../static/images/wx.png" alt="" />
</div>
<div class="main-text">官方微信客服</div>
</div>
<img class="btn-next" src="../../../static/images/next.png" alt="" />
</button>
</div>
</div>
</template>
<script>
import { getUserLocation } from "../../utils/wxIndex.js";
export default {
}
data() {
return {
sessionFrom: "",
};
},
onLoad(options) {
getUserLocation().then((res) => {
options.longitude = res.longitude;
options.latitude = res.latitude;
this.sessionFrom = JSON.stringify(options);
console.log('sessionFrom',this.sessionFrom)
});
},
};
</script>
<style scoped>
.contact{
padding: 10px 22px 0 22px;
}
.contact-img{
width: 100%;
height: 154px;
margin-bottom: 24px;
background-color: #ccc;
border-radius: 8px;
}
.contact-img img{
width: 100%;
height: 100%;
}
.btn-wrap{
width: 100%;
height: 80px;
box-sizing: border-box;
}
button{
width: 100%;
height: 80px;
border: none;
padding: 20px 10px 20px 10px;
background-color: white;
box-shadow: #eee 0px 0px 5px 4px;
display: flex;
align-items: center;
justify-content: space-between;
}
.btn-main{
display: flex;
height: 40px;
}
.main-img{
width: 54px;
height: 40px;
border-right: 1px solid #D7D4D4;
padding-top: 3px;
}
.main-img img{
width: 42px;
height: 34px;
}
.main-text{
color: #1C1B1B;
font-size:17px;
margin-left: 10px;
}
.btn-next{
width: 9px;
height: 14px;
}
.btn-next img{
width: 100%;
height: 100%;
}
button::after{
border: none;
}
.contact {
padding: 10px 22px 0 22px;
}
.contact-img {
width: 100%;
height: 154px;
margin-bottom: 24px;
background-color: #ccc;
border-radius: 8px;
}
.contact-img img {
width: 100%;
height: 100%;
}
.btn-wrap {
width: 100%;
height: 80px;
box-sizing: border-box;
}
button {
width: 100%;
height: 80px;
border: none;
padding: 20px 10px 20px 10px;
background-color: white;
box-shadow: #eee 0px 0px 5px 4px;
display: flex;
align-items: center;
justify-content: space-between;
}
.btn-main {
display: flex;
height: 40px;
}
.main-img {
width: 54px;
height: 40px;
border-right: 1px solid #d7d4d4;
padding-top: 3px;
}
.main-img img {
width: 42px;
height: 34px;
}
.main-text {
color: #1c1b1b;
font-size: 17px;
margin-left: 10px;
}
.btn-next {
width: 9px;
height: 14px;
}
.btn-next img {
width: 100%;
height: 100%;
}
button::after {
border: none;
}
</style>
\ No newline at end of file
......@@ -470,7 +470,30 @@ export default {
}
return params;
}
},
delParam(oldUrl,paramKey) {
var url = oldUrl; //页面url
var urlParam = oldUrl.split("?")[1]; //页面参数
var beforeUrl = url.substr(0, url.indexOf("?")); //页面主地址(参数之前地址)
var nextUrl = "";
var arr = new Array();
if (urlParam != "") {
var urlParamArr = urlParam.split("&"); //将参数按照&符分成数组
for (var i = 0; i < urlParamArr.length; i++) {
var paramArr = urlParamArr[i].split("="); //将参数键,值拆开
//如果键雨要删除的不一致,则加入到参数中
if (paramArr[0] != paramKey) {
arr.push(urlParamArr[i]);
}
}
}
if (arr.length > 0) {
nextUrl = "?" + arr.join("&");
}
url = beforeUrl + nextUrl;
return url;
},
},
onUnload() {
console.log("卸载----------------", this.options);
......@@ -487,7 +510,9 @@ export default {
}
//分享页面去掉登录态
if (url.indexOf("sessionid") > -1) {
url = url.split("?")[0] + "?mixid=" + this.shopId;
// url = url.split("?")[0] + "?mixid=" + this.shopId;
url = this.delParam(this.newWindowHref,'sessionid')
url = this.delParam(url,'open_id')
}
//分销员推广页面 默认分享分销员中心页面
if (url.indexOf("/personalCenter/spokesmanCenter/mine/popularize") > -1) {
......
// 微信解密
export function wx_decode(appId,sessionKey,encryptedData,iv) {
export function wx_decode(appId, sessionKey, encryptedData, iv) {
var WXBizDataCrypt = require('./WXBizDataCrypt');
var pc = new WXBizDataCrypt(appId, sessionKey);
var data = pc.decryptData(encryptedData, iv);
return data;
}
// 定位方法
export function getUserLocation() {
return new Promise((resolve,reject)=>{
wx.getLocation({
type: 'gcj02', // type有两中类型,gcj02 是腾讯地图所能解析的
success: res => {
resolve(res)
}
})
})
}
\ No newline at end of file
......@@ -5,7 +5,7 @@
</view>
<view wx:if="{{datas.componentData.style==='list'}}">
<view class="imgcontent" bindtap="itemClick" data-item="{{item}}" wx:for="{{datas.componentData.imgList}}" wx:key="index" style="margin-bottom:{{datas.componentData.imgPadding * 2}}rpx">
<image src="{{item.imageUrl}}" lazy-load mode="widthFix"></image>
<image src="{{item.imageUrl}}" mode="widthFix"></image>
</view>
</view>
<view wx:elif="{{datas.componentData.style==='across' || datas.componentData.style==='tiled'}}" class="across">
......
......@@ -21,7 +21,7 @@
</view>
<view
wx:elif="{{item.iconType==1}}"
class="img-view icons "
class="img-view "
>
<image
......
......@@ -1217,9 +1217,19 @@
box-sizing: border-box;
color: white;
}
.isItem .item .img-view{
width: 90rpx;
height: 90rpx;
background: var(--main-color);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border: 4px solid #fff;
}
.icons {
width: 100rpx;
height: 100rpx;
width: 90rpx;
height: 90rpx;
background: var(--main-color);
border-radius: 50%;
display: flex;
......
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