浏览代码

Merge branch '绿色开发分支' into 楚楚/2.5.2

xiaohaizhao 10 月之前
父节点
当前提交
4fb55e9a55

+ 2 - 1
packageA/market/detail.js

@@ -36,7 +36,8 @@ Page({
 		this.data.content.sa_itemgroupid = data.sa_itemgroupid;
 		this.setData({
 			userrole: wx.getStorageSync('userrole'),
-			isShowFavorites: wx.getStorageSync('auth').wfavorites ? true : false
+			isShowFavorites: wx.getStorageSync('auth').wfavorites ? true : false,
+			isdisplaysaleqty: wx.getStorageSync('siteP').isdisplaysaleqty
 		})
 		try {
 			let privacyFieldC = wx.getStorageSync('auth').wmarket.forms.wmarket.formcols.map(v => v.title);

+ 16 - 0
packageA/market/detail.scss

@@ -146,6 +146,7 @@ swiper {
     }
 
     .product {
+      position: relative;
       height: 60rpx;
       line-height: 60rpx;
       font-size: 28rpx;
@@ -155,6 +156,21 @@ swiper {
       padding: 0 20rpx;
       background: #F4F5F7;
       border-radius: 16rpx;
+
+      .tag {
+        position: absolute;
+        right: -10rpx;
+        top: -12rpx;
+        background-color: #FF976A;
+        padding: 0 6rpx;
+        border-radius: 4rpx;
+        font-size: 16rpx;
+        color: #fff;
+        box-sizing: border-box;
+        height: 28rpx;
+        line-height: 28rpx;
+        max-width: 104rpx;
+      }
     }
 
     .active {

+ 18 - 3
packageA/market/detail.wxml

@@ -15,7 +15,7 @@
     <view class="title">
         {{detail.itemname}}
         <text wx:if="{{isShowFavorites}}" class="{{detail.iscollection?'cuIcon-favorfill':'cuIcon-favor'}}" style="color:{{detail.iscollection?'#FADB14':''}};padding: 6rpx;" id='addToFavorites' bind:tap="{{'clickBut'}}" />
-        <van-tag type="warning">{{detail.delistingstatus}}</van-tag>
+        <van-tag size='medium' type="warning">{{detail.delistingstatus}}</van-tag>
     </view>
     <view class="tags">
         <text wx:if="{{detail.iscustomsize==1}}" style="background-color: #EE0A24;color: #fff;">定制</text>
@@ -25,6 +25,8 @@
     <view class="offer">
         <view>
             <text class="price">{{handleHide.verify(detail.gradeprice,"详情-当前商品价格",privacyFieldC)}}</text>
+            <text wx:if="{{isdisplaysaleqty}}" style="color: #999;font-size: 22rpx;margin-left: 10rpx;">已售{{(detail.soldbase-0)+(detail.saleqty-0)||0}}{{detail.unitname}}</text>
+
         </view>
         <text class="unit">单位/{{detail.unitname}}</text>
     </view>
@@ -43,10 +45,20 @@
             <view class="product-box">
                 <block wx:for="{{row[it.value+'Rows']}}" wx:key="index">
                     <block wx:if="{{it.isonlydisplay == 1}}">
-                        <navigator wx:if="{{item.flag}}" url="#" class="product {{content[it.value] === item.parm ? 'active' :''}}" bindtap="changeItemno" data-valuename="{{it.value}}" data-value="{{item}}">{{item.parm=='custom'?'自定义':item.parm}}</navigator>
+                        <navigator wx:if="{{item.flag}}" url="#" class="product {{content[it.value] === item.parm ? 'active' :''}}" bindtap="changeItemno" data-valuename="{{it.value}}" data-value="{{item}}">
+                            {{item.parm=='custom'?'自定义':item.parm}}
+                            <view wx:if="{{item.delistingstatus}}" class="tag line-1">
+                                {{item.delistingstatus}}
+                            </view>
+                        </navigator>
                     </block>
                     <block wx:else>
-                        <navigator url="#" class="product {{content[it.value] === item.parm ? 'active' :''}} {{item.flag ? '' : 'disabled'}}" bindtap="changeItemno" data-valuename="{{it.value}}" data-value="{{item}}">{{item.parm=='custom'?'自定义':item.parm}}</navigator>
+                        <navigator url="#" class="product {{content[it.value] === item.parm ? 'active' :''}} {{item.flag ? '' : 'disabled'}}" bindtap="changeItemno" data-valuename="{{it.value}}" data-value="{{item}}">
+                            {{item.parm=='custom'?'自定义':item.parm}}
+                            <view wx:if="{{item.delistingstatus}}" class="tag line-1">
+                                {{item.delistingstatus}}
+                            </view>
+                        </navigator>
                     </block>
                 </block>
             </view>
@@ -95,6 +107,9 @@
             <view class="row">
                 规格:{{detail.standards || ' --'}}
             </view>
+            <view class="row">
+                别名:{{detail.byname || ' --'}}
+            </view>
             <view class="row">
                 特殊说明:<text wx:if="{{detail.specalnote}}" style="color: red;">{{detail.specalnote}}</text><text wx:else> --</text>
             </view>

+ 25 - 2
pages/index/annunciate/index.js

@@ -8,6 +8,9 @@ Component({
     lookItem: null,
     show: false,
     height: 0,
+    countDown: 10,
+    Interval: null,
+    sat_noticeids: [],
   },
   methods: {
     getList() {
@@ -54,6 +57,26 @@ Component({
         lookItem.content = res.data.content;
         lookItem.inquire = true;
         this.data.list[lookItem.rowindex - 1].content = res.data.content;
+
+        if (!this.data.sat_noticeids.some(v => v == res.data.sat_noticeid)) {
+          this.data.sat_noticeids.push(res.data.sat_noticeid)
+          this.setData({
+            countDown: 10
+          })
+          this.data.Interval = setInterval(() => {
+            if (this.data.countDown == 0) {
+              clearInterval(this.data.Interval)
+              this.setData({
+                Interval: null
+              })
+            } else {
+              this.setData({
+                countDown: this.data.countDown - 1
+              })
+            }
+          }, 1000);
+        }
+
         this.setData({
           lookItem
         });
@@ -101,6 +124,7 @@ Component({
       })
     },
     changeLook(e) {
+      if (this.data.countDown != 0) return;
       let lookItem = this.data.lookItem;
       this.rander("")
       switch (e.target.id) {
@@ -119,7 +143,6 @@ Component({
           lookItem.inquire ? this.rander(lookItem.content) : this.getDetail();
           break;
         default:
-          console.log("关闭")
           this.setData({
             show: false
           })
@@ -132,7 +155,7 @@ Component({
       wx.createSelectorQuery().in(this).select('#editor').context(function (res) {
         editor = res.context;
       }).exec()
-      this.getList()
+      // this.getList()
     }
   }
 })

+ 3 - 1
pages/index/annunciate/index.scss

@@ -50,11 +50,13 @@
 		.count {
 			font-size: 28rpx;
 			color: #666;
+			flex: 1;
 		}
 
 		.button-box {
 			display: flex;
-
+			justify-content: flex-end;
+			flex: 1;
 			.button {
 				height: 50rpx;
 			}

+ 8 - 4
pages/index/annunciate/index.wxml

@@ -22,12 +22,16 @@
 			<view class="count">
 				{{lookItem.rowindex}}/{{list.length}}
 			</view>
+			<view wx:if="{{countDown}}" style="text-align: center;font-size: 24rpx;color: #999;">
+				倒计时:{{countDown}}秒
+			</view>
 			<view class="button-box">
-				<van-button custom-class='button' wx:if="{{lookItem.rowindex!=1}}" plain type="info" id='previous' catchtap="changeLook">上一条</van-button>
+				<van-button custom-class='button' wx:if="{{lookItem.rowindex!=1 && !countDown}}" plain type="info" id='previous' catchtap="changeLook">上一条</van-button>
 				<view style="width: 20rpx;" />
-				<van-button wx:if="{{lookItem.rowindex==list.length}}" custom-class='button' plain type="info" catchtap="changeLook">关闭</van-button>
-				<van-button wx:else custom-class='button' plain type="info" id='next' catchtap="changeLook">下一条</van-button>
+				<van-button wx:if="{{lookItem.rowindex==list.length}}" disabled='{{countDown!=0}}' custom-class='button' plain type="info" catchtap="changeLook">关闭</van-button>
+				<van-button wx:else custom-class='button' disabled='{{countDown!=0}}' plain type="info" id='next' catchtap="changeLook">下一条</van-button>
 			</view>
 		</view>
 	</view>
-</van-popup>
+</van-popup>
+<!-- {{countDown?countDown+'s':'下一条'}} -->

+ 8 - 48
pages/index/index.js

@@ -74,6 +74,7 @@ Page({
 		})
 	},
 	onShow() {
+		this.selectComponent('#Annunciate').getList();
 		// if (wx.getAccountInfoSync().miniProgram.envVersion !== 'release') this.refreshData();
 	},
 	/**
@@ -90,58 +91,11 @@ Page({
 		if (page && wx.getStorageSync('userauth').length != 0) {
 			let authList = {},
 				entrance = [{
-					label: "营销工具",
-					icon: "work-yingxiaogongju",
-					appid: "wx7505ddb0a1ec6146",
-					list: gettool()
-				}, {
 					label: "E-订单",
 					appid: "wx7505ddb0a1ec6146",
 					icon: "work-E-dingdan",
 					list: getedd()
 				}];
-			//营销工具
-			function gettool() {
-				const paths = [{
-					name: "通告",
-					path: "/marketing/annunciate/index",
-					icon: "work-a-shouyejingangqutonggao",
-					objectname: "sat_notice"
-				}, {
-					name: "营销物料",
-					path: "/marketing/mediaLibrary/index",
-					icon: "work-a-shouyejingangquyingxiaowuliao",
-					objectname: "sys_attachment"
-				}, {
-					name: "推广素材",
-					path: "/marketing/promotional/index",
-					icon: "work-a-shouyejingangqutuiguangsucai",
-					objectname: "sat_sharematerial"
-				}, {
-					name: "商学院",
-					path: "/marketing/college/index",
-					icon: "work-a-shangxueyuanxuexi",
-					objectname: "sat_courseware"
-				}, {
-					name: "提报",
-					path: "/marketing/submission/index",
-					icon: "work-a-tibaoguanlitibao",
-					objectname: "sat_submiteditmodel"
-				}];
-				let tool = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], paths.map(v => v.name)),
-					list = [];
-				tool.forEach(v => {
-					let auth = v.apps[0].meta.auth;
-					if (!auth.some(r => r.option == 'read')) return;
-					authList[v.apps[0].name] = {
-						options: auth.map(a => a.option),
-						optionnames: auth.map(a => a.optionname)
-					};
-					let item = paths.find(s => s.name == v.systemmodulename);
-					item && list.push(item)
-				});
-				return dye(list.sort((a, b) => a.index - b.index))
-			};
 			//E订单
 			function getedd() {
 				let paths = [{
@@ -209,8 +163,13 @@ Page({
 					key: "wfavorites",
 					path: "/packageA/favorites/index",
 					icon: "work-webshoucang"
+				}, {
+					name: "通告",
+					path: "/marketing/annunciate/index",
+					icon: "work-a-shouyejingangqutonggao",
+					objectname: "sat_notice"
 				}];
-				let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货管理", "业绩查询"]),
+				let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货管理", "业绩查询", '消息中心']).concat(getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["通用"], ['消息中心'])),
 					list = [];
 				edd.forEach(v => {
 					v.apps.forEach(s => {
@@ -378,6 +337,7 @@ Page({
 	 */
 	async NavChange(e) {
 		let cur = e.currentTarget.dataset.cur;
+		if (cur == 'Home') this.selectComponent('#Annunciate').getList();
 		if (this.data.PageCur == cur) return;
 		if (cur == 'Market' || cur == 'Collect') {
 			let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案"])[0].apps

+ 1 - 1
pages/index/index.wxml

@@ -17,7 +17,7 @@
 <view hidden="{{PageCur!='UserCenter'}}">
 	<UserCenter id='UserCenter' />
 </view>
-<Annunciate />
+<Annunciate id="Annunciate" />
 
 <view class="cu-bar tabbar bg-white foot">
 	<view class="action {{PageCur=='Home'?'text-blue':'text-gray'}}" bindtap="NavChange" data-cur="Home">

+ 7 - 1
pages/index/market/index.js

@@ -148,12 +148,18 @@ Component({
       wx.showLoading({
         title: '搜索中...',
       })
+      this.setData({
+        'condition': detail
+      })
       this.getList(true)
     },
     onChange({
       detail
     }) {
-      content.where.condition = detail;
+      content.where.condition = detail
+      this.setData({
+        'condition': detail
+      })
     },
     /* 获取领域 */
     getTradefie() {

+ 2 - 1
pages/index/market/index.wxml

@@ -1,5 +1,6 @@
 <van-search use-action-slot placeholder='请输入搜索关键词' shape='round' bind:change='onChange' bind:search="onSearch" bind:clear="onSearch">
-	<view style="padding: 0 10rpx;" slot="action" bind:tap="openPopup">筛选</view>
+	<!-- <view style="padding: 0 10rpx;" slot="action" bind:tap="openPopup">筛选</view> -->
+	<view wx:if="{{condition}}" style="padding: 0 10rpx;" slot="action" bind:tap="getList">搜索</view>
 </van-search>
 <Tabs active='0' id="tradefieList" list="{{tradefieList}}" wx:if="{{tradefieList.length>1}}" box-class='brand-box' tab-class='brand-tab-class' active-class='brand-active-class' name='tradefield' bind:onChange="tradefieChange" />
 <Tabs wx:for="{{itemClasss}}" id='class{{index}}' rowIndex='{{index}}' wx:key="{{item.rowindex}}" list="{{item}}" box-class='brand-box' tab-class='brand-tab-class' active-class='brand-active-class' name='itemclassname' bind:onChange="itemClasssChange" />

+ 3 - 0
pages/index/market/modules/list/index.js

@@ -20,6 +20,9 @@ Component({
   },
   lifetimes: {
     attached: function () {
+      this.setData({
+        isdisplaysaleqty:wx.getStorageSync('siteP').isdisplaysaleqty
+      })
       setTimeout(() => {
         try {
           const {

+ 6 - 3
pages/index/market/modules/list/index.wxml

@@ -7,20 +7,23 @@
 	</view>
 	<view class="right-box">
 		<view class="title line-1">{{item.groupname||'--'}}</view>
-		<view class="tags">
+		<!-- 	<view class="tags">
 			<view style="background: #FA8C16;">
 				{{item.brandname}}
 			</view>
 			<view wx:if="{{item.tradefield}}" style="background: #FF3B30;">
 				{{item.tradefield}}
 			</view>
-		</view>
+		</view> -->
 		<view class="type line-1">
 			型号:{{item.item[0].model || ' --'}}
 		</view>
 		<view class="type line-1">
 			规格:{{item.item[0].standards || ' --'}}
 		</view>
+		<view class="type line-1">
+			别名:{{item.item[0].byname||' --'}}
+		</view>
 		<view class="type line-1">
 			包装数量:{{item.item[0].packageqty || '0'}}
 		</view>
@@ -32,7 +35,7 @@
 				<view class="view" wx:else>
 					¥ {{handleHide.verify((item.minprice+'~'+item.maxprice),'列表价格',privacyFieldC)}}
 				</view>
-				<view class="punit" {{item.unitname}}</view>
+				<view class="punit" wx:if="{{isdisplaysaleqty}}">已售{{((item.item[0].soldbase-0)+(item.item[0].saleqty-0))||0}}{{item.unitname}}</view>
 			</view>
 			<view wx:if="{{!item.isscheme}}" class="shopping" data-item="{{item}}" data-index="{{index}}" catchtap="buyMore">
 				<view hover-class="navigator-hover" wx:if="{{isShowFavorites}}" url="#" data-name="收藏" class="{{item.item[0].iscollection?'cuIcon-favorfill':'cuIcon-favor'}} cuIcon" style="color:{{item.item[0].iscollection?'#FADB14':''}}" />