作者 3318410485

020906自测bug修复

@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 { 39 {
40 "path": "pages/my/myYouHuiJuan/myYouHuiJuan", 40 "path": "pages/my/myYouHuiJuan/myYouHuiJuan",
41 "style": { 41 "style": {
42 - "navigationBarTitleText": "我的优惠", 42 + "navigationBarTitleText": "我的优惠",
43 "enablePullDownRefresh": false, 43 "enablePullDownRefresh": false,
44 "navigationStyle":"custom" 44 "navigationStyle":"custom"
45 } 45 }
1 <template> 1 <template>
2 <view class="goodsDetail" v-if="product_list.name"> 2 <view class="goodsDetail" v-if="product_list.name">
3 <!-- 轮播图区域 --> 3 <!-- 轮播图区域 -->
4 - <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :circular="true" indicator-active-color="#FFFFFF"> 4 + <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :circular="true"
  5 + indicator-active-color="#FFFFFF">
5 <!-- 循环渲染轮播图的 item 项 --> 6 <!-- 循环渲染轮播图的 item 项 -->
6 <swiper-item v-if="product_list.videofiles != null"> 7 <swiper-item v-if="product_list.videofiles != null">
7 <!-- 视频 --> 8 <!-- 视频 -->
8 - <video :src="product_list.videofiles" object-fit="cover" enable-play-gesture class="swiperVideo"></video> 9 + <video :src="product_list.videofiles" object-fit="cover" enable-play-gesture
  10 + class="swiperVideo"></video>
  11 + </swiper-item>
  12 + <swiper-item v-for="(item, i) in product_list.images" :key="i">
  13 + <image :src="item" @click="preview(i)"></image>
9 </swiper-item> 14 </swiper-item>
10 - <swiper-item v-for="(item, i) in product_list.images" :key="i"><image :src="item" @click="preview(i)"></image></swiper-item>  
11 </swiper> 15 </swiper>
12 <!-- 商品信息区域 --> 16 <!-- 商品信息区域 -->
13 <view class="goods-info-box" v-if="product_list.spec[0]"> 17 <view class="goods-info-box" v-if="product_list.spec[0]">
@@ -63,7 +67,8 @@ @@ -63,7 +67,8 @@
63 <view class="middelTitle_En">Product details</view> 67 <view class="middelTitle_En">Product details</view>
64 </view> 68 </view>
65 <!-- 视频 --> 69 <!-- 视频 -->
66 - <view class="videoBox" v-if="product_list.videofiles != null"><video :src="product_list.videofiles" object-fit="cover" enable-play-gesture @fullscreenchange></video></view> 70 + <view class="videoBox" v-if="product_list.videofiles != null"><video :src="product_list.videofiles"
  71 + object-fit="cover" enable-play-gesture @fullscreenchange></video></view>
67 <rich-text :nodes="product_list.content"></rich-text> 72 <rich-text :nodes="product_list.content"></rich-text>
68 73
69 <!-- 商品底部 --> 74 <!-- 商品底部 -->
@@ -91,13 +96,16 @@ @@ -91,13 +96,16 @@
91 96
92 <!-- 判断是否是多规格与单规格 --> 97 <!-- 判断是否是多规格与单规格 -->
93 <view class="guigeJudge flex" v-if="spec_attr != 0"> 98 <view class="guigeJudge flex" v-if="spec_attr != 0">
94 - <view class="kucunTFBox" v-if="goodDetail_guigeNum"><view class="shouqingBox">已售罄</view></view> 99 + <view class="kucunTFBox" v-if="goodDetail_guigeNum">
  100 + <view class="shouqingBox">已售罄</view>
  101 + </view>
95 <view class="kucunTFBox flex" v-else> 102 <view class="kucunTFBox flex" v-else>
96 <view class="buttonCart" @click="getCart">加入购物车</view> 103 <view class="buttonCart" @click="getCart">加入购物车</view>
97 <u-popup v-model="cartShow" mode="bottom" width="750rpx" height="976rpx"> 104 <u-popup v-model="cartShow" mode="bottom" width="750rpx" height="976rpx">
98 <view class="goodDetailPopup" v-if="goodDetail_guigelist.form"> 105 <view class="goodDetailPopup" v-if="goodDetail_guigelist.form">
99 <view class="goodsinfo flex" v-if="goodDetail_guigelist.form.goods_price"> 106 <view class="goodsinfo flex" v-if="goodDetail_guigelist.form.goods_price">
100 - <image :src="goodDetail_guigelist.form.spec_image || product_list.image" class="goodsinfoImage"></image> 107 + <image :src="goodDetail_guigelist.form.spec_image || product_list.image"
  108 + class="goodsinfoImage"></image>
101 <view class="goodsinfoMessage"> 109 <view class="goodsinfoMessage">
102 <!-- 判断是否有活动价格 --> 110 <!-- 判断是否有活动价格 -->
103 <view class="jiaqian" v-if="goodDetail_guigelist.form.goods_price == 0"> 111 <view class="jiaqian" v-if="goodDetail_guigelist.form.goods_price == 0">
@@ -126,26 +134,23 @@ @@ -126,26 +134,23 @@
126 <view class="bottomNum flex justifyBetween alignC" v-if="goodDetail_guigelist.form"> 134 <view class="bottomNum flex justifyBetween alignC" v-if="goodDetail_guigelist.form">
127 <view class="numText">数量</view> 135 <view class="numText">数量</view>
128 <view class="numNum"> 136 <view class="numNum">
129 - <u-number-box  
130 - disabled-input  
131 - :input-width="72"  
132 - :input-height="56"  
133 - v-model="value"  
134 - :min="1"  
135 - :max="goodDetail_guigelist.form.stock_num"  
136 - @change="valChange"  
137 - ></u-number-box> 137 + <u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
  138 + :min="1" :max="goodDetail_guigelist.form.stock_num" @change="valChange">
  139 + </u-number-box>
138 </view> 140 </view>
139 </view> 141 </view>
140 <view class="goods_bt" @click="addgoodsCart">确定</view> 142 <view class="goods_bt" @click="addgoodsCart">确定</view>
141 - <view class="icout" @click="closeCart"><image src="../../../static/goods/ic_out.png" mode=""></image></view> 143 + <view class="icout" @click="closeCart">
  144 + <image src="../../../static/goods/ic_out.png" mode=""></image>
  145 + </view>
142 </view> 146 </view>
143 </u-popup> 147 </u-popup>
144 <view class="buttonGoumai" @click="getGoumai">立即购买</view> 148 <view class="buttonGoumai" @click="getGoumai">立即购买</view>
145 <u-popup v-model="cartShow" mode="bottom" width="750rpx" height="976rpx"> 149 <u-popup v-model="cartShow" mode="bottom" width="750rpx" height="976rpx">
146 <view class="goodDetailPopup"> 150 <view class="goodDetailPopup">
147 <view class="goodsinfo flex" v-if="goodDetail_guigelist.form"> 151 <view class="goodsinfo flex" v-if="goodDetail_guigelist.form">
148 - <image :src="goodDetail_guigelist.form.spec_image || product_list.image" class="goodsinfoImage"></image> 152 + <image :src="goodDetail_guigelist.form.spec_image || product_list.image"
  153 + class="goodsinfoImage"></image>
149 <view class="goodsinfoMessage"> 154 <view class="goodsinfoMessage">
150 <!-- 判断是否有活动价格 --> 155 <!-- 判断是否有活动价格 -->
151 <view class="jiaqian" v-if="goodDetail_guigelist.form.goods_price == 0"> 156 <view class="jiaqian" v-if="goodDetail_guigelist.form.goods_price == 0">
@@ -174,26 +179,25 @@ @@ -174,26 +179,25 @@
174 <view class="bottomNum flex justifyBetween alignC" v-if="goodDetail_guigelist.form"> 179 <view class="bottomNum flex justifyBetween alignC" v-if="goodDetail_guigelist.form">
175 <view class="numText">数量</view> 180 <view class="numText">数量</view>
176 <view class="numNum"> 181 <view class="numNum">
177 - <u-number-box  
178 - disabled-input  
179 - :input-width="72"  
180 - :input-height="56"  
181 - v-model="value"  
182 - :min="1"  
183 - :max="goodDetail_guigelist.form.stock_num"  
184 - @change="valChange"  
185 - ></u-number-box> 182 + <u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
  183 + :min="1" :max="goodDetail_guigelist.form.stock_num" @change="valChange">
  184 + </u-number-box>
186 </view> 185 </view>
187 </view> 186 </view>
188 - <view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">{{ addCartText ? '确认' : '立即购买' }}</view>  
189 - <view class="icout" @click="closeGoumai"><image src="../../../static/goods/ic_out.png" mode=""></image></view> 187 + <view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">
  188 + {{ addCartText ? '确认' : '立即购买' }}</view>
  189 + <view class="icout" @click="closeGoumai">
  190 + <image src="../../../static/goods/ic_out.png" mode=""></image>
  191 + </view>
190 </view> 192 </view>
191 </u-popup> 193 </u-popup>
192 </view> 194 </view>
193 </view> 195 </view>
194 <!-- 单规格 --> 196 <!-- 单规格 -->
195 <view class="guigeJudge" v-else> 197 <view class="guigeJudge" v-else>
196 - <view class="kucunTFBox" v-if="product_list.spec[0].stock_num == 0"><view class="shouqingBox">已售罄</view></view> 198 + <view class="kucunTFBox" v-if="product_list.spec[0].stock_num == 0">
  199 + <view class="shouqingBox">已售罄</view>
  200 + </view>
197 <view class="kucunTFBox flex" v-else> 201 <view class="kucunTFBox flex" v-else>
198 <view class="buttonCart" @click="getCart">加入购物车</view> 202 <view class="buttonCart" @click="getCart">加入购物车</view>
199 <u-popup v-model="cartShow" mode="bottom" width="750rpx" height="536rpx"> 203 <u-popup v-model="cartShow" mode="bottom" width="750rpx" height="536rpx">
@@ -224,19 +228,15 @@ @@ -224,19 +228,15 @@
224 <view class="bottomNum flex justifyBetween alignC" v-if="product_list.spec[0]"> 228 <view class="bottomNum flex justifyBetween alignC" v-if="product_list.spec[0]">
225 <view class="numText">数量</view> 229 <view class="numText">数量</view>
226 <view class="numNum"> 230 <view class="numNum">
227 - <u-number-box  
228 - disabled-input  
229 - :input-width="72"  
230 - :input-height="56"  
231 - v-model="value"  
232 - :min="1"  
233 - :max="product_list.spec[0].stock_num"  
234 - @change="valChange"  
235 - ></u-number-box> 231 + <u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
  232 + :min="1" :max="product_list.spec[0].stock_num" @change="valChange">
  233 + </u-number-box>
236 </view> 234 </view>
237 </view> 235 </view>
238 <view class="goods_bt" @click="addgoodsCart">确定</view> 236 <view class="goods_bt" @click="addgoodsCart">确定</view>
239 - <view class="icout" @click="closeCart"><image src="../../../static/goods/ic_out.png" mode=""></image></view> 237 + <view class="icout" @click="closeCart">
  238 + <image src="../../../static/goods/ic_out.png" mode=""></image>
  239 + </view>
240 </view> 240 </view>
241 </u-popup> 241 </u-popup>
242 <view class="buttonGoumai" @click="getGoumai">立即购买</view> 242 <view class="buttonGoumai" @click="getGoumai">立即购买</view>
@@ -268,19 +268,16 @@ @@ -268,19 +268,16 @@
268 <view class="bottomNum flex justifyBetween alignC" v-if="product_list.spec[0]"> 268 <view class="bottomNum flex justifyBetween alignC" v-if="product_list.spec[0]">
269 <view class="numText">数量</view> 269 <view class="numText">数量</view>
270 <view class="numNum"> 270 <view class="numNum">
271 - <u-number-box  
272 - disabled-input  
273 - :input-width="72"  
274 - :input-height="56"  
275 - v-model="value"  
276 - :min="1"  
277 - :max="product_list.spec[0].stock_num"  
278 - @change="valChange"  
279 - ></u-number-box> 271 + <u-number-box disabled-input :input-width="72" :input-height="56" v-model="value"
  272 + :min="1" :max="product_list.spec[0].stock_num" @change="valChange">
  273 + </u-number-box>
280 </view> 274 </view>
281 </view> 275 </view>
282 - <view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">{{ addCartText ? '确认' : '立即购买' }}</view>  
283 - <view class="icout" @click="closeCart"><image src="../../../static/goods/ic_out.png" mode=""></image></view> 276 + <view class="goods_bt" @click="gmGoods(product_list, goodDetail_guigelist)">
  277 + {{ addCartText ? '确认' : '立即购买' }}</view>
  278 + <view class="icout" @click="closeCart">
  279 + <image src="../../../static/goods/ic_out.png" mode=""></image>
  280 + </view>
284 </view> 281 </view>
285 </u-popup> 282 </u-popup>
286 </view> 283 </view>
@@ -290,183 +287,203 @@ @@ -290,183 +287,203 @@
290 </template> 287 </template>
291 288
292 <script> 289 <script>
293 -import Login from '../../../login';  
294 -import BroList from '@/components/Bro-List';  
295 -export default {  
296 - components: {  
297 - BroList  
298 - },  
299 - data() {  
300 - return {  
301 - token: '',  
302 - // 规格  
303 - spec_attr: [],  
304 - spec_list: [],  
305 - // 规格组成的新数组  
306 - guileList: [],  
307 -  
308 - show: false,  
309 - cartShow: false,  
310 - phone: '',  
311 - product_list: {},  
312 - //步进器  
313 - value: 1,  
314 - // 商品数量  
315 - goodDetailsNum: 1,  
316 - // new 规格函数  
317 - goodDetail_guigelist: [],  
318 - //多规格的所有库存  
319 - goodDetail_guigeNum: false,  
320 - //控制字体  
321 - addCartText: false  
322 - };  
323 - },  
324 - onShow() {  
325 - // 是否截取到code  
326 - this.$loginCustom();  
327 - },  
328 - onLoad(e) {  
329 - this.getPhone();  
330 - this.getGoodDetails(e.id);  
331 -  
332 - console.log(e.uid, 'uid');  
333 - uni.setStorageSync('uId', e.uid);  
334 - },  
335 - methods: {  
336 - // 商品详情接口  
337 - getGoodDetails(id) {  
338 - let data = {  
339 - id: id 290 + import Login from '../../../login';
  291 + import BroList from '@/components/Bro-List';
  292 + export default {
  293 + components: {
  294 + BroList
  295 + },
  296 + data() {
  297 + return {
  298 + token: '',
  299 + // 规格
  300 + spec_attr: [],
  301 + spec_list: [],
  302 + // 规格组成的新数组
  303 + guileList: [],
  304 +
  305 + show: false,
  306 + cartShow: false,
  307 + phone: '',
  308 + product_list: {},
  309 + //步进器
  310 + value: 1,
  311 + // 商品数量
  312 + goodDetailsNum: 1,
  313 + // new 规格函数
  314 + goodDetail_guigelist: [],
  315 + //多规格的所有库存
  316 + goodDetail_guigeNum: false,
  317 + //控制字体
  318 + addCartText: false
340 }; 319 };
341 - this.$rqs('/api/goods/detail', data).then(res => {  
342 - // 对富文本解析  
343 - res.data.data.detail.content = res.data.data.detail.content.replace(/<img /gi, '<img style="width:100%;display:block;" mode="widthFix"');  
344 - res.data.data.detail.content = res.data.data.detail.content.replace(/<img style=""/gi, '<img style="width:100%;display:block;" mode="widthFix"');  
345 - this.product_list = res.data.data.detail;  
346 - // 对多规格进行处理  
347 - if (res.data.data.specData) {  
348 - // 规格  
349 - this.spec_attr = res.data.data.specData.spec_attr;  
350 - //规格商品详情  
351 - this.spec_list = res.data.data.specData.spec_list;  
352 - // 规格默认值  
353 - this.spec_attr.map(item => {  
354 - this.guileList.push(item.spec_items[0].item_id);  
355 - });  
356 - var i = this.spec_list.findIndex(x => x.spec_sku_id == this.guileList.join('_'));  
357 - this.goodDetail_guigelist = this.spec_list[i];  
358 - this.goodDetail_guigeNum = this.spec_list.every(function(item, index, array) {  
359 - return item.form.stock_num == 0;  
360 - });  
361 - }  
362 - });  
363 }, 320 },
364 - //步进器  
365 - valChange(e) {  
366 - console.log('当前值为: ' + e.value);  
367 - this.goodDetailsNum = e.value; 321 + onShow() {
  322 + // 是否截取到code
  323 + this.$loginCustom();
368 }, 324 },
369 - // 图片变大  
370 - preview(i) {  
371 - // 调用 uni.previewImage() 方法预览图片  
372 - uni.previewImage({  
373 - // 预览时,默认显示图.item.image_src  
374 - current: i,  
375 - // 所有图片 url 地址的数组  
376 - urls: this.product_list.images  
377 - }); 325 + onLoad(e) {
  326 + this.getPhone();
  327 + this.getGoodDetails(e.id);
  328 +
  329 + console.log(e.uid, 'uid');
  330 + uni.setStorageSync('uId', e.uid);
378 }, 331 },
379 - // 领劵  
380 - getlingjuanCenter() {  
381 - if (!uni.getStorageSync('token')) {  
382 - this.$loginCustom(1);  
383 - } else {  
384 - uni.navigateTo({  
385 - url: '../../my/myYouHuiJuan/yuhuijuanCenter' 332 + methods: {
  333 + // 商品详情接口
  334 + getGoodDetails(id) {
  335 + let data = {
  336 + id: id
  337 + };
  338 + this.$rqs('/api/goods/detail', data).then(res => {
  339 + // 对富文本解析
  340 + res.data.data.detail.content = res.data.data.detail.content.replace(/<img /gi,
  341 + '<img style="width:100%;display:block;" mode="widthFix"');
  342 + res.data.data.detail.content = res.data.data.detail.content.replace(/<img style=""/gi,
  343 + '<img style="width:100%;display:block;" mode="widthFix"');
  344 + this.product_list = res.data.data.detail;
  345 + // 对多规格进行处理
  346 + if (res.data.data.specData) {
  347 + // 规格
  348 + this.spec_attr = res.data.data.specData.spec_attr;
  349 + //规格商品详情
  350 + this.spec_list = res.data.data.specData.spec_list;
  351 + // 规格默认值
  352 + this.spec_attr.map(item => {
  353 + this.guileList.push(item.spec_items[0].item_id);
  354 + });
  355 + var i = this.spec_list.findIndex(x => x.spec_sku_id == this.guileList.join('_'));
  356 + this.goodDetail_guigelist = this.spec_list[i];
  357 + this.goodDetail_guigeNum = this.spec_list.every(function(item, index, array) {
  358 + return item.form.stock_num == 0;
  359 + });
  360 + }
386 }); 361 });
387 - }  
388 - },  
389 - //分享  
390 - getShare(id) {  
391 - if (!uni.getStorageSync('token')) {  
392 - this.$loginCustom(1);  
393 - } else {  
394 - uni.navigateTo({  
395 - url: 'share?id=' + id 362 + },
  363 + //步进器
  364 + valChange(e) {
  365 + console.log('当前值为: ' + e.value);
  366 + this.goodDetailsNum = e.value;
  367 + },
  368 + // 图片变大
  369 + preview(i) {
  370 + // 调用 uni.previewImage() 方法预览图片
  371 + uni.previewImage({
  372 + // 预览时,默认显示图.item.image_src
  373 + current: i,
  374 + // 所有图片 url 地址的数组
  375 + urls: this.product_list.images
396 }); 376 });
397 - }  
398 - },  
399 - // 联系客服  
400 - openkefu() {  
401 - if (!uni.getStorageSync('token')) {  
402 - this.$loginCustom(1);  
403 - } else {  
404 - this.show = !this.show;  
405 - }  
406 - },  
407 - close() {  
408 - this.show = false;  
409 - },  
410 - getPhone() {  
411 - this.$rqs('/api/index/basic').then(res => {  
412 - this.phone = res.data.data;  
413 - });  
414 - },  
415 - open(phone) {  
416 - let that = this;  
417 - uni.makePhoneCall({  
418 - phoneNumber: phone,  
419 - success() {  
420 - that.show = false; 377 + },
  378 + // 领劵
  379 + getlingjuanCenter() {
  380 + if (!uni.getStorageSync('token')) {
  381 + this.$loginCustom(1);
  382 + } else {
  383 + uni.navigateTo({
  384 + url: '../../my/myYouHuiJuan/yuhuijuanCenter'
  385 + });
421 } 386 }
422 - });  
423 - },  
424 - // 跳转购物车  
425 - gotoCart() {  
426 - uni.switchTab({  
427 - url: '../../cart/cart'  
428 - });  
429 - },  
430 - // 加入购物车  
431 - getCart() {  
432 - this.cartShow = !this.cartShow;  
433 - this.addCartText = true;  
434 - },  
435 - // 关闭  
436 - closeCart() {  
437 - this.cartShow = false;  
438 - },  
439 - // 立即购买  
440 - getGoumai() {  
441 - this.cartShow = !this.cartShow;  
442 - },  
443 - //关闭  
444 - closeGoumai() {  
445 - this.cartShow = false;  
446 - },  
447 - //立即购买  
448 - gmGoods(product_list, goodDetail_guigelist) {  
449 - if (!uni.getStorageSync('token')) {  
450 - this.$loginCustom(1);  
451 - } else {  
452 - if (this.addCartText) {  
453 - // 多规格  
454 - if (goodDetail_guigelist != 0) {  
455 - // 判断库存  
456 - if (goodDetail_guigelist.form.stock_num == 0) {  
457 - uni.showToast({  
458 - icon: 'error',  
459 - title: '库存不足'  
460 - }); 387 + },
  388 + //分享
  389 + getShare(id) {
  390 + if (!uni.getStorageSync('token')) {
  391 + this.$loginCustom(1);
  392 + } else {
  393 + uni.navigateTo({
  394 + url: 'share?id=' + id
  395 + });
  396 + }
  397 + },
  398 + // 联系客服
  399 + openkefu() {
  400 + if (!uni.getStorageSync('token')) {
  401 + this.$loginCustom(1);
  402 + } else {
  403 + this.show = !this.show;
  404 + }
  405 + },
  406 + close() {
  407 + this.show = false;
  408 + },
  409 + getPhone() {
  410 + this.$rqs('/api/index/basic').then(res => {
  411 + this.phone = res.data.data;
  412 + });
  413 + },
  414 + open(phone) {
  415 + let that = this;
  416 + uni.makePhoneCall({
  417 + phoneNumber: phone,
  418 + success() {
  419 + that.show = false;
  420 + }
  421 + });
  422 + },
  423 + // 跳转购物车
  424 + gotoCart() {
  425 + uni.switchTab({
  426 + url: '../../cart/cart'
  427 + });
  428 + },
  429 + // 加入购物车
  430 + getCart() {
  431 + this.cartShow = !this.cartShow;
  432 + this.addCartText = true;
  433 + },
  434 + // 关闭
  435 + closeCart() {
  436 + this.cartShow = false;
  437 + },
  438 + // 立即购买
  439 + getGoumai() {
  440 + this.cartShow = !this.cartShow;
  441 + },
  442 + //关闭
  443 + closeGoumai() {
  444 + this.cartShow = false;
  445 + },
  446 + //立即购买
  447 + gmGoods(product_list, goodDetail_guigelist) {
  448 + if (!uni.getStorageSync('token')) {
  449 + this.$loginCustom(1);
  450 + } else {
  451 + if (this.addCartText) {
  452 + // 多规格
  453 + if (goodDetail_guigelist != 0) {
  454 + // 判断库存
  455 + if (goodDetail_guigelist.form.stock_num == 0) {
  456 + uni.showToast({
  457 + icon: 'error',
  458 + title: '库存不足'
  459 + });
  460 + } else {
  461 + let data = {
  462 + goods_id: product_list.id, //商品id
  463 + num: this.goodDetailsNum, //数量
  464 + name: product_list.name, //商品名称
  465 + image: goodDetail_guigelist.form.spec_image || product_list.image,
  466 + spec_id: goodDetail_guigelist.spec_sku_id,
  467 + goods_price: goodDetail_guigelist.form.goods_price,
  468 + goods_spec_id: goodDetail_guigelist.goods_spec_id
  469 + };
  470 + this.$rqs('/api/cart/add', data).then(res => {
  471 + console.log(res.data.msg);
  472 + });
  473 + uni.showToast({
  474 + title: '添加购物车成功'
  475 + });
  476 + }
461 } else { 477 } else {
  478 + // 单规格
462 let data = { 479 let data = {
463 goods_id: product_list.id, //商品id 480 goods_id: product_list.id, //商品id
464 num: this.goodDetailsNum, //数量 481 num: this.goodDetailsNum, //数量
465 name: product_list.name, //商品名称 482 name: product_list.name, //商品名称
466 - image: goodDetail_guigelist.form.spec_image || product_list.image,  
467 - spec_id: goodDetail_guigelist.spec_sku_id,  
468 - goods_price: goodDetail_guigelist.form.goods_price,  
469 - goods_spec_id: goodDetail_guigelist.goods_spec_id 483 + image: product_list.image,
  484 + goods_price: product_list.spec[0].goods_price,
  485 + goods_spec_id: product_list.spec[0].goods_spec_id,
  486 + spec_id: product_list.spec[0].spec_sku_id || 0
470 }; 487 };
471 this.$rqs('/api/cart/add', data).then(res => { 488 this.$rqs('/api/cart/add', data).then(res => {
472 console.log(res.data.msg); 489 console.log(res.data.msg);
@@ -475,513 +492,502 @@ export default { @@ -475,513 +492,502 @@ export default {
475 title: '添加购物车成功' 492 title: '添加购物车成功'
476 }); 493 });
477 } 494 }
  495 + this.cartShow = false;
478 } else { 496 } else {
479 - // 单规格  
480 - let data = {  
481 - goods_id: product_list.id, //商品id  
482 - num: this.goodDetailsNum, //数量  
483 - name: product_list.name, //商品名称  
484 - image: product_list.image,  
485 - goods_price: product_list.spec[0].goods_price,  
486 - goods_spec_id: product_list.spec[0].goods_spec_id,  
487 - spec_id: product_list.spec[0].spec_sku_id || 0  
488 - };  
489 - this.$rqs('/api/cart/add', data).then(res => {  
490 - console.log(res.data.msg);  
491 - });  
492 - uni.showToast({  
493 - title: '添加购物车成功'  
494 - });  
495 - }  
496 - this.cartShow = false;  
497 - } else {  
498 - if (goodDetail_guigelist != 0) {  
499 - // 多规格  
500 - let data = {  
501 - goods_id: product_list.id, //商品id  
502 - num: this.goodDetailsNum, //数量  
503 - name: product_list.name, //商品名称  
504 - image: goodDetail_guigelist.form.spec_image || product_list.image,  
505 - spec_id: goodDetail_guigelist.spec_sku_id,  
506 - goods_price: goodDetail_guigelist.form.goods_price,  
507 - goods_spec_id: goodDetail_guigelist.goods_spec_id  
508 - };  
509 - uni.navigateTo({  
510 - url: '../../order/order?goodsInfo=' + encodeURIComponent(JSON.stringify(data))  
511 - });  
512 - } else {  
513 - // 单规格  
514 - let data = {  
515 - goods_id: product_list.id, //商品id  
516 - num: this.goodDetailsNum, //数量  
517 - name: product_list.name, //商品名称  
518 - image: product_list.image,  
519 - goods_price: product_list.spec[0].goods_price,  
520 - goods_spec_id: product_list.spec[0].goods_spec_id,  
521 - spec_id: product_list.spec[0].spec_sku_id || 0  
522 - };  
523 - uni.navigateTo({  
524 - url: '../../order/order?goodsInfo=' + encodeURIComponent(JSON.stringify(data))  
525 - }); 497 + if (goodDetail_guigelist != 0) {
  498 + if (goodDetail_guigelist.form.stock_num == 0) {
  499 + uni.showToast({
  500 + icon: 'error',
  501 + title: '库存不足'
  502 + });
  503 + } else {
  504 + // 多规格
  505 + let data = {
  506 + goods_id: product_list.id, //商品id
  507 + num: this.goodDetailsNum, //数量
  508 + name: product_list.name, //商品名称
  509 + image: goodDetail_guigelist.form.spec_image || product_list.image,
  510 + spec_id: goodDetail_guigelist.spec_sku_id,
  511 + goods_price: goodDetail_guigelist.form.goods_price,
  512 + goods_spec_id: goodDetail_guigelist.goods_spec_id
  513 + };
  514 + uni.navigateTo({
  515 + url: '../../order/order?goodsInfo=' + encodeURIComponent(JSON.stringify(data))
  516 + });
  517 + }
  518 + } else {
  519 + // 单规格
  520 + let data = {
  521 + goods_id: product_list.id, //商品id
  522 + num: this.goodDetailsNum, //数量
  523 + name: product_list.name, //商品名称
  524 + image: product_list.image,
  525 + goods_price: product_list.spec[0].goods_price,
  526 + goods_spec_id: product_list.spec[0].goods_spec_id,
  527 + spec_id: product_list.spec[0].spec_sku_id || 0
  528 + };
  529 + uni.navigateTo({
  530 + url: '../../order/order?goodsInfo=' + encodeURIComponent(JSON.stringify(data))
  531 + });
  532 + }
526 } 533 }
527 } 534 }
528 - } 535 + },
  536 + /**
  537 + * @规格点击事件
  538 + * */
  539 + ItemList(id, index) {
  540 + this.guileList[index] = id;
  541 + var i = this.spec_list.findIndex(x => x.spec_sku_id == this.guileList.join('_'));
  542 + // console.log(i,'adsas');
  543 + this.goodDetail_guigelist = this.spec_list[i];
  544 + }
529 }, 545 },
530 - /**  
531 - * @规格点击事件  
532 - * */  
533 - ItemList(id, index) {  
534 - this.guileList[index] = id;  
535 - var i = this.spec_list.findIndex(x => x.spec_sku_id == this.guileList.join('_'));  
536 - // console.log(i,'adsas');  
537 - this.goodDetail_guigelist = this.spec_list[i];  
538 - }  
539 - },  
540 - watch: {  
541 - // 监听规格弹出框 是不弹出  
542 - cartShow: {  
543 - handler(newVal, oldVal) {  
544 - if (!newVal) {  
545 - setTimeout(() => {  
546 - this.addCartText = false;  
547 - }, 300); 546 + watch: {
  547 + // 监听规格弹出框 是不弹出
  548 + cartShow: {
  549 + handler(newVal, oldVal) {
  550 + if (!newVal) {
  551 + setTimeout(() => {
  552 + this.addCartText = false;
  553 + }, 300);
  554 + }
548 } 555 }
549 } 556 }
550 } 557 }
551 - }  
552 -}; 558 + };
553 </script> 559 </script>
554 560
555 <style> 561 <style>
556 -/* //富文本视频 */  
557 -.videoBox {  
558 - width: 750rpx;  
559 - height: 370rpx;  
560 -}  
561 -  
562 -.videoBox video {  
563 - width: 100%;  
564 - height: 100%;  
565 -}  
566 -  
567 -.goodsDetail {  
568 - padding-bottom: 100rpx;  
569 -}  
570 -  
571 -/* 价钱样式 */  
572 -.activePrice {  
573 - height: 44rpx;  
574 - color: rgba(220, 158, 94, 1);  
575 - font-size: 48rpx;  
576 - font-weight: 700;  
577 - text-align: left;  
578 - line-height: 44rpx;  
579 - letter-spacing: 0.6rpx;  
580 -}  
581 -  
582 -.dollorS {  
583 - height: 32rpx;  
584 - color: rgba(220, 158, 94, 1);  
585 - font-size: 28rpx;  
586 - font-weight: 500;  
587 - font-family: 'PingFang SC';  
588 - text-align: center;  
589 - line-height: 32rpx;  
590 -}  
591 -  
592 -.price {  
593 - height: 32rpx;  
594 - opacity: 1;  
595 - color: rgba(150, 151, 153, 1);  
596 - font-size: 24rpx;  
597 - font-weight: 500;  
598 - text-align: left;  
599 - line-height: 32rpx;  
600 -}  
601 -  
602 -.td {  
603 - text-decoration: line-through;  
604 -}  
605 -  
606 -swiper {  
607 - height: 750rpx;  
608 -}  
609 -  
610 -.swiperVideo {  
611 - width: 750rpx;  
612 - height: 750rpx;  
613 -}  
614 -  
615 -.swiper-item,  
616 -image {  
617 - width: 100%;  
618 - height: 100%;  
619 -}  
620 -  
621 -.goods-info-box {  
622 - width: 750rpx;  
623 - height: 374rpx;  
624 - padding: 32rpx;  
625 - background-color: #ffffff;  
626 -}  
627 -  
628 -.lingjuanText {  
629 - height: 40rpx;  
630 - color: rgba(252, 67, 56, 1);  
631 - font-size: 26rpx;  
632 - font-weight: 500;  
633 - font-family: 'PingFang SC';  
634 - text-align: center;  
635 - line-height: 40rpx;  
636 - letter-spacing: 0.6rpx;  
637 -}  
638 -  
639 -.lingjuanCenter {  
640 - margin-top: 4rpx;  
641 - width: 32rpx;  
642 - height: 32rpx;  
643 -}  
644 -  
645 -.goods-name {  
646 - width: 686rpx;  
647 - height: 52rpx;  
648 - margin-top: 26rpx;  
649 - color: rgba(31, 31, 31, 1);  
650 - font-size: 32rpx;  
651 - font-weight: 700;  
652 - text-align: left;  
653 - line-height: 52rpx;  
654 - letter-spacing: 0.6rpx;  
655 - white-space: nowrap;  
656 - overflow: hidden;  
657 - text-overflow: ellipsis;  
658 -}  
659 -  
660 -.goods-detail {  
661 - width: 686rpx;  
662 - height: 72rpx;  
663 - margin-top: 4rpx;  
664 - color: rgba(92, 92, 92, 1);  
665 - font-size: 24rpx;  
666 - font-weight: 400;  
667 - font-family: 'PingFang SC';  
668 - text-align: left;  
669 - line-height: 36rpx;  
670 - letter-spacing: 0.6rpx;  
671 - overflow: hidden;  
672 - text-overflow: ellipsis;  
673 - display: -webkit-box;  
674 - -webkit-line-clamp: 2;  
675 - -webkit-box-orient: vertical;  
676 -}  
677 -  
678 -.goods-model {  
679 - margin-top: 16rpx;  
680 - height: 32rpx;  
681 - color: rgba(92, 92, 92, 1);  
682 - font-size: 24rpx;  
683 - font-weight: 500;  
684 - text-align: left;  
685 - line-height: 32rpx;  
686 - letter-spacing: 0.6rpx;  
687 -}  
688 -  
689 -.salesShare {  
690 - margin-top: 24rpx;  
691 -}  
692 -  
693 -.sales {  
694 - height: 32rpx;  
695 - color: rgba(194, 194, 194, 1);  
696 - font-size: 28rpx;  
697 - font-weight: 500;  
698 - font-family: 'PingFang SC';  
699 - text-align: left;  
700 - line-height: 32rpx;  
701 -}  
702 -  
703 -.share image {  
704 - width: 32rpx;  
705 - margin-right: 8rpx;  
706 -}  
707 -  
708 -.shareText {  
709 - height: 34rpx;  
710 - color: rgba(194, 194, 194, 1);  
711 - font-size: 24rpx;  
712 - font-weight: 400;  
713 - font-family: 'PingFang SC';  
714 - text-align: center;  
715 -}  
716 -  
717 -.middelBox {  
718 - width: 750rpx;  
719 - height: 132rpx;  
720 - padding: 40rpx 130rpx 0;  
721 - background-color: #ebebeb;  
722 -}  
723 -  
724 -.uline {  
725 - width: 149rpx;  
726 - height: 1rpx;  
727 - background-color: #c2c2c2;  
728 -}  
729 -  
730 -.middelTitle {  
731 - height: 40rpx;  
732 - color: rgba(31, 31, 31, 1);  
733 - font-size: 28rpx;  
734 - font-weight: 600;  
735 - text-align: center;  
736 - line-height: 40rpx;  
737 - letter-spacing: 0.6rpx;  
738 -}  
739 -  
740 -.middelTitle_En {  
741 - margin-top: 8rpx;  
742 - color: rgba(31, 31, 31, 1);  
743 - font-size: 16rpx;  
744 - font-weight: 500;  
745 - text-align: center;  
746 - line-height: 20rpx;  
747 -}  
748 -  
749 -.goods_nav {  
750 - background-color: #ffffff;  
751 - // 为商品导航组件添加固定定位  
752 - position: fixed;  
753 - bottom: 0;  
754 - left: 0;  
755 - width: 100%;  
756 - height: 120rpx;  
757 - padding: 20rpx;  
758 -}  
759 -  
760 -.kefu {  
761 - margin-left: 26rpx;  
762 -}  
763 -  
764 -.kefu image {  
765 - width: 46rpx;  
766 - height: 46rpx;  
767 - margin-top: 3rpx;  
768 -}  
769 -  
770 -.gouwuche {  
771 - margin-left: 48rpx;  
772 - transform: translateY(-2rpx);  
773 -}  
774 -  
775 -.gouwuche image {  
776 - width: 50rpx;  
777 - height: 56rpx;  
778 -}  
779 -  
780 -.optionsText {  
781 - margin-top: 4rpx;  
782 - height: 28rpx;  
783 - color: rgba(50, 50, 51, 1);  
784 - font-size: 20rpx;  
785 - font-weight: 500;  
786 - line-height: 28rpx;  
787 -}  
788 -  
789 -.buttonCart {  
790 - width: 236rpx;  
791 - height: 80rpx;  
792 - margin-left: 30rpx;  
793 - background: linear-gradient(42.8deg, rgba(129, 145, 136, 1) 0%, rgba(136, 147, 141, 1) 100%);  
794 - color: rgba(255, 255, 255, 1);  
795 - font-size: 30rpx;  
796 - font-weight: 700;  
797 - text-align: center;  
798 - line-height: 80rpx;  
799 -}  
800 -  
801 -.buttonGoumai {  
802 - width: 236rpx;  
803 - height: 80rpx;  
804 - margin-left: 16rpx;  
805 - background: linear-gradient(119.1deg, rgba(52, 94, 71, 1) 0%, rgba(62, 85, 78, 1) 100%);  
806 - color: rgba(255, 255, 255, 1);  
807 - font-size: 30rpx;  
808 - font-weight: 700;  
809 - text-align: center;  
810 - line-height: 80rpx;  
811 -}  
812 -  
813 -.popup {  
814 - padding: 48rpx 56rpx 0;  
815 -}  
816 -  
817 -.popupText {  
818 - height: 44rpx;  
819 - color: rgba(50, 50, 51, 1);  
820 - font-size: 32rpx;  
821 - font-weight: 400;  
822 - text-align: center;  
823 - line-height: 44rpx;  
824 -}  
825 -  
826 -.popupbutton {  
827 - margin-top: 70rpx;  
828 -}  
829 -  
830 -.closeBox {  
831 - width: 244rpx;  
832 - height: 80rpx;  
833 - border: 2rpx #dcdee0 solid;  
834 - color: rgba(50, 50, 51, 1);  
835 - font-size: 28rpx;  
836 - font-weight: 400;  
837 - text-align: center;  
838 - line-height: 80rpx;  
839 -}  
840 -  
841 -.openBox {  
842 - width: 244rpx;  
843 - height: 80rpx;  
844 - border: 2rpx #dcdee0 solid;  
845 - background: rgba(62, 85, 78, 1);  
846 - color: rgba(255, 255, 255, 1);  
847 - font-size: 28rpx;  
848 - font-weight: 400;  
849 - text-align: center;  
850 - line-height: 80rpx;  
851 -}  
852 -  
853 -.icout {  
854 - position: absolute;  
855 - top: 32rpx;  
856 - right: 32rpx;  
857 -}  
858 -  
859 -.icout image {  
860 - width: 48rpx;  
861 - height: 48rpx;  
862 -}  
863 -  
864 -/* 商城详情弹窗*/  
865 -.goodDetailPopup {  
866 - padding: 32rpx 16rpx 0;  
867 - position: relative;  
868 -}  
869 -  
870 -.goodsinfo {  
871 - padding: 0 16rpx;  
872 - box-sizing: border-box;  
873 - margin-bottom: 38rpx;  
874 -}  
875 -  
876 -.goodsinfoImage {  
877 - width: 200rpx;  
878 - height: 200rpx;  
879 -}  
880 -  
881 -.goodsinfoMessage {  
882 - margin-left: 24rpx;  
883 - padding-top: 30rpx;  
884 -}  
885 -  
886 -.kucunBox {  
887 - margin-top: 40rpx;  
888 - height: 32rpx;  
889 - color: rgba(194, 194, 194, 1);  
890 - font-size: 24rpx;  
891 - font-weight: 500;  
892 - font-family: 'PingFang SC';  
893 - text-align: left;  
894 - line-height: 32rpx;  
895 -}  
896 -  
897 -.goods_bt {  
898 - position: fixed;  
899 - bottom: 20rpx;  
900 - width: 686rpx;  
901 - height: 80rpx;  
902 - background: linear-gradient(119.1deg, rgba(52, 94, 71, 1) 0%, rgba(62, 85, 78, 1) 100%);  
903 - color: rgba(255, 255, 255, 1);  
904 - font-size: 32rpx;  
905 - font-weight: 600;  
906 - text-align: center;  
907 - line-height: 80rpx;  
908 - left: 32rpx;  
909 -}  
910 -  
911 -.otherNorms {  
912 - height: 150rpx;  
913 - box-sizing: border-box;  
914 -}  
915 -  
916 -.norderDetailBox {  
917 - margin-bottom: 34rpx;  
918 - flex-wrap: wrap;  
919 - margin-top: 16rpx;  
920 -}  
921 -  
922 -.norderDetailBox:last-child {  
923 - margin-bottom: 0;  
924 -}  
925 -  
926 -.norms {  
927 - color: #5c5c5c;  
928 - padding-left: 16rpx;  
929 - box-sizing: border-box;  
930 -}  
931 -  
932 -.bottomNum {  
933 - border-top: 2rpx solid #f2f3f5;  
934 - height: 144rpx;  
935 - padding: 0 16rpx;  
936 - box-sizing: border-box;  
937 -}  
938 -  
939 -.normDetail {  
940 - padding: 8rpx 32rpx;  
941 - box-sizing: border-box;  
942 - border-radius: 24rpx;  
943 - background-color: #f1f1f3;  
944 - margin-left: 16rpx;  
945 - margin-bottom: 16rpx;  
946 - color: #5c5c5c;  
947 - font-size: 24rpx;  
948 -}  
949 -  
950 -.normDetailActive {  
951 - padding: 8rpx 32rpx;  
952 - box-sizing: border-box;  
953 - border-radius: 24rpx;  
954 - background-color: #f4fffc;  
955 - margin-left: 16rpx;  
956 - margin-bottom: 16rpx;  
957 - color: #3e554e;  
958 - font-size: 24rpx;  
959 - border: 2rpx solid #3e554e;  
960 -}  
961 -  
962 -.numText {  
963 - color: #5c5c5c;  
964 -}  
965 -  
966 -.mumBox {  
967 - width: 56rpx;  
968 - height: 56rpx;  
969 - background-color: #f2f3f5;  
970 - border-radius: 8rpx;  
971 - margin-left: 4rpx;  
972 -}  
973 -  
974 -/* 已售完 */  
975 -.shouqingBox {  
976 - width: 488rpx;  
977 - height: 80rpx;  
978 - opacity: 1;  
979 - margin-left: 30rpx;  
980 - background: rgba(194, 194, 194, 1);  
981 - color: rgba(255, 255, 255, 1);  
982 - font-size: 30rpx;  
983 - font-weight: 700;  
984 - text-align: center;  
985 - line-height: 80rpx;  
986 -} 562 + /* //富文本视频 */
  563 + .videoBox {
  564 + width: 750rpx;
  565 + height: 370rpx;
  566 + }
  567 +
  568 + .videoBox video {
  569 + width: 100%;
  570 + height: 100%;
  571 + }
  572 +
  573 + .goodsDetail {
  574 + padding-bottom: 100rpx;
  575 + }
  576 +
  577 + /* 价钱样式 */
  578 + .activePrice {
  579 + height: 44rpx;
  580 + color: rgba(220, 158, 94, 1);
  581 + font-size: 48rpx;
  582 + font-weight: 700;
  583 + text-align: left;
  584 + line-height: 44rpx;
  585 + letter-spacing: 0.6rpx;
  586 + }
  587 +
  588 + .dollorS {
  589 + height: 32rpx;
  590 + color: rgba(220, 158, 94, 1);
  591 + font-size: 28rpx;
  592 + font-weight: 500;
  593 + font-family: 'PingFang SC';
  594 + text-align: center;
  595 + line-height: 32rpx;
  596 + }
  597 +
  598 + .price {
  599 + height: 32rpx;
  600 + opacity: 1;
  601 + color: rgba(150, 151, 153, 1);
  602 + font-size: 24rpx;
  603 + font-weight: 500;
  604 + text-align: left;
  605 + line-height: 32rpx;
  606 + }
  607 +
  608 + .td {
  609 + text-decoration: line-through;
  610 + }
  611 +
  612 + swiper {
  613 + height: 750rpx;
  614 + }
  615 +
  616 + .swiperVideo {
  617 + width: 750rpx;
  618 + height: 750rpx;
  619 + }
  620 +
  621 + .swiper-item,
  622 + image {
  623 + width: 100%;
  624 + height: 100%;
  625 + }
  626 +
  627 + .goods-info-box {
  628 + width: 750rpx;
  629 + height: 374rpx;
  630 + padding: 32rpx;
  631 + background-color: #ffffff;
  632 + }
  633 +
  634 + .lingjuanText {
  635 + height: 40rpx;
  636 + color: rgba(252, 67, 56, 1);
  637 + font-size: 26rpx;
  638 + font-weight: 500;
  639 + font-family: 'PingFang SC';
  640 + text-align: center;
  641 + line-height: 40rpx;
  642 + letter-spacing: 0.6rpx;
  643 + }
  644 +
  645 + .lingjuanCenter {
  646 + margin-top: 4rpx;
  647 + width: 32rpx;
  648 + height: 32rpx;
  649 + }
  650 +
  651 + .goods-name {
  652 + width: 686rpx;
  653 + height: 52rpx;
  654 + margin-top: 26rpx;
  655 + color: rgba(31, 31, 31, 1);
  656 + font-size: 32rpx;
  657 + font-weight: 700;
  658 + text-align: left;
  659 + line-height: 52rpx;
  660 + letter-spacing: 0.6rpx;
  661 + white-space: nowrap;
  662 + overflow: hidden;
  663 + text-overflow: ellipsis;
  664 + }
  665 +
  666 + .goods-detail {
  667 + width: 686rpx;
  668 + height: 72rpx;
  669 + margin-top: 4rpx;
  670 + color: rgba(92, 92, 92, 1);
  671 + font-size: 24rpx;
  672 + font-weight: 400;
  673 + font-family: 'PingFang SC';
  674 + text-align: left;
  675 + line-height: 36rpx;
  676 + letter-spacing: 0.6rpx;
  677 + overflow: hidden;
  678 + text-overflow: ellipsis;
  679 + display: -webkit-box;
  680 + -webkit-line-clamp: 2;
  681 + -webkit-box-orient: vertical;
  682 + }
  683 +
  684 + .goods-model {
  685 + margin-top: 16rpx;
  686 + height: 32rpx;
  687 + color: rgba(92, 92, 92, 1);
  688 + font-size: 24rpx;
  689 + font-weight: 500;
  690 + text-align: left;
  691 + line-height: 32rpx;
  692 + letter-spacing: 0.6rpx;
  693 + }
  694 +
  695 + .salesShare {
  696 + margin-top: 24rpx;
  697 + }
  698 +
  699 + .sales {
  700 + height: 32rpx;
  701 + color: rgba(194, 194, 194, 1);
  702 + font-size: 28rpx;
  703 + font-weight: 500;
  704 + font-family: 'PingFang SC';
  705 + text-align: left;
  706 + line-height: 32rpx;
  707 + }
  708 +
  709 + .share image {
  710 + width: 32rpx;
  711 + margin-right: 8rpx;
  712 + }
  713 +
  714 + .shareText {
  715 + height: 34rpx;
  716 + color: rgba(194, 194, 194, 1);
  717 + font-size: 24rpx;
  718 + font-weight: 400;
  719 + font-family: 'PingFang SC';
  720 + text-align: center;
  721 + }
  722 +
  723 + .middelBox {
  724 + width: 750rpx;
  725 + height: 132rpx;
  726 + padding: 40rpx 130rpx 0;
  727 + background-color: #ebebeb;
  728 + }
  729 +
  730 + .uline {
  731 + width: 149rpx;
  732 + height: 1rpx;
  733 + background-color: #c2c2c2;
  734 + }
  735 +
  736 + .middelTitle {
  737 + height: 40rpx;
  738 + color: rgba(31, 31, 31, 1);
  739 + font-size: 28rpx;
  740 + font-weight: 600;
  741 + text-align: center;
  742 + line-height: 40rpx;
  743 + letter-spacing: 0.6rpx;
  744 + }
  745 +
  746 + .middelTitle_En {
  747 + margin-top: 8rpx;
  748 + color: rgba(31, 31, 31, 1);
  749 + font-size: 16rpx;
  750 + font-weight: 500;
  751 + text-align: center;
  752 + line-height: 20rpx;
  753 + }
  754 +
  755 + .goods_nav {
  756 + background-color: #ffffff;
  757 + // 为商品导航组件添加固定定位
  758 + position: fixed;
  759 + bottom: 0;
  760 + left: 0;
  761 + width: 100%;
  762 + height: 120rpx;
  763 + padding: 20rpx;
  764 + }
  765 +
  766 + .kefu {
  767 + margin-left: 26rpx;
  768 + }
  769 +
  770 + .kefu image {
  771 + width: 46rpx;
  772 + height: 46rpx;
  773 + margin-top: 3rpx;
  774 + }
  775 +
  776 + .gouwuche {
  777 + margin-left: 48rpx;
  778 + transform: translateY(-2rpx);
  779 + }
  780 +
  781 + .gouwuche image {
  782 + width: 50rpx;
  783 + height: 56rpx;
  784 + }
  785 +
  786 + .optionsText {
  787 + margin-top: 4rpx;
  788 + height: 28rpx;
  789 + color: rgba(50, 50, 51, 1);
  790 + font-size: 20rpx;
  791 + font-weight: 500;
  792 + line-height: 28rpx;
  793 + }
  794 +
  795 + .buttonCart {
  796 + width: 236rpx;
  797 + height: 80rpx;
  798 + margin-left: 30rpx;
  799 + background: linear-gradient(42.8deg, rgba(129, 145, 136, 1) 0%, rgba(136, 147, 141, 1) 100%);
  800 + color: rgba(255, 255, 255, 1);
  801 + font-size: 30rpx;
  802 + font-weight: 700;
  803 + text-align: center;
  804 + line-height: 80rpx;
  805 + }
  806 +
  807 + .buttonGoumai {
  808 + width: 236rpx;
  809 + height: 80rpx;
  810 + margin-left: 16rpx;
  811 + background: linear-gradient(119.1deg, rgba(52, 94, 71, 1) 0%, rgba(62, 85, 78, 1) 100%);
  812 + color: rgba(255, 255, 255, 1);
  813 + font-size: 30rpx;
  814 + font-weight: 700;
  815 + text-align: center;
  816 + line-height: 80rpx;
  817 + }
  818 +
  819 + .popup {
  820 + padding: 48rpx 56rpx 0;
  821 + }
  822 +
  823 + .popupText {
  824 + height: 44rpx;
  825 + color: rgba(50, 50, 51, 1);
  826 + font-size: 32rpx;
  827 + font-weight: 400;
  828 + text-align: center;
  829 + line-height: 44rpx;
  830 + }
  831 +
  832 + .popupbutton {
  833 + margin-top: 70rpx;
  834 + }
  835 +
  836 + .closeBox {
  837 + width: 244rpx;
  838 + height: 80rpx;
  839 + border: 2rpx #dcdee0 solid;
  840 + color: rgba(50, 50, 51, 1);
  841 + font-size: 28rpx;
  842 + font-weight: 400;
  843 + text-align: center;
  844 + line-height: 80rpx;
  845 + }
  846 +
  847 + .openBox {
  848 + width: 244rpx;
  849 + height: 80rpx;
  850 + border: 2rpx #dcdee0 solid;
  851 + background: rgba(62, 85, 78, 1);
  852 + color: rgba(255, 255, 255, 1);
  853 + font-size: 28rpx;
  854 + font-weight: 400;
  855 + text-align: center;
  856 + line-height: 80rpx;
  857 + }
  858 +
  859 + .icout {
  860 + position: absolute;
  861 + top: 32rpx;
  862 + right: 32rpx;
  863 + }
  864 +
  865 + .icout image {
  866 + width: 48rpx;
  867 + height: 48rpx;
  868 + }
  869 +
  870 + /* 商城详情弹窗*/
  871 + .goodDetailPopup {
  872 + padding: 32rpx 16rpx 0;
  873 + position: relative;
  874 + }
  875 +
  876 + .goodsinfo {
  877 + padding: 0 16rpx;
  878 + box-sizing: border-box;
  879 + margin-bottom: 38rpx;
  880 + }
  881 +
  882 + .goodsinfoImage {
  883 + width: 200rpx;
  884 + height: 200rpx;
  885 + }
  886 +
  887 + .goodsinfoMessage {
  888 + margin-left: 24rpx;
  889 + padding-top: 30rpx;
  890 + }
  891 +
  892 + .kucunBox {
  893 + margin-top: 40rpx;
  894 + height: 32rpx;
  895 + color: rgba(194, 194, 194, 1);
  896 + font-size: 24rpx;
  897 + font-weight: 500;
  898 + font-family: 'PingFang SC';
  899 + text-align: left;
  900 + line-height: 32rpx;
  901 + }
  902 +
  903 + .goods_bt {
  904 + position: fixed;
  905 + bottom: 20rpx;
  906 + width: 686rpx;
  907 + height: 80rpx;
  908 + background: linear-gradient(119.1deg, rgba(52, 94, 71, 1) 0%, rgba(62, 85, 78, 1) 100%);
  909 + color: rgba(255, 255, 255, 1);
  910 + font-size: 32rpx;
  911 + font-weight: 600;
  912 + text-align: center;
  913 + line-height: 80rpx;
  914 + left: 32rpx;
  915 + }
  916 +
  917 + .otherNorms {
  918 + height: 150rpx;
  919 + box-sizing: border-box;
  920 + }
  921 +
  922 + .norderDetailBox {
  923 + margin-bottom: 34rpx;
  924 + flex-wrap: wrap;
  925 + margin-top: 16rpx;
  926 + }
  927 +
  928 + .norderDetailBox:last-child {
  929 + margin-bottom: 0;
  930 + }
  931 +
  932 + .norms {
  933 + color: #5c5c5c;
  934 + padding-left: 16rpx;
  935 + box-sizing: border-box;
  936 + }
  937 +
  938 + .bottomNum {
  939 + border-top: 2rpx solid #f2f3f5;
  940 + height: 144rpx;
  941 + padding: 0 16rpx;
  942 + box-sizing: border-box;
  943 + }
  944 +
  945 + .normDetail {
  946 + padding: 8rpx 32rpx;
  947 + box-sizing: border-box;
  948 + border-radius: 24rpx;
  949 + background-color: #f1f1f3;
  950 + margin-left: 16rpx;
  951 + margin-bottom: 16rpx;
  952 + color: #5c5c5c;
  953 + font-size: 24rpx;
  954 + }
  955 +
  956 + .normDetailActive {
  957 + padding: 8rpx 32rpx;
  958 + box-sizing: border-box;
  959 + border-radius: 24rpx;
  960 + background-color: #f4fffc;
  961 + margin-left: 16rpx;
  962 + margin-bottom: 16rpx;
  963 + color: #3e554e;
  964 + font-size: 24rpx;
  965 + border: 2rpx solid #3e554e;
  966 + }
  967 +
  968 + .numText {
  969 + color: #5c5c5c;
  970 + }
  971 +
  972 + .mumBox {
  973 + width: 56rpx;
  974 + height: 56rpx;
  975 + background-color: #f2f3f5;
  976 + border-radius: 8rpx;
  977 + margin-left: 4rpx;
  978 + }
  979 +
  980 + /* 已售完 */
  981 + .shouqingBox {
  982 + width: 488rpx;
  983 + height: 80rpx;
  984 + opacity: 1;
  985 + margin-left: 30rpx;
  986 + background: rgba(194, 194, 194, 1);
  987 + color: rgba(255, 255, 255, 1);
  988 + font-size: 30rpx;
  989 + font-weight: 700;
  990 + text-align: center;
  991 + line-height: 80rpx;
  992 + }
987 </style> 993 </style>
@@ -262,7 +262,7 @@ @@ -262,7 +262,7 @@
262 navToAddress() { 262 navToAddress() {
263 if (uni.getStorageSync("token")) { 263 if (uni.getStorageSync("token")) {
264 uni.navigateTo({ 264 uni.navigateTo({
265 - url: "../order/selectAddress/addAddress" 265 + url: "../order/selectAddress/selectAddress"
266 }) 266 })
267 } else { 267 } else {
268 uni.showToast({ 268 uni.showToast({
@@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
96 //验证输入内容 96 //验证输入内容
97 isjiance(e) { 97 isjiance(e) {
98 if(/^(?:[\u4e00-\u9fa5·]{2,16})$/.test(this.userName)){ 98 if(/^(?:[\u4e00-\u9fa5·]{2,16})$/.test(this.userName)){
99 - 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)){ 99 + 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)){
100 100
101 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)){ 101 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)){
102 let data = { 102 let data = {
@@ -190,6 +190,7 @@ @@ -190,6 +190,7 @@
190 } 190 }
191 }, 191 },
192 onShow() { 192 onShow() {
  193 + this.address = '';
193 this.getAddress(); // 获取地址 194 this.getAddress(); // 获取地址
194 }, 195 },
195 methods: { 196 methods: {
@@ -426,12 +427,18 @@ @@ -426,12 +427,18 @@
426 // uni.navigateTo({ 427 // uni.navigateTo({
427 // url: route 428 // url: route
428 // }); 429 // });
  430 + uni.navigateBack({
  431 + delta:1
  432 + })
429 }, 433 },
430 cancel: function(r) { 434 cancel: function(r) {
431 // var route = 'payResult' + '?type=2' 435 // var route = 'payResult' + '?type=2'
432 // uni.navigateTo({ 436 // uni.navigateTo({
433 // url: route 437 // url: route
434 // }); 438 // });
  439 + uni.navigateBack({
  440 + delta:1
  441 + })
435 }, 442 },
436 fail: function(res) { 443 fail: function(res) {
437 // console.log('payfail') 444 // console.log('payfail')
@@ -507,12 +514,18 @@ @@ -507,12 +514,18 @@
507 // uni.navigateTo({ 514 // uni.navigateTo({
508 // url: route 515 // url: route
509 // }); 516 // });
  517 + uni.navigateBack({
  518 + delta:1
  519 + })
510 }, 520 },
511 cancel: function(r) { 521 cancel: function(r) {
512 // var route = 'payResult' + '?type=2' 522 // var route = 'payResult' + '?type=2'
513 // uni.navigateTo({ 523 // uni.navigateTo({
514 // url: route 524 // url: route
515 // }); 525 // });
  526 + uni.navigateBack({
  527 + delta:1
  528 + })
516 }, 529 },
517 fail: function(res) { 530 fail: function(res) {
518 // console.log('payfail') 531 // console.log('payfail')