|
@@ -7,7 +7,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content">
|
|
<view class="content">
|
|
|
- <view class="form" v-if="schedule ==1">
|
|
|
|
|
|
|
+ <view class="form" v-show="schedule ==1">
|
|
|
<view class="titl">
|
|
<view class="titl">
|
|
|
基础信息
|
|
基础信息
|
|
|
</view>
|
|
</view>
|
|
@@ -81,7 +81,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="form" v-if="schedule == 2">
|
|
|
|
|
|
|
+ <view class="form" v-show="schedule == 2">
|
|
|
<view class="titl ">
|
|
<view class="titl ">
|
|
|
售卖/使用信息
|
|
售卖/使用信息
|
|
|
</view>
|
|
</view>
|
|
@@ -89,8 +89,8 @@
|
|
|
<view class="label">
|
|
<view class="label">
|
|
|
售卖时间<span>*</span>
|
|
售卖时间<span>*</span>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="picker set inp" @click="isSelectDate = true">
|
|
|
|
|
- 去设置
|
|
|
|
|
|
|
+ <view class="picker set inp" @click="selectDate">
|
|
|
|
|
+ <u-input placeholder="去设置" v-model="showDate" @click="selectDate" />
|
|
|
<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
|
|
<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -99,7 +99,7 @@
|
|
|
库存<span>*</span>
|
|
库存<span>*</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker set">
|
|
<view class="picker set">
|
|
|
- <u-input v-model="form.productName" placeholder="输入库存数量" />
|
|
|
|
|
|
|
+ <u-input type="number" v-model="form.stockQuantity" placeholder="输入库存数量" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="item">
|
|
<view class="item">
|
|
@@ -107,8 +107,14 @@
|
|
|
可用时间<span>*</span>
|
|
可用时间<span>*</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker set">
|
|
<view class="picker set">
|
|
|
- 去设置
|
|
|
|
|
- <u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
|
|
|
|
|
|
|
+ <view class="picker set inp" @click="setUsable" v-if="showSellDate == ''">
|
|
|
|
|
+ <u-input placeholder="去设置" />
|
|
|
|
|
+ <u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="picker set inp" @click="setUsable" v-else>
|
|
|
|
|
+ {{showSellDate}}
|
|
|
|
|
+ <u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="item">
|
|
<view class="item">
|
|
@@ -116,7 +122,7 @@
|
|
|
需要预约<span>*</span>
|
|
需要预约<span>*</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker set">
|
|
<view class="picker set">
|
|
|
- <u-switch v-model="form.checked" style="margin-left:8rpx;" size="28"></u-switch>
|
|
|
|
|
|
|
+ <u-switch v-model="makeChecked" style="margin-left:8rpx;" size="28"></u-switch>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="item">
|
|
<view class="item">
|
|
@@ -138,10 +144,10 @@
|
|
|
使用说明
|
|
使用说明
|
|
|
</view>
|
|
</view>
|
|
|
<view class="textarea">
|
|
<view class="textarea">
|
|
|
- <u-input v-model="form.num" type="textarea" placeholder="输入库存数量" maxlength="500" />
|
|
|
|
|
|
|
+ <u-input v-model="form.instructions" type="textarea" placeholder="输入库存数量" maxlength="500" />
|
|
|
</view>
|
|
</view>
|
|
|
<view class="num">
|
|
<view class="num">
|
|
|
- 0/500
|
|
|
|
|
|
|
+ {{form.instructions.length}}/500
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -154,12 +160,12 @@
|
|
|
<view class="back" @click="schedule-=1">
|
|
<view class="back" @click="schedule-=1">
|
|
|
上一步
|
|
上一步
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="submit">
|
|
|
|
|
|
|
+ <view class="submit" @click="submit">
|
|
|
提交审核
|
|
提交审核
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <DateSelector @confirm="handleConfirm" @close="closeSelectDate" v-if="isSelectDate" />
|
|
|
|
|
|
|
+ <rangTime ref="rangTime" :mode="mode" @onSubmit="onEndTimeChange" />
|
|
|
<refund v-if="isRefund" @confirm="saveFound" @close="cutRule" />
|
|
<refund v-if="isRefund" @confirm="saveFound" @close="cutRule" />
|
|
|
<view class="popup" v-if="isSelectType">
|
|
<view class="popup" v-if="isSelectType">
|
|
|
<view class="model">
|
|
<view class="model">
|
|
@@ -198,16 +204,20 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- // import DateSelector from '@/components/product/select_date.vue'
|
|
|
|
|
|
|
+ import rangTime from '../../components/dengrq-datetime-picker/dateSelector/index.vue'
|
|
|
import refund from '@/components/product/refund.vue'
|
|
import refund from '@/components/product/refund.vue'
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
- // DateSelector,
|
|
|
|
|
|
|
+ rangTime,
|
|
|
refund
|
|
refund
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ mode: 1,
|
|
|
form: {
|
|
form: {
|
|
|
|
|
+ instructions: '',
|
|
|
|
|
+ preBook: 0,
|
|
|
|
|
+ merchantId: null
|
|
|
// categoryId:'',
|
|
// categoryId:'',
|
|
|
// productName: '',
|
|
// productName: '',
|
|
|
// productImage: '',
|
|
// productImage: '',
|
|
@@ -219,7 +229,7 @@
|
|
|
fmImageList: [], //封面图
|
|
fmImageList: [], //封面图
|
|
|
xqImage: [], //详情图
|
|
xqImage: [], //详情图
|
|
|
showRule: '', //显示退款规则文字
|
|
showRule: '', //显示退款规则文字
|
|
|
- action: 'http://192.168.0.52:8080/jeecg-boot/sys/common/upload', //图片上传地址
|
|
|
|
|
|
|
+ action: 'http://192.168.0.36:8080/jeecg-boot/sys/common/upload', //图片上传地址
|
|
|
schedule: 1, //进度
|
|
schedule: 1, //进度
|
|
|
fileList: [],
|
|
fileList: [],
|
|
|
selectedTime: null,
|
|
selectedTime: null,
|
|
@@ -234,7 +244,11 @@
|
|
|
currentRight: 0, //三级选中
|
|
currentRight: 0, //三级选中
|
|
|
productType: [], //选中的商品分类id
|
|
productType: [], //选中的商品分类id
|
|
|
selectTypeList: [], //选中的商品分类名称
|
|
selectTypeList: [], //选中的商品分类名称
|
|
|
- showText: ''
|
|
|
|
|
|
|
+ showText: '',
|
|
|
|
|
+ showDate: '',
|
|
|
|
|
+ showSellDate: '',
|
|
|
|
|
+ makeChecked: false,
|
|
|
|
|
+ imageHttp:'http://192.168.0.36:8080/jeecg-boot/'//上传图片前缀
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -247,7 +261,7 @@
|
|
|
files = this.$refs.uUpload.lists.filter(val => {
|
|
files = this.$refs.uUpload.lists.filter(val => {
|
|
|
return val.progress == 100;
|
|
return val.progress == 100;
|
|
|
})
|
|
})
|
|
|
- this.form.productImage = files[0].response.message
|
|
|
|
|
|
|
+ this.form.productImage =this.imageHttp + files[0].response.message
|
|
|
}
|
|
}
|
|
|
// 详情图处理
|
|
// 详情图处理
|
|
|
if (this.$refs.dUpload.lists.length > 0) {
|
|
if (this.$refs.dUpload.lists.length > 0) {
|
|
@@ -258,12 +272,12 @@
|
|
|
})
|
|
})
|
|
|
let temp = []
|
|
let temp = []
|
|
|
files.map(item => {
|
|
files.map(item => {
|
|
|
- temp.push(item.response.message)
|
|
|
|
|
|
|
+ temp.push(this.imageHttp+item.response.message)
|
|
|
})
|
|
})
|
|
|
this.form.detailImages = temp.join(',')
|
|
this.form.detailImages = temp.join(',')
|
|
|
}
|
|
}
|
|
|
//基础信息必填提示
|
|
//基础信息必填提示
|
|
|
- console.log(this.form)
|
|
|
|
|
|
|
+ console.log(this.form)
|
|
|
if (!this.form.categoryId) {
|
|
if (!this.form.categoryId) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '请选择商品分类',
|
|
title: '请选择商品分类',
|
|
@@ -299,16 +313,16 @@
|
|
|
});
|
|
});
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- if (!this.form.detailImages) {
|
|
|
|
|
|
|
+ if (!this.form.soldPrice) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '请输入商品售价',
|
|
title: '请输入商品售价',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
});
|
|
});
|
|
|
return
|
|
return
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
this.schedule += 1
|
|
this.schedule += 1
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
// 跳转至组合商品页
|
|
// 跳转至组合商品页
|
|
|
goGroup() {
|
|
goGroup() {
|
|
@@ -318,9 +332,9 @@
|
|
|
},
|
|
},
|
|
|
//返回
|
|
//返回
|
|
|
back() {
|
|
back() {
|
|
|
- uni.navigateBack({
|
|
|
|
|
- delta: 1
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pages/product/index'
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
// 处理 confirm 事件,接收子组件传递的时间段数据
|
|
// 处理 confirm 事件,接收子组件传递的时间段数据
|
|
|
handleConfirm(time) {
|
|
handleConfirm(time) {
|
|
@@ -338,12 +352,6 @@
|
|
|
url: '/pages/product/usable'
|
|
url: '/pages/product/usable'
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- //跳转至预约规则
|
|
|
|
|
- setRule() {
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: '/pages/product/rule'
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
// 保存退款规则
|
|
// 保存退款规则
|
|
|
saveFound(rules) {
|
|
saveFound(rules) {
|
|
|
console.log(rules)
|
|
console.log(rules)
|
|
@@ -443,6 +451,56 @@
|
|
|
//关闭选择分类弹窗
|
|
//关闭选择分类弹窗
|
|
|
closePopup() {
|
|
closePopup() {
|
|
|
this.isSelectType = false
|
|
this.isSelectType = false
|
|
|
|
|
+ },
|
|
|
|
|
+ selectDate() {
|
|
|
|
|
+ // this.isSelectDate = true
|
|
|
|
|
+ this.$refs.rangTime.open()
|
|
|
|
|
+ },
|
|
|
|
|
+ onEndTimeChange(val) {
|
|
|
|
|
+ this.form.saleStartDate = val.startDate
|
|
|
|
|
+ this.form.saleEndDate = val.endDate
|
|
|
|
|
+ console.log(this.form.saleStartDate, this.form.saleEndDate)
|
|
|
|
|
+ this.showDate = val.startDate + '-' + val.endDate
|
|
|
|
|
+ this.$forceUpdate(); // 强制刷新视图
|
|
|
|
|
+ },
|
|
|
|
|
+ //提交审核
|
|
|
|
|
+ submit() {
|
|
|
|
|
+ this.makeChecked ? this.form.preBook = 1 : this.form.preBook = 0
|
|
|
|
|
+ if (!this.form.saleStartDate) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '请设置售卖时间',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ } else if (!this.form.stockQuantity) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '请输入商品库存',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ } else if (!this.form.availableEndDate && !this.form.expirationDays) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '请选择可用时间',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$http.post("/app/product/add", this.form).then(res => {
|
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '添加成功',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.removeStorage({
|
|
|
|
|
+ key: 'smdate',
|
|
|
|
|
+ });
|
|
|
|
|
+ uni.removeStorage({
|
|
|
|
|
+ key: 'group',
|
|
|
|
|
+ });
|
|
|
|
|
+ // this.back()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -452,11 +510,38 @@
|
|
|
if (options.data) {
|
|
if (options.data) {
|
|
|
let objStr = decodeURIComponent(options.data); // 获取并解码参数
|
|
let objStr = decodeURIComponent(options.data); // 获取并解码参数
|
|
|
let obj = JSON.parse(objStr); // 将字符串转换回对象
|
|
let obj = JSON.parse(objStr); // 将字符串转换回对象
|
|
|
-
|
|
|
|
|
this.form.productGroups = obj
|
|
this.form.productGroups = obj
|
|
|
- console.log(this.form.productGroups);
|
|
|
|
|
|
|
+ console.log(this.form.productGroups);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ uni.getStorage({
|
|
|
|
|
+ key: 'login_user_info',
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ that.form.merchantId = res.data.id
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ uni.getStorage({
|
|
|
|
|
+ key: 'smdate',
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ if (res.data.availableEndDate) {
|
|
|
|
|
+ that.showSellDate = res.data.availableStartDate + '-' + res.data.availableEndDate
|
|
|
|
|
+ that.form.availableStartDate = res.data.availableStartDate
|
|
|
|
|
+ that.form.availableEndDate = res.data.availableEndDate
|
|
|
|
|
+
|
|
|
|
|
+ } else if (res.data.expirationDays) {
|
|
|
|
|
+ that.form.expirationDays = res.data.expirationDays
|
|
|
|
|
+ that.showSellDate = res.data.expirationDays
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ uni.getStorage({
|
|
|
|
|
+ key: 'group',
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ that.form.productGroups = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|