Commit c74e568c authored by 罗超's avatar 罗超

调整分享

parent d4cb3a43
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
> >
<view <view
class="ad-chi" class="ad-chi"
v-for="(item, index) in ad.list" v-for="(item, index) in adtemp"
:key="index" :key="index"
:style="[item.formatStyle]" :style="[item.formatStyle]"
@click="clickHandler(item.link[0].new_link_url)" @click="clickHandler(item.link[0].new_link_url)"
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
<script> <script>
export default { export default {
props: ["ad"], props: ["ad"],
data() {
return {
adtemp:[]
}
},
created() { created() {
this.ad.list.forEach((x) => { this.ad.list.forEach((x) => {
x.formatStyle = { x.formatStyle = {
...@@ -33,6 +38,7 @@ export default { ...@@ -33,6 +38,7 @@ export default {
if (this.ad.height == "auto") { if (this.ad.height == "auto") {
x.formatStyle.position = "unset"; x.formatStyle.position = "unset";
} }
this.adtemp.push(x)
}); });
}, },
methods: { methods: {
......
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})
</script>
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
</head>
<body>
<noscript>
<strong>Please enable JavaScript to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
...@@ -84,5 +84,19 @@ ...@@ -84,5 +84,19 @@
}, },
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : false
},
"h5" : {
"router" : {
"mode" : "history",
"base" : "/h5/"
},
"template" : "h5.html",
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "ZAPBZ-SVBWR-OAMWM-WC45H-AKFU3-FIBP3"
}
}
}
} }
} }
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [{ "pages": [{
"path": "pages/index/index" "path": "pages/index/index",
"enablePullDownRefresh": true
}, },
{ {
"path": "pages/cart/cart" "path": "pages/cart/cart"
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
{ {
"path": "pages/webbox/webbox" "path": "pages/webbox/webbox"
} }
], ],
"subPackages": [{ "subPackages": [{
"root": "pages/goods", "root": "pages/goods",
...@@ -48,22 +49,22 @@ ...@@ -48,22 +49,22 @@
} }
] ]
}, },
// { // {
// "root": "pages/member", // "root": "pages/member",
// "pages": [{ // "pages": [{
// "path": "index/index" // "path": "index/index"
// }, // },
// { // {
// "path": "privilege" // "path": "privilege"
// } // }
// ] // ]
// }, // },
{ {
"root": "pages/balance", "root": "pages/balance",
"pages": [ "pages": [
// { // {
// "path": "recharge" // "path": "recharge"
// }, // },
{ {
"path": "balance" "path": "balance"
}, },
...@@ -74,20 +75,18 @@ ...@@ -74,20 +75,18 @@
} }
] ]
}, },
{ {
"root": "pages/live", "root": "pages/live",
"plugins": { "plugins": {
"live-player-plugin": { "live-player-plugin": {
"version": "1.0.18", "version": "1.0.18",
"provider": "wx2b03c6e691cd7370" "provider": "wx2b03c6e691cd7370"
} }
}, },
"pages": [ "pages": [{
{ "path": "index"
"path": "index" }]
} },
]
},
{ {
"root": "pages/user-center", "root": "pages/user-center",
"pages": [{ "pages": [{
...@@ -109,12 +108,12 @@ ...@@ -109,12 +108,12 @@
{ {
"path": "cash/cash" "path": "cash/cash"
}, },
{ {
"path": "level/level" "path": "level/level"
}, },
{ {
"path": "examine" "path": "examine"
} }
] ]
}, },
...@@ -210,15 +209,15 @@ ...@@ -210,15 +209,15 @@
] ]
} }
], ],
// "rules": [{
// "action": "allow",
// "page": "*"
// }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8",
"app-plus": {
//#ifdef H5
"titleNView": false
//#endif
}
} }
} }
\ No newline at end of file
...@@ -12,17 +12,24 @@ ...@@ -12,17 +12,24 @@
@click="previewImage" @click="previewImage"
></u-swiper> ></u-swiper>
<!-- TODO 分销价格未做 is_share_price --> <!-- TODO 分销价格未做 is_share_price -->
<view class="is_share" v-if="g.share>0"> <view class="is_share" v-if="g.share > 0">
<image <image
src="@/static/images/icon/WechatIMG424.png" src="@/static/images/icon/WechatIMG424.png"
style="width: 20px;margin-left: 12px;opacity: 1;" style="width: 20px; margin-left: 12px; opacity: 1;"
mode="widthFix" mode="widthFix"
/> />
<view <view
style="display: flex;flex-direction: column;margin-left: 8px;font-size: 11px;color: #fff;opacity: 1;" style="
display: flex;
flex-direction: column;
margin-left: 8px;
font-size: 11px;
color: #fff;
opacity: 1;
"
> >
<Text>分销最高可赚</Text> <Text>分销最高可赚</Text>
<Text>{{g.share}}</Text> <Text>{{ g.share }}</Text>
</view> </view>
</view> </view>
</view> </view>
...@@ -34,9 +41,9 @@ ...@@ -34,9 +41,9 @@
<text class="small"></text> <text class="small"></text>
<text class="numfont"> <text class="numfont">
{{ {{
g.price_min == g.price_max g.price_min == g.price_max
? g.price_min ? g.price_min
: g.price_min + "-" + g.price_max : g.price_min + "-" + g.price_max
}} }}
</text> </text>
</view> </view>
...@@ -44,33 +51,46 @@ ...@@ -44,33 +51,46 @@
<!-- TODO is_member_user_member_price 会员用户会员价 --> <!-- TODO is_member_user_member_price 会员用户会员价 -->
<view class="sell u-skeleton-rect"> <view class="sell u-skeleton-rect">
<text class="oprice" v-if="setting.is_underline_price == 1"> <text class="oprice" v-if="setting.is_underline_price == 1">
{{ {{ g.original_price }}
g.original_price
}}
</text> </text>
<text v-if="setting.is_sales == 1">已售出{{ g.sales }}{{ g.unit }}</text> <text v-if="setting.is_sales == 1"
>已售出{{ g.sales }}{{ g.unit }}</text
>
</view> </view>
</view> </view>
<view class="right u-skeleton-rect" @click="openShare"> <view class="right u-skeleton-rect" @click="openShare">
<image src="@/static/images/icon/icon-share.png" class="share-icon" /> <image
src="@/static/images/icon/icon-share.png"
class="share-icon"
/>
<text>分享</text> <text>分享</text>
</view> </view>
</view> </view>
</view> </view>
<view class="sku-box u-skeleton-rect" v-if="g.goods_marketing_award.integral.title != ''"> <view
class="sku-box u-skeleton-rect"
v-if="g.goods_marketing_award.integral.title != ''"
>
<view class="label">活动</view> <view class="label">活动</view>
<view class="content"> <view class="content">
<u-tag text="送积分" type="error" /> <u-tag text="送积分" type="error" />
<text <text style="margin-left: 5px; font-size: 12px;">{{
style="margin-left: 5px; font-size: 12px;" g.goods_marketing_award.integral.title
>{{ g.goods_marketing_award.integral.title }}</text> }}</text>
</view> </view>
</view> </view>
<view class="sku-box u-skeleton-rect" style="align-items: flex-start;" v-if="sku.length > 0"> <view
class="sku-box u-skeleton-rect"
style="align-items: flex-start;"
v-if="sku.length > 0"
>
<view class="label">选择</view> <view class="label">选择</view>
<view class="content"> <view class="content">
<view class="sku-chosen" @click="chosenSku"> <view class="sku-chosen" @click="chosenSku">
<view class="sku">{{ currentSku.attr_list.length > 0 ? "已" : "请" }}选择 {{ sku }}</view> <view class="sku"
>{{ currentSku.attr_list.length > 0 ? "已" : "请" }}选择
{{ sku }}</view
>
<view class="arrow"> <view class="arrow">
<u-icon name="arrow" :size="32" color="#111"></u-icon> <u-icon name="arrow" :size="32" color="#111"></u-icon>
</view> </view>
...@@ -87,7 +107,7 @@ ...@@ -87,7 +107,7 @@
</view> </view>
<view class="item" v-if="g.attr_groups[0].attr_list.length > 1"> <view class="item" v-if="g.attr_groups[0].attr_list.length > 1">
{{ g.attr_groups[0].attr_list.length }}{{ {{ g.attr_groups[0].attr_list.length }}{{
g.attr_groups[0].attr_group_name g.attr_groups[0].attr_group_name
}}可选 }}可选
</view> </view>
</template> </template>
...@@ -98,12 +118,13 @@ ...@@ -98,12 +118,13 @@
v-if="i < 5" v-if="i < 5"
:key="i" :key="i"
style="margin-bottom: 5px;" style="margin-bottom: 5px;"
>{{ x.attr_name }}</view> >{{ x.attr_name }}</view
>
</template> </template>
<view class="item" v-if="g.attr_groups[0].attr_list.length > 1"> <view class="item" v-if="g.attr_groups[0].attr_list.length > 1">
共{{ g.attr_groups[0].attr_list.length }}种{{ 共{{ g.attr_groups[0].attr_list.length }}种{{
g.attr_groups[0].attr_group_name g.attr_groups[0].attr_group_name
}}可选 }}可选
</view> </view>
</template> </template>
...@@ -113,7 +134,9 @@ ...@@ -113,7 +134,9 @@
<view class="sku-box u-skeleton-rect" v-if="setting.is_express == '1'"> <view class="sku-box u-skeleton-rect" v-if="setting.is_express == '1'">
<view class="label">快递</view> <view class="label">快递</view>
<view class="content">{{ g.express == "" ? "免运费" :('¥'+ g.express) }}</view> <view class="content">{{
g.express == "" ? "免运费" : "¥" + g.express
}}</view>
</view> </view>
<view <view
class="sku-box u-skeleton-rect" class="sku-box u-skeleton-rect"
...@@ -132,7 +155,10 @@ ...@@ -132,7 +155,10 @@
<view class="content">{{ g.goods_marketing.limit }}</view> <view class="content">{{ g.goods_marketing.limit }}</view>
</view> </view>
<view class="sku-box u-skeleton-rect" v-if="comments.length == 0 && setting.is_comment == 1"> <view
class="sku-box u-skeleton-rect"
v-if="comments.length == 0 && setting.is_comment == 1"
>
<view class="label">暂无评论信息</view> <view class="label">暂无评论信息</view>
</view> </view>
<view class="comment" v-if="comments.length > 0"> <view class="comment" v-if="comments.length > 0">
...@@ -152,9 +178,7 @@ ...@@ -152,9 +178,7 @@
<view class="user"> <view class="user">
<u-avatar :src="comments[0].UserPhotoPath" :size="50"></u-avatar> <u-avatar :src="comments[0].UserPhotoPath" :size="50"></u-avatar>
<text style="margin-left: 10px;"> <text style="margin-left: 10px;">
{{ {{ comments[0].UserName }}
comments[0].UserName
}}
</text> </text>
</view> </view>
<view class="timer">{{ comments[0].CreateDate }}</view> <view class="timer">{{ comments[0].CreateDate }}</view>
...@@ -162,17 +186,31 @@ ...@@ -162,17 +186,31 @@
<view class="ucontent">{{ comments[0].Content }}</view> <view class="ucontent">{{ comments[0].Content }}</view>
</view> </view>
</view> </view>
<u-divider :margin-top="20" :margin-bottom="20" bg-color="transparent">商品详情</u-divider> <u-divider :margin-top="20" :margin-bottom="20" bg-color="transparent"
>商品详情</u-divider
>
<view class="details"> <view class="details">
<!-- <rich-text :nodes="detailContent" @click="clickDescription"></rich-text> --> <!-- <rich-text :nodes="detailContent" @click="clickDescription"></rich-text> -->
<h-parse :content="detailContent" @navigate="clickDescription"></h-parse> <h-parse
:content="detailContent"
@navigate="clickDescription"
></h-parse>
</view> </view>
<u-divider :margin-top="20" :margin-bottom="20" bg-color="transparent">或许你喜欢</u-divider> <u-divider :margin-top="20" :margin-bottom="20" bg-color="transparent"
<view style="width: calc(100vw - 20px); margin-left: 10px; overflow: hidden;"> >或许你喜欢</u-divider
>
<view
style="width: calc(100vw - 20px); margin-left: 10px; overflow: hidden;"
>
<goodlist :list="recommend"></goodlist> <goodlist :list="recommend"></goodlist>
</view> </view>
<u-skeleton v-if="loading" :loading="true" :animation="true" bgcolor="#FFF"></u-skeleton> <u-skeleton
v-if="loading"
:loading="true"
:animation="true"
bgcolor="#FFF"
></u-skeleton>
<goodsaction <goodsaction
v-if="!loading" v-if="!loading"
:good-name="g.name" :good-name="g.name"
...@@ -194,7 +232,11 @@ ...@@ -194,7 +232,11 @@
@close="closeSkuChosen" @close="closeSkuChosen"
></goodsku> ></goodsku>
</view> </view>
<u-empty text="没有找到商品,或商品已下架" mode="favor" v-if="!isExsitGoods"></u-empty> <u-empty
text="没有找到商品,或商品已下架"
mode="favor"
v-if="!isExsitGoods"
></u-empty>
<share <share
:good-id="id" :good-id="id"
v-if="showShare" v-if="showShare"
...@@ -202,7 +244,11 @@ ...@@ -202,7 +244,11 @@
:images="g.pic_url" :images="g.pic_url"
@close="closeShare" @close="closeShare"
></share> ></share>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view> </view>
</template> </template>
...@@ -215,7 +261,7 @@ import goodsaction from "./components/goodsaction"; ...@@ -215,7 +261,7 @@ import goodsaction from "./components/goodsaction";
import goodsku from "@/components/goods/goodsku"; import goodsku from "@/components/goods/goodsku";
import auth from "@/components/auth/index"; import auth from "@/components/auth/index";
import share from "./components/share/share"; import share from "./components/share/share";
import hParse from "./components/u-parse/parse.vue" import hParse from "./components/u-parse/parse.vue";
export default { export default {
data() { data() {
return { return {
...@@ -244,10 +290,10 @@ export default { ...@@ -244,10 +290,10 @@ export default {
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
GoodsId: 0, GoodsId: 0,
CommentGrade: 0 CommentGrade: 0,
}, },
showAuth: false, showAuth: false,
u: {} u: {},
}; };
}, },
components: { components: {
...@@ -256,7 +302,7 @@ export default { ...@@ -256,7 +302,7 @@ export default {
goodsku, goodsku,
auth, auth,
share, share,
hParse hParse,
}, },
onLoad(option) { onLoad(option) {
this.opTionObj = option; this.opTionObj = option;
...@@ -273,7 +319,7 @@ export default { ...@@ -273,7 +319,7 @@ export default {
if (!this.u) { if (!this.u) {
this.u = { this.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "" avatarUrl: "",
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
...@@ -288,19 +334,17 @@ export default { ...@@ -288,19 +334,17 @@ export default {
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let u = uni.getStorageSync("mall_UserInfo"); let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0;
return { return {
title: title:
this.g.app_share_title != null && this.g.app_share_title != "" this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title ? this.g.app_share_title
: this.g.name, : this.g.name,
path: path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid,
"/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId
? u.UserId
: 0,
imageUrl: imageUrl:
this.g.app_share_pic != null && this.g.app_share_pic != "" this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic ? this.g.app_share_pic
: this.g.pic_url[0].pic_url : this.g.pic_url[0].pic_url,
}; };
}, },
mounted() { mounted() {
...@@ -315,9 +359,12 @@ export default { ...@@ -315,9 +359,12 @@ export default {
initImages() { initImages() {
// let that = this; // let that = this;
let info = uni.createSelectorQuery().in(this); let info = uni.createSelectorQuery().in(this);
info.select('.goods').boundingClientRect(data => { info
console.log("得到布局位置信息" + JSON.stringify(data)); .select(".goods")
}).exec(); .boundingClientRect((data) => {
console.log("得到布局位置信息" + JSON.stringify(data));
})
.exec();
// info // info
// .boundingClientRect(function (data) { // .boundingClientRect(function (data) {
// console.log(data) // console.log(data)
...@@ -347,18 +394,18 @@ export default { ...@@ -347,18 +394,18 @@ export default {
let pages = uni.getStorageSync("basedata") let pages = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").bar_title ? uni.getStorageSync("basedata").bar_title
: []; : [];
pages.forEach(x => { pages.forEach((x) => {
if (x.value == u) { if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name; this.pageTitle = x.new_name ? x.new_name : x.name;
} }
}); });
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.pageTitle title: this.pageTitle,
}); });
}, },
clickCommentHandler() { clickCommentHandler() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/goods/comment-list?id=" + this.id url: "/pages/goods/comment-list?id=" + this.id,
}); });
}, },
init() { init() {
...@@ -367,14 +414,14 @@ export default { ...@@ -367,14 +414,14 @@ export default {
{ {
url: "/api/AppletGoods/GetAppletGoodsInfo", url: "/api/AppletGoods/GetAppletGoodsInfo",
data: { data: {
GoodsId: this.id GoodsId: this.id,
} },
}, },
res => { (res) => {
console.log(res, "详情"); console.log(res, "详情");
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.g = res.data.goods; this.g = res.data.goods;
this.g.pic_url.forEach(x => { this.g.pic_url.forEach((x) => {
this.imgs.push(x.pic_url); this.imgs.push(x.pic_url);
}); });
if (this.g.attr_groups.length > 0) { if (this.g.attr_groups.length > 0) {
...@@ -384,7 +431,7 @@ export default { ...@@ -384,7 +431,7 @@ export default {
} }
this.sku += x.attr_group_name; this.sku += x.attr_group_name;
}); });
this.g.attr_groups[0].attr_list.forEach(x => { this.g.attr_groups[0].attr_list.forEach((x) => {
if (x.pic_url) { if (x.pic_url) {
this.skuimage.push(x.pic_url); this.skuimage.push(x.pic_url);
} }
...@@ -413,7 +460,7 @@ export default { ...@@ -413,7 +460,7 @@ export default {
current: i, current: i,
longPressActions: { longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"], itemList: ["发送给朋友", "保存图片", "收藏"],
success: function(data) { success: function (data) {
console.log( console.log(
"选中了第" + "选中了第" +
(data.tapIndex + 1) + (data.tapIndex + 1) +
...@@ -422,10 +469,10 @@ export default { ...@@ -422,10 +469,10 @@ export default {
"张图片" "张图片"
); );
}, },
fail: function(err) { fail: function (err) {
console.log(err.errMsg); console.log(err.errMsg);
} },
} },
}); });
}, },
initComments() { initComments() {
...@@ -434,9 +481,9 @@ export default { ...@@ -434,9 +481,9 @@ export default {
this.request2( this.request2(
{ {
url: "/api/AppletOrder/GetAppletGoodsCommentPageList", url: "/api/AppletOrder/GetAppletGoodsCommentPageList",
data: this.msg data: this.msg,
}, },
res => { (res) => {
console.log(res, "pinglun"); console.log(res, "pinglun");
this.comments = res.data.pageData; this.comments = res.data.pageData;
// this.initRecommend(); // this.initRecommend();
...@@ -448,10 +495,10 @@ export default { ...@@ -448,10 +495,10 @@ export default {
{ {
url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY", url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY",
data: { data: {
RecommendType: 1 RecommendType: 1,
} },
}, },
res => { (res) => {
this.recommend = res.data.List; this.recommend = res.data.List;
console.log(this.recommend, "recommeds"); console.log(this.recommend, "recommeds");
} }
...@@ -462,10 +509,10 @@ export default { ...@@ -462,10 +509,10 @@ export default {
{ {
url: "/api/AppletUser/SetUserFootMarkInfo", url: "/api/AppletUser/SetUserFootMarkInfo",
data: { data: {
GoodsId: id GoodsId: id,
} },
}, },
res => {} (res) => {}
); );
}, },
joinCar() { joinCar() {
...@@ -504,8 +551,8 @@ export default { ...@@ -504,8 +551,8 @@ export default {
}, },
openShare() { openShare() {
this.showShare = true; this.showShare = true;
} },
} },
}; };
</script> </script>
......
<template> <template>
<view class="content" :style="{ 'padding-bottom': showtabs==ture? '100rpx':0 }"> <view class="content" v-if="myPageData.home_pages" :style="{ 'padding-bottom': showtabs==ture? '100rpx':0 }">
<u-tabs <u-tabs
v-if="myPageData.home_pages.navs.length > 1" v-if="myPageData.home_pages && myPageData.home_pages.navs.length > 1"
name="name" name="name"
:list="myPageData.home_pages.navs" :list="myPageData.home_pages.navs"
:is-scroll="true" :is-scroll="true"
...@@ -173,9 +173,10 @@ export default { ...@@ -173,9 +173,10 @@ export default {
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let uid=uni.getStorageSync('mall_UserInfo') ?uni.getStorageSync('mall_UserInfo').UserId:0
return { return {
title:this.setting.share_title?this.setting.share_title:uni.getStorageSync("basedata").mall.name, title:this.setting.share_title?this.setting.share_title:uni.getStorageSync("basedata").mall.name,
path: "/pages/index/index?user_id=" + uni.getStorageSync('mall_UserInfo') ?uni.getStorageSync('mall_UserInfo').UserId:0, path: "/pages/index/index?user_id=" + uid,
imageUrl: this.setting.share_pic?this.setting.share_pic:'', imageUrl: this.setting.share_pic?this.setting.share_pic:'',
}; };
}, },
......
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