Forráskód Böngészése

商品与分类优化

shish 4 éve
szülő
commit
dd8b10c4fb

+ 2 - 2
ghsApp/src/admin/home/mall.vue

@@ -5,10 +5,10 @@
     </view>
     <!-- 确认 -->
       <div class="confirm-btn">
-        <button class="admin-button-com big blue" @click="downloadImg">下载分享给客户</button>
+        <button class="admin-button-com big blue" @click="downloadImg">下载图片分享</button>
       </div>
       <div class="confirm-btn1">
-        <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">打开分享给客户</button>
+        <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">直接打开分享</button>
       </div>
   </view>
 </template>

+ 2 - 2
hdApp/src/admin/cg/mall.vue

@@ -5,10 +5,10 @@
     </view>
     <!-- 确认 -->
       <div class="confirm-btn">
-        <button class="admin-button-com big blue" @click="downloadImg">下载分享给客户</button>
+        <button class="admin-button-com big blue" @click="downloadImg">下载图片分享</button>
       </div>
       <div class="confirm-btn1">
-        <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">打开分享给客户</button>
+        <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">打开直接分享</button>
       </div>
   </view>
 </template>

+ 26 - 38
hdApp/src/admin/goodsManage/add.vue

@@ -16,31 +16,19 @@
           />
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">历史销量</div>
-          <input
-            v-model="form.sold"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="sold"
-            placeholder="选填,商城销量=历史销量+真实销量"
-            maxlength="50"
-            type="number"
-          />
-        </tui-list-cell>
-        <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">库存</div>
+          <div class="tui-title required">价格</div>
           <input
-            v-model="form.stock"
+            v-model="form.price"
             placeholder-class="phcolor"
             class="tui-input"
-            name="stock"
-            placeholder="请输入库存,留空表示库存充足"
+            name="price"
+            placeholder="请输入"
             maxlength="50"
-            type="number"
+            type="digit"
           />
         </tui-list-cell>
         <tui-list-cell class="line-cell category-wrap" :hover="false">
-          <div class="tui-title">类</div>
+          <div class="tui-title">分类</div>
           <div class="tui-input">
             <block v-for="(item, index) in categoryData" :key="index">
               <button
@@ -52,23 +40,29 @@
           </div>
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title required">价格</div>
+          <div class="tui-title">库存</div>
           <input
-            v-model="form.price"
+            v-model="form.stock"
             placeholder-class="phcolor"
             class="tui-input"
-            name="price"
-            placeholder="请输入"
+            name="stock"
+            placeholder="留空表示库存充足"
             maxlength="50"
-            type="digit"
+            type="number"
+          />
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">历史销量</div>
+          <input
+            v-model="form.sold"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="sold"
+            placeholder="选填,总销量=历史销量+真实销量"
+            maxlength="50"
+            type="number"
           />
-          <div class="tui-prompt">元</div>
         </tui-list-cell>
-        <!-- <tui-list-cell class="line-cell" :arrow="true">
-					<div class="tui-title">分类</div>
-					<div v-if="form.receiveFullAddress" class="tui-input">{{ form.receiveFullAddress }}</div>
-					<div v-else class="tui-placeholder">请选择</div>
-        </tui-list-cell>-->
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">节日涨价</div>
           <label for="autoPrice" class="tui-input" @click="autoRiseChange(form.autoRise)">
@@ -140,10 +134,10 @@
           />
         </div>
       </div>
-      <!-- button -->
+
       <div class="app-footer">
-        <button class="admin-button-com middle default" formType="submit" @click="status = 0">加入仓库</button>
-        <button class="admin-button-com middle blue" formType="submit" @click="status = 1">上架</button>
+        <button class="admin-button-com middle default" formType="submit" @click="status = 0">保存</button>
+        <button class="admin-button-com middle blue" formType="submit" @click="status = 1">保存上架</button>
       </div>
     </form>
   </div>
