|
@@ -206,12 +206,10 @@
|
|
|
可用时间<span>*</span>
|
|
可用时间<span>*</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker set">
|
|
<view class="picker set">
|
|
|
- <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>
|
|
|
|
|
- <span style="color: #333333;">{{ showSellDate }}</span>
|
|
|
|
|
|
|
+ <view class="picker set inp" @click="setUsable">
|
|
|
|
|
+ <text :style="{
|
|
|
|
|
+ color: showSellDate ? '#333333' : '#c0c4cc'
|
|
|
|
|
+ }">{{ showSellDate || '去设置' }}</text>
|
|
|
<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>
|
|
@@ -376,6 +374,58 @@
|
|
|
groupOptions: [],
|
|
groupOptions: [],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.getProductGroup()
|
|
|
|
|
+ this.getLeftTree()
|
|
|
|
|
+ this.getForm()
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad(options) {
|
|
|
|
|
+ if (options.productId) {
|
|
|
|
|
+ this.productId = options.productId
|
|
|
|
|
+ }
|
|
|
|
|
+ if (options.tabIndex) {
|
|
|
|
|
+ this.tabIndex = options.tabIndex
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ uni.getStorage({
|
|
|
|
|
+ key: 'login_user_info',
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ that.form.merchantId = res.data.merchantId
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ uni.getStorage({
|
|
|
|
|
+ key: 'smdate',
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.data.availableEndDate) {
|
|
|
|
|
+ this.showSellDate = res.data.availableStartDate + '-' + res.data.availableEndDate
|
|
|
|
|
+ this.form.availableStartDate = res.data.availableStartDate
|
|
|
|
|
+ this.form.availableEndDate = res.data.availableEndDate
|
|
|
|
|
+ this.form.expirationDays = null
|
|
|
|
|
+ this.form.useType = 2
|
|
|
|
|
+ } else if (res.data.expirationDays) {
|
|
|
|
|
+ this.form.expirationDays = res.data.expirationDays
|
|
|
|
|
+ this.form.availableEndDate = null
|
|
|
|
|
+ this.form.availableStartDate = null
|
|
|
|
|
+ this.form.useType = 1
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.showSellDate = res.data.expirationDays + '天后失效'
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(res.data.useType == 3){
|
|
|
|
|
+ this.form.useType = 3
|
|
|
|
|
+ this.showSellDate = '长期有效'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ uni.getStorage({
|
|
|
|
|
+ key: 'group',
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ that.form.productGroups = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
//全选
|
|
//全选
|
|
|
allSelect() {
|
|
allSelect() {
|
|
@@ -529,10 +579,10 @@
|
|
|
},
|
|
},
|
|
|
//跳转至可用时间
|
|
//跳转至可用时间
|
|
|
setUsable() {
|
|
setUsable() {
|
|
|
|
|
+ let str = this.$u.queryParams({ useType: this.form.useType })
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: '/pages/product/usable'
|
|
|
|
|
|
|
+ url: `/pages/product/usable${str}`
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
// 保存退款规则
|
|
// 保存退款规则
|
|
|
saveFound(rules) {
|
|
saveFound(rules) {
|
|
@@ -794,59 +844,6 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- mounted() {
|
|
|
|
|
- this.getProductGroup()
|
|
|
|
|
- this.getLeftTree()
|
|
|
|
|
- this.getForm()
|
|
|
|
|
- },
|
|
|
|
|
- onLoad(options) {
|
|
|
|
|
- if (options.productId) {
|
|
|
|
|
- this.productId = options.productId
|
|
|
|
|
- }
|
|
|
|
|
- if (options.tabIndex) {
|
|
|
|
|
- this.tabIndex = options.tabIndex
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
- onShow() {
|
|
|
|
|
- let that = this
|
|
|
|
|
- uni.getStorage({
|
|
|
|
|
- key: 'login_user_info',
|
|
|
|
|
- success: function(res) {
|
|
|
|
|
- that.form.merchantId = res.data.merchantId
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- uni.getStorage({
|
|
|
|
|
- key: 'smdate',
|
|
|
|
|
- success: (res) => {
|
|
|
|
|
- if (res.data.availableEndDate) {
|
|
|
|
|
- this.showSellDate = res.data.availableStartDate + '-' + res.data.availableEndDate
|
|
|
|
|
- this.form.availableStartDate = res.data.availableStartDate
|
|
|
|
|
- this.form.availableEndDate = res.data.availableEndDate
|
|
|
|
|
- this.form.expirationDays = null
|
|
|
|
|
- this.form.useType = 2
|
|
|
|
|
- } else if (res.data.expirationDays) {
|
|
|
|
|
- this.form.expirationDays = res.data.expirationDays
|
|
|
|
|
- this.form.availableEndDate = null
|
|
|
|
|
- this.form.availableStartDate = null
|
|
|
|
|
- this.form.useType = 1
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.showSellDate = res.data.expirationDays + '天后失效'
|
|
|
|
|
- });
|
|
|
|
|
- }else if(res.data.useType == 3){
|
|
|
|
|
- this.form.useType = 3
|
|
|
|
|
- this.showSellDate = '长期有效'
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- uni.getStorage({
|
|
|
|
|
- key: 'group',
|
|
|
|
|
- success: function(res) {
|
|
|
|
|
- that.form.productGroups = res.data
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|