Commit 741e1ebb authored by gouxionglai's avatar gouxionglai
Browse files

1.admin:去掉规格图片

2.wx:选择不同规格时展示不同图片,默认第一张。
parent 5af77957
...@@ -16,6 +16,14 @@ export function deleteGoods(data) { ...@@ -16,6 +16,14 @@ export function deleteGoods(data) {
}) })
} }
export function deleteGoodsBatch(data) {
return request({
url: '/goods/deleteBatch',
method: 'post',
data
})
}
export function publishGoods(data) { export function publishGoods(data) {
return request({ return request({
url: '/goods/create', url: '/goods/create',
......
...@@ -127,11 +127,13 @@ ...@@ -127,11 +127,13 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="picUrl" label="规格图片"> <!--
<template slot-scope="scope"> <el-table-column property="picUrl" label="规格图片">
<img v-if="scope.row.picUrl" :src="scope.row.picUrl" width="40"> <template slot-scope="scope">
</template> <img v-if="scope.row.picUrl" :src="scope.row.picUrl" width="40">
</el-table-column> </template>
</el-table-column>
-->
<el-table-column <el-table-column
v-if="multipleSpec" v-if="multipleSpec"
align="center" align="center"
...@@ -161,19 +163,22 @@ ...@@ -161,19 +163,22 @@
<el-form-item label="规格值" prop="value"> <el-form-item label="规格值" prop="value">
<el-input v-model="specForm.value" /> <el-input v-model="specForm.value" />
</el-form-item> </el-form-item>
<el-form-item label="规格图片" prop="picUrl">
<el-upload <!-- <el-form-item label="规格图片" prop="picUrl">
:action="uploadPath" <el-upload
:show-file-list="false" :action="uploadPath"
:headers="headers" :show-file-list="false"
:on-success="uploadSpecPicUrl" :headers="headers"
class="avatar-uploader" :on-success="uploadSpecPicUrl"
accept=".jpg,.jpeg,.png,.gif" class="avatar-uploader"
> accept=".jpg,.jpeg,.png,.gif"
<img v-if="specForm.picUrl" :src="specForm.picUrl" class="avatar"> >
<i v-else class="el-icon-plus avatar-uploader-icon" /> <img v-if="specForm.picUrl" :src="specForm.picUrl" class="avatar">
</el-upload> <i v-else class="el-icon-plus avatar-uploader-icon" />
</el-form-item> </el-upload>
</el-form-item>
-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="specVisiable = false">取消</el-button> <el-button @click="specVisiable = false">取消</el-button>
......
...@@ -21,6 +21,7 @@ Page({ ...@@ -21,6 +21,7 @@ Page({
cartGoodsCount: 0, cartGoodsCount: 0,
userHasCollect: 0, userHasCollect: 0,
number: 1, number: 1,
tmpPicUrl: '',
checkedSpecText: '规格数量选择', checkedSpecText: '规格数量选择',
tmpSpecText: '请选择规格数量', tmpSpecText: '请选择规格数量',
checkedSpecPrice: 0, checkedSpecPrice: 0,
...@@ -133,7 +134,9 @@ Page({ ...@@ -133,7 +134,9 @@ Page({
}).then(function(res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
let _specificationList = res.data.specificationList let _specificationList = res.data.productList;
let _tmpPicUrl = res.data.productList[0].url;
//console.log("pic: "+_tmpPicUrl);
// 如果仅仅存在一种货品,那么商品页面初始化时默认checked // 如果仅仅存在一种货品,那么商品页面初始化时默认checked
if (_specificationList.length == 1) { if (_specificationList.length == 1) {
if (_specificationList[0].valueList.length == 1) { if (_specificationList[0].valueList.length == 1) {
...@@ -149,7 +152,7 @@ Page({ ...@@ -149,7 +152,7 @@ Page({
that.setData({ that.setData({
checkedSpecText: _specificationList[0].valueList[0].value, checkedSpecText: _specificationList[0].valueList[0].value,
tmpSpecText: '已选择:' + _specificationList[0].valueList[0].value, tmpSpecText: '已选择:' + _specificationList[0].valueList[0].value
}); });
} }
} }
...@@ -167,8 +170,11 @@ Page({ ...@@ -167,8 +170,11 @@ Page({
checkedSpecPrice: res.data.info.retailPrice, checkedSpecPrice: res.data.info.retailPrice,
groupon: res.data.groupon, groupon: res.data.groupon,
canShare: res.data.share, canShare: res.data.share,
//选择规格时,默认展示第一张图片
tmpPicUrl: _tmpPicUrl
}); });
//如果是通过分享的团购参加团购,则团购项目应该与分享的一致并且不可更改 //如果是通过分享的团购参加团购,则团购项目应该与分享的一致并且不可更改
if (that.data.isGroupon) { if (that.data.isGroupon) {
let groupons = that.data.groupon; let groupons = that.data.groupon;
...@@ -372,9 +378,11 @@ Page({ ...@@ -372,9 +378,11 @@ Page({
} }
let checkedProduct = checkedProductArray[0]; let checkedProduct = checkedProductArray[0];
//console.log("checkedProduct: "+checkedProduct.url);
if (checkedProduct.number > 0) { if (checkedProduct.number > 0) {
this.setData({ this.setData({
checkedSpecPrice: checkedProduct.price, checkedSpecPrice: checkedProduct.price,
tmpPicUrl: checkedProduct.url,
soldout: false soldout: false
}); });
} else { } else {
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<van-icon class="icon" name="cross" /> <van-icon class="icon" name="cross" />
</view> </view>
<view class="img-info"> <view class="img-info">
<image class="img" src="{{goods.picUrl}}"></image> <image class="img" src="{{tmpPicUrl}}"></image>
<view class="info"> <view class="info">
<view class="c"> <view class="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view> <view class="p">价格:¥{{checkedSpecPrice}}</view>
...@@ -174,7 +174,6 @@ ...@@ -174,7 +174,6 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -199,5 +198,5 @@ ...@@ -199,5 +198,5 @@
</view> </view>
<view class="r" bindtap="addToCart" wx:if="{{!soldout}}" wx:if="{{!isGroupon}}">加入购物车</view> <view class="r" bindtap="addToCart" wx:if="{{!soldout}}" wx:if="{{!isGroupon}}">加入购物车</view>
<view class="c" bindtap="addFast" wx:if="{{!soldout}}">{{isGroupon?'参加团购':'立即购买'}}</view> <view class="c" bindtap="addFast" wx:if="{{!soldout}}">{{isGroupon?'参加团购':'立即购买'}}</view>
<view class="n" wx:if="{{soldout}}">商品已售空</view> <view class="c" wx:if="{{soldout}}">商品已售空</view>
</view> </view>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment