|
|
|
@ -84,20 +84,20 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="orderInfo"> |
|
|
|
|
<!-- |
|
|
|
|
<!-- <template v-if="userInfo.user_type == 40"> |
|
|
|
|
<view class="chosed" v-if="goods.spec_type == 20"> |
|
|
|
|
<view class="title">已选</view> |
|
|
|
|
<view class="info">{{ |
|
|
|
|
|
|
|
|
|
}}</view>--> |
|
|
|
|
<!-- <view class="info" v-if="goods.skuList.length>0"> |
|
|
|
|
<view class="info" style="justify-content: flex-start;" v-if="goods.skuList.length>0"> |
|
|
|
|
<text v-for="(a,idx) in goods.skuList[0].goods_props" :key="idx" style="margin-right: 10rpx;">{{a.group.name}}{{a.value.name}}</text>1件 |
|
|
|
|
</view> --> |
|
|
|
|
<!-- </view> |
|
|
|
|
</view> |
|
|
|
|
<u-icon name="arrow-right" color="#7C7C7C"></u-icon> |
|
|
|
|
</view> |
|
|
|
|
<view class="chosed" v-else> |
|
|
|
|
<view class="title">已选</view> |
|
|
|
|
<view class="info">1件</view> |
|
|
|
|
</view>--> |
|
|
|
|
<u-icon name="arrow-right" color="#7C7C7C"></u-icon> |
|
|
|
|
</view> |
|
|
|
|
</template> --> |
|
|
|
|
<view class="chosed" v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num > 0"> |
|
|
|
|
<view class="title">送至</view> |
|
|
|
|
<view class="info"> |
|
|
|
@ -207,7 +207,10 @@ |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<view class="btn-bg" style="background-color: #FF1D1D;" @click="openPirce()"> |
|
|
|
|
<view class="btn-bg" v-if="goods.spec_type == 20" style="background-color: #FF1D1D;" @click="choseSku(3)"> |
|
|
|
|
修改价格 |
|
|
|
|
</view> |
|
|
|
|
<view class="btn-bg" v-else style="background-color: #FF1D1D;" @click="openPirce(1)"> |
|
|
|
|
修改价格 |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
@ -293,7 +296,7 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="msp"> |
|
|
|
|
<text>原价格:</text> |
|
|
|
|
<input type="text" disabled v-model="goods.goods_price_min" class="inp" /> |
|
|
|
|
<input type="text" disabled v-model="selectShop.price" class="inp" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="msp"> |
|
|
|
|
<text>商品价格:</text> |
|
|
|
@ -327,7 +330,7 @@ |
|
|
|
|
<text>次</text> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="operaBtn"> |
|
|
|
|
<view class="cancel btnComm" @click="shareCancel()"> |
|
|
|
|
<view class="cancel btnComm" @click="shareCancel(1)"> |
|
|
|
|
取消 |
|
|
|
|
</view> |
|
|
|
|
<view class="sureBtn btnComm" @click="toUnpdatePrice()"> |
|
|
|
@ -417,7 +420,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="shareCancel" @click="shareCancel()"> |
|
|
|
|
<view class="shareCancel" @click="shareCancel(1)"> |
|
|
|
|
取消 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -425,8 +428,9 @@ |
|
|
|
|
<view class="toTop" v-if="isTop" @click="openScrollTo()"> |
|
|
|
|
<image :src="$picUrl+'/static/toTop.png'"></image> |
|
|
|
|
</view> |
|
|
|
|
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :goods="goods" @updateSku="updateSku" @addCart="onAddCart" /> |
|
|
|
|
|
|
|
|
|
<view v-if="isTodo"> |
|
|
|
|
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :goods="goods" @addCart="onAddCart" /> |
|
|
|
|
</view> |
|
|
|
|
<!-- 海报图弹层 --> |
|
|
|
|
<goods-poster-popup v-model="showGoodsPosterPopup" :apiCall="posterApiCall" :apiParam="{goodsId}" /> |
|
|
|
|
</view> |
|
|
|
@ -444,6 +448,8 @@ |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
isTodo: true, |
|
|
|
|
result: {}, |
|
|
|
|
max_price: "", |
|
|
|
|
markup_rate: "", |
|
|
|
|
showGoodsPosterPopup: false, |
|
|
|
@ -476,12 +482,13 @@ |
|
|
|
|
addressInfo: {}, |
|
|
|
|
serveList:[], |
|
|
|
|
isLogin: false, |
|
|
|
|
|
|
|
|
|
selectShop: {}, |
|
|
|
|
// 获取商品海报图api方法 |
|
|
|
|
posterApiCall: GoodsApi.poster, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
const that = this; |
|
|
|
|
console.log(options,"oo") |
|
|
|
|
this.isPre = options.isPre?options.isPre:null |
|
|
|
|
this.goodsId = options.goodsId?options.goodsId:null |
|
|
|
@ -494,6 +501,12 @@ |
|
|
|
|
this.getServeList() |
|
|
|
|
this.getGoodsDetail() |
|
|
|
|
this.cityInfo = uni.getStorageSync("cityInfo"); |
|
|
|
|
uni.$on("onenPrice",function(selectShop) { |
|
|
|
|
that.openPirce(); |
|
|
|
|
that.isTodo = false; |
|
|
|
|
that.selectShop = selectShop |
|
|
|
|
that.selectShop.price = that.selectShop.price/100 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
if(uni.getStorageSync('AccessToken')){ |
|
|
|
@ -530,19 +543,22 @@ |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
let sku_id = "" |
|
|
|
|
if(that.goods.spec_type == 20){ |
|
|
|
|
sku_id = that.goods.skuList[0].id |
|
|
|
|
} |
|
|
|
|
let params={ |
|
|
|
|
id: that.goods.goods_id, |
|
|
|
|
goods_price: that.max_price, |
|
|
|
|
line_price: that.markup_rate, |
|
|
|
|
cat_id: that.goods.category.category_id |
|
|
|
|
sku_id: sku_id.toString() |
|
|
|
|
} |
|
|
|
|
GoodsApi.editGoodsPrice(params).then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.shareCancel(); |
|
|
|
|
that.$toast("修改成功"); |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
that.getGoodsDetail(); |
|
|
|
|
},1000) |
|
|
|
|
that.getGoodsDetail(1); |
|
|
|
|
},500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
@ -560,9 +576,13 @@ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//修改价格 |
|
|
|
|
openPirce() { |
|
|
|
|
openPirce(type) { |
|
|
|
|
this.openDialog = true; |
|
|
|
|
this.shareType= 'setPrice' |
|
|
|
|
if(type == 1){ |
|
|
|
|
this.selectShop = {} |
|
|
|
|
this.selectShop.price = this.goods.goods_price_max; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//门店图片预览 |
|
|
|
|
previewImage(i){ |
|
|
|
@ -697,6 +717,7 @@ |
|
|
|
|
console.log(total) |
|
|
|
|
}, |
|
|
|
|
choseSku(skuMode) { |
|
|
|
|
console.log(this.goods) |
|
|
|
|
if(!uni.getStorageSync("AccessToken")) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: "/pages/login/index" |
|
|
|
@ -723,22 +744,20 @@ |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 获取商品信息 |
|
|
|
|
getGoodsDetail() { |
|
|
|
|
getGoodsDetail(type) { |
|
|
|
|
const that = this |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
GoodsApi.detail(this.goodsId) |
|
|
|
|
.then(result => { |
|
|
|
|
let info = result.data.detail; |
|
|
|
|
that.goods.skuList = []; |
|
|
|
|
that.godds = {} |
|
|
|
|
info.goods_images1 = [] |
|
|
|
|
if(info.goods_images && info.goods_images.length > 0){ |
|
|
|
|
info.goods_images.map(a=>{ |
|
|
|
|
info.goods_images1.push(a.preview_url) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// if(info.skuList && info.skuList.length > 0){ |
|
|
|
|
// info.skuList = info.skuList.reverse(); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
info.content = info.content |
|
|
|
|
.replace(/style=""/g,'') |
|
|
|
|
.replace(/<img src=/g,'<img style="width: 100%; display:block" src=') |
|
|
|
@ -747,8 +766,13 @@ |
|
|
|
|
this.$set(this.goods,item,info[item]) |
|
|
|
|
// that.goods[item] = info[item] |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
that.allPicture = info.goods_images.length |
|
|
|
|
that.allPicture = info.goods_images.length; |
|
|
|
|
if(type == 1){ |
|
|
|
|
that.selectShop = {} |
|
|
|
|
that.max_price = "" |
|
|
|
|
that.markup_rate = "" |
|
|
|
|
that.shareCancel(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
|
}) |
|
|
|
@ -847,6 +871,7 @@ |
|
|
|
|
}, |
|
|
|
|
shareCancel() { |
|
|
|
|
this.shareType = ""; |
|
|
|
|
this.isTodo = true; |
|
|
|
|
this.openDialog = false; |
|
|
|
|
}, |
|
|
|
|
toHaibao(index){ |
|
|
|
|