|
@@ -3,7 +3,7 @@
|
|
|
<view class="carousel">
|
|
<view class="carousel">
|
|
|
<swiper indicator-dots :circular="true" duration="400">
|
|
<swiper indicator-dots :circular="true" duration="400">
|
|
|
<swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
|
|
<swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
|
|
|
- <view class="image-wrapper"><image :src="item" class="loaded" mode="aspectFill"></image></view>
|
|
|
|
|
|
|
+ <view class="image-wrapper"><image :src="item" class="loaded" mode="scaleToFill"></image></view>
|
|
|
</swiper-item>
|
|
</swiper-item>
|
|
|
</swiper>
|
|
</swiper>
|
|
|
</view>
|
|
</view>
|
|
@@ -43,7 +43,7 @@
|
|
|
<view class="bot-row">
|
|
<view class="bot-row">
|
|
|
<text>快递: {{ goodsObjact.postage }}</text>
|
|
<text>快递: {{ goodsObjact.postage }}</text>
|
|
|
<text style="text-align: center;">销量: {{ goodsObjact.sales }}</text>
|
|
<text style="text-align: center;">销量: {{ goodsObjact.sales }}</text>
|
|
|
- <text style="text-align: right;">{{ storeObjact.address | address}}</text>
|
|
|
|
|
|
|
+ <text style="text-align: right;">{{ storeObjact.address | address }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 评价 -->
|
|
<!-- 评价 -->
|
|
@@ -163,7 +163,7 @@
|
|
|
<view class="a-t">
|
|
<view class="a-t">
|
|
|
<image :src="actionImage"></image>
|
|
<image :src="actionImage"></image>
|
|
|
<view class="right">
|
|
<view class="right">
|
|
|
- <view class="good-name clamp">{{goodsObjact.store_name}}</view>
|
|
|
|
|
|
|
+ <view class="good-name clamp">{{ goodsObjact.store_name }}</view>
|
|
|
<text class="price">¥{{ actionPrice }}</text>
|
|
<text class="price">¥{{ actionPrice }}</text>
|
|
|
<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
|
|
<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
|
|
|
<!-- <view class="selected" v-if="goodsType == 0">
|
|
<!-- <view class="selected" v-if="goodsType == 0">
|
|
@@ -192,7 +192,7 @@
|
|
|
<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
|
|
<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <button class="btn" @click.stop="buy">完成</button>
|
|
|
|
|
|
|
+ <button class="btn" @click.stop="buy">确定</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view :class="{ seckillBottom: goodsType == 1, goodsBottom: goodsType == 0 }"></view>
|
|
<view :class="{ seckillBottom: goodsType == 1, goodsBottom: goodsType == 0 }"></view>
|
|
@@ -207,8 +207,9 @@ import uniNumberBox from '@/components/uni-number-box.vue';
|
|
|
import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
|
|
import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
|
|
|
import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
|
|
import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
-import { weixindata } from '@/utils/wxAuthorized';
|
|
|
|
|
|
|
+import { weixindata,shareLoad } from '@/utils/wxAuthorized';
|
|
|
import { mapState } from 'vuex';
|
|
import { mapState } from 'vuex';
|
|
|
|
|
+import weixinObj from "@/plugin/jweixin-module/index.js";
|
|
|
// #endif
|
|
// #endif
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -217,11 +218,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
filters: {
|
|
filters: {
|
|
|
address(val) {
|
|
address(val) {
|
|
|
- let str = ''
|
|
|
|
|
- if(val) {
|
|
|
|
|
- str = val[0] + ' ' + val[1]
|
|
|
|
|
|
|
+ let str = '';
|
|
|
|
|
+ if (val) {
|
|
|
|
|
+ str = val[0] + ' ' + val[1];
|
|
|
}
|
|
}
|
|
|
- return str
|
|
|
|
|
|
|
+ return str;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -234,7 +235,7 @@ export default {
|
|
|
specClass: 'none', //显示隐藏弹窗
|
|
specClass: 'none', //显示隐藏弹窗
|
|
|
shareList: [], //分享列表
|
|
shareList: [], //分享列表
|
|
|
goodsObjact: {}, //保存商品数据
|
|
goodsObjact: {}, //保存商品数据
|
|
|
- storeObjact: {},//保存店铺数据
|
|
|
|
|
|
|
+ storeObjact: {}, //保存店铺数据
|
|
|
//图片循环
|
|
//图片循环
|
|
|
imgList: [],
|
|
imgList: [],
|
|
|
specList: [],
|
|
specList: [],
|
|
@@ -346,14 +347,14 @@ export default {
|
|
|
goodsDetail({}, this.goodsid).then(function({ data }) {
|
|
goodsDetail({}, this.goodsid).then(function({ data }) {
|
|
|
obj.details = data;
|
|
obj.details = data;
|
|
|
let goods = data.storeInfo;
|
|
let goods = data.storeInfo;
|
|
|
- let store_info = data.system_store// 保存店铺信息
|
|
|
|
|
- console.log(store_info)
|
|
|
|
|
- obj.storeObjact = store_info
|
|
|
|
|
|
|
+ let store_info = data.system_store; // 保存店铺信息
|
|
|
|
|
+ console.log(store_info);
|
|
|
|
|
+ obj.storeObjact = store_info;
|
|
|
obj.goodsObjact = goods;
|
|
obj.goodsObjact = goods;
|
|
|
obj.reply = data.reply; //保存评论列表
|
|
obj.reply = data.reply; //保存评论列表
|
|
|
obj.imgList = goods.slider_image; //保存轮播图
|
|
obj.imgList = goods.slider_image; //保存轮播图
|
|
|
obj.specList = data.productAttr; //保存分类列表
|
|
obj.specList = data.productAttr; //保存分类列表
|
|
|
- console.log(data.productAttr)
|
|
|
|
|
|
|
+ console.log(data.productAttr);
|
|
|
obj.productValue = data.productValue; //保存分类查询数据
|
|
obj.productValue = data.productValue; //保存分类查询数据
|
|
|
obj.actionPrice = goods.price; //保存默认选中商品价格
|
|
obj.actionPrice = goods.price; //保存默认选中商品价格
|
|
|
obj.actionImage = goods.image_base; //保存默认选中商品价格
|
|
obj.actionImage = goods.image_base; //保存默认选中商品价格
|
|
@@ -366,42 +367,41 @@ export default {
|
|
|
let attrValue = obj.specList[i].attr_value[0];
|
|
let attrValue = obj.specList[i].attr_value[0];
|
|
|
attrValue.check = true;
|
|
attrValue.check = true;
|
|
|
obj.specSelected.push(attrValue.attr);
|
|
obj.specSelected.push(attrValue.attr);
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//保存默认选中的对象字符串名称
|
|
//保存默认选中的对象字符串名称
|
|
|
let str = obj.specSelected.join(',');
|
|
let str = obj.specSelected.join(',');
|
|
|
// 设置默认值
|
|
// 设置默认值
|
|
|
obj.actionImage = obj.productValue[str].image;
|
|
obj.actionImage = obj.productValue[str].image;
|
|
|
obj.uniqueId = obj.productValue[str].unique;
|
|
obj.uniqueId = obj.productValue[str].unique;
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
- // obj.shareDate();
|
|
|
|
|
|
|
+ obj.shareDate();
|
|
|
// #endif
|
|
// #endif
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
// 加载微信html5页面分享方法
|
|
// 加载微信html5页面分享方法
|
|
|
- // shareDate() {
|
|
|
|
|
- // let obj = this;
|
|
|
|
|
- // // 保存分享人id链接
|
|
|
|
|
- // let url = window.location.href + '&spread=' + this.userInfo.uid;
|
|
|
|
|
- // // 判断是否微信浏览器
|
|
|
|
|
- // let bool = uni.getStorageSync('weichatBrowser') || '';
|
|
|
|
|
- // if (bool) {
|
|
|
|
|
- // // 过滤微信强制添加的链接地址
|
|
|
|
|
- // url = url.replace(/[\?,&]from=singlemessage/g, '');
|
|
|
|
|
- // let data = {
|
|
|
|
|
- // link: url, // 分享链接
|
|
|
|
|
- // imgUrl: obj.goodsObjact.image, // 分享图标
|
|
|
|
|
- // desc: obj.goodsObjact.store_info,
|
|
|
|
|
- // title: obj.goodsObjact.store_name,
|
|
|
|
|
- // success: function(e) {
|
|
|
|
|
- // console.log(e);
|
|
|
|
|
- // }
|
|
|
|
|
- // };
|
|
|
|
|
- // weixindata(data);
|
|
|
|
|
- // }
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ shareDate() {
|
|
|
|
|
+ let obj = this;
|
|
|
|
|
+ // 保存分享人id链接
|
|
|
|
|
+ let url = window.location.href + '&spread=' + this.userInfo.uid;
|
|
|
|
|
+ // 判断是否微信浏览器
|
|
|
|
|
+ let bool = uni.getStorageSync('weichatBrowser') || '';
|
|
|
|
|
+ if (bool) {
|
|
|
|
|
+ // 过滤微信强制添加的链接地址
|
|
|
|
|
+ url = url.replace(/[\?,&]from=singlemessage/g, '');
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ link: url, // 分享链接
|
|
|
|
|
+ imgUrl: obj.goodsObjact.image, // 分享图标
|
|
|
|
|
+ desc: obj.goodsObjact.store_info,
|
|
|
|
|
+ title: obj.goodsObjact.store_name,
|
|
|
|
|
+ success: function(e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ shareLoad(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// #endif
|
|
// #endif
|
|
|
// 购买数量变化
|
|
// 购买数量变化
|
|
|
numberChange(e) {
|
|
numberChange(e) {
|
|
@@ -470,7 +470,7 @@ export default {
|
|
|
cartNum: obj.goodsNumber, //商品数量
|
|
cartNum: obj.goodsNumber, //商品数量
|
|
|
uniqueId: obj.uniqueId, //商品标签
|
|
uniqueId: obj.uniqueId, //商品标签
|
|
|
new: '1', //商品是否新增加到购物车1为不加入0为加入
|
|
new: '1', //商品是否新增加到购物车1为不加入0为加入
|
|
|
- mer_id: obj.shopId,
|
|
|
|
|
|
|
+ mer_id: obj.shopId
|
|
|
// type: 0,//0为余额支付 1为消费券支付 2为积分支付
|
|
// type: 0,//0为余额支付 1为消费券支付 2为积分支付
|
|
|
};
|
|
};
|
|
|
if (obj.type == 2) {
|
|
if (obj.type == 2) {
|
|
@@ -916,7 +916,6 @@ page {
|
|
|
width: 170rpx;
|
|
width: 170rpx;
|
|
|
height: 170rpx;
|
|
height: 170rpx;
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
- margin-top: -40rpx;
|
|
|
|
|
border-radius: 8rpx;
|
|
border-radius: 8rpx;
|
|
|
}
|
|
}
|
|
|
.right {
|
|
.right {
|
|
@@ -932,7 +931,7 @@ page {
|
|
|
font-size: 30rpx;
|
|
font-size: 30rpx;
|
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
- color: #1D2023;
|
|
|
|
|
|
|
+ color: #1d2023;
|
|
|
line-height: 42rpx;
|
|
line-height: 42rpx;
|
|
|
margin-bottom: 15rpx;
|
|
margin-bottom: 15rpx;
|
|
|
}
|
|
}
|
|
@@ -940,7 +939,7 @@ page {
|
|
|
font-size: 60rpx;
|
|
font-size: 60rpx;
|
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
- color: #FF6F0F;
|
|
|
|
|
|
|
+ color: #ff6f0f;
|
|
|
// font-size: $font-lg;
|
|
// font-size: $font-lg;
|
|
|
// color: $uni-color-primary;
|
|
// color: $uni-color-primary;
|
|
|
// margin-bottom: 10rpx;
|
|
// margin-bottom: 10rpx;
|
|
@@ -1141,12 +1140,12 @@ page {
|
|
|
padding: 0;
|
|
padding: 0;
|
|
|
border-radius: 0;
|
|
border-radius: 0;
|
|
|
// background: transparent;
|
|
// background: transparent;
|
|
|
- background: #FFB238;
|
|
|
|
|
|
|
+ background: #ffb238;
|
|
|
&.buy-now-btn {
|
|
&.buy-now-btn {
|
|
|
- background-color: #FFB238;
|
|
|
|
|
|
|
+ background-color: #ffb238;
|
|
|
}
|
|
}
|
|
|
&.add-cart-btn {
|
|
&.add-cart-btn {
|
|
|
- background: linear-gradient(0deg, #2E58FF, #32C6FF);
|
|
|
|
|
|
|
+ background: linear-gradient(0deg, #2e58ff, #32c6ff);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|