Browse Source

上传提示语

shish 3 years ago
parent
commit
097a2754d5

+ 1 - 1
ghsApp/src/admin/item/xjSelect.vue

@@ -17,7 +17,7 @@
 		<div class="module-com input-line-wrap goods-wrap">
 			<div class="module-tit">
 			<span>选择图片</span>
-			<span class="app-color-3">(每次最多可选9张上传)</span>
+			<span class="app-color-3">(支持多次上传,每次最多可选9张)</span>
 			</div>
 			<div class="module-det">
 			<htz-image-upload :max="9" :compress="true" v-model="xjImgData" :headers="headers"

+ 2 - 4
hdApp/src/admin/ghsProduct/components/buy-foot.vue

@@ -11,8 +11,7 @@
             </div>
         </div>
         <div class="btn-right">
-            <button v-if="isShare" class="button-com red" @click="$msg('开发中')">立即购买</button>
-            <button v-else class="button-com red" @click="goBack">购买</button>
+            <button class="button-com red" @click="buy()">购买</button>
         </div>
     </div>
 </template>
@@ -39,7 +38,6 @@ export default {
 	}
 }
 </script>
-
 <style lang="scss" scoped>
 .app-footer {
     @include disFlex(center, space-between);
@@ -65,4 +63,4 @@ export default {
         }
     }
 }
-</style>
+</style>

+ 22 - 58
hdApp/src/admin/ghsProduct/components/sel-popup.vue

@@ -1,41 +1,18 @@
 <template>
   <div class="sel-popup">
-    <bottom-popup class="popup-wrap" :show="show" @close="close">
-      <app-close @close="close" />
+    <bottom-popup class="popup-wrap" :show="show" @close="close()">
+      <app-close @close="close()" />
       <div class="tui-popup-box">
         <div class="tui-product-box">
-          <template v-if="info.goodsStyle == 1">
-              <img :src="info.goodsStyleList[selIndex].img" class="tui-popup-img" />
-          </template>
-          <template v-else>
-              <img :src="imgNormal" class="tui-popup-img" />
-          </template>
-          <div class="tui-popup-price" v-if="!$util.isEmpty(info.goodsStyleList)">
-            <div
-              class="goods-tit app-bold app-font-size-30"
-            >{{ info.goodsStyleList[selIndex].styleName }}</div>
-            <div class="tui-amount tui-bold">¥{{ info.goodsStyleList[selIndex].price }}</div>
-          </div>
-          <div class="tui-popup-price" v-else>
-            <div class="goods-tit app-bold app-font-size-30">{{ info.name }}</div>
-            <div class="tui-amount tui-bold">¥{{ info.price }}</div>
+          <img :src="imgNormal" class="tui-popup-img" />
+          <div class="tui-popup-price">
+            <div class="goods-tit app-bold">{{ info.name }}</div>
+            <div class="tui-amount tui-bold">¥{{ info.price?parseFloat(info.price):0 }}</div>
+            <text style="position:absolute;top:70upx;color:#333333;width:400upx;">剩{{info.stock ? parseFloat(info.stock) : 0 }}{{info.bigUnit}}</text>
           </div>
         </div>
         <scroll-view scroll-y class="tui-popup-scroll">
           <div class="tui-scrolldiv-box">
-            <template v-if="$util.isEmpty(info.goodsStyleList) == false">
-              <div class="tui-bold tui-attr-title">款式</div>
-              <div class="tui-attr-box">
-                <div
-                  class="tui-attr-item"
-                  :class="{'tui-attr-active': selIndex == index}"
-                  v-for="(item, index) in info.goodsStyleList"
-                  :key="index"
-                  @click="changeStyleFn(index)"
-                >{{ item.styleName }}</div>
-              </div>
-            </template>
-
             <div class="tui-number-box tui-bold tui-attr-title">
               <div class="tui-attr-title">数量</div>
               <number-box :max="maxStock" :min="1" :value="buyNum" @change="change"></number-box>
@@ -49,7 +26,6 @@
     </bottom-popup>
   </div>
 </template>
-
 <script>
 import BottomPopup from "@/components/plugin/bottom-popup";
 import NumberBox from "@/components/plugin/number-box";
@@ -62,7 +38,6 @@ export default {
     AppClose
   },
   props: {
-    // 信息
     info: {
       type: Object,
       default: () => {
@@ -85,14 +60,10 @@ export default {
   },
   computed: {
     imgNormal() {
-      if (!this.$util.isEmpty(this.info)) {
-        return this.info.smallImgList[0];
-      } else {
-        return "";
-      }
+      return this.info.cover
     },
     maxStock() {
-      return this.info.stock == -1 ? 99999 : this.info.stock;
+      return 99999
     }
   },
   methods: {
@@ -100,27 +71,18 @@ export default {
       this.$emit("change", e);
     },
     close() {
-
-
-      this.$emit("close");
-    },
-    changeStyleFn(index) {
-      this.selIndex = index;
+      this.$emit("close")
     },
     nextFn() {
-      uni.setStorageSync("buyGoodsDetil", this.info);
-      this.$util.pageTo({
-        url: "/pages/order/buy",
-        type: 2,
-        query: {
-          goodsId: this.info.id,
-          goodsStyleId: this.$util.isEmpty(this.info.goodsStyleList)
-            ? ""
-            : this.info.goodsStyleList[this.selIndex].id,
-          goodsNum: this.buyNum,
-          selIndex: this.selIndex
-        }
-      });
+      if(Number(this.info.price) <= 0){
+        this.$msg('没有价格,暂时无法下单')
+        return false
+      }
+      if(Number(this.buyNum) > Number(this.info.stock)){
+        this.$msg('不足'+this.buyNum+this.info.bigUnit)
+        return false
+      }
+      this.$emit("nextFn",this.buyNum);
     }
   }
 };
@@ -171,14 +133,16 @@ export default {
   .tui-popup-price {
     padding-left: 20upx;
     padding-bottom: 8upx;
+    position:relative;
     .goods-tit {
       margin-bottom: 75upx;
+      font-size: 36upx;
     }
   }
 
   .tui-amount {
     color: #ff201f;
-    font-size: 36upx;
+    font-size: 34upx;
   }
 
   .tui-popup-scroll {

+ 44 - 32
hdApp/src/admin/ghsProduct/detail.vue

@@ -1,42 +1,52 @@
 <template>
-  <div class="app-content">
+  <view class="app-content">
     <app-swiper :height="{type: 'number',val: 750}" :tagShow="true" :list="imgList" />
-    <div class="shop-intro">
-      <div class="app-price app-bold">
-        <text class="app-size-34">¥{{ productInfo.price }}</text>
-      </div>
-      <div class="tui-pro-titbox">
-        <div class="tui-pro-title app-size-32">{{ productInfo.discountPrice > 0 ? '【特价】'+productInfo.name : productInfo.name }}</div>
+    <view class="shop-intro">
+      <view class="app-price app-bold">
+        <text class="app-size-34">¥{{ productInfo.price?parseFloat(productInfo.price):0 }}</text>
+      </view>
+      <view class="tui-pro-titbox">
+        <view class="tui-pro-title app-size-32">
+          <text v-if="productInfo.presell == 1">【预售】</text>
+          <text v-if="Number(productInfo.discountPrice) > 0">【特价】</text>
+          {{ productInfo.name}}
+        </view>
         <button open-type="share" class="tui-share-btn tui-share-position" >
           <app-tag type="gray" tui-tag-class="tui-tag-share tui-size" shape="circleLeft" size="small" >
-            <div class="flex-center">
+            <view class="flex-center">
               <i class="iconfont iconfenxiang"></i>
               <text class="tui-share-text tui-gray">分享</text>
-            </div>
+            </view>
           </app-tag>
         </button>
-      </div>
-    </div>
-
-    <div class="module-wrap shop-detail">
-      <div class="module-tit app-size-30">商品详情</div>
-      <div class="module-det">
-        <div class="module-det-text">
+      </view>
+      <view class="shop-express app-color-3" v-if="productInfo.presell == 1">
+        <view>
+          到货日期:
+          <block v-if="!$util.isEmpty(productInfo.presellDateShow)">
+            <text v-for="(dateItem, dateIndex) in productInfo.presellDateShow" :key="dateIndex" style="">{{dateItem}}<text v-if="dateIndex!=productInfo.presellDateShow.length-1">,</text></text>
+          </block>
+        </view>
+      </view>
+    </view>
+    <view class="module-wrap shop-detail">
+      <view class="module-tit app-size-30">商品详情</view>
+      <view class="module-det">
+        <view class="module-det-text">
           <template v-if="$util.isEmpty(productInfo.content) == false">
             <rich-text :nodes="productInfo.content"></rich-text>
           </template>
           <template v-else>
             <rich-text :nodes="productInfo.briefContent"></rich-text>
           </template>
-        </div>
-      </div>
-    </div>
-
-    <buy-foot :isShare="isShare" />
+        </view>
+      </view>
+    </view>
+    <buy-foot @buy="showPopup" />
+    <sel-popup :show="popupShow" :info="productInfo" :buyNum="buyNum" @change="changeNum" @close="hidePopup" @nextFn="nextFn" />
     <app-share-mask :show="showShare" text="分享商品" @click="hideShare" />
-  </div>
+  </view>
 </template>
-
 <script>
 import AppImg from "@/components/app-img";
 import AppSwiper from "@/components/app-swiper";
@@ -48,9 +58,10 @@ import { share } from "@/mixins";
 import { mapGetters } from "vuex";
 import { getGhsProductDetail } from "@/api/product";
 import { ghsInfo,getGhsDataApi } from "@/api/ghs/index";
+import productMins from "@/mixins/cgProduct";
 export default {
-  name: "product-detail",
-  mixins: [share],
+  name: "detail",
+  mixins: [share,productMins],
   components: {
     AppSwiper,
     AppTag,
@@ -67,7 +78,8 @@ export default {
       popupShow: false,
       loginShow: false,
       showShare: false,
-      isShare:true
+      isShare:true,
+			pageType: "cg"
     };
   },
   onLoad(option) {},
@@ -76,6 +88,11 @@ export default {
     ...mapGetters({ shopUser: "getShopUser" })
   },
   methods: {
+    nextFn(num){
+      let customData = {...this.productInfo,bigCount: Number(num),smallCount:0,itemPrice:this.productInfo.price,bigPrice:this.productInfo.price,smallPrice:0}
+      this.addItemEvent(customData)
+      this.$util.pageTo({url:"/admin/billing/affirmGhs?id="+this.option.ghsId,type:2})
+    },
     init() {
         let that = this
 
@@ -128,7 +145,6 @@ export default {
             }
           })
     },
-    // 更换数量
     changeNum(e) {
       this.buyNum = e.value;
     },
@@ -137,11 +153,7 @@ export default {
       this.$util.pageTo({url: '/pages/home/shop',type: 4,query: {account: account}})
     },
     showPopup() {
-      if (this.$util.isLogin()) {
-        this.popupShow = true;
-      } else {
-        this.loginShow = true;
-      }
+        this.popupShow = true
     },
     hidePopup() {
       this.popupShow = false;

+ 1 - 0
hdApp/src/components/module/app-close.vue

@@ -30,5 +30,6 @@ export default {
 	color: $fontColor3;
 	background-color: #fff;
 	padding: 20upx;
+	z-index:9999;
 }
 </style>

+ 45 - 9
hdApp/src/mixins/cgProduct.js

@@ -191,8 +191,15 @@ export default {
 		rememberProduct(){
 			//采购或预订的记忆花材
 			if(this.pageType == 'cg' || this.pageType == 'bookCg' ){
+				let ghsId = 0
+				if(this.option.ghsId){
+					ghsId = Number(this.option.ghsId)
+				}
+				if(ghsId == 0 && this.option.id){
+					ghsId = Number(this.option.id)
+				}
 				if(!this.$util.isEmpty(this.option.id)){
-					uni.setStorageSync('selectList'+this.pageType+'_ghs_'+this.option.id, this.selectList)
+					uni.setStorageSync('selectList'+this.pageType+'_ghs_'+ghsId, this.selectList)
 				}
 			}else{
 				uni.setStorageSync('selectList'+this.pageType, this.selectList)
@@ -725,21 +732,52 @@ export default {
 			}
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 		},
+		addItemEvent(item) {
+			const list = this.selectList;
+			if(!this.$util.isEmpty(list)){
+				let hasItem = false
+				for (let index = 0; index < list.length; index++) {
+					const element = list[index];
+					if (element.id == item.id && element.classId == item.classId) {
+						hasItem = true
+						const { bigCount, smallCount } = list[index];
+						const ratio = Number(item.ratio);
+						if (this.isLimit) {
+							if ( Number(bigCount) * ratio + Number(smallCount) > Number(item.bigNum) * ratio + Number(item.smallNum) ) {
+								list[index].bigCount = Number(item.bigNum);
+								list[index].smallCount = Number(item.smallNum);
+								list[index].itemPrice = item.itemPrice?Number(item.itemPrice):'';
+							}
+						}
+						list[index] = {
+							...element,
+							bigCount: Number(item.bigCount),
+							smallCount: Number(item.smallCount),
+							itemPrice: item.itemPrice?Number(item.itemPrice):''
+						};
+						break;
+					}
+				}
+				if(hasItem == false){
+					list.push(item)
+				}
+			}else{
+				list.push(item)
+			}
+			this.setSelectInfoByType({ type: this.pageType, info: list });
+			//记忆已经选择的花材
+			this.rememberProduct()
+		},
 		//更新商品
 		updateItemEvent(item) {
 			const list = this.selectList;
-
 			for (let index = 0; index < list.length; index++) {
 				const element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					const { bigCount, smallCount } = list[index];
-					//超过库存时 设置为库存最大值
 					const ratio = Number(item.ratio);
 					if (this.isLimit) {
-						if (
-							Number(bigCount) * ratio + Number(smallCount) >
-							Number(item.bigNum) * ratio + Number(item.smallNum)
-						) {
+						if ( Number(bigCount) * ratio + Number(smallCount) > Number(item.bigNum) * ratio + Number(item.smallNum) ) {
 							list[index].bigCount = Number(item.bigNum);
 							list[index].smallCount = Number(item.smallNum);
 							list[index].itemPrice = item.itemPrice?Number(item.itemPrice):'';
@@ -755,10 +793,8 @@ export default {
 				}
 			}
 			this.setSelectInfoByType({ type: this.pageType, info: list });
-
 			//记忆已经选择的花材
 			this.rememberProduct()
-
 		},
 		//切换左侧商品类别
 		swichClass(cur) {

+ 1 - 5
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -635,12 +635,8 @@ export default {
 
 				const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
 				const ratioNum = Number(ratio);
-				//超过库存时 设置为库存最大值 1
 				if (Number(bigCount) * ratioNum + Number(smallCount) > Number(bigNum) * ratioNum + Number(smallNum)) {
-					uni.showToast({
-						title: '库存还剩'+bigNum,
-						icon: "none"
-					});
+					uni.showToast({ title: '库存还剩'+bigNum, icon: "none" })
 				} else {
 					this.updateItemEvent(this.customData)
 					this.modalCancel()

+ 1 - 1
mallApp/src/pages/item/components/sel-popup.vue

@@ -10,7 +10,7 @@
           <view class="tui-popup-price">
             <view class="goods-tit app-bold">{{ info.name }}</view>
             <view class="tui-amount tui-bold">¥{{ info.skPrice?parseFloat(info.skPrice):0 }}</view>
-            <text style="position:absolute;top:70upx;color:#333333;width:300upx;">剩{{info.stock ? parseFloat(info.stock) : 0 }}{{info.bigUnit}}</text>
+            <text style="position:absolute;top:70upx;color:#333333;width:400upx;">剩{{info.stock ? parseFloat(info.stock) : 0 }}{{info.bigUnit}}</text>
           </view>
         </view>
         <scroll-view scroll-y class="tui-popup-scroll">