|
|
|
@ -72,8 +72,8 @@ |
|
|
|
|
<image :src="$picUrl+'/static/detail/copy.png'"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="operaImg"> |
|
|
|
|
<image :src="$picUrl+'/static/detail/jiangjia.png'" class="tips"></image> |
|
|
|
|
<image :src="$picUrl+'/static/detail/tip.png'" class="tips"></image> |
|
|
|
|
<image :src="$picUrl+'/static/detail/miaosha.png'" v-if="isSeckill" class="tips"></image> |
|
|
|
|
<image :src="$picUrl+'/static/detail/tip.png'" @click="toJDdetal(goods.goods_id)" class="tips"></image> |
|
|
|
|
<image :src="$picUrl+'/static/detail/ys.png'" class="tips"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -200,32 +200,77 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="fooRight"> |
|
|
|
|
<view class="fooRight" v-if="isLogin && userInfo.user_type == 40"> |
|
|
|
|
<template v-if="goods.status == 20"> |
|
|
|
|
<view class="btn-bg"> |
|
|
|
|
已下架 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<template v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num == 0"> |
|
|
|
|
<view class="btn-bg" style="background-color: #FF1D1D;" @click="openPirce()"> |
|
|
|
|
修改价格 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="fooRight" v-else> |
|
|
|
|
<template v-if="goods.status == 20"> |
|
|
|
|
<view class="btn-bg"> |
|
|
|
|
暂无库存 |
|
|
|
|
已下架 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<view class="addCar" v-if="!isPre" @click="choseSku(2)"> |
|
|
|
|
加入购物车 |
|
|
|
|
</view> |
|
|
|
|
<view class="buyNow" v-if="!isPre" @click="choseSku(3)"> |
|
|
|
|
立即购买 |
|
|
|
|
</view> |
|
|
|
|
<view class="buyNow" @click="onReservation()" v-if="isPre"> |
|
|
|
|
立即预约 |
|
|
|
|
</view> |
|
|
|
|
<template v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num == 0"> |
|
|
|
|
<view class="btn-bg"> |
|
|
|
|
暂无库存 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<template v-if="!isPre"> |
|
|
|
|
<template v-if="isSeckill"> |
|
|
|
|
<template v-if="isBuy"> |
|
|
|
|
<template v-if="seckillText=='距离'"> |
|
|
|
|
<view class="addCar" @click="choseSku(2)"> |
|
|
|
|
加入购物车 |
|
|
|
|
</view> |
|
|
|
|
<view class="buyNow" @click="choseSku(3)"> |
|
|
|
|
立即购买 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<view class="btn-bg"> |
|
|
|
|
未到时间 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<view class="btn-bg"> |
|
|
|
|
已下架 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<view class="addCar" @click="choseSku(2)"> |
|
|
|
|
加入购物车 |
|
|
|
|
</view> |
|
|
|
|
<view class="buyNow" @click="choseSku(3)"> |
|
|
|
|
立即购买 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
<template v-if="isPre"> |
|
|
|
|
<view class="buyNow" @click="onReservation()" v-if="isBuy > 0"> |
|
|
|
|
立即预约 |
|
|
|
|
</view> |
|
|
|
|
<view class="btn-bg" v-else> |
|
|
|
|
已失效 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class="dia" v-if="openDialog"> |
|
|
|
|
<view class="preSuc" v-if="shareType=='pre'"> |
|
|
|
@ -238,8 +283,59 @@ |
|
|
|
|
<view class="iKnow" @click="onKonw"> |
|
|
|
|
查看预约记录 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="setMs" v-if="shareType=='setPrice'"> |
|
|
|
|
<view class="msprice"> |
|
|
|
|
设置商品价格 |
|
|
|
|
</view> |
|
|
|
|
<view class="msLine"> |
|
|
|
|
<u-line class="u-line"></u-line> |
|
|
|
|
</view> |
|
|
|
|
<view class="msp"> |
|
|
|
|
<text>原价格:</text> |
|
|
|
|
<input type="text" disabled v-model="goods.goods_price_min" class="inp" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="msp"> |
|
|
|
|
<text>商品价格:</text> |
|
|
|
|
<input type="text" v-model="max_price" placeholder="商品价格" class="inp" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="msp"> |
|
|
|
|
<text>划线价格:</text> |
|
|
|
|
<input type="text" v-model="markup_rate" placeholder="划线价格" class="inp" /> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="qj"> |
|
|
|
|
<text class="msQj">秒杀区间:</text> |
|
|
|
|
<view class="date"> |
|
|
|
|
<view class="beginTime timeCommn"> |
|
|
|
|
开始时间 |
|
|
|
|
</view> |
|
|
|
|
- |
|
|
|
|
<view class="timeCommn endTime"> |
|
|
|
|
结束时间 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<!-- <view class="msLimit"> |
|
|
|
|
<text>秒杀限购:</text> |
|
|
|
|
<switch @change="switch1Change" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="peoLimit"> |
|
|
|
|
<text>每人限购</text> |
|
|
|
|
<view class="num"> |
|
|
|
|
1 |
|
|
|
|
</view> |
|
|
|
|
<text>次</text> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="operaBtn"> |
|
|
|
|
<view class="cancel btnComm" @click="shareCancel()"> |
|
|
|
|
取消 |
|
|
|
|
</view> |
|
|
|
|
<view class="sureBtn btnComm" @click="toUnpdatePrice()"> |
|
|
|
|
确定 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="setMs" v-if="shareType=='setPrice'"> |
|
|
|
|
<!-- <view class="setMs" v-if="shareType=='setPrice'"> |
|
|
|
|
<view class="msprice"> |
|
|
|
|
设置秒杀价格 |
|
|
|
|
</view> |
|
|
|
@ -281,7 +377,7 @@ |
|
|
|
|
确定 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<!-- --> |
|
|
|
|
<view class="shareWechat" v-if="shareType=='share'"> |
|
|
|
|
<view class="shareGoods"> |
|
|
|
@ -348,6 +444,8 @@ |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
max_price: "", |
|
|
|
|
markup_rate: "", |
|
|
|
|
showGoodsPosterPopup: false, |
|
|
|
|
cityInfo: {}, |
|
|
|
|
currenIndex: 0, |
|
|
|
@ -361,8 +459,11 @@ |
|
|
|
|
skuMode: 1, |
|
|
|
|
diaShow: false, |
|
|
|
|
searchValue: '', |
|
|
|
|
isPre: false, |
|
|
|
|
pre_id: '', |
|
|
|
|
isPre: false, //是否预售 |
|
|
|
|
pre_id: '', //预售id |
|
|
|
|
isBuy: "",//是否购买 |
|
|
|
|
isSeckill: false,//是否秒杀 |
|
|
|
|
seckillText: "",//是否秒杀 |
|
|
|
|
setPrice: false, |
|
|
|
|
openDialog: false, |
|
|
|
|
goodsId: '', |
|
|
|
@ -384,7 +485,11 @@ |
|
|
|
|
console.log(options,"oo") |
|
|
|
|
this.isPre = options.isPre?options.isPre:null |
|
|
|
|
this.goodsId = options.goodsId?options.goodsId:null |
|
|
|
|
this.pre_id = options.pre_id?options.pre_id:null; |
|
|
|
|
this.pre_id = options.pre_id?options.pre_id:null; |
|
|
|
|
this.isSeckill = options.isSeckill?options.isSeckill:null; |
|
|
|
|
this.isBuy = options.isBuy?decodeURIComponent(options.isBuy):null; |
|
|
|
|
this.seckillText = options.seckillText?decodeURIComponent(options.seckillText):null; |
|
|
|
|
console.log(this.isBuy) |
|
|
|
|
this.getSuggestGoods() |
|
|
|
|
this.getServeList() |
|
|
|
|
this.getGoodsDetail() |
|
|
|
@ -408,6 +513,57 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//修改商品价格 |
|
|
|
|
async toUnpdatePrice(){ |
|
|
|
|
const that = this; |
|
|
|
|
if(!that.max_price){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
title: "商品价格不能为空!" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!that.markup_rate){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
title: "划线价格不能为空!" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
let params={ |
|
|
|
|
id: that.goods.goods_id, |
|
|
|
|
goods_price: that.max_price, |
|
|
|
|
line_price: that.markup_rate, |
|
|
|
|
cat_id: that.goods.category.category_id |
|
|
|
|
} |
|
|
|
|
GoodsApi.editGoodsPrice(params).then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.shareCancel(); |
|
|
|
|
that.$toast("修改成功"); |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
that.getGoodsDetail(); |
|
|
|
|
},1000) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
|
}, |
|
|
|
|
//跳转京东小程序详情 |
|
|
|
|
toJDdetal(sku) { |
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
appId: 'wx91d27dbf599dff74', |
|
|
|
|
path: '/pages/item/detail/detail?sku='+sku, |
|
|
|
|
envVersion: 'release', |
|
|
|
|
success(res) { |
|
|
|
|
// 打开成功 |
|
|
|
|
console.log(res); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//修改价格 |
|
|
|
|
openPirce() { |
|
|
|
|
this.openDialog = true; |
|
|
|
|
this.shareType= 'setPrice' |
|
|
|
|
}, |
|
|
|
|
//门店图片预览 |
|
|
|
|
previewImage(i){ |
|
|
|
|
uni.previewImage({ |
|
|
|
@ -427,7 +583,8 @@ |
|
|
|
|
shareImg(){ |
|
|
|
|
this.openDialog =true |
|
|
|
|
this.shareType= 'share' |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
//立即预约 |
|
|
|
|
preNow(){ |
|
|
|
|
const that = this |
|
|
|
|
let params={ |
|
|
|
@ -712,23 +869,6 @@ |
|
|
|
|
this.openDialog = false |
|
|
|
|
this.showGoodsPosterPopup = true; |
|
|
|
|
} |
|
|
|
|
// |
|
|
|
|
// // 获取商品信息 |
|
|
|
|
// getGoodsDetail() { |
|
|
|
|
// const app = this |
|
|
|
|
// return new Promise((resolve, reject) => { |
|
|
|
|
// GoodsApi.poster({ |
|
|
|
|
// goodsId: app.goodsId, |
|
|
|
|
// channel: "微信小程序" |
|
|
|
|
// }) |
|
|
|
|
// .then(result => { |
|
|
|
|
// app.imageUrl = result.data.imageUrl |
|
|
|
|
// resolve(result) |
|
|
|
|
// }) |
|
|
|
|
// .catch(reject) |
|
|
|
|
// }) |
|
|
|
|
// }, |
|
|
|
|
// }, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
@ -1365,7 +1505,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.buyNow { |
|
|
|
|
width: 212rpx; |
|
|
|
|
flex: 1; |
|
|
|
|
height: 78rpx; |
|
|
|
|
background: linear-gradient(102deg, #FE5E06 0%, #F3221A 100%); |
|
|
|
|
border-radius: 42rpx 42rpx 42rpx 42rpx; |
|
|
|
@ -1453,7 +1593,7 @@ |
|
|
|
|
|
|
|
|
|
.setMs { |
|
|
|
|
width: 656rpx; |
|
|
|
|
height: 690rpx; |
|
|
|
|
height: 590rpx; |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border-radius: 12rpx 12rpx 12rpx 12rpx; |
|
|
|
|
opacity: 1; |
|
|
|
|