@@ -182,14 +176,8 @@ export default {
     ...mapGetters({ categoryData: "getCategory" })
   },
   onLoad() {
-    // this.init()
   },
   watch:{
-    categoryData(val){
-      
-    },
-    'form.categoryIdList'(val){
-    }
   },
   methods: {
     init() {

+ 117 - 197
hdApp/src/admin/goodsManage/category.vue

@@ -1,54 +1,40 @@
 <template>
 	<div class="app-content">
-		<!-- list -->
 		<div class="list-wrap">
 			<block v-if="!$util.isEmpty(list.data)">
 				<div class="list" v-for="(item, index) in list.data" :key="index">
-					<div class="list-index">{{ item.inTurn }}</div>
 					<div class="list-img">
-						<img :src="item.img" alt="分类图" mode="center" />
+						<img :src="item.img" alt="" mode="aspectFit" />
 					</div>
-					<div class="list-det">
-						<div class="app-size-28 app-color-0">{{ item.categoryName || '暂无' }}</div>
-						<div>{{ item.description || '暂无' }}</div>
+					<div class="list-det" @click="edit(item)">
+						<div class="app-size-28 app-color-0">{{ item.categoryName}}</div>
+						<div><text style="color:green;" v-if="item.status == 1">启用</text><text v-else>停用</text></div>
 						<div class="list-operate">
 							<div class="operate-det">
-								<span>商品数: {{ item.goodsNum }}</span>
-								<span>销量: {{ item.sold }}</span>
-								<span :style="{color: item.status == 1 ? '#049E2C' : '#ff6900'}">{{ item.status == 1? '启用' : '停用' }}</span>
-							</div>
-							<div class="operate-icon-wrap" @click="operateFn(item, index)">
-								<div class="operate-icon">
-									<i class="iconfont" :class="[ index == operateIndex ? 'iconcaozuojihuo' : 'iconcaozuo']" style="font-size:38rpx;"></i>
-								</div>
+								<span @click.stop="edit(item)">编辑</span>
+								<span @click.stop="changeStatus(item)"><text v-if="item.status == 1">停用</text><text v-else>启用</text></span>
+								<span @click.stop="delCategory(item.id)">删除</span>
 							</div>
 						</div>
 					</div>
 				</div>
-				<!-- operate -->
-				<operate-module 
-					v-if="operateShow" 
-					:top="operateTop" 
-					:right="30"
-					@clickFn="operateList"
-					:btnData="btnData" />
 			</block>
 			<block v-else>
 				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 			</block>
 		</div>
-		<!-- button -->
+
 		<div class="app-footer">
 			<button class="admin-button-com middle blue" @click="addCategoryFn">添加分类</button>
 		</div>
-		<!-- modify -->
+
 		<modal-module :show="modifyModal" :maskClosable="false" @cancel="modalCancel" @click="modifyModalClick" width="92%" :title="modifyTitle" padding="30rpx 30rpx">
 			<template v-slot:content>
 				<div class="app-modal-input-wrap modify-modal">
 					<div class="inp-list-line">
-						<div class="line-label">分类名称</div>
+						<div class="line-label">名称</div>
 						<div class="line-input">
-							<input type="text" v-model="modifyForm.categoryName" :adjust-position="false" class="inp-input" placeholder="请填写分类名称" />
+							<input type="text" v-model="modifyForm.categoryName" :adjust-position="false" class="inp-input" placeholder="请填写" />
 						</div>
 					</div>
 					<div class="inp-list-line">
@@ -57,15 +43,14 @@
 							<app-uploader :multiple="false" ref="appUploader" :imgList.sync="modifyForm.img" />
 						</div>
 					</div>
-					<div class="prompt-text">建议尺寸 500X500</div>
 					<div class="inp-list-line">
 						<div class="line-label">排序</div>
 						<div class="line-input">
-							<input type="text" v-model="modifyForm.inTurn" :adjust-position="false" class="inp-input" placeholder="默认排序最新在前面" />
+							<input type="text" v-model="modifyForm.inTurn" :adjust-position="false" class="inp-input" placeholder="越大越靠前" />
 						</div>
 					</div>
 					<div class="inp-list-line switch-wrap">
-						<div class="line-label">启用状态</div>
+						<div class="line-label">启用</div>
 						<div class="line-input flex-strat">
 							<switch :checked="modifyForm.status == '0' ? false : true" @change="switchChangeFn" />
 						</div>
@@ -73,8 +58,6 @@
 				</div>
 			</template>
 		</modal-module>
-		<!-- 删除提示 -->
-		<modal-module :show="delModal" :maskClosable="false" @cancel="modalCancel" @click="delModalClick" content="确定删除该分类吗?" color="#333" :size="32" padding="30rpx 30rpx"></modal-module>
 	</div>
 </template>
 
@@ -101,61 +84,16 @@ export default {
 			modifyForm: {
 				categoryName: '',
 				img: [],
-				inTurn: 0,
+				inTurn: 100,
 				status: 1
 			},
-			// 删除弹窗
 			delModal: false,
-			// operate
-			operateShow: false,
 			operateData: {},
 			operateIndex: null,
 			operateTop: 0
 		}
 	},
 	computed: {
-		btnData() {
-			return [
-				{
-					text: '编辑',
-					icon: 'iconbianji',
-					click: () => {
-						// this.operateShow = false
-						this.modifyModal = true
-						this.modifyTitle = '编辑'
-
-						this.modifyForm = {
-							categoryName: this.operateData.categoryName,
-							img: [this.operateData.img],
-							inTurn: this.operateData.inTurn,
-							status: this.operateData.status
-						}
-					}
-				},
-				{
-					text: this.operateData.status == 1 ? '停用' : '启用',
-					icon: this.operateData.status == 1 ? 'iconjinyong' : 'iconqiyong',
-					click: () => {
-						this.changeStatusFn()
-					}
-				},
-				{
-					text: '删除',
-					icon: 'iconshanchu1',
-					click: () => {
-						// this.operateCancle()
-						this.delModal = true
-					}
-				}
-				// {
-				// 	text: '分享',
-				// 	icon: 'iconfenxiang1',
-				// 	click: () => {
-				// 		this.$msg('功能开发中...')
-				// 	}
-				// }
-			]
-		}
 	},
 	onPullDownRefresh() {
 		this.resetList()
@@ -173,24 +111,17 @@ export default {
 		}
 	},
 	onLoad() {
-		// this.init()
 	},
 	methods: {
-		operateList(index){
-			if(index === 0){
-				this.modifyModal = true
-				this.modifyTitle = '编辑'
-
-				this.modifyForm = {
-					categoryName: this.operateData.categoryName,
-					img: [this.operateData.img],
-					inTurn: this.operateData.inTurn,
-					status: this.operateData.status
-				}
-			}else if(index === 1) {
-				this.changeStatusFn()
-			}else if(index === 2) {
-				this.delModal = true
+		edit(item){
+			this.modifyModal = true
+			this.modifyTitle = '编辑'
+			this.modifyForm = {
+				categoryId:item.id,
+				categoryName: item.categoryName,
+				img: [item.img],
+				inTurn: item.inTurn,
+				status: item.status
 			}
 		},
 		async init() {
@@ -208,32 +139,30 @@ export default {
 				this.completes(data)
 			})
 		},
-		// modal
 		_categoryAddOrEditB() {
 			if (!this.modifyForm.categoryName) {
-				this.$msg('请输入分类名称')
+				this.$msg('请输入分类名称')
 				return false
 			}
-			let host = this.modifyTitle == '编辑' ? categoryUpdateB : categoryAddB
 			let form = JSON.parse(JSON.stringify(this.modifyForm))
+
+			let host = categoryAddB
+			if(form.categoryId && form.categoryId > 0){
+				host =  categoryUpdateB
+			}
 			form.img = this.$util.imgSubstr(form.img)
 			form.img = form.img.join()
-			if (this.modifyTitle == '编辑') {
-				form.categoryId = this.operateData.id
-			}
 			host({
 				...form
 			}).then(res => {
 				this.$msg('操作成功!')
 				this.modalCancel()
-				this.operateCancle()
 				setTimeout(() => {
 					this.resetList()
 					this._list()
 				}, 1000)
 			})
 		},
-		// 操作
 		addCategoryFn() {
 			this.resetForm()
 			this.modifyModal = true
@@ -261,45 +190,34 @@ export default {
 		switchChangeFn(e) {
 			this.modifyForm.status = e.detail.value ? 1 : 0
 		},
-		delModalClick(e) {
-			if (e.index === 0) {
-				this.modalCancel()
-			} else {
-				console.log('this.operateData', this.operateData)
-				categoryDelB({ categoryId: this.operateData.id }).then(res => {
-					this.modalCancel()
-					this.operateCancle()
-					this.$msg('删除成功!')
-					this.resetList()
-					this._list()
-				})
-			}
-		},
-		// operate
-		operateFn(item, index) {
-			if (this.operateIndex == index) {
-				this.operateCancle()
-			} else {
-				this.operateData = item
-				this.operateIndex = index
-				this.operateShow = true
-				this.operateTop = (index + 1) * 191
-			}
-		},
-		operateCancle() {
-			this.operateData = {}
-			this.operateIndex = null
-			this.operateShow = false
+		delCategory(id) {
+			let that = this
+			uni.showModal({
+				title: '提示',
+				content: '确认删除?',
+				success: function (res) {
+					if (res.confirm) {
+						categoryDelB({ categoryId: id }).then(res => {
+							if(res.code == 1){
+								that.$msg('已删除')
+								that.resetList()
+								that._list()
+							}
+						})
+					}
+				}
+			})
 		},
-		changeStatusFn() {
-			let status = this.operateData.status == 1 ? 0 : 1
+		changeStatus(item) {
+			let status = item.status == 1 ? 0 : 1
 			categoryStatusB({
-				categoryId: this.operateData.id,
+				categoryId: item.id,
 				status: status
 			}).then(res => {
-				this.list.data[this.operateIndex].status = status
-				this.operateCancle()
-				this.$msg('操作成功!')
+				if(res.code == 1){
+					item.status = status
+					this.$msg('修改成功')
+				}
 			})
 		}
 	}
@@ -307,77 +225,79 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-	.app-content {
-		min-height: calc(100vh - 100px);
-		padding-bottom: 100px;
-	}
-	// list
-	.list-wrap {
-		position: relative;
-		background-color: #fff;
-		.list {
+.app-content {
+	min-height: calc(100vh - 100px);
+	padding-bottom: 100px;
+}
+.list-wrap {
+	position: relative;
+	background-color: #fff;
+	.list {
+		height: 160px;
+		@include disFlex(center, flex-start);
+		padding: 30px 0;
+		margin: 0 30px;
+		color: $fontColor3;
+		border-bottom: 1px solid $borderColor;
+		.list-index {
+			width: 50px;
+		}
+		.list-img {
+			width: 130px;
 			height: 130px;
-			@include disFlex(center, flex-start);
-			padding: 30px 0;
-			margin: 0 30px;
-			color: $fontColor3;
-			border-bottom: 1px solid $borderColor;
-			.list-index {
-				width: 50px;
+			img {
+				height: 100%;
 			}
-			.list-img {
-				width: 130px;
-				height: 130px;
-				img {
-					height: 100%;
+		}
+		.list-det {
+			width: calc(100% - 200px);
+			margin-left: 20px;
+			& > div {
+				margin-top: 14px;
+				&:first-child {
+					margin-top: 0;
 				}
 			}
-			.list-det {
-				width: calc(100% - 200px);
-				margin-left: 20px;
-				& > div {
-					margin-top: 14px;
-					&:first-child {
-						margin-top: 0;
-					}
-				}
-				.list-operate {
-					@include disFlex(center, space-between);
-					.operate-det {
-						& > span {
-							margin-left: 60px;
-							&:first-child {
-								margin-left: 0;
-							}
+			.list-operate {
+				@include disFlex(center, space-between);
+				.operate-det {
+					padding-left:160rpx;
+					& > span {
+						border:1px solid #ccc;
+						border-radius: 30rpx;
+						padding:5rpx 20rpx 5rpx 20rpx;
+						font-size:20rpx;
+						margin-left: 40px;
+						&:first-child {
+							margin-left: 0;
 						}
 					}
 				}
 			}
 		}
 	}
-	// button
-	.app-footer {
-		justify-content: flex-end;
-		.admin-button-com {
-			width: 200px;
-			margin-right: 30px;
-		}
+}
+.app-footer {
+	justify-content: flex-end;
+	.admin-button-com {
+		width: 200px;
+		margin-right: 30px;
 	}
-	// 编辑弹窗
-	.modify-modal {
-		.prompt-text {
-			color: red;
-			position: relative;
-			right: 52px;
-			bottom: 24px;
-			// margin-bottom: 10px;
-		}
-		.line-label {
-			width: 140px;
-			flex-shrink: 0;
-		}
-		.switch-wrap {
-			margin-top: 30px;
-		}
+}
+.modify-modal {
+	.prompt-text {
+		color: red;
+		position: relative;
+		right: 52px;
+		bottom: 24px;
+		// margin-bottom: 10px;
 	}
-</style>
+	.line-label {
+		width: 140px;
+		flex-shrink: 0;
+	}
+	.switch-wrap {
+		margin-top: 30px;
+	}
+}
+</style>

+ 60 - 203
hdApp/src/admin/goodsManage/list.vue

@@ -1,7 +1,6 @@
 <template>
   <div class="app-content" @click="operateBottomShow = false">
     <app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" @change="change" itemWidth="50%" />
-    <!-- 中间 -->
     <div class="app-middle">
       <scroll-view
         scroll-y
@@ -16,7 +15,7 @@
           class="tab-bar-item"
           :class="[currentTab==index ? 'active' : '']"
           :data-current="index"
-          @tap.stop="swichNav($event ,item)"
+          @tap.stop="swichTab($event ,item)"
         >
           <text>{{item.categoryName || '暂无'}}</text>
         </div>
@@ -28,11 +27,10 @@
           :style="{height:height+'px'}"
           v-if="currentTab==index"
         >
-          <!--内容部分 start -->
           <block v-if="!$util.isEmpty(list.data)">
             <div class="page-view">
               <div class="goods-list" v-for="(goodsItem, idx) in list.data" :key="idx">
-                <div class="goods-list-top">
+                <div class="goods-list-top" @click="edit(goodsItem.id)">
                   <div class="img-blo">
                     <img :src="goodsItem.smallImgList[0]" alt="商品图" mode="aspectFit" />
                   </div>
@@ -40,99 +38,55 @@
                     <div class="goods-det-top">
                       <div class="goods-name">{{ goodsItem.goodsName }}</div>
                     </div>
+                    <div class="operate-wrap">
+                      <div style="color:#CCCCCC;padding-bottom:5rpx;">库存:<text v-if="goodsItem.stock == -100000">充足</text><text>{{goodsItem.stock}}</text></div>
+                    </div>
                     <div class="operate-wrap">
                       <div class="goods-price">¥{{ goodsItem.price }}</div>
-                      <div 
-                        class="operate-icon-wrap" 
-                        @click.stop="operateFn(goodsItem, idx)">
-                        <div class="operate-icon">
-                          <i
-                            class="iconfont"
-                            :class="[ idx == operateIndex ? 'iconcaozuojihuo' : 	'iconcaozuo']"
-							style="font-size:38rpx;"
-                          ></i>
-                        </div>
-                      </div>
                     </div>
                   </div>
                 </div>
                 <div class="goods-list-bottom flex-center-between">
                   <div>已售: {{ goodsItem.actualSold }}</div>
-                  <div>库存: {{ goodsItem.stock == -1 ? '充足' : goodsItem.stock }}</div>
-                  <div>浏览: {{ goodsItem.viewNum }}</div>
+                  <text @click.stop="edit(goodsItem.id)">编辑</text>
+                  
+                  <text v-if="goodsItem.status == 0" @click.stop="changeStatus(goodsItem)">上架</text>
+                  <text v-else @click.stop="changeStatus(goodsItem)">下架</text>
+
+                  <text @click.stop="delGoods(goodsItem.id)">删除</text>
                 </div>
               </div>
             </div>
-            <!-- 操作 -->
-            <operate-module
-              @clickFn="operateList"
-              v-if="operateShow"
-              :top="operateTop"
-              :right="30"
-              :btnData="btnData"
-            />
+
           </block>
           <block v-else>
             <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
           </block>
-          <!--内容部分 end -->
+
         </scroll-view>
       </block>
     </div>
-    <!-- 底部 -->
+
     <div class="app-footer">
-      <div class="btn-list other-btn" @click.stop="changeOperateShowFn">
-        <i
-          class="iconfont iconxiala"
-          :class="[operateBottomShow ? 'animate-open' : 'animate-close']"
-        ></i>
-        <span>更多设置</span>
-      </div>
       <div class="btn-list">
         <button class="admin-button-com blue" @click="pageTo('/admin/goodsManage/add')">新增商品</button>
       </div>
     </div>
-    <!-- 操作弹窗 -->
-    <operate-line-module
-      v-if="operateBottomShow"
-      :btnData="btnBottomData"
-      @clickFn="operateLine"
-      :bottom="120"
-      :right="528"
-    />
-    <!-- 删除提示 -->
-    <modal-module
-      :show="delModal"
-      :maskClosable="false"
-      @cancel="modalCancel"
-      @click="delModalClick"
-      content="确定删除该商品吗?"
-      color="#333"
-      :size="32"
-      padding="30rpx 30rpx"
-    ></modal-module>
+
   </div>
 </template>
 
 <script>
 import AppTabs from "@/components/plugin/tabs";
 import OperateModule from "@/admin/home/components/module/operate";
-import OperateLineModule from "@/admin/home/components/module/operate-line";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
-// api
-import {
-  categoryListB,
-  getCategoryGoodsB,
-  delB,
-  changeStatusB
-} from "@/api/goods";
+import {categoryListB,getCategoryGoodsB,delB,changeStatusB} from "@/api/goods";
 import { list } from "@/mixins";
 export default {
   name: "goods-manage-list",
   components: {
     AppTabs,
-    OperateLineModule,
     OperateModule,
     AppWrapperEmpty,
     ModalModule
@@ -140,7 +94,6 @@ export default {
   mixins: [list],
   data() {
     return {
-      // tabs
       tabIndex: 0,
       tabs: [
         {
@@ -150,72 +103,22 @@ export default {
           name: "下架"
         }
       ],
-      // 中间
       tabbar: [],
-      height: 0, // scroll-view高度
-      currentTab: 0, // 预设当前项的值
-      scrollTop: 0, // tab标题的滚动条位置
+      height: 0,
+      currentTab: 0,
+      scrollTop: 0,
       form: {
         categoryId: ""
       },
-      // 删除弹窗
       delModal: false,
-      // 操作菜单
       operateData: {},
       operateShow: false,
       operateIndex: null,
       operateTop: 0,
-      // 底部操作
-      operateBottomShow: false,
-      btnBottomData: [
-        {
-          name: "分类管理",
-            click: () => this.$util.pageTo("/admin/goodsManage/category")
-        },
-        {
-          name: "涨价设置",
-          click: () => this.$util.pageTo("/admin/goodsManage/price-increase")
-        },
-        {
-          name: "运费设置",
-          click: () => this.$util.pageTo("/admin/goodsManage/freight")
-        }
-      ]
+      operateBottomShow: false
     };
   },
   computed: {
-    btnData() {
-      let self = this;
-      return [
-        {
-          text: "编辑",
-          icon: "iconbianji",
-          click: function() {
-            self.$util.pageTo({
-              url: "/admin/goodsManage/add",
-              query: {
-                type: self.tabIndex,
-                id: self.operateData.id
-              }
-            });
-          }
-        },
-        {
-          text: self.operateData.status == 1 ? "下架" : "上架",
-          icon: self.operateData.status == 1 ? "iconxiajia" : "iconqiyong",
-          click: () => {
-            self.changeStatusFn();
-          }
-        },
-        {
-          text: "删除",
-          icon: "iconshanchu1",
-          click: () => {
-            self.delModal = true;
-          }
-        }
-      ];
-    }
   },
   onLoad: function() {
     if (this.$util.isLogin()) {
@@ -230,41 +133,24 @@ export default {
     }
   },
   methods: {
-    operateLine(index) {
-      if (index === 0) {
-        this.$util.pageTo("/admin/goodsManage/category");
-      } else if (index === 1) {
-        this.$util.pageTo("/admin/goodsManage/price-increase");
-      } else{
-
-      }
-    },
-    operateList(index) {
-      if (index === 0) {
+    edit(id){
         this.$util.pageTo({
           url: "/admin/goodsManage/add",
           query: {
             type: this.tabIndex,
-            id: this.operateData.id
+            id: id
           }
-        });
-      } else if (index === 1) {
-        this.changeStatusFn();
-      } else if (index === 2) {
-        this.delModal = true;
-      }
+        })
     },
     async sInit() {
       this._getClass();
       this._list();
     },
-    // 分类
     _getClass() {
       categoryListB().then(res => {
         this.tabbar = res.data;
       });
     },
-    // 列表
     _list() {
       return getCategoryGoodsB({
         status: this.tabIndex == 0 ? 1 : 0,
@@ -273,37 +159,16 @@ export default {
         this.completes(res);
       });
     },
-    // tabs
     change(e) {
       if (this.tabIndex == e.index) {
         return false;
       } else {
         this.tabIndex = e.index;
-        this.operateCloseFn();
         this.resetList();
         this._list();
       }
     },
-    // 操作按钮
-    operateFn(item, index) {
-      if (this.operateIndex == index) {
-        this.operateCloseFn();
-      } else {
-        this.operateData = item;
-        this.operateData.index = index;
-        this.operateIndex = index;
-        this.operateTop = (index + 1) * 224 - 20;
-        this.operateShow = true;
-      }
-    },
-    // 关闭操作按钮
-    operateCloseFn() {
-      this.operateData = {};
-      this.operateIndex = null;
-      this.operateShow = false;
-    },
-    // 点击标题切换当前页时改变样式
-    swichNav(e, item) {
+    swichTab(e, item) {
       let cur = e.currentTarget.dataset.current;
       if (this.currentTab == cur) {
         return false;
@@ -312,51 +177,36 @@ export default {
         this.form.categoryId = item.id;
         this.resetList();
         this._list();
-        // this.checkCor()
-      }
-    },
-    // 判断当前滚动超过一屏时,设置tab标题滚动条。
-    checkCor() {
-      let that = this;
-      // 这里计算按照实际情况进行修改,动态数据要进行动态分析
-      // 思路:窗体高度/单个分类高度 200rpx 转px计算 =>得到一屏幕所显示的个数,结合后台传回分类总数进行计算
-      // 数据很多可以多次if判断然后进行滚动距离计算即可
-      if (that.currentTab > 7) {
-        that.scrollTop = 500;
-      } else {
-        that.scrollTop = 0;
       }
     },
-    changeOperateShowFn() {
-      this.operateBottomShow = !this.operateBottomShow;
-    },
-    changeStatusFn() {
-      let status = this.operateData.status == 1 ? 0 : 1;
-      changeStatusB({
-        id: this.operateData.id,
-        status: status
-      }).then(res => {
-        this.list.data[this.operateIndex].status = status;
-        this.operateCloseFn();
-        this.$msg("操作成功!");
+    changeStatus(item) {
+      let status = item.status == 0 ? 1 : 0
+      changeStatusB({id: item.id,status: status}).then(res => {
+        if(res.code == 1){
+          this.$msg("修改成功")
+          item.status = status
+        }
       });
     },
-    // delModal
-    modalCancel() {
-      this.delModal = false;
-    },
-    delModalClick(e) {
-      if (e.index === 0) {
-        this.modalCancel();
-      } else {
-        delB({ id: this.operateData.id }).then(res => {
-          this.modalCancel();
-          this.operateCloseFn();
-          this.$msg("删除成功!");
-          this.resetList();
-          this._list();
-        });
-      }
+    delGoods(id) {
+      let that = this
+      uni.showModal({
+          title: '提示',
+          content: '确认删除商品?',
+          success: function (res) {
+              if (res.confirm) {
+                  
+                delB({ id: id}).then(res => {
+                  that.$msg("删除成功!");
+                  that.resetList();
+                  that._list();
+                });
+
+              } else if (res.cancel) {
+                  console.log('用户点击取消');
+              }
+          }
+      });
     }
   }
 };
@@ -440,9 +290,15 @@ page {
         @include disFlex(flex-start, flex-start);
       }
       .goods-list-bottom {
-        width: 74%;
+        width: 96%;
         margin-top: 16px;
         color: $fontColor2;
+        text{
+          border:1px solid #ccc;
+          border-radius: 20rpx;
+          font-size:20rpx;
+          padding:7rpx 25rpx 7rpx 25rpx;
+        }
       }
       .img-blo {
         width: 130px;
@@ -471,7 +327,6 @@ page {
           font-size: 24px;
         }
         .goods-price {
-          margin-top: 50px;
           color: #ff2842;
           font-weight: bold;
         }
@@ -483,7 +338,7 @@ page {
 .app-footer {
   justify-content: space-between;
   .btn-list {
-    width: 33.33%;
+    width: 100%;
     &:first-child {
       border-left: 0;
     }
@@ -491,6 +346,8 @@ page {
       width: 160px;
       padding-top: 16px;
       padding-bottom: 16px;
+      float:right;
+      margin-right:30rpx;
     }
   }
   .other-btn {

+ 30 - 10
hdApp/src/admin/home/apply.vue

@@ -42,16 +42,6 @@ export default { // 应用页面
         {
           title: '门店仓库',
           list: [
-            {
-              name: "商品",
-              img: `${this.$constant.imgUrl}/ghs/home/icon_spgl.png`,
-              url: "/admin/goodsManage/list"
-            },
-            {
-              name: "花材",
-              img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
-              url: "/pagesStorehouse/flower/manage"
-            },
             {
               name: "门店",
               img: `${this.$constant.imgUrl}/ghs/home/shop.png`,
@@ -106,6 +96,36 @@ export default { // 应用页面
             },
           ]
         },
+        {
+          title: '商品',
+          list: [
+            {
+              name: "商品",
+              img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
+              url: "/admin/goodsManage/list"
+            },
+            {
+              name: "商品分类",
+              img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
+              url: "/admin/goodsManage/category"
+            },
+            {
+              name: "涨价设置",
+              img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
+              url: "/admin/goodsManage/price-increase"
+            },
+            {
+              name: "运费规则",
+              img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
+              url: "/admin/goodsManage/freight"
+            },
+            {
+              name: "花材",
+              img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
+              url: "/pagesStorehouse/flower/manage"
+            },
+          ]
+        },
         {
           title: '赚钱分红',
           list: [{

+ 30 - 51
hdApp/src/admin/home/components/module/operate.vue

@@ -1,22 +1,13 @@
 <template>
-	<div 
-		class="operate-module" 
-		:style="{top: top + 'rpx', right: right + 'rpx'}">
-		<!-- <div class="operate-icon">
-			<i class="iconfont" :class="[ isShow ? 'iconcaozuojihuo' : 'iconcaozuo']"></i>
-		</div>-->
-		<!-- 弹窗 -->
-		<!-- <div class="operate-wrap" :style="{top: top + 'rpx', right: right + 'rpx'}" > -->
-			<div 
-				class="operate-list" 
-				v-for="(item, index) in btnData" 
-				:key="index" 
-				@click="clickFn(item, index)">
-				<i class="iconfont" :class="[item.icon]"></i>
-				<div class="btn-text">{{ item.text }}</div>
-                <!-- <span>{{item.click}}</span> -->
-			</div>
-		<!-- </div> -->
+	<div class="operate-module" :style="{top: top + 'rpx', right: right + 'rpx'}">
+		<div 
+			class="operate-list" 
+			v-for="(item, index) in btnData" 
+			:key="index" 
+			@click="clickFn(item, index)">
+			<i class="iconfont" :class="[item.icon]"></i>
+			<div class="btn-text">{{ item.text }}</div>
+		</div>
 	</div>
 </template>
 
@@ -62,38 +53,26 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-	.operate-module {
-		z-index: 10;
-		// position: relative;
-		// .operate-icon {
-		// 	.iconcaozuojihuo {
-		// 		color: $mainColor;
-		// 	}
-		// }
-		// 操作
-		// .operate-wrap {
-			position: absolute;
-			// top: 50px;
-			background: rgba(0, 0, 0, 0.8);
-			box-shadow: 0px 3px 6px 0px rgba(29, 29, 29, 0.7);
-			border-radius: 10px;
-			// width: max-content;
-			height: 100px;
-			@include disFlex(center, space-between);
-			// padding: 14px 0;
-			.operate-list {
-				flex-shrink: 0;
-				padding: 0 24px;
-				text-align: center;
-                color: #fff;
-                .iconfont {
-                    font-size: 36px;
-                }
-				.btn-text {
-					transform: scale(0.8);
-					margin-top: 2px;
-				}
-			}
-		// }
+.operate-module {
+	z-index: 10;
+	position: absolute;
+	background: rgba(0, 0, 0, 0.8);
+	box-shadow: 0px 3px 6px 0px rgba(29, 29, 29, 0.7);
+	border-radius: 10px;
+	height: 100px;
+	@include disFlex(center, space-between);
+	.operate-list {
+		flex-shrink: 0;
+		padding: 0 24px;
+		text-align: center;
+		color: #fff;
+		.iconfont {
+			font-size: 36px;
+		}
+		.btn-text {
+			transform: scale(0.8);
+			margin-top: 2px;
+		}
 	}
+}
 </style>

+ 11 - 32
hdApp/src/admin/home/workbench.vue

@@ -148,11 +148,9 @@ export default {
     AppAvatarModule,
     noneHd
   },
-  // mixins:[share],
   data () {
     return {
       constant: this.$constant,
-      // 遮罩层
       renewMask: false,
       getappIdList: {},
       data: {
@@ -166,7 +164,6 @@ export default {
 					expend:0.00
         }
       },
-      // 订单总览
       orderData: [
         {
           name: "待配送",
@@ -196,7 +193,6 @@ export default {
           value: 0
         }
       ],
-      // tab按钮
       tabsData: [
         {
           name: "商城",
@@ -213,11 +209,21 @@ export default {
           img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,
           url: "/pagesPurchase/shopping"
         },
+        {
+          name: "供应商",
+          img: `${this.$constant.imgUrl}/ghs/home/icon_ghs.png`,
+          url: "/pagesPurchase/order"
+        },
         {
           name: "商品",
-          img: `${this.$constant.imgUrl}/ghs/home/icon_spgl.png`,
+          img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
           url: "/admin/goodsManage/list"
         },
+        {
+          name: "商品分类",
+          img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,
+          url: "/admin/goodsManage/category"
+        },
         {
           name: "员工",
           img: `${this.$constant.imgUrl}/ghs/home/yggl.png`,
@@ -227,19 +233,8 @@ export default {
           name: "门店",
           img: `${this.$constant.imgUrl}/ghs/home/shop.png`,
           url: "/admin/shop/list"
-        },
-        {
-          name: "邀请开店",
-          img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,
-          url: "/pagesInvite/list"
-        },
-        {
-          name: "经营概况",
-          img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,
-          url: "/pagesStatistics/business"
         }
       ],
-      // 总览
       totalData: [
         {
           name: "客户数",
@@ -376,29 +371,17 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-// button {
-//   margin: 0;
-//   padding: 0;
-//   border: 1px solid transparent;  //自定义边框
-//   outline: none;    //消除默认点击蓝色边框效果
-// }
 .app-content {
   padding-bottom: 10px;
 }
-// 公共
 .module-com {
   margin-bottom: 20px;
-  // padding: 20px;
   background-color: #fff;
-  // box-shadow: 0px 6px 16px #ddd;
-  // border-radius: 10px;
 }
-// 用户信息
 .user-wrap {
   padding: 20px 30px 34px 30px;
   color: #fff;
   text-align: center;
-  // background-image: url(http://img.huaml.com/home/deserve.png);
   background-size: 100% 380px;
   background-repeat: no-repeat;
   .user-top {
@@ -414,13 +397,10 @@ export default {
         border: 1px solid #ffffff;
         border-radius: 22px;
         padding: 10upx 17upx !important;
-        // height: 44px;
-        // line-height: 44px;
         font-size: 24px;
         font-family: PingFang SC;
         font-weight: 400;
         color: #ffffff;
-        // margin: 0 10px;
         & > .iconfont {
           font-size: 25px;
           padding-right: 10px;
@@ -439,7 +419,6 @@ export default {
   }
   .user-bottom {
     @include disFlex(center, space-around);
-    // padding-bottom: 40px;
     .info-list-name {
       color: #bfd4ff;
     }

+ 12 - 2
hdApp/src/utils/util.js

@@ -52,12 +52,22 @@ const imgSubstr = val => {
 	if (isEmpty(val)) return [];
 	if (isArray(val)) {
 		return val.map(e => {
-			let index = e.indexOf("/uploads/");
+
+			if(e.indexOf("?") > -1){
+				e = e.slice(0,e.indexOf("?"))
+			}
+
+			let index = e.indexOf("uploads/");
 			e = e.substring(index);
 			return e;
 		});
 	} else {
-		let index = val.indexOf("/uploads/");
+
+		if(e.indexOf("?") > -1){
+			e = e.slice(0,e.indexOf("?"))
+		}
+
+		let index = val.indexOf("uploads/");
 		return val.substring(index);
 	}
 };