commit
						44c88468d4
					
				|  | @ -85,6 +85,14 @@ module.exports = { | ||||||
|           limit: 10000, |           limit: 10000, | ||||||
|           name: utils.assetsPath('fonts/[name].[hash:7].[ext]') |           name: utils.assetsPath('fonts/[name].[hash:7].[ext]') | ||||||
|         } |         } | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         test: /\.(cur)(\?.*)?$/, | ||||||
|  |         loader: 'url-loader', | ||||||
|  |         options: { | ||||||
|  |           limit: 10000, | ||||||
|  |           name: utils.assetsPath('cur/[name].[hash:7].[ext]') | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     ] |     ] | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ | ||||||
|         <div class="c-left"> |         <div class="c-left"> | ||||||
|           <div> |           <div> | ||||||
|             <span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span> |             <span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span> | ||||||
|             <span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.discount}}</span>折</span> |             <span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.couponDiscount}}</span>折</span> | ||||||
|             <span class="describe">满{{item.consumeThreshold}}元可用</span> |             <span class="describe">满{{item.consumeThreshold}}元可用</span> | ||||||
|           </div> |           </div> | ||||||
|           <p>使用范围:{{useScope(item.scopeType, item.storeName)}}</p> |           <p>使用范围:{{useScope(item.scopeType, item.storeName)}}</p> | ||||||
|  |  | ||||||
|  | @ -38,7 +38,7 @@ | ||||||
|             <div class="c-left"> |             <div class="c-left"> | ||||||
|               <div> |               <div> | ||||||
|                 <span v-if="coupon.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{coupon.price | unitPrice}}</span></span> |                 <span v-if="coupon.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{coupon.price | unitPrice}}</span></span> | ||||||
|                 <span v-if="coupon.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{coupon.discount}}</span>折</span> |                 <span v-if="coupon.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{coupon.couponDiscount}}</span>折</span> | ||||||
|                 <span class="describe">满{{coupon.consumeThreshold}}元可用</span> |                 <span class="describe">满{{coupon.consumeThreshold}}元可用</span> | ||||||
|               </div> |               </div> | ||||||
|               <p>使用范围:{{useScope(coupon.scopeType, coupon.storeName)}}</p> |               <p>使用范围:{{useScope(coupon.scopeType, coupon.storeName)}}</p> | ||||||
|  |  | ||||||
|  | @ -56,8 +56,8 @@ | ||||||
|                       <Rate disabled :value="Number(item.descriptionScore)" allow-half class="remarks-star"></Rate> |                       <Rate disabled :value="Number(item.descriptionScore)" allow-half class="remarks-star"></Rate> | ||||||
|                     </p> |                     </p> | ||||||
|                     <p class="remarks-content">{{item.content}}</p> |                     <p class="remarks-content">{{item.content}}</p> | ||||||
|                     <div class="comment-img" v-if="item.image"> |                     <div class="comment-img" v-if="item.images"> | ||||||
|                       <div v-for="(img, imgIndex) in item.image.split(',')" |                       <div v-for="(img, imgIndex) in item.images.split(',')" | ||||||
|                        @click="previewImg(img, item)" |                        @click="previewImg(img, item)" | ||||||
|                        :class="{borderColor:img === item.previewImg}" |                        :class="{borderColor:img === item.previewImg}" | ||||||
|                        :key="imgIndex"> |                        :key="imgIndex"> | ||||||
|  |  | ||||||
|  | @ -53,16 +53,19 @@ | ||||||
|         </li> |         </li> | ||||||
|         <li class="hover-color" @click="goUserCenter('/home/MyOrder')"><span class="nav-item">我的订单</span></li> |         <li class="hover-color" @click="goUserCenter('/home/MyOrder')"><span class="nav-item">我的订单</span></li> | ||||||
|         <li class="hover-color" @click="goUserCenter('/home/MyTracks')"><span class="nav-item">我的足迹</span></li> |         <li class="hover-color" @click="goUserCenter('/home/MyTracks')"><span class="nav-item">我的足迹</span></li> | ||||||
|         <li v-if="$route.name !== 'Cart'" style="position:relative;" @mouseenter="getCartList"> |         <li v-if="$route.name !== 'Cart'" style="position:relative;" > | ||||||
|           <i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i> |           <i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i> | ||||||
|           <Dropdown placement="bottom-start"> |           <Dropdown placement="bottom-start"> | ||||||
|             <router-link to="cart" target="_blank"> |             <router-link to="cart" target="_blank" > | ||||||
|  |               <span @mouseenter="getCartList"> | ||||||
|                 <Icon |                 <Icon | ||||||
|                   size="18" |                   size="18" | ||||||
|                   class="cart-icon" |                   class="cart-icon" | ||||||
|                   type="ios-cart-outline" |                   type="ios-cart-outline" | ||||||
|                 ></Icon> |                 ></Icon> | ||||||
|                 购物车 |                 购物车 | ||||||
|  |               </span> | ||||||
|  |                | ||||||
|             </router-link> |             </router-link> | ||||||
| 
 | 
 | ||||||
