作者 杜晓添

合并分支 'xide_duxiaotian' 到 'master'

Xide duxiaotian



查看合并请求 !189
... ... @@ -39,7 +39,7 @@
{
"path": "pages/my/myYouHuiJuan/myYouHuiJuan",
"style": {
"navigationBarTitleText": "我的优惠",
"navigationBarTitleText": "我的优惠",
"enablePullDownRefresh": false,
"navigationStyle":"custom"
}
... ...
<template>
<view class="goodsDetail" v-if="product_list.name">
<!-- 轮播图区域 -->
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :circular="true" indicator-active-color="#FFFFFF">
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :circular="true"
indicator-active-color="#FFFFFF">
<!-- 循环渲染轮播图的 item 项 -->
<swiper-item v-if="product_list.videofiles != null">
<!-- 视频 -->
<video :src="product_list.videofiles" object-fit="cover" enable-play-gesture class="swiperVideo"></video>
<video :src="product_list.videofiles" object-fit="cover" enable-play-gesture
class="swiperVideo"></video>
</swiper-item>
<swiper-item v-for="(item, i) in product_list.images" :key="i">
<image :src="item" @click="preview(i)"></image>
</swiper-item>
<swiper-item v-for="(item, i) in product_list.images" :key="i"><image :src="item" @click="preview(i)"></image></swiper-item>
</swiper>
<!-- 商品信息区域 -->
<view class="goods-info-box" v-if="product_list.spec[0]">
... ... @@ -63,7 +67,8 @@
<view class="middelTitle_En">Product details</view>
</view>
<!-- 视频 -->
<view class="videoBox" v-if="product_list.videofiles != null"><video :src="product_list.videofiles" object-fit="cover" enable-play-gesture @fullscreenchange></video></view>
<view class="videoBox" v-if="product_list.videofiles != null"><video :src="product_list.videofiles"
object-fit="cover" enable-play-gesture @fullscreenchange></video></view>
<rich-text :nodes="product_list.content"></rich-text>
<!-- 商品底部 -->
... ... @@ -91,13 +96,16 @@
<!-- 判断是否是多规格与单规格 -->
<view class="guigeJudge flex" v-if="spec_attr != 0">
<view class="kucunTFBox" v-if="goodDetail_guigeNum"><view class="shouqingBox">已售罄</view></view>
<view class="kucunTFBox" v-if="goodDetail_guigeNum">
<view class="shouqingBox">已售罄</view>
</view>
<view class="kucunTFBox flex" v-else>
<view class="buttonCart" @click="getCart">加入购物车</view>
<u-popup v-model="cartShow" mode="bottom" width="750rpx" height="976rpx">
<view class="goodDetailPopup" v-if="goodDetail_guigelist.form">
<view class="goodsinfo flex" v-if="goodDetail_guigelist.form.goods_price">
<image :src="goodDetail_guigelist.form.spec_image || product_list.image" class="goodsinfoImage"></image>
<image :src="goodDetail_guigelist.form.spec_image || product_list.image"
class="goodsinfoImage"></image>
<view class="goodsinfoMessage">
<!-- 判断是否有活动价格 -->
<view class="jiaqian" v-if="goodDetail_guigelist.form.goods_price == 0">
... ... @@ -126,26 +134,23 @@
<view class="bottomNum flex justifyBetween alignC" v-if="goodDetail_guigelist.form">
<view class="numText">数量</view>
<view class="numNum">
<u-number-box
disabled-input
:input-width="72"
:input-height="56"
v-model="value"
:min="1"
:max="goodDetail_guigelist.form.stock_num"
@change="valChange"
></u-number-box>
<u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
:min="1" :max="goodDetail_guigelist.form.stock_num" @change="valChange">
</u-number-box>
</view>
</view>
<view class="goods_bt" @click="addgoodsCart">确定</view>
<view class="icout" @click="closeCart"><image src="../../../static/goods/ic_out.png" mode=""></image></view>
<view class="icout" @click="closeCart">
<image src="../../../static/goods/ic_out.png" mode=""></image>
</view>
</view>
</u-popup>
<view class="buttonGoumai" @click="getGoumai">立即购买</view>
<u-popup v-model="cartShow" mode="bottom" width="750rpx" height="976rpx">
<view class="goodDetailPopup">
<view class="goodsinfo flex" v-if="goodDetail_guigelist.form">
<image :src="goodDetail_guigelist.form.spec_image || product_list.image" class="goodsinfoImage"></image>
<image :src="goodDetail_guigelist.form.spec_image || product_list.image"
class="goodsinfoImage"></image>
<view class="goodsinfoMessage">
<!-- 判断是否有活动价格 -->
<view class="jiaqian" v-if="goodDetail_guigelist.form.goods_price == 0">
... ... @@ -174,26 +179,25 @@
<view class="bottomNum flex justifyBetween alignC" v-if="goodDetail_guigelist.form">
<view class="numText">数量</view>
<view class="numNum">
<u-number-box
disabled-input
:input-width="72"
:input-height="56"
v-model="value"
:min="1"
:max="goodDetail_guigelist.form.stock_num"
@change="valChange"
></u-number-box>
<u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
:min="1" :max="goodDetail_guigelist.form.stock_num" @change="valChange">
</u-number-box>
</view>
</view>
<view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">{{ addCartText ? '确认' : '立即购买' }}</view>
<view class="icout" @click="closeGoumai"><image src="../../../static/goods/ic_out.png" mode=""></image></view>
<view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">
{{ addCartText ? '确认' : '立即购买' }}</view>
<view class="icout" @click="closeGoumai">
<image src="../../../static/goods/ic_out.png" mode=""></image>
</view>
</view>
</u-popup>
</view>
</view>
<!-- 单规格 -->
<view class="guigeJudge" v-else>
<view class="kucunTFBox" v-if="product_list.spec[0].stock_num == 0"><view class="shouqingBox">已售罄</view></view>
<view class="kucunTFBox" v-if="product_list.spec[0].stock_num == 0">
<view class="shouqingBox">已售罄</view>
</view>
<view class="kucunTFBox flex" v-else>
<view class="buttonCart" @click="getCart">加入购物车</view>
<u-popup v-model="cartShow" mode="bottom" width="750rpx" height="536rpx">
... ... @@ -224,19 +228,15 @@
<view class="bottomNum flex justifyBetween alignC" v-if="product_list.spec[0]">
<view class="numText">数量</view>
<view class="numNum">
<u-number-box
disabled-input
:input-width="72"
:input-height="56"
v-model="value"
:min="1"
:max="product_list.spec[0].stock_num"
@change="valChange"
></u-number-box>
<u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
:min="1" :max="product_list.spec[0].stock_num" @change="valChange">
</u-number-box>
</view>
</view>
<view class="goods_bt" @click="addgoodsCart">确定</view>
<view class="icout" @click="closeCart"><image src="../../../static/goods/ic_out.png" mode=""></image></view>
<view class="icout" @click="closeCart">
<image src="../../../static/goods/ic_out.png" mode=""></image>
</view>
</view>
</u-popup>
<view class="buttonGoumai" @click="getGoumai">立即购买</view>
... ... @@ -268,19 +268,16 @@
<view class="bottomNum flex justifyBetween alignC" v-if="product_list.spec[0]">
<view class="numText">数量</view>
<view class="numNum">
<u-number-box
disabled-input
:input-width="72"
:input-height="56"
v-model="value"
:min="1"
:max="product_list.spec[0].stock_num"
@change="valChange"
></u-number-box>
<u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
:min="1" :max="product_list.spec[0].stock_num" @change="valChange">
</u-number-box>
</view>
</view>
<view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">
{{ addCartText ? '确认' : '立即购买' }}</view>
<view class="icout" @click="closeCart">
<image src="../../../static/goods/ic_out.png" mode=""></image>
</view>
<view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">{{ addCartText ? '确认' : '立即购买' }}</view>
<view class="icout" @click="closeCart"><image src="../../../static/goods/ic_out.png" mode=""></image></view>
</view>
</u-popup>
</view>
... ... @@ -290,9 +287,9 @@
</template>
<script>
import Login from '../../../login';
import BroList from '@/components/Bro-List';
export default {
import Login from '../../../login';
import BroList from '@/components/Bro-List';
export default {
components: {
BroList
},
... ... @@ -340,8 +337,10 @@ export default {
};
this.$rqs('/api/goods/detail', data).then(res => {
// 对富文本解析
res.data.data.detail.content = res.data.data.detail.content.replace(/<img /gi, '<img style="width:100%;display:block;" mode="widthFix"');
res.data.data.detail.content = res.data.data.detail.content.replace(/<img style=""/gi, '<img style="width:100%;display:block;" mode="widthFix"');
res.data.data.detail.content = res.data.data.detail.content.replace(/<img /gi,
'<img style="width:100%;display:block;" mode="widthFix"');
res.data.data.detail.content = res.data.data.detail.content.replace(/<img style=""/gi,
'<img style="width:100%;display:block;" mode="widthFix"');
this.product_list = res.data.data.detail;
// 对多规格进行处理
if (res.data.data.specData) {
... ... @@ -496,6 +495,12 @@ export default {
this.cartShow = false;
} else {
if (goodDetail_guigelist != 0) {
if (goodDetail_guigelist.form.stock_num == 0) {
uni.showToast({
icon: 'error',
title: '库存不足'
});
} else {
// 多规格
let data = {
goods_id: product_list.id, //商品id
... ... @@ -509,6 +514,7 @@ export default {
uni.navigateTo({
url: '../../order/order?goodsInfo=' + encodeURIComponent(JSON.stringify(data))
});
}
} else {
// 单规格
let data = {
... ... @@ -549,27 +555,27 @@ export default {
}
}
}
};
};
</script>
<style>
/* //富文本视频 */
.videoBox {
/* //富文本视频 */
.videoBox {
width: 750rpx;
height: 370rpx;
}
}
.videoBox video {
.videoBox video {
width: 100%;
height: 100%;
}
}
.goodsDetail {
.goodsDetail {
padding-bottom: 100rpx;
}
}
/* 价钱样式 */
.activePrice {
/* 价钱样式 */
.activePrice {
height: 44rpx;
color: rgba(220, 158, 94, 1);
font-size: 48rpx;
... ... @@ -577,9 +583,9 @@ export default {
text-align: left;
line-height: 44rpx;
letter-spacing: 0.6rpx;
}
}
.dollorS {
.dollorS {
height: 32rpx;
color: rgba(220, 158, 94, 1);
font-size: 28rpx;
... ... @@ -587,9 +593,9 @@ export default {
font-family: 'PingFang SC';
text-align: center;
line-height: 32rpx;
}
}
.price {
.price {
height: 32rpx;
opacity: 1;
color: rgba(150, 151, 153, 1);
... ... @@ -597,35 +603,35 @@ export default {
font-weight: 500;
text-align: left;
line-height: 32rpx;
}
}
.td {
.td {
text-decoration: line-through;
}
}
swiper {
swiper {
height: 750rpx;
}
}
.swiperVideo {
.swiperVideo {
width: 750rpx;
height: 750rpx;
}
}
.swiper-item,
image {
.swiper-item,
image {
width: 100%;
height: 100%;
}
}
.goods-info-box {
.goods-info-box {
width: 750rpx;
height: 374rpx;
padding: 32rpx;
background-color: #ffffff;
}
}
.lingjuanText {
.lingjuanText {
height: 40rpx;
color: rgba(252, 67, 56, 1);
font-size: 26rpx;
... ... @@ -634,15 +640,15 @@ image {
text-align: center;
line-height: 40rpx;
letter-spacing: 0.6rpx;
}
}
.lingjuanCenter {
.lingjuanCenter {
margin-top: 4rpx;
width: 32rpx;
height: 32rpx;
}
}
.goods-name {
.goods-name {
width: 686rpx;
height: 52rpx;
margin-top: 26rpx;
... ... @@ -655,9 +661,9 @@ image {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.goods-detail {
.goods-detail {
width: 686rpx;
height: 72rpx;
margin-top: 4rpx;
... ... @@ -673,9 +679,9 @@ image {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.goods-model {
.goods-model {
margin-top: 16rpx;
height: 32rpx;
color: rgba(92, 92, 92, 1);
... ... @@ -684,13 +690,13 @@ image {
text-align: left;
line-height: 32rpx;
letter-spacing: 0.6rpx;
}
}
.salesShare {
.salesShare {
margin-top: 24rpx;
}
}
.sales {
.sales {
height: 32rpx;
color: rgba(194, 194, 194, 1);
font-size: 28rpx;
... ... @@ -698,36 +704,36 @@ image {
font-family: 'PingFang SC';
text-align: left;
line-height: 32rpx;
}
}
.share image {
.share image {
width: 32rpx;
margin-right: 8rpx;
}
}
.shareText {
.shareText {
height: 34rpx;
color: rgba(194, 194, 194, 1);
font-size: 24rpx;
font-weight: 400;
font-family: 'PingFang SC';
text-align: center;
}
}
.middelBox {
.middelBox {
width: 750rpx;
height: 132rpx;
padding: 40rpx 130rpx 0;
background-color: #ebebeb;
}
}
.uline {
.uline {
width: 149rpx;
height: 1rpx;
background-color: #c2c2c2;
}
}
.middelTitle {
.middelTitle {
height: 40rpx;
color: rgba(31, 31, 31, 1);
font-size: 28rpx;
... ... @@ -735,18 +741,18 @@ image {
text-align: center;
line-height: 40rpx;
letter-spacing: 0.6rpx;
}
}
.middelTitle_En {
.middelTitle_En {
margin-top: 8rpx;
color: rgba(31, 31, 31, 1);
font-size: 16rpx;
font-weight: 500;
text-align: center;
line-height: 20rpx;
}
}
.goods_nav {
.goods_nav {
background-color: #ffffff;
// 为商品导航组件添加固定定位
position: fixed;
... ... @@ -755,38 +761,38 @@ image {
width: 100%;
height: 120rpx;
padding: 20rpx;
}
}
.kefu {
.kefu {
margin-left: 26rpx;
}
}
.kefu image {
.kefu image {
width: 46rpx;
height: 46rpx;
margin-top: 3rpx;
}
}
.gouwuche {
.gouwuche {
margin-left: 48rpx;
transform: translateY(-2rpx);
}
}
.gouwuche image {
.gouwuche image {
width: 50rpx;
height: 56rpx;
}
}
.optionsText {
.optionsText {
margin-top: 4rpx;
height: 28rpx;
color: rgba(50, 50, 51, 1);
font-size: 20rpx;
font-weight: 500;
line-height: 28rpx;
}
}
.buttonCart {
.buttonCart {
width: 236rpx;
height: 80rpx;
margin-left: 30rpx;
... ... @@ -796,9 +802,9 @@ image {
font-weight: 700;
text-align: center;
line-height: 80rpx;
}
}
.buttonGoumai {
.buttonGoumai {
width: 236rpx;
height: 80rpx;
margin-left: 16rpx;
... ... @@ -808,26 +814,26 @@ image {
font-weight: 700;
text-align: center;
line-height: 80rpx;
}
}
.popup {
.popup {
padding: 48rpx 56rpx 0;
}
}
.popupText {
.popupText {
height: 44rpx;
color: rgba(50, 50, 51, 1);
font-size: 32rpx;
font-weight: 400;
text-align: center;
line-height: 44rpx;
}
}
.popupbutton {
.popupbutton {
margin-top: 70rpx;
}
}
.closeBox {
.closeBox {
width: 244rpx;
height: 80rpx;
border: 2rpx #dcdee0 solid;
... ... @@ -836,9 +842,9 @@ image {
font-weight: 400;
text-align: center;
line-height: 80rpx;
}
}
.openBox {
.openBox {
width: 244rpx;
height: 80rpx;
border: 2rpx #dcdee0 solid;
... ... @@ -848,42 +854,42 @@ image {
font-weight: 400;
text-align: center;
line-height: 80rpx;
}
}
.icout {
.icout {
position: absolute;
top: 32rpx;
right: 32rpx;
}
}
.icout image {
.icout image {
width: 48rpx;
height: 48rpx;
}
}
/* 商城详情弹窗*/
.goodDetailPopup {
/* 商城详情弹窗*/
.goodDetailPopup {
padding: 32rpx 16rpx 0;
position: relative;
}
}
.goodsinfo {
.goodsinfo {
padding: 0 16rpx;
box-sizing: border-box;
margin-bottom: 38rpx;
}
}
.goodsinfoImage {
.goodsinfoImage {
width: 200rpx;
height: 200rpx;
}
}
.goodsinfoMessage {
.goodsinfoMessage {
margin-left: 24rpx;
padding-top: 30rpx;
}
}
.kucunBox {
.kucunBox {
margin-top: 40rpx;
height: 32rpx;
color: rgba(194, 194, 194, 1);
... ... @@ -892,9 +898,9 @@ image {
font-family: 'PingFang SC';
text-align: left;
line-height: 32rpx;
}
}
.goods_bt {
.goods_bt {
position: fixed;
bottom: 20rpx;
width: 686rpx;
... ... @@ -906,37 +912,37 @@ image {
text-align: center;
line-height: 80rpx;
left: 32rpx;
}
}
.otherNorms {
.otherNorms {
height: 150rpx;
box-sizing: border-box;
}
}
.norderDetailBox {
.norderDetailBox {
margin-bottom: 34rpx;
flex-wrap: wrap;
margin-top: 16rpx;
}
}
.norderDetailBox:last-child {
.norderDetailBox:last-child {
margin-bottom: 0;
}
}
.norms {
.norms {
color: #5c5c5c;
padding-left: 16rpx;
box-sizing: border-box;
}
}
.bottomNum {
.bottomNum {
border-top: 2rpx solid #f2f3f5;
height: 144rpx;
padding: 0 16rpx;
box-sizing: border-box;
}
}
.normDetail {
.normDetail {
padding: 8rpx 32rpx;
box-sizing: border-box;
border-radius: 24rpx;
... ... @@ -945,9 +951,9 @@ image {
margin-bottom: 16rpx;
color: #5c5c5c;
font-size: 24rpx;
}
}
.normDetailActive {
.normDetailActive {
padding: 8rpx 32rpx;
box-sizing: border-box;
border-radius: 24rpx;
... ... @@ -957,22 +963,22 @@ image {
color: #3e554e;
font-size: 24rpx;
border: 2rpx solid #3e554e;
}
}
.numText {
.numText {
color: #5c5c5c;
}
}
.mumBox {
.mumBox {
width: 56rpx;
height: 56rpx;
background-color: #f2f3f5;
border-radius: 8rpx;
margin-left: 4rpx;
}
}
/* 已售完 */
.shouqingBox {
/* 已售完 */
.shouqingBox {
width: 488rpx;
height: 80rpx;
opacity: 1;
... ... @@ -983,5 +989,5 @@ image {
font-weight: 700;
text-align: center;
line-height: 80rpx;
}
}
</style>
... ...
... ... @@ -262,7 +262,7 @@
navToAddress() {
if (uni.getStorageSync("token")) {
uni.navigateTo({
url: "../order/selectAddress/addAddress"
url: "../order/selectAddress/selectAddress"
})
} else {
uni.showToast({
... ...
... ... @@ -96,7 +96,7 @@
//验证输入内容
isjiance(e) {
if(/^(?:[\u4e00-\u9fa5·]{2,16})$/.test(this.userName)){
if(/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(this.userID)){
if(/^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(this.userID)){
if(/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/.test(this.telPhone)){
let data = {
... ...
... ... @@ -190,6 +190,7 @@
}
},
onShow() {
this.address = '';
this.getAddress(); // 获取地址
},
methods: {
... ... @@ -426,12 +427,18 @@
// uni.navigateTo({
// url: route
// });
uni.navigateBack({
delta:1
})
},
cancel: function(r) {
// var route = 'payResult' + '?type=2'
// uni.navigateTo({
// url: route
// });
uni.navigateBack({
delta:1
})
},
fail: function(res) {
// console.log('payfail')
... ... @@ -507,12 +514,18 @@
// uni.navigateTo({
// url: route
// });
uni.navigateBack({
delta:1
})
},
cancel: function(r) {
// var route = 'payResult' + '?type=2'
// uni.navigateTo({
// url: route
// });
uni.navigateBack({
delta:1
})
},
fail: function(res) {
// console.log('payfail')
... ...