lilei 10 月之前
父节点
当前提交
ad85e35465
共有 7 个文件被更改,包括 90 次插入78 次删除
  1. 2 2
      App.vue
  2. 8 0
      api/user.js
  3. 19 4
      api/video.js
  4. 30 21
      pages/index/index.vue
  5. 11 13
      pages/promo/index.vue
  6. 5 4
      pagesB/coupon.vue
  7. 15 34
      pagesB/promoDetail.vue

+ 2 - 2
App.vue

@@ -1,8 +1,8 @@
 <script>
 	export default {
 		globalData: {
-			// baseUrl: 'http://192.168.2.103:9110/saas/clz/', // 本地
-			baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
+			baseUrl: 'http://192.168.2.113:9110/saas/clz/', // 本地
+			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},
 		onLaunch: function() {

+ 8 - 0
api/user.js

@@ -37,4 +37,12 @@ export const getStore = (token) => {
     url: 'getStore',
     method: 'get'
   })
+}
+// 促销活动优惠券-分页
+export const ticketQueryList = params => {
+  return request({
+    url: `ticket/queryList/${params.pageNo}/${params.pageSize}`,
+    method: 'post',
+    data: params
+  })
 }

+ 19 - 4
api/video.js

@@ -3,9 +3,25 @@ import request from './request';
 // 首页轮播图
 export const promoTerminalList = params => {
   return request({
-    url: `promoTerminal/queryByDealerSn/${params.sn}`,
-    method: 'get',
-    data: ''
+    url: `promoTerminal/queryPublishList`,
+    method: 'post',
+    data: params
+  })
+}
+// 促销活动列表-分页
+export const promoTerminalListByPage = params => {
+  return request({
+    url: `promoTerminal/queryPublishPage/${params.pageNo}/${params.pageSize}`,
+    method: 'post',
+    data: params
+  })
+}
+// 促销活动产品列表-分页
+export const queryPromoProductByPage = params => {
+  return request({
+    url: `promoTerminal/queryPromoProduct/${params.pageNo}/${params.pageSize}`,
+    method: 'post',
+    data: params
   })
 }
 // 活动详情
@@ -13,7 +29,6 @@ export const promoTerminalDetail = params => {
   return request({
     url: `promoTerminal/findBySn/${params.sn}`,
     method: 'get',
-    data: ''
   })
 }
 // 视频列表

+ 30 - 21
pages/index/index.vue

@@ -211,15 +211,11 @@
 				// 价格类型
 				this.getLookUpList('PRICE_SHOW_TYPE', 'vuex_priceTypeList');
 				// 初始化页面
-				this.pageInit()
-				// 查询红包活动
-				this.getRedPacketRule()
-				// 更新用户信息
-				this.getCurrUserInfo()
+				this.pageInit(false)
 			})
 			// 刷新首页数据
 			uni.$on("refashHome",()=>{
-				this.pageInit()
+				this.pageInit(true)
 			})
 		},
 		// 页面卸载
@@ -228,7 +224,7 @@
 		},
 		// 下拉刷新
 		onPullDownRefresh(){
-			this.pageInit()
+			this.pageInit(true)
 			setTimeout(function () {
 				uni.stopPullDownRefresh();
 			}, 1000);
@@ -238,8 +234,6 @@
 			// 用户头像
 			this.avatarUrl = uni.getStorageSync('userPhoto');
 			if(this.hasLogin){
-				// 更新用户信息
-				this.getCurrUserInfo()
 				// 查询门店认证信息
 				if(this.userInfo.sysUserFlag == '0'){
 					this.findLastApply()
@@ -266,18 +260,20 @@
 			// 轮播图片
 			getCarousel(){
 				this.carouselList = []
-				const storeShelf = this.$store.state.vuex_storeShelf
-				promoTerminalList({sn:storeShelf.dealerSn}).then(res => {
+				// 获取所有促销活动数据
+				promoTerminalList({}).then(res => {
 					if(res.status == 200){
 						res.data&&res.data.map(item => {
 							item.image = item.imageSet&&item.imageSet[0] // 默认取第一张图片
 						})
 						// 过滤掉产品促销活动
-						this.carouselList = res.data.filter(item => item.content.indexOf("pages/promo/index") < 0)
+						// this.carouselList = res.data.filter(item => item.content.indexOf("pages/promo/index") < 0)
+						// 所有数据
+						this.carouselList = res.data
 					}
 				})
 			},
-			pageInit(){
+			pageInit(flag){
 				this.carouselList = []
 				if(this.hasLogin){
 					// 获取扫描记录
@@ -285,7 +281,7 @@
 					// 非游客
 					if(this.userInfo.sysUserFlag == '1'){
 						// 查询是否有数字货架
-						this.getStoreShelf()
+						this.getStoreShelf(flag)
 					}else{
 						// 获取扫描次数
 						this.$store.dispatch("getScanNums")
@@ -400,23 +396,28 @@
 					this.status = 'nomore'
 				})
 			},
-			// 查询是否支持数字货架
-			getStoreShelf(){
+			// 查询是否支持数字货架, flag: true 再次刷新,false 首次加载
+			getStoreShelf(flag){
 				findStoreShelf().then(res => {
 						this.$store.state.vuex_storeShelf = res.data;
 						if(res.data){
+							if(!flag){
+								// 更新用户信息
+								this.getCurrUserInfo()
+								// 显示促销模块
+								this.showPromoTab()
+							}
+							
 							// 获取价格权限配置
 							this.getPriceCofig()
 							// 保证金查询
 							this.getShelfBWPayRecord()
 							// 获取订单信息
 							this.shelfGetTotalWaitQty()
-							// 获取轮播数据
+							// 获取轮播数据,包括促销活动
 							this.getCarousel()
-							// 显示促销模块
-							this.showPromoTab()
 						}else{
-							// 隐藏促销模块
+							// 没有数字货架,隐藏促销模块
 							this.hidePromoTab()
 						}
 				})
@@ -453,6 +454,7 @@
 					this.getRedScroll()
 				})
 			},
+			// 红包奖励信息
 			getRedScroll(){
 				getRewardRollList({pageNo:1,pageSize:50}).then(res => {
 					this.slist = res.data || []
@@ -499,7 +501,14 @@
 				}
 				// 链接
 				if(row.contentType == 'LINK'){
-					openWebView({url:row.content})
+					// 货架促销活动
+					if(row.content.indexOf("pagesB/promoDetail") >= 0){
+						uni.navigateTo({
+							url: '/pagesB/promoDetail?promoActiveSn='+row.promoActiveSn+'&title='+row.title
+						 })
+					}else{
+						openWebView({url:row.content})
+					}
 				}
 			},
 			// 选择取货方式

+ 11 - 13
pages/promo/index.vue

@@ -30,7 +30,7 @@
 	    mapState,
 	    mapMutations,
 	} from 'vuex'
-	import { promoTerminalList } from '@/api/video.js'
+	import { promoTerminalListByPage } from '@/api/video.js'
 	export default {
 		data() {
 			return {
@@ -84,21 +84,19 @@
 			  let params = {
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
+				queryWord: this.queryWord
 			  }
 			  const storeShelf = this.$store.state.vuex_storeShelf
 			  this.status = "loading"
-			  promoTerminalList({sn:storeShelf.dealerSn,contentType:'LINK'}).then(res => {
+			  promoTerminalListByPage(params).then(res => {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
-				  // const list = res.data.list || []
-				  // if(_this.pageNo>1){
-					 //  _this.list = _this.list.concat(list)
-				  // }else{
-					 //  _this.list = list
-				  // }
-				  // _this.total = res.data.count || 0
-				  
-				  _this.list = res.data.filter(item => item.content.indexOf("pages/promo/index") >= 0)
-				  _this.total = _this.list.length
+				  const list = res.data.list.filter(item => item.content.indexOf("pagesB/promoDetail") >= 0)
+				  if(_this.pageNo>1){
+					  _this.list = _this.list.concat(list)
+				  }else{
+					  _this.list = list
+				  }
+				  _this.total = res.data.count || 0
 				} else {
 				  _this.list = []
 				  _this.total = 0
@@ -110,7 +108,7 @@
 			// 促销活动产品列表页
 			viewRow(item){
 				 uni.navigateTo({
-				 	url: '/pagesB/promoDetail?id='+item.id+'&title='+item.title
+				 	url: '/pagesB/promoDetail?promoActiveSn='+item.promoActiveSn+'&title='+item.title
 				 })
 			},
 			// 扫描vin

+ 5 - 4
pagesB/coupon.vue

@@ -52,7 +52,7 @@
 
 <script>
 	import carNo from '@/components/carNo.vue'
-	import { getShelfTempBillList, shelfTempTotalWaitQty } from '@/api/shelf.js'
+	import { ticketQueryList } from '@/api/user.js'
 	import moment from 'moment'
 	export default {
 		components: {carNo},
@@ -168,16 +168,17 @@
 			  let params = {
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
+				ticketState: 'UNUSED'
 			  }
 			  // 状态条件
 			  if(this.swiperCurrent == 1){
-				  params.billStateList = ['WAIT_AUDIT','AUDIT_REJECT','WAIT_OUT_WAREHOUSE']
+				  params.ticketState = 'USED'
 			  }
 			  if(this.swiperCurrent == 2){
-				  params.billStateList = ['FINISH']
+				  params.ticketState = 'DATED'
 			  }
 			  this.status = "loading"
-			  getShelfTempBillList(params).then(res => {
+			  ticketQueryList(params).then(res => {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
 				  if(_this.pageNo>1){
 					  _this.list = _this.list.concat(res.data.list || [])

+ 15 - 34
pagesB/promoDetail.vue

@@ -13,12 +13,12 @@
 					>
 						<view class="video-item">
 							<view>
-								<u-image :src="item.images" height="140px" width="100%"></u-image>
+								<u-image :src="item.imageSet[0]" height="140px" width="100%"></u-image>
 								<view class="back-price">返<text>¥15</text></view>
 							</view>
 							<view>
-								<view class="product-name">箭冠轮胎285/70R17LT RT-5900 坦克300、长城炮、牧马人 D</view>
-								<view class="product-guige">285/70R17LT RT-5900</view>
+								<view class="product-name">{{item.name}}</view>
+								<view class="product-guige">{{item.origCode}}</view>
 								<view class="product-button">
 									<view class="price-txt">¥<text>{{item.price}}</text></view>
 									<view>
@@ -86,8 +86,8 @@
 										<view class="back-price">返<text>¥15</text></view>
 									 </view>
 									 <view class="choose-product-item-info">
-										<view class="choose-product-item-left-info-name">箭冠轮胎285/70R17LT RT-5900 坦克300、长城炮、牧马人 D</view>
-										<view class="choose-product-item-left-info-guige">285/70R17LT RT-5900</view>
+										<view class="choose-product-item-left-info-name">{{item.name}}</view>
+										<view class="choose-product-item-left-info-guige">{{item.origCode}}</view>
 										<view class="choose-product-item-left-info-price">
 											<view class="price-txt">¥<text>{{item.price}}</text></view>
 											<view>
@@ -111,7 +111,7 @@
 	    mapState,
 	    mapMutations,
 	} from 'vuex'
-	import { promoTerminalList } from '@/api/video.js'
+	import { queryPromoProductByPage } from '@/api/video.js'
 	export default {
 		data() {
 			return {
@@ -139,7 +139,8 @@
 				showSwipeAction: false, // 已选弹框是否一打开
 				choosePageNo: 1, // 已选产品当前页
 				choosePageSize: 8, // 已选产品每页数
-				chooseTotal: 0 // 已选产品总记录数
+				chooseTotal: 0 ,// 已选产品总记录数
+				promoActiveSn: null
 			}
 		},
 		computed: {
@@ -156,6 +157,7 @@
 			uni.setNavigationBarTitle({
 				title: opts.title||'促销活动产品'
 			})
+			this.promoActiveSn = opts.promoActiveSn
 			this.pageInit()
 		},
 		methods: {
@@ -165,18 +167,7 @@
 				this.total = 0
 				this.pageNo = 1
 				// 获取列表数据
-				// this.getRow()
-				for(let i=0;i<25;i++){
-					this.list.push({
-						id: this.$u.guid(),
-						title: '长安回望绣成堆,山顶千门次第开,一骑红尘妃子笑,无人知是荔枝来',
-						images: 'https://cdn.uviewui.com/uview/common/logo.png',
-						price: Number(Math.random() * 100 + 50).toFixed(2),
-						checked: false,
-						show: false,
-						qty: 1
-					})
-				}
+				this.getRow()
 			},
 			// 添加已选产品
 			chooseProduct(item){
@@ -186,7 +177,6 @@
 					item.show = false
 					this.chooseList.unshift(item)
 				}else{
-					// item.qty = item.qty + 1
 					// 已添加,则增加数量
 					const row = this.chooseList.find(key => key.id == item.id)
 					if(row){row.qty = row.qty + 1}
@@ -253,7 +243,6 @@
 					const row = this.list.find(item => item.id == index)
 					if(row){row.checked = false}
 					const rindex = this.chooseProductList.findIndex(item => item.id == index)
-					console.log(rindex)
 					this.chooseProductList.splice(rindex, 1);
 					this.chooseList.splice(rindex, 1);
 					this.$u.toast(`删除成功!`);
@@ -314,22 +303,14 @@
 			  let params = {
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
-				queryWord: this.queryWord
+				queryWord: this.queryWord,
+				promoActiveSn: this.promoActiveSn
 			  }
-			  const storeShelf = this.$store.state.vuex_storeShelf
 			  this.status = "loading"
-			  promoTerminalList({sn:storeShelf.dealerSn,contentType:'LINK'}).then(res => {
+			  queryPromoProductByPage(params).then(res => {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
-				  // const list = res.data.list || []
-				  // if(_this.pageNo>1){
-					 //  _this.list = _this.list.concat(list)
-				  // }else{
-					 //  _this.list = list
-				  // }
-				  // _this.total = res.data.count || 0
-				  
-				  _this.list = res.data.filter(item => item.content.indexOf("pages/promo/index") >= 0)
-				  _this.total = _this.list.length
+				  _this.list = _this.list.concat(res.data.list||[])
+				  _this.total = res.data.count || 0
 				} else {
 				  _this.list = []
 				  _this.total = 0