|             <DropdownMenu slot="list"> |             <DropdownMenu slot="list"> | ||||||
|  | @ -115,7 +118,7 @@ | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import storage from '@/plugins/storage.js'; | import storage from '@/plugins/storage.js'; | ||||||
| import {cartGoodsAll, cartCount} from '@/api/cart.js' | import {cartGoodsAll} from '@/api/cart.js' | ||||||
| export default { | export default { | ||||||
|   name: 'M-Header', |   name: 'M-Header', | ||||||
|   created () { |   created () { | ||||||
|  | @ -211,12 +214,11 @@ export default { | ||||||
|     }, |     }, | ||||||
|     getCartList () { // 获取购物车列表 |     getCartList () { // 获取购物车列表 | ||||||
|       if (this.userInfo.username) { |       if (this.userInfo.username) { | ||||||
|         cartCount().then(res => { |            | ||||||
|           this.$store.commit('SET_CARTNUM', res.result) |  | ||||||
|           this.Cookies.setItem('cartNum', res.result) |  | ||||||
|         }) |  | ||||||
|         cartGoodsAll().then(res => { |         cartGoodsAll().then(res => { | ||||||
|           this.shoppingCart = res.result.skuList |           this.shoppingCart = res.result.skuList | ||||||
|  |           this.$store.commit('SET_CARTNUM', this.shoppingCart.length) | ||||||
|  |           this.Cookies.setItem('cartNum', this.shoppingCart.length) | ||||||
|         }) |         }) | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
|       <template v-else> |       <template v-else> | ||||||
|         <div style="font-size:14px">全部结果</div> |         <div style="font-size:14px">全部结果</div> | ||||||
|         <Icon type="ios-arrow-forward" /> |         <Icon type="ios-arrow-forward" /> | ||||||
|         <div>{{params.keyword}}</div> |         <div style="font-weight:bold;" class="mr_10">“{{params.keyword}}”</div> | ||||||
|       </template> |       </template> | ||||||
|       <!-- 所选分类 --> |       <!-- 所选分类 --> | ||||||
|       <a |       <a | ||||||
|  | @ -41,8 +41,7 @@ | ||||||
|         :key="index" |         :key="index" | ||||||
|         :title="item.name" |         :title="item.name" | ||||||
|       > |       > | ||||||
|         <span>{{ item.type }}:</span><span>{{ item.name }}</span |         <span>{{ item.type }}:</span><span>{{ item.name }}</span><Icon type="md-close" /> | ||||||
|         ><Icon type="md-close" /> |  | ||||||
|       </a> |       </a> | ||||||
|     </div> |     </div> | ||||||
| 
 | 
 | ||||||
|  | @ -190,8 +189,10 @@ export default { | ||||||
|     selectedItem: { |     selectedItem: { | ||||||
|       // 监听已选条件,来调用列表接口 |       // 监听已选条件,来调用列表接口 | ||||||
|       handler (val) { |       handler (val) { | ||||||
|  |         console.log(val); | ||||||
|         let classification = []; |         let classification = []; | ||||||
|         if (val.length) { |         this.params.brandId = '' | ||||||
|  |         this.params.prop = '' | ||||||
|         val.forEach((item) => { |         val.forEach((item) => { | ||||||
|           if (item.type === '品牌') { |           if (item.type === '品牌') { | ||||||
|             this.params.brandId = this.brandIds.join('@'); |             this.params.brandId = this.brandIds.join('@'); | ||||||
|  | @ -203,10 +204,6 @@ export default { | ||||||
|           } |           } | ||||||
|         }); |         }); | ||||||
|         this.params.prop = classification.join('@'); |         this.params.prop = classification.join('@'); | ||||||
|         } else { |  | ||||||
|           this.params.prop = '' |  | ||||||
|           this.params.brandId = '' |  | ||||||
|         } |  | ||||||
|         this.getFilterList(this.params); |         this.getFilterList(this.params); | ||||||
|         this.$emit('getParams', this.params); |         this.$emit('getParams', this.params); | ||||||
|       }, |       }, | ||||||
|  | @ -251,7 +248,7 @@ export default { | ||||||
|         this.$set(this.tabBar, 'second', second) |         this.$set(this.tabBar, 'second', second) | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     cateClick (item, index) { |     cateClick (item, index) {  // 点选分类 | ||||||
|       switch (index) { |       switch (index) { | ||||||
|         case 1: |         case 1: | ||||||
|           this.$router.push({ |           this.$router.push({ | ||||||
|  | @ -299,7 +296,6 @@ export default { | ||||||
| 
 | 
 | ||||||
|           brands.forEach((val) => { |           brands.forEach((val) => { | ||||||
|             if (val.name === item) this.brandIds.push(val.value); |             if (val.name === item) this.brandIds.push(val.value); | ||||||
|             console.log(this.brandIds); |  | ||||||
|           }); |           }); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  |  | ||||||
|  | @ -50,7 +50,7 @@ | ||||||
|               <div v-if="couponAvailable === index"> |               <div v-if="couponAvailable === index"> | ||||||
|                 <div class="coupon-item" v-for="(item, index) in shop.couponList" :key="index"> |                 <div class="coupon-item" v-for="(item, index) in shop.couponList" :key="index"> | ||||||
|                   <span v-if="item.couponType === 'PRICE'">¥{{ item.price }}</span> |                   <span v-if="item.couponType === 'PRICE'">¥{{ item.price }}</span> | ||||||
|                   <span v-if="item.couponType === 'DISCOUNT'">{{ item.discount }}折</span> |                   <span v-if="item.couponType === 'DISCOUNT'">{{ item.couponDiscount }}折</span> | ||||||
|                   <span>满{{item.consumeThreshold}}元可用</span> |                   <span>满{{item.consumeThreshold}}元可用</span> | ||||||
|                   <Button class="coupon-btn" size="small" type="primary" @click="receiveShopCoupon(item)" :disabled="item.disabled">{{ item.disabled ? "已领取" : "领取" }}</Button> |                   <Button class="coupon-btn" size="small" type="primary" @click="receiveShopCoupon(item)" :disabled="item.disabled">{{ item.disabled ? "已领取" : "领取" }}</Button> | ||||||
|                 </div> |                 </div> | ||||||
|  |  | ||||||
|  | @ -19,7 +19,7 @@ | ||||||
|             <div class="c-left"> |             <div class="c-left"> | ||||||
|               <div> |               <div> | ||||||
|                 <span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span> |                 <span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span> | ||||||
|                 <span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.discount}}</span>折</span> |                 <span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.couponDiscount}}</span>折</span> | ||||||
|                 <span class="describe">满{{item.consumeThreshold}}元可用</span> |                 <span class="describe">满{{item.consumeThreshold}}元可用</span> | ||||||
|               </div> |               </div> | ||||||
|               <p>使用范围:{{useScope(item.scopeType, item.storeName)}}</p> |               <p>使用范围:{{useScope(item.scopeType, item.storeName)}}</p> | ||||||
|  |  | ||||||
|  | @ -113,7 +113,7 @@ | ||||||
|                         <div class="c-left"> |                         <div class="c-left"> | ||||||
|                         <div> |                         <div> | ||||||
|                             <span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span> |                             <span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span> | ||||||
|                             <span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.discount}}</span>折</span> |                             <span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.couponDiscount}}</span>折</span> | ||||||
|                             <span class="describe">满{{item.consumeThreshold}}元可用</span> |                             <span class="describe">满{{item.consumeThreshold}}元可用</span> | ||||||
|                         </div> |                         </div> | ||||||
|                         <p>使用范围:{{useScope(item.scopeType)}}</p> |                         <p>使用范围:{{useScope(item.scopeType)}}</p> | ||||||
|  |  | ||||||
|  | @ -147,7 +147,7 @@ export default { | ||||||
|               { |               { | ||||||
|                 style: {}, |                 style: {}, | ||||||
|               }, |               }, | ||||||
|               this.$options.filters.unitPrice(params.row.price) |               this.$options.filters.unitPrice(params.row.price, '¥') | ||||||
|             ); |             ); | ||||||
|           }, |           }, | ||||||
|         }, |         }, | ||||||
|  |  | ||||||
|  | @ -174,7 +174,6 @@ export default { | ||||||
|         { |         { | ||||||
|           title: "领取数量/总数量", |           title: "领取数量/总数量", | ||||||
|           key: "publishNum", |           key: "publishNum", | ||||||
|           width: 100, |  | ||||||
|           render: (h, params) => { |           render: (h, params) => { | ||||||
|             return h( |             return h( | ||||||
|               "div", params.row.receivedNum + "/" + params.row.publishNum) |               "div", params.row.receivedNum + "/" + params.row.publishNum) | ||||||
|  | @ -214,7 +213,6 @@ export default { | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           title: "活动时间", |           title: "活动时间", | ||||||
|           minWidth: 120, |  | ||||||
|           render: (h, params) => { |           render: (h, params) => { | ||||||
|             return h("div", { |             return h("div", { | ||||||
|               domProps: |               domProps: | ||||||
|  |  | ||||||
|  | @ -14,7 +14,7 @@ | ||||||
|               }}</span> |               }}</span> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|             <FormItem label="面额"> |             <FormItem label="面额"> | ||||||
|               <span class="goods-category-name"> ¥{{ form.price }}</span> |               <span class="goods-category-name"> ¥{{ form.price | unitPrice }}</span> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|             <FormItem label="活动说明"> |             <FormItem label="活动说明"> | ||||||
|               <span class="goods-category-name">{{ form.description }}</span> |               <span class="goods-category-name">{{ form.description }}</span> | ||||||
|  |  | ||||||
|  | @ -49,11 +49,15 @@ | ||||||
|             <FormItem label="领取限制" prop="couponLimitNum"> |             <FormItem label="领取限制" prop="couponLimitNum"> | ||||||
|               <Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px" /> |               <Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px" /> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|             <FormItem label="有效期" prop="startTime"> |             <FormItem label="有效期" prop="rangeTime"> | ||||||
|               <DatePicker type="datetime" v-model="form.startTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" clearable style="width: 200px"> |               <DatePicker | ||||||
|               </DatePicker> |                 type="datetimerange" | ||||||
|               - |                 v-model="form.rangeTime" | ||||||
|               <DatePicker type="datetime" v-model="form.endTime" format="yyyy-MM-dd HH:mm:ss" :options="options" placeholder="请选择" clearable style="width: 200px"> |                 format="yyyy-MM-dd HH:mm:ss" | ||||||
|  |                 placeholder="请选择" | ||||||
|  |                 :options="options" | ||||||
|  |                 style="width: 260px" | ||||||
|  |               > | ||||||
|               </DatePicker> |               </DatePicker> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|             <FormItem label="使用范围" prop="scopeType"> |             <FormItem label="使用范围" prop="scopeType"> | ||||||
|  | @ -135,20 +139,6 @@ export default { | ||||||
|         callback(); |         callback(); | ||||||
|       } |       } | ||||||
|     }; |     }; | ||||||
|     const isLtEndDate = (rule, value, callback) => { |  | ||||||
|       if (new Date(value).getTime() > new Date(this.form.endTime).getTime()) { |  | ||||||
|         callback(new Error()); |  | ||||||
|       } else { |  | ||||||
|         callback(); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
|     const isGtStartDate = (rule, value, callback) => { |  | ||||||
|       if (new Date(value).getTime() < new Date(this.form.startTime).getTime()) { |  | ||||||
|         callback(new Error()); |  | ||||||
|       } else { |  | ||||||
|         callback(); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
|     return { |     return { | ||||||
|       modalType: 0, // 是否编辑 |       modalType: 0, // 是否编辑 | ||||||
|       form: { |       form: { | ||||||
|  | @ -186,34 +176,11 @@ export default { | ||||||
|           { required: true, message: "请输入面额" }, |           { required: true, message: "请输入面额" }, | ||||||
|           { validator: checkPrice }, |           { validator: checkPrice }, | ||||||
|         ], |         ], | ||||||
|  |         rangeTime: [{ required: true, message: "请选择优惠券有效期" }], | ||||||
|         consumeThreshold: [ |         consumeThreshold: [ | ||||||
|           { required: true, message: "请输入消费门槛" }, |           { required: true, message: "请输入消费门槛" }, | ||||||
|           { validator: checkWeight }, |           { validator: checkWeight }, | ||||||
|         ], |         ], | ||||||
|         startTime: [ |  | ||||||
|           { |  | ||||||
|             required: true, |  | ||||||
|             type: "date", |  | ||||||
|             message: "请选择开始时间", |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             trigger: "change", |  | ||||||
|             message: "开始时间要小于结束时间", |  | ||||||
|             validator: isLtEndDate, |  | ||||||
|           }, |  | ||||||
|         ], |  | ||||||
|         endTime: [ |  | ||||||
|           { |  | ||||||
|             required: true, |  | ||||||
|             type: "date", |  | ||||||
|             message: "请选择结束时间", |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             trigger: "change", |  | ||||||
|             message: "结束时间要大于开始时间", |  | ||||||
|             validator: isGtStartDate, |  | ||||||
|           }, |  | ||||||
|         ], |  | ||||||
|         couponDiscount: [ |         couponDiscount: [ | ||||||
|           { required: true, message: "请输入折扣" }, |           { required: true, message: "请输入折扣" }, | ||||||
|           { |           { | ||||||
|  | @ -337,6 +304,8 @@ export default { | ||||||
|           next(this.goodsCategoryList, []); |           next(this.goodsCategoryList, []); | ||||||
|           data.scopeIdGoods = prevCascader; |           data.scopeIdGoods = prevCascader; | ||||||
|         } |         } | ||||||
|  |         data.rangeTime = []; | ||||||
|  |         data.rangeTime.push(new Date(data.startTime), new Date(data.endTime)); | ||||||
|         this.form = data; |         this.form = data; | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|  | @ -345,15 +314,14 @@ export default { | ||||||
|       this.$refs.form.validate((valid) => { |       this.$refs.form.validate((valid) => { | ||||||
|         if (valid) { |         if (valid) { | ||||||
|           const params = JSON.parse(JSON.stringify(this.form)); |           const params = JSON.parse(JSON.stringify(this.form)); | ||||||
|           const strat = this.$options.filters.unixToDate( |           params.startTime = this.$options.filters.unixToDate( | ||||||
|             this.form.startTime / 1000 |             this.form.rangeTime[0] / 1000 | ||||||
|           ); |           ); | ||||||
|           const end = this.$options.filters.unixToDate( |           params.endTime = this.$options.filters.unixToDate( | ||||||
|             this.form.endTime / 1000 |             this.form.rangeTime[1] / 1000 | ||||||
|           ); |           ); | ||||||
|  |           delete params.rangeTime | ||||||
|           let scopeId = []; |           let scopeId = []; | ||||||
|           params.startTime = strat; |  | ||||||
|           params.endTime = end; |  | ||||||
| 
 | 
 | ||||||
|           if ( |           if ( | ||||||
|             params.scopeType == "PORTION_GOODS" && |             params.scopeType == "PORTION_GOODS" && | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ | ||||||
|               <div>{{ form.goodsSku.sellerName }}</div> |               <div>{{ form.goodsSku.sellerName }}</div> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|             <FormItem label="商品价格" prop="goodsPrice"> |             <FormItem label="商品价格" prop="goodsPrice"> | ||||||
|               <div>{{ form.goodsSku.price }}</div> |               <div>{{ form.goodsSku.price | unitPrice('¥') }}</div> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|             <FormItem label="库存" prop="quantity"> |             <FormItem label="库存" prop="quantity"> | ||||||
|               <div>{{ form.goodsSku.quantity }}</div> |               <div>{{ form.goodsSku.quantity }}</div> | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ export default { | ||||||
|           render: (h, params) => { |           render: (h, params) => { | ||||||
|             return h( |             return h( | ||||||
|               "div", |               "div", | ||||||
|               this.$options.filters.unitPrice(params.row.price) |               this.$options.filters.unitPrice(params.row.price, '¥') | ||||||
|             ); |             ); | ||||||
|           }, |           }, | ||||||
|         }, |         }, | ||||||
|  |  | ||||||
|  | @ -183,13 +183,14 @@ export default { | ||||||
|         { |         { | ||||||
|           title: "商品价格", |           title: "商品价格", | ||||||
|           key: "price", |           key: "price", | ||||||
|           minWidth: 120 |           render: (h, params) => { | ||||||
|  |             return h('div', this.$options.filters.unitPrice(params.row.price, '¥')) | ||||||
|  |           } | ||||||
|         }, |         }, | ||||||
| 
 | 
 | ||||||
|         { |         { | ||||||
|           title: "商品库存", |           title: "商品库存", | ||||||
|           key: "quantity", |           key: "quantity", | ||||||
|           minWidth: 120 |  | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           title: "创建时间", |           title: "创建时间", | ||||||
|  | @ -200,7 +201,7 @@ export default { | ||||||
|           title: "操作", |           title: "操作", | ||||||
|           key: "action", |           key: "action", | ||||||
|           align: "center", |           align: "center", | ||||||
|           width: 200, |           width: 150, | ||||||
|           render: (h, params) => { |           render: (h, params) => { | ||||||
|             return h("div", [ |             return h("div", [ | ||||||
|               h( |               h( | ||||||
|  |  | ||||||
|  | @ -166,7 +166,7 @@ | ||||||
|             <Icon class="icon" size="31" type="ios-card" /> |             <Icon class="icon" size="31" type="ios-card" /> | ||||||
|           </div> |           </div> | ||||||
|           <div> |           <div> | ||||||
|             <div class="counts">{{homeData.orderPrice ||0}}</div> |             <div class="counts">{{homeData.orderPrice || 0 | unitPrice('¥')}}</div> | ||||||
|             <div>订单总额</div> |             <div>订单总额</div> | ||||||
|           </div> |           </div> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,6 @@ | ||||||
|   <div> |   <div> | ||||||
|     <Row class="header"> |     <Row class="header"> | ||||||
|       <img src="../../assets/lili.png" class="logo" width="220px"> |       <img src="../../assets/lili.png" class="logo" width="220px"> | ||||||
| 
 |  | ||||||
|     </Row> |     </Row> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
|  | @ -173,7 +173,7 @@ | ||||||
|                 </dt> |                 </dt> | ||||||
|                 <dd> |                 <dd> | ||||||
|                   <a>{{ complaintInfo.goodsName }}</a><br> |                   <a>{{ complaintInfo.goodsName }}</a><br> | ||||||
|                   <span>{{ complaintInfo.goodsPrice | unitPrice }} * {{ complaintInfo.num }}(数量)</span> |                   <span>¥{{ complaintInfo.goodsPrice | unitPrice }} * {{ complaintInfo.num }}(数量)</span> | ||||||
|                 </dd> |                 </dd> | ||||||
|               </dl> |               </dl> | ||||||
| 
 | 
 | ||||||
|  | @ -201,7 +201,7 @@ | ||||||
|                   订单金额 |                   订单金额 | ||||||
|                 </dt> |                 </dt> | ||||||
|                 <dd> |                 <dd> | ||||||
|                   {{ complaintInfo.orderPrice }} |                   {{ complaintInfo.orderPrice | unitPrice('¥')}} | ||||||
|                 </dd> |                 </dd> | ||||||
|               </dl> |               </dl> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -90,26 +90,14 @@ | ||||||
|                 style="width: 260px" |                 style="width: 260px" | ||||||
|               /> |               /> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|             <FormItem label="有效期" prop="startTime"> |             <FormItem label="有效期" prop="rangeTime"> | ||||||
|               <DatePicker |               <DatePicker | ||||||
|                 type="datetime" |                 type="datetimerange" | ||||||
|                 v-model="form.startTime" |                 v-model="form.rangeTime" | ||||||
|                 format="yyyy-MM-dd HH:mm:ss" |                 format="yyyy-MM-dd HH:mm:ss" | ||||||
|                 placeholder="请选择" |                 placeholder="请选择" | ||||||
|                 :options="options" |                 :options="options" | ||||||
|                 clearable |                 style="width: 260px" | ||||||
|                 style="width: 200px" |  | ||||||
|               > |  | ||||||
|               </DatePicker> |  | ||||||
|               - |  | ||||||
|               <DatePicker |  | ||||||
|                 type="datetime" |  | ||||||
|                 v-model="form.endTime" |  | ||||||
|                 format="yyyy-MM-dd HH:mm:ss" |  | ||||||
|                 :options="options" |  | ||||||
|                 placeholder="请选择" |  | ||||||
|                 clearable |  | ||||||
|                 style="width: 200px" |  | ||||||
|               > |               > | ||||||
|               </DatePicker> |               </DatePicker> | ||||||
|             </FormItem> |             </FormItem> | ||||||
|  | @ -225,20 +213,7 @@ export default { | ||||||
|         callback(); |         callback(); | ||||||
|       } |       } | ||||||
|     }; |     }; | ||||||
|     const isLtEndDate = (rule, value, callback) => { |     | ||||||
|       if (new Date(value).getTime() > new Date(this.form.endTime).getTime()) { |  | ||||||
|         callback(new Error()); |  | ||||||
|       } else { |  | ||||||
|         callback(); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
|     const isGtStartDate = (rule, value, callback) => { |  | ||||||
|       if (new Date(value).getTime() < new Date(this.form.startTime).getTime()) { |  | ||||||
|         callback(new Error()); |  | ||||||
|       } else { |  | ||||||
|         callback(); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
|     return { |     return { | ||||||
|       modalType: 0, // 判断是新增还是编辑优惠券 0 新增  1 编辑 |       modalType: 0, // 判断是新增还是编辑优惠券 0 新增  1 编辑 | ||||||
|       categoryId: 0, // 分类id |       categoryId: 0, // 分类id | ||||||
|  | @ -281,30 +256,7 @@ export default { | ||||||
|           { required: true, message: "请输入消费门槛" }, |           { required: true, message: "请输入消费门槛" }, | ||||||
|           { validator: checkWeight }, |           { validator: checkWeight }, | ||||||
|         ], |         ], | ||||||
|         startTime: [ |         rangeTime: [{ required: true, message: "请选择优惠券有效期" }], | ||||||
|           { |  | ||||||
|             required: true, |  | ||||||
|             type: "date", |  | ||||||
|             message: "请选择开始时间", |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             trigger: "change", |  | ||||||
|             message: "开始时间要小于结束时间", |  | ||||||
|             validator: isLtEndDate, |  | ||||||
|           }, |  | ||||||
|         ], |  | ||||||
|         endTime: [ |  | ||||||
|           { |  | ||||||
|             required: true, |  | ||||||
|             type: "date", |  | ||||||
|             message: "请选择结束时间", |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             trigger: "change", |  | ||||||
|             message: "结束时间要大于开始时间", |  | ||||||
|             validator: isGtStartDate, |  | ||||||
|           }, |  | ||||||
|         ], |  | ||||||
|         couponDiscount: [ |         couponDiscount: [ | ||||||
|           { required: true, message: "请输入折扣" }, |           { required: true, message: "请输入折扣" }, | ||||||
|           { |           { | ||||||
|  | @ -425,6 +377,8 @@ export default { | ||||||
|           next(this.goodsCategoryList, []); |           next(this.goodsCategoryList, []); | ||||||
|           data.scopeIdGoods = prevCascader; |           data.scopeIdGoods = prevCascader; | ||||||
|         } |         } | ||||||
|  |         data.rangeTime = []; | ||||||
|  |         data.rangeTime.push(new Date(data.startTime), new Date(data.endTime)); | ||||||
|         this.form = data; |         this.form = data; | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|  | @ -433,16 +387,14 @@ export default { | ||||||
|       this.$refs.form.validate((valid) => { |       this.$refs.form.validate((valid) => { | ||||||
|         if (valid) { |         if (valid) { | ||||||
|           const params = JSON.parse(JSON.stringify(this.form)); |           const params = JSON.parse(JSON.stringify(this.form)); | ||||||
|           const strat = this.$options.filters.unixToDate( |           params.startTime = this.$options.filters.unixToDate( | ||||||
|             this.form.startTime / 1000 |             this.form.rangeTime[0] / 1000 | ||||||
|           ); |           ); | ||||||
|           const end = this.$options.filters.unixToDate( |           params.endTime = this.$options.filters.unixToDate( | ||||||
|             this.form.endTime / 1000 |             this.form.rangeTime[1] / 1000 | ||||||
|           ); |           ); | ||||||
|  |           delete params.rangeTime | ||||||
|           let scopeId = []; |           let scopeId = []; | ||||||
|           params.startTime = strat; |  | ||||||
|           params.endTime = end; |  | ||||||
| 
 |  | ||||||
|           if ( |           if ( | ||||||
|             params.scopeType == "PORTION_GOODS" && |             params.scopeType == "PORTION_GOODS" && | ||||||
|             (!params.promotionGoodsList || |             (!params.promotionGoodsList || | ||||||
|  |  | ||||||
|  | @ -8,26 +8,14 @@ | ||||||
|             活动名称将显示在对人拼团活动列表中,方便商家管理使用,最多输入25个字符 |             活动名称将显示在对人拼团活动列表中,方便商家管理使用,最多输入25个字符 | ||||||
|           </div> |           </div> | ||||||
|         </FormItem> |         </FormItem> | ||||||
|         <FormItem label="活动时间" prop="startTime"> |         <FormItem label="活动时间" prop="rangeTime"> | ||||||
|           <DatePicker |           <DatePicker | ||||||
|             type="datetime" |             type="datetimerange" | ||||||
|             v-model="form.startTime" |             v-model="form.rangeTime" | ||||||
|             format="yyyy-MM-dd HH:mm:ss" |             format="yyyy-MM-dd HH:mm:ss" | ||||||
|             :options="options" |  | ||||||
|             placeholder="请选择" |             placeholder="请选择" | ||||||
|             clearable |  | ||||||
|             style="width: 200px" |  | ||||||
|           > |  | ||||||
|           </DatePicker> |  | ||||||
|           - |  | ||||||
|           <DatePicker |  | ||||||
|             type="datetime" |  | ||||||
|             v-model="form.endTime" |  | ||||||
|             format="yyyy-MM-dd HH:mm:ss" |  | ||||||
|             :options="options" |             :options="options" | ||||||
|             placeholder="请选择" |             style="width: 260px" | ||||||
|             clearable |  | ||||||
|             style="width: 200px" |  | ||||||
|           > |           > | ||||||
|           </DatePicker> |           </DatePicker> | ||||||
|         </FormItem> |         </FormItem> | ||||||
|  | @ -87,20 +75,6 @@ | ||||||
| import { savePintuan, editPintuan, getPintuanDetail } from "@/api/promotion"; | import { savePintuan, editPintuan, getPintuanDetail } from "@/api/promotion"; | ||||||
| export default { | export default { | ||||||
|   data() { |   data() { | ||||||
|     const isLtEndDate = (rule, value, callback) => { |  | ||||||
|       if (new Date(value).getTime() > new Date(this.form.endTime).getTime()) { |  | ||||||
|         callback(new Error()); |  | ||||||
|       } else { |  | ||||||
|         callback(); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
|     const isGtStartDate = (rule, value, callback) => { |  | ||||||
|       if (new Date(value).getTime() < new Date(this.form.startTime).getTime()) { |  | ||||||
|         callback(new Error()); |  | ||||||
|       } else { |  | ||||||
|         callback(); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
|     return { |     return { | ||||||
|       id: this.$route.query.id, // 拼团id |       id: this.$route.query.id, // 拼团id | ||||||
|       form: { |       form: { | ||||||
|  | @ -131,33 +105,10 @@ export default { | ||||||
|             message: "限购数不合法", |             message: "限购数不合法", | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         startTime: [ |         rangeTime: [{ required: true, message: "请选择活动时间" }], | ||||||
|           { |  | ||||||
|             required: true, |  | ||||||
|             type: "date", |  | ||||||
|             message: "请选择开始时间", |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             trigger: "change", |  | ||||||
|             message: "开始时间要小于结束时间", |  | ||||||
|             validator: isLtEndDate, |  | ||||||
|           }, |  | ||||||
|         ], |  | ||||||
|         endTime: [ |  | ||||||
|           { |  | ||||||
|             required: true, |  | ||||||
|             type: "date", |  | ||||||
|             message: "请选择结束时间", |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             trigger: "change", |  | ||||||
|             message: "结束时间要大于开始时间", |  | ||||||
|             validator: isGtStartDate, |  | ||||||
|           }, |  | ||||||
|         ], |  | ||||||
|       }, |       }, | ||||||
|       submitLoading: false, // 添加或编辑提交状态 |       submitLoading: false, // 添加或编辑提交状态 | ||||||
|       options: { // 不可选取的时间段 |       options: { // 不可选取时间 | ||||||
|         disabledDate(date) { |         disabledDate(date) { | ||||||
|           return date && date.valueOf() < Date.now() - 86400000; |           return date && date.valueOf() < Date.now() - 86400000; | ||||||
|         }, |         }, | ||||||
|  | @ -185,11 +136,12 @@ export default { | ||||||
|           this.submitLoading = true; |           this.submitLoading = true; | ||||||
|           let params = JSON.parse(JSON.stringify(this.form)); |           let params = JSON.parse(JSON.stringify(this.form)); | ||||||
|           params.startTime = this.$options.filters.unixToDate( |           params.startTime = this.$options.filters.unixToDate( | ||||||
|             this.form.startTime / 1000 |             this.form.rangeTime[0] / 1000 | ||||||
|           ); |           ); | ||||||
|           params.endTime = this.$options.filters.unixToDate( |           params.endTime = this.$options.filters.unixToDate( | ||||||
|             this.form.endTime / 1000 |             this.form.rangeTime[1] / 1000 | ||||||
|           ); |           ); | ||||||
|  |           delete params.rangeTime | ||||||
|           if (!this.id) { |           if (!this.id) { | ||||||
|             // 添加 避免编辑后传入id等数据 记得删除 |             // 添加 避免编辑后传入id等数据 记得删除 | ||||||
|             delete params.id; |             delete params.id; | ||||||
|  | @ -218,7 +170,10 @@ export default { | ||||||
|     getDetail() { |     getDetail() { | ||||||
|       getPintuanDetail(this.id).then((res) => { |       getPintuanDetail(this.id).then((res) => { | ||||||
|         if (res.success) { |         if (res.success) { | ||||||
|           this.form = res.result; |           const data = res.result; | ||||||
|  |           data.rangeTime = []; | ||||||
|  |           data.rangeTime.push(new Date(data.startTime), new Date(data.endTime)); | ||||||
|  |           this.form = data; | ||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|  | @ -21,9 +21,6 @@ | ||||||
|           <template slot-scope="{ row, index }" slot="price"> |           <template slot-scope="{ row, index }" slot="price"> | ||||||
|             <Input v-model="row.price" :disabled="status==='view'" @input="goodsData[index].price = row.price" /> |             <Input v-model="row.price" :disabled="status==='view'" @input="goodsData[index].price = row.price" /> | ||||||
|           </template> |           </template> | ||||||
|           <template slot-scope="{ row }" slot="QRCode"> |  | ||||||
|             <img :src="row.QRCode || '../../../assets/lili.png'" width="50px" height="50px" alt="" /> |  | ||||||
|           </template> |  | ||||||
|           <template slot-scope="{ index }" slot="action"> |           <template slot-scope="{ index }" slot="action"> | ||||||
|             <Button type="error" size="small" ghost v-if="status === 'manager'" @click="delGoods(index)">删除</Button> |             <Button type="error" size="small" ghost v-if="status === 'manager'" @click="delGoods(index)">删除</Button> | ||||||
|           </template> |           </template> | ||||||
|  | @ -107,11 +104,7 @@ export default { | ||||||
|             return h("div", [ |             return h("div", [ | ||||||
|               h( |               h( | ||||||
|                 "Tag", |                 "Tag", | ||||||
|                 { |                 {props: {color: color}}, | ||||||
|                   props: { |  | ||||||
|                     color: color, |  | ||||||
|                   }, |  | ||||||
|                 }, |  | ||||||
|                 text |                 text | ||||||
|               ), |               ), | ||||||
|             ]); |             ]); | ||||||
|  | @ -125,20 +118,17 @@ export default { | ||||||
|           key: "goodsName", |           key: "goodsName", | ||||||
|           minWidth: 120, |           minWidth: 120, | ||||||
|         }, |         }, | ||||||
| 
 |  | ||||||
|         { |         { | ||||||
|           title: "库存", |           title: "库存", | ||||||
|           key: "quantity", |           key: "quantity", | ||||||
|           minWidth: 40, |           minWidth: 40, | ||||||
|         }, |         }, | ||||||
| 
 |  | ||||||
|         { |         { | ||||||
|           title: "拼团价格", |           title: "拼团价格", | ||||||
|           key: "price", |           key: "price", | ||||||
|           slot: "price", |           slot: "price", | ||||||
|           minWidth: 50, |           minWidth: 50, | ||||||
|         }, |         }, | ||||||
| 
 |  | ||||||
|         { |         { | ||||||
|           title: "操作", |           title: "操作", | ||||||
|           slot: "action", |           slot: "action", | ||||||
|  | @ -188,23 +178,23 @@ export default { | ||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|     init() { |     init() { // 初始化数据 | ||||||
|       this.getDataList(); |       this.getDataList(); | ||||||
|       this.getPintuanMsg(); |       this.getPintuanMsg(); | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     changePage(v) { |     changePage(v) { // 分页 改变页数 | ||||||
|       this.searchForm.pageNumber = v - 1; |       this.searchForm.pageNumber = v - 1; | ||||||
|       this.getDataList(); |       this.getDataList(); | ||||||
|       this.clearSelectAll(); |       this.clearSelectAll(); | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     changePageSize(v) { |     changePageSize(v) { // 分页 改变每页数 | ||||||
|       this.searchForm.pageSize = v; |       this.searchForm.pageSize = v; | ||||||
|       this.getDataList(); |       this.getDataList(); | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     handleSearch() { |     handleSearch() { // 搜索 | ||||||
|       this.searchForm.pageNumber = 0; |       this.searchForm.pageNumber = 0; | ||||||
|       this.searchForm.pageSize = 10; |       this.searchForm.pageSize = 10; | ||||||
|       this.getDataList(); |       this.getDataList(); | ||||||
|  | @ -253,7 +243,7 @@ export default { | ||||||
|       // 删除商品 |       // 删除商品 | ||||||
|       this.goodsData.splice(index, 1); |       this.goodsData.splice(index, 1); | ||||||
|     }, |     }, | ||||||
|     delAll() { |     delAll() { // 批量删除商品 | ||||||
|       if (this.selectCount <= 0) { |       if (this.selectCount <= 0) { | ||||||
|         this.$Message.warning("您还未选择要删除的数据"); |         this.$Message.warning("您还未选择要删除的数据"); | ||||||
|         return; |         return; | ||||||
|  | @ -272,7 +262,7 @@ export default { | ||||||
|         }, |         }, | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|     selectedGoodsData(item) { |     selectedGoodsData(item) { // 选择商品 | ||||||
|       let ids = []; |       let ids = []; | ||||||
|       let list = []; |       let list = []; | ||||||
|       this.goodsData.forEach((e) => { |       this.goodsData.forEach((e) => { | ||||||
|  | @ -295,7 +285,7 @@ export default { | ||||||
|       }); |       }); | ||||||
|       this.goodsData.push(...list); |       this.goodsData.push(...list); | ||||||
|     }, |     }, | ||||||
|     openSkuList() { |     openSkuList() { // 显示商品选择器 | ||||||
|       this.$refs.skuSelect.open("goods"); |       this.$refs.skuSelect.open("goods"); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|  | @ -46,13 +46,13 @@ | ||||||
|                     {{children.firstCompany}} |                     {{children.firstCompany}} | ||||||
|                   </td> |                   </td> | ||||||
|                   <td> |                   <td> | ||||||
|                     <span class="yuan">¥</span><span class="integer">{{children.firstPrice}}</span> |                     <span class="yuan">¥</span><span class="integer">{{children.firstPrice | unitPrice}}</span> | ||||||
|                   </td> |                   </td> | ||||||
|                   <td> |                   <td> | ||||||
|                     {{children.continuedCompany}} |                     {{children.continuedCompany}} | ||||||
|                   </td> |                   </td> | ||||||
|                   <td class="bdr"> |                   <td class="bdr"> | ||||||
|                     <span class="yuan">¥</span><span class="integer">{{children.continuedPrice}}</span> |                     <span class="yuan">¥</span><span class="integer">{{children.continuedPrice | unitPrice}}</span> | ||||||
|                   </td> |                   </td> | ||||||
|                 </tr> |                 </tr> | ||||||
|               </tbody> |               </tbody> | ||||||
|  |  | ||||||
|  | @ -68,7 +68,7 @@ | ||||||
|                 </div> |                 </div> | ||||||
|                 <div class="card-item"> |                 <div class="card-item"> | ||||||
|                   <div class="card-item-label">退单金额</div> |                   <div class="card-item-label">退单金额</div> | ||||||
|                   <div class="card-item-value">{{overViewList.refundOrderPrice || 0}}</div> |                   <div class="card-item-value">{{overViewList.refundOrderPrice || 0 | unitPrice('¥')}}</div> | ||||||
|                 </div> |                 </div> | ||||||
| 
 | 
 | ||||||
|               </div> |               </div> | ||||||
|  | @ -333,9 +333,7 @@ export default { | ||||||
|           key: "applyRefundPrice", |           key: "applyRefundPrice", | ||||||
|           render: (h, params) => { |           render: (h, params) => { | ||||||
|             return h( |             return h( | ||||||
|               "div", |               "div", this.$options.filters.unitPrice(params.row.applyRefundPrice, '¥') | ||||||
|               "¥" + |  | ||||||
|                 (params.row.applyRefundPrice ? params.row.applyRefundPrice : 0) |  | ||||||
|             ); |             ); | ||||||
|           }, |           }, | ||||||
|         }, |         }, | ||||||
|  |  | ||||||
|  | @ -51,7 +51,7 @@ | ||||||
|                 <span style="font-size: 14px;">总金额</span> |                 <span style="font-size: 14px;">总金额</span> | ||||||
|               </p> |               </p> | ||||||
|               <p class="static-num"> |               <p class="static-num"> | ||||||
|                 {{ priceData.price | unitPrice }} |                 {{ priceData.price | unitPrice('¥') }} | ||||||
|               </p> |               </p> | ||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue